pax_global_header00006660000000000000000000000064137717130620014521gustar00rootroot0000000000000052 comment=e410efd8c85f3dbbd9cbc262684ab74b3f2755fb packer-1.6.6+ds1/000077500000000000000000000000001377171306200134635ustar00rootroot00000000000000packer-1.6.6+ds1/.circleci/000077500000000000000000000000001377171306200153165ustar00rootroot00000000000000packer-1.6.6+ds1/.circleci/config.yml000066400000000000000000000150351377171306200173120ustar00rootroot00000000000000orbs: win: circleci/windows@1.0.0 codecov: codecov/codecov@1.0.5 version: 2.1 executors: golang: docker: - image: docker.mirror.hashicorp.services/circleci/golang:1.15 resource_class: medium+ darwin: macos: xcode: "12.0.0" commands: install-go-run-tests-unix: parameters: GOOS: type: string GOVERSION: type: string steps: - checkout - run: curl https://dl.google.com/go/go<< parameters.GOVERSION >>.<< parameters.GOOS >>-amd64.tar.gz | tar -C ~/ -xz - run: ~/go/bin/go test ./... -coverprofile=coverage.txt -covermode=atomic install-go-run-tests-windows: parameters: GOVERSION: type: string steps: - checkout - run: curl https://dl.google.com/go/go<< parameters.GOVERSION >>.windows-amd64.zip --output ~/go<< parameters.GOVERSION >>.windows-amd64.zip - run: unzip ~/go<< parameters.GOVERSION >>.windows-amd64.zip -d ~/ - run: ~/go/bin/go test ./... -coverprofile=coverage.txt -covermode=atomic build-and-persist-packer-binary: parameters: GOOS: type: string steps: - checkout - run: GOOS=<< parameters.GOOS >> go build -ldflags="-s -w -X github.com/hashicorp/packer/version.GitCommit=${CIRCLE_SHA1}" -o ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH) . - run: zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH).zip ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH) - run: rm ./pkg/packer_<< parameters.GOOS >>_$(go env GOARCH) - persist_to_workspace: root: . paths: - ./pkg/ # Golang CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-go/ for more details jobs: test-linux: executor: golang resource_class: large working_directory: /go/src/github.com/hashicorp/packer steps: - checkout - run: TESTARGS="-coverprofile=coverage.txt -covermode=atomic" make ci - codecov/upload: file: coverage.txt test-darwin: executor: darwin working_directory: ~/go/src/github.com/hashicorp/packer environment: GO111MODULE: "off" steps: - install-go-run-tests-unix: GOOS: darwin GOVERSION: "1.15" - codecov/upload: file: coverage.txt test-windows: executor: name: win/vs2019 shell: bash.exe steps: - install-go-run-tests-windows: GOVERSION: "1.15" - codecov/upload: file: coverage.txt check-lint: executor: golang resource_class: xlarge steps: - checkout - run: git fetch --all - run: command: make ci-lint no_output_timeout: 30m check-vendor-vs-mod: executor: golang working_directory: /go/src/github.com/hashicorp/packer environment: GO111MODULE: "off" steps: - checkout - run: GO111MODULE=on go run . --help - run: make check-vendor-vs-mod check-fmt: executor: golang steps: - checkout - run: make fmt-check check-generate: executor: golang working_directory: /go/src/github.com/hashicorp/packer steps: - checkout - run: make generate-check build_linux: executor: golang steps: - build-and-persist-packer-binary: GOOS: linux build_windows: executor: golang working_directory: /go/src/github.com/hashicorp/packer steps: - build-and-persist-packer-binary: GOOS: windows build_darwin: executor: golang working_directory: /go/src/github.com/hashicorp/packer steps: - build-and-persist-packer-binary: GOOS: darwin build_freebsd: executor: golang working_directory: /go/src/github.com/hashicorp/packer steps: - build-and-persist-packer-binary: GOOS: freebsd build_solaris: executor: golang working_directory: /go/src/github.com/hashicorp/packer steps: - build-and-persist-packer-binary: GOOS: solaris build_openbsd: executor: golang working_directory: /go/src/github.com/hashicorp/packer steps: - build-and-persist-packer-binary: GOOS: openbsd store_artifacts: executor: golang steps: - attach_workspace: at: . - store_artifacts: path: ./pkg/ destination: / build-website-docker-image: docker: - image: docker.mirror.hashicorp.services/circleci/buildpack-deps shell: /usr/bin/env bash -euo pipefail -c steps: - checkout - setup_remote_docker - run: name: Build Docker Image if Necessary command: | IMAGE_TAG=$(cat website/Dockerfile website/package-lock.json | sha256sum | awk '{print $1;}') echo "Using $IMAGE_TAG" if curl https://hub.docker.com/v2/repositories/hashicorp/packer-website/tags/$IMAGE_TAG -fsL > /dev/null; then echo "Dependencies have not changed, not building a new website docker image." else cd website/ docker login -u $WEBSITE_DOCKER_USER -p $WEBSITE_DOCKER_PASS docker build -t hashicorp/packer-website:$IMAGE_TAG . docker tag hashicorp/packer-website:$IMAGE_TAG hashicorp/packer-website:latest docker push hashicorp/packer-website fi algolia-index: docker: - image: docker.mirror.hashicorp.services/node:12 steps: - checkout - run: name: Push content to Algolia Index command: | if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/packer.git" ]; then echo "Not Packer OSS Repo, not indexing Algolia" exit 0 fi cd website/ npm install node scripts/index_search_content.js workflows: version: 2 test: jobs: - test-linux - test-darwin - test-windows check-code: jobs: - check-lint - check-vendor-vs-mod - check-fmt - check-generate build_packer_binaries: jobs: - build_linux - build_darwin - build_windows - build_freebsd - build_openbsd - build_solaris - store_artifacts: requires: - build_linux - build_darwin - build_windows - build_freebsd - build_openbsd - build_solaris website: jobs: - build-website-docker-image: filters: branches: only: - master - algolia-index: filters: branches: only: - stable-website packer-1.6.6+ds1/.codecov.yml000066400000000000000000000010771377171306200157130ustar00rootroot00000000000000comment: layout: "flags, files" behavior: default require_changes: true # only comment on changes in coverage require_base: yes # [yes :: must have a base report to post] require_head: yes # [yes :: must have a head report to post] after_n_builds: 3 # wait for all OS test coverage builds to post comment branches: # branch names that can post comment - "master" coverage: status: project: off patch: off ignore: # ignore hcl2spec generated code for coverage and mocks - "**/*.hcl2spec.go" - "**/*_mock.go"packer-1.6.6+ds1/.gitattributes000066400000000000000000000003431377171306200163560ustar00rootroot00000000000000* text=auto *.go text eol=lf *.sh text eol=lf *.json text eol=lf *.md text eol=lf *.mdx text eol=lf *.ps1 text eol=lf *.hcl text eol=lf *.txt text eol=lf go.mod text eol=lf go.sum text eol=lf common/test-fixtures/root/* eol=lf packer-1.6.6+ds1/.github/000077500000000000000000000000001377171306200150235ustar00rootroot00000000000000packer-1.6.6+ds1/.github/CONTRIBUTING.md000066400000000000000000000572541377171306200172710ustar00rootroot00000000000000# Contributing to Packer **First:** if you're unsure or afraid of _anything_, just ask or submit the issue or pull request anyway. You won't be yelled at for giving your best effort. The worst that can happen is that you'll be politely asked to change something. We appreciate any sort of contributions, and don't want a wall of rules to get in the way of that. However, for those individuals who want a bit more guidance on the best way to contribute to the project, read on. This document will cover what we're looking for. By addressing all the points we're looking for, it raises the chances we can quickly merge or address your contributions. ## Issues ### Reporting an Issue - Make sure you test against the latest released version. It is possible we already fixed the bug you're experiencing. - Run the command with debug output with the environment variable `PACKER_LOG`. For example: `PACKER_LOG=1 packer build template.json`. Take the _entire_ output and create a [gist](https://gist.github.com) for linking to in your issue. Packer should strip sensitive keys from the output, but take a look through just in case. - Provide a reproducible test case. If a contributor can't reproduce an issue, then it dramatically lowers the chances it'll get fixed. And in some cases, the issue will eventually be closed. - Respond promptly to any questions made by the Packer team to your issue. Stale issues will be closed. ### Issue Lifecycle 1. The issue is reported. 2. The issue is verified and categorized by a Packer collaborator. Categorization is done via tags. For example, bugs are marked as "bugs" and simple fixes are marked as "good first issue". 3. Unless it is critical, the issue is left for a period of time (sometimes many weeks), giving outside contributors a chance to address the issue. 4. The issue is addressed in a pull request or commit. The issue will be referenced in the commit message so that the code that fixes it is clearly linked. 5. Sometimes, if you have a specialized environment or use case, the maintainers may ask for your help testing the patch. You are able to download an experimental binary of Packer containing the Pull Request's patch via from the Pull Request page on github. You can do this by scrolling to the "checks" section on github, and clicking "details" on the "store_artifacts" check. This will take you to Packer's Circle CI page for the build, and you will be able to click a tab named "Artifacts" which will contain zipped Packer binaries for each major OS architecture. 6. The issue is closed. ## Setting up Go If you have never worked with Go before, you will have to install its runtime in order to build packer. 1. This project always releases from the latest version of golang. [Install go](https://golang.org/doc/install#install) ## Setting up Packer for dev If/when you have go installed you can already `go get` packer and `make` in order to compile and test Packer. These instructions target POSIX-like environments (macOS, Linux, Cygwin, etc.) so you may need to adjust them for Windows or other shells. The instructions below are for go 1.7. or later. 1. Download the Packer source (and its dependencies) by running `go get github.com/hashicorp/packer`. This will download the Packer source to `$GOPATH/src/github.com/hashicorp/packer`. 2. When working on Packer, first `cd $GOPATH/src/github.com/hashicorp/packer` so you can run `make` and easily access other files. Run `make help` to get information about make targets. 3. Make your changes to the Packer source. You can run `make` in `$GOPATH/src/github.com/hashicorp/packer` to run tests and build the Packer binary. Any compilation errors will be shown when the binaries are rebuilding. If you don't have `make` you can simply run `go build -o bin/packer .` from the project root. 4. After running building Packer successfully, use `$GOPATH/src/github.com/hashicorp/packer/bin/packer` to build a machine and verify your changes work. For instance: `$GOPATH/src/github.com/hashicorp/packer/bin/packer build template.json`. 5. If everything works well and the tests pass, run `go fmt` on your code before submitting a pull-request. ### Windows Systems On windows systems you need at least the [MinGW Tools](http://www.mingw.org/), e.g. install via [choco](https://chocolatey.org/): ``` choco install mingw -y ``` This installs the GCC compiler, as well as a `mingw32-make` which can be used wherever this documentation mentions `make` when building using `go` you also need to mention the windows executable extension ``` go build -o bin/packer.exe ``` ### Opening an Pull Request Thank you for contributing! When you are ready to open a pull-request, you will need to [fork Packer](https://github.com/hashicorp/packer#fork-destination-box), push your changes to your fork, and then open a pull-request. For example, my github username is `cbednarski`, so I would do the following: ``` git checkout -b f-my-feature # Develop a patch. git push https://github.com/cbednarski/Packer f-my-feature ``` From there, open your fork in your browser to open a new pull-request. **Note:** Go infers package names from their file paths. This means `go build` will break if you `git clone` your fork instead of using `go get` on the main Packer project. **Note:** See '[Working with forks](https://help.github.com/articles/working-with-forks/)' for a better way to use `git push ...`. ### Pull Request Lifecycle 1. You are welcome to submit your pull request for commentary or review before it is fully completed. Please prefix the title of your pull request with "[WIP]" to indicate this. It's also a good idea to include specific questions or items you'd like feedback on. 2. Once you believe your pull request is ready to be merged, you can remove any "[WIP]" prefix from the title and a core team member will review. 3. One of Packer's core team members will look over your contribution and either merge, or provide comments letting you know if there is anything left to do. We do our best to provide feedback in a timely manner, but it may take some time for us to respond. We may also have questions that we need answered about the code, either because something doesn't make sense to us or because we want to understand your thought process. 4. If we have requested changes, you can either make those changes or, if you disagree with the suggested changes, we can have a conversation about our reasoning and agree on a path forward. This may be a multi-step process. Our view is that pull requests are a chance to collaborate, and we welcome conversations about how to do things better. It is the contributor's responsibility to address any changes requested. While reviewers are happy to give guidance, it is unsustainable for us to perform the coding work necessary to get a PR into a mergeable state. 5. Once all outstanding comments and checklist items have been addressed, your contribution will be merged! Merged PRs will be included in the next Packer release. The core team takes care of updating the [CHANGELOG.md](../CHANGELOG.md) as they merge. 6. In rare cases, we might decide that a PR should be closed without merging. We'll make sure to provide clear reasoning when this happens. ### Tips for Working on Packer #### Getting Your Pull Requests Merged Faster It is much easier to review pull requests that are: 1. Well-documented: Try to explain in the pull request comments what your change does, why you have made the change, and provide instructions for how to produce the new behavior introduced in the pull request. If you can, provide screen captures or terminal output to show what the changes look like. This helps the reviewers understand and test the change. 2. Small: Try to only make one change per pull request. If you found two bugs and want to fix them both, that's _awesome_, but it's still best to submit the fixes as separate pull requests. This makes it much easier for reviewers to keep in their heads all of the implications of individual code changes, and that means the PR takes less effort and energy to merge. In general, the smaller the pull request, the sooner reviewers will be able to make time to review it. 3. Passing Tests: Based on how much time we have, we may not review pull requests which aren't passing our tests. (Look below for advice on how to run unit tests). If you need help figuring out why tests are failing, please feel free to ask, but while we're happy to give guidance it is generally your responsibility to make sure that tests are passing. If your pull request changes an interface or invalidates an assumption that causes a bunch of tests to fail, then you need to fix those tests before we can merge your PR. If we request changes, try to make those changes in a timely manner. Otherwise, PRs can go stale and be a lot more work for all of us to merge in the future. Even with everyone making their best effort to be responsive, it can be time-consuming to get a PR merged. It can be frustrating to deal with the back-and-forth as we make sure that we understand the changes fully. Please bear with us, and please know that we appreciate the time and energy you put into the project. #### Working on forks The easiest way to work on a fork is to set it as a remote of the Packer project. After following the steps in "Setting up Go to work on Packer": 1. Navigate to the code: `cd $GOPATH/src/github.com/hashicorp/packer` 2. Add the remote by running: `git remote add ` For example: `git remote add mwhooker https://github.com/mwhooker/packer.git` 3. Checkout a feature branch: `git checkout -b new-feature` 4. Make changes. 5. (Optional) Push your changes to the fork: `git push -u new-feature` This way you can push to your fork to create a PR, but the code on disk still lives in the spot where the go cli tools are expecting to find it. #### Go modules & go vendor If you are submitting a change that requires new or updated dependencies, please include them in `go.mod`/`go.sum` and in the `vendor/` folder. This helps everything get tested properly in CI. Note that you will need to use [go mod](https://github.com/golang/go/wiki/Modules) to do this. This step is recommended but not required. Use `go get ` to add dependencies to the project and `go mod vendor` to make vendored copy of dependencies. See [go mod quick start](https://github.com/golang/go/wiki/Modules#quick-start) for examples. Please only apply the minimal vendor changes to get your PR to work. Packer does not attempt to track the latest version for each dependency. #### Code generation Packer relies on `go generate` to generate a [peg parser for boot commands](https://github.com/hashicorp/packer/blob/master/packer-plugin-sdk/bootcommand/boot_command.go), [docs](https://github.com/hashicorp/packer/blob/master/website/pages/partials/builder/amazon/chroot/_Config-not-required.mdx) and HCL2's bridging code. Packer's testing suite will run `make check-generate` to check that all the generated files Packer needs are what they should be. `make generate` re-generates all these file and can take a while depending on your machine's performances. To make it faster it is recommended to run localized code generation. Say you are working on the Amazon builder: running `go generate ./builder/amazon/...` will do that for you. Make sure that the latest code generation tool is installed by running `make install-gen-deps`. #### Code linting Packer relies on [golangci-lint](https://github.com/golangci/golangci-lint) for linting its Go code base, excluding any generated code created by `go generate`. Linting is executed on new files during Travis builds via `make ci`; the linting of existing code base is only executed when running `make lint`. Linting a large project like Packer is an iterative process so existing code base will have issues that are actively being fixed; pull-requests that fix existing linting issues are always welcomed :smile:. The main configuration for golangci-lint is the `.golangci.yml` in the project root. See `golangci-lint --help` for a list of flags that can be used to override the default configuration. Run golangci-lint on the entire Packer code base. ``` make lint ``` Run golangci-lint on a single pkg or directory; PKG_NAME expands to /builder/amazon/... ``` make lint PKG_NAME=builder/amazon ``` Note: linting on Travis uses the `--new-from-rev` flag to only lint new files added within a branch or pull-request. To run this check locally you can use the `ci-lint` make target. See [golangci-lint in CI](https://github.com/golangci/golangci-lint#faq) for more information. ``` make ci-lint ``` #### Running Unit Tests You can run tests for individual packages using commands like this: ``` make test TEST=./builder/amazon/... ``` #### Running Builder Acceptance Tests Packer has [acceptance tests](https://en.wikipedia.org/wiki/Acceptance_testing) for various builders. These typically require an API key (AWS, GCE), or additional software to be installed on your computer (VirtualBox, VMware). If you're working on a new builder or builder feature and want to verify it is functioning (and also hasn't broken anything else), we recommend creating or running the acceptance tests. **Warning:** The acceptance tests create/destroy/modify _real resources_, which may incur costs for real money. In the presence of a bug, it is possible that resources may be left behind, which can cost money even though you were not using them. We recommend running tests in an account used only for that purpose so it is easy to see if there are any dangling resources, and so production resources are not accidentally destroyed or overwritten during testing. To run the acceptance tests, invoke `make testacc`: ``` make testacc TEST=./builder/amazon/ebs ... ``` The `TEST` variable lets you narrow the scope of the acceptance tests to a specific package / folder. The `TESTARGS` variable is recommended to filter down to a specific resource to test, since testing all of them at once can sometimes take a very long time. To run only a specific test, use the `-run` argument: ``` make testacc TEST=./builder/amazon/ebs TESTARGS="-run TestBuilderAcc_forceDeleteSnapshot" ``` Acceptance tests typically require other environment variables to be set for things such as API tokens and keys. Each test should error and tell you which credentials are missing, so those are not documented here. #### Running Provisioner Acceptance Tests **Warning:** The acceptance tests create/destroy/modify _real resources_, which may incur costs for real money. In the presence of a bug, it is possible that resources may be left behind, which can cost money even though you were not using them. We recommend running tests in an account used only for that purpose so it is easy to see if there are any dangling resources, and so production resources are not accidentally destroyed or overwritten during testing. Also, these typically require an API key (AWS, GCE), or additional software to be installed on your computer (VirtualBox, VMware). To run the Provisioners Acceptance Tests you should use the **ACC_TEST_BUILDERS** environment variable to tell the tests which builder the test should be run against. Examples of usage: - Run the Shell provisioner acceptance tests against the Amazon EBS builder. ``` ACC_TEST_BUILDERS=amazon-ebs go test ./provisioner/shell/... -v -timeout=1h ``` - Do the same but using the Makefile ``` ACC_TEST_BUILDERS=amazon-ebs make provisioners-acctest TEST=./provisioner/shell ``` - Run all provisioner acceptance tests against the Amazon EBS builder. ``` ACC_TEST_BUILDERS=amazon-ebs make provisioners-acctest TEST=./... ``` - Run all provisioner acceptance tests against all builders whenever they are compatible. ``` ACC_TEST_BUILDERS=all make provisioners-acctest TEST=./... ``` The **ACC_TEST_BUILDERS** env variable accepts a list of builders separated by commas. (e.g. `ACC_TEST_BUILDERS=amazon-ebs,virtualbox-iso`) #### Writing Provisioner Acceptance Tests Packer has implemented a `ProvisionerTestCase` structure to help write provisioner acceptance tests. ```go type ProvisionerTestCase struct { // Check is called after this step is executed in order to test that // the step executed successfully. If this is not set, then the next // step will be called Check func(*exec.Cmd, string) error // IsCompatible checks whether a provisioner is able to run against a // given builder type and guest operating system, and returns a boolean. // if it returns true, the test combination is okay to run. If false, the // test combination is not okay to run. IsCompatible func(builderType string, BuilderGuestOS string) bool // Name is the name of the test case. Be simple but unique and descriptive. Name string // Setup, if non-nil, will be called once before the test case // runs. This can be used for some setup like setting environment // variables, or for validation prior to the // test running. For example, you can use this to make sure certain // binaries are installed, or text fixtures are in place. Setup func() error // Teardown will be called before the test case is over regardless // of if the test succeeded or failed. This should return an error // in the case that the test can't guarantee all resources were // properly cleaned up. Teardown builderT.TestTeardownFunc // Template is the provisioner template to use. // The provisioner template fragment must be a json-formatted string // containing the provisioner definition but no other portions of a packer // template. For // example: // // ```json // { // "type": "shell-local", // "inline", ["echo hello world"] // } //``` // // is a valid entry for "template" here, but the complete Packer template: // // ```json // { // "provisioners": [ // { // "type": "shell-local", // "inline", ["echo hello world"] // } // ] // } // ``` // // is invalid as input. // // You may provide multiple provisioners in the same template. For example: // ```json // { // "type": "shell-local", // "inline", ["echo hello world"] // }, // { // "type": "shell-local", // "inline", ["echo hello world 2"] // } // ``` Template string // Type is the type of provisioner. Type string } ``` To start writing a new provisioner acceptance test, you should add a test file named `provisioner_acc_test.go` in the same folder as your provisioner is defined. Create a test case by implementing the above struct, and run it by calling `provisioneracc.TestProvisionersAgainstBuilders(testCase, t)` The following example has been adapted from a shell-local provisioner test: ``` import ( "github.com/hashicorp/packer/packer-plugin-sdk/acctest/provisioneracc" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/testutils" ) // ... func TestAccShellProvisioner_basic(t *testing.T) { // Create a json template fragment containing just the provisioners you want // to run. templateString := `{ "type": "shell-local", "script": "test-fixtures/script.sh", "max_retries" : 5 }` // instantiate a test case. testCase := &provisioneracc.ProvisionerTestCase{ IsCompatible: func() bool {return true}, Name: "shell-local-provisioner-basic", Teardown: func() error { testutils.CleanupFiles("test-fixtures/file.txt") return nil }, Template: templateString, Type: "shell-local", Check: func(buildcommand *exec.Cmd, logfile string) error { if buildcommand.ProcessState != nil { if buildcommand.ProcessState.ExitCode() != 0 { return fmt.Errorf("Bad exit code. Logfile: %s", logfile) } } filecontents, err := loadFile("file.txt") if err != nil { return err } if !strings.Contains(filecontents, "hello") { return fmt.Errorf("file contents were wrong: %s", filecontents) } return nil }, } provisioneracc.TestProvisionersAgainstBuilders(testCase, t) } ``` After writing the struct and implementing the interface, now is time to write the test that will run all of this code you wrote. Your test should be like: ```go func TestShellProvisioner(t *testing.T) { acc.TestProvisionersPreCheck("shell", t) acc.TestProvisionersAgainstBuilders(new(ShellProvisionerAccTest), t) } ``` The method `TestProvisionersAgainstBuilders` will run the provisioner against all available and compatible builders. If there are not builders compatible with the test you want to run, you can add a builder using the following steps: Create a subdirectory in provisioneracc/test-fixtures for the type of builder you are adding. In this subdirectory, add one json file containing a single builder fragment. For example, one of our amazon-ebs builders is defined in provisioneracc/test-fixtures/amazon-ebs/amazon-ebs.txt and contains: ```json { "type": "amazon-ebs", "ami_name": "packer-acc-test", "instance_type": "t2.micro", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*", "root-device-type": "ebs" }, "owners": ["099720109477"], "most_recent": true }, "force_deregister" : true, "tags": { "packer-test": "true" } } ``` note that this fragment does not contain anything other than a single builder definition. The testing framework will combine this with the provisioner fragment to create a working json template. In order to tell the testing framework how to use this builder fragment, you need to implement a `BuilderFixture` struct: ```go type BuilderFixture struct { // Name is the name of the builder fixture. // Be simple and descriptive. Name string // Setup creates necessary extra test fixtures, and renders their values // into the BuilderFixture.Template. Setup func() // Template is the path to a builder template fragment. // The builder template fragment must be a json-formatted file containing // the builder definition but no other portions of a packer template. For // example: // // ```json // { // "type": "null", // "communicator", "none" // } //``` // // is a valid entry for "template" here, but the complete Packer template: // // ```json // { // "builders": [ // "type": "null", // "communicator": "none" // ] // } // ``` // // is invalid as input. // // Only provide one builder template fragment per file. TemplatePath string // GuestOS says what guest os type the builder template fragment creates. // Valid values are "windows", "linux" or "darwin" guests. GuestOS string // HostOS says what host os type the builder is capable of running on. // Valid values are "any", windows", or "posix". If you set "posix", then // this builder can run on a "linux" or "darwin" platform. If you set // "any", then this builder can be used on any platform. HostOS string Teardown builderT.TestTeardownFunc } ``` Implement this struct to the file "provisioneracc/builders.go", then add the new implementation to the `BuildersAccTest` map in `provisioneracc/provisioners.go` Once you finish these steps, you should be ready to run your new provisioner acceptance test by setting the name used in the BuildersAccTest map as your `ACC_TEST_BUILDERS` environment variable. #### Debugging Plugins Each packer plugin runs in a separate process and communicates via RPC over a socket therefore using a debugger will not work (be complicated at least). But most of the Packer code is really simple and easy to follow with PACKER_LOG turned on. If that doesn't work adding some extra debug print outs when you have homed in on the problem is usually enough. packer-1.6.6+ds1/.github/ISSUE_TEMPLATE/000077500000000000000000000000001377171306200172065ustar00rootroot00000000000000packer-1.6.6+ds1/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000023741377171306200217060ustar00rootroot00000000000000--- name: Bug Report about: You're experiencing an issue with Packer that is different than the documented behavior. labels: bug --- When filing a bug, please include the following headings if possible. Any example text in this template can be deleted. #### Overview of the Issue A paragraph or two about the issue you're experiencing. #### Reproduction Steps Steps to reproduce this issue ### Packer version From `packer version` ### Simplified Packer Buildfile If the file is longer than a few dozen lines, please include the URL to the [gist](https://gist.github.com/) of the log or use the [Github detailed format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d) instead of posting it directly in the issue. ### Operating system and Environment details OS, Architecture, and any other information you can provide about the environment. ### Log Fragments and crash.log files Include appropriate log fragments. If the log is longer than a few dozen lines, please include the URL to the [gist](https://gist.github.com/) of the log or use the [Github detailed format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d) instead of posting it directly in the issue. Set the env var `PACKER_LOG=1` for maximum log detail. packer-1.6.6+ds1/.github/ISSUE_TEMPLATE/feature_requests.md000066400000000000000000000017721377171306200231250ustar00rootroot00000000000000--- name: Feature Request about: If you have something you think Packer could improve or add support for. labels: enhancement --- Please search the existing issues for relevant feature requests, and use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests. #### Community Note Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request. Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request. If you are interested in working on this issue or have submitted a pull request, please leave a comment. #### Description A written overview of the feature. #### Use Case(s) Any relevant use-cases that you see. #### Potential configuration ``` ``` #### Potential References packer-1.6.6+ds1/.github/ISSUE_TEMPLATE/question.md000066400000000000000000000011411377171306200213740ustar00rootroot00000000000000--- name: Question about: If you have a question, please check out our other community resources instead of opening an issue. labels: question --- Issues on GitHub are intended to be related to bugs or feature requests, so we recommend using our other community resources instead of asking here if you have a question. - Packer Guides: https://www.packer.io/guides - Discussion List: https://groups.google.com/group/packer-tool - Any other questions can be sent to the packer section of the HashiCorp forum: https://discuss.hashicorp.com/c/packer - Packer community links: https://www.packer.io/community packer-1.6.6+ds1/.github/ISSUE_TEMPLATE/ssh_or_winrm_times_out.md000066400000000000000000000017161377171306200243360ustar00rootroot00000000000000--- name: SSH or WinRM times out about: I have a waiting SSH or WinRM error. labels: communicator-question --- Got one of the following errors ? See if the related guides can help. - `Waiting for WinRM to become available` ? - See our basic WinRm Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/autounattend_windows - `Waiting for SSH to become available` ? - See our basic SSH Packer guide: https://www.packer.io/guides/automatic-operating-system-installs/preseed_ubuntu Issues on GitHub are intended to be related to bugs or feature requests, so we recommend using our other community resources instead of asking here if you have a question. - Packer Guides: https://www.packer.io/guides - Discussion List: https://groups.google.com/group/packer-tool - Any other questions can be sent to the packer section of the HashiCorp forum: https://discuss.hashicorp.com/c/packer - Packer community links: https://www.packer.io/community packer-1.6.6+ds1/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000013661377171306200206320ustar00rootroot00000000000000**DELETE THIS TEMPLATE BEFORE SUBMITTING** In order to have a good experience with our community, we recommend that you read the contributing guidelines for making a PR, and understand the lifecycle of a Packer PR: https://github.com/hashicorp/packer/blob/master/.github/CONTRIBUTING.md#opening-an-pull-request Describe the change you are making here! Please include tests. Check out these examples: - https://github.com/hashicorp/packer/blob/master/builder/virtualbox/common/ssh_config_test.go#L19-L37 - https://github.com/hashicorp/packer/blob/master/post-processor/compress/post-processor_test.go#L153-L182 If your PR resolves any open issue(s), please indicate them like this so they will be closed when your PR is merged: Closes #xxx Closes #xxx packer-1.6.6+ds1/.github/workflows/000077500000000000000000000000001377171306200170605ustar00rootroot00000000000000packer-1.6.6+ds1/.github/workflows/issues.yml000066400000000000000000000005341377171306200211200ustar00rootroot00000000000000name: Milestone Labeler on: issues: types: [milestoned] jobs: apply_labels: runs-on: ubuntu-latest steps: - name: Add track-internal uses: andymckay/labeler@1.0.2 if: github.event.issue.pull_request == null with: repo-token: ${{ secrets.Github_Token }} add-labels: "track-internal" packer-1.6.6+ds1/.gitignore000066400000000000000000000004171377171306200154550ustar00rootroot00000000000000/bin /local /pkg /src /website/.sass-cache /website/build /website/tmp .DS_Store .vagrant .idea test/.env *~ *.received.* *.swp website/.bundle website/vendor packer-test*.log *.received.txt *.received.json .idea/ *.iml Thumbs.db /packer.exe .project cache /.vscode/ packer-1.6.6+ds1/.golangci.yml000066400000000000000000000102421377171306200160460ustar00rootroot00000000000000issues: # List of regexps of issue texts to exclude, empty list by default. # But independently from this option we use default exclude patterns, # it can be disabled by `exclude-use-default: false`. To list all # excluded by default patterns execute `golangci-lint run --help` exclude-rules: # Exclude gosimple bool check - linters: - gosimple text: "S(1002|1008|1021)" # Exclude failing staticchecks for now - linters: - staticcheck text: "SA(1006|1019|4006|4010|4017|5007|6005|9004):" # Exclude lll issues for long lines with go:generate - linters: - lll source: "^//go:generate " # Maximum issues count per one linter. Set to 0 to disable. Default is 50. max-issues-per-linter: 0 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. max-same-issues: 0 linters: disable-all: true enable: - deadcode - errcheck - goimports - gosimple - govet - ineffassign - staticcheck - unconvert - unused - varcheck fast: true # options for analysis running run: # default concurrency is a available CPU number concurrency: 4 # timeout for analysis, e.g. 30s, 5m, default is 1m timeout: 10m # exit code when at least one issue was found, default is 1 issues-exit-code: 1 # include test files or not, default is true tests: true # list of build tags, all linters use it. Default is empty list. #build-tags: # - mytag # which dirs to skip: issues from them won't be reported; # can use regexp here: generated.*, regexp is applied on full path; # default value is empty list, but default dirs are skipped independently # from this option's value (see skip-dirs-use-default). #skip-dirs: # - src/external_libs # - autogenerated_by_my_lib # default is true. Enables skipping of directories: # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ skip-dirs-use-default: true # which files to skip: they will be analyzed, but issues from them # won't be reported. Default value is empty list, but there is # no need to include all autogenerated files, we confidently recognize # autogenerated files. If it's not please let us know. skip-files: - ".*\\.hcl2spec\\.go$" # - lib/bad.go # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": # If invoked with -mod=readonly, the go command is disallowed from the implicit # automatic updating of go.mod described above. Instead, it fails when any changes # to go.mod are needed. This setting is most useful to check that go.mod does # not need updates, such as in a continuous integration and testing system. # If invoked with -mod=vendor, the go command assumes that the vendor # directory holds the correct copies of dependencies and ignores # the dependency descriptions in go.mod. modules-download-mode: vendor # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" format: colored-line-number # print lines of code with issue, default is true print-issued-lines: true # print linter name in the end of issue text, default is true print-linter-name: true # make issues output unique by line, default is true uniq-by-line: true # all available settings of specific linters linters-settings: errcheck: # report about not checking of errors in type assetions: `a := b.(MyStruct)`; # default is false: such cases aren't reported by default. check-type-assertions: false # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; # default is false: such cases aren't reported by default. check-blank: false # [deprecated] comma-separated list of pairs of the form pkg:regex # the regex is used to ignore names within pkg. (default "fmt:.*"). # see https://github.com/kisielk/errcheck#the-deprecated-method for details ignore: fmt:.*,io/ioutil:^Read.*,io:Close # path to a file containing a list of functions to exclude from checking # see https://github.com/kisielk/errcheck#excluding-functions for details #exclude: /path/to/file.txt packer-1.6.6+ds1/.hashibot.hcl000066400000000000000000000014621377171306200160350ustar00rootroot00000000000000 behavior "regexp_issue_labeler" "panic_label" { regexp = "panic:" labels = ["crash", "bug"] } behavior "remove_labels_on_reply" "remove_stale" { labels = ["waiting-reply", "stale"] only_non_maintainers = true } poll "closed_issue_locker" "locker" { schedule = "0 50 1 * * *" closed_for = "720h" # 30 days max_issues = 500 sleep_between_issues = "5s" no_comment_if_no_activity_for = "4320h" # 180 days message = <<-EOF I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. EOF } packer-1.6.6+ds1/CHANGELOG.md000066400000000000000000006736651377171306200153230ustar00rootroot00000000000000## 1.6.6 (December 16, 2020) ### FEATURES: * **New command** `fmt` allows users to format existing HCL2 configuration files into a canonical style. Please see [fmt command docs](https://packer.io/docs/commands/fmt) for more details. [GH-10225] [GH-10377] * **New function** `env` allows users to set the default value of a variable to the value of an environment variable. Please see [env function docs](https://www.packer.io/docs/from-1.5/functions/contextual/env") for more details. [GH-10240] * **Future Scaffolding** This release contains a large number of no-op refactoring changes. The Packer team at HashiCorp is preparing to split the plugins and core to make it easier for our third party maintainers and community members to release and maintain plugins, just like HashiCorp did with the Terraform Core-Provider split. The Packer team is committed to making sure that this split is seamless for our users and for our community maintainers -- if you are a community maintainer, you may want to follow along with some of the work by looking at the [core-plugin-split github tag.](https://github.com/hashicorp/packer/pulls?q=is%3Apr+label%3Acore-plugin-split) No one needs to do anything, yet, but we felt it was worth calling out all the work that isn't making it into the changelog. We will be following up with lots of documentation and communication in early 2021 with more information. ### IMPROVEMENTS * builder/amazon-ebs: Add tags to launch templates. [GH-10203] * builder/amazon: Add support for Amazon EBS gp3 volumes. [Gh-10338] * builder/amazon: Increase default max_retries to lessen throttling issues. [GH-10290] * builder/amazon: Support AWS gp3 volumes [GH-10338] * builder/amazon: Support root volume encryption for amazon-chroot. [GH-10243] * builder/amazon: Validate IOPS ratio. [GH-10199] * builder/azure-arm: Add Azure CLI authentication support to builder. [GH-10157] * builder/azure-arm: Create keyvaults with SoftDelete enabled. [GH-10210] * builder/digitalocean: New option to provision with private ip. [GH-10093] * builder/google: Add `wait_to_add_ssh_keys` option to delay the addition of SSH configuration that may be disrupted during an instance boot sequence. [GH-10320] * builder/google: Add support for creating shielded VMs. [GH-10172] * builder/googlecompute-export: Add logging.write to service account scopes. [GH-10316] * builder/oracle-oci: Support image launch mode. [GH-10212] * builder/outscale: Add outscale.hk endpoint support [GH-10207] * builder/outscale: Add x509 certificate support. [GH-10161] * builder/proxmox: New config option for boot-order. [GH-10260] * builder/scaleway: Use the SDK functions to load profile from file and env. [GH-10181] * builder/virtualbox: Allow attaching guest additions with "none" communicator. [GH-10306] * builder/vmware: Make compatible with MacOS BigSur by using Apple DHCP leases instead of VMWare leases [GH-10384] * builder/vsphere: New option to add additional storage to a cloned vm. [GH-10287] * builder/yandex: More resilient image mounting and initialization. [GH-10335] * builder/yandex: Update user-data to not use cloud-config fields to prevent possible user data collisions. [GH-10385] * core/hcl: Update to `hcl2_upgrade` command to support complex variable values and packer version blocks. [GH-10221] * hcl2upgrade: Update command to fix `env` call upgrade. [GH-10244] * post-processor/vagrant-cloud: Add support for uploading directly to storage on Vagrant Cloud. [GH-10193] * post-processor/yandex-export: Add retries and wait after disk attach operation. [GH-10303] * post-processor/yandex-export: Show progress on export. [GH-10368] * post-processor/yandex-export: Use ssh communicator in export. [GH-10352] * post-processor/yandex-export: Verify the access to a specific bucket. [GH-10188] * provisioner/salt-masterless: Call winrepo.update_git_repos and pkg.refresh_db. [GH-10201] ### BUG FIXES * builder/amazon: Fix retry logic in AWS spot instance tagging. [GH-10394] * builder/amazon: Fix single `tag` interpolation to allow for templating engine usage. [GH-10224] * builder/google: Fix crash when using the `-on-error` build flag. [GH-10247] * builder/google: Fix issue with service account detection when running Packer on a compute instance with `use_os_login` enabled. [GH-10360] * builder/qemu: Fix duplication of main disk when setting "disk_image: true". [GH-10337] * builder/qemu: Fix nil pointer dereference when loading values from state. [GH-10249] * builder/qemu: Fix panic when disk_image=true and source image has no file extension. [GH-10226] * builder/vagrant: Return error if ssh-config command fails. [GH-10213] * builder/vsphere: WaitForIP should not return an error if an IP is not found [GH-10321] * builder/yandex: Change disk creation method to manual. [GH-10250] * builder/yandex: Fix issue with UserAgent string. [GH-10361] * builder/yandex: Fixed using cloud config when using IPv6. [GH-10297] * core/hcl: Ensure the `reverse` function does not break when given a value of type list. [GH-10380] * post-processor/yandex-export: Check service account id. [GH-10305] ## 1.6.5 (October 30, 2020) ### FEATURES: * New Builder(s): Proxmox builder has been split into two new builders `proxmox-iso` and `promox-clone`. See [Proxmox Builder](https://packer.io/docs/builders/proxmox) for more information on the builder. For users of the previous `proxmox` builder please use `packer fix` to migrate your templates to the new `promox-iso` builder. [GH-9262] ### BUG FIXES: * builder/amazon: SSM connection now recovers from reboots. [GH-10003] * builder/azure-arm: Fix build failures due to the deletion of additional managed disks defined in "disk_additional_size". [GH-10163] * builder/azure-chroot: Fix typo in option `exlude_from_latest` to `exclude_from_latest`. Old name will still be respected. [GH-10034] * builder/googlecompute: Fix HCL image_encryption_key fields and use the same casing in JSON and HCL2 [GH-10173] * builder/openstack: Fix source image validation regression when using filters. [GH-10065] * builder/proxmox: Fix unhandled buildvar type for HCL2 enabled build templates. [GH-10154] * builder/qemu: Fix a regression where Packer would not wait properly in step_shutdown when a null communicator was used. [GH-10178] * builder/qemu: Fix crash in step_run of qemu when loading commhostport form the statebag in a situation where the communicator is none. [GH-10145] * builder/vsphere-clone: Packer was not respecting the "destroy" flag set in the content library config, and always keeping the source vm. This has been fixed. [GH-10165] * builder/vsphere: Ensure builds are able to continue when no communicator has been specified `"communicator": "none"`. [GH-9964] * builder/vsphere: Fix CD uploads so that Packer does not try to delete a CD that was not successfully uploaded. [GH-10155] * core/hcl: Hide sensitive variables from output. [GH-10031] * core/hcl: Packer HCL's "Coalesce" function now behaves same way as Terraform's. [GH-10016] * core: Fix artifact handling so that input artifacts are properly preserved in postprocessors that don't modify artifacts. [GH-9996] * core: Fix pathing in cd_files to copy proper directory tree when user provided absolute paths. [GH-10022] * provisioner/ansible: Ansible galaxy no longer forces use of collections in v1 files. [GH-10010] ### IMPROVEMENTS: * builder/amazon-ebssurrogate: Apply snapshot tags at snapshot creation time. [GH-10150] * builder/amazon: Add `io2` as a supported volume type. [GH-10102] * builder/amazon: Add support for source instance tenancy [GH-10085] * builder/google: Add service account impersonation. [GH-9968] [GH-10054] * builder/googlecompute: Add `skip_create_image` option. [GH-10115] * builder/googlecompute: Allow users to select the algorithm to use when generating temporary SSH keypair [GH-10111] * builder/linode: Add `state_timeout` attribute to Linode builder. [GH-10128] * builder/oracle-oci: New option to specify image compartment separate from build compartment. [GH-10040] * builder/oracle-oci: New option to specify boot volume size. [GH-10017] * builder/oracle: Add `base_image_filter` option as alternative to `base_image_ocid` [GH-10116] * builder/outscale: Migrate to new Outscale SDK. [GH-10056] * builder/proxmox: split Proxmox into proxmox-iso and proxmox-clone. [GH-9626] [GH-10166] * builder/scaleway: Allow the user to use an image label (eg ubuntu_focal) instead of a hardcoded UUID on the Scaleway builder. [GH-10061] * builder/vsphere: Skip iso download if hashed file is already present on remote datastore. [GH-10143] * builder/yandex: Add support for IAM credentials in the token field and YC_TOKEN environment variable. [GH-10158] * core/hcl: Add ability to set version restrictions [GH-10149] * core/hcl: Add build.name variable so users can access build name in addition to source name. [GH-10114] * core/hcl: Add consul_key function to HCL templates. [GH-10119] * core/hcl: Add HCL2 aws_secretsmanager function [GH-10124] * core/hcl: Add packer.version variable to hcl configs so users can access the Packer release version. [GH-10117] * core: Let user provide type of generated ssh key instead of always doing ssh- rsa [GH-10101] ## 1.6.4 (September 30, 2020) ### BUG FIXES: * builder/amazon: Fix authentication issue when using instance profiles or assumed roles for loading session-derived credentials. [GH-10007] * builder/azure: Fix crash when using `azure_tag` or `azure_tags` configuration options. [GH-10014] * builder/qemu: Ensure `qemu_img_args` are honored during the disk convert step. [GH-10001] ## 1.6.3 (September 25, 2020) ### IMPROVEMENTS: * builder/amazon: Add `pause_before_ssm` option to pause for some time before establishing a Session Manager session; defaults to 10s. [GH-9988] * builder/amazon: Implement assume_role option that matches Terraform behavior. [GH-9981] * builder/azure: Support publishing to a Shared Image Gallery with a different subscription id [GH-9875] * builder/openstack: Add `external_source_image_url` and `external_source_image_format` to support building images from external source URLs. [GH-9992] * builder/openstack: Include API requests and responses as part of the debug log output. [GH-9972] * builder/oracle-oci: Add `create_vnic_details` option for launch details. [GH-9856] * builder/oracle-oci: Allow freeform and defined tags to be added to an instance. [GH-9802] * builder/proxmox: Add `io_thread` option for supporting io threads when using a `virtio-scsi-single` controller with a `scsi` or `virtio` disk type. [GH-9969] * builder/proxmox: Add ability to specify interfaces for http_directory and VM. [GH-9874] * builder/proxmox: Allow the mounting of multiple ISOs via the `cd_drive` option. [GH-9653] * builder/proxmox: Fix boot command special keys. [GH-9885] * builder/qemu: Add `qemu_img_args` option to set special cli flags for calls to qemu-img [GH-9956] * builder/qemu: Add `skip_resize_disk` option to skip the resizing of QCOW2 images. [GH-9896] [GH-9860] * builder/qemu: Skip qemu-img convert on MacOS to prevent the creation of corrupt images [QEMU #1776920](https://bugs.launchpad.net/qemu/+bug/1776920) [GH-9949] * builder/scaleway: Change default boottype to local. [GH-9853] * builder/scaleway: Update scaleway to use non-deprecated sdk. [GH-9902] * builder/vmware: Add `vnc_over_websocket` to allow the sending of a `boot_command` to hosts running ESXi 6.7 and above. [GH-9938] * builder/vmware: Allow user to set vmware tools source path. [GH-9983] * builder/vsphere-clone: Add ability to set `mac_address` [GH-9930] * builder/vsphere-clone: Add floppy_files, cd_files, and iso_paths options. [GH-9963] * builder/vsphere-iso: Add NVMe controller support. [GH-9880] * builder/vsphere: Look for a default resource pool when root resource pool is not found. [GH-9809] * core: Add support for running cygwin/msys2 based cd/iso creation tool [GH-9954] * core: New `cd_files` option to mount iso for modern OSes which don't support floppies. [GH-9796] [GH-9919] [GH-9928] [GH-9932] [GH-9941] * HCL2: When the type of a variable is not known evaluate setting as a literal string instead of a variable name. [GH-9863] * post-processor/vagrant: Support the use of template variables within Vagrantfile templates. [GH-9923] * post-processor/yandex-import: Allow custom API endpoint. [GH-9850] * provisioner/ansible: Add support for Ansible Galaxy Collections. [GH-9903] ### BUG FIXES: * builder/amazon-ebs: Fix issue where retrying on invalid IAM instance profile error was creating multiple spot instances. [GH-9946] * builder/amazon-ebssurrogate: Fix issue where builder defaults to AWS managed key even when custom `kms_key_id` is set. [GH-9959] * builder/amazon: Update ssm_driver log polling logic to prevent infinite loops when SSM driver is terminated outside of Packer. [GH-9991] * builder/azure: Fix crash when using HCL2 configs. [GH-9984] [GH-9985] * builder/qemu: Fix hardcoded lowerbound causing negative ports [GH-9905] * builder/qemu: Skip compaction when backing file is used. [GH-9918] * builder/scaleway: Add pre validate step to prevent the creation of multiple images with the same name. [GH-9840] * builder/vmware-iso: Prevent the use of reserved SCSI ID 0:7 when attaching multiple disks. [GH-9940] * builder/vsphere: Fix overly strict iso_path validation regex. [GH-9855] * command/console: Prevent failure when there are unknown vars. [GH-9864] * command/inspect: Allow unset variables in HCL2 and JSON. [GH-9832] * core: Prevent the UI progressbar from hanging and crashing when there is no TTY available. [GH-9974] * core: Use $APPDATA over $HOME on Windows hosts when determining homedir. [GH-9830] * post-processor/digitalocean-import: Fix crash caused by empty artifact.Files slice. [GH-9857] * post-processor/yandex-export: Check for error after runner completes. [GH-9925] * post-processor/yandex-export: Set metadata key to expected value on error. [GH-9849] * post-processor/yandex-import: Fix S3 URL construct process. [GH-9931] ## 1.6.2 (August 28, 2020) ### FEATURES: * **New command** `hcl2_upgrade` is a JSON to HCL2 transpiler that allows users to transform an existing JSON configuration template into its HCL2 template equivalent. Please see [hcl2_upgrade command docs](https://packer.io/docs/commands/hcl2_upgrade) for more details. [GH-9659] ### IMPROVEMENTS: * builder/amazon: Add all of the custom AWS template engines to `build` template function for use by provisioners. [GH-9751] * builder/amazon: Add aws_polling config option to override env variables. [GH-9777] * builder/azure: Add FreeBSD support to azure/chroot builder. [GH-9697] * builder/vmware-esx: Add `network_name` option to vmware so that users can set a network without using vmx data. [GH-9718] * builder/vmware-vmx: Add additional disk configuration option. Previously only implemented for vmware-iso builder [GH-9815] * builder/vmware: Add a `remote_output_directory option` so users can tell Packer where on a datastore to create a vm. [GH-9784] * builder/vmware: Add option to export to ovf or ova from a local vmware build [GH-9825] * builder/vmware: Add progress tracker to vmware-esx5 iso upload. [GH-9779] * builder/vsphere-iso: Add support for building on a single ESXi host [GH-9793] * builder/vsphere: Add new `directory_permission` config export option. [GH-9704] * builder/vsphere: Add option to import OVF templates to the Content Library [GH-9755] * builder/vsphere: Add step and options to customize cloned VMs. [GH-9665] * builder/vsphere: Update `iso_paths` to support reading ISOs from Content Library paths [GH-9801] * core/hcl: Add provisioner "override" option to HCL2 templates. [GH-9764] * core/hcl: Add vault integration as an HCL2 function function. [GH-9746] * core: Add colored prefix to progress bar so it's clearer what build each progress bar belongs to. [GH-9780] * core: Ui now pretty prints build durations. [GH-9749] * core: When a build is cancelled, Packer will skip postprocessors gracefully rather than failing them. [GH-9720] * integrations/secretsmanager: Add support for plaintext non-key/pair secrets. [GH-9773] * post-processor/vsphere: Improve UI to catch bad credentials and print errors. [GH-9649] * provisioner/ansible-remote: Add `ansible_ssh_extra_args` so users can specify extra arguments to pass to ssh [GH-9821] * provisioner/file: Clean up, bugfix, and document previously-hidden `sources` option. [GH-9725] [GH-9735] * provisioner/salt-masterless: Add option to option to download community SaltStack formulas. [GH-9726] ### BUG FIXES: * build: Fix bug in code generator that caused generation to fail in nested packer/packer dirs [GH-9728] * build: Fix Makefile so that default target doesn't crash and creates dev binaries. [GH-9706] * builder/amazon-ebssurrogate: Make skip_save_build_region option work in the ebssurrogate builder, not just the ebs builder. [GH-9666] * builder/amazon: Add retry logic to the spot instance creation step to handle "Invalid IAM Instance Profile name" errors [GH-9810] * builder/amazon: Update the `aws_secretsmanager` function to read from the AWS credentials file for obtaining default region information; fixes the 'MissingRegion' error when AWS_REGION is not set [GH-9781] * builder/file: Make sure that UploadDir receives the interpolated destination. [GH-9698] * builder/googlecompute: Fix bug where startup script hang would cause export to hang. [GH-9708] * builder/hyperv: Send boot command in small chunks to make it more stable. [GH-9765] * builder/scaleway: Fix config issue that made scaleway builder fail when used with HCL2 config. [GH-9677] * builder/vmware: Fully destroy vm if it was cancelled or errored. This will make orphaned vms easier to destroy through vCenter. [GH-9782] * builder/vsphere: Fix `alt`, `ctrl`, and `shift` keypresses in the boot_command. [GH-9702] [GH-9739] * builder/vsphere: Fix bug where Packer timed out if two interfaces were defined but only one had an available IP. [GH-9748] * builder/vsphere: Fix the configuration_parameters option so that it is always applied, not just when the tool sync policy is set. [GH-9713] * communicator: Fix `pause_before_connect` option to force a reconnect after the pause. [GH-9772] * core: Make `max_retries` provisioner option a string to allow variable interpolation. [GH-9673] * post-processor/vsphere-template: Fix ReregisterVM to default to true instead of false. [GH-9736] * post-processor/yandex-export: Fix issue when validating region_name [GH-9814] * provisioner/inspec: Fix the 'Unsupported argument; An argument named "command"' error when using the inspec provisioner in an HCL2 configuration [GH-9800] ## 1.6.1 (July 30, 2020) ### BACKWARDS INCOMPATABILITIES: * HCL: builder/vsphere: Add option to add a xhci/usb3 controller; changes controller value to an array of strings. [GH-9574] * HCL: New HCL-only `post-processors` block to run chained post-processors after a build [GH-9638]. Before this, defining multiple `post-processor` blocks after provisioning steps would run them sequentially, now doing this makes them start from the build artifact. To queue post-processors you now have to define them in a `post-processors` block. [GH-9638] * post-processor/vSphere: We have fixed a bug in the ovftool URL encoding. This may mean that you have performed an encoding workaround that is no longer necessary. [GH-9589] ### FEATURES: * **New post-processor** Yandex Import [GH-9553] ### IMPROVEMENTS: * builder/amazon-ebs: Wrap CreateImage call in a retry to account for eventual consistency [GH-9579] * builder/azure: Disable SSH password authentication unless password is explicitly specified. [GH-9603] * builder/docker: Add options for --cap-add, --cap-drop, --tmpfs, --device [GH-9565] * builder/file: Create parent directories of target file, if they don't exist. [GH-9452] * builder/googlecompute: Add `wrap_startup_script` configuration option to allow the disabling of Packer's startup script wrapper [GH-9505] * builder/googlecompute: Add support for oslogin via the `use_os_login` configuration option [GH-9339] * builder/googlecompute: Make IAP tunnel timeout configurable. [GH-9545] * builder/googlecompute: Support using WinRM over an IAP tunnel [GH-9610] * builder/hyper-v: Include secure boot template in box.xml [GH-9552] * builder/hyperone: Add support for custom username in vm creation. [GH-9497] * builder/hyperone: Skip chroot device discovery. [GH-9489] * builder/openstack: Bump gophercloud to latest version [GH-9573] * builder/proxmox: Add option to disable KVM hardware virtualization in Proxmox builder [GH-9587] * builder/proxmox: Add support for multiple NIC packet queues [GH-9597] * builder/proxmox: Enable Proxmox builder to toggle the firewall parameter for network interfaces. [GH-9487] * builder/proxmox: Update Proxmox storagePoolTypes [GH-9418] * builder/qemu: Add 'cdrom_interface' option to QEMU builder [GH-9483] * builder/tencentcloud: Add `source_image_name` to support getting source image by name [GH-9619] * builder/tencentcloud: Update cvm root disk type to `CLOUD_PREMIUM` [GH-9663] * builder/ucloud: New access config options and run config options. [GH-9466] * builder/vsphere-clone: Add `boot_command` support to vsphere-clone builder, including support for starting an HTTP server * builder/vsphere-clone: Add `vapp` configuration option [GH-9507] * builder/vsphere: Add ability to define multiple disk controllers [GH-9519] * builder/vsphere: Add `boot_command` support to vsphere-clone builder. [GH-9397] * builder/vsphere: Add `content_library_destination` to import VM template to a Content Library [GH-9551] * builder/vsphere: Add `force_bios_setup` configuration option [GH-9563] * builder/vsphere: Add option to add a xhci/usb3 controller [GH-9574] * builder/vsphere: Create vm output folders if they don't exist [GH-9402] * builder/vsphere: Fix file size descriptor when exporting OFV [GH-9568] * builder/vsphere: Look at all available IPs in the waiting for IP loop. [GH-9450] * builder/vsphere: Match network to host when multiple networks are found [GH-9556] * builder/vsphere: Update vsphere `boot_command` to bring it in line with other builders' boot_command functionality. [GH-9406] * builder/vsphere: Use datacenter inventory path for find folder [GH-9390] * builder/vsphere: Use value from "ip_wait_address" option to determine the default for the http server IP [GH-9441] * builder/yandex: Allow set `min_disk_size` for an image. * builder/yandex: Support authentication by Service Account on instance [GH-9383] * builder/yandex: yandex: Add new property `min_disk_size` of built image [GH-9594] * communicator/ssh: Add support for OpenSSH certificate signing [GH-9521] * communicator/ssh: Allow users to provide a list of ciphers that they want Packer to support. [GH-9453] * core/hcl2: Add possibility to name singular build.source blocks to differentiate their output and to filter on them [GH-9490] * core/hcl2: Add the "inspect" command for hcl2 configs. [GH-9468] * core/hcl2: HCL configs now respect only/except using build names instead of types. [GH-9454] * core/hcl: Allow use of `keep_input_artifact` in post processors. [GH-9477] * core/hcl: Share build info with Provisioner and Post-Processor via HCL2 variables [GH-9444] [GH-9534] [GH-9622] * core: Add on-error flag option to run error-cleanup-provisioner [GH-9429] * core: communicator/ssh: Add new `ssh_key_exchange_algorithms` option to supply custom key exchange algorithms in SSH client [GH-9634] * core: refactor initialization out from Packer core to allow `validate --syntax-only` to no error when a variable is not set [GH-9627] * hcl2: Handle uint64 buildvars [GH-9585] * post-processor/yandex-export: Allow users to utilize generated variables in templating. [GH-9555] * post-processor/yandex-export: Support Authentication by Service Account Key file [GH-9379] * post-processor/yandex-import: Support creating an Image based on another one [GH-9614] * post-processor/yandex-import: Support using URL from yandex-export [GH-9601] * provisioner/ansible: Add template option for templating the inventory file lines [GH-9438] ### BUG FIXES: * builder/amazon: Change "Resource" field in `temporary_iam_instance_profile_policy_document` to be an array of strings, not just a single string. [GH-9509] * builder/amazon: HCL2: Add singular `run_volume_tag` block to ebs & ebssurrogate builders. [GH-9457] * builder/amazon: Retry fetching block device mappings if empty. [GH-9480] * builder/azure: Fix data disks URI. [GH-9467] * builder/googlecompute: Fix issue with `use_iap` globally changing a user's gcloud project configuration, by temporarily setting "project" via project flag and not via `gcloud config` [GH-9662] * builder/googlecompute: Fix the "secure boot" validation for uefi_compatible images. [GH-9371] * builder/qemu: Only set up localhost port forwarding if skipnatmapping is false. [GH-9479] * builder/vagrant: Fix box file validation for remote box files specified using `source_path` [GH-9660] * builder/vagrant: Improve validation and error handling around synced_folder. Make sure that synced folder can be defined relative to Packer run directory, not the Vagrant output directory. [GH-9577] * builder/virtualbox-vm: Fix regression where builder would fail if the vm had no snapshots. [GH-9435] * builder/vmware-iso: Try checksum remote file instead of local file. [GH-9584] * builder/vmware: Fix a race that occurred when parsing the network config. [GH-9387] * builder/vmware: Update vendor library, enabling retries on 502 errors [GH-9391] * builder/vsphere-clone: Fix SSH public key injection for cloned templates [GH-9507] * builder/vsphere: Clean up folder path to remove leading slashes. [GH-9542] * builder/vsphere: Deduplicate where Firmware is set in vsphere-iso builder [GH-9557] * builder/vsphere: Fix vsphere ToolsSyncTime and ToolsUpgradePolicy [GH-9515] * builder/vsphere: vSphere driver context is no longer cancelled when Packer context is cancelled. [GH-9576] * communicator/winrm: Add the "no_proxy" environment variable option to have winrm bypass the proxy set by the http_proxy or https_proxy environment vars, when connecting to the remote instance. [GH-9267] * core: Do not print download progress bar if a machine-readable UI is chosen. [GH-9448] * post-processor/amazon-import: Add support for retrying RequestLimitExceeded errors when importing an image [GH-9537] * post-processor/docker-import: Fix crash when using docker-import with HCL. [GH-9670] * post-processor/vsphere: Fix password encoding in vsphere post-processor ovftool call [GH-9589] * post-processor/yandex-export: Fix error handling and docs. [GH-9554] * provisioner/ansible-local: Fix agent auth in SSH communicator [GH-9639] * provisioner/ansible: Correct check for whether PackerHttpAddr is implemented or not [GH-9498] * provisioner/ansible: Quote extra-var packer_build_name to handle names with spaces [GH-9590] ## 1.6.0 (June 09, 2020) ### BACKWARDS INCOMPATIBILITIES: * builder/vsphere-iso: The deprecated fields `network`, `network_card`, `disk_size`, `disk_thin_provisioned`, and `disk_eagerly_scrub` have been removed. Run `packer fix template.json` to migrate an existing template [GH-9149] * For all iso-based builders, the `iso_checksum_type` and `iso_checksum_url` fields have been removed in favor of simply setting the `iso_checksum` field. Use the [packer fix](https://www.packer.io/docs/commands/fix/) command to update a config file. See the [iso_checksum field docs](https://www.packer.io/docs/builders/virtualbox/iso/#iso_checksum) to read more about this. [GH-8437] ### FEATURES: * **New post-processor** Yandex Export [GH-9124] * builder/amazon: Add SSM Session Manager as a SSH interface connection [GH-9082] * builder/google: Implement iap proxy for googlecompute [GH-9105] * HCL2/core: Add command/console support for HCL2 config files [GH-9359] * HCL2/core: Add command/validate support for HCL2 config files [GH-9346] * HCL2/core: it is now possible to set source fields from the `build` block [GH-9291] ### IMPROVEMENTS: * builder/amazon: Added new `build` template function field: SourceAMICreationDate [GH-9277] * builder/azure-arm: Support User Assigned Managed Identity [GH-9293] * builder/azure-chroot: Copy data disks between shared image galleries [GH-9323] * builder/googlecompute: Changed default disk size. [GH-9071] * builder/googlecompute: New option to specify storage location for GCP images [GH-9326] * builder/qemu: Add support for using a network bridge [GH-9159] * builder/qemu: Added `skip_nat_mapping` option to skip the communicator (SSH or WinRM) automatic port forward and use the guest port directly. [GH-9307] * builder/qemu: Replace deprecated `ssh_host_port_min` and `ssh_host_port_max` by `host_port_min` and `host_port_max`. [GH-9307] * builder/virtualbox: Add `output_filename` config option to allow user to set a custom filename instead of forcing it to be the same as vm_name. [GH-9174] * builder/vsphere: Add `floppy_label` option. [GH-9187] * builder/vsphere: Add `ip_wait_address` to allow packer to wait for an ip address that fits within the range (cidr address). [GH-9358] * builder/vsphere: Add `tools_sync_time` and `tools_upgrade_policy` options to set time synchronization and automatic VMware Tools upgrade. [GH-9366] * core/hcl: Enable "force", "debug", and "on-error" command line flags for hcl2 builds. [GH-9234] * core/hcl: Enable only/except for provisioners and post-processors [GH-9357] * core/hcl: Support named builds in HCL2 templates [GH-9245] * core/interpolation: Add support for specifying a particular key to fetch from the AWS Secrets Manager [GH-9202] [GH-9286] * core: HCL logs now display source type and source name (`type.name`) in logs to differentiate more easily who says what. [GH-9257] * core: update consul and vault dependencies [GH-9205] * core: Update vendored "go-getter" library with checksum fixes. * core: Users can now configure the http bind address of the server launched to serve files from http_directory [GH-9313] * core: When a template contains a deprecated option, Packer will now encourage the user to call `packer fix`. [GH-9325] * post-processor/docker-push: Support pushing multiple tags [GH-9182] * post-processor/docker-tag: Change field name of docker tag to "tags" instead of "tag" since it's a list. Keep "tag" for backwards compatibility. [GH-9183] * provisioner/windows-restart: Display full hostname, instead of just the NetBIOS name [GH-9335] ### BUG FIXES: * buidler/vsphere-iso: Fix bug validating iso_urls [GH-9321] * builder/azure-arm: Update runtime constants with a valid DataDiskName [GH-9251] * builder/digitalocean: Use correct image type for Droplet creates. [GH-9212] * builder/openstack: Don't error if metadata can't be set. Old versions of openstack don't support that API call. [GH-9198] * builder/vagrant: Use absolute path for package_include files to prevent them from having to be relative to the output vagrant directory. [GH-9260] * builder/virtualbox: Fix bug using checksum files. [GH-9101] * builder/vmware: Fix ssh connection when the guest platform's dhcpcd switches the IP address in-between a build. [GH-9322] * builder/vsphere-iso: Use the Datacenter's VmFolder call instead of manually generating folder path [GH-9342] * builder/vsphere: Add option not to set host during datastore upload. [GH-9100 * builder/vsphere: Fix crash in the driver for an interface conversion of types.AnyType nil to types.ManagedObjectReference. [GH-9354] * builder/vsphere: Fix iso config prepare being called incorrectly, which caused `iso_url` field to fail. [GH-9197] * builder/yandex: Do not require 'gpu-standard-v1' platform_id for any GPU- based config. [GH-9356] * core: Ensure HTTP server information `PackerHTTPIP`, `PackerHTTPPort`, and `PackerHTTPAddr` are available via the `build` template engine for all supported builders [GH-9238] * core: Fix `iso_url` to accept SMB shared files UNC and windows network paths. [GH-8954] * core: Fix regression that broke use of pwd when retrieving the checksum from a file [GH-9129]. * post-processor/vagrant: Add "provider_override" template option to allow artifacts from the Artifice post-processor [GH-9239] * post-processor/vsphere-template: Add VSphere builder's artifact to vsphere- template's supported types [GH-9146] * postprocessor/artifice: Update various core post-processors to accept artifacts from the Artifice post-processor [GH-9239] * provisioner/ansible-remote: Fix the arg order to make sure that the playbook file is the last item in the call [GH-9279] * provisioner/ansible: Ansible provisioner doesn't force ssh key checking if user wants to use password to connect instead. [GH-9350] * provisioner/inspec: Fix build variables interpolation [GH-9262] * provisioner/powershell: fix interpolation of execute_command in cleanup script call. [GH-9275] * provisioner/powershell: Fix long-wait retry loop caused by cleanup logic [GH-9226] * provisioner/salt-masterless: Ignore the CmdArgs field in hcl2 [GH-9290] ## 1.5.6 (May 1, 2020) ### BACKWARDS INCOMPATIBILITIES: * core/hcl2: HCL2 singular blocks: use key/value or name/value depending on how the service names things [GH-9078] * core/hcl2: Maps are now treated as settable arguments as opposed to blocks. For example `tags = {}` instead of `tags {}` [GH-9035] * `packer build` command: removed option to set `parallel=false`, use `-parallel-builds=1` for this. ### FEATURES: * **New Builder** azure-dtl allows creation of devtestlabs images in Azure [GH-8987] * **New Core Feature** provisioners now support a `max_retries` option that can be used for retrying a provisioner on error [GH-9061] * **New Post-Processor**: `yandex-export` Upload built image in Yandex Object Storage. ### IMPROVEMENTS: * builder/azure-arm: Add `boot_diag_storage_account` option for enabling boot diagnostics on a virtual machine [GH-9053] * builder/azure-arm: Add support for setting custom resource names [GH-9028] * builder/azure-arm: Data disk names are now randomly generated [GH-8986] * builder/azure: Add shared image destination for azure-chroot [GH-9021] * builder/azure: Add shared image source for chroot builder [GH-9070] * builder/google: Add support for custom shielded images [GH-8970] * builder/google: Allow `source_image_project_id` to be a list of several projects to search. [GH-8679] * builder/hyperv: Add `boot_order` option to override the default boot order [GH-9046] * builder/oracle-oci: Allow Instance Principal Auth for Oracle OCI builder [GH-8893] * builder/oracle-oci: Update Oracle SDK. [GH-9104] * builder/proxmox: Add ability to add a cloud-init drive [GH-9045] * builder/vsphere: Add `disable_shutdown` option to support manual vm shutdown over the default automatic shutdown step [GH-9095] * builder/vsphere: Add `vgpu_profile` option for specifying vGPU profiles [GH-8946] * builder/vsphere: Add support for EFI Secure Boot [GH-9018] * builder/vsphere: Add support for specifying vGPU profiles [GH-8946] * builder/yandex: Add `target_image_folder_id ` option for changing the folder where a built image will be saved to [GH-9080] * core/hcl2: HCL mode builds now honor -only and -except options [GH-8947] * core/hcl2: Set `packer_build_name` and `packer_builder_type` variables for builder provisioners and post-processors [GH-8956] * core/HCL: HCL mode now honors -only and -except options. [GH-8947] * core: New template function: aws_secretsmanager [GH-9099] * provisioner/ansible: Add `use_proxy` option to not use localhost proxy adapter. Removes need for ansible connection_plugin when using WinRM. [GH-8625] * provisioner/powershell: Add `debug_mode` option to help with debugging generated scripts [GH-8996] * provisioner/powershell: Add cleanup step to remove temporarily created scripts; cleanup can be skipped by setting the `skip_clean` option [GH-8908] ### BUG FIXES: * builder/amazon: Fix bug with `launch_block_device_mappings` in spot instances. [GH-8945] * builder/azure-arm: Fix issue where managed image builds were using a different `location` then what was specified in the build configuration [GH-9068] * builder/azure: Allow Managed Data Disks to be used with Azure Shared Image Gallery [GH-8912] * builder/azure: Fix SSH connection for temporary admin users specified in `ssh_username` [GH-9103] * builder/osc: Make compliant with oAPI spec for Outscale osc-bsu builder [GH-9093] * builder/qemu: Remove `net_device` pre-validation [GH-8979] * builder/tencentcloud: Update builder to handle the InstanceOperationInProgress error [GH-9069] * builder/vsphere-iso: disk_size is no longer required if storage is defined [GH-8975] * builder/vsphere: Add exported files to VSphere artifact [GH-9020] * builder/vsphere: Fix issue where -force is not working with vsphere builders [GH-9039] * core: Fix crash in wrapperreadline helper when calling `os.NewFile` on unknown file descriptor [GH-9037] * core: Make sure CLI variables supersede variables from var files [GH-8964] * provisioner/powershell: Fix integer decoding issue in the execution policy parser [GH-8997] ## 1.5.5 (March 25,2020) ### BACKWARDS INCOMPATIBILITIES: * core: Interpolation of undefined variables will now error as expected, in previous versions variables were allowed to be set as a command line argument but that was because the validation was being ignored ### IMPROVEMENTS: * builder/azure: Add support for configurable KeyVault SKU [GH-8879] * builder/hyperv: Add `first_boot_device` setting to allow the selection of the initial device or device class used for booting the VM. [GH-8714] * builder/hyperv: Fix Hyper-V compacted disk size comparison [GH-8811] * builder/openstack: Add new `image_auto_accept_members` option [GH-8931] * builder/proxmox: Add ability to specify vga adapter [GH-8892] * builder/proxmox: Add onboot directive support [GH-8935] * builder/tencentcloud: Show tencentcloud image id after copy to destination region. [GH-8763] * builder/vmware-iso: Add `cleanup_remote_cache` config option to [GH-8917] * builder/vmware-iso: Do not perform dial test of NIC when ssh bastion is required [GH-8877] * builder/vsphere-clone: Add ability to export VM to OVF file [GH-8764] * builder/vsphere-iso: Add ability to define multiple disks. [GH-8787] * builder/vsphere-iso: Add ability to export VM to OVF file [GH-8764] * builder/vsphere-iso: Add support for eagerly zeroed / scrubbed disks. [GH-8756] * builder/vsphere-iso: Add the remote iso first so that it is first in boot order, and clarify boot behavior. [GH-8732] * communicator/ssh: Add flag to enable support for keyboard-interactive auth to connect bastion [GH-8847] * core/hcl2: Add support for singular blocks [GH-8889] * core/hcl2: Add support in HCL2 configs for dynamic blocks, document for loops and splat expressions [GH-8720] * core/hcl2: Fix HCL2 local variables decoding to allow local usage within another local in the same locals block [GH-8755] * core/hcl2: Import new replace and regex_replace funcs from go-cty + documentation [GH-8863] * core: Enable hcl files as var files in HCL mode [GH-8882] * core: Make "build" engine template variables SSHPublicKey and SSHPrivateKey strings [GH-8829] ### Bug Fixes: * builder/azure: Fix `winrm_password` attribution and allow users to set `winrm_username` [GH-8928] * builder/azure: Fix azure key vault cleanup failure [GH-8905] * builder/azure: Fix HCL2 bug that prevented Azure and other builders from loading properly. [GH-8785] * builder/googlecompute: Fix WinRMPassword template engine. [GH-8890] * builder/googlecompute: Replace deprecated "sshKeys" metadata with "ssh-keys" to fix SSH authentication issue [GH-8942] * builder/proxmox: Add new validation to catch that template_name cannot contain spaces. [GH-8799] * builder/proxmox: Bump proxmox-api-go to fix upstream bug where users hit open file limit. [GH-8800] * builder/vagrant: Fix path validation in ssh config step. [GH-8826] * builder/virtualbox-vm: Fix crash when VM has no snapshots. [GH-8906] * builder/virtualbox: Remove all floppy controllers before adding a new one. [GH-8828] * builder/vsphere-clone: Fix issue preventing the cloning of VMs with the same name in different folders [GH-8938] * builder/vsphere-iso: Fix issue preventing the creation of VMs with the same name in different folders [GH-8938] * builder/vsphere: Fix network object interface panic. [GH-8753] * core/hcl2: Fix crash when an unset variable is used [GH-8837] * core/hcl2: Fix logic for parsing literal value variables [GH-8834] * core/hcl2: Make sure locals are evaluated only after variables are. [GH-8918] * core: Fix "build" template engine interpolation for certain fields in certain provisioners. [GH-8771] * core: Fix bug where user var recursion could fail intermittently when used with env vars [GH-8875] * core: Interpolation of undefined variables will now error as expected * plugins: Make plugin discovery stricter with respect to periods so that users can disable plugins by renaming the extension [GH-8735] * provisioner/salt: Fix `no_exit_on_failure` config to work correctly as expected. [GH-9119] * provisioner/shell: "inline" config option is now a template engine. [GH-8883] ## 1.5.4 (February 14, 2020) no-change release to fix code-signing on OSX binaries. Since checksums for these binaries has changed, we are releasing a second time to prevent confusion. ## 1.5.3 (February 14, 2020) ### IMPROVEMENTS: * builder/vsphere: Add ability to define multiple NICs for vsphere-iso [GH-8739] * builder/vsphere: Add option to remove CD-ROM drives. [GH-8690] * core: Add validation to catch when users accidentally add duplicate fields to template [GH-8725] ### Bug Fixes: * core/hcl2: Fix template prepare/validation for HCL2 templates [GH-8742] * core: Fix `build` template function interpolation [GH-8727] ## 1.5.2 (February 12, 2020) **New Builder** The vsphere-iso builder, previously maintained by JetBrains, has been merged with the Packer core. It will be officially supported by the Packer team at HashiCorp moving forward. [GH-8480] **HCL2 variables & functions** HCL2 configurations can now use `variable`, `variables`, `locals`, and functions [GH-8588]. ### IMPROVEMENTS: * builder/alicloud: Add AlicloudProfile option. [GH-8560] * builder/amazon: Add max_retries option to aws builders [GH-8709] * builder/amazon: Add source AMI owner ID/name to template engines [GH-8550] * builder/amazon: Update instance waiters to use global waiter settings set by `AWS_POLL_DELAY_SECONDS` and `AWS_TIMEOUT_SECONDS` [GH-8699] * builder/azure: Allow users to use custom key vault for storing Windows certificates [GH-8704] * builder/azure: Set expiry for image versions in SIG [GH-8561] * builder/proxmox: Add option to upload the boot ISO rather than pointing out a previously manually uploaded one. [GH-8624] * builder/vagrant: Fix a crash in the Vagrant driver [GH-8607] * builder/yandex: Add service account ID to config [GH-8717] * communicator/winrm: Users can now override winrm_host with a static IP even when using cloud builders. [GH-8675] * core/hcl2: Fix bug preventing reading slices within other slices [GH-8669] * core: Interpolation within post-processors can now access build-specific values like Host IP, communicator password, and more [GH-8632] * core: Add `PACKER_PLUGIN_PATH` to list of supported paths for plugin discovery [GH-8616] * core: clean up messy log line in plugin execution. [GH-8542] * core: Ensure `PACKER_HTTP_ADDR` is always set for any builder that provides a HTTP server for file transfer [GH-8654] * core: Fix loading external plugins defined in PACKER_CONFIG [GH-8582] * core: Log name of postprocessor running to disambiguate long chains of post- processors. [GH-8613] * core: Packer can use isos in-place on Windows again, instead of copying them into its cache. [GH-7627] * core: step_download: return without error if Urls is empty [GH-8579] * post-processor/vsphere-template] Simplify method to use vm.MarkAsTemplate (optionally) [GH-8511] * scripts: Fix some issues with mapstructure-to-hcl2 code generator. [GH-8574] * scripts: Update Vagrant bootstrapping scripts [GH-8604] ### Bug Fixes: * builder/alicloud: Fix "security group doesn't exist" error when there are >10 security groups. [GH-8535] * builder/amazon: Allow AWS builder pre-validation to pass when subnet filters are present [GH-8622] * builder/azure: Fix bug where deployments were not being cleaned up: [GH-8496] * builder/azure: Fix issue where WinRMPassword was being left unset [GH-8670] * builder/lxd: Fix file uploading issue when using the file provisioner [GH-8636] * builder/null: Fix crash when configuring builder using HCL2. [GH-8612] * builder/osc: Fix ssh host detection in Public Cloud and Nets [GH-8414] * builder/vagrant: Fix bug with reading key from a path with spaces [GH-8605] * builder/virtualbox-ovf: Remove config dependency from StepImport [GH-8509] * builder/virtualbox-vm: use config as a non pointer to avoid a panic [GH-8576] * core: Fix crash when build.sources is set to an invalid name [GH-8569] * core: Fix error loading .packerconfig [GH-8623] * core: Fix loading local ISO files when using `iso_target_path` [GH-8689] * core: Fix loading of external plugins. GH-8543] * post-processor/docker-tag: Fix regression if no tags were specified. [GH-8593] * post-processor/vagrant-cloud: Update error handling for Vagrant Cloud API [GH-8594] * post-processor/vagrant: correctly handle the diskSize property as a qemu size string [GH-8567] * provisioner/ansible: Fix password sanitization to account for empty string values. [GH-8570] * provisioner/shell: Fix bug with shell provisioner failing to clean up the environment var file when env_var_file is true. [GH-8639] ## 1.5.1 (December 20, 2019) This was a fast-follow release to fix a number of panics that we introduced when making changes for HCL2. ### IMPROVEMENTS: * builder/alicloud: Add show_expired option for describing images [GH-8425] ### Bug Fixes: * builder/cloudstack: Fix panics associated with loading config [GH-8513] * builder/hyperv/iso: Fix panics associated with loading config [GH-8513] * builder/hyperv/vmcx: Fix panics associated with loading config [GH-8513] * builder/jdcloud: Update jdcloud statebag to use pointers for config [GH-8518] * builder/linode: Fix panics associated with loading config [GH-8513] * builder/lxc: Fix panics associated with loading config [GH-8513] * builder/lxd: Fix panics associated with loading config [GH-8513] * builder/oneandone: Fix panics associated with loading config [GH-8513] * builder/oracle/classic: Fix panics associated with loading config [GH-8513] * builder/oracle/oci: Fix panics associated with loading config [GH-8513] * builder/osc/bsuvolume: Fix panics associated with loading config [GH-8513] * builder/parallels/pvm: Fix panics associated with loading config [GH-8513] * builder/profitbricks: Fix panics associated with loading config [GH-8513] * builder/scaleway: Fix panics associated with loading config [GH-8513] * builder/vagrant: Fix panics associated with loading config [GH-8513] * builder/virtualbox/ovf: Fix panics associated with loading config [GH-8513] * builder/virtualbox: Configure NAT interface before forwarded port mapping #8514 * post-processor/vagrant-cloud: Configure NAT interface before forwarded port mapping [GH-8514] ## 1.5.0 (December 18, 2019) ### IMPROVEMENTS: * builder/amazon: Add no_ephemeral template option to remove ephemeral drives from launch mappings. [GH-8393] * builder/amazon: Add validation for "subnet_id" when specifying "vpc_id" [GH-8360] [GH-8387] [GH-8391] * builder/amazon: allow enabling ena/sr-iov on ebssurrogate spot instances [GH-8397] * builder/amazon: Retry runinstances aws api call to mitigate throttling [GH-8342] * builder/hyperone: Update builder schema and tags [GH-8444] * builder/qemu: Add display template option for qemu. [GH-7676] * builder/qemu: Disk Size is now read as a string to support units. [GH-8320] [GH-7546] * builder/qemu: Add fixer to convert disk size from int to string [GH-8390] * builder/qemu: Disk Size is now read as a string to support units. [GH-8320] [GH-7546] * builder/qemu: When a user adds a new drive in qemuargs, process it to make sure that necessary settings are applied to that drive. [GH-8380] * builder/vmware: Fix error message when ovftool is missing [GH-8371] * core: Cleanup logging for external plugins [GH-8471] * core: HCL2 template support is now in beta. [GH-8423] * core: Interpolation within provisioners can now access build-specific values like Host IP, communicator password, and more. [GH-7866] * core: Various fixes to error handling. [GH-8343] [GH-8333] [GH-8316] [GH-8354] [GH-8361] [GH-8363] [GH-8370] * post-processor/docker-tag: Add support for multiple tags. [GH-8392] * post-processor/shell-local: Add "valid_exit_codes" option to shell-local. [GH-8401] * provisioner/chef-client: Add version selection option. [GH-8468] * provisioner/shell-local: Add "valid_exit_codes" option to shell-local. [GH-8401] * provisioner/shell: Add support for the "env_var_format" parameter [GH-8319] ### BUG FIXES: * builder/amazon: Fix request retry mechanism to launch aws instance [GH-8430] * builder/azure: Fix PollDuration option which was overridden in some clients. [GH-8490] * builder/hyperv: Fix bug in checking VM name that could cause flakiness if many VMs are defined. [GH-8357] * builder/vagrant: Use absolute path for Vagrantfile [GH-8321] * builder/virtualbox: Fix panic in snapshot builder. [GH-8336] [GH-8329] * communicator/winrm: Resolve ntlm nil pointer bug by bumping go-ntlmssp dependency [GH-8369] * communicator: Fix proxy connection settings to use "SSHProxyUsername" and "SSHProxyPassword" where relevant instead of bastion username and password. [GH-8375] * core: Fix bug where Packer froze if asked to log an extremely long line [GH-8356] * core: Fix iso_target_path option; don't cache when target path is non-nil [GH-8394] * core: Return exit code 1 when builder type is not found [GH-8474] * core: Return exit code 1 when builder type is not found [GH-8475] * core: Update to newest version of go-tty to re-enable CTRL-S and CTRL-Q usage [GH-8364] ### BACKWARDS INCOMPATIBILITIES: * builder/amazon: Complete deprecation of clean_ami_name template func [GH-8320] [GH-8193] * core: Changes have been made to both the Prepare() method signature on the builder interface and on the Provision() method signature on the provisioner interface. [GH-7866] * provisioner/ansible-local: The "galaxycommand" option has been renamed to "galaxy_command". A fixer has been written for this, which can be invoked with `packer fix`. [GH-8411] ## 1.4.5 (November 4, 2019) ### IMPROVEMENTS: * added ucloud-import post-processsor to import custom image for UCloud UHost instance [GH-8261] * builder/amazon: New option to specify IAM policy for a temporary instance profile [GH-8247] * builder/amazon: improved validation around encrypt_boot and kms_key_id for a better experience [GH-8288] * builder/azure-arm: Allow specification of polling duration [GH-8226] * builder/azure-chroot: Add Azure chroot builder [GH-8185] & refactored some common code together after it [GH-8269] * builder/azure: Deploy NSG if list of IP addresses is provided in config [GH-8203] * builder/azure: Set correct user agent for Azure client set [GH-8259] * builder/cloudstack: Add instance_display_name for cloudstack builder [GH-8280] * builder/hyperv: Add the additional_disk_size option tho the hyperv vmcx builder. [GH-8246] * builder/openstack: Add option to discover provisioning network [GH-8279] * builder/oracle-oci: Support defined tags for oci builder [GH-8172] * builder/proxmox: Add ability to select CPU type [GH-8201] * builder/proxmox: Add support for SCSI controller selection [GH-8199] * builder/proxmoz: Bump Proxmox dependency: [GH-8241] * builder/tencent: Add retry on remote api call [GH-8250] * builder/vagrant: Pass through logs from vagrant in real time rather than buffering until command is complete [GH-8274] * builder/vagrant: add insert_key option for toggling whether to add Vagrant's insecure key [GH-8274] * builder/virtualbox: enabled pcie disks usage, but this feature is in beta and won't work out of the box yet [GH-8305] * communicator/winrm: Prevent busy loop while waiting for WinRM connection [GH-8213] * core: Add strftime function in templates [GH-8208] * core: Improve error message when comment is bad [GH-8267] * post-processor/amazon-import: delete intermediary snapshots [GH-8307] * Fix various dropped errors an removed unused code: [GH-8230] [GH-8265] [GH-8276] [GH-8281] [GH-8309] [GH-8311] [GH-8304] [GH-8303] [GH-8293] ### BUG FIXES: * builder/amazon: Fix region copy for non-ebs amazon builders [GH-8212] * builder/amazon: Fix spot instance bug where builder would fail if one availability zone could not support the requested spot instance type, even if another AZ could do so. [GH-8184] * builder/azure: Fix build failure after a retry config generation error. [GH-8209] * builder/docker: Use a unique temp dir for each build to prevent concurrent builds from stomping on each other [GH-8192] * builder/hyperv: Improve filter for determining which files to compact [GH-8248] * builder/hyperv: Use first adapter, rather than failing, when multiple adapters are attached to host OS's VM switch [GH-8234] * builder/openstack: Fix setting openstack metadata for use_blockstorage_volume [GH-8186] * builder/openstack: Warn instead of failing on terminate if instance is already shut down [GH-8176] * post-processor/digitalocean-import: Fix panic when 'image_regions' not set [GH-8179] * provisioner/powershell: Fix powershell syntax error causing failed builds [GH-8195] ## 1.4.4 (October 1, 2019) ### IMPROVEMENTS: **New Core Feature** Error cleanup provisioner [GH-8155] * builder/amazon: Add ability to set `run_volume_tags` [GH-8051] * builder/amazon: Add AWS API call reties on AMI prevalidation [GH-8034] * builder/azure: Refactor client config [GH-8121] * builder/cloudstack: New step to detach iso. [GH-8106] * builder/googlecompute: Fail fast when image name is invalid. [GH-8112] * builder/googlecompute: Users can now query Vault for an Oauth token rather than setting an account file [GH-8143] * builder/hcloud: Allow selecting image based on filters [GH-7945] * builder/hyper-v: Decrease the delay between Hyper-V VM startup and hyper-v builder's ability to send keystrokes to the target VM. [GH-7970] * builder/openstack: Store WinRM password for provisioners to use [GH-7940] * builder/proxmox: Shorten default boot_key_interval to 5ms from 100ms [GH-8088] * builder/proxmox: Allow running the template VM in a Proxmox resource pool [GH-7862] * builder/ucloud: Make ucloud builder's base url configurable [GH-8095] * builder/virtualbox-vm: Make target snapshot optional [GH-8011] [GH-8004] * builder/vmware: Allow user to attach floppy files to remote vmx builds [GH-8132] * builder/yandex: Add ability to retry API requests [GH-8142] * builder/yandex: Support GPU instances and set source image by name [GH-8091] * communicator/ssh: Support for SSH port tunneling [GH-7918] * core: Add a new `floppy_label` option [GH-8099] * core: Added version compatibility to console command [GH-8080] * post-processor/vagrant-cloud: Allow blank access_token for private vagrant box hosting [GH-8097] * post-processor/vagrant-cloud: Allow use of the Artifice post-processor with the Vagrant Cloud post-processor [GH-8018] [GH-8027] * post-processor/vsphere: Removed redundant whitelist check for builders, allowing users to use post-processor without the VMWare builder [GH-8064] ### BUG FIXES: * builder/amazon: Fix FleetID crash. [GH-8013] * builder/amazon: Gracefully handle rate limiting when retrieving winrm password. [GH-8087] * builder/amazon: Fix race condition in spot instance launching [GH-8165] * builder/amazon: Amazon builders now respect ssh_host option [GH-8162] * builder/amazon: Update the AWS sdk to resolve some credential handling issues [GH-8131] * builder/azure: Avoid a panic in getObjectIdFromToken [GH-8047] * builder/googlecompute: Fix crash caused by nil account file. [GH-8102] * builder/hyper-v: Fix when management interface is not part of virtual switch [GH-8017] * builder/openstack: Fix dropped error when creating image client. [GH-8110] * builder/openstack: Fix race condition created when adding metadata [GH-8016] * builder/outscale: Get SSH Host from VM.Nics instead of VM Root [GH-8077] * builder/proxmox: Bump proxmox api dep, fixing bug with checking http status during boot command [GH-8083] * builder/proxmox: Check that disk format is set when pool type requires it [GH-8084] * builder/proxmox: Fix panic caused by cancelling build [GH-8067] [GH-8072] * builder/qemu: Fix dropped error when retrieving version [GH-8050] * builder/vagrant: Fix dropped errors in code and tests. [GH-8118] * builder/vagrant: Fix provisioning boxes, define source and output boxes [GH-7957] * builder/vagrant: Fix ssh and package steps to use source syntax. [GH-8125] * builder/vagrant: Use GlobalID when provided [GH-8092] * builder/virtualbox: Fix windows pathing problem for guest additions checksum download. [GH-7996] * builder/virtualbox: LoadSnapshots succeeds even if machine has no snapshots [GH-8096] * builder/vmware: fix dropped test errors [GH-8170] * core: Fix bug where sensitive variables containing commas were not being properly sanitized in UI calls. [GH-7997] * core: Fix handling of booleans where "unset" is a value distinct from "false". [GH-8021] * core: Fix tests that swallowed errors in goroutines [GH-8094] * core: Fix bug where Packer could no longer run as background process [GH-8101] * core: Fix zsh auto-completion [GH-8160] * communicator/ssh: Friendlier message warning user that their creds may be wrong [GH-8167] * post-processor/amazon-import: Fix non-default encryption. [GH-8113] * post-processor/vagrant-cloud: Fix dropped errors [GH-8156] * provisioner/ansible: Fix provisioner dropped errors [GH-8045] ### BACKWARDS INCOMPATIBILITIES: * core: "sed" template function has been deprecated in favor of "replace" and "replace_all" functions [GH-8119] ## 1.4.3 (August 14, 2019) ### IMPROVEMENTS: * **new builder** UCloud builder [GH-7775] * **new builder** Outscale [GH-7459] * **new builder** VirtualBox Snapshot [GH-7780] * **new builder** JDCloud [GH-7962] * **new post-processor** Exoscale Import post-processor [GH-7822] [GH-7946] * build: Change Makefile to behave differently inside and outside the gopath when generating code. [GH-7827] * builder/amazon: Don't calculate spot bids; Amazon has changed spot pricing to no longer require this. [GH-7813] * builder/google: Add suse-byos-cloud to list of public GCP cloud image projects [GH-7935] * builder/openstack: New `image_min_disk` option [GH-7290] * builder/openstack: New option `use_blockstorage_volume` to set openstack image metadata [GH-7792] * builder/openstack: Select instance network on which to assign floating ip [GH-7884] * builder/qemu: Implement VNC password functionality [GH-7836] * builder/scaleway: Allow removing volume after image creation for Scaleway builder [GH-7887] * builder/tencent: Add `run_tags` to option to tag instance. [GH-7810] * builder/tencent: Remove unnecessary image name validation check. [GH-7786] * builder/tencent: Support data disks for tencentcloud builder [GH-7815] * builder/vmware: Fix intense CPU usage because of poorly handled errors. [GH-7877] * communicator: Use context for timeouts, interruption in ssh and winrm communicators [GH-7868] * core: Change how on-error=abort is handled to prevent EOF errors that mask real issues [GH-7913] * core: Clean up logging vs ui call in step download [GH-7936] * core: New environment var option to allow user to set location of config directory [GH-7912] * core: Remove obsolete Cancel functions from builtin provisioners [GH-7917] * post-processor/vagrant: Add option to allow box Vagrantfiles to be generated during the build [GH-7951] * provisioner/ansible: Add support for installing roles with ansible-galaxy [GH-7916 * provisioner/salt-masterless: Modify file upload to handle non-root case. [GH-7833] ### BUG FIXES: * builder/amazon: Add error to warn users of spot_tags regression. [GH-7989] * builder/amazon: Allow EC2 Spot Fleet packer instances to run in parallel [GH-7818] * builder/amazon: Fix failures and duplication in Amazon region copy and encryption step. [GH-7870] [GH-7923] * builder/amazon: No longer store names of volumes which get deleted on termination inside ebssurrogate artifact. [GH-7829] * builder/amazon: Update aws-sdk-go to v1.22.2, resolving some AssumeRole issues [GH-7967] * builder/azure: Create configurable polling duration and set higher default for image copies to prevent timeouts on successful copies [GH-7920] * builder/digitalocean: increase timeout for Digital Ocean snapshot creation. [GH-7841] * builder/docker: Check container os, not host os, when creating container dir default [GH-7939] * builder/docker: Fix bug where PACKER_TMP_DIR was created with root perms on linux [GH-7905] * builder/docker: Fix file download hang caused by blocking ReadAll call [GH-7814] * builder/google: Fix outdated oauth URL. [GH-7835] [GH-7927] * builder/hyperv: Improve code for detecting IP address [GH-7880] * builder/ucloud: Update the api about stop instance to fix the read-only image build by ucloud-uhost [GH-7914] * builder/vagrant: Fix bug where source_path was being used instead of box_name when generating the Vagrantfile. [GH-7859] * builder/virtualbox: Honor value of 'Comment' field in ssh keypair generation. [GH-7922] * builder/vmware: Fix validation regression that occurred when user provided a checksum file [GH-7804] * buildere/azure: Fix crash with managed images not published to shared image gallery. [GH-7837] * communicator/ssh: Move ssh_interface back into individual builders from ssh communicator to prevent validation issues where it isn't implemented. [GH-7831] * console: Fix console help text [GH-7960] * core: Fix bug in template parsing where function errors were getting swallowed. [GH-7854] * core: Fix regression where a local filepath containing `//` was no longer properly resolving to `/`. [GH-7888] * core: Fix regression where we could no longer access isos on SMB shares. [GH-7800] * core: Make ssh_host template option always override all builders' IP discovery. [GH-7832] * core: Regenerate boot_command PEG code [GH-7977] * fix: clean up help text and fixer order to make sure all fixers are called [GH-7903] * provisioner/inspec: Use --input-file instead of --attrs to avoid deprecation warning [GH-7893] * provisioner/salt-masterless: Make salt-masterless provisioner respect disable_sudo directive for all commands [GH-7774] ## 1.4.2 (June 26, 2019) ### IMPROVEMENTS: * **new feature:** Packer console [GH-7726] * builder/alicloud: cleanup image and snapshot if target image is still not available after timeout [GH-7744] * builder/alicloud: let product API determine the default value of io_optimized [GH-7747] * builder/amazon: Add new `skip_save_build_region` option to fix naming conflicts when building in a region you don't want the final image saved in. [GH-7759] * builder/amazon: Add retry for temp key-pair generation in amazon-ebs [GH-7731] * builder/amazon: Enable encrypted AMI sharing across accounts [GH-7707] * builder/amazon: New SpotInstanceTypes feature for spot instance users. [GH-7682] * builder/azure: Allow users to publish Managed Images to Azure Shared Image Gallery (same Subscription) [GH-7778] * builder/azure: Update Azure SDK for Go to v30.0.0 [GH-7706] * builder/cloudstack: Add tags to instance upon creation [GH-7526] * builder/docker: Better windows defaults [GH-7678] * builder/google: Add feature to import user-data from a file [GH-7720] * builder/hyperv: Abort build if there's a name collision [GH-7746] * builder/hyperv: Clarify pathing requirements for hyperv-vmcx [GH-7790] * builder/hyperv: Increase MaxRamSize to match modern Windows [GH-7785] * builder/openstack: Add image filtering on properties. [GH-7597] * builder/qemu: Add additional disk support [GH-7791] * builder/vagrant: Allow user to override vagrant ssh-config details [GH-7782] * builder/yandex: Gracefully shutdown instance, allow metadata from file, and create preemptible instance type [GH-7734] * core: scrub out sensitive variables in scrub out sensitive variables logs [GH-7743] ### BUG FIXES: * builder/alicloud: Fix describing snapshots issue when image_ignore_data_disks is provided [GH-7736] * builder/amazon: Fix bug in region copy which produced badly-named AMIs in the build region. [GH-7691] * builder/amazon: Fix failure that happened when spot_tags was set but ami_tags wasn't [GH-7712] * builder/cloudstack: Update go-cloudstack sdk, fixing compatibility with CloudStack v 4.12 [GH-7694] * builder/proxmox: Update proxmox-api-go dependency, fixing issue calculating VMIDs. [GH-7755] * builder/tencent: Correctly remove tencentcloud temporary keypair. [GH-7787] * core: Allow timestamped AND colorless ui messages [GH-7769] * core: Apply logSecretFilter to output from ui.Say [GH-7739] * core: Fix "make bin" command to use reasonable defaults. [GH-7752] * core: Fix user var interpolation for variables set via -var-file and from command line [GH-7733] * core: machine-readable UI now writes UI calls to logs. [GH-7745] * core: Switch makefile to use "GO111MODULE=auto" to allow for modern gomodule usage. [GH-7753] * provisioner/ansible: prevent nil pointer dereference after a language change [GH-7738] * provisioner/chef: Accept chef license by default to prevent hangs in latest Chef [GH-7653] * provisioner/powershell: Fix crash caused by error in retry logic check in powershell provisioner [GH-7657] * provisioner/powershell: Fix null file descriptor error that occurred when remote_path provided is a directory and not a file. [GH-7705] ## 1.4.1 (May 15, 2019) ### IMPROVEMENTS: * **new builder:** new proxmox builder implemented [GH-7490] * **new builder:** new yandex cloud builder implemented [GH-7484] * **new builder:** new linode builder implemented [GH-7508] * build: Circle CI now generates test binaries for all pull requests [GH-7624] [GH-7625] [GH-7630] * builder/alicloud: Support encryption with default service key [GH-7574] * builder/amazon: Users of chroot and ebssurrogate builders may now choose between "x86_64" and "arm64" architectures when registering their AMIs. [GH-7620] * builder/amazon: Users of the ebssurrogage builder may now choose to omit certain launch_block_devices from the final AMI mapping by using the omit_from_artifact feature. [GH-7612] * builder/azure: Update Azure SDK [GH-7563] * builder/docker: Better error messaging with container downloads. [GH-7513] * builder/google: add image encryption support [GH-7551] * builder/hyperv: Add keep_registered option to hyperv [GH-7498] * builder/qemu: Replace dot-based parsing with hashicorp/go-version [GH-7614] * builder/vmware: Add 30 minute timeout for destroying a VM [GH-7553] * core: Cleanup cache of used port after closing [GH-7613] * core: New option to set number of builds running in parallel & test BuildCommand more [GH-7501] * packer compiles on s390x [GH-7567] * provisioner/file: Added warnings about writeable locations [GH-7494] ### BUG FIXES: * builder/amazon: Fix bug that always encrypted build region with default key. [GH-7507] * builder/amazon: Fix bug that wasn't deleting unencrypted temporary snapshots [GH-7521] * builder/amazon: Fix EBSsurrogate copy, encryption, and deletion of temporary unencrypted amis. [GH-7598] * builder/hyperv: Fixes IP detection error if more than one VMNetworkAdapter is found [GH-7480] * builder/qemu: Fix mistake switching ssh port mix/max for vnc port min/max [GH-7615] * builder/vagrant: Fix bug with builder and vagrant-libvirt plugin [GH-7633] * builder/virtualbox: Don't fail download when checksum is not set. [GH-7512] * builder/virtualbox: Fix ovf download failures by using local ovf files in place instead of symlinking [GH-7497] * builder/vmware: Fix panic configuring VNC for remote builds [GH-7509] * core/build: Allow building Packer on solaris by removing progress bar and tty imports on solaris [GH-7618] * core: Fix race condition causing hang [GH-7579] * core: Fix tty related panics [GH-7517] * core: Step download: Always copy local files on windows rather than symlinking them [GH-7575] * packer compiles on Solaris again [GH-7589] [GH-7618] * post-processor/vagrant: Fix bug in retry logic that caused failed upload to report success. [GH-7554] ## 1.4.0 (April 11, 2019) ### IMPROVEMENTS: * builder/alicloud: Improve error message for conflicting images name [GH-7415] * builder/amazon-chroot: Allow users to specify custom block device mapping [GH-7370] * builder/ansible: Documentation fix explaining how to use ansible 2.7 + winrm [GH-7461] * builder/azure-arm: specify zone resilient image from config [GH-7211] * builder/docker: Add support for windows containers [GH-7444] * builder/openstack: Allow both ports and networks in openstack builder [GH-7451] * builder/openstack: Expose force_delete for openstack builder [GH-7395] * builder/OpenStack: Support Application Credential Authentication [GH-7300] * builder/virtualbox: Add validation for 'none' communicator. [GH-7419] * builder/virtualbox: create ephemeral SSH key pair for build process [GH-7287] * core: Add functionality to marshal a Template to valid Packer JSON [GH-7339] * core: Allow user variables to be interpreted within the variables section [GH-7390] * core: Incorporate the go-getter to handle downloads [GH-6999] * core: Lock Packer VNC ports using a lock file to prevent collisions [GH-7422] * core: Print VerifyChecksum log for the download as ui.Message output [GH-7387] * core: Users can now set provisioner timeouts [GH-7466] * core: Switch to using go mod for managing dependencies [GH-7270] * core: Select a new VNC port if initial port is busy [GH-7423] * post-processor/googlecompute-export: Set network project id to builder [GH-7359] * post-processor/vagrant-cloud: support for the vagrant builder [GH-7397] * post-processor/Vagrant: Option to ignore SSL verification when using on- premise vagrant cloud [GH-7377] * postprocessor/amazon-import: Support S3 and AMI encryption. [GH-7396] * provisioner/shell provisioner/windows-shell: allow to specify valid exit codes [GH-7385] * core: Filter sensitive variables out of the ui as well as the logs [GH-7462] ### BUG FIXES: * builder/alibaba: Update to latest Alibaba Cloud official image to fix acceptance tests [GH-7375] * builder/amazon-chroot: Fix building PV images and where mount_partition is set [GH-7337] * builder/amazon: Fix http_proxy env var regression [GH-7361] * builder/azure: Fix: Power off before taking snapshot (windows) [GH-7464] * builder/hcloud: Fix usage of freebsd64 rescue image [GH-7381] * builder/vagrant: windows : fix docs and usage [GH-7416] [GH-7417] * builder/vmware-esxi: properly copy .vmxf files in remote vmx builds [GH-7357] * core: fix bug where Packer didn't pause in debug on certain linux platforms. [GH-7352] * builder/amazon: Fix bug copying encrypted images between regions [GH-7342] ### BACKWARDS INCOMPATIBILITIES: * builder/amazon: Change `temporary_security_group_source_cidr` to `temporary_security_group_source_cidrs` and allow it to accept a list of strings. [GH-7450] * builder/amazon: If users do not pass any encrypt setting, retain any initial encryption setting of the AMI. [GH-6787] * builder/docker: Update docker's default config to use /bin/sh instead of /bin/bash [GH-7106] * builder/hyperv: Change option names cpu->cpus and ram_size->memory to bring naming in line with vmware and virtualbox builders [GH-7447] * builder/oracle-classic: Remove default ssh_username from oracle classic builder, but add note to docs with oracle's default user. [GH-7446] * builder/scaleway: Renamed attribute api_access_key to organization_id. [GH-6983] * Change clean_image name and clean_ami_name to a more general clean_resource name for Googlecompute, Azure, and AWS builders. [GH-7456] * core/post-processors: Change interface for post-processors to allow an overridable default for keeping input artifacts. [GH-7463] ## 1.3.5 (February 28, 2019) ### IMPROVEMENTS: * builder/alicloud: Update aliyun sdk to support eu-west-1 region [GH-7338] * builder/amazon: AWS users can now use the Vault AWS engine to generate temporary credentials. [GH-7282] * builder/azure: IMDS to get subscription for Azure MSI [GH-7332] * builder/openstack: Replaced deprecated compute/ api with imageservice/ [GH-7038] * builder/virtualbox: New "guest_additions_interface" option to enable attaching via a SATA interface. [GH-7298] * builder/vmware: Add `cores` option for specifying the number of cores per socket. [GH-7191] * bulder/openstac: Deprecated compute/v2/images API [GH-7268] * core: Add validation check to help folks who swap their iso_path and checksum_path [GH-7311] * fixer/amazon: Make the amazon-private-ip fixer errors more visible [GH-7336] * post-processor/googlecompute-export: Extend auth for the GCE-post-processors to act like the GCE builder. [GH-7222] * post-processor/googlecompute-import: Extend auth for the GCE-post-processors to act like the GCE builder. [GH-7222] * post-processor/manifest: Add "custom_data" key to packer manifest post- processor [GH-7248] ### BUG FIXES: * builder/amazon: Fix support for aws-us-gov [GH-7347] * builder/amazon: Move snapshot deletion to cleanup phase. [GH-7343] * builder/azure: Fixed Azure interactive authentication [GH-7276] * builder/cloudstack: Updated sdk version; can now use ostype name in template_os option. [GH-7264] * builder/google: Change metadata url to use a FQDN fixing bug stemming from differing DNS/search domains. [GH-7260] * builder/hyper-v: Fix integer overflows in 32-bit builds [GH-7251] * builder/hyper-v: Fix regression where we improperly handled spaces in switch names [GH-7266] * builder/openstack: Pass context So we know to cancel during WaitForImage [GH-7341] * builder/vmware-esxi: Strip \r\n whitespace from end of names of files stored on esxi. [GH-7310] * builder/vmware: Add "--noSSLVerify" to args in ovftool Validation [GH-7314] * core: clean up Makefile [GH-7254][GH-7265] * core: Fixes mismatches in checksums for dependencies for Go 1.11.4+ [GH-7261] * core: make sure 'only' option is completely ignored by post-processors [GH-7262] * core: name a post-processor to its type when it is not named [GH-7330] * provisioner/salt: Force powershell to overwrite duplicate files [GH-7281] ### Features: * **new builder** `vagrant` allows users to call vagrant to provision starting from vagrant boxes and save them as new vagrant boxes. [GH-7221] * **new builder:** `hyperone` for building new images on HyperOne Platform on top of existing image or from the scratch with the use of chroot. [GH-7294] * **new post-processor** `digitalocean-import`Add digitalocean-import post- processor. [GH-7060] * **new provisioner**`inspec` Added inspec.io provisioner [GH-7180] * communicator: Add configurable pause after communicator can connect but before it performs provisioning tasks [GH-7317] [GH-7351] ## 1.3.4 (January 30, 2019) ### IMPROVEMENTS: * builder/alicloud: delete copied image and snapshots if corresponding options are specified [GH-7050] * builder/amazon: allow to interpolate more variables [GH-7059] * builder/amazon: Check that the KMS key ID is valid [GH-7090] * builder/amazon: Clean up logging for aws waiters so that it only runs once per builder [GH-7080] * builder/amazon: don't Cleanup Temp Keys when there is no communicator to avoid a panic [GH-7100] [GH-7095] * builder/amazon: Don't try to guess region from metadata if not set & update aws-sdk-go [GH-7230] * builder/amazon: Import error messages should now contain reason for failure [GH-7207] * builder/azure: add certificate authentication [GH-7189] * builder/azure: allow to configure disk caching [GH-7061] * builder/azure: use deallocate instead of just power-off [GH-7203] * builder/hyperv: Add support for legacy network adapters on Hyper-V. [GH-7128] * builder/hyperv: Allow user to set `version` option in the New-VM command. [GH-7136] * builder/openstack: Add `volume_size` option [GH-7130] * builder/openstack: Don't require network v2 [GH-6933] * builder/openstack: Support for tagging new images [GH-7037] * builder/qemu: Add configuration options to specify cpu count and memory size [GH-7156] * builder/qemu: Add support for whpx accelerator to qemu builder [GH-7151] * builder/vmware: Escape query as suggested in issue #7200 [GH-7223] * core/shell: Add env vars "PACKER_HTTP_IP" and "PACKER_HTTP_PORT" to shell provisioners [GH-7075] * core: allow to use `-except` on post-processors [GH-7183] * core: Clean up internal handling and creation of temporary directories [GH-7102] * core: Deprecate mitchellh/go-homedir package in favor of os/user [GH-7062] * core: Download checksum match failures will now log the received checksum. [GH-7210] * core: Explicitly set ProxyFromEnvironment in httpclients when creating an aws session [GH-7226] * core: make packer inspect not print sensitive variables [GH-7084] * post-processor/google: Add new `guest-os-features` option. [GH-7218] * postprocessor/docker-import: Added `change` support [GH-7127] * provisioner/ansible-remote: add `-o IdentitiesOnly=yes` as a default flag [GH-7115] * provisioner/chef-client: Elevated support for chef-client provisioner [GH-7078] * provisioner/puppet: Elevated support for puppet-* provisioner [GH-7078] * provisioner/windows-restart: wait for already-scheduled reboot [GH-7056] and ignore reboot specific errors [GH-7071] ### BUG FIXES: * builder/azure: Ensure the Windows Guest Agent is fully functional before Sysprep is executed. [GH-7176] * builder/azure: Fix snapshot regression [GH-7111] * builder/docker: Ensure that entrypoint and arguments get passed to docker, not the image. [GH-7091] * builder/hcloud: fix go mod dependency [GH-7099] * builder/hcloud: prevent panic when ssh key was not passed [GH-7118] * builder/hyperv: Fix the Hyper-V gen 1 guest boot order. [GH-7147] * builder/hyperv: hyper-v builder no longer ignores `ssh_host` option. [GH-7154] * builder/oracle-oci: Fix crash that occurs when image is nil [GH-7126] * builder/parallels: Fix attaching prl tools [GH-7158] * builder/virtualbox: Fix handling of portcount argument for version 6 beta [GH-7174] [GH-7094] * builder/vmware: Fix bug caused by 'nil' dir field in artifact struct when building locally [GH-7116] * communicator/docker: Fix docker file provisioner on Windows [GH-7163] * core: prioritize AppData over default user directory ( UserProfile ) [GH-7166] * core: removed a flaky race condition in tests [GH-7119] * postprocessor/vsphere: Stop setting HDDOrder, since it was breaking uploads [GH-7108] ## 1.3.3 (December 5, 2018) ### IMPROVEMENTS: * builder/alicloud: Add options for system disk properties [GH-6939] * builder/alicloud: Apply tags to relevant snapshots [GH-7040] * builder/alicloud: Support creating image without data disks [GH-7022] * builder/amazon: Add option for skipping TLS verification [GH-6842] * builder/azure: Add options for Managed Image OS Disk and Data Disk snapshots [GH-6980] * builder/hcloud: Add `snapshot_labels` option to hcloud builder [GH-7046] * builder/hcloud: Add ssh_keys config to hcloud builder [GH-7028] * builder/hcloud: Update hcloud-go version and support builds using rescue mode [GH-7034] * builder/oracle: Parameterized volume size support for Oracle classic builder [GH-6918] * builder/parallels: Add configuration options to parallels builder to specify cpu count and memory size [GH-7018] * builder/virtualbox: Add configuration options to virtualbox builder to specify cpu count and memory size [GH-7017] * builder/virtualbox: expose the VBoxManage export --iso option [GH-5950] * builder/vmware: Add configuration options to vmware builder to specify cpu count and memory size [GH-7019] * builder/vmware: Add new display_name template option [GH-6984] * builder/vmware: Extend vmware-vmx builder to allow esxi builds. [GH-4591] [GH-6927] * builder/vmware: Validate username/password for ovftool during prepare. [GH-6977] * builder/vmware: Warn users if their vmx_data overrides data that Packer uses the template engine to set in its default vmx template. [GH-6987] * communicator/ssh: Expand user path for SSH private key [GH-6946] * core: Add a sed template engine [GH-6580] * core: More explicit error message in rpc/ui.go [GH-6981] * core: Replaced unsafe method of determining homedir with os/user implementation [GH-7036] * core: Update vagrantfile's go version. [GH-6841] * post-processor/amazon-import: Support ova, raw, vmdk, and vhdx formats in the amazon-import post-processor. [GH-6938] * post-processor/vsphere-template: Add option to snapshot vm before marking as template [GH-6969] * provisioner/breakpoint: Add a new breakpoint provisioner. [GH-7058] * provisioner/powershell: Allow Powershell provisioner to use service accounts [GH-6972] * provisioner/shell: Add PauseAfter option to shell provisioner [GH-6913] ### BUG FIXES: * builder/amazon: Better error handling of region/credential guessing from metadata [GH-6931] * builder/amazon: move region validation to run so that we don't break validation when no credentials are set [GH-7032] * builder/hyperv: Remove -Copy:$false when calling Hyper-V\Compare-VM compatability report [GH-7030] * builder/qemu: Do not set detect-zeroes option when we want it "off" [GH-7064] * builder/vmware-esxi: Create export directories for vmx and ovf file types [GH-6985] * builder/vmware: Correctly parse version for VMware Fusion Tech Preview [GH-7016] * builder/vmware: Escape vSphere username when putting it into the export call [GH-6962] * post-processor/vagrant: Add "hvf" as a libvirt driver [GH-6955] * provisioner/ansible: inventory is no longer set to inventory_directory [GH-7065] ## 1.3.2 (October 29, 2018) ### IMPROVEMENTS: * builder/alicloud: Add new `disable_stop_instance` option. [GH-6764] * builder/alicloud: Support adding tags to image. [GH-6719] * builder/alicloud: Support ssh with private ip address. [GH-6688] * builder/amazon: Add support to explicitly control ENA support [GH-6872] * builder/amazon: Add suppport for `vpc_filter`, `subnet_filter`, and `security_group_filter`. [GH-6374] * builder/amazon: Add validation for required `device_name` parameter in `block_device_mappings`. [GH-6845] * builder/amazon: Clean up security group wait code. [GH-6843] * builder/amazon: Update aws-sdk-go to v1.15.54, adding support for `credential_source`. [GH-6849] * builder/amazon: Use DescribeRegions for aws region validation. [GH-6512], [GH-6904] * builder/azure: Add new `shared_image_gallery` option. [GH-6798] * builder/googlecompute: Return an error if `startup_script_file` is specified, but file does not exist. [GH-6848] * builder/hcloud: Add Hetzner Cloud builder. [GH-6871] * builder/openstack: Add new `disk_format` option. [GH-6702] * builder/openstack: Fix bug where `source_image_name` wasn't being used to properly find a UUID. [GH-6751] * builder/openstack: Wait for volume availability when cleaning up [GH-6703] * builder/qemu: Add `disk_detect_zeroes` option. [GH-6827] * builder/scaleway: Add `boottype` parameter to config. [GH-6772] * builder/scaleway: Update scaleway-cli vendor. [GH-6771] * core: New option to add timestamps to UI output. [GH-6784] * post-processor/vagrant-cloud: Validate vagrant cloud auth token doing an auth request [GH-6914] * provisioner/file: Improve error messaging when file destination is a directory with no trailing slash. [GH-6756] * provisioner/powershell: Provide better error when Packer can't find Powershell executable. [GH-6817] * provisioner/shell-local: Add ability to specify OSs where shell-local can run [GH-6878] ### BUG FIXES: * builder/alicloud: Fix ssh configuration pointer issues that could cause a bug [GH-6720] * builder/alicloud: Fix type error in step_create_tags [GH-6763] * builder/amazon: Error validating credentials is no longer obscured by a region validation error. and some region validation refactors and improvements [GH-6865] * builder/amazon: Fix error calculating defaults in AWS waiters. [GH-6727] * builder/amazon: Increase default wait for image import to one hour. [GH-6818] * builder/amazon: Waiter now fails rather than hanging for extra time when an image import fails. [GH-6747] * builder/azure: Updated Azure/go-ntlmssp dependency to resolve an issue with the winrm communicator not connecting to Windows machines requiring NTLMv2 session security * builder/digitalocean: Fix ssh configuration pointer issues that could cause a panic [GH-6729] * builder/hyperv/vmcx: Allow to set generation from buildfile [GH-6909] * builder/scaleway: Fix issues with ssh keys. [GH-6768] * core: Fix error where logging was always enabled when Packer was run from inside Terraform. [GH-6758] * core: Fix issue with with names containing spaces in ESX5Driver and in ssh communicator [GH-6891], [GH-6823] * core: Fix logger so it doesn't accidentally try to format unescaped strings. [GH-6824] * core: Fix race conditions in progress bar code [GH-6858], [GH-6788], [GH-6851] * core: Fix various places in multiple builders where config was not being passed as a pointer. [GH-6739] * post-processor/manifest: No longer provides an empty ID string for Azure's managed image artifact [GH-6822] * provisioner/powershell: Fix a bug in the way we set the ProgressPreference variable in the default `execute_command` [GH-6838] * provisioner/windows-restart: Fix extraneous break which forced early exit from our wait loop. [GH-6792] ## 1.3.1 (September 13, 2018) ### IMPROVEMENTS: * builder/amazon: automatically decode encoded authorization messages if possible [GH-5415] * builder:amazon: Optional cleanup of the authorized keys file [GH-6713] * builder/qemu: Fixed bug where a -device in the qemuargs would override the default network settings, resulting in no network [GH-6807] ### BUG FIXES: * builder/amazon: fix bugs relating to spot instances provisioning [GH-6697] [GH-6693] * builder/openstack: fix ssh keypair not attached [GH-6701] * core: progressbar: fix deadlock locking builds after first display [GH-6698] ## 1.3.0 (September 11, 2018) ### IMPROVEMENTS: * azure/arm: Retry cleanup of individual resources on error [GH-6644] * builder/alicloud: Support source image coming from marketplace [GH-6588] * builder/amazon-chroot: Add new `root_volume_type` option. [GH-6669] * builder/amazon-chroot: If you have a PV source AMI, with the Amazon Chroot builder, and the destination AMI is type HVM, you can now enable ena_support, example: [GH-6670] * builder/amazon-chroot: New feature `root_volume_tags` to tag the created volumes. [GH-6504] * builder/amazon: Create a random interim AMI name when encrypt_boot is true so that ami name is not searchable. [GH-6657] * builder/azure: Implement clean_image_name template engine. [GH-6558] * builder/cloudstack: Add option to use a fixed port via public_port. [GH-6532] * builder/digitalocean: Add support for tagging to instances [GH-6546] * builder/googlecompute: Add new `min_cpu_platform` feature [GH-6607] * builder/googlecompute: Update the list of public image projects that we search, based on GCE documentation. [GH-6648] * builder/lxc: Allow unplivileged LXC containers. [GH-6279] * builder/oci: Add `metadata` feature to Packer config. [GH-6498] * builder/openstack: Add support for getting config from clouds-public.yaml. [GH-6595] * builder/openstack: Add support for ports. [GH-6570] * builder/openstack: Add support for source_image_filter. [GH-6490] * builder/openstack: Migrate floating IP usage to Network v2 API from Compute API. [GH-6373] * builder/openstack: Support Block Storage volumes as boot volume. [GH-6596] * builder/oracle-oci: Add support for freeform tagging of OCI images [GH-6338] * builder/qemu: add ssh agent support. [GH-6541] * builder/qemu: New `use_backing_file` feature [GH-6249] * builder/vmware-iso: Add support for disk compaction [GH-6411] * builder/vmware-iso: Try to use ISO files uploaded to the datastore when building remotely instead of uploading them freshly every time [GH-5165] * command/validate: Warn users if config needs fixing. [GH-6423] * core: Add a 'split' function to parse template variables. [GH-6357] * core: Add a template function allowing users to read keys from consul [GH-6577] * core: Add a template function allowing users to read keys from vault [GH-6533] * core: Add progress-bar to download step. [GH-5851] * core: Create a new root-level Packer template option, "sensitive-variables" which allows users to list which variables they would like to have scrubbed from the Packer logs. [GH-6610] * core: Create new config options, "boot_keygroup_interval" and "boot_key_interval" that can be set at the builder-level to supercede PACKER_KEY_INTERVAL for the bootcommand. [GH-6616] * core: Deduplicate ui and log lines that stream to terminal [GH-6611] * core: Refactor and deduplicate ssh code across builders. This should be a no- op but is a big win for maintainability. [GH-6621] [GH-6613] * post-processor/compress: Add support for xz compression [GH-6534] * post-processor/vagrant: Support for Docker images. [GH-6494] * post-processor/vsphere: Add new `esxi_host` option. [GH-5366] * postprocessor/vagrant: Add support for Azure. [GH-6576] * provisioner/ansible: Add new "extra var", packer_http_addr. [GH-6501] * provisioner/ansible: Enable {{.WinRMPassword}} template engine. [GH-6450] * provisioner/shell-local: Create PACKER_HTTP_ADDR environment variable [GH-6503] ### BUG FIXES: * builder/amazon-ebssurrogate: Clean up volumes at end of build. [GH-6514] * builder/amazon: Increase default waiter timeout for AWS WaitUntilImageAvailable command [GH-6601] * builder/amazon: Increase the MaxRetries in the Amazon client from the default to 20, to work around users who regularly reach their requestlimit and are being throttled. [GH-6641] * builder/amazon: Properly apply environment overrides to our custom-written waiters. [GH-6649] * builder/azure: Generated password satisfies Azure password requirements [GH-6480] * builder/hyper-v: Builder no longer errors if skip_compaction isn't true when skip_export is true, and compaction efficiency is improved [GH-6393] * builder/lxc: Correctly pass "config" option to "lxc launch". [GH-6563] * builder/lxc: Determine lxc root according to the running user [GH-6543] * builder/lxc: Fix file copying for unprivileged LXC containers [GH-6544] * builder/oracle-oci: Update OCI sdk, fixing validation bug that occurred when RSA key was encrypted. [GH-6492] * builder/vmware-iso: Fix crash caused by invalid datacenter url. [GH-6529] * builder/vmware: Maintain original boot order during CreateVMX step for vmware-iso builder [GH-6204] * communicator/chroot: Fix quote escaping so that ansible provisioner works properly. [GH-6635] * core: Better error handling in downloader when connection error occurs. [GH-6557] * core: Fix broken pathing checks in checksum files. [GH-6525] * provisioner/shell Create new template option allowing users to choose to source env vars from a file rather than declaring them inline. This resolves a bug that occurred when users had complex quoting in their `execute_command`s [GH-6636] * provisioner/shell-local: Windows inline scripts now default to being appended with ".cmd", fixing a backwards incompatibility in v1.2.5 [GH-6626] * provisioner/windows-restart: Provisioner now works when used in conjunction with SSH communicator [GH-6606] ### BACKWARDS INCOMPATIBILITIES: * builder/amazon: "owners" field on source_ami_filter is now required for secuirty reasons. [GH-6585] * builder/vmware-iso: validation will fail for templates using esxi that have the "disk_type_id" set to something other than "thin" or "" and that do not have "skip_compaction": true also set. Use `packer fix` to fix this. [GH-6411] ## 1.2.5 (July 16, 2018) ### BUG FIXES: * builder/alickoud: Fix issue where internet_max_bandwidth_out template option was not being passed to builder. [GH-6416] * builder/alicloud: Fix an issue with VPC cleanup. [GH-6418] * builder/amazon-chroot: Fix communicator bug that broke chroot builds. [GH-6363] * builder/amazon: Replace packer's waiters with those from the AWS sdk, solving several timeout bugs. [GH-6332] * builder/azure: update azure-sdk-for-go, fixing 32-bit build errors. [GH-6479] * builder/azure: update the max length of managed_image_resource_group to match new increased length of 90 characters. [GH-6477] * builder/hyper-v: Fix secure boot template feature so that it properly passes the temolate for MicrosoftUEFICertificateAuthority. [GH-6415] * builder/hyperv: Fix bug in HyperV IP lookups that was causing breakages in FreeBSD/OpenBSD builds. [GH-6416] * builder/qemu: Fix error race condition in qemu builder that caused convert to fail on ubuntu 18.x [GH-6437] * builder/qemu: vnc_bind_address was not being passed to qemu. [GH-6467] * builder/virtualbox: Allow iso_url to be a symlink. [GH-6370] * builder/vmware: Don't fail on DHCP lease files that cannot be read, fixing bug where builder failed on NAT networks that don't serve DHCP. [GH-6415] * builder/vmware: Fix bug where we couldn't discover IP if vm_name differed from the vmx displayName. [GH-6448] * builder/vmware: Fix validation to prevent hang when remopte_password is not sent but vmware is building on esxi. [GH-6424] * builder/vmware:Correctly default the vm export format to ovf; this is what the docs claimed we already did, but we didn't. [GH-4538] * communicator/winrm: Revert an attempt to determine whether remote upload destinations were files or directories, as this broke uploads on systems without Powershell installed. [GH-6481] * core: Fix bug in parsing of iso checksum files that arose when setting iso_url to a relative filepath. [GH-6488] * core: Fix Packer crash caused by improper error handling in the downloader. [GH-6381] * fix: Fix bug where fixer for ssh_private_ip that failed when boolean values are passed as strings. [GH-6458] * provisioner/powershell: Make upload of powershell variables retryable, in case of system restarts. [GH-6388] ### IMPROVEMENTS: * builder/amazon: Add the ap-northeast-3 region. [GH-6385] * builder/amazon: Spot requests may now have tags applied using the `spot_tags` option [GH-5452] * builder/cloudstack: Add support for Projectid and new config option prevent_firewall_changes. [GH-6487] * builder/openstack: Add support for token authorization and cloud.yaml. [GH-6362] * builder/oracle-oci: Add new "instance_name" template option. [GH-6408] * builder/scaleway: Add new "bootscript" parameter, allowing the user to not use the default local bootscript [GH-6439] * builder/vmware: Add support for linked clones to vmware-vmx. [GH-6394] * debug: The -debug flag will now cause Packer to pause between provisioner scripts in addition to Packer steps. [GH-4663] * post-processor/googlecompute-import: Added new googlecompute-import post- processor [GH-6451] * provisioner/ansible: Add new "playbook_files" option to execute multiple playbooks within one provisioner call. [GH-5086] ## 1.2.4 (May 29, 2018) ### BUG FIXES: * builder/amazon: Can now force the chroot builder to mount an entire block device instead of a partition [GH-6194] * builder/azure: windows-sql-cloud is now in the default list of projects to check for provided images. [GH-6210] * builder/chroot: A new template option, `nvme_device_path` has been added to provide a workaround for users who need the amazon-chroot builder to mount a NVMe volume on their instances. [GH-6295] * builder/hyper-v: Fix command for mounting multiple disks [GH-6267] * builder/hyperv: Enable IP retrieval for Server 2008 R2 hosts. [GH-6219] * builder/hyperv: Fix bug in MAC address specification on Hyper-V. [GH-6187] * builder/parallels-pvm: Add missing disk compaction step. [GH-6202] * builder/vmware-esxi: Remove floppy files from the remote server on cleanup. [GH-6206] * communicator/winrm: Updated dependencies to fix a race condition [GH-6261] * core: When using `-on-error=[abort|ask]`, output the error to the user. [GH-6252] * provisioner/puppet: Extra-Arguments are no longer prematurely interpolated.[GH-6215] * provisioner/shell: Remove file stat that was causing problems uploading files [GH-6239] ### IMPROVEMENTS: * builder/amazon: Amazon builders other than `chroot` now support T2 unlimited instances [GH-6265] * builder/azure: Allow device login for US government cloud. [GH-6105] * builder/azure: Devicelogin Support for Windows [GH-6285] * builder/azure: Enable simultaneous builds within one resource group. [GH-6231] * builder/azure: Faster deletion of Azure Resource Groups. [GH-6269] * builder/azure: Updated Azure SDK to v15.0.0 [GH-6224] * builder/hyper-v: Hyper-V builds now connect to vnc display by default when building [GH-6243] * builder/hyper-v: New `use_fixed_vhd_format` allows vm export in an Azure- compatible format [GH-6101] * builder/hyperv: New config option for specifying what secure boot template to use, allowing secure boot of linux vms. [GH-5883] * builder/qemu: Add support for hvf accelerator. [GH-6193] * builder/scaleway: Fix SSH communicator connection issue. [GH-6238] * core: Add opt-in Packer top-level command autocomplete [GH-5454] * post-processor/shell-local: New options have been added to create feature parity with the shell-local provisioner. This feature now works on Windows hosts. [GH-5956] * provisioner/chef: New config option allows user to skip cleanup of chef client staging directory. [GH-4300] * provisioner/shell-local: Can now access automatically-generated WinRM password as variable [GH-6251] * provisoner/shell-local: New options have been added to create feature parity with the shell-local post-processor. This feature now works on Windows hosts. [GH-5956] * builder/virtualbox: Use HTTPS to download guest editions, now that it's available. [GH-6406] ## 1.2.3 (April 25, 2018) ### BUG FIXES: * builder/azure: Azure CLI may now be logged into several accounts. [GH-6087] * builder/ebssurrogate: Snapshot all launch devices. [GH-6056] * builder/hyper-v: Fix CopyExportedVirtualMachine script so it works with links. [GH-6082] * builder/oracle-classic: Fix panics when cleaning up resources that haven't been created. [GH-6095] * builder/parallels: Allow user to cancel build while the OS is starting up. [GH-6166] * builder/qemu: Avoid warning when using raw format. [GH-6080] * builder/scaleway: Fix compilation issues on solaris/amd64. [GH-6069] * builder/virtualbox: Fix broken scancodes in boot_command. [GH-6067] * builder/vmware-iso: Fail in validation if user gives wrong remote_type value. [GH-4563] * builder/vmware: Fixed a case-sensitivity issue when determining the network type during the cloning step in the vmware-vmx builder. [GH-6057] * builder/vmware: Fixes the DHCP lease and configuration pathfinders for VMware Player. [GH-6096] * builder/vmware: Multi-disk VM's can be properly handled by the compacting stage. [GH-6074] * common/bootcommand: Fix numerous bugs in the boot command code, and make supported features consistent across builders. [GH-6129] * communicator/ssh: Stop trying to discover whether destination is a directory from uploader. [GH-6124] * post-processor/vagrant: Large VMDKs should no longer show a 0-byte size on OS X. [GH-6084] * post-processor/vsphere: Fix encoding of spaces in passwords for upload. [GH-6110] * provisioner/ansible: Pass the inventory_directory configuration option to ansible -i when it is set. [GH-6065] * provisioner/powershell: fix bug with SSH communicator + cygwin. [GH-6160] * provisioner/powershell: The {{.WinRMPassword}} template variable now works with parallel builders. [GH-6144] ### IMPROVEMENTS: * builder/alicloud: Update aliyungo common package. [GH-6157] * builder/amazon: Expose more source ami data as template variables. [GH-6088] * builder/amazon: Setting `force_delete` will only delete AMIs owned by the user. This should prevent failures where we try to delete an AMI with a matching name, but owned by someone else. [GH-6111] * builder/azure: Users of Powershell provisioner may access the randomly- generated winrm password using the template variable {{.WinRMPassword}}. [GH-6113] * builder/google: Users of Powershell provisioner may access the randomly- generated winrm password using the template variable {{.WinRMPassword}}. [GH-6141] * builder/hyper-v: User can now configure hyper-v disk block size. [GH-5941] * builder/openstack: Add configuration option for `instance_name`. [GH-6041] * builder/oracle-classic: Better validation of destination image name. [GH-6089] * builder/oracle-oci: New config options for user data and user data file. [GH-6079] * builder/oracle-oci: use the official OCI sdk instead of handcrafted client. [GH-6142] * builder/triton: Add support to Skip TLS Verification of Triton Certificate. [GH-6039] * provisioner/ansible: Ansible users may provide a custom inventory file. [GH-6107] * provisioner/file: New `generated` tag allows users to upload files created during Packer run. [GH-3891] ## 1.2.2 (March 26, 2018) ### BUG FIXES: * builder/amazon: Fix AWS credential defaulting [GH-6019] * builder/LXC: make sleep timeout easily configurable [GH-6038] * builder/virtualbox: Correctly send multi-byte scancodes when typing boot command. [GH-5987] * builder/virtualbox: Special boot-commands no longer overwrite previous commands [GH-6002] * builder/vmware: Default to disabling XHCI bus for USB on the vmware-iso builder. [GH-5975] * builder/vmware: Handle multiple devices per VMware network type [GH-5985] * communicator/ssh: Handle errors uploading files more gracefully [GH-6033] * provisioner/powershell: Fix environment variable file escaping. [GH-5973] ### IMPROVEMENTS: * builder/amazon: Added new region `cn-northwest-1`. [GH-5960] * builder/amazon: Users may now access the amazon-generated administrator password [GH-5998] * builder/azure: Add support concurrent deployments in the same resource group. [GH-6005] * builder/azure: Add support for building with additional disks. [GH-5944] * builder/azure: Add support for marketplace plan information. [GH-5970] * builder/azure: Make all command output human readable. [GH-5967] * builder/azure: Respect `-force` for managed image deletion. [GH-6003] * builder/google: Add option to specify a service account, or to run without one. [GH-5991] [GH-5928] * builder/oracle-oci: Add new "use_private_ip" option. [GH-5893] * post-processor/vagrant: Add LXC support. [GH-5980] * provisioner/salt-masterless: Added Windows support. [GH-5702] * provisioner/salt: Add windows support to salt provisioner [GH-6012] [GH-6012] ## 1.2.1 (February 23, 2018) ### BUG FIXES: * builder/amazon: Fix authorization using assume role. [GH-5914] * builder/hyper-v: Fix command collisions with VMWare PowerCLI. [GH-5861] * builder/vmware-iso: Fix panic when building on esx5 remotes. [GH-5931] * builder/vmware: Fix issue detecting host IP. [GH-5898] [GH-5900] * provisioner/ansible-local: Fix conflicting escaping schemes for vars provided via `--extra-vars`. [GH-5888] ### IMPROVEMENTS: * builder/oracle-classic: Add `snapshot_timeout` option to control how long we wait for the snapshot to be created. [GH-5932] * builder/oracle-classic: Add support for WinRM connections. [GH-5929] ## 1.2.0 (February 9, 2018) ### BACKWARDS INCOMPATIBILITIES: * 3rd party plugins: We have moved internal dependencies, meaning your 3rd party plugins will no longer compile (however existing builds will still work fine); the work to fix them is minimal and documented in GH-5810. [GH-5810] * builder/amazon: The `ssh_private_ip` option has been removed. Instead, please use `"ssh_interface": "private"`. A fixer has been written for this, which can be invoked with `packer fix`. [GH-5876] * builder/openstack: Extension support has been removed. To use OpenStack builder with the OpenStack Newton (Oct 2016) or earlier, we recommend you use Packer v1.1.2 or earlier version. * core: Affects Windows guests: User variables containing Powershell special characters no longer need to be escaped.[GH-5376] * provisioner/file: We've made destination semantics more consistent across the various communicators. In general, if the destination is a directory, files will be uploaded into the directory instead of failing. This mirrors the behavior of `rsync`. There's a chance some users might be depending on the previous buggy behavior, so it's worth ensuring your configuration is correct. [GH-5426] * provisioner/powershell: Regression from v1.1.1 forcing extra escaping of environment variables in the non-elevated provisioner has been fixed. [GH-5515] [GH-5872] ### IMPROVEMENTS: * **New builder:** `ncloud` for building server images using the NAVER Cloud Platform. [GH-5791] * **New builder:** `oci-classic` for building new custom images for use with Oracle Cloud Infrastructure Classic Compute. [GH-5819] * **New builder:** `scaleway` - The Scaleway Packer builder is able to create new images for use with Scaleway BareMetal and Virtual cloud server. [GH-4770] * builder/amazon: Add `kms_key_id` option to block device mappings. [GH-5774] * builder/amazon: Add `skip_metadata_api_check` option to skip consulting the amazon metadata service. [GH-5764] * builder/amazon: Add Paris region (eu-west-3) [GH-5718] * builder/amazon: Give better error messages if we have trouble during authentication. [GH-5764] * builder/amazon: Remove Session Token (STS) from being shown in the log. [GH-5665] * builder/amazon: Replace `InstanceStatusOK` check with `InstanceReady`. This reduces build times universally while still working for all instance types. [GH-5678] * builder/amazon: Report which authentication provider we're using. [GH-5764] * builder/amazon: Timeout early if metadata service can't be reached. [GH-5764] * builder/amazon: Warn during prepare if we didn't get both an access key and a secret key when we were expecting one. [GH-5762] * builder/azure: Add validation for incorrect VHD URLs [GH-5695] * builder/docker: Remove credentials from being shown in the log. [GH-5666] * builder/google: Support specifying licenses for images. [GH-5842] * builder/hyper-v: Allow MAC address specification. [GH-5709] * builder/hyper-v: New option to use differential disks and Inline disk creation to improve build time and reduce disk usage [GH-5631] * builder/qemu: Add Intel HAXM support to QEMU builder [GH-5738] * builder/triton: Triton RBAC is now supported. [GH-5741] * builder/triton: Updated triton-go dependencies, allowing better error handling. [GH-5795] * builder/vmware-iso: Add support for cdrom and disk adapter types. [GH-3417] * builder/vmware-iso: Add support for setting network type and network adapter type. [GH-3417] * builder/vmware-iso: Add support for usb/serial/parallel ports. [GH-3417] * builder/vmware-iso: Add support for virtual soundcards. [GH-3417] * builder/vmware-iso: More reliably retrieve the guest networking configuration. [GH-3417] * builder/vmware: Add support for "super" key in `boot_command`. [GH-5681] * communicator/ssh: Add session-level keep-alives [GH-5830] * communicator/ssh: Detect dead connections. [GH-4709] * core: Gracefully clean up resources on SIGTERM. [GH-5318] * core: Improved error logging in floppy file handling. [GH-5802] * core: Improved support for downloading and validating a uri containing a Windows UNC path or a relative file:// scheme. [GH-2906] * post-processor/amazon-import: Allow user to specify role name in amazon- import [GH-5817] * post-processor/docker: Remove credentials from being shown in the log. [GH-5666] * post-processor/google-export: Synchronize credential semantics with the Google builder. [GH-4148] * post-processor/vagrant: Add vagrant post-processor support for Google [GH-5732] * post-processor/vsphere-template: Now accepts artifacts from the vSphere post- processor. [GH-5380] * provisioner/amazon: Use Amazon SDK's InstanceRunning waiter instead of InstanceStatusOK waiter [GH-5773] * provisioner/ansible: Improve user retrieval. [GH-5758] * provisioner/chef: Add support for 'trusted_certs_dir' chef-client configuration option [GH-5790] * provisioner/chef: Added Policyfile support to chef-client provisioner. [GH-5831] ### BUG FIXES: * builder/alicloud-ecs: Attach keypair before starting instance in alicloud builder [GH-5739] * builder/amazon: Fix tagging support when building in us-gov/china. [GH-5841] * builder/amazon: NewSession now inherits MaxRetries and other settings. [GH-5719] * builder/virtualbox: Fix interpolation ordering so that edge cases around guest_additions_url are handled correctly [GH-5757] * builder/virtualbox: Fix regression affecting users running Packer on a Windows host that kept Packer from finding Virtualbox guest additions if Packer ran on a different drive from the one where the guest additions were stored. [GH-5761] * builder/vmware: Fix case where artifacts might not be cleaned up correctly. [GH-5835] * builder/vmware: Fixed file handle leak that may have caused race conditions in vmware builder [GH-5767] * communicator/ssh: Add deadline to SSH connection to prevent Packer hangs after script provisioner reboots vm [GH-4684] * communicator/winrm: Fix issue copying empty directories. [GH-5763] * provisioner/ansible-local: Fix support for `--extra-vars` in `extra_arguments`. [GH-5703] * provisioner/ansible-remote: Fixes an error where Packer's private key can be overridden by inherited `ansible_ssh_private_key` options. [GH-5869] * provisioner/ansible: The "default extra variables" feature added in Packer v1.0.1 caused the ansible-local provisioner to fail when an --extra-vars argument was specified in the extra_arguments configuration option; this has been fixed. [GH-5335] * provisioner/powershell: Regression from v1.1.1 forcing extra escaping of environment variables in the non-elevated provisioner has been fixed. [GH-5515] [GH-5872] ## 1.1.3 (December 8, 2017) ### IMPROVEMENTS: * builder/alicloud-ecs: Add security token support and set TLS handshake timeout through environment variable. [GH-5641] * builder/amazon: Add a new parameter `ssh_interface`. Valid values include `public_ip`, `private_ip`, `public_dns` or `private_dns`. [GH-5630] * builder/azure: Add sanity checks for resource group names [GH-5599] * builder/azure: Allow users to specify an existing resource group to use, instead of creating a new one for every run. [GH-5548] * builder/hyper-v: Add support for differencing disk. [GH-5458] * builder/vmware-iso: Improve logging of network errors. [GH-5456] * core: Add new `packer_version` template engine. [GH-5619] * core: Improve logic checking for downloaded ISOs in case where user has provided more than one URL in `iso_urls` [GH-5632] * provisioner/ansible-local: Add ability to clean staging directory. [GH-5618] ### BUG FIXES: * builder/amazon: Allow `region` to appear in `ami_regions`. [GH-5660] * builder/amazon: `C5` instance types now build more reliably. [GH-5678] * builder/amazon: Correctly set AWS region if given in template along with a profile. [GH-5676] * builder/amazon: Prevent `sriov_support` and `ena_support` from being used with spot instances, which would cause a build failure. [GH-5679] * builder/hyper-v: Fix interpolation context for user variables in `boot_command` [GH-5547] * builder/qemu: Set default disk size to 40960 MB to prevent boot failures. [GH-5588] * builder/vmware: Correctly detect Windows boot on vmware workstation. [GH-5672] * core: Fix windows path regression when downloading ISOs. [GH-5591] * provisioner/chef: Fix chef installs on Windows. [GH-5649] ## 1.1.2 (November 15, 2017) ### IMPROVEMENTS: * builder/amazon: Correctly deregister AMIs when `force_deregister` is set. [GH-5525] * builder/digitalocean: Add `ipv6` option to enable on droplet. [GH-5534] * builder/docker: Add `aws_profile` option to control the aws profile for ECR. [GH-5470] * builder/google: Add `clean_image_name` template engine. [GH-5463] * builder/google: Allow selecting container optimized images. [GH-5576] * builder/google: Interpolate network and subnetwork values, rather than relying on an API call that packer may not have permission for. [GH-5343] * builder/hyper-v: Add `disk_additional_size` option to allow for up to 64 additional disks. [GH-5491] * builder/hyper-v: Also disable automatic checkpoints for gen 2 VMs. [GH-5517] * builder/lxc: Add new `publish_properties` field to set image properties. [GH-5475] * builder/lxc: Add three new configuration option categories to LXC builder: `create_options`, `start_options`, and `attach_options`. [GH-5530] * builder/triton: Add `source_machine_image_filter` option to select an image ID based on a variety of parameters. [GH-5538] * builder/virtualbox-ovf: Error during prepare if source path doesn't exist. [GH-5573] * builder/virtualbox-ovf: Retry while removing VM to solve for transient errors. [GH-5512] * communicator/ssh: Add socks 5 proxy support. [GH-5439] * core/iso_config: Support relative paths in checksum file. [GH-5578] * core: Rewrite vagrantfile code to make cross-platform development easier. [GH-5539] * post-processor/docker-push: Add `aws_profile` option to control the aws profile for ECR. [GH-5470] * post-processor/vsphere: Properly capture `ovftool` output. [GH-5499] ### BUG FIXES: * builder/amazon: Add a delay option to security group waiter. [GH-5536] * builder/amazon: Fix regressions relating to spot instances and EBS volumes. [GH-5495] * builder/amazon: Set region from profile, if profile is set, rather than being overridden by metadata. [GH-5562] * builder/docker: Remove `login_email`, which no longer exists in the docker client. [GH-5511] * builder/hyperv: Fix admin check that was causing powershell failures. [GH-5510] * builder/oracle: Defaulting of OCI builder region will first check the packer template and the OCI config file. [GH-5407] * builder/triton: Fix a bug where partially created images can be reported as complete. [GH-5566] * post-processor/vsphere: Use the vm disk path information to re-create the vmx datastore path. [GH-5567] * provisioner/windows-restart: Wait for restart no longer endlessly loops if user specifies a custom restart check command. [GH-5563] ## 1.1.1 (October 13, 2017) ### IMPROVEMENTS: * **New builder:** `hyperv-vmcx` for building images from existing VMs. [GH-4944] [GH-5444] * builder/amazon-instance: Add `.Token` as a variable in the `BundleUploadCommand` template. [GH-5288] * builder/amazon: Add `temporary_security_group_source_cidr` option to control ingress to source instances. [GH-5384] * builder/amazon: Output AMI Name during prevalidation. [GH-5389] * builder/amazon: Support template functions in tag keys. [GH-5381] * builder/amazon: Tag volumes on creation instead of as a separate step. [GH-5417] * builder/docker: Add option to set `--user` flag when running `exec`. [GH-5406] * builder/docker: Set file owner to container user when uploading. Can be disabled by setting `fix_upload_owner` to `false`. [GH-5422] * builder/googlecompute: Support setting labels on the resulting image. [GH-5356] * builder/hyper-v: Add `vhd_temp_path` option to control where the VHD resides while it's being provisioned. [GH-5206] * builder/hyper-v: Allow vhd or vhdx source images instead of just ISO. [GH-4944] [GH-5444] * builder/hyper-v: Disable automatic checkpoints. [GH-5374] * builder/virtualbox-ovf: Add `keep_registered` option. [GH-5336] * builder/vmware: Add `disable_vnc` option to prevent VNC connections from being made. [GH-5436] * core: Releases will now be built for ppc64le. * post-processor/vagrant: When building from a builder/hyper-v artifact, link instead of copy when available. [GH-5207] ### BUG FIXES: * builder/cloudstack: Fix panic if build is aborted. [GH-5388] * builder/hyper-v: Respect `enable_dynamic_memory` flag. [GH-5363] * builder/puppet-masterless: Make sure directories created with sudo are writable by the packer user. [GH-5351] * provisioner/chef-solo: Fix issue installing chef-solo on Windows. [GH-5357] * provisioner/powershell: Fix issue setting environment variables by writing them to a file, instead of the command line. [GH-5345] * provisioner/powershell: Fix issue where powershell scripts could hang. [GH-5082] * provisioner/powershell: Fix Powershell progress stream leak to stderr for normal and elevated commands. [GH-5365] * provisioner/puppet-masterless: Fix bug where `puppet_bin_dir` wasn't being respected. [GH-5340] * provisioner/puppet: Fix setting facter vars on Windows. [GH-5341] ## 1.1.0 (September 12, 2017) ### IMPROVEMENTS: * builder/alicloud: Update alicloud go sdk and enable multi sites support for alicloud [GH-5219] * builder/amazon: Upgrade aws-sdk-go to 1.10.14, add tags at instance run time. [GH-5196] * builder/azure: Add object_id to windows_custom_image.json. [GH-5285] * builder/azure: Add support for storage account for managed images. [GH-5244] * builder/azure: Update pkcs12 package. [GH-5301] * builder/cloudstack: Add support for Security Groups. [GH-5175] * builder/docker: Uploading files and directories now use docker cp. [GH-5273] [GH-5333] * builder/googlecompute: Add `labels` option for labeling launched instances. [GH-5308] * builder/googlecompute: Add support for accelerator api. [GH-5137] * builder/profitbricks: added support for Cloud API v4. [GH-5233] * builder/vmware-esxi: Remote builds now respect `output_directory` [GH-4592] * builder/vmware: Set artifact ID to `VMName`. [GH-5187] * core: Build solaris binary by default. [GH-5268] [GH-5248] * core: Remove LGPL dependencies. [GH-5262] * provisioner/puppet: Add `guest_os_type` option to add support for Windows. [GH-5252] * provisioner/salt-masterless: Also use sudo to clean up if we used sudo to install. [GH-5240] ### BACKWARDS INCOMPATIBILITIES: * builder/amazon: Changes way that AMI artifacts are printed out after build, aligning them to builder. Could affect output parsing. [GH-5281] * builder/amazon: Split `enhanced_networking` into `sriov_support` and `ena_support` to support finer grained control. Use `packer fix ` to automatically update your template to use `ena_support` where previously there was only `enhanced_networking`. Make sure to also add `sriov_support` if you need that feature, and to ensure `ena_support` is what you intended to be in your template. [GH-5284] * builder/cloudstack: Setup temporary SSH keypair; backwards incompatible in the uncommon case that the source image allowed SSH auth with password but not with keypair. [GH-5174] * communicator/ssh: Renamed `ssh_disable_agent` to `ssh_disable_agent_forwarding`. Need to run fixer on packer configs that use `ssh_disable_agent`. [GH-5024] * communicator: Preserve left-sided white-space in remote command output. Make sure any scripts that parse this output can handle the new whitespace before upgrading. [GH-5167] * provisioner/shell: Set default for `ExpectDisconnect` to `false`. If your script causes the connection to be reset, you should set this to `true` to prevent errors. [GH-5283] ### BUG FIXES: * builder/amazon: `force_deregister` works in all regions, not just original region. [GH-5250] * builder/docker: Directory uploads now use the same semantics as the rest of the communicators. [GH-5333] * builder/vmware: Fix timestamp in default VMName. [GH-5274] * builder/winrm: WinRM now waits to make sure commands can run successfully before considering itself connected. [GH-5300] * core: Fix issue where some builders wouldn't respect `-on-error` behavior. [GH-5297] * provisioner/windows-restart: The first powershell provisioner after a restart now works. [GH-5272] ### FEATURES: * **New builder**: Oracle Cloud Infrastructure (OCI) builder for creating custom images. [GH-4554] * **New builder:** `lxc` for building lxc images. [GH-3523] * **New builder:** `lxd` for building lxd images. [GH-3625] * **New post-processor**: vSphere Template post-processor to be used with vmware-iso builder enabling user to mark a VM as a template. [GH-5114] ## 1.0.4 (August 11, 2017) ### IMPROVEMENTS: * builder/alicloud: Increase polling timeout. [GH-5148] * builder/azure: Add `private_virtual_network_with_public_ip` option to optionally obtain a public IP. [GH-5222] * builder/googlecompute: use a more portable method of obtaining zone. [GH-5192] * builder/hyperv: Properly interpolate user variables in template. [GH-5184] * builder/parallels: Remove soon to be removed --vmtype flag in createvm. [GH-5172] * contrib: add json files to zsh completion. [GH-5195] ### BUG FIXES: * builder/amazon: Don't delete snapshots we didn't create. [GH-5211] * builder/amazon: fix builds when using the null communicator. [GH-5217] * builder/docker: Correctly handle case when uploading an empty directory. [GH-5234] * command/push: Don't push variables if they are unspecified. Reverts to behavior in 1.0.1. [GH-5235] * command/push: fix handling of symlinks. [GH-5226] * core: Strip query parameters from ISO URLs when checking against a checksum file. [GH-5181] * provisioner/ansible-remote: Fix issue where packer could hang communicating with ansible-remote. [GH-5146] ## 1.0.3 (July 17, 2017) ### IMPROVEMENTS: * builder/azure: Update to latest Azure SDK, enabling support for managed disks. [GH-4511] * builder/cloudstack: Add default cidr_list [ 0.0.0.0/0 ]. [GH-5125] * builder/cloudstack: Add support for ssh_agent_auth. [GH-5130] * builder/cloudstack: Add support for using a HTTP server. [GH-5017] * builder/cloudstack: Allow reading api_url, api_key, and secret_key from env vars. [GH-5124] * builder/cloudstack: Make expunge optional and improve logging output. [GH-5099] * builder/googlecompute: Allow using URL's for network and subnetwork. [GH-5035] * builder/hyperv: Add support for floppy_dirs with hyperv-iso builder. * builder/hyperv: Add support for override of system %temp% path. * core: Experimental Android ARM support. [GH-5111] * post-processor/atlas: Disallow packer push of vagrant.box artifacts to atlas. [GH-4780] * postprocessor/atlas: Disallow pushing vagrant.box artifacts now that Vagrant cloud is live. [GH-4780] ### BUG FIXES: * builder/amazon: Fix panic that happens if ami_block_device_mappings is empty. [GH-5059] * builder/azure: Write private SSH to file in debug mode. [GH-5070] [GH-5074] * builder/cloudstack: Properly report back errors. [GH-5103] [GH-5123] * builder/docker: Fix windows filepath in docker-toolbox call [GH-4887] * builder/docker: Fix windows filepath in docker-toolbox call. [GH-4887] * builder/hyperv: Use SID to verify membership in Admin group, fixing for non- english users. [GH-5022] * builder/hyperv: Verify membership in the group Hyper-V Administrators by SID not name. [GH-5022] * builder/openstack: Update gophercloud version, fixing builds > 1 hr long. [GH-5046] * builder/parallels: Skip missing paths when looking for unnecessary files. [GH-5058] * builder/vmware-esxi: Fix VNC port discovery default timeout. [GH-5051] * communicator/ssh: Add ProvisionerTypes to communicator tests, resolving panic [GH-5116] * communicator/ssh: Resolve race condition that sometimes truncates ssh provisioner stdout [GH-4719] * post-processor/checksum: Fix interpolation of "output". [GH-5112] * push: Push vars in packer config, not just those set from command line and in var-file. [GH-5101] ## 1.0.2 (June 21, 2017) ### BUG FIXES: * communicator/ssh: Fix truncated stdout from remote ssh provisioner. [GH-5050] * builder/amazon: Fix bugs related to stop instance command. [GH-4719] * communicator/ssh: Fix ssh connection errors. [GH-5038] * core: Remove logging that shouldn't be there when running commands. [GH-5042] * provisioner/shell: Fix bug where scripts were being run under `sh`. [GH-5043] ### IMPROVEMENTS: * provisioner/windows-restart: make it clear that timeouts come from the provisioner, not winrm. [GH-5040] ## 1.0.1 (June 19, 2017) ### IMPROVEMENTS: * builder/amazon: Allow amis to be copied to other regions, encrypted with custom KMS keys. [GH-4948] * builder/amazon: Allow configuration of api endpoint to support api-compatible cloud providers. [GH-4896] * builder/amazon: Fix regex used for ami name validation [GH-4902] * builder/amazon: Look up vpc from subnet id if no vpc was specified. [GH-4879] * builder/amazon: Print temporary security group name to the UI. [GH-4997] * builder/amazon: Support Assume Role with MFA and ECS Task Roles. Also updates to a newer version of aws-sdk-go. [GH-4996] * builder/amazon: Use retry logic when creating instance tags. [GH-4876] * builder/amazon: Validate ami name. [GH-4762] * builder/azure: Add build output to artifact. [GH-4953] * builder/azure: Use disk URI as artifact ID. [GH-4981] * builder/digitalocean: Added support for monitoring. [GH-4782] * builder/digitalocean: Support for copying snapshot to other regions. [GH-4893] * builder/hyper-v: Remove the check for administrator rights when sending key strokes to Hyper-V. [GH-4687] # builder/openstack: Fix private key error message to match documentation [GH-4898] * builder/null: Support SSH agent auth [GH-4956] * builder/openstack: Add ssh agent support. [GH-4655] * builder/openstack: Support client x509 certificates. [GH-4921] * builder/parallels-iso: Configuration of disk type, plain or expanding. [GH-4621] * builder/triton: An SSH agent can be used to authenticate requests, making `triton_key_material` optional. [GH-4838] * builder/triton: If no source machine networks are specified, instances are started on the default public and internal networks. [GH-4838] * builder/virtualbox: Add sata port count configuration option. [GH-4699] * builder/virtualbox: Don't add port forwarding when using "none" communicator. [GH-4960] * builder/vmware: Add option to remove interfaces from the vmx. [GH-4927] * builder/vmware: Properly remove mounted CDs on OS X. [GH-4810] * builder/vmware: VNC probe timeout is configurable. [GH-4919] * command/push: add `-sensitive` flag to mark pushed vars are sensitive. [GH-4970] * command/push: Vagrant support in Terraform Enterprise is deprecated. [GH-4950] * communicator/ssh: Add ssh agent support for bastion connections. [GH-4940] * communicator/winrm: Add NTLM authentication support. [GH-4979] * communicator/winrm: Add support for file downloads. [GH-4748] * core: add telemetry for better product support. [GH-5015] * core: Build binaries for arm64 [GH-4892] * post-processor/amazon-import: Add support for `license_type`. [GH-4634] * post-processor/vagrant-cloud: Get vagrant cloud token from environment. [GH-4982] * provisioner/ansible-local: Add extra-vars `packer_build_name`, `packer_builder_type`, and `packer_http_addr`. [GH-4821] * provisioner/ansible: Add `inventory_directory` option to control where to place the generated inventory file. [GH-4760] * provisioner/ansible: Add `skip_version_check` flag for when ansible will be installed from a prior provisioner. [GH-4983] * provisioner/ansible: Add extra-vars `packer_build_name` and `packer_builder_type`. [GH-4821] * provisioner/chef-solo: Add option to select Chef version. [GH-4791] * provisioner/salt: Add salt bin directory configuration. [GH-5009] * provisioner/salt: Add support for grains. [GH-4961] * provisioner/shell: Use `env` to set environment variables to support freebsd out of the box. [GH-4909] * website/docs: Clarify language, improve formatting. [GH-4866] * website/docs: Update docker metadata fields that can be changed. [GH-4867] ### BUG FIXES: * builder/amazon-ebssurrogate: Use ami device settings when creating the AMI. [GH-4972] * builder/amazon: don't try to delete extra volumes during clean up. [GH-4930] * builder/amazon: fix `force_delete_snapshot` when the launch instance has extra volumes. [GH-4931] * builder/amazon: Only delete temporary key if we created one. [GH-4850] * builder/azure: Replace calls to panic with error returns. [GH-4846] * communicator/winrm: Use KeepAlive to keep long-running connections open. [GH-4952] * core: Correctly reject config files which have junk after valid json. [GH-4906] * post-processor/checksum: fix crash when invalid checksum is used. [GH-4812] * post-processor/vagrant-cloud: don't read files to upload in to memory first. [GH-5005] * post-processor/vagrant-cloud: only upload once under normal conditions. [GH-5008] * provisioner/ansible-local: Correctly set the default staging directory under Windows. [GH-4792] ### FEATURES: * **New builder:** `alicloud-ecs` for building Alicloud ECS images. [GH-4619] ## 1.0.0 (April 4, 2017) ### BUG FIXES: * builder/amazon: Fix b/c issue by reporting again the tags we create. [GH-4704] * builder/amazon: Fix crash in `step_region_copy`. [GH-4642] * builder/googlecompute: Correct values for `on_host_maintenance`. [GH-4643] * builder/googlecompute: Use "default" service account. [GH-4749] * builder/hyper-v: Don't wait for shutdown_command to return. [GH-4691] * builder/virtualbox: fix `none` communicator by allowing skipping upload of version file. [GH-4678] * builder/virtualbox: retry removing floppy controller. [GH-4705] * communicator/ssh: don't return error if we can't close connection. [GH-4741] * communicator/ssh: fix nil pointer error. [GH-4690] * core: fix version number * core: Invoking packer `--help` or `--version` now exits with status 0. [GH-4723] * core: show correct step name when debugging. [GH-4672] * communicator/winrm: Directory uploads behave more like scp. [GH-4438] ### IMPROVEMENTS: * builder/amazon-chroot: Ability to give an empty list in `copy_files` to prevent the default `/etc/resolv.conf` file from being copied. If `copy_files` isn't given at all, the default behavior remains. [GH-4708] * builder/amazon: set force_deregister to true on -force. [GH-4649] * builder/amazon: validate ssh key name/file. [GH-4665] * builder/ansible: Clearer error message when we have problems getting the ansible version. [GH-4694] * builder/hyper-v: validate output dir in step, not in config. [GH-4645] * More diligently try to complete azure-setup.sh. [GH-4752] * website: fix display on ios devices. [GH-4618] ## 0.12.3 (March 1, 2017) ### BACKWARDS INCOMPATIBILITIES: * provisioner/ansible: by default, the staging dir will be randomized. [GH-4472] ### FEATURES: * **New builder:** `ebs-surrogate` for building AMIs from EBS volumes. [GH-4351] ### IMPROVEMENTS: * builder/amazon-chroot: support encrypted boot volume. [GH-4584] * builder/amazon: Add BuildRegion and SourceAMI template variables. [GH-4399] * builder/amazon: Change EC2 Windows password timeout to 20 minutes. [GH-4590] * builder/amazon: enable ena when `enhanced_networking` is set. [GH-4578] * builder/azure:: add two new config variables for temp_compute_name and temp_resource_group_name. [GH-4468] * builder/docker: create export dir if needed. [GH-4439] * builder/googlecompute: Add `on_host_maintenance` option. [GH-4544] * builder/openstack: add reuse_ips option to try to re-use existing IPs. [GH-4564] * builder/vmware-esxi: try for longer to connect to vnc port. [GH-4480] [GH-4610] * builder/vmware: allow extra options for ovftool. [GH-4536] * builder/vmware: don't cache ip address so we know if it changes. [GH-4532] * communicator/docker: preserve file mode. [GH-4443] * communicator/ssh: Use SSH agent when enabled for bastion step. [GH-4598] * communicator/winrm: support ProxyFromEnvironment. [GH-4463] * core: don't show ui color if we're not colorized. [GH-4525] * core: make VNC links clickable in terminal. [GH-4497] [GH-4498] * docs: add community page. [GH-4550] * post-processor/amazon-import: support AMI attributes on import [GH-4216] * post-processor/docker-import: print stderr on docker import failure. [GH-4529] ### BUG FIXES: * builder/amazon-ebsvolume: Fix interpolation of block_device. [GH-4464] * builder/amazon: Fix ssh agent authentication. [GH-4597] * builder/docker: Don't force tag if using a docker version that doesn't support it. [GH-4560] * builder/googlecompute: fix bug when creating image from custom image_family. [GH-4518] * builder/virtualbox: remove guest additions before saving image. [GH-4496] * core: always check for an error first when walking a path. [GH-4467] * core: update crypto/ssh lib to fix large file uploads. [GH-4546] * provisioner/chef-client: only upload knife config if we're cleaning. [GH-4534] ## 0.12.2 (January 20, 2017) ### FEATURES: * **New builder:** `triton` for building images for Joyent Triton. [GH-4325] * **New provisioner:** `converge` for provisioning with converge.sh. [GH-4326] ### IMPROVEMENTS: * builder/hyperv-iso: add `iso_target_extension` option. [GH-4294] * builder/openstack: Add support for instance metadata. [GH-4361] * builder/openstack: Attempt to use existing floating IPs before allocating a new one. [GH-4357] * builder/parallels-iso: add `iso_target_extension` option. [GH-4294] * builder/qemu: add `iso_target_extension` option. [GH-4294] * builder/qemu: add `use_default_display` option for osx compatibility. [GH-4293] * builder/qemu: Detect input disk image format during copy/convert. [GH-4343] * builder/virtualbox-iso: add `iso_target_extension` option. [GH-4294] * builder/virtualbox: add `skip_export` option to skip exporting the VM after build completes. [GH-4339] * builder/vmware & builder/qemu: Allow configurable delay between keystrokes when typing boot command. [GH-4403] * builder/vmware-iso: add `iso_target_extension` option. [GH-4294] * builder/vmware-iso: add `skip_export` option to skip exporting the VM after build completes. [GH-4378] * builder/vmware: Try to use `ip address` to find host IP. [GH-4411] * common/step_http\_server: set `PACKER_HTTP_ADDR` env var for accessing http server from inside builder. [GH-4409] * provisioner/powershell: Allow equals sign in value of environment variables. [GH-4328] * provisioner/puppet-server: Add default facts. [GH-4286] ### BUG FIXES: * builder/amazon-chroot: Panic in AMI region copy step. [GH-4341] * builder/amazon: Crashes when new EBS vols are used. [GH-4308] * builder/amazon: Fix crash in amazon-instance. [GH-4372] * builder/amazon: fix run volume tagging [GH-4420] * builder/amazon: fix when using non-existent security\_group\_id. [GH-4425] * builder/amazon: Properly error if we don't have the ec2:DescribeSecurityGroups permission. [GH-4304] * builder/amazon: Properly wait for security group to exist. [GH-4369] * builder/docker: Fix crash when performing log in to ECR with an invalid URL. [GH-4385] * builder/openstack: fix for finding resource by ID. [GH-4301] * builder/qemu: Explicitly set WinRMPort for StepConnect. [GH-4321] * builder/virtualbox: Explicitly set WinRMPort for StepConnect. [GH-4321] * builder/virtualbox: Pause between each boot command element in -debug. [GH-4346] * builder/vmware builder/parallels: Fix hang when shutting down windows in certain cases. [GH-4436] * command/push: Don't interpolate variables when pushing. [GH-4389] * common/step_http_server: make port range inclusive. [GH-4398] * communicator/winrm: update winrm client, resolving `MaxMemoryPerShellMB` errors and properly error logging instead of panicking. [GH-4412] [GH-4424] * provider/windows-shell: Allows equals sign in env var value. [GH-4423] ## 0.12.1 (December 15, 2016) ### BACKWARDS INCOMPATIBILITIES: * `ssh_username` is now required if using communicator ssh. [GH-4172] * builder/amazon: Change `shutdown_behaviour` to `shutdown_behavior`. Run "packer fix template.json" to migrate a template. [GH-4285] * builder/openstack: No long supports the `api_key` option for rackspace. [GH-4283] * post-processor/manifest: Changed `filename` field to be `output`, to be more consistent with other post-processors. `packer fix` will fix this for you. [GH-4192] * post-processor/shell-local: Now runs per-builder instead of per-file. The filename is no longer passed in as an argument to the script, but instead needs to be gleaned from the manifest post-processor. [GH-4189] ### FEATURES: * **New builder:** "Hyper-V" Added new builder for Hyper-V on Windows. [GH-2576] * **New builder:** "1&1" Added new builder for [1&1](https://www.1and1.com/). [GH-4163] ### IMPROVEMENTS: * builder/amazon-ebs: Support specifying KMS key for encryption. [GH-4023] * builder/amazon-ebsvolume: Add artifact output. [GH-4141] * builder/amazon: Add `snapshot_tag` overrides. [GH-4015] * builder/amazon: Added new region London - eu-west-2. [GH-4284] * builder/amazon: Added ca-central-1 to list of known aws regions. [GH-4274] * builder/amazon: Adds `force_delete_snapshot` flag to also cleanup snapshots if we're removing a preexisting image, as with `force_deregister_image`. [GH-4223] * builder/amazon: Support `snapshot_users` and `snapshot_groups` for sharing ebs snapshots. [GH-4243] * builder/cloudstack: Support reusing an already associated public IP. [GH-4149] * builder/docker: Introduce docker commit changes, author, and message. [GH-4202] * builder/googlecompute: Support `source_image_family`. [GH-4162] * builder/googlecompute: enable support for Google Compute XPN. [GH-4288] * builder/openstack: Added `image_members` to add new members to image after it's created. [GH-4283] * builder/openstack: Added `image_visibility` field to specify visibility of created image. [GH-4283] * builder/openstack: Automatically reauth as needed. [GH-4262] * builder/virtualbox-ovf: Can now give a URL to an ova file. [GH-3982] * communicator/ssh: adds ability to download download directories and wildcards, fix destination file mode (not hardcoded anymore). [GH-4210] * post-processor/shell-local: support spaces in script path. [GH-4144] * provisioner/ansible: Allow `winrm` communicator. [GH-4209] * provisioner/salt: Bootstrap fallback on wget if curl failed. [GH-4244] ### BUG FIXES: * builder/amazon: Correctly assign key from `ssh_keypair_name` to source instance. [GH-4222] * builder/amazon: Fix `source_ami_filter` ignores `owners`. [GH-4235] * builder/amazon: Fix launching spot instances in EC2 Classic [GH-4204] * builder/qemu: Fix issue where multiple commands on a single line in boot_command wouldn't be parsed correctly. [GH-4269] * core: Unbreak glob patterns in `floppy_files`. [GH-3890] * post-processor/checksum: cleanup, and fix output to specified file with more than one artifacts. [GH-4210] * post-processor/checksum: reset hash after each artifact file. [GH-4210] * provisioner/file: fix for directory download. [GH-4210] * provisioner/file: fix issue uploading multiple files to a directory, mentioned in [GH-4049]. [GH-4210] * provisioner/shell: Treat disconnects as retryable when running cleanup. If you have a reboot in your script, we'll now wait until the host is available before attempting to cleanup the script. [GH-4197] ## 0.12.0 (November 15, 2016) ### FEATURES: * **New builder:** "cloudstack" Can create new templates for use with CloudStack taking either an ISO or existing template as input. [GH-3909] * **New builder:** "profitbricks" Builder for creating images in the ProfitBricks cloud. [GH-3660] * **New builder:** "amazon-ebsvolume" Can create Amazon EBS volumes which are preinitialized with a filesystem and data. [GH-4088] ### IMPROVEMENTS: * builder/amazon: Allow polling delay override with `AWS_POLL_DELAY_SECONDS`. [GH-4083] * builder/amazon: Allow use of local SSH Agent. [GH-4050] * builder/amazon: Dynamic source AMI [GH-3817] * builder/amazon: Show AMI ID found when using `source_ami_filter`. [GH-4096] * builder/googlecompute: Support `ssh_private_key_file` in communicator. [GH-4101] * builder/googlecompute: Support custom scopes. [GH-4043] * command/push: Fix variable pushes to Atlas. Still needs Atlas server to be updated before the issue will be fixed completely. [GH-4089] * communicator/ssh: Improved SSH upload performance. [GH-3940] * contrib/azure-setup.sh: Support for azure-cli 0.10.7. [GH-4133] * docs: Fix command line variable docs. [GH-4143] * post-processor/vagrant: Fixed inconsistency between vagrant-libvirt driver and packer QEMU accelerator. [GH-4104] * provisioner/ansible: Move info messages to log [GH-4123] * provisioner/puppet: Add `puppet_bin_dir` option. [GH-4014] * provisioner/salt: Add `salt_call_args` option. [GH-4158] ### BUG FIXES: * builder/amazon: Fixed an error where we wouldn't fail the build even if we timed out waiting for the temporary security group to become available. [GH-4099] * builder/amazon: Properly cleanup temporary key pairs. [GH-4080] * builder/google: Fix issue where we'd hang waiting for a startup script which doesn't exist. [GH-4102] * builder/qemu: Fix keycodes for ctrl, shift and alt keys. [GH-4115] * builder/vmware: Fix keycodes for ctrl, shift and alt keys. [GH-4115] * builder/vmware: Fixed build error when shutting down. [GH-4041] * common/step_create_floppy: Fixed support for 1.44MB floppies on Windows. [GH-4135] * post-processor/googlecompute-export: Fixes scopes. [GH-4147] * provisioner/powershell: Reverted [GH-3371] fixes quoting issue. [GH-4069] * scripts: Fix build under Windows for go 1.5. [GH-4142] ## 0.11.0 (October 21, 2016) ### BACKWARDS INCOMPATIBILITIES: * VNC and VRDP-like features in VirtualBox, VMware, and QEMU now configurable but bind to 127.0.0.1 by default to improve security. See the relevant builder docs for more info. * Docker builder requires Docker > 1.3 * provisioner/chef-solo: default staging directory renamed to `packer-chef-solo`. [GH-3971] ### FEATURES: * **New Checksum post-processor**: Create a checksum file from your build artifacts as part of your build. [GH-3492] [GH-3790] * **New build flag** `-on-error` to allow inspection and keeping artifacts on builder errors. [GH-3885] * **New Google Compute Export post-processor**: exports an image from a Packer googlecompute builder run and uploads it to Google Cloud Storage. [GH-3760] * **New Manifest post-processor**: writes metadata about packer's output artifacts data to a JSON file. [GH-3651] ### IMPROVEMENTS: * builder/amazon: Added `disable_stop_instance` option to prevent automatic shutdown when the build is complete. [GH-3352] * builder/amazon: Added `shutdown_behavior` option to support `stop` or `terminate` at the end of the build. [GH-3556] * builder/amazon: Added `skip_region_validation` option to allow newer or custom AWS regions. [GH-3598] * builder/amazon: Added `us-east-2` and `ap-south-1` regions. [GH-4021] [GH-3663] * builder/amazon: Support building from scratch with amazon-chroot builder. [GH-3855] [GH-3895] * builder/amazon: Support create an AMI with an `encrypt_boot` volume. [GH-3382] * builder/azure: Add `os_disk_size_gb`. [GH-3995] * builder/azure: Add location to setup script. [GH-3803] * builder/azure: Allow user to set custom data. [GH-3996] * builder/azure: Made `tenant_id` optional. [GH-3643] * builder/azure: Now pre-validates `capture_container_name` and `capture_name_prefix` [GH-3537] * builder/azure: Removed superfluous polling code for deployments. [GH-3638] * builder/azure: Support for a user defined VNET. [GH-3683] * builder/azure: Support for custom images. [GH-3575] * builder/azure: tag all resources. [GH-3764] * builder/digitalocean: Added `user_data_file` support. [GH-3933] * builder/digitalocean: Fixes timeout waiting for snapshot. [GH-3868] * builder/digitalocean: Use `state_timeout` for unlock and off transitions. [GH-3444] * builder/docker: Improved support for Docker pull from Amazon ECR. [GH-3856] * builder/google: Add `-force` option to delete old image before creating new one. [GH-3918] * builder/google: Add image license metadata. [GH-3873] * builder/google: Added support for `image_family` [GH-3531] * builder/google: Added support for startup scripts. [GH-3639] * builder/google: Create passwords for Windows instances. [GH-3932] * builder/google: Enable to select NVMe images. [GH-3338] * builder/google: Signal that startup script fished via metadata. [GH-3873] * builder/google: Use gcloud application default credentials. [GH-3655] * builder/google: provision VM without external IP address. [GH-3774] * builder/null: Can now be used with WinRM. [GH-2525] * builder/openstack: Added support for `ssh_password` instead of generating ssh keys. [GH-3976] * builder/parallels: Add support for ctrl, shift and alt keys in `boot_command`. [GH-3767] * builder/parallels: Copy directories recursively with `floppy_dirs`. [GH-2919] * builder/parallels: Now pauses between `boot_command` entries when running with `-debug` [GH-3547] * builder/parallels: Support future versions of Parallels by using the latest driver. [GH-3673] * builder/qemu: Add support for ctrl, shift and alt keys in `boot_command`. [GH-3767] * builder/qemu: Added `vnc_bind_address` option. [GH-3574] * builder/qemu: Copy directories recursively with `floppy_dirs`. [GH-2919] * builder/qemu: Now pauses between `boot_command` entries when running with `-debug` [GH-3547] * builder/qemu: Specify disk format when starting qemu. [GH-3888] * builder/virtualbox-iso: Added `hard_drive_nonrotational` and `hard_drive_discard` options to enable trim/discard. [GH-4013] * builder/virtualbox-iso: Added `keep_registered` option to skip cleaning up the image. [GH-3954] * builder/virtualbox: Add support for ctrl, shift and alt keys in `boot_command`. [GH-3767] * builder/virtualbox: Added `post_shutdown_delay` option to wait after shutting down to prevent issues removing floppy drive. [GH-3952] * builder/virtualbox: Added `vrdp_bind_address` option. [GH-3566] * builder/virtualbox: Copy directories recursively with `floppy_dirs`. [GH-2919] * builder/virtualbox: Now pauses between `boot_command` entries when running with `-debug` [GH-3542] * builder/vmware-vmx: Added `tools_upload_flavor` and `tools_upload_path` to docs. * builder/vmware: Add support for ctrl, shift and alt keys in `boot_command`. [GH-3767] * builder/vmware: Added `vnc_bind_address` option. [GH-3565] * builder/vmware: Adds passwords for VNC. [GH-2325] * builder/vmware: Copy directories recursively with `floppy_dirs`. [GH-2919] * builder/vmware: Handle connection to VM with more than one NIC on ESXi [GH-3347] * builder/vmware: Now paused between `boot_command` entries when running with `-debug` [GH-3542] * core: Supress plugin discovery from plugins. [GH-4002] * core: Test floppy disk files actually exist. [GH-3756] * core: setting `PACKER_LOG=0` now disables logging. [GH-3964] * post-processor/amazon-import: Support `ami_name` for naming imported AMI. [GH-3941] * post-processor/compress: Added support for bgzf compression. [GH-3501] * post-processor/docker: Improved support for Docker push to Amazon ECR. [GH-3856] * post-processor/docker: Preserve tags when running docker push. [GH-3631] * post-processor/vagrant: Added vsphere-esx hosts to supported machine types. [GH-3967] * provisioner/ansible-local: Support for ansible-galaxy. [GH-3350] [GH-3836] * provisioner/ansible: Improved logging and error handling. [GH-3477] * provisioner/ansible: Support scp. [GH-3861] * provisioner/chef: Added `knife_command` option and added a correct default value for Windows. [GH-3622] * provisioner/chef: Installs 64bit chef on Windows if available. [GH-3848] * provisioner/file: Now makes destination directory. [GH-3692] * provisioner/puppet: Added `execute_command` option. [GH-3614] * provisioner/salt: Added `custom_state` to specify state to run instead of `highstate`. [GH-3776] * provisioner/shell: Added `expect_disconnect` flag to fail if remote unexpectedly disconnects. [GH-4034] * scripts: Added `help` target to Makefile. [GH-3290] * vendor: Moving from Godep to govendor. See `CONTRIBUTING.md` for details. [GH-3956] * website: code examples now use inconsolata. Improve code font rendering on linux. ### BUG FIXES: * builder/amazon: Add 0.5 cents to discovered spot price. [GH-3662] * builder/amazon: Allow using `ssh_private_key_file` and `ssh_password`. [GH-3953] * builder/amazon: Fix packer crash when waiting for SSH. [GH-3865] * builder/amazon: Honor ssh_private_ip flag in EC2-Classic. [GH-3752] * builder/amazon: Properly clean up EBS volumes on failure. [GH-3789] * builder/amazon: Use `temporary_key_pair_name` when specified. [GH-3739] * builder/amazon: retry creating tags on images since the images might take some time to become available. [GH-3938] * builder/azure: Fix authorization setup script failing to creating service principal. [GH-3812] * builder/azure: check for empty resource group. [GH-3606] * builder/azure: fix token validity test. [GH-3609] * builder/docker: Fix file provisioner dotfile matching. [GH-3800] * builder/docker: fix docker builder with ansible provisioner. [GH-3476] * builder/qemu: Don't fail on communicator set to `none`. [GH-3681] * builder/qemu: Make `ssh_host_port_max` an inclusive bound. [GH-2784] * builder/virtualbox: Make `ssh_host_port_max` an inclusive bound. [GH-2784] * builder/virtualbox: Respect `ssh_host` [GH-3617] * builder/vmware: Do not add remotedisplay.vnc.ip to VMX data on ESXi [GH-3740] * builder/vmware: Don't check for poweron errors on ESXi. [GH-3195] * builder/vmware: Re-introduce case sensitive VMX keys. [GH-2707] * builder/vmware: Respect `ssh_host`/`winrm_host` on ESXi. [GH-3738] * command/push: Allows dot (`.`) in image names. [GH-3937] * common/iso_config: fix potential panic when iso checksum url was given but not the iso url. [GH-4004] * communicator/ssh: fixed possible panic when reconnecting fails. [GH-4008] * communicator/ssh: handle error case where server closes the connection but doesn't give us an error code. [GH-3966] * post-processor/shell-local: Do not set execute bit on artifact file. [GH-3505] * post-processor/vsphere: Fix upload failures with vsphere. [GH-3321] * provisioner/ansible: Properly set host key checking even when a custom ENV is specified. [GH-3568] * provisioner/file: Fix directory download. [GH-3899] * provisioner/powershell: fixed issue with setting environment variables. [GH-2785] * website: improved rendering on iPad. [GH-3780] ## 0.10.2 (September 20, 2016) ### BUG FIXES: * Rebuilding with OS X Sierra and go 1.7.1 to fix bug in Sierra ## 0.10.1 (May 7, 2016) ### FEATURES: * `azure-arm` builder: Can now build Windows images, and supports additional configuration. Please refer to the documentation for details. ### IMPROVEMENTS: * core: Added support for `ATLAS_CAFILE` and `ATLAS_CAPATH` [GH-3494] * builder/azure: Improved build cancellation and cleanup of partially- provisioned resources. [GH-3461] * builder/azure: Improved logging. [GH-3461] * builder/azure: Added support for US Government and China clouds. [GH-3461] * builder/azure: Users may now specify an image version. [GH-3461] * builder/azure: Added device login. [GH-3461] * builder/docker: Added `privileged` build option. [GH-3475] * builder/google: Packer now identifies its version to the service. [GH-3465] * provisioner/shell: Added `remote_folder` and `remote_file` options [GH-3462] * post-processor/compress: Added support for `bgzf` format and added `format` option. [GH-3501] ### BUG FIXES: * core: Fix hang after pressing enter key in `-debug` mode. [GH-3346] * provisioner/chef: Use custom values for remote validation key path [GH-3468] ## 0.10.0 (March 14, 2016) ### BACKWARDS INCOMPATIBILITIES: * Building Packer now requires go >= 1.5 (>= 1.6 is recommended). If you want to continue building with go 1.4 you can remove the `azurearmbuilder` line from `command/plugin.go`. ### FEATURES: * **New `azure-arm` builder**: Build virtual machines in Azure Resource Manager ### IMPROVEMENTS: * builder/google: Added support for `disk_type` [GH-2830] * builder/openstack: Added support for retrieving the Administrator password when using WinRM if no `winrm_password` is set. [GH-3209] * provisioner/ansible: Added the `empty_groups` parameter. [GH-3232] * provisioner/ansible: Added the `user` parameter. [GH-3276] * provisioner/ansible: Don't use deprecated ssh option with Ansible 2.0 [GH-3291] * provisioner/puppet-masterless: Add `ignore_exit_codes` parameter. [GH-3349] ### BUG FIXES: * builders/parallels: Handle `output_directory` containing `.` and `..` [GH-3239] * provisioner/ansible: os.Environ() should always be passed to the ansible command. [GH-3274] ## 0.9.0 (February 19, 2016) ### BACKWARDS INCOMPATIBILITIES: * Packer now ships as a single binary, including plugins. If you install packer 0.9.0 over a previous packer installation, **you must delete all of the packer-* plugin files** or packer will load out-of-date plugins from disk. * Release binaries are now provided via . * Packer 0.9.0 is now built with Go 1.6. * core: Plugins that implement the Communicator interface must now implement a DownloadDir method. [GH-2618] * builder/amazon: Inline `user_data` for EC2 is now base64 encoded automatically. [GH-2539] * builder/parallels: `parallels_tools_host_path` and `guest_os_distribution` have been replaced by `guest_os_type`; use `packer fix` to update your templates. [GH-2751] ### FEATURES: * **Chef on Windows**: The chef provisioner now has native support for Windows using Powershell and WinRM. [GH-1215] * **New `vmware-esxi` feature**: Packer can now export images from vCloud or vSphere during the build. [GH-1921] * **New Ansible Provisioner**: `ansible` provisioner supports remote provisioning to keep your build image cleaner. [GH-1969] * **New Amazon Import post-processor**: `amazon-import` allows you to upload an OVA-based VM to Amazon EC2. [GH-2962] * **Shell Local post-processor**: `shell-local` allows you to run shell commands on the host after a build has completed for custom packaging or publishing of your artifacts. [GH-2706] * **Artifice post-processor**: Override packer artifacts during post- processing. This allows you to extract artifacts from a packer builder and use them with other post-processors like compress, docker, and Atlas. ### IMPROVEMENTS: * core: Packer plugins are now compiled into the main binary, reducing file size and build times, and making packer easier to install. The overall plugin architecture has not changed and third-party plugins can still be loaded from disk. Please make sure your plugins are up-to-date! [GH-2854] * core: Packer now indicates line numbers for template parse errors. [GH-2742] * core: Scripts are executed via `/usr/bin/env bash` instead of `/bin/bash` for broader compatibility. [GH-2913] * core: `target_path` for builder downloads can now be specified. [GH-2600] * core: WinRM communicator now supports HTTPS protocol. [GH-3061] * core: Template syntax errors now show line, column, offset. [GH-3180] * core: SSH communicator now supports downloading directories. [GH-2618] * builder/amazon: Add support for `ebs_optimized` [GH-2806] * builder/amazon: You can now specify `0` for `spot_price` to switch to on demand instances. [GH-2845] * builder/amazon: Added `ap-northeast-2` (Seoul) [GH-3056] * builder/amazon: packer will try to derive the AZ if only a subnet is specified. [GH-3037] * builder/digitalocean: doubled instance wait timeouts to power off or shutdown (now 4 minutes) and to complete a snapshot (now 20 minutes) [GH-2939] * builder/google: `account_file` can now be provided as a JSON string [GH-2811] * builder/google: added support for `preemptible` instances. [GH-2982] * builder/google: added support for static external IPs via `address` option [GH-3030] * builder/openstack: added retry on WaitForImage 404. [GH-3009] * builder/openstack: Can specify `source_image_name` instead of the ID [GH-2577] * builder/openstack: added support for SSH over IPv6. [GH-3197] * builder/parallels: Improve support for Parallels 11. [GH-2662] * builder/parallels: Parallels disks are now compacted by default. [GH-2731] * builder/parallels: Packer will look for Parallels in `/Applications/Parallels Desktop.app` if it is not detected automatically [GH-2839] * builder/qemu: qcow2 images are now compacted by default. [GH-2748] * builder/qemu: qcow2 images can now be compressed. [GH-2748] * builder/qemu: Now specifies `virtio-scsi` by default. [GH-2422] * builder/qemu: Now checks for version-specific options. [GH-2376] * builder/qemu: Can now bypass disk cache using `iso_skip_cache` [GH-3105] * builder/qemu: `` in `boot_command` now accepts an arbitrary duration like [GH-3129] * builder/qemu: Expose `{{ .SSHHostPort }}` in templates. [GH-2884] * builder/virtualbox: Added VRDP for debugging. [GH-3188] * builder/vmware-esxi: Added private key auth for remote builds via `remote_private_key_file` [GH-2912] * post-processor/atlas: Added support for compile ID. [GH-2775] * post-processor/docker-import: Can now import Artifice artifacts. [GH-2718] * provisioner/chef: Added `encrypted_data_bag_secret_path` option. [GH-2653] * provisioner/puppet: Added the `extra_arguments` parameter. [GH-2635] * provisioner/salt: Added `no_exit_on_failure`, `log_level`, and improvements to salt command invocation. [GH-2660] ### BUG FIXES: * core: Random number generator is now seeded. [GH-2640] * core: Packer should now have a lot less race conditions. [GH-2824] * builder/amazon: The `no_device` option for block device mappings is now handled correctly. [GH-2398] * builder/amazon: AMI name validation now matches Amazon's spec. [GH-2774] * builder/amazon: Use snapshot size when volume size is unspecified. [GH-2480] * builder/amazon: Pass AccessKey and SecretKey when uploading bundles for instance-backed AMIs. [GH-2596] * builder/parallels: Added interpolation in `prlctl_post` [GH-2828] * builder/vmware: `format` option is now read correctly. [GH-2892] * builder/vmware-esxi: Correct endless loop in destroy validation logic [GH-2911] * provisioner/shell: No longer leaves temp scripts behind. [GH-1536] * provisioner/winrm: Now waits for reboot to complete before continuing with provisioning. [GH-2568] * post-processor/artifice: Fix truncation of files downloaded from Docker. [GH-2793] ## 0.8.6 (Aug 22, 2015) ### IMPROVEMENTS: * builder/docker: Now supports Download so it can be used with the file provisioner to download a file from a container. [GH-2585] * builder/docker: Now verifies that the artifact will be used before the build starts, unless the `discard` option is specified. This prevent failures after the build completes. [GH-2626] * post-processor/artifice: Now supports glob-like syntax for filenames. [GH-2619] * post-processor/vagrant: Like the compress post-processor, vagrant now uses a parallel gzip algorithm to compress vagrant boxes. [GH-2590] ### BUG FIXES: * core: When `iso_url` is a local file and the checksum is invalid, the local file will no longer be deleted. [GH-2603] * builder/parallels: Fix interpolation in `parallels_tools_guest_path` [GH-2543] ## 0.8.5 (Aug 10, 2015) ### FEATURES: * **[Beta]** Artifice post-processor: Override packer artifacts during post- processing. This allows you to extract artifacts from a packer builder and use them with other post-processors like compress, docker, and Atlas. ### IMPROVEMENTS: * Many docs have been updated and corrected; big thanks to our contributors! * builder/openstack: Add debug logging for IP addresses used for SSH. [GH-2513] * builder/openstack: Add option to use existing SSH keypair. [GH-2512] * builder/openstack: Add support for Glance metadata. [GH-2434] * builder/qemu and builder/vmware: Packer's VNC connection no longer asks for an exclusive connection. [GH-2522] * provisioner/salt-masterless: Can now customize salt remote directories. [GH-2519] ### BUG FIXES: * builder/amazon: Improve instance cleanup by storing id sooner. [GH-2404] * builder/amazon: Only fetch windows password when using WinRM communicator. [GH-2538] * builder/openstack: Support IPv6 SSH address. [GH-2450] * builder/openstack: Track new IP address discovered during RackConnect. [GH-2514] * builder/qemu: Add 100ms delay between VNC key events. [GH-2415] * post-processor/atlas: atlas_url configuration option works now. [GH-2478] * post-processor/compress: Now supports interpolation in output config. [GH-2414] * provisioner/powershell: Elevated runs now receive environment variables. [GH-2378] * provisioner/salt-masterless: Clarify error messages when we can't create or write to the temp directory. [GH-2518] * provisioner/salt-masterless: Copy state even if /srv/salt exists already. [GH-1699] * provisioner/salt-masterless: Make sure /etc/salt exists before writing to it. [GH-2520] * provisioner/winrm: Connect to the correct port when using NAT with VirtualBox / VMware. [GH-2399] ## Note: 0.8.3 was pulled and 0.8.4 was skipped. ## 0.8.2 (July 17, 2015) ### IMPROVEMENTS: * builder/docker: Add option to use a Pty. [GH-2425] ### BUG FIXES: * core: Fix crash when `min_packer_version` is specified in a template. [GH-2385] * builder/amazon: Fix EC2 devices being included in EBS mappings. [GH-2459] * builder/googlecompute: Fix default name for GCE images. [GH-2400] * builder/null: Fix error message with missing ssh_host. [GH-2407] * builder/virtualbox: Use --portcount on VirtualBox 5.x. [GH-2438] * provisioner/puppet: Packer now correctly handles a directory for manifest_file. [GH-2463] * provisioner/winrm: Fix potential crash with WinRM. [GH-2416] ## 0.8.1 (July 2, 2015) ### IMPROVEMENTS: * builder/amazon: When debug mode is enabled, the Windows administrator password for Windows instances will be shown. [GH-2351] ### BUG FIXES: * core: `min_packer_version` field in configs work. [GH-2356] * core: The `build_name` and `build_type` functions work in provisioners. [GH-2367] * core: Handle timeout in SSH handshake. [GH-2333] * command/build: Fix reading configuration from stdin. [GH-2366] * builder/amazon: Fix issue with sharing AMIs when using `ami_users` [GH-2308] * builder/amazon: Fix issue when using multiple Security Groups. [GH-2381] * builder/amazon: Fix for tag creation when creating new ec2 instance. [GH-2317] * builder/amazon: Fix issue with creating AMIs with multiple device mappings. [GH-2320] * builder/amazon: Fix failing AMI snapshot tagging when copying to other regions. [GH-2316] * builder/amazon: Fix setting AMI launch permissions. [GH-2348] * builder/amazon: Fix spot instance cleanup to remove the correct request. [GH-2327] * builder/amazon: Fix `bundle_prefix` not interpolating `timestamp` [GH-2352] * builder/amazon-instance: Fix issue with creating AMIs without specifying a virtualization type. [GH-2330] * builder/digitalocean: Fix builder using private IP instead of public IP. [GH-2339] * builder/google: Set default communicator settings properly. [GH-2353] * builder/vmware-iso: Setting `checksum_type` to `none` for ESX builds now works. [GH-2323] * provisioner/chef: Use knife config file vs command-line params to clean up nodes so full set of features can be used. [GH-2306] * post-processor/compress: Fixed crash in compress post-processor plugin. [GH-2311] ## 0.8.0 (June 23, 2015) ### BACKWARDS INCOMPATIBILITIES: * core: SSH connection will no longer request a PTY by default. This can be enabled per builder. * builder/digitalocean: no longer supports the v1 API which has been deprecated for some time. Most configurations should continue to work as long as you use the `api_token` field for auth. * builder/digitalocean: `image`, `region`, and `size` are now required. * builder/openstack: auth parameters have been changed to better reflect OS terminology. Existing environment variables still work. ### FEATURES: * **WinRM:** You can now connect via WinRM with almost every builder. See the docs for more info. [GH-2239] * **Windows AWS Support:** Windows AMIs can now be built without any external plugins: Packer will start a Windows instance, get the admin password, and can use WinRM (above) to connect through. [GH-2240] * **Disable SSH:** Set `communicator` to "none" in any builder to disable SSH connections. Note that provisioners won't work if this is done. [GH-1591] * **SSH Agent Forwarding:** SSH Agent Forwarding will now be enabled to allow access to remote servers such as private git repos. [GH-1066] * **SSH Bastion Hosts:** You can now specify a bastion host for SSH access (works with all builders). [GH-387] * **OpenStack v3 Identity:** The OpenStack builder now supports the v3 identity API. * **Docker builder supports SSH**: The Docker builder now supports containers with SSH, just set `communicator` to "ssh" [GH-2244] * **File provisioner can download**: The file provisioner can now download files out of the build process. [GH-1909] * **New config function: `build_name`**: The name of the currently running build. [GH-2232] * **New config function: `build_type`**: The type of the currently running builder. This is useful for provisioners. [GH-2232] * **New config function: `template_dir`**: The directory to the template being built. This should be used for template-relative paths. [GH-54] * **New provisioner: shell-local**: Runs a local shell script. [GH-770] * **New provisioner: powershell**: Provision Windows machines with PowerShell scripts. [GH-2243] * **New provisioner: windows-shell**: Provision Windows machines with batch files. [GH-2243] * **New provisioner: windows-restart**: Restart a Windows machines and wait for it to come back online. [GH-2243] * **Compress post-processor supports multiple algorithms:** The compress post-processor now supports lz4 compression and compresses gzip in parallel for much faster throughput. ### IMPROVEMENTS: * core: Interrupt handling for SIGTERM signal as well. [GH-1858] * core: HTTP downloads support resuming. [GH-2106] * builder/*: Add `ssh_handshake_attempts` to configure the number of handshake attempts done before failure. [GH-2237] * builder/amazon: Add `force_deregister` option for automatic AMI deregistration. [GH-2221] * builder/amazon: Now applies tags to EBS snapshots. [GH-2212] * builder/amazon: Clean up orphaned volumes from Source AMIs. [GH-1783] * builder/amazon: Support custom keypairs. [GH-1837] * builder/amazon-chroot: Can now resize the root volume of the resulting AMI with the `root_volume_size` option. [GH-2289] * builder/amazon-chroot: Add `mount_options` configuration option for providing options to the `mount` command. [GH-2296] * builder/digitalocean: Save SSH key to pwd if debug mode is on. [GH-1829] * builder/digitalocean: User data support. [GH-2113] * builder/googlecompute: Option to use internal IP for connections. [GH-2152] * builder/parallels: Support Parallels Desktop 11. [GH-2199] * builder/openstack: Add `rackconnect_wait` for Rackspace customers to wait for RackConnect data to appear * builder/openstack: Add `ssh_interface` option for rackconnect for users that have prohibitive firewalls * builder/openstack: Flavor names can be used as well as refs * builder/openstack: Add `availability_zone` [GH-2016] * builder/openstack: Machine will be stopped prior to imaging if the cluster supports the `startstop` extension. [GH-2223] * builder/openstack: Support for user data. [GH-2224] * builder/qemu: Default accelerator to "tcg" on Windows. [GH-2291] * builder/virtualbox: Added option: `ssh_skip_nat_mapping` to skip the automatic port forward for SSH and to use the guest port directly. [GH-1078] * builder/virtualbox: Added SCSI support * builder/vmware: Support for additional disks. [GH-1382] * builder/vmware: Can now customize the template used for adding disks. [GH-2254] * command/fix: After fixing, the template is validated. [GH-2228] * command/push: Add `-name` flag for specifying name from CLI. [GH-2042] * command/push: Push configuration in templates supports variables. [GH-1861] * post-processor/docker-save: Can be chained. [GH-2179] * post-processor/docker-tag: Support `force` option. [GH-2055] * post-processor/docker-tag: Can be chained. [GH-2179] * post-processor/vsphere: Make more fields optional, support empty resource pools. [GH-1868] * provisioner/puppet-masterless: `working_directory` option. [GH-1831] * provisioner/puppet-masterless: `packer_build_name` and `packer_build_type` are default facts. [GH-1878] * provisioner/puppet-server: `ignore_exit_codes` option added. [GH-2280] ### BUG FIXES: * core: Fix potential panic for post-processor plugin exits. [GH-2098] * core: `PACKER_CONFIG` may point to a non-existent file. [GH-2226] * builder/amazon: Allow spaces in AMI names when using `clean_ami_name` [GH-2182] * builder/amazon: Remove deprecated ec2-upload-bundle parameter. [GH-1931] * builder/amazon: Use IAM Profile to upload bundle if provided. [GH-1985] * builder/amazon: Use correct exit code after SSH authentication failed. [GH-2004] * builder/amazon: Retry finding created instance for eventual consistency. [GH-2129] * builder/amazon: If no AZ is specified, use AZ chosen automatically by AWS for spot instance. [GH-2017] * builder/amazon: Private key file (only available in debug mode) is deleted on cleanup. [GH-1801] * builder/amazon: AMI copy won't copy to the source region. [GH-2123] * builder/amazon: Validate AMI doesn't exist with name prior to build. [GH-1774] * builder/amazon: Improved retry logic around waiting for instances. [GH-1764] * builder/amazon: Fix issues with creating Block Devices. [GH-2195] * builder/amazon/chroot: Retry waiting for disk attachments. [GH-2046] * builder/amazon/chroot: Only unmount path if it is mounted. [GH-2054] * builder/amazon/instance: Use `-i` in sudo commands so PATH is inherited. [GH-1930] * builder/amazon/instance: Use `--region` flag for bundle upload command. [GH-1931] * builder/digitalocean: Wait for droplet to unlock before changing state, should lower the "pending event" errors. * builder/digitalocean: Ignore invalid fields from the ever-changing v2 API * builder/digitalocean: Private images can be used as a source. [GH-1792] * builder/docker: Fixed hang on prompt while copying script * builder/docker: Use `docker exec` for newer versions of Docker for running scripts. [GH-1993] * builder/docker: Fix crash that could occur at certain timed ctrl-c. [GH-1838] * builder/docker: validate that `export_path` is not a directory. [GH-2105] * builder/google: `ssh_timeout` is respected. [GH-1781] * builder/openstack: `ssh_interface` can be used to specify the interface to retrieve the SSH IP from. [GH-2220] * builder/qemu: Add `disk_discard` option. [GH-2120] * builder/qemu: Use proper SSH port, not hardcoded to 22. [GH-2236] * builder/qemu: Find unused SSH port if SSH port is taken. [GH-2032] * builder/virtualbox: Bind HTTP server to IPv4, which is more compatible with OS installers. [GH-1709] * builder/virtualbox: Remove the floppy controller in addition to the floppy disk. [GH-1879] * builder/virtualbox: Fixed regression where downloading ISO without a ".iso" extension didn't work. [GH-1839] * builder/virtualbox: Output dir is verified at runtime, not template validation time. [GH-2233] * builder/virtualbox: Find unused SSH port if SSH port is taken. [GH-2032] * builder/vmware: Add 100ms delay between keystrokes to avoid subtle timing issues in most cases. [GH-1663] * builder/vmware: Bind HTTP server to IPv4, which is more compatible with OS installers. [GH-1709] * builder/vmware: Case-insensitive match of MAC address to find IP. [GH-1989] * builder/vmware: More robust IP parsing from ifconfig output. [GH-1999] * builder/vmware: Nested output directories for ESXi work. [GH-2174] * builder/vmware: Output dir is verified at runtime, not template validation time. [GH-2233] * command/fix: For the `virtualbox` to `virtualbox-iso` builder rename, provisioner overrides are now also fixed. [GH-2231] * command/validate: don't crash for invalid builds. [GH-2139] * post-processor/atlas: Find common archive prefix for Windows. [GH-1874] * post-processor/atlas: Fix index out of range panic. [GH-1959] * post-processor/vagrant-cloud: Fixed failing on response * post-processor/vagrant-cloud: Don't delete version on error. [GH-2014] * post-processor/vagrant-cloud: Retry failed uploads a few times * provisioner/chef-client: Fix permissions issues on default dir. [GH-2255] * provisioner/chef-client: Node cleanup works now. [GH-2257] * provisioner/puppet-masterless: Allow manifest_file to be a directory * provisioner/salt-masterless: Add `--retcode-passthrough` to salt-call * provisioner/shell: chmod executable script to 0755, not 0777. [GH-1708] * provisioner/shell: inline commands failing will fail the provisioner. [GH-2069] * provisioner/shell: single quotes in env vars are escaped. [GH-2229] * provisioner/shell: Temporary file is deleted after run. [GH-2259] * provisioner/shell: Randomize default script name to avoid strange race issues from Windows. [GH-2270] ## 0.7.5 (December 9, 2014) ### FEATURES: * **New command: `packer push`**: Push template and files to HashiCorp's Atlas for building your templates automatically. * **New post-processor: `atlas`**: Send artifact to HashiCorp's Atlas for versioning and storing artifacts. These artifacts can then be queried using the API, Terraform, etc. ### IMPROVEMENTS: * builder/googlecompute: Support for ubuntu-os-cloud project * builder/googlecompute: Support for OAuth2 to avoid client secrets file * builder/googlecompute: GCE image from persistent disk instead of tarball * builder/qemu: Checksum type "none" can be used * provisioner/chef: Generate a node name if none available * provisioner/chef: Added ssl_verify_mode configuration ### BUG FIXES: * builder/parallels: Fixed attachment of ISO to cdrom device * builder/parallels: Fixed boot load ordering * builder/digitalocean: Fixed decoding of size * builder/digitalocean: Fixed missing content-type header in request * builder/digitalocean: Fixed use of private IP * builder/digitalocean: Fixed the artifact ID generation * builder/vsphere: Fixed credential escaping * builder/qemu: Fixed use of CDROM with disk_image * builder/aws: Fixed IP address for SSH in VPC * builder/aws: Fixed issue with multiple block devices * builder/vmware: Upload VMX to ESX5 after editing * communicator/docker: Fix handling of symlinks during upload * provisioner/chef: Fixed use of sudo in some cases * core: Fixed build name interpolation * postprocessor/vagrant: Fixed check for Vagrantfile template ## 0.7.2 (October 28, 2014) ### FEATURES: * builder/digitalocean: API V2 support. [GH-1463] * builder/parallels: Don't depend on _prl-utils_. [GH-1499] ### IMPROVEMENTS: * builder/amazon/all: Support new AWS Frankfurt region. * builder/docker: Allow remote `DOCKER_HOST`, which works as long as volumes work. [GH-1594] * builder/qemu: Can set cache mode for main disk. [GH-1558] * builder/qemu: Can build from pre-existing disk. [GH-1342] * builder/vmware: Can specify path to Fusion installation with environmental variable `FUSION_APP_PATH`. [GH-1552] * builder/vmware: Can specify the HW version for the VMX. [GH-1530] * builder/vmware/esxi: Will now cache ISOs/floppies remotely. [GH-1479] * builder/vmware/vmx: Source VMX can have a disk connected via SATA. [GH-1604] * post-processors/vagrant: Support Qemu (libvirt) boxes. [GH-1330] * post-processors/vagrantcloud: Support self-hosted box URLs. ### BUG FIXES: * core: Fix loading plugins from pwd. [GH-1521] * builder/amazon: Prefer token in config if given. [GH-1544] * builder/amazon/all: Extended timeout for waiting for AMI. [GH-1533] * builder/virtualbox: Can read VirtualBox version on FreeBSD. [GH-1570] * builder/virtualbox: More robust reading of guest additions URL. [GH-1509] * builder/vmware: Always remove floppies/drives. [GH-1504] * builder/vmware: Wait some time so that post-VMX update aren't overwritten. [GH-1504] * builder/vmware/esxi: Retry power on if it fails. [GH-1334] * builder/vmware-vmx: Fix issue with order of boot command support. [GH-1492] * builder/amazon: Extend timeout and allow user override. [GH-1533] * builder/parallels: Ignore 'The fdd0 device does not exist' [GH-1501] * builder/parallels: Rely on Cleanup functions to detach devices. [GH-1502] * builder/parallels: Create VM without hdd and then add it later. [GH-1548] * builder/parallels: Disconnect cdrom0. [GH-1605] * builder/qemu: Don't use `-redir` flag anymore, replace with `hostfwd` options. [GH-1561] * builder/qemu: Use `pc` as default machine type instead of `pc-1.0`. * providers/aws: Ignore transient network errors. [GH-1579] * provisioner/ansible: Don't buffer output so output streams in. [GH-1585] * provisioner/ansible: Use inventory file always to avoid potentially deprecated feature. [GH-1562] * provisioner/shell: Quote environmental variables. [GH-1568] * provisioner/salt: Bootstrap over SSL. [GH-1608] * post-processors/docker-push: Work with docker-tag artifacts. [GH-1526] * post-processors/vsphere: Append "/" to object address. [GH-1615] ## 0.7.1 (September 10, 2014) ### FEATURES: * builder/vmware: VMware Fusion Pro 7 is now supported. [GH-1478] ### BUG FIXES: * core: SSH will connect slightly faster if it is ready immediately. * provisioner/file: directory uploads no longer hang. [GH-1484] * provisioner/file: fixed crash on large files. [GH-1473] * scripts: Windows executable renamed to packer.exe. [GH-1483] ## 0.7.0 (September 8, 2014) ### BACKWARDS INCOMPATIBILITIES: * The authentication configuration for Google Compute Engine has changed. The new method is much simpler, but is not backwards compatible. `packer fix` will _not_ fix this. Please read the updated GCE docs. ### FEATURES: * **New Post-Processor: `compress`** - Gzip compresses artifacts with files. * **New Post-Processor: `docker-save`** - Save an image. This is similar to export, but preserves the image hierarchy. * **New Post-Processor: `docker-tag`** - Tag a created image. * **New Template Functions: `upper`, `lower`** - See documentation for more details. * core: Plugins are automatically discovered if they're named properly. Packer will look in the PWD and the directory with `packer` for binaries named `packer-TYPE-NAME`. * core: Plugins placed in `~/.packer.d/plugins` are now automatically discovered. * builder/amazon: Spot instances can now be used to build EBS backed and instance store images. [GH-1139] * builder/docker: Images can now be committed instead of exported. [GH-1198] * builder/virtualbox-ovf: New `import_flags` setting can be used to add new command line flags to `VBoxManage import` to allow things such as EULAs to be accepted. [GH-1383] * builder/virtualbox-ovf: Boot commands and the HTTP server are supported. [GH-1169] * builder/vmware: VMware Player 6 is now supported. [GH-1168] * builder/vmware-vmx: Boot commands and the HTTP server are supported. [GH-1169] ### IMPROVEMENTS: * core: `isotime` function can take a format. [GH-1126] * builder/amazon/all: `AWS_SECURITY_TOKEN` is read and can also be set with the `token` configuration. [GH-1236] * builder/amazon/all: Can force SSH on the private IP address with `ssh_private_ip`. [GH-1229] * builder/amazon/all: String fields in device mappings can use variables. [GH-1090] * builder/amazon-instance: EBS AMIs can be used as a source. [GH-1453] * builder/digitalocean: Can set API URL endpoint. [GH-1448] * builder/digitalocean: Region supports variables. [GH-1452] * builder/docker: Can now specify login credentials to pull images. * builder/docker: Support mounting additional volumes. [GH-1430] * builder/parallels/all: Path to tools ISO is calculated automatically. [GH-1455] * builder/parallels-pvm: `reassign_mac` option to choose whether or not to generate a new MAC address. [GH-1461] * builder/qemu: Can specify "none" acceleration type. [GH-1395] * builder/qemu: Can specify "tcg" acceleration type. [GH-1395] * builder/virtualbox/all: `iso_interface` option to mount ISO with SATA. [GH-1200] * builder/vmware-vmx: Proper `floppy_files` support. [GH-1057] * command/build: Add `-color=false` flag to disable color. [GH-1433] * post-processor/docker-push: Can now specify login credentials. [GH-1243] * provisioner/chef-client: Support `chef_environment`. [GH-1190] ### BUG FIXES: * core: nicer error message if an encrypted private key is used for SSH. [GH-1445] * core: Fix crash that could happen with a well timed double Ctrl-C. [GH-1328] [GH-1314] * core: SSH TCP keepalive period is now 5 seconds (shorter). [GH-1232] * builder/amazon-chroot: Can properly build HVM images now. [GH-1360] * builder/amazon-chroot: Fix crash in root device check. [GH-1360] * builder/amazon-chroot: Add description that Packer made the snapshot with a time. [GH-1388] * builder/amazon-ebs: AMI is deregistered if an error. [GH-1186] * builder/amazon-instance: Fix deprecation warning for `ec2-bundle-vol` [GH-1424] * builder/amazon-instance: Add `--no-filter` to the `ec2-bundle-vol` command by default to avoid corrupting data by removing package manager certs. [GH-1137] * builder/amazon/all: `delete_on_termination` set to false will work. * builder/amazon/all: Fix race condition on setting tags. [GH-1367] * builder/amazon/all: More descriptive error messages if Amazon only sends an error code. [GH-1189] * builder/docker: Error if `DOCKER_HOST` is set. * builder/docker: Remove the container during cleanup. [GH-1206] * builder/docker: Fix case where not all output would show up from provisioners. * builder/googlecompute: add `disk_size` option. [GH-1397] * builder/googlecompute: Auth works with latest formats on Google Cloud Console. [GH-1344] * builder/openstack: Region is not required. [GH-1418] * builder/parallels-iso: ISO not removed from VM after install. [GH-1338] * builder/parallels/all: Add support for Parallels Desktop 10. [GH-1438] * builder/parallels/all: Added some navigation keys. [GH-1442] * builder/qemu: If headless, sdl display won't be used. [GH-1395] * builder/qemu: Use `512M` as `-m` default. [GH-1444] * builder/virtualbox/all: Search `VBOX_MSI_INSTALL_PATH` for path to `VBoxManage` on Windows. [GH-1337] * builder/virtualbox/all: Seed RNG to avoid same ports. [GH-1386] * builder/virtualbox/all: Better error if guest additions URL couldn't be detected. [GH-1439] * builder/virtualbox/all: Detect errors even when `VBoxManage` exits with a zero exit code. [GH-1119] * builder/virtualbox/iso: Append timestamp to default name for parallel builds. [GH-1365] * builder/vmware/all: No more error when Packer stops an already-stopped VM. [GH-1300] * builder/vmware/all: `ssh_host` accepts templates. [GH-1396] * builder/vmware/all: Don't remount floppy in VMX post step. [GH-1239] * builder/vmware/vmx: Do not re-add floppy disk files to VMX. [GH-1361] * builder/vmware-iso: Fix crash when `vnc_port_min` and max were the same value. [GH-1288] * builder/vmware-iso: Finding an available VNC port on Windows works. [GH-1372] * builder/vmware-vmx: Nice error if Clone is not supported (not VMware Fusion Pro). [GH-787] * post-processor/vagrant: Can supply your own metadata.json. [GH-1143] * provisioner/ansible-local: Use proper path on Windows. [GH-1375] * provisioner/file: Mode will now be preserved. [GH-1064] ## 0.6.1 (July 20, 2014) ### FEATURES: * **New post processor:** `vagrant-cloud` - Push box files generated by vagrant post processor to Vagrant Cloud. [GH-1289] * Vagrant post-processor can now packer Hyper-V boxes. ### IMPROVEMENTS: * builder/amazon: Support for enhanced networking on HVM images. [GH-1228] * builder/amazon-ebs: Support encrypted EBS volumes. [GH-1194] * builder/ansible: Add `playbook_dir` option. [GH-1000] * builder/openstack: Add ability to configure networks. [GH-1261] * builder/openstack: Skip certificate verification. [GH-1121] * builder/parallels/all: Add ability to select interface to connect to. * builder/parallels/pvm: Support `boot_command`. [GH-1082] * builder/virtualbox/all: Attempt to use local guest additions ISO before downloading from internet. [GH-1123] * builder/virtualbox/ovf: Supports `guest_additions_mode` [GH-1035] * builder/vmware/all: Increase cleanup timeout to 120 seconds. [GH-1167] * builder/vmware/all: Add `vmx_data_post` for modifying VMX data after shutdown. [GH-1149] * builder/vmware/vmx: Supports tools uploading. [GH-1154] ### BUG FIXES: * core: `isotime` is the same time during the entire build. [GH-1153] * builder/amazon-common: Sort AMI strings before outputting. [GH-1305] * builder/amazon: User data can use templates/variables. [GH-1343] * builder/amazon: Can now build AMIs in GovCloud. * builder/null: SSH info can use templates/variables. [GH-1343] * builder/openstack: Workaround for gophercloud.ServerById crashing. [GH-1257] * builder/openstack: Force IPv4 addresses from address pools. [GH-1258] * builder/parallels: Do not delete entire CDROM device. [GH-1115] * builder/parallels: Errors while creating floppy disk. [GH-1225] * builder/parallels: Errors while removing floppy drive. [GH-1226] * builder/virtualbox-ovf: Supports guest additions options. [GH-1120] * builder/vmware-iso: Fix esx5 path separator in windows. [GH-1316] * builder/vmware: Remote ESXi builder now uploads floppy. [GH-1106] * builder/vmware: Remote ESXi builder no longer re-uploads ISO every time. [GH-1244] * post-processor/vsphere: Accept DOMAIN\account usernames. [GH-1178] * provisioner/chef-*: Fix remotePaths for Windows. [GH-394] ## 0.6.0 (May 2, 2014) ### FEATURES: * **New builder:** `null` - The null builder does not produce any artifacts, but is useful for debugging provisioning scripts. [GH-970] * **New builder:** `parallels-iso` and `parallels-pvm` - These can be used to build Parallels virtual machines. [GH-1101] * **New provisioner:** `chef-client` - Provision using a the `chef-client` command, which talks to a Chef Server. [GH-855] * **New provisioner:** `puppet-server` - Provision using Puppet by communicating to a Puppet master. [GH-796] * `min_packer_version` can be specified in a Packer template to force a minimum version. [GH-487] ### IMPROVEMENTS: * core: RPC transport between plugins switched to MessagePack * core: Templates array values can now be comma separated strings. Most importantly, this allows for user variables to fill array configurations. [GH-950] * builder/amazon: Added `ssh_private_key_file` option. [GH-971] * builder/amazon: Added `ami_virtualization_type` option. [GH-1021] * builder/digitalocean: Regions, image names, and sizes can be names that are looked up for their valid ID. [GH-960] * builder/googlecompute: Configurable instance name. [GH-1065] * builder/openstack: Support for conventional OpenStack environmental variables such as `OS_USERNAME`, `OS_PASSWORD`, etc. [GH-768] * builder/openstack: Support `openstack_provider` option to automatically fill defaults for different OpenStack variants. [GH-912] * builder/openstack: Support security groups. [GH-848] * builder/qemu: User variable expansion in `ssh_key_path` [GH-918] * builder/qemu: Floppy disk files list can also include globs and directories. [GH-1086] * builder/virtualbox: Support an `export_opts` option which allows specifying arbitrary arguments when exporting the VM. [GH-945] * builder/virtualbox: Added `vboxmanage_post` option to run vboxmanage commands just before exporting. [GH-664] * builder/virtualbox: Floppy disk files list can also include globs and directories. [GH-1086] * builder/vmware: Workstation 10 support for Linux. [GH-900] * builder/vmware: add cloning support on Windows. [GH-824] * builder/vmware: Floppy disk files list can also include globs and directories. [GH-1086] * command/build: Added `-parallel` flag so you can disable parallelization with `-no-parallel`. [GH-924] * post-processors/vsphere: `disk_mode` option. [GH-778] * provisioner/ansible: Add `inventory_file` option. [GH-1006] * provisioner/chef-client: Add `validation_client_name` option. [GH-1056] ### BUG FIXES: * core: Errors are properly shown when adding bad floppy files. [GH-1043] * core: Fix some URL parsing issues on Windows. * core: Create Cache directory only when it is needed. [GH-367] * builder/amazon-instance: Use S3Endpoint for ec2-upload-bundle arg, which works for every region. [GH-904] * builder/digitalocean: updated default image_id. [GH-1032] * builder/googlecompute: Create persistent disk as boot disk via API v1. [GH-1001] * builder/openstack: Return proper error on invalid instance states. [GH-1018] * builder/virtualbox-iso: Retry unregister a few times to deal with VBoxManage randomness. [GH-915] * provisioner/ansible: Fix paths when provisioning Linux from Windows. [GH-963] * provisioner/ansible: set cwd to staging directory. [GH-1016] * provisioners/chef-client: Don't chown directory with Ubuntu. [GH-939] * provisioners/chef-solo: Deeply nested JSON works properly. [GH-1076] * provisioners/shell: Env var values can have equal signs. [GH-1045] * provisioners/shell: chmod the uploaded script file to 0777. [GH-994] * post-processor/docker-push: Allow repositories with ports. [GH-923] * post-processor/vagrant: Create parent directories for `output` path. [GH-1059] * post-processor/vsphere: datastore, network, and folder are no longer required. [GH-1091] ## 0.5.2 (02/21/2014) ### FEATURES: * **New post-processor:** `docker-import` - Import a Docker image and give it a specific repository/tag. * **New post-processor:** `docker-push` - Push an imported image to a registry. ### IMPROVEMENTS: * core: Most downloads made by Packer now use a custom user agent. [GH-803] * builder/googlecompute: SSH private key will be saved to disk if `-debug` is specified. [GH-867] * builder/qemu: Can specify the name of the qemu binary. [GH-854] * builder/virtualbox-ovf: Can specify import options such as "keepallmacs". [GH-883] ### BUG FIXES: * core: Fix crash case if blank parameters are given to Packer. [GH-832] * core: Fix crash if big file uploads are done. [GH-897] * core: Fix crash if machine-readable output is going to a closed pipe. [GH-875] * builder/docker: user variables work properly. [GH-777] * builder/qemu: reboots are now possible in provisioners. [GH-864] * builder/virtualbox,vmware: iso\_checksum is not required if the checksum type is "none" * builder/virtualbox,vmware/qemu: Support for additional scancodes for `boot_command` such as ``, ``, ``, etc. [GH-808] * communicator/ssh: Send TCP keep-alives on connections. [GH-872] * post-processor/vagrant: AWS/DigitalOcean keep input artifacts by default. [GH-55] * provisioners/ansible-local: Properly upload custom playbooks. [GH-829] * provisioners/ansible-local: Better error if ansible isn't installed. [GH-836] ## 0.5.1 (01/02/2014) ### BUG FIXES: * core: If a stream ID loops around, don't let it use stream ID 0. [GH-767] * core: Fix issue where large writes to plugins would result in stream corruption. [GH-727] * builders/virtualbox-ovf: `shutdown_timeout` config works. [GH-772] * builders/vmware-iso: Remote driver works properly again. [GH-773] ## 0.5.0 (12/30/2013) ### BACKWARDS INCOMPATIBILITIES: * "virtualbox" builder has been renamed to "virtualbox-iso". Running your template through `packer fix` will resolve this. * "vmware" builder has been renamed to "vmware-iso". Running your template through `packer fix` will resolve this. * post-processor/vagrant: Syntax for overriding by provider has changed. See the documentation for more information. Running your template through `packer fix` should resolve this. * post-processor/vsphere: Some available configuration options were changed. Running your template through `packer fix` should resolve this. * provisioner/puppet-masterless: The `execute_command` no longer has the `Has*` variables, since the templating language now supports comparison operations. See the Go documentation for more info: http://golang.org/pkg/text/template/ ### FEATURES: * **New builder:** Google Compute Engine. You can now build images for use in Google Compute Engine. See the documentation for more information. [GH-715] * **New builder:** "virtualbox-ovf" can build VirtualBox images from an existing OVF or OVA. [GH-201] * **New builder:** "vmware-vmx" can build VMware images from an existing VMX. [GH-201] * Environmental variables can now be accessed as default values for user variables using the "env" function. See the documentation for more information. * "description" field in templates: write a human-readable description of what a template does. This will be shown in `packer inspect`. * Vagrant post-processor now accepts a list of files to include in the box. * All provisioners can now have a "pause\_before" parameter to wait some period of time before running that provisioner. This is useful for reboots. [GH-737] ### IMPROVEMENTS: * core: Plugins communicate over a single TCP connection per plugin now, instead of sometimes dozens. Performance around plugin communication dramatically increased. * core: Build names are now template processed so you can use things like user variables in them. [GH-744] * core: New "pwd" function available globally that returns the working directory. [GH-762] * builder/amazon/all: Launched EC2 instances now have a name of "Packer Builder" so that they are easily recognizable. [GH-642] * builder/amazon/all: Copying AMIs to multiple regions now happens in parallel. [GH-495] * builder/amazon/all: Ability to specify "run\_tags" to tag the instance while running. [GH-722] * builder/digitalocean: Private networking support. [GH-698] * builder/docker: A "run\_command" can be specified, configuring how the container is started. [GH-648] * builder/openstack: In debug mode, the generated SSH keypair is saved so you can SSH into the machine. [GH-746] * builder/qemu: Floppy files are supported. [GH-686] * builder/qemu: Next `run_once` option tells Qemu to run only once, which is useful for Windows installs that handle reboots for you. [GH-687] * builder/virtualbox: Nice errors if Packer can't write to the output directory. * builder/virtualbox: ISO is ejected prior to export. * builder/virtualbox: Checksum type can be "none" [GH-471] * builder/vmware: Can now specify path to the Fusion application. [GH-677] * builder/vmware: Checksum type can be "none" [GH-471] * provisioner/puppet-masterless: Can now specify a `manifest_dir` to upload manifests to the remote machine for imports. [GH-655] ### BUG FIXES: * core: No colored output in machine-readable output. [GH-684] * core: User variables can now be used for non-string fields. [GH-598] * core: Fix bad download paths if the download URL contained a "." before a "/" [GH-716] * core: "{{timestamp}}" values will always be the same for the entire duration of a build. [GH-744] * builder/amazon: Handle cases where security group isn't instantly available. [GH-494] * builder/virtualbox: don't download guest additions if disabled. [GH-731] * post-processor/vsphere: Uploads VM properly. [GH-694] * post-processor/vsphere: Process user variables. * provisioner/ansible-local: all configurations are processed as templates [GH-749] * provisioner/ansible-local: playbook paths are properly validated as directories, not files. [GH-710] * provisioner/chef-solo: Environments are recognized. [GH-726] ## 0.4.1 (December 7, 2013) ### IMPROVEMENTS: * builder/amazon/ebs: New option allows associating a public IP with non-default VPC instances. [GH-660] * builder/openstack: A "proxy\_url" setting was added to define an HTTP proxy to use when building with this builder. [GH-637] ### BUG FIXES: * core: Don't change background color on CLI anymore, making things look a tad nicer in some terminals. * core: multiple ISO URLs works properly in all builders. [GH-683] * builder/amazon/chroot: Block when obtaining file lock to allow parallel builds. [GH-689] * builder/amazon/instance: Add location flag to upload bundle command so that building AMIs works out of us-east-1. [GH-679] * builder/qemu: Qemu arguments are templated. [GH-688] * builder/vmware: Cleanup of VMX keys works properly so cd-rom won't get stuck with ISO. [GH-685] * builder/vmware: File cleanup is more resilient to file delete races with the operating system. [GH-675] * provisioner/puppet-masterless: Check for hiera config path existence properly. [GH-656] ## 0.4.0 (November 19, 2013) ### FEATURES: * Docker builder: build and export Docker containers, easily provisioned with any of the Packer built-in provisioners. * QEMU builder: builds a new VM compatible with KVM or Xen using QEMU. * Remote ESXi builder: builds a VMware VM using ESXi remotely using only SSH to an ESXi machine directly. * vSphere post-processor: Can upload VMware artifacts to vSphere * Vagrant post-processor can now make DigitalOcean provider boxes. [GH-504] ### IMPROVEMENTS: * builder/amazon/all: Can now specify a list of multiple security group IDs to apply. [GH-499] * builder/amazon/all: AWS API requests are now retried when a temporary network error occurs as well as 500 errors. [GH-559] * builder/virtualbox: Use VBOX\_INSTALL\_PATH env var on Windows to find VBoxManage. [GH-628] * post-processor/vagrant: skips gzip compression when compression_level=0 * provisioner/chef-solo: Encrypted data bag support. [GH-625] ### BUG FIXES: * builder/amazon/chroot: Copying empty directories works. [GH-588] * builder/amazon/chroot: Chroot commands work with shell provisioners. [GH-581] * builder/amazon/chroot: Don't choose a mount point that is a partition of an already mounted device. [GH-635] * builder/virtualbox: Ctrl-C interrupts during waiting for boot. [GH-618] * builder/vmware: VMX modifications are now case-insensitive. [GH-608] * builder/vmware: VMware Fusion won't ask for VM upgrade. * builder/vmware: Ctrl-C interrupts during waiting for boot. [GH-618] * provisioner/chef-solo: Output is slightly prettier and more informative. ## 0.3.11 (November 4, 2013) ### FEATURES: * builder/amazon/ebs: Ability to specify which availability zone to create instance in. [GH-536] ### IMPROVEMENTS: * core: builders can now give warnings during validation. warnings won't fail the build but may hint at potential future problems. * builder/digitalocean: Can now specify a droplet name * builder/virtualbox: Can now disable guest addition download entirely by setting "guest_additions_mode" to "disable" [GH-580] * builder/virtualbox,vmware: ISO urls can now be https. [GH-587] * builder/virtualbox,vmware: Warning if shutdown command is not specified, since it is a common case of data loss. ### BUG FIXES: * core: Won't panic when writing to a bad pipe. [GH-560] * builder/amazon/all: Properly scrub access key and secret key from logs. [GH-554] * builder/openstack: Properly scrub password from logs. [GH-554] * builder/virtualbox: No panic if SSH host port min/max is the same. [GH-594] * builder/vmware: checks if `ifconfig` is in `/sbin` [GH-591] * builder/vmware: Host IP lookup works for non-C locales. [GH-592] * common/uuid: Use cryptographically secure PRNG when generating UUIDs. [GH-552] * communicator/ssh: File uploads that exceed the size of memory no longer cause crashes. [GH-561] ## 0.3.10 (October 20, 2013) ### FEATURES: * Ansible provisioner ### IMPROVEMENTS: * post-processor/vagrant: support instance-store AMIs built by Packer. [GH-502] * post-processor/vagrant: can now specify compression level to use when creating the box. [GH-506] ### BUG FIXES: * builder/all: timeout waiting for SSH connection is a failure. [GH-491] * builder/amazon: Scrub sensitive data from the logs. [GH-521] * builder/amazon: Handle the situation where an EC2 instance might not be immediately available. [GH-522] * builder/amazon/chroot: Files copied into the chroot remove destination before copy, fixing issues with dangling symlinks. [GH-500] * builder/digitalocean: don't panic if erroneous API response doesn't contain error message. [GH-492] * builder/digitalocean: scrub API keys from config debug output. [GH-516] * builder/virtualbox: error if VirtualBox version cant be detected. [GH-488] * builder/virtualbox: detect if vboxdrv isn't properly setup. [GH-488] * builder/virtualbox: sleep a bit before export to ensure the session is unlocked. [GH-512] * builder/virtualbox: create SATA drives properly on VirtualBox 4.3. [GH-547] * builder/virtualbox: support user templates in SSH key path. [GH-539] * builder/vmware: support user templates in SSH key path. [GH-539] * communicator/ssh: Fix issue where a panic could arise from a nil dereference. [GH-525] * post-processor/vagrant: Fix issue with VirtualBox OVA. [GH-548] * provisioner/salt: Move salt states to correct remote directory. [GH-513] * provisioner/shell: Won't block on certain scripts on Windows anymore. [GH-507] ## 0.3.9 (October 2, 2013) ### FEATURES: * The Amazon chroot builder is now able to run without any `sudo` privileges by using the "command_wrapper" configuration. [GH-430] * Chef provisioner supports environments. [GH-483] ### BUG FIXES: * core: default user variable values don't need to be strings. [GH-456] * builder/amazon-chroot: Fix errors with waiting for state change. [GH-459] * builder/digitalocean: Use proper error message JSON key (DO API change). * communicator/ssh: SCP uploads now work properly when directories contain symlinks. [GH-449] * provisioner/chef-solo: Data bags and roles path are now properly populated when set. [GH-470] * provisioner/shell: Windows line endings are actually properly changed to Unix line endings. [GH-477] ## 0.3.8 (September 22, 2013) ### FEATURES: * core: You can now specify `only` and `except` configurations on any provisioner or post-processor to specify a list of builds that they are valid for. [GH-438] * builders/virtualbox: Guest additions can be attached rather than uploaded, easier to handle for Windows guests. [GH-405] * provisioner/chef-solo: Ability to specify a custom Chef configuration template. * provisioner/chef-solo: Roles and data bags support. [GH-348] ### IMPROVEMENTS: * core: User variables can now be used for integer, boolean, etc. values. [GH-418] * core: Plugins made with incompatible versions will no longer load. * builder/amazon/all: Interrupts work while waiting for AMI to be ready. * provisioner/shell: Script line-endings are automatically converted to Unix-style line-endings. Can be disabled by setting "binary" to "true". [GH-277] ### BUG FIXES: * core: Set TCP KeepAlives on internally created RPC connections so that they don't die. [GH-416] * builder/amazon/all: While waiting for AMI, will detect "failed" state. * builder/amazon/all: Waiting for state will detect if the resource (AMI, instance, etc.) disappears from under it. * builder/amazon/instance: Exclude only contents of /tmp, not /tmp itself. [GH-437] * builder/amazon/instance: Make AccessKey/SecretKey available to bundle command even when they come from the environment. [GH-434] * builder/virtualbox: F1-F12 and delete scancodes now work. [GH-425] * post-processor/vagrant: Override configurations properly work. [GH-426] * provisioner/puppet-masterless: Fix failure case when both facter vars are used and prevent_sudo. [GH-415] * provisioner/puppet-masterless: User variables now work properly in manifest file and hiera path. [GH-448] ## 0.3.7 (September 9, 2013) ### BACKWARDS INCOMPATIBILITIES: * The "event_delay" option for the DigitalOcean builder is now gone. The builder automatically waits for events to go away. Run your templates through `packer fix` to get rid of these. ### FEATURES: * **NEW PROVISIONER:** `puppet-masterless`. You can now provision with a masterless Puppet setup. [GH-234] * New globally available template function: `uuid`. Generates a new random UUID. * New globally available template function: `isotime`. Generates the current time in ISO standard format. * New Amazon template function: `clean_ami_name`. Substitutes '-' for characters that are illegal to use in an AMI name. ### IMPROVEMENTS: * builder/amazon/all: Ability to specify the format of the temporary keypair created. [GH-389] * builder/amazon/all: Support the NoDevice flag for block mappings. [GH-396] * builder/digitalocean: Retry on any pending event errors. * builder/openstack: Can now specify a project. [GH-382] * builder/virtualbox: Can now attach hard drive over SATA. [GH-391] * provisioner/file: Can now upload directories. [GH-251] ### BUG FIXES: * core: Detect if SCP is not enabled on the other side. [GH-386] * builder/amazon/all: When copying AMI to multiple regions, copy the metadata (tags and attributes) as well. [GH-388] * builder/amazon/all: Fix panic case where eventually consistent instance state caused an index out of bounds. * builder/virtualbox: The `vm_name` setting now properly sets the OVF name of the output. [GH-401] * builder/vmware: Autoanswer VMware dialogs. [GH-393] * command/inspect: Fix weird output for default values for optional vars. ## 0.3.6 (September 2, 2013) ### FEATURES: * User variables can now be specified as "required", meaning the user MUST specify a value. Just set the default value to "null". [GH-374] ### IMPROVEMENTS: * core: Much improved interrupt handling. For example, interrupts now cancel much more quickly within provisioners. * builder/amazon: In `-debug` mode, the keypair used will be saved to the current directory so you can access the machine. [GH-373] * builder/amazon: In `-debug` mode, the DNS is outputted. * builder/openstack: IPv6 addresses supported for SSH. [GH-379] * communicator/ssh: Support for private keys encrypted using PKCS8. [GH-376] * provisioner/chef-solo: You can now use user variables in the `json` configuration for Chef. [GH-362] ### BUG FIXES: * core: Concurrent map access is completely gone, fixing rare issues with runtime memory corruption. [GH-307] * core: Fix possible panic when ctrl-C during provisioner run. * builder/digitalocean: Retry destroy a few times because DO sometimes gives false errors. * builder/openstack: Properly handle the case no image is made. [GH-375] * builder/openstack: Specifying a region is now required in a template. * provisioners/salt-masterless: Use filepath join to properly join paths. ## 0.3.5 (August 28, 2013) ### FEATURES: * **NEW BUILDER:** `openstack`. You can now build on OpenStack. [GH-155] * **NEW PROVISIONER:** `chef-solo`. You can now provision with Chef using `chef-solo` from local cookbooks. * builder/amazon: Copy AMI to multiple regions with `ami_regions`. [GH-322] * builder/virtualbox,vmware: Can now use SSH keys as an auth mechanism for SSH using `ssh_key_path`. [GH-70] * builder/virtualbox,vmware: Support SHA512 as a checksum type. [GH-356] * builder/vmware: The root hard drive type can now be specified with "disk_type_id" for advanced users. [GH-328] * provisioner/salt-masterless: Ability to specify a minion config. [GH-264] * provisioner/salt-masterless: Ability to upload pillars. [GH-353] ### IMPROVEMENTS: * core: Output message when Ctrl-C received that we're cleaning up. [GH-338] * builder/amazon: Tagging now works with all amazon builder types. * builder/vmware: Option `ssh_skip_request_pty` for not requesting a PTY for the SSH connection. [GH-270] * builder/vmware: Specify a `vmx_template_path` in order to customize the generated VMX. [GH-270] * command/build: Machine-readable output now contains build errors, if any. * command/build: An "end" sentinel is outputted in machine-readable output for artifact listing so it is easier to know when it is over. ### BUG FIXES: * core: Fixed a couple cases where a double ctrl-C could panic. * core: Template validation fails if an override is specified for a non-existent builder. [GH-336] * core: The SSH connection is heartbeated so that drops can be detected. [GH-200] * builder/amazon/instance: Remove check for ec2-ami-tools because it didn't allow absolute paths to work properly. [GH-330] * builder/digitalocean: Send a soft shutdown request so that files are properly synced before shutdown. [GH-332] * command/build,command/validate: If a non-existent build is specified to '-only' or '-except', it is now an error. [GH-326] * post-processor/vagrant: Setting OutputPath with a timestamp now always works properly. [GH-324] * post-processor/vagrant: VirtualBox OVA formats now turn into Vagrant boxes properly. [GH-331] * provisioner/shell: Retry upload if start command fails, making reboot handling much more robust. ## 0.3.4 (August 21, 2013) ### IMPROVEMENTS: * post-processor/vagrant: the file being compressed will be shown in the UI. [GH-314] ### BUG FIXES: * core: Avoid panics when double-interrupting Packer. * provisioner/shell: Retry shell script uploads, making reboots more robust if they happen to fail in this stage. [GH-282] ## 0.3.3 (August 19, 2013) ### FEATURES: * builder/virtualbox: support exporting in OVA format. [GH-309] ### IMPROVEMENTS: * core: All HTTP downloads across Packer now support the standard proxy environmental variables (`HTTP_PROXY`, `NO_PROXY`, etc.) [GH-252] * builder/amazon: API requests will use HTTP proxy if specified by environmental variables. * builder/digitalocean: API requests will use HTTP proxy if specified by environmental variables. ### BUG FIXES: * core: TCP connection between plugin processes will keep-alive. [GH-312] * core: No more "unused key keep_input_artifact" for post processors. [GH-310] * post-processor/vagrant: `output_path` templates now work again. ## 0.3.2 (August 18, 2013) ### FEATURES: * New command: `packer inspect`. This command tells you the components of a template. It respects the `-machine-readable` flag as well so you can parse out components of a template. * Packer will detect its own crashes (always a bug) and save a "crash.log" file. * builder/virtualbox: You may now specify multiple URLs for an ISO using "iso_url" in a template. The URLs will be tried in order. * builder/vmware: You may now specify multiple URLs for an ISO using "iso_url" in a template. The URLs will be tried in order. ### IMPROVEMENTS: * core: built with Go 1.1.2 * core: packer help output now loads much faster. * builder/virtualbox: guest_additions_url can now use the `Version` variable to get the VirtualBox version. [GH-272] * builder/virtualbox: Do not check for VirtualBox as part of template validation; only check at execution. * builder/vmware: Do not check for VMware as part of template validation; only check at execution. * command/build: A path of "-" will read the template from stdin. * builder/amazon: add block device mappings. [GH-90] ### BUG FIXES: * windows: file URLs are easier to get right as Packer has better parsing and error handling for Windows file paths. [GH-284] * builder/amazon/all: Modifying more than one AMI attribute type no longer crashes. * builder/amazon-instance: send IAM instance profile data. [GH-294] * builder/digitalocean: API request parameters are properly URL encoded. [GH-281] * builder/virtualbox: download progress won't be shown until download actually starts. [GH-288] * builder/virtualbox: floppy files names of 13 characters are now properly written to the FAT12 filesystem. [GH-285] * builder/vmware: download progress won't be shown until download actually starts. [GH-288] * builder/vmware: interrupt works while typing commands over VNC. * builder/virtualbox: floppy files names of 13 characters are now properly written to the FAT12 filesystem. [GH-285] * post-processor/vagrant: Process user variables. [GH-295] ## 0.3.1 (August 12, 2013) ### IMPROVEMENTS: * provisioner/shell: New setting `start_retry_timeout` which is the timeout for the provisioner to attempt to _start_ the remote process. This allows the shell provisioner to work properly with reboots. [GH-260] ### BUG FIXES: * core: Remote command output containing '\r' now looks much better within the Packer output. * builder/vmware: Fix issue with finding driver files. [GH-279] * provisioner/salt-masterless: Uploads work properly from Windows. [GH-276] ## 0.3.0 (August 12, 2013) ### BACKWARDS INCOMPATIBILITIES: * All `{{.CreateTime}}` variables within templates (such as for AMI names) are now replaced with `{{timestamp}}`. Run `packer fix` to fix your templates. ### FEATURES: * **User Variables** allow you to specify variables within your templates that can be replaced using the command-line, files, or environmental variables. This dramatically improves the portability of packer templates. See the documentation for more information. * **Machine-readable output** can be enabled by passing the `-machine-readable` flag to _any_ Packer command. * All strings in a template are now processed for variables/functions, so things like `{{timestamp}}` can be used everywhere. More features will be added in the future. * The `amazon` builders (all of them) can now have attributes of their resulting AMIs modified, such as access permissions and product codes. ### IMPROVEMENTS: * builder/amazon/all: User data can be passed to start the instances. [GH-253] * provisioner/salt-masterless: `local_state_tree` is no longer required, allowing you to use shell provisioner (or others) to bring this down. [GH-269] ### BUG FIXES: * builder/amazon/ebs,instance: Retry deleing security group a few times. [GH-278] * builder/vmware: Workstation works on Windows XP now. [GH-238] * builder/vmware: Look for files on Windows in multiple locations using multiple environmental variables. [GH-263] * provisioner/salt-masterless: states aren't deleted after the run anymore. [GH-265] * provisioner/salt-masterless: error if any commands exit with a non-zero exit status. [GH-266] ## 0.2.3 (August 7, 2013) ### IMPROVEMENTS: * builder/amazon/all: Added Amazon AMI tag support. [GH-233] ### BUG FIXES: * core: Absolute/relative filepaths on Windows now work for iso_url and other settings. [GH-240] * builder/amazon/all: instance info is refreshed while waiting for SSH, allowing Packer to see updated IP/DNS info. [GH-243] ## 0.2.2 (August 1, 2013) ### FEATURES: * New builder: `amazon-chroot` can create EBS-backed AMIs without launching a new EC2 instance. This can shave minutes off of the AMI creation process. See the docs for more info. * New provisioner: `salt-masterless` will provision the node using Salt without a master. * The `vmware` builder now works with Workstation 9 on Windows. [GH-222] * The `vmware` builder now works with Player 5 on Linux. [GH-190] ### IMPROVEMENTS: * core: Colors won't be outputted on Windows unless in Cygwin. * builder/amazon/all: Added `iam_instance_profile` to launch the source image with a given IAM profile. [GH-226] ### BUG FIXES: * builder/virtualbox,vmware: relative paths work properly as URL configurations. [GH-215] * builder/virtualbox,vmware: fix race condition in deleting the output directory on Windows by retrying. ## 0.2.1 (July 26, 2013) ### FEATURES: * New builder: `amazon-instance` can create instance-storage backed AMIs. * VMware builder now works with Workstation 9 on Linux. ### IMPROVEMENTS: * builder/amazon/all: Ctrl-C while waiting for state change works * builder/amazon/ebs: Can now launch instances into a VPC for added protection. [GH-210] * builder/virtualbox,vmware: Add backspace, delete, and F1-F12 keys to the boot command. * builder/virtualbox: massive performance improvements with big ISO files because an expensive copy is avoided. [GH-202] * builder/vmware: CD is removed prior to exporting final machine. [GH-198] ### BUG FIXES: * builder/amazon/all: Gracefully handle when AMI appears to not exist while AWS state is propagating. [GH-207] * builder/virtualbox: Trim carriage returns for Windows to properly detect VM state on Windows. [GH-218] * core: build names no longer cause invalid config errors. [GH-197] * command/build: If any builds fail, exit with non-zero exit status. * communicator/ssh: SCP exit codes are tested and errors are reported. [GH-195] * communicator/ssh: Properly change slash direction for Windows hosts. [GH-218] ## 0.2.0 (July 16, 2013) ### BACKWARDS INCOMPATIBILITIES: * "iso_md5" in the virtualbox and vmware builders is replaced with "iso_checksum" and "iso_checksum_type" (with the latter set to "md5"). See the announce below on `packer fix` to automatically fix your templates. ### FEATURES: * **NEW COMMAND:** `packer fix` will attempt to fix templates from older versions of Packer that are now broken due to backwards incompatibilities. This command will fix the backwards incompatibilities introduced in this version. * Amazon EBS builder can now optionally use a pre-made security group instead of randomly generating one. * DigitalOcean API key and client IDs can now be passed in as environmental variables. See the documentation for more details. * VirtualBox and VMware can now have `floppy_files` specified to attach floppy disks when booting. This allows for unattended Windows installs. * `packer build` has a new `-force` flag that forces the removal of existing artifacts if they exist. [GH-173] * You can now log to a file (instead of just stderr) by setting the `PACKER_LOG_FILE` environmental variable. [GH-168] * Checksums other than MD5 can now be used. SHA1 and SHA256 can also be used. See the documentation on `iso_checksum_type` for more info. [GH-175] ### IMPROVEMENTS: * core: invalid keys in configuration are now considered validation errors. [GH-104] * core: all builders now share a common SSH connection core, improving SSH reliability over all the builders. * amazon-ebs: Credentials will come from IAM role if available. [GH-160] * amazon-ebs: Verify the source AMI is EBS-backed before launching. [GH-169] * shell provisioner: the build name and builder type are available in the `PACKER_BUILD_NAME` and `PACKER_BUILDER_TYPE` env vars by default, respectively. [GH-154] * vmware: error if shutdown command has non-zero exit status. ### BUG FIXES: * core: UI messages are now properly prefixed with spaces again. * core: If SSH connection ends, re-connection attempts will take place. [GH-152] * virtualbox: "paused" doesn't mean the VM is stopped, improving shutdown detection. * vmware: error if guest IP could not be detected. [GH-189] ## 0.1.5 (July 7, 2013) ### FEATURES: * "file" uploader will upload files from the machine running Packer to the remote machine. * VirtualBox guest additions URL and checksum can now be specified, allowing the VirtualBox builder to have the ability to be used completely offline. ### IMPROVEMENTS: * core: If SCP is not available, a more descriptive error message is shown telling the user. [GH-127] * shell: Scripts are now executed by default according to their shebang, not with `/bin/sh`. [GH-105] * shell: You can specify what interpreter you want inline scripts to run with `inline_shebang`. * virtualbox: Delete the packer-made SSH port forwarding prior to exporting the VM. ### BUG FIXES: * core: Non-200 response codes on downloads now show proper errors. [GH-141] * amazon-ebs: SSH handshake is retried. [GH-130] * vagrant: The `BuildName` template property works properly in the output path. * vagrant: Properly configure the provider-specific post-processors so things like `vagrantfile_template` work. [GH-129] * vagrant: Close filehandles when copying files so Windows can rename files. [GH-100] ## 0.1.4 (July 2, 2013) ### FEATURES: * virtualbox: Can now be built headless with the "Headless" option. [GH-99] * virtualbox: and codes for waiting 5 and 10 seconds during the boot sequence, respectively. [GH-97] * vmware: Can now be built headless with the "Headless" option. [GH-99] * vmware: and codes for waiting 5 and 10 seconds during the boot sequence, respectively. [GH-97] * vmware: Disks are defragmented and compacted at the end of the build. This can be disabled using "skip_compaction" ### IMPROVEMENTS: * core: Template syntax errors now show line and character number. [GH-56] * amazon-ebs: Access key and secret access key default to environmental variables. [GH-40] * virtualbox: Send password for keyboard-interactive auth. [GH-121] * vmware: Send password for keyboard-interactive auth. [GH-121] ### BUG FIXES: * vmware: Wait until shut down cleans up properly to avoid corrupt disk files. [GH-111] ## 0.1.3 (July 1, 2013) ### FEATURES: * The VMware builder can now upload the VMware tools for you into the VM. This is opt-in, you must specify the `tools_upload_flavor` option. See the website for more documentation. ### IMPROVEMENTS: * digitalocean: Errors contain human-friendly error messages. [GH-85] ### BUG FIXES: * core: More plugin server fixes that avoid hangs on OS X 10.7. [GH-87] * vagrant: AWS boxes will keep the AMI artifact around. [GH-55] * virtualbox: More robust version parsing for uploading guest additions. [GH-69] * virtualbox: Output dir and VM name defaults depend on build name, avoiding collisions. [GH-91] * vmware: Output dir and VM name defaults depend on build name, avoiding collisions. [GH-91] ## 0.1.2 (June 29, 2013) ### IMPROVEMENTS: * core: Template doesn't validate if there are no builders. * vmware: Delete any VMware files in the VM that aren't necessary for it to function. ### BUG FIXES: * core: Plugin servers consider a port in use if there is any error listening to it. This fixes I18n issues and Windows. [GH-58] * amazon-ebs: Sleep between checking instance state to avoid RequestLimitExceeded. [GH-50] * vagrant: Rename VirtualBox ovf to "box.ovf" [GH-64] * vagrant: VMware boxes have the correct provider type. * vmware: Properly populate files in artifact so that the Vagrant post-processor works. [GH-63] ## 0.1.1 (June 28, 2013) ### BUG FIXES: * core: plugins listen explicitly on 127.0.0.1, fixing odd hangs. [GH-37] * core: fix race condition on verifying checksum of large ISOs which could cause panics. [GH-52] * virtualbox: `boot_wait` defaults to "10s" rather than 0. [GH-44] * virtualbox: if `http_port_min` and max are the same, it will no longer panic. [GH-53] * vmware: `boot_wait` defaults to "10s" rather than 0. [GH-44] * vmware: if `http_port_min` and max are the same, it will no longer panic. [GH-53] ## 0.1.0 (June 28, 2013) * Initial release packer-1.6.6+ds1/CODEOWNERS000066400000000000000000000071361377171306200150650ustar00rootroot00000000000000* @hashicorp/packer # builders /examples/alicloud/ @chhaj5236 @alexyueer /builder/alicloud/ @chhaj5236 @alexyueer /website/pages/docs/builders/alicloud* @chhaj5236 @alexyueer /examples/azure/ @paulmey /builder/azure/ @paulmey /website/pages/docs/builders/azure* @paulmey /builder/digitalocean/ @andrewsomething /website/pages/docs/builders/digitalocean* @andrewsomething /builder/hyperv/ @taliesins /website/pages/docs/builders/hyperv* @taliesins /examples/jdcloud/ @XiaohanLiang @remrain /builder/jdcloud/ @XiaohanLiang @remrain /website/pages/docs/builders/jdcloud* @XiaohanLiang @remrain /builder/linode/ @displague @ctreatma @stvnjacobs @charliekenney23 @phillc /website/pages/docs/builders/linode* @displague @ctreatma @stvnjacobs @charliekenney23 @phillc /builder/lxc/ @ChrisLundquist /website/pages/docs/builders/lxc* @ChrisLundquist /test/fixtures/builder-lxc/ @ChrisLundquist /test/builder_lxc* @ChrisLundquist /builder/lxd/ @ChrisLundquist /website/pages/docs/builders/lxd* @ChrisLundquist /builder/oneandone/ @jasmingacic /website/pages/docs/builders/oneandone* @jasmingacic /builder/oracle/ @prydie @owainlewis /website/pages/docs/builders/oracle* @prydie @owainlewis /builder/profitbricks/ @jasmingacic /website/pages/docs/builders/profitbricks* @jasmingacic /builder/triton/ @sean- /website/pages/docs/builders/triton* @sean- /builder/ncloud/ @YuSungDuk /website/pages/docs/builders/ncloud* @YuSungDuk /builder/proxmox/ @carlpett /website/pages/docs/builders/proxmox* @carlpett /builder/scaleway/ @scaleway/devtools /website/pages/docs/builders/scaleway* @scaleway/devtools /builder/hcloud/ @LKaemmerling /website/pages/docs/builders/hcloud* @LKaemmerling /examples/hyperone/ @m110 @gregorybrzeski @ad-m /builder/hyperone/ @m110 @gregorybrzeski @ad-m /website/pages/docs/builders/hyperone* @m110 @gregorybrzeski @ad-m /test/builder_hyperone* @m110 @gregorybrzeski @ad-m /test/fixtures/builder-hyperone/ @m110 @gregorybrzeski @ad-m /examples/ucloud/ @shawnmssu /builder/ucloud/ @shawnmssu /website/pages/docs/builders/ucloud* @shawnmssu /builder/yandex/ @GennadySpb @alexanderKhaustov @seukyaso /website/pages/docs/builders/yandex* @GennadySpb @alexanderKhaustov @seukyaso /builder/osc/ @marinsalinas @Hakujou /website/pages/docs/builders/osc* @marinsalinas @Hakujou /examples/tencentcloud/ @likexian /builder/tencentcloud/ @likexian /website/pages/docs/builders/tencentcloud* @likexian # provisioners /examples/ansible/ @bhcleek /provisioner/ansible/ @bhcleek /provisioner/converge/ @stevendborrelli # post-processors /post-processor/alicloud-import/ dongxiao.zzh@alibaba-inc.com /post-processor/checksum/ v.tolstov@selfip.ru /post-processor/exoscale-import/ @falzm @mcorbin /post-processor/googlecompute-export/ crunkleton@google.com /post-processor/yandex-export/ @GennadySpb /post-processor/yandex-import/ @GennadySpb /post-processor/vsphere-template/ nelson@bennu.cl /post-processor/ucloud-import/ @shawnmssu packer-1.6.6+ds1/Dockerfile000066400000000000000000000016431377171306200154610ustar00rootroot00000000000000FROM docker.mirror.hashicorp.services/ubuntu:16.04 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -y \ locales \ openssh-server \ sudo RUN locale-gen en_US.UTF-8 RUN if ! getent passwd vagrant; then useradd -d /home/vagrant -m -s /bin/bash vagrant; fi \ && echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ && mkdir -p /etc/sudoers.d \ && echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/vagrant \ && chmod 0440 /etc/sudoers.d/vagrant RUN mkdir -p /home/vagrant/.ssh \ && chmod 0700 /home/vagrant/.ssh \ && wget --no-check-certificate \ https://raw.github.com/hashicorp/vagrant/master/keys/vagrant.pub \ -O /home/vagrant/.ssh/authorized_keys \ && chmod 0600 /home/vagrant/.ssh/authorized_keys \ && chown -R vagrant /home/vagrant/.ssh RUN mkdir -p /run/sshd CMD /usr/sbin/sshd -D \ -o UseDNS=no \ -o PidFile=/tmp/sshd.pid packer-1.6.6+ds1/LICENSE000066400000000000000000000405251377171306200144760ustar00rootroot00000000000000Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. packer-1.6.6+ds1/Makefile000066400000000000000000000162461377171306200151340ustar00rootroot00000000000000TEST?=$(shell go list ./...) COUNT?=1 VET?=$(shell go list ./...) ACC_TEST_BUILDERS?=all ACC_TEST_PROVISIONERS?=all # Get the current full sha from git GITSHA:=$(shell git rev-parse HEAD) # Get the current local branch name from git (if we can, this may be blank) GITBRANCH:=$(shell git symbolic-ref --short HEAD 2>/dev/null) GOOS=$(shell go env GOOS) GOARCH=$(shell go env GOARCH) GOPATH=$(shell go env GOPATH) EXECUTABLE_FILES=$(shell find . -type f -executable | egrep -v '^\./(website/[vendor|tmp]|vendor/|\.git|bin/|scripts/|pkg/)' | egrep -v '.*(\.sh|\.bats|\.git)' | egrep -v './provisioner/(ansible|inspec)/test-fixtures/exit1') # Get the git commit GIT_DIRTY=$(shell test -n "`git status --porcelain`" && echo "+CHANGES" || true) GIT_COMMIT=$(shell git rev-parse --short HEAD) GIT_IMPORT=github.com/hashicorp/packer/version UNAME_S := $(shell uname -s) LDFLAGS=-s -w GOLDFLAGS=-X $(GIT_IMPORT).GitCommit=$(GIT_COMMIT)$(GIT_DIRTY) $(LDFLAGS) export GOLDFLAGS .PHONY: bin checkversion ci ci-lint default install-build-deps install-gen-deps fmt fmt-docs fmt-examples generate install-lint-deps lint \ releasebin test testacc testrace default: install-build-deps install-gen-deps generate dev ci: testrace ## Test in continuous integration release: install-build-deps test releasebin package ## Build a release build bin: install-build-deps ## Build debug/test build @echo "WARN: 'make bin' is for debug / test builds only. Use 'make release' for release builds." @GO111MODULE=auto sh -c "$(CURDIR)/scripts/build.sh" releasebin: install-build-deps @grep 'const VersionPrerelease = "dev"' version/version.go > /dev/null ; if [ $$? -eq 0 ]; then \ echo "ERROR: You must remove prerelease tags from version/version.go prior to release."; \ exit 1; \ fi @GO111MODULE=auto sh -c "$(CURDIR)/scripts/build.sh" package: $(if $(VERSION),,@echo 'VERSION= needed to release; Use make package skip compilation'; exit 1) @sh -c "$(CURDIR)/scripts/dist.sh $(VERSION)" install-build-deps: ## Install dependencies for bin build @go get github.com/mitchellh/gox install-gen-deps: ## Install dependencies for code generation # to avoid having to tidy our go deps, we `go get` our binaries from a temp # dir. `go get` will change our deps and the following deps are not part of # out code dependencies; so a go mod tidy will remove them again. `go # install` seems to install the last tagged version and we want to install # master. @(cd $(TEMPDIR) && GO111MODULE=on go get github.com/alvaroloes/enumer@master) @go install ./cmd/struct-markdown @go install ./cmd/mapstructure-to-hcl2 install-lint-deps: ## Install linter dependencies # Pinning golangci-lint at v1.23.8 as --new-from-rev seems to work properly; the latest 1.24.0 has caused issues with memory consumption @echo "==> Updating linter dependencies..." @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.23.8 dev: ## Build and install a development build @grep 'const VersionPrerelease = ""' version/version.go > /dev/null ; if [ $$? -eq 0 ]; then \ echo "ERROR: You must add prerelease tags to version/version.go prior to making a dev build."; \ exit 1; \ fi @mkdir -p pkg/$(GOOS)_$(GOARCH) @mkdir -p bin @go install -ldflags '$(GOLDFLAGS)' @cp $(GOPATH)/bin/packer bin/packer @cp $(GOPATH)/bin/packer pkg/$(GOOS)_$(GOARCH) lint: install-lint-deps ## Lint Go code @if [ ! -z $(PKG_NAME) ]; then \ echo "golangci-lint run ./$(PKG_NAME)/..."; \ golangci-lint run ./$(PKG_NAME)/...; \ else \ echo "golangci-lint run ./..."; \ golangci-lint run ./...; \ fi ci-lint: install-lint-deps ## On ci only lint newly added Go source files @echo "==> Running linter on newly added Go source files..." GO111MODULE=on golangci-lint run --new-from-rev=$(shell git merge-base origin/master HEAD) ./... fmt: ## Format Go code @go fmt ./... fmt-check: fmt ## Check go code formatting @echo "==> Checking that code complies with go fmt requirements..." @git diff --exit-code; if [ $$? -eq 1 ]; then \ echo "Found files that are not fmt'ed."; \ echo "You can use the command: \`make fmt\` to reformat code."; \ exit 1; \ fi mode-check: ## Check that only certain files are executable @echo "==> Checking that only certain files are executable..." @if [ ! -z "$(EXECUTABLE_FILES)" ]; then \ echo "These files should not be executable or they must be white listed in the Makefile:"; \ echo "$(EXECUTABLE_FILES)" | xargs -n1; \ exit 1; \ else \ echo "Check passed."; \ fi fmt-docs: @find ./website/pages/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \; # Install js-beautify with npm install -g js-beautify fmt-examples: find examples -name *.json | xargs js-beautify -r -s 2 -n -eol "\n" # generate runs `go generate` to build the dynamically generated # source files. generate: install-gen-deps ## Generate dynamically generated code @echo "==> removing autogenerated markdown..." # but don't remove partials generated in the SDK and copied over. @find website/pages -path website/pages/partials/packer-plugin-sdk -prune -o -type f | xargs grep -l '^ "file.ext" func RemoveDatastorePrefix(path string) string { res := object.DatastorePath{} if hadPrefix := res.FromString(path); hadPrefix { return res.Path } else { return path } } type DatastoreIsoPath struct { path string } func (d *DatastoreIsoPath) Validate() bool { // Matches: // [datastore] /dir/subdir/file // [datastore] dir/subdir/file // [] /dir/subdir/file // [data-store] /dir/subdir/file // dir/subdir/file or dir/subdir/file matched, _ := regexp.MatchString(`^\s*(\[[^\[\]\/]*\])?\s*[^\[\]]+\s*$`, d.path) return matched } func (d *DatastoreIsoPath) GetFilePath() string { filePath := d.path parts := strings.Split(d.path, "]") if len(parts) > 1 { // removes datastore name from path filePath = parts[1] filePath = strings.TrimSpace(filePath) } return filePath } packer-1.6.6+ds1/builder/vsphere/driver/datastore_acc_test.go000066400000000000000000000042021377171306200242400ustar00rootroot00000000000000package driver import ( "fmt" "io/ioutil" "testing" "time" ) func TestDatastoreAcc(t *testing.T) { t.Skip("Acceptance tests not configured yet.") d := newTestDriver(t) ds, err := d.FindDatastore("datastore1", "") if err != nil { t.Fatalf("Cannot find the default datastore '%v': %v", "datastore1", err) } info, err := ds.Info("name") if err != nil { t.Fatalf("Cannot read datastore properties: %v", err) } if info.Name != "datastore1" { t.Errorf("Wrong datastore. expected: 'datastore1', got: '%v'", info.Name) } } func TestFileUpload(t *testing.T) { t.Skip("Acceptance tests not configured yet.") dsName := "datastore1" hostName := "esxi-1.vsphere65.test" fileName := fmt.Sprintf("test-%v", time.Now().Unix()) tmpFile, err := ioutil.TempFile("", fileName) if err != nil { t.Fatalf("Error creating temp file") } err = tmpFile.Close() if err != nil { t.Fatalf("Error creating temp file") } d := newTestDriver(t) ds, err := d.FindDatastore(dsName, hostName) if err != nil { t.Fatalf("Cannot find datastore '%v': %v", dsName, err) } err = ds.UploadFile(tmpFile.Name(), fileName, hostName, true) if err != nil { t.Fatalf("Cannot upload file: %v", err) } if ds.FileExists(fileName) != true { t.Fatalf("Cannot find file") } err = ds.Delete(fileName) if err != nil { t.Fatalf("Cannot delete file: %v", err) } } func TestFileUploadDRS(t *testing.T) { t.Skip("Acceptance tests not configured yet.") dsName := "datastore3" hostName := "" fileName := fmt.Sprintf("test-%v", time.Now().Unix()) tmpFile, err := ioutil.TempFile("", fileName) if err != nil { t.Fatalf("Error creating temp file") } err = tmpFile.Close() if err != nil { t.Fatalf("Error creating temp file") } d := newTestDriver(t) ds, err := d.FindDatastore(dsName, hostName) if err != nil { t.Fatalf("Cannot find datastore '%v': %v", dsName, err) } err = ds.UploadFile(tmpFile.Name(), fileName, hostName, false) if err != nil { t.Fatalf("Cannot upload file: %v", err) } if ds.FileExists(fileName) != true { t.Fatalf("Cannot find file") } err = ds.Delete(fileName) if err != nil { t.Fatalf("Cannot delete file: %v", err) } } packer-1.6.6+ds1/builder/vsphere/driver/datastore_mock.go000066400000000000000000000032211377171306200234040ustar00rootroot00000000000000package driver import ( "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type DatastoreMock struct { FileExistsCalled bool FileExistsReturn bool DirExistsCalled bool DirExistsReturn bool NameReturn string MakeDirectoryCalled bool ResolvePathCalled bool ResolvePathReturn string DeleteCalled bool DeletePath string DeleteErr error UploadFileCalled bool UploadFileSrc string UploadFileDst string UploadFileHost string UploadFileSetHost bool UploadFileErr error } func (ds *DatastoreMock) Info(params ...string) (*mo.Datastore, error) { return nil, nil } func (ds *DatastoreMock) FileExists(path string) bool { ds.FileExistsCalled = true return ds.FileExistsReturn } func (ds *DatastoreMock) DirExists(path string) bool { ds.DirExistsCalled = true return ds.DirExistsReturn } func (ds *DatastoreMock) Name() string { if ds.NameReturn == "" { return "datastore-mock" } return ds.NameReturn } func (ds *DatastoreMock) Reference() types.ManagedObjectReference { return types.ManagedObjectReference{} } func (ds *DatastoreMock) ResolvePath(path string) string { ds.ResolvePathCalled = true return ds.ResolvePathReturn } func (ds *DatastoreMock) UploadFile(src, dst, host string, setHost bool) error { ds.UploadFileCalled = true ds.UploadFileSrc = src ds.UploadFileDst = dst ds.UploadFileHost = host ds.UploadFileSetHost = setHost return ds.UploadFileErr } func (ds *DatastoreMock) Delete(path string) error { ds.DeleteCalled = true ds.DeletePath = path return ds.DeleteErr } func (ds *DatastoreMock) MakeDirectory(path string) error { ds.MakeDirectoryCalled = true return nil } packer-1.6.6+ds1/builder/vsphere/driver/datastore_test.go000066400000000000000000000073541377171306200234450ustar00rootroot00000000000000package driver import ( "testing" "github.com/vmware/govmomi/simulator" ) func TestDatastoreIsoPath(t *testing.T) { tc := []struct { isoPath string filePath string valid bool }{ { isoPath: "[datastore] dir/subdir/file", filePath: "dir/subdir/file", valid: true, }, { isoPath: "[] dir/subdir/file", filePath: "dir/subdir/file", valid: true, }, { isoPath: "dir/subdir/file", filePath: "dir/subdir/file", valid: true, }, { isoPath: "[datastore] /dir/subdir/file", filePath: "/dir/subdir/file", valid: true, }, { isoPath: "/dir/subdir/file [datastore] ", valid: false, }, { isoPath: "[datastore][] /dir/subdir/file", valid: false, }, { isoPath: "[data/store] /dir/subdir/file", valid: false, }, { isoPath: "[data store] /dir/sub dir/file", filePath: "/dir/sub dir/file", valid: true, }, { isoPath: " [datastore] /dir/subdir/file", filePath: "/dir/subdir/file", valid: true, }, { isoPath: "[datastore] /dir/subdir/file", filePath: "/dir/subdir/file", valid: true, }, { isoPath: "[datastore] /dir/subdir/file ", filePath: "/dir/subdir/file", valid: true, }, { isoPath: "[привѣ́тъ] /привѣ́тъ/привѣ́тъ/привѣ́тъ", filePath: "/привѣ́тъ/привѣ́тъ/привѣ́тъ", valid: true, }, // Test case for #9846 { isoPath: "[ISO-StorageLun9] Linux/rhel-8.0-x86_64-dvd.iso", filePath: "Linux/rhel-8.0-x86_64-dvd.iso", valid: true, }, } for i, c := range tc { dsIsoPath := &DatastoreIsoPath{path: c.isoPath} if dsIsoPath.Validate() != c.valid { t.Fatalf("%d Expecting %s to be %t but was %t", i, c.isoPath, c.valid, !c.valid) } if !c.valid { continue } filePath := dsIsoPath.GetFilePath() if filePath != c.filePath { t.Fatalf("%d Expecting %s but got %s", i, c.filePath, filePath) } } } func TestVCenterDriver_FindDatastore(t *testing.T) { sim, err := NewVCenterSimulator() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() _, datastore := sim.ChooseSimulatorPreCreatedDatastore() _, host := sim.ChooseSimulatorPreCreatedHost() tc := []struct { name string datastore string host string fail bool errMessage string }{ { name: "should find datastore when name is provided", datastore: datastore.Name, fail: false, }, { name: "should find datastore when only host is provided", host: host.Name, fail: false, }, { name: "should not find invalid datastore", datastore: "invalid", fail: true, }, { name: "should not find invalid host", host: "invalid", fail: true, }, } for _, c := range tc { t.Run(c.name, func(t *testing.T) { ds, err := sim.driver.FindDatastore(c.datastore, c.host) if c.fail { if err == nil { t.Fatalf("expected to fail") } if c.errMessage != "" && err.Error() != c.errMessage { t.Fatalf("unexpected error message %s", err.Error()) } } else { if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if ds == nil { t.Fatalf("expected to find datastore") } } }) } } func TestVCenterDriver_MultipleDatastoreError(t *testing.T) { model := simulator.ESX() model.Datastore = 2 sim, err := NewCustomVCenterSimulator(model) if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() _, host := sim.ChooseSimulatorPreCreatedHost() _, err = sim.driver.FindDatastore("", host.Name) if err == nil { t.Fatalf("expected to fail") } if err.Error() != "Host has multiple datastores. Specify it explicitly" { t.Fatalf("unexpected error message %s", err.Error()) } } packer-1.6.6+ds1/builder/vsphere/driver/disk.go000066400000000000000000000044261377171306200213470ustar00rootroot00000000000000package driver import ( "errors" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/types" ) type Disk struct { DiskSize int64 DiskEagerlyScrub bool DiskThinProvisioned bool ControllerIndex int } type StorageConfig struct { DiskControllerType []string // example: "scsi", "pvscsi", "nvme", "lsilogic" Storage []Disk } func (c *StorageConfig) AddStorageDevices(existingDevices object.VirtualDeviceList) ([]types.BaseVirtualDeviceConfigSpec, error) { newDevices := object.VirtualDeviceList{} // Create new controller based on existing devices list and add it to the new devices list // to confirm creation var controllers []types.BaseVirtualController for _, controllerType := range c.DiskControllerType { var device types.BaseVirtualDevice var err error if controllerType == "nvme" { device, err = existingDevices.CreateNVMEController() } else { device, err = existingDevices.CreateSCSIController(controllerType) } if err != nil { return nil, err } existingDevices = append(existingDevices, device) newDevices = append(newDevices, device) controller, err := existingDevices.FindDiskController(existingDevices.Name(device)) if err != nil { return nil, err } controllers = append(controllers, controller) } for _, dc := range c.Storage { disk := &types.VirtualDisk{ VirtualDevice: types.VirtualDevice{ Key: existingDevices.NewKey(), Backing: &types.VirtualDiskFlatVer2BackingInfo{ DiskMode: string(types.VirtualDiskModePersistent), ThinProvisioned: types.NewBool(dc.DiskThinProvisioned), EagerlyScrub: types.NewBool(dc.DiskEagerlyScrub), }, }, CapacityInKB: dc.DiskSize * 1024, } existingDevices.AssignController(disk, controllers[dc.ControllerIndex]) newDevices = append(newDevices, disk) } return newDevices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) } func findDisk(devices object.VirtualDeviceList) (*types.VirtualDisk, error) { var disks []*types.VirtualDisk for _, device := range devices { switch d := device.(type) { case *types.VirtualDisk: disks = append(disks, d) } } switch len(disks) { case 0: return nil, errors.New("VM has no disks") case 1: return disks[0], nil } return nil, errors.New("VM has multiple disks") } packer-1.6.6+ds1/builder/vsphere/driver/driver.go000066400000000000000000000074701377171306200217120ustar00rootroot00000000000000package driver import ( "context" "fmt" "net/url" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/session" "github.com/vmware/govmomi/vapi/library" "github.com/vmware/govmomi/vapi/rest" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) type Driver interface { NewVM(ref *types.ManagedObjectReference) VirtualMachine FindVM(name string) (VirtualMachine, error) FindCluster(name string) (*Cluster, error) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error CreateVM(config *CreateConfig) (VirtualMachine, error) NewDatastore(ref *types.ManagedObjectReference) Datastore FindDatastore(name string, host string) (Datastore, error) GetDatastoreName(id string) (string, error) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) NewFolder(ref *types.ManagedObjectReference) *Folder FindFolder(name string) (*Folder, error) NewHost(ref *types.ManagedObjectReference) *Host FindHost(name string) (*Host, error) NewNetwork(ref *types.ManagedObjectReference) *Network FindNetwork(name string) (*Network, error) FindNetworks(name string) ([]*Network, error) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) FindContentLibraryByName(name string) (*Library, error) FindContentLibraryItem(libraryId string, name string) (*library.Item, error) FindContentLibraryFileDatastorePath(isoPath string) (string, error) } type VCenterDriver struct { // context that controls the authenticated sessions used to run the VM commands ctx context.Context client *govmomi.Client vimClient *vim25.Client restClient *RestClient finder *find.Finder datacenter *object.Datacenter } type ConnectConfig struct { VCenterServer string Username string Password string InsecureConnection bool Datacenter string } func NewDriver(config *ConnectConfig) (Driver, error) { ctx := context.TODO() vcenterUrl, err := url.Parse(fmt.Sprintf("https://%v/sdk", config.VCenterServer)) if err != nil { return nil, err } credentials := url.UserPassword(config.Username, config.Password) vcenterUrl.User = credentials soapClient := soap.NewClient(vcenterUrl, config.InsecureConnection) vimClient, err := vim25.NewClient(ctx, soapClient) if err != nil { return nil, err } vimClient.RoundTripper = session.KeepAlive(vimClient.RoundTripper, 10*time.Minute) client := &govmomi.Client{ Client: vimClient, SessionManager: session.NewManager(vimClient), } err = client.SessionManager.Login(ctx, credentials) if err != nil { return nil, err } finder := find.NewFinder(client.Client, false) datacenter, err := finder.DatacenterOrDefault(ctx, config.Datacenter) if err != nil { return nil, err } finder.SetDatacenter(datacenter) d := &VCenterDriver{ ctx: ctx, client: client, vimClient: vimClient, restClient: &RestClient{ client: rest.NewClient(vimClient), credentials: credentials, }, datacenter: datacenter, finder: finder, } return d, nil } // The rest.Client requires vCenter. // RestClient is to modularize the rest.Client session and use it only when is necessary. // This will allow users without vCenter to use the other features that doesn't use the rest.Client. // To use the client login/logout must be done to create an authenticated session. type RestClient struct { client *rest.Client credentials *url.Userinfo } func (r *RestClient) Login(ctx context.Context) error { return r.client.Login(ctx, r.credentials) } func (r *RestClient) Logout(ctx context.Context) error { return r.client.Logout(ctx) } packer-1.6.6+ds1/builder/vsphere/driver/driver_mock.go000066400000000000000000000061201377171306200227120ustar00rootroot00000000000000package driver import ( "fmt" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi/vapi/library" "github.com/vmware/govmomi/vim25/types" ) type DriverMock struct { FindDatastoreCalled bool DatastoreMock *DatastoreMock FindDatastoreName string FindDatastoreHost string FindDatastoreErr error PreCleanShouldFail bool PreCleanVMCalled bool PreCleanForce bool PreCleanVMPath string CreateVMShouldFail bool CreateVMCalled bool CreateConfig *CreateConfig VM VirtualMachine } func NewDriverMock() *DriverMock { return new(DriverMock) } func (d *DriverMock) FindDatastore(name string, host string) (Datastore, error) { d.FindDatastoreCalled = true if d.DatastoreMock == nil { d.DatastoreMock = new(DatastoreMock) } d.FindDatastoreName = name d.FindDatastoreHost = host return d.DatastoreMock, d.FindDatastoreErr } func (d *DriverMock) NewVM(ref *types.ManagedObjectReference) VirtualMachine { return nil } func (d *DriverMock) FindVM(name string) (VirtualMachine, error) { return nil, nil } func (d *DriverMock) FindCluster(name string) (*Cluster, error) { return nil, nil } func (d *DriverMock) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error { d.PreCleanVMCalled = true if d.PreCleanShouldFail { return fmt.Errorf("pre clean failed") } d.PreCleanForce = true d.PreCleanVMPath = vmPath return nil } func (d *DriverMock) CreateVM(config *CreateConfig) (VirtualMachine, error) { d.CreateVMCalled = true if d.CreateVMShouldFail { return nil, fmt.Errorf("create vm failed") } d.CreateConfig = config d.VM = new(VirtualMachineDriver) return d.VM, nil } func (d *DriverMock) NewDatastore(ref *types.ManagedObjectReference) Datastore { return nil } func (d *DriverMock) GetDatastoreName(id string) (string, error) { return "", nil } func (d *DriverMock) GetDatastoreFilePath(datastoreID, dir, filename string) (string, error) { return "", nil } func (d *DriverMock) NewFolder(ref *types.ManagedObjectReference) *Folder { return nil } func (d *DriverMock) FindFolder(name string) (*Folder, error) { return nil, nil } func (d *DriverMock) NewHost(ref *types.ManagedObjectReference) *Host { return nil } func (d *DriverMock) FindHost(name string) (*Host, error) { return nil, nil } func (d *DriverMock) NewNetwork(ref *types.ManagedObjectReference) *Network { return nil } func (d *DriverMock) FindNetwork(name string) (*Network, error) { return nil, nil } func (d *DriverMock) FindNetworks(name string) ([]*Network, error) { return nil, nil } func (d *DriverMock) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool { return nil } func (d *DriverMock) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) { return nil, nil } func (d *DriverMock) FindContentLibraryByName(name string) (*Library, error) { return nil, nil } func (d *DriverMock) FindContentLibraryItem(libraryId string, name string) (*library.Item, error) { return nil, nil } func (d *DriverMock) FindContentLibraryFileDatastorePath(isoPath string) (string, error) { return "", nil } packer-1.6.6+ds1/builder/vsphere/driver/driver_test.go000066400000000000000000000077001377171306200227450ustar00rootroot00000000000000package driver import ( "context" "crypto/tls" "fmt" "math/rand" "net/http" "net/url" "os" "testing" "time" "github.com/vmware/govmomi" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/session" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vapi/rest" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/soap" ) // Defines whether acceptance tests should be run const TestHostName = "esxi-1.vsphere65.test" func newTestDriver(t *testing.T) Driver { username := os.Getenv("VSPHERE_USERNAME") if username == "" { username = "root" } password := os.Getenv("VSPHERE_PASSWORD") if password == "" { password = "jetbrains" } d, err := NewDriver(&ConnectConfig{ VCenterServer: "vcenter.vsphere65.test", Username: username, Password: password, InsecureConnection: true, }) if err != nil { t.Fatalf("Cannot connect: %v", err) } return d } func newVMName() string { rand.Seed(time.Now().UTC().UnixNano()) return fmt.Sprintf("test-%v", rand.Intn(1000)) } type VCenterSimulator struct { model *simulator.Model server *simulator.Server driver *VCenterDriver } func NewCustomVCenterSimulator(model *simulator.Model) (*VCenterSimulator, error) { sim := new(VCenterSimulator) sim.model = model server, err := sim.NewSimulatorServer() if err != nil { sim.Close() return nil, err } sim.server = server driver, err := sim.NewSimulatorDriver() if err != nil { sim.Close() return nil, err } sim.driver = driver return sim, nil } func NewVCenterSimulator() (*VCenterSimulator, error) { model := simulator.VPX() model.Machine = 1 return NewCustomVCenterSimulator(model) } func (s *VCenterSimulator) Close() { if s.model != nil { s.model.Remove() } if s.server != nil { s.server.Close() } } //Simulator shortcut to choose any pre created VM. func (s *VCenterSimulator) ChooseSimulatorPreCreatedVM() (VirtualMachine, *simulator.VirtualMachine) { machine := simulator.Map.Any("VirtualMachine").(*simulator.VirtualMachine) ref := machine.Reference() vm := s.driver.NewVM(&ref) return vm, machine } //Simulator shortcut to choose any pre created Datastore. func (s *VCenterSimulator) ChooseSimulatorPreCreatedDatastore() (Datastore, *simulator.Datastore) { ds := simulator.Map.Any("Datastore").(*simulator.Datastore) ref := ds.Reference() datastore := s.driver.NewDatastore(&ref) return datastore, ds } //Simulator shortcut to choose any pre created Host. func (s *VCenterSimulator) ChooseSimulatorPreCreatedHost() (*Host, *simulator.HostSystem) { h := simulator.Map.Any("HostSystem").(*simulator.HostSystem) ref := h.Reference() host := s.driver.NewHost(&ref) return host, h } func (s *VCenterSimulator) NewSimulatorServer() (*simulator.Server, error) { err := s.model.Create() if err != nil { return nil, err } s.model.Service.RegisterEndpoints = true s.model.Service.TLS = new(tls.Config) s.model.Service.ServeMux = http.NewServeMux() return s.model.Service.NewServer(), nil } func (s *VCenterSimulator) NewSimulatorDriver() (*VCenterDriver, error) { ctx := context.TODO() user := &url.Userinfo{} s.server.URL.User = user soapClient := soap.NewClient(s.server.URL, true) vimClient, err := vim25.NewClient(ctx, soapClient) if err != nil { return nil, err } vimClient.RoundTripper = session.KeepAlive(vimClient.RoundTripper, 10*time.Minute) client := &govmomi.Client{ Client: vimClient, SessionManager: session.NewManager(vimClient), } err = client.SessionManager.Login(ctx, user) if err != nil { return nil, err } finder := find.NewFinder(client.Client, false) datacenter, err := finder.DatacenterOrDefault(ctx, "") if err != nil { return nil, err } finder.SetDatacenter(datacenter) d := &VCenterDriver{ ctx: ctx, client: client, vimClient: vimClient, restClient: &RestClient{ client: rest.NewClient(vimClient), credentials: user, }, datacenter: datacenter, finder: finder, } return d, nil } packer-1.6.6+ds1/builder/vsphere/driver/folder.go000066400000000000000000000036751377171306200216750ustar00rootroot00000000000000package driver import ( "fmt" "path" "strings" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type Folder struct { driver *VCenterDriver folder *object.Folder } func (d *VCenterDriver) NewFolder(ref *types.ManagedObjectReference) *Folder { return &Folder{ folder: object.NewFolder(d.client.Client, *ref), driver: d, } } func (d *VCenterDriver) FindFolder(name string) (*Folder, error) { if name != "" { // create folders if they don't exist parent := "" parentFolder, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm")) if err != nil { return nil, err } folders := strings.Split(name, "/") for _, folder := range folders { parent = path.Join(parent, folder) f, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm", parent)) if _, ok := err.(*find.NotFoundError); ok { f, err = parentFolder.CreateFolder(d.ctx, folder) } if err != nil { return nil, err } parentFolder = f } } f, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm", name)) if err != nil { return nil, err } return &Folder{ folder: f, driver: d, }, nil } func (f *Folder) Info(params ...string) (*mo.Folder, error) { var p []string if len(params) == 0 { p = []string{"*"} } else { p = params } var info mo.Folder err := f.folder.Properties(f.driver.ctx, f.folder.Reference(), p, &info) if err != nil { return nil, err } return &info, nil } func (f *Folder) Path() (string, error) { info, err := f.Info("name", "parent") if err != nil { return "", err } if info.Parent.Type == "Datacenter" { return "", nil } else { parent := f.driver.NewFolder(info.Parent) path, err := parent.Path() if err != nil { return "", err } if path == "" { return info.Name, nil } else { return fmt.Sprintf("%v/%v", path, info.Name), nil } } } packer-1.6.6+ds1/builder/vsphere/driver/folder_acc_test.go000066400000000000000000000007411377171306200235310ustar00rootroot00000000000000package driver import "testing" func TestFolderAcc(t *testing.T) { t.Skip("Acceptance tests not configured yet.") d := newTestDriver(t) f, err := d.FindFolder("folder1/folder2") if err != nil { t.Fatalf("Cannot find the default folder '%v': %v", "folder1/folder2", err) } path, err := f.Path() if err != nil { t.Fatalf("Cannot read folder name: %v", err) } if path != "folder1/folder2" { t.Errorf("Wrong folder. expected: 'folder1/folder2', got: '%v'", path) } } packer-1.6.6+ds1/builder/vsphere/driver/host.go000066400000000000000000000015561377171306200213730ustar00rootroot00000000000000package driver import ( "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type Host struct { driver *VCenterDriver host *object.HostSystem } func (d *VCenterDriver) NewHost(ref *types.ManagedObjectReference) *Host { return &Host{ host: object.NewHostSystem(d.client.Client, *ref), driver: d, } } func (d *VCenterDriver) FindHost(name string) (*Host, error) { h, err := d.finder.HostSystem(d.ctx, name) if err != nil { return nil, err } return &Host{ host: h, driver: d, }, nil } func (h *Host) Info(params ...string) (*mo.HostSystem, error) { var p []string if len(params) == 0 { p = []string{"*"} } else { p = params } var info mo.HostSystem err := h.host.Properties(h.driver.ctx, h.host.Reference(), p, &info) if err != nil { return nil, err } return &info, nil } packer-1.6.6+ds1/builder/vsphere/driver/host_acc_test.go000066400000000000000000000007571377171306200232420ustar00rootroot00000000000000package driver import ( "testing" ) func TestHostAcc(t *testing.T) { t.Skip("Acceptance tests not configured yet.") d := newTestDriver(t) host, err := d.FindHost(TestHostName) if err != nil { t.Fatalf("Cannot find the default host '%v': %v", "datastore1", err) } info, err := host.Info("name") if err != nil { t.Fatalf("Cannot read host properties: %v", err) } if info.Name != TestHostName { t.Errorf("Wrong host name: expected '%v', got: '%v'", TestHostName, info.Name) } } packer-1.6.6+ds1/builder/vsphere/driver/library.go000066400000000000000000000061651377171306200220630ustar00rootroot00000000000000package driver import ( "fmt" "log" "path" "strings" "github.com/vmware/govmomi/vapi/library" ) type Library struct { driver *VCenterDriver library *library.Library } func (d *VCenterDriver) FindContentLibraryByName(name string) (*Library, error) { lm := library.NewManager(d.restClient.client) l, err := lm.GetLibraryByName(d.ctx, name) if err != nil { return nil, err } return &Library{ library: l, driver: d, }, nil } func (d *VCenterDriver) FindContentLibraryItem(libraryId string, name string) (*library.Item, error) { lm := library.NewManager(d.restClient.client) items, err := lm.GetLibraryItems(d.ctx, libraryId) if err != nil { return nil, err } for _, item := range items { if item.Name == name { return &item, nil } } return nil, fmt.Errorf("Item %s not found", name) } func (d *VCenterDriver) FindContentLibraryFileDatastorePath(isoPath string) (string, error) { log.Printf("Check if ISO path is a Content Library path") err := d.restClient.Login(d.ctx) if err != nil { log.Printf("vCenter client not available. ISO path not identified as a Content Library path") return isoPath, err } libraryFilePath := &LibraryFilePath{path: isoPath} err = libraryFilePath.Validate() if err != nil { log.Printf("ISO path not identified as a Content Library path") return isoPath, err } libraryName := libraryFilePath.GetLibraryName() itemName := libraryFilePath.GetLibraryItemName() isoFile := libraryFilePath.GetFileName() lib, err := d.FindContentLibraryByName(libraryName) if err != nil { log.Printf("ISO path not identified as a Content Library path") return isoPath, err } log.Printf("ISO path identified as a Content Library path") log.Printf("Finding the equivalent datastore path for the Content Library ISO file path") libItem, err := d.FindContentLibraryItem(lib.library.ID, itemName) if err != nil { log.Printf("[WARN] Couldn't find item %s: %s", itemName, err.Error()) return isoPath, err } datastoreName, err := d.GetDatastoreName(lib.library.Storage[0].DatastoreID) if err != nil { log.Printf("[WARN] Couldn't find datastore name for library %s", libraryName) return isoPath, err } libItemDir := fmt.Sprintf("[%s] contentlib-%s/%s", datastoreName, lib.library.ID, libItem.ID) isoFilePath, err := d.GetDatastoreFilePath(lib.library.Storage[0].DatastoreID, libItemDir, isoFile) if err != nil { log.Printf("[WARN] Couldn't find datastore ID path for %s", isoFile) return isoPath, err } _ = d.restClient.Logout(d.ctx) return path.Join(libItemDir, isoFilePath), nil } type LibraryFilePath struct { path string } func (l *LibraryFilePath) Validate() error { l.path = strings.TrimLeft(l.path, "/") parts := strings.Split(l.path, "/") if len(parts) != 3 { return fmt.Errorf("Not a valid Content Library File path. The path must contain the nanmes for the library, item and file.") } return nil } func (l *LibraryFilePath) GetLibraryName() string { return strings.Split(l.path, "/")[0] } func (l *LibraryFilePath) GetLibraryItemName() string { return strings.Split(l.path, "/")[1] } func (l *LibraryFilePath) GetFileName() string { return strings.Split(l.path, "/")[2] } packer-1.6.6+ds1/builder/vsphere/driver/library_test.go000066400000000000000000000026051377171306200231150ustar00rootroot00000000000000package driver import "testing" func TestLibraryFilePath(t *testing.T) { tc := []struct { filePath string libraryName string libraryItemName string fileName string valid bool }{ { filePath: "lib/item/file", libraryName: "lib", libraryItemName: "item", fileName: "file", valid: true, }, { filePath: "/lib/item/file", libraryName: "lib", libraryItemName: "item", fileName: "file", valid: true, }, { filePath: "/lib/item/filedir/file", valid: false, }, { filePath: "/lib/item", valid: false, }, { filePath: "/lib", valid: false, }, } for _, c := range tc { libraryFilePath := &LibraryFilePath{path: c.filePath} if err := libraryFilePath.Validate(); err != nil { if c.valid { t.Fatalf("Expecting %s to be valid", c.filePath) } continue } libraryName := libraryFilePath.GetLibraryName() if libraryName != c.libraryName { t.Fatalf("Expecting %s but got %s", c.libraryName, libraryName) } libraryItemName := libraryFilePath.GetLibraryItemName() if libraryItemName != c.libraryItemName { t.Fatalf("Expecting %s but got %s", c.libraryItemName, libraryItemName) } fileName := libraryFilePath.GetFileName() if fileName != c.fileName { t.Fatalf("Expecting %s but got %s", c.fileName, fileName) } } } packer-1.6.6+ds1/builder/vsphere/driver/network.go000066400000000000000000000030351377171306200221010ustar00rootroot00000000000000package driver import ( "fmt" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type Network struct { driver *VCenterDriver network object.NetworkReference } func (d *VCenterDriver) NewNetwork(ref *types.ManagedObjectReference) *Network { return &Network{ network: object.NewNetwork(d.client.Client, *ref), driver: d, } } func (d *VCenterDriver) FindNetwork(name string) (*Network, error) { n, err := d.finder.Network(d.ctx, name) if err != nil { return nil, err } return &Network{ network: n, driver: d, }, nil } func (d *VCenterDriver) FindNetworks(name string) ([]*Network, error) { ns, err := d.finder.NetworkList(d.ctx, name) if err != nil { return nil, err } var networks []*Network for _, n := range ns { networks = append(networks, &Network{ network: n, driver: d, }) } return networks, nil } func (n *Network) Info(params ...string) (*mo.Network, error) { var p []string if len(params) == 0 { p = []string{"*"} } else { p = params } var info mo.Network network, ok := n.network.(*object.Network) if !ok { return nil, fmt.Errorf("unexpected %t network object type", n.network) } err := network.Properties(n.driver.ctx, network.Reference(), p, &info) if err != nil { return nil, err } return &info, nil } type MultipleNetworkFoundError struct { path string append string } func (e *MultipleNetworkFoundError) Error() string { return fmt.Sprintf("path '%s' resolves to multiple networks. %s", e.path, e.append) } packer-1.6.6+ds1/builder/vsphere/driver/resource_pool.go000066400000000000000000000040571377171306200232750ustar00rootroot00000000000000package driver import ( "fmt" "log" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type ResourcePool struct { pool *object.ResourcePool driver *VCenterDriver } func (d *VCenterDriver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool { return &ResourcePool{ pool: object.NewResourcePool(d.client.Client, *ref), driver: d, } } func (d *VCenterDriver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error) { var res string if cluster != "" { res = cluster } else { res = host } resourcePath := fmt.Sprintf("%v/Resources/%v", res, name) p, err := d.finder.ResourcePool(d.ctx, resourcePath) if err != nil { log.Printf("[WARN] %s not found. Looking for default resource pool.", resourcePath) dp, dperr := d.finder.DefaultResourcePool(d.ctx) if _, ok := dperr.(*find.NotFoundError); ok { // VirtualApp extends ResourcePool, so it should support VirtualApp types. vapp, verr := d.finder.VirtualApp(d.ctx, name) if verr != nil { return nil, err } dp = vapp.ResourcePool } else if dperr != nil { return nil, err } p = dp } return &ResourcePool{ pool: p, driver: d, }, nil } func (p *ResourcePool) Info(params ...string) (*mo.ResourcePool, error) { var params2 []string if len(params) == 0 { params2 = []string{"*"} } else { params2 = params } var info mo.ResourcePool err := p.pool.Properties(p.driver.ctx, p.pool.Reference(), params2, &info) if err != nil { return nil, err } return &info, nil } func (p *ResourcePool) Path() (string, error) { poolInfo, err := p.Info("name", "parent") if err != nil { return "", err } if poolInfo.Parent.Type == "ComputeResource" { return "", nil } else { parent := p.driver.NewResourcePool(poolInfo.Parent) parentPath, err := parent.Path() if err != nil { return "", err } if parentPath == "" { return poolInfo.Name, nil } else { return fmt.Sprintf("%v/%v", parentPath, poolInfo.Name), nil } } } packer-1.6.6+ds1/builder/vsphere/driver/resource_pool_acc_test.go000066400000000000000000000010111377171306200251250ustar00rootroot00000000000000package driver import "testing" func TestResourcePoolAcc(t *testing.T) { t.Skip("Acceptance tests not configured yet.") d := newTestDriver(t) p, err := d.FindResourcePool("", "esxi-1.vsphere65.test", "pool1/pool2") if err != nil { t.Fatalf("Cannot find the default resource pool '%v': %v", "pool1/pool2", err) } path, err := p.Path() if err != nil { t.Fatalf("Cannot read resource pool name: %v", err) } if path != "pool1/pool2" { t.Errorf("Wrong folder. expected: 'pool1/pool2', got: '%v'", path) } } packer-1.6.6+ds1/builder/vsphere/driver/resource_pool_test.go000066400000000000000000000037471377171306200243410ustar00rootroot00000000000000package driver import ( "testing" "github.com/vmware/govmomi/simulator" ) func TestVCenterDriver_FindResourcePool(t *testing.T) { sim, err := NewVCenterSimulator() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() res, err := sim.driver.FindResourcePool("", "DC0_H0", "") if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if res == nil { t.Fatalf("resource pool should not be nil") } expectedResourcePool := "Resources" if res.pool.Name() != expectedResourcePool { t.Fatalf("resource name expected %s but was %s", expectedResourcePool, res.pool.Name()) } } func TestVCenterDriver_FindResourcePoolStandaloneESX(t *testing.T) { // standalone ESX host without any vCenter model := simulator.ESX() defer model.Remove() opts := simulator.VPX() model.Datastore = opts.Datastore model.Machine = opts.Machine model.Autostart = opts.Autostart model.DelayConfig.Delay = opts.DelayConfig.Delay model.DelayConfig.MethodDelay = opts.DelayConfig.MethodDelay model.DelayConfig.DelayJitter = opts.DelayConfig.DelayJitter sim, err := NewCustomVCenterSimulator(model) if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() res, err := sim.driver.FindResourcePool("", "localhost.localdomain", "") if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if res == nil { t.Fatalf("resource pool should not be nil") } expectedResourcePool := "Resources" if res.pool.Name() != expectedResourcePool { t.Fatalf("resource name expected %s but was %s", expectedResourcePool, res.pool.Name()) } // Invalid resource name should look for default resource pool res, err = sim.driver.FindResourcePool("", "localhost.localdomain", "invalid") if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if res == nil { t.Fatalf("resource pool should not be nil") } if res.pool.Name() != expectedResourcePool { t.Fatalf("resource name expected %s but was %s", expectedResourcePool, res.pool.Name()) } } packer-1.6.6+ds1/builder/vsphere/driver/vm.go000066400000000000000000000715711377171306200210440ustar00rootroot00000000000000package driver import ( "context" "errors" "fmt" "log" "net" "reflect" "strings" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/nfc" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/ovf" "github.com/vmware/govmomi/property" "github.com/vmware/govmomi/vapi/vcenter" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type VirtualMachine interface { Info(params ...string) (*mo.VirtualMachine, error) Devices() (object.VirtualDeviceList, error) FloppyDevices() (object.VirtualDeviceList, error) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) AddPublicKeys(ctx context.Context, publicKeys string) error Properties(ctx context.Context) (*mo.VirtualMachine, error) Destroy() error Configure(config *HardwareConfig) error Customize(spec types.CustomizationSpec) error ResizeDisk(diskSize int64) error WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) PowerOn() error PowerOff() error IsPoweredOff() (bool, error) StartShutdown() error WaitForShutdown(ctx context.Context, timeout time.Duration) error CreateSnapshot(name string) error ConvertToTemplate() error ImportOvfToContentLibrary(ovf vcenter.OVF) error ImportToContentLibrary(template vcenter.Template) error GetDir() (string, error) AddFloppy(imgPath string) error SetBootOrder(order []string) error RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error addDevice(device types.BaseVirtualDevice) error AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error Export() (*nfc.Lease, error) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) NewOvfManager() *ovf.Manager GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) AddCdrom(controllerType string, datastoreIsoPath string) error CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) RemoveCdroms() error EjectCdroms() error AddSATAController() error FindSATAController() (*types.VirtualAHCIController, error) } type VirtualMachineDriver struct { vm *object.VirtualMachine driver *VCenterDriver } type CloneConfig struct { Name string Folder string Cluster string Host string ResourcePool string Datastore string LinkedClone bool Network string MacAddress string Annotation string VAppProperties map[string]string StorageConfig StorageConfig } type HardwareConfig struct { CPUs int32 CpuCores int32 CPUReservation int64 CPULimit int64 RAM int64 RAMReservation int64 RAMReserveAll bool NestedHV bool CpuHotAddEnabled bool MemoryHotAddEnabled bool VideoRAM int64 VGPUProfile string Firmware string ForceBIOSSetup bool } type NIC struct { Network string // "" for default network NetworkCard string // example: vmxnet3 MacAddress string // set mac if want specific address Passthrough *bool // direct path i/o } type CreateConfig struct { Annotation string Name string Folder string Cluster string Host string ResourcePool string Datastore string GuestOS string // example: otherGuest NICs []NIC USBController []string Version uint // example: 10 StorageConfig StorageConfig } func (d *VCenterDriver) NewVM(ref *types.ManagedObjectReference) VirtualMachine { return &VirtualMachineDriver{ vm: object.NewVirtualMachine(d.client.Client, *ref), driver: d, } } func (d *VCenterDriver) FindVM(name string) (VirtualMachine, error) { vm, err := d.finder.VirtualMachine(d.ctx, name) if err != nil { return nil, err } return &VirtualMachineDriver{ vm: vm, driver: d, }, nil } func (d *VCenterDriver) PreCleanVM(ui packersdk.Ui, vmPath string, force bool) error { vm, err := d.FindVM(vmPath) if err != nil { if _, ok := err.(*find.NotFoundError); !ok { return fmt.Errorf("error looking up old vm: %v", err) } } if force && vm != nil { ui.Say(fmt.Sprintf("the vm/template %s already exists, but deleting it due to -force flag", vmPath)) // power off just in case it is still on vm.PowerOff() err := vm.Destroy() if err != nil { return fmt.Errorf("error destroying %s: %v", vmPath, err) } } if !force && vm != nil { return fmt.Errorf("%s already exists, you can use -force flag to destroy it: %v", vmPath, err) } return nil } func (d *VCenterDriver) CreateVM(config *CreateConfig) (VirtualMachine, error) { createSpec := types.VirtualMachineConfigSpec{ Name: config.Name, Annotation: config.Annotation, GuestId: config.GuestOS, } if config.Version != 0 { createSpec.Version = fmt.Sprintf("%s%d", "vmx-", config.Version) } folder, err := d.FindFolder(config.Folder) if err != nil { return nil, err } resourcePool, err := d.FindResourcePool(config.Cluster, config.Host, config.ResourcePool) if err != nil { return nil, err } var host *object.HostSystem if config.Cluster != "" && config.Host != "" { h, err := d.FindHost(config.Host) if err != nil { return nil, err } host = h.host } datastore, err := d.FindDatastore(config.Datastore, config.Host) if err != nil { return nil, err } devices := object.VirtualDeviceList{} storageConfigSpec, err := config.StorageConfig.AddStorageDevices(devices) if err != nil { return nil, err } createSpec.DeviceChange = append(createSpec.DeviceChange, storageConfigSpec...) devices, err = addNetwork(d, devices, config) if err != nil { return nil, err } t := true for _, usbType := range config.USBController { var usb types.BaseVirtualDevice switch usbType { // handle "true" and "1" for backwards compatibility case "usb", "true", "1": usb = &types.VirtualUSBController{ EhciEnabled: &t, } case "xhci": usb = new(types.VirtualUSBXHCIController) default: continue } devices = append(devices, usb) } devicesConfigSpec, err := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) if err != nil { return nil, err } createSpec.DeviceChange = append(createSpec.DeviceChange, devicesConfigSpec...) createSpec.Files = &types.VirtualMachineFileInfo{ VmPathName: fmt.Sprintf("[%s]", datastore.Name()), } task, err := folder.folder.CreateVM(d.ctx, createSpec, resourcePool.pool, host) if err != nil { return nil, err } taskInfo, err := task.WaitForResult(d.ctx, nil) if err != nil { return nil, err } vmRef, ok := taskInfo.Result.(types.ManagedObjectReference) if !ok { return nil, fmt.Errorf("something went wrong when creating the VM") } return d.NewVM(&vmRef), nil } func (vm *VirtualMachineDriver) Info(params ...string) (*mo.VirtualMachine, error) { var p []string if len(params) == 0 { p = []string{"*"} } else { p = params } var info mo.VirtualMachine err := vm.vm.Properties(vm.driver.ctx, vm.vm.Reference(), p, &info) if err != nil { return nil, err } return &info, nil } func (vm *VirtualMachineDriver) Devices() (object.VirtualDeviceList, error) { vmInfo, err := vm.Info("config.hardware.device") if err != nil { return nil, err } return vmInfo.Config.Hardware.Device, nil } func (vm *VirtualMachineDriver) FloppyDevices() (object.VirtualDeviceList, error) { device, err := vm.Devices() if err != nil { return device, err } floppies := device.SelectByType((*types.VirtualFloppy)(nil)) return floppies, nil } func (vm *VirtualMachineDriver) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) { folder, err := vm.driver.FindFolder(config.Folder) if err != nil { return nil, fmt.Errorf("Error finding filder: %s", err) } var relocateSpec types.VirtualMachineRelocateSpec pool, err := vm.driver.FindResourcePool(config.Cluster, config.Host, config.ResourcePool) if err != nil { return nil, fmt.Errorf("Error finding resource pool: %s", err) } poolRef := pool.pool.Reference() relocateSpec.Pool = &poolRef datastore, err := vm.driver.FindDatastore(config.Datastore, config.Host) if err != nil { return nil, fmt.Errorf("Error finding datastore: %s", err) } datastoreRef := datastore.Reference() relocateSpec.Datastore = &datastoreRef var cloneSpec types.VirtualMachineCloneSpec cloneSpec.Location = relocateSpec cloneSpec.PowerOn = false if config.LinkedClone == true { cloneSpec.Location.DiskMoveType = "createNewChildDiskBacking" tpl, err := vm.Info("snapshot") if err != nil { return nil, fmt.Errorf("Error getting snapshot info for vm: %s", err) } if tpl.Snapshot == nil { err = errors.New("`linked_clone=true`, but template has no snapshots") return nil, err } cloneSpec.Snapshot = tpl.Snapshot.CurrentSnapshot } var configSpec types.VirtualMachineConfigSpec cloneSpec.Config = &configSpec if config.Annotation != "" { configSpec.Annotation = config.Annotation } devices, err := vm.vm.Device(vm.driver.ctx) if err != nil { return nil, err } virtualDisks := devices.SelectByType((*types.VirtualDisk)(nil)) virtualControllers := devices.SelectByType((*types.VirtualController)(nil)) // Use existing devices to avoid overlapping configuration existingDevices := object.VirtualDeviceList{} existingDevices = append(existingDevices, virtualDisks...) existingDevices = append(existingDevices, virtualControllers...) storageConfigSpec, err := config.StorageConfig.AddStorageDevices(existingDevices) if err != nil { return nil, err } configSpec.DeviceChange = append(configSpec.DeviceChange, storageConfigSpec...) if config.Network != "" { net, err := vm.driver.FindNetwork(config.Network) if err != nil { return nil, fmt.Errorf("Error finding network: %s", err) } backing, err := net.network.EthernetCardBackingInfo(ctx) if err != nil { return nil, fmt.Errorf("Error finding ethernet card backing info: %s", err) } devices, err := vm.vm.Device(ctx) if err != nil { return nil, fmt.Errorf("Error finding vm devices: %s", err) } adapter, err := findNetworkAdapter(devices) if err != nil { return nil, fmt.Errorf("Error finding network adapter: %s", err) } current := adapter.GetVirtualEthernetCard() current.Backing = backing current.MacAddress = config.MacAddress config := &types.VirtualDeviceConfigSpec{ Device: adapter.(types.BaseVirtualDevice), Operation: types.VirtualDeviceConfigSpecOperationEdit, } configSpec.DeviceChange = append(configSpec.DeviceChange, config) } vAppConfig, err := vm.updateVAppConfig(ctx, config.VAppProperties) if err != nil { return nil, fmt.Errorf("Error updating VAppConfig: %s", err) } configSpec.VAppConfig = vAppConfig task, err := vm.vm.Clone(vm.driver.ctx, folder.folder, config.Name, cloneSpec) if err != nil { return nil, fmt.Errorf("Error calling vm.vm.Clone task: %s", err) } info, err := task.WaitForResult(ctx, nil) if err != nil { if ctx.Err() == context.Canceled { err = task.Cancel(context.TODO()) return nil, err } return nil, fmt.Errorf("Error waiting for vm Clone to complete: %s", err) } vmRef, ok := info.Result.(types.ManagedObjectReference) if !ok { return nil, fmt.Errorf("something went wrong when cloning the VM") } created := vm.driver.NewVM(&vmRef) return created, nil } func (vm *VirtualMachineDriver) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) { if len(newProps) == 0 { return nil, nil } vProps, _ := vm.Properties(ctx) if vProps.Config.VAppConfig == nil { return nil, fmt.Errorf("this VM lacks a vApp configuration and cannot have vApp properties set on it") } allProperties := vProps.Config.VAppConfig.GetVmConfigInfo().Property var props []types.VAppPropertySpec for _, p := range allProperties { userValue, setByUser := newProps[p.Id] if !setByUser { continue } if *p.UserConfigurable == false { return nil, fmt.Errorf("vApp property with userConfigurable=false specified in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) } prop := types.VAppPropertySpec{ ArrayUpdateSpec: types.ArrayUpdateSpec{ Operation: types.ArrayUpdateOperationEdit, }, Info: &types.VAppPropertyInfo{ Key: p.Key, Id: p.Id, Value: userValue, UserConfigurable: p.UserConfigurable, }, } props = append(props, prop) delete(newProps, p.Id) } if len(newProps) > 0 { return nil, fmt.Errorf("unsupported vApp properties in vapp.properties: %+v", reflect.ValueOf(newProps).MapKeys()) } return &types.VmConfigSpec{ Property: props, }, nil } func (vm *VirtualMachineDriver) AddPublicKeys(ctx context.Context, publicKeys string) error { newProps := map[string]string{"public-keys": publicKeys} config, err := vm.updateVAppConfig(ctx, newProps) if err != nil { return fmt.Errorf("not possible to save temporary public key: %s", err.Error()) } confSpec := types.VirtualMachineConfigSpec{VAppConfig: config} task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) Properties(ctx context.Context) (*mo.VirtualMachine, error) { log.Printf("fetching properties for VM %q", vm.vm.InventoryPath) var props mo.VirtualMachine if err := vm.vm.Properties(ctx, vm.vm.Reference(), nil, &props); err != nil { return nil, err } return &props, nil } func (vm *VirtualMachineDriver) Destroy() error { task, err := vm.vm.Destroy(vm.driver.ctx) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) Configure(config *HardwareConfig) error { var confSpec types.VirtualMachineConfigSpec confSpec.NumCPUs = config.CPUs confSpec.NumCoresPerSocket = config.CpuCores confSpec.MemoryMB = config.RAM var cpuSpec types.ResourceAllocationInfo cpuSpec.Reservation = &config.CPUReservation if config.CPULimit != 0 { cpuSpec.Limit = &config.CPULimit } confSpec.CpuAllocation = &cpuSpec var ramSpec types.ResourceAllocationInfo ramSpec.Reservation = &config.RAMReservation confSpec.MemoryAllocation = &ramSpec confSpec.MemoryReservationLockedToMax = &config.RAMReserveAll confSpec.NestedHVEnabled = &config.NestedHV confSpec.CpuHotAddEnabled = &config.CpuHotAddEnabled confSpec.MemoryHotAddEnabled = &config.MemoryHotAddEnabled if config.VideoRAM != 0 { devices, err := vm.vm.Device(vm.driver.ctx) if err != nil { return err } l := devices.SelectByType((*types.VirtualMachineVideoCard)(nil)) if len(l) != 1 { return err } card := l[0].(*types.VirtualMachineVideoCard) card.VideoRamSizeInKB = config.VideoRAM spec := &types.VirtualDeviceConfigSpec{ Device: card, Operation: types.VirtualDeviceConfigSpecOperationEdit, } confSpec.DeviceChange = append(confSpec.DeviceChange, spec) } if config.VGPUProfile != "" { devices, err := vm.vm.Device(vm.driver.ctx) if err != nil { return err } pciDevices := devices.SelectByType((*types.VirtualPCIPassthrough)(nil)) vGPUDevices := pciDevices.SelectByBackingInfo((*types.VirtualPCIPassthroughVmiopBackingInfo)(nil)) var operation types.VirtualDeviceConfigSpecOperation if len(vGPUDevices) > 1 { return err } else if len(pciDevices) == 1 { operation = types.VirtualDeviceConfigSpecOperationEdit } else if len(pciDevices) == 0 { operation = types.VirtualDeviceConfigSpecOperationAdd } vGPUProfile := newVGPUProfile(config.VGPUProfile) spec := &types.VirtualDeviceConfigSpec{ Device: &vGPUProfile, Operation: operation, } log.Printf("Adding vGPU device with profile '%s'", config.VGPUProfile) confSpec.DeviceChange = append(confSpec.DeviceChange, spec) } efiSecureBootEnabled := false firmware := config.Firmware if firmware == "efi-secure" { firmware = "efi" efiSecureBootEnabled = true } confSpec.Firmware = firmware confSpec.BootOptions = &types.VirtualMachineBootOptions{ EnterBIOSSetup: types.NewBool(config.ForceBIOSSetup), EfiSecureBootEnabled: types.NewBool(efiSecureBootEnabled), } task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) Customize(spec types.CustomizationSpec) error { task, err := vm.vm.Customize(vm.driver.ctx, spec) if err != nil { return err } return task.Wait(vm.driver.ctx) } func (vm *VirtualMachineDriver) ResizeDisk(diskSize int64) error { var confSpec types.VirtualMachineConfigSpec devices, err := vm.vm.Device(vm.driver.ctx) if err != nil { return err } disk, err := findDisk(devices) if err != nil { return err } disk.CapacityInKB = diskSize * 1024 confSpec.DeviceChange = []types.BaseVirtualDeviceConfigSpec{ &types.VirtualDeviceConfigSpec{ Device: disk, Operation: types.VirtualDeviceConfigSpecOperationEdit, }, } task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) PowerOn() error { task, err := vm.vm.PowerOn(vm.driver.ctx) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) { netIP, err := vm.vm.WaitForNetIP(ctx, false) if err != nil { return "", err } for _, ips := range netIP { for _, ip := range ips { parseIP := net.ParseIP(ip) if ipNet != nil && !ipNet.Contains(parseIP) { // ip address is not in range continue } // default to an ipv4 addresses if no ipNet is defined if ipNet == nil && parseIP.To4() == nil { continue } return ip, nil } } // unable to find an IP return "", nil } func (vm *VirtualMachineDriver) PowerOff() error { state, err := vm.vm.PowerState(vm.driver.ctx) if err != nil { return err } if state == types.VirtualMachinePowerStatePoweredOff { return nil } task, err := vm.vm.PowerOff(vm.driver.ctx) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) IsPoweredOff() (bool, error) { state, err := vm.vm.PowerState(vm.driver.ctx) if err != nil { return false, err } return state == types.VirtualMachinePowerStatePoweredOff, nil } func (vm *VirtualMachineDriver) StartShutdown() error { err := vm.vm.ShutdownGuest(vm.driver.ctx) return err } func (vm *VirtualMachineDriver) WaitForShutdown(ctx context.Context, timeout time.Duration) error { shutdownTimer := time.After(timeout) for { off, err := vm.IsPoweredOff() if err != nil { return err } if off { break } select { case <-shutdownTimer: err := errors.New("Timeout while waiting for machine to shut down.") return err case <-ctx.Done(): return nil default: time.Sleep(1 * time.Second) } } return nil } func (vm *VirtualMachineDriver) CreateSnapshot(name string) error { task, err := vm.vm.CreateSnapshot(vm.driver.ctx, name, "", false, false) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) ConvertToTemplate() error { return vm.vm.MarkAsTemplate(vm.driver.ctx) } func (vm *VirtualMachineDriver) ImportOvfToContentLibrary(ovf vcenter.OVF) error { err := vm.driver.restClient.Login(vm.driver.ctx) if err != nil { return err } l, err := vm.driver.FindContentLibraryByName(ovf.Target.LibraryID) if err != nil { return err } if l.library.Type != "LOCAL" { return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+ "the content library must be of type LOCAL", ovf.Target.LibraryID, l.library.Type) } item, err := vm.driver.FindContentLibraryItem(l.library.ID, ovf.Spec.Name) if err == nil { // Updates existing library item ovf.Target.LibraryItemID = item.ID } ovf.Target.LibraryID = l.library.ID ovf.Source.Value = vm.vm.Reference().Value ovf.Source.Type = "VirtualMachine" vcm := vcenter.NewManager(vm.driver.restClient.client) _, err = vcm.CreateOVF(vm.driver.ctx, ovf) if err != nil { return err } return vm.driver.restClient.Logout(vm.driver.ctx) } func (vm *VirtualMachineDriver) ImportToContentLibrary(template vcenter.Template) error { err := vm.driver.restClient.Login(vm.driver.ctx) if err != nil { return err } l, err := vm.driver.FindContentLibraryByName(template.Library) if err != nil { return err } if l.library.Type != "LOCAL" { return fmt.Errorf("can not deploy a VM to the content library %s of type %s; "+ "the content library must be of type LOCAL", template.Library, l.library.Type) } template.Library = l.library.ID template.SourceVM = vm.vm.Reference().Value if template.Placement.Cluster != "" { c, err := vm.driver.FindCluster(template.Placement.Cluster) if err != nil { return err } template.Placement.Cluster = c.cluster.Reference().Value } if template.Placement.Folder != "" { f, err := vm.driver.FindFolder(template.Placement.Folder) if err != nil { return err } template.Placement.Folder = f.folder.Reference().Value } if template.Placement.Host != "" { h, err := vm.driver.FindHost(template.Placement.Host) if err != nil { return err } template.Placement.Host = h.host.Reference().Value } if template.Placement.ResourcePool != "" { rp, err := vm.driver.FindResourcePool(template.Placement.Cluster, template.Placement.Host, template.Placement.ResourcePool) if err != nil { return err } template.Placement.ResourcePool = rp.pool.Reference().Value } if template.VMHomeStorage != nil { d, err := vm.driver.FindDatastore(template.VMHomeStorage.Datastore, template.Placement.Host) if err != nil { return err } template.VMHomeStorage.Datastore = d.Reference().Value } vcm := vcenter.NewManager(vm.driver.restClient.client) _, err = vcm.CreateTemplate(vm.driver.ctx, template) if err != nil { return err } return vm.driver.restClient.Logout(vm.driver.ctx) } func (vm *VirtualMachineDriver) GetDir() (string, error) { vmInfo, err := vm.Info("name", "layoutEx.file") if err != nil { return "", err } vmxName := fmt.Sprintf("/%s.vmx", vmInfo.Name) for _, file := range vmInfo.LayoutEx.File { if strings.Contains(file.Name, vmInfo.Name) { return RemoveDatastorePrefix(file.Name[:len(file.Name)-len(vmxName)]), nil } } return "", fmt.Errorf("cannot find '%s'", vmxName) } func addNetwork(d *VCenterDriver, devices object.VirtualDeviceList, config *CreateConfig) (object.VirtualDeviceList, error) { if len(config.NICs) == 0 { return nil, errors.New("no network adapters have been defined") } for _, nic := range config.NICs { network, err := findNetwork(nic.Network, config.Host, d) if err != nil { return nil, err } backing, err := network.EthernetCardBackingInfo(d.ctx) if err != nil { return nil, err } device, err := object.EthernetCardTypes().CreateEthernetCard(nic.NetworkCard, backing) if err != nil { return nil, err } card := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() if nic.MacAddress != "" { card.AddressType = string(types.VirtualEthernetCardMacTypeManual) card.MacAddress = nic.MacAddress } card.UptCompatibilityEnabled = nic.Passthrough devices = append(devices, device) } return devices, nil } func findNetwork(network string, host string, d *VCenterDriver) (object.NetworkReference, error) { if network != "" { var err error networks, err := d.FindNetworks(network) if err != nil { return nil, err } if len(networks) == 1 { return networks[0].network, nil } // If there are multiple networks then try to match the host if host != "" { h, err := d.FindHost(host) if err != nil { return nil, &MultipleNetworkFoundError{network, fmt.Sprintf("unable to match a network to the host %s: %s", host, err.Error())} } for _, n := range networks { info, err := n.Info("host") if err != nil { continue } for _, host := range info.Host { if h.host.Reference().Value == host.Reference().Value { return n.network, nil } } } return nil, &MultipleNetworkFoundError{network, fmt.Sprintf("unable to match a network to the host %s", host)} } return nil, &MultipleNetworkFoundError{network, "please provide a host to match or the network full path"} } if host != "" { h, err := d.FindHost(host) if err != nil { return nil, err } i, err := h.Info("network") if err != nil { return nil, err } if len(i.Network) > 1 { return nil, fmt.Errorf("Host has multiple networks. Specify it explicitly") } return object.NewNetwork(d.client.Client, i.Network[0]), nil } return nil, fmt.Errorf("Couldn't find network; 'host' and 'network' not specified. At least one of the two must be specified.") } func newVGPUProfile(vGPUProfile string) types.VirtualPCIPassthrough { return types.VirtualPCIPassthrough{ VirtualDevice: types.VirtualDevice{ DeviceInfo: &types.Description{ Summary: "", Label: fmt.Sprintf("New vGPU %v PCI device", vGPUProfile), }, Backing: &types.VirtualPCIPassthroughVmiopBackingInfo{ Vgpu: vGPUProfile, }, }, } } func (vm *VirtualMachineDriver) AddCdrom(controllerType string, datastoreIsoPath string) error { devices, err := vm.vm.Device(vm.driver.ctx) if err != nil { return err } var controller *types.VirtualController if controllerType == "sata" { c, err := vm.FindSATAController() if err != nil { return err } controller = c.GetVirtualController() } else { c, err := devices.FindIDEController("") if err != nil { return err } controller = c.GetVirtualController() } cdrom, err := vm.CreateCdrom(controller) if err != nil { return err } if datastoreIsoPath != "" { ds := &DatastoreIsoPath{path: datastoreIsoPath} if !ds.Validate() { return fmt.Errorf("%s is not a valid iso path", datastoreIsoPath) } if libPath, err := vm.driver.FindContentLibraryFileDatastorePath(ds.GetFilePath()); err == nil { datastoreIsoPath = libPath } else { log.Printf("Using %s as the datastore path", datastoreIsoPath) } devices.InsertIso(cdrom, datastoreIsoPath) } log.Printf("Creating CD-ROM on controller '%v' with iso '%v'", controller, datastoreIsoPath) return vm.addDevice(cdrom) } func (vm *VirtualMachineDriver) AddFloppy(imgPath string) error { devices, err := vm.vm.Device(vm.driver.ctx) if err != nil { return err } floppy, err := devices.CreateFloppy() if err != nil { return err } if imgPath != "" { floppy = devices.InsertImg(floppy, imgPath) } return vm.addDevice(floppy) } func (vm *VirtualMachineDriver) SetBootOrder(order []string) error { devices, err := vm.vm.Device(vm.driver.ctx) if err != nil { return err } bootOptions := types.VirtualMachineBootOptions{ BootOrder: devices.BootOrder(order), } return vm.vm.SetBootOptions(vm.driver.ctx, &bootOptions) } func (vm *VirtualMachineDriver) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error { return vm.vm.RemoveDevice(vm.driver.ctx, keepFiles, device...) } func (vm *VirtualMachineDriver) addDevice(device types.BaseVirtualDevice) error { newDevices := object.VirtualDeviceList{device} confSpec := types.VirtualMachineConfigSpec{} var err error confSpec.DeviceChange, err = newDevices.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) if err != nil { return err } task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } func (vm *VirtualMachineDriver) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error { var confSpec types.VirtualMachineConfigSpec var ov []types.BaseOptionValue for k, v := range params { o := types.OptionValue{ Key: k, Value: v, } ov = append(ov, &o) } confSpec.ExtraConfig = ov confSpec.Tools = info if len(confSpec.ExtraConfig) > 0 || confSpec.Tools != nil { task, err := vm.vm.Reconfigure(vm.driver.ctx, confSpec) if err != nil { return err } _, err = task.WaitForResult(vm.driver.ctx, nil) return err } return nil } func (vm *VirtualMachineDriver) Export() (*nfc.Lease, error) { return vm.vm.Export(vm.driver.ctx) } func (vm *VirtualMachineDriver) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { return m.CreateDescriptor(vm.driver.ctx, vm.vm, cdp) } func (vm *VirtualMachineDriver) NewOvfManager() *ovf.Manager { return ovf.NewManager(vm.vm.Client()) } func (vm *VirtualMachineDriver) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) { var mgr mo.OvfManager err := property.DefaultCollector(vm.vm.Client()).RetrieveOne(vm.driver.ctx, m.Reference(), nil, &mgr) if err != nil { return nil, err } return mgr.OvfExportOption, nil } func findNetworkAdapter(l object.VirtualDeviceList) (types.BaseVirtualEthernetCard, error) { c := l.SelectByType((*types.VirtualEthernetCard)(nil)) if len(c) == 0 { return nil, errors.New("no network adapter device found") } return c[0].(types.BaseVirtualEthernetCard), nil } packer-1.6.6+ds1/builder/vsphere/driver/vm_cdrom.go000066400000000000000000000037041377171306200222210ustar00rootroot00000000000000package driver import ( "errors" "github.com/vmware/govmomi/vim25/types" ) var ( ErrNoSataController = errors.New("no available SATA controller") ) func (vm *VirtualMachineDriver) AddSATAController() error { sata := &types.VirtualAHCIController{} return vm.addDevice(sata) } func (vm *VirtualMachineDriver) FindSATAController() (*types.VirtualAHCIController, error) { l, err := vm.Devices() if err != nil { return nil, err } c := l.PickController((*types.VirtualAHCIController)(nil)) if c == nil { return nil, ErrNoSataController } return c.(*types.VirtualAHCIController), nil } func (vm *VirtualMachineDriver) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) { l, err := vm.Devices() if err != nil { return nil, err } device := &types.VirtualCdrom{} l.AssignController(device, c) device.Backing = &types.VirtualCdromAtapiBackingInfo{ VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{}, } device.Connectable = &types.VirtualDeviceConnectInfo{ AllowGuestControl: true, Connected: true, StartConnected: true, } return device, nil } func (vm *VirtualMachineDriver) RemoveCdroms() error { devices, err := vm.Devices() if err != nil { return err } cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) if err = vm.RemoveDevice(true, cdroms...); err != nil { return err } sata := devices.SelectByType((*types.VirtualAHCIController)(nil)) if err = vm.RemoveDevice(true, sata...); err != nil { return err } return nil } func (vm *VirtualMachineDriver) EjectCdroms() error { devices, err := vm.Devices() if err != nil { return err } cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) for _, cd := range cdroms { c := cd.(*types.VirtualCdrom) c.Backing = &types.VirtualCdromRemotePassthroughBackingInfo{} c.Connectable = &types.VirtualDeviceConnectInfo{} err := vm.vm.EditDevice(vm.driver.ctx, c) if err != nil { return err } } return nil } packer-1.6.6+ds1/builder/vsphere/driver/vm_cdrom_test.go000066400000000000000000000101031377171306200232470ustar00rootroot00000000000000package driver import ( "strings" "testing" "github.com/google/go-cmp/cmp" "github.com/vmware/govmomi/vim25/types" ) func TestVirtualMachineDriver_FindAndAddSATAController(t *testing.T) { sim, err := NewVCenterSimulator() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() vm, _ := sim.ChooseSimulatorPreCreatedVM() _, err = vm.FindSATAController() if err != nil && !strings.Contains(err.Error(), "no available SATA controller") { t.Fatalf("unexpected error: %s", err.Error()) } if err == nil { t.Fatalf("vm should not have sata controller") } if err := vm.AddSATAController(); err != nil { t.Fatalf("should not fail: %s", err.Error()) } sc, err := vm.FindSATAController() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if sc == nil { t.Fatalf("SATA controller wasn't added properly") } } func TestVirtualMachineDriver_CreateAndRemoveCdrom(t *testing.T) { sim, err := NewVCenterSimulator() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() vm, _ := sim.ChooseSimulatorPreCreatedVM() // Add SATA Controller if err := vm.AddSATAController(); err != nil { t.Fatalf("should not fail: %s", err.Error()) } // Verify if controller was created sc, err := vm.FindSATAController() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if sc == nil { t.Fatalf("SATA controller wasn't added properly") } // Create CDROM controller := sc.GetVirtualController() cdrom, err := vm.CreateCdrom(controller) if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if cdrom == nil { t.Fatalf("CDrom wasn't created properly") } // Verify if CDROM was created devices, err := vm.Devices() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) if len(cdroms) != 1 { t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) } // Remove CDROM err = vm.RemoveCdroms() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } // Verify if CDROM was removed devices, err = vm.Devices() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } cdroms = devices.SelectByType((*types.VirtualCdrom)(nil)) if len(cdroms) != 0 { t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) } } func TestVirtualMachineDriver_EjectCdrom(t *testing.T) { sim, err := NewVCenterSimulator() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() vm, _ := sim.ChooseSimulatorPreCreatedVM() // Add SATA Controller if err := vm.AddSATAController(); err != nil { t.Fatalf("should not fail: %s", err.Error()) } // Verify if controller was created sc, err := vm.FindSATAController() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if sc == nil { t.Fatalf("SATA controller wasn't added properly") } // Create CDROM controller := sc.GetVirtualController() cdrom, err := vm.CreateCdrom(controller) if err != nil { t.Fatalf("should not fail: %s", err.Error()) } if cdrom == nil { t.Fatalf("CDrom wasn't created properly") } // Verify if CDROM was created devices, err := vm.Devices() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) if len(cdroms) != 1 { t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) } // Remove CDROM err = vm.EjectCdroms() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } // Verify if CDROM was removed devices, err = vm.Devices() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } cdroms = devices.SelectByType((*types.VirtualCdrom)(nil)) if len(cdroms) != 1 { t.Fatalf("unexpected numbers of cdrom: %d", len(cdroms)) } cd, ok := cdroms[0].(*types.VirtualCdrom) if !ok { t.Fatalf("Wrong cdrom type") } if diff := cmp.Diff(cd.Backing, &types.VirtualCdromRemotePassthroughBackingInfo{}); diff != "" { t.Fatalf("Wrong cdrom backing info: %s", diff) } if diff := cmp.Diff(cd.Connectable, &types.VirtualDeviceConnectInfo{}); diff != "" { t.Fatalf("Wrong cdrom connect info: %s", diff) } } packer-1.6.6+ds1/builder/vsphere/driver/vm_clone_acc_test.go000066400000000000000000000221331377171306200240570ustar00rootroot00000000000000package driver import ( "context" "log" "net" "testing" "time" ) func TestVMAcc_clone(t *testing.T) { t.Skip("Acceptance tests not configured yet.") testCases := []struct { name string config *CloneConfig checkFunction func(*testing.T, VirtualMachine, *CloneConfig) }{ {"Default", &CloneConfig{}, cloneDefaultCheck}, {"LinkedClone", &CloneConfig{LinkedClone: true}, cloneLinkedCloneCheck}, {"Folder", &CloneConfig{LinkedClone: true, Folder: "folder1/folder2"}, cloneFolderCheck}, {"ResourcePool", &CloneConfig{LinkedClone: true, ResourcePool: "pool1/pool2"}, cloneResourcePoolCheck}, {"Configure", &CloneConfig{LinkedClone: true}, configureCheck}, {"Configure_RAMReserveAll", &CloneConfig{LinkedClone: true}, configureRAMReserveAllCheck}, {"StartAndStop", &CloneConfig{LinkedClone: true}, startAndStopCheck}, {"Template", &CloneConfig{LinkedClone: true}, templateCheck}, {"Snapshot", &CloneConfig{}, snapshotCheck}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { tc.config.Host = TestHostName tc.config.Name = newVMName() templateName := "alpine" d := newTestDriver(t) template, err := d.FindVM(templateName) // Don't destroy this VM! if err != nil { t.Fatalf("Cannot find template vm '%v': %v", templateName, err) } log.Printf("[DEBUG] Clonning VM") vm, err := template.Clone(context.TODO(), tc.config) if err != nil { t.Fatalf("Cannot clone vm '%v': %v", templateName, err) } defer destroyVM(t, vm, tc.config.Name) log.Printf("[DEBUG] Running check function") tc.checkFunction(t, vm, tc.config) }) } } func cloneDefaultCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { d := vm.(*VirtualMachineDriver).driver // Check that the clone can be found by its name if _, err := d.FindVM(config.Name); err != nil { t.Errorf("Cannot find created vm '%v': %v", config.Name, err) } vmInfo, err := vm.Info("name", "parent", "runtime.host", "resourcePool", "datastore", "layoutEx.disk") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } if vmInfo.Name != config.Name { t.Errorf("Invalid VM name: expected '%v', got '%v'", config.Name, vmInfo.Name) } f := d.NewFolder(vmInfo.Parent) folderPath, err := f.Path() if err != nil { t.Fatalf("Cannot read folder name: %v", err) } if folderPath != "" { t.Errorf("Invalid folder: expected '/', got '%v'", folderPath) } h := d.NewHost(vmInfo.Runtime.Host) hostInfo, err := h.Info("name") if err != nil { t.Fatal("Cannot read host properties: ", err) } if hostInfo.Name != TestHostName { t.Errorf("Invalid host name: expected '%v', got '%v'", TestHostName, hostInfo.Name) } p := d.NewResourcePool(vmInfo.ResourcePool) poolPath, err := p.Path() if err != nil { t.Fatalf("Cannot read resource pool name: %v", err) } if poolPath != "" { t.Errorf("Invalid resource pool: expected '/', got '%v'", poolPath) } dsr := vmInfo.Datastore[0].Reference() ds := d.NewDatastore(&dsr) dsInfo, err := ds.Info("name") if err != nil { t.Fatal("Cannot read datastore properties: ", err) } if dsInfo.Name != "datastore1" { t.Errorf("Invalid datastore name: expected '%v', got '%v'", "datastore1", dsInfo.Name) } if len(vmInfo.LayoutEx.Disk[0].Chain) != 1 { t.Error("Not a full clone") } } func configureCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { log.Printf("[DEBUG] Configuring the vm") hwConfig := &HardwareConfig{ CPUs: 2, CPUReservation: 1000, CPULimit: 1500, RAM: 2048, RAMReservation: 1024, MemoryHotAddEnabled: true, CpuHotAddEnabled: true, } err := vm.Configure(hwConfig) if err != nil { t.Fatalf("Failed to configure VM: %v", err) } log.Printf("[DEBUG] Running checks") vmInfo, err := vm.Info("config") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } cpuSockets := vmInfo.Config.Hardware.NumCPU if cpuSockets != hwConfig.CPUs { t.Errorf("VM should have %v CPU sockets, got %v", hwConfig.CPUs, cpuSockets) } cpuReservation := *vmInfo.Config.CpuAllocation.Reservation if cpuReservation != hwConfig.CPUReservation { t.Errorf("VM should have CPU reservation for %v Mhz, got %v", hwConfig.CPUReservation, cpuReservation) } cpuLimit := *vmInfo.Config.CpuAllocation.Limit if cpuLimit != hwConfig.CPULimit { t.Errorf("VM should have CPU reservation for %v Mhz, got %v", hwConfig.CPULimit, cpuLimit) } ram := vmInfo.Config.Hardware.MemoryMB if int64(ram) != hwConfig.RAM { t.Errorf("VM should have %v MB of RAM, got %v", hwConfig.RAM, ram) } ramReservation := *vmInfo.Config.MemoryAllocation.Reservation if ramReservation != hwConfig.RAMReservation { t.Errorf("VM should have RAM reservation for %v MB, got %v", hwConfig.RAMReservation, ramReservation) } cpuHotAdd := vmInfo.Config.CpuHotAddEnabled if *cpuHotAdd != hwConfig.CpuHotAddEnabled { t.Errorf("VM should have CPU hot add set to %v, got %v", hwConfig.CpuHotAddEnabled, cpuHotAdd) } memoryHotAdd := vmInfo.Config.MemoryHotAddEnabled if *memoryHotAdd != hwConfig.MemoryHotAddEnabled { t.Errorf("VM should have Memroy hot add set to %v, got %v", hwConfig.MemoryHotAddEnabled, memoryHotAdd) } } func configureRAMReserveAllCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { log.Printf("[DEBUG] Configuring the vm") err := vm.Configure(&HardwareConfig{RAMReserveAll: true}) if err != nil { t.Fatalf("Failed to configure VM: %v", err) } log.Printf("[DEBUG] Running checks") vmInfo, err := vm.Info("config") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } if *vmInfo.Config.MemoryReservationLockedToMax != true { t.Errorf("VM should have all RAM reserved") } } func cloneLinkedCloneCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { vmInfo, err := vm.Info("layoutEx.disk") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } if len(vmInfo.LayoutEx.Disk[0].Chain) != 2 { t.Error("Not a linked clone") } } func cloneFolderCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { vmInfo, err := vm.Info("parent") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } f := vm.(*VirtualMachineDriver).driver.NewFolder(vmInfo.Parent) path, err := f.Path() if err != nil { t.Fatalf("Cannot read folder name: %v", err) } if path != config.Folder { t.Errorf("Wrong folder. expected: %v, got: %v", config.Folder, path) } } func cloneResourcePoolCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { vmInfo, err := vm.Info("resourcePool") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } p := vm.(*VirtualMachineDriver).driver.NewResourcePool(vmInfo.ResourcePool) path, err := p.Path() if err != nil { t.Fatalf("Cannot read resource pool name: %v", err) } if path != config.ResourcePool { t.Errorf("Wrong folder. expected: %v, got: %v", config.ResourcePool, path) } } func startAndStopCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { stopper := startVM(t, vm, config.Name) defer stopper() switch ip, err := vm.WaitForIP(context.TODO(), nil); { case err != nil: t.Errorf("Cannot obtain IP address from created vm '%v': %v", config.Name, err) case net.ParseIP(ip) == nil: t.Errorf("'%v' is not a valid ip address", ip) } err := vm.StartShutdown() if err != nil { t.Fatalf("Failed to initiate guest shutdown: %v", err) } log.Printf("[DEBUG] Waiting max 1m0s for shutdown to complete") err = vm.WaitForShutdown(context.TODO(), 1*time.Minute) if err != nil { t.Fatalf("Failed to wait for giest shutdown: %v", err) } } func snapshotCheck(t *testing.T, vm VirtualMachine, config *CloneConfig) { stopper := startVM(t, vm, config.Name) defer stopper() err := vm.CreateSnapshot("test-snapshot") if err != nil { t.Fatalf("Failed to create snapshot: %v", err) } vmInfo, err := vm.Info("layoutEx.disk") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } layers := len(vmInfo.LayoutEx.Disk[0].Chain) if layers != 2 { t.Errorf("VM should have a single snapshot. expected 2 disk layers, got %v", layers) } } func templateCheck(t *testing.T, vm VirtualMachine, _ *CloneConfig) { err := vm.ConvertToTemplate() if err != nil { t.Fatalf("Failed to convert to template: %v", err) } vmInfo, err := vm.Info("config.template") if err != nil { t.Errorf("Cannot read VM properties: %v", err) } else if !vmInfo.Config.Template { t.Error("Not a template") } } func startVM(t *testing.T, vm VirtualMachine, vmName string) (stopper func()) { log.Printf("[DEBUG] Starting the vm") if err := vm.PowerOn(); err != nil { t.Fatalf("Cannot start vm '%v': %v", vmName, err) } return func() { log.Printf("[DEBUG] Powering off the vm") if err := vm.PowerOff(); err != nil { t.Errorf("Cannot power off started vm '%v': %v", vmName, err) } } } func destroyVM(t *testing.T, vm VirtualMachine, vmName string) { log.Printf("[DEBUG] Deleting the VM") if err := vm.Destroy(); err != nil { t.Errorf("!!! ERROR DELETING VM '%v': %v!!!", vmName, err) } // Check that the clone is no longer exists if _, err := vm.(*VirtualMachineDriver).driver.FindVM(vmName); err == nil { t.Errorf("!!! STILL CAN FIND VM '%v'. IT MIGHT NOT HAVE BEEN DELETED !!!", vmName) } } packer-1.6.6+ds1/builder/vsphere/driver/vm_create_acc_test.go000066400000000000000000000045301377171306200242230ustar00rootroot00000000000000package driver import ( "log" "testing" ) func TestVMAcc_create(t *testing.T) { t.Skip("Acceptance tests not configured yet.") testCases := []struct { name string config *CreateConfig checkFunction func(*testing.T, VirtualMachine, *CreateConfig) }{ {"MinimalConfiguration", &CreateConfig{}, createDefaultCheck}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { tc.config.Host = TestHostName tc.config.Name = newVMName() d := newTestDriver(t) log.Printf("[DEBUG] Creating VM") vm, err := d.CreateVM(tc.config) if err != nil { t.Fatalf("Cannot create VM: %v", err) } defer destroyVM(t, vm, tc.config.Name) log.Printf("[DEBUG] Running check function") tc.checkFunction(t, vm, tc.config) }) } } func createDefaultCheck(t *testing.T, vm VirtualMachine, config *CreateConfig) { d := vm.(*VirtualMachineDriver).driver // Check that the clone can be found by its name if _, err := d.FindVM(config.Name); err != nil { t.Errorf("Cannot find created vm '%v': %v", config.Name, err) } vmInfo, err := vm.Info("name", "parent", "runtime.host", "resourcePool", "datastore", "layoutEx.disk") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } if vmInfo.Name != config.Name { t.Errorf("Invalid VM name: expected '%v', got '%v'", config.Name, vmInfo.Name) } f := d.NewFolder(vmInfo.Parent) folderPath, err := f.Path() if err != nil { t.Fatalf("Cannot read folder name: %v", err) } if folderPath != "" { t.Errorf("Invalid folder: expected '/', got '%v'", folderPath) } h := d.NewHost(vmInfo.Runtime.Host) hostInfo, err := h.Info("name") if err != nil { t.Fatal("Cannot read host properties: ", err) } if hostInfo.Name != TestHostName { t.Errorf("Invalid host name: expected '%v', got '%v'", TestHostName, hostInfo.Name) } p := d.NewResourcePool(vmInfo.ResourcePool) poolPath, err := p.Path() if err != nil { t.Fatalf("Cannot read resource pool name: %v", err) } if poolPath != "" { t.Errorf("Invalid resource pool: expected '/', got '%v'", poolPath) } dsr := vmInfo.Datastore[0].Reference() ds := d.NewDatastore(&dsr) dsInfo, err := ds.Info("name") if err != nil { t.Fatal("Cannot read datastore properties: ", err) } if dsInfo.Name != "datastore1" { t.Errorf("Invalid datastore name: expected 'datastore1', got '%v'", dsInfo.Name) } } packer-1.6.6+ds1/builder/vsphere/driver/vm_keyboard.go000066400000000000000000000015141377171306200227120ustar00rootroot00000000000000package driver import ( "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/types" "golang.org/x/mobile/event/key" ) type KeyInput struct { Scancode key.Code Alt bool Ctrl bool Shift bool } func (vm *VirtualMachineDriver) TypeOnKeyboard(input KeyInput) (int32, error) { var spec types.UsbScanCodeSpec spec.KeyEvents = append(spec.KeyEvents, types.UsbScanCodeSpecKeyEvent{ UsbHidCode: int32(input.Scancode)<<16 | 7, Modifiers: &types.UsbScanCodeSpecModifierType{ LeftControl: &input.Ctrl, LeftAlt: &input.Alt, LeftShift: &input.Shift, }, }) req := &types.PutUsbScanCodes{ This: vm.vm.Reference(), Spec: spec, } resp, err := methods.PutUsbScanCodes(vm.driver.ctx, vm.driver.client.RoundTripper, req) if err != nil { return 0, err } return resp.Returnval, nil } packer-1.6.6+ds1/builder/vsphere/driver/vm_mock.go000066400000000000000000000130021377171306200220360ustar00rootroot00000000000000package driver import ( "context" "net" "time" "github.com/vmware/govmomi/nfc" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/ovf" "github.com/vmware/govmomi/vapi/vcenter" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) type VirtualMachineMock struct { DestroyError error DestroyCalled bool ConfigureError error ConfigureCalled bool ConfigureHardwareConfig *HardwareConfig FindSATAControllerCalled bool FindSATAControllerErr error AddSATAControllerCalled bool AddSATAControllerErr error AddCdromCalled bool AddCdromCalledTimes int AddCdromErr error AddCdromTypes []string AddCdromPaths []string GetDirCalled bool GetDirResponse string GetDirErr error AddFloppyCalled bool AddFloppyImagePath string AddFloppyErr error FloppyDevicesErr error FloppyDevicesReturn object.VirtualDeviceList FloppyDevicesCalled bool RemoveDeviceErr error RemoveDeviceCalled bool RemoveDeviceKeepFiles bool RemoveDeviceDevices []types.BaseVirtualDevice EjectCdromsCalled bool EjectCdromsErr error RemoveCdromsCalled bool RemoveCdromsErr error } func (vm *VirtualMachineMock) Info(params ...string) (*mo.VirtualMachine, error) { return nil, nil } func (vm *VirtualMachineMock) Devices() (object.VirtualDeviceList, error) { return object.VirtualDeviceList{}, nil } func (vm *VirtualMachineMock) FloppyDevices() (object.VirtualDeviceList, error) { vm.FloppyDevicesCalled = true return vm.FloppyDevicesReturn, vm.FloppyDevicesErr } func (vm *VirtualMachineMock) Clone(ctx context.Context, config *CloneConfig) (VirtualMachine, error) { return nil, nil } func (vm *VirtualMachineMock) updateVAppConfig(ctx context.Context, newProps map[string]string) (*types.VmConfigSpec, error) { return nil, nil } func (vm *VirtualMachineMock) AddPublicKeys(ctx context.Context, publicKeys string) error { return nil } func (vm *VirtualMachineMock) Properties(ctx context.Context) (*mo.VirtualMachine, error) { return nil, nil } func (vm *VirtualMachineMock) Destroy() error { vm.DestroyCalled = true if vm.DestroyError != nil { return vm.DestroyError } return nil } func (vm *VirtualMachineMock) Configure(config *HardwareConfig) error { vm.ConfigureCalled = true vm.ConfigureHardwareConfig = config if vm.ConfigureError != nil { return vm.ConfigureError } return nil } func (vm *VirtualMachineMock) Customize(spec types.CustomizationSpec) error { return nil } func (vm *VirtualMachineMock) ResizeDisk(diskSize int64) error { return nil } func (vm *VirtualMachineMock) PowerOn() error { return nil } func (vm *VirtualMachineMock) WaitForIP(ctx context.Context, ipNet *net.IPNet) (string, error) { return "", nil } func (vm *VirtualMachineMock) PowerOff() error { return nil } func (vm *VirtualMachineMock) IsPoweredOff() (bool, error) { return false, nil } func (vm *VirtualMachineMock) StartShutdown() error { return nil } func (vm *VirtualMachineMock) WaitForShutdown(ctx context.Context, timeout time.Duration) error { return nil } func (vm *VirtualMachineMock) CreateSnapshot(name string) error { return nil } func (vm *VirtualMachineMock) ConvertToTemplate() error { return nil } func (vm *VirtualMachineMock) ImportOvfToContentLibrary(ovf vcenter.OVF) error { return nil } func (vm *VirtualMachineMock) ImportToContentLibrary(template vcenter.Template) error { return nil } func (vm *VirtualMachineMock) GetDir() (string, error) { vm.GetDirCalled = true return vm.GetDirResponse, vm.GetDirErr } func (vm *VirtualMachineMock) AddCdrom(cdromType string, isoPath string) error { vm.AddCdromCalledTimes++ vm.AddCdromCalled = true vm.AddCdromTypes = append(vm.AddCdromTypes, cdromType) vm.AddCdromPaths = append(vm.AddCdromPaths, isoPath) return vm.AddCdromErr } func (vm *VirtualMachineMock) AddFloppy(imgPath string) error { vm.AddFloppyCalled = true vm.AddFloppyImagePath = imgPath return vm.AddFloppyErr } func (vm *VirtualMachineMock) SetBootOrder(order []string) error { return nil } func (vm *VirtualMachineMock) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error { vm.RemoveDeviceCalled = true vm.RemoveDeviceKeepFiles = keepFiles vm.RemoveDeviceDevices = device return vm.RemoveDeviceErr } func (vm *VirtualMachineMock) addDevice(device types.BaseVirtualDevice) error { return nil } func (vm *VirtualMachineMock) AddConfigParams(params map[string]string, info *types.ToolsConfigInfo) error { return nil } func (vm *VirtualMachineMock) Export() (*nfc.Lease, error) { return nil, nil } func (vm *VirtualMachineMock) CreateDescriptor(m *ovf.Manager, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { return nil, nil } func (vm *VirtualMachineMock) NewOvfManager() *ovf.Manager { return nil } func (vm *VirtualMachineMock) GetOvfExportOptions(m *ovf.Manager) ([]types.OvfOptionInfo, error) { return nil, nil } func (vm *VirtualMachineMock) AddSATAController() error { vm.AddSATAControllerCalled = true return vm.AddSATAControllerErr } func (vm *VirtualMachineMock) FindSATAController() (*types.VirtualAHCIController, error) { vm.FindSATAControllerCalled = true return nil, vm.FindSATAControllerErr } func (vm *VirtualMachineMock) CreateCdrom(c *types.VirtualController) (*types.VirtualCdrom, error) { return nil, nil } func (vm *VirtualMachineMock) RemoveCdroms() error { vm.RemoveCdromsCalled = true return vm.RemoveCdromsErr } func (vm *VirtualMachineMock) EjectCdroms() error { vm.EjectCdromsCalled = true return vm.EjectCdromsErr } packer-1.6.6+ds1/builder/vsphere/driver/vm_test.go000066400000000000000000000031511377171306200220700ustar00rootroot00000000000000package driver import ( "testing" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) // ReconfigureFail changes the behavior of simulator.VirtualMachine type ReconfigureFail struct { *simulator.VirtualMachine } // Override simulator.VirtualMachine.ReconfigVMTask to inject faults func (vm *ReconfigureFail) ReconfigVMTask(req *types.ReconfigVM_Task) soap.HasFault { task := simulator.CreateTask(req.This, "reconfigure", func(*simulator.Task) (types.AnyType, types.BaseMethodFault) { return nil, &types.TaskInProgress{} }) return &methods.ReconfigVM_TaskBody{ Res: &types.ReconfigVM_TaskResponse{ Returnval: task.Run(), }, } } func TestVirtualMachineDriver_Configure(t *testing.T) { sim, err := NewVCenterSimulator() if err != nil { t.Fatalf("should not fail: %s", err.Error()) } defer sim.Close() vm, machine := sim.ChooseSimulatorPreCreatedVM() // Happy test hardwareConfig := &HardwareConfig{ CPUs: 1, CpuCores: 1, CPUReservation: 2500, CPULimit: 1, RAM: 1024, RAMReserveAll: true, VideoRAM: 512, VGPUProfile: "grid_m10-8q", Firmware: "efi-secure", ForceBIOSSetup: true, } if err = vm.Configure(hardwareConfig); err != nil { t.Fatalf("should not fail: %s", err.Error()) } //Fail test //Wrap the existing vm object with the mocked reconfigure task which will return a fault simulator.Map.Put(&ReconfigureFail{machine}) if err = vm.Configure(&HardwareConfig{}); err == nil { t.Fatalf("Configure should fail") } } packer-1.6.6+ds1/builder/vsphere/examples/000077500000000000000000000000001377171306200204035ustar00rootroot00000000000000packer-1.6.6+ds1/builder/vsphere/examples/alpine/000077500000000000000000000000001377171306200216535ustar00rootroot00000000000000packer-1.6.6+ds1/builder/vsphere/examples/alpine/alpine-3.8.json000066400000000000000000000027331377171306200243310ustar00rootroot00000000000000{ "builders": [ { "type": "vsphere-iso", "vcenter_server": "vcenter.vsphere65.test", "username": "root", "password": "jetbrains", "insecure_connection": true, "vm_name": "alpine-{{timestamp}}", "host": "esxi-1.vsphere65.test", "CPUs": 1, "RAM": 512, "RAM_reserve_all": true, "disk_controller_type": "pvscsi", "disk_size": 1024, "disk_thin_provisioned": true, "network_card": "vmxnet3", "guest_os_type": "other3xLinux64Guest", "iso_paths": [ "[datastore1] ISO/alpine-standard-3.8.2-x86_64.iso" ], "floppy_files": [ "{{template_dir}}/answerfile", "{{template_dir}}/setup.sh" ], "boot_wait": "15s", "boot_command": [ "root", "mount -t vfat /dev/fd0 /media/floppy", "setup-alpine -f /media/floppy/answerfile", "", "jetbrains", "jetbrains", "", "y", "", "reboot", "", "root", "jetbrains", "mount -t vfat /dev/fd0 /media/floppy", "/media/floppy/SETUP.SH" ], "ssh_username": "root", "ssh_password": "jetbrains" } ], "provisioners": [ { "type": "shell", "inline": ["ls /"] } ] } packer-1.6.6+ds1/builder/vsphere/examples/alpine/answerfile000066400000000000000000000004731377171306200237410ustar00rootroot00000000000000KEYMAPOPTS="us us" HOSTNAMEOPTS="-n alpine" INTERFACESOPTS="auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp hostname alpine " TIMEZONEOPTS="-z UTC" PROXYOPTS="none" APKREPOSOPTS="http://mirror.yandex.ru/mirrors/alpine/v3.8/main" SSHDOPTS="-c openssh" NTPOPTS="-c none" DISKOPTS="-m sys /dev/sda" packer-1.6.6+ds1/builder/vsphere/examples/alpine/setup.sh000066400000000000000000000007011377171306200233450ustar00rootroot00000000000000#!/bin/sh set -ex apk add libressl apk add open-vm-tools rc-update add open-vm-tools /etc/init.d/open-vm-tools start cat >/usr/local/bin/shutdown <", "ut", "/Volumes/setup/setup.sh" ], "ssh_username": "jetbrains", "ssh_password": "jetbrains" } ] } packer-1.6.6+ds1/builder/vsphere/examples/macos/setup/000077500000000000000000000000001377171306200226455ustar00rootroot00000000000000packer-1.6.6+ds1/builder/vsphere/examples/macos/setup/.gitignore000066400000000000000000000000051377171306200246300ustar00rootroot00000000000000out/ packer-1.6.6+ds1/builder/vsphere/examples/macos/setup/iso-macos.sh000066400000000000000000000011611377171306200250720ustar00rootroot00000000000000#!/bin/sh set -eux # Based on # https://gist.github.com/agentsim/00cc38c693e7d0e1b36a2080870d955b#gistcomment-2304505 mkdir -p out hdiutil create -o out/HighSierra.cdr -size 5530m -layout SPUD -fs HFS+J hdiutil attach out/HighSierra.cdr.dmg -noverify -mountpoint /Volumes/install_build sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build --nointeraction hdiutil detach /Volumes/Install\ macOS\ High\ Sierra hdiutil convert out/HighSierra.cdr.dmg -format UDTO -o out/HighSierra.iso mv out/HighSierra.iso.cdr out/HighSierra.iso rm out/HighSierra.cdr.dmg packer-1.6.6+ds1/builder/vsphere/examples/macos/setup/iso-setup.sh000066400000000000000000000010541377171306200251310ustar00rootroot00000000000000#!/bin/sh set -eux mkdir -p out/pkgroot rm -rf /out/pkgroot/* mkdir -p out/scripts rm -rf /out/scripts/* cp postinstall out/scripts/ pkgbuild \ --identifier io.packer.install \ --root out/pkgroot \ --scripts out/scripts \ out/postinstall.pkg mkdir -p out/iso rm -rf out/iso/* cp setup.sh out/iso/ chmod +x out/iso/setup.sh productbuild --package out/postinstall.pkg out/iso/postinstall.pkg rm -f out/setup.iso hdiutil makehybrid -iso -joliet -default-volume-name setup -o out/setup.iso out/iso cd out shasum -a 256 setup.iso >sha256sums packer-1.6.6+ds1/builder/vsphere/examples/macos/setup/postinstall000066400000000000000000000014371377171306200251510ustar00rootroot00000000000000#!/bin/sh set -eux # debug output in /var/log/install.log # Create user account USERNAME=jetbrains PASSWORD=jetbrains dscl . -create "/Users/${USERNAME}" dscl . -create "/Users/${USERNAME}" UserShell /bin/bash dscl . -create "/Users/${USERNAME}" RealName "${USERNAME}" dscl . -create "/Users/${USERNAME}" UniqueID 510 dscl . -create "/Users/${USERNAME}" PrimaryGroupID 20 dscl . -create "/Users/${USERNAME}" NFSHomeDirectory "/Users/${USERNAME}" dscl . -passwd "/Users/${USERNAME}" "${PASSWORD}" dscl . -append /Groups/admin GroupMembership "${USERNAME}" createhomedir -c # Start VMware Tools daemon explicitly launchctl load /Library/LaunchDaemons/com.vmware.launchd.tools.plist # Enable SSH systemsetup -setremotelogin on # Disable the welcome screen touch "$3/private/var/db/.AppleSetupDone" packer-1.6.6+ds1/builder/vsphere/examples/macos/setup/setup.sh000066400000000000000000000006751377171306200243510ustar00rootroot00000000000000#!/bin/sh set -eux # Format partition diskutil eraseDisk JHFS+ Disk disk0 # Packages are installed in reversed order - why? "/Volumes/Image Volume/Install macOS High Sierra.app/Contents/Resources/startosinstall" \ --volume /Volumes/Disk \ --converttoapfs no \ --agreetolicense \ --installpackage "/Volumes/setup/postinstall.pkg" \ --installpackage "/Volumes/VMware Tools/Install VMware Tools.app/Contents/Resources/VMware Tools.pkg" packer-1.6.6+ds1/builder/vsphere/examples/ubuntu/000077500000000000000000000000001377171306200217255ustar00rootroot00000000000000packer-1.6.6+ds1/builder/vsphere/examples/ubuntu/preseed.cfg000066400000000000000000000011061377171306200240330ustar00rootroot00000000000000d-i passwd/user-fullname string jetbrains d-i passwd/username string jetbrains d-i passwd/user-password password jetbrains d-i passwd/user-password-again password jetbrains d-i user-setup/allow-password-weak boolean true d-i partman-auto/disk string /dev/sda d-i partman-auto/method string regular d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i pkgsel/include string open-vm-tools openssh-server d-i finish-install/reboot_in_progress note packer-1.6.6+ds1/builder/vsphere/examples/ubuntu/ubuntu-16.04.json000066400000000000000000000031101377171306200246030ustar00rootroot00000000000000{ "builders": [ { "type": "vsphere-iso", "vcenter_server": "vcenter.vsphere65.test", "username": "root", "password": "jetbrains", "insecure_connection": "true", "vm_name": "example-ubuntu", "host": "esxi-1.vsphere65.test", "guest_os_type": "ubuntu64Guest", "ssh_username": "jetbrains", "ssh_password": "jetbrains", "CPUs": 1, "RAM": 1024, "RAM_reserve_all": true, "disk_controller_type": "pvscsi", "disk_size": 32768, "disk_thin_provisioned": true, "network_card": "vmxnet3", "iso_paths": [ "[datastore1] ISO/ubuntu-16.04.3-server-amd64.iso" ], "floppy_files": [ "{{template_dir}}/preseed.cfg" ], "boot_command": [ "", "", "", "", "", "", "", "", "", "", "/install/vmlinuz", " initrd=/install/initrd.gz", " priority=critical", " locale=en_US", " file=/media/preseed.cfg", "" ] } ], "provisioners": [ { "type": "shell", "inline": ["ls /"] } ] } packer-1.6.6+ds1/builder/vsphere/examples/windows/000077500000000000000000000000001377171306200220755ustar00rootroot00000000000000packer-1.6.6+ds1/builder/vsphere/examples/windows/.gitattributes000066400000000000000000000000501377171306200247630ustar00rootroot00000000000000*.cmd text eol=crlf *.ps1 text eol=crlf packer-1.6.6+ds1/builder/vsphere/examples/windows/setup/000077500000000000000000000000001377171306200232355ustar00rootroot00000000000000packer-1.6.6+ds1/builder/vsphere/examples/windows/setup/Autounattend.xml000066400000000000000000000134201377171306200264320ustar00rootroot00000000000000 en-US B:\ true /IMAGE/NAME Windows 10 Pro true 0 1 true Primary false 1 a:\vmtools.cmd Always en-US 3 jetbrains jetbrains true</PlainText> </Password> <Group>Administrators</Group> </LocalAccount> </LocalAccounts> </UserAccounts> <AutoLogon> <Enabled>true</Enabled> <Username>jetbrains</Username> <Password> <Value>jetbrains</Value> <PlainText>true</PlainText> </Password> <LogonCount>1</LogonCount> </AutoLogon> <FirstLogonCommands> <SynchronousCommand wcm:action="add"> <Order>1</Order> <!-- Enable WinRM service --> <CommandLine>powershell -ExecutionPolicy Bypass -File a:\setup.ps1</CommandLine> <RequiresUserInput>true</RequiresUserInput> </SynchronousCommand> </FirstLogonCommands> </component> </settings> </unattend> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/examples/windows/setup/setup.ps1�����������������������������������0000664�0000000�0000000�00000001263�13771713062�0025024�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������$ErrorActionPreference = "Stop" # Switch network connection to private mode # Required for WinRM firewall rules $profile = Get-NetConnectionProfile Set-NetConnectionProfile -Name $profile.Name -NetworkCategory Private # Enable WinRM service winrm quickconfig -quiet winrm set winrm/config/service '@{AllowUnencrypted="true"}' winrm set winrm/config/service/auth '@{Basic="true"}' # Reset auto logon count # https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-autologon-logoncount#logoncount-known-issue Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name AutoLogonCount -Value 0 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/examples/windows/setup/vmtools.cmd���������������������������������0000664�0000000�0000000�00000000110�13771713062�0025415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������@rem Silent mode, basic UI, no reboot e:\setup64 /s /v "/qb REBOOT=R" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/examples/windows/windows-10.json�����������������������������������0000664�0000000�0000000�00000002205�13771713062�0024677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "type": "vsphere-iso", "vcenter_server": "vcenter.vsphere65.test", "username": "root", "password": "jetbrains", "insecure_connection": "true", "vm_name": "example-windows", "host": "esxi-1.vsphere65.test", "guest_os_type": "windows9_64Guest", "communicator": "winrm", "winrm_username": "jetbrains", "winrm_password": "jetbrains", "CPUs": 1, "RAM": 4096, "RAM_reserve_all": true, "disk_controller_type": "pvscsi", "disk_size": 32768, "disk_thin_provisioned": true, "network_card": "vmxnet3", "iso_paths": [ "[datastore1] ISO/en_windows_10_multi-edition_vl_version_1709_updated_dec_2017_x64_dvd_100406172.iso", "[datastore1] ISO/VMware Tools/10.2.0/windows.iso" ], "floppy_files": [ "{{template_dir}}/setup/" ], "floppy_img_path": "[datastore1] ISO/VMware Tools/10.2.0/pvscsi-Windows8.flp" } ], "provisioners": [ { "type": "windows-shell", "inline": ["dir c:\\"] } ] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/���������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017357�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/builder.go�����������������������������������������������������0000664�0000000�0000000�00000011574�13771713062�0021344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package iso import ( "context" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/vsphere/common" "github.com/hashicorp/packer/builder/vsphere/driver" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type Builder struct { config Config runner multistep.Runner } func (b *Builder) ConfigSpec() hcldec.ObjectSpec { return b.config.FlatMapstructure().HCL2Spec() } func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { warnings, errs := b.config.Prepare(raws...) if errs != nil { return nil, warnings, errs } return nil, warnings, nil } func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { state := new(multistep.BasicStateBag) state.Put("debug", b.config.PackerDebug) state.Put("hook", hook) state.Put("ui", ui) var steps []multistep.Step steps = append(steps, &common.StepConnect{ Config: &b.config.ConnectConfig, }, &common.StepDownload{ DownloadStep: &commonsteps.StepDownload{ Checksum: b.config.ISOChecksum, Description: "ISO", Extension: b.config.TargetExtension, ResultKey: "iso_path", TargetPath: b.config.TargetPath, Url: b.config.ISOUrls, }, Url: b.config.ISOUrls, ResultKey: "iso_path", Datastore: b.config.Datastore, Host: b.config.Host, }, &commonsteps.StepCreateCD{ Files: b.config.CDConfig.CDFiles, Label: b.config.CDConfig.CDLabel, }, &common.StepRemoteUpload{ Datastore: b.config.Datastore, Host: b.config.Host, SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, }, &StepCreateVM{ Config: &b.config.CreateConfig, Location: &b.config.LocationConfig, Force: b.config.PackerConfig.PackerForce, }, &common.StepConfigureHardware{ Config: &b.config.HardwareConfig, }, &common.StepAddCDRom{ Config: &b.config.CDRomConfig, }, &common.StepConfigParams{ Config: &b.config.ConfigParamsConfig, }, &commonsteps.StepCreateFloppy{ Files: b.config.FloppyFiles, Directories: b.config.FloppyDirectories, Label: b.config.FloppyLabel, }, &common.StepAddFloppy{ Config: &b.config.FloppyConfig, Datastore: b.config.Datastore, Host: b.config.Host, SetHostForDatastoreUploads: b.config.SetHostForDatastoreUploads, }, &common.StepHTTPIPDiscover{ HTTPIP: b.config.BootConfig.HTTPIP, Network: b.config.WaitIpConfig.GetIPNet(), }, &commonsteps.StepHTTPServer{ HTTPDir: b.config.HTTPDir, HTTPPortMin: b.config.HTTPPortMin, HTTPPortMax: b.config.HTTPPortMax, HTTPAddress: b.config.HTTPAddress, }, &common.StepRun{ Config: &b.config.RunConfig, SetOrder: true, }, &common.StepBootCommand{ Config: &b.config.BootConfig, Ctx: b.config.ctx, VMName: b.config.VMName, }, ) if b.config.Comm.Type != "none" { steps = append(steps, &common.StepWaitForIp{ Config: &b.config.WaitIpConfig, }, &communicator.StepConnect{ Config: &b.config.Comm, Host: common.CommHost(b.config.Comm.Host()), SSHConfig: b.config.Comm.SSHConfigFunc(), }, &commonsteps.StepProvision{}, ) } steps = append(steps, &common.StepShutdown{ Config: &b.config.ShutdownConfig, }, &common.StepRemoveFloppy{ Datastore: b.config.Datastore, Host: b.config.Host, }, &common.StepRemoveCDRom{ Config: &b.config.RemoveCDRomConfig, }, &common.StepCreateSnapshot{ CreateSnapshot: b.config.CreateSnapshot, }, &common.StepConvertToTemplate{ ConvertToTemplate: b.config.ConvertToTemplate, }, ) if b.config.ContentLibraryDestinationConfig != nil { steps = append(steps, &common.StepImportToContentLibrary{ ContentLibConfig: b.config.ContentLibraryDestinationConfig, }) } if b.config.Export != nil { steps = append(steps, &common.StepExport{ Name: b.config.Export.Name, Force: b.config.Export.Force, Images: b.config.Export.Images, Manifest: b.config.Export.Manifest, OutputDir: b.config.Export.OutputDir.OutputDir, Options: b.config.Export.Options, }) } b.runner = commonsteps.NewRunnerWithPauseFn(steps, b.config.PackerConfig, ui, state) b.runner.Run(ctx, state) if rawErr, ok := state.GetOk("error"); ok { return nil, rawErr.(error) } if _, ok := state.GetOk("vm"); !ok { return nil, nil } artifact := &common.Artifact{ Name: b.config.VMName, VM: state.Get("vm").(*driver.VirtualMachineDriver), StateData: map[string]interface{}{"generated_data": state.Get("generated_data")}, } if b.config.Export != nil { artifact.Outconfig = &b.config.Export.OutputDir } return artifact, nil } ������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/builder_acc_test.go��������������������������������������������0000664�0000000�0000000�00000033006�13771713062�0023203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package iso import ( "fmt" "io/ioutil" "os" "testing" commonT "github.com/hashicorp/packer/builder/vsphere/common/testing" builderT "github.com/hashicorp/packer/packer-plugin-sdk/acctest" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi/vim25/types" ) func TestISOBuilderAcc_default(t *testing.T) { config := defaultConfig() builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: commonT.RenderConfig(config), Check: checkDefault(t, config["vm_name"].(string), config["host"].(string), "datastore1"), }) } func defaultConfig() map[string]interface{} { username := os.Getenv("VSPHERE_USERNAME") if username == "" { username = "root" } password := os.Getenv("VSPHERE_PASSWORD") if password == "" { password = "jetbrains" } config := map[string]interface{}{ "vcenter_server": "vcenter.vsphere65.test", "username": username, "password": password, "insecure_connection": true, "host": "esxi-1.vsphere65.test", "ssh_username": "root", "ssh_password": "jetbrains", "vm_name": commonT.NewVMName(), "storage": map[string]interface{}{ "disk_size": 2048, }, "communicator": "none", // do not start the VM without any bootable devices } return config } func checkDefault(t *testing.T, name string, host string, datastore string) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) vmInfo, err := vm.Info("name", "parent", "runtime.host", "resourcePool", "datastore", "layoutEx.disk", "config.firmware") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } if vmInfo.Name != name { t.Errorf("Invalid VM name: expected '%v', got '%v'", name, vmInfo.Name) } f := d.NewFolder(vmInfo.Parent) folderPath, err := f.Path() if err != nil { t.Fatalf("Cannot read folder name: %v", err) } if folderPath != "" { t.Errorf("Invalid folder: expected '/', got '%v'", folderPath) } h := d.NewHost(vmInfo.Runtime.Host) hostInfo, err := h.Info("name") if err != nil { t.Fatal("Cannot read host properties: ", err) } if hostInfo.Name != host { t.Errorf("Invalid host name: expected '%v', got '%v'", host, hostInfo.Name) } p := d.NewResourcePool(vmInfo.ResourcePool) poolPath, err := p.Path() if err != nil { t.Fatalf("Cannot read resource pool name: %v", err) } if poolPath != "" { t.Errorf("Invalid resource pool: expected '/', got '%v'", poolPath) } dsr := vmInfo.Datastore[0].Reference() ds := d.NewDatastore(&dsr) dsInfo, err := ds.Info("name") if err != nil { t.Fatal("Cannot read datastore properties: ", err) } if dsInfo.Name != datastore { t.Errorf("Invalid datastore name: expected '%v', got '%v'", datastore, dsInfo.Name) } fw := vmInfo.Config.Firmware if fw != "bios" { t.Errorf("Invalid firmware: expected 'bios', got '%v'", fw) } return nil } } func TestISOBuilderAcc_notes(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: notesConfig(), Check: checkNotes(t), }) } func notesConfig() string { config := defaultConfig() config["notes"] = "test" return commonT.RenderConfig(config) } func checkNotes(t *testing.T) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) vmInfo, err := vm.Info("config.annotation") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } notes := vmInfo.Config.Annotation if notes != "test" { t.Errorf("notes should be 'test'") } return nil } } func TestISOBuilderAcc_hardware(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: hardwareConfig(), Check: checkHardware(t), }) } func hardwareConfig() string { config := defaultConfig() config["CPUs"] = 2 config["cpu_cores"] = 2 config["CPU_reservation"] = 1000 config["CPU_limit"] = 1500 config["RAM"] = 2048 config["RAM_reservation"] = 1024 config["NestedHV"] = true config["firmware"] = "efi" config["video_ram"] = 8192 return commonT.RenderConfig(config) } func checkHardware(t *testing.T) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) vmInfo, err := vm.Info("config") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } cpuSockets := vmInfo.Config.Hardware.NumCPU if cpuSockets != 2 { t.Errorf("VM should have 2 CPU sockets, got %v", cpuSockets) } cpuCores := vmInfo.Config.Hardware.NumCoresPerSocket if cpuCores != 2 { t.Errorf("VM should have 2 CPU cores per socket, got %v", cpuCores) } cpuReservation := *vmInfo.Config.CpuAllocation.Reservation if cpuReservation != 1000 { t.Errorf("VM should have CPU reservation for 1000 Mhz, got %v", cpuReservation) } cpuLimit := *vmInfo.Config.CpuAllocation.Limit if cpuLimit != 1500 { t.Errorf("VM should have CPU reservation for 1500 Mhz, got %v", cpuLimit) } ram := vmInfo.Config.Hardware.MemoryMB if ram != 2048 { t.Errorf("VM should have 2048 MB of RAM, got %v", ram) } ramReservation := *vmInfo.Config.MemoryAllocation.Reservation if ramReservation != 1024 { t.Errorf("VM should have RAM reservation for 1024 MB, got %v", ramReservation) } nestedHV := vmInfo.Config.NestedHVEnabled if !*nestedHV { t.Errorf("VM should have NestedHV enabled, got %v", nestedHV) } fw := vmInfo.Config.Firmware if fw != "efi" { t.Errorf("Invalid firmware: expected 'efi', got '%v'", fw) } l, err := vm.Devices() if err != nil { t.Fatalf("Cannot read VM devices: %v", err) } c := l.PickController((*types.VirtualIDEController)(nil)) if c == nil { t.Errorf("VM should have IDE controller") } s := l.PickController((*types.VirtualAHCIController)(nil)) if s != nil { t.Errorf("VM should have no SATA controllers") } v := l.SelectByType((*types.VirtualMachineVideoCard)(nil)) if len(v) != 1 { t.Errorf("VM should have one video card") } if v[0].(*types.VirtualMachineVideoCard).VideoRamSizeInKB != 8192 { t.Errorf("Video RAM should be equal 8192") } return nil } } func TestISOBuilderAcc_limit(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: limitConfig(), Check: checkLimit(t), }) } func limitConfig() string { config := defaultConfig() config["CPUs"] = 1 // hardware is customized, but CPU limit is not specified explicitly return commonT.RenderConfig(config) } func checkLimit(t *testing.T) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) vmInfo, err := vm.Info("config.cpuAllocation") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } limit := *vmInfo.Config.CpuAllocation.Limit if limit != -1 { // must be unlimited t.Errorf("Invalid CPU limit: expected '%v', got '%v'", -1, limit) } return nil } } func TestISOBuilderAcc_sata(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: sataConfig(), Check: checkSata(t), }) } func sataConfig() string { config := defaultConfig() config["cdrom_type"] = "sata" return commonT.RenderConfig(config) } func checkSata(t *testing.T) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) l, err := vm.Devices() if err != nil { t.Fatalf("Cannot read VM devices: %v", err) } c := l.PickController((*types.VirtualAHCIController)(nil)) if c == nil { t.Errorf("VM has no SATA controllers") } return nil } } func TestISOBuilderAcc_cdrom(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: cdromConfig(), }) } func cdromConfig() string { config := defaultConfig() config["iso_paths"] = []string{ "[datastore1] test0.iso", "[datastore1] test1.iso", } return commonT.RenderConfig(config) } func TestISOBuilderAcc_networkCard(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: networkCardConfig(), Check: checkNetworkCard(t), }) } func networkCardConfig() string { config := defaultConfig() config["network_adapters"] = map[string]interface{}{ "network_card": "vmxnet3", } return commonT.RenderConfig(config) } func checkNetworkCard(t *testing.T) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) devices, err := vm.Devices() if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } netCards := devices.SelectByType((*types.VirtualEthernetCard)(nil)) if len(netCards) == 0 { t.Fatalf("Cannot find the network card") } if len(netCards) > 1 { t.Fatalf("Found several network catds") } if _, ok := netCards[0].(*types.VirtualVmxnet3); !ok { t.Errorf("The network card type is not the expected one (vmxnet3)") } return nil } } func TestISOBuilderAcc_createFloppy(t *testing.T) { tmpFile, err := ioutil.TempFile("", "packer-vsphere-iso-test") if err != nil { t.Fatalf("Error creating temp file: %v", err) } _, err = fmt.Fprint(tmpFile, "Hello, World!") if err != nil { t.Fatalf("Error creating temp file: %v", err) } err = tmpFile.Close() if err != nil { t.Fatalf("Error creating temp file: %v", err) } builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: createFloppyConfig(tmpFile.Name()), }) } func createFloppyConfig(filePath string) string { config := defaultConfig() config["floppy_files"] = []string{filePath} return commonT.RenderConfig(config) } func TestISOBuilderAcc_full(t *testing.T) { config := fullConfig() builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: commonT.RenderConfig(config), Check: checkFull(t), }) } func fullConfig() map[string]interface{} { username := os.Getenv("VSPHERE_USERNAME") if username == "" { username = "root" } password := os.Getenv("VSPHERE_PASSWORD") if password == "" { password = "jetbrains" } config := map[string]interface{}{ "vcenter_server": "vcenter.vsphere65.test", "username": username, "password": password, "insecure_connection": true, "vm_name": commonT.NewVMName(), "host": "esxi-1.vsphere65.test", "RAM": 512, "disk_controller_type": []string{ "pvscsi", }, "storage": map[string]interface{}{ "disk_size": 1024, "disk_thin_provisioned": true, }, "network_adapters": map[string]interface{}{ "network_card": "vmxnet3", }, "guest_os_type": "other3xLinux64Guest", "iso_paths": []string{ "[datastore1] ISO/alpine-standard-3.8.2-x86_64.iso", }, "floppy_files": []string{ "../examples/alpine/answerfile", "../examples/alpine/setup.sh", }, "boot_wait": "20s", "boot_command": []string{ "root<enter><wait>", "mount -t vfat /dev/fd0 /media/floppy<enter><wait>", "setup-alpine -f /media/floppy/answerfile<enter>", "<wait5>", "jetbrains<enter>", "jetbrains<enter>", "<wait5>", "y<enter>", "<wait10><wait10><wait10><wait10>", "reboot<enter>", "<wait10><wait10><wait10>", "root<enter>", "jetbrains<enter><wait>", "mount -t vfat /dev/fd0 /media/floppy<enter><wait>", "/media/floppy/SETUP.SH<enter>", }, "ssh_username": "root", "ssh_password": "jetbrains", } return config } func checkFull(t *testing.T) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) vmInfo, err := vm.Info("config.bootOptions") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } order := vmInfo.Config.BootOptions.BootOrder if order != nil { t.Errorf("Boot order must be empty") } devices, err := vm.Devices() if err != nil { t.Fatalf("Cannot read devices: %v", err) } cdroms := devices.SelectByType((*types.VirtualCdrom)(nil)) for _, cd := range cdroms { _, ok := cd.(*types.VirtualCdrom).Backing.(*types.VirtualCdromRemotePassthroughBackingInfo) if !ok { t.Errorf("wrong cdrom backing") } } return nil } } func TestISOBuilderAcc_bootOrder(t *testing.T) { config := fullConfig() config["boot_order"] = "disk,cdrom,floppy" builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: commonT.RenderConfig(config), Check: checkBootOrder(t), }) } func checkBootOrder(t *testing.T) builderT.TestCheckFunc { return func(artifacts []packersdk.Artifact) error { d := commonT.TestConn(t) vm := commonT.GetVM(t, d, artifacts) vmInfo, err := vm.Info("config.bootOptions") if err != nil { t.Fatalf("Cannot read VM properties: %v", err) } order := vmInfo.Config.BootOptions.BootOrder if order == nil { t.Errorf("Boot order must not be empty") } return nil } } func TestISOBuilderAcc_cluster(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: clusterConfig(), }) } func clusterConfig() string { config := defaultConfig() config["cluster"] = "cluster1" config["host"] = "esxi-2.vsphere65.test" return commonT.RenderConfig(config) } func TestISOBuilderAcc_clusterDRS(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: clusterDRSConfig(), }) } func clusterDRSConfig() string { config := defaultConfig() config["cluster"] = "cluster2" config["host"] = "" config["datastore"] = "datastore3" // bug #183 config["network_adapters"] = map[string]interface{}{ "network": "VM Network", } return commonT.RenderConfig(config) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/common_test.go�������������������������������������������������0000664�0000000�0000000�00000000552�13771713062�0022237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package iso import ( "bytes" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func basicStateBag() *multistep.BasicStateBag { state := new(multistep.BasicStateBag) state.Put("ui", &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), }) return state } ������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/config.go������������������������������������������������������0000664�0000000�0000000�00000010322�13771713062�0021151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type Config package iso import ( "github.com/hashicorp/packer/builder/vsphere/common" packerCommon "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { packerCommon.PackerConfig `mapstructure:",squash"` commonsteps.HTTPConfig `mapstructure:",squash"` commonsteps.CDConfig `mapstructure:",squash"` common.ConnectConfig `mapstructure:",squash"` CreateConfig `mapstructure:",squash"` common.LocationConfig `mapstructure:",squash"` common.HardwareConfig `mapstructure:",squash"` common.ConfigParamsConfig `mapstructure:",squash"` commonsteps.ISOConfig `mapstructure:",squash"` common.CDRomConfig `mapstructure:",squash"` common.RemoveCDRomConfig `mapstructure:",squash"` common.FloppyConfig `mapstructure:",squash"` common.RunConfig `mapstructure:",squash"` common.BootConfig `mapstructure:",squash"` common.WaitIpConfig `mapstructure:",squash"` Comm communicator.Config `mapstructure:",squash"` common.ShutdownConfig `mapstructure:",squash"` // Create a snapshot when set to `true`, so the VM can be used as a base // for linked clones. Defaults to `false`. CreateSnapshot bool `mapstructure:"create_snapshot"` // Convert VM to a template. Defaults to `false`. ConvertToTemplate bool `mapstructure:"convert_to_template"` // Configuration for exporting VM to an ovf file. // The VM will not be exported if no [Export Configuration](#export-configuration) is specified. Export *common.ExportConfig `mapstructure:"export"` // Configuration for importing the VM template to a Content Library. // The VM template will not be imported if no [Content Library Import Configuration](#content-library-import-configuration) is specified. // The import doesn't work if [convert_to_template](#convert_to_template) is set to true. ContentLibraryDestinationConfig *common.ContentLibraryDestinationConfig `mapstructure:"content_library_destination"` ctx interpolate.Context } func (c *Config) Prepare(raws ...interface{}) ([]string, error) { err := config.Decode(c, &config.DecodeOpts{ PluginType: common.BuilderId, Interpolate: true, InterpolateContext: &c.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "boot_command", }, }, }, raws...) if err != nil { return nil, err } warnings := make([]string, 0) errs := new(packersdk.MultiError) if c.ISOUrls != nil || c.RawSingleISOUrl != "" { isoWarnings, isoErrs := c.ISOConfig.Prepare(&c.ctx) warnings = append(warnings, isoWarnings...) errs = packersdk.MultiErrorAppend(errs, isoErrs...) } errs = packersdk.MultiErrorAppend(errs, c.ConnectConfig.Prepare()...) errs = packersdk.MultiErrorAppend(errs, c.CreateConfig.Prepare()...) errs = packersdk.MultiErrorAppend(errs, c.LocationConfig.Prepare()...) errs = packersdk.MultiErrorAppend(errs, c.HardwareConfig.Prepare()...) errs = packersdk.MultiErrorAppend(errs, c.HTTPConfig.Prepare(&c.ctx)...) errs = packersdk.MultiErrorAppend(errs, c.CDRomConfig.Prepare()...) errs = packersdk.MultiErrorAppend(errs, c.CDConfig.Prepare(&c.ctx)...) errs = packersdk.MultiErrorAppend(errs, c.BootConfig.Prepare(&c.ctx)...) errs = packersdk.MultiErrorAppend(errs, c.WaitIpConfig.Prepare()...) errs = packersdk.MultiErrorAppend(errs, c.Comm.Prepare(&c.ctx)...) shutdownWarnings, shutdownErrs := c.ShutdownConfig.Prepare(c.Comm) warnings = append(warnings, shutdownWarnings...) errs = packersdk.MultiErrorAppend(errs, shutdownErrs...) if c.Export != nil { errs = packersdk.MultiErrorAppend(errs, c.Export.Prepare(&c.ctx, &c.LocationConfig, &c.PackerConfig)...) } if c.ContentLibraryDestinationConfig != nil { errs = packersdk.MultiErrorAppend(errs, c.ContentLibraryDestinationConfig.Prepare(&c.LocationConfig)...) } if len(errs.Errors) > 0 { return warnings, errs } return warnings, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/config.hcl2spec.go���������������������������������������������0000664�0000000�0000000�00000105001�13771713062�0022652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package iso import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/vsphere/common" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` HTTPDir *string `mapstructure:"http_directory" cty:"http_directory" hcl:"http_directory"` HTTPPortMin *int `mapstructure:"http_port_min" cty:"http_port_min" hcl:"http_port_min"` HTTPPortMax *int `mapstructure:"http_port_max" cty:"http_port_max" hcl:"http_port_max"` HTTPAddress *string `mapstructure:"http_bind_address" cty:"http_bind_address" hcl:"http_bind_address"` HTTPInterface *string `mapstructure:"http_interface" undocumented:"true" cty:"http_interface" hcl:"http_interface"` CDFiles []string `mapstructure:"cd_files" cty:"cd_files" hcl:"cd_files"` CDLabel *string `mapstructure:"cd_label" cty:"cd_label" hcl:"cd_label"` VCenterServer *string `mapstructure:"vcenter_server" cty:"vcenter_server" hcl:"vcenter_server"` Username *string `mapstructure:"username" cty:"username" hcl:"username"` Password *string `mapstructure:"password" cty:"password" hcl:"password"` InsecureConnection *bool `mapstructure:"insecure_connection" cty:"insecure_connection" hcl:"insecure_connection"` Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` Version *uint `mapstructure:"vm_version" cty:"vm_version" hcl:"vm_version"` GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` NICs []FlatNIC `mapstructure:"network_adapters" cty:"network_adapters" hcl:"network_adapters"` USBController []string `mapstructure:"usb_controller" cty:"usb_controller" hcl:"usb_controller"` Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` Host *string `mapstructure:"host" cty:"host" hcl:"host"` ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` SetHostForDatastoreUploads *bool `mapstructure:"set_host_for_datastore_uploads" cty:"set_host_for_datastore_uploads" hcl:"set_host_for_datastore_uploads"` CPUs *int32 `mapstructure:"CPUs" cty:"CPUs" hcl:"CPUs"` CpuCores *int32 `mapstructure:"cpu_cores" cty:"cpu_cores" hcl:"cpu_cores"` CPUReservation *int64 `mapstructure:"CPU_reservation" cty:"CPU_reservation" hcl:"CPU_reservation"` CPULimit *int64 `mapstructure:"CPU_limit" cty:"CPU_limit" hcl:"CPU_limit"` CpuHotAddEnabled *bool `mapstructure:"CPU_hot_plug" cty:"CPU_hot_plug" hcl:"CPU_hot_plug"` RAM *int64 `mapstructure:"RAM" cty:"RAM" hcl:"RAM"` RAMReservation *int64 `mapstructure:"RAM_reservation" cty:"RAM_reservation" hcl:"RAM_reservation"` RAMReserveAll *bool `mapstructure:"RAM_reserve_all" cty:"RAM_reserve_all" hcl:"RAM_reserve_all"` MemoryHotAddEnabled *bool `mapstructure:"RAM_hot_plug" cty:"RAM_hot_plug" hcl:"RAM_hot_plug"` VideoRAM *int64 `mapstructure:"video_ram" cty:"video_ram" hcl:"video_ram"` VGPUProfile *string `mapstructure:"vgpu_profile" cty:"vgpu_profile" hcl:"vgpu_profile"` NestedHV *bool `mapstructure:"NestedHV" cty:"NestedHV" hcl:"NestedHV"` Firmware *string `mapstructure:"firmware" cty:"firmware" hcl:"firmware"` ForceBIOSSetup *bool `mapstructure:"force_bios_setup" cty:"force_bios_setup" hcl:"force_bios_setup"` ConfigParams map[string]string `mapstructure:"configuration_parameters" cty:"configuration_parameters" hcl:"configuration_parameters"` ToolsSyncTime *bool `mapstructure:"tools_sync_time" cty:"tools_sync_time" hcl:"tools_sync_time"` ToolsUpgradePolicy *bool `mapstructure:"tools_upgrade_policy" cty:"tools_upgrade_policy" hcl:"tools_upgrade_policy"` ISOChecksum *string `mapstructure:"iso_checksum" required:"true" cty:"iso_checksum" hcl:"iso_checksum"` RawSingleISOUrl *string `mapstructure:"iso_url" required:"true" cty:"iso_url" hcl:"iso_url"` ISOUrls []string `mapstructure:"iso_urls" cty:"iso_urls" hcl:"iso_urls"` TargetPath *string `mapstructure:"iso_target_path" cty:"iso_target_path" hcl:"iso_target_path"` TargetExtension *string `mapstructure:"iso_target_extension" cty:"iso_target_extension" hcl:"iso_target_extension"` CdromType *string `mapstructure:"cdrom_type" cty:"cdrom_type" hcl:"cdrom_type"` ISOPaths []string `mapstructure:"iso_paths" cty:"iso_paths" hcl:"iso_paths"` RemoveCdrom *bool `mapstructure:"remove_cdrom" cty:"remove_cdrom" hcl:"remove_cdrom"` FloppyIMGPath *string `mapstructure:"floppy_img_path" cty:"floppy_img_path" hcl:"floppy_img_path"` FloppyFiles []string `mapstructure:"floppy_files" cty:"floppy_files" hcl:"floppy_files"` FloppyDirectories []string `mapstructure:"floppy_dirs" cty:"floppy_dirs" hcl:"floppy_dirs"` FloppyLabel *string `mapstructure:"floppy_label" cty:"floppy_label" hcl:"floppy_label"` BootOrder *string `mapstructure:"boot_order" cty:"boot_order" hcl:"boot_order"` BootGroupInterval *string `mapstructure:"boot_keygroup_interval" cty:"boot_keygroup_interval" hcl:"boot_keygroup_interval"` BootWait *string `mapstructure:"boot_wait" cty:"boot_wait" hcl:"boot_wait"` BootCommand []string `mapstructure:"boot_command" cty:"boot_command" hcl:"boot_command"` HTTPIP *string `mapstructure:"http_ip" cty:"http_ip" hcl:"http_ip"` WaitTimeout *string `mapstructure:"ip_wait_timeout" cty:"ip_wait_timeout" hcl:"ip_wait_timeout"` SettleTimeout *string `mapstructure:"ip_settle_timeout" cty:"ip_settle_timeout" hcl:"ip_settle_timeout"` WaitAddress *string `mapstructure:"ip_wait_address" cty:"ip_wait_address" hcl:"ip_wait_address"` Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` Command *string `mapstructure:"shutdown_command" cty:"shutdown_command" hcl:"shutdown_command"` Timeout *string `mapstructure:"shutdown_timeout" cty:"shutdown_timeout" hcl:"shutdown_timeout"` DisableShutdown *bool `mapstructure:"disable_shutdown" cty:"disable_shutdown" hcl:"disable_shutdown"` CreateSnapshot *bool `mapstructure:"create_snapshot" cty:"create_snapshot" hcl:"create_snapshot"` ConvertToTemplate *bool `mapstructure:"convert_to_template" cty:"convert_to_template" hcl:"convert_to_template"` Export *common.FlatExportConfig `mapstructure:"export" cty:"export" hcl:"export"` ContentLibraryDestinationConfig *common.FlatContentLibraryDestinationConfig `mapstructure:"content_library_destination" cty:"content_library_destination" hcl:"content_library_destination"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "http_directory": &hcldec.AttrSpec{Name: "http_directory", Type: cty.String, Required: false}, "http_port_min": &hcldec.AttrSpec{Name: "http_port_min", Type: cty.Number, Required: false}, "http_port_max": &hcldec.AttrSpec{Name: "http_port_max", Type: cty.Number, Required: false}, "http_bind_address": &hcldec.AttrSpec{Name: "http_bind_address", Type: cty.String, Required: false}, "http_interface": &hcldec.AttrSpec{Name: "http_interface", Type: cty.String, Required: false}, "cd_files": &hcldec.AttrSpec{Name: "cd_files", Type: cty.List(cty.String), Required: false}, "cd_label": &hcldec.AttrSpec{Name: "cd_label", Type: cty.String, Required: false}, "vcenter_server": &hcldec.AttrSpec{Name: "vcenter_server", Type: cty.String, Required: false}, "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, "insecure_connection": &hcldec.AttrSpec{Name: "insecure_connection", Type: cty.Bool, Required: false}, "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, "vm_version": &hcldec.AttrSpec{Name: "vm_version", Type: cty.Number, Required: false}, "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, "network_adapters": &hcldec.BlockListSpec{TypeName: "network_adapters", Nested: hcldec.ObjectSpec((*FlatNIC)(nil).HCL2Spec())}, "usb_controller": &hcldec.AttrSpec{Name: "usb_controller", Type: cty.List(cty.String), Required: false}, "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, "set_host_for_datastore_uploads": &hcldec.AttrSpec{Name: "set_host_for_datastore_uploads", Type: cty.Bool, Required: false}, "CPUs": &hcldec.AttrSpec{Name: "CPUs", Type: cty.Number, Required: false}, "cpu_cores": &hcldec.AttrSpec{Name: "cpu_cores", Type: cty.Number, Required: false}, "CPU_reservation": &hcldec.AttrSpec{Name: "CPU_reservation", Type: cty.Number, Required: false}, "CPU_limit": &hcldec.AttrSpec{Name: "CPU_limit", Type: cty.Number, Required: false}, "CPU_hot_plug": &hcldec.AttrSpec{Name: "CPU_hot_plug", Type: cty.Bool, Required: false}, "RAM": &hcldec.AttrSpec{Name: "RAM", Type: cty.Number, Required: false}, "RAM_reservation": &hcldec.AttrSpec{Name: "RAM_reservation", Type: cty.Number, Required: false}, "RAM_reserve_all": &hcldec.AttrSpec{Name: "RAM_reserve_all", Type: cty.Bool, Required: false}, "RAM_hot_plug": &hcldec.AttrSpec{Name: "RAM_hot_plug", Type: cty.Bool, Required: false}, "video_ram": &hcldec.AttrSpec{Name: "video_ram", Type: cty.Number, Required: false}, "vgpu_profile": &hcldec.AttrSpec{Name: "vgpu_profile", Type: cty.String, Required: false}, "NestedHV": &hcldec.AttrSpec{Name: "NestedHV", Type: cty.Bool, Required: false}, "firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false}, "force_bios_setup": &hcldec.AttrSpec{Name: "force_bios_setup", Type: cty.Bool, Required: false}, "configuration_parameters": &hcldec.AttrSpec{Name: "configuration_parameters", Type: cty.Map(cty.String), Required: false}, "tools_sync_time": &hcldec.AttrSpec{Name: "tools_sync_time", Type: cty.Bool, Required: false}, "tools_upgrade_policy": &hcldec.AttrSpec{Name: "tools_upgrade_policy", Type: cty.Bool, Required: false}, "iso_checksum": &hcldec.AttrSpec{Name: "iso_checksum", Type: cty.String, Required: false}, "iso_url": &hcldec.AttrSpec{Name: "iso_url", Type: cty.String, Required: false}, "iso_urls": &hcldec.AttrSpec{Name: "iso_urls", Type: cty.List(cty.String), Required: false}, "iso_target_path": &hcldec.AttrSpec{Name: "iso_target_path", Type: cty.String, Required: false}, "iso_target_extension": &hcldec.AttrSpec{Name: "iso_target_extension", Type: cty.String, Required: false}, "cdrom_type": &hcldec.AttrSpec{Name: "cdrom_type", Type: cty.String, Required: false}, "iso_paths": &hcldec.AttrSpec{Name: "iso_paths", Type: cty.List(cty.String), Required: false}, "remove_cdrom": &hcldec.AttrSpec{Name: "remove_cdrom", Type: cty.Bool, Required: false}, "floppy_img_path": &hcldec.AttrSpec{Name: "floppy_img_path", Type: cty.String, Required: false}, "floppy_files": &hcldec.AttrSpec{Name: "floppy_files", Type: cty.List(cty.String), Required: false}, "floppy_dirs": &hcldec.AttrSpec{Name: "floppy_dirs", Type: cty.List(cty.String), Required: false}, "floppy_label": &hcldec.AttrSpec{Name: "floppy_label", Type: cty.String, Required: false}, "boot_order": &hcldec.AttrSpec{Name: "boot_order", Type: cty.String, Required: false}, "boot_keygroup_interval": &hcldec.AttrSpec{Name: "boot_keygroup_interval", Type: cty.String, Required: false}, "boot_wait": &hcldec.AttrSpec{Name: "boot_wait", Type: cty.String, Required: false}, "boot_command": &hcldec.AttrSpec{Name: "boot_command", Type: cty.List(cty.String), Required: false}, "http_ip": &hcldec.AttrSpec{Name: "http_ip", Type: cty.String, Required: false}, "ip_wait_timeout": &hcldec.AttrSpec{Name: "ip_wait_timeout", Type: cty.String, Required: false}, "ip_settle_timeout": &hcldec.AttrSpec{Name: "ip_settle_timeout", Type: cty.String, Required: false}, "ip_wait_address": &hcldec.AttrSpec{Name: "ip_wait_address", Type: cty.String, Required: false}, "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, "shutdown_command": &hcldec.AttrSpec{Name: "shutdown_command", Type: cty.String, Required: false}, "shutdown_timeout": &hcldec.AttrSpec{Name: "shutdown_timeout", Type: cty.String, Required: false}, "disable_shutdown": &hcldec.AttrSpec{Name: "disable_shutdown", Type: cty.Bool, Required: false}, "create_snapshot": &hcldec.AttrSpec{Name: "create_snapshot", Type: cty.Bool, Required: false}, "convert_to_template": &hcldec.AttrSpec{Name: "convert_to_template", Type: cty.Bool, Required: false}, "export": &hcldec.BlockSpec{TypeName: "export", Nested: hcldec.ObjectSpec((*common.FlatExportConfig)(nil).HCL2Spec())}, "content_library_destination": &hcldec.BlockSpec{TypeName: "content_library_destination", Nested: hcldec.ObjectSpec((*common.FlatContentLibraryDestinationConfig)(nil).HCL2Spec())}, } return s } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/step_create.go�������������������������������������������������0000664�0000000�0000000�00000012731�13771713062�0022210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type NIC,CreateConfig package iso import ( "context" "fmt" "path" "github.com/hashicorp/packer/builder/vsphere/common" "github.com/hashicorp/packer/builder/vsphere/driver" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // Defines a Network Adapter // // Example that creates two network adapters: // // In JSON: // ```json // "network_adapters": [ // { // "network": "VM Network", // "network_card": "vmxnet3" // }, // { // "network": "OtherNetwork", // "network_card": "vmxnet3" // } // ], // ``` // In HCL2: // ```hcl // network_adapters { // network = "VM Network" // network_card = "vmxnet3" // } // network_adapters { // network = "OtherNetwork" // network_card = "vmxnet3" // } // ``` type NIC struct { // Set the network in which the VM will be connected to. If no network is // specified, `host` must be specified to allow Packer to look for the // available network. If the network is inside a network folder in vCenter, // you need to provide the full path to the network. Network string `mapstructure:"network"` // Set VM network card type. Example `vmxnet3`. NetworkCard string `mapstructure:"network_card" required:"true"` // Set network card MAC address MacAddress string `mapstructure:"mac_address"` // Enable DirectPath I/O passthrough Passthrough *bool `mapstructure:"passthrough"` } type CreateConfig struct { // Set VM hardware version. Defaults to the most current VM hardware // version supported by vCenter. See // [VMWare article 1003746](https://kb.vmware.com/s/article/1003746) for // the full list of supported VM hardware versions. Version uint `mapstructure:"vm_version"` // Set VM OS type. Defaults to `otherGuest`. See [ // here](https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html) // for a full list of possible values. GuestOSType string `mapstructure:"guest_os_type"` StorageConfig common.StorageConfig `mapstructure:",squash"` // Network adapters NICs []NIC `mapstructure:"network_adapters"` // Create USB controllers for the virtual machine. "usb" for a usb 2.0 controller. "xhci" for a usb 3.0 controller. There can only be at most one of each. USBController []string `mapstructure:"usb_controller"` // VM notes. Notes string `mapstructure:"notes"` } func (c *CreateConfig) Prepare() []error { var errs []error if len(c.StorageConfig.DiskControllerType) == 0 { c.StorageConfig.DiskControllerType = append(c.StorageConfig.DiskControllerType, "") } // there should be at least one if len(c.StorageConfig.Storage) == 0 { errs = append(errs, fmt.Errorf("no storage devices have been defined")) } errs = append(errs, c.StorageConfig.Prepare()...) if c.GuestOSType == "" { c.GuestOSType = "otherGuest" } usbCount := 0 xhciCount := 0 for i, s := range c.USBController { switch s { // 1 and true for backwards compatibility case "usb", "1", "true": usbCount++ case "xhci": xhciCount++ // 0 and false for backwards compatibility case "false", "0": continue default: errs = append(errs, fmt.Errorf("usb_controller[%d] references an unknown usb controller", i)) } } if usbCount > 1 || xhciCount > 1 { errs = append(errs, fmt.Errorf("there can only be one usb controller and one xhci controller")) } return errs } type StepCreateVM struct { Config *CreateConfig Location *common.LocationConfig Force bool } func (s *StepCreateVM) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) d := state.Get("driver").(driver.Driver) vmPath := path.Join(s.Location.Folder, s.Location.VMName) err := d.PreCleanVM(ui, vmPath, s.Force) if err != nil { state.Put("error", err) return multistep.ActionHalt } ui.Say("Creating VM...") // add network/network card an the first nic for backwards compatibility in the type is defined var networkCards []driver.NIC for _, nic := range s.Config.NICs { networkCards = append(networkCards, driver.NIC{ Network: nic.Network, NetworkCard: nic.NetworkCard, MacAddress: nic.MacAddress, Passthrough: nic.Passthrough, }) } // add disk as the first drive for backwards compatibility if the type is defined var disks []driver.Disk for _, disk := range s.Config.StorageConfig.Storage { disks = append(disks, driver.Disk{ DiskSize: disk.DiskSize, DiskEagerlyScrub: disk.DiskEagerlyScrub, DiskThinProvisioned: disk.DiskThinProvisioned, ControllerIndex: disk.DiskControllerIndex, }) } vm, err := d.CreateVM(&driver.CreateConfig{ StorageConfig: driver.StorageConfig{ DiskControllerType: s.Config.StorageConfig.DiskControllerType, Storage: disks, }, Annotation: s.Config.Notes, Name: s.Location.VMName, Folder: s.Location.Folder, Cluster: s.Location.Cluster, Host: s.Location.Host, ResourcePool: s.Location.ResourcePool, Datastore: s.Location.Datastore, GuestOS: s.Config.GuestOSType, NICs: networkCards, USBController: s.Config.USBController, Version: s.Config.Version, }) if err != nil { state.Put("error", fmt.Errorf("error creating vm: %v", err)) return multistep.ActionHalt } state.Put("vm", vm) return multistep.ActionContinue } func (s *StepCreateVM) Cleanup(state multistep.StateBag) { common.CleanupVM(state) } ���������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/step_create.hcl2spec.go����������������������������������������0000664�0000000�0000000�00000007733�13771713062�0023720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type NIC,CreateConfig"; DO NOT EDIT. package iso import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/vsphere/common" "github.com/zclconf/go-cty/cty" ) // FlatCreateConfig is an auto-generated flat version of CreateConfig. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatCreateConfig struct { Version *uint `mapstructure:"vm_version" cty:"vm_version" hcl:"vm_version"` GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` DiskControllerType []string `mapstructure:"disk_controller_type" cty:"disk_controller_type" hcl:"disk_controller_type"` Storage []common.FlatDiskConfig `mapstructure:"storage" cty:"storage" hcl:"storage"` NICs []FlatNIC `mapstructure:"network_adapters" cty:"network_adapters" hcl:"network_adapters"` USBController []string `mapstructure:"usb_controller" cty:"usb_controller" hcl:"usb_controller"` Notes *string `mapstructure:"notes" cty:"notes" hcl:"notes"` } // FlatMapstructure returns a new FlatCreateConfig. // FlatCreateConfig is an auto-generated flat version of CreateConfig. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*CreateConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatCreateConfig) } // HCL2Spec returns the hcl spec of a CreateConfig. // This spec is used by HCL to read the fields of CreateConfig. // The decoded values from this spec will then be applied to a FlatCreateConfig. func (*FlatCreateConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "vm_version": &hcldec.AttrSpec{Name: "vm_version", Type: cty.Number, Required: false}, "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, "disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.List(cty.String), Required: false}, "storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*common.FlatDiskConfig)(nil).HCL2Spec())}, "network_adapters": &hcldec.BlockListSpec{TypeName: "network_adapters", Nested: hcldec.ObjectSpec((*FlatNIC)(nil).HCL2Spec())}, "usb_controller": &hcldec.AttrSpec{Name: "usb_controller", Type: cty.List(cty.String), Required: false}, "notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false}, } return s } // FlatNIC is an auto-generated flat version of NIC. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatNIC struct { Network *string `mapstructure:"network" cty:"network" hcl:"network"` NetworkCard *string `mapstructure:"network_card" required:"true" cty:"network_card" hcl:"network_card"` MacAddress *string `mapstructure:"mac_address" cty:"mac_address" hcl:"mac_address"` Passthrough *bool `mapstructure:"passthrough" cty:"passthrough" hcl:"passthrough"` } // FlatMapstructure returns a new FlatNIC. // FlatNIC is an auto-generated flat version of NIC. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*NIC) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatNIC) } // HCL2Spec returns the hcl spec of a NIC. // This spec is used by HCL to read the fields of NIC. // The decoded values from this spec will then be applied to a FlatNIC. func (*FlatNIC) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, "network_card": &hcldec.AttrSpec{Name: "network_card", Type: cty.String, Required: false}, "mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false}, "passthrough": &hcldec.AttrSpec{Name: "passthrough", Type: cty.Bool, Required: false}, } return s } �������������������������������������packer-1.6.6+ds1/builder/vsphere/iso/step_create_test.go��������������������������������������������0000664�0000000�0000000�00000024677�13771713062�0023263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package iso import ( "context" "errors" "io/ioutil" "path" "strings" "testing" "github.com/google/go-cmp/cmp" "github.com/hashicorp/packer/builder/vsphere/common" "github.com/hashicorp/packer/builder/vsphere/driver" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestCreateConfig_Prepare(t *testing.T) { // Empty config - check defaults config := &CreateConfig{ // Storage is required StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, } if errs := config.Prepare(); len(errs) != 0 { t.Fatalf("Config preprare should not fail: %s", errs[0]) } if config.GuestOSType != "otherGuest" { t.Fatalf("GuestOSType should default to 'otherGuest'") } if len(config.StorageConfig.DiskControllerType) != 1 { t.Fatalf("DiskControllerType should have at least one element as default") } // Data validation tc := []struct { name string config *CreateConfig fail bool expectedErrMsg string }{ { name: "Storage validate disk_size", config: &CreateConfig{ StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 0, DiskThinProvisioned: true, }, }, }, }, fail: true, expectedErrMsg: "storage[0].'disk_size' is required", }, { name: "Storage validate disk_controller_index", config: &CreateConfig{ StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, DiskControllerIndex: 3, }, }, }, }, fail: true, expectedErrMsg: "storage[0].'disk_controller_index' references an unknown disk controller", }, { name: "USBController validate 'usb' and 'xhci' can be set together", config: &CreateConfig{ USBController: []string{"usb", "xhci"}, StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, }, fail: false, }, { name: "USBController validate '1' and '0' can be set together", config: &CreateConfig{ USBController: []string{"1", "0"}, StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, }, fail: false, }, { name: "USBController validate 'true' and 'false' can be set together", config: &CreateConfig{ USBController: []string{"true", "false"}, StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, }, fail: false, }, { name: "USBController validate 'true' and 'usb' cannot be set together", config: &CreateConfig{ USBController: []string{"true", "usb"}, StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, }, fail: true, expectedErrMsg: "there can only be one usb controller and one xhci controller", }, { name: "USBController validate '1' and 'usb' cannot be set together", config: &CreateConfig{ USBController: []string{"1", "usb"}, StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, }, fail: true, expectedErrMsg: "there can only be one usb controller and one xhci controller", }, { name: "USBController validate 'xhci' cannot be set more that once", config: &CreateConfig{ USBController: []string{"xhci", "xhci"}, StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, }, fail: true, expectedErrMsg: "there can only be one usb controller and one xhci controller", }, { name: "USBController validate unknown value cannot be set", config: &CreateConfig{ USBController: []string{"unknown"}, StorageConfig: common.StorageConfig{ Storage: []common.DiskConfig{ { DiskSize: 32768, }, }, }, }, fail: true, expectedErrMsg: "usb_controller[0] references an unknown usb controller", }, } for _, c := range tc { errs := c.config.Prepare() if c.fail { if len(errs) == 0 { t.Fatalf("Config preprare should fail") } if errs[0].Error() != c.expectedErrMsg { t.Fatalf("Expected error message: %s but was '%s'", c.expectedErrMsg, errs[0].Error()) } } else { if len(errs) != 0 { t.Fatalf("Config preprare should not fail: %s", errs[0]) } } } } func TestStepCreateVM_Run(t *testing.T) { state := basicStateBag() driverMock := driver.NewDriverMock() state.Put("driver", driverMock) step := basicStepCreateVM() step.Force = true vmPath := path.Join(step.Location.Folder, step.Location.VMName) if action := step.Run(context.TODO(), state); action == multistep.ActionHalt { t.Fatalf("Should not halt.") } // Pre clean VM if !driverMock.PreCleanVMCalled { t.Fatalf("driver.PreCleanVM should be called.") } if driverMock.PreCleanForce != step.Force { t.Fatalf("Force PreCleanVM should be %t but was %t.", step.Force, driverMock.PreCleanForce) } if driverMock.PreCleanVMPath != vmPath { t.Fatalf("VM path expected to be %s but was %s", vmPath, driverMock.PreCleanVMPath) } if !driverMock.CreateVMCalled { t.Fatalf("driver.CreateVM should be called.") } if diff := cmp.Diff(driverMock.CreateConfig, driverCreateConfig(step.Config, step.Location)); diff != "" { t.Fatalf("wrong driver.CreateConfig: %s", diff) } vm, ok := state.GetOk("vm") if !ok { t.Fatal("state must contain the VM") } if vm != driverMock.VM { t.Fatalf("state doesn't contain the created VM.") } } func TestStepCreateVM_RunHalt(t *testing.T) { state := basicStateBag() step := basicStepCreateVM() // PreCleanVM fails driverMock := driver.NewDriverMock() driverMock.PreCleanShouldFail = true state.Put("driver", driverMock) if action := step.Run(context.TODO(), state); action != multistep.ActionHalt { t.Fatalf("Step should halt.") } if !driverMock.PreCleanVMCalled { t.Fatalf("driver.PreCleanVM should be called") } // CreateVM fails driverMock = driver.NewDriverMock() driverMock.CreateVMShouldFail = true state.Put("driver", driverMock) if action := step.Run(context.TODO(), state); action != multistep.ActionHalt { t.Fatalf("Step should halt.") } if !driverMock.PreCleanVMCalled { t.Fatalf("driver.PreCleanVM should be called") } if !driverMock.CreateVMCalled { t.Fatalf("driver.PreCleanVM should be called") } if _, ok := state.GetOk("vm"); ok { t.Fatal("state should not contain a VM") } } func TestStepCreateVM_Cleanup(t *testing.T) { state := basicStateBag() step := basicStepCreateVM() vm := new(driver.VirtualMachineMock) state.Put("vm", vm) // Clean up when state is cancelled state.Put(multistep.StateCancelled, true) step.Cleanup(state) if !vm.DestroyCalled { t.Fatalf("vm.Destroy should be called") } vm.DestroyCalled = false state.Remove(multistep.StateCancelled) // Clean up when state is halted state.Put(multistep.StateHalted, true) step.Cleanup(state) if !vm.DestroyCalled { t.Fatalf("vm.Destroy should be called") } vm.DestroyCalled = false state.Remove(multistep.StateHalted) // Clean up when state is destroy_vm is set state.Put("destroy_vm", true) step.Cleanup(state) if !vm.DestroyCalled { t.Fatalf("vm.Destroy should be called") } vm.DestroyCalled = false state.Remove("destroy_vm") // Don't clean up if state is not set with previous values step.Cleanup(state) if vm.DestroyCalled { t.Fatalf("vm.Destroy should not be called") } // Destroy fail errorBuffer := &strings.Builder{} ui := &packersdk.BasicUi{ Reader: strings.NewReader(""), Writer: ioutil.Discard, ErrorWriter: errorBuffer, } state.Put("ui", ui) state.Put(multistep.StateCancelled, true) vm.DestroyError = errors.New("destroy failed") step.Cleanup(state) if !vm.DestroyCalled { t.Fatalf("vm.Destroy should be called") } if !strings.Contains(errorBuffer.String(), vm.DestroyError.Error()) { t.Fatalf("Destroy should fail with error message '%s' but failed with '%s'", vm.DestroyError.Error(), errorBuffer.String()) } vm.DestroyCalled = false state.Remove(multistep.StateCancelled) // Should not destroy if VM is not set state.Remove("vm") state.Put(multistep.StateCancelled, true) step.Cleanup(state) if vm.DestroyCalled { t.Fatalf("vm.Destroy should not be called") } } func basicStepCreateVM() *StepCreateVM { step := &StepCreateVM{ Config: createConfig(), Location: basicLocationConfig(), } return step } func basicLocationConfig() *common.LocationConfig { return &common.LocationConfig{ VMName: "test-vm", Folder: "test-folder", Cluster: "test-cluster", Host: "test-host", ResourcePool: "test-resource-pool", Datastore: "test-datastore", } } func createConfig() *CreateConfig { return &CreateConfig{ Version: 1, GuestOSType: "ubuntu64Guest", StorageConfig: common.StorageConfig{ DiskControllerType: []string{"pvscsi"}, Storage: []common.DiskConfig{ { DiskSize: 32768, DiskThinProvisioned: true, }, }, }, NICs: []NIC{ { Network: "VM Network", NetworkCard: "vmxnet3", }, }, } } func driverCreateConfig(config *CreateConfig, location *common.LocationConfig) *driver.CreateConfig { var networkCards []driver.NIC for _, nic := range config.NICs { networkCards = append(networkCards, driver.NIC{ Network: nic.Network, NetworkCard: nic.NetworkCard, MacAddress: nic.MacAddress, Passthrough: nic.Passthrough, }) } var disks []driver.Disk for _, disk := range config.StorageConfig.Storage { disks = append(disks, driver.Disk{ DiskSize: disk.DiskSize, DiskEagerlyScrub: disk.DiskEagerlyScrub, DiskThinProvisioned: disk.DiskThinProvisioned, ControllerIndex: disk.DiskControllerIndex, }) } return &driver.CreateConfig{ StorageConfig: driver.StorageConfig{ DiskControllerType: config.StorageConfig.DiskControllerType, Storage: disks, }, Annotation: config.Notes, Name: location.VMName, Folder: location.Folder, Cluster: location.Cluster, Host: location.Host, ResourcePool: location.ResourcePool, Datastore: location.Datastore, GuestOS: config.GuestOSType, NICs: networkCards, USBController: config.USBController, Version: config.Version, } } �����������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/test/��������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017544�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/test/lab.ovpn������������������������������������������������������0000664�0000000�0000000�00000001571�13771713062�0021212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������dev tun persist-tun persist-key cipher AES-256-CBC ncp-ciphers AES-256-GCM:AES-128-GCM auth SHA1 tls-client client resolv-retry infinite remote 91.132.204.28 2000 tcp-client remote-cert-tls server pkcs12 lab.p12 <tls-auth> # # 2048 bit OpenVPN static key # -----BEGIN OpenVPN Static key V1----- 6c9efab783fc2ee1a558bcedeaf92f8d 85322bc05432fbb00745fcd00bb48857 77cbf0c82462726a848657c56b62f6fd b9b1622c633188e848ce78c1b4476e9f 938338532c79784f36d80156e3b29bcf 493e64c393ee216b776c7a5d62c03aa8 5fc5fea73990612f07660988da133b61 34c847e67f65b8af407ae0b2761de402 49ede990747659a878acaaf8fa1a6201 1aa8ec5aeb01ccf50d1dc6e675dea291 8d4c199c1c126fee9c112ce16c736159 3234d5eaea167f5e60d01ad618fd33bb c262fb3d5227933d6149e45ab0246d58 5f5d66d835fbfc8e8d51e0462194d835 8f66f166ccef5616abba26dd38046a87 9476359e2dc7a5b4dc045e3fbe39d6e6 -----END OpenVPN Static key V1----- </tls-auth> key-direction 1 ���������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/test/lab.p12�������������������������������������������������������0000664�0000000�0000000�00000010055�13771713062�0020627�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������0)0 *H 00  *H  0 |�0 u *H 0 *H  0mOQGE4� HO*=ѓjI�U>Η"oѳG(4I赝IX kmw~?:bDiqj` EFCnB.L)4e>EBMF8nH_*@^$T6�2YXǶljDA/;ceWH"J<d"n5(-8(ۈ<'wZh .iGKpI(أg !Vwsˊ2fk, Wg+޻ 2Rz+w'wFbH:8l"%^lHEUزK7As ~/JP*?A[-wq4J=.#aXu:1#6B WEQ; TI^ { ct9�!.N$&/r:Ju/QlU+^*xuHR*'¼mdfˈG:?|$ZOL&߿7 cP. a^c-?FfHQNgċe%UKU4SC^8 #&ND>2]0dc2޺UR--wrI 'jǟ.EBkgKd pP~#:UVpqiG=evSu\6i8Lw6<?>.}n{!`Ĺ{˟6!/=FA[$b)[9$W =Nm&4z!hث [sވUUZ? 8|)yBÿIMѓ%pRڳY0Ju$qn|<W!AEH;>E K PF(7ro]oM嫞0Oe7Q%SI<(EPG9c 6$�Gc#$Wb%{J4梈%FU;[*{c\.s%Fzof}xQ1TQ4W0GZj'$Ǧ|=b7E�0XBaf, dqa1tI>Zio)+d-Axd(.:iw99_Lf]m{l/# qa:iJh[9kkϯHCt!9mz%[Q&dn#bx'M?:~⴮1#_"fڜzQۖi-<t5;)?,@i@T8.euD#W_ !z(9or0dZnG)�8ݑn%TQ jSqtiOeeƏKPgQ͹-!`q˜.wƬ40a.?߼OYf ­v0]Fr/O�LF P9P62JUxuYי, #ż j$(_ڍVfSPE]Qr{]Lh`d7=ܪbFsdpA0ن&#O}8<m_c[y(Co7H ?280Ehep4CC.ޯ‹FUʤwجs""I[ _RkH,U[_ώ ר5zJڟWsZ*➘_nN'rD+uS-J$FUbڱIӬf^L!aJ\_<voq} b?QQj^D:HwWk/+@Y!jn;0\ʆ{,<7"Hh+d'jā\/p$}0tdgs4͖뗩o27;S]o,^ƛiEx ) TƆ0m wx06$%7L>~XϹgN,:4ՎSil)`[ӯF!6𶆜+h??=Eܜ@=8ab] f99!;TS Z+Nh.Z1 �zq�ծV_!pb[2[ --fL{8{Uv+Yݱl:Uk'n#2 r<w?ŒӚ3NG)�pSxe*:2׎~G\Gl+^*([�/3DE`TnT7 (RwmȒ~W+ܲ|B웖ܒ|z/*h\YVʞL (X:Ae&tP-rWZ-Zhz^Ff1D Lց !}m"z= JsM0ȜLCUfKf$Cftd _De@�5kbcD&+^F- 9BB{7Bd^ϱ-\S0A *H 2.0*0& *H  00 *H  0jp�äÇACå69XR}Q.1J׎:d)a=n{"jTǕOdPwcpx̾{[qEj_^'Ȃ|w w6{X[O䊌m�L2Ԑw&`ubY(H^雈QF'Qr T=hI║ Lb+{#}R/p^uOj)(\쟻#IE 4{od' 19dWͳ^?x?I{EniW{-tΫ{Վpa3HQI{C";ճ{FhmZ*gb.mjK|X<V^לߊ'X }H}t"q1IHŦD7a cҮ8NѻIOd,I�_&dt-)YvFÄ*s*1Ê:b JK7?0풭FqO=JkA�PWdN\.mfFg&L::2t ͩPϼs*?#AΏƒjmM+$:i nU<mbAAl%lFO'+m7Ym±i]^Vq4+f@UN{P?B[e;�Ǩk .x<*KG.X_}#?eǵ_!ґy)6�L ѹ>, ;%ˉ)]5{0Rusnn 8A"Noq Oϡ] s, zjsC,ƥ\arݨ89(3ϕbpAX\6 Oדz=dSg ew]6hD$)}t~. ĥܾF gdQ{K!wWbn&^v$J9rjK�1},bڸDY::iN%޴b}l0;:̤GӅe )+L Ù؍A2~FցB'*̚ iGp7%U+.ah&@=34D3f6vhCw-�*3ե;%_lMWx&1%0# *H  1bٽQŎ;010!0 +�JQMyFdJu%������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/test/test-key.pem��������������������������������������������������0000664�0000000�0000000�00000003213�13771713062�0022013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEA2J9w3cbqMJSDTCUtFW3qRHhqgXbSOW32anqEWQYvW48WKXJm ZmuuSViC0tcAMCnX8pu5YGlAMCi5RBDtdoE9mZzUCfE4Q1Om42S2jKRrSSbhU9Ts 8jTRL0V81Tja64SEt5l1dDHS5sgNJy8C4nWaWob1HT+YloPEllj80ogwoQoL3ufp r5me/TOrA3ApHXewWm0feBkkkuN6NkL1Z9sILCstLrjD+RVEOvI/wrHZEaLpYJ4P LgS8LmTNKaFafmqwgcC4VcA4kVbhxw9X385v+mQLqpiOJa+vS51dT2qINEw+80Y+ HL7k7OIZTLg803wubI3rUZQ/2PX/STBq1zO9RwIDAQABAoIBAAmrDBGJ6Dfk2PtU CXAUaMlHipFeqUFQ7BeSgkeq5AA1IasV5QYbNjslzSj12ZdMtsuoMZzg9bFwj9w+ 2SpZ2FL70ebjsjwnBqLNguxCBlvMdXAVZ8Hjo5Z1hn3JvNOYJYhAPCLEeoI8WYHv MjTDRPFXZqc4iGnnVaXUMOyAkZMOV6sMQzvuJad4x7gvQGRhCgcdnFdGbVs+MZQc WPI6cO6imj27F6rJK3W6s5XcSjDbkpytf2wUuWYgck93Fdm3kYy3ER6B3P/MiM95 qGRmg6OuEYbXAr4ytamjKUThl83SGvDS89N5SIjS5rgrEBgrOFBgMhjG/ibaxbrh c84oplECgYEA+vyI4VUYgce8voYmdDijlM/NwPbCpD3SGiyXIYcDN1i/CUdDhBYh z4982H6I1b2cg+veBWICro9Dp20CpfGtXT6Y3o1yNWkbKlosd+f2Us10fG1gkcyI TiZCYaJPrtdoTT0vMKbdUbkgn0FLNbW1TCh5FQ7K7RXhDonb9BbsTzkCgYEA3PMu bv/MgaET654GAItudazJmh4FfR905w59yVNJfe+7iG/f5zzv7vIpaERvBo245hcu IaO8QbW5OKYuCaNIjGOSd1uxN5ytcOHcf1bmjS+WRQdu/FR5v9BM0BY66NFjqKMb dZLXVZPnU3EOqCKmi9SI2VOVKrDL5XzMOHhL8H8CgYBFJh5wNomx993AgCVID/LB pR8C8vldVsrz+yUIT7JLJWA8pi2rzo0yKk4zN2lrufnNPsbEpOQoQ8BX+GiqX5Ns BTsI1d+JZ5Pcb0uhHX94ALL/NQNOKBPFtDTFwXpCqYZLAXhm5xJC2cZrGgommhGB EgWKD7FI8KY44zJ+ZXJlwQKBgGvw/eFKZI17tPCp3cLMW2VvyXnaatIK2SC8SqVd ZAz7XoG0Lg2ZDpqMgcAnlpn8CLWX43iZtjHf5qIPRXR96cZ0KqzXBcfmajE4lnE7 chzNf7sve4AYgPY9fBk4kwUEroxHSvXwi/SJ8jwogoGPlA/CAC00ES6u+p2dj2OT GX5fAoGBAM6saTeyjAjLDE/vlPM9OButsoj5CJg7DklRgrRuRyygbyRBudafslnl 8e4+4mlXEBwKDnrDTtXFhX1Ur95/w/4GjyFXO/TB/Tmn+vaEBQTzgViKc2cJ/yay ttiF6oJh9EjCaFDTz5P11wX7DajRux/2tUcBXX/C3FcGhNEkVb2P -----END RSA PRIVATE KEY----- �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/test/test-key.pub��������������������������������������������������0000664�0000000�0000000�00000000575�13771713062�0022030�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYn3DdxuowlINMJS0VbepEeGqBdtI5bfZqeoRZBi9bjxYpcmZma65JWILS1wAwKdfym7lgaUAwKLlEEO12gT2ZnNQJ8ThDU6bjZLaMpGtJJuFT1OzyNNEvRXzVONrrhIS3mXV0MdLmyA0nLwLidZpahvUdP5iWg8SWWPzSiDChCgve5+mvmZ79M6sDcCkdd7BabR94GSSS43o2QvVn2wgsKy0uuMP5FUQ68j/CsdkRoulgng8uBLwuZM0poVp+arCBwLhVwDiRVuHHD1ffzm/6ZAuqmI4lr69LnV1Paog0TD7zRj4cvuTs4hlMuDzTfC5sjetRlD/Y9f9JMGrXM71H �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/version/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020252�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/vsphere/version/version.go�������������������������������������������������0000664�0000000�0000000�00000000477�13771713062�0022276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var VSpherePluginVersion *version.PluginVersion func init() { VSpherePluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/��������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016401�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/access_config.go����������������������������������������������������0000664�0000000�0000000�00000004302�13771713062�0021515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package yandex import ( "errors" "fmt" "os" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/yandex-cloud/go-sdk/iamkey" ) const ( defaultEndpoint = "api.cloud.yandex.net:443" defaultMaxRetries = 3 ) // AccessConfig is for common configuration related to Yandex.Cloud API access type AccessConfig struct { // Non standard API endpoint. Default is `api.cloud.yandex.net:443`. Endpoint string `mapstructure:"endpoint" required:"false"` // Path to file with Service Account key in json format. This // is an alternative method to authenticate to Yandex.Cloud. Alternatively you may set environment variable // `YC_SERVICE_ACCOUNT_KEY_FILE`. ServiceAccountKeyFile string `mapstructure:"service_account_key_file" required:"false"` // [OAuth token](https://cloud.yandex.com/docs/iam/concepts/authorization/oauth-token) // or [IAM token](https://cloud.yandex.com/docs/iam/concepts/authorization/iam-token) // to use to authenticate to Yandex.Cloud. Alternatively you may set // value by environment variable `YC_TOKEN`. Token string `mapstructure:"token" required:"true"` // The maximum number of times an API request is being executed. MaxRetries int `mapstructure:"max_retries"` } func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error { var errs []error if c.MaxRetries == 0 { c.MaxRetries = defaultMaxRetries } if c.Endpoint == "" { c.Endpoint = defaultEndpoint } // provision config by OS environment variables if c.Token == "" { c.Token = os.Getenv("YC_TOKEN") } if c.ServiceAccountKeyFile == "" { c.ServiceAccountKeyFile = os.Getenv("YC_SERVICE_ACCOUNT_KEY_FILE") } if c.Token != "" && c.ServiceAccountKeyFile != "" { errs = append(errs, errors.New("one of token or service account key file must be specified, not both")) } if c.Token != "" { packersdk.LogSecretFilter.Set(c.Token) } if c.ServiceAccountKeyFile != "" { if _, err := iamkey.ReadFromJSONFile(c.ServiceAccountKeyFile); err != nil { errs = append(errs, fmt.Errorf("fail to read service account key file: %s", err)) } } if len(errs) > 0 { return errs } return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/artifact.go���������������������������������������������������������0000664�0000000�0000000�00000001765�13771713062�0020536�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "fmt" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ) type Artifact struct { config *Config driver Driver Image *compute.Image // StateData should store data such as GeneratedData // to be shared with post-processors StateData map[string]interface{} } //revive:disable:var-naming func (*Artifact) BuilderId() string { return BuilderID } func (a *Artifact) Id() string { return a.Image.Id } func (*Artifact) Files() []string { return []string{""} } //revive:enable:var-naming func (a *Artifact) String() string { return fmt.Sprintf("A disk image was created: %v (id: %v) with family name %v", a.Image.Name, a.Image.Id, a.Image.Family) } func (a *Artifact) State(name string) interface{} { if _, ok := a.StateData[name]; ok { return a.StateData[name] } switch name { case "ImageID": return a.Image.Id case "FolderID": return a.Image.FolderId } return nil } func (a *Artifact) Destroy() error { return a.driver.DeleteImage(a.Image.Id) } �����������packer-1.6.6+ds1/builder/yandex/artifact_test.go����������������������������������������������������0000664�0000000�0000000�00000003066�13771713062�0021571�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ) func TestArtifact_impl(t *testing.T) { var _ packersdk.Artifact = new(Artifact) } func TestArtifact_Id(t *testing.T) { i := &compute.Image{ Id: "test-id-value", FolderId: "test-folder-id", } a := &Artifact{ Image: i} expected := "test-id-value" if a.Id() != expected { t.Fatalf("artifact ID should match: %v", expected) } } func TestArtifact_String(t *testing.T) { i := &compute.Image{ Id: "test-id-value", FolderId: "test-folder-id", Name: "test-name", Family: "test-family", } a := &Artifact{ Image: i} expected := "A disk image was created: test-name (id: test-id-value) with family name test-family" if a.String() != expected { t.Fatalf("artifact string should match: %v", expected) } } func TestArtifactState(t *testing.T) { expectedData := "this is the data" artifact := &Artifact{ StateData: map[string]interface{}{"state_data": expectedData}, } // Valid state result := artifact.State("state_data") if result != expectedData { t.Fatalf("Bad: State data was %s instead of %s", result, expectedData) } // Invalid state result = artifact.State("invalid_key") if result != nil { t.Fatalf("Bad: State should be nil for invalid state data name") } // Nil StateData should not fail and should return nil artifact = &Artifact{} result = artifact.State("key") if result != nil { t.Fatalf("Bad: State should be nil for nil StateData") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/builder.go����������������������������������������������������������0000664�0000000�0000000�00000006205�13771713062�0020361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "fmt" "github.com/google/uuid" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" "github.com/yandex-cloud/go-sdk/pkg/requestid" ) // The unique ID for this builder. const BuilderID = "packer.yandex" // Builder represents a Packer Builder. type Builder struct { config Config runner multistep.Runner } func (b *Builder) ConfigSpec() hcldec.ObjectSpec { return b.config.FlatMapstructure().HCL2Spec() } func (b *Builder) Prepare(raws ...interface{}) ([]string, []string, error) { warnings, errs := b.config.Prepare(raws...) if errs != nil { return nil, warnings, errs } generatedData := []string{ "ImageID", "ImageName", "ImageFamily", "ImageDescription", "ImageFolderID", "SourceImageID", "SourceImageName", "SourceImageDescription", "SourceImageFamily", "SourceImageFolderID", } return generatedData, warnings, nil } // Run executes a yandex Packer build and returns a packersdk.Artifact // representing a Yandex.Cloud compute image. func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { driver, err := NewDriverYC(ui, &b.config.AccessConfig) ctx = requestid.ContextWithClientTraceID(ctx, uuid.New().String()) if err != nil { return nil, err } // Set up the state state := &multistep.BasicStateBag{} state.Put("config", &b.config) state.Put("driver", driver) state.Put("sdk", driver.SDK()) state.Put("hook", hook) state.Put("ui", ui) generatedData := &packerbuilderdata.GeneratedData{State: state} // Build the steps steps := []multistep.Step{ &StepCreateSSHKey{ Debug: b.config.PackerDebug, DebugKeyPath: fmt.Sprintf("yc_%s.pem", b.config.PackerBuildName), }, &StepCreateInstance{ Debug: b.config.PackerDebug, SerialLogFile: b.config.SerialLogFile, GeneratedData: generatedData, }, &StepInstanceInfo{}, &communicator.StepConnect{ Config: &b.config.Communicator, Host: CommHost, SSHConfig: b.config.Communicator.SSHConfigFunc(), }, &commonsteps.StepProvision{}, &commonsteps.StepCleanupTempKeys{ Comm: &b.config.Communicator, }, &StepTeardownInstance{ SerialLogFile: b.config.SerialLogFile, }, &stepCreateImage{ GeneratedData: generatedData, }, } // Run the steps b.runner = commonsteps.NewRunner(steps, b.config.PackerConfig, ui) b.runner.Run(ctx, state) // Report any errors if rawErr, ok := state.GetOk("error"); ok { return nil, rawErr.(error) } image, ok := state.GetOk("image") if !ok { return nil, fmt.Errorf("Failed to find 'image' in state. Bug?") } artifact := &Artifact{ Image: image.(*compute.Image), config: &b.config, driver: driver, StateData: map[string]interface{}{"generated_data": state.Get("generated_data")}, } return artifact, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/builder_acc_test.go�������������������������������������������������0000664�0000000�0000000�00000003230�13771713062�0022221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "fmt" "os" "testing" "github.com/go-resty/resty/v2" builderT "github.com/hashicorp/packer/packer-plugin-sdk/acctest" ) const InstanceMetadataAddr = "169.254.169.254" func TestBuilderAcc_basic(t *testing.T) { builderT.Test(t, builderT.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Builder: &Builder{}, Template: testBuilderAccBasic, }) } func TestBuilderAcc_instanceSA(t *testing.T) { builderT.Test(t, builderT.TestCase{ PreCheck: func() { testAccPreCheckInstanceSA(t) }, Builder: &Builder{}, Template: testBuilderAccInstanceSA, }) } func testAccPreCheck(t *testing.T) { if v := os.Getenv("YC_TOKEN"); v == "" { t.Fatal("YC_TOKEN must be set for acceptance tests") } if v := os.Getenv("YC_FOLDER_ID"); v == "" { t.Fatal("YC_FOLDER_ID must be set for acceptance tests") } } func testAccPreCheckInstanceSA(t *testing.T) { client := resty.New() _, err := client.R().SetHeader("Metadata-Flavor", "Google").Get(tokenUrl()) if err != nil { t.Fatalf("error get Service Account token assignment: %s", err) } if v := os.Getenv("YC_FOLDER_ID"); v == "" { t.Fatal("YC_FOLDER_ID must be set for acceptance tests") } } const testBuilderAccBasic = ` { "builders": [{ "type": "test", "source_image_family": "ubuntu-1804-lts", "use_ipv4_nat": "true", "ssh_username": "ubuntu" }] } ` const testBuilderAccInstanceSA = ` { "builders": [{ "type": "test", "source_image_family": "ubuntu-1804-lts", "use_ipv4_nat": "true", "ssh_username": "ubuntu" }] } ` func tokenUrl() string { return fmt.Sprintf("http://%s/computeMetadata/v1/instance/service-accounts/default/token", InstanceMetadataAddr) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/builder_test.go�����������������������������������������������������0000664�0000000�0000000�00000000432�13771713062�0021414�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestBuilder_ImplementsBuilder(t *testing.T) { var raw interface{} = &Builder{} if _, ok := raw.(packersdk.Builder); !ok { t.Fatalf("Builder should be a builder") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/cloud_init.go�������������������������������������������������������0000664�0000000�0000000�00000002660�13771713062�0021065�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "bytes" "fmt" "mime/multipart" "net/textproto" "strings" ) const ( defaultContentType = "text/cloud-config" shellContentType = "text/x-shellscript" multipartContentType = "multipart/mixed" ) const ( cloudInitIPv6Config = `#!/usr/bin/env bash dhclient -6 -D LL -nw -pf /run/dhclient_ipv6.eth0.pid -lf /var/lib/dhcp/dhclient_ipv6.eth0.leases eth0 ` ) // MergeCloudUserMetaData allow merge some user-data sections func MergeCloudUserMetaData(usersData ...string) (string, error) { buff := new(bytes.Buffer) data := multipart.NewWriter(buff) _, err := buff.WriteString(fmt.Sprintf("Content-Type: %s; boundary=\"%s\"\r\n", multipartContentType, data.Boundary())) if err != nil { return "", err } _, err = buff.WriteString("MIME-Version: 1.0\r\n\r\n") if err != nil { return "", err } for i, userData := range usersData { w, err := data.CreatePart(textproto.MIMEHeader{ "Content-Disposition": {fmt.Sprintf("attachment; filename=\"user-data-%d\"", i)}, "Content-Type": {detectContentType(userData)}, }) if err != nil { return "", err } _, err = w.Write([]byte(userData)) if err != nil { return "", err } } return buff.String(), nil } func detectContentType(content string) string { switch { case strings.HasPrefix(content, "#!"): return shellContentType case strings.HasPrefix(content, "#cloud-config"): return defaultContentType } return defaultContentType } ��������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/cloud_init_test.go��������������������������������������������������0000664�0000000�0000000�00000001226�13771713062�0022121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "testing" "github.com/stretchr/testify/require" ) const ( data1 = ` #cloud-config bootcmd: - cmd1 - cmd2 ` data2 = ` #cloud-config runcmd: - touch "cmd3" - cmd4 ` data3 = `#!/bin/bash touch /test` ) func TestCloudInitMerge(t *testing.T) { merged, err := MergeCloudUserMetaData( data1, data2, data3, ) require.NoError(t, err) require.NotEmpty(t, merged) require.Contains(t, merged, "cmd1") require.Contains(t, merged, "cmd2") require.Contains(t, merged, "\"cmd3\"") require.Contains(t, merged, "cmd4") require.Contains(t, merged, "text/cloud-config") require.Contains(t, merged, "text/x-shellscript") } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/common_config.go����������������������������������������������������0000664�0000000�0000000�00000017313�13771713062�0021552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package yandex import ( "errors" "fmt" "os" "regexp" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" ) const ( defaultPlatformID = "standard-v2" defaultZone = "ru-central1-a" defaultGpuPlatformID = "gpu-standard-v1" ) var reImageFamily = regexp.MustCompile(`^[a-z]([-a-z0-9]{0,61}[a-z0-9])?$`) type CommonConfig struct { // File path to save serial port output of the launched instance. SerialLogFile string `mapstructure:"serial_log_file" required:"false"` // The time to wait for instance state changes. // Defaults to `5m`. StateTimeout time.Duration `mapstructure:"state_timeout" required:"false"` InstanceConfig `mapstructure:",squash"` DiskConfig `mapstructure:",squash"` NetworkConfig `mapstructure:",squash"` CloudConfig `mapstructure:",squash"` } func (c *CommonConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError { if c.SerialLogFile != "" { if _, err := os.Stat(c.SerialLogFile); os.IsExist(err) { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Serial log file %s already exist", c.SerialLogFile)) } } if c.StateTimeout == 0 { c.StateTimeout = 5 * time.Minute } errs = c.CloudConfig.Prepare(errs) errs = c.InstanceConfig.Prepare(errs) errs = c.DiskConfig.Prepare(errs) errs = c.NetworkConfig.Prepare(errs) return errs } type CloudConfig struct { // The folder ID that will be used to launch instances and store images. // Alternatively you may set value by environment variable `YC_FOLDER_ID`. // To use a different folder for looking up the source image or saving the target image to // check options 'source_image_folder_id' and 'target_image_folder_id'. FolderID string `mapstructure:"folder_id" required:"true"` } func (c *CloudConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError { if c.FolderID == "" { c.FolderID = os.Getenv("YC_FOLDER_ID") } if c.FolderID == "" { errs = packersdk.MultiErrorAppend( errs, errors.New("a folder_id must be specified")) } return errs } type DiskConfig struct { // The name of the disk, if unset the instance name // will be used. DiskName string `mapstructure:"disk_name" required:"false"` // The size of the disk in GB. This defaults to 10/100GB. DiskSizeGb int `mapstructure:"disk_size_gb" required:"false"` // Specify disk type for the launched instance. Defaults to `network-ssd`. DiskType string `mapstructure:"disk_type" required:"false"` // Key/value pair labels to apply to the disk. DiskLabels map[string]string `mapstructure:"disk_labels" required:"false"` } func (c *DiskConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError { if c.DiskSizeGb == 0 { c.DiskSizeGb = 10 } if c.DiskType == "" { c.DiskType = "network-ssd" } return errs } type NetworkConfig struct { // The Yandex VPC subnet id to use for // the launched instance. Note, the zone of the subnet must match the // zone in which the VM is launched. SubnetID string `mapstructure:"subnet_id" required:"false"` // The name of the zone to launch the instance. This defaults to `ru-central1-a`. Zone string `mapstructure:"zone" required:"false"` // If set to true, then launched instance will have external internet // access. UseIPv4Nat bool `mapstructure:"use_ipv4_nat" required:"false"` // Set to true to enable IPv6 for the instance being // created. This defaults to `false`, or not enabled. // // -> **Note**: Usage of IPv6 will be available in the future. UseIPv6 bool `mapstructure:"use_ipv6" required:"false"` // If true, use the instance's internal IP address // instead of its external IP during building. UseInternalIP bool `mapstructure:"use_internal_ip" required:"false"` } func (c *NetworkConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError { if c.Zone == "" { c.Zone = defaultZone } return errs } type ImageConfig struct { // The name of the resulting image, which contains 1-63 characters and only // supports lowercase English characters, numbers and hyphen. Defaults to // `packer-{{timestamp}}`. ImageName string `mapstructure:"image_name" required:"false"` // The description of the image. ImageDescription string `mapstructure:"image_description" required:"false"` // The family name of the image. ImageFamily string `mapstructure:"image_family" required:"false"` // Key/value pair labels to apply to the image. ImageLabels map[string]string `mapstructure:"image_labels" required:"false"` // Minimum size of the disk that will be created from built image, specified in gigabytes. // Should be more or equal to `disk_size_gb`. ImageMinDiskSizeGb int `mapstructure:"image_min_disk_size_gb" required:"false"` // License IDs that indicate which licenses are attached to resulting image. ImageProductIDs []string `mapstructure:"image_product_ids" required:"false"` } func (c *ImageConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError { if len(c.ImageFamily) > 63 { errs = packersdk.MultiErrorAppend(errs, errors.New("Invalid image family: Must not be longer than 63 characters")) } if c.ImageFamily != "" { if !reImageFamily.MatchString(c.ImageFamily) { errs = packersdk.MultiErrorAppend(errs, errors.New("Invalid image family: The first character must be a "+ "lowercase letter, and all following characters must be a dash, "+ "lowercase letter, or digit, except the last character, which cannot be a dash")) } } if c.ImageDescription == "" { c.ImageDescription = "Created by Packer" } if c.ImageName == "" { img, err := interpolate.Render("packer-{{timestamp}}", nil) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Unable to render default image name: %s ", err)) } else { c.ImageName = img } } return errs } type InstanceConfig struct { // The number of cores available to the instance. InstanceCores int `mapstructure:"instance_cores" required:"false"` // The number of GPU available to the instance. InstanceGpus int `mapstructure:"instance_gpus" required:"false"` // The amount of memory available to the instance, specified in gigabytes. InstanceMemory int `mapstructure:"instance_mem_gb" required:"false"` // The name assigned to the instance. InstanceName string `mapstructure:"instance_name" required:"false"` // Identifier of the hardware platform configuration for the instance. This defaults to `standard-v2`. PlatformID string `mapstructure:"platform_id" required:"false"` // Key/value pair labels to apply to the launched instance. Labels map[string]string `mapstructure:"labels" required:"false"` // Metadata applied to the launched instance. Metadata map[string]string `mapstructure:"metadata" required:"false"` // Metadata applied to the launched instance. // The values in this map are the paths to the content files for the corresponding metadata keys. MetadataFromFile map[string]string `mapstructure:"metadata_from_file"` // Launch a preemptible instance. This defaults to `false`. Preemptible bool `mapstructure:"preemptible"` } func (c *InstanceConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError { if c.InstanceCores == 0 { c.InstanceCores = 2 } if c.InstanceMemory == 0 { c.InstanceMemory = 4 } if c.InstanceName == "" { c.InstanceName = fmt.Sprintf("packer-%s", uuid.TimeOrderedUUID()) } for key, file := range c.MetadataFromFile { if _, err := os.Stat(file); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("cannot access file '%s' with content for value of metadata key '%s': %s", file, key, err)) } } if c.PlatformID == "" { c.PlatformID = defaultPlatformID if c.InstanceGpus != 0 { c.PlatformID = defaultGpuPlatformID } } return errs } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/config.go�����������������������������������������������������������0000664�0000000�0000000�00000006447�13771713062�0020210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type Config package yandex import ( "errors" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` Communicator communicator.Config `mapstructure:",squash"` AccessConfig `mapstructure:",squash"` CommonConfig `mapstructure:",squash"` ImageConfig `mapstructure:",squash"` // Service account identifier to assign to instance. ServiceAccountID string `mapstructure:"service_account_id" required:"false"` // The source image family to create the new image // from. You can also specify source_image_id instead. Just one of a source_image_id or // source_image_family must be specified. Example: `ubuntu-1804-lts`. SourceImageFamily string `mapstructure:"source_image_family" required:"true"` // The ID of the folder containing the source image. SourceImageFolderID string `mapstructure:"source_image_folder_id" required:"false"` // The source image ID to use to create the new image from. SourceImageID string `mapstructure:"source_image_id" required:"false"` // The source image name to use to create the new image // from. Name will be looked up in `source_image_folder_id`. SourceImageName string `mapstructure:"source_image_name"` // The ID of the folder to save built image in. // This defaults to value of 'folder_id'. TargetImageFolderID string `mapstructure:"target_image_folder_id" required:"false"` ctx interpolate.Context } func (c *Config) Prepare(raws ...interface{}) ([]string, error) { c.ctx.Funcs = TemplateFuncs err := config.Decode(c, &config.DecodeOpts{ Interpolate: true, InterpolateContext: &c.ctx, }, raws...) if err != nil { return nil, err } // Accumulate any errors var errs *packersdk.MultiError errs = packersdk.MultiErrorAppend(errs, c.AccessConfig.Prepare(&c.ctx)...) errs = c.CommonConfig.Prepare(errs) errs = c.ImageConfig.Prepare(errs) if c.ImageMinDiskSizeGb == 0 { c.ImageMinDiskSizeGb = c.DiskSizeGb } if c.ImageMinDiskSizeGb < c.DiskSizeGb { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Invalid image_min_disk_size value (%d): Must be equal or greate than disk_size_gb (%d)", c.ImageMinDiskSizeGb, c.DiskSizeGb)) } if c.DiskName == "" { c.DiskName = c.InstanceName + "-disk" } if es := c.Communicator.Prepare(&c.ctx); len(es) > 0 { errs = packersdk.MultiErrorAppend(errs, es...) } // Process required parameters. if c.SourceImageID == "" { if c.SourceImageFamily == "" && c.SourceImageName == "" { errs = packersdk.MultiErrorAppend( errs, errors.New("a source_image_name or source_image_family must be specified")) } if c.SourceImageFamily != "" && c.SourceImageName != "" { errs = packersdk.MultiErrorAppend( errs, errors.New("one of source_image_name or source_image_family must be specified, not both")) } } if c.TargetImageFolderID == "" { c.TargetImageFolderID = c.FolderID } // Check for any errors. if errs != nil && len(errs.Errors) > 0 { return nil, errs } return nil, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/config.hcl2spec.go��������������������������������������������������0000664�0000000�0000000�00000056637�13771713062�0021720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package yandex import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` Endpoint *string `mapstructure:"endpoint" required:"false" cty:"endpoint" hcl:"endpoint"` ServiceAccountKeyFile *string `mapstructure:"service_account_key_file" required:"false" cty:"service_account_key_file" hcl:"service_account_key_file"` Token *string `mapstructure:"token" required:"true" cty:"token" hcl:"token"` MaxRetries *int `mapstructure:"max_retries" cty:"max_retries" hcl:"max_retries"` SerialLogFile *string `mapstructure:"serial_log_file" required:"false" cty:"serial_log_file" hcl:"serial_log_file"` StateTimeout *string `mapstructure:"state_timeout" required:"false" cty:"state_timeout" hcl:"state_timeout"` InstanceCores *int `mapstructure:"instance_cores" required:"false" cty:"instance_cores" hcl:"instance_cores"` InstanceGpus *int `mapstructure:"instance_gpus" required:"false" cty:"instance_gpus" hcl:"instance_gpus"` InstanceMemory *int `mapstructure:"instance_mem_gb" required:"false" cty:"instance_mem_gb" hcl:"instance_mem_gb"` InstanceName *string `mapstructure:"instance_name" required:"false" cty:"instance_name" hcl:"instance_name"` PlatformID *string `mapstructure:"platform_id" required:"false" cty:"platform_id" hcl:"platform_id"` Labels map[string]string `mapstructure:"labels" required:"false" cty:"labels" hcl:"labels"` Metadata map[string]string `mapstructure:"metadata" required:"false" cty:"metadata" hcl:"metadata"` MetadataFromFile map[string]string `mapstructure:"metadata_from_file" cty:"metadata_from_file" hcl:"metadata_from_file"` Preemptible *bool `mapstructure:"preemptible" cty:"preemptible" hcl:"preemptible"` DiskName *string `mapstructure:"disk_name" required:"false" cty:"disk_name" hcl:"disk_name"` DiskSizeGb *int `mapstructure:"disk_size_gb" required:"false" cty:"disk_size_gb" hcl:"disk_size_gb"` DiskType *string `mapstructure:"disk_type" required:"false" cty:"disk_type" hcl:"disk_type"` DiskLabels map[string]string `mapstructure:"disk_labels" required:"false" cty:"disk_labels" hcl:"disk_labels"` SubnetID *string `mapstructure:"subnet_id" required:"false" cty:"subnet_id" hcl:"subnet_id"` Zone *string `mapstructure:"zone" required:"false" cty:"zone" hcl:"zone"` UseIPv4Nat *bool `mapstructure:"use_ipv4_nat" required:"false" cty:"use_ipv4_nat" hcl:"use_ipv4_nat"` UseIPv6 *bool `mapstructure:"use_ipv6" required:"false" cty:"use_ipv6" hcl:"use_ipv6"` UseInternalIP *bool `mapstructure:"use_internal_ip" required:"false" cty:"use_internal_ip" hcl:"use_internal_ip"` FolderID *string `mapstructure:"folder_id" required:"true" cty:"folder_id" hcl:"folder_id"` ImageName *string `mapstructure:"image_name" required:"false" cty:"image_name" hcl:"image_name"` ImageDescription *string `mapstructure:"image_description" required:"false" cty:"image_description" hcl:"image_description"` ImageFamily *string `mapstructure:"image_family" required:"false" cty:"image_family" hcl:"image_family"` ImageLabels map[string]string `mapstructure:"image_labels" required:"false" cty:"image_labels" hcl:"image_labels"` ImageMinDiskSizeGb *int `mapstructure:"image_min_disk_size_gb" required:"false" cty:"image_min_disk_size_gb" hcl:"image_min_disk_size_gb"` ImageProductIDs []string `mapstructure:"image_product_ids" required:"false" cty:"image_product_ids" hcl:"image_product_ids"` ServiceAccountID *string `mapstructure:"service_account_id" required:"false" cty:"service_account_id" hcl:"service_account_id"` SourceImageFamily *string `mapstructure:"source_image_family" required:"true" cty:"source_image_family" hcl:"source_image_family"` SourceImageFolderID *string `mapstructure:"source_image_folder_id" required:"false" cty:"source_image_folder_id" hcl:"source_image_folder_id"` SourceImageID *string `mapstructure:"source_image_id" required:"false" cty:"source_image_id" hcl:"source_image_id"` SourceImageName *string `mapstructure:"source_image_name" cty:"source_image_name" hcl:"source_image_name"` TargetImageFolderID *string `mapstructure:"target_image_folder_id" required:"false" cty:"target_image_folder_id" hcl:"target_image_folder_id"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, "endpoint": &hcldec.AttrSpec{Name: "endpoint", Type: cty.String, Required: false}, "service_account_key_file": &hcldec.AttrSpec{Name: "service_account_key_file", Type: cty.String, Required: false}, "token": &hcldec.AttrSpec{Name: "token", Type: cty.String, Required: false}, "max_retries": &hcldec.AttrSpec{Name: "max_retries", Type: cty.Number, Required: false}, "serial_log_file": &hcldec.AttrSpec{Name: "serial_log_file", Type: cty.String, Required: false}, "state_timeout": &hcldec.AttrSpec{Name: "state_timeout", Type: cty.String, Required: false}, "instance_cores": &hcldec.AttrSpec{Name: "instance_cores", Type: cty.Number, Required: false}, "instance_gpus": &hcldec.AttrSpec{Name: "instance_gpus", Type: cty.Number, Required: false}, "instance_mem_gb": &hcldec.AttrSpec{Name: "instance_mem_gb", Type: cty.Number, Required: false}, "instance_name": &hcldec.AttrSpec{Name: "instance_name", Type: cty.String, Required: false}, "platform_id": &hcldec.AttrSpec{Name: "platform_id", Type: cty.String, Required: false}, "labels": &hcldec.AttrSpec{Name: "labels", Type: cty.Map(cty.String), Required: false}, "metadata": &hcldec.AttrSpec{Name: "metadata", Type: cty.Map(cty.String), Required: false}, "metadata_from_file": &hcldec.AttrSpec{Name: "metadata_from_file", Type: cty.Map(cty.String), Required: false}, "preemptible": &hcldec.AttrSpec{Name: "preemptible", Type: cty.Bool, Required: false}, "disk_name": &hcldec.AttrSpec{Name: "disk_name", Type: cty.String, Required: false}, "disk_size_gb": &hcldec.AttrSpec{Name: "disk_size_gb", Type: cty.Number, Required: false}, "disk_type": &hcldec.AttrSpec{Name: "disk_type", Type: cty.String, Required: false}, "disk_labels": &hcldec.AttrSpec{Name: "disk_labels", Type: cty.Map(cty.String), Required: false}, "subnet_id": &hcldec.AttrSpec{Name: "subnet_id", Type: cty.String, Required: false}, "zone": &hcldec.AttrSpec{Name: "zone", Type: cty.String, Required: false}, "use_ipv4_nat": &hcldec.AttrSpec{Name: "use_ipv4_nat", Type: cty.Bool, Required: false}, "use_ipv6": &hcldec.AttrSpec{Name: "use_ipv6", Type: cty.Bool, Required: false}, "use_internal_ip": &hcldec.AttrSpec{Name: "use_internal_ip", Type: cty.Bool, Required: false}, "folder_id": &hcldec.AttrSpec{Name: "folder_id", Type: cty.String, Required: false}, "image_name": &hcldec.AttrSpec{Name: "image_name", Type: cty.String, Required: false}, "image_description": &hcldec.AttrSpec{Name: "image_description", Type: cty.String, Required: false}, "image_family": &hcldec.AttrSpec{Name: "image_family", Type: cty.String, Required: false}, "image_labels": &hcldec.AttrSpec{Name: "image_labels", Type: cty.Map(cty.String), Required: false}, "image_min_disk_size_gb": &hcldec.AttrSpec{Name: "image_min_disk_size_gb", Type: cty.Number, Required: false}, "image_product_ids": &hcldec.AttrSpec{Name: "image_product_ids", Type: cty.List(cty.String), Required: false}, "service_account_id": &hcldec.AttrSpec{Name: "service_account_id", Type: cty.String, Required: false}, "source_image_family": &hcldec.AttrSpec{Name: "source_image_family", Type: cty.String, Required: false}, "source_image_folder_id": &hcldec.AttrSpec{Name: "source_image_folder_id", Type: cty.String, Required: false}, "source_image_id": &hcldec.AttrSpec{Name: "source_image_id", Type: cty.String, Required: false}, "source_image_name": &hcldec.AttrSpec{Name: "source_image_name", Type: cty.String, Required: false}, "target_image_folder_id": &hcldec.AttrSpec{Name: "target_image_folder_id", Type: cty.String, Required: false}, } return s } �������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/config_test.go������������������������������������������������������0000664�0000000�0000000�00000013170�13771713062�0021236�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "io/ioutil" "os" "strings" "testing" "github.com/stretchr/testify/require" ) const TestServiceAccountKeyFile = "./testdata/fake-sa-key.json" func TestConfigPrepare(t *testing.T) { tf, err := ioutil.TempFile("", "packer") require.NoError(t, err, "create temporary file failed") defer os.Remove(tf.Name()) tf.Close() cases := []struct { Key string Value interface{} Err bool }{ { "unknown_key", "bad", true, }, { "service_account_key_file", "/tmp/i/should/not/exist", true, }, { "service_account_key_file", tf.Name(), true, }, { "service_account_key_file", TestServiceAccountKeyFile, false, }, { "folder_id", nil, true, }, { "folder_id", "foo", false, }, { "source_image_id", nil, true, }, { "source_image_id", "foo", false, }, { "source_image_family", nil, false, }, { "source_image_family", "foo", false, }, { "zone", nil, false, }, { "zone", "foo", false, }, { "ssh_timeout", "SO BAD", true, }, { "ssh_timeout", "5s", false, }, { "image_family", nil, false, }, { "image_family", "", false, }, { "image_family", "foo-bar", false, }, { "image_family", "foo bar", true, }, } for _, tc := range cases { raw := testConfig(t) if tc.Value == nil { delete(raw, tc.Key) } else { raw[tc.Key] = tc.Value } if tc.Key == "service_account_key_file" { delete(raw, "token") } var c Config warns, errs := c.Prepare(raw) if tc.Err { testConfigErr(t, warns, errs, tc.Key) } else { testConfigOk(t, warns, errs) } } } func TestConfigPrepareStartupScriptFile(t *testing.T) { config := testConfig(t) config["metadata"] = map[string]string{ "key": "value", } config["metadata_from_file"] = map[string]string{ "key": "file_not_exist", } var c Config _, errs := c.Prepare(config) if errs == nil || !strings.Contains(errs.Error(), "cannot access file 'file_not_exist' with content "+ "for value of metadata key 'key':") { t.Fatalf("should error: metadata_from_file") } } func TestConfigImageMinDiskSize(t *testing.T) { cases := []struct { Name string Config map[string]interface{} Err bool }{ { Name: "image_min_disk_size lower than disk_size (default value)", Config: map[string]interface{}{ "image_min_disk_size_gb": 2, }, Err: true, }, { Name: "image_min_disk_size greater than disk_size (default value)", Config: map[string]interface{}{ "image_min_disk_size_gb": 20, }, Err: false, }, { Name: "image_min_disk_size lower than disk_size (custom value)", Config: map[string]interface{}{ "disk_size_gb": 50, "image_min_disk_size_gb": 20, }, Err: true, }, { Name: "image_min_disk_size greate than disk_size (custom value)", Config: map[string]interface{}{ "disk_size_gb": 50, "image_min_disk_size_gb": 55, }, Err: false, }, } for _, tc := range cases { raw := testConfig(t) for k, v := range tc.Config { raw[k] = v } var c Config warns, errs := c.Prepare(raw) if tc.Err { testConfigErr(t, warns, errs, tc.Name) } else { testConfigOk(t, warns, errs) } } } func TestConfigDefaults(t *testing.T) { cases := []struct { Read func(c *Config) interface{} Value interface{} }{ { func(c *Config) interface{} { return c.Communicator.Type }, "ssh", }, { func(c *Config) interface{} { return c.Communicator.SSHPort }, 22, }, { func(c *Config) interface{} { return c.TargetImageFolderID }, "hashicorp", }, } for _, tc := range cases { raw := testConfig(t) var c Config warns, errs := c.Prepare(raw) testConfigOk(t, warns, errs) actual := tc.Read(&c) if actual != tc.Value { t.Fatalf("bad: %#v", actual) } } } func TestImageName(t *testing.T) { raw := testConfig(t) var c Config c.Prepare(raw) if !strings.HasPrefix(c.ImageName, "packer-") { t.Fatalf("ImageName should have 'packer-' prefix, found %s", c.ImageName) } if strings.Contains(c.ImageName, "{{timestamp}}") { t.Errorf("ImageName should be interpolated; found %s", c.ImageName) } } func TestZone(t *testing.T) { raw := testConfig(t) var c Config c.Prepare(raw) if c.Zone != "ru-central1-a" { t.Fatalf("Zone should be 'ru-central1-a' given, but is '%s'", c.Zone) } } func TestGpuDefaultPlatformID(t *testing.T) { raw := testConfig(t) raw["instance_gpus"] = 1 var c Config c.Prepare(raw) if c.PlatformID != "gpu-standard-v1" { t.Fatalf("expected 'gpu-standard-v1' as default platform_id for instance with GPU(s), but got '%s'", c.PlatformID) } } // Helper stuff below func testConfig(t *testing.T) (config map[string]interface{}) { config = map[string]interface{}{ "token": "test_token", "folder_id": "hashicorp", "source_image_id": "foo", "ssh_username": "root", "image_family": "bar", "image_product_ids": []string{ "test-license", }, "zone": "ru-central1-a", } return config } func testConfigStruct(t *testing.T) *Config { raw := testConfig(t) var c Config warns, errs := c.Prepare(raw) require.True(t, len(warns) == 0, "bad: %#v", warns) require.NoError(t, errs, "should not have error: %s", errs) return &c } func testConfigErr(t *testing.T, warns []string, err error, extra string) { if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err == nil { t.Fatalf("should error: %s", extra) } } func testConfigOk(t *testing.T, warns []string, err error) { if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err != nil { t.Fatalf("bad: %s", err) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/driver.go�����������������������������������������������������������0000664�0000000�0000000�00000001275�13771713062�0020230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" ycsdk "github.com/yandex-cloud/go-sdk" ) type Driver interface { DeleteImage(id string) error SDK() *ycsdk.SDK GetImage(imageID string) (*Image, error) GetImageFromFolder(ctx context.Context, folderID string, family string) (*Image, error) GetImageFromFolderByName(ctx context.Context, folderID string, name string) (*Image, error) DeleteDisk(ctx context.Context, diskID string) error DeleteInstance(ctx context.Context, instanceID string) error DeleteSubnet(ctx context.Context, subnetID string) error DeleteNetwork(ctx context.Context, networkID string) error GetInstanceMetadata(ctx context.Context, instanceID string, key string) (string, error) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/driver_yc.go��������������������������������������������������������0000664�0000000�0000000�00000015145�13771713062�0020724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "fmt" "log" "strings" "time" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/useragent" "google.golang.org/grpc" "google.golang.org/grpc/codes" "github.com/hashicorp/packer/builder/yandex/version" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" "github.com/yandex-cloud/go-genproto/yandex/cloud/endpoint" "github.com/yandex-cloud/go-genproto/yandex/cloud/vpc/v1" ycsdk "github.com/yandex-cloud/go-sdk" "github.com/yandex-cloud/go-sdk/iamkey" "github.com/yandex-cloud/go-sdk/pkg/requestid" "github.com/yandex-cloud/go-sdk/pkg/retry" "github.com/yandex-cloud/go-sdk/sdkresolvers" ) const ( defaultExponentialBackoffBase = 50 * time.Millisecond defaultExponentialBackoffCap = 1 * time.Minute ) type driverYC struct { sdk *ycsdk.SDK ui packersdk.Ui } func NewDriverYC(ui packersdk.Ui, ac *AccessConfig) (Driver, error) { log.Printf("[INFO] Initialize Yandex.Cloud client...") sdkConfig := ycsdk.Config{} if ac.Endpoint != "" { sdkConfig.Endpoint = ac.Endpoint } switch { case ac.Token == "" && ac.ServiceAccountKeyFile == "": log.Printf("[INFO] Use Instance Service Account for authentication") sdkConfig.Credentials = ycsdk.InstanceServiceAccount() case ac.Token != "": if strings.HasPrefix(ac.Token, "t1.") && strings.Count(ac.Token, ".") == 2 { log.Printf("[INFO] Use IAM token for authentication") sdkConfig.Credentials = ycsdk.NewIAMTokenCredentials(ac.Token) } else { log.Printf("[INFO] Use OAuth token for authentication") sdkConfig.Credentials = ycsdk.OAuthToken(ac.Token) } case ac.ServiceAccountKeyFile != "": log.Printf("[INFO] Use Service Account key file %q for authentication", ac.ServiceAccountKeyFile) key, err := iamkey.ReadFromJSONFile(ac.ServiceAccountKeyFile) if err != nil { return nil, err } credentials, err := ycsdk.ServiceAccountKey(key) if err != nil { return nil, err } sdkConfig.Credentials = credentials } requestIDInterceptor := requestid.Interceptor() retryInterceptor := retry.Interceptor( retry.WithMax(ac.MaxRetries), retry.WithCodes(codes.Unavailable), retry.WithAttemptHeader(true), retry.WithBackoff(retry.BackoffExponentialWithJitter(defaultExponentialBackoffBase, defaultExponentialBackoffCap))) // Make sure retry interceptor is above id interceptor. // Now we will have new request id for every retry attempt. interceptorChain := grpc_middleware.ChainUnaryClient(retryInterceptor, requestIDInterceptor) sdk, err := ycsdk.Build(context.Background(), sdkConfig, grpc.WithUserAgent(useragent.String(version.YandexPluginVersion.FormattedVersion())), grpc.WithUnaryInterceptor(interceptorChain), ) if err != nil { return nil, err } if _, err = sdk.ApiEndpoint().ApiEndpoint().List(context.Background(), &endpoint.ListApiEndpointsRequest{}); err != nil { return nil, err } return &driverYC{ sdk: sdk, ui: ui, }, nil } func (d *driverYC) GetImage(imageID string) (*Image, error) { image, err := d.sdk.Compute().Image().Get(context.Background(), &compute.GetImageRequest{ ImageId: imageID, }) if err != nil { return nil, err } return &Image{ ID: image.Id, Labels: image.Labels, Licenses: image.ProductIds, Name: image.Name, Description: image.Description, FolderID: image.FolderId, MinDiskSizeGb: toGigabytes(image.MinDiskSize), SizeGb: toGigabytes(image.StorageSize), }, nil } func (d *driverYC) GetImageFromFolder(ctx context.Context, folderID string, family string) (*Image, error) { image, err := d.sdk.Compute().Image().GetLatestByFamily(ctx, &compute.GetImageLatestByFamilyRequest{ FolderId: folderID, Family: family, }) if err != nil { return nil, err } return &Image{ ID: image.Id, Labels: image.Labels, Licenses: image.ProductIds, Name: image.Name, Description: image.Description, FolderID: image.FolderId, Family: image.Family, MinDiskSizeGb: toGigabytes(image.MinDiskSize), SizeGb: toGigabytes(image.StorageSize), }, nil } func (d *driverYC) GetImageFromFolderByName(ctx context.Context, folderID string, imageName string) (*Image, error) { imageResolver := sdkresolvers.ImageResolver(imageName, sdkresolvers.FolderID(folderID)) if err := d.sdk.Resolve(ctx, imageResolver); err != nil { return nil, fmt.Errorf("failed to resolve image name: %s", err) } return d.GetImage(imageResolver.ID()) } func (d *driverYC) DeleteImage(ID string) error { ctx := context.TODO() op, err := d.sdk.WrapOperation(d.sdk.Compute().Image().Delete(ctx, &compute.DeleteImageRequest{ ImageId: ID, })) if err != nil { return err } err = op.Wait(ctx) if err != nil { return err } _, err = op.Response() return err } func (d *driverYC) SDK() *ycsdk.SDK { return d.sdk } func (d *driverYC) DeleteInstance(ctx context.Context, instanceID string) error { op, err := d.sdk.WrapOperation(d.sdk.Compute().Instance().Delete(ctx, &compute.DeleteInstanceRequest{ InstanceId: instanceID, })) if err != nil { return err } err = op.Wait(ctx) if err != nil { return err } _, err = op.Response() return err } func (d *driverYC) DeleteSubnet(ctx context.Context, subnetID string) error { op, err := d.sdk.WrapOperation(d.sdk.VPC().Subnet().Delete(ctx, &vpc.DeleteSubnetRequest{ SubnetId: subnetID, })) if err != nil { return err } err = op.Wait(ctx) if err != nil { return err } _, err = op.Response() return err } func (d *driverYC) DeleteNetwork(ctx context.Context, networkID string) error { op, err := d.sdk.WrapOperation(d.sdk.VPC().Network().Delete(ctx, &vpc.DeleteNetworkRequest{ NetworkId: networkID, })) if err != nil { return err } err = op.Wait(ctx) if err != nil { return err } _, err = op.Response() return err } func (d *driverYC) DeleteDisk(ctx context.Context, diskID string) error { op, err := d.sdk.WrapOperation(d.sdk.Compute().Disk().Delete(ctx, &compute.DeleteDiskRequest{ DiskId: diskID, })) if err != nil { return err } err = op.Wait(ctx) if err != nil { return err } _, err = op.Response() return err } func (d *driverYC) GetInstanceMetadata(ctx context.Context, instanceID string, key string) (string, error) { instance, err := d.sdk.Compute().Instance().Get(ctx, &compute.GetInstanceRequest{ InstanceId: instanceID, View: compute.InstanceView_FULL, }) if err != nil { return "", err } for k, v := range instance.GetMetadata() { if k == key { return v, nil } } return "", fmt.Errorf("Instance metadata key, %s, not found.", key) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/image.go������������������������������������������������������������0000664�0000000�0000000�00000000363�13771713062�0020014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex type Image struct { ID string FolderID string Labels map[string]string Licenses []string MinDiskSizeGb int Name string Description string Family string SizeGb int } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/ssh.go��������������������������������������������������������������0000664�0000000�0000000�00000000332�13771713062�0017523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "github.com/hashicorp/packer/packer-plugin-sdk/multistep" ) func CommHost(state multistep.StateBag) (string, error) { ipAddress := state.Get("instance_ip").(string) return ipAddress, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/step_create_image.go������������������������������������������������0000664�0000000�0000000�00000004741�13771713062�0022376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "errors" "fmt" "log" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ycsdk "github.com/yandex-cloud/go-sdk" ) type stepCreateImage struct { GeneratedData *packerbuilderdata.GeneratedData } func (s *stepCreateImage) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { sdk := state.Get("sdk").(*ycsdk.SDK) ui := state.Get("ui").(packersdk.Ui) c := state.Get("config").(*Config) diskID := state.Get("disk_id").(string) ui.Say(fmt.Sprintf("Creating image: %v", c.ImageName)) ctx, cancel := context.WithTimeout(ctx, c.StateTimeout) defer cancel() op, err := sdk.WrapOperation(sdk.Compute().Image().Create(ctx, &compute.CreateImageRequest{ FolderId: c.TargetImageFolderID, Name: c.ImageName, Family: c.ImageFamily, Description: c.ImageDescription, Labels: c.ImageLabels, MinDiskSize: toBytes(c.ImageMinDiskSizeGb), ProductIds: c.ImageProductIDs, Source: &compute.CreateImageRequest_DiskId{ DiskId: diskID, }, })) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error creating image: %s", err)) } ui.Say("Waiting for image to complete...") if err := op.Wait(ctx); err != nil { return StepHaltWithError(state, fmt.Errorf("Error waiting for image: %s", err)) } resp, err := op.Response() if err != nil { return StepHaltWithError(state, err) } image, ok := resp.(*compute.Image) if !ok { return StepHaltWithError(state, errors.New("API call response doesn't contain Compute Image")) } log.Printf("Image ID: %s", image.Id) log.Printf("Image Name: %s", image.Name) log.Printf("Image Family: %s", image.Family) log.Printf("Image Description: %s", image.Description) log.Printf("Image Storage size: %d", image.StorageSize) state.Put("image", image) // provision generated_data from declared in Builder.Prepare func // see doc https://www.packer.io/docs/extending/custom-builders#build-variables for details s.GeneratedData.Put("ImageID", image.Id) s.GeneratedData.Put("ImageName", image.Name) s.GeneratedData.Put("ImageFamily", image.Family) s.GeneratedData.Put("ImageDescription", image.Description) s.GeneratedData.Put("ImageFolderID", image.FolderId) return multistep.ActionContinue } func (stepCreateImage) Cleanup(state multistep.StateBag) { // no cleanup } �������������������������������packer-1.6.6+ds1/builder/yandex/step_create_instance.go���������������������������������������������0000664�0000000�0000000�00000027610�13771713062�0023120�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "errors" "fmt" "io/ioutil" "github.com/c2h5oh/datasize" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" "github.com/yandex-cloud/go-genproto/yandex/cloud/vpc/v1" ycsdk "github.com/yandex-cloud/go-sdk" ) const StandardImagesFolderID = "standard-images" type StepCreateInstance struct { Debug bool SerialLogFile string GeneratedData *packerbuilderdata.GeneratedData } func createNetwork(ctx context.Context, c *Config, d Driver) (*vpc.Network, error) { req := &vpc.CreateNetworkRequest{ FolderId: c.FolderID, Name: fmt.Sprintf("packer-network-%s", uuid.TimeOrderedUUID()), } sdk := d.SDK() op, err := sdk.WrapOperation(sdk.VPC().Network().Create(ctx, req)) if err != nil { return nil, err } err = op.Wait(ctx) if err != nil { return nil, err } resp, err := op.Response() if err != nil { return nil, err } network, ok := resp.(*vpc.Network) if !ok { return nil, errors.New("network create operation response doesn't contain Network") } return network, nil } func createDisk(ctx context.Context, state multistep.StateBag, c *Config, d Driver, sourceImage *Image) (*compute.Disk, error) { req := &compute.CreateDiskRequest{ Name: c.DiskName, FolderId: c.FolderID, TypeId: c.DiskType, Labels: c.DiskLabels, ZoneId: c.Zone, Size: int64((datasize.ByteSize(c.DiskSizeGb) * datasize.GB).Bytes()), Source: &compute.CreateDiskRequest_ImageId{ ImageId: sourceImage.ID, }, } sdk := d.SDK() op, err := sdk.WrapOperation(sdk.Compute().Disk().Create(ctx, req)) if err != nil { return nil, err } protoMD, err := op.Metadata() if err != nil { return nil, err } md, ok := protoMD.(*compute.CreateDiskMetadata) if !ok { return nil, fmt.Errorf("could not get Instance ID from create operation metadata") } state.Put("disk_id", md.DiskId) err = op.Wait(ctx) if err != nil { return nil, err } resp, err := op.Response() if err != nil { return nil, err } disk, ok := resp.(*compute.Disk) if !ok { return nil, errors.New("disk create operation response doesn't contain Disk") } return disk, nil } func createSubnet(ctx context.Context, c *Config, d Driver, networkID string) (*vpc.Subnet, error) { req := &vpc.CreateSubnetRequest{ FolderId: c.FolderID, NetworkId: networkID, Name: fmt.Sprintf("packer-subnet-%s", uuid.TimeOrderedUUID()), ZoneId: c.Zone, V4CidrBlocks: []string{"192.168.111.0/24"}, } sdk := d.SDK() op, err := sdk.WrapOperation(sdk.VPC().Subnet().Create(ctx, req)) if err != nil { return nil, err } err = op.Wait(ctx) if err != nil { return nil, err } resp, err := op.Response() if err != nil { return nil, err } subnet, ok := resp.(*vpc.Subnet) if !ok { return nil, errors.New("subnet create operation response doesn't contain Subnet") } return subnet, nil } func getImage(ctx context.Context, c *Config, d Driver) (*Image, error) { if c.SourceImageID != "" { return d.GetImage(c.SourceImageID) } folderID := c.SourceImageFolderID if folderID == "" { folderID = StandardImagesFolderID } switch { case c.SourceImageFamily != "": return d.GetImageFromFolder(ctx, folderID, c.SourceImageFamily) case c.SourceImageName != "": return d.GetImageFromFolderByName(ctx, folderID, c.SourceImageName) } return &Image{}, errors.New("neither source_image_name nor source_image_family defined in config") } func (s *StepCreateInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { sdk := state.Get("sdk").(*ycsdk.SDK) ui := state.Get("ui").(packersdk.Ui) config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ctx, cancel := context.WithTimeout(ctx, config.StateTimeout) defer cancel() sourceImage, err := getImage(ctx, config, driver) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error getting source image for instance creation: %s", err)) } if sourceImage.MinDiskSizeGb > config.DiskSizeGb { return StepHaltWithError(state, fmt.Errorf("Instance DiskSizeGb (%d) should be equal or greater "+ "than SourceImage disk requirement (%d)", config.DiskSizeGb, sourceImage.MinDiskSizeGb)) } ui.Say(fmt.Sprintf("Using as source image: %s (name: %q, family: %q)", sourceImage.ID, sourceImage.Name, sourceImage.Family)) // create or reuse network configuration instanceSubnetID := "" if config.SubnetID == "" { // create Network and Subnet ui.Say("Creating network...") network, err := createNetwork(ctx, config, driver) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error creating network: %s", err)) } state.Put("network_id", network.Id) ui.Say(fmt.Sprintf("Creating subnet in zone %q...", config.Zone)) subnet, err := createSubnet(ctx, config, driver, network.Id) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error creating subnet: %s", err)) } instanceSubnetID = subnet.Id // save for cleanup state.Put("subnet_id", subnet.Id) } else { ui.Say("Use provided subnet id " + config.SubnetID) instanceSubnetID = config.SubnetID } // Create a disk manually to have a delete ID ui.Say("Creating disk...") disk, err := createDisk(ctx, state, config, driver, sourceImage) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error creating disk: %s", err)) } // Create an instance based on the configuration ui.Say("Creating instance...") instanceMetadata, err := config.createInstanceMetadata(string(config.Communicator.SSHPublicKey)) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error preparing instance metadata: %s", err)) } if config.UseIPv6 { ui.Say("Prepare user-data...") oldUserData, ok := instanceMetadata["user-data"] if !ok { oldUserData = "" } instanceMetadata["user-data"], err = MergeCloudUserMetaData(cloudInitIPv6Config, oldUserData) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error merge user data configs: %s", err)) } } req := &compute.CreateInstanceRequest{ FolderId: config.FolderID, Name: config.InstanceName, Labels: config.Labels, ZoneId: config.Zone, PlatformId: config.PlatformID, SchedulingPolicy: &compute.SchedulingPolicy{ Preemptible: config.Preemptible, }, ResourcesSpec: &compute.ResourcesSpec{ Memory: toBytes(config.InstanceMemory), Cores: int64(config.InstanceCores), Gpus: int64(config.InstanceGpus), }, Metadata: instanceMetadata, BootDiskSpec: &compute.AttachedDiskSpec{ AutoDelete: false, Disk: &compute.AttachedDiskSpec_DiskId{ DiskId: disk.Id, }, }, NetworkInterfaceSpecs: []*compute.NetworkInterfaceSpec{ { SubnetId: instanceSubnetID, PrimaryV4AddressSpec: &compute.PrimaryAddressSpec{}, }, }, } if config.ServiceAccountID != "" { req.ServiceAccountId = config.ServiceAccountID } if config.UseIPv6 { req.NetworkInterfaceSpecs[0].PrimaryV6AddressSpec = &compute.PrimaryAddressSpec{} } if config.UseIPv4Nat { req.NetworkInterfaceSpecs[0].PrimaryV4AddressSpec = &compute.PrimaryAddressSpec{ OneToOneNatSpec: &compute.OneToOneNatSpec{ IpVersion: compute.IpVersion_IPV4, }, } } op, err := sdk.WrapOperation(sdk.Compute().Instance().Create(ctx, req)) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error create instance: %s", err)) } opMetadata, err := op.Metadata() if err != nil { return StepHaltWithError(state, fmt.Errorf("Error get create operation metadata: %s", err)) } if cimd, ok := opMetadata.(*compute.CreateInstanceMetadata); ok { state.Put("instance_id", cimd.InstanceId) } else { return StepHaltWithError(state, fmt.Errorf("could not get Instance ID from operation metadata")) } err = op.Wait(ctx) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error create instance: %s", err)) } resp, err := op.Response() if err != nil { return StepHaltWithError(state, err) } instance, ok := resp.(*compute.Instance) if !ok { return StepHaltWithError(state, fmt.Errorf("response doesn't contain Instance")) } // instance_id is the generic term used so that users can have access to the // instance id inside of the provisioners, used in step_provision. state.Put("instance_id", instance.Id) if s.Debug { ui.Message(fmt.Sprintf("Instance ID %s started. Current instance status %s", instance.Id, instance.Status)) ui.Message(fmt.Sprintf("Disk ID %s. ", disk.Id)) } // provision generated_data from declared in Builder.Prepare func // see doc https://www.packer.io/docs/extending/custom-builders#build-variables for details s.GeneratedData.Put("SourceImageID", sourceImage.ID) s.GeneratedData.Put("SourceImageName", sourceImage.Name) s.GeneratedData.Put("SourceImageDescription", sourceImage.Description) s.GeneratedData.Put("SourceImageFamily", sourceImage.Family) s.GeneratedData.Put("SourceImageFolderID", sourceImage.FolderID) return multistep.ActionContinue } func (s *StepCreateInstance) Cleanup(state multistep.StateBag) { config := state.Get("config").(*Config) driver := state.Get("driver").(Driver) ui := state.Get("ui").(packersdk.Ui) ctx, cancel := context.WithTimeout(context.Background(), config.StateTimeout) defer cancel() if s.SerialLogFile != "" { ui.Say("Current state 'cancelled' or 'halted'...") err := writeSerialLogFile(ctx, state, s.SerialLogFile) if err != nil { ui.Error(err.Error()) } } instanceIDRaw, ok := state.GetOk("instance_id") if ok { instanceID := instanceIDRaw.(string) if instanceID != "" { ui.Say("Destroying instance...") err := driver.DeleteInstance(ctx, instanceID) if err != nil { ui.Error(fmt.Sprintf( "Error destroying instance (id: %s). Please destroy it manually: %s", instanceID, err)) } ui.Message("Instance has been destroyed!") } } subnetIDRaw, ok := state.GetOk("subnet_id") if ok { subnetID := subnetIDRaw.(string) if subnetID != "" { // Destroy the subnet we just created ui.Say("Destroying subnet...") err := driver.DeleteSubnet(ctx, subnetID) if err != nil { ui.Error(fmt.Sprintf( "Error destroying subnet (id: %s). Please destroy it manually: %s", subnetID, err)) } ui.Message("Subnet has been deleted!") } } // Destroy the network we just created networkIDRaw, ok := state.GetOk("network_id") if ok { networkID := networkIDRaw.(string) if networkID != "" { // Destroy the network we just created ui.Say("Destroying network...") err := driver.DeleteNetwork(ctx, networkID) if err != nil { ui.Error(fmt.Sprintf( "Error destroying network (id: %s). Please destroy it manually: %s", networkID, err)) } ui.Message("Network has been deleted!") } } diskIDRaw, ok := state.GetOk("disk_id") if ok { ui.Say("Destroying boot disk...") diskID := diskIDRaw.(string) err := driver.DeleteDisk(ctx, diskID) if err != nil { ui.Error(fmt.Sprintf( "Error destroying boot disk (id: %s). Please destroy it manually: %s", diskID, err)) } ui.Message("Disk has been deleted!") } } func (c *Config) createInstanceMetadata(sshPublicKey string) (map[string]string, error) { instanceMetadata := make(map[string]string) // Copy metadata from config. for k, file := range c.MetadataFromFile { contents, err := ioutil.ReadFile(file) if err != nil { return nil, fmt.Errorf("error while read file '%s' with content for value of metadata key '%s': %s", file, k, err) } instanceMetadata[k] = string(contents) } for k, v := range c.Metadata { instanceMetadata[k] = v } if sshPublicKey != "" { sshMetaKey := "ssh-keys" sshKeys := fmt.Sprintf("%s:%s", c.Communicator.SSHUsername, sshPublicKey) if confSSHKeys, exists := instanceMetadata[sshMetaKey]; exists { sshKeys = fmt.Sprintf("%s\n%s", sshKeys, confSSHKeys) } instanceMetadata[sshMetaKey] = sshKeys } return instanceMetadata, nil } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/step_create_instance_test.go����������������������������������������0000664�0000000�0000000�00000007102�13771713062�0024151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "bytes" "io/ioutil" "os" "strings" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const testMetadataFileContent = `meta data value` func testMetadataFile(t *testing.T) string { tf, err := ioutil.TempFile("", "packer") require.NoErrorf(t, err, "create temporary file failed") defer tf.Close() _, err = tf.Write([]byte(testMetadataFileContent)) require.NoErrorf(t, err, "write to file failed") return tf.Name() } func TestCreateInstanceMetadata(t *testing.T) { state := testState(t) c := state.Get("config").(*Config) pubKey := "abcdefgh123456789" // create our metadata metadata, err := c.createInstanceMetadata(pubKey) require.NoError(t, err, "Metadata creation should have succeeded.") // ensure our pubKey is listed assert.True(t, strings.Contains(metadata["ssh-keys"], pubKey), "Instance metadata should contain provided public key") } func TestCreateInstanceMetadata_noPublicKey(t *testing.T) { state := testState(t) c := state.Get("config").(*Config) sshKeys := c.Metadata["sshKeys"] // create our metadata metadata, err := c.createInstanceMetadata("") // ensure the metadata created without err require.NoError(t, err, "Metadata creation should have succeeded.") // ensure the ssh metadata hasn't changed assert.Equal(t, metadata["sshKeys"], sshKeys, "Instance metadata should not have been modified") } func TestCreateInstanceMetadata_fromFile(t *testing.T) { state := testState(t) metadataFile := testMetadataFile(t) defer os.Remove(metadataFile) state.Put("config", testConfigStruct(t)) c := state.Get("config").(*Config) c.MetadataFromFile = map[string]string{ "test-key": metadataFile, } // create our metadata metadata, err := c.createInstanceMetadata("") require.NoError(t, err, "Metadata creation should have succeeded.") // ensure the metadata from file hasn't changed assert.Equal(t, testMetadataFileContent, metadata["test-key"], "Instance metadata should not have been modified") } func TestCreateInstanceMetadata_fromFileAndTemplate(t *testing.T) { state := testState(t) metadataFile := testMetadataFile(t) defer os.Remove(metadataFile) state.Put("config", testConfigStruct(t)) c := state.Get("config").(*Config) c.MetadataFromFile = map[string]string{ "test-key": metadataFile, } c.Metadata = map[string]string{ "test-key": "override value", "test-key-2": "new-value", } // create our metadata metadata, err := c.createInstanceMetadata("") require.NoError(t, err, "Metadata creation should have succeeded.") // ensure the metadata merged assert.Equal(t, "override value", metadata["test-key"], "Instance metadata should not have been modified") assert.Equal(t, "new-value", metadata["test-key-2"], "Instance metadata should not have been modified") } func TestCreateInstanceMetadata_fromNotExistFile(t *testing.T) { state := testState(t) metadataFile := "not-exist-file" state.Put("config", testConfigStruct(t)) c := state.Get("config").(*Config) c.MetadataFromFile = map[string]string{ "test-key": metadataFile, } // create our metadata _, err := c.createInstanceMetadata("") assert.True(t, err != nil, "Metadata creation should have an error.") } func testState(t *testing.T) multistep.StateBag { state := new(multistep.BasicStateBag) state.Put("config", testConfigStruct(t)) state.Put("hook", &packersdk.MockHook{}) state.Put("ui", &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), }) return state } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/step_create_ssh_key.go����������������������������������������������0000664�0000000�0000000�00000005374�13771713062�0022764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "io/ioutil" "log" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "golang.org/x/crypto/ssh" ) type StepCreateSSHKey struct { Debug bool DebugKeyPath string } func (s *StepCreateSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) config := state.Get("config").(*Config) if config.Communicator.SSHPrivateKeyFile != "" { ui.Say("Using existing SSH private key") privateKeyBytes, err := config.Communicator.ReadSSHPrivateKeyFile() if err != nil { state.Put("error", err) return multistep.ActionHalt } key, err := ssh.ParsePrivateKey(privateKeyBytes) if err != nil { err = fmt.Errorf("Error parsing 'ssh_private_key_file': %s", err) ui.Error(err.Error()) state.Put("error", err) return multistep.ActionHalt } config.Communicator.SSHPublicKey = ssh.MarshalAuthorizedKey(key.PublicKey()) config.Communicator.SSHPrivateKey = privateKeyBytes return multistep.ActionContinue } ui.Say("Creating temporary ssh key for instance...") priv, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error generating temporary SSH key: %s", err)) } // ASN.1 DER encoded form privDer := x509.MarshalPKCS1PrivateKey(priv) privBlk := pem.Block{ Type: "RSA PRIVATE KEY", Headers: nil, Bytes: privDer, } // Marshal the public key into SSH compatible format pub, err := ssh.NewPublicKey(&priv.PublicKey) if err != nil { err = fmt.Errorf("Error creating public ssh key: %s", err) ui.Error(err.Error()) state.Put("error", err) return multistep.ActionHalt } pubSSHFormat := string(ssh.MarshalAuthorizedKey(pub)) hashMD5 := ssh.FingerprintLegacyMD5(pub) hashSHA256 := ssh.FingerprintSHA256(pub) log.Printf("[INFO] md5 hash of ssh pub key: %s", hashMD5) log.Printf("[INFO] sha256 hash of ssh pub key: %s", hashSHA256) // Remember some state for the future state.Put("ssh_key_public", pubSSHFormat) // Set the private key in the config for later config.Communicator.SSHPrivateKey = pem.EncodeToMemory(&privBlk) config.Communicator.SSHPublicKey = ssh.MarshalAuthorizedKey(pub) // If we're in debug mode, output the private key to the working directory. if s.Debug { ui.Message(fmt.Sprintf("Saving key for debug purposes: %s", s.DebugKeyPath)) err := ioutil.WriteFile(s.DebugKeyPath, config.Communicator.SSHPrivateKey, 0600) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error saving debug key: %s", err)) } } return multistep.ActionContinue } func (s *StepCreateSSHKey) Cleanup(state multistep.StateBag) { } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/step_instance_info.go�����������������������������������������������0000664�0000000�0000000�00000006072�13771713062�0022607�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "errors" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ycsdk "github.com/yandex-cloud/go-sdk" ) type StepInstanceInfo struct{} func (s *StepInstanceInfo) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { sdk := state.Get("sdk").(*ycsdk.SDK) ui := state.Get("ui").(packersdk.Ui) c := state.Get("config").(*Config) instanceID := state.Get("instance_id").(string) ui.Say(fmt.Sprintf("Waiting for instance with id %s to become active...", instanceID)) ctx, cancel := context.WithTimeout(ctx, c.StateTimeout) defer cancel() instance, err := sdk.Compute().Instance().Get(ctx, &compute.GetInstanceRequest{ InstanceId: instanceID, View: compute.InstanceView_FULL, }) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error retrieving instance data: %s", err)) } instanceIP, err := getInstanceIPAddress(c, instance) if err != nil { return StepHaltWithError(state, fmt.Errorf("Failed to find instance ip address: %s", err)) } state.Put("instance_ip", instanceIP) ui.Message(fmt.Sprintf("Detected instance IP: %s", instanceIP)) return multistep.ActionContinue } func getInstanceIPAddress(c *Config, instance *compute.Instance) (address string, err error) { // Instance could have several network interfaces with different configuration each // Get all possible addresses for instance addrIPV4Internal, addrIPV4External, addrIPV6Addr, err := instanceAddresses(instance) if err != nil { return "", err } if c.UseIPv6 { if addrIPV6Addr != "" { return "[" + addrIPV6Addr + "]", nil } return "", errors.New("instance has no one IPv6 address") } if c.UseInternalIP { if addrIPV4Internal != "" { return addrIPV4Internal, nil } return "", errors.New("instance has no one IPv4 internal address") } if addrIPV4External != "" { return addrIPV4External, nil } return "", errors.New("instance has no one IPv4 external address") } func instanceAddresses(instance *compute.Instance) (ipV4Int, ipV4Ext, ipV6 string, err error) { if len(instance.NetworkInterfaces) == 0 { return "", "", "", errors.New("No one network interface found for an instance") } var ipV4IntFound, ipV4ExtFound, ipV6Found bool for _, iface := range instance.NetworkInterfaces { if !ipV6Found && iface.PrimaryV6Address != nil { ipV6 = iface.PrimaryV6Address.Address ipV6Found = true } if !ipV4IntFound && iface.PrimaryV4Address != nil { ipV4Int = iface.PrimaryV4Address.Address ipV4IntFound = true if !ipV4ExtFound && iface.PrimaryV4Address.OneToOneNat != nil { ipV4Ext = iface.PrimaryV4Address.OneToOneNat.Address ipV4ExtFound = true } } if ipV6Found && ipV4IntFound && ipV4ExtFound { break } } if !ipV4IntFound { // internal ipV4 address always should present return "", "", "", errors.New("No IPv4 internal address found. Bug?") } return } func (s *StepInstanceInfo) Cleanup(state multistep.StateBag) { // no cleanup } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/step_teardown_instance.go�������������������������������������������0000664�0000000�0000000�00000003360�13771713062�0023474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ycsdk "github.com/yandex-cloud/go-sdk" ) type StepTeardownInstance struct { SerialLogFile string } func (s *StepTeardownInstance) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { sdk := state.Get("sdk").(*ycsdk.SDK) ui := state.Get("ui").(packersdk.Ui) c := state.Get("config").(*Config) instanceID := state.Get("instance_id").(string) ui.Say("Stopping instance...") ctx, cancel := context.WithTimeout(ctx, c.StateTimeout) defer cancel() if s.SerialLogFile != "" { err := writeSerialLogFile(ctx, state, s.SerialLogFile) if err != nil { ui.Error(err.Error()) } } op, err := sdk.WrapOperation(sdk.Compute().Instance().Stop(ctx, &compute.StopInstanceRequest{ InstanceId: instanceID, })) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error stopping instance: %s", err)) } err = op.Wait(ctx) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error stopping instance: %s", err)) } ui.Say("Deleting instance...") op, err = sdk.WrapOperation(sdk.Compute().Instance().Delete(ctx, &compute.DeleteInstanceRequest{ InstanceId: instanceID, })) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error deleting instance: %s", err)) } err = op.Wait(ctx) if err != nil { return StepHaltWithError(state, fmt.Errorf("Error deleting instance: %s", err)) } ui.Message("Instance has been deleted!") state.Put("instance_id", "") return multistep.ActionContinue } func (s *StepTeardownInstance) Cleanup(state multistep.StateBag) { // no cleanup } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/template_func.go����������������������������������������������������0000664�0000000�0000000�00000001261�13771713062�0021556�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "strings" "text/template" ) func isalphanumeric(b byte) bool { if '0' <= b && b <= '9' { return true } if 'a' <= b && b <= 'z' { return true } return false } // Clean up resource name by replacing invalid characters with "-" // and converting upper cases to lower cases func templateCleanResourceName(s string) string { if reImageFamily.MatchString(s) { return s } b := []byte(strings.ToLower(s)) newb := make([]byte, len(b)) for i := range newb { if isalphanumeric(b[i]) { newb[i] = b[i] } else { newb[i] = '-' } } return string(newb) } var TemplateFuncs = template.FuncMap{ "clean_resource_name": templateCleanResourceName, } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/testdata/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020212�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/testdata/fake-sa-key.json�������������������������������������������0000664�0000000�0000000�00000010313�13771713062�0023200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "id": "ajeboa0du6edu6m43c3t", "service_account_id": "ajeq7dsmihqple6761c5", "created_at": "2018-11-19T13:38:09Z", "description": "description", "key_algorithm": "RSA_4096", "public_key": "-----BEGIN PUBLIC KEY-----\nMIICCgKCAgEAo/s1lN5vFpFNJvS/l+yRilQHAPDeC3JqBwpLstbqJXW4kAUaKKoe\nxkIuJuPUKOUcd/JE3LXOEt/LOFb9mkCRdpjaIW7Jd5Fw0kTHIZ5rDoq7DZx0LV9b\nGJNskdccd6M6stb1GEqVuGpVcyXMCH8tMSG3c85DkcAg0cxXgyrirAzHMPiWSTpj\nJjICkxXRVj01Xq7dIDqL2LSMrZ2kLda5m+CnfscUbwnGRPPoEg20jLiEgBM2o43e\nhpWko1NStRR5fMQcQSUBbdtvbfPracjZz2/fq4fZfqlnObgq3WpYpdGynniLH3i5\nbxPM3ufYL3HY2w5aIOY6KIwMKLf3WYlug90ieviMYAvCukrCASwyqBQlt3MKCHlN\nIcebZXJDQ1VSBuEs+4qXYlhG1p+5C07zahzigNNTm6rEo47FFfClF04mv2uJN42F\nfWlEPR+V9JHBcfcBCdvyhiGzftl/vDo2NdO751ETIhyNKzxM/Ve2PR9h/qcuEatC\nLlXUA+40epNNHbSxAauxcngyrtkn7FZAEhdjyTtx46sELyb90Z56WgnbNUUGnsS/\nHBnBy5z8RyCmI5MjTC2NtplVqtAWkG+x59mU3GoCeuI8EaNtu2YPXhl1ovRkS4NB\n1G0F4c5FiJ27/E2MbNKlV5iw9ICcDforATYTeqiXbkkEKqIIiZYZWOsCAwEAAQ==\n-----END PUBLIC KEY-----\n", "private_key": "-----BEGIN PRIVATE KEY-----\nMIIJKQIBAAKCAgEAo/s1lN5vFpFNJvS/l+yRilQHAPDeC3JqBwpLstbqJXW4kAUa\nKKoexkIuJuPUKOUcd/JE3LXOEt/LOFb9mkCRdpjaIW7Jd5Fw0kTHIZ5rDoq7DZx0\nLV9bGJNskdccd6M6stb1GEqVuGpVcyXMCH8tMSG3c85DkcAg0cxXgyrirAzHMPiW\nSTpjJjICkxXRVj01Xq7dIDqL2LSMrZ2kLda5m+CnfscUbwnGRPPoEg20jLiEgBM2\no43ehpWko1NStRR5fMQcQSUBbdtvbfPracjZz2/fq4fZfqlnObgq3WpYpdGynniL\nH3i5bxPM3ufYL3HY2w5aIOY6KIwMKLf3WYlug90ieviMYAvCukrCASwyqBQlt3MK\nCHlNIcebZXJDQ1VSBuEs+4qXYlhG1p+5C07zahzigNNTm6rEo47FFfClF04mv2uJ\nN42FfWlEPR+V9JHBcfcBCdvyhiGzftl/vDo2NdO751ETIhyNKzxM/Ve2PR9h/qcu\nEatCLlXUA+40epNNHbSxAauxcngyrtkn7FZAEhdjyTtx46sELyb90Z56WgnbNUUG\nnsS/HBnBy5z8RyCmI5MjTC2NtplVqtAWkG+x59mU3GoCeuI8EaNtu2YPXhl1ovRk\nS4NB1G0F4c5FiJ27/E2MbNKlV5iw9ICcDforATYTeqiXbkkEKqIIiZYZWOsCAwEA\nAQKCAgEAihT1L6CGhshf4VfjJfktLQBIzYAGWjlEEx2WVMgobtbMTWoedvOZ6nS8\nDD943d7ftBkr53aoSrhslcqazpNkaiuYMuLpf2fXSxhjXmnZ2Gr1zCZcpgBP40fw\n+nXbINswiHv98zCLFrljrwy63MTKtz6fDkM4HrlcaY3aezdXnG0+JnyNgKhL6VPf\nWx/aIPZ1xH8W8RabwCV4+JFwOLFBpoLsSBM3n7DpZhLE7r7ftEeEO5zyO5MxOL81\n3dpCIP1Wt7sj169jnrBTCpGFQJTC5Kxd+kDw4nmf1LjCT6RHdYo5ELyM2jl8XI6d\ny24LWxhQ9VUGjAGSI6aabodLH/hcOBB2wG1tnO+n5y85GnKKOJgxCxaj1yR/LAcT\nFvZgbDGwAMd7h7+fU46Yj5BILk6mRvBNL6Mk2VAlBzUatGduU+Xxha3JkGxIJY4G\np1qPLNiP7as90mXXMgNEtsP2zXtyi+9q7XBOBnfL3ftHWQmu7MKQCHIKcNRchFJ4\nS1LtndjXtNchzDhbXru2qsRiASmL9u4CgZn/lM3kDHs+v2JI+V8cPk5XZhoPrrpP\nZ0SPeoLZEJ5/TtlTWAXXqP6F24rziBqnEJgpNCkeBnQYx2Rs9OKVsrlDk8cf3KkL\nH8qQ/86HYz9cEtFnVKAYOV5GtQsJRyzipMy7R/cegdtWJ8ScuiECggEBANOT7lBX\nRYw+k53TRpkk7NlWuQogKKEQx4PEf8A6HQj3SseH8u+tt3HfTFJktzWs/9EQerLS\nJky9bSPxBvDq0Zfj+IPamiY+c2w5a9WbLxk8UHCaUHcSUeWoWQwmCZqzXeUNj9f5\nQOfF+ajsqhaXE68/HuIj+dgOOn/XYyqNkxlidXa9U3gUanuftwRSephsGcsaEGTe\nep2My4Jj3hPH/9Qoith0X18atRru6RanK63bDl0FqAU/1uUycQr+h0hEwQHWoRiq\nNVXI1uxfi5/2pxK0w1MOzZLitwEQ/veCv6CZwNPf1SW1U8j70SvKVR8Z7gGDIPjS\n8klW2Z9g6gxPQ1MCggEBAMZpBFa4mEnsmt+paEFCGUtoeBapjZF94PBtdxII/T5t\ne5z4Iz7RMl+ixLhNepQu+0t+v1iDVJgDJuUjCsSF69jEca7gzmsWhs9d+gDU5Knm\n18ChbQyeaDvmqINCs2t45pA/mVIQHbA8L8n/ToI5P63ZELDUFVzZo9kerZu1ALNB\nRoG0PhIHrGkZKwL8oE72nrZmWtfjROsZBhu7FqJ0i7va/6fgNMuMtBC/abOC7yVT\nir5XP+ZGF8XNyIZ3Ic0X8xc+XqagYsf+XobHGmbSct/ZaDP3g1z4B/7JZcbYjuTZ\nMJ3s5T+6l/qo0dfDuaVBJFJrnw8YfahX/Bn4OQ2TuQkCggEBALfhs5dDogA3Spg6\nTPtAalCh3IP+WxFQwfW1S8pHN4DZW7Z6YxsHgY2IIo7hVZFi35pVli3gEsVTRI2e\nJwgvLSWzTgNac+qVED+Y0C1/h7mI/+g9VX2HAIJ2g53ZWTOIfCxcUw3DZTOKjmbP\n+StU9hiy5SZpWfT6uMDu8xLCpHvFZI1kEi0koT78GlW5US8zlF8+Mc1YxnwzJ5QV\nM6dBhQhgi/t/eHvxfEECLrYvZ/jbj2otRk/5oczkv/ZsLCsVBiGQ5cXH+D6sJI6e\no3zNI3tQewmurd/hBmf4239FtUHhHwOFX3w8Uas1oB9M5Bn5sS7DRl67BzPSNaUc\n140HPl0CggEAX1+13TXoxog8vkzBt7TdUdlK+KHSUmCvEwObnAjEKxEXvZGt55FJ\n5JzqcSmVRcv7sgOgWRzwOg4x0S1yDJvPjiiH+SdJMkLm1KF4/pNXw7AagBdYwxsW\nQc0Trd0PQBcixa48tizXCJM16aSXCZQZXykbk9Su3C4mS8UqcNGmH4S+LrUErUgR\nAYg+m7XyHWMBUe6LtoEh7Nzfic76B2d8j/WqtPjaiAn/uJk6ZzcGW+v3op1wMvH4\nlXXg8XosvljH2qF5gCFSuo40xBbLQyfgXmg0Zd6Rv8velAQdr2MD9U/NxexNGsBI\nNA6YqF4GTECvBAuFrwz3wkdhAN7IFhWveQKCAQBdfdHB3D+m+b/hZoEIv0nPcgQf\ncCOPPNO/ufObjWed2jTL3RjoDT337Mp3mYkoP4GE9n6cl7mjlcrf7KQeRG8k35fv\n3nMoMOp21qj9J66UgGf1/RHsV/+ljcu87ggYDCVKd8uGzkspRIQIsD77He/TwZNa\nyWL4fa1EvRU6STwi7CZFfhWhMF3rBGAPshABoyJZh6Z14cioAKSR0Sl6XZ5dcB9B\naoJM8sISSlOqMIJyNnyMtdE55Ag+P7LyMe2grxlwVTv3h0o5mHSzWnjSHVYvN4q5\n6h5UUopLtyVMGCwOJz+zNT7zFqi4XIGU8a8Lg1iiKtfjgHB2X8ZWZuXBdrTj\n-----END PRIVATE KEY-----\n" }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/testdata/terraform/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022213�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/testdata/terraform/instanceSA.tf������������������������������������0000664�0000000�0000000�00000004134�13771713062�0024600�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// This terraform code allows you to quickly create an instance with the assigned service account and the necessary rights. // To start, it is required to specify two parameters: oauth token and folder id. // // $ terraform apply -var yc_token=<your_token_value> -var folder_id=<your_folder_id> // // After testing and completing work, just run the command to delete all provisioned cloud resources: // // $ terraform destroy -var yc_token=<your_token_value> -var folder_id=<your_folder_id> // // Variables section variable "yc_token" { description = "Yandex.Cloud OAuth token" } variable "folder_id" { description = "Folder ID to provision all cloud resources" } variable "username" { default = "ubuntu" } variable "path_to_ssh_public_key" { default = "~/.ssh/id_rsa.pub" } // Provider section provider "yandex" { folder_id = var.folder_id token = var.yc_token zone = "ru-central1-a" } // Main section data "yandex_compute_image" "ubuntu" { family = "ubuntu-1604-lts" } resource "yandex_vpc_network" "this" { } resource "yandex_vpc_subnet" "this" { network_id = yandex_vpc_network.this.id v4_cidr_blocks = ["192.168.86.0/24"] } resource "yandex_compute_instance" "this" { service_account_id = yandex_iam_service_account.this.id boot_disk { initialize_params { image_id = data.yandex_compute_image.ubuntu.id } } network_interface { subnet_id = yandex_vpc_subnet.this.id nat = true } resources { cores = 1 memory = 1 core_fraction = 20 } metadata = { ssh-keys = "${var.username}:${file(var.path_to_ssh_public_key)}" } } resource "yandex_iam_service_account" "this" { name = "test-sa-for-instance" } resource "yandex_resourcemanager_folder_iam_member" "this" { folder_id = var.folder_id member = "serviceAccount:${yandex_iam_service_account.this.id}" role = "editor" } // Output section output "result" { value = "\nuse ssh with login `ubuntu` to connect instance like:\n\n$ ssh -i ${var.path_to_ssh_public_key} -l ${var.username} ${yandex_compute_instance.this.network_interface[0].nat_ip_address}" } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/util.go�������������������������������������������������������������0000664�0000000�0000000�00000003115�13771713062�0017705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandex import ( "context" "fmt" "io/ioutil" "github.com/c2h5oh/datasize" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ycsdk "github.com/yandex-cloud/go-sdk" ) func StepHaltWithError(state multistep.StateBag, err error) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } func toGigabytes(bytesCount int64) int { return int((datasize.ByteSize(bytesCount) * datasize.B).GBytes()) } func toBytes(gigabytesCount int) int64 { return int64((datasize.ByteSize(gigabytesCount) * datasize.GB).Bytes()) } func writeSerialLogFile(ctx context.Context, state multistep.StateBag, serialLogFile string) error { sdk := state.Get("sdk").(*ycsdk.SDK) ui := state.Get("ui").(packersdk.Ui) instanceID := state.Get("instance_id").(string) if instanceID == "" { return nil } ui.Say("Try get instance's serial port output and write to file " + serialLogFile) serialOutput, err := sdk.Compute().Instance().GetSerialPortOutput(ctx, &compute.GetInstanceSerialPortOutputRequest{ InstanceId: instanceID, }) if err != nil { return fmt.Errorf("Failed to get serial port output for instance (id: %s): %s", instanceID, err) } if err := ioutil.WriteFile(serialLogFile, []byte(serialOutput.Contents), 0600); err != nil { return fmt.Errorf("Failed to write serial port output to file: %s", err) } ui.Message("Serial port output has been successfully written") return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/version/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020066�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/builder/yandex/version/version.go��������������������������������������������������0000664�0000000�0000000�00000000475�13771713062�0022110�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var YandexPluginVersion *version.PluginVersion func init() { YandexPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/checkpoint.go����������������������������������������������������������������������0000664�0000000�0000000�00000004112�13771713062�0016137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "fmt" "log" "path/filepath" "github.com/hashicorp/go-checkpoint" "github.com/hashicorp/packer/command" "github.com/hashicorp/packer/packer-plugin-sdk/pathing" packerVersion "github.com/hashicorp/packer/version" ) func init() { checkpointResult = make(chan *checkpoint.CheckResponse, 1) } var checkpointResult chan *checkpoint.CheckResponse // runCheckpoint runs a HashiCorp Checkpoint request. You can read about // Checkpoint here: https://github.com/hashicorp/go-checkpoint. func runCheckpoint(c *config) { // If the user doesn't want checkpoint at all, then return. if c.DisableCheckpoint { log.Printf("[INFO] Checkpoint disabled. Not running.") checkpointResult <- nil return } configDir, err := pathing.ConfigDir() if err != nil { log.Printf("[ERR] Checkpoint setup error: %s", err) checkpointResult <- nil return } version := packerVersion.Version if packerVersion.VersionPrerelease != "" { version += fmt.Sprintf("-%s", packerVersion.VersionPrerelease) } signaturePath := filepath.Join(configDir, "checkpoint_signature") if c.DisableCheckpointSignature { log.Printf("[INFO] Checkpoint signature disabled") signaturePath = "" } resp, err := checkpoint.Check(&checkpoint.CheckParams{ Product: "packer", Version: version, SignatureFile: signaturePath, CacheFile: filepath.Join(configDir, "checkpoint_cache"), }) if err != nil { log.Printf("[ERR] Checkpoint error: %s", err) resp = nil } checkpointResult <- resp } // commandVersionCheck implements command.VersionCheckFunc and is used // as the version checker. func commandVersionCheck() (command.VersionCheckInfo, error) { // Wait for the result to come through info := <-checkpointResult if info == nil { var zero command.VersionCheckInfo return zero, nil } // Build the alerts that we may have received about our version alerts := make([]string, len(info.Alerts)) for i, a := range info.Alerts { alerts[i] = a.Message } return command.VersionCheckInfo{ Outdated: info.Outdated, Latest: info.CurrentVersion, Alerts: alerts, }, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/�������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0014226�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/generate-fixer-deprecations/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021611�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/generate-fixer-deprecations/main.go��������������������������������������������0000664�0000000�0000000�00000004167�13771713062�0023074�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "bytes" "flag" "fmt" "go/format" "os" "path/filepath" "strings" "text/template" "github.com/hashicorp/packer/fix" ) var deprecatedOptsTemplate = template.Must(template.New("deprecatedOptsTemplate").Funcs(template.FuncMap{"StringsJoin": strings.Join}).Parse(`//<!-- Code generated by generate-fixer-deprecations; DO NOT EDIT MANUALLY --> package config var DeprecatedOptions = map[string][]string{ {{- range $key, $value := .DeprecatedOpts}} "{{$key}}": []string{"{{ StringsJoin . "\", \"" }}"}, {{- end}} } `)) type executeOpts struct { DeprecatedOpts map[string][]string } func main() { // Figure out location in directory structure args := flag.Args() if len(args) == 0 { // Default: process the file args = []string{os.Getenv("GOFILE")} } fname := args[0] absFilePath, err := filepath.Abs(fname) if err != nil { panic(err) } paths := strings.Split(absFilePath, "cmd"+string(os.PathSeparator)+ "generate-fixer-deprecations"+string(os.PathSeparator)+"main.go") packerDir := paths[0] // Load all deprecated options from all active fixers allDeprecatedOpts := map[string][]string{} for _, name := range fix.FixerOrder { fixer, ok := fix.Fixers[name] if !ok { panic("fixer not found: " + name) } deprecated := fixer.DeprecatedOptions() for k, v := range deprecated { if allDeprecatedOpts[k] == nil { allDeprecatedOpts[k] = v } else { allDeprecatedOpts[k] = append(allDeprecatedOpts[k], v...) } } } deprecated_path := filepath.Join(packerDir, "packer-plugin-sdk", "template", "config", "deprecated_options.go") buf := bytes.Buffer{} // execute template into buffer deprecated := &executeOpts{DeprecatedOpts: allDeprecatedOpts} err = deprecatedOptsTemplate.Execute(&buf, deprecated) if err != nil { panic(err) } // we've written unformatted go code to the file. now we have to format it. out, err := format.Source(buf.Bytes()) if err != nil { panic(err) } outputFile, err := os.Create(deprecated_path) if err != nil { panic(err) } _, err = outputFile.Write(out) defer outputFile.Close() if err != nil { fmt.Printf("%v", err) os.Exit(1) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/mapstructure-to-hcl2/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020232�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/mapstructure-to-hcl2/mapstructure-to-hcl2.go�����������������������������������0000664�0000000�0000000�00000047033�13771713062�0024574�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// mapstructure-to-hcl2 fills the gaps between hcl2 and mapstructure for Packer // // By generating a struct that the HCL2 ecosystem understands making use of // mapstructure tags. // // Packer heavily uses the mapstructure decoding library to load/parse user // config files. Packer now needs to move to HCL2. // // Here are a few differences/gaps betweens hcl2 and mapstructure: // // * in HCL2 all basic struct fields (string/int/struct) that are not pointers // are required ( must be set ). In mapstructure everything is optional. // // * mapstructure allows to 'squash' fields // (ex: Field CommonStructType `mapstructure:",squash"`) this allows to // decorate structs and reuse configuration code. HCL2 parsing libs don't have // anything similar. // // mapstructure-to-hcl2 will parse Packer's config files and generate the HCL2 // compliant code that will allow to not change any of the current builders in // order to softly move to HCL2. package main import ( "bytes" "flag" "fmt" "go/types" "io" "log" "os" "regexp" "sort" "strings" "github.com/fatih/structtag" "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" "golang.org/x/tools/go/packages" "golang.org/x/tools/imports" ) const mapstructureToHCL2 = "mapstructure-to-hcl2" var ( typeNames = flag.String("type", "", "comma-separated list of type names; must be set") output = flag.String("output", "", "output file name; default srcdir/<type>_hcl2.go") trimprefix = flag.String("trimprefix", "", "trim the `prefix` from the generated constant names") ) // Usage is a replacement usage function for the flags package. func Usage() { fmt.Fprintf(os.Stderr, "Usage of "+mapstructureToHCL2+":\n") fmt.Fprintf(os.Stderr, "\t"+mapstructureToHCL2+" [flags] -type T[,T...] pkg\n") fmt.Fprintf(os.Stderr, "Flags:\n") flag.PrintDefaults() } func main() { log.SetFlags(0) log.SetPrefix(mapstructureToHCL2 + ": ") flag.Usage = Usage flag.Parse() if len(*typeNames) == 0 { flag.Usage() os.Exit(2) } typeNames := strings.Split(*typeNames, ",") // We accept either one directory or a list of files. Which do we have? args := flag.Args() if len(args) == 0 { // Default: process whole package in current directory. args = []string{"."} } outputPath := strings.ToLower(typeNames[0]) + ".hcl2spec.go" if goFile := os.Getenv("GOFILE"); goFile != "" { outputPath = goFile[:len(goFile)-2] + "hcl2spec.go" } log.SetPrefix(fmt.Sprintf(mapstructureToHCL2+": %s.%v: ", os.Getenv("GOPACKAGE"), typeNames)) cfg := &packages.Config{ Mode: packages.LoadSyntax, } pkgs, err := packages.Load(cfg, args...) if err != nil { log.Fatal(err) } if len(pkgs) != 1 { log.Fatalf("error: %d packages found", len(pkgs)) } topPkg := pkgs[0] sort.Strings(typeNames) var structs []StructDef usedImports := map[NamePath]*types.Package{} for id, obj := range topPkg.TypesInfo.Defs { if obj == nil { continue } t := obj.Type() nt, isANamedType := t.(*types.Named) if !isANamedType { continue } if nt.Obj().Pkg() != topPkg.Types { // Sometimes a struct embeds another struct named the same. ex: // builder/osc/bsuvolume.BlockDevice. This makes sure the type is // defined in topPkg. continue } ut := nt.Underlying() utStruct, utOk := ut.(*types.Struct) if !utOk { continue } pos := sort.SearchStrings(typeNames, id.Name) if pos >= len(typeNames) || typeNames[pos] != id.Name { continue // not a struct we care about } // make sure each type is found once where somehow sometimes they can be found twice typeNames = append(typeNames[:pos], typeNames[pos+1:]...) flatenedStruct := getMapstructureSquashedStruct(obj.Pkg(), utStruct) flatenedStruct = addCtyTagToStruct(flatenedStruct) newStructName := "Flat" + id.Name structs = append(structs, StructDef{ OriginalStructName: id.Name, FlatStructName: newStructName, Struct: flatenedStruct, }) for k, v := range getUsedImports(flatenedStruct) { if _, found := usedImports[k]; !found { usedImports[k] = v } } } out := bytes.NewBuffer(nil) fmt.Fprintf(out, `// Code generated by "%s %s"; DO NOT EDIT.`, mapstructureToHCL2, strings.Join(os.Args[1:], " ")) fmt.Fprintf(out, "\npackage %s\n", topPkg.Name) delete(usedImports, NamePath{topPkg.Name, topPkg.PkgPath}) usedImports[NamePath{"hcldec", "github.com/hashicorp/hcl/v2/hcldec"}] = types.NewPackage("hcldec", "github.com/hashicorp/hcl/v2/hcldec") usedImports[NamePath{"cty", "github.com/zclconf/go-cty/cty"}] = types.NewPackage("cty", "github.com/zclconf/go-cty/cty") outputImports(out, usedImports) sort.Slice(structs, func(i int, j int) bool { return structs[i].OriginalStructName < structs[j].OriginalStructName }) for _, flatenedStruct := range structs { fmt.Fprintf(out, "\n// %s is an auto-generated flat version of %s.", flatenedStruct.FlatStructName, flatenedStruct.OriginalStructName) fmt.Fprintf(out, "\n// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.") fmt.Fprintf(out, "\ntype %s struct {\n", flatenedStruct.FlatStructName) outputStructFields(out, flatenedStruct.Struct) fmt.Fprint(out, "}\n") fmt.Fprintf(out, "\n// FlatMapstructure returns a new %s.", flatenedStruct.FlatStructName) fmt.Fprintf(out, "\n// %s is an auto-generated flat version of %s.", flatenedStruct.FlatStructName, flatenedStruct.OriginalStructName) fmt.Fprintf(out, "\n// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.") fmt.Fprintf(out, "\nfunc (*%s) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {", flatenedStruct.OriginalStructName) fmt.Fprintf(out, "\nreturn new(%s)", flatenedStruct.FlatStructName) fmt.Fprint(out, "\n}\n") fmt.Fprintf(out, "\n// HCL2Spec returns the hcl spec of a %s.", flatenedStruct.OriginalStructName) fmt.Fprintf(out, "\n// This spec is used by HCL to read the fields of %s.", flatenedStruct.OriginalStructName) fmt.Fprintf(out, "\n// The decoded values from this spec will then be applied to a %s.", flatenedStruct.FlatStructName) fmt.Fprintf(out, "\nfunc (*%s) HCL2Spec() map[string]hcldec.Spec {\n", flatenedStruct.FlatStructName) outputStructHCL2SpecBody(out, flatenedStruct.Struct) fmt.Fprint(out, "}\n") } for impt := range usedImports { if strings.ContainsAny(impt.Path, "/") { out = bytes.NewBuffer(bytes.ReplaceAll(out.Bytes(), []byte(impt.Path+"."), []byte(impt.Name+"."))) } } // avoid needing to import current pkg; there's probably a better way. out = bytes.NewBuffer(bytes.ReplaceAll(out.Bytes(), []byte(topPkg.PkgPath+"."), nil)) outputFile, err := os.Create(outputPath) if err != nil { log.Fatalf("os.Create: %v", err) } _, err = outputFile.Write(goFmt(outputFile.Name(), out.Bytes())) if err != nil { log.Fatalf("failed to write file: %v", err) } } type StructDef struct { OriginalStructName string FlatStructName string Struct *types.Struct } // outputStructHCL2SpecBody writes the map[string]hcldec.Spec that defines the HCL spec of a // struct. Based on the layout of said struct. // If a field of s is a struct then the HCL2Spec() function of that struct will be called, otherwise a // cty.Type is outputed. func outputStructHCL2SpecBody(w io.Writer, s *types.Struct) { fmt.Fprintf(w, "s := map[string]hcldec.Spec{\n") for i := 0; i < s.NumFields(); i++ { field, tag := s.Field(i), s.Tag(i) st, _ := structtag.Parse(tag) ctyTag, _ := st.Get("cty") fmt.Fprintf(w, " \"%s\": ", ctyTag.Name) outputHCL2SpecField(w, ctyTag.Name, field.Type(), st) fmt.Fprintln(w, `,`) } fmt.Fprintln(w, `}`) fmt.Fprintln(w, `return s`) } // outputHCL2SpecField is called on each field of a struct. // outputHCL2SpecField writes the values of the `map[string]hcldec.Spec` map // supposed to define the HCL spec of a struct. func outputHCL2SpecField(w io.Writer, accessor string, fieldType types.Type, tag *structtag.Tags) { if m2h, err := tag.Get(mapstructureToHCL2); err == nil && m2h.HasOption("self-defined") { fmt.Fprintf(w, `(&%s{}).HCL2Spec()`, fieldType.String()) return } spec, _ := goFieldToCtyType(accessor, fieldType) switch spec := spec.(type) { case string: fmt.Fprintf(w, spec) default: fmt.Fprintf(w, `%#v`, spec) } } // goFieldToCtyType is a recursive method that returns a cty.Type (or a string) based on the fieldType. // goFieldToCtyType returns the values of the `map[string]hcldec.Spec` map // supposed to define the HCL spec of a struct. // To allow it to be recursive, the method returns two values: an interface that can either be // a cty.Type or a string. The second argument is used for recursion and is the // type that will be used by the parent. For example when fieldType is a []string; a // recursive goFieldToCtyType call will return a cty.String. func goFieldToCtyType(accessor string, fieldType types.Type) (interface{}, cty.Type) { switch f := fieldType.(type) { case *types.Pointer: return goFieldToCtyType(accessor, f.Elem()) case *types.Basic: ctyType := basicKindToCtyType(f.Kind()) return &hcldec.AttrSpec{ Name: accessor, Type: ctyType, Required: false, }, ctyType case *types.Map: return &hcldec.AttrSpec{ Name: accessor, Type: cty.Map(cty.String), // for now everything can be simplified to a map[string]string }, cty.Map(cty.String) case *types.Named: // Named is the relative type when of a field with a struct. // E.g. SourceAmiFilter *common.FlatAmiFilterOptions // SourceAmiFilter will become a block with nested elements from the struct itself. underlyingType := f.Underlying() switch underlyingType.(type) { case *types.Struct: // A struct returns NilType because its HCL2Spec is written in the related file // and we don't need to write it again. return fmt.Sprintf(`&hcldec.BlockSpec{TypeName: "%s",`+ ` Nested: hcldec.ObjectSpec((*%s)(nil).HCL2Spec())}`, accessor, f.String()), cty.NilType default: return goFieldToCtyType(accessor, underlyingType) } case *types.Slice: elem := f.Elem() if ptr, isPtr := elem.(*types.Pointer); isPtr { elem = ptr.Elem() } switch elem := elem.(type) { case *types.Named: // A Slice of Named is the relative type of a filed with a slice of structs. // E.g. LaunchMappings []common.FlatBlockDevice // LaunchMappings will validate more than one block with nested elements. b := bytes.NewBuffer(nil) underlyingType := elem.Underlying() switch underlyingType.(type) { case *types.Struct: fmt.Fprintf(b, `hcldec.ObjectSpec((*%s)(nil).HCL2Spec())`, elem.String()) } return fmt.Sprintf(`&hcldec.BlockListSpec{TypeName: "%s", Nested: %s}`, accessor, b.String()), cty.NilType default: _, specType := goFieldToCtyType(accessor, elem) if specType == cty.NilType { return goFieldToCtyType(accessor, elem.Underlying()) } return &hcldec.AttrSpec{ Name: accessor, Type: cty.List(specType), Required: false, }, cty.List(specType) } } b := bytes.NewBuffer(nil) fmt.Fprintf(b, `%#v`, &hcldec.AttrSpec{ Name: accessor, Type: basicKindToCtyType(types.Bool), Required: false, }) fmt.Fprintf(b, `/* TODO(azr): could not find type */`) return b.String(), cty.NilType } func basicKindToCtyType(kind types.BasicKind) cty.Type { switch kind { case types.Bool: return cty.Bool case types.String: return cty.String case types.Int, types.Int8, types.Int16, types.Int32, types.Int64, types.Uint, types.Uint8, types.Uint16, types.Uint32, types.Uint64, types.Float32, types.Float64, types.Complex64, types.Complex128: return cty.Number case types.Invalid: return cty.String // TODO(azr): fix that beforehand ? default: log.Printf("Un handled basic kind: %d", kind) return cty.String } } func outputStructFields(w io.Writer, s *types.Struct) { for i := 0; i < s.NumFields(); i++ { field, tag := s.Field(i), s.Tag(i) fieldNameStr := field.String() fieldNameStr = strings.Replace(fieldNameStr, "field ", "", 1) fmt.Fprintf(w, " %s `%s`\n", fieldNameStr, tag) } } type NamePath struct { Name, Path string } func outputImports(w io.Writer, imports map[NamePath]*types.Package) { if len(imports) == 0 { return } // naive implementation pkgs := []NamePath{} for k := range imports { pkgs = append(pkgs, k) } sort.Slice(pkgs, func(i int, j int) bool { return pkgs[i].Path < pkgs[j].Path }) fmt.Fprint(w, "import (\n") for _, pkg := range pkgs { if pkg.Name == pkg.Path || strings.HasSuffix(pkg.Path, "/"+pkg.Name) { fmt.Fprintf(w, " \"%s\"\n", pkg.Path) } else { fmt.Fprintf(w, " %s \"%s\"\n", pkg.Name, pkg.Path) } } fmt.Fprint(w, ")\n") } func getUsedImports(s *types.Struct) map[NamePath]*types.Package { res := map[NamePath]*types.Package{} for i := 0; i < s.NumFields(); i++ { fieldType := s.Field(i).Type() if p, ok := fieldType.(*types.Pointer); ok { fieldType = p.Elem() } if p, ok := fieldType.(*types.Slice); ok { fieldType = p.Elem() } namedType, ok := fieldType.(*types.Named) if !ok { continue } pkg := namedType.Obj().Pkg() if pkg == nil { continue } res[NamePath{pkg.Name(), pkg.Path()}] = pkg } return res } func addCtyTagToStruct(s *types.Struct) *types.Struct { vars, tags := structFields(s) for i := range tags { field, tag := vars[i], tags[i] ctyAccessor := ToSnakeCase(field.Name()) st, err := structtag.Parse(tag) if err == nil { if ms, err := st.Get("mapstructure"); err == nil && ms.Name != "" { ctyAccessor = ms.Name } } st.Set(&structtag.Tag{Key: "cty", Name: ctyAccessor}) _ = st.Set(&structtag.Tag{Key: "hcl", Name: ctyAccessor}) tags[i] = st.String() } return types.NewStruct(uniqueTags("cty", vars, tags)) } func uniqueTags(tagName string, fields []*types.Var, tags []string) ([]*types.Var, []string) { outVars := []*types.Var{} outTags := []string{} uniqueTags := map[string]bool{} for i := range fields { field, tag := fields[i], tags[i] structtag, _ := structtag.Parse(tag) h, err := structtag.Get(tagName) if err == nil { if uniqueTags[h.Name] { log.Printf("skipping field %s ( duplicate `%s` %s tag )", field.Name(), h.Name, tagName) continue } uniqueTags[h.Name] = true } outVars = append(outVars, field) outTags = append(outTags, tag) } return outVars, outTags } // getMapstructureSquashedStruct will return the same struct but embedded // fields with a `mapstructure:",squash"` tag will be un-nested. func getMapstructureSquashedStruct(topPkg *types.Package, utStruct *types.Struct) *types.Struct { res := &types.Struct{} for i := 0; i < utStruct.NumFields(); i++ { field, tag := utStruct.Field(i), utStruct.Tag(i) if !field.Exported() { continue } if _, ok := field.Type().(*types.Signature); ok { continue // ignore funcs } structtag, err := structtag.Parse(tag) if err != nil { log.Printf("could not parse field tag %s of : %v", tag, err) continue } // Contains mapstructure-to-hcl2 tag if ms, err := structtag.Get("mapstructure-to-hcl2"); err == nil { // Stop if is telling to skip it if ms.HasOption("skip") { continue } } // Contains mapstructure tag if ms, err := structtag.Get("mapstructure"); err == nil { // Squash structs if ms.HasOption("squash") { ot := field.Type() uot := ot.Underlying() utStruct, utOk := uot.(*types.Struct) if !utOk { continue } res = squashStructs(res, getMapstructureSquashedStruct(topPkg, utStruct)) continue } } if field.Pkg() != topPkg { field = types.NewField(field.Pos(), topPkg, field.Name(), field.Type(), field.Embedded()) } if p, isPointer := field.Type().(*types.Pointer); isPointer { // in order to make the following switch simpler we 'unwrap' this // pointer all structs are going to be made pointers anyways. field = types.NewField(field.Pos(), field.Pkg(), field.Name(), p.Elem(), field.Embedded()) } switch f := field.Type().(type) { case *types.Named: switch f.String() { case "time.Duration": field = types.NewField(field.Pos(), field.Pkg(), field.Name(), types.NewPointer(types.Typ[types.String]), field.Embedded()) case "github.com/hashicorp/packer/packer-plugin-sdk/template/config.Trilean": // TODO(azr): unhack this situation field = types.NewField(field.Pos(), field.Pkg(), field.Name(), types.NewPointer(types.Typ[types.Bool]), field.Embedded()) case "github.com/hashicorp/packer/provisioner/powershell.ExecutionPolicy": // TODO(azr): unhack this situation field = types.NewField(field.Pos(), field.Pkg(), field.Name(), types.NewPointer(types.Typ[types.String]), field.Embedded()) default: if str, isStruct := f.Underlying().(*types.Struct); isStruct { obj := flattenNamed(f, str) field = types.NewField(field.Pos(), field.Pkg(), field.Name(), obj, field.Embedded()) field = makePointer(field) } if slice, isSlice := f.Underlying().(*types.Slice); isSlice { if f, fNamed := slice.Elem().(*types.Named); fNamed { if str, isStruct := f.Underlying().(*types.Struct); isStruct { // this is a slice of named structs; we want to change // the struct ref to a 'FlatStruct'. obj := flattenNamed(f, str) slice := types.NewSlice(obj) field = types.NewField(field.Pos(), field.Pkg(), field.Name(), slice, field.Embedded()) } } } if _, isBasic := f.Underlying().(*types.Basic); isBasic { field = makePointer(field) } } case *types.Slice: if f, fNamed := f.Elem().(*types.Named); fNamed { if str, isStruct := f.Underlying().(*types.Struct); isStruct { obj := flattenNamed(f, str) field = types.NewField(field.Pos(), field.Pkg(), field.Name(), types.NewSlice(obj), field.Embedded()) } } case *types.Basic: // since everything is optional, everything must be a pointer // non optional fields should be non pointers. field = makePointer(field) } res = addFieldToStruct(res, field, tag) } return res } func flattenNamed(f *types.Named, underlying types.Type) *types.Named { obj := f.Obj() obj = types.NewTypeName(obj.Pos(), obj.Pkg(), "Flat"+obj.Name(), obj.Type()) return types.NewNamed(obj, underlying, nil) } func makePointer(field *types.Var) *types.Var { return types.NewField(field.Pos(), field.Pkg(), field.Name(), types.NewPointer(field.Type()), field.Embedded()) } func addFieldToStruct(s *types.Struct, field *types.Var, tag string) *types.Struct { sf, st := structFields(s) return types.NewStruct(uniqueFields(append(sf, field), append(st, tag))) } func squashStructs(a, b *types.Struct) *types.Struct { va, ta := structFields(a) vb, tb := structFields(b) return types.NewStruct(uniqueFields(append(va, vb...), append(ta, tb...))) } func uniqueFields(fields []*types.Var, tags []string) ([]*types.Var, []string) { outVars := []*types.Var{} outTags := []string{} fieldNames := map[string]bool{} for i := range fields { field, tag := fields[i], tags[i] if fieldNames[field.Name()] { log.Printf("skipping duplicate %s field", field.Name()) continue } fieldNames[field.Name()] = true outVars = append(outVars, field) outTags = append(outTags, tag) } return outVars, outTags } func structFields(s *types.Struct) (vars []*types.Var, tags []string) { for i := 0; i < s.NumFields(); i++ { field, tag := s.Field(i), s.Tag(i) vars = append(vars, field) tags = append(tags, tag) } return vars, tags } var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)") var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])") func ToSnakeCase(str string) string { snake := matchFirstCap.ReplaceAllString(str, "${1}_${2}") snake = matchAllCap.ReplaceAllString(snake, "${1}_${2}") return strings.ToLower(snake) } func goFmt(filename string, b []byte) []byte { fb, err := imports.Process(filename, b, nil) if err != nil { log.Printf("formatting err: %v", err) return b } return fb } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/packer-plugin-amazon/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020252�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/packer-plugin-amazon/main.go���������������������������������������������������0000664�0000000�0000000�00000001444�13771713062�0021530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "fmt" "os" "github.com/hashicorp/packer/builder/amazon/ebs" "github.com/hashicorp/packer/builder/amazon/ebssurrogate" "github.com/hashicorp/packer/builder/amazon/ebsvolume" "github.com/hashicorp/packer/builder/osc/chroot" "github.com/hashicorp/packer/packer-plugin-sdk/plugin" amazonimport "github.com/hashicorp/packer/post-processor/amazon-import" ) func main() { pps := plugin.NewSet() pps.RegisterBuilder("ebs", new(ebs.Builder)) pps.RegisterBuilder("chroot", new(chroot.Builder)) pps.RegisterBuilder("ebssurrogate", new(ebssurrogate.Builder)) pps.RegisterBuilder("ebsvolume", new(ebsvolume.Builder)) pps.RegisterPostProcessor("import", new(amazonimport.PostProcessor)) err := pps.Run() if err != nil { fmt.Fprintln(os.Stderr, err.Error()) os.Exit(1) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/packer-plugin-check/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020042�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/packer-plugin-check/main.go����������������������������������������������������0000664�0000000�0000000�00000013206�13771713062�0021317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// packer-plugin-check is a command used by plugins to validate compatibility and basic configuration // to work with Packer. package main import ( "flag" "fmt" "io" "log" "os" "path/filepath" "strings" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer/plugin" ) const packerPluginCheck = "packer-plugin-check" var ( docs = flag.Bool("docs", false, "flag to indicate that documentation files should be checked.") load = flag.String("load", "", "flag to check if plugin can be loaded by Packer and is compatible with HCL2.") ) // Usage is a replacement usage function for the flags package. func Usage() { fmt.Fprintf(os.Stderr, "Usage of "+packerPluginCheck+":\n") fmt.Fprintf(os.Stderr, "\t"+packerPluginCheck+" [flags]\n") fmt.Fprintf(os.Stderr, "Flags:\n") flag.PrintDefaults() } func main() { log.SetFlags(0) log.SetPrefix(packerPluginCheck + ": ") flag.Usage = Usage flag.Parse() if flag.NFlag() == 0 { flag.Usage() os.Exit(2) } if *docs { if err := checkDocumentation(); err != nil { fmt.Printf(err.Error()) os.Exit(2) } fmt.Printf("Plugin succesfully passed docs check.\n") } if len(*load) > 0 { if err := checkPluginName(*load); err != nil { fmt.Printf(err.Error()) os.Exit(2) } if err := discoverAndLoad(); err != nil { fmt.Printf(err.Error()) os.Exit(2) } fmt.Printf("Plugin succesfully passed compatibility check.\n") } } // checkDocumentation looks for the presence of a docs folder with mdx files inside. // It is not possible to predict the number of mdx files for a given plugin. // Because of that, finding one file inside the folder is enough to validate the docs existence. func checkDocumentation() error { // TODO: this should be updated once we have defined what's going to be for plguin's docs wd, err := os.Getwd() if err != nil { return err } docsDir := wd + "/docs" stat, err := os.Stat(docsDir) if err != nil { return fmt.Errorf("could not find docs folter: %s", err.Error()) } if !stat.IsDir() { return fmt.Errorf("expecting docs do be a directory of mdx files") } var mdxFound bool _ = filepath.Walk(docsDir, func(path string, info os.FileInfo, err error) error { if !info.IsDir() && filepath.Ext(path) == ".mdx" { mdxFound = true return io.EOF } return nil }) if mdxFound { fmt.Printf("a mdx file was found inside the docs folder\n") return nil } return fmt.Errorf("no docs files found, make sure to have the docs in place before releasing") } // checkPluginName checks for the possible valid names for a plugin, packer-plugin-* or packer-[builder|provisioner|post-processor]-*. // If the name is prefixed with `packer-[builder|provisioner|post-processor]-`, packer won't be able to install it, // therefore a WARNING will be shown. func checkPluginName(name string) error { if strings.HasPrefix(name, "packer-plugin-") { return nil } if strings.HasPrefix(name, "packer-builder-") || strings.HasPrefix(name, "packer-provisioner-") || strings.HasPrefix(name, "packer-post-processor-") { fmt.Printf("\n[WARNING] Plugin is named with old prefix `packer-[builder|provisioner|post-processor]-{name})`. " + "These will be detected but Packer cannot install them automatically. " + "The plugin must be a multi-plugin named packer-plugin-{name} to be installable through the `packer init` command.\n") return nil } return fmt.Errorf("plugin's name is not valid") } // discoverAndLoad will discover the plugin binary from the current directory and load any builder/provisioner/post-processor // in the plugin configuration. At least one builder, provisioner, or post-processor should be found to validate the plugin's // compatibility with Packer. func discoverAndLoad() error { config := plugin.Config{ PluginMinPort: 10000, PluginMaxPort: 25000, } err := config.Discover() if err != nil { return err } // TODO: validate correctness of plugins loaded by checking them against the output of the `describe` command. builders, provisioners, postProcessors := config.GetPlugins() if len(builders) == 0 && len(provisioners) == 0 && len(postProcessors) == 0 { return fmt.Errorf("couldn't load any Builder/Provisioner/Post-Processor from the plugin binary") } return checkHCL2ConfigSpec(builders, provisioners, postProcessors) } // checkHCL2ConfigSpec checks if the hcl2spec config is present for the given plugins by validating that ConfigSpec() does not // return an empty map of specs. func checkHCL2ConfigSpec(builders packersdk.MapOfBuilder, provisioners packersdk.MapOfProvisioner, postProcessors packersdk.MapOfPostProcessor) error { var errs *packersdk.MultiError for _, b := range builders.List() { builder, err := builders.Start(b) if err != nil { return packersdk.MultiErrorAppend(err, errs) } if len(builder.ConfigSpec()) == 0 { errs = packersdk.MultiErrorAppend(fmt.Errorf("builder %q does not contain the required hcl2spec configuration", b), errs) } } for _, p := range provisioners.List() { provisioner, err := provisioners.Start(p) if err != nil { return packersdk.MultiErrorAppend(err, errs) } if len(provisioner.ConfigSpec()) == 0 { errs = packersdk.MultiErrorAppend(fmt.Errorf("provisioner %q does not contain the required hcl2spec configuration", p), errs) } } for _, pp := range postProcessors.List() { postProcessor, err := postProcessors.Start(pp) if err != nil { return packersdk.MultiErrorAppend(err, errs) } if len(postProcessor.ConfigSpec()) == 0 { errs = packersdk.MultiErrorAppend(fmt.Errorf("post-processor %q does not contain the required hcl2spec configuration", pp), errs) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/snippet-extractor/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017721�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/snippet-extractor/main.go������������������������������������������������������0000664�0000000�0000000�00000007534�13771713062�0021205�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// snippet-extract --begin=#_BEGIN_WRAP_TAG_ --end=#_END_WRAP_TAG_ -output_dir=./docs/ [./file|./directory/]... // Extracts markdown snippets from relative files into output_dir, keeping the // directory layout. // It is not mandatory to terminate a snippet, the extractor will simply add // line until EOF. // Lines matching begin or end tags will not be put in the resulting file. // When a directory is passed, all files from directory will be parsed. package main import ( "bufio" "bytes" "flag" "fmt" "io/ioutil" "log" "os" "path/filepath" "strings" ) type options struct { filenames []string begin, end string outputDir string extension string } func (o *options) AddFlagSets(fs *flag.FlagSet) { fs.StringVar(&o.begin, "begin", "#_BEGIN_WRAP_TAG_", "flag to mark beginning of a snippet") fs.StringVar(&o.end, "end", "#_END_WRAP_TAG_", "flag to mark ending of a snippet") fs.StringVar(&o.outputDir, "output_dir", "./docs/", "directory in which the files will be generated, note that the directory layout is kept") fs.StringVar(&o.extension, "extension", ".mdx", "extension for generated files") } func main() { fs := flag.NewFlagSet("snippet-extract", flag.ContinueOnError) opts := options{} opts.AddFlagSets(fs) if err := fs.Parse(os.Args[1:]); err != nil { fs.Usage() os.Exit(1) } wd, _ := os.Getwd() fmt.Printf("working from %s\n", wd) opts.filenames = extactFilenames(fs.Args()) for _, filename := range opts.filenames { ext := filepath.Ext(filename) snippets := extractSnippets(opts.begin, opts.end, filename) for _, snippet := range snippets { outputFile := filepath.Join(opts.outputDir, filepath.Base(filename), snippet.Identifier+opts.extension) folder := filepath.Dir(outputFile) err := os.MkdirAll(folder, os.ModePerm) if err != nil { log.Printf("cannot mkdir %s: %s", folder, err) } f := bytes.NewBuffer(nil) fmt.Fprintf(f, `<!-- Code generated by snippet-extractor %s; DO NOT EDIT MANUALLY -->`, strings.Join(os.Args[1:], " ")) fmt.Fprintf(f, "\n\n```%s\n%s```\n", ext, snippet.Text) err = ioutil.WriteFile(outputFile, f.Bytes(), 0600) if err != nil { log.Printf("cannot write %s in %s: %s", filepath.Base(outputFile), folder, err) } } } } type snippet struct { Identifier string Text string Closed bool } func extractSnippets(beginPattern, endPattern, filename string) []snippet { file, err := os.Open(filename) if err != nil { log.Printf("could not open file: %s", err) os.Exit(1) } defer file.Close() scanner := bufio.NewScanner(file) snippets := []snippet{} for scanner.Scan() { line := scanner.Text() if identifier := matches(line, beginPattern); identifier != "" { snippets = append(snippets, snippet{ Identifier: identifier, }) continue } if identifier := matches(line, endPattern); identifier != "" { for i := range snippets { snippet := &snippets[i] if snippet.Identifier == identifier { snippet.Closed = true } } continue } for i := range snippets { snippet := &snippets[i] if snippet.Closed { continue } snippet.Text = snippet.Text + line + "\n" } } return snippets } func matches(s, prefix string) string { trimmed := strings.TrimSpace(s) lenDiff := len(s) - len(trimmed) if strings.HasPrefix(trimmed, prefix) { return s[len(prefix)+lenDiff:] } return "" } // if an entry is a directory all files from directory will be listed. func extactFilenames(in []string) []string { out := []string{} for _, path := range in { fi, err := os.Stat(path) if err != nil { log.Fatalf("%s: %s", path, err) } if !fi.IsDir() { out = append(out, path) continue } files, err := ioutil.ReadDir(path) if err != nil { log.Fatalf("could not read directory %s: %s", path, err) } for _, file := range files { if file.IsDir() { continue } out = append(out, file.Name()) } } return in } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/ssh-keygen/��������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016303�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/ssh-keygen/main.go�������������������������������������������������������������0000664�0000000�0000000�00000004676�13771713062�0017573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "flag" "io/ioutil" "log" "os" "os/user" "path/filepath" "github.com/hashicorp/packer/packer-plugin-sdk/communicator/sshkey" ) type options struct { Type string Bits int Filename string } func (o *options) AddFlagSets(fs *flag.FlagSet) { fs.StringVar(&o.Type, "type", "rsa", `dsa | ecdsa | ed25519 | rsa Specifies the type of key to create. The possible values are 'dsa', 'ecdsa', 'ed25519', or 'rsa'. `) fs.IntVar(&o.Bits, "bits", 0, `Specifies the number of bits in the key to create. By default maximum number will be picked. For RSA keys, the minimum size is 1024 bits and the default is 3072 bits. Generally, 3072 bits is considered sufficient. DSA keys must be exactly 1024 bits as specified by FIPS 186-2. For ECDSA keys, the bits flag determines the key length by selecting from one of three elliptic curve sizes: 256, 384 or 521 bits. Attempting to use bit lengths other than these three values for ECDSA keys will fail. Ed25519 keys have a fixed length and the bits flag will be ignored. `) defaultPath := "" user, err := user.Current() if err == nil { defaultPath = filepath.Join(user.HomeDir, ".ssh", "tests") } fs.StringVar(&o.Filename, "filename", defaultPath, `Specifies the filename of the key file. `) } func main() { log.SetFlags(0) log.SetPrefix("ssh-keygen: ") fs := flag.NewFlagSet("ssh-keygen", flag.ContinueOnError) cla := options{} cla.AddFlagSets(fs) if err := fs.Parse(os.Args[1:]); err != nil { log.Fatal(err) } algo, err := sshkey.AlgorithmString(cla.Type) if err != nil { log.Fatal(err) } log.Printf("Generating public/private %s key pair.", algo) keypair, err := sshkey.GeneratePair(algo, nil, cla.Bits) if err != nil { log.Fatal(err) } if isDir(cla.Filename) { cla.Filename = filepath.Join(cla.Filename, "id_"+algo.String()) } if fileExists(cla.Filename) { log.Fatalf("%s already exists.", cla.Filename) } log.Printf("Saving private key to %s", cla.Filename) if err := ioutil.WriteFile(cla.Filename, keypair.Private, 0600); err != nil { log.Fatal(err) } publicFilename := cla.Filename + ".pub" log.Printf("Saving public key to %s", publicFilename) if err := ioutil.WriteFile(publicFilename, keypair.Public, 0644); err != nil { log.Fatal(err) } } func isDir(filename string) bool { info, err := os.Stat(filename) if err != nil { log.Fatal(err) } return info.IsDir() } func fileExists(filename string) bool { _, err := os.Stat(filename) return err == nil } ������������������������������������������������������������������packer-1.6.6+ds1/cmd/struct-markdown/���������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017372�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/struct-markdown/main.go��������������������������������������������������������0000664�0000000�0000000�00000010016�13771713062�0020643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "flag" "fmt" "go/ast" "go/parser" "go/token" "io/ioutil" "os" "path/filepath" "strings" "github.com/fatih/camelcase" "github.com/fatih/structtag" ) func main() { args := flag.Args() if len(args) == 0 { // Default: process the file args = []string{os.Getenv("GOFILE")} } fname := args[0] absFilePath, err := filepath.Abs(fname) if err != nil { panic(err) } projectRoot := os.Getenv("PROJECT_ROOT") var paths []string if projectRoot == "" { // fall back to the packer root. paths = strings.SplitAfter(absFilePath, "packer"+string(os.PathSeparator)) projectRoot = paths[0] } else { paths = strings.SplitAfter(absFilePath, projectRoot+string(os.PathSeparator)) } builderName, _ := filepath.Split(paths[1]) builderName = strings.Trim(builderName, string(os.PathSeparator)) b, err := ioutil.ReadFile(fname) if err != nil { fmt.Printf("ReadFile: %+v", err) os.Exit(1) } fset := token.NewFileSet() f, err := parser.ParseFile(fset, fname, b, parser.ParseComments) if err != nil { fmt.Printf("ParseFile: %+v", err) os.Exit(1) } for _, decl := range f.Decls { typeDecl, ok := decl.(*ast.GenDecl) if !ok { continue } typeSpec, ok := typeDecl.Specs[0].(*ast.TypeSpec) if !ok { continue } structDecl, ok := typeSpec.Type.(*ast.StructType) if !ok { continue } fields := structDecl.Fields.List sourcePath := filepath.ToSlash(paths[1]) header := Struct{ SourcePath: sourcePath, Name: typeSpec.Name.Name, Filename: typeSpec.Name.Name + ".mdx", Header: strings.TrimSpace(typeDecl.Doc.Text()), } required := Struct{ SourcePath: sourcePath, Name: typeSpec.Name.Name, Filename: typeSpec.Name.Name + "-required.mdx", } notRequired := Struct{ SourcePath: sourcePath, Name: typeSpec.Name.Name, Filename: typeSpec.Name.Name + "-not-required.mdx", } for _, field := range fields { if len(field.Names) == 0 || field.Tag == nil { continue } tag := field.Tag.Value[1:] tag = tag[:len(tag)-1] tags, err := structtag.Parse(tag) if err != nil { fmt.Printf("structtag.Parse(%s): err: %v", field.Tag.Value, err) os.Exit(1) } // Leave undocumented tags out of markdown. This is useful for // fields which exist for backwards compatability, or internal-use // only fields undocumented, _ := tags.Get("undocumented") if undocumented != nil { if undocumented.Name == "true" { continue } } mstr, err := tags.Get("mapstructure") if err != nil { continue } name := mstr.Name if name == "" { continue } var docs string if field.Doc != nil { docs = field.Doc.Text() } else { docs = strings.Join(camelcase.Split(field.Names[0].Name), " ") } if strings.Contains(docs, "TODO") { continue } fieldType := string(b[field.Type.Pos()-1 : field.Type.End()-1]) fieldType = strings.ReplaceAll(fieldType, "*", `\*`) switch fieldType { case "time.Duration": fieldType = `duration string | ex: "1h5m2s"` case "config.Trilean": fieldType = `boolean` case "config.NameValues": fieldType = `[]{name string, value string}` case "config.KeyValues": fieldType = `[]{key string, value string}` } field := Field{ Name: name, Type: fieldType, Docs: docs, } if req, err := tags.Get("required"); err == nil && req.Value() == "true" { required.Fields = append(required.Fields, field) } else { notRequired.Fields = append(notRequired.Fields, field) } } dir := filepath.Join(projectRoot, "website", "content", "partials", builderName) os.MkdirAll(dir, 0755) for _, str := range []Struct{header, required, notRequired} { if len(str.Fields) == 0 && len(str.Header) == 0 { continue } outputPath := filepath.Join(dir, str.Filename) outputFile, err := os.Create(outputPath) if err != nil { panic(err) } defer outputFile.Close() err = structDocsTemplate.Execute(outputFile, str) if err != nil { fmt.Printf("%v", err) os.Exit(1) } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/cmd/struct-markdown/template.go����������������������������������������������������0000664�0000000�0000000�00000001412�13771713062�0021532�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "strings" "text/template" ) type Field struct { Name string Type string Docs string } type Struct struct { SourcePath string Name string Filename string Header string Fields []Field } var structDocsTemplate = template.Must(template.New("structDocsTemplate"). Funcs(template.FuncMap{ "indent": indent, }). Parse(`<!-- Code generated from the comments of the {{ .Name }} struct in {{ .SourcePath }}; DO NOT EDIT MANUALLY --> {{ if .Header }} {{ .Header }} {{ end -}} {{ range .Fields }} - ` + "`" + `{{ .Name}}` + "`" + ` ({{ .Type }}) - {{ .Docs | indent 2 }} {{ end }}`)) func indent(spaces int, v string) string { pad := strings.Repeat(" ", spaces) return strings.TrimSpace(strings.Replace(v, "\n", "\n"+pad, -1)) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/���������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0015101�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/build.go�������������������������������������������������������������������0000664�0000000�0000000�00000027167�13771713062�0016544�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bytes" "context" "fmt" "log" "math" "strconv" "strings" "sync" "time" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclparse" "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template" "github.com/hashicorp/packer/version" "golang.org/x/sync/semaphore" "github.com/hako/durafmt" "github.com/posener/complete" ) type BuildCommand struct { Meta } func (c *BuildCommand) Run(args []string) int { ctx, cleanup := handleTermInterrupt(c.Ui) defer cleanup() cfg, ret := c.ParseArgs(args) if ret != 0 { return ret } return c.RunContext(ctx, cfg) } func (c *BuildCommand) ParseArgs(args []string) (*BuildArgs, int) { var cfg BuildArgs flags := c.Meta.FlagSet("build", FlagSetBuildFilter|FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { return &cfg, 1 } if cfg.ParallelBuilds < 1 { cfg.ParallelBuilds = math.MaxInt64 } args = flags.Args() if len(args) != 1 { flags.Usage() return &cfg, 1 } cfg.Path = args[0] return &cfg, 0 } func (m *Meta) GetConfigFromHCL(cla *MetaArgs) (*hcl2template.PackerConfig, int) { parser := &hcl2template.Parser{ CorePackerVersion: version.SemVer, CorePackerVersionString: version.FormattedVersion(), Parser: hclparse.NewParser(), BuilderSchemas: m.CoreConfig.Components.BuilderStore, ProvisionersSchemas: m.CoreConfig.Components.ProvisionerStore, PostProcessorsSchemas: m.CoreConfig.Components.PostProcessorStore, } cfg, diags := parser.Parse(cla.Path, cla.VarFiles, cla.Vars) return cfg, writeDiags(m.Ui, parser.Files(), diags) } func writeDiags(ui packersdk.Ui, files map[string]*hcl.File, diags hcl.Diagnostics) int { // write HCL errors/diagnostics if any. b := bytes.NewBuffer(nil) err := hcl.NewDiagnosticTextWriter(b, files, 80, false).WriteDiagnostics(diags) if err != nil { ui.Error("could not write diagnostic: " + err.Error()) return 1 } if b.Len() != 0 { if diags.HasErrors() { ui.Error(b.String()) return 1 } ui.Say(b.String()) } return 0 } func (m *Meta) GetConfig(cla *MetaArgs) (packer.Handler, int) { cfgType, err := cla.GetConfigType() if err != nil { m.Ui.Error(fmt.Sprintf("%q: %s", cla.Path, err)) return nil, 1 } switch cfgType { case ConfigTypeHCL2: // TODO(azr): allow to pass a slice of files here. return m.GetConfigFromHCL(cla) default: // TODO: uncomment once we've polished HCL a bit more. // c.Ui.Say(`Legacy JSON Configuration Will Be Used. // The template will be parsed in the legacy configuration style. This style // will continue to work but users are encouraged to move to the new style. // See: https://packer.io/guides/hcl // `) return m.GetConfigFromJSON(cla) } } func (m *Meta) GetConfigFromJSON(cla *MetaArgs) (packer.Handler, int) { // Parse the template var tpl *template.Template var err error if cla.Path == "" { // here cla validation passed so this means we want a default builder // and we probably are in the console command tpl, err = template.Parse(TiniestBuilder) } else { tpl, err = template.ParseFile(cla.Path) } if err != nil { m.Ui.Error(fmt.Sprintf("Failed to parse template: %s", err)) return nil, 1 } // Get the core core, err := m.Core(tpl, cla) ret := 0 if err != nil { m.Ui.Error(err.Error()) ret = 1 } return &CoreWrapper{core}, ret } func (c *BuildCommand) RunContext(buildCtx context.Context, cla *BuildArgs) int { packerStarter, ret := c.GetConfig(&cla.MetaArgs) if ret != 0 { return ret } diags := packerStarter.Initialize() ret = writeDiags(c.Ui, nil, diags) if ret != 0 { return ret } builds, diags := packerStarter.GetBuilds(packer.GetBuildsOptions{ Only: cla.Only, Except: cla.Except, Debug: cla.Debug, Force: cla.Force, OnError: cla.OnError, }) // here, something could have gone wrong but we still want to run valid // builds. ret = writeDiags(c.Ui, nil, diags) if cla.Debug { c.Ui.Say("Debug mode enabled. Builds will not be parallelized.") } // Compile all the UIs for the builds colors := [5]packer.UiColor{ packer.UiColorGreen, packer.UiColorCyan, packer.UiColorMagenta, packer.UiColorYellow, packer.UiColorBlue, } buildUis := make(map[packersdk.Build]packersdk.Ui) for i := range builds { ui := c.Ui if cla.Color { // Only set up UI colors if -machine-readable isn't set. if _, ok := c.Ui.(*packer.MachineReadableUi); !ok { ui = &packer.ColoredUi{ Color: colors[i%len(colors)], Ui: ui, } ui.Say(fmt.Sprintf("%s: output will be in this color.", builds[i].Name())) if i+1 == len(builds) { // Add a newline between the color output and the actual output c.Ui.Say("") } } } // Now add timestamps if requested if cla.TimestampUi { ui = &packer.TimestampedUi{ Ui: ui, } } buildUis[builds[i]] = ui } log.Printf("Build debug mode: %v", cla.Debug) log.Printf("Force build: %v", cla.Force) log.Printf("On error: %v", cla.OnError) // Get the start of the build command buildCommandStart := time.Now() // Run all the builds in parallel and wait for them to complete var wg sync.WaitGroup var artifacts = struct { sync.RWMutex m map[string][]packersdk.Artifact }{m: make(map[string][]packersdk.Artifact)} // Get the builds we care about var errors = struct { sync.RWMutex m map[string]error }{m: make(map[string]error)} limitParallel := semaphore.NewWeighted(cla.ParallelBuilds) for i := range builds { if err := buildCtx.Err(); err != nil { log.Println("Interrupted, not going to start any more builds.") break } b := builds[i] name := b.Name() ui := buildUis[b] if err := limitParallel.Acquire(buildCtx, 1); err != nil { ui.Error(fmt.Sprintf("Build '%s' failed to acquire semaphore: %s", name, err)) errors.Lock() errors.m[name] = err errors.Unlock() break } // Increment the waitgroup so we wait for this item to finish properly wg.Add(1) // Run the build in a goroutine go func() { // Get the start of the build buildStart := time.Now() defer wg.Done() defer limitParallel.Release(1) log.Printf("Starting build run: %s", name) runArtifacts, err := b.Run(buildCtx, ui) // Get the duration of the build and parse it buildEnd := time.Now() buildDuration := buildEnd.Sub(buildStart) fmtBuildDuration := durafmt.Parse(buildDuration).LimitFirstN(2) if err != nil { ui.Error(fmt.Sprintf("Build '%s' errored after %s: %s", name, fmtBuildDuration, err)) errors.Lock() errors.m[name] = err errors.Unlock() } else { ui.Say(fmt.Sprintf("Build '%s' finished after %s.", name, fmtBuildDuration)) if nil != runArtifacts { artifacts.Lock() artifacts.m[name] = runArtifacts artifacts.Unlock() } } }() if cla.Debug { log.Printf("Debug enabled, so waiting for build to finish: %s", b.Name()) wg.Wait() } if cla.ParallelBuilds == 1 { log.Printf("Parallelization disabled, waiting for build to finish: %s", b.Name()) wg.Wait() } } // Wait for both the builds to complete and the interrupt handler, // if it is interrupted. log.Printf("Waiting on builds to complete...") wg.Wait() // Get the duration of the buildCommand command and parse it buildCommandEnd := time.Now() buildCommandDuration := buildCommandEnd.Sub(buildCommandStart) fmtBuildCommandDuration := durafmt.Parse(buildCommandDuration).LimitFirstN(2) c.Ui.Say(fmt.Sprintf("\n==> Wait completed after %s", fmtBuildCommandDuration)) if err := buildCtx.Err(); err != nil { c.Ui.Say("Cleanly cancelled builds after being interrupted.") return 1 } if len(errors.m) > 0 { c.Ui.Machine("error-count", strconv.FormatInt(int64(len(errors.m)), 10)) c.Ui.Error("\n==> Some builds didn't complete successfully and had errors:") for name, err := range errors.m { // Create a UI for the machine readable stuff to be targeted ui := &packer.TargetedUI{ Target: name, Ui: c.Ui, } ui.Machine("error", err.Error()) c.Ui.Error(fmt.Sprintf("--> %s: %s", name, err)) } } if len(artifacts.m) > 0 { c.Ui.Say("\n==> Builds finished. The artifacts of successful builds are:") for name, buildArtifacts := range artifacts.m { // Create a UI for the machine readable stuff to be targeted ui := &packer.TargetedUI{ Target: name, Ui: c.Ui, } // Machine-readable helpful ui.Machine("artifact-count", strconv.FormatInt(int64(len(buildArtifacts)), 10)) for i, artifact := range buildArtifacts { var message bytes.Buffer fmt.Fprintf(&message, "--> %s: ", name) if artifact != nil { fmt.Fprint(&message, artifact.String()) } else { fmt.Fprint(&message, "<nothing>") } iStr := strconv.FormatInt(int64(i), 10) if artifact != nil { ui.Machine("artifact", iStr, "builder-id", artifact.BuilderId()) ui.Machine("artifact", iStr, "id", artifact.Id()) ui.Machine("artifact", iStr, "string", artifact.String()) files := artifact.Files() ui.Machine("artifact", iStr, "files-count", strconv.FormatInt(int64(len(files)), 10)) for fi, file := range files { fiStr := strconv.FormatInt(int64(fi), 10) ui.Machine("artifact", iStr, "file", fiStr, file) } } else { ui.Machine("artifact", iStr, "nil") } ui.Machine("artifact", iStr, "end") c.Ui.Say(message.String()) } } } else { c.Ui.Say("\n==> Builds finished but no artifacts were created.") } if len(errors.m) > 0 { // If any errors occurred, exit with a non-zero exit status ret = 1 } return ret } func (*BuildCommand) Help() string { helpText := ` Usage: packer build [options] TEMPLATE Will execute multiple builds in parallel as defined in the template. The various artifacts created by the template will be outputted. Options: -color=false Disable color output. (Default: color) -debug Debug mode enabled for builds. -except=foo,bar,baz Run all builds and post-processors other than these. -only=foo,bar,baz Build only the specified builds. -force Force a build to continue if artifacts exist, deletes existing artifacts. -machine-readable Produce machine-readable output. -on-error=[cleanup|abort|ask|run-cleanup-provisioner] If the build fails do: clean up (default), abort, ask, or run-cleanup-provisioner. -parallel-builds=1 Number of builds to run in parallel. 1 disables parallelization. 0 means no limit (Default: 0) -timestamp-ui Enable prefixing of each ui output with an RFC3339 timestamp. -var 'key=value' Variable for templates, can be used multiple times. -var-file=path JSON or HCL2 file containing user variables. ` return strings.TrimSpace(helpText) } func (*BuildCommand) Synopsis() string { return "build image(s) from template" } func (*BuildCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing } func (*BuildCommand) AutocompleteFlags() complete.Flags { return complete.Flags{ "-color": complete.PredictNothing, "-debug": complete.PredictNothing, "-except": complete.PredictNothing, "-only": complete.PredictNothing, "-force": complete.PredictNothing, "-machine-readable": complete.PredictNothing, "-on-error": complete.PredictNothing, "-parallel": complete.PredictNothing, "-timestamp-ui": complete.PredictNothing, "-var": complete.PredictNothing, "-var-file": complete.PredictNothing, } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/build_cancellation_test.go�������������������������������������������������0000664�0000000�0000000�00000004331�13771713062�0022303�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "context" "path/filepath" "testing" "time" "github.com/google/go-cmp/cmp" ) func TestBuildCommand_RunContext_CtxCancel(t *testing.T) { tests := []struct { name string args []string parallelPassingTests int expected int }{ {"cancel 1 pending build - parallel=true", []string{"-parallel-builds=10", filepath.Join(testFixture("parallel"), "1lock-5wg.json")}, 5, 1, }, {"cancel in the middle with 2 pending builds - parallel=true", []string{"-parallel-builds=10", filepath.Join(testFixture("parallel"), "2lock-4wg.json")}, 4, 1, }, {"cancel 1 locked build - debug - parallel=true", []string{"-parallel-builds=10", "-debug=true", filepath.Join(testFixture("parallel"), "1lock.json")}, 0, 1, }, {"cancel 2 locked builds - debug - parallel=true", []string{"-parallel-builds=10", "-debug=true", filepath.Join(testFixture("parallel"), "2lock.json")}, 0, 1, }, {"cancel 1 locked build - debug - parallel=false", []string{"-parallel-builds=1", "-debug=true", filepath.Join(testFixture("parallel"), "1lock.json")}, 0, 1, }, {"cancel 2 locked builds - debug - parallel=false", []string{"-parallel-builds=1", "-debug=true", filepath.Join(testFixture("parallel"), "2lock.json")}, 0, 1, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { t.Parallel() b := NewParallelTestBuilder(tt.parallelPassingTests) locked := &LockedBuilder{unlock: make(chan interface{})} c := &BuildCommand{ Meta: testMetaParallel(t, b, locked), } ctx, cancelCtx := context.WithCancel(context.Background()) codeC := make(chan int) go func() { defer close(codeC) cfg, ret := c.ParseArgs(tt.args) if ret != 0 { t.Fatal("ParseArgs failed.") } codeC <- c.RunContext(ctx, cfg) }() t.Logf("waiting for passing tests if any") b.wg.Wait() // ran `tt.parallelPassingTests` times t.Logf("cancelling context") cancelCtx() select { case code := <-codeC: if code != tt.expected { t.Logf("wrong code: %s", cmp.Diff(code, tt.expected)) fatalCommand(t, c.Meta) } case <-time.After(15 * time.Second): t.Fatal("deadlock") } }) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/build_cleanup_script_test.go�����������������������������������������������0000664�0000000�0000000�00000000725�13771713062�0022665�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "path/filepath" "testing" ) func TestBuildWithCleanupScript(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } args := []string{ "-parallel-builds=1", filepath.Join(testFixture("cleanup-script"), "template.json"), } defer cleanup() // build should exit with error code! if code := c.Run(args); code == 0 { fatalCommand(t, c.Meta) } if !fileExists("ducky.txt") { t.Errorf("Expected to find ducky.txt") } } �������������������������������������������packer-1.6.6+ds1/command/build_parallel_test.go�����������������������������������������������������0000664�0000000�0000000�00000010533�13771713062�0021444�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bytes" "context" "fmt" "path/filepath" "sync" "testing" "github.com/hashicorp/hcl/v2/hcldec" "golang.org/x/sync/errgroup" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/provisioner/sleep" ) // NewParallelTestBuilder will return a New ParallelTestBuilder that will // unlock after `runs` builds func NewParallelTestBuilder(runs int) *ParallelTestBuilder { pb := &ParallelTestBuilder{} pb.wg.Add(runs) return pb } // The ParallelTestBuilder's first run will lock type ParallelTestBuilder struct { wg sync.WaitGroup } func (b *ParallelTestBuilder) ConfigSpec() hcldec.ObjectSpec { return nil } func (b *ParallelTestBuilder) Prepare(raws ...interface{}) ([]string, []string, error) { return nil, nil, nil } func (b *ParallelTestBuilder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { ui.Say("building") b.wg.Done() return nil, nil } // LockedBuilder wont run until unlock is called type LockedBuilder struct{ unlock chan interface{} } func (b *LockedBuilder) ConfigSpec() hcldec.ObjectSpec { return nil } func (b *LockedBuilder) Prepare(raws ...interface{}) ([]string, []string, error) { return nil, nil, nil } func (b *LockedBuilder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { ui.Say("locking build") select { case <-b.unlock: case <-ctx.Done(): return nil, ctx.Err() } return nil, nil } // testMetaFile creates a Meta object that includes a file builder func testMetaParallel(t *testing.T, builder *ParallelTestBuilder, locked *LockedBuilder) Meta { var out, err bytes.Buffer return Meta{ CoreConfig: &packer.CoreConfig{ Components: packer.ComponentFinder{ BuilderStore: packersdk.MapOfBuilder{ "parallel-test": func() (packersdk.Builder, error) { return builder, nil }, "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, "lock": func() (packersdk.Builder, error) { return locked, nil }, }, ProvisionerStore: packersdk.MapOfProvisioner{ "sleep": func() (packersdk.Provisioner, error) { return &sleep.Provisioner{}, nil }, }, }, }, Ui: &packersdk.BasicUi{ Writer: &out, ErrorWriter: &err, }, } } func TestBuildParallel_1(t *testing.T) { // testfile has 6 builds, with first one locks 'forever', other builds // should go through. b := NewParallelTestBuilder(5) locked := &LockedBuilder{unlock: make(chan interface{})} c := &BuildCommand{ Meta: testMetaParallel(t, b, locked), } args := []string{ fmt.Sprintf("-parallel-builds=10"), filepath.Join(testFixture("parallel"), "1lock-5wg.json"), } wg := errgroup.Group{} wg.Go(func() error { if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } return nil }) b.wg.Wait() // ran 5 times close(locked.unlock) // unlock locking one wg.Wait() // wait for termination } func TestBuildParallel_2(t *testing.T) { // testfile has 6 builds, 2 of them lock 'forever', other builds // should go through. b := NewParallelTestBuilder(4) locked := &LockedBuilder{unlock: make(chan interface{})} c := &BuildCommand{ Meta: testMetaParallel(t, b, locked), } args := []string{ fmt.Sprintf("-parallel-builds=3"), filepath.Join(testFixture("parallel"), "2lock-4wg.json"), } wg := errgroup.Group{} wg.Go(func() error { if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } return nil }) b.wg.Wait() // ran 4 times close(locked.unlock) // unlock locking one wg.Wait() // wait for termination } func TestBuildParallel_Timeout(t *testing.T) { // testfile has 6 builds, 1 of them locks 'forever', one locks and times // out other builds should go through. b := NewParallelTestBuilder(4) locked := &LockedBuilder{unlock: make(chan interface{})} c := &BuildCommand{ Meta: testMetaParallel(t, b, locked), } args := []string{ fmt.Sprintf("-parallel-builds=3"), filepath.Join(testFixture("parallel"), "2lock-timeout.json"), } wg := errgroup.Group{} wg.Go(func() error { if code := c.Run(args); code == 0 { fatalCommand(t, c.Meta) } return nil }) b.wg.Wait() // ran 4 times close(locked.unlock) // unlock locking one wg.Wait() // wait for termination } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/build_test.go��������������������������������������������������������������0000664�0000000�0000000�00000056633�13771713062�0017603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bytes" "fmt" "io/ioutil" "math" "os" "path/filepath" "runtime" "strings" "testing" "github.com/google/go-cmp/cmp" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/builder/null" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/post-processor/manifest" shell_local_pp "github.com/hashicorp/packer/post-processor/shell-local" filep "github.com/hashicorp/packer/provisioner/file" "github.com/hashicorp/packer/provisioner/shell" shell_local "github.com/hashicorp/packer/provisioner/shell-local" ) var ( spaghettiCarbonara = `spaghetti carbonara ` lasagna = `lasagna tomato mozza cooking... ` tiramisu = `whip_york mascarpone whipped_egg_white dress ` ) func TestBuild(t *testing.T) { tc := []struct { name string args []string expectedCode int fileCheck }{ { name: "var-args: json - json varfile sets an apple env var", args: []string{ "-var-file=" + filepath.Join(testFixture("var-arg"), "apple.json"), filepath.Join(testFixture("var-arg"), "fruit_builder.json"), }, fileCheck: fileCheck{expected: []string{"apple.txt"}}, }, { name: "json - json varfile sets an apple env var, " + "override with banana cli var", args: []string{ "-var", "fruit=banana", "-var-file=" + filepath.Join(testFixture("var-arg"), "apple.json"), filepath.Join(testFixture("var-arg"), "fruit_builder.json"), }, fileCheck: fileCheck{expected: []string{"banana.txt"}}, }, { name: "var-args: json - arg sets a pear env var", args: []string{ "-var=fruit=pear", filepath.Join(testFixture("var-arg"), "fruit_builder.json"), }, fileCheck: fileCheck{expected: []string{"pear.txt"}}, }, { name: "var-args: json - inexistent var file errs", args: []string{ "-var-file=" + filepath.Join(testFixture("var-arg"), "potato.json"), filepath.Join(testFixture("var-arg"), "fruit_builder.json"), }, expectedCode: 1, fileCheck: fileCheck{notExpected: []string{"potato.txt"}}, }, { name: "var-args: hcl - inexistent json var file errs", args: []string{ "-var-file=" + filepath.Join(testFixture("var-arg"), "potato.json"), testFixture("var-arg"), }, expectedCode: 1, fileCheck: fileCheck{notExpected: []string{"potato.txt"}}, }, { name: "var-args: hcl - inexistent hcl var file errs", args: []string{ "-var-file=" + filepath.Join(testFixture("var-arg"), "potato.hcl"), testFixture("var-arg"), }, expectedCode: 1, fileCheck: fileCheck{notExpected: []string{"potato.hcl"}}, }, { name: "var-args: hcl - auto varfile sets a chocolate env var", args: []string{ testFixture("var-arg"), }, fileCheck: fileCheck{expected: []string{"chocolate.txt"}}, }, { name: "var-args: hcl - hcl varfile sets a apple env var", args: []string{ "-var-file=" + filepath.Join(testFixture("var-arg"), "apple.hcl"), testFixture("var-arg"), }, fileCheck: fileCheck{expected: []string{"apple.txt"}}, }, { name: "var-args: hcl - json varfile sets a apple env var", args: []string{ "-var-file=" + filepath.Join(testFixture("var-arg"), "apple.json"), testFixture("var-arg"), }, fileCheck: fileCheck{expected: []string{"apple.txt"}}, }, { name: "var-args: hcl - arg sets a tomato env var", args: []string{ "-var=fruit=tomato", testFixture("var-arg"), }, fileCheck: fileCheck{expected: []string{"tomato.txt"}}, }, { name: "source name: HCL", args: []string{ "-parallel-builds=1", // to ensure order is kept testFixture("build-name-and-type"), }, fileCheck: fileCheck{ expectedContent: map[string]string{ "manifest.json": `{ "builds": [ { "name": "test", "builder_type": "null", "files": null, "artifact_id": "Null", "packer_run_uuid": "", "custom_data": null }, { "name": "potato", "builder_type": "null", "files": null, "artifact_id": "Null", "packer_run_uuid": "", "custom_data": null } ], "last_run_uuid": "" }`, }, }, }, { name: "build name: JSON except potato", args: []string{ "-except=potato", "-parallel-builds=1", // to ensure order is kept filepath.Join(testFixture("build-name-and-type"), "all.json"), }, fileCheck: fileCheck{ expected: []string{ "null.test.txt", "null.potato.txt", }, expectedContent: map[string]string{ "manifest.json": `{ "builds": [ { "name": "test", "builder_type": "null", "files": null, "artifact_id": "Null", "packer_run_uuid": "", "custom_data": null } ], "last_run_uuid": "" }`, }, }, }, { name: "build name: JSON only potato", args: []string{ "-only=potato", "-parallel-builds=1", // to ensure order is kept filepath.Join(testFixture("build-name-and-type"), "all.json"), }, fileCheck: fileCheck{ expectedContent: map[string]string{ "manifest.json": `{ "builds": [ { "name": "potato", "builder_type": "null", "files": null, "artifact_id": "Null", "packer_run_uuid": "", "custom_data": null } ], "last_run_uuid": "" }`, }, }, }, // only / except HCL2 { name: "hcl - 'except' a build block", args: []string{ "-except=my_build.*", testFixture("hcl-only-except"), }, fileCheck: fileCheck{ expected: []string{"cherry.txt"}, notExpected: []string{"chocolate.txt", "vanilla.txt"}, }, }, { name: "hcl - 'only' a build block", args: []string{ "-only=my_build.*", testFixture("hcl-only-except"), }, fileCheck: fileCheck{ notExpected: []string{"cherry.txt"}, expected: []string{"chocolate.txt", "vanilla.txt"}, }, }, // recipes { name: "hcl - recipes", args: []string{ testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ expectedContent: map[string]string{ "NULL.spaghetti_carbonara.txt": spaghettiCarbonara, "NULL.lasagna.txt": lasagna, "NULL.tiramisu.txt": tiramisu, }, }, }, { name: "hcl - recipes - except carbonara", args: []string{ "-except", "recipes.null.spaghetti_carbonara", testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ notExpected: []string{"NULL.spaghetti_carbonara.txt"}, expectedContent: map[string]string{ "NULL.lasagna.txt": lasagna, "NULL.tiramisu.txt": tiramisu, }, }, }, { name: "hcl - recipes - only lasagna", args: []string{ "-only", "*lasagna", testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ notExpected: []string{ "NULL.spaghetti_carbonara.txt", "NULL.tiramisu.txt", }, expectedContent: map[string]string{ "NULL.lasagna.txt": lasagna, }, }, }, { name: "hcl - recipes - only recipes", args: []string{ "-only", "recipes.*", testFixture("hcl", "recipes"), }, fileCheck: fileCheck{ notExpected: []string{ "NULL.tiramisu.txt", }, expectedContent: map[string]string{ "NULL.spaghetti_carbonara.txt": spaghettiCarbonara, "NULL.lasagna.txt": lasagna, }, }, }, { name: "hcl - build.name accessible", args: []string{ filepath.Join(testFixture("build-name-and-type"), "buildname.pkr.hcl"), }, fileCheck: fileCheck{ expected: []string{ "pineapple.pizza.txt", }, }, }, { name: "hcl - valid validation rule for default value", args: []string{ filepath.Join(testFixture("hcl", "validation", "map")), }, expectedCode: 0, }, { name: "hcl - valid setting from varfile", args: []string{ "-var-file", filepath.Join(testFixture("hcl", "validation", "map", "valid_value.pkrvars.hcl")), filepath.Join(testFixture("hcl", "validation", "map")), }, expectedCode: 0, }, { name: "hcl - invalid setting from varfile", args: []string{ "-var-file", filepath.Join(testFixture("hcl", "validation", "map", "invalid_value.pkrvars.hcl")), filepath.Join(testFixture("hcl", "validation", "map")), }, expectedCode: 1, }, { name: "hcl - valid cmd ( invalid varfile bypased )", args: []string{ "-var-file", filepath.Join(testFixture("hcl", "validation", "map", "invalid_value.pkrvars.hcl")), "-var", `image_metadata={key = "new_value", something = { foo = "bar" }}`, filepath.Join(testFixture("hcl", "validation", "map")), }, expectedCode: 0, }, { name: "hcl - invalid cmd ( valid varfile bypased )", args: []string{ "-var-file", filepath.Join(testFixture("hcl", "validation", "map", "valid_value.pkrvars.hcl")), "-var", `image_metadata={key = "?", something = { foo = "wrong" }}`, filepath.Join(testFixture("hcl", "validation", "map")), }, expectedCode: 1, }, } for _, tt := range tc { t.Run(tt.name, func(t *testing.T) { defer tt.cleanup(t) run(t, tt.args, tt.expectedCode) tt.fileCheck.verify(t) }) } } func Test_build_output(t *testing.T) { tc := []struct { command []string env []string expected []string notExpected []string runtime string }{ {[]string{"build", "--color=false", testFixture("hcl", "reprepare", "shell-local.pkr.hcl")}, nil, []string{"null.example: hello from the NULL builder packeruser", "Build 'null.example' finished after"}, []string{}, "posix"}, {[]string{"build", "--color=false", testFixture("hcl", "reprepare", "shell-local-windows.pkr.hcl")}, nil, []string{"null.example: hello from the NULL builder packeruser", "Build 'null.example' finished after"}, []string{}, "windows"}, {[]string{"build", "--color=false", testFixture("hcl", "provisioner-override.pkr.hcl")}, nil, []string{"null.example1: yes overridden", "null.example2: not overridden"}, []string{"null.example2: yes overridden", "null.example1: not overridden"}, "posix"}, {[]string{"build", "--color=false", testFixture("provisioners", "provisioner-override.json")}, nil, []string{"example1: yes overridden", "example2: not overridden"}, []string{"example2: yes overridden", "example1: not overridden"}, "posix"}, } for _, tc := range tc { if (runtime.GOOS == "windows") != (tc.runtime == "windows") { continue } t.Run(fmt.Sprintf("packer %s", tc.command), func(t *testing.T) { p := helperCommand(t, tc.command...) p.Env = append(p.Env, tc.env...) bs, err := p.Output() if err != nil { t.Fatalf("%v: %s", err, bs) } for _, expected := range tc.expected { if !strings.Contains(string(bs), expected) { t.Fatalf("Should contain output %s.\nReceived: %s", tc.expected, string(bs)) } } for _, notExpected := range tc.notExpected { if strings.Contains(string(bs), notExpected) { t.Fatalf("Should NOT contain output %s.\nReceived: %s", tc.expected, string(bs)) } } }) } } func TestBuildOnlyFileCommaFlags(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } args := []string{ "-parallel-builds=1", "-only=chocolate,vanilla", filepath.Join(testFixture("build-only"), "template.json"), } defer cleanup() if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } for _, f := range []string{"chocolate.txt", "vanilla.txt", "apple.txt", "peach.txt", "pear.txt", "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } if fileExists("cherry.txt") { t.Error("Expected NOT to find cherry.txt") } if !fileExists("tomato.txt") { t.Error("Expected to find tomato.txt") } } func TestBuildStdin(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } f, err := os.Open(filepath.Join(testFixture("build-only"), "template.json")) if err != nil { t.Fatal(err) } defer f.Close() stdin := os.Stdin os.Stdin = f defer func() { os.Stdin = stdin }() defer cleanup() if code := c.Run([]string{"-parallel-builds=1", "-"}); code != 0 { fatalCommand(t, c.Meta) } for _, f := range []string{"vanilla.txt", "cherry.txt", "chocolate.txt", "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } } func TestBuildOnlyFileMultipleFlags(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } args := []string{ "-parallel-builds=1", "-only=chocolate", "-only=cherry", "-only=apple", // ignored "-only=peach", // ignored "-only=pear", // ignored filepath.Join(testFixture("build-only"), "template.json"), } defer cleanup() if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } for _, f := range []string{"vanilla.txt", "tomato.txt"} { if fileExists(f) { t.Errorf("Expected NOT to find %s", f) } } for _, f := range []string{"chocolate.txt", "cherry.txt", "apple.txt", "peach.txt", "pear.txt", "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } } func TestBuildProvisionAndPosProcessWithBuildVariablesSharing(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } args := []string{ filepath.Join(testFixture("build-variable-sharing"), "template.json"), } files := []string{ "provisioner.Null.txt", "post-processor.Null.txt", } defer cleanup(files...) if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } for _, f := range files { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } } func TestBuildEverything(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } args := []string{ "-parallel-builds=1", `-except=`, filepath.Join(testFixture("build-only"), "template.json"), } defer cleanup() if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } for _, f := range []string{"chocolate.txt", "vanilla.txt", "tomato.txt", "apple.txt", "cherry.txt", "pear.txt", "peach.txt", "unnamed.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } } func TestBuildExceptFileCommaFlags(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } tc := []struct { name string args []string expectedFiles []string buildNotExpectedFiles []string postProcNotExpectedFiles []string }{ { name: "JSON: except build and post-processor", args: []string{ "-parallel-builds=1", "-except=chocolate,vanilla,tomato", filepath.Join(testFixture("build-only"), "template.json"), }, expectedFiles: []string{"apple.txt", "cherry.txt", "peach.txt"}, buildNotExpectedFiles: []string{"chocolate.txt", "vanilla.txt", "tomato.txt", "unnamed.txt"}, postProcNotExpectedFiles: []string{"pear.txt, banana.txt"}, }, { name: "HCL2: except build and post-processor", args: []string{ "-parallel-builds=1", "-except=file.chocolate,file.vanilla,tomato", filepath.Join(testFixture("build-only"), "template.pkr.hcl"), }, expectedFiles: []string{"apple.txt", "cherry.txt", "peach.txt"}, buildNotExpectedFiles: []string{"chocolate.txt", "vanilla.txt", "tomato.txt", "unnamed.txt"}, postProcNotExpectedFiles: []string{"pear.txt, banana.txt"}, }, { name: "HCL2-JSON: except build and post-processor", args: []string{ "-parallel-builds=1", "-except=file.chocolate,file.vanilla,tomato", filepath.Join(testFixture("build-only"), "template.pkr.json"), }, expectedFiles: []string{"apple.txt", "cherry.txt", "peach.txt"}, buildNotExpectedFiles: []string{"chocolate.txt", "vanilla.txt", "tomato.txt", "unnamed.txt"}, postProcNotExpectedFiles: []string{"pear.txt, banana.txt"}, }, } for _, tt := range tc { t.Run(tt.name, func(t *testing.T) { defer cleanup() if code := c.Run(tt.args); code != 0 { fatalCommand(t, c.Meta) } for _, f := range tt.buildNotExpectedFiles { if fileExists(f) { t.Errorf("build not skipped: Expected NOT to find %s", f) } } for _, f := range tt.postProcNotExpectedFiles { if fileExists(f) { t.Errorf("post-processor not skipped: Expected NOT to find %s", f) } } for _, f := range tt.expectedFiles { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } }) } } func testHCLOnlyExceptFlags(t *testing.T, args, present, notPresent []string) { c := &BuildCommand{ Meta: testMetaFile(t), } defer cleanup() finalArgs := []string{"-parallel-builds=1"} finalArgs = append(finalArgs, args...) finalArgs = append(finalArgs, testFixture("hcl-only-except")) if code := c.Run(finalArgs); code != 0 { fatalCommand(t, c.Meta) } for _, f := range notPresent { if fileExists(f) { t.Errorf("Expected NOT to find %s", f) } } for _, f := range present { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } } func TestBuildCommand_HCLOnlyExceptOptions(t *testing.T) { tests := []struct { args []string present []string notPresent []string }{ { []string{"-only=chocolate"}, []string{}, []string{"chocolate.txt", "vanilla.txt", "cherry.txt"}, }, { []string{"-only=*chocolate*"}, []string{"chocolate.txt"}, []string{"vanilla.txt", "cherry.txt"}, }, { []string{"-except=*chocolate*"}, []string{"vanilla.txt", "cherry.txt"}, []string{"chocolate.txt"}, }, { []string{"-except=*ch*"}, []string{"vanilla.txt"}, []string{"chocolate.txt", "cherry.txt"}, }, { []string{"-only=*chocolate*", "-only=*vanilla*"}, []string{"chocolate.txt", "vanilla.txt"}, []string{"cherry.txt"}, }, { []string{"-except=*chocolate*", "-except=*vanilla*"}, []string{"cherry.txt"}, []string{"chocolate.txt", "vanilla.txt"}, }, { []string{"-only=my_build.file.chocolate"}, []string{"chocolate.txt"}, []string{"vanilla.txt", "cherry.txt"}, }, { []string{"-except=my_build.file.chocolate"}, []string{"vanilla.txt", "cherry.txt"}, []string{"chocolate.txt"}, }, { []string{"-only=file.cherry"}, []string{"cherry.txt"}, []string{"vanilla.txt", "chocolate.txt"}, }, } for _, tt := range tests { t.Run(fmt.Sprintf("%s", tt.args), func(t *testing.T) { testHCLOnlyExceptFlags(t, tt.args, tt.present, tt.notPresent) }) } } func TestBuildWithNonExistingBuilder(t *testing.T) { c := &BuildCommand{ Meta: testMetaFile(t), } args := []string{ "-parallel-builds=1", `-except=`, filepath.Join(testFixture("build-only"), "not-found.json"), } defer cleanup() if code := c.Run(args); code != 1 { t.Errorf("Expected to find exit code 1, found %d", code) } if !fileExists("chocolate.txt") { t.Errorf("Expected to find chocolate.txt") } if fileExists("vanilla.txt") { t.Errorf("NOT expected to find vanilla.tx") } } func run(t *testing.T, args []string, expectedCode int) { t.Helper() c := &BuildCommand{ Meta: testMetaFile(t), } if code := c.Run(args); code != expectedCode { fatalCommand(t, c.Meta) } } type fileCheck struct { expected, notExpected []string expectedContent map[string]string } func (fc fileCheck) cleanup(t *testing.T) { for _, file := range fc.expectedFiles() { t.Logf("removing %v", file) if err := os.Remove(file); err != nil { t.Errorf("failed to remove file %s: %v", file, err) } } } func (fc fileCheck) expectedFiles() []string { expected := fc.expected for file := range fc.expectedContent { expected = append(expected, file) } return expected } func (fc fileCheck) verify(t *testing.T) { for _, f := range fc.expectedFiles() { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } for _, f := range fc.notExpected { if fileExists(f) { t.Errorf("Expected to not find %s", f) } } for file, expectedContent := range fc.expectedContent { content, err := ioutil.ReadFile(file) if err != nil { t.Fatalf("ioutil.ReadFile: %v", err) } if diff := cmp.Diff(expectedContent, string(content)); diff != "" { t.Errorf("content of %s differs: %s", file, diff) } } } // fileExists returns true if the filename is found func fileExists(filename string) bool { if _, err := os.Stat(filename); err == nil { return true } return false } // testCoreConfigBuilder creates a packer CoreConfig that has a file builder // available. This allows us to test a builder that writes files to disk. func testCoreConfigBuilder(t *testing.T) *packer.CoreConfig { components := packer.ComponentFinder{ BuilderStore: packersdk.MapOfBuilder{ "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, "null": func() (packersdk.Builder, error) { return &null.Builder{}, nil }, }, ProvisionerStore: packersdk.MapOfProvisioner{ "shell-local": func() (packersdk.Provisioner, error) { return &shell_local.Provisioner{}, nil }, "shell": func() (packersdk.Provisioner, error) { return &shell.Provisioner{}, nil }, "file": func() (packersdk.Provisioner, error) { return &filep.Provisioner{}, nil }, }, PostProcessorStore: packersdk.MapOfPostProcessor{ "shell-local": func() (packersdk.PostProcessor, error) { return &shell_local_pp.PostProcessor{}, nil }, "manifest": func() (packersdk.PostProcessor, error) { return &manifest.PostProcessor{}, nil }, }, } return &packer.CoreConfig{ Components: components, } } // testMetaFile creates a Meta object that includes a file builder func testMetaFile(t *testing.T) Meta { var out, err bytes.Buffer return Meta{ CoreConfig: testCoreConfigBuilder(t), Ui: &packersdk.BasicUi{ Writer: &out, ErrorWriter: &err, }, } } func cleanup(moreFiles ...string) { os.RemoveAll("chocolate.txt") os.RemoveAll("vanilla.txt") os.RemoveAll("cherry.txt") os.RemoveAll("apple.txt") os.RemoveAll("peach.txt") os.RemoveAll("banana.txt") os.RemoveAll("pear.txt") os.RemoveAll("tomato.txt") os.RemoveAll("unnamed.txt") os.RemoveAll("roses.txt") os.RemoveAll("fuchsias.txt") os.RemoveAll("lilas.txt") os.RemoveAll("campanules.txt") os.RemoveAll("ducky.txt") os.RemoveAll("banana.txt") for _, file := range moreFiles { os.RemoveAll(file) } } func TestBuildCommand_ParseArgs(t *testing.T) { defaultMeta := testMetaFile(t) type fields struct { Meta Meta } type args struct { args []string } tests := []struct { fields fields args args wantCfg *BuildArgs wantExitCode int }{ {fields{defaultMeta}, args{[]string{"file.json"}}, &BuildArgs{ MetaArgs: MetaArgs{Path: "file.json"}, ParallelBuilds: math.MaxInt64, Color: true, }, 0, }, {fields{defaultMeta}, args{[]string{"-parallel-builds=10", "file.json"}}, &BuildArgs{ MetaArgs: MetaArgs{Path: "file.json"}, ParallelBuilds: 10, Color: true, }, 0, }, {fields{defaultMeta}, args{[]string{"-parallel-builds=1", "file.json"}}, &BuildArgs{ MetaArgs: MetaArgs{Path: "file.json"}, ParallelBuilds: 1, Color: true, }, 0, }, {fields{defaultMeta}, args{[]string{"-parallel-builds=5", "file.json"}}, &BuildArgs{ MetaArgs: MetaArgs{Path: "file.json"}, ParallelBuilds: 5, Color: true, }, 0, }, {fields{defaultMeta}, args{[]string{"-parallel-builds=1", "-parallel-builds=5", "otherfile.json"}}, &BuildArgs{ MetaArgs: MetaArgs{Path: "otherfile.json"}, ParallelBuilds: 5, Color: true, }, 0, }, } for _, tt := range tests { t.Run(fmt.Sprintf("%s", tt.args.args), func(t *testing.T) { c := &BuildCommand{ Meta: tt.fields.Meta, } gotCfg, gotExitCode := c.ParseArgs(tt.args.args) if diff := cmp.Diff(gotCfg, tt.wantCfg); diff != "" { t.Fatalf("BuildCommand.ParseArgs() unexpected cfg %s", diff) } if gotExitCode != tt.wantExitCode { t.Fatalf("BuildCommand.ParseArgs() gotExitCode = %v, want %v", gotExitCode, tt.wantExitCode) } }) } } �����������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/build_timeout_test.go������������������������������������������������������0000664�0000000�0000000�00000003461�13771713062�0021340�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bytes" "path/filepath" "testing" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" shell_local "github.com/hashicorp/packer/provisioner/shell-local" "github.com/hashicorp/packer/provisioner/sleep" ) // testCoreConfigBuilder creates a packer CoreConfig that has a file builder // available. This allows us to test a builder that writes files to disk. func testCoreConfigSleepBuilder(t *testing.T) *packer.CoreConfig { components := packer.ComponentFinder{ BuilderStore: packersdk.MapOfBuilder{ "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, }, ProvisionerStore: packersdk.MapOfProvisioner{ "sleep": func() (packersdk.Provisioner, error) { return &sleep.Provisioner{}, nil }, "shell-local": func() (packersdk.Provisioner, error) { return &shell_local.Provisioner{}, nil }, }, } return &packer.CoreConfig{ Components: components, } } // testMetaFile creates a Meta object that includes a file builder func testMetaSleepFile(t *testing.T) Meta { var out, err bytes.Buffer return Meta{ CoreConfig: testCoreConfigSleepBuilder(t), Ui: &packersdk.BasicUi{ Writer: &out, ErrorWriter: &err, }, } } func TestBuildSleepTimeout(t *testing.T) { defer cleanup() c := &BuildCommand{ Meta: testMetaSleepFile(t), } args := []string{ filepath.Join(testFixture("timeout"), "template.json"), } defer cleanup() if code := c.Run(args); code == 0 { fatalCommand(t, c.Meta) } for _, f := range []string{"roses.txt", "fuchsias.txt", "lilas.txt"} { if !fileExists(f) { t.Errorf("Expected to find %s", f) } } for _, f := range []string{"campanules.txt"} { if fileExists(f) { t.Errorf("Expected to not find %s", f) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/build_windows_test.go������������������������������������������������������0000664�0000000�0000000�00000000447�13771713062�0021345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import "strings" func init() { spaghettiCarbonara = fixWindowsLineEndings(spaghettiCarbonara) lasagna = fixWindowsLineEndings(lasagna) tiramisu = fixWindowsLineEndings(tiramisu) } func fixWindowsLineEndings(s string) string { return strings.ReplaceAll(s, "\n", " \r\n") } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/cli.go���������������������������������������������������������������������0000664�0000000�0000000�00000010657�13771713062�0016210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "flag" "strings" "github.com/hashicorp/packer/command/enumflag" kvflag "github.com/hashicorp/packer/command/flag-kv" sliceflag "github.com/hashicorp/packer/command/flag-slice" ) //go:generate enumer -type configType -trimprefix ConfigType -transform snake type configType int const ( ConfigTypeJSON configType = iota // default config type ConfigTypeHCL2 ) func (c *configType) Set(value string) error { v, err := configTypeString(value) if err == nil { *c = v } return err } // ConfigType tells what type of config we should use, it can return values // like "hcl" or "json". // Make sure Args was correctly set before. func (ma *MetaArgs) GetConfigType() (configType, error) { if ma.Path == "" { return ma.ConfigType, nil } name := ma.Path if name == "-" { // TODO(azr): To allow piping HCL2 confs (when args is "-"), we probably // will need to add a setting that says "this is an HCL config". return ma.ConfigType, nil } if strings.HasSuffix(name, ".pkr.hcl") || strings.HasSuffix(name, ".pkr.json") { return ConfigTypeHCL2, nil } isDir, err := isDir(name) if isDir { return ConfigTypeHCL2, err } return ma.ConfigType, err } // NewMetaArgs parses cli args and put possible values func (ma *MetaArgs) AddFlagSets(fs *flag.FlagSet) { fs.Var((*sliceflag.StringFlag)(&ma.Only), "only", "") fs.Var((*sliceflag.StringFlag)(&ma.Except), "except", "") fs.Var((*kvflag.Flag)(&ma.Vars), "var", "") fs.Var((*kvflag.StringSlice)(&ma.VarFiles), "var-file", "") fs.Var(&ma.ConfigType, "config-type", "set to 'hcl2' to run in hcl2 mode when no file is passed.") } // MetaArgs defines commonalities between all comands type MetaArgs struct { // TODO(azr): in the future, I want to allow passing multiple path to // merge HCL confs together; but this will probably need an RFC first. Path string Only, Except []string Vars map[string]string VarFiles []string // set to "hcl2" to force hcl2 mode ConfigType configType } func (ba *BuildArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&ba.Color, "color", true, "") flags.BoolVar(&ba.Debug, "debug", false, "") flags.BoolVar(&ba.Force, "force", false, "") flags.BoolVar(&ba.TimestampUi, "timestamp-ui", false, "") flags.BoolVar(&ba.MachineReadable, "machine-readable", false, "") flags.Int64Var(&ba.ParallelBuilds, "parallel-builds", 0, "") flagOnError := enumflag.New(&ba.OnError, "cleanup", "abort", "ask", "run-cleanup-provisioner") flags.Var(flagOnError, "on-error", "") ba.MetaArgs.AddFlagSets(flags) } // BuildArgs represents a parsed cli line for a `packer build` type BuildArgs struct { MetaArgs Color, Debug, Force, TimestampUi, MachineReadable bool ParallelBuilds int64 OnError string } // ConsoleArgs represents a parsed cli line for a `packer console` type ConsoleArgs struct { MetaArgs } func (fa *FixArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&fa.Validate, "validate", true, "") fa.MetaArgs.AddFlagSets(flags) } // FixArgs represents a parsed cli line for a `packer fix` type FixArgs struct { MetaArgs Validate bool } func (va *ValidateArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&va.SyntaxOnly, "syntax-only", false, "check syntax only") va.MetaArgs.AddFlagSets(flags) } // ValidateArgs represents a parsed cli line for a `packer validate` type ValidateArgs struct { MetaArgs SyntaxOnly bool } func (va *InspectArgs) AddFlagSets(flags *flag.FlagSet) { va.MetaArgs.AddFlagSets(flags) } // InspectArgs represents a parsed cli line for a `packer inspect` type InspectArgs struct { MetaArgs } func (va *HCL2UpgradeArgs) AddFlagSets(flags *flag.FlagSet) { flags.StringVar(&va.OutputFile, "output-file", "", "File where to put the hcl2 generated config. Defaults to JSON_TEMPLATE.pkr.hcl") va.MetaArgs.AddFlagSets(flags) } // HCL2UpgradeArgs represents a parsed cli line for a `packer hcl2_upgrade` type HCL2UpgradeArgs struct { MetaArgs OutputFile string } func (va *FormatArgs) AddFlagSets(flags *flag.FlagSet) { flags.BoolVar(&va.Check, "check", false, "check if the input is formatted") flags.BoolVar(&va.Diff, "diff", false, "display the diff of formatting changes") flags.BoolVar(&va.Write, "write", true, "overwrite source files instead of writing to stdout") va.MetaArgs.AddFlagSets(flags) } // FormatArgs represents a parsed cli line for `packer fmt` type FormatArgs struct { MetaArgs Check, Diff, Write bool } ���������������������������������������������������������������������������������packer-1.6.6+ds1/command/command_test.go������������������������������������������������������������0000664�0000000�0000000�00000002263�13771713062�0020110�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bytes" "io/ioutil" "path/filepath" "testing" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) const fixturesDir = "./test-fixtures" func fatalCommand(t *testing.T, m Meta) { ui := m.Ui.(*packersdk.BasicUi) out := ui.Writer.(*bytes.Buffer) err := ui.ErrorWriter.(*bytes.Buffer) t.Fatalf( "Bad exit code.\n\nStdout:\n\n%s\n\nStderr:\n\n%s", out.String(), err.String()) } func outputCommand(t *testing.T, m Meta) (string, string) { ui := m.Ui.(*packersdk.BasicUi) out := ui.Writer.(*bytes.Buffer) err := ui.ErrorWriter.(*bytes.Buffer) return out.String(), err.String() } func testFixtureContent(n ...string) string { path := filepath.Join(append([]string{fixturesDir}, n...)...) b, err := ioutil.ReadFile(path) if err != nil { panic(err) } return string(b) } func testFixture(n ...string) string { paths := []string{fixturesDir} paths = append(paths, n...) return filepath.Join(paths...) } func testMeta(t *testing.T) Meta { var out, err bytes.Buffer return Meta{ CoreConfig: packer.TestCoreConfig(t), Ui: &packersdk.BasicUi{ Writer: &out, ErrorWriter: &err, }, } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/configtype_enumer.go�������������������������������������������������������0000664�0000000�0000000�00000002364�13771713062�0021157�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "enumer -type configType -trimprefix ConfigType -transform snake"; DO NOT EDIT. // package command import ( "fmt" ) const _configTypeName = "jsonhcl2" var _configTypeIndex = [...]uint8{0, 4, 8} func (i configType) String() string { if i < 0 || i >= configType(len(_configTypeIndex)-1) { return fmt.Sprintf("configType(%d)", i) } return _configTypeName[_configTypeIndex[i]:_configTypeIndex[i+1]] } var _configTypeValues = []configType{0, 1} var _configTypeNameToValueMap = map[string]configType{ _configTypeName[0:4]: 0, _configTypeName[4:8]: 1, } // configTypeString retrieves an enum value from the enum constants string name. // Throws an error if the param is not part of the enum. func configTypeString(s string) (configType, error) { if val, ok := _configTypeNameToValueMap[s]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to configType values", s) } // configTypeValues returns all values of the enum func configTypeValues() []configType { return _configTypeValues } // IsAconfigType returns "true" if the value is listed in the enum definition. "false" otherwise func (i configType) IsAconfigType() bool { for _, v := range _configTypeValues { if i == v { return true } } return false } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/console.go�����������������������������������������������������������������0000664�0000000�0000000�00000006714�13771713062�0017102�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bufio" "context" "fmt" "io" "strings" "github.com/chzyer/readline" "github.com/hashicorp/packer/helper/wrappedreadline" "github.com/hashicorp/packer/helper/wrappedstreams" "github.com/hashicorp/packer/packer" "github.com/posener/complete" ) var TiniestBuilder = strings.NewReader(`{ "builders": [ { "type":"null", "communicator": "none" } ] }`) type ConsoleCommand struct { Meta } func (c *ConsoleCommand) Run(args []string) int { ctx := context.Background() cfg, ret := c.ParseArgs(args) if ret != 0 { return ret } return c.RunContext(ctx, cfg) } func (c *ConsoleCommand) ParseArgs(args []string) (*ConsoleArgs, int) { var cfg ConsoleArgs flags := c.Meta.FlagSet("console", FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { return &cfg, 1 } args = flags.Args() if len(args) == 1 { cfg.Path = args[0] } return &cfg, 0 } func (c *ConsoleCommand) RunContext(ctx context.Context, cla *ConsoleArgs) int { packerStarter, ret := c.GetConfig(&cla.MetaArgs) if ret != 0 { return ret } _ = packerStarter.Initialize() // Determine if stdin is a pipe. If so, we evaluate directly. if c.StdinPiped() { return c.modePiped(packerStarter) } return c.modeInteractive(packerStarter) } func (*ConsoleCommand) Help() string { helpText := ` Usage: packer console [options] [TEMPLATE] Creates a console for testing variable interpolation. If a template is provided, this command will load the template and any variables defined therein into its context to be referenced during interpolation. Options: -var 'key=value' Variable for templates, can be used multiple times. -var-file=path JSON or HCL2 file containing user variables. [ Note that even in HCL mode this expects file to contain JSON, a fix is comming soon ] ` return strings.TrimSpace(helpText) } func (*ConsoleCommand) Synopsis() string { return "creates a console for testing variable interpolation" } func (*ConsoleCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing } func (*ConsoleCommand) AutocompleteFlags() complete.Flags { return complete.Flags{ "-var": complete.PredictNothing, "-var-file": complete.PredictNothing, } } func (c *ConsoleCommand) modePiped(cfg packer.Evaluator) int { var lastResult string scanner := bufio.NewScanner(wrappedstreams.Stdin()) ret := 0 for scanner.Scan() { result, _, diags := cfg.EvaluateExpression(strings.TrimSpace(scanner.Text())) if len(diags) > 0 { ret = writeDiags(c.Ui, nil, diags) } // Store the last result lastResult = result } // Output the final result c.Ui.Message(lastResult) return ret } func (c *ConsoleCommand) modeInteractive(cfg packer.Evaluator) int { // Setup the UI so we can output directly to stdout l, err := readline.NewEx(wrappedreadline.Override(&readline.Config{ Prompt: "> ", InterruptPrompt: "^C", EOFPrompt: "exit", HistorySearchFold: true, })) if err != nil { c.Ui.Error(fmt.Sprintf( "Error initializing console: %s", err)) return 1 } for { // Read a line line, err := l.Readline() if err == readline.ErrInterrupt { if len(line) == 0 { break } else { continue } } else if err == io.EOF { break } out, exit, diags := cfg.EvaluateExpression(line) ret := writeDiags(c.Ui, nil, diags) if exit { return ret } c.Ui.Say(out) if exit { return ret } } return 0 } ����������������������������������������������������packer-1.6.6+ds1/command/console_test.go������������������������������������������������������������0000664�0000000�0000000�00000004714�13771713062�0020137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "fmt" "os" "path/filepath" "strings" "testing" "github.com/hashicorp/packer/hcl2template" "github.com/hashicorp/packer/packer" "github.com/stretchr/testify/assert" ) func Test_console(t *testing.T) { cwd, err := os.Getwd() if err != nil { t.Fatalf("Getwd: %v", err) } tc := []struct { piped string command []string env []string expected string }{ {"help", []string{"console"}, nil, packer.ConsoleHelp + "\n"}, {"help", []string{"console", "--config-type=hcl2"}, nil, hcl2template.PackerConsoleHelp + "\n"}, {"var.fruit", []string{"console", filepath.Join(testFixture("var-arg"), "fruit_builder.pkr.hcl")}, []string{"PKR_VAR_fruit=potato"}, "potato\n"}, {"upper(var.fruit)", []string{"console", filepath.Join(testFixture("var-arg"), "fruit_builder.pkr.hcl")}, []string{"PKR_VAR_fruit=potato"}, "POTATO\n"}, {"1 + 5", []string{"console", "--config-type=hcl2"}, nil, "6\n"}, {"var.images", []string{"console", filepath.Join(testFixture("var-arg"), "map.pkr.hcl")}, nil, "{\n" + ` "key" = "value"` + "\n}\n"}, {"path.cwd", []string{"console", filepath.Join(testFixture("var-arg"), "map.pkr.hcl")}, nil, strings.ReplaceAll(cwd, `\`, `/`) + "\n"}, {"path.root", []string{"console", filepath.Join(testFixture("var-arg"), "map.pkr.hcl")}, nil, strings.ReplaceAll(testFixture("var-arg"), `\`, `/`) + "\n"}, {"var.list_of_string[0]", []string{"console", `-var=list_of_string=["first"]`, filepath.Join(testFixture("hcl", "variables", "list_of_string"))}, nil, "first\n"}, {"var.untyped[2]", []string{"console", filepath.Join(testFixture("hcl", "variables", "untyped_var"))}, nil, "strings\n"}, {"var.untyped", []string{"console", `-var=untyped=just_a_string`, filepath.Join(testFixture("hcl", "variables", "untyped_var"))}, nil, "just_a_string\n"}, {"var.untyped", []string{"console", filepath.Join(testFixture("hcl", "variables", "untyped_var", "var.pkr.hcl"))}, nil, "<unknown>\n"}, {"var.untyped", []string{"console", filepath.Join(testFixture("hcl", "variables", "untyped_var", "var.pkr.hcl"))}, []string{"PKR_VAR_untyped=just_a_string"}, "just_a_string\n"}, } for _, tc := range tc { t.Run(fmt.Sprintf("echo %q | packer %s", tc.piped, tc.command), func(t *testing.T) { p := helperCommand(t, tc.command...) p.Stdin = strings.NewReader(tc.piped) p.Env = append(p.Env, tc.env...) bs, err := p.Output() if err != nil { t.Fatalf("%v: %s", err, bs) } assert.Equal(t, tc.expected, string(bs)) }) } } ����������������������������������������������������packer-1.6.6+ds1/command/core_wrapper.go������������������������������������������������������������0000664�0000000�0000000�00000000721�13771713062�0020120�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/packer" ) // CoreWrapper wraps a packer.Core in order to have it's Initialize func return // a diagnostic. type CoreWrapper struct { *packer.Core } func (c *CoreWrapper) Initialize() hcl.Diagnostics { err := c.Core.Initialize() if err != nil { return hcl.Diagnostics{ &hcl.Diagnostic{ Detail: err.Error(), Severity: hcl.DiagError, }, } } return nil } �����������������������������������������������packer-1.6.6+ds1/command/enumflag/������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016677�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/enumflag/flag.go�����������������������������������������������������������0000664�0000000�0000000�00000001034�13771713062�0020135�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package enumflag import "fmt" type enumFlag struct { target *string options []string } // New returns a flag.Value implementation for parsing flags with a one-of-a-set value func New(target *string, options ...string) *enumFlag { return &enumFlag{target: target, options: options} } func (f *enumFlag) String() string { return *f.target } func (f *enumFlag) Set(value string) error { for _, v := range f.options { if v == value { *f.target = value return nil } } return fmt.Errorf("expected one of %q", f.options) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/exec_test.go���������������������������������������������������������������0000664�0000000�0000000�00000007532�13771713062�0017422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "context" "fmt" "os" "os/exec" "runtime" "testing" "github.com/hashicorp/packer/builder/amazon/ebs" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/builder/null" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/post-processor/manifest" shell_local_pp "github.com/hashicorp/packer/post-processor/shell-local" filep "github.com/hashicorp/packer/provisioner/file" "github.com/hashicorp/packer/provisioner/shell" shell_local "github.com/hashicorp/packer/provisioner/shell-local" "github.com/hashicorp/packer/version" ) // HasExec reports whether the current system can start new processes // using os.StartProcess or (more commonly) exec.Command. func HasExec() bool { switch runtime.GOOS { case "js": return false case "darwin": if runtime.GOARCH == "arm64" { return false } } return true } // MustHaveExec checks that the current system can start new processes // using os.StartProcess or (more commonly) exec.Command. // If not, MustHaveExec calls t.Skip with an explanation. func MustHaveExec(t testing.TB) { if !HasExec() { t.Skipf("skipping test: cannot exec subprocess on %s/%s", runtime.GOOS, runtime.GOARCH) } } func helperCommandContext(t *testing.T, ctx context.Context, s ...string) (cmd *exec.Cmd) { MustHaveExec(t) cs := []string{"-test.run=TestHelperProcess", "--"} cs = append(cs, s...) if ctx != nil { cmd = exec.CommandContext(ctx, os.Args[0], cs...) } else { cmd = exec.Command(os.Args[0], cs...) } cmd.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=1") return cmd } func helperCommand(t *testing.T, s ...string) *exec.Cmd { return helperCommandContext(t, nil, s...) } // TestHelperProcess isn't a real test. It's used as a helper process // for TestParameterRun. func TestHelperProcess(*testing.T) { if os.Getenv("GO_WANT_HELPER_PROCESS") != "1" { return } defer os.Exit(0) args := os.Args for len(args) > 0 { if args[0] == "--" { args = args[1:] break } args = args[1:] } if len(args) == 0 { fmt.Fprintf(os.Stderr, "No command\n") os.Exit(2) } cmd, args := args[0], args[1:] switch cmd { case "console": os.Exit((&ConsoleCommand{Meta: commandMeta()}).Run(args)) case "inspect": os.Exit((&InspectCommand{Meta: commandMeta()}).Run(args)) case "build": os.Exit((&BuildCommand{Meta: commandMeta()}).Run(args)) case "hcl2_upgrade": os.Exit((&HCL2UpgradeCommand{Meta: commandMeta()}).Run(args)) default: fmt.Fprintf(os.Stderr, "Unknown command %q\n", cmd) os.Exit(2) } } func commandMeta() Meta { basicUi := &packersdk.BasicUi{ Reader: os.Stdin, Writer: os.Stdout, ErrorWriter: os.Stdout, } CommandMeta := Meta{ CoreConfig: &packer.CoreConfig{ Components: getBareComponentFinder(), Version: version.Version, }, Ui: basicUi, } return CommandMeta } func getBareComponentFinder() packer.ComponentFinder { return packer.ComponentFinder{ BuilderStore: packersdk.MapOfBuilder{ "file": func() (packersdk.Builder, error) { return &file.Builder{}, nil }, "null": func() (packersdk.Builder, error) { return &null.Builder{}, nil }, "amazon-ebs": func() (packersdk.Builder, error) { return &ebs.Builder{}, nil }, }, ProvisionerStore: packersdk.MapOfProvisioner{ "shell-local": func() (packersdk.Provisioner, error) { return &shell_local.Provisioner{}, nil }, "shell": func() (packersdk.Provisioner, error) { return &shell.Provisioner{}, nil }, "file": func() (packersdk.Provisioner, error) { return &filep.Provisioner{}, nil }, }, PostProcessorStore: packersdk.MapOfPostProcessor{ "shell-local": func() (packersdk.PostProcessor, error) { return &shell_local_pp.PostProcessor{}, nil }, "manifest": func() (packersdk.PostProcessor, error) { return &manifest.PostProcessor{}, nil }, }, } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/fix.go���������������������������������������������������������������������0000664�0000000�0000000�00000007425�13771713062�0016226�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bytes" "context" "encoding/json" "fmt" "log" "os" "strings" "github.com/hashicorp/packer/fix" "github.com/hashicorp/packer/packer-plugin-sdk/template" "github.com/posener/complete" ) type FixCommand struct { Meta } func (c *FixCommand) Run(args []string) int { ctx, cleanup := handleTermInterrupt(c.Ui) defer cleanup() cfg, ret := c.ParseArgs(args) if ret != 0 { return ret } return c.RunContext(ctx, cfg) } func (c *FixCommand) ParseArgs(args []string) (*FixArgs, int) { var cfg FixArgs flags := c.Meta.FlagSet("fix", FlagSetNone) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { return &cfg, 1 } args = flags.Args() if len(args) != 1 { flags.Usage() return &cfg, 1 } cfg.Path = args[0] return &cfg, 0 } func (c *FixCommand) RunContext(ctx context.Context, cla *FixArgs) int { // Read the file for decoding tplF, err := os.Open(cla.Path) if err != nil { c.Ui.Error(fmt.Sprintf("Error opening template: %s", err)) return 1 } defer tplF.Close() // Decode the JSON into a generic map structure var templateData map[string]interface{} decoder := json.NewDecoder(tplF) if err := decoder.Decode(&templateData); err != nil { c.Ui.Error(fmt.Sprintf("Error parsing template: %s", err)) return 1 } // Close the file since we're done with that tplF.Close() input := templateData for _, name := range fix.FixerOrder { var err error fixer, ok := fix.Fixers[name] if !ok { panic("fixer not found: " + name) } log.Printf("Running fixer: %s", name) input, err = fixer.Fix(input) if err != nil { c.Ui.Error(fmt.Sprintf("Error fixing: %s", err)) return 1 } } var output bytes.Buffer encoder := json.NewEncoder(&output) if err := encoder.Encode(input); err != nil { c.Ui.Error(fmt.Sprintf("Error encoding: %s", err)) return 1 } var indented bytes.Buffer if err := json.Indent(&indented, output.Bytes(), "", " "); err != nil { c.Ui.Error(fmt.Sprintf("Error encoding: %s", err)) return 1 } result := indented.String() result = strings.Replace(result, `\u003c`, "<", -1) result = strings.Replace(result, `\u003e`, ">", -1) c.Ui.Say(result) if cla.Validate == false { return 0 } // Attempt to parse and validate the template tpl, err := template.Parse(strings.NewReader(result)) if err != nil { c.Ui.Error(fmt.Sprintf( "Error! Fixed template fails to parse: %s\n\n"+ "This is usually caused by an error in the input template.\n"+ "Please fix the error and try again.", err)) return 1 } if err := tpl.Validate(); err != nil { c.Ui.Error(fmt.Sprintf( "Error! Fixed template failed to validate: %s\n\n"+ "This is usually caused by an error in the input template.\n"+ "Please fix the error and try again.", err)) return 1 } return 0 } func (*FixCommand) Help() string { helpText := ` Usage: packer fix [options] TEMPLATE Reads the JSON template and attempts to fix known backwards incompatibilities. The fixed template will be outputted to standard out. If the template cannot be fixed due to an error, the command will exit with a non-zero exit status. Error messages will appear on standard error. Fixes that are run (in order): ` for _, name := range fix.FixerOrder { helpText += fmt.Sprintf( " %-27s%s\n", name, fix.Fixers[name].Synopsis()) } helpText += ` Options: -validate=true If true (default), validates the fixed template. ` return strings.TrimSpace(helpText) } func (c *FixCommand) Synopsis() string { return "fixes templates from old versions of packer" } func (c *FixCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing } func (c *FixCommand) AutocompleteFlags() complete.Flags { return complete.Flags{ "-validate": complete.PredictNothing, } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/fix_test.go����������������������������������������������������������������0000664�0000000�0000000�00000002176�13771713062�0017263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "path/filepath" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/stretchr/testify/assert" ) func TestFix(t *testing.T) { s := &strings.Builder{} ui := &packersdk.BasicUi{ Writer: s, } c := &FixCommand{ Meta: testMeta(t), } c.Ui = ui args := []string{filepath.Join(testFixture("fix"), "template.json")} if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } expected := `{ "builders": [ { "type": "dummy" } ], "push": { "name": "foo/bar" } }` assert.Equal(t, expected, strings.TrimSpace(s.String())) } func TestFix_invalidTemplate(t *testing.T) { c := &FixCommand{ Meta: testMeta(t), } args := []string{filepath.Join(testFixture("fix-invalid"), "template.json")} if code := c.Run(args); code != 1 { fatalCommand(t, c.Meta) } } func TestFix_invalidTemplateDisableValidation(t *testing.T) { c := &FixCommand{ Meta: testMeta(t), } args := []string{ "-validate=false", filepath.Join(testFixture("fix-invalid"), "template.json"), } if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/�������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016430�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/flag.go������������������������������������������������������������0000664�0000000�0000000�00000001002�13771713062�0017661�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package kvflag import ( "fmt" "strings" ) // Flag is a flag.Value implementation for parsing user variables // from the command-line in the format of '-var key=value'. type Flag map[string]string func (v *Flag) String() string { return "" } func (v *Flag) Set(raw string) error { idx := strings.Index(raw, "=") if idx == -1 { return fmt.Errorf("No '=' value in arg: %s", raw) } if *v == nil { *v = make(map[string]string) } key, value := raw[0:idx], raw[idx+1:] (*v)[key] = value return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/flag_json.go�������������������������������������������������������0000664�0000000�0000000�00000001071�13771713062�0020720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package kvflag import ( "encoding/json" "fmt" "os" ) // FlagJSON is a flag.Value implementation for parsing user variables // from the command-line using JSON files. type FlagJSON map[string]string func (v *FlagJSON) String() string { return "" } func (v *FlagJSON) Set(raw string) error { f, err := os.Open(raw) if err != nil { return err } defer f.Close() if *v == nil { *v = make(map[string]string) } if err := json.NewDecoder(f).Decode(v); err != nil { return fmt.Errorf( "Error reading variables in '%s': %s", raw, err) } return nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/flag_json_test.go��������������������������������������������������0000664�0000000�0000000�00000001755�13771713062�0021770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package kvflag import ( "flag" "path/filepath" "reflect" "testing" ) func TestFlagJSON_impl(t *testing.T) { var _ flag.Value = new(FlagJSON) } func TestFlagJSON(t *testing.T) { cases := []struct { Input string Initial map[string]string Output map[string]string Error bool }{ { "basic.json", nil, map[string]string{"key": "value"}, false, }, { "basic.json", map[string]string{"foo": "bar"}, map[string]string{"foo": "bar", "key": "value"}, false, }, { "basic.json", map[string]string{"key": "bar"}, map[string]string{"key": "value"}, false, }, } for _, tc := range cases { f := new(FlagJSON) if tc.Initial != nil { f = (*FlagJSON)(&tc.Initial) } err := f.Set(filepath.Join("./test-fixtures", tc.Input)) if (err != nil) != tc.Error { t.Fatalf("bad error. Input: %#v\n\n%s", tc.Input, err) } actual := map[string]string(*f) if !reflect.DeepEqual(actual, tc.Output) { t.Fatalf("bad: %#v", actual) } } } �������������������packer-1.6.6+ds1/command/flag-kv/flag_strings.go����������������������������������������������������0000664�0000000�0000000�00000000342�13771713062�0021440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package kvflag import ( "strings" ) type StringSlice []string func (s *StringSlice) String() string { return strings.Join(*s, ", ") } func (s *StringSlice) Set(value string) error { *s = append(*s, value) return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/flag_strings_test.go�����������������������������������������������0000664�0000000�0000000�00000001270�13771713062�0022500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package kvflag import ( "testing" "github.com/google/go-cmp/cmp" ) func TestStringSlice_Set(t *testing.T) { type args struct { values []string } tests := []struct { name string s StringSlice args args wantStringSlice StringSlice }{ {"basic", StringSlice{"hey", "yo"}, args{[]string{"how", "are", "you"}}, StringSlice{"hey", "yo", "how", "are", "you"}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { for _, value := range tt.args.values { err := tt.s.Set(value) if err != nil { t.Fatal(err) } } if diff := cmp.Diff(tt.s, tt.wantStringSlice); diff != "" { t.Fatal(diff) } }) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/flag_test.go�������������������������������������������������������0000664�0000000�0000000�00000001400�13771713062�0020722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package kvflag import ( "flag" "reflect" "testing" ) func TestFlag_impl(t *testing.T) { var _ flag.Value = new(Flag) } func TestFlag(t *testing.T) { cases := []struct { Input string Output map[string]string Error bool }{ { "key=value", map[string]string{"key": "value"}, false, }, { "key=", map[string]string{"key": ""}, false, }, { "key=foo=bar", map[string]string{"key": "foo=bar"}, false, }, { "key", nil, true, }, } for _, tc := range cases { f := new(Flag) err := f.Set(tc.Input) if (err != nil) != tc.Error { t.Fatalf("bad error. Input: %#v", tc.Input) } actual := map[string]string(*f) if !reflect.DeepEqual(actual, tc.Output) { t.Fatalf("bad: %#v", actual) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/test-fixtures/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021256�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-kv/test-fixtures/basic.json�������������������������������������������0000664�0000000�0000000�00000000027�13771713062�0023231�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "key": "value" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-slice/����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017107�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-slice/flag.go���������������������������������������������������������0000664�0000000�0000000�00000000551�13771713062�0020350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package sliceflag import "strings" // StringFlag implements the flag.Value interface and allows multiple // calls to the same variable to append a list. type StringFlag []string func (s *StringFlag) String() string { return strings.Join(*s, ",") } func (s *StringFlag) Set(value string) error { *s = append(*s, strings.Split(value, ",")...) return nil } �������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/flag-slice/flag_test.go����������������������������������������������������0000664�0000000�0000000�00000002107�13771713062�0021406�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package sliceflag import ( "flag" "reflect" "testing" ) func TestStringFlag_implements(t *testing.T) { var raw interface{} raw = new(StringFlag) if _, ok := raw.(flag.Value); !ok { t.Fatalf("StringFlag should be a Value") } } // TestStringFlagSet tests for setting the same flag more than once on the CLI // like: blah -flag foo -flag bar func TestStringFlagSet(t *testing.T) { sv := new(StringFlag) err := sv.Set("foo") if err != nil { t.Fatalf("err: %s", err) } err = sv.Set("bar") if err != nil { t.Fatalf("err: %s", err) } expected := []string{"foo", "bar"} if !reflect.DeepEqual([]string(*sv), expected) { t.Fatalf("Bad: %#v", sv) } } // TestMultiStringFlag tests for setting the same flag using a comma-separated // list of items like: blah -flag=foo,bar func TestMultiStringFlag(t *testing.T) { sv := new(StringFlag) err := sv.Set("chocolate,vanilla") if err != nil { t.Fatalf("err :%s", err) } expected := []string{"chocolate", "vanilla"} if !reflect.DeepEqual([]string(*sv), expected) { t.Fatalf("Expected: %#v, found: %#v", expected, sv) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/fmt.go���������������������������������������������������������������������0000664�0000000�0000000�00000004520�13771713062�0016217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "context" "os" "strings" hclutils "github.com/hashicorp/packer/hcl2template" "github.com/posener/complete" ) type FormatCommand struct { Meta } func (c *FormatCommand) Run(args []string) int { ctx := context.Background() cfg, ret := c.ParseArgs(args) if ret != 0 { return ret } return c.RunContext(ctx, cfg) } func (c *FormatCommand) ParseArgs(args []string) (*FormatArgs, int) { var cfg FormatArgs flags := c.Meta.FlagSet("format", FlagSetNone) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { return &cfg, 1 } args = flags.Args() if len(args) != 1 { flags.Usage() return &cfg, 1 } cfg.Path = args[0] return &cfg, 0 } func (c *FormatCommand) RunContext(ctx context.Context, cla *FormatArgs) int { if cla.Check { cla.Write = false } formatter := hclutils.HCL2Formatter{ ShowDiff: cla.Diff, Write: cla.Write, Output: os.Stdout, } bytesModified, diags := formatter.Format(cla.Path) ret := writeDiags(c.Ui, nil, diags) if ret != 0 { return ret } if cla.Check && bytesModified > 0 { // exit code taken from `terraform fmt` command return 3 } return 0 } func (*FormatCommand) Help() string { helpText := ` Usage: packer fmt [options] [TEMPLATE] Rewrites all Packer configuration files to a canonical format. Both configuration files (.pkr.hcl) and variable files (.pkrvars.hcl) are updated. JSON files (.json) are not modified. If TEMPATE is "." the current directory will be used. The given content must be in Packer's HCL2 configuration language; JSON is not supported. Options: -check Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise. -diff Display diffs of formatting change -write=false Don't write to source files (always disabled if using -check) ` return strings.TrimSpace(helpText) } func (*FormatCommand) Synopsis() string { return "Rewrites HCL2 config files to canonical format" } func (*FormatCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing } func (*FormatCommand) AutocompleteFlags() complete.Flags { return complete.Flags{ "-check": complete.PredictNothing, "-diff": complete.PredictNothing, "-write": complete.PredictNothing, } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/fmt_test.go����������������������������������������������������������������0000664�0000000�0000000�00000002060�13771713062�0017253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "path/filepath" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/stretchr/testify/assert" ) func TestFmt(t *testing.T) { s := &strings.Builder{} ui := &packersdk.BasicUi{ Writer: s, } c := &FormatCommand{ Meta: testMeta(t), } c.Ui = ui args := []string{"-check=true", filepath.Join(testFixture("fmt"), "formatted.pkr.hcl")} if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } expected := "" assert.Equal(t, expected, strings.TrimSpace(s.String())) } func TestFmt_unformattedPKRVarsTemplate(t *testing.T) { c := &FormatCommand{ Meta: testMeta(t), } args := []string{"-check=true", filepath.Join(testFixture("fmt"), "unformatted.pkrvars.hcl")} if code := c.Run(args); code != 3 { fatalCommand(t, c.Meta) } } func TestFmt_unfomattedTemlateDirectory(t *testing.T) { c := &FormatCommand{ Meta: testMeta(t), } args := []string{"-check=true", filepath.Join(testFixture("fmt"), "")} if code := c.Run(args); code != 3 { fatalCommand(t, c.Meta) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/hcl2_upgrade.go������������������������������������������������������������0000664�0000000�0000000�00000037127�13771713062�0020001�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bytes" "context" "fmt" "io" "os" "path/filepath" "sort" "strings" texttemplate "text/template" "github.com/hashicorp/hcl/v2/hclwrite" hcl2shim "github.com/hashicorp/packer/hcl2template/shim" "github.com/hashicorp/packer/packer-plugin-sdk/template" "github.com/posener/complete" "github.com/zclconf/go-cty/cty" ) type HCL2UpgradeCommand struct { Meta } func (c *HCL2UpgradeCommand) Run(args []string) int { ctx, cleanup := handleTermInterrupt(c.Ui) defer cleanup() cfg, ret := c.ParseArgs(args) if ret != 0 { return ret } return c.RunContext(ctx, cfg) } func (c *HCL2UpgradeCommand) ParseArgs(args []string) (*HCL2UpgradeArgs, int) { var cfg HCL2UpgradeArgs flags := c.Meta.FlagSet("hcl2_upgrade", FlagSetNone) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { return &cfg, 1 } args = flags.Args() if len(args) != 1 { flags.Usage() return &cfg, 1 } cfg.Path = args[0] if cfg.OutputFile == "" { cfg.OutputFile = cfg.Path + ".pkr.hcl" } return &cfg, 0 } const ( hcl2UpgradeFileHeader = `# This file was autogenerated by the BETA 'packer hcl2_upgrade' command. We # recommend double checking that everything is correct before going forward. We # also recommend treating this file as disposable. The HCL2 blocks in this # file can be moved to other files. For example, the variable blocks could be # moved to their own 'variables.pkr.hcl' file, etc. Those files need to be # suffixed with '.pkr.hcl' to be visible to Packer. To use multiple files at # once they also need to be in the same folder. 'packer inspect folder/' # will describe to you what is in that folder. # Avoid mixing go templating calls ( for example ` + "```{{ upper(`string`) }}```" + ` ) # and HCL2 calls (for example '${ var.string_value_example }' ). They won't be # executed together and the outcome will be unknown. ` inputVarHeader = ` # All generated input variables will be of 'string' type as this is how Packer JSON # views them; you can change their type later on. Read the variables type # constraints documentation # https://www.packer.io/docs/from-1.5/variables#type-constraints for more info. ` packerBlockHeader = ` # See https://www.packer.io/docs/from-1.5/blocks/packer for more info ` sourcesHeader = ` # source blocks are generated from your builders; a source can be referenced in # build blocks. A build block runs provisioner and post-processors on a # source. Read the documentation for source blocks here: # https://www.packer.io/docs/from-1.5/blocks/source` buildHeader = ` # a build block invokes sources and runs provisioning steps on them. The # documentation for build blocks can be found here: # https://www.packer.io/docs/from-1.5/blocks/build build { ` ) func (c *HCL2UpgradeCommand) RunContext(buildCtx context.Context, cla *HCL2UpgradeArgs) int { out := &bytes.Buffer{} var output io.Writer if err := os.MkdirAll(filepath.Dir(cla.OutputFile), 0); err != nil { c.Ui.Error(fmt.Sprintf("Failed to create output directory: %v", err)) return 1 } if f, err := os.Create(cla.OutputFile); err == nil { output = f defer f.Close() } else { c.Ui.Error(fmt.Sprintf("Failed to create output file: %v", err)) return 1 } if _, err := output.Write([]byte(hcl2UpgradeFileHeader)); err != nil { c.Ui.Error(fmt.Sprintf("Failed to write to file: %v", err)) return 1 } hdl, ret := c.GetConfigFromJSON(&cla.MetaArgs) if ret != 0 { return ret } core := hdl.(*CoreWrapper).Core if err := core.Initialize(); err != nil { c.Ui.Error(fmt.Sprintf("Ignoring following initialization error: %v", err)) } tpl := core.Template // Packer section if tpl.MinVersion != "" { out.Write([]byte(packerBlockHeader)) fileContent := hclwrite.NewEmptyFile() body := fileContent.Body() packerBody := body.AppendNewBlock("packer", nil).Body() packerBody.SetAttributeValue("required_version", cty.StringVal(fmt.Sprintf(">= %s", tpl.MinVersion))) out.Write(fileContent.Bytes()) } out.Write([]byte(inputVarHeader)) // Output variables section variables := []*template.Variable{} { // sort variables to avoid map's randomness for _, variable := range tpl.Variables { variables = append(variables, variable) } sort.Slice(variables, func(i, j int) bool { return variables[i].Key < variables[j].Key }) } for _, variable := range variables { variablesContent := hclwrite.NewEmptyFile() variablesBody := variablesContent.Body() variableBody := variablesBody.AppendNewBlock("variable", []string{variable.Key}).Body() variableBody.SetAttributeRaw("type", hclwrite.Tokens{&hclwrite.Token{Bytes: []byte("string")}}) if variable.Default != "" || !variable.Required { variableBody.SetAttributeValue("default", hcl2shim.HCL2ValueFromConfigValue(variable.Default)) } if isSensitiveVariable(variable.Key, tpl.SensitiveVariables) { variableBody.SetAttributeValue("sensitive", cty.BoolVal(true)) } variablesBody.AppendNewline() out.Write(transposeTemplatingCalls(variablesContent.Bytes())) } fmt.Fprintln(out, `# "timestamp" template function replacement`) fmt.Fprintln(out, `locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") }`) // Output sources section builders := []*template.Builder{} { // sort builders to avoid map's randomnes for _, builder := range tpl.Builders { builders = append(builders, builder) } sort.Slice(builders, func(i, j int) bool { return builders[i].Type+builders[i].Name < builders[j].Type+builders[j].Name }) } out.Write([]byte(sourcesHeader)) for i, builderCfg := range builders { sourcesContent := hclwrite.NewEmptyFile() body := sourcesContent.Body() body.AppendNewline() if !c.Meta.CoreConfig.Components.BuilderStore.Has(builderCfg.Type) { c.Ui.Error(fmt.Sprintf("unknown builder type: %q\n", builderCfg.Type)) return 1 } if builderCfg.Name == "" || builderCfg.Name == builderCfg.Type { builderCfg.Name = fmt.Sprintf("autogenerated_%d", i+1) } sourceBody := body.AppendNewBlock("source", []string{builderCfg.Type, builderCfg.Name}).Body() jsonBodyToHCL2Body(sourceBody, builderCfg.Config) _, _ = out.Write(transposeTemplatingCalls(sourcesContent.Bytes())) } // Output build section out.Write([]byte(buildHeader)) buildContent := hclwrite.NewEmptyFile() buildBody := buildContent.Body() if tpl.Description != "" { buildBody.SetAttributeValue("description", cty.StringVal(tpl.Description)) buildBody.AppendNewline() } sourceNames := []string{} for _, builder := range builders { sourceNames = append(sourceNames, fmt.Sprintf("source.%s.%s", builder.Type, builder.Name)) } buildBody.SetAttributeValue("sources", hcl2shim.HCL2ValueFromConfigValue(sourceNames)) buildBody.AppendNewline() _, _ = buildContent.WriteTo(out) for _, provisioner := range tpl.Provisioners { provisionerContent := hclwrite.NewEmptyFile() body := provisionerContent.Body() buildBody.AppendNewline() block := body.AppendNewBlock("provisioner", []string{provisioner.Type}) cfg := provisioner.Config if len(provisioner.Except) > 0 { cfg["except"] = provisioner.Except } if len(provisioner.Only) > 0 { cfg["only"] = provisioner.Only } if provisioner.MaxRetries != "" { cfg["max_retries"] = provisioner.MaxRetries } if provisioner.Timeout > 0 { cfg["timeout"] = provisioner.Timeout.String() } jsonBodyToHCL2Body(block.Body(), cfg) out.Write(transposeTemplatingCalls(provisionerContent.Bytes())) } for _, pps := range tpl.PostProcessors { postProcessorContent := hclwrite.NewEmptyFile() body := postProcessorContent.Body() switch len(pps) { case 0: continue case 1: default: body = body.AppendNewBlock("post-processors", nil).Body() } for _, pp := range pps { ppBody := body.AppendNewBlock("post-processor", []string{pp.Type}).Body() if pp.KeepInputArtifact != nil { ppBody.SetAttributeValue("keep_input_artifact", cty.BoolVal(*pp.KeepInputArtifact)) } cfg := pp.Config if len(pp.Except) > 0 { cfg["except"] = pp.Except } if len(pp.Only) > 0 { cfg["only"] = pp.Only } if pp.Name != "" && pp.Name != pp.Type { cfg["name"] = pp.Name } jsonBodyToHCL2Body(ppBody, cfg) } _, _ = out.Write(transposeTemplatingCalls(postProcessorContent.Bytes())) } _, _ = out.Write([]byte("}\n")) _, _ = output.Write(hclwrite.Format(out.Bytes())) c.Ui.Say(fmt.Sprintf("Successfully created %s ", cla.OutputFile)) return 0 } type UnhandleableArgumentError struct { Call string Correspondance string Docs string } func (uc UnhandleableArgumentError) Error() string { return fmt.Sprintf(`unhandled %q call: # there is no way to automatically upgrade the %[1]q call. # Please manually upgrade to %s # Visit %s for more infos.`, uc.Call, uc.Correspondance, uc.Docs) } // transposeTemplatingCalls executes parts of blocks as go template files and replaces // their result with their hcl2 variant. If something goes wrong the template // containing the go template string is returned. func transposeTemplatingCalls(s []byte) []byte { fallbackReturn := func(err error) []byte { if strings.Contains(err.Error(), "unhandled") { return append([]byte(fmt.Sprintf("\n# %s\n", err)), s...) } return append([]byte(fmt.Sprintf("\n# could not parse template for following block: %q\n", err)), s...) } funcMap := texttemplate.FuncMap{ "timestamp": func() string { return "${local.timestamp}" }, "isotime": func() string { return "${local.timestamp}" }, "user": func(in string) string { return fmt.Sprintf("${var.%s}", in) }, "env": func(in string) string { return fmt.Sprintf("${env(%q)}", in) }, "build": func(a string) string { return fmt.Sprintf("${build.%s}", a) }, "template_dir": func() string { return fmt.Sprintf("${path.root}") }, "pwd": func() string { return fmt.Sprintf("${path.cwd}") }, "packer_version": func() string { return fmt.Sprintf("${packer.version}") }, "uuid": func() string { return fmt.Sprintf("${uuidv4()}") }, "lower": func(_ string) (string, error) { return "", UnhandleableArgumentError{ "lower", "`lower(var.example)`", "https://www.packer.io/docs/from-1.5/functions/string/lower", } }, "upper": func(_ string) (string, error) { return "", UnhandleableArgumentError{ "upper", "`upper(var.example)`", "https://www.packer.io/docs/from-1.5/functions/string/upper", } }, "split": func(_, _ string, _ int) (string, error) { return "", UnhandleableArgumentError{ "split", "`split(separator, string)`", "https://www.packer.io/docs/from-1.5/functions/string/split", } }, "replace": func(_, _, _ string, _ int) (string, error) { return "", UnhandleableArgumentError{ "replace", "`replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`", "https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace", } }, "replace_all": func(_, _, _ string) (string, error) { return "", UnhandleableArgumentError{ "replace_all", "`replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`", "https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace", } }, "clean_resource_name": func(_ string) (string, error) { return "", UnhandleableArgumentError{ "clean_resource_name", "use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)`", "https://packer.io/docs/from-1.5/variables#custom-validation-rules" + " , https://www.packer.io/docs/from-1.5/functions/string/replace" + " or https://www.packer.io/docs/from-1.5/functions/string/regex_replace", } }, "build_name": func() string { return fmt.Sprintf("${build.name}") }, "build_type": func() string { return fmt.Sprintf("${build.type}") }, } tpl, err := texttemplate.New("hcl2_upgrade"). Funcs(funcMap). Parse(string(s)) if err != nil { return fallbackReturn(err) } str := &bytes.Buffer{} v := struct { HTTPIP string HTTPPort string }{ HTTPIP: "{{ .HTTPIP }}", HTTPPort: "{{ .HTTPPort }}", } if err := tpl.Execute(str, v); err != nil { return fallbackReturn(err) } return str.Bytes() } func jsonBodyToHCL2Body(out *hclwrite.Body, kvs map[string]interface{}) { ks := []string{} for k := range kvs { ks = append(ks, k) } sort.Strings(ks) for _, k := range ks { value := kvs[k] switch value := value.(type) { case map[string]interface{}: var mostComplexElem interface{} for _, randomElem := range value { // HACK: we take the most complex element of that map because // in HCL2, map of objects can be bodies, for example: // map containing object: source_ami_filter {} ( body ) // simple string/string map: tags = {} ) ( attribute ) // // if we could not find an object in this map then it's most // likely a plain map and so we guess it should be and // attribute. Though now if value refers to something that is // an object but only contains a string or a bool; we could // generate a faulty object. For example a (somewhat invalid) // source_ami_filter where only `most_recent` is set. switch randomElem.(type) { case string, int, float64, bool: if mostComplexElem != nil { continue } mostComplexElem = randomElem default: mostComplexElem = randomElem } } switch mostComplexElem.(type) { case string, int, float64, bool: out.SetAttributeValue(k, hcl2shim.HCL2ValueFromConfigValue(value)) default: nestedBlockBody := out.AppendNewBlock(k, nil).Body() jsonBodyToHCL2Body(nestedBlockBody, value) } case map[string]string, map[string]int, map[string]float64: out.SetAttributeValue(k, hcl2shim.HCL2ValueFromConfigValue(value)) case []interface{}: if len(value) == 0 { continue } var mostComplexElem interface{} for _, randomElem := range value { // HACK: we take the most complex element of that slice because // in hcl2 slices of plain types can be arrays, for example: // simple string type: owners = ["0000000000"] // object: launch_block_device_mappings {} switch randomElem.(type) { case string, int, float64, bool: if mostComplexElem != nil { continue } mostComplexElem = randomElem default: mostComplexElem = randomElem } } switch mostComplexElem.(type) { case map[string]interface{}: // this is an object in a slice; so we unwrap it. We // could try to remove any 's' suffix in the key, but // this might not work everywhere. for i := range value { value := value[i].(map[string]interface{}) nestedBlockBody := out.AppendNewBlock(k, nil).Body() jsonBodyToHCL2Body(nestedBlockBody, value) } continue default: out.SetAttributeValue(k, hcl2shim.HCL2ValueFromConfigValue(value)) } default: out.SetAttributeValue(k, hcl2shim.HCL2ValueFromConfigValue(value)) } } } func isSensitiveVariable(key string, vars []*template.Variable) bool { for _, v := range vars { if v.Key == key { return true } } return false } func (*HCL2UpgradeCommand) Help() string { helpText := ` Usage: packer hcl2_upgrade -output-file=JSON_TEMPLATE.pkr.hcl JSON_TEMPLATE... Will transform your JSON template into an HCL2 configuration. ` return strings.TrimSpace(helpText) } func (*HCL2UpgradeCommand) Synopsis() string { return "transform a JSON template into an HCL2 configuration" } func (*HCL2UpgradeCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing } func (*HCL2UpgradeCommand) AutocompleteFlags() complete.Flags { return complete.Flags{} } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/hcl2_upgrade_test.go�������������������������������������������������������0000664�0000000�0000000�00000001776�13771713062�0021041�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "io/ioutil" "os" "path/filepath" "testing" "github.com/google/go-cmp/cmp" ) func Test_hcl2_upgrade(t *testing.T) { cwd, err := os.Getwd() if err != nil { t.Fatalf("Getwd: %v", err) } _ = cwd tc := []struct { folder string }{ {"hcl2_upgrade_basic"}, } for _, tc := range tc { t.Run(tc.folder, func(t *testing.T) { inputPath := filepath.Join(testFixture(tc.folder, "input.json")) outputPath := inputPath + ".pkr.hcl" expectedPath := filepath.Join(testFixture(tc.folder, "expected.pkr.hcl")) p := helperCommand(t, "hcl2_upgrade", inputPath) bs, err := p.CombinedOutput() if err != nil { t.Fatalf("%v %s", err, bs) } expected := mustBytes(ioutil.ReadFile(expectedPath)) actual := mustBytes(ioutil.ReadFile(outputPath)) if diff := cmp.Diff(expected, actual); diff != "" { t.Fatalf("unexpected output: %s", diff) } os.Remove(outputPath) }) } } func mustBytes(b []byte, e error) []byte { if e != nil { panic(e) } return b } ��packer-1.6.6+ds1/command/inspect.go�����������������������������������������������������������������0000664�0000000�0000000�00000003301�13771713062�0017072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "context" "strings" "github.com/hashicorp/packer/packer" "github.com/posener/complete" ) type InspectCommand struct { Meta } func (c *InspectCommand) Run(args []string) int { ctx := context.Background() cfg, ret := c.ParseArgs(args) if ret != 0 { return ret } return c.RunContext(ctx, cfg) } func (c *InspectCommand) ParseArgs(args []string) (*InspectArgs, int) { var cfg InspectArgs flags := c.Meta.FlagSet("inspect", FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { return &cfg, 1 } args = flags.Args() if len(args) == 1 { cfg.Path = args[0] } return &cfg, 0 } func (c *InspectCommand) RunContext(ctx context.Context, cla *InspectArgs) int { packerStarter, ret := c.GetConfig(&cla.MetaArgs) if ret != 0 { return ret } // here we ignore init diags to allow unknown variables to be used _ = packerStarter.Initialize() return packerStarter.InspectConfig(packer.InspectConfigOptions{ Ui: c.Ui, }) } func (*InspectCommand) Help() string { helpText := ` Usage: packer inspect TEMPLATE Inspects a template, parsing and outputting the components a template defines. This does not validate the contents of a template (other than basic syntax by necessity). Options: -machine-readable Machine-readable output ` return strings.TrimSpace(helpText) } func (c *InspectCommand) Synopsis() string { return "see components of a template" } func (c *InspectCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing } func (c *InspectCommand) AutocompleteFlags() complete.Flags { return complete.Flags{ "-machine-readable": complete.PredictNothing, } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/inspect_test.go������������������������������������������������������������0000664�0000000�0000000�00000006370�13771713062�0020142�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "fmt" "path/filepath" "testing" "github.com/google/go-cmp/cmp" ) func Test_commands(t *testing.T) { tc := []struct { command []string env []string expected string }{ {[]string{"inspect", filepath.Join(testFixture("var-arg"), "fruit_builder.pkr.hcl")}, nil, `Packer Inspect: HCL2 mode > input-variables: var.fruit: "<unknown>" > local-variables: local.fruit: "<unknown>" > builds: > <unnamed build 0>: sources: null.builder provisioners: shell-local post-processors: <no post-processor> `}, {[]string{"inspect", "-var=fruit=banana", filepath.Join(testFixture("var-arg"), "fruit_builder.pkr.hcl")}, nil, `Packer Inspect: HCL2 mode > input-variables: var.fruit: "banana" > local-variables: local.fruit: "banana" > builds: > <unnamed build 0>: sources: null.builder provisioners: shell-local post-processors: <no post-processor> `}, {[]string{"inspect", "-var=fruit=peach", "-var=unknown_string=also_peach", `-var=unknown_unknown=["peach_too"]`, `-var=unknown_list_of_string=["first_peach", "second_peach"]`, filepath.Join(testFixture("hcl"), "inspect", "fruit_string.pkr.hcl")}, nil, `Packer Inspect: HCL2 mode > input-variables: var.default_from_env: "" var.fruit: "peach" var.other_default_from_env: "" var.unknown_list_of_string: "[\n \"first_peach\",\n \"second_peach\",\n]" var.unknown_string: "also_peach" var.unknown_unknown: "[\"peach_too\"]" > local-variables: > builds: `}, {[]string{"inspect", "-var=fruit=peach", "-var=other_default_from_env=apple", filepath.Join(testFixture("hcl"), "inspect")}, []string{"DEFAULT_FROM_ENV=cherry"}, `Packer Inspect: HCL2 mode > input-variables: var.default_from_env: "cherry" var.fruit: "peach" var.other_default_from_env: "apple" var.unknown_list_of_string: "<unknown>" var.unknown_string: "<unknown>" var.unknown_unknown: "<unknown>" > local-variables: > builds: > aws_example_builder: > Description: The builder of clouds !! Use it at will. sources: amazon-ebs.example-1 amazon-ebs.example-2 provisioners: shell post-processors: 0: manifest 1: shell-local 2: manifest shell-local `}, {[]string{"inspect", filepath.Join(testFixture("inspect"), "unset_var.json")}, nil, `Packer Inspect: JSON mode Required variables: something Optional variables and their defaults: Builders: <No builders> Provisioners: <No provisioners> Note: If your build names contain user variables or template functions such as 'timestamp', these are processed at build time, and therefore only show in their raw form here. `}, { []string{ "inspect", filepath.Join(testFixture("hcl-inspect-with-sensitive-vars")), }, nil, testFixtureContent("hcl-inspect-with-sensitive-vars", "expected-output.txt"), }, } for _, tc := range tc { t.Run(fmt.Sprintf("packer %s", tc.command), func(t *testing.T) { p := helperCommand(t, tc.command...) p.Env = append(p.Env, tc.env...) bs, err := p.Output() if err != nil { t.Fatalf("%v: %s", err, bs) } actual := string(bs) if diff := cmp.Diff(tc.expected, actual); diff != "" { t.Fatalf("unexpected ouput %s", diff) } }) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/meta.go��������������������������������������������������������������������0000664�0000000�0000000�00000005513�13771713062�0016362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "bufio" "flag" "io" "os" kvflag "github.com/hashicorp/packer/command/flag-kv" "github.com/hashicorp/packer/helper/wrappedstreams" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template" ) // FlagSetFlags is an enum to define what flags are present in the // default FlagSet returned by Meta.FlagSet type FlagSetFlags uint const ( FlagSetNone FlagSetFlags = 0 FlagSetBuildFilter FlagSetFlags = 1 << iota FlagSetVars ) // Meta contains the meta-options and functionality that nearly every // Packer command inherits. type Meta struct { CoreConfig *packer.CoreConfig Ui packersdk.Ui Version string } // Core returns the core for the given template given the configured // CoreConfig and user variables on this Meta. func (m *Meta) Core(tpl *template.Template, cla *MetaArgs) (*packer.Core, error) { // Copy the config so we don't modify it config := *m.CoreConfig config.Template = tpl fj := &kvflag.FlagJSON{} // First populate fj with contents from var files for _, file := range cla.VarFiles { err := fj.Set(file) if err != nil { return nil, err } } // Now read fj values back into flagvars and set as config.Variables. Only // add to flagVars if the key doesn't already exist, because flagVars comes // from the command line and should not be overridden by variable files. if cla.Vars == nil { cla.Vars = map[string]string{} } for k, v := range *fj { if _, exists := cla.Vars[k]; !exists { cla.Vars[k] = v } } config.Variables = cla.Vars core := packer.NewCore(&config) return core, nil } // FlagSet returns a FlagSet with the common flags that every // command implements. The exact behavior of FlagSet can be configured // using the flags as the second parameter, for example to disable // build settings on the commands that don't handle builds. func (m *Meta) FlagSet(n string, _ FlagSetFlags) *flag.FlagSet { f := flag.NewFlagSet(n, flag.ContinueOnError) // Create an io.Writer that writes to our Ui properly for errors. // This is kind of a hack, but it does the job. Basically: create // a pipe, use a scanner to break it into lines, and output each line // to the UI. Do this forever. errR, errW := io.Pipe() errScanner := bufio.NewScanner(errR) go func() { for errScanner.Scan() { m.Ui.Error(errScanner.Text()) } }() f.SetOutput(errW) return f } // ValidateFlags should be called after parsing flags to validate the // given flags func (m *Meta) ValidateFlags() error { // TODO return nil } // StdinPiped returns true if the input is piped. func (m *Meta) StdinPiped() bool { fi, err := wrappedstreams.Stdin().Stat() if err != nil { // If there is an error, let's just say its not piped return false } return fi.Mode()&os.ModeNamedPipe != 0 } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/plugin.go������������������������������������������������������������������0000664�0000000�0000000�00000034722�13771713062�0016736�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // This file is automatically generated by scripts/generate-plugins.go -- Do not edit! // package command import ( "fmt" "log" "regexp" "strings" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/plugin" alicloudecsbuilder "github.com/hashicorp/packer/builder/alicloud/ecs" amazonchrootbuilder "github.com/hashicorp/packer/builder/amazon/chroot" amazonebsbuilder "github.com/hashicorp/packer/builder/amazon/ebs" amazonebssurrogatebuilder "github.com/hashicorp/packer/builder/amazon/ebssurrogate" amazonebsvolumebuilder "github.com/hashicorp/packer/builder/amazon/ebsvolume" amazoninstancebuilder "github.com/hashicorp/packer/builder/amazon/instance" azurearmbuilder "github.com/hashicorp/packer/builder/azure/arm" azurechrootbuilder "github.com/hashicorp/packer/builder/azure/chroot" azuredtlbuilder "github.com/hashicorp/packer/builder/azure/dtl" cloudstackbuilder "github.com/hashicorp/packer/builder/cloudstack" digitaloceanbuilder "github.com/hashicorp/packer/builder/digitalocean" dockerbuilder "github.com/hashicorp/packer/builder/docker" filebuilder "github.com/hashicorp/packer/builder/file" googlecomputebuilder "github.com/hashicorp/packer/builder/googlecompute" hcloudbuilder "github.com/hashicorp/packer/builder/hcloud" hyperonebuilder "github.com/hashicorp/packer/builder/hyperone" hypervisobuilder "github.com/hashicorp/packer/builder/hyperv/iso" hypervvmcxbuilder "github.com/hashicorp/packer/builder/hyperv/vmcx" jdcloudbuilder "github.com/hashicorp/packer/builder/jdcloud" linodebuilder "github.com/hashicorp/packer/builder/linode" lxcbuilder "github.com/hashicorp/packer/builder/lxc" lxdbuilder "github.com/hashicorp/packer/builder/lxd" ncloudbuilder "github.com/hashicorp/packer/builder/ncloud" nullbuilder "github.com/hashicorp/packer/builder/null" oneandonebuilder "github.com/hashicorp/packer/builder/oneandone" openstackbuilder "github.com/hashicorp/packer/builder/openstack" oracleclassicbuilder "github.com/hashicorp/packer/builder/oracle/classic" oracleocibuilder "github.com/hashicorp/packer/builder/oracle/oci" oscbsubuilder "github.com/hashicorp/packer/builder/osc/bsu" oscbsusurrogatebuilder "github.com/hashicorp/packer/builder/osc/bsusurrogate" oscbsuvolumebuilder "github.com/hashicorp/packer/builder/osc/bsuvolume" oscchrootbuilder "github.com/hashicorp/packer/builder/osc/chroot" parallelsisobuilder "github.com/hashicorp/packer/builder/parallels/iso" parallelspvmbuilder "github.com/hashicorp/packer/builder/parallels/pvm" profitbricksbuilder "github.com/hashicorp/packer/builder/profitbricks" proxmoxbuilder "github.com/hashicorp/packer/builder/proxmox" proxmoxclonebuilder "github.com/hashicorp/packer/builder/proxmox/clone" proxmoxisobuilder "github.com/hashicorp/packer/builder/proxmox/iso" qemubuilder "github.com/hashicorp/packer/builder/qemu" scalewaybuilder "github.com/hashicorp/packer/builder/scaleway" tencentcloudcvmbuilder "github.com/hashicorp/packer/builder/tencentcloud/cvm" tritonbuilder "github.com/hashicorp/packer/builder/triton" uclouduhostbuilder "github.com/hashicorp/packer/builder/ucloud/uhost" vagrantbuilder "github.com/hashicorp/packer/builder/vagrant" virtualboxisobuilder "github.com/hashicorp/packer/builder/virtualbox/iso" virtualboxovfbuilder "github.com/hashicorp/packer/builder/virtualbox/ovf" virtualboxvmbuilder "github.com/hashicorp/packer/builder/virtualbox/vm" vmwareisobuilder "github.com/hashicorp/packer/builder/vmware/iso" vmwarevmxbuilder "github.com/hashicorp/packer/builder/vmware/vmx" vsphereclonebuilder "github.com/hashicorp/packer/builder/vsphere/clone" vsphereisobuilder "github.com/hashicorp/packer/builder/vsphere/iso" yandexbuilder "github.com/hashicorp/packer/builder/yandex" alicloudimportpostprocessor "github.com/hashicorp/packer/post-processor/alicloud-import" amazonimportpostprocessor "github.com/hashicorp/packer/post-processor/amazon-import" artificepostprocessor "github.com/hashicorp/packer/post-processor/artifice" checksumpostprocessor "github.com/hashicorp/packer/post-processor/checksum" compresspostprocessor "github.com/hashicorp/packer/post-processor/compress" digitaloceanimportpostprocessor "github.com/hashicorp/packer/post-processor/digitalocean-import" dockerimportpostprocessor "github.com/hashicorp/packer/post-processor/docker-import" dockerpushpostprocessor "github.com/hashicorp/packer/post-processor/docker-push" dockersavepostprocessor "github.com/hashicorp/packer/post-processor/docker-save" dockertagpostprocessor "github.com/hashicorp/packer/post-processor/docker-tag" exoscaleimportpostprocessor "github.com/hashicorp/packer/post-processor/exoscale-import" googlecomputeexportpostprocessor "github.com/hashicorp/packer/post-processor/googlecompute-export" googlecomputeimportpostprocessor "github.com/hashicorp/packer/post-processor/googlecompute-import" manifestpostprocessor "github.com/hashicorp/packer/post-processor/manifest" shelllocalpostprocessor "github.com/hashicorp/packer/post-processor/shell-local" ucloudimportpostprocessor "github.com/hashicorp/packer/post-processor/ucloud-import" vagrantpostprocessor "github.com/hashicorp/packer/post-processor/vagrant" vagrantcloudpostprocessor "github.com/hashicorp/packer/post-processor/vagrant-cloud" vspherepostprocessor "github.com/hashicorp/packer/post-processor/vsphere" vspheretemplatepostprocessor "github.com/hashicorp/packer/post-processor/vsphere-template" yandexexportpostprocessor "github.com/hashicorp/packer/post-processor/yandex-export" yandeximportpostprocessor "github.com/hashicorp/packer/post-processor/yandex-import" ansibleprovisioner "github.com/hashicorp/packer/provisioner/ansible" ansiblelocalprovisioner "github.com/hashicorp/packer/provisioner/ansible-local" azuredtlartifactprovisioner "github.com/hashicorp/packer/provisioner/azure-dtlartifact" breakpointprovisioner "github.com/hashicorp/packer/provisioner/breakpoint" chefclientprovisioner "github.com/hashicorp/packer/provisioner/chef-client" chefsoloprovisioner "github.com/hashicorp/packer/provisioner/chef-solo" convergeprovisioner "github.com/hashicorp/packer/provisioner/converge" fileprovisioner "github.com/hashicorp/packer/provisioner/file" inspecprovisioner "github.com/hashicorp/packer/provisioner/inspec" powershellprovisioner "github.com/hashicorp/packer/provisioner/powershell" puppetmasterlessprovisioner "github.com/hashicorp/packer/provisioner/puppet-masterless" puppetserverprovisioner "github.com/hashicorp/packer/provisioner/puppet-server" saltmasterlessprovisioner "github.com/hashicorp/packer/provisioner/salt-masterless" shellprovisioner "github.com/hashicorp/packer/provisioner/shell" shelllocalprovisioner "github.com/hashicorp/packer/provisioner/shell-local" sleepprovisioner "github.com/hashicorp/packer/provisioner/sleep" windowsrestartprovisioner "github.com/hashicorp/packer/provisioner/windows-restart" windowsshellprovisioner "github.com/hashicorp/packer/provisioner/windows-shell" ) type PluginCommand struct { Meta } var Builders = map[string]packersdk.Builder{ "alicloud-ecs": new(alicloudecsbuilder.Builder), "amazon-chroot": new(amazonchrootbuilder.Builder), "amazon-ebs": new(amazonebsbuilder.Builder), "amazon-ebssurrogate": new(amazonebssurrogatebuilder.Builder), "amazon-ebsvolume": new(amazonebsvolumebuilder.Builder), "amazon-instance": new(amazoninstancebuilder.Builder), "azure-arm": new(azurearmbuilder.Builder), "azure-chroot": new(azurechrootbuilder.Builder), "azure-dtl": new(azuredtlbuilder.Builder), "cloudstack": new(cloudstackbuilder.Builder), "digitalocean": new(digitaloceanbuilder.Builder), "docker": new(dockerbuilder.Builder), "file": new(filebuilder.Builder), "googlecompute": new(googlecomputebuilder.Builder), "hcloud": new(hcloudbuilder.Builder), "hyperone": new(hyperonebuilder.Builder), "hyperv-iso": new(hypervisobuilder.Builder), "hyperv-vmcx": new(hypervvmcxbuilder.Builder), "jdcloud": new(jdcloudbuilder.Builder), "linode": new(linodebuilder.Builder), "lxc": new(lxcbuilder.Builder), "lxd": new(lxdbuilder.Builder), "ncloud": new(ncloudbuilder.Builder), "null": new(nullbuilder.Builder), "oneandone": new(oneandonebuilder.Builder), "openstack": new(openstackbuilder.Builder), "oracle-classic": new(oracleclassicbuilder.Builder), "oracle-oci": new(oracleocibuilder.Builder), "osc-bsu": new(oscbsubuilder.Builder), "osc-bsusurrogate": new(oscbsusurrogatebuilder.Builder), "osc-bsuvolume": new(oscbsuvolumebuilder.Builder), "osc-chroot": new(oscchrootbuilder.Builder), "parallels-iso": new(parallelsisobuilder.Builder), "parallels-pvm": new(parallelspvmbuilder.Builder), "profitbricks": new(profitbricksbuilder.Builder), "proxmox": new(proxmoxbuilder.Builder), "proxmox-clone": new(proxmoxclonebuilder.Builder), "proxmox-iso": new(proxmoxisobuilder.Builder), "qemu": new(qemubuilder.Builder), "scaleway": new(scalewaybuilder.Builder), "tencentcloud-cvm": new(tencentcloudcvmbuilder.Builder), "triton": new(tritonbuilder.Builder), "ucloud-uhost": new(uclouduhostbuilder.Builder), "vagrant": new(vagrantbuilder.Builder), "virtualbox-iso": new(virtualboxisobuilder.Builder), "virtualbox-ovf": new(virtualboxovfbuilder.Builder), "virtualbox-vm": new(virtualboxvmbuilder.Builder), "vmware-iso": new(vmwareisobuilder.Builder), "vmware-vmx": new(vmwarevmxbuilder.Builder), "vsphere-clone": new(vsphereclonebuilder.Builder), "vsphere-iso": new(vsphereisobuilder.Builder), "yandex": new(yandexbuilder.Builder), } var Provisioners = map[string]packersdk.Provisioner{ "ansible": new(ansibleprovisioner.Provisioner), "ansible-local": new(ansiblelocalprovisioner.Provisioner), "azure-dtlartifact": new(azuredtlartifactprovisioner.Provisioner), "breakpoint": new(breakpointprovisioner.Provisioner), "chef-client": new(chefclientprovisioner.Provisioner), "chef-solo": new(chefsoloprovisioner.Provisioner), "converge": new(convergeprovisioner.Provisioner), "file": new(fileprovisioner.Provisioner), "inspec": new(inspecprovisioner.Provisioner), "powershell": new(powershellprovisioner.Provisioner), "puppet-masterless": new(puppetmasterlessprovisioner.Provisioner), "puppet-server": new(puppetserverprovisioner.Provisioner), "salt-masterless": new(saltmasterlessprovisioner.Provisioner), "shell": new(shellprovisioner.Provisioner), "shell-local": new(shelllocalprovisioner.Provisioner), "sleep": new(sleepprovisioner.Provisioner), "windows-restart": new(windowsrestartprovisioner.Provisioner), "windows-shell": new(windowsshellprovisioner.Provisioner), } var PostProcessors = map[string]packersdk.PostProcessor{ "alicloud-import": new(alicloudimportpostprocessor.PostProcessor), "amazon-import": new(amazonimportpostprocessor.PostProcessor), "artifice": new(artificepostprocessor.PostProcessor), "checksum": new(checksumpostprocessor.PostProcessor), "compress": new(compresspostprocessor.PostProcessor), "digitalocean-import": new(digitaloceanimportpostprocessor.PostProcessor), "docker-import": new(dockerimportpostprocessor.PostProcessor), "docker-push": new(dockerpushpostprocessor.PostProcessor), "docker-save": new(dockersavepostprocessor.PostProcessor), "docker-tag": new(dockertagpostprocessor.PostProcessor), "exoscale-import": new(exoscaleimportpostprocessor.PostProcessor), "googlecompute-export": new(googlecomputeexportpostprocessor.PostProcessor), "googlecompute-import": new(googlecomputeimportpostprocessor.PostProcessor), "manifest": new(manifestpostprocessor.PostProcessor), "shell-local": new(shelllocalpostprocessor.PostProcessor), "ucloud-import": new(ucloudimportpostprocessor.PostProcessor), "vagrant": new(vagrantpostprocessor.PostProcessor), "vagrant-cloud": new(vagrantcloudpostprocessor.PostProcessor), "vsphere": new(vspherepostprocessor.PostProcessor), "vsphere-template": new(vspheretemplatepostprocessor.PostProcessor), "yandex-export": new(yandexexportpostprocessor.PostProcessor), "yandex-import": new(yandeximportpostprocessor.PostProcessor), } var pluginRegexp = regexp.MustCompile("packer-(builder|post-processor|provisioner)-(.+)") func (c *PluginCommand) Run(args []string) int { // This is an internal call (users should not call this directly) so we're // not going to do much input validation. If there's a problem we'll often // just crash. Error handling should be added to facilitate debugging. log.Printf("args: %#v", args) if len(args) != 1 { c.Ui.Error("Wrong number of args") return 1 } // Plugin will match something like "packer-builder-amazon-ebs" parts := pluginRegexp.FindStringSubmatch(args[0]) if len(parts) != 3 { c.Ui.Error(fmt.Sprintf("Error parsing plugin argument [DEBUG]: %#v", parts)) return 1 } pluginType := parts[1] // capture group 1 (builder|post-processor|provisioner) pluginName := parts[2] // capture group 2 (.+) server, err := plugin.Server() if err != nil { c.Ui.Error(fmt.Sprintf("Error starting plugin server: %s", err)) return 1 } switch pluginType { case "builder": builder, found := Builders[pluginName] if !found { c.Ui.Error(fmt.Sprintf("Could not load builder: %s", pluginName)) return 1 } server.RegisterBuilder(builder) case "provisioner": provisioner, found := Provisioners[pluginName] if !found { c.Ui.Error(fmt.Sprintf("Could not load provisioner: %s", pluginName)) return 1 } server.RegisterProvisioner(provisioner) case "post-processor": postProcessor, found := PostProcessors[pluginName] if !found { c.Ui.Error(fmt.Sprintf("Could not load post-processor: %s", pluginName)) return 1 } server.RegisterPostProcessor(postProcessor) } server.Serve() return 0 } func (*PluginCommand) Help() string { helpText := ` Usage: packer plugin PLUGIN Runs an internally-compiled version of a plugin from the packer binary. NOTE: this is an internal command and you should not call it yourself. ` return strings.TrimSpace(helpText) } func (c *PluginCommand) Synopsis() string { return "internal plugin command" } ����������������������������������������������packer-1.6.6+ds1/command/signal.go������������������������������������������������������������������0000664�0000000�0000000�00000001405�13771713062�0016705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "context" "fmt" "os" "os/signal" "syscall" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func handleTermInterrupt(ui packersdk.Ui) (context.Context, func()) { ctx, cancelCtx := context.WithCancel(context.Background()) // Handle interrupts for this build sigCh := make(chan os.Signal, 1) signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) cleanup := func() { cancelCtx() signal.Stop(sigCh) close(sigCh) } go func() { select { case sig := <-sigCh: if sig == nil { // context got cancelled and this closed chan probably // triggered first return } ui.Error(fmt.Sprintf("Cancelling build after receiving %s", sig)) cancelCtx() case <-ctx.Done(): } }() return ctx, cleanup } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017727�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-name-and-type/�����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023463�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-name-and-type/all.json���������������������������������0000664�0000000�0000000�00000000627�13771713062�0025133�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "name": "test", "communicator": "none", "type": "null" }, { "name": "potato", "communicator": "none", "type": "null" } ], "post-processors": [ { "type": "manifest", "output": "manifest.json", "strip_time": true } ] } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-name-and-type/all.pkr.hcl������������������������������0000664�0000000�0000000�00000000646�13771713062�0025524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "test" { communicator = "none" } source "null" "potato" { communicator = "none" } build { sources = [ "sources.null.test", "sources.null.potato", ] provisioner "shell-local" { inline = [ "echo '' > ${source.type}.${source.name}.txt" ] } post-processor "manifest" { output = "manifest.json" strip_time = true } } ������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-name-and-type/buildname.pkr.hcl������������������������0000664�0000000�0000000�00000000407�13771713062�0026707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "pizza" { communicator = "none" } build { name = "pineapple" sources = [ "sources.null.pizza", ] provisioner "shell-local" { inline = [ "echo '' > ${build.name}.${source.name}.txt" ] } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-only/��������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022005�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-only/not-found.json������������������������������������0000664�0000000�0000000�00000001631�13771713062�0024612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "name": "chocolate", "type": "file", "content": "chocolate", "target": "chocolate.txt" }, { "name": "vanilla", "type": "non-existing", "content": "vanilla", "target": "vanilla.txt" } ], "post-processors": [ [ { "only": [ "vanilla" ], "name": "tomato", "type": "shell-local", "inline": [ "echo tomato > tomato.txt" ] } ], [ { "only": [ "chocolate" ], "type": "shell-local", "inline": [ "echo unnamed > unnamed.txt" ] } ] ] }�������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-only/template.json�������������������������������������0000664�0000000�0000000�00000003162�13771713062�0024515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "name": "chocolate", "type": "file", "content": "chocolate", "target": "chocolate.txt" }, { "name": "vanilla", "type": "file", "content": "vanilla", "target": "vanilla.txt" }, { "name": "cherry", "type": "file", "content": "cherry", "target": "cherry.txt" } ], "post-processors": [ [ { "name": "apple", "type": "shell-local", "inline": [ "echo apple > apple.txt" ] }, { "name": "peach", "type": "shell-local", "inline": [ "echo peach > peach.txt" ] } ], [ { "name": "pear", "type": "shell-local", "inline": [ "echo pear > pear.txt" ] }, { "name": "banana", "type": "shell-local", "inline": [ "echo pear > banana.txt" ] } ], [ { "only": [ "vanilla" ], "name": "tomato", "type": "shell-local", "inline": [ "echo tomato > tomato.txt" ] } ], [ { "only": [ "chocolate" ], "type": "shell-local", "inline": [ "echo unnamed > unnamed.txt" ] } ] ] }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-only/template.pkr.hcl����������������������������������0000664�0000000�0000000�00000001746�13771713062�0025113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "file" "chocolate" { content = "chocolate" target = "chocolate.txt" } source "file" "vanilla" { content = "vanilla" target = "vanilla.txt" } source "file" "cherry" { content = "cherry" target = "cherry.txt" } build { sources = [ "sources.file.chocolate", "sources.file.vanilla", "sources.file.cherry", ] post-processor "shell-local" { name = "apple" inline = [ "echo apple > apple.txt" ] } post-processor "shell-local" { name = "peach" inline = [ "echo apple > peach.txt" ] } post-processor "shell-local" { name = "pear" inline = [ "echo apple > pear.txt" ] } post-processor "shell-local" { name = "banana" inline = [ "echo apple > banana.txt" ] } post-processor "shell-local" { only = ["sources.file.vanilla"] name = "tomato" inline = [ "echo apple > tomato.txt" ] } post-processor "shell-local" { only = ["sources.file.chocolate"] inline = [ "echo apple > unnamed.txt" ] } } ��������������������������packer-1.6.6+ds1/command/test-fixtures/build-only/template.pkr.json���������������������������������0000664�0000000�0000000�00000002724�13771713062�0025313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "source": { "file": { "chocolate": { "content": "chocolate", "target": "chocolate.txt" } }, "file": { "vanilla": { "content": "vanilla", "target": "vanilla.txt" } }, "file": { "cherry": { "content": "cherry", "target": "cherry.txt" } } }, "build": { "sources": [ "sources.file.chocolate", "sources.file.vanilla", "sources.file.cherry" ], "provisioner": [ { "shell-local": { "name": "apple", "inline": [ "echo apple > apple.txt" ] } } ], "post-processor": [ { "shell-local": { "name": "peach", "inline": [ "echo peach > peach.txt" ] } }, { "shell-local": { "name": "pear", "inline": [ "echo pear > pear.txt" ] } }, { "shell-local": { "name": "banana", "inline": [ "echo banana > banana.txt" ] } }, { "shell-local": { "name": "tomato", "inline": [ "echo tomato > tomato.txt" ] } }, { "shell-local": { "only": [ "sources.file.chocolate" ], "inline": [ "echo unnamed > unnamed.txt" ] } } ] } } ��������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-variable-sharing/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024242�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/build-variable-sharing/template.json�������������������������0000664�0000000�0000000�00000001001�13771713062�0026740�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "name": "chocolate", "type": "null", "communicator": "none" } ], "provisioners": [ { "type": "shell-local", "inline": [ "echo hi > provisioner.{{ build `ID`}}.txt" ] } ], "post-processors": [ { "type": "shell-local", "inline": [ "echo hi > post-processor.{{ build `ID`}}.txt" ] } ] }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/cleanup-script/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022660�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/cleanup-script/template.json���������������������������������0000664�0000000�0000000�00000000407�13771713062�0025367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "type": "null", "communicator": "none" } ], "provisioners": [ { "type": "shell-local", "inline": ["exit 2"] } ], "error-cleanup-provisioner": { "type": "shell-local", "inline": ["echo 'rubber ducky'> ducky.txt"] } }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fix-invalid/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022141�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fix-invalid/template.json������������������������������������0000664�0000000�0000000�00000000031�13771713062�0024641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "hello": "world" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fix/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020515�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fix/template.json��������������������������������������������0000664�0000000�0000000�00000000130�13771713062�0023215�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{"type": "dummy"}], "push": { "name": "foo/bar" } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fmt/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020515�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fmt/formatted.pkr.hcl����������������������������������������0000664�0000000�0000000�00000000143�13771713062�0023763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "example" { communicator = "none" } build { sources = ["source.null.example"] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fmt/unformatted.auto.pkrvars.hcl�����������������������������0000664�0000000�0000000�00000000024�13771713062�0026167�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������region ="us-west-2" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fmt/unformatted.pkr.hcl��������������������������������������0000664�0000000�0000000�00000000223�13771713062�0024325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variable "region" { type =string } source "amazon-ebs" "example" { region = var.region } build { sources = ["source.amazon-ebs.example"] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/fmt/unformatted.pkrvars.hcl����������������������������������0000664�0000000�0000000�00000000125�13771713062�0025222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ami_filter_name ="amzn2-ami-hvm-*-x86_64-gp2" ami_filter_owners =[ "137112412989" ] �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl-inspect-with-sensitive-vars/�����������������������������0000775�0000000�0000000�00000000000�13771713062�0026071�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl-inspect-with-sensitive-vars/expected-output.txt����������0000664�0000000�0000000�00000000613�13771713062�0031771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Packer Inspect: HCL2 mode > input-variables: var.not_sensitive: "I am soooo not sensitive" var.not_sensitive_unknown: "<unknown>" var.sensitive: "<sensitive>" var.sensitive_array: "[\n \"<sensitive>\",\n \"<sensitive>\",\n]" var.sensitive_tags: "{\n \"first_key\" = \"<sensitive>\"\n \"second_key\" = \"<sensitive>\"\n}" var.sensitive_unknown: "<unknown>" > local-variables: > builds: ���������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl-inspect-with-sensitive-vars/vars.pkr.hcl�����������������0000664�0000000�0000000�00000000770�13771713062�0030333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "not_sensitive" { default = "I am soooo not sensitive" } variable "not_sensitive_unknown" { } variable "sensitive" { default = "I am soooo sensitive" sensitive = true } variable "sensitive_array" { default = ["Im supersensitive", "me too !!!!"] sensitive = true } variable "sensitive_tags" { default = { first_key = "this-is-mega-sensitive" second_key = "this-is-also-sensitive" } sensitive = true } variable "sensitive_unknown" { sensitive = true } ��������packer-1.6.6+ds1/command/test-fixtures/hcl-only-except/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022742�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl-only-except/build.pkr.hcl��������������������������������0000664�0000000�0000000�00000000552�13771713062�0025326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "file" "chocolate" { content = "chocolate" target = "chocolate.txt" } source "file" "vanilla" { content = "vanilla" target = "vanilla.txt" } source "file" "cherry" { content = "cherry" target = "cherry.txt" } build { source "file.cherry" { } } build { name = "my_build" sources = [ "file.chocolate", "file.vanilla", ] } ������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020475�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/inspect/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022142�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/inspect/aws-builds.pkr.hcl�������������������������������0000664�0000000�0000000�00000001221�13771713062�0025473�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { name = "aws_example_builder" description = <<EOF The builder of clouds !! Use it at will. EOF sources = [ "source.amazon-ebs.example-1", // this one is not defined but we don't want to error there, we just // would like to show what sources are being referenced. "source.amazon-ebs.example-2", ] provisioner "shell" { files = [ "bins/install-this.sh", "bins/install-that.sh", "bins/conf-this.sh", ] } post-processor "manifest" { } post-processor "shell-local" { } post-processors { post-processor "manifest" { } post-processor "shell-local" { } } }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/inspect/fruit_string.pkr.hcl�����������������������������0000664�0000000�0000000�00000000536�13771713062�0026150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "fruit" { type = string default = "banana" } variable "unknown_string" { type = string } variable "unknown_list_of_string" { type = list(string) } variable "unknown_unknown" { } variable "default_from_env" { default = env("DEFAULT_FROM_ENV") } variable "other_default_from_env" { default = env("OTHER_DEFAULT_FROM_ENV") } ������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/inspect/virtualbox-builds.pkr.hcl������������������������0000664�0000000�0000000�00000000000�13771713062�0027072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/provisioner-override.pkr.hcl�����������������������������0000664�0000000�0000000�00000000524�13771713062�0026155�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "example1" { communicator = "none" } source "null" "example2" { communicator = "none" } build { sources = ["source.null.example1", "source.null.example2"] provisioner "shell-local" { inline = ["echo not overridden"] override = { example1 = { inline = ["echo yes overridden"] } } } }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/recipes/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022127�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/recipes/build.pkr.hcl������������������������������������0000664�0000000�0000000�00000003456�13771713062�0024521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { source "source.null.base" { name = "tiramisu" // pull me up ! } provisioner "shell-local" { name = "whipped_york" inline = [ "echo whip_york > ${upper(build.ID)}.${source.name}.txt" ] } provisioner "shell-local" { name = "mascarpone" inline = [ "echo mascarpone >> ${upper(build.ID)}.${source.name}.txt" ] } post-processor "shell-local" { name = "whipped_egg_white" inline = [ "echo whipped_egg_white >> ${upper(build.ID)}.${source.name}.txt" ] } post-processor "shell-local" { name = "dress_with_coffeed_boudoirs" inline = [ "echo dress >> ${upper(build.ID)}.${source.name}.txt" ] } } build { name = "recipes" source "source.null.base" { name = "spaghetti_carbonara" } source "source.null.base" { name = "lasagna" } provisioner "shell-local" { name = "add_spaghetti" inline = [ "echo spaghetti > ${upper(build.ID)}.${source.name}.txt" ] only = ["null.spaghetti_carbonara"] } post-processor "shell-local" { name = "carbonara_it" inline = [ "echo carbonara >> ${upper(build.ID)}.${source.name}.txt" ] except = ["null.lasagna"] } provisioner "shell-local" { name = "add_lasagna" inline = [ "echo lasagna > ${upper(build.ID)}.${source.name}.txt" ] only = ["null.lasagna"] } provisioner "shell-local" { name = "add_tomato" inline = [ "echo tomato >> ${upper(build.ID)}.${source.name}.txt" ] except = ["null.spaghetti_carbonara"] } provisioner "shell-local" { name = "add_mozza" inline = [ "echo mozza >> ${upper(build.ID)}.${source.name}.txt" ] except = ["null.spaghetti_carbonara"] } post-processor "shell-local" { name = "cook" inline = [ "echo cooking... >> ${upper(build.ID)}.${source.name}.txt" ] except = ["null.spaghetti_carbonara"] } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/recipes/sources.pkr.hcl����������������������������������0000664�0000000�0000000�00000000061�13771713062�0025072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "base" { communicator = "none" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/reprepare/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022462�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/reprepare/hello.sh���������������������������������������0000775�0000000�0000000�00000000056�13771713062�0024125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������echo hello from the ${BUILDER} builder ${USER}����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/reprepare/shell-local-windows.pkr.hcl��������������������0000664�0000000�0000000�00000000371�13771713062�0027635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "example" { communicator = "none" } build { sources = [ "source.null.example" ] provisioner "shell-local" { script = "./${path.root}/test_cmd.cmd" environment_vars = ["USER=packeruser", "BUILDER=${upper(build.ID)}"] } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/reprepare/shell-local.pkr.hcl����������������������������0000664�0000000�0000000�00000000365�13771713062�0026150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "example" { communicator = "none" } build { sources = [ "source.null.example" ] provisioner "shell-local" { script = "./${path.root}/hello.sh" environment_vars = ["USER=packeruser", "BUILDER=${upper(build.ID)}"] } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/reprepare/test_cmd.cmd�����������������������������������0000664�0000000�0000000�00000000054�13771713062�0024750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������echo hello from the %BUILDER% builder %USER%������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/validation/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022627�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/validation/map/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023404�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/validation/map/definition.pkr.hcl������������������������0000664�0000000�0000000�00000000704�13771713062�0027020�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "image_metadata" { default = { key: "value", something: { foo: "bar", } } validation { condition = length(var.image_metadata.key) > 4 error_message = "The image_metadata.key field must be more than 4 runes." } validation { condition = substr(var.image_metadata.something.foo, 0, 3) == "bar" error_message = "The image_metadata.something.foo field must start with \"bar\"." } } build {} ������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/validation/map/invalid_value.pkrvars.hcl�����������������0000664�0000000�0000000�00000000112�13771713062�0030377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ image_metadata = { key: "value", something: { foo: "woo", } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/validation/map/valid_value.pkrvars.hcl�������������������0000664�0000000�0000000�00000000115�13771713062�0030053�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ image_metadata = { key: "value", something: { foo: "barwoo", } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/variables/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022445�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/variables/list_of_string/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025472�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/variables/list_of_string/var.pkr.hcl���������������������0000664�0000000�0000000�00000000065�13771713062�0027546�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "list_of_string" { type = list(string) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/variables/untyped_var/�����������������������������������0000775�0000000�0000000�00000000000�13771713062�0025005�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/variables/untyped_var/settings.auto.pkrvars.hcl����������0000664�0000000�0000000�00000000046�13771713062�0031773�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ untyped = ["slice", "of", "strings"] ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl/variables/untyped_var/var.pkr.hcl������������������������0000664�0000000�0000000�00000000030�13771713062�0027051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "untyped" { } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl2_upgrade_basic/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023427�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl2_upgrade_basic/expected.pkr.hcl��������������������������0000664�0000000�0000000�00000016511�13771713062�0026517�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This file was autogenerated by the BETA 'packer hcl2_upgrade' command. We # recommend double checking that everything is correct before going forward. We # also recommend treating this file as disposable. The HCL2 blocks in this # file can be moved to other files. For example, the variable blocks could be # moved to their own 'variables.pkr.hcl' file, etc. Those files need to be # suffixed with '.pkr.hcl' to be visible to Packer. To use multiple files at # once they also need to be in the same folder. 'packer inspect folder/' # will describe to you what is in that folder. # Avoid mixing go templating calls ( for example ```{{ upper(`string`) }}``` ) # and HCL2 calls (for example '${ var.string_value_example }' ). They won't be # executed together and the outcome will be unknown. # See https://www.packer.io/docs/from-1.5/blocks/packer for more info packer { required_version = ">= 1.6.0" } # All generated input variables will be of 'string' type as this is how Packer JSON # views them; you can change their type later on. Read the variables type # constraints documentation # https://www.packer.io/docs/from-1.5/variables#type-constraints for more info. variable "aws_access_key" { type = string default = "" sensitive = true } variable "aws_region" { type = string } variable "aws_secondary_region" { type = string default = "${env("AWS_DEFAULT_REGION")}" } variable "aws_secret_key" { type = string default = "" sensitive = true } variable "secret_account" { type = string default = "🤷" sensitive = true } # "timestamp" template function replacement locals { timestamp = regex_replace(timestamp(), "[- TZ:]", "") } # source blocks are generated from your builders; a source can be referenced in # build blocks. A build block runs provisioner and post-processors on a # source. Read the documentation for source blocks here: # https://www.packer.io/docs/from-1.5/blocks/source source "amazon-ebs" "autogenerated_1" { access_key = "${var.aws_access_key}" ami_description = "Ubuntu 16.04 LTS - expand root partition" ami_name = "ubuntu-16-04-test-${local.timestamp}" encrypt_boot = true launch_block_device_mappings { delete_on_termination = true device_name = "/dev/sda1" volume_size = 48 volume_type = "gp2" } region = "${var.aws_region}" secret_key = "${var.aws_secret_key}" source_ami_filter { filters = { name = "ubuntu/images/*/ubuntu-xenial-16.04-amd64-server-*" root-device-type = "ebs" virtualization-type = "hvm" } most_recent = true owners = ["099720109477"] } spot_instance_types = ["t2.small", "t2.medium", "t2.large"] spot_price = "0.0075" ssh_interface = "session_manager" ssh_username = "ubuntu" temporary_iam_instance_profile_policy_document { Statement { Action = ["*"] Effect = "Allow" Resource = ["*"] } Version = "2012-10-17" } } # a build block invokes sources and runs provisioning steps on them. The # documentation for build blocks can be found here: # https://www.packer.io/docs/from-1.5/blocks/build build { sources = ["source.amazon-ebs.autogenerated_1"] provisioner "shell" { except = ["amazon-ebs"] inline = ["echo ${var.secret_account}", "echo ${build.ID}", "echo ${build.SSHPublicKey} | head -c 14", "echo ${path.root} is not ${path.cwd}", "echo ${packer.version}", "echo ${uuidv4()}"] max_retries = "5" } # template: hcl2_upgrade:2:38: executing "hcl2_upgrade" at <clean_resource_name>: error calling clean_resource_name: unhandled "clean_resource_name" call: # there is no way to automatically upgrade the "clean_resource_name" call. # Please manually upgrade to use custom validation rules, `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)` # Visit https://packer.io/docs/from-1.5/variables#custom-validation-rules , https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace for more infos. provisioner "shell" { inline = ["echo mybuild-{{isotime | clean_resource_name}}"] } # template: hcl2_upgrade:2:35: executing "hcl2_upgrade" at <lower>: error calling lower: unhandled "lower" call: # there is no way to automatically upgrade the "lower" call. # Please manually upgrade to `lower(var.example)` # Visit https://www.packer.io/docs/from-1.5/functions/string/lower for more infos. provisioner "shell" { inline = ["echo {{ `SOMETHING` | lower }}"] } # template: hcl2_upgrade:2:35: executing "hcl2_upgrade" at <upper>: error calling upper: unhandled "upper" call: # there is no way to automatically upgrade the "upper" call. # Please manually upgrade to `upper(var.example)` # Visit https://www.packer.io/docs/from-1.5/functions/string/upper for more infos. provisioner "shell" { inline = ["echo {{ `something` | upper }}"] } # template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <split `some-string` `-` 0>: error calling split: unhandled "split" call: # there is no way to automatically upgrade the "split" call. # Please manually upgrade to `split(separator, string)` # Visit https://www.packer.io/docs/from-1.5/functions/string/split for more infos. provisioner "shell" { inline = ["echo {{ split `some-string` `-` 0 }}"] } # template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <replace_all `-` `/` build_name>: error calling replace_all: unhandled "replace_all" call: # there is no way to automatically upgrade the "replace_all" call. # Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)` # Visit https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace for more infos. provisioner "shell" { inline = ["echo {{ replace_all `-` `/` build_name }}"] } # template: hcl2_upgrade:2:21: executing "hcl2_upgrade" at <replace `some-string` `-` `/` 1>: error calling replace: unhandled "replace" call: # there is no way to automatically upgrade the "replace" call. # Please manually upgrade to `replace(string, substring, replacement)` or `regex_replace(string, substring, replacement)` # Visit https://www.packer.io/docs/from-1.5/functions/string/replace or https://www.packer.io/docs/from-1.5/functions/string/regex_replace for more infos. provisioner "shell" { inline = ["echo {{ replace `some-string` `-` `/` 1 }}"] } provisioner "shell-local" { inline = ["sleep 100000"] only = ["amazon-ebs"] timeout = "5s" } post-processor "amazon-import" { format = "vmdk" license_type = "BYOL" region = "eu-west-3" s3_bucket_name = "hashicorp.adrien" tags = { Description = "packer amazon-import ${local.timestamp}" } } post-processors { post-processor "artifice" { keep_input_artifact = true files = ["path/something.ova"] name = "very_special_artifice_post-processor" only = ["amazon-ebs"] } post-processor "amazon-import" { except = ["amazon-ebs"] license_type = "BYOL" s3_bucket_name = "hashicorp.adrien" tags = { Description = "packer amazon-import ${local.timestamp}" } } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/hcl2_upgrade_basic/input.json��������������������������������0000664�0000000�0000000�00000011341�13771713062�0025461�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "min_packer_version": "1.6.0", "variables": { "secret_account": "🤷", "aws_region": null, "aws_secondary_region": "{{ env `AWS_DEFAULT_REGION` }}", "aws_secret_key": "", "aws_access_key": "" }, "sensitive-variables": [ "aws_secret_key", "aws_access_key", "secret_account", "potato" ], "builders": [ { "type": "amazon-ebs", "region": "{{ user `aws_region` }}", "secret_key": "{{ user `aws_secret_key` }}", "access_key": "{{ user `aws_access_key` }}", "ami_name": "ubuntu-16-04-test-{{ timestamp }}", "ami_description": "Ubuntu 16.04 LTS - expand root partition", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "ubuntu/images/*/ubuntu-xenial-16.04-amd64-server-*", "root-device-type": "ebs" }, "owners": [ "099720109477" ], "most_recent": true }, "launch_block_device_mappings": [ { "delete_on_termination": true, "device_name": "/dev/sda1", "volume_type": "gp2", "volume_size": 48 } ], "spot_price": "0.0075", "spot_instance_types": [ "t2.small", "t2.medium", "t2.large" ], "encrypt_boot": true, "ssh_username": "ubuntu", "temporary_iam_instance_profile_policy_document": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "*" ], "Resource": ["*"] } ] }, "ssh_interface": "session_manager" } ], "provisioners": [ { "type": "shell", "except": [ "amazon-ebs" ], "max_retries": 5, "inline": [ "echo {{ user `secret_account` }}", "echo {{ build `ID` }}", "echo {{ build `SSHPublicKey` }} | head -c 14", "echo {{ template_dir }} is not {{ pwd }}", "echo {{ packer_version }}", "echo {{ uuid }}" ] }, { "type": "shell", "inline": [ "echo mybuild-{{isotime | clean_resource_name}}" ] }, { "type": "shell", "inline": [ "echo {{ `SOMETHING` | lower }}" ] }, { "type": "shell", "inline": [ "echo {{ `something` | upper }}" ] }, { "type": "shell", "inline": [ "echo {{ split `some-string` `-` 0 }}" ] }, { "type": "shell", "inline": [ "echo {{ replace_all `-` `/` build_name }}" ] }, { "type": "shell", "inline": [ "echo {{ replace `some-string` `-` `/` 1 }}" ] }, { "type": "shell-local", "only": [ "amazon-ebs" ], "timeout": "5s", "inline": [ "sleep 100000" ] } ], "post-processors": [ [ { "type": "amazon-import", "region": "eu-west-3", "s3_bucket_name": "hashicorp.adrien", "license_type": "BYOL", "format": "vmdk", "tags": { "Description": "packer amazon-import {{timestamp}}" } } ], [ { "only": [ "amazon-ebs" ], "files": [ "path/something.ova" ], "keep_input_artifact": true, "name": "very_special_artifice_post-processor", "type": "artifice" }, { "except": [ "amazon-ebs" ], "type": "amazon-import", "s3_bucket_name": "hashicorp.adrien", "license_type": "BYOL", "tags": { "Description": "packer amazon-import {{timestamp}}" } } ] ] }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/inspect/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021374�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/inspect/unset_var.json���������������������������������������0000664�0000000�0000000�00000000067�13771713062�0024300�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "something": null } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/parallel/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021523�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/parallel/1lock-5wg.json��������������������������������������0000664�0000000�0000000�00000000517�13771713062�0024132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "lock", "name": "build0"}, {"type": "parallel-test", "name": "build1"}, {"type": "parallel-test", "name": "build2"}, {"type": "parallel-test", "name": "build3"}, {"type": "parallel-test", "name": "build4"}, {"type": "parallel-test", "name": "build5"} ] }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/parallel/1lock.json������������������������������������������0000664�0000000�0000000�00000000106�13771713062�0023424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "lock", "name": "build0"} ] }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/parallel/2lock-4wg.json��������������������������������������0000664�0000000�0000000�00000000506�13771713062�0024130�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "lock", "name": "build0"}, {"type": "parallel-test", "name": "build1"}, {"type": "parallel-test", "name": "build2"}, {"type": "lock", "name": "build3"}, {"type": "parallel-test", "name": "build4"}, {"type": "parallel-test", "name": "build5"} ] }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/parallel/2lock-timeout.json����������������������������������0000664�0000000�0000000�00000001025�13771713062�0025112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "lock", "name": "build0"}, {"type": "parallel-test", "name": "build1"}, {"type": "parallel-test", "name": "build2"}, {"type": "file", "name": "timeout-build", "target": "roses.txt"}, {"type": "parallel-test", "name": "build4"}, {"type": "parallel-test", "name": "build5"} ], "provisioners": [ { "only": ["timeout-build"], "type": "sleep", "duration": "2m", "timeout": "1ns" } ] }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/parallel/2lock.json������������������������������������������0000664�0000000�0000000�00000000162�13771713062�0023427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "lock", "name": "build0"}, {"type": "lock", "name": "build1"} ] }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/provisioners/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022471�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/provisioners/provisioner-override.json�����������������������0000664�0000000�0000000�00000000635�13771713062�0027564�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "type": "null", "name": "example1", "communicator": "none" }, { "type": "null", "name": "example2", "communicator": "none" } ], "provisioners": [ { "type": "shell-local", "inline": ["echo not overridden"], "override": { "example1": { "inline": ["echo yes overridden"] } } } ] }���������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/timeout/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021415�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/timeout/template.json����������������������������������������0000664�0000000�0000000�00000001332�13771713062�0024122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "name": "roses", "type": "file", "content": "roses", "target": "roses.txt" } ], "provisioners": [ { "type": "shell-local", "inline": [ "touch fuchsias.txt" ], "timeout": "5s" }, { "type": "shell-local", "inline": [ "touch lilas.txt" ] }, { "type": "sleep", "duration": "2m", "timeout": "1ms" }, { "type": "shell-local", "inline": [ "touch campanules.txt" ] } ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate-invalid/��������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023144�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate-invalid/bad_provisioner.json������������������������0000664�0000000�0000000�00000000320�13771713062�0027217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders":[ { "type":"file", "target":"chocolate.txt", "content":"chocolate" } ], "provisioners": [ { "type": "file", "comment": "unknown field" } ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate-invalid/broken.json���������������������������������0000664�0000000�0000000�00000000226�13771713062�0025317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders":[ { "type":"file", "target":"chocolate.txt", "content":"chocolate" } ], "provisioners": "not an array" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate-invalid/missing_build_block.pkr.hcl�����������������0000664�0000000�0000000�00000000175�13771713062�0030434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "file" "chocolate" { target = "chocolate.txt" content = "chocolate" } build { sources = ["source.file.cho"] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021520�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/build.json������������������������������������������0000664�0000000�0000000�00000000164�13771713062�0023513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders":[ { "type":"file", "target":"chocolate.txt", "content":"chocolate" } ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/build.pkr.hcl���������������������������������������0000664�0000000�0000000�00000000257�13771713062�0024106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer { required_version = ">= v1.0.0" } source "file" "chocolate" { target = "chocolate.txt" content = "chocolate" } build { sources = ["source.file.chocolate"] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/build_with_vars.pkr.hcl�����������������������������0000664�0000000�0000000�00000000300�13771713062�0026161�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variable "target" { type = string default = "chocolate.txt" } source "file" "chocolate" { target = var.target content = "chocolate" } build { sources = ["source.file.chocolate"] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/invalid_packer_block.pkr.hcl������������������������0000664�0000000�0000000�00000000043�13771713062�0027125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer { version = ">= v1.0.0" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/null_var.json���������������������������������������0000664�0000000�0000000�00000000375�13771713062�0024242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "null_var": null }, "builders": [{ "type": "null", "communicator": "none" }], "provisioners": [ { "type": "shell-local", "inline": "echo yop" } ] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/template.json���������������������������������������0000664�0000000�0000000�00000000226�13771713062�0024226�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders":[ { "type":"file", "target":"chocolate.txt", "content":"chocolate" } ], "min_packer_version":"101.0.0" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/validate_except.json��������������������������������0000664�0000000�0000000�00000001167�13771713062�0025561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "name": "chocolate", "type": "file", "target": "chocolate.txt", "content": "chocolate" }, { "type": "file", "name": "vanilla" } ], "post-processors": [ [ { "name": "apple", "type": "shell-local", "inline": [ "echo apple 'apple'" ] } ], [ { "name": "pear", "type": "shell-local", "inline": [ "echo apple 'pear'" ] }, { "name": "banana", "type": "shell-local" } ] ], "min_packer_version": "101.0.0" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/validate/validate_except.pkr.hcl�����������������������������0000664�0000000�0000000�00000000773�13771713062�0026153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "file" "chocolate" { content = "chocolate" target = "chocolate.txt" } source "file" "vanilla" { content = "vanilla" } build { sources = [ "source.file.chocolate", "source.file.vanilla" ] post-processors { post-processor "shell-local" { name = "apple" inline = [ "echo apple 'apple'" ] } post-processor "shell-local" { name = "pear" inline = [ "echo apple 'pear'" ] } post-processor "shell-local" { name = "banana" } } } �����packer-1.6.6+ds1/command/test-fixtures/validate/var_foo_with_no_default.pkr.hcl���������������������0000664�0000000�0000000�00000000023�13771713062�0027664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "foo" { }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/var-arg/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021266�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/var-arg/apple.hcl��������������������������������������������0000664�0000000�0000000�00000000021�13771713062�0023050�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ fruit = "apple" ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/var-arg/apple.json�������������������������������������������0000664�0000000�0000000�00000000031�13771713062�0023254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "fruit": "apple" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/var-arg/chocolate.auto.pkrvars.hcl���������������������������0000664�0000000�0000000�00000000060�13771713062�0026351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ fruit = "chocolate" // is that even a fruit !? ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/var-arg/fruit_builder.json�����������������������������������0000664�0000000�0000000�00000000610�13771713062�0025015�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "fruit": null }, "builders": [ { "communicator": "none", "type": "null" } ], "post-processors": [ [ { "name": "apple", "type": "shell-local", "inline": [ "echo {{ user `fruit` }} > {{ user `fruit` }}.txt" ] } ] ] } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/var-arg/fruit_builder.pkr.hcl��������������������������������0000664�0000000�0000000�00000000447�13771713062�0025415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "fruit" { type = string } locals { fruit = var.fruit } source "null" "builder" { communicator = "none" } build { sources = [ "source.null.builder", ] provisioner "shell-local" { inline = ["echo ${local.fruit} > ${local.fruit}.txt"] } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/var-arg/map.pkr.hcl������������������������������������������0000664�0000000�0000000�00000000122�13771713062�0023321�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "images" { type = map(string) default = { key = "value" } }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/version_req/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022263�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/version_req/base_failure/������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024704�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/version_req/base_failure/version.pkr.hcl���������������������0000664�0000000�0000000�00000000201�13771713062�0027645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer { required_version = ">= 700000.0.0" } block_from_the_future { the_answer_to_life_the_universe_and_everything = 42 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/version_req/base_success/������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024725�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/version_req/base_success/version.pkr.hcl���������������������0000664�0000000�0000000�00000000053�13771713062�0027673�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer { required_version = ">= 1.0.0" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/version_req/wrong_field_name/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025562�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/test-fixtures/version_req/wrong_field_name/version.pkr.hcl�����������������0000664�0000000�0000000�00000000047�13771713062�0030533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer { version = ">= 700000.0.0" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/utils.go�������������������������������������������������������������������0000664�0000000�0000000�00000000537�13771713062�0016575�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "os" "strings" ) func isDir(name string) (bool, error) { s, err := os.Stat(name) if err != nil { return false, err } return s.IsDir(), nil } func isHCLLoaded(name string) (bool, error) { if strings.HasSuffix(name, ".pkr.hcl") || strings.HasSuffix(name, ".pkr.json") { return true, nil } return isDir(name) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/validate.go����������������������������������������������������������������0000664�0000000�0000000�00000005460�13771713062�0017226�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "context" "strings" "github.com/hashicorp/packer/packer" "github.com/posener/complete" ) type ValidateCommand struct { Meta } func (c *ValidateCommand) Run(args []string) int { ctx, cleanup := handleTermInterrupt(c.Ui) defer cleanup() cfg, ret := c.ParseArgs(args) if ret != 0 { return ret } return c.RunContext(ctx, cfg) } func (c *ValidateCommand) ParseArgs(args []string) (*ValidateArgs, int) { var cfg ValidateArgs flags := c.Meta.FlagSet("validate", FlagSetBuildFilter|FlagSetVars) flags.Usage = func() { c.Ui.Say(c.Help()) } cfg.AddFlagSets(flags) if err := flags.Parse(args); err != nil { return &cfg, 1 } args = flags.Args() if len(args) != 1 { flags.Usage() return &cfg, 1 } cfg.Path = args[0] return &cfg, 0 } func (c *ValidateCommand) RunContext(ctx context.Context, cla *ValidateArgs) int { packerStarter, ret := c.GetConfig(&cla.MetaArgs) if ret != 0 { return 1 } // If we're only checking syntax, then we're done already if cla.SyntaxOnly { c.Ui.Say("Syntax-only check passed. Everything looks okay.") return 0 } diags := packerStarter.Initialize() ret = writeDiags(c.Ui, nil, diags) if ret != 0 { return ret } _, diags = packerStarter.GetBuilds(packer.GetBuildsOptions{ Only: cla.Only, Except: cla.Except, }) fixerDiags := packerStarter.FixConfig(packer.FixConfigOptions{ Mode: packer.Diff, }) diags = append(diags, fixerDiags...) return writeDiags(c.Ui, nil, diags) } func (*ValidateCommand) Help() string { helpText := ` Usage: packer validate [options] TEMPLATE Checks the template is valid by parsing the template and also checking the configuration with the various builders, provisioners, etc. If it is not valid, the errors will be shown and the command will exit with a non-zero exit status. If it is valid, it will exit with a zero exit status. Options: -syntax-only Only check syntax. Do not verify config of the template. -except=foo,bar,baz Validate all builds other than these. -only=foo,bar,baz Validate only these builds. -var 'key=value' Variable for templates, can be used multiple times. -var-file=path JSON or HCL2 file containing user variables. [ Note that even in HCL mode this expects file to contain JSON, a fix is comming soon ] ` return strings.TrimSpace(helpText) } func (*ValidateCommand) Synopsis() string { return "check that a template is valid" } func (*ValidateCommand) AutocompleteArgs() complete.Predictor { return complete.PredictNothing } func (*ValidateCommand) AutocompleteFlags() complete.Flags { return complete.Flags{ "-syntax-only": complete.PredictNothing, "-except": complete.PredictNothing, "-only": complete.PredictNothing, "-var": complete.PredictNothing, "-var-file": complete.PredictNothing, } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/validate_test.go�����������������������������������������������������������0000664�0000000�0000000�00000011072�13771713062�0020261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "path/filepath" "testing" "github.com/google/go-cmp/cmp" ) func TestValidateCommand(t *testing.T) { tt := []struct { path string exitCode int }{ {path: filepath.Join(testFixture("validate"), "build.json")}, {path: filepath.Join(testFixture("validate"), "build.pkr.hcl")}, {path: filepath.Join(testFixture("validate"), "build_with_vars.pkr.hcl")}, {path: filepath.Join(testFixture("validate-invalid"), "bad_provisioner.json"), exitCode: 1}, {path: filepath.Join(testFixture("validate-invalid"), "missing_build_block.pkr.hcl"), exitCode: 1}, {path: filepath.Join(testFixture("validate"), "null_var.json"), exitCode: 1}, {path: filepath.Join(testFixture("validate"), "var_foo_with_no_default.pkr.hcl"), exitCode: 1}, // wrong version fails {path: filepath.Join(testFixture("version_req", "base_failure")), exitCode: 1}, {path: filepath.Join(testFixture("version_req", "base_success")), exitCode: 0}, // wrong version field {path: filepath.Join(testFixture("version_req", "wrong_field_name")), exitCode: 1}, // wrong packer block {path: filepath.Join(testFixture("validate", "invalid_packer_block.pkr.hcl")), exitCode: 1}, } for _, tc := range tt { t.Run(tc.path, func(t *testing.T) { c := &ValidateCommand{ Meta: testMetaFile(t), } tc := tc args := []string{tc.path} if code := c.Run(args); code != tc.exitCode { fatalCommand(t, c.Meta) } }) } } func TestValidateCommand_SyntaxOnly(t *testing.T) { tt := []struct { path string exitCode int }{ {path: filepath.Join(testFixture("validate"), "build.json")}, {path: filepath.Join(testFixture("validate"), "build.pkr.hcl")}, {path: filepath.Join(testFixture("validate"), "build_with_vars.pkr.hcl")}, {path: filepath.Join(testFixture("validate-invalid"), "bad_provisioner.json")}, {path: filepath.Join(testFixture("validate-invalid"), "missing_build_block.pkr.hcl")}, {path: filepath.Join(testFixture("validate-invalid"), "broken.json"), exitCode: 1}, {path: filepath.Join(testFixture("validate"), "null_var.json")}, {path: filepath.Join(testFixture("validate"), "var_foo_with_no_default.pkr.hcl")}, } for _, tc := range tt { t.Run(tc.path, func(t *testing.T) { c := &ValidateCommand{ Meta: testMetaFile(t), } c.CoreConfig.Version = "102.0.0" tc := tc args := []string{"-syntax-only", tc.path} if code := c.Run(args); code != tc.exitCode { fatalCommand(t, c.Meta) } }) } } func TestValidateCommandOKVersion(t *testing.T) { c := &ValidateCommand{ Meta: testMetaFile(t), } args := []string{ filepath.Join(testFixture("validate"), "template.json"), } // This should pass with a valid configuration version c.CoreConfig.Version = "102.0.0" if code := c.Run(args); code != 0 { fatalCommand(t, c.Meta) } } func TestValidateCommandBadVersion(t *testing.T) { c := &ValidateCommand{ Meta: testMetaFile(t), } args := []string{ filepath.Join(testFixture("validate"), "template.json"), } // This should fail with an invalid configuration version c.CoreConfig.Version = "100.0.0" if code := c.Run(args); code != 1 { t.Errorf("Expected exit code 1") } stdout, stderr := outputCommand(t, c.Meta) expected := `Error: This template requires Packer version 101.0.0 or higher; using 100.0.0 ` if diff := cmp.Diff(expected, stderr); diff != "" { t.Errorf("Unexpected output: %s", diff) } t.Log(stdout) } func TestValidateCommandExcept(t *testing.T) { tt := []struct { name string args []string exitCode int }{ { name: "JSON: validate except build and post-processor", args: []string{ "-except=vanilla,pear", filepath.Join(testFixture("validate"), "validate_except.json"), }, }, { name: "JSON: fail validate except build and post-processor", args: []string{ "-except=chocolate,apple", filepath.Join(testFixture("validate"), "validate_except.json"), }, exitCode: 1, }, { name: "HCL2: validate except build and post-processor", args: []string{ "-except=file.vanilla,pear", filepath.Join(testFixture("validate"), "validate_except.pkr.hcl"), }, }, { name: "HCL2: fail validation except build and post-processor", args: []string{ "-except=file.chocolate,apple", filepath.Join(testFixture("validate"), "validate_except.pkr.hcl"), }, exitCode: 1, }, } c := &ValidateCommand{ Meta: testMetaFile(t), } c.CoreConfig.Version = "102.0.0" for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { defer cleanup() tc := tc if code := c.Run(tc.args); code != tc.exitCode { fatalCommand(t, c.Meta) } }) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/version.go�����������������������������������������������������������������0000664�0000000�0000000�00000003067�13771713062�0017123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "fmt" "github.com/hashicorp/packer/version" ) // VersionCommand is a Command implementation prints the version. type VersionCommand struct { Meta CheckFunc VersionCheckFunc } // VersionCheckFunc is the callback called by the Version command to // check if there is a new version of Packer. type VersionCheckFunc func() (VersionCheckInfo, error) // VersionCheckInfo is the return value for the VersionCheckFunc callback // and tells the Version command information about the latest version // of Packer. type VersionCheckInfo struct { Outdated bool Latest string Alerts []string } func (c *VersionCommand) Help() string { return "Prints the Packer version, and checks for new release." } func (c *VersionCommand) Run(args []string) int { c.Ui.Machine("version", version.Version) c.Ui.Machine("version-prelease", version.VersionPrerelease) c.Ui.Machine("version-commit", version.GitCommit) c.Ui.Say(fmt.Sprintf("Packer v%s", version.FormattedVersion())) // If we have a version check function, then let's check for // the latest version as well. if c.CheckFunc != nil { // Check the latest version info, err := c.CheckFunc() if err != nil { c.Ui.Error(fmt.Sprintf( "\nError checking latest version: %s", err)) } if info.Outdated { c.Ui.Say(fmt.Sprintf( "\nYour version of Packer is out of date! The latest version\n"+ "is %s. You can update by downloading from www.packer.io/downloads", info.Latest)) } } return 0 } func (c *VersionCommand) Synopsis() string { return "Prints the Packer version" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/command/version_test.go������������������������������������������������������������0000664�0000000�0000000�00000000241�13771713062�0020151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package command import ( "testing" "github.com/mitchellh/cli" ) func TestVersionCommand_implements(t *testing.T) { var _ cli.Command = &VersionCommand{} } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/commands.go������������������������������������������������������������������������0000664�0000000�0000000�00000002775�13771713062�0015626�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "github.com/hashicorp/packer/command" "github.com/mitchellh/cli" ) // Commands is the mapping of all the available Packer commands. var Commands map[string]cli.CommandFactory // CommandMeta is the Meta to use for the commands. This must be written // before the CLI is started. var CommandMeta *command.Meta const ErrorPrefix = "e:" const OutputPrefix = "o:" func init() { Commands = map[string]cli.CommandFactory{ "build": func() (cli.Command, error) { return &command.BuildCommand{Meta: *CommandMeta}, nil }, "console": func() (cli.Command, error) { return &command.ConsoleCommand{ Meta: *CommandMeta, }, nil }, "fix": func() (cli.Command, error) { return &command.FixCommand{ Meta: *CommandMeta, }, nil }, "fmt": func() (cli.Command, error) { return &command.FormatCommand{ Meta: *CommandMeta, }, nil }, "hcl2_upgrade": func() (cli.Command, error) { return &command.HCL2UpgradeCommand{ Meta: *CommandMeta, }, nil }, "inspect": func() (cli.Command, error) { return &command.InspectCommand{ Meta: *CommandMeta, }, nil }, "plugin": func() (cli.Command, error) { return &command.PluginCommand{ Meta: *CommandMeta, }, nil }, "validate": func() (cli.Command, error) { return &command.ValidateCommand{ Meta: *CommandMeta, }, nil }, "version": func() (cli.Command, error) { return &command.VersionCommand{ Meta: *CommandMeta, CheckFunc: commandVersionCheck, }, nil }, } } ���packer-1.6.6+ds1/config.go��������������������������������������������������������������������������0000664�0000000�0000000�00000014305�13771713062�0015262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "encoding/json" "fmt" "io" "log" "os" "path/filepath" "runtime" "sort" "strings" "github.com/hashicorp/packer/command" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer/plugin" ) // PACKERSPACE is used to represent the spaces that separate args for a command // without being confused with spaces in the path to the command itself. const PACKERSPACE = "-PACKERSPACE-" type config struct { DisableCheckpoint bool `json:"disable_checkpoint"` DisableCheckpointSignature bool `json:"disable_checkpoint_signature"` RawBuilders map[string]string `json:"builders"` RawProvisioners map[string]string `json:"provisioners"` RawPostProcessors map[string]string `json:"post-processors"` Builders packersdk.MapOfBuilder `json:"-"` Provisioners packersdk.MapOfProvisioner `json:"-"` PostProcessors packersdk.MapOfPostProcessor `json:"-"` Plugins plugin.Config } // decodeConfig decodes configuration in JSON format from the given io.Reader into // the config object pointed to. func decodeConfig(r io.Reader, c *config) error { decoder := json.NewDecoder(r) return decoder.Decode(c) } // LoadExternalComponentsFromConfig loads plugins defined in RawBuilders, RawProvisioners, and RawPostProcessors. func (c *config) LoadExternalComponentsFromConfig() { // helper to build up list of plugin paths extractPaths := func(m map[string]string) []string { paths := make([]string, 0, len(m)) for _, v := range m { paths = append(paths, v) } return paths } var pluginPaths []string pluginPaths = append(pluginPaths, extractPaths(c.RawProvisioners)...) pluginPaths = append(pluginPaths, extractPaths(c.RawBuilders)...) pluginPaths = append(pluginPaths, extractPaths(c.RawPostProcessors)...) var externallyUsed = make([]string, 0, len(pluginPaths)) for _, pluginPath := range pluginPaths { name, err := c.loadSingleComponent(pluginPath) if err != nil { log.Print(err) continue } log.Printf("loaded plugin: %s = %s", name, pluginPath) externallyUsed = append(externallyUsed, name) } if len(externallyUsed) > 0 { sort.Strings(externallyUsed) log.Printf("using external plugins %v", externallyUsed) } } func (c *config) loadSingleComponent(path string) (string, error) { pluginName := filepath.Base(path) // On Windows, ignore any plugins that don't end in .exe. // We could do a full PATHEXT parse, but this is probably good enough. if runtime.GOOS == "windows" && strings.ToLower(filepath.Ext(pluginName)) != ".exe" { return "", fmt.Errorf("error loading plugin %q, no exe extension", path) } if _, err := os.Stat(path); err != nil { return "", fmt.Errorf("error loading plugin %q: %s", path, err) } // If the filename has a ".", trim up to there if idx := strings.Index(pluginName, "."); idx >= 0 { pluginName = pluginName[:idx] } switch { case strings.HasPrefix(pluginName, "packer-builder-"): pluginName = pluginName[len("packer-builder-"):] c.Builders[pluginName] = func() (packersdk.Builder, error) { return c.Plugins.Client(path).Builder() } case strings.HasPrefix(pluginName, "packer-post-processor-"): pluginName = pluginName[len("packer-post-processor-"):] c.PostProcessors[pluginName] = func() (packersdk.PostProcessor, error) { return c.Plugins.Client(path).PostProcessor() } case strings.HasPrefix(pluginName, "packer-provisioner-"): pluginName = pluginName[len("packer-provisioner-"):] c.Provisioners[pluginName] = func() (packersdk.Provisioner, error) { return c.Plugins.Client(path).Provisioner() } } return pluginName, nil } // This is a proper packer.BuilderFunc that can be used to load packersdk.Builder // implementations from the defined plugins. func (c *config) StartBuilder(name string) (packersdk.Builder, error) { log.Printf("Loading builder: %s\n", name) return c.Builders.Start(name) } // This is a proper implementation of packer.HookFunc that can be used // to load packersdk.Hook implementations from the defined plugins. func (c *config) StarHook(name string) (packersdk.Hook, error) { log.Printf("Loading hook: %s\n", name) return c.Plugins.Client(name).Hook() } // This is a proper packersdk.PostProcessorFunc that can be used to load // packersdk.PostProcessor implementations from defined plugins. func (c *config) StartPostProcessor(name string) (packersdk.PostProcessor, error) { log.Printf("Loading post-processor: %s", name) return c.PostProcessors.Start(name) } // This is a proper packer.ProvisionerFunc that can be used to load // packer.Provisioner implementations from defined plugins. func (c *config) StartProvisioner(name string) (packersdk.Provisioner, error) { log.Printf("Loading provisioner: %s\n", name) return c.Provisioners.Start(name) } func (c *config) discoverInternalComponents() error { // Get the packer binary path packerPath, err := os.Executable() if err != nil { log.Printf("[ERR] Error loading exe directory: %s", err) return err } for builder := range command.Builders { builder := builder _, found := (c.Builders)[builder] if !found { c.Builders[builder] = func() (packersdk.Builder, error) { bin := fmt.Sprintf("%s%splugin%spacker-builder-%s", packerPath, PACKERSPACE, PACKERSPACE, builder) return c.Plugins.Client(bin).Builder() } } } for provisioner := range command.Provisioners { provisioner := provisioner _, found := (c.Provisioners)[provisioner] if !found { c.Provisioners[provisioner] = func() (packersdk.Provisioner, error) { bin := fmt.Sprintf("%s%splugin%spacker-provisioner-%s", packerPath, PACKERSPACE, PACKERSPACE, provisioner) return c.Plugins.Client(bin).Provisioner() } } } for postProcessor := range command.PostProcessors { postProcessor := postProcessor _, found := (c.PostProcessors)[postProcessor] if !found { c.PostProcessors[postProcessor] = func() (packersdk.PostProcessor, error) { bin := fmt.Sprintf("%s%splugin%spacker-post-processor-%s", packerPath, PACKERSPACE, PACKERSPACE, postProcessor) return c.Plugins.Client(bin).PostProcessor() } } } return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/config_test.go���������������������������������������������������������������������0000664�0000000�0000000�00000013764�13771713062�0016331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "reflect" "runtime" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestDecodeConfig(t *testing.T) { packerConfig := ` { "PluginMinPort": 10, "PluginMaxPort": 25, "disable_checkpoint": true, "disable_checkpoint_signature": true, "provisioners": { "super-shell": "packer-provisioner-super-shell" } }` var cfg config err := decodeConfig(strings.NewReader(packerConfig), &cfg) if err != nil { t.Fatalf("error encountered decoding configuration: %v", err) } var expectedCfg config json.NewDecoder(strings.NewReader(packerConfig)).Decode(&expectedCfg) if !reflect.DeepEqual(cfg, expectedCfg) { t.Errorf("failed to load custom configuration data; expected %v got %v", expectedCfg, cfg) } } func TestLoadExternalComponentsFromConfig(t *testing.T) { packerConfigData, cleanUpFunc, err := generateFakePackerConfigData() if err != nil { t.Fatalf("error encountered while creating fake Packer configuration data %v", err) } defer cleanUpFunc() var cfg config cfg.Builders = packersdk.MapOfBuilder{} cfg.PostProcessors = packersdk.MapOfPostProcessor{} cfg.Provisioners = packersdk.MapOfProvisioner{} if err := decodeConfig(strings.NewReader(packerConfigData), &cfg); err != nil { t.Fatalf("error encountered decoding configuration: %v", err) } cfg.LoadExternalComponentsFromConfig() if len(cfg.Builders) != 1 || !cfg.Builders.Has("cloud-xyz") { t.Errorf("failed to load external builders; got %v as the resulting config", cfg.Builders) } if len(cfg.PostProcessors) != 1 || !cfg.PostProcessors.Has("noop") { t.Errorf("failed to load external post-processors; got %v as the resulting config", cfg.PostProcessors) } if len(cfg.Provisioners) != 1 || !cfg.Provisioners.Has("super-shell") { t.Errorf("failed to load external provisioners; got %v as the resulting config", cfg.Provisioners) } } func TestLoadExternalComponentsFromConfig_onlyProvisioner(t *testing.T) { packerConfigData, cleanUpFunc, err := generateFakePackerConfigData() if err != nil { t.Fatalf("error encountered while creating fake Packer configuration data %v", err) } defer cleanUpFunc() var cfg config cfg.Provisioners = packersdk.MapOfProvisioner{} if err := decodeConfig(strings.NewReader(packerConfigData), &cfg); err != nil { t.Fatalf("error encountered decoding configuration: %v", err) } /* Let's clear out any custom Builders or PostProcessors that were part of the config. This step does not remove them from disk, it just removes them from of plugins Packer knows about. */ cfg.RawBuilders = nil cfg.RawPostProcessors = nil cfg.LoadExternalComponentsFromConfig() if len(cfg.Builders) != 0 { t.Errorf("loaded external builders when it wasn't supposed to; got %v as the resulting config", cfg.Builders) } if len(cfg.PostProcessors) != 0 { t.Errorf("loaded external post-processors when it wasn't supposed to; got %v as the resulting config", cfg.PostProcessors) } if len(cfg.Provisioners) != 1 || !cfg.Provisioners.Has("super-shell") { t.Errorf("failed to load external provisioners; got %v as the resulting config", cfg.Provisioners) } } func TestLoadSingleComponent(t *testing.T) { // .exe will work everyone for testing purpose, but mostly here to help Window's test runs. tmpFile, err := ioutil.TempFile(".", "packer-builder-*.exe") if err != nil { t.Fatalf("failed to create test file with error: %s", err) } defer os.Remove(tmpFile.Name()) tt := []struct { pluginPath string errorExpected bool }{ {pluginPath: tmpFile.Name(), errorExpected: false}, {pluginPath: "./non-existing-file", errorExpected: true}, } var cfg config cfg.Builders = packersdk.MapOfBuilder{} cfg.PostProcessors = packersdk.MapOfPostProcessor{} cfg.Provisioners = packersdk.MapOfProvisioner{} for _, tc := range tt { tc := tc _, err := cfg.loadSingleComponent(tc.pluginPath) if tc.errorExpected && err == nil { t.Errorf("expected loadSingleComponent(%s) to error but it didn't", tc.pluginPath) continue } if err != nil && !tc.errorExpected { t.Errorf("expected loadSingleComponent(%s) to load properly but got an error: %v", tc.pluginPath, err) } } } func generateFakePlugins(dirname string, pluginNames []string) (string, []string, func(), error) { dir, err := ioutil.TempDir("", dirname) if err != nil { return "", nil, nil, fmt.Errorf("failed to create temporary test directory: %v", err) } cleanUpFunc := func() { os.RemoveAll(dir) } var suffix string if runtime.GOOS == "windows" { suffix = ".exe" } plugins := make([]string, len(pluginNames)) for i, plugin := range pluginNames { plug := filepath.Join(dir, plugin+suffix) plugins[i] = plug _, err := os.Create(plug) if err != nil { cleanUpFunc() return "", nil, nil, fmt.Errorf("failed to create temporary plugin file (%s): %v", plug, err) } } return dir, plugins, cleanUpFunc, nil } /* generateFakePackerConfigData creates a collection of mock plugins along with a basic packerconfig. The return packerConfigData is a valid packerconfig file that can be used for configuring external plugins, cleanUpFunc is a function that should be called for cleaning up any generated mock data. This function will only clean up if there is an error, on successful runs the caller is responsible for cleaning up the data via cleanUpFunc(). */ func generateFakePackerConfigData() (packerConfigData string, cleanUpFunc func(), err error) { _, plugins, cleanUpFunc, err := generateFakePlugins("random-testdata", []string{"packer-builder-cloud-xyz", "packer-provisioner-super-shell", "packer-post-processor-noop"}) if err != nil { cleanUpFunc() return "", nil, err } packerConfigData = fmt.Sprintf(` { "PluginMinPort": 10, "PluginMaxPort": 25, "disable_checkpoint": true, "disable_checkpoint_signature": true, "builders": { "cloud-xyz": %q }, "provisioners": { "super-shell": %q }, "post-processors": { "noop": %q } }`, plugins[0], plugins[1], plugins[2]) return } ������������packer-1.6.6+ds1/contrib/���������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0015123�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/contrib/azure-setup.sh�������������������������������������������������������������0000775�0000000�0000000�00000020337�13771713062�0017753�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash set -e meta_name= azure_client_id= # Derived from application after creation azure_client_name= # Application name azure_client_secret= # Application password azure_group_name= azure_storage_name= azure_subscription_id= # Derived from the account after login azure_tenant_id= # Derived from the account after login location= azure_object_id= azureversion= create_sleep=10 showhelp() { echo "azure-setup" echo "" echo " azure-setup helps you generate packer credentials for azure" echo "" echo " The script creates a resource group, storage account, application" echo " (client), service principal, and permissions and displays a snippet" echo " for use in your packer templates." echo "" echo " For simplicity we make a lot of assumptions and choose reasonable" echo " defaults. If you want more control over what happens, please use" echo " the azure-cli directly." echo "" echo " Note that you must already have an Azure account, username," echo " password, and subscription. You can create those here:" echo "" echo " - https://azure.microsoft.com/en-us/account/" echo "" echo "REQUIREMENTS" echo "" echo " - azure-cli" echo " - jq" echo "" echo " Use the requirements command (below) for more info." echo "" echo "USAGE" echo "" echo " ./azure-setup.sh requirements" echo " ./azure-setup.sh setup" echo "" } requirements() { found=0 azureversion=$(az --version) if [ $? -eq 0 ]; then found=$((found + 1)) echo "Found azure-cli version: $azureversion" else echo "azure-cli is missing. Please install azure-cli from" echo "https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest" echo "Alternatively, you can use the Cloud Shell https://docs.microsoft.com/en-us/azure/cloud-shell/overview right from the Azure Portal or even VS Code." fi jqversion=$(jq --version) if [ $? -eq 0 ]; then found=$((found + 1)) echo "Found jq version: $jqversion" else echo "jq is missing. Please install jq from" echo "https://stedolan.github.io/jq/" fi if [ $found -lt 2 ]; then exit 1 fi } askSubscription() { az account list -otable echo "" echo "Please enter the Id of the account you wish to use. If you do not see" echo "a valid account in the list press Ctrl+C to abort and create one." echo "If you leave this blank we will use the Current account." echo -n "> " read azure_subscription_id if [ "$azure_subscription_id" != "" ]; then az account set --subscription $azure_subscription_id else azure_subscription_id=$(az account list --output json | jq -r '.[] | select(.isDefault==true) | .id') fi azure_tenant_id=$(az account list --output json | jq -r '.[] | select(.id=="'$azure_subscription_id'") | .tenantId') echo "Using subscription_id: $azure_subscription_id" echo "Using tenant_id: $azure_tenant_id" } askName() { echo "" echo "Choose a name for your resource group, storage account and client" echo "client. This is arbitrary, but it must not already be in use by" echo "any of those resources. ALPHANUMERIC ONLY. Ex: mypackerbuild" echo -n "> " read meta_name } askSecret() { echo "" echo "Enter a secret for your application. We recommend generating one with" echo "openssl rand -base64 24. If you leave this blank we will attempt to" echo "generate one for you using openssl. THIS WILL BE SHOWN IN PLAINTEXT." echo "Ex: mypackersecret8734" echo -n "> " read azure_client_secret if [ "$azure_client_secret" = "" ]; then azure_client_secret=$(openssl rand -base64 24) if [ $? -ne 0 ]; then echo "Error generating secret" exit 1 fi echo "Generated client_secret: $azure_client_secret" fi } askLocation() { az account list-locations -otable echo "" echo "Choose which region your resource group and storage account will be created. example: westus" echo -n "> " read location } createResourceGroup() { echo "==> Creating resource group" az group create -n $meta_name -l $location if [ $? -eq 0 ]; then azure_group_name=$meta_name else echo "Error creating resource group: $meta_name" return 1 fi } createStorageAccount() { echo "==> Creating storage account" az storage account create --name $meta_name --resource-group $meta_name --location $location --kind Storage --sku Standard_LRS if [ $? -eq 0 ]; then azure_storage_name=$meta_name else echo "Error creating storage account: $meta_name" return 1 fi } createApplication() { echo "==> Creating application" echo "==> Does application exist?" azure_client_id=$(az ad app list --output json | jq -r '.[] | select(.displayName | contains("'$meta_name'")) ') if [ "$azure_client_id" != "" ]; then echo "==> application already exist, grab appId" azure_client_id=$(az ad app list --output json | jq -r '.[] | select(.displayName | contains("'$meta_name'")) .appId') else echo "==> application does not exist" azure_client_id=$(az ad app create --display-name $meta_name --identifier-uris http://$meta_name --homepage http://$meta_name --password $azure_client_secret --output json | jq -r .appId) fi if [ $? -ne 0 ]; then echo "Error creating application: $meta_name @ http://$meta_name" return 1 fi } createServicePrincipal() { echo "==> Creating service principal" azure_object_id=$(az ad sp create --id $azure_client_id --output json | jq -r .objectId) echo $azure_object_id "was selected." if [ $? -ne 0 ]; then echo "Error creating service principal: $azure_client_id" return 1 fi } createPermissions() { echo "==> Creating permissions" az role assignment create --assignee $azure_object_id --role "Owner" --scope /subscriptions/$azure_subscription_id # If the user wants to use a more conservative scope, she can. She must # configure the Azure builder to use build_resource_group_name. The # easiest solution is subscription wide permission. # az role assignment create --spn http://$meta_name -g $azure_group_name -o "API Management Service Contributor" if [ $? -ne 0 ]; then echo "Error creating permissions for: http://$meta_name" return 1 fi } showConfigs() { echo "" echo "Use the following configuration for your packer template:" echo "" echo "{" echo " \"client_id\": \"$azure_client_id\"," echo " \"client_secret\": \"$azure_client_secret\"," echo " \"object_id\": \"$azure_object_id\"," echo " \"subscription_id\": \"$azure_subscription_id\"," echo " \"tenant_id\": \"$azure_tenant_id\"," echo " \"resource_group_name\": \"$azure_group_name\"," echo " \"storage_account\": \"$azure_storage_name\"," echo "}" echo "" } doSleep() { local sleep_time=${PACKER_SLEEP_TIME-$create_sleep} echo "" echo "Sleeping for ${sleep_time} seconds to wait for resources to be " echo "created. If you get an error about a resource not existing, you can " echo "try increasing the amount of time we wait after creating resources " echo "by setting PACKER_SLEEP_TIME to something higher than the default." echo "" sleep $sleep_time } retryable() { n=0 until [ $n -ge $1 ] do $2 && return 0 echo "$2 failed. Retrying..." n=$[$n+1] doSleep done echo "$2 failed after $1 tries. Exiting." exit 1 } setup() { requirements az login askSubscription askName askSecret askLocation # Some of the resources take a while to converge in the API. To make the # script more reliable we'll add a sleep after we create each resource. retryable 3 createResourceGroup retryable 3 createStorageAccount retryable 3 createApplication retryable 3 createServicePrincipal retryable 3 createPermissions showConfigs } case "$1" in requirements) requirements ;; setup) setup ;; *) showhelp ;; esac �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/contrib/zsh-completion/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020076�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/contrib/zsh-completion/_packer�����������������������������������������������������0000664�0000000�0000000�00000004300�13771713062�0021422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#compdef packer _packer () { local -a sub_commands && sub_commands=( 'build:Build image(s) from template' 'fix:Fixes templates from old versions of packer' 'inspect:See components of a template' 'validate:Check that a template is valid' 'version:Prints the Packer version' ) local -a build_arguments && build_arguments=( '-debug[Debug mode enabled for builds.]' '-force[Force a build to continue if artifacts exist, deletes existing artifacts.]' '-machine-readable[Produce machine-readable output.]' '-color=[(false) Disable color output. (Default: color)]' '-except=[(foo,bar,baz) Run all builds and post-processors other than these.]' '-on-error=[(cleanup,abort,ask) If the build fails do: clean up (default), abort, or ask.]' '-only=[(foo,bar,baz) Only build the given builds by name.]' '-parallel=[(false) Disable parallelization. (Default: false)]' '-parallel-builds=[(0) Number of builds to run in parallel. (Defaults to infinite: 0)]' '-var[("key=value") Variable for templates, can be used multiple times.]' '-var-file=[(path) JSON or HCL2 file containing user variables.]' '(-)*:files:_files -g "*.json"' ) local -a inspect_arguments && inspect_arguments=( '-machine-readable[Machine-readable output]' '(-)*:files:_files -g "*.json"' ) local -a validate_arguments && validate_arguments=( '-syntax-only[Only check syntax. Do not verify config of the template.]' '-except=[(foo,bar,baz) Validate all builds other than these.]' '-only=[(foo,bar,baz) Validate only these builds.]' '-var[("key=value") Variable for templates, can be used multiple times.]' '-var-file=[(path) JSON or HCL2 file containing user variables.]' '(-)*:files:_files -g "*.json"' ) _arguments -C \ ':command:->command' \ '*::options:->options' case $state in command) _describe -t commands 'command' sub_commands ;; options) case $line[1] in build) _arguments -s -S : $build_arguments ;; inspect) _arguments -s -S : $inspect_arguments ;; validate) _arguments -s -S : $validate_arguments ;; esac ;; esac } _packer "$@" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/��������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0015301�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/_common/������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016730�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/_common/minimize.sh�������������������������������������������������������0000664�0000000�0000000�00000001717�13771713062�0021113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux case "$PACKER_BUILDER_TYPE" in qemu) exit 0 ;; esac # Whiteout root count=$(df --sync -kP / | tail -n1 | awk -F ' ' '{print $4}') count=$(($count-1)) dd if=/dev/zero of=/tmp/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; rm /tmp/whitespace # Whiteout /boot count=$(df --sync -kP /boot | tail -n1 | awk -F ' ' '{print $4}') count=$(($count-1)) dd if=/dev/zero of=/boot/whitespace bs=1M count=$count || echo "dd exit code $? is suppressed"; rm /boot/whitespace set +e swapuuid="`/sbin/blkid -o value -l -s UUID -t TYPE=swap`"; case "$?" in 2|0) ;; *) exit 1 ;; esac set -e if [ "x${swapuuid}" != "x" ]; then # Whiteout the swap partition to reduce box size # Swap is disabled till reboot swappart="`readlink -f /dev/disk/by-uuid/$swapuuid`"; /sbin/swapoff "$swappart"; dd if=/dev/zero of="$swappart" bs=1M || echo "dd exit code $? is suppressed"; /sbin/mkswap -U "$swapuuid" "$swappart"; fi sync; �������������������������������������������������packer-1.6.6+ds1/examples/_common/parallels.sh������������������������������������������������������0000664�0000000�0000000�00000002310�13771713062�0021237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux # set a default HOME_DIR environment variable if not set HOME_DIR="${HOME_DIR:-/home/vagrant}"; case "$PACKER_BUILDER_TYPE" in parallels-iso|parallels-pvm) mkdir -p /tmp/parallels; mount -o loop $HOME_DIR/prl-tools-lin.iso /tmp/parallels; VER="`cat /tmp/parallels/version`"; echo "Parallels Tools Version: $VER"; /tmp/parallels/install --install-unattended-with-deps \ || (code="$?"; \ echo "Parallels tools installation exited $code, attempting" \ "to output /var/log/parallels-tools-install.log"; \ cat /var/log/parallels-tools-install.log; \ exit $code); umount /tmp/parallels; rm -rf /tmp/parallels; rm -f $HOME_DIR/*.iso; # Parallels Tools for Linux includes native auto-mount script, # which causes losing some of Vagrant-relative shared folders. # So, we should disable this behavior. # https://github.com/Parallels/vagrant-parallels/issues/325#issuecomment-418727113 auto_mount_script='/usr/bin/prlfsmountd' if [ -f "${auto_mount_script}" ]; then echo -e '#!/bin/sh\n'\ '# Shared folders auto-mount is disabled by Vagrant ' \ > "${auto_mount_script}" fi ;; esac ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/_common/sshd.sh�����������������������������������������������������������0000664�0000000�0000000�00000001046�13771713062�0020226�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux SSHD_CONFIG="/etc/ssh/sshd_config" # ensure that there is a trailing newline before attempting to concatenate sed -i -e '$a\' "$SSHD_CONFIG" USEDNS="UseDNS no" if grep -q -E "^[[:space:]]*UseDNS" "$SSHD_CONFIG"; then sed -i "s/^\s*UseDNS.*/${USEDNS}/" "$SSHD_CONFIG" else echo "$USEDNS" >>"$SSHD_CONFIG" fi GSSAPI="GSSAPIAuthentication no" if grep -q -E "^[[:space:]]*GSSAPIAuthentication" "$SSHD_CONFIG"; then sed -i "s/^\s*GSSAPIAuthentication.*/${GSSAPI}/" "$SSHD_CONFIG" else echo "$GSSAPI" >>"$SSHD_CONFIG" fi ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/_common/vagrant.sh��������������������������������������������������������0000664�0000000�0000000�00000001310�13771713062�0020721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux # set a default HOME_DIR environment variable if not set HOME_DIR="${HOME_DIR:-/home/vagrant}"; pubkey_url="https://raw.githubusercontent.com/hashicorp/vagrant/master/keys/vagrant.pub"; mkdir -p $HOME_DIR/.ssh; if command -v wget >/dev/null 2>&1; then wget --no-check-certificate "$pubkey_url" -O $HOME_DIR/.ssh/authorized_keys; elif command -v curl >/dev/null 2>&1; then curl --insecure --location "$pubkey_url" > $HOME_DIR/.ssh/authorized_keys; elif command -v fetch >/dev/null 2>&1; then fetch -am -o $HOME_DIR/.ssh/authorized_keys "$pubkey_url"; else echo "Cannot download vagrant public key"; exit 1; fi chown -R vagrant $HOME_DIR/.ssh; chmod -R go-rwsx $HOME_DIR/.ssh; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/_common/virtualbox.sh�����������������������������������������������������0000664�0000000�0000000�00000001115�13771713062�0021461�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux # set a default HOME_DIR environment variable if not set HOME_DIR="${HOME_DIR:-/home/vagrant}"; case "$PACKER_BUILDER_TYPE" in virtualbox-iso|virtualbox-ovf) VER="`cat $HOME_DIR/.vbox_version`"; ISO="VBoxGuestAdditions_$VER.iso"; mkdir -p /tmp/vbox; mount -o loop $HOME_DIR/$ISO /tmp/vbox; sh /tmp/vbox/VBoxLinuxAdditions.run \ || echo "VBoxLinuxAdditions.run exited $? and is suppressed." \ "For more read https://www.virtualbox.org/ticket/12479"; umount /tmp/vbox; rm -rf /tmp/vbox; rm -f $HOME_DIR/*.iso; ;; esac ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/_common/vmware.sh���������������������������������������������������������0000664�0000000�0000000�00000001706�13771713062�0020571�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux # set a default HOME_DIR environment variable if not set HOME_DIR="${HOME_DIR:-/home/vagrant}"; case "$PACKER_BUILDER_TYPE" in vmware-iso|vmware-vmx) # make sure we have /sbin in our path. RHEL systems lack this PATH=/sbin:$PATH export PATH mkdir -p /tmp/vmware; mkdir -p /tmp/vmware-archive; mount -o loop $HOME_DIR/linux.iso /tmp/vmware; TOOLS_PATH="`ls /tmp/vmware/VMwareTools-*.tar.gz`"; VER="`echo "${TOOLS_PATH}" | cut -f2 -d'-'`"; MAJ_VER="`echo ${VER} | cut -d '.' -f 1`"; echo "VMware Tools Version: $VER"; tar xzf ${TOOLS_PATH} -C /tmp/vmware-archive; if [ "${MAJ_VER}" -lt "10" ]; then /tmp/vmware-archive/vmware-tools-distrib/vmware-install.pl --default; else /tmp/vmware-archive/vmware-tools-distrib/vmware-install.pl --force-install; fi umount /tmp/vmware; rm -rf /tmp/vmware; rm -rf /tmp/vmware-archive; rm -f $HOME_DIR/*.iso; ;; esac ����������������������������������������������������������packer-1.6.6+ds1/examples/hcl/����������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016047�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017206�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/README.md�������������������������������������������������������0000664�0000000�0000000�00000000306�13771713062�0020464�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Basic HCL2 Ubuntu builders Taking the [chef/bento](https://github.com/chef/bento) repo as an example. I recommend you start by reading the build.pkr.hcl file and the comments/description there. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/build.alpine.pkr.hcl��������������������������������������������0000664�0000000�0000000�00000002675�13771713062�0023051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { name = "alpine" description = <<EOF This build creates alpine images for versions : * v3.12 For the following builers : * virtualbox-iso EOF // the common fields of the source blocks are defined in the // source.builder-type.pkr.hcl files, here we only set the fields specific to // the different versions of ubuntu. source "source.virtualbox-iso.base-alpine-amd64" { name = "3.12" iso_url = local.iso_url_alpine_312 iso_checksum = "file:${local.iso_checksum_url_alpine_312}" output_directory = "virtualbox_iso_alpine_312_amd64" boot_command = local.alpine_312_floppy_boot_command boot_wait = "10s" } source "source.vsphere-iso.base-alpine-amd64" { name = "3.12" vm_name = "alpine-3.12" iso_url = local.iso_url_alpine_312 iso_checksum = "file:${local.iso_checksum_url_alpine_312}" boot_command = local.alpine_312_floppy_boot_command_vsphere boot_wait = "10s" } source "source.vmware-iso.esxi-base-alpine-amd64" { name = "3.12-from-esxi" iso_url = local.iso_url_alpine_312 iso_checksum = "file:${local.iso_checksum_url_alpine_312}" boot_command = local.alpine_312_floppy_boot_command_vsphere } provisioner "shell" { inline = ["echo hi"] } } �������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/build.ubuntu.pkr.hcl��������������������������������������������0000664�0000000�0000000�00000010427�13771713062�0023115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { name = "ubuntu" description = <<EOF This build creates ubuntu images for ubuntu versions : * 16.04 * 18.04 For the following builers : * virtualbox-iso * parallels-iso * vmware-iso * qemu * vsphere-iso EOF // the common fields of the source blocks are defined in the // source.builder-type.pkr.hcl files, here we only set the fields specific to // the different versions of ubuntu. source "source.virtualbox-iso.base-ubuntu-amd64" { name = "16.04" iso_url = local.iso_url_ubuntu_1604 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1604}" output_directory = "virtualbox_iso_ubuntu_1604_amd64" boot_command = local.ubuntu_1604_boot_command boot_wait = "10s" } source "source.virtualbox-iso.base-ubuntu-amd64" { name = "18.04" iso_url = local.iso_url_ubuntu_1804 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1804}" output_directory = "virtualbox_iso_ubuntu_1804_amd64" boot_command = local.ubuntu_1804_boot_command boot_wait = "5s" } source "source.parallels-iso.base-ubuntu-amd64" { name = "16.04" iso_url = local.iso_url_ubuntu_1604 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1604}" output_directory = "parallels_iso_ubuntu_1604_amd64" boot_command = local.ubuntu_1604_boot_command } source "source.parallels-iso.base-ubuntu-amd64" { name = "18.04" iso_url = local.iso_url_ubuntu_1804 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1804}" output_directory = "parallels_iso_ubuntu_1804_amd64" boot_command = local.ubuntu_1804_boot_command } source "source.vmware-iso.base-ubuntu-amd64" { name = "16.04" iso_url = local.iso_url_ubuntu_1604 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1604}" output_directory = "vmware_iso_ubuntu_1604_amd64" boot_command = local.ubuntu_1604_boot_command } source "source.vmware-vmx.base-ubuntu-amd64" { name = "16.04" source_path = "vmware_iso_ubuntu_1604_amd64/packer-base-ubuntu-amd64.vmx" } source "source.vmware-iso.base-ubuntu-amd64" { name = "18.04" iso_url = local.iso_url_ubuntu_1804 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1804}" output_directory = "vmware_iso_ubuntu_1804_amd64" boot_command = local.ubuntu_1804_boot_command } source "source.vmware-iso.esxi-base-ubuntu-amd64" { name = "16.04-from-esxi" iso_url = local.iso_url_ubuntu_1604 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1604}" output_directory = "vmware_iso_ubuntu_1604_amd64_from_esxi" boot_command = local.ubuntu_1604_boot_command } source "source.qemu.base-ubuntu-amd64" { name = "16.04" iso_url = local.iso_url_ubuntu_1604 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1604}" output_directory = "qemu_iso_ubuntu_1604_amd64" boot_command = local.ubuntu_1604_boot_command } source "source.qemu.base-ubuntu-amd64" { name = "18.04" iso_url = local.iso_url_ubuntu_1804 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1804}" output_directory = "qemu_iso_ubuntu_1804_amd64" boot_command = local.ubuntu_1804_boot_command } source "source.vsphere-iso.base-ubuntu-amd64" { name = "16.04" vm_name = "ubuntu-16.04" iso_url = local.iso_url_ubuntu_1604 iso_checksum = "file:${local.iso_checksum_url_ubuntu_1604}" } provisioner "shell" { environment_vars = [ "HOME_DIR=/home/vagrant" ] execute_command = "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'" expect_disconnect = true // fileset will list files in etc/scripts sorted in an alphanumerical way. scripts = fileset(".", "etc/scripts/*.sh") } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017761�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/http/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020740�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/http/alpine-answers�����������������������������������������0000664�0000000�0000000�00000000465�13771713062�0023620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������KEYMAPOPTS="us us" HOSTNAMEOPTS="-n alpine" INTERFACESOPTS="auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp hostname alpine " TIMEZONEOPTS="-z UTC" PROXYOPTS="none" APKREPOSOPTS="http://mirrors.dotsrc.org/alpine/v3.8/main" SSHDOPTS="-c openssh" NTPOPTS="-c none" DISKOPTS="-m sys /dev/sda" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/http/alpine-setup.sh����������������������������������������0000664�0000000�0000000�00000000646�13771713062�0023710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh set -ex apk add libressl apk add open-vm-tools rc-update add open-vm-tools /etc/init.d/open-vm-tools start cat >/usr/local/bin/shutdown <<EOF #!/bin/sh poweroff EOF chmod +x /usr/local/bin/shutdown sed -i "/#PermitRootLogin/c\PermitRootLogin yes" /etc/ssh/sshd_config sed -i "/#PasswordAuthentication/c\PasswordAuthentication yes" /etc/ssh/sshd_config mkdir ~/.ssh # copy ssy key ? /etc/init.d/sshd restart ������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/http/alpine-vsphere-answers���������������������������������0000664�0000000�0000000�00000000773�13771713062�0025274�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������KEYMAPOPTS="us us" HOSTNAMEOPTS="-n alpine" INTERFACESOPTS="auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 147.75.201.6 netmask 255.255.255.248 network 147.75.201.0 broadcast 147.75.201.7 gateway 147.75.201.1 " DNSOPTS="-d example.com 8.8.8.8" TIMEZONEOPTS="-z UTC" PROXYOPTS="none" APKREPOSOPTS="http://dl-cdn.alpinelinux.org/alpine/v3.12/main http://dl-cdn.alpinelinux.org/alpine/v3.8/main " SSHDOPTS="-c openssh" NTPOPTS="-c none" DISKOPTS="-m sys /dev/sda" �����packer-1.6.6+ds1/examples/hcl/linux/etc/http/preseed.cfg��������������������������������������������0000664�0000000�0000000�00000003143�13771713062�0023051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������choose-mirror-bin mirror/http/proxy string d-i base-installer/kernel/override-image string linux-server d-i clock-setup/utc boolean true d-i clock-setup/utc-auto boolean true d-i finish-install/reboot_in_progress note d-i grub-installer/only_debian boolean true d-i grub-installer/with_other_os boolean true d-i mirror/country string manual d-i mirror/http/directory string /ubuntu/ d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/proxy string d-i partman-auto-lvm/guided_size string max d-i partman-auto/choose_recipe select atomic d-i partman-auto/method string lvm d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-lvm/device_remove_lvm boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman/confirm_write_new_label boolean true d-i passwd/user-fullname string vagrant d-i passwd/user-uid string 1000 d-i passwd/user-password password vagrant d-i passwd/user-password-again password vagrant d-i passwd/username string vagrant d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common linux-headers-$(uname -r) perl cifs-utils software-properties-common rsync ifupdown d-i pkgsel/install-language-support boolean false d-i pkgsel/update-policy select none d-i pkgsel/upgrade select full-upgrade d-i time/zone string UTC d-i user-setup/allow-password-weak boolean true d-i user-setup/encrypt-home boolean false tasksel tasksel/first multiselect standard, server �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/http/preseed_hardcoded_ip.cfg�������������������������������0000664�0000000�0000000�00000004127�13771713062�0025541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# # Based upon: https://help.ubuntu.com/12.04/installation-guide/example-preseed.txt # # localisation d-i debian-installer/locale string en_US.utf8 d-i console-setup/ask_detect boolean false d-i keyboard-configuration/layoutcode string us # networking # Static network configuration. d-i netcfg/disable_autoconfig boolean true d-i netcfg/get_nameservers string 8.8.8.8 d-i netcfg/get_netmask string 255.255.255.248 d-i netcfg/confirm_static boolean true # d-i netcfg/choose_interface select auto # d-i netcfg/get_hostname string unassigned-hostname # d-i netcfg/get_domain string unassigned-domain # d-i netcfg/wireless_wep string # apt mirrors d-i mirror/country string manual d-i mirror/http/directory string /ubuntu/ d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/proxy string # clock and time zone d-i clock-setup/utc boolean true d-i time/zone string GMT d-i clock-setup/ntp boolean true # partitioning d-i partman-auto/method string lvm d-i partman-lvm/device_remove_lvm boolean true d-i partman-md/device_remove_md boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-auto-lvm/guided_size string max d-i partman-auto/choose_recipe select atomic d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true # users d-i passwd/user-fullname string Vagrant d-i passwd/username string vagrant d-i passwd/user-password password vagrant d-i passwd/user-password-again password vagrant d-i user-setup/allow-password-weak boolean true d-i user-setup/encrypt-home boolean false # packages tasksel tasksel/first multiselect standard, ubuntu-server d-i pkgsel/install-language-support boolean false d-i pkgsel/include string openssh-server nfs-common open-vm-tools d-i pkgsel/upgrade select full-upgrade d-i pkgsel/update-policy select none # postfix postfix/main_mailer_type select No configuration # boot loader d-i grub-installer/only_debian boolean true # hide the shutdown notice d-i finish-install/reboot_in_progress note�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021450�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/010-update.sh���������������������������������������0000664�0000000�0000000�00000002275�13771713062�0023572�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux export DEBIAN_FRONTEND=noninteractive ubuntu_version="`lsb_release -r | awk '{print $2}'`"; major_version="`echo $ubuntu_version | awk -F. '{print $1}'`"; # Disable release-upgrades sed -i.bak 's/^Prompt=.*$/Prompt=never/' /etc/update-manager/release-upgrades; # Disable systemd apt timers/services if [ "$major_version" -ge "16" ]; then systemctl stop apt-daily.timer; systemctl stop apt-daily-upgrade.timer; systemctl disable apt-daily.timer; systemctl disable apt-daily-upgrade.timer; systemctl mask apt-daily.service; systemctl mask apt-daily-upgrade.service; systemctl daemon-reload; fi # Disable periodic activities of apt to be safe cat <<EOF >/etc/apt/apt.conf.d/10periodic; APT::Periodic::Enable "0"; APT::Periodic::Update-Package-Lists "0"; APT::Periodic::Download-Upgradeable-Packages "0"; APT::Periodic::AutocleanInterval "0"; APT::Periodic::Unattended-Upgrade "0"; EOF # Clean and nuke the package from orbit rm -rf /var/log/unattended-upgrades; apt-get -y purge unattended-upgrades; # Update the package list apt-get -y update; # Upgrade all installed packages incl. kernel and kernel headers apt-get -y dist-upgrade -o Dpkg::Options::="--force-confnew"; reboot �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/020-sshd.sh�����������������������������������������0000777�0000000�0000000�00000000000�13771713062�0027237�2../../../../_common/sshd.sh�������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/030-networking.sh�����������������������������������0000664�0000000�0000000�00000001350�13771713062�0024472�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux ubuntu_version="`lsb_release -r | awk '{print $2}'`"; major_version="`echo $ubuntu_version | awk -F. '{print $1}'`"; if [ "$major_version" -ge "18" ]; then echo "Create netplan config for eth0" cat <<EOF >/etc/netplan/01-netcfg.yaml; network: version: 2 ethernets: eth0: dhcp4: true EOF else # Adding a 2 sec delay to the interface up, to make the dhclient happy echo "pre-up sleep 2" >> /etc/network/interfaces; fi if [ "$major_version" -ge "16" ]; then # Disable Predictable Network Interface names and use eth0 sed -i 's/en[[:alnum:]]*/eth0/g' /etc/network/interfaces; sed -i 's/GRUB_CMDLINE_LINUX="\(.*\)"/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 \1"/g' /etc/default/grub; update-grub; fi ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/040-sudoers.sh��������������������������������������0000664�0000000�0000000�00000000370�13771713062�0023771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers; # Set up password-less sudo for the vagrant user echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >/etc/sudoers.d/99_vagrant; chmod 440 /etc/sudoers.d/99_vagrant; ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/050-vagrant.sh��������������������������������������0000777�0000000�0000000�00000000000�13771713062�0030444�2../../../../_common/vagrant.sh����������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/060-virtualbox.sh�����������������������������������0000777�0000000�0000000�00000000000�13771713062�0031737�2../../../../_common/virtualbox.sh�������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/070-vmware.sh���������������������������������������0000664�0000000�0000000�00000000374�13771713062�0023615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux case "$PACKER_BUILDER_TYPE" in vmware-iso|vmware-vmx) apt-get install -y open-vm-tools; mkdir /mnt/hgfs; systemctl enable open-vm-tools systemctl start open-vm-tools echo "platform specific vmware.sh executed"; esac ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/080-parallels.sh������������������������������������0000777�0000000�0000000�00000000000�13771713062�0031301�2../../../../_common/parallels.sh��������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/090-hyperv.sh���������������������������������������0000664�0000000�0000000�00000000640�13771713062�0023627�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux ubuntu_version="`lsb_release -r | awk '{print $2}'`"; major_version="`echo $ubuntu_version | awk -F. '{print $1}'`"; case "$PACKER_BUILDER_TYPE" in hyperv-iso) if [ "$major_version" -eq "16" ]; then apt-get install -y linux-tools-virtual-lts-xenial linux-cloud-tools-virtual-lts-xenial; else apt-get -y install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual; fi esac ������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/100-cleanup.sh��������������������������������������0000664�0000000�0000000�00000004152�13771713062�0023733�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh -eux # Delete all Linux headers dpkg --list \ | awk '{ print $2 }' \ | grep 'linux-headers' \ | xargs apt-get -y purge; # Remove specific Linux kernels, such as linux-image-3.11.0-15-generic but # keeps the current kernel and does not touch the virtual packages, # e.g. 'linux-image-generic', etc. dpkg --list \ | awk '{ print $2 }' \ | grep 'linux-image-.*-generic' \ | grep -v `uname -r` \ | xargs apt-get -y purge; # Delete Linux source dpkg --list \ | awk '{ print $2 }' \ | grep linux-source \ | xargs apt-get -y purge; # Delete development packages dpkg --list \ | awk '{ print $2 }' \ | grep -- '-dev$' \ | xargs apt-get -y purge; # delete docs packages dpkg --list \ | awk '{ print $2 }' \ | grep -- '-doc$' \ | xargs apt-get -y purge; # Delete X11 libraries apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6; # Delete obsolete networking apt-get -y purge ppp pppconfig pppoeconf; # Delete oddities apt-get -y purge popularity-contest installation-report command-not-found friendly-recovery bash-completion fonts-ubuntu-font-family-console laptop-detect; # 19.10+ don't have this package so fail gracefully apt-get -y purge command-not-found-data || true; # Exlude the files we don't need w/o uninstalling linux-firmware echo "==> Setup dpkg excludes for linux-firmware" cat <<_EOF_ | cat >> /etc/dpkg/dpkg.cfg.d/excludes #BENTO-BEGIN path-exclude=/lib/firmware/* path-exclude=/usr/share/doc/linux-firmware/* #BENTO-END _EOF_ # Delete the massive firmware packages rm -rf /lib/firmware/* rm -rf /usr/share/doc/linux-firmware/* apt-get -y autoremove; apt-get -y clean; # Remove docs rm -rf /usr/share/doc/* # Remove caches find /var/cache -type f -exec rm -rf {} \; # truncate any logs that have built up during the install find /var/log -type f -exec truncate --size=0 {} \; # Blank netplan machine-id (DUID) so machines get unique ID generated on boot. truncate -s 0 /etc/machine-id # remove the contents of /tmp and /var/tmp rm -rf /tmp/* /var/tmp/* # clear the history so our install isn't there export HISTSIZE=0 rm -f /root/.wget-hsts ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/etc/scripts/110-minimize.sh�������������������������������������0000777�0000000�0000000�00000000000�13771713062�0030777�2../../../../_common/minimize.sh���������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/source.esxi-vmware-iso.pkr.hcl����������������������������������0000664�0000000�0000000�00000003425�13771713062�0025033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "vmware-iso" "esxi-base-ubuntu-amd64" { headless = var.headless boot_wait = "10s" guest_os_type = "ubuntu-64" http_directory = local.http_directory shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now" ssh_password = "vagrant" ssh_port = 22 ssh_timeout = "10000s" ssh_username = "vagrant" tools_upload_flavor = "linux" vmx_data = { "cpuid.coresPerSocket" = "1" "ethernet0.pciSlotNumber" = "32" } vmx_remove_ethernet_interfaces = true remote_type = "esx5" remote_host = var.esxi_host remote_username = var.esxi_user remote_password = var.esxi_password remote_datastore = var.datastore remote_private_key_file = var.remote_private_key_file_path } source "vmware-iso" "esxi-base-alpine-amd64" { headless = var.headless boot_wait = "10s" guest_os_type = "otherLinux64Guest" floppy_files = local.floppy_files_alpine_vsphere ssh_port = 22 ssh_timeout = "10000s" ssh_username = "root" ssh_password = var.alpine_password tools_upload_flavor = "linux" shutdown_command = "poweroff" vmx_data = { "cpuid.coresPerSocket" = "1" "ethernet0.pciSlotNumber" = "32" } vmx_remove_ethernet_interfaces = true remote_type = "esx5" remote_host = var.esxi_host remote_username = var.esxi_user remote_password = var.esxi_password remote_datastore = var.datastore remote_private_key_file = var.remote_private_key_file_path } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/source.parallels-iso.pkr.hcl������������������������������������0000664�0000000�0000000�00000000705�13771713062�0024541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ source "parallels-iso" "base-ubuntu-amd64" { boot_wait = "10s" guest_os_type = "ubuntu" http_directory = local.http_directory parallels_tools_flavor = "lin" prlctl_version_file = ".prlctl_version" shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now" ssh_password = "vagrant" ssh_port = 22 ssh_timeout = "10000s" ssh_username = "vagrant" } �����������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/source.qemu.pkr.hcl���������������������������������������������0000664�0000000�0000000�00000000770�13771713062�0022743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "qemu" "base-ubuntu-amd64" { headless = var.headless floppy_files = [ "${local.http_directory}/preseed.cfg", ] http_directory = local.http_directory shutdown_command = "echo 'vagrant'|sudo -S shutdown -P now" ssh_password = "vagrant" ssh_username = "vagrant" ssh_wait_timeout = "50m" disk_size = 5000 disk_interface = "virtio-scsi" memory = 512 * 4 cpus = 4 boot_wait = "5s" } ��������packer-1.6.6+ds1/examples/hcl/linux/source.virtualbox-iso.pkr.hcl�����������������������������������0000664�0000000�0000000�00000002036�13771713062�0024760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "virtualbox-iso" "base-ubuntu-amd64" { headless = var.headless guest_os_type = "Ubuntu_64" http_directory = local.http_directory shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now" ssh_username = "vagrant" ssh_password = "vagrant" ssh_port = 22 ssh_wait_timeout = "15m" hard_drive_interface = "sata" virtualbox_version_file = ".vbox_version" guest_additions_path = "VBoxGuestAdditions_{{.Version}}.iso" guest_additions_url = var.guest_additions_url } source "virtualbox-iso" "base-alpine-amd64" { headless = var.headless guest_os_type = "Linux26_64" http_directory = local.http_directory hard_drive_interface = "sata" ssh_username = "root" ssh_password = var.alpine_password ssh_wait_timeout = "60m" shutdown_command = "poweroff" floppy_files = local.floppy_files_alpine } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/source.vmware-iso.pkr.hcl���������������������������������������0000664�0000000�0000000�00000001156�13771713062�0024064�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "vmware-iso" "base-ubuntu-amd64" { headless = var.headless boot_wait = "10s" guest_os_type = "ubuntu-64" http_directory = local.http_directory shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now" ssh_password = "vagrant" ssh_port = 22 ssh_timeout = "10000s" ssh_username = "vagrant" tools_upload_flavor = "linux" vmx_data = { "cpuid.coresPerSocket" = "1" "ethernet0.pciSlotNumber" = "32" } vmx_remove_ethernet_interfaces = true } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/source.vmware-vmx.pkr.hcl���������������������������������������0000664�0000000�0000000�00000001104�13771713062�0024075�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "vmware-vmx" "base-ubuntu-amd64" { headless = var.headless boot_wait = "10s" http_directory = local.http_directory shutdown_command = "echo 'vagrant' | sudo -S shutdown -P now" ssh_password = "vagrant" ssh_port = 22 ssh_timeout = "10000s" ssh_username = "vagrant" tools_upload_flavor = "linux" vmx_data = { "cpuid.coresPerSocket" = "1" "ethernet0.pciSlotNumber" = "32" } vmx_remove_ethernet_interfaces = true } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/source.vsphere-iso.pkr.hcl��������������������������������������0000664�0000000�0000000�00000006522�13771713062�0024241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// I use the following config with direnv and set the following values: // export PKR_VAR_bastion_host="" // export PKR_VAR_bastion_user="" // export PKR_VAR_datacenter_name="" // export PKR_VAR_esxi_host="" // export PKR_VAR_esxi_password="" // export PKR_VAR_esxi_user="" // export PKR_VAR_vcenter_endpoint="" // export PKR_VAR_vcenter_password="" // export PKR_VAR_vcenter_user="" // export PKR_VAR_vm_ip="" // export PKR_VAR_gateway_ip="" // ... variable "vcenter_endpoint" { type = string } variable "vcenter_user" { type = string } variable "vcenter_password" { type = string } variable "esxi_host" { type = string } variable "esxi_password" { type = string } variable "esxi_user" { type = string } variable "datacenter_name" { type = string } variable "vm_ip" { type = string } variable "gateway_ip" { type = string } variable "datastore" { default = "datastore1" } variable "remote_private_key_file_path" { type = string } source "vsphere-iso" "base-ubuntu-amd64" { vcenter_server = var.vcenter_endpoint username = var.vcenter_user password = var.vcenter_password host = var.esxi_host insecure_connection = true datacenter = var.datacenter_name datastore = "datastore1" ssh_password = "vagrant" ssh_username = "vagrant" CPUs = 1 RAM = 512 * 2 RAM_reserve_all = true disk_controller_type = "pvscsi" floppy_files = [ "etc/http/preseed_hardcoded_ip.cfg" ] guest_os_type = "ubuntu64Guest" network_adapters { network = "VM Network" network_card = "vmxnet3" } storage { disk_size = 32768 disk_thin_provisioned = true } boot_command = [ "<enter><wait><f6><wait><esc><wait>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs>", "/install/vmlinuz", " initrd=/install/initrd.gz", " priority=critical", " locale=en_US", " file=/media/preseed_hardcoded_ip.cfg", " netcfg/get_ipaddress=${var.vm_ip}", " netcfg/get_gateway=${var.gateway_ip}", "<enter>" ] } source "vsphere-iso" "base-alpine-amd64" { vcenter_server = var.vcenter_endpoint username = var.vcenter_user password = var.vcenter_password host = var.esxi_host insecure_connection = true datacenter = var.datacenter_name datastore = "datastore1" ssh_username = "root" ssh_password = var.alpine_password CPUs = 1 RAM = 512 * 2 RAM_reserve_all = true guest_os_type = "otherLinux64Guest" floppy_files = local.floppy_files_alpine_vsphere network_adapters { network = "VM Network" network_card = "vmxnet3" } storage { disk_size = 32768 disk_thin_provisioned = true } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/variables.16.04.pkr.hcl�����������������������������������������0000664�0000000�0000000�00000002704�13771713062�0023113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variable "ubuntu_1604_version" { default = "16.04.7" } locals { iso_url_ubuntu_1604 = "http://releases.ubuntu.com/releases/16.04/ubuntu-${var.ubuntu_1604_version}-server-amd64.iso" iso_checksum_url_ubuntu_1604 = "http://releases.ubuntu.com/releases/16.04/SHA256SUMS" ubuntu_1604_boot_command = [ "<enter><wait><f6><esc><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>", "/install/vmlinuz<wait>", " auto<wait>", " console-setup/ask_detect=false<wait>", " console-setup/layoutcode=us<wait>", " console-setup/modelcode=pc105<wait>", " debconf/frontend=noninteractive<wait>", " debian-installer=en_US.UTF-8<wait>", " fb=false<wait>", " initrd=/install/initrd.gz<wait>", " kbd-chooser/method=us<wait>", " keyboard-configuration/layout=USA<wait>", " keyboard-configuration/variant=USA<wait>", " locale=en_US.UTF-8<wait>", " netcfg/get_domain=vm<wait>", " netcfg/get_hostname=vagrant<wait>", " grub-installer/bootdev=/dev/sda<wait>", " noapic<wait>", " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/${var.preseed_path}<wait>", " -- <wait>", "<enter><wait>" ] } ������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/variables.18.04.pkr.hcl�����������������������������������������0000664�0000000�0000000�00000002206�13771713062�0023112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variable "ubuntu_1804_version" { default = "18.04.4" } locals { iso_url_ubuntu_1804 = "http://cdimage.ubuntu.com/ubuntu/releases/18.04/release/ubuntu-18.04.4-server-amd64.iso" iso_checksum_url_ubuntu_1804 = "http://cdimage.ubuntu.com/ubuntu/releases/18.04/release/SHA256SUMS" ubuntu_1804_boot_command = [ "<esc><wait>", "<esc><wait>", "<enter><wait>", "/install/vmlinuz<wait>", " auto<wait>", " console-setup/ask_detect=false<wait>", " console-setup/layoutcode=us<wait>", " console-setup/modelcode=pc105<wait>", " debconf/frontend=noninteractive<wait>", " debian-installer=en_US.UTF-8<wait>", " fb=false<wait>", " initrd=/install/initrd.gz<wait>", " kbd-chooser/method=us<wait>", " keyboard-configuration/layout=USA<wait>", " keyboard-configuration/variant=USA<wait>", " locale=en_US.UTF-8<wait>", " netcfg/get_domain=vm<wait>", " netcfg/get_hostname=vagrant<wait>", " grub-installer/bootdev=/dev/sda<wait>", " noapic<wait>", " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/${var.preseed_path}<wait>", " -- <wait>", "<enter><wait>" ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/variables.alpine.pkr.hcl����������������������������������������0000664�0000000�0000000�00000003213�13771713062�0023707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "alpine_password" { type = string default = "alpine" } locals { iso_url_alpine_312 = "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.0-x86_64.iso" iso_checksum_url_alpine_312 = "http://dl-cdn.alpinelinux.org/alpine/v3.12/releases/x86_64/alpine-virt-3.12.0-x86_64.iso.sha256" floppy_files_alpine = [ "${local.http_directory}/alpine-answers", "${local.http_directory}/alpine-setup.sh" ] alpine_312_floppy_boot_command = [ "root<enter><wait>", "mount -t vfat /dev/fd0 /media/floppy<enter><wait>", "setup-alpine -f /media/floppy/alpine-answers<enter>", "<wait5>", "${var.alpine_password}<enter>", "${var.alpine_password}<enter>", "<wait5>", "y<enter>", "<wait40s>", "reboot<enter>", "<wait20s>", "root<enter>", "${var.alpine_password}<enter><wait>", "mount -t vfat /dev/fd0 /media/floppy<enter><wait>", "/media/floppy/alpine-setup.sh<enter>", ] floppy_files_alpine_vsphere = [ "${local.http_directory}/alpine-vsphere-answers", "${local.http_directory}/alpine-setup.sh" ] alpine_312_floppy_boot_command_vsphere = [ "root<enter><wait1s>", "mount -t vfat /dev/fd0 /media/floppy<enter><wait1s>", "setup-alpine -f /media/floppy/alpine-vsphere-answers<enter><wait3s>", "${var.alpine_password}<enter>", "${var.alpine_password}<enter>", "<wait6s>", "y<enter>", "<wait12s>", "reboot<enter>", "<wait12s>", "root<enter>", "${var.alpine_password}<enter><wait>", "mount -t vfat /dev/fd0 /media/floppy<enter><wait>", "/media/floppy/alpine-setup.sh<enter>", "<wait55s>", ] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/hcl/linux/variables.common.pkr.hcl����������������������������������������0000664�0000000�0000000�00000001054�13771713062�0023730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "preseed_path" { type = string default = "preseed.cfg" } variable "guest_additions_url" { type = string default = "" } variable "headless" { type = bool default = true } locals { // fileset lists all files in the http directory as a set, we convert that // set to a list of strings and we then take the directory of the first // value. This validates that the http directory exists even before starting // any builder/provisioner. http_directory = dirname(convert(fileset(".", "etc/http/*"), list(string))[0]) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/preseeds/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017113�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/examples/preseeds/ubuntu_preseed.cfg�����������������������������������������������0000664�0000000�0000000�00000004125�13771713062�0022627�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Preseeding only locale sets language, country and locale. d-i debian-installer/locale string en_US # Keyboard selection. d-i console-setup/ask_detect boolean false d-i keyboard-configuration/xkb-keymap select us choose-mirror-bin mirror/http/proxy string ### Clock and time zone setup d-i clock-setup/utc boolean true d-i time/zone string UTC # Avoid that last message about the install being complete. d-i finish-install/reboot_in_progress note # This is fairly safe to set, it makes grub install automatically to the MBR # if no other operating system is detected on the machine. d-i grub-installer/only_debian boolean true # This one makes grub-installer install to the MBR if it also finds some other # OS, which is less safe as it might not be able to boot that other OS. d-i grub-installer/with_other_os boolean true ### Mirror settings # If you select ftp, the mirror/country string does not need to be set. d-i mirror/country string manual d-i mirror/http/directory string /ubuntu/ d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/proxy string ### Partitioning d-i partman-auto/method string lvm # This makes partman automatically partition without confirmation. d-i partman-md/confirm boolean true d-i partman-partitioning/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true ### Account setup d-i passwd/user-fullname string vagrant d-i passwd/user-uid string 1000 d-i passwd/user-password password vagrant d-i passwd/user-password-again password vagrant d-i passwd/username string vagrant # The installer will warn about weak passwords. If you are sure you know # what you're doing and want to override it, uncomment this. d-i user-setup/allow-password-weak boolean true d-i user-setup/encrypt-home boolean false ### Package selection tasksel tasksel/first standard d-i pkgsel/include string openssh-server build-essential d-i pkgsel/install-language-support boolean false # disable automatic package updates d-i pkgsel/update-policy select none d-i pkgsel/upgrade select full-upgrade�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/�������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0014251�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer.go�����������������������������������������������������������������������0000664�0000000�0000000�00000007413�13771713062�0015722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix // A Fixer is something that can perform a fix operation on a template. type Fixer interface { // DeprecatedOptions returns the name(s) of the option(s) being replaced in // this fixer. It is used to generate a list of deprecated options that the // template parser checks against to warn users that they need to call // `packer fix` against their templates after upgrading. DeprecatedOptions() map[string][]string // Fix takes a raw map structure input, potentially transforms it // in some way, and returns the new, transformed structure. The // Fix method is allowed to mutate the input. Fix(input map[string]interface{}) (map[string]interface{}, error) // Synopsis returns a string description of what the fixer actually // does. Synopsis() string } // Fixers is the map of all available fixers, by name. var Fixers map[string]Fixer // FixerOrder is the default order the fixers should be run. var FixerOrder []string func init() { Fixers = map[string]Fixer{ "iso-md5": new(FixerISOMD5), "createtime": new(FixerCreateTime), "pp-vagrant-override": new(FixerVagrantPPOverride), "virtualbox-gaattach": new(FixerVirtualBoxGAAttach), "virtualbox-rename": new(FixerVirtualBoxRename), "vmware-rename": new(FixerVMwareRename), "parallels-headless": new(FixerParallelsHeadless), "parallels-deprecations": new(FixerParallelsDeprecations), "sshkeypath": new(FixerSSHKeyPath), "sshdisableagent": new(FixerSSHDisableAgent), "scaleway-access-key": new(FixerScalewayAccessKey), "manifest-filename": new(FixerManifestFilename), "amazon-shutdown_behavior": new(FixerAmazonShutdownBehavior), "amazon-enhanced-networking": new(FixerAmazonEnhancedNetworking), "amazon-private-ip": new(FixerAmazonPrivateIP), "amazon-temp-sec-cidrs": new(FixerAmazonTemporarySecurityCIDRs), "docker-email": new(FixerDockerEmail), "powershell-escapes": new(FixerPowerShellEscapes), "hyperv-deprecations": new(FixerHypervDeprecations), "hyperv-vmxc-typo": new(FixerHypervVmxcTypo), "hyperv-cpu-and-ram": new(FizerHypervCPUandRAM), "vmware-compaction": new(FixerVMwareCompaction), "clean-image-name": new(FixerCleanImageName), "spot-price-auto-product": new(FixerAmazonSpotPriceProductDeprecation), "qemu-disk-size": new(FixerQEMUDiskSize), "galaxy-command": new(FixerGalaxyCommand), "comm-config": new(FixerCommConfig), "ssh-wait-timeout": new(FixerSSHTimout), "docker-tag-tags": new(FixerDockerTagtoTags), "vsphere-iso-net-disk": new(FixerVSphereNetworkDisk), "iso-checksum-type-and-url": new(FixerISOChecksumTypeAndURL), "qemu-host-port": new(FixerQEMUHostPort), "azure-exclude_from_latest": new(FixerAzureExcludeFromLatest), "proxmox-type": new(FixerProxmoxType), } FixerOrder = []string{ "iso-md5", "createtime", "virtualbox-gaattach", "pp-vagrant-override", "virtualbox-rename", "vmware-rename", "parallels-headless", "parallels-deprecations", "sshkeypath", "sshdisableagent", "scaleway-access-key", "manifest-filename", "amazon-shutdown_behavior", "amazon-enhanced-networking", "amazon-private-ip", "amazon-temp-sec-cidrs", "docker-email", "docker-tag-tags", "powershell-escapes", "vmware-compaction", "hyperv-deprecations", "hyperv-vmxc-typo", "hyperv-cpu-and-ram", "clean-image-name", "spot-price-auto-product", "qemu-disk-size", "galaxy-command", "comm-config", "ssh-wait-timeout", "vsphere-iso-net-disk", "iso-checksum-type-and-url", "qemu-host-port", "azure-exclude_from_latest", "proxmox-type", } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_enhanced_networking.go��������������������������������������������0000664�0000000�0000000�00000003153�13771713062�0023360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strings" "github.com/mitchellh/mapstructure" ) // FixerAmazonEnhancedNetworking is a Fixer that replaces the "enhanced_networking" configuration key // with the clearer "ena_support". This disambiguates ena_support from sriov_support. type FixerAmazonEnhancedNetworking struct{} func (FixerAmazonEnhancedNetworking) DeprecatedOptions() map[string][]string { return map[string][]string{ "*amazon*": []string{"enhanced_networking"}, } } func (FixerAmazonEnhancedNetworking) Fix(input map[string]interface{}) (map[string]interface{}, error) { // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each builder and replace the enhanced_networking if we can for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if !strings.HasPrefix(builderType, "amazon-") { continue } enhancedNetworkingRaw, ok := builder["enhanced_networking"] if !ok { continue } enhancedNetworkingString, ok := enhancedNetworkingRaw.(bool) if !ok { // TODO: error? continue } delete(builder, "enhanced_networking") builder["ena_support"] = enhancedNetworkingString } input["builders"] = tpl.Builders return input, nil } func (FixerAmazonEnhancedNetworking) Synopsis() string { return `Replaces "enhanced_networking" in builders with "ena_support"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_enhanced_networking_test.go���������������������������������������0000664�0000000�0000000�00000002371�13771713062�0024420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerAmazonEnhancedNetworking_Impl(t *testing.T) { var _ Fixer = new(FixerAmazonEnhancedNetworking) } func TestFixerAmazonEnhancedNetworking(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // Attach field == false { Input: map[string]interface{}{ "type": "amazon-ebs", "enhanced_networking": false, }, Expected: map[string]interface{}{ "type": "amazon-ebs", "ena_support": false, }, }, // Attach field == true { Input: map[string]interface{}{ "type": "amazon-ebs", "enhanced_networking": true, }, Expected: map[string]interface{}{ "type": "amazon-ebs", "ena_support": true, }, }, } for _, tc := range cases { var f FixerAmazonEnhancedNetworking input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_private_ip.go�����������������������������������������������������0000664�0000000�0000000�00000003413�13771713062�0021505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "fmt" "strconv" "strings" "github.com/mitchellh/mapstructure" ) // FixerAmazonPrivateIP is a Fixer that replaces instances of `"private_ip": // true` with `"ssh_interface": "private_ip"` type FixerAmazonPrivateIP struct{} func (FixerAmazonPrivateIP) DeprecatedOptions() map[string][]string { return map[string][]string{ "*amazon*": []string{"ssh_private_ip"}, } } func (FixerAmazonPrivateIP) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each builder and replace the enhanced_networking if we can for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if !strings.HasPrefix(builderType, "amazon-") { continue } // if ssh_interface already set, do nothing if _, ok := builder["ssh_interface"]; ok { continue } privateIPi, ok := builder["ssh_private_ip"] if !ok { continue } privateIP, ok := privateIPi.(bool) if !ok { var err error privateIP, err = strconv.ParseBool(privateIPi.(string)) if err != nil { return nil, fmt.Errorf("ssh_private_ip is not a boolean, %s", err) } } delete(builder, "ssh_private_ip") if privateIP { builder["ssh_interface"] = "private_ip" } else { builder["ssh_interface"] = "public_ip" } } input["builders"] = tpl.Builders return input, nil } func (FixerAmazonPrivateIP) Synopsis() string { return "Replaces `\"ssh_private_ip\": true` in amazon builders with `\"ssh_interface\": \"private_ip\"`" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_private_ip_test.go������������������������������������������������0000664�0000000�0000000�00000003456�13771713062�0022553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerAmazonPrivateIP_Impl(t *testing.T) { var _ Fixer = new(FixerAmazonPrivateIP) } func TestFixerAmazonPrivateIP(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // Attach field == false { Input: map[string]interface{}{ "type": "amazon-ebs", "ssh_private_ip": false, }, Expected: map[string]interface{}{ "type": "amazon-ebs", "ssh_interface": "public_ip", }, }, // Attach field == true { Input: map[string]interface{}{ "type": "amazon-ebs", "ssh_private_ip": true, }, Expected: map[string]interface{}{ "type": "amazon-ebs", "ssh_interface": "private_ip", }, }, // ssh_private_ip specified as string { Input: map[string]interface{}{ "type": "amazon-ebs", "ssh_private_ip": "true", }, Expected: map[string]interface{}{ "type": "amazon-ebs", "ssh_interface": "private_ip", }, }, } for _, tc := range cases { var f FixerAmazonPrivateIP input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } func TestFixerAmazonPrivateIPNonBoolean(t *testing.T) { var f FixerAmazonPrivateIP input := map[string]interface{}{ "builders": []map[string]interface{}{{ "type": "amazon-ebs", "ssh_private_ip": "not-a-boolean-value", }}, } _, err := f.Fix(input) if err == nil { t.Fatal("should have errored") } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_shutdown_behavior.go����������������������������������������������0000664�0000000�0000000�00000002524�13771713062�0023077�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strings" "github.com/mitchellh/mapstructure" ) // FixerAmazonShutdownBehavior fix the spelling of "shutdown_behavior" // template in a Amazon builder type FixerAmazonShutdownBehavior struct{} func (FixerAmazonShutdownBehavior) DeprecatedOptions() map[string][]string { return map[string][]string{ "*amazon*": []string{"shutdown_behaviour"}, } } func (FixerAmazonShutdownBehavior) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if !strings.HasPrefix(builderType, "amazon-") { continue } shutdownBehavior, ok := builder["shutdown_behaviour"] if ok { builder["shutdown_behavior"] = shutdownBehavior delete(builder, "shutdown_behaviour") } } input["builders"] = tpl.Builders return input, nil } func (FixerAmazonShutdownBehavior) Synopsis() string { return `Changes "shutdown_behaviour" to "shutdown_behavior" in Amazon builders.` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_shutdown_behavior_test.go�����������������������������������������0000664�0000000�0000000�00000002311�13771713062�0024130�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerAmazonShutdownBehavior(t *testing.T) { var _ Fixer = new(FixerAmazonShutdownBehavior) } func TestFixerAmazonShutdownBehavior_Fix_shutdown_behaviour(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No shutdown_behaviour field { Input: map[string]interface{}{ "type": "amazon-ebs", }, Expected: map[string]interface{}{ "type": "amazon-ebs", }, }, // shutdown_behaviour field { Input: map[string]interface{}{ "type": "amazon-ebs", "shutdown_behaviour": "stop", }, Expected: map[string]interface{}{ "type": "amazon-ebs", "shutdown_behavior": "stop", }, }, } for _, tc := range cases { var f FixerAmazonShutdownBehavior input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_spot_price_product.go���������������������������������������������0000664�0000000�0000000�00000003053�13771713062�0023252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerAmazonSpotPriceProductDeprecation removes the deprecated "spot_price_auto_product" setting // from Amazon builder templates type FixerAmazonSpotPriceProductDeprecation struct{} func (FixerAmazonSpotPriceProductDeprecation) DeprecatedOptions() map[string][]string { return map[string][]string{ "*amazon*": []string{"spot_price_auto_product"}, } } func (FixerAmazonSpotPriceProductDeprecation) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } buildersToFix := []string{"amazon-ebs", "amazon-ebssurrogate", "amazon-ebsvolume", "amazon-instance"} matched := false for _, b := range buildersToFix { if builderType == b { matched = true break } } if !matched { continue } _, ok = builder["spot_price_auto_product"] if ok { delete(builder, "spot_price_auto_product") } } input["builders"] = tpl.Builders return input, nil } func (FixerAmazonSpotPriceProductDeprecation) Synopsis() string { return `Removes the deprecated "spot_price_auto_product" setting from Amazon builder templates` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_temporary_security_group_cidrs.go���������������������������������0000664�0000000�0000000�00000003004�13771713062�0025710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strings" "github.com/mitchellh/mapstructure" ) type FixerAmazonTemporarySecurityCIDRs struct{} func (FixerAmazonTemporarySecurityCIDRs) DeprecatedOptions() map[string][]string { return map[string][]string{ "*amazon*": []string{"temporary_security_group_source_cidr"}, } } func (FixerAmazonTemporarySecurityCIDRs) Fix(input map[string]interface{}) (map[string]interface{}, error) { // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each builder and replace the temporary_security_group_source_cidr if we can for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if !strings.HasPrefix(builderType, "amazon-") { continue } temporarySecurityGroupCIDR, ok := builder["temporary_security_group_source_cidr"].(string) if !ok { continue } delete(builder, "temporary_security_group_source_cidr") builder["temporary_security_group_source_cidrs"] = []string{temporarySecurityGroupCIDR} } input["builders"] = tpl.Builders return input, nil } func (FixerAmazonTemporarySecurityCIDRs) Synopsis() string { return `Replaces "temporary_security_group_source_cidr" (string) with "temporary_security_group_source_cidrs" (list of strings)` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_amazon_temporary_security_group_cidrs_test.go����������������������������0000664�0000000�0000000�00000002136�13771713062�0026754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerAmazonTemporarySecurityCIDRs_Impl(t *testing.T) { var _ Fixer = new(FixerAmazonTemporarySecurityCIDRs) } func TestFixerAmazonTemporarySecurityCIDRs(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "amazon-ebs", "temporary_security_group_source_cidr": "0.0.0.0/0", }, Expected: map[string]interface{}{ "type": "amazon-ebs", "temporary_security_group_source_cidrs": []string{"0.0.0.0/0"}, }, }, } for _, tc := range cases { var f FixerAmazonTemporarySecurityCIDRs input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_azure_exclude_from_latest.go���������������������������������������������0000664�0000000�0000000�00000003227�13771713062�0023237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strings" "github.com/mitchellh/mapstructure" ) // FixerAzureExcludeFromLatest fix the spelling of "exclude_from_latest" // template in an Azure builder type FixerAzureExcludeFromLatest struct{} func (FixerAzureExcludeFromLatest) DeprecatedOptions() map[string][]string { return map[string][]string{ "Azure*": []string{"exlude_from_latest"}, } } func (FixerAzureExcludeFromLatest) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if !strings.HasPrefix(builderType, "azure-chroot") { continue } if !strings.HasPrefix(builderType, "azure-chroot") { continue } sharedImageDestination, ok := builder["shared_image_destination"].(map[string]interface{}) if !ok { continue } excludeFromLatest, ok := sharedImageDestination["exlude_from_latest"] if !ok { continue } sharedImageDestination["exclude_from_latest"] = excludeFromLatest delete(sharedImageDestination, "exlude_from_latest") builder["shared_image_destination"] = sharedImageDestination } input["builders"] = tpl.Builders return input, nil } func (FixerAzureExcludeFromLatest) Synopsis() string { return `Changes "exlude_from_latest" to "exclude_from_latest" in Azure builders.` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_azure_exclude_from_latest_test.go����������������������������������������0000664�0000000�0000000�00000002500�13771713062�0024267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerAzureExcludeFromLatest(t *testing.T) { var _ Fixer = new(FixerAzureExcludeFromLatest) } func TestFixerAzureExcludeFromLatest_Fix_exlude_from_latest(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No shared_image_destination field { Input: map[string]interface{}{ "type": "azure-chroot", }, Expected: map[string]interface{}{ "type": "azure-chroot", }, }, // exlude_from_latest field { Input: map[string]interface{}{ "type": "azure-chroot", "shared_image_destination": map[string]interface{}{ "exlude_from_latest": "false", }, }, Expected: map[string]interface{}{ "type": "azure-chroot", "shared_image_destination": map[string]interface{}{ "exclude_from_latest": "false", }, }, }, } for _, tc := range cases { var f FixerAzureExcludeFromLatest input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_clean_image_name.go������������������������������������������������������0000664�0000000�0000000�00000003431�13771713062�0021222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "fmt" "regexp" "github.com/mitchellh/mapstructure" ) // FixerCleanImageName is a Fixer that replaces the "clean_(image|ami)_name" template // calls with "clean_resource_name" type FixerCleanImageName struct{} func (FixerCleanImageName) DeprecatedOptions() map[string][]string { return map[string][]string{ "*amazon*": []string{"clean_ami_name"}, "packer.googlecompute": []string{"clean_image_name"}, "Azure*": []string{"clean_image_name"}, } } func (FixerCleanImageName) Fix(input map[string]interface{}) (map[string]interface{}, error) { // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } re := regexp.MustCompile(`clean_(image|ami)_name`) // Go through each builder and replace CreateTime if we can for _, builder := range tpl.Builders { for key, value := range builder { switch v := value.(type) { case string: changed := re.ReplaceAllString(v, "clean_resource_name") builder[key] = changed case map[string]string: for k := range v { v[k] = re.ReplaceAllString(v[k], "clean_resource_name") } builder[key] = v case map[string]interface{}: for k := range v { if s, ok := v[k].(string); ok { v[k] = re.ReplaceAllString(s, "clean_resource_name") } } builder[key] = v default: if key == "image_labels" { panic(fmt.Sprintf("value: %#v", value)) } } } } input["builders"] = tpl.Builders return input, nil } func (FixerCleanImageName) Synopsis() string { return `Replaces /clean_(image|ami)_name/ in builder configs with "clean_resource_name"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_clean_image_name_test.go�������������������������������������������������0000664�0000000�0000000�00000002050�13771713062�0022255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/google/go-cmp/cmp" ) func TestFixerCleanImageName_Impl(t *testing.T) { var raw interface{} raw = new(FixerCleanImageName) if _, ok := raw.(Fixer); !ok { t.Fatalf("must be a Fixer") } } func TestFixerCleanImageName_Fix(t *testing.T) { var f FixerCleanImageName input := map[string]interface{}{ "builders": []interface{}{ map[string]interface{}{ "type": "foo", "ami_name": "heyo clean_image_name", "image_labels": map[string]interface{}{ "name": "test-packer-{{packer_version | clean_image_name}}", }, }, }, } expected := map[string]interface{}{ "builders": []map[string]interface{}{ { "type": "foo", "ami_name": "heyo clean_resource_name", "image_labels": map[string]interface{}{ "name": "test-packer-{{packer_version | clean_resource_name}}", }, }, }, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if diff := cmp.Diff(expected, output); diff != "" { t.Fatalf("unexpected output: %s", diff) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_comm_config.go�����������������������������������������������������������0000664�0000000�0000000�00000006113�13771713062�0020256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strings" "github.com/mitchellh/mapstructure" ) // FixerCommConfig removes ssh prefix from communicator port forwarding config // for variables host_port_min, host_port_max, skip_nat_mapping type FixerCommConfig struct{} func (FixerCommConfig) DeprecatedOptions() map[string][]string { return map[string][]string{ "*": []string{"ssh_host_port_min", "ssh_host_port_max", "ssh_skip_nat_mapping"}, } } func (FixerCommConfig) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Builders []interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.WeakDecode(input, &tpl); err != nil { return nil, err } for i, raw := range tpl.Builders { var builders map[string]interface{} if err := mapstructure.Decode(raw, &builders); err != nil { // Ignore errors, could be a non-map continue } // only virtualbox builders builderType := builders["type"].(string) if ok := strings.HasPrefix(builderType, "virtualbox"); !ok { continue } // ssh_host_port_min to host_port_min if _, ok := builders["host_port_min"]; ok { // drop ssh_host_port_min if it is also included if _, sshHostPortMinIncluded := builders["ssh_host_port_min"]; sshHostPortMinIncluded { delete(builders, "ssh_host_port_min") } } else if _, ok := builders["ssh_host_port_min"]; ok { // replace ssh_host_port_min with host_port_min sshHostPortMinRaw := builders["ssh_host_port_min"] delete(builders, "ssh_host_port_min") builders["host_port_min"] = sshHostPortMinRaw } // ssh_host_port_max to host_port_max if _, ok := builders["host_port_max"]; ok { // drop ssh_host_port_max if it is also included if _, sshHostPortMaxIncluded := builders["ssh_host_port_max"]; sshHostPortMaxIncluded { delete(builders, "ssh_host_port_max") } } else if _, ok := builders["ssh_host_port_max"]; ok { // replace ssh_host_port_max with host_port_max sshHostPortMaxRaw := builders["ssh_host_port_max"] delete(builders, "ssh_host_port_max") builders["host_port_max"] = sshHostPortMaxRaw } // ssh_skip_nat_mapping to skip_nat_mapping if _, ok := builders["skip_nat_mapping"]; ok { // drop ssh_skip_nat_mapping if it is also included if _, sshSkipNatMappingIncluded := builders["ssh_skip_nat_mapping"]; sshSkipNatMappingIncluded { delete(builders, "ssh_skip_nat_mapping") } } else if _, ok := builders["ssh_skip_nat_mapping"]; ok { // replace ssh_skip_nat_mapping with skip_nat_mapping sshSkipNatMappingRaw := builders["ssh_skip_nat_mapping"] sshSkipNatMappingBool, ok := sshSkipNatMappingRaw.(bool) if ok { delete(builders, "ssh_skip_nat_mapping") builders["skip_nat_mapping"] = sshSkipNatMappingBool } } // Write all changes back to template tpl.Builders[i] = builders } if len(tpl.Builders) > 0 { input["builders"] = tpl.Builders } return input, nil } func (FixerCommConfig) Synopsis() string { return `Remove ssh prefixes from communicator port forwarding configuration (host_port_min, host_port_max, skip_nat_mapping)` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_comm_config_test.go������������������������������������������������������0000664�0000000�0000000�00000006411�13771713062�0021316�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerCommConfig_Impl(t *testing.T) { var _ Fixer = new(FixerCommConfig) } func TestFixerCommConfig_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // set host_port_min { Input: map[string]interface{}{ "type": "virtualbox-iso", "host_port_min": 2222, }, Expected: map[string]interface{}{ "type": "virtualbox-iso", "host_port_min": 2222, }, }, // set ssh_host_port_min (old key) { Input: map[string]interface{}{ "type": "virtualbox-ovf", "ssh_host_port_min": 2222, }, Expected: map[string]interface{}{ "type": "virtualbox-ovf", "host_port_min": 2222, }, }, // set ssh_host_port_min and host_port_min // host_port_min takes precedence { Input: map[string]interface{}{ "type": "virtualbox-vm", "ssh_host_port_min": 1234, "host_port_min": 4321, }, Expected: map[string]interface{}{ "type": "virtualbox-vm", "host_port_min": 4321, }, }, // set host_port_max { Input: map[string]interface{}{ "type": "virtualbox-iso", "host_port_max": 4444, }, Expected: map[string]interface{}{ "type": "virtualbox-iso", "host_port_max": 4444, }, }, // set ssh_host_port_max (old key) { Input: map[string]interface{}{ "type": "virtualbox-iso", "ssh_host_port_max": 4444, }, Expected: map[string]interface{}{ "type": "virtualbox-iso", "host_port_max": 4444, }, }, // set ssh_host_port_max and host_port_max // host_port_max takes precedence { Input: map[string]interface{}{ "type": "virtualbox-vm", "ssh_host_port_max": 1234, "host_port_max": 4321, }, Expected: map[string]interface{}{ "type": "virtualbox-vm", "host_port_max": 4321, }, }, // set skip_nat_mapping { Input: map[string]interface{}{ "type": "virtualbox-vm", "skip_nat_mapping": true, }, Expected: map[string]interface{}{ "type": "virtualbox-vm", "skip_nat_mapping": true, }, }, // set ssh_skip_nat_mapping (old key) { Input: map[string]interface{}{ "type": "virtualbox-vm", "ssh_skip_nat_mapping": true, }, Expected: map[string]interface{}{ "type": "virtualbox-vm", "skip_nat_mapping": true, }, }, // set ssh_skip_nat_mapping and skip_nat_mapping // skip_nat_mapping takes precedence { Input: map[string]interface{}{ "type": "virtualbox-iso", "ssh_skip_nat_mapping": false, "skip_nat_mapping": true, }, Expected: map[string]interface{}{ "type": "virtualbox-iso", "skip_nat_mapping": true, }, }, } for _, tc := range cases { var f FixerCommConfig input := map[string]interface{}{ "builders": []interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_createtime.go������������������������������������������������������������0000664�0000000�0000000�00000002374�13771713062�0020125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "regexp" "github.com/mitchellh/mapstructure" ) // FixerCreateTime is a Fixer that replaces the ".CreateTime" template // calls with "{{timestamp}" type FixerCreateTime struct{} func (FixerCreateTime) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerCreateTime) Fix(input map[string]interface{}) (map[string]interface{}, error) { // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } badKeys := []string{ "ami_name", "bundle_prefix", "snapshot_name", } re := regexp.MustCompile(`{{\s*\.CreateTime\s*}}`) // Go through each builder and replace CreateTime if we can for _, builder := range tpl.Builders { for _, key := range badKeys { raw, ok := builder[key] if !ok { continue } v, ok := raw.(string) if !ok { continue } builder[key] = re.ReplaceAllString(v, "{{timestamp}}") } } input["builders"] = tpl.Builders return input, nil } func (FixerCreateTime) Synopsis() string { return `Replaces ".CreateTime" in builder configs with "{{timestamp}}"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_createtime_test.go�������������������������������������������������������0000664�0000000�0000000�00000001424�13771713062�0021157�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerCreateTime_Impl(t *testing.T) { var raw interface{} raw = new(FixerCreateTime) if _, ok := raw.(Fixer); !ok { t.Fatalf("must be a Fixer") } } func TestFixerCreateTime_Fix(t *testing.T) { var f FixerCreateTime input := map[string]interface{}{ "builders": []interface{}{ map[string]string{ "type": "foo", "ami_name": "{{.CreateTime}} foo", }, }, } expected := map[string]interface{}{ "builders": []map[string]interface{}{ { "type": "foo", "ami_name": "{{timestamp}} foo", }, }, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_docker_email.go����������������������������������������������������������0000664�0000000�0000000�00000002563�13771713062�0020421�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import "github.com/mitchellh/mapstructure" type FixerDockerEmail struct{} func (FixerDockerEmail) DeprecatedOptions() map[string][]string { return map[string][]string{ "packer.docker": []string{"login_email"}, "packer.post-processor.docker-import": []string{"login_email"}, } } func (FixerDockerEmail) Fix(input map[string]interface{}) (map[string]interface{}, error) { if input["post-processors"] == nil { return input, nil } // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} PP `mapstructure:",squash"` } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each builder and delete `docker_login` if present for _, builder := range tpl.Builders { _, ok := builder["login_email"] if !ok { continue } delete(builder, "login_email") } // Go through each post-processor and delete `docker_login` if present pps := tpl.ppList() for _, pp := range pps { _, ok := pp["login_email"] if !ok { continue } delete(pp, "login_email") } input["builders"] = tpl.Builders input["post-processors"] = tpl.PostProcessors return input, nil } func (FixerDockerEmail) Synopsis() string { return `Removes "login_email" from the Docker builder.` } ���������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_galaxy_command.go��������������������������������������������������������0000664�0000000�0000000�00000003512�13771713062�0020761�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerGalaxyCommand removes the escape character from user // environment variables and replace galaxycommand with galaxy_command type FixerGalaxyCommand struct{} func (FixerGalaxyCommand) DeprecatedOptions() map[string][]string { return map[string][]string{ "ansible": []string{"galaxycommand"}, } } func (FixerGalaxyCommand) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Provisioners []interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.WeakDecode(input, &tpl); err != nil { return nil, err } for i, raw := range tpl.Provisioners { var provisioners map[string]interface{} if err := mapstructure.Decode(raw, &provisioners); err != nil { // Ignore errors, could be a non-map continue } if ok := provisioners["type"] == "ansible-local"; !ok { continue } if _, ok := provisioners["galaxy_command"]; ok { // drop galaxycommand if it is also included if _, galaxyCommandIncluded := provisioners["galaxycommand"]; galaxyCommandIncluded { delete(provisioners, "galaxycommand") } } else { // replace galaxycommand with galaxy_command if it exists galaxyCommandRaw, ok := provisioners["galaxycommand"] if !ok { continue } galaxyCommandString, ok := galaxyCommandRaw.(string) if !ok { continue } delete(provisioners, "galaxycommand") provisioners["galaxy_command"] = galaxyCommandString } // Write all changes back to template tpl.Provisioners[i] = provisioners } if len(tpl.Provisioners) > 0 { input["provisioners"] = tpl.Provisioners } return input, nil } func (FixerGalaxyCommand) Synopsis() string { return `Replaces "galaxycommand" in ansible-local provisioner configs with "galaxy_command"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_galaxy_command_test.go���������������������������������������������������0000664�0000000�0000000�00000003261�13771713062�0022021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerGalaxyCommand_Impl(t *testing.T) { var _ Fixer = new(FixerGalaxyCommand) } func TestFixerGalaxyCommand_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // set galaxy_command { Input: map[string]interface{}{ "type": "ansible-local", "galaxy_command": "/usr/local/bin/ansible-galaxy", }, Expected: map[string]interface{}{ "type": "ansible-local", "galaxy_command": "/usr/local/bin/ansible-galaxy", }, }, // set galaxycommand (old key) { Input: map[string]interface{}{ "type": "ansible-local", "galaxycommand": "/usr/bin/ansible-galaxy", }, Expected: map[string]interface{}{ "type": "ansible-local", "galaxy_command": "/usr/bin/ansible-galaxy", }, }, // set galaxy_command and galaxycommand // galaxy_command takes precedence { Input: map[string]interface{}{ "type": "ansible-local", "galaxy_command": "ansible_galaxy_command", "galaxycommand": "ansible_galaxycommand", }, Expected: map[string]interface{}{ "type": "ansible-local", "galaxy_command": "ansible_galaxy_command", }, }, } for _, tc := range cases { var f FixerGalaxyCommand input := map[string]interface{}{ "provisioners": []interface{}{tc.Input}, } expected := map[string]interface{}{ "provisioners": []interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_hyperv_cpu_and_ram_naming.go���������������������������������������������0000664�0000000�0000000�00000002555�13771713062�0023202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FizerHypervCPUandRAM changes `cpu` to `cpus` and `ram_size` to `memory` type FizerHypervCPUandRAM struct{} func (FizerHypervCPUandRAM) DeprecatedOptions() map[string][]string { return map[string][]string{ "MSOpenTech.hyperv": []string{"cpu", "ram_size"}, } } func (FizerHypervCPUandRAM) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "hyperv-vmcx" && builderType != "hyperv-iso" { continue } ncpus, ok := builder["cpu"] if ok { delete(builder, "cpu") builder["cpus"] = ncpus } memory, ok := builder["ram_size"] if ok { delete(builder, "ram_size") builder["memory"] = memory } } input["builders"] = tpl.Builders return input, nil } func (FizerHypervCPUandRAM) Synopsis() string { return `Replaces "cpu" with "cpus" and "ram_size" with "memory"` + `in Hyper-V VMCX builder templates` } ���������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_hyperv_deprecations.go���������������������������������������������������0000664�0000000�0000000�00000002362�13771713062�0022055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerHypervDeprecations removes the deprecated "vhd_temp_path" setting // from Hyper-V ISO builder templates type FixerHypervDeprecations struct{} func (FixerHypervDeprecations) DeprecatedOptions() map[string][]string { return map[string][]string{ "MSOpenTech.hyperv": []string{"vhd_temp_path"}, } } func (FixerHypervDeprecations) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "hyperv-iso" { continue } _, ok = builder["vhd_temp_path"] if ok { delete(builder, "vhd_temp_path") } } input["builders"] = tpl.Builders return input, nil } func (FixerHypervDeprecations) Synopsis() string { return `Removes the deprecated "vhd_temp_path" setting from Hyper-V ISO builder templates` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_hyperv_deprecations_test.go����������������������������������������������0000664�0000000�0000000�00000002211�13771713062�0023105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/stretchr/testify/assert" ) func TestFixerHypervDeprecations_impl(t *testing.T) { var _ Fixer = new(FixerHypervDeprecations) } func TestFixerHypervDeprecations_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No vhd_temp_path field in template - noop { Input: map[string]interface{}{ "type": "hyperv-iso", }, Expected: map[string]interface{}{ "type": "hyperv-iso", }, }, // Deprecated vhd_temp_path field in template should be deleted { Input: map[string]interface{}{ "type": "hyperv-iso", "vhd_temp_path": "foopath", }, Expected: map[string]interface{}{ "type": "hyperv-iso", }, }, } for _, tc := range cases { var f FixerHypervDeprecations input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } assert.Equal(t, expected, output, "Should be equal") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_hyperv_vmxc_typo.go������������������������������������������������������0000664�0000000�0000000�00000002545�13771713062�0021430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerHypervVmxcTypo fixes the typo in "clone_from_vmxc_path" replacing // it with "clone_from_vmcx_path" in Hyper-V VMCX builder templates type FixerHypervVmxcTypo struct{} func (FixerHypervVmxcTypo) DeprecatedOptions() map[string][]string { return map[string][]string{ "MSOpenTech.hyperv": []string{"clone_from_vmxc_path"}, } } func (FixerHypervVmxcTypo) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "hyperv-vmcx" { continue } path, ok := builder["clone_from_vmxc_path"] if ok { delete(builder, "clone_from_vmxc_path") builder["clone_from_vmcx_path"] = path } } input["builders"] = tpl.Builders return input, nil } func (FixerHypervVmxcTypo) Synopsis() string { return `Fixes a typo replacing "clone_from_vmxc_path" with "clone_from_vmcx_path" ` + `in Hyper-V VMCX builder templates` } �����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_hyperv_vmxc_typo_test.go�������������������������������������������������0000664�0000000�0000000�00000002511�13771713062�0022460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/stretchr/testify/assert" ) func TestFixerHypervVmxcTypo_impl(t *testing.T) { var _ Fixer = new(FixerHypervVmxcTypo) } func TestFixerHypervVmxcTypo_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No "clone_from_vmxc_path" in template - noop { Input: map[string]interface{}{ "type": "hyperv-vmcx", "temp_path": "C:/some/temp/path", }, Expected: map[string]interface{}{ "type": "hyperv-vmcx", "temp_path": "C:/some/temp/path", }, }, // "clone_from_vmxc_path" should be replaced with // "clone_from_vmcx_path" in template { Input: map[string]interface{}{ "type": "hyperv-vmcx", "clone_from_vmxc_path": "C:/some/vmcx/path", }, Expected: map[string]interface{}{ "type": "hyperv-vmcx", "clone_from_vmcx_path": "C:/some/vmcx/path", }, }, } for _, tc := range cases { var f FixerHypervVmxcTypo input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } assert.Equal(t, expected, output, "Should be equal") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_iso_checksum_type_and_url.go���������������������������������������������0000664�0000000�0000000�00000003251�13771713062�0023217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerISOChecksumTypeAndURL is a Fixer that remove the "iso_checksum_url" and // "iso_checksum_type" to put everything in the checksum field. type FixerISOChecksumTypeAndURL struct{} func (FixerISOChecksumTypeAndURL) DeprecatedOptions() map[string][]string { return map[string][]string{ "*": []string{"iso_checksum_url", "iso_checksum_type"}, } } func (FixerISOChecksumTypeAndURL) Fix(input map[string]interface{}) (map[string]interface{}, error) { // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each builder and replace the iso_md5 if we can for _, builder := range tpl.Builders { checksumUrl := stringValue(builder["iso_checksum_url"]) checksumType := stringValue(builder["iso_checksum_type"]) checksum := stringValue(builder["iso_checksum"]) delete(builder, "iso_checksum_url") delete(builder, "iso_checksum_type") if checksum == "" && checksumUrl == "" { continue } if checksumUrl != "" { checksum = "file:" + checksumUrl } else if checksumType != "" { checksum = checksumType + ":" + checksum } builder["iso_checksum"] = checksum } input["builders"] = tpl.Builders return input, nil } func stringValue(v interface{}) string { switch rfl := v.(type) { case string: return rfl default: return "" } } func (FixerISOChecksumTypeAndURL) Synopsis() string { return `Puts content of potential "iso_checksum_url" and "iso_checksum_url" in "iso_checksum"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_iso_checksum_type_and_url_test.go����������������������������������������0000664�0000000�0000000�00000003103�13771713062�0024252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/stretchr/testify/assert" ) func TestFixerISOChecksumTypeAndURL_Impl(t *testing.T) { var raw interface{} raw = new(FixerISOChecksumTypeAndURL) if _, ok := raw.(Fixer); !ok { t.Fatalf("must be a Fixer") } } func TestFixerISOChecksumTypeAndURL_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "foo", "iso_checksum_url": "bar", "iso_checksum_type": "ignored", }, Expected: map[string]interface{}{ "type": "foo", "iso_checksum": "file:bar", }, }, { Input: map[string]interface{}{ "type": "foo", "iso_checksum": "checksum", "iso_checksum_type": "md5", }, Expected: map[string]interface{}{ "type": "foo", "iso_checksum": "md5:checksum", }, }, { Input: map[string]interface{}{ "type": "foo", "iso_checksum": "checksum", "iso_checksum_url": "path/to/checksumfile", }, Expected: map[string]interface{}{ "type": "foo", "iso_checksum": "file:path/to/checksumfile", }, }, } for _, tc := range cases { var f FixerISOChecksumTypeAndURL input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } assert.Equal(t, expected, output, "Should be equal") } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_iso_md5.go���������������������������������������������������������������0000664�0000000�0000000�00000002276�13771713062�0017343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerISOMD5 is a Fixer that replaces the "iso_md5" configuration key // with the newer "iso_checksum" and "iso_checksum_type" within builders. type FixerISOMD5 struct{} func (FixerISOMD5) DeprecatedOptions() map[string][]string { return map[string][]string{ "*": []string{"iso_md5"}, } } func (FixerISOMD5) Fix(input map[string]interface{}) (map[string]interface{}, error) { // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each builder and replace the iso_md5 if we can for _, builder := range tpl.Builders { md5raw, ok := builder["iso_md5"] if !ok { continue } md5, ok := md5raw.(string) if !ok { // TODO: error? continue } delete(builder, "iso_md5") builder["iso_checksum"] = md5 builder["iso_checksum_type"] = "md5" } input["builders"] = tpl.Builders return input, nil } func (FixerISOMD5) Synopsis() string { return `Replaces "iso_md5" in builders with "iso_checksum"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_iso_md5_test.go����������������������������������������������������������0000664�0000000�0000000�00000001426�13771713062�0020376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerISOMD5_Impl(t *testing.T) { var raw interface{} raw = new(FixerISOMD5) if _, ok := raw.(Fixer); !ok { t.Fatalf("must be a Fixer") } } func TestFixerISOMD5_Fix(t *testing.T) { var f FixerISOMD5 input := map[string]interface{}{ "builders": []interface{}{ map[string]string{ "type": "foo", "iso_md5": "bar", }, }, } expected := map[string]interface{}{ "builders": []map[string]interface{}{ { "type": "foo", "iso_checksum": "bar", "iso_checksum_type": "md5", }, }, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_parallels_deprecations.go������������������������������������������������0000664�0000000�0000000�00000003241�13771713062�0022514�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerParallelsDeprecations removes "parallels_tools_host_path" from a // template in a Parallels builder and changes "guest_os_distribution" to // "guest_os_type", possibly overwriting any existing "guest_os_type" type FixerParallelsDeprecations struct{} func (FixerParallelsDeprecations) DeprecatedOptions() map[string][]string { return map[string][]string{ "packer.parallels": []string{"parallels_tools_host_path", "guest_os_distribution"}, } } func (FixerParallelsDeprecations) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "parallels-iso" && builderType != "parallels-pvm" { continue } _, ok = builder["parallels_tools_host_path"] if ok { delete(builder, "parallels_tools_host_path") } guestOsDistribution, ok := builder["guest_os_distribution"] if ok { builder["guest_os_type"] = guestOsDistribution delete(builder, "guest_os_distribution") } } input["builders"] = tpl.Builders return input, nil } func (FixerParallelsDeprecations) Synopsis() string { return `Removes deprecated "parallels_tools_host_path" from Parallels builders and changes "guest_os_distribution" to "guest_os_type".` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_parallels_deprecations_test.go�������������������������������������������0000664�0000000�0000000�00000005311�13771713062�0023553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerParallelsDeprecations(t *testing.T) { var _ Fixer = new(FixerParallelsDeprecations) } func TestFixerParallelsDeprecations_Fix_parallels_tools_guest_path(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No parallels_tools_host_path field { Input: map[string]interface{}{ "type": "parallels-iso", }, Expected: map[string]interface{}{ "type": "parallels-iso", }, }, // parallels_tools_host_path field { Input: map[string]interface{}{ "type": "parallels-iso", "parallels_tools_host_path": "/Path...", }, Expected: map[string]interface{}{ "type": "parallels-iso", }, }, } for _, tc := range cases { var f FixerParallelsDeprecations input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } func TestFixerParallelsDeprecations_Fix_guest_os_distribution(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No guest_os_distribution field { Input: map[string]interface{}{ "type": "parallels-iso", "guest_os_type": "ubuntu", }, Expected: map[string]interface{}{ "type": "parallels-iso", "guest_os_type": "ubuntu", }, }, // guest_os_distribution and guest_os_type field { Input: map[string]interface{}{ "type": "parallels-iso", "guest_os_type": "linux", "guest_os_distribution": "ubuntu", }, Expected: map[string]interface{}{ "type": "parallels-iso", "guest_os_type": "ubuntu", }, }, // guest_os_distribution but no guest_os_type field { Input: map[string]interface{}{ "type": "parallels-iso", "guest_os_distribution": "ubuntu", }, Expected: map[string]interface{}{ "type": "parallels-iso", "guest_os_type": "ubuntu", }, }, } for _, tc := range cases { var f FixerParallelsDeprecations input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_parallels_headless.go����������������������������������������������������0000664�0000000�0000000�00000002324�13771713062�0021625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerParallelsHeadless removes "headless" from a template in a Parallels builder type FixerParallelsHeadless struct{} func (FixerParallelsHeadless) DeprecatedOptions() map[string][]string { return map[string][]string{ "packer.parallels": []string{"headless"}, } } func (FixerParallelsHeadless) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "parallels-iso" && builderType != "parallels-pvm" { continue } _, ok = builder["headless"] if !ok { continue } delete(builder, "headless") } input["builders"] = tpl.Builders return input, nil } func (FixerParallelsHeadless) Synopsis() string { return `Removes unused "headless" from Parallels builders` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_parallels_headless_test.go�����������������������������������������������0000664�0000000�0000000�00000002134�13771713062�0022663�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerParallelsHeadless_Impl(t *testing.T) { var _ Fixer = new(FixerParallelsHeadless) } func TestFixerParallelsHeadless_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No headless field { Input: map[string]interface{}{ "type": "parallels-iso", }, Expected: map[string]interface{}{ "type": "parallels-iso", }, }, // Headless field { Input: map[string]interface{}{ "type": "parallels-iso", "headless": false, }, Expected: map[string]interface{}{ "type": "parallels-iso", }, }, } for _, tc := range cases { var f FixerParallelsHeadless input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_powershell_escapes.go����������������������������������������������������0000664�0000000�0000000�00000004105�13771713062�0021664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strings" "github.com/mitchellh/mapstructure" ) // FixerPowerShellEscapes removes the PowerShell escape character from user // environment variables and elevated username and password strings type FixerPowerShellEscapes struct{} func (FixerPowerShellEscapes) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerPowerShellEscapes) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Provisioners []interface{} } var psUnescape = strings.NewReplacer( "`$", "$", "`\"", "\"", "``", "`", "`'", "'", ) // Decode the input into our structure, if we can var tpl template if err := mapstructure.WeakDecode(input, &tpl); err != nil { return nil, err } for i, raw := range tpl.Provisioners { var provisioners map[string]interface{} if err := mapstructure.Decode(raw, &provisioners); err != nil { // Ignore errors, could be a non-map continue } if ok := provisioners["type"] == "powershell"; !ok { continue } if _, ok := provisioners["elevated_user"]; ok { provisioners["elevated_user"] = psUnescape.Replace(provisioners["elevated_user"].(string)) } if _, ok := provisioners["elevated_password"]; ok { provisioners["elevated_password"] = psUnescape.Replace(provisioners["elevated_password"].(string)) } if raw, ok := provisioners["environment_vars"]; ok { var env_vars []string if err := mapstructure.Decode(raw, &env_vars); err != nil { continue } env_vars_unescaped := make([]interface{}, len(env_vars)) for j, env_var := range env_vars { env_vars_unescaped[j] = psUnescape.Replace(env_var) } // Replace with unescaped environment variables provisioners["environment_vars"] = env_vars_unescaped } // Write all changes back to template tpl.Provisioners[i] = provisioners } if len(tpl.Provisioners) > 0 { input["provisioners"] = tpl.Provisioners } return input, nil } func (FixerPowerShellEscapes) Synopsis() string { return `Removes PowerShell escapes from user env vars and elevated username and password strings` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_pp_docker_tag_tags.go����������������������������������������������������0000664�0000000�0000000�00000005112�13771713062�0021613�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strings" "github.com/mitchellh/mapstructure" ) // FixerDockerTagtoTags renames tag to tags type FixerDockerTagtoTags struct{} func (FixerDockerTagtoTags) DeprecatedOptions() map[string][]string { return map[string][]string{ "packer.post-processor.docker-tag": []string{"tag"}, } } func (FixerDockerTagtoTags) Fix(input map[string]interface{}) (map[string]interface{}, error) { if input["post-processors"] == nil { return input, nil } // Our template type we'll use for this fixer only type template struct { PP `mapstructure:",squash"` } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each post-processor and get out all the complex configs pps := tpl.ppList() for _, pp := range pps { ppTypeRaw, ok := pp["type"] if !ok { continue } if ppType, ok := ppTypeRaw.(string); !ok { continue } else if ppType != "docker-tag" { continue } // Create a []string to hold tag and tags values allTags := []string{} tagRaw, ok := pp["tag"] if ok { // Gather all "tag" into the []string switch t := tagRaw.(type) { case []interface{}: for _, tag := range t { allTags = append(allTags, tag.(string)) } case []string: allTags = append(allTags, t...) case string: tList := strings.Split(t, ",") for _, tag := range tList { allTags = append(allTags, strings.TrimSpace(tag)) } } } // Now check to see if they already have the "tags" field tagsRaw, ok := pp["tags"] if ok { // Gather all "tag" into the []string switch t := tagsRaw.(type) { case []interface{}: for _, tag := range t { allTags = append(allTags, tag.(string)) } case []string: allTags = append(allTags, t...) case string: tList := strings.Split(t, ",") for _, tag := range tList { allTags = append(allTags, strings.TrimSpace(tag)) } } } // Now deduplicate the tags in the list so we don't tag the same thing // multiple times. deduplicater := map[string]bool{} finalTags := []string{} for _, tag := range allTags { if found := deduplicater[tag]; found { continue } deduplicater[tag] = true finalTags = append(finalTags, tag) } // Delete tag key, and set tags key to the final deduplicated list. delete(pp, "tag") pp["tags"] = finalTags } input["post-processors"] = tpl.PostProcessors return input, nil } func (FixerDockerTagtoTags) Synopsis() string { return `Updates "docker" post-processor so any "tag" field is renamed to "tags".` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_pp_docker_tag_tags_test.go�����������������������������������������������0000664�0000000�0000000�00000001767�13771713062�0022666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/stretchr/testify/assert" ) func TestFixerDockerTags(t *testing.T) { var _ Fixer = new(FixerVagrantPPOverride) } func TestFixerDockerTags_Fix(t *testing.T) { var f FixerDockerTagtoTags input := map[string]interface{}{ "post-processors": []interface{}{ map[string]interface{}{ "type": "docker-tag", "tag": "foo", "tags": []string{"foo", "bar"}, }, []interface{}{ map[string]interface{}{ "type": "docker-tag", "tag": []string{"baz"}, "tags": []string{"foo", "bar"}, }, }, }, } expected := map[string]interface{}{ "post-processors": []interface{}{ map[string]interface{}{ "type": "docker-tag", "tags": []string{"foo", "bar"}, }, []interface{}{ map[string]interface{}{ "type": "docker-tag", "tags": []string{"baz", "foo", "bar"}, }, }, }, } output, err := f.Fix(input) assert.NoError(t, err) for k, v := range expected { assert.EqualValues(t, v, output[k]) } } ���������packer-1.6.6+ds1/fix/fixer_pp_manifest_filename.go��������������������������������������������������0000664�0000000�0000000�00000002601�13771713062�0022141�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerManifestFilename renames any Filename to Output type FixerManifestFilename struct{} func (FixerManifestFilename) DeprecatedOptions() map[string][]string { return map[string][]string{ "packer.post-processor.manifest": []string{"filename"}, } } func (FixerManifestFilename) Fix(input map[string]interface{}) (map[string]interface{}, error) { if input["post-processors"] == nil { return input, nil } // Our template type we'll use for this fixer only type template struct { PP `mapstructure:",squash"` } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } // Go through each post-processor and get out all the complex configs pps := tpl.ppList() for _, pp := range pps { ppTypeRaw, ok := pp["type"] if !ok { continue } if ppType, ok := ppTypeRaw.(string); !ok { continue } else if ppType != "manifest" { continue } filenameRaw, ok := pp["filename"] if !ok { continue } if filename, ok := filenameRaw.(string); ok { delete(pp, "filename") pp["output"] = filename } } input["post-processors"] = tpl.PostProcessors return input, nil } func (FixerManifestFilename) Synopsis() string { return `Updates "manifest" post-processor so any "filename" field is renamed to "output".` } �������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_pp_manifest_filename_test.go���������������������������������������������0000664�0000000�0000000�00000001576�13771713062�0023212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/stretchr/testify/assert" ) func TestFixerManifestPPFilename_Impl(t *testing.T) { var _ Fixer = new(FixerVagrantPPOverride) } func TestFixerManifestPPFilename_Fix(t *testing.T) { var f FixerManifestFilename input := map[string]interface{}{ "post-processors": []interface{}{ map[string]interface{}{ "type": "manifest", "filename": "foo", }, []interface{}{ map[string]interface{}{ "type": "manifest", "filename": "foo", }, }, }, } expected := map[string]interface{}{ "post-processors": []interface{}{ map[string]interface{}{ "type": "manifest", "output": "foo", }, []interface{}{ map[string]interface{}{ "type": "manifest", "output": "foo", }, }, }, } output, err := f.Fix(input) assert.NoError(t, err) assert.Equal(t, expected, output) } ����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_pp_vagrant_override.go���������������������������������������������������0000664�0000000�0000000�00000003055�13771713062�0022040�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import "github.com/mitchellh/mapstructure" // FixerVagrantPPOverride is a Fixer that replaces the provider-specific // overrides for the Vagrant post-processor with the new style introduced // as part of Packer 0.5.0. type FixerVagrantPPOverride struct{} func (FixerVagrantPPOverride) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerVagrantPPOverride) Fix(input map[string]interface{}) (map[string]interface{}, error) { if input["post-processors"] == nil { return input, nil } // Our template type we'll use for this fixer only type template struct { PP `mapstructure:",squash"` } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } pps := tpl.ppList() // Go through each post-processor and make the fix if necessary possible := []string{"aws", "digitalocean", "virtualbox", "vmware"} for _, pp := range pps { typeRaw, ok := pp["type"] if !ok { continue } if typeName, ok := typeRaw.(string); !ok { continue } else if typeName != "vagrant" { continue } overrides := make(map[string]interface{}) for _, name := range possible { if _, ok := pp[name]; !ok { continue } overrides[name] = pp[name] delete(pp, name) } if len(overrides) > 0 { pp["override"] = overrides } } input["post-processors"] = tpl.PostProcessors return input, nil } func (FixerVagrantPPOverride) Synopsis() string { return `Fixes provider-specific overrides for Vagrant post-processor` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_pp_vagrant_override_test.go����������������������������������������������0000664�0000000�0000000�00000002403�13771713062�0023073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/stretchr/testify/assert" ) func TestFixerVagrantPPOverride_Impl(t *testing.T) { var _ Fixer = new(FixerVagrantPPOverride) } func TestFixerVagrantPPOverride_Fix(t *testing.T) { var f FixerVagrantPPOverride input := map[string]interface{}{ "post-processors": []interface{}{ "foo", map[string]interface{}{ "type": "vagrant", "aws": map[string]interface{}{ "foo": "bar", }, }, map[string]interface{}{ "type": "vsphere", }, []interface{}{ map[string]interface{}{ "type": "vagrant", "vmware": map[string]interface{}{ "foo": "bar", }, }, }, }, } expected := map[string]interface{}{ "post-processors": []interface{}{ "foo", map[string]interface{}{ "type": "vagrant", "override": map[string]interface{}{ "aws": map[string]interface{}{ "foo": "bar", }, }, }, map[string]interface{}{ "type": "vsphere", }, []interface{}{ map[string]interface{}{ "type": "vagrant", "override": map[string]interface{}{ "vmware": map[string]interface{}{ "foo": "bar", }, }, }, }, }, } output, err := f.Fix(input) assert.NoError(t, err) assert.Equal(t, expected, output) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_proxmox_type.go����������������������������������������������������������0000664�0000000�0000000�00000001737�13771713062�0020562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerProxmoxType updates proxmox builder types to proxmox-iso type FixerProxmoxType struct{} func (FixerProxmoxType) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerProxmoxType) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "proxmox" { continue } builder["type"] = "proxmox-iso" } input["builders"] = tpl.Builders return input, nil } func (FixerProxmoxType) Synopsis() string { return `Updates the builder type proxmox to proxmox-iso` } ���������������������������������packer-1.6.6+ds1/fix/fixer_proxmox_type_test.go�����������������������������������������������������0000664�0000000�0000000�00000002273�13771713062�0021615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" "github.com/stretchr/testify/assert" ) func TestFixerProxmoxType_Impl(t *testing.T) { var raw interface{} raw = new(FixerProxmoxType) if _, ok := raw.(Fixer); !ok { t.Fatalf("must be a Fixer") } } func TestFixerProxmoxType_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "proxmox", }, Expected: map[string]interface{}{ "type": "proxmox-iso", }, }, { Input: map[string]interface{}{ "type": "proxmox-iso", }, Expected: map[string]interface{}{ "type": "proxmox-iso", }, }, { Input: map[string]interface{}{ "type": "proxmox-clone", }, Expected: map[string]interface{}{ "type": "proxmox-clone", }, }, } for _, tc := range cases { var f FixerProxmoxType input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } assert.Equal(t, expected, output, "Should be equal") } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_qemu_disk_size.go��������������������������������������������������������0000664�0000000�0000000�00000002247�13771713062�0021015�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "strconv" "github.com/mitchellh/mapstructure" ) // FixerQEMUDiskSize updates disk_size from a string to int for QEMU builders type FixerQEMUDiskSize struct{} func (FixerQEMUDiskSize) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerQEMUDiskSize) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "qemu" { continue } switch diskSize := builder["disk_size"].(type) { case float64: builder["disk_size"] = strconv.Itoa(int(diskSize)) + "M" case int: builder["disk_size"] = strconv.Itoa(diskSize) + "M" } } input["builders"] = tpl.Builders return input, nil } func (FixerQEMUDiskSize) Synopsis() string { return `Updates "disk_size" from int to string in QEMU builders.` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_qemu_disk_size_test.go���������������������������������������������������0000664�0000000�0000000�00000002141�13771713062�0022045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerQEMUDiskSize_impl(t *testing.T) { var _ Fixer = new(FixerQEMUDiskSize) } func TestFixerQEMUDiskSize(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "qemu", "disk_size": int(40960), }, Expected: map[string]interface{}{ "type": "qemu", "disk_size": "40960M", }, }, { Input: map[string]interface{}{ "type": "qemu", "disk_size": float64(50000), }, Expected: map[string]interface{}{ "type": "qemu", "disk_size": "50000M", }, }, } for _, tc := range cases { var f FixerQEMUDiskSize input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_qemu_host_port.go��������������������������������������������������������0000664�0000000�0000000�00000003023�13771713062�0021043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerQEMUHostPort updates ssh_host_port_min and ssh_host_port_max to host_port_min and host_port_max for QEMU builders type FixerQEMUHostPort struct{} func (FixerQEMUHostPort) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "qemu" { continue } // replace ssh_host_port_min with host_port_min if it exists sshHostPortMin, ok := builder["ssh_host_port_min"] if ok { delete(builder, "ssh_host_port_min") builder["host_port_min"] = sshHostPortMin } // replace ssh_host_port_min with host_port_min if it exists sshHostPortMax, ok := builder["ssh_host_port_max"] if ok { delete(builder, "ssh_host_port_max") builder["host_port_max"] = sshHostPortMax } } input["builders"] = tpl.Builders return input, nil } func (FixerQEMUHostPort) Synopsis() string { return `Updates ssh_host_port_min and ssh_host_port_max to host_port_min and host_port_max` } func (FixerQEMUHostPort) DeprecatedOptions() map[string][]string { return map[string][]string{ "transcend.qemu": []string{"ssh_host_port_max", "ssh_host_port_min"}, } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_qemu_host_port_test.go���������������������������������������������������0000664�0000000�0000000�00000002171�13771713062�0022105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerQEMUHostPort_impl(t *testing.T) { var _ Fixer = new(FixerQEMUHostPort) } func TestFixerQEMUHostPort(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "qemu", "ssh_host_port_min": 2222, }, Expected: map[string]interface{}{ "type": "qemu", "host_port_min": 2222, }, }, { Input: map[string]interface{}{ "type": "qemu", "ssh_host_port_max": 4444, }, Expected: map[string]interface{}{ "type": "qemu", "host_port_max": 4444, }, }, } for _, tc := range cases { var f FixerQEMUHostPort input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_scaleway_access_key.go���������������������������������������������������0000664�0000000�0000000�00000002567�13771713062�0022010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerScalewayAccessKey changes the "access_key" of a template // to "organization_id". type FixerScalewayAccessKey struct{} func (FixerScalewayAccessKey) DeprecatedOptions() map[string][]string { return map[string][]string{ "hashicorp.scaleway": []string{"access_key"}, } } func (FixerScalewayAccessKey) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { if builder["type"] != "scaleway" { continue } keyRaw, ok := builder["access_key"] if !ok { continue } accessKey, ok := keyRaw.(string) if !ok { continue } // only assign to organization_id if it doesn't // already exist; otherwise we'll just ignore access_key _, organizationIdIncluded := builder["organization_id"] if !organizationIdIncluded { builder["organization_id"] = accessKey } delete(builder, "access_key") } input["builders"] = tpl.Builders return input, nil } func (FixerScalewayAccessKey) Synopsis() string { return `Updates builders using "access_key" to use "organization_id"` } �����������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_scaleway_access_key_test.go����������������������������������������������0000664�0000000�0000000�00000003276�13771713062�0023045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerScalewayAccessKey_Fix_Impl(t *testing.T) { var _ Fixer = new(FixerScalewayAccessKey) } func TestFixerScalewayAccessKey_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No key_path field { Input: map[string]interface{}{ "type": "scaleway", }, Expected: map[string]interface{}{ "type": "scaleway", }, }, // organization_id without access_key { Input: map[string]interface{}{ "type": "scaleway", "organization_id": "0000", }, Expected: map[string]interface{}{ "type": "scaleway", "organization_id": "0000", }, }, // access_key without organization_id { Input: map[string]interface{}{ "type": "scaleway", "access_key": "1111", }, Expected: map[string]interface{}{ "type": "scaleway", "organization_id": "1111", }, }, // access_key and organization_id { Input: map[string]interface{}{ "type": "scaleway", "access_key": "2222", "organization_id": "3333", }, Expected: map[string]interface{}{ "type": "scaleway", "organization_id": "3333", }, }, } for _, tc := range cases { var f FixerScalewayAccessKey input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_ssh_timeout.go�����������������������������������������������������������0000664�0000000�0000000�00000003123�13771713062�0020337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerSSHTimout replaces ssh_wait_timeout with ssh_timeout type FixerSSHTimout struct{} func (FixerSSHTimout) DeprecatedOptions() map[string][]string { return map[string][]string{ "*": []string{"ssh_wait_timeout"}, } } func (FixerSSHTimout) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Builders []interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.WeakDecode(input, &tpl); err != nil { return nil, err } for i, raw := range tpl.Builders { var builders map[string]interface{} if err := mapstructure.Decode(raw, &builders); err != nil { // Ignore errors, could be a non-map continue } if _, ok := builders["ssh_timeout"]; ok { // drop ssh_wait_timeout if it is also included if _, sshWaitTimeoutIncluded := builders["ssh_wait_timeout"]; sshWaitTimeoutIncluded { delete(builders, "ssh_wait_timeout") } } else { // replace ssh_wait_timeout with ssh_timeout if it exists sshWaitTimeoutRaw, ok := builders["ssh_wait_timeout"] if !ok { continue } sshWaitTimeoutString, ok := sshWaitTimeoutRaw.(string) if !ok { continue } delete(builders, "ssh_wait_timeout") builders["ssh_timeout"] = sshWaitTimeoutString } // Write all changes back to template tpl.Builders[i] = builders } if len(tpl.Builders) > 0 { input["builders"] = tpl.Builders } return input, nil } func (FixerSSHTimout) Synopsis() string { return `Replaces "ssh_wait_timeout" with "ssh_timeout"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_ssh_timeout_test.go������������������������������������������������������0000664�0000000�0000000�00000002451�13771713062�0021401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerSSHTimout_Impl(t *testing.T) { var _ Fixer = new(FixerSSHTimout) } func TestFixerSSHTimout_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // set galaxy_command { Input: map[string]interface{}{ "ssh_timeout": "1h5m2s", }, Expected: map[string]interface{}{ "ssh_timeout": "1h5m2s", }, }, // set galaxycommand (old key) { Input: map[string]interface{}{ "ssh_wait_timeout": "1h5m2s", }, Expected: map[string]interface{}{ "ssh_timeout": "1h5m2s", }, }, // set galaxy_command and galaxycommand // galaxy_command takes precedence { Input: map[string]interface{}{ "ssh_timeout": "1h5m2s", "ssh_wait_timeout": "30m", }, Expected: map[string]interface{}{ "ssh_timeout": "1h5m2s", }, }, } for _, tc := range cases { var f FixerSSHTimout input := map[string]interface{}{ "builders": []interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_sshdisableagent.go�������������������������������������������������������0000664�0000000�0000000�00000002665�13771713062�0021146�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerSSHDisableAgent changes the "ssh_disable_agent" of a template // to "ssh_disable_agent_forwarding". type FixerSSHDisableAgent struct{} func (FixerSSHDisableAgent) DeprecatedOptions() map[string][]string { return map[string][]string{ "*": []string{"ssh_disable_agent"}, } } func (FixerSSHDisableAgent) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { sshDisableAgentRaw, ok := builder["ssh_disable_agent"] if !ok { continue } sshDisableAgent, ok := sshDisableAgentRaw.(bool) if !ok { continue } // only assign to ssh_disable_agent_forwarding if it doesn't // already exist; otherwise we'll just ignore ssh_disable_agent _, sshDisableAgentIncluded := builder["ssh_disable_agent_forwarding"] if !sshDisableAgentIncluded { builder["ssh_disable_agent_forwarding"] = sshDisableAgent } delete(builder, "ssh_disable_agent") } input["builders"] = tpl.Builders return input, nil } func (FixerSSHDisableAgent) Synopsis() string { return `Updates builders using "ssh_disable_agent" to use "ssh_disable_agent_forwarding"` } ���������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_sshdisableagent_test.go��������������������������������������������������0000664�0000000�0000000�00000003133�13771713062�0022174�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerSSHDisableAgent_Impl(t *testing.T) { var _ Fixer = new(FixerSSHDisableAgent) } func TestFixerSSHDisableAgent_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No disable_agent field { Input: map[string]interface{}{ "type": "virtualbox", }, Expected: map[string]interface{}{ "type": "virtualbox", }, }, // disable_agent_forwarding without disable_agent { Input: map[string]interface{}{ "ssh_disable_agent_forwarding": true, }, Expected: map[string]interface{}{ "ssh_disable_agent_forwarding": true, }, }, // disable_agent without disable_agent_forwarding { Input: map[string]interface{}{ "ssh_disable_agent": true, }, Expected: map[string]interface{}{ "ssh_disable_agent_forwarding": true, }, }, // disable_agent and disable_agent_forwarding { Input: map[string]interface{}{ "ssh_disable_agent": true, "ssh_disable_agent_forwarding": false, }, Expected: map[string]interface{}{ "ssh_disable_agent_forwarding": false, }, }, } for _, tc := range cases { var f FixerSSHDisableAgent input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_sshkeypath.go������������������������������������������������������������0000664�0000000�0000000�00000002472�13771713062�0020165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerSSHKeyPath changes the "ssh_key_path" of a template // to "ssh_private_key_file". type FixerSSHKeyPath struct{} func (FixerSSHKeyPath) DeprecatedOptions() map[string][]string { return map[string][]string{ "*": []string{"ssh_key_path"}, } } func (FixerSSHKeyPath) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { sshKeyPathRaw, ok := builder["ssh_key_path"] if !ok { continue } sshKeyPath, ok := sshKeyPathRaw.(string) if !ok { continue } // only assign to ssh_private_key_file if it doesn't // already exist; otherwise we'll just ignore ssh_key_path _, sshPrivateIncluded := builder["ssh_private_key_file"] if !sshPrivateIncluded { builder["ssh_private_key_file"] = sshKeyPath } delete(builder, "ssh_key_path") } input["builders"] = tpl.Builders return input, nil } func (FixerSSHKeyPath) Synopsis() string { return `Updates builders using "ssh_key_path" to use "ssh_private_key_file"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_sshkeypath_test.go�������������������������������������������������������0000664�0000000�0000000�00000003024�13771713062�0021216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerSSHKeyPath_Impl(t *testing.T) { var _ Fixer = new(FixerSSHKeyPath) } func TestFixerSSHKeyPath_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No key_path field { Input: map[string]interface{}{ "type": "virtualbox", }, Expected: map[string]interface{}{ "type": "virtualbox", }, }, // private_key_file without key_path { Input: map[string]interface{}{ "ssh_private_key_file": "id_rsa", }, Expected: map[string]interface{}{ "ssh_private_key_file": "id_rsa", }, }, // key_path without private_key_file { Input: map[string]interface{}{ "ssh_key_path": "id_rsa", }, Expected: map[string]interface{}{ "ssh_private_key_file": "id_rsa", }, }, // key_path and private_key_file { Input: map[string]interface{}{ "ssh_key_path": "key_id_rsa", "ssh_private_key_file": "private_id_rsa", }, Expected: map[string]interface{}{ "ssh_private_key_file": "private_id_rsa", }, }, } for _, tc := range cases { var f FixerSSHKeyPath input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_test.go������������������������������������������������������������������0000664�0000000�0000000�00000000704�13771713062�0016755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "testing" ) func TestFix_allFixersEnabled(t *testing.T) { f := Fixers o := FixerOrder if len(f) != len(o) { t.Fatalf("Fixers length (%d) does not match FixerOrder length (%d)", len(f), len(o)) } for fixer := range f { found := false for _, orderedFixer := range o { if orderedFixer == fixer { found = true break } } if !found { t.Fatalf("Did not find Fixer %s in FixerOrder", fixer) } } } ������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_virtualbox_gaattach.go���������������������������������������������������0000664�0000000�0000000�00000002726�13771713062�0022037�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerVirtualBoxGAAttach changes the "guest_additions_attach" of a template // to "guest_additions_mode". type FixerVirtualBoxGAAttach struct{} func (FixerVirtualBoxGAAttach) DeprecatedOptions() map[string][]string { return map[string][]string{ "mitchellh.virtualbox": []string{"guest_additions_attach"}, } } func (FixerVirtualBoxGAAttach) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "virtualbox" { continue } gaAttachRaw, ok := builder["guest_additions_attach"] if !ok { continue } gaAttach, ok := gaAttachRaw.(bool) if !ok { continue } gaMode := "upload" if gaAttach { gaMode = "attach" } delete(builder, "guest_additions_attach") builder["guest_additions_mode"] = gaMode } input["builders"] = tpl.Builders return input, nil } func (FixerVirtualBoxGAAttach) Synopsis() string { return `Updates VirtualBox builders using "guest_additions_attach" to use "guest_additions_mode"` } ������������������������������������������packer-1.6.6+ds1/fix/fixer_virtualbox_gaattach_test.go����������������������������������������������0000664�0000000�0000000�00000003345�13771713062�0023074�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerVirtualBoxGAAttach_Impl(t *testing.T) { var _ Fixer = new(FixerVirtualBoxGAAttach) } func TestFixerVirtualBoxGAAttach_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ // No attach field { Input: map[string]interface{}{ "type": "virtualbox", }, Expected: map[string]interface{}{ "type": "virtualbox", }, }, // Attach field == false { Input: map[string]interface{}{ "type": "virtualbox", "guest_additions_attach": false, }, Expected: map[string]interface{}{ "type": "virtualbox", "guest_additions_mode": "upload", }, }, // Attach field == true { Input: map[string]interface{}{ "type": "virtualbox", "guest_additions_attach": true, }, Expected: map[string]interface{}{ "type": "virtualbox", "guest_additions_mode": "attach", }, }, // Attach field is not a bool { Input: map[string]interface{}{ "type": "virtualbox", "guest_additions_attach": "what", }, Expected: map[string]interface{}{ "type": "virtualbox", "guest_additions_attach": "what", }, }, } for _, tc := range cases { var f FixerVirtualBoxGAAttach input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_virtualbox_rename.go�����������������������������������������������������0000664�0000000�0000000�00000003322�13771713062�0021523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerVirtualBoxRename changes "virtualbox" builders to "virtualbox-iso" type FixerVirtualBoxRename struct{} func (FixerVirtualBoxRename) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerVirtualBoxRename) Fix(input map[string]interface{}) (map[string]interface{}, error) { type template struct { Builders []map[string]interface{} Provisioners []interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.WeakDecode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "virtualbox" { continue } builder["type"] = "virtualbox-iso" } for i, raw := range tpl.Provisioners { var m map[string]interface{} if err := mapstructure.WeakDecode(raw, &m); err != nil { // Ignore errors, could be a non-map continue } raw, ok := m["override"] if !ok { continue } var override map[string]interface{} if err := mapstructure.WeakDecode(raw, &override); err != nil { return nil, err } if raw, ok := override["virtualbox"]; ok { override["virtualbox-iso"] = raw delete(override, "virtualbox") // Set the change m["override"] = override tpl.Provisioners[i] = m } } if len(tpl.Builders) > 0 { input["builders"] = tpl.Builders } if len(tpl.Provisioners) > 0 { input["provisioners"] = tpl.Provisioners } return input, nil } func (FixerVirtualBoxRename) Synopsis() string { return `Updates "virtualbox" builders to "virtualbox-iso"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_virtualbox_rename_test.go������������������������������������������������0000664�0000000�0000000�00000003365�13771713062�0022571�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerVirtualBoxRename_impl(t *testing.T) { var _ Fixer = new(FixerVirtualBoxRename) } func TestFixerVirtualBoxRename_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "virtualbox", }, Expected: map[string]interface{}{ "type": "virtualbox-iso", }, }, } for _, tc := range cases { var f FixerVirtualBoxRename input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } func TestFixerVirtualBoxRenameFix_provisionerOverride(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "provisioners": []interface{}{ map[string]interface{}{ "override": map[string]interface{}{ "virtualbox": map[string]interface{}{}, }, }, }, }, Expected: map[string]interface{}{ "provisioners": []interface{}{ map[string]interface{}{ "override": map[string]interface{}{ "virtualbox-iso": map[string]interface{}{}, }, }, }, }, }, } for _, tc := range cases { var f FixerVirtualBoxRename output, err := f.Fix(tc.Input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, tc.Expected) { t.Fatalf("unexpected:\n\n%#v\nexpected:\n\n%#v\n", output, tc.Expected) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_vmware_compaction.go�����������������������������������������������������0000664�0000000�0000000�00000004205�13771713062�0021513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerVMwareCompaction adds "skip_compaction = true" to "vmware-iso" builders with incompatible disk_type_id type FixerVMwareCompaction struct{} func (FixerVMwareCompaction) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerVMwareCompaction) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "vmware-iso" { continue } builderRemoteTypeRaw, ok := builder["remote_type"] if !ok { continue } builderRemoteType, ok := builderRemoteTypeRaw.(string) if !ok { continue } if builderRemoteType != "esx5" { continue } builderDiskTypeIdRaw, ok := builder["disk_type_id"] // set to default when this fixer was added due to incompatibility of defaults if !ok { builderDiskTypeId := "zeroedthick" builder["disk_type_id"] = builderDiskTypeId } if ok { builderDiskTypeId, ok := builderDiskTypeIdRaw.(string) if !ok { continue } if builderDiskTypeId == "thin" { continue } } builderSkipCompactionRaw, ok := builder["skip_compaction"] // already verified this is not creating a "thin" disk, will need to skip_compaction if ok { builderSkipCompaction, ok := builderSkipCompactionRaw.(bool) if !ok { continue } if !builderSkipCompaction { builder["skip_compaction"] = !builderSkipCompaction } continue } builderSkipCompaction := true builder["skip_compaction"] = builderSkipCompaction } input["builders"] = tpl.Builders return input, nil } func (FixerVMwareCompaction) Synopsis() string { return `Adds "skip_compaction = true" to "vmware-iso" builders with incompatible disk_type_id` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_vmware_compaction_test.go������������������������������������������������0000664�0000000�0000000�00000004357�13771713062�0022562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerVMwareCompaction_impl(t *testing.T) { var _ Fixer = new(FixerVMwareCompaction) } func TestFixerVMwareCompaction_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "virtualbox-iso", }, Expected: map[string]interface{}{ "type": "virtualbox-iso", }, }, { Input: map[string]interface{}{ "type": "vmware-iso", }, Expected: map[string]interface{}{ "type": "vmware-iso", }, }, { Input: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", }, Expected: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", "disk_type_id": "zeroedthick", "skip_compaction": true, }, }, { Input: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", "disk_type_id": "zeroedthick", }, Expected: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", "disk_type_id": "zeroedthick", "skip_compaction": true, }, }, { Input: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", "disk_type_id": "zeroedthick", "skip_compaction": false, }, Expected: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", "disk_type_id": "zeroedthick", "skip_compaction": true, }, }, { Input: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", "disk_type_id": "thin", }, Expected: map[string]interface{}{ "type": "vmware-iso", "remote_type": "esx5", "disk_type_id": "thin", }, }, } for _, tc := range cases { var f FixerVMwareCompaction input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_vmware_rename.go���������������������������������������������������������0000664�0000000�0000000�00000002025�13771713062�0020624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerVMwareRename changes "vmware" builders to "vmware-iso" type FixerVMwareRename struct{} func (FixerVMwareRename) DeprecatedOptions() map[string][]string { return map[string][]string{} } func (FixerVMwareRename) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "vmware" { continue } builder["type"] = "vmware-iso" } input["builders"] = tpl.Builders return input, nil } func (FixerVMwareRename) Synopsis() string { return `Updates "vmware" builders to "vmware-iso"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_vmware_rename_test.go����������������������������������������������������0000664�0000000�0000000�00000001540�13771713062�0021664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerVMwareRename_impl(t *testing.T) { var _ Fixer = new(FixerVMwareRename) } func TestFixerVMwareRename_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "vmware", }, Expected: map[string]interface{}{ "type": "vmware-iso", }, }, } for _, tc := range cases { var f FixerVMwareRename input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_vsphere_network_storage.go�����������������������������������������������0000664�0000000�0000000�00000006160�13771713062�0022751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "github.com/mitchellh/mapstructure" ) // FixerVSphereNetworkDisk changes vsphere-iso network and networkCard fields // into a network adapter and changes the disk_size, disk_thin_provisioned, and // disk_eagerly_scrub into a storage adapter type FixerVSphereNetworkDisk struct{} func (FixerVSphereNetworkDisk) DeprecatedOptions() map[string][]string { return map[string][]string{ "jetbrains.vsphere": []string{"network_card", "network", "networkCard", "disk_size", "disk_thin_provisioned", "disk_eagerly_scrub"}, } } func (FixerVSphereNetworkDisk) Fix(input map[string]interface{}) (map[string]interface{}, error) { // The type we'll decode into; we only care about builders type template struct { Builders []map[string]interface{} } // Decode the input into our structure, if we can var tpl template if err := mapstructure.Decode(input, &tpl); err != nil { return nil, err } for _, builder := range tpl.Builders { builderTypeRaw, ok := builder["type"] if !ok { continue } builderType, ok := builderTypeRaw.(string) if !ok { continue } if builderType != "vsphere-iso" { continue } var networkAdapters []interface{} nic := make(map[string]interface{}) hasNetwork := false networkRaw, ok := builder["network"] if ok { nic["network"] = networkRaw delete(builder, "network") hasNetwork = true } // legacy syntax from when VSphere was 3rd party networkCardRaw, ok := builder["networkCard"] if ok { nic["network_card"] = networkCardRaw delete(builder, "networkCard") hasNetwork = true } // underscored syntax used when Packer merged vSphere networkCardRaw, ok = builder["network_card"] if ok { nic["network_card"] = networkCardRaw delete(builder, "network_card") hasNetwork = true } if hasNetwork { networkAdapters = append(networkAdapters, nic) adaptersRaw, ok := builder["network_adapters"] if ok { existingAdapters := adaptersRaw.([]interface{}) networkAdapters = append(networkAdapters, existingAdapters...) } builder["network_adapters"] = networkAdapters } var storage []interface{} disk := make(map[string]interface{}) hasStorage := false diskSizeRaw, ok := builder["disk_size"] if ok { disk["disk_size"] = diskSizeRaw delete(builder, "disk_size") hasStorage = true } discThinProvisionedRaw, ok := builder["disk_thin_provisioned"] if ok { disk["disk_thin_provisioned"] = discThinProvisionedRaw hasStorage = true delete(builder, "disk_thin_provisioned") } diskEagerlyScrubRaw, ok := builder["disk_eagerly_scrub"] if ok { disk["disk_eagerly_scrub"] = diskEagerlyScrubRaw hasStorage = true delete(builder, "disk_eagerly_scrub") } if hasStorage { storage = append(storage, disk) storageRaw, ok := builder["storage"] if ok { existingStorage := storageRaw.([]interface{}) storage = append(storage, existingStorage...) } builder["storage"] = storage } } input["builders"] = tpl.Builders return input, nil } func (FixerVSphereNetworkDisk) Synopsis() string { return `Removes deprecated network and disk fields from "vsphere-iso" builder` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/fixer_vsphere_network_storage_test.go������������������������������������������0000664�0000000�0000000�00000007072�13771713062�0024013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix import ( "reflect" "testing" ) func TestFixerVSphereNetwork_impl(t *testing.T) { var _ Fixer = new(FixerVSphereNetworkDisk) } func TestFixerVSphereNetwork_Fix(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} }{ { Input: map[string]interface{}{ "type": "vsphere-iso", "network": "", "networkCard": "vmxnet3", "disk_size": 5000, }, Expected: map[string]interface{}{ "type": "vsphere-iso", "network_adapters": []interface{}{ map[string]interface{}{ "network": "", "network_card": "vmxnet3", }, }, "storage": []interface{}{ map[string]interface{}{ "disk_size": 5000, }, }, }, }, { Input: map[string]interface{}{ "type": "vsphere-iso", "network": "", "network_card": "vmxnet3", "disk_size": 5000, }, Expected: map[string]interface{}{ "type": "vsphere-iso", "network_adapters": []interface{}{ map[string]interface{}{ "network": "", "network_card": "vmxnet3", }, }, "storage": []interface{}{ map[string]interface{}{ "disk_size": 5000, }, }, }, }, { Input: map[string]interface{}{ "type": "vsphere-iso", "network": "myNetwork", "networkCard": "vmxnet3", "disk_size": 5000, "disk_thin_provisioned": true, "disk_eagerly_scrub": true, }, Expected: map[string]interface{}{ "type": "vsphere-iso", "network_adapters": []interface{}{ map[string]interface{}{ "network": "myNetwork", "network_card": "vmxnet3", }, }, "storage": []interface{}{ map[string]interface{}{ "disk_size": 5000, "disk_thin_provisioned": true, "disk_eagerly_scrub": true, }, }, }, }, { Input: map[string]interface{}{ "type": "vsphere-iso", "network": "myNetwork", "networkCard": "vmxnet3", "disk_size": 5000, "disk_thin_provisioned": true, "disk_eagerly_scrub": true, "network_adapters": []interface{}{ map[string]interface{}{ "network": "net1", "network_card": "vmxnet3", }, }, "storage": []interface{}{ map[string]interface{}{ "disk_size": 5001, "disk_thin_provisioned": true, "disk_eagerly_scrub": true, }, }, }, Expected: map[string]interface{}{ "type": "vsphere-iso", "network_adapters": []interface{}{ map[string]interface{}{ "network": "myNetwork", "network_card": "vmxnet3", }, map[string]interface{}{ "network": "net1", "network_card": "vmxnet3", }, }, "storage": []interface{}{ map[string]interface{}{ "disk_size": 5000, "disk_thin_provisioned": true, "disk_eagerly_scrub": true, }, map[string]interface{}{ "disk_size": 5001, "disk_thin_provisioned": true, "disk_eagerly_scrub": true, }, }, }, }, } for _, tc := range cases { var f FixerVSphereNetworkDisk input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input}, } expected := map[string]interface{}{ "builders": []map[string]interface{}{tc.Expected}, } output, err := f.Fix(input) if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(output, expected) { t.Fatalf("unexpected: %#v\nexpected: %#v\n", output, expected) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/fix/helpers.go���������������������������������������������������������������������0000664�0000000�0000000�00000001267�13771713062�0016250�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package fix // PP is a convenient way to interact with the post-processors within a fixer type PP struct { PostProcessors []interface{} `mapstructure:"post-processors"` } // postProcessors converts the variable structure of the template to a list func (pp *PP) ppList() []map[string]interface{} { pps := make([]map[string]interface{}, 0, len(pp.PostProcessors)) for _, rawPP := range pp.PostProcessors { switch pp := rawPP.(type) { case string: case map[string]interface{}: pps = append(pps, pp) case []interface{}: for _, innerRawPP := range pp { if innerPP, ok := innerRawPP.(map[string]interface{}); ok { pps = append(pps, innerPP) } } } } return pps } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/formatted.pkr.hcl������������������������������������������������������������������0000664�0000000�0000000�00000000143�13771713062�0016731�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������source "null" "example" { communicator = "none" } build { sources = ["source.null.example"] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/go.mod�����������������������������������������������������������������������������0000664�0000000�0000000�00000017464�13771713062�0014605�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/packer require ( cloud.google.com/go v0.66.0 github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1 github.com/Azure/azure-sdk-for-go v40.5.0+incompatible github.com/Azure/go-autorest/autorest v0.10.0 github.com/Azure/go-autorest/autorest/adal v0.8.2 github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 github.com/Azure/go-autorest/autorest/date v0.2.0 github.com/Azure/go-autorest/autorest/to v0.3.0 github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect github.com/Azure/go-ntlmssp v0.0.0-20191115201650-bad6df29494a // indirect github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.1.0 github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/Telmate/proxmox-api-go v0.0.0-20200715182505-ec97c70ba887 github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af // indirect github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190418113227-25233c783f4e github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd // indirect github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607 // indirect github.com/antihax/optional v1.0.0 github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43 github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect github.com/aws/aws-sdk-go v1.36.0 github.com/biogo/hts v0.0.0-20160420073057-50da7d4131a3 github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee github.com/cheggaaa/pb v1.0.27 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/digitalocean/go-libvirt v0.0.0-20190626172931-4d226dd6c437 // indirect github.com/digitalocean/go-qemu v0.0.0-20181112162955-dd7bb9c771b8 github.com/digitalocean/godo v1.11.1 github.com/dylanmei/iso8601 v0.1.0 // indirect github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08 github.com/exoscale/egoscale v0.18.1 github.com/fatih/camelcase v1.0.0 github.com/fatih/structtag v1.0.0 github.com/go-ini/ini v1.25.4 github.com/go-ole/go-ole v1.2.4 // indirect github.com/go-resty/resty/v2 v2.3.0 github.com/gobwas/glob v0.2.3 github.com/gofrs/flock v0.7.3 github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/google/go-cmp v0.5.2 github.com/google/go-querystring v1.0.0 // indirect github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 github.com/google/uuid v1.1.1 github.com/gophercloud/gophercloud v0.12.0 github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 github.com/hashicorp/aws-sdk-go-base v0.6.0 github.com/hashicorp/consul/api v1.4.0 github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840 github.com/hashicorp/go-getter/gcs/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-getter/s3/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-getter/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-immutable-radix v1.1.0 // indirect github.com/hashicorp/go-msgpack v0.5.5 // indirect github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/go-oracle-terraform v0.0.0-20181016190316-007121241b79 github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/go-version v1.2.0 github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/hashicorp/hcl/v2 v2.6.0 github.com/hashicorp/serf v0.9.2 // indirect github.com/hashicorp/vault/api v1.0.4 github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hetznercloud/hcloud-go v1.15.1 github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4 github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 github.com/joyent/triton-go v0.0.0-20180628001255-830d2b111e62 github.com/json-iterator/go v1.1.6 // indirect github.com/jtolds/gls v4.2.1+incompatible // indirect github.com/klauspost/compress v0.0.0-20160131094358-f86d2e6d8a77 // indirect github.com/klauspost/cpuid v0.0.0-20160106104451-349c67577817 // indirect github.com/klauspost/crc32 v0.0.0-20160114101742-999f3125931f // indirect github.com/klauspost/pgzip v0.0.0-20151221113845-47f36e165cec github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 // indirect github.com/linode/linodego v0.14.0 github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect github.com/masterzen/winrm v0.0.0-20200615185753-c42b5136ff88 github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08 github.com/mitchellh/cli v1.1.0 github.com/mitchellh/go-fs v0.0.0-20180402234041-7b48fa161ea7 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-testing-interface v1.0.3 // indirect github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed github.com/mitchellh/gox v1.0.1 // indirect github.com/mitchellh/iochan v1.0.0 github.com/mitchellh/mapstructure v1.2.3 github.com/mitchellh/panicwrap v1.0.0 github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 github.com/mitchellh/reflectwalk v1.0.0 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b github.com/oracle/oci-go-sdk v18.0.0+incompatible github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699 github.com/packer-community/winrmcp v0.0.0-20180921204643-0fd363d6159a github.com/pierrec/lz4 v2.0.5+incompatible github.com/pkg/errors v0.9.1 github.com/pkg/sftp v0.0.0-20160118190721-e84cc8c755ca github.com/posener/complete v1.2.3 github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible github.com/ryanuber/go-glob v1.0.0 github.com/satori/go.uuid v1.2.0 // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7 github.com/shirou/gopsutil v2.18.12+incompatible github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect github.com/stretchr/objx v0.2.0 // indirect github.com/stretchr/testify v1.5.1 github.com/tencentcloud/tencentcloud-sdk-go v3.0.222+incompatible github.com/ucloud/ucloud-sdk-go v0.16.3 github.com/ufilesdk-dev/ufile-gosdk v0.0.0-20190830075812-b4dbc4ef43a6 github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1 github.com/ulikunitz/xz v0.5.5 github.com/vmware/govmomi v0.23.1 github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0 github.com/yandex-cloud/go-genproto v0.0.0-20200915125933-33de72a328bd github.com/yandex-cloud/go-sdk v0.0.0-20200921111412-ef15ded2014c github.com/zclconf/go-cty v1.4.0 github.com/zclconf/go-cty-yaml v1.0.1 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/mobile v0.0.0-20191130191448-5c0e7e404af8 golang.org/x/net v0.0.0-20201110031124-69a78807bb2b golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f golang.org/x/tools v0.0.0-20201111133315-69daaf961d65 google.golang.org/api v0.32.0 google.golang.org/genproto v0.0.0-20200918140846-d0d605568037 // indirect google.golang.org/grpc v1.32.0 gopkg.in/ini.v1 v1.42.0 // indirect gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect ) go 1.13 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/go.sum�����������������������������������������������������������������������������0000664�0000000�0000000�00000305777�13771713062�0014641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.66.0 h1:DZeAkuQGQqnm9Xv36SbMJEU8aFBz4wL04UpMWPWwjzg= cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0 h1:sAbMqjY1PEQKZBWfbu6Y6bsupJ9c4QdHnzg/VvYTLcE= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0 h1:Kt+gOPPp2LEPWp8CSfxhsM8ik9CcyE/gYu+0r+RnZvM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0 h1:9/vpR43S4aJaROxqQHQ3nH9lfyKKV0dC3vOmnw8ebQQ= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1 h1:RMTyvS5bjvSWiUcfqfr/E2pxHEMrALvU+E12n6biymg= github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1/go.mod h1:61apmbkVJH4kg+38ftT+/l0XxdUCVnHggqcOTqZRSEE= github.com/Azure/azure-sdk-for-go v40.5.0+incompatible h1:CVQNKuUepSFBo6BW6gM1J9slPHLRcjn6vaw+j+causw= github.com/Azure/azure-sdk-for-go v40.5.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= github.com/Azure/go-autorest/autorest v0.10.0 h1:mvdtztBqcL8se7MdrUweNieTNi4kfNG6GOJuurQJpuY= github.com/Azure/go-autorest/autorest v0.10.0/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.8.2 h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/Azure/go-ntlmssp v0.0.0-20191115201650-bad6df29494a h1:3FwiePtHk5YJrooV799oo5jIfsgRdES25VdngJM03dU= github.com/Azure/go-ntlmssp v0.0.0-20191115201650-bad6df29494a/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/DataDog/datadog-go v2.2.0+incompatible h1:V5BKkxACZLjzHjSgBbr2gvLA2Ae49yhc6CSY7MLy5k4= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.1.0 h1:0nxjOH7NurPGUWNG5BCrASWjB0uuhGbgJAKLqj2ZDTo= github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.1.0/go.mod h1:P+3VS0ETiQPyWOx3vB/oeC8J3qd7jnVZLYAFwWgGRt8= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/Telmate/proxmox-api-go v0.0.0-20200715182505-ec97c70ba887 h1:Q65o4V0g/KR1sSUZIMf4m1rShb7f1tVHuEt30hfnh2A= github.com/Telmate/proxmox-api-go v0.0.0-20200715182505-ec97c70ba887/go.mod h1:OGWyIMJ87/k/GCz8CGiWB2HOXsOVDM6Lpe/nFPkC4IQ= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af h1:DBNMBMuMiWYu0b+8KMJuWmfCkcxl09JwdlqwDZZ6U14= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190418113227-25233c783f4e h1:/8wOj52pewmIX/8d5eVO3t7Rr3astkBI/ruyg4WNqRo= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190418113227-25233c783f4e/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f h1:jI4DIE5Vf4oRaHfthB0oRhU+yuYuoOTurDzwAlskP00= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd h1:S3Fr6QnkpW9VRjiEY4psQHhhbbahASuNVj52YIce7lI= github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607 h1:BFFG6KP8ASFBg2ptWsJn8p8RDufBjBDKIxLU7BTYGOM= github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43 h1:ePCAQPf5tUc5IMcUvu6euhSGna7jzs7eiXtJXHig6Zc= github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43/go.mod h1:S6puKjZ9ZeqUPBv2hEBnMZGcM2J6mOsDRQcmxkMAND0= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM= github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.26.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.8 h1:4BHbh8K3qKmcnAgToZ2LShldRF9inoqIBccpCLNCy3I= github.com/aws/aws-sdk-go v1.30.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.34.26 h1:tw4nsSfGvCDnXt2xPe8NkxIrDui+asAWinMknPLEf80= github.com/aws/aws-sdk-go v1.34.26/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.36.0 h1:CscTrS+szX5iu34zk2bZrChnGO/GMtUYgMK1Xzs2hYo= github.com/aws/aws-sdk-go v1.36.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/biogo/hts v0.0.0-20160420073057-50da7d4131a3 h1:3b+p838vN4sc37brz9W2HDphtSwZFcXZwFLyzm5Vk28= github.com/biogo/hts v0.0.0-20160420073057-50da7d4131a3/go.mod h1:YOY5xnRf7Jz2SZCLSKgVfyqNzbRgyTznM3HyDqQMxcU= github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee h1:BnPxIde0gjtTnc9Er7cxvBk8DHLWhEux0SxayC8dP6I= github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27 h1:wIkZHkNfC7R6GI5w7l/PdAdzXzlrbcI3p8OAlnkTsnc= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible h1:C29Ae4G5GtYyYMm1aztcyj/J5ckgJm2zwdDajFbx1NY= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3 h1:TJH+oke8D16535+jHExHj4nQvzlZrj7ug5D7I/orNUA= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-xdr v0.0.0-20161123171359-e6a2ba005892/go.mod h1:CTDl0pzVzE5DEzZhPfvhY/9sPFMQIxaJ9VAMs9AagrE= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/digitalocean/go-libvirt v0.0.0-20190626172931-4d226dd6c437 h1:phR13shVFOIpa1pnLBmewI9p16NEladLPvVylLPeexo= github.com/digitalocean/go-libvirt v0.0.0-20190626172931-4d226dd6c437/go.mod h1:PRcPVAAma6zcLpFd4GZrjR/MRpood3TamjKI2m/z/Uw= github.com/digitalocean/go-qemu v0.0.0-20181112162955-dd7bb9c771b8 h1:N7nH2py78LcMqYY3rZjjrsX6N7uCN7sjvaosgpXN9Ow= github.com/digitalocean/go-qemu v0.0.0-20181112162955-dd7bb9c771b8/go.mod h1:/YnlngP1PARC0SKAZx6kaAEMOp8bNTQGqS+Ka3MctNI= github.com/digitalocean/godo v1.11.1 h1:OsTh37YFKk+g6DnAOrkXJ9oDArTkRx5UTkBJ2EWAO38= github.com/digitalocean/godo v1.11.1/go.mod h1:h6faOIcZ8lWIwNQ+DN7b3CgX4Kwby5T+nbpNqkUIozU= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dnaeon/go-vcr v1.0.1 h1:r8L/HqC0Hje5AXMu1ooW8oyQyOFv4GxqpL0nRP7SLLY= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08 h1:0bp6/GrNOrTDtSXe9YYGCwf8jp5Fb/b+4a6MTRm4qzY= github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08/go.mod h1:VBVDFSBXCIW8JaHQpI8lldSKfYaLMzP9oyq6IJ4fhzY= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4 h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/exoscale/egoscale v0.18.1 h1:1FNZVk8jHUx0AvWhOZxLEDNlacTU0chMXUUNkm9EZaI= github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE= github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.0.0 h1:pTHj65+u3RKWYPSGaU290FpI/dXxTaHdVwVwbcPKmEc= github.com/fatih/structtag v1.0.0/go.mod h1:IKitwq45uXL/yqi5mYghiD3w9H6eTOvI9vnk8tXMphA= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.25.4 h1:Mujh4R/dH6YL8bxuISne3xX2+qcQ9p0IxKAP6ExWoUo= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48 h1:JVrqSeQfdhYRFk24TvhTZWU0q8lfCojxZQFi3Ou7+uY= github.com/go-resty/resty/v2 v2.1.1-0.20191201195748-d7b97669fe48/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8= github.com/go-resty/resty/v2 v2.3.0 h1:JOOeAvjSlapTT92p8xiS19Zxev1neGikoHsXJeOq8So= github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gofrs/flock v0.7.3 h1:I0EKY9l8HZCXTMYC4F80vwT6KNypV9uYKP3Alm/hjmQ= github.com/gofrs/flock v0.7.3/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 h1:zN2lZNZRflqFyxVaTIU61KNKQ9C0055u9CAfpmqUvo4= github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3/go.mod h1:nPpo7qLxd6XL3hWJG/O60sR8ZKfMCiIoNap5GvD12KU= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 h1:JM174NTeGNJ2m/oLH3UOWOvWQQKd+BoL3hcSCUWFLt0= github.com/google/shlex v0.0.0-20150127133951-6f45313302b9/go.mod h1:RpwtwJQFrIEPstU94h88MWPXP2ektJZ8cZ0YntAmXiE= github.com/google/uuid v0.0.0-20170306145142-6a5e28554805/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gophercloud/gophercloud v0.6.1-0.20191122030953-d8ac278c1c9d/go.mod h1:ozGNgr9KYOVATV5jsgHl/ceCDXGuguqOZAzoQ/2vcNM= github.com/gophercloud/gophercloud v0.12.0 h1:mZrie07npp6ODiwHZolTicr5jV8Ogn43AvAsSMm6Ork= github.com/gophercloud/gophercloud v0.12.0/go.mod h1:gmC5oQqMDOMO1t1gq5DquX/yAU808e/4mzjjDA76+Ss= github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c h1:iawx2ojEQA7c+GmkaVO5sN+k8YONibXyDO8RlsC+1bs= github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c/go.mod h1:ehWUbLQJPqS0Ep+CxeD559hsm9pthPXadJNKwZkp43w= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= github.com/hashicorp/aws-sdk-go-base v0.6.0 h1:qmUbzM36msbBF59YctwuO5w0M2oNXjlilgKpnEhx1uw= github.com/hashicorp/aws-sdk-go-base v0.6.0/go.mod h1:2fRjWDv3jJBeN6mVWFHV6hFTNeFBx2gpDLQaZNxUVAY= github.com/hashicorp/consul/api v1.4.0 h1:jfESivXnO5uLdH650JU/6AnjRoHrLhULq0FnC3Kp9EY= github.com/hashicorp/consul/api v1.4.0/go.mod h1:xc8u05kyMa3Wjr9eEAsIAo3dg8+LywT5E/Cl7cNS5nU= github.com/hashicorp/consul/sdk v0.4.0 h1:zBtCfKJZcJDBvSCkQJch4ulp59m1rATFLKwNo/LYY30= github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de h1:XDCSythtg8aWSRSO29uwhgh7b127fWr+m5SemqjSUL8= github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de/go.mod h1:xIwEieBHERyEvaeKF/TcHh1Hu+lxPM+n2vT1+g9I4m4= github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840 h1:kgvybwEeu0SXktbB2y3uLHX9lklLo+nzUwh59A3jzQc= github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840/go.mod h1:Abjk0jbRkDaNCzsRhOv2iDCofYpX1eVsjozoiK63qLA= github.com/hashicorp/go-getter v1.4.1 h1:3A2Mh8smGFcf5M+gmcv898mZdrxpseik45IpcyISLsA= github.com/hashicorp/go-getter v1.4.1/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter/gcs/v2 v2.0.0-20200604122502-a6995fa1edad h1:QPLyAkuTS5Uf9uqJQxCTDDFgmD+gVAzSvqkGb3h+7oQ= github.com/hashicorp/go-getter/gcs/v2 v2.0.0-20200604122502-a6995fa1edad/go.mod h1:e752jX43t0ynGvZNR7UVizfZX9icakpmUetiv7LH7xY= github.com/hashicorp/go-getter/s3/v2 v2.0.0-20200604122502-a6995fa1edad h1:hwk5mQRwVvZc/f+So1kHbOhW/f7P2fEcCr2D5pSk9sI= github.com/hashicorp/go-getter/s3/v2 v2.0.0-20200604122502-a6995fa1edad/go.mod h1:kcB6Mv+0wzYXbQjTAeD/Pb85145WcFk2EElpe02fuoE= github.com/hashicorp/go-getter/v2 v2.0.0-20200511090339-3107ec4af37a/go.mod h1:QJ+LwRM91JBKBLyHoKBrcmi49i9Tu/ItpgTNXWSnpGM= github.com/hashicorp/go-getter/v2 v2.0.0-20200604122502-a6995fa1edad h1:BfRfKjQgvwJrXF2apbeqoqeuxzDcxZIeI/eCj6HLkM4= github.com/hashicorp/go-getter/v2 v2.0.0-20200604122502-a6995fa1edad/go.mod h1:bM2M11foprILIk1Slmr2wBrJYsdQTym//+QMJqgm3F8= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.1.0 h1:vN9wG1D6KG6YHRTWr8512cxGOVgTMEfgEdSj/hr8MPc= github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-oracle-terraform v0.0.0-20181016190316-007121241b79 h1:RKu7yAXZTaQsxj1K9GDsh+QVw0+Wu1SWHxtbFN0n+hE= github.com/hashicorp/go-oracle-terraform v0.0.0-20181016190316-007121241b79/go.mod h1:09jT3Y/OIsjTjQ2+3bkVNPDKqWcGIYYvjB2BEKVUdvc= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.5.4 h1:1BZvpawXoJCWX6pNtow9+rpEj+3itIlutiqnntI6jOE= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0 h1:KaodqZuhUoZereWVIYmpUgZysurB1kBLX2j0MwMrUAE= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl/v2 v2.6.0 h1:3krZOfGY6SziUXa6H9PJU6TyohHn7I+ARYnhbeNBz+o= github.com/hashicorp/hcl/v2 v2.6.0/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/mdns v1.0.1 h1:XFSOubp8KWB+Jd2PDyaX5xUd5bhSP/+pTDZVDMzZJM8= github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/memberlist v0.2.2 h1:5+RffWKwqJ71YPu9mWsF7ZOscZmwfasdA8kbdC7AO2g= github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.9.2 h1:yJoyfZXo4Pk2p/M/viW+YLibBFiIbKoP79gu7kDAFP0= github.com/hashicorp/serf v0.9.2/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/vault/api v1.0.4 h1:j08Or/wryXT4AcHj1oCbMd7IijXcKzYUGw59LGu9onU= github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= github.com/hashicorp/vault/sdk v0.1.13 h1:mOEPeOhT7jl0J4AMl1E705+BcmeRs1VmKNb9F0sMLy8= github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hetznercloud/hcloud-go v1.15.1 h1:G8Q+xyAqQ5IUY7yq4HKZgkabFa0S/VXJXq3TGCeT8JM= github.com/hetznercloud/hcloud-go v1.15.1/go.mod h1:8lR3yHBHZWy2uGcUi9Ibt4UOoop2wrVdERJgCtxsF3Q= github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4 h1:mSmyzhwBeQt2TlHbsXYLona9pwjWAvYGwQJ2Cq/k3VE= github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4/go.mod h1:yNUVHSleURKSaYUKq4Wx0i/vjCen2aq7CvPyHd/Vj2Q= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 h1:a2/K4HRhg31A5vafiz5yYiGMjaCxwRpyjJStfVquKds= github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961/go.mod h1:UrKjuULIWLjHFlG6aSPunArE5QX57LftMmStAZJBEX8= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uczJe5YQdrYB16oTJlGSC/OyZDqUk9xX4= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/joyent/triton-go v0.0.0-20180628001255-830d2b111e62 h1:JHCT6xuyPUrbbgAPE/3dqlvUKzRHMNuTBKKUb6OeR/k= github.com/joyent/triton-go v0.0.0-20180628001255-830d2b111e62/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v0.0.0-20160131094358-f86d2e6d8a77 h1:rJnR80lkojFgjdg/oQPhbZoY8t8uM51XMz8DrJrjabk= github.com/klauspost/compress v0.0.0-20160131094358-f86d2e6d8a77/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v0.0.0-20160106104451-349c67577817 h1:/7pPahIC+GoCm/euDCi2Pm29bAj9tc6TcK4Zcc8D3WI= github.com/klauspost/cpuid v0.0.0-20160106104451-349c67577817/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20160114101742-999f3125931f h1:UD9YLTi2aBhdOOThzatodQ/pGd9nd5255swS+UzHZj4= github.com/klauspost/crc32 v0.0.0-20160114101742-999f3125931f/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v0.0.0-20151221113845-47f36e165cec h1:PYqF3Tiz2W2Ag0ezyDhAobWDWlrFv7U+qct4spLeDBM= github.com/klauspost/pgzip v0.0.0-20151221113845-47f36e165cec/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 h1:YUrU1/jxRqnt0PSrKj1Uj/wEjk/fjnE80QFfi2Zlj7Q= github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169/go.mod h1:glhvuHOU9Hy7/8PwwdtnarXqLagOX0b/TbZx2zLMqEg= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/linode/linodego v0.14.0 h1:0APKMjiVGyry2TTUVDiok72H6cWpFNMMrFWBFn14aFU= github.com/linode/linodego v0.14.0/go.mod h1:2ce3S00NrDqJfp4i55ZuSlT0U3cKNELNYACWBPI8Tnw= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 h1:2ZKn+w/BJeL43sCxI2jhPLRv73oVVOjEKZjKkflyqxg= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/winrm v0.0.0-20200615185753-c42b5136ff88 h1:cxuVcCvCLD9yYDbRCWw0jSgh1oT6P6mv3aJDKK5o7X4= github.com/masterzen/winrm v0.0.0-20200615185753-c42b5136ff88/go.mod h1:a2HXwefeat3evJHxFXSayvRHpYEPJYtErl4uIzfaUqY= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08 h1:8YAWbq7rJqfbc6IaAvA2eCQuOQvf6Bs4vHKcOyWw//E= github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0 h1:tEElEatulEHDeedTxwckzyYMA5c86fbmNIUL1hBIiTg= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-fs v0.0.0-20180402234041-7b48fa161ea7 h1:PXPMDtfqV+rZJshQHOiwUFqlqErXaAcuWy+/ZmyRfNc= github.com/mitchellh/go-fs v0.0.0-20180402234041-7b48fa161ea7/go.mod h1:g7SZj7ABpStq3tM4zqHiVEG5un/DZ1+qJJKO7qx1EvU= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.3 h1:gqwbsGvc0jbhAPW/26WfEoSiPANAVlR49AAVdvaTjI4= github.com/mitchellh/go-testing-interface v1.0.3/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed h1:FI2NIv6fpef6BQl2u3IZX/Cj20tfypRF4yd+uaHOMtI= github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI= github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4= github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.2.3 h1:f/MjBEBDLttYCGfRaKBbKSRVF5aV2O6fnBpzknuE3jU= github.com/mitchellh/mapstructure v1.2.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/panicwrap v1.0.0 h1:67zIyVakCIvcs69A0FGfZjBdPleaonSgGlXRSRlb6fE= github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 h1:+DAetXqxv/mSyCkE9KBIYOZs9b68y7SUaDCxQMRjA68= github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b h1:LGItPaClbzopugAomw5VFKnG3h1dUr9QW5KOU+m8gu0= github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/oracle/oci-go-sdk v18.0.0+incompatible h1:FLV4KixsVfF3rwyVTMI6Ryp/Q+OSb9sR5TawbfjFLN4= github.com/oracle/oci-go-sdk v18.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699 h1:SHe9i7h5cHe+cB77fQ6lsEgIwKg3ckNU90P03CjGMnI= github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699/go.mod h1:5AqqNH1X8zCHescKVlpSHRzrat1KCKDXqZoQPe8fY3A= github.com/packer-community/winrmcp v0.0.0-20180921204643-0fd363d6159a h1:A3QMuteviunoaY/8ex+RKFqwhcZJ/Cf3fCW3IwL2wx4= github.com/packer-community/winrmcp v0.0.0-20180921204643-0fd363d6159a/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v0.0.0-20160118190721-e84cc8c755ca h1:k8gsErq3rkcbAyCnpOycQsbw88NjCHk7L3KfBZKhQDQ= github.com/pkg/sftp v0.0.0-20160118190721-e84cc8c755ca/go.mod h1:NxmoDg/QLVWluQDUYG7XBZTLUpKeFa8e3aMf1BfjyHk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible h1:ZoVHH6voxW9Onzo6z2yLtocVoN6mBocyDoqoyAMHokE= github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible/go.mod h1:T3/WrziK7fYH3C8ilAFAHe99R452/IzIG3YYkqaOFeQ= github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 h1:PnBWHBf+6L0jOqq0gIVUe6Yk0/QMZ640k6NvkxcBf+8= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a h1:9a8MnZMP0X2nLJdBg+pBmGgkJlSaKC2KaQmTCk1XDtE= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7 h1:Do8ksLD4Nr3pA0x0hnLOLftZgkiTDvwPDShRTUxtXpE= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM= github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/tencentcloud/tencentcloud-sdk-go v3.0.222+incompatible h1:bs+0lcG4RELNbE8PsBC9oaPP0/qExr0DuEGnZyocm84= github.com/tencentcloud/tencentcloud-sdk-go v3.0.222+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926 h1:G3dpKMzFDjgEh2q1Z7zUUtKa8ViPtH+ocF0bE0g00O8= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ucloud/ucloud-sdk-go v0.16.3 h1:DCh4A5vSxFr3EvtvJL+g0Ehy4hSlEkMpQmEvxEQhYdo= github.com/ucloud/ucloud-sdk-go v0.16.3/go.mod h1:dyLmFHmUfgb4RZKYQP9IArlvQ2pxzFthfhwxRzOEPIw= github.com/ufilesdk-dev/ufile-gosdk v0.0.0-20190830075812-b4dbc4ef43a6 h1:FAWNiqocJ04wC4Znj7Ax4PGWstZijayO6ifuHHvb+vI= github.com/ufilesdk-dev/ufile-gosdk v0.0.0-20190830075812-b4dbc4ef43a6/go.mod h1:R5FMQxkQ+QK/9Vz+jfnJP4rZIktYrRcWmuAnbOSkROI= github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1 h1:U6ufy3mLDgg9RYupntOvAF7xCmNNquyKaYaaVHo1Nnk= github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/vmihailenco/msgpack v3.3.3+incompatible h1:wapg9xDUZDzGCNFlwc5SqI1rvcciqcxEHac4CYj89xI= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmware/govmomi v0.23.1 h1:vU09hxnNR/I7e+4zCJvW+5vHu5dO64Aoe2Lw7Yi/KRg= github.com/vmware/govmomi v0.23.1/go.mod h1:Y+Wq4lst78L85Ge/F8+ORXIWiKYqaro1vhAulACy9Lc= github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk= github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0 h1:NJrcIkdzq0C3I8ypAZwFE9RHtGbfp+mJvqIcoFATZuk= github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0/go.mod h1:sBh287mCRwCz6zyXHMmw7sSZGPohVpnx+o+OY4M+i3A= github.com/yandex-cloud/go-genproto v0.0.0-20200915125933-33de72a328bd h1:o4pvS7D4OErKOM6y+/q6IfOa65OaentKbEDh1ABirE8= github.com/yandex-cloud/go-genproto v0.0.0-20200915125933-33de72a328bd/go.mod h1:HEUYX/p8966tMUHHT+TsS0hF/Ca/NYwqprC5WXSDMfE= github.com/yandex-cloud/go-sdk v0.0.0-20200921111412-ef15ded2014c h1:LJrgyICodRAgtBvOO2eCbhDDIoaJgeLa1tGQecqW9ac= github.com/yandex-cloud/go-sdk v0.0.0-20200921111412-ef15ded2014c/go.mod h1:Zn/U9YKH0w8n83ezLps5eB6Jftc4gSoZWxVR8hgXgoY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.4.0 h1:+q+tmgyUB94HIdH/uVTIi/+kt3pt4sHwEZAcTyLoGsQ= github.com/zclconf/go-cty v1.4.0/go.mod h1:nHzOclRkoj++EU9ZjSrZvRG0BXIWt8c7loYc0qXAFGQ= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3 h1:KYQXGkl6vs02hK7pK4eIbw0NpNPedieTSTEiJ//bwGs= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 h1:58fnuSXlxZmFdJyvtTFVmVhcMLU6v5fEb/ok4wyqtNU= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191202143827-86a70503ff7e/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200422194213-44a606286825 h1:dSChiwOTvzwbHFTMq2l6uRardHH7/E6SqEkqccinS/o= golang.org/x/crypto v0.0.0-20200422194213-44a606286825/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587 h1:5Uz0rkjCFu9BC9gCRN7EkwVvhNyQgGWb8KNJrPwBoHY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20191130191448-5c0e7e404af8 h1:9w7mvrikkrG9zFfEJfuFe08FVKrg8Yi0ePhOdGAKpUw= golang.org/x/mobile v0.0.0-20191130191448-5c0e7e404af8/go.mod h1:p895TfNkDgPEmEQrNiOtIl3j98d/tGU95djDj7NfyjQ= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200320220750-118fecf932d8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190909214602-067311248421/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201111133315-69daaf961d65 h1:cuDLV0fZoIC/Oj72hGUKPhXR2AvbvJoQKPmSeE5nH4Q= golang.org/x/tools v0.0.0-20201111133315-69daaf961d65/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.21.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= google.golang.org/api v0.32.0 h1:Le77IccnTqEa8ryp9wIpX5W3zYm7Gf9LhOp9PHcwFts= google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200323114720-3f67cca34472/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200918140846-d0d605568037 h1:ujwz1DPMeHwCvo36rK5shXhAzc4GMRecrqQFaMZJBKQ= google.golang.org/genproto v0.0.0-20200918140846-d0d605568037/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27 h1:kJdccidYzt3CaHD1crCFTS1hxyhSi059NhOFUf03YFo= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.42.0 h1:7N3gPTt50s8GuLortA00n8AqRTk75qOP98+mTPpgzRk= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516 h1:H6trpavCIuipdInWrab8l34Mf+GGVfphniHostMdMaQ= gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181117152235-275e9df93516/go.mod h1:d3R+NllX3X5e0zlG1Rful3uLvsGC/Q3OHut5464DEQw= gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= �packer-1.6.6+ds1/hcl2template/����������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016047�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/addrs/����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017144�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/addrs/doc.go����������������������������������������������������������0000664�0000000�0000000�00000001075�13771713062�0020243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package addrs contains types that represent "addresses", which are // references to specific objects within a Packer configuration. // // All addresses have string representations based on HCL traversal syntax // which should be used in the user-interface, and also in-memory // representations that can be used internally. // // All types within this package should be treated as immutable, even if this // is not enforced by the Go compiler. It is always an implementation error // to modify an address object in-place after it is initially constructed. package addrs �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/addrs/input_variable.go�����������������������������������������������0000664�0000000�0000000�00000000303�13771713062�0022473�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package addrs // InputVariable is the address of an input variable. type InputVariable struct { referenceable Name string } func (v InputVariable) String() string { return "var." + v.Name } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/addrs/parse_ref.go����������������������������������������������������0000664�0000000�0000000�00000005041�13771713062�0021441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package addrs import ( "fmt" "github.com/hashicorp/hcl/v2" ) // Reference describes a reference to an address with source location // information. type Reference struct { Subject Referenceable SourceRange hcl.Range Remaining hcl.Traversal } // ParseRef attempts to extract a referencable address from the prefix of the // given traversal, which must be an absolute traversal or this function // will panic. // // If no error diagnostics are returned, the returned reference includes the // address that was extracted, the source range it was extracted from, and any // remaining relative traversal that was not consumed as part of the // reference. // // If error diagnostics are returned then the Reference value is invalid and // must not be used. func ParseRef(traversal hcl.Traversal) (*Reference, hcl.Diagnostics) { ref, diags := parseRef(traversal) // Normalize a little to make life easier for callers. if ref != nil { if len(ref.Remaining) == 0 { ref.Remaining = nil } } return ref, diags } func parseRef(traversal hcl.Traversal) (*Reference, hcl.Diagnostics) { var diags hcl.Diagnostics root := traversal.RootName() rootRange := traversal[0].SourceRange() switch root { case "var": name, rng, remain, diags := parseSingleAttrRef(traversal) return &Reference{ Subject: InputVariable{Name: name}, SourceRange: rng, Remaining: remain, }, diags default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unhandled reference type", Detail: `Currently parseRef can only parse "var" references.`, Subject: &rootRange, }) } return nil, diags } func parseSingleAttrRef(traversal hcl.Traversal) (string, hcl.Range, hcl.Traversal, hcl.Diagnostics) { var diags hcl.Diagnostics root := traversal.RootName() rootRange := traversal[0].SourceRange() if len(traversal) < 2 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid reference", Detail: fmt.Sprintf("The %q object cannot be accessed directly. Instead, access one of its attributes.", root), Subject: &rootRange, }) return "", hcl.Range{}, nil, diags } if attrTrav, ok := traversal[1].(hcl.TraverseAttr); ok { return attrTrav.Name, hcl.RangeBetween(rootRange, attrTrav.SrcRange), traversal[2:], diags } diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid reference", Detail: fmt.Sprintf("The %q object does not support this operation.", root), Subject: traversal[1].SourceRange().Ptr(), }) return "", hcl.Range{}, nil, diags } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/addrs/referenceable.go������������������������������������������������0000664�0000000�0000000�00000001361�13771713062�0022256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package addrs // Referenceable is an interface implemented by all address types that can // appear as references in configuration language expressions. type Referenceable interface { // referenceableSigil is private to ensure that all Referenceables are // implentented in this current package. For now this does nothing. referenceableSigil() // String produces a string representation of the address that could be // parsed as a HCL traversal and passed to ParseRef to produce an identical // result. String() string } // referenceable is an empty struct that implements Referenceable, add it to // your Referenceable struct so that it can be recognized as such. type referenceable struct { } func (r referenceable) referenceableSigil() { } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/common_test.go��������������������������������������������������������0000664�0000000�0000000�00000014620�13771713062�0020730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclparse" "github.com/hashicorp/packer/builder/null" . "github.com/hashicorp/packer/hcl2template/internal" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/zclconf/go-cty/cty" ) func getBasicParser() *Parser { return &Parser{ Parser: hclparse.NewParser(), BuilderSchemas: packersdk.MapOfBuilder{ "amazon-ebs": func() (packersdk.Builder, error) { return &MockBuilder{}, nil }, "virtualbox-iso": func() (packersdk.Builder, error) { return &MockBuilder{}, nil }, "null": func() (packersdk.Builder, error) { return &null.Builder{}, nil }, }, ProvisionersSchemas: packersdk.MapOfProvisioner{ "shell": func() (packersdk.Provisioner, error) { return &MockProvisioner{}, nil }, "file": func() (packersdk.Provisioner, error) { return &MockProvisioner{}, nil }, }, PostProcessorsSchemas: packersdk.MapOfPostProcessor{ "amazon-import": func() (packersdk.PostProcessor, error) { return &MockPostProcessor{}, nil }, "manifest": func() (packersdk.PostProcessor, error) { return &MockPostProcessor{}, nil }, }, } } type parseTestArgs struct { filename string vars map[string]string varFiles []string } type parseTest struct { name string parser *Parser args parseTestArgs parseWantCfg *PackerConfig parseWantDiags bool parseWantDiagHasErrors bool getBuildsWantBuilds []packersdk.Build getBuildsWantDiags bool // getBuildsWantDiagHasErrors bool } func testParse(t *testing.T, tests []parseTest) { t.Helper() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { gotCfg, gotDiags := tt.parser.Parse(tt.args.filename, tt.args.varFiles, tt.args.vars) moreDiags := gotCfg.Initialize() gotDiags = append(gotDiags, moreDiags...) if tt.parseWantDiags == (gotDiags == nil) { t.Fatalf("Parser.parse() unexpected %q diagnostics.", gotDiags) } if tt.parseWantDiagHasErrors != gotDiags.HasErrors() { t.Fatalf("Parser.parse() unexpected diagnostics HasErrors. %s", gotDiags) } if diff := cmp.Diff(tt.parseWantCfg, gotCfg, cmpOpts...); diff != "" { t.Fatalf("Parser.parse() wrong packer config. %s", diff) } if gotCfg != nil && !tt.parseWantDiagHasErrors { if diff := cmp.Diff(tt.parseWantCfg.InputVariables, gotCfg.InputVariables, cmpOpts...); diff != "" { t.Fatalf("Parser.parse() unexpected input vars. %s", diff) } if diff := cmp.Diff(tt.parseWantCfg.LocalVariables, gotCfg.LocalVariables, cmpOpts...); diff != "" { t.Fatalf("Parser.parse() unexpected local vars. %s", diff) } } if gotDiags.HasErrors() { return } gotBuilds, gotDiags := gotCfg.GetBuilds(packer.GetBuildsOptions{}) if tt.getBuildsWantDiags == (gotDiags == nil) { t.Fatalf("Parser.getBuilds() unexpected diagnostics. %s", gotDiags) } if diff := cmp.Diff(tt.getBuildsWantBuilds, gotBuilds, cmpOpts...); diff != "" { t.Fatalf("Parser.getBuilds() wrong packer builds. %s", diff) } }) } } var ( // everything in the tests is a basicNestedMockConfig this allow to test // each known type to packer ( and embedding ) in one go. basicNestedMockConfig = NestedMockConfig{ String: "string", Int: 42, Int64: 43, Bool: true, Trilean: config.TriTrue, Duration: 10 * time.Second, MapStringString: map[string]string{ "a": "b", "c": "d", }, SliceString: []string{ "a", "b", "c", }, SliceSliceString: [][]string{ {"a", "b"}, {"c", "d"}, }, Tags: []MockTag{}, } basicMockBuilder = &MockBuilder{ Config: MockConfig{ NestedMockConfig: basicNestedMockConfig, Nested: basicNestedMockConfig, NestedSlice: []NestedMockConfig{ basicNestedMockConfig, basicNestedMockConfig, }, }, } basicMockProvisioner = &MockProvisioner{ Config: MockConfig{ NotSquashed: "value <UNKNOWN>", NestedMockConfig: basicNestedMockConfig, Nested: basicNestedMockConfig, NestedSlice: []NestedMockConfig{ { Tags: dynamicTagList, }, }, }, } basicMockPostProcessor = &MockPostProcessor{ Config: MockConfig{ NotSquashed: "value <UNKNOWN>", NestedMockConfig: basicNestedMockConfig, Nested: basicNestedMockConfig, NestedSlice: []NestedMockConfig{ { Tags: []MockTag{}, }, }, }, } basicMockCommunicator = &MockCommunicator{ Config: MockConfig{ NestedMockConfig: basicNestedMockConfig, Nested: basicNestedMockConfig, NestedSlice: []NestedMockConfig{ { Tags: []MockTag{}, }, }, }, } emptyMockBuilder = &MockBuilder{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{ Tags: []MockTag{}, }, Nested: NestedMockConfig{}, NestedSlice: []NestedMockConfig{}, }, } emptyMockProvisioner = &MockProvisioner{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, } dynamicTagList = []MockTag{ { Key: "first_tag_key", Value: "first_tag_value", }, { Key: "Component", Value: "user-service", }, { Key: "Environment", Value: "production", }, } ) var ctyValueComparer = cmp.Comparer(func(x, y cty.Value) bool { return x.RawEquals(y) }) var ctyTypeComparer = cmp.Comparer(func(x, y cty.Type) bool { if x == cty.NilType && y == cty.NilType { return true } if x == cty.NilType || y == cty.NilType { return false } return x.Equals(y) }) var cmpOpts = []cmp.Option{ ctyValueComparer, ctyTypeComparer, cmpopts.IgnoreUnexported( PackerConfig{}, Variable{}, SourceBlock{}, ProvisionerBlock{}, PostProcessorBlock{}, packer.CoreBuild{}, HCL2Provisioner{}, HCL2PostProcessor{}, packer.CoreBuildPostProcessor{}, packer.CoreBuildProvisioner{}, packer.CoreBuildPostProcessor{}, null.Builder{}, ), cmpopts.IgnoreFields(PackerConfig{}, "Cwd", // Cwd will change for every os type ), cmpopts.IgnoreFields(VariableAssignment{}, "Expr", // its an interface ), cmpopts.IgnoreTypes(HCL2Ref{}), cmpopts.IgnoreTypes([]*LocalBlock{}), cmpopts.IgnoreTypes([]hcl.Range{}), cmpopts.IgnoreTypes(hcl.Range{}), cmpopts.IgnoreInterfaces(struct{ hcl.Expression }{}), cmpopts.IgnoreInterfaces(struct{ hcl.Body }{}), } ����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/decode.go�������������������������������������������������������������0000664�0000000�0000000�00000001070�13771713062�0017617�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // Decodable structs are structs that can tell their hcl2 ObjectSpec; this // config spec will be passed to hcldec.Decode and the result will be a // cty.Value. This Value can then be applied on the said struct. type Decodable interface { ConfigSpec() hcldec.ObjectSpec } func decodeHCL2Spec(body hcl.Body, ectx *hcl.EvalContext, dec Decodable) (cty.Value, hcl.Diagnostics) { return hcldec.Decode(body, dec.ConfigSpec(), ectx) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/docs.go���������������������������������������������������������������0000664�0000000�0000000�00000000410�13771713062�0017321�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package hcl2template defines code to parse hcl2 template files. // // In order to configure a packer builder,provisioner, and post processor. // // Checkout the files in testdata/complete/ to see what a packer config could // look like. // package hcl2template ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/formatter.go����������������������������������������������������������0000664�0000000�0000000�00000007022�13771713062�0020402�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "bytes" "fmt" "io" "io/ioutil" "os" "os/exec" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclparse" "github.com/hashicorp/hcl/v2/hclwrite" ) type HCL2Formatter struct { ShowDiff, Write bool Output io.Writer parser *hclparse.Parser } // NewHCL2Formatter creates a new formatter, ready to format configuration files. func NewHCL2Formatter() *HCL2Formatter { return &HCL2Formatter{ parser: hclparse.NewParser(), } } // Format all HCL2 files in path and return the total bytes formatted. // If any error is encountered, zero bytes will be returned. // // Path can be a directory or a file. func (f *HCL2Formatter) Format(path string) (int, hcl.Diagnostics) { hclFiles, _, diags := GetHCL2Files(path, hcl2FileExt, hcl2JsonFileExt) if diags.HasErrors() { return 0, diags } hclVarFiles, _, diags := GetHCL2Files(path, hcl2VarFileExt, hcl2VarJsonFileExt) if diags.HasErrors() { return 0, diags } allHclFiles := append(hclFiles, hclVarFiles...) if len(allHclFiles) == 0 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Cannot tell whether %s contains HCL2 configuration data", path), }) return 0, diags } if f.parser == nil { f.parser = hclparse.NewParser() } var bytesModified int for _, fn := range allHclFiles { data, err := f.processFile(fn) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("encountered an error while formatting %s", fn), Detail: err.Error(), }) } bytesModified += len(data) } return bytesModified, diags } // processFile formats the source contents of filename and return the formatted data. // overwriting the contents of the original when the f.Write is true; a diff of the changes // will be outputted if f.ShowDiff is true. func (f *HCL2Formatter) processFile(filename string) ([]byte, error) { if f.Output == nil { f.Output = os.Stdout } in, err := os.Open(filename) if err != nil { return nil, fmt.Errorf("failed to open %s: %s", filename, err) } inSrc, err := ioutil.ReadAll(in) if err != nil { return nil, fmt.Errorf("failed to read %s: %s", filename, err) } _, diags := f.parser.ParseHCL(inSrc, filename) if diags.HasErrors() { return nil, fmt.Errorf("failed to parse HCL %s", filename) } outSrc := hclwrite.Format(inSrc) if bytes.Equal(inSrc, outSrc) { return nil, nil } s := []byte(fmt.Sprintf("%s\n", filename)) _, _ = f.Output.Write(s) if f.Write { if err := ioutil.WriteFile(filename, outSrc, 0644); err != nil { return nil, err } } if f.ShowDiff { diff, err := bytesDiff(inSrc, outSrc, filename) if err != nil { return outSrc, fmt.Errorf("failed to generate diff for %s: %s", filename, err) } _, _ = f.Output.Write(diff) } return outSrc, nil } // bytesDiff returns the unified diff of b1 and b2 // Shamelessly copied from Terraform's fmt command. func bytesDiff(b1, b2 []byte, path string) (data []byte, err error) { f1, err := ioutil.TempFile("", "") if err != nil { return } defer os.Remove(f1.Name()) defer f1.Close() f2, err := ioutil.TempFile("", "") if err != nil { return } defer os.Remove(f2.Name()) defer f2.Close() _, _ = f1.Write(b1) _, _ = f2.Write(b2) data, err = exec.Command("diff", "--label=old/"+path, "--label=new/"+path, "-u", f1.Name(), f2.Name()).CombinedOutput() if len(data) > 0 { // diff exits with a non-zero status when the files don't match. // Ignore that failure as long as we get output. err = nil } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/formatter_test.go�����������������������������������������������������0000664�0000000�0000000�00000005376�13771713062�0021453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "bytes" "io/ioutil" "os" "os/exec" "strings" "testing" "github.com/google/go-cmp/cmp" ) func TestHCL2Formatter_Format(t *testing.T) { tt := []struct { Name string Path string FormatExpected bool }{ {Name: "Unformatted file", Path: "testdata/format/unformatted.pkr.hcl", FormatExpected: true}, {Name: "Unformatted vars file", Path: "testdata/format/unformatted.pkrvars.hcl", FormatExpected: true}, {Name: "Formatted file", Path: "testdata/format/formatted.pkr.hcl"}, {Name: "Directory", Path: "testdata/format", FormatExpected: true}, } for _, tc := range tt { tc := tc var buf bytes.Buffer f := NewHCL2Formatter() f.Output = &buf _, diags := f.Format(tc.Path) if diags.HasErrors() { t.Fatalf("the call to Format failed unexpectedly %s", diags.Error()) } if buf.String() != "" && tc.FormatExpected == false { t.Errorf("Format(%q) should contain the name of the formatted file(s), but got %q", tc.Path, buf.String()) } } } func TestHCL2Formatter_Format_Write(t *testing.T) { var buf bytes.Buffer f := NewHCL2Formatter() f.Output = &buf f.Write = true unformattedData, err := ioutil.ReadFile("testdata/format/unformatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the unformatted fixture %s", err) } tf, err := ioutil.TempFile("", "*.pkr.hcl") if err != nil { t.Fatalf("failed to create tempfile for test %s", err) } defer os.Remove(tf.Name()) _, _ = tf.Write(unformattedData) tf.Close() _, diags := f.Format(tf.Name()) if diags.HasErrors() { t.Fatalf("the call to Format failed unexpectedly %s", diags.Error()) } //lets re-read the tempfile which should now be formatted data, err := ioutil.ReadFile(tf.Name()) if err != nil { t.Fatalf("failed to open the newly formatted fixture %s", err) } formattedData, err := ioutil.ReadFile("testdata/format/formatted.pkr.hcl") if err != nil { t.Fatalf("failed to open the formatted fixture %s", err) } if diff := cmp.Diff(string(data), string(formattedData)); diff != "" { t.Errorf("Unexpected format output %s", diff) } } func TestHCL2Formatter_Format_ShowDiff(t *testing.T) { if _, err := exec.LookPath("diff"); err != nil { t.Skip("Skipping test because diff is not in the executable PATH") } var buf bytes.Buffer f := HCL2Formatter{ Output: &buf, ShowDiff: true, } _, diags := f.Format("testdata/format/unformatted.pkr.hcl") if diags.HasErrors() { t.Fatalf("the call to Format failed unexpectedly %s", diags.Error()) } diffHeader := ` --- old/testdata/format/unformatted.pkr.hcl +++ new/testdata/format/unformatted.pkr.hcl @@ -1,149 +1,149 @@ ` if !strings.Contains(buf.String(), diffHeader) { t.Errorf("expected buf to contain a file diff, but instead we got %s", buf.String()) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/function/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017674�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/function/Consul.go����������������������������������������������������0000664�0000000�0000000�00000001125�13771713062�0021465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package function import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" commontpl "github.com/hashicorp/packer/packer-plugin-sdk/template" ) // ConsulFunc constructs a function that retrieves KV secrets from HC vault var ConsulFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "key", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { key := args[0].AsString() val, err := commontpl.Consul(key) return cty.StringVal(val), err }, }) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/function/aws_secretetkey.go�������������������������������������������0000664�0000000�0000000�00000001726�13771713062�0023432�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package function import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" commontpl "github.com/hashicorp/packer/packer-plugin-sdk/template" ) // AWSSecret constructs a function that retrieves secrets from aws secrets // manager. If Key field is not set then we will return first secret key stored // in secret name. var AWSSecret = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "name", Type: cty.String, AllowNull: false, AllowUnknown: false, }, { Name: "key", Type: cty.String, AllowNull: true, AllowUnknown: false, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { name := args[0].AsString() var key string if !args[1].IsNull() && args[1].IsWhollyKnown() { key = args[1].AsString() } val, err := commontpl.GetAWSSecret(name, key) return cty.StringVal(val), err }, }) ������������������������������������������packer-1.6.6+ds1/hcl2template/function/datetime.go��������������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0022014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package function import ( "time" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // TimestampFunc constructs a function that returns a string representation of the current date and time. var TimestampFunc = function.New(&function.Spec{ Params: []function.Parameter{}, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return cty.StringVal(time.Now().UTC().Format(time.RFC3339)), nil }, }) // Timestamp returns a string representation of the current date and time. // // In the HCL language, timestamps are conventionally represented as strings // using RFC 3339 "Date and Time format" syntax, and so timestamp returns a // string in this format. func Timestamp() (cty.Value, error) { return TimestampFunc.Call([]cty.Value{}) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/function/env.go�������������������������������������������������������0000664�0000000�0000000�00000001377�13771713062�0021023�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package function import ( "os" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // EnvFunc constructs a function that returns a string representation of the // env var behind a value var EnvFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "key", Type: cty.String, AllowNull: false, AllowUnknown: false, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { key := args[0].AsString() value := os.Getenv(key) return cty.StringVal(value), nil }, }) // Env returns a string representation of the env var behind key. func Env(key cty.Value) (cty.Value, error) { return EnvFunc.Call([]cty.Value{key}) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/function/length.go����������������������������������������������������0000664�0000000�0000000�00000003646�13771713062�0021515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package function import ( "errors" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/function/stdlib" ) var LengthFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "value", Type: cty.DynamicPseudoType, AllowDynamicType: true, AllowUnknown: true, }, }, Type: func(args []cty.Value) (cty.Type, error) { collTy := args[0].Type() switch { case collTy == cty.String || collTy.IsTupleType() || collTy.IsObjectType() || collTy.IsListType() || collTy.IsMapType() || collTy.IsSetType() || collTy == cty.DynamicPseudoType: return cty.Number, nil default: return cty.Number, errors.New("argument must be a string, a collection type, or a structural type") } }, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { coll := args[0] collTy := args[0].Type() switch { case collTy == cty.DynamicPseudoType: return cty.UnknownVal(cty.Number), nil case collTy.IsTupleType(): l := len(collTy.TupleElementTypes()) return cty.NumberIntVal(int64(l)), nil case collTy.IsObjectType(): l := len(collTy.AttributeTypes()) return cty.NumberIntVal(int64(l)), nil case collTy == cty.String: // We'll delegate to the cty stdlib strlen function here, because // it deals with all of the complexities of tokenizing unicode // grapheme clusters. return stdlib.Strlen(coll) case collTy.IsListType() || collTy.IsSetType() || collTy.IsMapType(): return coll.Length(), nil default: // Should never happen, because of the checks in our Type func above return cty.UnknownVal(cty.Number), errors.New("impossible value type for length(...)") } }, }) // Length returns the number of elements in the given collection or number of // Unicode characters in the given string. func Length(collection cty.Value) (cty.Value, error) { return LengthFunc.Call([]cty.Value{collection}) } ������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/function/length_test.go�����������������������������������������������0000664�0000000�0000000�00000005230�13771713062�0022543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package function import ( "fmt" "testing" "github.com/zclconf/go-cty/cty" ) func TestLength(t *testing.T) { tests := []struct { Value cty.Value Want cty.Value }{ { cty.ListValEmpty(cty.Number), cty.NumberIntVal(0), }, { cty.ListVal([]cty.Value{cty.True}), cty.NumberIntVal(1), }, { cty.ListVal([]cty.Value{cty.UnknownVal(cty.Bool)}), cty.NumberIntVal(1), }, { cty.SetValEmpty(cty.Number), cty.NumberIntVal(0), }, { cty.SetVal([]cty.Value{cty.True}), cty.NumberIntVal(1), }, { cty.MapValEmpty(cty.Bool), cty.NumberIntVal(0), }, { cty.MapVal(map[string]cty.Value{"hello": cty.True}), cty.NumberIntVal(1), }, { cty.EmptyTupleVal, cty.NumberIntVal(0), }, { cty.UnknownVal(cty.EmptyTuple), cty.NumberIntVal(0), }, { cty.TupleVal([]cty.Value{cty.True}), cty.NumberIntVal(1), }, { cty.EmptyObjectVal, cty.NumberIntVal(0), }, { cty.UnknownVal(cty.EmptyObject), cty.NumberIntVal(0), }, { cty.ObjectVal(map[string]cty.Value{"true": cty.True}), cty.NumberIntVal(1), }, { cty.UnknownVal(cty.List(cty.Bool)), cty.UnknownVal(cty.Number), }, { cty.DynamicVal, cty.UnknownVal(cty.Number), }, { cty.StringVal("hello"), cty.NumberIntVal(5), }, { cty.StringVal(""), cty.NumberIntVal(0), }, { cty.StringVal("1"), cty.NumberIntVal(1), }, { cty.StringVal("Живой Журнал"), cty.NumberIntVal(12), }, { // note that the dieresis here is intentionally a combining // ligature. cty.StringVal("noël"), cty.NumberIntVal(4), }, { // The Es in this string has three combining acute accents. // This tests something that NFC-normalization cannot collapse // into a single precombined codepoint, since otherwise we might // be cheating and relying on the single-codepoint forms. cty.StringVal("wé́́é́́é́́!"), cty.NumberIntVal(5), }, { // Go's normalization forms don't handle this ligature, so we // will produce the wrong result but this is now a compatibility // constraint and so we'll test it. cty.StringVal("baffle"), cty.NumberIntVal(4), }, { cty.StringVal("😸😾"), cty.NumberIntVal(2), }, { cty.UnknownVal(cty.String), cty.UnknownVal(cty.Number), }, { cty.DynamicVal, cty.UnknownVal(cty.Number), }, } for _, test := range tests { t.Run(fmt.Sprintf("Length(%#v)", test.Value), func(t *testing.T) { got, err := Length(test.Value) if err != nil { t.Fatalf("unexpected error: %s", err) } if !got.RawEquals(test.Want) { t.Errorf("wrong result\ngot: %#v\nwant: %#v", got, test.Want) } }) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/function/vault.go�����������������������������������������������������0000664�0000000�0000000�00000001245�13771713062�0021360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package function import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" commontpl "github.com/hashicorp/packer/packer-plugin-sdk/template" ) // VaultFunc constructs a function that retrieves KV secrets from HC vault var VaultFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, { Name: "key", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { path := args[0].AsString() key := args[1].AsString() val, err := commontpl.Vault(path, key) return cty.StringVal(val), err }, }) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/functions.go����������������������������������������������������������0000664�0000000�0000000�00000012073�13771713062�0020411�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "github.com/hashicorp/go-cty-funcs/cidr" "github.com/hashicorp/go-cty-funcs/collection" "github.com/hashicorp/go-cty-funcs/crypto" "github.com/hashicorp/go-cty-funcs/encoding" "github.com/hashicorp/go-cty-funcs/filesystem" "github.com/hashicorp/go-cty-funcs/uuid" "github.com/hashicorp/hcl/v2/ext/tryfunc" "github.com/hashicorp/hcl/v2/ext/typeexpr" pkrfunction "github.com/hashicorp/packer/hcl2template/function" ctyyaml "github.com/zclconf/go-cty-yaml" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/function/stdlib" ) // Functions returns the set of functions that should be used to when // evaluating expressions in the receiving scope. // // basedir is used with file functions and allows a user to reference a file // using local path. Usually basedir is the directory in which the config file // is located // func Functions(basedir string) map[string]function.Function { funcs := map[string]function.Function{ "abs": stdlib.AbsoluteFunc, "abspath": filesystem.AbsPathFunc, "aws_secretsmanager": pkrfunction.AWSSecret, "basename": filesystem.BasenameFunc, "base64decode": encoding.Base64DecodeFunc, "base64encode": encoding.Base64EncodeFunc, "bcrypt": crypto.BcryptFunc, "can": tryfunc.CanFunc, "ceil": stdlib.CeilFunc, "chomp": stdlib.ChompFunc, "chunklist": stdlib.ChunklistFunc, "cidrhost": cidr.HostFunc, "cidrnetmask": cidr.NetmaskFunc, "cidrsubnet": cidr.SubnetFunc, "cidrsubnets": cidr.SubnetsFunc, "coalesce": collection.CoalesceFunc, "coalescelist": stdlib.CoalesceListFunc, "compact": stdlib.CompactFunc, "concat": stdlib.ConcatFunc, "consul_key": pkrfunction.ConsulFunc, "contains": stdlib.ContainsFunc, "convert": typeexpr.ConvertFunc, "csvdecode": stdlib.CSVDecodeFunc, "dirname": filesystem.DirnameFunc, "distinct": stdlib.DistinctFunc, "element": stdlib.ElementFunc, "file": filesystem.MakeFileFunc(basedir, false), "fileexists": filesystem.MakeFileExistsFunc(basedir), "fileset": filesystem.MakeFileSetFunc(basedir), "flatten": stdlib.FlattenFunc, "floor": stdlib.FloorFunc, "format": stdlib.FormatFunc, "formatdate": stdlib.FormatDateFunc, "formatlist": stdlib.FormatListFunc, "indent": stdlib.IndentFunc, "index": stdlib.IndexFunc, "join": stdlib.JoinFunc, "jsondecode": stdlib.JSONDecodeFunc, "jsonencode": stdlib.JSONEncodeFunc, "keys": stdlib.KeysFunc, "length": pkrfunction.LengthFunc, "log": stdlib.LogFunc, "lookup": stdlib.LookupFunc, "lower": stdlib.LowerFunc, "max": stdlib.MaxFunc, "md5": crypto.Md5Func, "merge": stdlib.MergeFunc, "min": stdlib.MinFunc, "parseint": stdlib.ParseIntFunc, "pathexpand": filesystem.PathExpandFunc, "pow": stdlib.PowFunc, "range": stdlib.RangeFunc, "reverse": stdlib.ReverseListFunc, "replace": stdlib.ReplaceFunc, "regex_replace": stdlib.RegexReplaceFunc, "rsadecrypt": crypto.RsaDecryptFunc, "setintersection": stdlib.SetIntersectionFunc, "setproduct": stdlib.SetProductFunc, "setunion": stdlib.SetUnionFunc, "sha1": crypto.Sha1Func, "sha256": crypto.Sha256Func, "sha512": crypto.Sha512Func, "signum": stdlib.SignumFunc, "slice": stdlib.SliceFunc, "sort": stdlib.SortFunc, "split": stdlib.SplitFunc, "strrev": stdlib.ReverseFunc, "substr": stdlib.SubstrFunc, "timestamp": pkrfunction.TimestampFunc, "timeadd": stdlib.TimeAddFunc, "title": stdlib.TitleFunc, "trim": stdlib.TrimFunc, "trimprefix": stdlib.TrimPrefixFunc, "trimspace": stdlib.TrimSpaceFunc, "trimsuffix": stdlib.TrimSuffixFunc, "try": tryfunc.TryFunc, "upper": stdlib.UpperFunc, "urlencode": encoding.URLEncodeFunc, "uuidv4": uuid.V4Func, "uuidv5": uuid.V5Func, "values": stdlib.ValuesFunc, "vault": pkrfunction.VaultFunc, "yamldecode": ctyyaml.YAMLDecodeFunc, "yamlencode": ctyyaml.YAMLEncodeFunc, "zipmap": stdlib.ZipmapFunc, } return funcs } var unimplFunc = function.New(&function.Spec{ Type: func([]cty.Value) (cty.Type, error) { return cty.DynamicPseudoType, fmt.Errorf("function not yet implemented") }, Impl: func([]cty.Value, cty.Type) (cty.Value, error) { return cty.DynamicVal, fmt.Errorf("function not yet implemented") }, }) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/internal/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017663�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/internal/mock.go������������������������������������������������������0000664�0000000�0000000�00000007750�13771713062�0021154�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag package hcl2template import ( "context" "time" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/json" ) type NestedMockConfig struct { String string `mapstructure:"string"` Int int `mapstructure:"int"` Int64 int64 `mapstructure:"int64"` Bool bool `mapstructure:"bool"` Trilean config.Trilean `mapstructure:"trilean"` Duration time.Duration `mapstructure:"duration"` MapStringString map[string]string `mapstructure:"map_string_string"` SliceString []string `mapstructure:"slice_string"` SliceSliceString [][]string `mapstructure:"slice_slice_string"` NamedMapStringString NamedMapStringString `mapstructure:"named_map_string_string"` NamedString NamedString `mapstructure:"named_string"` Tags []MockTag `mapstructure:"tag"` } type MockTag struct { Key string `mapstructure:"key"` Value string `mapstructure:"value"` } type MockConfig struct { NotSquashed string `mapstructure:"not_squashed"` NestedMockConfig `mapstructure:",squash"` Nested NestedMockConfig `mapstructure:"nested"` NestedSlice []NestedMockConfig `mapstructure:"nested_slice"` } func (b *MockConfig) Prepare(raws ...interface{}) error { for i, raw := range raws { cval, ok := raw.(cty.Value) if !ok { continue } b, err := json.Marshal(cval, cty.DynamicPseudoType) if err != nil { return err } ccval, err := json.Unmarshal(b, cty.DynamicPseudoType) if err != nil { return err } raws[i] = ccval } return config.Decode(b, &config.DecodeOpts{ Interpolate: true, }, raws...) } ////// // MockBuilder ////// type MockBuilder struct { Config MockConfig } var _ packersdk.Builder = new(MockBuilder) func (b *MockBuilder) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() } func (b *MockBuilder) Prepare(raws ...interface{}) ([]string, []string, error) { return []string{"ID"}, nil, b.Config.Prepare(raws...) } func (b *MockBuilder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { return nil, nil } ////// // MockProvisioner ////// type MockProvisioner struct { Config MockConfig } var _ packersdk.Provisioner = new(MockProvisioner) func (b *MockProvisioner) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() } func (b *MockProvisioner) Prepare(raws ...interface{}) error { return b.Config.Prepare(raws...) } func (b *MockProvisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, _ map[string]interface{}) error { return nil } ////// // MockPostProcessor ////// type MockPostProcessor struct { Config MockConfig } var _ packersdk.PostProcessor = new(MockPostProcessor) func (b *MockPostProcessor) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() } func (b *MockPostProcessor) Configure(raws ...interface{}) error { return b.Config.Prepare(raws...) } func (b *MockPostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { return nil, false, false, nil } ////// // MockCommunicator ////// type MockCommunicator struct { Config MockConfig packersdk.Communicator } var _ packersdk.ConfigurableCommunicator = new(MockCommunicator) func (b *MockCommunicator) ConfigSpec() hcldec.ObjectSpec { return b.Config.FlatMapstructure().HCL2Spec() } func (b *MockCommunicator) Configure(raws ...interface{}) ([]string, error) { return nil, b.Config.Prepare(raws...) } ////// // Utils ////// type NamedMapStringString map[string]string type NamedString string ������������������������packer-1.6.6+ds1/hcl2template/internal/mock.hcl2spec.go���������������������������������������������0000664�0000000�0000000�00000021035�13771713062�0022646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type MockConfig,NestedMockConfig,MockTag"; DO NOT EDIT. package hcl2template import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatMockConfig is an auto-generated flat version of MockConfig. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatMockConfig struct { NotSquashed *string `mapstructure:"not_squashed" cty:"not_squashed" hcl:"not_squashed"` String *string `mapstructure:"string" cty:"string" hcl:"string"` Int *int `mapstructure:"int" cty:"int" hcl:"int"` Int64 *int64 `mapstructure:"int64" cty:"int64" hcl:"int64"` Bool *bool `mapstructure:"bool" cty:"bool" hcl:"bool"` Trilean *bool `mapstructure:"trilean" cty:"trilean" hcl:"trilean"` Duration *string `mapstructure:"duration" cty:"duration" hcl:"duration"` MapStringString map[string]string `mapstructure:"map_string_string" cty:"map_string_string" hcl:"map_string_string"` SliceString []string `mapstructure:"slice_string" cty:"slice_string" hcl:"slice_string"` SliceSliceString [][]string `mapstructure:"slice_slice_string" cty:"slice_slice_string" hcl:"slice_slice_string"` NamedMapStringString NamedMapStringString `mapstructure:"named_map_string_string" cty:"named_map_string_string" hcl:"named_map_string_string"` NamedString *NamedString `mapstructure:"named_string" cty:"named_string" hcl:"named_string"` Tags []FlatMockTag `mapstructure:"tag" cty:"tag" hcl:"tag"` Nested *FlatNestedMockConfig `mapstructure:"nested" cty:"nested" hcl:"nested"` NestedSlice []FlatNestedMockConfig `mapstructure:"nested_slice" cty:"nested_slice" hcl:"nested_slice"` } // FlatMapstructure returns a new FlatMockConfig. // FlatMockConfig is an auto-generated flat version of MockConfig. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*MockConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatMockConfig) } // HCL2Spec returns the hcl spec of a MockConfig. // This spec is used by HCL to read the fields of MockConfig. // The decoded values from this spec will then be applied to a FlatMockConfig. func (*FlatMockConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "not_squashed": &hcldec.AttrSpec{Name: "not_squashed", Type: cty.String, Required: false}, "string": &hcldec.AttrSpec{Name: "string", Type: cty.String, Required: false}, "int": &hcldec.AttrSpec{Name: "int", Type: cty.Number, Required: false}, "int64": &hcldec.AttrSpec{Name: "int64", Type: cty.Number, Required: false}, "bool": &hcldec.AttrSpec{Name: "bool", Type: cty.Bool, Required: false}, "trilean": &hcldec.AttrSpec{Name: "trilean", Type: cty.Bool, Required: false}, "duration": &hcldec.AttrSpec{Name: "duration", Type: cty.String, Required: false}, "map_string_string": &hcldec.AttrSpec{Name: "map_string_string", Type: cty.Map(cty.String), Required: false}, "slice_string": &hcldec.AttrSpec{Name: "slice_string", Type: cty.List(cty.String), Required: false}, "slice_slice_string": &hcldec.AttrSpec{Name: "slice_slice_string", Type: cty.List(cty.List(cty.String)), Required: false}, "named_map_string_string": &hcldec.AttrSpec{Name: "named_map_string_string", Type: cty.Map(cty.String), Required: false}, "named_string": &hcldec.AttrSpec{Name: "named_string", Type: cty.String, Required: false}, "tag": &hcldec.BlockListSpec{TypeName: "tag", Nested: hcldec.ObjectSpec((*FlatMockTag)(nil).HCL2Spec())}, "nested": &hcldec.BlockSpec{TypeName: "nested", Nested: hcldec.ObjectSpec((*FlatNestedMockConfig)(nil).HCL2Spec())}, "nested_slice": &hcldec.BlockListSpec{TypeName: "nested_slice", Nested: hcldec.ObjectSpec((*FlatNestedMockConfig)(nil).HCL2Spec())}, } return s } // FlatMockTag is an auto-generated flat version of MockTag. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatMockTag struct { Key *string `mapstructure:"key" cty:"key" hcl:"key"` Value *string `mapstructure:"value" cty:"value" hcl:"value"` } // FlatMapstructure returns a new FlatMockTag. // FlatMockTag is an auto-generated flat version of MockTag. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*MockTag) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatMockTag) } // HCL2Spec returns the hcl spec of a MockTag. // This spec is used by HCL to read the fields of MockTag. // The decoded values from this spec will then be applied to a FlatMockTag. func (*FlatMockTag) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "key": &hcldec.AttrSpec{Name: "key", Type: cty.String, Required: false}, "value": &hcldec.AttrSpec{Name: "value", Type: cty.String, Required: false}, } return s } // FlatNestedMockConfig is an auto-generated flat version of NestedMockConfig. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatNestedMockConfig struct { String *string `mapstructure:"string" cty:"string" hcl:"string"` Int *int `mapstructure:"int" cty:"int" hcl:"int"` Int64 *int64 `mapstructure:"int64" cty:"int64" hcl:"int64"` Bool *bool `mapstructure:"bool" cty:"bool" hcl:"bool"` Trilean *bool `mapstructure:"trilean" cty:"trilean" hcl:"trilean"` Duration *string `mapstructure:"duration" cty:"duration" hcl:"duration"` MapStringString map[string]string `mapstructure:"map_string_string" cty:"map_string_string" hcl:"map_string_string"` SliceString []string `mapstructure:"slice_string" cty:"slice_string" hcl:"slice_string"` SliceSliceString [][]string `mapstructure:"slice_slice_string" cty:"slice_slice_string" hcl:"slice_slice_string"` NamedMapStringString NamedMapStringString `mapstructure:"named_map_string_string" cty:"named_map_string_string" hcl:"named_map_string_string"` NamedString *NamedString `mapstructure:"named_string" cty:"named_string" hcl:"named_string"` Tags []FlatMockTag `mapstructure:"tag" cty:"tag" hcl:"tag"` } // FlatMapstructure returns a new FlatNestedMockConfig. // FlatNestedMockConfig is an auto-generated flat version of NestedMockConfig. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*NestedMockConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatNestedMockConfig) } // HCL2Spec returns the hcl spec of a NestedMockConfig. // This spec is used by HCL to read the fields of NestedMockConfig. // The decoded values from this spec will then be applied to a FlatNestedMockConfig. func (*FlatNestedMockConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "string": &hcldec.AttrSpec{Name: "string", Type: cty.String, Required: false}, "int": &hcldec.AttrSpec{Name: "int", Type: cty.Number, Required: false}, "int64": &hcldec.AttrSpec{Name: "int64", Type: cty.Number, Required: false}, "bool": &hcldec.AttrSpec{Name: "bool", Type: cty.Bool, Required: false}, "trilean": &hcldec.AttrSpec{Name: "trilean", Type: cty.Bool, Required: false}, "duration": &hcldec.AttrSpec{Name: "duration", Type: cty.String, Required: false}, "map_string_string": &hcldec.AttrSpec{Name: "map_string_string", Type: cty.Map(cty.String), Required: false}, "slice_string": &hcldec.AttrSpec{Name: "slice_string", Type: cty.List(cty.String), Required: false}, "slice_slice_string": &hcldec.AttrSpec{Name: "slice_slice_string", Type: cty.List(cty.List(cty.String)), Required: false}, "named_map_string_string": &hcldec.AttrSpec{Name: "named_map_string_string", Type: cty.Map(cty.String), Required: false}, "named_string": &hcldec.AttrSpec{Name: "named_string", Type: cty.String, Required: false}, "tag": &hcldec.BlockListSpec{TypeName: "tag", Nested: hcldec.ObjectSpec((*FlatMockTag)(nil).HCL2Spec())}, } return s } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/parser.go�������������������������������������������������������������0000664�0000000�0000000�00000023301�13771713062�0017671�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "os" "path/filepath" "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/ext/dynblock" "github.com/hashicorp/hcl/v2/hclparse" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" ) const ( packerLabel = "packer" sourceLabel = "source" variablesLabel = "variables" variableLabel = "variable" localsLabel = "locals" buildLabel = "build" communicatorLabel = "communicator" ) var configSchema = &hcl.BodySchema{ Blocks: []hcl.BlockHeaderSchema{ {Type: packerLabel}, {Type: sourceLabel, LabelNames: []string{"type", "name"}}, {Type: variablesLabel}, {Type: variableLabel, LabelNames: []string{"name"}}, {Type: localsLabel}, {Type: buildLabel}, {Type: communicatorLabel, LabelNames: []string{"type", "name"}}, }, } // packerBlockSchema is the schema for a top-level "packer" block in // a configuration file. var packerBlockSchema = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ {Name: "required_version"}, }, } // Parser helps you parse HCL folders. It will parse an hcl file or directory // and start builders, provisioners and post-processors to configure them with // the parsed HCL and then return a []packersdk.Build. Packer will use that list // of Builds to run everything in order. type Parser struct { CorePackerVersion *version.Version CorePackerVersionString string *hclparse.Parser BuilderSchemas packer.BuilderStore ProvisionersSchemas packer.ProvisionerStore PostProcessorsSchemas packer.PostProcessorStore } const ( hcl2FileExt = ".pkr.hcl" hcl2JsonFileExt = ".pkr.json" hcl2VarFileExt = ".pkrvars.hcl" hcl2VarJsonFileExt = ".pkrvars.json" hcl2AutoVarFileExt = ".auto.pkrvars.hcl" hcl2AutoVarJsonFileExt = ".auto.pkrvars.json" ) // Parse will Parse all HCL files in filename. Path can be a folder or a file. // // Parse will first Parse variables and then the rest; so that interpolation // can happen. // // Parse returns a PackerConfig that contains configuration layout of a packer // build; sources(builders)/provisioners/posts-processors will not be started // and their contents wont be verified; Most syntax errors will cause an error. func (p *Parser) Parse(filename string, varFiles []string, argVars map[string]string) (*PackerConfig, hcl.Diagnostics) { var files []*hcl.File var diags hcl.Diagnostics // parse config files if filename != "" { hclFiles, jsonFiles, moreDiags := GetHCL2Files(filename, hcl2FileExt, hcl2JsonFileExt) diags = append(diags, moreDiags...) if len(hclFiles)+len(jsonFiles) == 0 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Could not find any config file in " + filename, Detail: "A config file must be suffixed with `.pkr.hcl` or " + "`.pkr.json`. A folder can be referenced.", }) } for _, filename := range hclFiles { f, moreDiags := p.ParseHCLFile(filename) diags = append(diags, moreDiags...) files = append(files, f) } for _, filename := range jsonFiles { f, moreDiags := p.ParseJSONFile(filename) diags = append(diags, moreDiags...) files = append(files, f) } if diags.HasErrors() { return nil, diags } } basedir := filename if isDir, err := isDir(basedir); err == nil && !isDir { basedir = filepath.Dir(basedir) } wd, err := os.Getwd() if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Could not find current working directory", Detail: err.Error(), }) } cfg := &PackerConfig{ Basedir: basedir, Cwd: wd, CorePackerVersionString: p.CorePackerVersionString, builderSchemas: p.BuilderSchemas, provisionersSchemas: p.ProvisionersSchemas, postProcessorsSchemas: p.PostProcessorsSchemas, parser: p, files: files, } for _, file := range files { coreVersionConstraints, moreDiags := sniffCoreVersionRequirements(file.Body) cfg.Packer.VersionConstraints = append(cfg.Packer.VersionConstraints, coreVersionConstraints...) diags = append(diags, moreDiags...) } // Before we go further, we'll check to make sure this version can read // that file, so we can produce a version-related error message rather than // potentially-confusing downstream errors. versionDiags := cfg.CheckCoreVersionRequirements(p.CorePackerVersion) diags = append(diags, versionDiags...) if versionDiags.HasErrors() { return cfg, diags } // Decode variable blocks so that they are available later on. Here locals // can use input variables so we decode them firsthand. { for _, file := range files { diags = append(diags, cfg.decodeInputVariables(file)...) } for _, file := range files { moreLocals, morediags := cfg.parseLocalVariables(file) diags = append(diags, morediags...) cfg.LocalBlocks = append(cfg.LocalBlocks, moreLocals...) } } // parse var files { hclVarFiles, jsonVarFiles, moreDiags := GetHCL2Files(filename, hcl2AutoVarFileExt, hcl2AutoVarJsonFileExt) diags = append(diags, moreDiags...) for _, file := range varFiles { switch filepath.Ext(file) { case ".hcl": hclVarFiles = append(hclVarFiles, file) case ".json": jsonVarFiles = append(jsonVarFiles, file) default: diags = append(moreDiags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Could not guess format of " + file, Detail: "A var file must be suffixed with `.hcl` or `.json`.", }) } } var varFiles []*hcl.File for _, filename := range hclVarFiles { f, moreDiags := p.ParseHCLFile(filename) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } varFiles = append(varFiles, f) } for _, filename := range jsonVarFiles { f, moreDiags := p.ParseJSONFile(filename) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } varFiles = append(varFiles, f) } diags = append(diags, cfg.collectInputVariableValues(os.Environ(), varFiles, argVars)...) } return cfg, diags } // sniffCoreVersionRequirements does minimal parsing of the given body for // "packer" blocks with "required_version" attributes, returning the // requirements found. // // This is intended to maximize the chance that we'll be able to read the // requirements (syntax errors notwithstanding) even if the config file contains // constructs that might've been added in future versions // // This is a "best effort" sort of method which will return constraints it is // able to find, but may return no constraints at all if the given body is // so invalid that it cannot be decoded at all. func sniffCoreVersionRequirements(body hcl.Body) ([]VersionConstraint, hcl.Diagnostics) { var sniffRootSchema = &hcl.BodySchema{ Blocks: []hcl.BlockHeaderSchema{ { Type: packerLabel, }, }, } rootContent, _, diags := body.PartialContent(sniffRootSchema) var constraints []VersionConstraint for _, block := range rootContent.Blocks { content, blockDiags := block.Body.Content(packerBlockSchema) diags = append(diags, blockDiags...) attr, exists := content.Attributes["required_version"] if !exists { continue } constraint, constraintDiags := decodeVersionConstraint(attr) diags = append(diags, constraintDiags...) if !constraintDiags.HasErrors() { constraints = append(constraints, constraint) } } return constraints, diags } func (cfg *PackerConfig) Initialize() hcl.Diagnostics { var diags hcl.Diagnostics _, moreDiags := cfg.InputVariables.Values() diags = append(diags, moreDiags...) _, moreDiags = cfg.LocalVariables.Values() diags = append(diags, moreDiags...) diags = append(diags, cfg.evaluateLocalVariables(cfg.LocalBlocks)...) for _, variable := range cfg.InputVariables { if !variable.Sensitive { continue } value, _ := variable.Value() _ = cty.Walk(value, func(_ cty.Path, nested cty.Value) (bool, error) { if nested.IsWhollyKnown() && !nested.IsNull() && nested.Type().Equals(cty.String) { packersdk.LogSecretFilter.Set(nested.AsString()) } return true, nil }) } // decode the actual content for _, file := range cfg.files { diags = append(diags, cfg.parser.decodeConfig(file, cfg)...) } return diags } // decodeConfig looks in the found blocks for everything that is not a variable // block. It should be called after parsing input variables and locals so that // they can be referenced. func (p *Parser) decodeConfig(f *hcl.File, cfg *PackerConfig) hcl.Diagnostics { var diags hcl.Diagnostics body := dynblock.Expand(f.Body, cfg.EvalContext(nil)) content, moreDiags := body.Content(configSchema) diags = append(diags, moreDiags...) for _, block := range content.Blocks { switch block.Type { case sourceLabel: source, moreDiags := p.decodeSource(block) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } ref := source.Ref() if existing, found := cfg.Sources[ref]; found { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Duplicate " + sourceLabel + " block", Detail: fmt.Sprintf("This "+sourceLabel+" block has the "+ "same builder type and name as a previous block declared "+ "at %s. Each "+sourceLabel+" must have a unique name per builder type.", existing.block.DefRange.Ptr()), Subject: source.block.DefRange.Ptr(), }) continue } if cfg.Sources == nil { cfg.Sources = map[SourceRef]SourceBlock{} } cfg.Sources[ref] = source case buildLabel: build, moreDiags := p.decodeBuildConfig(block, cfg) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } cfg.Builds = append(cfg.Builds, build) } } return diags } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/repl/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017011�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/repl/format.go��������������������������������������������������������0000664�0000000�0000000�00000004037�13771713062�0020634�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package repl import ( "bufio" "bytes" "fmt" "sort" "strconv" "strings" ) // FormatResult formats the given result value for human-readable output. // // The value must currently be a string, list, map, and any nested values // with those same types. func FormatResult(value interface{}) string { return formatResult(value, false) } func formatResult(value interface{}, nested bool) string { if value == nil { return "null" } switch output := value.(type) { case string: if nested { return fmt.Sprintf("%q", output) } return output case int: return strconv.Itoa(output) case float64: return fmt.Sprintf("%g", output) case bool: switch { case output == true: return "true" default: return "false" } case []interface{}: return formatListResult(output) case map[string]interface{}: return formatMapResult(output) default: return "<unknown-type>" } } func formatListResult(value []interface{}) string { var outputBuf bytes.Buffer outputBuf.WriteString("[") if len(value) > 0 { outputBuf.WriteString("\n") } for _, v := range value { raw := formatResult(v, true) outputBuf.WriteString(indent(raw)) outputBuf.WriteString(",\n") } outputBuf.WriteString("]") return outputBuf.String() } func formatMapResult(value map[string]interface{}) string { ks := make([]string, 0, len(value)) for k := range value { ks = append(ks, k) } sort.Strings(ks) var outputBuf bytes.Buffer outputBuf.WriteString("{") if len(value) > 0 { outputBuf.WriteString("\n") } for _, k := range ks { v := value[k] rawK := formatResult(k, true) rawV := formatResult(v, true) outputBuf.WriteString(indent(fmt.Sprintf("%s = %s", rawK, rawV))) outputBuf.WriteString("\n") } outputBuf.WriteString("}") return outputBuf.String() } func indent(value string) string { var outputBuf bytes.Buffer s := bufio.NewScanner(strings.NewReader(value)) newline := false for s.Scan() { if newline { outputBuf.WriteByte('\n') } outputBuf.WriteString(" " + s.Text()) newline = true } return outputBuf.String() } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/repl/repl.go����������������������������������������������������������0000664�0000000�0000000�00000000311�13771713062�0020275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package repl provides the structs and functions necessary to run REPL for // HCL2. The REPL allows experimentation of HCL2 interpolations without having // to run a HCL2 configuration. package repl �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/shim/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017007�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/shim/values.go��������������������������������������������������������0000664�0000000�0000000�00000007703�13771713062�0020644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2shim import ( "fmt" "math/big" "github.com/zclconf/go-cty/cty" ) // UnknownVariableValue is a sentinel value that can be used // to denote that the value of a variable is unknown at this time. // RawConfig uses this information to build up data about // unknown keys. const UnknownVariableValue = "74D93920-ED26-11E3-AC10-0800200C9A66" // ConfigValueFromHCL2 converts a value from HCL2 (really, from the cty dynamic // types library that HCL2 uses) to a value type that matches what would've // been produced from the HCL-based interpolator for an equivalent structure. // // This function will transform a cty null value into a Go nil value, which // isn't a possible outcome of the HCL/HIL-based decoder and so callers may // need to detect and reject any null values. func ConfigValueFromHCL2(v cty.Value) interface{} { if !v.IsKnown() { return UnknownVariableValue } if v.IsNull() { return nil } switch v.Type() { case cty.Bool: return v.True() // like HCL.BOOL case cty.String: return v.AsString() // like HCL token.STRING or token.HEREDOC case cty.Number: // We can't match HCL _exactly_ here because it distinguishes between // int and float values, but we'll get as close as we can by using // an int if the number is exactly representable, and a float if not. // The conversion to float will force precision to that of a float64, // which is potentially losing information from the specific number // given, but no worse than what HCL would've done in its own conversion // to float. f := v.AsBigFloat() if i, acc := f.Int64(); acc == big.Exact { // if we're on a 32-bit system and the number is too big for 32-bit // int then we'll fall through here and use a float64. const MaxInt = int(^uint(0) >> 1) const MinInt = -MaxInt - 1 if i <= int64(MaxInt) && i >= int64(MinInt) { return int(i) // Like HCL token.NUMBER } } f64, _ := f.Float64() return f64 // like HCL token.FLOAT } if v.Type().IsListType() || v.Type().IsSetType() || v.Type().IsTupleType() { l := make([]interface{}, 0, v.LengthInt()) it := v.ElementIterator() for it.Next() { _, ev := it.Element() l = append(l, ConfigValueFromHCL2(ev)) } return l } if v.Type().IsMapType() || v.Type().IsObjectType() { l := make(map[string]interface{}) it := v.ElementIterator() for it.Next() { ek, ev := it.Element() cv := ConfigValueFromHCL2(ev) if cv != nil { l[ek.AsString()] = cv } } return l } // If we fall out here then we have some weird type that we haven't // accounted for. This should never happen unless the caller is using // capsule types, and we don't currently have any such types defined. panic(fmt.Errorf("can't convert %#v to config value", v)) } // HCL2ValueFromConfigValue is the opposite of ConfigValueFromHCL2: it takes // a value as would be returned from the old interpolator and turns it into // a cty.Value so it can be used within, for example, an HCL2 EvalContext. func HCL2ValueFromConfigValue(v interface{}) cty.Value { if v == nil { return cty.NullVal(cty.DynamicPseudoType) } if v == UnknownVariableValue { return cty.DynamicVal } switch tv := v.(type) { case bool: return cty.BoolVal(tv) case string: return cty.StringVal(tv) case int: return cty.NumberIntVal(int64(tv)) case float64: return cty.NumberFloatVal(tv) case []interface{}: vals := make([]cty.Value, len(tv)) for i, ev := range tv { vals[i] = HCL2ValueFromConfigValue(ev) } return cty.TupleVal(vals) case []string: vals := make([]cty.Value, len(tv)) for i, ev := range tv { vals[i] = cty.StringVal(ev) } return cty.ListVal(vals) case map[string]interface{}: vals := map[string]cty.Value{} for k, ev := range tv { vals[k] = HCL2ValueFromConfigValue(ev) } return cty.ObjectVal(vals) default: // HCL/HIL should never generate anything that isn't caught by // the above, so if we get here something has gone very wrong. panic(fmt.Errorf("can't convert %#v to cty.Value", v)) } } �������������������������������������������������������������packer-1.6.6+ds1/hcl2template/shim/values_test.go���������������������������������������������������0000664�0000000�0000000�00000003364�13771713062�0021702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2shim import ( "fmt" "reflect" "testing" "github.com/zclconf/go-cty/cty" ) func TestConfigValueFromHCL2(t *testing.T) { tests := []struct { Input cty.Value Want interface{} }{ { cty.True, true, }, { cty.False, false, }, { cty.NumberIntVal(12), int(12), }, { cty.NumberFloatVal(12.5), float64(12.5), }, { cty.StringVal("hello world"), "hello world", }, { cty.ObjectVal(map[string]cty.Value{ "name": cty.StringVal("Ermintrude"), "age": cty.NumberIntVal(19), "address": cty.ObjectVal(map[string]cty.Value{ "street": cty.ListVal([]cty.Value{cty.StringVal("421 Shoreham Loop")}), "city": cty.StringVal("Fridgewater"), "state": cty.StringVal("MA"), "zip": cty.StringVal("91037"), }), }), map[string]interface{}{ "name": "Ermintrude", "age": int(19), "address": map[string]interface{}{ "street": []interface{}{"421 Shoreham Loop"}, "city": "Fridgewater", "state": "MA", "zip": "91037", }, }, }, { cty.MapVal(map[string]cty.Value{ "foo": cty.StringVal("bar"), "bar": cty.StringVal("baz"), }), map[string]interface{}{ "foo": "bar", "bar": "baz", }, }, { cty.TupleVal([]cty.Value{ cty.StringVal("foo"), cty.True, }), []interface{}{ "foo", true, }, }, { cty.NullVal(cty.String), nil, }, { cty.UnknownVal(cty.String), UnknownVariableValue, }, } for _, test := range tests { t.Run(fmt.Sprintf("%#v", test.Input), func(t *testing.T) { got := ConfigValueFromHCL2(test.Input) if !reflect.DeepEqual(got, test.Want) { t.Errorf("wrong result\ninput: %#v\ngot: %#v\nwant: %#v", test.Input, got, test.Want) } }) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017660�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build.pkr.hcl/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022317�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build.pkr.hcl/basic.pkr.hcl����������������������������������0000664�0000000�0000000�00000004713�13771713062�0024670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.amazon-ebs.ubuntu-1604", "source.virtualbox-iso.ubuntu-1204", ] provisioner "shell" { string = lower("STRING") int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] } nested_slice { } } provisioner "file" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] } nested_slice { } } post-processor "amazon-import" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] } nested_slice { } } } �����������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020757�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/basic.pkr.hcl������������������������������������������0000664�0000000�0000000�00000006046�13771713062�0023331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.amazon-ebs.ubuntu-1604", "source.virtualbox-iso.ubuntu-1204", ] provisioner "shell" { string = coalesce(null, "", "string") int = "${41 + 1}" int64 = "${42 + 1}" bool = "true" trilean = true duration = "${9 + 1}s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } provisioner "file" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } post-processor "amazon-import" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/invalid_source_reference.pkr.hcl�����������������������0000664�0000000�0000000�00000000037�13771713062�0027266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { sources = ["ami"] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/named.pkr.hcl������������������������������������������0000664�0000000�0000000�00000000216�13771713062�0023325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������build { name = "somebuild" sources = [ "source.amazon-ebs.ubuntu-1604", "source.virtualbox-iso.ubuntu-1204", ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/post-processor_inexistent.pkr.hcl����������������������0000664�0000000�0000000�00000000107�13771713062�0027514�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { post-processor "inexistant" { foo = "bar" } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/post-processor_onlyexcept.pkr.hcl����������������������0000664�0000000�0000000�00000001175�13771713062�0027522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.virtualbox-iso.ubuntu-1204", ] source "source.amazon-ebs.ubuntu-1604" { name = "aws-ubuntu-16.04" } post-processor "amazon-import" { only = ["virtualbox-iso.ubuntu-1204"] } post-processor "manifest" { except = ["virtualbox-iso.ubuntu-1204"] } post-processor "amazon-import" { only = ["amazon-ebs.aws-ubuntu-16.04"] } post-processor "manifest" { except = ["amazon-ebs.aws-ubuntu-16.04"] } } source "virtualbox-iso" "ubuntu-1204" { } source "amazon-ebs" "ubuntu-1604" { } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/post-processor_untyped.pkr.hcl�������������������������0000664�0000000�0000000�00000000070�13771713062�0027011�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { post-process { foo = "bar" } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/provisioner_inexistent.pkr.hcl�������������������������0000664�0000000�0000000�00000000104�13771713062�0027066�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { provisioner "inexistant" { foo = "bar" } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/provisioner_onlyexcept.pkr.hcl�������������������������0000664�0000000�0000000�00000001131�13771713062�0027067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.virtualbox-iso.ubuntu-1204", ] source "source.amazon-ebs.ubuntu-1604" { name = "aws-ubuntu-16.04" } provisioner "shell" { only = ["virtualbox-iso.ubuntu-1204"] } provisioner "file" { except = ["virtualbox-iso.ubuntu-1204"] } provisioner "shell" { only = ["amazon-ebs.aws-ubuntu-16.04"] } provisioner "file" { except = ["amazon-ebs.aws-ubuntu-16.04"] } } source "virtualbox-iso" "ubuntu-1204" { } source "amazon-ebs" "ubuntu-1604" { } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/provisioner_paused_before_retry.pkr.hcl����������������0000664�0000000�0000000�00000000364�13771713062�0030734�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.virtualbox-iso.ubuntu-1204" ] provisioner "shell" { pause_before = "10s" max_retries = 5 } } source "virtualbox-iso" "ubuntu-1204" { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/provisioner_timeout.pkr.hcl����������������������������0000664�0000000�0000000�00000000327�13771713062�0026371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.virtualbox-iso.ubuntu-1204" ] provisioner "shell" { timeout = "10s" } } source "virtualbox-iso" "ubuntu-1204" { }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/build/provisioner_untyped.pkr.hcl����������������������������0000664�0000000�0000000�00000000065�13771713062�0026372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ build { provision { foo = "bar" } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/communicator/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022360�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/communicator/basic.pkr.hcl�����������������������������������0000664�0000000�0000000�00000001202�13771713062�0024717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ communicator "ssh" "vagrant" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] } nested_slice { } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/complete/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021470�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/complete/build.pkr.hcl���������������������������������������0000664�0000000�0000000�00000023715�13771713062�0024062�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.virtualbox-iso.ubuntu-1204", ] source "source.amazon-ebs.ubuntu-1604" { string = "setting from build section" } provisioner "shell" { name = "provisioner that does something" not_squashed = "${var.foo} ${upper(build.ID)}" string = "string" int = "${41 + 1}" int64 = "${42 + 1}" bool = "true" trilean = true duration = "${9 + 1}s" map_string_string = { a = "b" c = "d" } slice_string = [for s in var.availability_zone_names : lower(s)] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [for s in var.availability_zone_names : lower(s)] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { tag { key = "first_tag_key" value = "first_tag_value" } dynamic "tag" { for_each = local.standard_tags content { key = tag.key value = tag.value } } } } provisioner "file" { not_squashed = "${var.foo} ${upper(build.ID)}" string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = local.abc_map[*].id slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { tag { key = "first_tag_key" value = "first_tag_value" } dynamic "tag" { for_each = local.standard_tags content { key = tag.key value = tag.value } } } } post-processor "amazon-import" { name = "something" string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" keep_input_artifact = true map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } post-processor "amazon-import" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } post-processors { post-processor "amazon-import" { name = "first-nested-post-processor" string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } post-processor "amazon-import" { name = "second-nested-post-processor" string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } } post-processors { post-processor "amazon-import" { name = "third-nested-post-processor" string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } post-processor "amazon-import" { name = "fourth-nested-post-processor" string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] not_squashed = "${var.foo} ${upper(build.ID)}" nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } } } ���������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/complete/sources.pkr.hcl�������������������������������������0000664�0000000�0000000�00000003221�13771713062�0024434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ source "amazon-ebs" "ubuntu-1604" { int = 42 } source "virtualbox-iso" "ubuntu-1204" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/complete/variables.pkr.hcl�����������������������������������0000664�0000000�0000000�00000001044�13771713062�0024722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variables { foo = "value" // my_secret = "foo" // image_name = "foo-image-{{user `my_secret`}}" } variable "image_id" { type = string default = "image-id-default" } variable "port" { type = number default = 42 } variable "availability_zone_names" { type = list(string) default = ["A", "B", "C"] } locals { feefoo = "${var.foo}_${var.image_id}" } locals { standard_tags = { Component = "user-service" Environment = "production" } abc_map = [ {id = "a"}, {id = "b"}, {id = "c"}, ] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/empty/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021016�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/empty/.gitkeep�����������������������������������������������0000664�0000000�0000000�00000000000�13771713062�0022435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/format/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021150�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/format/formatted.pkr.hcl�������������������������������������0000664�0000000�0000000�00000004533�13771713062�0024425�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.amazon-ebs.ubuntu-1604", "source.virtualbox-iso.ubuntu-1204", ] provisioner "shell" { string = coalesce(null, "", "string") int = "${41 + 1}" int64 = "${42 + 1}" bool = "true" trilean = true duration = "${9 + 1}s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a", "b"], ["c", "d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a", "b"], ["c", "d"] ] } nested_slice { } } provisioner "file" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a", "b"], ["c", "d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a", "b"], ["c", "d"] ] } nested_slice { } } post-processor "amazon-import" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a", "b"], ["c", "d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a", "b"], ["c", "d"] ] } nested_slice { } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/format/unformatted.pkr.hcl�����������������������������������0000664�0000000�0000000�00000006037�13771713062�0024771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ // starts resources to provision them. build { sources = [ "source.amazon-ebs.ubuntu-1604", "source.virtualbox-iso.ubuntu-1204", ] provisioner "shell" { string = coalesce(null, "", "string") int = "${41 + 1}" int64 = "${42 + 1}" bool = "true" trilean = true duration = "${9 + 1}s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } provisioner "file" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } post-processor "amazon-import" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/format/unformatted.pkrvars.hcl�������������������������������0000664�0000000�0000000�00000000125�13771713062�0025655�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ami_filter_name ="amzn2-ami-hvm-*-x86_64-gp2" ami_filter_owners =[ "137112412989" ] �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/sources/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021343�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/sources/basic.pkr.hcl����������������������������������������0000664�0000000�0000000�00000003234�13771713062�0023711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// a source represents a reusable setting for a system boot/start. source "virtualbox-iso" "ubuntu-1204" { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] nested { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } nested_slice { string = "string" int = 42 int64 = 43 bool = true trilean = true duration = "10s" map_string_string = { a = "b" c = "d" } slice_string = [ "a", "b", "c", ] slice_slice_string = [ ["a","b"], ["c","d"] ] } }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/sources/duplicate.pkr.hcl������������������������������������0000664�0000000�0000000�00000000123�13771713062�0024574�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ source "virtualbox-iso" "ubuntu-1204" {} source "virtualbox-iso" "ubuntu-1204" {} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/sources/inexistent.pkr.hcl�����������������������������������0000664�0000000�0000000�00000000170�13771713062�0025016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// a source represents a reusable setting for a system boot/start. source "inexistant" "ubuntu-1204" { foo = "bar" }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/sources/unnamed.pkr.hcl��������������������������������������0000664�0000000�0000000�00000000156�13771713062�0024257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// a source represents a reusable setting for a system boot/start. source "virtualbox-iso" { foo = "bar" }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/sources/untyped.pkr.hcl��������������������������������������0000664�0000000�0000000�00000000135�13771713062�0024315�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// a source represents a reusable setting for a system boot/start. source { foo = "bar" }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/unknown/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021357�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/unknown/block_type.pkr.hcl�����������������������������������0000664�0000000�0000000�00000000014�13771713062�0024770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ potato { } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021630�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/basic.pkr.hcl��������������������������������������0000664�0000000�0000000�00000001132�13771713062�0024171�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variables { key = "value" my_secret = "foo" image_name = "foo-image-{{user `my_secret`}}" } variable "image_id" { type = string default = "image-id-default" } variable "port" { type = number default = 42 } variable "availability_zone_names" { type = list(string) default = ["us-west-1a"] description = <<POTATO Describing is awesome ;D POTATO } variable "super_secret_password" { type = string sensitive = true description = <<IMSENSIBLE Handle with care plz IMSENSIBLE default = null } locals { service_name = "forum" owner = "Community Team" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/complicated/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024114�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/complicated/a.pkr.hcl������������������������������0000664�0000000�0000000�00000000170�13771713062�0025615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������locals { for_var = "${local.name_prefix}" bar_var = [ local.for_var, local.foo, var.name_prefix, ] }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/complicated/b.pkr.hcl������������������������������0000664�0000000�0000000�00000000170�13771713062�0025616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������locals { name_prefix = "${var.name_prefix}" foo = "${local.name_prefix}" bar = local.name_prefix }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/complicated/c.pkr.hcl������������������������������0000664�0000000�0000000�00000000054�13771713062�0025620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variable "name_prefix" { default = "foo" }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/duplicate_variable.pkr.hcl�������������������������0000664�0000000�0000000�00000000143�13771713062�0026730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "boolean_value" { default = false } variable "boolean_value" { default = true } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/duplicate_variables.pkr.hcl������������������������0000664�0000000�0000000�00000000123�13771713062�0027111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variables { boolean_value = false } variables { boolean_value = true } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/empty.pkr.hcl��������������������������������������0000664�0000000�0000000�00000000000�13771713062�0024237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/foo-string.variable.pkr.hcl������������������������0000664�0000000�0000000�00000000071�13771713062�0026764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variable "foo" { type = string default = "bar" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/invalid_default.pkr.hcl����������������������������0000664�0000000�0000000�00000000113�13771713062�0026240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "broken_type" { type = list(string) default = true } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/provisioner_variable_decoding.pkr.hcl��������������0000664�0000000�0000000�00000000457�13771713062�0031201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variables { max_retries = "1" max_retries_int = 1 } source "null" "null-builder" { communicator = "none" } build { sources = [ "source.null.null-builder", ] provisioner "shell" { max_retries = var.max_retries_int } provisioner "shell" { max_retries = var.max_retries } }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/recursive_locals.pkr.hcl���������������������������0000664�0000000�0000000�00000000071�13771713062�0026455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������locals { first = local.second second = local.first }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/set-foo-too-wee.hcl��������������������������������0000664�0000000�0000000�00000000014�13771713062�0025244�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������foo = "wee" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/unknown_key.pkr.hcl��������������������������������0000664�0000000�0000000�00000000106�13771713062�0025457�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "broken_variable" { invalid = true default = true } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/unset_unused_string_variable.pkr.hcl���������������0000664�0000000�0000000�00000000234�13771713062�0031066�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "foo" { type = string } build { sources = [ "source.null.null-builder", ] } source "null" "null-builder" { communicator = "none" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/unset_used_string_variable.pkr.hcl�����������������0000664�0000000�0000000�00000000153�13771713062�0030523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "foo" { type = string } build { sources = [ "source.null.null-builder${var.foo}", ] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/validation/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023762�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/validation/invalid_default.pkr.hcl�����������������0000664�0000000�0000000�00000000402�13771713062�0030373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "image_id" { type = string default = "potato" validation { condition = length(var.image_id) > 4 && substr(var.image_id, 0, 4) == "ami-" error_message = "The image_id value must be a valid AMI id, starting with \"ami-\"." } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/validation/valid.pkr.hcl���������������������������0000664�0000000�0000000�00000000423�13771713062�0026343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "image_id" { type = string default = "ami-something-something" validation { condition = length(var.image_id) > 4 && substr(var.image_id, 0, 4) == "ami-" error_message = "The image_id value must be a valid AMI id, starting with \"ami-\"." } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/validation/valid_map/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025716�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/validation/valid_map/definition.pkr.hcl������������0000664�0000000�0000000�00000000672�13771713062�0031336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ variable "image_metadata" { default = { key: "value", something: { foo: "bar", } } validation { condition = length(var.image_metadata.key) > 4 error_message = "The image_metadata.key field must be more than 4 runes." } validation { condition = substr(var.image_metadata.something.foo, 0, 3) == "bar" error_message = "The image_metadata.something.foo field must start with \"bar\"." } } ����������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/testdata/variables/validation/valid_map/invalid_value.auto.pkrvars.hcl0000664�0000000�0000000�00000000112�13771713062�0033660�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ image_metadata = { key: "value", something: { foo: "woo", } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.build.from.go���������������������������������������������������0000664�0000000�0000000�00000000437�13771713062�0021606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "strings" ) func sourceRefFromString(in string) SourceRef { args := strings.Split(in, ".") if len(args) < 2 { return NoSource } if len(args) > 2 { // source.type.name args = args[1:] } return SourceRef{ Type: args[0], Name: args[1], } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.build.go��������������������������������������������������������0000664�0000000�0000000�00000011047�13771713062�0020643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" "github.com/hashicorp/hcl/v2/hclsyntax" ) const ( buildFromLabel = "from" buildSourceLabel = "source" buildProvisionerLabel = "provisioner" buildPostProcessorLabel = "post-processor" buildPostProcessorsLabel = "post-processors" ) var buildSchema = &hcl.BodySchema{ Blocks: []hcl.BlockHeaderSchema{ {Type: buildFromLabel, LabelNames: []string{"type"}}, {Type: sourceLabel, LabelNames: []string{"reference"}}, {Type: buildProvisionerLabel, LabelNames: []string{"type"}}, {Type: buildPostProcessorLabel, LabelNames: []string{"type"}}, {Type: buildPostProcessorsLabel, LabelNames: []string{}}, }, } var postProcessorsSchema = &hcl.BodySchema{ Blocks: []hcl.BlockHeaderSchema{ {Type: buildPostProcessorLabel, LabelNames: []string{"type"}}, }, } // BuildBlock references an HCL 'build' block and it content, for example : // // build { // sources = [ // ... // ] // provisioner "" { ... } // post-processor "" { ... } // } type BuildBlock struct { // Name is a string representing the named build to show in the logs Name string // A description of what this build does, it could be used in a inspect // call for example. Description string // Sources is the list of sources that we want to start in this build block. Sources []SourceRef // ProvisionerBlocks references a list of HCL provisioner block that will // will be ran against the sources. ProvisionerBlocks []*ProvisionerBlock // PostProcessorLists references the lists of lists of HCL post-processors // block that will be run against the artifacts from the provisioning // steps. PostProcessorsLists [][]*PostProcessorBlock HCL2Ref HCL2Ref } type Builds []*BuildBlock // decodeBuildConfig is called when a 'build' block has been detected. It will // load the references to the contents of the build block. func (p *Parser) decodeBuildConfig(block *hcl.Block, cfg *PackerConfig) (*BuildBlock, hcl.Diagnostics) { build := &BuildBlock{} var b struct { Name string `hcl:"name,optional"` Description string `hcl:"description,optional"` FromSources []string `hcl:"sources,optional"` Config hcl.Body `hcl:",remain"` } diags := gohcl.DecodeBody(block.Body, nil, &b) if diags.HasErrors() { return nil, diags } build.Name = b.Name build.Description = b.Description for _, buildFrom := range b.FromSources { ref := sourceRefFromString(buildFrom) if ref == NoSource || !hclsyntax.ValidIdentifier(ref.Type) || !hclsyntax.ValidIdentifier(ref.Name) { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid " + sourceLabel + " reference", Detail: "A " + sourceLabel + " type is made of three parts that are" + "split by a dot `.`; each part must start with a letter and " + "may contain only letters, digits, underscores, and dashes." + "A valid source reference looks like: `source.type.name`", Subject: block.DefRange.Ptr(), }) continue } build.Sources = append(build.Sources, ref) } content, moreDiags := b.Config.Content(buildSchema) diags = append(diags, moreDiags...) if diags.HasErrors() { return nil, diags } for _, block := range content.Blocks { switch block.Type { case sourceLabel: ref, moreDiags := p.decodeBuildSource(block) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } build.Sources = append(build.Sources, ref) case buildProvisionerLabel: p, moreDiags := p.decodeProvisioner(block, cfg) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } build.ProvisionerBlocks = append(build.ProvisionerBlocks, p) case buildPostProcessorLabel: pp, moreDiags := p.decodePostProcessor(block) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } build.PostProcessorsLists = append(build.PostProcessorsLists, []*PostProcessorBlock{pp}) case buildPostProcessorsLabel: content, moreDiags := block.Body.Content(postProcessorsSchema) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } errored := false postProcessors := []*PostProcessorBlock{} for _, block := range content.Blocks { pp, moreDiags := p.decodePostProcessor(block) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { errored = true break } postProcessors = append(postProcessors, pp) } if errored == false { build.PostProcessorsLists = append(build.PostProcessorsLists, postProcessors) } } } return build, diags } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.build.post-processor.go�����������������������������������������0000664�0000000�0000000�00000005354�13771713062�0023650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // ProvisionerBlock references a detected but unparsed post processor type PostProcessorBlock struct { PType string PName string OnlyExcept OnlyExcept KeepInputArtifact *bool HCL2Ref } func (p *PostProcessorBlock) String() string { return fmt.Sprintf(buildPostProcessorLabel+"-block %q %q", p.PType, p.PName) } func (p *Parser) decodePostProcessor(block *hcl.Block) (*PostProcessorBlock, hcl.Diagnostics) { var b struct { Name string `hcl:"name,optional"` Only []string `hcl:"only,optional"` Except []string `hcl:"except,optional"` KeepInputArtifact *bool `hcl:"keep_input_artifact,optional"` Rest hcl.Body `hcl:",remain"` } diags := gohcl.DecodeBody(block.Body, nil, &b) if diags.HasErrors() { return nil, diags } postProcessor := &PostProcessorBlock{ PType: block.Labels[0], PName: b.Name, OnlyExcept: OnlyExcept{Only: b.Only, Except: b.Except}, HCL2Ref: newHCL2Ref(block, b.Rest), KeepInputArtifact: b.KeepInputArtifact, } diags = diags.Extend(postProcessor.OnlyExcept.Validate()) if diags.HasErrors() { return nil, diags } if !p.PostProcessorsSchemas.Has(postProcessor.PType) { diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildPostProcessorLabel+" type %q", postProcessor.PType), Subject: block.LabelRanges[0].Ptr(), Detail: fmt.Sprintf("known "+buildPostProcessorLabel+"s: %v", p.PostProcessorsSchemas.List()), Severity: hcl.DiagError, }) return nil, diags } return postProcessor, diags } func (cfg *PackerConfig) startPostProcessor(source SourceBlock, pp *PostProcessorBlock, ectx *hcl.EvalContext) (packersdk.PostProcessor, hcl.Diagnostics) { // ProvisionerBlock represents a detected but unparsed provisioner var diags hcl.Diagnostics postProcessor, err := cfg.postProcessorsSchemas.Start(pp.PType) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Failed loading %s", pp.PType), Subject: pp.DefRange.Ptr(), Detail: err.Error(), }) return nil, diags } hclPostProcessor := &HCL2PostProcessor{ PostProcessor: postProcessor, postProcessorBlock: pp, evalContext: ectx, builderVariables: source.builderVariables(), } err = hclPostProcessor.HCL2Prepare(nil) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Failed preparing %s", pp), Detail: err.Error(), Subject: pp.DefRange.Ptr(), }) return nil, diags } return hclPostProcessor, diags } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.build.provisioners.go�������������������������������������������0000664�0000000�0000000�00000011601�13771713062�0023400�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "time" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" hcl2shim "github.com/hashicorp/packer/hcl2template/shim" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" ) // OnlyExcept is a struct that is meant to be embedded that contains the // logic required for "only" and "except" meta-parameters. type OnlyExcept struct { Only []string `json:"only,omitempty"` Except []string `json:"except,omitempty"` } // Skip says whether or not to skip the build with the given name. func (o *OnlyExcept) Skip(n string) bool { if len(o.Only) > 0 { for _, v := range o.Only { if v == n { return false } } return true } if len(o.Except) > 0 { for _, v := range o.Except { if v == n { return true } } return false } return false } // Validate validates that the OnlyExcept settings are correct for a thing. func (o *OnlyExcept) Validate() hcl.Diagnostics { var diags hcl.Diagnostics if len(o.Only) > 0 && len(o.Except) > 0 { diags = diags.Append(&hcl.Diagnostic{ Summary: "only one of 'only' or 'except' may be specified", Severity: hcl.DiagError, }) } return diags } // ProvisionerBlock references a detected but unparsed provisioner type ProvisionerBlock struct { PType string PName string PauseBefore time.Duration MaxRetries int Timeout time.Duration Override map[string]interface{} OnlyExcept OnlyExcept HCL2Ref } func (p *ProvisionerBlock) String() string { return fmt.Sprintf(buildProvisionerLabel+"-block %q %q", p.PType, p.PName) } func (p *Parser) decodeProvisioner(block *hcl.Block, cfg *PackerConfig) (*ProvisionerBlock, hcl.Diagnostics) { var b struct { Name string `hcl:"name,optional"` PauseBefore string `hcl:"pause_before,optional"` MaxRetries int `hcl:"max_retries,optional"` Timeout string `hcl:"timeout,optional"` Only []string `hcl:"only,optional"` Except []string `hcl:"except,optional"` Override cty.Value `hcl:"override,optional"` Rest hcl.Body `hcl:",remain"` } diags := gohcl.DecodeBody(block.Body, cfg.EvalContext(nil), &b) if diags.HasErrors() { return nil, diags } provisioner := &ProvisionerBlock{ PType: block.Labels[0], PName: b.Name, MaxRetries: b.MaxRetries, OnlyExcept: OnlyExcept{Only: b.Only, Except: b.Except}, HCL2Ref: newHCL2Ref(block, b.Rest), } diags = diags.Extend(provisioner.OnlyExcept.Validate()) if diags.HasErrors() { return nil, diags } if !b.Override.IsNull() { override := make(map[string]interface{}) for buildName, overrides := range b.Override.AsValueMap() { buildOverrides := make(map[string]interface{}) for option, value := range overrides.AsValueMap() { buildOverrides[option] = hcl2shim.ConfigValueFromHCL2(value) } override[buildName] = buildOverrides } provisioner.Override = override } if b.PauseBefore != "" { pauseBefore, err := time.ParseDuration(b.PauseBefore) if err != nil { return nil, append(diags, &hcl.Diagnostic{ Summary: "Failed to parse pause_before duration", Detail: err.Error(), }) } provisioner.PauseBefore = pauseBefore } if b.Timeout != "" { timeout, err := time.ParseDuration(b.Timeout) if err != nil { return nil, append(diags, &hcl.Diagnostic{ Summary: "Failed to parse timeout duration", Detail: err.Error(), }) } provisioner.Timeout = timeout } if !p.ProvisionersSchemas.Has(provisioner.PType) { diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Unknown "+buildProvisionerLabel+" type %q", provisioner.PType), Subject: block.LabelRanges[0].Ptr(), Detail: fmt.Sprintf("known "+buildProvisionerLabel+"s: %v", p.ProvisionersSchemas.List()), Severity: hcl.DiagError, }) return nil, diags } return provisioner, diags } func (cfg *PackerConfig) startProvisioner(source SourceBlock, pb *ProvisionerBlock, ectx *hcl.EvalContext) (packersdk.Provisioner, hcl.Diagnostics) { var diags hcl.Diagnostics provisioner, err := cfg.provisionersSchemas.Start(pb.PType) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("failed loading %s", pb.PType), Subject: pb.HCL2Ref.LabelsRanges[0].Ptr(), Detail: err.Error(), }) return nil, diags } hclProvisioner := &HCL2Provisioner{ Provisioner: provisioner, provisionerBlock: pb, evalContext: ectx, builderVariables: source.builderVariables(), } if pb.Override != nil { if override, ok := pb.Override[source.name()]; ok { hclProvisioner.override = override.(map[string]interface{}) } } err = hclProvisioner.HCL2Prepare(nil) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Failed preparing %s", pb), Detail: err.Error(), Subject: pb.HCL2Ref.DefRange.Ptr(), }) return nil, diags } return hclProvisioner, diags } �������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.build_test.go���������������������������������������������������0000664�0000000�0000000�00000021501�13771713062�0021676�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "path/filepath" "testing" . "github.com/hashicorp/packer/hcl2template/internal" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestParse_build(t *testing.T) { defaultParser := getBasicParser() tests := []parseTest{ {"basic build no src", defaultParser, parseTestArgs{"testdata/build/basic.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Builds: Builds{ &BuildBlock{ Sources: []SourceRef{ { Type: "amazon-ebs", Name: "ubuntu-1604", }, refVBIsoUbuntu1204, }, ProvisionerBlocks: []*ProvisionerBlock{ { PType: "shell", }, { PType: "file", }, }, PostProcessorsLists: [][]*PostProcessorBlock{ { { PType: "amazon-import", }, }, }, }, }, }, false, false, []packersdk.Build{}, true, }, {"untyped provisioner", defaultParser, parseTestArgs{"testdata/build/provisioner_untyped.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Builds: nil, }, true, true, nil, false, }, {"inexistent provisioner", defaultParser, parseTestArgs{"testdata/build/provisioner_inexistent.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Builds: nil, }, true, true, []packersdk.Build{&packer.CoreBuild{}}, false, }, {"untyped post-processor", defaultParser, parseTestArgs{"testdata/build/post-processor_untyped.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Builds: nil, }, true, true, []packersdk.Build{&packer.CoreBuild{}}, false, }, {"inexistent post-processor", defaultParser, parseTestArgs{"testdata/build/post-processor_inexistent.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Builds: nil, }, true, true, []packersdk.Build{}, false, }, {"invalid source", defaultParser, parseTestArgs{"testdata/build/invalid_source_reference.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Builds: nil, }, true, true, []packersdk.Build{}, false, }, {"named build", defaultParser, parseTestArgs{"testdata/build/named.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Builds: Builds{ &BuildBlock{ Name: "somebuild", Sources: []SourceRef{ { Type: "amazon-ebs", Name: "ubuntu-1604", }, refVBIsoUbuntu1204, }, }, }, }, false, false, []packersdk.Build{}, true, }, {"post-processor with only and except", defaultParser, parseTestArgs{"testdata/build/post-processor_onlyexcept.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Sources: map[SourceRef]SourceBlock{ refVBIsoUbuntu1204: {Type: "virtualbox-iso", Name: "ubuntu-1204"}, refAWSEBSUbuntu1604: {Type: "amazon-ebs", Name: "ubuntu-1604"}, }, Builds: Builds{ &BuildBlock{ Sources: []SourceRef{ refVBIsoUbuntu1204, SourceRef{Type: "amazon-ebs", Name: "ubuntu-1604", LocalName: "aws-ubuntu-16.04"}, }, ProvisionerBlocks: nil, PostProcessorsLists: [][]*PostProcessorBlock{ { { PType: "amazon-import", OnlyExcept: OnlyExcept{Only: []string{"virtualbox-iso.ubuntu-1204"}, Except: nil}, }, }, { { PType: "manifest", OnlyExcept: OnlyExcept{Only: nil, Except: []string{"virtualbox-iso.ubuntu-1204"}}, }, }, { { PType: "amazon-import", OnlyExcept: OnlyExcept{Only: []string{"amazon-ebs.aws-ubuntu-16.04"}, Except: nil}, }, }, { { PType: "manifest", OnlyExcept: OnlyExcept{Only: nil, Except: []string{"amazon-ebs.aws-ubuntu-16.04"}}, }, }, }, }, }, }, false, false, []packersdk.Build{ &packer.CoreBuild{ Type: "virtualbox-iso.ubuntu-1204", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{ { { PType: "amazon-import", PostProcessor: &HCL2PostProcessor{ PostProcessor: &MockPostProcessor{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, { { PType: "manifest", PostProcessor: &HCL2PostProcessor{ PostProcessor: &MockPostProcessor{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, }, }, &packer.CoreBuild{ Type: "amazon-ebs.aws-ubuntu-16.04", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{ { { PType: "manifest", PostProcessor: &HCL2PostProcessor{ PostProcessor: &MockPostProcessor{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, { { PType: "amazon-import", PostProcessor: &HCL2PostProcessor{ PostProcessor: &MockPostProcessor{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, }, }, }, false, }, {"provisioner with only and except", defaultParser, parseTestArgs{"testdata/build/provisioner_onlyexcept.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "build"), Sources: map[SourceRef]SourceBlock{ refVBIsoUbuntu1204: {Type: "virtualbox-iso", Name: "ubuntu-1204"}, refAWSEBSUbuntu1604: {Type: "amazon-ebs", Name: "ubuntu-1604"}, }, Builds: Builds{ &BuildBlock{ Sources: []SourceRef{ refVBIsoUbuntu1204, SourceRef{Type: "amazon-ebs", Name: "ubuntu-1604", LocalName: "aws-ubuntu-16.04"}, }, ProvisionerBlocks: []*ProvisionerBlock{ { PType: "shell", OnlyExcept: OnlyExcept{Only: []string{"virtualbox-iso.ubuntu-1204"}}, }, { PType: "file", OnlyExcept: OnlyExcept{Except: []string{"virtualbox-iso.ubuntu-1204"}}, }, { PType: "shell", OnlyExcept: OnlyExcept{Only: []string{"amazon-ebs.aws-ubuntu-16.04"}}, }, { PType: "file", OnlyExcept: OnlyExcept{Except: []string{"amazon-ebs.aws-ubuntu-16.04"}}, }, }, }, }, }, false, false, []packersdk.Build{ &packer.CoreBuild{ Type: "virtualbox-iso.ubuntu-1204", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", Provisioner: &HCL2Provisioner{ Provisioner: &MockProvisioner{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, { PType: "file", Provisioner: &HCL2Provisioner{ Provisioner: &MockProvisioner{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, PostProcessors: [][]packer.CoreBuildPostProcessor{}, }, &packer.CoreBuild{ Type: "amazon-ebs.aws-ubuntu-16.04", Prepared: true, Builder: emptyMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { PType: "file", Provisioner: &HCL2Provisioner{ Provisioner: &MockProvisioner{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, { PType: "shell", Provisioner: &HCL2Provisioner{ Provisioner: &MockProvisioner{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{Tags: []MockTag{}}, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, PostProcessors: [][]packer.CoreBuildPostProcessor{}, }, }, false, }, } testParse(t, tests) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.hcl_post-processor.go�������������������������������������������0000664�0000000�0000000�00000004467�13771713062�0023404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "context" "fmt" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" ) // HCL2PostProcessor has a reference to the part of the HCL2 body where it is // defined, allowing to completely reconfigure the PostProcessor right before // calling PostProcess: with contextual variables. // This permits using "${build.ID}" values for example. type HCL2PostProcessor struct { PostProcessor packersdk.PostProcessor postProcessorBlock *PostProcessorBlock evalContext *hcl.EvalContext builderVariables map[string]string } func (p *HCL2PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.PostProcessor.ConfigSpec() } func (p *HCL2PostProcessor) HCL2Prepare(buildVars map[string]interface{}) error { var diags hcl.Diagnostics ectx := p.evalContext if len(buildVars) > 0 { ectx = p.evalContext.NewChild() buildValues := map[string]cty.Value{} for k, v := range buildVars { switch v := v.(type) { case string: buildValues[k] = cty.StringVal(v) case int64: buildValues[k] = cty.NumberIntVal(v) case uint64: buildValues[k] = cty.NumberUIntVal(v) case bool: buildValues[k] = cty.BoolVal(v) default: return fmt.Errorf("unhandled buildvar type: %T", v) } } ectx.Variables = map[string]cty.Value{ buildAccessor: cty.ObjectVal(buildValues), } } flatPostProcessorCfg, moreDiags := decodeHCL2Spec(p.postProcessorBlock.HCL2Ref.Rest, ectx, p.PostProcessor) diags = append(diags, moreDiags...) if diags.HasErrors() { return diags } return p.PostProcessor.Configure(p.builderVariables, flatPostProcessorCfg) } func (p *HCL2PostProcessor) Configure(args ...interface{}) error { return p.PostProcessor.Configure(args...) } func (p *HCL2PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { generatedData := make(map[string]interface{}) if artifactStateData, ok := artifact.State("generated_data").(map[interface{}]interface{}); ok { for k, v := range artifactStateData { generatedData[k.(string)] = v } } err := p.HCL2Prepare(generatedData) if err != nil { return nil, false, false, err } return p.PostProcessor.PostProcess(ctx, ui, artifact) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.hcl_provisioner.go����������������������������������������������0000664�0000000�0000000�00000004260�13771713062�0022750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "context" "fmt" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" ) // HCL2Provisioner has a reference to the part of the HCL2 body where it is // defined, allowing to completely reconfigure the Provisioner right before // calling Provision: with contextual variables. // This permits using "${build.ID}" values for example. type HCL2Provisioner struct { Provisioner packersdk.Provisioner provisionerBlock *ProvisionerBlock evalContext *hcl.EvalContext builderVariables map[string]string override map[string]interface{} } func (p *HCL2Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.Provisioner.ConfigSpec() } func (p *HCL2Provisioner) HCL2Prepare(buildVars map[string]interface{}) error { var diags hcl.Diagnostics ectx := p.evalContext if len(buildVars) > 0 { ectx = p.evalContext.NewChild() buildValues := map[string]cty.Value{} if !p.evalContext.Variables[buildAccessor].IsNull() { buildValues = p.evalContext.Variables[buildAccessor].AsValueMap() } for k, v := range buildVars { switch v := v.(type) { case string: buildValues[k] = cty.StringVal(v) case int64: buildValues[k] = cty.NumberIntVal(v) case uint64: buildValues[k] = cty.NumberUIntVal(v) case bool: buildValues[k] = cty.BoolVal(v) default: return fmt.Errorf("unhandled buildvar type: %T", v) } } ectx.Variables = map[string]cty.Value{ buildAccessor: cty.ObjectVal(buildValues), } } flatProvisionerCfg, moreDiags := decodeHCL2Spec(p.provisionerBlock.HCL2Ref.Rest, ectx, p.Provisioner) diags = append(diags, moreDiags...) if diags.HasErrors() { return diags } return p.Provisioner.Prepare(p.builderVariables, flatProvisionerCfg, p.override) } func (p *HCL2Provisioner) Prepare(args ...interface{}) error { return p.Provisioner.Prepare(args...) } func (p *HCL2Provisioner) Provision(ctx context.Context, ui packersdk.Ui, c packersdk.Communicator, vars map[string]interface{}) error { err := p.HCL2Prepare(vars) if err != nil { return err } return p.Provisioner.Provision(ctx, ui, c, vars) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.hcl_ref.go������������������������������������������������������0000664�0000000�0000000�00000001252�13771713062�0021143�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "github.com/hashicorp/hcl/v2" ) // HCL2Ref references to the source definition in configuration text file. It // is used to tell were something was wrong, - like a warning or an error - // long after it was parsed; allowing to give pointers as to where change/fix // things in a file. type HCL2Ref struct { // references DefRange hcl.Range TypeRange hcl.Range LabelsRanges []hcl.Range // remainder of unparsed body Rest hcl.Body } func newHCL2Ref(block *hcl.Block, rest hcl.Body) HCL2Ref { return HCL2Ref{ Rest: rest, DefRange: block.DefRange, TypeRange: block.TypeRange, LabelsRanges: block.LabelRanges, } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.packer_config.go������������������������������������������������0000664�0000000�0000000�00000040551�13771713062�0022340�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "sort" "strings" "github.com/gobwas/glob" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" pkrfunction "github.com/hashicorp/packer/hcl2template/function" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // PackerConfig represents a loaded Packer HCL config. It will contain // references to all possible blocks of the allowed configuration. type PackerConfig struct { Packer struct { VersionConstraints []VersionConstraint } // Directory where the config files are defined Basedir string // Core Packer version, for reference by plugins and template functions. CorePackerVersionString string // directory Packer was called from Cwd string // Available Source blocks Sources map[SourceRef]SourceBlock // InputVariables and LocalVariables are the list of defined input and // local variables. They are of the same type but are not used in the same // way. Local variables will not be decoded from any config file, env var, // or ect. Like the Input variables will. InputVariables Variables LocalVariables Variables LocalBlocks []*LocalBlock ValidationOptions // Builds is the list of Build blocks defined in the config files. Builds Builds builderSchemas packer.BuilderStore provisionersSchemas packer.ProvisionerStore postProcessorsSchemas packer.PostProcessorStore except []glob.Glob only []glob.Glob parser *Parser files []*hcl.File } type ValidationOptions struct { Strict bool } const ( inputVariablesAccessor = "var" localsAccessor = "local" pathVariablesAccessor = "path" sourcesAccessor = "source" buildAccessor = "build" packerAccessor = "packer" ) // EvalContext returns the *hcl.EvalContext that will be passed to an hcl // decoder in order to tell what is the actual value of a var or a local and // the list of defined functions. func (cfg *PackerConfig) EvalContext(variables map[string]cty.Value) *hcl.EvalContext { inputVariables, _ := cfg.InputVariables.Values() localVariables, _ := cfg.LocalVariables.Values() ectx := &hcl.EvalContext{ Functions: Functions(cfg.Basedir), Variables: map[string]cty.Value{ inputVariablesAccessor: cty.ObjectVal(inputVariables), localsAccessor: cty.ObjectVal(localVariables), sourcesAccessor: cty.ObjectVal(map[string]cty.Value{ "type": cty.UnknownVal(cty.String), "name": cty.UnknownVal(cty.String), }), buildAccessor: cty.UnknownVal(cty.EmptyObject), packerAccessor: cty.ObjectVal(map[string]cty.Value{ "version": cty.StringVal(cfg.CorePackerVersionString), }), pathVariablesAccessor: cty.ObjectVal(map[string]cty.Value{ "cwd": cty.StringVal(strings.ReplaceAll(cfg.Cwd, `\`, `/`)), "root": cty.StringVal(strings.ReplaceAll(cfg.Basedir, `\`, `/`)), }), }, } for k, v := range variables { ectx.Variables[k] = v } return ectx } // decodeInputVariables looks in the found blocks for 'variables' and // 'variable' blocks. It should be called firsthand so that other blocks can // use the variables. func (c *PackerConfig) decodeInputVariables(f *hcl.File) hcl.Diagnostics { var diags hcl.Diagnostics content, moreDiags := f.Body.Content(configSchema) diags = append(diags, moreDiags...) // for input variables we allow to use env in the default value section. ectx := &hcl.EvalContext{ Functions: map[string]function.Function{ "env": pkrfunction.EnvFunc, }, } for _, block := range content.Blocks { switch block.Type { case variableLabel: moreDiags := c.InputVariables.decodeVariableBlock(block, ectx) diags = append(diags, moreDiags...) case variablesLabel: attrs, moreDiags := block.Body.JustAttributes() diags = append(diags, moreDiags...) for key, attr := range attrs { moreDiags = c.InputVariables.decodeVariable(key, attr, ectx) diags = append(diags, moreDiags...) } } } return diags } // parseLocalVariables looks in the found blocks for 'locals' blocks. It // should be called after parsing input variables so that they can be // referenced. func (c *PackerConfig) parseLocalVariables(f *hcl.File) ([]*LocalBlock, hcl.Diagnostics) { var diags hcl.Diagnostics content, moreDiags := f.Body.Content(configSchema) diags = append(diags, moreDiags...) var locals []*LocalBlock for _, block := range content.Blocks { switch block.Type { case localsLabel: attrs, moreDiags := block.Body.JustAttributes() diags = append(diags, moreDiags...) for name, attr := range attrs { if _, found := c.LocalVariables[name]; found { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Duplicate value in " + localsLabel, Detail: "Duplicate " + name + " definition found.", Subject: attr.NameRange.Ptr(), Context: block.DefRange.Ptr(), }) return nil, diags } locals = append(locals, &LocalBlock{ Name: name, Expr: attr.Expr, }) } } } return locals, diags } func (c *PackerConfig) evaluateLocalVariables(locals []*LocalBlock) hcl.Diagnostics { var diags hcl.Diagnostics if len(locals) > 0 && c.LocalVariables == nil { c.LocalVariables = Variables{} } var retry, previousL int for len(locals) > 0 { local := locals[0] moreDiags := c.evaluateLocalVariable(local) if moreDiags.HasErrors() { if len(locals) == 1 { // If this is the only local left there's no need // to try evaluating again return append(diags, moreDiags...) } if previousL == len(locals) { if retry == 100 { // To get to this point, locals must have a circle dependency return append(diags, moreDiags...) } retry++ } previousL = len(locals) // If local uses another local that has not been evaluated yet this could be the reason of errors // Push local to the end of slice to be evaluated later locals = append(locals, local) } else { retry = 0 diags = append(diags, moreDiags...) } // Remove local from slice locals = append(locals[:0], locals[1:]...) } return diags } func (c *PackerConfig) evaluateLocalVariable(local *LocalBlock) hcl.Diagnostics { var diags hcl.Diagnostics value, moreDiags := local.Expr.Value(c.EvalContext(nil)) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { return diags } c.LocalVariables[local.Name] = &Variable{ Name: local.Name, Values: []VariableAssignment{{ Value: value, Expr: local.Expr, From: "default", }}, Type: value.Type(), } return diags } // getCoreBuildProvisioners takes a list of provisioner block, starts according // provisioners and sends parsed HCL2 over to it. func (cfg *PackerConfig) getCoreBuildProvisioners(source SourceBlock, blocks []*ProvisionerBlock, ectx *hcl.EvalContext) ([]packer.CoreBuildProvisioner, hcl.Diagnostics) { var diags hcl.Diagnostics res := []packer.CoreBuildProvisioner{} for _, pb := range blocks { if pb.OnlyExcept.Skip(source.String()) { continue } provisioner, moreDiags := cfg.startProvisioner(source, pb, ectx) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } // If we're pausing, we wrap the provisioner in a special pauser. if pb.PauseBefore != 0 { provisioner = &packer.PausedProvisioner{ PauseBefore: pb.PauseBefore, Provisioner: provisioner, } } else if pb.Timeout != 0 { provisioner = &packer.TimeoutProvisioner{ Timeout: pb.Timeout, Provisioner: provisioner, } } if pb.MaxRetries != 0 { provisioner = &packer.RetriedProvisioner{ MaxRetries: pb.MaxRetries, Provisioner: provisioner, } } res = append(res, packer.CoreBuildProvisioner{ PType: pb.PType, PName: pb.PName, Provisioner: provisioner, }) } return res, diags } // getCoreBuildProvisioners takes a list of post processor block, starts // according provisioners and sends parsed HCL2 over to it. func (cfg *PackerConfig) getCoreBuildPostProcessors(source SourceBlock, blocksList [][]*PostProcessorBlock, ectx *hcl.EvalContext) ([][]packer.CoreBuildPostProcessor, hcl.Diagnostics) { var diags hcl.Diagnostics res := [][]packer.CoreBuildPostProcessor{} for _, blocks := range blocksList { pps := []packer.CoreBuildPostProcessor{} for _, ppb := range blocks { if ppb.OnlyExcept.Skip(source.String()) { continue } name := ppb.PName if name == "" { name = ppb.PType } // -except exclude := false for _, exceptGlob := range cfg.except { if exceptGlob.Match(name) { exclude = true break } } if exclude { break } postProcessor, moreDiags := cfg.startPostProcessor(source, ppb, ectx) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } pps = append(pps, packer.CoreBuildPostProcessor{ PostProcessor: postProcessor, PName: ppb.PName, PType: ppb.PType, KeepInputArtifact: ppb.KeepInputArtifact, }) } if len(pps) > 0 { res = append(res, pps) } } return res, diags } // GetBuilds returns a list of packer Build based on the HCL2 parsed build // blocks. All Builders, Provisioners and Post Processors will be started and // configured. func (cfg *PackerConfig) GetBuilds(opts packer.GetBuildsOptions) ([]packersdk.Build, hcl.Diagnostics) { res := []packersdk.Build{} var diags hcl.Diagnostics for _, build := range cfg.Builds { for _, from := range build.Sources { src, found := cfg.Sources[from.Ref()] if !found { diags = append(diags, &hcl.Diagnostic{ Summary: "Unknown " + sourceLabel + " " + from.String(), Subject: build.HCL2Ref.DefRange.Ptr(), Severity: hcl.DiagError, Detail: fmt.Sprintf("Known: %v", cfg.Sources), }) continue } src.addition = from.addition src.LocalName = from.LocalName pcb := &packer.CoreBuild{ BuildName: build.Name, Type: src.String(), } // Apply the -only and -except command-line options to exclude matching builds. buildName := pcb.Name() // -only if len(opts.Only) > 0 { onlyGlobs, diags := convertFilterOption(opts.Only, "only") if diags.HasErrors() { return nil, diags } cfg.only = onlyGlobs include := false for _, onlyGlob := range onlyGlobs { if onlyGlob.Match(buildName) { include = true break } } if !include { continue } } // -except if len(opts.Except) > 0 { exceptGlobs, diags := convertFilterOption(opts.Except, "except") if diags.HasErrors() { return nil, diags } cfg.except = exceptGlobs exclude := false for _, exceptGlob := range exceptGlobs { if exceptGlob.Match(buildName) { exclude = true break } } if exclude { continue } } builder, moreDiags, generatedVars := cfg.startBuilder(src, cfg.EvalContext(nil), opts) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } // If the builder has provided a list of to-be-generated variables that // should be made accessible to provisioners, pass that list into // the provisioner prepare() so that the provisioner can appropriately // validate user input against what will become available. Otherwise, // only pass the default variables, using the basic placeholder data. unknownBuildValues := map[string]cty.Value{} for _, k := range append(packer.BuilderDataCommonKeys, generatedVars...) { unknownBuildValues[k] = cty.StringVal("<unknown>") } unknownBuildValues["name"] = cty.StringVal(build.Name) variables := map[string]cty.Value{ sourcesAccessor: cty.ObjectVal(src.ctyValues()), buildAccessor: cty.ObjectVal(unknownBuildValues), } provisioners, moreDiags := cfg.getCoreBuildProvisioners(src, build.ProvisionerBlocks, cfg.EvalContext(variables)) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } pps, moreDiags := cfg.getCoreBuildPostProcessors(src, build.PostProcessorsLists, cfg.EvalContext(variables)) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } pcb.Builder = builder pcb.Provisioners = provisioners pcb.PostProcessors = pps pcb.Prepared = true // Prepare just sets the "prepareCalled" flag on CoreBuild, since // we did all the prep here. _, err := pcb.Prepare() if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Preparing packer core build %s failed", src.Ref().String()), Detail: err.Error(), Subject: build.HCL2Ref.DefRange.Ptr(), }) continue } res = append(res, pcb) } } return res, diags } var PackerConsoleHelp = strings.TrimSpace(` Packer console HCL2 Mode. The Packer console allows you to experiment with Packer interpolations. You may access variables and functions in the Packer config you called the console with. Type in the interpolation to test and hit <enter> to see the result. "upper(var.foo.id)" would evaluate to the ID of "foo" and uppercase is, if it exists in your config file. "variables" will dump all available variables and their values. To exit the console, type "exit" and hit <enter>, or use Control-C. /!\ It is not possible to use go templating interpolation like "{{timestamp}}" with in HCL2 mode. `) func (p *PackerConfig) EvaluateExpression(line string) (out string, exit bool, diags hcl.Diagnostics) { switch { case line == "": return "", false, nil case line == "exit": return "", true, nil case line == "help": return PackerConsoleHelp, false, nil case line == "variables": return p.printVariables(), false, nil default: return p.handleEval(line) } } func (p *PackerConfig) printVariables() string { out := &strings.Builder{} out.WriteString("> input-variables:\n\n") keys := p.InputVariables.Keys() sort.Strings(keys) for _, key := range keys { v := p.InputVariables[key] val, _ := v.Value() fmt.Fprintf(out, "var.%s: %q\n", v.Name, PrintableCtyValue(val)) } out.WriteString("\n> local-variables:\n\n") keys = p.LocalVariables.Keys() sort.Strings(keys) for _, key := range keys { v := p.LocalVariables[key] val, _ := v.Value() fmt.Fprintf(out, "local.%s: %q\n", v.Name, PrintableCtyValue(val)) } return out.String() } func (p *PackerConfig) printBuilds() string { out := &strings.Builder{} out.WriteString("> builds:\n") for i, build := range p.Builds { name := build.Name if name == "" { name = fmt.Sprintf("<unnamed build %d>", i) } fmt.Fprintf(out, "\n > %s:\n", name) if build.Description != "" { fmt.Fprintf(out, "\n > Description: %s\n", build.Description) } fmt.Fprintf(out, "\n sources:\n") if len(build.Sources) == 0 { fmt.Fprintf(out, "\n <no source>\n") } for _, source := range build.Sources { fmt.Fprintf(out, "\n %s\n", source) } fmt.Fprintf(out, "\n provisioners:\n\n") if len(build.ProvisionerBlocks) == 0 { fmt.Fprintf(out, " <no provisioner>\n") } for _, prov := range build.ProvisionerBlocks { str := prov.PType if prov.PName != "" { str = strings.Join([]string{prov.PType, prov.PName}, ".") } fmt.Fprintf(out, " %s\n", str) } fmt.Fprintf(out, "\n post-processors:\n") if len(build.PostProcessorsLists) == 0 { fmt.Fprintf(out, "\n <no post-processor>\n") } for i, ppList := range build.PostProcessorsLists { fmt.Fprintf(out, "\n %d:\n", i) for _, pp := range ppList { str := pp.PType if pp.PName != "" { str = strings.Join([]string{pp.PType, pp.PName}, ".") } fmt.Fprintf(out, " %s\n", str) } } } return out.String() } func (p *PackerConfig) handleEval(line string) (out string, exit bool, diags hcl.Diagnostics) { // Parse the given line as an expression expr, parseDiags := hclsyntax.ParseExpression([]byte(line), "<console-input>", hcl.Pos{Line: 1, Column: 1}) diags = append(diags, parseDiags...) if parseDiags.HasErrors() { return "", false, diags } val, valueDiags := expr.Value(p.EvalContext(nil)) diags = append(diags, valueDiags...) if valueDiags.HasErrors() { return "", false, diags } return PrintableCtyValue(val), false, diags } func (p *PackerConfig) FixConfig(_ packer.FixConfigOptions) (diags hcl.Diagnostics) { // No Fixers exist for HCL2 configs so there is nothing to do here for now. return } func (p *PackerConfig) InspectConfig(opts packer.InspectConfigOptions) int { ui := opts.Ui ui.Say("Packer Inspect: HCL2 mode\n") ui.Say(p.printVariables()) ui.Say(p.printBuilds()) return 0 } �������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.packer_config_test.go�������������������������������������������0000664�0000000�0000000�00000020732�13771713062�0023376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "testing" . "github.com/hashicorp/packer/hcl2template/internal" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" ) var ( refVBIsoUbuntu1204 = SourceRef{Type: "virtualbox-iso", Name: "ubuntu-1204"} refAWSEBSUbuntu1604 = SourceRef{Type: "amazon-ebs", Name: "ubuntu-1604"} pTrue = pointerToBool(true) ) func TestParser_complete(t *testing.T) { defaultParser := getBasicParser() tests := []parseTest{ {"working build", defaultParser, parseTestArgs{"testdata/complete", nil, nil}, &PackerConfig{ Basedir: "testdata/complete", InputVariables: Variables{ "foo": &Variable{ Name: "foo", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("value")}}, Type: cty.String, }, "image_id": &Variable{ Name: "image_id", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("image-id-default")}}, Type: cty.String, }, "port": &Variable{ Name: "port", Values: []VariableAssignment{{From: "default", Value: cty.NumberIntVal(42)}}, Type: cty.Number, }, "availability_zone_names": &Variable{ Name: "availability_zone_names", Values: []VariableAssignment{{ From: "default", Value: cty.ListVal([]cty.Value{ cty.StringVal("A"), cty.StringVal("B"), cty.StringVal("C"), }), }}, Type: cty.List(cty.String), }, }, LocalVariables: Variables{ "feefoo": &Variable{ Name: "feefoo", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("value_image-id-default")}}, Type: cty.String, }, "standard_tags": &Variable{ Name: "standard_tags", Values: []VariableAssignment{{From: "default", Value: cty.ObjectVal(map[string]cty.Value{ "Component": cty.StringVal("user-service"), "Environment": cty.StringVal("production"), }), }}, Type: cty.Object(map[string]cty.Type{ "Component": cty.String, "Environment": cty.String, }), }, "abc_map": &Variable{ Name: "abc_map", Values: []VariableAssignment{{From: "default", Value: cty.TupleVal([]cty.Value{ cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("a"), }), cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("b"), }), cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("c"), }), }), }}, Type: cty.Tuple([]cty.Type{ cty.Object(map[string]cty.Type{ "id": cty.String, }), cty.Object(map[string]cty.Type{ "id": cty.String, }), cty.Object(map[string]cty.Type{ "id": cty.String, }), }), }, }, Sources: map[SourceRef]SourceBlock{ refVBIsoUbuntu1204: {Type: "virtualbox-iso", Name: "ubuntu-1204"}, refAWSEBSUbuntu1604: {Type: "amazon-ebs", Name: "ubuntu-1604"}, }, Builds: Builds{ &BuildBlock{ Sources: []SourceRef{ refVBIsoUbuntu1204, refAWSEBSUbuntu1604, }, ProvisionerBlocks: []*ProvisionerBlock{ { PType: "shell", PName: "provisioner that does something", }, {PType: "file"}, }, PostProcessorsLists: [][]*PostProcessorBlock{ { { PType: "amazon-import", PName: "something", KeepInputArtifact: pTrue, }, }, { { PType: "amazon-import", }, }, { { PType: "amazon-import", PName: "first-nested-post-processor", }, { PType: "amazon-import", PName: "second-nested-post-processor", }, }, { { PType: "amazon-import", PName: "third-nested-post-processor", }, { PType: "amazon-import", PName: "fourth-nested-post-processor", }, }, }, }, }, }, false, false, []packersdk.Build{ &packer.CoreBuild{ Type: "virtualbox-iso.ubuntu-1204", Prepared: true, Builder: basicMockBuilder, Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", PName: "provisioner that does something", Provisioner: &HCL2Provisioner{ Provisioner: basicMockProvisioner, }, }, { PType: "file", Provisioner: &HCL2Provisioner{ Provisioner: basicMockProvisioner, }, }, }, PostProcessors: [][]packer.CoreBuildPostProcessor{ { { PType: "amazon-import", PName: "something", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, KeepInputArtifact: pTrue, }, }, { { PType: "amazon-import", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, }, { { PType: "amazon-import", PName: "first-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, { PType: "amazon-import", PName: "second-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, }, { { PType: "amazon-import", PName: "third-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, { PType: "amazon-import", PName: "fourth-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, }, }, }, &packer.CoreBuild{ Type: "amazon-ebs.ubuntu-1604", Prepared: true, Builder: &MockBuilder{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{ String: "setting from build section", Int: 42, Tags: []MockTag{}, }, NestedSlice: []NestedMockConfig{}, }, }, Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", PName: "provisioner that does something", Provisioner: &HCL2Provisioner{ Provisioner: basicMockProvisioner, }, }, { PType: "file", Provisioner: &HCL2Provisioner{ Provisioner: basicMockProvisioner, }, }, }, PostProcessors: [][]packer.CoreBuildPostProcessor{ { { PType: "amazon-import", PName: "something", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, KeepInputArtifact: pTrue, }, }, { { PType: "amazon-import", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, }, { { PType: "amazon-import", PName: "first-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, { PType: "amazon-import", PName: "second-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, }, { { PType: "amazon-import", PName: "third-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, { PType: "amazon-import", PName: "fourth-nested-post-processor", PostProcessor: &HCL2PostProcessor{ PostProcessor: basicMockPostProcessor, }, }, }, }, }, }, false, }, } testParse(t, tests) } func TestParser_ValidateFilterOption(t *testing.T) { tests := []struct { pattern string expectError bool }{ {"*foo*", false}, {"foo[]bar", true}, } for _, test := range tests { t.Run(test.pattern, func(t *testing.T) { _, diags := convertFilterOption([]string{test.pattern}, "") if diags.HasErrors() && !test.expectError { t.Fatalf("Expected %s to parse as glob", test.pattern) } if !diags.HasErrors() && test.expectError { t.Fatalf("Expected %s to fail to parse as glob", test.pattern) } }) } } func pointerToBool(b bool) *bool { return &b } ��������������������������������������packer-1.6.6+ds1/hcl2template/types.source.go�������������������������������������������������������0000664�0000000�0000000�00000011336�13771713062�0021045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "strconv" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/gohcl" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" ) // SourceBlock references an HCL 'source' block. type SourceBlock struct { // Type of source; ex: virtualbox-iso Type string // Given name; if any Name string block *hcl.Block // addition will be merged into block to allow user to override builder settings // per build.source block. addition hcl.Body // LocalName can be set in a singular source block from a build block, it // allows to give a special name to a build in the logs. LocalName string } func (b *SourceBlock) name() string { if b.LocalName != "" { return b.LocalName } return b.Name } func (b *SourceBlock) String() string { return fmt.Sprintf("%s.%s", b.Type, b.name()) } // EvalContext adds the values of the source to the passed eval context. func (b *SourceBlock) ctyValues() map[string]cty.Value { return map[string]cty.Value{ "type": cty.StringVal(b.Type), "name": cty.StringVal(b.name()), } } // decodeBuildSource reads a used source block from a build: // build { // source "type.example" { // name = "local_name" // } // } func (p *Parser) decodeBuildSource(block *hcl.Block) (SourceRef, hcl.Diagnostics) { ref := sourceRefFromString(block.Labels[0]) var b struct { Name string `hcl:"name,optional"` Rest hcl.Body `hcl:",remain"` } diags := gohcl.DecodeBody(block.Body, nil, &b) if diags.HasErrors() { return ref, diags } ref.addition = b.Rest ref.LocalName = b.Name return ref, nil } func (p *Parser) decodeSource(block *hcl.Block) (SourceBlock, hcl.Diagnostics) { source := SourceBlock{ Type: block.Labels[0], Name: block.Labels[1], block: block, } var diags hcl.Diagnostics if !p.BuilderSchemas.Has(source.Type) { diags = append(diags, &hcl.Diagnostic{ Summary: "Unknown " + buildSourceLabel + " type " + source.Type, Subject: block.LabelRanges[0].Ptr(), Detail: fmt.Sprintf("known builders: %v", p.BuilderSchemas.List()), Severity: hcl.DiagError, }) return source, diags } return source, diags } func (cfg *PackerConfig) startBuilder(source SourceBlock, ectx *hcl.EvalContext, opts packer.GetBuildsOptions) (packersdk.Builder, hcl.Diagnostics, []string) { var diags hcl.Diagnostics builder, err := cfg.builderSchemas.Start(source.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: "Failed to load " + sourceLabel + " type", Detail: err.Error(), Subject: &source.block.LabelRanges[0], }) return builder, diags, nil } body := source.block.Body if source.addition != nil { body = hcl.MergeBodies([]hcl.Body{source.block.Body, source.addition}) } decoded, moreDiags := decodeHCL2Spec(body, ectx, builder) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { return nil, diags, nil } // Note: HCL prepares inside of the Start func, but Json does not. Json // builds are instead prepared only in command/build.go // TODO: either make json prepare when plugins are loaded, or make HCL // prepare at a later step, to make builds from different template types // easier to reason about. builderVars := source.builderVariables() builderVars["packer_debug"] = strconv.FormatBool(opts.Debug) builderVars["packer_force"] = strconv.FormatBool(opts.Force) builderVars["packer_on_error"] = opts.OnError generatedVars, warning, err := builder.Prepare(builderVars, decoded) moreDiags = warningErrorsToDiags(source.block, warning, err) diags = append(diags, moreDiags...) return builder, diags, generatedVars } // These variables will populate the PackerConfig inside of the builders. func (source *SourceBlock) builderVariables() map[string]string { return map[string]string{ "packer_build_name": source.Name, "packer_builder_type": source.Type, } } func (source *SourceBlock) Ref() SourceRef { return SourceRef{ Type: source.Type, Name: source.Name, } } type SourceRef struct { Type string Name string // The content of this body will be merged into a new block to allow to // override builder settings per build section. addition hcl.Body // LocalName can be set in a singular source block from a build block, it // allows to give a special name to a build in the logs. LocalName string } // the 'addition' field makes of ref a different entry in the sources map, so // Ref is here to make sure only one is returned. func (r *SourceRef) Ref() SourceRef { return SourceRef{ Type: r.Type, Name: r.Name, } } // NoSource is the zero value of sourceRef, representing the absense of an // source. var NoSource SourceRef func (r SourceRef) String() string { return fmt.Sprintf("%s.%s", r.Type, r.Name) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.source_test.go��������������������������������������������������0000664�0000000�0000000�00000003305�13771713062�0022101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "path/filepath" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestParse_source(t *testing.T) { defaultParser := getBasicParser() tests := []parseTest{ {"two basic sources", defaultParser, parseTestArgs{"testdata/sources/basic.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "sources"), Sources: map[SourceRef]SourceBlock{ { Type: "virtualbox-iso", Name: "ubuntu-1204", }: { Type: "virtualbox-iso", Name: "ubuntu-1204", }, }, }, false, false, []packersdk.Build{}, false, }, {"untyped source", defaultParser, parseTestArgs{"testdata/sources/untyped.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "sources"), }, true, true, nil, false, }, {"unnamed source", defaultParser, parseTestArgs{"testdata/sources/unnamed.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "sources"), }, true, true, nil, false, }, {"inexistent source", defaultParser, parseTestArgs{"testdata/sources/inexistent.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "sources"), }, true, true, nil, false, }, {"duplicate source", defaultParser, parseTestArgs{"testdata/sources/duplicate.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "sources"), Sources: map[SourceRef]SourceBlock{ { Type: "virtualbox-iso", Name: "ubuntu-1204", }: { Type: "virtualbox-iso", Name: "ubuntu-1204", }, }, }, true, true, nil, false, }, } testParse(t, tests) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.variables.go����������������������������������������������������0000664�0000000�0000000�00000053127�13771713062�0021521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "log" "strings" "unicode" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/ext/typeexpr" "github.com/hashicorp/hcl/v2/gohcl" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/packer/hcl2template/addrs" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) // A consistent detail message for all "not a valid identifier" diagnostics. const badIdentifierDetail = "A name must start with a letter or underscore and may contain only letters, digits, underscores, and dashes." // Local represents a single entry from a "locals" block in a file. // The "locals" block itself is not represented, because it serves only to // provide context for us to interpret its contents. type LocalBlock struct { Name string Expr hcl.Expression } // VariableAssignment represents a way a variable was set: the expression // setting it and the value of that expression. It helps pinpoint were // something was set in diagnostics. type VariableAssignment struct { // From tells were it was taken from, command/varfile/env/default From string Value cty.Value Expr hcl.Expression } type Variable struct { // Values contains possible values for the variable; The last value set // from these will be the one used. If none is set; an error will be // returned by Value(). Values []VariableAssignment // Validations contains all variables validation rules to be applied to the // used value. Only the used value - the last value from Values - is // validated. Validations []*VariableValidation // Cty Type of the variable. If the default value or a collected value is // not of this type nor can be converted to this type an error diagnostic // will show up. This allows us to assume that values are valid later in // code. // // When a default value - and no type - is passed in the variable // declaration, the type of the default variable will be used. This will // allow to ensure that users set this variable correctly. Type cty.Type // Common name of the variable Name string // Description of the variable Description string // When Sensitive is set to true Packer will try it best to hide/obfuscate // the variable from the output stream. By replacing the text. Sensitive bool Range hcl.Range } func (v *Variable) GoString() string { b := &strings.Builder{} fmt.Fprintf(b, "{type:%s", v.Type.GoString()) for _, vv := range v.Values { fmt.Fprintf(b, ",%s:%s", vv.From, vv.Value) } fmt.Fprintf(b, "}") return b.String() } // validateValue ensures that all of the configured custom validations for a // variable value are passing. // func (v *Variable) validateValue(val VariableAssignment) (diags hcl.Diagnostics) { if len(v.Validations) == 0 { log.Printf("[TRACE] validateValue: not active for %s, so skipping", v.Name) return nil } hclCtx := &hcl.EvalContext{ Variables: map[string]cty.Value{ "var": cty.ObjectVal(map[string]cty.Value{ v.Name: val.Value, }), }, Functions: Functions(""), } for _, validation := range v.Validations { const errInvalidCondition = "Invalid variable validation result" result, moreDiags := validation.Condition.Value(hclCtx) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { log.Printf("[TRACE] evalVariableValidations: %s rule %s condition expression failed: %s", v.Name, validation.DeclRange, moreDiags.Error()) } if !result.IsKnown() { log.Printf("[TRACE] evalVariableValidations: %s rule %s condition value is unknown, so skipping validation for now", v.Name, validation.DeclRange) continue // We'll wait until we've learned more, then. } if result.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: errInvalidCondition, Detail: "Validation condition expression must return either true or false, not null.", Subject: validation.Condition.Range().Ptr(), Expression: validation.Condition, EvalContext: hclCtx, }) continue } var err error result, err = convert.Convert(result, cty.Bool) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: errInvalidCondition, Detail: fmt.Sprintf("Invalid validation condition result value: %s.", err), Subject: validation.Condition.Range().Ptr(), Expression: validation.Condition, EvalContext: hclCtx, }) continue } if result.False() { subj := validation.DeclRange.Ptr() if val.Expr != nil { subj = val.Expr.Range().Ptr() } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Invalid value for %s variable", val.From), Detail: fmt.Sprintf("%s\n\nThis was checked by the validation rule at %s.", validation.ErrorMessage, validation.DeclRange.String()), Subject: subj, }) } } return diags } // Value returns the last found value from the list of variable settings. func (v *Variable) Value() (cty.Value, hcl.Diagnostics) { if len(v.Values) == 0 { return cty.UnknownVal(v.Type), hcl.Diagnostics{&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unset variable %q", v.Name), Detail: "A used variable must be set or have a default value; see " + "https://packer.io/docs/configuration/from-1.5/syntax for " + "details.", Context: v.Range.Ptr(), }} } val := v.Values[len(v.Values)-1] return val.Value, v.validateValue(v.Values[len(v.Values)-1]) } type Variables map[string]*Variable func (variables Variables) Keys() []string { keys := make([]string, 0, len(variables)) for key := range variables { keys = append(keys, key) } return keys } func (variables Variables) Values() (map[string]cty.Value, hcl.Diagnostics) { res := map[string]cty.Value{} var diags hcl.Diagnostics for k, v := range variables { value, moreDiags := v.Value() diags = append(diags, moreDiags...) res[k] = value } return res, diags } // decodeVariable decodes a variable key and value into Variables func (variables *Variables) decodeVariable(key string, attr *hcl.Attribute, ectx *hcl.EvalContext) hcl.Diagnostics { var diags hcl.Diagnostics if (*variables) == nil { (*variables) = Variables{} } if _, found := (*variables)[key]; found { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Duplicate variable", Detail: "Duplicate " + key + " variable definition found.", Subject: attr.NameRange.Ptr(), }) return diags } value, moreDiags := attr.Expr.Value(ectx) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { return diags } (*variables)[key] = &Variable{ Name: key, Values: []VariableAssignment{{ From: "default", Value: value, Expr: attr.Expr, }}, Type: value.Type(), Range: attr.Range, } return diags } var variableBlockSchema = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { Name: "description", }, { Name: "default", }, { Name: "type", }, { Name: "sensitive", }, }, Blocks: []hcl.BlockHeaderSchema{ { Type: "validation", }, }, } // decodeVariableBlock decodes a "variable" block // ectx is passed only in the evaluation of the default value. func (variables *Variables) decodeVariableBlock(block *hcl.Block, ectx *hcl.EvalContext) hcl.Diagnostics { if (*variables) == nil { (*variables) = Variables{} } if _, found := (*variables)[block.Labels[0]]; found { return []*hcl.Diagnostic{{ Severity: hcl.DiagError, Summary: "Duplicate variable", Detail: "Duplicate " + block.Labels[0] + " variable definition found.", Context: block.DefRange.Ptr(), }} } name := block.Labels[0] content, diags := block.Body.Content(variableBlockSchema) if !hclsyntax.ValidIdentifier(name) { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid variable name", Detail: badIdentifierDetail, Subject: &block.LabelRanges[0], }) } v := &Variable{ Name: name, Range: block.DefRange, } if attr, exists := content.Attributes["description"]; exists { valDiags := gohcl.DecodeExpression(attr.Expr, nil, &v.Description) diags = append(diags, valDiags...) } if t, ok := content.Attributes["type"]; ok { tp, moreDiags := typeexpr.Type(t.Expr) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { return diags } v.Type = tp } if attr, exists := content.Attributes["sensitive"]; exists { valDiags := gohcl.DecodeExpression(attr.Expr, nil, &v.Sensitive) diags = append(diags, valDiags...) } if def, ok := content.Attributes["default"]; ok { defaultValue, moreDiags := def.Expr.Value(ectx) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { return diags } if v.Type != cty.NilType { var err error defaultValue, err = convert.Convert(defaultValue, v.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid default value for variable", Detail: fmt.Sprintf("This default value is not compatible with the variable's type constraint: %s.", err), Subject: def.Expr.Range().Ptr(), }) defaultValue = cty.DynamicVal } } v.Values = append(v.Values, VariableAssignment{ From: "default", Value: defaultValue, Expr: def.Expr, }) // It's possible no type attribute was assigned so lets make sure we // have a valid type otherwise there could be issues parsing the value. if v.Type == cty.NilType { v.Type = defaultValue.Type() } } for _, block := range content.Blocks { switch block.Type { case "validation": vv, moreDiags := decodeVariableValidationBlock(v.Name, block) diags = append(diags, moreDiags...) v.Validations = append(v.Validations, vv) } } (*variables)[name] = v return diags } var variableValidationBlockSchema = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { Name: "condition", Required: true, }, { Name: "error_message", Required: true, }, }, } // VariableValidation represents a configuration-defined validation rule // for a particular input variable, given as a "validation" block inside // a "variable" block. type VariableValidation struct { // Condition is an expression that refers to the variable being tested and // contains no other references. The expression must return true to // indicate that the value is valid or false to indicate that it is // invalid. If the expression produces an error, that's considered a bug in // the block defining the validation rule, not an error in the caller. Condition hcl.Expression // ErrorMessage is one or more full sentences, which _should_ be in English // for consistency with the rest of the error message output but can in // practice be in any language as long as it ends with a period. The // message should describe what is required for the condition to return // true in a way that would make sense to a caller of the module. ErrorMessage string DeclRange hcl.Range } func decodeVariableValidationBlock(varName string, block *hcl.Block) (*VariableValidation, hcl.Diagnostics) { var diags hcl.Diagnostics vv := &VariableValidation{ DeclRange: block.DefRange, } content, moreDiags := block.Body.Content(variableValidationBlockSchema) diags = append(diags, moreDiags...) if attr, exists := content.Attributes["condition"]; exists { vv.Condition = attr.Expr // The validation condition must refer to the variable itself and // nothing else; to ensure that the variable declaration can't create // additional edges in the dependency graph. goodRefs := 0 for _, traversal := range vv.Condition.Variables() { ref, moreDiags := addrs.ParseRef(traversal) if !moreDiags.HasErrors() { if addr, ok := ref.Subject.(addrs.InputVariable); ok { if addr.Name == varName { goodRefs++ continue // Reference is valid } } } // If we fall out here then the reference is invalid. diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid reference in variable validation", Detail: fmt.Sprintf("The condition for variable %q can only refer to the variable itself, using var.%s.", varName, varName), Subject: traversal.SourceRange().Ptr(), }) } if goodRefs < 1 { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid variable validation condition", Detail: fmt.Sprintf("The condition for variable %q must refer to var.%s in order to test incoming values.", varName, varName), Subject: attr.Expr.Range().Ptr(), }) } } if attr, exists := content.Attributes["error_message"]; exists { moreDiags := gohcl.DecodeExpression(attr.Expr, nil, &vv.ErrorMessage) diags = append(diags, moreDiags...) if !moreDiags.HasErrors() { const errSummary = "Invalid validation error message" switch { case vv.ErrorMessage == "": diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: errSummary, Detail: "An empty string is not a valid nor useful error message.", Subject: attr.Expr.Range().Ptr(), }) case !looksLikeSentences(vv.ErrorMessage): // Because we're going to include this string verbatim as part // of a bigger error message written in our usual style, we'll // require the given error message to conform to that. We might // relax this in future if e.g. we start presenting these error // messages in a different way, or if Packer starts supporting // producing error messages in other human languages, etc. For // pragmatism we also allow sentences ending with exclamation // points, but we don't mention it explicitly here because // that's not really consistent with the Packer UI writing // style. diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: errSummary, Detail: "Validation error message must be at least one full sentence starting with an uppercase letter ( if the alphabet permits it ) and ending with a period or question mark.", Subject: attr.Expr.Range().Ptr(), }) } } } return vv, diags } // looksLikeSentence is a simple heuristic that encourages writing error // messages that will be presentable when included as part of a larger error // diagnostic whose other text is written in the UI writing style. // // This is intentionally not a very strong validation since we're assuming that // authors want to write good messages and might just need a nudge about // Packer's specific style, rather than that they are going to try to work // around these rules to write a lower-quality message. func looksLikeSentences(s string) bool { s = strings.TrimSpace(s) if len(s) < 1 { return false } runes := []rune(s) // HCL guarantees that all strings are valid UTF-8 first := runes[0] last := runes[len(runes)-1] // If the first rune is a letter then it must be an uppercase letter. To // sorts of nudge people into writting sentences. For alphabets that don't // have the notion of 'upper', this does nothing. if unicode.IsLetter(first) && !unicode.IsUpper(first) { return false } // The string must be at least one full sentence, which implies having // sentence-ending punctuation. return last == '.' || last == '?' || last == '!' } // Prefix your environment variables with VarEnvPrefix so that Packer can see // them. const VarEnvPrefix = "PKR_VAR_" func (cfg *PackerConfig) collectInputVariableValues(env []string, files []*hcl.File, argv map[string]string) hcl.Diagnostics { var diags hcl.Diagnostics variables := cfg.InputVariables for _, raw := range env { if !strings.HasPrefix(raw, VarEnvPrefix) { continue } raw = raw[len(VarEnvPrefix):] // trim the prefix eq := strings.Index(raw, "=") if eq == -1 { // Seems invalid, so we'll ignore it. continue } name := raw[:eq] value := raw[eq+1:] variable, found := variables[name] if !found { // this variable was not defined in the hcl files, let's skip it ! continue } fakeFilename := fmt.Sprintf("<value for var.%s from env>", name) expr, moreDiags := expressionFromVariableDefinition(fakeFilename, value, variable.Type) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } val, valDiags := expr.Value(nil) diags = append(diags, valDiags...) if variable.Type != cty.NilType { var err error val, err = convert.Convert(val, variable.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid value for variable", Detail: fmt.Sprintf("The value for %s is not compatible with the variable's type constraint: %s.", name, err), Subject: expr.Range().Ptr(), }) val = cty.DynamicVal } } variable.Values = append(variable.Values, VariableAssignment{ From: "env", Value: val, Expr: expr, }) } // files will contain files found in the folder then files passed as // arguments. for _, file := range files { // Before we do our real decode, we'll probe to see if there are any // blocks of type "variable" in this body, since it's a common mistake // for new users to put variable declarations in pkrvars rather than // variable value definitions, and otherwise our error message for that // case is not so helpful. { content, _, _ := file.Body.PartialContent(&hcl.BodySchema{ Blocks: []hcl.BlockHeaderSchema{ { Type: "variable", LabelNames: []string{"name"}, }, }, }) for _, block := range content.Blocks { name := block.Labels[0] diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Variable declaration in a .pkrvar file", Detail: fmt.Sprintf("A .pkrvar file is used to assign "+ "values to variables that have already been declared "+ "in .pkr files, not to declare new variables. To "+ "declare variable %q, place this block in one of your"+ " .pkr files, such as variables.pkr.hcl\n\nTo set a "+ "value for this variable in %s, use the definition "+ "syntax instead:\n %s = <value>", name, block.TypeRange.Filename, name), Subject: &block.TypeRange, }) } if diags.HasErrors() { // If we already found problems then JustAttributes below will find // the same problems with less-helpful messages, so we'll bail for // now to let the user focus on the immediate problem. return diags } } attrs, moreDiags := file.Body.JustAttributes() diags = append(diags, moreDiags...) for name, attr := range attrs { variable, found := variables[name] if !found { sev := hcl.DiagWarning if cfg.ValidationOptions.Strict { sev = hcl.DiagError } diags = append(diags, &hcl.Diagnostic{ Severity: sev, Summary: "Undefined variable", Detail: fmt.Sprintf("A %q variable was set but was "+ "not found in known variables. To declare "+ "variable %q, place this block in one of your "+ ".pkr files, such as variables.pkr.hcl", name, name), Context: attr.Range.Ptr(), }) continue } val, moreDiags := attr.Expr.Value(nil) diags = append(diags, moreDiags...) if variable.Type != cty.NilType { var err error val, err = convert.Convert(val, variable.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid value for variable", Detail: fmt.Sprintf("The value for %s is not compatible with the variable's type constraint: %s.", name, err), Subject: attr.Expr.Range().Ptr(), }) val = cty.DynamicVal } } variable.Values = append(variable.Values, VariableAssignment{ From: "varfile", Value: val, Expr: attr.Expr, }) } } // Finally we process values given explicitly on the command line. for name, value := range argv { variable, found := variables[name] if !found { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Undefined -var variable", Detail: fmt.Sprintf("A %q variable was passed in the command "+ "line but was not found in known variables. "+ "To declare variable %q, place this block in one of your"+ " .pkr files, such as variables.pkr.hcl", name, name), }) continue } fakeFilename := fmt.Sprintf("<value for var.%s from arguments>", name) expr, moreDiags := expressionFromVariableDefinition(fakeFilename, value, variable.Type) diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue } val, valDiags := expr.Value(nil) diags = append(diags, valDiags...) if variable.Type != cty.NilType { var err error val, err = convert.Convert(val, variable.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid argument value for -var variable", Detail: fmt.Sprintf("The received arg value for %s is not compatible with the variable's type constraint: %s.", name, err), Subject: expr.Range().Ptr(), }) val = cty.DynamicVal } } variable.Values = append(variable.Values, VariableAssignment{ From: "cmd", Value: val, Expr: expr, }) } return diags } // expressionFromVariableDefinition creates an hclsyntax.Expression that is capable of evaluating the specified value for a given cty.Type. // The specified filename is to identify the source of where value originated from in the diagnostics report, if there is an error. func expressionFromVariableDefinition(filename string, value string, variableType cty.Type) (hclsyntax.Expression, hcl.Diagnostics) { switch variableType { case cty.String, cty.Number, cty.NilType: // when the type is nil (not set in a variable block) we default to // interpreting everything as a string literal. return &hclsyntax.LiteralValueExpr{Val: cty.StringVal(value)}, nil default: return hclsyntax.ParseExpression([]byte(value), filename, hcl.Pos{Line: 1, Column: 1}) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/types.variables_test.go�����������������������������������������������0000664�0000000�0000000�00000052602�13771713062�0022555�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "path/filepath" "testing" "github.com/google/go-cmp/cmp" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/builder/null" . "github.com/hashicorp/packer/hcl2template/internal" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) func TestParse_variables(t *testing.T) { defaultParser := getBasicParser() tests := []parseTest{ {"basic variables", defaultParser, parseTestArgs{"testdata/variables/basic.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "image_name": &Variable{ Name: "image_name", Type: cty.String, Values: []VariableAssignment{{From: "default", Value: cty.StringVal("foo-image-{{user `my_secret`}}")}}, }, "key": &Variable{ Name: "key", Type: cty.String, Values: []VariableAssignment{{From: "default", Value: cty.StringVal("value")}}, }, "my_secret": &Variable{ Name: "my_secret", Type: cty.String, Values: []VariableAssignment{{From: "default", Value: cty.StringVal("foo")}}, }, "image_id": &Variable{ Name: "image_id", Type: cty.String, Values: []VariableAssignment{{From: "default", Value: cty.StringVal("image-id-default")}}, }, "port": &Variable{ Name: "port", Type: cty.Number, Values: []VariableAssignment{{From: "default", Value: cty.NumberIntVal(42)}}, }, "availability_zone_names": &Variable{ Name: "availability_zone_names", Values: []VariableAssignment{{ From: "default", Value: cty.ListVal([]cty.Value{ cty.StringVal("us-west-1a"), }), }}, Type: cty.List(cty.String), Description: fmt.Sprintln("Describing is awesome ;D"), }, "super_secret_password": &Variable{ Name: "super_secret_password", Sensitive: true, Values: []VariableAssignment{{ From: "default", Value: cty.NullVal(cty.String), }}, Type: cty.String, Description: fmt.Sprintln("Handle with care plz"), }, }, LocalVariables: Variables{ "owner": &Variable{ Name: "owner", Values: []VariableAssignment{{ From: "default", Value: cty.StringVal("Community Team"), }}, Type: cty.String, }, "service_name": &Variable{ Name: "service_name", Values: []VariableAssignment{{ From: "default", Value: cty.StringVal("forum"), }}, Type: cty.String, }, }, }, false, false, []packersdk.Build{}, false, }, {"duplicate variable", defaultParser, parseTestArgs{"testdata/variables/duplicate_variable.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "boolean_value": &Variable{ Name: "boolean_value", Values: []VariableAssignment{{ From: "default", Value: cty.BoolVal(false), }}, Type: cty.Bool, }, }, }, true, true, []packersdk.Build{}, false, }, {"duplicate variable in variables", defaultParser, parseTestArgs{"testdata/variables/duplicate_variables.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "boolean_value": &Variable{ Name: "boolean_value", Values: []VariableAssignment{{ From: "default", Value: cty.BoolVal(false), }}, Type: cty.Bool, }, }, }, true, true, []packersdk.Build{}, false, }, {"invalid default type", defaultParser, parseTestArgs{"testdata/variables/invalid_default.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "broken_type": &Variable{ Name: "broken_type", Values: []VariableAssignment{{ From: "default", Value: cty.UnknownVal(cty.DynamicPseudoType), }}, Type: cty.List(cty.String), }, }, }, true, true, []packersdk.Build{}, false, }, {"unknown key", defaultParser, parseTestArgs{"testdata/variables/unknown_key.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "broken_variable": &Variable{ Name: "broken_variable", Values: []VariableAssignment{{From: "default", Value: cty.BoolVal(true)}}, Type: cty.Bool, }, }, }, true, true, []packersdk.Build{}, false, }, {"unset used variable", defaultParser, parseTestArgs{"testdata/variables/unset_used_string_variable.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "foo": &Variable{ Name: "foo", Type: cty.String, }, }, }, true, true, []packersdk.Build{}, true, }, {"unset unused variable", defaultParser, parseTestArgs{"testdata/variables/unset_unused_string_variable.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "foo": &Variable{ Name: "foo", Type: cty.String, }, }, Sources: map[SourceRef]SourceBlock{ SourceRef{Type: "null", Name: "null-builder"}: SourceBlock{ Name: "null-builder", Type: "null", }, }, Builds: Builds{ &BuildBlock{ Sources: []SourceRef{ {Type: "null", Name: "null-builder"}, }, }, }, }, true, true, []packersdk.Build{ &packer.CoreBuild{ Type: "null", Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{}, PostProcessors: [][]packer.CoreBuildPostProcessor{}, Prepared: true, }, }, false, }, {"locals within another locals usage in different files", defaultParser, parseTestArgs{"testdata/variables/complicated", nil, nil}, &PackerConfig{ Basedir: "testdata/variables/complicated", InputVariables: Variables{ "name_prefix": &Variable{ Name: "name_prefix", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("foo")}}, Type: cty.String, }, }, LocalVariables: Variables{ "name_prefix": &Variable{ Name: "name_prefix", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("foo")}}, Type: cty.String, }, "foo": &Variable{ Name: "foo", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("foo")}}, Type: cty.String, }, "bar": &Variable{ Name: "bar", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("foo")}}, Type: cty.String, }, "for_var": &Variable{ Name: "for_var", Values: []VariableAssignment{{From: "default", Value: cty.StringVal("foo")}}, Type: cty.String, }, "bar_var": &Variable{ Name: "bar_var", Values: []VariableAssignment{{ From: "default", Value: cty.TupleVal([]cty.Value{ cty.StringVal("foo"), cty.StringVal("foo"), cty.StringVal("foo"), }), }}, Type: cty.Tuple([]cty.Type{ cty.String, cty.String, cty.String, }), }, }, }, false, false, []packersdk.Build{}, false, }, {"recursive locals", defaultParser, parseTestArgs{"testdata/variables/recursive_locals.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), LocalVariables: Variables{}, }, true, true, []packersdk.Build{}, false, }, {"set variable from var-file", defaultParser, parseTestArgs{"testdata/variables/foo-string.variable.pkr.hcl", nil, []string{"testdata/variables/set-foo-too-wee.hcl"}}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "foo": &Variable{ Name: "foo", Values: []VariableAssignment{ VariableAssignment{"default", cty.StringVal("bar"), nil}, VariableAssignment{"varfile", cty.StringVal("wee"), nil}, }, Type: cty.String, }, }, }, false, false, []packersdk.Build{}, false, }, {"unknown variable from var-file", defaultParser, parseTestArgs{"testdata/variables/empty.pkr.hcl", nil, []string{"testdata/variables/set-foo-too-wee.hcl"}}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), }, true, false, []packersdk.Build{}, false, }, {"provisioner variable decoding", defaultParser, parseTestArgs{"testdata/variables/provisioner_variable_decoding.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables"), InputVariables: Variables{ "max_retries": &Variable{ Name: "max_retries", Values: []VariableAssignment{{"default", cty.StringVal("1"), nil}}, Type: cty.String, }, "max_retries_int": &Variable{ Name: "max_retries_int", Values: []VariableAssignment{{"default", cty.NumberIntVal(1), nil}}, Type: cty.Number, }, }, Sources: map[SourceRef]SourceBlock{ SourceRef{Type: "null", Name: "null-builder"}: SourceBlock{ Name: "null-builder", Type: "null", }, }, Builds: Builds{ &BuildBlock{ Sources: []SourceRef{ {Type: "null", Name: "null-builder"}, }, ProvisionerBlocks: []*ProvisionerBlock{ { PType: "shell", MaxRetries: 1, }, { PType: "shell", MaxRetries: 1, }, }, }, }, }, false, false, []packersdk.Build{&packer.CoreBuild{ Type: "null.null-builder", Prepared: true, Builder: &null.Builder{}, Provisioners: []packer.CoreBuildProvisioner{ { PType: "shell", Provisioner: &packer.RetriedProvisioner{ MaxRetries: 1, Provisioner: &HCL2Provisioner{ Provisioner: &MockProvisioner{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{ Tags: []MockTag{}, }, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, { PType: "shell", Provisioner: &packer.RetriedProvisioner{ MaxRetries: 1, Provisioner: &HCL2Provisioner{ Provisioner: &MockProvisioner{ Config: MockConfig{ NestedMockConfig: NestedMockConfig{ Tags: []MockTag{}, }, NestedSlice: []NestedMockConfig{}, }, }, }, }, }, }, PostProcessors: [][]packer.CoreBuildPostProcessor{}, }, }, false, }, {"valid validation block", defaultParser, parseTestArgs{"testdata/variables/validation/valid.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables", "validation"), InputVariables: Variables{ "image_id": &Variable{ Values: []VariableAssignment{ {"default", cty.StringVal("ami-something-something"), nil}, }, Name: "image_id", Type: cty.String, Validations: []*VariableValidation{ &VariableValidation{ ErrorMessage: `The image_id value must be a valid AMI id, starting with "ami-".`, }, }, }, }, }, false, false, []packersdk.Build{}, false, }, {"valid validation block - invalid default", defaultParser, parseTestArgs{"testdata/variables/validation/invalid_default.pkr.hcl", nil, nil}, &PackerConfig{ Basedir: filepath.Join("testdata", "variables", "validation"), InputVariables: Variables{ "image_id": &Variable{ Values: []VariableAssignment{{"default", cty.StringVal("potato"), nil}}, Name: "image_id", Type: cty.String, Validations: []*VariableValidation{ &VariableValidation{ ErrorMessage: `The image_id value must be a valid AMI id, starting with "ami-".`, }, }, }, }, }, true, true, nil, false, }, } testParse(t, tests) } func TestVariables_collectVariableValues(t *testing.T) { type args struct { env []string hclFiles []string argv map[string]string } tests := []struct { name string variables Variables validationOptions ValidationOptions args args wantDiags bool wantDiagsHasError bool wantVariables Variables wantValues map[string]cty.Value }{ {name: "string", variables: Variables{"used_string": &Variable{ Values: []VariableAssignment{ {"default", cty.StringVal("default_value"), nil}, }, Type: cty.String, }}, args: args{ env: []string{`PKR_VAR_used_string=env_value`}, hclFiles: []string{ `used_string="xy"`, `used_string="varfile_value"`, }, argv: map[string]string{ "used_string": `cmd_value`, }, }, // output wantDiags: false, wantVariables: Variables{ "used_string": &Variable{ Type: cty.String, Values: []VariableAssignment{ {"default", cty.StringVal(`default_value`), nil}, {"env", cty.StringVal(`env_value`), nil}, {"varfile", cty.StringVal(`xy`), nil}, {"varfile", cty.StringVal(`varfile_value`), nil}, {"cmd", cty.StringVal(`cmd_value`), nil}, }, }, }, wantValues: map[string]cty.Value{ "used_string": cty.StringVal("cmd_value"), }, }, {name: "quoted string", variables: Variables{"quoted_string": &Variable{ Values: []VariableAssignment{ {"default", cty.StringVal(`"default_value"`), nil}, }, Type: cty.String, }}, args: args{ env: []string{`PKR_VAR_quoted_string="env_value"`}, hclFiles: []string{ `quoted_string="\"xy\""`, `quoted_string="\"varfile_value\""`, }, argv: map[string]string{ "quoted_string": `"cmd_value"`, }, }, // output wantDiags: false, wantVariables: Variables{ "quoted_string": &Variable{ Type: cty.String, Values: []VariableAssignment{ {"default", cty.StringVal(`"default_value"`), nil}, {"env", cty.StringVal(`"env_value"`), nil}, {"varfile", cty.StringVal(`"xy"`), nil}, {"varfile", cty.StringVal(`"varfile_value"`), nil}, {"cmd", cty.StringVal(`"cmd_value"`), nil}, }, }, }, wantValues: map[string]cty.Value{ "quoted_string": cty.StringVal(`"cmd_value"`), }, }, {name: "array of strings", variables: Variables{"used_strings": &Variable{ Values: []VariableAssignment{ {"default", stringListVal("default_value_1"), nil}, }, Type: cty.List(cty.String), }}, args: args{ env: []string{`PKR_VAR_used_strings=["env_value_1", "env_value_2"]`}, hclFiles: []string{ `used_strings=["xy"]`, `used_strings=["varfile_value_1"]`, }, argv: map[string]string{ "used_strings": `["cmd_value_1"]`, }, }, // output wantDiags: false, wantVariables: Variables{ "used_strings": &Variable{ Type: cty.List(cty.String), Values: []VariableAssignment{ {"default", stringListVal("default_value_1"), nil}, {"env", stringListVal("env_value_1", "env_value_2"), nil}, {"varfile", stringListVal("xy"), nil}, {"varfile", stringListVal("varfile_value_1"), nil}, {"cmd", stringListVal("cmd_value_1"), nil}, }, }, }, wantValues: map[string]cty.Value{ "used_strings": stringListVal("cmd_value_1"), }, }, {name: "bool", variables: Variables{"enabled": &Variable{ Values: []VariableAssignment{{"default", cty.False, nil}}, Type: cty.Bool, }}, args: args{ env: []string{`PKR_VAR_enabled=true`}, hclFiles: []string{ `enabled="false"`, }, argv: map[string]string{ "enabled": `true`, }, }, // output wantDiags: false, wantVariables: Variables{ "enabled": &Variable{ Type: cty.Bool, Values: []VariableAssignment{ {"default", cty.False, nil}, {"env", cty.True, nil}, {"varfile", cty.False, nil}, {"cmd", cty.True, nil}, }, }, }, wantValues: map[string]cty.Value{ "enabled": cty.True, }, }, {name: "invalid env var", variables: Variables{"used_string": &Variable{ Values: []VariableAssignment{{"default", cty.StringVal("default_value"), nil}}, Type: cty.String, }}, args: args{ env: []string{`PKR_VAR_used_string`}, }, // output wantDiags: false, wantVariables: Variables{ "used_string": &Variable{ Type: cty.String, Values: []VariableAssignment{{"default", cty.StringVal("default_value"), nil}}, }, }, wantValues: map[string]cty.Value{ "used_string": cty.StringVal("default_value"), }, }, {name: "undefined but set value - pkrvar file - normal mode", variables: Variables{}, args: args{ hclFiles: []string{`undefined_string="value"`}, }, // output wantDiags: true, wantDiagsHasError: false, wantVariables: Variables{}, wantValues: map[string]cty.Value{}, }, {name: "undefined but set value - pkrvar file - strict mode", variables: Variables{}, validationOptions: ValidationOptions{ Strict: true, }, args: args{ hclFiles: []string{`undefined_string="value"`}, }, // output wantDiags: true, wantDiagsHasError: true, wantVariables: Variables{}, wantValues: map[string]cty.Value{}, }, {name: "undefined but set value - env", variables: Variables{}, args: args{ env: []string{`PKR_VAR_undefined_string=value`}, }, // output wantDiags: false, wantVariables: Variables{}, wantValues: map[string]cty.Value{}, }, {name: "undefined but set value - argv", variables: Variables{}, args: args{ argv: map[string]string{ "undefined_string": "value", }, }, // output wantDiags: true, wantDiagsHasError: true, wantVariables: Variables{}, wantValues: map[string]cty.Value{}, }, {name: "value not corresponding to type - env", variables: Variables{ "used_string": &Variable{ Type: cty.List(cty.String), }, }, args: args{ env: []string{`PKR_VAR_used_string="string"`}, }, // output wantDiags: true, wantDiagsHasError: true, wantVariables: Variables{ "used_string": &Variable{ Type: cty.List(cty.String), Values: []VariableAssignment{{"env", cty.DynamicVal, nil}}, }, }, wantValues: map[string]cty.Value{ "used_string": cty.DynamicVal, }, }, {name: "value not corresponding to type - cfg file", variables: Variables{ "used_string": &Variable{ Type: cty.Bool, }, }, args: args{ hclFiles: []string{`used_string=["string"]`}, }, // output wantDiags: true, wantDiagsHasError: true, wantVariables: Variables{ "used_string": &Variable{ Type: cty.Bool, Values: []VariableAssignment{{"varfile", cty.DynamicVal, nil}}, }, }, wantValues: map[string]cty.Value{ "used_string": cty.DynamicVal, }, }, {name: "value not corresponding to type - argv", variables: Variables{ "used_string": &Variable{ Type: cty.Bool, }, }, args: args{ argv: map[string]string{ "used_string": `["true"]`, }, }, // output wantDiags: true, wantDiagsHasError: true, wantVariables: Variables{ "used_string": &Variable{ Type: cty.Bool, Values: []VariableAssignment{{"cmd", cty.DynamicVal, nil}}, }, }, wantValues: map[string]cty.Value{ "used_string": cty.DynamicVal, }, }, {name: "defining a variable block in a variables file is invalid ", variables: Variables{}, args: args{ hclFiles: []string{`variable "something" {}`}, }, // output wantDiags: true, wantDiagsHasError: true, wantVariables: Variables{}, wantValues: map[string]cty.Value{}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var files []*hcl.File parser := getBasicParser() for i, hclContent := range tt.args.hclFiles { file, diags := parser.ParseHCL([]byte(hclContent), fmt.Sprintf("test_file_%d_*"+hcl2AutoVarFileExt, i)) if diags != nil { t.Fatalf("ParseHCLFile %d: %v", i, diags) } files = append(files, file) } cfg := &PackerConfig{ InputVariables: tt.variables, ValidationOptions: tt.validationOptions, } gotDiags := cfg.collectInputVariableValues(tt.args.env, files, tt.args.argv) if (gotDiags == nil) == tt.wantDiags { t.Fatalf("Variables.collectVariableValues() = %v, want %v", gotDiags, tt.wantDiags) } if tt.wantDiagsHasError != gotDiags.HasErrors() { t.Fatalf("Variables.collectVariableValues() unexpected diagnostics HasErrors. %s", gotDiags) } if diff := cmp.Diff(tt.wantVariables, tt.variables, cmpOpts...); diff != "" { t.Fatalf("didn't get expected variables: %s", diff) } values := map[string]cty.Value{} for k, v := range tt.variables { value, diag := v.Value() if diag != nil { t.Fatalf("Value %s: %v", k, diag) } values[k] = value } if diff := cmp.Diff(fmt.Sprintf("%#v", values), fmt.Sprintf("%#v", tt.wantValues)); diff != "" { t.Fatalf("didn't get expected values: %s", diff) } }) } } func stringListVal(strings ...string) cty.Value { values := []cty.Value{} for _, str := range strings { values = append(values, cty.StringVal(str)) } list, err := convert.Convert(cty.ListVal(values), cty.List(cty.String)) if err != nil { panic(err) } return list } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/utils.go��������������������������������������������������������������0000664�0000000�0000000�00000006151�13771713062�0017541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "io/ioutil" "os" "path/filepath" "strings" "github.com/gobwas/glob" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/packer/hcl2template/repl" hcl2shim "github.com/hashicorp/packer/hcl2template/shim" "github.com/zclconf/go-cty/cty" ) func warningErrorsToDiags(block *hcl.Block, warnings []string, err error) hcl.Diagnostics { var diags hcl.Diagnostics for _, warning := range warnings { diags = append(diags, &hcl.Diagnostic{ Summary: warning, Subject: &block.DefRange, Severity: hcl.DiagWarning, }) } if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: err.Error(), Subject: &block.DefRange, Severity: hcl.DiagError, }) } return diags } func isDir(name string) (bool, error) { s, err := os.Stat(name) if err != nil { return false, err } return s.IsDir(), nil } // GetHCL2Files returns two slices of json formatted and hcl formatted files, // hclSuffix and jsonSuffix tell which file is what. Filename can be a folder // or a file. // // When filename is a folder all files of folder matching the suffixes will be // returned. Otherwise if filename references a file and filename matches one // of the suffixes it is returned in the according slice. func GetHCL2Files(filename, hclSuffix, jsonSuffix string) (hclFiles, jsonFiles []string, diags hcl.Diagnostics) { if filename == "" { return } isDir, err := isDir(filename) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Cannot tell wether " + filename + " is a directory", Detail: err.Error(), }) return nil, nil, diags } if !isDir { if strings.HasSuffix(filename, jsonSuffix) { return nil, []string{filename}, diags } if strings.HasSuffix(filename, hclSuffix) { return []string{filename}, nil, diags } return nil, nil, diags } fileInfos, err := ioutil.ReadDir(filename) if err != nil { diag := &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Cannot read hcl directory", Detail: err.Error(), } diags = append(diags, diag) return nil, nil, diags } for _, fileInfo := range fileInfos { if fileInfo.IsDir() { continue } filename := filepath.Join(filename, fileInfo.Name()) if strings.HasSuffix(filename, hclSuffix) { hclFiles = append(hclFiles, filename) } else if strings.HasSuffix(filename, jsonSuffix) { jsonFiles = append(jsonFiles, filename) } } return hclFiles, jsonFiles, diags } // Convert -only and -except globs to glob.Glob instances. func convertFilterOption(patterns []string, optionName string) ([]glob.Glob, hcl.Diagnostics) { var globs []glob.Glob var diags hcl.Diagnostics for _, pattern := range patterns { g, err := glob.Compile(pattern) if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: fmt.Sprintf("Invalid -%s pattern %s: %s", optionName, pattern, err), Severity: hcl.DiagError, }) } globs = append(globs, g) } return globs, diags } func PrintableCtyValue(v cty.Value) string { if !v.IsWhollyKnown() { return "<unknown>" } gval := hcl2shim.ConfigValueFromHCL2(v) str := repl.FormatResult(gval) return str } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/version.go������������������������������������������������������������0000664�0000000�0000000�00000004031�13771713062�0020061�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) // VersionConstraint represents a version constraint on some resource that // carries with it a source range so that a helpful diagnostic can be printed // in the event that a particular constraint does not match. type VersionConstraint struct { Required version.Constraints DeclRange hcl.Range } func decodeVersionConstraint(attr *hcl.Attribute) (VersionConstraint, hcl.Diagnostics) { ret := VersionConstraint{ DeclRange: attr.Range, } val, diags := attr.Expr.Value(nil) if diags.HasErrors() { return ret, diags } var err error val, err = convert.Convert(val, cty.String) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid version constraint", Detail: fmt.Sprintf("A string value is required for %s.", attr.Name), Subject: attr.Expr.Range().Ptr(), }) return ret, diags } if val.IsNull() { // A null version constraint is strange, but we'll just treat it // like an empty constraint set. return ret, diags } if !val.IsWhollyKnown() { // If there is a syntax error, HCL sets the value of the given attribute // to cty.DynamicVal. A diagnostic for the syntax error will already // bubble up, so we will move forward gracefully here. return ret, diags } constraintStr := val.AsString() constraints, err := version.NewConstraint(constraintStr) if err != nil { // NewConstraint doesn't return user-friendly errors, so we'll just // ignore the provided error and produce our own generic one. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid version constraint", Detail: "This string does not use correct version constraint syntax. Check out the docs: https://packer.io/docs/from-1.5/blocks/packer#version-constraints", Subject: attr.Expr.Range().Ptr(), }) return ret, diags } ret.Required = constraints return ret, diags } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/hcl2template/version_required.go���������������������������������������������������0000664�0000000�0000000�00000002422�13771713062�0021763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl2template import ( "fmt" "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" ) // CheckCoreVersionRequirements visits each of the block in the given // configuration and verifies that any given Core version constraints match // with the version of Packer Core that is being used. // // The returned diagnostics will contain errors if any constraints do not match. // The returned diagnostics might also return warnings, which should be // displayed to the user. func (cfg *PackerConfig) CheckCoreVersionRequirements(coreVersion *version.Version) hcl.Diagnostics { if cfg == nil { return nil } var diags hcl.Diagnostics for _, constraint := range cfg.Packer.VersionConstraints { if !constraint.Required.Check(coreVersion) { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsupported Packer Core version", Detail: fmt.Sprintf( "This configuration does not support Packer version %s. To proceed, either choose another supported Packer version or update this version constraint. Version constraints are normally set for good reason, so updating the constraint may lead to other errors or unexpected behavior.", coreVersion.String(), ), Subject: constraint.DeclRange.Ptr(), }) } } return diags } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/����������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0014742�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedreadline/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020110�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedreadline/wrappedreadline.go������������������������������������������0000664�0000000�0000000�00000004206�13771713062�0023607�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. // // "a little copying is better than a lot of dependency" // // wrappedreadline is a package that has helpers for interacting with // readline from a panicwrap executable. // // panicwrap overrides the standard file descriptors so that the child process // no longer looks like a TTY. The helpers here access the extra file descriptors // passed by panicwrap to fix that. // // panicwrap should be checked for with panicwrap.Wrapped before using this // librar, since this library won't adapt if the binary is not wrapped. package wrappedreadline import ( "runtime" "github.com/chzyer/readline" "github.com/hashicorp/packer/helper/wrappedstreams" ) // Override overrides the values in readline.Config that need to be // set with wrapped values. func Override(cfg *readline.Config) *readline.Config { cfg.Stdin = wrappedstreams.Stdin() cfg.Stdout = wrappedstreams.Stdout() cfg.Stderr = wrappedstreams.Stderr() cfg.FuncGetWidth = TerminalWidth cfg.FuncIsTerminal = IsTerminal rm := RawMode{StdinFd: int(wrappedstreams.Stdin().Fd())} cfg.FuncMakeRaw = rm.Enter cfg.FuncExitRaw = rm.Exit return cfg } // IsTerminal determines if this process is attached to a TTY. func IsTerminal() bool { // Windows is always a terminal if runtime.GOOS == "windows" { return true } // Same implementation as readline but with our custom fds return readline.IsTerminal(int(wrappedstreams.Stdin().Fd())) && (readline.IsTerminal(int(wrappedstreams.Stdout().Fd())) || readline.IsTerminal(int(wrappedstreams.Stderr().Fd()))) } // TerminalWidth gets the terminal width in characters. func TerminalWidth() int { if runtime.GOOS == "windows" { return readline.GetScreenWidth() } return getWidth() } // RawMode is a helper for entering and exiting raw mode. type RawMode struct { StdinFd int state *readline.State } func (r *RawMode) Enter() (err error) { r.state, err = readline.MakeRaw(r.StdinFd) return err } func (r *RawMode) Exit() error { if r.state == nil { return nil } return readline.Restore(r.StdinFd, r.state) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedreadline/wrappedreadline_solaris.go����������������������������������0000664�0000000�0000000�00000000260�13771713062�0025337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package wrappedreadline // getWidth impl for Solaris func getWidth() int { return 80 } // get width of the terminal func getWidthFd(stdoutFd int) int { return getWidth() } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedreadline/wrappedreadline_unix.go�������������������������������������0000664�0000000�0000000�00000001426�13771713062�0024653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build darwin dragonfly freebsd linux,!appengine netbsd openbsd package wrappedreadline import ( "syscall" "unsafe" "github.com/hashicorp/packer/helper/wrappedstreams" ) // getWidth impl for Unix func getWidth() int { stdoutFd := int(wrappedstreams.Stdout().Fd()) stderrFd := int(wrappedstreams.Stderr().Fd()) w := getWidthFd(stdoutFd) if w < 0 { w = getWidthFd(stderrFd) } return w } type winsize struct { Row uint16 Col uint16 Xpixel uint16 Ypixel uint16 } // get width of the terminal func getWidthFd(stdoutFd int) int { ws := &winsize{} retCode, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(stdoutFd), uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws))) if int(retCode) == -1 { _ = errno return -1 } return int(ws.Col) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedreadline/wrappedreadline_windows.go����������������������������������0000664�0000000�0000000�00000000151�13771713062�0025354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build windows package wrappedreadline // getWidth impl for other func getWidth() int { return 0 } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedstreams/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020003�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedstreams/streams.go���������������������������������������������������0000664�0000000�0000000�00000002213�13771713062�0022006�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// STOLEN SHAMELESSLY FROM THE TERRAFORM REPO BECAUSE VENDORING OUT // WRAPPEDREADLINE AND WRAPPEDSTREAMS FELT LIKE TOO MUCH WORK. // // "a little copying is better than a lot of dependency" // // Package wrappedstreams provides access to the standard OS streams // (stdin, stdout, stderr) even if wrapped under panicwrap. package wrappedstreams import ( "os" "github.com/mitchellh/panicwrap" ) // Stdin returns the true stdin of the process. func Stdin() *os.File { stdin, _, _ := fds() return stdin } // Stdout returns the true stdout of the process. func Stdout() *os.File { _, stdout, _ := fds() return stdout } // Stderr returns the true stderr of the process. func Stderr() *os.File { _, _, stderr := fds() return stderr } func fds() (stdin, stdout, stderr *os.File) { stdin, stdout, stderr = os.Stdin, os.Stdout, os.Stderr if panicwrap.Wrapped(nil) { initPlatform() stdin, stdout, stderr = wrappedStdin, wrappedStdout, wrappedStderr } return } // These are the wrapped standard streams. These are setup by the // platform specific code in initPlatform. var ( wrappedStdin *os.File wrappedStdout *os.File wrappedStderr *os.File ) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/helper/wrappedstreams/streams_other.go���������������������������������������������0000664�0000000�0000000�00000000717�13771713062�0023216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !windows package wrappedstreams import ( "os" "sync" ) var initOnce sync.Once func initPlatform() { // These must be initialized lazily, once it's been determined that this is // a wrapped process. initOnce.Do(func() { // The standard streams are passed in via extra file descriptors. wrappedStdin = os.NewFile(uintptr(3), "stdin") wrappedStdout = os.NewFile(uintptr(4), "stdout") wrappedStderr = os.NewFile(uintptr(5), "stderr") }) } �������������������������������������������������packer-1.6.6+ds1/helper/wrappedstreams/streams_windows.go�������������������������������������������0000664�0000000�0000000�00000002107�13771713062�0023562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build windows package wrappedstreams import ( "log" "os" "syscall" ) func initPlatform() { wrappedStdin = openConsole("CONIN$", os.Stdin) wrappedStdout = openConsole("CONOUT$", os.Stdout) wrappedStderr = wrappedStdout } // openConsole opens a console handle, using a backup if it fails. // This is used to get the exact console handle instead of the redirected // handles from panicwrap. func openConsole(name string, backup *os.File) *os.File { // Convert to UTF16 path, err := syscall.UTF16PtrFromString(name) if err != nil { log.Printf("[ERROR] wrappedstreams: %s", err) return backup } // Determine the share mode var shareMode uint32 switch name { case "CONIN$": shareMode = syscall.FILE_SHARE_READ case "CONOUT$": shareMode = syscall.FILE_SHARE_WRITE } // Get the file h, err := syscall.CreateFile( path, syscall.GENERIC_READ|syscall.GENERIC_WRITE, shareMode, nil, syscall.OPEN_EXISTING, 0, 0) if err != nil { log.Printf("[ERROR] wrappedstreams: %s", err) return backup } // Create the Go file return os.NewFile(uintptr(h), name) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/log.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000004735�13771713062�0014604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "bufio" "bytes" "fmt" "io" "os" "strings" ) // These are the environmental variables that determine if we log, and if // we log whether or not the log should go to a file. const EnvLog = "PACKER_LOG" //Set to True const EnvLogFile = "PACKER_LOG_PATH" //Set to a file // logOutput determines where we should send logs (if anywhere). func logOutput() (logOutput io.Writer, err error) { logOutput = nil if os.Getenv(EnvLog) != "" && os.Getenv(EnvLog) != "0" { logOutput = os.Stderr if logPath := os.Getenv(EnvLogFile); logPath != "" { var err error logOutput, err = os.Create(logPath) if err != nil { return nil, err } } else { // no path; do a little light filtering to avoid double-dipping UI // calls. r, w := io.Pipe() scanner := bufio.NewScanner(r) scanner.Split(ScanLinesSmallerThanBuffer) go func(scanner *bufio.Scanner) { for scanner.Scan() { if strings.Contains(scanner.Text(), "ui:") { continue } if strings.Contains(scanner.Text(), "ui error:") { continue } os.Stderr.WriteString(fmt.Sprint(scanner.Text() + "\n")) } if err := scanner.Err(); err != nil { os.Stderr.WriteString(err.Error()) w.Close() } }(scanner) logOutput = w } } return } // The below functions come from bufio.Scanner with a small tweak, to fix an // edgecase where the default ScanFunc fails: sometimes, if someone tries to // log a line that is longer than 64*1024 bytes long before it contains a // newline, the ScanLine will continue to return, requesting more data from the // buffer, which can't increase in size anymore, causing a hang. func dropCR(data []byte) []byte { if len(data) > 0 && data[len(data)-1] == '\r' { return data[0 : len(data)-1] } return data } func ScanLinesSmallerThanBuffer(data []byte, atEOF bool) (advance int, token []byte, err error) { if atEOF && len(data) == 0 { return 0, nil, nil } if i := bytes.IndexByte(data, '\n'); i >= 0 { // We have a full newline-terminated line. return i + 1, dropCR(data[0:i]), nil } // If we're at EOF, we have a final, non-terminated line. Return it. if atEOF { return len(data), dropCR(data), nil } // Our tweak: // Buffer is full, so we can't get more data. Just return what we have as // its own token so we can keep going, even though there's no newline. if len(data)+1 >= bufio.MaxScanTokenSize { return len(data), data[0 : len(data)-1], nil } // Request more data. return 0, nil, nil } �����������������������������������packer-1.6.6+ds1/main.go����������������������������������������������������������������������������0000664�0000000�0000000�00000025550�13771713062�0014745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// This is the main package for the `packer` application. //go:generate go run ./scripts/generate-plugins.go package main import ( "fmt" "io" "io/ioutil" "log" "math/rand" "os" "runtime" "sync" "syscall" "time" "github.com/hashicorp/go-uuid" "github.com/hashicorp/packer/command" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/pathing" pluginsdk "github.com/hashicorp/packer/packer-plugin-sdk/plugin" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/hashicorp/packer/packer/plugin" "github.com/hashicorp/packer/version" "github.com/mitchellh/cli" "github.com/mitchellh/panicwrap" "github.com/mitchellh/prefixedio" ) func main() { // Call realMain instead of doing the work here so we can use // `defer` statements within the function and have them work properly. // (defers aren't called with os.Exit) os.Exit(realMain()) } // realMain is executed from main and returns the exit status to exit with. func realMain() int { var wrapConfig panicwrap.WrapConfig // When following env variable is set, packer // wont panic wrap itself as it's already wrapped. // i.e.: when terraform runs it. wrapConfig.CookieKey = "PACKER_WRAP_COOKIE" wrapConfig.CookieValue = "49C22B1A-3A93-4C98-97FA-E07D18C787B5" if inPlugin() || panicwrap.Wrapped(&wrapConfig) { // Call the real main return wrappedMain() } // Generate a UUID for this packer run and pass it to the environment. // GenerateUUID always returns a nil error (based on rand.Read) so we'll // just ignore it. UUID, _ := uuid.GenerateUUID() os.Setenv("PACKER_RUN_UUID", UUID) // Determine where logs should go in general (requested by the user) logWriter, err := logOutput() if err != nil { fmt.Fprintf(os.Stderr, "Couldn't setup log output: %s", err) return 1 } if logWriter == nil { logWriter = ioutil.Discard } packersdk.LogSecretFilter.SetOutput(logWriter) // Disable logging here log.SetOutput(ioutil.Discard) // We always send logs to a temporary file that we use in case // there is a panic. Otherwise, we delete it. logTempFile, err := tmp.File("packer-log") if err != nil { fmt.Fprintf(os.Stderr, "Couldn't setup logging tempfile: %s", err) return 1 } defer os.Remove(logTempFile.Name()) defer logTempFile.Close() // Tell the logger to log to this file os.Setenv(EnvLog, "") os.Setenv(EnvLogFile, "") // Setup the prefixed readers that send data properly to // stdout/stderr. doneCh := make(chan struct{}) outR, outW := io.Pipe() go copyOutput(outR, doneCh) // Enable checkpoint for panic reporting if config, _ := loadConfig(); config != nil && !config.DisableCheckpoint { packer.CheckpointReporter = packer.NewCheckpointReporter( config.DisableCheckpointSignature, ) } // Create the configuration for panicwrap and wrap our executable wrapConfig.Handler = panicHandler(logTempFile) wrapConfig.Writer = io.MultiWriter(logTempFile, &packersdk.LogSecretFilter) wrapConfig.Stdout = outW wrapConfig.DetectDuration = 500 * time.Millisecond wrapConfig.ForwardSignals = []os.Signal{syscall.SIGTERM} exitStatus, err := panicwrap.Wrap(&wrapConfig) if err != nil { fmt.Fprintf(os.Stderr, "Couldn't start Packer: %s", err) return 1 } // If >= 0, we're the parent, so just exit if exitStatus >= 0 { // Close the stdout writer so that our copy process can finish outW.Close() // Wait for the output copying to finish <-doneCh return exitStatus } // We're the child, so just close the tempfile we made in order to // save file handles since the tempfile is only used by the parent. logTempFile.Close() return 0 } // wrappedMain is called only when we're wrapped by panicwrap and // returns the exit status to exit with. func wrappedMain() int { // If there is no explicit number of Go threads to use, then set it if os.Getenv("GOMAXPROCS") == "" { runtime.GOMAXPROCS(runtime.NumCPU()) } packersdk.LogSecretFilter.SetOutput(os.Stderr) log.SetOutput(&packersdk.LogSecretFilter) inPlugin := inPlugin() if inPlugin { // This prevents double-logging timestamps log.SetFlags(0) } log.Printf("[INFO] Packer version: %s [%s %s %s]", version.FormattedVersion(), runtime.Version(), runtime.GOOS, runtime.GOARCH) // The config being loaded here is the Packer config -- it defines // the location of third party builder plugins, plugin ports to use, and // whether to disable telemetry. It is a global config. // Do not confuse this config with the .json Packer template which gets // passed into commands like `packer build` config, err := loadConfig() if err != nil { fmt.Fprintf(os.Stderr, "Error loading configuration: \n\n%s\n", err) return 1 } // Fire off the checkpoint. go runCheckpoint(config) if !config.DisableCheckpoint { packer.CheckpointReporter = packer.NewCheckpointReporter( config.DisableCheckpointSignature, ) } cacheDir, err := packersdk.CachePath() if err != nil { fmt.Fprintf(os.Stderr, "Error preparing cache directory: \n\n%s\n", err) return 1 } log.Printf("Setting cache directory: %s", cacheDir) // Determine if we're in machine-readable mode by mucking around with // the arguments... args, machineReadable := extractMachineReadable(os.Args[1:]) defer plugin.CleanupClients() var ui packersdk.Ui if machineReadable { // Setup the UI as we're being machine-readable ui = &packer.MachineReadableUi{ Writer: os.Stdout, } // Set this so that we don't get colored output in our machine- // readable UI. if err := os.Setenv("PACKER_NO_COLOR", "1"); err != nil { fmt.Fprintf(os.Stderr, "Packer failed to initialize UI: %s\n", err) return 1 } } else { basicUi := &packersdk.BasicUi{ Reader: os.Stdin, Writer: os.Stdout, ErrorWriter: os.Stdout, PB: &packersdk.NoopProgressTracker{}, } ui = basicUi if !inPlugin { currentPID := os.Getpid() backgrounded, err := checkProcess(currentPID) if err != nil { fmt.Fprintf(os.Stderr, "cannot determine if process is in "+ "background: %s\n", err) } if backgrounded { fmt.Fprint(os.Stderr, "Running in background, not using a TTY\n") } else if TTY, err := openTTY(); err != nil { fmt.Fprintf(os.Stderr, "No tty available: %s\n", err) } else { basicUi.TTY = TTY basicUi.PB = &packer.UiProgressBar{} defer TTY.Close() } } } // Create the CLI meta CommandMeta = &command.Meta{ CoreConfig: &packer.CoreConfig{ Components: packer.ComponentFinder{ Hook: config.StarHook, BuilderStore: config.Builders, ProvisionerStore: config.Provisioners, PostProcessorStore: config.PostProcessors, }, Version: version.Version, }, Ui: ui, } cli := &cli.CLI{ Args: args, Autocomplete: true, Commands: Commands, HelpFunc: excludeHelpFunc(Commands, []string{"plugin"}), HelpWriter: os.Stdout, Name: "packer", Version: version.Version, } exitCode, err := cli.Run() if !inPlugin { if err := packer.CheckpointReporter.Finalize(cli.Subcommand(), exitCode, err); err != nil { log.Printf("[WARN] (telemetry) Error finalizing report. This is safe to ignore. %s", err.Error()) } } if err != nil { fmt.Fprintf(os.Stderr, "Error executing CLI: %s\n", err) return 1 } return exitCode } // excludeHelpFunc filters commands we don't want to show from the list of // commands displayed in packer's help text. func excludeHelpFunc(commands map[string]cli.CommandFactory, exclude []string) cli.HelpFunc { // Make search slice into a map so we can use use the `if found` idiom // instead of a nested loop. var excludes = make(map[string]interface{}, len(exclude)) for _, item := range exclude { excludes[item] = nil } // Create filtered list of commands helpCommands := []string{} for command := range commands { if _, found := excludes[command]; !found { helpCommands = append(helpCommands, command) } } return cli.FilteredHelpFunc(helpCommands, cli.BasicHelpFunc("packer")) } // extractMachineReadable checks the args for the machine readable // flag and returns whether or not it is on. It modifies the args // to remove this flag. func extractMachineReadable(args []string) ([]string, bool) { for i, arg := range args { if arg == "-machine-readable" { // We found it. Slice it out. result := make([]string, len(args)-1) copy(result, args[:i]) copy(result[i:], args[i+1:]) return result, true } } return args, false } func loadConfig() (*config, error) { var config config config.Plugins = plugin.Config{ PluginMinPort: 10000, PluginMaxPort: 25000, } if err := config.Plugins.Discover(); err != nil { return nil, err } // Copy plugins to general list builders, provisioners, postProcessors := config.Plugins.GetPlugins() config.Builders = builders config.Provisioners = provisioners config.PostProcessors = postProcessors // Finally, try to use an internal plugin. Note that this will not override // any previously-loaded plugins. if err := config.discoverInternalComponents(); err != nil { return nil, err } // start by loading from PACKER_CONFIG if available log.Print("Checking 'PACKER_CONFIG' for a config file path") configFilePath := os.Getenv("PACKER_CONFIG") if configFilePath == "" { var err error log.Print("'PACKER_CONFIG' not set; checking the default config file path") configFilePath, err = pathing.ConfigFile() if err != nil { log.Printf("Error detecting default config file path: %s", err) } } if configFilePath == "" { return &config, nil } log.Printf("Attempting to open config file: %s", configFilePath) f, err := os.Open(configFilePath) if err != nil { if !os.IsNotExist(err) { return nil, err } log.Printf("[WARN] Config file doesn't exist: %s", configFilePath) return &config, nil } defer f.Close() // This loads a json config, defined in packer/config.go if err := decodeConfig(f, &config); err != nil { return nil, err } config.LoadExternalComponentsFromConfig() return &config, nil } // copyOutput uses output prefixes to determine whether data on stdout // should go to stdout or stderr. This is due to panicwrap using stderr // as the log and error channel. func copyOutput(r io.Reader, doneCh chan<- struct{}) { defer close(doneCh) pr, err := prefixedio.NewReader(r) if err != nil { panic(err) } stderrR, err := pr.Prefix(ErrorPrefix) if err != nil { panic(err) } stdoutR, err := pr.Prefix(OutputPrefix) if err != nil { panic(err) } defaultR, err := pr.Prefix("") if err != nil { panic(err) } var wg sync.WaitGroup wg.Add(3) go func() { defer wg.Done() io.Copy(os.Stderr, stderrR) }() go func() { defer wg.Done() io.Copy(os.Stdout, stdoutR) }() go func() { defer wg.Done() io.Copy(os.Stdout, defaultR) }() wg.Wait() } func inPlugin() bool { return os.Getenv(pluginsdk.MagicCookieKey) == pluginsdk.MagicCookieValue } func init() { // Seed the random number generator rand.Seed(time.Now().UTC().UnixNano()) } ��������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/main_test.go�����������������������������������������������������������������������0000664�0000000�0000000�00000002575�13771713062�0016006�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "math/rand" "reflect" "strings" "testing" "github.com/hashicorp/packer/command" "github.com/mitchellh/cli" ) func TestExcludeHelpFunc(t *testing.T) { commands := map[string]cli.CommandFactory{ "build": func() (cli.Command, error) { return &command.BuildCommand{ Meta: command.Meta{}, }, nil }, "fix": func() (cli.Command, error) { return &command.FixCommand{ Meta: command.Meta{}, }, nil }, } helpFunc := excludeHelpFunc(commands, []string{"fix"}) helpText := helpFunc(commands) if strings.Contains(helpText, "fix") { t.Fatalf("Found fix in help text even though we excluded it: \n\n%s\n\n", helpText) } } func TestExtractMachineReadable(t *testing.T) { var args, expected, result []string var mr bool // Not args = []string{"foo", "bar", "baz"} result, mr = extractMachineReadable(args) expected = []string{"foo", "bar", "baz"} if !reflect.DeepEqual(result, expected) { t.Fatalf("bad: %#v", result) } if mr { t.Fatal("should not be mr") } // Yes args = []string{"foo", "-machine-readable", "baz"} result, mr = extractMachineReadable(args) expected = []string{"foo", "baz"} if !reflect.DeepEqual(result, expected) { t.Fatalf("bad: %#v", result) } if !mr { t.Fatal("should be mr") } } func TestRandom(t *testing.T) { if rand.Intn(9999999) == 8498210 { t.Fatal("math.rand is not seeded properly") } } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017003�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/Makefile���������������������������������������������������������0000664�0000000�0000000�00000011026�13771713062�0020443�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������TEST?=$(shell go list ./...) COUNT?=1 VET?=$(shell go list ./...) # Get the current full sha from git GOPATH=$(shell go env GOPATH) default: install-build-deps install-gen-deps generate ci: testrace ## Test in continuous integration install-gen-deps: ## Install dependencies for code generation # to avoid having to tidy our go deps, we `go get` our binaries from a temp # dir. `go get` will change our deps and the following deps are not part of # out code dependencies; so a go mod tidy will remove them again. `go # install` seems to install the last tagged version and we want to install # master. @(cd $(TEMPDIR) && GO111MODULE=on go get github.com/mna/@master) @(cd $(TEMPDIR) && GO111MODULE=on go get github.com/alvaroloes/enumer@master) # grab files from github and install them using go install, then remove files again. @mkdir cmd @mkdir cmd/struct-markdown @curl -sSfL -q https://raw.githubusercontent.com/hashicorp/packer/master/cmd/struct-markdown/main.go -o cmd/struct-markdown/main.go @curl -sSfL -q https://raw.githubusercontent.com/hashicorp/packer/master/cmd/struct-markdown/template.go -o cmd/struct-markdown/template.go @go install ./cmd/struct-markdown # in the packer repo @mkdir cmd/mapstructure-to-hcl2 @curl -sSfL -q https://raw.githubusercontent.com/hashicorp/packer/master/cmd/mapstructure-to-hcl2/mapstructure-to-hcl2.go -o cmd/mapstructure-to-hcl2/mapstructure-to-hcl2.go @go install ./cmd/mapstructure-to-hcl2 # in the packer repo @rm -rf cmd install-lint-deps: ## Install linter dependencies # Pinning golangci-lint at v1.23.8 as --new-from-rev seems to work properly; the latest 1.24.0 has caused issues with memory consumption @echo "==> Updating linter dependencies..." @curl -sSfL -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.23.8 lint: install-lint-deps ## Lint Go code @if [ ! -z $(PKG_NAME) ]; then \ echo "golangci-lint run ./$(PKG_NAME)/..."; \ golangci-lint run ./$(PKG_NAME)/...; \ else \ echo "golangci-lint run ./..."; \ golangci-lint run ./...; \ fi ci-lint: install-lint-deps ## On ci only lint newly added Go source files @echo "==> Running linter on newly added Go source files..." GO111MODULE=on golangci-lint run --new-from-rev=$(shell git merge-base origin/master HEAD) ./... fmt: ## Format Go code @go fmt ./... fmt-check: fmt ## Check go code formatting @echo "==> Checking that code complies with go fmt requirements..." @git diff --exit-code; if [ $$? -eq 1 ]; then \ echo "Found files that are not fmt'ed."; \ echo "You can use the command: \`make fmt\` to reformat code."; \ exit 1; \ fi fmt-docs: @find ./website/pages/docs -name "*.md" -exec pandoc --wrap auto --columns 79 --atx-headers -s -f "markdown_github+yaml_metadata_block" -t "markdown_github+yaml_metadata_block" {} -o {} \; # Install js-beautify with npm install -g js-beautify fmt-examples: find examples -name *.json | xargs js-beautify -r -s 2 -n -eol "\n" # generate runs `go generate` to build the dynamically generated # source files. generate: install-gen-deps ## Generate dynamically generated code @echo "==> removing autogenerated markdown..." @find website/pages/ -type f | xargs grep -l '^<!-- Code generated' | xargs rm -f @echo "==> removing autogenerated code..." @find ./ -type f | xargs grep -l '^// Code generated' | xargs rm -f PROJECT_ROOT="$(pwd)" go generate ./... go fmt bootcommand/boot_command.go # go run ./cmd/generate-fixer-deprecations generate-check: generate ## Check go code generation is on par @echo "==> Checking that auto-generated code is not changed..." @git diff --exit-code; if [ $$? -eq 1 ]; then \ echo "Found diffs in go generated code."; \ echo "You can use the command: \`make generate\` to reformat code."; \ echo "ONCE YOU HAVE REGENERATED CODE, IT SHOULD BE COPIED INTO PACKER CORE"; \ exit 1; \ fi test: mode-check vet ## Run unit tests @go test -count $(COUNT) $(TEST) $(TESTARGS) -timeout=3m testrace: mode-check vet ## Test with race detection enabled @GO111MODULE=off go test -count $(COUNT) -race $(TEST) $(TESTARGS) -timeout=3m -p=8 # Runs code coverage and open a html page with report cover: go test -count $(COUNT) $(TEST) $(TESTARGS) -timeout=3m -coverprofile=coverage.out go tool cover -html=coverage.out rm coverage.out vet: ## Vet Go code @go vet $(VET) ; if [ $$? -eq 1 ]; then \ echo "ERROR: Vet found problems in the code."; \ exit 1; \ fi help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/README.md��������������������������������������������������������0000664�0000000�0000000�00000005536�13771713062�0020273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Packer Plugin SDK This SDK enables building Packer plugins. This allows Packer's users to use both the officially-supported builders, provisioners, and post-processors, and custom in-house solutions. Packer itself is a tool for building identical machine images for multiple platforms from a single source configuration. You can find more about Packer on its [website](https://www.packer.io) and [its GitHub repository](https://github.com/hashicorp/packer). ## Packer CLI Compatibility Packer v1.7.0 or later is needed for this SDK. Versions of Packer prior to that release are still compatible with third-party plugins, but the plugins should use the plugin tooling from inside earlier versions of Packer to ensure complete API compatibility. ## Go Compatibility The Packer Plugin SDK is built in Go, and uses the [support policy](https://golang.org/doc/devel/release.html#policy) of Go as its support policy. The two latest major releases of Go are supported by the SDK. Currently, that means Go **1.14** or later must be used when building a provider with the SDK. ## Getting Started See the [Extending Packer](https://www.packer.io/docs/extending) docs for a guided tour of plugin development. ## Documentation See the [Extending Packer](https://www.packer.io/docs/extending) section on the Packer website. ## Packer Scope (Plugins VS Core) ### Packer Core - acts as an RPC _client_ - interacts with the user - parses (HCL/JSON) configuration - manages build as whole, asks **plugin(s)** to manage the image lifecycle and modify the image being built. - discovers **plugin(s)** and their versions per configuration - manages **plugin** lifecycles (i.e. spins up & tears down plugin process) - passes relevant parts of parsed (valid JSON/HCL) and interpolated configuration to **plugin(s)** ### Packer Provider (via this SDK) - acts as RPC _server_ - executes any domain-specific logic based on received parsed configuration. For builders this includes managing the vm lifecycle on a give hypervisor or cloud; for provisioners this involves calling the operation on the remote instance. - tests domain-specific logic via provided acceptance test framework - provides **Core** with template validation, artifact information, and information about whether the plugin process succeeded or failed. ## Migrating to SDK from built-in SDK Migrating to the standalone SDK v1 is covered on the [Plugin SDK section](https://www.packer.io/docs/extend/plugin-sdk.html) of the website. ## Versioning The Packer Plugin SDK is a [Go module](https://github.com/golang/go/wiki/Modules) versioned using [semantic versioning](https://semver.org/). ## Contributing See [`.github/CONTRIBUTING.md`](https://github.com/hashicorp/packer-plugin-sdk/blob/master/.github/CONTRIBUTING.md) ## License [Mozilla Public License v2.0](https://github.com/hashicorp/Packer-plugin-sdk/blob/master/LICENSE) ������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020431�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/doc.go���������������������������������������������������0000664�0000000�0000000�00000016677�13771713062�0021546�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* The acctest package provides an acceptance testing framework for testing builders and provisioners. Writing Provisioner Acceptance Tests Packer has implemented a `ProvisionerTestCase` structure to help write provisioner acceptance tests. ```go type ProvisionerTestCase struct { // Check is called after this step is executed in order to test that // the step executed successfully. If this is not set, then the next // step will be called Check func(*exec.Cmd, string) error // IsCompatible checks whether a provisioner is able to run against a // given builder type and guest operating system, and returns a boolean. // if it returns true, the test combination is okay to run. If false, the // test combination is not okay to run. IsCompatible func(builderType string, BuilderGuestOS string) bool // Name is the name of the test case. Be simple but unique and descriptive. Name string // Setup, if non-nil, will be called once before the test case // runs. This can be used for some setup like setting environment // variables, or for validation prior to the // test running. For example, you can use this to make sure certain // binaries are installed, or text fixtures are in place. Setup func() error // Teardown will be called before the test case is over regardless // of if the test succeeded or failed. This should return an error // in the case that the test can't guarantee all resources were // properly cleaned up. Teardown builderT.TestTeardownFunc // Template is the provisioner template to use. // The provisioner template fragment must be a json-formatted string // containing the provisioner definition but no other portions of a packer // template. For // example: // // ```json // { // "type": "shell-local", // "inline", ["echo hello world"] // } //``` // // is a valid entry for "template" here, but the complete Packer template: // // ```json // { // "provisioners": [ // { // "type": "shell-local", // "inline", ["echo hello world"] // } // ] // } // ``` // // is invalid as input. // // You may provide multiple provisioners in the same template. For example: // ```json // { // "type": "shell-local", // "inline", ["echo hello world"] // }, // { // "type": "shell-local", // "inline", ["echo hello world 2"] // } // ``` Template string // Type is the type of provisioner. Type string } ``` To start writing a new provisioner acceptance test, you should add a test file named `provisioner_acc_test.go` in the same folder as your provisioner is defined. Create a test case by implementing the above struct, and run it by calling `provisioneracc.TestProvisionersAgainstBuilders(testCase, t)` The following example has been adapted from a shell-local provisioner test: ``` import ( "github.com/hashicorp/packer/packer-plugin-sdk/acctest/provisioneracc" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/testutils" ) // ... func TestAccShellProvisioner_basic(t *testing.T) { // Create a json template fragment containing just the provisioners you want // to run. templateString := `{ "type": "shell-local", "script": "test-fixtures/script.sh", "max_retries" : 5 }` // instantiate a test case. testCase := &provisioneracc.ProvisionerTestCase{ IsCompatible: func() bool {return true}, Name: "shell-local-provisioner-basic", Teardown: func() error { testutils.CleanupFiles("test-fixtures/file.txt") return nil }, Template: templateString, Type: "shell-local", Check: func(buildcommand *exec.Cmd, logfile string) error { if buildcommand.ProcessState != nil { if buildcommand.ProcessState.ExitCode() != 0 { return fmt.Errorf("Bad exit code. Logfile: %s", logfile) } } filecontents, err := loadFile("file.txt") if err != nil { return err } if !strings.Contains(filecontents, "hello") { return fmt.Errorf("file contents were wrong: %s", filecontents) } return nil }, } provisioneracc.TestProvisionersAgainstBuilders(testCase, t) } ``` After writing the struct and implementing the interface, now is time to write the test that will run all of this code you wrote. Your test should be like: ```go func TestShellProvisioner(t *testing.T) { acc.TestProvisionersPreCheck("shell", t) acc.TestProvisionersAgainstBuilders(new(ShellProvisionerAccTest), t) } ``` The method `TestProvisionersAgainstBuilders` will run the provisioner against all available and compatible builders. If there are not builders compatible with the test you want to run, you can add a builder using the following steps: Create a subdirectory in provisioneracc/test-fixtures for the type of builder you are adding. In this subdirectory, add one json file containing a single builder fragment. For example, one of our amazon-ebs builders is defined in provisioneracc/test-fixtures/amazon-ebs/amazon-ebs.txt and contains: ```json { "type": "amazon-ebs", "ami_name": "packer-acc-test", "instance_type": "t2.micro", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*", "root-device-type": "ebs" }, "owners": ["099720109477"], "most_recent": true }, "force_deregister" : true, "tags": { "packer-test": "true" } } ``` note that this fragment does not contain anything other than a single builder definition. The testing framework will combine this with the provisioner fragment to create a working json template. In order to tell the testing framework how to use this builder fragment, you need to implement a `BuilderFixture` struct: ```go type BuilderFixture struct { // Name is the name of the builder fixture. // Be simple and descriptive. Name string // Setup creates necessary extra test fixtures, and renders their values // into the BuilderFixture.Template. Setup func() // Template is the path to a builder template fragment. // The builder template fragment must be a json-formatted file containing // the builder definition but no other portions of a packer template. For // example: // // ```json // { // "type": "null", // "communicator", "none" // } //``` // // is a valid entry for "template" here, but the complete Packer template: // // ```json // { // "builders": [ // "type": "null", // "communicator": "none" // ] // } // ``` // // is invalid as input. // // Only provide one builder template fragment per file. TemplatePath string // GuestOS says what guest os type the builder template fragment creates. // Valid values are "windows", "linux" or "darwin" guests. GuestOS string // HostOS says what host os type the builder is capable of running on. // Valid values are "any", windows", or "posix". If you set "posix", then // this builder can run on a "linux" or "darwin" platform. If you set // "any", then this builder can be used on any platform. HostOS string Teardown builderT.TestTeardownFunc } ``` Implement this struct to the file "provisioneracc/builders.go", then add the new implementation to the `BuildersAccTest` map in `provisioneracc/provisioners.go` Once you finish these steps, you should be ready to run your new provisioner acceptance test by setting the name used in the BuildersAccTest map as your `ACC_TEST_BUILDERS` environment variable. */ package acctest �����������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023457�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/builders.go�������������������������������0000664�0000000�0000000�00000003501�13771713062�0025616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* The provisioneracc package creates a framework for provisioner acceptance testing. For builder acceptance testing, use the top level tooling in the acctest package. */ package provisioneracc import ( "github.com/hashicorp/packer/packer-plugin-sdk/acctest/testutils" ) // Variables stored in this file represent implementations of the BuilderFixture // struct inside of provisioners.go // AmasonEBSBuilderFixtureLinux points to a build stub of a simple amazon-ebs // build running on a linux operating system. var AmasonEBSBuilderFixtureLinux = &BuilderFixture{ Name: "Amazon-ebs Linux builder", TemplatePath: "amazon-ebs/amazon-ebs.txt", GuestOS: "linux", HostOS: "any", Teardown: func() error { // TODO // helper := AWSHelper{ // Region: "us-east-1", // AMIName: "packer-acc-test", // } // return helper.CleanUpAmi() return nil }, } // AmasonEBSBuilderFixtureWindows points to a build stub of a simple amazon-ebs // build running on a Windows operating system. var AmasonEBSBuilderFixtureWindows = &BuilderFixture{ Name: "Amazon-ebs Windows builder", TemplatePath: "amazon-ebs/amazon-ebs_windows.txt", GuestOS: "windows", HostOS: "any", Teardown: func() error { // TODO // helper := AWSHelper{ // Region: "us-east-1", // AMIName: "packer-acc-test", // } // return helper.CleanUpAmi() return nil }, } // VirtualboxBuilderFixtureLinux points to a build stub of a simple amazon-ebs // build running on a linux operating system. var VirtualboxBuilderFixtureLinux = &BuilderFixture{ Name: "Virtualbox Windows builder", TemplatePath: "virtualbox/virtualbox-iso.txt", GuestOS: "linux", HostOS: "any", Teardown: func() error { testutils.CleanupFiles("virtualbox-iso-packer-acc-test") testutils.CleanupFiles("packer_cache") return nil }, } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/provisioners.go���������������������������0000664�0000000�0000000�00000025157�13771713062�0026562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package provisioneracc import ( "bytes" "fmt" "io/ioutil" "log" "os" "os/exec" "path/filepath" "runtime" "strings" "testing" builderT "github.com/hashicorp/packer/packer-plugin-sdk/acctest" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // ProvisionerTestCase is a single set of tests to run for a provisioner. // A ProvisionerTestCase should generally map 1:1 to each test method for your // acceptance tests. type ProvisionerTestCase struct { // Check is called after this step is executed in order to test that // the step executed successfully. If this is not set, then the next // step will be called Check func(*exec.Cmd, string) error // IsCompatible checks whether a provisioner is able to run against a // given builder type and guest operating system, and returns a boolean. // if it returns true, the test combination is okay to run. If false, the // test combination is not okay to run. IsCompatible func(builderType string, BuilderGuestOS string) bool // Name is the name of the test case. Be simple but unique and descriptive. Name string // Setup, if non-nil, will be called once before the test case // runs. This can be used for some setup like setting environment // variables, or for validation prior to the // test running. For example, you can use this to make sure certain // binaries are installed, or text fixtures are in place. Setup func() error // Teardown will be called before the test case is over regardless // of if the test succeeded or failed. This should return an error // in the case that the test can't guarantee all resources were // properly cleaned up. Teardown builderT.TestTeardownFunc // Template is the provisioner template to use. // The provisioner template fragment must be a json-formatted string // containing the provisioner definition but no other portions of a packer // template. For // example: // // ```json // { // "type": "shell-local", // "inline", ["echo hello world"] // } //``` // // is a valid entry for "template" here, but the complete Packer template: // // ```json // { // "provisioners": [ // { // "type": "shell-local", // "inline", ["echo hello world"] // } // ] // } // ``` // // is invalid as input. // // You may provide multiple provisioners in the same template. For example: // ```json // { // "type": "shell-local", // "inline", ["echo hello world"] // }, // { // "type": "shell-local", // "inline", ["echo hello world 2"] // } // ``` Template string // Type is the type of provisioner. Type string } // BuilderFixtures are basic builder test configurations and metadata used // in provisioner acceptance testing. These are frameworks to be used by // provisioner tests, not tests in and of themselves. BuilderFixtures should // generally be simple and not contain excessive or complex configurations. // Instantiations of this struct are stored in the builders.go file in this // module. type BuilderFixture struct { // Name is the name of the builder fixture. // Be simple and descriptive. Name string // Setup creates necessary extra test fixtures, and renders their values // into the BuilderFixture.Template. Setup func() // Template is the path to a builder template fragment. // The builder template fragment must be a json-formatted file containing // the builder definition but no other portions of a packer template. For // example: // // ```json // { // "type": "null", // "communicator", "none" // } //``` // // is a valid entry for "template" here, but the complete Packer template: // // ```json // { // "builders": [ // "type": "null", // "communicator": "none" // ] // } // ``` // // is invalid as input. // // Only provide one builder template fragment per file. TemplatePath string // GuestOS says what guest os type the builder template fragment creates. // Valid values are "windows", "linux" or "darwin" guests. GuestOS string // HostOS says what host os type the builder is capable of running on. // Valid values are "any", windows", or "posix". If you set "posix", then // this builder can run on a "linux" or "darwin" platform. If you set // "any", then this builder can be used on any platform. HostOS string Teardown builderT.TestTeardownFunc } func fixtureDir() string { _, file, _, _ := runtime.Caller(0) return filepath.Join(filepath.Dir(file), "test-fixtures") } func LoadBuilderFragment(templateFragmentPath string) (string, error) { dir := fixtureDir() fragmentAbsPath := filepath.Join(dir, templateFragmentPath) fragmentFile, err := os.Open(fragmentAbsPath) if err != nil { return "", fmt.Errorf("Unable find %s", fragmentAbsPath) } defer fragmentFile.Close() fragmentString, err := ioutil.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } return string(fragmentString), nil } func RunProvisionerAccTest(testCase *ProvisionerTestCase, t *testing.T) { TestProvisionersAgainstBuilders(testCase, t) } //nolint:errcheck func TestProvisionersAgainstBuilders(testCase *ProvisionerTestCase, t *testing.T) { // retrieve user-desired builders. builderTypes := checkBuilders(t) // Run this provisioner test case against each builder type requested. for _, builderType := range builderTypes { buildFixtures := BuildersAccTest[builderType] // loop over individual build templates, merge with provisioner // templates, and shell out to run test. for _, buildFixture := range buildFixtures { if !testCase.IsCompatible(builderType, buildFixture.GuestOS) { continue } testName := fmt.Sprintf("%s on %s", testCase.Name, buildFixture.Name) if testCase.Setup != nil { err := testCase.Setup() if err != nil { t.Fatalf("test %s setup failed: %s", testName, err) } } t.Run(testName, func(t *testing.T) { builderFragment, err := LoadBuilderFragment(buildFixture.TemplatePath) if err != nil { t.Fatalf("failed to load builder fragment: %s", err) } // Combine provisioner and builder template fragments; write to // file. out := bytes.NewBuffer(nil) fmt.Fprintf(out, `{"builders": [%s],"provisioners": [%s]}`, builderFragment, testCase.Template) templateName := fmt.Sprintf("%s_%s.json", builderType, testCase.Type) templatePath := filepath.Join("./", templateName) writeJsonTemplate(out, templatePath, t) logfile := fmt.Sprintf("packer_log_%s_%s.txt", builderType, testCase.Type) // Make sure packer is installed: packerbin, err := exec.LookPath("packer") if err != nil { t.Fatalf("Couldn't find packer binary installed on system: %s", err.Error()) } // Run build buildCommand := exec.Command(packerbin, "build", "--machine-readable", templatePath) buildCommand.Env = append(buildCommand.Env, os.Environ()...) buildCommand.Env = append(buildCommand.Env, "PACKER_LOG=1", fmt.Sprintf("PACKER_LOG_PATH=%s", logfile)) buildCommand.Run() // Check for test custom pass/fail before we clean up var checkErr error if testCase.Check != nil { checkErr = testCase.Check(buildCommand, logfile) } // Cleanup stuff created by builder. cleanErr := buildFixture.Teardown() if cleanErr != nil { log.Printf("bad: failed to clean up builder-created resources: %s", cleanErr.Error()) } // Clean up anything created in provisioner run if testCase.Teardown != nil { cleanErr = testCase.Teardown() if cleanErr != nil { log.Printf("bad: failed to clean up test-created resources: %s", cleanErr.Error()) } } // Fail test if check failed. if checkErr != nil { cwd, _ := os.Getwd() t.Fatalf(fmt.Sprintf("Error running provisioner acceptance"+ " tests: %s\nLogs can be found at %s\nand the "+ "acceptance test template can be found at %s", checkErr.Error(), filepath.Join(cwd, logfile), filepath.Join(cwd, templatePath))) } else { os.Remove(templatePath) os.Remove(logfile) } }) } } } // checkBuilders retrieves all of the builders that the user has requested to // run acceptance tests against. func checkBuilders(t *testing.T) []string { b := os.Getenv("ACC_TEST_BUILDERS") // validate if we want to run provisioners acc tests if b == "" { t.Skip("Provisioners Acceptance tests skipped unless env 'ACC_TEST_BUILDERS' is set") } // Get builders type to test provisioners against var builders []string for k := range BuildersAccTest { // This will validate that only defined builders are executed against if b != "all" && !strings.Contains(b, k) { continue } builders = append(builders, k) } return builders } func writeJsonTemplate(out *bytes.Buffer, filePath string, t *testing.T) { outputFile, err := os.Create(filePath) if err != nil { t.Fatalf("bad: failed to create template file: %s", err.Error()) } _, err = outputFile.Write(out.Bytes()) if err != nil { t.Fatalf("bad: failed to write template file: %s", err.Error()) } outputFile.Sync() } // BuilderAcceptance is specialized tooling implemented by individual builders. // To add your builder to the provisioner testing framework, create a struct // that implements this interface, add it to the BuildersAccTest map below. // TODO add this interface to the plugin server so that Packer can request it // From the plugin rather than importing it here. type BuilderAcceptance interface { // GetConfigs provides a mapping of guest OS architecture to builder // template fragment. // The builder template fragment must be a json-formatted string containing // the builder definition but no other portions of a packer template. For // example: // // ```json // { // "type": "null", // "communicator", "none" // } //``` // // is a valid entry for "template" here, but the complete Packer template: // // ```json // { // "builders": [ // "type": "null", // "communicator": "none" // ] // } // ``` // // is invalid as input. // // Valid keys for the map are "linux" and "windows". These keys will be used // to determine whether a given builder template is compatible with a given // provisioner template. GetConfigs() (map[string]string, error) // GetBuilderStore() returns a MapOfBuilder that contains the actual builder // struct definition being used for this test. GetBuilderStore() packersdk.MapOfBuilder // CleanUp cleans up any side-effects of the builder not already cleaned up // by the builderT framework. CleanUp() error } // Mapping of all builder fixtures defined for a given builder type. var BuildersAccTest = map[string][]*BuilderFixture{ "virtualbox-iso": []*BuilderFixture{VirtualboxBuilderFixtureLinux}, "amazon-ebs": []*BuilderFixture{AmasonEBSBuilderFixtureLinux, AmasonEBSBuilderFixtureWindows}, } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/����������������������������0000775�0000000�0000000�00000000000�13771713062�0026305�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/amazon-ebs/�����������������0000775�0000000�0000000�00000000000�13771713062�0030341�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/amazon-ebs/amazon-ebs.txt���0000664�0000000�0000000�00000000714�13771713062�0033140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "type": "amazon-ebs", "ami_name": "packer-acc-test", "instance_type": "t2.micro", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*", "root-device-type": "ebs" }, "owners": ["099720109477"], "most_recent": true }, "force_deregister" : true, "tags": { "packer-test": "true" } }����������������������������������������������������amazon-ebs_windows.txt������������������������������������������������������������������������������0000664�0000000�0000000�00000001152�13771713062�0034630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/amazon-ebs�������������������������������������������������������������������������������������{ "type": "amazon-ebs", "region": "us-east-1", "instance_type": "t2.micro", "source_ami_filter": { "filters": { "virtualization-type": "hvm", "name": "*Windows_Server-2012-R2*English-64Bit-Base*", "root-device-type": "ebs" }, "most_recent": true, "owners": "amazon" }, "ami_name": "packer-acc-test", "user_data_file": "../../builder/amazon/ebs/acceptance/test-fixtures/scripts/bootstrap_win.txt", "communicator": "winrm", "winrm_username": "Administrator", "winrm_password": "SuperS3cr3t!!!!", "force_deregister" : true, "tags": { "packer-test": "true" } }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/amazon-ebs/scripts/���������0000775�0000000�0000000�00000000000�13771713062�0032030�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������bootstrap_win.txt�����������������������������������������������������������������������������������0000664�0000000�0000000�00000003747�13771713062�0035417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/amazon-ebs/scripts�����������������������������������������������������������������������������<powershell> # Set administrator password net user Administrator SuperS3cr3t!!!! wmic useraccount where "name='Administrator'" set PasswordExpires=FALSE # First, make sure WinRM can't be connected to netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes action=block # Delete any existing WinRM listeners winrm delete winrm/config/listener?Address=*+Transport=HTTP 2>$Null winrm delete winrm/config/listener?Address=*+Transport=HTTPS 2>$Null # Disable group policies which block basic authentication and unencrypted login Set-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\WinRM\Client -Name AllowBasic -Value 1 Set-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\WinRM\Client -Name AllowUnencryptedTraffic -Value 1 Set-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\WinRM\Service -Name AllowBasic -Value 1 Set-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\WinRM\Service -Name AllowUnencryptedTraffic -Value 1 # Create a new WinRM listener and configure winrm create winrm/config/listener?Address=*+Transport=HTTP winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}' winrm set winrm/config '@{MaxTimeoutms="7200000"}' winrm set winrm/config/service '@{AllowUnencrypted="true"}' winrm set winrm/config/service '@{MaxConcurrentOperationsPerUser="12000"}' winrm set winrm/config/service/auth '@{Basic="true"}' winrm set winrm/config/client/auth '@{Basic="true"}' # Configure UAC to allow privilege elevation in remote shells $Key = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' $Setting = 'LocalAccountTokenFilterPolicy' Set-ItemProperty -Path $Key -Name $Setting -Value 1 -Force # Configure and restart the WinRM Service; Enable the required firewall exception Stop-Service -Name WinRM Set-Service -Name WinRM -StartupType Automatic netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new action=allow localip=any remoteip=any Start-Service -Name WinRM </powershell> �������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/virtualbox/�����������������0000775�0000000�0000000�00000000000�13771713062�0030504�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/virtualbox/http/������������0000775�0000000�0000000�00000000000�13771713062�0031463�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/virtualbox/http/preseed.cfg�0000664�0000000�0000000�00000003430�13771713062�0033573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Preseeding only locale sets language, country and locale. d-i debian-installer/locale string en_US # Keyboard selection. d-i console-setup/ask_detect boolean false d-i keyboard-configuration/xkb-keymap select us choose-mirror-bin mirror/http/proxy string d-i base-installer/kernel/override-image string linux-server d-i clock-setup/utc boolean true d-i clock-setup/utc-auto boolean true d-i finish-install/reboot_in_progress note d-i grub-installer/only_debian boolean true d-i grub-installer/with_other_os boolean true d-i mirror/country string manual d-i mirror/http/directory string /ubuntu/ d-i mirror/http/hostname string archive.ubuntu.com d-i mirror/http/proxy string d-i partman-auto-lvm/guided_size string max d-i partman-auto/choose_recipe select atomic d-i partman-auto/method string lvm d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-lvm/device_remove_lvm boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true d-i partman/confirm_write_new_label boolean true d-i passwd/user-fullname string vagrant d-i passwd/user-uid string 1000 d-i passwd/user-password password vagrant d-i passwd/user-password-again password vagrant d-i passwd/username string vagrant d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-kernel-server nfs-common linux-headers-$(uname -r) perl d-i pkgsel/install-language-support boolean false d-i pkgsel/update-policy select none d-i pkgsel/upgrade select full-upgrade d-i time/zone string UTC d-i user-setup/allow-password-weak boolean true d-i user-setup/encrypt-home boolean false tasksel tasksel/first multiselect standard, server ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������virtualbox-iso.txt����������������������������������������������������������������������������������0000664�0000000�0000000�00000002642�13771713062�0034161�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/acctest/provisioneracc/test-fixtures/virtualbox�������������������������������������������������������������������������������������{ "type": "virtualbox-iso", "iso_checksum": "sha256:946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2", "iso_url": "http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso", "disk_size": "40960", "guest_os_type": "Ubuntu_64", "headless" : "true", "ssh_password": "vagrant", "ssh_username": "vagrant", "ssh_wait_timeout": "10000s", "http_directory": "../../builder/virtualbox/iso/acceptance/test-fixtures/http", "boot_wait": "10s", "boot_command": [ "<esc><wait>", "<esc><wait>", "<enter><wait>", "/install/vmlinuz<wait>", " auto<wait>", " console-setup/ask_detect=false<wait>", " console-setup/layoutcode=us<wait>", " console-setup/modelcode=pc105<wait>", " debconf/frontend=noninteractive<wait>", " debian-installer=en_US.UTF-8<wait>", " fb=false<wait>", " initrd=/install/initrd.gz<wait>", " kbd-chooser/method=us<wait>", " keyboard-configuration/layout=USA<wait>", " keyboard-configuration/variant=USA<wait>", " locale=en_US.UTF-8<wait>", " netcfg/get_domain=vm<wait>", " netcfg/get_hostname=vagrant<wait>", " noapic<wait>", " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>", " -- <wait>", "<enter><wait>" ], "output_directory": "virtualbox-iso-packer-acc-test", "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now", "post_shutdown_delay": "60s" }����������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/testing.go�����������������������������������������������0000664�0000000�0000000�00000014617�13771713062�0022446�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package acctest import ( "context" "fmt" "io/ioutil" "log" "os" "strings" "testing" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template" "github.com/hashicorp/packer/provisioner/file" shellprovisioner "github.com/hashicorp/packer/provisioner/shell" ) // TestEnvVar must be set to a non-empty value for acceptance tests to run. const TestEnvVar = "PACKER_ACC" // TestCase is a single set of tests to run for a backend. A TestCase // should generally map 1:1 to each test method for your acceptance // tests. type TestCase struct { // Precheck, if non-nil, will be called once before the test case // runs at all. This can be used for some validation prior to the // test running. PreCheck func() // Builder is the Builder that will be tested. It will be available // as the "test" builder in the template. Builder packersdk.Builder // Template is the template contents to use. Template string // Check is called after this step is executed in order to test that // the step executed successfully. If this is not set, then the next // step will be called Check TestCheckFunc // Teardown will be called before the test case is over regardless // of if the test succeeded or failed. This should return an error // in the case that the test can't guarantee all resources were // properly cleaned up. Teardown TestTeardownFunc // If SkipArtifactTeardown is true, we will not attempt to destroy the // artifact created in this test run. SkipArtifactTeardown bool // If set, overrides the default provisioner store with custom provisioners. // This can be useful for running acceptance tests for a particular // provisioner using a specific builder. // Default provisioner store: // ProvisionerStore: packersdk.MapOfProvisioner{ // "shell": func() (packersdk.Provisioner, error) { return &shellprovisioner.Provisioner{}, nil }, // "file": func() (packersdk.Provisioner, error) { return &file.Provisioner{}, nil }, // }, ProvisionerStore packersdk.MapOfProvisioner } // TestCheckFunc is the callback used for Check in TestStep. type TestCheckFunc func([]packersdk.Artifact) error // TestTeardownFunc is the callback used for Teardown in TestCase. type TestTeardownFunc func() error // TestT is the interface used to handle the test lifecycle of a test. // // Users should just use a *testing.T object, which implements this. type TestT interface { Error(args ...interface{}) Fatal(args ...interface{}) Skip(args ...interface{}) } type TestBuilderStore struct { packer.BuilderStore StartFn func(name string) (packersdk.Builder, error) } func (tbs TestBuilderStore) Start(name string) (packersdk.Builder, error) { return tbs.StartFn(name) } // Test performs an acceptance test on a backend with the given test case. // // Tests are not run unless an environmental variable "PACKER_ACC" is // set to some non-empty value. This is to avoid test cases surprising // a user by creating real resources. // // Tests will fail unless the verbose flag (`go test -v`, or explicitly // the "-test.v" flag) is set. Because some acceptance tests take quite // long, we require the verbose flag so users are able to see progress // output. func Test(t TestT, c TestCase) { // We only run acceptance tests if an env var is set because they're // slow and generally require some outside configuration. if os.Getenv(TestEnvVar) == "" { t.Skip(fmt.Sprintf( "Acceptance tests skipped unless env '%s' set", TestEnvVar)) return } // We require verbose mode so that the user knows what is going on. if !testTesting && !testing.Verbose() { t.Fatal("Acceptance tests must be run with the -v flag on tests") return } // Run the PreCheck if we have it if c.PreCheck != nil { c.PreCheck() } // Parse the template log.Printf("[DEBUG] Parsing template...") tpl, err := template.Parse(strings.NewReader(c.Template)) if err != nil { t.Fatal(fmt.Sprintf("Failed to parse template: %s", err)) return } if c.ProvisionerStore == nil { c.ProvisionerStore = packersdk.MapOfProvisioner{ "shell": func() (packersdk.Provisioner, error) { return &shellprovisioner.Provisioner{}, nil }, "file": func() (packersdk.Provisioner, error) { return &file.Provisioner{}, nil }, } } // Build the core log.Printf("[DEBUG] Initializing core...") core := packer.NewCore(&packer.CoreConfig{ Components: packer.ComponentFinder{ BuilderStore: TestBuilderStore{ StartFn: func(n string) (packersdk.Builder, error) { if n == "test" { return c.Builder, nil } return nil, nil }, }, ProvisionerStore: c.ProvisionerStore, }, Template: tpl, }) err = core.Initialize() if err != nil { t.Fatal(fmt.Sprintf("Failed to init core: %s", err)) return } // Get the build log.Printf("[DEBUG] Retrieving 'test' build") build, err := core.Build("test") if err != nil { t.Fatal(fmt.Sprintf("Failed to get 'test' build: %s", err)) return } // Prepare it log.Printf("[DEBUG] Preparing 'test' build") warnings, err := build.Prepare() if err != nil { t.Fatal(fmt.Sprintf("Prepare error: %s", err)) return } if len(warnings) > 0 { t.Fatal(fmt.Sprintf( "Prepare warnings:\n\n%s", strings.Join(warnings, "\n"))) return } // Run it! We use a temporary directory for caching and discard // any UI output. We discard since it shows up in logs anyways. log.Printf("[DEBUG] Running 'test' build") ui := &packersdk.BasicUi{ Reader: os.Stdin, Writer: ioutil.Discard, ErrorWriter: ioutil.Discard, PB: &packersdk.NoopProgressTracker{}, } artifacts, err := build.Run(context.Background(), ui) if err != nil { t.Fatal(fmt.Sprintf("Run error:\n\n%s", err)) goto TEARDOWN } // Check function if c.Check != nil { log.Printf("[DEBUG] Running check function") if err := c.Check(artifacts); err != nil { t.Fatal(fmt.Sprintf("Check error:\n\n%s", err)) goto TEARDOWN } } TEARDOWN: if !c.SkipArtifactTeardown { // Delete all artifacts for _, a := range artifacts { if err := a.Destroy(); err != nil { t.Error(fmt.Sprintf( "!!! ERROR REMOVING ARTIFACT '%s': %s !!!", a.String(), err)) } } } // Teardown if c.Teardown != nil { log.Printf("[DEBUG] Running teardown function") if err := c.Teardown(); err != nil { t.Fatal(fmt.Sprintf("Teardown failure:\n\n%s", err)) return } } } // This is for unit tests of this package. var testTesting = false �����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/testing_test.go������������������������������������������0000664�0000000�0000000�00000002150�13771713062�0023472�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package acctest import ( "os" "testing" ) func init() { testTesting = true if err := os.Setenv(TestEnvVar, "1"); err != nil { panic(err) } } func TestTest_noEnv(t *testing.T) { // Unset the variable if err := os.Setenv(TestEnvVar, ""); err != nil { t.Fatalf("err: %s", err) } defer os.Setenv(TestEnvVar, "1") mt := new(mockT) Test(mt, TestCase{}) if !mt.SkipCalled { t.Fatal("skip not called") } } func TestTest_preCheck(t *testing.T) { called := false mt := new(mockT) Test(mt, TestCase{ PreCheck: func() { called = true }, }) if !called { t.Fatal("precheck should be called") } } // mockT implements TestT for testing type mockT struct { ErrorCalled bool ErrorArgs []interface{} FatalCalled bool FatalArgs []interface{} SkipCalled bool SkipArgs []interface{} f bool } func (t *mockT) Error(args ...interface{}) { t.ErrorCalled = true t.ErrorArgs = args t.f = true } func (t *mockT) Fatal(args ...interface{}) { t.FatalCalled = true t.FatalArgs = args t.f = true } func (t *mockT) Skip(args ...interface{}) { t.SkipCalled = true t.SkipArgs = args t.f = true } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/testutils/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022471�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/acctest/testutils/utils.go���������������������������������������0000664�0000000�0000000�00000000546�13771713062�0024165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package testutils import "os" // CleanupFiles removes all the provided filenames. func CleanupFiles(moreFiles ...string) { for _, file := range moreFiles { os.RemoveAll(file) } } // FileExists returns true if the filename is found. func FileExists(filename string) bool { if _, err := os.Stat(filename); err == nil { return true } return false } ����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/adapter/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020423�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/adapter/adapter.go�����������������������������������������������0000664�0000000�0000000�00000016544�13771713062�0022404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package adapter import ( "bytes" "context" "encoding/binary" "errors" "fmt" "io" "log" "net" "strings" "github.com/google/shlex" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "golang.org/x/crypto/ssh" ) // An adapter satisfies SSH requests (from an Ansible client) by delegating SSH // exec and subsystem commands to a packersdk.Communicator. type Adapter struct { done <-chan struct{} l net.Listener config *ssh.ServerConfig sftpCmd string ui packersdk.Ui comm packersdk.Communicator } func NewAdapter(done <-chan struct{}, l net.Listener, config *ssh.ServerConfig, sftpCmd string, ui packersdk.Ui, comm packersdk.Communicator) *Adapter { return &Adapter{ done: done, l: l, config: config, sftpCmd: sftpCmd, ui: ui, comm: comm, } } func (c *Adapter) Serve() { log.Printf("SSH proxy: serving on %s", c.l.Addr()) for { // Accept will return if either the underlying connection is closed or if a connection is made. // after returning, check to see if c.done can be received. If so, then Accept() returned because // the connection has been closed. conn, err := c.l.Accept() select { case <-c.done: return default: if err != nil { c.ui.Error(fmt.Sprintf("listen.Accept failed: %v", err)) continue } go func(conn net.Conn) { if err := c.Handle(conn, c.ui); err != nil { c.ui.Error(err.Error()) } }(conn) } } } func (c *Adapter) Handle(conn net.Conn, ui packersdk.Ui) error { log.Print("SSH proxy: accepted connection") _, chans, reqs, err := ssh.NewServerConn(conn, c.config) if err != nil { return errors.New("failed to handshake") } // discard all global requests go ssh.DiscardRequests(reqs) // Service the incoming NewChannels for newChannel := range chans { if newChannel.ChannelType() != "session" { newChannel.Reject(ssh.UnknownChannelType, "unknown channel type") continue } go func(ch ssh.NewChannel) { if err := c.handleSession(ch); err != nil { c.ui.Error(err.Error()) } }(newChannel) } return nil } func (c *Adapter) handleSession(newChannel ssh.NewChannel) error { channel, requests, err := newChannel.Accept() if err != nil { return err } defer channel.Close() done := make(chan struct{}) // Sessions have requests such as "pty-req", "shell", "env", and "exec". // see RFC 4254, section 6 go func(in <-chan *ssh.Request) { env := make([]envRequestPayload, 4) for req := range in { switch req.Type { case "pty-req": log.Println("ansible provisioner pty-req request") // accept pty-req requests, but don't actually do anything. Necessary for OpenSSH and sudo. req.Reply(true, nil) case "env": req, err := newEnvRequest(req) if err != nil { c.ui.Error(err.Error()) req.Reply(false, nil) continue } env = append(env, req.Payload) log.Printf("new env request: %s", req.Payload) req.Reply(true, nil) case "exec": req, err := newExecRequest(req) if err != nil { c.ui.Error(err.Error()) req.Reply(false, nil) close(done) continue } log.Printf("new exec request: %s", req.Payload) if len(req.Payload) == 0 { req.Reply(false, nil) close(done) return } go func(channel ssh.Channel) { exit := c.exec(string(req.Payload), channel, channel, channel.Stderr()) exitStatus := make([]byte, 4) binary.BigEndian.PutUint32(exitStatus, uint32(exit)) channel.SendRequest("exit-status", false, exitStatus) close(done) }(channel) req.Reply(true, nil) case "subsystem": req, err := newSubsystemRequest(req) if err != nil { c.ui.Error(err.Error()) req.Reply(false, nil) continue } log.Printf("new subsystem request: %s", req.Payload) switch req.Payload { case "sftp": sftpCmd := c.sftpCmd if len(sftpCmd) == 0 { sftpCmd = "/usr/lib/sftp-server -e" } log.Print("starting sftp subsystem") go func() { _ = c.remoteExec(sftpCmd, channel, channel, channel.Stderr()) close(done) }() req.Reply(true, nil) default: c.ui.Error(fmt.Sprintf("unsupported subsystem requested: %s", req.Payload)) req.Reply(false, nil) } default: log.Printf("rejecting %s request", req.Type) req.Reply(false, nil) } } }(requests) <-done return nil } func (c *Adapter) Shutdown() { c.l.Close() } func (c *Adapter) exec(command string, in io.Reader, out io.Writer, err io.Writer) int { var exitStatus int switch { case strings.HasPrefix(command, "scp ") && serveSCP(command[4:]): err := c.scpExec(command[4:], in, out) if err != nil { log.Println(err) exitStatus = 1 } default: exitStatus = c.remoteExec(command, in, out, err) } return exitStatus } func serveSCP(args string) bool { opts, _ := scpOptions(args) return bytes.IndexAny(opts, "tf") >= 0 } func (c *Adapter) scpExec(args string, in io.Reader, out io.Writer) error { opts, rest := scpOptions(args) // remove the quoting that ansible added to rest for shell safety. shargs, err := shlex.Split(rest) if err != nil { return err } rest = strings.Join(shargs, "") if i := bytes.IndexByte(opts, 't'); i >= 0 { return scpUploadSession(opts, rest, in, out, c.comm) } if i := bytes.IndexByte(opts, 'f'); i >= 0 { return scpDownloadSession(opts, rest, in, out, c.comm) } return errors.New("no scp mode specified") } func (c *Adapter) remoteExec(command string, in io.Reader, out io.Writer, err io.Writer) int { cmd := &packersdk.RemoteCmd{ Stdin: in, Stdout: out, Stderr: err, Command: command, } ctx := context.TODO() if err := c.comm.Start(ctx, cmd); err != nil { c.ui.Error(err.Error()) } cmd.Wait() return cmd.ExitStatus() } type envRequest struct { *ssh.Request Payload envRequestPayload } type envRequestPayload struct { Name string Value string } func (p envRequestPayload) String() string { return fmt.Sprintf("%s=%s", p.Name, p.Value) } func newEnvRequest(raw *ssh.Request) (*envRequest, error) { r := new(envRequest) r.Request = raw if err := ssh.Unmarshal(raw.Payload, &r.Payload); err != nil { return nil, err } return r, nil } func sshString(buf io.Reader) (string, error) { var size uint32 err := binary.Read(buf, binary.BigEndian, &size) if err != nil { return "", err } b := make([]byte, size) err = binary.Read(buf, binary.BigEndian, b) if err != nil { return "", err } return string(b), nil } type execRequest struct { *ssh.Request Payload execRequestPayload } type execRequestPayload string func (p execRequestPayload) String() string { return string(p) } func newExecRequest(raw *ssh.Request) (*execRequest, error) { r := new(execRequest) r.Request = raw buf := bytes.NewReader(r.Request.Payload) var err error var payload string if payload, err = sshString(buf); err != nil { return nil, err } r.Payload = execRequestPayload(payload) return r, nil } type subsystemRequest struct { *ssh.Request Payload subsystemRequestPayload } type subsystemRequestPayload string func (p subsystemRequestPayload) String() string { return string(p) } func newSubsystemRequest(raw *ssh.Request) (*subsystemRequest, error) { r := new(subsystemRequest) r.Request = raw buf := bytes.NewReader(r.Request.Payload) var err error var payload string if payload, err = sshString(buf); err != nil { return nil, err } r.Payload = subsystemRequestPayload(payload) return r, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/adapter/adapter_test.go������������������������������������������0000664�0000000�0000000�00000004145�13771713062�0023435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package adapter import ( "context" "errors" "io" "log" "net" "os" "testing" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "golang.org/x/crypto/ssh" ) func TestAdapter_Serve(t *testing.T) { // done signals the adapter that the provisioner is done done := make(chan struct{}) acceptC := make(chan struct{}) l := listener{done: make(chan struct{}), acceptC: acceptC} config := &ssh.ServerConfig{} ui := packersdk.TestUi(t) sut := NewAdapter(done, &l, config, "", ui, communicator{}) go func() { i := 0 for range acceptC { i++ if i == 4 { close(done) l.Close() } } }() sut.Serve() } type listener struct { done chan struct{} acceptC chan<- struct{} i int } func (l *listener) Accept() (net.Conn, error) { log.Println("Accept() called") l.acceptC <- struct{}{} select { case <-l.done: log.Println("done, serving an error") return nil, errors.New("listener is closed") case <-time.After(10 * time.Millisecond): l.i++ if l.i%2 == 0 { c1, c2 := net.Pipe() go func(c net.Conn) { <-time.After(100 * time.Millisecond) log.Println("closing c") c.Close() }(c1) return c2, nil } } return nil, errors.New("accept error") } func (l *listener) Close() error { close(l.done) return nil } func (l *listener) Addr() net.Addr { return addr{} } type addr struct{} func (a addr) Network() string { return a.String() } func (a addr) String() string { return "test" } type communicator struct{} func (c communicator) Start(context.Context, *packersdk.RemoteCmd) error { return errors.New("communicator not supported") } func (c communicator) Upload(string, io.Reader, *os.FileInfo) error { return errors.New("communicator not supported") } func (c communicator) UploadDir(dst string, src string, exclude []string) error { return errors.New("communicator not supported") } func (c communicator) Download(string, io.Writer) error { return errors.New("communicator not supported") } func (c communicator) DownloadDir(src string, dst string, exclude []string) error { return errors.New("communicator not supported") } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/adapter/doc.go���������������������������������������������������0000664�0000000�0000000�00000000743�13771713062�0021523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package adapter helps command line tools connect to the guest via a Packer communicator. A typical use is for custom provisioners that wrap command line tools. For example, the Ansible provisioner and the Inspec provisioner both use this package to proxy communicator calls. You may want to use this adapter if you are writing a provisioner that wraps a tool which under normal usage would be run locally and form a connection to the remote instance itself. */ package adapter �����������������������������packer-1.6.6+ds1/packer-plugin-sdk/adapter/scp.go���������������������������������������������������0000664�0000000�0000000�00000020211�13771713062�0021533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package adapter import ( "bufio" "bytes" "errors" "fmt" "io" "log" "os" "path/filepath" "strings" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) const ( scpOK = "\x00" scpEmptyError = "\x02\n" ) /* scp is a simple, but poorly documented, protocol. Thankfully, its source is freely available, and there is at least one page that describes it reasonably well. * https://raw.githubusercontent.com/openssh/openssh-portable/master/scp.c * https://opensource.apple.com/source/OpenSSH/OpenSSH-7.1/openssh/scp.c * https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works is a great resource, but has some bad information. Its first problem is that it doesn't correctly describe why the producer has to read more responses than messages it sends (because it has to read the 0 sent by the sink to start the transfer). The second problem is that it omits that the producer needs to send a 0 byte after file contents. */ func scpUploadSession(opts []byte, rest string, in io.Reader, out io.Writer, comm packersdk.Communicator) error { rest = strings.TrimSpace(rest) if len(rest) == 0 { fmt.Fprintf(out, scpEmptyError) return errors.New("no scp target specified") } d, err := tmp.Dir("ansible-upload") if err != nil { fmt.Fprintf(out, scpEmptyError) return err } defer os.RemoveAll(d) // To properly implement scp, rest should be checked to see if it is a // directory on the remote side, but ansible only sends files, so there's no // need to set targetIsDir, because it can be safely assumed that rest is // intended to be a file, and whatever names are used in 'C' commands are // irrelevant. state := &scpUploadState{target: rest, srcRoot: d, comm: comm} fmt.Fprintf(out, scpOK) // signal the client to start the transfer. return state.Protocol(bufio.NewReader(in), out) } func scpDownloadSession(opts []byte, rest string, in io.Reader, out io.Writer, comm packersdk.Communicator) error { rest = strings.TrimSpace(rest) if len(rest) == 0 { fmt.Fprintf(out, scpEmptyError) return errors.New("no scp source specified") } d, err := tmp.Dir("ansible-download") if err != nil { fmt.Fprintf(out, scpEmptyError) return err } defer os.RemoveAll(d) if bytes.Contains([]byte{'d'}, opts) { // the only ansible module that supports downloading via scp is fetch, // fetch only supports file downloads as of Ansible 2.1. fmt.Fprintf(out, scpEmptyError) return errors.New("directory downloads not supported") } f, err := os.Create(filepath.Join(d, filepath.Base(rest))) if err != nil { fmt.Fprintf(out, scpEmptyError) return err } defer f.Close() err = comm.Download(rest, f) if err != nil { fmt.Fprintf(out, scpEmptyError) return err } state := &scpDownloadState{srcRoot: d} return state.Protocol(bufio.NewReader(in), out) } func (state *scpDownloadState) FileProtocol(path string, info os.FileInfo, in *bufio.Reader, out io.Writer) error { size := info.Size() perms := fmt.Sprintf("C%04o", info.Mode().Perm()) fmt.Fprintln(out, perms, size, info.Name()) if err := scpResponse(in); err != nil { return err } f, err := os.Open(path) if err != nil { return err } defer f.Close() io.CopyN(out, f, size) fmt.Fprintf(out, scpOK) return scpResponse(in) } type scpUploadState struct { comm packersdk.Communicator target string // target is the directory on the target srcRoot string // srcRoot is the directory on the host mtime time.Time atime time.Time dir string // dir is a path relative to the roots targetIsDir bool } func (scp scpUploadState) DestPath() string { return filepath.Join(scp.target, scp.dir) } func (scp scpUploadState) SrcPath() string { return filepath.Join(scp.srcRoot, scp.dir) } func (state *scpUploadState) Protocol(in *bufio.Reader, out io.Writer) error { for { b, err := in.ReadByte() if err != nil { return err } switch b { case 'T': err := state.TimeProtocol(in, out) if err != nil { return err } case 'C': return state.FileProtocol(in, out) case 'E': state.dir = filepath.Dir(state.dir) fmt.Fprintf(out, scpOK) return nil case 'D': return state.DirProtocol(in, out) default: fmt.Fprintf(out, scpEmptyError) return fmt.Errorf("unexpected message: %c", b) } } } func (state *scpUploadState) FileProtocol(in *bufio.Reader, out io.Writer) error { defer func() { state.mtime = time.Time{} }() var mode os.FileMode var size int64 var name string _, err := fmt.Fscanf(in, "%04o %d %s\n", &mode, &size, &name) if err != nil { fmt.Fprintf(out, scpEmptyError) return fmt.Errorf("invalid file message: %v", err) } fmt.Fprintf(out, scpOK) var fi os.FileInfo = fileInfo{name: name, size: size, mode: mode, mtime: state.mtime} dest := state.DestPath() if state.targetIsDir { dest = filepath.Join(dest, fi.Name()) } err = state.comm.Upload(dest, io.LimitReader(in, fi.Size()), &fi) if err != nil { fmt.Fprintf(out, scpEmptyError) return err } if err := scpResponse(in); err != nil { return err } fmt.Fprintf(out, scpOK) return nil } func (state *scpUploadState) TimeProtocol(in *bufio.Reader, out io.Writer) error { var m, a int64 if _, err := fmt.Fscanf(in, "%d 0 %d 0\n", &m, &a); err != nil { fmt.Fprintf(out, scpEmptyError) return err } fmt.Fprintf(out, scpOK) state.atime = time.Unix(a, 0) state.mtime = time.Unix(m, 0) return nil } func (state *scpUploadState) DirProtocol(in *bufio.Reader, out io.Writer) error { var mode os.FileMode var length uint var name string if _, err := fmt.Fscanf(in, "%04o %d %s\n", &mode, &length, &name); err != nil { fmt.Fprintf(out, scpEmptyError) return fmt.Errorf("invalid directory message: %v", err) } fmt.Fprintf(out, scpOK) path := filepath.Join(state.dir, name) if err := os.Mkdir(path, mode); err != nil { return err } state.dir = path if state.atime.IsZero() { state.atime = time.Now() } if state.mtime.IsZero() { state.mtime = time.Now() } if err := os.Chtimes(path, state.atime, state.mtime); err != nil { return err } if err := state.comm.UploadDir(filepath.Dir(state.DestPath()), state.SrcPath(), nil); err != nil { return err } state.mtime = time.Time{} state.atime = time.Time{} return state.Protocol(in, out) } type scpDownloadState struct { srcRoot string // srcRoot is the directory on the host } func (state *scpDownloadState) Protocol(in *bufio.Reader, out io.Writer) error { r := bufio.NewReader(in) // read the byte sent by the other side to start the transfer if err := scpResponse(r); err != nil { return err } return filepath.Walk(state.srcRoot, func(path string, info os.FileInfo, err error) error { if err != nil { return err } if path == state.srcRoot { return nil } if info.IsDir() { // no need to get fancy; srcRoot should only contain one file, because // Ansible only allows fetching a single file. return errors.New("unexpected directory") } return state.FileProtocol(path, info, r, out) }) } func scpOptions(s string) (opts []byte, rest string) { end := 0 opt := false Loop: for i := 0; i < len(s); i++ { b := s[i] switch { case b == ' ': opt = false end++ case b == '-': opt = true end++ case opt: opts = append(opts, b) end++ default: break Loop } } rest = s[end:] return } func scpResponse(r *bufio.Reader) error { code, err := r.ReadByte() if err != nil { return err } if code != 0 { message, err := r.ReadString('\n') if err != nil { return fmt.Errorf("Error reading error message: %s", err) } // 1 is a warning. Anything higher (really just 2) is an error. if code > 1 { return errors.New(message) } log.Println("WARNING:", err) } return nil } type fileInfo struct { name string size int64 mode os.FileMode mtime time.Time } func (fi fileInfo) Name() string { return fi.name } func (fi fileInfo) Size() int64 { return fi.size } func (fi fileInfo) Mode() os.FileMode { return fi.mode } func (fi fileInfo) ModTime() time.Time { if fi.mtime.IsZero() { return time.Now() } return fi.mtime } func (fi fileInfo) IsDir() bool { return fi.mode.IsDir() } func (fi fileInfo) Sys() interface{} { return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021305�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/boot_command.go��������������������������������������0000664�0000000�0000000�00000144565�13771713062�0024314�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by pigeon; DO NOT EDIT. package bootcommand import ( "bytes" "errors" "fmt" "io" "io/ioutil" "math" "os" "sort" "strconv" "strings" "sync" "time" "unicode" "unicode/utf8" ) var g = &grammar{ rules: []*rule{ { name: "Input", pos: position{line: 6, col: 1, offset: 26}, expr: &actionExpr{ pos: position{line: 6, col: 10, offset: 35}, run: (*parser).callonInput1, expr: &seqExpr{ pos: position{line: 6, col: 10, offset: 35}, exprs: []interface{}{ &labeledExpr{ pos: position{line: 6, col: 10, offset: 35}, label: "expr", expr: &ruleRefExpr{ pos: position{line: 6, col: 15, offset: 40}, name: "Expr", }, }, &ruleRefExpr{ pos: position{line: 6, col: 20, offset: 45}, name: "EOF", }, }, }, }, }, { name: "Expr", pos: position{line: 10, col: 1, offset: 75}, expr: &actionExpr{ pos: position{line: 10, col: 9, offset: 83}, run: (*parser).callonExpr1, expr: &labeledExpr{ pos: position{line: 10, col: 9, offset: 83}, label: "l", expr: &oneOrMoreExpr{ pos: position{line: 10, col: 11, offset: 85}, expr: &choiceExpr{ pos: position{line: 10, col: 13, offset: 87}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 10, col: 13, offset: 87}, name: "Wait", }, &ruleRefExpr{ pos: position{line: 10, col: 20, offset: 94}, name: "CharToggle", }, &ruleRefExpr{ pos: position{line: 10, col: 33, offset: 107}, name: "Special", }, &ruleRefExpr{ pos: position{line: 10, col: 43, offset: 117}, name: "Literal", }, }, }, }, }, }, }, { name: "Wait", pos: position{line: 14, col: 1, offset: 150}, expr: &actionExpr{ pos: position{line: 14, col: 8, offset: 157}, run: (*parser).callonWait1, expr: &seqExpr{ pos: position{line: 14, col: 8, offset: 157}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 14, col: 8, offset: 157}, name: "ExprStart", }, &litMatcher{ pos: position{line: 14, col: 18, offset: 167}, val: "wait", ignoreCase: false, want: "\"wait\"", }, &labeledExpr{ pos: position{line: 14, col: 25, offset: 174}, label: "duration", expr: &zeroOrOneExpr{ pos: position{line: 14, col: 34, offset: 183}, expr: &choiceExpr{ pos: position{line: 14, col: 36, offset: 185}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 14, col: 36, offset: 185}, name: "Duration", }, &ruleRefExpr{ pos: position{line: 14, col: 47, offset: 196}, name: "Integer", }, }, }, }, }, &ruleRefExpr{ pos: position{line: 14, col: 58, offset: 207}, name: "ExprEnd", }, }, }, }, }, { name: "CharToggle", pos: position{line: 27, col: 1, offset: 453}, expr: &actionExpr{ pos: position{line: 27, col: 14, offset: 466}, run: (*parser).callonCharToggle1, expr: &seqExpr{ pos: position{line: 27, col: 14, offset: 466}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 27, col: 14, offset: 466}, name: "ExprStart", }, &labeledExpr{ pos: position{line: 27, col: 24, offset: 476}, label: "lit", expr: &ruleRefExpr{ pos: position{line: 27, col: 29, offset: 481}, name: "Literal", }, }, &labeledExpr{ pos: position{line: 27, col: 38, offset: 490}, label: "t", expr: &choiceExpr{ pos: position{line: 27, col: 41, offset: 493}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 27, col: 41, offset: 493}, name: "On", }, &ruleRefExpr{ pos: position{line: 27, col: 46, offset: 498}, name: "Off", }, }, }, }, &ruleRefExpr{ pos: position{line: 27, col: 51, offset: 503}, name: "ExprEnd", }, }, }, }, }, { name: "Special", pos: position{line: 31, col: 1, offset: 574}, expr: &actionExpr{ pos: position{line: 31, col: 11, offset: 584}, run: (*parser).callonSpecial1, expr: &seqExpr{ pos: position{line: 31, col: 11, offset: 584}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 31, col: 11, offset: 584}, name: "ExprStart", }, &labeledExpr{ pos: position{line: 31, col: 21, offset: 594}, label: "s", expr: &ruleRefExpr{ pos: position{line: 31, col: 24, offset: 597}, name: "SpecialKey", }, }, &labeledExpr{ pos: position{line: 31, col: 36, offset: 609}, label: "t", expr: &zeroOrOneExpr{ pos: position{line: 31, col: 38, offset: 611}, expr: &choiceExpr{ pos: position{line: 31, col: 39, offset: 612}, alternatives: []interface{}{ &ruleRefExpr{ pos: position{line: 31, col: 39, offset: 612}, name: "On", }, &ruleRefExpr{ pos: position{line: 31, col: 44, offset: 617}, name: "Off", }, }, }, }, }, &ruleRefExpr{ pos: position{line: 31, col: 50, offset: 623}, name: "ExprEnd", }, }, }, }, }, { name: "Number", pos: position{line: 39, col: 1, offset: 810}, expr: &actionExpr{ pos: position{line: 39, col: 10, offset: 819}, run: (*parser).callonNumber1, expr: &seqExpr{ pos: position{line: 39, col: 10, offset: 819}, exprs: []interface{}{ &zeroOrOneExpr{ pos: position{line: 39, col: 10, offset: 819}, expr: &litMatcher{ pos: position{line: 39, col: 10, offset: 819}, val: "-", ignoreCase: false, want: "\"-\"", }, }, &ruleRefExpr{ pos: position{line: 39, col: 15, offset: 824}, name: "Integer", }, &zeroOrOneExpr{ pos: position{line: 39, col: 23, offset: 832}, expr: &seqExpr{ pos: position{line: 39, col: 25, offset: 834}, exprs: []interface{}{ &litMatcher{ pos: position{line: 39, col: 25, offset: 834}, val: ".", ignoreCase: false, want: "\".\"", }, &oneOrMoreExpr{ pos: position{line: 39, col: 29, offset: 838}, expr: &ruleRefExpr{ pos: position{line: 39, col: 29, offset: 838}, name: "Digit", }, }, }, }, }, }, }, }, }, { name: "Integer", pos: position{line: 43, col: 1, offset: 884}, expr: &choiceExpr{ pos: position{line: 43, col: 11, offset: 894}, alternatives: []interface{}{ &litMatcher{ pos: position{line: 43, col: 11, offset: 894}, val: "0", ignoreCase: false, want: "\"0\"", }, &actionExpr{ pos: position{line: 43, col: 17, offset: 900}, run: (*parser).callonInteger3, expr: &seqExpr{ pos: position{line: 43, col: 17, offset: 900}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 43, col: 17, offset: 900}, name: "NonZeroDigit", }, &zeroOrMoreExpr{ pos: position{line: 43, col: 30, offset: 913}, expr: &ruleRefExpr{ pos: position{line: 43, col: 30, offset: 913}, name: "Digit", }, }, }, }, }, }, }, }, { name: "Duration", pos: position{line: 47, col: 1, offset: 977}, expr: &actionExpr{ pos: position{line: 47, col: 12, offset: 988}, run: (*parser).callonDuration1, expr: &oneOrMoreExpr{ pos: position{line: 47, col: 12, offset: 988}, expr: &seqExpr{ pos: position{line: 47, col: 14, offset: 990}, exprs: []interface{}{ &ruleRefExpr{ pos: position{line: 47, col: 14, offset: 990}, name: "Number", }, &ruleRefExpr{ pos: position{line: 47, col: 21, offset: 997}, name: "TimeUnit", }, }, }, }, }, }, { name: "On", pos: position{line: 51, col: 1, offset: 1060}, expr: &actionExpr{ pos: position{line: 51, col: 6, offset: 1065}, run: (*parser).callonOn1, expr: &litMatcher{ pos: position{line: 51, col: 6, offset: 1065}, val: "on", ignoreCase: true, want: "\"on\"i", }, }, }, { name: "Off", pos: position{line: 55, col: 1, offset: 1098}, expr: &actionExpr{ pos: position{line: 55, col: 7, offset: 1104}, run: (*parser).callonOff1, expr: &litMatcher{ pos: position{line: 55, col: 7, offset: 1104}, val: "off", ignoreCase: true, want: "\"off\"i", }, }, }, { name: "Literal", pos: position{line: 59, col: 1, offset: 1139}, expr: &actionExpr{ pos: position{line: 59, col: 11, offset: 1149}, run: (*parser).callonLiteral1, expr: &anyMatcher{ line: 59, col: 11, offset: 1149, }, }, }, { name: "ExprEnd", pos: position{line: 64, col: 1, offset: 1230}, expr: &litMatcher{ pos: position{line: 64, col: 11, offset: 1240}, val: ">", ignoreCase: false, want: "\">\"", }, }, { name: "ExprStart", pos: position{line: 65, col: 1, offset: 1244}, expr: &litMatcher{ pos: position{line: 65, col: 13, offset: 1256}, val: "<", ignoreCase: false, want: "\"<\"", }, }, { name: "SpecialKey", pos: position{line: 66, col: 1, offset: 1260}, expr: &choiceExpr{ pos: position{line: 66, col: 14, offset: 1273}, alternatives: []interface{}{ &litMatcher{ pos: position{line: 66, col: 14, offset: 1273}, val: "bs", ignoreCase: true, want: "\"bs\"i", }, &litMatcher{ pos: position{line: 66, col: 22, offset: 1281}, val: "del", ignoreCase: true, want: "\"del\"i", }, &litMatcher{ pos: position{line: 66, col: 31, offset: 1290}, val: "enter", ignoreCase: true, want: "\"enter\"i", }, &litMatcher{ pos: position{line: 66, col: 42, offset: 1301}, val: "esc", ignoreCase: true, want: "\"esc\"i", }, &litMatcher{ pos: position{line: 66, col: 51, offset: 1310}, val: "f10", ignoreCase: true, want: "\"f10\"i", }, &litMatcher{ pos: position{line: 66, col: 60, offset: 1319}, val: "f11", ignoreCase: true, want: "\"f11\"i", }, &litMatcher{ pos: position{line: 66, col: 69, offset: 1328}, val: "f12", ignoreCase: true, want: "\"f12\"i", }, &litMatcher{ pos: position{line: 67, col: 11, offset: 1345}, val: "f1", ignoreCase: true, want: "\"f1\"i", }, &litMatcher{ pos: position{line: 67, col: 19, offset: 1353}, val: "f2", ignoreCase: true, want: "\"f2\"i", }, &litMatcher{ pos: position{line: 67, col: 27, offset: 1361}, val: "f3", ignoreCase: true, want: "\"f3\"i", }, &litMatcher{ pos: position{line: 67, col: 35, offset: 1369}, val: "f4", ignoreCase: true, want: "\"f4\"i", }, &litMatcher{ pos: position{line: 67, col: 43, offset: 1377}, val: "f5", ignoreCase: true, want: "\"f5\"i", }, &litMatcher{ pos: position{line: 67, col: 51, offset: 1385}, val: "f6", ignoreCase: true, want: "\"f6\"i", }, &litMatcher{ pos: position{line: 67, col: 59, offset: 1393}, val: "f7", ignoreCase: true, want: "\"f7\"i", }, &litMatcher{ pos: position{line: 67, col: 67, offset: 1401}, val: "f8", ignoreCase: true, want: "\"f8\"i", }, &litMatcher{ pos: position{line: 67, col: 75, offset: 1409}, val: "f9", ignoreCase: true, want: "\"f9\"i", }, &litMatcher{ pos: position{line: 68, col: 12, offset: 1426}, val: "return", ignoreCase: true, want: "\"return\"i", }, &litMatcher{ pos: position{line: 68, col: 24, offset: 1438}, val: "tab", ignoreCase: true, want: "\"tab\"i", }, &litMatcher{ pos: position{line: 68, col: 33, offset: 1447}, val: "up", ignoreCase: true, want: "\"up\"i", }, &litMatcher{ pos: position{line: 68, col: 41, offset: 1455}, val: "down", ignoreCase: true, want: "\"down\"i", }, &litMatcher{ pos: position{line: 68, col: 51, offset: 1465}, val: "spacebar", ignoreCase: true, want: "\"spacebar\"i", }, &litMatcher{ pos: position{line: 68, col: 65, offset: 1479}, val: "insert", ignoreCase: true, want: "\"insert\"i", }, &litMatcher{ pos: position{line: 68, col: 77, offset: 1491}, val: "home", ignoreCase: true, want: "\"home\"i", }, &litMatcher{ pos: position{line: 69, col: 11, offset: 1509}, val: "end", ignoreCase: true, want: "\"end\"i", }, &litMatcher{ pos: position{line: 69, col: 20, offset: 1518}, val: "pageup", ignoreCase: true, want: "\"pageUp\"i", }, &litMatcher{ pos: position{line: 69, col: 32, offset: 1530}, val: "pagedown", ignoreCase: true, want: "\"pageDown\"i", }, &litMatcher{ pos: position{line: 69, col: 46, offset: 1544}, val: "leftalt", ignoreCase: true, want: "\"leftAlt\"i", }, &litMatcher{ pos: position{line: 69, col: 59, offset: 1557}, val: "leftctrl", ignoreCase: true, want: "\"leftCtrl\"i", }, &litMatcher{ pos: position{line: 69, col: 73, offset: 1571}, val: "leftshift", ignoreCase: true, want: "\"leftShift\"i", }, &litMatcher{ pos: position{line: 70, col: 11, offset: 1594}, val: "rightalt", ignoreCase: true, want: "\"rightAlt\"i", }, &litMatcher{ pos: position{line: 70, col: 25, offset: 1608}, val: "rightctrl", ignoreCase: true, want: "\"rightCtrl\"i", }, &litMatcher{ pos: position{line: 70, col: 40, offset: 1623}, val: "rightshift", ignoreCase: true, want: "\"rightShift\"i", }, &litMatcher{ pos: position{line: 70, col: 56, offset: 1639}, val: "leftsuper", ignoreCase: true, want: "\"leftSuper\"i", }, &litMatcher{ pos: position{line: 70, col: 71, offset: 1654}, val: "rightsuper", ignoreCase: true, want: "\"rightSuper\"i", }, &litMatcher{ pos: position{line: 71, col: 11, offset: 1678}, val: "left", ignoreCase: true, want: "\"left\"i", }, &litMatcher{ pos: position{line: 71, col: 21, offset: 1688}, val: "right", ignoreCase: true, want: "\"right\"i", }, }, }, }, { name: "NonZeroDigit", pos: position{line: 73, col: 1, offset: 1698}, expr: &charClassMatcher{ pos: position{line: 73, col: 16, offset: 1713}, val: "[1-9]", ranges: []rune{'1', '9'}, ignoreCase: false, inverted: false, }, }, { name: "Digit", pos: position{line: 74, col: 1, offset: 1719}, expr: &charClassMatcher{ pos: position{line: 74, col: 9, offset: 1727}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, inverted: false, }, }, { name: "TimeUnit", pos: position{line: 75, col: 1, offset: 1733}, expr: &choiceExpr{ pos: position{line: 75, col: 13, offset: 1745}, alternatives: []interface{}{ &litMatcher{ pos: position{line: 75, col: 13, offset: 1745}, val: "ns", ignoreCase: false, want: "\"ns\"", }, &litMatcher{ pos: position{line: 75, col: 20, offset: 1752}, val: "us", ignoreCase: false, want: "\"us\"", }, &litMatcher{ pos: position{line: 75, col: 27, offset: 1759}, val: "µs", ignoreCase: false, want: "\"µs\"", }, &litMatcher{ pos: position{line: 75, col: 34, offset: 1767}, val: "ms", ignoreCase: false, want: "\"ms\"", }, &litMatcher{ pos: position{line: 75, col: 41, offset: 1774}, val: "s", ignoreCase: false, want: "\"s\"", }, &litMatcher{ pos: position{line: 75, col: 47, offset: 1780}, val: "m", ignoreCase: false, want: "\"m\"", }, &litMatcher{ pos: position{line: 75, col: 53, offset: 1786}, val: "h", ignoreCase: false, want: "\"h\"", }, }, }, }, { name: "_", displayName: "\"whitespace\"", pos: position{line: 77, col: 1, offset: 1792}, expr: &zeroOrMoreExpr{ pos: position{line: 77, col: 19, offset: 1810}, expr: &charClassMatcher{ pos: position{line: 77, col: 19, offset: 1810}, val: "[ \\n\\t\\r]", chars: []rune{' ', '\n', '\t', '\r'}, ignoreCase: false, inverted: false, }, }, }, { name: "EOF", pos: position{line: 79, col: 1, offset: 1822}, expr: &notExpr{ pos: position{line: 79, col: 8, offset: 1829}, expr: &anyMatcher{ line: 79, col: 9, offset: 1830, }, }, }, }, } func (c *current) onInput1(expr interface{}) (interface{}, error) { return expr, nil } func (p *parser) callonInput1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInput1(stack["expr"]) } func (c *current) onExpr1(l interface{}) (interface{}, error) { return l, nil } func (p *parser) callonExpr1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onExpr1(stack["l"]) } func (c *current) onWait1(duration interface{}) (interface{}, error) { var d time.Duration switch t := duration.(type) { case time.Duration: d = t case int64: d = time.Duration(t) * time.Second default: d = time.Second } return &waitExpression{d}, nil } func (p *parser) callonWait1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onWait1(stack["duration"]) } func (c *current) onCharToggle1(lit, t interface{}) (interface{}, error) { return &literal{lit.(*literal).s, t.(KeyAction)}, nil } func (p *parser) callonCharToggle1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onCharToggle1(stack["lit"], stack["t"]) } func (c *current) onSpecial1(s, t interface{}) (interface{}, error) { l := strings.ToLower(string(s.([]byte))) if t == nil { return &specialExpression{l, KeyPress}, nil } return &specialExpression{l, t.(KeyAction)}, nil } func (p *parser) callonSpecial1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onSpecial1(stack["s"], stack["t"]) } func (c *current) onNumber1() (interface{}, error) { return string(c.text), nil } func (p *parser) callonNumber1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onNumber1() } func (c *current) onInteger3() (interface{}, error) { return strconv.ParseInt(string(c.text), 10, 64) } func (p *parser) callonInteger3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onInteger3() } func (c *current) onDuration1() (interface{}, error) { return time.ParseDuration(string(c.text)) } func (p *parser) callonDuration1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onDuration1() } func (c *current) onOn1() (interface{}, error) { return KeyOn, nil } func (p *parser) callonOn1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOn1() } func (c *current) onOff1() (interface{}, error) { return KeyOff, nil } func (p *parser) callonOff1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onOff1() } func (c *current) onLiteral1() (interface{}, error) { r, _ := utf8.DecodeRune(c.text) return &literal{r, KeyPress}, nil } func (p *parser) callonLiteral1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack return p.cur.onLiteral1() } var ( // errNoRule is returned when the grammar to parse has no rule. errNoRule = errors.New("grammar has no rule") // errInvalidEntrypoint is returned when the specified entrypoint rule // does not exit. errInvalidEntrypoint = errors.New("invalid entrypoint") // errInvalidEncoding is returned when the source is not properly // utf8-encoded. errInvalidEncoding = errors.New("invalid encoding") // errMaxExprCnt is used to signal that the maximum number of // expressions have been parsed. errMaxExprCnt = errors.New("max number of expresssions parsed") ) // Option is a function that can set an option on the parser. It returns // the previous setting as an Option. type Option func(*parser) Option // MaxExpressions creates an Option to stop parsing after the provided // number of expressions have been parsed, if the value is 0 then the parser will // parse for as many steps as needed (possibly an infinite number). // // The default for maxExprCnt is 0. func MaxExpressions(maxExprCnt uint64) Option { return func(p *parser) Option { oldMaxExprCnt := p.maxExprCnt p.maxExprCnt = maxExprCnt return MaxExpressions(oldMaxExprCnt) } } // Entrypoint creates an Option to set the rule name to use as entrypoint. // The rule name must have been specified in the -alternate-entrypoints // if generating the parser with the -optimize-grammar flag, otherwise // it may have been optimized out. Passing an empty string sets the // entrypoint to the first rule in the grammar. // // The default is to start parsing at the first rule in the grammar. func Entrypoint(ruleName string) Option { return func(p *parser) Option { oldEntrypoint := p.entrypoint p.entrypoint = ruleName if ruleName == "" { p.entrypoint = g.rules[0].name } return Entrypoint(oldEntrypoint) } } // Statistics adds a user provided Stats struct to the parser to allow // the user to process the results after the parsing has finished. // Also the key for the "no match" counter is set. // // Example usage: // // input := "input" // stats := Stats{} // _, err := Parse("input-file", []byte(input), Statistics(&stats, "no match")) // if err != nil { // log.Panicln(err) // } // b, err := json.MarshalIndent(stats.ChoiceAltCnt, "", " ") // if err != nil { // log.Panicln(err) // } // fmt.Println(string(b)) // func Statistics(stats *Stats, choiceNoMatch string) Option { return func(p *parser) Option { oldStats := p.Stats p.Stats = stats oldChoiceNoMatch := p.choiceNoMatch p.choiceNoMatch = choiceNoMatch if p.Stats.ChoiceAltCnt == nil { p.Stats.ChoiceAltCnt = make(map[string]map[string]int) } return Statistics(oldStats, oldChoiceNoMatch) } } // Debug creates an Option to set the debug flag to b. When set to true, // debugging information is printed to stdout while parsing. // // The default is false. func Debug(b bool) Option { return func(p *parser) Option { old := p.debug p.debug = b return Debug(old) } } // Memoize creates an Option to set the memoize flag to b. When set to true, // the parser will cache all results so each expression is evaluated only // once. This guarantees linear parsing time even for pathological cases, // at the expense of more memory and slower times for typical cases. // // The default is false. func Memoize(b bool) Option { return func(p *parser) Option { old := p.memoize p.memoize = b return Memoize(old) } } // AllowInvalidUTF8 creates an Option to allow invalid UTF-8 bytes. // Every invalid UTF-8 byte is treated as a utf8.RuneError (U+FFFD) // by character class matchers and is matched by the any matcher. // The returned matched value, c.text and c.offset are NOT affected. // // The default is false. func AllowInvalidUTF8(b bool) Option { return func(p *parser) Option { old := p.allowInvalidUTF8 p.allowInvalidUTF8 = b return AllowInvalidUTF8(old) } } // Recover creates an Option to set the recover flag to b. When set to // true, this causes the parser to recover from panics and convert it // to an error. Setting it to false can be useful while debugging to // access the full stack trace. // // The default is true. func Recover(b bool) Option { return func(p *parser) Option { old := p.recover p.recover = b return Recover(old) } } // GlobalStore creates an Option to set a key to a certain value in // the globalStore. func GlobalStore(key string, value interface{}) Option { return func(p *parser) Option { old := p.cur.globalStore[key] p.cur.globalStore[key] = value return GlobalStore(key, old) } } // InitState creates an Option to set a key to a certain value in // the global "state" store. func InitState(key string, value interface{}) Option { return func(p *parser) Option { old := p.cur.state[key] p.cur.state[key] = value return InitState(key, old) } } // ParseFile parses the file identified by filename. func ParseFile(filename string, opts ...Option) (i interface{}, err error) { f, err := os.Open(filename) if err != nil { return nil, err } defer func() { if closeErr := f.Close(); closeErr != nil { err = closeErr } }() return ParseReader(filename, f, opts...) } // ParseReader parses the data from r using filename as information in the // error messages. func ParseReader(filename string, r io.Reader, opts ...Option) (interface{}, error) { b, err := ioutil.ReadAll(r) if err != nil { return nil, err } return Parse(filename, b, opts...) } // Parse parses the data from b using filename as information in the // error messages. func Parse(filename string, b []byte, opts ...Option) (interface{}, error) { return newParser(filename, b, opts...).parse(g) } // position records a position in the text. type position struct { line, col, offset int } func (p position) String() string { return strconv.Itoa(p.line) + ":" + strconv.Itoa(p.col) + " [" + strconv.Itoa(p.offset) + "]" } // savepoint stores all state required to go back to this point in the // parser. type savepoint struct { position rn rune w int } type current struct { pos position // start position of the match text []byte // raw text of the match // state is a store for arbitrary key,value pairs that the user wants to be // tied to the backtracking of the parser. // This is always rolled back if a parsing rule fails. state storeDict // globalStore is a general store for the user to store arbitrary key-value // pairs that they need to manage and that they do not want tied to the // backtracking of the parser. This is only modified by the user and never // rolled back by the parser. It is always up to the user to keep this in a // consistent state. globalStore storeDict } type storeDict map[string]interface{} // the AST types... type grammar struct { pos position rules []*rule } type rule struct { pos position name string displayName string expr interface{} } type choiceExpr struct { pos position alternatives []interface{} } type actionExpr struct { pos position expr interface{} run func(*parser) (interface{}, error) } type recoveryExpr struct { pos position expr interface{} recoverExpr interface{} failureLabel []string } type seqExpr struct { pos position exprs []interface{} } type throwExpr struct { pos position label string } type labeledExpr struct { pos position label string expr interface{} } type expr struct { pos position expr interface{} } type andExpr expr type notExpr expr type zeroOrOneExpr expr type zeroOrMoreExpr expr type oneOrMoreExpr expr type ruleRefExpr struct { pos position name string } type stateCodeExpr struct { pos position run func(*parser) error } type andCodeExpr struct { pos position run func(*parser) (bool, error) } type notCodeExpr struct { pos position run func(*parser) (bool, error) } type litMatcher struct { pos position val string ignoreCase bool want string } type charClassMatcher struct { pos position val string basicLatinChars [128]bool chars []rune ranges []rune classes []*unicode.RangeTable ignoreCase bool inverted bool } type anyMatcher position // errList cumulates the errors found by the parser. type errList []error func (e *errList) add(err error) { *e = append(*e, err) } func (e errList) err() error { if len(e) == 0 { return nil } e.dedupe() return e } func (e *errList) dedupe() { var cleaned []error set := make(map[string]bool) for _, err := range *e { if msg := err.Error(); !set[msg] { set[msg] = true cleaned = append(cleaned, err) } } *e = cleaned } func (e errList) Error() string { switch len(e) { case 0: return "" case 1: return e[0].Error() default: var buf bytes.Buffer for i, err := range e { if i > 0 { buf.WriteRune('\n') } buf.WriteString(err.Error()) } return buf.String() } } // parserError wraps an error with a prefix indicating the rule in which // the error occurred. The original error is stored in the Inner field. type parserError struct { Inner error pos position prefix string expected []string } // Error returns the error message. func (p *parserError) Error() string { return p.prefix + ": " + p.Inner.Error() } // newParser creates a parser with the specified input source and options. func newParser(filename string, b []byte, opts ...Option) *parser { stats := Stats{ ChoiceAltCnt: make(map[string]map[string]int), } p := &parser{ filename: filename, errs: new(errList), data: b, pt: savepoint{position: position{line: 1}}, recover: true, cur: current{ state: make(storeDict), globalStore: make(storeDict), }, maxFailPos: position{col: 1, line: 1}, maxFailExpected: make([]string, 0, 20), Stats: &stats, // start rule is rule [0] unless an alternate entrypoint is specified entrypoint: g.rules[0].name, } p.setOptions(opts) if p.maxExprCnt == 0 { p.maxExprCnt = math.MaxUint64 } return p } // setOptions applies the options to the parser. func (p *parser) setOptions(opts []Option) { for _, opt := range opts { opt(p) } } type resultTuple struct { v interface{} b bool end savepoint } const choiceNoMatch = -1 // Stats stores some statistics, gathered during parsing type Stats struct { // ExprCnt counts the number of expressions processed during parsing // This value is compared to the maximum number of expressions allowed // (set by the MaxExpressions option). ExprCnt uint64 // ChoiceAltCnt is used to count for each ordered choice expression, // which alternative is used how may times. // These numbers allow to optimize the order of the ordered choice expression // to increase the performance of the parser // // The outer key of ChoiceAltCnt is composed of the name of the rule as well // as the line and the column of the ordered choice. // The inner key of ChoiceAltCnt is the number (one-based) of the matching alternative. // For each alternative the number of matches are counted. If an ordered choice does not // match, a special counter is incremented. The name of this counter is set with // the parser option Statistics. // For an alternative to be included in ChoiceAltCnt, it has to match at least once. ChoiceAltCnt map[string]map[string]int } type parser struct { filename string pt savepoint cur current data []byte errs *errList depth int recover bool debug bool memoize bool // memoization table for the packrat algorithm: // map[offset in source] map[expression or rule] {value, match} memo map[int]map[interface{}]resultTuple // rules table, maps the rule identifier to the rule node rules map[string]*rule // variables stack, map of label to value vstack []map[string]interface{} // rule stack, allows identification of the current rule in errors rstack []*rule // parse fail maxFailPos position maxFailExpected []string maxFailInvertExpected bool // max number of expressions to be parsed maxExprCnt uint64 // entrypoint for the parser entrypoint string allowInvalidUTF8 bool *Stats choiceNoMatch string // recovery expression stack, keeps track of the currently available recovery expression, these are traversed in reverse recoveryStack []map[string]interface{} } // push a variable set on the vstack. func (p *parser) pushV() { if cap(p.vstack) == len(p.vstack) { // create new empty slot in the stack p.vstack = append(p.vstack, nil) } else { // slice to 1 more p.vstack = p.vstack[:len(p.vstack)+1] } // get the last args set m := p.vstack[len(p.vstack)-1] if m != nil && len(m) == 0 { // empty map, all good return } m = make(map[string]interface{}) p.vstack[len(p.vstack)-1] = m } // pop a variable set from the vstack. func (p *parser) popV() { // if the map is not empty, clear it m := p.vstack[len(p.vstack)-1] if len(m) > 0 { // GC that map p.vstack[len(p.vstack)-1] = nil } p.vstack = p.vstack[:len(p.vstack)-1] } // push a recovery expression with its labels to the recoveryStack func (p *parser) pushRecovery(labels []string, expr interface{}) { if cap(p.recoveryStack) == len(p.recoveryStack) { // create new empty slot in the stack p.recoveryStack = append(p.recoveryStack, nil) } else { // slice to 1 more p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)+1] } m := make(map[string]interface{}, len(labels)) for _, fl := range labels { m[fl] = expr } p.recoveryStack[len(p.recoveryStack)-1] = m } // pop a recovery expression from the recoveryStack func (p *parser) popRecovery() { // GC that map p.recoveryStack[len(p.recoveryStack)-1] = nil p.recoveryStack = p.recoveryStack[:len(p.recoveryStack)-1] } func (p *parser) print(prefix, s string) string { if !p.debug { return s } fmt.Printf("%s %d:%d:%d: %s [%#U]\n", prefix, p.pt.line, p.pt.col, p.pt.offset, s, p.pt.rn) return s } func (p *parser) in(s string) string { p.depth++ return p.print(strings.Repeat(" ", p.depth)+">", s) } func (p *parser) out(s string) string { p.depth-- return p.print(strings.Repeat(" ", p.depth)+"<", s) } func (p *parser) addErr(err error) { p.addErrAt(err, p.pt.position, []string{}) } func (p *parser) addErrAt(err error, pos position, expected []string) { var buf bytes.Buffer if p.filename != "" { buf.WriteString(p.filename) } if buf.Len() > 0 { buf.WriteString(":") } buf.WriteString(fmt.Sprintf("%d:%d (%d)", pos.line, pos.col, pos.offset)) if len(p.rstack) > 0 { if buf.Len() > 0 { buf.WriteString(": ") } rule := p.rstack[len(p.rstack)-1] if rule.displayName != "" { buf.WriteString("rule " + rule.displayName) } else { buf.WriteString("rule " + rule.name) } } pe := &parserError{Inner: err, pos: pos, prefix: buf.String(), expected: expected} p.errs.add(pe) } func (p *parser) failAt(fail bool, pos position, want string) { // process fail if parsing fails and not inverted or parsing succeeds and invert is set if fail == p.maxFailInvertExpected { if pos.offset < p.maxFailPos.offset { return } if pos.offset > p.maxFailPos.offset { p.maxFailPos = pos p.maxFailExpected = p.maxFailExpected[:0] } if p.maxFailInvertExpected { want = "!" + want } p.maxFailExpected = append(p.maxFailExpected, want) } } // read advances the parser to the next rune. func (p *parser) read() { p.pt.offset += p.pt.w rn, n := utf8.DecodeRune(p.data[p.pt.offset:]) p.pt.rn = rn p.pt.w = n p.pt.col++ if rn == '\n' { p.pt.line++ p.pt.col = 0 } if rn == utf8.RuneError && n == 1 { // see utf8.DecodeRune if !p.allowInvalidUTF8 { p.addErr(errInvalidEncoding) } } } // restore parser position to the savepoint pt. func (p *parser) restore(pt savepoint) { if p.debug { defer p.out(p.in("restore")) } if pt.offset == p.pt.offset { return } p.pt = pt } // Cloner is implemented by any value that has a Clone method, which returns a // copy of the value. This is mainly used for types which are not passed by // value (e.g map, slice, chan) or structs that contain such types. // // This is used in conjunction with the global state feature to create proper // copies of the state to allow the parser to properly restore the state in // the case of backtracking. type Cloner interface { Clone() interface{} } var statePool = &sync.Pool{ New: func() interface{} { return make(storeDict) }, } func (sd storeDict) Discard() { for k := range sd { delete(sd, k) } statePool.Put(sd) } // clone and return parser current state. func (p *parser) cloneState() storeDict { if p.debug { defer p.out(p.in("cloneState")) } state := statePool.Get().(storeDict) for k, v := range p.cur.state { if c, ok := v.(Cloner); ok { state[k] = c.Clone() } else { state[k] = v } } return state } // restore parser current state to the state storeDict. // every restoreState should applied only one time for every cloned state func (p *parser) restoreState(state storeDict) { if p.debug { defer p.out(p.in("restoreState")) } p.cur.state.Discard() p.cur.state = state } // get the slice of bytes from the savepoint start to the current position. func (p *parser) sliceFrom(start savepoint) []byte { return p.data[start.position.offset:p.pt.position.offset] } func (p *parser) getMemoized(node interface{}) (resultTuple, bool) { if len(p.memo) == 0 { return resultTuple{}, false } m := p.memo[p.pt.offset] if len(m) == 0 { return resultTuple{}, false } res, ok := m[node] return res, ok } func (p *parser) setMemoized(pt savepoint, node interface{}, tuple resultTuple) { if p.memo == nil { p.memo = make(map[int]map[interface{}]resultTuple) } m := p.memo[pt.offset] if m == nil { m = make(map[interface{}]resultTuple) p.memo[pt.offset] = m } m[node] = tuple } func (p *parser) buildRulesTable(g *grammar) { p.rules = make(map[string]*rule, len(g.rules)) for _, r := range g.rules { p.rules[r.name] = r } } func (p *parser) parse(g *grammar) (val interface{}, err error) { if len(g.rules) == 0 { p.addErr(errNoRule) return nil, p.errs.err() } // TODO : not super critical but this could be generated p.buildRulesTable(g) if p.recover { // panic can be used in action code to stop parsing immediately // and return the panic as an error. defer func() { if e := recover(); e != nil { if p.debug { defer p.out(p.in("panic handler")) } val = nil switch e := e.(type) { case error: p.addErr(e) default: p.addErr(fmt.Errorf("%v", e)) } err = p.errs.err() } }() } startRule, ok := p.rules[p.entrypoint] if !ok { p.addErr(errInvalidEntrypoint) return nil, p.errs.err() } p.read() // advance to first rune val, ok = p.parseRule(startRule) if !ok { if len(*p.errs) == 0 { // If parsing fails, but no errors have been recorded, the expected values // for the farthest parser position are returned as error. maxFailExpectedMap := make(map[string]struct{}, len(p.maxFailExpected)) for _, v := range p.maxFailExpected { maxFailExpectedMap[v] = struct{}{} } expected := make([]string, 0, len(maxFailExpectedMap)) eof := false if _, ok := maxFailExpectedMap["!."]; ok { delete(maxFailExpectedMap, "!.") eof = true } for k := range maxFailExpectedMap { expected = append(expected, k) } sort.Strings(expected) if eof { expected = append(expected, "EOF") } p.addErrAt(errors.New("no match found, expected: "+listJoin(expected, ", ", "or")), p.maxFailPos, expected) } return nil, p.errs.err() } return val, p.errs.err() } func listJoin(list []string, sep string, lastSep string) string { switch len(list) { case 0: return "" case 1: return list[0] default: return strings.Join(list[:len(list)-1], sep) + " " + lastSep + " " + list[len(list)-1] } } func (p *parser) parseRule(rule *rule) (interface{}, bool) { if p.debug { defer p.out(p.in("parseRule " + rule.name)) } if p.memoize { res, ok := p.getMemoized(rule) if ok { p.restore(res.end) return res.v, res.b } } start := p.pt p.rstack = append(p.rstack, rule) p.pushV() val, ok := p.parseExpr(rule.expr) p.popV() p.rstack = p.rstack[:len(p.rstack)-1] if ok && p.debug { p.print(strings.Repeat(" ", p.depth)+"MATCH", string(p.sliceFrom(start))) } if p.memoize { p.setMemoized(start, rule, resultTuple{val, ok, p.pt}) } return val, ok } func (p *parser) parseExpr(expr interface{}) (interface{}, bool) { var pt savepoint if p.memoize { res, ok := p.getMemoized(expr) if ok { p.restore(res.end) return res.v, res.b } pt = p.pt } p.ExprCnt++ if p.ExprCnt > p.maxExprCnt { panic(errMaxExprCnt) } var val interface{} var ok bool switch expr := expr.(type) { case *actionExpr: val, ok = p.parseActionExpr(expr) case *andCodeExpr: val, ok = p.parseAndCodeExpr(expr) case *andExpr: val, ok = p.parseAndExpr(expr) case *anyMatcher: val, ok = p.parseAnyMatcher(expr) case *charClassMatcher: val, ok = p.parseCharClassMatcher(expr) case *choiceExpr: val, ok = p.parseChoiceExpr(expr) case *labeledExpr: val, ok = p.parseLabeledExpr(expr) case *litMatcher: val, ok = p.parseLitMatcher(expr) case *notCodeExpr: val, ok = p.parseNotCodeExpr(expr) case *notExpr: val, ok = p.parseNotExpr(expr) case *oneOrMoreExpr: val, ok = p.parseOneOrMoreExpr(expr) case *recoveryExpr: val, ok = p.parseRecoveryExpr(expr) case *ruleRefExpr: val, ok = p.parseRuleRefExpr(expr) case *seqExpr: val, ok = p.parseSeqExpr(expr) case *stateCodeExpr: val, ok = p.parseStateCodeExpr(expr) case *throwExpr: val, ok = p.parseThrowExpr(expr) case *zeroOrMoreExpr: val, ok = p.parseZeroOrMoreExpr(expr) case *zeroOrOneExpr: val, ok = p.parseZeroOrOneExpr(expr) default: panic(fmt.Sprintf("unknown expression type %T", expr)) } if p.memoize { p.setMemoized(pt, expr, resultTuple{val, ok, p.pt}) } return val, ok } func (p *parser) parseActionExpr(act *actionExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseActionExpr")) } start := p.pt val, ok := p.parseExpr(act.expr) if ok { p.cur.pos = start.position p.cur.text = p.sliceFrom(start) state := p.cloneState() actVal, err := act.run(p) if err != nil { p.addErrAt(err, start.position, []string{}) } p.restoreState(state) val = actVal } if ok && p.debug { p.print(strings.Repeat(" ", p.depth)+"MATCH", string(p.sliceFrom(start))) } return val, ok } func (p *parser) parseAndCodeExpr(and *andCodeExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseAndCodeExpr")) } state := p.cloneState() ok, err := and.run(p) if err != nil { p.addErr(err) } p.restoreState(state) return nil, ok } func (p *parser) parseAndExpr(and *andExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseAndExpr")) } pt := p.pt state := p.cloneState() p.pushV() _, ok := p.parseExpr(and.expr) p.popV() p.restoreState(state) p.restore(pt) return nil, ok } func (p *parser) parseAnyMatcher(any *anyMatcher) (interface{}, bool) { if p.debug { defer p.out(p.in("parseAnyMatcher")) } if p.pt.rn == utf8.RuneError && p.pt.w == 0 { // EOF - see utf8.DecodeRune p.failAt(false, p.pt.position, ".") return nil, false } start := p.pt p.read() p.failAt(true, start.position, ".") return p.sliceFrom(start), true } func (p *parser) parseCharClassMatcher(chr *charClassMatcher) (interface{}, bool) { if p.debug { defer p.out(p.in("parseCharClassMatcher")) } cur := p.pt.rn start := p.pt // can't match EOF if cur == utf8.RuneError && p.pt.w == 0 { // see utf8.DecodeRune p.failAt(false, start.position, chr.val) return nil, false } if chr.ignoreCase { cur = unicode.ToLower(cur) } // try to match in the list of available chars for _, rn := range chr.chars { if rn == cur { if chr.inverted { p.failAt(false, start.position, chr.val) return nil, false } p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } } // try to match in the list of ranges for i := 0; i < len(chr.ranges); i += 2 { if cur >= chr.ranges[i] && cur <= chr.ranges[i+1] { if chr.inverted { p.failAt(false, start.position, chr.val) return nil, false } p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } } // try to match in the list of Unicode classes for _, cl := range chr.classes { if unicode.Is(cl, cur) { if chr.inverted { p.failAt(false, start.position, chr.val) return nil, false } p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } } if chr.inverted { p.read() p.failAt(true, start.position, chr.val) return p.sliceFrom(start), true } p.failAt(false, start.position, chr.val) return nil, false } func (p *parser) incChoiceAltCnt(ch *choiceExpr, altI int) { choiceIdent := fmt.Sprintf("%s %d:%d", p.rstack[len(p.rstack)-1].name, ch.pos.line, ch.pos.col) m := p.ChoiceAltCnt[choiceIdent] if m == nil { m = make(map[string]int) p.ChoiceAltCnt[choiceIdent] = m } // We increment altI by 1, so the keys do not start at 0 alt := strconv.Itoa(altI + 1) if altI == choiceNoMatch { alt = p.choiceNoMatch } m[alt]++ } func (p *parser) parseChoiceExpr(ch *choiceExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseChoiceExpr")) } for altI, alt := range ch.alternatives { // dummy assignment to prevent compile error if optimized _ = altI state := p.cloneState() p.pushV() val, ok := p.parseExpr(alt) p.popV() if ok { p.incChoiceAltCnt(ch, altI) return val, ok } p.restoreState(state) } p.incChoiceAltCnt(ch, choiceNoMatch) return nil, false } func (p *parser) parseLabeledExpr(lab *labeledExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseLabeledExpr")) } p.pushV() val, ok := p.parseExpr(lab.expr) p.popV() if ok && lab.label != "" { m := p.vstack[len(p.vstack)-1] m[lab.label] = val } return val, ok } func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) { if p.debug { defer p.out(p.in("parseLitMatcher")) } start := p.pt for _, want := range lit.val { cur := p.pt.rn if lit.ignoreCase { cur = unicode.ToLower(cur) } if cur != want { p.failAt(false, start.position, lit.want) p.restore(start) return nil, false } p.read() } p.failAt(true, start.position, lit.want) return p.sliceFrom(start), true } func (p *parser) parseNotCodeExpr(not *notCodeExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseNotCodeExpr")) } state := p.cloneState() ok, err := not.run(p) if err != nil { p.addErr(err) } p.restoreState(state) return nil, !ok } func (p *parser) parseNotExpr(not *notExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseNotExpr")) } pt := p.pt state := p.cloneState() p.pushV() p.maxFailInvertExpected = !p.maxFailInvertExpected _, ok := p.parseExpr(not.expr) p.maxFailInvertExpected = !p.maxFailInvertExpected p.popV() p.restoreState(state) p.restore(pt) return nil, !ok } func (p *parser) parseOneOrMoreExpr(expr *oneOrMoreExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseOneOrMoreExpr")) } var vals []interface{} for { p.pushV() val, ok := p.parseExpr(expr.expr) p.popV() if !ok { if len(vals) == 0 { // did not match once, no match return nil, false } return vals, true } vals = append(vals, val) } } func (p *parser) parseRecoveryExpr(recover *recoveryExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseRecoveryExpr (" + strings.Join(recover.failureLabel, ",") + ")")) } p.pushRecovery(recover.failureLabel, recover.recoverExpr) val, ok := p.parseExpr(recover.expr) p.popRecovery() return val, ok } func (p *parser) parseRuleRefExpr(ref *ruleRefExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseRuleRefExpr " + ref.name)) } if ref.name == "" { panic(fmt.Sprintf("%s: invalid rule: missing name", ref.pos)) } rule := p.rules[ref.name] if rule == nil { p.addErr(fmt.Errorf("undefined rule: %s", ref.name)) return nil, false } return p.parseRule(rule) } func (p *parser) parseSeqExpr(seq *seqExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseSeqExpr")) } vals := make([]interface{}, 0, len(seq.exprs)) pt := p.pt state := p.cloneState() for _, expr := range seq.exprs { val, ok := p.parseExpr(expr) if !ok { p.restoreState(state) p.restore(pt) return nil, false } vals = append(vals, val) } return vals, true } func (p *parser) parseStateCodeExpr(state *stateCodeExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseStateCodeExpr")) } err := state.run(p) if err != nil { p.addErr(err) } return nil, true } func (p *parser) parseThrowExpr(expr *throwExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseThrowExpr")) } for i := len(p.recoveryStack) - 1; i >= 0; i-- { if recoverExpr, ok := p.recoveryStack[i][expr.label]; ok { if val, ok := p.parseExpr(recoverExpr); ok { return val, ok } } } return nil, false } func (p *parser) parseZeroOrMoreExpr(expr *zeroOrMoreExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseZeroOrMoreExpr")) } var vals []interface{} for { p.pushV() val, ok := p.parseExpr(expr.expr) p.popV() if !ok { return vals, true } vals = append(vals, val) } } func (p *parser) parseZeroOrOneExpr(expr *zeroOrOneExpr) (interface{}, bool) { if p.debug { defer p.out(p.in("parseZeroOrOneExpr")) } p.pushV() val, _ := p.parseExpr(expr.expr) p.popV() // whether it matched or not, consider it a match return val, true } �������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/boot_command.pigeon����������������������������������0000664�0000000�0000000�00000003450�13771713062�0025153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ package bootcommand } Input <- expr:Expr EOF { return expr, nil } Expr <- l:( Wait / CharToggle / Special / Literal)+ { return l, nil } Wait = ExprStart "wait" duration:( Duration / Integer )? ExprEnd { var d time.Duration switch t := duration.(type) { case time.Duration: d = t case int64: d = time.Duration(t) * time.Second default: d = time.Second } return &waitExpression{d}, nil } CharToggle = ExprStart lit:(Literal) t:(On / Off) ExprEnd { return &literal{lit.(*literal).s, t.(KeyAction)}, nil } Special = ExprStart s:(SpecialKey) t:(On / Off)? ExprEnd { l := strings.ToLower(string(s.([]byte))) if t == nil { return &specialExpression{l, KeyPress}, nil } return &specialExpression{l, t.(KeyAction)}, nil } Number = '-'? Integer ( '.' Digit+ )? { return string(c.text), nil } Integer = '0' / NonZeroDigit Digit* { return strconv.ParseInt(string(c.text), 10, 64) } Duration = ( Number TimeUnit )+ { return time.ParseDuration(string(c.text)) } On = "on"i { return KeyOn, nil } Off = "off"i { return KeyOff, nil } Literal = . { r, _ := utf8.DecodeRune(c.text) return &literal{r, KeyPress}, nil } ExprEnd = ">" ExprStart = "<" SpecialKey = "bs"i / "del"i / "enter"i / "esc"i / "f10"i / "f11"i / "f12"i / "f1"i / "f2"i / "f3"i / "f4"i / "f5"i / "f6"i / "f7"i / "f8"i / "f9"i / "return"i / "tab"i / "up"i / "down"i / "spacebar"i / "insert"i / "home"i / "end"i / "pageUp"i / "pageDown"i / "leftAlt"i / "leftCtrl"i / "leftShift"i / "rightAlt"i / "rightCtrl"i / "rightShift"i / "leftSuper"i / "rightSuper"i / "left"i / "right"i NonZeroDigit = [1-9] Digit = [0-9] TimeUnit = ("ns" / "us" / "µs" / "ms" / "s" / "m" / "h") _ "whitespace" <- [ \n\t\r]* EOF <- !. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/boot_command_ast.go����������������������������������0000664�0000000�0000000�00000007013�13771713062�0025145�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "context" "fmt" "log" "strings" "time" ) // KeysAction represents what we want to do with a key press. // It can take 3 states. We either want to: // * press the key once // * press and hold // * press and release type KeyAction int const ( KeyOn KeyAction = 1 << iota KeyOff KeyPress ) func (k KeyAction) String() string { switch k { case KeyOn: return "On" case KeyOff: return "Off" case KeyPress: return "Press" } panic(fmt.Sprintf("Unknwon KeyAction %d", k)) } type expression interface { // Do executes the expression Do(context.Context, BCDriver) error // Validate validates the expression without executing it Validate() error } type expressionSequence []expression // Do executes every expression in the sequence and then flushes remaining // scancodes. func (s expressionSequence) Do(ctx context.Context, b BCDriver) error { // validate should never fail here, since it should be called before // expressionSequence.Do. Only reason we don't panic is so we can clean up. if errs := s.Validate(); errs != nil { return fmt.Errorf("Found an invalid boot command. This is likely an error in Packer, so please open a ticket.") } for _, exp := range s { if err := ctx.Err(); err != nil { return err } if err := exp.Do(ctx, b); err != nil { return err } } return b.Flush() } // Validate tells us if every expression in the sequence is valid. func (s expressionSequence) Validate() (errs []error) { for _, exp := range s { if err := exp.Validate(); err != nil { errs = append(errs, err) } } return } // GenerateExpressionSequence generates a sequence of expressions from the // given command. This is the primary entry point to the boot command parser. func GenerateExpressionSequence(command string) (expressionSequence, error) { seq := expressionSequence{} if command == "" { return seq, nil } got, err := ParseReader("", strings.NewReader(command)) if err != nil { return nil, err } for _, exp := range got.([]interface{}) { seq = append(seq, exp.(expression)) } return seq, nil } type waitExpression struct { d time.Duration } // Do waits the amount of time described by the expression. It is cancellable // through the context. func (w *waitExpression) Do(ctx context.Context, driver BCDriver) error { driver.Flush() log.Printf("[INFO] Waiting %s", w.d) select { case <-time.After(w.d): return nil case <-ctx.Done(): return ctx.Err() } } // Validate returns an error if the time is <= 0 func (w *waitExpression) Validate() error { if w.d <= 0 { return fmt.Errorf("Expecting a positive wait value. Got %s", w.d) } return nil } func (w *waitExpression) String() string { return fmt.Sprintf("Wait<%s>", w.d) } type specialExpression struct { s string action KeyAction } // Do sends the special command to the driver, along with the key action. func (s *specialExpression) Do(ctx context.Context, driver BCDriver) error { return driver.SendSpecial(s.s, s.action) } // Validate always passes func (s *specialExpression) Validate() error { return nil } func (s *specialExpression) String() string { return fmt.Sprintf("Spec-%s(%s)", s.action, s.s) } type literal struct { s rune action KeyAction } // Do sends the key to the driver, along with the key action. func (l *literal) Do(ctx context.Context, driver BCDriver) error { return driver.SendKey(l.s, l.action) } // Validate always passes func (l *literal) Validate() error { return nil } func (l *literal) String() string { return fmt.Sprintf("LIT-%s(%s)", l.action, string(l.s)) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/boot_command_ast_test.go�����������������������������0000664�0000000�0000000�00000004451�13771713062�0026207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "fmt" "log" "testing" "github.com/stretchr/testify/assert" ) func Test_parse(t *testing.T) { in := "<wait><wait20><wait3s><wait4m2ns>" in += "foo/bar > one 界" in += "<fon> b<fOff>" in += "<foo><f3><f12><spacebar><leftalt><rightshift><rightsuper>" expected := []string{ "Wait<1s>", "Wait<20s>", "Wait<3s>", "Wait<4m0.000000002s>", "LIT-Press(f)", "LIT-Press(o)", "LIT-Press(o)", "LIT-Press(/)", "LIT-Press(b)", "LIT-Press(a)", "LIT-Press(r)", "LIT-Press( )", "LIT-Press(>)", "LIT-Press( )", "LIT-Press(o)", "LIT-Press(n)", "LIT-Press(e)", "LIT-Press( )", "LIT-Press(界)", "LIT-On(f)", "LIT-Press( )", "LIT-Press(b)", "LIT-Off(f)", "LIT-Press(<)", "LIT-Press(f)", "LIT-Press(o)", "LIT-Press(o)", "LIT-Press(>)", "Spec-Press(f3)", "Spec-Press(f12)", "Spec-Press(spacebar)", "Spec-Press(leftalt)", "Spec-Press(rightshift)", "Spec-Press(rightsuper)", } seq, err := GenerateExpressionSequence(in) if err != nil { log.Fatal(err) } for i, exp := range seq { assert.Equal(t, expected[i], fmt.Sprintf("%s", exp)) log.Printf("%s\n", exp) } } func Test_special(t *testing.T) { var specials = []struct { in string out string }{ { "<rightShift><rightshift><RIGHTSHIFT>", "Spec-Press(rightshift)", }, { "<delon><delON><deLoN><DELON>", "Spec-On(del)", }, { "<enteroff><enterOFF><eNtErOfF><ENTEROFF>", "Spec-Off(enter)", }, } for _, tt := range specials { seq, err := GenerateExpressionSequence(tt.in) if err != nil { log.Fatal(err) } for _, exp := range seq { assert.Equal(t, tt.out, exp.(*specialExpression).String()) } } } func Test_validation(t *testing.T) { var expressions = []struct { in string valid bool }{ { "<wait1m>", true, }, { "<wait-1m>", false, }, { "<f1>", true, }, { "<", true, }, } for _, tt := range expressions { exp, err := GenerateExpressionSequence(tt.in) if err != nil { log.Fatal(err) } assert.Len(t, exp, 1) err = exp[0].Validate() if tt.valid { assert.NoError(t, err) } else { assert.Error(t, err) } } } func Test_empty(t *testing.T) { exp, err := GenerateExpressionSequence("") assert.NoError(t, err, "should have parsed an empty input okay.") assert.Len(t, exp, 0) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/config.go��������������������������������������������0000664�0000000�0000000�00000017603�13771713062�0023110�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package bootcommand import ( "fmt" "strings" "time" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // PackerKeyEnv is used to specify the key interval (delay) between keystrokes // sent to the VM, typically in boot commands. This is to prevent host CPU // utilization from causing key presses to be skipped or repeated incorrectly. const PackerKeyEnv = "PACKER_KEY_INTERVAL" // PackerKeyDefault 100ms is appropriate for shared build infrastructure while a // shorter delay (e.g. 10ms) can be used on a workstation. See PackerKeyEnv. const PackerKeyDefault = 100 * time.Millisecond // The boot configuration is very important: `boot_command` specifies the keys // to type when the virtual machine is first booted in order to start the OS // installer. This command is typed after boot_wait, which gives the virtual // machine some time to actually load. // // The boot_command is an array of strings. The strings are all typed in // sequence. It is an array only to improve readability within the template. // // There are a set of special keys available. If these are in your boot // command, they will be replaced by the proper key: // // - `<bs>` - Backspace // // - `<del>` - Delete // // - `<enter> <return>` - Simulates an actual "enter" or "return" keypress. // // - `<esc>` - Simulates pressing the escape key. // // - `<tab>` - Simulates pressing the tab key. // // - `<f1> - <f12>` - Simulates pressing a function key. // // - `<up> <down> <left> <right>` - Simulates pressing an arrow key. // // - `<spacebar>` - Simulates pressing the spacebar. // // - `<insert>` - Simulates pressing the insert key. // // - `<home> <end>` - Simulates pressing the home and end keys. // // - `<pageUp> <pageDown>` - Simulates pressing the page up and page down // keys. // // - `<menu>` - Simulates pressing the Menu key. // // - `<leftAlt> <rightAlt>` - Simulates pressing the alt key. // // - `<leftCtrl> <rightCtrl>` - Simulates pressing the ctrl key. // // - `<leftShift> <rightShift>` - Simulates pressing the shift key. // // - `<leftSuper> <rightSuper>` - Simulates pressing the ⌘ or Windows key. // // - `<wait> <wait5> <wait10>` - Adds a 1, 5 or 10 second pause before // sending any additional keys. This is useful if you have to generally // wait for the UI to update before typing more. // // - `<waitXX>` - Add an arbitrary pause before sending any additional keys. // The format of `XX` is a sequence of positive decimal numbers, each with // optional fraction and a unit suffix, such as `300ms`, `1.5h` or `2h45m`. // Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. For // example `<wait10m>` or `<wait1m20s>`. // // - `<XXXOn> <XXXOff>` - Any printable keyboard character, and of these // "special" expressions, with the exception of the `<wait>` types, can // also be toggled on or off. For example, to simulate ctrl+c, use // `<leftCtrlOn>c<leftCtrlOff>`. Be sure to release them, otherwise they // will be held down until the machine reboots. To hold the `c` key down, // you would use `<cOn>`. Likewise, `<cOff>` to release. // // - `{{ .HTTPIP }} {{ .HTTPPort }}` - The IP and port, respectively of an // HTTP server that is started serving the directory specified by the // `http_directory` configuration parameter. If `http_directory` isn't // specified, these will be blank! // // - `{{ .Name }}` - The name of the VM. // // Example boot command. This is actually a working boot command used to start an // CentOS 6.4 installer: // // In JSON: // // ```json // "boot_command": [ // "<tab><wait>", // " ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg<enter>" // ] // ``` // // In HCL2: // // ```hcl // boot_command = [ // "<tab><wait>", // " ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg<enter>" // ] // ``` // // The example shown below is a working boot command used to start an Ubuntu // 12.04 installer: // // In JSON: // // ```json // "boot_command": [ // "<esc><esc><enter><wait>", // "/install/vmlinuz noapic ", // "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", // "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", // "hostname={{ .Name }} ", // "fb=false debconf/frontend=noninteractive ", // "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", // "keyboard-configuration/variant=USA console-setup/ask_detect=false ", // "initrd=/install/initrd.gz -- <enter>" // ] // ``` // // In HCL2: // // ```hcl // boot_command = [ // "<esc><esc><enter><wait>", // "/install/vmlinuz noapic ", // "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", // "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", // "hostname={{ .Name }} ", // "fb=false debconf/frontend=noninteractive ", // "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", // "keyboard-configuration/variant=USA console-setup/ask_detect=false ", // "initrd=/install/initrd.gz -- <enter>" // ] // ``` // // For more examples of various boot commands, see the sample projects from our // [community templates page](/community-tools#templates). type BootConfig struct { // Time to wait after sending a group of key pressses. The value of this // should be a duration. Examples are `5s` and `1m30s` which will cause // Packer to wait five seconds and one minute 30 seconds, respectively. If // this isn't specified, a sensible default value is picked depending on // the builder type. BootGroupInterval time.Duration `mapstructure:"boot_keygroup_interval"` // The time to wait after booting the initial virtual machine before typing // the `boot_command`. The value of this should be a duration. Examples are // `5s` and `1m30s` which will cause Packer to wait five seconds and one // minute 30 seconds, respectively. If this isn't specified, the default is // `10s` or 10 seconds. To set boot_wait to 0s, use a negative number, such // as "-1s" BootWait time.Duration `mapstructure:"boot_wait"` // This is an array of commands to type when the virtual machine is first // booted. The goal of these commands should be to type just enough to // initialize the operating system installer. Special keys can be typed as // well, and are covered in the section below on the boot command. If this // is not specified, it is assumed the installer will start itself. BootCommand []string `mapstructure:"boot_command"` } // The boot command "typed" character for character over a VNC connection to // the machine, simulating a human actually typing the keyboard. // // Keystrokes are typed as separate key up/down events over VNC with a default // 100ms delay. The delay alleviates issues with latency and CPU contention. // You can tune this delay on a per-builder basis by specifying // "boot_key_interval" in your Packer template. type VNCConfig struct { BootConfig `mapstructure:",squash"` // Whether to create a VNC connection or not. A boot_command cannot be used // when this is true. Defaults to false. DisableVNC bool `mapstructure:"disable_vnc"` // Time in ms to wait between each key press BootKeyInterval time.Duration `mapstructure:"boot_key_interval"` } func (c *BootConfig) Prepare(ctx *interpolate.Context) (errs []error) { if c.BootWait == 0 { c.BootWait = 10 * time.Second } if c.BootCommand != nil { expSeq, err := GenerateExpressionSequence(c.FlatBootCommand()) if err != nil { errs = append(errs, err) } else if vErrs := expSeq.Validate(); vErrs != nil { errs = append(errs, vErrs...) } } return } func (c *BootConfig) FlatBootCommand() string { return strings.Join(c.BootCommand, "") } func (c *VNCConfig) Prepare(ctx *interpolate.Context) (errs []error) { if len(c.BootCommand) > 0 && c.DisableVNC { errs = append(errs, fmt.Errorf("A boot command cannot be used when vnc is disabled.")) } errs = append(errs, c.BootConfig.Prepare(ctx)...) return } �����������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/config_test.go���������������������������������������0000664�0000000�0000000�00000002200�13771713062�0024132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "testing" "time" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) func TestConfigPrepare(t *testing.T) { var c *BootConfig // Test a default boot_wait c = new(BootConfig) c.BootWait = 0 errs := c.Prepare(&interpolate.Context{}) if len(errs) > 0 { t.Fatalf("bad: %#v", errs) } if c.BootWait != 10*time.Second { t.Fatalf("bad value: %s", c.BootWait) } // Test with a good one c = new(BootConfig) c.BootWait = 5 * time.Second errs = c.Prepare(&interpolate.Context{}) if len(errs) > 0 { t.Fatalf("bad: %#v", errs) } } func TestVNCConfigPrepare(t *testing.T) { var c *VNCConfig // Test with a boot command c = new(VNCConfig) c.BootCommand = []string{"a", "b"} errs := c.Prepare(&interpolate.Context{}) if len(errs) > 0 { t.Fatalf("bad: %#v", errs) } // Test with disabled vnc c.DisableVNC = true errs = c.Prepare(&interpolate.Context{}) if len(errs) == 0 { t.Fatal("should error") } // Test no boot command with no vnc c = new(VNCConfig) c.DisableVNC = true errs = c.Prepare(&interpolate.Context{}) if len(errs) > 0 { t.Fatalf("bad: %#v", errs) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/doc.go�����������������������������������������������0000664�0000000�0000000�00000000767�13771713062�0022413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package bootcommand generates and sends boot commands to the remote instance. This package is relevant to people who want to create new builders, particularly builders with the capacity to build a VM from an iso. You can choose between three different drivers to send the command: a vnc driver, a usb driver, and a PX-XT keyboard driver. The driver you choose will depend on what kind of keyboard codes your hypervisor expects, and how you want to implement the connection. */ package bootcommand ���������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/driver.go��������������������������������������������0000664�0000000�0000000�00000000527�13771713062�0023133�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand const shiftedChars = "~!@#$%^&*()_+{}|:\"<>?" // BCDriver is our access to the VM we want to type boot commands to type BCDriver interface { SendKey(key rune, action KeyAction) error SendSpecial(special string, action KeyAction) error // Flush will be called when we want to send scancodes to the VM. Flush() error } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/gen.go�����������������������������������������������0000664�0000000�0000000�00000000121�13771713062�0022377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand //go:generate pigeon -o boot_command.go boot_command.pigeon �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/pc_xt_driver.go��������������������������������������0000664�0000000�0000000�00000015137�13771713062�0024333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "fmt" "log" "os" "strings" "time" "unicode" "unicode/utf8" ) // SendCodeFunc will be called to send codes to the VM type SendCodeFunc func([]string) error type scMap map[string]*scancode type pcXTDriver struct { interval time.Duration sendImpl SendCodeFunc specialMap scMap scancodeMap map[rune]byte buffer [][]string // TODO: set from env scancodeChunkSize int } type scancode struct { make []string break_ []string } func (sc *scancode) makeBreak() []string { return append(sc.make, sc.break_...) } // NewPCXTDriver creates a new boot command driver for VMs that expect PC-XT // keyboard codes. `send` should send its argument to the VM. `chunkSize` should // be the maximum number of keyboard codes to send to `send` at one time. func NewPCXTDriver(send SendCodeFunc, chunkSize int, interval time.Duration) *pcXTDriver { // We delay (default 100ms) between each input event to allow for CPU or // network latency. See PackerKeyEnv for tuning. keyInterval := PackerKeyDefault if delay, err := time.ParseDuration(os.Getenv(PackerKeyEnv)); err == nil { keyInterval = delay } // Override interval based on builder-specific override if interval > time.Duration(0) { keyInterval = interval } // Scancodes reference: https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html // https://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html // // Scancodes are recorded here in pairs. The first entry represents // the key press and the second entry represents the key release and is // derived from the first by the addition of 0x80. sMap := make(scMap) sMap["bs"] = &scancode{[]string{"0e"}, []string{"8e"}} sMap["del"] = &scancode{[]string{"e0", "53"}, []string{"e0", "d3"}} sMap["down"] = &scancode{[]string{"e0", "50"}, []string{"e0", "d0"}} sMap["end"] = &scancode{[]string{"e0", "4f"}, []string{"e0", "cf"}} sMap["enter"] = &scancode{[]string{"1c"}, []string{"9c"}} sMap["esc"] = &scancode{[]string{"01"}, []string{"81"}} sMap["f1"] = &scancode{[]string{"3b"}, []string{"bb"}} sMap["f2"] = &scancode{[]string{"3c"}, []string{"bc"}} sMap["f3"] = &scancode{[]string{"3d"}, []string{"bd"}} sMap["f4"] = &scancode{[]string{"3e"}, []string{"be"}} sMap["f5"] = &scancode{[]string{"3f"}, []string{"bf"}} sMap["f6"] = &scancode{[]string{"40"}, []string{"c0"}} sMap["f7"] = &scancode{[]string{"41"}, []string{"c1"}} sMap["f8"] = &scancode{[]string{"42"}, []string{"c2"}} sMap["f9"] = &scancode{[]string{"43"}, []string{"c3"}} sMap["f10"] = &scancode{[]string{"44"}, []string{"c4"}} sMap["f11"] = &scancode{[]string{"57"}, []string{"d7"}} sMap["f12"] = &scancode{[]string{"58"}, []string{"d8"}} sMap["home"] = &scancode{[]string{"e0", "47"}, []string{"e0", "c7"}} sMap["insert"] = &scancode{[]string{"e0", "52"}, []string{"e0", "d2"}} sMap["left"] = &scancode{[]string{"e0", "4b"}, []string{"e0", "cb"}} sMap["leftalt"] = &scancode{[]string{"38"}, []string{"b8"}} sMap["leftctrl"] = &scancode{[]string{"1d"}, []string{"9d"}} sMap["leftshift"] = &scancode{[]string{"2a"}, []string{"aa"}} sMap["leftsuper"] = &scancode{[]string{"e0", "5b"}, []string{"e0", "db"}} sMap["menu"] = &scancode{[]string{"e0", "5d"}, []string{"e0", "dd"}} sMap["pagedown"] = &scancode{[]string{"e0", "51"}, []string{"e0", "d1"}} sMap["pageup"] = &scancode{[]string{"e0", "49"}, []string{"e0", "c9"}} sMap["return"] = &scancode{[]string{"1c"}, []string{"9c"}} sMap["right"] = &scancode{[]string{"e0", "4d"}, []string{"e0", "cd"}} sMap["rightalt"] = &scancode{[]string{"e0", "38"}, []string{"e0", "b8"}} sMap["rightctrl"] = &scancode{[]string{"e0", "1d"}, []string{"e0", "9d"}} sMap["rightshift"] = &scancode{[]string{"36"}, []string{"b6"}} sMap["rightsuper"] = &scancode{[]string{"e0", "5c"}, []string{"e0", "dc"}} sMap["spacebar"] = &scancode{[]string{"39"}, []string{"b9"}} sMap["tab"] = &scancode{[]string{"0f"}, []string{"8f"}} sMap["up"] = &scancode{[]string{"e0", "48"}, []string{"e0", "c8"}} scancodeIndex := make(map[string]byte) scancodeIndex["1234567890-="] = 0x02 scancodeIndex["!@#$%^&*()_+"] = 0x02 scancodeIndex["qwertyuiop[]"] = 0x10 scancodeIndex["QWERTYUIOP{}"] = 0x10 scancodeIndex["asdfghjkl;'`"] = 0x1e scancodeIndex[`ASDFGHJKL:"~`] = 0x1e scancodeIndex[`\zxcvbnm,./`] = 0x2b scancodeIndex["|ZXCVBNM<>?"] = 0x2b scancodeIndex[" "] = 0x39 scancodeMap := make(map[rune]byte) for chars, start := range scancodeIndex { var i byte = 0 for len(chars) > 0 { r, size := utf8.DecodeRuneInString(chars) chars = chars[size:] scancodeMap[r] = start + i i += 1 } } return &pcXTDriver{ interval: keyInterval, sendImpl: send, specialMap: sMap, scancodeMap: scancodeMap, scancodeChunkSize: chunkSize, } } // Flush send all scanecodes. func (d *pcXTDriver) Flush() error { defer func() { d.buffer = nil }() sc, err := chunkScanCodes(d.buffer, d.scancodeChunkSize) if err != nil { return err } for _, b := range sc { if err := d.sendImpl(b); err != nil { return err } time.Sleep(d.interval) } return nil } func (d *pcXTDriver) SendKey(key rune, action KeyAction) error { keyShift := unicode.IsUpper(key) || strings.ContainsRune(shiftedChars, key) var sc []string if action&(KeyOn|KeyPress) != 0 { scInt := d.scancodeMap[key] if keyShift { sc = append(sc, "2a") } sc = append(sc, fmt.Sprintf("%02x", scInt)) } if action&(KeyOff|KeyPress) != 0 { scInt := d.scancodeMap[key] + 0x80 if keyShift { sc = append(sc, "aa") } sc = append(sc, fmt.Sprintf("%02x", scInt)) } log.Printf("Sending char '%c', code '%s', shift %v", key, strings.Join(sc, ""), keyShift) d.send(sc) return nil } func (d *pcXTDriver) SendSpecial(special string, action KeyAction) error { keyCode, ok := d.specialMap[special] if !ok { return fmt.Errorf("special %s not found.", special) } log.Printf("Special code '%s' '<%s>' found, replacing with: %v", action.String(), special, keyCode) switch action { case KeyOn: d.send(keyCode.make) case KeyOff: d.send(keyCode.break_) case KeyPress: d.send(keyCode.makeBreak()) } return nil } // send stores the codes in an internal buffer. Use Flush to send them. func (d *pcXTDriver) send(codes []string) { d.buffer = append(d.buffer, codes) } func chunkScanCodes(sc [][]string, size int) (out [][]string, err error) { var running []string for _, codes := range sc { if size > 0 { if len(codes) > size { return nil, fmt.Errorf("chunkScanCodes: size cannot be smaller than sc width.") } if len(running)+len(codes) > size { out = append(out, running) running = nil } } running = append(running, codes...) } if running != nil { out = append(out, running) } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/pc_xt_driver_test.go���������������������������������0000664�0000000�0000000�00000005446�13771713062�0025374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "context" "testing" "time" "github.com/stretchr/testify/assert" ) func Test_chunkScanCodes(t *testing.T) { var chunktests = []struct { size int in [][]string out [][]string }{ { 3, [][]string{ {"a", "b"}, {"c"}, {"d"}, {"e", "f"}, {"g", "h"}, {"i", "j"}, {"k"}, {"l", "m"}, }, [][]string{ {"a", "b", "c"}, {"d", "e", "f"}, {"g", "h"}, {"i", "j", "k"}, {"l", "m"}, }, }, { -1, [][]string{ {"a", "b"}, {"c"}, {"d"}, {"e", "f"}, {"g", "h"}, {"i", "j"}, {"k"}, {"l", "m"}, }, [][]string{ {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m"}, }, }, } for _, tt := range chunktests { out, err := chunkScanCodes(tt.in, tt.size) assert.NoError(t, err) assert.Equalf(t, tt.out, out, "expecting chunks of %d.", tt.size) } } func Test_chunkScanCodeError(t *testing.T) { // can't go from wider to thinner in := [][]string{ {"a", "b", "c"}, {"d", "e", "f"}, {"g", "h"}, } _, err := chunkScanCodes(in, 2) assert.Error(t, err) } func Test_pcxtSpecialOnOff(t *testing.T) { in := "<rightShift><rightshiftoff><RIGHTSHIFTON>" expected := []string{"36", "b6", "b6", "36"} var codes []string sendCodes := func(c []string) error { codes = c return nil } d := NewPCXTDriver(sendCodes, -1, time.Duration(0)) seq, err := GenerateExpressionSequence(in) assert.NoError(t, err) err = seq.Do(context.Background(), d) assert.NoError(t, err) assert.Equal(t, expected, codes) } func Test_pcxtSpecial(t *testing.T) { in := "<left>" expected := []string{"e0", "4b", "e0", "cb"} var codes []string sendCodes := func(c []string) error { codes = c return nil } d := NewPCXTDriver(sendCodes, -1, time.Duration(0)) seq, err := GenerateExpressionSequence(in) assert.NoError(t, err) err = seq.Do(context.Background(), d) assert.NoError(t, err) assert.Equal(t, expected, codes) } func Test_flushes(t *testing.T) { in := "abc123<wait>098" expected := [][]string{ {"1e", "9e", "30", "b0", "2e", "ae", "02", "82", "03", "83", "04", "84"}, {"0b", "8b", "0a", "8a", "09", "89"}, } var actual [][]string sendCodes := func(c []string) error { actual = append(actual, c) return nil } d := NewPCXTDriver(sendCodes, -1, time.Duration(0)) seq, err := GenerateExpressionSequence(in) assert.NoError(t, err) err = seq.Do(context.Background(), d) assert.NoError(t, err) assert.Equal(t, expected, actual) } func Test_KeyIntervalNotGiven(t *testing.T) { d := NewPCXTDriver(nil, -1, time.Duration(0)) assert.Equal(t, d.interval, time.Duration(100)*time.Millisecond) } func Test_KeyIntervalGiven(t *testing.T) { d := NewPCXTDriver(nil, -1, time.Duration(5000)*time.Millisecond) assert.Equal(t, d.interval, time.Duration(5000)*time.Millisecond) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/usb_driver.go����������������������������������������0000664�0000000�0000000�00000007146�13771713062�0024010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "fmt" "log" "os" "strings" "time" "unicode" "golang.org/x/mobile/event/key" ) // SendUsbScanCodes will be called to send codes to the VM type SendUsbScanCodes func(k key.Code, down bool) error type usbDriver struct { sendImpl SendUsbScanCodes interval time.Duration specialMap map[string]key.Code scancodeMap map[rune]key.Code } func NewUSBDriver(send SendUsbScanCodes, interval time.Duration) *usbDriver { // We delay (default 100ms) between each key event to allow for CPU or // network latency. See PackerKeyEnv for tuning. keyInterval := PackerKeyDefault if delay, err := time.ParseDuration(os.Getenv(PackerKeyEnv)); err == nil { keyInterval = delay } // override interval based on builder-specific override. if interval > time.Duration(0) { keyInterval = interval } special := map[string]key.Code{ "enter": key.CodeReturnEnter, "return": key.CodeReturnEnter, "esc": key.CodeEscape, "bs": key.CodeDeleteBackspace, "del": key.CodeDeleteForward, "tab": key.CodeTab, "f1": key.CodeF1, "f2": key.CodeF2, "f3": key.CodeF3, "f4": key.CodeF4, "f5": key.CodeF5, "f6": key.CodeF6, "f7": key.CodeF7, "f8": key.CodeF8, "f9": key.CodeF9, "f10": key.CodeF10, "f11": key.CodeF11, "f12": key.CodeF12, "insert": key.CodeInsert, "home": key.CodeHome, "end": key.CodeEnd, "pageUp": key.CodePageUp, "pageDown": key.CodePageDown, "left": key.CodeLeftArrow, "right": key.CodeRightArrow, "up": key.CodeUpArrow, "down": key.CodeDownArrow, "leftalt": key.CodeLeftAlt, "leftctrl": key.CodeLeftControl, "leftshift": key.CodeLeftShift, "rightalt": key.CodeRightAlt, "rightctrl": key.CodeRightControl, "rightshift": key.CodeRightShift, "leftsuper": key.CodeLeftGUI, "rightsuper": key.CodeRightGUI, "spacebar": key.CodeSpacebar, } scancodeIndex := make(map[string]key.Code) scancodeIndex["abcdefghijklmnopqrstuvwxyz"] = key.CodeA scancodeIndex["ABCDEFGHIJKLMNOPQRSTUVWXYZ"] = key.CodeA scancodeIndex["1234567890"] = key.Code1 scancodeIndex["!@#$%^&*()"] = key.Code1 scancodeIndex[" "] = key.CodeSpacebar scancodeIndex["-=[]\\"] = key.CodeHyphenMinus scancodeIndex["_+{}|"] = key.CodeHyphenMinus scancodeIndex[";'`,./"] = key.CodeSemicolon scancodeIndex[":\"~<>?"] = key.CodeSemicolon var scancodeMap = make(map[rune]key.Code) for chars, start := range scancodeIndex { for i, r := range chars { scancodeMap[r] = start + key.Code(i) } } return &usbDriver{ sendImpl: send, specialMap: special, interval: keyInterval, scancodeMap: scancodeMap, } } func (d *usbDriver) keyEvent(k key.Code, down bool) error { if err := d.sendImpl(k, down); err != nil { return err } time.Sleep(d.interval) return nil } func (d *usbDriver) Flush() error { return nil } func (d *usbDriver) SendKey(k rune, action KeyAction) error { keyShift := unicode.IsUpper(k) || strings.ContainsRune(shiftedChars, k) keyCode := d.scancodeMap[k] log.Printf("Sending char '%c', code %s, shift %v", k, keyCode, keyShift) return d.keyEvent(keyCode, keyShift) } func (d *usbDriver) SendSpecial(special string, action KeyAction) (err error) { keyCode, ok := d.specialMap[special] if !ok { return fmt.Errorf("special %s not found.", special) } log.Printf("Special code '<%s>' found, replacing with: %s", special, keyCode) switch action { case KeyOn: err = d.keyEvent(keyCode, true) case KeyOff, KeyPress: err = d.keyEvent(keyCode, false) } return err } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/usb_driver_test.go�����������������������������������0000664�0000000�0000000�00000003470�13771713062�0025043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "context" "testing" "time" "golang.org/x/mobile/event/key" ) func TestUSBDriver(t *testing.T) { tc := []struct { command string code key.Code shift bool }{ { "<leftShift>", key.CodeLeftShift, false, }, { "<leftShiftOff>", key.CodeLeftShift, false, }, { "<leftShiftOn>", key.CodeLeftShift, true, }, { "<leftsuper>", key.CodeLeftGUI, false, }, { "<spacebar>", key.CodeSpacebar, false, }, { "<return>", key.CodeReturnEnter, false, }, { "a", key.CodeA, false, }, { "A", key.CodeA, true, }, { "_", key.CodeHyphenMinus, true, }, } for _, tt := range tc { t.Run(tt.command, func(t *testing.T) { var code key.Code var shift bool sendCodes := func(c key.Code, d bool) error { code = c shift = d return nil } d := NewUSBDriver(sendCodes, time.Duration(0)) seq, err := GenerateExpressionSequence(tt.command) if err != nil { t.Fatalf("bad: not expected error: %s", err.Error()) } err = seq.Do(context.Background(), d) if err != nil { t.Fatalf("bad: not expected error: %s", err.Error()) } if code != tt.code { t.Fatalf("bad: wrong scan code: \n expected: %s \n actual: %s", tt.code, code) } if shift != tt.shift { t.Fatalf("bad: wrong shift: \n expected: %t \n actual: %t", tt.shift, shift) } }) } } func TestUSBDriver_KeyIntervalNotGiven(t *testing.T) { d := NewUSBDriver(nil, time.Duration(0)) if d.interval != time.Duration(100)*time.Millisecond { t.Fatal("not expected key interval") } } func TestUSBDriver_KeyIntervalGiven(t *testing.T) { d := NewUSBDriver(nil, time.Duration(5000)*time.Millisecond) if d.interval != time.Duration(5000)*time.Millisecond { t.Fatal("not expected key interval") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/vnc_driver.go����������������������������������������0000664�0000000�0000000�00000006337�13771713062�0024006�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "fmt" "log" "os" "strings" "time" "unicode" ) const KeyLeftShift uint32 = 0xFFE1 type VNCKeyEvent interface { KeyEvent(uint32, bool) error } type vncDriver struct { c VNCKeyEvent interval time.Duration specialMap map[string]uint32 // keyEvent can set this error which will prevent it from continuing err error } func NewVNCDriver(c VNCKeyEvent, interval time.Duration) *vncDriver { // We delay (default 100ms) between each key event to allow for CPU or // network latency. See PackerKeyEnv for tuning. keyInterval := PackerKeyDefault if delay, err := time.ParseDuration(os.Getenv(PackerKeyEnv)); err == nil { keyInterval = delay } // override interval based on builder-specific override. if interval > time.Duration(0) { keyInterval = interval } // Scancodes reference: https://github.com/qemu/qemu/blob/master/ui/vnc_keysym.h sMap := make(map[string]uint32) sMap["bs"] = 0xFF08 sMap["del"] = 0xFFFF sMap["down"] = 0xFF54 sMap["end"] = 0xFF57 sMap["enter"] = 0xFF0D sMap["esc"] = 0xFF1B sMap["f1"] = 0xFFBE sMap["f2"] = 0xFFBF sMap["f3"] = 0xFFC0 sMap["f4"] = 0xFFC1 sMap["f5"] = 0xFFC2 sMap["f6"] = 0xFFC3 sMap["f7"] = 0xFFC4 sMap["f8"] = 0xFFC5 sMap["f9"] = 0xFFC6 sMap["f10"] = 0xFFC7 sMap["f11"] = 0xFFC8 sMap["f12"] = 0xFFC9 sMap["home"] = 0xFF50 sMap["insert"] = 0xFF63 sMap["left"] = 0xFF51 sMap["leftalt"] = 0xFFE9 sMap["leftctrl"] = 0xFFE3 sMap["leftshift"] = 0xFFE1 sMap["leftsuper"] = 0xFFEB sMap["menu"] = 0xFF67 sMap["pagedown"] = 0xFF56 sMap["pageup"] = 0xFF55 sMap["return"] = 0xFF0D sMap["right"] = 0xFF53 sMap["rightalt"] = 0xFFEA sMap["rightctrl"] = 0xFFE4 sMap["rightshift"] = 0xFFE2 sMap["rightsuper"] = 0xFFEC sMap["spacebar"] = 0x020 sMap["tab"] = 0xFF09 sMap["up"] = 0xFF52 return &vncDriver{ c: c, interval: keyInterval, specialMap: sMap, } } func (d *vncDriver) keyEvent(k uint32, down bool) error { if d.err != nil { return nil } if err := d.c.KeyEvent(k, down); err != nil { d.err = err return err } time.Sleep(d.interval) return nil } // Flush does nothing here func (d *vncDriver) Flush() error { return nil } func (d *vncDriver) SendKey(key rune, action KeyAction) error { keyShift := unicode.IsUpper(key) || strings.ContainsRune(shiftedChars, key) keyCode := uint32(key) log.Printf("Sending char '%c', code 0x%X, shift %v", key, keyCode, keyShift) switch action { case KeyOn: if keyShift { d.keyEvent(KeyLeftShift, true) } d.keyEvent(keyCode, true) case KeyOff: if keyShift { d.keyEvent(KeyLeftShift, false) } d.keyEvent(keyCode, false) case KeyPress: if keyShift { d.keyEvent(KeyLeftShift, true) } d.keyEvent(keyCode, true) d.keyEvent(keyCode, false) if keyShift { d.keyEvent(KeyLeftShift, false) } } return d.err } func (d *vncDriver) SendSpecial(special string, action KeyAction) error { keyCode, ok := d.specialMap[special] if !ok { return fmt.Errorf("special %s not found.", special) } log.Printf("Special code '<%s>' found, replacing with: 0x%X", special, keyCode) switch action { case KeyOn: d.keyEvent(keyCode, true) case KeyOff: d.keyEvent(keyCode, false) case KeyPress: d.keyEvent(keyCode, true) d.keyEvent(keyCode, false) } return d.err } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/bootcommand/vnc_driver_test.go�����������������������������������0000664�0000000�0000000�00000002047�13771713062�0025037�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package bootcommand import ( "context" "testing" "time" "github.com/stretchr/testify/assert" ) type event struct { u uint32 down bool } type sender struct { e []event } func (s *sender) KeyEvent(u uint32, down bool) error { s.e = append(s.e, event{u, down}) return nil } func Test_vncSpecialLookup(t *testing.T) { in := "<rightShift><rightshiftoff><RIGHTSHIFTON>" expected := []event{ {0xFFE2, true}, {0xFFE2, false}, {0xFFE2, false}, {0xFFE2, true}, } s := &sender{} d := NewVNCDriver(s, time.Duration(0)) seq, err := GenerateExpressionSequence(in) assert.NoError(t, err) err = seq.Do(context.Background(), d) assert.NoError(t, err) assert.Equal(t, expected, s.e) } func Test_vncIntervalNotGiven(t *testing.T) { s := &sender{} d := NewVNCDriver(s, time.Duration(0)) assert.Equal(t, d.interval, time.Duration(100)*time.Millisecond) } func Test_vncIntervalGiven(t *testing.T) { s := &sender{} d := NewVNCDriver(s, time.Duration(5000)*time.Millisecond) assert.Equal(t, d.interval, time.Duration(5000)*time.Millisecond) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020301�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/cleanup.go������������������������������������������������0000664�0000000�0000000�00000000341�13771713062�0022255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "github.com/hashicorp/packer/packer-plugin-sdk/multistep" ) // Cleanup is an interface that some steps implement for early cleanup. type Cleanup interface { CleanupFunc(multistep.StateBag) error } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/communicator.go�������������������������������������������0000664�0000000�0000000�00000007033�13771713062�0023333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "bytes" "context" "fmt" "io" "log" "os" "os/exec" "path/filepath" "strconv" "strings" "syscall" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) // Communicator is a special communicator that works by executing // commands locally but within a chroot. type Communicator struct { Chroot string CmdWrapper common.CommandWrapper } func (c *Communicator) Start(ctx context.Context, cmd *packersdk.RemoteCmd) error { // need extra escapes for the command since we're wrapping it in quotes cmd.Command = strconv.Quote(cmd.Command) command, err := c.CmdWrapper( fmt.Sprintf("chroot %s /bin/sh -c %s", c.Chroot, cmd.Command)) if err != nil { return err } localCmd := common.ShellCommand(command) localCmd.Stdin = cmd.Stdin localCmd.Stdout = cmd.Stdout localCmd.Stderr = cmd.Stderr log.Printf("Executing: %s %#v", localCmd.Path, localCmd.Args) if err := localCmd.Start(); err != nil { return err } go func() { exitStatus := 0 if err := localCmd.Wait(); err != nil { if exitErr, ok := err.(*exec.ExitError); ok { exitStatus = 1 // There is no process-independent way to get the REAL // exit status so we just try to go deeper. if status, ok := exitErr.Sys().(syscall.WaitStatus); ok { exitStatus = status.ExitStatus() } } } log.Printf( "Chroot execution exited with '%d': '%s'", exitStatus, cmd.Command) cmd.SetExited(exitStatus) }() return nil } func (c *Communicator) Upload(dst string, r io.Reader, fi *os.FileInfo) error { dst = filepath.Join(c.Chroot, dst) log.Printf("Uploading to chroot dir: %s", dst) tf, err := tmp.File("packer-amazon-chroot") if err != nil { return fmt.Errorf("Error preparing shell script: %s", err) } defer os.Remove(tf.Name()) if _, err := io.Copy(tf, r); err != nil { return err } cpCmd, err := c.CmdWrapper(fmt.Sprintf("cp %s %s", tf.Name(), dst)) if err != nil { return err } return common.ShellCommand(cpCmd).Run() } func (c *Communicator) UploadDir(dst string, src string, exclude []string) error { // If src ends with a trailing "/", copy from "src/." so that // directory contents (including hidden files) are copied, but the // directory "src" is omitted. BSD does this automatically when // the source contains a trailing slash, but linux does not. if src[len(src)-1] == '/' { src = src + "." } // TODO: remove any file copied if it appears in `exclude` chrootDest := filepath.Join(c.Chroot, dst) log.Printf("Uploading directory '%s' to '%s'", src, chrootDest) cpCmd, err := c.CmdWrapper(fmt.Sprintf("cp -R '%s' %s", src, chrootDest)) if err != nil { return err } var stderr bytes.Buffer cmd := common.ShellCommand(cpCmd) cmd.Env = append(cmd.Env, "LANG=C") cmd.Env = append(cmd.Env, os.Environ()...) cmd.Stderr = &stderr err = cmd.Run() if err == nil { return err } if strings.Contains(stderr.String(), "No such file") { // This just means that the directory was empty. Just ignore it. return nil } return err } func (c *Communicator) DownloadDir(src string, dst string, exclude []string) error { return fmt.Errorf("DownloadDir is not implemented for amazon-chroot") } func (c *Communicator) Download(src string, w io.Writer) error { src = filepath.Join(c.Chroot, src) log.Printf("Downloading from chroot dir: %s", src) f, err := os.Open(src) if err != nil { return err } defer f.Close() if _, err := io.Copy(w, f); err != nil { return err } return nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/communicator_test.go��������������������������������������0000664�0000000�0000000�00000000475�13771713062�0024375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestCommunicator_ImplementsCommunicator(t *testing.T) { var raw interface{} raw = &Communicator{} if _, ok := raw.(packersdk.Communicator); !ok { t.Fatalf("Communicator should be a communicator") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/doc.go����������������������������������������������������0000664�0000000�0000000�00000002256�13771713062�0021402�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package chroot provides convenience tooling specific to chroot builders. Chroot builders work by creating a new volume from an existing source image and attaching it into an already-running instance. Once attached, a chroot is used to provision the system within that volume. After provisioning, the volume is detached, snapshotted, and a cloud-specific image is made. Using this process, minutes can be shaved off image build processes because a new instance doesn't need to be launched in the cloud before provisioning can take place. There are some restrictions, however. The host instance where the volume is attached to must be a similar system (generally the same OS version, kernel versions, etc.) as the image being built. Additionally, this process is much more expensive because the instance used to perform the build must be kept running persistently in order to build images, whereas the other non-chroot cloud image builders start instances on-demand to build images as needed. The HashiCorp-maintained Amazon and Azure builder plugins have chroot builders which use this option and can serve as an example for how the chroot steps and communicator are used. */ package chroot ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/interpolate_context_provider.go���������������������������0000664�0000000�0000000�00000000255�13771713062�0026636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" type interpolateContextProvider interface { GetContext() interpolate.Context } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/run_local_commands.go�������������������������������������0000664�0000000�0000000�00000002262�13771713062�0024471�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" sl "github.com/hashicorp/packer/packer-plugin-sdk/shell-local" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) func RunLocalCommands(commands []string, wrappedCommand common.CommandWrapper, ictx interpolate.Context, ui packersdk.Ui) error { ctx := context.TODO() for _, rawCmd := range commands { intCmd, err := interpolate.Render(rawCmd, &ictx) if err != nil { return fmt.Errorf("Error interpolating: %s", err) } command, err := wrappedCommand(intCmd) if err != nil { return fmt.Errorf("Error wrapping command: %s", err) } ui.Say(fmt.Sprintf("Executing command: %s", command)) comm := &sl.Communicator{ ExecuteCommand: []string{"sh", "-c", command}, } cmd := &packersdk.RemoteCmd{Command: command} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return fmt.Errorf("Error executing command: %s", err) } if cmd.ExitStatus() != 0 { return fmt.Errorf( "Received non-zero exit code %d from command: %s", cmd.ExitStatus(), command) } } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_chroot_provision.go����������������������������������0000664�0000000�0000000�00000002547�13771713062�0025301�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "context" "log" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepChrootProvision provisions the instance within a chroot. type StepChrootProvision struct { } func (s *StepChrootProvision) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { hook := state.Get("hook").(packersdk.Hook) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packersdk.Ui) wrappedCommand := state.Get("wrappedCommand").(common.CommandWrapper) // Create our communicator comm := &Communicator{ Chroot: mountPath, CmdWrapper: wrappedCommand, } // Loads hook data from builder's state, if it has been set. hookData := commonsteps.PopulateProvisionHookData(state) // Update state generated_data with complete hookData // to make them accessible by post-processors state.Put("generated_data", hookData) // Provision log.Println("Running the provision hook") if err := hook.Run(ctx, packersdk.HookProvision, ui, comm, hookData); err != nil { state.Put("error", err) return multistep.ActionHalt } return multistep.ActionContinue } func (s *StepChrootProvision) Cleanup(state multistep.StateBag) {} ���������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_copy_files.go����������������������������������������0000664�0000000�0000000�00000005310�13771713062�0024016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "bytes" "context" "fmt" "log" "path/filepath" "runtime" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepCopyFiles copies some files from the host into the chroot environment. // // Produces: // copy_files_cleanup CleanupFunc - A function to clean up the copied files // early. type StepCopyFiles struct { Files []string files []string } func (s *StepCopyFiles) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packersdk.Ui) wrappedCommand := state.Get("wrappedCommand").(common.CommandWrapper) stderr := new(bytes.Buffer) s.files = make([]string, 0, len(s.Files)) if len(s.Files) > 0 { ui.Say("Copying files from host to chroot...") var removeDestinationOption string switch runtime.GOOS { case "freebsd": // The -f option here is closer to GNU --remove-destination than // what POSIX says -f should do. removeDestinationOption = "-f" default: // This is the GNU binutils version. removeDestinationOption = "--remove-destination" } for _, path := range s.Files { ui.Message(path) chrootPath := filepath.Join(mountPath, path) log.Printf("Copying '%s' to '%s'", path, chrootPath) cmdText, err := wrappedCommand(fmt.Sprintf("cp %s %s %s", removeDestinationOption, path, chrootPath)) if err != nil { err := fmt.Errorf("Error building copy command: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } stderr.Reset() cmd := common.ShellCommand(cmdText) cmd.Stderr = stderr if err := cmd.Run(); err != nil { err := fmt.Errorf( "Error copying file: %s\nnStderr: %s", err, stderr.String()) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } s.files = append(s.files, chrootPath) } } state.Put("copy_files_cleanup", s) return multistep.ActionContinue } func (s *StepCopyFiles) Cleanup(state multistep.StateBag) { ui := state.Get("ui").(packersdk.Ui) if err := s.CleanupFunc(state); err != nil { ui.Error(err.Error()) } } func (s *StepCopyFiles) CleanupFunc(state multistep.StateBag) error { wrappedCommand := state.Get("wrappedCommand").(common.CommandWrapper) if s.files != nil { for _, file := range s.files { log.Printf("Removing: %s", file) localCmdText, err := wrappedCommand(fmt.Sprintf("rm -f %s", file)) if err != nil { return err } localCmd := common.ShellCommand(localCmdText) if err := localCmd.Run(); err != nil { return err } } } s.files = nil return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_copy_files_test.go�����������������������������������0000664�0000000�0000000�00000005611�13771713062�0025061�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "context" "fmt" "io/ioutil" "path" "runtime" "strings" "testing" "time" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // testUI returns a test ui plus a function to retrieve the errors written to the ui func testUI() (packersdk.Ui, func() string) { errorBuffer := &strings.Builder{} ui := &packersdk.BasicUi{ Reader: strings.NewReader(""), Writer: ioutil.Discard, ErrorWriter: errorBuffer, } return ui, errorBuffer.String } func TestCopyFilesCleanupFunc_ImplementsCleanupFunc(t *testing.T) { var raw interface{} raw = new(StepCopyFiles) if _, ok := raw.(Cleanup); !ok { t.Fatalf("cleanup func should be a CleanupFunc") } } func TestCopyFiles_Run(t *testing.T) { mountPath := "/mnt/abcde" copySource := "/etc/resolv.conf" copyDestination := path.Join(mountPath, "etc", "resolv.conf") step := &StepCopyFiles{ Files: []string{ copySource, }, } var gotCommand string commandRunCount := 0 var wrapper common.CommandWrapper wrapper = func(ran string) (string, error) { gotCommand = ran commandRunCount++ return "", nil } state := new(multistep.BasicStateBag) state.Put("mount_path", mountPath) state.Put("wrappedCommand", wrapper) ui, getErrs := testUI() state.Put("ui", ui) var expectedCopyTemplate string switch runtime.GOOS { case "linux": expectedCopyTemplate = "cp --remove-destination %s %s" case "freebsd": expectedCopyTemplate = "cp -f %s %s" default: t.Skip("Unsupported operating system") } ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() got := step.Run(ctx, state) if got != multistep.ActionContinue { t.Errorf("Expected 'continue', but got '%v'", got) } if commandRunCount != 1 { t.Errorf("Copy command should run exactly once but ran %v times", commandRunCount) } expectedCopyCommand := fmt.Sprintf(expectedCopyTemplate, copySource, copyDestination) if gotCommand != expectedCopyCommand { t.Errorf("Expected command was '%v' but actual was '%v'", expectedCopyCommand, gotCommand) } _ = getErrs } func TestCopyFiles_CopyNothing(t *testing.T) { step := &StepCopyFiles{ Files: []string{}, } commandRunCount := 0 var wrapper common.CommandWrapper wrapper = func(ran string) (string, error) { commandRunCount++ return "", nil } state := new(multistep.BasicStateBag) state.Put("mount_path", "/mnt/something") state.Put("wrappedCommand", wrapper) ui, getErrs := testUI() state.Put("ui", ui) ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() got := step.Run(ctx, state) if got != multistep.ActionContinue { t.Errorf("Expected 'continue', but got '%v'", got) } if commandRunCount != 0 { t.Errorf("Copy command should not run but ran %v times", commandRunCount) } _ = getErrs } �����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_early_cleanup.go�������������������������������������0000664�0000000�0000000�00000001747�13771713062�0024517�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "context" "fmt" "log" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepEarlyCleanup performs some of the cleanup steps early in order to // prepare for snapshotting and creating an AMI. type StepEarlyCleanup struct{} func (s *StepEarlyCleanup) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) cleanupKeys := []string{ "copy_files_cleanup", "mount_extra_cleanup", "mount_device_cleanup", "attach_cleanup", } for _, key := range cleanupKeys { c := state.Get(key).(Cleanup) log.Printf("Running cleanup func: %s", key) if err := c.CleanupFunc(state); err != nil { err := fmt.Errorf("Error cleaning up: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } } return multistep.ActionContinue } func (s *StepEarlyCleanup) Cleanup(state multistep.StateBag) {} �������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_mount_extra.go���������������������������������������0000664�0000000�0000000�00000006750�13771713062�0024240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "bytes" "context" "fmt" "os" "os/exec" "syscall" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepMountExtra mounts the attached device. // // Produces: // mount_extra_cleanup CleanupFunc - To perform early cleanup type StepMountExtra struct { ChrootMounts [][]string mounts []string } func (s *StepMountExtra) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packersdk.Ui) wrappedCommand := state.Get("wrappedCommand").(common.CommandWrapper) s.mounts = make([]string, 0, len(s.ChrootMounts)) ui.Say("Mounting additional paths within the chroot...") for _, mountInfo := range s.ChrootMounts { innerPath := mountPath + mountInfo[2] if err := os.MkdirAll(innerPath, 0755); err != nil { err := fmt.Errorf("Error creating mount directory: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } flags := "-t " + mountInfo[0] if mountInfo[0] == "bind" { flags = "--bind" } ui.Message(fmt.Sprintf("Mounting: %s", mountInfo[2])) stderr := new(bytes.Buffer) mountCommand, err := wrappedCommand(fmt.Sprintf( "mount %s %s %s", flags, mountInfo[1], innerPath)) if err != nil { err := fmt.Errorf("Error creating mount command: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } cmd := common.ShellCommand(mountCommand) cmd.Stderr = stderr if err := cmd.Run(); err != nil { err := fmt.Errorf( "Error mounting: %s\nStderr: %s", err, stderr.String()) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } s.mounts = append(s.mounts, innerPath) } state.Put("mount_extra_cleanup", s) return multistep.ActionContinue } func (s *StepMountExtra) Cleanup(state multistep.StateBag) { ui := state.Get("ui").(packersdk.Ui) if err := s.CleanupFunc(state); err != nil { ui.Error(err.Error()) return } } func (s *StepMountExtra) CleanupFunc(state multistep.StateBag) error { if s.mounts == nil { return nil } wrappedCommand := state.Get("wrappedCommand").(common.CommandWrapper) for len(s.mounts) > 0 { var path string lastIndex := len(s.mounts) - 1 path, s.mounts = s.mounts[lastIndex], s.mounts[:lastIndex] grepCommand, err := wrappedCommand(fmt.Sprintf("grep %s /proc/mounts", path)) if err != nil { return fmt.Errorf("Error creating grep command: %s", err) } // Before attempting to unmount, // check to see if path is already unmounted stderr := new(bytes.Buffer) cmd := common.ShellCommand(grepCommand) cmd.Stderr = stderr if err := cmd.Run(); err != nil { if exitError, ok := err.(*exec.ExitError); ok { if status, ok := exitError.Sys().(syscall.WaitStatus); ok { exitStatus := status.ExitStatus() if exitStatus == 1 { // path has already been unmounted // just skip this path continue } } } } unmountCommand, err := wrappedCommand(fmt.Sprintf("umount %s", path)) if err != nil { return fmt.Errorf("Error creating unmount command: %s", err) } stderr = new(bytes.Buffer) cmd = common.ShellCommand(unmountCommand) cmd.Stderr = stderr if err := cmd.Run(); err != nil { return fmt.Errorf( "Error unmounting device: %s\nStderr: %s", err, stderr.String()) } } s.mounts = nil return nil } ������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_mount_extra_test.go����������������������������������0000664�0000000�0000000�00000000361�13771713062�0025267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import "testing" func TestMountExtraCleanupFunc_ImplementsCleanupFunc(t *testing.T) { var raw interface{} raw = new(StepMountExtra) if _, ok := raw.(Cleanup); !ok { t.Fatalf("cleanup func should be a CleanupFunc") } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_post_mount_commands.go�������������������������������0000664�0000000�0000000�00000002474�13771713062�0025762�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "context" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type postMountCommandsData struct { Device string MountPath string } // StepPostMountCommands allows running arbitrary commands after mounting the // device, but prior to the bind mount and copy steps. type StepPostMountCommands struct { Commands []string } func (s *StepPostMountCommands) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(interpolateContextProvider) device := state.Get("device").(string) mountPath := state.Get("mount_path").(string) ui := state.Get("ui").(packersdk.Ui) wrappedCommand := state.Get("wrappedCommand").(common.CommandWrapper) if len(s.Commands) == 0 { return multistep.ActionContinue } ictx := config.GetContext() ictx.Data = &postMountCommandsData{ Device: device, MountPath: mountPath, } ui.Say("Running post-mount commands...") if err := RunLocalCommands(s.Commands, wrappedCommand, ictx, ui); err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } return multistep.ActionContinue } func (s *StepPostMountCommands) Cleanup(state multistep.StateBag) {} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/chroot/step_pre_mount_commands.go��������������������������������0000664�0000000�0000000�00000002241�13771713062�0025553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chroot import ( "context" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type preMountCommandsData struct { Device string } // StepPreMountCommands sets up the a new block device when building from scratch type StepPreMountCommands struct { Commands []string } func (s *StepPreMountCommands) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { config := state.Get("config").(interpolateContextProvider) device := state.Get("device").(string) ui := state.Get("ui").(packersdk.Ui) wrappedCommand := state.Get("wrappedCommand").(common.CommandWrapper) if len(s.Commands) == 0 { return multistep.ActionContinue } ictx := config.GetContext() ictx.Data = &preMountCommandsData{Device: device} ui.Say("Running device setup commands...") if err := RunLocalCommands(s.Commands, wrappedCommand, ictx, ui); err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } return multistep.ActionContinue } func (s *StepPreMountCommands) Cleanup(state multistep.StateBag) {} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/common/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020273�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/common/command.go������������������������������������������������0000664�0000000�0000000�00000001455�13771713062�0022245�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package common import ( "os/exec" ) // CommandWrapper is a type that given a command, will modify that // command in-flight. This might return an error. // For example, your command could be `foo` and your CommandWrapper could be // func(s string) (string, error) { // return fmt.Sprintf("/bin/sh/ %s", s) // } // Using the CommandWrapper, you can set environment variables or perform // string interpolation once rather than many times, to save some lines of code // if similar wrapping needs to be performed many times during a plugin run. type CommandWrapper func(string) (string, error) // ShellCommand takes a command string and returns an *exec.Cmd to execute // it within the context of a shell (/bin/sh). func ShellCommand(command string) *exec.Cmd { return exec.Command("/bin/sh", "-c", command) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/common/packer_config.go������������������������������������������0000664�0000000�0000000�00000004316�13771713062�0023420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package common const ( // This is the key in configurations that is set to the name of the // build. BuildNameConfigKey = "packer_build_name" // This is the key in the configuration that is set to the type // of the builder that is run. This is useful for provisioners and // such who want to make use of this. BuilderTypeConfigKey = "packer_builder_type" // this is the key in the configuration that is set to the version of the // Packer Core. This can be used by plugins to set user agents, etc, without // having to import the Core to find out the Packer version. CoreVersionConfigKey = "packer_core_version" // This is the key in configurations that is set to "true" when Packer // debugging is enabled. DebugConfigKey = "packer_debug" // This is the key in configurations that is set to "true" when Packer // force build is enabled. ForceConfigKey = "packer_force" // This key determines what to do when a normal multistep step fails // - "cleanup" - run cleanup steps // - "abort" - exit without cleanup // - "ask" - ask the user OnErrorConfigKey = "packer_on_error" // TemplatePathKey is the path to the template that configured this build TemplatePathKey = "packer_template_path" // This key contains a map[string]string of the user variables for // template processing. UserVariablesConfigKey = "packer_user_variables" ) // PackerConfig is a struct that contains the configuration keys that // are sent by packer, properly tagged already so mapstructure can load // them. Embed this structure into your configuration class to get access to // this information from the Packer Core. type PackerConfig struct { PackerBuildName string `mapstructure:"packer_build_name"` PackerBuilderType string `mapstructure:"packer_builder_type"` PackerCoreVersion string `mapstructure:"packer_core_version"` PackerDebug bool `mapstructure:"packer_debug"` PackerForce bool `mapstructure:"packer_force"` PackerOnError string `mapstructure:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021503�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/comm_host.go����������������������������������������0000664�0000000�0000000�00000001074�13771713062�0024024�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "fmt" "log" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" ) // Generic commHost function that should work for most cloud builders. func CommHost(host string, statebagKey string) func(multistep.StateBag) (string, error) { return func(state multistep.StateBag) (string, error) { if host != "" { log.Printf("Using host value: %s", host) return host, nil } ipAddress, hasIP := state.Get(statebagKey).(string) if !hasIP { return "", fmt.Errorf("Failed to retrieve IP address.") } return ipAddress, nil } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/config.go�������������������������������������������0000664�0000000�0000000�00000054146�13771713062�0023311�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type Config,SSH,WinRM,SSHTemporaryKeyPair package communicator import ( "errors" "fmt" "io/ioutil" "net" "os" "time" "github.com/hashicorp/hcl/v2/hcldec" helperssh "github.com/hashicorp/packer/packer-plugin-sdk/communicator/ssh" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/pathing" packerssh "github.com/hashicorp/packer/packer-plugin-sdk/sdk-internals/communicator/ssh" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/masterzen/winrm" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) // Config is the common configuration that communicators allow within // a builder. type Config struct { // Packer currently supports three kinds of communicators: // // - `none` - No communicator will be used. If this is set, most // provisioners also can't be used. // // - `ssh` - An SSH connection will be established to the machine. This // is usually the default. // // - `winrm` - A WinRM connection will be established. // // In addition to the above, some builders have custom communicators they // can use. For example, the Docker builder has a "docker" communicator // that uses `docker exec` and `docker cp` to execute scripts and copy // files. Type string `mapstructure:"communicator"` // We recommend that you enable SSH or WinRM as the very last step in your // guest's bootstrap script, but sometimes you may have a race condition // where you need Packer to wait before attempting to connect to your // guest. // // If you end up in this situation, you can use the template option // `pause_before_connecting`. By default, there is no pause. For example if // you set `pause_before_connecting` to `10m` Packer will check whether it // can connect, as normal. But once a connection attempt is successful, it // will disconnect and then wait 10 minutes before connecting to the guest // and beginning provisioning. PauseBeforeConnect time.Duration `mapstructure:"pause_before_connecting"` SSH `mapstructure:",squash"` WinRM `mapstructure:",squash"` } type SSH struct { // The address to SSH to. This usually is automatically configured by the // builder. SSHHost string `mapstructure:"ssh_host"` // The port to connect to SSH. This defaults to `22`. SSHPort int `mapstructure:"ssh_port"` // The username to connect to SSH with. Required if using SSH. SSHUsername string `mapstructure:"ssh_username"` // A plaintext password to use to authenticate with SSH. SSHPassword string `mapstructure:"ssh_password"` // If specified, this is the key that will be used for SSH with the // machine. The key must match a key pair name loaded up into the remote. // By default, this is blank, and Packer will generate a temporary keypair // unless [`ssh_password`](#ssh_password) is used. // [`ssh_private_key_file`](#ssh_private_key_file) or // [`ssh_agent_auth`](#ssh_agent_auth) must be specified when // [`ssh_keypair_name`](#ssh_keypair_name) is utilized. SSHKeyPairName string `mapstructure:"ssh_keypair_name" undocumented:"true"` // The name of the temporary key pair to generate. By default, Packer // generates a name that looks like `packer_<UUID>`, where &lt;UUID&gt; is // a 36 character unique identifier. SSHTemporaryKeyPairName string `mapstructure:"temporary_key_pair_name" undocumented:"true"` SSHTemporaryKeyPair `mapstructure:",squash"` // This overrides the value of ciphers supported by default by golang. // The default value is [ // "aes128-gcm@openssh.com", // "chacha20-poly1305@openssh.com", // "aes128-ctr", "aes192-ctr", "aes256-ctr", // ] // // Valid options for ciphers include: // "aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", // "chacha20-poly1305@openssh.com", // "arcfour256", "arcfour128", "arcfour", "aes128-cbc", "3des-cbc", SSHCiphers []string `mapstructure:"ssh_ciphers"` // If true, Packer will attempt to remove its temporary key from // `~/.ssh/authorized_keys` and `/root/.ssh/authorized_keys`. This is a // mostly cosmetic option, since Packer will delete the temporary private // key from the host system regardless of whether this is set to true // (unless the user has set the `-debug` flag). Defaults to "false"; // currently only works on guests with `sed` installed. SSHClearAuthorizedKeys bool `mapstructure:"ssh_clear_authorized_keys"` // If set, Packer will override the value of key exchange (kex) altorighms // supported by default by golang. Acceptable values include: // "curve25519-sha256@libssh.org", "ecdh-sha2-nistp256", // "ecdh-sha2-nistp384", "ecdh-sha2-nistp521", // "diffie-hellman-group14-sha1", and "diffie-hellman-group1-sha1". SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms"` // Path to a PEM encoded private key file to use to authenticate with SSH. // The `~` can be used in path and will be expanded to the home directory // of current user. SSHPrivateKeyFile string `mapstructure:"ssh_private_key_file" undocumented:"true"` // Path to user certificate used to authenticate with SSH. // The `~` can be used in path and will be expanded to the // home directory of current user. SSHCertificateFile string `mapstructure:"ssh_certificate_file"` // If `true`, a PTY will be requested for the SSH connection. This defaults // to `false`. SSHPty bool `mapstructure:"ssh_pty"` // The time to wait for SSH to become available. Packer uses this to // determine when the machine has booted so this is usually quite long. // Example value: `10m`. SSHTimeout time.Duration `mapstructure:"ssh_timeout"` // Deprecated in favor of SSHTimeout SSHWaitTimeout time.Duration `mapstructure:"ssh_wait_timeout" undocumented:"true"` // If true, the local SSH agent will be used to authenticate connections to // the source instance. No temporary keypair will be created, and the // values of [`ssh_password`](#ssh_password) and // [`ssh_private_key_file`](#ssh_private_key_file) will be ignored. The // environment variable `SSH_AUTH_SOCK` must be set for this option to work // properly. SSHAgentAuth bool `mapstructure:"ssh_agent_auth" undocumented:"true"` // If true, SSH agent forwarding will be disabled. Defaults to `false`. SSHDisableAgentForwarding bool `mapstructure:"ssh_disable_agent_forwarding"` // The number of handshakes to attempt with SSH once it can connect. This // defaults to `10`. SSHHandshakeAttempts int `mapstructure:"ssh_handshake_attempts"` // A bastion host to use for the actual SSH connection. SSHBastionHost string `mapstructure:"ssh_bastion_host"` // The port of the bastion host. Defaults to `22`. SSHBastionPort int `mapstructure:"ssh_bastion_port"` // If `true`, the local SSH agent will be used to authenticate with the // bastion host. Defaults to `false`. SSHBastionAgentAuth bool `mapstructure:"ssh_bastion_agent_auth"` // The username to connect to the bastion host. SSHBastionUsername string `mapstructure:"ssh_bastion_username"` // The password to use to authenticate with the bastion host. SSHBastionPassword string `mapstructure:"ssh_bastion_password"` // If `true`, the keyboard-interactive used to authenticate with bastion host. SSHBastionInteractive bool `mapstructure:"ssh_bastion_interactive"` // Path to a PEM encoded private key file to use to authenticate with the // bastion host. The `~` can be used in path and will be expanded to the // home directory of current user. SSHBastionPrivateKeyFile string `mapstructure:"ssh_bastion_private_key_file"` // Path to user certificate used to authenticate with bastion host. // The `~` can be used in path and will be expanded to the //home directory of current user. SSHBastionCertificateFile string `mapstructure:"ssh_bastion_certificate_file"` // `scp` or `sftp` - How to transfer files, Secure copy (default) or SSH // File Transfer Protocol. SSHFileTransferMethod string `mapstructure:"ssh_file_transfer_method"` // A SOCKS proxy host to use for SSH connection SSHProxyHost string `mapstructure:"ssh_proxy_host"` // A port of the SOCKS proxy. Defaults to `1080`. SSHProxyPort int `mapstructure:"ssh_proxy_port"` // The optional username to authenticate with the proxy server. SSHProxyUsername string `mapstructure:"ssh_proxy_username"` // The optional password to use to authenticate with the proxy server. SSHProxyPassword string `mapstructure:"ssh_proxy_password"` // How often to send "keep alive" messages to the server. Set to a negative // value (`-1s`) to disable. Example value: `10s`. Defaults to `5s`. SSHKeepAliveInterval time.Duration `mapstructure:"ssh_keep_alive_interval"` // The amount of time to wait for a remote command to end. This might be // useful if, for example, packer hangs on a connection after a reboot. // Example: `5m`. Disabled by default. SSHReadWriteTimeout time.Duration `mapstructure:"ssh_read_write_timeout"` // Tunneling // SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels"` // SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels"` // SSH Internals SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true"` SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true"` } // When no ssh credentials are specified, Packer will generate a temporary SSH // keypair for the instance, you can change the algorithm type and bits // settings. type SSHTemporaryKeyPair struct { // `dsa` | `ecdsa` | `ed25519` | `rsa` ( the default ) // // Specifies the type of key to create. The possible values are 'dsa', // 'ecdsa', 'ed25519', or 'rsa'. SSHTemporaryKeyPairType string `mapstructure:"temporary_key_pair_type"` // Specifies the number of bits in the key to create. For RSA keys, the // minimum size is 1024 bits and the default is 4096 bits. Generally, 3072 // bits is considered sufficient. DSA keys must be exactly 1024 bits as // specified by FIPS 186-2. For ECDSA keys, bits determines the key length // by selecting from one of three elliptic curve sizes: 256, 384 or 521 // bits. Attempting to use bit lengths other than these three values for // ECDSA keys will fail. Ed25519 keys have a fixed length and bits will be // ignored. SSHTemporaryKeyPairBits int `mapstructure:"temporary_key_pair_bits"` } type WinRM struct { // The username to use to connect to WinRM. WinRMUser string `mapstructure:"winrm_username"` // The password to use to connect to WinRM. WinRMPassword string `mapstructure:"winrm_password"` // The address for WinRM to connect to. // // NOTE: If using an Amazon EBS builder, you can specify the interface // WinRM connects to via // [`ssh_interface`](/docs/builders/amazon-ebs#ssh_interface) WinRMHost string `mapstructure:"winrm_host"` // Setting this to `true` adds the remote // `host:port` to the `NO_PROXY` environment variable. This has the effect of // bypassing any configured proxies when connecting to the remote host. // Default to `false`. WinRMNoProxy bool `mapstructure:"winrm_no_proxy"` // The WinRM port to connect to. This defaults to `5985` for plain // unencrypted connection and `5986` for SSL when `winrm_use_ssl` is set to // true. WinRMPort int `mapstructure:"winrm_port"` // The amount of time to wait for WinRM to become available. This defaults // to `30m` since setting up a Windows machine generally takes a long time. WinRMTimeout time.Duration `mapstructure:"winrm_timeout"` // If `true`, use HTTPS for WinRM. WinRMUseSSL bool `mapstructure:"winrm_use_ssl"` // If `true`, do not check server certificate chain and host name. WinRMInsecure bool `mapstructure:"winrm_insecure"` // If `true`, NTLMv2 authentication (with session security) will be used // for WinRM, rather than default (basic authentication), removing the // requirement for basic authentication to be enabled within the target // guest. Further reading for remote connection authentication can be found // [here](https://msdn.microsoft.com/en-us/library/aa384295(v=vs.85).aspx). WinRMUseNTLM bool `mapstructure:"winrm_use_ntlm"` WinRMTransportDecorator func() winrm.Transporter } func (c *SSH) ConfigSpec() hcldec.ObjectSpec { return c.FlatMapstructure().HCL2Spec() } func (c *WinRM) ConfigSpec() hcldec.ObjectSpec { return c.FlatMapstructure().HCL2Spec() } func (c *SSH) Configure(raws ...interface{}) ([]string, error) { err := config.Decode(c, nil, raws...) return nil, err } func (c *WinRM) Configure(raws ...interface{}) ([]string, error) { err := config.Decode(c, nil, raws...) return nil, err } var ( _ packersdk.ConfigurableCommunicator = new(SSH) _ packersdk.ConfigurableCommunicator = new(WinRM) ) type SSHInterface struct { // One of `public_ip`, `private_ip`, `public_dns`, or `private_dns`. If // set, either the public IP address, private IP address, public DNS name // or private DNS name will used as the host for SSH. The default behaviour // if inside a VPC is to use the public IP address if available, otherwise // the private IP address will be used. If not in a VPC the public DNS name // will be used. Also works for WinRM. // // Where Packer is configured for an outbound proxy but WinRM traffic // should be direct, `ssh_interface` must be set to `private_dns` and // `<region>.compute.internal` included in the `NO_PROXY` environment // variable. SSHInterface string `mapstructure:"ssh_interface"` // The IP version to use for SSH connections, valid values are `4` and `6`. // Useful on dual stacked instances where the default behavior is to // connect via whichever IP address is returned first from the OpenStack // API. SSHIPVersion string `mapstructure:"ssh_ip_version"` } // ReadSSHPrivateKeyFile returns the SSH private key bytes func (c *Config) ReadSSHPrivateKeyFile() ([]byte, error) { var privateKey []byte if c.SSHPrivateKeyFile != "" { keyPath, err := pathing.ExpandUser(c.SSHPrivateKeyFile) if err != nil { return []byte{}, fmt.Errorf("Error expanding path for SSH private key: %s", err) } privateKey, err = ioutil.ReadFile(keyPath) if err != nil { return privateKey, fmt.Errorf("Error on reading SSH private key: %s", err) } } return privateKey, nil } // SSHConfigFunc returns a function that can be used for the SSH communicator // config for connecting to the instance created over SSH using the private key // or password. func (c *Config) SSHConfigFunc() func(multistep.StateBag) (*ssh.ClientConfig, error) { return func(state multistep.StateBag) (*ssh.ClientConfig, error) { sshConfig := &ssh.ClientConfig{ User: c.SSHUsername, HostKeyCallback: ssh.InsecureIgnoreHostKey(), } if len(c.SSHCiphers) != 0 { sshConfig.Config.Ciphers = c.SSHCiphers } if len(c.SSHKEXAlgos) != 0 { sshConfig.Config.KeyExchanges = c.SSHKEXAlgos } if c.SSHAgentAuth { authSock := os.Getenv("SSH_AUTH_SOCK") if authSock == "" { return nil, fmt.Errorf("SSH_AUTH_SOCK is not set") } sshAgent, err := net.Dial("unix", authSock) if err != nil { return nil, fmt.Errorf("Cannot connect to SSH Agent socket %q: %s", authSock, err) } sshConfig.Auth = append(sshConfig.Auth, ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers)) } var privateKeys [][]byte if c.SSHPrivateKeyFile != "" { privateKey, err := c.ReadSSHPrivateKeyFile() if err != nil { return nil, err } privateKeys = append(privateKeys, privateKey) } // aws,alicloud,cloudstack,digitalOcean,oneAndOne,openstack,oracle & profitbricks key if iKey, hasKey := state.GetOk("privateKey"); hasKey { privateKeys = append(privateKeys, []byte(iKey.(string))) } if len(c.SSHPrivateKey) != 0 { privateKeys = append(privateKeys, c.SSHPrivateKey) } certPath := "" if c.SSHCertificateFile != "" { var err error certPath, err = pathing.ExpandUser(c.SSHCertificateFile) if err != nil { return nil, err } } for _, key := range privateKeys { signer, err := ssh.ParsePrivateKey(key) if err != nil { return nil, fmt.Errorf("Error on parsing SSH private key: %s", err) } if certPath != "" { signer, err = helperssh.ReadCertificate(certPath, signer) if err != nil { return nil, err } } sshConfig.Auth = append(sshConfig.Auth, ssh.PublicKeys(signer)) } if c.SSHPassword != "" { sshConfig.Auth = append(sshConfig.Auth, ssh.Password(c.SSHPassword), ssh.KeyboardInteractive(packerssh.PasswordKeyboardInteractive(c.SSHPassword)), ) } return sshConfig, nil } } // Port returns the port that will be used for access based on config. func (c *Config) Port() int { switch c.Type { case "ssh": return c.SSHPort case "winrm": return c.WinRMPort default: return 0 } } // Host returns the host that will be used for access based on config. func (c *Config) Host() string { switch c.Type { case "ssh": return c.SSHHost case "winrm": return c.WinRMHost default: return "" } } // User returns the user that will be used for access based on config. func (c *Config) User() string { switch c.Type { case "ssh": return c.SSHUsername case "winrm": return c.WinRMUser default: return "" } } // Password returns the password that will be used for access based on config. func (c *Config) Password() string { switch c.Type { case "ssh": return c.SSHPassword case "winrm": return c.WinRMPassword default: return "" } } func (c *Config) Prepare(ctx *interpolate.Context) []error { if c.Type == "" { c.Type = "ssh" } var errs []error switch c.Type { case "ssh": if es := c.prepareSSH(ctx); len(es) > 0 { errs = append(errs, es...) } case "winrm": if es := c.prepareWinRM(ctx); len(es) > 0 { errs = append(errs, es...) } case "docker", "dockerWindowsContainer", "none": break default: return []error{fmt.Errorf("Communicator type %s is invalid", c.Type)} } return errs } func (c *Config) prepareSSH(ctx *interpolate.Context) []error { if c.SSHPort == 0 { c.SSHPort = 22 } if c.SSHTimeout == 0 { c.SSHTimeout = 5 * time.Minute } if c.SSHKeepAliveInterval == 0 { c.SSHKeepAliveInterval = 5 * time.Second } if c.SSHHandshakeAttempts == 0 { c.SSHHandshakeAttempts = 10 } if c.SSHBastionHost != "" { if c.SSHBastionPort == 0 { c.SSHBastionPort = 22 } if c.SSHBastionPrivateKeyFile == "" && c.SSHPrivateKeyFile != "" { c.SSHBastionPrivateKeyFile = c.SSHPrivateKeyFile } if c.SSHBastionCertificateFile == "" && c.SSHCertificateFile != "" { c.SSHBastionCertificateFile = c.SSHCertificateFile } } if c.SSHProxyHost != "" { if c.SSHProxyPort == 0 { c.SSHProxyPort = 1080 } } if c.SSHFileTransferMethod == "" { c.SSHFileTransferMethod = "scp" } // Backwards compatibility if c.SSHWaitTimeout != 0 { c.SSHTimeout = c.SSHWaitTimeout } // Validation var errs []error if c.SSHUsername == "" { errs = append(errs, errors.New("An ssh_username must be specified\n Note: some builders used to default ssh_username to \"root\".")) } if c.SSHPrivateKeyFile != "" { path, err := pathing.ExpandUser(c.SSHPrivateKeyFile) if err != nil { errs = append(errs, fmt.Errorf( "ssh_private_key_file is invalid: %s", err)) } else if _, err := os.Stat(path); err != nil { errs = append(errs, fmt.Errorf( "ssh_private_key_file is invalid: %s", err)) } else { if c.SSHCertificateFile != "" { certPath, err := pathing.ExpandUser(c.SSHCertificateFile) if err != nil { errs = append(errs, fmt.Errorf("invalid identity certificate: #{err}")) } if _, err := helperssh.FileSignerWithCert(path, certPath); err != nil { errs = append(errs, fmt.Errorf( "ssh_private_key_file is invalid: %s", err)) } } else { if _, err := helperssh.FileSigner(path); err != nil { errs = append(errs, fmt.Errorf( "ssh_private_key_file is invalid: %s", err)) } } } } if c.SSHBastionHost != "" && !c.SSHBastionAgentAuth { if c.SSHBastionPassword == "" && c.SSHBastionPrivateKeyFile == "" { errs = append(errs, errors.New( "ssh_bastion_password or ssh_bastion_private_key_file must be specified")) } else if c.SSHBastionPrivateKeyFile != "" { path, err := pathing.ExpandUser(c.SSHBastionPrivateKeyFile) if err != nil { errs = append(errs, fmt.Errorf( "ssh_bastion_private_key_file is invalid: %s", err)) } else if _, err := os.Stat(path); err != nil { errs = append(errs, fmt.Errorf( "ssh_bastion_private_key_file is invalid: %s", err)) } else { if c.SSHBastionCertificateFile != "" { certPath, err := pathing.ExpandUser(c.SSHBastionCertificateFile) if err != nil { errs = append(errs, fmt.Errorf("invalid identity certificate: #{err}")) } if _, err := helperssh.FileSignerWithCert(path, certPath); err != nil { errs = append(errs, fmt.Errorf( "ssh_bastion_private_key_file is invalid: %s", err)) } } else { if _, err := helperssh.FileSigner(path); err != nil { errs = append(errs, fmt.Errorf( "ssh_bastion_private_key_file is invalid: %s", err)) } } } } } if c.SSHFileTransferMethod != "scp" && c.SSHFileTransferMethod != "sftp" { errs = append(errs, fmt.Errorf( "ssh_file_transfer_method ('%s') is invalid, valid methods: sftp, scp", c.SSHFileTransferMethod)) } if c.SSHBastionHost != "" && c.SSHProxyHost != "" { errs = append(errs, errors.New("please specify either ssh_bastion_host or ssh_proxy_host, not both")) } for _, v := range c.SSHLocalTunnels { _, err := helperssh.ParseTunnelArgument(v, packerssh.UnsetTunnel) if err != nil { errs = append(errs, fmt.Errorf( "ssh_local_tunnels ('%s') is invalid: %s", v, err)) } } for _, v := range c.SSHRemoteTunnels { _, err := helperssh.ParseTunnelArgument(v, packerssh.UnsetTunnel) if err != nil { errs = append(errs, fmt.Errorf( "ssh_remote_tunnels ('%s') is invalid: %s", v, err)) } } return errs } func (c *Config) prepareWinRM(ctx *interpolate.Context) (errs []error) { if c.WinRMPort == 0 && c.WinRMUseSSL { c.WinRMPort = 5986 } else if c.WinRMPort == 0 { c.WinRMPort = 5985 } if c.WinRMTimeout == 0 { c.WinRMTimeout = 30 * time.Minute } if c.WinRMUseNTLM == true { c.WinRMTransportDecorator = func() winrm.Transporter { return &winrm.ClientNTLM{} } } if c.WinRMUser == "" { errs = append(errs, errors.New("winrm_username must be specified.")) } return errs } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/config.hcl2spec.go����������������������������������0000664�0000000�0000000�00000063424�13771713062�0025012�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config,SSH,WinRM,SSHTemporaryKeyPair"; DO NOT EDIT. package communicator import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, } return s } // FlatSSH is an auto-generated flat version of SSH. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatSSH struct { SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` } // FlatMapstructure returns a new FlatSSH. // FlatSSH is an auto-generated flat version of SSH. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*SSH) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatSSH) } // HCL2Spec returns the hcl spec of a SSH. // This spec is used by HCL to read the fields of SSH. // The decoded values from this spec will then be applied to a FlatSSH. func (*FlatSSH) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, } return s } // FlatSSHTemporaryKeyPair is an auto-generated flat version of SSHTemporaryKeyPair. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatSSHTemporaryKeyPair struct { SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` } // FlatMapstructure returns a new FlatSSHTemporaryKeyPair. // FlatSSHTemporaryKeyPair is an auto-generated flat version of SSHTemporaryKeyPair. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*SSHTemporaryKeyPair) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatSSHTemporaryKeyPair) } // HCL2Spec returns the hcl spec of a SSHTemporaryKeyPair. // This spec is used by HCL to read the fields of SSHTemporaryKeyPair. // The decoded values from this spec will then be applied to a FlatSSHTemporaryKeyPair. func (*FlatSSHTemporaryKeyPair) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, } return s } // FlatWinRM is an auto-generated flat version of WinRM. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatWinRM struct { WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` } // FlatMapstructure returns a new FlatWinRM. // FlatWinRM is an auto-generated flat version of WinRM. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*WinRM) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatWinRM) } // HCL2Spec returns the hcl spec of a WinRM. // This spec is used by HCL to read the fields of WinRM. // The decoded values from this spec will then be applied to a FlatWinRM. func (*FlatWinRM) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/config_test.go��������������������������������������0000664�0000000�0000000�00000012077�13771713062�0024345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "reflect" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/masterzen/winrm" ) func testConfig() *Config { return &Config{ SSH: SSH{ SSHUsername: "root", }, } } func TestConfigType(t *testing.T) { c := testConfig() if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } if c.Type != "ssh" { t.Fatalf("bad: %#v", c) } } func TestConfig_none(t *testing.T) { c := &Config{Type: "none"} if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } } func TestConfig_badtype(t *testing.T) { c := &Config{Type: "foo"} if err := c.Prepare(testContext(t)); len(err) != 1 { t.Fatalf("bad: %#v", err) } } func TestConfig_winrm_noport(t *testing.T) { c := &Config{ Type: "winrm", WinRM: WinRM{ WinRMUser: "admin", }, } if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } if c.WinRMPort != 5985 { t.Fatalf("WinRMPort doesn't match default port 5985 when SSL is not enabled and no port is specified.") } } func TestConfig_winrm_noport_ssl(t *testing.T) { c := &Config{ Type: "winrm", WinRM: WinRM{ WinRMUser: "admin", WinRMUseSSL: true, }, } if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } if c.WinRMPort != 5986 { t.Fatalf("WinRMPort doesn't match default port 5986 when SSL is enabled and no port is specified.") } } func TestConfig_winrm_port(t *testing.T) { c := &Config{ Type: "winrm", WinRM: WinRM{ WinRMUser: "admin", WinRMPort: 5509, }, } if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } if c.WinRMPort != 5509 { t.Fatalf("WinRMPort doesn't match custom port 5509 when SSL is not enabled.") } } func TestConfig_winrm_port_ssl(t *testing.T) { c := &Config{ Type: "winrm", WinRM: WinRM{ WinRMUser: "admin", WinRMPort: 5510, WinRMUseSSL: true, }, } if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } if c.WinRMPort != 5510 { t.Fatalf("WinRMPort doesn't match custom port 5510 when SSL is enabled.") } } func TestConfig_winrm_use_ntlm(t *testing.T) { c := &Config{ Type: "winrm", WinRM: WinRM{ WinRMUser: "admin", WinRMUseNTLM: true, }, } if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } if c.WinRMTransportDecorator == nil { t.Fatalf("WinRMTransportDecorator not set.") } expected := &winrm.ClientNTLM{} actual := c.WinRMTransportDecorator() if !reflect.DeepEqual(expected, actual) { t.Fatalf("WinRMTransportDecorator isn't ClientNTLM.") } } func TestSSHBastion(t *testing.T) { c := &Config{ Type: "ssh", SSH: SSH{ SSHUsername: "root", SSHBastionHost: "mybastionhost.company.com", SSHBastionPassword: "test", }, } if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } if c.SSHBastionCertificateFile != "" { t.Fatalf("Identity certificate somehow set") } if c.SSHPrivateKeyFile != "" { t.Fatalf("Private key file somehow set") } } func TestSSHConfigFunc_ciphers(t *testing.T) { state := new(multistep.BasicStateBag) // No ciphers set c := &Config{ Type: "ssh", } f := c.SSHConfigFunc() sshConfig, _ := f(state) if sshConfig.Config.Ciphers != nil { t.Fatalf("Shouldn't set SSHCiphers if communicator config option " + "ssh_ciphers is unset.") } // Ciphers are set c = &Config{ Type: "ssh", SSH: SSH{ SSHCiphers: []string{"partycipher"}, }, } f = c.SSHConfigFunc() sshConfig, _ = f(state) if sshConfig.Config.Ciphers == nil { t.Fatalf("Shouldn't set SSHCiphers if communicator config option " + "ssh_ciphers is unset.") } if sshConfig.Config.Ciphers[0] != "partycipher" { t.Fatalf("ssh_ciphers should be a direct passthrough.") } if c.SSHCertificateFile != "" { t.Fatalf("Identity certificate somehow set") } } func TestSSHConfigFunc_kexAlgos(t *testing.T) { state := new(multistep.BasicStateBag) // No ciphers set c := &Config{ Type: "ssh", } f := c.SSHConfigFunc() sshConfig, _ := f(state) if sshConfig.Config.KeyExchanges != nil { t.Fatalf("Shouldn't set KeyExchanges if communicator config option " + "ssh_key_exchange_algorithms is unset.") } // Ciphers are set c = &Config{ Type: "ssh", SSH: SSH{ SSHKEXAlgos: []string{"partyalgo"}, }, } f = c.SSHConfigFunc() sshConfig, _ = f(state) if sshConfig.Config.KeyExchanges == nil { t.Fatalf("Should set SSHKEXAlgos if communicator config option " + "ssh_key_exchange_algorithms is set.") } if sshConfig.Config.KeyExchanges[0] != "partyalgo" { t.Fatalf("ssh_key_exchange_algorithms should be a direct passthrough.") } if c.SSHCertificateFile != "" { t.Fatalf("Identity certificate somehow set") } } func TestConfig_winrm(t *testing.T) { c := &Config{ Type: "winrm", WinRM: WinRM{ WinRMUser: "admin", }, } if err := c.Prepare(testContext(t)); len(err) > 0 { t.Fatalf("bad: %#v", err) } } func testContext(t *testing.T) *interpolate.Context { return nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/ssh/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022300�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/ssh/key_pair.go�������������������������������������0000664�0000000�0000000�00000015556�13771713062�0024446�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "bytes" "crypto" "crypto/dsa" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "strings" gossh "golang.org/x/crypto/ssh" ) const ( // defaultRsaBits is the default bits of entropy for a new RSA // key pair. That's a lot of bits. defaultRsaBits = 4096 // Markers for various SSH key pair types. Default KeyPairType = "" Rsa KeyPairType = "RSA" Ecdsa KeyPairType = "ECDSA" Dsa KeyPairType = "DSA" Ed25519 KeyPairType = "ED25519" ) // KeyPairType represents different types of SSH key pairs. // See the 'const' block for details. type KeyPairType string func (o KeyPairType) String() string { return string(o) } // KeyPair represents an SSH key pair. type KeyPair struct { // PrivateKeyPemBlock represents the key pair's private key in // ASN.1 Distinguished Encoding Rules (DER) format in a // Privacy-Enhanced Mail (PEM) block. PrivateKeyPemBlock []byte // PublicKeyAuthorizedKeysLine represents the key pair's public key // as a line in OpenSSH authorized_keys. PublicKeyAuthorizedKeysLine []byte // Comment is the key pair's comment. This is typically used // to identify the key pair's owner in the SSH user's // 'authorized_keys' file. Comment string } // KeyPairFromPrivateKey returns a KeyPair loaded from an existing private key. // // Supported key pair types include: // - DSA // - ECDSA // - ED25519 // - RSA func KeyPairFromPrivateKey(config FromPrivateKeyConfig) (KeyPair, error) { privateKey, err := gossh.ParseRawPrivateKey(config.RawPrivateKeyPemBlock) if err != nil { return KeyPair{}, err } switch pk := privateKey.(type) { case crypto.Signer: // crypto.Signer is implemented by ecdsa.PrivateKey, // ed25519.PrivateKey, and rsa.PrivateKey - separate cases // for each PrivateKey type would be redundant. publicKey, err := gossh.NewPublicKey(pk.Public()) if err != nil { return KeyPair{}, err } return KeyPair{ Comment: config.Comment, PrivateKeyPemBlock: config.RawPrivateKeyPemBlock, PublicKeyAuthorizedKeysLine: authorizedKeysLine(publicKey, config.Comment), }, nil case *dsa.PrivateKey: publicKey, err := gossh.NewPublicKey(&pk.PublicKey) if err != nil { return KeyPair{}, err } return KeyPair{ Comment: config.Comment, PrivateKeyPemBlock: config.RawPrivateKeyPemBlock, PublicKeyAuthorizedKeysLine: authorizedKeysLine(publicKey, config.Comment), }, nil } return KeyPair{}, fmt.Errorf("Cannot parse existing SSH key pair - unknown key pair type") } // FromPrivateKeyConfig describes how an SSH key pair should be loaded from an // existing private key. type FromPrivateKeyConfig struct { // RawPrivateKeyPemBlock is the raw private key that the key pair // should be loaded from. RawPrivateKeyPemBlock []byte // Comment is the key pair's comment. This is typically used // to identify the key pair's owner in the SSH user's // 'authorized_keys' file. Comment string } // NewKeyPair generates a new SSH key pair using the specified // CreateKeyPairConfig. func NewKeyPair(config CreateKeyPairConfig) (KeyPair, error) { if config.Type == Default { config.Type = Ecdsa } switch config.Type { case Ecdsa: return newEcdsaKeyPair(config) case Rsa: return newRsaKeyPair(config) } return KeyPair{}, fmt.Errorf("Unable to generate new key pair, type %s is not supported", config.Type.String()) } // newEcdsaKeyPair returns a new ECDSA SSH key pair. func newEcdsaKeyPair(config CreateKeyPairConfig) (KeyPair, error) { var curve elliptic.Curve switch config.Bits { case 0: config.Bits = 521 fallthrough case 521: curve = elliptic.P521() case 384: curve = elliptic.P384() case 256: curve = elliptic.P256() case 224: // Not supported by "golang.org/x/crypto/ssh". return KeyPair{}, fmt.Errorf("golang.org/x/crypto/ssh does not support %d bits", config.Bits) default: return KeyPair{}, fmt.Errorf("crypto/elliptic does not support %d bits", config.Bits) } privateKey, err := ecdsa.GenerateKey(curve, rand.Reader) if err != nil { return KeyPair{}, err } sshPublicKey, err := gossh.NewPublicKey(&privateKey.PublicKey) if err != nil { return KeyPair{}, err } privateRaw, err := x509.MarshalECPrivateKey(privateKey) if err != nil { return KeyPair{}, err } privatePem, err := rawPemBlock(&pem.Block{ Type: "EC PRIVATE KEY", Headers: nil, Bytes: privateRaw, }) if err != nil { return KeyPair{}, err } return KeyPair{ PrivateKeyPemBlock: privatePem, PublicKeyAuthorizedKeysLine: authorizedKeysLine(sshPublicKey, config.Comment), Comment: config.Comment, }, nil } // newRsaKeyPair returns a new RSA SSH key pair. func newRsaKeyPair(config CreateKeyPairConfig) (KeyPair, error) { if config.Bits == 0 { config.Bits = defaultRsaBits } privateKey, err := rsa.GenerateKey(rand.Reader, config.Bits) if err != nil { return KeyPair{}, err } sshPublicKey, err := gossh.NewPublicKey(&privateKey.PublicKey) if err != nil { return KeyPair{}, err } privatePemBlock, err := rawPemBlock(&pem.Block{ Type: "RSA PRIVATE KEY", Headers: nil, Bytes: x509.MarshalPKCS1PrivateKey(privateKey), }) if err != nil { return KeyPair{}, err } return KeyPair{ PrivateKeyPemBlock: privatePemBlock, PublicKeyAuthorizedKeysLine: authorizedKeysLine(sshPublicKey, config.Comment), Comment: config.Comment, }, nil } // CreateKeyPairConfig describes how an SSH key pair should be created. type CreateKeyPairConfig struct { // Type describes the key pair's type. Type KeyPairType // Bits represents the key pair's bits of entropy. E.g., 4096 for // a 4096 bit RSA key pair, or 521 for a ECDSA key pair with a // 521-bit curve. Bits int // Comment is the resulting key pair's comment. This is typically // used to identify the key pair's owner in the SSH user's // 'authorized_keys' file. Comment string } // rawPemBlock encodes a pem.Block to a slice of bytes. func rawPemBlock(block *pem.Block) ([]byte, error) { buffer := bytes.NewBuffer(nil) err := pem.Encode(buffer, block) if err != nil { return []byte{}, err } return buffer.Bytes(), nil } // authorizedKeysLine serializes key for inclusion in an OpenSSH // authorized_keys file. The return value ends without newline so // a comment can be appended to the end. func authorizedKeysLine(key gossh.PublicKey, comment string) []byte { marshaledPublicKey := gossh.MarshalAuthorizedKey(key) // Remove the mandatory unix new line. Awful, but the go // ssh library automatically appends a unix new line. // We remove it so a key comment can be safely appended to the // end of the string. marshaledPublicKey = bytes.TrimSpace(marshaledPublicKey) if len(strings.TrimSpace(comment)) > 0 { marshaledPublicKey = append(marshaledPublicKey, ' ') marshaledPublicKey = append(marshaledPublicKey, comment...) } return marshaledPublicKey } ��������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/ssh/key_pair_test.go��������������������������������0000664�0000000�0000000�00000035342�13771713062�0025500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "bytes" "crypto/dsa" "crypto/ecdsa" "crypto/rsa" "fmt" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" "golang.org/x/crypto/ed25519" gossh "golang.org/x/crypto/ssh" ) const ( pemRsa1024 = `-----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDJEMFPpTBiWNDb3qEIPTSeEnIP8FZdBpG8njOrclcMoQQNhzZ+ 4uz37tqtHMp36Z7LB4/+85NN6epNXO+ekyZIHswiyBcJC2sT3KuH7nG1BESOooPY DfeCSM+CJT9GDIhy9nUXSsJjrceEyh/B5DjEtIbS0XfcRelrNTJodCmPJwIDAQAB AoGAK66GMOV0c4lUJtBhL8cMTWM4gJn4SVGKC+5az16R5t58YOwFPN/UF7E+tOlS W2bX5sgH0p3cXMr66j/Mlyjk4deLg7trDavulIP93MyVO2SUJ0cstQ0ZmRz2oGwx Gow+hD75Cet7uvepdmG4DKHJe8D/I72rtP1WKuZyd0vP6WECQQDua6wWlyEdIimx XoGWUvmywACWPnQmBnyHG7x5hxMjijQoQZu60zRxSU9I5q08BerTsvbTc+xLnDVv mFzlcjT/AkEA1+P7lcvViZeNKoDB1Qt+VV+pkcqL5aoRwdnLA51SyFJ9tXkxeZwA LOof3xtoRGhCld7ixi3kF5aZsafAJOZd2QJAH8rFyMFgTgU3MAqdFxF7cGV/7ojn bgahZlbBfCcR20Rbjh6piHEPZifTZbI02XMkjBQqK6oikTaEPZxAjuv6uwJANczu yWm+kUdfOpRTuY/fr87jJx3etyEmw7ROz1vJYXqNMUg+eBvUP10pDCR8W2/QCCE/ Sjvtd6NkMc2oKInwIQJAFZ1xJte0EaQsXaCIoZwHrQJbK1dd5l1xTAzz51voAcKH 2K23xgx4I+/eam2enjFa7wXLZFoW0xg/51xsaIjnrA== -----END RSA PRIVATE KEY----- ` pemRsa2048 = `-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEA/ZPazeRmBapF01gzHXtJGpu0S936xHY+pOrIyIk6lEE06paf q5gh6BCuiN/60Keed5Nz+Es4dPGc73mql9pd7N0HOoEc1IQjZzJVqWOy3E55oWbz rXr1qbmMjw8bGHalZsVBov1UhyB6f2bKi88fGkThJi9HZ+Dc3Jr87eW+whS4D0bI JJe5dkY0VhDqB0YVEk299TxlAiDkeXD1EcMZrD/yHsusapwlXL2WHWmCgbPpbeYW YJhD1bScChYmf41iiInBwFymG7kz4bPsup7wCBXpcLJplY1iuXdtVVujNLDbJwlb Xi2oBm3WizPjYcUthvMlqOieuy6Z4KzyJd7EnQIDAQABAoIBAByZ8LQIbvl0myub ZyiMH1LA/TURdJd0PtybHsp/r/vI3w8WrivMnQZv2z/VA5VFUrpqB0qaMWP/XJQm RPebybxNseMHbRkLTnL1WnQgqqvurglmc1W96LecFh6MtaGswDs3RI/9wur63tY/ 4dijI/7yhfKoooU097RqRt0ObNW3BxGwNKUraMLKEZjtohv1cZBeRqzGZuui351E YsG1jt23/3OP3Acfd1xpzoi+daadxl9JTr02kE7lMjfq32quhTdzuNZP84sQsaV+ RXLNEoiSufjzy3nHTEpG6QaEWQc4gszCIBVRabxr7LtIOqJn2KmXxtOyFE52AJJj ls3ifAECgYEA/9K+5oHdZBizWWUvNzQWXrdHUtVavCwjj+0v+yRFZSoAhKtVmLYl 8R4NeG6NCIOoJsqmGVpgtCyPndR4PQ6yr4Jt1FJorjsNw21eYrjOVG+y9Z0DkCwJ uCRVUeqB42jLu7v9r1V3OBQdKLN6VxO4np05KEZyv1LOGGt0XC8NCykCgYEA/cC2 NR7Y4Z5OjCc2GHMQNrVZ2HTDDir71RjcIIEmsIQ5/AMAELFLCSqzD73tJ87T5jPi aWeOpIcnK78jMvIIsbV0BXaDsjtlvCdQui2AoX63FuK4q4E+vwe5Q/TqY2nDh2io mGHfeXECyUx4gxIede2XEO9zYQ0lP8gxnjmLkFUCgYBO8LolqQcm/xRAzp9eOn14 prekkN+Z10j1/avjpFKhn+9fAPu9zt8wYySm9/4fFXlK1xegFSpoDqQWgNzFgoaS 7/1yGifhM6nQlywb7IkGtx0S+2uBDoXFQ7jsOR/xi4HqoVzrwMS0EkjZKWDkA9rh XwSnL+3yqduc33OdiotM2QKBgCgNCrVHsSOrQOqOJdOmFaEM7qljhIXv8t+nlNbs i5bAyAYm0xPPZ/CCdNC/QXdPBdMHzWylk7YUPvKAsKWR3h1ubmmOUysGhQA1lGBO XkcfIPbTwiIPvD+akHtRZM1cHCh7NGEY0ZTxaWcsUrkdWwFyBq39nVBsKrzudCZt HsIhAoGBAMv3erZQawzIgX9nOUHB2UJl8pS+LZSNMlYvFoMHKI2hLq0g/VxUlnsh Jzw9+fTLMVFdY+F3ydO6qQFd8wlfov7deyscdoSj8R5gjGKJsarBs+YVdFde2oLG gkFsXmbmc2boyqGg51CbAX34VJOhGQKhWgKCWqDGmoYXafmyiZc+ -----END RSA PRIVATE KEY----- ` pemOpenSshRsa1024 = `-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAlwAAAAdzc2gtcn NhAAAAAwEAAQAAAIEAzzknaHV741775aJOPacDpd2SiDpIDYmm7/w2sgY8lrinSakfLIVk 1qn0IBRLNOzMxoF/pvIgGQXS51xvE1vB3QK8L+8vJwH06DuOXPP1WgVoDTU03gGvBJ7MNF 5HcQYvBiIaU5XxG8l0OZO88B9RFhPP9r0XrYxAlSjuk9KKlEcAAAIYLQ46zy0OOs8AAAAH c3NoLXJzYQAAAIEAzzknaHV741775aJOPacDpd2SiDpIDYmm7/w2sgY8lrinSakfLIVk1q n0IBRLNOzMxoF/pvIgGQXS51xvE1vB3QK8L+8vJwH06DuOXPP1WgVoDTU03gGvBJ7MNF5H cQYvBiIaU5XxG8l0OZO88B9RFhPP9r0XrYxAlSjuk9KKlEcAAAADAQABAAAAgQDJ9Jq6jF 08P/LhXug/38iHW0UW7S4Ru4jttHGd2MQt5DJtcJzIKA0ZxLL+nKibIPmFsOm2y5yKpolg IE7EoBVzTeg0LedbRayc0Kc5tY7PEz0Shi9ABIMYbNo2L2pNmsq9ns0xA8ur3OugfKHsH8 XjJ1rdHsyLjoMx2ADfLY0xkQAAAEAvyrgW4jswENdErbF0rOdP+Y73B/8rxBaY/QBE2qtG oUp7bpOtUAH2Ip7RjXOX4xTAt4n2QeHBSfX7gfXRjmY6AAAAQQDmYlgSWtTYLV9VZSScLU OG+GkhQxYqkKN/N9LSpTP4Pwh81KpMp40yvIlufmKLgGihWVxUDzRap3aoR7PqIvHPAAAA QQDmQ47VwclxiVn5tVAht/Lk2ZVa7rSjeFlXAkAWZkUAiHboaH8IfW9W4gYV7o2BqJO11L 0vi+vCq+le45F416wJAAAAImNocmlzQHBvZXRhc3Rlci5jb3JwLm11dHVhbGluay5uZXQ= -----END OPENSSH PRIVATE KEY----- ` pemOpenSshRsa2048 = `-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn NhAAAAAwEAAQAAAQEAxWfWNu0i8sbmwPqTUfKSeXOSt/fLMuqucn9KYU7rJ+83trznRhAn AHQzKgcSU8PBgkax+PDEUexYUB9gZApNI6K/2twVDYh3Hgwx7EjXf05rji7bQk6TFyKEp4 n348CWAdK8iFmNUutSpJLy7GciyMPLu3BK+EsXpsnuPpIm184hEFOiADZyHTGeUgvsKOAc G7u5hBS3kty8LRZmL+pihbktFwGC4D5bapCcTaF2++zkUy4JKcVE5/2JfK1Ya6D0ATczjz 1b6+r7j2RUg1mXfK6AwMHEcamzhgeuM9RdrPtMdhZI09LCJzjmXc9pzlGu1HCZzh3rJ3hd 8PVmlAd3VQAAA+A9hesQPYXrEAAAAAdzc2gtcnNhAAABAQDFZ9Y27SLyxubA+pNR8pJ5c5 K398sy6q5yf0phTusn7ze2vOdGECcAdDMqBxJTw8GCRrH48MRR7FhQH2BkCk0jor/a3BUN iHceDDHsSNd/TmuOLttCTpMXIoSniffjwJYB0ryIWY1S61KkkvLsZyLIw8u7cEr4Sxemye 4+kibXziEQU6IANnIdMZ5SC+wo4Bwbu7mEFLeS3LwtFmYv6mKFuS0XAYLgPltqkJxNoXb7 7ORTLgkpxUTn/Yl8rVhroPQBNzOPPVvr6vuPZFSDWZd8roDAwcRxqbOGB64z1F2s+0x2Fk jT0sInOOZdz2nOUa7UcJnOHesneF3w9WaUB3dVAAAAAwEAAQAAAQEAvA8Z8iWjX6nA9yM/ 6ZevluhVY9E60XzlR8qgL2ehet/YMcxwfzywCyyn+WfXO9mHpfZ3YfLs9Ca2U04w4900c7 h+EaAMpmHVKNjxTmpucadhq4hT9S0pz6ZgvcMgVuaHgaEjXroBencYuhQMPM5cQurUUfK+ WSAgnhJNV2qgeoEGgfDZoL1HkItckEZwIzmx4lfMVAuaeqVq5tJNcdv5ukNHpnIYl6fgDp WGUn/9F8sSHO7P7kGl67IZIsAz+1wW+6pFaVgxbZJ3baPiURtRp+nRSaKLYZSMph6MAiTu YC8EEVqi3X4m/ZHy+BkphfzR24ouwpt1Vv9QOAPzXXsPwQAAAIEAvmA+yiBdzsJplCifTA KljE+KpSuvLPRPTb7MGsBO0LIvxrkXOMCXZF4I2VP1zSUH+SDPPc6JeR1Q8liMqPC3Md6c CIkHfVFBAZL709d0ZtTiir1BipG/l5vIpBnepNX/bWIszIOMzPF2at0WF1lFe6THWujuE8 Xjp2AJSFZlUjAAAACBAOMxr6FN38VwRC1nrDcZyo4TjWVhAdk4p3AkdNJhFSiKS/x5/yo2 K1majzcKbrR8+fEPTVWGszAg+AXQdsOq17q+DMenfrBckQ9ZHr3upSZAaGN+keNwge/Kaj yOvYiKdYFXmAulQZCPQsDNp7e7Z1dTqxi5IlhUgDPzzO0vRGjNAAAAgQDeb0Ulv7fkYAav tZ+D0LohGjlGFwTeLdwErcVnq9wGyupdeNhlTXZXxRvF+yEt4FCV9UEUnRX75CAnpk2hT2 D5uYMyixAEfSeIo59Ln27MmAy0alR3UnT7JnLEZRh4dnvFbSSMJ1rHxf8Eg6YFJmpH65fX exrJE+p69wgRVndoqQAAACJjaHJpc0Bwb2V0YXN0ZXIuY29ycC5tdXR1YWxpbmsubmV0AQ IDBAUGBw== -----END OPENSSH PRIVATE KEY----- ` pemDsa = `-----BEGIN DSA PRIVATE KEY----- MIIBuwIBAAKBgQDH/T+IkpbdA9nUM7O4MMRoeS0bn7iXWs63Amo2fsIyJPxDvjjF 5HZBH5Rq045TFCCWHjymwiYof+wvwUMZIUH++ABTrKzes/r5qG5jXp42pFWf6nTI zHwttdjvNiXr+AgreXOrJKhjv6Ga3hq8MNcXMa9xFsIB83EZNMBPxbj0nwIVAJQW 1eR4Uf8/8haQb4HkTsoH+R5/AoGBAK9FV5LIZxY1TeNsD5eXoqpTqCy1WROMggSG VZ4yN0rrKCtLd8am61m/L8VCMUWiO3IJQdq3yWBTEBbsShL/toau9beUdTl6rdB8 wcEcNgtZnhypQR58HlmgUFWC45rW37hW4AUJuMDgLxgqSVuoF1pDcHrHSi/fZwgp 7t0MKH2SAoGAJfUcLrXg5ZR8jbpZs4L/ubibUn+y35y+33aos07auMW1MesuNTcZ Ch42nbH2wKnbjk8eDxHdHLHzzOLGgYVMpUuBeuc7G5Q94rM/Z0I8HGQ6mvIkuFyp 58Unu5yu33GsNUgGEHmriiMGezXNXGNH/72PmTXuyxEMSrad23c6NZoCFAtIqbal 4tGCfnnmWU514A7ZzEKj -----END DSA PRIVATE KEY----- ` pemEcdsa384 = `-----BEGIN EC PRIVATE KEY----- MIGkAgEBBDAjuEIlmFyhGjFtJoAwD420FuPAjIknN3YwDZL4cfMFpB4YAK+7QVLs coAJ/ADuT7OgBwYFK4EEACKhZANiAASeXKyBr2prr4f4aOsM4dtVikYOUIL3yYnb GFOy7yHmauCnkIB48paXpvRE5m53Q8zgu7vkz/z9tcMBcC0GzpY3Sef37fmgTUuZ AJuJp36DMBdQel+j51TcQ79sizxCayg= -----END EC PRIVATE KEY----- ` pemEcdsa521 = `-----BEGIN EC PRIVATE KEY----- MIHcAgEBBEIBVCiwcf/did2vCIu3aMe7OeTD35PULm0hqmfkAK9OKIosi/DjOFfA 8h99rVNPaf+Cx/JNmEzR4bZNnYDyilSRCr+gBwYFK4EEACOhgYkDgYYABABHBMLP XbQoRF31ZGIeUj9jt9GqKES1dLBtGDEQSiiZFouL4tEIW7NfIZDpOIkA0khNcO8N xH6eylg0XOgcr01GRwCjY5VOapOahtn63SpajPGeKk+46F2dULIwrov9tWQuYNa3 P50N8j3rx6fAdgyDENOcCJlfNdNcySvkH4bgL1xcsw== -----END EC PRIVATE KEY----- ` pemOpenSshEd25519 = `-----BEGIN OPENSSH PRIVATE KEY----- b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW QyNTUxOQAAACAUftPhZQN17kAlThiiWJEgJvddm/pUhHvgrHUtpuYFOQAAAKjN+UhDzflI QwAAAAtzc2gtZWQyNTUxOQAAACAUftPhZQN17kAlThiiWJEgJvddm/pUhHvgrHUtpuYFOQ AAAEANXlEZdNU03RMmj77O2ojWh06Hbj8/qQ++H5wkt688NBR+0+FlA3XuQCVOGKJYkSAm 912b+lSEe+CsdS2m5gU5AAAAImNocmlzQHBvZXRhc3Rlci5jb3JwLm11dHVhbGluay5uZX QBAgM= -----END OPENSSH PRIVATE KEY----- ` ) func TestNewKeyPair_Default(t *testing.T) { kp, err := NewKeyPair(CreateKeyPairConfig{}) if err != nil { t.Fatal(err.Error()) } err = verifyEcdsaKeyPair(kp, expectedData{ bits: 521, }) if err != nil { t.Fatal(err.Error()) } } func TestNewKeyPair_ECDSA_Default(t *testing.T) { kp, err := NewKeyPair(CreateKeyPairConfig{ Type: Ecdsa, }) if err != nil { t.Fatal(err.Error()) } err = verifyEcdsaKeyPair(kp, expectedData{ bits: 521, }) if err != nil { t.Fatal(err.Error()) } } func TestNewKeyPair_ECDSA_Positive(t *testing.T) { for _, bits := range []int{521, 384, 256} { config := CreateKeyPairConfig{ Type: Ecdsa, Bits: bits, Comment: uuid.TimeOrderedUUID(), } kp, err := NewKeyPair(config) if err != nil { t.Fatal(err.Error()) } err = verifyEcdsaKeyPair(kp, expectedData{ bits: bits, comment: config.Comment, }) if err != nil { t.Fatal(err.Error()) } } } func TestNewKeyPair_ECDSA_Negative(t *testing.T) { for _, bits := range []int{224, 1, 2, 3} { _, err := NewKeyPair(CreateKeyPairConfig{ Type: Ecdsa, Bits: bits, }) if err == nil { t.Fatalf("expected key pair generation to fail for %d bits", bits) } } } func TestNewKeyPair_RSA_Positive(t *testing.T) { for _, bits := range []int{4096, 2048} { config := CreateKeyPairConfig{ Type: Rsa, Bits: bits, Comment: uuid.TimeOrderedUUID(), } kp, err := NewKeyPair(config) if err != nil { t.Fatal(err.Error()) } err = verifyRsaKeyPair(kp, expectedData{ bits: config.Bits, comment: config.Comment, }) if err != nil { t.Fatal(err.Error()) } } } func TestKeyPairFromPrivateKey(t *testing.T) { m := map[string]fromPrivateExpectedData{ pemRsa1024: { t: Rsa, d: expectedData{ bits: 1024, comment: uuid.TimeOrderedUUID(), }, }, pemRsa2048: { t: Rsa, d: expectedData{ bits: 2048, comment: uuid.TimeOrderedUUID(), }, }, pemOpenSshRsa1024: { t: Rsa, d: expectedData{ bits: 1024, comment: uuid.TimeOrderedUUID(), }, }, pemOpenSshRsa2048: { t: Rsa, d: expectedData{ bits: 2048, comment: uuid.TimeOrderedUUID(), }, }, pemDsa: { t: Dsa, d: expectedData{ bits: 1024, comment: uuid.TimeOrderedUUID(), }, }, pemEcdsa384: { t: Ecdsa, d: expectedData{ bits: 384, comment: uuid.TimeOrderedUUID(), }, }, pemEcdsa521: { t: Ecdsa, d: expectedData{ bits: 521, comment: uuid.TimeOrderedUUID(), }, }, pemOpenSshEd25519: { t: Ed25519, d: expectedData{ bits: 256, comment: uuid.TimeOrderedUUID(), }, }, } for rawPrivateKey, expected := range m { kp, err := KeyPairFromPrivateKey(FromPrivateKeyConfig{ RawPrivateKeyPemBlock: []byte(rawPrivateKey), Comment: expected.d.comment, }) if err != nil { t.Fatal(err.Error()) } switch expected.t { case Dsa: err = verifyDsaKeyPair(kp, expected) case Ecdsa: err = verifyEcdsaKeyPair(kp, expected.d) case Ed25519: err = verifyEd25519KeyPair(kp, expected) case Rsa: err = verifyRsaKeyPair(kp, expected.d) default: err = fmt.Errorf("unexected SSH key pair type %s", expected.t.String()) } if err != nil { t.Fatal(err.Error()) } } } type fromPrivateExpectedData struct { t KeyPairType d expectedData } type expectedData struct { bits int comment string } func verifyEcdsaKeyPair(kp KeyPair, e expectedData) error { privateKey, err := gossh.ParseRawPrivateKey(kp.PrivateKeyPemBlock) if err != nil { return err } pk, ok := privateKey.(*ecdsa.PrivateKey) if !ok { return fmt.Errorf("private key should be *ecdsa.PrivateKey") } if pk.Curve.Params().BitSize != e.bits { return fmt.Errorf("bit size should be %d - got %d", e.bits, pk.Curve.Params().BitSize) } publicKey, err := gossh.NewPublicKey(&pk.PublicKey) if err != nil { return err } if kp.Comment != e.comment { return fmt.Errorf("key pair comment should be:\n'%s'\nGot:\n'%s'", e.comment, kp.Comment) } expectedBytes := bytes.TrimSuffix(gossh.MarshalAuthorizedKey(publicKey), []byte("\n")) if len(e.comment) > 0 { expectedBytes = append(expectedBytes, ' ') expectedBytes = append(expectedBytes, e.comment...) } if !bytes.Equal(expectedBytes, kp.PublicKeyAuthorizedKeysLine) { return fmt.Errorf("authorized keys line should be:\n'%s'\nGot:\n'%s'", string(expectedBytes), string(kp.PublicKeyAuthorizedKeysLine)) } return nil } func verifyRsaKeyPair(kp KeyPair, e expectedData) error { privateKey, err := gossh.ParseRawPrivateKey(kp.PrivateKeyPemBlock) if err != nil { return err } pk, ok := privateKey.(*rsa.PrivateKey) if !ok { return fmt.Errorf("private key should be *rsa.PrivateKey") } if pk.N.BitLen() != e.bits { return fmt.Errorf("bit size should be %d - got %d", e.bits, pk.N.BitLen()) } publicKey, err := gossh.NewPublicKey(&pk.PublicKey) if err != nil { return err } if kp.Comment != e.comment { return fmt.Errorf("key pair comment should be:\n'%s'\nGot:\n'%s'", e.comment, kp.Comment) } expectedBytes := bytes.TrimSuffix(gossh.MarshalAuthorizedKey(publicKey), []byte("\n")) if len(e.comment) > 0 { expectedBytes = append(expectedBytes, ' ') expectedBytes = append(expectedBytes, e.comment...) } if !bytes.Equal(expectedBytes, kp.PublicKeyAuthorizedKeysLine) { return fmt.Errorf("authorized keys line should be:\n'%s'\nGot:\n'%s'", string(expectedBytes), string(kp.PublicKeyAuthorizedKeysLine)) } return nil } func verifyDsaKeyPair(kp KeyPair, e fromPrivateExpectedData) error { privateKey, err := gossh.ParseRawPrivateKey(kp.PrivateKeyPemBlock) if err != nil { return err } pk, ok := privateKey.(*dsa.PrivateKey) if !ok { return fmt.Errorf("private key should be *rsa.PrivateKey") } publicKey, err := gossh.NewPublicKey(&pk.PublicKey) if err != nil { return err } if kp.Comment != e.d.comment { return fmt.Errorf("key pair comment should be:\n'%s'\nGot:\n'%s'", e.d.comment, kp.Comment) } expectedBytes := bytes.TrimSuffix(gossh.MarshalAuthorizedKey(publicKey), []byte("\n")) if len(e.d.comment) > 0 { expectedBytes = append(expectedBytes, ' ') expectedBytes = append(expectedBytes, e.d.comment...) } if !bytes.Equal(expectedBytes, kp.PublicKeyAuthorizedKeysLine) { return fmt.Errorf("authorized keys line should be:\n'%s'\nGot:\n'%s'", string(expectedBytes), string(kp.PublicKeyAuthorizedKeysLine)) } return nil } func verifyEd25519KeyPair(kp KeyPair, e fromPrivateExpectedData) error { privateKey, err := gossh.ParseRawPrivateKey(kp.PrivateKeyPemBlock) if err != nil { return err } pk, ok := privateKey.(*ed25519.PrivateKey) if !ok { return fmt.Errorf("private key should be *rsa.PrivateKey") } publicKey, err := gossh.NewPublicKey(pk.Public()) if err != nil { return err } if kp.Comment != e.d.comment { return fmt.Errorf("key pair comment should be:\n'%s'\nGot:\n'%s'", e.d.comment, kp.Comment) } expectedBytes := bytes.TrimSuffix(gossh.MarshalAuthorizedKey(publicKey), []byte("\n")) if len(e.d.comment) > 0 { expectedBytes = append(expectedBytes, ' ') expectedBytes = append(expectedBytes, e.d.comment...) } if !bytes.Equal(expectedBytes, kp.PublicKeyAuthorizedKeysLine) { return fmt.Errorf("authorized keys line should be:\n'%s'\nGot:\n'%s'", string(expectedBytes), string(kp.PublicKeyAuthorizedKeysLine)) } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/ssh/ssh.go������������������������������������������0000664�0000000�0000000�00000005332�13771713062�0023427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "encoding/pem" "fmt" "io/ioutil" "os" "time" "golang.org/x/crypto/ssh" ) func parseKeyFile(path string) ([]byte, error) { f, err := os.Open(path) if err != nil { return nil, err } defer f.Close() keyBytes, err := ioutil.ReadAll(f) if err != nil { return nil, err } // We parse the private key on our own first so that we can // show a nicer error if the private key has a password. block, _ := pem.Decode(keyBytes) if block == nil { return nil, fmt.Errorf( "Failed to read key '%s': no key found", path) } if block.Headers["Proc-Type"] == "4,ENCRYPTED" { return nil, fmt.Errorf( "Failed to read key '%s': password protected keys are\n"+ "not supported. Please decrypt the key prior to use.", path) } return keyBytes, nil } // FileSigner returns an ssh.Signer for a key file. func FileSigner(path string) (ssh.Signer, error) { keyBytes, err := parseKeyFile(path) if err != nil { return nil, fmt.Errorf("Error setting up SSH config: %s", err) } signer, err := ssh.ParsePrivateKey(keyBytes) if err != nil { return nil, fmt.Errorf("Error setting up SSH config: %s", err) } return signer, nil } func ReadCertificate(certificatePath string, keySigner ssh.Signer) (ssh.Signer, error) { if certificatePath == "" { return keySigner, fmt.Errorf("no certificate file provided") } // Load the certificate cert, err := ioutil.ReadFile(certificatePath) if err != nil { return nil, fmt.Errorf("unable to read certificate file: %v", err) } pk, _, _, _, err := ssh.ParseAuthorizedKey(cert) if err != nil { return nil, fmt.Errorf("unable to parse public key: %v", err) } certificate, ok := pk.(*ssh.Certificate) if !ok { return nil, fmt.Errorf("Error loading certificate") } err = checkValidCert(certificate) if err != nil { return nil, fmt.Errorf("%s not a valid cert: %v", certificatePath, err) } certSigner, err := ssh.NewCertSigner(certificate, keySigner) if err != nil { return nil, fmt.Errorf("failed to create cert signer: %v", err) } return certSigner, nil } // FileSigner returns an ssh.Signer for a key file. func FileSignerWithCert(path string, certificatePath string) (ssh.Signer, error) { keySigner, err := FileSigner(path) if err != nil { return nil, err } return ReadCertificate(certificatePath, keySigner) } func checkValidCert(cert *ssh.Certificate) error { const CertTimeInfinity = 1<<64 - 1 unixNow := time.Now().Unix() if after := int64(cert.ValidAfter); after < 0 || unixNow < int64(cert.ValidAfter) { return fmt.Errorf("ssh: cert is not yet valid") } if before := int64(cert.ValidBefore); cert.ValidBefore != uint64(CertTimeInfinity) && (unixNow >= before || before < 0) { return fmt.Errorf("ssh: cert has expired") } return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/ssh/tunnel.go���������������������������������������0000664�0000000�0000000�00000002627�13771713062�0024143�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "fmt" "net" "strconv" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/sdk-internals/communicator/ssh" ) // ParseTunnelArgument parses an SSH tunneling argument compatible with the openssh client form. // Valid formats: // `port:host:hostport` // NYI `[bind_address:]port:host:hostport` func ParseTunnelArgument(forward string, direction ssh.TunnelDirection) (ssh.TunnelSpec, error) { parts := strings.SplitN(forward, ":", 2) if len(parts) != 2 { return ssh.TunnelSpec{}, fmt.Errorf("Error parsing tunnel '%s': %v", forward, parts) } listeningPort, forwardingAddr := parts[0], parts[1] _, sPort, err := net.SplitHostPort(forwardingAddr) if err != nil { return ssh.TunnelSpec{}, fmt.Errorf("Error parsing forwarding, must be a tcp address: %s", err) } _, err = strconv.Atoi(sPort) if err != nil { return ssh.TunnelSpec{}, fmt.Errorf("Error parsing forwarding port, must be a valid port: %s", err) } _, err = strconv.Atoi(listeningPort) if err != nil { return ssh.TunnelSpec{}, fmt.Errorf("Error parsing listening port, must be a valid port: %s", err) } return ssh.TunnelSpec{ Direction: direction, ForwardAddr: forwardingAddr, ForwardType: "tcp", ListenAddr: fmt.Sprintf("localhost:%s", listeningPort), ListenType: "tcp", }, nil // So we parsed all that, and are just going to ignore it now. We would // have used the information to set the type here. } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/ssh/tunnel_test.go����������������������������������0000664�0000000�0000000�00000003774�13771713062�0025206�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "testing" "github.com/hashicorp/packer/packer-plugin-sdk/sdk-internals/communicator/ssh" ) const ( tunnel8080ToLocal = "8080:localhost:1234" tunnel8080ToRemote = "8080:example.com:80" bindRemoteAddress_NYI = "redis:6379:localhost:6379" ) func TestTCPToLocalTCP(t *testing.T) { tun, err := ParseTunnelArgument(tunnel8080ToLocal, ssh.UnsetTunnel) if err != nil { t.Fatal(err.Error()) } expectedTun := ssh.TunnelSpec{ Direction: ssh.UnsetTunnel, ForwardAddr: "localhost:1234", ForwardType: "tcp", ListenAddr: "localhost:8080", ListenType: "tcp", } if tun != expectedTun { t.Errorf("Parsed tunnel (%v), want %v", tun, expectedTun) } } func TestTCPToRemoteTCP(t *testing.T) { tun, err := ParseTunnelArgument(tunnel8080ToRemote, ssh.UnsetTunnel) if err != nil { t.Fatal(err.Error()) } expectedTun := ssh.TunnelSpec{ Direction: ssh.UnsetTunnel, ForwardAddr: "example.com:80", ForwardType: "tcp", ListenAddr: "localhost:8080", ListenType: "tcp", } if tun != expectedTun { t.Errorf("Parsed tunnel (%v), want %v", tun, expectedTun) } } func TestBindAddress_NYI(t *testing.T) { tun, err := ParseTunnelArgument(bindRemoteAddress_NYI, ssh.UnsetTunnel) if err == nil { t.Fatal(err.Error()) } expectedTun := ssh.TunnelSpec{ Direction: ssh.UnsetTunnel, ForwardAddr: "redis:6379", ForwardType: "tcp", ListenAddr: "localhost:6379", ListenType: "tcp", } if tun == expectedTun { t.Errorf("Parsed tunnel (%v), want %v", tun, expectedTun) } } func TestInvalidTunnels(t *testing.T) { invalids := []string{ "nope:8080", // insufficient parts "nope:localhost:8080", // listen port is not a number "8080:localhost:nope", // forwarding port is not a number "/unix/is/no/go:/path/to/nowhere", // unix socket is unsupported } for _, tunnelStr := range invalids { tun, err := ParseTunnelArgument(tunnelStr, ssh.UnsetTunnel) if err == nil { t.Errorf("Parsed tunnel %v, want error", tun) } } } ����packer-1.6.6+ds1/packer-plugin-sdk/communicator/sshkey/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023011�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/sshkey/algorithm_enumer.go��������������������������0000664�0000000�0000000�00000002421�13771713062�0026700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "enumer -type Algorithm -transform snake"; DO NOT EDIT. // package sshkey import ( "fmt" ) const _AlgorithmName = "rsadsaecdsaed25519" var _AlgorithmIndex = [...]uint8{0, 3, 6, 11, 18} func (i Algorithm) String() string { if i < 0 || i >= Algorithm(len(_AlgorithmIndex)-1) { return fmt.Sprintf("Algorithm(%d)", i) } return _AlgorithmName[_AlgorithmIndex[i]:_AlgorithmIndex[i+1]] } var _AlgorithmValues = []Algorithm{0, 1, 2, 3} var _AlgorithmNameToValueMap = map[string]Algorithm{ _AlgorithmName[0:3]: 0, _AlgorithmName[3:6]: 1, _AlgorithmName[6:11]: 2, _AlgorithmName[11:18]: 3, } // AlgorithmString retrieves an enum value from the enum constants string name. // Throws an error if the param is not part of the enum. func AlgorithmString(s string) (Algorithm, error) { if val, ok := _AlgorithmNameToValueMap[s]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to Algorithm values", s) } // AlgorithmValues returns all values of the enum func AlgorithmValues() []Algorithm { return _AlgorithmValues } // IsAAlgorithm returns "true" if the value is listed in the enum definition. "false" otherwise func (i Algorithm) IsAAlgorithm() bool { for _, v := range _AlgorithmValues { if i == v { return true } } return false } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/sshkey/generate.go����������������������������������0000664�0000000�0000000�00000014204�13771713062�0025133�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package sshkey import ( "crypto/dsa" "crypto/ecdsa" "crypto/ed25519" "crypto/elliptic" cryptorand "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/asn1" "encoding/pem" "fmt" "io" "math/big" "golang.org/x/crypto/ssh" ) type Algorithm int //go:generate enumer -type Algorithm -transform snake const ( RSA Algorithm = iota DSA ECDSA ED25519 ) var ( ErrUnknownAlgorithm = fmt.Errorf("sshkey: unknown private key algorithm") ErrInvalidRSAKeySize = fmt.Errorf("sshkey: invalid private key rsa size: must be more than 1024") ErrInvalidECDSAKeySize = fmt.Errorf("sshkey: invalid private key ecdsa size, must be one of 256, 384 or 521") ErrInvalidDSAKeySize = fmt.Errorf("sshkey: invalid private key dsa size, must be one of 1024, 2048 or 3072") ) // Pair represents an ssh key pair, as in type Pair struct { Private []byte Public []byte } func NewPair(public, private interface{}) (*Pair, error) { kb, err := x509.MarshalPKCS8PrivateKey(private) if err != nil { return nil, err } privBlk := &pem.Block{ Type: "PRIVATE KEY", Headers: nil, Bytes: kb, } publicKey, err := ssh.NewPublicKey(public) if err != nil { return nil, err } return &Pair{ Private: pem.EncodeToMemory(privBlk), Public: ssh.MarshalAuthorizedKey(publicKey), }, nil } // PairFromED25519 marshalls a valid pair of openssh pem for ED25519 keypairs. // NewPair can handle ed25519 pairs but generates the wrong format apparently: // `Load key "id_ed25519": invalid format` is the error that happens when I try // to ssh with such a key. func PairFromED25519(public ed25519.PublicKey, private ed25519.PrivateKey) (*Pair, error) { // see https://github.com/golang/crypto/blob/7f63de1d35b0f77fa2b9faea3e7deb402a2383c8/ssh/keys.go#L1273-L1443 key := struct { Pub []byte Priv []byte Comment string Pad []byte `ssh:"rest"` }{ Pub: public, Priv: private, } keyBytes := ssh.Marshal(key) pk1 := struct { Check1 uint32 Check2 uint32 Keytype string Rest []byte `ssh:"rest"` }{ Keytype: ssh.KeyAlgoED25519, Rest: keyBytes, } pk1Bytes := ssh.Marshal(pk1) k := struct { CipherName string KdfName string KdfOpts string NumKeys uint32 PubKey []byte PrivKeyBlock []byte }{ CipherName: "none", KdfName: "none", KdfOpts: "", NumKeys: 1, PrivKeyBlock: pk1Bytes, } const opensshV1Magic = "openssh-key-v1\x00" privBlk := &pem.Block{ Type: "OPENSSH PRIVATE KEY", Headers: nil, Bytes: append([]byte(opensshV1Magic), ssh.Marshal(k)...), } publicKey, err := ssh.NewPublicKey(public) if err != nil { return nil, err } return &Pair{ Private: pem.EncodeToMemory(privBlk), Public: ssh.MarshalAuthorizedKey(publicKey), }, nil } // PairFromDSA marshalls a valid pair of openssh pem for dsa keypairs. // x509.MarshalPKCS8PrivateKey does not know how to deal with dsa keys. func PairFromDSA(key *dsa.PrivateKey) (*Pair, error) { // see https://github.com/golang/crypto/blob/7f63de1d35b0f77fa2b9faea3e7deb402a2383c8/ssh/keys.go#L1186-L1195 // and https://linux.die.net/man/1/dsa k := struct { Version int P *big.Int Q *big.Int G *big.Int Pub *big.Int Priv *big.Int }{ Version: 0, P: key.P, Q: key.Q, G: key.G, Pub: key.Y, Priv: key.X, } kb, err := asn1.Marshal(k) if err != nil { return nil, err } privBlk := &pem.Block{ Type: "DSA PRIVATE KEY", Headers: nil, Bytes: kb, } publicKey, err := ssh.NewPublicKey(&key.PublicKey) if err != nil { return nil, err } return &Pair{ Private: pem.EncodeToMemory(privBlk), Public: ssh.MarshalAuthorizedKey(publicKey), }, nil } // GeneratePair generates a Private/Public key pair using algorithm t. // // When rand is nil "crypto/rand".Reader will be used. // // bits specifies the number of bits in the key to create. For RSA keys, the // minimum size is 1024 bits and the default is 3072 bits. Generally, 3072 bits // is considered sufficient. DSA keys must be exactly 1024 bits - or 2 or 3 // times that - as specified by FIPS 186-2. For ECDSA keys, bits determines the // key length by selecting from one of three elliptic curve sizes: 256, 384 or // 521 bits. Attempting to use bit lengths other than these three values for // ECDSA keys will fail. Ed25519 keys have a fixed length and the bits will // be ignored. func GeneratePair(t Algorithm, rand io.Reader, bits int) (*Pair, error) { if rand == nil { rand = cryptorand.Reader } switch t { case DSA: if bits == 0 { // currently the ssh package can only decode 1024 bits dsa keys, so // that's going be the default for now see // https://github.com/golang/crypto/blob/7f63de1d35b0f77fa2b9faea3e7deb402a2383c8/ssh/keys.go#L411-L420 bits = 1024 } var sizes dsa.ParameterSizes switch bits { case 1024: sizes = dsa.L1024N160 case 2048: sizes = dsa.L2048N256 case 3072: sizes = dsa.L3072N256 default: return nil, ErrInvalidDSAKeySize } params := dsa.Parameters{} if err := dsa.GenerateParameters(&params, rand, sizes); err != nil { return nil, err } dsakey := &dsa.PrivateKey{ PublicKey: dsa.PublicKey{ Parameters: params, }, } if err := dsa.GenerateKey(dsakey, rand); err != nil { return nil, err } return PairFromDSA(dsakey) case ECDSA: if bits == 0 { bits = 521 } var ecdsakey *ecdsa.PrivateKey var err error switch bits { case 256: ecdsakey, err = ecdsa.GenerateKey(elliptic.P256(), rand) case 384: ecdsakey, err = ecdsa.GenerateKey(elliptic.P384(), rand) case 521: ecdsakey, err = ecdsa.GenerateKey(elliptic.P521(), rand) default: ecdsakey, err = nil, ErrInvalidECDSAKeySize } if err != nil { return nil, err } return NewPair(&ecdsakey.PublicKey, ecdsakey) case ED25519: publicKey, privateKey, err := ed25519.GenerateKey(rand) if err != nil { return nil, err } return PairFromED25519(publicKey, privateKey) case RSA: if bits == 0 { bits = 4096 } if bits < 1024 { return nil, ErrInvalidRSAKeySize } rsakey, err := rsa.GenerateKey(rand, bits) if err != nil { return nil, err } return NewPair(&rsakey.PublicKey, rsakey) default: return nil, ErrUnknownAlgorithm } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/sshkey/generate_test.go�����������������������������0000664�0000000�0000000�00000001443�13771713062�0026173�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package sshkey import ( "testing" "github.com/google/go-cmp/cmp" "golang.org/x/crypto/ssh" ) func TestGeneratePair_parseable(t *testing.T) { tests := []struct { t Algorithm }{ {DSA}, {RSA}, {ECDSA}, {ED25519}, } for _, tt := range tests { t.Run(tt.t.String(), func(t *testing.T) { got, err := GeneratePair(tt.t, nil, 0) if err != nil { t.Errorf("GeneratePair() error = %v", err) return } privateKey, err := ssh.ParsePrivateKey(got.Private) if err != nil { t.Fatal(err) } publicKey, _, _, _, err := ssh.ParseAuthorizedKey(got.Public) if err != nil { t.Fatalf("%v: %s", err, got.Public) } if diff := cmp.Diff(privateKey.PublicKey().Marshal(), publicKey.Marshal()); diff != "" { t.Fatalf("wrong public key: %s", diff) } }) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/step_connect.go�������������������������������������0000664�0000000�0000000�00000007443�13771713062�0024526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "context" "fmt" "log" "time" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/sdk-internals/communicator/none" gossh "golang.org/x/crypto/ssh" ) // StepConnect is a multistep Step implementation that connects to // the proper communicator and stores it in the "communicator" key in the // state bag. type StepConnect struct { // Config is the communicator config struct Config *Config // Host should return a host that can be connected to for communicator // connections. Host func(multistep.StateBag) (string, error) // The fields below are callbacks to assist with connecting to SSH. // // SSHConfig should return the default configuration for // connecting via SSH. SSHConfig func(multistep.StateBag) (*gossh.ClientConfig, error) SSHPort func(multistep.StateBag) (int, error) // The fields below are callbacks to assist with connecting to WinRM. // // WinRMConfig should return the default configuration for // connecting via WinRM. WinRMConfig func(multistep.StateBag) (*WinRMConfig, error) WinRMPort func(multistep.StateBag) (int, error) // CustomConnect can be set to have custom connectors for specific // types. These take highest precedence so you can also override // existing types. CustomConnect map[string]multistep.Step substep multistep.Step } func (s *StepConnect) pause(pauseLen time.Duration, ctx context.Context) bool { // Use a select to determine if we get cancelled during the wait select { case <-ctx.Done(): return true case <-time.After(pauseLen): } log.Printf("Pause over; connecting...") return false } func (s *StepConnect) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) typeMap := map[string]multistep.Step{ "none": nil, "ssh": &StepConnectSSH{ Config: s.Config, Host: s.Host, SSHConfig: s.SSHConfig, SSHPort: s.SSHPort, }, "winrm": &StepConnectWinRM{ Config: s.Config, Host: s.Host, WinRMConfig: s.WinRMConfig, WinRMPort: s.WinRMPort, }, } for k, v := range s.CustomConnect { typeMap[k] = v } step, ok := typeMap[s.Config.Type] if !ok { state.Put("error", fmt.Errorf("unknown communicator type: %s", s.Config.Type)) return multistep.ActionHalt } if step == nil { if comm, err := none.New("none"); err != nil { err := fmt.Errorf("Failed to set communicator 'none': %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } else { state.Put("communicator", comm) log.Printf("[INFO] communicator disabled, will not connect") } return multistep.ActionContinue } if host, err := s.Host(state); err == nil { ui.Say(fmt.Sprintf("Using %s communicator to connect: %s", s.Config.Type, host)) } else { log.Printf("[DEBUG] Unable to get address during connection step: %s", err) } s.substep = step action := s.substep.Run(ctx, state) if action == multistep.ActionHalt { return action } if s.Config.PauseBeforeConnect > 0 { ui.Say(fmt.Sprintf("Pausing %s before connecting...", s.Config.PauseBeforeConnect.String())) cancelled := s.pause(s.Config.PauseBeforeConnect, ctx) if cancelled { return multistep.ActionHalt } // After pause is complete, re-run the connect substep to make sure // you've connected properly action := s.substep.Run(ctx, state) if action == multistep.ActionHalt { return action } } // Put communicator config into state so we can pass it to provisioners // for specialized interpolation later state.Put("communicator_config", s.Config) return multistep.ActionContinue } func (s *StepConnect) Cleanup(state multistep.StateBag) { if s.substep != nil { s.substep.Cleanup(state) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/step_connect_ssh.go���������������������������������0000664�0000000�0000000�00000022243�13771713062�0025376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "context" "errors" "fmt" "io" "log" "net" "os" "strings" "time" "golang.org/x/crypto/ssh/terminal" helperssh "github.com/hashicorp/packer/packer-plugin-sdk/communicator/ssh" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/pathing" "github.com/hashicorp/packer/packer-plugin-sdk/sdk-internals/communicator/ssh" gossh "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" "golang.org/x/net/proxy" ) // StepConnectSSH is a step that only connects to SSH. // // In general, you should use StepConnect. type StepConnectSSH struct { // All the fields below are documented on StepConnect Config *Config Host func(multistep.StateBag) (string, error) SSHConfig func(multistep.StateBag) (*gossh.ClientConfig, error) SSHPort func(multistep.StateBag) (int, error) } func (s *StepConnectSSH) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) var comm packersdk.Communicator var err error subCtx, cancel := context.WithCancel(ctx) waitDone := make(chan bool, 1) go func() { ui.Say("Waiting for SSH to become available...") comm, err = s.waitForSSH(state, subCtx) cancel() // just to make 'possible context leak' analysis happy waitDone <- true }() log.Printf("[INFO] Waiting for SSH, up to timeout: %s", s.Config.SSHTimeout) timeout := time.After(s.Config.SSHTimeout) for { // Wait for either SSH to become available, a timeout to occur, // or an interrupt to come through. select { case <-waitDone: if err != nil { ui.Error(fmt.Sprintf("Error waiting for SSH: %s", err)) state.Put("error", err) return multistep.ActionHalt } ui.Say("Connected to SSH!") state.Put("communicator", comm) return multistep.ActionContinue case <-timeout: err := fmt.Errorf("Timeout waiting for SSH.") state.Put("error", err) ui.Error(err.Error()) cancel() return multistep.ActionHalt case <-ctx.Done(): // The step sequence was cancelled, so cancel waiting for SSH // and just start the halting process. cancel() log.Println("[WARN] Interrupt detected, quitting waiting for SSH.") return multistep.ActionHalt case <-time.After(1 * time.Second): } } } func (s *StepConnectSSH) Cleanup(multistep.StateBag) { } func (s *StepConnectSSH) waitForSSH(state multistep.StateBag, ctx context.Context) (packersdk.Communicator, error) { // Determine if we're using a bastion host, and if so, retrieve // that configuration. This configuration doesn't change so we // do this one before entering the retry loop. var bProto, bAddr string var bConf *gossh.ClientConfig var pAddr string var pAuth *proxy.Auth if s.Config.SSHBastionHost != "" { // The protocol is hardcoded for now, but may be configurable one day bProto = "tcp" bAddr = fmt.Sprintf( "%s:%d", s.Config.SSHBastionHost, s.Config.SSHBastionPort) conf, err := sshBastionConfig(s.Config) if err != nil { return nil, fmt.Errorf("Error configuring bastion: %s", err) } bConf = conf } if s.Config.SSHProxyHost != "" { pAddr = fmt.Sprintf("%s:%d", s.Config.SSHProxyHost, s.Config.SSHProxyPort) if s.Config.SSHProxyUsername != "" { pAuth = new(proxy.Auth) pAuth.User = s.Config.SSHProxyUsername pAuth.Password = s.Config.SSHProxyPassword } } handshakeAttempts := 0 var comm packersdk.Communicator first := true for { // Don't check for cancel or wait on first iteration if !first { select { case <-ctx.Done(): log.Println("[DEBUG] SSH wait cancelled. Exiting loop.") return nil, errors.New("SSH wait cancelled") case <-time.After(5 * time.Second): } } first = false // First we request the TCP connection information host, err := s.Host(state) if err != nil { log.Printf("[DEBUG] Error getting SSH address: %s", err) continue } // store host and port in config so we can access them from provisioners s.Config.SSHHost = host port := s.Config.SSHPort if s.SSHPort != nil { port, err = s.SSHPort(state) if err != nil { log.Printf("[DEBUG] Error getting SSH port: %s", err) continue } s.Config.SSHPort = port } state.Put("communicator_config", s.Config) // Retrieve the SSH configuration sshConfig, err := s.SSHConfig(state) if err != nil { log.Printf("[DEBUG] Error getting SSH config: %s", err) continue } // Attempt to connect to SSH port var connFunc func() (net.Conn, error) address := fmt.Sprintf("%s:%d", host, port) if bAddr != "" { // We're using a bastion host, so use the bastion connfunc connFunc = ssh.BastionConnectFunc( bProto, bAddr, bConf, "tcp", address) } else if pAddr != "" { // Connect via SOCKS5 proxy connFunc = ssh.ProxyConnectFunc(pAddr, pAuth, "tcp", address) } else { // No bastion host, connect directly connFunc = ssh.ConnectFunc("tcp", address) } nc, err := connFunc() if err != nil { log.Printf("[DEBUG] TCP connection to SSH ip/port failed: %s", err) continue } nc.Close() // Parse out all the requested Port Tunnels that will go over our SSH connection var tunnels []ssh.TunnelSpec for _, v := range s.Config.SSHLocalTunnels { t, err := helperssh.ParseTunnelArgument(v, ssh.LocalTunnel) if err != nil { return nil, fmt.Errorf( "Error parsing port forwarding: %s", err) } tunnels = append(tunnels, t) } for _, v := range s.Config.SSHRemoteTunnels { t, err := helperssh.ParseTunnelArgument(v, ssh.RemoteTunnel) if err != nil { return nil, fmt.Errorf( "Error parsing port forwarding: %s", err) } tunnels = append(tunnels, t) } // Then we attempt to connect via SSH config := &ssh.Config{ Connection: connFunc, SSHConfig: sshConfig, Pty: s.Config.SSHPty, DisableAgentForwarding: s.Config.SSHDisableAgentForwarding, UseSftp: s.Config.SSHFileTransferMethod == "sftp", KeepAliveInterval: s.Config.SSHKeepAliveInterval, Timeout: s.Config.SSHReadWriteTimeout, Tunnels: tunnels, } log.Printf("[INFO] Attempting SSH connection to %s...", address) comm, err = ssh.New(address, config) if err != nil { log.Printf("[DEBUG] SSH handshake err: %s", err) // Only count this as an attempt if we were able to attempt // to authenticate. Note this is very brittle since it depends // on the string of the error... but I don't see any other way. if strings.Contains(err.Error(), "authenticate") { log.Printf( "[DEBUG] Detected authentication error. Increasing handshake attempts.") err = fmt.Errorf("Packer experienced an authentication error "+ "when trying to connect via SSH. This can happen if your "+ "username/password are wrong. You may want to double-check"+ " your credentials as part of your debugging process. "+ "original error: %s", err) handshakeAttempts += 1 } if handshakeAttempts < s.Config.SSHHandshakeAttempts { // Try to connect via SSH a handful of times. We sleep here // so we don't get a ton of authentication errors back to back. time.Sleep(2 * time.Second) continue } return nil, err } break } return comm, nil } func sshBastionConfig(config *Config) (*gossh.ClientConfig, error) { auth := make([]gossh.AuthMethod, 0, 2) if config.SSHBastionInteractive { var c io.ReadWriteCloser if terminal.IsTerminal(int(os.Stdin.Fd())) { c = os.Stdin } else { tty, err := os.Open("/dev/tty") if err != nil { return nil, err } defer tty.Close() c = tty } auth = append(auth, gossh.KeyboardInteractive(ssh.KeyboardInteractive(c))) } if config.SSHBastionPassword != "" { auth = append(auth, gossh.Password(config.SSHBastionPassword), gossh.KeyboardInteractive( ssh.PasswordKeyboardInteractive(config.SSHBastionPassword))) } if config.SSHBastionPrivateKeyFile != "" { path, err := pathing.ExpandUser(config.SSHBastionPrivateKeyFile) if err != nil { return nil, fmt.Errorf( "Error expanding path for SSH bastion private key: %s", err) } if config.SSHBastionCertificateFile != "" { identityPath, err := pathing.ExpandUser(config.SSHBastionCertificateFile) if err != nil { return nil, fmt.Errorf("Error expanding path for SSH bastion identity certificate: %s", err) } signer, err := helperssh.FileSignerWithCert(path, identityPath) if err != nil { return nil, err } auth = append(auth, gossh.PublicKeys(signer)) } else { signer, err := helperssh.FileSigner(path) if err != nil { return nil, err } auth = append(auth, gossh.PublicKeys(signer)) } } if config.SSHBastionAgentAuth { authSock := os.Getenv("SSH_AUTH_SOCK") if authSock == "" { return nil, fmt.Errorf("SSH_AUTH_SOCK is not set") } sshAgent, err := net.Dial("unix", authSock) if err != nil { return nil, fmt.Errorf("Cannot connect to SSH Agent socket %q: %s", authSock, err) } auth = append(auth, gossh.PublicKeysCallback(agent.NewClient(sshAgent).Signers)) } return &gossh.ClientConfig{ User: config.SSHBastionUsername, Auth: auth, HostKeyCallback: gossh.InsecureIgnoreHostKey(), }, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/step_connect_test.go��������������������������������0000664�0000000�0000000�00000001503�13771713062�0025554�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "bytes" "context" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestStepConnect_impl(t *testing.T) { var _ multistep.Step = new(StepConnect) } func TestStepConnect_none(t *testing.T) { state := testState(t) step := &StepConnect{ Config: &Config{ Type: "none", }, } defer step.Cleanup(state) // run the step if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } } func testState(t *testing.T) multistep.StateBag { state := new(multistep.BasicStateBag) state.Put("hook", &packersdk.MockHook{}) state.Put("ui", &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), }) return state } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/step_connect_winrm.go�������������������������������0000664�0000000�0000000�00000015756�13771713062�0025750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "bytes" "context" "errors" "fmt" "io" "log" "net/http" "net/url" "os" "strings" "time" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/sdk-internals/communicator/winrm" winrmcmd "github.com/masterzen/winrm" "golang.org/x/net/http/httpproxy" ) // StepConnectWinRM is a multistep Step implementation that waits for WinRM // to become available. It gets the connection information from a single // configuration when creating the step. // // Uses: // ui packersdk.Ui // // Produces: // communicator packersdk.Communicator type StepConnectWinRM struct { // All the fields below are documented on StepConnect Config *Config Host func(multistep.StateBag) (string, error) WinRMConfig func(multistep.StateBag) (*WinRMConfig, error) WinRMPort func(multistep.StateBag) (int, error) } func (s *StepConnectWinRM) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) var comm packersdk.Communicator var err error subCtx, cancel := context.WithCancel(ctx) waitDone := make(chan bool, 1) go func() { ui.Say("Waiting for WinRM to become available...") comm, err = s.waitForWinRM(state, subCtx) cancel() // just to make 'possible context leak' analysis happy waitDone <- true }() log.Printf("Waiting for WinRM, up to timeout: %s", s.Config.WinRMTimeout) timeout := time.After(s.Config.WinRMTimeout) for { // Wait for either WinRM to become available, a timeout to occur, // or an interrupt to come through. select { case <-waitDone: if err != nil { ui.Error(fmt.Sprintf("Error waiting for WinRM: %s", err)) return multistep.ActionHalt } ui.Say("Connected to WinRM!") state.Put("communicator", comm) return multistep.ActionContinue case <-timeout: err := fmt.Errorf("Timeout waiting for WinRM.") state.Put("error", err) ui.Error(err.Error()) cancel() return multistep.ActionHalt case <-ctx.Done(): // The step sequence was cancelled, so cancel waiting for WinRM // and just start the halting process. cancel() log.Println("Interrupt detected, quitting waiting for WinRM.") return multistep.ActionHalt case <-time.After(1 * time.Second): } } } func (s *StepConnectWinRM) Cleanup(multistep.StateBag) { } func (s *StepConnectWinRM) waitForWinRM(state multistep.StateBag, ctx context.Context) (packersdk.Communicator, error) { var comm packersdk.Communicator first := true for { // Don't check for cancel or wait on first iteration if !first { select { case <-ctx.Done(): log.Println("[INFO] WinRM wait cancelled. Exiting loop.") return nil, errors.New("WinRM wait cancelled") case <-time.After(5 * time.Second): } } first = false host, err := s.Host(state) if err != nil { log.Printf("[DEBUG] Error getting WinRM host: %s", err) continue } s.Config.WinRMHost = host port := s.Config.WinRMPort if s.WinRMPort != nil { port, err = s.WinRMPort(state) if err != nil { log.Printf("[DEBUG] Error getting WinRM port: %s", err) continue } s.Config.WinRMPort = port } state.Put("communicator_config", s.Config) user := s.Config.WinRMUser password := s.Config.WinRMPassword if s.WinRMConfig != nil { config, err := s.WinRMConfig(state) if err != nil { log.Printf("[DEBUG] Error getting WinRM config: %s", err) continue } if config.Username != "" { user = config.Username } if config.Password != "" { password = config.Password s.Config.WinRMPassword = password } } if s.Config.WinRMNoProxy { if err := setNoProxy(host, port); err != nil { return nil, fmt.Errorf("Error setting no_proxy: %s", err) } s.Config.WinRMTransportDecorator = ProxyTransportDecorator } log.Println("[INFO] Attempting WinRM connection...") comm, err = winrm.New(&winrm.Config{ Host: host, Port: port, Username: user, Password: password, Timeout: s.Config.WinRMTimeout, Https: s.Config.WinRMUseSSL, Insecure: s.Config.WinRMInsecure, TransportDecorator: s.Config.WinRMTransportDecorator, }) if err != nil { log.Printf("[ERROR] WinRM connection err: %s", err) continue } break } // run an "echo" command to make sure winrm is actually connected before moving on. var connectCheckCommand = winrmcmd.Powershell(`if (Test-Path variable:global:ProgressPreference){$ProgressPreference='SilentlyContinue'}; echo "WinRM connected."`) var retryableSleep = 5 * time.Second // run an "echo" command to make sure that the winrm is connected for { cmd := &packersdk.RemoteCmd{Command: connectCheckCommand} var buf, buf2 bytes.Buffer cmd.Stdout = &buf cmd.Stdout = io.MultiWriter(cmd.Stdout, &buf2) select { case <-ctx.Done(): log.Println("WinRM wait canceled, exiting loop") return comm, fmt.Errorf("WinRM wait canceled") case <-time.After(retryableSleep): } log.Printf("Checking that WinRM is connected with: '%s'", connectCheckCommand) ui := state.Get("ui").(packersdk.Ui) err := cmd.RunWithUi(ctx, comm, ui) if err != nil { log.Printf("Communication connection err: %s", err) continue } log.Printf("Connected to machine") stdoutToRead := buf2.String() if !strings.Contains(stdoutToRead, "WinRM connected.") { log.Printf("echo didn't succeed; retrying...") continue } break } return comm, nil } // setNoProxy configures the $NO_PROXY env var func setNoProxy(host string, port int) error { current := os.Getenv("NO_PROXY") p := fmt.Sprintf("%s:%d", host, port) if current == "" { return os.Setenv("NO_PROXY", p) } if !strings.Contains(current, p) { return os.Setenv("NO_PROXY", strings.Join([]string{current, p}, ",")) } return nil } // The net/http ProxyFromEnvironment only loads the environment once, when the // code is initialized rather than when it's executed. This means that if your // wrapping code sets the NO_PROXY env var (as Packer does!), it will be // ignored. Re-loading the environment vars is more expensive, but it is the // easiest way to work around this limitation. func RefreshProxyFromEnvironment(req *http.Request) (*url.URL, error) { return envProxyFunc()(req.URL) } func envProxyFunc() func(*url.URL) (*url.URL, error) { envProxyFuncValue := httpproxy.FromEnvironment().ProxyFunc() return envProxyFuncValue } // ProxyTransportDecorator is a custom Transporter that reloads HTTP Proxy settings at client runtime. // The net/http ProxyFromEnvironment only loads the environment once, when the // code is initialized rather than when it's executed. This means that if your // wrapping code sets the NO_PROXY env var (as Packer does!), it will be // ignored. Re-loading the environment vars is more expensive, but it is the // easiest way to work around this limitation. func ProxyTransportDecorator() winrmcmd.Transporter { return winrmcmd.NewClientWithProxyFunc(RefreshProxyFromEnvironment) } ������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/step_debug_ssh_keys.go������������������������������0000664�0000000�0000000�00000001472�13771713062�0026067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "context" "fmt" "io/ioutil" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepDumpSSHKey is a multistep Step implementation that writes the ssh // keypair somewhere. type StepDumpSSHKey struct { Path string SSH *SSH } func (s *StepDumpSSHKey) Run(_ context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) ui.Message(fmt.Sprintf("Saving key for debug purposes: %s", s.Path)) err := ioutil.WriteFile(s.Path, s.SSH.SSHPrivateKey, 0700) if err != nil { state.Put("error", fmt.Errorf("Error saving debug key: %s", err)) return multistep.ActionHalt } return multistep.ActionContinue } func (s *StepDumpSSHKey) Cleanup(state multistep.StateBag) {} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/step_ssh_keygen.go����������������������������������0000664�0000000�0000000�00000003540�13771713062�0025226�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/communicator/sshkey" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepSSHKeyGen is a Packer build step that generates SSH key pairs. type StepSSHKeyGen struct { CommConf *Config SSHTemporaryKeyPair } // Run executes the Packer build step that generates SSH key pairs. // The key pairs are added to the ssh config func (s *StepSSHKeyGen) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) comm := s.CommConf if comm.SSHPrivateKeyFile != "" { ui.Say("Using existing SSH private key") privateKeyBytes, err := comm.ReadSSHPrivateKeyFile() if err != nil { state.Put("error", err) return multistep.ActionHalt } comm.SSHPrivateKey = privateKeyBytes comm.SSHPublicKey = nil return multistep.ActionContinue } algorithm := s.SSHTemporaryKeyPair.SSHTemporaryKeyPairType if algorithm == "" { algorithm = sshkey.RSA.String() } a, err := sshkey.AlgorithmString(algorithm) if err != nil { err := fmt.Errorf("%w: possible algorithm types are `dsa` | `ecdsa` | `ed25519` | `rsa` ( the default )", err) state.Put("error", err) return multistep.ActionHalt } ui.Say(fmt.Sprintf("Creating temporary %s SSH key for instance...", a.String())) pair, err := sshkey.GeneratePair(a, nil, s.SSHTemporaryKeyPairBits) if err != nil { err := fmt.Errorf("Error creating temporary ssh key: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } comm.SSHPrivateKey = pair.Private comm.SSHPublicKey = pair.Public return multistep.ActionContinue } // Nothing to clean up. SSH keys are associated with a single GCE instance. func (s *StepSSHKeyGen) Cleanup(state multistep.StateBag) {} ����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/testing.go������������������������������������������0000664�0000000�0000000�00000003705�13771713062�0023514�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator import ( "testing" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) func TestPEM(t *testing.T) string { tf, err := tmp.File("packer") if err != nil { t.Fatalf("err: %s", err) } tf.Write([]byte(TestPEMContents)) tf.Close() return tf.Name() } const TestPEMContents = ` -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAxd4iamvrwRJvtNDGQSIbNvvIQN8imXTRWlRY62EvKov60vqu hh+rDzFYAIIzlmrJopvOe0clqmi3mIP9dtkjPFrYflq52a2CF5q+BdwsJXuRHbJW LmStZUwW1khSz93DhvhmK50nIaczW63u4EO/jJb3xj+wxR1Nkk9bxi3DDsYFt8SN AzYx9kjlEYQ/+sI4/ATfmdV9h78SVotjScupd9KFzzi76gWq9gwyCBLRynTUWlyD 2UOfJRkOvhN6/jKzvYfVVwjPSfA9IMuooHdScmC4F6KBKJl/zf/zETM0XyzIDNmH uOPbCiljq2WoRM+rY6ET84EO0kVXbfx8uxUsqQIDAQABAoIBAQCkPj9TF0IagbM3 5BSs/CKbAWS4dH/D4bPlxx4IRCNirc8GUg+MRb04Xz0tLuajdQDqeWpr6iLZ0RKV BvreLF+TOdV7DNQ4XE4gSdJyCtCaTHeort/aordL3l0WgfI7mVk0L/yfN1PEG4YG E9q1TYcyrB3/8d5JwIkjabxERLglCcP+geOEJp+QijbvFIaZR/n2irlKW4gSy6ko 9B0fgUnhkHysSg49ChHQBPQ+o5BbpuLrPDFMiTPTPhdfsvGGcyCGeqfBA56oHcSF K02Fg8OM+Bd1lb48LAN9nWWY4WbwV+9bkN3Ym8hO4c3a/Dxf2N7LtAQqWZzFjvM3 /AaDvAgBAoGBAPLD+Xn1IYQPMB2XXCXfOuJewRY7RzoVWvMffJPDfm16O7wOiW5+ 2FmvxUDayk4PZy6wQMzGeGKnhcMMZTyaq2g/QtGfrvy7q1Lw2fB1VFlVblvqhoJa nMJojjC4zgjBkXMHsRLeTmgUKyGs+fdFbfI6uejBnnf+eMVUMIdJ+6I9AoGBANCn kWO9640dttyXURxNJ3lBr2H3dJOkmD6XS+u+LWqCSKQe691Y/fZ/ZL0Oc4Mhy7I6 hsy3kDQ5k2V0fkaNODQIFJvUqXw2pMewUk8hHc9403f4fe9cPrL12rQ8WlQw4yoC v2B61vNczCCUDtGxlAaw8jzSRaSI5s6ax3K7enbdAoGBAJB1WYDfA2CoAQO6y9Sl b07A/7kQ8SN5DbPaqrDrBdJziBQxukoMJQXJeGFNUFD/DXFU5Fp2R7C86vXT7HIR v6m66zH+CYzOx/YE6EsUJms6UP9VIVF0Rg/RU7teXQwM01ZV32LQ8mswhTH20o/3 uqMHmxUMEhZpUMhrfq0isyApAoGAe1UxGTXfj9AqkIVYylPIq2HqGww7+jFmVEj1 9Wi6S6Sq72ffnzzFEPkIQL/UA4TsdHMnzsYKFPSbbXLIWUeMGyVTmTDA5c0e5XIR lPhMOKCAzv8w4VUzMnEkTzkFY5JqFCD/ojW57KvDdNZPVB+VEcdxyAW6aKELXMAc eHLc1nkCgYEApm/motCTPN32nINZ+Vvywbv64ZD+gtpeMNP3CLrbe1X9O+H52AXa 1jCoOldWR8i2bs2NVPcKZgdo6fFULqE4dBX7Te/uYEIuuZhYLNzRO1IKU/YaqsXG 3bfQ8hKYcSnTfE0gPtLDnqCIxTocaGLSHeG3TH9fTw+dA8FvWpUztI4= -----END RSA PRIVATE KEY----- ` �����������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/communicator/winrm.go��������������������������������������������0000664�0000000�0000000�00000000267�13771713062�0023173�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package communicator // WinRMConfig is configuration that can be returned at runtime to // dynamically configure WinRM. type WinRMConfig struct { Username string Password string } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/filelock/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020573�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/filelock/doc.go��������������������������������������������������0000664�0000000�0000000�00000000160�13771713062�0021664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package filelock makes it easy to create and check file locks for concurrent processes. */ package filelock ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/filelock/filelock.go���������������������������������������������0000664�0000000�0000000�00000000232�13771713062�0022707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !solaris package filelock import "github.com/gofrs/flock" type Flock = flock.Flock func New(path string) *Flock { return flock.New(path) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/filelock/filelock_solaris.go�������������������������������������0000664�0000000�0000000�00000000275�13771713062�0024452�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// build solaris package filelock // Flock is a noop on solaris for now. // TODO(azr): PR github.com/gofrs/flock for this. type Flock = Noop func New(string) *Flock { return &Flock{} } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/filelock/noop.go�������������������������������������������������0000664�0000000�0000000�00000000356�13771713062�0022101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package filelock // this lock does nothing type Noop struct{} func (_ *Noop) Lock() (bool, error) { return true, nil } func (_ *Noop) TryLock() (bool, error) { return true, nil } func (_ *Noop) Unlock() error { return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/go.mod.example���������������������������������������������������0000664�0000000�0000000�00000003335�13771713062�0021547�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/packer-plugin-sdk require ( github.com/aws/aws-sdk-go v1.36.5 github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1 github.com/fatih/camelcase v1.0.0 github.com/fatih/structtag v1.0.0 github.com/gofrs/flock v0.8.0 github.com/google/go-cmp v0.5.2 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/uuid v1.1.2 github.com/hashicorp/consul/api v1.8.0 github.com/hashicorp/go-getter/gcs/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-getter/s3/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-getter/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/go-version v1.2.0 github.com/hashicorp/hcl/v2 v2.8.0 github.com/hashicorp/packer v1.6.5 github.com/hashicorp/vault/api v1.0.4 github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 github.com/masterzen/winrm v0.0.0-20201030141608-56ca5c5f2380 github.com/mitchellh/go-fs v0.0.0-20180402235330-b7b9ca407fff github.com/mitchellh/iochan v1.0.0 github.com/mitchellh/mapstructure v1.4.0 github.com/mitchellh/reflectwalk v1.0.1 github.com/packer-community/winrmcp v0.0.0-20180921211025-c76d91c1e7db github.com/pkg/sftp v1.12.0 github.com/ryanuber/go-glob v1.0.0 github.com/stretchr/testify v1.6.1 github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1 github.com/zclconf/go-cty v1.7.0 golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 golang.org/x/mobile v0.0.0-20201208152944-da85bec010a2 golang.org/x/net v0.0.0-20201209123823-ac852fbbde11 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a golang.org/x/tools v0.0.0-20200918232735-d647fc253266 ) go 1.14 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/guestexec/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020777�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/guestexec/doc.go�������������������������������������������������0000664�0000000�0000000�00000001001�13771713062�0022063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package guestexec provides a shim for running common operating system commands on the guest/remote instance that is being provisioned. It helps provisioners which need to perform operating-system specific calls do so in a way that is simple and repeatable. Note that to successfully use this package your provisioner must have knowledge of the guest type, which is not information that builders generally collect -- your provisioner will have to require guest information in its config. */ package guestexec �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/guestexec/elevated.go��������������������������������������������0000664�0000000�0000000�00000015203�13771713062�0023120�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package guestexec import ( "bytes" "encoding/xml" "fmt" "log" "strings" "text/template" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" ) type ElevatedProvisioner interface { Communicator() packersdk.Communicator ElevatedUser() string ElevatedPassword() string } type elevatedOptions struct { User string Password string TaskName string TaskDescription string LogFile string XMLEscapedCommand string ScriptFile string } var psEscape = strings.NewReplacer( "$", "`$", "\"", "`\"", "`", "``", "'", "`'", ) var elevatedTemplate = template.Must(template.New("ElevatedCommand").Parse(` $name = "{{.TaskName}}" $log = [System.Environment]::ExpandEnvironmentVariables("{{.LogFile}}") $s = New-Object -ComObject "Schedule.Service" $s.Connect() $t = $s.NewTask($null) $xml = [xml]@' <?xml version="1.0" encoding="UTF-16"?> <Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> <RegistrationInfo> <Description>{{.TaskDescription}}</Description> </RegistrationInfo> <Principals> <Principal id="Author"> <UserId>{{.User}}</UserId> <LogonType>Password</LogonType> <RunLevel>HighestAvailable</RunLevel> </Principal> </Principals> <Settings> <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries> <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries> <AllowHardTerminate>true</AllowHardTerminate> <StartWhenAvailable>false</StartWhenAvailable> <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> <IdleSettings> <StopOnIdleEnd>false</StopOnIdleEnd> <RestartOnIdle>false</RestartOnIdle> </IdleSettings> <AllowStartOnDemand>true</AllowStartOnDemand> <Enabled>true</Enabled> <Hidden>false</Hidden> <RunOnlyIfIdle>false</RunOnlyIfIdle> <WakeToRun>false</WakeToRun> <ExecutionTimeLimit>PT0S</ExecutionTimeLimit> <Priority>4</Priority> </Settings> <Actions Context="Author"> <Exec> <Command>cmd</Command> <Arguments>/c {{.XMLEscapedCommand}}</Arguments> </Exec> </Actions> </Task> '@ $logon_type = 1 $password = "{{.Password}}" if ($password.Length -eq 0) { $logon_type = 5 $password = $null $ns = New-Object System.Xml.XmlNamespaceManager($xml.NameTable) $ns.AddNamespace("ns", $xml.DocumentElement.NamespaceURI) $node = $xml.SelectSingleNode("/ns:Task/ns:Principals/ns:Principal/ns:LogonType", $ns) $node.ParentNode.RemoveChild($node) | Out-Null } $t.XmlText = $xml.OuterXml if (Test-Path variable:global:ProgressPreference){$ProgressPreference="SilentlyContinue"} $f = $s.GetFolder("\") $f.RegisterTaskDefinition($name, $t, 6, "{{.User}}", $password, $logon_type, $null) | Out-Null $t = $f.GetTask("\$name") $t.Run($null) | Out-Null $timeout = 10 $sec = 0 while ((!($t.state -eq 4)) -and ($sec -lt $timeout)) { Start-Sleep -s 1 $sec++ } $line = 0 do { Start-Sleep -m 100 if (Test-Path $log) { Get-Content $log | select -skip $line | ForEach { $line += 1 Write-Output "$_" } } } while (!($t.state -eq 3)) $result = $t.LastTaskResult if (Test-Path $log) { Remove-Item $log -Force -ErrorAction SilentlyContinue | Out-Null } $script = [System.Environment]::ExpandEnvironmentVariables("{{.ScriptFile}}") if (Test-Path $script) { Remove-Item $script -Force -ErrorAction SilentlyContinue | Out-Null } $f = $s.GetFolder("\") $f.DeleteTask("\$name", "") [System.Runtime.Interopservices.Marshal]::ReleaseComObject($s) | Out-Null exit $result`)) func GenerateElevatedRunner(command string, p ElevatedProvisioner) (uploadedPath string, err error) { log.Printf("Building elevated command wrapper for: %s", command) var buffer bytes.Buffer // Output from the elevated command cannot be returned directly to the // Packer console. In order to be able to view output from elevated // commands and scripts an indirect approach is used by which the commands // output is first redirected to file. The output file is then 'watched' // by Packer while the elevated command is running and any content // appearing in the file is written out to the console. Below the portion // of command required to redirect output from the command to file is // built and appended to the existing command string taskName := fmt.Sprintf("packer-%s", uuid.TimeOrderedUUID()) // Only use %ENVVAR% format for environment variables when setting the log // file path; Do NOT use $env:ENVVAR format as it won't be expanded // correctly in the elevatedTemplate logFile := `%SYSTEMROOT%/Temp/` + taskName + ".out" command += fmt.Sprintf(" > %s 2>&1", logFile) // elevatedTemplate wraps the command in a single quoted XML text string // so we need to escape characters considered 'special' in XML. err = xml.EscapeText(&buffer, []byte(command)) if err != nil { return "", fmt.Errorf("Error escaping characters special to XML in command %s: %s", command, err) } escapedCommand := buffer.String() log.Printf("Command [%s] converted to [%s] for use in XML string", command, escapedCommand) buffer.Reset() // Escape chars special to PowerShell in the ElevatedUser string elevatedUser := p.ElevatedUser() escapedElevatedUser := psEscape.Replace(elevatedUser) if escapedElevatedUser != elevatedUser { log.Printf("Elevated user %s converted to %s after escaping chars special to PowerShell", elevatedUser, escapedElevatedUser) } // Escape chars special to PowerShell in the ElevatedPassword string elevatedPassword := p.ElevatedPassword() escapedElevatedPassword := psEscape.Replace(elevatedPassword) if escapedElevatedPassword != elevatedPassword { log.Printf("Elevated password %s converted to %s after escaping chars special to PowerShell", elevatedPassword, escapedElevatedPassword) } uuid := uuid.TimeOrderedUUID() path := fmt.Sprintf(`C:/Windows/Temp/packer-elevated-shell-%s.ps1`, uuid) // Generate command err = elevatedTemplate.Execute(&buffer, elevatedOptions{ User: escapedElevatedUser, Password: escapedElevatedPassword, TaskName: taskName, TaskDescription: "Packer elevated task", ScriptFile: path, LogFile: logFile, XMLEscapedCommand: escapedCommand, }) if err != nil { fmt.Printf("Error creating elevated template: %s", err) return "", err } log.Printf("Uploading elevated shell wrapper for command [%s] to [%s]", command, path) err = p.Communicator().Upload(path, &buffer, nil) if err != nil { return "", fmt.Errorf("Error preparing elevated powershell script: %s", err) } return fmt.Sprintf("powershell -executionpolicy bypass -file \"%s\"", path), err } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/guestexec/elevated_test.go���������������������������������������0000664�0000000�0000000�00000001456�13771713062�0024164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package guestexec import ( "regexp" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "inline": []interface{}{"foo", "bar"}, } } func TestProvisioner_GenerateElevatedRunner(t *testing.T) { // Non-elevated config := testConfig() p := new(packersdk.MockProvisioner) p.Prepare(config) comm := new(packersdk.MockCommunicator) p.ProvCommunicator = comm path, err := GenerateElevatedRunner("whoami", p) if err != nil { t.Fatalf("Did not expect error: %s", err.Error()) } if comm.UploadCalled != true { t.Fatalf("Should have uploaded file") } matched, _ := regexp.MatchString("C:/Windows/Temp/packer-elevated-shell.*", path) if !matched { t.Fatalf("Got unexpected file: %s", path) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/guestexec/guest_commands.go��������������������������������������0000664�0000000�0000000�00000004403�13771713062�0024337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package guestexec import ( "fmt" "strings" ) const UnixOSType = "unix" const WindowsOSType = "windows" const DefaultOSType = UnixOSType type guestOSTypeCommand struct { chmod string mkdir string removeDir string statPath string mv string } var guestOSTypeCommands = map[string]guestOSTypeCommand{ UnixOSType: { chmod: "chmod %s '%s'", mkdir: "mkdir -p '%s'", removeDir: "rm -rf '%s'", statPath: "stat '%s'", mv: "mv '%s' '%s'", }, WindowsOSType: { chmod: "echo 'skipping chmod %s %s'", // no-op mkdir: "powershell.exe -Command \"New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path %s\"", removeDir: "powershell.exe -Command \"rm %s -recurse -force\"", statPath: "powershell.exe -Command { if (test-path %s) { exit 0 } else { exit 1 } }", mv: "powershell.exe -Command \"mv %s %s -force\"", }, } type GuestCommands struct { GuestOSType string Sudo bool } func NewGuestCommands(osType string, sudo bool) (*GuestCommands, error) { _, ok := guestOSTypeCommands[osType] if !ok { return nil, fmt.Errorf("Invalid osType: \"%s\"", osType) } return &GuestCommands{GuestOSType: osType, Sudo: sudo}, nil } func (g *GuestCommands) Chmod(path string, mode string) string { return g.sudo(fmt.Sprintf(g.commands().chmod, mode, g.escapePath(path))) } func (g *GuestCommands) CreateDir(path string) string { return g.sudo(fmt.Sprintf(g.commands().mkdir, g.escapePath(path))) } func (g *GuestCommands) RemoveDir(path string) string { return g.sudo(fmt.Sprintf(g.commands().removeDir, g.escapePath(path))) } func (g *GuestCommands) commands() guestOSTypeCommand { return guestOSTypeCommands[g.GuestOSType] } func (g *GuestCommands) escapePath(path string) string { if g.GuestOSType == WindowsOSType { return strings.Replace(path, " ", "` ", -1) } return path } func (g *GuestCommands) StatPath(path string) string { return g.sudo(fmt.Sprintf(g.commands().statPath, g.escapePath(path))) } func (g *GuestCommands) MovePath(srcPath string, dstPath string) string { return g.sudo(fmt.Sprintf(g.commands().mv, g.escapePath(srcPath), g.escapePath(dstPath))) } func (g *GuestCommands) sudo(cmd string) string { if g.GuestOSType == UnixOSType && g.Sudo { return "sudo " + cmd } return cmd } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/guestexec/guest_commands_test.go���������������������������������0000664�0000000�0000000�00000014353�13771713062�0025403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package guestexec import ( "testing" ) func TestNewGuestCommands(t *testing.T) { _, err := NewGuestCommands("Amiga", true) if err == nil { t.Fatalf("Should have returned an err for unsupported OS type") } } func TestCreateDir(t *testing.T) { // *nix OS guestCmd, err := NewGuestCommands(UnixOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", UnixOSType) } cmd := guestCmd.CreateDir("/tmp/tempdir") if cmd != "mkdir -p '/tmp/tempdir'" { t.Fatalf("Unexpected Unix create dir cmd: %s", cmd) } // *nix OS w/sudo guestCmd, err = NewGuestCommands(UnixOSType, true) if err != nil { t.Fatalf("Failed to create new sudo GuestCommands for OS: %s", UnixOSType) } cmd = guestCmd.CreateDir("/tmp/tempdir") if cmd != "sudo mkdir -p '/tmp/tempdir'" { t.Fatalf("Unexpected Unix sudo create dir cmd: %s", cmd) } // Windows OS guestCmd, err = NewGuestCommands(WindowsOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", WindowsOSType) } cmd = guestCmd.CreateDir("C:\\Windows\\Temp\\tempdir") if cmd != "powershell.exe -Command \"New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path C:\\Windows\\Temp\\tempdir\"" { t.Fatalf("Unexpected Windows create dir cmd: %s", cmd) } // Windows OS w/ space in path cmd = guestCmd.CreateDir("C:\\Windows\\Temp\\temp dir") if cmd != "powershell.exe -Command \"New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path C:\\Windows\\Temp\\temp` dir\"" { t.Fatalf("Unexpected Windows create dir cmd: %s", cmd) } } func TestChmod(t *testing.T) { // *nix guestCmd, err := NewGuestCommands(UnixOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", UnixOSType) } cmd := guestCmd.Chmod("/usr/local/bin/script.sh", "0666") if cmd != "chmod 0666 '/usr/local/bin/script.sh'" { t.Fatalf("Unexpected Unix chmod 0666 cmd: %s", cmd) } // sudo *nix guestCmd, err = NewGuestCommands(UnixOSType, true) if err != nil { t.Fatalf("Failed to create new sudo GuestCommands for OS: %s", UnixOSType) } cmd = guestCmd.Chmod("/usr/local/bin/script.sh", "+x") if cmd != "sudo chmod +x '/usr/local/bin/script.sh'" { t.Fatalf("Unexpected Unix chmod +x cmd: %s", cmd) } // Windows guestCmd, err = NewGuestCommands(WindowsOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", WindowsOSType) } cmd = guestCmd.Chmod("C:\\Program Files\\SomeApp\\someapp.exe", "+x") if cmd != "echo 'skipping chmod +x C:\\Program` Files\\SomeApp\\someapp.exe'" { t.Fatalf("Unexpected Windows chmod +x cmd: %s", cmd) } } func TestRemoveDir(t *testing.T) { // *nix guestCmd, err := NewGuestCommands(UnixOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", UnixOSType) } cmd := guestCmd.RemoveDir("/tmp/somedir") if cmd != "rm -rf '/tmp/somedir'" { t.Fatalf("Unexpected Unix remove dir cmd: %s", cmd) } // sudo *nix guestCmd, err = NewGuestCommands(UnixOSType, true) if err != nil { t.Fatalf("Failed to create new sudo GuestCommands for OS: %s", UnixOSType) } cmd = guestCmd.RemoveDir("/tmp/somedir") if cmd != "sudo rm -rf '/tmp/somedir'" { t.Fatalf("Unexpected Unix sudo remove dir cmd: %s", cmd) } // Windows OS guestCmd, err = NewGuestCommands(WindowsOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", WindowsOSType) } cmd = guestCmd.RemoveDir("C:\\Temp\\SomeDir") if cmd != "powershell.exe -Command \"rm C:\\Temp\\SomeDir -recurse -force\"" { t.Fatalf("Unexpected Windows remove dir cmd: %s", cmd) } // Windows OS w/ space in path cmd = guestCmd.RemoveDir("C:\\Temp\\Some Dir") if cmd != "powershell.exe -Command \"rm C:\\Temp\\Some` Dir -recurse -force\"" { t.Fatalf("Unexpected Windows remove dir cmd: %s", cmd) } } func TestStatPath(t *testing.T) { // *nix guestCmd, err := NewGuestCommands(UnixOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", UnixOSType) } cmd := guestCmd.StatPath("/tmp/somedir") if cmd != "stat '/tmp/somedir'" { t.Fatalf("Unexpected Unix stat cmd: %s", cmd) } guestCmd, err = NewGuestCommands(UnixOSType, true) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", UnixOSType) } cmd = guestCmd.StatPath("/tmp/somedir") if cmd != "sudo stat '/tmp/somedir'" { t.Fatalf("Unexpected Unix stat cmd: %s", cmd) } // Windows OS guestCmd, err = NewGuestCommands(WindowsOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", WindowsOSType) } cmd = guestCmd.StatPath("C:\\Temp\\SomeDir") if cmd != "powershell.exe -Command { if (test-path C:\\Temp\\SomeDir) { exit 0 } else { exit 1 } }" { t.Fatalf("Unexpected Windows stat cmd: %s", cmd) } // Windows OS w/ space in path cmd = guestCmd.StatPath("C:\\Temp\\Some Dir") if cmd != "powershell.exe -Command { if (test-path C:\\Temp\\Some` Dir) { exit 0 } else { exit 1 } }" { t.Fatalf("Unexpected Windows stat cmd: %s", cmd) } } func TestMovePath(t *testing.T) { // *nix guestCmd, err := NewGuestCommands(UnixOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", UnixOSType) } cmd := guestCmd.MovePath("/tmp/somedir", "/tmp/newdir") if cmd != "mv '/tmp/somedir' '/tmp/newdir'" { t.Fatalf("Unexpected Unix move cmd: %s", cmd) } // sudo *nix guestCmd, err = NewGuestCommands(UnixOSType, true) if err != nil { t.Fatalf("Failed to create new sudo GuestCommands for OS: %s", UnixOSType) } cmd = guestCmd.MovePath("/tmp/somedir", "/tmp/newdir") if cmd != "sudo mv '/tmp/somedir' '/tmp/newdir'" { t.Fatalf("Unexpected Unix sudo mv cmd: %s", cmd) } // Windows OS guestCmd, err = NewGuestCommands(WindowsOSType, false) if err != nil { t.Fatalf("Failed to create new GuestCommands for OS: %s", WindowsOSType) } cmd = guestCmd.MovePath("C:\\Temp\\SomeDir", "C:\\Temp\\NewDir") if cmd != "powershell.exe -Command \"mv C:\\Temp\\SomeDir C:\\Temp\\NewDir -force\"" { t.Fatalf("Unexpected Windows remove dir cmd: %s", cmd) } // Windows OS w/ space in path cmd = guestCmd.MovePath("C:\\Temp\\Some Dir", "C:\\Temp\\New Dir") if cmd != "powershell.exe -Command \"mv C:\\Temp\\Some` Dir C:\\Temp\\New` Dir -force\"" { t.Fatalf("Unexpected Windows remove dir cmd: %s", cmd) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/iochan/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020244�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/iochan/iochan.go�������������������������������������������������0000664�0000000�0000000�00000001206�13771713062�0022033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package iochan import ( "bufio" "io" ) // LineReader takes an io.Reader and produces the contents of the reader on the // returned channel. Internally bufio.NewScanner is used, io.ScanLines parses // lines and returns them without carriage return. Scan can panic if the split // function returns too many empty tokens without advancing the input. // // The channel will be closed either by reaching the end of the input or an // error. func LineReader(r io.Reader) <-chan string { ch := make(chan string) go func() { scanner := bufio.NewScanner(r) defer close(ch) for scanner.Scan() { ch <- scanner.Text() } }() return ch } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/iochan/iochan_test.go��������������������������������������������0000664�0000000�0000000�00000000663�13771713062�0023100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package iochan import ( "bytes" "reflect" "strings" "testing" ) func TestLineReader(t *testing.T) { data := []string{"foo", "bar", "baz"} buf := new(bytes.Buffer) buf.WriteString(strings.Join(data, "\n") + "\n") ch := LineReader(buf) var result []string expected := data for v := range ch { result = append(result, v) } if !reflect.DeepEqual(result, expected) { t.Fatalf("unexpected results: %#v", result) } } �����������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/json/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017754�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/json/unmarshal.go������������������������������������������������0000664�0000000�0000000�00000002015�13771713062�0022273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "bytes" "encoding/json" "fmt" ) // Unmarshal is wrapper around json.Unmarshal that returns user-friendly // errors when there are syntax errors. func Unmarshal(data []byte, i interface{}) error { err := json.Unmarshal(data, i) if err != nil { syntaxErr, ok := err.(*json.SyntaxError) if !ok { return err } // We have a syntax error. Extract out the line number and friends. // https://groups.google.com/forum/#!topic/golang-nuts/fizimmXtVfc newline := []byte{'\x0a'} // Calculate the start/end position of the line where the error is start := bytes.LastIndex(data[:syntaxErr.Offset], newline) + 1 end := len(data) if idx := bytes.Index(data[start:], newline); idx >= 0 { end = start + idx } // Count the line number we're on plus the offset in the line line := bytes.Count(data[:start], newline) + 1 pos := int(syntaxErr.Offset) - start - 1 err = fmt.Errorf("Error in line %d, char %d: %s\n%s", line, pos, syntaxErr, data[start:end]) return err } return nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/json/unmarshal_test.go�������������������������������������������0000664�0000000�0000000�00000000015�13771713062�0023330�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021031�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/LICENSE.md���������������������������������������������0000664�0000000�0000000�00000002063�13771713062�0022436�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright (c) 2013 Mitchell Hashimoto MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/basic_runner.go����������������������������������������0000664�0000000�0000000�00000002750�13771713062�0024036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep import ( "context" "sync" "sync/atomic" ) type runState int32 const ( stateIdle runState = iota stateRunning stateCancelling ) // BasicRunner is a Runner that just runs the given slice of steps. type BasicRunner struct { // Steps is a slice of steps to run. Once set, this should _not_ be // modified. Steps []Step l sync.Mutex state runState } func (b *BasicRunner) Run(ctx context.Context, state StateBag) { b.l.Lock() if b.state != stateIdle { panic("already running") } doneCh := make(chan struct{}) b.state = stateRunning b.l.Unlock() defer func() { b.l.Lock() b.state = stateIdle close(doneCh) b.l.Unlock() }() // This goroutine listens for cancels and puts the StateCancelled key // as quickly as possible into the state bag to mark it. go func() { select { case <-ctx.Done(): state.Put(StateCancelled, true) case <-doneCh: } }() for _, step := range b.Steps { if step == nil { continue } if err := ctx.Err(); err != nil { state.Put(StateCancelled, true) break } // We also check for cancellation here since we can't be sure // the goroutine that is running to set it actually ran. if runState(atomic.LoadInt32((*int32)(&b.state))) == stateCancelling { state.Put(StateCancelled, true) break } action := step.Run(ctx, state) defer step.Cleanup(state) if _, ok := state.GetOk(StateCancelled); ok { break } if action == ActionHalt { state.Put(StateHalted, true) break } } } ������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/basic_runner_test.go�����������������������������������0000664�0000000�0000000�00000010065�13771713062�0025073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep import ( "context" "reflect" "testing" ) func TestBasicRunner_ImplRunner(t *testing.T) { var raw interface{} raw = &BasicRunner{} if _, ok := raw.(Runner); !ok { t.Fatalf("BasicRunner must be a Runner") } } func TestBasicRunner_Run(t *testing.T) { data := new(BasicStateBag) stepA := &TestStepAcc{Data: "a"} stepB := &TestStepAcc{Data: "b"} r := &BasicRunner{Steps: []Step{stepA, stepB}} r.Run(context.Background(), data) // Test run data expected := []string{"a", "b"} results := data.Get("data").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test cleanup data expected = []string{"b", "a"} results = data.Get("cleanup").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test no halted or cancelled if _, ok := data.GetOk(StateCancelled); ok { t.Errorf("cancelled should not be in state bag") } if _, ok := data.GetOk(StateHalted); ok { t.Errorf("halted should not be in state bag") } } func TestBasicRunner_Run_Halt(t *testing.T) { data := new(BasicStateBag) stepA := &TestStepAcc{Data: "a"} stepB := &TestStepAcc{Data: "b", Halt: true} stepC := &TestStepAcc{Data: "c"} r := &BasicRunner{Steps: []Step{stepA, stepB, stepC}} r.Run(context.Background(), data) // Test run data expected := []string{"a", "b"} results := data.Get("data").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test cleanup data expected = []string{"b", "a"} results = data.Get("cleanup").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test that it says it is halted halted := data.Get(StateHalted).(bool) if !halted { t.Errorf("not halted") } } // confirm that can't run twice func TestBasicRunner_Run_Run(t *testing.T) { defer func() { recover() }() ch := make(chan chan bool) stepInt := &TestStepSync{ch} stepWait := &TestStepWaitForever{} r := &BasicRunner{Steps: []Step{stepInt, stepWait}} go r.Run(context.Background(), new(BasicStateBag)) // wait until really running <-ch // now try to run aain r.Run(context.Background(), new(BasicStateBag)) // should not get here in nominal codepath t.Errorf("Was able to run an already running BasicRunner") } func TestBasicRunner_Cancel(t *testing.T) { topCtx, topCtxCancel := context.WithCancel(context.Background()) checkCancelled := func(data StateBag) { cancelled := data.Get(StateCancelled).(bool) if !cancelled { t.Fatal("state should be cancelled") } } data := new(BasicStateBag) r := &BasicRunner{} r.Steps = []Step{ &TestStepAcc{Data: "a"}, &TestStepAcc{Data: "b"}, TestStepFn{ run: func(ctx context.Context, sb StateBag) StepAction { return ActionContinue }, cleanup: checkCancelled, }, TestStepFn{ run: func(ctx context.Context, sb StateBag) StepAction { topCtxCancel() <-ctx.Done() return ActionContinue }, cleanup: checkCancelled, }, TestStepFn{ run: func(context.Context, StateBag) StepAction { t.Fatal("I should not be called") return ActionContinue }, cleanup: func(StateBag) { t.Fatal("I should not be called") }, }, } r.Run(topCtx, data) // Test run data expected := []string{"a", "b"} results := data.Get("data").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test cleanup data expected = []string{"b", "a"} results = data.Get("cleanup").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test that it says it is cancelled checkCancelled(data) } func TestBasicRunner_Cancel_Special(t *testing.T) { stepOne := &TestStepInjectCancel{} stepTwo := &TestStepInjectCancel{} r := &BasicRunner{Steps: []Step{stepOne, stepTwo}} state := new(BasicStateBag) state.Put("runner", r) r.Run(context.Background(), state) // test that state contains cancelled if _, ok := state.GetOk(StateCancelled); !ok { t.Errorf("cancelled should be in state bag") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/�������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023400�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/doc.go�������������������������������������0000664�0000000�0000000�00000001361�13771713062�0024475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* The commonsteps package contains the multistep runner that comprises the main architectural convention of Packer builder plugins. It enables builders to respect global Packer flags like "on-error" and "debug". It also contains a selection of convenience "multistep" steps that perform globally relevant tasks that many or most builders will want to implement -- for example, launching Packer's internal HTTP server for serving files to the instance. It also provides step_provision, which contains the hooks necessary for allowing provisioners to run inside your builder. While it is possible to create a simple builder without using the multistep runner or step_provision, your builder will lack core Packer functionality. */ package commonsteps �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/extra_iso_config.go������������������������0000664�0000000�0000000�00000005522�13771713062�0027255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package commonsteps import ( "fmt" "os" "path/filepath" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // An iso (CD) containing custom files can be made available for your build. // // By default, no extra CD will be attached. All files listed in this setting // get placed into the root directory of the CD and the CD is attached as the // second CD device. // // This config exists to work around modern operating systems that have no // way to mount floppy disks, which was our previous go-to for adding files at // boot time. type CDConfig struct { // A list of files to place onto a CD that is attached when the VM is // booted. This can include either files or directories; any directories // will be copied onto the CD recursively, preserving directory structure // hierarchy. Symlinks will have the link's target copied into the directory // tree on the CD where the symlink was. File globbing is allowed. // // Usage example (JSON): // // ```json // "cd_files": ["./somedirectory/meta-data", "./somedirectory/user-data"], // "cd_label": "cidata", // ``` // // Usage example (HCL): // // ```hcl // cd_files = ["./somedirectory/meta-data", "./somedirectory/user-data"] // cd_label = "cidata" // ``` // // The above will create a CD with two files, user-data and meta-data in the // CD root. This specific example is how you would create a CD that can be // used for an Ubuntu 20.04 autoinstall. // // Since globbing is also supported, // // ```hcl // cd_files = ["./somedirectory/*"] // cd_label = "cidata" // ``` // // Would also be an acceptable way to define the above cd. The difference // between providing the directory with or without the glob is whether the // directory itself or its contents will be at the CD root. // // Use of this option assumes that you have a command line tool installed // that can handle the iso creation. Packer will use one of the following // tools: // // * xorriso // * mkisofs // * hdiutil (normally found in macOS) // * oscdimg (normally found in Windows as part of the Windows ADK) CDFiles []string `mapstructure:"cd_files"` CDLabel string `mapstructure:"cd_label"` } func (c *CDConfig) Prepare(ctx *interpolate.Context) []error { var errs []error var err error if c.CDFiles == nil { c.CDFiles = make([]string, 0) } // Create new file list based on globbing. var files []string for _, path := range c.CDFiles { if strings.ContainsAny(path, "*?[") { var globbedFiles []string globbedFiles, err = filepath.Glob(path) if len(globbedFiles) > 0 { files = append(files, globbedFiles...) } } else { _, err = os.Stat(path) files = append(files, path) } if err != nil { errs = append(errs, fmt.Errorf("Bad CD disk file '%s': %s", path, err)) } c.CDFiles = files } return errs } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/extra_iso_config_test.go�������������������0000664�0000000�0000000�00000004060�13771713062�0030310�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "testing" "github.com/stretchr/testify/assert" ) func TestCDPrepare(t *testing.T) { type testCases struct { CDConfig CDConfig ErrExpected bool Reason string ExpectedCDFiles []string } tcs := []testCases{ { CDConfig: CDConfig{}, ErrExpected: false, Reason: "TestNilCD: nil CD array should not fail", ExpectedCDFiles: []string{}, }, { CDConfig: CDConfig{CDFiles: make([]string, 0)}, ErrExpected: false, Reason: "TestEmptyArrayCD: empty CD array should never fail", ExpectedCDFiles: []string{}, }, { CDConfig: CDConfig{CDFiles: []string{"extra_iso_config.go"}}, ErrExpected: false, Reason: "TestExistingCDFile: array with existing CD should not fail", ExpectedCDFiles: []string{"extra_iso_config.go"}, }, { CDConfig: CDConfig{CDFiles: []string{"does_not_exist.foo"}}, ErrExpected: true, Reason: "TestNonExistingCDFile: array with non existing CD should return errors", ExpectedCDFiles: []string{"does_not_exist.foo"}, }, { CDConfig: CDConfig{CDFiles: []string{"extra_iso_config*"}}, ErrExpected: false, Reason: "TestGlobbingCDFile: Glob should work", ExpectedCDFiles: []string{"extra_iso_config.go", "extra_iso_config_test.go"}, }, } for _, tc := range tcs { c := tc.CDConfig errs := c.Prepare(nil) if (len(errs) != 0) != tc.ErrExpected { t.Fatal(tc.Reason) } assert.Equal(t, c.CDFiles, tc.ExpectedCDFiles) } } func TestMultiErrorCDFiles(t *testing.T) { c := CDConfig{ CDFiles: []string{"extra_iso_config.foo", "extra_iso_config.go", "extra_iso_config.bar", "extra_iso_config_test.go", "extra_iso_config.baz"}, } errs := c.Prepare(nil) if len(errs) == 0 { t.Fatal("array with non existing CD should return errors") } expectedErrors := 3 if count := len(errs); count != expectedErrors { t.Fatalf("array with %v non existing CD should return %v errors but it is returning %v", expectedErrors, expectedErrors, count) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/floppy_config.go���������������������������0000664�0000000�0000000�00000004700�13771713062�0026566�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package commonsteps import ( "fmt" "os" "path/filepath" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // A floppy can be made available for your build. This is most useful for // unattended Windows installs, which look for an Autounattend.xml file on // removable media. By default, no floppy will be attached. All files listed in // this setting get placed into the root directory of the floppy and the floppy // is attached as the first floppy device. The summary size of the listed files // must not exceed 1.44 MB. The supported ways to move large files into the OS // are using `http_directory` or [the file // provisioner](/docs/provisioners/file). type FloppyConfig struct { // A list of files to place onto a floppy disk that is attached when the VM // is booted. Currently, no support exists for creating sub-directories on // the floppy. Wildcard characters (\\*, ?, and \[\]) are allowed. Directory // names are also allowed, which will add all the files found in the // directory to the floppy. FloppyFiles []string `mapstructure:"floppy_files"` // A list of directories to place onto the floppy disk recursively. This is // similar to the `floppy_files` option except that the directory structure // is preserved. This is useful for when your floppy disk includes drivers // or if you just want to organize it's contents as a hierarchy. Wildcard // characters (\\*, ?, and \[\]) are allowed. The maximum summary size of // all files in the listed directories are the same as in `floppy_files`. FloppyDirectories []string `mapstructure:"floppy_dirs"` FloppyLabel string `mapstructure:"floppy_label"` } func (c *FloppyConfig) Prepare(ctx *interpolate.Context) []error { var errs []error var err error if c.FloppyFiles == nil { c.FloppyFiles = make([]string, 0) } for _, path := range c.FloppyFiles { if strings.ContainsAny(path, "*?[") { _, err = filepath.Glob(path) } else { _, err = os.Stat(path) } if err != nil { errs = append(errs, fmt.Errorf("Bad Floppy disk file '%s': %s", path, err)) } } if c.FloppyDirectories == nil { c.FloppyDirectories = make([]string, 0) } for _, path := range c.FloppyDirectories { if strings.ContainsAny(path, "*?[") { _, err = filepath.Glob(path) } else { _, err = os.Stat(path) } if err != nil { errs = append(errs, fmt.Errorf("Bad Floppy disk directory '%s': %s", path, err)) } } return errs } ����������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/floppy_config_test.go����������������������0000664�0000000�0000000�00000003025�13771713062�0027624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "testing" ) func TestNilFloppies(t *testing.T) { c := FloppyConfig{} errs := c.Prepare(nil) if len(errs) != 0 { t.Fatal("nil floppies array should not fail") } if len(c.FloppyFiles) > 0 { t.Fatal("struct should not have floppy files") } } func TestEmptyArrayFloppies(t *testing.T) { c := FloppyConfig{ FloppyFiles: make([]string, 0), } errs := c.Prepare(nil) if len(errs) != 0 { t.Fatal("empty floppies array should never fail") } if len(c.FloppyFiles) > 0 { t.Fatal("struct should not have floppy files") } } func TestExistingFloppyFile(t *testing.T) { c := FloppyConfig{ FloppyFiles: []string{"floppy_config.go"}, } errs := c.Prepare(nil) if len(errs) != 0 { t.Fatal("array with existing floppies should not fail") } } func TestNonExistingFloppyFile(t *testing.T) { c := FloppyConfig{ FloppyFiles: []string{"floppy_config.foo"}, } errs := c.Prepare(nil) if len(errs) == 0 { t.Fatal("array with non existing floppies should return errors") } } func TestMultiErrorFloppyFiles(t *testing.T) { c := FloppyConfig{ FloppyFiles: []string{"floppy_config.foo", "floppy_config.go", "floppy_config.bar", "floppy_config_test.go", "floppy_config.baz"}, } errs := c.Prepare(nil) if len(errs) == 0 { t.Fatal("array with non existing floppies should return errors") } expectedErrors := 3 if count := len(errs); count != expectedErrors { t.Fatalf("array with %v non existing floppy should return %v errors but it is returning %v", expectedErrors, expectedErrors, count) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/http_config.go�����������������������������0000664�0000000�0000000�00000004666�13771713062�0026247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package commonsteps import ( "errors" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // Packer will create an http server serving `http_directory` when it is set, a // random free port will be selected and the architecture of the directory // referenced will be available in your builder. // // Example usage from a builder: // // `wget http://{{ .HTTPIP }}:{{ .HTTPPort }}/foo/bar/preseed.cfg` type HTTPConfig struct { // Path to a directory to serve using an HTTP server. The files in this // directory will be available over HTTP that will be requestable from the // virtual machine. This is useful for hosting kickstart files and so on. // By default this is an empty string, which means no HTTP server will be // started. The address and port of the HTTP server will be available as // variables in `boot_command`. This is covered in more detail below. HTTPDir string `mapstructure:"http_directory"` // These are the minimum and maximum port to use for the HTTP server // started to serve the `http_directory`. Because Packer often runs in // parallel, Packer will choose a randomly available port in this range to // run the HTTP server. If you want to force the HTTP server to be on one // port, make this minimum and maximum port the same. By default the values // are `8000` and `9000`, respectively. HTTPPortMin int `mapstructure:"http_port_min"` HTTPPortMax int `mapstructure:"http_port_max"` // This is the bind address for the HTTP server. Defaults to 0.0.0.0 so that // it will work with any network interface. HTTPAddress string `mapstructure:"http_bind_address"` // This is the bind interface for the HTTP server. Defaults to the first // interface with a non-loopback address. Either `http_bind_address` or // `http_interface` can be specified. HTTPInterface string `mapstructure:"http_interface" undocumented:"true"` } func (c *HTTPConfig) Prepare(ctx *interpolate.Context) []error { // Validation var errs []error if c.HTTPPortMin == 0 { c.HTTPPortMin = 8000 } if c.HTTPPortMax == 0 { c.HTTPPortMax = 9000 } if c.HTTPAddress == "" { c.HTTPAddress = "0.0.0.0" } if c.HTTPPortMin > c.HTTPPortMax { errs = append(errs, errors.New("http_port_min must be less than http_port_max")) } if c.HTTPInterface != "" && c.HTTPAddress == "0.0.0.0" { errs = append(errs, errors.New("either http_interface of http_bind_address can be specified")) } return errs } ��������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/http_config_test.go������������������������0000664�0000000�0000000�00000001450�13771713062�0027272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "testing" ) func TestHTTPConfigPrepare_Bounds(t *testing.T) { // Test bad h := HTTPConfig{ HTTPPortMin: 1000, HTTPPortMax: 500, } err := h.Prepare(nil) if err == nil { t.Fatal("should have error") } // Test good h = HTTPConfig{ HTTPPortMin: 0, HTTPPortMax: 0, } err = h.Prepare(nil) if err != nil { t.Fatalf("should not have error: %s", err) } portMin := 8000 if h.HTTPPortMin != portMin { t.Fatalf("HTTPPortMin: expected %d got %d", portMin, h.HTTPPortMin) } portMax := 9000 if h.HTTPPortMax != portMax { t.Fatalf("HTTPPortMax: expected %d got %d", portMax, h.HTTPPortMax) } // Test good h = HTTPConfig{ HTTPPortMin: 500, HTTPPortMax: 1000, } err = h.Prepare(nil) if err != nil { t.Fatalf("should not have error: %s", err) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/iso_config.go������������������������������0000664�0000000�0000000�00000014520�13771713062�0026050�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package commonsteps import ( "context" "errors" "fmt" "log" "os" "strings" getter "github.com/hashicorp/go-getter/v2" urlhelper "github.com/hashicorp/go-getter/v2/helper/url" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // By default, Packer will symlink, download or copy image files to the Packer // cache into a "`hash($iso_url+$iso_checksum).$iso_target_extension`" file. // Packer uses [hashicorp/go-getter](https://github.com/hashicorp/go-getter) in // file mode in order to perform a download. // // go-getter supports the following protocols: // // * Local files // * Git // * Mercurial // * HTTP // * Amazon S3 // // Examples: // go-getter can guess the checksum type based on `iso_checksum` length, and it is // also possible to specify the checksum type. // // In JSON: // // ```json // "iso_checksum": "946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2", // "iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // // ```json // "iso_checksum": "file:ubuntu.org/..../ubuntu-14.04.1-server-amd64.iso.sum", // "iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // // ```json // "iso_checksum": "file://./shasums.txt", // "iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // // ```json // "iso_checksum": "file:./shasums.txt", // "iso_url": "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // // In HCL2: // // ```hcl // iso_checksum = "946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2" // iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // // ```hcl // iso_checksum = "file:ubuntu.org/..../ubuntu-14.04.1-server-amd64.iso.sum" // iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // // ```hcl // iso_checksum = "file://./shasums.txt" // iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // // ```hcl // iso_checksum = "file:./shasums.txt", // iso_url = "ubuntu.org/.../ubuntu-14.04.1-server-amd64.iso" // ``` // type ISOConfig struct { // The checksum for the ISO file or virtual hard drive file. The type of // the checksum is specified within the checksum field as a prefix, ex: // "md5:{$checksum}". The type of the checksum can also be omitted and // Packer will try to infer it based on string length. Valid values are // "none", "{$checksum}", "md5:{$checksum}", "sha1:{$checksum}", // "sha256:{$checksum}", "sha512:{$checksum}" or "file:{$path}". Here is a // list of valid checksum values: // * md5:090992ba9fd140077b0661cb75f7ce13 // * 090992ba9fd140077b0661cb75f7ce13 // * sha1:ebfb681885ddf1234c18094a45bbeafd91467911 // * ebfb681885ddf1234c18094a45bbeafd91467911 // * sha256:ed363350696a726b7932db864dda019bd2017365c9e299627830f06954643f93 // * ed363350696a726b7932db864dda019bd2017365c9e299627830f06954643f93 // * file:http://releases.ubuntu.com/20.04/MD5SUMS // * file:file://./local/path/file.sum // * file:./local/path/file.sum // * none // Although the checksum will not be verified when it is set to "none", // this is not recommended since these files can be very large and // corruption does happen from time to time. ISOChecksum string `mapstructure:"iso_checksum" required:"true"` // A URL to the ISO containing the installation image or virtual hard drive // (VHD or VHDX) file to clone. RawSingleISOUrl string `mapstructure:"iso_url" required:"true"` // Multiple URLs for the ISO to download. Packer will try these in order. // If anything goes wrong attempting to download or while downloading a // single URL, it will move on to the next. All URLs must point to the same // file (same checksum). By default this is empty and `iso_url` is used. // Only one of `iso_url` or `iso_urls` can be specified. ISOUrls []string `mapstructure:"iso_urls"` // The path where the iso should be saved after download. By default will // go in the packer cache, with a hash of the original filename and // checksum as its name. TargetPath string `mapstructure:"iso_target_path"` // The extension of the iso file after download. This defaults to `iso`. TargetExtension string `mapstructure:"iso_target_extension"` } func (c *ISOConfig) Prepare(*interpolate.Context) (warnings []string, errs []error) { if len(c.ISOUrls) != 0 && c.RawSingleISOUrl != "" { errs = append( errs, errors.New("Only one of iso_url or iso_urls must be specified")) return } if c.RawSingleISOUrl != "" { // make sure only array is set c.ISOUrls = append([]string{c.RawSingleISOUrl}, c.ISOUrls...) c.RawSingleISOUrl = "" } if len(c.ISOUrls) == 0 { errs = append( errs, errors.New("One of iso_url or iso_urls must be specified")) return } if c.TargetExtension == "" { c.TargetExtension = "iso" } c.TargetExtension = strings.ToLower(c.TargetExtension) // Warnings if c.ISOChecksum == "none" { warnings = append(warnings, "A checksum of 'none' was specified. Since ISO files are so big,\n"+ "a checksum is highly recommended.") return warnings, errs } else if c.ISOChecksum == "" { errs = append(errs, fmt.Errorf("A checksum must be specified")) } else { // ESX5Driver.VerifyChecksum is ran remotely but should not download a // checksum file, therefore in case it is a file, we need to download // it now and compute the checksum now, we transform it back to a // checksum string so that it can be simply read in the VerifyChecksum. // // Doing this also has the added benefit of failing early if a checksum // is incorrect or if getting it should fail. u, err := urlhelper.Parse(c.ISOUrls[0]) if err != nil { return warnings, append(errs, fmt.Errorf("url parse: %s", err)) } q := u.Query() if c.ISOChecksum != "" { q.Set("checksum", c.ISOChecksum) } u.RawQuery = q.Encode() wd, err := os.Getwd() if err != nil { log.Printf("Getwd: %v", err) // here we ignore the error in case the // working directory is not needed. } req := &getter.Request{ Src: u.String(), Pwd: wd, } cksum, err := defaultGetterClient.GetChecksum(context.TODO(), req) if err != nil { errs = append(errs, fmt.Errorf("%v in %q", err, req.URL().Query().Get("checksum"))) } else { c.ISOChecksum = cksum.String() } } if strings.HasSuffix(strings.ToLower(c.ISOChecksum), ".iso") { errs = append(errs, fmt.Errorf("Error parsing checksum:"+ " .iso is not a valid checksum ending")) } return warnings, errs } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/iso_config_test.go�������������������������0000664�0000000�0000000�00000013710�13771713062�0027107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !windows package commonsteps import ( "io" "net/http" "net/http/httptest" "os" "path/filepath" "reflect" "testing" ) func testISOConfig() ISOConfig { return ISOConfig{ ISOChecksum: "md5:0B0F137F17AC10944716020B018F8126", RawSingleISOUrl: "http://www.packer.io/the-OS.iso", } } var cs_bsd_style = ` MD5 (other.iso) = bAr MD5 (the-OS.iso) = baZ ` var cs_bsd_style_subdir = ` MD5 (other.iso) = bAr MD5 (./subdir/the-OS.iso) = baZ ` var cs_gnu_style = ` bAr0 *the-OS.iso baZ0 other.iso ` var cs_gnu_style_subdir = ` bAr0 *./subdir/the-OS.iso baZ0 other.iso ` var cs_bsd_style_no_newline = ` MD5 (other.iso) = bAr MD5 (the-OS.iso) = baZ` var cs_gnu_style_no_newline = ` bAr0 *the-OS.iso baZ0 other.iso` func TestISOConfigPrepare_ISOChecksum(t *testing.T) { i := testISOConfig() // Test bad i.ISOChecksum = "" warns, err := i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err == nil { t.Fatal("should have error") } // Test good i = testISOConfig() i.ISOChecksum = "0b0F137F17AC10944716020B018F8126" warns, err = i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err != nil { t.Fatalf("should not have error: %s", err) } } func TestISOConfigPrepare_ISOChecksumURLBad(t *testing.T) { // Test that we won't try to read an iso into memory because of a user // error i := testISOConfig() i.ISOChecksum = "file:///not_a_checksum.iso" _, err := i.Prepare(nil) if err == nil { t.Fatalf("should have error because iso is bad filetype: %s", err) } } func TestISOConfigPrepare_ISOChecksumType(t *testing.T) { i := testISOConfig() // Test none i = testISOConfig() i.ISOChecksum = "none" warns, err := i.Prepare(nil) if len(warns) == 0 { t.Fatalf("bad: %#v", warns) } if err != nil { t.Fatalf("should not have error: %s", err) } } func TestISOConfigPrepare_ISOUrl(t *testing.T) { i := testISOConfig() // Test both empty i.RawSingleISOUrl = "" i.ISOUrls = []string{} warns, err := i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err == nil { t.Fatal("should have error") } // Test iso_url not set but checksum url is ts := httpTestModule("root") defer ts.Close() i = testISOConfig() i.RawSingleISOUrl = "" i.ISOChecksum = "file:" + ts.URL + "/basic.txt" // ISOConfig.Prepare() returns a slice of errors var errs []error warns, errs = i.Prepare(nil) if len(warns) > 0 { t.Fatalf("expected no warnings, got:%v", warns) } if len(errs) < 1 || err[0] == nil { t.Fatalf("expected a populated error slice, got: %v", errs) } // Test iso_url set i = testISOConfig() i.RawSingleISOUrl = "http://www.packer.io/the-OS.iso" warns, err = i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err != nil { t.Errorf("should not have error: %s", err) } expected := []string{"http://www.packer.io/the-OS.iso"} if !reflect.DeepEqual(i.ISOUrls, expected) { t.Fatalf("bad: %#v", i.ISOUrls) } // Test both set i = testISOConfig() i.RawSingleISOUrl = "http://www.packer.io/the-OS.iso" i.ISOUrls = []string{"http://www.packer.io/the-OS.iso"} warns, err = i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err == nil { t.Fatal("should have error") } // Test just iso_urls set i = testISOConfig() i.RawSingleISOUrl = "" i.ISOUrls = []string{ "http://www.packer.io/the-OS.iso", "http://www.hashicorp.com/the-OS.iso", } warns, err = i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err != nil { t.Errorf("should not have error: %s", err) } expected = []string{ "http://www.packer.io/the-OS.iso", "http://www.hashicorp.com/the-OS.iso", } if !reflect.DeepEqual(i.ISOUrls, expected) { t.Fatalf("bad: %#v", i.ISOUrls) } } func TestISOConfigPrepare_TargetExtension(t *testing.T) { i := testISOConfig() // Test the default value warns, err := i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err != nil { t.Fatalf("should not have error: %s", err) } if i.TargetExtension != "iso" { t.Fatalf("should've found \"iso\" got: %s", i.TargetExtension) } // Test the lowercased value i = testISOConfig() i.TargetExtension = "DMG" warns, err = i.Prepare(nil) if len(warns) > 0 { t.Fatalf("bad: %#v", warns) } if err != nil { t.Fatalf("should not have error: %s", err) } if i.TargetExtension != "dmg" { t.Fatalf("should've lowercased: %s", i.TargetExtension) } } func TestISOConfigPrepare_ISOChecksumURLMyTest(t *testing.T) { httpChecksums := httpTestModule("root") defer httpChecksums.Close() i := ISOConfig{ ISOChecksum: "file:" + httpChecksums.URL + "/subfolder.sum", ISOUrls: []string{"http://hashicorp.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso"}, } // Test ISOChecksum overrides url warns, err := i.Prepare(nil) if len(warns) > 0 { t.Fatalf("Bad: should not have warnings") } if len(err) > 0 { t.Fatalf("Bad; should not have errored.") } } func TestISOConfigPrepare_ISOChecksumLocalFile(t *testing.T) { // Creates checksum file in local dir p := filepath.Join(fixtureDir, "root/subfolder.sum") source, err := os.Open(p) if err != nil { t.Fatalf(err.Error()) } defer source.Close() destination, err := os.Create("local.sum") if err != nil { t.Fatalf(err.Error()) } defer os.Remove("local.sum") defer destination.Close() if _, err := io.Copy(destination, source); err != nil { t.Fatalf(err.Error()) } i := ISOConfig{ ISOChecksum: "file:./local.sum", ISOUrls: []string{"http://hashicorp.com/ubuntu/dists/bionic-updates/main/installer-amd64/current/images/netboot/mini.iso"}, } warns, errs := i.Prepare(nil) if len(warns) > 0 { t.Fatalf("Bad: should not have warnings") } if len(errs) > 0 { t.Fatalf("Bad; should not have errored. %v", errs) } } const fixtureDir = "./test-fixtures" func httpTestModule(n string) *httptest.Server { p := filepath.Join(fixtureDir, n) p, err := filepath.Abs(p) if err != nil { panic(err) } return httptest.NewServer(http.FileServer(http.Dir(p))) } ��������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/multistep_debug.go�������������������������0000664�0000000�0000000�00000002226�13771713062�0027125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "fmt" "log" "time" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // MultistepDebugFn will return a proper multistep.DebugPauseFn to // use for debugging if you're using multistep in your builder. func MultistepDebugFn(ui packersdk.Ui) multistep.DebugPauseFn { return func(loc multistep.DebugLocation, name string, state multistep.StateBag) { var locationString string switch loc { case multistep.DebugLocationAfterRun: locationString = "after run of" case multistep.DebugLocationBeforeCleanup: locationString = "before cleanup of" default: locationString = "at" } message := fmt.Sprintf( "Pausing %s step '%s'. Press enter to continue.", locationString, name) result := make(chan string, 1) go func() { line, err := ui.Ask(message) if err != nil { log.Printf("Error asking for input: %s", err) } result <- line }() for { select { case <-result: return case <-time.After(100 * time.Millisecond): if _, ok := state.GetOk(multistep.StateCancelled); ok { return } } } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/multistep_runner.go������������������������0000664�0000000�0000000�00000012256�13771713062�0027354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "fmt" "log" "reflect" "strings" "time" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func newRunner(steps []multistep.Step, config common.PackerConfig, ui packersdk.Ui) (multistep.Runner, multistep.DebugPauseFn) { switch config.PackerOnError { case "", "cleanup": case "abort": for i, step := range steps { steps[i] = abortStep{ step: step, cleanupProv: false, ui: ui, } } case "ask": for i, step := range steps { steps[i] = askStep{step, ui} } case "run-cleanup-provisioner": for i, step := range steps { steps[i] = abortStep{ step: step, cleanupProv: true, ui: ui, } } } if config.PackerDebug { pauseFn := MultistepDebugFn(ui) return &multistep.DebugRunner{Steps: steps, PauseFn: pauseFn}, pauseFn } else { return &multistep.BasicRunner{Steps: steps}, nil } } // NewRunner returns a multistep.Runner that runs steps augmented with support // for -debug and -on-error command line arguments. func NewRunner(steps []multistep.Step, config common.PackerConfig, ui packersdk.Ui) multistep.Runner { runner, _ := newRunner(steps, config, ui) return runner } // NewRunnerWithPauseFn returns a multistep.Runner that runs steps augmented // with support for -debug and -on-error command line arguments. With -debug it // puts the multistep.DebugPauseFn that will pause execution between steps into // the state under the key "pauseFn". func NewRunnerWithPauseFn(steps []multistep.Step, config common.PackerConfig, ui packersdk.Ui, state multistep.StateBag) multistep.Runner { runner, pauseFn := newRunner(steps, config, ui) if pauseFn != nil { state.Put("pauseFn", pauseFn) } return runner } func typeName(i interface{}) string { return reflect.Indirect(reflect.ValueOf(i)).Type().Name() } type abortStep struct { step multistep.Step cleanupProv bool ui packersdk.Ui } func (s abortStep) InnerStepName() string { return typeName(s.step) } func (s abortStep) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { return s.step.Run(ctx, state) } func (s abortStep) Cleanup(state multistep.StateBag) { if s.InnerStepName() == typeName(StepProvision{}) && s.cleanupProv { s.step.Cleanup(state) return } shouldCleanup := handleAbortsAndInterupts(state, s.ui, typeName(s.step)) if !shouldCleanup { return } s.step.Cleanup(state) } type askStep struct { step multistep.Step ui packersdk.Ui } func (s askStep) InnerStepName() string { return typeName(s.step) } func (s askStep) Run(ctx context.Context, state multistep.StateBag) (action multistep.StepAction) { for { action = s.step.Run(ctx, state) if action != multistep.ActionHalt { return } err, ok := state.GetOk("error") if ok { s.ui.Error(fmt.Sprintf("%s", err)) } switch ask(s.ui, typeName(s.step), state) { case askCleanup: return case askAbort: state.Put("aborted", true) return case askRetry: continue } } } func (s askStep) Cleanup(state multistep.StateBag) { if _, ok := state.GetOk("aborted"); ok { shouldCleanup := handleAbortsAndInterupts(state, s.ui, typeName(s.step)) if !shouldCleanup { return } } s.step.Cleanup(state) } type askResponse int const ( askCleanup askResponse = iota askAbort askRetry ) func ask(ui packersdk.Ui, name string, state multistep.StateBag) askResponse { ui.Say(fmt.Sprintf("Step %q failed", name)) result := make(chan askResponse) go func() { result <- askPrompt(ui) }() for { select { case response := <-result: return response case <-time.After(100 * time.Millisecond): if _, ok := state.GetOk(multistep.StateCancelled); ok { return askCleanup } } } } func askPrompt(ui packersdk.Ui) askResponse { for { line, err := ui.Ask("[c] Clean up and exit, [a] abort without cleanup, or [r] retry step (build may fail even if retry succeeds)?") if err != nil { log.Printf("Error asking for input: %s", err) } input := strings.ToLower(line) + "c" switch input[0] { case 'c': return askCleanup case 'a': return askAbort case 'r': return askRetry } ui.Say(fmt.Sprintf("Incorrect input: %#v", line)) } } func handleAbortsAndInterupts(state multistep.StateBag, ui packersdk.Ui, stepName string) bool { // if returns false, don't run cleanup. If true, do run cleanup. _, alreadyLogged := state.GetOk("abort_step_logged") err, ok := state.GetOk("error") if ok && !alreadyLogged { ui.Error(fmt.Sprintf("%s", err)) state.Put("abort_step_logged", true) } if _, ok := state.GetOk(multistep.StateCancelled); ok { if !alreadyLogged { ui.Error("Interrupted, aborting...") state.Put("abort_step_logged", true) } else { ui.Error(fmt.Sprintf("aborted: skipping cleanup of step %q", stepName)) } return false } if _, ok := state.GetOk(multistep.StateHalted); ok { if !alreadyLogged { ui.Error(fmt.Sprintf("Step %q failed, aborting...", stepName)) state.Put("abort_step_logged", true) } else { ui.Error(fmt.Sprintf("aborted: skipping cleanup of step %q", stepName)) } return false } return true } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_cleanup_temp_keys.go������������������0000664�0000000�0000000�00000005062�13771713062�0030474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "fmt" "log" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type StepCleanupTempKeys struct { Comm *communicator.Config } func (s *StepCleanupTempKeys) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // This step is mostly cosmetic; Packer deletes the ephemeral keys anyway // so there's no realistic situation where these keys can cause issues. // However, it's nice to clean up after yourself. if !s.Comm.SSHClearAuthorizedKeys { return multistep.ActionContinue } if s.Comm.Type != "ssh" { return multistep.ActionContinue } if s.Comm.SSHTemporaryKeyPairName == "" { return multistep.ActionContinue } comm := state.Get("communicator").(packersdk.Communicator) ui := state.Get("ui").(packersdk.Ui) cmd := new(packersdk.RemoteCmd) ui.Say("Trying to remove ephemeral keys from authorized_keys files") // Per the OpenSSH manual (https://man.openbsd.org/sshd.8), a typical // line in the 'authorized_keys' file contains several fields that // are delimited by spaces. Here is an (abbreviated) example of a line: // ssh-rsa AAAAB3Nza...LiPk== user@example.net // // In the above example, 'ssh-rsa' is the key pair type, // 'AAAAB3Nza...LiPk==' is the base64 encoded public key, // and 'user@example.net' is a comment (in this case, describing // who the key belongs to). // // In the following 'sed' calls, the comment field will be equal to // the value of communicator.Config.SSHTemporaryKeyPairName. // We can remove an authorized public key using 'sed' by looking // for a line ending in ' packer-key-pair-comment' (note the // leading space). // // TODO: Why create a backup file if you are going to remove it? cmd.Command = fmt.Sprintf("sed -i.bak '/ %s$/d' ~/.ssh/authorized_keys; rm ~/.ssh/authorized_keys.bak", s.Comm.SSHTemporaryKeyPairName) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { log.Printf("Error cleaning up ~/.ssh/authorized_keys; please clean up keys manually: %s", err) } cmd = new(packersdk.RemoteCmd) cmd.Command = fmt.Sprintf("sudo sed -i.bak '/ %s$/d' /root/.ssh/authorized_keys; sudo rm /root/.ssh/authorized_keys.bak", s.Comm.SSHTemporaryKeyPairName) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { log.Printf("Error cleaning up /root/.ssh/authorized_keys; please clean up keys manually: %s", err) } return multistep.ActionContinue } func (s *StepCleanupTempKeys) Cleanup(state multistep.StateBag) { } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_create_cdrom.go�����������������������0000664�0000000�0000000�00000016204�13771713062�0027414�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "fmt" "io" "log" "os" "os/exec" "path/filepath" "runtime" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/shell-local/localexec" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) // StepCreateCD will create a CD disk with the given files. type StepCreateCD struct { // Files can be either files or directories. Any files provided here will // be written to the root of the CD. Directories will be written to the // root of the CD as well, but will retain their subdirectory structure. Files []string Label string CDPath string filesAdded map[string]bool } func (s *StepCreateCD) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if len(s.Files) == 0 { log.Println("No CD files specified. CD disk will not be made.") return multistep.ActionContinue } ui := state.Get("ui").(packersdk.Ui) ui.Say("Creating CD disk...") if s.Label == "" { s.Label = "packer" } else { log.Printf("CD label is set to %s", s.Label) } // Track what files are added. Used for testing step. s.filesAdded = make(map[string]bool) // Create a temporary file to be our CD drive CDF, err := tmp.File("packer*.iso") // Set the path so we can remove it later CDPath := CDF.Name() CDF.Close() os.Remove(CDPath) if err != nil { state.Put("error", fmt.Errorf("Error creating temporary file for CD: %s", err)) return multistep.ActionHalt } log.Printf("CD path: %s", CDPath) s.CDPath = CDPath // Consolidate all files provided into a single directory to become our // "root" directory. rootFolder, err := tmp.Dir("packer_to_cdrom") if err != nil { state.Put("error", fmt.Errorf("Error creating temporary file for CD: %s", err)) return multistep.ActionHalt } for _, toAdd := range s.Files { err = s.AddFile(rootFolder, toAdd) if err != nil { state.Put("error", fmt.Errorf("Error creating temporary file for CD: %s", err)) return multistep.ActionHalt } } cmd, err := retrieveCDISOCreationCommand(s.Label, rootFolder, CDPath) if err != nil { state.Put("error", err) return multistep.ActionHalt } err = localexec.RunAndStream(cmd, ui, []string{}) if err != nil { state.Put("error", err) return multistep.ActionHalt } ui.Message("Done copying paths from CD_dirs") // Set the path to the CD so it can be used later state.Put("cd_path", CDPath) if err != nil { state.Put("error", err) return multistep.ActionHalt } return multistep.ActionContinue } func (s *StepCreateCD) Cleanup(multistep.StateBag) { if s.CDPath != "" { log.Printf("Deleting CD disk: %s", s.CDPath) os.Remove(s.CDPath) } } type cdISOCreationCommand struct { Name string Command func(path string, label string, source string, dest string) *exec.Cmd } var supportedCDISOCreationCommands []cdISOCreationCommand = []cdISOCreationCommand{ { "xorriso", func(path string, label string, source string, dest string) *exec.Cmd { return exec.Command( path, "-as", "genisoimage", "-rock", "-joliet", "-volid", label, "-output", dest, source) }, }, { "mkisofs", func(path string, label string, source string, dest string) *exec.Cmd { return exec.Command( path, "-joliet", "-volid", label, "-o", dest, source) }, }, { "hdiutil", func(path string, label string, source string, dest string) *exec.Cmd { return exec.Command( path, "makehybrid", "-o", dest, "-hfs", "-joliet", "-iso", "-default-volume-name", label, source) }, }, { "oscdimg", func(path string, label string, source string, dest string) *exec.Cmd { return exec.Command( path, "-j1", "-o", "-m", "-l"+label, source, dest) }, }, } func isCygwinExecutable(path string) bool { return runtime.GOOS == "windows" && strings.Contains(path, "\\usr\\bin\\") } func toCygwinPath(path string) (string, error) { c := exec.Command("cygpath", path) cygwinPath, err := c.Output() return strings.TrimSpace(string(cygwinPath)), err } func retrieveCDISOCreationCommand(label string, source string, dest string) (*exec.Cmd, error) { for _, c := range supportedCDISOCreationCommands { path, err := exec.LookPath(c.Name) if err != nil { continue } // if we are running a cygwin/msys2 executable we must convert the // native win32 path to a cygwin/msys2/unix style path. if isCygwinExecutable(path) { source, err = toCygwinPath(source) if err != nil { return nil, err } dest, err = toCygwinPath(dest) if err != nil { return nil, err } } return c.Command(path, label, source, dest), nil } var commands = make([]string, 0, len(supportedCDISOCreationCommands)) for _, c := range supportedCDISOCreationCommands { commands = append(commands, c.Name) } return nil, fmt.Errorf( "could not find a supported CD ISO creation command (the supported commands are: %s)", strings.Join(commands, ", ")) } func (s *StepCreateCD) AddFile(dst, src string) error { finfo, err := os.Stat(src) if err != nil { return fmt.Errorf("Error adding path to CD: %s", err) } // add a file if !finfo.IsDir() { inputF, err := os.Open(src) if err != nil { return err } defer inputF.Close() // Create a new file in the root directory dest, err := os.Create(filepath.Join(dst, finfo.Name())) if err != nil { return fmt.Errorf("Error opening file for copy %s to CD root", src) } defer dest.Close() nBytes, err := io.Copy(dest, inputF) if err != nil { return fmt.Errorf("Error copying %s to CD root", src) } s.filesAdded[src] = true log.Printf("Wrote %d bytes to %s", nBytes, finfo.Name()) return err } // file is a directory, so we need to parse the filename into a path to // discard and a basename discardPath, _ := filepath.Split(src) // Add a directory and its subdirectories visit := func(pathname string, fi os.FileInfo, err error) error { if err != nil { return err } // Clean up pathing so that we preserve the base directory provided by // the user but not the local pathing to that directory. allDirs, base := filepath.Split(pathname) intermediaryDirs := strings.Replace(allDirs, discardPath, "", 1) dstPath := filepath.Join(dst, base) if intermediaryDirs != "" { dstPath = filepath.Join(dst, intermediaryDirs, base) } // add a file if !fi.IsDir() { inputF, err := os.Open(pathname) if err != nil { return err } defer inputF.Close() fileDst, err := os.Create(dstPath) if err != nil { return fmt.Errorf("Error opening file %s on CD: %s", dstPath, err) } defer fileDst.Close() nBytes, err := io.Copy(fileDst, inputF) if err != nil { return fmt.Errorf("Error copying %s to CD: %s", dstPath, err) } s.filesAdded[dstPath] = true log.Printf("Wrote %d bytes to %s", nBytes, dstPath) return err } if fi.Mode().IsDir() { // create the directory on the CD, continue walk. err := os.MkdirAll(dstPath, fi.Mode()) if err != nil { err = fmt.Errorf("error creating new directory %s: %s", dstPath, err) } return err } return err } return filepath.Walk(src, visit) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_create_cdrom_test.go������������������0000664�0000000�0000000�00000005500�13771713062�0030450�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "bytes" "context" "io/ioutil" "os" "path" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestStepCreateCD_Impl(t *testing.T) { var raw interface{} raw = new(StepCreateCD) if _, ok := raw.(multistep.Step); !ok { t.Fatalf("StepCreateCD should be a step") } } func testStepCreateCDState(t *testing.T) multistep.StateBag { state := new(multistep.BasicStateBag) state.Put("ui", &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), }) return state } func TestStepCreateCD(t *testing.T) { if os.Getenv("PACKER_ACC") == "" { t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the disk management binaries.") } state := testStepCreateCDState(t) step := new(StepCreateCD) dir, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) files := make([]string, 3) tempFileNames := []string{"test_cd_roms.tmp", "test cd files.tmp", "Test-Test-Test5.tmp"} for i, fname := range tempFileNames { files[i] = path.Join(dir, fname) _, err := os.Create(files[i]) if err != nil { t.Fatalf("err: %s", err) } } step.Files = files action := step.Run(context.Background(), state) if err, ok := state.GetOk("error"); ok { t.Fatalf("state should be ok for %v: %s", step.Files, err) } if action != multistep.ActionContinue { t.Fatalf("bad action: %#v for %v", action, step.Files) } CD_path := state.Get("cd_path").(string) if _, err := os.Stat(CD_path); err != nil { t.Fatalf("file not found: %s for %v", CD_path, step.Files) } if len(step.filesAdded) != 3 { t.Fatalf("expected 3 files, found %d for %v", len(step.filesAdded), step.Files) } step.Cleanup(state) if _, err := os.Stat(CD_path); err == nil { t.Fatalf("file found: %s for %v", CD_path, step.Files) } } func TestStepCreateCD_missing(t *testing.T) { if os.Getenv("PACKER_ACC") == "" { t.Skip("This test is only run with PACKER_ACC=1 due to the requirement of access to the disk management binaries.") } state := testStepCreateCDState(t) step := new(StepCreateCD) dir, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) expected := 0 step.Files = []string{"missing file.tmp"} if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v for %v", action, step.Files) } if _, ok := state.GetOk("error"); !ok { t.Fatalf("state should not be ok for %v", step.Files) } CD_path := state.Get("cd_path") if CD_path != nil { t.Fatalf("CD_path is not nil for %v", step.Files) } if len(step.filesAdded) != expected { t.Fatalf("expected %d, found %d for %v", expected, len(step.filesAdded), step.Files) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_create_floppy.go����������������������0000664�0000000�0000000�00000025300�13771713062�0027616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "fmt" "io" "log" "os" "path" "path/filepath" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/mitchellh/go-fs" "github.com/mitchellh/go-fs/fat" ) // StepCreateFloppy will create a floppy disk with the given files. type StepCreateFloppy struct { Files []string Directories []string Label string floppyPath string FilesAdded map[string]bool } func (s *StepCreateFloppy) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if len(s.Files) == 0 && len(s.Directories) == 0 { log.Println("No floppy files specified. Floppy disk will not be made.") return multistep.ActionContinue } if s.Label == "" { s.Label = "packer" } else { log.Printf("Floppy label is set to %s", s.Label) } s.FilesAdded = make(map[string]bool) ui := state.Get("ui").(packersdk.Ui) ui.Say("Creating floppy disk...") // Create a temporary file to be our floppy drive floppyF, err := tmp.File("packer") if err != nil { state.Put("error", fmt.Errorf("Error creating temporary file for floppy: %s", err)) return multistep.ActionHalt } defer floppyF.Close() // Set the path so we can remove it later s.floppyPath = floppyF.Name() log.Printf("Floppy path: %s", s.floppyPath) // Set the size of the file to be a floppy sized if err := floppyF.Truncate(1440 * 1024); err != nil { state.Put("error", fmt.Errorf("Error creating floppy: %s", err)) return multistep.ActionHalt } // BlockDevice backed by the file for our filesystem log.Println("Initializing block device backed by temporary file") device, err := fs.NewFileDisk(floppyF) if err != nil { state.Put("error", fmt.Errorf("Error creating floppy: %s", err)) return multistep.ActionHalt } // Format the block device so it contains a valid FAT filesystem log.Println("Formatting the block device with a FAT filesystem...") formatConfig := &fat.SuperFloppyConfig{ FATType: fat.FAT12, Label: s.Label, OEMName: s.Label, } if err := fat.FormatSuperFloppy(device, formatConfig); err != nil { state.Put("error", fmt.Errorf("Error creating floppy: %s", err)) return multistep.ActionHalt } // The actual FAT filesystem log.Println("Initializing FAT filesystem on block device") fatFs, err := fat.New(device) if err != nil { state.Put("error", fmt.Errorf("Error creating floppy: %s", err)) return multistep.ActionHalt } // Get the root directory to the filesystem and create a cache for any directories within log.Println("Reading the root directory from the filesystem") rootDir, err := fatFs.RootDir() if err != nil { state.Put("error", fmt.Errorf("Error creating floppy: %s", err)) return multistep.ActionHalt } cache := fsDirectoryCache(rootDir) // Utility functions for walking through a directory grabbing all files flatly globFiles := func(files []string, list chan string) { for _, filename := range files { if strings.ContainsAny(filename, "*?[") { matches, _ := filepath.Glob(filename) if err != nil { continue } for _, match := range matches { list <- match } continue } list <- filename } close(list) } var crawlDirectoryFiles []string crawlDirectory := func(path string, info os.FileInfo, err error) error { if err != nil { return err } if !info.IsDir() { crawlDirectoryFiles = append(crawlDirectoryFiles, path) ui.Message(fmt.Sprintf("Adding file: %s", path)) } return nil } crawlDirectoryFiles = []string{} // Collect files and copy them flatly...because floppy_files is broken on purpose. var filelist chan string filelist = make(chan string) go globFiles(s.Files, filelist) ui.Message("Copying files flatly from floppy_files") for { filename, ok := <-filelist if !ok { break } finfo, err := os.Stat(filename) if err != nil { state.Put("error", fmt.Errorf("Error trying to stat : %s : %s", filename, err)) return multistep.ActionHalt } // walk through directory adding files to the root of the fs if finfo.IsDir() { ui.Message(fmt.Sprintf("Copying directory: %s", filename)) err := filepath.Walk(filename, crawlDirectory) if err != nil { state.Put("error", fmt.Errorf("Error adding file from floppy_files : %s : %s", filename, err)) return multistep.ActionHalt } for _, crawlfilename := range crawlDirectoryFiles { if err = s.Add(cache, crawlfilename); err != nil { state.Put("error", fmt.Errorf("Error adding file from floppy_files : %s : %s", filename, err)) return multistep.ActionHalt } s.FilesAdded[crawlfilename] = true } crawlDirectoryFiles = []string{} continue } // add just a single file ui.Message(fmt.Sprintf("Copying file: %s", filename)) if err = s.Add(cache, filename); err != nil { state.Put("error", fmt.Errorf("Error adding file from floppy_files : %s : %s", filename, err)) return multistep.ActionHalt } s.FilesAdded[filename] = true } ui.Message("Done copying files from floppy_files") // Collect all paths (expanding wildcards) into pathqueue ui.Message("Collecting paths from floppy_dirs") var pathqueue []string for _, filename := range s.Directories { if strings.ContainsAny(filename, "*?[") { matches, err := filepath.Glob(filename) if err != nil { state.Put("error", fmt.Errorf("Error adding path %s to floppy: %s", filename, err)) return multistep.ActionHalt } for _, filename := range matches { pathqueue = append(pathqueue, filename) } continue } pathqueue = append(pathqueue, filename) } ui.Message(fmt.Sprintf("Resulting paths from floppy_dirs : %v", pathqueue)) // Go over each path in pathqueue and copy it. for _, src := range pathqueue { ui.Message(fmt.Sprintf("Recursively copying : %s", src)) err = s.Add(cache, src) if err != nil { state.Put("error", fmt.Errorf("Error adding path %s to floppy: %s", src, err)) return multistep.ActionHalt } } ui.Message("Done copying paths from floppy_dirs") // Set the path to the floppy so it can be used later state.Put("floppy_path", s.floppyPath) return multistep.ActionContinue } func (s *StepCreateFloppy) Add(dircache directoryCache, src string) error { finfo, err := os.Stat(src) if err != nil { return fmt.Errorf("Error adding path to floppy: %s", err) } // add a file if !finfo.IsDir() { inputF, err := os.Open(src) if err != nil { return err } defer inputF.Close() d, err := dircache("") if err != nil { return err } entry, err := d.AddFile(path.Base(filepath.ToSlash(src))) if err != nil { return err } fatFile, err := entry.File() if err != nil { return err } _, err = io.Copy(fatFile, inputF) s.FilesAdded[src] = true return err } // add a directory and it's subdirectories basedirectory := filepath.Join(src, "..") visit := func(pathname string, fi os.FileInfo, err error) error { if err != nil { return err } if fi.Mode().IsDir() { base, err := removeBase(basedirectory, pathname) if err != nil { return err } _, err = dircache(filepath.ToSlash(base)) return err } directory, filename := filepath.Split(filepath.ToSlash(pathname)) base, err := removeBase(basedirectory, filepath.FromSlash(directory)) if err != nil { return err } inputF, err := os.Open(pathname) if err != nil { return err } defer inputF.Close() wd, err := dircache(filepath.ToSlash(base)) if err != nil { return err } entry, err := wd.AddFile(filename) if err != nil { return err } fatFile, err := entry.File() if err != nil { return err } _, err = io.Copy(fatFile, inputF) s.FilesAdded[pathname] = true return err } return filepath.Walk(src, visit) } func (s *StepCreateFloppy) Cleanup(multistep.StateBag) { if s.floppyPath != "" { log.Printf("Deleting floppy disk: %s", s.floppyPath) os.Remove(s.floppyPath) } } // removeBase will take a regular os.PathSeparator-separated path and remove the // prefix directory base from it. Both paths are converted to their absolute // formats before the stripping takes place. func removeBase(base string, path string) (string, error) { var idx int var err error if res, err := filepath.Abs(path); err == nil { path = res } path = filepath.Clean(path) if base, err = filepath.Abs(base); err != nil { return path, err } c1, c2 := strings.Split(base, string(os.PathSeparator)), strings.Split(path, string(os.PathSeparator)) for idx = 0; idx < len(c1); idx++ { if len(c1[idx]) == 0 && len(c2[idx]) != 0 { break } if c1[idx] != c2[idx] { return "", fmt.Errorf("Path %s is not prefixed by Base %s", path, base) } } return strings.Join(c2[idx:], string(os.PathSeparator)), nil } // fsDirectoryCache returns a function that can be used to grab the fs.Directory // entry associated with a given path. If an fs.Directory entry is not found // then it will be created relative to the rootDirectory argument that is // passed. type directoryCache func(string) (fs.Directory, error) func fsDirectoryCache(rootDirectory fs.Directory) directoryCache { var cache map[string]fs.Directory cache = make(map[string]fs.Directory) cache[""] = rootDirectory Input, Output, Error := make(chan string), make(chan fs.Directory), make(chan error) go func(Error chan error) { for { input := <-Input if len(input) > 0 { input = path.Clean(input) } // found a directory, so yield it res, ok := cache[input] if ok { Output <- res continue } component := strings.Split(input, "/") // directory not cached, so start at the root and walk each component // creating them if they're not in cache var entry fs.Directory for i := range component { // join all of our components into a key path := strings.Join(component[:i], "/") // check if parent directory is cached res, ok = cache[path] if !ok { // add directory into cache directory, err := entry.AddDirectory(component[i-1]) if err != nil { Error <- err continue } res, err = directory.Dir() if err != nil { Error <- err continue } cache[path] = res } // cool, found a directory entry = res } // finally create our directory directory, err := entry.AddDirectory(component[len(component)-1]) if err != nil { Error <- err continue } res, err = directory.Dir() if err != nil { Error <- err continue } cache[input] = res // ..and yield it Output <- entry } }(Error) getFilesystemDirectory := func(input string) (fs.Directory, error) { Input <- input select { case res := <-Output: return res, nil case err := <-Error: return *new(fs.Directory), err } } return getFilesystemDirectory } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_create_floppy_test.go�����������������0000664�0000000�0000000�00000017127�13771713062�0030665�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "bytes" "context" "fmt" "io/ioutil" "log" "os" "path" "path/filepath" "strconv" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) const TestFixtures = "test-fixtures" func TestStepCreateFloppy_Impl(t *testing.T) { var raw interface{} raw = new(StepCreateFloppy) if _, ok := raw.(multistep.Step); !ok { t.Fatalf("StepCreateFloppy should be a step") } } func testStepCreateFloppyState(t *testing.T) multistep.StateBag { state := new(multistep.BasicStateBag) state.Put("ui", &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), }) return state } func TestStepCreateFloppy(t *testing.T) { state := testStepCreateFloppyState(t) step := new(StepCreateFloppy) dir, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) count := 10 expected := count files := make([]string, count) prefix := "exists" ext := ".tmp" for i := 0; i < expected; i++ { files[i] = path.Join(dir, prefix+strconv.Itoa(i)+ext) _, err := os.Create(files[i]) if err != nil { t.Fatalf("err: %s", err) } } lists := [][]string{ files, {dir + string(os.PathSeparator) + prefix + "*" + ext}, {dir + string(os.PathSeparator) + prefix + "?" + ext}, {dir + string(os.PathSeparator) + prefix + "[0123456789]" + ext}, {dir + string(os.PathSeparator) + prefix + "[0-9]" + ext}, {dir + string(os.PathSeparator)}, {dir}, } for _, step.Files = range lists { if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v for %v", action, step.Files) } if _, ok := state.GetOk("error"); ok { t.Fatalf("state should be ok for %v", step.Files) } floppy_path := state.Get("floppy_path").(string) if _, err := os.Stat(floppy_path); err != nil { t.Fatalf("file not found: %s for %v", floppy_path, step.Files) } if len(step.FilesAdded) != expected { t.Fatalf("expected %d, found %d for %v", expected, len(step.FilesAdded), step.Files) } step.Cleanup(state) if _, err := os.Stat(floppy_path); err == nil { t.Fatalf("file found: %s for %v", floppy_path, step.Files) } } } func TestStepCreateFloppy_missing(t *testing.T) { state := testStepCreateFloppyState(t) step := new(StepCreateFloppy) dir, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) count := 2 expected := 0 files := make([]string, count) prefix := "missing" for i := 0; i < count; i++ { files[i] = path.Join(dir, prefix+strconv.Itoa(i)) } lists := [][]string{ files, } for _, step.Files = range lists { if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v for %v", action, step.Files) } if _, ok := state.GetOk("error"); !ok { t.Fatalf("state should not be ok for %v", step.Files) } floppy_path := state.Get("floppy_path") if floppy_path != nil { t.Fatalf("floppy_path is not nil for %v", step.Files) } if len(step.FilesAdded) != expected { t.Fatalf("expected %d, found %d for %v", expected, len(step.FilesAdded), step.Files) } } } func TestStepCreateFloppy_notfound(t *testing.T) { state := testStepCreateFloppyState(t) step := new(StepCreateFloppy) dir, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(dir) count := 2 expected := 0 files := make([]string, count) prefix := "notfound" for i := 0; i < count; i++ { files[i] = path.Join(dir, prefix+strconv.Itoa(i)) } lists := [][]string{ {dir + string(os.PathSeparator) + prefix + "*"}, {dir + string(os.PathSeparator) + prefix + "?"}, {dir + string(os.PathSeparator) + prefix + "[0123456789]"}, {dir + string(os.PathSeparator) + prefix + "[0-9]"}, {dir + string(os.PathSeparator)}, {dir}, } for _, step.Files = range lists { if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v for %v", action, step.Files) } if _, ok := state.GetOk("error"); ok { t.Fatalf("state should be ok for %v", step.Files) } floppy_path := state.Get("floppy_path").(string) if _, err := os.Stat(floppy_path); err != nil { t.Fatalf("file not found: %s for %v", floppy_path, step.Files) } if len(step.FilesAdded) != expected { t.Fatalf("expected %d, found %d for %v", expected, len(step.FilesAdded), step.Files) } step.Cleanup(state) if _, err := os.Stat(floppy_path); err == nil { t.Fatalf("file found: %s for %v", floppy_path, step.Files) } } } func TestStepCreateFloppyDirectories(t *testing.T) { const TestName = "floppy-hier" // file-system hierarchies var basePath = filepath.Join(".", TestFixtures, TestName) type contentsTest struct { dirs []string result []string } // keep in mind that .FilesAdded doesn't keep track of the target filename or directories, but rather the source filename. directories := [][]contentsTest{ { {dirs: []string{"file1", "file2", "file3"}, result: []string{"file1", "file2", "file3"}}, {dirs: []string{"file?"}, result: []string{"file1", "file2", "file3"}}, {dirs: []string{"*"}, result: []string{"file1", "file2", "file3"}}, }, { {dirs: []string{"dir1"}, result: []string{"dir1/file1", "dir1/file2", "dir1/file3"}}, {dirs: []string{"dir1/file1", "dir1/file2", "dir1/file3"}, result: []string{"dir1/file1", "dir1/file2", "dir1/file3"}}, {dirs: []string{"*"}, result: []string{"dir1/file1", "dir1/file2", "dir1/file3"}}, {dirs: []string{"*/*"}, result: []string{"dir1/file1", "dir1/file2", "dir1/file3"}}, }, { {dirs: []string{"dir1"}, result: []string{"dir1/file1", "dir1/subdir1/file1", "dir1/subdir1/file2"}}, {dirs: []string{"dir2/*"}, result: []string{"dir2/subdir1/file1", "dir2/subdir1/file2"}}, {dirs: []string{"dir2/subdir1"}, result: []string{"dir2/subdir1/file1", "dir2/subdir1/file2"}}, {dirs: []string{"dir?"}, result: []string{"dir1/file1", "dir1/subdir1/file1", "dir1/subdir1/file2", "dir2/subdir1/file1", "dir2/subdir1/file2"}}, }, } // create the hierarchy for each file for i := 0; i < 2; i++ { dir := filepath.Join(basePath, fmt.Sprintf("test-%d", i)) for _, test := range directories[i] { // create a new state and step state := testStepCreateFloppyState(t) step := new(StepCreateFloppy) // modify step.Directories with ones from testcase step.Directories = []string{} for _, c := range test.dirs { step.Directories = append(step.Directories, filepath.Join(dir, filepath.FromSlash(c))) } log.Println(fmt.Sprintf("Trying against floppy_dirs : %v", step.Directories)) // run the step if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v for %v : %v", action, step.Directories, state.Get("error")) } if _, ok := state.GetOk("error"); ok { t.Fatalf("state should be ok for %v : %v", step.Directories, state.Get("error")) } floppy_path := state.Get("floppy_path").(string) if _, err := os.Stat(floppy_path); err != nil { t.Fatalf("file not found: %s for %v : %v", floppy_path, step.Directories, err) } // check the FilesAdded array to see if it matches for _, rpath := range test.result { fpath := filepath.Join(dir, filepath.FromSlash(rpath)) if !step.FilesAdded[fpath] { t.Fatalf("unable to find file: %s for %v", fpath, step.Directories) } } // cleanup the step step.Cleanup(state) if _, err := os.Stat(floppy_path); err == nil { t.Fatalf("file found: %s for %v", floppy_path, step.Directories) } } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_download.go���������������������������0000664�0000000�0000000�00000015525�13771713062�0026601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "crypto/sha1" "encoding/hex" "fmt" "log" "net/url" "os" "path/filepath" "runtime" "strings" gcs "github.com/hashicorp/go-getter/gcs/v2" s3 "github.com/hashicorp/go-getter/s3/v2" getter "github.com/hashicorp/go-getter/v2" urlhelper "github.com/hashicorp/go-getter/v2/helper/url" "github.com/hashicorp/packer/packer-plugin-sdk/filelock" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepDownload downloads a remote file using the download client within // this package. This step handles setting up the download configuration, // progress reporting, interrupt handling, etc. // // Uses: // cache packer.Cache // ui packersdk.Ui type StepDownload struct { // The checksum and the type of the checksum for the download Checksum string // A short description of the type of download being done. Example: // "ISO" or "Guest Additions" Description string // The name of the key where the final path of the ISO will be put // into the state. ResultKey string // The path where the result should go, otherwise it goes to the // cache directory. TargetPath string // A list of URLs to attempt to download this thing. Url []string // Extension is the extension to force for the file that is downloaded. // Some systems require a certain extension. If this isn't set, the // extension on the URL is used. Otherwise, this will be forced // on the downloaded file for every URL. Extension string } var defaultGetterClient = getter.Client{ Getters: getter.Getters, } func init() { defaultGetterClient.Getters = append(defaultGetterClient.Getters, new(gcs.Getter)) defaultGetterClient.Getters = append(defaultGetterClient.Getters, new(s3.Getter)) } func (s *StepDownload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { if len(s.Url) == 0 { log.Printf("No URLs were provided to Step Download. Continuing...") return multistep.ActionContinue } defer log.Printf("Leaving retrieve loop for %s", s.Description) ui := state.Get("ui").(packersdk.Ui) ui.Say(fmt.Sprintf("Retrieving %s", s.Description)) var errs []error for _, source := range s.Url { if ctx.Err() != nil { state.Put("error", fmt.Errorf("Download cancelled: %v", errs)) return multistep.ActionHalt } ui.Say(fmt.Sprintf("Trying %s", source)) var err error var dst string if s.Description == "OVF/OVA" && strings.HasSuffix(source, ".ovf") { // TODO(adrien): make go-getter allow using files in place. // ovf files usually point to a file in the same directory, so // using them in place is the only way. ui.Say(fmt.Sprintf("Using ovf inplace")) dst = source } else { dst, err = s.download(ctx, ui, source) } if err == nil { state.Put(s.ResultKey, dst) return multistep.ActionContinue } // may be another url will work errs = append(errs, err) } err := fmt.Errorf("error downloading %s: %v", s.Description, errs) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } func (s *StepDownload) UseSourceToFindCacheTarget(source string) (*url.URL, string, error) { u, err := parseSourceURL(source) if err != nil { return nil, "", fmt.Errorf("url parse: %s", err) } if checksum := u.Query().Get("checksum"); checksum != "" { s.Checksum = checksum } if s.Checksum != "" && s.Checksum != "none" { // add checksum to url query params as go getter will checksum for us q := u.Query() q.Set("checksum", s.Checksum) u.RawQuery = q.Encode() } // store file under sha1(hash) if set // hash can sometimes be a checksum url // otherwise, use sha1(source_url) var shaSum [20]byte if s.Checksum != "" && s.Checksum != "none" { shaSum = sha1.Sum([]byte(s.Checksum)) } else { shaSum = sha1.Sum([]byte(u.String())) } shaSumString := hex.EncodeToString(shaSum[:]) targetPath := s.TargetPath if targetPath == "" { targetPath = shaSumString if s.Extension != "" { targetPath += "." + s.Extension } targetPath, err = packersdk.CachePath(targetPath) if err != nil { return nil, "", fmt.Errorf("CachePath: %s", err) } } else if filepath.Ext(targetPath) == "" { // When an absolute path is provided // this adds the file to the targetPath if !strings.HasSuffix(targetPath, "/") { targetPath += "/" } targetPath += shaSumString if s.Extension != "" { targetPath += "." + s.Extension } else { targetPath += ".iso" } } return u, targetPath, nil } func (s *StepDownload) download(ctx context.Context, ui packersdk.Ui, source string) (string, error) { u, targetPath, err := s.UseSourceToFindCacheTarget(source) if err != nil { return "", err } lockFile := targetPath + ".lock" log.Printf("Acquiring lock for: %s (%s)", u.String(), lockFile) lock := filelock.New(lockFile) lock.Lock() defer lock.Unlock() wd, err := os.Getwd() if err != nil { log.Printf("get working directory: %v", err) // here we ignore the error in case the // working directory is not needed. // It would be better if the go-getter // could guess it only in cases it is // necessary. } src := u.String() if u.Scheme == "" || strings.ToLower(u.Scheme) == "file" { // If a local filepath, then we need to preprocess to make sure the // path doens't have any multiple successive path separators; if it // does, go-getter will read this as a specialized go-getter-specific // subdirectory command, which it most likely isn't. src = filepath.Clean(u.String()) if _, err := os.Stat(filepath.Clean(u.Path)); err != nil { // Cleaned path isn't present on system so it must be some other // scheme. Don't error right away; see if go-getter can figure it // out. src = u.String() } } ui.Say(fmt.Sprintf("Trying %s", u.String())) req := &getter.Request{ Dst: targetPath, Src: src, ProgressListener: ui, Pwd: wd, Mode: getter.ModeFile, Inplace: true, } switch op, err := defaultGetterClient.Get(ctx, req); err.(type) { case nil: // success ! ui.Say(fmt.Sprintf("%s => %s", u.String(), op.Dst)) return op.Dst, nil case *getter.ChecksumError: ui.Say(fmt.Sprintf("Checksum did not match, removing %s", targetPath)) if err := os.Remove(targetPath); err != nil { ui.Error(fmt.Sprintf("Failed to remove cache file. Please remove manually: %s", targetPath)) } return "", err default: ui.Say(fmt.Sprintf("Download failed %s", err)) return "", err } } func parseSourceURL(source string) (*url.URL, error) { if runtime.GOOS == "windows" { // Check that the user specified a UNC path, and promote it to an smb:// uri. if strings.HasPrefix(source, "\\\\") && len(source) > 2 && source[2] != '?' { source = filepath.ToSlash(source[2:]) source = fmt.Sprintf("smb://%s", source) } } u, err := urlhelper.Parse(source) return u, err } func (s *StepDownload) Cleanup(multistep.StateBag) {} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_download_test.go����������������������0000664�0000000�0000000�00000024431�13771713062�0027634�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "bytes" "context" "crypto/sha1" "encoding/hex" "io/ioutil" "log" "net/http" "net/http/httptest" "os" "path/filepath" "reflect" "runtime" "testing" "github.com/google/go-cmp/cmp" urlhelper "github.com/hashicorp/go-getter/v2/helper/url" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) var _ multistep.Step = new(StepDownload) func toSha1(in string) string { b := sha1.Sum([]byte(in)) return hex.EncodeToString(b[:]) } func abs(t *testing.T, path string) string { path, err := filepath.Abs(path) if err != nil { t.Fatal(err) } u, err := urlhelper.Parse(path) if err != nil { t.Fatal(err) } return u.String() } func TestStepDownload_Run(t *testing.T) { srvr := httptest.NewServer(http.FileServer(http.Dir("test-fixtures"))) defer srvr.Close() cs := map[string]string{ "/root/basic.txt": "f572d396fae9206628714fb2ce00f72e94f2258f", "/root/another.txt": "7c6e5dd1bacb3b48fdffba2ed096097eb172497d", } type fields struct { Checksum string Description string ResultKey string TargetPath string Url []string Extension string } tests := []struct { name string fields fields want multistep.StepAction wantFiles []string }{ {"Empty URL field passes", fields{Url: []string{}}, multistep.ActionContinue, nil, }, {"not passing a checksum passes", fields{Url: []string{abs(t, "./test-fixtures/root/another.txt")}}, multistep.ActionContinue, []string{ toSha1(abs(t, "./test-fixtures/root/another.txt")) + ".lock", }, }, {"double slashes on a local filesystem passes", fields{Url: []string{abs(t, "./test-fixtures/root//another.txt")}}, multistep.ActionContinue, []string{ toSha1(abs(t, "./test-fixtures/root//another.txt")) + ".lock", }, }, {"none checksum works", fields{Url: []string{abs(t, "./test-fixtures/root/another.txt")}, Checksum: "none"}, multistep.ActionContinue, []string{ toSha1(abs(t, "./test-fixtures/root/another.txt")) + ".lock", }, }, {"bad checksum removes file - checksum from string - no Checksum Type", fields{Extension: "txt", Url: []string{abs(t, "./test-fixtures/root/another.txt")}, Checksum: cs["/root/basic.txt"]}, multistep.ActionHalt, []string{ toSha1(cs["/root/basic.txt"]) + ".txt.lock", // a lock file is created & deleted on mac for each download }, }, {"bad checksum removes file - checksum from string - Checksum Type", fields{Extension: "txt", Url: []string{abs(t, "./test-fixtures/root/another.txt")}, Checksum: "sha1:" + cs["/root/basic.txt"]}, multistep.ActionHalt, []string{ toSha1("sha1:"+cs["/root/basic.txt"]) + ".txt.lock", }, }, {"bad checksum removes file - checksum from url - Checksum Type", fields{Extension: "txt", Url: []string{abs(t, "./test-fixtures/root/basic.txt")}, Checksum: "file:" + srvr.URL + "/root/another.txt.sha1sum"}, multistep.ActionHalt, []string{ toSha1("file:"+srvr.URL+"/root/another.txt.sha1sum") + ".txt.lock", }, }, {"successfull http dl - checksum from http file - parameter", fields{Extension: "txt", Url: []string{srvr.URL + "/root/another.txt"}, Checksum: "file:" + srvr.URL + "/root/another.txt.sha1sum"}, multistep.ActionContinue, []string{ toSha1("file:"+srvr.URL+"/root/another.txt.sha1sum") + ".txt", toSha1("file:"+srvr.URL+"/root/another.txt.sha1sum") + ".txt.lock", }, }, {"successfull http dl - checksum from http file - url", fields{Extension: "txt", Url: []string{srvr.URL + "/root/another.txt?checksum=file:" + srvr.URL + "/root/another.txt.sha1sum"}}, multistep.ActionContinue, []string{ toSha1("file:"+srvr.URL+"/root/another.txt.sha1sum") + ".txt", toSha1("file:"+srvr.URL+"/root/another.txt.sha1sum") + ".txt.lock", }, }, {"successfull http dl - checksum from url", fields{Extension: "txt", Url: []string{srvr.URL + "/root/another.txt?checksum=" + cs["/root/another.txt"]}}, multistep.ActionContinue, []string{ toSha1(cs["/root/another.txt"]) + ".txt", toSha1(cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull http dl - checksum from parameter - no checksum type", fields{Extension: "txt", Url: []string{srvr.URL + "/root/another.txt?"}, Checksum: cs["/root/another.txt"]}, multistep.ActionContinue, []string{ toSha1(cs["/root/another.txt"]) + ".txt", toSha1(cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull http dl - checksum from parameter - checksum type", fields{Extension: "txt", Url: []string{srvr.URL + "/root/another.txt?"}, Checksum: "sha1:" + cs["/root/another.txt"]}, multistep.ActionContinue, []string{ toSha1("sha1:"+cs["/root/another.txt"]) + ".txt", toSha1("sha1:"+cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull relative symlink - checksum from url", fields{Extension: "txt", Url: []string{"./test-fixtures/root/another.txt?checksum=" + cs["/root/another.txt"]}}, multistep.ActionContinue, []string{ toSha1(cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull relative symlink - checksum from parameter - no checksum type", fields{Extension: "txt", Url: []string{"./test-fixtures/root/another.txt?"}, Checksum: cs["/root/another.txt"]}, multistep.ActionContinue, []string{ toSha1(cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull relative symlink - checksum from parameter - checksum type", fields{Extension: "txt", Url: []string{"./test-fixtures/root/another.txt?"}, Checksum: "sha1:" + cs["/root/another.txt"]}, multistep.ActionContinue, []string{ toSha1("sha1:"+cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull absolute symlink - checksum from url", fields{Extension: "txt", Url: []string{abs(t, "./test-fixtures/root/another.txt") + "?checksum=" + cs["/root/another.txt"]}}, multistep.ActionContinue, []string{ toSha1(cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull absolute symlink - checksum from parameter - no checksum type", fields{Extension: "txt", Url: []string{abs(t, "./test-fixtures/root/another.txt") + "?"}, Checksum: cs["/root/another.txt"]}, multistep.ActionContinue, []string{ toSha1(cs["/root/another.txt"]) + ".txt.lock", }, }, {"successfull absolute symlink - checksum from parameter - checksum type", fields{Extension: "txt", Url: []string{abs(t, "./test-fixtures/root/another.txt") + "?"}, Checksum: "sha1:" + cs["/root/another.txt"]}, multistep.ActionContinue, []string{ toSha1("sha1:"+cs["/root/another.txt"]) + ".txt.lock", }, }, {"wrong first 2 urls - absolute urls - checksum from parameter - no checksum type", fields{ Url: []string{ abs(t, "./test-fixtures/root/another.txt"), abs(t, "./test-fixtures/root/not_found"), abs(t, "./test-fixtures/root/basic.txt"), }, Checksum: cs["/root/basic.txt"], }, multistep.ActionContinue, []string{ toSha1(cs["/root/basic.txt"]) + ".lock", }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { dir := createTempDir(t) defer os.RemoveAll(dir) s := &StepDownload{ TargetPath: tt.fields.TargetPath, Checksum: tt.fields.Checksum, ResultKey: tt.fields.ResultKey, Url: tt.fields.Url, Extension: tt.fields.Extension, Description: tt.name, } defer os.Setenv("PACKER_CACHE_DIR", os.Getenv("PACKER_CACHE_DIR")) os.Setenv("PACKER_CACHE_DIR", dir) if got := s.Run(context.Background(), testState(t)); !reflect.DeepEqual(got, tt.want) { t.Fatalf("StepDownload.Run() = %v, want %v", got, tt.want) } files := listFiles(t, dir) if diff := cmp.Diff(tt.wantFiles, files); diff != "" { t.Fatalf("file list differs in %s: %s", dir, diff) } }) } } func TestStepDownload_download(t *testing.T) { step := &StepDownload{ Checksum: "sha1:f572d396fae9206628714fb2ce00f72e94f2258f", Description: "ISO", ResultKey: "iso_path", Url: nil, } ui := &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), PB: &packersdk.NoopProgressTracker{}, } dir := createTempDir(t) defer os.RemoveAll(dir) defer os.Setenv("PACKER_CACHE_DIR", os.Getenv("PACKER_CACHE_DIR")) os.Setenv("PACKER_CACHE_DIR", dir) // Abs path with extension provided step.TargetPath = "./packer" step.Extension = "ova" _, err := step.download(context.TODO(), ui, "./test-fixtures/root/basic.txt") if err != nil { t.Fatalf("Bad: non expected error %s", err.Error()) } os.RemoveAll(step.TargetPath) // Abs path with no extension provided step.TargetPath = "./packer" step.Extension = "" _, err = step.download(context.TODO(), ui, "./test-fixtures/root/basic.txt") if err != nil { t.Fatalf("Bad: non expected error %s", err.Error()) } os.RemoveAll(step.TargetPath) // Path with file step.TargetPath = "./packer/file.iso" _, err = step.download(context.TODO(), ui, "./test-fixtures/root/basic.txt") if err != nil { t.Fatalf("Bad: non expected error %s", err.Error()) } os.RemoveAll(step.TargetPath) } func TestStepDownload_WindowsParseSourceURL(t *testing.T) { if runtime.GOOS != "windows" { t.Skip("skip windows specific tests") } source := "\\\\hostname\\dir\\filename.txt" url, err := parseSourceURL(source) if err != nil { t.Fatalf("bad: parsing source url failed: %s", err.Error()) } if url.Scheme != "smb" { t.Fatalf("bad: url should contain smb scheme but contains: %s", url.Scheme) } } func TestStepDownload_ParseSourceSmbURL(t *testing.T) { source := "smb://hostname/dir/filename.txt" url, err := parseSourceURL(source) if err != nil { t.Fatalf("bad: parsing source url failed: %s", err.Error()) } if url.Scheme != "smb" { t.Fatalf("bad: url should contain smb scheme but contains: %s", url.Scheme) } if url.String() != "smb://hostname/dir/filename.txt" { t.Fatalf("bad: url should contain smb scheme but contains: %s", url.String()) } } func createTempDir(t *testing.T) string { dir, err := tmp.Dir("pkr") if err != nil { t.Fatalf("err: %s", err) } return dir } func listFiles(t *testing.T, dir string) []string { fs, err := ioutil.ReadDir(dir) if err != nil { log.Fatal(err) } var files []string for _, file := range fs { if file.Name() == "." { continue } files = append(files, file.Name()) } return files } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_http_server.go������������������������0000664�0000000�0000000�00000003414�13771713062�0027331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "fmt" "net/http" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/net" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // This step creates and runs the HTTP server that is serving files from the // directory specified by the 'http_directory` configuration parameter in the // template. // // Uses: // ui packersdk.Ui // // Produces: // http_port int - The port the HTTP server started on. type StepHTTPServer struct { HTTPDir string HTTPPortMin int HTTPPortMax int HTTPAddress string l *net.Listener } func (s *StepHTTPServer) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) if s.HTTPDir == "" { state.Put("http_port", 0) return multistep.ActionContinue } // Find an available TCP port for our HTTP server var httpAddr string var err error s.l, err = net.ListenRangeConfig{ Min: s.HTTPPortMin, Max: s.HTTPPortMax, Addr: s.HTTPAddress, Network: "tcp", }.Listen(ctx) if err != nil { err := fmt.Errorf("Error finding port: %s", err) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } ui.Say(fmt.Sprintf("Starting HTTP server on port %d", s.l.Port)) // Start the HTTP server and run it in the background fileServer := http.FileServer(http.Dir(s.HTTPDir)) server := &http.Server{Addr: httpAddr, Handler: fileServer} go server.Serve(s.l) // Save the address into the state so it can be accessed in the future state.Put("http_port", s.l.Port) return multistep.ActionContinue } func (s *StepHTTPServer) Cleanup(multistep.StateBag) { if s.l != nil { // Close the listener so that the HTTP server stops s.l.Close() } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_output_dir.go�������������������������0000664�0000000�0000000�00000003577�13771713062�0027174�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "fmt" "log" "os" "path/filepath" "time" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepOutputDir sets up the output directory by creating it if it does // not exist, deleting it if it does exist and we're forcing, and cleaning // it up when we're done with it. type StepOutputDir struct { Force bool Path string cleanup bool } func (s *StepOutputDir) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) if _, err := os.Stat(s.Path); err == nil { if !s.Force { err := fmt.Errorf( "Output directory exists: %s\n\n"+ "Use the force flag to delete it prior to building.", s.Path) state.Put("error", err) return multistep.ActionHalt } ui.Say("Deleting previous output directory...") os.RemoveAll(s.Path) } // Enable cleanup s.cleanup = true // Create the directory if err := os.MkdirAll(s.Path, 0755); err != nil { state.Put("error", err) return multistep.ActionHalt } // Make sure we can write in the directory f, err := os.Create(filepath.Join(s.Path, "_packer_perm_check")) if err != nil { err = fmt.Errorf("Couldn't write to output directory: %s", err) state.Put("error", err) return multistep.ActionHalt } f.Close() os.Remove(f.Name()) return multistep.ActionContinue } func (s *StepOutputDir) Cleanup(state multistep.StateBag) { if !s.cleanup { return } _, cancelled := state.GetOk(multistep.StateCancelled) _, halted := state.GetOk(multistep.StateHalted) if cancelled || halted { ui := state.Get("ui").(packersdk.Ui) ui.Say("Deleting output directory...") for i := 0; i < 5; i++ { err := os.RemoveAll(s.Path) if err == nil { break } log.Printf("Error removing output dir: %s", err) time.Sleep(2 * time.Second) } } } ���������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_output_dir_test.go��������������������0000664�0000000�0000000�00000006035�13771713062�0030223�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "bytes" "context" "io/ioutil" "os" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testState(t *testing.T) multistep.StateBag { state := new(multistep.BasicStateBag) state.Put("ui", &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), PB: &packersdk.NoopProgressTracker{}, }) return state } func testStepOutputDir(t *testing.T) *StepOutputDir { td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } if err := os.RemoveAll(td); err != nil { t.Fatalf("err: %s", err) } return &StepOutputDir{Force: false, Path: td} } func TestStepOutputDir_impl(t *testing.T) { var _ multistep.Step = new(StepOutputDir) } func TestStepOutputDir(t *testing.T) { state := testState(t) step := testStepOutputDir(t) defer os.RemoveAll(step.Path) // Test the run if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { t.Fatal("should NOT have error") } if _, err := os.Stat(step.Path); err != nil { t.Fatalf("err: %s", err) } // Test the cleanup step.Cleanup(state) if _, err := os.Stat(step.Path); err != nil { t.Fatalf("err: %s", err) } } func TestStepOutputDir_exists(t *testing.T) { state := testState(t) step := testStepOutputDir(t) // Make the dir if err := os.MkdirAll(step.Path, 0755); err != nil { t.Fatalf("bad: %s", err) } defer os.RemoveAll(step.Path) // Test the run if action := step.Run(context.Background(), state); action != multistep.ActionHalt { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); !ok { t.Fatal("should have error") } // Test the cleanup step.Cleanup(state) if _, err := os.Stat(step.Path); err != nil { t.Fatalf("err: %s", err) } } func TestStepOutputDir_cancelled(t *testing.T) { state := testState(t) step := testStepOutputDir(t) // Test the run if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { t.Fatal("should NOT have error") } if _, err := os.Stat(step.Path); err != nil { t.Fatalf("err: %s", err) } // Mark state.Put(multistep.StateCancelled, true) // Test the cleanup step.Cleanup(state) if _, err := os.Stat(step.Path); err == nil { t.Fatal("should not exist") } } func TestStepOutputDir_halted(t *testing.T) { state := testState(t) step := testStepOutputDir(t) // Test the run if action := step.Run(context.Background(), state); action != multistep.ActionContinue { t.Fatalf("bad action: %#v", action) } if _, ok := state.GetOk("error"); ok { t.Fatal("should NOT have error") } if _, err := os.Stat(step.Path); err != nil { t.Fatalf("err: %s", err) } // Mark state.Put(multistep.StateHalted, true) // Test the cleanup step.Cleanup(state) if _, err := os.Stat(step.Path); err == nil { t.Fatal("should not exist") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_provision.go��������������������������0000664�0000000�0000000�00000012452�13771713062�0027016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "context" "fmt" "log" "os" "strconv" "time" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // StepProvision runs the provisioners. // // Uses: // communicator packersdk.Communicator // hook packersdk.Hook // ui packersdk.Ui // // Produces: // <nothing> const HttpIPNotImplemented = "ERR_HTTP_IP_NOT_IMPLEMENTED_BY_BUILDER" const HttpPortNotImplemented = "ERR_HTTP_PORT_NOT_IMPLEMENTED_BY_BUILDER" const HttpAddrNotImplemented = "ERR_HTTP_ADDR_NOT_IMPLEMENTED_BY_BUILDER" func PopulateProvisionHookData(state multistep.StateBag) map[string]interface{} { hookData := make(map[string]interface{}) // Load Builder hook data from state, if it has been set. hd, ok := state.GetOk("generated_data") if ok { hookData = hd.(map[string]interface{}) } // Warn user that the id isn't implemented hookData["ID"] = "ERR_ID_NOT_IMPLEMENTED_BY_BUILDER" // instance_id is placed in state by the builders. // Not yet implemented in Chroot, lxc/lxd, Azure, Qemu. // Implemented in most others including digitalOcean (droplet id), // docker (container_id), and clouds which use "server" internally instead // of instance. id, ok := state.GetOk("instance_id") if ok { hookData["ID"] = id } hookData["PackerRunUUID"] = os.Getenv("PACKER_RUN_UUID") // Packer HTTP info hookData["PackerHTTPIP"] = HttpIPNotImplemented hookData["PackerHTTPPort"] = HttpPortNotImplemented hookData["PackerHTTPAddr"] = HttpAddrNotImplemented httpPort, okPort := state.GetOk("http_port") if okPort { hookData["PackerHTTPPort"] = strconv.Itoa(httpPort.(int)) } httIP, okIP := state.GetOk("http_ip") if okIP { hookData["PackerHTTPIP"] = httIP.(string) } if okPort && okIP { hookData["PackerHTTPAddr"] = fmt.Sprintf("%s:%s", hookData["PackerHTTPIP"], hookData["PackerHTTPPort"]) } // Read communicator data into hook data comm, ok := state.GetOk("communicator_config") if !ok { log.Printf("Unable to load communicator config from state to populate provisionHookData") return hookData } commConf := comm.(*communicator.Config) // Loop over all field values and retrieve them from the ssh config hookData["Host"] = commConf.Host() hookData["Port"] = commConf.Port() hookData["User"] = commConf.User() hookData["Password"] = commConf.Password() hookData["ConnType"] = commConf.Type hookData["SSHPublicKey"] = string(commConf.SSHPublicKey) hookData["SSHPrivateKey"] = string(commConf.SSHPrivateKey) hookData["SSHPrivateKeyFile"] = commConf.SSHPrivateKeyFile hookData["SSHAgentAuth"] = commConf.SSHAgentAuth // Backwards compatibility; in practice, WinRMPassword is fulfilled by // Password. hookData["WinRMPassword"] = commConf.WinRMPassword return hookData } type StepProvision struct { Comm packersdk.Communicator } func (s *StepProvision) runWithHook(ctx context.Context, state multistep.StateBag, hooktype string) multistep.StepAction { // hooktype will be either packersdk.HookProvision or packersdk.HookCleanupProvision comm := s.Comm if comm == nil { raw, ok := state.Get("communicator").(packersdk.Communicator) if ok { comm = raw.(packersdk.Communicator) } } hook := state.Get("hook").(packersdk.Hook) ui := state.Get("ui").(packersdk.Ui) hookData := PopulateProvisionHookData(state) // Update state generated_data with complete hookData // to make them accessible by post-processors state.Put("generated_data", hookData) // Run the provisioner in a goroutine so we can continually check // for cancellations... if hooktype == packersdk.HookProvision { log.Println("Running the provision hook") } else if hooktype == packersdk.HookCleanupProvision { ui.Say("Provisioning step had errors: Running the cleanup provisioner, if present...") } errCh := make(chan error, 1) go func() { errCh <- hook.Run(ctx, hooktype, ui, comm, hookData) }() for { select { case err := <-errCh: if err != nil { if hooktype == packersdk.HookProvision { // We don't overwrite the error if it's a cleanup // provisioner being run. state.Put("error", err) } else if hooktype == packersdk.HookCleanupProvision { origErr := state.Get("error").(error) state.Put("error", fmt.Errorf("Cleanup failed: %s. "+ "Original Provisioning error: %s", err, origErr)) } return multistep.ActionHalt } return multistep.ActionContinue case <-ctx.Done(): log.Printf("Cancelling provisioning due to context cancellation: %s", ctx.Err()) return multistep.ActionHalt case <-time.After(1 * time.Second): if _, ok := state.GetOk(multistep.StateCancelled); ok { log.Println("Cancelling provisioning due to interrupt...") return multistep.ActionHalt } } } } func (s *StepProvision) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { return s.runWithHook(ctx, state, packersdk.HookProvision) } func (s *StepProvision) Cleanup(state multistep.StateBag) { // We have a "final" provisioner that gets defined by "error-cleanup-provisioner" // which we only call if there's an error during the provision run and // the "error-cleanup-provisioner" is defined. if _, ok := state.GetOk("error"); ok { s.runWithHook(context.Background(), state, packersdk.HookCleanupProvision) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/step_provision_test.go���������������������0000664�0000000�0000000�00000007021�13771713062�0030051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package commonsteps import ( "fmt" "os" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" ) func testCommConfig() *communicator.Config { return &communicator.Config{ Type: "ssh", SSH: communicator.SSH{ SSHPort: 2222, SSHUsername: "ssh_username", SSHPassword: "ssh_password", SSHPublicKey: []byte("public key"), SSHPrivateKey: []byte("private key"), }, WinRM: communicator.WinRM{ WinRMPassword: "winrm_password", }, } } func TestStepProvision_Impl(t *testing.T) { var raw interface{} raw = new(StepProvision) if _, ok := raw.(multistep.Step); !ok { t.Fatalf("provision should be a step") } } func TestPopulateProvisionHookData(t *testing.T) { state := testState(t) commConfig := testCommConfig() generatedData := map[string]interface{}{"Data": "generated"} instanceId := 11111 packerRunUUID := "1fa225b8-27d1-42d1-9117-221772213962" httpIP := "10.0.2.2" httpPort := 2222 httpAddr := fmt.Sprintf("%s:%d", httpIP, httpPort) state.Put("generated_data", generatedData) state.Put("instance_id", instanceId) state.Put("communicator_config", commConfig) os.Setenv("PACKER_RUN_UUID", packerRunUUID) state.Put("http_ip", httpIP) state.Put("http_port", httpPort) hookData := PopulateProvisionHookData(state) if len(hookData) == 0 { t.Fatalf("Bad: hookData is empty!") } if hookData["Data"] != generatedData["Data"] { t.Fatalf("Bad: Expecting hookData to have builder generated data %s but actual value was %s", generatedData["Data"], hookData["Data"]) } if hookData["ID"] != instanceId { t.Fatalf("Bad: Expecting hookData[\"ID\"] was %d but actual value was %d", instanceId, hookData["ID"]) } if hookData["PackerRunUUID"] != packerRunUUID { t.Fatalf("Bad: Expecting hookData[\"PackerRunUUID\"] was %s but actual value was %s", packerRunUUID, hookData["PackerRunUUID"]) } if hookData["PackerHTTPAddr"] != httpAddr { t.Fatalf("Bad: Expecting hookData[\"PackerHTTPAddr\"] was %s but actual value was %s", httpAddr, hookData["PackerHTTPAddr"]) } if hookData["Host"] != commConfig.Host() { t.Fatalf("Bad: Expecting hookData[\"Host\"] was %s but actual value was %s", commConfig.Host(), hookData["Host"]) } if hookData["Port"] != commConfig.Port() { t.Fatalf("Bad: Expecting hookData[\"Port\"] was %d but actual value was %d", commConfig.Port(), hookData["Port"]) } if hookData["User"] != commConfig.User() { t.Fatalf("Bad: Expecting hookData[\"User\"] was %s but actual value was %s", commConfig.User(), hookData["User"]) } if hookData["Password"] != commConfig.Password() { t.Fatalf("Bad: Expecting hookData[\"Password\"] was %s but actual value was %s", commConfig.Password(), hookData["Password"]) } if hookData["ConnType"] != commConfig.Type { t.Fatalf("Bad: Expecting hookData[\"ConnType\"] was %s but actual value was %s", commConfig.Type, hookData["ConnType"]) } if hookData["SSHPublicKey"] != string(commConfig.SSHPublicKey) { t.Fatalf("Bad: Expecting hookData[\"SSHPublicKey\"] was %s but actual value was %s", string(commConfig.SSHPublicKey), hookData["SSHPublicKey"]) } if hookData["SSHPrivateKey"] != string(commConfig.SSHPrivateKey) { t.Fatalf("Bad: Expecting hookData[\"SSHPrivateKey\"] was %s but actual value was %s", string(commConfig.SSHPrivateKey), hookData["SSHPrivateKey"]) } if hookData["WinRMPassword"] != commConfig.WinRMPassword { t.Fatalf("Bad: Expecting hookData[\"WinRMPassword\"] was %s but actual value was %s", commConfig.WinRMPassword, hookData["WinRMPassword"]) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/�����������������������������0000775�0000000�0000000�00000000000�13771713062�0026226�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/SomeDir/���������������������0000775�0000000�0000000�00000000000�13771713062�0027570�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/SomeDir/myfile.txt�����������0000664�0000000�0000000�00000000000�13771713062�0031604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/�����������������0000775�0000000�0000000�00000000000�13771713062�0030464�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-0/����������0000775�0000000�0000000�00000000000�13771713062�0031600�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-0/file1�����0000664�0000000�0000000�00000000000�13771713062�0032511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-0/file2�����0000664�0000000�0000000�00000000000�13771713062�0032512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-0/file3�����0000664�0000000�0000000�00000000000�13771713062�0032513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-1/����������0000775�0000000�0000000�00000000000�13771713062�0031601�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-1/dir1/�����0000775�0000000�0000000�00000000000�13771713062�0032440�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-1/dir1/file10000664�0000000�0000000�00000000000�13771713062�0033351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-1/dir1/file20000664�0000000�0000000�00000000000�13771713062�0033352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-1/dir1/file30000664�0000000�0000000�00000000000�13771713062�0033353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/����������0000775�0000000�0000000�00000000000�13771713062�0031602�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir1/�����0000775�0000000�0000000�00000000000�13771713062�0032441�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir1/file10000664�0000000�0000000�00000000000�13771713062�0033352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������subdir1/��������������������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0033733�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir1�������������������������������������������������������������������������file1�����������������������������������������������������������������������������������������������0000664�0000000�0000000�00000000000�13771713062�0034644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir1/subdir1�����������������������������������������������������������������file2�����������������������������������������������������������������������������������������������0000664�0000000�0000000�00000000000�13771713062�0034645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir1/subdir1�����������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir2/�����0000775�0000000�0000000�00000000000�13771713062�0032442�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������subdir1/��������������������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0033734�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir2�������������������������������������������������������������������������file1�����������������������������������������������������������������������������������������������0000664�0000000�0000000�00000000000�13771713062�0034645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir2/subdir1�����������������������������������������������������������������file2�����������������������������������������������������������������������������������������������0000664�0000000�0000000�00000000000�13771713062�0034646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/floppy-hier/test-2/dir2/subdir1�����������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/root/������������������������0000775�0000000�0000000�00000000000�13771713062�0027211�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/root/another.txt�������������0000664�0000000�0000000�00000000010�13771713062�0031401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������another ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/root/another.txt.sha1sum�����0000664�0000000�0000000�00000000066�13771713062�0032774�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������7c6e5dd1bacb3b48fdffba2ed096097eb172497d another.txt ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/root/basic.txt���������������0000664�0000000�0000000�00000000006�13771713062�0031027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������hello ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/root/basic.txt.sha1sum�������0000664�0000000�0000000�00000000064�13771713062�0032413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������f572d396fae9206628714fb2ce00f72e94f2258f basic.txt ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/commonsteps/test-fixtures/root/subfolder.sum�����������0000664�0000000�0000000�00000000176�13771713062�0031730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������a264b6b009dfaa16286fdfd046a156a43587333b ./hwe-netboot/mini.iso 27c39bac2cf4640c00cacfc8982b0ba39e7b7f96 ./netboot/mini.iso ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/debug_runner.go����������������������������������������0000664�0000000�0000000�00000006175�13771713062�0024050�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep import ( "context" "fmt" "reflect" "sync" ) // DebugLocation is the location where the pause is occurring when debugging // a step sequence. "DebugLocationAfterRun" is after the run of the named // step. "DebugLocationBeforeCleanup" is before the cleanup of the named // step. type DebugLocation uint const ( DebugLocationAfterRun DebugLocation = iota DebugLocationBeforeCleanup ) // StepWrapper is an interface that wrapped steps can implement to expose their // inner step names to the debug runner. type StepWrapper interface { // InnerStepName should return the human readable name of the wrapped step. InnerStepName() string } // DebugPauseFn is the type signature for the function that is called // whenever the DebugRunner pauses. It allows the caller time to // inspect the state of the multi-step sequence at a given step. type DebugPauseFn func(DebugLocation, string, StateBag) // DebugRunner is a Runner that runs the given set of steps in order, // but pauses between each step until it is told to continue. type DebugRunner struct { // Steps is the steps to run. These will be run in order. Steps []Step // PauseFn is the function that is called whenever the debug runner // pauses. The debug runner continues when this function returns. // The function is given the state so that the state can be inspected. PauseFn DebugPauseFn l sync.Mutex runner *BasicRunner } func (r *DebugRunner) Run(ctx context.Context, state StateBag) { r.l.Lock() if r.runner != nil { panic("already running") } r.runner = new(BasicRunner) r.l.Unlock() pauseFn := r.PauseFn // If no PauseFn is specified, use the default if pauseFn == nil { pauseFn = DebugPauseDefault } // Rebuild the steps so that we insert the pause step after each steps := make([]Step, len(r.Steps)*2) for i, step := range r.Steps { if step == nil { continue } steps[i*2] = step name := "" if wrapped, ok := step.(StepWrapper); ok { name = wrapped.InnerStepName() } else { name = reflect.Indirect(reflect.ValueOf(step)).Type().Name() } steps[(i*2)+1] = &debugStepPause{ name, pauseFn, } } // Then just use a basic runner to run it r.runner.Steps = steps r.runner.Run(ctx, state) } // DebugPauseDefault is the default pause function when using the // DebugRunner if no PauseFn is specified. It outputs some information // to stderr about the step and waits for keyboard input on stdin before // continuing. func DebugPauseDefault(loc DebugLocation, name string, state StateBag) { var locationString string switch loc { case DebugLocationAfterRun: locationString = "after run of" case DebugLocationBeforeCleanup: locationString = "before cleanup of" } fmt.Printf("Pausing %s step '%s'. Press any key to continue.\n", locationString, name) var line string fmt.Scanln(&line) } type debugStepPause struct { StepName string PauseFn DebugPauseFn } func (s *debugStepPause) Run(ctx context.Context, state StateBag) StepAction { s.PauseFn(DebugLocationAfterRun, s.StepName, state) return ActionContinue } func (s *debugStepPause) Cleanup(state StateBag) { s.PauseFn(DebugLocationBeforeCleanup, s.StepName, state) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/debug_runner_test.go�����������������������������������0000664�0000000�0000000�00000010372�13771713062�0025101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep import ( "context" "os" "reflect" "testing" "time" ) func TestDebugRunner_Impl(t *testing.T) { var raw interface{} raw = &DebugRunner{} if _, ok := raw.(Runner); !ok { t.Fatal("DebugRunner must be a runner.") } } func TestDebugRunner_Run(t *testing.T) { data := new(BasicStateBag) stepA := &TestStepAcc{Data: "a"} stepB := &TestStepAcc{Data: "b"} pauseFn := func(loc DebugLocation, name string, state StateBag) { key := "data" if loc == DebugLocationBeforeCleanup { key = "cleanup" } if _, ok := state.GetOk(key); !ok { state.Put(key, make([]string, 0, 5)) } data := state.Get(key).([]string) state.Put(key, append(data, name)) } r := &DebugRunner{ Steps: []Step{stepA, stepB}, PauseFn: pauseFn, } r.Run(context.Background(), data) // Test data expected := []string{"a", "TestStepAcc", "b", "TestStepAcc"} results := data.Get("data").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected results: %#v", results) } // Test cleanup expected = []string{"TestStepAcc", "b", "TestStepAcc", "a"} results = data.Get("cleanup").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected results: %#v", results) } } // confirm that can't run twice func TestDebugRunner_Run_Run(t *testing.T) { defer func() { recover() }() ch := make(chan chan bool) stepInt := &TestStepSync{ch} stepWait := &TestStepWaitForever{} r := &DebugRunner{Steps: []Step{stepInt, stepWait}} go r.Run(context.Background(), new(BasicStateBag)) // wait until really running <-ch // now try to run aain r.Run(context.Background(), new(BasicStateBag)) // should not get here in nominal codepath t.Errorf("Was able to run an already running DebugRunner") } type TestStepFn struct { run func(context.Context, StateBag) StepAction cleanup func(StateBag) } var _ Step = TestStepFn{} func (fn TestStepFn) Run(ctx context.Context, sb StateBag) StepAction { return fn.run(ctx, sb) } func (fn TestStepFn) Cleanup(sb StateBag) { if fn.cleanup != nil { fn.cleanup(sb) } } func TestDebugRunner_Cancel(t *testing.T) { topCtx, topCtxCancel := context.WithCancel(context.Background()) checkCancelled := func(data StateBag) { cancelled := data.Get(StateCancelled).(bool) if !cancelled { t.Fatal("state should be cancelled") } } data := new(BasicStateBag) r := &DebugRunner{} r.Steps = []Step{ &TestStepAcc{Data: "a"}, &TestStepAcc{Data: "b"}, TestStepFn{ run: func(ctx context.Context, sb StateBag) StepAction { return ActionContinue }, cleanup: checkCancelled, }, TestStepFn{ run: func(ctx context.Context, sb StateBag) StepAction { topCtxCancel() <-ctx.Done() return ActionContinue }, cleanup: checkCancelled, }, TestStepFn{ run: func(context.Context, StateBag) StepAction { t.Fatal("I should not be called") return ActionContinue }, cleanup: func(StateBag) { t.Fatal("I should not be called") }, }, } r.Run(topCtx, data) // Test run data expected := []string{"a", "b"} results := data.Get("data").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test cleanup data expected = []string{"b", "a"} results = data.Get("cleanup").([]string) if !reflect.DeepEqual(results, expected) { t.Errorf("unexpected result: %#v", results) } // Test that it says it is cancelled cancelled, ok := data.GetOk(StateCancelled) if !ok { t.Fatal("could not get state cancelled") } if !cancelled.(bool) { t.Errorf("not cancelled") } } func TestDebugPauseDefault(t *testing.T) { // Create a pipe pair so that writes/reads are blocked until we do it r, w, err := os.Pipe() if err != nil { t.Fatalf("err: %s", err) } // Set stdin so we can control it oldStdin := os.Stdin os.Stdin = r defer func() { os.Stdin = oldStdin }() // Start pausing complete := make(chan bool, 1) go func() { dr := &DebugRunner{Steps: []Step{ &TestStepAcc{Data: "a"}, }} dr.Run(context.Background(), new(BasicStateBag)) complete <- true }() select { case <-complete: t.Fatal("shouldn't have completed") case <-time.After(100 * time.Millisecond): } w.Write([]byte("\n\n")) select { case <-complete: case <-time.After(100 * time.Millisecond): t.Fatal("didn't complete") } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/doc.go�������������������������������������������������0000664�0000000�0000000�00000002577�13771713062�0022140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* multistep is a Go library for building up complex actions using discrete, individual "steps." These steps are strung together and run in sequence to achieve a more complex goal. The runner handles cleanup, cancelling, etc. if necessary. ## Basic Example Make a step to perform some action. The step can access your "state", which is passed between steps by the runner. ```go type stepAdd struct{} func (s *stepAdd) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { // Read our value and assert that it is they type we want value := state.Get("value").(int) fmt.Printf("Value is %d\n", value) // Store some state back state.Put("value", value + 1) return multistep.ActionContinue } func (s *stepAdd) Cleanup(multistep.StateBag) { // This is called after all the steps have run or if the runner is // cancelled so that cleanup can be performed. } ``` Make a runner and call your array of Steps. ```go func main() { // Our "bag of state" that we read the value from state := new(multistep.BasicStateBag) state.Put("value", 0) steps := []multistep.Step{ &stepAdd{}, &stepAdd{}, &stepAdd{}, } runner := &multistep.BasicRunner{Steps: steps} // Executes the steps runner.Run(context.Background(), state) } ``` This will produce: ``` Value is 0 Value is 1 Value is 2 ``` */ package multistep ���������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/if.go��������������������������������������������������0000664�0000000�0000000�00000000226�13771713062�0021756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep // if returns step only if on is true. func If(on bool, step Step) Step { if on == false { return &nullStep{} } return step } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/multistep.go�������������������������������������������0000664�0000000�0000000�00000004143�13771713062�0023410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// multistep is a library for building up complex actions using individual, // discrete steps. package multistep import ( "context" "strconv" ) // A StepAction determines the next step to take regarding multi-step actions. type StepAction uint const ( ActionContinue StepAction = iota ActionHalt ) // Implement the stringer interface; useful for testing. func (a StepAction) String() string { switch a { case ActionContinue: return "ActionContinue" case ActionHalt: return "ActionHalt" default: return "Unexpected value: " + strconv.Itoa(int(a)) } } // This is the key set in the state bag when using the basic runner to // signal that the step sequence was cancelled. const StateCancelled = "cancelled" // This is the key set in the state bag when a step halted the sequence. const StateHalted = "halted" // Step is a single step that is part of a potentially large sequence // of other steps, responsible for performing some specific action. type Step interface { // Run is called to perform the action. The passed through context will be // cancelled when the runner is cancelled. The second parameter is a "state // bag" of untyped things. Please be very careful about type-checking the // items in this bag. // // The return value determines whether multi-step sequences continue // or should halt. Run(context.Context, StateBag) StepAction // Cleanup is called in reverse order of the steps that have run // and allow steps to clean up after themselves. Do not assume if this // ran that the entire multi-step sequence completed successfully. This // method can be ran in the face of errors and cancellations as well. // // The parameter is the same "state bag" as Run, and represents the // state at the latest possible time prior to calling Cleanup. Cleanup(StateBag) } // Runner is a thing that runs one or more steps. type Runner interface { // Run runs the steps with the given initial state. Run(context.Context, StateBag) } type nullStep struct{} func (s nullStep) Run(ctx context.Context, state StateBag) StepAction { return ActionContinue } func (s nullStep) Cleanup(state StateBag) {} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/multistep_test.go��������������������������������������0000664�0000000�0000000�00000003204�13771713062�0024444�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep import "context" // A step for testing that accumulates data into a string slice in the // the state bag. It always uses the "data" key in the state bag, and will // initialize it. type TestStepAcc struct { // The data inserted into the state bag. Data string // If true, it will halt at the step when it is run Halt bool } // A step that syncs by sending a channel and expecting a response. type TestStepSync struct { Ch chan chan bool } // A step that sleeps forever type TestStepWaitForever struct { } // A step that manually flips state to cancelling in run type TestStepInjectCancel struct { } func (s TestStepAcc) Run(ctx context.Context, state StateBag) StepAction { s.insertData(state, "data") if s.Halt { return ActionHalt } return ActionContinue } func (s TestStepAcc) Cleanup(state StateBag) { s.insertData(state, "cleanup") } func (s TestStepAcc) insertData(state StateBag, key string) { if _, ok := state.GetOk(key); !ok { state.Put(key, make([]string, 0, 5)) } data := state.Get(key).([]string) data = append(data, s.Data) state.Put(key, data) } func (s TestStepSync) Run(context.Context, StateBag) StepAction { ch := make(chan bool) s.Ch <- ch <-ch return ActionContinue } func (s TestStepSync) Cleanup(StateBag) { close(s.Ch) } func (s TestStepWaitForever) Run(context.Context, StateBag) StepAction { select {} } func (s TestStepWaitForever) Cleanup(StateBag) {} func (s TestStepInjectCancel) Run(ctx context.Context, state StateBag) StepAction { r := state.Get("runner").(*BasicRunner) r.state = stateCancelling return ActionContinue } func (s TestStepInjectCancel) Cleanup(StateBag) {} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/statebag.go��������������������������������������������0000664�0000000�0000000�00000002117�13771713062�0023153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep import "sync" // Add context to state bag to prevent changing step signature // StateBag holds the state that is used by the Runner and Steps. The // StateBag implementation must be safe for concurrent access. type StateBag interface { Get(string) interface{} GetOk(string) (interface{}, bool) Put(string, interface{}) Remove(string) } // BasicStateBag implements StateBag by using a normal map underneath // protected by a RWMutex. type BasicStateBag struct { data map[string]interface{} l sync.RWMutex once sync.Once } func (b *BasicStateBag) Get(k string) interface{} { result, _ := b.GetOk(k) return result } func (b *BasicStateBag) GetOk(k string) (interface{}, bool) { b.l.RLock() defer b.l.RUnlock() result, ok := b.data[k] return result, ok } func (b *BasicStateBag) Put(k string, v interface{}) { b.l.Lock() defer b.l.Unlock() // Make sure the map is initialized one time, on write b.once.Do(func() { b.data = make(map[string]interface{}) }) // Write the data b.data[k] = v } func (b *BasicStateBag) Remove(k string) { delete(b.data, k) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/multistep/statebag_test.go���������������������������������������0000664�0000000�0000000�00000000757�13771713062�0024222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package multistep import ( "testing" ) func TestBasicStateBag_ImplRunner(t *testing.T) { var raw interface{} raw = &BasicStateBag{} if _, ok := raw.(StateBag); !ok { t.Fatalf("must be a StateBag") } } func TestBasicStateBag(t *testing.T) { b := new(BasicStateBag) if b.Get("foo") != nil { t.Fatalf("bad: %#v", b.Get("foo")) } if _, ok := b.GetOk("foo"); ok { t.Fatal("should not have foo") } b.Put("foo", "bar") if b.Get("foo").(string) != "bar" { t.Fatalf("bad") } } �����������������packer-1.6.6+ds1/packer-plugin-sdk/net/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017571�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/net/configure_port.go��������������������������������������������0000664�0000000�0000000�00000006233�13771713062�0023151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package net import ( "context" "fmt" "log" "math/rand" "net" "os" "strconv" "time" "github.com/hashicorp/packer/packer-plugin-sdk/filelock" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" ) var _ net.Listener = &Listener{} // Listener wraps a net.Lister with some Packer-specific capabilies. For // example, until you call Listener.Close, any call to ListenRangeConfig.Listen // cannot bind to a Port. Packer tries to tell moving parts which port they can // use, but often the port has to be released before a 3rd party is started, // like a VNC server. type Listener struct { // Listener can be closed but Port will be file locked by packer until // Close is called. net.Listener Port int Address string lock *filelock.Flock cleanupFunc func() error } func (l *Listener) Close() error { err := l.lock.Unlock() if err != nil { log.Printf("cannot unlock lockfile %#v: %v", l, err) } err = l.Listener.Close() if err != nil { return err } if l.cleanupFunc != nil { err := l.cleanupFunc() if err != nil { log.Printf("cannot cleanup: %#v", err) } } return nil } // ListenRangeConfig contains options for listening to a free address [Min,Max) // range. ListenRangeConfig wraps a net.ListenConfig. type ListenRangeConfig struct { // like "tcp" or "udp". defaults to "tcp". Network string Addr string Min, Max int net.ListenConfig } // Listen tries to Listen to a random open TCP port in the [min, max) range // until ctx is cancelled. // Listen uses net.ListenConfig.Listen internally. func (lc ListenRangeConfig) Listen(ctx context.Context) (*Listener, error) { if lc.Network == "" { lc.Network = "tcp" } portRange := lc.Max - lc.Min var listener *Listener err := retry.Config{ RetryDelay: func() time.Duration { return 1 * time.Millisecond }, }.Run(ctx, func(context.Context) error { port := lc.Min if portRange > 0 { port += rand.Intn(portRange) } lockFilePath, err := packersdk.CachePath("port", strconv.Itoa(port)) if err != nil { return err } lock := filelock.New(lockFilePath) locked, err := lock.TryLock() if err != nil { return err } if !locked { return ErrPortFileLocked(port) } l, err := lc.ListenConfig.Listen(ctx, lc.Network, fmt.Sprintf("%s:%d", lc.Addr, port)) if err != nil { if err := lock.Unlock(); err != nil { log.Fatalf("Could not unlock file lock for port %d: %v", port, err) } return &ErrPortBusy{ Port: port, Err: err, } } cleanupFunc := func() error { return os.Remove(lockFilePath) } log.Printf("Found available port: %d on IP: %s", port, lc.Addr) listener = &Listener{ Address: lc.Addr, Port: port, Listener: l, lock: lock, cleanupFunc: cleanupFunc, } return nil }) return listener, err } type ErrPortFileLocked int func (port ErrPortFileLocked) Error() string { return fmt.Sprintf("Port %d is file locked", port) } type ErrPortBusy struct { Port int Err error } func (err *ErrPortBusy) Error() string { if err == nil { return "<nil>" } return fmt.Sprintf("port %d cannot be opened: %v", err.Port, err.Err) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/net/configure_port_test.go���������������������������������������0000664�0000000�0000000�00000010043�13771713062�0024202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package net import ( "context" "net" "testing" "time" ) func TestListenRangeConfig_Listen(t *testing.T) { topCtx, cancel := context.WithCancel(context.Background()) defer cancel() var err error var lockedListener *Listener { // open a random port in range ctx, cancel := context.WithTimeout(topCtx, time.Second*5) lockedListener, err = ListenRangeConfig{ Min: 800, Max: 10000, Addr: "localhost", }.Listen(ctx) if err != nil { t.Fatalf("could not open first port") } cancel() defer lockedListener.Close() // in case } { // open a second random port in range ctx, cancel := context.WithTimeout(topCtx, time.Second*5) listener, err := ListenRangeConfig{ Min: 800, Max: 10000, Addr: "localhost", }.Listen(ctx) if err != nil { t.Fatalf("could not open first port") } cancel() if err := listener.Close(); err != nil { // in case t.Fatal("failed to close second random port") } } { // test that opened port cannot be openned using min/max ctx, cancel := context.WithTimeout(topCtx, 250*time.Millisecond) l, err := ListenRangeConfig{ Min: lockedListener.Port, Max: lockedListener.Port, }.Listen(ctx) if err == nil { l.Close() t.Fatal("port should be taken, this should fail") } if p := int(err.(ErrPortFileLocked)); p != lockedListener.Port { t.Fatalf("wrong fileport: %d", p) } cancel() } { // test that opened port cannot be openned using min only ctx, cancel := context.WithTimeout(topCtx, 250*time.Millisecond) l, err := ListenRangeConfig{ Min: lockedListener.Port, }.Listen(ctx) if err == nil { l.Close() t.Fatalf("port should be taken, this should timeout.") } portErr, ok := err.(ErrPortFileLocked) if !ok { t.Fatalf("unexpected error: %v", err) } if p := int(portErr); p != lockedListener.Port { t.Fatalf("wrong fileport: %d", p) } cancel() } err = lockedListener.Close() // close port and release lock file if err != nil { t.Fatalf("could not release lockfile or port: %v", err) } { // test that closed port can be reopenned. ctx, cancel := context.WithTimeout(topCtx, 250*time.Millisecond) lockedListener, err = ListenRangeConfig{ Min: lockedListener.Port, }.Listen(ctx) if err != nil { t.Fatalf("port should have been freed: %v", err) } cancel() defer lockedListener.Close() // in case } err = lockedListener.Listener.Close() // close listener, keep lockfile only if err != nil { t.Fatalf("could not release lockfile or port: %v", err) } { // test that file locked port cannot be opened ctx, cancel := context.WithTimeout(topCtx, 250*time.Millisecond) l, err := ListenRangeConfig{ Min: lockedListener.Port, }.Listen(ctx) if err == nil { l.Close() t.Fatalf("port should be file locked, this should timeout") } cancel() } var netListener net.Listener { // test that the closed network port can be reopened using net.Listen netListener, err = net.Listen("tcp", lockedListener.Addr().String()) if err != nil { t.Fatalf("listen on freed port failed: %v", err) } } if err := lockedListener.lock.Unlock(); err != nil { t.Fatalf("error closing port: %v", err) } { // test that busy port cannot be opened ctx, cancel := context.WithTimeout(topCtx, 250*time.Millisecond) l, err := ListenRangeConfig{ Min: lockedListener.Port, }.Listen(ctx) if err == nil { l.Close() t.Fatalf("port should be file locked, this should timeout") } busyErr := err.(*ErrPortBusy) if busyErr.Port != lockedListener.Port { t.Fatal("wrong port") } // error types vary depending on OS and it might get quickly // complicated to test for the error we want. cancel() } if err := netListener.Close(); err != nil { // free port t.Fatalf("close failed: %v", err) } { // test that freed port can be opened ctx, cancel := context.WithTimeout(topCtx, 250*time.Minute) lockedListener, err = ListenRangeConfig{ Min: lockedListener.Port, }.Listen(ctx) if err != nil { t.Fatalf("port should have been freed: %v", err) } cancel() defer lockedListener.Close() // in case } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/net/default_client.go��������������������������������������������0000664�0000000�0000000�00000000327�13771713062�0023104�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package net import ( "net/http" ) func HttpClientWithEnvironmentProxy() *http.Client { httpClient := &http.Client{ Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, }, } return httpClient } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020250�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/artifact.go�����������������������������������������������0000664�0000000�0000000�00000002673�13771713062�0022404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer // An Artifact is the result of a build, and is the metadata that documents // what a builder actually created. The exact meaning of the contents is // specific to each builder, but this interface is used to communicate back // to the user the result of a build. type Artifact interface { // Returns the ID of the builder that was used to create this artifact. // This is the internal ID of the builder and should be unique to every // builder. This can be used to identify what the contents of the // artifact actually are. BuilderId() string // Returns the set of files that comprise this artifact. If an // artifact is not made up of files, then this will be empty. Files() []string // The ID for the artifact, if it has one. This is not guaranteed to // be unique every run (like a GUID), but simply provide an identifier // for the artifact that may be meaningful in some way. For example, // for Amazon EC2, this value might be the AMI ID. Id() string // Returns human-readable output that describes the artifact created. // This is used for UI output. It can be multiple lines. String() string // State allows the caller to ask for builder specific state information // relating to the artifact instance. State(name string) interface{} // Destroy deletes the artifact. Packer calls this for various reasons, // such as if a post-processor has processed this artifact and it is // no longer needed. Destroy() error } ���������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/artifact_mock.go������������������������������������������0000664�0000000�0000000�00000001624�13771713062�0023410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer // MockArtifact is an implementation of Artifact that can be used for tests. type MockArtifact struct { BuilderIdValue string FilesValue []string IdValue string StateValues map[string]interface{} DestroyCalled bool StringValue string } func (a *MockArtifact) BuilderId() string { if a.BuilderIdValue == "" { return "bid" } return a.BuilderIdValue } func (a *MockArtifact) Files() []string { if a.FilesValue == nil { return []string{"a", "b"} } return a.FilesValue } func (a *MockArtifact) Id() string { id := a.IdValue if id == "" { id = "id" } return id } func (a *MockArtifact) String() string { str := a.StringValue if str == "" { str = "string" } return str } func (a *MockArtifact) State(name string) interface{} { value := a.StateValues[name] return value } func (a *MockArtifact) Destroy() error { a.DestroyCalled = true return nil } ������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/artifact_test.go������������������������������������������0000664�0000000�0000000�00000001110�13771713062�0023424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer type TestArtifact struct { id string state map[string]interface{} destroyCalled bool } func (*TestArtifact) BuilderId() string { return "bid" } func (*TestArtifact) Files() []string { return []string{"a", "b"} } func (a *TestArtifact) Id() string { id := a.id if id == "" { id = "id" } return id } func (*TestArtifact) String() string { return "string" } func (a *TestArtifact) State(name string) interface{} { value := a.state[name] return value } func (a *TestArtifact) Destroy() error { a.destroyCalled = true return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/build.go��������������������������������������������������0000664�0000000�0000000�00000003105�13771713062�0021675�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import "context" // A Build represents a single job within Packer that is responsible for // building some machine image artifact. Builds are meant to be parallelized. type Build interface { // Name is the name of the build. This is unique across a single template, // but not absolutely unique. This is meant more to describe to the user // what is being built rather than being a unique identifier. Name() string // Prepare configures the various components of this build and reports // any errors in doing so (such as syntax errors, validation errors, etc.). // It also reports any warnings. Prepare() ([]string, error) // Run runs the actual builder, returning an artifact implementation // of what is built. If anything goes wrong, an error is returned. // Run can be context cancelled. Run(context.Context, Ui) ([]Artifact, error) // SetDebug will enable/disable debug mode. Debug mode is always // enabled by adding the additional key "packer_debug" to boolean // true in the configuration of the various components. This must // be called prior to Prepare. // // When SetDebug is set to true, parallelism between builds is // strictly prohibited. SetDebug(bool) // SetForce will enable/disable forcing a build when artifacts exist. // // When SetForce is set to true, existing artifacts from the build are // deleted prior to the build. SetForce(bool) // SetOnError will determine what to do when a normal multistep step fails // - "cleanup" - run cleanup steps // - "abort" - exit without cleanup // - "ask" - ask the user SetOnError(string) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/builder.go������������������������������������������������0000664�0000000�0000000�00000003122�13771713062�0022223�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" ) // Implementers of Builder are responsible for actually building images // on some platform given some configuration. // // In addition to the documentation on Prepare above: Prepare is sometimes // configured with a `map[string]interface{}` that has a key "packer_debug". // This is a boolean value. If it is set to true, then the builder should // enable a debug mode which allows builder developers and advanced users // to introspect what is going on during a build. During debug builds, // parallelism is strictly disabled, so it is safe to request input from // stdin and so on. type Builder interface { HCL2Speccer // Prepare is responsible for configuring the builder and validating // that configuration. Any setup should be done in this method. Note that // NO side effects should take place in prepare, it is meant as a state // setup only. Calling Prepare is not necessarily followed by a Run. // // The parameters to Prepare are a set of interface{} values of the // configuration. These are almost always `map[string]interface{}` // parsed from a template, but no guarantee is made. // // Each of the configuration values should merge into the final // configuration. // // Prepare should return a list of variables that will be made accessible to // users during the provision methods, a list of warnings along with any // errors that occurred while preparing. Prepare(...interface{}) ([]string, []string, error) // Run is where the actual build should take place. It takes a Build and a Ui. Run(context.Context, Ui, Hook) (Artifact, error) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/builder_mock.go�������������������������������������������0000664�0000000�0000000�00000002731�13771713062�0023241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type MockBuilder package packer import ( "context" "errors" "github.com/hashicorp/hcl/v2/hcldec" ) // MockBuilder is an implementation of Builder that can be used for tests. // You can set some fake return values and you can keep track of what // methods were called on the builder. It is fairly basic. type MockBuilder struct { ArtifactId string PrepareWarnings []string RunErrResult bool RunNilResult bool PrepareCalled bool PrepareConfig []interface{} RunCalled bool RunHook Hook RunUi Ui CancelCalled bool RunFn func(ctx context.Context) GeneratedVars []string } func (tb *MockBuilder) ConfigSpec() hcldec.ObjectSpec { return tb.FlatMapstructure().HCL2Spec() } func (tb *MockBuilder) FlatConfig() interface{} { return tb.FlatMapstructure() } func (tb *MockBuilder) Prepare(config ...interface{}) ([]string, []string, error) { tb.PrepareCalled = true tb.PrepareConfig = config return tb.GeneratedVars, tb.PrepareWarnings, nil } func (tb *MockBuilder) Run(ctx context.Context, ui Ui, h Hook) (Artifact, error) { tb.RunCalled = true tb.RunHook = h tb.RunUi = ui if tb.RunErrResult { return nil, errors.New("foo") } if tb.RunNilResult { return nil, nil } if tb.RunFn != nil { tb.RunFn(ctx) } if h != nil { if err := h.Run(ctx, HookProvision, ui, new(MockCommunicator), nil); err != nil { return nil, err } } return &MockArtifact{ IdValue: tb.ArtifactId, }, nil } ���������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/builder_mock.hcl2spec.go����������������������������������0000664�0000000�0000000�00000005607�13771713062�0024750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type MockBuilder"; DO NOT EDIT. package packer import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatMockBuilder is an auto-generated flat version of MockBuilder. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatMockBuilder struct { ArtifactId *string `cty:"artifact_id" hcl:"artifact_id"` PrepareWarnings []string `cty:"prepare_warnings" hcl:"prepare_warnings"` RunErrResult *bool `cty:"run_err_result" hcl:"run_err_result"` RunNilResult *bool `cty:"run_nil_result" hcl:"run_nil_result"` PrepareCalled *bool `cty:"prepare_called" hcl:"prepare_called"` PrepareConfig []interface{} `cty:"prepare_config" hcl:"prepare_config"` RunCalled *bool `cty:"run_called" hcl:"run_called"` RunHook Hook `cty:"run_hook" hcl:"run_hook"` RunUi Ui `cty:"run_ui" hcl:"run_ui"` CancelCalled *bool `cty:"cancel_called" hcl:"cancel_called"` GeneratedVars []string `cty:"generated_vars" hcl:"generated_vars"` } // FlatMapstructure returns a new FlatMockBuilder. // FlatMockBuilder is an auto-generated flat version of MockBuilder. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*MockBuilder) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatMockBuilder) } // HCL2Spec returns the hcl spec of a MockBuilder. // This spec is used by HCL to read the fields of MockBuilder. // The decoded values from this spec will then be applied to a FlatMockBuilder. func (*FlatMockBuilder) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "artifact_id": &hcldec.AttrSpec{Name: "artifact_id", Type: cty.String, Required: false}, "prepare_warnings": &hcldec.AttrSpec{Name: "prepare_warnings", Type: cty.List(cty.String), Required: false}, "run_err_result": &hcldec.AttrSpec{Name: "run_err_result", Type: cty.Bool, Required: false}, "run_nil_result": &hcldec.AttrSpec{Name: "run_nil_result", Type: cty.Bool, Required: false}, "prepare_called": &hcldec.AttrSpec{Name: "prepare_called", Type: cty.Bool, Required: false}, "prepare_config": &hcldec.AttrSpec{Name: "prepare_config", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "run_called": &hcldec.AttrSpec{Name: "run_called", Type: cty.Bool, Required: false}, "run_hook": &hcldec.AttrSpec{Name: "run_hook", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "run_ui": &hcldec.AttrSpec{Name: "run_ui", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "cancel_called": &hcldec.AttrSpec{Name: "cancel_called", Type: cty.Bool, Required: false}, "generated_vars": &hcldec.AttrSpec{Name: "generated_vars", Type: cty.List(cty.String), Required: false}, } return s } �������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/cache.go��������������������������������������������������0000664�0000000�0000000�00000002112�13771713062�0021636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "os" "path/filepath" ) var DefaultCacheDir = "packer_cache" // CachePath returns an absolute path to a cache file or directory // // When the directory is not absolute, CachePath will try to get // current working directory to be able to return a full path. // CachePath tries to create the resulting path if it doesn't exist. // // CachePath can error in case it cannot find the cwd. // // ex: // PACKER_CACHE_DIR="" CacheDir() => "./packer_cache/ // PACKER_CACHE_DIR="" CacheDir("foo") => "./packer_cache/foo // PACKER_CACHE_DIR="bar" CacheDir("foo") => "./bar/foo // PACKER_CACHE_DIR="/home/there" CacheDir("foo", "bar") => "/home/there/foo/bar func CachePath(paths ...string) (path string, err error) { defer func() { // create the dir based on return path if it doesn't exist os.MkdirAll(filepath.Dir(path), os.ModePerm) }() cacheDir := DefaultCacheDir if cd := os.Getenv("PACKER_CACHE_DIR"); cd != "" { cacheDir = cd } paths = append([]string{cacheDir}, paths...) return filepath.Abs(filepath.Join(paths...)) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/cache_test.go���������������������������������������������0000664�0000000�0000000�00000002222�13771713062�0022677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "os" "path/filepath" "testing" ) func TestCachePath(t *testing.T) { wd, err := os.Getwd() if err != nil { t.Fatalf("Getwd: %v", err) } tmp := os.TempDir() // reset env cd := os.Getenv("PACKER_CACHE_DIR") os.Setenv("PACKER_CACHE_DIR", "") defer func() { os.Setenv("PACKER_CACHE_DIR", cd) }() type args struct { paths []string } tests := []struct { name string args args env map[string]string want string wantErr bool }{ {"base", args{}, nil, filepath.Join(wd, "packer_cache"), false}, {"base and path", args{[]string{"a", "b"}}, nil, filepath.Join(wd, "packer_cache", "a", "b"), false}, {"env and path", args{[]string{"a", "b"}}, map[string]string{"PACKER_CACHE_DIR": tmp}, filepath.Join(tmp, "a", "b"), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { for k, v := range tt.env { os.Setenv(k, v) } got, err := CachePath(tt.args.paths...) if (err != nil) != tt.wantErr { t.Errorf("CachePath() error = %v, wantErr %v", err, tt.wantErr) return } if got != tt.want { t.Errorf("CachePath() = %v, want %v", got, tt.want) } }) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/communicator.go�������������������������������������������0000664�0000000�0000000�00000013501�13771713062�0023277�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "io" "os" "strings" "sync" "unicode" "github.com/mitchellh/iochan" ) // CmdDisconnect is a sentinel value to indicate a RemoteCmd // exited because the remote side disconnected us. const CmdDisconnect int = 2300218 // RemoteCmd represents a remote command being prepared or run. type RemoteCmd struct { // Command is the command to run remotely. This is executed as if // it were a shell command, so you are expected to do any shell escaping // necessary. Command string // Stdin specifies the process's standard input. If Stdin is // nil, the process reads from an empty bytes.Buffer. Stdin io.Reader // Stdout and Stderr represent the process's standard output and // error. // // If either is nil, it will be set to ioutil.Discard. Stdout io.Writer Stderr io.Writer // Once Exited is true, this will contain the exit code of the process. exitStatus int // This thing is a mutex, lock when making modifications concurrently m sync.Mutex exitChInit sync.Once exitCh chan interface{} } // A Communicator is the interface used to communicate with the machine // that exists that will eventually be packaged into an image. Communicators // allow you to execute remote commands, upload files, etc. // // Communicators must be safe for concurrency, meaning multiple calls to // Start or any other method may be called at the same time. type Communicator interface { // Start takes a RemoteCmd and starts it. The RemoteCmd must not be // modified after being used with Start, and it must not be used with // Start again. The Start method returns immediately once the command // is started. It does not wait for the command to complete. The // RemoteCmd.Exited field should be used for this. Start(context.Context, *RemoteCmd) error // Upload uploads a file to the machine to the given path with the // contents coming from the given reader. This method will block until // it completes. Upload(string, io.Reader, *os.FileInfo) error // UploadDir uploads the contents of a directory recursively to // the remote path. It also takes an optional slice of paths to // ignore when uploading. // // The folder name of the source folder should be created unless there // is a trailing slash on the source "/". For example: "/tmp/src" as // the source will create a "src" directory in the destination unless // a trailing slash is added. This is identical behavior to rsync(1). UploadDir(dst string, src string, exclude []string) error // Download downloads a file from the machine from the given remote path // with the contents writing to the given writer. This method will // block until it completes. Download(string, io.Writer) error DownloadDir(src string, dst string, exclude []string) error } type ConfigurableCommunicator interface { HCL2Speccer Configure(...interface{}) ([]string, error) } // RunWithUi runs the remote command and streams the output to any configured // Writers for stdout/stderr, while also writing each line as it comes to a Ui. // RunWithUi will not return until the command finishes or is cancelled. func (r *RemoteCmd) RunWithUi(ctx context.Context, c Communicator, ui Ui) error { r.initchan() stdout_r, stdout_w := io.Pipe() stderr_r, stderr_w := io.Pipe() defer stdout_w.Close() defer stderr_w.Close() // Retain the original stdout/stderr that we can replace back in. originalStdout := r.Stdout originalStderr := r.Stderr defer func() { r.m.Lock() defer r.m.Unlock() r.Stdout = originalStdout r.Stderr = originalStderr }() // Set the writers for the output so that we get it streamed to us if r.Stdout == nil { r.Stdout = stdout_w } else { r.Stdout = io.MultiWriter(r.Stdout, stdout_w) } if r.Stderr == nil { r.Stderr = stderr_w } else { r.Stderr = io.MultiWriter(r.Stderr, stderr_w) } // Start the command if err := c.Start(ctx, r); err != nil { return err } // Create the channels we'll use for data stdoutCh := iochan.DelimReader(stdout_r, '\n') stderrCh := iochan.DelimReader(stderr_r, '\n') // Start the goroutine to watch for the exit go func() { defer stdout_w.Close() defer stderr_w.Close() r.Wait() }() // Loop and get all our output OutputLoop: for { select { case output := <-stderrCh: if output != "" { ui.Error(r.cleanOutputLine(output)) } case output := <-stdoutCh: if output != "" { ui.Message(r.cleanOutputLine(output)) } case <-r.exitCh: break OutputLoop case <-ctx.Done(): return ctx.Err() } } // Make sure we finish off stdout/stderr because we may have gotten // a message from the exit channel before finishing these first. for output := range stdoutCh { ui.Message(r.cleanOutputLine(output)) } for output := range stderrCh { ui.Error(r.cleanOutputLine(output)) } return nil } // SetExited is a helper for setting that this process is exited. This // should be called by communicators who are running a remote command in // order to set that the command is done. func (r *RemoteCmd) SetExited(status int) { r.initchan() r.m.Lock() r.exitStatus = status r.m.Unlock() close(r.exitCh) } // Wait for command exit and return exit status func (r *RemoteCmd) Wait() int { r.initchan() <-r.exitCh r.m.Lock() defer r.m.Unlock() return r.exitStatus } func (r *RemoteCmd) ExitStatus() int { return r.Wait() } func (r *RemoteCmd) initchan() { r.exitChInit.Do(func() { if r.exitCh == nil { r.exitCh = make(chan interface{}) } }) } // cleanOutputLine cleans up a line so that '\r' don't muck up the // UI output when we're reading from a remote command. func (r *RemoteCmd) cleanOutputLine(line string) string { // Trim surrounding whitespace line = strings.TrimRightFunc(line, unicode.IsSpace) // Trim up to the first carriage return, since that text would be // lost anyways. idx := strings.LastIndex(line, "\r") if idx > -1 { line = line[idx+1:] } return line } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/communicator_mock.go��������������������������������������0000664�0000000�0000000�00000005341�13771713062�0024313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "context" "errors" "io" "os" "strings" "sync" ) // MockCommunicator is a valid Communicator implementation that can be // used for tests. type MockCommunicator struct { StartCalled bool StartCmd *RemoteCmd StartStderr string StartStdout string StartStdin string StartExitStatus int UploadCalled bool UploadPath string UploadData string UploadDirDst string UploadDirSrc string UploadDirExclude []string DownloadDirDst string DownloadDirSrc string DownloadDirExclude []string DownloadCalled bool DownloadPath string DownloadData string } func (c *MockCommunicator) Start(ctx context.Context, rc *RemoteCmd) error { c.StartCalled = true c.StartCmd = rc go func() { var wg sync.WaitGroup if rc.Stdout != nil && c.StartStdout != "" { wg.Add(1) go func() { io.Copy(rc.Stdout, strings.NewReader(c.StartStdout)) wg.Done() }() } if rc.Stderr != nil && c.StartStderr != "" { wg.Add(1) go func() { io.Copy(rc.Stderr, strings.NewReader(c.StartStderr)) wg.Done() }() } if rc.Stdin != nil { wg.Add(1) go func() { defer wg.Done() var data bytes.Buffer io.Copy(&data, rc.Stdin) c.StartStdin = data.String() }() } wg.Wait() rc.SetExited(c.StartExitStatus) }() return nil } func (c *MockCommunicator) Upload(path string, r io.Reader, fi *os.FileInfo) error { c.UploadCalled = true c.UploadPath = path var data bytes.Buffer if _, err := io.Copy(&data, r); err != nil { panic(err) } c.UploadData = data.String() return nil } func (c *MockCommunicator) UploadDir(dst string, src string, excl []string) error { c.UploadDirDst = dst c.UploadDirSrc = src c.UploadDirExclude = excl return nil } func (c *MockCommunicator) Download(path string, w io.Writer) error { c.DownloadCalled = true c.DownloadPath = path w.Write([]byte(c.DownloadData)) return nil } func (c *MockCommunicator) DownloadDir(src string, dst string, excl []string) error { c.DownloadDirDst = dst c.DownloadDirSrc = src c.DownloadDirExclude = excl return nil } // ScriptUploadErrorMockCommunicator returns an error from it's Upload() method // when a script is uploaded to test the case where this upload fails. type ScriptUploadErrorMockCommunicator struct { MockCommunicator } var ScriptUploadErrorMockCommunicatorError = errors.New("ScriptUploadErrorMockCommunicator Upload error") func (c *ScriptUploadErrorMockCommunicator) Upload(path string, r io.Reader, fi *os.FileInfo) error { // only fail on script uploads, not on environment variable uploads if !strings.Contains(path, "packer-ps-env-vars") { return ScriptUploadErrorMockCommunicatorError } return c.MockCommunicator.Upload(path, r, fi) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/communicator_mock_test.go���������������������������������0000664�0000000�0000000�00000000332�13771713062�0025345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "testing" ) func TestMockCommunicator_impl(t *testing.T) { var raw interface{} raw = new(MockCommunicator) if _, ok := raw.(Communicator); !ok { t.Fatal("should be a communicator") } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/communicator_test.go��������������������������������������0000664�0000000�0000000�00000003253�13771713062�0024341�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "context" "io" "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/hashicorp/packer/packer-plugin-sdk/iochan" "golang.org/x/sync/errgroup" ) func TestRemoteCmd_StartWithUi(t *testing.T) { data := []string{ "hello", "world", "foo", "there", } originalOutputReader, originalOutputWriter := io.Pipe() uilOutputReader, uilOutputWriter := io.Pipe() testComm := new(MockCommunicator) testComm.StartStdout = strings.Join(data, "\n") + "\n" testUi := &BasicUi{ Reader: new(bytes.Buffer), Writer: uilOutputWriter, } rc := &RemoteCmd{ Command: "test", Stdout: originalOutputWriter, } ctx := context.TODO() wg := errgroup.Group{} testPrintFn := func(in io.Reader, expected []string) error { i := 0 got := []string{} for output := range iochan.LineReader(in) { got = append(got, output) i++ if i == len(expected) { // here ideally the LineReader chan should be closed, but since // the stream virtually has no ending we need to leave early. break } } if diff := cmp.Diff(got, expected); diff != "" { t.Fatalf("bad output: %s", diff) } return nil } wg.Go(func() error { return testPrintFn(uilOutputReader, data) }) wg.Go(func() error { return testPrintFn(originalOutputReader, data) }) err := rc.RunWithUi(ctx, testComm, testUi) if err != nil { t.Fatalf("err: %s", err) } wg.Wait() } func TestRemoteCmd_Wait(t *testing.T) { var cmd RemoteCmd result := make(chan bool) go func() { cmd.Wait() result <- true }() cmd.SetExited(42) select { case <-result: // Success case <-time.After(500 * time.Millisecond): t.Fatal("never got exit notification") } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/hcl2spec.go�����������������������������������������������0000664�0000000�0000000�00000000624�13771713062�0022304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import "github.com/hashicorp/hcl/v2/hcldec" // a struct (or type) implementing HCL2Speccer is a type that can tell it's own // hcl2 conf/layout. type HCL2Speccer interface { // ConfigSpec should return the hcl object spec used to configure the // builder. It will be used to tell the HCL parsing library how to // validate/configure a configuration. ConfigSpec() hcldec.ObjectSpec } ������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/hook.go���������������������������������������������������0000664�0000000�0000000�00000003253�13771713062�0021542�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" ) // This is the hook that should be fired for provisioners to run. const HookProvision = "packer_provision" const HookCleanupProvision = "packer_cleanup_provision" // A Hook is used to hook into an arbitrarily named location in a build, // allowing custom behavior to run at certain points along a build. // // Run is called when the hook is called, with the name of the hook and // arbitrary data associated with it. To know what format the data is in, // you must reference the documentation for the specific hook you're interested // in. In addition to that, the Hook is given access to a UI so that it can // output things to the user. // // The first context argument controls cancellation, the context will usually // be called when Run is still in progress so the mechanism that handles this // must be race-free. Cancel should attempt to cancel the hook in the quickest, // safest way possible. type Hook interface { Run(context.Context, string, Ui, Communicator, interface{}) error } // A Hook implementation that dispatches based on an internal mapping. type DispatchHook struct { Mapping map[string][]Hook } // Runs the hook with the given name by dispatching it to the proper // hooks if a mapping exists. If a mapping doesn't exist, then nothing // happens. func (h *DispatchHook) Run(ctx context.Context, name string, ui Ui, comm Communicator, data interface{}) error { hooks, ok := h.Mapping[name] if !ok { // No hooks for that name. No problem. return nil } for _, hook := range hooks { if err := ctx.Err(); err != nil { return err } if err := hook.Run(ctx, name, ui, comm, data); err != nil { return err } } return nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/hook_mock.go����������������������������������������������0000664�0000000�0000000�00000001023�13771713062�0022544�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" ) // MockHook is an implementation of Hook that can be used for tests. type MockHook struct { RunFunc func(context.Context) error RunCalled bool RunComm Communicator RunData interface{} RunName string RunUi Ui } func (t *MockHook) Run(ctx context.Context, name string, ui Ui, comm Communicator, data interface{}) error { t.RunCalled = true t.RunComm = comm t.RunData = data t.RunName = name t.RunUi = ui if t.RunFunc == nil { return nil } return t.RunFunc(ctx) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/hook_test.go����������������������������������������������0000664�0000000�0000000�00000002623�13771713062�0022601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "testing" ) func TestDispatchHook_Implements(t *testing.T) { var _ Hook = new(DispatchHook) } func TestDispatchHook_Run_NoHooks(t *testing.T) { // Just make sure nothing blows up dh := &DispatchHook{} dh.Run(context.Background(), "foo", nil, nil, nil) } func TestDispatchHook_Run(t *testing.T) { hook := &MockHook{} mapping := make(map[string][]Hook) mapping["foo"] = []Hook{hook} dh := &DispatchHook{Mapping: mapping} dh.Run(context.Background(), "foo", nil, nil, 42) if !hook.RunCalled { t.Fatal("should be called") } if hook.RunName != "foo" { t.Fatalf("bad: %s", hook.RunName) } if hook.RunData != 42 { t.Fatalf("bad: %#v", hook.RunData) } } // A helper Hook implementation for testing cancels. // Run will wait indetinitelly until ctx is cancelled. type CancelHook struct { cancel func() } func (h *CancelHook) Run(ctx context.Context, _ string, _ Ui, _ Communicator, _ interface{}) error { h.cancel() <-ctx.Done() return ctx.Err() } func TestDispatchHook_cancel(t *testing.T) { cancelHook := new(CancelHook) dh := &DispatchHook{ Mapping: map[string][]Hook{ "foo": {cancelHook}, }, } ctx, cancel := context.WithCancel(context.Background()) cancelHook.cancel = cancel errchan := make(chan error) go func() { errchan <- dh.Run(ctx, "foo", nil, nil, 42) }() if err := <-errchan; err == nil { t.Fatal("hook should've errored") } } �������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/logs.go���������������������������������������������������0000664�0000000�0000000�00000002076�13771713062�0021550�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "io" "strings" "sync" ) type secretFilter struct { s map[string]struct{} m sync.Mutex w io.Writer } func (l *secretFilter) Set(secrets ...string) { l.m.Lock() defer l.m.Unlock() for _, s := range secrets { l.s[s] = struct{}{} } } func (l *secretFilter) SetOutput(output io.Writer) { l.m.Lock() defer l.m.Unlock() l.w = output } func (l *secretFilter) Write(p []byte) (n int, err error) { for s := range l.s { if s != "" { p = bytes.Replace(p, []byte(s), []byte("<sensitive>"), -1) } } return l.w.Write(p) } // FilterString will overwrite any senstitive variables in a string, returning // the filtered string. func (l *secretFilter) FilterString(message string) string { for s := range l.s { if s != "" { message = strings.Replace(message, s, "<sensitive>", -1) } } return message } func (l *secretFilter) get() (s []string) { l.m.Lock() defer l.m.Unlock() for k := range l.s { s = append(s, k) } return } var LogSecretFilter secretFilter func init() { LogSecretFilter.s = make(map[string]struct{}) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/maps.go���������������������������������������������������0000664�0000000�0000000�00000002733�13771713062�0021544�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "fmt" ) type MapOfProvisioner map[string]func() (Provisioner, error) func (mop MapOfProvisioner) Has(provisioner string) bool { _, res := mop[provisioner] return res } func (mop MapOfProvisioner) Start(provisioner string) (Provisioner, error) { p, found := mop[provisioner] if !found { return nil, fmt.Errorf("Unknown provisioner %s", provisioner) } return p() } func (mop MapOfProvisioner) List() []string { res := []string{} for k := range mop { res = append(res, k) } return res } type MapOfPostProcessor map[string]func() (PostProcessor, error) func (mopp MapOfPostProcessor) Has(postProcessor string) bool { _, res := mopp[postProcessor] return res } func (mopp MapOfPostProcessor) Start(postProcessor string) (PostProcessor, error) { p, found := mopp[postProcessor] if !found { return nil, fmt.Errorf("Unknown post-processor %s", postProcessor) } return p() } func (mopp MapOfPostProcessor) List() []string { res := []string{} for k := range mopp { res = append(res, k) } return res } type MapOfBuilder map[string]func() (Builder, error) func (mob MapOfBuilder) Has(builder string) bool { _, res := mob[builder] return res } func (mob MapOfBuilder) Start(builder string) (Builder, error) { d, found := mob[builder] if !found { return nil, fmt.Errorf("Unknown builder %s", builder) } return d() } func (mob MapOfBuilder) List() []string { res := []string{} for k := range mob { res = append(res, k) } return res } �������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/multi_error.go��������������������������������������������0000664�0000000�0000000�00000002450�13771713062�0023143�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "fmt" "strings" ) // MultiError is an error type to track multiple errors. This is used to // accumulate errors in cases such as configuration parsing, and returning // them as a single error. type MultiError struct { Errors []error } func (e *MultiError) Error() string { points := make([]string, len(e.Errors)) for i, err := range e.Errors { points[i] = fmt.Sprintf("* %s", err) } return fmt.Sprintf( "%d error(s) occurred:\n\n%s", len(e.Errors), strings.Join(points, "\n")) } // MultiErrorAppend is a helper function that will append more errors // onto a MultiError in order to create a larger multi-error. If the // original error is not a MultiError, it will be turned into one. func MultiErrorAppend(err error, errs ...error) *MultiError { if err == nil { err = new(MultiError) } switch err := err.(type) { case *MultiError: if err == nil { err = new(MultiError) } for _, verr := range errs { switch rhsErr := verr.(type) { case *MultiError: if rhsErr != nil { err.Errors = append(err.Errors, rhsErr.Errors...) } default: err.Errors = append(err.Errors, verr) } } return err default: newErrs := make([]error, len(errs)+1) newErrs[0] = err copy(newErrs[1:], errs) return &MultiError{ Errors: newErrs, } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/multi_error_test.go���������������������������������������0000664�0000000�0000000�00000002152�13771713062�0024201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "errors" "testing" ) func TestMultiError_Impl(t *testing.T) { var raw interface{} raw = &MultiError{} if _, ok := raw.(error); !ok { t.Fatal("MultiError must implement error") } } func TestMultiErrorError(t *testing.T) { expected := `2 error(s) occurred: * foo * bar` errors := []error{ errors.New("foo"), errors.New("bar"), } multi := &MultiError{errors} if multi.Error() != expected { t.Fatalf("bad: %s", multi.Error()) } } func TestMultiErrorAppend_MultiError(t *testing.T) { original := &MultiError{ Errors: []error{errors.New("foo")}, } result := MultiErrorAppend(original, errors.New("bar")) if len(result.Errors) != 2 { t.Fatalf("wrong len: %d", len(result.Errors)) } original = &MultiError{} result = MultiErrorAppend(original, errors.New("bar")) if len(result.Errors) != 1 { t.Fatalf("wrong len: %d", len(result.Errors)) } } func TestMultiErrorAppend_NonMultiError(t *testing.T) { original := errors.New("foo") result := MultiErrorAppend(original, errors.New("bar")) if len(result.Errors) != 2 { t.Fatalf("wrong len: %d", len(result.Errors)) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/post_processor.go�����������������������������������������0000664�0000000�0000000�00000002250�13771713062�0023662�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" ) // A PostProcessor is responsible for taking an artifact of a build // and doing some sort of post-processing to turn this into another // artifact. An example of a post-processor would be something that takes // the result of a build, compresses it, and returns a new artifact containing // a single file of the prior artifact compressed. type PostProcessor interface { HCL2Speccer // Configure is responsible for setting up configuration, storing // the state for later, and returning and errors, such as validation // errors. Configure(...interface{}) error // PostProcess takes a previously created Artifact and produces another // Artifact. If an error occurs, it should return that error. If `keep` is // true, then the previous artifact defaults to being kept if user has not // given a value to keep_input_artifact. If forceOverride is true, then any // user input for keep_input_artifact is ignored and the artifact is either // kept or discarded according to the value set in `keep`. // PostProcess is cancellable using context PostProcess(context.Context, Ui, Artifact) (a Artifact, keep bool, forceOverride bool, err error) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/provisioner.go��������������������������������������������0000664�0000000�0000000�00000001352�13771713062�0023157�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import "context" // A provisioner is responsible for installing and configuring software // on a machine prior to building the actual image. type Provisioner interface { HCL2Speccer // Prepare is called with a set of configurations to setup the // internal state of the provisioner. The multiple configurations // should be merged in some sane way. Prepare(...interface{}) error // Provision is called to actually provision the machine. A context is // given for cancellation, a UI is given to communicate with the user, and // a communicator is given that is guaranteed to be connected to some // machine so that provisioning can be done. Provision(context.Context, Ui, Communicator, map[string]interface{}) error } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/provisioner_mock.go���������������������������������������0000664�0000000�0000000�00000002437�13771713062�0024175�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type MockProvisioner package packer import ( "context" "github.com/hashicorp/hcl/v2/hcldec" ) // MockProvisioner is an implementation of Provisioner that can be // used for tests. type MockProvisioner struct { ProvFunc func(context.Context) error PrepCalled bool PrepConfigs []interface{} ProvCalled bool ProvRetried bool ProvCommunicator Communicator ProvUi Ui } func (tp *MockProvisioner) ConfigSpec() hcldec.ObjectSpec { return tp.FlatMapstructure().HCL2Spec() } func (tp *MockProvisioner) FlatConfig() interface{} { return tp.FlatMapstructure() } func (t *MockProvisioner) Prepare(configs ...interface{}) error { t.PrepCalled = true t.PrepConfigs = configs return nil } func (t *MockProvisioner) Provision(ctx context.Context, ui Ui, comm Communicator, generatedData map[string]interface{}) error { if t.ProvCalled { t.ProvRetried = true return nil } t.ProvCalled = true t.ProvCommunicator = comm t.ProvUi = ui if t.ProvFunc == nil { return nil } return t.ProvFunc(ctx) } func (t *MockProvisioner) Communicator() Communicator { return t.ProvCommunicator } func (t *MockProvisioner) ElevatedUser() string { return "user" } func (t *MockProvisioner) ElevatedPassword() string { return "password" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/provisioner_mock.hcl2spec.go������������������������������0000664�0000000�0000000�00000004153�13771713062�0025674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type MockProvisioner"; DO NOT EDIT. package packer import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatMockProvisioner is an auto-generated flat version of MockProvisioner. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatMockProvisioner struct { PrepCalled *bool `cty:"prep_called" hcl:"prep_called"` PrepConfigs []interface{} `cty:"prep_configs" hcl:"prep_configs"` ProvCalled *bool `cty:"prov_called" hcl:"prov_called"` ProvRetried *bool `cty:"prov_retried" hcl:"prov_retried"` ProvCommunicator Communicator `cty:"prov_communicator" hcl:"prov_communicator"` ProvUi Ui `cty:"prov_ui" hcl:"prov_ui"` } // FlatMapstructure returns a new FlatMockProvisioner. // FlatMockProvisioner is an auto-generated flat version of MockProvisioner. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*MockProvisioner) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatMockProvisioner) } // HCL2Spec returns the hcl spec of a MockProvisioner. // This spec is used by HCL to read the fields of MockProvisioner. // The decoded values from this spec will then be applied to a FlatMockProvisioner. func (*FlatMockProvisioner) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "prep_called": &hcldec.AttrSpec{Name: "prep_called", Type: cty.Bool, Required: false}, "prep_configs": &hcldec.AttrSpec{Name: "prep_configs", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "prov_called": &hcldec.AttrSpec{Name: "prov_called", Type: cty.Bool, Required: false}, "prov_retried": &hcldec.AttrSpec{Name: "prov_retried", Type: cty.Bool, Required: false}, "prov_communicator": &hcldec.AttrSpec{Name: "prov_communicator", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "prov_ui": &hcldec.AttrSpec{Name: "prov_ui", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ } return s } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/ui.go�����������������������������������������������������0000664�0000000�0000000�00000010752�13771713062�0021221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "errors" "fmt" "io" "log" "os" "os/signal" "strings" "sync" "syscall" getter "github.com/hashicorp/go-getter/v2" ) type TTY interface { ReadString() (string, error) Close() error } // The Ui interface handles all communication for Packer with the outside // world. This sort of control allows us to strictly control how output // is formatted and various levels of output. type Ui interface { Ask(string) (string, error) Say(string) Message(string) Error(string) Machine(string, ...string) // TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) getter.ProgressTracker } var ErrInterrupted = errors.New("interrupted") // BasicUI is an implementation of Ui that reads and writes from a standard Go // reader and writer. It is safe to be called from multiple goroutines. Machine // readable output is simply logged for this UI. type BasicUi struct { Reader io.Reader Writer io.Writer ErrorWriter io.Writer l sync.Mutex interrupted bool TTY TTY PB getter.ProgressTracker } var _ Ui = new(BasicUi) func (rw *BasicUi) Ask(query string) (string, error) { rw.l.Lock() defer rw.l.Unlock() if rw.interrupted { return "", ErrInterrupted } if rw.TTY == nil { return "", errors.New("no available tty") } sigCh := make(chan os.Signal, 1) signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) defer signal.Stop(sigCh) log.Printf("ui: ask: %s", query) if query != "" { if _, err := fmt.Fprint(rw.Writer, query+" "); err != nil { return "", err } } result := make(chan string, 1) go func() { line, err := rw.TTY.ReadString() if err != nil { log.Printf("ui: scan err: %s", err) return } result <- strings.TrimSpace(line) }() select { case line := <-result: return line, nil case <-sigCh: // Print a newline so that any further output starts properly // on a new line. fmt.Fprintln(rw.Writer) // Mark that we were interrupted so future Ask calls fail. rw.interrupted = true return "", ErrInterrupted } } func (rw *BasicUi) Say(message string) { rw.l.Lock() defer rw.l.Unlock() // Use LogSecretFilter to scrub out sensitive variables message = LogSecretFilter.FilterString(message) log.Printf("ui: %s", message) _, err := fmt.Fprint(rw.Writer, message+"\n") if err != nil { log.Printf("[ERR] Failed to write to UI: %s", err) } } func (rw *BasicUi) Message(message string) { rw.l.Lock() defer rw.l.Unlock() // Use LogSecretFilter to scrub out sensitive variables message = LogSecretFilter.FilterString(message) log.Printf("ui: %s", message) _, err := fmt.Fprint(rw.Writer, message+"\n") if err != nil { log.Printf("[ERR] Failed to write to UI: %s", err) } } func (rw *BasicUi) Error(message string) { rw.l.Lock() defer rw.l.Unlock() writer := rw.ErrorWriter if writer == nil { writer = rw.Writer } // Use LogSecretFilter to scrub out sensitive variables message = LogSecretFilter.FilterString(message) log.Printf("ui error: %s", message) _, err := fmt.Fprint(writer, message+"\n") if err != nil { log.Printf("[ERR] Failed to write to UI: %s", err) } } func (rw *BasicUi) Machine(t string, args ...string) { log.Printf("machine readable: %s %#v", t, args) } func (rw *BasicUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) { return rw.PB.TrackProgress(src, currentSize, totalSize, stream) } // Safe is a UI that wraps another UI implementation and // provides concurrency-safe access type SafeUi struct { Sem chan int Ui Ui PB getter.ProgressTracker } var _ Ui = new(SafeUi) func (u *SafeUi) Ask(s string) (string, error) { u.Sem <- 1 ret, err := u.Ui.Ask(s) <-u.Sem return ret, err } func (u *SafeUi) Say(s string) { u.Sem <- 1 u.Ui.Say(s) <-u.Sem } func (u *SafeUi) Message(s string) { u.Sem <- 1 u.Ui.Message(s) <-u.Sem } func (u *SafeUi) Error(s string) { u.Sem <- 1 u.Ui.Error(s) <-u.Sem } func (u *SafeUi) Machine(t string, args ...string) { u.Sem <- 1 u.Ui.Machine(t, args...) <-u.Sem } func (u *SafeUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) { u.Sem <- 1 ret := u.Ui.TrackProgress(src, currentSize, totalSize, stream) <-u.Sem return ret } // NoopProgressTracker is a progress tracker // that displays nothing. type NoopProgressTracker struct{} // TrackProgress returns stream func (*NoopProgressTracker) TrackProgress(_ string, _, _ int64, stream io.ReadCloser) io.ReadCloser { return stream } ����������������������packer-1.6.6+ds1/packer-plugin-sdk/packer/ui_mock.go������������������������������������������������0000664�0000000�0000000�00000003372�13771713062�0022232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "io" "io/ioutil" "testing" ) // TestUi creates a simple UI for use in testing. // It's not meant for "real" use. func TestUi(t *testing.T) Ui { var buf bytes.Buffer return &BasicUi{ Reader: &buf, Writer: ioutil.Discard, ErrorWriter: ioutil.Discard, PB: &NoopProgressTracker{}, } } type MockUi struct { AskCalled bool AskQuery string ErrorCalled bool ErrorMessage string MachineCalled bool MachineType string MachineArgs []string MessageCalled bool MessageMessage string SayCalled bool SayMessage string TrackProgressCalled bool ProgressBarAddCalled bool ProgressBarCloseCalled bool } func (u *MockUi) Ask(query string) (string, error) { u.AskCalled = true u.AskQuery = query return "foo", nil } func (u *MockUi) Error(message string) { u.ErrorCalled = true u.ErrorMessage = message } func (u *MockUi) Machine(t string, args ...string) { u.MachineCalled = true u.MachineType = t u.MachineArgs = args } func (u *MockUi) Message(message string) { u.MessageCalled = true u.MessageMessage = message } func (u *MockUi) Say(message string) { u.SayCalled = true u.SayMessage = message } func (u *MockUi) TrackProgress(_ string, _, _ int64, stream io.ReadCloser) (body io.ReadCloser) { u.TrackProgressCalled = true return &readCloser{ read: func(p []byte) (int, error) { u.ProgressBarAddCalled = true return stream.Read(p) }, close: func() error { u.ProgressBarCloseCalled = true return stream.Close() }, } } type readCloser struct { read func([]byte) (int, error) close func() error } func (c *readCloser) Close() error { return c.close() } func (c *readCloser) Read(p []byte) (int, error) { return c.read(p) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packerbuilderdata/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022451�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packerbuilderdata/generated_data.go������������������������������0000664�0000000�0000000�00000002126�13771713062�0025730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packerbuilderdata import "github.com/hashicorp/packer/packer-plugin-sdk/multistep" // This is used in the BasicPlaceholderData() func in the packer/provisioner.go // To force users to access generated data via the "generated" func. const PlaceholderMsg = "To set this dynamically in the Packer template, " + "you must use the `build` function" // GeneratedData manages variables created and exported by a builder after // it starts, so that provisioners and post-processors can have access to // build data generated at runtime -- for example, instance ID or instance IP // address. Internally, it uses the builder's multistep.StateBag. The user // must make sure that the State field is not is not nil before calling Put(). type GeneratedData struct { // The builder's StateBag State multistep.StateBag } func (gd *GeneratedData) Put(key string, data interface{}) { genData := make(map[string]interface{}) if _, ok := gd.State.GetOk("generated_data"); ok { genData = gd.State.Get("generated_data").(map[string]interface{}) } genData[key] = data gd.State.Put("generated_data", genData) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/packerbuilderdata/generated_data_test.go�������������������������0000664�0000000�0000000�00000002002�13771713062�0026760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packerbuilderdata import ( "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" ) func TestGeneratedData_Put(t *testing.T) { state := new(multistep.BasicStateBag) generatedData := GeneratedData{ State: state, } expectedValue := "data value" secondExpectedValue := "another data value" generatedData.Put("data_key", expectedValue) generatedData.Put("another_data_key", secondExpectedValue) if _, ok := generatedData.State.GetOk("generated_data"); !ok { t.Fatalf("BAD: StateBag should contain generated_data") } generatedDataState := generatedData.State.Get("generated_data").(map[string]interface{}) if generatedDataState["data_key"] != expectedValue { t.Fatalf("Unexpected state for data_key: expected %#v got %#v\n", expectedValue, generatedDataState["data_key"]) } if generatedDataState["another_data_key"] != secondExpectedValue { t.Fatalf("Unexpected state for another_data_key: expected %#v got %#v\n", secondExpectedValue, generatedDataState["another_data_key"]) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/pathing/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020435�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/pathing/config_file.go�������������������������������������������0000664�0000000�0000000�00000006211�13771713062�0023230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package pathing import ( "log" "os" "os/user" "path/filepath" "strings" ) // ConfigFile returns the default path to the configuration file. On // Unix-like systems this is the ".packerconfig" file in the home directory. // On Windows, this is the "packer.config" file in the application data // directory. func ConfigFile() (string, error) { return configFile() } // ConfigDir returns the configuration directory for Packer. func ConfigDir() (string, error) { return configDir() } func homeDir() (string, error) { // Prefer $APPDATA over $HOME in Windows. // This makes it possible to use packer plugins (as installed by Chocolatey) // in cmd/ps and msys2. // See https://github.com/hashicorp/packer/issues/9795 if home := os.Getenv("APPDATA"); home != "" { return home, nil } // Prefer $HOME over user.Current due to glibc bug: golang.org/issue/13470 if home := os.Getenv("HOME"); home != "" { return home, nil } // Fall back to the passwd database if not found which follows // the same semantics as bourne shell u, err := user.Current() // Get homedir from specified username // if it is set and different than what we have if username := os.Getenv("USER"); username != "" && err == nil && u.Username != username { u, err = user.Lookup(username) } // Fail if we were unable to read the record if err != nil { return "", err } return u.HomeDir, nil } func configFile() (string, error) { var dir string if cd := os.Getenv("PACKER_CONFIG_DIR"); cd != "" { log.Printf("Detected config directory from env var: %s", cd) dir = cd } else { homedir, err := homeDir() if err != nil { return "", err } dir = homedir } return filepath.Join(dir, defaultConfigFile), nil } func configDir() (string, error) { var dir string if cd := os.Getenv("PACKER_CONFIG_DIR"); cd != "" { log.Printf("Detected config directory from env var: %s", cd) dir = cd } else { homedir, err := homeDir() if err != nil { return "", err } dir = homedir } return filepath.Join(dir, defaultConfigDir), nil } // Given a path, check to see if it's using ~ to reference a user directory. // If so, then replace that component with the requested user directory. // In "~/", "~" gets replaced by current user's home dir. // In "~root/", "~user" gets replaced by root's home dir. // ~ has to be the first character of path for ExpandUser change it. func ExpandUser(path string) (string, error) { var ( u *user.User err error ) // refuse to do anything with a zero-length path if len(path) == 0 { return path, nil } // If no expansion was specified, then refuse that too if path[0] != '~' { return path, nil } // Grab everything up to the first filepath.Separator idx := strings.IndexAny(path, `/\`) if idx == -1 { idx = len(path) } // Now we should be able to extract the username username := path[:idx] // Check if the current user was requested if username == "~" { u, err = user.Current() } else { u, err = user.Lookup(username[1:]) } // If we couldn't figure that out, then fail here if err != nil { return "", err } // Now we can replace the path with u.HomeDir return filepath.Join(u.HomeDir, path[idx:]), nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/pathing/config_file_test.go��������������������������������������0000664�0000000�0000000�00000006407�13771713062�0024276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package pathing import ( "fmt" "os/user" "path/filepath" "runtime" "testing" ) // Depending on the platform, find a valid username to use func platform_user() string { // XXX: We make an assumption here that there's an Administrator user // on the windows platform, whereas the correct way is to use // the api or to scrape `net user`. if runtime.GOOS == "windows" { return "Administrator" } return "root" } func homedir_current() (string, error) { u, err := user.Current() if err != nil { return "", err } return u.HomeDir, nil } func homedir_user(username string) (string, error) { u, err := user.Lookup(username) if err != nil { return "", err } return u.HomeDir, nil } // Begin the actual tests and stuff func TestExpandUser_Empty(t *testing.T) { var path, expected string // Try an invalid user _, err := ExpandUser("~invalid-user-that-should-not-exist") if err == nil { t.Fatalf("expected failure") } // Try an empty string expected = "" if path, err = ExpandUser(""); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } // Try an absolute path expected = "/etc/shadow" if path, err = ExpandUser("/etc/shadow"); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } // Try a relative path expected = "tmp/foo" if path, err = ExpandUser("tmp/foo"); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } } func TestExpandUser_Current(t *testing.T) { var path, expected string // Grab the current user's home directory to verify ExpandUser works homedir, err := homedir_current() if err != nil { t.Fatalf("err: %s", err) } // Try just a tilde expected = homedir if path, err = ExpandUser("~"); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } // Try as a directory expected = filepath.Join(homedir, "") if path, err = ExpandUser("~/"); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } // Try as a file expected = filepath.Join(homedir, "foo") if path, err = ExpandUser("~/foo"); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } } func TestExpandUser_User(t *testing.T) { var path, expected string username := platform_user() // Grab the current user's home directory to verify ExpandUser works homedir, err := homedir_user(username) if err != nil { t.Fatalf("err: %s", err) } // Try just a tilde expected = homedir if path, err = ExpandUser(fmt.Sprintf("~%s", username)); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } // Try as a directory expected = filepath.Join(homedir, "") if path, err = ExpandUser(fmt.Sprintf("~%s/", username)); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } // Try as a file expected = filepath.Join(homedir, "foo") if path, err = ExpandUser(fmt.Sprintf("~%s/foo", username)); err != nil { t.Fatalf("err: %s", err) } if path != expected { t.Fatalf("err: %v != %v", path, expected) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/pathing/config_file_unix.go��������������������������������������0000664�0000000�0000000�00000000230�13771713062�0024266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build darwin freebsd linux netbsd openbsd solaris package pathing const ( defaultConfigFile = ".packerconfig" defaultConfigDir = ".packer.d" ) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/pathing/config_file_windows.go�����������������������������������0000664�0000000�0000000�00000000163�13771713062�0025002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build windows package pathing const ( defaultConfigFile = "packer.config" defaultConfigDir = "packer.d" ) �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020301�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/example/��������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021734�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/example/main.go�������������������������������������������0000664�0000000�0000000�00000002602�13771713062�0023207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// This is an example plugin. In packer 0.9.0 and up, core plugins are compiled // into the main binary so these files are no longer necessary for the packer // project. // // However, it is still possible to create a third-party plugin for packer that // is distributed independently from the packer distribution. These continue to // work in the same way. They will be loaded from the same directory as packer // by looking for packer-[builder|provisioner|post-processor]-plugin-name. For // example: // // packer-builder-docker // // Look at command/plugin.go to see how the core plugins are loaded now, but the // format below was used for packer <= 0.8.6 and is forward-compatible. package main import ( "github.com/hashicorp/packer/builder/amazon/chroot" pluginsdk "github.com/hashicorp/packer/packer-plugin-sdk/plugin" dockerpush "github.com/hashicorp/packer/post-processor/docker-push" "github.com/hashicorp/packer/provisioner/powershell" ) func main() { server, err := pluginsdk.Server() if err != nil { panic(err) } // Choose the appropriate type of plugin. You should only use one of these // at a time, which means you will have a separate plugin for each builder, // provisioner, or post-processor. server.RegisterBuilder(new(chroot.Builder)) server.RegisterPostProcessor(new(dockerpush.PostProcessor)) server.RegisterProvisioner(new(powershell.Provisioner)) server.Serve() } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/example/main_test.go��������������������������������������0000664�0000000�0000000�00000000252�13771713062�0024245�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Core Packer plugins included a _test.go file to make sure they compiled // correctly when running packer tests. For custom plugins this file is optional. package main ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/server.go�������������������������������������������������0000664�0000000�0000000�00000007511�13771713062�0022142�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// The plugin package provides the functionality to both expose a Packer // plugin binary and to connect to an existing Packer plugin binary. // // Packer supports plugins in the form of self-contained external static // Go binaries. These binaries behave in a certain way (enforced by this // package) and are connected to in a certain way (also enforced by this // package). package plugin import ( "errors" "fmt" "log" "math/rand" "net" "os" "os/signal" "runtime" "strconv" "sync/atomic" "syscall" "time" packrpc "github.com/hashicorp/packer/packer-plugin-sdk/rpc" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) // This is a count of the number of interrupts the process has received. // This is updated with sync/atomic whenever a SIGINT is received and can // be checked by the plugin safely to take action. var Interrupts int32 = 0 const MagicCookieKey = "PACKER_PLUGIN_MAGIC_COOKIE" const MagicCookieValue = "d602bf8f470bc67ca7faa0386276bbdd4330efaf76d1a219cb4d6991ca9872b2" // The APIVersion is outputted along with the RPC address. The plugin // client validates this API version and will show an error if it doesn't // know how to speak it. const APIVersion = "5" var ErrManuallyStartedPlugin = errors.New( "Please do not execute plugins directly. Packer will execute these for you.") // Server waits for a connection to this plugin and returns a Packer // RPC server that you can use to register components and serve them. func Server() (*packrpc.Server, error) { if os.Getenv(MagicCookieKey) != MagicCookieValue { return nil, ErrManuallyStartedPlugin } // If there is no explicit number of Go threads to use, then set it if os.Getenv("GOMAXPROCS") == "" { runtime.GOMAXPROCS(runtime.NumCPU()) } listener, err := serverListener() if err != nil { return nil, err } defer listener.Close() // Output the address to stdout log.Printf("Plugin address: %s %s\n", listener.Addr().Network(), listener.Addr().String()) fmt.Printf("%s|%s|%s\n", APIVersion, listener.Addr().Network(), listener.Addr().String()) os.Stdout.Sync() // Accept a connection log.Println("Waiting for connection...") conn, err := listener.Accept() if err != nil { log.Printf("Error accepting connection: %s\n", err.Error()) return nil, err } // Eat the interrupts ch := make(chan os.Signal, 1) signal.Notify(ch, os.Interrupt, syscall.SIGTERM) go func() { var count int32 = 0 for { <-ch newCount := atomic.AddInt32(&count, 1) log.Printf("Received interrupt signal (count: %d). Ignoring.", newCount) } }() // Serve a single connection log.Println("Serving a plugin connection...") return packrpc.NewServer(conn) } func serverListener() (net.Listener, error) { if runtime.GOOS == "windows" { return serverListener_tcp() } return serverListener_unix() } func serverListener_tcp() (net.Listener, error) { minPort, err := strconv.ParseInt(os.Getenv("PACKER_PLUGIN_MIN_PORT"), 10, 32) if err != nil { return nil, err } maxPort, err := strconv.ParseInt(os.Getenv("PACKER_PLUGIN_MAX_PORT"), 10, 32) if err != nil { return nil, err } log.Printf("Plugin port range: [%d,%d]", minPort, maxPort) for port := minPort; port <= maxPort; port++ { address := fmt.Sprintf("127.0.0.1:%d", port) listener, err := net.Listen("tcp", address) if err == nil { return listener, nil } } return nil, errors.New("Couldn't bind plugin TCP listener") } func serverListener_unix() (net.Listener, error) { tf, err := tmp.File("packer-plugin") if err != nil { return nil, err } path := tf.Name() // Close the file and remove it because it has to not exist for // the domain socket. if err := tf.Close(); err != nil { return nil, err } if err := os.Remove(path); err != nil { return nil, err } return net.Listen("unix", path) } func init() { // Seed the random number generator rand.Seed(time.Now().UTC().UnixNano()) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/server_test.go��������������������������������������������0000664�0000000�0000000�00000000267�13771713062�0023202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "math/rand" "testing" ) func TestPluginServerRandom(t *testing.T) { if rand.Intn(9999999) == 8498210 { t.Fatal("math.rand is not seeded properly") } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/set.go����������������������������������������������������0000664�0000000�0000000�00000010332�13771713062�0021422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "encoding/json" "fmt" "io" "log" "os" "sort" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" pluginVersion "github.com/hashicorp/packer/packer-plugin-sdk/version" "github.com/hashicorp/packer/version" ) // Set is a plugin set. It's API is meant to be very close to what is returned // by plugin.Server // It can describe itself or run a single plugin using the CLI arguments. type Set struct { version string sdkVersion string Builders map[string]packersdk.Builder PostProcessors map[string]packersdk.PostProcessor Provisioners map[string]packersdk.Provisioner } // SetDescription describes a Set. type SetDescription struct { Version string `json:"version"` SDKVersion string `json:"sdk_version"` Builders []string `json:"builders"` PostProcessors []string `json:"post_processors"` Provisioners []string `json:"provisioners"` } //// // Setup //// func NewSet() *Set { return &Set{ version: version.String(), sdkVersion: version.String(), // TODO: Set me after the split Builders: map[string]packersdk.Builder{}, PostProcessors: map[string]packersdk.PostProcessor{}, Provisioners: map[string]packersdk.Provisioner{}, } } func (i *Set) SetVersion(version *pluginVersion.PluginVersion) { i.version = version.String() } func (i *Set) RegisterBuilder(name string, builder packersdk.Builder) { if _, found := i.Builders[name]; found { panic(fmt.Errorf("registering duplicate %s builder", name)) } i.Builders[name] = builder } func (i *Set) RegisterPostProcessor(name string, postProcessor packersdk.PostProcessor) { if _, found := i.PostProcessors[name]; found { panic(fmt.Errorf("registering duplicate %s post-processor", name)) } i.PostProcessors[name] = postProcessor } func (i *Set) RegisterProvisioner(name string, provisioner packersdk.Provisioner) { if _, found := i.Provisioners[name]; found { panic(fmt.Errorf("registering duplicate %s provisioner", name)) } i.Provisioners[name] = provisioner } // Run takes the os Args and runs a packer plugin command from it. // * "describe" command makes the plugin set describe itself. // * "start builder builder-name" starts the builder "builder-name" // * "start post-processor example" starts the post-processor "example" func (i *Set) Run() error { args := os.Args[1:] return i.RunCommand(args...) } func (i *Set) RunCommand(args ...string) error { if len(args) < 1 { return fmt.Errorf("needs at least one argument") } switch args[0] { case "describe": return i.jsonDescribe(os.Stdout) case "start": args = args[1:] if len(args) != 2 { return fmt.Errorf("start takes two arguments, for example 'start builder example-builder'. Found: %v", args) } return i.start(args[0], args[1]) default: return fmt.Errorf("Unknown command: %q", args[0]) } } func (i *Set) start(kind, name string) error { server, err := Server() if err != nil { return err } log.Printf("[TRACE] starting %s %s", kind, name) switch kind { case "builder": err = server.RegisterBuilder(i.Builders[name]) case "post-processor": err = server.RegisterPostProcessor(i.PostProcessors[name]) case "provisioners": err = server.RegisterProvisioner(i.Provisioners[name]) default: err = fmt.Errorf("Unknown plugin type: %s", kind) } if err != nil { return err } server.Serve() return nil } //// // Describe //// func (i *Set) description() SetDescription { return SetDescription{ Version: i.version, SDKVersion: i.sdkVersion, Builders: i.buildersDescription(), PostProcessors: i.postProcessorsDescription(), Provisioners: i.provisionersDescription(), } } func (i *Set) jsonDescribe(out io.Writer) error { return json.NewEncoder(out).Encode(i.description()) } func (i *Set) buildersDescription() []string { out := []string{} for key := range i.Builders { out = append(out, key) } sort.Strings(out) return out } func (i *Set) postProcessorsDescription() []string { out := []string{} for key := range i.PostProcessors { out = append(out, key) } sort.Strings(out) return out } func (i *Set) provisionersDescription() []string { out := []string{} for key := range i.Provisioners { out = append(out, key) } sort.Strings(out) return out } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/plugin/set_test.go�����������������������������������������������0000664�0000000�0000000�00000003055�13771713062�0022465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "testing" "github.com/google/go-cmp/cmp" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" pluginVersion "github.com/hashicorp/packer/packer-plugin-sdk/version" "github.com/hashicorp/packer/version" ) type MockBuilder struct { packersdk.Builder } var _ packersdk.Builder = new(MockBuilder) type MockProvisioner struct { packersdk.Provisioner } var _ packersdk.Provisioner = new(MockProvisioner) type MockPostProcessor struct { packersdk.PostProcessor } var _ packersdk.PostProcessor = new(MockPostProcessor) func TestSet(t *testing.T) { set := NewSet() set.RegisterBuilder("example-2", new(MockBuilder)) set.RegisterBuilder("example", new(MockBuilder)) set.RegisterPostProcessor("example", new(MockPostProcessor)) set.RegisterPostProcessor("example-2", new(MockPostProcessor)) set.RegisterProvisioner("example", new(MockProvisioner)) set.RegisterProvisioner("example-2", new(MockProvisioner)) set.SetVersion(pluginVersion.InitializePluginVersion( "1.1.1", "")) outputDesc := set.description() if diff := cmp.Diff(SetDescription{ Version: "1.1.1", SDKVersion: version.String(), Builders: []string{"example", "example-2"}, PostProcessors: []string{"example", "example-2"}, Provisioners: []string{"example", "example-2"}, }, outputDesc); diff != "" { t.Fatalf("Unexpected description: %s", diff) } err := set.RunCommand("start", "builder", "example") if diff := cmp.Diff(err.Error(), ErrManuallyStartedPlugin.Error()); diff != "" { t.Fatalf("Unexpected error: %s", diff) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/random/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020263�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/random/string.go�������������������������������������������������0000664�0000000�0000000�00000003324�13771713062�0022122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package random import ( "math/rand" "os" "time" ) var ( PossibleNumbers = "0123456789" PossibleLowerCase = "abcdefghijklmnopqrstuvwxyz" PossibleUpperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" PossibleSpecialCharacter = " !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" PossibleAlphaNum = PossibleNumbers + PossibleLowerCase + PossibleUpperCase PossibleAlphaNumLower = PossibleNumbers + PossibleLowerCase PossibleAlphaNumUpper = PossibleNumbers + PossibleUpperCase ) var rnd = rand.New(rand.NewSource(time.Now().UnixNano() + int64(os.Getpid()))) // Numbers returns a random numeric string of the given length func Numbers(length int) string { return String(PossibleNumbers, length) } // AlphaNum returns a random alphanumeric string of the given length. The // returned string can contain both uppercase and lowercase letters. func AlphaNum(length int) string { return String(PossibleAlphaNum, length) } // AlphaNumLower returns a random alphanumeric string of the given length. The // returned string can contain lowercase letters, but not uppercase. func AlphaNumLower(length int) string { return String(PossibleAlphaNumLower, length) } // AlphaNumUpper returns a random alphanumeric string of the given length. The // returned string can contain uppercase letters, but not lowercase. func AlphaNumUpper(length int) string { return String(PossibleAlphaNumUpper, length) } // String returns a random string of the given length, using only the component // characters provided in the "chooseFrom" string. func String(chooseFrom string, length int) (randomString string) { cflen := len(chooseFrom) bytes := make([]byte, length) for i := range bytes { bytes[i] = chooseFrom[rnd.Intn(cflen)] } return string(bytes) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/retry/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020150�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/retry/retry.go���������������������������������������������������0000664�0000000�0000000�00000006453�13771713062�0021654�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package retry import ( "context" "fmt" "log" "time" ) // Config represents a retry config type Config struct { // The operation will be retried until StartTimeout has elapsed. 0 means // forever. StartTimeout time.Duration // RetryDelay gives the time elapsed after a failure and before we try // again. Returns 2s by default. RetryDelay func() time.Duration // Max number of retries, 0 means infinite Tries int // ShouldRetry tells whether error should be retried. Nil defaults to always // true. ShouldRetry func(error) bool } type RetryExhaustedError struct { Err error } func (err *RetryExhaustedError) Error() string { if err == nil || err.Err == nil { return "<nil>" } return fmt.Sprintf("retry count exhausted. Last err: %s", err.Err) } // Run will repeatedly retry the proivided fn within the constraints set in the // retry Config. It will retry until one of the following conditions is met: // - The provided context is cancelled. // - The Config.StartTimeout time has passed. // - The function returns without an error. // - The maximum number of tries, Config.Tries is exceeded. // - The function returns with an error that does not satisfy conditions // set in the Config.ShouldRetry function. // If the given function (fn) does not return an error, then Run will return // nil. Otherwise, Run will return a relevant error. func (cfg Config) Run(ctx context.Context, fn func(context.Context) error) error { retryDelay := func() time.Duration { return 2 * time.Second } if cfg.RetryDelay != nil { retryDelay = cfg.RetryDelay } shouldRetry := func(error) bool { return true } if cfg.ShouldRetry != nil { shouldRetry = cfg.ShouldRetry } var startTimeout <-chan time.Time // nil chans never unlock ! if cfg.StartTimeout != 0 { startTimeout = time.After(cfg.StartTimeout) } var err error for try := 0; ; try++ { if cfg.Tries != 0 && try == cfg.Tries { return &RetryExhaustedError{err} } if err = fn(ctx); err == nil { return nil } if !shouldRetry(err) { return err } log.Print(fmt.Errorf("Retryable error: %s", err)) select { case <-ctx.Done(): return err case <-startTimeout: return err default: time.Sleep(retryDelay()) } } } // Backoff is a self contained backoff time calculator. This struct should be // passed around as a copy as it changes its own fields upon any Backoff call. // Backoff is not thread safe. For now only a Linear backoff call is // implemented and the Exponential call will be implemented when needed. type Backoff struct { // Initial time to wait. A Backoff call will change this value. InitialBackoff time.Duration // Maximum time returned. MaxBackoff time.Duration // For a Linear backoff, InitialBackoff will be multiplied by Multiplier // after each call. Multiplier float64 } // Linear Backoff returns a linearly increasing Duration. // n = n * Multiplier. // the first value of n is InitialBackoff. n is maxed by MaxBackoff. func (lb *Backoff) Linear() time.Duration { wait := lb.InitialBackoff lb.InitialBackoff = time.Duration(lb.Multiplier * float64(lb.InitialBackoff)) if lb.MaxBackoff != 0 && lb.InitialBackoff > lb.MaxBackoff { lb.InitialBackoff = lb.MaxBackoff } return wait } // Exponential backoff panics: not implemented, yet. func (lb *Backoff) Exponential() time.Duration { panic("not implemented, yet") } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/retry/retry_test.go����������������������������������������������0000664�0000000�0000000�00000004410�13771713062�0022702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package retry import ( "context" "errors" "testing" "time" "github.com/google/go-cmp/cmp" ) func success(context.Context) error { return nil } func wait(ctx context.Context) error { <-ctx.Done() return ctx.Err() } var failErr = errors.New("woops !") func fail(context.Context) error { return failErr } type failOnce bool func (ran *failOnce) Run(context.Context) error { if !*ran { *ran = true return failErr } return nil } func TestConfig_Run(t *testing.T) { cancelledCtx, cancel := context.WithCancel(context.Background()) cancel() type fields struct { StartTimeout time.Duration RetryDelay func() time.Duration Tries int } type args struct { ctx context.Context fn func(context.Context) error } tests := []struct { name string fields fields args args wantErr error }{ {"success", fields{StartTimeout: time.Second}, args{context.Background(), success}, nil}, {"context cancelled", fields{StartTimeout: time.Second}, args{cancelledCtx, wait}, context.Canceled}, {"timeout", fields{StartTimeout: 20 * time.Millisecond, RetryDelay: func() time.Duration { return 10 * time.Millisecond }}, args{cancelledCtx, fail}, failErr}, {"success after one failure", fields{Tries: 2, RetryDelay: func() time.Duration { return 0 }}, args{context.Background(), new(failOnce).Run}, nil}, {"fail after one failure", fields{Tries: 1, RetryDelay: func() time.Duration { return 0 }}, args{context.Background(), new(failOnce).Run}, &RetryExhaustedError{failErr}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cfg := Config{ StartTimeout: tt.fields.StartTimeout, RetryDelay: tt.fields.RetryDelay, Tries: tt.fields.Tries, } err := cfg.Run(tt.args.ctx, tt.args.fn) if diff := cmp.Diff(err, tt.wantErr, DeepAllowUnexported(RetryExhaustedError{}, errors.New(""))); diff != "" { t.Fatalf("Config.Run() unexpected error: %s", diff) } }) } } func TestBackoff_Linear(t *testing.T) { b := Backoff{ InitialBackoff: 2 * time.Minute, Multiplier: 2, } linear := (&b).Linear if linear() != 2*time.Minute { t.Fatal("first backoff should be 2 minutes") } if linear() != 4*time.Minute { t.Fatal("second backoff should be 4 minutes") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/retry/utils_test.go����������������������������������������������0000664�0000000�0000000�00000001670�13771713062�0022702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package retry import ( "reflect" "github.com/google/go-cmp/cmp" ) func DeepAllowUnexported(vs ...interface{}) cmp.Option { m := make(map[reflect.Type]struct{}) for _, v := range vs { structTypes(reflect.ValueOf(v), m) } var typs []interface{} for t := range m { typs = append(typs, reflect.New(t).Elem().Interface()) } return cmp.AllowUnexported(typs...) } func structTypes(v reflect.Value, m map[reflect.Type]struct{}) { if !v.IsValid() { return } switch v.Kind() { case reflect.Ptr: if !v.IsNil() { structTypes(v.Elem(), m) } case reflect.Interface: if !v.IsNil() { structTypes(v.Elem(), m) } case reflect.Slice, reflect.Array: for i := 0; i < v.Len(); i++ { structTypes(v.Index(i), m) } case reflect.Map: for _, k := range v.MapKeys() { structTypes(v.MapIndex(k), m) } case reflect.Struct: m[v.Type()] = struct{}{} for i := 0; i < v.NumField(); i++ { structTypes(v.Field(i), m) } } } ������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017567�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/artifact.go��������������������������������������������������0000664�0000000�0000000�00000003673�13771713062�0021724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.Artifact where the artifact is actually // available over an RPC connection. type artifact struct { commonClient } // ArtifactServer wraps a packersdk.Artifact implementation and makes it // exportable as part of a Golang RPC server. type ArtifactServer struct { artifact packersdk.Artifact } func (a *artifact) BuilderId() (result string) { a.client.Call(a.endpoint+".BuilderId", new(interface{}), &result) return } func (a *artifact) Files() (result []string) { a.client.Call(a.endpoint+".Files", new(interface{}), &result) return } func (a *artifact) Id() (result string) { a.client.Call(a.endpoint+".Id", new(interface{}), &result) return } func (a *artifact) String() (result string) { a.client.Call(a.endpoint+".String", new(interface{}), &result) return } func (a *artifact) State(name string) (result interface{}) { a.client.Call(a.endpoint+".State", name, &result) return } func (a *artifact) Destroy() error { var result error if err := a.client.Call(a.endpoint+".Destroy", new(interface{}), &result); err != nil { return err } return result } func (s *ArtifactServer) BuilderId(args *interface{}, reply *string) error { *reply = s.artifact.BuilderId() return nil } func (s *ArtifactServer) Files(args *interface{}, reply *[]string) error { *reply = s.artifact.Files() return nil } func (s *ArtifactServer) Id(args *interface{}, reply *string) error { *reply = s.artifact.Id() return nil } func (s *ArtifactServer) String(args *interface{}, reply *string) error { *reply = s.artifact.String() return nil } func (s *ArtifactServer) State(name string, reply *interface{}) error { *reply = s.artifact.State(name) return nil } func (s *ArtifactServer) Destroy(args *interface{}, reply *error) error { err := s.artifact.Destroy() if err != nil { err = NewBasicError(err) } *reply = err return nil } ���������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/artifact_test.go���������������������������������������������0000664�0000000�0000000�00000001461�13771713062�0022754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "reflect" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestArtifactRPC(t *testing.T) { // Create the interface to test a := new(packersdk.MockArtifact) // Start the server client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterArtifact(a) aClient := client.Artifact() // Test if aClient.BuilderId() != "bid" { t.Fatalf("bad: %s", aClient.BuilderId()) } if !reflect.DeepEqual(aClient.Files(), []string{"a", "b"}) { t.Fatalf("bad: %#v", aClient.Files()) } if aClient.Id() != "id" { t.Fatalf("bad: %s", aClient.Id()) } if aClient.String() != "string" { t.Fatalf("bad: %s", aClient.String()) } } func TestArtifact_Implements(t *testing.T) { var _ packersdk.Artifact = new(artifact) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/build.go�����������������������������������������������������0000664�0000000�0000000�00000007434�13771713062�0021225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "log" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.Build where the build is actually executed // over an RPC connection. type build struct { commonClient } // BuildServer wraps a packersdk.Build implementation and makes it exportable // as part of a Golang RPC server. type BuildServer struct { context context.Context contextCancel func() build packersdk.Build mux *muxBroker } type BuildPrepareResponse struct { Warnings []string Error *BasicError } func (b *build) Name() (result string) { b.client.Call("Build.Name", new(interface{}), &result) return } func (b *build) Prepare() ([]string, error) { var resp BuildPrepareResponse if cerr := b.client.Call("Build.Prepare", new(interface{}), &resp); cerr != nil { return nil, cerr } var err error = nil if resp.Error != nil { err = resp.Error } return resp.Warnings, err } func (b *build) Run(ctx context.Context, ui packersdk.Ui) ([]packersdk.Artifact, error) { nextId := b.mux.NextId() server := newServerWithMux(b.mux, nextId) server.RegisterUi(ui) go server.Serve() done := make(chan interface{}) defer close(done) go func() { select { case <-ctx.Done(): log.Printf("Cancelling build after context cancellation %v", ctx.Err()) if err := b.client.Call("Build.Cancel", new(interface{}), new(interface{})); err != nil { log.Printf("Error cancelling builder: %s", err) } case <-done: } }() var result []uint32 if err := b.client.Call("Build.Run", nextId, &result); err != nil { return nil, err } artifacts := make([]packersdk.Artifact, len(result)) for i, streamId := range result { client, err := newClientWithMux(b.mux, streamId) if err != nil { return nil, err } artifacts[i] = client.Artifact() } return artifacts, nil } func (b *build) SetDebug(val bool) { if err := b.client.Call("Build.SetDebug", val, new(interface{})); err != nil { panic(err) } } func (b *build) SetForce(val bool) { if err := b.client.Call("Build.SetForce", val, new(interface{})); err != nil { panic(err) } } func (b *build) SetOnError(val string) { if err := b.client.Call("Build.SetOnError", val, new(interface{})); err != nil { panic(err) } } func (b *build) Cancel() { if err := b.client.Call("Build.Cancel", new(interface{}), new(interface{})); err != nil { panic(err) } } func (b *BuildServer) Name(args *interface{}, reply *string) error { *reply = b.build.Name() return nil } func (b *BuildServer) Prepare(args *interface{}, resp *BuildPrepareResponse) error { warnings, err := b.build.Prepare() *resp = BuildPrepareResponse{ Warnings: warnings, Error: NewBasicError(err), } return nil } func (b *BuildServer) Run(streamId uint32, reply *[]uint32) error { if b.context == nil { b.context, b.contextCancel = context.WithCancel(context.Background()) } client, err := newClientWithMux(b.mux, streamId) if err != nil { return NewBasicError(err) } defer client.Close() artifacts, err := b.build.Run(b.context, client.Ui()) if err != nil { return NewBasicError(err) } *reply = make([]uint32, len(artifacts)) for i, artifact := range artifacts { streamId := b.mux.NextId() server := newServerWithMux(b.mux, streamId) server.RegisterArtifact(artifact) go server.Serve() (*reply)[i] = streamId } return nil } func (b *BuildServer) SetDebug(val *bool, reply *interface{}) error { b.build.SetDebug(*val) return nil } func (b *BuildServer) SetForce(val *bool, reply *interface{}) error { b.build.SetForce(*val) return nil } func (b *BuildServer) SetOnError(val *string, reply *interface{}) error { b.build.SetOnError(*val) return nil } func (b *BuildServer) Cancel(args *interface{}, reply *interface{}) error { if b.contextCancel != nil { b.contextCancel() } return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/build_test.go������������������������������������������������0000664�0000000�0000000�00000006452�13771713062�0022263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "errors" "reflect" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) var testBuildArtifact = &packersdk.MockArtifact{} type testBuild struct { nameCalled bool prepareCalled bool prepareWarnings []string runFn func(context.Context) runCalled bool runUi packersdk.Ui setDebugCalled bool setForceCalled bool setOnErrorCalled bool errRunResult bool } func (b *testBuild) Name() string { b.nameCalled = true return "name" } func (b *testBuild) Prepare() ([]string, error) { b.prepareCalled = true return b.prepareWarnings, nil } func (b *testBuild) Run(ctx context.Context, ui packersdk.Ui) ([]packersdk.Artifact, error) { b.runCalled = true b.runUi = ui if b.runFn != nil { b.runFn(ctx) } if b.errRunResult { return nil, errors.New("foo") } else { return []packersdk.Artifact{testBuildArtifact}, nil } } func (b *testBuild) SetDebug(bool) { b.setDebugCalled = true } func (b *testBuild) SetForce(bool) { b.setForceCalled = true } func (b *testBuild) SetOnError(string) { b.setOnErrorCalled = true } func TestBuild(t *testing.T) { b := new(testBuild) client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuild(b) bClient := client.Build() ctx := context.Background() // Test Name bClient.Name() if !b.nameCalled { t.Fatal("name should be called") } // Test Prepare bClient.Prepare() if !b.prepareCalled { t.Fatal("prepare should be called") } // Test Run ui := new(packersdk.MockUi) artifacts, err := bClient.Run(ctx, ui) if !b.runCalled { t.Fatal("run should be called") } if err != nil { t.Fatalf("err: %s", err) } if len(artifacts) != 1 { t.Fatalf("bad: %#v", artifacts) } if artifacts[0].BuilderId() != "bid" { t.Fatalf("bad: %#v", artifacts) } // Test run with an error b.errRunResult = true _, err = bClient.Run(ctx, ui) if err == nil { t.Fatal("should error") } // Test SetDebug bClient.SetDebug(true) if !b.setDebugCalled { t.Fatal("should be called") } // Test SetForce bClient.SetForce(true) if !b.setForceCalled { t.Fatal("should be called") } // Test SetOnError bClient.SetOnError("ask") if !b.setOnErrorCalled { t.Fatal("should be called") } } func TestBuild_cancel(t *testing.T) { topCtx, cancelTopCtx := context.WithCancel(context.Background()) b := new(testBuild) done := make(chan interface{}) b.runFn = func(ctx context.Context) { cancelTopCtx() <-ctx.Done() close(done) } client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuild(b) bClient := client.Build() bClient.Prepare() ui := new(packersdk.MockUi) bClient.Run(topCtx, ui) // if context cancellation is not propagated, this will timeout <-done } func TestBuildPrepare_Warnings(t *testing.T) { b := new(testBuild) client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuild(b) bClient := client.Build() expected := []string{"foo"} b.prepareWarnings = expected warnings, err := bClient.Prepare() if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(warnings, expected) { t.Fatalf("bad: %#v", warnings) } } func TestBuild_ImplementsBuild(t *testing.T) { var _ packersdk.Build = new(build) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/builder.go���������������������������������������������������0000664�0000000�0000000�00000006054�13771713062�0021551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "log" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.Builder where the builder is actually executed // over an RPC connection. type builder struct { commonClient } // BuilderServer wraps a packersdk.Builder implementation and makes it exportable // as part of a Golang RPC server. type BuilderServer struct { context context.Context contextCancel func() commonServer builder packersdk.Builder } type BuilderPrepareArgs struct { Configs []interface{} } type BuilderPrepareResponse struct { GeneratedVars []string Warnings []string Error *BasicError } func (b *builder) Prepare(config ...interface{}) ([]string, []string, error) { config, err := encodeCTYValues(config) if err != nil { return nil, nil, err } var resp BuilderPrepareResponse cerr := b.client.Call(b.endpoint+".Prepare", &BuilderPrepareArgs{config}, &resp) if cerr != nil { return nil, nil, cerr } if resp.Error != nil { err = resp.Error } return resp.GeneratedVars, resp.Warnings, err } func (b *builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { nextId := b.mux.NextId() server := newServerWithMux(b.mux, nextId) server.RegisterHook(hook) server.RegisterUi(ui) go server.Serve() done := make(chan interface{}) defer close(done) go func() { select { case <-ctx.Done(): log.Printf("Cancelling builder after context cancellation %v", ctx.Err()) if err := b.client.Call(b.endpoint+".Cancel", new(interface{}), new(interface{})); err != nil { log.Printf("Error cancelling builder: %s", err) } case <-done: } }() var responseId uint32 if err := b.client.Call(b.endpoint+".Run", nextId, &responseId); err != nil { return nil, err } if responseId == 0 { return nil, nil } client, err := newClientWithMux(b.mux, responseId) if err != nil { return nil, err } return client.Artifact(), nil } func (b *BuilderServer) Prepare(args *BuilderPrepareArgs, reply *BuilderPrepareResponse) error { config, err := decodeCTYValues(args.Configs) if err != nil { return err } generated, warnings, err := b.builder.Prepare(config...) *reply = BuilderPrepareResponse{ GeneratedVars: generated, Warnings: warnings, Error: NewBasicError(err), } return nil } func (b *BuilderServer) Run(streamId uint32, reply *uint32) error { client, err := newClientWithMux(b.mux, streamId) if err != nil { return NewBasicError(err) } defer client.Close() if b.context == nil { b.context, b.contextCancel = context.WithCancel(context.Background()) } artifact, err := b.builder.Run(b.context, client.Ui(), client.Hook()) if err != nil { return NewBasicError(err) } *reply = 0 if artifact != nil { streamId = b.mux.NextId() artifactServer := newServerWithMux(b.mux, streamId) artifactServer.RegisterArtifact(artifact) go artifactServer.Serve() *reply = streamId } return nil } func (b *BuilderServer) Cancel(args *interface{}, reply *interface{}) error { b.contextCancel() return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/builder_test.go����������������������������������������������0000664�0000000�0000000�00000006572�13771713062�0022615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "reflect" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) var testBuilderArtifact = &packersdk.MockArtifact{} func TestBuilderPrepare(t *testing.T) { b := new(packersdk.MockBuilder) client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuilder(b) bClient := client.Builder() // Test Prepare config := 42 _, warnings, err := bClient.Prepare(config) if err != nil { t.Fatalf("bad: %s", err) } if len(warnings) > 0 { t.Fatalf("bad: %#v", warnings) } if !b.PrepareCalled { t.Fatal("should be called") } expected := []interface{}{int64(42)} if !reflect.DeepEqual(b.PrepareConfig, expected) { t.Fatalf("bad: %#v != %#v", b.PrepareConfig, expected) } } func TestBuilderPrepare_Warnings(t *testing.T) { b := new(packersdk.MockBuilder) client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuilder(b) bClient := client.Builder() expected := []string{"foo"} b.PrepareWarnings = expected // Test Prepare _, warnings, err := bClient.Prepare(nil) if err != nil { t.Fatalf("bad: %s", err) } if !reflect.DeepEqual(warnings, expected) { t.Fatalf("bad: %#v", warnings) } } func TestBuilderRun(t *testing.T) { b := new(packersdk.MockBuilder) client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuilder(b) bClient := client.Builder() // Test Run hook := &packersdk.MockHook{} ui := &testUi{} artifact, err := bClient.Run(context.Background(), ui, hook) if err != nil { t.Fatalf("err: %s", err) } if !b.RunCalled { t.Fatal("run should be called") } if artifact.Id() != testBuilderArtifact.Id() { t.Fatalf("bad: %s", artifact.Id()) } } func TestBuilderRun_nilResult(t *testing.T) { b := new(packersdk.MockBuilder) b.RunNilResult = true client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuilder(b) bClient := client.Builder() hook := &packersdk.MockHook{} ui := &testUi{} artifact, err := bClient.Run(context.Background(), ui, hook) if artifact != nil { t.Fatalf("bad: %#v", artifact) } if err != nil { t.Fatalf("bad: %#v", err) } } func TestBuilderRun_ErrResult(t *testing.T) { b := new(packersdk.MockBuilder) client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuilder(b) bClient := client.Builder() b.RunErrResult = true hook := &packersdk.MockHook{} ui := &testUi{} artifact, err := bClient.Run(context.Background(), ui, hook) if artifact != nil { t.Fatalf("bad: %#v", artifact) } if err == nil { t.Fatal("should have error") } } func TestBuilderCancel(t *testing.T) { topCtx, topCtxCancel := context.WithCancel(context.Background()) // var runCtx context.Context b := new(packersdk.MockBuilder) cancelled := false b.RunFn = func(ctx context.Context) { topCtxCancel() <-ctx.Done() cancelled = true } client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterBuilder(b) bClient := client.Builder() _, err := bClient.Run(topCtx, new(testUi), new(packersdk.MockHook)) if err != nil { t.Fatalf("mock shouldnt retun run error for cancellation") } if !cancelled { t.Fatal("context should have been cancelled") } } func TestBuilder_ImplementsBuilder(t *testing.T) { var _ packersdk.Builder = new(builder) } ��������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/client.go����������������������������������������������������0000664�0000000�0000000�00000005575�13771713062�0021410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "io" "log" "net/rpc" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/ugorji/go/codec" ) // Client is the client end that communicates with a Packer RPC server. // Establishing a connection is up to the user. The Client can communicate over // any ReadWriteCloser. In Packer, each "plugin" (builder, provisioner, // and post-processor) creates and launches a server. The the packer "core" // creates and uses the client. type Client struct { mux *muxBroker client *rpc.Client closeMux bool } func NewClient(rwc io.ReadWriteCloser) (*Client, error) { mux, err := newMuxBrokerClient(rwc) if err != nil { return nil, err } go mux.Run() result, err := newClientWithMux(mux, 0) if err != nil { mux.Close() return nil, err } result.closeMux = true return result, err } func newClientWithMux(mux *muxBroker, streamId uint32) (*Client, error) { clientConn, err := mux.Dial(streamId) if err != nil { return nil, err } h := &codec.MsgpackHandle{ RawToString: true, WriteExt: true, } clientCodec := codec.GoRpc.ClientCodec(clientConn, h) return &Client{ mux: mux, client: rpc.NewClientWithCodec(clientCodec), closeMux: false, }, nil } func (c *Client) Close() error { if err := c.client.Close(); err != nil { return err } if c.closeMux { log.Printf("[WARN] Client is closing mux") return c.mux.Close() } return nil } func (c *Client) Artifact() packersdk.Artifact { return &artifact{ commonClient: commonClient{ endpoint: DefaultArtifactEndpoint, client: c.client, }, } } func (c *Client) Build() packersdk.Build { return &build{ commonClient: commonClient{ endpoint: DefaultBuildEndpoint, client: c.client, mux: c.mux, }, } } func (c *Client) Builder() packersdk.Builder { return &builder{ commonClient: commonClient{ endpoint: DefaultBuilderEndpoint, client: c.client, mux: c.mux, }, } } func (c *Client) Communicator() packersdk.Communicator { return &communicator{ commonClient: commonClient{ endpoint: DefaultCommunicatorEndpoint, client: c.client, mux: c.mux, }, } } func (c *Client) Hook() packersdk.Hook { return &hook{ commonClient: commonClient{ endpoint: DefaultHookEndpoint, client: c.client, mux: c.mux, }, } } func (c *Client) PostProcessor() packersdk.PostProcessor { return &postProcessor{ commonClient: commonClient{ endpoint: DefaultPostProcessorEndpoint, client: c.client, mux: c.mux, }, } } func (c *Client) Provisioner() packersdk.Provisioner { return &provisioner{ commonClient: commonClient{ endpoint: DefaultProvisionerEndpoint, client: c.client, mux: c.mux, }, } } func (c *Client) Ui() packersdk.Ui { return &Ui{ commonClient: commonClient{ endpoint: DefaultUiEndpoint, client: c.client, }, endpoint: DefaultUiEndpoint, } } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/client_test.go�����������������������������������������������0000664�0000000�0000000�00000001641�13771713062�0022435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "net" "testing" ) func testConn(t *testing.T) (net.Conn, net.Conn) { l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("err: %s", err) } var serverConn net.Conn errChan := make(chan error) go func() { defer close(errChan) defer l.Close() var err error serverConn, err = l.Accept() if err != nil { errChan <- err return } }() clientConn, err := net.Dial("tcp", l.Addr().String()) if err != nil { t.Fatalf("err: %s", err) } err = <-errChan if err != nil { t.Fatalf("err: %s", err) } return clientConn, serverConn } func testClientServer(t *testing.T) (*Client, *Server) { clientConn, serverConn := testConn(t) server, err := NewServer(serverConn) if err != nil { t.Fatalf("err: %v", err) } go server.Serve() client, err := NewClient(clientConn) if err != nil { server.Close() t.Fatalf("err: %s", err) } return client, server } �����������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/common.go����������������������������������������������������0000664�0000000�0000000�00000003455�13771713062�0021415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "bytes" "encoding/gob" "fmt" "net/rpc" "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // commonClient allows to rpc call funcs that can be defined on the different // build blocks of packer type commonClient struct { // endpoint is usually the type of build block we are connecting to. // // eg: Provisioner / PostProcessor / Builder / Artifact / Communicator endpoint string client *rpc.Client mux *muxBroker } type commonServer struct { mux *muxBroker selfConfigurable interface { ConfigSpec() hcldec.ObjectSpec } } type ConfigSpecResponse struct { ConfigSpec []byte } func (p *commonClient) ConfigSpec() hcldec.ObjectSpec { // TODO(azr): the RPC Call can fail but the ConfigSpec signature doesn't // return an error; should we simply panic ? Logging this for now; will // decide later. The correct approach would probably be to return an error // in ConfigSpec but that will break a lot of things. resp := &ConfigSpecResponse{} cerr := p.client.Call(p.endpoint+".ConfigSpec", new(interface{}), resp) if cerr != nil { err := fmt.Errorf("ConfigSpec failed: %v", cerr) panic(err.Error()) } res := hcldec.ObjectSpec{} err := gob.NewDecoder(bytes.NewReader(resp.ConfigSpec)).Decode(&res) if err != nil { panic("ici:" + err.Error()) } return res } func (s *commonServer) ConfigSpec(_ interface{}, reply *ConfigSpecResponse) error { spec := s.selfConfigurable.ConfigSpec() b := bytes.NewBuffer(nil) err := gob.NewEncoder(b).Encode(spec) reply.ConfigSpec = b.Bytes() return err } func init() { gob.Register(new(hcldec.AttrSpec)) gob.Register(new(hcldec.BlockSpec)) gob.Register(new(hcldec.BlockAttrsSpec)) gob.Register(new(hcldec.BlockListSpec)) gob.Register(new(hcldec.BlockObjectSpec)) gob.Register(new(cty.Value)) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/communicator.go����������������������������������������������0000664�0000000�0000000�00000017231�13771713062�0022622�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "encoding/gob" "io" "log" "net/rpc" "os" "sync" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.Communicator where the communicator is actually // executed over an RPC connection. type communicator struct { commonClient } // CommunicatorServer wraps a packersdk.Communicator implementation and makes // it exportable as part of a Golang RPC server. type CommunicatorServer struct { commonServer c packersdk.Communicator } type CommandFinished struct { ExitStatus int } type CommunicatorStartArgs struct { Command string StdinStreamId uint32 StdoutStreamId uint32 StderrStreamId uint32 ResponseStreamId uint32 } type CommunicatorDownloadArgs struct { Path string WriterStreamId uint32 } type CommunicatorUploadArgs struct { Path string ReaderStreamId uint32 FileInfo *fileInfo } type CommunicatorUploadDirArgs struct { Dst string Src string Exclude []string } type CommunicatorDownloadDirArgs struct { Dst string Src string Exclude []string } func Communicator(client *rpc.Client) *communicator { return &communicator{ commonClient: commonClient{ client: client, endpoint: DefaultCommunicatorEndpoint, }, } } func (c *communicator) Start(ctx context.Context, cmd *packersdk.RemoteCmd) (err error) { var args CommunicatorStartArgs args.Command = cmd.Command var wg sync.WaitGroup if cmd.Stdin != nil { args.StdinStreamId = c.mux.NextId() go func() { serveSingleCopy("stdin", c.mux, args.StdinStreamId, nil, cmd.Stdin) }() } if cmd.Stdout != nil { wg.Add(1) args.StdoutStreamId = c.mux.NextId() go func() { defer wg.Done() serveSingleCopy("stdout", c.mux, args.StdoutStreamId, cmd.Stdout, nil) }() } if cmd.Stderr != nil { wg.Add(1) args.StderrStreamId = c.mux.NextId() go func() { defer wg.Done() serveSingleCopy("stderr", c.mux, args.StderrStreamId, cmd.Stderr, nil) }() } responseStreamId := c.mux.NextId() args.ResponseStreamId = responseStreamId go func() { conn, err := c.mux.Accept(responseStreamId) wg.Wait() if err != nil { log.Printf("[ERR] Error accepting response stream %d: %s", responseStreamId, err) cmd.SetExited(123) return } defer conn.Close() var finished CommandFinished decoder := gob.NewDecoder(conn) if err := decoder.Decode(&finished); err != nil { log.Printf("[ERR] Error decoding response stream %d: %s", responseStreamId, err) cmd.SetExited(123) return } log.Printf("[INFO] RPC client: Communicator ended with: %d", finished.ExitStatus) cmd.SetExited(finished.ExitStatus) }() err = c.client.Call(c.endpoint+".Start", &args, new(interface{})) return } func (c *communicator) Upload(path string, r io.Reader, fi *os.FileInfo) (err error) { // Pipe the reader through to the connection streamId := c.mux.NextId() go serveSingleCopy("uploadData", c.mux, streamId, nil, r) args := CommunicatorUploadArgs{ Path: path, ReaderStreamId: streamId, } if fi != nil { args.FileInfo = NewFileInfo(*fi) } err = c.client.Call(c.endpoint+".Upload", &args, new(interface{})) return } func (c *communicator) UploadDir(dst string, src string, exclude []string) error { args := &CommunicatorUploadDirArgs{ Dst: dst, Src: src, Exclude: exclude, } var reply error err := c.client.Call(c.endpoint+".UploadDir", args, &reply) if err == nil { err = reply } return err } func (c *communicator) DownloadDir(src string, dst string, exclude []string) error { args := &CommunicatorDownloadDirArgs{ Dst: dst, Src: src, Exclude: exclude, } var reply error err := c.client.Call(c.endpoint+".DownloadDir", args, &reply) if err == nil { err = reply } return err } func (c *communicator) Download(path string, w io.Writer) (err error) { // Serve a single connection and a single copy streamId := c.mux.NextId() waitServer := make(chan struct{}) go func() { serveSingleCopy("downloadWriter", c.mux, streamId, w, nil) close(waitServer) }() args := CommunicatorDownloadArgs{ Path: path, WriterStreamId: streamId, } // Start sending data to the RPC server err = c.client.Call(c.endpoint+".Download", &args, new(interface{})) // Wait for the RPC server to finish receiving the data before we return <-waitServer return } func (c *CommunicatorServer) Start(args *CommunicatorStartArgs, reply *interface{}) error { ctx := context.TODO() // Build the RemoteCmd on this side so that it all pipes over // to the remote side. var cmd packersdk.RemoteCmd cmd.Command = args.Command // Create a channel to signal we're done so that we can close // our stdin/stdout/stderr streams toClose := make([]io.Closer, 0) doneCh := make(chan struct{}) go func() { <-doneCh for _, conn := range toClose { defer conn.Close() } }() if args.StdinStreamId > 0 { conn, err := c.mux.Dial(args.StdinStreamId) if err != nil { close(doneCh) return NewBasicError(err) } toClose = append(toClose, conn) cmd.Stdin = conn } if args.StdoutStreamId > 0 { conn, err := c.mux.Dial(args.StdoutStreamId) if err != nil { close(doneCh) return NewBasicError(err) } toClose = append(toClose, conn) cmd.Stdout = conn } if args.StderrStreamId > 0 { conn, err := c.mux.Dial(args.StderrStreamId) if err != nil { close(doneCh) return NewBasicError(err) } toClose = append(toClose, conn) cmd.Stderr = conn } // Connect to the response address so we can write our result to it // when ready. responseC, err := c.mux.Dial(args.ResponseStreamId) if err != nil { close(doneCh) return NewBasicError(err) } responseWriter := gob.NewEncoder(responseC) // Start the actual command err = c.c.Start(ctx, &cmd) if err != nil { close(doneCh) return NewBasicError(err) } // Start a goroutine to spin and wait for the process to actual // exit. When it does, report it back to caller... go func() { defer close(doneCh) defer responseC.Close() cmd.Wait() log.Printf("[INFO] RPC endpoint: Communicator ended with: %d", cmd.ExitStatus()) responseWriter.Encode(&CommandFinished{cmd.ExitStatus()}) }() return nil } func (c *CommunicatorServer) Upload(args *CommunicatorUploadArgs, reply *interface{}) (err error) { readerC, err := c.mux.Dial(args.ReaderStreamId) if err != nil { return } defer readerC.Close() var fi *os.FileInfo if args.FileInfo != nil { fi = new(os.FileInfo) *fi = *args.FileInfo } err = c.c.Upload(args.Path, readerC, fi) return } func (c *CommunicatorServer) UploadDir(args *CommunicatorUploadDirArgs, reply *error) error { return c.c.UploadDir(args.Dst, args.Src, args.Exclude) } func (c *CommunicatorServer) DownloadDir(args *CommunicatorUploadDirArgs, reply *error) error { return c.c.DownloadDir(args.Src, args.Dst, args.Exclude) } func (c *CommunicatorServer) Download(args *CommunicatorDownloadArgs, reply *interface{}) (err error) { writerC, err := c.mux.Dial(args.WriterStreamId) if err != nil { return } defer writerC.Close() err = c.c.Download(args.Path, writerC) return } func serveSingleCopy(name string, mux *muxBroker, id uint32, dst io.Writer, src io.Reader) { conn, err := mux.Accept(id) if err != nil { log.Printf("[ERR] '%s' accept error: %s", name, err) return } // Be sure to close the connection after we're done copying so // that an EOF will successfully be sent to the remote side defer conn.Close() // The connection is the destination/source that is nil if dst == nil { dst = conn } else { src = conn } written, err := io.Copy(dst, src) log.Printf("[INFO] %d bytes written for '%s'", written, name) if err != nil { log.Printf("[ERR] '%s' copy error: %s", name, err) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/communicator_test.go�����������������������������������������0000664�0000000�0000000�00000006623�13771713062�0023664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "bufio" "context" "io" "reflect" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestCommunicatorRPC(t *testing.T) { // Create the interface to test c := new(packersdk.MockCommunicator) // Start the server client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterCommunicator(c) remote := client.Communicator() // The remote command we'll use stdin_r, stdin_w := io.Pipe() stdout_r, stdout_w := io.Pipe() stderr_r, stderr_w := io.Pipe() var cmd packersdk.RemoteCmd cmd.Command = "foo" cmd.Stdin = stdin_r cmd.Stdout = stdout_w cmd.Stderr = stderr_w // Send some data on stdout and stderr from the mock c.StartStdout = "outfoo\n" c.StartStderr = "errfoo\n" c.StartExitStatus = 42 ctx := context.Background() // Test Start err := remote.Start(ctx, &cmd) if err != nil { t.Fatalf("err: %s", err) } // Test that we can read from stdout bufOut := bufio.NewReader(stdout_r) data, err := bufOut.ReadString('\n') if err != nil { t.Fatalf("err: %s", err) } if data != "outfoo\n" { t.Fatalf("bad data: %s", data) } // Test that we can read from stderr bufErr := bufio.NewReader(stderr_r) data, err = bufErr.ReadString('\n') if err != nil { t.Fatalf("err: %s", err) } if data != "errfoo\n" { t.Fatalf("bad data: %s", data) } // Test that we can write to stdin stdin_w.Write([]byte("info\n")) stdin_w.Close() cmd.Wait() if c.StartStdin != "info\n" { t.Fatalf("bad data: %s", c.StartStdin) } // Test that we can get the exit status properly if cmd.ExitStatus() != 42 { t.Fatalf("bad exit: %d", cmd.ExitStatus()) } // Test that we can upload things uploadR, uploadW := io.Pipe() go func() { defer uploadW.Close() uploadW.Write([]byte("uploadfoo\n")) }() err = remote.Upload("foo", uploadR, nil) if err != nil { t.Fatalf("err: %s", err) } if !c.UploadCalled { t.Fatal("should have uploaded") } if c.UploadPath != "foo" { t.Fatalf("path: %s", c.UploadPath) } if c.UploadData != "uploadfoo\n" { t.Fatalf("bad: %s", c.UploadData) } // Test that we can upload directories dirDst := "foo" dirSrc := "bar" dirExcl := []string{"foo"} err = remote.UploadDir(dirDst, dirSrc, dirExcl) if err != nil { t.Fatalf("err: %s", err) } if c.UploadDirDst != dirDst { t.Fatalf("bad: %s", c.UploadDirDst) } if c.UploadDirSrc != dirSrc { t.Fatalf("bad: %s", c.UploadDirSrc) } if !reflect.DeepEqual(c.UploadDirExclude, dirExcl) { t.Fatalf("bad: %#v", c.UploadDirExclude) } // Test that we can download things downloadR, downloadW := io.Pipe() downloadDone := make(chan bool) var downloadData string var downloadErr error go func() { bufDownR := bufio.NewReader(downloadR) downloadData, downloadErr = bufDownR.ReadString('\n') downloadDone <- true }() c.DownloadData = "download\n" err = remote.Download("bar", downloadW) if err != nil { t.Fatalf("err: %s", err) } if !c.DownloadCalled { t.Fatal("download should be called") } if c.DownloadPath != "bar" { t.Fatalf("bad: %s", c.DownloadPath) } <-downloadDone if downloadErr != nil { t.Fatalf("err: %s", downloadErr) } if downloadData != "download\n" { t.Fatalf("bad: %s", downloadData) } } func TestCommunicator_ImplementsCommunicator(t *testing.T) { var raw interface{} raw = Communicator(nil) if _, ok := raw.(packersdk.Communicator); !ok { t.Fatal("should be a Communicator") } } �������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/cty_encode.go������������������������������������������������0000664�0000000�0000000�00000001473�13771713062�0022237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/json" ) // cty.Value is does not know how to encode itself through the wire so we // transform it to bytes. func encodeCTYValues(config []interface{}) ([]interface{}, error) { for i := range config { if v, ok := config[i].(cty.Value); ok { b, err := json.Marshal(v, cty.DynamicPseudoType) if err != nil { return nil, err } config[i] = b } } return config, nil } // decodeCTYValues will try to decode a cty value when it finds a byte slice func decodeCTYValues(config []interface{}) ([]interface{}, error) { for i := range config { if b, ok := config[i].([]byte); ok { t, err := json.Unmarshal(b, cty.DynamicPseudoType) if err != nil { return nil, err } config[i] = t } } return config, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/error.go�����������������������������������������������������0000664�0000000�0000000�00000000743�13771713062�0021253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc // This is a type that wraps error types so that they can be messaged // across RPC channels. Since "error" is an interface, we can't always // gob-encode the underlying structure. This is a valid error interface // implementer that we will push across. type BasicError struct { Message string } func NewBasicError(err error) *BasicError { if err == nil { return nil } return &BasicError{err.Error()} } func (e *BasicError) Error() string { return e.Message } �����������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/error_test.go������������������������������������������������0000664�0000000�0000000�00000000503�13771713062�0022304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "errors" "testing" ) func TestBasicError_ImplementsError(t *testing.T) { var _ error = new(BasicError) } func TestBasicError_MatchesMessage(t *testing.T) { err := errors.New("foo") wrapped := NewBasicError(err) if wrapped.Error() != err.Error() { t.Fatalf("bad: %#v", wrapped.Error()) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/fileinfo.go��������������������������������������������������0000664�0000000�0000000�00000001204�13771713062�0021706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "os" "time" ) func NewFileInfo(fi os.FileInfo) *fileInfo { if fi == nil { return nil } return &fileInfo{N: fi.Name(), S: fi.Size(), M: fi.Mode(), T: fi.ModTime()} } type fileInfo struct { N string S int64 M os.FileMode T time.Time } func (fi fileInfo) Name() string { return fi.N } func (fi fileInfo) Size() int64 { return fi.S } func (fi fileInfo) Mode() os.FileMode { return fi.M } func (fi fileInfo) ModTime() time.Time { if fi.T.IsZero() { return time.Now() } return fi.T } func (fi fileInfo) IsDir() bool { return fi.M.IsDir() } func (fi fileInfo) Sys() interface{} { return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/fileinfo_test.go���������������������������������������������0000664�0000000�0000000�00000002226�13771713062�0022752�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "os" "testing" "time" ) type dummyFileInfo struct{} func (fi dummyFileInfo) Name() string { return "dummy" } func (fi dummyFileInfo) Size() int64 { return 64 } func (fi dummyFileInfo) Mode() os.FileMode { return 0644 } func (fi dummyFileInfo) ModTime() time.Time { return time.Time{}.Add(1 * time.Minute) } func (fi dummyFileInfo) IsDir() bool { return false } func (fi dummyFileInfo) Sys() interface{} { return nil } func TestNewFileInfoNilPointer(t *testing.T) { fi := NewFileInfo(os.FileInfo(nil)) if fi != nil { t.Fatalf("should be nil") } } func TestNewFileInfoValues(t *testing.T) { in := dummyFileInfo{} fi := NewFileInfo(in) if fi.Size() != in.Size() { t.Errorf("fi.Size() = %d; want %d", fi.Size(), in.Size()) } if fi.Name() != in.Name() { t.Errorf("fi.Name() = %s; want %s", fi.Name(), in.Name()) } if fi.Mode() != in.Mode() { t.Errorf("fi.Mode() = %#o; want %#o", fi.Mode(), in.Mode()) } if fi.ModTime() != in.ModTime() { t.Errorf("fi.ModTime() = %s; want %s", fi.ModTime(), in.ModTime()) } if fi.IsDir() != in.IsDir() { t.Errorf("fi.IsDir() = %t; want %t", fi.IsDir(), in.IsDir()) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/hook.go������������������������������������������������������0000664�0000000�0000000�00000003756�13771713062�0021071�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "log" "sync" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.Hook where the hook is actually executed // over an RPC connection. type hook struct { commonClient } // HookServer wraps a packersdk.Hook implementation and makes it exportable // as part of a Golang RPC server. type HookServer struct { context context.Context contextCancel func() hook packersdk.Hook lock sync.Mutex mux *muxBroker } type HookRunArgs struct { Name string Data interface{} StreamId uint32 } func (h *hook) Run(ctx context.Context, name string, ui packersdk.Ui, comm packersdk.Communicator, data interface{}) error { nextId := h.mux.NextId() server := newServerWithMux(h.mux, nextId) server.RegisterCommunicator(comm) server.RegisterUi(ui) go server.Serve() done := make(chan interface{}) defer close(done) go func() { select { case <-ctx.Done(): log.Printf("Cancelling hook after context cancellation %v", ctx.Err()) if err := h.client.Call(h.endpoint+".Cancel", new(interface{}), new(interface{})); err != nil { log.Printf("Error cancelling builder: %s", err) } case <-done: } }() args := HookRunArgs{ Name: name, Data: data, StreamId: nextId, } return h.client.Call(h.endpoint+".Run", &args, new(interface{})) } func (h *HookServer) Run(args *HookRunArgs, reply *interface{}) error { client, err := newClientWithMux(h.mux, args.StreamId) if err != nil { return NewBasicError(err) } defer client.Close() h.lock.Lock() if h.context == nil { h.context, h.contextCancel = context.WithCancel(context.Background()) } h.lock.Unlock() if err := h.hook.Run(h.context, args.Name, client.Ui(), client.Communicator(), args.Data); err != nil { return NewBasicError(err) } *reply = nil return nil } func (h *HookServer) Cancel(args *interface{}, reply *interface{}) error { h.lock.Lock() if h.contextCancel != nil { h.contextCancel() } h.lock.Unlock() return nil } ������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/hook_test.go�������������������������������������������������0000664�0000000�0000000�00000001303�13771713062�0022112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestHook_Implements(t *testing.T) { var _ packersdk.Hook = new(hook) } func TestHook_cancelWhileRun(t *testing.T) { topCtx, cancelTopCtx := context.WithCancel(context.Background()) h := &packersdk.MockHook{ RunFunc: func(ctx context.Context) error { cancelTopCtx() <-ctx.Done() return ctx.Err() }, } // Serve client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterHook(h) hClient := client.Hook() // Start the run err := hClient.Run(topCtx, "foo", nil, nil, nil) if err == nil { t.Fatal("should have errored") } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/init.go������������������������������������������������������0000664�0000000�0000000�00000000237�13771713062�0021063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import "encoding/gob" func init() { gob.Register(new(map[string]string)) gob.Register(make([]interface{}, 0)) gob.Register(new(BasicError)) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/mux_broker.go������������������������������������������������0000664�0000000�0000000�00000007460�13771713062�0022302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "encoding/binary" "fmt" "io" "net" "sync" "sync/atomic" "time" "github.com/hashicorp/yamux" ) // MuxBroker is responsible for brokering multiplexed connections by unique ID. // // This allows a plugin to request a channel with a specific ID to connect to // or accept a connection from, and the broker handles the details of // holding these channels open while they're being negotiated. type muxBroker struct { nextId uint32 session *yamux.Session streams map[uint32]*muxBrokerPending sync.Mutex } type muxBrokerPending struct { ch chan net.Conn doneCh chan struct{} } func newMuxBroker(s *yamux.Session) *muxBroker { return &muxBroker{ session: s, streams: make(map[uint32]*muxBrokerPending), } } func newMuxBrokerClient(rwc io.ReadWriteCloser) (*muxBroker, error) { s, err := yamux.Client(rwc, nil) if err != nil { return nil, err } return newMuxBroker(s), nil } func newMuxBrokerServer(rwc io.ReadWriteCloser) (*muxBroker, error) { s, err := yamux.Server(rwc, nil) if err != nil { return nil, err } return newMuxBroker(s), nil } // Accept accepts a connection by ID. // // This should not be called multiple times with the same ID at one time. func (m *muxBroker) Accept(id uint32) (net.Conn, error) { var c net.Conn p := m.getStream(id) select { case c = <-p.ch: close(p.doneCh) case <-time.After(5 * time.Second): m.Lock() defer m.Unlock() delete(m.streams, id) return nil, fmt.Errorf("timeout waiting for accept") } // Ack our connection if err := binary.Write(c, binary.LittleEndian, id); err != nil { c.Close() return nil, err } return c, nil } // Close closes the connection and all sub-connections. func (m *muxBroker) Close() error { return m.session.Close() } // Dial opens a connection by ID. func (m *muxBroker) Dial(id uint32) (net.Conn, error) { // Open the stream stream, err := m.session.OpenStream() if err != nil { return nil, err } // Write the stream ID onto the wire. if err := binary.Write(stream, binary.LittleEndian, id); err != nil { stream.Close() return nil, err } // Read the ack that we connected. Then we're off! var ack uint32 if err := binary.Read(stream, binary.LittleEndian, &ack); err != nil { stream.Close() return nil, err } if ack != id { stream.Close() return nil, fmt.Errorf("bad ack: %d (expected %d)", ack, id) } return stream, nil } // NextId returns a unique ID to use next. func (m *muxBroker) NextId() uint32 { return atomic.AddUint32(&m.nextId, 1) } // Run starts the brokering and should be executed in a goroutine, since it // blocks forever, or until the session closes. func (m *muxBroker) Run() { for { stream, err := m.session.AcceptStream() if err != nil { // Once we receive an error, just exit break } // Read the stream ID from the stream var id uint32 if err := binary.Read(stream, binary.LittleEndian, &id); err != nil { stream.Close() continue } // Initialize the waiter p := m.getStream(id) select { case p.ch <- stream: default: } // Wait for a timeout go m.timeoutWait(id, p) } } func (m *muxBroker) getStream(id uint32) *muxBrokerPending { m.Lock() defer m.Unlock() p, ok := m.streams[id] if ok { return p } m.streams[id] = &muxBrokerPending{ ch: make(chan net.Conn, 1), doneCh: make(chan struct{}), } return m.streams[id] } func (m *muxBroker) timeoutWait(id uint32, p *muxBrokerPending) { // Wait for the stream to either be picked up and connected, or // for a timeout. timeout := false select { case <-p.doneCh: case <-time.After(5 * time.Second): timeout = true } m.Lock() defer m.Unlock() // Delete the stream so no one else can grab it delete(m.streams, id) // If we timed out, then check if we have a channel in the buffer, // and if so, close it. if timeout { s := <-p.ch s.Close() } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/mux_broker_test.go�������������������������������������������0000664�0000000�0000000�00000003052�13771713062�0023332�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "fmt" "net" "testing" "github.com/hashicorp/yamux" ) func TestMuxBroker(t *testing.T) { c, s := testYamux(t) defer c.Close() defer s.Close() bc := newMuxBroker(c) bs := newMuxBroker(s) go bc.Run() go bs.Run() errChan := make(chan error, 1) go func() { defer close(errChan) c, err := bc.Dial(5) if err != nil { errChan <- fmt.Errorf("err dialing: %s", err.Error()) return } if _, err := c.Write([]byte{42}); err != nil { errChan <- fmt.Errorf("err writing: %s", err.Error()) } }() client, err := bs.Accept(5) if err != nil { t.Fatalf("err: %s", err) } var data [1]byte if _, err := client.Read(data[:]); err != nil { t.Fatalf("err: %s", err) } if data[0] != 42 { t.Fatalf("bad: %d", data[0]) } for err := range errChan { if err != nil { t.Fatalf(err.Error()) } } } func testYamux(t *testing.T) (client *yamux.Session, server *yamux.Session) { l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("err: %s", err) } // Server side errChan := make(chan error) go func() { defer close(errChan) conn, err := l.Accept() l.Close() if err != nil { errChan <- err return } server, err = yamux.Server(conn, nil) if err != nil { errChan <- err } }() // Client side conn, err := net.Dial("tcp", l.Addr().String()) if err != nil { t.Fatalf("err: %s", err) } client, err = yamux.Client(conn, nil) if err != nil { t.Fatalf("err: %s", err) } // Wait for the server err = <-errChan if err != nil { t.Fatalf("err: %s", err) } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/post_processor.go��������������������������������������������0000664�0000000�0000000�00000007213�13771713062�0023205�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "log" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.PostProcessor where the PostProcessor is actually // executed over an RPC connection. type postProcessor struct { commonClient } // PostProcessorServer wraps a packersdk.PostProcessor implementation and makes it // exportable as part of a Golang RPC server. type PostProcessorServer struct { context context.Context contextCancel func() commonServer p packersdk.PostProcessor } type PostProcessorConfigureArgs struct { Configs []interface{} } type PostProcessorProcessResponse struct { Err *BasicError Keep bool ForceOverride bool StreamId uint32 } func (p *postProcessor) Configure(raw ...interface{}) error { raw, err := encodeCTYValues(raw) if err != nil { return err } args := &PostProcessorConfigureArgs{Configs: raw} return p.client.Call(p.endpoint+".Configure", args, new(interface{})) } func (p *postProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { nextId := p.mux.NextId() server := newServerWithMux(p.mux, nextId) server.RegisterArtifact(a) server.RegisterUi(ui) go server.Serve() done := make(chan interface{}) defer close(done) go func() { select { case <-ctx.Done(): log.Printf("Cancelling post-processor after context cancellation %v", ctx.Err()) if err := p.client.Call(p.endpoint+".Cancel", new(interface{}), new(interface{})); err != nil { log.Printf("Error cancelling post-processor: %s", err) } case <-done: } }() var response PostProcessorProcessResponse if err := p.client.Call(p.endpoint+".PostProcess", nextId, &response); err != nil { return nil, false, false, err } if response.Err != nil { return nil, false, false, response.Err } if response.StreamId == 0 { return nil, false, false, nil } client, err := newClientWithMux(p.mux, response.StreamId) if err != nil { return nil, false, false, err } return client.Artifact(), response.Keep, response.ForceOverride, nil } func (p *PostProcessorServer) Configure(args *PostProcessorConfigureArgs, reply *interface{}) (err error) { config, err := decodeCTYValues(args.Configs) if err != nil { return err } err = p.p.Configure(config...) return err } func (p *PostProcessorServer) PostProcess(streamId uint32, reply *PostProcessorProcessResponse) error { client, err := newClientWithMux(p.mux, streamId) if err != nil { return NewBasicError(err) } if p.context == nil { p.context, p.contextCancel = context.WithCancel(context.Background()) } artifact := client.Artifact() artifactResult, keep, forceOverride, err := p.p.PostProcess(p.context, client.Ui(), artifact) *reply = PostProcessorProcessResponse{ Err: NewBasicError(err), Keep: keep, ForceOverride: forceOverride, StreamId: 0, } if err != nil { log.Printf("error: %v", err) client.Close() return nil } if artifactResult != artifact { // Sometimes, the artifact returned by PostProcess is the artifact from // client.Artifact() and in that case we don't want to close client; // otherwise the outcome is sort of undetermined. See [GH-9995] for a // good test file. defer client.Close() } if artifactResult != nil { streamId = p.mux.NextId() reply.StreamId = streamId server := newServerWithMux(p.mux, streamId) if err := server.RegisterArtifact(artifactResult); err != nil { return err } go server.Serve() } return nil } func (b *PostProcessorServer) Cancel(args *interface{}, reply *interface{}) error { if b.contextCancel != nil { b.contextCancel() } return nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/post_processor_test.go���������������������������������������0000664�0000000�0000000�00000006030�13771713062�0024240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "reflect" "testing" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) var testPostProcessorArtifact = new(packersdk.MockArtifact) type TestPostProcessor struct { configCalled bool configVal []interface{} ppCalled bool ppArtifact packersdk.Artifact ppArtifactId string ppUi packersdk.Ui postProcessFn func(context.Context) error } func (*TestPostProcessor) ConfigSpec() hcldec.ObjectSpec { return nil } func (pp *TestPostProcessor) Configure(v ...interface{}) error { pp.configCalled = true pp.configVal = v return nil } func (pp *TestPostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { pp.ppCalled = true pp.ppArtifact = a pp.ppArtifactId = a.Id() pp.ppUi = ui if pp.postProcessFn != nil { return testPostProcessorArtifact, false, false, pp.postProcessFn(ctx) } return testPostProcessorArtifact, false, false, nil } func TestPostProcessorRPC(t *testing.T) { // Create the interface to test p := new(TestPostProcessor) // Start the server client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterPostProcessor(p) ppClient := client.PostProcessor() // Test Configure config := 42 err := ppClient.Configure(config) if err != nil { t.Fatalf("error: %s", err) } if !p.configCalled { t.Fatal("config should be called") } expected := []interface{}{int64(42)} if !reflect.DeepEqual(p.configVal, expected) { t.Fatalf("unknown config value: %#v", p.configVal) } // Test PostProcess a := &packersdk.MockArtifact{ IdValue: "ppTestId", } ui := new(testUi) artifact, _, _, err := ppClient.PostProcess(context.Background(), ui, a) if err != nil { t.Fatalf("err: %s", err) } if !p.ppCalled { t.Fatal("postprocess should be called") } if p.ppArtifactId != "ppTestId" { t.Fatalf("unknown artifact: '%s'", p.ppArtifact.Id()) } if artifact.Id() != "id" { t.Fatalf("unknown artifact: %s", artifact.Id()) } } func TestPostProcessorRPC_cancel(t *testing.T) { topCtx, cancelTopCtx := context.WithCancel(context.Background()) p := new(TestPostProcessor) p.postProcessFn = func(ctx context.Context) error { cancelTopCtx() <-ctx.Done() return ctx.Err() } // Start the server client, server := testClientServer(t) defer client.Close() defer server.Close() if err := server.RegisterPostProcessor(p); err != nil { panic(err) } ppClient := client.PostProcessor() // Test Configure config := 42 err := ppClient.Configure(config) if err != nil { t.Fatalf("error configuring post-processor client: %s", err) } // Test PostProcess a := &packersdk.MockArtifact{ IdValue: "ppTestId", } ui := new(testUi) _, _, _, err = ppClient.PostProcess(topCtx, ui, a) if err == nil { t.Fatalf("should err") } } func TestPostProcessor_Implements(t *testing.T) { var raw interface{} raw = new(postProcessor) if _, ok := raw.(packersdk.PostProcessor); !ok { t.Fatal("not a postprocessor") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/provisioner.go�����������������������������������������������0000664�0000000�0000000�00000004760�13771713062�0022504�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "log" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.Provisioner where the provisioner is actually // executed over an RPC connection. type provisioner struct { commonClient } // ProvisionerServer wraps a packersdk.Provisioner implementation and makes it // exportable as part of a Golang RPC server. type ProvisionerServer struct { context context.Context contextCancel func() commonServer p packersdk.Provisioner } type ProvisionerPrepareArgs struct { Configs []interface{} } func (p *provisioner) Prepare(configs ...interface{}) error { configs, err := encodeCTYValues(configs) if err != nil { return err } args := &ProvisionerPrepareArgs{configs} return p.client.Call(p.endpoint+".Prepare", args, new(interface{})) } type ProvisionerProvisionArgs struct { GeneratedData map[string]interface{} StreamID uint32 } func (p *provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { nextId := p.mux.NextId() server := newServerWithMux(p.mux, nextId) server.RegisterCommunicator(comm) server.RegisterUi(ui) go server.Serve() done := make(chan interface{}) defer close(done) go func() { select { case <-ctx.Done(): log.Printf("Cancelling provisioner after context cancellation %v", ctx.Err()) if err := p.client.Call(p.endpoint+".Cancel", new(interface{}), new(interface{})); err != nil { log.Printf("Error cancelling provisioner: %s", err) } case <-done: } }() args := &ProvisionerProvisionArgs{generatedData, nextId} return p.client.Call(p.endpoint+".Provision", args, new(interface{})) } func (p *ProvisionerServer) Prepare(args *ProvisionerPrepareArgs, reply *interface{}) error { config, err := decodeCTYValues(args.Configs) if err != nil { return err } return p.p.Prepare(config...) } func (p *ProvisionerServer) Provision(args *ProvisionerProvisionArgs, reply *interface{}) error { streamId := args.StreamID client, err := newClientWithMux(p.mux, streamId) if err != nil { return NewBasicError(err) } defer client.Close() if p.context == nil { p.context, p.contextCancel = context.WithCancel(context.Background()) } if err := p.p.Provision(p.context, client.Ui(), client.Communicator(), args.GeneratedData); err != nil { return NewBasicError(err) } return nil } func (p *ProvisionerServer) Cancel(args *interface{}, reply *interface{}) error { p.contextCancel() return nil } ����������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/provisioner_test.go������������������������������������������0000664�0000000�0000000�00000002227�13771713062�0023537�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "context" "reflect" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestProvisionerRPC(t *testing.T) { topCtx, topCtxCancel := context.WithCancel(context.Background()) // Create the interface to test p := new(packersdk.MockProvisioner) p.ProvFunc = func(ctx context.Context) error { topCtxCancel() <-ctx.Done() return ctx.Err() } // Start the server client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterProvisioner(p) pClient := client.Provisioner() // Test Prepare config := 42 pClient.Prepare(config) if !p.PrepCalled { t.Fatal("should be called") } expected := []interface{}{int64(42)} if !reflect.DeepEqual(p.PrepConfigs, expected) { t.Fatalf("bad: %#v", p.PrepConfigs) } // Test Provision ui := &testUi{} comm := &packersdk.MockCommunicator{} if err := pClient.Provision(topCtx, ui, comm, make(map[string]interface{})); err == nil { t.Fatalf("Provison should have err") } if !p.ProvCalled { t.Fatal("should be called") } } func TestProvisioner_Implements(t *testing.T) { var _ packersdk.Provisioner = new(provisioner) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/server.go����������������������������������������������������0000664�0000000�0000000�00000007313�13771713062�0021430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "io" "log" "net/rpc" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/ugorji/go/codec" ) const ( DefaultArtifactEndpoint string = "Artifact" DefaultBuildEndpoint = "Build" DefaultBuilderEndpoint = "Builder" DefaultCacheEndpoint = "Cache" DefaultCommandEndpoint = "Command" DefaultCommunicatorEndpoint = "Communicator" DefaultHookEndpoint = "Hook" DefaultPostProcessorEndpoint = "PostProcessor" DefaultProvisionerEndpoint = "Provisioner" DefaultUiEndpoint = "Ui" ) // Server represents an RPC server for Packer. This must be paired on // the other side with a Client. In Packer, each "plugin" (builder, provisioner, // and post-processor) creates and launches a server. The client created and // used by the packer "core" type Server struct { mux *muxBroker streamId uint32 server *rpc.Server closeMux bool } // NewServer returns a new Packer RPC server. func NewServer(conn io.ReadWriteCloser) (*Server, error) { mux, err := newMuxBrokerServer(conn) if err != nil { return nil, err } result := newServerWithMux(mux, 0) result.closeMux = true go mux.Run() return result, nil } func newServerWithMux(mux *muxBroker, streamId uint32) *Server { return &Server{ mux: mux, streamId: streamId, server: rpc.NewServer(), closeMux: false, } } func (s *Server) Close() error { if s.closeMux { log.Printf("[WARN] Shutting down mux conn in Server") return s.mux.Close() } return nil } func (s *Server) RegisterArtifact(a packersdk.Artifact) error { return s.server.RegisterName(DefaultArtifactEndpoint, &ArtifactServer{ artifact: a, }) } func (s *Server) RegisterBuild(b packersdk.Build) error { return s.server.RegisterName(DefaultBuildEndpoint, &BuildServer{ build: b, mux: s.mux, }) } func (s *Server) RegisterBuilder(b packersdk.Builder) error { return s.server.RegisterName(DefaultBuilderEndpoint, &BuilderServer{ commonServer: commonServer{ selfConfigurable: b, mux: s.mux, }, builder: b, }) } func (s *Server) RegisterCommunicator(c packersdk.Communicator) error { return s.server.RegisterName(DefaultCommunicatorEndpoint, &CommunicatorServer{ c: c, commonServer: commonServer{ mux: s.mux, }, }) } func (s *Server) RegisterHook(h packersdk.Hook) error { return s.server.RegisterName(DefaultHookEndpoint, &HookServer{ hook: h, mux: s.mux, }) } func (s *Server) RegisterPostProcessor(p packersdk.PostProcessor) error { return s.server.RegisterName(DefaultPostProcessorEndpoint, &PostProcessorServer{ commonServer: commonServer{ selfConfigurable: p, mux: s.mux, }, p: p, }) } func (s *Server) RegisterProvisioner(p packersdk.Provisioner) error { return s.server.RegisterName(DefaultProvisionerEndpoint, &ProvisionerServer{ commonServer: commonServer{ selfConfigurable: p, mux: s.mux, }, p: p, }) } func (s *Server) RegisterUi(ui packersdk.Ui) error { return s.server.RegisterName(DefaultUiEndpoint, &UiServer{ ui: ui, register: s.server.RegisterName, }) } // ServeConn serves a single connection over the RPC server. It is up // to the caller to obtain a proper io.ReadWriteCloser. func (s *Server) Serve() { // Accept a connection on stream ID 0, which is always used for // normal client to server connections. stream, err := s.mux.Accept(s.streamId) if err != nil { log.Printf("[ERR] Error retrieving stream for serving: %s", err) return } defer stream.Close() h := &codec.MsgpackHandle{ RawToString: true, WriteExt: true, } rpcCodec := codec.GoRpc.ServerCodec(stream, h) s.server.ServeCodec(rpcCodec) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/server_test.go�����������������������������������������������0000664�0000000�0000000�00000000014�13771713062�0022456�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/ui.go��������������������������������������������������������0000664�0000000�0000000�00000004065�13771713062�0020540�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "log" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // An implementation of packersdk.Ui where the Ui is actually executed // over an RPC connection. type Ui struct { commonClient endpoint string } var _ packersdk.Ui = new(Ui) // UiServer wraps a packersdk.Ui implementation and makes it exportable // as part of a Golang RPC server. type UiServer struct { ui packersdk.Ui register func(name string, rcvr interface{}) error } // The arguments sent to Ui.Machine type UiMachineArgs struct { Category string Args []string } func (u *Ui) Ask(query string) (result string, err error) { err = u.client.Call("Ui.Ask", query, &result) return } func (u *Ui) Error(message string) { if err := u.client.Call("Ui.Error", message, new(interface{})); err != nil { log.Printf("Error in Ui.Error RPC call: %s", err) } } func (u *Ui) Machine(t string, args ...string) { rpcArgs := &UiMachineArgs{ Category: t, Args: args, } if err := u.client.Call("Ui.Machine", rpcArgs, new(interface{})); err != nil { log.Printf("Error in Ui.Machine RPC call: %s", err) } } func (u *Ui) Message(message string) { if err := u.client.Call("Ui.Message", message, new(interface{})); err != nil { log.Printf("Error in Ui.Message RPC call: %s", err) } } func (u *Ui) Say(message string) { if err := u.client.Call("Ui.Say", message, new(interface{})); err != nil { log.Printf("Error in Ui.Say RPC call: %s", err) } } func (u *UiServer) Ask(query string, reply *string) (err error) { *reply, err = u.ui.Ask(query) return } func (u *UiServer) Error(message *string, reply *interface{}) error { u.ui.Error(*message) *reply = nil return nil } func (u *UiServer) Machine(args *UiMachineArgs, reply *interface{}) error { u.ui.Machine(args.Category, args.Args...) *reply = nil return nil } func (u *UiServer) Message(message *string, reply *interface{}) error { u.ui.Message(*message) *reply = nil return nil } func (u *UiServer) Say(message *string, reply *interface{}) error { u.ui.Say(*message) *reply = nil return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/ui_progress_tracking.go��������������������������������������0000664�0000000�0000000�00000005027�13771713062�0024345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "io" "log" "net/rpc" "github.com/hashicorp/packer/packer-plugin-sdk/random" ) // TrackProgress starts a pair of ProgressTrackingClient and ProgressProgressTrackingServer // that will send the size of each read bytes of stream. // In order to track an operation on the terminal side. func (u *Ui) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser { pl := &TrackProgressParameters{ Src: src, CurrentSize: currentSize, TotalSize: totalSize, } var trackingID string if err := u.client.Call("Ui.NewTrackProgress", pl, &trackingID); err != nil { log.Printf("Error in Ui.NewTrackProgress RPC call: %s", err) return stream } cli := &ProgressTrackingClient{ id: trackingID, client: u.client, stream: stream, } return cli } type ProgressTrackingClient struct { id string client *rpc.Client stream io.ReadCloser } // Read will send len(b) over the wire instead of it's content func (u *ProgressTrackingClient) Read(b []byte) (read int, err error) { defer func() { if err := u.client.Call("Ui"+u.id+".Add", read, new(interface{})); err != nil { log.Printf("Error in ProgressTrackingClient.Read RPC call: %s", err) } }() return u.stream.Read(b) } func (u *ProgressTrackingClient) Close() error { log.Printf("closing") if err := u.client.Call("Ui"+u.id+".Close", nil, new(interface{})); err != nil { log.Printf("Error in ProgressTrackingClient.Close RPC call: %s", err) } return u.stream.Close() } type TrackProgressParameters struct { Src string TotalSize int64 CurrentSize int64 } func (ui *UiServer) NewTrackProgress(pl *TrackProgressParameters, reply *string) error { // keep identifier as is for now srvr := &ProgressTrackingServer{ id: *reply, } *reply = pl.Src + random.AlphaNum(6) srvr.stream = ui.ui.TrackProgress(pl.Src, pl.CurrentSize, pl.TotalSize, nopReadCloser{}) err := ui.register("Ui"+*reply, srvr) if err != nil { log.Printf("failed to register ProgressTrackingServer at %s: %s", *reply, err) return err } return nil } type ProgressTrackingServer struct { id string stream io.ReadCloser } func (t *ProgressTrackingServer) Add(size int, _ *interface{}) error { stubBytes := make([]byte, size, size) t.stream.Read(stubBytes) return nil } func (t *ProgressTrackingServer) Close(_, _ *interface{}) error { t.stream.Close() return nil } type nopReadCloser struct { } func (nopReadCloser) Close() error { return nil } func (nopReadCloser) Read(b []byte) (int, error) { return len(b), nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/rpc/ui_test.go���������������������������������������������������0000664�0000000�0000000�00000006061�13771713062�0021575�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package rpc import ( "bytes" "io" "io/ioutil" "reflect" "testing" ) type testUi struct { askCalled bool askQuery string errorCalled bool errorMessage string machineCalled bool machineType string machineArgs []string messageCalled bool messageMessage string sayCalled bool sayMessage string trackProgressCalled bool progressBarAddCalled bool progressBarCloseCalled bool } func (u *testUi) Ask(query string) (string, error) { u.askCalled = true u.askQuery = query return "foo", nil } func (u *testUi) Error(message string) { u.errorCalled = true u.errorMessage = message } func (u *testUi) Machine(t string, args ...string) { u.machineCalled = true u.machineType = t u.machineArgs = args } func (u *testUi) Message(message string) { u.messageCalled = true u.messageMessage = message } func (u *testUi) Say(message string) { u.sayCalled = true u.sayMessage = message } func (u *testUi) TrackProgress(_ string, _, _ int64, stream io.ReadCloser) (body io.ReadCloser) { u.trackProgressCalled = true return &readCloser{ read: func(p []byte) (int, error) { u.progressBarAddCalled = true return stream.Read(p) }, close: func() error { u.progressBarCloseCalled = true return stream.Close() }, } } type readCloser struct { read func([]byte) (int, error) close func() error } func (c *readCloser) Close() error { return c.close() } func (c *readCloser) Read(p []byte) (int, error) { return c.read(p) } func TestUiRPC(t *testing.T) { // Create the UI to test ui := new(testUi) // Start the RPC server client, server := testClientServer(t) defer client.Close() defer server.Close() server.RegisterUi(ui) uiClient := client.Ui() // Basic error and say tests result, err := uiClient.Ask("query") if err != nil { t.Fatalf("err: %s", err) } if !ui.askCalled { t.Fatal("should be called") } if ui.askQuery != "query" { t.Fatalf("bad: %s", ui.askQuery) } if result != "foo" { t.Fatalf("bad: %#v", result) } uiClient.Error("message") if ui.errorMessage != "message" { t.Fatalf("bad: %#v", ui.errorMessage) } uiClient.Message("message") if ui.messageMessage != "message" { t.Fatalf("bad: %#v", ui.errorMessage) } uiClient.Say("message") if ui.sayMessage != "message" { t.Fatalf("bad: %#v", ui.errorMessage) } ctt := []byte("foo bar baz !!!") rc := ioutil.NopCloser(bytes.NewReader(ctt)) stream := uiClient.TrackProgress("stuff.txt", 0, int64(len(ctt)), rc) if ui.trackProgressCalled != true { t.Errorf("ProgressBastream not called.") } b := []byte{0} stream.Read(b) // output ignored if ui.progressBarAddCalled != true { t.Errorf("Add not called.") } stream.Close() if ui.progressBarCloseCalled != true { t.Errorf("close not called.") } uiClient.Machine("foo", "bar", "baz") if !ui.machineCalled { t.Fatal("machine should be called") } if ui.machineType != "foo" { t.Fatalf("bad type: %#v", ui.machineType) } expected := []string{"bar", "baz"} if !reflect.DeepEqual(ui.machineArgs, expected) { t.Fatalf("bad: %#v", ui.machineArgs) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021561�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024261�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/none/���������������������������������0000775�0000000�0000000�00000000000�13771713062�0025220�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/none/communicator.go������������������0000664�0000000�0000000�00000002161�13771713062�0030247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package none import ( "context" "errors" "io" "os" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type comm struct { config string } // Creates a null packersdk.Communicator implementation. This takes // an already existing configuration. func New(config string) (result *comm, err error) { // Establish an initial connection and connect result = &comm{ config: config, } return } func (c *comm) Start(ctx context.Context, cmd *packersdk.RemoteCmd) (err error) { cmd.SetExited(0) return } func (c *comm) Upload(path string, input io.Reader, fi *os.FileInfo) error { return errors.New("Upload is not implemented when communicator = 'none'") } func (c *comm) UploadDir(dst string, src string, excl []string) error { return errors.New("UploadDir is not implemented when communicator = 'none'") } func (c *comm) Download(path string, output io.Writer) error { return errors.New("Download is not implemented when communicator = 'none'") } func (c *comm) DownloadDir(dst string, src string, excl []string) error { return errors.New("DownloadDir is not implemented when communicator = 'none'") } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/none/communicator_test.go�������������0000664�0000000�0000000�00000000430�13771713062�0031303�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package none import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestCommIsCommunicator(t *testing.T) { var raw interface{} raw = &comm{} if _, ok := raw.(packersdk.Communicator); !ok { t.Fatalf("comm must be a communicator") } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/����������������������������������0000775�0000000�0000000�00000000000�13771713062�0025056�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/communicator.go�������������������0000664�0000000�0000000�00000062366�13771713062�0030122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "bufio" "bytes" "context" "errors" "fmt" "io" "io/ioutil" "log" "net" "os" "path/filepath" "strconv" "strings" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/pkg/sftp" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) // ErrHandshakeTimeout is returned from New() whenever we're unable to establish // an ssh connection within a certain timeframe. By default the handshake time- // out period is 1 minute. You can change it with Config.HandshakeTimeout. var ErrHandshakeTimeout = fmt.Errorf("Timeout during SSH handshake") type comm struct { client *ssh.Client config *Config conn net.Conn address string } // TunnelDirection is the supported tunnel directions type TunnelDirection int const ( UnsetTunnel TunnelDirection = iota RemoteTunnel LocalTunnel ) // TunnelSpec represents a request to map a port on one side of the SSH connection to the other type TunnelSpec struct { Direction TunnelDirection ListenType string ListenAddr string ForwardType string ForwardAddr string } // Config is the structure used to configure the SSH communicator. type Config struct { // The configuration of the Go SSH connection SSHConfig *ssh.ClientConfig // Connection returns a new connection. The current connection // in use will be closed as part of the Close method, or in the // case an error occurs. Connection func() (net.Conn, error) // Pty, if true, will request a pty from the remote end. Pty bool // DisableAgentForwarding, if true, will not forward the SSH agent. DisableAgentForwarding bool // HandshakeTimeout limits the amount of time we'll wait to handshake before // saying the connection failed. HandshakeTimeout time.Duration // UseSftp, if true, sftp will be used instead of scp for file transfers UseSftp bool // KeepAliveInterval sets how often we send a channel request to the // server. A value < 0 disables. KeepAliveInterval time.Duration // Timeout is how long to wait for a read or write to succeed. Timeout time.Duration Tunnels []TunnelSpec } // Creates a new packersdk.Communicator implementation over SSH. This takes // an already existing TCP connection and SSH configuration. func New(address string, config *Config) (result *comm, err error) { // Establish an initial connection and connect result = &comm{ config: config, address: address, } if err = result.reconnect(); err != nil { result = nil return } return } func (c *comm) Start(ctx context.Context, cmd *packersdk.RemoteCmd) (err error) { session, err := c.newSession() if err != nil { return } // Setup our session session.Stdin = cmd.Stdin session.Stdout = cmd.Stdout session.Stderr = cmd.Stderr if c.config.Pty { // Request a PTY termModes := ssh.TerminalModes{ ssh.ECHO: 0, // do not echo ssh.TTY_OP_ISPEED: 14400, // input speed = 14.4kbaud ssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud } if err = session.RequestPty("xterm", 40, 80, termModes); err != nil { return } } log.Printf("[DEBUG] starting remote command: %s", cmd.Command) err = session.Start(cmd.Command + "\n") if err != nil { return } go func() { if c.config.KeepAliveInterval <= 0 { return } c := time.NewTicker(c.config.KeepAliveInterval) defer c.Stop() for range c.C { _, err := session.SendRequest("keepalive@packer.io", true, nil) if err != nil { return } } }() // Start a goroutine to wait for the session to end and set the // exit boolean and status. go func() { defer session.Close() err := session.Wait() exitStatus := 0 if err != nil { switch err.(type) { case *ssh.ExitError: exitStatus = err.(*ssh.ExitError).ExitStatus() log.Printf("[ERROR] Remote command exited with '%d': %s", exitStatus, cmd.Command) case *ssh.ExitMissingError: log.Printf("[ERROR] Remote command exited without exit status or exit signal.") exitStatus = packersdk.CmdDisconnect default: log.Printf("[ERROR] Error occurred waiting for ssh session: %s", err.Error()) } } cmd.SetExited(exitStatus) }() return } func (c *comm) Upload(path string, input io.Reader, fi *os.FileInfo) error { if c.config.UseSftp { return c.sftpUploadSession(path, input, fi) } else { return c.scpUploadSession(path, input, fi) } } func (c *comm) UploadDir(dst string, src string, excl []string) error { log.Printf("[DEBUG] Upload dir '%s' to '%s'", src, dst) if c.config.UseSftp { return c.sftpUploadDirSession(dst, src, excl) } else { return c.scpUploadDirSession(dst, src, excl) } } func (c *comm) DownloadDir(src string, dst string, excl []string) error { log.Printf("[DEBUG] Download dir '%s' to '%s'", src, dst) scpFunc := func(w io.Writer, stdoutR *bufio.Reader) error { dirStack := []string{dst} for { fmt.Fprint(w, "\x00") // read file info fi, err := stdoutR.ReadString('\n') if err != nil { return err } if len(fi) < 0 { return fmt.Errorf("empty response from server") } switch fi[0] { case '\x01', '\x02': return fmt.Errorf("%s", fi[1:]) case 'C', 'D': break case 'E': dirStack = dirStack[:len(dirStack)-1] if len(dirStack) == 0 { fmt.Fprint(w, "\x00") return nil } continue default: return fmt.Errorf("unexpected server response (%x)", fi[0]) } var mode int64 var size int64 var name string log.Printf("[DEBUG] Download dir str:%s", fi) n, err := fmt.Sscanf(fi[1:], "%o %d %s", &mode, &size, &name) if err != nil || n != 3 { return fmt.Errorf("can't parse server response (%s)", fi) } if size < 0 { return fmt.Errorf("negative file size") } log.Printf("[DEBUG] Download dir mode:%0o size:%d name:%s", mode, size, name) dst = filepath.Join(dirStack...) switch fi[0] { case 'D': err = os.MkdirAll(filepath.Join(dst, name), os.FileMode(mode)) if err != nil { return err } dirStack = append(dirStack, name) continue case 'C': fmt.Fprint(w, "\x00") err = scpDownloadFile(filepath.Join(dst, name), stdoutR, size, os.FileMode(mode)) if err != nil { return err } } if err := checkSCPStatus(stdoutR); err != nil { return err } } } return c.scpSession("scp -vrf "+src, scpFunc) } func (c *comm) Download(path string, output io.Writer) error { if c.config.UseSftp { return c.sftpDownloadSession(path, output) } return c.scpDownloadSession(path, output) } func (c *comm) newSession() (session *ssh.Session, err error) { log.Println("[DEBUG] Opening new ssh session") if c.client == nil { err = errors.New("client not available") } else { session, err = c.client.NewSession() } if err != nil { log.Printf("[ERROR] ssh session open error: '%s', attempting reconnect", err) if err := c.reconnect(); err != nil { return nil, err } if c.client == nil { return nil, errors.New("client not available") } else { return c.client.NewSession() } } return session, nil } func (c *comm) reconnect() (err error) { if c.conn != nil { // Ignore errors here because we don't care if it fails c.conn.Close() } // Set the conn and client to nil since we'll recreate it c.conn = nil c.client = nil log.Printf("[DEBUG] reconnecting to TCP connection for SSH") c.conn, err = c.config.Connection() if err != nil { // Explicitly set this to the REAL nil. Connection() can return // a nil implementation of net.Conn which will make the // "if c.conn == nil" check fail above. Read here for more information // on this psychotic language feature: // // http://golang.org/doc/faq#nil_error c.conn = nil log.Printf("[ERROR] reconnection error: %s", err) return } if c.config.Timeout > 0 { c.conn = &timeoutConn{c.conn, c.config.Timeout, c.config.Timeout} } log.Printf("[DEBUG] handshaking with SSH") // Default timeout to 1 minute if it wasn't specified (zero value). For // when you need to handshake from low orbit. var duration time.Duration if c.config.HandshakeTimeout == 0 { duration = 1 * time.Minute } else { duration = c.config.HandshakeTimeout } connectionEstablished := make(chan struct{}, 1) var sshConn ssh.Conn var sshChan <-chan ssh.NewChannel var req <-chan *ssh.Request go func() { sshConn, sshChan, req, err = ssh.NewClientConn(c.conn, c.address, c.config.SSHConfig) close(connectionEstablished) }() select { case <-connectionEstablished: // We don't need to do anything here. We just want select to block until // we connect or timeout. case <-time.After(duration): if c.conn != nil { c.conn.Close() } if sshConn != nil { sshConn.Close() } return ErrHandshakeTimeout } if err != nil { return } log.Printf("[DEBUG] handshake complete!") if sshConn != nil { c.client = ssh.NewClient(sshConn, sshChan, req) } c.connectToAgent() err = c.connectTunnels(sshConn) if err != nil { return } return } func (c *comm) connectTunnels(sshConn ssh.Conn) (err error) { if c.client == nil { return } if len(c.config.Tunnels) == 0 { // No Tunnels to configure return } // Start remote forwards of ports to ourselves. log.Printf("[DEBUG] Tunnel configuration: %v", c.config.Tunnels) for _, v := range c.config.Tunnels { done := make(chan struct{}) var listener net.Listener switch v.Direction { case RemoteTunnel: // This requests the sshd Host to bind a port and send traffic back to us listener, err = c.client.Listen(v.ListenType, v.ListenAddr) if err != nil { err = fmt.Errorf("Tunnel: Failed to bind remote ('%v'): %s", v, err) return } log.Printf("[INFO] Tunnel: Remote bound on %s forwarding to %s", v.ListenAddr, v.ForwardAddr) connectFunc := ConnectFunc(v.ForwardType, v.ForwardAddr) go ProxyServe(listener, done, connectFunc) // Wait for our sshConn to be shutdown // FIXME: Is there a better "on-shutdown" we can wait on? go shutdownProxyTunnel(sshConn, done, listener) case LocalTunnel: // This binds locally and sends traffic back to the sshd host listener, err = net.Listen(v.ListenType, v.ListenAddr) if err != nil { err = fmt.Errorf("Tunnel: Failed to bind local ('%v'): %s", v, err) return } log.Printf("[INFO] Tunnel: Local bound on %s forwarding to %s", v.ListenAddr, v.ForwardAddr) connectFunc := func() (net.Conn, error) { // This Dial occurs on the SSH server's side return c.client.Dial(v.ForwardType, v.ForwardAddr) } go ProxyServe(listener, done, connectFunc) // FIXME: Is there a better "on-shutdown" we can wait on? go shutdownProxyTunnel(sshConn, done, listener) default: err = fmt.Errorf("Tunnel: Unknown tunnel direction ('%v'): %v", v, v.Direction) return } } return } // shutdownProxyTunnel waits for our sshConn to be shutdown and closes the listeners func shutdownProxyTunnel(sshConn ssh.Conn, done chan struct{}, listener net.Listener) { sshConn.Wait() log.Printf("[INFO] Tunnel: Shutting down listener %v", listener) done <- struct{}{} close(done) listener.Close() } func (c *comm) connectToAgent() { if c.client == nil { return } if c.config.DisableAgentForwarding { log.Printf("[INFO] SSH agent forwarding is disabled.") return } // open connection to the local agent socketLocation := os.Getenv("SSH_AUTH_SOCK") if socketLocation == "" { log.Printf("[INFO] no local agent socket, will not connect agent") return } agentConn, err := net.Dial("unix", socketLocation) if err != nil { log.Printf("[ERROR] could not connect to local agent socket: %s", socketLocation) return } // create agent and add in auth forwardingAgent := agent.NewClient(agentConn) if forwardingAgent == nil { log.Printf("[ERROR] Could not create agent client") agentConn.Close() return } // add callback for forwarding agent to SSH config // XXX - might want to handle reconnects appending multiple callbacks auth := ssh.PublicKeysCallback(forwardingAgent.Signers) c.config.SSHConfig.Auth = append(c.config.SSHConfig.Auth, auth) agent.ForwardToAgent(c.client, forwardingAgent) // Setup a session to request agent forwarding session, err := c.newSession() if err != nil { return } defer session.Close() err = agent.RequestAgentForwarding(session) if err != nil { log.Printf("[ERROR] RequestAgentForwarding: %#v", err) return } log.Printf("[INFO] agent forwarding enabled") return } func (c *comm) sftpUploadSession(path string, input io.Reader, fi *os.FileInfo) error { sftpFunc := func(client *sftp.Client) error { return c.sftpUploadFile(path, input, client, fi) } return c.sftpSession(sftpFunc) } func (c *comm) sftpUploadFile(path string, input io.Reader, client *sftp.Client, fi *os.FileInfo) error { log.Printf("[DEBUG] sftp: uploading %s", path) f, err := client.Create(path) if err != nil { return err } defer f.Close() if _, err = io.Copy(f, input); err != nil { return err } if fi != nil && (*fi).Mode().IsRegular() { mode := (*fi).Mode().Perm() err = client.Chmod(path, mode) if err != nil { return err } } return nil } func (c *comm) sftpUploadDirSession(dst string, src string, excl []string) error { sftpFunc := func(client *sftp.Client) error { rootDst := dst if src[len(src)-1] != '/' { log.Printf("[DEBUG] No trailing slash, creating the source directory name") rootDst = filepath.Join(dst, filepath.Base(src)) } walkFunc := func(path string, info os.FileInfo, err error) error { if err != nil { return err } // Calculate the final destination using the // base source and root destination relSrc, err := filepath.Rel(src, path) if err != nil { return err } finalDst := filepath.Join(rootDst, relSrc) // In Windows, Join uses backslashes which we don't want to get // to the sftp server finalDst = filepath.ToSlash(finalDst) // Skip the creation of the target destination directory since // it should exist and we might not even own it if finalDst == dst { return nil } return c.sftpVisitFile(finalDst, path, info, client) } return filepath.Walk(src, walkFunc) } return c.sftpSession(sftpFunc) } func (c *comm) sftpMkdir(path string, client *sftp.Client, fi os.FileInfo) error { log.Printf("[DEBUG] sftp: creating dir %s", path) if err := client.Mkdir(path); err != nil { // Do not consider it an error if the directory existed remoteFi, fiErr := client.Lstat(path) if fiErr != nil || !remoteFi.IsDir() { return err } } mode := fi.Mode().Perm() if err := client.Chmod(path, mode); err != nil { return err } return nil } func (c *comm) sftpVisitFile(dst string, src string, fi os.FileInfo, client *sftp.Client) error { if !fi.IsDir() { f, err := os.Open(src) if err != nil { return err } defer f.Close() return c.sftpUploadFile(dst, f, client, &fi) } else { err := c.sftpMkdir(dst, client, fi) return err } } func (c *comm) sftpDownloadSession(path string, output io.Writer) error { sftpFunc := func(client *sftp.Client) error { f, err := client.Open(path) if err != nil { return err } defer f.Close() if _, err = io.Copy(output, f); err != nil { return err } return nil } return c.sftpSession(sftpFunc) } func (c *comm) sftpSession(f func(*sftp.Client) error) error { client, err := c.newSftpClient() if err != nil { return fmt.Errorf("sftpSession error: %s", err.Error()) } defer client.Close() return f(client) } func (c *comm) newSftpClient() (*sftp.Client, error) { session, err := c.newSession() if err != nil { return nil, err } if err := session.RequestSubsystem("sftp"); err != nil { return nil, err } pw, err := session.StdinPipe() if err != nil { return nil, err } pr, err := session.StdoutPipe() if err != nil { return nil, err } // Capture stdout so we can return errors to the user var stdout bytes.Buffer tee := io.TeeReader(pr, &stdout) client, err := sftp.NewClientPipe(tee, pw) if err != nil && stdout.Len() > 0 { log.Printf("[ERROR] Upload failed: %s", stdout.Bytes()) } return client, err } func (c *comm) scpUploadSession(path string, input io.Reader, fi *os.FileInfo) error { // The target directory and file for talking the SCP protocol target_dir := filepath.Dir(path) target_file := filepath.Base(path) // On windows, filepath.Dir uses backslash separators (ie. "\tmp"). // This does not work when the target host is unix. Switch to forward slash // which works for unix and windows target_dir = filepath.ToSlash(target_dir) // Escape spaces in remote directory target_dir = strings.Replace(target_dir, " ", "\\ ", -1) scpFunc := func(w io.Writer, stdoutR *bufio.Reader) error { return scpUploadFile(target_file, input, w, stdoutR, fi) } return c.scpSession("scp -vt "+target_dir, scpFunc) } func (c *comm) scpUploadDirSession(dst string, src string, excl []string) error { scpFunc := func(w io.Writer, r *bufio.Reader) error { uploadEntries := func() error { f, err := os.Open(src) if err != nil { return err } defer f.Close() entries, err := f.Readdir(-1) if err != nil { return err } return scpUploadDir(src, entries, w, r) } if src[len(src)-1] != '/' { log.Printf("[DEBUG] No trailing slash, creating the source directory name") fi, err := os.Stat(src) if err != nil { return err } return scpUploadDirProtocol(filepath.Base(src), w, r, uploadEntries, fi) } else { // Trailing slash, so only upload the contents return uploadEntries() } } return c.scpSession("scp -rvt "+dst, scpFunc) } func (c *comm) scpDownloadSession(path string, output io.Writer) error { scpFunc := func(w io.Writer, stdoutR *bufio.Reader) error { fmt.Fprint(w, "\x00") // read file info fi, err := stdoutR.ReadString('\n') if err != nil { return err } if len(fi) < 0 { return fmt.Errorf("empty response from server") } switch fi[0] { case '\x01', '\x02': return fmt.Errorf("%s", fi[1:]) case 'C': case 'D': return fmt.Errorf("remote file is directory") default: return fmt.Errorf("unexpected server response (%x)", fi[0]) } var mode string var size int64 n, err := fmt.Sscanf(fi, "%6s %d ", &mode, &size) if err != nil || n != 2 { return fmt.Errorf("can't parse server response (%s)", fi) } if size < 0 { return fmt.Errorf("negative file size") } fmt.Fprint(w, "\x00") if _, err := io.CopyN(output, stdoutR, size); err != nil { return err } fmt.Fprint(w, "\x00") return checkSCPStatus(stdoutR) } if !strings.Contains(path, " ") { return c.scpSession("scp -vf "+path, scpFunc) } return c.scpSession("scp -vf "+strconv.Quote(path), scpFunc) } func (c *comm) scpSession(scpCommand string, f func(io.Writer, *bufio.Reader) error) error { session, err := c.newSession() if err != nil { return err } defer session.Close() // Get a pipe to stdin so that we can send data down stdinW, err := session.StdinPipe() if err != nil { return err } // We only want to close once, so we nil w after we close it, // and only close in the defer if it hasn't been closed already. defer func() { if stdinW != nil { stdinW.Close() } }() // Get a pipe to stdout so that we can get responses back stdoutPipe, err := session.StdoutPipe() if err != nil { return err } stdoutR := bufio.NewReader(stdoutPipe) // Set stderr to a bytes buffer stderr := new(bytes.Buffer) session.Stderr = stderr // Start the sink mode on the other side // TODO(mitchellh): There are probably issues with shell escaping the path log.Println("[DEBUG] Starting remote scp process: ", scpCommand) if err := session.Start(scpCommand); err != nil { return err } // Call our callback that executes in the context of SCP. We ignore // EOF errors if they occur because it usually means that SCP prematurely // ended on the other side. log.Println("[DEBUG] Started SCP session, beginning transfers...") if err := f(stdinW, stdoutR); err != nil && err != io.EOF { return err } // Close the stdin, which sends an EOF, and then set w to nil so that // our defer func doesn't close it again since that is unsafe with // the Go SSH package. log.Println("[DEBUG] SCP session complete, closing stdin pipe.") stdinW.Close() stdinW = nil // Wait for the SCP connection to close, meaning it has consumed all // our data and has completed. Or has errored. log.Println("[DEBUG] Waiting for SSH session to complete.") err = session.Wait() log.Printf("[DEBUG] scp stderr (length %d): %s", stderr.Len(), stderr.String()) if err != nil { if exitErr, ok := err.(*ssh.ExitError); ok { // Otherwise, we have an ExitError, meaning we can just read the // exit status log.Printf("[DEBUG] non-zero exit status: %d, %v", exitErr.ExitStatus(), err) stdoutB, err := ioutil.ReadAll(stdoutR) if err != nil { return err } log.Printf("[DEBUG] scp output: %s", stdoutB) // If we exited with status 127, it means SCP isn't available. // Return a more descriptive error for that. if exitErr.ExitStatus() == 127 { return errors.New( "SCP failed to start. This usually means that SCP is not\n" + "properly installed on the remote system.") } } return err } return nil } // checkSCPStatus checks that a prior command sent to SCP completed // successfully. If it did not complete successfully, an error will // be returned. func checkSCPStatus(r *bufio.Reader) error { code, err := r.ReadByte() if err != nil { return err } if code != 0 { // Treat any non-zero (really 1 and 2) as fatal errors message, _, err := r.ReadLine() if err != nil { return fmt.Errorf("Error reading error message: %s", err) } return errors.New(string(message)) } return nil } func scpDownloadFile(dst string, src io.Reader, size int64, mode os.FileMode) error { f, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode) if err != nil { return err } defer f.Close() if _, err := io.CopyN(f, src, size); err != nil { return err } return nil } func scpUploadFile(dst string, src io.Reader, w io.Writer, r *bufio.Reader, fi *os.FileInfo) error { var mode os.FileMode var size int64 if fi != nil && (*fi).Mode().IsRegular() { mode = (*fi).Mode().Perm() size = (*fi).Size() } else { // Create a temporary file where we can copy the contents of the src // so that we can determine the length, since SCP is length-prefixed. tf, err := tmp.File("packer-upload") if err != nil { return fmt.Errorf("Error creating temporary file for upload: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() mode = 0644 log.Println("[DEBUG] Copying input data into temporary file so we can read the length") if _, err := io.Copy(tf, src); err != nil { return fmt.Errorf("Error copying input data into local temporary "+ "file. Check that TEMPDIR has enough space. Please see "+ "https://www.packer.io/docs/other/environment-variables#tmpdir"+ "for more info. Error: %s", err) } // Sync the file so that the contents are definitely on disk, then // read the length of it. if err := tf.Sync(); err != nil { return fmt.Errorf("Error creating temporary file for upload: %s", err) } // Seek the file to the beginning so we can re-read all of it if _, err := tf.Seek(0, 0); err != nil { return fmt.Errorf("Error creating temporary file for upload: %s", err) } tfi, err := tf.Stat() if err != nil { return fmt.Errorf("Error creating temporary file for upload: %s", err) } size = tfi.Size() src = tf } // Start the protocol perms := fmt.Sprintf("C%04o", mode) log.Printf("[DEBUG] scp: Uploading %s: perms=%s size=%d", dst, perms, size) fmt.Fprintln(w, perms, size, dst) if err := checkSCPStatus(r); err != nil { return err } if _, err := io.CopyN(w, src, size); err != nil { return err } fmt.Fprint(w, "\x00") return checkSCPStatus(r) } func scpUploadDirProtocol(name string, w io.Writer, r *bufio.Reader, f func() error, fi os.FileInfo) error { log.Printf("[DEBUG] SCP: starting directory upload: %s", name) mode := fi.Mode().Perm() perms := fmt.Sprintf("D%04o 0", mode) fmt.Fprintln(w, perms, name) err := checkSCPStatus(r) if err != nil { return err } if err := f(); err != nil { return err } fmt.Fprintln(w, "E") return err } func scpUploadDir(root string, fs []os.FileInfo, w io.Writer, r *bufio.Reader) error { for _, fi := range fs { realPath := filepath.Join(root, fi.Name()) // Track if this is actually a symlink to a directory. If it is // a symlink to a file we don't do any special behavior because uploading // a file just works. If it is a directory, we need to know so we // treat it as such. isSymlinkToDir := false if fi.Mode()&os.ModeSymlink == os.ModeSymlink { symPath, err := filepath.EvalSymlinks(realPath) if err != nil { return err } symFi, err := os.Lstat(symPath) if err != nil { return err } isSymlinkToDir = symFi.IsDir() } if !fi.IsDir() && !isSymlinkToDir { // It is a regular file (or symlink to a file), just upload it f, err := os.Open(realPath) if err != nil { return err } err = func() error { defer f.Close() return scpUploadFile(fi.Name(), f, w, r, &fi) }() if err != nil { return err } continue } // It is a directory, recursively upload err := scpUploadDirProtocol(fi.Name(), w, r, func() error { f, err := os.Open(realPath) if err != nil { return err } defer f.Close() entries, err := f.Readdir(-1) if err != nil { return err } return scpUploadDir(realPath, entries, w, r) }, fi) if err != nil { return err } } return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/communicator_test.go��������������0000664�0000000�0000000�00000014237�13771713062�0031153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !race package ssh import ( "bytes" "context" "fmt" "net" "testing" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "golang.org/x/crypto/ssh" ) // private key for mock server const testServerPrivateKey = `-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA19lGVsTqIT5iiNYRgnoY1CwkbETW5cq+Rzk5v/kTlf31XpSU 70HVWkbTERECjaYdXM2gGcbb+sxpq6GtXf1M3kVomycqhxwhPv4Cr6Xp4WT/jkFx 9z+FFzpeodGJWjOH6L2H5uX1Cvr9EDdQp9t9/J32/qBFntY8GwoUI/y/1MSTmMiF tupdMODN064vd3gyMKTwrlQ8tZM6aYuyOPsutLlUY7M5x5FwMDYvnPDSeyT/Iw0z s3B+NCyqeeMd2T7YzQFnRATj0M7rM5LoSs7DVqVriOEABssFyLj31PboaoLhOKgc qoM9khkNzr7FHVvi+DhYM2jD0DwvqZLN6NmnLwIDAQABAoIBAQCGVj+kuSFOV1lT +IclQYA6bM6uY5mroqcSBNegVxCNhWU03BxlW//BE9tA/+kq53vWylMeN9mpGZea riEMIh25KFGWXqXlOOioH8bkMsqA8S7sBmc7jljyv+0toQ9vCCtJ+sueNPhxQQxH D2YvUjfzBQ04I9+wn30BByDJ1QA/FoPsunxIOUCcRBE/7jxuLYcpR+JvEF68yYIh atXRld4W4in7T65YDR8jK1Uj9XAcNeDYNpT/M6oFLx1aPIlkG86aCWRO19S1jLPT b1ZAKHHxPMCVkSYW0RqvIgLXQOR62D0Zne6/2wtzJkk5UCjkSQ2z7ZzJpMkWgDgN ifCULFPBAoGBAPoMZ5q1w+zB+knXUD33n1J+niN6TZHJulpf2w5zsW+m2K6Zn62M MXndXlVAHtk6p02q9kxHdgov34Uo8VpuNjbS1+abGFTI8NZgFo+bsDxJdItemwC4 KJ7L1iz39hRN/ZylMRLz5uTYRGddCkeIHhiG2h7zohH/MaYzUacXEEy3AoGBANz8 e/msleB+iXC0cXKwds26N4hyMdAFE5qAqJXvV3S2W8JZnmU+sS7vPAWMYPlERPk1 D8Q2eXqdPIkAWBhrx4RxD7rNc5qFNcQWEhCIxC9fccluH1y5g2M+4jpMX2CT8Uv+ 3z+NoJ5uDTXZTnLCfoZzgZ4nCZVZ+6iU5U1+YXFJAoGBANLPpIV920n/nJmmquMj orI1R/QXR9Cy56cMC65agezlGOfTYxk5Cfl5Ve+/2IJCfgzwJyjWUsFx7RviEeGw 64o7JoUom1HX+5xxdHPsyZ96OoTJ5RqtKKoApnhRMamau0fWydH1yeOEJd+TRHhc XStGfhz8QNa1dVFvENczja1vAoGABGWhsd4VPVpHMc7lUvrf4kgKQtTC2PjA4xoc QJ96hf/642sVE76jl+N6tkGMzGjnVm4P2j+bOy1VvwQavKGoXqJBRd5Apppv727g /SM7hBXKFc/zH80xKBBgP/i1DR7kdjakCoeu4ngeGywvu2jTS6mQsqzkK+yWbUxJ I7mYBsECgYB/KNXlTEpXtz/kwWCHFSYA8U74l7zZbVD8ul0e56JDK+lLcJ0tJffk gqnBycHj6AhEycjda75cs+0zybZvN4x65KZHOGW/O/7OAWEcZP5TPb3zf9ned3Hl NsZoFj52ponUM6+99A2CmezFCN16c4mbA//luWF+k3VVqR6BpkrhKw== -----END RSA PRIVATE KEY-----` var serverConfig = &ssh.ServerConfig{ PasswordCallback: func(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) { if c.User() == "user" && string(pass) == "pass" { return nil, nil } return nil, fmt.Errorf("password rejected for %q", c.User()) }, } func init() { // Parse and set the private key of the server, required to accept connections signer, err := ssh.ParsePrivateKey([]byte(testServerPrivateKey)) if err != nil { panic("unable to parse private key: " + err.Error()) } serverConfig.AddHostKey(signer) } func newMockLineServer(t *testing.T) string { l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("Unable to listen for connection: %s", err) } go func() { defer l.Close() c, err := l.Accept() if err != nil { t.Errorf("Unable to accept incoming connection: %s", err) } defer c.Close() conn, chans, _, err := ssh.NewServerConn(c, serverConfig) if err != nil { t.Logf("Handshaking error: %v", err) } t.Log("Accepted SSH connection") for newChannel := range chans { channel, _, err := newChannel.Accept() if err != nil { t.Errorf("Unable to accept channel.") } t.Log("Accepted channel") go func(channelType string) { defer channel.Close() conn.OpenChannel(channelType, nil) }(newChannel.ChannelType()) } conn.Close() }() return l.Addr().String() } func newMockBrokenServer(t *testing.T) string { l, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("Unable tp listen for connection: %s", err) } go func() { defer l.Close() c, err := l.Accept() if err != nil { t.Errorf("Unable to accept incoming connection: %s", err) } defer c.Close() // This should block for a period of time longer than our timeout in // the test case. That way we invoke a failure scenario. t.Log("Block on handshaking for SSH connection") time.Sleep(5 * time.Second) }() return l.Addr().String() } func TestCommIsCommunicator(t *testing.T) { var raw interface{} raw = &comm{} if _, ok := raw.(packersdk.Communicator); !ok { t.Fatalf("comm must be a communicator") } } func TestNew_Invalid(t *testing.T) { clientConfig := &ssh.ClientConfig{ User: "user", Auth: []ssh.AuthMethod{ ssh.Password("i-am-invalid"), }, HostKeyCallback: ssh.InsecureIgnoreHostKey(), } address := newMockLineServer(t) conn := func() (net.Conn, error) { conn, err := net.Dial("tcp", address) if err != nil { t.Errorf("Unable to accept incoming connection: %v", err) } return conn, err } config := &Config{ Connection: conn, SSHConfig: clientConfig, } _, err := New(address, config) if err == nil { t.Fatal("should have had an error connecting") } } func TestStart(t *testing.T) { clientConfig := &ssh.ClientConfig{ User: "user", Auth: []ssh.AuthMethod{ ssh.Password("pass"), }, HostKeyCallback: ssh.InsecureIgnoreHostKey(), } address := newMockLineServer(t) conn := func() (net.Conn, error) { conn, err := net.Dial("tcp", address) if err != nil { t.Fatalf("unable to dial to remote side: %s", err) } return conn, err } config := &Config{ Connection: conn, SSHConfig: clientConfig, } client, err := New(address, config) if err != nil { t.Fatalf("error connecting to SSH: %s", err) } cmd := &packersdk.RemoteCmd{ Command: "echo foo", Stdout: new(bytes.Buffer), } ctx := context.Background() client.Start(ctx, cmd) } func TestHandshakeTimeout(t *testing.T) { clientConfig := &ssh.ClientConfig{ User: "user", Auth: []ssh.AuthMethod{ ssh.Password("pass"), }, HostKeyCallback: ssh.InsecureIgnoreHostKey(), } address := newMockBrokenServer(t) conn := func() (net.Conn, error) { conn, err := net.Dial("tcp", address) if err != nil { t.Fatalf("unable to dial to remote side: %s", err) } return conn, err } config := &Config{ Connection: conn, SSHConfig: clientConfig, HandshakeTimeout: 50 * time.Millisecond, } _, err := New(address, config) if err != ErrHandshakeTimeout { // Note: there's another error that can come back from this call: // ssh: handshake failed: EOF // This should appear in cases where the handshake fails because of // malformed (or no) data sent back by the server, but should not happen // in a timeout scenario. t.Fatalf("Expected handshake timeout, got: %s", err) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/connect.go������������������������0000664�0000000�0000000�00000004030�13771713062�0027033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "fmt" "net" "time" "golang.org/x/crypto/ssh" "golang.org/x/net/proxy" ) // ConnectFunc is a convenience method for returning a function // that just uses net.Dial to communicate with the remote end that // is suitable for use with the SSH communicator configuration. func ConnectFunc(network, addr string) func() (net.Conn, error) { return func() (net.Conn, error) { c, err := net.DialTimeout(network, addr, 15*time.Second) if err != nil { return nil, err } if tcpConn, ok := c.(*net.TCPConn); ok { tcpConn.SetKeepAlive(true) tcpConn.SetKeepAlivePeriod(5 * time.Second) } return c, nil } } // ProxyConnectFunc is a convenience method for returning a function // that connects to a host using SOCKS5 proxy func ProxyConnectFunc(socksProxy string, socksAuth *proxy.Auth, network, addr string) func() (net.Conn, error) { return func() (net.Conn, error) { // create a socks5 dialer dialer, err := proxy.SOCKS5("tcp", socksProxy, socksAuth, proxy.Direct) if err != nil { return nil, fmt.Errorf("Can't connect to the proxy: %s", err) } c, err := dialer.Dial(network, addr) if err != nil { return nil, err } return c, nil } } // BastionConnectFunc is a convenience method for returning a function // that connects to a host over a bastion connection. func BastionConnectFunc( bProto string, bAddr string, bConf *ssh.ClientConfig, proto string, addr string) func() (net.Conn, error) { return func() (net.Conn, error) { // Connect to the bastion bastion, err := ssh.Dial(bProto, bAddr, bConf) if err != nil { return nil, fmt.Errorf("Error connecting to bastion: %s", err) } // Connect through to the end host conn, err := bastion.Dial(proto, addr) if err != nil { bastion.Close() return nil, err } // Wrap it up so we close both things properly return &bastionConn{ Conn: conn, Bastion: bastion, }, nil } } type bastionConn struct { net.Conn Bastion *ssh.Client } func (c *bastionConn) Close() error { c.Conn.Close() return c.Bastion.Close() } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/connect_test.go�������������������0000664�0000000�0000000�00000002743�13771713062�0030103�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh_test import ( "bytes" "fmt" "log" "os" "os/user" "testing" "time" helperssh "github.com/hashicorp/packer/packer-plugin-sdk/communicator/ssh" "golang.org/x/crypto/ssh" ) func getIdentityCertFile() (certSigner ssh.Signer, err error) { usr, _ := user.Current() privateKeyFile := usr.HomeDir + "/.ssh/id_ed25519" certificateFile := usr.HomeDir + "/.ssh/id_ed25519-cert.pub" return helperssh.FileSignerWithCert(privateKeyFile, certificateFile) } func TestConnectFunc(t *testing.T) { { if os.Getenv("PACKER_ACC") == "" { t.Skip("This test is only run with PACKER_ACC=1") } const host = "mybastionhost.com:2222" certSigner, err := getIdentityCertFile() if err != nil { panic(fmt.Errorf("we have an error %v", err)) } publicKeys := ssh.PublicKeys(certSigner) usr, _ := user.Current() config := &ssh.ClientConfig{ User: usr.Username, Auth: []ssh.AuthMethod{ publicKeys, }, HostKeyCallback: ssh.InsecureIgnoreHostKey(), Timeout: 30 * time.Second, } println("Dialing", config.User) connection, err := ssh.Dial("tcp", host, config) if err != nil { log.Fatal("Failed to dial ", err) return } session, err := connection.NewSession() if err != nil { log.Fatal("Failed to create session: ", err) return } defer session.Close() var stdoutBuf bytes.Buffer session.Stdout = &stdoutBuf err = session.Run("ls") if err != nil { log.Fatal("Failed to ls") } fmt.Println(stdoutBuf.String()) } } �����������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/connection.go���������������������0000664�0000000�0000000�00000001106�13771713062�0027542�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "net" "time" ) // timeoutConn wraps a net.Conn, and sets a deadline for every read // and write operation. type timeoutConn struct { net.Conn ReadTimeout time.Duration WriteTimeout time.Duration } func (c *timeoutConn) Read(b []byte) (int, error) { err := c.Conn.SetReadDeadline(time.Now().Add(c.ReadTimeout)) if err != nil { return 0, err } return c.Conn.Read(b) } func (c *timeoutConn) Write(b []byte) (int, error) { err := c.Conn.SetWriteDeadline(time.Now().Add(c.WriteTimeout)) if err != nil { return 0, err } return c.Conn.Write(b) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/keyboard_interactive.go�����������0000664�0000000�0000000�00000001400�13771713062�0031575�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "io" "log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/terminal" ) func KeyboardInteractive(c io.ReadWriter) ssh.KeyboardInteractiveChallenge { t := terminal.NewTerminal(c, "") return func(user, instruction string, questions []string, echos []bool) ([]string, error) { if len(questions) == 0 { return []string{}, nil } log.Printf("[INFO] -- User: %s", user) log.Printf("[INFO] -- Instructions: %s", instruction) for i, question := range questions { log.Printf("[INFO] -- Question %d: %s", i+1, question) } answers := make([]string, len(questions)) for i := range questions { s, err := t.ReadPassword("") if err != nil { return nil, err } answers[i] = string(s) } return answers, nil } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/keyboard_interactive_test.go������0000664�0000000�0000000�00000003226�13771713062�0032644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "io" "log" "reflect" "testing" ) type MockTerminal struct { toSend []byte bytesPerRead int received []byte } func (c *MockTerminal) Read(data []byte) (n int, err error) { n = len(data) if n == 0 { return } if n > len(c.toSend) { n = len(c.toSend) } if n == 0 { return 0, io.EOF } if c.bytesPerRead > 0 && n > c.bytesPerRead { n = c.bytesPerRead } copy(data, c.toSend[:n]) c.toSend = c.toSend[n:] return } func (c *MockTerminal) Write(data []byte) (n int, err error) { c.received = append(c.received, data...) return len(data), nil } func TestKeyboardInteractive(t *testing.T) { type args struct { user string instruction string questions []string echos []bool } tests := []struct { name string args args want []string wantErr bool }{ { name: "questions are none", args: args{ questions: []string{}, }, want: []string{}, wantErr: false, }, { name: "input answer interactive", args: args{ questions: []string{"this is question"}, }, want: []string{"xxxx"}, wantErr: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { c := &MockTerminal{ toSend: []byte("xxxx\r\x1b[A\r"), bytesPerRead: 1, } f := KeyboardInteractive(c) got, err := f(tt.args.user, tt.args.instruction, tt.args.questions, tt.args.echos) if (err != nil) != tt.wantErr { t.Errorf("KeyboardInteractive error = %v, wantErr %v", err, tt.wantErr) return } if !reflect.DeepEqual(got, tt.want) { t.Errorf("KeyboardInteractive = %v, want %v", got, tt.want) } log.Printf("finish") }) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/password.go�����������������������0000664�0000000�0000000�00000001421�13771713062�0027245�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "log" "golang.org/x/crypto/ssh" ) // An implementation of ssh.KeyboardInteractiveChallenge that simply sends // back the password for all questions. The questions are logged. func PasswordKeyboardInteractive(password string) ssh.KeyboardInteractiveChallenge { return func(user, instruction string, questions []string, echos []bool) ([]string, error) { log.Printf("Keyboard interactive challenge: ") log.Printf("-- User: %s", user) log.Printf("-- Instructions: %s", instruction) for i, question := range questions { log.Printf("-- Question %d: %s", i+1, question) } // Just send the password back for all questions answers := make([]string, len(questions)) for i := range answers { answers[i] = password } return answers, nil } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/password_test.go������������������0000664�0000000�0000000�00000001241�13771713062�0030304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "reflect" "testing" "golang.org/x/crypto/ssh" ) func TestPasswordKeyboardInteractive_Impl(t *testing.T) { var raw interface{} raw = PasswordKeyboardInteractive("foo") if _, ok := raw.(ssh.KeyboardInteractiveChallenge); !ok { t.Fatal("PasswordKeyboardInteractive must implement KeyboardInteractiveChallenge") } } func TestPasswordKeyboardInteractive_Challenge(t *testing.T) { p := PasswordKeyboardInteractive("foo") result, err := p("foo", "bar", []string{"one", "two"}, nil) if err != nil { t.Fatalf("err not nil: %s", err) } if !reflect.DeepEqual(result, []string{"foo", "foo"}) { t.Fatalf("invalid password: %#v", result) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/ssh/tunnel.go�������������������������0000664�0000000�0000000�00000004301�13771713062�0026710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ssh import ( "io" "log" "net" ) // ProxyServe starts Accepting connections func ProxyServe(l net.Listener, done <-chan struct{}, dialer func() (net.Conn, error)) { for { // Accept will return if either the underlying connection is closed or if a connection is made. // after returning, check to see if c.done can be received. If so, then Accept() returned because // the connection has been closed. client, err := l.Accept() select { case <-done: log.Printf("[WARN] Tunnel: received Done event: %v", err) return default: if err != nil { log.Printf("[ERROR] Tunnel: listen.Accept failed: %v", err) continue } log.Printf("[DEBUG] Tunnel: client '%s' accepted", client.RemoteAddr()) // Proxy bytes from one side to the other go handleProxyClient(client, dialer) } } } // handleProxyClient will open a connection using the dialer, and ensure close events propagate to the brokers func handleProxyClient(clientConn net.Conn, dialer func() (net.Conn, error)) { //We have a client connected, open an upstream connection to the destination upstreamConn, err := dialer() if err != nil { log.Printf("[ERROR] Tunnel: failed to open connection to upstream: %v", err) clientConn.Close() return } // channels to wait on the close event for each connection serverClosed := make(chan struct{}, 1) upstreamClosed := make(chan struct{}, 1) go brokerData(clientConn, upstreamConn, upstreamClosed) go brokerData(upstreamConn, clientConn, serverClosed) // Now we wait for the connections to close and notify the other side of the event select { case <-upstreamClosed: clientConn.Close() <-serverClosed case <-serverClosed: upstreamConn.Close() <-upstreamClosed } log.Printf("[DEBUG] Tunnel: client ('%s') proxy closed", clientConn.RemoteAddr()) } // brokerData is responsible for copying data src => dest. It will also close the src when there are no more bytes to transfer func brokerData(src net.Conn, dest net.Conn, srcClosed chan struct{}) { _, err := io.Copy(src, dest) if err != nil { log.Printf("[ERROR] Tunnel: Copy error: %s", err) } if err := src.Close(); err != nil { log.Printf("[ERROR] Tunnel: Close error: %s", err) } srcClosed <- struct{}{} } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/winrm/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025415�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/winrm/communicator.go�����������������0000664�0000000�0000000�00000014510�13771713062�0030445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package winrm import ( "context" "encoding/base64" "fmt" "io" "io/ioutil" "log" "os" "path/filepath" "strings" "sync" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/masterzen/winrm" "github.com/packer-community/winrmcp/winrmcp" ) // Communicator represents the WinRM communicator type Communicator struct { config *Config client *winrm.Client endpoint *winrm.Endpoint } // New creates a new communicator implementation over WinRM. func New(config *Config) (*Communicator, error) { endpoint := &winrm.Endpoint{ Host: config.Host, Port: config.Port, HTTPS: config.Https, Insecure: config.Insecure, /* TODO HTTPS: connInfo.HTTPS, Insecure: connInfo.Insecure, CACert: connInfo.CACert, */ } // Create the client params := *winrm.DefaultParameters if config.TransportDecorator != nil { params.TransportDecorator = config.TransportDecorator } params.Timeout = formatDuration(config.Timeout) client, err := winrm.NewClientWithParameters( endpoint, config.Username, config.Password, &params) if err != nil { return nil, err } // Create the shell to verify the connection log.Printf("[DEBUG] connecting to remote shell using WinRM") shell, err := client.CreateShell() if err != nil { log.Printf("[ERROR] connection error: %s", err) return nil, err } if err := shell.Close(); err != nil { log.Printf("[ERROR] error closing connection: %s", err) return nil, err } return &Communicator{ config: config, client: client, endpoint: endpoint, }, nil } // Start implementation of communicator.Communicator interface func (c *Communicator) Start(ctx context.Context, rc *packersdk.RemoteCmd) error { shell, err := c.client.CreateShell() if err != nil { return err } log.Printf("[INFO] starting remote command: %s", rc.Command) cmd, err := shell.Execute(rc.Command) if err != nil { return err } go runCommand(shell, cmd, rc) return nil } func runCommand(shell *winrm.Shell, cmd *winrm.Command, rc *packersdk.RemoteCmd) { defer shell.Close() var wg sync.WaitGroup copyFunc := func(w io.Writer, r io.Reader) { defer wg.Done() io.Copy(w, r) } if rc.Stdout != nil && cmd.Stdout != nil { wg.Add(1) go copyFunc(rc.Stdout, cmd.Stdout) } else { log.Printf("[WARN] Failed to read stdout for command '%s'", rc.Command) } if rc.Stderr != nil && cmd.Stderr != nil { wg.Add(1) go copyFunc(rc.Stderr, cmd.Stderr) } else { log.Printf("[WARN] Failed to read stderr for command '%s'", rc.Command) } cmd.Wait() wg.Wait() code := cmd.ExitCode() log.Printf("[INFO] command '%s' exited with code: %d", rc.Command, code) rc.SetExited(code) } // Upload implementation of communicator.Communicator interface func (c *Communicator) Upload(path string, input io.Reader, fi *os.FileInfo) error { wcp, err := c.newCopyClient() if err != nil { return fmt.Errorf("Was unable to create winrm client: %s", err) } if strings.HasSuffix(path, `\`) { // path is a directory if fi != nil { path += filepath.Base((*fi).Name()) } else { return fmt.Errorf("Was unable to infer file basename for upload.") } } log.Printf("Uploading file to '%s'", path) return wcp.Write(path, input) } // UploadDir implementation of communicator.Communicator interface func (c *Communicator) UploadDir(dst string, src string, exclude []string) error { if !strings.HasSuffix(src, "/") { dst = fmt.Sprintf("%s\\%s", dst, filepath.Base(src)) } log.Printf("Uploading dir '%s' to '%s'", src, dst) wcp, err := c.newCopyClient() if err != nil { return err } return wcp.Copy(src, dst) } func (c *Communicator) Download(src string, dst io.Writer) error { client, err := c.newWinRMClient() if err != nil { return err } encodeScript := `$file=[System.IO.File]::ReadAllBytes("%s"); Write-Output $([System.Convert]::ToBase64String($file))` base64DecodePipe := &Base64Pipe{w: dst} cmd := winrm.Powershell(fmt.Sprintf(encodeScript, src)) _, err = client.Run(cmd, base64DecodePipe, ioutil.Discard) return err } func (c *Communicator) DownloadDir(src string, dst string, exclude []string) error { return fmt.Errorf("WinRM doesn't support download dir.") } func (c *Communicator) getClientConfig() *winrmcp.Config { return &winrmcp.Config{ Auth: winrmcp.Auth{ User: c.config.Username, Password: c.config.Password, }, Https: c.config.Https, Insecure: c.config.Insecure, OperationTimeout: c.config.Timeout, MaxOperationsPerShell: 15, // lowest common denominator TransportDecorator: c.config.TransportDecorator, } } func (c *Communicator) newCopyClient() (*winrmcp.Winrmcp, error) { addr := fmt.Sprintf("%s:%d", c.endpoint.Host, c.endpoint.Port) clientConfig := c.getClientConfig() return winrmcp.New(addr, clientConfig) } func (c *Communicator) newWinRMClient() (*winrm.Client, error) { conf := c.getClientConfig() // Shamelessly borrowed from the winrmcp client to ensure // that the client is configured using the same defaulting behaviors that // winrmcp uses even we we aren't using winrmcp. This ensures similar // behavior between upload, download, and copy functions. We can't use the // one generated by winrmcp because it isn't exported. var endpoint *winrm.Endpoint endpoint = &winrm.Endpoint{ Host: c.endpoint.Host, Port: c.endpoint.Port, HTTPS: conf.Https, Insecure: conf.Insecure, TLSServerName: conf.TLSServerName, CACert: conf.CACertBytes, Timeout: conf.ConnectTimeout, } params := winrm.NewParameters( winrm.DefaultParameters.Timeout, winrm.DefaultParameters.Locale, winrm.DefaultParameters.EnvelopeSize, ) params.TransportDecorator = conf.TransportDecorator params.Timeout = "PT3M" client, err := winrm.NewClientWithParameters( endpoint, conf.Auth.User, conf.Auth.Password, params) return client, err } type Base64Pipe struct { w io.Writer // underlying writer (file, buffer) } func (d *Base64Pipe) ReadFrom(r io.Reader) (int64, error) { b, err := ioutil.ReadAll(r) if err != nil { return 0, err } var i int i, err = d.Write(b) if err != nil { return 0, err } return int64(i), err } func (d *Base64Pipe) Write(p []byte) (int, error) { dst := make([]byte, base64.StdEncoding.DecodedLen(len(p))) decodedBytes, err := base64.StdEncoding.Decode(dst, p) if err != nil { return 0, err } return d.w.Write(dst[0:decodedBytes]) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/winrm/communicator_test.go������������0000664�0000000�0000000�00000006126�13771713062�0031510�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package winrm import ( "bytes" "context" "io" "strings" "testing" "time" "github.com/dylanmei/winrmtest" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) const PAYLOAD = "stuff" const BASE64_ENCODED_PAYLOAD = "c3R1ZmY=" func newMockWinRMServer(t *testing.T) *winrmtest.Remote { wrm := winrmtest.NewRemote() wrm.CommandFunc( winrmtest.MatchText("echo foo"), func(out, err io.Writer) int { out.Write([]byte("foo")) return 0 }) wrm.CommandFunc( winrmtest.MatchPattern(`^echo c29tZXRoaW5n >> ".*"$`), func(out, err io.Writer) int { return 0 }) wrm.CommandFunc( winrmtest.MatchPattern(`^echo `+BASE64_ENCODED_PAYLOAD+` >> ".*"$`), func(out, err io.Writer) int { return 0 }) wrm.CommandFunc( winrmtest.MatchPattern(`^powershell.exe -EncodedCommand .*$`), func(out, err io.Writer) int { out.Write([]byte(BASE64_ENCODED_PAYLOAD)) return 0 }) wrm.CommandFunc( winrmtest.MatchText("powershell"), func(out, err io.Writer) int { return 0 }) wrm.CommandFunc( winrmtest.MatchText(`powershell -Command "(Get-Item C:/Temp/packer.cmd) -is [System.IO.DirectoryInfo]"`), func(out, err io.Writer) int { out.Write([]byte("False")) return 0 }) return wrm } func TestStart(t *testing.T) { wrm := newMockWinRMServer(t) defer wrm.Close() c, err := New(&Config{ Host: wrm.Host, Port: wrm.Port, Username: "user", Password: "pass", Timeout: 30 * time.Second, }) if err != nil { t.Fatalf("error creating communicator: %s", err) } var cmd packersdk.RemoteCmd stdout := new(bytes.Buffer) cmd.Command = "echo foo" cmd.Stdout = stdout ctx := context.Background() err = c.Start(ctx, &cmd) if err != nil { t.Fatalf("error executing remote command: %s", err) } cmd.Wait() if stdout.String() != "foo" { t.Fatalf("bad command response: expected %q, got %q", "foo", stdout.String()) } } func TestUpload(t *testing.T) { wrm := newMockWinRMServer(t) defer wrm.Close() c, err := New(&Config{ Host: wrm.Host, Port: wrm.Port, Username: "user", Password: "pass", Timeout: 30 * time.Second, }) if err != nil { t.Fatalf("error creating communicator: %s", err) } file := "C:/Temp/packer.cmd" err = c.Upload(file, strings.NewReader(PAYLOAD), nil) if err != nil { t.Fatalf("error uploading file: %s", err) } dest := new(bytes.Buffer) err = c.Download(file, dest) if err != nil { t.Fatalf("error downloading file: %s", err) } downloadedPayload := dest.String() if downloadedPayload != PAYLOAD { t.Fatalf("files are not equal: expected [%s] length: %v, got [%s] length %v", PAYLOAD, len(PAYLOAD), downloadedPayload, len(downloadedPayload)) } } func TestUpload_nilFileInfo(t *testing.T) { wrm := newMockWinRMServer(t) defer wrm.Close() c, err := New(&Config{ Host: wrm.Host, Port: wrm.Port, Username: "user", Password: "pass", Timeout: 30 * time.Second, }) if err != nil { t.Fatalf("error creating communicator: %s", err) } file := "C:\\Temp\\" err = c.Upload(file, strings.NewReader(PAYLOAD), nil) if err == nil { t.Fatalf("Should have errored because of nil fileinfo") } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/winrm/config.go�����������������������0000664�0000000�0000000�00000000567�13771713062�0027221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package winrm import ( "time" "github.com/masterzen/winrm" ) // Config is used to configure the WinRM connection type Config struct { Host string Port int Username string Password string Timeout time.Duration Https bool Insecure bool TransportDecorator func() winrm.Transporter } �����������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/winrm/time.go�������������������������0000664�0000000�0000000�00000001101�13771713062�0026673�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package winrm import ( "fmt" "time" ) // formatDuration formats the given time.Duration into an ISO8601 // duration string. func formatDuration(duration time.Duration) string { // We're not supporting negative durations if duration.Seconds() <= 0 { return "PT0S" } h := int(duration.Hours()) m := int(duration.Minutes()) - (h * 60) s := int(duration.Seconds()) - (h*3600 + m*60) res := "PT" if h > 0 { res = fmt.Sprintf("%s%dH", res, h) } if m > 0 { res = fmt.Sprintf("%s%dM", res, m) } if s > 0 { res = fmt.Sprintf("%s%dS", res, s) } return res } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/sdk-internals/communicator/winrm/time_test.go��������������������0000664�0000000�0000000�00000001441�13771713062�0027741�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package winrm import ( "testing" "time" ) func TestFormatDuration(t *testing.T) { // Test complex duration with hours, minutes, seconds d := time.Duration(3701) * time.Second s := formatDuration(d) if s != "PT1H1M41S" { t.Fatalf("bad ISO 8601 duration string: %s", s) } // Test only minutes duration d = time.Duration(20) * time.Minute s = formatDuration(d) if s != "PT20M" { t.Fatalf("bad ISO 8601 duration string for 20M: %s", s) } // Test only seconds d = time.Duration(1) * time.Second s = formatDuration(d) if s != "PT1S" { t.Fatalf("bad ISO 8601 duration string for 1S: %s", s) } // Test negative duration (unsupported) d = time.Duration(-1) * time.Second s = formatDuration(d) if s != "PT0S" { t.Fatalf("bad ISO 8601 duration string for negative: %s", s) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021202�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/communicator.go��������������������������������������0000664�0000000�0000000�00000003471�13771713062�0024236�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_local import ( "context" "fmt" "io" "log" "os" "os/exec" "syscall" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type Communicator struct { ExecuteCommand []string } func (c *Communicator) Start(ctx context.Context, cmd *packersdk.RemoteCmd) error { if len(c.ExecuteCommand) == 0 { return fmt.Errorf("Error launching command via shell-local communicator: No ExecuteCommand provided") } // Build the local command to execute log.Printf("[INFO] (shell-local communicator): Executing local shell command %s", c.ExecuteCommand) localCmd := exec.CommandContext(ctx, c.ExecuteCommand[0], c.ExecuteCommand[1:]...) localCmd.Stdin = cmd.Stdin localCmd.Stdout = cmd.Stdout localCmd.Stderr = cmd.Stderr // Start it. If it doesn't work, then error right away. if err := localCmd.Start(); err != nil { return err } // We've started successfully. Start a goroutine to wait for // it to complete and track exit status. go func() { var exitStatus int err := localCmd.Wait() if err != nil { if exitErr, ok := err.(*exec.ExitError); ok { exitStatus = 1 // There is no process-independent way to get the REAL // exit status so we just try to go deeper. if status, ok := exitErr.Sys().(syscall.WaitStatus); ok { exitStatus = status.ExitStatus() } } } cmd.SetExited(exitStatus) }() return nil } func (c *Communicator) Upload(string, io.Reader, *os.FileInfo) error { return fmt.Errorf("upload not supported") } func (c *Communicator) UploadDir(string, string, []string) error { return fmt.Errorf("uploadDir not supported") } func (c *Communicator) Download(string, io.Writer) error { return fmt.Errorf("download not supported") } func (c *Communicator) DownloadDir(string, string, []string) error { return fmt.Errorf("downloadDir not supported") } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/communicator_test.go���������������������������������0000664�0000000�0000000�00000001472�13771713062�0025274�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_local import ( "bytes" "context" "runtime" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestCommunicator_impl(t *testing.T) { var _ packersdk.Communicator = new(Communicator) } func TestCommunicator(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("windows not supported for this test") return } c := &Communicator{ ExecuteCommand: []string{"/bin/sh", "-c", "echo foo"}, } var buf bytes.Buffer cmd := &packersdk.RemoteCmd{ Stdout: &buf, } ctx := context.Background() if err := c.Start(ctx, cmd); err != nil { t.Fatalf("err: %s", err) } cmd.Wait() if cmd.ExitStatus() != 0 { t.Fatalf("err bad exit status: %d", cmd.ExitStatus()) } if strings.TrimSpace(buf.String()) != "foo" { t.Fatalf("bad: %s", buf.String()) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/config.go��������������������������������������������0000664�0000000�0000000�00000015320�13771713062�0022777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package shell_local import ( "errors" "fmt" "os" "path/filepath" "runtime" "strings" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/shell" configHelper "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { shell.Provisioner `mapstructure:",squash"` // ** DEPRECATED: USE INLINE INSTEAD ** // ** Only Present for backwards compatibility ** // Command is the command to execute Command string // The command used to execute the script. The '{{ .Path }}' variable // should be used to specify where the script goes, {{ .Vars }} // can be used to inject the environment_vars into the environment. ExecuteCommand []string `mapstructure:"execute_command"` // The shebang value used when running inline scripts. InlineShebang string `mapstructure:"inline_shebang"` // An array of multiple Runtime OSs to run on. OnlyOn []string `mapstructure:"only_on"` // The file extension to use for the file generated from the inline commands TempfileExtension string `mapstructure:"tempfile_extension"` // End dedupe with postprocessor UseLinuxPathing bool `mapstructure:"use_linux_pathing"` // used to track the data sent to shell-local from the builder // GeneratedData ctx interpolate.Context generatedData map[string]interface{} } func Decode(config *Config, raws ...interface{}) error { err := configHelper.Decode(config, &configHelper.DecodeOpts{ Interpolate: true, InterpolateContext: &config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", }, }, }, raws...) if err != nil { return fmt.Errorf("Error decoding config: %s", err) // return fmt.Errorf("Error decoding config: %s, config is %#v, and raws is %#v", err, config, raws) } return nil } func Validate(config *Config) error { var errs *packersdk.MultiError if runtime.GOOS == "windows" { if len(config.ExecuteCommand) == 0 { config.ExecuteCommand = []string{ "cmd", "/V", "/C", "{{.Vars}}", "call", "{{.Script}}", } } if len(config.TempfileExtension) == 0 { config.TempfileExtension = ".cmd" } } else { if config.InlineShebang == "" { config.InlineShebang = "/bin/sh -e" } if len(config.ExecuteCommand) == 0 { config.ExecuteCommand = []string{ "/bin/sh", "-c", "{{.Vars}} {{.Script}}", } } } // Clean up input if config.Inline != nil && len(config.Inline) == 0 { config.Inline = make([]string, 0) } if config.Scripts == nil { config.Scripts = make([]string, 0) } if config.Vars == nil { config.Vars = make([]string, 0) } // Verify that the user has given us a command to run if config.Command == "" && len(config.Inline) == 0 && len(config.Scripts) == 0 && config.Script == "" { errs = packersdk.MultiErrorAppend(errs, errors.New("Command, Inline, Script and Scripts options cannot all be empty.")) } // Check that user hasn't given us too many commands to run tooManyOptionsErr := errors.New("You may only specify one of the " + "following options: Command, Inline, Script or Scripts. Please" + " consolidate these options in your config.") if config.Command != "" { if len(config.Inline) != 0 || len(config.Scripts) != 0 || config.Script != "" { errs = packersdk.MultiErrorAppend(errs, tooManyOptionsErr) } else { config.Inline = []string{config.Command} } } if config.Script != "" { if len(config.Scripts) > 0 || len(config.Inline) > 0 { errs = packersdk.MultiErrorAppend(errs, tooManyOptionsErr) } else { config.Scripts = []string{config.Script} } } if len(config.Scripts) > 0 && config.Inline != nil { errs = packersdk.MultiErrorAppend(errs, tooManyOptionsErr) } // Check that all scripts we need to run exist locally for _, path := range config.Scripts { if _, err := os.Stat(path); err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Bad script '%s': %s", path, err)) } } // Check for properly formatted go os types supportedSyslist := []string{"darwin", "freebsd", "linux", "openbsd", "solaris", "windows"} if len(config.OnlyOn) > 0 { for _, provided_os := range config.OnlyOn { supported_os := false for _, go_os := range supportedSyslist { if provided_os == go_os { supported_os = true break } } if supported_os != true { return fmt.Errorf("Invalid OS specified in only_on: '%s'\n"+ "Supported OS names: %s", provided_os, strings.Join(supportedSyslist, ", ")) } } } if config.UseLinuxPathing { for index, script := range config.Scripts { scriptAbsPath, err := filepath.Abs(script) if err != nil { return fmt.Errorf("Error converting %s to absolute path: %s", script, err.Error()) } converted, err := ConvertToLinuxPath(scriptAbsPath) if err != nil { return err } config.Scripts[index] = converted } // Interoperability issues with WSL makes creating and running tempfiles // via golang's os package basically impossible. if len(config.Inline) > 0 { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Packer is unable to use the Command and Inline "+ "features with the Windows Linux Subsystem. Please use "+ "the Script or Scripts options instead")) } } if config.EnvVarFormat == "" { if (runtime.GOOS == "windows") && !config.UseLinuxPathing { config.EnvVarFormat = "set %s=%s && " } else { config.EnvVarFormat = "%s='%s' " } } // drop unnecessary "." in extension; we add this later. if config.TempfileExtension != "" { if strings.HasPrefix(config.TempfileExtension, ".") { config.TempfileExtension = config.TempfileExtension[1:] } } // Do a check for bad environment variables, such as '=foo', 'foobar' for _, kv := range config.Vars { vs := strings.SplitN(kv, "=", 2) if len(vs) != 2 || vs[0] == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Environment variable not in format 'key=value': %s", kv)) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } // C:/path/to/your/file becomes /mnt/c/path/to/your/file func ConvertToLinuxPath(winAbsPath string) (string, error) { // get absolute path of script, and morph it into the bash path winAbsPath = strings.Replace(winAbsPath, "\\", "/", -1) splitPath := strings.SplitN(winAbsPath, ":/", 2) if len(splitPath) == 2 { winBashPath := fmt.Sprintf("/mnt/%s/%s", strings.ToLower(splitPath[0]), splitPath[1]) return winBashPath, nil } else { err := fmt.Errorf("There was an error splitting your absolute path; expected "+ "to find a drive following the format ':/' but did not: absolute "+ "path: %s", winAbsPath) return "", err } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/config.hcl2spec.go�����������������������������������0000664�0000000�0000000�00000012357�13771713062�0024510�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package shell_local import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Inline []string `cty:"inline" hcl:"inline"` Script *string `cty:"script" hcl:"script"` Scripts []string `cty:"scripts" hcl:"scripts"` ValidExitCodes []int `mapstructure:"valid_exit_codes" cty:"valid_exit_codes" hcl:"valid_exit_codes"` Vars []string `mapstructure:"environment_vars" cty:"environment_vars" hcl:"environment_vars"` EnvVarFormat *string `mapstructure:"env_var_format" cty:"env_var_format" hcl:"env_var_format"` Command *string `cty:"command" hcl:"command"` ExecuteCommand []string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` InlineShebang *string `mapstructure:"inline_shebang" cty:"inline_shebang" hcl:"inline_shebang"` OnlyOn []string `mapstructure:"only_on" cty:"only_on" hcl:"only_on"` TempfileExtension *string `mapstructure:"tempfile_extension" cty:"tempfile_extension" hcl:"tempfile_extension"` UseLinuxPathing *bool `mapstructure:"use_linux_pathing" cty:"use_linux_pathing" hcl:"use_linux_pathing"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "inline": &hcldec.AttrSpec{Name: "inline", Type: cty.List(cty.String), Required: false}, "script": &hcldec.AttrSpec{Name: "script", Type: cty.String, Required: false}, "scripts": &hcldec.AttrSpec{Name: "scripts", Type: cty.List(cty.String), Required: false}, "valid_exit_codes": &hcldec.AttrSpec{Name: "valid_exit_codes", Type: cty.List(cty.Number), Required: false}, "environment_vars": &hcldec.AttrSpec{Name: "environment_vars", Type: cty.List(cty.String), Required: false}, "env_var_format": &hcldec.AttrSpec{Name: "env_var_format", Type: cty.String, Required: false}, "command": &hcldec.AttrSpec{Name: "command", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.List(cty.String), Required: false}, "inline_shebang": &hcldec.AttrSpec{Name: "inline_shebang", Type: cty.String, Required: false}, "only_on": &hcldec.AttrSpec{Name: "only_on", Type: cty.List(cty.String), Required: false}, "tempfile_extension": &hcldec.AttrSpec{Name: "tempfile_extension", Type: cty.String, Required: false}, "use_linux_pathing": &hcldec.AttrSpec{Name: "use_linux_pathing", Type: cty.Bool, Required: false}, } return s } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/config_test.go���������������������������������������0000664�0000000�0000000�00000000565�13771713062�0024043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_local import ( "testing" "github.com/stretchr/testify/assert" ) func TestConvertToLinuxPath(t *testing.T) { winPath := "C:/path/to/your/file" winBashPath := "/mnt/c/path/to/your/file" converted, _ := ConvertToLinuxPath(winPath) assert.Equal(t, winBashPath, converted, "Should have converted %s to %s -- not %s", winPath, winBashPath, converted) } �������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/doc.go�����������������������������������������������0000664�0000000�0000000�00000001145�13771713062�0022277�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package shell-local is designed to make it easier to shell out locally on the machine running Packer. The top level tools in this package are probably not relevant to plugin maintainers, as they are implementation details shared between the HashiCorp-maintained shell-local provisioner and shell-local post-processor. The localexec sub-package can be used in any plugins that need local shell access, whether that is in a driver for a hypervisor, or a command to a third party cli tool. Please make sure that any third party tool dependencies are noted in your plugin's documentation. */ package shell_local ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/localexec/�������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023141�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/localexec/run_and_stream.go��������������������������0000664�0000000�0000000�00000005305�13771713062�0026474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package localexec import ( "fmt" "io" "log" "os/exec" "regexp" "strings" "sync" "syscall" "github.com/hashicorp/packer/packer-plugin-sdk/iochan" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // RunAndStream allows you to run a local command and stream output to the UI. // This does not require use of a shell-local communicator, so is a nice tool // for plugins that need to shell out to a local dependency and provide clear // output to users. func RunAndStream(cmd *exec.Cmd, ui packersdk.Ui, sensitive []string) error { stdout_r, stdout_w := io.Pipe() stderr_r, stderr_w := io.Pipe() defer stdout_w.Close() defer stderr_w.Close() // Scrub any sensitive values from being printed to Packer ui. packersdk.LogSecretFilter.Set(sensitive...) args := make([]string, len(cmd.Args)-1) copy(args, cmd.Args[1:]) log.Printf("Executing: %s %v", cmd.Path, args) cmd.Stdout = stdout_w cmd.Stderr = stderr_w if err := cmd.Start(); err != nil { return err } // Create the channels we'll use for data exitCh := make(chan int, 1) stdoutCh := iochan.LineReader(stdout_r) stderrCh := iochan.LineReader(stderr_r) // Start the goroutine to watch for the exit go func() { defer stdout_w.Close() defer stderr_w.Close() exitStatus := 0 err := cmd.Wait() if exitErr, ok := err.(*exec.ExitError); ok { exitStatus = 1 // There is no process-independent way to get the REAL // exit status so we just try to go deeper. if status, ok := exitErr.Sys().(syscall.WaitStatus); ok { exitStatus = status.ExitStatus() } } exitCh <- exitStatus }() // This waitgroup waits for the streaming to end var streamWg sync.WaitGroup streamWg.Add(2) streamFunc := func(ch <-chan string) { defer streamWg.Done() for data := range ch { data = cleanOutputLine(data) if data != "" { ui.Message(data) } } } // Stream stderr/stdout go streamFunc(stderrCh) go streamFunc(stdoutCh) // Wait for the process to end and then wait for the streaming to end exitStatus := <-exitCh streamWg.Wait() if exitStatus != 0 { return fmt.Errorf("Bad exit status: %d", exitStatus) } return nil } // cleanOutputLine cleans up a line so that '\r' don't muck up the // UI output when we're reading from a remote command. func cleanOutputLine(line string) string { // Build a regular expression that will get rid of shell codes re := regexp.MustCompile("(?i)\x1b\\[([0-9]{1,2}(;[0-9]{1,2})?)?[a|b|m|k]") line = re.ReplaceAllString(line, "") // Trim surrounding whitespace line = strings.TrimSpace(line) // Trim up to the first carriage return, since that text would be // lost anyways. idx := strings.LastIndex(line, "\r") if idx > -1 { line = line[idx+1:] } return line } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/localexec/run_and_stream_test.go���������������������0000664�0000000�0000000�00000001132�13771713062�0027525�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package localexec import ( "testing" ) func TestCleanLine(t *testing.T) { cases := []struct { input string output string }{ { "\x1b[0A\x1b[2K\r8dbd9e392a96: Pulling image (precise) from ubuntu\r\x1b[0B\x1b[1A\x1b[2K\r8dbd9e392a96: Pulling image (precise) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/\r\x1b[1B", "8dbd9e392a96: Pulling image (precise) from ubuntu, endpoint: https://cdn-registry-1.docker.io/v1/", }, } for _, tc := range cases { actual := cleanOutputLine(tc.input) if actual != tc.output { t.Fatalf("bad: %#v %#v", tc.input, actual) } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell-local/run.go�����������������������������������������������0000664�0000000�0000000�00000015344�13771713062�0022344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_local import ( "bufio" "context" "fmt" "log" "os" "path/filepath" "runtime" "sort" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) func Run(ctx context.Context, ui packersdk.Ui, config *Config, generatedData map[string]interface{}) (bool, error) { if generatedData != nil { config.generatedData = generatedData } else { // No fear; probably just in the post-processor, not provisioner. // Make sure it's not a nil map so we can assign to it later. config.generatedData = make(map[string]interface{}) } config.ctx.Data = generatedData // Check if shell-local can even execute against this runtime OS if len(config.OnlyOn) > 0 { runCommand := false for _, os := range config.OnlyOn { if os == runtime.GOOS { runCommand = true break } } if !runCommand { ui.Say(fmt.Sprintf("Skipping shell-local due to runtime OS")) log.Printf("[INFO] (shell-local): skipping shell-local due to missing runtime OS") return true, nil } } scripts := make([]string, len(config.Scripts)) if len(config.Scripts) > 0 { copy(scripts, config.Scripts) } else if config.Inline != nil { // If we have an inline script, then turn that into a temporary // shell script and use that. tempScriptFileName, err := createInlineScriptFile(config) if err != nil { return false, err } // figure out what extension the file should have, and rename it. if config.TempfileExtension != "" { os.Rename(tempScriptFileName, fmt.Sprintf("%s.%s", tempScriptFileName, config.TempfileExtension)) tempScriptFileName = fmt.Sprintf("%s.%s", tempScriptFileName, config.TempfileExtension) } scripts = append(scripts, tempScriptFileName) defer os.Remove(tempScriptFileName) } // Create environment variables to set before executing the command flattenedEnvVars, err := createFlattenedEnvVars(config) if err != nil { return false, err } for _, script := range scripts { // use absolute path in case the script is linked with forward slashes // on windows. absScript, err := filepath.Abs(script) if err != nil { return false, fmt.Errorf( "Error executing script: %s\n%v\n", absScript, err, ) } interpolatedCmds, err := createInterpolatedCommands(config, absScript, flattenedEnvVars) if err != nil { return false, err } ui.Say(fmt.Sprintf("Running local shell script: %s", script)) comm := &Communicator{ ExecuteCommand: interpolatedCmds, } // The remoteCmd generated here isn't actually run, but it allows us to // use the same interafce for the shell-local communicator as we use for // the other communicators; ultimately, this command is just used for // buffers and for reading the final exit status. flattenedCmd := strings.Join(interpolatedCmds, " ") cmd := &packersdk.RemoteCmd{Command: flattenedCmd} log.Printf("[INFO] (shell-local): starting local command: %s", flattenedCmd) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return false, fmt.Errorf( "Error executing script: %s\n\n"+ "Please see output above for more information.", absScript) } if err := config.ValidExitCode(cmd.ExitStatus()); err != nil { return false, err } } return true, nil } func createInlineScriptFile(config *Config) (string, error) { tf, err := tmp.File("packer-shell") if err != nil { return "", fmt.Errorf("Error preparing shell script: %s", err) } defer tf.Close() // Write our contents to it writer := bufio.NewWriter(tf) if config.InlineShebang != "" { shebang := fmt.Sprintf("#!%s\n", config.InlineShebang) log.Printf("[INFO] (shell-local): Prepending inline script with %s", shebang) writer.WriteString(shebang) } for _, command := range config.Inline { // interpolate command to check for template variables. command, err := interpolate.Render(command, &config.ctx) if err != nil { return "", err } if _, err := writer.WriteString(command + "\n"); err != nil { return "", fmt.Errorf("Error preparing shell script: %s", err) } } if err := writer.Flush(); err != nil { return "", fmt.Errorf("Error preparing shell script: %s", err) } err = os.Chmod(tf.Name(), 0700) if err != nil { log.Printf("[ERROR] (shell-local): error modifying permissions of temp script file: %s", err.Error()) } return tf.Name(), nil } // Generates the final command to send to the communicator, using either the // user-provided ExecuteCommand or defaulting to something that makes sense for // the host OS func createInterpolatedCommands(config *Config, script string, flattenedEnvVars string) ([]string, error) { config.generatedData["Vars"] = flattenedEnvVars config.generatedData["Script"] = script config.generatedData["Command"] = script config.ctx.Data = config.generatedData interpolatedCmds := make([]string, len(config.ExecuteCommand)) for i, cmd := range config.ExecuteCommand { interpolatedCmd, err := interpolate.Render(cmd, &config.ctx) if err != nil { return nil, fmt.Errorf("Error processing command: %s", err) } interpolatedCmds[i] = interpolatedCmd } return interpolatedCmds, nil } func createFlattenedEnvVars(config *Config) (string, error) { flattened := "" envVars := make(map[string]string) // Always available Packer provided env vars envVars["PACKER_BUILD_NAME"] = config.PackerBuildName envVars["PACKER_BUILDER_TYPE"] = config.PackerBuilderType // expose ip address variables httpAddr := config.generatedData["PackerHTTPAddr"] if httpAddr != nil && httpAddr != commonsteps.HttpAddrNotImplemented { envVars["PACKER_HTTP_ADDR"] = httpAddr.(string) } httpIP := config.generatedData["PackerHTTPIP"] if httpIP != nil && httpIP != commonsteps.HttpIPNotImplemented { envVars["PACKER_HTTP_IP"] = httpIP.(string) } httpPort := config.generatedData["PackerHTTPPort"] if httpPort != nil && httpPort != commonsteps.HttpPortNotImplemented { envVars["PACKER_HTTP_PORT"] = httpPort.(string) } // Split vars into key/value components for _, envVar := range config.Vars { envVar, err := interpolate.Render(envVar, &config.ctx) if err != nil { return "", err } // Split vars into key/value components keyValue := strings.SplitN(envVar, "=", 2) // Store pair, replacing any single quotes in value so they parse // correctly with required environment variable format envVars[keyValue[0]] = strings.Replace(keyValue[1], "'", `'"'"'`, -1) } // Create a list of env var keys in sorted order var keys []string for k := range envVars { keys = append(keys, k) } sort.Strings(keys) for _, key := range keys { flattened += fmt.Sprintf(config.EnvVarFormat, key, envVars[key]) } return flattened, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020112�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell/exit_code.go�����������������������������������������������0000664�0000000�0000000�00000001331�13771713062�0022402�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import "fmt" func (p *Provisioner) ValidExitCode(code int) error { // Check exit code against allowed codes (likely just 0) validCodes := p.ValidExitCodes if len(validCodes) == 0 { validCodes = []int{0} } validExitCode := false for _, v := range validCodes { if code == v { validExitCode = true break } } if !validExitCode { return &ErrorInvalidExitCode{ Code: code, Allowed: validCodes, } } return nil } type ErrorInvalidExitCode struct { Code int Allowed []int } func (e *ErrorInvalidExitCode) Error() string { if e == nil { return "<nil>" } return fmt.Sprintf("Script exited with non-zero exit status: %d."+ "Allowed exit codes are: %v", e.Code, e.Allowed) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell/exit_code_test.go������������������������������������������0000664�0000000�0000000�00000001155�13771713062�0023445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import ( "fmt" "testing" ) func TestProvisioner_ValidExitCode(t *testing.T) { tests := []struct { exitCodes []int code int wantErr bool }{ {nil, 0, false}, {nil, 1, true}, {[]int{2}, 2, false}, {[]int{2}, 3, true}, } for n := range tests { tt := tests[n] t.Run(fmt.Sprintf("%v - %v - %v", tt.exitCodes, tt.code, tt.wantErr), func(t *testing.T) { p := Provisioner{ ValidExitCodes: tt.exitCodes, } if err := p.ValidExitCode(tt.code); (err != nil) != tt.wantErr { t.Errorf("Provisioner.ValidExitCode() error = %v, wantErr %v", err, tt.wantErr) } }) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shell/shell.go���������������������������������������������������0000664�0000000�0000000�00000004733�13771713062�0021557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package shell defines code that is common in shells package shell import "github.com/hashicorp/packer/packer-plugin-sdk/common" // Provisioner contains common fields to all shell provisioners. // It is provided as a convenience to encourage plugin developers to // consider implementing these options, which we believe are valuable for all // shell-type provisioners. It also helps guarantee that option names for // similar options are the same across the various shell provisioners. // Validation and defaulting are left to the maintainer because appropriate // values and defaults will be different depending on which shell is used. // To use the Provisioner struct, embed it in your shell provisioner's config // using the `mapstructure:",squash"` struct tag. Examples can be found in the // HashiCorp-maintained "shell", "shell-local", "windows-shell" and "powershell" // provisioners. type Provisioner struct { common.PackerConfig `mapstructure:",squash"` // An inline script to execute. Multiple strings are all executed // in the context of a single shell. Inline []string // The local path of the shell script to upload and execute. Script string // An array of multiple scripts to run. Scripts []string // Valid Exit Codes - 0 is not always the only valid error code! See // http://www.symantec.com/connect/articles/windows-system-error-codes-exit-codes-description // for examples such as 3010 - "The requested operation is successful. ValidExitCodes []int `mapstructure:"valid_exit_codes"` // An array of environment variables that will be injected before // your command(s) are executed. Vars []string `mapstructure:"environment_vars"` // This is used in the template generation to format environment variables // inside the `ExecuteCommand` template. EnvVarFormat string `mapstructure:"env_var_format"` } type ProvisionerRemoteSpecific struct { // If true, the script contains binary and line endings will not be // converted from Windows to Unix-style. Binary bool // The remote path where the local shell script will be uploaded to. // This should be set to a writable file that is in a pre-existing directory. // This defaults to remote_folder/remote_file RemotePath string `mapstructure:"remote_path"` // The command used to execute the script. The '{{ .Path }}' variable // should be used to specify where the script goes, {{ .Vars }} // can be used to inject the environment_vars into the environment. ExecuteCommand string `mapstructure:"execute_command"` } �������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shutdowncommand/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022215�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shutdowncommand/config.go����������������������������������������0000664�0000000�0000000�00000003276�13771713062�0024021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package shutdowncommand import ( "time" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // ShutdownConfig defines implementation details for shutting down a VM once it // is done provisioned. // It is provided as a convenience to encourage builder developers to // consider implementing these options, which we believe are valuable for all // builders. It also helps guarantee that option names for similar options // are the same across the various builders. Embed it in your builder config // using the `mapstructure:",squash"` struct tag. type ShutdownConfig struct { // The command to use to gracefully shut down the machine once all // provisioning is complete. By default this is an empty string, which // tells Packer to just forcefully shut down the machine. This setting can // be safely omitted if for example, a shutdown command to gracefully halt // the machine is configured inside a provisioning script. If one or more // scripts require a reboot it is suggested to leave this blank (since // reboots may fail) and instead specify the final shutdown command in your // last script. ShutdownCommand string `mapstructure:"shutdown_command" required:"false"` // The amount of time to wait after executing the shutdown_command for the // virtual machine to actually shut down. If the machine doesn't shut down // in this time it is considered an error. By default, the time out is "5m" // (five minutes). ShutdownTimeout time.Duration `mapstructure:"shutdown_timeout" required:"false"` } func (c *ShutdownConfig) Prepare(ctx *interpolate.Context) []error { if c.ShutdownTimeout == 0 { c.ShutdownTimeout = 5 * time.Minute } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/shutdowncommand/config_test.go�����������������������������������0000664�0000000�0000000�00000001446�13771713062�0025055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shutdowncommand import ( "testing" "time" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) func testShutdownConfig() *ShutdownConfig { return &ShutdownConfig{} } func TestShutdownConfigPrepare_ShutdownCommand(t *testing.T) { var c *ShutdownConfig var errs []error c = testShutdownConfig() errs = c.Prepare(interpolate.NewContext()) if len(errs) > 0 { t.Fatalf("err: %#v", errs) } } func TestShutdownConfigPrepare_ShutdownTimeout(t *testing.T) { var c *ShutdownConfig var errs []error // Test with a good one c = testShutdownConfig() c.ShutdownTimeout = 5 * time.Second errs = c.Prepare(interpolate.NewContext()) if len(errs) > 0 { t.Fatalf("err: %#v", errs) } if c.ShutdownTimeout != 5*time.Second { t.Fatalf("bad: %s", c.ShutdownTimeout) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020616�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/config/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022063�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/config/custom_types.go����������������������������������0000664�0000000�0000000�00000004420�13771713062�0025150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type KeyValue,KeyValues,KeyValueFilter,NameValue,NameValues,NameValueFilter package config import ( "strconv" ) type Trilean uint8 const ( // This will assign unset to 0, which is the default value in interpolation TriUnset Trilean = iota TriTrue TriFalse ) func (t Trilean) ToString() string { if t == TriTrue { return "TriTrue" } else if t == TriFalse { return "TriFalse" } return "TriUnset" } func (t Trilean) ToBoolPointer() *bool { if t == TriTrue { return boolPointer(true) } else if t == TriFalse { return boolPointer(false) } return nil } func (t Trilean) True() bool { if t == TriTrue { return true } return false } func (t Trilean) False() bool { if t == TriFalse { return true } return false } func TrileanFromString(s string) (Trilean, error) { if s == "" { return TriUnset, nil } b, err := strconv.ParseBool(s) if err != nil { return TriUnset, err } else if b == true { return TriTrue, nil } else { return TriFalse, nil } } func TrileanFromBool(b bool) Trilean { if b { return TriTrue } return TriFalse } func boolPointer(b bool) *bool { return &b } // These are used to convert HCL blocks to key-value pairs type KeyValue struct { Key string Value string } type KeyValues []KeyValue func (kvs KeyValues) CopyOn(to *map[string]string) []error { if len(kvs) == 0 { return nil } if *to == nil { *to = map[string]string{} } for _, kv := range kvs { (*to)[kv.Key] = kv.Value } return nil } type KeyValueFilter struct { Filters map[string]string Filter KeyValues } func (kvf *KeyValueFilter) Prepare() []error { kvf.Filter.CopyOn(&kvf.Filters) return nil } func (kvf *KeyValueFilter) Empty() bool { return len(kvf.Filters) == 0 } type NameValue struct { Name string Value string } type NameValues []NameValue func (nvs NameValues) CopyOn(to *map[string]string) []error { if len(nvs) == 0 { return nil } if *to == nil { *to = map[string]string{} } for _, kv := range nvs { (*to)[kv.Name] = kv.Value } return nil } type NameValueFilter struct { Filters map[string]string Filter NameValues } func (nvf *NameValueFilter) Prepare() []error { nvf.Filter.CopyOn(&nvf.Filters) return nil } func (nvf *NameValueFilter) Empty() bool { return len(nvf.Filters) == 0 } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/config/custom_types.hcl2spec.go�������������������������0000664�0000000�0000000�00000010761�13771713062�0026657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type KeyValue,KeyValues,KeyValueFilter,NameValue,NameValues,NameValueFilter"; DO NOT EDIT. package config import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatKeyValue is an auto-generated flat version of KeyValue. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatKeyValue struct { Key *string `cty:"key" hcl:"key"` Value *string `cty:"value" hcl:"value"` } // FlatMapstructure returns a new FlatKeyValue. // FlatKeyValue is an auto-generated flat version of KeyValue. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*KeyValue) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatKeyValue) } // HCL2Spec returns the hcl spec of a KeyValue. // This spec is used by HCL to read the fields of KeyValue. // The decoded values from this spec will then be applied to a FlatKeyValue. func (*FlatKeyValue) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "key": &hcldec.AttrSpec{Name: "key", Type: cty.String, Required: false}, "value": &hcldec.AttrSpec{Name: "value", Type: cty.String, Required: false}, } return s } // FlatKeyValueFilter is an auto-generated flat version of KeyValueFilter. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatKeyValueFilter struct { Filters map[string]string `cty:"filters" hcl:"filters"` Filter []FlatKeyValue `cty:"filter" hcl:"filter"` } // FlatMapstructure returns a new FlatKeyValueFilter. // FlatKeyValueFilter is an auto-generated flat version of KeyValueFilter. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*KeyValueFilter) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatKeyValueFilter) } // HCL2Spec returns the hcl spec of a KeyValueFilter. // This spec is used by HCL to read the fields of KeyValueFilter. // The decoded values from this spec will then be applied to a FlatKeyValueFilter. func (*FlatKeyValueFilter) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "filters": &hcldec.AttrSpec{Name: "filters", Type: cty.Map(cty.String), Required: false}, "filter": &hcldec.BlockListSpec{TypeName: "filter", Nested: hcldec.ObjectSpec((*FlatKeyValue)(nil).HCL2Spec())}, } return s } // FlatNameValue is an auto-generated flat version of NameValue. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatNameValue struct { Name *string `cty:"name" hcl:"name"` Value *string `cty:"value" hcl:"value"` } // FlatMapstructure returns a new FlatNameValue. // FlatNameValue is an auto-generated flat version of NameValue. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*NameValue) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatNameValue) } // HCL2Spec returns the hcl spec of a NameValue. // This spec is used by HCL to read the fields of NameValue. // The decoded values from this spec will then be applied to a FlatNameValue. func (*FlatNameValue) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "name": &hcldec.AttrSpec{Name: "name", Type: cty.String, Required: false}, "value": &hcldec.AttrSpec{Name: "value", Type: cty.String, Required: false}, } return s } // FlatNameValueFilter is an auto-generated flat version of NameValueFilter. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatNameValueFilter struct { Filters map[string]string `cty:"filters" hcl:"filters"` Filter []FlatNameValue `cty:"filter" hcl:"filter"` } // FlatMapstructure returns a new FlatNameValueFilter. // FlatNameValueFilter is an auto-generated flat version of NameValueFilter. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*NameValueFilter) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatNameValueFilter) } // HCL2Spec returns the hcl spec of a NameValueFilter. // This spec is used by HCL to read the fields of NameValueFilter. // The decoded values from this spec will then be applied to a FlatNameValueFilter. func (*FlatNameValueFilter) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "filters": &hcldec.AttrSpec{Name: "filters", Type: cty.Map(cty.String), Required: false}, "filter": &hcldec.BlockListSpec{TypeName: "filter", Nested: hcldec.ObjectSpec((*FlatNameValue)(nil).HCL2Spec())}, } return s } ���������������packer-1.6.6+ds1/packer-plugin-sdk/template/config/custom_types_test.go�����������������������������0000664�0000000�0000000�00000001253�13771713062�0026210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package config import ( "testing" ) func TestTrilianParsing(t *testing.T) { type testCase struct { Input string Output Trilean ErrExpected bool } testCases := []testCase{ {"true", TriTrue, false}, {"True", TriTrue, false}, {"false", TriFalse, false}, {"False", TriFalse, false}, {"", TriUnset, false}, {"badvalue", TriUnset, true}, {"FAlse", TriUnset, true}, {"TrUe", TriUnset, true}, } for _, tc := range testCases { tril, err := TrileanFromString(tc.Input) if err != nil { if tc.ErrExpected == false { t.Fatalf("Didn't expect error: %v", tc) } } if tc.Output != tril { t.Fatalf("Didn't return proper trilean. %v", tc) } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/config/decode.go����������������������������������������0000664�0000000�0000000�00000023173�13771713062�0023643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package config import ( "encoding/json" "fmt" "log" "reflect" "sort" "strings" "github.com/hashicorp/go-multierror" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/mitchellh/mapstructure" "github.com/ryanuber/go-glob" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/gocty" ctyjson "github.com/zclconf/go-cty/cty/json" ) // DecodeOpts are the options for decoding configuration. type DecodeOpts struct { // Metadata, if non-nil, will be set to the metadata post-decode Metadata *mapstructure.Metadata // Interpolate, if true, will automatically interpolate the // configuration with the given InterpolateContext. User variables // will be automatically detected and added in-place to the given // context. Interpolate bool InterpolateContext *interpolate.Context InterpolateFilter *interpolate.RenderFilter // PluginType is the BuilderID, etc of the plugin -- it is used to // determine whether to tell the user to "fix" their template if an // unknown option is a deprecated one for this plugin type. PluginType string DecodeHooks []mapstructure.DecodeHookFunc } var DefaultDecodeHookFuncs = []mapstructure.DecodeHookFunc{ uint8ToStringHook, stringToTrilean, mapstructure.StringToSliceHookFunc(","), mapstructure.StringToTimeDurationHookFunc(), } // Decode decodes the configuration into the target and optionally // automatically interpolates all the configuration as it goes. func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error { // loop over raws once to get cty values from hcl, if that's a thing. for i, raw := range raws { // check for cty values and transform them to json then to a // map[string]interface{} so that mapstructure can do its thing. cval, ok := raw.(cty.Value) if !ok { continue } type flatConfigurer interface { FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } } ctarget := target.(flatConfigurer) flatCfg := ctarget.FlatMapstructure() err := gocty.FromCtyValue(cval, flatCfg) if err != nil { switch err := err.(type) { case cty.PathError: return fmt.Errorf("%v: %v", err, err.Path) } return err } b, err := ctyjson.SimpleJSONValue{Value: cval}.MarshalJSON() if err != nil { return err } var raw map[string]interface{} if err := json.Unmarshal(b, &raw); err != nil { return err } raws[i] = raw { // reset target to zero. // In HCL2, we need to prepare provisioners/post-processors after a // builder has started in order to have build values correctly // extrapolated. Packer plugins have never been prepared twice in // the past and some of them set fields during their Validation // steps; which end up in an invalid provisioner/post-processor, // like in [GH-9596]. This ensures Packer plugin will be reset // right before we Prepare them. p := reflect.ValueOf(target).Elem() p.Set(reflect.Zero(p.Type())) } } // Now perform the normal decode. if config == nil { config = &DecodeOpts{Interpolate: true} } // Detect user variables from the raws and merge them into our context ctxData, raws := DetectContextData(raws...) // Interpolate first if config.Interpolate { ctx, err := DetectContext(raws...) if err != nil { return err } if config.InterpolateContext == nil { config.InterpolateContext = ctx } else { config.InterpolateContext.BuildName = ctx.BuildName config.InterpolateContext.BuildType = ctx.BuildType config.InterpolateContext.CorePackerVersionString = ctx.CorePackerVersionString config.InterpolateContext.TemplatePath = ctx.TemplatePath config.InterpolateContext.UserVariables = ctx.UserVariables if config.InterpolateContext.Data == nil { config.InterpolateContext.Data = ctxData } } ctx = config.InterpolateContext // Render everything for i, raw := range raws { m, err := interpolate.RenderMap(raw, ctx, config.InterpolateFilter) if err != nil { return err } raws[i] = m } } decodeHookFuncs := DefaultDecodeHookFuncs if len(config.DecodeHooks) != 0 { decodeHookFuncs = config.DecodeHooks } // Build our decoder var md mapstructure.Metadata decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ Result: target, Metadata: &md, WeaklyTypedInput: true, DecodeHook: mapstructure.ComposeDecodeHookFunc(decodeHookFuncs...), }) if err != nil { return err } // In practice, raws is two interfaces: one containing all the packer config // vars, and one containing the raw json configuration for a single // plugin. for _, raw := range raws { if err := decoder.Decode(raw); err != nil { return err } } // If we have unused keys, it is an error if len(md.Unused) > 0 { var err error sort.Strings(md.Unused) for _, unused := range md.Unused { if unused == "type" || strings.HasPrefix(unused, "packer_") { continue } // Check for whether the key is handled in a packer fix // call. fixable := false // check whether the deprecation option can be fixed using packer fix. if config.PluginType != "" { for k, deprecatedOptions := range DeprecatedOptions { // the deprecated options keys are globbable, for // example "amazon*" for all amazon builders, or * for // all builders if glob.Glob(k, config.PluginType) { for _, deprecatedOption := range deprecatedOptions { if unused == deprecatedOption { fixable = true break } } } if fixable == true { break } } } unusedErr := fmt.Errorf("unknown configuration key: '%q'", unused) if fixable { unusedErr = fmt.Errorf("Deprecated configuration key: '%s'."+ " Please call `packer fix` against your template to "+ "update your template to be compatible with the current "+ "version of Packer. Visit "+ "https://www.packer.io/docs/commands/fix/ for more detail.", unused) } err = multierror.Append(err, unusedErr) } if err != nil { return err } } // Set the metadata if it is set if config.Metadata != nil { *config.Metadata = md } return nil } func DetectContextData(raws ...interface{}) (map[interface{}]interface{}, []interface{}) { // In provisioners, the last value pulled from raws is the placeholder data // for build-specific variables. Pull these out to add to interpolation // context. if len(raws) == 0 { return nil, raws } // Internally, our tests may cause this to be read as a map[string]string placeholderData := raws[len(raws)-1] if pd, ok := placeholderData.(map[string]string); ok { if uuid, ok := pd["PackerRunUUID"]; ok { if strings.Contains(uuid, "Build_PackerRunUUID.") { cast := make(map[interface{}]interface{}) for k, v := range pd { cast[k] = v } raws = raws[:len(raws)-1] return cast, raws } } } // but with normal interface conversion across the rpc, it'll look like a // map[interface]interface, not a map[string]string if pd, ok := placeholderData.(map[interface{}]interface{}); ok { if uuid, ok := pd["PackerRunUUID"]; ok { if strings.Contains(uuid.(string), "Build_PackerRunUUID.") { raws = raws[:len(raws)-1] return pd, raws } } } return nil, raws } // DetectContext builds a base interpolate.Context, automatically // detecting things like user variables from the raw configuration params. func DetectContext(raws ...interface{}) (*interpolate.Context, error) { var s struct { BuildName string `mapstructure:"packer_build_name"` BuildType string `mapstructure:"packer_builder_type"` CorePackerVersionString string `mapstructure:"packer_core_version"` TemplatePath string `mapstructure:"packer_template_path"` Vars map[string]string `mapstructure:"packer_user_variables"` SensitiveVars []string `mapstructure:"packer_sensitive_variables"` } for _, r := range raws { if err := mapstructure.Decode(r, &s); err != nil { log.Printf("Error detecting context: %s", err) return nil, err } } return &interpolate.Context{ BuildName: s.BuildName, BuildType: s.BuildType, CorePackerVersionString: s.CorePackerVersionString, TemplatePath: s.TemplatePath, UserVariables: s.Vars, SensitiveVariables: s.SensitiveVars, }, nil } func uint8ToStringHook(f reflect.Kind, t reflect.Kind, v interface{}) (interface{}, error) { // We need to convert []uint8 to string. We have to do this // because internally Packer uses MsgPack for RPC and the MsgPack // codec turns strings into []uint8 if f == reflect.Slice && t == reflect.String { dataVal := reflect.ValueOf(v) dataType := dataVal.Type() elemKind := dataType.Elem().Kind() if elemKind == reflect.Uint8 { v = string(dataVal.Interface().([]uint8)) } } return v, nil } func stringToTrilean(f reflect.Type, t reflect.Type, v interface{}) (interface{}, error) { // We have a custom data type, config, which we read from a string and // then cast to a *bool. Why? So that we can appropriately read "unset" // *bool values in order to intelligently default, even when the values are // being set by a template variable. testTril, _ := TrileanFromString("") if t == reflect.TypeOf(testTril) { // From value is string if f == reflect.TypeOf("") { tril, err := TrileanFromString(v.(string)) if err != nil { return v, fmt.Errorf("Error parsing bool from given var: %s", err) } return tril, nil } else { // From value is boolean if f == reflect.TypeOf(true) { tril := TrileanFromBool(v.(bool)) return tril, nil } } } return v, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/config/decode_test.go�����������������������������������0000664�0000000�0000000�00000007752�13771713062�0024707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package config import ( "reflect" "strings" "testing" "time" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) func TestDecode(t *testing.T) { type Target struct { Name string Address string Time time.Duration Trilean Trilean } cases := map[string]struct { Input []interface{} Output *Target Opts *DecodeOpts }{ "basic": { []interface{}{ map[string]interface{}{ "name": "bar", "time": "5s", "trilean": "true", }, }, &Target{ Name: "bar", Time: 5 * time.Second, Trilean: TriTrue, }, nil, }, "empty-string-trilean": { []interface{}{ map[string]interface{}{ "trilean": "", }, }, &Target{ Trilean: TriUnset, }, nil, }, "variables": { []interface{}{ map[string]interface{}{ "name": "{{user `name`}}", }, map[string]interface{}{ "packer_user_variables": map[string]string{ "name": "bar", }, }, }, &Target{ Name: "bar", }, nil, }, "filter": { []interface{}{ map[string]interface{}{ "name": "{{user `name`}}", "address": "{{user `name`}}", }, map[string]interface{}{ "packer_user_variables": map[string]string{ "name": "bar", }, }, }, &Target{ Name: "bar", Address: "{{user `name`}}", }, &DecodeOpts{ Interpolate: true, InterpolateFilter: &interpolate.RenderFilter{ Include: []string{"name"}, }, }, }, "build name": { []interface{}{ map[string]interface{}{ "name": "{{build_name}}", }, map[string]interface{}{ "packer_build_name": "foo", }, }, &Target{ Name: "foo", }, nil, }, "build type": { []interface{}{ map[string]interface{}{ "name": "{{build_type}}", }, map[string]interface{}{ "packer_builder_type": "foo", }, }, &Target{ Name: "foo", }, nil, }, } for k, tc := range cases { var result Target err := Decode(&result, tc.Opts, tc.Input...) if err != nil { t.Fatalf("err: %s\n\n%s", k, err) } if !reflect.DeepEqual(&result, tc.Output) { t.Fatalf("bad:\n\n%#v\n\n%#v", &result, tc.Output) } } } func TestDecode_fixerRecommendations(t *testing.T) { type TestConfig struct { Name string } cases := []struct { Reason string Input []interface{} Opts *DecodeOpts Expected string }{ { Reason: "If no plugin type is provided, don't try to match fixer options", Input: []interface{}{ map[string]interface{}{ "name": "bar", "iso_md5": "13123412341234", }, }, Opts: &DecodeOpts{}, Expected: `unknown configuration key: '"iso_md5"'`, }, { Reason: "iso_md5 should always recommend packer fix regardless of plugin type", Input: []interface{}{ map[string]interface{}{ "name": "bar", "iso_md5": "13123412341234", }, }, Opts: &DecodeOpts{PluginType: "someplugin"}, Expected: `Deprecated configuration key: 'iso_md5'`, }, { Reason: "filename option should generate a fixer recommendation for the manifest postprocessor", Input: []interface{}{ map[string]interface{}{ "name": "bar", "filename": "fakefilename", }, }, Opts: &DecodeOpts{PluginType: "packer.post-processor.manifest"}, Expected: `Deprecated configuration key: 'filename'`, }, { Reason: "filename option should generate an unknown key error for other plugins", Input: []interface{}{ map[string]interface{}{ "name": "bar", "filename": "fakefilename", }, }, Opts: &DecodeOpts{PluginType: "randomplugin"}, Expected: `unknown configuration key: '"filename"'`, }, } for _, tc := range cases { var result TestConfig err := Decode(&result, tc.Opts, tc.Input...) if err == nil { t.Fatalf("Should have had an error: %s", tc.Reason) } if !strings.Contains(err.Error(), tc.Expected) { t.Fatalf("Expected: %s\nActual: %s\n; Reason: %s", tc.Expected, err.Error(), tc.Reason) } } } ����������������������packer-1.6.6+ds1/packer-plugin-sdk/template/config/deprecated_options.go����������������������������0000664�0000000�0000000�00000003166�13771713062�0026273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//<!-- Code generated by generate-fixer-deprecations; DO NOT EDIT MANUALLY --> package config var DeprecatedOptions = map[string][]string{ "*": []string{"iso_md5", "ssh_key_path", "ssh_disable_agent", "ssh_host_port_min", "ssh_host_port_max", "ssh_skip_nat_mapping", "ssh_wait_timeout", "iso_checksum_url", "iso_checksum_type"}, "*amazon*": []string{"shutdown_behaviour", "enhanced_networking", "ssh_private_ip", "temporary_security_group_source_cidr", "clean_ami_name", "spot_price_auto_product"}, "Azure*": []string{"clean_image_name", "exlude_from_latest"}, "MSOpenTech.hyperv": []string{"vhd_temp_path", "clone_from_vmxc_path", "cpu", "ram_size"}, "ansible": []string{"galaxycommand"}, "hashicorp.scaleway": []string{"access_key"}, "jetbrains.vsphere": []string{"network_card", "network", "networkCard", "disk_size", "disk_thin_provisioned", "disk_eagerly_scrub"}, "mitchellh.virtualbox": []string{"guest_additions_attach"}, "packer.docker": []string{"login_email"}, "packer.googlecompute": []string{"clean_image_name"}, "packer.parallels": []string{"headless", "parallels_tools_host_path", "guest_os_distribution"}, "packer.post-processor.docker-import": []string{"login_email"}, "packer.post-processor.docker-tag": []string{"tag"}, "packer.post-processor.manifest": []string{"filename"}, "transcend.qemu": []string{"ssh_host_port_max", "ssh_host_port_min"}, } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/funcs.go������������������������������������������������0000664�0000000�0000000�00000006314�13771713062�0022267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package template import ( "errors" "fmt" "log" "os" "strings" "sync" consulapi "github.com/hashicorp/consul/api" awssmapi "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate/aws/secretsmanager" vaultapi "github.com/hashicorp/vault/api" ) // DeprecatedTemplateFunc wraps a template func to warn users that it's // deprecated. The deprecation warning is called only once. func DeprecatedTemplateFunc(funcName, useInstead string, deprecated func(string) string) func(string) string { once := sync.Once{} return func(in string) string { once.Do(func() { log.Printf("[WARN]: the `%s` template func is deprecated, please use %s instead", funcName, useInstead) }) return deprecated(in) } } // Vault retrieves a secret from a HashiCorp Vault KV store. // It assumes the necessary environment variables are set. func Vault(path string, key string) (string, error) { if token := os.Getenv("VAULT_TOKEN"); token == "" { return "", errors.New("Must set VAULT_TOKEN env var in order to use vault template function") } vaultConfig := vaultapi.DefaultConfig() cli, err := vaultapi.NewClient(vaultConfig) if err != nil { return "", fmt.Errorf("Error getting Vault client: %s", err) } secret, err := cli.Logical().Read(path) if err != nil { return "", fmt.Errorf("Error reading vault secret: %s", err) } if secret == nil { return "", errors.New("Vault Secret does not exist at the given path") } data, ok := secret.Data["data"] if !ok { // maybe ths is v1, not v2 kv store value, ok := secret.Data[key] if ok { return value.(string), nil } // neither v1 nor v2 proudced a valid value return "", fmt.Errorf("Vault data was empty at the given path. Warnings: %s", strings.Join(secret.Warnings, "; ")) } if val, ok := data.(map[string]interface{})[key]; ok { return val.(string), nil } return "", errors.New("Vault path does not contain the requested key") } // Consul retrieves a value from a HashiCorp Consul KV store. // It assumes the necessary environment variables are set. func Consul(k string) (string, error) { consulConfig := consulapi.DefaultConfig() client, err := consulapi.NewClient(consulConfig) if err != nil { return "", fmt.Errorf("error getting consul client: %s", err) } q := &consulapi.QueryOptions{} kv, _, err := client.KV().Get(k, q) if err != nil { return "", fmt.Errorf("error reading consul key: %s", err) } if kv == nil { return "", fmt.Errorf("key does not exist at the given path: %s", k) } value := string(kv.Value) if value == "" { return "", fmt.Errorf("value is empty at path %s", k) } return value, nil } // GetAwsSecret retrieves a value from an AWS Secrets Manager. // It assumes that credentials are properly set in the AWS SDK's credential // chain. func GetAWSSecret(name, key string) (string, error) { // Check if at least 1 parameter has been used if len(name) == 0 { return "", errors.New("At least one secret name must be provided") } // client uses AWS SDK CredentialChain method. So,credentials can // be loaded from credential file, environment variables, or IAM // roles. client := awssmapi.New( &awssmapi.AWSConfig{}, ) spec := &awssmapi.SecretSpec{ Name: name, Key: key, } return client.GetSecret(spec) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/��������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023144�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/aws/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023736�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/aws/secretsmanager/�������������������������0000775�0000000�0000000�00000000000�13771713062�0026741�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/aws/secretsmanager/secretsmanager.go��������0000664�0000000�0000000�00000004702�13771713062�0032276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package secretsmanager provide methods to get data from // AWS Secret Manager package secretsmanager import ( "encoding/json" "errors" "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/secretsmanager/secretsmanageriface" ) // Client represents an AWS Secrets Manager client type Client struct { config *AWSConfig api secretsmanageriface.SecretsManagerAPI } // New creates an AWS Session Manager Client func New(config *AWSConfig) *Client { c := &Client{ config: config, } s := c.newSession(config) c.api = secretsmanager.New(s) return c } func (c *Client) newSession(config *AWSConfig) *session.Session { // Initialize config with error verbosity sessConfig := aws.NewConfig().WithCredentialsChainVerboseErrors(true) if config.Region != "" { sessConfig = sessConfig.WithRegion(config.Region) } opts := session.Options{ SharedConfigState: session.SharedConfigEnable, Config: *sessConfig, } return session.Must(session.NewSessionWithOptions(opts)) } // GetSecret return an AWS Secret Manager secret // in plain text from a given secret name func (c *Client) GetSecret(spec *SecretSpec) (string, error) { params := &secretsmanager.GetSecretValueInput{ SecretId: aws.String(spec.Name), VersionStage: aws.String("AWSCURRENT"), } resp, err := c.api.GetSecretValue(params) if err != nil { return "", err } if resp.SecretString == nil { return "", errors.New("Secret is not string") } secret := SecretString{ Name: *resp.Name, SecretString: *resp.SecretString, } value, err := getSecretValue(&secret, spec) if err != nil { return "", err } return value, nil } func getSecretValue(s *SecretString, spec *SecretSpec) (string, error) { var secretValue map[string]string blob := []byte(s.SecretString) //For those plaintext secrets just return the value if json.Valid(blob) != true { return s.SecretString, nil } err := json.Unmarshal(blob, &secretValue) if err != nil { return "", err } // If key is not set and secret has multiple keys, return error if spec.Key == "" && len(secretValue) > 1 { return "", errors.New("Secret has multiple values and no key was set") } if spec.Key == "" { for _, v := range secretValue { return v, nil } } if v, ok := secretValue[spec.Key]; ok { return v, nil } return "", fmt.Errorf("No secret found for key %q", spec.Key) } ��������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/aws/secretsmanager/secretsmanager_test.go���0000664�0000000�0000000�00000007257�13771713062�0033345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package secretsmanager import ( "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/secretsmanager/secretsmanageriface" ) type mockedSecret struct { secretsmanageriface.SecretsManagerAPI Resp secretsmanager.GetSecretValueOutput } // GetSecret return mocked secret value func (m mockedSecret) GetSecretValue(in *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error) { return &m.Resp, nil } func TestGetSecret(t *testing.T) { testCases := []struct { description string arg *SecretSpec mock secretsmanager.GetSecretValueOutput want string ok bool }{ { description: "input has valid secret name, secret has single key", arg: &SecretSpec{Name: "test/secret"}, mock: secretsmanager.GetSecretValueOutput{ Name: aws.String("test/secret"), SecretString: aws.String(`{"key": "test"}`), }, want: "test", ok: true, }, { description: "input has valid secret name and key, secret has single key", arg: &SecretSpec{ Name: "test/secret", Key: "key", }, mock: secretsmanager.GetSecretValueOutput{ Name: aws.String("test/secret"), SecretString: aws.String(`{"key": "test"}`), }, want: "test", ok: true, }, { description: "input has valid secret name and key, secret has multiple keys", arg: &SecretSpec{ Name: "test/secret", Key: "second_key", }, mock: secretsmanager.GetSecretValueOutput{ Name: aws.String("test/secret"), SecretString: aws.String(`{"first_key": "first_val", "second_key": "second_val"}`), }, want: "second_val", ok: true, }, { description: "input has valid secret name and no key, secret has multiple keys", arg: &SecretSpec{ Name: "test/secret", }, mock: secretsmanager.GetSecretValueOutput{ Name: aws.String("test/secret"), SecretString: aws.String(`{"first_key": "first_val", "second_key": "second_val"}`), }, ok: false, }, { description: "input has valid secret name and invalid key, secret has single key", arg: &SecretSpec{ Name: "test/secret", Key: "nonexistent", }, mock: secretsmanager.GetSecretValueOutput{ Name: aws.String("test/secret"), SecretString: aws.String(`{"key": "test"}`), }, ok: false, }, { description: "input has valid secret name and invalid key, secret has multiple keys", arg: &SecretSpec{ Name: "test/secret", Key: "nonexistent", }, mock: secretsmanager.GetSecretValueOutput{ Name: aws.String("test/secret"), SecretString: aws.String(`{"first_key": "first_val", "second_key": "second_val"}`), }, ok: false, }, { description: "input has secret and key, secret is empty", arg: &SecretSpec{ Name: "test/secret", Key: "nonexistent", }, mock: secretsmanager.GetSecretValueOutput{}, ok: false, }, { description: "input has secret stored as plaintext", arg: &SecretSpec{ Name: "test", }, mock: secretsmanager.GetSecretValueOutput{ Name: aws.String("test"), SecretString: aws.String("ThisIsThePassword"), }, want: "ThisIsThePassword", ok: true, }, } for _, test := range testCases { c := &Client{ api: mockedSecret{Resp: test.mock}, } got, err := c.GetSecret(test.arg) if test.ok { if got != test.want { t.Fatalf("want %v, got %v, error %v, using arg %v", test.want, got, err, test.arg) } } if !test.ok { if err == nil { t.Fatalf("error expected but got %q, using arg %v", err, test.arg) } } t.Logf("arg (%v), want %v, got %v, err %v", test.arg, test.want, got, err) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/aws/secretsmanager/types.go�����������������0000664�0000000�0000000�00000000773�13771713062�0030443�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package secretsmanager // AWSConfig store configuration used to initialize // secrets manager client. type AWSConfig struct { Region string } // SecretSpec represent specs of secret to be searched // If Key field is not set then package will return first // secret key stored in secret name. type SecretSpec struct { Name string Key string } // SecretString is a concret representation // of an AWS Secrets Manager Secret String type SecretString struct { Name string SecretString string } �����packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/funcs.go������������������������������������0000664�0000000�0000000�00000020556�13771713062�0024621�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "errors" "fmt" "os" "path/filepath" "strconv" "strings" "text/template" "time" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" commontpl "github.com/hashicorp/packer/packer-plugin-sdk/template" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" strftime "github.com/jehiah/go-strftime" ) // InitTime is the UTC time when this package was initialized. It is // used as the timestamp for all configuration templates so that they // match for a single build. var InitTime time.Time func init() { InitTime = time.Now().UTC() } // Funcs are the interpolation funcs that are available within interpolations. var FuncGens = map[string]interface{}{ "build_name": funcGenBuildName, "build_type": funcGenBuildType, "env": funcGenEnv, "isotime": funcGenIsotime, "strftime": funcGenStrftime, "pwd": funcGenPwd, "split": funcGenSplitter, "template_dir": funcGenTemplateDir, "timestamp": funcGenTimestamp, "uuid": funcGenUuid, "user": funcGenUser, "packer_version": funcGenPackerVersion, "consul_key": funcGenConsul, "vault": funcGenVault, "sed": funcGenSed, "build": funcGenBuild, "aws_secretsmanager": funcGenAwsSecrets, "replace": replace, "replace_all": replace_all, "upper": strings.ToUpper, "lower": strings.ToLower, } var ErrVariableNotSetString = "Error: variable not set:" // FuncGenerator is a function that given a context generates a template // function for the template. type FuncGenerator func(*Context) interface{} // Funcs returns the functions that can be used for interpolation given // a context. func Funcs(ctx *Context) template.FuncMap { result := make(map[string]interface{}) for k, v := range FuncGens { switch v := v.(type) { case func(*Context) interface{}: result[k] = v(ctx) default: result[k] = v } } if ctx != nil { for k, v := range ctx.Funcs { result[k] = v } } return template.FuncMap(result) } func funcGenSplitter(ctx *Context) interface{} { return func(k string, s string, i int) (string, error) { // return func(s string) (string, error) { split := strings.Split(k, s) if len(split) <= i { return "", fmt.Errorf("the substring %d was unavailable using the separator value, %s, only %d values were found", i, s, len(split)) } return split[i], nil } } func funcGenBuildName(ctx *Context) interface{} { return func() (string, error) { if ctx == nil || ctx.BuildName == "" { return "", errors.New("build_name not available") } return ctx.BuildName, nil } } func funcGenBuildType(ctx *Context) interface{} { return func() (string, error) { if ctx == nil || ctx.BuildType == "" { return "", errors.New("build_type not available") } return ctx.BuildType, nil } } func funcGenEnv(ctx *Context) interface{} { return func(k string) (string, error) { if !ctx.EnableEnv { // The error message doesn't have to be that detailed since // semantic checks should catch this. return "", errors.New("env vars are not allowed here") } return os.Getenv(k), nil } } func funcGenIsotime(ctx *Context) interface{} { return func(format ...string) (string, error) { if len(format) == 0 { return InitTime.Format(time.RFC3339), nil } if len(format) > 1 { return "", fmt.Errorf("too many values, 1 needed: %v", format) } return InitTime.Format(format[0]), nil } } func funcGenStrftime(ctx *Context) interface{} { return func(format string) string { return strftime.Format(format, InitTime) } } func funcGenPwd(ctx *Context) interface{} { return func() (string, error) { return os.Getwd() } } func funcGenTemplateDir(ctx *Context) interface{} { return func() (string, error) { if ctx == nil || ctx.TemplatePath == "" { return "", errors.New("template path not available") } path, err := filepath.Abs(filepath.Dir(ctx.TemplatePath)) if err != nil { return "", err } return path, nil } } func passthroughOrInterpolate(data map[interface{}]interface{}, s string) (string, error) { if heldPlace, ok := data[s]; ok { if hp, ok := heldPlace.(string); ok { // If we're in the first interpolation pass, the goal is to // make sure that we pass the value through. // TODO match against an actual string constant if strings.Contains(hp, packerbuilderdata.PlaceholderMsg) { return fmt.Sprintf("{{.%s}}", s), nil } else { return hp, nil } } } return "", fmt.Errorf("loaded data, but couldnt find %s in it.", s) } func funcGenBuild(ctx *Context) interface{} { // Depending on where the context data is coming from, it could take a few // different map types. The following switch standardizes the map types // so we can act on them correctly. return func(s string) (string, error) { switch data := ctx.Data.(type) { case map[interface{}]interface{}: return passthroughOrInterpolate(data, s) case map[string]interface{}: // convert to a map[interface{}]interface{} so we can use same // parsing on it passed := make(map[interface{}]interface{}, len(data)) for k, v := range data { passed[k] = v } return passthroughOrInterpolate(passed, s) case map[string]string: // convert to a map[interface{}]interface{} so we can use same // parsing on it passed := make(map[interface{}]interface{}, len(data)) for k, v := range data { passed[k] = v } return passthroughOrInterpolate(passed, s) default: return "", fmt.Errorf("Error validating build variable: the given "+ "variable %s will not be passed into your plugin.", s) } } } func funcGenTimestamp(ctx *Context) interface{} { return func() string { return strconv.FormatInt(InitTime.Unix(), 10) } } func funcGenUser(ctx *Context) interface{} { return func(k string) (string, error) { if ctx == nil || ctx.UserVariables == nil { return "", errors.New("test") } val, ok := ctx.UserVariables[k] if ctx.EnableEnv { // error and retry if we're interpolating UserVariables. But if // we're elsewhere in the template, just return the empty string. if !ok { return "", fmt.Errorf("%s %s", ErrVariableNotSetString, k) } } return val, nil } } func funcGenUuid(ctx *Context) interface{} { return func() string { return uuid.TimeOrderedUUID() } } func funcGenPackerVersion(ctx *Context) interface{} { return func() (string, error) { if ctx == nil || ctx.CorePackerVersionString == "" { return "", errors.New("packer_version not available") } return ctx.CorePackerVersionString, nil } } func funcGenConsul(ctx *Context) interface{} { return func(key string) (string, error) { if !ctx.EnableEnv { // The error message doesn't have to be that detailed since // semantic checks should catch this. return "", errors.New("consul_key is not allowed here") } return commontpl.Consul(key) } } func funcGenVault(ctx *Context) interface{} { return func(path string, key string) (string, error) { // Only allow interpolation from Vault when env vars are being read. if !ctx.EnableEnv { // The error message doesn't have to be that detailed since // semantic checks should catch this. return "", errors.New("Vault vars are only allowed in the variables section") } return commontpl.Vault(path, key) } } func funcGenAwsSecrets(ctx *Context) interface{} { return func(secret ...string) (string, error) { if !ctx.EnableEnv { // The error message doesn't have to be that detailed since // semantic checks should catch this. return "", errors.New("AWS Secrets Manager is only allowed in the variables section") } switch len(secret) { case 0: return "", errors.New("secret name must be provided") case 1: return commontpl.GetAWSSecret(secret[0], "") case 2: return commontpl.GetAWSSecret(secret[0], secret[1]) default: return "", errors.New("only secret name and optional secret key can be provided.") } } } func funcGenSed(ctx *Context) interface{} { return func(expression string, inputString string) (string, error) { return "", errors.New("template function `sed` is deprecated " + "use `replace` or `replace_all` instead." + "Documentation: https://www.packer.io/docs/templates/engine") } } func replace_all(old, new, src string) string { return strings.ReplaceAll(src, old, new) } func replace(old, new string, n int, src string) string { return strings.Replace(src, old, new, n) } ��������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/funcs_test.go�������������������������������0000664�0000000�0000000�00000022327�13771713062�0025656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "os" "path/filepath" "strconv" "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" ) func TestFuncBuildName(t *testing.T) { cases := []struct { Input string Output string }{ { `{{build_name}}`, "foo", }, } ctx := &Context{BuildName: "foo"} for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncBuildType(t *testing.T) { cases := []struct { Input string Output string }{ { `{{build_type}}`, "foo", }, } ctx := &Context{BuildType: "foo"} for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncEnv(t *testing.T) { cases := []struct { Input string Output string }{ { `{{env "PACKER_TEST_ENV"}}`, `foo`, }, { `{{env "PACKER_TEST_ENV_NOPE"}}`, ``, }, } os.Setenv("PACKER_TEST_ENV", "foo") defer os.Setenv("PACKER_TEST_ENV", "") ctx := &Context{EnableEnv: true} for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncEnv_disable(t *testing.T) { cases := []struct { Input string Output string Error bool }{ { `{{env "PACKER_TEST_ENV"}}`, "", true, }, } ctx := &Context{EnableEnv: false} for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if (err != nil) != tc.Error { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncIsotime(t *testing.T) { ctx := &Context{} i := &I{Value: "{{isotime}}"} result, err := i.Render(ctx) if err != nil { t.Fatalf("err: %s", err) } val, err := time.Parse(time.RFC3339, result) if err != nil { t.Fatalf("err: %s", err) } currentTime := time.Now().UTC() if currentTime.Sub(val) > 2*time.Second { t.Fatalf("val: %v (current: %v)", val, currentTime) } } func TestFuncStrftime(t *testing.T) { ctx := &Context{} i := &I{Value: "{{strftime \"%Y-%m-%dT%H:%M:%S%z\"}}"} result, err := i.Render(ctx) if err != nil { t.Fatalf("err: %s", err) } val, err := time.Parse("2006-01-02T15:04:05-0700", result) if err != nil { t.Fatalf("err: %s", err) } currentTime := time.Now().UTC() if currentTime.Sub(val) > 2*time.Second { t.Fatalf("val: %v (current: %v)", val, currentTime) } } func TestFuncPwd(t *testing.T) { wd, err := os.Getwd() if err != nil { t.Fatalf("err: %s", err) } cases := []struct { Input string Output string }{ { `{{pwd}}`, wd, }, } ctx := &Context{} for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncTemplatePath(t *testing.T) { path := "foo/bar" expected, _ := filepath.Abs(filepath.Dir(path)) cases := []struct { Input string Output string }{ { `{{template_dir}}`, expected, }, } ctx := &Context{ TemplatePath: path, } for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncSplit(t *testing.T) { cases := []struct { Input string Output string ErrorExpected bool }{ { `{{split build_name "-" 0}}`, "foo", false, }, { `{{split build_name "-" 1}}`, "bar", false, }, { `{{split build_name "-" 2}}`, "", true, }, } ctx := &Context{BuildName: "foo-bar"} for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if (err == nil) == tc.ErrorExpected { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncTimestamp(t *testing.T) { expected := strconv.FormatInt(InitTime.Unix(), 10) cases := []struct { Input string Output string }{ { `{{timestamp}}`, expected, }, } ctx := &Context{} for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncUser(t *testing.T) { cases := []struct { Input string Output string }{ { `{{user "foo"}}`, `foo`, }, { `{{user "what"}}`, ``, }, } ctx := &Context{ UserVariables: map[string]string{ "foo": "foo", }, } for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if result != tc.Output { t.Fatalf("Input: %s\n\nGot: %s", tc.Input, result) } } } func TestFuncPackerBuild(t *testing.T) { type cases struct { DataMap interface{} ErrExpected bool Template string OutVal string } testCases := []cases{ // Data map is empty; there should be an error. { DataMap: nil, ErrExpected: true, Template: "{{ build `PartyVar` }}", OutVal: "", }, // Data map is a map[string]string and contains value { DataMap: map[string]string{"PartyVar": "PartyVal"}, ErrExpected: false, Template: "{{ build `PartyVar` }}", OutVal: "PartyVal", }, // Data map is a map[string]string and contains value { DataMap: map[string]string{"PartyVar": "PartyVal"}, ErrExpected: false, Template: "{{ build `PartyVar` }}", OutVal: "PartyVal", }, // Data map is a map[string]string and contains value with placeholder. { DataMap: map[string]string{"PartyVar": "PartyVal" + packerbuilderdata.PlaceholderMsg}, ErrExpected: false, Template: "{{ build `PartyVar` }}", OutVal: "{{.PartyVar}}", }, // Data map is a map[interface{}]interface{} and contains value { DataMap: map[interface{}]interface{}{"PartyVar": "PartyVal"}, ErrExpected: false, Template: "{{ build `PartyVar` }}", OutVal: "PartyVal", }, // Data map is a map[interface{}]interface{} and contains value { DataMap: map[interface{}]interface{}{"PartyVar": "PartyVal"}, ErrExpected: false, Template: "{{ build `PartyVar` }}", OutVal: "PartyVal", }, // Data map is a map[interface{}]interface{} and contains value with placeholder. { DataMap: map[interface{}]interface{}{"PartyVar": "PartyVal" + packerbuilderdata.PlaceholderMsg}, ErrExpected: false, Template: "{{ build `PartyVar` }}", OutVal: "{{.PartyVar}}", }, // Data map is a map[interface{}]interface{} and doesn't have value. { DataMap: map[interface{}]interface{}{"BadVar": "PartyVal" + packerbuilderdata.PlaceholderMsg}, ErrExpected: true, Template: "{{ build `MissingVar` }}", OutVal: "", }, // Data map is a map[string]interface and contains value { DataMap: map[string]interface{}{"PartyVar": "PartyVal"}, ErrExpected: false, Template: "{{ build `PartyVar` }}", OutVal: "PartyVal", }, } for _, tc := range testCases { ctx := &Context{} ctx.Data = tc.DataMap i := &I{Value: tc.Template} result, err := i.Render(ctx) if (err != nil) != tc.ErrExpected { t.Fatalf("Input: %s\n\nerr: %s", tc.Template, err) } if ok := strings.Compare(result, tc.OutVal); ok != 0 { t.Fatalf("Expected input to include: %s\n\nGot: %s", tc.OutVal, result) } } } func TestFuncPackerVersion(t *testing.T) { template := `{{packer_version}}` ctx := &Context{ CorePackerVersionString: "1.4.3-dev [DEADC0DE]", } i := &I{Value: template} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", template, err) } // Only match the X.Y.Z portion of the whole version string. if !strings.HasPrefix(result, "1.4.3-dev [DEADC0DE]") { t.Fatalf("Expected input to include: %s\n\nGot: %s", "1.4.3-dev [DEADC0DE]", result) } } func TestReplaceFuncs(t *testing.T) { cases := []struct { Input string Output string }{ { `{{ "foo-bar-baz" | replace "-" "/" 1}}`, `foo/bar-baz`, }, { `{{ replace "-" "/" 1 "foo-bar-baz" }}`, `foo/bar-baz`, }, { `{{ "I Am Henry VIII" | replace_all " " "-" }}`, `I-Am-Henry-VIII`, }, { `{{ replace_all " " "-" "I Am Henry VIII" }}`, `I-Am-Henry-VIII`, }, } ctx := &Context{ UserVariables: map[string]string{ "fee": "-foo-", }, } for _, tc := range cases { i := &I{Value: tc.Input} result, err := i.Render(ctx) if err != nil { t.Fatalf("Input: %s\n\nerr: %s", tc.Input, err) } if diff := cmp.Diff(tc.Output, result); diff != "" { t.Fatalf("Unexpected output: %s", diff) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/i.go����������������������������������������0000664�0000000�0000000�00000006573�13771713062�0023736�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "bytes" "regexp" "strings" "text/template" "github.com/google/uuid" ) // Context is the context that an interpolation is done in. This defines // things such as available variables. type Context struct { // Data is the data for the template that is available Data interface{} // Funcs are extra functions available in the template Funcs map[string]interface{} // UserVariables is the mapping of user variables that the // "user" function reads from. UserVariables map[string]string // SensitiveVariables is a list of variables to sanitize. SensitiveVariables []string // EnableEnv enables the env function EnableEnv bool // All the fields below are used for built-in functions. // // BuildName and BuildType are the name and type, respectively, // of the builder being used. // // TemplatePath is the path to the template that this is being // rendered within. BuildName string BuildType string CorePackerVersionString string TemplatePath string } // NewContext returns an initialized empty context. func NewContext() *Context { return &Context{} } // RenderOnce is shorthand for constructing an I and calling Render one time. func RenderOnce(v string, ctx *Context) (string, error) { return (&I{Value: v}).Render(ctx) } // Render is shorthand for constructing an I and calling Render until all variables are rendered. func Render(v string, ctx *Context) (rendered string, err error) { // Keep interpolating until all variables are done // Sometimes a variable can been inside another one for { rendered, err = (&I{Value: v}).Render(ctx) if err != nil || rendered == v { break } v = rendered } return } // Render is shorthand for constructing an I and calling Render. // Use regex to filter variables that are not supposed to be interpolated now func RenderRegex(v string, ctx *Context, regex string) (string, error) { re := regexp.MustCompile(regex) matches := re.FindAllStringSubmatch(v, -1) // Replace variables to be excluded with a unique UUID excluded := make(map[string]string) for _, value := range matches { id := uuid.New().String() excluded[id] = value[0] v = strings.ReplaceAll(v, value[0], id) } rendered, err := (&I{Value: v}).Render(ctx) if err != nil { return rendered, err } // Replace back by the UUID the previously excluded values for id, value := range excluded { rendered = strings.ReplaceAll(rendered, id, value) } return rendered, nil } // Validate is shorthand for constructing an I and calling Validate. func Validate(v string, ctx *Context) error { return (&I{Value: v}).Validate(ctx) } // I stands for "interpolation" and is the main interpolation struct // in order to render values. type I struct { Value string } // Render renders the interpolation with the given context. func (i *I) Render(ictx *Context) (string, error) { tpl, err := i.template(ictx) if err != nil { return "", err } var result bytes.Buffer var data interface{} if ictx != nil { data = ictx.Data } if err := tpl.Execute(&result, data); err != nil { return "", err } return result.String(), nil } // Validate validates that the template is syntactically valid. func (i *I) Validate(ctx *Context) error { _, err := i.template(ctx) return err } func (i *I) template(ctx *Context) (*template.Template, error) { return template.New("root").Funcs(Funcs(ctx)).Parse(i.Value) } �������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/i_test.go�����������������������������������0000664�0000000�0000000�00000001005�13771713062�0024756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "testing" ) func TestIRender(t *testing.T) { cases := map[string]struct { Ctx *Context Value string Result string }{ "basic": { nil, "foo", "foo", }, } for k, tc := range cases { i := &I{Value: tc.Value} result, err := i.Render(tc.Ctx) if err != nil { t.Fatalf("%s\n\ninput: %s\n\nerr: %s", k, tc.Value, err) } if result != tc.Result { t.Fatalf( "%s\n\ninput: %s\n\nexpected: %s\n\ngot: %s", k, tc.Value, tc.Result, result) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/parse.go������������������������������������0000664�0000000�0000000�00000001746�13771713062�0024615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "fmt" "text/template" "text/template/parse" ) // functionsCalled returns a map (to be used as a set) of the functions // that are called from the given text template. func functionsCalled(t *template.Template) map[string]struct{} { result := make(map[string]struct{}) functionsCalledWalk(t.Tree.Root, result) return result } func functionsCalledWalk(raw parse.Node, r map[string]struct{}) { switch node := raw.(type) { case *parse.ActionNode: functionsCalledWalk(node.Pipe, r) case *parse.CommandNode: if in, ok := node.Args[0].(*parse.IdentifierNode); ok { r[in.Ident] = struct{}{} } for _, n := range node.Args[1:] { functionsCalledWalk(n, r) } case *parse.ListNode: for _, n := range node.Nodes { functionsCalledWalk(n, r) } case *parse.PipeNode: for _, n := range node.Cmds { functionsCalledWalk(n, r) } case *parse.StringNode, *parse.TextNode: // Ignore default: panic(fmt.Sprintf("unknown type: %T", node)) } } ��������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/parse_test.go�������������������������������0000664�0000000�0000000�00000001210�13771713062�0025636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "reflect" "testing" "text/template" ) func TestFunctionsCalled(t *testing.T) { cases := []struct { Input string Result map[string]struct{} }{ { "foo", map[string]struct{}{}, }, { "foo {{user `bar`}}", map[string]struct{}{ "user": {}, }, }, } funcs := Funcs(&Context{}) for _, tc := range cases { tpl, err := template.New("root").Funcs(funcs).Parse(tc.Input) if err != nil { t.Fatalf("err parsing: %v\n\n%s", tc.Input, err) } actual := functionsCalled(tpl) if !reflect.DeepEqual(actual, tc.Result) { t.Fatalf("bad: %v\n\ngot: %#v", tc.Input, actual) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/render.go�����������������������������������0000664�0000000�0000000�00000014771�13771713062�0024764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "fmt" "reflect" "strings" "sync" "github.com/mitchellh/mapstructure" "github.com/mitchellh/reflectwalk" ) // RenderFilter is an option for filtering what gets rendered and // doesn't within an interface. type RenderFilter struct { Include []string Exclude []string once sync.Once excludeSet map[string]struct{} includeSet map[string]struct{} } // RenderMap renders all the strings in the given interface. The // interface must decode into a map[string]interface{}, but is left // as an interface{} type to ease backwards compatibility with the way // arguments are passed around in Packer. func RenderMap(v interface{}, ctx *Context, f *RenderFilter) (map[string]interface{}, error) { // First decode it into the map var m map[string]interface{} if err := mapstructure.Decode(v, &m); err != nil { return nil, err } // Now go through each value and render it for k, raw := range m { // Always validate every field if err := ValidateInterface(raw, ctx); err != nil { return nil, fmt.Errorf("invalid '%s': %s", k, err) } if !f.include(k) { continue } raw, err := RenderInterface(raw, ctx) if err != nil { return nil, fmt.Errorf("render '%s': %s", k, err) } m[k] = raw } return m, nil } // RenderInterface renders any value and returns the resulting value. func RenderInterface(v interface{}, ctx *Context) (interface{}, error) { f := func(v string) (string, error) { return RenderOnce(v, ctx) } walker := &renderWalker{ F: f, Replace: true, } err := reflectwalk.Walk(v, walker) if err != nil { return nil, err } if walker.Top != nil { v = walker.Top } return v, nil } // ValidateInterface renders any value and returns the resulting value. func ValidateInterface(v interface{}, ctx *Context) error { f := func(v string) (string, error) { return v, Validate(v, ctx) } walker := &renderWalker{ F: f, Replace: false, } err := reflectwalk.Walk(v, walker) if err != nil { return err } return nil } // Include checks whether a key should be included. func (f *RenderFilter) include(k string) bool { if f == nil { return true } k = strings.ToLower(k) f.once.Do(f.init) if len(f.includeSet) > 0 { _, ok := f.includeSet[k] return ok } if len(f.excludeSet) > 0 { _, ok := f.excludeSet[k] return !ok } return true } func (f *RenderFilter) init() { f.includeSet = make(map[string]struct{}) for _, v := range f.Include { f.includeSet[strings.ToLower(v)] = struct{}{} } f.excludeSet = make(map[string]struct{}) for _, v := range f.Exclude { f.excludeSet[strings.ToLower(v)] = struct{}{} } } // renderWalker implements interfaces for the reflectwalk package // (github.com/mitchellh/reflectwalk) that can be used to automatically // execute a callback for an interpolation. type renderWalker struct { // F is the function to call for every interpolation. It can be nil. // // If Replace is true, then the return value of F will be used to // replace the interpolation. F renderWalkerFunc Replace bool // ContextF is an advanced version of F that also receives the // location of where it is in the structure. This lets you do // context-aware validation. ContextF renderWalkerContextFunc // Top is the top value of the walk. This might get replaced if the // top value needs to be modified. It is valid to read after any walk. // If it is nil, it means the top wasn't replaced. Top interface{} key []string lastValue reflect.Value loc reflectwalk.Location cs []reflect.Value csKey []reflect.Value csData interface{} sliceIndex int } // renderWalkerFunc is the callback called by interpolationWalk. // It is called with any interpolation found. It should return a value // to replace the interpolation with, along with any errors. // // If Replace is set to false in renderWalker, then the replace // value can be anything as it will have no effect. type renderWalkerFunc func(string) (string, error) // renderWalkerContextFunc is called by interpolationWalk if // ContextF is set. This receives both the interpolation and the location // where the interpolation is. // // This callback can be used to validate the location of the interpolation // within the configuration. type renderWalkerContextFunc func(reflectwalk.Location, string) func (w *renderWalker) Enter(loc reflectwalk.Location) error { w.loc = loc return nil } func (w *renderWalker) Exit(loc reflectwalk.Location) error { w.loc = reflectwalk.None switch loc { case reflectwalk.Map: w.cs = w.cs[:len(w.cs)-1] case reflectwalk.MapValue: w.key = w.key[:len(w.key)-1] w.csKey = w.csKey[:len(w.csKey)-1] case reflectwalk.Slice: // Split any values that need to be split w.cs = w.cs[:len(w.cs)-1] case reflectwalk.SliceElem: w.csKey = w.csKey[:len(w.csKey)-1] } return nil } func (w *renderWalker) Map(m reflect.Value) error { w.cs = append(w.cs, m) return nil } func (w *renderWalker) MapElem(m, k, v reflect.Value) error { w.csData = k w.csKey = append(w.csKey, k) w.key = append(w.key, k.String()) w.lastValue = v return nil } func (w *renderWalker) Slice(s reflect.Value) error { w.cs = append(w.cs, s) return nil } func (w *renderWalker) SliceElem(i int, elem reflect.Value) error { w.csKey = append(w.csKey, reflect.ValueOf(i)) w.sliceIndex = i return nil } func (w *renderWalker) Primitive(v reflect.Value) error { setV := v // We only care about strings if v.Kind() == reflect.Interface { setV = v v = v.Elem() } if v.Kind() != reflect.String { return nil } strV := v.String() if w.ContextF != nil { w.ContextF(w.loc, strV) } if w.F == nil { return nil } replaceVal, err := w.F(strV) if err != nil { return fmt.Errorf( "%s in:\n\n%s", err, v.String()) } if w.Replace { resultVal := reflect.ValueOf(replaceVal) switch w.loc { case reflectwalk.MapKey: m := w.cs[len(w.cs)-1] // Delete the old value var zero reflect.Value m.SetMapIndex(w.csData.(reflect.Value), zero) // Set the new key with the existing value m.SetMapIndex(resultVal, w.lastValue) // Set the key to be the new key w.csData = resultVal case reflectwalk.MapValue: // If we're in a map, then the only way to set a map value is // to set it directly. m := w.cs[len(w.cs)-1] mk := w.csData.(reflect.Value) m.SetMapIndex(mk, resultVal) case reflectwalk.WalkLoc: // At the root element, we can't write that, so we just save it w.Top = resultVal.Interface() default: // Otherwise, we should be addressable setV.Set(resultVal) } } return nil } �������packer-1.6.6+ds1/packer-plugin-sdk/template/interpolate/render_test.go������������������������������0000664�0000000�0000000�00000005444�13771713062�0026020�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package interpolate import ( "reflect" "testing" ) func TestRenderInterface(t *testing.T) { type Test struct { Foo string } cases := map[string]struct { Input interface{} Output interface{} }{ "basic": { map[string]interface{}{ "foo": "{{upper `bar`}}", }, map[string]interface{}{ "foo": "BAR", }, }, "struct": { &Test{ Foo: "{{upper `bar`}}", }, &Test{ Foo: "BAR", }, }, } ctx := &Context{} for k, tc := range cases { actual, err := RenderInterface(tc.Input, ctx) if err != nil { t.Fatalf("err: %s\n\n%s", k, err) } if !reflect.DeepEqual(actual, tc.Output) { t.Fatalf("err: %s\n\n%#v\n\n%#v", k, actual, tc.Output) } } } func TestRenderMap(t *testing.T) { cases := map[string]struct { Input interface{} Output interface{} Filter *RenderFilter }{ "basic": { map[string]interface{}{ "foo": "{{upper `bar`}}", }, map[string]interface{}{ "foo": "BAR", }, nil, }, "map keys shouldn't be interpolated": { map[string]interface{}{ "{{foo}}": "{{upper `bar`}}", }, map[string]interface{}{ "{{foo}}": "BAR", }, nil, }, "nested values": { map[string]interface{}{ "foo": map[string]string{ "bar": "{{upper `baz`}}", }, }, map[string]interface{}{ "foo": map[string]string{ "bar": "BAZ", }, }, nil, }, // this test fails if you get github.com/mitchellh/reflectwalk@v1.0.1 // the fail is caused by // https://github.com/mitchellh/reflectwalk/pull/22/commits/51d4c99fad9e9aa269e874bc3ad60313a574799f // TODO: open a PR to fix it. "nested value keys": { map[string]interface{}{ "foo": map[string]string{ "{{upper `bar`}}": "{{upper `baz`}}", }, }, map[string]interface{}{ "foo": map[string]string{ "BAR": "BAZ", }, }, nil, }, "filter": { map[string]interface{}{ "bar": "{{upper `baz`}}", "foo": map[string]string{ "{{upper `bar`}}": "{{upper `baz`}}", }, }, map[string]interface{}{ "bar": "BAZ", "foo": map[string]string{ "{{upper `bar`}}": "{{upper `baz`}}", }, }, &RenderFilter{ Include: []string{"bar"}, }, }, "filter case-insensitive": { map[string]interface{}{ "bar": "{{upper `baz`}}", "foo": map[string]string{ "{{upper `bar`}}": "{{upper `baz`}}", }, }, map[string]interface{}{ "bar": "BAZ", "foo": map[string]string{ "{{upper `bar`}}": "{{upper `baz`}}", }, }, &RenderFilter{ Include: []string{"baR"}, }, }, } ctx := &Context{} for k, tc := range cases { actual, err := RenderMap(tc.Input, ctx, tc.Filter) if err != nil { t.Fatalf("err: %s\n\n%s", k, err) } if !reflect.DeepEqual(actual, tc.Output) { t.Fatalf("err: %s\n\n%#v\n\n%#v", k, actual, tc.Output) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/parse.go������������������������������������������������0000664�0000000�0000000�00000035235�13771713062�0022267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package template import ( "bufio" "bytes" "encoding/json" "fmt" "io" "os" "path/filepath" "sort" "strings" multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/mitchellh/mapstructure" ) // rawTemplate is the direct JSON document format of the template file. // This is what is decoded directly from the file, and then it is turned // into a Template object thereafter. type rawTemplate struct { MinVersion string `mapstructure:"min_packer_version" json:"min_packer_version,omitempty"` Description string `json:"description,omitempty"` Builders []interface{} `mapstructure:"builders" json:"builders,omitempty"` Comments []map[string]string `json:"comments,omitempty"` Push map[string]interface{} `json:"push,omitempty"` PostProcessors []interface{} `mapstructure:"post-processors" json:"post-processors,omitempty"` Provisioners []interface{} `json:"provisioners,omitempty"` CleanupProvisioner interface{} `mapstructure:"error-cleanup-provisioner" json:"error-cleanup-provisioner,omitempty"` Variables map[string]interface{} `json:"variables,omitempty"` SensitiveVariables []string `mapstructure:"sensitive-variables" json:"sensitive-variables,omitempty"` RawContents []byte `json:"-"` } // MarshalJSON conducts the necessary flattening of the rawTemplate struct // to provide valid Packer template JSON func (r *rawTemplate) MarshalJSON() ([]byte, error) { // Avoid recursion type rawTemplate_ rawTemplate out, _ := json.Marshal(rawTemplate_(*r)) var m map[string]json.RawMessage _ = json.Unmarshal(out, &m) // Flatten Comments delete(m, "comments") for _, comment := range r.Comments { for k, v := range comment { out, _ = json.Marshal(v) m[k] = out } } return json.Marshal(m) } func (r *rawTemplate) decodeProvisioner(raw interface{}) (Provisioner, error) { var p Provisioner if err := r.weakDecoder(&p, nil).Decode(raw); err != nil { return p, fmt.Errorf("Error decoding provisioner: %s", err) } // Type is required before any richer validation if p.Type == "" { return p, fmt.Errorf("Provisioner missing 'type'") } // Set the raw configuration and delete any special keys p.Config = raw.(map[string]interface{}) delete(p.Config, "except") delete(p.Config, "only") delete(p.Config, "override") delete(p.Config, "pause_before") delete(p.Config, "max_retries") delete(p.Config, "type") delete(p.Config, "timeout") if len(p.Config) == 0 { p.Config = nil } return p, nil } // Template returns the actual Template object built from this raw // structure. func (r *rawTemplate) Template() (*Template, error) { var result Template var errs error // Copy some literals result.Description = r.Description result.MinVersion = r.MinVersion result.RawContents = r.RawContents // Gather the comments if len(r.Comments) > 0 { result.Comments = make(map[string]string, len(r.Comments)) for _, c := range r.Comments { for k, v := range c { result.Comments[k] = v } } } // Gather the variables if len(r.Variables) > 0 { result.Variables = make(map[string]*Variable, len(r.Variables)) } for k, rawV := range r.Variables { var v Variable v.Key = k // Variable is required if the value is exactly nil v.Required = rawV == nil // Weak decode the default if we have one if err := r.decoder(&v.Default, nil).Decode(rawV); err != nil { errs = multierror.Append(errs, fmt.Errorf( "variable %s: %s", k, err)) continue } for _, sVar := range r.SensitiveVariables { if sVar == k { result.SensitiveVariables = append(result.SensitiveVariables, &v) } } result.Variables[k] = &v } // Let's start by gathering all the builders if len(r.Builders) > 0 { result.Builders = make(map[string]*Builder, len(r.Builders)) } for i, rawB := range r.Builders { var b Builder if err := mapstructure.WeakDecode(rawB, &b); err != nil { errs = multierror.Append(errs, fmt.Errorf( "builder %d: %s", i+1, err)) continue } // Set the raw configuration and delete any special keys b.Config = rawB.(map[string]interface{}) delete(b.Config, "name") delete(b.Config, "type") if len(b.Config) == 0 { b.Config = nil } // If there is no type set, it is an error if b.Type == "" { errs = multierror.Append(errs, fmt.Errorf( "builder %d: missing 'type'", i+1)) continue } // The name defaults to the type if it isn't set if b.Name == "" { b.Name = b.Type } // If this builder already exists, it is an error if _, ok := result.Builders[b.Name]; ok { errs = multierror.Append(errs, fmt.Errorf( "builder %d: builder with name '%s' already exists", i+1, b.Name)) continue } // Append the builders result.Builders[b.Name] = &b } // Gather all the post-processors if len(r.PostProcessors) > 0 { result.PostProcessors = make([][]*PostProcessor, 0, len(r.PostProcessors)) } for i, v := range r.PostProcessors { // Parse the configurations. We need to do this because post-processors // can take three different formats. configs, err := r.parsePostProcessor(i, v) if err != nil { errs = multierror.Append(errs, err) continue } // Parse the PostProcessors out of the configs pps := make([]*PostProcessor, 0, len(configs)) for j, c := range configs { var pp PostProcessor if err := r.decoder(&pp, nil).Decode(c); err != nil { errs = multierror.Append(errs, fmt.Errorf( "post-processor %d.%d: %s", i+1, j+1, err)) continue } // Type is required if pp.Type == "" { errs = multierror.Append(errs, fmt.Errorf( "post-processor %d.%d: type is required", i+1, j+1)) continue } // Set the raw configuration and delete any special keys pp.Config = c // The name defaults to the type if it isn't set if pp.Name == "" { pp.Name = pp.Type } delete(pp.Config, "except") delete(pp.Config, "only") delete(pp.Config, "keep_input_artifact") delete(pp.Config, "type") delete(pp.Config, "name") if len(pp.Config) == 0 { pp.Config = nil } pps = append(pps, &pp) } result.PostProcessors = append(result.PostProcessors, pps) } // Gather all the provisioners if len(r.Provisioners) > 0 { result.Provisioners = make([]*Provisioner, 0, len(r.Provisioners)) } for i, v := range r.Provisioners { p, err := r.decodeProvisioner(v) if err != nil { errs = multierror.Append(errs, fmt.Errorf( "provisioner %d: %s", i+1, err)) continue } result.Provisioners = append(result.Provisioners, &p) } // Gather the error-cleanup-provisioner if r.CleanupProvisioner != nil { p, err := r.decodeProvisioner(r.CleanupProvisioner) if err != nil { errs = multierror.Append(errs, fmt.Errorf("On Error Cleanup Provisioner error: %s", err)) } result.CleanupProvisioner = &p } // If we have errors, return those with a nil result if errs != nil { return nil, errs } return &result, nil } func (r *rawTemplate) decoder( result interface{}, md *mapstructure.Metadata) *mapstructure.Decoder { d, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ DecodeHook: mapstructure.StringToTimeDurationHookFunc(), Metadata: md, Result: result, }) if err != nil { // This really shouldn't happen since we have firm control over // all the arguments and they're all unit tested. So we use a // panic here to note this would definitely be a bug. panic(err) } return d } func (r *rawTemplate) weakDecoder( result interface{}, md *mapstructure.Metadata) *mapstructure.Decoder { d, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ WeaklyTypedInput: true, DecodeHook: mapstructure.StringToTimeDurationHookFunc(), Metadata: md, Result: result, }) if err != nil { // This really shouldn't happen since we have firm control over // all the arguments and they're all unit tested. So we use a // panic here to note this would definitely be a bug. panic(err) } return d } func (r *rawTemplate) parsePostProcessor( i int, raw interface{}) ([]map[string]interface{}, error) { switch v := raw.(type) { case string: return []map[string]interface{}{ {"type": v}, }, nil case map[string]interface{}: return []map[string]interface{}{v}, nil case []interface{}: var err error result := make([]map[string]interface{}, len(v)) for j, innerRaw := range v { switch innerV := innerRaw.(type) { case string: result[j] = map[string]interface{}{"type": innerV} case map[string]interface{}: result[j] = innerV case []interface{}: err = multierror.Append(err, fmt.Errorf( "post-processor %d.%d: sequence not allowed to be nested in a sequence", i+1, j+1)) default: err = multierror.Append(err, fmt.Errorf( "post-processor %d.%d: unknown format", i+1, j+1)) } } if err != nil { return nil, err } return result, nil default: return nil, fmt.Errorf("post-processor %d: bad format", i+1) } } // Parse takes the given io.Reader and parses a Template object out of it. func Parse(r io.Reader) (*Template, error) { // First, decode the object into an interface{} and search for duplicate fields. // We do this instead of the rawTemplate directly because we'd rather use mapstructure to // decode since it has richer errors. var raw interface{} buf, err := jsonUnmarshal(r, &raw) if err != nil { return nil, err } // Create our decoder var md mapstructure.Metadata var rawTpl rawTemplate rawTpl.RawContents = buf.Bytes() decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ Metadata: &md, Result: &rawTpl, }) if err != nil { return nil, err } // Do the actual decode into our structure if err := decoder.Decode(raw); err != nil { return nil, err } // Build an error if there are unused root level keys if len(md.Unused) > 0 { sort.Strings(md.Unused) unusedMap, ok := raw.(map[string]interface{}) if !ok { return nil, fmt.Errorf("Failed to convert unused root level keys to map") } for _, unused := range md.Unused { if unused[0] == '_' { commentVal, ok := unusedMap[unused].(string) if !ok { return nil, fmt.Errorf("Failed to cast root level comment value in comment \"%s\" to string.", unused) } comment := map[string]string{ unused: commentVal, } rawTpl.Comments = append(rawTpl.Comments, comment) continue } err = multierror.Append(err, fmt.Errorf( "Unknown root level key in template: '%s'", unused)) } } if err != nil { return nil, err } // Return the template parsed from the raw structure return rawTpl.Template() } func jsonUnmarshal(r io.Reader, raw *interface{}) (bytes.Buffer, error) { // Create a buffer to copy what we read var buf bytes.Buffer if _, err := buf.ReadFrom(r); err != nil { return buf, err } // Decode the object into an interface{} if err := json.Unmarshal(buf.Bytes(), raw); err != nil { return buf, err } // If Json is valid, check for duplicate fields to avoid silent unwanted override jsonDecoder := json.NewDecoder(strings.NewReader(buf.String())) if err := checkForDuplicateFields(jsonDecoder); err != nil { return buf, err } return buf, nil } func checkForDuplicateFields(d *json.Decoder) error { // Get next token from JSON t, err := d.Token() if err != nil { return err } delim, ok := t.(json.Delim) // Do nothing if it's not a delimiter if !ok { return nil } // Check for duplicates inside of a delimiter {} or [] switch delim { case '{': keys := make(map[string]bool) for d.More() { // Get attribute key t, err := d.Token() if err != nil { return err } key := t.(string) // Check for duplicates if keys[key] { return fmt.Errorf("template has duplicate field: %s", key) } keys[key] = true // Check value to find duplicates in nested blocks if err := checkForDuplicateFields(d); err != nil { return err } } case '[': for d.More() { if err := checkForDuplicateFields(d); err != nil { return err } } } // consume closing delimiter } or ] if _, err := d.Token(); err != nil { return err } return nil } // ParseFile is the same as Parse but is a helper to automatically open // a file for parsing. func ParseFile(path string) (*Template, error) { var f *os.File var err error if path == "-" { // Create a temp file for stdin in case of errors f, err = tmp.File("parse") if err != nil { return nil, err } defer os.Remove(f.Name()) defer f.Close() if _, err = io.Copy(f, os.Stdin); err != nil { return nil, err } if _, err = f.Seek(0, io.SeekStart); err != nil { return nil, err } } else { f, err = os.Open(path) if err != nil { return nil, err } defer f.Close() } tpl, err := Parse(f) if err != nil { syntaxErr, ok := err.(*json.SyntaxError) if !ok { return nil, err } // Rewind the file and get a better error if _, err := f.Seek(0, io.SeekStart); err != nil { return nil, err } // Grab the error location, and return a string to point to offending syntax error line, col, highlight := highlightPosition(f, syntaxErr.Offset) err = fmt.Errorf("Error parsing JSON: %s\nAt line %d, column %d (offset %d):\n%s", err, line, col, syntaxErr.Offset, highlight) return nil, err } if !filepath.IsAbs(path) { path, err = filepath.Abs(path) if err != nil { return nil, err } } tpl.Path = path return tpl, nil } // Takes a file and the location in bytes of a parse error // from json.SyntaxError.Offset and returns the line, column, // and pretty-printed context around the error with an arrow indicating the exact // position of the syntax error. func highlightPosition(f *os.File, pos int64) (line, col int, highlight string) { // Modified version of the function in Camlistore by Brad Fitzpatrick // https://github.com/camlistore/camlistore/blob/4b5403dd5310cf6e1ae8feb8533fd59262701ebc/vendor/go4.org/errorutil/highlight.go line = 1 // New io.Reader for file br := bufio.NewReader(f) // Initialize lines lastLine := "" thisLine := new(bytes.Buffer) // Loop through template to find line, column for n := int64(0); n < pos; n++ { // read byte from io.Reader b, err := br.ReadByte() if err != nil { break } // If end of line, save line as previous line in case next line is offender if b == '\n' { lastLine = thisLine.String() thisLine.Reset() line++ col = 1 } else { // Write current line, until line is safe, or error point is encountered col++ thisLine.WriteByte(b) } } // Populate highlight string to place a '^' char at offending column if line > 1 { highlight += fmt.Sprintf("%5d: %s\n", line-1, lastLine) } highlight += fmt.Sprintf("%5d: %s\n", line, thisLine.String()) highlight += fmt.Sprintf("%s^\n", strings.Repeat(" ", col+5)) return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/parse_test.go�������������������������������������������0000664�0000000�0000000�00000024353�13771713062�0023325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !windows package template import ( "bytes" "encoding/json" "path/filepath" "reflect" "strings" "testing" "time" "github.com/google/go-cmp/cmp" ) func boolPointer(tf bool) *bool { return &tf } func TestParse(t *testing.T) { cases := []struct { File string Result *Template Err bool }{ /* * Builders */ { "parse-basic.json", &Template{ Builders: map[string]*Builder{ "something": { Name: "something", Type: "something", }, }, }, false, }, { "parse-basic-config.json", &Template{ Builders: map[string]*Builder{ "something": { Name: "something", Type: "something", Config: map[string]interface{}{ "foo": "bar", }, }, }, }, false, }, { "parse-builder-no-type.json", nil, true, }, { "parse-builder-repeat.json", nil, true, }, /* * Provisioners */ { "parse-provisioner-basic.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", }, }, }, false, }, { "parse-provisioner-config.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", Config: map[string]interface{}{ "inline": "echo 'foo'", }, }, }, }, false, }, { "parse-provisioner-pause-before.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", PauseBefore: 1 * time.Second, }, }, }, false, }, { "parse-provisioner-retry.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", MaxRetries: "5", }, }, }, false, }, { "parse-provisioner-timeout.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", Timeout: 5 * time.Minute, }, }, }, false, }, { "parse-provisioner-only.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", OnlyExcept: OnlyExcept{ Only: []string{"foo"}, }, }, }, }, false, }, { "parse-provisioner-except.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", OnlyExcept: OnlyExcept{ Except: []string{"foo"}, }, }, }, }, false, }, { "parse-provisioner-override.json", &Template{ Provisioners: []*Provisioner{ { Type: "something", Override: map[string]interface{}{ "foo": map[string]interface{}{}, }, }, }, }, false, }, { "parse-provisioner-no-type.json", nil, true, }, { "parse-variable-default.json", &Template{ Variables: map[string]*Variable{ "foo": { Default: "foo", Key: "foo", }, }, }, false, }, { "parse-variable-required.json", &Template{ Variables: map[string]*Variable{ "foo": { Required: true, Key: "foo", }, }, }, false, }, { "parse-pp-basic.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", Config: map[string]interface{}{ "foo": "bar", }, }, }, }, }, false, }, { "parse-pp-keep.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", KeepInputArtifact: boolPointer(true), }, }, }, }, false, }, { "parse-pp-only.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", OnlyExcept: OnlyExcept{ Only: []string{"bar"}, }, }, }, }, }, false, }, { "parse-pp-except.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", OnlyExcept: OnlyExcept{ Except: []string{"bar"}, }, }, }, }, }, false, }, { "parse-pp-string.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", }, }, }, }, false, }, { "parse-pp-map.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", }, }, }, }, false, }, { "parse-pp-slice.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", }, }, { { Name: "bar", Type: "bar", }, }, }, }, false, }, { "parse-pp-multi.json", &Template{ PostProcessors: [][]*PostProcessor{ { { Name: "foo", Type: "foo", }, { Name: "bar", Type: "bar", }, }, }, }, false, }, { "parse-pp-no-type.json", nil, true, }, { "parse-description.json", &Template{ Description: "foo", }, false, }, { "parse-min-version.json", &Template{ MinVersion: "1.2", }, false, }, { "parse-comment.json", &Template{ Builders: map[string]*Builder{ "something": { Name: "something", Type: "something", }, }, Comments: map[string]string{ "_info": "foo", }, }, false, }, { "parse-monolithic.json", &Template{ Comments: map[string]string{ "_comment": "comment", }, Description: "Description Test", MinVersion: "1.3.0", SensitiveVariables: []*Variable{ { Required: false, Key: "one", Default: "1", }, }, Variables: map[string]*Variable{ "one": { Required: false, Key: "one", Default: "1", }, "two": { Required: false, Key: "two", Default: "2", }, "three": { Required: true, Key: "three", Default: "", }, }, Builders: map[string]*Builder{ "amazon-ebs": { Name: "amazon-ebs", Type: "amazon-ebs", Config: map[string]interface{}{ "ami_name": "AMI Name", "instance_type": "t2.micro", "ssh_username": "ec2-user", "source_ami": "ami-aaaaaaaaaaaaaa", }, }, "docker": { Name: "docker", Type: "docker", Config: map[string]interface{}{ "image": "ubuntu", "export_path": "image.tar", }, }, }, Provisioners: []*Provisioner{ { Type: "shell", Config: map[string]interface{}{ "script": "script.sh", }, }, { Type: "shell", Config: map[string]interface{}{ "script": "script.sh", }, Override: map[string]interface{}{ "docker": map[string]interface{}{ "execute_command": "echo 'override'", }, }, }, }, PostProcessors: [][]*PostProcessor{ { { Name: "compress", Type: "compress", }, { Name: "vagrant", Type: "vagrant", OnlyExcept: OnlyExcept{ Only: []string{"docker"}, }, }, }, { { Name: "shell-local", Type: "shell-local", Config: map[string]interface{}{ "inline": []interface{}{"echo foo"}, }, OnlyExcept: OnlyExcept{ Except: []string{"amazon-ebs"}, }, }, }, }, }, false, }, } for i, tc := range cases { path, _ := filepath.Abs(fixtureDir(tc.File)) tpl, err := ParseFile(fixtureDir(tc.File)) if (err != nil) != tc.Err { t.Fatalf("%s\n\nerr: %s", tc.File, err) } if tc.Result != nil { tc.Result.Path = path } if tpl != nil { tpl.RawContents = nil } if diff := cmp.Diff(tpl, tc.Result); diff != "" { t.Fatalf("[%d]bad: %s\n%v", i, tc.File, diff) } // Only test template writing if the template is valid if tc.Err == false { // Get rawTemplate raw, err := tpl.Raw() if err != nil { t.Fatalf("Failed to convert back to raw template: %s\n\n%v\n\n%s", tc.File, tpl, err) } out, _ := json.MarshalIndent(raw, "", " ") if err != nil { t.Fatalf("Failed to marshal raw template: %s\n\n%v\n\n%s", tc.File, raw, err) } // Write JSON to a buffer (emulates filesystem write without dirtying the workspace) fileBuf := bytes.NewBuffer(out) // Parse the JSON template we wrote to our buffer tplRewritten, err := Parse(fileBuf) if err != nil { t.Fatalf("Failed to re-read marshalled template: %s\n\n%v\n\n%s\n\n%s", tc.File, tpl, out, err) } // Override the metadata we don't care about (file path, raw file contents) tplRewritten.Path = path tplRewritten.RawContents = nil // Test that our output raw template is functionally equal if !reflect.DeepEqual(tpl, tplRewritten) { t.Fatalf("Data lost when writing template to file: %s\n\n%v\n\n%v\n\n%s", tc.File, tpl, tplRewritten, out) } } } } func TestParse_contents(t *testing.T) { tpl, err := ParseFile(fixtureDir("parse-contents.json")) if err != nil { t.Fatalf("err: %s", err) } actual := strings.TrimSpace(string(tpl.RawContents)) expected := `{"builders":[{"type":"test"}]}` if actual != expected { t.Fatalf("bad: %s\n\n%s", actual, expected) } } func TestParse_bad(t *testing.T) { cases := []struct { File string Expected string }{ {"error-beginning.json", "line 1, column 1 (offset 1)"}, {"error-middle.json", "line 5, column 6 (offset 50)"}, {"error-end.json", "line 1, column 30 (offset 30)"}, {"malformed.json", "line 16, column 3 (offset 433)"}, } for _, tc := range cases { _, err := ParseFile(fixtureDir(tc.File)) if err == nil { t.Fatalf("expected error") } if !strings.Contains(err.Error(), tc.Expected) { t.Fatalf("file: %s\nExpected: %s\n%s\n", tc.File, tc.Expected, err.Error()) } } } func TestParse_checkForDuplicateFields(t *testing.T) { cases := []struct { File string Expected string }{ {"error-duplicate-variables.json", "template has duplicate field: variables"}, {"error-duplicate-config.json", "template has duplicate field: foo"}, } for _, tc := range cases { _, err := ParseFile(fixtureDir(tc.File)) if err == nil { t.Fatalf("expected error") } if !strings.Contains(err.Error(), tc.Expected) { t.Fatalf("file: %s\nExpected: %s\n%s\n", tc.File, tc.Expected, err.Error()) } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/template.go���������������������������������������������0000664�0000000�0000000�00000020270�13771713062�0022761�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Provisioner package template import ( "encoding/json" "errors" "fmt" "time" multierror "github.com/hashicorp/go-multierror" ) // Template represents the parsed template that is used to configure // Packer builds. type Template struct { // Path is the path to the template. This will be blank if Parse is // used, but will be automatically populated by ParseFile. Path string Description string MinVersion string Comments map[string]string Variables map[string]*Variable SensitiveVariables []*Variable Builders map[string]*Builder Provisioners []*Provisioner CleanupProvisioner *Provisioner PostProcessors [][]*PostProcessor // RawContents is just the raw data for this template RawContents []byte } // Raw converts a Template struct back into the raw Packer template structure func (t *Template) Raw() (*rawTemplate, error) { var out rawTemplate out.MinVersion = t.MinVersion out.Description = t.Description for k, v := range t.Comments { out.Comments = append(out.Comments, map[string]string{k: v}) } for _, b := range t.Builders { out.Builders = append(out.Builders, b) } for _, p := range t.Provisioners { out.Provisioners = append(out.Provisioners, p) } for _, pp := range t.PostProcessors { out.PostProcessors = append(out.PostProcessors, pp) } for _, v := range t.SensitiveVariables { out.SensitiveVariables = append(out.SensitiveVariables, v.Key) } for k, v := range t.Variables { if out.Variables == nil { out.Variables = make(map[string]interface{}) } out.Variables[k] = v } return &out, nil } // Builder represents a builder configured in the template type Builder struct { Name string `json:"name,omitempty"` Type string `json:"type"` Config map[string]interface{} `json:"config,omitempty"` } // MarshalJSON conducts the necessary flattening of the Builder struct // to provide valid Packer template JSON func (b *Builder) MarshalJSON() ([]byte, error) { // Avoid recursion type Builder_ Builder out, _ := json.Marshal(Builder_(*b)) var m map[string]json.RawMessage _ = json.Unmarshal(out, &m) // Flatten Config delete(m, "config") for k, v := range b.Config { out, _ = json.Marshal(v) m[k] = out } return json.Marshal(m) } // PostProcessor represents a post-processor within the template. type PostProcessor struct { OnlyExcept `mapstructure:",squash" json:",omitempty"` Name string `json:"name,omitempty"` Type string `json:"type"` KeepInputArtifact *bool `mapstructure:"keep_input_artifact" json:"keep_input_artifact,omitempty"` Config map[string]interface{} `json:"config,omitempty"` } // MarshalJSON conducts the necessary flattening of the PostProcessor struct // to provide valid Packer template JSON func (p *PostProcessor) MarshalJSON() ([]byte, error) { // Early exit for simple definitions if len(p.Config) == 0 && len(p.OnlyExcept.Only) == 0 && len(p.OnlyExcept.Except) == 0 && p.KeepInputArtifact == nil { return json.Marshal(p.Type) } // Avoid recursion type PostProcessor_ PostProcessor out, _ := json.Marshal(PostProcessor_(*p)) var m map[string]json.RawMessage _ = json.Unmarshal(out, &m) // Flatten Config delete(m, "config") for k, v := range p.Config { out, _ = json.Marshal(v) m[k] = out } return json.Marshal(m) } // Provisioner represents a provisioner within the template. type Provisioner struct { OnlyExcept `mapstructure:",squash" json:",omitempty"` Type string `json:"type"` Config map[string]interface{} `json:"config,omitempty"` Override map[string]interface{} `json:"override,omitempty"` PauseBefore time.Duration `mapstructure:"pause_before" json:"pause_before,omitempty"` MaxRetries string `mapstructure:"max_retries" json:"max_retries,omitempty"` Timeout time.Duration `mapstructure:"timeout" json:"timeout,omitempty"` } // MarshalJSON conducts the necessary flattening of the Provisioner struct // to provide valid Packer template JSON func (p *Provisioner) MarshalJSON() ([]byte, error) { // Avoid recursion type Provisioner_ Provisioner out, _ := json.Marshal(Provisioner_(*p)) var m map[string]json.RawMessage _ = json.Unmarshal(out, &m) // Flatten Config delete(m, "config") for k, v := range p.Config { out, _ = json.Marshal(v) m[k] = out } return json.Marshal(m) } // Push represents the configuration for pushing the template to Atlas. type Push struct { Name string Address string BaseDir string `mapstructure:"base_dir"` Include []string Exclude []string Token string VCS bool } // Variable represents a variable within the template type Variable struct { Key string Default string Required bool } func (v *Variable) MarshalJSON() ([]byte, error) { if v.Required { // We use a nil pointer to coax Go into marshalling it as a JSON null var ret *string return json.Marshal(ret) } return json.Marshal(v.Default) } // OnlyExcept is a struct that is meant to be embedded that contains the // logic required for "only" and "except" meta-parameters. type OnlyExcept struct { Only []string `json:"only,omitempty"` Except []string `json:"except,omitempty"` } //------------------------------------------------------------------- // Functions //------------------------------------------------------------------- // Validate does some basic validation of the template on top of the // validation that occurs while parsing. If possible, we try to defer // validation to here. The validation errors that occur during parsing // are the minimal necessary to make sure parsing builds a reasonable // Template structure. func (t *Template) Validate() error { var err error // At least one builder must be defined if len(t.Builders) == 0 { err = multierror.Append(err, errors.New( "at least one builder must be defined")) } // Verify that the provisioner overrides target builders that exist for i, p := range t.Provisioners { // Validate only/except if verr := p.OnlyExcept.Validate(t); verr != nil { for _, e := range multierror.Append(verr).Errors { err = multierror.Append(err, fmt.Errorf( "provisioner %d: %s", i+1, e)) } } // Validate overrides for name := range p.Override { if _, ok := t.Builders[name]; !ok { err = multierror.Append(err, fmt.Errorf( "provisioner %d: override '%s' doesn't exist", i+1, name)) } } } // Verify post-processors for i, chain := range t.PostProcessors { for j, p := range chain { // Validate only/except if verr := p.OnlyExcept.Validate(t); verr != nil { for _, e := range multierror.Append(verr).Errors { err = multierror.Append(err, fmt.Errorf( "post-processor %d.%d: %s", i+1, j+1, e)) } } } } return err } // Skip says whether or not to skip the build with the given name. func (o *OnlyExcept) Skip(n string) bool { if len(o.Only) > 0 { for _, v := range o.Only { if v == n { return false } } return true } if len(o.Except) > 0 { for _, v := range o.Except { if v == n { return true } } return false } return false } // Validate validates that the OnlyExcept settings are correct for a thing. func (o *OnlyExcept) Validate(t *Template) error { if len(o.Only) > 0 && len(o.Except) > 0 { return errors.New("only one of 'only' or 'except' may be specified") } var err error for _, n := range o.Only { if _, ok := t.Builders[n]; !ok { err = multierror.Append(err, fmt.Errorf( "'only' specified builder '%s' not found", n)) } } for _, n := range o.Except { if _, ok := t.Builders[n]; !ok { err = multierror.Append(err, fmt.Errorf( "'except' specified builder '%s' not found", n)) } } return err } //------------------------------------------------------------------- // GoStringer //------------------------------------------------------------------- func (b *Builder) GoString() string { return fmt.Sprintf("*%#v", *b) } func (p *Provisioner) GoString() string { return fmt.Sprintf("*%#v", *p) } func (p *PostProcessor) GoString() string { return fmt.Sprintf("*%#v", *p) } func (v *Variable) GoString() string { return fmt.Sprintf("*%#v", *v) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/template.hcl2spec.go������������������������������������0000664�0000000�0000000�00000004740�13771713062�0024467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Provisioner"; DO NOT EDIT. package template import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatProvisioner is an auto-generated flat version of Provisioner. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatProvisioner struct { Only []string `json:"only,omitempty" cty:"only" hcl:"only"` Except []string `json:"except,omitempty" cty:"except" hcl:"except"` Type *string `json:"type" cty:"type" hcl:"type"` Config map[string]interface{} `json:"config,omitempty" cty:"config" hcl:"config"` Override map[string]interface{} `json:"override,omitempty" cty:"override" hcl:"override"` PauseBefore *string `mapstructure:"pause_before" json:"pause_before,omitempty" cty:"pause_before" hcl:"pause_before"` MaxRetries *string `mapstructure:"max_retries" json:"max_retries,omitempty" cty:"max_retries" hcl:"max_retries"` Timeout *string `mapstructure:"timeout" json:"timeout,omitempty" cty:"timeout" hcl:"timeout"` } // FlatMapstructure returns a new FlatProvisioner. // FlatProvisioner is an auto-generated flat version of Provisioner. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Provisioner) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatProvisioner) } // HCL2Spec returns the hcl spec of a Provisioner. // This spec is used by HCL to read the fields of Provisioner. // The decoded values from this spec will then be applied to a FlatProvisioner. func (*FlatProvisioner) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "only": &hcldec.AttrSpec{Name: "only", Type: cty.List(cty.String), Required: false}, "except": &hcldec.AttrSpec{Name: "except", Type: cty.List(cty.String), Required: false}, "type": &hcldec.AttrSpec{Name: "type", Type: cty.String, Required: false}, "config": &hcldec.AttrSpec{Name: "config", Type: cty.Map(cty.String), Required: false}, "override": &hcldec.AttrSpec{Name: "override", Type: cty.Map(cty.String), Required: false}, "pause_before": &hcldec.AttrSpec{Name: "pause_before", Type: cty.String, Required: false}, "max_retries": &hcldec.AttrSpec{Name: "max_retries", Type: cty.String, Required: false}, "timeout": &hcldec.AttrSpec{Name: "timeout", Type: cty.String, Required: false}, } return s } ��������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/template_test.go����������������������������������������0000664�0000000�0000000�00000003502�13771713062�0024017�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package template import ( "os" "path/filepath" "testing" ) const FixturesDir = "./test-fixtures" // fixtureDir returns the path to a test fixtures directory func fixtureDir(n string) string { return filepath.Join(FixturesDir, n) } func TestTemplateValidate(t *testing.T) { cases := []struct { File string Err bool }{ { "validate-good-prov-timeout.json", false, }, { "validate-no-builders.json", true, }, { "validate-bad-override.json", true, }, { "validate-good-override.json", false, }, { "validate-bad-prov-only.json", true, }, { "validate-good-prov-only.json", false, }, { "validate-bad-prov-except.json", true, }, { "validate-good-prov-except.json", false, }, { "validate-bad-pp-only.json", true, }, { "validate-good-pp-only.json", false, }, { "validate-bad-pp-except.json", true, }, { "validate-good-pp-except.json", false, }, } for _, tc := range cases { f, err := os.Open(fixtureDir(tc.File)) if err != nil { t.Fatalf("err: %s", err) } tpl, err := Parse(f) f.Close() if err != nil { t.Fatalf("err: %s\n\n%s", tc.File, err) } err = tpl.Validate() if (err != nil) != tc.Err { t.Fatalf("err: %s\n\n%s", tc.File, err) } } } func TestOnlyExceptSkip(t *testing.T) { cases := []struct { Only, Except []string Input string Result bool }{ { []string{"foo"}, nil, "foo", false, }, { nil, []string{"foo"}, "foo", true, }, { nil, nil, "foo", false, }, } for _, tc := range cases { oe := &OnlyExcept{ Only: tc.Only, Except: tc.Except, } actual := oe.Skip(tc.Input) if actual != tc.Result { t.Fatalf( "bad: %#v\n\n%#v\n\n%#v\n\n%#v", actual, tc.Only, tc.Except, tc.Input) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023444�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/error-beginning.json����������������������0000664�0000000�0000000�00000000044�13771713062�0027424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*"builders": [ { "type":"test", }]} ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/error-duplicate-config.json���������������0000664�0000000�0000000�00000000200�13771713062�0030673�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "var": "value" }, "builders": [ { "foo": "something", "foo": "something" } ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/error-duplicate-variables.json������������0000664�0000000�0000000�00000000217�13771713062�0031406�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "var": "value" }, "variables": { "var": "value" }, "builders": [ { "foo": "something" } ] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/error-end.json����������������������������0000664�0000000�0000000�00000000037�13771713062�0026234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"builders":[{"type":"test"}]* �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/error-middle.json�������������������������0000664�0000000�0000000�00000000071�13771713062�0026722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ { "type":"test", } ] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/malformed.json����������������������������0000664�0000000�0000000�00000001047�13771713062�0026307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "access_key": "{{env `AWS_ACCESS_KEY_ID`}}", "secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}" }, "builders": [{ "type": "amazon-ebs", "access_key": "{{user `access_key`}}", "secret_key": "{{user `secret_key`}}", "region": "us-east-1", "source_ami": "ami-fce3c696,", "instance_type": "t2.micro", "ssh_username": "ubuntu", "ami_name": "packer-example {{timestamp}}" }] }] "provisioners": [{ "type": "shell", "inline": [ "sleep 15", "sudo yum update -y" ] }] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-basic-config.json�������������������0000664�0000000�0000000�00000000072�13771713062�0027772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{"type": "something", "foo": "bar"}] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-basic.json��������������������������0000664�0000000�0000000�00000000054�13771713062�0026527�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{"type": "something"}] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-builder-no-type.json����������������0000664�0000000�0000000�00000000053�13771713062�0030464�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{"foo": "something"}] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-builder-repeat.json�����������������0000664�0000000�0000000�00000000131�13771713062�0030346�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "something"}, {"type": "something"} ] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-comment.json������������������������0000664�0000000�0000000�00000000100�13771713062�0027100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "_info": "foo", "builders": [{"type": "something"}] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-contents.json�����������������������0000664�0000000�0000000�00000000037�13771713062�0027304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{"builders":[{"type":"test"}]} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-description.json��������������������0000664�0000000�0000000�00000000035�13771713062�0027770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "description": "foo" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-min-version.json��������������������0000664�0000000�0000000�00000000044�13771713062�0027713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "min_packer_version": "1.2" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-monolithic.json���������������������0000664�0000000�0000000�00000002036�13771713062�0027615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "_comment": "comment", "description": "Description Test", "min_packer_version": "1.3.0", "variables": { "one": "1", "two": "2", "three": null }, "sensitive-variables": ["one"], "builders": [ { "type": "amazon-ebs", "ami_name": "AMI Name", "instance_type": "t2.micro", "ssh_username": "ec2-user", "source_ami": "ami-aaaaaaaaaaaaaa" }, { "type": "docker", "image": "ubuntu", "export_path": "image.tar" } ], "provisioners": [ { "type": "shell", "script": "script.sh" }, { "type": "shell", "script": "script.sh", "override": { "docker": { "execute_command": "echo 'override'" } } } ], "post-processors": [ [ "compress", { "type": "vagrant", "only": ["docker"] } ], [ { "type": "shell-local", "inline": ["echo foo"], "except": ["amazon-ebs"] } ] ], "push": { "name": "push test" } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-basic.json�����������������������0000664�0000000�0000000�00000000121�13771713062�0027137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [{ "type": "foo", "foo": "bar" }] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-except.json����������������������0000664�0000000�0000000�00000000160�13771713062�0027351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [ { "type": "foo", "except": ["bar"] } ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-keep.json������������������������0000664�0000000�0000000�00000000140�13771713062�0027003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [{ "type": "foo", "keep_input_artifact": true }] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-map.json�������������������������0000664�0000000�0000000�00000000073�13771713062�0026641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [{ "type": "foo" }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-multi.json�����������������������0000664�0000000�0000000�00000000104�13771713062�0027211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [[{ "type": "foo" }, "bar"]] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-no-type.json���������������������0000664�0000000�0000000�00000000111�13771713062�0027450�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [{ "keep_input_artifact": true }] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-only.json������������������������0000664�0000000�0000000�00000000156�13771713062�0027047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [ { "type": "foo", "only": ["bar"] } ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-slice.json�����������������������0000664�0000000�0000000�00000000102�13771713062�0027154�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": [{ "type": "foo" }, "bar"] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-pp-string.json����������������������0000664�0000000�0000000�00000000043�13771713062�0027367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "post-processors": ["foo"] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-basic.json��������������0000664�0000000�0000000�00000000076�13771713062�0031110�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ {"type": "something"} ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-config.json�������������0000664�0000000�0000000�00000000124�13771713062�0031266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ {"type": "something","inline":"echo 'foo'"} ] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-except.json�������������0000664�0000000�0000000�00000000163�13771713062�0031314�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ { "type": "something", "except": ["foo"] } ] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-no-type.json������������0000664�0000000�0000000�00000000075�13771713062�0031421�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ {"foo": "something"} ] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-only.json���������������0000664�0000000�0000000�00000000161�13771713062�0031003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ { "type": "something", "only": ["foo"] } ] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-override.json�����������0000664�0000000�0000000�00000000227�13771713062�0031644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ { "type": "something", "override": { "foo": {} } } ] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-pause-before.json�������0000664�0000000�0000000�00000000166�13771713062�0032404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ { "type": "something", "pause_before": "1s" } ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-retry.json��������������0000664�0000000�0000000�00000000162�13771713062�0031170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ { "type": "something", "max_retries": 5 } ] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-provisioner-timeout.json������������0000664�0000000�0000000�00000000161�13771713062�0031510�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "provisioners": [ { "type": "something", "timeout": "5m" } ] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-variable-default.json���������������0000664�0000000�0000000�00000000062�13771713062�0030654�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "foo": "foo" } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/parse-variable-required.json��������������0000664�0000000�0000000�00000000061�13771713062�0031047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "foo": null } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-bad-override.json����������������0000664�0000000�0000000�00000000241�13771713062�0030466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "provisioners": [{ "type": "bar", "override": { "bar": {} } }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-bad-pp-except.json���������������0000664�0000000�0000000�00000000210�13771713062�0030550�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "post-processors": [{ "type": "bar", "except": ["bar"] }] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-bad-pp-only.json�����������������0000664�0000000�0000000�00000000206�13771713062�0030246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "post-processors": [{ "type": "bar", "only": ["bar"] }] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-bad-prov-except.json�������������0000664�0000000�0000000�00000000205�13771713062�0031123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "provisioners": [{ "type": "bar", "except": ["bar"] }] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-bad-prov-only.json���������������0000664�0000000�0000000�00000000203�13771713062�0030612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "provisioners": [{ "type": "bar", "only": ["bar"] }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-good-override.json���������������0000664�0000000�0000000�00000000241�13771713062�0030670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "provisioners": [{ "type": "bar", "override": { "foo": {} } }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-good-pp-except.json��������������0000664�0000000�0000000�00000000210�13771713062�0030752�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "post-processors": [{ "type": "bar", "except": ["foo"] }] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-good-pp-only.json����������������0000664�0000000�0000000�00000000206�13771713062�0030450�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "post-processors": [{ "type": "bar", "only": ["foo"] }] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-good-prov-except.json������������0000664�0000000�0000000�00000000205�13771713062�0031325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "provisioners": [{ "type": "bar", "except": ["foo"] }] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-good-prov-only.json��������������0000664�0000000�0000000�00000000203�13771713062�0031014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "provisioners": [{ "type": "bar", "only": ["foo"] }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-good-prov-timeout.json�����������0000664�0000000�0000000�00000000234�13771713062�0031525�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "foo" }], "provisioners": [{ "timeout": "5m", "type": "bar", "only": ["foo"] }] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/template/test-fixtures/validate-no-builders.json�����������������0000664�0000000�0000000�00000000003�13771713062�0030342�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021631�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/SomeDir/�������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023173�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/SomeDir/myfile.txt���������������������������������0000664�0000000�0000000�00000000000�13771713062�0025207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/decompress-tar/������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024561�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/decompress-tar/outside_parent.tar������������������0000664�0000000�0000000�00000024000�13771713062�0030312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������../demo.poc�����������������������������������������������������������������������������������������0000600�0000765�0000024�00000000033�13256232626�014007� 0����������������������������������������������������������������������������������������������������ustar �mitchellh�����������������������staff���������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh echo Hello World �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������main.tf���������������������������������������������������������������������������������������������0000600�0000765�0000024�00000000000�13256232626�013416� 0����������������������������������������������������������������������������������������������������ustar �mitchellh�����������������������staff���������������������������0000000�0000000����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppies/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023452�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppies/bar.bat�����������������������������������0000664�0000000�0000000�00000000044�13771713062�0024704�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Echo I am a floppy with a batch file��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppies/foo.ps1�����������������������������������0000664�0000000�0000000�00000000057�13771713062�0024664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Write-Host "I am a floppy with some Powershell"���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024067�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-0/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025203�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-0/file1���������������������������0000664�0000000�0000000�00000000000�13771713062�0026114�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-0/file2���������������������������0000664�0000000�0000000�00000000000�13771713062�0026115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-0/file3���������������������������0000664�0000000�0000000�00000000000�13771713062�0026116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-1/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025204�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-1/dir1/���������������������������0000775�0000000�0000000�00000000000�13771713062�0026043�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-1/dir1/file1����������������������0000664�0000000�0000000�00000000000�13771713062�0026754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-1/dir1/file2����������������������0000664�0000000�0000000�00000000000�13771713062�0026755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-1/dir1/file3����������������������0000664�0000000�0000000�00000000000�13771713062�0026756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025205�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/���������������������������0000775�0000000�0000000�00000000000�13771713062�0026044�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/file1����������������������0000664�0000000�0000000�00000000000�13771713062�0026755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/subdir1/�������������������0000775�0000000�0000000�00000000000�13771713062�0027415�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/subdir1/file1��������������0000664�0000000�0000000�00000000000�13771713062�0030326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir1/subdir1/file2��������������0000664�0000000�0000000�00000000000�13771713062�0030327�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir2/���������������������������0000775�0000000�0000000�00000000000�13771713062�0026045�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir2/subdir1/�������������������0000775�0000000�0000000�00000000000�13771713062�0027416�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir2/subdir1/file1��������������0000664�0000000�0000000�00000000000�13771713062�0030327�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/test-fixtures/floppy-hier/test-2/dir2/subdir1/file2��������������0000664�0000000�0000000�00000000000�13771713062�0030330�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/tmp/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017603�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/tmp/tmp.go�������������������������������������������������������0000664�0000000�0000000�00000003135�13771713062�0020734�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package tmp provides temporary directory helpers. // // tmp stores temporary items in the system's // temporary directory unless a corresponding // environment variable is set ( see os.TempDir ). // // On Unix systems, it uses $TMPDIR if non-empty, else /tmp. // On Windows, it uses GetTempPath, returning the first non-empty // value from %TMP%, %TEMP%, %USERPROFILE%, or the Windows directory. // On Plan 9, it returns /tmp. // // The directory is neither guaranteed to exist nor have accessible // permissions. package tmp import ( "io/ioutil" "os" ) var tmpDir = os.TempDir() // Dir creates a new temporary directory in the system temporary // directory with a name beginning with prefix and returns the path // of the new directory. // Multiple programs calling Dir simultaneously // will not choose the same directory. // It is the caller's responsibility // to remove the file when no longer needed. func Dir(prefix string) (string, error) { return ioutil.TempDir(tmpDir, prefix) } // File creates a new temporary file in the system temporary // directory, opens the file for reading and writing, and // returns the resulting *os.File. // The filename is generated by taking pattern and adding a random // string to the end. If pattern includes a "*", the random string // replaces the last "*". // Multiple programs calling File simultaneously // will not choose the same file. The caller can use f.Name() // to find the pathname of the file. It is the caller's responsibility // to remove the file when no longer needed. func File(pattern string) (*os.File, error) { return ioutil.TempFile(tmpDir, pattern) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/useragent/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021000�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/useragent/useragent.go�������������������������������������������0000664�0000000�0000000�00000001044�13771713062�0023323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package useragent import ( "fmt" "runtime" ) var ( // projectURL is the project URL. projectURL = "https://www.packer.io/" // rt is the runtime - variable for tests. rt = runtime.Version() // goos is the os - variable for tests. goos = runtime.GOOS // goarch is the architecture - variable for tests. goarch = runtime.GOARCH ) // String returns the consistent user-agent string for Packer. func String(packerVersion string) string { return fmt.Sprintf("Packer/%s (+%s; %s; %s/%s)", packerVersion, projectURL, rt, goos, goarch) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/useragent/useragent_test.go��������������������������������������0000664�0000000�0000000�00000000510�13771713062�0024357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package useragent import ( "testing" ) func TestUserAgent(t *testing.T) { projectURL = "https://packer-test.com" rt = "go5.0" goos = "linux" goarch = "amd64" act := String("1.2.3") exp := "Packer/1.2.3 (+https://packer-test.com; go5.0; linux/amd64)" if exp != act { t.Errorf("expected %q to be %q", act, exp) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/uuid/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017751�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/uuid/uuid.go�����������������������������������������������������0000664�0000000�0000000�00000000727�13771713062�0021254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package uuid import ( "crypto/rand" "fmt" "time" ) // Generates a time ordered UUID. Top 32 bits are a timestamp, // bottom 96 are random. func TimeOrderedUUID() string { unix := uint32(time.Now().UTC().Unix()) b := make([]byte, 12) n, err := rand.Read(b) if n != len(b) { err = fmt.Errorf("Not enough entropy available") } if err != nil { panic(err) } return fmt.Sprintf("%08x-%04x-%04x-%04x-%04x%08x", unix, b[0:2], b[2:4], b[4:6], b[6:8], b[8:]) } �����������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/uuid/uuid_test.go������������������������������������������������0000664�0000000�0000000�00000000240�13771713062�0022301�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package uuid import ( "testing" ) func TestTimeOrderedUuid(t *testing.T) { uuid := TimeOrderedUUID() if len(uuid) != 36 { t.Fatalf("bad: %s", uuid) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/version/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020470�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer-plugin-sdk/version/version.go�����������������������������������������������0000664�0000000�0000000�00000005143�13771713062�0022507�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Version helps plugin creators set and track the plugin version using the same // convenience functions used by the Packer core. package version import ( "bytes" "fmt" "github.com/hashicorp/go-version" ) // The git commit that was compiled. This will be filled in by the compiler. var GitCommit string // InitializePluginVersion initializes the SemVer and returns a version var. // If the provided "version" string is not valid, the call to version.Must // will panic. Therefore, this function should always be called in a package // init() function to make sure that plugins are following proper semantic // versioning and to make sure that plugins which aren't following proper // semantic versioning crash immediately rather than later. func InitializePluginVersion(vers, versionPrerelease string) *PluginVersion { pv := PluginVersion{ version: vers, versionPrerelease: versionPrerelease, } // This call initializes the SemVer to make sure that if Packer crashes due // to an invalid SemVer it's at the very beginning of the Packer run. pv.semVer = version.Must(version.NewVersion(vers)) return &pv } type PluginVersion struct { // The main version number that is being run at the moment. version string // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release // such as "dev" (in development), "beta", "rc1", etc. versionPrerelease string // The Semantic Version of the plugin. Used for version constraint comparisons semVer *version.Version } func (p *PluginVersion) FormattedVersion() string { var versionString bytes.Buffer fmt.Fprintf(&versionString, "%s", p.version) if p.versionPrerelease != "" { fmt.Fprintf(&versionString, "-%s", p.versionPrerelease) if GitCommit != "" { fmt.Fprintf(&versionString, " (%s)", GitCommit) } } return versionString.String() } func (p *PluginVersion) SemVer() *version.Version { if p.semVer != nil { // SemVer is an instance of version.Version. This has the secondary // benefit of verifying during tests and init time that our version is a // proper semantic version, which should always be the case. p.semVer = version.Must(version.NewVersion(p.version)) } return p.semVer } func (p *PluginVersion) GetVersion() string { return p.version } func (p *PluginVersion) GetVersionPrerelease() string { return p.versionPrerelease } // String returns the complete version string, including prerelease func (p *PluginVersion) String() string { if p.versionPrerelease != "" { return fmt.Sprintf("%s-%s", p.version, p.versionPrerelease) } return p.version } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/����������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0014730�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/build.go��������������������������������������������������������������������0000664�0000000�0000000�00000025361�13771713062�0016365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "fmt" "log" "sync" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" "github.com/hashicorp/packer/version" ) // A CoreBuild struct represents a single build job, the result of which should // be a single machine image artifact. This artifact may be comprised of // multiple files, of course, but it should be for only a single provider (such // as VirtualBox, EC2, etc.). type CoreBuild struct { BuildName string Type string Builder packersdk.Builder BuilderConfig interface{} BuilderType string hooks map[string][]packersdk.Hook Provisioners []CoreBuildProvisioner PostProcessors [][]CoreBuildPostProcessor CleanupProvisioner CoreBuildProvisioner TemplatePath string Variables map[string]string // Indicates whether the build is already initialized before calling Prepare(..) Prepared bool debug bool force bool onError string l sync.Mutex prepareCalled bool } // CoreBuildPostProcessor Keeps track of the post-processor and the // configuration of the post-processor used within a build. type CoreBuildPostProcessor struct { PostProcessor packersdk.PostProcessor PType string PName string config map[string]interface{} KeepInputArtifact *bool } // CoreBuildProvisioner keeps track of the provisioner and the configuration of // the provisioner within the build. type CoreBuildProvisioner struct { PType string PName string Provisioner packersdk.Provisioner config []interface{} } // Returns the name of the build. func (b *CoreBuild) Name() string { if b.BuildName != "" { return b.BuildName + "." + b.Type } return b.Type } // Prepare prepares the build by doing some initialization for the builder // and any hooks. This _must_ be called prior to Run. The parameter is the // overrides for the variables within the template (if any). func (b *CoreBuild) Prepare() (warn []string, err error) { // For HCL2 templates, the builder and hooks are initialized when the // template is parsed. Calling Prepare(...) is not necessary if b.Prepared { b.prepareCalled = true return } b.l.Lock() defer b.l.Unlock() if b.prepareCalled { panic("prepare already called") } // Templates loaded from HCL2 will never get here. TODO: move this code into // a custom json area instead of just aborting early for HCL. b.prepareCalled = true packerConfig := map[string]interface{}{ common.BuildNameConfigKey: b.Type, common.BuilderTypeConfigKey: b.BuilderType, common.CoreVersionConfigKey: version.FormattedVersion(), common.DebugConfigKey: b.debug, common.ForceConfigKey: b.force, common.OnErrorConfigKey: b.onError, common.TemplatePathKey: b.TemplatePath, common.UserVariablesConfigKey: b.Variables, } // Prepare the builder generatedVars, warn, err := b.Builder.Prepare(b.BuilderConfig, packerConfig) if err != nil { log.Printf("Build '%s' prepare failure: %s\n", b.Type, err) return } // If the builder has provided a list of to-be-generated variables that // should be made accessible to provisioners, pass that list into // the provisioner prepare() so that the provisioner can appropriately // validate user input against what will become available. generatedPlaceholderMap := BasicPlaceholderData() if generatedVars != nil { for _, k := range generatedVars { generatedPlaceholderMap[k] = fmt.Sprintf("Build_%s. "+ packerbuilderdata.PlaceholderMsg, k) } } // Prepare the provisioners for _, coreProv := range b.Provisioners { configs := make([]interface{}, len(coreProv.config), len(coreProv.config)+1) copy(configs, coreProv.config) configs = append(configs, packerConfig) configs = append(configs, generatedPlaceholderMap) if err = coreProv.Provisioner.Prepare(configs...); err != nil { return } } // Prepare the on-error-cleanup provisioner if b.CleanupProvisioner.PType != "" { configs := make([]interface{}, len(b.CleanupProvisioner.config), len(b.CleanupProvisioner.config)+1) copy(configs, b.CleanupProvisioner.config) configs = append(configs, packerConfig) configs = append(configs, generatedPlaceholderMap) err = b.CleanupProvisioner.Provisioner.Prepare(configs...) if err != nil { return } } // Prepare the post-processors for _, ppSeq := range b.PostProcessors { for _, corePP := range ppSeq { err = corePP.PostProcessor.Configure(corePP.config, packerConfig, generatedPlaceholderMap) if err != nil { return } } } return } // Runs the actual build. Prepare must be called prior to running this. func (b *CoreBuild) Run(ctx context.Context, originalUi packersdk.Ui) ([]packersdk.Artifact, error) { if !b.prepareCalled { panic("Prepare must be called first") } // Copy the hooks hooks := make(map[string][]packersdk.Hook) for hookName, hookList := range b.hooks { hooks[hookName] = make([]packersdk.Hook, len(hookList)) copy(hooks[hookName], hookList) } // Add a hook for the provisioners if we have provisioners if len(b.Provisioners) > 0 { hookedProvisioners := make([]*HookedProvisioner, len(b.Provisioners)) for i, p := range b.Provisioners { var pConfig interface{} if len(p.config) > 0 { pConfig = p.config[0] } if b.debug { hookedProvisioners[i] = &HookedProvisioner{ &DebuggedProvisioner{Provisioner: p.Provisioner}, pConfig, p.PType, } } else { hookedProvisioners[i] = &HookedProvisioner{ p.Provisioner, pConfig, p.PType, } } } if _, ok := hooks[packersdk.HookProvision]; !ok { hooks[packersdk.HookProvision] = make([]packersdk.Hook, 0, 1) } hooks[packersdk.HookProvision] = append(hooks[packersdk.HookProvision], &ProvisionHook{ Provisioners: hookedProvisioners, }) } if b.CleanupProvisioner.PType != "" { hookedCleanupProvisioner := &HookedProvisioner{ b.CleanupProvisioner.Provisioner, b.CleanupProvisioner.config, b.CleanupProvisioner.PType, } hooks[packersdk.HookCleanupProvision] = []packersdk.Hook{&ProvisionHook{ Provisioners: []*HookedProvisioner{hookedCleanupProvisioner}, }} } hook := &packersdk.DispatchHook{Mapping: hooks} artifacts := make([]packersdk.Artifact, 0, 1) // The builder just has a normal Ui, but targeted builderUi := &TargetedUI{ Target: b.Name(), Ui: originalUi, } log.Printf("Running builder: %s", b.BuilderType) ts := CheckpointReporter.AddSpan(b.BuilderType, "builder", b.BuilderConfig) builderArtifact, err := b.Builder.Run(ctx, builderUi, hook) ts.End(err) if err != nil { return nil, err } // If there was no result, don't worry about running post-processors // because there is nothing they can do, just return. if builderArtifact == nil { return nil, nil } errors := make([]error, 0) keepOriginalArtifact := len(b.PostProcessors) == 0 select { case <-ctx.Done(): log.Println("Build was cancelled. Skipping post-processors.") return nil, nil default: } // Run the post-processors PostProcessorRunSeqLoop: for _, ppSeq := range b.PostProcessors { priorArtifact := builderArtifact for i, corePP := range ppSeq { ppUi := &TargetedUI{ Target: fmt.Sprintf("%s (%s)", b.Name(), corePP.PType), Ui: originalUi, } if corePP.PName == corePP.PType { builderUi.Say(fmt.Sprintf("Running post-processor: %s", corePP.PType)) } else { builderUi.Say(fmt.Sprintf("Running post-processor: %s (type %s)", corePP.PName, corePP.PType)) } ts := CheckpointReporter.AddSpan(corePP.PType, "post-processor", corePP.config) artifact, defaultKeep, forceOverride, err := corePP.PostProcessor.PostProcess(ctx, ppUi, priorArtifact) ts.End(err) if err != nil { errors = append(errors, fmt.Errorf("Post-processor failed: %s", err)) continue PostProcessorRunSeqLoop } if artifact == nil { log.Println("Nil artifact, halting post-processor chain.") continue PostProcessorRunSeqLoop } keep := defaultKeep // When user has not set keep_input_artifact // corePP.keepInputArtifact is nil. // In this case, use the keepDefault provided by the postprocessor. // When user _has_ set keep_input_artifact, go with that instead. // Exception: for postprocessors that will fail/become // useless if keep isn't true, heed forceOverride and keep the // input artifact regardless of user preference. if corePP.KeepInputArtifact != nil { if defaultKeep && *corePP.KeepInputArtifact == false && forceOverride { log.Printf("The %s post-processor forces "+ "keep_input_artifact=true to preserve integrity of the"+ "build chain. User-set keep_input_artifact=false will be"+ "ignored.", corePP.PType) } else { // User overrides default. keep = *corePP.KeepInputArtifact } } if i == 0 { // This is the first post-processor. We handle deleting // previous artifacts a bit different because multiple // post-processors may be using the original and need it. if !keepOriginalArtifact && keep { log.Printf( "Flagging to keep original artifact from post-processor '%s'", corePP.PType) keepOriginalArtifact = true } } else { // We have a prior artifact. If we want to keep it, we append // it to the results list. Otherwise, we destroy it. if keep { artifacts = append(artifacts, priorArtifact) } else { log.Printf("Deleting prior artifact from post-processor '%s'", corePP.PType) if err := priorArtifact.Destroy(); err != nil { log.Printf("Error is %#v", err) errors = append(errors, fmt.Errorf("Failed cleaning up prior artifact: %s; pp is %s", err, corePP.PType)) } } } priorArtifact = artifact } // Add on the last artifact to the results if priorArtifact != nil { artifacts = append(artifacts, priorArtifact) } } if keepOriginalArtifact { artifacts = append(artifacts, nil) copy(artifacts[1:], artifacts) artifacts[0] = builderArtifact } else { log.Printf("Deleting original artifact for build '%s'", b.Type) if err := builderArtifact.Destroy(); err != nil { errors = append(errors, fmt.Errorf("Error destroying builder artifact: %s; bad artifact: %#v", err, builderArtifact.Files())) } } if len(errors) > 0 { err = &packersdk.MultiError{Errors: errors} } return artifacts, err } func (b *CoreBuild) SetDebug(val bool) { if b.prepareCalled { panic("prepare has already been called") } b.debug = val } func (b *CoreBuild) SetForce(val bool) { if b.prepareCalled { panic("prepare has already been called") } b.force = val } func (b *CoreBuild) SetOnError(val string) { if b.prepareCalled { panic("prepare has already been called") } b.onError = val } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/build_test.go���������������������������������������������������������������0000664�0000000�0000000�00000031327�13771713062�0017423�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "reflect" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" "github.com/hashicorp/packer/version" ) func boolPointer(tf bool) *bool { return &tf } func testBuild() *CoreBuild { return &CoreBuild{ Type: "test", Builder: &packersdk.MockBuilder{ArtifactId: "b"}, BuilderConfig: 42, BuilderType: "foo", hooks: map[string][]packersdk.Hook{ "foo": {&packersdk.MockHook{}}, }, Provisioners: []CoreBuildProvisioner{ { PType: "mock-provisioner", Provisioner: &packersdk.MockProvisioner{}, config: []interface{}{42}}, }, PostProcessors: [][]CoreBuildPostProcessor{ { {&MockPostProcessor{ArtifactId: "pp"}, "testPP", "testPPName", make(map[string]interface{}), boolPointer(true)}, }, }, Variables: make(map[string]string), onError: "cleanup", } } func testDefaultPackerConfig() map[string]interface{} { return map[string]interface{}{ common.BuildNameConfigKey: "test", common.BuilderTypeConfigKey: "foo", common.CoreVersionConfigKey: version.FormattedVersion(), common.DebugConfigKey: false, common.ForceConfigKey: false, common.OnErrorConfigKey: "cleanup", common.TemplatePathKey: "", common.UserVariablesConfigKey: make(map[string]string), } } func TestBuild_Name(t *testing.T) { build := testBuild() if build.Name() != "test" { t.Fatalf("bad: %s", build.Name()) } } func TestBuild_Prepare(t *testing.T) { packerConfig := testDefaultPackerConfig() build := testBuild() builder := build.Builder.(*packersdk.MockBuilder) build.Prepare() if !builder.PrepareCalled { t.Fatal("should be called") } if !reflect.DeepEqual(builder.PrepareConfig, []interface{}{42, packerConfig}) { t.Fatalf("bad: %#v", builder.PrepareConfig) } coreProv := build.Provisioners[0] prov := coreProv.Provisioner.(*packersdk.MockProvisioner) if !prov.PrepCalled { t.Fatal("prep should be called") } if !reflect.DeepEqual(prov.PrepConfigs, []interface{}{42, packerConfig, BasicPlaceholderData()}) { t.Fatalf("bad: %#v", prov.PrepConfigs) } corePP := build.PostProcessors[0][0] pp := corePP.PostProcessor.(*MockPostProcessor) if !pp.ConfigureCalled { t.Fatal("should be called") } if !reflect.DeepEqual(pp.ConfigureConfigs, []interface{}{make(map[string]interface{}), packerConfig, BasicPlaceholderData()}) { t.Fatalf("bad: %#v", pp.ConfigureConfigs) } } func TestBuild_Prepare_SkipWhenBuilderAlreadyInitialized(t *testing.T) { build := testBuild() builder := build.Builder.(*packersdk.MockBuilder) build.Prepared = true build.Prepare() if builder.PrepareCalled { t.Fatal("should not be called") } } func TestBuild_Prepare_Twice(t *testing.T) { build := testBuild() warn, err := build.Prepare() if len(warn) > 0 { t.Fatalf("bad: %#v", warn) } if err != nil { t.Fatalf("bad error: %s", err) } defer func() { p := recover() if p == nil { t.Fatalf("should've paniced") } if p.(string) != "prepare already called" { t.Fatalf("Invalid panic: %s", p) } }() build.Prepare() } func TestBuildPrepare_BuilderWarnings(t *testing.T) { expected := []string{"foo"} build := testBuild() builder := build.Builder.(*packersdk.MockBuilder) builder.PrepareWarnings = expected warn, err := build.Prepare() if err != nil { t.Fatalf("err: %s", err) } if !reflect.DeepEqual(warn, expected) { t.Fatalf("bad: %#v", warn) } } func TestBuild_Prepare_Debug(t *testing.T) { packerConfig := testDefaultPackerConfig() packerConfig[common.DebugConfigKey] = true build := testBuild() builder := build.Builder.(*packersdk.MockBuilder) build.SetDebug(true) build.Prepare() if !builder.PrepareCalled { t.Fatalf("should be called") } if !reflect.DeepEqual(builder.PrepareConfig, []interface{}{42, packerConfig}) { t.Fatalf("bad: %#v", builder.PrepareConfig) } coreProv := build.Provisioners[0] prov := coreProv.Provisioner.(*packersdk.MockProvisioner) if !prov.PrepCalled { t.Fatal("prepare should be called") } if !reflect.DeepEqual(prov.PrepConfigs, []interface{}{42, packerConfig, BasicPlaceholderData()}) { t.Fatalf("bad: %#v", prov.PrepConfigs) } } func TestBuildPrepare_variables_default(t *testing.T) { packerConfig := testDefaultPackerConfig() packerConfig[common.UserVariablesConfigKey] = map[string]string{ "foo": "bar", } build := testBuild() build.Variables["foo"] = "bar" builder := build.Builder.(*packersdk.MockBuilder) warn, err := build.Prepare() if len(warn) > 0 { t.Fatalf("bad: %#v", warn) } if err != nil { t.Fatalf("err: %s", err) } if !builder.PrepareCalled { t.Fatal("prepare should be called") } if !reflect.DeepEqual(builder.PrepareConfig[1], packerConfig) { t.Fatalf("prepare bad: %#v", builder.PrepareConfig[1]) } } func TestBuildPrepare_ProvisionerGetsGeneratedMap(t *testing.T) { packerConfig := testDefaultPackerConfig() build := testBuild() builder := build.Builder.(*packersdk.MockBuilder) builder.GeneratedVars = []string{"PartyVar"} build.Prepare() if !builder.PrepareCalled { t.Fatalf("should be called") } if !reflect.DeepEqual(builder.PrepareConfig, []interface{}{42, packerConfig}) { t.Fatalf("bad: %#v", builder.PrepareConfig) } coreProv := build.Provisioners[0] prov := coreProv.Provisioner.(*packersdk.MockProvisioner) if !prov.PrepCalled { t.Fatal("prepare should be called") } generated := BasicPlaceholderData() generated["PartyVar"] = "Build_PartyVar. " + packerbuilderdata.PlaceholderMsg if !reflect.DeepEqual(prov.PrepConfigs, []interface{}{42, packerConfig, generated}) { t.Fatalf("bad: %#v", prov.PrepConfigs) } } func TestBuild_Run(t *testing.T) { ui := testUi() build := testBuild() build.Prepare() ctx := context.Background() artifacts, err := build.Run(ctx, ui) if err != nil { t.Fatalf("err: %s", err) } if len(artifacts) != 2 { t.Fatalf("bad: %#v", artifacts) } // Verify builder was run builder := build.Builder.(*packersdk.MockBuilder) if !builder.RunCalled { t.Fatal("should be called") } // Verify hooks are dispatchable dispatchHook := builder.RunHook dispatchHook.Run(ctx, "foo", nil, nil, 42) hook := build.hooks["foo"][0].(*packersdk.MockHook) if !hook.RunCalled { t.Fatal("should be called") } if hook.RunData != 42 { t.Fatalf("bad: %#v", hook.RunData) } // Verify provisioners run err = dispatchHook.Run(ctx, packersdk.HookProvision, nil, new(packersdk.MockCommunicator), 42) if err != nil { t.Fatalf("should not have errored") } prov := build.Provisioners[0].Provisioner.(*packersdk.MockProvisioner) if !prov.ProvCalled { t.Fatal("should be called") } // Verify post-processor was run pp := build.PostProcessors[0][0].PostProcessor.(*MockPostProcessor) if !pp.PostProcessCalled { t.Fatal("should be called") } } func TestBuild_Run_Artifacts(t *testing.T) { ui := testUi() // Test case: Test that with no post-processors, we only get the // main build. build := testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{} build.Prepare() artifacts, err := build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } expectedIds := []string{"b"} artifactIds := make([]string, len(artifacts)) for i, artifact := range artifacts { artifactIds[i] = artifact.Id() } if !reflect.DeepEqual(artifactIds, expectedIds) { t.Fatalf("unexpected ids: %#v", artifactIds) } // Test case: Test that with a single post-processor that doesn't keep // inputs, only that post-processors results are returned. build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { {&MockPostProcessor{ArtifactId: "pp"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, }, } build.Prepare() artifacts, err = build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } expectedIds = []string{"pp"} artifactIds = make([]string, len(artifacts)) for i, artifact := range artifacts { artifactIds[i] = artifact.Id() } if !reflect.DeepEqual(artifactIds, expectedIds) { t.Fatalf("unexpected ids: %#v", artifactIds) } // Test case: Test that with multiple post-processors, as long as one // keeps the original, the original is kept. build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { {&MockPostProcessor{ArtifactId: "pp1"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, }, { {&MockPostProcessor{ArtifactId: "pp2"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(true)}, }, } build.Prepare() artifacts, err = build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } expectedIds = []string{"b", "pp1", "pp2"} artifactIds = make([]string, len(artifacts)) for i, artifact := range artifacts { artifactIds[i] = artifact.Id() } if !reflect.DeepEqual(artifactIds, expectedIds) { t.Fatalf("unexpected ids: %#v", artifactIds) } // Test case: Test that with sequences, intermediaries are kept if they // want to be. build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { {&MockPostProcessor{ArtifactId: "pp1a"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, {&MockPostProcessor{ArtifactId: "pp1b"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(true)}, }, { {&MockPostProcessor{ArtifactId: "pp2a"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, {&MockPostProcessor{ArtifactId: "pp2b"}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false)}, }, } build.Prepare() artifacts, err = build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } expectedIds = []string{"pp1a", "pp1b", "pp2b"} artifactIds = make([]string, len(artifacts)) for i, artifact := range artifacts { artifactIds[i] = artifact.Id() } if !reflect.DeepEqual(artifactIds, expectedIds) { t.Fatalf("unexpected ids: %#v", artifactIds) } // Test case: Test that with a single post-processor that forcibly // keeps inputs, that the artifacts are kept. build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { { &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: true}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false), }, }, } build.Prepare() artifacts, err = build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } expectedIds = []string{"b", "pp"} artifactIds = make([]string, len(artifacts)) for i, artifact := range artifacts { artifactIds[i] = artifact.Id() } if !reflect.DeepEqual(artifactIds, expectedIds) { t.Fatalf("unexpected ids: %#v", artifactIds) } // Test case: Test that with a single post-processor that non-forcibly // keeps inputs, that the artifacts are discarded if user overrides. build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { { &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: false}, "pp", "testPPName", make(map[string]interface{}), boolPointer(false), }, }, } build.Prepare() artifacts, err = build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } expectedIds = []string{"pp"} artifactIds = make([]string, len(artifacts)) for i, artifact := range artifacts { artifactIds[i] = artifact.Id() } if !reflect.DeepEqual(artifactIds, expectedIds) { t.Fatalf("unexpected ids: %#v", artifactIds) } // Test case: Test that with a single post-processor that non-forcibly // keeps inputs, that the artifacts are kept if user does not have preference. build = testBuild() build.PostProcessors = [][]CoreBuildPostProcessor{ { { &MockPostProcessor{ArtifactId: "pp", Keep: true, ForceOverride: false}, "pp", "testPPName", make(map[string]interface{}), nil, }, }, } build.Prepare() artifacts, err = build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } expectedIds = []string{"b", "pp"} artifactIds = make([]string, len(artifacts)) for i, artifact := range artifacts { artifactIds[i] = artifact.Id() } if !reflect.DeepEqual(artifactIds, expectedIds) { t.Fatalf("unexpected ids: %#v", artifactIds) } } func TestBuild_RunBeforePrepare(t *testing.T) { defer func() { p := recover() if p == nil { t.Fatal("should panic") } if p.(string) != "Prepare must be called first" { t.Fatalf("bad: %s", p.(string)) } }() testBuild().Run(context.Background(), testUi()) } func TestBuild_Cancel(t *testing.T) { build := testBuild() build.Prepare() topCtx, topCtxCancel := context.WithCancel(context.Background()) builder := build.Builder.(*packersdk.MockBuilder) builder.RunFn = func(ctx context.Context) { topCtxCancel() } _, err := build.Run(topCtx, testUi()) if err == nil { t.Fatal("build should err") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/builder_test.go�������������������������������������������������������������0000664�0000000�0000000�00000000017�13771713062�0017742�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/core.go���������������������������������������������������������������������0000664�0000000�0000000�00000055043�13771713062�0016216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "encoding/json" "fmt" "log" "regexp" "sort" "strconv" "strings" ttmp "text/template" "github.com/google/go-cmp/cmp" multierror "github.com/hashicorp/go-multierror" version "github.com/hashicorp/go-version" "github.com/hashicorp/hcl/v2" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // Core is the main executor of Packer. If Packer is being used as a // library, this is the struct you'll want to instantiate to get anything done. type Core struct { Template *template.Template components ComponentFinder variables map[string]string builds map[string]*template.Builder version string secrets []string except []string only []string } // CoreConfig is the structure for initializing a new Core. Once a CoreConfig // is used to initialize a Core, it shouldn't be re-used or modified again. type CoreConfig struct { Components ComponentFinder Template *template.Template Variables map[string]string SensitiveVariables []string Version string // These are set by command-line flags Except []string Only []string } // The function type used to lookup Builder implementations. type BuilderFunc func(name string) (packersdk.Builder, error) // The function type used to lookup Hook implementations. type HookFunc func(name string) (packersdk.Hook, error) // The function type used to lookup PostProcessor implementations. type PostProcessorFunc func(name string) (packersdk.PostProcessor, error) // The function type used to lookup Provisioner implementations. type ProvisionerFunc func(name string) (packersdk.Provisioner, error) type BasicStore interface { Has(name string) bool List() (names []string) } type BuilderStore interface { BasicStore Start(name string) (packersdk.Builder, error) } type ProvisionerStore interface { BasicStore Start(name string) (packersdk.Provisioner, error) } type PostProcessorStore interface { BasicStore Start(name string) (packersdk.PostProcessor, error) } // ComponentFinder is a struct that contains the various function // pointers necessary to look up components of Packer such as builders, // commands, etc. type ComponentFinder struct { Hook HookFunc // For HCL2 BuilderStore BuilderStore ProvisionerStore ProvisionerStore PostProcessorStore PostProcessorStore } // NewCore creates a new Core. func NewCore(c *CoreConfig) *Core { core := &Core{ Template: c.Template, components: c.Components, variables: c.Variables, version: c.Version, only: c.Only, except: c.Except, } return core } func (core *Core) Initialize() error { if err := core.validate(); err != nil { return err } if err := core.init(); err != nil { return err } for _, secret := range core.secrets { packersdk.LogSecretFilter.Set(secret) } // Go through and interpolate all the build names. We should be able // to do this at this point with the variables. core.builds = make(map[string]*template.Builder) for _, b := range core.Template.Builders { v, err := interpolate.Render(b.Name, core.Context()) if err != nil { return fmt.Errorf( "Error interpolating builder '%s': %s", b.Name, err) } core.builds[v] = b } return nil } // BuildNames returns the builds that are available in this configured core. func (c *Core) BuildNames(only, except []string) []string { sort.Strings(only) sort.Strings(except) c.except = except c.only = only r := make([]string, 0, len(c.builds)) for n := range c.builds { onlyPos := sort.SearchStrings(only, n) foundInOnly := onlyPos < len(only) && only[onlyPos] == n if len(only) > 0 && !foundInOnly { continue } if pos := sort.SearchStrings(except, n); pos < len(except) && except[pos] == n { continue } r = append(r, n) } sort.Strings(r) return r } func (c *Core) generateCoreBuildProvisioner(rawP *template.Provisioner, rawName string) (CoreBuildProvisioner, error) { // Get the provisioner cbp := CoreBuildProvisioner{} provisioner, err := c.components.ProvisionerStore.Start(rawP.Type) if err != nil { return cbp, fmt.Errorf( "error initializing provisioner '%s': %s", rawP.Type, err) } if provisioner == nil { return cbp, fmt.Errorf( "provisioner type not found: %s", rawP.Type) } // Get the configuration config := make([]interface{}, 1, 2) config[0] = rawP.Config if rawP.Override != nil { if override, ok := rawP.Override[rawName]; ok { config = append(config, override) } } // If we're pausing, we wrap the provisioner in a special pauser. if rawP.PauseBefore != 0 { provisioner = &PausedProvisioner{ PauseBefore: rawP.PauseBefore, Provisioner: provisioner, } } else if rawP.Timeout != 0 { provisioner = &TimeoutProvisioner{ Timeout: rawP.Timeout, Provisioner: provisioner, } } maxRetries := 0 if rawP.MaxRetries != "" { renderedMaxRetries, err := interpolate.Render(rawP.MaxRetries, c.Context()) if err != nil { return cbp, fmt.Errorf("failed to interpolate `max_retries`: %s", err.Error()) } maxRetries, err = strconv.Atoi(renderedMaxRetries) if err != nil { return cbp, fmt.Errorf("`max_retries` must be a valid integer: %s", err.Error()) } } if maxRetries != 0 { provisioner = &RetriedProvisioner{ MaxRetries: maxRetries, Provisioner: provisioner, } } cbp = CoreBuildProvisioner{ PType: rawP.Type, Provisioner: provisioner, config: config, } return cbp, nil } // This is used for json templates to launch the build plugins. // They will be prepared via b.Prepare() later. func (c *Core) GetBuilds(opts GetBuildsOptions) ([]packersdk.Build, hcl.Diagnostics) { buildNames := c.BuildNames(opts.Only, opts.Except) builds := []packersdk.Build{} diags := hcl.Diagnostics{} for _, n := range buildNames { b, err := c.Build(n) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Failed to initialize build %q", n), Detail: err.Error(), }) continue } // Now that build plugin has been launched, call Prepare() log.Printf("Preparing build: %s", b.Name()) b.SetDebug(opts.Debug) b.SetForce(opts.Force) b.SetOnError(opts.OnError) warnings, err := b.Prepare() if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Failed to prepare build: %q", n), Detail: err.Error(), }) continue } // Only append builds to list if the Prepare() is successful. builds = append(builds, b) if len(warnings) > 0 { for _, warning := range warnings { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagWarning, Summary: fmt.Sprintf("Warning when preparing build: %q", n), Detail: warning, }) } } } return builds, diags } // Build returns the Build object for the given name. func (c *Core) Build(n string) (packersdk.Build, error) { // Setup the builder configBuilder, ok := c.builds[n] if !ok { return nil, fmt.Errorf("no such build found: %s", n) } // BuilderStore = config.Builders, gathered in loadConfig() in main.go // For reference, the builtin BuilderStore is generated in // packer/config.go in the Discover() func. // the Start command launches the builder plugin of the given type without // calling Prepare() or passing any build-specific details. builder, err := c.components.BuilderStore.Start(configBuilder.Type) if err != nil { return nil, fmt.Errorf( "error initializing builder '%s': %s", configBuilder.Type, err) } if builder == nil { return nil, fmt.Errorf( "builder type not found: %s", configBuilder.Type) } // rawName is the uninterpolated name that we use for various lookups rawName := configBuilder.Name // Setup the provisioners for this build provisioners := make([]CoreBuildProvisioner, 0, len(c.Template.Provisioners)) for _, rawP := range c.Template.Provisioners { // If we're skipping this, then ignore it if rawP.OnlyExcept.Skip(rawName) { continue } cbp, err := c.generateCoreBuildProvisioner(rawP, rawName) if err != nil { return nil, err } provisioners = append(provisioners, cbp) } var cleanupProvisioner CoreBuildProvisioner if c.Template.CleanupProvisioner != nil { // This is a special instantiation of the shell-local provisioner that // is only run on error at end of provisioning step before other step // cleanup occurs. cleanupProvisioner, err = c.generateCoreBuildProvisioner(c.Template.CleanupProvisioner, rawName) if err != nil { return nil, err } } // Setup the post-processors postProcessors := make([][]CoreBuildPostProcessor, 0, len(c.Template.PostProcessors)) for _, rawPs := range c.Template.PostProcessors { current := make([]CoreBuildPostProcessor, 0, len(rawPs)) for _, rawP := range rawPs { if rawP.Skip(rawName) { continue } // -except skips post-processor & build foundExcept := false for _, except := range c.except { if except != "" && except == rawP.Name { foundExcept = true } } if foundExcept { break } // Get the post-processor postProcessor, err := c.components.PostProcessorStore.Start(rawP.Type) if err != nil { return nil, fmt.Errorf( "error initializing post-processor '%s': %s", rawP.Type, err) } if postProcessor == nil { return nil, fmt.Errorf( "post-processor type not found: %s", rawP.Type) } current = append(current, CoreBuildPostProcessor{ PostProcessor: postProcessor, PType: rawP.Type, PName: rawP.Name, config: rawP.Config, KeepInputArtifact: rawP.KeepInputArtifact, }) } // If we have no post-processors in this chain, just continue. if len(current) == 0 { continue } postProcessors = append(postProcessors, current) } // TODO hooks one day // Return a structure that contains the plugins, their types, variables, and // the raw builder config loaded from the json template return &CoreBuild{ Type: n, Builder: builder, BuilderConfig: configBuilder.Config, BuilderType: configBuilder.Type, PostProcessors: postProcessors, Provisioners: provisioners, CleanupProvisioner: cleanupProvisioner, TemplatePath: c.Template.Path, Variables: c.variables, }, nil } // Context returns an interpolation context. func (c *Core) Context() *interpolate.Context { return &interpolate.Context{ TemplatePath: c.Template.Path, UserVariables: c.variables, } } var ConsoleHelp = strings.TrimSpace(` Packer console JSON Mode. The Packer console allows you to experiment with Packer interpolations. You may access variables in the Packer config you called the console with. Type in the interpolation to test and hit <enter> to see the result. "variables" will dump all available variables and their values. "{{timestamp}}" will output the timestamp, for example "1559855090". To exit the console, type "exit" and hit <enter>, or use Control-C. /!\ If you would like to start console in hcl2 mode without a config you can use the --config-type=hcl2 option. `) func (c *Core) EvaluateExpression(line string) (string, bool, hcl.Diagnostics) { switch { case line == "": return "", false, nil case line == "exit": return "", true, nil case line == "help": return ConsoleHelp, false, nil case line == "variables": varsstring := "\n" for k, v := range c.Context().UserVariables { varsstring += fmt.Sprintf("%s: %+v,\n", k, v) } return varsstring, false, nil default: ctx := c.Context() rendered, err := interpolate.Render(line, ctx) var diags hcl.Diagnostics if err != nil { diags = append(diags, &hcl.Diagnostic{ Summary: "Interpolation error", Detail: err.Error(), }) } return rendered, false, diags } } func (c *Core) InspectConfig(opts InspectConfigOptions) int { // Convenience... ui := opts.Ui tpl := c.Template ui.Say("Packer Inspect: JSON mode") // Description if tpl.Description != "" { ui.Say("Description:\n") ui.Say(tpl.Description + "\n") } // Variables if len(tpl.Variables) == 0 { ui.Say("Variables:\n") ui.Say(" <No variables>") } else { requiredHeader := false for k, v := range tpl.Variables { for _, sensitive := range tpl.SensitiveVariables { if ok := strings.Compare(sensitive.Default, v.Default); ok == 0 { v.Default = "<sensitive>" } } if v.Required { if !requiredHeader { requiredHeader = true ui.Say("Required variables:\n") } ui.Machine("template-variable", k, v.Default, "1") ui.Say(" " + k) } } if requiredHeader { ui.Say("") } ui.Say("Optional variables and their defaults:\n") keys := make([]string, 0, len(tpl.Variables)) max := 0 for k := range tpl.Variables { keys = append(keys, k) if len(k) > max { max = len(k) } } sort.Strings(keys) for _, k := range keys { v := tpl.Variables[k] if v.Required { continue } for _, sensitive := range tpl.SensitiveVariables { if ok := strings.Compare(sensitive.Default, v.Default); ok == 0 { v.Default = "<sensitive>" } } padding := strings.Repeat(" ", max-len(k)) output := fmt.Sprintf(" %s%s = %s", k, padding, v.Default) ui.Machine("template-variable", k, v.Default, "0") ui.Say(output) } } ui.Say("") // Builders ui.Say("Builders:\n") if len(tpl.Builders) == 0 { ui.Say(" <No builders>") } else { keys := make([]string, 0, len(tpl.Builders)) max := 0 for k := range tpl.Builders { keys = append(keys, k) if len(k) > max { max = len(k) } } sort.Strings(keys) for _, k := range keys { v := tpl.Builders[k] padding := strings.Repeat(" ", max-len(k)) output := fmt.Sprintf(" %s%s", k, padding) if v.Name != v.Type { output = fmt.Sprintf("%s (%s)", output, v.Type) } ui.Machine("template-builder", k, v.Type) ui.Say(output) } } ui.Say("") // Provisioners ui.Say("Provisioners:\n") if len(tpl.Provisioners) == 0 { ui.Say(" <No provisioners>") } else { for _, v := range tpl.Provisioners { ui.Machine("template-provisioner", v.Type) ui.Say(fmt.Sprintf(" %s", v.Type)) } } ui.Say("\nNote: If your build names contain user variables or template\n" + "functions such as 'timestamp', these are processed at build time,\n" + "and therefore only show in their raw form here.") return 0 } func (c *Core) FixConfig(opts FixConfigOptions) hcl.Diagnostics { var diags hcl.Diagnostics // Remove once we have support for the Inplace FixConfigMode if opts.Mode != Diff { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("FixConfig only supports template diff; FixConfigMode %d not supported", opts.Mode), }) return diags } var rawTemplateData map[string]interface{} input := make(map[string]interface{}) templateData := make(map[string]interface{}) if err := json.Unmarshal(c.Template.RawContents, &rawTemplateData); err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("unable to read the contents of the JSON configuration file: %s", err), Detail: err.Error(), }) return diags } // Hold off on Diff for now - need to think about displaying to user. // delete empty top-level keys since the fixers seem to add them // willy-nilly for k := range input { ml, ok := input[k].([]map[string]interface{}) if !ok { continue } if len(ml) == 0 { delete(input, k) } } // marshal/unmarshal to make comparable to templateData var fixedData map[string]interface{} // Guaranteed to be valid json, so we can ignore errors j, _ := json.Marshal(input) if err := json.Unmarshal(j, &fixedData); err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("unable to read the contents of the JSON configuration file: %s", err), Detail: err.Error(), }) return diags } if diff := cmp.Diff(templateData, fixedData); diff != "" { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Fixable configuration found.\nPlease run `packer fix` to get your build to run correctly.\nSee debug log for more information.", Detail: diff, }) } return diags } // validate does a full validation of the template. // // This will automatically call template.validate() in addition to doing // richer semantic checks around variables and so on. func (c *Core) validate() error { // First validate the template in general, we can't do anything else // unless the template itself is valid. if err := c.Template.Validate(); err != nil { return err } // Validate the minimum version is satisfied if c.Template.MinVersion != "" { versionActual, err := version.NewVersion(c.version) if err != nil { // This shouldn't happen since we set it via the compiler panic(err) } versionMin, err := version.NewVersion(c.Template.MinVersion) if err != nil { return fmt.Errorf( "min_version is invalid: %s", err) } if versionActual.LessThan(versionMin) { return fmt.Errorf( "This template requires Packer version %s or higher; using %s", versionMin, versionActual) } } // Validate variables are set var err error for n, v := range c.Template.Variables { if v.Required { if _, ok := c.variables[n]; !ok { err = multierror.Append(err, fmt.Errorf( "required variable not set: %s", n)) } } } // TODO: validate all builders exist // TODO: ^^ provisioner // TODO: ^^ post-processor return err } func isDoneInterpolating(v string) (bool, error) { // Check for whether the var contains any more references to `user`, wrapped // in interpolation syntax. filter := `{{\s*user\s*\x60.*\x60\s*}}` matched, err := regexp.MatchString(filter, v) if err != nil { return false, fmt.Errorf("Can't tell if interpolation is done: %s", err) } if matched { // not done interpolating; there's still a call to "user" in a template // engine return false, nil } // No more calls to "user" as a template engine, so we're done. return true, nil } func (c *Core) renderVarsRecursively() (*interpolate.Context, error) { ctx := c.Context() ctx.EnableEnv = true ctx.UserVariables = make(map[string]string) shouldRetry := true changed := false failedInterpolation := "" // Why this giant loop? User variables can be recursively defined. For // example: // "variables": { // "foo": "bar", // "baz": "{{user `foo`}}baz", // "bang": "bang{{user `baz`}}" // }, // In this situation, we cannot guarantee that we've added "foo" to // UserVariables before we try to interpolate "baz" the first time. We need // to have the option to loop back over in order to add the properly // interpolated "baz" to the UserVariables map. // Likewise, we'd need to loop up to two times to properly add "bang", // since that depends on "baz" being set, which depends on "foo" being set. // We break out of the while loop either if all our variables have been // interpolated or if after 100 loops we still haven't succeeded in // interpolating them. Please don't actually nest your variables in 100 // layers of other variables. Please. // c.Template.Variables is populated by variables defined within the Template // itself // c.variables is populated by variables read in from the command line and // var-files. // We need to read the keys from both, then loop over all of them to figure // out the appropriate interpolations. repeatMap := make(map[string]string) allKeys := make([]string, 0) // load in template variables for k, v := range c.Template.Variables { repeatMap[k] = v.Default allKeys = append(allKeys, k) } // overwrite template variables with command-line-read variables for k, v := range c.variables { repeatMap[k] = v allKeys = append(allKeys, k) } // sort map to force the following loop to be deterministic. sort.Strings(allKeys) type keyValue struct { Key string Value string } sortedMap := make([]keyValue, len(repeatMap)) for _, k := range allKeys { sortedMap = append(sortedMap, keyValue{k, repeatMap[k]}) } // Regex to exclude any build function variable or template variable // from interpolating earlier // E.g.: {{ .HTTPIP }} won't interpolate now renderFilter := "{{(\\s|)\\.(.*?)(\\s|)}}" for i := 0; i < 100; i++ { shouldRetry = false changed = false deleteKeys := []string{} // First, loop over the variables in the template for _, kv := range sortedMap { // Interpolate the default renderedV, err := interpolate.RenderRegex(kv.Value, ctx, renderFilter) switch err.(type) { case nil: // We only get here if interpolation has succeeded, so something is // different in this loop than in the last one. changed = true c.variables[kv.Key] = renderedV ctx.UserVariables = c.variables // Remove fully-interpolated variables from the map, and flag // variables that still need interpolating for a repeat. done, err := isDoneInterpolating(kv.Value) if err != nil { return ctx, err } if done { deleteKeys = append(deleteKeys, kv.Key) } else { shouldRetry = true } case ttmp.ExecError: castError := err.(ttmp.ExecError) if strings.Contains(castError.Error(), interpolate.ErrVariableNotSetString) { shouldRetry = true failedInterpolation = fmt.Sprintf(`"%s": "%s"; error: %s`, kv.Key, kv.Value, err) } else { return ctx, err } default: return ctx, fmt.Errorf( // unexpected interpolation error: abort the run "error interpolating default value for '%s': %s", kv.Key, err) } } if !shouldRetry { break } // Clear completed vars from sortedMap before next loop. Do this one // key at a time because the indices are gonna change ever time you // delete from the map. for _, k := range deleteKeys { for ind, kv := range sortedMap { if kv.Key == k { log.Printf("Deleting kv.Value: %s", kv.Value) sortedMap = append(sortedMap[:ind], sortedMap[ind+1:]...) break } } } deleteKeys = []string{} } if !changed && shouldRetry { return ctx, fmt.Errorf("Failed to interpolate %s: Please make sure that "+ "the variable you're referencing has been defined; Packer treats "+ "all variables used to interpolate other user variables as "+ "required.", failedInterpolation) } return ctx, nil } func (c *Core) init() error { if c.variables == nil { c.variables = make(map[string]string) } // Go through the variables and interpolate the environment and // user variables ctx, err := c.renderVarsRecursively() if err != nil { return err } for _, v := range c.Template.SensitiveVariables { secret := ctx.UserVariables[v.Key] c.secrets = append(c.secrets, secret) } return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/core_test.go����������������������������������������������������������������0000664�0000000�0000000�00000047635�13771713062�0017265�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "errors" "os" "path/filepath" "reflect" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template" configHelper "github.com/hashicorp/packer/packer-plugin-sdk/template/config" ) func TestCoreBuildNames(t *testing.T) { cases := []struct { File string Vars map[string]string Result []string }{ { "build-names-basic.json", nil, []string{"something"}, }, { "build-names-func.json", nil, []string{"TUBES"}, }, } for _, tc := range cases { tpl, err := template.ParseFile(fixtureDir(tc.File)) if err != nil { t.Fatalf("err: %s\n\n%s", tc.File, err) } core := NewCore(&CoreConfig{ Template: tpl, Variables: tc.Vars, }) err = core.Initialize() if err != nil { t.Fatalf("err: %s\n\n%s", tc.File, err) } names := core.BuildNames(nil, nil) if !reflect.DeepEqual(names, tc.Result) { t.Fatalf("err: %s\n\n%#v", tc.File, names) } } } func TestCoreBuild_basic(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-basic.json")) b := TestBuilder(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } artifact, err := build.Run(context.Background(), nil) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != b.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } } func TestCoreBuild_basicInterpolated(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-basic-interpolated.json")) b := TestBuilder(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("NAME") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } artifact, err := build.Run(context.Background(), nil) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != b.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } } func TestCoreBuild_env(t *testing.T) { os.Setenv("PACKER_TEST_ENV", "test") defer os.Setenv("PACKER_TEST_ENV", "") config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-env.json")) b := TestBuilder(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } // Interpolate the config var result map[string]interface{} err = configHelper.Decode(&result, nil, b.PrepareConfig...) if err != nil { t.Fatalf("err: %s", err) } if result["value"] != "test" { t.Fatalf("bad: %#v", result) } } func TestCoreBuild_IgnoreTemplateVariables(t *testing.T) { os.Setenv("PACKER_TEST_ENV", "test") defer os.Setenv("PACKER_TEST_ENV", "") config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-ignore-template-variable.json")) core := TestCore(t, config) if core.variables["http_ip"] != "{{ .HTTPIP }}" { t.Fatalf("bad: User variable http_ip={{ .HTTPIP }} should not be interpolated") } if core.variables["var"] != "test_{{ .PACKER_TEST_TEMP }}" { t.Fatalf("bad: User variable var should be half interpolated to var=test_{{ .PACKER_TEST_TEMP }} but was var=%s", core.variables["var"]) } if core.variables["array_var"] != "us-west-1,us-west-2" { t.Fatalf("bad: User variable array_var should be \"us-west-1,us-west-2\" but was %s", core.variables["var"]) } build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } } func TestCoreBuild_buildNameVar(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-var-build-name.json")) b := TestBuilder(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } // Interpolate the config var result map[string]interface{} err = configHelper.Decode(&result, nil, b.PrepareConfig...) if err != nil { t.Fatalf("err: %s", err) } if result["value"] != "test" { t.Fatalf("bad: %#v", result) } } func TestCoreBuild_buildTypeVar(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-var-build-type.json")) b := TestBuilder(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } // Interpolate the config var result map[string]interface{} err = configHelper.Decode(&result, nil, b.PrepareConfig...) if err != nil { t.Fatalf("err: %s", err) } if result["value"] != "test" { t.Fatalf("bad: %#v", result) } } func TestCoreBuild_nonExist(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-basic.json")) TestBuilder(t, config, "test") core := TestCore(t, config) _, err := core.Build("nope") if err == nil { t.Fatal("should error") } } func TestCoreBuild_prov(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-prov.json")) b := TestBuilder(t, config, "test") p := TestProvisioner(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } artifact, err := build.Run(context.Background(), nil) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != b.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } if !p.ProvCalled { t.Fatal("provisioner not called") } } func TestCoreBuild_provSkip(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-prov-skip.json")) b := TestBuilder(t, config, "test") p := TestProvisioner(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } artifact, err := build.Run(context.Background(), nil) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != b.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } if p.ProvCalled { t.Fatal("provisioner should not be called") } } func TestCoreBuild_provSkipInclude(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-prov-skip-include.json")) b := TestBuilder(t, config, "test") p := TestProvisioner(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } artifact, err := build.Run(context.Background(), nil) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != b.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } if !p.ProvCalled { t.Fatal("provisioner should be called") } } func TestCoreBuild_provOverride(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-prov-override.json")) b := TestBuilder(t, config, "test") p := TestProvisioner(t, config, "test") core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } artifact, err := build.Run(context.Background(), nil) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != b.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } if !p.ProvCalled { t.Fatal("provisioner not called") } found := false for _, raw := range p.PrepConfigs { if m, ok := raw.(map[string]interface{}); ok { if _, ok := m["foo"]; ok { found = true break } } } if !found { t.Fatal("override not called") } } func TestCoreBuild_postProcess(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-pp.json")) b := TestBuilder(t, config, "test") p := TestPostProcessor(t, config, "test") core := TestCore(t, config) ui := TestUi(t) b.ArtifactId = "hello" p.ArtifactId = "goodbye" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } artifact, err := build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != p.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } if p.PostProcessArtifact.Id() != b.ArtifactId { t.Fatalf("bad: %s", p.PostProcessArtifact.Id()) } } func TestCoreBuild_templatePath(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-template-path.json")) b := TestBuilder(t, config, "test") core := TestCore(t, config) expected, _ := filepath.Abs("./test-fixtures") build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } // Interpolate the config var result map[string]interface{} err = configHelper.Decode(&result, nil, b.PrepareConfig...) if err != nil { t.Fatalf("err: %s", err) } if result["value"] != expected { t.Fatalf("bad: %#v", result) } } func TestCoreValidate(t *testing.T) { cases := []struct { File string Vars map[string]string Err bool }{ {"validate-dup-builder.json", nil, true}, // Required variable not set {"validate-req-variable.json", nil, true}, {"validate-req-variable.json", map[string]string{"foo": "bar"}, false}, // Min version good {"validate-min-version.json", map[string]string{"foo": "bar"}, false}, {"validate-min-version-high.json", map[string]string{"foo": "bar"}, true}, } for _, tc := range cases { f, err := os.Open(fixtureDir(tc.File)) if err != nil { t.Fatalf("err: %s", err) } tpl, err := template.Parse(f) f.Close() if err != nil { t.Fatalf("err: %s\n\n%s", tc.File, err) } core := NewCore(&CoreConfig{ Template: tpl, Variables: tc.Vars, Version: "1.0.0", }) err = core.Initialize() if (err != nil) != tc.Err { t.Fatalf("err: %s\n\n%s", tc.File, err) } } } // Tests that we can properly interpolate user variables defined within the // packer template func TestCore_InterpolateUserVars(t *testing.T) { cases := []struct { File string Expected map[string]string Err bool }{ { "build-variables-interpolate.json", map[string]string{ "foo": "bar", "bar": "bar", "baz": "barbaz", "bang": "bangbarbaz", }, false, }, { "build-variables-interpolate2.json", map[string]string{}, true, }, } for _, tc := range cases { f, err := os.Open(fixtureDir(tc.File)) if err != nil { t.Fatalf("err: %s", err) } tpl, err := template.Parse(f) f.Close() if err != nil { t.Fatalf("err: %s\n\n%s", tc.File, err) } ccf := NewCore(&CoreConfig{ Template: tpl, Version: "1.0.0", }) err = ccf.Initialize() if (err != nil) != tc.Err { if tc.Err == false { t.Fatalf("Error interpolating %s: Expected no error, but got: %s", tc.File, err) } else { t.Fatalf("Error interpolating %s: Expected an error, but got: %s", tc.File, err) } } if !tc.Err { for k, v := range ccf.variables { if tc.Expected[k] != v { t.Fatalf("Expected %s but got %s", tc.Expected[k], v) } } } } } // Tests that we can properly interpolate user variables defined within a // var-file provided alongside the Packer template func TestCore_InterpolateUserVars_VarFile(t *testing.T) { cases := []struct { File string Variables map[string]string Expected map[string]string Err bool }{ { // tests that we can interpolate from var files when var isn't set in // originating template "build-basic-interpolated.json", map[string]string{ "name": "gotta-{{user `my_var`}}", "my_var": "interpolate-em-all", }, map[string]string{ "name": "gotta-interpolate-em-all", "my_var": "interpolate-em-all"}, false, }, { // tests that we can interpolate from var files when var is set in // originating template as required "build-basic-interpolated-required.json", map[string]string{ "name": "gotta-{{user `my_var`}}", "my_var": "interpolate-em-all", }, map[string]string{ "name": "gotta-interpolate-em-all", "my_var": "interpolate-em-all"}, false, }, } for _, tc := range cases { f, err := os.Open(fixtureDir(tc.File)) if err != nil { t.Fatalf("err: %s", err) } tpl, err := template.Parse(f) f.Close() if err != nil { t.Fatalf("err: %s\n\n%s", tc.File, err) } ccf := NewCore(&CoreConfig{ Template: tpl, Version: "1.0.0", Variables: tc.Variables, }) err = ccf.Initialize() if (err != nil) != tc.Err { t.Fatalf("err: %s\n\n%s", tc.File, err) } if !tc.Err { for k, v := range ccf.variables { if tc.Expected[k] != v { t.Fatalf("Expected value %s for key %s but got %s", tc.Expected[k], k, v) } } } } } func TestSensitiveVars(t *testing.T) { cases := []struct { File string Vars map[string]string SensitiveVars []string Expected string Err bool }{ // hardcoded { "sensitive-variables.json", map[string]string{"foo": "bar_extra_sensitive_probably_a_password"}, []string{"foo"}, "the foo jumped over the <sensitive>", false, }, // interpolated { "sensitive-variables.json", map[string]string{"foo": "bar_extra_sensitive_probably_a_password", "bang": "{{ user `foo`}}"}, []string{"bang"}, "the foo jumped over the <sensitive>", false, }, } for _, tc := range cases { f, err := os.Open(fixtureDir(tc.File)) if err != nil { t.Fatalf("err: %s", err) } tpl, err := template.Parse(f) f.Close() if err != nil { t.Fatalf("err: %s\n\n%s", tc.File, err) } ccf := NewCore(&CoreConfig{ Template: tpl, Variables: tc.Vars, Version: "1.0.0", }) err = ccf.Initialize() if (err != nil) != tc.Err { t.Fatalf("err: %s\n\n%s", tc.File, err) } // Check that filter correctly manipulates strings: filtered := packersdk.LogSecretFilter.FilterString("the foo jumped over the bar_extra_sensitive_probably_a_password") if filtered != tc.Expected { t.Fatalf("not filtering sensitive vars; filtered is %#v", filtered) } } } // Normally I wouldn't test a little helper function, but it's regex. func TestIsDoneInterpolating(t *testing.T) { cases := []struct { inputString string expectedBool bool expectedErr bool }{ // Many of these tests are just exercising the regex to make sure it // doesnt get confused by different kinds of whitespace {"charmander-{{ user `spacesaroundticks` }}", false, false}, {"pidgey-{{ user `partyparrot`}}", false, false}, {"jigglypuff-{{ user`notickspaaces`}}", false, false}, {"eevee-{{user`nospaces`}}", false, false}, {"staryu-{{ user `somanyspaces` }}", false, false}, {"{{ user `somanyspaces` }}-{{isotime}}", false, false}, // Make sure that we only flag on "user" when it's in the right set of // brackets, in a properly declared template engine format {"missingno-{{ user `missingbracket` }", true, false}, {"missing2-{user ``missingopenbrackets }}", true, false}, {"wat-userjustinname", true, false}, // Any functions that aren't "user" should have already been properly // interpolated by the time this is called, so these cases aren't // realistic. That said, this makes it clear that this function doesn't // care about anything but the user function {"pokemon-{{ isotime }}", true, false}, {"squirtle-{{ env `water`}}", true, false}, {"bulbasaur-notinterpolated", true, false}, {"extra-{{thisfunc `user`}}", true, false}, } for _, tc := range cases { done, err := isDoneInterpolating(tc.inputString) if (err != nil) != tc.expectedErr { t.Fatalf("Test case failed. Error: %s expected error: "+ "%t test string: %s", err, tc.expectedErr, tc.inputString) } if done != tc.expectedBool { t.Fatalf("Test case failed. inputString: %s. "+ "Expected done = %t but got done = %t", tc.inputString, tc.expectedBool, done) } } } func TestEnvAndFileVars(t *testing.T) { os.Setenv("INTERPOLATE_TEST_ENV_1", "bulbasaur") os.Setenv("INTERPOLATE_TEST_ENV_3", "/path/to/nowhere") os.Setenv("INTERPOLATE_TEST_ENV_2", "5") os.Setenv("INTERPOLATE_TEST_ENV_4", "bananas") f, err := os.Open(fixtureDir("complex-recursed-env-user-var-file.json")) if err != nil { t.Fatalf("err: %s", err) } tpl, err := template.Parse(f) f.Close() if err != nil { t.Fatalf("err: %s\n\n%s", "complex-recursed-env-user-var-file.json", err) } ccf := NewCore(&CoreConfig{ Template: tpl, Version: "1.0.0", Variables: map[string]string{ "var_1": "partyparrot", "var_2": "{{user `env_1`}}-{{user `env_2`}}{{user `env_3`}}-{{user `var_1`}}", "final_var": "{{user `env_1`}}/{{user `env_2`}}/{{user `env_4`}}{{user `env_3`}}-{{user `var_1`}}/vmware/{{user `var_2`}}.vmx", }, }) err = ccf.Initialize() expected := map[string]string{ "var_1": "partyparrot", "var_2": "bulbasaur-5/path/to/nowhere-partyparrot", "final_var": "bulbasaur/5/bananas/path/to/nowhere-partyparrot/vmware/bulbasaur-5/path/to/nowhere-partyparrot.vmx", "env_1": "bulbasaur", "env_2": "5", "env_3": "/path/to/nowhere", "env_4": "bananas", } if err != nil { t.Fatalf("err: %s\n\n%s", "complex-recursed-env-user-var-file.json", err) } for k, v := range ccf.variables { if expected[k] != v { t.Fatalf("Expected value %s for key %s but got %s", expected[k], k, v) } } // Clean up env vars os.Unsetenv("INTERPOLATE_TEST_ENV_1") os.Unsetenv("INTERPOLATE_TEST_ENV_3") os.Unsetenv("INTERPOLATE_TEST_ENV_2") os.Unsetenv("INTERPOLATE_TEST_ENV_4") } func testCoreTemplate(t *testing.T, c *CoreConfig, p string) { tpl, err := template.ParseFile(p) if err != nil { t.Fatalf("err: %s\n\n%s", p, err) } c.Template = tpl } func TestCoreBuild_provRetry(t *testing.T) { config := TestCoreConfig(t) testCoreTemplate(t, config, fixtureDir("build-prov-retry.json")) b := TestBuilder(t, config, "test") pString := new(packersdk.MockProvisioner) pInt := new(packersdk.MockProvisioner) config.Components.ProvisionerStore = packersdk.MapOfProvisioner{ "test-string": func() (packersdk.Provisioner, error) { return pString, nil }, // backwards compatibility "test-integer": func() (packersdk.Provisioner, error) { return pInt, nil }, } core := TestCore(t, config) b.ArtifactId = "hello" build, err := core.Build("test") if err != nil { t.Fatalf("err: %s", err) } if _, err := build.Prepare(); err != nil { t.Fatalf("err: %s", err) } ui := testUi() pInt.ProvFunc = func(ctx context.Context) error { return errors.New("failed") } pString.ProvFunc = func(ctx context.Context) error { return errors.New("failed") } artifact, err := build.Run(context.Background(), ui) if err != nil { t.Fatalf("err: %s", err) } if len(artifact) != 1 { t.Fatalf("bad: %#v", artifact) } if artifact[0].Id() != b.ArtifactId { t.Fatalf("bad: %s", artifact[0].Id()) } if !pString.ProvRetried { t.Fatal("provisioner should retry for max_retries string value") } // backwards compatibility if !pInt.ProvRetried { t.Fatal("provisioner should retry for max_retries integer value") } } ���������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/fixconfigmode_enumer.go�����������������������������������������������������0000664�0000000�0000000�00000002526�13771713062�0021460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "enumer -type FixConfigMode"; DO NOT EDIT. // package packer import ( "fmt" ) const _FixConfigModeName = "StdoutInplaceDiff" var _FixConfigModeIndex = [...]uint8{0, 6, 13, 17} func (i FixConfigMode) String() string { if i < 0 || i >= FixConfigMode(len(_FixConfigModeIndex)-1) { return fmt.Sprintf("FixConfigMode(%d)", i) } return _FixConfigModeName[_FixConfigModeIndex[i]:_FixConfigModeIndex[i+1]] } var _FixConfigModeValues = []FixConfigMode{0, 1, 2} var _FixConfigModeNameToValueMap = map[string]FixConfigMode{ _FixConfigModeName[0:6]: 0, _FixConfigModeName[6:13]: 1, _FixConfigModeName[13:17]: 2, } // FixConfigModeString retrieves an enum value from the enum constants string name. // Throws an error if the param is not part of the enum. func FixConfigModeString(s string) (FixConfigMode, error) { if val, ok := _FixConfigModeNameToValueMap[s]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to FixConfigMode values", s) } // FixConfigModeValues returns all values of the enum func FixConfigModeValues() []FixConfigMode { return _FixConfigModeValues } // IsAFixConfigMode returns "true" if the value is listed in the enum definition. "false" otherwise func (i FixConfigMode) IsAFixConfigMode() bool { for _, v := range _FixConfigModeValues { if i == v { return true } } return false } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/packer_test.go��������������������������������������������������������������0000664�0000000�0000000�00000000235�13771713062�0017563�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "path/filepath" ) const FixtureDir = "./test-fixtures" func fixtureDir(n string) string { return filepath.Join(FixtureDir, n) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/���������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016226�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/builder.go�����������������������������������������������������������0000664�0000000�0000000�00000001636�13771713062�0020211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "context" "log" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type cmdBuilder struct { builder packersdk.Builder client *Client } func (b *cmdBuilder) ConfigSpec() hcldec.ObjectSpec { defer func() { r := recover() b.checkExit(r, nil) }() return b.builder.ConfigSpec() } func (b *cmdBuilder) Prepare(config ...interface{}) ([]string, []string, error) { defer func() { r := recover() b.checkExit(r, nil) }() return b.builder.Prepare(config...) } func (b *cmdBuilder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook) (packersdk.Artifact, error) { defer func() { r := recover() b.checkExit(r, nil) }() return b.builder.Run(ctx, ui, hook) } func (c *cmdBuilder) checkExit(p interface{}, cb func()) { if c.client.Exited() && cb != nil { cb() } else if p != nil && !Killed { log.Panic(p) } } ��������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/builder_test.go������������������������������������������������������0000664�0000000�0000000�00000000720�13771713062�0021241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "os/exec" "testing" ) func TestBuilder_NoExist(t *testing.T) { c := NewClient(&ClientConfig{Cmd: exec.Command("i-should-not-exist")}) defer c.Kill() _, err := c.Builder() if err == nil { t.Fatal("should have error") } } func TestBuilder_Good(t *testing.T) { c := NewClient(&ClientConfig{Cmd: helperProcess("builder")}) defer c.Kill() _, err := c.Builder() if err != nil { t.Fatalf("should not have error: %s", err) } } ������������������������������������������������packer-1.6.6+ds1/packer/plugin/client.go������������������������������������������������������������0000664�0000000�0000000�00000023472�13771713062�0020043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "bufio" "errors" "fmt" "io" "io/ioutil" "log" "net" "os" "os/exec" "path/filepath" "strings" "sync" "time" "unicode" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" pluginsdk "github.com/hashicorp/packer/packer-plugin-sdk/plugin" packerrpc "github.com/hashicorp/packer/packer-plugin-sdk/rpc" ) // If this is true, then the "unexpected EOF" panic will not be // raised throughout the clients. var Killed = false // This is a slice of the "managed" clients which are cleaned up when // calling Cleanup var managedClients = make([]*Client, 0, 5) // Client handles the lifecycle of a plugin application, determining its // RPC address, and returning various types of packer interface implementations // across the multi-process communication layer. type Client struct { config *ClientConfig exited bool doneLogging chan struct{} l sync.Mutex address net.Addr } // ClientConfig is the configuration used to initialize a new // plugin client. After being used to initialize a plugin client, // that configuration must not be modified again. type ClientConfig struct { // The unstarted subprocess for starting the plugin. Cmd *exec.Cmd // Managed represents if the client should be managed by the // plugin package or not. If true, then by calling CleanupClients, // it will automatically be cleaned up. Otherwise, the client // user is fully responsible for making sure to Kill all plugin // clients. By default the client is _not_ managed. Managed bool // The minimum and maximum port to use for communicating with // the subprocess. If not set, this defaults to 10,000 and 25,000 // respectively. MinPort, MaxPort int // StartTimeout is the timeout to wait for the plugin to say it // has started successfully. StartTimeout time.Duration // If non-nil, then the stderr of the client will be written to here // (as well as the log). Stderr io.Writer } // This makes sure all the managed subprocesses are killed and properly // logged. This should be called before the parent process running the // plugins exits. // // This must only be called _once_. func CleanupClients() { // Set the killed to true so that we don't get unexpected panics Killed = true // Kill all the managed clients in parallel and use a WaitGroup // to wait for them all to finish up. var wg sync.WaitGroup for _, client := range managedClients { wg.Add(1) go func(client *Client) { client.Kill() wg.Done() }(client) } log.Println("waiting for all plugin processes to complete...") wg.Wait() } // Creates a new plugin client which manages the lifecycle of an external // plugin and gets the address for the RPC connection. // // The client must be cleaned up at some point by calling Kill(). If // the client is a managed client (created with NewManagedClient) you // can just call CleanupClients at the end of your program and they will // be properly cleaned. func NewClient(config *ClientConfig) (c *Client) { if config.MinPort == 0 && config.MaxPort == 0 { config.MinPort = 10000 config.MaxPort = 25000 } if config.StartTimeout == 0 { config.StartTimeout = 1 * time.Minute } if config.Stderr == nil { config.Stderr = ioutil.Discard } c = &Client{config: config} if config.Managed { managedClients = append(managedClients, c) } return } // Tells whether or not the underlying process has exited. func (c *Client) Exited() bool { c.l.Lock() defer c.l.Unlock() return c.exited } // Returns a builder implementation that is communicating over this // client. If the client hasn't been started, this will start it. func (c *Client) Builder() (packersdk.Builder, error) { client, err := c.Client() if err != nil { return nil, err } return &cmdBuilder{client.Builder(), c}, nil } // Returns a hook implementation that is communicating over this // client. If the client hasn't been started, this will start it. func (c *Client) Hook() (packersdk.Hook, error) { client, err := c.Client() if err != nil { return nil, err } return &cmdHook{client.Hook(), c}, nil } // Returns a post-processor implementation that is communicating over // this client. If the client hasn't been started, this will start it. func (c *Client) PostProcessor() (packersdk.PostProcessor, error) { client, err := c.Client() if err != nil { return nil, err } return &cmdPostProcessor{client.PostProcessor(), c}, nil } // Returns a provisioner implementation that is communicating over this // client. If the client hasn't been started, this will start it. func (c *Client) Provisioner() (packersdk.Provisioner, error) { client, err := c.Client() if err != nil { return nil, err } return &cmdProvisioner{client.Provisioner(), c}, nil } // End the executing subprocess (if it is running) and perform any cleanup // tasks necessary such as capturing any remaining logs and so on. // // This method blocks until the process successfully exits. // // This method can safely be called multiple times. func (c *Client) Kill() { cmd := c.config.Cmd if cmd.Process == nil { return } cmd.Process.Kill() // Wait for the client to finish logging so we have a complete log <-c.doneLogging } // Starts the underlying subprocess, communicating with it to negotiate // a port for RPC connections, and returning the address to connect via RPC. // // This method is safe to call multiple times. Subsequent calls have no effect. // Once a client has been started once, it cannot be started again, even if // it was killed. func (c *Client) Start() (addr net.Addr, err error) { c.l.Lock() defer c.l.Unlock() if c.address != nil { return c.address, nil } c.doneLogging = make(chan struct{}) env := []string{ fmt.Sprintf("%s=%s", pluginsdk.MagicCookieKey, pluginsdk.MagicCookieValue), fmt.Sprintf("PACKER_PLUGIN_MIN_PORT=%d", c.config.MinPort), fmt.Sprintf("PACKER_PLUGIN_MAX_PORT=%d", c.config.MaxPort), } stdout_r, stdout_w := io.Pipe() stderr_r, stderr_w := io.Pipe() cmd := c.config.Cmd cmd.Env = append(cmd.Env, os.Environ()...) cmd.Env = append(cmd.Env, env...) cmd.Stdin = os.Stdin cmd.Stderr = stderr_w cmd.Stdout = stdout_w log.Printf("Starting plugin: %s %#v", cmd.Path, cmd.Args) err = cmd.Start() if err != nil { return } // Make sure the command is properly cleaned up if there is an error defer func() { r := recover() if err != nil || r != nil { cmd.Process.Kill() } if r != nil { panic(r) } }() // Start goroutine to wait for process to exit exitCh := make(chan struct{}) go func() { // Make sure we close the write end of our stderr/stdout so // that the readers send EOF properly. defer stderr_w.Close() defer stdout_w.Close() // Wait for the command to end. cmd.Wait() // Log and make sure to flush the logs write away log.Printf("%s: plugin process exited\n", cmd.Path) os.Stderr.Sync() // Mark that we exited close(exitCh) // Set that we exited, which takes a lock c.l.Lock() defer c.l.Unlock() c.exited = true }() // Start goroutine that logs the stderr go c.logStderr(stderr_r) // Start a goroutine that is going to be reading the lines // out of stdout linesCh := make(chan []byte) go func() { defer close(linesCh) buf := bufio.NewReader(stdout_r) for { line, err := buf.ReadBytes('\n') if line != nil { linesCh <- line } if err == io.EOF { return } } }() // Make sure after we exit we read the lines from stdout forever // so they dont' block since it is an io.Pipe defer func() { go func() { for range linesCh { } }() }() // Some channels for the next step timeout := time.After(c.config.StartTimeout) // Start looking for the address log.Printf("Waiting for RPC address for: %s", cmd.Path) select { case <-timeout: err = errors.New("timeout while waiting for plugin to start") case <-exitCh: err = errors.New("plugin exited before we could connect") case lineBytes := <-linesCh: // Trim the line and split by "|" in order to get the parts of // the output. line := strings.TrimSpace(string(lineBytes)) parts := strings.SplitN(line, "|", 3) if len(parts) < 3 { err = fmt.Errorf("Unrecognized remote plugin message: %s", line) return } // Test the API version if parts[0] != pluginsdk.APIVersion { err = fmt.Errorf("Incompatible API version with plugin. "+ "Plugin version: %s, Ours: %s", parts[0], pluginsdk.APIVersion) return } switch parts[1] { case "tcp": addr, err = net.ResolveTCPAddr("tcp", parts[2]) log.Printf("Received tcp RPC address for %s: addr is %s", cmd.Path, addr) case "unix": addr, err = net.ResolveUnixAddr("unix", parts[2]) log.Printf("Received unix RPC address for %s: addr is %s", cmd.Path, addr) default: err = fmt.Errorf("Unknown address type: %s", parts[1]) } } c.address = addr return } func (c *Client) logStderr(r io.Reader) { logPrefix := filepath.Base(c.config.Cmd.Path) if logPrefix == "packer" { // we just called the normal packer binary with the plugin arg. // grab the last arg from the list which will match the plugin name. logPrefix = c.config.Cmd.Args[len(c.config.Cmd.Args)-1] } bufR := bufio.NewReader(r) for { line, err := bufR.ReadString('\n') if line != "" { c.config.Stderr.Write([]byte(line)) line = strings.TrimRightFunc(line, unicode.IsSpace) log.Printf("%s plugin: %s", logPrefix, line) } if err == io.EOF { break } } // Flag that we've completed logging for others close(c.doneLogging) } func (c *Client) Client() (*packerrpc.Client, error) { addr, err := c.Start() if err != nil { return nil, err } conn, err := net.Dial(addr.Network(), addr.String()) if err != nil { return nil, err } if tcpConn, ok := conn.(*net.TCPConn); ok { // Make sure to set keep alive so that the connection doesn't die tcpConn.SetKeepAlive(true) } client, err := packerrpc.NewClient(conn) if err != nil { conn.Close() return nil, err } return client, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/client_test.go�������������������������������������������������������0000664�0000000�0000000�00000005156�13771713062�0021101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "bytes" "io/ioutil" "os" "strings" "testing" "time" ) func TestClient(t *testing.T) { process := helperProcess("mock") c := NewClient(&ClientConfig{Cmd: process}) defer c.Kill() // Test that it parses the proper address addr, err := c.Start() if err != nil { t.Fatalf("err should be nil, got %s", err) } if addr.Network() != "tcp" { t.Fatalf("bad: %#v", addr) } if addr.String() != ":1234" { t.Fatalf("bad: %#v", addr) } // Test that it exits properly if killed c.Kill() if process.ProcessState == nil { t.Fatal("should have process state") } // Test that it knows it is exited if !c.Exited() { t.Fatal("should say client has exited") } } func TestClientStart_badVersion(t *testing.T) { config := &ClientConfig{ Cmd: helperProcess("bad-version"), StartTimeout: 50 * time.Millisecond, } c := NewClient(config) defer c.Kill() _, err := c.Start() if err == nil { t.Fatal("err should not be nil") } } func TestClient_Start_Timeout(t *testing.T) { config := &ClientConfig{ Cmd: helperProcess("start-timeout"), StartTimeout: 50 * time.Millisecond, } c := NewClient(config) defer c.Kill() _, err := c.Start() if err == nil { t.Fatal("err should not be nil") } } func TestClient_Stderr(t *testing.T) { stderr := new(bytes.Buffer) process := helperProcess("stderr") c := NewClient(&ClientConfig{ Cmd: process, Stderr: stderr, }) defer c.Kill() if _, err := c.Start(); err != nil { t.Fatalf("err: %s", err) } for !c.Exited() { time.Sleep(10 * time.Millisecond) } if !strings.Contains(stderr.String(), "HELLO\n") { t.Fatalf("bad log data: '%s'", stderr.String()) } if !strings.Contains(stderr.String(), "WORLD\n") { t.Fatalf("bad log data: '%s'", stderr.String()) } } func TestClient_Stdin(t *testing.T) { // Overwrite stdin for this test with a temporary file tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() if _, err = tf.WriteString("hello"); err != nil { t.Fatalf("error: %s", err) } if err = tf.Sync(); err != nil { t.Fatalf("error: %s", err) } if _, err = tf.Seek(0, 0); err != nil { t.Fatalf("error: %s", err) } oldStdin := os.Stdin defer func() { os.Stdin = oldStdin }() os.Stdin = tf process := helperProcess("stdin") c := NewClient(&ClientConfig{Cmd: process}) defer c.Kill() _, err = c.Start() if err != nil { t.Fatalf("error: %s", err) } for { if c.Exited() { break } time.Sleep(50 * time.Millisecond) } if !process.ProcessState.Success() { t.Fatal("process didn't exit cleanly") } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/discover.go����������������������������������������������������������0000664�0000000�0000000�00000022326�13771713062�0020400�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "encoding/json" "log" "os" "os/exec" "path/filepath" "runtime" "sort" "strings" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/pathing" pluginsdk "github.com/hashicorp/packer/packer-plugin-sdk/plugin" ) // PACKERSPACE is used to represent the spaces that separate args for a command // without being confused with spaces in the path to the command itself. const PACKERSPACE = "-PACKERSPACE-" type Config struct { PluginMinPort int PluginMaxPort int builders packersdk.MapOfBuilder provisioners packersdk.MapOfProvisioner postProcessors packersdk.MapOfPostProcessor } func (c *Config) GetPlugins() (packersdk.MapOfBuilder, packersdk.MapOfProvisioner, packersdk.MapOfPostProcessor) { return c.builders, c.provisioners, c.postProcessors } // Discover discovers plugins. // // Search the directory of the executable, then the plugins directory, and // finally the CWD, in that order. Any conflicts will overwrite previously // found plugins, in that order. // Hence, the priority order is the reverse of the search order - i.e., the // CWD has the highest priority. func (c *Config) Discover() error { if c.builders == nil { c.builders = packersdk.MapOfBuilder{} } if c.provisioners == nil { c.provisioners = packersdk.MapOfProvisioner{} } if c.postProcessors == nil { c.postProcessors = packersdk.MapOfPostProcessor{} } // If we are already inside a plugin process we should not need to // discover anything. if os.Getenv(pluginsdk.MagicCookieKey) == pluginsdk.MagicCookieValue { return nil } // Next, look in the same directory as the executable. exePath, err := os.Executable() if err != nil { log.Printf("[ERR] Error loading exe directory: %s", err) } else { if err := c.discoverExternalComponents(filepath.Dir(exePath)); err != nil { return err } } // Next, look in the default plugins directory inside the configdir/.packer.d/plugins. dir, err := pathing.ConfigDir() if err != nil { log.Printf("[ERR] Error loading config directory: %s", err) } else { if err := c.discoverExternalComponents(filepath.Join(dir, "plugins")); err != nil { return err } } // Next, look in the CWD. if err := c.discoverExternalComponents("."); err != nil { return err } // Check whether there is a custom Plugin directory defined. This gets // absolute preference. if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" { sep := ":" if runtime.GOOS == "windows" { // on windows, PATH is semicolon-separated sep = ";" } plugPaths := strings.Split(packerPluginPath, sep) for _, plugPath := range plugPaths { if err := c.discoverExternalComponents(plugPath); err != nil { return err } } } return nil } func (c *Config) discoverExternalComponents(path string) error { var err error if !filepath.IsAbs(path) { path, err = filepath.Abs(path) if err != nil { return err } } var externallyUsed []string pluginPaths, err := c.discoverSingle(filepath.Join(path, "packer-builder-*")) if err != nil { return err } for pluginName, pluginPath := range pluginPaths { newPath := pluginPath // this needs to be stored in a new variable for the func below c.builders[pluginName] = func() (packersdk.Builder, error) { return c.Client(newPath).Builder() } externallyUsed = append(externallyUsed, pluginName) } if len(externallyUsed) > 0 { sort.Strings(externallyUsed) log.Printf("using external builders %v", externallyUsed) externallyUsed = nil } pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-post-processor-*")) if err != nil { return err } for pluginName, pluginPath := range pluginPaths { newPath := pluginPath // this needs to be stored in a new variable for the func below c.postProcessors[pluginName] = func() (packersdk.PostProcessor, error) { return c.Client(newPath).PostProcessor() } externallyUsed = append(externallyUsed, pluginName) } if len(externallyUsed) > 0 { sort.Strings(externallyUsed) log.Printf("using external post-processors %v", externallyUsed) externallyUsed = nil } pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-provisioner-*")) if err != nil { return err } for pluginName, pluginPath := range pluginPaths { newPath := pluginPath // this needs to be stored in a new variable for the func below c.provisioners[pluginName] = func() (packersdk.Provisioner, error) { return c.Client(newPath).Provisioner() } externallyUsed = append(externallyUsed, pluginName) } if len(externallyUsed) > 0 { sort.Strings(externallyUsed) log.Printf("using external provisioners %v", externallyUsed) } pluginPaths, err = c.discoverSingle(filepath.Join(path, "packer-plugin-*")) if err != nil { return err } for pluginName, pluginPath := range pluginPaths { if err := c.discoverMultiPlugin(pluginName, pluginPath); err != nil { return err } } return nil } func (c *Config) discoverSingle(glob string) (map[string]string, error) { matches, err := filepath.Glob(glob) if err != nil { return nil, err } res := make(map[string]string) prefix := filepath.Base(glob) prefix = prefix[:strings.Index(prefix, "*")] for _, match := range matches { file := filepath.Base(match) // skip folders like packer-plugin-sdk if stat, err := os.Stat(file); err == nil && stat.IsDir() { continue } // On Windows, ignore any plugins that don't end in .exe. // We could do a full PATHEXT parse, but this is probably good enough. if runtime.GOOS == "windows" && strings.ToLower(filepath.Ext(file)) != ".exe" { log.Printf( "[DEBUG] Ignoring plugin match %s, no exe extension", match) continue } // If the filename has a ".", trim up to there if idx := strings.Index(file, ".exe"); idx >= 0 { file = file[:idx] } // Look for foo-bar-baz. The plugin name is "baz" pluginName := file[len(prefix):] log.Printf("[DEBUG] Discovered plugin: %s = %s", pluginName, match) res[pluginName] = match } return res, nil } // discoverMultiPlugin takes the description from a multiplugin binary and // makes the plugins available to use in Packer. Each plugin found in the // binary will be addressable using `${pluginName}-${builderName}` for example. // pluginName could be manually set. It usually is a cloud name like amazon. // pluginName can be extrapolated from the filename of the binary; so // if the "packer-plugin-amazon" binary had an "ebs" builder one could use // the "amazon-ebs" builder. func (c *Config) discoverMultiPlugin(pluginName, pluginPath string) error { out, err := exec.Command(pluginPath, "describe").Output() if err != nil { return err } var desc pluginsdk.SetDescription if err := json.Unmarshal(out, &desc); err != nil { return err } pluginPrefix := pluginName + "-" for _, builderName := range desc.Builders { builderName := builderName // copy to avoid pointer overwrite issue c.builders[pluginPrefix+builderName] = func() (packersdk.Builder, error) { return c.Client(pluginPath, "start", "builder", builderName).Builder() } } if len(desc.Builders) > 0 { log.Printf("found external %v builders from %s plugin", desc.Builders, pluginName) } for _, postProcessorName := range desc.PostProcessors { postProcessorName := postProcessorName // copy to avoid pointer overwrite issue c.postProcessors[pluginPrefix+postProcessorName] = func() (packersdk.PostProcessor, error) { return c.Client(pluginPath, "start", "post-processor", postProcessorName).PostProcessor() } } if len(desc.PostProcessors) > 0 { log.Printf("found external %v post-processors from %s plugin", desc.PostProcessors, pluginName) } for _, provisionerName := range desc.Provisioners { provisionerName := provisionerName // copy to avoid pointer overwrite issue c.provisioners[pluginPrefix+provisionerName] = func() (packersdk.Provisioner, error) { return c.Client(pluginPath, "start", "provisioner", provisionerName).Provisioner() } } if len(desc.Provisioners) > 0 { log.Printf("found external %v provisioner from %s plugin", desc.Provisioners, pluginName) } return nil } func (c *Config) Client(path string, args ...string) *Client { originalPath := path // Check for special case using `packer plugin PLUGIN` if strings.Contains(path, PACKERSPACE) { parts := strings.Split(path, PACKERSPACE) path = parts[0] args = parts[1:] } // First attempt to find the executable by consulting the PATH. path, err := exec.LookPath(path) if err != nil { // If that doesn't work, look for it in the same directory // as the `packer` executable (us). log.Printf("Plugin could not be found at %s (%v). Checking same directory as executable.", originalPath, err) exePath, err := os.Executable() if err != nil { log.Printf("Couldn't get current exe path: %s", err) } else { log.Printf("Current exe path: %s", exePath) path = filepath.Join(filepath.Dir(exePath), filepath.Base(originalPath)) } } // If everything failed, just use the original path and let the error // bubble through. if path == "" { path = originalPath } log.Printf("Creating plugin client for path: %s", path) var config ClientConfig config.Cmd = exec.Command(path, args...) config.Managed = true config.MinPort = c.PluginMinPort config.MaxPort = c.PluginMaxPort return NewClient(&config) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/discover_test.go�����������������������������������������������������0000664�0000000�0000000�00000016735�13771713062�0021446�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "fmt" "io/ioutil" "os" "os/exec" "path" "path/filepath" "runtime" "strings" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/packer" pluginsdk "github.com/hashicorp/packer/packer-plugin-sdk/plugin" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) func newConfig() Config { var conf Config conf.PluginMinPort = 10000 conf.PluginMaxPort = 25000 return conf } func TestDiscoverReturnsIfMagicCookieSet(t *testing.T) { config := newConfig() os.Setenv(pluginsdk.MagicCookieKey, pluginsdk.MagicCookieValue) defer os.Unsetenv(pluginsdk.MagicCookieKey) err := config.Discover() if err != nil { t.Fatalf("Should not have errored: %s", err) } if len(config.builders) != 0 { t.Fatalf("Should not have tried to find builders") } } func TestEnvVarPackerPluginPath(t *testing.T) { // Create a temporary directory to store plugins in dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", []string{"packer-provisioner-partyparrot"}) if err != nil { t.Fatalf("Error creating fake custom plugins: %s", err) } defer cleanUpFunc() // Add temp dir to path. os.Setenv("PACKER_PLUGIN_PATH", dir) defer os.Unsetenv("PACKER_PLUGIN_PATH") config := newConfig() err = config.Discover() if err != nil { t.Fatalf("Should not have errored: %s", err) } if len(config.provisioners) == 0 { t.Fatalf("Should have found partyparrot provisioner") } if _, ok := config.provisioners["partyparrot"]; !ok { t.Fatalf("Should have found partyparrot provisioner.") } } func TestEnvVarPackerPluginPath_MultiplePaths(t *testing.T) { // Create a temporary directory to store plugins in dir, _, cleanUpFunc, err := generateFakePlugins("custom_plugin_dir", []string{"packer-provisioner-partyparrot"}) if err != nil { t.Fatalf("Error creating fake custom plugins: %s", err) } defer cleanUpFunc() pathsep := ":" if runtime.GOOS == "windows" { pathsep = ";" } // Create a second dir to look in that will be empty decoyDir, err := ioutil.TempDir("", "decoy") if err != nil { t.Fatalf("Failed to create a temporary test dir.") } defer os.Remove(decoyDir) pluginPath := dir + pathsep + decoyDir // Add temp dir to path. os.Setenv("PACKER_PLUGIN_PATH", pluginPath) defer os.Unsetenv("PACKER_PLUGIN_PATH") config := newConfig() err = config.Discover() if err != nil { t.Fatalf("Should not have errored: %s", err) } if len(config.provisioners) == 0 { t.Fatalf("Should have found partyparrot provisioner") } if _, ok := config.provisioners["partyparrot"]; !ok { t.Fatalf("Should have found partyparrot provisioner.") } } func generateFakePlugins(dirname string, pluginNames []string) (string, []string, func(), error) { dir, err := ioutil.TempDir("", dirname) if err != nil { return "", nil, nil, fmt.Errorf("failed to create temporary test directory: %v", err) } cleanUpFunc := func() { os.RemoveAll(dir) } var suffix string if runtime.GOOS == "windows" { suffix = ".exe" } plugins := make([]string, len(pluginNames)) for i, plugin := range pluginNames { plug := filepath.Join(dir, plugin+suffix) plugins[i] = plug _, err := os.Create(plug) if err != nil { cleanUpFunc() return "", nil, nil, fmt.Errorf("failed to create temporary plugin file (%s): %v", plug, err) } } return dir, plugins, cleanUpFunc, nil } // TestHelperProcess isn't a real test. It's used as a helper process // for multiplugin-binary tests. func TestHelperPlugins(*testing.T) { if os.Getenv("PKR_WANT_TEST_PLUGINS") != "1" { return } defer os.Exit(0) args := os.Args for len(args) > 0 { if args[0] == "--" { args = args[1:] break } args = args[1:] } if len(args) == 0 { fmt.Fprintf(os.Stderr, "No command\n") os.Exit(2) } pluginName, args := args[0], args[1:] plugin, found := mockPlugins[pluginName] if !found { fmt.Fprintf(os.Stderr, "No %q plugin found\n", pluginName) os.Exit(2) } err := plugin.RunCommand(args...) if err != nil { fmt.Fprintf(os.Stderr, "%v\n", err) os.Exit(1) } } // HasExec reports whether the current system can start new processes // using os.StartProcess or (more commonly) exec.Command. func HasExec() bool { switch runtime.GOOS { case "js": return false case "darwin": if runtime.GOARCH == "arm64" { return false } case "windows": // TODO(azr): Fix this once versioning is added and we know more return false } return true } // MustHaveExec checks that the current system can start new processes // using os.StartProcess or (more commonly) exec.Command. // If not, MustHaveExec calls t.Skip with an explanation. func MustHaveExec(t testing.TB) { if !HasExec() { t.Skipf("skipping test: cannot exec subprocess on %s/%s", runtime.GOOS, runtime.GOARCH) } } func MustHaveCommand(t testing.TB, cmd string) string { path, err := exec.LookPath(cmd) if err != nil { t.Skipf("skipping test: cannot find the %q command: %v", cmd, err) } return path } func helperCommand(t *testing.T, s ...string) []string { MustHaveExec(t) cmd := []string{os.Args[0], "-test.run=TestHelperPlugins", "--"} return append(cmd, s...) } var ( mockPlugins = map[string]pluginsdk.Set{ "bird": pluginsdk.Set{ Builders: map[string]packer.Builder{ "feather": nil, "guacamole": nil, }, }, "chimney": pluginsdk.Set{ PostProcessors: map[string]packer.PostProcessor{ "smoke": nil, }, }, } ) func Test_multiplugin_describe(t *testing.T) { pluginDir, err := tmp.Dir("pkr-multiplugin-test-*") { // create an exectutable file with a `sh` sheebang // this file will look like: // #!/bin/sh // PKR_WANT_TEST_PLUGINS=1 ...plugin/debug.test -test.run=TestHelperPlugins -- bird $@ // 'bird' is the mock plugin we want to start // $@ just passes all passed arguments // This will allow to run the fake plugin from go tests which in turn // will run go tests callback to `TestHelperPlugins`, this one will be // transparently calling our mock multiplugins `mockPlugins`. if err != nil { t.Fatal(err) } defer os.RemoveAll(pluginDir) t.Logf("putting temporary mock plugins in %s", pluginDir) defer os.RemoveAll(pluginDir) shPath := MustHaveCommand(t, "bash") for name := range mockPlugins { plugin := path.Join(pluginDir, "packer-plugin-"+name) fileContent := "" fileContent = fmt.Sprintf("#!%s\n", shPath) fileContent += strings.Join( append([]string{"PKR_WANT_TEST_PLUGINS=1"}, helperCommand(t, name, "$@")...), " ") if err := ioutil.WriteFile(plugin, []byte(fileContent), os.ModePerm); err != nil { t.Fatalf("failed to create fake plugin binary: %v", err) } } } os.Setenv("PACKER_PLUGIN_PATH", pluginDir) c := Config{} err = c.Discover() if err != nil { t.Fatal(err) } for mockPluginName, plugin := range mockPlugins { for mockBuilderName := range plugin.Builders { expectedBuilderName := mockPluginName + "-" + mockBuilderName if _, found := c.builders[expectedBuilderName]; !found { t.Fatalf("expected to find builder %q", expectedBuilderName) } } for mockProvisionerName := range plugin.Provisioners { expectedProvisionerName := mockPluginName + "-" + mockProvisionerName if _, found := c.provisioners[expectedProvisionerName]; !found { t.Fatalf("expected to find builder %q", expectedProvisionerName) } } for mockPostProcessorName := range plugin.PostProcessors { expectedPostProcessorName := mockPluginName + "-" + mockPostProcessorName if _, found := c.postProcessors[expectedPostProcessorName]; !found { t.Fatalf("expected to find post-processor %q", expectedPostProcessorName) } } } } �����������������������������������packer-1.6.6+ds1/packer/plugin/hook.go��������������������������������������������������������������0000664�0000000�0000000�00000001070�13771713062�0017513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "context" "log" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type cmdHook struct { hook packersdk.Hook client *Client } func (c *cmdHook) Run(ctx context.Context, name string, ui packersdk.Ui, comm packersdk.Communicator, data interface{}) error { defer func() { r := recover() c.checkExit(r, nil) }() return c.hook.Run(ctx, name, ui, comm, data) } func (c *cmdHook) checkExit(p interface{}, cb func()) { if c.client.Exited() && cb != nil { cb() } else if p != nil && !Killed { log.Panic(p) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/hook_test.go���������������������������������������������������������0000664�0000000�0000000�00000000701�13771713062�0020552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "os/exec" "testing" ) func TestHook_NoExist(t *testing.T) { c := NewClient(&ClientConfig{Cmd: exec.Command("i-should-not-exist")}) defer c.Kill() _, err := c.Hook() if err == nil { t.Fatal("should have error") } } func TestHook_Good(t *testing.T) { c := NewClient(&ClientConfig{Cmd: helperProcess("hook")}) defer c.Kill() _, err := c.Hook() if err != nil { t.Fatalf("should not have error: %s", err) } } ���������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/plugin_test.go�������������������������������������������������������0000664�0000000�0000000�00000005405�13771713062�0021116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "fmt" "log" "os" "os/exec" "testing" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" pluginsdk "github.com/hashicorp/packer/packer-plugin-sdk/plugin" ) func helperProcess(s ...string) *exec.Cmd { cs := []string{"-test.run=TestHelperProcess", "--"} cs = append(cs, s...) env := []string{ "GO_WANT_HELPER_PROCESS=1", "PACKER_PLUGIN_MIN_PORT=10000", "PACKER_PLUGIN_MAX_PORT=25000", } cmd := exec.Command(os.Args[0], cs...) cmd.Env = append(env, os.Environ()...) return cmd } // This is not a real test. This is just a helper process kicked off by // tests. func TestHelperProcess(*testing.T) { if os.Getenv("GO_WANT_HELPER_PROCESS") != "1" { return } defer os.Exit(0) args := os.Args for len(args) > 0 { if args[0] == "--" { args = args[1:] break } args = args[1:] } if len(args) == 0 { fmt.Fprintf(os.Stderr, "No command\n") os.Exit(2) } cmd, _ := args[0], args[1:] switch cmd { case "bad-version": fmt.Printf("%s1|tcp|:1234\n", pluginsdk.APIVersion) <-make(chan int) case "builder": server, err := pluginsdk.Server() if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } err = server.RegisterBuilder(new(packersdk.MockBuilder)) if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } server.Serve() case "hook": server, err := pluginsdk.Server() if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } err = server.RegisterHook(new(packersdk.MockHook)) if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } server.Serve() case "invalid-rpc-address": fmt.Println("lolinvalid") case "mock": fmt.Printf("%s|tcp|:1234\n", pluginsdk.APIVersion) <-make(chan int) case "post-processor": server, err := pluginsdk.Server() if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } err = server.RegisterPostProcessor(new(helperPostProcessor)) if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } server.Serve() case "provisioner": server, err := pluginsdk.Server() if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } err = server.RegisterProvisioner(new(packersdk.MockProvisioner)) if err != nil { log.Printf("[ERR] %s", err) os.Exit(1) } server.Serve() case "start-timeout": time.Sleep(1 * time.Minute) os.Exit(1) case "stderr": fmt.Printf("%s|tcp|:1234\n", pluginsdk.APIVersion) log.Println("HELLO") log.Println("WORLD") case "stdin": fmt.Printf("%s|tcp|:1234\n", pluginsdk.APIVersion) data := make([]byte, 5) if _, err := os.Stdin.Read(data); err != nil { log.Printf("stdin read error: %s", err) os.Exit(100) } if string(data) == "hello" { os.Exit(0) } os.Exit(1) default: fmt.Fprintf(os.Stderr, "Unknown command: %q\n", cmd) os.Exit(2) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/post_processor.go����������������������������������������������������0000664�0000000�0000000�00000001666�13771713062�0021652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "context" "log" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type cmdPostProcessor struct { p packersdk.PostProcessor client *Client } func (b *cmdPostProcessor) ConfigSpec() hcldec.ObjectSpec { defer func() { r := recover() b.checkExit(r, nil) }() return b.p.ConfigSpec() } func (c *cmdPostProcessor) Configure(config ...interface{}) error { defer func() { r := recover() c.checkExit(r, nil) }() return c.p.Configure(config...) } func (c *cmdPostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { defer func() { r := recover() c.checkExit(r, nil) }() return c.p.PostProcess(ctx, ui, a) } func (c *cmdPostProcessor) checkExit(p interface{}, cb func()) { if c.client.Exited() && cb != nil { cb() } else if p != nil && !Killed { log.Panic(p) } } ��������������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/post_processor_test.go�����������������������������������������������0000664�0000000�0000000�00000001676�13771713062�0022712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "context" "os/exec" "testing" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type helperPostProcessor byte func (helperPostProcessor) ConfigSpec() hcldec.ObjectSpec { return nil } func (helperPostProcessor) Configure(...interface{}) error { return nil } func (helperPostProcessor) PostProcess(context.Context, packersdk.Ui, packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { return nil, false, false, nil } func TestPostProcessor_NoExist(t *testing.T) { c := NewClient(&ClientConfig{Cmd: exec.Command("i-should-not-exist")}) defer c.Kill() _, err := c.PostProcessor() if err == nil { t.Fatal("should have error") } } func TestPostProcessor_Good(t *testing.T) { c := NewClient(&ClientConfig{Cmd: helperProcess("post-processor")}) defer c.Kill() _, err := c.PostProcessor() if err != nil { t.Fatalf("should not have error: %s", err) } } ������������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/provisioner.go�������������������������������������������������������0000664�0000000�0000000�00000001701�13771713062�0021133�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "context" "log" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type cmdProvisioner struct { p packersdk.Provisioner client *Client } func (p *cmdProvisioner) ConfigSpec() hcldec.ObjectSpec { defer func() { r := recover() p.checkExit(r, nil) }() return p.p.ConfigSpec() } func (c *cmdProvisioner) Prepare(configs ...interface{}) error { defer func() { r := recover() c.checkExit(r, nil) }() return c.p.Prepare(configs...) } func (c *cmdProvisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { defer func() { r := recover() c.checkExit(r, nil) }() return c.p.Provision(ctx, ui, comm, generatedData) } func (c *cmdProvisioner) checkExit(p interface{}, cb func()) { if c.client.Exited() && cb != nil { cb() } else if p != nil && !Killed { log.Panic(p) } } ���������������������������������������������������������������packer-1.6.6+ds1/packer/plugin/provisioner_test.go��������������������������������������������������0000664�0000000�0000000�00000000744�13771713062�0022200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package plugin import ( "os/exec" "testing" ) func TestProvisioner_NoExist(t *testing.T) { c := NewClient(&ClientConfig{Cmd: exec.Command("i-should-not-exist")}) defer c.Kill() _, err := c.Provisioner() if err == nil { t.Fatal("should have error") } } func TestProvisioner_Good(t *testing.T) { c := NewClient(&ClientConfig{Cmd: helperProcess("provisioner")}) defer c.Kill() _, err := c.Provisioner() if err != nil { t.Fatalf("should not have error: %s", err) } } ����������������������������packer-1.6.6+ds1/packer/post_processor_mock.go������������������������������������������������������0000664�0000000�0000000�00000002216�13771713062�0021355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type MockPostProcessor package packer import ( "context" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // MockPostProcessor is an implementation of PostProcessor that can be // used for tests. type MockPostProcessor struct { ArtifactId string Keep bool ForceOverride bool Error error ConfigureCalled bool ConfigureConfigs []interface{} ConfigureError error PostProcessCalled bool PostProcessArtifact packersdk.Artifact PostProcessUi packersdk.Ui } func (t *MockPostProcessor) ConfigSpec() hcldec.ObjectSpec { return t.FlatMapstructure().HCL2Spec() } func (t *MockPostProcessor) Configure(configs ...interface{}) error { t.ConfigureCalled = true t.ConfigureConfigs = configs return t.ConfigureError } func (t *MockPostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { t.PostProcessCalled = true t.PostProcessArtifact = a t.PostProcessUi = ui return &packersdk.MockArtifact{ IdValue: t.ArtifactId, }, t.Keep, t.ForceOverride, t.Error } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/post_processor_mock.hcl2spec.go���������������������������������������������0000664�0000000�0000000�00000006072�13771713062�0023063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type MockPostProcessor"; DO NOT EDIT. package packer import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/zclconf/go-cty/cty" ) // FlatMockPostProcessor is an auto-generated flat version of MockPostProcessor. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatMockPostProcessor struct { ArtifactId *string `cty:"artifact_id" hcl:"artifact_id"` Keep *bool `cty:"keep" hcl:"keep"` ForceOverride *bool `cty:"force_override" hcl:"force_override"` Error error `cty:"error" hcl:"error"` ConfigureCalled *bool `cty:"configure_called" hcl:"configure_called"` ConfigureConfigs []interface{} `cty:"configure_configs" hcl:"configure_configs"` ConfigureError error `cty:"configure_error" hcl:"configure_error"` PostProcessCalled *bool `cty:"post_process_called" hcl:"post_process_called"` PostProcessArtifact packer.Artifact `cty:"post_process_artifact" hcl:"post_process_artifact"` PostProcessUi packer.Ui `cty:"post_process_ui" hcl:"post_process_ui"` } // FlatMapstructure returns a new FlatMockPostProcessor. // FlatMockPostProcessor is an auto-generated flat version of MockPostProcessor. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*MockPostProcessor) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatMockPostProcessor) } // HCL2Spec returns the hcl spec of a MockPostProcessor. // This spec is used by HCL to read the fields of MockPostProcessor. // The decoded values from this spec will then be applied to a FlatMockPostProcessor. func (*FlatMockPostProcessor) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "artifact_id": &hcldec.AttrSpec{Name: "artifact_id", Type: cty.String, Required: false}, "keep": &hcldec.AttrSpec{Name: "keep", Type: cty.Bool, Required: false}, "force_override": &hcldec.AttrSpec{Name: "force_override", Type: cty.Bool, Required: false}, "error": &hcldec.AttrSpec{Name: "error", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "configure_called": &hcldec.AttrSpec{Name: "configure_called", Type: cty.Bool, Required: false}, "configure_configs": &hcldec.AttrSpec{Name: "configure_configs", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "configure_error": &hcldec.AttrSpec{Name: "configure_error", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "post_process_called": &hcldec.AttrSpec{Name: "post_process_called", Type: cty.Bool, Required: false}, "post_process_artifact": &hcldec.AttrSpec{Name: "post_process_artifact", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ "post_process_ui": &hcldec.AttrSpec{Name: "post_process_ui", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */ } return s } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/progressbar.go��������������������������������������������������������������0000664�0000000�0000000�00000002430�13771713062�0017607�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !solaris package packer import ( "io" "path/filepath" "sync" pb "github.com/cheggaaa/pb" ) func ProgressBarConfig(bar *pb.ProgressBar, prefix string) { bar.SetUnits(pb.U_BYTES) bar.Prefix(prefix) } // UiProgressBar is a progress bar compatible with go-getter used in our // UI structs. type UiProgressBar struct { lock sync.Mutex pool *pb.Pool pbs int } func (p *UiProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser { if p == nil { return stream } p.lock.Lock() defer p.lock.Unlock() newPb := pb.New64(totalSize) newPb.Set64(currentSize) ProgressBarConfig(newPb, filepath.Base(src)) if p.pool == nil { pool := pb.NewPool() err := pool.Start() if err != nil { // here, we probably cannot lock // stdout, so let's just return // stream to avoid any error. return stream } p.pool = pool } p.pool.Add(newPb) reader := newPb.NewProxyReader(stream) p.pbs++ return &readCloser{ Reader: reader, close: func() error { p.lock.Lock() defer p.lock.Unlock() newPb.Finish() p.pbs-- if p.pbs <= 0 { p.pool.Stop() p.pool = nil } return nil }, } } type readCloser struct { io.Reader close func() error } func (c *readCloser) Close() error { return c.close() } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/progressbar_solaris.go������������������������������������������������������0000664�0000000�0000000�00000000221�13771713062�0021337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type UiProgressBar = packersdk.NoopProgressTracker �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/progressbar_test.go���������������������������������������������������������0000664�0000000�0000000�00000002213�13771713062�0020645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "io/ioutil" "testing" "golang.org/x/sync/errgroup" ) // The following tests rarelly just happen. So we run them 100 times. func TestProgressTracking_open_close(t *testing.T) { var bar *UiProgressBar tracker := bar.TrackProgress("1,", 1, 42, ioutil.NopCloser(nil)) tracker.Close() tracker = bar.TrackProgress("2,", 1, 42, ioutil.NopCloser(nil)) tracker.Close() } func TestProgressTracking_multi_open_close(t *testing.T) { var bar *UiProgressBar g := errgroup.Group{} for i := 0; i < 100; i++ { g.Go(func() error { tracker := bar.TrackProgress("file,", 1, 42, ioutil.NopCloser(nil)) return tracker.Close() }) } if err := g.Wait(); err != nil { t.Fatal(err) } } func TestProgressTracking_races(t *testing.T) { var bar *UiProgressBar g := errgroup.Group{} for i := 0; i < 100; i++ { g.Go(func() error { txt := []byte("foobarbaz dolores") b := bytes.NewReader(txt) tracker := bar.TrackProgress("file,", 1, 42, ioutil.NopCloser(b)) for i := 0; i < 42; i++ { tracker.Read([]byte("i")) } return tracker.Close() }) } if err := g.Wait(); err != nil { t.Fatal(err) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/provisioner.go��������������������������������������������������������������0000664�0000000�0000000�00000016441�13771713062�0017644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "fmt" "log" "sync" "time" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" ) // A HookedProvisioner represents a provisioner and information describing it type HookedProvisioner struct { Provisioner packersdk.Provisioner Config interface{} TypeName string } // A Hook implementation that runs the given provisioners. type ProvisionHook struct { // The provisioners to run as part of the hook. These should already // be prepared (by calling Prepare) at some earlier stage. Provisioners []*HookedProvisioner } // BuilderDataCommonKeys is the list of common keys that all builder will // return var BuilderDataCommonKeys = []string{ "ID", // The following correspond to communicator-agnostic functions that are } // part of the SSH and WinRM communicator implementations. These functions // are not part of the communicator interface, but are stored on the // Communicator Config and return the appropriate values rather than // depending on the actual communicator config values. E.g "Password" // reprosents either WinRMPassword or SSHPassword, which makes this more // useful if a template contains multiple builds. "Host", "Port", "User", "Password", "ConnType", "PackerRunUUID", "PackerHTTPPort", "PackerHTTPIP", "PackerHTTPAddr", "SSHPublicKey", "SSHPrivateKey", "WinRMPassword", } // Provisioners interpolate most of their fields in the prepare stage; this // placeholder map helps keep fields that are only generated at build time from // accidentally being interpolated into empty strings at prepare time. // This helper function generates the most basic placeholder data which should // be accessible to the provisioners. It is used to initialize provisioners, to // force validation using the `generated` template function. In the future, // custom generated data could be passed into provisioners from builders to // enable specialized builder-specific (but still validated!!) access to builder // data. func BasicPlaceholderData() map[string]string { placeholderData := map[string]string{} for _, key := range BuilderDataCommonKeys { placeholderData[key] = fmt.Sprintf("Build_%s. "+packerbuilderdata.PlaceholderMsg, key) } // Backwards-compatability: WinRM Password can get through without forcing // the generated func validation. placeholderData["WinRMPassword"] = "{{.WinRMPassword}}" return placeholderData } func CastDataToMap(data interface{}) map[string]interface{} { if interMap, ok := data.(map[string]interface{}); ok { // null and file builder sometimes don't use a communicator and // therefore don't go through RPC return interMap } // Provisioners expect a map[string]interface{} in their data field, but // it gets converted into a map[interface]interface on the way over the // RPC. Check that data can be cast into such a form, and cast it. cast := make(map[string]interface{}) interMap, ok := data.(map[interface{}]interface{}) if !ok { log.Printf("Unable to read map[string]interface out of data."+ "Using empty interface: %#v", data) } else { for key, val := range interMap { keyString, ok := key.(string) if ok { cast[keyString] = val } else { log.Printf("Error casting generated data key to a string.") } } } return cast } // Runs the provisioners in order. func (h *ProvisionHook) Run(ctx context.Context, name string, ui packersdk.Ui, comm packersdk.Communicator, data interface{}) error { // Shortcut if len(h.Provisioners) == 0 { return nil } if comm == nil { return fmt.Errorf( "No communicator found for provisioners! This is usually because the\n" + "`communicator` config was set to \"none\". If you have any provisioners\n" + "then a communicator is required. Please fix this to continue.") } for _, p := range h.Provisioners { ts := CheckpointReporter.AddSpan(p.TypeName, "provisioner", p.Config) cast := CastDataToMap(data) err := p.Provisioner.Provision(ctx, ui, comm, cast) ts.End(err) if err != nil { return err } } return nil } // PausedProvisioner is a Provisioner implementation that pauses before // the provisioner is actually run. type PausedProvisioner struct { PauseBefore time.Duration Provisioner packersdk.Provisioner } func (p *PausedProvisioner) ConfigSpec() hcldec.ObjectSpec { return p.ConfigSpec() } func (p *PausedProvisioner) FlatConfig() interface{} { return p.FlatConfig() } func (p *PausedProvisioner) Prepare(raws ...interface{}) error { return p.Provisioner.Prepare(raws...) } func (p *PausedProvisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { // Use a select to determine if we get cancelled during the wait ui.Say(fmt.Sprintf("Pausing %s before the next provisioner...", p.PauseBefore)) select { case <-time.After(p.PauseBefore): case <-ctx.Done(): return ctx.Err() } return p.Provisioner.Provision(ctx, ui, comm, generatedData) } // RetriedProvisioner is a Provisioner implementation that retries // the provisioner whenever there's an error. type RetriedProvisioner struct { MaxRetries int Provisioner packersdk.Provisioner } func (r *RetriedProvisioner) ConfigSpec() hcldec.ObjectSpec { return r.ConfigSpec() } func (r *RetriedProvisioner) FlatConfig() interface{} { return r.FlatConfig() } func (r *RetriedProvisioner) Prepare(raws ...interface{}) error { return r.Provisioner.Prepare(raws...) } func (r *RetriedProvisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { if ctx.Err() != nil { // context was cancelled return ctx.Err() } err := r.Provisioner.Provision(ctx, ui, comm, generatedData) if err == nil { return nil } leftTries := r.MaxRetries for ; leftTries > 0; leftTries-- { if ctx.Err() != nil { // context was cancelled return ctx.Err() } ui.Say(fmt.Sprintf("Provisioner failed with %q, retrying with %d trie(s) left", err, leftTries)) err := r.Provisioner.Provision(ctx, ui, comm, generatedData) if err == nil { return nil } } ui.Say("retry limit reached.") return err } // DebuggedProvisioner is a Provisioner implementation that waits until a key // press before the provisioner is actually run. type DebuggedProvisioner struct { Provisioner packersdk.Provisioner cancelCh chan struct{} doneCh chan struct{} lock sync.Mutex } func (p *DebuggedProvisioner) ConfigSpec() hcldec.ObjectSpec { return p.ConfigSpec() } func (p *DebuggedProvisioner) FlatConfig() interface{} { return p.FlatConfig() } func (p *DebuggedProvisioner) Prepare(raws ...interface{}) error { return p.Provisioner.Prepare(raws...) } func (p *DebuggedProvisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { // Use a select to determine if we get cancelled during the wait message := "Pausing before the next provisioner . Press enter to continue." result := make(chan string, 1) go func() { line, err := ui.Ask(message) if err != nil { log.Printf("Error asking for input: %s", err) } result <- line }() select { case <-result: case <-ctx.Done(): return ctx.Err() } return p.Provisioner.Provision(ctx, ui, comm, generatedData) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/provisioner_test.go���������������������������������������������������������0000664�0000000�0000000�00000017023�13771713062�0020700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "errors" "fmt" "testing" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestProvisionHook_Impl(t *testing.T) { var raw interface{} raw = &ProvisionHook{} if _, ok := raw.(packersdk.Hook); !ok { t.Fatalf("must be a Hook") } } func TestProvisionHook(t *testing.T) { pA := &packersdk.MockProvisioner{} pB := &packersdk.MockProvisioner{} ui := testUi() var comm packersdk.Communicator = new(packersdk.MockCommunicator) var data interface{} = nil hook := &ProvisionHook{ Provisioners: []*HookedProvisioner{ {pA, nil, ""}, {pB, nil, ""}, }, } hook.Run(context.Background(), "foo", ui, comm, data) if !pA.ProvCalled { t.Error("provision should be called on pA") } if !pB.ProvCalled { t.Error("provision should be called on pB") } } func TestProvisionHook_nilComm(t *testing.T) { pA := &packersdk.MockProvisioner{} pB := &packersdk.MockProvisioner{} ui := testUi() var comm packersdk.Communicator = nil var data interface{} = nil hook := &ProvisionHook{ Provisioners: []*HookedProvisioner{ {pA, nil, ""}, {pB, nil, ""}, }, } err := hook.Run(context.Background(), "foo", ui, comm, data) if err == nil { t.Fatal("should error") } } func TestProvisionHook_cancel(t *testing.T) { topCtx, topCtxCancel := context.WithCancel(context.Background()) p := &packersdk.MockProvisioner{ ProvFunc: func(ctx context.Context) error { topCtxCancel() <-ctx.Done() return ctx.Err() }, } hook := &ProvisionHook{ Provisioners: []*HookedProvisioner{ {p, nil, ""}, }, } err := hook.Run(topCtx, "foo", nil, new(packersdk.MockCommunicator), nil) if err == nil { t.Fatal("should have err") } } // TODO(mitchellh): Test that they're run in the proper order func TestPausedProvisioner_impl(t *testing.T) { var _ packersdk.Provisioner = new(PausedProvisioner) } func TestPausedProvisionerPrepare(t *testing.T) { mock := new(packersdk.MockProvisioner) prov := &PausedProvisioner{ Provisioner: mock, } prov.Prepare(42) if !mock.PrepCalled { t.Fatal("prepare should be called") } if mock.PrepConfigs[0] != 42 { t.Fatal("should have proper configs") } } func TestPausedProvisionerProvision(t *testing.T) { mock := new(packersdk.MockProvisioner) prov := &PausedProvisioner{ Provisioner: mock, } ui := testUi() comm := new(packersdk.MockCommunicator) prov.Provision(context.Background(), ui, comm, make(map[string]interface{})) if !mock.ProvCalled { t.Fatal("prov should be called") } if mock.ProvUi != ui { t.Fatal("should have proper ui") } if mock.ProvCommunicator != comm { t.Fatal("should have proper comm") } } func TestPausedProvisionerProvision_waits(t *testing.T) { startTime := time.Now() waitTime := 50 * time.Millisecond prov := &PausedProvisioner{ PauseBefore: waitTime, Provisioner: &packersdk.MockProvisioner{ ProvFunc: func(context.Context) error { timeSinceStartTime := time.Since(startTime) if timeSinceStartTime < waitTime { return fmt.Errorf("Spent not enough time waiting: %s", timeSinceStartTime) } return nil }, }, } err := prov.Provision(context.Background(), testUi(), new(packersdk.MockCommunicator), make(map[string]interface{})) if err != nil { t.Fatalf("prov failed: %v", err) } } func TestPausedProvisionerCancel(t *testing.T) { topCtx, cancelTopCtx := context.WithCancel(context.Background()) mock := new(packersdk.MockProvisioner) prov := &PausedProvisioner{ Provisioner: mock, } mock.ProvFunc = func(ctx context.Context) error { cancelTopCtx() <-ctx.Done() return ctx.Err() } err := prov.Provision(topCtx, testUi(), new(packersdk.MockCommunicator), make(map[string]interface{})) if err == nil { t.Fatal("should have err") } } func TestDebuggedProvisioner_impl(t *testing.T) { var _ packersdk.Provisioner = new(DebuggedProvisioner) } func TestDebuggedProvisionerPrepare(t *testing.T) { mock := new(packersdk.MockProvisioner) prov := &DebuggedProvisioner{ Provisioner: mock, } prov.Prepare(42) if !mock.PrepCalled { t.Fatal("prepare should be called") } if mock.PrepConfigs[0] != 42 { t.Fatal("should have proper configs") } } func TestDebuggedProvisionerProvision(t *testing.T) { mock := new(packersdk.MockProvisioner) prov := &DebuggedProvisioner{ Provisioner: mock, } ui := testUi() comm := new(packersdk.MockCommunicator) writeReader(ui, "\n") prov.Provision(context.Background(), ui, comm, make(map[string]interface{})) if !mock.ProvCalled { t.Fatal("prov should be called") } if mock.ProvUi != ui { t.Fatal("should have proper ui") } if mock.ProvCommunicator != comm { t.Fatal("should have proper comm") } } func TestDebuggedProvisionerCancel(t *testing.T) { topCtx, topCtxCancel := context.WithCancel(context.Background()) mock := new(packersdk.MockProvisioner) prov := &DebuggedProvisioner{ Provisioner: mock, } mock.ProvFunc = func(ctx context.Context) error { topCtxCancel() <-ctx.Done() return ctx.Err() } err := prov.Provision(topCtx, testUi(), new(packersdk.MockCommunicator), make(map[string]interface{})) if err == nil { t.Fatal("should have error") } } func TestRetriedProvisioner_impl(t *testing.T) { var _ packersdk.Provisioner = new(RetriedProvisioner) } func TestRetriedProvisionerPrepare(t *testing.T) { mock := new(packersdk.MockProvisioner) prov := &RetriedProvisioner{ Provisioner: mock, } err := prov.Prepare(42) if err != nil { t.Fatal("should not have errored") } if !mock.PrepCalled { t.Fatal("prepare should be called") } if mock.PrepConfigs[0] != 42 { t.Fatal("should have proper configs") } } func TestRetriedProvisionerProvision(t *testing.T) { mock := &packersdk.MockProvisioner{ ProvFunc: func(ctx context.Context) error { return errors.New("failed") }, } prov := &RetriedProvisioner{ MaxRetries: 2, Provisioner: mock, } ui := testUi() comm := new(packersdk.MockCommunicator) err := prov.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatal("should not have errored") } if !mock.ProvCalled { t.Fatal("prov should be called") } if !mock.ProvRetried { t.Fatal("prov should be retried") } if mock.ProvUi != ui { t.Fatal("should have proper ui") } if mock.ProvCommunicator != comm { t.Fatal("should have proper comm") } } func TestRetriedProvisionerCancelledProvision(t *testing.T) { // Don't retry if context is cancelled ctx, topCtxCancel := context.WithCancel(context.Background()) mock := &packersdk.MockProvisioner{ ProvFunc: func(ctx context.Context) error { topCtxCancel() <-ctx.Done() return ctx.Err() }, } prov := &RetriedProvisioner{ MaxRetries: 2, Provisioner: mock, } ui := testUi() comm := new(packersdk.MockCommunicator) err := prov.Provision(ctx, ui, comm, make(map[string]interface{})) if err == nil { t.Fatal("should have errored") } if !mock.ProvCalled { t.Fatal("prov should be called") } if mock.ProvRetried { t.Fatal("prov should NOT be retried") } if mock.ProvUi != ui { t.Fatal("should have proper ui") } if mock.ProvCommunicator != comm { t.Fatal("should have proper comm") } } func TestRetriedProvisionerCancel(t *testing.T) { topCtx, cancelTopCtx := context.WithCancel(context.Background()) mock := new(packersdk.MockProvisioner) prov := &RetriedProvisioner{ Provisioner: mock, } mock.ProvFunc = func(ctx context.Context) error { cancelTopCtx() <-ctx.Done() return ctx.Err() } err := prov.Provision(topCtx, testUi(), new(packersdk.MockCommunicator), make(map[string]interface{})) if err == nil { t.Fatal("should have err") } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/provisioner_timeout.go������������������������������������������������������0000664�0000000�0000000�00000002075�13771713062�0021410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "fmt" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // TimeoutProvisioner is a Provisioner implementation that can timeout after a // duration type TimeoutProvisioner struct { packersdk.Provisioner Timeout time.Duration } func (p *TimeoutProvisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ctx, cancel := context.WithTimeout(ctx, p.Timeout) defer cancel() // Use a select to determine if we get cancelled during the wait ui.Say(fmt.Sprintf("Setting a %s timeout for the next provisioner...", p.Timeout)) errC := make(chan interface{}) go func() { select { case <-errC: // all good case <-ctx.Done(): switch ctx.Err() { case context.DeadlineExceeded: ui.Error("Cancelling provisioner after a timeout...") default: // the context also gets cancelled when the provisioner is // successful } } }() err := p.Provisioner.Provision(ctx, ui, comm, generatedData) close(errC) return err } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/run_interfaces.go�����������������������������������������������������������0000664�0000000�0000000�00000003345�13771713062�0020273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "github.com/hashicorp/hcl/v2" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type GetBuildsOptions struct { // Get builds except the ones that match with except and with only the ones // that match with Only. When those are empty everything matches. Except, Only []string Debug, Force bool OnError string } type BuildGetter interface { // GetBuilds return all possible builds for a config. It also starts all // builders. // TODO(azr): rename to builder starter ? GetBuilds(GetBuildsOptions) ([]packersdk.Build, hcl.Diagnostics) } type Evaluator interface { // EvaluateExpression is meant to be used in the `packer console` command. // It parses the input string and returns what needs to be displayed. In // case of an error the error should be displayed. EvaluateExpression(expr string) (output string, exit bool, diags hcl.Diagnostics) } // The packer.Handler handles all Packer things. type Handler interface { Initialize() hcl.Diagnostics Evaluator BuildGetter ConfigFixer ConfigInspector } //go:generate enumer -type FixConfigMode type FixConfigMode int const ( // Stdout will make FixConfig simply print what the config should be; it // will only work when a single file is passed. Stdout FixConfigMode = iota // Inplace fixes your files on the spot. Inplace // Diff shows a full diff. Diff ) type FixConfigOptions struct { Mode FixConfigMode } type ConfigFixer interface { // FixConfig will output the config in a fixed manner. FixConfig(FixConfigOptions) hcl.Diagnostics } type InspectConfigOptions struct { packersdk.Ui } type ConfigInspector interface { // Inspect will output self inspection for a configuration InspectConfig(InspectConfigOptions) (ret int) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/telemetry.go����������������������������������������������������������������0000664�0000000�0000000�00000010220�13771713062�0017264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "context" "log" "os" "path/filepath" "sort" "time" checkpoint "github.com/hashicorp/go-checkpoint" "github.com/hashicorp/packer/packer-plugin-sdk/pathing" packerVersion "github.com/hashicorp/packer/version" ) const TelemetryVersion string = "beta/packer/5" const TelemetryPanicVersion string = "beta/packer_panic/4" var CheckpointReporter *CheckpointTelemetry type PackerReport struct { Spans []*TelemetrySpan `json:"spans"` ExitCode int `json:"exit_code"` Error string `json:"error"` Command string `json:"command"` } type CheckpointTelemetry struct { spans []*TelemetrySpan signatureFile string startTime time.Time } func NewCheckpointReporter(disableSignature bool) *CheckpointTelemetry { if disabled := os.Getenv("CHECKPOINT_DISABLE"); disabled != "" { return nil } configDir, err := pathing.ConfigDir() if err != nil { log.Printf("[WARN] (telemetry) setup error: %s", err) return nil } signatureFile := "" if disableSignature { log.Printf("[INFO] (telemetry) Checkpoint signature disabled") } else { signatureFile = filepath.Join(configDir, "checkpoint_signature") } return &CheckpointTelemetry{ signatureFile: signatureFile, startTime: time.Now().UTC(), } } func (c *CheckpointTelemetry) baseParams(prefix string) *checkpoint.ReportParams { version := packerVersion.Version if packerVersion.VersionPrerelease != "" { version += "-" + packerVersion.VersionPrerelease } return &checkpoint.ReportParams{ Product: "packer", SchemaVersion: prefix, StartTime: c.startTime, Version: version, RunID: os.Getenv("PACKER_RUN_UUID"), SignatureFile: c.signatureFile, } } func (c *CheckpointTelemetry) ReportPanic(m string) error { if c == nil { return nil } panicParams := c.baseParams(TelemetryPanicVersion) panicParams.Payload = m panicParams.EndTime = time.Now().UTC() // This timeout can be longer because it runs in the real main. // We're also okay waiting a bit longer to collect panic information ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() return checkpoint.Report(ctx, panicParams) } func (c *CheckpointTelemetry) AddSpan(name, pluginType string, options interface{}) *TelemetrySpan { if c == nil { return nil } log.Printf("[INFO] (telemetry) Starting %s %s", pluginType, name) ts := &TelemetrySpan{ Name: name, Options: flattenConfigKeys(options), StartTime: time.Now().UTC(), Type: pluginType, } c.spans = append(c.spans, ts) return ts } func (c *CheckpointTelemetry) Finalize(command string, errCode int, err error) error { if c == nil { return nil } params := c.baseParams(TelemetryVersion) params.EndTime = time.Now().UTC() extra := &PackerReport{ Spans: c.spans, ExitCode: errCode, Command: command, } if err != nil { extra.Error = err.Error() } params.Payload = extra // b, _ := json.MarshalIndent(params, "", " ") // log.Println(string(b)) ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() log.Printf("[INFO] (telemetry) Finalizing.") return checkpoint.Report(ctx, params) } type TelemetrySpan struct { EndTime time.Time `json:"end_time"` Error string `json:"error"` Name string `json:"name"` Options []string `json:"options"` StartTime time.Time `json:"start_time"` Type string `json:"type"` } func (s *TelemetrySpan) End(err error) { if s == nil { return } s.EndTime = time.Now().UTC() log.Printf("[INFO] (telemetry) ending %s", s.Name) if err != nil { s.Error = err.Error() } } func flattenConfigKeys(options interface{}) []string { var flatten func(string, interface{}) []string flatten = func(prefix string, options interface{}) (strOpts []string) { if m, ok := options.(map[string]interface{}); ok { for k, v := range m { if prefix != "" { k = prefix + "/" + k } if n, ok := v.(map[string]interface{}); ok { strOpts = append(strOpts, flatten(k, n)...) } else { strOpts = append(strOpts, k) } } } return } flattened := flatten("", options) sort.Strings(flattened) return flattened } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/telemetry_test.go�����������������������������������������������������������0000664�0000000�0000000�00000001075�13771713062�0020333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "testing" "github.com/stretchr/testify/assert" ) func TestFlattenConfigKeys_nil(t *testing.T) { f := flattenConfigKeys(nil) assert.Zero(t, f, "Expected empty list.") } func TestFlattenConfigKeys_nested(t *testing.T) { inp := make(map[string]interface{}) inp["A"] = "" inp["B"] = []string{} c := make(map[string]interface{}) c["X"] = "" d := make(map[string]interface{}) d["a"] = "" c["Y"] = d inp["C"] = c assert.Equal(t, []string{"A", "B", "C/X", "C/Y/a"}, flattenConfigKeys(inp), "Input didn't flatten correctly.", ) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/��������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017556�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-basic-interpolated-required.json������������������������0000664�0000000�0000000�00000000174�13771713062�0027137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "name": null }, "builders": [{ "name": "{{upper `name`}}", "type": "test" }] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-basic-interpolated.json���������������������������������0000664�0000000�0000000�00000000131�13771713062�0025312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "name": "{{upper `name`}}", "type": "test" }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-basic.json����������������������������������������������0000664�0000000�0000000�00000000065�13771713062�0022630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test" }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-env.json������������������������������������������������0000664�0000000�0000000�00000000236�13771713062�0022337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "var": "{{env `PACKER_TEST_ENV`}}" }, "builders": [{ "type": "test", "value": "{{user `var`}}" }] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-ignore-template-variable.json���������������������������0000664�0000000�0000000�00000000343�13771713062�0026425�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "var": "{{env `PACKER_TEST_ENV`}}_{{ .PACKER_TEST_TEMP }}", "http_ip": "{{ .HTTPIP }}", "array_var": "us-west-1,us-west-2" }, "builders": [{ "type": "test" }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-names-basic.json����������������������������������������0000664�0000000�0000000�00000000072�13771713062�0023727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "something"} ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-names-func.json�����������������������������������������0000664�0000000�0000000�00000000102�13771713062�0023573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "{{upper `tubes`}}"} ] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-pp.json�������������������������������������������������0000664�0000000�0000000�00000000127�13771713062�0022165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test" }], "post-processors": ["test"] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-prov-override.json��������������������������������������0000664�0000000�0000000�00000000316�13771713062�0024351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test" }], "provisioners": [{ "type": "test", "override": { "test": { "foo": "bar" } } }] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-prov-retry.json�����������������������������������������0000664�0000000�0000000�00000000377�13771713062�0023706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test" }], "provisioners": [ { "type": "test-integer", "max_retries": 1 }, { "type": "test-string", "max_retries": "1" } ] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-prov-skip-include.json����������������������������������0000664�0000000�0000000�00000000206�13771713062�0025117�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test" }], "provisioners": [{ "type": "test", "only": ["test"] }] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-prov-skip.json������������������������������������������0000664�0000000�0000000�00000000274�13771713062�0023503�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test" }, { "name": "foo", "type": "test" }], "provisioners": [{ "type": "test", "only": ["foo"] }] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-prov.json�����������������������������������������������0000664�0000000�0000000�00000000154�13771713062�0022534�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test" }], "provisioners": [{ "type": "test" }] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-split-func.json�����������������������������������������0000664�0000000�0000000�00000000147�13771713062�0023634�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test", "value": "{{split \"foo-bar\" \"-\" 0}}" }] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-template-path.json��������������������������������������0000664�0000000�0000000�00000000132�13771713062�0024307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test", "value": "{{template_dir}}" }] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-var-build-name.json�������������������������������������0000664�0000000�0000000�00000000130�13771713062�0024343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test", "value": "{{build_name}}" }] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-var-build-type.json�������������������������������������0000664�0000000�0000000�00000000130�13771713062�0024404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "test", "value": "{{build_type}}" }] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-var-file-interpolate.json�������������������������������0000664�0000000�0000000�00000000042�13771713062�0025573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "name": "{{ user `my_var` }}" }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-var-file-interpolate2.json������������������������������0000664�0000000�0000000�00000000047�13771713062�0025662�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "my_var": "interpolate this, yall" }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-variables-interpolate.json������������������������������0000664�0000000�0000000�00000000266�13771713062�0026046�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "foo": "bar", "bar": "{{user `foo`}}", "baz": "{{user `bar`}}baz", "bang": "bang{{user `baz`}}" }, "builders": [ {"type": "foo"} ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/build-variables-interpolate2.json�����������������������������0000664�0000000�0000000�00000000242�13771713062�0026122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "bar": "{{user `foo`}}", "baz": "{{user `bar`}}baz", "bang": "bang{{user `baz`}}" }, "builders": [ {"type": "foo"} ] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/complex-recursed-env-user-var-file.json�����������������������0000664�0000000�0000000�00000000425�13771713062�0027200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "env_1": "{{ env `INTERPOLATE_TEST_ENV_1` }}", "env_2": "{{ env `INTERPOLATE_TEST_ENV_2` }}", "env_3": "{{ env `INTERPOLATE_TEST_ENV_3` }}", "env_4": "{{ env `INTERPOLATE_TEST_ENV_4` }}" }, "builders": [{ "type": "test" }] }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/push-vars.json������������������������������������������������0000664�0000000�0000000�00000000215�13771713062�0022377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "foo": null }, "builders": [{"type": "test"}], "push": { "name": "{{user `foo`}}" } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/sensitive-variables.json��������������������������������������0000664�0000000�0000000�00000000332�13771713062�0024426�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "foo": "bar_extra_sensitive_probably_a_password" }, "sensitive-variables": [ "foo" ], "builders": [{ "type": "test", "value": "{{build_name}}" }] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/validate-dup-builder.json�������������������������������������0000664�0000000�0000000�00000000203�13771713062�0024447�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [ {"type": "foo"} ], "provisioners": [{ "type": "foo", "only": ["bar"] }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/validate-min-version-high.json��������������������������������0000664�0000000�0000000�00000000130�13771713062�0025415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "min_packer_version": "2.1.0", "builders": [ {"type": "foo"} ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/validate-min-version.json�������������������������������������0000664�0000000�0000000�00000000130�13771713062�0024500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "min_packer_version": "0.1.0", "builders": [ {"type": "foo"} ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/test-fixtures/validate-req-variable.json������������������������������������0000664�0000000�0000000�00000000143�13771713062�0024610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "foo": null }, "builders": [{ "type": "foo" }] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/testing.go������������������������������������������������������������������0000664�0000000�0000000�00000003445�13771713062�0016742�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "io/ioutil" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestCoreConfig(t *testing.T) *CoreConfig { // Create some test components components := ComponentFinder{ BuilderStore: packersdk.MapOfBuilder{ "test": func() (packersdk.Builder, error) { return &packersdk.MockBuilder{}, nil }, }, } return &CoreConfig{ Components: components, } } func TestCore(t *testing.T, c *CoreConfig) *Core { core := NewCore(c) err := core.Initialize() if err != nil { t.Fatalf("err: %s", err) } return core } func TestUi(t *testing.T) packersdk.Ui { var buf bytes.Buffer return &packersdk.BasicUi{ Reader: &buf, Writer: ioutil.Discard, ErrorWriter: ioutil.Discard, } } // TestBuilder sets the builder with the name n to the component finder // and returns the mock. func TestBuilder(t *testing.T, c *CoreConfig, n string) *packersdk.MockBuilder { var b packersdk.MockBuilder c.Components.BuilderStore = packersdk.MapOfBuilder{ n: func() (packersdk.Builder, error) { return &b, nil }, } return &b } // TestProvisioner sets the prov. with the name n to the component finder // and returns the mock. func TestProvisioner(t *testing.T, c *CoreConfig, n string) *packersdk.MockProvisioner { var b packersdk.MockProvisioner c.Components.ProvisionerStore = packersdk.MapOfProvisioner{ n: func() (packersdk.Provisioner, error) { return &b, nil }, } return &b } // TestPostProcessor sets the prov. with the name n to the component finder // and returns the mock. func TestPostProcessor(t *testing.T, c *CoreConfig, n string) *MockPostProcessor { var b MockPostProcessor c.Components.PostProcessorStore = packersdk.MapOfPostProcessor{ n: func() (packersdk.PostProcessor, error) { return &b, nil }, } return &b } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/ui.go�����������������������������������������������������������������������0000664�0000000�0000000�00000015077�13771713062�0015706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "errors" "fmt" "io" "log" "os" "runtime" "strings" "syscall" "time" "unicode" getter "github.com/hashicorp/go-getter/v2" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) var ErrInterrupted = errors.New("interrupted") type UiColor uint const ( UiColorRed UiColor = 31 UiColorGreen = 32 UiColorYellow = 33 UiColorBlue = 34 UiColorMagenta = 35 UiColorCyan = 36 ) // ColoredUi is a UI that is colored using terminal colors. type ColoredUi struct { Color UiColor ErrorColor UiColor Ui packersdk.Ui PB getter.ProgressTracker } var _ packersdk.Ui = new(ColoredUi) func (u *ColoredUi) Ask(query string) (string, error) { return u.Ui.Ask(u.colorize(query, u.Color, true)) } func (u *ColoredUi) Say(message string) { u.Ui.Say(u.colorize(message, u.Color, true)) } func (u *ColoredUi) Message(message string) { u.Ui.Message(u.colorize(message, u.Color, false)) } func (u *ColoredUi) Error(message string) { color := u.ErrorColor if color == 0 { color = UiColorRed } u.Ui.Error(u.colorize(message, color, true)) } func (u *ColoredUi) Machine(t string, args ...string) { // Don't colorize machine-readable output u.Ui.Machine(t, args...) } func (u *ColoredUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser { return u.Ui.TrackProgress(u.colorize(src, u.Color, false), currentSize, totalSize, stream) } func (u *ColoredUi) colorize(message string, color UiColor, bold bool) string { if !u.supportsColors() { return message } attr := 0 if bold { attr = 1 } return fmt.Sprintf("\033[%d;%dm%s\033[0m", attr, color, message) } func (u *ColoredUi) supportsColors() bool { // Never use colors if we have this environmental variable if os.Getenv("PACKER_NO_COLOR") != "" { return false } // For now, on non-Windows machine, just assume it does if runtime.GOOS != "windows" { return true } // On Windows, if we appear to be in Cygwin, then it does cygwin := os.Getenv("CYGWIN") != "" || os.Getenv("OSTYPE") == "cygwin" || os.Getenv("TERM") == "cygwin" return cygwin } // TargetedUI is a UI that wraps another UI implementation and modifies // the output to indicate a specific target. Specifically, all Say output // is prefixed with the target name. Message output is not prefixed but // is offset by the length of the target so that output is lined up properly // with Say output. Machine-readable output has the proper target set. type TargetedUI struct { Target string Ui packersdk.Ui } var _ packersdk.Ui = new(TargetedUI) func (u *TargetedUI) Ask(query string) (string, error) { return u.Ui.Ask(u.prefixLines(true, query)) } func (u *TargetedUI) Say(message string) { u.Ui.Say(u.prefixLines(true, message)) } func (u *TargetedUI) Message(message string) { u.Ui.Message(u.prefixLines(false, message)) } func (u *TargetedUI) Error(message string) { u.Ui.Error(u.prefixLines(true, message)) } func (u *TargetedUI) Machine(t string, args ...string) { // Prefix in the target, then pass through u.Ui.Machine(fmt.Sprintf("%s,%s", u.Target, t), args...) } func (u *TargetedUI) prefixLines(arrow bool, message string) string { arrowText := "==>" if !arrow { arrowText = strings.Repeat(" ", len(arrowText)) } var result bytes.Buffer for _, line := range strings.Split(message, "\n") { result.WriteString(fmt.Sprintf("%s %s: %s\n", arrowText, u.Target, line)) } return strings.TrimRightFunc(result.String(), unicode.IsSpace) } func (u *TargetedUI) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser { return u.Ui.TrackProgress(u.prefixLines(false, src), currentSize, totalSize, stream) } // MachineReadableUi is a UI that only outputs machine-readable output // to the given Writer. type MachineReadableUi struct { Writer io.Writer PB packersdk.NoopProgressTracker } var _ packersdk.Ui = new(MachineReadableUi) func (u *MachineReadableUi) Ask(query string) (string, error) { return "", errors.New("machine-readable UI can't ask") } func (u *MachineReadableUi) Say(message string) { u.Machine("ui", "say", message) } func (u *MachineReadableUi) Message(message string) { u.Machine("ui", "message", message) } func (u *MachineReadableUi) Error(message string) { u.Machine("ui", "error", message) } func (u *MachineReadableUi) Machine(category string, args ...string) { now := time.Now().UTC() // Determine if we have a target, and set it target := "" commaIdx := strings.Index(category, ",") if commaIdx > -1 { target = category[0:commaIdx] category = category[commaIdx+1:] } // Prepare the args for i, v := range args { // Use packersdk.LogSecretFilter to scrub out sensitive variables args[i] = packersdk.LogSecretFilter.FilterString(args[i]) args[i] = strings.Replace(v, ",", "%!(PACKER_COMMA)", -1) args[i] = strings.Replace(args[i], "\r", "\\r", -1) args[i] = strings.Replace(args[i], "\n", "\\n", -1) } argsString := strings.Join(args, ",") _, err := fmt.Fprintf(u.Writer, "%d,%s,%s,%s\n", now.Unix(), target, category, argsString) if err != nil { if err == syscall.EPIPE || strings.Contains(err.Error(), "broken pipe") { // Ignore epipe errors because that just means that the file // is probably closed or going to /dev/null or something. } else { panic(err) } } log.Printf("%d,%s,%s,%s\n", now.Unix(), target, category, argsString) } func (u *MachineReadableUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) { return u.PB.TrackProgress(src, currentSize, totalSize, stream) } // TimestampedUi is a UI that wraps another UI implementation and // prefixes each message with an RFC3339 timestamp type TimestampedUi struct { Ui packersdk.Ui PB getter.ProgressTracker } var _ packersdk.Ui = new(TimestampedUi) func (u *TimestampedUi) Ask(query string) (string, error) { return u.Ui.Ask(query) } func (u *TimestampedUi) Say(message string) { u.Ui.Say(u.timestampLine(message)) } func (u *TimestampedUi) Message(message string) { u.Ui.Message(u.timestampLine(message)) } func (u *TimestampedUi) Error(message string) { u.Ui.Error(u.timestampLine(message)) } func (u *TimestampedUi) Machine(message string, args ...string) { u.Ui.Machine(message, args...) } func (u *TimestampedUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) { return u.Ui.TrackProgress(src, currentSize, totalSize, stream) } func (u *TimestampedUi) timestampLine(string string) string { return fmt.Sprintf("%v: %v", time.Now().Format(time.RFC3339), string) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/packer/ui_test.go������������������������������������������������������������������0000664�0000000�0000000�00000014474�13771713062�0016745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package packer import ( "bytes" "os" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // This reads the output from the bytes.Buffer in our test object // and then resets the buffer. func readWriter(ui *packersdk.BasicUi) (result string) { buffer := ui.Writer.(*bytes.Buffer) result = buffer.String() buffer.Reset() return } // Reset the input Reader than add some input to it. func writeReader(ui *packersdk.BasicUi, input string) { buffer := ui.Reader.(*bytes.Buffer) buffer.WriteString(input) } func readErrorWriter(ui *packersdk.BasicUi) (result string) { buffer := ui.ErrorWriter.(*bytes.Buffer) result = buffer.String() buffer.Reset() return } func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), ErrorWriter: new(bytes.Buffer), TTY: new(testTTY), } } type testTTY struct { say string } func (tty *testTTY) Close() error { return nil } func (tty *testTTY) ReadString() (string, error) { return tty.say, nil } func TestColoredUi(t *testing.T) { bufferUi := testUi() ui := &ColoredUi{UiColorYellow, UiColorRed, bufferUi, &UiProgressBar{}} if !ui.supportsColors() { t.Skip("skipping for ui without color support") } ui.Say("foo") result := readWriter(bufferUi) if result != "\033[1;33mfoo\033[0m\n" { t.Fatalf("invalid output: %s", result) } ui.Message("foo") result = readWriter(bufferUi) if result != "\033[0;33mfoo\033[0m\n" { t.Fatalf("invalid output: %s", result) } ui.Error("foo") result = readWriter(bufferUi) if result != "" { t.Fatalf("invalid output: %s", result) } result = readErrorWriter(bufferUi) if result != "\033[1;31mfoo\033[0m\n" { t.Fatalf("invalid output: %s", result) } } func TestColoredUi_noColorEnv(t *testing.T) { bufferUi := testUi() ui := &ColoredUi{UiColorYellow, UiColorRed, bufferUi, &UiProgressBar{}} // Set the env var to get rid of the color oldenv := os.Getenv("PACKER_NO_COLOR") os.Setenv("PACKER_NO_COLOR", "1") defer os.Setenv("PACKER_NO_COLOR", oldenv) ui.Say("foo") result := readWriter(bufferUi) if result != "foo\n" { t.Fatalf("invalid output: %s", result) } ui.Message("foo") result = readWriter(bufferUi) if result != "foo\n" { t.Fatalf("invalid output: %s", result) } ui.Error("foo") result = readErrorWriter(bufferUi) if result != "foo\n" { t.Fatalf("invalid output: %s", result) } } func TestTargetedUI(t *testing.T) { bufferUi := testUi() targetedUi := &TargetedUI{ Target: "foo", Ui: bufferUi, } var actual, expected string targetedUi.Say("foo") actual = readWriter(bufferUi) expected = "==> foo: foo\n" if actual != expected { t.Fatalf("bad: %#v", actual) } targetedUi.Message("foo") actual = readWriter(bufferUi) expected = " foo: foo\n" if actual != expected { t.Fatalf("bad: %#v", actual) } targetedUi.Error("bar") actual = readErrorWriter(bufferUi) expected = "==> foo: bar\n" if actual != expected { t.Fatalf("bad: %#v", actual) } targetedUi.Say("foo\nbar") actual = readWriter(bufferUi) expected = "==> foo: foo\n==> foo: bar\n" if actual != expected { t.Fatalf("bad: %#v", actual) } } func TestColoredUi_ImplUi(t *testing.T) { var raw interface{} raw = &ColoredUi{} if _, ok := raw.(packersdk.Ui); !ok { t.Fatalf("ColoredUi must implement Ui") } } func TestTargetedUI_ImplUi(t *testing.T) { var raw interface{} raw = &TargetedUI{} if _, ok := raw.(packersdk.Ui); !ok { t.Fatalf("TargetedUI must implement Ui") } } func TestBasicUi_ImplUi(t *testing.T) { var raw interface{} raw = &packersdk.BasicUi{} if _, ok := raw.(packersdk.Ui); !ok { t.Fatalf("BasicUi must implement Ui") } } func TestBasicUi_Error(t *testing.T) { bufferUi := testUi() var actual, expected string bufferUi.Error("foo") actual = readErrorWriter(bufferUi) expected = "foo\n" if actual != expected { t.Fatalf("bad: %#v", actual) } bufferUi.ErrorWriter = nil bufferUi.Error("5") actual = readWriter(bufferUi) expected = "5\n" if actual != expected { t.Fatalf("bad: %#v", actual) } } func TestBasicUi_Say(t *testing.T) { bufferUi := testUi() var actual, expected string bufferUi.Say("foo") actual = readWriter(bufferUi) expected = "foo\n" if actual != expected { t.Fatalf("bad: %#v", actual) } bufferUi.Say("5") actual = readWriter(bufferUi) expected = "5\n" if actual != expected { t.Fatalf("bad: %#v", actual) } } func TestBasicUi_Ask(t *testing.T) { var actual, expected string var err error var testCases = []struct { Prompt, Input, Answer string }{ {"[c]ontinue or [a]bort", "c\n", "c"}, {"[c]ontinue or [a]bort", "c", "c"}, // Empty input shouldn't give an error {"Name", "Joe Bloggs\n", "Joe Bloggs"}, {"Name", "Joe Bloggs", "Joe Bloggs"}, {"Name", "\n", ""}, } for _, testCase := range testCases { // Because of the internal bufio we can't easily reset the input, so create a new one each time bufferUi := testUi() bufferUi.TTY = &testTTY{testCase.Input} actual, err = bufferUi.Ask(testCase.Prompt) if err != nil { t.Fatal(err) } if actual != testCase.Answer { t.Fatalf("bad answer: %#v", actual) } actual = readWriter(bufferUi) expected = testCase.Prompt + " " if actual != expected { t.Fatalf("bad prompt: %#v", actual) } } } func TestMachineReadableUi_ImplUi(t *testing.T) { var raw interface{} raw = &MachineReadableUi{} if _, ok := raw.(packersdk.Ui); !ok { t.Fatalf("MachineReadableUi must implement Ui") } } func TestMachineReadableUi(t *testing.T) { var data, expected string buf := new(bytes.Buffer) ui := &MachineReadableUi{Writer: buf} // No target ui.Machine("foo", "bar", "baz") data = strings.SplitN(buf.String(), ",", 2)[1] expected = ",foo,bar,baz\n" if data != expected { t.Fatalf("bad: %s", data) } // Target buf.Reset() ui.Machine("mitchellh,foo", "bar", "baz") data = strings.SplitN(buf.String(), ",", 2)[1] expected = "mitchellh,foo,bar,baz\n" if data != expected { t.Fatalf("bad: %s", data) } // Commas buf.Reset() ui.Machine("foo", "foo,bar") data = strings.SplitN(buf.String(), ",", 2)[1] expected = ",foo,foo%!(PACKER_COMMA)bar\n" if data != expected { t.Fatalf("bad: %s", data) } // New lines buf.Reset() ui.Machine("foo", "foo\n") data = strings.SplitN(buf.String(), ",", 2)[1] expected = ",foo,foo\\n\n" if data != expected { t.Fatalf("bad: %#v", data) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/panic.go���������������������������������������������������������������������������0000664�0000000�0000000�00000004005�13771713062�0015103�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "fmt" "io" "os" "strings" "github.com/hashicorp/packer/packer" "github.com/mitchellh/panicwrap" ) // This is output if a panic happens. const panicOutput = ` !!!!!!!!!!!!!!!!!!!!!!!!!!! PACKER CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! Packer crashed! This is always indicative of a bug within Packer. A crash log has been placed at "crash.log" relative to your current working directory. It would be immensely helpful if you could please report the crash with Packer[1] so that we can fix this. [1]: https://github.com/hashicorp/packer/issues !!!!!!!!!!!!!!!!!!!!!!!!!!! PACKER CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! ` // panicHandler is what is called by panicwrap when a panic is encountered // within Packer. It is guaranteed to run after the resulting process has // exited so we can take the log file, add in the panic, and store it // somewhere locally. func panicHandler(logF *os.File) panicwrap.HandlerFunc { return func(m string) { // Write away just output this thing on stderr so that it gets // shown in case anything below fails. fmt.Fprintf(os.Stderr, fmt.Sprintf("%s\n", m)) if err := packer.CheckpointReporter.ReportPanic(m); err != nil { fmt.Fprintf(os.Stderr, "Failed to report panic. This is safe to ignore: %s", err) } // Create the crash log file where we'll write the logs f, err := os.Create("crash.log") if err != nil { fmt.Fprintf(os.Stderr, "Failed to create crash log file: %s", err) return } defer f.Close() // Seek the log file back to the beginning if _, err = logF.Seek(0, 0); err != nil { fmt.Fprintf(os.Stderr, "Failed to seek log file for crash: %s", err) return } // Copy the contents to the crash file. This will include // the panic that just happened. if _, err = io.Copy(f, logF); err != nil { fmt.Fprintf(os.Stderr, "Failed to write crash log: %s", err) return } // Tell the user a crash occurred in some helpful way that // they'll hopefully notice. fmt.Printf("\n\n") fmt.Println(strings.TrimSpace(panicOutput)) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/��������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016465�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/alicloud-import/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021571�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/alicloud-import/post-processor.go�����������������������������������0000664�0000000�0000000�00000037463�13771713062�0025137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config //go:generate struct-markdown package alicloudimport import ( "context" "fmt" "log" "strconv" "strings" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs" "github.com/aliyun/alibaba-cloud-sdk-go/services/ram" "github.com/aliyun/aliyun-oss-go-sdk/oss" "github.com/hashicorp/hcl/v2/hcldec" packerecs "github.com/hashicorp/packer/builder/alicloud/ecs" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) const ( Packer = "HashiCorp-Packer" BuilderId = "packer.post-processor.alicloud-import" OSSSuffix = "oss-" RAWFileFormat = "raw" VHDFileFormat = "vhd" ) const ( PolicyTypeSystem = "System" NoSetRoleError = "NoSetRoletoECSServiceAcount" RoleNotExistError = "EntityNotExist.Role" DefaultImportRoleName = "AliyunECSImageImportDefaultRole" DefaultImportPolicyName = "AliyunECSImageImportRolePolicy" DefaultImportRolePolicy = `{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": [ "ecs.aliyuncs.com" ] } } ], "Version": "1" }` ) // Configuration of this post processor type Config struct { packerecs.Config `mapstructure:",squash"` // The name of the OSS bucket where the RAW or VHD file will be copied to // for import. If the Bucket doesn't exist, the post-process will create it for // you. OSSBucket string `mapstructure:"oss_bucket_name" required:"true"` // The name of the object key in `oss_bucket_name` where the RAW or VHD // file will be copied to for import. This is treated as a [template // engine](/docs/templates/engine), and you may access any of the variables // stored in the generated data using the [build](/docs/templates/engine) // template function. OSSKey string `mapstructure:"oss_key_name"` // Whether we should skip removing the RAW or VHD file uploaded to OSS // after the import process has completed. `true` means that we should // leave it in the OSS bucket, `false` means to clean it out. Defaults to // `false`. SkipClean bool `mapstructure:"skip_clean"` Tags map[string]string `mapstructure:"tags"` // The description of the image, with a length limit of `0` to `256` // characters. Leaving it blank means null, which is the default value. It // cannot begin with `http://` or `https://`. AlicloudImageDescription string `mapstructure:"image_description"` AlicloudImageShareAccounts []string `mapstructure:"image_share_account"` AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions"` // Type of the OS, like linux/windows OSType string `mapstructure:"image_os_type" required:"true"` // Platform such as `CentOS` Platform string `mapstructure:"image_platform" required:"true"` // Platform type of the image system: `i386` or `x86_64` Architecture string `mapstructure:"image_architecture" required:"true"` // Size of the system disk, in GB, values // range: // - cloud - 5 \~ 2000 // - cloud_efficiency - 20 \~ 2048 // - cloud_ssd - 20 \~ 2048 Size string `mapstructure:"image_system_size"` // The format of the image for import, now alicloud only support RAW and // VHD. Format string `mapstructure:"format" required:"true"` // If this value is true, when the target image name is duplicated with an // existing image, it will delete the existing image and then create the // target image, otherwise, the creation will fail. The default value is // false. AlicloudImageForceDelete bool `mapstructure:"image_force_delete"` ctx interpolate.Context } type PostProcessor struct { config Config DiskDeviceMapping []ecs.DiskDeviceMapping ossClient *oss.Client ramClient *ram.Client } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "oss_key_name", }, }, }, raws...) if err != nil { return err } errs := new(packersdk.MultiError) // Check and render oss_key_name if err = interpolate.Validate(p.config.OSSKey, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing oss_key_name template: %s", err)) } errs = packersdk.MultiErrorAppend(errs, p.config.AlicloudImageTag.CopyOn(&p.config.AlicloudImageTags)...) // Check we have alicloud access variables defined somewhere errs = packersdk.MultiErrorAppend(errs, p.config.AlicloudAccessConfig.Prepare(&p.config.ctx)...) // define all our required parameters templates := map[string]*string{ "oss_bucket_name": &p.config.OSSBucket, } // Check out required params are defined for key, ptr := range templates { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } // Anything which flagged return back up the stack if len(errs.Errors) > 0 { return errs } packersdk.LogSecretFilter.Set(p.config.AlicloudAccessKey, p.config.AlicloudSecretKey) log.Println(p.config) return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { var err error generatedData := artifact.State("generated_data") if generatedData == nil { // Make sure it's not a nil map so we can assign to it later. generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData // Render this key since we didn't in the configure phase p.config.OSSKey, err = interpolate.Render(p.config.OSSKey, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error rendering oss_key_name template: %s", err) } if p.config.OSSKey == "" { p.config.OSSKey = "Packer_" + strconv.Itoa(time.Now().Nanosecond()) } ui.Say(fmt.Sprintf("Rendered oss_key_name as %s", p.config.OSSKey)) ui.Say("Looking for RAW or VHD in artifact") // Locate the files output from the builder source := "" for _, path := range artifact.Files() { if strings.HasSuffix(path, VHDFileFormat) || strings.HasSuffix(path, RAWFileFormat) { source = path break } } // Hope we found something useful if source == "" { return nil, false, false, fmt.Errorf("No vhd or raw file found in artifact from builder") } ecsClient, err := p.config.AlicloudAccessConfig.Client() if err != nil { return nil, false, false, fmt.Errorf("Failed to connect alicloud ecs %s", err) } endpoint := getEndPoint(p.config.AlicloudRegion, p.config.OSSBucket) describeImagesRequest := ecs.CreateDescribeImagesRequest() describeImagesRequest.RegionId = p.config.AlicloudRegion describeImagesRequest.ImageName = p.config.AlicloudImageName imagesResponse, err := ecsClient.DescribeImages(describeImagesRequest) if err != nil { return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) } images := imagesResponse.Images.Image if len(images) > 0 && !p.config.AlicloudImageForceDelete { return nil, false, false, fmt.Errorf("Duplicated image exists, please delete the existing images " + "or set the 'image_force_delete' value as true") } bucket, err := p.queryOrCreateBucket(p.config.OSSBucket) if err != nil { return nil, false, false, fmt.Errorf("Failed to query or create bucket %s: %s", p.config.OSSBucket, err) } ui.Say(fmt.Sprintf("Waiting for uploading file %s to %s/%s...", source, endpoint, p.config.OSSKey)) err = bucket.PutObjectFromFile(p.config.OSSKey, source) if err != nil { return nil, false, false, fmt.Errorf("Failed to upload image %s: %s", source, err) } ui.Say(fmt.Sprintf("Image file %s has been uploaded to OSS", source)) if len(images) > 0 && p.config.AlicloudImageForceDelete { deleteImageRequest := ecs.CreateDeleteImageRequest() deleteImageRequest.RegionId = p.config.AlicloudRegion deleteImageRequest.ImageId = images[0].ImageId _, err := ecsClient.DeleteImage(deleteImageRequest) if err != nil { return nil, false, false, fmt.Errorf("Delete duplicated image %s failed", images[0].ImageName) } } importImageRequest := p.buildImportImageRequest() importImageResponse, err := ecsClient.ImportImage(importImageRequest) if err != nil { e, ok := err.(errors.Error) if !ok || e.ErrorCode() != NoSetRoleError { return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) } ui.Say("initialize ram role for importing image") if err := p.prepareImportRole(); err != nil { return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) } acsResponse, err := ecsClient.WaitForExpected(&packerecs.WaitForExpectArgs{ RequestFunc: func() (responses.AcsResponse, error) { return ecsClient.ImportImage(importImageRequest) }, EvalFunc: func(response responses.AcsResponse, err error) packerecs.WaitForExpectEvalResult { if err == nil { return packerecs.WaitForExpectSuccess } e, ok = err.(errors.Error) if ok && packerecs.ContainsInArray([]string{ "ImageIsImporting", "InvalidImageName.Duplicated", }, e.ErrorCode()) { return packerecs.WaitForExpectSuccess } if ok && e.ErrorCode() != NoSetRoleError { return packerecs.WaitForExpectFailToStop } return packerecs.WaitForExpectToRetry }, }) if err != nil { return nil, false, false, fmt.Errorf("Failed to start import from %s/%s: %s", endpoint, p.config.OSSKey, err) } importImageResponse = acsResponse.(*ecs.ImportImageResponse) } imageId := importImageResponse.ImageId ui.Say(fmt.Sprintf("Waiting for importing %s/%s to alicloud...", endpoint, p.config.OSSKey)) _, err = ecsClient.WaitForImageStatus(p.config.AlicloudRegion, imageId, packerecs.ImageStatusAvailable, time.Duration(packerecs.ALICLOUD_DEFAULT_LONG_TIMEOUT)*time.Second) if err != nil { return nil, false, false, fmt.Errorf("Import image %s failed: %s", imageId, err) } // Add the reported Alicloud image ID to the artifact list ui.Say(fmt.Sprintf("Importing created alicloud image ID %s in region %s Finished.", imageId, p.config.AlicloudRegion)) artifact = &packerecs.Artifact{ AlicloudImages: map[string]string{ p.config.AlicloudRegion: imageId, }, BuilderIdValue: BuilderId, Client: ecsClient, } if !p.config.SkipClean { ui.Message(fmt.Sprintf("Deleting import source %s/%s/%s", endpoint, p.config.OSSBucket, p.config.OSSKey)) if err = bucket.DeleteObject(p.config.OSSKey); err != nil { return nil, false, false, fmt.Errorf("Failed to delete %s/%s/%s: %s", endpoint, p.config.OSSBucket, p.config.OSSKey, err) } } return artifact, false, false, nil } func (p *PostProcessor) getOssClient() *oss.Client { if p.ossClient == nil { log.Println("Creating OSS Client") ossClient, _ := oss.New(getEndPoint(p.config.AlicloudRegion, ""), p.config.AlicloudAccessKey, p.config.AlicloudSecretKey) p.ossClient = ossClient } return p.ossClient } func (p *PostProcessor) getRamClient() *ram.Client { if p.ramClient == nil { ramClient, _ := ram.NewClientWithAccessKey(p.config.AlicloudRegion, p.config.AlicloudAccessKey, p.config.AlicloudSecretKey) p.ramClient = ramClient } return p.ramClient } func (p *PostProcessor) queryOrCreateBucket(bucketName string) (*oss.Bucket, error) { ossClient := p.getOssClient() isExist, err := ossClient.IsBucketExist(bucketName) if err != nil { return nil, err } if !isExist { err = ossClient.CreateBucket(bucketName) if err != nil { return nil, err } } bucket, err := ossClient.Bucket(bucketName) if err != nil { return nil, err } return bucket, nil } func (p *PostProcessor) prepareImportRole() error { ramClient := p.getRamClient() getRoleRequest := ram.CreateGetRoleRequest() getRoleRequest.SetScheme(requests.HTTPS) getRoleRequest.RoleName = DefaultImportRoleName _, err := ramClient.GetRole(getRoleRequest) if err == nil { if e := p.updateOrAttachPolicy(); e != nil { return e } return nil } e, ok := err.(errors.Error) if !ok || e.ErrorCode() != RoleNotExistError { return e } if err := p.createRoleAndAttachPolicy(); err != nil { return err } time.Sleep(1 * time.Minute) return nil } func (p *PostProcessor) updateOrAttachPolicy() error { ramClient := p.getRamClient() listPoliciesForRoleRequest := ram.CreateListPoliciesForRoleRequest() listPoliciesForRoleRequest.SetScheme(requests.HTTPS) listPoliciesForRoleRequest.RoleName = DefaultImportRoleName policyListResponse, err := p.ramClient.ListPoliciesForRole(listPoliciesForRoleRequest) if err != nil { return fmt.Errorf("Failed to list policies: %s", err) } rolePolicyExists := false for _, policy := range policyListResponse.Policies.Policy { if policy.PolicyName == DefaultImportPolicyName && policy.PolicyType == PolicyTypeSystem { rolePolicyExists = true break } } if rolePolicyExists { updateRoleRequest := ram.CreateUpdateRoleRequest() updateRoleRequest.SetScheme(requests.HTTPS) updateRoleRequest.RoleName = DefaultImportRoleName updateRoleRequest.NewAssumeRolePolicyDocument = DefaultImportRolePolicy if _, err := ramClient.UpdateRole(updateRoleRequest); err != nil { return fmt.Errorf("Failed to update role policy: %s", err) } } else { attachPolicyToRoleRequest := ram.CreateAttachPolicyToRoleRequest() attachPolicyToRoleRequest.SetScheme(requests.HTTPS) attachPolicyToRoleRequest.PolicyName = DefaultImportPolicyName attachPolicyToRoleRequest.PolicyType = PolicyTypeSystem attachPolicyToRoleRequest.RoleName = DefaultImportRoleName if _, err := ramClient.AttachPolicyToRole(attachPolicyToRoleRequest); err != nil { return fmt.Errorf("Failed to attach role policy: %s", err) } } return nil } func (p *PostProcessor) createRoleAndAttachPolicy() error { ramClient := p.getRamClient() createRoleRequest := ram.CreateCreateRoleRequest() createRoleRequest.SetScheme(requests.HTTPS) createRoleRequest.RoleName = DefaultImportRoleName createRoleRequest.AssumeRolePolicyDocument = DefaultImportRolePolicy if _, err := ramClient.CreateRole(createRoleRequest); err != nil { return fmt.Errorf("Failed to create role: %s", err) } attachPolicyToRoleRequest := ram.CreateAttachPolicyToRoleRequest() attachPolicyToRoleRequest.SetScheme(requests.HTTPS) attachPolicyToRoleRequest.PolicyName = DefaultImportPolicyName attachPolicyToRoleRequest.PolicyType = PolicyTypeSystem attachPolicyToRoleRequest.RoleName = DefaultImportRoleName if _, err := ramClient.AttachPolicyToRole(attachPolicyToRoleRequest); err != nil { return fmt.Errorf("Failed to attach policy: %s", err) } return nil } func (p *PostProcessor) buildImportImageRequest() *ecs.ImportImageRequest { request := ecs.CreateImportImageRequest() request.RegionId = p.config.AlicloudRegion request.ImageName = p.config.AlicloudImageName request.Description = p.config.AlicloudImageDescription request.Architecture = p.config.Architecture request.OSType = p.config.OSType request.Platform = p.config.Platform request.DiskDeviceMapping = &[]ecs.ImportImageDiskDeviceMapping{ { DiskImageSize: p.config.Size, Format: p.config.Format, OSSBucket: p.config.OSSBucket, OSSObject: p.config.OSSKey, }, } return request } func getEndPoint(region string, bucket string) string { if bucket != "" { return "https://" + bucket + "." + getOSSRegion(region) + ".aliyuncs.com" } return "https://" + getOSSRegion(region) + ".aliyuncs.com" } func getOSSRegion(region string) string { if strings.HasPrefix(region, OSSSuffix) { return region } return OSSSuffix + region } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/alicloud-import/post-processor.hcl2spec.go��������������������������0000664�0000000�0000000�00000074162�13771713062�0026636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package alicloudimport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/alicloud/ecs" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` AlicloudAccessKey *string `mapstructure:"access_key" required:"true" cty:"access_key" hcl:"access_key"` AlicloudSecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key" hcl:"secret_key"` AlicloudRegion *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"` AlicloudSkipValidation *bool `mapstructure:"skip_region_validation" required:"false" cty:"skip_region_validation" hcl:"skip_region_validation"` AlicloudSkipImageValidation *bool `mapstructure:"skip_image_validation" required:"false" cty:"skip_image_validation" hcl:"skip_image_validation"` AlicloudProfile *string `mapstructure:"profile" required:"false" cty:"profile" hcl:"profile"` AlicloudSharedCredentialsFile *string `mapstructure:"shared_credentials_file" required:"false" cty:"shared_credentials_file" hcl:"shared_credentials_file"` SecurityToken *string `mapstructure:"security_token" required:"false" cty:"security_token" hcl:"security_token"` AlicloudImageName *string `mapstructure:"image_name" required:"true" cty:"image_name" hcl:"image_name"` AlicloudImageVersion *string `mapstructure:"image_version" required:"false" cty:"image_version" hcl:"image_version"` AlicloudImageDescription *string `mapstructure:"image_description" required:"false" cty:"image_description" hcl:"image_description"` AlicloudImageShareAccounts []string `mapstructure:"image_share_account" required:"false" cty:"image_share_account" hcl:"image_share_account"` AlicloudImageUNShareAccounts []string `mapstructure:"image_unshare_account" cty:"image_unshare_account" hcl:"image_unshare_account"` AlicloudImageDestinationRegions []string `mapstructure:"image_copy_regions" required:"false" cty:"image_copy_regions" hcl:"image_copy_regions"` AlicloudImageDestinationNames []string `mapstructure:"image_copy_names" required:"false" cty:"image_copy_names" hcl:"image_copy_names"` ImageEncrypted *bool `mapstructure:"image_encrypted" required:"false" cty:"image_encrypted" hcl:"image_encrypted"` AlicloudImageForceDelete *bool `mapstructure:"image_force_delete" required:"false" cty:"image_force_delete" hcl:"image_force_delete"` AlicloudImageForceDeleteSnapshots *bool `mapstructure:"image_force_delete_snapshots" required:"false" cty:"image_force_delete_snapshots" hcl:"image_force_delete_snapshots"` AlicloudImageForceDeleteInstances *bool `mapstructure:"image_force_delete_instances" cty:"image_force_delete_instances" hcl:"image_force_delete_instances"` AlicloudImageIgnoreDataDisks *bool `mapstructure:"image_ignore_data_disks" required:"false" cty:"image_ignore_data_disks" hcl:"image_ignore_data_disks"` AlicloudImageTags map[string]string `mapstructure:"tags" required:"false" cty:"tags" hcl:"tags"` AlicloudImageTag []config.FlatKeyValue `mapstructure:"tag" required:"false" cty:"tag" hcl:"tag"` ECSSystemDiskMapping *ecs.FlatAlicloudDiskDevice `mapstructure:"system_disk_mapping" required:"false" cty:"system_disk_mapping" hcl:"system_disk_mapping"` ECSImagesDiskMappings []ecs.FlatAlicloudDiskDevice `mapstructure:"image_disk_mappings" required:"false" cty:"image_disk_mappings" hcl:"image_disk_mappings"` AssociatePublicIpAddress *bool `mapstructure:"associate_public_ip_address" cty:"associate_public_ip_address" hcl:"associate_public_ip_address"` ZoneId *string `mapstructure:"zone_id" required:"false" cty:"zone_id" hcl:"zone_id"` IOOptimized *bool `mapstructure:"io_optimized" required:"false" cty:"io_optimized" hcl:"io_optimized"` InstanceType *string `mapstructure:"instance_type" required:"true" cty:"instance_type" hcl:"instance_type"` Description *string `mapstructure:"description" cty:"description" hcl:"description"` AlicloudSourceImage *string `mapstructure:"source_image" required:"true" cty:"source_image" hcl:"source_image"` ForceStopInstance *bool `mapstructure:"force_stop_instance" required:"false" cty:"force_stop_instance" hcl:"force_stop_instance"` DisableStopInstance *bool `mapstructure:"disable_stop_instance" required:"false" cty:"disable_stop_instance" hcl:"disable_stop_instance"` SecurityGroupId *string `mapstructure:"security_group_id" required:"false" cty:"security_group_id" hcl:"security_group_id"` SecurityGroupName *string `mapstructure:"security_group_name" required:"false" cty:"security_group_name" hcl:"security_group_name"` UserData *string `mapstructure:"user_data" required:"false" cty:"user_data" hcl:"user_data"` UserDataFile *string `mapstructure:"user_data_file" required:"false" cty:"user_data_file" hcl:"user_data_file"` VpcId *string `mapstructure:"vpc_id" required:"false" cty:"vpc_id" hcl:"vpc_id"` VpcName *string `mapstructure:"vpc_name" required:"false" cty:"vpc_name" hcl:"vpc_name"` CidrBlock *string `mapstructure:"vpc_cidr_block" required:"false" cty:"vpc_cidr_block" hcl:"vpc_cidr_block"` VSwitchId *string `mapstructure:"vswitch_id" required:"false" cty:"vswitch_id" hcl:"vswitch_id"` VSwitchName *string `mapstructure:"vswitch_name" required:"false" cty:"vswitch_name" hcl:"vswitch_name"` InstanceName *string `mapstructure:"instance_name" required:"false" cty:"instance_name" hcl:"instance_name"` InternetChargeType *string `mapstructure:"internet_charge_type" required:"false" cty:"internet_charge_type" hcl:"internet_charge_type"` InternetMaxBandwidthOut *int `mapstructure:"internet_max_bandwidth_out" required:"false" cty:"internet_max_bandwidth_out" hcl:"internet_max_bandwidth_out"` WaitSnapshotReadyTimeout *int `mapstructure:"wait_snapshot_ready_timeout" required:"false" cty:"wait_snapshot_ready_timeout" hcl:"wait_snapshot_ready_timeout"` Type *string `mapstructure:"communicator" cty:"communicator" hcl:"communicator"` PauseBeforeConnect *string `mapstructure:"pause_before_connecting" cty:"pause_before_connecting" hcl:"pause_before_connecting"` SSHHost *string `mapstructure:"ssh_host" cty:"ssh_host" hcl:"ssh_host"` SSHPort *int `mapstructure:"ssh_port" cty:"ssh_port" hcl:"ssh_port"` SSHUsername *string `mapstructure:"ssh_username" cty:"ssh_username" hcl:"ssh_username"` SSHPassword *string `mapstructure:"ssh_password" cty:"ssh_password" hcl:"ssh_password"` SSHKeyPairName *string `mapstructure:"ssh_keypair_name" undocumented:"true" cty:"ssh_keypair_name" hcl:"ssh_keypair_name"` SSHTemporaryKeyPairName *string `mapstructure:"temporary_key_pair_name" undocumented:"true" cty:"temporary_key_pair_name" hcl:"temporary_key_pair_name"` SSHTemporaryKeyPairType *string `mapstructure:"temporary_key_pair_type" cty:"temporary_key_pair_type" hcl:"temporary_key_pair_type"` SSHTemporaryKeyPairBits *int `mapstructure:"temporary_key_pair_bits" cty:"temporary_key_pair_bits" hcl:"temporary_key_pair_bits"` SSHCiphers []string `mapstructure:"ssh_ciphers" cty:"ssh_ciphers" hcl:"ssh_ciphers"` SSHClearAuthorizedKeys *bool `mapstructure:"ssh_clear_authorized_keys" cty:"ssh_clear_authorized_keys" hcl:"ssh_clear_authorized_keys"` SSHKEXAlgos []string `mapstructure:"ssh_key_exchange_algorithms" cty:"ssh_key_exchange_algorithms" hcl:"ssh_key_exchange_algorithms"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" undocumented:"true" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` SSHCertificateFile *string `mapstructure:"ssh_certificate_file" cty:"ssh_certificate_file" hcl:"ssh_certificate_file"` SSHPty *bool `mapstructure:"ssh_pty" cty:"ssh_pty" hcl:"ssh_pty"` SSHTimeout *string `mapstructure:"ssh_timeout" cty:"ssh_timeout" hcl:"ssh_timeout"` SSHWaitTimeout *string `mapstructure:"ssh_wait_timeout" undocumented:"true" cty:"ssh_wait_timeout" hcl:"ssh_wait_timeout"` SSHAgentAuth *bool `mapstructure:"ssh_agent_auth" undocumented:"true" cty:"ssh_agent_auth" hcl:"ssh_agent_auth"` SSHDisableAgentForwarding *bool `mapstructure:"ssh_disable_agent_forwarding" cty:"ssh_disable_agent_forwarding" hcl:"ssh_disable_agent_forwarding"` SSHHandshakeAttempts *int `mapstructure:"ssh_handshake_attempts" cty:"ssh_handshake_attempts" hcl:"ssh_handshake_attempts"` SSHBastionHost *string `mapstructure:"ssh_bastion_host" cty:"ssh_bastion_host" hcl:"ssh_bastion_host"` SSHBastionPort *int `mapstructure:"ssh_bastion_port" cty:"ssh_bastion_port" hcl:"ssh_bastion_port"` SSHBastionAgentAuth *bool `mapstructure:"ssh_bastion_agent_auth" cty:"ssh_bastion_agent_auth" hcl:"ssh_bastion_agent_auth"` SSHBastionUsername *string `mapstructure:"ssh_bastion_username" cty:"ssh_bastion_username" hcl:"ssh_bastion_username"` SSHBastionPassword *string `mapstructure:"ssh_bastion_password" cty:"ssh_bastion_password" hcl:"ssh_bastion_password"` SSHBastionInteractive *bool `mapstructure:"ssh_bastion_interactive" cty:"ssh_bastion_interactive" hcl:"ssh_bastion_interactive"` SSHBastionPrivateKeyFile *string `mapstructure:"ssh_bastion_private_key_file" cty:"ssh_bastion_private_key_file" hcl:"ssh_bastion_private_key_file"` SSHBastionCertificateFile *string `mapstructure:"ssh_bastion_certificate_file" cty:"ssh_bastion_certificate_file" hcl:"ssh_bastion_certificate_file"` SSHFileTransferMethod *string `mapstructure:"ssh_file_transfer_method" cty:"ssh_file_transfer_method" hcl:"ssh_file_transfer_method"` SSHProxyHost *string `mapstructure:"ssh_proxy_host" cty:"ssh_proxy_host" hcl:"ssh_proxy_host"` SSHProxyPort *int `mapstructure:"ssh_proxy_port" cty:"ssh_proxy_port" hcl:"ssh_proxy_port"` SSHProxyUsername *string `mapstructure:"ssh_proxy_username" cty:"ssh_proxy_username" hcl:"ssh_proxy_username"` SSHProxyPassword *string `mapstructure:"ssh_proxy_password" cty:"ssh_proxy_password" hcl:"ssh_proxy_password"` SSHKeepAliveInterval *string `mapstructure:"ssh_keep_alive_interval" cty:"ssh_keep_alive_interval" hcl:"ssh_keep_alive_interval"` SSHReadWriteTimeout *string `mapstructure:"ssh_read_write_timeout" cty:"ssh_read_write_timeout" hcl:"ssh_read_write_timeout"` SSHRemoteTunnels []string `mapstructure:"ssh_remote_tunnels" cty:"ssh_remote_tunnels" hcl:"ssh_remote_tunnels"` SSHLocalTunnels []string `mapstructure:"ssh_local_tunnels" cty:"ssh_local_tunnels" hcl:"ssh_local_tunnels"` SSHPublicKey []byte `mapstructure:"ssh_public_key" undocumented:"true" cty:"ssh_public_key" hcl:"ssh_public_key"` SSHPrivateKey []byte `mapstructure:"ssh_private_key" undocumented:"true" cty:"ssh_private_key" hcl:"ssh_private_key"` WinRMUser *string `mapstructure:"winrm_username" cty:"winrm_username" hcl:"winrm_username"` WinRMPassword *string `mapstructure:"winrm_password" cty:"winrm_password" hcl:"winrm_password"` WinRMHost *string `mapstructure:"winrm_host" cty:"winrm_host" hcl:"winrm_host"` WinRMNoProxy *bool `mapstructure:"winrm_no_proxy" cty:"winrm_no_proxy" hcl:"winrm_no_proxy"` WinRMPort *int `mapstructure:"winrm_port" cty:"winrm_port" hcl:"winrm_port"` WinRMTimeout *string `mapstructure:"winrm_timeout" cty:"winrm_timeout" hcl:"winrm_timeout"` WinRMUseSSL *bool `mapstructure:"winrm_use_ssl" cty:"winrm_use_ssl" hcl:"winrm_use_ssl"` WinRMInsecure *bool `mapstructure:"winrm_insecure" cty:"winrm_insecure" hcl:"winrm_insecure"` WinRMUseNTLM *bool `mapstructure:"winrm_use_ntlm" cty:"winrm_use_ntlm" hcl:"winrm_use_ntlm"` SSHPrivateIp *bool `mapstructure:"ssh_private_ip" required:"false" cty:"ssh_private_ip" hcl:"ssh_private_ip"` OSSBucket *string `mapstructure:"oss_bucket_name" required:"true" cty:"oss_bucket_name" hcl:"oss_bucket_name"` OSSKey *string `mapstructure:"oss_key_name" cty:"oss_key_name" hcl:"oss_key_name"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"` OSType *string `mapstructure:"image_os_type" required:"true" cty:"image_os_type" hcl:"image_os_type"` Platform *string `mapstructure:"image_platform" required:"true" cty:"image_platform" hcl:"image_platform"` Architecture *string `mapstructure:"image_architecture" required:"true" cty:"image_architecture" hcl:"image_architecture"` Size *string `mapstructure:"image_system_size" cty:"image_system_size" hcl:"image_system_size"` Format *string `mapstructure:"format" required:"true" cty:"format" hcl:"format"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "access_key": &hcldec.AttrSpec{Name: "access_key", Type: cty.String, Required: false}, "secret_key": &hcldec.AttrSpec{Name: "secret_key", Type: cty.String, Required: false}, "region": &hcldec.AttrSpec{Name: "region", Type: cty.String, Required: false}, "skip_region_validation": &hcldec.AttrSpec{Name: "skip_region_validation", Type: cty.Bool, Required: false}, "skip_image_validation": &hcldec.AttrSpec{Name: "skip_image_validation", Type: cty.Bool, Required: false}, "profile": &hcldec.AttrSpec{Name: "profile", Type: cty.String, Required: false}, "shared_credentials_file": &hcldec.AttrSpec{Name: "shared_credentials_file", Type: cty.String, Required: false}, "security_token": &hcldec.AttrSpec{Name: "security_token", Type: cty.String, Required: false}, "image_name": &hcldec.AttrSpec{Name: "image_name", Type: cty.String, Required: false}, "image_version": &hcldec.AttrSpec{Name: "image_version", Type: cty.String, Required: false}, "image_description": &hcldec.AttrSpec{Name: "image_description", Type: cty.String, Required: false}, "image_share_account": &hcldec.AttrSpec{Name: "image_share_account", Type: cty.List(cty.String), Required: false}, "image_unshare_account": &hcldec.AttrSpec{Name: "image_unshare_account", Type: cty.List(cty.String), Required: false}, "image_copy_regions": &hcldec.AttrSpec{Name: "image_copy_regions", Type: cty.List(cty.String), Required: false}, "image_copy_names": &hcldec.AttrSpec{Name: "image_copy_names", Type: cty.List(cty.String), Required: false}, "image_encrypted": &hcldec.AttrSpec{Name: "image_encrypted", Type: cty.Bool, Required: false}, "image_force_delete": &hcldec.AttrSpec{Name: "image_force_delete", Type: cty.Bool, Required: false}, "image_force_delete_snapshots": &hcldec.AttrSpec{Name: "image_force_delete_snapshots", Type: cty.Bool, Required: false}, "image_force_delete_instances": &hcldec.AttrSpec{Name: "image_force_delete_instances", Type: cty.Bool, Required: false}, "image_ignore_data_disks": &hcldec.AttrSpec{Name: "image_ignore_data_disks", Type: cty.Bool, Required: false}, "tags": &hcldec.AttrSpec{Name: "tags", Type: cty.Map(cty.String), Required: false}, "tag": &hcldec.BlockListSpec{TypeName: "tag", Nested: hcldec.ObjectSpec((*config.FlatKeyValue)(nil).HCL2Spec())}, "system_disk_mapping": &hcldec.BlockSpec{TypeName: "system_disk_mapping", Nested: hcldec.ObjectSpec((*ecs.FlatAlicloudDiskDevice)(nil).HCL2Spec())}, "image_disk_mappings": &hcldec.BlockListSpec{TypeName: "image_disk_mappings", Nested: hcldec.ObjectSpec((*ecs.FlatAlicloudDiskDevice)(nil).HCL2Spec())}, "associate_public_ip_address": &hcldec.AttrSpec{Name: "associate_public_ip_address", Type: cty.Bool, Required: false}, "zone_id": &hcldec.AttrSpec{Name: "zone_id", Type: cty.String, Required: false}, "io_optimized": &hcldec.AttrSpec{Name: "io_optimized", Type: cty.Bool, Required: false}, "instance_type": &hcldec.AttrSpec{Name: "instance_type", Type: cty.String, Required: false}, "description": &hcldec.AttrSpec{Name: "description", Type: cty.String, Required: false}, "source_image": &hcldec.AttrSpec{Name: "source_image", Type: cty.String, Required: false}, "force_stop_instance": &hcldec.AttrSpec{Name: "force_stop_instance", Type: cty.Bool, Required: false}, "disable_stop_instance": &hcldec.AttrSpec{Name: "disable_stop_instance", Type: cty.Bool, Required: false}, "security_group_id": &hcldec.AttrSpec{Name: "security_group_id", Type: cty.String, Required: false}, "security_group_name": &hcldec.AttrSpec{Name: "security_group_name", Type: cty.String, Required: false}, "user_data": &hcldec.AttrSpec{Name: "user_data", Type: cty.String, Required: false}, "user_data_file": &hcldec.AttrSpec{Name: "user_data_file", Type: cty.String, Required: false}, "vpc_id": &hcldec.AttrSpec{Name: "vpc_id", Type: cty.String, Required: false}, "vpc_name": &hcldec.AttrSpec{Name: "vpc_name", Type: cty.String, Required: false}, "vpc_cidr_block": &hcldec.AttrSpec{Name: "vpc_cidr_block", Type: cty.String, Required: false}, "vswitch_id": &hcldec.AttrSpec{Name: "vswitch_id", Type: cty.String, Required: false}, "vswitch_name": &hcldec.AttrSpec{Name: "vswitch_name", Type: cty.String, Required: false}, "instance_name": &hcldec.AttrSpec{Name: "instance_name", Type: cty.String, Required: false}, "internet_charge_type": &hcldec.AttrSpec{Name: "internet_charge_type", Type: cty.String, Required: false}, "internet_max_bandwidth_out": &hcldec.AttrSpec{Name: "internet_max_bandwidth_out", Type: cty.Number, Required: false}, "wait_snapshot_ready_timeout": &hcldec.AttrSpec{Name: "wait_snapshot_ready_timeout", Type: cty.Number, Required: false}, "communicator": &hcldec.AttrSpec{Name: "communicator", Type: cty.String, Required: false}, "pause_before_connecting": &hcldec.AttrSpec{Name: "pause_before_connecting", Type: cty.String, Required: false}, "ssh_host": &hcldec.AttrSpec{Name: "ssh_host", Type: cty.String, Required: false}, "ssh_port": &hcldec.AttrSpec{Name: "ssh_port", Type: cty.Number, Required: false}, "ssh_username": &hcldec.AttrSpec{Name: "ssh_username", Type: cty.String, Required: false}, "ssh_password": &hcldec.AttrSpec{Name: "ssh_password", Type: cty.String, Required: false}, "ssh_keypair_name": &hcldec.AttrSpec{Name: "ssh_keypair_name", Type: cty.String, Required: false}, "temporary_key_pair_name": &hcldec.AttrSpec{Name: "temporary_key_pair_name", Type: cty.String, Required: false}, "temporary_key_pair_type": &hcldec.AttrSpec{Name: "temporary_key_pair_type", Type: cty.String, Required: false}, "temporary_key_pair_bits": &hcldec.AttrSpec{Name: "temporary_key_pair_bits", Type: cty.Number, Required: false}, "ssh_ciphers": &hcldec.AttrSpec{Name: "ssh_ciphers", Type: cty.List(cty.String), Required: false}, "ssh_clear_authorized_keys": &hcldec.AttrSpec{Name: "ssh_clear_authorized_keys", Type: cty.Bool, Required: false}, "ssh_key_exchange_algorithms": &hcldec.AttrSpec{Name: "ssh_key_exchange_algorithms", Type: cty.List(cty.String), Required: false}, "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, "ssh_certificate_file": &hcldec.AttrSpec{Name: "ssh_certificate_file", Type: cty.String, Required: false}, "ssh_pty": &hcldec.AttrSpec{Name: "ssh_pty", Type: cty.Bool, Required: false}, "ssh_timeout": &hcldec.AttrSpec{Name: "ssh_timeout", Type: cty.String, Required: false}, "ssh_wait_timeout": &hcldec.AttrSpec{Name: "ssh_wait_timeout", Type: cty.String, Required: false}, "ssh_agent_auth": &hcldec.AttrSpec{Name: "ssh_agent_auth", Type: cty.Bool, Required: false}, "ssh_disable_agent_forwarding": &hcldec.AttrSpec{Name: "ssh_disable_agent_forwarding", Type: cty.Bool, Required: false}, "ssh_handshake_attempts": &hcldec.AttrSpec{Name: "ssh_handshake_attempts", Type: cty.Number, Required: false}, "ssh_bastion_host": &hcldec.AttrSpec{Name: "ssh_bastion_host", Type: cty.String, Required: false}, "ssh_bastion_port": &hcldec.AttrSpec{Name: "ssh_bastion_port", Type: cty.Number, Required: false}, "ssh_bastion_agent_auth": &hcldec.AttrSpec{Name: "ssh_bastion_agent_auth", Type: cty.Bool, Required: false}, "ssh_bastion_username": &hcldec.AttrSpec{Name: "ssh_bastion_username", Type: cty.String, Required: false}, "ssh_bastion_password": &hcldec.AttrSpec{Name: "ssh_bastion_password", Type: cty.String, Required: false}, "ssh_bastion_interactive": &hcldec.AttrSpec{Name: "ssh_bastion_interactive", Type: cty.Bool, Required: false}, "ssh_bastion_private_key_file": &hcldec.AttrSpec{Name: "ssh_bastion_private_key_file", Type: cty.String, Required: false}, "ssh_bastion_certificate_file": &hcldec.AttrSpec{Name: "ssh_bastion_certificate_file", Type: cty.String, Required: false}, "ssh_file_transfer_method": &hcldec.AttrSpec{Name: "ssh_file_transfer_method", Type: cty.String, Required: false}, "ssh_proxy_host": &hcldec.AttrSpec{Name: "ssh_proxy_host", Type: cty.String, Required: false}, "ssh_proxy_port": &hcldec.AttrSpec{Name: "ssh_proxy_port", Type: cty.Number, Required: false}, "ssh_proxy_username": &hcldec.AttrSpec{Name: "ssh_proxy_username", Type: cty.String, Required: false}, "ssh_proxy_password": &hcldec.AttrSpec{Name: "ssh_proxy_password", Type: cty.String, Required: false}, "ssh_keep_alive_interval": &hcldec.AttrSpec{Name: "ssh_keep_alive_interval", Type: cty.String, Required: false}, "ssh_read_write_timeout": &hcldec.AttrSpec{Name: "ssh_read_write_timeout", Type: cty.String, Required: false}, "ssh_remote_tunnels": &hcldec.AttrSpec{Name: "ssh_remote_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_local_tunnels": &hcldec.AttrSpec{Name: "ssh_local_tunnels", Type: cty.List(cty.String), Required: false}, "ssh_public_key": &hcldec.AttrSpec{Name: "ssh_public_key", Type: cty.List(cty.Number), Required: false}, "ssh_private_key": &hcldec.AttrSpec{Name: "ssh_private_key", Type: cty.List(cty.Number), Required: false}, "winrm_username": &hcldec.AttrSpec{Name: "winrm_username", Type: cty.String, Required: false}, "winrm_password": &hcldec.AttrSpec{Name: "winrm_password", Type: cty.String, Required: false}, "winrm_host": &hcldec.AttrSpec{Name: "winrm_host", Type: cty.String, Required: false}, "winrm_no_proxy": &hcldec.AttrSpec{Name: "winrm_no_proxy", Type: cty.Bool, Required: false}, "winrm_port": &hcldec.AttrSpec{Name: "winrm_port", Type: cty.Number, Required: false}, "winrm_timeout": &hcldec.AttrSpec{Name: "winrm_timeout", Type: cty.String, Required: false}, "winrm_use_ssl": &hcldec.AttrSpec{Name: "winrm_use_ssl", Type: cty.Bool, Required: false}, "winrm_insecure": &hcldec.AttrSpec{Name: "winrm_insecure", Type: cty.Bool, Required: false}, "winrm_use_ntlm": &hcldec.AttrSpec{Name: "winrm_use_ntlm", Type: cty.Bool, Required: false}, "ssh_private_ip": &hcldec.AttrSpec{Name: "ssh_private_ip", Type: cty.Bool, Required: false}, "oss_bucket_name": &hcldec.AttrSpec{Name: "oss_bucket_name", Type: cty.String, Required: false}, "oss_key_name": &hcldec.AttrSpec{Name: "oss_key_name", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "image_os_type": &hcldec.AttrSpec{Name: "image_os_type", Type: cty.String, Required: false}, "image_platform": &hcldec.AttrSpec{Name: "image_platform", Type: cty.String, Required: false}, "image_architecture": &hcldec.AttrSpec{Name: "image_architecture", Type: cty.String, Required: false}, "image_system_size": &hcldec.AttrSpec{Name: "image_system_size", Type: cty.String, Required: false}, "format": &hcldec.AttrSpec{Name: "format", Type: cty.String, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/alicloud-import/version/��������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023256�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/alicloud-import/version/version.go����������������������������������0000664�0000000�0000000�00000000515�13771713062�0025273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var AlicloudImportPluginVersion *version.PluginVersion func init() { AlicloudImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/amazon-import/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021262�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/amazon-import/post-processor.go�������������������������������������0000664�0000000�0000000�00000034734�13771713062�0024626�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package amazonimport import ( "context" "fmt" "log" "os" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/hashicorp/hcl/v2/hcldec" awscommon "github.com/hashicorp/packer/builder/amazon/common" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) const BuilderId = "packer.post-processor.amazon-import" // Configuration of this post processor type Config struct { common.PackerConfig `mapstructure:",squash"` awscommon.AccessConfig `mapstructure:",squash"` // Variables specific to this post processor S3Bucket string `mapstructure:"s3_bucket_name"` S3Key string `mapstructure:"s3_key_name"` S3Encryption string `mapstructure:"s3_encryption"` S3EncryptionKey string `mapstructure:"s3_encryption_key"` SkipClean bool `mapstructure:"skip_clean"` Tags map[string]string `mapstructure:"tags"` Name string `mapstructure:"ami_name"` Description string `mapstructure:"ami_description"` Users []string `mapstructure:"ami_users"` Groups []string `mapstructure:"ami_groups"` Encrypt bool `mapstructure:"ami_encrypt"` KMSKey string `mapstructure:"ami_kms_key"` LicenseType string `mapstructure:"license_type"` RoleName string `mapstructure:"role_name"` Format string `mapstructure:"format"` ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { p.config.ctx.Funcs = awscommon.TemplateFuncs err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "s3_key_name", }, }, }, raws...) if err != nil { return err } // Set defaults if p.config.Format == "" { p.config.Format = "ova" } if p.config.S3Key == "" { p.config.S3Key = "packer-import-{{timestamp}}." + p.config.Format } errs := new(packersdk.MultiError) // Check and render s3_key_name if err = interpolate.Validate(p.config.S3Key, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing s3_key_name template: %s", err)) } // Check we have AWS access variables defined somewhere errs = packersdk.MultiErrorAppend(errs, p.config.AccessConfig.Prepare(&p.config.ctx)...) // define all our required parameters templates := map[string]*string{ "s3_bucket_name": &p.config.S3Bucket, } // Check out required params are defined for key, ptr := range templates { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } switch p.config.Format { case "ova", "raw", "vmdk", "vhd", "vhdx": default: errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("invalid format '%s'. Only 'ova', 'raw', 'vhd', 'vhdx', or 'vmdk' are allowed", p.config.Format)) } if p.config.S3Encryption != "" && p.config.S3Encryption != "AES256" && p.config.S3Encryption != "aws:kms" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("invalid s3 encryption format '%s'. Only 'AES256' and 'aws:kms' are allowed", p.config.S3Encryption)) } // Anything which flagged return back up the stack if len(errs.Errors) > 0 { return errs } if p.config.PollingConfig == nil { p.config.PollingConfig = new(awscommon.AWSPollingConfig) } p.config.PollingConfig.LogEnvOverrideWarnings() packersdk.LogSecretFilter.Set(p.config.AccessKey, p.config.SecretKey, p.config.Token) log.Println(p.config) return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { var err error generatedData := artifact.State("generated_data") if generatedData == nil { // Make sure it's not a nil map so we can assign to it later. generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData session, err := p.config.Session() if err != nil { return nil, false, false, err } config := session.Config // Render this key since we didn't in the configure phase p.config.S3Key, err = interpolate.Render(p.config.S3Key, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error rendering s3_key_name template: %s", err) } log.Printf("Rendered s3_key_name as %s", p.config.S3Key) log.Println("Looking for image in artifact") // Locate the files output from the builder source := "" for _, path := range artifact.Files() { if strings.HasSuffix(path, "."+p.config.Format) { source = path break } } // Hope we found something useful if source == "" { return nil, false, false, fmt.Errorf("No %s image file found in artifact from builder", p.config.Format) } if p.config.S3Encryption == "AES256" && p.config.S3EncryptionKey != "" { ui.Message(fmt.Sprintf("Ignoring s3_encryption_key because s3_encryption is set to '%s'", p.config.S3Encryption)) } // open the source file log.Printf("Opening file %s to upload", source) file, err := os.Open(source) if err != nil { return nil, false, false, fmt.Errorf("Failed to open %s: %s", source, err) } ui.Message(fmt.Sprintf("Uploading %s to s3://%s/%s", source, p.config.S3Bucket, p.config.S3Key)) // Prepare S3 request updata := &s3manager.UploadInput{ Body: file, Bucket: &p.config.S3Bucket, Key: &p.config.S3Key, } // Add encryption if specified in the config if p.config.S3Encryption != "" { updata.ServerSideEncryption = &p.config.S3Encryption if p.config.S3Encryption == "aws:kms" && p.config.S3EncryptionKey != "" { updata.SSEKMSKeyId = &p.config.S3EncryptionKey } } // Copy the image file into the S3 bucket specified uploader := s3manager.NewUploader(session) if _, err = uploader.Upload(updata); err != nil { return nil, false, false, fmt.Errorf("Failed to upload %s: %s", source, err) } // May as well stop holding this open now file.Close() ui.Message(fmt.Sprintf("Completed upload of %s to s3://%s/%s", source, p.config.S3Bucket, p.config.S3Key)) // Call EC2 image import process log.Printf("Calling EC2 to import from s3://%s/%s", p.config.S3Bucket, p.config.S3Key) ec2conn := ec2.New(session) params := &ec2.ImportImageInput{ Encrypted: &p.config.Encrypt, DiskContainers: []*ec2.ImageDiskContainer{ { Format: &p.config.Format, UserBucket: &ec2.UserBucket{ S3Bucket: &p.config.S3Bucket, S3Key: &p.config.S3Key, }, }, }, } if p.config.Encrypt && p.config.KMSKey != "" { params.KmsKeyId = &p.config.KMSKey } if p.config.RoleName != "" { params.SetRoleName(p.config.RoleName) } if p.config.LicenseType != "" { ui.Message(fmt.Sprintf("Setting license type to '%s'", p.config.LicenseType)) params.LicenseType = &p.config.LicenseType } var import_start *ec2.ImportImageOutput err = retry.Config{ Tries: 11, RetryDelay: (&retry.Backoff{InitialBackoff: 200 * time.Millisecond, MaxBackoff: 30 * time.Second, Multiplier: 2}).Linear, }.Run(ctx, func(ctx context.Context) error { import_start, err = ec2conn.ImportImage(params) return err }) if err != nil { return nil, false, false, fmt.Errorf("Failed to start import from s3://%s/%s: %s", p.config.S3Bucket, p.config.S3Key, err) } ui.Message(fmt.Sprintf("Started import of s3://%s/%s, task id %s", p.config.S3Bucket, p.config.S3Key, *import_start.ImportTaskId)) // Wait for import process to complete, this takes a while ui.Message(fmt.Sprintf("Waiting for task %s to complete (may take a while)", *import_start.ImportTaskId)) err = p.config.PollingConfig.WaitUntilImageImported(aws.BackgroundContext(), ec2conn, *import_start.ImportTaskId) if err != nil { // Retrieve the status message import_result, err2 := ec2conn.DescribeImportImageTasks(&ec2.DescribeImportImageTasksInput{ ImportTaskIds: []*string{ import_start.ImportTaskId, }, }) statusMessage := "Error retrieving status message" if err2 == nil { statusMessage = *import_result.ImportImageTasks[0].StatusMessage } return nil, false, false, fmt.Errorf("Import task %s failed with status message: %s, error: %s", *import_start.ImportTaskId, statusMessage, err) } // Retrieve what the outcome was for the import task import_result, err := ec2conn.DescribeImportImageTasks(&ec2.DescribeImportImageTasksInput{ ImportTaskIds: []*string{ import_start.ImportTaskId, }, }) if err != nil { return nil, false, false, fmt.Errorf("Failed to find import task %s: %s", *import_start.ImportTaskId, err) } // Check it was actually completed if *import_result.ImportImageTasks[0].Status != "completed" { // The most useful error message is from the job itself return nil, false, false, fmt.Errorf("Import task %s failed: %s", *import_start.ImportTaskId, *import_result.ImportImageTasks[0].StatusMessage) } ui.Message(fmt.Sprintf("Import task %s complete", *import_start.ImportTaskId)) // Pull AMI ID out of the completed job createdami := *import_result.ImportImageTasks[0].ImageId if p.config.Name != "" { ui.Message(fmt.Sprintf("Starting rename of AMI (%s)", createdami)) copyInput := &ec2.CopyImageInput{ Name: &p.config.Name, SourceImageId: &createdami, SourceRegion: config.Region, } if p.config.Encrypt { copyInput.Encrypted = aws.Bool(p.config.Encrypt) if p.config.KMSKey != "" { copyInput.KmsKeyId = &p.config.KMSKey } } resp, err := ec2conn.CopyImage(copyInput) if err != nil { return nil, false, false, fmt.Errorf("Error Copying AMI (%s): %s", createdami, err) } ui.Message(fmt.Sprintf("Waiting for AMI rename to complete (may take a while)")) if err := p.config.PollingConfig.WaitUntilAMIAvailable(aws.BackgroundContext(), ec2conn, *resp.ImageId); err != nil { return nil, false, false, fmt.Errorf("Error waiting for AMI (%s): %s", *resp.ImageId, err) } // Clean up intermediary image now that it has successfully been renamed. ui.Message("Destroying intermediary AMI...") err = awscommon.DestroyAMIs([]*string{&createdami}, ec2conn) if err != nil { return nil, false, false, fmt.Errorf("Error deregistering existing AMI: %s", err) } ui.Message(fmt.Sprintf("AMI rename completed")) createdami = *resp.ImageId } // If we have tags, then apply them now to both the AMI and snaps // created by the import if len(p.config.Tags) > 0 { var ec2Tags []*ec2.Tag log.Printf("Repacking tags into AWS format") for key, value := range p.config.Tags { ui.Message(fmt.Sprintf("Adding tag \"%s\": \"%s\"", key, value)) ec2Tags = append(ec2Tags, &ec2.Tag{ Key: aws.String(key), Value: aws.String(value), }) } resourceIds := []*string{&createdami} log.Printf("Getting details of %s", createdami) imageResp, err := ec2conn.DescribeImages(&ec2.DescribeImagesInput{ ImageIds: resourceIds, }) if err != nil { return nil, false, false, fmt.Errorf("Failed to retrieve details for AMI %s: %s", createdami, err) } if len(imageResp.Images) == 0 { return nil, false, false, fmt.Errorf("AMI %s has no images", createdami) } image := imageResp.Images[0] log.Printf("Walking block device mappings for %s to find snapshots", createdami) for _, device := range image.BlockDeviceMappings { if device.Ebs != nil && device.Ebs.SnapshotId != nil { ui.Message(fmt.Sprintf("Tagging snapshot %s", *device.Ebs.SnapshotId)) resourceIds = append(resourceIds, device.Ebs.SnapshotId) } } ui.Message(fmt.Sprintf("Tagging AMI %s", createdami)) _, err = ec2conn.CreateTags(&ec2.CreateTagsInput{ Resources: resourceIds, Tags: ec2Tags, }) if err != nil { return nil, false, false, fmt.Errorf("Failed to add tags to resources %#v: %s", resourceIds, err) } } // Apply attributes for AMI specified in config // (duped from builder/amazon/common/step_modify_ami_attributes.go) options := make(map[string]*ec2.ModifyImageAttributeInput) if p.config.Description != "" { options["description"] = &ec2.ModifyImageAttributeInput{ Description: &ec2.AttributeValue{Value: &p.config.Description}, } } if len(p.config.Groups) > 0 { groups := make([]*string, len(p.config.Groups)) adds := make([]*ec2.LaunchPermission, len(p.config.Groups)) addGroups := &ec2.ModifyImageAttributeInput{ LaunchPermission: &ec2.LaunchPermissionModifications{}, } for i, g := range p.config.Groups { groups[i] = aws.String(g) adds[i] = &ec2.LaunchPermission{ Group: aws.String(g), } } addGroups.UserGroups = groups addGroups.LaunchPermission.Add = adds options["groups"] = addGroups } if len(p.config.Users) > 0 { users := make([]*string, len(p.config.Users)) adds := make([]*ec2.LaunchPermission, len(p.config.Users)) for i, u := range p.config.Users { users[i] = aws.String(u) adds[i] = &ec2.LaunchPermission{UserId: aws.String(u)} } options["users"] = &ec2.ModifyImageAttributeInput{ UserIds: users, LaunchPermission: &ec2.LaunchPermissionModifications{ Add: adds, }, } } if len(options) > 0 { for name, input := range options { ui.Message(fmt.Sprintf("Modifying: %s", name)) input.ImageId = &createdami _, err := ec2conn.ModifyImageAttribute(input) if err != nil { return nil, false, false, fmt.Errorf("Error modifying AMI attributes: %s", err) } } } // Add the reported AMI ID to the artifact list log.Printf("Adding created AMI ID %s in region %s to output artifacts", createdami, *config.Region) artifact = &awscommon.Artifact{ Amis: map[string]string{ *config.Region: createdami, }, BuilderIdValue: BuilderId, Session: session, } if !p.config.SkipClean { ui.Message(fmt.Sprintf("Deleting import source s3://%s/%s", p.config.S3Bucket, p.config.S3Key)) s3conn := s3.New(session) _, err = s3conn.DeleteObject(&s3.DeleteObjectInput{ Bucket: &p.config.S3Bucket, Key: &p.config.S3Key, }) if err != nil { return nil, false, false, fmt.Errorf("Failed to delete s3://%s/%s: %s", p.config.S3Bucket, p.config.S3Key, err) } } return artifact, false, false, nil } ������������������������������������packer-1.6.6+ds1/post-processor/amazon-import/post-processor.hcl2spec.go����������������������������0000664�0000000�0000000�00000025122�13771713062�0026317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package amazonimport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/amazon/common" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` AccessKey *string `mapstructure:"access_key" required:"true" cty:"access_key" hcl:"access_key"` AssumeRole *common.FlatAssumeRoleConfig `mapstructure:"assume_role" required:"false" cty:"assume_role" hcl:"assume_role"` CustomEndpointEc2 *string `mapstructure:"custom_endpoint_ec2" required:"false" cty:"custom_endpoint_ec2" hcl:"custom_endpoint_ec2"` CredsFilename *string `mapstructure:"shared_credentials_file" required:"false" cty:"shared_credentials_file" hcl:"shared_credentials_file"` DecodeAuthZMessages *bool `mapstructure:"decode_authorization_messages" required:"false" cty:"decode_authorization_messages" hcl:"decode_authorization_messages"` InsecureSkipTLSVerify *bool `mapstructure:"insecure_skip_tls_verify" required:"false" cty:"insecure_skip_tls_verify" hcl:"insecure_skip_tls_verify"` MaxRetries *int `mapstructure:"max_retries" required:"false" cty:"max_retries" hcl:"max_retries"` MFACode *string `mapstructure:"mfa_code" required:"false" cty:"mfa_code" hcl:"mfa_code"` ProfileName *string `mapstructure:"profile" required:"false" cty:"profile" hcl:"profile"` RawRegion *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"` SecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key" hcl:"secret_key"` SkipMetadataApiCheck *bool `mapstructure:"skip_metadata_api_check" cty:"skip_metadata_api_check" hcl:"skip_metadata_api_check"` SkipCredsValidation *bool `mapstructure:"skip_credential_validation" cty:"skip_credential_validation" hcl:"skip_credential_validation"` Token *string `mapstructure:"token" required:"false" cty:"token" hcl:"token"` VaultAWSEngine *common.FlatVaultAWSEngineOptions `mapstructure:"vault_aws_engine" required:"false" cty:"vault_aws_engine" hcl:"vault_aws_engine"` PollingConfig *common.FlatAWSPollingConfig `mapstructure:"aws_polling" required:"false" cty:"aws_polling" hcl:"aws_polling"` S3Bucket *string `mapstructure:"s3_bucket_name" cty:"s3_bucket_name" hcl:"s3_bucket_name"` S3Key *string `mapstructure:"s3_key_name" cty:"s3_key_name" hcl:"s3_key_name"` S3Encryption *string `mapstructure:"s3_encryption" cty:"s3_encryption" hcl:"s3_encryption"` S3EncryptionKey *string `mapstructure:"s3_encryption_key" cty:"s3_encryption_key" hcl:"s3_encryption_key"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"` Tags map[string]string `mapstructure:"tags" cty:"tags" hcl:"tags"` Name *string `mapstructure:"ami_name" cty:"ami_name" hcl:"ami_name"` Description *string `mapstructure:"ami_description" cty:"ami_description" hcl:"ami_description"` Users []string `mapstructure:"ami_users" cty:"ami_users" hcl:"ami_users"` Groups []string `mapstructure:"ami_groups" cty:"ami_groups" hcl:"ami_groups"` Encrypt *bool `mapstructure:"ami_encrypt" cty:"ami_encrypt" hcl:"ami_encrypt"` KMSKey *string `mapstructure:"ami_kms_key" cty:"ami_kms_key" hcl:"ami_kms_key"` LicenseType *string `mapstructure:"license_type" cty:"license_type" hcl:"license_type"` RoleName *string `mapstructure:"role_name" cty:"role_name" hcl:"role_name"` Format *string `mapstructure:"format" cty:"format" hcl:"format"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "access_key": &hcldec.AttrSpec{Name: "access_key", Type: cty.String, Required: false}, "assume_role": &hcldec.BlockSpec{TypeName: "assume_role", Nested: hcldec.ObjectSpec((*common.FlatAssumeRoleConfig)(nil).HCL2Spec())}, "custom_endpoint_ec2": &hcldec.AttrSpec{Name: "custom_endpoint_ec2", Type: cty.String, Required: false}, "shared_credentials_file": &hcldec.AttrSpec{Name: "shared_credentials_file", Type: cty.String, Required: false}, "decode_authorization_messages": &hcldec.AttrSpec{Name: "decode_authorization_messages", Type: cty.Bool, Required: false}, "insecure_skip_tls_verify": &hcldec.AttrSpec{Name: "insecure_skip_tls_verify", Type: cty.Bool, Required: false}, "max_retries": &hcldec.AttrSpec{Name: "max_retries", Type: cty.Number, Required: false}, "mfa_code": &hcldec.AttrSpec{Name: "mfa_code", Type: cty.String, Required: false}, "profile": &hcldec.AttrSpec{Name: "profile", Type: cty.String, Required: false}, "region": &hcldec.AttrSpec{Name: "region", Type: cty.String, Required: false}, "secret_key": &hcldec.AttrSpec{Name: "secret_key", Type: cty.String, Required: false}, "skip_metadata_api_check": &hcldec.AttrSpec{Name: "skip_metadata_api_check", Type: cty.Bool, Required: false}, "skip_credential_validation": &hcldec.AttrSpec{Name: "skip_credential_validation", Type: cty.Bool, Required: false}, "token": &hcldec.AttrSpec{Name: "token", Type: cty.String, Required: false}, "vault_aws_engine": &hcldec.BlockSpec{TypeName: "vault_aws_engine", Nested: hcldec.ObjectSpec((*common.FlatVaultAWSEngineOptions)(nil).HCL2Spec())}, "aws_polling": &hcldec.BlockSpec{TypeName: "aws_polling", Nested: hcldec.ObjectSpec((*common.FlatAWSPollingConfig)(nil).HCL2Spec())}, "s3_bucket_name": &hcldec.AttrSpec{Name: "s3_bucket_name", Type: cty.String, Required: false}, "s3_key_name": &hcldec.AttrSpec{Name: "s3_key_name", Type: cty.String, Required: false}, "s3_encryption": &hcldec.AttrSpec{Name: "s3_encryption", Type: cty.String, Required: false}, "s3_encryption_key": &hcldec.AttrSpec{Name: "s3_encryption_key", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "tags": &hcldec.AttrSpec{Name: "tags", Type: cty.Map(cty.String), Required: false}, "ami_name": &hcldec.AttrSpec{Name: "ami_name", Type: cty.String, Required: false}, "ami_description": &hcldec.AttrSpec{Name: "ami_description", Type: cty.String, Required: false}, "ami_users": &hcldec.AttrSpec{Name: "ami_users", Type: cty.List(cty.String), Required: false}, "ami_groups": &hcldec.AttrSpec{Name: "ami_groups", Type: cty.List(cty.String), Required: false}, "ami_encrypt": &hcldec.AttrSpec{Name: "ami_encrypt", Type: cty.Bool, Required: false}, "ami_kms_key": &hcldec.AttrSpec{Name: "ami_kms_key", Type: cty.String, Required: false}, "license_type": &hcldec.AttrSpec{Name: "license_type", Type: cty.String, Required: false}, "role_name": &hcldec.AttrSpec{Name: "role_name", Type: cty.String, Required: false}, "format": &hcldec.AttrSpec{Name: "format", Type: cty.String, Required: false}, } return s } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/amazon-import/version/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022747�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/amazon-import/version/version.go������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var AmazonImportPluginVersion *version.PluginVersion func init() { AmazonImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/artifice/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020253�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/artifice/artifact.go������������������������������������������������0000664�0000000�0000000�00000002024�13771713062�0022375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package artifice import ( "fmt" "os" "path/filepath" "strings" ) const BuilderId = "packer.post-processor.artifice" type Artifact struct { files []string } func NewArtifact(files []string) (*Artifact, error) { artifact := &Artifact{} for _, f := range files { globfiles, err := filepath.Glob(f) if err != nil { return nil, err } for _, gf := range globfiles { if _, err := os.Stat(gf); err != nil { return nil, err } artifact.files = append(artifact.files, gf) } } return artifact, nil } func (a *Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Files() []string { return a.files } func (a *Artifact) Id() string { return "" } func (a *Artifact) String() string { files := strings.Join(a.files, ", ") return fmt.Sprintf("Created artifact from files: %s", files) } func (a *Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { for _, f := range a.files { err := os.RemoveAll(f) if err != nil { return err } } return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/artifice/post-processor.go������������������������������������������0000664�0000000�0000000�00000003776�13771713062�0023621�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package artifice import ( "context" "fmt" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // The artifact-override post-processor allows you to specify arbitrary files as // artifacts. These will override any other artifacts created by the builder. // This allows you to use a builder and provisioner to create some file, such as // a compiled binary or tarball, extract it from the builder (VM or container) // and then save that binary or tarball and throw away the builder. type Config struct { common.PackerConfig `mapstructure:",squash"` Files []string `mapstructure:"files"` Keep bool `mapstructure:"keep_input_artifact"` ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "artifice", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } if len(p.config.Files) == 0 { return fmt.Errorf("No files specified in artifice configuration") } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { if len(artifact.Files()) > 0 { ui.Say(fmt.Sprintf("Discarding files from artifact: %s", strings.Join(artifact.Files(), ", "))) } artifact, err := NewArtifact(p.config.Files) ui.Say(fmt.Sprintf("Using these artifact files: %s", strings.Join(artifact.Files(), ", "))) return artifact, true, false, err } ��packer-1.6.6+ds1/post-processor/artifice/post-processor.hcl2spec.go���������������������������������0000664�0000000�0000000�00000006274�13771713062�0025317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package artifice import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Files []string `mapstructure:"files" cty:"files" hcl:"files"` Keep *bool `mapstructure:"keep_input_artifact" cty:"keep_input_artifact" hcl:"keep_input_artifact"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "files": &hcldec.AttrSpec{Name: "files", Type: cty.List(cty.String), Required: false}, "keep_input_artifact": &hcldec.AttrSpec{Name: "keep_input_artifact", Type: cty.Bool, Required: false}, } return s } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/artifice/version/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021740�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/artifice/version/version.go�����������������������������������������0000664�0000000�0000000�00000000501�13771713062�0023750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ArtificePluginVersion *version.PluginVersion func init() { ArtificePluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020267�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/LICENSE����������������������������������������������������0000664�0000000�0000000�00000002072�13771713062�0021275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The MIT License (MIT) Copyright (c) 2016 Vasiliy Tolstov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/artifact.go������������������������������������������������0000664�0000000�0000000�00000001350�13771713062�0022412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package checksum import ( "fmt" "os" "strings" ) const BuilderId = "packer.post-processor.checksum" type Artifact struct { files []string } func NewArtifact(files []string) *Artifact { return &Artifact{files: files} } func (a *Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Files() []string { return a.files } func (a *Artifact) Id() string { return "" } func (a *Artifact) String() string { files := strings.Join(a.files, ", ") return fmt.Sprintf("Created artifact from files: %s", files) } func (a *Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { for _, f := range a.files { err := os.RemoveAll(f) if err != nil { return err } } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/post-processor.go������������������������������������������0000664�0000000�0000000�00000010404�13771713062�0023617�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package checksum import ( "context" "crypto/md5" "crypto/sha1" "crypto/sha256" "crypto/sha512" "fmt" "hash" "io" "os" "path/filepath" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` ChecksumTypes []string `mapstructure:"checksum_types"` OutputPath string `mapstructure:"output"` ctx interpolate.Context } type PostProcessor struct { config Config } func getHash(t string) hash.Hash { var h hash.Hash switch t { case "md5": h = md5.New() case "sha1": h = sha1.New() case "sha224": h = sha256.New224() case "sha256": h = sha256.New() case "sha384": h = sha512.New384() case "sha512": h = sha512.New() } return h } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "checksum", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{"output"}, }, }, raws...) if err != nil { return err } errs := new(packersdk.MultiError) if p.config.ChecksumTypes == nil { p.config.ChecksumTypes = []string{"md5"} } for _, k := range p.config.ChecksumTypes { if h := getHash(k); h == nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Unrecognized checksum type: %s", k)) } } if p.config.OutputPath == "" { p.config.OutputPath = "packer_{{.BuildName}}_{{.BuilderType}}_{{.ChecksumType}}.checksum" } if err = interpolate.Validate(p.config.OutputPath, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing target template: %s", err)) } if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { files := artifact.Files() var h hash.Hash var generatedData map[interface{}]interface{} stateData := artifact.State("generated_data") if stateData != nil { // Make sure it's not a nil map so we can assign to it later. generatedData = stateData.(map[interface{}]interface{}) } // If stateData has a nil map generatedData will be nil // and we need to make sure it's not if generatedData == nil { generatedData = make(map[interface{}]interface{}) } generatedData["BuildName"] = p.config.PackerBuildName generatedData["BuilderType"] = p.config.PackerBuilderType newartifact := NewArtifact(artifact.Files()) for _, ct := range p.config.ChecksumTypes { h = getHash(ct) generatedData["ChecksumType"] = ct p.config.ctx.Data = generatedData for _, art := range files { checksumFile, err := interpolate.Render(p.config.OutputPath, &p.config.ctx) if err != nil { return nil, false, true, err } if _, err := os.Stat(checksumFile); err != nil { newartifact.files = append(newartifact.files, checksumFile) } if err := os.MkdirAll(filepath.Dir(checksumFile), os.FileMode(0755)); err != nil { return nil, false, true, fmt.Errorf("unable to create dir: %s", err.Error()) } fw, err := os.OpenFile(checksumFile, os.O_WRONLY|os.O_APPEND|os.O_CREATE, os.FileMode(0644)) if err != nil { return nil, false, true, fmt.Errorf("unable to create file %s: %s", checksumFile, err.Error()) } fr, err := os.Open(art) if err != nil { fw.Close() return nil, false, true, fmt.Errorf("unable to open file %s: %s", art, err.Error()) } if _, err = io.Copy(h, fr); err != nil { fr.Close() fw.Close() return nil, false, true, fmt.Errorf("unable to compute %s hash for %s", ct, art) } fr.Close() fw.WriteString(fmt.Sprintf("%x\t%s\n", h.Sum(nil), filepath.Base(art))) fw.Close() h.Reset() } } // sets keep and forceOverride to true because we don't want to accidentally // delete the very artifact we're checksumming. return newartifact, true, true, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/post-processor.hcl2spec.go���������������������������������0000664�0000000�0000000�00000006256�13771713062�0025333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package checksum import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` ChecksumTypes []string `mapstructure:"checksum_types" cty:"checksum_types" hcl:"checksum_types"` OutputPath *string `mapstructure:"output" cty:"output" hcl:"output"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "checksum_types": &hcldec.AttrSpec{Name: "checksum_types", Type: cty.List(cty.String), Required: false}, "output": &hcldec.AttrSpec{Name: "output", Type: cty.String, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/post-processor_test.go�������������������������������������0000664�0000000�0000000�00000005400�13771713062�0024656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package checksum import ( "bytes" "context" "fmt" "io/ioutil" "os" "strings" "testing" "github.com/hashicorp/packer/builder/file" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template" ) const expectedFileContents = "Hello world!" func TestChecksumSHA1(t *testing.T) { const config = ` { "post-processors": [ { "type": "checksum", "checksum_types": ["sha1"], "output": "sha1sums" } ] } ` artifact := testChecksum(t, config) defer artifact.Destroy() f, err := os.Open("sha1sums") if err != nil { t.Errorf("Unable to read checksum file: %s", err) } if buf, _ := ioutil.ReadAll(f); !bytes.Equal(buf, []byte("d3486ae9136e7856bc42212385ea797094475802\tpackage.txt\n")) { t.Errorf("Failed to compute checksum: %s\n%s", buf, "d3486ae9136e7856bc42212385ea797094475802 package.txt") } defer f.Close() } // Test Helpers func setup(t *testing.T) (packersdk.Ui, packersdk.Artifact, error) { // Create fake UI and Cache ui := packersdk.TestUi(t) // Create config for file builder const fileConfig = `{"builders":[{"type":"file","target":"package.txt","content":"Hello world!"}]}` tpl, err := template.Parse(strings.NewReader(fileConfig)) if err != nil { return nil, nil, fmt.Errorf("Unable to parse setup configuration: %s", err) } // Prepare the file builder builder := file.Builder{} _, warnings, err := builder.Prepare(tpl.Builders["file"].Config) if len(warnings) > 0 { for _, warn := range warnings { return nil, nil, fmt.Errorf("Configuration warning: %s", warn) } } if err != nil { return nil, nil, fmt.Errorf("Invalid configuration: %s", err) } // Run the file builder artifact, err := builder.Run(context.Background(), ui, nil) if err != nil { return nil, nil, fmt.Errorf("Failed to build artifact: %s", err) } return ui, artifact, err } func testChecksum(t *testing.T, config string) packersdk.Artifact { ui, artifact, err := setup(t) if err != nil { t.Fatalf("Error bootstrapping test: %s", err) } if artifact != nil { defer artifact.Destroy() } tpl, err := template.Parse(strings.NewReader(config)) if err != nil { t.Fatalf("Unable to parse test config: %s", err) } checksum := PostProcessor{} checksum.Configure(tpl.PostProcessors[0][0].Config) // I get the feeling these should be automatically available somewhere, but // some of the post-processors construct this manually. checksum.config.ctx.BuildName = "chocolate" checksum.config.PackerBuildName = "vanilla" checksum.config.PackerBuilderType = "file" artifactOut, _, _, err := checksum.PostProcess(context.Background(), ui, artifact) if err != nil { t.Fatalf("Failed to checksum artifact: %s", err) } return artifactOut } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/version/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021754�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/checksum/version/version.go�����������������������������������������0000664�0000000�0000000�00000000501�13771713062�0023764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ChecksumPluginVersion *version.PluginVersion func init() { ChecksumPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020320�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/LICENSE����������������������������������������������������0000664�0000000�0000000�00000002072�13771713062�0021326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The MIT License (MIT) Copyright (c) 2014 Vasiliy Tolstov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/artifact.go������������������������������������������������0000664�0000000�0000000�00000001027�13771713062�0022444�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compress import ( "fmt" "os" ) const BuilderId = "packer.post-processor.compress" type Artifact struct { Path string } func (a *Artifact) BuilderId() string { return BuilderId } func (*Artifact) Id() string { return "" } func (a *Artifact) Files() []string { return []string{a.Path} } func (a *Artifact) String() string { return fmt.Sprintf("compressed artifacts in: %s", a.Path) } func (*Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return os.Remove(a.Path) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/artifact_test.go�������������������������������������������0000664�0000000�0000000�00000000450�13771713062�0023502�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compress import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestArtifact_ImplementsArtifact(t *testing.T) { var raw interface{} raw = &Artifact{} if _, ok := raw.(packersdk.Artifact); !ok { t.Fatalf("Artifact should be a Artifact!") } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/benchmark.go�����������������������������������������������0000664�0000000�0000000�00000010577�13771713062�0022613�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build ignore package main import ( "compress/flate" "compress/gzip" "fmt" "io" "io/ioutil" "os" "runtime" "testing" "github.com/biogo/hts/bgzf" "github.com/klauspost/pgzip" "github.com/pierrec/lz4" "github.com/ulikunitz/xz" ) type Compressor struct { r *os.File w *os.File sr int64 sw int64 } func (c *Compressor) Close() error { var err error fi, _ := c.w.Stat() c.sw = fi.Size() if err = c.w.Close(); err != nil { return err } fi, _ = c.r.Stat() c.sr = fi.Size() if err = c.r.Close(); err != nil { return err } return nil } func NewCompressor(src, dst string) (*Compressor, error) { r, err := os.Open(src) if err != nil { return nil, err } w, err := os.Create(dst) if err != nil { r.Close() return nil, err } c := &Compressor{r: r, w: w} return c, nil } func main() { runtime.GOMAXPROCS(runtime.NumCPU()) var resw testing.BenchmarkResult var resr testing.BenchmarkResult c, err := NewCompressor("/tmp/image.r", "/tmp/image.w") if err != nil { panic(err) } resw = testing.Benchmark(c.BenchmarkGZIPWriter) c.w.Seek(0, 0) resr = testing.Benchmark(c.BenchmarkGZIPReader) c.Close() fmt.Printf("gzip:\twriter %s\treader %s\tsize %d\n", resw.T.String(), resr.T.String(), c.sw) c, err = NewCompressor("/tmp/image.r", "/tmp/image.w") if err != nil { panic(err) } resw = testing.Benchmark(c.BenchmarkBGZFWriter) c.w.Seek(0, 0) resr = testing.Benchmark(c.BenchmarkBGZFReader) c.Close() fmt.Printf("bgzf:\twriter %s\treader %s\tsize %d\n", resw.T.String(), resr.T.String(), c.sw) c, err = NewCompressor("/tmp/image.r", "/tmp/image.w") if err != nil { panic(err) } resw = testing.Benchmark(c.BenchmarkPGZIPWriter) c.w.Seek(0, 0) resr = testing.Benchmark(c.BenchmarkPGZIPReader) c.Close() fmt.Printf("pgzip:\twriter %s\treader %s\tsize %d\n", resw.T.String(), resr.T.String(), c.sw) c, err = NewCompressor("/tmp/image.r", "/tmp/image.w") if err != nil { panic(err) } resw = testing.Benchmark(c.BenchmarkLZ4Writer) c.w.Seek(0, 0) resr = testing.Benchmark(c.BenchmarkLZ4Reader) c.Close() fmt.Printf("lz4:\twriter %s\treader %s\tsize %d\n", resw.T.String(), resr.T.String(), c.sw) c, err = NewCompressor("/tmp/image.r", "/tmp/image.w") if err != nil { panic(err) } resw = testing.Benchmark(c.BenchmarkXZWriter) c.w.Seek(0, 0) resr = testing.Benchmark(c.BenchmarkXZReader) c.Close() fmt.Printf("xz:\twriter %s\treader %s\tsize %d\n", resw.T.String(), resr.T.String(), c.sw) } func (c *Compressor) BenchmarkGZIPWriter(b *testing.B) { cw, _ := gzip.NewWriterLevel(c.w, flate.BestSpeed) b.ResetTimer() _, err := io.Copy(cw, c.r) if err != nil { b.Fatal(err) } cw.Close() c.w.Sync() } func (c *Compressor) BenchmarkGZIPReader(b *testing.B) { cr, _ := gzip.NewReader(c.w) b.ResetTimer() _, err := io.Copy(ioutil.Discard, cr) if err != nil { b.Fatal(err) } } func (c *Compressor) BenchmarkBGZFWriter(b *testing.B) { cw, _ := bgzf.NewWriterLevel(c.w, flate.BestSpeed, runtime.NumCPU()) b.ResetTimer() _, err := io.Copy(cw, c.r) if err != nil { b.Fatal(err) } c.w.Sync() } func (c *Compressor) BenchmarkBGZFReader(b *testing.B) { cr, _ := bgzf.NewReader(c.w, 0) b.ResetTimer() _, err := io.Copy(ioutil.Discard, cr) if err != nil { b.Fatal(err) } } func (c *Compressor) BenchmarkPGZIPWriter(b *testing.B) { cw, _ := pgzip.NewWriterLevel(c.w, flate.BestSpeed) b.ResetTimer() _, err := io.Copy(cw, c.r) if err != nil { b.Fatal(err) } cw.Close() c.w.Sync() } func (c *Compressor) BenchmarkPGZIPReader(b *testing.B) { cr, _ := pgzip.NewReader(c.w) b.ResetTimer() _, err := io.Copy(ioutil.Discard, cr) if err != nil { b.Fatal(err) } } func (c *Compressor) BenchmarkLZ4Writer(b *testing.B) { cw := lz4.NewWriter(c.w) // cw.Header.HighCompression = true cw.Header.NoChecksum = true b.ResetTimer() _, err := io.Copy(cw, c.r) if err != nil { b.Fatal(err) } cw.Close() c.w.Sync() } func (c *Compressor) BenchmarkLZ4Reader(b *testing.B) { cr := lz4.NewReader(c.w) b.ResetTimer() _, err := io.Copy(ioutil.Discard, cr) if err != nil { b.Fatal(err) } } func (c *Compressor) BenchmarkXZWriter(b *testing.B) { cw := xz.NewWriter(c.w) b.ResetTimer() _, err := io.Copy(cw, c.r) if err != nil { b.Fatal(err) } cw.Close() c.w.Sync() } func (c *Compressor) BenchmarkXZReader(b *testing.B) { cr := xz.NewReader(c.w) b.ResetTimer() _, err := io.Copy(ioutil.Discard, cr) if err != nil { b.Fatal(err) } } ���������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/notes.txt��������������������������������������������������0000664�0000000�0000000�00000000161�13771713062�0022207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������* 1.9.6 => GNU tar format * 1.10.3 w/ patch => GNU tar format * 1.10.3 w/o patch => Posix tar format ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/post-processor.go������������������������������������������0000664�0000000�0000000�00000025401�13771713062�0023653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package compress import ( "archive/tar" "archive/zip" "context" "fmt" "io" "os" "path/filepath" "regexp" "runtime" "github.com/biogo/hts/bgzf" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/klauspost/pgzip" "github.com/pierrec/lz4" "github.com/ulikunitz/xz" ) var ( // ErrInvalidCompressionLevel is returned when the compression level passed // to gzip is not in the expected range. See compress/flate for details. ErrInvalidCompressionLevel = fmt.Errorf( "Invalid compression level. Expected an integer from -1 to 9.") ErrWrongInputCount = fmt.Errorf( "Can only have 1 input file when not using tar/zip") filenamePattern = regexp.MustCompile(`(?:\.([a-z0-9]+))`) ) type Config struct { common.PackerConfig `mapstructure:",squash"` // Fields from config file OutputPath string `mapstructure:"output"` Format string `mapstructure:"format"` CompressionLevel int `mapstructure:"compression_level"` // Derived fields Archive string Algorithm string ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "compress", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{"output"}, }, }, raws...) if err != nil { return err } errs := new(packersdk.MultiError) // If there is no explicit number of Go threads to use, then set it if os.Getenv("GOMAXPROCS") == "" { runtime.GOMAXPROCS(runtime.NumCPU()) } if p.config.OutputPath == "" { p.config.OutputPath = "packer_{{.BuildName}}_{{.BuilderType}}" } if p.config.CompressionLevel > pgzip.BestCompression { p.config.CompressionLevel = pgzip.BestCompression } // Technically 0 means "don't compress" but I don't know how to // differentiate between "user entered zero" and "user entered nothing". // Also, why bother creating a compressed file with zero compression? if p.config.CompressionLevel == -1 || p.config.CompressionLevel == 0 { p.config.CompressionLevel = pgzip.DefaultCompression } if err = interpolate.Validate(p.config.OutputPath, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing target template: %s", err)) } p.config.detectFromFilename() if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) PostProcess( ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact, ) (packersdk.Artifact, bool, bool, error) { var generatedData map[interface{}]interface{} stateData := artifact.State("generated_data") if stateData != nil { // Make sure it's not a nil map so we can assign to it later. generatedData = stateData.(map[interface{}]interface{}) } // If stateData has a nil map generatedData will be nil // and we need to make sure it's not if generatedData == nil { generatedData = make(map[interface{}]interface{}) } // These are extra variables that will be made available for interpolation. generatedData["BuildName"] = p.config.PackerBuildName generatedData["BuilderType"] = p.config.PackerBuilderType p.config.ctx.Data = generatedData target, err := interpolate.Render(p.config.OutputPath, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error interpolating output value: %s", err) } else { fmt.Println(target) } newArtifact := &Artifact{Path: target} if err = os.MkdirAll(filepath.Dir(target), os.FileMode(0755)); err != nil { return nil, false, false, fmt.Errorf( "Unable to create dir for archive %s: %s", target, err) } outputFile, err := os.Create(target) if err != nil { return nil, false, false, fmt.Errorf( "Unable to create archive %s: %s", target, err) } defer outputFile.Close() // Setup output interface. If we're using compression, output is a // compression writer. Otherwise it's just a file. var output io.WriteCloser errTmpl := "error creating %s writer: %s" switch p.config.Algorithm { case "bgzf": ui.Say(fmt.Sprintf("Using bgzf compression with %d cores for %s", runtime.GOMAXPROCS(-1), target)) output, err = makeBGZFWriter(outputFile, p.config.CompressionLevel) if err != nil { return nil, false, false, fmt.Errorf(errTmpl, p.config.Algorithm, err) } defer output.Close() case "lz4": ui.Say(fmt.Sprintf("Using lz4 compression with %d cores for %s", runtime.GOMAXPROCS(-1), target)) output, err = makeLZ4Writer(outputFile, p.config.CompressionLevel) if err != nil { return nil, false, false, fmt.Errorf(errTmpl, p.config.Algorithm, err) } defer output.Close() case "xz": ui.Say(fmt.Sprintf("Using xz compression with 1 core for %s (library does not support MT)", target)) output, err = makeXZWriter(outputFile) if err != nil { return nil, false, false, fmt.Errorf(errTmpl, p.config.Algorithm, err) } defer output.Close() case "pgzip": ui.Say(fmt.Sprintf("Using pgzip compression with %d cores for %s", runtime.GOMAXPROCS(-1), target)) output, err = makePgzipWriter(outputFile, p.config.CompressionLevel) if err != nil { return nil, false, false, fmt.Errorf(errTmpl, p.config.Algorithm, err) } defer output.Close() default: output = outputFile } compression := p.config.Algorithm if compression == "" { compression = "no compression" } // Build an archive, if we're supposed to do that. switch p.config.Archive { case "tar": ui.Say(fmt.Sprintf("Tarring %s with %s", target, compression)) err = createTarArchive(artifact.Files(), output) if err != nil { return nil, false, false, fmt.Errorf("Error creating tar: %s", err) } case "zip": ui.Say(fmt.Sprintf("Zipping %s", target)) err = createZipArchive(artifact.Files(), output) if err != nil { return nil, false, false, fmt.Errorf("Error creating zip: %s", err) } default: // Filename indicates no tarball (just compress) so we'll do an io.Copy // into our compressor. if len(artifact.Files()) != 1 { return nil, false, false, fmt.Errorf( "Can only have 1 input file when not using tar/zip. Found %d "+ "files: %v", len(artifact.Files()), artifact.Files()) } archiveFile := artifact.Files()[0] ui.Say(fmt.Sprintf("Archiving %s with %s", archiveFile, compression)) source, err := os.Open(archiveFile) if err != nil { return nil, false, false, fmt.Errorf( "Failed to open source file %s for reading: %s", archiveFile, err) } defer source.Close() if _, err = io.Copy(output, source); err != nil { return nil, false, false, fmt.Errorf("Failed to compress %s: %s", archiveFile, err) } } ui.Say(fmt.Sprintf("Archive %s completed", target)) return newArtifact, false, false, nil } func (config *Config) detectFromFilename() { var result [][]string extensions := map[string]string{ "tar": "tar", "zip": "zip", "gz": "pgzip", "lz4": "lz4", "bgzf": "bgzf", "xz": "xz", } if config.Format == "" { result = filenamePattern.FindAllStringSubmatch(config.OutputPath, -1) } else { result = filenamePattern.FindAllStringSubmatch(fmt.Sprintf("%s.%s", config.OutputPath, config.Format), -1) } // No dots. Bail out with defaults. if len(result) == 0 { config.Algorithm = "pgzip" config.Archive = "tar" return } // Parse the last two .groups, if they're there lastItem := result[len(result)-1][1] var nextToLastItem string if len(result) == 1 { nextToLastItem = "" } else { nextToLastItem = result[len(result)-2][1] } // Should we make an archive? E.g. tar or zip? if nextToLastItem == "tar" { config.Archive = "tar" } if lastItem == "zip" || lastItem == "tar" { config.Archive = lastItem // Tar or zip is our final artifact. Bail out. return } // Should we compress the artifact? algorithm, ok := extensions[lastItem] if ok { config.Algorithm = algorithm // We found our compression algorithm. Bail out. return } // We didn't match a known compression format. Default to tar + pgzip config.Algorithm = "pgzip" config.Archive = "tar" return } func makeBGZFWriter(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { bgzfWriter, err := bgzf.NewWriterLevel(output, compressionLevel, runtime.GOMAXPROCS(-1)) if err != nil { return nil, ErrInvalidCompressionLevel } return bgzfWriter, nil } func makeLZ4Writer(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { lzwriter := lz4.NewWriter(output) if compressionLevel > 0 { lzwriter.Header.CompressionLevel = compressionLevel } return lzwriter, nil } func makeXZWriter(output io.WriteCloser) (io.WriteCloser, error) { xzwriter, err := xz.NewWriter(output) if err != nil { return nil, err } return xzwriter, nil } func makePgzipWriter(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { gzipWriter, err := pgzip.NewWriterLevel(output, compressionLevel) if err != nil { return nil, ErrInvalidCompressionLevel } gzipWriter.SetConcurrency(500000, runtime.GOMAXPROCS(-1)) return gzipWriter, nil } func createTarArchive(files []string, output io.WriteCloser) error { archive := tar.NewWriter(output) defer archive.Close() for _, path := range files { file, err := os.Open(path) if err != nil { return fmt.Errorf("Unable to read file %s: %s", path, err) } defer file.Close() fi, err := file.Stat() if err != nil { return fmt.Errorf("Unable to get fileinfo for %s: %s", path, err) } header, err := tar.FileInfoHeader(fi, path) if err != nil { return fmt.Errorf("Failed to create tar header for %s: %s", path, err) } // workaround for archive format on go >=1.10 setHeaderFormat(header) if err := archive.WriteHeader(header); err != nil { return fmt.Errorf("Failed to write tar header for %s: %s", path, err) } if _, err := io.Copy(archive, file); err != nil { return fmt.Errorf("Failed to copy %s data to archive: %s", path, err) } } return nil } func createZipArchive(files []string, output io.WriteCloser) error { archive := zip.NewWriter(output) defer archive.Close() for _, path := range files { path = filepath.ToSlash(path) source, err := os.Open(path) if err != nil { return fmt.Errorf("Unable to read file %s: %s", path, err) } defer source.Close() target, err := archive.Create(path) if err != nil { return fmt.Errorf("Failed to add zip header for %s: %s", path, err) } _, err = io.Copy(target, source) if err != nil { return fmt.Errorf("Failed to copy %s data to archive: %s", path, err) } } return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/post-processor.hcl2spec.go���������������������������������0000664�0000000�0000000�00000007312�13771713062�0025356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package compress import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` OutputPath *string `mapstructure:"output" cty:"output" hcl:"output"` Format *string `mapstructure:"format" cty:"format" hcl:"format"` CompressionLevel *int `mapstructure:"compression_level" cty:"compression_level" hcl:"compression_level"` Archive *string `cty:"archive" hcl:"archive"` Algorithm *string `cty:"algorithm" hcl:"algorithm"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "output": &hcldec.AttrSpec{Name: "output", Type: cty.String, Required: false}, "format": &hcldec.AttrSpec{Name: "format", Type: cty.String, Required: false}, "compression_level": &hcldec.AttrSpec{Name: "compression_level", Type: cty.Number, Required: false}, "archive": &hcldec.AttrSpec{Name: "archive", Type: cty.String, Required: false}, "algorithm": &hcldec.AttrSpec{Name: "algorithm", Type: cty.String, Required: false}, } return s } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/post-processor_test.go�������������������������������������0000664�0000000�0000000�00000013473�13771713062�0024720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compress import ( "compress/gzip" "context" "fmt" "io/ioutil" "os" "strings" "testing" "github.com/hashicorp/packer/builder/file" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template" ) func TestDetectFilename(t *testing.T) { // Test default / fallback with no file extension nakedFilename := Config{OutputPath: "test"} nakedFilename.detectFromFilename() if nakedFilename.Archive != "tar" { t.Error("Expected to find tar archive setting") } if nakedFilename.Algorithm != "pgzip" { t.Error("Expected to find pgzip algorithm setting") } // Test .archive zipFilename := Config{OutputPath: "test.zip"} zipFilename.detectFromFilename() if zipFilename.Archive != "zip" { t.Error("Expected to find zip archive setting") } if zipFilename.Algorithm != "" { t.Error("Expected to find empty algorithm setting") } // Test .compress lz4Filename := Config{OutputPath: "test.lz4"} lz4Filename.detectFromFilename() if lz4Filename.Archive != "" { t.Error("Expected to find empty archive setting") } if lz4Filename.Algorithm != "lz4" { t.Error("Expected to find lz4 algorithm setting") } // Test .archive.compress with some.extra.dots... lotsOfDots := Config{OutputPath: "test.blah.bloo.blee.tar.lz4"} lotsOfDots.detectFromFilename() if lotsOfDots.Archive != "tar" { t.Error("Expected to find tar archive setting") } if lotsOfDots.Algorithm != "lz4" { t.Error("Expected to find lz4 algorithm setting") } } const expectedFileContents = "Hello world!" func TestSimpleCompress(t *testing.T) { const config = ` { "post-processors": [ { "type": "compress", "output": "package.tar.gz" } ] } ` artifact := testArchive(t, config) defer artifact.Destroy() fi, err := os.Stat("package.tar.gz") if err != nil { t.Errorf("Unable to read archive: %s", err) } if fi.IsDir() { t.Error("Archive should not be a directory") } } func TestZipArchive(t *testing.T) { const config = ` { "post-processors": [ { "type": "compress", "output": "package.zip" } ] } ` artifact := testArchive(t, config) defer artifact.Destroy() // Verify things look good _, err := os.Stat("package.zip") if err != nil { t.Errorf("Unable to read archive: %s", err) } } func TestTarArchive(t *testing.T) { const config = ` { "post-processors": [ { "type": "compress", "output": "package.tar" } ] } ` artifact := testArchive(t, config) defer artifact.Destroy() // Verify things look good _, err := os.Stat("package.tar") if err != nil { t.Errorf("Unable to read archive: %s", err) } } func TestCompressOptions(t *testing.T) { const config = ` { "post-processors": [ { "type": "compress", "output": "package.gz", "compression_level": 9 } ] } ` artifact := testArchive(t, config) defer artifact.Destroy() filename := "package.gz" archive, _ := os.Open(filename) gzipReader, _ := gzip.NewReader(archive) data, _ := ioutil.ReadAll(gzipReader) if string(data) != expectedFileContents { t.Errorf("Expected:\n%s\nFound:\n%s\n", expectedFileContents, data) } } func TestCompressInterpolation(t *testing.T) { const config = ` { "post-processors": [ { "type": "compress", "output": "{{ build_name}}-{{ .BuildName }}-{{.BuilderType}}.gz" } ] } ` artifact := testArchive(t, config) defer artifact.Destroy() // You can interpolate using the .BuildName variable or build_name global // function. We'll check both. filename := "chocolate-vanilla-file.gz" archive, err := os.Open(filename) if err != nil { t.Fatalf("Unable to read %s: %s", filename, err) } gzipReader, _ := gzip.NewReader(archive) data, _ := ioutil.ReadAll(gzipReader) if string(data) != expectedFileContents { t.Errorf("Expected:\n%s\nFound:\n%s\n", expectedFileContents, data) } } // Test Helpers func setup(t *testing.T) (packersdk.Ui, packersdk.Artifact, error) { // Create fake UI and Cache ui := packersdk.TestUi(t) // Create config for file builder const fileConfig = `{"builders":[{"type":"file","target":"package.txt","content":"Hello world!"}]}` tpl, err := template.Parse(strings.NewReader(fileConfig)) if err != nil { return nil, nil, fmt.Errorf("Unable to parse setup configuration: %s", err) } // Prepare the file builder builder := file.Builder{} _, warnings, err := builder.Prepare(tpl.Builders["file"].Config) if len(warnings) > 0 { for _, warn := range warnings { return nil, nil, fmt.Errorf("Configuration warning: %s", warn) } } if err != nil { return nil, nil, fmt.Errorf("Invalid configuration: %s", err) } // Run the file builder artifact, err := builder.Run(context.Background(), ui, nil) if err != nil { return nil, nil, fmt.Errorf("Failed to build artifact: %s", err) } return ui, artifact, err } func testArchive(t *testing.T, config string) packersdk.Artifact { ui, artifact, err := setup(t) if err != nil { t.Fatalf("Error bootstrapping test: %s", err) } if artifact != nil { defer artifact.Destroy() } tpl, err := template.Parse(strings.NewReader(config)) if err != nil { t.Fatalf("Unable to parse test config: %s", err) } compressor := PostProcessor{} compressor.Configure(tpl.PostProcessors[0][0].Config) // I get the feeling these should be automatically available somewhere, but // some of the post-processors construct this manually. compressor.config.ctx.BuildName = "chocolate" compressor.config.PackerBuildName = "vanilla" compressor.config.PackerBuilderType = "file" artifactOut, _, _, err := compressor.PostProcess(context.Background(), ui, artifact) if err != nil { t.Fatalf("Failed to compress artifact: %s", err) } return artifactOut } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/tar_fix.go�������������������������������������������������0000664�0000000�0000000�00000000162�13771713062�0022302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !go1.10 package compress import "archive/tar" func setHeaderFormat(header *tar.Header) { // no-op } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/tar_fix_go110.go�������������������������������������������0000664�0000000�0000000�00000000600�13771713062�0023206�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build go1.10 package compress import ( "archive/tar" "time" ) func setHeaderFormat(header *tar.Header) { // We have to set the Format explicitly for the googlecompute-import // post-processor. Google Cloud only allows importing GNU tar format. header.Format = tar.FormatGNU header.AccessTime = time.Time{} header.ModTime = time.Time{} header.ChangeTime = time.Time{} } ��������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/version/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022005�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/compress/version/version.go�����������������������������������������0000664�0000000�0000000�00000000501�13771713062�0024015�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var CompressPluginVersion *version.PluginVersion func init() { CompressPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/digitalocean-import/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022420�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/digitalocean-import/post-processor.go�������������������������������0000664�0000000�0000000�00000025714�13771713062�0025762�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package digitaloceanimport import ( "context" "fmt" "log" "os" "strings" "time" "golang.org/x/oauth2" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/digitalocean/godo" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/digitalocean" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) const BuilderId = "packer.post-processor.digitalocean-import" type Config struct { common.PackerConfig `mapstructure:",squash"` APIToken string `mapstructure:"api_token"` SpacesKey string `mapstructure:"spaces_key"` SpacesSecret string `mapstructure:"spaces_secret"` SpacesRegion string `mapstructure:"spaces_region"` SpaceName string `mapstructure:"space_name"` ObjectName string `mapstructure:"space_object_name"` SkipClean bool `mapstructure:"skip_clean"` Tags []string `mapstructure:"image_tags"` Name string `mapstructure:"image_name"` Description string `mapstructure:"image_description"` Distribution string `mapstructure:"image_distribution"` ImageRegions []string `mapstructure:"image_regions"` Timeout time.Duration `mapstructure:"timeout"` ctx interpolate.Context } type PostProcessor struct { config Config } type apiTokenSource struct { AccessToken string } type logger struct { logger *log.Logger } func (t *apiTokenSource) Token() (*oauth2.Token, error) { return &oauth2.Token{ AccessToken: t.AccessToken, }, nil } func (l logger) Log(args ...interface{}) { l.logger.Println(args...) } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{"space_object_name"}, }, }, raws...) if err != nil { return err } if p.config.SpacesKey == "" { p.config.SpacesKey = os.Getenv("DIGITALOCEAN_SPACES_ACCESS_KEY") } if p.config.SpacesSecret == "" { p.config.SpacesSecret = os.Getenv("DIGITALOCEAN_SPACES_SECRET_KEY") } if p.config.APIToken == "" { p.config.APIToken = os.Getenv("DIGITALOCEAN_API_TOKEN") } if p.config.ObjectName == "" { p.config.ObjectName = "packer-import-{{timestamp}}" } if p.config.Distribution == "" { p.config.Distribution = "Unkown" } if p.config.Timeout == 0 { p.config.Timeout = 20 * time.Minute } errs := new(packersdk.MultiError) if err = interpolate.Validate(p.config.ObjectName, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing space_object_name template: %s", err)) } requiredArgs := map[string]*string{ "api_token": &p.config.APIToken, "spaces_key": &p.config.SpacesKey, "spaces_secret": &p.config.SpacesSecret, "spaces_region": &p.config.SpacesRegion, "space_name": &p.config.SpaceName, "image_name": &p.config.Name, } for key, ptr := range requiredArgs { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } if len(p.config.ImageRegions) == 0 { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("image_regions must be set")) } if len(errs.Errors) > 0 { return errs } packersdk.LogSecretFilter.Set(p.config.SpacesKey, p.config.SpacesSecret, p.config.APIToken) log.Println(p.config) return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { var err error generatedData := artifact.State("generated_data") if generatedData == nil { // Make sure it's not a nil map so we can assign to it later. generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData p.config.ObjectName, err = interpolate.Render(p.config.ObjectName, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error rendering space_object_name template: %s", err) } log.Printf("Rendered space_object_name as %s", p.config.ObjectName) log.Println("Looking for image in artifact") source, err := extractImageArtifact(artifact.Files()) if err != nil { return nil, false, false, fmt.Errorf("Image file not found") } spacesCreds := credentials.NewStaticCredentials(p.config.SpacesKey, p.config.SpacesSecret, "") spacesEndpoint := fmt.Sprintf("https://%s.digitaloceanspaces.com", p.config.SpacesRegion) spacesConfig := &aws.Config{ Credentials: spacesCreds, Endpoint: aws.String(spacesEndpoint), Region: aws.String(p.config.SpacesRegion), LogLevel: aws.LogLevel(aws.LogDebugWithSigning), Logger: &logger{ logger: log.New(os.Stderr, "", log.LstdFlags), }, } sess, err := session.NewSession(spacesConfig) if err != nil { return nil, false, false, err } ui.Message(fmt.Sprintf("Uploading %s to spaces://%s/%s", source, p.config.SpaceName, p.config.ObjectName)) err = uploadImageToSpaces(source, p, sess) if err != nil { return nil, false, false, err } ui.Message(fmt.Sprintf("Completed upload of %s to spaces://%s/%s", source, p.config.SpaceName, p.config.ObjectName)) client := godo.NewClient(oauth2.NewClient(context.Background(), &apiTokenSource{ AccessToken: p.config.APIToken, })) ui.Message(fmt.Sprintf("Started import of spaces://%s/%s", p.config.SpaceName, p.config.ObjectName)) image, err := importImageFromSpaces(p, client) if err != nil { return nil, false, false, err } ui.Message(fmt.Sprintf("Waiting for import of image %s to complete (may take a while)", p.config.Name)) err = waitUntilImageAvailable(client, image.ID, p.config.Timeout) if err != nil { return nil, false, false, fmt.Errorf("Import of image %s failed with error: %s", p.config.Name, err) } ui.Message(fmt.Sprintf("Import of image %s complete", p.config.Name)) if len(p.config.ImageRegions) > 1 { // Remove the first region from the slice as the image is already there. regions := p.config.ImageRegions regions[0] = regions[len(regions)-1] regions[len(regions)-1] = "" regions = regions[:len(regions)-1] ui.Message(fmt.Sprintf("Distributing image %s to additional regions: %v", p.config.Name, regions)) err = distributeImageToRegions(client, image.ID, regions, p.config.Timeout) if err != nil { return nil, false, false, err } } log.Printf("Adding created image ID %v to output artifacts", image.ID) artifact = &digitalocean.Artifact{ SnapshotName: image.Name, SnapshotId: image.ID, RegionNames: p.config.ImageRegions, Client: client, } if !p.config.SkipClean { ui.Message(fmt.Sprintf("Deleting import source spaces://%s/%s", p.config.SpaceName, p.config.ObjectName)) err = deleteImageFromSpaces(p, sess) if err != nil { return nil, false, false, err } } return artifact, false, false, nil } func extractImageArtifact(artifacts []string) (string, error) { artifactCount := len(artifacts) if artifactCount == 0 { return "", fmt.Errorf("no artifacts were provided") } if artifactCount == 1 { return artifacts[0], nil } validSuffix := []string{"raw", "img", "qcow2", "vhdx", "vdi", "vmdk", "tar.bz2", "tar.xz", "tar.gz"} for _, path := range artifacts { for _, suffix := range validSuffix { if strings.HasSuffix(path, suffix) { return path, nil } } } return "", fmt.Errorf("no valid image file found") } func uploadImageToSpaces(source string, p *PostProcessor, s *session.Session) (err error) { file, err := os.Open(source) if err != nil { return fmt.Errorf("Failed to open %s: %s", source, err) } uploader := s3manager.NewUploader(s) _, err = uploader.Upload(&s3manager.UploadInput{ Body: file, Bucket: &p.config.SpaceName, Key: &p.config.ObjectName, ACL: aws.String("public-read"), }) if err != nil { return fmt.Errorf("Failed to upload %s: %s", source, err) } file.Close() return nil } func importImageFromSpaces(p *PostProcessor, client *godo.Client) (image *godo.Image, err error) { log.Printf("Importing custom image from spaces://%s/%s", p.config.SpaceName, p.config.ObjectName) url := fmt.Sprintf("https://%s.%s.digitaloceanspaces.com/%s", p.config.SpaceName, p.config.SpacesRegion, p.config.ObjectName) createRequest := &godo.CustomImageCreateRequest{ Name: p.config.Name, Url: url, Region: p.config.ImageRegions[0], Distribution: p.config.Distribution, Description: p.config.Description, Tags: p.config.Tags, } image, _, err = client.Images.Create(context.TODO(), createRequest) if err != nil { return image, fmt.Errorf("Failed to import from spaces://%s/%s: %s", p.config.SpaceName, p.config.ObjectName, err) } return image, nil } func waitUntilImageAvailable(client *godo.Client, imageId int, timeout time.Duration) (err error) { done := make(chan struct{}) defer close(done) result := make(chan error, 1) go func() { attempts := 0 for { attempts += 1 log.Printf("Waiting for image to become available... (attempt: %d)", attempts) image, _, err := client.Images.GetByID(context.TODO(), imageId) if err != nil { result <- err return } if image.Status == "available" { result <- nil return } if image.ErrorMessage != "" { result <- fmt.Errorf("%v", image.ErrorMessage) return } time.Sleep(3 * time.Second) select { case <-done: return default: } } }() log.Printf("Waiting for up to %d seconds for image to become available", timeout/time.Second) select { case err := <-result: return err case <-time.After(timeout): err := fmt.Errorf("Timeout while waiting to for action to become available") return err } } func distributeImageToRegions(client *godo.Client, imageId int, regions []string, timeout time.Duration) (err error) { for _, region := range regions { transferRequest := &godo.ActionRequest{ "type": "transfer", "region": region, } log.Printf("Transferring image to %s", region) action, _, err := client.ImageActions.Transfer(context.TODO(), imageId, transferRequest) if err != nil { return fmt.Errorf("Error transferring image: %s", err) } if err := digitalocean.WaitForImageState(godo.ActionCompleted, imageId, action.ID, client, timeout); err != nil { if err != nil { return fmt.Errorf("Error transferring image: %s", err) } } } return nil } func deleteImageFromSpaces(p *PostProcessor, s *session.Session) (err error) { s3conn := s3.New(s) _, err = s3conn.DeleteObject(&s3.DeleteObjectInput{ Bucket: &p.config.SpaceName, Key: &p.config.ObjectName, }) if err != nil { return fmt.Errorf("Failed to delete spaces://%s/%s: %s", p.config.SpaceName, p.config.ObjectName, err) } return nil } ����������������������������������������������������packer-1.6.6+ds1/post-processor/digitalocean-import/post-processor.hcl2spec.go����������������������0000664�0000000�0000000�00000013006�13771713062�0027453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package digitaloceanimport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` APIToken *string `mapstructure:"api_token" cty:"api_token" hcl:"api_token"` SpacesKey *string `mapstructure:"spaces_key" cty:"spaces_key" hcl:"spaces_key"` SpacesSecret *string `mapstructure:"spaces_secret" cty:"spaces_secret" hcl:"spaces_secret"` SpacesRegion *string `mapstructure:"spaces_region" cty:"spaces_region" hcl:"spaces_region"` SpaceName *string `mapstructure:"space_name" cty:"space_name" hcl:"space_name"` ObjectName *string `mapstructure:"space_object_name" cty:"space_object_name" hcl:"space_object_name"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"` Tags []string `mapstructure:"image_tags" cty:"image_tags" hcl:"image_tags"` Name *string `mapstructure:"image_name" cty:"image_name" hcl:"image_name"` Description *string `mapstructure:"image_description" cty:"image_description" hcl:"image_description"` Distribution *string `mapstructure:"image_distribution" cty:"image_distribution" hcl:"image_distribution"` ImageRegions []string `mapstructure:"image_regions" cty:"image_regions" hcl:"image_regions"` Timeout *string `mapstructure:"timeout" cty:"timeout" hcl:"timeout"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "api_token": &hcldec.AttrSpec{Name: "api_token", Type: cty.String, Required: false}, "spaces_key": &hcldec.AttrSpec{Name: "spaces_key", Type: cty.String, Required: false}, "spaces_secret": &hcldec.AttrSpec{Name: "spaces_secret", Type: cty.String, Required: false}, "spaces_region": &hcldec.AttrSpec{Name: "spaces_region", Type: cty.String, Required: false}, "space_name": &hcldec.AttrSpec{Name: "space_name", Type: cty.String, Required: false}, "space_object_name": &hcldec.AttrSpec{Name: "space_object_name", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "image_tags": &hcldec.AttrSpec{Name: "image_tags", Type: cty.List(cty.String), Required: false}, "image_name": &hcldec.AttrSpec{Name: "image_name", Type: cty.String, Required: false}, "image_description": &hcldec.AttrSpec{Name: "image_description", Type: cty.String, Required: false}, "image_distribution": &hcldec.AttrSpec{Name: "image_distribution", Type: cty.String, Required: false}, "image_regions": &hcldec.AttrSpec{Name: "image_regions", Type: cty.List(cty.String), Required: false}, "timeout": &hcldec.AttrSpec{Name: "timeout", Type: cty.String, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/digitalocean-import/post-processor_test.go��������������������������0000664�0000000�0000000�00000002444�13771713062�0027014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package digitaloceanimport import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } func TestPostProcessor_ImageArtifactExtraction(t *testing.T) { tt := []struct { Name string Source string Artifacts []string ExpectedError string }{ {Name: "EmptyArtifacts", ExpectedError: "no artifacts were provided"}, {Name: "SingleArtifact", Source: "Sample.img", Artifacts: []string{"Sample.img"}}, {Name: "SupportedArtifact", Source: "Example.tar.xz", Artifacts: []string{"Sample", "SomeZip.zip", "Example.tar.xz"}}, {Name: "FirstSupportedArtifact", Source: "SomeVMDK.vmdk", Artifacts: []string{"Sample", "SomeVMDK.vmdk", "Example.xz"}}, {Name: "NonSupportedArtifact", Artifacts: []string{"Sample", "SomeZip.zip", "Example.xz"}, ExpectedError: "no valid image file found"}, } for _, tc := range tt { tc := tc source, err := extractImageArtifact(tc.Artifacts) if tc.Source != source { t.Errorf("expected the source to be %q, but got %q", tc.Source, source) } if err != nil && (tc.ExpectedError != err.Error()) { t.Errorf("unexpected error received; expected %q, but got %q", tc.ExpectedError, err.Error()) } } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/digitalocean-import/version/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024105�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/digitalocean-import/version/version.go������������������������������0000664�0000000�0000000�00000000525�13771713062�0026123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var DigitalOceanImportPluginVersion *version.PluginVersion func init() { DigitalOceanImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-import/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021244�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-import/post-processor.go�������������������������������������0000664�0000000�0000000�00000004731�13771713062�0024602�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package dockerimport import ( "context" "fmt" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/docker" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/post-processor/artifice" ) const BuilderId = "packer.post-processor.docker-import" type Config struct { common.PackerConfig `mapstructure:",squash"` Repository string `mapstructure:"repository"` Tag string `mapstructure:"tag"` Changes []string `mapstructure:"changes"` ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { switch artifact.BuilderId() { case docker.BuilderId, artifice.BuilderId: break default: err := fmt.Errorf( "Unknown artifact type: %s\nCan only import from Docker builder "+ "and Artifice post-processor artifacts. If you are getting this "+ "error after having run the docker builder, it may be because you "+ "set commit: true in your Docker builder, so the image is "+ "already imported. ", artifact.BuilderId()) return nil, false, false, err } importRepo := p.config.Repository if p.config.Tag != "" { importRepo += ":" + p.config.Tag } driver := &docker.DockerDriver{Ctx: &p.config.ctx, Ui: ui} ui.Message("Importing image: " + artifact.Id()) ui.Message("Repository: " + importRepo) id, err := driver.Import(artifact.Files()[0], p.config.Changes, importRepo) if err != nil { return nil, false, false, err } ui.Message("Imported ID: " + id) // Build the artifact artifact = &docker.ImportArtifact{ BuilderIdValue: BuilderId, Driver: driver, IdValue: importRepo, } return artifact, false, false, nil } ���������������������������������������packer-1.6.6+ds1/post-processor/docker-import/post-processor.hcl2spec.go����������������������������0000664�0000000�0000000�00000006530�13771713062�0026303�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package dockerimport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Repository *string `mapstructure:"repository" cty:"repository" hcl:"repository"` Tag *string `mapstructure:"tag" cty:"tag" hcl:"tag"` Changes []string `mapstructure:"changes" cty:"changes" hcl:"changes"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "repository": &hcldec.AttrSpec{Name: "repository", Type: cty.String, Required: false}, "tag": &hcldec.AttrSpec{Name: "tag", Type: cty.String, Required: false}, "changes": &hcldec.AttrSpec{Name: "changes", Type: cty.List(cty.String), Required: false}, } return s } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-import/post-processor_test.go��������������������������������0000664�0000000�0000000�00000000345�13771713062�0025636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dockerimport import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-import/version/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022731�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-import/version/version.go������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024742�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var DockerImportPluginVersion *version.PluginVersion func init() { DockerImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-push/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020711�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-push/post-processor.go���������������������������������������0000664�0000000�0000000�00000007217�13771713062�0024251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package dockerpush import ( "context" "fmt" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/docker" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" dockerimport "github.com/hashicorp/packer/post-processor/docker-import" dockertag "github.com/hashicorp/packer/post-processor/docker-tag" ) const BuilderIdImport = "packer.post-processor.docker-import" type Config struct { common.PackerConfig `mapstructure:",squash"` Login bool LoginUsername string `mapstructure:"login_username"` LoginPassword string `mapstructure:"login_password"` LoginServer string `mapstructure:"login_server"` EcrLogin bool `mapstructure:"ecr_login"` docker.AwsAccessConfig `mapstructure:",squash"` ctx interpolate.Context } type PostProcessor struct { Driver docker.Driver config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderIdImport, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } if p.config.EcrLogin && p.config.LoginServer == "" { return fmt.Errorf("ECR login requires login server to be provided.") } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { if artifact.BuilderId() != dockerimport.BuilderId && artifact.BuilderId() != dockertag.BuilderId { err := fmt.Errorf( "Unknown artifact type: %s\nCan only import from docker-import and docker-tag artifacts.", artifact.BuilderId()) return nil, false, false, err } driver := p.Driver if driver == nil { // If no driver is set, then we use the real driver driver = &docker.DockerDriver{Ctx: &p.config.ctx, Ui: ui} } if p.config.EcrLogin { ui.Message("Fetching ECR credentials...") username, password, err := p.config.EcrGetLogin(p.config.LoginServer) if err != nil { return nil, false, false, err } p.config.LoginUsername = username p.config.LoginPassword = password } if p.config.Login || p.config.EcrLogin { ui.Message("Logging in...") err := driver.Login( p.config.LoginServer, p.config.LoginUsername, p.config.LoginPassword) if err != nil { return nil, false, false, fmt.Errorf( "Error logging in to Docker: %s", err) } defer func() { ui.Message("Logging out...") if err := driver.Logout(p.config.LoginServer); err != nil { ui.Error(fmt.Sprintf("Error logging out: %s", err)) } }() } var tags []string switch t := artifact.State("docker_tags").(type) { case []string: tags = t case []interface{}: for _, name := range t { if n, ok := name.(string); ok { tags = append(tags, n) } } } names := []string{artifact.Id()} names = append(names, tags...) // Get the name. for _, name := range names { ui.Message("Pushing: " + name) if err := driver.Push(name); err != nil { return nil, false, false, err } } artifact = &docker.ImportArtifact{ BuilderIdValue: BuilderIdImport, Driver: driver, IdValue: names[0], StateData: map[string]interface{}{"docker_tags": tags}, } return artifact, true, false, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-push/post-processor.hcl2spec.go������������������������������0000664�0000000�0000000�00000011243�13771713062�0025745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package dockerpush import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Login *bool `cty:"login" hcl:"login"` LoginUsername *string `mapstructure:"login_username" cty:"login_username" hcl:"login_username"` LoginPassword *string `mapstructure:"login_password" cty:"login_password" hcl:"login_password"` LoginServer *string `mapstructure:"login_server" cty:"login_server" hcl:"login_server"` EcrLogin *bool `mapstructure:"ecr_login" cty:"ecr_login" hcl:"ecr_login"` AccessKey *string `mapstructure:"aws_access_key" required:"false" cty:"aws_access_key" hcl:"aws_access_key"` SecretKey *string `mapstructure:"aws_secret_key" required:"false" cty:"aws_secret_key" hcl:"aws_secret_key"` Token *string `mapstructure:"aws_token" required:"false" cty:"aws_token" hcl:"aws_token"` Profile *string `mapstructure:"aws_profile" required:"false" cty:"aws_profile" hcl:"aws_profile"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "login": &hcldec.AttrSpec{Name: "login", Type: cty.Bool, Required: false}, "login_username": &hcldec.AttrSpec{Name: "login_username", Type: cty.String, Required: false}, "login_password": &hcldec.AttrSpec{Name: "login_password", Type: cty.String, Required: false}, "login_server": &hcldec.AttrSpec{Name: "login_server", Type: cty.String, Required: false}, "ecr_login": &hcldec.AttrSpec{Name: "ecr_login", Type: cty.Bool, Required: false}, "aws_access_key": &hcldec.AttrSpec{Name: "aws_access_key", Type: cty.String, Required: false}, "aws_secret_key": &hcldec.AttrSpec{Name: "aws_secret_key", Type: cty.String, Required: false}, "aws_token": &hcldec.AttrSpec{Name: "aws_token", Type: cty.String, Required: false}, "aws_profile": &hcldec.AttrSpec{Name: "aws_profile", Type: cty.String, Required: false}, } return s } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-push/post-processor_test.go����������������������������������0000664�0000000�0000000�00000005624�13771713062�0025310�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dockerpush import ( "bytes" "context" "testing" "github.com/hashicorp/packer/builder/docker" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" dockerimport "github.com/hashicorp/packer/post-processor/docker-import" ) func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } } func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } func TestPostProcessor_PostProcess(t *testing.T) { driver := &docker.MockDriver{} p := &PostProcessor{Driver: driver} artifact := &packersdk.MockArtifact{ BuilderIdValue: dockerimport.BuilderId, IdValue: "foo/bar", } result, keep, forceOverride, err := p.PostProcess(context.Background(), testUi(), artifact) if _, ok := result.(packersdk.Artifact); !ok { t.Fatal("should be instance of Artifact") } if !keep { t.Fatal("should keep") } if forceOverride { t.Fatal("Should default to keep, but not override user wishes") } if err != nil { t.Fatalf("err: %s", err) } if !driver.PushCalled { t.Fatal("should call push") } if driver.PushName != "foo/bar" { t.Fatal("bad name") } if result.Id() != "foo/bar" { t.Fatal("bad image id") } } func TestPostProcessor_PostProcess_portInName(t *testing.T) { driver := &docker.MockDriver{} p := &PostProcessor{Driver: driver} artifact := &packersdk.MockArtifact{ BuilderIdValue: dockerimport.BuilderId, IdValue: "localhost:5000/foo/bar", } result, keep, forceOverride, err := p.PostProcess(context.Background(), testUi(), artifact) if _, ok := result.(packersdk.Artifact); !ok { t.Fatal("should be instance of Artifact") } if !keep { t.Fatal("should keep") } if forceOverride { t.Fatal("Should default to keep, but not override user wishes") } if err != nil { t.Fatalf("err: %s", err) } if !driver.PushCalled { t.Fatal("should call push") } if driver.PushName != "localhost:5000/foo/bar" { t.Fatal("bad name") } if result.Id() != "localhost:5000/foo/bar" { t.Fatal("bad image id") } } func TestPostProcessor_PostProcess_tags(t *testing.T) { driver := &docker.MockDriver{} p := &PostProcessor{Driver: driver} artifact := &packersdk.MockArtifact{ BuilderIdValue: dockerimport.BuilderId, IdValue: "hashicorp/ubuntu:precise", } result, keep, forceOverride, err := p.PostProcess(context.Background(), testUi(), artifact) if _, ok := result.(packersdk.Artifact); !ok { t.Fatal("should be instance of Artifact") } if !keep { t.Fatal("should keep") } if forceOverride { t.Fatal("Should default to keep, but not override user wishes") } if err != nil { t.Fatalf("err: %s", err) } if !driver.PushCalled { t.Fatal("should call push") } if driver.PushName != "hashicorp/ubuntu:precise" { t.Fatalf("bad name: %s", driver.PushName) } if result.Id() != "hashicorp/ubuntu:precise" { t.Fatal("bad image id") } } ������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-push/version/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022376�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-push/version/version.go��������������������������������������0000664�0000000�0000000�00000000505�13771713062�0024412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var DockerPushPluginVersion *version.PluginVersion func init() { DockerPushPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-save/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020670�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-save/post-processor.go���������������������������������������0000664�0000000�0000000�00000004435�13771713062�0024227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package dockersave import ( "context" "fmt" "os" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/docker" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" dockerimport "github.com/hashicorp/packer/post-processor/docker-import" dockertag "github.com/hashicorp/packer/post-processor/docker-tag" ) const BuilderId = "packer.post-processor.docker-save" type Config struct { common.PackerConfig `mapstructure:",squash"` Path string `mapstructure:"path"` ctx interpolate.Context } type PostProcessor struct { Driver docker.Driver config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { if artifact.BuilderId() != dockerimport.BuilderId && artifact.BuilderId() != dockertag.BuilderId { err := fmt.Errorf( "Unknown artifact type: %s\nCan only save Docker builder artifacts.", artifact.BuilderId()) return nil, false, false, err } path := p.config.Path // Open the file that we're going to write to f, err := os.Create(path) if err != nil { err := fmt.Errorf("Error creating output file: %s", err) return nil, false, false, err } driver := p.Driver if driver == nil { // If no driver is set, then we use the real driver driver = &docker.DockerDriver{Ctx: &p.config.ctx, Ui: ui} } ui.Message("Saving image: " + artifact.Id()) if err := driver.SaveImage(artifact.Id(), f); err != nil { f.Close() os.Remove(f.Name()) return nil, false, false, err } f.Close() ui.Message("Saved to: " + path) return artifact, true, false, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-save/post-processor.hcl2spec.go������������������������������0000664�0000000�0000000�00000005700�13771713062�0025725�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package dockersave import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Path *string `mapstructure:"path" cty:"path" hcl:"path"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "path": &hcldec.AttrSpec{Name: "path", Type: cty.String, Required: false}, } return s } ����������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-save/post-processor_test.go����������������������������������0000664�0000000�0000000�00000000343�13771713062�0025260�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dockersave import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-save/version/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022355�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-save/version/version.go��������������������������������������0000664�0000000�0000000�00000000505�13771713062�0024371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var DockerSavePluginVersion *version.PluginVersion func init() { DockerSavePluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-tag/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020505�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-tag/post-processor.go����������������������������������������0000664�0000000�0000000�00000006502�13771713062�0024041�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package dockertag import ( "context" "fmt" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/docker" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" dockerimport "github.com/hashicorp/packer/post-processor/docker-import" ) const BuilderId = "packer.post-processor.docker-tag" type Config struct { common.PackerConfig `mapstructure:",squash"` Repository string `mapstructure:"repository"` // Kept for backwards compatability Tag []string `mapstructure:"tag"` Tags []string `mapstructure:"tags"` Force bool ctx interpolate.Context } type PostProcessor struct { Driver docker.Driver config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } // combine Tag and Tags fields allTags := p.config.Tags allTags = append(allTags, p.config.Tag...) p.config.Tags = allTags return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { if len(p.config.Tag) > 0 { ui.Say("Deprecation warning: \"tag\" option has been replaced with " + "\"tags\". In future versions of Packer, this configuration may " + "not work. Please call `packer fix` on your template to update.") } if artifact.BuilderId() != BuilderId && artifact.BuilderId() != dockerimport.BuilderId { err := fmt.Errorf( "Unknown artifact type: %s\nCan only tag from Docker builder artifacts.", artifact.BuilderId()) return nil, false, true, err } driver := p.Driver if driver == nil { // If no driver is set, then we use the real driver driver = &docker.DockerDriver{Ctx: &p.config.ctx, Ui: ui} } importRepo := p.config.Repository var lastTaggedRepo = importRepo RepoTags := []string{} if len(p.config.Tags) > 0 { for _, tag := range p.config.Tags { local := importRepo + ":" + tag ui.Message("Tagging image: " + artifact.Id()) ui.Message("Repository: " + local) err := driver.TagImage(artifact.Id(), local, p.config.Force) if err != nil { return nil, false, true, err } RepoTags = append(RepoTags, local) lastTaggedRepo = local } } else { ui.Message("Tagging image: " + artifact.Id()) ui.Message("Repository: " + importRepo) err := driver.TagImage(artifact.Id(), importRepo, p.config.Force) if err != nil { return nil, false, true, err } } // Build the artifact artifact = &docker.ImportArtifact{ BuilderIdValue: BuilderId, Driver: driver, IdValue: lastTaggedRepo, StateData: map[string]interface{}{"docker_tags": RepoTags}, } // If we tag an image and then delete it, there was no point in creating the // tag. Override users to force us to always keep the input artifact. return artifact, true, true, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-tag/post-processor.hcl2spec.go�������������������������������0000664�0000000�0000000�00000006766�13771713062�0025557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package dockertag import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Repository *string `mapstructure:"repository" cty:"repository" hcl:"repository"` Tag []string `mapstructure:"tag" cty:"tag" hcl:"tag"` Tags []string `mapstructure:"tags" cty:"tags" hcl:"tags"` Force *bool `cty:"force" hcl:"force"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "repository": &hcldec.AttrSpec{Name: "repository", Type: cty.String, Required: false}, "tag": &hcldec.AttrSpec{Name: "tag", Type: cty.List(cty.String), Required: false}, "tags": &hcldec.AttrSpec{Name: "tags", Type: cty.List(cty.String), Required: false}, "force": &hcldec.AttrSpec{Name: "force", Type: cty.Bool, Required: false}, } return s } ����������packer-1.6.6+ds1/post-processor/docker-tag/post-processor_test.go�����������������������������������0000664�0000000�0000000�00000010641�13771713062�0025077�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dockertag import ( "bytes" "context" "testing" "github.com/hashicorp/packer/builder/docker" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" dockerimport "github.com/hashicorp/packer/post-processor/docker-import" "github.com/stretchr/testify/assert" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "repository": "foo", "tag": "bar,buzz", } } func testPP(t *testing.T) *PostProcessor { var p PostProcessor if err := p.Configure(testConfig()); err != nil { t.Fatalf("err: %s", err) } return &p } func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } } func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } func TestPostProcessor_PostProcess(t *testing.T) { driver := &docker.MockDriver{} p := &PostProcessor{Driver: driver} if err := p.Configure(testConfig()); err != nil { t.Fatalf("err: %s", err) } artifact := &packersdk.MockArtifact{ BuilderIdValue: dockerimport.BuilderId, IdValue: "1234567890abcdef", } result, keep, forceOverride, err := p.PostProcess(context.Background(), testUi(), artifact) if _, ok := result.(packersdk.Artifact); !ok { t.Fatal("should be instance of Artifact") } if !keep { t.Fatal("should keep") } if !forceOverride { t.Fatal("Should force keep no matter what user sets.") } if err != nil { t.Fatalf("err: %s", err) } if driver.TagImageCalled != 2 { t.Fatal("should call TagImage") } if driver.TagImageImageId != "1234567890abcdef" { t.Fatal("bad image id") } if driver.TagImageRepo[0] != "foo:bar" { t.Fatal("bad repo") } if driver.TagImageRepo[1] != "foo:buzz" { t.Fatal("bad repo") } if driver.TagImageForce { t.Fatal("bad force. force=false in default") } } func TestPostProcessor_PostProcess_Force(t *testing.T) { driver := &docker.MockDriver{} p := &PostProcessor{Driver: driver} c := testConfig() c["force"] = true if err := p.Configure(c); err != nil { t.Fatalf("err: %s", err) } artifact := &packersdk.MockArtifact{ BuilderIdValue: dockerimport.BuilderId, IdValue: "1234567890abcdef", } result, keep, forceOverride, err := p.PostProcess(context.Background(), testUi(), artifact) if _, ok := result.(packersdk.Artifact); !ok { t.Fatal("should be instance of Artifact") } if !keep { t.Fatal("should keep") } if !forceOverride { t.Fatal("Should force keep no matter what user sets.") } if err != nil { t.Fatalf("err: %s", err) } if driver.TagImageCalled != 2 { t.Fatal("should call TagImage") } if driver.TagImageImageId != "1234567890abcdef" { t.Fatal("bad image id") } if driver.TagImageRepo[0] != "foo:bar" { t.Fatal("bad repo") } if driver.TagImageRepo[1] != "foo:buzz" { t.Fatal("bad repo") } if !driver.TagImageForce { t.Fatal("bad force") } } func TestPostProcessor_PostProcess_NoTag(t *testing.T) { driver := &docker.MockDriver{} p := &PostProcessor{Driver: driver} c := testConfig() delete(c, "tag") if err := p.Configure(c); err != nil { t.Fatalf("err %s", err) } artifact := &packersdk.MockArtifact{BuilderIdValue: dockerimport.BuilderId, IdValue: "1234567890abcdef"} result, keep, forceOverride, err := p.PostProcess(context.Background(), testUi(), artifact) if _, ok := result.(packersdk.Artifact); !ok { t.Fatal("should be instance of Artifact") } if !keep { t.Fatal("should keep") } if !forceOverride { t.Fatal("Should force keep no matter what user sets.") } if err != nil { t.Fatalf("err: %s", err) } if driver.TagImageCalled != 1 { t.Fatal("should call TagImage") } if driver.TagImageImageId != "1234567890abcdef" { t.Fatal("bad image id") } if driver.TagImageRepo[0] != "foo" { t.Fatal("bad repo") } if driver.TagImageForce { t.Fatal("bad force") } } func TestPostProcessor_PostProcess_Tag_vs_Tags(t *testing.T) { testCases := []map[string]interface{}{ { "tag": "bar,buzz", "tags": []string{"bang"}, }, { "tag": []string{"bar", "buzz"}, "tags": []string{"bang"}, }, { "tag": []string{"bar"}, "tags": []string{"buzz", "bang"}, }, } for _, tc := range testCases { var p PostProcessor if err := p.Configure(tc); err != nil { t.Fatalf("err: %s", err) } assert.ElementsMatchf(t, p.config.Tags, []string{"bar", "buzz", "bang"}, "tag and tags fields should be combined into tags fields. Recieved: %#v", p.config.Tags) } } �����������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-tag/version/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022172�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/docker-tag/version/version.go���������������������������������������0000664�0000000�0000000�00000000503�13771713062�0024204�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var DockerTagPluginVersion *version.PluginVersion func init() { DockerTagPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/exoscale-import/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021600�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/exoscale-import/artifact.go�����������������������������������������0000664�0000000�0000000�00000000706�13771713062�0023727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package exoscaleimport const BuilderId = "packer.post-processor.exoscale-import" type Artifact struct { id string } func (a *Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Id() string { return a.id } func (a *Artifact) Files() []string { return nil } func (a *Artifact) String() string { return a.id } func (a *Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return nil } ����������������������������������������������������������packer-1.6.6+ds1/post-processor/exoscale-import/post-processor.go�����������������������������������0000664�0000000�0000000�00000017732�13771713062�0025143�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package exoscaleimport import ( "context" "crypto/md5" "encoding/base64" "fmt" "io" "os" "path/filepath" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/exoscale/egoscale" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/builder/qemu" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/post-processor/artifice" "github.com/hashicorp/packer/post-processor/exoscale-import/version" ) var ( defaultTemplateZone = "ch-gva-2" defaultAPIEndpoint = "https://api.exoscale.com/compute" defaultSOSEndpoint = "https://sos-" + defaultTemplateZone + ".exo.io" ) type Config struct { common.PackerConfig `mapstructure:",squash"` SkipClean bool `mapstructure:"skip_clean"` SOSEndpoint string `mapstructure:"sos_endpoint"` APIEndpoint string `mapstructure:"api_endpoint"` APIKey string `mapstructure:"api_key"` APISecret string `mapstructure:"api_secret"` ImageBucket string `mapstructure:"image_bucket"` TemplateZone string `mapstructure:"template_zone"` TemplateName string `mapstructure:"template_name"` TemplateDescription string `mapstructure:"template_description"` TemplateUsername string `mapstructure:"template_username"` TemplateDisablePassword bool `mapstructure:"template_disable_password"` TemplateDisableSSHKey bool `mapstructure:"template_disable_sshkey"` } func init() { egoscale.UserAgent = "Packer-Exoscale/" + version.ExoscaleImportPluginVersion.FormattedVersion() + " " + egoscale.UserAgent } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { p.config.TemplateZone = defaultTemplateZone p.config.APIEndpoint = defaultAPIEndpoint p.config.SOSEndpoint = defaultSOSEndpoint if err := config.Decode(&p.config, nil, raws...); err != nil { return err } if p.config.APIKey == "" { p.config.APIKey = os.Getenv("EXOSCALE_API_KEY") } if p.config.APISecret == "" { p.config.APISecret = os.Getenv("EXOSCALE_API_SECRET") } requiredArgs := map[string]*string{ "api_key": &p.config.APIKey, "api_secret": &p.config.APISecret, "api_endpoint": &p.config.APIEndpoint, "sos_endpoint": &p.config.SOSEndpoint, "image_bucket": &p.config.ImageBucket, "template_zone": &p.config.TemplateZone, "template_name": &p.config.TemplateName, "template_description": &p.config.TemplateDescription, } errs := new(packersdk.MultiError) for k, v := range requiredArgs { if *v == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", k)) } } if len(errs.Errors) > 0 { return errs } packersdk.LogSecretFilter.Set(p.config.APIKey, p.config.APISecret) return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { switch a.BuilderId() { case qemu.BuilderId, file.BuilderId, artifice.BuilderId: break default: err := fmt.Errorf( "Unknown artifact type: %s\nCan only import from QEMU/file builders and Artifice post-processor artifacts.", a.BuilderId()) return nil, false, false, err } ui.Message("Uploading template image") url, md5sum, err := p.uploadImage(ctx, ui, a) if err != nil { return nil, false, false, fmt.Errorf("unable to upload image: %s", err) } ui.Message("Registering template") id, err := p.registerTemplate(ctx, ui, url, md5sum) if err != nil { return nil, false, false, fmt.Errorf("unable to register template: %s", err) } if !p.config.SkipClean { ui.Message("Deleting uploaded template image") if err = p.deleteImage(ctx, ui, a); err != nil { return nil, false, false, fmt.Errorf("unable to delete uploaded template image: %s", err) } } return &Artifact{id}, false, false, nil } func (p *PostProcessor) uploadImage(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) (string, string, error) { var ( imageFile = a.Files()[0] bucketFile = filepath.Base(imageFile) ) f, err := os.Open(imageFile) if err != nil { return "", "", err } defer f.Close() fileInfo, err := f.Stat() if err != nil { return "", "", err } // For tracking image file upload progress pf := ui.TrackProgress(imageFile, 0, fileInfo.Size(), f) defer pf.Close() hash := md5.New() if _, err := io.Copy(hash, f); err != nil { return "", "", fmt.Errorf("image checksumming failed: %s", err) } if _, err := f.Seek(0, 0); err != nil { return "", "", err } sess := session.Must(session.NewSessionWithOptions(session.Options{Config: aws.Config{ Region: aws.String(p.config.TemplateZone), Endpoint: aws.String(p.config.SOSEndpoint), Credentials: credentials.NewStaticCredentials(p.config.APIKey, p.config.APISecret, "")}})) uploader := s3manager.NewUploader(sess) output, err := uploader.UploadWithContext(ctx, &s3manager.UploadInput{ Body: pf, Bucket: aws.String(p.config.ImageBucket), Key: aws.String(bucketFile), ContentMD5: aws.String(base64.StdEncoding.EncodeToString(hash.Sum(nil))), ACL: aws.String("public-read"), }) if err != nil { return "", "", err } return output.Location, fmt.Sprintf("%x", hash.Sum(nil)), nil } func (p *PostProcessor) deleteImage(ctx context.Context, ui packersdk.Ui, a packersdk.Artifact) error { var ( imageFile = a.Files()[0] bucketFile = filepath.Base(imageFile) ) sess := session.Must(session.NewSessionWithOptions(session.Options{Config: aws.Config{ Region: aws.String(p.config.TemplateZone), Endpoint: aws.String(p.config.SOSEndpoint), Credentials: credentials.NewStaticCredentials(p.config.APIKey, p.config.APISecret, "")}})) svc := s3.New(sess) if _, err := svc.DeleteObject(&s3.DeleteObjectInput{ Bucket: aws.String(p.config.ImageBucket), Key: aws.String(bucketFile), }); err != nil { return err } return nil } func (p *PostProcessor) registerTemplate(ctx context.Context, ui packersdk.Ui, url, md5sum string) (string, error) { var ( passwordEnabled = !p.config.TemplateDisablePassword sshkeyEnabled = !p.config.TemplateDisableSSHKey regErr error ) exo := egoscale.NewClient(p.config.APIEndpoint, p.config.APIKey, p.config.APISecret) exo.RetryStrategy = egoscale.FibonacciRetryStrategy zone := egoscale.Zone{Name: p.config.TemplateZone} if resp, err := exo.GetWithContext(ctx, &zone); err != nil { return "", fmt.Errorf("template zone lookup failed: %s", err) } else { zone.ID = resp.(*egoscale.Zone).ID } req := egoscale.RegisterCustomTemplate{ URL: url, ZoneID: zone.ID, Name: p.config.TemplateName, Displaytext: p.config.TemplateDescription, PasswordEnabled: &passwordEnabled, SSHKeyEnabled: &sshkeyEnabled, Details: map[string]string{"username": p.config.TemplateUsername}, Checksum: md5sum, } res := make([]egoscale.Template, 0) exo.AsyncRequestWithContext(ctx, req, func(jobRes *egoscale.AsyncJobResult, err error) bool { if err != nil { regErr = fmt.Errorf("request failed: %s", err) return false } else if jobRes.JobStatus == egoscale.Pending { // Job is not completed yet ui.Message("template registration in progress") return true } if err := jobRes.Result(&res); err != nil { regErr = err return false } if len(res) != 1 { regErr = fmt.Errorf("unexpected response from API (expected 1 item, got %d)", len(res)) return false } return false }) if regErr != nil { return "", regErr } return res[0].ID.String(), nil } ��������������������������������������packer-1.6.6+ds1/post-processor/exoscale-import/post-processor.hcl2spec.go��������������������������0000664�0000000�0000000�00000012730�13771713062�0026636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package exoscaleimport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"` SOSEndpoint *string `mapstructure:"sos_endpoint" cty:"sos_endpoint" hcl:"sos_endpoint"` APIEndpoint *string `mapstructure:"api_endpoint" cty:"api_endpoint" hcl:"api_endpoint"` APIKey *string `mapstructure:"api_key" cty:"api_key" hcl:"api_key"` APISecret *string `mapstructure:"api_secret" cty:"api_secret" hcl:"api_secret"` ImageBucket *string `mapstructure:"image_bucket" cty:"image_bucket" hcl:"image_bucket"` TemplateZone *string `mapstructure:"template_zone" cty:"template_zone" hcl:"template_zone"` TemplateName *string `mapstructure:"template_name" cty:"template_name" hcl:"template_name"` TemplateDescription *string `mapstructure:"template_description" cty:"template_description" hcl:"template_description"` TemplateUsername *string `mapstructure:"template_username" cty:"template_username" hcl:"template_username"` TemplateDisablePassword *bool `mapstructure:"template_disable_password" cty:"template_disable_password" hcl:"template_disable_password"` TemplateDisableSSHKey *bool `mapstructure:"template_disable_sshkey" cty:"template_disable_sshkey" hcl:"template_disable_sshkey"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "sos_endpoint": &hcldec.AttrSpec{Name: "sos_endpoint", Type: cty.String, Required: false}, "api_endpoint": &hcldec.AttrSpec{Name: "api_endpoint", Type: cty.String, Required: false}, "api_key": &hcldec.AttrSpec{Name: "api_key", Type: cty.String, Required: false}, "api_secret": &hcldec.AttrSpec{Name: "api_secret", Type: cty.String, Required: false}, "image_bucket": &hcldec.AttrSpec{Name: "image_bucket", Type: cty.String, Required: false}, "template_zone": &hcldec.AttrSpec{Name: "template_zone", Type: cty.String, Required: false}, "template_name": &hcldec.AttrSpec{Name: "template_name", Type: cty.String, Required: false}, "template_description": &hcldec.AttrSpec{Name: "template_description", Type: cty.String, Required: false}, "template_username": &hcldec.AttrSpec{Name: "template_username", Type: cty.String, Required: false}, "template_disable_password": &hcldec.AttrSpec{Name: "template_disable_password", Type: cty.Bool, Required: false}, "template_disable_sshkey": &hcldec.AttrSpec{Name: "template_disable_sshkey", Type: cty.Bool, Required: false}, } return s } ����������������������������������������packer-1.6.6+ds1/post-processor/exoscale-import/version/��������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023265�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/exoscale-import/version/version.go����������������������������������0000664�0000000�0000000�00000000515�13771713062�0025302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ExoscaleImportPluginVersion *version.PluginVersion func init() { ExoscaleImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022655�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/artifact.go������������������������������������0000664�0000000�0000000�00000001130�13771713062�0024774�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package googlecomputeexport import ( "fmt" ) const BuilderId = "packer.post-processor.googlecompute-export" type Artifact struct { paths []string } func (*Artifact) BuilderId() string { return BuilderId } func (*Artifact) Id() string { return "" } func (a *Artifact) Files() []string { pathsCopy := make([]string, len(a.paths)) copy(pathsCopy, a.paths) return pathsCopy } func (a *Artifact) String() string { return fmt.Sprintf("Exported artifacts in: %s", a.paths) } func (*Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/post-processor.go������������������������������0000664�0000000�0000000�00000017527�13771713062�0026222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type Config package googlecomputeexport import ( "context" "fmt" "strings" "time" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/googlecompute" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/post-processor/artifice" ) type Config struct { common.PackerConfig `mapstructure:",squash"` //The JSON file containing your account credentials. //If specified, the account file will take precedence over any `googlecompute` builder authentication method. AccountFile string `mapstructure:"account_file"` // This allows service account impersonation as per the [docs](https://cloud.google.com/iam/docs/impersonating-service-accounts). ImpersonateServiceAccount string `mapstructure:"impersonate_service_account" required:"false"` //The size of the export instances disk. //The disk is unused for the export but a larger size will increase `pd-ssd` read speed. //This defaults to `200`, which is 200GB. DiskSizeGb int64 `mapstructure:"disk_size"` //Type of disk used to back the export instance, like //`pd-ssd` or `pd-standard`. Defaults to `pd-ssd`. DiskType string `mapstructure:"disk_type"` //The export instance machine type. Defaults to `"n1-highcpu-4"`. MachineType string `mapstructure:"machine_type"` //The Google Compute network id or URL to use for the export instance. //Defaults to `"default"`. If the value is not a URL, it //will be interpolated to `projects/((builder_project_id))/global/networks/((network))`. //This value is not required if a `subnet` is specified. Network string `mapstructure:"network"` //A list of GCS paths where the image will be exported. //For example `'gs://mybucket/path/to/file.tar.gz'` Paths []string `mapstructure:"paths" required:"true"` //The Google Compute subnetwork id or URL to use for //the export instance. Only required if the `network` has been created with //custom subnetting. Note, the region of the subnetwork must match the //`zone` in which the VM is launched. If the value is not a URL, //it will be interpolated to //`projects/((builder_project_id))/regions/((region))/subnetworks/((subnetwork))` Subnetwork string `mapstructure:"subnetwork"` //The zone in which to launch the export instance. Defaults //to `googlecompute` builder zone. Example: `"us-central1-a"` Zone string `mapstructure:"zone"` IAP bool `mapstructure-to-hcl2:",skip"` VaultGCPOauthEngine string `mapstructure:"vault_gcp_oauth_engine"` ServiceAccountEmail string `mapstructure:"service_account_email"` account *googlecompute.ServiceAccount ctx interpolate.Context } type PostProcessor struct { config Config runner multistep.Runner } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, }, raws...) if err != nil { return err } errs := new(packersdk.MultiError) if len(p.config.Paths) == 0 { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("paths must be specified")) } // Set defaults. if p.config.DiskSizeGb == 0 { p.config.DiskSizeGb = 200 } if p.config.DiskType == "" { p.config.DiskType = "pd-ssd" } if p.config.MachineType == "" { p.config.MachineType = "n1-highcpu-4" } if p.config.Network == "" && p.config.Subnetwork == "" { p.config.Network = "default" } if p.config.AccountFile != "" && p.config.VaultGCPOauthEngine != "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("May set either account_file or "+ "vault_gcp_oauth_engine, but not both.")) } if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { switch artifact.BuilderId() { case googlecompute.BuilderId, artifice.BuilderId: break default: err := fmt.Errorf( "Unknown artifact type: %s\nCan only export from Google Compute Engine builder and Artifice post-processor artifacts.", artifact.BuilderId()) return nil, false, false, err } builderAccountFile := artifact.State("AccountFilePath").(string) builderImageName := artifact.State("ImageName").(string) builderProjectId := artifact.State("ProjectId").(string) builderZone := artifact.State("BuildZone").(string) ui.Say(fmt.Sprintf("Exporting image %v to destination: %v", builderImageName, p.config.Paths)) if p.config.Zone == "" { p.config.Zone = builderZone } // Set up credentials for GCE driver. if builderAccountFile != "" { cfg, err := googlecompute.ProcessAccountFile(builderAccountFile) if err != nil { return nil, false, false, err } p.config.account = cfg } if p.config.AccountFile != "" { cfg, err := googlecompute.ProcessAccountFile(p.config.AccountFile) if err != nil { return nil, false, false, err } p.config.account = cfg } // Set up exporter instance configuration. exporterName := fmt.Sprintf("%s-exporter", artifact.Id()) exporterMetadata := map[string]string{ "image_name": builderImageName, "name": exporterName, "paths": strings.Join(p.config.Paths, " "), "startup-script": StartupScript, "zone": p.config.Zone, } exporterConfig := googlecompute.Config{ DiskName: exporterName, DiskSizeGb: p.config.DiskSizeGb, DiskType: p.config.DiskType, InstanceName: exporterName, MachineType: p.config.MachineType, Metadata: exporterMetadata, Network: p.config.Network, NetworkProjectId: builderProjectId, StateTimeout: 5 * time.Minute, SourceImageFamily: "debian-9-worker", SourceImageProjectId: []string{"compute-image-tools"}, Subnetwork: p.config.Subnetwork, Zone: p.config.Zone, Scopes: []string{ "https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/devstorage.full_control", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/logging.write", }, } if p.config.ServiceAccountEmail != "" { exporterConfig.ServiceAccountEmail = p.config.ServiceAccountEmail } cfg := googlecompute.GCEDriverConfig{ Ui: ui, ProjectId: builderProjectId, Account: p.config.account, ImpersonateServiceAccountName: p.config.ImpersonateServiceAccount, VaultOauthEngineName: p.config.VaultGCPOauthEngine, } driver, err := googlecompute.NewDriverGCE(cfg) if err != nil { return nil, false, false, err } // Set up the state. state := new(multistep.BasicStateBag) state.Put("config", &exporterConfig) state.Put("driver", driver) state.Put("ui", ui) // Build the steps. steps := []multistep.Step{ &communicator.StepSSHKeyGen{ CommConf: &exporterConfig.Comm, }, multistep.If(p.config.PackerDebug, &communicator.StepDumpSSHKey{ Path: fmt.Sprintf("gce_%s.pem", p.config.PackerBuildName), }, ), &googlecompute.StepCreateInstance{ Debug: p.config.PackerDebug, }, new(googlecompute.StepWaitStartupScript), new(googlecompute.StepTeardownInstance), } // Run the steps. p.runner = commonsteps.NewRunner(steps, p.config.PackerConfig, ui) p.runner.Run(ctx, state) result := &Artifact{paths: p.config.Paths} return result, false, false, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/post-processor.hcl2spec.go���������������������0000664�0000000�0000000�00000012415�13771713062�0027713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package googlecomputeexport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` AccountFile *string `mapstructure:"account_file" cty:"account_file" hcl:"account_file"` ImpersonateServiceAccount *string `mapstructure:"impersonate_service_account" required:"false" cty:"impersonate_service_account" hcl:"impersonate_service_account"` DiskSizeGb *int64 `mapstructure:"disk_size" cty:"disk_size" hcl:"disk_size"` DiskType *string `mapstructure:"disk_type" cty:"disk_type" hcl:"disk_type"` MachineType *string `mapstructure:"machine_type" cty:"machine_type" hcl:"machine_type"` Network *string `mapstructure:"network" cty:"network" hcl:"network"` Paths []string `mapstructure:"paths" required:"true" cty:"paths" hcl:"paths"` Subnetwork *string `mapstructure:"subnetwork" cty:"subnetwork" hcl:"subnetwork"` Zone *string `mapstructure:"zone" cty:"zone" hcl:"zone"` VaultGCPOauthEngine *string `mapstructure:"vault_gcp_oauth_engine" cty:"vault_gcp_oauth_engine" hcl:"vault_gcp_oauth_engine"` ServiceAccountEmail *string `mapstructure:"service_account_email" cty:"service_account_email" hcl:"service_account_email"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "account_file": &hcldec.AttrSpec{Name: "account_file", Type: cty.String, Required: false}, "impersonate_service_account": &hcldec.AttrSpec{Name: "impersonate_service_account", Type: cty.String, Required: false}, "disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false}, "disk_type": &hcldec.AttrSpec{Name: "disk_type", Type: cty.String, Required: false}, "machine_type": &hcldec.AttrSpec{Name: "machine_type", Type: cty.String, Required: false}, "network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false}, "paths": &hcldec.AttrSpec{Name: "paths", Type: cty.List(cty.String), Required: false}, "subnetwork": &hcldec.AttrSpec{Name: "subnetwork", Type: cty.String, Required: false}, "zone": &hcldec.AttrSpec{Name: "zone", Type: cty.String, Required: false}, "vault_gcp_oauth_engine": &hcldec.AttrSpec{Name: "vault_gcp_oauth_engine", Type: cty.String, Required: false}, "service_account_email": &hcldec.AttrSpec{Name: "service_account_email", Type: cty.String, Required: false}, } return s } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/post-processor_test.go�������������������������0000664�0000000�0000000�00000000034�13771713062�0027242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package googlecomputeexport ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/startup.go�������������������������������������0000664�0000000�0000000�00000005055�13771713062�0024713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package googlecomputeexport import ( "fmt" "github.com/hashicorp/packer/builder/googlecompute" ) var StartupScript string = fmt.Sprintf(`#!/bin/bash GetMetadata () { echo "$(curl -f -H "Metadata-Flavor: Google" http://metadata/computeMetadata/v1/instance/attributes/$1 2> /dev/null)" } ZONE=$(basename $(GetMetadata zone)) SetMetadata () { gcloud compute instances add-metadata ${HOSTNAME} --metadata ${1}=${2} --zone ${ZONE} } STARTUPSCRIPT=$(GetMetadata attributes/%s) STARTUPSCRIPTPATH=/packer-wrapped-startup-script if [ -f "/var/log/startupscript.log" ]; then STARTUPSCRIPTLOGPATH=/var/log/startupscript.log else STARTUPSCRIPTLOGPATH=/var/log/daemon.log fi STARTUPSCRIPTLOGDEST=$(GetMetadata attributes/startup-script-log-dest) IMAGENAME=$(GetMetadata image_name) NAME=$(GetMetadata name) DISKNAME=${NAME}-toexport PATHS=($(GetMetadata paths)) Exit () { for i in ${PATHS[@]}; do LOGDEST="${i}.exporter.log" echo "Uploading exporter log to ${LOGDEST}..." gsutil -h "Content-Type:text/plain" cp /var/log/daemon.log ${LOGDEST} done exit $1 } echo "####### Export configuration #######" echo "Image name - ${IMAGENAME}" echo "Instance name - ${NAME}" echo "Instance zone - ${ZONE}" echo "Disk name - ${DISKNAME}" echo "Export paths - ${PATHS}" echo "####################################" echo "Creating disk from image to be exported..." if ! gcloud compute disks create ${DISKNAME} --image ${IMAGENAME} --zone ${ZONE}; then echo "Failed to create disk." Exit 1 fi echo "Attaching disk..." if ! gcloud compute instances attach-disk ${NAME} --disk ${DISKNAME} --device-name toexport --zone ${ZONE}; then echo "Failed to attach disk." Exit 1 fi echo "GCEExport: Running export tool." gce_export -gcs_path "${PATHS[0]}" -disk /dev/disk/by-id/google-toexport -y if [ $? -ne 0 ]; then echo "ExportFailed: Failed to export disk source to ${PATHS[0]}." Exit 1 fi echo "ExportSuccess" sync echo "Detaching disk..." if ! gcloud compute instances detach-disk ${NAME} --disk ${DISKNAME} --zone ${ZONE}; then echo "Failed to detach disk." fi FAIL=0 echo "Deleting disk..." if ! gcloud compute disks delete ${DISKNAME} --zone ${ZONE}; then echo "Failed to delete disk." FAIL=1 fi for i in ${PATHS[@]:1}; do echo "Copying archive image to ${i}..." if ! gsutil -o GSUtil:parallel_composite_upload_threshold=100M cp ${PATHS[0]} ${i}; then echo "Failed to copy image to ${i}." FAIL=1 fi done SetMetadata %s %s Exit ${FAIL} `, googlecompute.StartupWrappedScriptKey, googlecompute.StartupScriptStatusKey, googlecompute.StartupScriptStatusDone) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/version/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024342�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-export/version/version.go�����������������������������0000664�0000000�0000000�00000000503�13771713062�0026354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var GCPExportPluginVersion *version.PluginVersion func init() { GCPExportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-import/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022646�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-import/artifact.go������������������������������������0000664�0000000�0000000�00000001130�13771713062�0024765�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package googlecomputeimport import ( "fmt" ) const BuilderId = "packer.post-processor.googlecompute-import" type Artifact struct { paths []string } func (*Artifact) BuilderId() string { return BuilderId } func (*Artifact) Id() string { return "" } func (a *Artifact) Files() []string { pathsCopy := make([]string, len(a.paths)) copy(pathsCopy, a.paths) return pathsCopy } func (a *Artifact) String() string { return fmt.Sprintf("Exported artifacts in: %s", a.paths) } func (*Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-import/artifact_test.go�������������������������������0000664�0000000�0000000�00000000462�13771713062�0026033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package googlecomputeimport import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestArtifact_ImplementsArtifact(t *testing.T) { var raw interface{} raw = &Artifact{} if _, ok := raw.(packersdk.Artifact); !ok { t.Fatalf("Artifact should be a Artifact") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-import/post-processor.go������������������������������0000664�0000000�0000000�00000031406�13771713062�0026203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type Config package googlecomputeimport import ( "context" "crypto/x509" "encoding/base64" "encoding/pem" "fmt" "io/ioutil" "os" "strings" "time" "google.golang.org/api/compute/v1" "google.golang.org/api/option" "google.golang.org/api/storage/v1" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/googlecompute" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/post-processor/artifice" "github.com/hashicorp/packer/post-processor/compress" ) type Config struct { common.PackerConfig `mapstructure:",squash"` //The JSON file containing your account credentials. //If specified, the account file will take precedence over any `googlecompute` builder authentication method. AccountFile string `mapstructure:"account_file" required:"true"` // This allows service account impersonation as per the [docs](https://cloud.google.com/iam/docs/impersonating-service-accounts). ImpersonateServiceAccount string `mapstructure:"impersonate_service_account" required:"false"` //The project ID where the GCS bucket exists and where the GCE image is stored. ProjectId string `mapstructure:"project_id" required:"true"` IAP bool `mapstructure-to-hcl:",skip"` //The name of the GCS bucket where the raw disk image will be uploaded. Bucket string `mapstructure:"bucket" required:"true"` //The name of the GCS object in `bucket` where //the RAW disk image will be copied for import. This is treated as a //[template engine](/docs/templates/engine). Therefore, you //may use user variables and template functions in this field. Defaults to //`packer-import-{{timestamp}}.tar.gz`. GCSObjectName string `mapstructure:"gcs_object_name"` //The description of the resulting image. ImageDescription string `mapstructure:"image_description"` //The name of the image family to which the resulting image belongs. ImageFamily string `mapstructure:"image_family"` //A list of features to enable on the guest operating system. Applicable only for bootable images. Valid //values are `MULTI_IP_SUBNET`, `UEFI_COMPATIBLE`, //`VIRTIO_SCSI_MULTIQUEUE` and `WINDOWS` currently. ImageGuestOsFeatures []string `mapstructure:"image_guest_os_features"` //Key/value pair labels to apply to the created image. ImageLabels map[string]string `mapstructure:"image_labels"` //The unique name of the resulting image. ImageName string `mapstructure:"image_name" required:"true"` //Skip removing the TAR file uploaded to the GCS //bucket after the import process has completed. "true" means that we should //leave it in the GCS bucket, "false" means to clean it out. Defaults to //`false`. SkipClean bool `mapstructure:"skip_clean"` VaultGCPOauthEngine string `mapstructure:"vault_gcp_oauth_engine"` //A key used to establish the trust relationship between the platform owner and the firmware. You may only specify one platform key, and it must be a valid X.509 certificate. ImagePlatformKey string `mapstructure:"image_platform_key"` //A key used to establish a trust relationship between the firmware and the OS. You may specify multiple comma-separated keys for this value. ImageKeyExchangeKey []string `mapstructure:"image_key_exchange_key"` //A database of certificates that have been revoked and will cause the system to stop booting if a boot file is signed with one of them. You may specify single or multiple comma-separated values for this value. ImageSignaturesDB []string `mapstructure:"image_signatures_db"` //A database of certificates that are trusted and can be used to sign boot files. You may specify single or multiple comma-separated values for this value. ImageForbiddenSignaturesDB []string `mapstructure:"image_forbidden_signatures_db"` account *googlecompute.ServiceAccount ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "gcs_object_name", }, }, }, raws...) if err != nil { return err } errs := new(packersdk.MultiError) // Set defaults if p.config.GCSObjectName == "" { p.config.GCSObjectName = "packer-import-{{timestamp}}.tar.gz" } // Check and render gcs_object_name if err = interpolate.Validate(p.config.GCSObjectName, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing gcs_object_name template: %s", err)) } if p.config.AccountFile != "" { if p.config.VaultGCPOauthEngine != "" && p.config.ImpersonateServiceAccount != "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("You cannot "+ "specify impersonate_service_account, account_file and vault_gcp_oauth_engine at the same time")) } cfg, err := googlecompute.ProcessAccountFile(p.config.AccountFile) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } p.config.account = cfg } templates := map[string]*string{ "bucket": &p.config.Bucket, "image_name": &p.config.ImageName, "project_id": &p.config.ProjectId, } for key, ptr := range templates { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { generatedData := artifact.State("generated_data") if generatedData == nil { // Make sure it's not a nil map so we can assign to it later. generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData var err error var opts option.ClientOption opts, err = googlecompute.NewClientOptionGoogle(p.config.account, p.config.VaultGCPOauthEngine, p.config.ImpersonateServiceAccount) if err != nil { return nil, false, false, err } switch artifact.BuilderId() { case compress.BuilderId, artifice.BuilderId: break default: err := fmt.Errorf( "Unknown artifact type: %s\nCan only import from Compress post-processor and Artifice post-processor artifacts.", artifact.BuilderId()) return nil, false, false, err } p.config.GCSObjectName, err = interpolate.Render(p.config.GCSObjectName, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error rendering gcs_object_name template: %s", err) } rawImageGcsPath, err := UploadToBucket(opts, ui, artifact, p.config.Bucket, p.config.GCSObjectName) if err != nil { return nil, false, false, err } shieldedVMStateConfig, err := CreateShieldedVMStateConfig(p.config.ImageGuestOsFeatures, p.config.ImagePlatformKey, p.config.ImageKeyExchangeKey, p.config.ImageSignaturesDB, p.config.ImageForbiddenSignaturesDB) if err != nil { return nil, false, false, err } gceImageArtifact, err := CreateGceImage(opts, ui, p.config.ProjectId, rawImageGcsPath, p.config.ImageName, p.config.ImageDescription, p.config.ImageFamily, p.config.ImageLabels, p.config.ImageGuestOsFeatures, shieldedVMStateConfig) if err != nil { return nil, false, false, err } if !p.config.SkipClean { err = DeleteFromBucket(opts, ui, p.config.Bucket, p.config.GCSObjectName) if err != nil { return nil, false, false, err } } return gceImageArtifact, false, false, nil } func FillFileContentBuffer(certOrKeyFile string) (*compute.FileContentBuffer, error) { data, err := ioutil.ReadFile(certOrKeyFile) if err != nil { err := fmt.Errorf("Unable to read Certificate or Key file %s", certOrKeyFile) return nil, err } shield := &compute.FileContentBuffer{ Content: base64.StdEncoding.EncodeToString(data), FileType: "X509", } block, _ := pem.Decode(data) if block == nil || block.Type != "CERTIFICATE" { _, err = x509.ParseCertificate(data) } else { _, err = x509.ParseCertificate(block.Bytes) } if err != nil { shield.FileType = "BIN" } return shield, nil } func CreateShieldedVMStateConfig(imageGuestOsFeatures []string, imagePlatformKey string, imageKeyExchangeKey []string, imageSignaturesDB []string, imageForbiddenSignaturesDB []string) (*compute.InitialStateConfig, error) { shieldedVMStateConfig := &compute.InitialStateConfig{} for _, v := range imageGuestOsFeatures { if v == "UEFI_COMPATIBLE" { if imagePlatformKey != "" { shieldedData, err := FillFileContentBuffer(imagePlatformKey) if err != nil { return nil, err } shieldedVMStateConfig.Pk = shieldedData } for _, v := range imageKeyExchangeKey { shieldedData, err := FillFileContentBuffer(v) if err != nil { return nil, err } shieldedVMStateConfig.Keks = append(shieldedVMStateConfig.Keks, shieldedData) } for _, v := range imageSignaturesDB { shieldedData, err := FillFileContentBuffer(v) if err != nil { return nil, err } shieldedVMStateConfig.Dbs = append(shieldedVMStateConfig.Dbs, shieldedData) } for _, v := range imageForbiddenSignaturesDB { shieldedData, err := FillFileContentBuffer(v) if err != nil { return nil, err } shieldedVMStateConfig.Dbxs = append(shieldedVMStateConfig.Dbxs, shieldedData) } } } return shieldedVMStateConfig, nil } func UploadToBucket(opts option.ClientOption, ui packersdk.Ui, artifact packersdk.Artifact, bucket string, gcsObjectName string) (string, error) { service, err := storage.NewService(context.TODO(), opts) if err != nil { return "", err } ui.Say("Looking for tar.gz file in list of artifacts...") source := "" for _, path := range artifact.Files() { ui.Say(fmt.Sprintf("Found artifact %v...", path)) if strings.HasSuffix(path, ".tar.gz") { source = path break } } if source == "" { return "", fmt.Errorf("No tar.gz file found in list of artifacts") } artifactFile, err := os.Open(source) if err != nil { err := fmt.Errorf("error opening %v", source) return "", err } ui.Say(fmt.Sprintf("Uploading file %v to GCS bucket %v/%v...", source, bucket, gcsObjectName)) storageObject, err := service.Objects.Insert(bucket, &storage.Object{Name: gcsObjectName}).Media(artifactFile).Do() if err != nil { ui.Say(fmt.Sprintf("Failed to upload: %v", storageObject)) return "", err } return storageObject.SelfLink, nil } func CreateGceImage(opts option.ClientOption, ui packersdk.Ui, project string, rawImageURL string, imageName string, imageDescription string, imageFamily string, imageLabels map[string]string, imageGuestOsFeatures []string, shieldedVMStateConfig *compute.InitialStateConfig) (packersdk.Artifact, error) { service, err := compute.NewService(context.TODO(), opts) if err != nil { return nil, err } // Build up the imageFeatures imageFeatures := make([]*compute.GuestOsFeature, len(imageGuestOsFeatures)) for _, v := range imageGuestOsFeatures { imageFeatures = append(imageFeatures, &compute.GuestOsFeature{ Type: v, }) } gceImage := &compute.Image{ Description: imageDescription, Family: imageFamily, GuestOsFeatures: imageFeatures, Labels: imageLabels, Name: imageName, RawDisk: &compute.ImageRawDisk{Source: rawImageURL}, SourceType: "RAW", ShieldedInstanceInitialState: shieldedVMStateConfig, } ui.Say(fmt.Sprintf("Creating GCE image %v...", imageName)) op, err := service.Images.Insert(project, gceImage).Do() if err != nil { ui.Say("Error creating GCE image") return nil, err } ui.Say("Waiting for GCE image creation operation to complete...") for op.Status != "DONE" { op, err = service.GlobalOperations.Get(project, op.Name).Do() if err != nil { return nil, err } time.Sleep(5 * time.Second) } // fail if image creation operation has an error if op.Error != nil { var imageError string for _, error := range op.Error.Errors { imageError += error.Message } err = fmt.Errorf("failed to create GCE image %s: %s", imageName, imageError) return nil, err } return &Artifact{paths: []string{op.TargetLink}}, nil } func DeleteFromBucket(opts option.ClientOption, ui packersdk.Ui, bucket string, gcsObjectName string) error { service, err := storage.NewService(context.TODO(), opts) if err != nil { return err } ui.Say(fmt.Sprintf("Deleting import source from GCS %s/%s...", bucket, gcsObjectName)) err = service.Objects.Delete(bucket, gcsObjectName).Do() if err != nil { ui.Say(fmt.Sprintf("Failed to delete: %v/%v", bucket, gcsObjectName)) return err } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-import/post-processor.hcl2spec.go���������������������0000664�0000000�0000000�00000015706�13771713062�0027712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package googlecomputeimport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` AccountFile *string `mapstructure:"account_file" required:"true" cty:"account_file" hcl:"account_file"` ImpersonateServiceAccount *string `mapstructure:"impersonate_service_account" required:"false" cty:"impersonate_service_account" hcl:"impersonate_service_account"` ProjectId *string `mapstructure:"project_id" required:"true" cty:"project_id" hcl:"project_id"` IAP *bool `mapstructure-to-hcl:",skip" cty:"iap" hcl:"iap"` Bucket *string `mapstructure:"bucket" required:"true" cty:"bucket" hcl:"bucket"` GCSObjectName *string `mapstructure:"gcs_object_name" cty:"gcs_object_name" hcl:"gcs_object_name"` ImageDescription *string `mapstructure:"image_description" cty:"image_description" hcl:"image_description"` ImageFamily *string `mapstructure:"image_family" cty:"image_family" hcl:"image_family"` ImageGuestOsFeatures []string `mapstructure:"image_guest_os_features" cty:"image_guest_os_features" hcl:"image_guest_os_features"` ImageLabels map[string]string `mapstructure:"image_labels" cty:"image_labels" hcl:"image_labels"` ImageName *string `mapstructure:"image_name" required:"true" cty:"image_name" hcl:"image_name"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"` VaultGCPOauthEngine *string `mapstructure:"vault_gcp_oauth_engine" cty:"vault_gcp_oauth_engine" hcl:"vault_gcp_oauth_engine"` ImagePlatformKey *string `mapstructure:"image_platform_key" cty:"image_platform_key" hcl:"image_platform_key"` ImageKeyExchangeKey []string `mapstructure:"image_key_exchange_key" cty:"image_key_exchange_key" hcl:"image_key_exchange_key"` ImageSignaturesDB []string `mapstructure:"image_signatures_db" cty:"image_signatures_db" hcl:"image_signatures_db"` ImageForbiddenSignaturesDB []string `mapstructure:"image_forbidden_signatures_db" cty:"image_forbidden_signatures_db" hcl:"image_forbidden_signatures_db"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "account_file": &hcldec.AttrSpec{Name: "account_file", Type: cty.String, Required: false}, "impersonate_service_account": &hcldec.AttrSpec{Name: "impersonate_service_account", Type: cty.String, Required: false}, "project_id": &hcldec.AttrSpec{Name: "project_id", Type: cty.String, Required: false}, "iap": &hcldec.AttrSpec{Name: "iap", Type: cty.Bool, Required: false}, "bucket": &hcldec.AttrSpec{Name: "bucket", Type: cty.String, Required: false}, "gcs_object_name": &hcldec.AttrSpec{Name: "gcs_object_name", Type: cty.String, Required: false}, "image_description": &hcldec.AttrSpec{Name: "image_description", Type: cty.String, Required: false}, "image_family": &hcldec.AttrSpec{Name: "image_family", Type: cty.String, Required: false}, "image_guest_os_features": &hcldec.AttrSpec{Name: "image_guest_os_features", Type: cty.List(cty.String), Required: false}, "image_labels": &hcldec.AttrSpec{Name: "image_labels", Type: cty.Map(cty.String), Required: false}, "image_name": &hcldec.AttrSpec{Name: "image_name", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "vault_gcp_oauth_engine": &hcldec.AttrSpec{Name: "vault_gcp_oauth_engine", Type: cty.String, Required: false}, "image_platform_key": &hcldec.AttrSpec{Name: "image_platform_key", Type: cty.String, Required: false}, "image_key_exchange_key": &hcldec.AttrSpec{Name: "image_key_exchange_key", Type: cty.List(cty.String), Required: false}, "image_signatures_db": &hcldec.AttrSpec{Name: "image_signatures_db", Type: cty.List(cty.String), Required: false}, "image_forbidden_signatures_db": &hcldec.AttrSpec{Name: "image_forbidden_signatures_db", Type: cty.List(cty.String), Required: false}, } return s } ����������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-import/version/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024333�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/googlecompute-import/version/version.go�����������������������������0000664�0000000�0000000�00000000503�13771713062�0026345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var GCPImportPluginVersion *version.PluginVersion func init() { GCPImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/manifest/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020273�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/manifest/artifact.go������������������������������������������������0000664�0000000�0000000�00000002036�13771713062�0022420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package manifest import "fmt" const BuilderId = "packer.post-processor.manifest" type ArtifactFile struct { Name string `json:"name"` Size int64 `json:"size"` } type Artifact struct { BuildName string `json:"name"` BuilderType string `json:"builder_type"` BuildTime int64 `json:"build_time,omitempty"` ArtifactFiles []ArtifactFile `json:"files"` ArtifactId string `json:"artifact_id"` PackerRunUUID string `json:"packer_run_uuid"` CustomData map[string]string `json:"custom_data"` } func (a *Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Files() []string { var files []string for _, af := range a.ArtifactFiles { files = append(files, af.Name) } return files } func (a *Artifact) Id() string { return a.ArtifactId } func (a *Artifact) String() string { return fmt.Sprintf("%s-%s", a.BuildName, a.ArtifactId) } func (a *Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/manifest/post-processor.go������������������������������������������0000664�0000000�0000000�00000014075�13771713062�0023633�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config //go:generate struct-markdown package manifest import ( "context" "encoding/json" "fmt" "io/ioutil" "log" "os" "path/filepath" "time" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` // The manifest will be written to this file. This defaults to // `packer-manifest.json`. OutputPath string `mapstructure:"output"` // Write only filename without the path to the manifest file. This defaults // to false. StripPath bool `mapstructure:"strip_path"` // Don't write the `build_time` field from the output. StripTime bool `mapstructure:"strip_time"` // Arbitrary data to add to the manifest. This is a [template // engine](https://packer.io/docs/templates/engine.html). Therefore, you // may use user variables and template functions in this field. CustomData map[string]string `mapstructure:"custom_data"` ctx interpolate.Context } type PostProcessor struct { config Config } type ManifestFile struct { Builds []Artifact `json:"builds"` LastRunUUID string `json:"last_run_uuid"` } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "packer.post-processor.manifest", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } if p.config.OutputPath == "" { p.config.OutputPath = "packer-manifest.json" } if err = interpolate.Validate(p.config.OutputPath, &p.config.ctx); err != nil { return fmt.Errorf("Error parsing target template: %s", err) } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, source packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { generatedData := source.State("generated_data") if generatedData == nil { // Make sure it's not a nil map so we can assign to it later. generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData for key, data := range p.config.CustomData { interpolatedData, err := createInterpolatedCustomData(&p.config, data) if err != nil { return nil, false, false, err } p.config.CustomData[key] = interpolatedData } artifact := &Artifact{} var err error var fi os.FileInfo // Create the current artifact. for _, name := range source.Files() { af := ArtifactFile{} if fi, err = os.Stat(name); err == nil { af.Size = fi.Size() } if p.config.StripPath { af.Name = filepath.Base(name) } else { af.Name = name } artifact.ArtifactFiles = append(artifact.ArtifactFiles, af) } artifact.ArtifactId = source.Id() artifact.CustomData = p.config.CustomData artifact.BuilderType = p.config.PackerBuilderType artifact.BuildName = p.config.PackerBuildName artifact.BuildTime = time.Now().Unix() if p.config.StripTime { artifact.BuildTime = 0 } // Since each post-processor runs in a different process we need a way to // coordinate between various post-processors in a single packer run. We do // this by setting a UUID per run and tracking this in the manifest file. // When we detect that the UUID in the file is the same, we know that we are // part of the same run and we simply add our data to the list. If the UUID // is different we will check the -force flag and decide whether to truncate // the file before we proceed. artifact.PackerRunUUID = os.Getenv("PACKER_RUN_UUID") // Create a lock file with exclusive access. If this fails we will retry // after a delay. lockFilename := p.config.OutputPath + ".lock" for i := 0; i < 3; i++ { // The file should not be locked for very long so we'll keep this short. time.Sleep((time.Duration(i) * 200 * time.Millisecond)) _, err = os.OpenFile(lockFilename, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) if err == nil { break } log.Printf("Error locking manifest file for reading and writing. Will sleep and retry. %s", err) } defer os.Remove(lockFilename) // Read the current manifest file from disk contents := []byte{} if contents, err = ioutil.ReadFile(p.config.OutputPath); err != nil && !os.IsNotExist(err) { return source, true, true, fmt.Errorf("Unable to open %s for reading: %s", p.config.OutputPath, err) } // Parse the manifest file JSON, if we have one manifestFile := &ManifestFile{} if len(contents) > 0 { if err = json.Unmarshal(contents, manifestFile); err != nil { return source, true, true, fmt.Errorf("Unable to parse content from %s: %s", p.config.OutputPath, err) } } // If -force is set and we are not on same run, truncate the file. Otherwise // we will continue to add new builds to the existing manifest file. if p.config.PackerForce && os.Getenv("PACKER_RUN_UUID") != manifestFile.LastRunUUID { manifestFile = &ManifestFile{} } // Add the current artifact to the manifest file manifestFile.Builds = append(manifestFile.Builds, *artifact) manifestFile.LastRunUUID = os.Getenv("PACKER_RUN_UUID") // Write JSON to disk if out, err := json.MarshalIndent(manifestFile, "", " "); err == nil { if err = ioutil.WriteFile(p.config.OutputPath, out, 0664); err != nil { return source, true, true, fmt.Errorf("Unable to write %s: %s", p.config.OutputPath, err) } } else { return source, true, true, fmt.Errorf("Unable to marshal JSON %s", err) } // The manifest should never delete the artifacts it is set to record, so it // forcibly sets "keep" to true. return source, true, true, nil } func createInterpolatedCustomData(config *Config, customData string) (string, error) { interpolatedCmd, err := interpolate.Render(customData, &config.ctx) if err != nil { return "", fmt.Errorf("Error interpolating custom data: %s", err) } return interpolatedCmd, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/manifest/post-processor.hcl2spec.go���������������������������������0000664�0000000�0000000�00000007071�13771713062�0025333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package manifest import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` OutputPath *string `mapstructure:"output" cty:"output" hcl:"output"` StripPath *bool `mapstructure:"strip_path" cty:"strip_path" hcl:"strip_path"` StripTime *bool `mapstructure:"strip_time" cty:"strip_time" hcl:"strip_time"` CustomData map[string]string `mapstructure:"custom_data" cty:"custom_data" hcl:"custom_data"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "output": &hcldec.AttrSpec{Name: "output", Type: cty.String, Required: false}, "strip_path": &hcldec.AttrSpec{Name: "strip_path", Type: cty.Bool, Required: false}, "strip_time": &hcldec.AttrSpec{Name: "strip_time", Type: cty.Bool, Required: false}, "custom_data": &hcldec.AttrSpec{Name: "custom_data", Type: cty.Map(cty.String), Required: false}, } return s } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/manifest/version/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021760�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/manifest/version/version.go�����������������������������������������0000664�0000000�0000000�00000000501�13771713062�0023770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ManifestPluginVersion *version.PluginVersion func init() { ManifestPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/shell-local/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020664�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/shell-local/post-processor.go���������������������������������������0000664�0000000�0000000�00000004073�13771713062�0024221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_local import ( "context" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" sl "github.com/hashicorp/packer/packer-plugin-sdk/shell-local" ) type PostProcessor struct { config sl.Config } type ExecuteCommandTemplate struct { Vars string Script string } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := sl.Decode(&p.config, raws...) if err != nil { return err } if len(p.config.ExecuteCommand) == 1 { // Backwards compatibility -- before we merged the shell-local // post-processor and provisioners, the post-processor accepted // execute_command as a string rather than a slice of strings. It didn't // have a configurable call to shell program, automatically prepending // the user-supplied execute_command string with "sh -c". If users are // still using the old way of defining ExecuteCommand (by supplying a // single string rather than a slice of strings) then we need to // prepend this command with the call that the post-processor defaulted // to before. p.config.ExecuteCommand = append([]string{"sh", "-c"}, p.config.ExecuteCommand...) } return sl.Validate(&p.config) } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { generatedData := make(map[string]interface{}) artifactStateData := artifact.State("generated_data") if artifactStateData != nil { for k, v := range artifactStateData.(map[interface{}]interface{}) { generatedData[k.(string)] = v } } success, retErr := sl.Run(ctx, ui, &p.config, generatedData) if !success { return nil, false, false, retErr } // Force shell-local pp to keep the input artifact, because otherwise we'll // lose it instead of being able to pass it through. If you want to delete // the input artifact for a shell local pp, use the artifice pp to create a // new artifact return artifact, true, true, retErr } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/shell-local/post-processor_test.go����������������������������������0000664�0000000�0000000�00000014466�13771713062�0025267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_local import ( "io/ioutil" "os" "runtime" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/stretchr/testify/assert" ) func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } func testConfig() map[string]interface{} { return map[string]interface{}{ "inline": []interface{}{"foo", "bar"}, } } func TestPostProcessor_Impl(t *testing.T) { var raw interface{} raw = &PostProcessor{} if _, ok := raw.(packersdk.PostProcessor); !ok { t.Fatalf("must be a post processor") } } func TestPostProcessorPrepare_Defaults(t *testing.T) { var p PostProcessor raws := testConfig() err := p.Configure(raws) if err != nil { t.Fatalf("err: %s", err) } } func TestPostProcessorPrepare_InlineShebang(t *testing.T) { raws := testConfig() delete(raws, "inline_shebang") p := new(PostProcessor) err := p.Configure(raws) if err != nil { t.Fatalf("should not have error: %s", err) } expected := "" if runtime.GOOS != "windows" { expected = "/bin/sh -e" } if p.config.InlineShebang != expected { t.Fatalf("bad value: %s", p.config.InlineShebang) } // Test with a good one raws["inline_shebang"] = "foo" p = new(PostProcessor) err = p.Configure(raws) if err != nil { t.Fatalf("should not have error: %s", err) } if p.config.InlineShebang != "foo" { t.Fatalf("bad value: %s", p.config.InlineShebang) } } func TestPostProcessorPrepare_InvalidKey(t *testing.T) { var p PostProcessor raws := testConfig() // Add a random key raws["i_should_not_be_valid"] = true err := p.Configure(raws) if err == nil { t.Fatal("should have error") } } func TestPostProcessorPrepare_Script(t *testing.T) { raws := testConfig() delete(raws, "inline") raws["script"] = "/this/should/not/exist" p := new(PostProcessor) err := p.Configure(raws) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) raws["script"] = tf.Name() p = new(PostProcessor) err = p.Configure(raws) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestPostProcessorPrepare_ExecuteCommand(t *testing.T) { // Check that passing a string will work (Backwards Compatibility) p := new(PostProcessor) raws := testConfig() raws["execute_command"] = "foo bar" err := p.Configure(raws) expected := []string{"sh", "-c", "foo bar"} if err != nil { t.Fatalf("should handle backwards compatibility: %s", err) } assert.Equal(t, p.config.ExecuteCommand, expected, "Did not get expected execute_command: expected: %#v; received %#v", expected, p.config.ExecuteCommand) // Check that passing a list will work p = new(PostProcessor) raws = testConfig() raws["execute_command"] = []string{"foo", "bar"} err = p.Configure(raws) if err != nil { t.Fatalf("should handle backwards compatibility: %s", err) } expected = []string{"foo", "bar"} assert.Equal(t, p.config.ExecuteCommand, expected, "Did not get expected execute_command: expected: %#v; received %#v", expected, p.config.ExecuteCommand) // Check that default is as expected raws = testConfig() delete(raws, "execute_command") p = new(PostProcessor) p.Configure(raws) if runtime.GOOS != "windows" { expected = []string{"/bin/sh", "-c", "{{.Vars}} {{.Script}}"} } else { expected = []string{"cmd", "/V", "/C", "{{.Vars}}", "call", "{{.Script}}"} } assert.Equal(t, p.config.ExecuteCommand, expected, "Did not get expected default: expected: %#v; received %#v", expected, p.config.ExecuteCommand) } func TestPostProcessorPrepare_ScriptAndInline(t *testing.T) { var p PostProcessor raws := testConfig() // Error if no scripts/inline commands provided delete(raws, "inline") delete(raws, "script") delete(raws, "command") delete(raws, "scripts") err := p.Configure(raws) if err == nil { t.Fatalf("should error when no scripts/inline commands are provided") } // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) raws["inline"] = []interface{}{"foo"} raws["script"] = tf.Name() err = p.Configure(raws) if err == nil { t.Fatal("should have error") } } func TestPostProcessorPrepare_ScriptAndScripts(t *testing.T) { var p PostProcessor raws := testConfig() // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) raws["inline"] = []interface{}{"foo"} raws["scripts"] = []string{tf.Name()} err = p.Configure(raws) if err == nil { t.Fatal("should have error") } } func TestPostProcessorPrepare_Scripts(t *testing.T) { raws := testConfig() delete(raws, "inline") raws["scripts"] = []string{} p := new(PostProcessor) err := p.Configure(raws) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) raws["scripts"] = []string{tf.Name()} p = new(PostProcessor) err = p.Configure(raws) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestPostProcessorPrepare_EnvironmentVars(t *testing.T) { raws := testConfig() // Test with a bad case raws["environment_vars"] = []string{"badvar", "good=var"} p := new(PostProcessor) err := p.Configure(raws) if err == nil { t.Fatal("should have error") } // Test with a trickier case raws["environment_vars"] = []string{"=bad"} p = new(PostProcessor) err = p.Configure(raws) if err == nil { t.Fatal("should have error") } // Test with a good case // Note: baz= is a real env variable, just empty raws["environment_vars"] = []string{"FOO=bar", "baz="} p = new(PostProcessor) err = p.Configure(raws) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value contains an equals sign raws["environment_vars"] = []string{"good=withequals=true"} p = new(PostProcessor) err = p.Configure(raws) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value starts with an equals sign raws["environment_vars"] = []string{"good==true"} p = new(PostProcessor) err = p.Configure(raws) if err != nil { t.Fatalf("should not have error: %s", err) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/shell-local/version/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022351�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/shell-local/version/version.go��������������������������������������0000664�0000000�0000000�00000000505�13771713062�0024365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ShellLocalPluginVersion *version.PluginVersion func init() { ShellLocalPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/ucloud-import/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021270�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/ucloud-import/post-processor.go�������������������������������������0000664�0000000�0000000�00000030160�13771713062�0024621�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config //go:generate struct-markdown package ucloudimport import ( "context" "fmt" "log" "net/url" "strings" "time" "github.com/hashicorp/hcl/v2/hcldec" ucloudcommon "github.com/hashicorp/packer/builder/ucloud/common" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/ucloud/ucloud-sdk-go/services/ufile" "github.com/ucloud/ucloud-sdk-go/services/uhost" "github.com/ucloud/ucloud-sdk-go/ucloud" ufsdk "github.com/ufilesdk-dev/ufile-gosdk" ) const ( BuilderId = "packer.post-processor.ucloud-import" ImageFileFormatRAW = "raw" ImageFileFormatVHD = "vhd" ImageFileFormatVMDK = "vmdk" ImageFileFormatQCOW2 = "qcow2" ) var imageFormatMap = ucloudcommon.NewStringConverter(map[string]string{ "raw": "RAW", "vhd": "VHD", "vmdk": "VMDK", }) // Configuration of this post processor type Config struct { common.PackerConfig `mapstructure:",squash"` ucloudcommon.AccessConfig `mapstructure:",squash"` // The name of the UFile bucket where the RAW, VHD, VMDK, or qcow2 file will be copied to for import. // This bucket must exist when the post-processor is run. UFileBucket string `mapstructure:"ufile_bucket_name" required:"true"` // The name of the object key in // `ufile_bucket_name` where the RAW, VHD, VMDK, or qcow2 file will be copied // to import. This is a [template engine](/docs/templates/engine). // Therefore, you may use user variables and template functions in this field. UFileKey string `mapstructure:"ufile_key_name" required:"false"` // Whether we should skip removing the RAW, VHD, VMDK, or qcow2 file uploaded to // UFile after the import process has completed. Possible values are: `true` to // leave it in the UFile bucket, `false` to remove it. (Default: `false`). SkipClean bool `mapstructure:"skip_clean" required:"false"` // The name of the user-defined image, which contains 1-63 characters and only // supports Chinese, English, numbers, '-\_,.:[]'. ImageName string `mapstructure:"image_name" required:"true"` // The description of the image. ImageDescription string `mapstructure:"image_description" required:"false"` // Type of the OS. Possible values are: `CentOS`, `Ubuntu`, `Windows`, `RedHat`, `Debian`, `Other`. // You may refer to [ucloud_api_docs](https://docs.ucloud.cn/api/uhost-api/import_custom_image) for detail. OSType string `mapstructure:"image_os_type" required:"true"` // The name of OS. Such as: `CentOS 7.2 64位`, set `Other` When `image_os_type` is `Other`. // You may refer to [ucloud_api_docs](https://docs.ucloud.cn/api/uhost-api/import_custom_image) for detail. OSName string `mapstructure:"image_os_name" required:"true"` // The format of the import image , Possible values are: `raw`, `vhd`, `vmdk`, or `qcow2`. Format string `mapstructure:"format" required:"true"` // Timeout of importing image. The default timeout is 3600 seconds if this option is not set or is set. WaitImageReadyTimeout int `mapstructure:"wait_image_ready_timeout" required:"false"` ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "ufile_key_name", }, }, }, raws...) if err != nil { return err } // Set defaults if p.config.UFileKey == "" { p.config.UFileKey = "packer-import-{{timestamp}}." + p.config.Format } if p.config.WaitImageReadyTimeout <= 0 { p.config.WaitImageReadyTimeout = ucloudcommon.DefaultCreateImageTimeout } errs := new(packersdk.MultiError) // Check and render ufile_key_name if err = interpolate.Validate(p.config.UFileKey, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing ufile_key_name template: %s", err)) } // Check we have ucloud access variables defined somewhere errs = packersdk.MultiErrorAppend(errs, p.config.AccessConfig.Prepare(&p.config.ctx)...) // define all our required parameters templates := map[string]*string{ "ufile_bucket_name": &p.config.UFileBucket, "image_name": &p.config.ImageName, "image_os_type": &p.config.OSType, "image_os_name": &p.config.OSName, "format": &p.config.Format, } // Check out required params are defined for key, ptr := range templates { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } imageName := p.config.ImageName if !ucloudcommon.ImageNamePattern.MatchString(imageName) { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("expected %q to be 1-63 characters and only support chinese, english, numbers, '-_,.:[]', got %q", "image_name", imageName)) } switch p.config.Format { case ImageFileFormatVHD, ImageFileFormatRAW, ImageFileFormatVMDK, ImageFileFormatQCOW2: default: errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("expected %q only be one of 'raw', 'vhd', 'vmdk', or 'qcow2', got %q", "format", p.config.Format)) } // Anything which flagged return back up the stack if len(errs.Errors) > 0 { return errs } packersdk.LogSecretFilter.Set(p.config.PublicKey, p.config.PrivateKey) log.Println(p.config) return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { var err error generatedData := artifact.State("generated_data") if generatedData == nil { // Make sure it's not a nil map so we can assign to it later. generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData client, err := p.config.Client() if err != nil { return nil, false, false, fmt.Errorf("Failed to connect ucloud client %s", err) } uhostconn := client.UHostConn ufileconn := client.UFileConn // Render this key since we didn't in the configure phase p.config.UFileKey, err = interpolate.Render(p.config.UFileKey, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error rendering ufile_key_name template: %s", err) } ui.Message(fmt.Sprintf("Rendered ufile_key_name as %s", p.config.UFileKey)) ui.Message("Looking for image in artifact") // Locate the files output from the builder var source string for _, path := range artifact.Files() { if strings.HasSuffix(path, "."+p.config.Format) { source = path break } } // Hope we found something useful if source == "" { return nil, false, false, fmt.Errorf("No %s image file found in artifact from builder", p.config.Format) } keyName := p.config.UFileKey bucketName := p.config.UFileBucket // query bucket domain, err := queryBucket(ufileconn, bucketName) if err != nil { return nil, false, false, fmt.Errorf("Failed to query bucket, %s", err) } var bucketHost string if p.config.BaseUrl != "" { // skip error because it has been validated by prepare urlObj, _ := url.Parse(p.config.BaseUrl) bucketHost = urlObj.Host } else { bucketHost = "api.ucloud.cn" } fileHost := strings.SplitN(domain, ".", 2)[1] config := &ufsdk.Config{ PublicKey: p.config.PublicKey, PrivateKey: p.config.PrivateKey, BucketName: bucketName, FileHost: fileHost, BucketHost: bucketHost, } ui.Say(fmt.Sprintf("Waiting for uploading image file %s to UFile: %s/%s...", source, bucketName, keyName)) // upload file to bucket ufileUrl, err := uploadFile(ufileconn, config, keyName, source) if err != nil { return nil, false, false, fmt.Errorf("Failed to Upload image file, %s", err) } ui.Say(fmt.Sprintf("Image file %s has been uploaded to UFile: %s/%s", source, bucketName, keyName)) importImageRequest := p.buildImportImageRequest(uhostconn, ufileUrl) importImageResponse, err := uhostconn.ImportCustomImage(importImageRequest) if err != nil { return nil, false, false, fmt.Errorf("Failed to import image from UFile: %s/%s, %s", bucketName, keyName, err) } ui.Say(fmt.Sprintf("Waiting for importing image from UFile: %s/%s ...", bucketName, keyName)) imageId := importImageResponse.ImageId err = retry.Config{ StartTimeout: time.Duration(p.config.WaitImageReadyTimeout) * time.Second, ShouldRetry: func(err error) bool { return ucloudcommon.IsExpectedStateError(err) }, RetryDelay: (&retry.Backoff{InitialBackoff: 2 * time.Second, MaxBackoff: 12 * time.Second, Multiplier: 2}).Linear, }.Run(ctx, func(ctx context.Context) error { image, err := client.DescribeImageById(imageId) if err != nil { return err } if image.State == ucloudcommon.ImageStateUnavailable { return fmt.Errorf("Unavailable importing image %q", imageId) } if image.State != ucloudcommon.ImageStateAvailable { return ucloudcommon.NewExpectedStateError("image", imageId) } return nil }) if err != nil { return nil, false, false, fmt.Errorf("Error on waiting for importing image %q from UFile: %s/%s, %s", imageId, bucketName, keyName, err) } // Add the reported UCloud image ID to the artifact list ui.Say(fmt.Sprintf("Importing created ucloud image %q in region %q Complete.", imageId, p.config.Region)) images := []ucloudcommon.ImageInfo{ { ImageId: imageId, ProjectId: p.config.ProjectId, Region: p.config.Region, }, } artifact = &ucloudcommon.Artifact{ UCloudImages: ucloudcommon.NewImageInfoSet(images), BuilderIdValue: BuilderId, Client: client, } if !p.config.SkipClean { ui.Message(fmt.Sprintf("Deleting import source UFile: %s/%s", p.config.UFileBucket, p.config.UFileKey)) if err = deleteFile(config, p.config.UFileKey); err != nil { return nil, false, false, fmt.Errorf("Failed to delete UFile: %s/%s, %s", p.config.UFileBucket, p.config.UFileKey, err) } } return artifact, false, false, nil } func (p *PostProcessor) buildImportImageRequest(conn *uhost.UHostClient, privateUrl string) *uhost.ImportCustomImageRequest { req := conn.NewImportCustomImageRequest() req.ImageName = ucloud.String(p.config.ImageName) req.ImageDescription = ucloud.String(p.config.ImageDescription) req.UFileUrl = ucloud.String(privateUrl) req.OsType = ucloud.String(p.config.OSType) req.OsName = ucloud.String(p.config.OSName) req.Format = ucloud.String(imageFormatMap.Convert(p.config.Format)) req.Auth = ucloud.Bool(true) return req } func queryBucket(conn *ufile.UFileClient, bucketName string) (string, error) { req := conn.NewDescribeBucketRequest() req.BucketName = ucloud.String(bucketName) resp, err := conn.DescribeBucket(req) if err != nil { return "", fmt.Errorf("error on reading bucket %q when create bucket, %s", bucketName, err) } if len(resp.DataSet) < 1 { return "", fmt.Errorf("the bucket %s is not exit", bucketName) } return resp.DataSet[0].Domain.Src[0], nil } func uploadFile(conn *ufile.UFileClient, config *ufsdk.Config, keyName, source string) (string, error) { reqFile, err := ufsdk.NewFileRequest(config, nil) if err != nil { return "", fmt.Errorf("error on building upload file request, %s", err) } // upload file in segments err = reqFile.AsyncMPut(source, keyName, "") if err != nil { return "", fmt.Errorf("error on upload file, %s, details: %s", err, reqFile.DumpResponse(true)) } reqBucket := conn.NewDescribeBucketRequest() reqBucket.BucketName = ucloud.String(config.BucketName) resp, err := conn.DescribeBucket(reqBucket) if err != nil { return "", fmt.Errorf("error on reading bucket list when upload file, %s", err) } if resp.DataSet[0].Type == "private" { return reqFile.GetPrivateURL(keyName, time.Duration(24*60*60)*time.Second), nil } return reqFile.GetPublicURL(keyName), nil } func deleteFile(config *ufsdk.Config, keyName string) error { req, err := ufsdk.NewFileRequest(config, nil) if err != nil { return fmt.Errorf("error on new deleting file, %s", err) } req.DeleteFile(keyName) if err != nil { return fmt.Errorf("error on deleting file, %s", err) } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/ucloud-import/post-processor.hcl2spec.go����������������������������0000664�0000000�0000000�00000014675�13771713062�0026340�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package ucloudimport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` PublicKey *string `mapstructure:"public_key" required:"true" cty:"public_key" hcl:"public_key"` PrivateKey *string `mapstructure:"private_key" required:"true" cty:"private_key" hcl:"private_key"` Region *string `mapstructure:"region" required:"true" cty:"region" hcl:"region"` ProjectId *string `mapstructure:"project_id" required:"true" cty:"project_id" hcl:"project_id"` BaseUrl *string `mapstructure:"base_url" required:"false" cty:"base_url" hcl:"base_url"` Profile *string `mapstructure:"profile" required:"false" cty:"profile" hcl:"profile"` SharedCredentialsFile *string `mapstructure:"shared_credentials_file" required:"false" cty:"shared_credentials_file" hcl:"shared_credentials_file"` UFileBucket *string `mapstructure:"ufile_bucket_name" required:"true" cty:"ufile_bucket_name" hcl:"ufile_bucket_name"` UFileKey *string `mapstructure:"ufile_key_name" required:"false" cty:"ufile_key_name" hcl:"ufile_key_name"` SkipClean *bool `mapstructure:"skip_clean" required:"false" cty:"skip_clean" hcl:"skip_clean"` ImageName *string `mapstructure:"image_name" required:"true" cty:"image_name" hcl:"image_name"` ImageDescription *string `mapstructure:"image_description" required:"false" cty:"image_description" hcl:"image_description"` OSType *string `mapstructure:"image_os_type" required:"true" cty:"image_os_type" hcl:"image_os_type"` OSName *string `mapstructure:"image_os_name" required:"true" cty:"image_os_name" hcl:"image_os_name"` Format *string `mapstructure:"format" required:"true" cty:"format" hcl:"format"` WaitImageReadyTimeout *int `mapstructure:"wait_image_ready_timeout" required:"false" cty:"wait_image_ready_timeout" hcl:"wait_image_ready_timeout"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "public_key": &hcldec.AttrSpec{Name: "public_key", Type: cty.String, Required: false}, "private_key": &hcldec.AttrSpec{Name: "private_key", Type: cty.String, Required: false}, "region": &hcldec.AttrSpec{Name: "region", Type: cty.String, Required: false}, "project_id": &hcldec.AttrSpec{Name: "project_id", Type: cty.String, Required: false}, "base_url": &hcldec.AttrSpec{Name: "base_url", Type: cty.String, Required: false}, "profile": &hcldec.AttrSpec{Name: "profile", Type: cty.String, Required: false}, "shared_credentials_file": &hcldec.AttrSpec{Name: "shared_credentials_file", Type: cty.String, Required: false}, "ufile_bucket_name": &hcldec.AttrSpec{Name: "ufile_bucket_name", Type: cty.String, Required: false}, "ufile_key_name": &hcldec.AttrSpec{Name: "ufile_key_name", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "image_name": &hcldec.AttrSpec{Name: "image_name", Type: cty.String, Required: false}, "image_description": &hcldec.AttrSpec{Name: "image_description", Type: cty.String, Required: false}, "image_os_type": &hcldec.AttrSpec{Name: "image_os_type", Type: cty.String, Required: false}, "image_os_name": &hcldec.AttrSpec{Name: "image_os_name", Type: cty.String, Required: false}, "format": &hcldec.AttrSpec{Name: "format", Type: cty.String, Required: false}, "wait_image_ready_timeout": &hcldec.AttrSpec{Name: "wait_image_ready_timeout", Type: cty.Number, Required: false}, } return s } �������������������������������������������������������������������packer-1.6.6+ds1/post-processor/ucloud-import/version/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022755�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/ucloud-import/version/version.go������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024766�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var UCloudImportPluginVersion *version.PluginVersion func init() { UCloudImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021233�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/artifact.go�������������������������������������������0000664�0000000�0000000�00000001200�13771713062�0023350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "fmt" ) const BuilderId = "pearkes.post-processor.vagrant-cloud" type Artifact struct { Tag string Provider string } func NewArtifact(provider, tag string) *Artifact { return &Artifact{ Tag: tag, Provider: provider, } } func (*Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Files() []string { return nil } func (a *Artifact) Id() string { return "" } func (a *Artifact) String() string { return fmt.Sprintf("'%s': %s", a.Provider, a.Tag) } func (*Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/artifact_test.go��������������������������������������0000664�0000000�0000000�00000000453�13771713062�0024420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestArtifact_ImplementsArtifact(t *testing.T) { var raw interface{} raw = &Artifact{} if _, ok := raw.(packersdk.Artifact); !ok { t.Fatalf("Artifact should be a Artifact") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/client.go���������������������������������������������0000664�0000000�0000000�00000013640�13771713062�0023044�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "bytes" "crypto/tls" "encoding/json" "fmt" "io" "log" "net/http" "os" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/net" ) type VagrantCloudClient struct { // The http client for communicating client *http.Client // The base URL of the API BaseURL string // Access token AccessToken string } type VagrantCloudErrors struct { Errors []interface{} `json:"errors"` } func (v VagrantCloudErrors) FormatErrors() string { errs := make([]string, 0) for _, err := range v.Errors { switch e := err.(type) { case string: errs = append(errs, e) case map[string]interface{}: for k, v := range e { errs = append(errs, fmt.Sprintf("%s %s", k, v)) } default: errs = append(errs, fmt.Sprintf("%s", err)) } } return strings.Join(errs, ". ") } func (v VagrantCloudClient) New(baseUrl string, token string, InsecureSkipTLSVerify bool) (*VagrantCloudClient, error) { c := &VagrantCloudClient{ client: net.HttpClientWithEnvironmentProxy(), BaseURL: baseUrl, AccessToken: token, } if InsecureSkipTLSVerify { transport := c.client.Transport.(*http.Transport) transport.TLSClientConfig = &tls.Config{ InsecureSkipVerify: true, } } return c, c.ValidateAuthentication() } func decodeBody(resp *http.Response, out interface{}) error { defer resp.Body.Close() dec := json.NewDecoder(resp.Body) return dec.Decode(out) } // encodeBody is used to encode a request body func encodeBody(obj interface{}) (io.Reader, error) { buf := bytes.NewBuffer(nil) enc := json.NewEncoder(buf) if err := enc.Encode(obj); err != nil { return nil, err } return buf, nil } func (v *VagrantCloudClient) ValidateAuthentication() error { resp, err := v.Get("authenticate") if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != 200 { return fmt.Errorf(resp.Status) } return nil } func (v *VagrantCloudClient) Get(path string) (*http.Response, error) { reqUrl := fmt.Sprintf("%s/%s", v.BaseURL, path) log.Printf("Post-Processor Vagrant Cloud API GET: %s", reqUrl) req, err := v.newRequest("GET", reqUrl, nil) if err != nil { return nil, err } resp, err := v.client.Do(req) log.Printf("Post-Processor Vagrant Cloud API Response: \n\n%+v", resp) return resp, err } func (v *VagrantCloudClient) Delete(path string) (*http.Response, error) { reqUrl := fmt.Sprintf("%s/%s", v.BaseURL, path) // Scrub API key for logs scrubbedUrl := strings.Replace(reqUrl, v.AccessToken, "ACCESS_TOKEN", -1) log.Printf("Post-Processor Vagrant Cloud API DELETE: %s", scrubbedUrl) req, err := v.newRequest("DELETE", reqUrl, nil) if err != nil { return nil, err } resp, err := v.client.Do(req) log.Printf("Post-Processor Vagrant Cloud API Response: \n\n%+v", resp) return resp, err } func (v *VagrantCloudClient) Upload(path string, url string) (*http.Response, error) { file, err := os.Open(path) if err != nil { return nil, fmt.Errorf("Error opening file for upload: %s", err) } fi, err := file.Stat() if err != nil { return nil, fmt.Errorf("Error stating file for upload: %s", err) } defer file.Close() request, err := v.newRequest("PUT", url, file) if err != nil { return nil, fmt.Errorf("Error preparing upload request: %s", err) } log.Printf("Post-Processor Vagrant Cloud API Upload: %s %s", path, url) request.ContentLength = fi.Size() resp, err := v.client.Do(request) log.Printf("Post-Processor Vagrant Cloud Upload Response: \n\n%+v", resp) return resp, err } func (v *VagrantCloudClient) DirectUpload(path string, url string) (*http.Response, error) { file, err := os.Open(path) if err != nil { return nil, fmt.Errorf("Error opening file for upload: %s", err) } defer file.Close() fi, err := file.Stat() if err != nil { return nil, fmt.Errorf("Error stating file for upload: %s", err) } request, err := http.NewRequest("PUT", url, file) if err != nil { return nil, fmt.Errorf("Error preparing upload request: %s", err) } log.Printf("Post-Processor Vagrant Cloud API Direct Upload: %s %s", path, url) request.ContentLength = fi.Size() resp, err := v.client.Do(request) log.Printf("Post-Processor Vagrant Cloud Direct Upload Response: \n\n%+v", resp) return resp, err } func (v *VagrantCloudClient) Callback(url string) (*http.Response, error) { request, err := v.newRequest("PUT", url, nil) if err != nil { return nil, fmt.Errorf("Error preparing callback request: %s", err) } log.Printf("Post-Processor Vagrant Cloud API Direct Upload Callback: %s", url) resp, err := v.client.Do(request) log.Printf("Post-Processor Vagrant Cloud Direct Upload Callback Response: \n\n%+v", resp) return resp, err } func (v *VagrantCloudClient) Post(path string, body interface{}) (*http.Response, error) { reqUrl := fmt.Sprintf("%s/%s", v.BaseURL, path) encBody, err := encodeBody(body) if err != nil { return nil, fmt.Errorf("Error encoding body for request: %s", err) } log.Printf("Post-Processor Vagrant Cloud API POST: %s. \n\n Body: %s", reqUrl, encBody) req, err := v.newRequest("POST", reqUrl, encBody) if err != nil { return nil, err } resp, err := v.client.Do(req) log.Printf("Post-Processor Vagrant Cloud API Response: \n\n%+v", resp) return resp, err } func (v *VagrantCloudClient) Put(path string) (*http.Response, error) { reqUrl := fmt.Sprintf("%s/%s", v.BaseURL, path) log.Printf("Post-Processor Vagrant Cloud API PUT: %s", reqUrl) req, err := v.newRequest("PUT", reqUrl, nil) if err != nil { return nil, err } resp, err := v.client.Do(req) log.Printf("Post-Processor Vagrant Cloud API Response: \n\n%+v", resp) return resp, err } func (v *VagrantCloudClient) newRequest(method, url string, body io.Reader) (*http.Request, error) { req, err := http.NewRequest(method, url, body) if err != nil { return nil, err } req.Header.Add("Content-Type", "application/json") if len(v.AccessToken) > 0 { req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", v.AccessToken)) } return req, err } ������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/client_test.go����������������������������������������0000664�0000000�0000000�00000001664�13771713062�0024106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "encoding/json" "strings" "testing" ) func TestVagranCloudErrors(t *testing.T) { testCases := []struct { resp string expected string }{ {`{"Status":"422 Unprocessable Entity", "StatusCode":422, "errors":[]}`, ""}, {`{"Status":"404 Artifact not found", "StatusCode":404, "errors":["error1", "error2"]}`, "error1. error2"}, {`{"StatusCode":403, "errors":[{"message":"Bad credentials"}]}`, "message Bad credentials"}, {`{"StatusCode":500, "errors":[["error in unexpected format"]]}`, "[error in unexpected format]"}, } for _, tc := range testCases { var cloudErrors VagrantCloudErrors err := json.NewDecoder(strings.NewReader(tc.resp)).Decode(&cloudErrors) if err != nil { t.Errorf("failed to decode error response: %s", err) } if got := cloudErrors.FormatErrors(); got != tc.expected { t.Errorf("failed to get expected response; expected %q, got %q", tc.expected, got) } } } ����������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/post-processor.go�������������������������������������0000664�0000000�0000000�00000022130�13771713062�0024562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // vagrant_cloud implements the packersdk.PostProcessor interface and adds a // post-processor that uploads artifacts from the vagrant post-processor // and vagrant builder to Vagrant Cloud (vagrantcloud.com) or manages // self hosted boxes on the Vagrant Cloud package vagrantcloud import ( "archive/tar" "compress/gzip" "context" "encoding/json" "fmt" "io" "io/ioutil" "log" "os" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) var builtins = map[string]string{ "mitchellh.post-processor.vagrant": "vagrant", "packer.post-processor.artifice": "artifice", "vagrant": "vagrant", } const VAGRANT_CLOUD_URL = "https://vagrantcloud.com/api/v1" type Config struct { common.PackerConfig `mapstructure:",squash"` Tag string `mapstructure:"box_tag"` Version string `mapstructure:"version"` VersionDescription string `mapstructure:"version_description"` NoRelease bool `mapstructure:"no_release"` AccessToken string `mapstructure:"access_token"` VagrantCloudUrl string `mapstructure:"vagrant_cloud_url"` InsecureSkipTLSVerify bool `mapstructure:"insecure_skip_tls_verify"` BoxDownloadUrl string `mapstructure:"box_download_url"` NoDirectUpload bool `mapstructure:"no_direct_upload"` ctx interpolate.Context } type PostProcessor struct { config Config client *VagrantCloudClient runner multistep.Runner warnAtlasToken bool insecureSkipTLSVerify bool } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "box_download_url", }, }, }, raws...) if err != nil { return err } // Default configuration if p.config.VagrantCloudUrl == "" { p.config.VagrantCloudUrl = VAGRANT_CLOUD_URL } p.insecureSkipTLSVerify = p.config.InsecureSkipTLSVerify == true && p.config.VagrantCloudUrl != VAGRANT_CLOUD_URL if p.config.AccessToken == "" { envToken := os.Getenv("VAGRANT_CLOUD_TOKEN") if envToken == "" { envToken = os.Getenv("ATLAS_TOKEN") if envToken != "" { p.warnAtlasToken = true } } p.config.AccessToken = envToken } // Accumulate any errors errs := new(packersdk.MultiError) // Required configuration templates := map[string]*string{ "box_tag": &p.config.Tag, "version": &p.config.Version, } for key, ptr := range templates { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } if p.config.VagrantCloudUrl == VAGRANT_CLOUD_URL && p.config.AccessToken == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("access_token must be set if vagrant_cloud_url has not been overriden")) } // Create the HTTP client p.client, err = VagrantCloudClient{}.New(p.config.VagrantCloudUrl, p.config.AccessToken, p.insecureSkipTLSVerify) if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Failed to verify authentication token: %v", err)) } if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { if _, ok := builtins[artifact.BuilderId()]; !ok { return nil, false, false, fmt.Errorf( "Unknown artifact type: this post-processor requires an input artifact from the artifice post-processor, vagrant post-processor, or vagrant builder: %s", artifact.BuilderId()) } // We assume that there is only one .box file to upload if !strings.HasSuffix(artifact.Files()[0], ".box") { return nil, false, false, fmt.Errorf( "Unknown files in artifact, Vagrant box with .box suffix is required as first artifact file: %s", artifact.Files()) } if p.warnAtlasToken { ui.Message("Warning: Using Vagrant Cloud token found in ATLAS_TOKEN. Please make sure it is correct, or set VAGRANT_CLOUD_TOKEN") } // Determine the name of the provider for Vagrant Cloud, and Vagrant providerName, err := getProvider(artifact.Id(), artifact.Files()[0], builtins[artifact.BuilderId()]) if err != nil { return nil, false, false, fmt.Errorf("error getting provider name: %s", err) } var generatedData map[interface{}]interface{} stateData := artifact.State("generated_data") if stateData != nil { // Make sure it's not a nil map so we can assign to it later. generatedData = stateData.(map[interface{}]interface{}) } // If stateData has a nil map generatedData will be nil // and we need to make sure it's not if generatedData == nil { generatedData = make(map[interface{}]interface{}) } generatedData["ArtifactId"] = artifact.Id() generatedData["Provider"] = providerName p.config.ctx.Data = generatedData boxDownloadUrl, err := interpolate.Render(p.config.BoxDownloadUrl, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error processing box_download_url: %s", err) } // Set up the state state := new(multistep.BasicStateBag) state.Put("config", &p.config) state.Put("client", p.client) state.Put("artifact", artifact) state.Put("artifactFilePath", artifact.Files()[0]) state.Put("ui", ui) state.Put("providerName", providerName) state.Put("boxDownloadUrl", boxDownloadUrl) // Build the steps steps := []multistep.Step{ new(stepVerifyBox), new(stepCreateVersion), new(stepCreateProvider), } if p.config.BoxDownloadUrl == "" { steps = append(steps, new(stepPrepareUpload), new(stepUpload)) if !p.config.NoDirectUpload { steps = append(steps, new(stepConfirmUpload)) } } steps = append(steps, new(stepReleaseVersion)) // Run the steps p.runner = commonsteps.NewRunner(steps, p.config.PackerConfig, ui) p.runner.Run(ctx, state) // If there was an error, return that if rawErr, ok := state.GetOk("error"); ok { return nil, false, false, rawErr.(error) } return NewArtifact(providerName, p.config.Tag), true, false, nil } func getProvider(builderName, boxfile, builderId string) (providerName string, err error) { if builderId == "artifice" { // The artifice post processor cannot embed any data in the // supplied artifact so the provider information must be extracted // from the box file directly providerName, err = providerFromVagrantBox(boxfile) } else { // For the Vagrant builder and Vagrant post processor the provider can // be determined from information embedded in the artifact providerName = providerFromBuilderName(builderName) } return providerName, err } // Converts a packer builder name to the corresponding vagrant provider func providerFromBuilderName(name string) string { switch name { case "aws": return "aws" case "scaleway": return "scaleway" case "digitalocean": return "digitalocean" case "virtualbox": return "virtualbox" case "vmware": return "vmware_desktop" case "parallels": return "parallels" default: return name } } // Returns the Vagrant provider the box is intended for use with by // reading the metadata file packaged inside the box func providerFromVagrantBox(boxfile string) (providerName string, err error) { log.Println("Attempting to determine provider from metadata in box file. This may take some time...") f, err := os.Open(boxfile) if err != nil { return "", fmt.Errorf("Error attempting to open box file: %s", err) } defer f.Close() // Vagrant boxes are gzipped tar archives ar, err := gzip.NewReader(f) if err != nil { return "", fmt.Errorf("Error unzipping box archive: %s", err) } tr := tar.NewReader(ar) // The metadata.json file in the tar archive contains a 'provider' key type metadata struct { ProviderName string `json:"provider"` } md := metadata{} // Loop through the files in the archive and read the provider // information from the boxes metadata.json file for { hdr, err := tr.Next() if err == io.EOF { if md.ProviderName == "" { return "", fmt.Errorf("Error: Provider info was not found in box: %s", boxfile) } break } if err != nil { return "", fmt.Errorf("Error reading header info from box tar archive: %s", err) } if hdr.Name == "metadata.json" { contents, err := ioutil.ReadAll(tr) if err != nil { return "", fmt.Errorf("Error reading contents of metadata.json file from box file: %s", err) } err = json.Unmarshal(contents, &md) if err != nil { return "", fmt.Errorf("Error parsing metadata.json file: %s", err) } if md.ProviderName == "" { return "", fmt.Errorf("Error: Could not determine Vagrant provider from box metadata.json file") } break } } return md.ProviderName, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/post-processor.hcl2spec.go����������������������������0000664�0000000�0000000�00000011376�13771713062�0026276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package vagrantcloud import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Tag *string `mapstructure:"box_tag" cty:"box_tag" hcl:"box_tag"` Version *string `mapstructure:"version" cty:"version" hcl:"version"` VersionDescription *string `mapstructure:"version_description" cty:"version_description" hcl:"version_description"` NoRelease *bool `mapstructure:"no_release" cty:"no_release" hcl:"no_release"` AccessToken *string `mapstructure:"access_token" cty:"access_token" hcl:"access_token"` VagrantCloudUrl *string `mapstructure:"vagrant_cloud_url" cty:"vagrant_cloud_url" hcl:"vagrant_cloud_url"` InsecureSkipTLSVerify *bool `mapstructure:"insecure_skip_tls_verify" cty:"insecure_skip_tls_verify" hcl:"insecure_skip_tls_verify"` BoxDownloadUrl *string `mapstructure:"box_download_url" cty:"box_download_url" hcl:"box_download_url"` NoDirectUpload *bool `mapstructure:"no_direct_upload" cty:"no_direct_upload" hcl:"no_direct_upload"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "box_tag": &hcldec.AttrSpec{Name: "box_tag", Type: cty.String, Required: false}, "version": &hcldec.AttrSpec{Name: "version", Type: cty.String, Required: false}, "version_description": &hcldec.AttrSpec{Name: "version_description", Type: cty.String, Required: false}, "no_release": &hcldec.AttrSpec{Name: "no_release", Type: cty.Bool, Required: false}, "access_token": &hcldec.AttrSpec{Name: "access_token", Type: cty.String, Required: false}, "vagrant_cloud_url": &hcldec.AttrSpec{Name: "vagrant_cloud_url", Type: cty.String, Required: false}, "insecure_skip_tls_verify": &hcldec.AttrSpec{Name: "insecure_skip_tls_verify", Type: cty.Bool, Required: false}, "box_download_url": &hcldec.AttrSpec{Name: "box_download_url", Type: cty.String, Required: false}, "no_direct_upload": &hcldec.AttrSpec{Name: "no_direct_upload", Type: cty.Bool, Required: false}, } return s } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/post-processor_test.go��������������������������������0000664�0000000�0000000�00000050757�13771713062�0025641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "archive/tar" "bytes" "compress/gzip" "context" "fmt" "io/ioutil" "net/http" "net/http/httptest" "os" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/stretchr/testify/assert" ) type stubResponse struct { Path string Method string Response string StatusCode int } type tarFiles []struct { Name, Body string } func testGoodConfig() map[string]interface{} { return map[string]interface{}{ "access_token": "foo", "version_description": "bar", "box_tag": "hashicorp/precise64", "version": "0.5", } } func testBadConfig() map[string]interface{} { return map[string]interface{}{ "access_token": "foo", "box_tag": "baz", "version_description": "bar", } } func testNoAccessTokenProvidedConfig() map[string]interface{} { return map[string]interface{}{ "box_tag": "baz", "version_description": "bar", "version": "0.5", } } func newStackServer(stack []stubResponse) *httptest.Server { return httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { if len(stack) < 1 { rw.Header().Add("Error", fmt.Sprintf("Request stack is empty - Method: %s Path: %s", req.Method, req.URL.Path)) http.Error(rw, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } match := stack[0] stack = stack[1:] if match.Method != "" && req.Method != match.Method { rw.Header().Add("Error", fmt.Sprintf("Request %s != %s", match.Method, req.Method)) http.Error(rw, fmt.Sprintf("Request %s != %s", match.Method, req.Method), http.StatusInternalServerError) return } if match.Path != "" && match.Path != req.URL.Path { rw.Header().Add("Error", fmt.Sprintf("Request %s != %s", match.Path, req.URL.Path)) http.Error(rw, fmt.Sprintf("Request %s != %s", match.Path, req.URL.Path), http.StatusInternalServerError) return } rw.Header().Add("Complete", fmt.Sprintf("Method: %s Path: %s", match.Method, match.Path)) rw.WriteHeader(match.StatusCode) if match.Response != "" { _, err := rw.Write([]byte(match.Response)) if err != nil { panic("failed to write response: " + err.Error()) } } })) } func newSecureServer(token string, handler http.HandlerFunc) *httptest.Server { token = fmt.Sprintf("Bearer %s", token) return httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { if req.Header.Get("authorization") != token { http.Error(rw, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized) return } if handler != nil { handler(rw, req) } })) } func newSelfSignedSslServer(token string, handler http.HandlerFunc) *httptest.Server { token = fmt.Sprintf("Bearer %s", token) return httptest.NewTLSServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { if req.Header.Get("authorization") != token { http.Error(rw, http.StatusText(http.StatusUnauthorized), http.StatusUnauthorized) return } if handler != nil { handler(rw, req) } })) } func newNoAuthServer(handler http.HandlerFunc) *httptest.Server { return httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { if req.Header.Get("authorization") != "" { http.Error(rw, "Authorization header was provider", http.StatusBadRequest) return } if handler != nil { handler(rw, req) } })) } func TestPostProcessor_Insecure_Ssl(t *testing.T) { var p PostProcessor server := newSelfSignedSslServer("foo", nil) defer server.Close() config := testGoodConfig() config["vagrant_cloud_url"] = server.URL config["insecure_skip_tls_verify"] = true if err := p.Configure(config); err != nil { t.Fatalf("Expected TLS to skip certificate validation: %s", err) } } func TestPostProcessor_Configure_fromVagrantEnv(t *testing.T) { var p PostProcessor config := testGoodConfig() server := newSecureServer("bar", nil) defer server.Close() config["vagrant_cloud_url"] = server.URL config["access_token"] = "" os.Setenv("VAGRANT_CLOUD_TOKEN", "bar") defer func() { os.Setenv("VAGRANT_CLOUD_TOKEN", "") }() if err := p.Configure(config); err != nil { t.Fatalf("err: %s", err) } if p.config.AccessToken != "bar" { t.Fatalf("Expected to get token from VAGRANT_CLOUD_TOKEN env var. Got '%s' instead", p.config.AccessToken) } } func TestPostProcessor_Configure_fromAtlasEnv(t *testing.T) { var p PostProcessor config := testGoodConfig() config["access_token"] = "" server := newSecureServer("foo", nil) defer server.Close() config["vagrant_cloud_url"] = server.URL os.Setenv("ATLAS_TOKEN", "foo") defer func() { os.Setenv("ATLAS_TOKEN", "") }() if err := p.Configure(config); err != nil { t.Fatalf("err: %s", err) } if p.config.AccessToken != "foo" { t.Fatalf("Expected to get token from ATLAS_TOKEN env var. Got '%s' instead", p.config.AccessToken) } if !p.warnAtlasToken { t.Fatal("Expected warn flag to be set when getting token from atlas env var.") } } func TestPostProcessor_Configure_Good(t *testing.T) { config := testGoodConfig() server := newSecureServer("foo", nil) defer server.Close() config["vagrant_cloud_url"] = server.URL var p PostProcessor if err := p.Configure(config); err != nil { t.Fatalf("err: %s", err) } } func TestPostProcessor_Configure_Bad(t *testing.T) { config := testBadConfig() server := newSecureServer("foo", nil) defer server.Close() config["vagrant_cloud_url"] = server.URL var p PostProcessor if err := p.Configure(config); err == nil { t.Fatalf("should have err") } } func TestPostProcessor_Configure_checkAccessTokenIsRequiredByDefault(t *testing.T) { var p PostProcessor server := newSecureServer("foo", nil) defer server.Close() config := testNoAccessTokenProvidedConfig() config["vagrant_cloud_url"] = server.URL if err := p.Configure(config); err == nil { t.Fatalf("Expected access token to be required.") } } func TestPostProcessor_Configure_checkAccessTokenIsNotRequiredForOverridenVagrantCloud(t *testing.T) { var p PostProcessor server := newNoAuthServer(nil) defer server.Close() config := testNoAccessTokenProvidedConfig() config["vagrant_cloud_url"] = server.URL if err := p.Configure(config); err != nil { t.Fatalf("Expected blank access token to be allowed and authenticate to pass: %s", err) } } func TestPostProcessor_PostProcess_checkArtifactType(t *testing.T) { artifact := &packersdk.MockArtifact{ BuilderIdValue: "invalid.builder", } config := testGoodConfig() server := newSecureServer("foo", nil) defer server.Close() config["vagrant_cloud_url"] = server.URL var p PostProcessor p.Configure(config) _, _, _, err := p.PostProcess(context.Background(), testUi(), artifact) if !strings.Contains(err.Error(), "Unknown artifact type") { t.Fatalf("Should error with message 'Unknown artifact type...' with BuilderId: %s", artifact.BuilderIdValue) } } func TestPostProcessor_PostProcess_checkArtifactFileIsBox(t *testing.T) { artifact := &packersdk.MockArtifact{ BuilderIdValue: "mitchellh.post-processor.vagrant", // good FilesValue: []string{"invalid.boxfile"}, // should have .box extension } config := testGoodConfig() server := newSecureServer("foo", nil) defer server.Close() config["vagrant_cloud_url"] = server.URL var p PostProcessor p.Configure(config) _, _, _, err := p.PostProcess(context.Background(), testUi(), artifact) if !strings.Contains(err.Error(), "Unknown files in artifact") { t.Fatalf("Should error with message 'Unknown files in artifact...' with artifact file: %s", artifact.FilesValue[0]) } } func TestPostProcessor_PostProcess_uploadsAndReleases(t *testing.T) { files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", `{"provider": "virtualbox"}`}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("%s", err) } defer os.Remove(boxfile.Name()) artifact := &packersdk.MockArtifact{ BuilderIdValue: "mitchellh.post-processor.vagrant", FilesValue: []string{boxfile.Name()}, } s := newStackServer([]stubResponse{stubResponse{StatusCode: 200, Method: "PUT", Path: "/box-upload-path"}}) defer s.Close() stack := []stubResponse{ stubResponse{StatusCode: 200, Method: "GET", Path: "/authenticate"}, stubResponse{StatusCode: 200, Method: "GET", Path: "/box/hashicorp/precise64", Response: `{"tag": "hashicorp/precise64"}`}, stubResponse{StatusCode: 200, Method: "POST", Path: "/box/hashicorp/precise64/versions", Response: `{}`}, stubResponse{StatusCode: 200, Method: "POST", Path: "/box/hashicorp/precise64/version/0.5/providers", Response: `{}`}, stubResponse{StatusCode: 200, Method: "GET", Path: "/box/hashicorp/precise64/version/0.5/provider/id/upload", Response: `{"upload_path": "` + s.URL + `/box-upload-path"}`}, stubResponse{StatusCode: 200, Method: "PUT", Path: "/box/hashicorp/precise64/version/0.5/release"}, } server := newStackServer(stack) defer server.Close() config := testGoodConfig() config["vagrant_cloud_url"] = server.URL config["no_direct_upload"] = true var p PostProcessor err = p.Configure(config) if err != nil { t.Fatalf("err: %s", err) } _, _, _, err = p.PostProcess(context.Background(), testUi(), artifact) if err != nil { t.Fatalf("err: %s", err) } } func TestPostProcessor_PostProcess_uploadsAndNoRelease(t *testing.T) { files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", `{"provider": "virtualbox"}`}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("%s", err) } defer os.Remove(boxfile.Name()) artifact := &packersdk.MockArtifact{ BuilderIdValue: "mitchellh.post-processor.vagrant", FilesValue: []string{boxfile.Name()}, } s := newStackServer([]stubResponse{stubResponse{StatusCode: 200, Method: "PUT", Path: "/box-upload-path"}}) defer s.Close() stack := []stubResponse{ stubResponse{StatusCode: 200, Method: "GET", Path: "/authenticate"}, stubResponse{StatusCode: 200, Method: "GET", Path: "/box/hashicorp/precise64", Response: `{"tag": "hashicorp/precise64"}`}, stubResponse{StatusCode: 200, Method: "POST", Path: "/box/hashicorp/precise64/versions", Response: `{}`}, stubResponse{StatusCode: 200, Method: "POST", Path: "/box/hashicorp/precise64/version/0.5/providers", Response: `{}`}, stubResponse{StatusCode: 200, Method: "GET", Path: "/box/hashicorp/precise64/version/0.5/provider/id/upload", Response: `{"upload_path": "` + s.URL + `/box-upload-path"}`}, } server := newStackServer(stack) defer server.Close() config := testGoodConfig() config["vagrant_cloud_url"] = server.URL config["no_direct_upload"] = true config["no_release"] = true var p PostProcessor err = p.Configure(config) if err != nil { t.Fatalf("err: %s", err) } _, _, _, err = p.PostProcess(context.Background(), testUi(), artifact) if err != nil { t.Fatalf("err: %s", err) } } func TestPostProcessor_PostProcess_uploadsDirectAndReleases(t *testing.T) { files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", `{"provider": "virtualbox"}`}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("%s", err) } defer os.Remove(boxfile.Name()) artifact := &packersdk.MockArtifact{ BuilderIdValue: "mitchellh.post-processor.vagrant", FilesValue: []string{boxfile.Name()}, } s := newStackServer( []stubResponse{ stubResponse{StatusCode: 200, Method: "PUT", Path: "/box-upload-path"}, }, ) defer s.Close() stack := []stubResponse{ stubResponse{StatusCode: 200, Method: "GET", Path: "/authenticate"}, stubResponse{StatusCode: 200, Method: "GET", Path: "/box/hashicorp/precise64", Response: `{"tag": "hashicorp/precise64"}`}, stubResponse{StatusCode: 200, Method: "POST", Path: "/box/hashicorp/precise64/versions", Response: `{}`}, stubResponse{StatusCode: 200, Method: "POST", Path: "/box/hashicorp/precise64/version/0.5/providers", Response: `{}`}, stubResponse{StatusCode: 200, Method: "GET", Path: "/box/hashicorp/precise64/version/0.5/provider/id/upload/direct"}, stubResponse{StatusCode: 200, Method: "PUT", Path: "/box-upload-complete"}, stubResponse{StatusCode: 200, Method: "PUT", Path: "/box/hashicorp/precise64/version/0.5/release"}, } server := newStackServer(stack) defer server.Close() config := testGoodConfig() config["vagrant_cloud_url"] = server.URL // Set response here so we have API server URL available stack[4].Response = `{"upload_path": "` + s.URL + `/box-upload-path", "callback": "` + server.URL + `/box-upload-complete"}` var p PostProcessor err = p.Configure(config) if err != nil { t.Fatalf("err: %s", err) } _, _, _, err = p.PostProcess(context.Background(), testUi(), artifact) if err != nil { t.Fatalf("err: %s", err) } } func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } } func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } func TestProviderFromBuilderName(t *testing.T) { if providerFromBuilderName("foobar") != "foobar" { t.Fatal("should copy unknown provider") } if providerFromBuilderName("vmware") != "vmware_desktop" { t.Fatal("should convert provider") } } func TestProviderFromVagrantBox_missing_box(t *testing.T) { // Bad: Box does not exist boxfile := "i_dont_exist.box" _, err := providerFromVagrantBox(boxfile) if err == nil { t.Fatal("Should have error as box file does not exist") } t.Logf("%s", err) } func TestProviderFromVagrantBox_empty_box(t *testing.T) { // Bad: Empty box file boxfile, err := newBoxFile() if err != nil { t.Fatalf("%s", err) } defer os.Remove(boxfile.Name()) _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatal("Should have error as box file is empty") } t.Logf("%s", err) } func TestProviderFromVagrantBox_gzip_only_box(t *testing.T) { boxfile, err := newBoxFile() if err != nil { t.Fatalf("%s", err) } defer os.Remove(boxfile.Name()) // Bad: Box is just a plain gzip file aw := gzip.NewWriter(boxfile) _, err = aw.Write([]byte("foo content")) if err != nil { t.Fatal("Error zipping test box file") } aw.Close() // Flush the gzipped contents to file _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatalf("Should have error as box file is a plain gzip file: %s", err) } t.Logf("%s", err) } func TestProviderFromVagrantBox_no_files_in_archive(t *testing.T) { // Bad: Box contains no files boxfile, err := createBox(tarFiles{}) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatalf("Should have error as box file has no contents") } t.Logf("%s", err) } func TestProviderFromVagrantBox_no_metadata(t *testing.T) { // Bad: Box contains no metadata/metadata.json file files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatalf("Should have error as box file does not include metadata.json file") } t.Logf("%s", err) } func TestProviderFromVagrantBox_metadata_empty(t *testing.T) { // Bad: Create a box with an empty metadata.json file files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", ""}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatalf("Should have error as box files metadata.json file is empty") } t.Logf("%s", err) } func TestProviderFromVagrantBox_metadata_bad_json(t *testing.T) { // Bad: Create a box with bad JSON in the metadata.json file files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", "{provider: badjson}"}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatalf("Should have error as box files metadata.json file contains badly formatted JSON") } t.Logf("%s", err) } func TestProviderFromVagrantBox_metadata_no_provider_key(t *testing.T) { // Bad: Create a box with no 'provider' key in the metadata.json file files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", `{"cows":"moo"}`}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatalf("Should have error as provider key/value pair is missing from boxes metadata.json file") } t.Logf("%s", err) } func TestProviderFromVagrantBox_metadata_provider_value_empty(t *testing.T) { // Bad: The boxes metadata.json file 'provider' key has an empty value files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", `{"provider":""}`}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) _, err = providerFromVagrantBox(boxfile.Name()) if err == nil { t.Fatalf("Should have error as value associated with 'provider' key in boxes metadata.json file is empty") } t.Logf("%s", err) } func TestProviderFromVagrantBox_metadata_ok(t *testing.T) { // Good: The boxes metadata.json file has the 'provider' key/value pair expectedProvider := "virtualbox" files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", `{"provider":"` + expectedProvider + `"}`}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) provider, err := providerFromVagrantBox(boxfile.Name()) if err != nil { t.Fatalf("error getting provider from vagrant box %s:%v", boxfile.Name(), err) } assert.Equal(t, expectedProvider, provider, "Error: Expected provider: '%s'. Got '%s'", expectedProvider, provider) t.Logf("Expected provider '%s'. Got provider '%s'", expectedProvider, provider) } func TestGetProvider_artifice(t *testing.T) { expectedProvider := "virtualbox" files := tarFiles{ {"foo.txt", "This is a foo file"}, {"bar.txt", "This is a bar file"}, {"metadata.json", `{"provider":"` + expectedProvider + `"}`}, } boxfile, err := createBox(files) if err != nil { t.Fatalf("Error creating test box: %s", err) } defer os.Remove(boxfile.Name()) provider, err := getProvider("", boxfile.Name(), "artifice") if err != nil { t.Fatalf("error getting provider %s:%v", boxfile.Name(), err) } assert.Equal(t, expectedProvider, provider, "Error: Expected provider: '%s'. Got '%s'", expectedProvider, provider) t.Logf("Expected provider '%s'. Got provider '%s'", expectedProvider, provider) } func TestGetProvider_other(t *testing.T) { expectedProvider := "virtualbox" provider, _ := getProvider(expectedProvider, "foo.box", "other") assert.Equal(t, expectedProvider, provider, "Error: Expected provider: '%s'. Got '%s'", expectedProvider, provider) t.Logf("Expected provider '%s'. Got provider '%s'", expectedProvider, provider) } func newBoxFile() (boxfile *os.File, err error) { boxfile, err = ioutil.TempFile(os.TempDir(), "test*.box") if err != nil { return boxfile, fmt.Errorf("Error creating test box file: %s", err) } return boxfile, nil } func createBox(files tarFiles) (boxfile *os.File, err error) { boxfile, err = newBoxFile() if err != nil { return boxfile, err } // Box files are gzipped tar archives aw := gzip.NewWriter(boxfile) tw := tar.NewWriter(aw) // Add each file to the box for _, file := range files { // Create and write the tar file header hdr := &tar.Header{ Name: file.Name, Mode: 0644, Size: int64(len(file.Body)), } err = tw.WriteHeader(hdr) if err != nil { return boxfile, fmt.Errorf("Error writing box tar file header: %s", err) } // Write the file contents _, err = tw.Write([]byte(file.Body)) if err != nil { return boxfile, fmt.Errorf("Error writing box tar file contents: %s", err) } } // Flush and close each writer err = tw.Close() if err != nil { return boxfile, fmt.Errorf("Error flushing tar file contents: %s", err) } err = aw.Close() if err != nil { return boxfile, fmt.Errorf("Error flushing gzip file contents: %s", err) } return boxfile, nil } �����������������packer-1.6.6+ds1/post-processor/vagrant-cloud/step_confirm_upload.go��������������������������������0000664�0000000�0000000�00000002145�13771713062�0025620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type stepConfirmUpload struct { } func (s *stepConfirmUpload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packersdk.Ui) upload := state.Get("upload").(*Upload) url := upload.CallbackPath ui.Say("Confirming direct box upload completion") resp, err := client.Callback(url) if err != nil || resp.StatusCode != 200 { if resp == nil || resp.Body == nil { state.Put("error", "No response from server.") } else { cloudErrors := &VagrantCloudErrors{} err = decodeBody(resp, cloudErrors) if err != nil { ui.Error(fmt.Sprintf("error decoding error response: %s", err)) } state.Put("error", fmt.Errorf("Error preparing upload: %s", cloudErrors.FormatErrors())) } return multistep.ActionHalt } return multistep.ActionContinue } func (s *stepConfirmUpload) Cleanup(state multistep.StateBag) { // No cleanup } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/step_create_provider.go�������������������������������0000664�0000000�0000000�00000005436�13771713062�0026002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type Provider struct { Name string `json:"name"` Url string `json:"url,omitempty"` HostedToken string `json:"hosted_token,omitempty"` UploadUrl string `json:"upload_url,omitempty"` } type stepCreateProvider struct { name string // the name of the provider } func (s *stepCreateProvider) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packersdk.Ui) box := state.Get("box").(*Box) version := state.Get("version").(*Version) providerName := state.Get("providerName").(string) downloadUrl := state.Get("boxDownloadUrl").(string) path := fmt.Sprintf("box/%s/version/%v/providers", box.Tag, version.Version) provider := &Provider{Name: providerName} if downloadUrl != "" { provider.Url = downloadUrl } // Wrap the provider in a provider object for the API wrapper := make(map[string]interface{}) wrapper["provider"] = provider ui.Say(fmt.Sprintf("Creating provider: %s", providerName)) resp, err := client.Post(path, wrapper) if err != nil || (resp.StatusCode != 200) { cloudErrors := &VagrantCloudErrors{} err = decodeBody(resp, cloudErrors) if err != nil { ui.Error(fmt.Sprintf("error decoding error response: %s", err)) } state.Put("error", fmt.Errorf("Error creating provider: %s", cloudErrors.FormatErrors())) return multistep.ActionHalt } if err = decodeBody(resp, provider); err != nil { state.Put("error", fmt.Errorf("Error parsing provider response: %s", err)) return multistep.ActionHalt } // Save the name for cleanup s.name = provider.Name state.Put("provider", provider) return multistep.ActionContinue } func (s *stepCreateProvider) Cleanup(state multistep.StateBag) { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packersdk.Ui) box := state.Get("box").(*Box) version := state.Get("version").(*Version) // If we didn't save the provider name, it likely doesn't exist if s.name == "" { ui.Say("Cleaning up provider") ui.Message("Provider was not created, not deleting") return } _, cancelled := state.GetOk(multistep.StateCancelled) _, halted := state.GetOk(multistep.StateHalted) // Return if we didn't cancel or halt, and thus need // no cleanup if !cancelled && !halted { return } ui.Say("Cleaning up provider") ui.Message(fmt.Sprintf("Deleting provider: %s", s.name)) path := fmt.Sprintf("box/%s/version/%v/provider/%s", box.Tag, version.Version, s.name) // No need for resp from the cleanup DELETE _, err := client.Delete(path) if err != nil { ui.Error(fmt.Sprintf("Error destroying provider: %s", err)) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/step_create_version.go��������������������������������0000664�0000000�0000000�00000003365�13771713062�0025634�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type Version struct { Version string `json:"version"` Description string `json:"description,omitempty"` } type stepCreateVersion struct { } func (s *stepCreateVersion) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packersdk.Ui) config := state.Get("config").(*Config) box := state.Get("box").(*Box) ui.Say(fmt.Sprintf("Creating version: %s", config.Version)) if hasVersion, v := box.HasVersion(config.Version); hasVersion { ui.Message(fmt.Sprintf("Version exists, skipping creation")) state.Put("version", v) return multistep.ActionContinue } path := fmt.Sprintf("box/%s/versions", box.Tag) version := &Version{Version: config.Version, Description: config.VersionDescription} // Wrap the version in a version object for the API wrapper := make(map[string]interface{}) wrapper["version"] = version resp, err := client.Post(path, wrapper) if err != nil || (resp.StatusCode != 200) { cloudErrors := &VagrantCloudErrors{} err = decodeBody(resp, cloudErrors) if err != nil { ui.Error(fmt.Sprintf("error decoding error response: %s", err)) } state.Put("error", fmt.Errorf("Error creating version: %s", cloudErrors.FormatErrors())) return multistep.ActionHalt } if err = decodeBody(resp, version); err != nil { state.Put("error", fmt.Errorf("Error parsing version response: %s", err)) return multistep.ActionHalt } state.Put("version", version) return multistep.ActionContinue } func (s *stepCreateVersion) Cleanup(state multistep.StateBag) {} ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/step_prepare_upload.go��������������������������������0000664�0000000�0000000�00000003425�13771713062�0025623�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type Upload struct { UploadPath string `json:"upload_path"` CallbackPath string `json:"callback"` } type stepPrepareUpload struct { } func (s *stepPrepareUpload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packersdk.Ui) box := state.Get("box").(*Box) version := state.Get("version").(*Version) provider := state.Get("provider").(*Provider) artifactFilePath := state.Get("artifactFilePath").(string) path := fmt.Sprintf("box/%s/version/%v/provider/%s/upload", box.Tag, version.Version, provider.Name) if !config.NoDirectUpload { path = path + "/direct" } upload := &Upload{} ui.Say(fmt.Sprintf("Preparing upload of box: %s", artifactFilePath)) resp, err := client.Get(path) if err != nil || (resp.StatusCode != 200) { if resp == nil || resp.Body == nil { state.Put("error", "No response from server.") } else { cloudErrors := &VagrantCloudErrors{} err = decodeBody(resp, cloudErrors) if err != nil { ui.Error(fmt.Sprintf("error decoding error response: %s", err)) } state.Put("error", fmt.Errorf("Error preparing upload: %s", cloudErrors.FormatErrors())) } return multistep.ActionHalt } if err = decodeBody(resp, upload); err != nil { state.Put("error", fmt.Errorf("Error parsing upload response: %s", err)) return multistep.ActionHalt } // Save the upload details to the state state.Put("upload", upload) return multistep.ActionContinue } func (s *stepPrepareUpload) Cleanup(state multistep.StateBag) { // No cleanup } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/step_release_version.go�������������������������������0000664�0000000�0000000�00000003045�13771713062�0026004�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "context" "fmt" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type stepReleaseVersion struct { } func (s *stepReleaseVersion) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packersdk.Ui) box := state.Get("box").(*Box) version := state.Get("version").(*Version) config := state.Get("config").(*Config) ui.Say(fmt.Sprintf("Releasing version: %s", version.Version)) if config.NoRelease { ui.Message("Not releasing version due to configuration") return multistep.ActionContinue } path := fmt.Sprintf("box/%s/version/%v/release", box.Tag, version.Version) resp, err := client.Put(path) if err != nil || (resp.StatusCode != 200) { cloudErrors := &VagrantCloudErrors{} if err := decodeBody(resp, cloudErrors); err != nil { state.Put("error", fmt.Errorf("Error parsing provider response: %s", err)) return multistep.ActionHalt } if strings.Contains(cloudErrors.FormatErrors(), "already been released") { ui.Message("Not releasing version, already released") return multistep.ActionContinue } state.Put("error", fmt.Errorf("Error releasing version: %s", cloudErrors.FormatErrors())) return multistep.ActionHalt } ui.Message(fmt.Sprintf("Version successfully released and available")) return multistep.ActionContinue } func (s *stepReleaseVersion) Cleanup(state multistep.StateBag) { // No cleanup } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/step_upload.go����������������������������������������0000664�0000000�0000000�00000003533�13771713062�0024105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "context" "fmt" "log" "net/http" "time" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" ) type stepUpload struct { } func (s *stepUpload) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) config := state.Get("config").(*Config) ui := state.Get("ui").(packersdk.Ui) upload := state.Get("upload").(*Upload) artifactFilePath := state.Get("artifactFilePath").(string) url := upload.UploadPath ui.Say(fmt.Sprintf("Uploading box: %s", artifactFilePath)) ui.Message( "Depending on your internet connection and the size of the box,\n" + "this may take some time") err := retry.Config{ Tries: 3, RetryDelay: (&retry.Backoff{InitialBackoff: 10 * time.Second, MaxBackoff: 10 * time.Second, Multiplier: 2}).Linear, }.Run(ctx, func(ctx context.Context) error { ui.Message(fmt.Sprintf("Uploading box")) var err error var resp *http.Response if config.NoDirectUpload { resp, err = client.Upload(artifactFilePath, url) } else { resp, err = client.DirectUpload(artifactFilePath, url) } if err != nil { ui.Message(fmt.Sprintf( "Error uploading box! Will retry in 10 seconds. Error: %s", err)) return err } if resp.StatusCode != 200 { err := fmt.Errorf("bad HTTP status: %d", resp.StatusCode) log.Print(err) ui.Message(fmt.Sprintf( "Error uploading box! Will retry in 10 seconds. Status: %d", resp.StatusCode)) return err } return err }) if err != nil { state.Put("error", err) return multistep.ActionHalt } ui.Message("Box successfully uploaded") return multistep.ActionContinue } func (s *stepUpload) Cleanup(state multistep.StateBag) { // No cleanup } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/step_verify_box.go������������������������������������0000664�0000000�0000000�00000003463�13771713062�0024777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrantcloud import ( "context" "fmt" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type Box struct { Tag string `json:"tag"` Versions []*Version `json:"versions"` } func (b *Box) HasVersion(version string) (bool, *Version) { for _, v := range b.Versions { if v.Version == version { return true, v } } return false, nil } type stepVerifyBox struct { } func (s *stepVerifyBox) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { client := state.Get("client").(*VagrantCloudClient) ui := state.Get("ui").(packersdk.Ui) config := state.Get("config").(*Config) ui.Say(fmt.Sprintf("Verifying box is accessible: %s", config.Tag)) path := fmt.Sprintf("box/%s", config.Tag) resp, err := client.Get(path) if err != nil { state.Put("error", fmt.Errorf("Error retrieving box: %s", err)) return multistep.ActionHalt } if resp.StatusCode != 200 { cloudErrors := &VagrantCloudErrors{} err = decodeBody(resp, cloudErrors) if err != nil { ui.Error(fmt.Sprintf("error decoding error response: %s", err)) } state.Put("error", fmt.Errorf("Error retrieving box: %s", cloudErrors.FormatErrors())) return multistep.ActionHalt } box := &Box{} if err = decodeBody(resp, box); err != nil { state.Put("error", fmt.Errorf("Error parsing box response: %s", err)) return multistep.ActionHalt } if box.Tag != config.Tag { state.Put("error", fmt.Errorf("Could not verify box: %s", config.Tag)) return multistep.ActionHalt } ui.Message("Box accessible and matches tag") // Keep the box in state for later state.Put("box", box) // Box exists and is accessible return multistep.ActionContinue } func (s *stepVerifyBox) Cleanup(state multistep.StateBag) { // no cleanup needed } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/version/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022720�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant-cloud/version/version.go������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024731�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var VagrantCloudPluginVersion *version.PluginVersion func init() { VagrantCloudPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020127�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/artifact.go�������������������������������������������������0000664�0000000�0000000�00000001262�13771713062�0022254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "os" ) const BuilderId = "mitchellh.post-processor.vagrant" type Artifact struct { Path string Provider string } func NewArtifact(provider, path string) *Artifact { return &Artifact{ Path: path, Provider: provider, } } func (*Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Files() []string { return []string{a.Path} } func (a *Artifact) Id() string { return a.Provider } func (a *Artifact) String() string { return fmt.Sprintf("'%s' provider box: %s", a.Provider, a.Path) } func (a *Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return os.Remove(a.Path) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/artifact_test.go��������������������������������������������0000664�0000000�0000000�00000000701�13771713062�0023310�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestArtifact_ImplementsArtifact(t *testing.T) { var raw interface{} raw = &Artifact{} if _, ok := raw.(packersdk.Artifact); !ok { t.Fatalf("Artifact should be a Artifact") } } func TestArtifact_Id(t *testing.T) { artifact := NewArtifact("vmware", "./") if artifact.Id() != "vmware" { t.Fatalf("should return name as Id") } } ���������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/aws.go������������������������������������������������������0000664�0000000�0000000�00000002471�13771713062�0021254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "bytes" "fmt" "strings" "text/template" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type AWSProvider struct{} func (p *AWSProvider) KeepInputArtifact() bool { return true } func (p *AWSProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "aws"} // Build up the template data to build our Vagrantfile tplData := &awsVagrantfileTemplate{ Images: make(map[string]string), } for _, regions := range strings.Split(artifact.Id(), ",") { parts := strings.Split(regions, ":") if len(parts) != 2 { err = fmt.Errorf("Poorly formatted artifact ID: %s", artifact.Id()) return } tplData.Images[parts[0]] = parts[1] } // Build up the contents var contents bytes.Buffer t := template.Must(template.New("vf").Parse(defaultAWSVagrantfile)) err = t.Execute(&contents, tplData) vagrantfile = contents.String() return } type awsVagrantfileTemplate struct { Images map[string]string } var defaultAWSVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider "aws" do |aws| {{ range $region, $ami := .Images }} aws.region_config "{{ $region }}", ami: "{{ $ami }}" {{ end }} end end ` �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/aws_test.go�������������������������������������������������0000664�0000000�0000000�00000001432�13771713062�0022307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestAWSProvider_impl(t *testing.T) { var _ Provider = new(AWSProvider) } func TestAWSProvider_KeepInputArtifact(t *testing.T) { p := new(AWSProvider) if !p.KeepInputArtifact() { t.Fatal("should keep input artifact") } } func TestAWSProvider_ArtifactId(t *testing.T) { p := new(AWSProvider) ui := testUi() artifact := &packersdk.MockArtifact{ IdValue: "us-east-1:ami-1234", } vagrantfile, _, err := p.Process(ui, artifact, "foo") if err != nil { t.Fatalf("should not have error: %s", err) } result := `aws.region_config "us-east-1", ami: "ami-1234"` if !strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/azure.go����������������������������������������������������0000664�0000000�0000000�00000003764�13771713062�0021616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "strings" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type AzureProvider struct{} func (p *AzureProvider) KeepInputArtifact() bool { return true } func (p *AzureProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "azure"} var AzureImageProps map[string]string AzureImageProps = make(map[string]string) // HACK(double16): It appears we can not access the Azure Artifact directly, so parse String() artifactString := artifact.String() ui.Message(fmt.Sprintf("artifact string: '%s'", artifactString)) lines := strings.Split(artifactString, "\n") for l := 0; l < len(lines); l++ { split := strings.Split(lines[l], ": ") if len(split) > 1 { AzureImageProps[strings.TrimSpace(split[0])] = strings.TrimSpace(split[1]) } } ui.Message(fmt.Sprintf("artifact string parsed: %+v", AzureImageProps)) if AzureImageProps["ManagedImageId"] != "" { vagrantfile = fmt.Sprintf(managedImageVagrantfile, AzureImageProps["ManagedImageLocation"], AzureImageProps["ManagedImageId"]) } else if AzureImageProps["OSDiskUri"] != "" { vagrantfile = fmt.Sprintf(vhdVagrantfile, AzureImageProps["StorageAccountLocation"], AzureImageProps["OSDiskUri"], AzureImageProps["OSType"]) } else { err = fmt.Errorf("No managed image nor VHD URI found in artifact: %s", artifactString) return } return } var managedImageVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider :azure do |azure, override| azure.location = "%s" azure.vm_managed_image_id = "%s" override.winrm.transport = :ssl override.winrm.port = 5986 end end ` var vhdVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider :azure do |azure, override| azure.location = "%s" azure.vm_vhd_uri = "%s" azure.vm_operating_system = "%s" override.winrm.transport = :ssl override.winrm.port = 5986 end end ` ������������packer-1.6.6+ds1/post-processor/vagrant/azure_test.go�����������������������������������������������0000664�0000000�0000000�00000007374�13771713062�0022656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestAzureProvider_impl(t *testing.T) { var _ Provider = new(AzureProvider) } func TestAzureProvider_KeepInputArtifact(t *testing.T) { p := new(AzureProvider) if !p.KeepInputArtifact() { t.Fatal("should keep input artifact") } } func TestAzureProvider_ManagedImage(t *testing.T) { p := new(AzureProvider) ui := testUi() artifact := &packersdk.MockArtifact{ StringValue: `Azure.ResourceManagement.VMImage: OSType: Linux ManagedImageResourceGroupName: packerruns ManagedImageName: packer-1533651633 ManagedImageId: /subscriptions/e6229913-d9c3-4ddd-99a4-9e1ef3beaa1b/resourceGroups/packerruns/providers/Microsoft.Compute/images/packer-1533675589 ManagedImageLocation: westus`, } vagrantfile, _, err := p.Process(ui, artifact, "foo") if err != nil { t.Fatalf("should not have error: %s", err) } result := `azure.location = "westus"` if !strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } result = `azure.vm_managed_image_id = "/subscriptions/e6229913-d9c3-4ddd-99a4-9e1ef3beaa1b/resourceGroups/packerruns/providers/Microsoft.Compute/images/packer-1533675589"` if !strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } // DO NOT set resource group in Vagrantfile, it should be separate from the image result = `azure.resource_group_name` if strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } result = `azure.vm_operating_system` if strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } } func TestAzureProvider_VHD(t *testing.T) { p := new(AzureProvider) ui := testUi() artifact := &packersdk.MockArtifact{ IdValue: "https://packerbuildswest.blob.core.windows.net/system/Microsoft.Compute/Images/images/packer-osDisk.96ed2120-591d-4900-95b0-ee8e985f2213.vhd", StringValue: `Azure.ResourceManagement.VMImage: OSType: Linux StorageAccountLocation: westus OSDiskUri: https://packerbuildswest.blob.core.windows.net/system/Microsoft.Compute/Images/images/packer-osDisk.96ed2120-591d-4900-95b0-ee8e985f2213.vhd OSDiskUriReadOnlySas: https://packerbuildswest.blob.core.windows.net/system/Microsoft.Compute/Images/images/packer-osDisk.96ed2120-591d-4900-95b0-ee8e985f2213.vhd?se=2018-09-07T18%3A36%3A34Z&sig=xUiFvwAviPYoP%2Bc91vErqvwYR1eK4x%2BAx7YLMe84zzU%3D&sp=r&sr=b&sv=2016-05-31 TemplateUri: https://packerbuildswest.blob.core.windows.net/system/Microsoft.Compute/Images/images/packer-vmTemplate.96ed2120-591d-4900-95b0-ee8e985f2213.json TemplateUriReadOnlySas: https://packerbuildswest.blob.core.windows.net/system/Microsoft.Compute/Images/images/packer-vmTemplate.96ed2120-591d-4900-95b0-ee8e985f2213.json?se=2018-09-07T18%3A36%3A34Z&sig=lDxePyAUCZbfkB5ddiofimXfwk5INn%2F9E2BsnqIKC9Q%3D&sp=r&sr=b&sv=2016-05-31`, } vagrantfile, _, err := p.Process(ui, artifact, "foo") if err != nil { t.Fatalf("should not have error: %s", err) } result := `azure.location = "westus"` if !strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } result = `azure.vm_vhd_uri = "https://packerbuildswest.blob.core.windows.net/system/Microsoft.Compute/Images/images/packer-osDisk.96ed2120-591d-4900-95b0-ee8e985f2213.vhd"` if !strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } result = `azure.vm_operating_system = "Linux"` if !strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } // DO NOT set resource group in Vagrantfile, it should be separate from the image result = `azure.resource_group_name` if strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/digitalocean.go���������������������������������������������0000664�0000000�0000000�00000002436�13771713062�0023106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "bytes" "fmt" "strings" "text/template" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type digitalOceanVagrantfileTemplate struct { Image string "" Region string "" } type DigitalOceanProvider struct{} func (p *DigitalOceanProvider) KeepInputArtifact() bool { return true } func (p *DigitalOceanProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "digital_ocean"} // Determine the image and region... tplData := &digitalOceanVagrantfileTemplate{} parts := strings.Split(artifact.Id(), ":") if len(parts) != 2 { err = fmt.Errorf("Poorly formatted artifact ID: %s", artifact.Id()) return } tplData.Region = parts[0] tplData.Image = parts[1] // Build up the Vagrantfile var contents bytes.Buffer t := template.Must(template.New("vf").Parse(defaultDigitalOceanVagrantfile)) err = t.Execute(&contents, tplData) vagrantfile = contents.String() return } var defaultDigitalOceanVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider :digital_ocean do |digital_ocean| digital_ocean.image = "{{ .Image }}" digital_ocean.region = "{{ .Region }}" end end ` ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/digitalocean_test.go����������������������������������������0000664�0000000�0000000�00000001733�13771713062�0024144�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestDigitalOceanProvider_impl(t *testing.T) { var _ Provider = new(DigitalOceanProvider) } func TestDigitalOceanProvider_KeepInputArtifact(t *testing.T) { p := new(DigitalOceanProvider) if !p.KeepInputArtifact() { t.Fatal("should keep input artifact") } } func TestDigitalOceanProvider_ArtifactId(t *testing.T) { p := new(DigitalOceanProvider) ui := testUi() artifact := &packersdk.MockArtifact{ IdValue: "San Francisco:42", } vagrantfile, _, err := p.Process(ui, artifact, "foo") if err != nil { t.Fatalf("should not have error: %s", err) } image := `digital_ocean.image = "42"` if !strings.Contains(vagrantfile, image) { t.Fatalf("wrong image substitution: %s", vagrantfile) } region := `digital_ocean.region = "San Francisco"` if !strings.Contains(vagrantfile, region) { t.Fatalf("wrong region substitution: %s", vagrantfile) } } �������������������������������������packer-1.6.6+ds1/post-processor/vagrant/docker.go���������������������������������������������������0000664�0000000�0000000�00000001222�13771713062�0021722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type DockerProvider struct{} func (p *DockerProvider) KeepInputArtifact() bool { return false } func (p *DockerProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "docker"} vagrantfile = fmt.Sprintf(dockerVagrantfile, artifact.Id()) return } var dockerVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider :docker do |docker, override| docker.image = "%s" end end ` ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/docker_test.go����������������������������������������������0000664�0000000�0000000�00000000175�13771713062�0022767�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "testing" ) func TestDockerProvider_impl(t *testing.T) { var _ Provider = new(DockerProvider) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/google.go���������������������������������������������������0000664�0000000�0000000�00000001765�13771713062�0021743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "bytes" "text/template" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type googleVagrantfileTemplate struct { Image string "" } type GoogleProvider struct{} func (p *GoogleProvider) KeepInputArtifact() bool { return true } func (p *GoogleProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "google"} // Build up the template data to build our Vagrantfile tplData := &googleVagrantfileTemplate{} tplData.Image = artifact.Id() // Build up the Vagrantfile var contents bytes.Buffer t := template.Must(template.New("vf").Parse(defaultGoogleVagrantfile)) err = t.Execute(&contents, tplData) vagrantfile = contents.String() return } var defaultGoogleVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider :google do |google| google.image = "{{ .Image }}" end end ` �����������packer-1.6.6+ds1/post-processor/vagrant/google_test.go����������������������������������������������0000664�0000000�0000000�00000001423�13771713062�0022771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestGoogleProvider_impl(t *testing.T) { var _ Provider = new(GoogleProvider) } func TestGoogleProvider_KeepInputArtifact(t *testing.T) { p := new(GoogleProvider) if !p.KeepInputArtifact() { t.Fatal("should keep input artifact") } } func TestGoogleProvider_ArtifactId(t *testing.T) { p := new(GoogleProvider) ui := testUi() artifact := &packersdk.MockArtifact{ IdValue: "packer-1234", } vagrantfile, _, err := p.Process(ui, artifact, "foo") if err != nil { t.Fatalf("should not have error: %s", err) } result := `google.image = "packer-1234"` if !strings.Contains(vagrantfile, result) { t.Fatalf("wrong substitution: %s", vagrantfile) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/hyperv.go���������������������������������������������������0000664�0000000�0000000�00000004431�13771713062�0021775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "os" "path/filepath" "strings" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type HypervProvider struct{} func (p *HypervProvider) KeepInputArtifact() bool { return false } func (p *HypervProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "hyperv"} // ui.Message(fmt.Sprintf("artifacts all: %+v", artifact)) var outputDir string // Vargant requires specific dir structure for hyperv // hyperv builder creates the structure in the output dir // we have to keep the structure in a temp dir // hack little bit but string in artifact usually have output dir artifactString := artifact.String() d := strings.Split(artifactString, ": ") outputDir = d[1] // ui.Message(fmt.Sprintf("artifact dir from string: %s", outputDir)) // Copy all of the original contents into the temporary directory for _, path := range artifact.Files() { ui.Message(fmt.Sprintf("Copying: %s", path)) var rel string rel, err = filepath.Rel(outputDir, filepath.Dir(path)) // ui.Message(fmt.Sprintf("rel is: %s", rel)) if err != nil { ui.Message(fmt.Sprintf("err in: %s", rel)) return } dstDir := filepath.Join(dir, rel) // ui.Message(fmt.Sprintf("dstdir is: %s", dstDir)) if _, err = os.Stat(dstDir); err != nil { if err = os.MkdirAll(dstDir, 0755); err != nil { ui.Message(fmt.Sprintf("err in creating: %s", dstDir)) return } } dstPath := filepath.Join(dstDir, filepath.Base(path)) // We prefer to link the files where possible because they are often very huge. // Some filesystem configurations do not allow hardlinks. As the possibilities // of mounting different devices in different paths are flexible, we just try to // link the file and copy if the link fails, thereby automatically optimizing with a safe fallback. if err = LinkFile(dstPath, path); err != nil { // ui.Message(fmt.Sprintf("err in linking: %s to %s", path, dstPath)) if err = CopyContents(dstPath, path); err != nil { ui.Message(fmt.Sprintf("err in copying: %s to %s", path, dstPath)) return } } ui.Message(fmt.Sprintf("Copied %s to %s", path, dstPath)) } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/libvirt.go��������������������������������������������������0000664�0000000�0000000�00000005110�13771713062�0022126�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "path/filepath" "strconv" "strings" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // Lowercase a ascii letter. func lower(c byte) byte { return c | ('a' - 'A') } // Convert a string that represents a qemu disk image size to megabytes. // // Valid units (case-insensitive): // // B (byte) 1B // K (kilobyte) 1024B // M (megabyte) 1024K // G (gigabyte) 1024M // T (terabyte) 1024G // P (petabyte) 1024T // E (exabyte) 1024P // // The default is M. func sizeInMegabytes(size string) uint64 { unit := size[len(size)-1] if unit >= '0' && unit <= '9' { unit = 'm' } else { size = size[:len(size)-1] } value, _ := strconv.ParseUint(size, 10, 64) switch lower(unit) { case 'b': return value / 1024 / 1024 case 'k': return value / 1024 case 'm': return value case 'g': return value * 1024 case 't': return value * 1024 * 1024 case 'p': return value * 1024 * 1024 * 1024 case 'e': return value * 1024 * 1024 * 1024 * 1024 default: panic(fmt.Sprintf("Unknown size unit %c", unit)) } } type LibVirtProvider struct{} func (p *LibVirtProvider) KeepInputArtifact() bool { return false } func (p *LibVirtProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { diskName := artifact.State("diskName").(string) // Copy the disk image into the temporary directory (as box.img) for _, path := range artifact.Files() { if strings.HasSuffix(path, "/"+diskName) { ui.Message(fmt.Sprintf("Copying from artifact: %s", path)) dstPath := filepath.Join(dir, "box.img") if err = CopyContents(dstPath, path); err != nil { return } } } format := artifact.State("diskType").(string) origSize := sizeInMegabytes(artifact.State("diskSize").(string)) size := origSize / 1024 // In MB, want GB if origSize%1024 > 0 { // Make sure we don't make the size smaller size++ } domainType := artifact.State("domainType").(string) // Convert domain type to libvirt driver var driver string switch domainType { case "none", "tcg", "hvf": driver = "qemu" case "kvm": driver = domainType default: return "", nil, fmt.Errorf("Unknown libvirt domain type: %s", domainType) } // Create the metadata metadata = map[string]interface{}{ "provider": "libvirt", "format": format, "virtual_size": size, } vagrantfile = fmt.Sprintf(libvirtVagrantfile, driver) return } var libvirtVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider :libvirt do |libvirt| libvirt.driver = "%s" end end ` ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/libvirt_test.go���������������������������������������������0000664�0000000�0000000�00000004060�13771713062�0023170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "testing" ) func assertSizeInMegabytes(t *testing.T, size string, expected uint64) { actual := sizeInMegabytes(size) if actual != expected { t.Fatalf("the size `%s` was converted to `%d` but expected `%d`", size, actual, expected) } } func Test_sizeInMegabytes_WithInvalidUnitMustPanic(t *testing.T) { defer func() { if r := recover(); r == nil { t.Fatalf("expected a panic but got none") } }() sizeInMegabytes("1234x") } func Test_sizeInMegabytes_WithoutUnitMustDefaultToMegabytes(t *testing.T) { assertSizeInMegabytes(t, "1234", 1234) } func Test_sizeInMegabytes_WithBytesUnit(t *testing.T) { assertSizeInMegabytes(t, fmt.Sprintf("%db", 1234*1024*1024), 1234) assertSizeInMegabytes(t, fmt.Sprintf("%dB", 1234*1024*1024), 1234) assertSizeInMegabytes(t, "1B", 0) } func Test_sizeInMegabytes_WithKiloBytesUnit(t *testing.T) { assertSizeInMegabytes(t, fmt.Sprintf("%dk", 1234*1024), 1234) assertSizeInMegabytes(t, fmt.Sprintf("%dK", 1234*1024), 1234) assertSizeInMegabytes(t, "1K", 0) } func Test_sizeInMegabytes_WithMegabytesUnit(t *testing.T) { assertSizeInMegabytes(t, "1234m", 1234) assertSizeInMegabytes(t, "1234M", 1234) assertSizeInMegabytes(t, "1M", 1) } func Test_sizeInMegabytes_WithGigabytesUnit(t *testing.T) { assertSizeInMegabytes(t, "1234g", 1234*1024) assertSizeInMegabytes(t, "1234G", 1234*1024) assertSizeInMegabytes(t, "1G", 1*1024) } func Test_sizeInMegabytes_WithTerabytesUnit(t *testing.T) { assertSizeInMegabytes(t, "1234t", 1234*1024*1024) assertSizeInMegabytes(t, "1234T", 1234*1024*1024) assertSizeInMegabytes(t, "1T", 1*1024*1024) } func Test_sizeInMegabytes_WithPetabytesUnit(t *testing.T) { assertSizeInMegabytes(t, "1234p", 1234*1024*1024*1024) assertSizeInMegabytes(t, "1234P", 1234*1024*1024*1024) assertSizeInMegabytes(t, "1P", 1*1024*1024*1024) } func Test_sizeInMegabytes_WithExabytesUnit(t *testing.T) { assertSizeInMegabytes(t, "1234e", 1234*1024*1024*1024*1024) assertSizeInMegabytes(t, "1234E", 1234*1024*1024*1024*1024) assertSizeInMegabytes(t, "1E", 1*1024*1024*1024*1024) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/lxc.go������������������������������������������������������0000664�0000000�0000000�00000001376�13771713062�0021253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "path/filepath" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type LXCProvider struct{} func (p *LXCProvider) KeepInputArtifact() bool { return false } func (p *LXCProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{ "provider": "lxc", "version": "1.0.0", } // Copy all of the original contents into the temporary directory for _, path := range artifact.Files() { ui.Message(fmt.Sprintf("Copying: %s", path)) dstPath := filepath.Join(dir, filepath.Base(path)) if err = CopyContents(dstPath, path); err != nil { return } } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/lxc_test.go�������������������������������������������������0000664�0000000�0000000�00000000167�13771713062�0022307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "testing" ) func TestLXCProvider_impl(t *testing.T) { var _ Provider = new(LXCProvider) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/parallels.go������������������������������������������������0000664�0000000�0000000�00000003076�13771713062�0022443�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "path/filepath" "regexp" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // These are the extensions of files and directories that are unnecessary for the function // of a Parallels virtual machine. var UnnecessaryFilesPatterns = []string{"\\.log$", "\\.backup$", "\\.Backup$", "\\.app/", "/Windows Disks/"} type ParallelsProvider struct{} func (p *ParallelsProvider) KeepInputArtifact() bool { return false } func (p *ParallelsProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "parallels"} // Copy all of the original contents into the temporary directory for _, path := range artifact.Files() { // If the file isn't critical to the function of the // virtual machine, we get rid of it. unnecessary := false for _, unnecessaryPat := range UnnecessaryFilesPatterns { if matched, _ := regexp.MatchString(unnecessaryPat, path); matched { unnecessary = true break } } if unnecessary { continue } tmpPath := filepath.ToSlash(path) pathRe := regexp.MustCompile(`^(.+?)([^/]+\.pvm/.+?)$`) matches := pathRe.FindStringSubmatch(tmpPath) var pvmPath string if matches != nil { pvmPath = filepath.FromSlash(matches[2]) } else { continue // Just copy a pvm } dstPath := filepath.Join(dir, pvmPath) ui.Message(fmt.Sprintf("Copying: %s", path)) if err = CopyContents(dstPath, path); err != nil { return } } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/parallels_test.go�������������������������������������������0000664�0000000�0000000�00000000203�13771713062�0023467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "testing" ) func TestParallelsProvider_impl(t *testing.T) { var _ Provider = new(ParallelsProvider) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/post-processor.go�������������������������������������������0000664�0000000�0000000�00000022752�13771713062�0023470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // vagrant implements the packersdk.PostProcessor interface and adds a // post-processor that turns artifacts of known builders into Vagrant // boxes. package vagrant import ( "compress/flate" "context" "fmt" "io/ioutil" "os" "path/filepath" "strings" "text/template" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/hashicorp/packer/post-processor/artifice" "github.com/mitchellh/mapstructure" ) var builtins = map[string]string{ "mitchellh.amazonebs": "aws", "mitchellh.amazon.instance": "aws", "mitchellh.virtualbox": "virtualbox", "mitchellh.vmware": "vmware", "mitchellh.vmware-esx": "vmware", "pearkes.digitalocean": "digitalocean", "packer.googlecompute": "google", "hashicorp.scaleway": "scaleway", "packer.parallels": "parallels", "MSOpenTech.hyperv": "hyperv", "transcend.qemu": "libvirt", "ustream.lxc": "lxc", "Azure.ResourceManagement.VMImage": "azure", "packer.post-processor.docker-import": "docker", "packer.post-processor.docker-tag": "docker", "packer.post-processor.docker-push": "docker", } func availableProviders() []string { dedupedProvidersMap := map[string]string{} for _, v := range builtins { dedupedProvidersMap[v] = v } dedupedProviders := []string{} for k := range dedupedProvidersMap { dedupedProviders = append(dedupedProviders, k) } return dedupedProviders } type Config struct { common.PackerConfig `mapstructure:",squash"` CompressionLevel int `mapstructure:"compression_level"` Include []string `mapstructure:"include"` OutputPath string `mapstructure:"output"` Override map[string]interface{} VagrantfileTemplate string `mapstructure:"vagrantfile_template"` VagrantfileTemplateGenerated bool `mapstructure:"vagrantfile_template_generated"` ProviderOverride string `mapstructure:"provider_override"` ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { if err := p.configureSingle(&p.config, raws...); err != nil { return err } if p.config.ProviderOverride != "" { validOverride := false providers := availableProviders() for _, prov := range providers { if prov == p.config.ProviderOverride { validOverride = true break } } if !validOverride { return fmt.Errorf("The given provider_override %s is not valid. "+ "Please choose from one of %s", p.config.ProviderOverride, strings.Join(providers, ", ")) } } return nil } func (p *PostProcessor) PostProcessProvider(name string, provider Provider, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, error) { config, err := p.specificConfig(name) if err != nil { return nil, false, err } err = CreateDummyBox(ui, config.CompressionLevel) if err != nil { return nil, false, err } ui.Say(fmt.Sprintf("Creating Vagrant box for '%s' provider", name)) var generatedData map[interface{}]interface{} stateData := artifact.State("generated_data") if stateData != nil { // Make sure it's not a nil map so we can assign to it later. generatedData = stateData.(map[interface{}]interface{}) } // If stateData has a nil map generatedData will be nil // and we need to make sure it's not if generatedData == nil { generatedData = make(map[interface{}]interface{}) } generatedData["ArtifactId"] = artifact.Id() generatedData["BuildName"] = config.PackerBuildName generatedData["Provider"] = name config.ctx.Data = generatedData outputPath, err := interpolate.Render(config.OutputPath, &config.ctx) if err != nil { return nil, false, err } // Create a temporary directory for us to build the contents of the box in dir, err := tmp.Dir("packer") if err != nil { return nil, false, err } defer os.RemoveAll(dir) // Copy all of the includes files into the temporary directory for _, src := range config.Include { ui.Message(fmt.Sprintf("Copying from include: %s", src)) dst := filepath.Join(dir, filepath.Base(src)) if err := CopyContents(dst, src); err != nil { err = fmt.Errorf("Error copying include file: %s\n\n%s", src, err) return nil, false, err } } // Run the provider processing step vagrantfile, metadata, err := provider.Process(ui, artifact, dir) if err != nil { return nil, false, err } // Write the metadata we got if err := WriteMetadata(dir, metadata); err != nil { return nil, false, err } // Write our Vagrantfile var customVagrantfile string if config.VagrantfileTemplate != "" { ui.Message(fmt.Sprintf("Using custom Vagrantfile: %s", config.VagrantfileTemplate)) customBytes, err := ioutil.ReadFile(config.VagrantfileTemplate) if err != nil { return nil, false, err } customVagrantfile, err = interpolate.Render(string(customBytes), &config.ctx) if err != nil { return nil, false, err } } f, err := os.Create(filepath.Join(dir, "Vagrantfile")) if err != nil { return nil, false, err } t := template.Must(template.New("root").Parse(boxVagrantfileContents)) err = t.Execute(f, &vagrantfileTemplate{ ProviderVagrantfile: vagrantfile, CustomVagrantfile: customVagrantfile, }) f.Close() if err != nil { return nil, false, err } // Create the box if err := DirToBox(outputPath, dir, ui, config.CompressionLevel); err != nil { return nil, false, err } return NewArtifact(name, outputPath), provider.KeepInputArtifact(), nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { name := p.config.ProviderOverride if name == "" { n, ok := builtins[artifact.BuilderId()] if !ok { return nil, false, false, fmt.Errorf( "Unknown artifact type, can't build box: %s", artifact.BuilderId()) } name = n } provider := providerForName(name) if provider == nil { if artifact.BuilderId() == artifice.BuilderId { return nil, false, false, fmt.Errorf( "Unknown provider type: When using an artifact created by " + "the artifice post-processor, you need to set the " + "provider_override option.") } else { // This shouldn't happen since we hard code all of these ourselves panic(fmt.Sprintf("bad provider name: %s", name)) } } artifact, keep, err := p.PostProcessProvider(name, provider, ui, artifact) // In some cases, (e.g. AMI), deleting the input artifact would render the // resulting vagrant box useless. Because of these cases, we want to // forcibly set keep_input_artifact. // TODO: rework all provisioners to only forcibly keep those where it matters return artifact, keep, true, err } func (p *PostProcessor) configureSingle(c *Config, raws ...interface{}) error { var md mapstructure.Metadata err := config.Decode(c, &config.DecodeOpts{ Metadata: &md, Interpolate: true, InterpolateContext: &c.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "output", }, }, }, raws...) if err != nil { return err } // Defaults if c.OutputPath == "" { c.OutputPath = "packer_{{ .BuildName }}_{{.Provider}}.box" } found := false for _, k := range md.Keys { if k == "compression_level" { found = true break } } if !found { c.CompressionLevel = flate.DefaultCompression } var errs *packersdk.MultiError if c.VagrantfileTemplate != "" && c.VagrantfileTemplateGenerated == false { _, err := os.Stat(c.VagrantfileTemplate) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf( "vagrantfile_template '%s' does not exist", c.VagrantfileTemplate)) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) specificConfig(name string) (Config, error) { config := p.config if _, ok := config.Override[name]; ok { if err := mapstructure.Decode(config.Override[name], &config); err != nil { err = fmt.Errorf("Error overriding config for %s: %s", name, err) return config, err } } return config, nil } func providerForName(name string) Provider { switch name { case "aws": return new(AWSProvider) case "scaleway": return new(ScalewayProvider) case "digitalocean": return new(DigitalOceanProvider) case "virtualbox": return new(VBoxProvider) case "vmware": return new(VMwareProvider) case "parallels": return new(ParallelsProvider) case "hyperv": return new(HypervProvider) case "libvirt": return new(LibVirtProvider) case "google": return new(GoogleProvider) case "lxc": return new(LXCProvider) case "azure": return new(AzureProvider) case "docker": return new(DockerProvider) default: return nil } } type vagrantfileTemplate struct { ProviderVagrantfile string CustomVagrantfile string } const boxVagrantfileContents string = ` # The contents below were provided by the Packer Vagrant post-processor {{ .ProviderVagrantfile }} # The contents below (if any) are custom contents provided by the # Packer template during image build. {{ .CustomVagrantfile }} ` ����������������������packer-1.6.6+ds1/post-processor/vagrant/post-processor.hcl2spec.go����������������������������������0000664�0000000�0000000�00000011074�13771713062�0025165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package vagrant import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` CompressionLevel *int `mapstructure:"compression_level" cty:"compression_level" hcl:"compression_level"` Include []string `mapstructure:"include" cty:"include" hcl:"include"` OutputPath *string `mapstructure:"output" cty:"output" hcl:"output"` Override map[string]interface{} `cty:"override" hcl:"override"` VagrantfileTemplate *string `mapstructure:"vagrantfile_template" cty:"vagrantfile_template" hcl:"vagrantfile_template"` VagrantfileTemplateGenerated *bool `mapstructure:"vagrantfile_template_generated" cty:"vagrantfile_template_generated" hcl:"vagrantfile_template_generated"` ProviderOverride *string `mapstructure:"provider_override" cty:"provider_override" hcl:"provider_override"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "compression_level": &hcldec.AttrSpec{Name: "compression_level", Type: cty.Number, Required: false}, "include": &hcldec.AttrSpec{Name: "include", Type: cty.List(cty.String), Required: false}, "output": &hcldec.AttrSpec{Name: "output", Type: cty.String, Required: false}, "override": &hcldec.AttrSpec{Name: "override", Type: cty.Map(cty.String), Required: false}, "vagrantfile_template": &hcldec.AttrSpec{Name: "vagrantfile_template", Type: cty.String, Required: false}, "vagrantfile_template_generated": &hcldec.AttrSpec{Name: "vagrantfile_template_generated", Type: cty.Bool, Required: false}, "provider_override": &hcldec.AttrSpec{Name: "provider_override", Type: cty.String, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/post-processor_test.go��������������������������������������0000664�0000000�0000000�00000011703�13771713062�0024521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "bytes" "compress/flate" "context" "io/ioutil" "os" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{} } func testPP(t *testing.T) *PostProcessor { var p PostProcessor if err := p.Configure(testConfig()); err != nil { t.Fatalf("err: %s", err) } return &p } func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } } func TestPostProcessor_ImplementsPostProcessor(t *testing.T) { var _ packersdk.PostProcessor = new(PostProcessor) } func TestPostProcessorPrepare_compressionLevel(t *testing.T) { var p PostProcessor // Default c := testConfig() delete(c, "compression_level") if err := p.Configure(c); err != nil { t.Fatalf("err: %s", err) } config := p.config if config.CompressionLevel != flate.DefaultCompression { t.Fatalf("bad: %#v", config.CompressionLevel) } // Set c = testConfig() c["compression_level"] = 7 if err := p.Configure(c); err != nil { t.Fatalf("err: %s", err) } config = p.config if config.CompressionLevel != 7 { t.Fatalf("bad: %#v", config.CompressionLevel) } } func TestPostProcessorPrepare_outputPath(t *testing.T) { var p PostProcessor // Default c := testConfig() delete(c, "output") err := p.Configure(c) if err != nil { t.Fatalf("err: %s", err) } // Bad template c["output"] = "bad {{{{.Template}}}}" err = p.Configure(c) if err == nil { t.Fatal("should have error") } } func TestSpecificConfig(t *testing.T) { var p PostProcessor // Default c := testConfig() c["compression_level"] = 1 c["output"] = "folder" c["override"] = map[string]interface{}{ "aws": map[string]interface{}{ "compression_level": 7, }, } if err := p.Configure(c); err != nil { t.Fatalf("err: %s", err) } // overrides config config, err := p.specificConfig("aws") if err != nil { t.Fatalf("err: %s", err) } if config.CompressionLevel != 7 { t.Fatalf("bad: %#v", config.CompressionLevel) } if config.OutputPath != "folder" { t.Fatalf("bad: %#v", config.OutputPath) } // does NOT overrides config config, err = p.specificConfig("virtualbox") if err != nil { t.Fatalf("err: %s", err) } if config.CompressionLevel != 1 { t.Fatalf("bad: %#v", config.CompressionLevel) } if config.OutputPath != "folder" { t.Fatalf("bad: %#v", config.OutputPath) } } func TestPostProcessorPrepare_vagrantfileTemplateExists(t *testing.T) { f, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } name := f.Name() c := testConfig() c["vagrantfile_template"] = name if err := f.Close(); err != nil { t.Fatalf("err: %s", err) } var p PostProcessor if err := p.Configure(c); err != nil { t.Fatal("no error expected as vagrantfile_template exists") } if err := os.Remove(name); err != nil { t.Fatalf("err: %s", err) } if err := p.Configure(c); err == nil { t.Fatal("expected error since vagrantfile_template does not exist and vagrantfile_template_generated is unset") } // The vagrantfile_template will be generated during the build process c["vagrantfile_template_generated"] = true if err := p.Configure(c); err != nil { t.Fatal("no error expected due to missing vagrantfile_template as vagrantfile_template_generated is set") } } func TestPostProcessorPrepare_ProviderOverrideExists(t *testing.T) { c := testConfig() c["provider_override"] = "foo" var p PostProcessor if err := p.Configure(c); err == nil { t.Fatal("Should have errored since foo is not a valid vagrant provider") } c = testConfig() c["provider_override"] = "aws" if err := p.Configure(c); err != nil { t.Fatal("Should not have errored since aws is a valid vagrant provider") } } func TestPostProcessorPostProcess_badId(t *testing.T) { artifact := &packersdk.MockArtifact{ BuilderIdValue: "invalid.packer", } _, _, _, err := testPP(t).PostProcess(context.Background(), testUi(), artifact) if !strings.Contains(err.Error(), "artifact type") { t.Fatalf("err: %s", err) } } func TestPostProcessorPostProcess_vagrantfileUserVariable(t *testing.T) { var p PostProcessor f, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(f.Name()) c := map[string]interface{}{ "packer_user_variables": map[string]string{ "foo": f.Name(), }, "vagrantfile_template": "{{user `foo`}}", } err = p.Configure(c) if err != nil { t.Fatalf("err: %s", err) } a := &packersdk.MockArtifact{ BuilderIdValue: "packer.parallels", } a2, _, _, err := p.PostProcess(context.Background(), testUi(), a) if a2 != nil { for _, fn := range a2.Files() { defer os.Remove(fn) } } if err != nil { t.Fatalf("err: %s", err) } } func TestProviderForName(t *testing.T) { if v, ok := providerForName("virtualbox").(*VBoxProvider); !ok { t.Fatalf("bad: %#v", v) } if providerForName("nope") != nil { t.Fatal("should be nil if bad provider") } } �������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/provider.go�������������������������������������������������0000664�0000000�0000000�00000001465�13771713062�0022316�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // Provider is the interface that each provider must implement in order // to package the artifacts into a Vagrant-compatible box. type Provider interface { // KeepInputArtifact should return true/false whether this provider // requires the input artifact to be kept by default. KeepInputArtifact() bool // Process is called to process an artifact into a Vagrant box. The // artifact is given as well as the temporary directory path to // put things. // // The Provider should return the contents for the Vagrantfile, // any metadata (including the provider type in that), and an error // if any. Process(packersdk.Ui, packersdk.Artifact, string) (vagrantfile string, metadata map[string]interface{}, err error) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/scaleway.go�������������������������������������������������0000664�0000000�0000000�00000002351�13771713062�0022267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "bytes" "fmt" "strings" "text/template" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type scalewayVagrantfileTemplate struct { Image string "" Region string "" } type ScalewayProvider struct{} func (p *ScalewayProvider) KeepInputArtifact() bool { return true } func (p *ScalewayProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "scaleway"} // Determine the image and region... tplData := &scalewayVagrantfileTemplate{} parts := strings.Split(artifact.Id(), ":") if len(parts) != 2 { err = fmt.Errorf("Poorly formatted artifact ID: %s", artifact.Id()) return } tplData.Region = parts[0] tplData.Image = parts[1] // Build up the Vagrantfile var contents bytes.Buffer t := template.Must(template.New("vf").Parse(defaultScalewayVagrantfile)) err = t.Execute(&contents, tplData) vagrantfile = contents.String() return } var defaultScalewayVagrantfile = ` Vagrant.configure("2") do |config| config.vm.provider :scaleway do |scaleway| scaleway.image = "{{ .Image }}" scaleway.region = "{{ .Region }}" end end ` ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/tar_fix.go��������������������������������������������������0000664�0000000�0000000�00000000161�13771713062�0022110�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !go1.10 package vagrant import "archive/tar" func setHeaderFormat(header *tar.Header) { // no-op } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/tar_fix_go110.go��������������������������������������������0000664�0000000�0000000�00000000442�13771713062�0023021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build go1.10 package vagrant import "archive/tar" func setHeaderFormat(header *tar.Header) { // We have to set the Format explicitly because of a bug in // libarchive. This affects eg. the tar in macOS listing huge // files with zero byte length. header.Format = tar.FormatGNU } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/util.go�����������������������������������������������������0000664�0000000�0000000�00000012175�13771713062�0021441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "archive/tar" "compress/flate" "encoding/json" "fmt" "io" "log" "os" "path/filepath" "runtime" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/klauspost/pgzip" ) var ( // ErrInvalidCompressionLevel is returned when the compression level passed // to gzip is not in the expected range. See compress/flate for details. ErrInvalidCompressionLevel = fmt.Errorf( "Invalid compression level. Expected an integer from -1 to 9.") ) // Copies a file by copying the contents of the file to another place. func CopyContents(dst, src string) error { srcF, err := os.Open(src) if err != nil { return err } defer srcF.Close() dstDir, _ := filepath.Split(dst) if dstDir != "" { err := os.MkdirAll(dstDir, 0755) if err != nil { return err } } dstF, err := os.Create(dst) if err != nil { return err } defer dstF.Close() if _, err := io.Copy(dstF, srcF); err != nil { return err } return nil } // Creates a (hard) link to a file, ensuring that all parent directories also exist. func LinkFile(dst, src string) error { dstDir, _ := filepath.Split(dst) if dstDir != "" { err := os.MkdirAll(dstDir, 0755) if err != nil { return err } } if err := os.Link(src, dst); err != nil { return err } return nil } // DirToBox takes the directory and compresses it into a Vagrant-compatible // box. This function does not perform checks to verify that dir is // actually a proper box. This is an expected precondition. func DirToBox(dst, dir string, ui packersdk.Ui, level int) error { log.Printf("Turning dir into box: %s => %s", dir, dst) // Make the containing directory, if it does not already exist err := os.MkdirAll(filepath.Dir(dst), 0755) if err != nil { return err } dstF, err := os.Create(dst) if err != nil { return err } defer dstF.Close() var dstWriter io.WriteCloser = dstF if level != flate.NoCompression { log.Printf("Compressing with gzip compression level: %d", level) gzipWriter, err := makePgzipWriter(dstWriter, level) if err != nil { return err } defer gzipWriter.Close() dstWriter = gzipWriter } tarWriter := tar.NewWriter(dstWriter) defer tarWriter.Close() // This is the walk func that tars each of the files in the dir tarWalk := func(path string, info os.FileInfo, prevErr error) error { // If there was a prior error, return it if prevErr != nil { return prevErr } // Skip directories if info.IsDir() { log.Printf("Skipping directory '%s' for box '%s'", path, dst) return nil } log.Printf("Box add: '%s' to '%s'", path, dst) f, err := os.Open(path) if err != nil { return err } defer f.Close() header, err := tar.FileInfoHeader(info, "") if err != nil { return err } // go >=1.10 wants to use GNU tar format to workaround issues in // libarchive < 3.3.2 setHeaderFormat(header) // We have to set the Name explicitly because it is supposed to // be a relative path to the root. Otherwise, the tar ends up // being a bunch of files in the root, even if they're actually // nested in a dir in the original "dir" param. header.Name, err = filepath.Rel(dir, path) if err != nil { return err } if ui != nil { ui.Message(fmt.Sprintf("Compressing: %s", header.Name)) } if err := tarWriter.WriteHeader(header); err != nil { return err } if _, err := io.Copy(tarWriter, f); err != nil { return err } return nil } // Tar.gz everything up return filepath.Walk(dir, tarWalk) } // CreateDummyBox create a dummy Vagrant-compatible box under temporary dir // This function is mainly used to check cases such as the host system having // a GNU tar incompatible uname that will cause the actual Vagrant box creation // to fail later func CreateDummyBox(ui packersdk.Ui, level int) error { ui.Say("Creating a dummy Vagrant box to ensure the host system can create one correctly") // Create a temporary dir to create dummy Vagrant box from tempDir, err := tmp.Dir("packer") if err != nil { return err } defer os.RemoveAll(tempDir) // Write some dummy metadata for the box if err := WriteMetadata(tempDir, make(map[string]string)); err != nil { return err } // Create the dummy Vagrant box tempBox, err := tmp.File("box-*.box") if err != nil { return err } defer tempBox.Close() defer os.Remove(tempBox.Name()) if err := DirToBox(tempBox.Name(), tempDir, nil, level); err != nil { return err } return nil } // WriteMetadata writes the "metadata.json" file for a Vagrant box. func WriteMetadata(dir string, contents interface{}) error { if _, err := os.Stat(filepath.Join(dir, "metadata.json")); os.IsNotExist(err) { f, err := os.Create(filepath.Join(dir, "metadata.json")) if err != nil { return err } defer f.Close() enc := json.NewEncoder(f) return enc.Encode(contents) } return nil } func makePgzipWriter(output io.WriteCloser, compressionLevel int) (io.WriteCloser, error) { gzipWriter, err := pgzip.NewWriterLevel(output, compressionLevel) if err != nil { return nil, ErrInvalidCompressionLevel } gzipWriter.SetConcurrency(500000, runtime.GOMAXPROCS(-1)) return gzipWriter, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/version/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021614�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/version/version.go������������������������������������������0000664�0000000�0000000�00000000515�13771713062�0023631�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var VagrantPostprocessorVersion *version.PluginVersion func init() { VagrantPostprocessorVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/virtualbox.go�����������������������������������������������0000664�0000000�0000000�00000010312�13771713062�0022652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "archive/tar" "errors" "fmt" "io" "io/ioutil" "log" "os" "path/filepath" "regexp" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type VBoxProvider struct{} func (p *VBoxProvider) KeepInputArtifact() bool { return false } func (p *VBoxProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "virtualbox"} // Copy all of the original contents into the temporary directory for _, path := range artifact.Files() { // We treat OVA files specially, we unpack those into the temporary // directory so we can get the resulting disk and OVF. if extension := filepath.Ext(path); extension == ".ova" { ui.Message(fmt.Sprintf("Unpacking OVA: %s", path)) if err = DecompressOva(dir, path); err != nil { return } } else { ui.Message(fmt.Sprintf("Copying from artifact: %s", path)) dstPath := filepath.Join(dir, filepath.Base(path)) if err = CopyContents(dstPath, path); err != nil { return } } } // Rename the OVF file to box.ovf, as required by Vagrant ui.Message("Renaming the OVF to box.ovf...") if err = p.renameOVF(dir); err != nil { return } // Create the Vagrantfile from the template var baseMacAddress string baseMacAddress, err = p.findBaseMacAddress(dir) if err != nil { return } vagrantfile = fmt.Sprintf(vboxVagrantfile, baseMacAddress) return } func (p *VBoxProvider) findOvf(dir string) (string, error) { log.Println("Looking for OVF in artifact...") file_matches, err := filepath.Glob(filepath.Join(dir, "*.ovf")) if err != nil { return "", err } if len(file_matches) > 1 { return "", errors.New("More than one OVF file in VirtualBox artifact.") } if len(file_matches) < 1 { return "", errors.New("ovf file couldn't be found") } return file_matches[0], err } func (p *VBoxProvider) renameOVF(dir string) error { log.Println("Looking for OVF to rename...") ovf, err := p.findOvf(dir) if err != nil { return err } log.Printf("Renaming: '%s' => box.ovf", ovf) return os.Rename(ovf, filepath.Join(dir, "box.ovf")) } func (p *VBoxProvider) findBaseMacAddress(dir string) (string, error) { log.Println("Looking for OVF for base mac address...") ovf, err := p.findOvf(dir) if err != nil { return "", err } f, err := os.Open(ovf) if err != nil { return "", err } defer f.Close() data, err := ioutil.ReadAll(f) if err != nil { return "", err } re := regexp.MustCompile(`<Adapter slot="0".+?MACAddress="(.+?)"`) matches := re.FindSubmatch(data) if matches == nil { return "", errors.New("can't find base mac address in OVF") } log.Printf("Base mac address: %s", string(matches[1])) return string(matches[1]), nil } // DecompressOva takes an ova file and decompresses it into the target // directory. func DecompressOva(dir, src string) error { log.Printf("Turning ova to dir: %s => %s", src, dir) srcF, err := os.Open(src) if err != nil { return err } defer srcF.Close() tarReader := tar.NewReader(srcF) for { hdr, err := tarReader.Next() if hdr == nil || err == io.EOF { break } if err != nil { return err } // We use the fileinfo to get the file name because we are not // expecting path information as from the tar header. It's important // that we not use the path name from the tar header without checking // for the presence of `..`. If we accidentally allow for that, we can // open ourselves up to a path traversal vulnerability. info := hdr.FileInfo() // Shouldn't be any directories, skip them if info.IsDir() { continue } // We wrap this in an anonymous function so that the defers // inside are handled more quickly so we can give up file handles. err = func() error { path := filepath.Join(dir, info.Name()) output, err := os.Create(path) if err != nil { return err } defer output.Close() os.Chmod(path, info.Mode()) os.Chtimes(path, hdr.AccessTime, hdr.ModTime) _, err = io.Copy(output, tarReader) return err }() if err != nil { return err } } return nil } var vboxVagrantfile = ` Vagrant.configure("2") do |config| config.vm.base_mac = "%s" end ` ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/virtualbox_test.go������������������������������������������0000664�0000000�0000000�00000001242�13771713062�0023713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "os" "path/filepath" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/stretchr/testify/assert" ) func TestVBoxProvider_impl(t *testing.T) { var _ Provider = new(VBoxProvider) } func TestDecomressOVA(t *testing.T) { td, err := tmp.Dir("pp-vagrant-virtualbox") assert.NoError(t, err) defer os.RemoveAll(td) fixture := "../../packer-plugin-sdk/test-fixtures/decompress-tar/outside_parent.tar" err = DecompressOva(td, fixture) assert.NoError(t, err) _, err = os.Stat(filepath.Join(filepath.Base(td), "demo.poc")) assert.Error(t, err) _, err = os.Stat(filepath.Join(td, "demo.poc")) assert.NoError(t, err) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/vmware.go���������������������������������������������������0000664�0000000�0000000�00000001365�13771713062�0021764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "fmt" "path/filepath" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type VMwareProvider struct{} func (p *VMwareProvider) KeepInputArtifact() bool { return false } func (p *VMwareProvider) Process(ui packersdk.Ui, artifact packersdk.Artifact, dir string) (vagrantfile string, metadata map[string]interface{}, err error) { // Create the metadata metadata = map[string]interface{}{"provider": "vmware_desktop"} // Copy all of the original contents into the temporary directory for _, path := range artifact.Files() { ui.Message(fmt.Sprintf("Copying: %s", path)) dstPath := filepath.Join(dir, filepath.Base(path)) if err = CopyContents(dstPath, path); err != nil { return } } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vagrant/vmware_test.go����������������������������������������������0000664�0000000�0000000�00000000175�13771713062�0023021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vagrant import ( "testing" ) func TestVMwareProvider_impl(t *testing.T) { var _ Provider = new(VMwareProvider) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021752�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/post-processor.go����������������������������������0000664�0000000�0000000�00000011622�13771713062�0025305�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package vsphere_template import ( "context" "errors" "fmt" "net/url" "strings" "time" "github.com/hashicorp/hcl/v2/hcldec" vmwcommon "github.com/hashicorp/packer/builder/vmware/common" vsphere "github.com/hashicorp/packer/builder/vsphere/common" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/post-processor/artifice" vspherepost "github.com/hashicorp/packer/post-processor/vsphere" "github.com/vmware/govmomi" ) var builtins = map[string]string{ vspherepost.BuilderId: "vmware", vmwcommon.BuilderIdESX: "vmware", vsphere.BuilderId: "vsphere", artifice.BuilderId: "artifice", } type Config struct { common.PackerConfig `mapstructure:",squash"` Host string `mapstructure:"host"` Insecure bool `mapstructure:"insecure"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` Datacenter string `mapstructure:"datacenter"` Folder string `mapstructure:"folder"` SnapshotEnable bool `mapstructure:"snapshot_enable"` SnapshotName string `mapstructure:"snapshot_name"` SnapshotDescription string `mapstructure:"snapshot_description"` ReregisterVM config.Trilean `mapstructure:"reregister_vm"` ctx interpolate.Context } type PostProcessor struct { config Config url *url.URL } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: vsphere.BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } errs := new(packersdk.MultiError) vc := map[string]*string{ "host": &p.config.Host, "username": &p.config.Username, "password": &p.config.Password, } for key, ptr := range vc { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } if p.config.Folder != "" && !strings.HasPrefix(p.config.Folder, "/") { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Folder must be bound to the root")) } sdk, err := url.Parse(fmt.Sprintf("https://%v/sdk", p.config.Host)) if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error invalid vSphere sdk endpoint: %s", err)) return errs } sdk.User = url.UserPassword(p.config.Username, p.config.Password) p.url = sdk if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { if _, ok := builtins[artifact.BuilderId()]; !ok { return nil, false, false, fmt.Errorf("The Packer vSphere Template post-processor "+ "can only take an artifact from the VMware-iso builder, built on "+ "ESXi (i.e. remote) or an artifact from the vSphere post-processor. "+ "Artifact type %s does not fit this requirement", artifact.BuilderId()) } f := artifact.State(vmwcommon.ArtifactConfFormat) k := artifact.State(vmwcommon.ArtifactConfKeepRegistered) s := artifact.State(vmwcommon.ArtifactConfSkipExport) if f != "" && k != "true" && s == "false" { return nil, false, false, errors.New("To use this post-processor with exporting behavior you need set keep_registered as true") } // In some occasions the VM state is powered on and if we immediately try to mark as template // (after the ESXi creates it) it will fail. If vSphere is given a few seconds this behavior doesn't reappear. ui.Message("Waiting 10s for VMware vSphere to start") time.Sleep(10 * time.Second) c, err := govmomi.NewClient(context.Background(), p.url, p.config.Insecure) if err != nil { return nil, false, false, fmt.Errorf("Error connecting to vSphere: %s", err) } defer c.Logout(context.Background()) state := new(multistep.BasicStateBag) state.Put("ui", ui) state.Put("client", c) steps := []multistep.Step{ &stepChooseDatacenter{ Datacenter: p.config.Datacenter, }, &stepCreateFolder{ Folder: p.config.Folder, }, NewStepCreateSnapshot(artifact, p), NewStepMarkAsTemplate(artifact, p), } runner := commonsteps.NewRunnerWithPauseFn(steps, p.config.PackerConfig, ui, state) runner.Run(ctx, state) if rawErr, ok := state.GetOk("error"); ok { return nil, false, false, rawErr.(error) } return artifact, true, true, nil } ��������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/post-processor.hcl2spec.go�������������������������0000664�0000000�0000000�00000011452�13771713062�0027010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package vsphere_template import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Host *string `mapstructure:"host" cty:"host" hcl:"host"` Insecure *bool `mapstructure:"insecure" cty:"insecure" hcl:"insecure"` Username *string `mapstructure:"username" cty:"username" hcl:"username"` Password *string `mapstructure:"password" cty:"password" hcl:"password"` Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` Folder *string `mapstructure:"folder" cty:"folder" hcl:"folder"` SnapshotEnable *bool `mapstructure:"snapshot_enable" cty:"snapshot_enable" hcl:"snapshot_enable"` SnapshotName *string `mapstructure:"snapshot_name" cty:"snapshot_name" hcl:"snapshot_name"` SnapshotDescription *string `mapstructure:"snapshot_description" cty:"snapshot_description" hcl:"snapshot_description"` ReregisterVM *bool `mapstructure:"reregister_vm" cty:"reregister_vm" hcl:"reregister_vm"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, "insecure": &hcldec.AttrSpec{Name: "insecure", Type: cty.Bool, Required: false}, "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, "folder": &hcldec.AttrSpec{Name: "folder", Type: cty.String, Required: false}, "snapshot_enable": &hcldec.AttrSpec{Name: "snapshot_enable", Type: cty.Bool, Required: false}, "snapshot_name": &hcldec.AttrSpec{Name: "snapshot_name", Type: cty.String, Required: false}, "snapshot_description": &hcldec.AttrSpec{Name: "snapshot_description", Type: cty.String, Required: false}, "reregister_vm": &hcldec.AttrSpec{Name: "reregister_vm", Type: cty.Bool, Required: false}, } return s } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/post-processor_test.go�����������������������������0000664�0000000�0000000�00000001142�13771713062�0026340�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere_template import ( "testing" ) func getTestConfig() Config { return Config{ Username: "me", Password: "notpassword", Host: "myhost", } } func TestConfigure_Good(t *testing.T) { var p PostProcessor config := getTestConfig() err := p.Configure(config) if err != nil { t.Errorf("Error: %s", err) } } func TestConfigure_ReRegisterVM(t *testing.T) { var p PostProcessor config := getTestConfig() err := p.Configure(config) if err != nil { t.Errorf("Error: %s", err) } if p.config.ReregisterVM.False() { t.Errorf("This should default to unset, not false.") } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/step_choose_datacenter.go��������������������������0000664�0000000�0000000�00000001563�13771713062�0027013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere_template import ( "context" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi" "github.com/vmware/govmomi/find" ) type stepChooseDatacenter struct { Datacenter string } func (s *stepChooseDatacenter) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) cli := state.Get("client").(*govmomi.Client) finder := find.NewFinder(cli.Client, false) ui.Message("Choosing datacenter...") dc, err := finder.DatacenterOrDefault(context.Background(), s.Datacenter) if err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } state.Put("dcPath", dc.InventoryPath) return multistep.ActionContinue } func (s *stepChooseDatacenter) Cleanup(multistep.StateBag) {} ���������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/step_create_folder.go������������������������������0000664�0000000�0000000�00000004200�13771713062�0026126�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere_template import ( "context" "fmt" "path" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" ) type stepCreateFolder struct { Folder string } func (s *stepCreateFolder) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) cli := state.Get("client").(*govmomi.Client) dcPath := state.Get("dcPath").(string) ui.Message("Creating or checking destination folders...") base := path.Join(dcPath, "vm") fullPath := path.Join(base, s.Folder) si := object.NewSearchIndex(cli.Client) var folders []string var err error var ref object.Reference // We iterate over the path starting with full path // If we don't find it, we save the folder name and continue with the previous path // The iteration ends when we find an existing path otherwise it throws error for { ref, err = si.FindByInventoryPath(context.Background(), fullPath) if err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } if ref == nil { dir, folder := path.Split(fullPath) fullPath = path.Clean(dir) if fullPath == dcPath { err = fmt.Errorf("vSphere base path %s not found", base) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } folders = append(folders, folder) } else { break } } if root, ok := ref.(*object.Folder); ok { for i := len(folders) - 1; i >= 0; i-- { ui.Message(fmt.Sprintf("Creating folder: %v", folders[i])) root, err = root.CreateFolder(context.Background(), folders[i]) if err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } fullPath = path.Join(fullPath, folders[i]) } root.SetInventoryPath(fullPath) state.Put("folder", root) } else { err = fmt.Errorf("folder not found: '%v'", ref) state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } return multistep.ActionContinue } func (s *stepCreateFolder) Cleanup(multistep.StateBag) {} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/step_create_snapshot.go����������������������������0000664�0000000�0000000�00000003621�13771713062�0026520�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere_template import ( "context" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/post-processor/vsphere" "github.com/vmware/govmomi" ) type stepCreateSnapshot struct { VMName string RemoteFolder string SnapshotName string SnapshotDescription string SnapshotEnable bool } func NewStepCreateSnapshot(artifact packersdk.Artifact, p *PostProcessor) *stepCreateSnapshot { remoteFolder := "Discovered virtual machine" vmname := artifact.Id() if artifact.BuilderId() == vsphere.BuilderId { id := strings.Split(artifact.Id(), "::") remoteFolder = id[1] vmname = id[2] } return &stepCreateSnapshot{ VMName: vmname, RemoteFolder: remoteFolder, SnapshotEnable: p.config.SnapshotEnable, SnapshotName: p.config.SnapshotName, SnapshotDescription: p.config.SnapshotDescription, } } func (s *stepCreateSnapshot) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) cli := state.Get("client").(*govmomi.Client) dcPath := state.Get("dcPath").(string) if !s.SnapshotEnable { return multistep.ActionContinue } ui.Message("Creating a Snapshot...") vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder) if err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } task, err := vm.CreateSnapshot(context.Background(), s.SnapshotName, s.SnapshotDescription, false, false) if err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } if err = task.Wait(context.Background()); err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } return multistep.ActionContinue } func (s *stepCreateSnapshot) Cleanup(multistep.StateBag) {} ���������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/step_mark_as_template.go���������������������������0000664�0000000�0000000�00000011353�13771713062�0026647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere_template import ( "context" "fmt" "path" "regexp" "strings" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/post-processor/vsphere" "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/types" ) type stepMarkAsTemplate struct { VMName string RemoteFolder string ReregisterVM config.Trilean } func NewStepMarkAsTemplate(artifact packersdk.Artifact, p *PostProcessor) *stepMarkAsTemplate { remoteFolder := "Discovered virtual machine" vmname := artifact.Id() if artifact.BuilderId() == vsphere.BuilderId { id := strings.Split(artifact.Id(), "::") remoteFolder = id[1] vmname = id[2] } return &stepMarkAsTemplate{ VMName: vmname, RemoteFolder: remoteFolder, ReregisterVM: p.config.ReregisterVM, } } func (s *stepMarkAsTemplate) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) cli := state.Get("client").(*govmomi.Client) folder := state.Get("folder").(*object.Folder) dcPath := state.Get("dcPath").(string) vm, err := findRuntimeVM(cli, dcPath, s.VMName, s.RemoteFolder) if err != nil { state.Put("error", err) ui.Error(err.Error()) return multistep.ActionHalt } // Use a simple "MarkAsTemplate" method unless `reregister_vm` is true if s.ReregisterVM.False() { ui.Message("Marking as a template...") if err := vm.MarkAsTemplate(context.Background()); err != nil { state.Put("error", err) ui.Error("vm.MarkAsTemplate:" + err.Error()) return multistep.ActionHalt } return multistep.ActionContinue } ui.Message("Re-register VM as a template...") dsPath, err := datastorePath(vm) if err != nil { state.Put("error", err) ui.Error("datastorePath:" + err.Error()) return multistep.ActionHalt } host, err := vm.HostSystem(context.Background()) if err != nil { state.Put("error", err) ui.Error("vm.HostSystem:" + err.Error()) return multistep.ActionHalt } if err := vm.Unregister(context.Background()); err != nil { state.Put("error", err) ui.Error("vm.Unregister:" + err.Error()) return multistep.ActionHalt } if err := unregisterPreviousVM(cli, folder, s.VMName); err != nil { state.Put("error", err) ui.Error("unregisterPreviousVM:" + err.Error()) return multistep.ActionHalt } task, err := folder.RegisterVM(context.Background(), dsPath.String(), s.VMName, true, nil, host) if err != nil { state.Put("error", err) ui.Error("RegisterVM:" + err.Error()) return multistep.ActionHalt } if err = task.Wait(context.Background()); err != nil { state.Put("error", err) ui.Error("task.Wait:" + err.Error()) return multistep.ActionHalt } return multistep.ActionContinue } func datastorePath(vm *object.VirtualMachine) (*object.DatastorePath, error) { devices, err := vm.Device(context.Background()) if err != nil { return nil, err } disk := "" for _, device := range devices { if d, ok := device.(*types.VirtualDisk); ok { if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { disk = b.GetVirtualDeviceFileBackingInfo().FileName } break } } if disk == "" { return nil, fmt.Errorf("disk not found in '%v'", vm.Name()) } re := regexp.MustCompile("\\[(.*?)\\]") datastore := re.FindStringSubmatch(disk)[1] vmxPath := path.Join("/", path.Dir(strings.Split(disk, " ")[1]), vm.Name()+".vmx") return &object.DatastorePath{ Datastore: datastore, Path: vmxPath, }, nil } func findRuntimeVM(cli *govmomi.Client, dcPath, name, remoteFolder string) (*object.VirtualMachine, error) { si := object.NewSearchIndex(cli.Client) fullPath := path.Join(dcPath, "vm", remoteFolder, name) ref, err := si.FindByInventoryPath(context.Background(), fullPath) if err != nil { return nil, err } if ref == nil { return nil, fmt.Errorf("VM at path %s not found", fullPath) } vm := ref.(*object.VirtualMachine) if vm.InventoryPath == "" { vm.SetInventoryPath(fullPath) } return vm, nil } // If in the target folder a virtual machine or template already exists // it will be removed to maintain consistency func unregisterPreviousVM(cli *govmomi.Client, folder *object.Folder, name string) error { si := object.NewSearchIndex(cli.Client) fullPath := path.Join(folder.InventoryPath, name) ref, err := si.FindByInventoryPath(context.Background(), fullPath) if err != nil { return err } if ref != nil { if vm, ok := ref.(*object.VirtualMachine); ok { return vm.Unregister(context.Background()) } else { return fmt.Errorf("an object name '%v' already exists", name) } } return nil } func (s *stepMarkAsTemplate) Cleanup(multistep.StateBag) {} �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/version/�������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023437�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere-template/version/version.go���������������������������������0000664�0000000�0000000�00000000535�13771713062�0025456�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var VSphereTemplatePostprocessorVersion *version.PluginVersion func init() { VSphereTemplatePostprocessorVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020141�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/artifact.go�������������������������������������������������0000664�0000000�0000000�00000001520�13771713062�0022263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere import ( "fmt" ) const BuilderId = "packer.post-processor.vsphere" type Artifact struct { files []string datastore string vmfolder string vmname string } func NewArtifact(datastore, vmfolder, vmname string, files []string) *Artifact { return &Artifact{ files: files, datastore: datastore, vmfolder: vmfolder, vmname: vmname, } } func (*Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Files() []string { return a.files } func (a *Artifact) Id() string { return fmt.Sprintf("%s::%s::%s", a.datastore, a.vmfolder, a.vmname) } func (a *Artifact) String() string { return fmt.Sprintf("VM: %s Folder: %s Datastore: %s", a.vmname, a.vmfolder, a.datastore) } func (*Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/artifact_test.go��������������������������������������������0000664�0000000�0000000�00000001025�13771713062�0023322�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestArtifact_ImplementsArtifact(t *testing.T) { var raw interface{} raw = &Artifact{} if _, ok := raw.(packersdk.Artifact); !ok { t.Fatalf("Artifact should be a Artifact") } } func TestArtifact_Id(t *testing.T) { artifact := NewArtifact("datastore", "vmfolder", "vmname", nil) if artifact.Id() != "datastore::vmfolder::vmname" { t.Fatalf("must return datastore, vmfolder and vmname splitted by :: as Id") } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/post-processor.go�������������������������������������������0000664�0000000�0000000�00000017324�13771713062�0023501�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package vsphere import ( "bytes" "context" "fmt" "log" "net/url" "os/exec" "regexp" "runtime" "strings" "time" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" shelllocal "github.com/hashicorp/packer/packer-plugin-sdk/shell-local" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) var ovftool string = "ovftool" var ( // Regular expression to validate RFC1035 hostnames from full fqdn or simple hostname. // For example "packer-esxi1". Requires proper DNS setup and/or correct DNS search domain setting. hostnameRegex = regexp.MustCompile(`^[[:alnum:]][[:alnum:]\-]{0,61}[[:alnum:]]|[[:alpha:]]$`) // Simple regular expression to validate IPv4 values. // For example "192.168.1.1". ipv4Regex = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`) ) type Config struct { common.PackerConfig `mapstructure:",squash"` Cluster string `mapstructure:"cluster"` Datacenter string `mapstructure:"datacenter"` Datastore string `mapstructure:"datastore"` DiskMode string `mapstructure:"disk_mode"` Host string `mapstructure:"host"` ESXiHost string `mapstructure:"esxi_host"` Insecure bool `mapstructure:"insecure"` Options []string `mapstructure:"options"` Overwrite bool `mapstructure:"overwrite"` Password string `mapstructure:"password"` ResourcePool string `mapstructure:"resource_pool"` Username string `mapstructure:"username"` VMFolder string `mapstructure:"vm_folder"` VMName string `mapstructure:"vm_name"` VMNetwork string `mapstructure:"vm_network"` ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } // Defaults if p.config.DiskMode == "" { p.config.DiskMode = "thick" } // Accumulate any errors errs := new(packersdk.MultiError) if runtime.GOOS == "windows" { ovftool = "ovftool.exe" } if _, err := exec.LookPath(ovftool); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("ovftool not found: %s", err)) } // First define all our templatable parameters that are _required_ templates := map[string]*string{ "cluster": &p.config.Cluster, "datacenter": &p.config.Datacenter, "diskmode": &p.config.DiskMode, "host": &p.config.Host, "password": &p.config.Password, "username": &p.config.Username, "vm_name": &p.config.VMName, } for key, ptr := range templates { if *ptr == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("%s must be set", key)) } } if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) generateURI() (*url.URL, error) { // use net/url lib to encode and escape url elements ovftool_uri := fmt.Sprintf("vi://%s/%s/host/%s", p.config.Host, p.config.Datacenter, p.config.Cluster) if p.config.ResourcePool != "" { ovftool_uri += "/Resources/" + p.config.ResourcePool } u, err := url.Parse(ovftool_uri) if err != nil { return nil, fmt.Errorf("Couldn't generate uri for ovftool: %s", err) } u.User = url.UserPassword(p.config.Username, p.config.Password) if p.config.ESXiHost != "" { q := u.Query() if ipv4Regex.MatchString(p.config.ESXiHost) { q.Add("ip", p.config.ESXiHost) } else if hostnameRegex.MatchString(p.config.ESXiHost) { q.Add("dns", p.config.ESXiHost) } u.RawQuery = q.Encode() } return u, nil } func getEncodedPassword(u *url.URL) (string, bool) { // filter password from all logging password, passwordSet := u.User.Password() if passwordSet && password != "" { encodedPassword := strings.Split(u.User.String(), ":")[1] return encodedPassword, true } return password, false } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { source := "" for _, path := range artifact.Files() { if strings.HasSuffix(path, ".vmx") || strings.HasSuffix(path, ".ovf") || strings.HasSuffix(path, ".ova") { source = path break } } if source == "" { return nil, false, false, fmt.Errorf("VMX, OVF or OVA file not found") } ovftool_uri, err := p.generateURI() if err != nil { return nil, false, false, err } encodedPassword, isSet := getEncodedPassword(ovftool_uri) if isSet { packersdk.LogSecretFilter.Set(encodedPassword) } args, err := p.BuildArgs(source, ovftool_uri.String()) if err != nil { ui.Message(fmt.Sprintf("Failed: %s\n", err)) } ui.Message(fmt.Sprintf("Uploading %s to vSphere", source)) log.Printf("Starting ovftool with parameters: %s", strings.Join(args, " ")) ui.Message("Validating Username and Password with dry-run") err = p.ValidateOvfTool(args, ovftool) if err != nil { return nil, false, false, err } // Validation has passed, so run for real. ui.Message("Calling OVFtool to upload vm") commandAndArgs := []string{ovftool} commandAndArgs = append(commandAndArgs, args...) comm := &shelllocal.Communicator{ ExecuteCommand: commandAndArgs, } flattenedCmd := strings.Join(commandAndArgs, " ") cmd := &packersdk.RemoteCmd{Command: flattenedCmd} log.Printf("[INFO] (vsphere): starting ovftool command: %s", flattenedCmd) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return nil, false, false, fmt.Errorf( "Error uploading virtual machine: Please see output above for more information.") } artifact = NewArtifact(p.config.Datastore, p.config.VMFolder, p.config.VMName, artifact.Files()) return artifact, false, false, nil } func (p *PostProcessor) ValidateOvfTool(args []string, ofvtool string) error { args = append([]string{"--verifyOnly"}, args...) var out bytes.Buffer cmdCtx, cancel := context.WithTimeout(context.Background(), 20*time.Second) defer cancel() cmd := exec.CommandContext(cmdCtx, ovftool, args...) cmd.Stdout = &out // Need to manually close stdin or else the ofvtool call will hang // forever in a situation where the user has provided an invalid // password or username stdin, err := cmd.StdinPipe() if err != nil { return err } defer stdin.Close() if err := cmd.Run(); err != nil { outString := out.String() if strings.Contains(outString, "Enter login information for") { err = fmt.Errorf("Error performing OVFtool dry run; the username " + "or password you provided to ovftool is likely invalid.") return err } return nil } return nil } func (p *PostProcessor) BuildArgs(source, ovftool_uri string) ([]string, error) { args := []string{ "--acceptAllEulas", fmt.Sprintf(`--name=%s`, p.config.VMName), fmt.Sprintf(`--datastore=%s`, p.config.Datastore), } if p.config.Insecure { args = append(args, fmt.Sprintf(`--noSSLVerify=%t`, p.config.Insecure)) } if p.config.DiskMode != "" { args = append(args, fmt.Sprintf(`--diskMode=%s`, p.config.DiskMode)) } if p.config.VMFolder != "" { args = append(args, fmt.Sprintf(`--vmFolder=%s`, p.config.VMFolder)) } if p.config.VMNetwork != "" { args = append(args, fmt.Sprintf(`--network=%s`, p.config.VMNetwork)) } if p.config.Overwrite == true { args = append(args, "--overwrite") } if len(p.config.Options) > 0 { args = append(args, p.config.Options...) } args = append(args, source) args = append(args, ovftool_uri) return args, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/post-processor.hcl2spec.go����������������������������������0000664�0000000�0000000�00000013303�13771713062�0025174�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package vsphere import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Cluster *string `mapstructure:"cluster" cty:"cluster" hcl:"cluster"` Datacenter *string `mapstructure:"datacenter" cty:"datacenter" hcl:"datacenter"` Datastore *string `mapstructure:"datastore" cty:"datastore" hcl:"datastore"` DiskMode *string `mapstructure:"disk_mode" cty:"disk_mode" hcl:"disk_mode"` Host *string `mapstructure:"host" cty:"host" hcl:"host"` ESXiHost *string `mapstructure:"esxi_host" cty:"esxi_host" hcl:"esxi_host"` Insecure *bool `mapstructure:"insecure" cty:"insecure" hcl:"insecure"` Options []string `mapstructure:"options" cty:"options" hcl:"options"` Overwrite *bool `mapstructure:"overwrite" cty:"overwrite" hcl:"overwrite"` Password *string `mapstructure:"password" cty:"password" hcl:"password"` ResourcePool *string `mapstructure:"resource_pool" cty:"resource_pool" hcl:"resource_pool"` Username *string `mapstructure:"username" cty:"username" hcl:"username"` VMFolder *string `mapstructure:"vm_folder" cty:"vm_folder" hcl:"vm_folder"` VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` VMNetwork *string `mapstructure:"vm_network" cty:"vm_network" hcl:"vm_network"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "cluster": &hcldec.AttrSpec{Name: "cluster", Type: cty.String, Required: false}, "datacenter": &hcldec.AttrSpec{Name: "datacenter", Type: cty.String, Required: false}, "datastore": &hcldec.AttrSpec{Name: "datastore", Type: cty.String, Required: false}, "disk_mode": &hcldec.AttrSpec{Name: "disk_mode", Type: cty.String, Required: false}, "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, "esxi_host": &hcldec.AttrSpec{Name: "esxi_host", Type: cty.String, Required: false}, "insecure": &hcldec.AttrSpec{Name: "insecure", Type: cty.Bool, Required: false}, "options": &hcldec.AttrSpec{Name: "options", Type: cty.List(cty.String), Required: false}, "overwrite": &hcldec.AttrSpec{Name: "overwrite", Type: cty.Bool, Required: false}, "password": &hcldec.AttrSpec{Name: "password", Type: cty.String, Required: false}, "resource_pool": &hcldec.AttrSpec{Name: "resource_pool", Type: cty.String, Required: false}, "username": &hcldec.AttrSpec{Name: "username", Type: cty.String, Required: false}, "vm_folder": &hcldec.AttrSpec{Name: "vm_folder", Type: cty.String, Required: false}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "vm_network": &hcldec.AttrSpec{Name: "vm_network", Type: cty.String, Required: false}, } return s } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/post-processor_test.go��������������������������������������0000664�0000000�0000000�00000006300�13771713062�0024530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package vsphere import ( "fmt" "net/url" "strings" "testing" ) func getTestConfig() Config { return Config{ Username: "me", Password: "notpassword", Host: "myhost", Datacenter: "mydc", Cluster: "mycluster", VMName: "my vm", Datastore: "my datastore", Insecure: true, DiskMode: "thin", VMFolder: "my folder", } } func TestArgs(t *testing.T) { var p PostProcessor p.config = getTestConfig() source := "something.vmx" ovftool_uri := fmt.Sprintf("vi://%s:%s@%s/%s/host/%s", url.QueryEscape(p.config.Username), url.QueryEscape(p.config.Password), p.config.Host, p.config.Datacenter, p.config.Cluster) if p.config.ResourcePool != "" { ovftool_uri += "/Resources/" + p.config.ResourcePool } args, err := p.BuildArgs(source, ovftool_uri) if err != nil { t.Errorf("Error: %s", err) } t.Logf("ovftool %s", strings.Join(args, " ")) } func TestGenerateURI_Basic(t *testing.T) { var p PostProcessor p.config = getTestConfig() uri, err := p.generateURI() if err != nil { t.Fatalf("had error: %s", err) } expected_uri := "vi://me:notpassword@myhost/mydc/host/mycluster" if uri.String() != expected_uri { t.Fatalf("URI did not match. Recieved: %s. Expected: %s", uri, expected_uri) } } func TestGenerateURI_PasswordEscapes(t *testing.T) { type escapeCases struct { Input string Expected string } cases := []escapeCases{ {`this has spaces`, `this%20has%20spaces`}, {`exclaimation_!`, `exclaimation_%21`}, {`hash_#_dollar_$`, `hash_%23_dollar_$`}, {`ampersand_&awesome`, `ampersand_&awesome`}, {`single_quote_'_and_another_'`, `single_quote_%27_and_another_%27`}, {`open_paren_(_close_paren_)`, `open_paren_%28_close_paren_%29`}, {`asterisk_*_plus_+`, `asterisk_%2A_plus_+`}, {`comma_,slash_/`, `comma_,slash_%2F`}, {`colon_:semicolon_;`, `colon_%3Asemicolon_;`}, {`equal_=question_?`, `equal_=question_%3F`}, {`at_@`, `at_%40`}, {`open_bracket_[closed_bracket]`, `open_bracket_%5Bclosed_bracket%5D`}, {`user:password with $paces@host/name.foo`, `user%3Apassword%20with%20$paces%40host%2Fname.foo`}, } for _, escapeCase := range cases { var p PostProcessor p.config = getTestConfig() p.config.Password = escapeCase.Input uri, err := p.generateURI() if err != nil { t.Fatalf("had error: %s", err) } expected_uri := fmt.Sprintf("vi://me:%s@myhost/mydc/host/mycluster", escapeCase.Expected) if uri.String() != expected_uri { t.Fatalf("URI did not match. Recieved: %s. Expected: %s", uri, expected_uri) } } } func TestGetEncodedPassword(t *testing.T) { // Password is encoded, and contains a colon ovftool_uri := fmt.Sprintf("vi://hostname/Datacenter/host/cluster") u, _ := url.Parse(ovftool_uri) u.User = url.UserPassword("us:ername", "P@ssW:rd") encoded, isSet := getEncodedPassword(u) expected := "P%40ssW%3Ard" if !isSet { t.Fatalf("Password is set but test said it is not") } if encoded != expected { t.Fatalf("Should have successfully gotten encoded password. Expected: %s; recieved: %s", expected, encoded) } // There is no password u.User = url.UserPassword("us:ername", "") _, isSet = getEncodedPassword(u) if isSet { t.Fatalf("Should have determined that password was not set") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/version/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021626�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/vsphere/version/version.go������������������������������������������0000664�0000000�0000000�00000000515�13771713062�0023643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var VSpherePostprocessorVersion *version.PluginVersion func init() { VSpherePostprocessorVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021274�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/artifact.go�������������������������������������������0000664�0000000�0000000�00000001143�13771713062�0023417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandexexport import ( "fmt" ) const BuilderId = "packer.post-processor.yandex-export" type Artifact struct { paths []string urls []string } func (*Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Id() string { return a.urls[0] } func (a *Artifact) Files() []string { pathsCopy := make([]string, len(a.paths)) copy(pathsCopy, a.paths) return pathsCopy } func (a *Artifact) String() string { return fmt.Sprintf("Exported artifacts in: %s", a.paths) } func (*Artifact) State(name string) interface{} { return nil } func (a *Artifact) Destroy() error { return nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/cloud-init-script.go����������������������������������0000664�0000000�0000000�00000003610�13771713062�0025174�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// CODE GENERATED. DO NOT EDIT package yandexexport var ( CloudInitScript = `#!/usr/bin/env bash GetMetadata() { curl -f -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/attributes/$1 2>/dev/null } [[ "$(GetMetadata debug)" == "1" || "$(GetMetadata debug)" == "true" ]] && set -x InstallPackages() { sudo apt-get update -qq && sudo apt-get install -y qemu-utils awscli } WaitFile() { local RETRIES=60 while [[ ${RETRIES} -gt 0 ]]; do echo "Wait ${1}" if [ -e "${1}" ]; then echo "[${1}] has been found" return 0 fi RETRIES=$((RETRIES-1)) sleep 5 done echo "[${1}] not found" return 1 } PATHS=$(GetMetadata paths) S3_ENDPOINT="https://storage.yandexcloud.net" DISK_EXPORT_PATH="/dev/disk/by-id/virtio-doexport" export AWS_SHARED_CREDENTIALS_FILE="/tmp/aws-credentials" export AWS_REGION=ru-central1 Exit() { for i in ${PATHS}; do LOGDEST="${i}.exporter.log" echo "Uploading exporter log to ${LOGDEST}..." aws s3 --endpoint-url="${S3_ENDPOINT}" cp /var/log/syslog "${LOGDEST}" done exit $1 } InstallPackages echo "####### Export configuration #######" echo "Export paths - ${PATHS}" echo "####################################" if ! WaitFile "${AWS_SHARED_CREDENTIALS_FILE}"; then echo "Failed wait credentials" Exit 1 fi udevadm trigger || true if ! WaitFile "${DISK_EXPORT_PATH}"; then echo "Failed wait attach disk" Exit 1 fi echo "Dumping disk..." if ! qemu-img convert -O qcow2 -o cluster_size=2M "${DISK_EXPORT_PATH}" disk.qcow2; then echo "Failed to dump disk to qcow2 image." Exit 1 fi for i in ${PATHS}; do echo "Uploading qcow2 disk image to ${i}..." if ! aws s3 --endpoint-url="${S3_ENDPOINT}" cp disk.qcow2 "${i}"; then echo "Failed to upload image to ${i}." FAIL=1 fi done Exit ${FAIL} ` ) ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/config.go���������������������������������������������0000664�0000000�0000000�00000001171�13771713062�0023070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown package yandexexport import ( "fmt" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type ExchangeConfig struct { // Service Account ID with proper permission to modify an instance, create and attach disk and // make upload to specific Yandex Object Storage paths. ServiceAccountID string `mapstructure:"service_account_id" required:"true"` } func (c *ExchangeConfig) Prepare(errs *packersdk.MultiError) *packersdk.MultiError { if c.ServiceAccountID == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("service_account_id must be specified")) } return errs } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/post-processor.go�������������������������������������0000664�0000000�0000000�00000022321�13771713062�0024625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type Config //go:generate go run ./scripts/script-to-var.go ./scripts/export.sh CloudInitScript cloud-init-script.go package yandexexport import ( "context" "fmt" "log" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/yandex" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/communicator" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/packerbuilderdata" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/post-processor/artifice" "github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1" ycsdk "github.com/yandex-cloud/go-sdk" ) const ( defaultStorageEndpoint = "storage.yandexcloud.net" defaultStorageRegion = "ru-central1" ) type Config struct { common.PackerConfig `mapstructure:",squash"` yandex.AccessConfig `mapstructure:",squash"` yandex.CommonConfig `mapstructure:",squash"` ExchangeConfig `mapstructure:",squash"` // List of paths to Yandex Object Storage where exported image will be uploaded. // Please be aware that use of space char inside path not supported. // Also this param support [build](/docs/templates/engine) template function. // Check available template data for [Yandex](/docs/builders/yandex#build-template-data) builder. // Paths to Yandex Object Storage where exported image will be uploaded. Paths []string `mapstructure:"paths" required:"true"` // Path to a PEM encoded private key file to use to authenticate with SSH. // The `~` can be used in path and will be expanded to the home directory // of current user. Login for attach: `ubuntu` SSHPrivateKeyFile string `mapstructure:"ssh_private_key_file" required:"false"` // Number of attempts to wait for export (must be greater than 0). Default: 1000 Tries int `mapstructure:"tries" required:"false"` ctx interpolate.Context } type PostProcessor struct { config Config runner multistep.Runner } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "paths", }, }, }, raws...) if err != nil { return err } // Accumulate any errors var errs *packersdk.MultiError errs = packersdk.MultiErrorAppend(errs, p.config.AccessConfig.Prepare(&p.config.ctx)...) // Set defaults. if p.config.DiskSizeGb == 0 { p.config.DiskSizeGb = 100 } if p.config.Tries <= 0 { p.config.Tries = 1000 } errs = p.config.CommonConfig.Prepare(errs) errs = p.config.ExchangeConfig.Prepare(errs) if len(p.config.Paths) == 0 { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("paths must be specified")) } // Validate templates in 'paths' for _, path := range p.config.Paths { if err = interpolate.Validate(path, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error parsing one of 'paths' template: %s", err)) } } if len(errs.Errors) > 0 { return errs } // Due to the fact that now it's impossible to go to the object storage // through the internal network - we need access // to the global Internet: either through ipv4 or ipv6 // TODO: delete this when access appears if p.config.UseIPv4Nat == false && p.config.UseIPv6 == false { log.Printf("[DEBUG] Force use IPv4") p.config.UseIPv4Nat = true } p.config.Preemptible = true //? safety if p.config.Labels == nil { p.config.Labels = make(map[string]string) } if _, ok := p.config.Labels["role"]; !ok { p.config.Labels["role"] = "exporter" } if _, ok := p.config.Labels["target"]; !ok { p.config.Labels["target"] = "object-storage" } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { switch artifact.BuilderId() { case yandex.BuilderID, artifice.BuilderId: break default: err := fmt.Errorf( "Unknown artifact type: %s\nCan only export from Yandex Cloud builder artifact or Artifice post-processor artifact.", artifact.BuilderId()) return nil, false, false, err } // prepare and render values var generatedData map[interface{}]interface{} stateData := artifact.State("generated_data") if stateData != nil { // Make sure it's not a nil map so we can assign to it later. generatedData = stateData.(map[interface{}]interface{}) } // If stateData has a nil map generatedData will be nil // and we need to make sure it's not if generatedData == nil { generatedData = make(map[interface{}]interface{}) } p.config.ctx.Data = generatedData var err error // Render this key since we didn't in the configure phase for i, path := range p.config.Paths { p.config.Paths[i], err = interpolate.Render(path, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("Error rendering one of 'path' template: %s", err) } } log.Printf("Rendered path items: %v", p.config.Paths) imageID := artifact.State("ImageID").(string) ui.Say(fmt.Sprintf("Exporting image %v to destination: %v", imageID, p.config.Paths)) driver, err := yandex.NewDriverYC(ui, &p.config.AccessConfig) if err != nil { return nil, false, false, err } // Set up exporter instance configuration. exporterName := fmt.Sprintf("%s-exporter", artifact.Id()) yandexConfig := ycSaneDefaults(&p.config, map[string]string{ "image_id": imageID, "name": exporterName, "paths": strings.Join(p.config.Paths, " "), "user-data": CloudInitScript, "zone": p.config.Zone, }, ) if yandexConfig.InstanceConfig.InstanceName == "" { yandexConfig.InstanceConfig.InstanceName = exporterName } if yandexConfig.DiskName == "" { yandexConfig.DiskName = exporterName } errs := yandexConfig.Communicator.Prepare(interpolate.NewContext()) if len(errs) > 0 { err := &packersdk.MultiError{Errors: errs} return nil, false, false, err } ui.Say(fmt.Sprintf("Validating service_account_id: '%s'...", yandexConfig.ServiceAccountID)) if err := validateServiceAccount(ctx, driver.SDK(), yandexConfig.ServiceAccountID); err != nil { return nil, false, false, err } // Set up the state. state := new(multistep.BasicStateBag) state.Put("config", &yandexConfig) state.Put("driver", driver) state.Put("sdk", driver.SDK()) state.Put("ui", ui) // Build the steps. steps := []multistep.Step{ &StepCreateS3Keys{ ServiceAccountID: p.config.ServiceAccountID, Paths: p.config.Paths, }, &yandex.StepCreateSSHKey{ Debug: p.config.PackerDebug, DebugKeyPath: fmt.Sprintf("yc_export_pp_%s.pem", p.config.PackerBuildName), }, &yandex.StepCreateInstance{ Debug: p.config.PackerDebug, SerialLogFile: yandexConfig.SerialLogFile, GeneratedData: &packerbuilderdata.GeneratedData{State: state}, }, new(yandex.StepInstanceInfo), &communicator.StepConnect{ Config: &yandexConfig.Communicator, Host: yandex.CommHost, SSHConfig: yandexConfig.Communicator.SSHConfigFunc(), }, &StepAttachDisk{ CommonConfig: p.config.CommonConfig, ImageID: imageID, }, new(StepUploadSecrets), &StepWaitCloudInitScript{ Tries: p.config.Tries, }, &yandex.StepTeardownInstance{ SerialLogFile: yandexConfig.SerialLogFile, }, &commonsteps.StepCleanupTempKeys{Comm: &yandexConfig.Communicator}, } // Run the steps. p.runner = commonsteps.NewRunner(steps, p.config.PackerConfig, ui) p.runner.Run(ctx, state) if rawErr, ok := state.GetOk("error"); ok { return nil, false, false, rawErr.(error) } result := &Artifact{ paths: p.config.Paths, urls: formUrls(p.config.Paths), } return result, false, false, nil } func ycSaneDefaults(c *Config, md map[string]string) yandex.Config { yandexConfig := yandex.Config{ CommonConfig: c.CommonConfig, AccessConfig: c.AccessConfig, Communicator: communicator.Config{ Type: "ssh", SSH: communicator.SSH{ SSHUsername: "ubuntu", }, }, } if c.SSHPrivateKeyFile != "" { yandexConfig.Communicator.SSH.SSHPrivateKeyFile = c.SSHPrivateKeyFile } if yandexConfig.Metadata == nil { yandexConfig.Metadata = md } else { for k, v := range md { yandexConfig.Metadata[k] = v } } yandexConfig.SourceImageFamily = "ubuntu-1604-lts" yandexConfig.SourceImageFolderID = yandex.StandardImagesFolderID yandexConfig.ServiceAccountID = c.ServiceAccountID return yandexConfig } func formUrls(paths []string) []string { result := []string{} for _, path := range paths { url := fmt.Sprintf("https://%s/%s", defaultStorageEndpoint, strings.TrimPrefix(path, "s3://")) result = append(result, url) } return result } func validateServiceAccount(ctx context.Context, ycsdk *ycsdk.SDK, serviceAccountID string) error { _, err := ycsdk.IAM().ServiceAccount().Get(ctx, &iam.GetServiceAccountRequest{ ServiceAccountId: serviceAccountID, }) return err } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/post-processor.hcl2spec.go����������������������������0000664�0000000�0000000�00000022454�13771713062�0026336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package yandexexport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Endpoint *string `mapstructure:"endpoint" required:"false" cty:"endpoint" hcl:"endpoint"` ServiceAccountKeyFile *string `mapstructure:"service_account_key_file" required:"false" cty:"service_account_key_file" hcl:"service_account_key_file"` Token *string `mapstructure:"token" required:"true" cty:"token" hcl:"token"` MaxRetries *int `mapstructure:"max_retries" cty:"max_retries" hcl:"max_retries"` SerialLogFile *string `mapstructure:"serial_log_file" required:"false" cty:"serial_log_file" hcl:"serial_log_file"` StateTimeout *string `mapstructure:"state_timeout" required:"false" cty:"state_timeout" hcl:"state_timeout"` InstanceCores *int `mapstructure:"instance_cores" required:"false" cty:"instance_cores" hcl:"instance_cores"` InstanceGpus *int `mapstructure:"instance_gpus" required:"false" cty:"instance_gpus" hcl:"instance_gpus"` InstanceMemory *int `mapstructure:"instance_mem_gb" required:"false" cty:"instance_mem_gb" hcl:"instance_mem_gb"` InstanceName *string `mapstructure:"instance_name" required:"false" cty:"instance_name" hcl:"instance_name"` PlatformID *string `mapstructure:"platform_id" required:"false" cty:"platform_id" hcl:"platform_id"` Labels map[string]string `mapstructure:"labels" required:"false" cty:"labels" hcl:"labels"` Metadata map[string]string `mapstructure:"metadata" required:"false" cty:"metadata" hcl:"metadata"` MetadataFromFile map[string]string `mapstructure:"metadata_from_file" cty:"metadata_from_file" hcl:"metadata_from_file"` Preemptible *bool `mapstructure:"preemptible" cty:"preemptible" hcl:"preemptible"` DiskName *string `mapstructure:"disk_name" required:"false" cty:"disk_name" hcl:"disk_name"` DiskSizeGb *int `mapstructure:"disk_size_gb" required:"false" cty:"disk_size_gb" hcl:"disk_size_gb"` DiskType *string `mapstructure:"disk_type" required:"false" cty:"disk_type" hcl:"disk_type"` DiskLabels map[string]string `mapstructure:"disk_labels" required:"false" cty:"disk_labels" hcl:"disk_labels"` SubnetID *string `mapstructure:"subnet_id" required:"false" cty:"subnet_id" hcl:"subnet_id"` Zone *string `mapstructure:"zone" required:"false" cty:"zone" hcl:"zone"` UseIPv4Nat *bool `mapstructure:"use_ipv4_nat" required:"false" cty:"use_ipv4_nat" hcl:"use_ipv4_nat"` UseIPv6 *bool `mapstructure:"use_ipv6" required:"false" cty:"use_ipv6" hcl:"use_ipv6"` UseInternalIP *bool `mapstructure:"use_internal_ip" required:"false" cty:"use_internal_ip" hcl:"use_internal_ip"` FolderID *string `mapstructure:"folder_id" required:"true" cty:"folder_id" hcl:"folder_id"` ServiceAccountID *string `mapstructure:"service_account_id" required:"true" cty:"service_account_id" hcl:"service_account_id"` Paths []string `mapstructure:"paths" required:"true" cty:"paths" hcl:"paths"` SSHPrivateKeyFile *string `mapstructure:"ssh_private_key_file" required:"false" cty:"ssh_private_key_file" hcl:"ssh_private_key_file"` Tries *int `mapstructure:"tries" required:"false" cty:"tries" hcl:"tries"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "endpoint": &hcldec.AttrSpec{Name: "endpoint", Type: cty.String, Required: false}, "service_account_key_file": &hcldec.AttrSpec{Name: "service_account_key_file", Type: cty.String, Required: false}, "token": &hcldec.AttrSpec{Name: "token", Type: cty.String, Required: false}, "max_retries": &hcldec.AttrSpec{Name: "max_retries", Type: cty.Number, Required: false}, "serial_log_file": &hcldec.AttrSpec{Name: "serial_log_file", Type: cty.String, Required: false}, "state_timeout": &hcldec.AttrSpec{Name: "state_timeout", Type: cty.String, Required: false}, "instance_cores": &hcldec.AttrSpec{Name: "instance_cores", Type: cty.Number, Required: false}, "instance_gpus": &hcldec.AttrSpec{Name: "instance_gpus", Type: cty.Number, Required: false}, "instance_mem_gb": &hcldec.AttrSpec{Name: "instance_mem_gb", Type: cty.Number, Required: false}, "instance_name": &hcldec.AttrSpec{Name: "instance_name", Type: cty.String, Required: false}, "platform_id": &hcldec.AttrSpec{Name: "platform_id", Type: cty.String, Required: false}, "labels": &hcldec.AttrSpec{Name: "labels", Type: cty.Map(cty.String), Required: false}, "metadata": &hcldec.AttrSpec{Name: "metadata", Type: cty.Map(cty.String), Required: false}, "metadata_from_file": &hcldec.AttrSpec{Name: "metadata_from_file", Type: cty.Map(cty.String), Required: false}, "preemptible": &hcldec.AttrSpec{Name: "preemptible", Type: cty.Bool, Required: false}, "disk_name": &hcldec.AttrSpec{Name: "disk_name", Type: cty.String, Required: false}, "disk_size_gb": &hcldec.AttrSpec{Name: "disk_size_gb", Type: cty.Number, Required: false}, "disk_type": &hcldec.AttrSpec{Name: "disk_type", Type: cty.String, Required: false}, "disk_labels": &hcldec.AttrSpec{Name: "disk_labels", Type: cty.Map(cty.String), Required: false}, "subnet_id": &hcldec.AttrSpec{Name: "subnet_id", Type: cty.String, Required: false}, "zone": &hcldec.AttrSpec{Name: "zone", Type: cty.String, Required: false}, "use_ipv4_nat": &hcldec.AttrSpec{Name: "use_ipv4_nat", Type: cty.Bool, Required: false}, "use_ipv6": &hcldec.AttrSpec{Name: "use_ipv6", Type: cty.Bool, Required: false}, "use_internal_ip": &hcldec.AttrSpec{Name: "use_internal_ip", Type: cty.Bool, Required: false}, "folder_id": &hcldec.AttrSpec{Name: "folder_id", Type: cty.String, Required: false}, "service_account_id": &hcldec.AttrSpec{Name: "service_account_id", Type: cty.String, Required: false}, "paths": &hcldec.AttrSpec{Name: "paths", Type: cty.List(cty.String), Required: false}, "ssh_private_key_file": &hcldec.AttrSpec{Name: "ssh_private_key_file", Type: cty.String, Required: false}, "tries": &hcldec.AttrSpec{Name: "tries", Type: cty.Number, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/post-processor_test.go��������������������������������0000664�0000000�0000000�00000007720�13771713062�0025672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandexexport import ( "testing" "github.com/hashicorp/packer/builder/yandex" "github.com/stretchr/testify/require" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" ) func TestPostProcessor_Configure(t *testing.T) { type fields struct { config Config runner multistep.Runner } type args struct { raws []interface{} } tests := []struct { name string fields fields args args wantErr bool }{ { name: "no one creds", fields: fields{ config: Config{ AccessConfig: yandex.AccessConfig{ Token: "", ServiceAccountKeyFile: "", }, ExchangeConfig: ExchangeConfig{ ServiceAccountID: "some-srv-acc-id", }, CommonConfig: yandex.CommonConfig{ CloudConfig: yandex.CloudConfig{ FolderID: "some-folder-id", }, }, }, }, wantErr: false, }, { name: "both token and sa key file", fields: fields{ config: Config{ AccessConfig: yandex.AccessConfig{ Token: "some-value", ServiceAccountKeyFile: "path/not-exist.file", }, ExchangeConfig: ExchangeConfig{ ServiceAccountID: "some-srv-acc-id", }, CommonConfig: yandex.CommonConfig{ CloudConfig: yandex.CloudConfig{ FolderID: "some-folder-id", }, }, }, }, wantErr: true, }, { name: "use sa key file", fields: fields{ config: Config{ AccessConfig: yandex.AccessConfig{ Token: "", ServiceAccountKeyFile: "testdata/fake-sa-key.json", }, ExchangeConfig: ExchangeConfig{ ServiceAccountID: "some-srv-acc-id", }, CommonConfig: yandex.CommonConfig{ CloudConfig: yandex.CloudConfig{ FolderID: "some-folder-id", }, }, }, }, wantErr: false, }, { name: "service_account_id required", fields: fields{ config: Config{ AccessConfig: yandex.AccessConfig{ Token: "some token", }, ExchangeConfig: ExchangeConfig{ ServiceAccountID: "", }, CommonConfig: yandex.CommonConfig{ CloudConfig: yandex.CloudConfig{ FolderID: "some-folder-id", }, }, }, }, wantErr: true, }, { name: "folderID required", fields: fields{ config: Config{ AccessConfig: yandex.AccessConfig{ Token: "some token", }, ExchangeConfig: ExchangeConfig{ ServiceAccountID: "some-srv-acc-id", }, CommonConfig: yandex.CommonConfig{ CloudConfig: yandex.CloudConfig{ FolderID: "", }, }, }, }, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tt.fields.config.Paths = []string{"some-path"} // make Paths not empty p := &PostProcessor{ config: tt.fields.config, runner: tt.fields.runner, } if err := p.Configure(tt.args.raws...); (err != nil) != tt.wantErr { t.Errorf("Configure() error = %v, wantErr %v", err, tt.wantErr) } }) } } func Test_formUrls(t *testing.T) { type args struct { paths []string } tests := []struct { name string args args wantResult []string }{ { name: "empty list", args: args{ paths: []string{}, }, wantResult: []string{}, }, { name: "one element", args: args{ paths: []string{"s3://bucket1/object1"}, }, wantResult: []string{"https://" + defaultStorageEndpoint + "/bucket1/object1"}, }, { name: "several elements", args: args{ paths: []string{ "s3://bucket1/object1", "s3://bucket-name/object-with/prefix/filename.blob", "s3://bucket-too/foo/bar.test", }, }, wantResult: []string{ "https://" + defaultStorageEndpoint + "/bucket1/object1", "https://" + defaultStorageEndpoint + "/bucket-name/object-with/prefix/filename.blob", "https://" + defaultStorageEndpoint + "/bucket-too/foo/bar.test", }, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { require.Equal(t, tt.wantResult, formUrls(tt.args.paths)) }) } } ������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/scripts/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022763�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/scripts/export.sh�������������������������������������0000664�0000000�0000000�00000003465�13771713062�0024650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash GetMetadata() { curl -f -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/attributes/$1 2>/dev/null } [[ "$(GetMetadata debug)" == "1" || "$(GetMetadata debug)" == "true" ]] && set -x InstallPackages() { sudo apt-get update -qq && sudo apt-get install -y qemu-utils awscli } WaitFile() { local RETRIES=60 while [[ ${RETRIES} -gt 0 ]]; do echo "Wait ${1}" if [ -e "${1}" ]; then echo "[${1}] has been found" return 0 fi RETRIES=$((RETRIES-1)) sleep 5 done echo "[${1}] not found" return 1 } PATHS=$(GetMetadata paths) S3_ENDPOINT="https://storage.yandexcloud.net" DISK_EXPORT_PATH="/dev/disk/by-id/virtio-doexport" export AWS_SHARED_CREDENTIALS_FILE="/tmp/aws-credentials" export AWS_REGION=ru-central1 Exit() { for i in ${PATHS}; do LOGDEST="${i}.exporter.log" echo "Uploading exporter log to ${LOGDEST}..." aws s3 --endpoint-url="${S3_ENDPOINT}" cp /var/log/syslog "${LOGDEST}" done exit $1 } InstallPackages echo "####### Export configuration #######" echo "Export paths - ${PATHS}" echo "####################################" if ! WaitFile "${AWS_SHARED_CREDENTIALS_FILE}"; then echo "Failed wait credentials" Exit 1 fi udevadm trigger || true if ! WaitFile "${DISK_EXPORT_PATH}"; then echo "Failed wait attach disk" Exit 1 fi echo "Dumping disk..." if ! qemu-img convert -O qcow2 -o cluster_size=2M "${DISK_EXPORT_PATH}" disk.qcow2; then echo "Failed to dump disk to qcow2 image." Exit 1 fi for i in ${PATHS}; do echo "Uploading qcow2 disk image to ${i}..." if ! aws s3 --endpoint-url="${S3_ENDPOINT}" cp disk.qcow2 "${i}"; then echo "Failed to upload image to ${i}." FAIL=1 fi done Exit ${FAIL} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/scripts/script-to-var.go������������������������������0000664�0000000�0000000�00000002541�13771713062�0026026�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "bytes" "io/ioutil" "log" "os" "path/filepath" "strings" "text/template" "golang.org/x/tools/imports" ) var ( tmpl = template.Must(template.New("var").Parse(` // CODE GENERATED. DO NOT EDIT package {{.PkgName }} var ( {{ .Name }} = ` + "`" + `{{.Value}}` + "`" + ` ) `)) ) type vars struct { PkgName string Name string Value string } func main() { log.SetFlags(log.LstdFlags | log.Lshortfile) if len(os.Args) < 3 { log.Fatalf("Usage: %s file varname [output]", os.Args[0]) } fname := os.Args[1] targetVar := os.Args[2] pkg := os.Getenv("GOPACKAGE") absFilePath, err := filepath.Abs(fname) targetFName := strings.ToLower(targetVar) + ".go" if len(os.Args) > 3 { targetFName = os.Args[3] } log.Println(absFilePath, "=>", targetFName) if err != nil { log.Fatal(err) } b, err := ioutil.ReadFile(fname) if err != nil { log.Fatal(err) } if _, err := os.Stat(absFilePath); err != nil { os.Remove(absFilePath) } buff := bytes.Buffer{} err = tmpl.Execute(&buff, vars{ Name: targetVar, Value: string(b), PkgName: pkg, }) if err != nil { log.Fatal(err) } data, err := imports.Process(targetFName, buff.Bytes(), nil) if err != nil { log.Fatal(err) } f, err := os.Create(targetFName) if err != nil { log.Fatal(err) } _, err = f.Write(data) if err != nil { log.Fatal(err) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/step-attach-disk.go�����������������������������������0000664�0000000�0000000�00000005511�13771713062�0024772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandexexport import ( "context" "fmt" "github.com/hashicorp/packer/builder/yandex" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ) type StepAttachDisk struct { yandex.CommonConfig ImageID string } func (c *StepAttachDisk) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(yandex.Driver) ui := state.Get("ui").(packer.Ui) instanceID := state.Get("instance_id").(string) ui.Say("Create secondary disk from image for export...") imageDesc, err := driver.SDK().Compute().Image().Get(ctx, &compute.GetImageRequest{ ImageId: c.ImageID, }) if err != nil { return yandex.StepHaltWithError(state, err) } op, err := driver.SDK().WrapOperation(driver.SDK().Compute().Disk().Create(ctx, &compute.CreateDiskRequest{ Source: &compute.CreateDiskRequest_ImageId{ ImageId: c.ImageID, }, Name: fmt.Sprintf("export-%s-disk", instanceID), Size: imageDesc.GetMinDiskSize(), ZoneId: c.Zone, FolderId: c.FolderID, TypeId: c.DiskType, Description: "Temporary disk for exporting", })) if op == nil { return yandex.StepHaltWithError(state, err) } protoMD, err := op.Metadata() if err != nil { return yandex.StepHaltWithError(state, err) } md, ok := protoMD.(*compute.CreateDiskMetadata) if !ok { return yandex.StepHaltWithError(state, fmt.Errorf("could not get Disk ID from create operation metadata")) } state.Put("secondary_disk_id", md.GetDiskId()) if err := op.Wait(ctx); err != nil { return yandex.StepHaltWithError(state, err) } ui.Say("Attach secondary disk to instance...") op, err = driver.SDK().WrapOperation(driver.SDK().Compute().Instance().AttachDisk(ctx, &compute.AttachInstanceDiskRequest{ InstanceId: instanceID, AttachedDiskSpec: &compute.AttachedDiskSpec{ AutoDelete: true, DeviceName: "doexport", Disk: &compute.AttachedDiskSpec_DiskId{ DiskId: md.GetDiskId(), }, }, })) if err != nil { return yandex.StepHaltWithError(state, err) } ui.Message("Wait attached disk...") if err := op.Wait(ctx); err != nil { return yandex.StepHaltWithError(state, err) } state.Remove("secondary_disk_id") return multistep.ActionContinue } func (s *StepAttachDisk) Cleanup(state multistep.StateBag) { ui := state.Get("ui").(packer.Ui) driver := state.Get("driver").(yandex.Driver) if diskID, ok := state.GetOk("secondary_disk_id"); ok { ui.Say("Remove the secondary disk...") op, err := driver.SDK().WrapOperation(driver.SDK().Compute().Disk().Delete(context.Background(), &compute.DeleteDiskRequest{ DiskId: diskID.(string), })) if err != nil { ui.Error(err.Error()) return } if err := op.Wait(context.Background()); err != nil { ui.Error(err.Error()) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/step-create-s3-keys.go��������������������������������0000664�0000000�0000000�00000010002�13771713062�0025324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandexexport import ( "context" "fmt" "log" "net/url" "path/filepath" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/packer/builder/yandex" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1/awscompatibility" ) type StepCreateS3Keys struct { ServiceAccountID string Paths []string } func (c *StepCreateS3Keys) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { driver := state.Get("driver").(yandex.Driver) ui := state.Get("ui").(packer.Ui) ui.Say("Create temporary storage Access Key") // Create temporary storage Access Key respWithKey, err := driver.SDK().IAM().AWSCompatibility().AccessKey().Create(ctx, &awscompatibility.CreateAccessKeyRequest{ ServiceAccountId: c.ServiceAccountID, Description: "this temporary key is for upload image to storage; created by Packer", }) if err != nil { err := fmt.Errorf("Error waiting for cloud-init script to finish: %s", err) return yandex.StepHaltWithError(state, err) } state.Put("s3_secret", respWithKey) ui.Say("Verify access to paths") if err := verfiyAccess(respWithKey.GetAccessKey().GetKeyId(), respWithKey.Secret, c.Paths); err != nil { return yandex.StepHaltWithError(state, err) } return multistep.ActionContinue } func (s *StepCreateS3Keys) Cleanup(state multistep.StateBag) { driver := state.Get("driver").(yandex.Driver) ui := state.Get("ui").(packer.Ui) if val, ok := state.GetOk("s3_secret"); ok { ui.Say("S3 secrets have been found") s3Secret := val.(*awscompatibility.CreateAccessKeyResponse) ui.Message("Cleanup empty objects...") cleanUpEmptyObjects(s3Secret.GetAccessKey().GetKeyId(), s3Secret.GetSecret(), s.Paths) ui.Say("Delete S3 secrets...") _, err := driver.SDK().IAM().AWSCompatibility().AccessKey().Delete(context.Background(), &awscompatibility.DeleteAccessKeyRequest{ AccessKeyId: s3Secret.GetAccessKey().GetId(), }) if err != nil { ui.Error(err.Error()) } } } func verfiyAccess(keyID, secret string, paths []string) error { newSession, err := session.NewSession(&aws.Config{ Endpoint: aws.String(defaultStorageEndpoint), Region: aws.String(defaultStorageRegion), Credentials: credentials.NewStaticCredentials( keyID, secret, "", ), }) if err != nil { return err } s3Conn := s3.New(newSession) for _, path := range paths { u, err := url.Parse(path) if err != nil { return err } key := u.Path if strings.HasSuffix(key, "/") { key = filepath.Join(key, "disk.qcow2") } _, err = s3Conn.PutObject(&s3.PutObjectInput{ Body: aws.ReadSeekCloser(strings.NewReader("")), Bucket: aws.String(u.Host), Key: aws.String(key), }) if err != nil { return err } } return nil } func cleanUpEmptyObjects(keyID, secret string, paths []string) { newSession, err := session.NewSession(&aws.Config{ Endpoint: aws.String(defaultStorageEndpoint), Region: aws.String(defaultStorageRegion), Credentials: credentials.NewStaticCredentials( keyID, secret, "", ), }) if err != nil { log.Printf("[WARN] %s", err) return } s3Conn := s3.New(newSession) for _, path := range paths { u, err := url.Parse(path) if err != nil { log.Printf("[WARN] %s", err) continue } key := u.Path if strings.HasSuffix(key, "/") { key = filepath.Join(key, "disk.qcow2") } log.Printf("Check object: '%s'", path) respHead, err := s3Conn.HeadObject(&s3.HeadObjectInput{ Bucket: aws.String(u.Host), Key: aws.String(key), }) if err != nil { log.Printf("[WARN] %s", err) continue } if *respHead.ContentLength > 0 { continue } log.Printf("[DEBUG] Delete object: '%s'", path) _, err = s3Conn.DeleteObject(&s3.DeleteObjectInput{ Bucket: aws.String(u.Host), Key: aws.String(key), }) if err != nil { log.Printf("[WARN] %s", err) } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/step-upload-secrets.go��������������������������������0000664�0000000�0000000�00000002420�13771713062�0025524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandexexport import ( "context" "fmt" "strings" "github.com/hashicorp/packer/builder/yandex" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1/awscompatibility" ) type StepUploadSecrets struct{} // Run reads the instance metadata and looks for the log entry // indicating the cloud-init script finished. func (s *StepUploadSecrets) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { _ = state.Get("config").(*yandex.Config) _ = state.Get("driver").(yandex.Driver) ui := state.Get("ui").(packersdk.Ui) comm := state.Get("communicator").(packersdk.Communicator) s3Secret := state.Get("s3_secret").(*awscompatibility.CreateAccessKeyResponse) ui.Say("Upload secrets..") creds := fmt.Sprintf( "[default]\naws_access_key_id = %s\naws_secret_access_key = %s\n", s3Secret.GetAccessKey().GetKeyId(), s3Secret.GetSecret()) err := comm.Upload("/tmp/aws-credentials", strings.NewReader(creds), nil) if err != nil { return yandex.StepHaltWithError(state, err) } ui.Message("Secrets has been uploaded") return multistep.ActionContinue } // Cleanup. func (s *StepUploadSecrets) Cleanup(state multistep.StateBag) {} ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/step-wait-cloud-init.go�������������������������������0000664�0000000�0000000�00000005724�13771713062�0025615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandexexport import ( "bytes" "context" "encoding/json" "errors" "fmt" "time" "github.com/hashicorp/packer/builder/yandex" "github.com/hashicorp/packer/packer-plugin-sdk/multistep" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" ) type StepWaitCloudInitScript struct { Tries int } type cloudInitStatus struct { V1 struct { Errors []interface{} } } type cloudInitError struct { Err error } func (e *cloudInitError) Error() string { return e.Err.Error() } // Run reads the instance metadata and looks for the log entry // indicating the cloud-init script finished. func (s *StepWaitCloudInitScript) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { ui := state.Get("ui").(packersdk.Ui) comm := state.Get("communicator").(packersdk.Communicator) ui.Say("Waiting for any running cloud-init script to finish...") ctxWithCancel, cancelCtx := context.WithCancel(ctx) defer cancelCtx() go func() { cmd := &packersdk.RemoteCmd{ Command: "tail -f /var/log/cloud-init-output.log", } err := cmd.RunWithUi(ctxWithCancel, comm, ui) if err != nil && !errors.Is(err, context.Canceled) { ui.Error(err.Error()) return } ui.Message("Cloud-init output closed") }() // periodically show progress by sending SIGUSR1 to `qemu-img` process go func() { cmd := &packersdk.RemoteCmd{ Command: "until pid=$(pidof qemu-img) ; do sleep 1 ; done ; " + "while true ; do sudo kill -s SIGUSR1 ${pid}; sleep 10 ; done", } err := cmd.RunWithUi(ctxWithCancel, comm, ui) if err != nil && !errors.Is(err, context.Canceled) { ui.Error("qemu-img signal sender error: " + err.Error()) return } }() // Keep checking the serial port output to see if the cloud-init script is done. retryConfig := &retry.Config{ ShouldRetry: func(e error) bool { switch e.(type) { case *cloudInitError: return false } return true }, Tries: s.Tries, RetryDelay: (&retry.Backoff{InitialBackoff: 10 * time.Second, MaxBackoff: 60 * time.Second, Multiplier: 2}).Linear, } err := retryConfig.Run(ctx, func(ctx context.Context) error { buff := bytes.Buffer{} err := comm.Download("/var/run/cloud-init/result.json", &buff) if err != nil { err := fmt.Errorf("Waiting cloud-init script status: %s", err) return err } result := &cloudInitStatus{} err = json.Unmarshal(buff.Bytes(), result) if err != nil { err := fmt.Errorf("Failed parse result: %s", err) return &cloudInitError{Err: err} } if len(result.V1.Errors) != 0 { err := fmt.Errorf("Result: %v", result.V1.Errors) return &cloudInitError{Err: err} } return nil }) if err != nil { err := fmt.Errorf("Error waiting for cloud-init script to finish: %s", err) return yandex.StepHaltWithError(state, err) } ui.Say("Cloud-init script has finished running.") return multistep.ActionContinue } // Cleanup. func (s *StepWaitCloudInitScript) Cleanup(state multistep.StateBag) {} ��������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/testdata/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023105�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/testdata/fake-sa-key.json�����������������������������0000664�0000000�0000000�00000010313�13771713062�0026073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "id": "ajeboa0du6edu6m43c3t", "service_account_id": "ajeq7dsmihqple6761c5", "created_at": "2018-11-19T13:38:09Z", "description": "description", "key_algorithm": "RSA_4096", "public_key": "-----BEGIN PUBLIC KEY-----\nMIICCgKCAgEAo/s1lN5vFpFNJvS/l+yRilQHAPDeC3JqBwpLstbqJXW4kAUaKKoe\nxkIuJuPUKOUcd/JE3LXOEt/LOFb9mkCRdpjaIW7Jd5Fw0kTHIZ5rDoq7DZx0LV9b\nGJNskdccd6M6stb1GEqVuGpVcyXMCH8tMSG3c85DkcAg0cxXgyrirAzHMPiWSTpj\nJjICkxXRVj01Xq7dIDqL2LSMrZ2kLda5m+CnfscUbwnGRPPoEg20jLiEgBM2o43e\nhpWko1NStRR5fMQcQSUBbdtvbfPracjZz2/fq4fZfqlnObgq3WpYpdGynniLH3i5\nbxPM3ufYL3HY2w5aIOY6KIwMKLf3WYlug90ieviMYAvCukrCASwyqBQlt3MKCHlN\nIcebZXJDQ1VSBuEs+4qXYlhG1p+5C07zahzigNNTm6rEo47FFfClF04mv2uJN42F\nfWlEPR+V9JHBcfcBCdvyhiGzftl/vDo2NdO751ETIhyNKzxM/Ve2PR9h/qcuEatC\nLlXUA+40epNNHbSxAauxcngyrtkn7FZAEhdjyTtx46sELyb90Z56WgnbNUUGnsS/\nHBnBy5z8RyCmI5MjTC2NtplVqtAWkG+x59mU3GoCeuI8EaNtu2YPXhl1ovRkS4NB\n1G0F4c5FiJ27/E2MbNKlV5iw9ICcDforATYTeqiXbkkEKqIIiZYZWOsCAwEAAQ==\n-----END PUBLIC KEY-----\n", "private_key": "-----BEGIN PRIVATE KEY-----\nMIIJKQIBAAKCAgEAo/s1lN5vFpFNJvS/l+yRilQHAPDeC3JqBwpLstbqJXW4kAUa\nKKoexkIuJuPUKOUcd/JE3LXOEt/LOFb9mkCRdpjaIW7Jd5Fw0kTHIZ5rDoq7DZx0\nLV9bGJNskdccd6M6stb1GEqVuGpVcyXMCH8tMSG3c85DkcAg0cxXgyrirAzHMPiW\nSTpjJjICkxXRVj01Xq7dIDqL2LSMrZ2kLda5m+CnfscUbwnGRPPoEg20jLiEgBM2\no43ehpWko1NStRR5fMQcQSUBbdtvbfPracjZz2/fq4fZfqlnObgq3WpYpdGynniL\nH3i5bxPM3ufYL3HY2w5aIOY6KIwMKLf3WYlug90ieviMYAvCukrCASwyqBQlt3MK\nCHlNIcebZXJDQ1VSBuEs+4qXYlhG1p+5C07zahzigNNTm6rEo47FFfClF04mv2uJ\nN42FfWlEPR+V9JHBcfcBCdvyhiGzftl/vDo2NdO751ETIhyNKzxM/Ve2PR9h/qcu\nEatCLlXUA+40epNNHbSxAauxcngyrtkn7FZAEhdjyTtx46sELyb90Z56WgnbNUUG\nnsS/HBnBy5z8RyCmI5MjTC2NtplVqtAWkG+x59mU3GoCeuI8EaNtu2YPXhl1ovRk\nS4NB1G0F4c5FiJ27/E2MbNKlV5iw9ICcDforATYTeqiXbkkEKqIIiZYZWOsCAwEA\nAQKCAgEAihT1L6CGhshf4VfjJfktLQBIzYAGWjlEEx2WVMgobtbMTWoedvOZ6nS8\nDD943d7ftBkr53aoSrhslcqazpNkaiuYMuLpf2fXSxhjXmnZ2Gr1zCZcpgBP40fw\n+nXbINswiHv98zCLFrljrwy63MTKtz6fDkM4HrlcaY3aezdXnG0+JnyNgKhL6VPf\nWx/aIPZ1xH8W8RabwCV4+JFwOLFBpoLsSBM3n7DpZhLE7r7ftEeEO5zyO5MxOL81\n3dpCIP1Wt7sj169jnrBTCpGFQJTC5Kxd+kDw4nmf1LjCT6RHdYo5ELyM2jl8XI6d\ny24LWxhQ9VUGjAGSI6aabodLH/hcOBB2wG1tnO+n5y85GnKKOJgxCxaj1yR/LAcT\nFvZgbDGwAMd7h7+fU46Yj5BILk6mRvBNL6Mk2VAlBzUatGduU+Xxha3JkGxIJY4G\np1qPLNiP7as90mXXMgNEtsP2zXtyi+9q7XBOBnfL3ftHWQmu7MKQCHIKcNRchFJ4\nS1LtndjXtNchzDhbXru2qsRiASmL9u4CgZn/lM3kDHs+v2JI+V8cPk5XZhoPrrpP\nZ0SPeoLZEJ5/TtlTWAXXqP6F24rziBqnEJgpNCkeBnQYx2Rs9OKVsrlDk8cf3KkL\nH8qQ/86HYz9cEtFnVKAYOV5GtQsJRyzipMy7R/cegdtWJ8ScuiECggEBANOT7lBX\nRYw+k53TRpkk7NlWuQogKKEQx4PEf8A6HQj3SseH8u+tt3HfTFJktzWs/9EQerLS\nJky9bSPxBvDq0Zfj+IPamiY+c2w5a9WbLxk8UHCaUHcSUeWoWQwmCZqzXeUNj9f5\nQOfF+ajsqhaXE68/HuIj+dgOOn/XYyqNkxlidXa9U3gUanuftwRSephsGcsaEGTe\nep2My4Jj3hPH/9Qoith0X18atRru6RanK63bDl0FqAU/1uUycQr+h0hEwQHWoRiq\nNVXI1uxfi5/2pxK0w1MOzZLitwEQ/veCv6CZwNPf1SW1U8j70SvKVR8Z7gGDIPjS\n8klW2Z9g6gxPQ1MCggEBAMZpBFa4mEnsmt+paEFCGUtoeBapjZF94PBtdxII/T5t\ne5z4Iz7RMl+ixLhNepQu+0t+v1iDVJgDJuUjCsSF69jEca7gzmsWhs9d+gDU5Knm\n18ChbQyeaDvmqINCs2t45pA/mVIQHbA8L8n/ToI5P63ZELDUFVzZo9kerZu1ALNB\nRoG0PhIHrGkZKwL8oE72nrZmWtfjROsZBhu7FqJ0i7va/6fgNMuMtBC/abOC7yVT\nir5XP+ZGF8XNyIZ3Ic0X8xc+XqagYsf+XobHGmbSct/ZaDP3g1z4B/7JZcbYjuTZ\nMJ3s5T+6l/qo0dfDuaVBJFJrnw8YfahX/Bn4OQ2TuQkCggEBALfhs5dDogA3Spg6\nTPtAalCh3IP+WxFQwfW1S8pHN4DZW7Z6YxsHgY2IIo7hVZFi35pVli3gEsVTRI2e\nJwgvLSWzTgNac+qVED+Y0C1/h7mI/+g9VX2HAIJ2g53ZWTOIfCxcUw3DZTOKjmbP\n+StU9hiy5SZpWfT6uMDu8xLCpHvFZI1kEi0koT78GlW5US8zlF8+Mc1YxnwzJ5QV\nM6dBhQhgi/t/eHvxfEECLrYvZ/jbj2otRk/5oczkv/ZsLCsVBiGQ5cXH+D6sJI6e\no3zNI3tQewmurd/hBmf4239FtUHhHwOFX3w8Uas1oB9M5Bn5sS7DRl67BzPSNaUc\n140HPl0CggEAX1+13TXoxog8vkzBt7TdUdlK+KHSUmCvEwObnAjEKxEXvZGt55FJ\n5JzqcSmVRcv7sgOgWRzwOg4x0S1yDJvPjiiH+SdJMkLm1KF4/pNXw7AagBdYwxsW\nQc0Trd0PQBcixa48tizXCJM16aSXCZQZXykbk9Su3C4mS8UqcNGmH4S+LrUErUgR\nAYg+m7XyHWMBUe6LtoEh7Nzfic76B2d8j/WqtPjaiAn/uJk6ZzcGW+v3op1wMvH4\nlXXg8XosvljH2qF5gCFSuo40xBbLQyfgXmg0Zd6Rv8velAQdr2MD9U/NxexNGsBI\nNA6YqF4GTECvBAuFrwz3wkdhAN7IFhWveQKCAQBdfdHB3D+m+b/hZoEIv0nPcgQf\ncCOPPNO/ufObjWed2jTL3RjoDT337Mp3mYkoP4GE9n6cl7mjlcrf7KQeRG8k35fv\n3nMoMOp21qj9J66UgGf1/RHsV/+ljcu87ggYDCVKd8uGzkspRIQIsD77He/TwZNa\nyWL4fa1EvRU6STwi7CZFfhWhMF3rBGAPshABoyJZh6Z14cioAKSR0Sl6XZ5dcB9B\naoJM8sISSlOqMIJyNnyMtdE55Ag+P7LyMe2grxlwVTv3h0o5mHSzWnjSHVYvN4q5\n6h5UUopLtyVMGCwOJz+zNT7zFqi4XIGU8a8Lg1iiKtfjgHB2X8ZWZuXBdrTj\n-----END PRIVATE KEY-----\n" }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/version/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022761�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-export/version/version.go������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var YandexExportPluginVersion *version.PluginVersion func init() { YandexExportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021265�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/artifact.go�������������������������������������������0000664�0000000�0000000�00000001453�13771713062�0023414�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandeximport import ( "fmt" ) const BuilderId = "packer.post-processor.yandex-import" type Artifact struct { imageID string sourceType string sourceID string // StateData should store data such as GeneratedData // to be shared with post-processors StateData map[string]interface{} } func (*Artifact) BuilderId() string { return BuilderId } func (a *Artifact) Id() string { return a.imageID } func (a *Artifact) Files() []string { return nil } func (a *Artifact) String() string { return fmt.Sprintf("Create image %v from source type %v with ID/URL %v", a.imageID, a.sourceType, a.sourceID) } func (a *Artifact) State(name string) interface{} { if _, ok := a.StateData[name]; ok { return a.StateData[name] } return nil } func (a *Artifact) Destroy() error { return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/artifact_test.go��������������������������������������0000664�0000000�0000000�00000001123�13771713062�0024445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandeximport import ( "testing" "github.com/stretchr/testify/require" ) func TestArtifactState_StateData(t *testing.T) { expectedData := "this is the data" artifact := &Artifact{ StateData: map[string]interface{}{"state_data": expectedData}, } // Valid state result := artifact.State("state_data") require.Equal(t, expectedData, result) // Invalid state result = artifact.State("invalid_key") require.Equal(t, nil, result) // Nil StateData should not fail and should return nil artifact = &Artifact{} result = artifact.State("key") require.Equal(t, nil, result) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/post-processor.go�������������������������������������0000664�0000000�0000000�00000015744�13771713062�0024631�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate struct-markdown //go:generate mapstructure-to-hcl2 -type Config package yandeximport import ( "context" "fmt" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/file" "github.com/hashicorp/packer/builder/yandex" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/post-processor/artifice" "github.com/hashicorp/packer/post-processor/compress" yandexexport "github.com/hashicorp/packer/post-processor/yandex-export" "github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1/awscompatibility" ) type Config struct { common.PackerConfig `mapstructure:",squash"` yandex.AccessConfig `mapstructure:",squash"` yandex.CloudConfig `mapstructure:",squash"` yandexexport.ExchangeConfig `mapstructure:",squash"` yandex.ImageConfig `mapstructure:",squash"` // The name of the bucket where the qcow2 file will be uploaded to for import. // This bucket must exist when the post-processor is run. // // If import occurred after Yandex-Export post-processor, artifact already // in storage service and first paths (URL) is used to, so no need to set this param. Bucket string `mapstructure:"bucket" required:"false"` // The name of the object key in `bucket` where the qcow2 file will be copied to import. // This is a [template engine](/docs/templates/engine). // Therefore, you may use user variables and template functions in this field. ObjectName string `mapstructure:"object_name" required:"false"` // Whether skip removing the qcow2 file uploaded to Storage // after the import process has completed. Possible values are: `true` to // leave it in the bucket, `false` to remove it. Default is `false`. SkipClean bool `mapstructure:"skip_clean" required:"false"` ctx interpolate.Context } type PostProcessor struct { config Config } func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *PostProcessor) Configure(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: BuilderId, Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "object_name", }, }, }, raws...) if err != nil { return err } // Accumulate any errors var errs *packersdk.MultiError errs = packersdk.MultiErrorAppend(errs, p.config.AccessConfig.Prepare(&p.config.ctx)...) errs = p.config.CloudConfig.Prepare(errs) errs = p.config.ImageConfig.Prepare(errs) errs = p.config.ExchangeConfig.Prepare(errs) // Set defaults if p.config.ObjectName == "" { p.config.ObjectName = "packer-import-{{timestamp}}.qcow2" } // Check and render object_name if err = interpolate.Validate(p.config.ObjectName, &p.config.ctx); err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("error parsing object_name template: %s", err)) } if len(errs.Errors) > 0 { return errs } return nil } func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error) { var imageSrc cloudImageSource var fileSource bool var err error generatedData := artifact.State("generated_data") if generatedData == nil { // Make sure it's not a nil map so we can assign to it later. generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData p.config.ObjectName, err = interpolate.Render(p.config.ObjectName, &p.config.ctx) if err != nil { return nil, false, false, fmt.Errorf("error rendering object_name template: %s", err) } client, err := yandex.NewDriverYC(ui, &p.config.AccessConfig) if err != nil { return nil, false, false, err } // Create temporary storage Access Key respWithKey, err := client.SDK().IAM().AWSCompatibility().AccessKey().Create(ctx, &awscompatibility.CreateAccessKeyRequest{ ServiceAccountId: p.config.ServiceAccountID, Description: "this temporary key is for upload image to storage; created by Packer", }) if err != nil { return nil, false, false, err } storageClient, err := newYCStorageClient("", respWithKey.GetAccessKey().GetKeyId(), respWithKey.GetSecret()) if err != nil { return nil, false, false, fmt.Errorf("error create object storage client: %s", err) } switch artifact.BuilderId() { case compress.BuilderId, artifice.BuilderId, file.BuilderId: // Artifact as a file, need to be uploaded to storage before create Compute Image fileSource = true // As `bucket` option validate input here if p.config.Bucket == "" { return nil, false, false, fmt.Errorf("To upload artfact you need to specify `bucket` value") } imageSrc, err = uploadToBucket(storageClient, ui, artifact, p.config.Bucket, p.config.ObjectName) if err != nil { return nil, false, false, err } case yandexexport.BuilderId: // Artifact already in storage, just get URL imageSrc, err = presignUrl(storageClient, ui, artifact.Id()) if err != nil { return nil, false, false, err } case yandex.BuilderID: // Artifact is plain Yandex Compute Image, just create new one based on provided imageSrc = &imageSource{ imageID: artifact.Id(), } case BuilderId: // Artifact from prev yandex-import PP, reuse URL or Cloud Image ID imageSrc, err = chooseSource(artifact) if err != nil { return nil, false, false, err } default: err := fmt.Errorf( "Unknown artifact type: %s\nCan only import from Yandex-Export, Yandex-Import, Compress, Artifice and File post-processor artifacts.", artifact.BuilderId()) return nil, false, false, err } ycImage, err := createYCImage(ctx, client, ui, imageSrc, &p.config) if err != nil { return nil, false, false, err } if fileSource && !p.config.SkipClean { err = deleteFromBucket(storageClient, ui, imageSrc) if err != nil { return nil, false, false, err } } // Delete temporary storage Access Key _, err = client.SDK().IAM().AWSCompatibility().AccessKey().Delete(ctx, &awscompatibility.DeleteAccessKeyRequest{ AccessKeyId: respWithKey.GetAccessKey().GetId(), }) if err != nil { return nil, false, false, fmt.Errorf("error delete static access key: %s", err) } return &Artifact{ imageID: ycImage.GetId(), StateData: map[string]interface{}{ "source_type": imageSrc.GetSourceType(), "source_id": imageSrc.GetSourceID(), }, }, false, false, nil } func chooseSource(a packersdk.Artifact) (cloudImageSource, error) { st := a.State("source_type").(string) if st == "" { return nil, fmt.Errorf("could not determine source type of yandex-import artifact: %v", a) } switch st { case sourceType_IMAGE: return &imageSource{ imageID: a.State("source_id").(string), }, nil case sourceType_OBJECT: return &objectSource{ url: a.State("source_id").(string), }, nil } return nil, fmt.Errorf("unknow source type of yandex-import artifact: %s", st) } ����������������������������packer-1.6.6+ds1/post-processor/yandex-import/post-processor.hcl2spec.go����������������������������0000664�0000000�0000000�00000014360�13771713062�0026324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package yandeximport import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Endpoint *string `mapstructure:"endpoint" required:"false" cty:"endpoint" hcl:"endpoint"` ServiceAccountKeyFile *string `mapstructure:"service_account_key_file" required:"false" cty:"service_account_key_file" hcl:"service_account_key_file"` Token *string `mapstructure:"token" required:"true" cty:"token" hcl:"token"` MaxRetries *int `mapstructure:"max_retries" cty:"max_retries" hcl:"max_retries"` FolderID *string `mapstructure:"folder_id" required:"true" cty:"folder_id" hcl:"folder_id"` ServiceAccountID *string `mapstructure:"service_account_id" required:"true" cty:"service_account_id" hcl:"service_account_id"` ImageName *string `mapstructure:"image_name" required:"false" cty:"image_name" hcl:"image_name"` ImageDescription *string `mapstructure:"image_description" required:"false" cty:"image_description" hcl:"image_description"` ImageFamily *string `mapstructure:"image_family" required:"false" cty:"image_family" hcl:"image_family"` ImageLabels map[string]string `mapstructure:"image_labels" required:"false" cty:"image_labels" hcl:"image_labels"` ImageMinDiskSizeGb *int `mapstructure:"image_min_disk_size_gb" required:"false" cty:"image_min_disk_size_gb" hcl:"image_min_disk_size_gb"` ImageProductIDs []string `mapstructure:"image_product_ids" required:"false" cty:"image_product_ids" hcl:"image_product_ids"` Bucket *string `mapstructure:"bucket" required:"false" cty:"bucket" hcl:"bucket"` ObjectName *string `mapstructure:"object_name" required:"false" cty:"object_name" hcl:"object_name"` SkipClean *bool `mapstructure:"skip_clean" required:"false" cty:"skip_clean" hcl:"skip_clean"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "endpoint": &hcldec.AttrSpec{Name: "endpoint", Type: cty.String, Required: false}, "service_account_key_file": &hcldec.AttrSpec{Name: "service_account_key_file", Type: cty.String, Required: false}, "token": &hcldec.AttrSpec{Name: "token", Type: cty.String, Required: false}, "max_retries": &hcldec.AttrSpec{Name: "max_retries", Type: cty.Number, Required: false}, "folder_id": &hcldec.AttrSpec{Name: "folder_id", Type: cty.String, Required: false}, "service_account_id": &hcldec.AttrSpec{Name: "service_account_id", Type: cty.String, Required: false}, "image_name": &hcldec.AttrSpec{Name: "image_name", Type: cty.String, Required: false}, "image_description": &hcldec.AttrSpec{Name: "image_description", Type: cty.String, Required: false}, "image_family": &hcldec.AttrSpec{Name: "image_family", Type: cty.String, Required: false}, "image_labels": &hcldec.AttrSpec{Name: "image_labels", Type: cty.Map(cty.String), Required: false}, "image_min_disk_size_gb": &hcldec.AttrSpec{Name: "image_min_disk_size_gb", Type: cty.Number, Required: false}, "image_product_ids": &hcldec.AttrSpec{Name: "image_product_ids", Type: cty.List(cty.String), Required: false}, "bucket": &hcldec.AttrSpec{Name: "bucket", Type: cty.String, Required: false}, "object_name": &hcldec.AttrSpec{Name: "object_name", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/source.go���������������������������������������������0000664�0000000�0000000�00000001455�13771713062�0023121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandeximport import "fmt" const sourceType_IMAGE = "image" const sourceType_OBJECT = "object" type cloudImageSource interface { GetSourceID() string GetSourceType() string Description() string } type imageSource struct { imageID string } func (i *imageSource) GetSourceID() string { return i.imageID } func (i *imageSource) GetSourceType() string { return sourceType_IMAGE } func (i *imageSource) Description() string { return fmt.Sprintf("%s source, id: %s", i.GetSourceType(), i.imageID) } type objectSource struct { url string } func (i *objectSource) GetSourceID() string { return i.url } func (i *objectSource) GetSourceType() string { return sourceType_OBJECT } func (i *objectSource) Description() string { return fmt.Sprintf("%s source, url: %s", i.GetSourceType(), i.url) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/storage.go��������������������������������������������0000664�0000000�0000000�00000004525�13771713062�0023266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandeximport import ( "fmt" "net/url" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) const defaultS3Region = "ru-central1" const defaultStorageEndpoint = "storage.yandexcloud.net" func newYCStorageClient(storageEndpoint, accessKey, secretKey string) (*s3.S3, error) { var creds *credentials.Credentials if storageEndpoint == "" { storageEndpoint = defaultStorageEndpoint } s3Config := &aws.Config{ Endpoint: aws.String(storageEndpoint), Region: aws.String(defaultS3Region), } switch { case accessKey != "" && secretKey != "": creds = credentials.NewStaticCredentials(accessKey, secretKey, "") default: return nil, fmt.Errorf("either access or secret key not provided") } s3Config.Credentials = creds newSession, err := session.NewSession(s3Config) if err != nil { return nil, err } return s3.New(newSession), nil } // Get path-style S3 URL and return presigned URL func presignUrl(s3conn *s3.S3, ui packersdk.Ui, fullUrl string) (cloudImageSource, error) { bucket, key, err := s3URLToBucketKey(fullUrl) if err != nil { return nil, err } req, _ := s3conn.GetObjectRequest(&s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(key), }) // Compute service allow only `https://storage.yandexcloud.net/...` URLs for Image create process req.Config.S3ForcePathStyle = aws.Bool(true) urlStr, _, err := req.PresignRequest(30 * time.Minute) if err != nil { ui.Say(fmt.Sprintf("Failed to presign url: %s", err)) return nil, err } return &objectSource{ urlStr, }, nil } func s3URLToBucketKey(storageURL string) (bucket string, key string, err error) { u, err := url.Parse(storageURL) if err != nil { return } if u.Scheme == "s3" { // s3://bucket/key bucket = u.Host key = strings.TrimLeft(u.Path, "/") } else if u.Scheme == "https" { // https://***.storage.yandexcloud.net/... if u.Host == defaultStorageEndpoint { // No bucket name in the host part path := strings.SplitN(u.Path, "/", 3) bucket = path[1] key = path[2] } else { // Bucket name in host bucket = strings.TrimSuffix(u.Host, "."+defaultStorageEndpoint) key = strings.TrimLeft(u.Path, "/") } } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/storage_test.go���������������������������������������0000664�0000000�0000000�00000002666�13771713062�0024331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandeximport import ( "testing" "github.com/stretchr/testify/assert" ) func Test_s3URLToBucketKey(t *testing.T) { tests := []struct { name string storageURL string wantBucket string wantKey string wantErr bool }{ { name: "path-style url #1", storageURL: "https://storage.yandexcloud.net/bucket1/key1/foobar.txt", wantBucket: "bucket1", wantKey: "key1/foobar.txt", wantErr: false, }, { name: "path-style url #2", storageURL: "https://storage.yandexcloud.net/bucket1.with.dots/key1/foobar.txt", wantBucket: "bucket1.with.dots", wantKey: "key1/foobar.txt", wantErr: false, }, { name: "host-style url #1", storageURL: "https://bucket1.with.dots.storage.yandexcloud.net/key1/foobar.txt", wantBucket: "bucket1.with.dots", wantKey: "key1/foobar.txt", wantErr: false, }, { name: "host-style url #2", storageURL: "https://bucket-with-dash.storage.yandexcloud.net/key2/foobar.txt", wantBucket: "bucket-with-dash", wantKey: "key2/foobar.txt", wantErr: false, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { gotBucket, gotKey, err := s3URLToBucketKey(tt.storageURL) if (err != nil) != tt.wantErr { t.Errorf("s3URLToBucketKey() error = %v, wantErr %v", err, tt.wantErr) return } assert.Equal(t, tt.wantBucket, gotBucket) assert.Equal(t, tt.wantKey, gotKey) }) } } ��������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/utils.go����������������������������������������������0000664�0000000�0000000�00000010501�13771713062�0022751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package yandeximport import ( "context" "fmt" "os" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/packer/builder/yandex" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1" ) func uploadToBucket(s3conn *s3.S3, ui packersdk.Ui, artifact packersdk.Artifact, bucket string, objectName string) (cloudImageSource, error) { ui.Say("Looking for qcow2 file in list of artifacts...") source := "" for _, path := range artifact.Files() { ui.Say(fmt.Sprintf("Found artifact %v...", path)) if strings.HasSuffix(path, ".qcow2") { source = path break } } if source == "" { return nil, fmt.Errorf("no qcow2 file found in list of artifacts") } artifactFile, err := os.Open(source) if err != nil { err := fmt.Errorf("error opening %v", source) return nil, err } ui.Say(fmt.Sprintf("Uploading file %v to bucket %v/%v...", source, bucket, objectName)) _, err = s3conn.PutObject(&s3.PutObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectName), Body: artifactFile, }) if err != nil { ui.Say(fmt.Sprintf("Failed to upload: %v", objectName)) return nil, err } req, _ := s3conn.GetObjectRequest(&s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectName), }) // Compute service allow only `https://storage.yandexcloud.net/...` URLs for Image create process req.Config.S3ForcePathStyle = aws.Bool(true) err = req.Build() if err != nil { ui.Say(fmt.Sprintf("Failed to build S3 request: %v", err)) return nil, err } return &objectSource{ url: req.HTTPRequest.URL.String(), }, nil } func createYCImage(ctx context.Context, driver yandex.Driver, ui packersdk.Ui, imageSrc cloudImageSource, c *Config) (*compute.Image, error) { req := &compute.CreateImageRequest{ FolderId: c.CloudConfig.FolderID, Name: c.ImageConfig.ImageName, Description: c.ImageConfig.ImageDescription, Labels: c.ImageConfig.ImageLabels, Family: c.ImageConfig.ImageFamily, MinDiskSize: int64(c.ImageMinDiskSizeGb), ProductIds: c.ImageProductIDs, } // switch on cloudImageSource type: cloud image id or storage URL switch v := imageSrc.(type) { case *imageSource: req.Source = &compute.CreateImageRequest_ImageId{ImageId: v.imageID} case *objectSource: req.Source = &compute.CreateImageRequest_Uri{Uri: v.url} } op, err := driver.SDK().WrapOperation(driver.SDK().Compute().Image().Create(ctx, req)) if err != nil { ui.Say("Error creating Yandex Compute Image") return nil, err } ui.Say(fmt.Sprintf("Source of Image creation: %s", imageSrc.Description())) ui.Say(fmt.Sprintf("Creating Yandex Compute Image %v within operation %#v", c.ImageName, op.Id())) ui.Say("Waiting for Yandex Compute Image creation operation to complete...") err = op.Wait(ctx) // fail if image creation operation has an error if err != nil { return nil, fmt.Errorf("failed to create Yandex Compute Image: %s", err) } protoMetadata, err := op.Metadata() if err != nil { return nil, fmt.Errorf("error while get image create operation metadata: %s", err) } md, ok := protoMetadata.(*compute.CreateImageMetadata) if !ok { return nil, fmt.Errorf("could not get Image ID from create operation metadata") } image, err := driver.SDK().Compute().Image().Get(ctx, &compute.GetImageRequest{ ImageId: md.ImageId, }) if err != nil { return nil, fmt.Errorf("error while image get request: %s", err) } return image, nil } func deleteFromBucket(s3conn *s3.S3, ui packersdk.Ui, imageSrc cloudImageSource) error { var url string // switch on cloudImageSource type: cloud image id or storage URL switch v := imageSrc.(type) { case *objectSource: url = v.GetSourceID() case *imageSource: return fmt.Errorf("invalid argument for `deleteFromBucket` method: %v", v) } bucket, objectName, err := s3URLToBucketKey(url) if err != nil { return err } ui.Say(fmt.Sprintf("Deleting import source from Object Storage %s/%s...", bucket, objectName)) _, err = s3conn.DeleteObject(&s3.DeleteObjectInput{ Bucket: aws.String(bucket), Key: aws.String(objectName), }) if err != nil { ui.Say(fmt.Sprintf("Failed to delete: %v/%v", bucket, objectName)) return fmt.Errorf("error deleting storage object %q in bucket %q: %s ", objectName, bucket, err) } return nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/version/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022752�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/post-processor/yandex-import/version/version.go������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var YandexImportPluginVersion *version.PluginVersion func init() { YandexImportPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/�����������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016042�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020547�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/communicator_mock.go�������������������������������������0000664�0000000�0000000�00000001535�13771713062�0024613�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ansiblelocal import ( "context" "io" "os" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type communicatorMock struct { startCommand []string uploadDestination []string } func (c *communicatorMock) Start(ctx context.Context, cmd *packersdk.RemoteCmd) error { c.startCommand = append(c.startCommand, cmd.Command) cmd.SetExited(0) return nil } func (c *communicatorMock) Upload(dst string, _ io.Reader, _ *os.FileInfo) error { c.uploadDestination = append(c.uploadDestination, dst) return nil } func (c *communicatorMock) UploadDir(dst, src string, exclude []string) error { return nil } func (c *communicatorMock) Download(src string, dst io.Writer) error { return nil } func (c *communicatorMock) DownloadDir(src, dst string, exclude []string) error { return nil } func (c *communicatorMock) verify() { } �������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/provisioner.go�������������������������������������������0000664�0000000�0000000�00000040237�13771713062�0023463�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package ansiblelocal import ( "context" "fmt" "os" "path/filepath" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" ) const DefaultStagingDir = "/tmp/packer-provisioner-ansible-local" type Config struct { common.PackerConfig `mapstructure:",squash"` ctx interpolate.Context // The command to run ansible Command string // Extra options to pass to the ansible command ExtraArguments []string `mapstructure:"extra_arguments"` // Path to group_vars directory GroupVars string `mapstructure:"group_vars"` // Path to host_vars directory HostVars string `mapstructure:"host_vars"` // The playbook dir to upload. PlaybookDir string `mapstructure:"playbook_dir"` // The main playbook file to execute. PlaybookFile string `mapstructure:"playbook_file"` // The playbook files to execute. PlaybookFiles []string `mapstructure:"playbook_files"` // An array of local paths of playbook files to upload. PlaybookPaths []string `mapstructure:"playbook_paths"` // An array of local paths of roles to upload. RolePaths []string `mapstructure:"role_paths"` // The directory where files will be uploaded. Packer requires write // permissions in this directory. StagingDir string `mapstructure:"staging_directory"` // If true, staging directory is removed after executing ansible. CleanStagingDir bool `mapstructure:"clean_staging_directory"` // The optional inventory file InventoryFile string `mapstructure:"inventory_file"` // The optional inventory groups InventoryGroups []string `mapstructure:"inventory_groups"` // The optional ansible-galaxy requirements file GalaxyFile string `mapstructure:"galaxy_file"` // The command to run ansible-galaxy GalaxyCommand string `mapstructure:"galaxy_command"` } type Provisioner struct { config Config playbookFiles []string generatedData map[string]interface{} } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "ansible-local", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } // Reset the state. p.playbookFiles = make([]string, 0, len(p.config.PlaybookFiles)) // Defaults if p.config.Command == "" { p.config.Command = "ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook" } if p.config.GalaxyCommand == "" { p.config.GalaxyCommand = "ansible-galaxy" } if p.config.StagingDir == "" { p.config.StagingDir = filepath.ToSlash(filepath.Join(DefaultStagingDir, uuid.TimeOrderedUUID())) } // Validation var errs *packersdk.MultiError // Check that either playbook_file or playbook_files is specified if len(p.config.PlaybookFiles) != 0 && p.config.PlaybookFile != "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Either playbook_file or playbook_files can be specified, not both")) } if len(p.config.PlaybookFiles) == 0 && p.config.PlaybookFile == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Either playbook_file or playbook_files must be specified")) } if p.config.PlaybookFile != "" { err = validateFileConfig(p.config.PlaybookFile, "playbook_file", true) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } for _, playbookFile := range p.config.PlaybookFiles { if err := validateFileConfig(playbookFile, "playbook_files", true); err != nil { errs = packersdk.MultiErrorAppend(errs, err) } else { playbookFile, err := filepath.Abs(playbookFile) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } else { p.playbookFiles = append(p.playbookFiles, playbookFile) } } } // Check that the inventory file exists, if configured if len(p.config.InventoryFile) > 0 { err = validateFileConfig(p.config.InventoryFile, "inventory_file", true) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } // Check that the galaxy file exists, if configured if len(p.config.GalaxyFile) > 0 { err = validateFileConfig(p.config.GalaxyFile, "galaxy_file", true) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } // Check that the playbook_dir directory exists, if configured if len(p.config.PlaybookDir) > 0 { if err := validateDirConfig(p.config.PlaybookDir, "playbook_dir"); err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } // Check that the group_vars directory exists, if configured if len(p.config.GroupVars) > 0 { if err := validateDirConfig(p.config.GroupVars, "group_vars"); err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } // Check that the host_vars directory exists, if configured if len(p.config.HostVars) > 0 { if err := validateDirConfig(p.config.HostVars, "host_vars"); err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } for _, path := range p.config.PlaybookPaths { err := validateDirConfig(path, "playbook_paths") if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } for _, path := range p.config.RolePaths { if err := validateDirConfig(path, "role_paths"); err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ui.Say("Provisioning with Ansible...") p.generatedData = generatedData if len(p.config.PlaybookDir) > 0 { ui.Message("Uploading Playbook directory to Ansible staging directory...") if err := p.uploadDir(ui, comm, p.config.StagingDir, p.config.PlaybookDir); err != nil { return fmt.Errorf("Error uploading playbook_dir directory: %s", err) } } else { ui.Message("Creating Ansible staging directory...") if err := p.createDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error creating staging directory: %s", err) } } if p.config.PlaybookFile != "" { ui.Message("Uploading main Playbook file...") src := p.config.PlaybookFile dst := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(src))) if err := p.uploadFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading main playbook: %s", err) } } else if err := p.provisionPlaybookFiles(ui, comm); err != nil { return err } if len(p.config.InventoryFile) == 0 { tf, err := tmp.File("packer-provisioner-ansible-local") if err != nil { return fmt.Errorf("Error preparing inventory file: %s", err) } defer os.Remove(tf.Name()) if len(p.config.InventoryGroups) != 0 { content := "" for _, group := range p.config.InventoryGroups { content += fmt.Sprintf("[%s]\n127.0.0.1\n", group) } _, err = tf.Write([]byte(content)) } else { _, err = tf.Write([]byte("127.0.0.1")) } if err != nil { tf.Close() return fmt.Errorf("Error preparing inventory file: %s", err) } tf.Close() p.config.InventoryFile = tf.Name() defer func() { p.config.InventoryFile = "" }() } if len(p.config.GalaxyFile) > 0 { ui.Message("Uploading galaxy file...") src := p.config.GalaxyFile dst := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(src))) if err := p.uploadFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading galaxy file: %s", err) } } ui.Message("Uploading inventory file...") src := p.config.InventoryFile dst := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(src))) if err := p.uploadFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading inventory file: %s", err) } if len(p.config.GroupVars) > 0 { ui.Message("Uploading group_vars directory...") src := p.config.GroupVars dst := filepath.ToSlash(filepath.Join(p.config.StagingDir, "group_vars")) if err := p.uploadDir(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading group_vars directory: %s", err) } } if len(p.config.HostVars) > 0 { ui.Message("Uploading host_vars directory...") src := p.config.HostVars dst := filepath.ToSlash(filepath.Join(p.config.StagingDir, "host_vars")) if err := p.uploadDir(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading host_vars directory: %s", err) } } if len(p.config.RolePaths) > 0 { ui.Message("Uploading role directories...") for _, src := range p.config.RolePaths { dst := filepath.ToSlash(filepath.Join(p.config.StagingDir, "roles", filepath.Base(src))) if err := p.uploadDir(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading roles: %s", err) } } } if len(p.config.PlaybookPaths) > 0 { ui.Message("Uploading additional Playbooks...") playbookDir := filepath.ToSlash(filepath.Join(p.config.StagingDir, "playbooks")) if err := p.createDir(ui, comm, playbookDir); err != nil { return fmt.Errorf("Error creating playbooks directory: %s", err) } for _, src := range p.config.PlaybookPaths { dst := filepath.ToSlash(filepath.Join(playbookDir, filepath.Base(src))) if err := p.uploadDir(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading playbooks: %s", err) } } } if err := p.executeAnsible(ui, comm); err != nil { return fmt.Errorf("Error executing Ansible: %s", err) } if p.config.CleanStagingDir { ui.Message("Removing staging directory...") if err := p.removeDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error removing staging directory: %s", err) } } return nil } func (p *Provisioner) provisionPlaybookFiles(ui packersdk.Ui, comm packersdk.Communicator) error { var playbookDir string if p.config.PlaybookDir != "" { var err error playbookDir, err = filepath.Abs(p.config.PlaybookDir) if err != nil { return err } } for index, playbookFile := range p.playbookFiles { if playbookDir != "" && strings.HasPrefix(playbookFile, playbookDir) { p.playbookFiles[index] = strings.TrimPrefix(playbookFile, playbookDir) continue } if err := p.provisionPlaybookFile(ui, comm, playbookFile); err != nil { return err } } return nil } func (p *Provisioner) provisionPlaybookFile(ui packersdk.Ui, comm packersdk.Communicator, playbookFile string) error { ui.Message(fmt.Sprintf("Uploading playbook file: %s", playbookFile)) remoteDir := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Dir(playbookFile))) remotePlaybookFile := filepath.ToSlash(filepath.Join(p.config.StagingDir, playbookFile)) if err := p.createDir(ui, comm, remoteDir); err != nil { return fmt.Errorf("Error uploading playbook file: %s [%s]", playbookFile, err) } if err := p.uploadFile(ui, comm, remotePlaybookFile, playbookFile); err != nil { return fmt.Errorf("Error uploading playbook: %s [%s]", playbookFile, err) } return nil } func (p *Provisioner) executeGalaxy(ui packersdk.Ui, comm packersdk.Communicator) error { ctx := context.TODO() rolesDir := filepath.ToSlash(filepath.Join(p.config.StagingDir, "roles")) galaxyFile := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(p.config.GalaxyFile))) // ansible-galaxy install -r requirements.yml -p roles/ command := fmt.Sprintf("cd %s && %s install -r %s -p %s", p.config.StagingDir, p.config.GalaxyCommand, galaxyFile, rolesDir) ui.Message(fmt.Sprintf("Executing Ansible Galaxy: %s", command)) cmd := &packersdk.RemoteCmd{ Command: command, } if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { // ansible-galaxy version 2.0.0.2 doesn't return exit codes on error.. return fmt.Errorf("Non-zero exit status: %d", cmd.ExitStatus()) } return nil } func (p *Provisioner) executeAnsible(ui packersdk.Ui, comm packersdk.Communicator) error { inventory := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(p.config.InventoryFile))) extraArgs := fmt.Sprintf(" --extra-vars \"packer_build_name=%s packer_builder_type=%s packer_http_addr=%s -o IdentitiesOnly=yes\" ", p.config.PackerBuildName, p.config.PackerBuilderType, p.generatedData["PackerHTTPAddr"]) if len(p.config.ExtraArguments) > 0 { extraArgs = extraArgs + strings.Join(p.config.ExtraArguments, " ") } // Fetch external dependencies if len(p.config.GalaxyFile) > 0 { if err := p.executeGalaxy(ui, comm); err != nil { return fmt.Errorf("Error executing Ansible Galaxy: %s", err) } } if p.config.PlaybookFile != "" { playbookFile := filepath.ToSlash(filepath.Join(p.config.StagingDir, filepath.Base(p.config.PlaybookFile))) if err := p.executeAnsiblePlaybook(ui, comm, playbookFile, extraArgs, inventory); err != nil { return err } } for _, playbookFile := range p.playbookFiles { playbookFile = filepath.ToSlash(filepath.Join(p.config.StagingDir, playbookFile)) if err := p.executeAnsiblePlaybook(ui, comm, playbookFile, extraArgs, inventory); err != nil { return err } } return nil } func (p *Provisioner) executeAnsiblePlaybook( ui packersdk.Ui, comm packersdk.Communicator, playbookFile, extraArgs, inventory string, ) error { ctx := context.TODO() command := fmt.Sprintf("cd %s && %s %s%s -c local -i %s", p.config.StagingDir, p.config.Command, playbookFile, extraArgs, inventory, ) ui.Message(fmt.Sprintf("Executing Ansible: %s", command)) cmd := &packersdk.RemoteCmd{ Command: command, } if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { if cmd.ExitStatus() == 127 { return fmt.Errorf("%s could not be found. Verify that it is available on the\n"+ "PATH after connecting to the machine.", p.config.Command) } return fmt.Errorf("Non-zero exit status: %d", cmd.ExitStatus()) } return nil } func validateDirConfig(path string, config string) error { info, err := os.Stat(path) if err != nil { return fmt.Errorf("%s: %s is invalid: %s", config, path, err) } else if !info.IsDir() { return fmt.Errorf("%s: %s must point to a directory", config, path) } return nil } func validateFileConfig(name string, config string, req bool) error { if req { if name == "" { return fmt.Errorf("%s must be specified.", config) } } info, err := os.Stat(name) if err != nil { return fmt.Errorf("%s: %s is invalid: %s", config, name, err) } else if info.IsDir() { return fmt.Errorf("%s: %s must point to a file", config, name) } return nil } func (p *Provisioner) uploadFile(ui packersdk.Ui, comm packersdk.Communicator, dst, src string) error { f, err := os.Open(src) if err != nil { return fmt.Errorf("Error opening: %s", err) } defer f.Close() if err = comm.Upload(dst, f, nil); err != nil { return fmt.Errorf("Error uploading %s: %s", src, err) } return nil } func (p *Provisioner) createDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ctx := context.TODO() cmd := &packersdk.RemoteCmd{ Command: fmt.Sprintf("mkdir -p '%s'", dir), } ui.Message(fmt.Sprintf("Creating directory: %s", dir)) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more information.") } return nil } func (p *Provisioner) removeDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ctx := context.TODO() cmd := &packersdk.RemoteCmd{ Command: fmt.Sprintf("rm -rf '%s'", dir), } ui.Message(fmt.Sprintf("Removing directory: %s", dir)) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more information.") } return nil } func (p *Provisioner) uploadDir(ui packersdk.Ui, comm packersdk.Communicator, dst, src string) error { if err := p.createDir(ui, comm, dst); err != nil { return err } // Make sure there is a trailing "/" so that the directory isn't // created on the other side. if src[len(src)-1] != '/' { src = src + "/" } return comm.UploadDir(dst, src, nil) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/provisioner.hcl2spec.go����������������������������������0000664�0000000�0000000�00000013773�13771713062�0025172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package ansiblelocal import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Command *string `cty:"command" hcl:"command"` ExtraArguments []string `mapstructure:"extra_arguments" cty:"extra_arguments" hcl:"extra_arguments"` GroupVars *string `mapstructure:"group_vars" cty:"group_vars" hcl:"group_vars"` HostVars *string `mapstructure:"host_vars" cty:"host_vars" hcl:"host_vars"` PlaybookDir *string `mapstructure:"playbook_dir" cty:"playbook_dir" hcl:"playbook_dir"` PlaybookFile *string `mapstructure:"playbook_file" cty:"playbook_file" hcl:"playbook_file"` PlaybookFiles []string `mapstructure:"playbook_files" cty:"playbook_files" hcl:"playbook_files"` PlaybookPaths []string `mapstructure:"playbook_paths" cty:"playbook_paths" hcl:"playbook_paths"` RolePaths []string `mapstructure:"role_paths" cty:"role_paths" hcl:"role_paths"` StagingDir *string `mapstructure:"staging_directory" cty:"staging_directory" hcl:"staging_directory"` CleanStagingDir *bool `mapstructure:"clean_staging_directory" cty:"clean_staging_directory" hcl:"clean_staging_directory"` InventoryFile *string `mapstructure:"inventory_file" cty:"inventory_file" hcl:"inventory_file"` InventoryGroups []string `mapstructure:"inventory_groups" cty:"inventory_groups" hcl:"inventory_groups"` GalaxyFile *string `mapstructure:"galaxy_file" cty:"galaxy_file" hcl:"galaxy_file"` GalaxyCommand *string `mapstructure:"galaxy_command" cty:"galaxy_command" hcl:"galaxy_command"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "command": &hcldec.AttrSpec{Name: "command", Type: cty.String, Required: false}, "extra_arguments": &hcldec.AttrSpec{Name: "extra_arguments", Type: cty.List(cty.String), Required: false}, "group_vars": &hcldec.AttrSpec{Name: "group_vars", Type: cty.String, Required: false}, "host_vars": &hcldec.AttrSpec{Name: "host_vars", Type: cty.String, Required: false}, "playbook_dir": &hcldec.AttrSpec{Name: "playbook_dir", Type: cty.String, Required: false}, "playbook_file": &hcldec.AttrSpec{Name: "playbook_file", Type: cty.String, Required: false}, "playbook_files": &hcldec.AttrSpec{Name: "playbook_files", Type: cty.List(cty.String), Required: false}, "playbook_paths": &hcldec.AttrSpec{Name: "playbook_paths", Type: cty.List(cty.String), Required: false}, "role_paths": &hcldec.AttrSpec{Name: "role_paths", Type: cty.List(cty.String), Required: false}, "staging_directory": &hcldec.AttrSpec{Name: "staging_directory", Type: cty.String, Required: false}, "clean_staging_directory": &hcldec.AttrSpec{Name: "clean_staging_directory", Type: cty.Bool, Required: false}, "inventory_file": &hcldec.AttrSpec{Name: "inventory_file", Type: cty.String, Required: false}, "inventory_groups": &hcldec.AttrSpec{Name: "inventory_groups", Type: cty.List(cty.String), Required: false}, "galaxy_file": &hcldec.AttrSpec{Name: "galaxy_file", Type: cty.String, Required: false}, "galaxy_command": &hcldec.AttrSpec{Name: "galaxy_command", Type: cty.String, Required: false}, } return s } �����packer-1.6.6+ds1/provisioner/ansible-local/provisioner_test.go��������������������������������������0000664�0000000�0000000�00000026462�13771713062�0024526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ansiblelocal import ( "context" "io/ioutil" "os" "path/filepath" "strings" "testing" "fmt" "os/exec" "github.com/hashicorp/packer/builder/docker" builderT "github.com/hashicorp/packer/packer-plugin-sdk/acctest" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/provisioner/file" ) func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig() playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["playbook_file"] = playbook_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.HasPrefix(filepath.ToSlash(p.config.StagingDir), DefaultStagingDir) { t.Fatalf("unexpected staging dir %s, expected %s", p.config.StagingDir, DefaultStagingDir) } } func TestProvisionerPrepare_PlaybookFile(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err == nil { t.Fatal("should have error") } config["playbook_file"] = "" err = p.Prepare(config) if err == nil { t.Fatal("should have error") } playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["playbook_file"] = playbook_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_PlaybookFiles(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err == nil { t.Fatal("should have error") } config["playbook_file"] = "" config["playbook_files"] = []string{} err = p.Prepare(config) if err == nil { t.Fatal("should have error") } playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["playbook_file"] = playbook_file.Name() config["playbook_files"] = []string{"some_other_file"} err = p.Prepare(config) if err == nil { t.Fatal("should have error") } p = Provisioner{} config["playbook_file"] = playbook_file.Name() config["playbook_files"] = []string{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } config["playbook_file"] = "" config["playbook_files"] = []string{playbook_file.Name()} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerProvision_PlaybookFiles(t *testing.T) { var p Provisioner config := testConfig() playbooks := createTempFiles("", 3) defer removeFiles(playbooks...) config["playbook_files"] = playbooks err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } comm := &communicatorMock{} if err := p.Provision(context.Background(), packersdk.TestUi(t), comm, make(map[string]interface{})); err != nil { t.Fatalf("err: %s", err) } assertPlaybooksUploaded(comm, playbooks) assertPlaybooksExecuted(comm, playbooks) } func TestProvisionerProvision_PlaybookFilesWithPlaybookDir(t *testing.T) { var p Provisioner config := testConfig() playbook_dir, err := ioutil.TempDir("", "") if err != nil { t.Fatalf("Failed to create playbook_dir: %s", err) } defer os.RemoveAll(playbook_dir) playbooks := createTempFiles(playbook_dir, 3) playbookNames := make([]string, 0, len(playbooks)) playbooksInPlaybookDir := make([]string, 0, len(playbooks)) for _, playbook := range playbooks { playbooksInPlaybookDir = append(playbooksInPlaybookDir, strings.TrimPrefix(playbook, playbook_dir)) playbookNames = append(playbookNames, filepath.Base(playbook)) } config["playbook_files"] = playbooks config["playbook_dir"] = playbook_dir err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } comm := &communicatorMock{} if err := p.Provision(context.Background(), packersdk.TestUi(t), comm, make(map[string]interface{})); err != nil { t.Fatalf("err: %s", err) } assertPlaybooksNotUploaded(comm, playbookNames) assertPlaybooksExecuted(comm, playbooksInPlaybookDir) } func TestProvisionerPrepare_InventoryFile(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err == nil { t.Fatal("should have error") } config["playbook_file"] = "" err = p.Prepare(config) if err == nil { t.Fatal("should have error") } playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["playbook_file"] = playbook_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } inventory_file, err := ioutil.TempFile("", "inventory") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(inventory_file.Name()) config["inventory_file"] = inventory_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_Dirs(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err == nil { t.Fatal("should have error") } config["playbook_file"] = "" err = p.Prepare(config) if err == nil { t.Fatal("should have error") } playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["playbook_file"] = playbook_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } config["playbook_paths"] = []string{playbook_file.Name()} err = p.Prepare(config) if err == nil { t.Fatal("should error if playbook paths is not a dir") } config["playbook_paths"] = []string{os.TempDir()} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } config["role_paths"] = []string{playbook_file.Name()} err = p.Prepare(config) if err == nil { t.Fatal("should error if role paths is not a dir") } config["role_paths"] = []string{os.TempDir()} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } config["group_vars"] = playbook_file.Name() err = p.Prepare(config) if err == nil { t.Fatalf("should error if group_vars path is not a dir") } config["group_vars"] = os.TempDir() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } config["host_vars"] = playbook_file.Name() err = p.Prepare(config) if err == nil { t.Fatalf("should error if host_vars path is not a dir") } config["host_vars"] = os.TempDir() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_CleanStagingDir(t *testing.T) { var p Provisioner config := testConfig() playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["playbook_file"] = playbook_file.Name() config["clean_staging_directory"] = true err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !p.config.CleanStagingDir { t.Fatalf("expected clean_staging_directory to be set") } } func TestProvisionerProvisionDocker_PlaybookFiles(t *testing.T) { testProvisionerProvisionDockerWithPlaybookFiles(t, playbookFilesDockerTemplate) } func TestProvisionerProvisionDocker_PlaybookFilesWithPlaybookDir(t *testing.T) { testProvisionerProvisionDockerWithPlaybookFiles(t, playbookFilesWithPlaybookDirDockerTemplate) } func testProvisionerProvisionDockerWithPlaybookFiles(t *testing.T, templateString string) { if os.Getenv("PACKER_ACC") == "" { t.Skip("This test is only run with PACKER_ACC=1") } // this should be a precheck cmd := exec.Command("docker", "-v") err := cmd.Run() if err != nil { t.Error("docker command not found; please make sure docker is installed") } builderT.Test(t, builderT.TestCase{ Builder: &docker.Builder{}, Template: templateString, Check: func(a []packersdk.Artifact) error { actualContent, err := ioutil.ReadFile("hello_world") if err != nil { return fmt.Errorf("Expected file not found: %s", err) } expectedContent := "Hello world!" if string(actualContent) != expectedContent { return fmt.Errorf(`Unexpected file content: expected="%s", actual="%s"`, expectedContent, actualContent) } return nil }, Teardown: func() error { os.Remove("hello_world") return nil }, ProvisionerStore: packersdk.MapOfProvisioner{ "ansible-local": func() (packersdk.Provisioner, error) { return &Provisioner{}, nil }, "file": func() (packersdk.Provisioner, error) { return &file.Provisioner{}, nil }, }, }) } func assertPlaybooksExecuted(comm *communicatorMock, playbooks []string) { cmdIndex := 0 for _, playbook := range playbooks { playbook = filepath.ToSlash(playbook) for ; cmdIndex < len(comm.startCommand); cmdIndex++ { cmd := comm.startCommand[cmdIndex] if strings.Contains(cmd, "ansible-playbook") && strings.Contains(cmd, playbook) { break } } if cmdIndex == len(comm.startCommand) { panic(fmt.Sprintf("Playbook %s was not executed", playbook)) } } } func assertPlaybooksUploaded(comm *communicatorMock, playbooks []string) { uploadIndex := 0 for _, playbook := range playbooks { playbook = filepath.ToSlash(playbook) for ; uploadIndex < len(comm.uploadDestination); uploadIndex++ { dest := comm.uploadDestination[uploadIndex] if strings.HasSuffix(dest, playbook) { break } } if uploadIndex == len(comm.uploadDestination) { panic(fmt.Sprintf("Playbook %s was not uploaded", playbook)) } } } func assertPlaybooksNotUploaded(comm *communicatorMock, playbooks []string) { for _, playbook := range playbooks { playbook = filepath.ToSlash(playbook) for _, destination := range comm.uploadDestination { if strings.HasSuffix(destination, playbook) { panic(fmt.Sprintf("Playbook %s was uploaded", playbook)) } } } } func testConfig() map[string]interface{} { m := make(map[string]interface{}) return m } func createTempFile(dir string) string { file, err := ioutil.TempFile(dir, "") if err != nil { panic(fmt.Sprintf("err: %s", err)) } return file.Name() } func createTempFiles(dir string, numFiles int) []string { files := make([]string, 0, numFiles) defer func() { // Cleanup the files if not all were created. if len(files) < numFiles { for _, file := range files { os.Remove(file) } } }() for i := 0; i < numFiles; i++ { files = append(files, createTempFile(dir)) } return files } func removeFiles(files ...string) { for _, file := range files { os.Remove(file) } } const playbookFilesDockerTemplate = ` { "builders": [ { "type": "test", "image": "williamyeh/ansible:centos7", "discard": true } ], "provisioners": [ { "type": "ansible-local", "playbook_files": [ "test-fixtures/hello.yml", "test-fixtures/world.yml" ] }, { "type": "file", "source": "/tmp/hello_world", "destination": "hello_world", "direction": "download" } ] } ` const playbookFilesWithPlaybookDirDockerTemplate = ` { "builders": [ { "type": "test", "image": "williamyeh/ansible:centos7", "discard": true } ], "provisioners": [ { "type": "ansible-local", "playbook_files": [ "test-fixtures/hello.yml", "test-fixtures/world.yml" ], "playbook_dir": "test-fixtures" }, { "type": "file", "source": "/tmp/hello_world", "destination": "hello_world", "direction": "download" } ] } ` ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/test-fixtures/�������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023375�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/test-fixtures/hello.yml����������������������������������0000664�0000000�0000000�00000000142�13771713062�0025220�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- - hosts: all tasks: - name: write Hello shell: echo -n "Hello" >> /tmp/hello_world������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/test-fixtures/world.yml����������������������������������0000664�0000000�0000000�00000000145�13771713062�0025247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- - hosts: all tasks: - name: write world! shell: echo -n " world!" >> /tmp/hello_world���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/version/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022234�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible-local/version/version.go���������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024245�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var AnsibleLocalPluginVersion *version.PluginVersion func init() { AnsibleLocalPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/���������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017457�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021275�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/connection-plugin/������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024730�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/connection-plugin/2.4.x/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025501�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/connection-plugin/2.4.x/packer.py���������������������0000664�0000000�0000000�00000015601�13771713062�0027323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.connection.ssh import Connection as SSHConnection DOCUMENTATION = ''' connection: packer short_description: ssh based connections for powershell via packer description: - This connection plugin allows ansible to communicate to the target packer machines via ssh based connections for powershell. author: Packer Community version_added: na options: host: description: Hostname/ip to connect to. default: inventory_hostname vars: - name: ansible_host - name: ansible_ssh_host host_key_checking: #constant: HOST_KEY_CHECKING description: Determines if ssh should check host keys type: boolean ini: - section: defaults key: 'host_key_checking' env: - name: ANSIBLE_HOST_KEY_CHECKING password: description: Authentication password for the C(remote_user). Can be supplied as CLI option. vars: - name: ansible_password - name: ansible_ssh_pass ssh_args: description: Arguments to pass to all ssh cli tools default: '-C -o ControlMaster=auto -o ControlPersist=60s' ini: - section: 'ssh_connection' key: 'ssh_args' env: - name: ANSIBLE_SSH_ARGS ssh_common_args: description: Common extra args for all ssh CLI tools vars: - name: ansible_ssh_common_args ssh_executable: default: ssh description: - This defines the location of the ssh binary. It defaults to `ssh` which will use the first ssh binary available in $PATH. - This option is usually not required, it might be useful when access to system ssh is restricted, or when using ssh wrappers to connect to remote hosts. env: [{name: ANSIBLE_SSH_EXECUTABLE}] ini: - {key: ssh_executable, section: ssh_connection} yaml: {key: ssh_connection.ssh_executable} #const: ANSIBLE_SSH_EXECUTABLE version_added: "2.2" scp_extra_args: description: Extra exclusive to the 'scp' CLI vars: - name: ansible_scp_extra_args sftp_extra_args: description: Extra exclusive to the 'sftp' CLI vars: - name: ansible_sftp_extra_args ssh_extra_args: description: Extra exclusive to the 'ssh' CLI vars: - name: ansible_ssh_extra_args retries: # constant: ANSIBLE_SSH_RETRIES description: Number of attempts to connect. default: 3 type: integer env: - name: ANSIBLE_SSH_RETRIES ini: - section: connection key: retries - section: ssh_connection key: retries port: description: Remote port to connect to. type: int default: 22 ini: - section: defaults key: remote_port env: - name: ANSIBLE_REMOTE_PORT vars: - name: ansible_port - name: ansible_ssh_port remote_user: description: - User name with which to login to the remote server, normally set by the remote_user keyword. - If no user is supplied, Ansible will let the ssh client binary choose the user as it normally ini: - section: defaults key: remote_user env: - name: ANSIBLE_REMOTE_USER vars: - name: ansible_user - name: ansible_ssh_user pipelining: default: ANSIBLE_PIPELINING description: - Pipelining reduces the number of SSH operations required to execute a module on the remote server, by executing many Ansible modules without actual file transfer. - This can result in a very significant performance improvement when enabled. - However this conflicts with privilege escalation (become). For example, when using sudo operations you must first disable 'requiretty' in the sudoers file for the target hosts, which is why this feature is disabled by default. env: - name: ANSIBLE_PIPELINING #- name: ANSIBLE_SSH_PIPELINING ini: - section: defaults key: pipelining #- section: ssh_connection # key: pipelining type: boolean vars: - name: ansible_pipelining - name: ansible_ssh_pipelining private_key_file: description: - Path to private key file to use for authentication ini: - section: defaults key: private_key_file env: - name: ANSIBLE_PRIVATE_KEY_FILE vars: - name: ansible_private_key_file - name: ansible_ssh_private_key_file control_path: default: null description: - This is the location to save ssh's ControlPath sockets, it uses ssh's variable substitution. - Since 2.3, if null, ansible will generate a unique hash. Use `%(directory)s` to indicate where to use the control dir path setting. env: - name: ANSIBLE_SSH_CONTROL_PATH ini: - key: control_path section: ssh_connection control_path_dir: default: ~/.ansible/cp description: - This sets the directory to use for ssh control path if the control path setting is null. - Also, provides the `%(directory)s` variable for the control path setting. env: - name: ANSIBLE_SSH_CONTROL_PATH_DIR ini: - section: ssh_connection key: control_path_dir sftp_batch_mode: default: True description: 'TODO: write it' env: [{name: ANSIBLE_SFTP_BATCH_MODE}] ini: - {key: sftp_batch_mode, section: ssh_connection} type: boolean scp_if_ssh: default: smart description: - "Prefered method to use when transfering files over ssh" - When set to smart, Ansible will try them until one succeeds or they all fail - If set to True, it will force 'scp', if False it will use 'sftp' env: [{name: ANSIBLE_SCP_IF_SSH}] ini: - {key: scp_if_ssh, section: ssh_connection} ''' class Connection(SSHConnection): ''' ssh based connections for powershell via packer''' transport = 'packer' has_pipelining = True become_methods = [] allow_executable = False module_implementation_preferences = ('.ps1', '') def __init__(self, *args, **kwargs): super(Connection, self).__init__(*args, **kwargs)�������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/connection-plugin/2.5.x/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025502�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/connection-plugin/2.5.x/packer.py���������������������0000664�0000000�0000000�00000017023�13771713062�0027324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.connection.ssh import Connection as SSHConnection DOCUMENTATION = ''' connection: packer short_description: ssh based connections for powershell via packer description: - This connection plugin allows ansible to communicate to the target packer machines via ssh based connections for powershell. author: Packer Community version_added: na options: host: description: Hostname/ip to connect to. default: inventory_hostname vars: - name: ansible_host - name: ansible_ssh_host host_key_checking: description: Determines if ssh should check host keys type: boolean ini: - section: defaults key: 'host_key_checking' - section: ssh_connection key: 'host_key_checking' version_added: '2.5' env: - name: ANSIBLE_HOST_KEY_CHECKING - name: ANSIBLE_SSH_HOST_KEY_CHECKING version_added: '2.5' vars: - name: ansible_host_key_checking version_added: '2.5' - name: ansible_ssh_host_key_checking version_added: '2.5' password: description: Authentication password for the C(remote_user). Can be supplied as CLI option. vars: - name: ansible_password - name: ansible_ssh_pass ssh_args: description: Arguments to pass to all ssh cli tools default: '-C -o ControlMaster=auto -o ControlPersist=60s' ini: - section: 'ssh_connection' key: 'ssh_args' env: - name: ANSIBLE_SSH_ARGS ssh_common_args: description: Common extra args for all ssh CLI tools vars: - name: ansible_ssh_common_args ssh_executable: default: ssh description: - This defines the location of the ssh binary. It defaults to `ssh` which will use the first ssh binary available in $PATH. - This option is usually not required, it might be useful when access to system ssh is restricted, or when using ssh wrappers to connect to remote hosts. env: [{name: ANSIBLE_SSH_EXECUTABLE}] ini: - {key: ssh_executable, section: ssh_connection} yaml: {key: ssh_connection.ssh_executable} #const: ANSIBLE_SSH_EXECUTABLE version_added: "2.2" scp_extra_args: description: Extra exclusive to the 'scp' CLI vars: - name: ansible_scp_extra_args sftp_extra_args: description: Extra exclusive to the 'sftp' CLI vars: - name: ansible_sftp_extra_args ssh_extra_args: description: Extra exclusive to the 'ssh' CLI vars: - name: ansible_ssh_extra_args retries: # constant: ANSIBLE_SSH_RETRIES description: Number of attempts to connect. default: 3 type: integer env: - name: ANSIBLE_SSH_RETRIES ini: - section: connection key: retries - section: ssh_connection key: retries port: description: Remote port to connect to. type: int default: 22 ini: - section: defaults key: remote_port env: - name: ANSIBLE_REMOTE_PORT vars: - name: ansible_port - name: ansible_ssh_port remote_user: description: - User name with which to login to the remote server, normally set by the remote_user keyword. - If no user is supplied, Ansible will let the ssh client binary choose the user as it normally ini: - section: defaults key: remote_user env: - name: ANSIBLE_REMOTE_USER vars: - name: ansible_user - name: ansible_ssh_user pipelining: default: ANSIBLE_PIPELINING description: - Pipelining reduces the number of SSH operations required to execute a module on the remote server, by executing many Ansible modules without actual file transfer. - This can result in a very significant performance improvement when enabled. - However this conflicts with privilege escalation (become). For example, when using sudo operations you must first disable 'requiretty' in the sudoers file for the target hosts, which is why this feature is disabled by default. env: - name: ANSIBLE_PIPELINING #- name: ANSIBLE_SSH_PIPELINING ini: - section: defaults key: pipelining #- section: ssh_connection # key: pipelining type: boolean vars: - name: ansible_pipelining - name: ansible_ssh_pipelining private_key_file: description: - Path to private key file to use for authentication ini: - section: defaults key: private_key_file env: - name: ANSIBLE_PRIVATE_KEY_FILE vars: - name: ansible_private_key_file - name: ansible_ssh_private_key_file control_path: default: null description: - This is the location to save ssh's ControlPath sockets, it uses ssh's variable substitution. - Since 2.3, if null, ansible will generate a unique hash. Use `%(directory)s` to indicate where to use the control dir path setting. env: - name: ANSIBLE_SSH_CONTROL_PATH ini: - key: control_path section: ssh_connection control_path_dir: default: ~/.ansible/cp description: - This sets the directory to use for ssh control path if the control path setting is null. - Also, provides the `%(directory)s` variable for the control path setting. env: - name: ANSIBLE_SSH_CONTROL_PATH_DIR ini: - section: ssh_connection key: control_path_dir sftp_batch_mode: default: True description: 'TODO: write it' env: [{name: ANSIBLE_SFTP_BATCH_MODE}] ini: - {key: sftp_batch_mode, section: ssh_connection} type: boolean scp_if_ssh: default: smart description: - "Prefered method to use when transfering files over ssh" - When set to smart, Ansible will try them until one succeeds or they all fail - If set to True, it will force 'scp', if False it will use 'sftp' env: [{name: ANSIBLE_SCP_IF_SSH}] ini: - {key: scp_if_ssh, section: ssh_connection} use_tty: version_added: '2.5' default: True description: add -tt to ssh commands to force tty allocation env: [{name: ANSIBLE_SSH_USETTY}] ini: - {key: usetty, section: ssh_connection} type: boolean yaml: {key: connection.usetty} ''' class Connection(SSHConnection): ''' ssh based connections for powershell via packer''' transport = 'packer' has_pipelining = True become_methods = [] allow_executable = False module_implementation_preferences = ('.ps1', '') def __init__(self, *args, **kwargs): super(Connection, self).__init__(*args, **kwargs)�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/connection-plugin/2.6.x/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025503�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/examples/connection-plugin/2.6.x/packer.py���������������������0000664�0000000�0000000�00000020224�13771713062�0027322�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.connection.ssh import Connection as SSHConnection DOCUMENTATION = ''' connection: packer short_description: ssh based connections for powershell via packer description: - This connection plugin allows ansible to communicate to the target packer machines via ssh based connections for powershell. author: Packer Community version_added: na options: host: description: Hostname/ip to connect to. default: inventory_hostname vars: - name: ansible_host - name: ansible_ssh_host host_key_checking: description: Determines if ssh should check host keys type: boolean ini: - section: defaults key: 'host_key_checking' - section: ssh_connection key: 'host_key_checking' version_added: '2.5' env: - name: ANSIBLE_HOST_KEY_CHECKING - name: ANSIBLE_SSH_HOST_KEY_CHECKING version_added: '2.5' vars: - name: ansible_host_key_checking version_added: '2.5' - name: ansible_ssh_host_key_checking version_added: '2.5' password: description: Authentication password for the C(remote_user). Can be supplied as CLI option. vars: - name: ansible_password - name: ansible_ssh_pass ssh_args: description: Arguments to pass to all ssh cli tools default: '-C -o ControlMaster=auto -o ControlPersist=60s' ini: - section: 'ssh_connection' key: 'ssh_args' env: - name: ANSIBLE_SSH_ARGS ssh_common_args: description: Common extra args for all ssh CLI tools vars: - name: ansible_ssh_common_args ssh_executable: default: ssh description: - This defines the location of the ssh binary. It defaults to ``ssh`` which will use the first ssh binary available in $PATH. - This option is usually not required, it might be useful when access to system ssh is restricted, or when using ssh wrappers to connect to remote hosts. env: [{name: ANSIBLE_SSH_EXECUTABLE}] ini: - {key: ssh_executable, section: ssh_connection} #const: ANSIBLE_SSH_EXECUTABLE version_added: "2.2" sftp_executable: default: sftp description: - This defines the location of the sftp binary. It defaults to ``sftp`` which will use the first binary available in $PATH. env: [{name: ANSIBLE_SFTP_EXECUTABLE}] ini: - {key: sftp_executable, section: ssh_connection} version_added: "2.6" scp_executable: default: scp description: - This defines the location of the scp binary. It defaults to `scp` which will use the first binary available in $PATH. env: [{name: ANSIBLE_SCP_EXECUTABLE}] ini: - {key: scp_executable, section: ssh_connection} version_added: "2.6" scp_extra_args: description: Extra exclusive to the ``scp`` CLI vars: - name: ansible_scp_extra_args sftp_extra_args: description: Extra exclusive to the ``sftp`` CLI vars: - name: ansible_sftp_extra_args ssh_extra_args: description: Extra exclusive to the 'ssh' CLI vars: - name: ansible_ssh_extra_args retries: # constant: ANSIBLE_SSH_RETRIES description: Number of attempts to connect. default: 3 type: integer env: - name: ANSIBLE_SSH_RETRIES ini: - section: connection key: retries - section: ssh_connection key: retries port: description: Remote port to connect to. type: int default: 22 ini: - section: defaults key: remote_port env: - name: ANSIBLE_REMOTE_PORT vars: - name: ansible_port - name: ansible_ssh_port remote_user: description: - User name with which to login to the remote server, normally set by the remote_user keyword. - If no user is supplied, Ansible will let the ssh client binary choose the user as it normally ini: - section: defaults key: remote_user env: - name: ANSIBLE_REMOTE_USER vars: - name: ansible_user - name: ansible_ssh_user pipelining: default: ANSIBLE_PIPELINING description: - Pipelining reduces the number of SSH operations required to execute a module on the remote server, by executing many Ansible modules without actual file transfer. - This can result in a very significant performance improvement when enabled. - However this conflicts with privilege escalation (become). For example, when using sudo operations you must first disable 'requiretty' in the sudoers file for the target hosts, which is why this feature is disabled by default. env: - name: ANSIBLE_PIPELINING #- name: ANSIBLE_SSH_PIPELINING ini: - section: defaults key: pipelining #- section: ssh_connection # key: pipelining type: boolean vars: - name: ansible_pipelining - name: ansible_ssh_pipelining private_key_file: description: - Path to private key file to use for authentication ini: - section: defaults key: private_key_file env: - name: ANSIBLE_PRIVATE_KEY_FILE vars: - name: ansible_private_key_file - name: ansible_ssh_private_key_file control_path: description: - This is the location to save ssh's ControlPath sockets, it uses ssh's variable substitution. - Since 2.3, if null, ansible will generate a unique hash. Use `%(directory)s` to indicate where to use the control dir path setting. env: - name: ANSIBLE_SSH_CONTROL_PATH ini: - key: control_path section: ssh_connection control_path_dir: default: ~/.ansible/cp description: - This sets the directory to use for ssh control path if the control path setting is null. - Also, provides the `%(directory)s` variable for the control path setting. env: - name: ANSIBLE_SSH_CONTROL_PATH_DIR ini: - section: ssh_connection key: control_path_dir sftp_batch_mode: default: 'yes' description: 'TODO: write it' env: [{name: ANSIBLE_SFTP_BATCH_MODE}] ini: - {key: sftp_batch_mode, section: ssh_connection} type: bool scp_if_ssh: default: smart description: - "Prefered method to use when transfering files over ssh" - When set to smart, Ansible will try them until one succeeds or they all fail - If set to True, it will force 'scp', if False it will use 'sftp' env: [{name: ANSIBLE_SCP_IF_SSH}] ini: - {key: scp_if_ssh, section: ssh_connection} use_tty: version_added: '2.5' default: 'yes' description: add -tt to ssh commands to force tty allocation env: [{name: ANSIBLE_SSH_USETTY}] ini: - {key: usetty, section: ssh_connection} type: bool yaml: {key: connection.usetty} ''' class Connection(SSHConnection): ''' ssh based connections for powershell via packer''' transport = 'packer' has_pipelining = True become_methods = [] allow_executable = False module_implementation_preferences = ('.ps1', '') def __init__(self, *args, **kwargs): super(Connection, self).__init__(*args, **kwargs)����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/mock_ansible.go������������������������������������������������0000664�0000000�0000000�00000001273�13771713062�0022437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !windows package ansible import ( "fmt" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) type provisionLogicTracker struct { setupAdapterCalled bool executeAnsibleCalled bool happyPath bool } func (l *provisionLogicTracker) setupAdapter(ui packersdk.Ui, comm packersdk.Communicator) (string, error) { l.setupAdapterCalled = true if l.happyPath { return "fakeKeyString", nil } return "", fmt.Errorf("chose sadpath") } func (l *provisionLogicTracker) executeAnsible(ui packersdk.Ui, comm packersdk.Communicator, privKeyFile string) error { l.executeAnsibleCalled = true if l.happyPath { return fmt.Errorf("Chose sadpath") } return nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/provisioner.go�������������������������������������������������0000664�0000000�0000000�00000100302�13771713062�0022361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config //go:generate struct-markdown package ansible import ( "bufio" "bytes" "context" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "fmt" "io" "io/ioutil" "log" "net" "os" "os/exec" "os/user" "path/filepath" "regexp" "strconv" "strings" "sync" "unicode" "golang.org/x/crypto/ssh" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/adapter" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) type Config struct { common.PackerConfig `mapstructure:",squash"` ctx interpolate.Context // The command to invoke ansible. Defaults to // `ansible-playbook`. If you would like to provide a more complex command, // for example, something that sets up a virtual environment before calling // ansible, take a look at the ansible wrapper guide below for inspiration. // Please note that Packer expects Command to be a path to an executable. // Arbitrary bash scripting will not work and needs to go inside an // executable script. Command string `mapstructure:"command"` // Extra arguments to pass to Ansible. // These arguments _will not_ be passed through a shell and arguments should // not be quoted. Usage example: // // ```json // "extra_arguments": [ "--extra-vars", "Region={{user `Region`}} Stage={{user `Stage`}}" ] // ``` // // If you are running a Windows build on AWS, Azure, Google Compute, or OpenStack // and would like to access the auto-generated password that Packer uses to // connect to a Windows instance via WinRM, you can use the template variable // `{{.WinRMPassword}}` in this option. For example: // // ```json // "extra_arguments": [ // "--extra-vars", "winrm_password={{ .WinRMPassword }}" // ] // ``` ExtraArguments []string `mapstructure:"extra_arguments"` // Environment variables to set before // running Ansible. Usage example: // // ```json // "ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False", "ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s'", "ANSIBLE_NOCOLOR=True" ] // ``` // // This is a [template engine](/docs/templates/engine). Therefore, you // may use user variables and template functions in this field. // // For example, if you are running a Windows build on AWS, Azure, // Google Compute, or OpenStack and would like to access the auto-generated // password that Packer uses to connect to a Windows instance via WinRM, you // can use the template variable `{{.WinRMPassword}}` in this option. Example: // // ```json // "ansible_env_vars": [ "WINRM_PASSWORD={{.WinRMPassword}}" ], // ``` AnsibleEnvVars []string `mapstructure:"ansible_env_vars"` // The playbook to be run by Ansible. PlaybookFile string `mapstructure:"playbook_file" required:"true"` // Specifies --ssh-extra-args on command line defaults to -o IdentitiesOnly=yes AnsibleSSHExtraArgs []string `mapstructure:"ansible_ssh_extra_args"` // The groups into which the Ansible host should // be placed. When unspecified, the host is not associated with any groups. Groups []string `mapstructure:"groups"` // The groups which should be present in // inventory file but remain empty. EmptyGroups []string `mapstructure:"empty_groups"` // The alias by which the Ansible host should be // known. Defaults to `default`. This setting is ignored when using a custom // inventory file. HostAlias string `mapstructure:"host_alias"` // The `ansible_user` to use. Defaults to the user running // packer, NOT the user set for your communicator. If you want to use the same // user as the communicator, you will need to manually set it again in this // field. User string `mapstructure:"user"` // The port on which to attempt to listen for SSH // connections. This value is a starting point. The provisioner will attempt // listen for SSH connections on the first available of ten ports, starting at // `local_port`. A system-chosen port is used when `local_port` is missing or // empty. LocalPort int `mapstructure:"local_port"` // The SSH key that will be used to run the SSH // server on the host machine to forward commands to the target machine. // Ansible connects to this server and will validate the identity of the // server using the system known_hosts. The default behavior is to generate // and use a onetime key. Host key checking is disabled via the // `ANSIBLE_HOST_KEY_CHECKING` environment variable if the key is generated. SSHHostKeyFile string `mapstructure:"ssh_host_key_file"` // The SSH public key of the Ansible // `ssh_user`. The default behavior is to generate and use a onetime key. If // this key is generated, the corresponding private key is passed to // `ansible-playbook` with the `-e ansible_ssh_private_key_file` option. SSHAuthorizedKeyFile string `mapstructure:"ssh_authorized_key_file"` // The command to run on the machine being // provisioned by Packer to handle the SFTP protocol that Ansible will use to // transfer files. The command should read and write on stdin and stdout, // respectively. Defaults to `/usr/lib/sftp-server -e`. SFTPCmd string `mapstructure:"sftp_command"` // Check if ansible is installed prior to // running. Set this to `true`, for example, if you're going to install // ansible during the packer run. SkipVersionCheck bool `mapstructure:"skip_version_check"` UseSFTP bool `mapstructure:"use_sftp"` // The directory in which to place the // temporary generated Ansible inventory file. By default, this is the // system-specific temporary file location. The fully-qualified name of this // temporary file will be passed to the `-i` argument of the `ansible` command // when this provisioner runs ansible. Specify this if you have an existing // inventory directory with `host_vars` `group_vars` that you would like to // use in the playbook that this provisioner will run. InventoryDirectory string `mapstructure:"inventory_directory"` // This template represents the format for the lines added to the temporary // inventory file that Packer will create to run Ansible against your image. // The default for recent versions of Ansible is: // "{{ .HostAlias }} ansible_host={{ .Host }} ansible_user={{ .User }} ansible_port={{ .Port }}\n" // Available template engines are: This option is a template engine; // variables available to you include the examples in the default (Host, // HostAlias, User, Port) as well as any variables available to you via the // "build" template engine. InventoryFileTemplate string `mapstructure:"inventory_file_template"` // The inventory file to use during provisioning. // When unspecified, Packer will create a temporary inventory file and will // use the `host_alias`. InventoryFile string `mapstructure:"inventory_file"` // If `true`, the Ansible provisioner will // not delete the temporary inventory file it creates in order to connect to // the instance. This is useful if you are trying to debug your ansible run // and using "--on-error=ask" in order to leave your instance running while you // test your playbook. this option is not used if you set an `inventory_file`. KeepInventoryFile bool `mapstructure:"keep_inventory_file"` // A requirements file which provides a way to // install roles or collections with the [ansible-galaxy // cli](https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#the-ansible-galaxy-command-line-tool) // on the local machine before executing `ansible-playbook`. By default, this is empty. GalaxyFile string `mapstructure:"galaxy_file"` // The command to invoke ansible-galaxy. By default, this is // `ansible-galaxy`. GalaxyCommand string `mapstructure:"galaxy_command"` // Force overwriting an existing role. // Adds `--force` option to `ansible-galaxy` command. By default, this is // `false`. GalaxyForceInstall bool `mapstructure:"galaxy_force_install"` // The path to the directory on your local system in which to // install the roles. Adds `--roles-path /path/to/your/roles` to // `ansible-galaxy` command. By default, this is empty, and thus `--roles-path` // option is not added to the command. RolesPath string `mapstructure:"roles_path"` // The path to the directory on your local system in which to // install the collections. Adds `--collections-path /path/to/your/collections` to // `ansible-galaxy` command. By default, this is empty, and thus `--collections-path` // option is not added to the command. CollectionsPath string `mapstructure:"collections_path"` // When `true`, set up a localhost proxy adapter // so that Ansible has an IP address to connect to, even if your guest does not // have an IP address. For example, the adapter is necessary for Docker builds // to use the Ansible provisioner. If you set this option to `false`, but // Packer cannot find an IP address to connect Ansible to, it will // automatically set up the adapter anyway. // // In order for Ansible to connect properly even when use_proxy is false, you // need to make sure that you are either providing a valid username and ssh key // to the ansible provisioner directly, or that the username and ssh key // being used by the ssh communicator will work for your needs. If you do not // provide a user to ansible, it will use the user associated with your // builder, not the user running Packer. // use_proxy=false is currently only supported for SSH and WinRM. // // Currently, this defaults to `true` for all connection types. In the future, // this option will be changed to default to `false` for SSH and WinRM // connections where the provisioner has access to a host IP. UseProxy config.Trilean `mapstructure:"use_proxy"` userWasEmpty bool } type Provisioner struct { config Config adapter *adapter.Adapter done chan struct{} ansibleVersion string ansibleMajVersion uint generatedData map[string]interface{} setupAdapterFunc func(ui packersdk.Ui, comm packersdk.Communicator) (string, error) executeAnsibleFunc func(ui packersdk.Ui, comm packersdk.Communicator, privKeyFile string) error } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { p.done = make(chan struct{}) err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "ansible", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "inventory_file_template", }, }, }, raws...) if err != nil { return err } // Defaults if p.config.Command == "" { p.config.Command = "ansible-playbook" } if p.config.GalaxyCommand == "" { p.config.GalaxyCommand = "ansible-galaxy" } if p.config.HostAlias == "" { p.config.HostAlias = "default" } var errs *packersdk.MultiError err = validateFileConfig(p.config.PlaybookFile, "playbook_file", true) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } // Check that the galaxy file exists, if configured if len(p.config.GalaxyFile) > 0 { err = validateFileConfig(p.config.GalaxyFile, "galaxy_file", true) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } // Check that the authorized key file exists if len(p.config.SSHAuthorizedKeyFile) > 0 { err = validateFileConfig(p.config.SSHAuthorizedKeyFile, "ssh_authorized_key_file", true) if err != nil { log.Println(p.config.SSHAuthorizedKeyFile, "does not exist") errs = packersdk.MultiErrorAppend(errs, err) } } if len(p.config.SSHHostKeyFile) > 0 { err = validateFileConfig(p.config.SSHHostKeyFile, "ssh_host_key_file", true) if err != nil { log.Println(p.config.SSHHostKeyFile, "does not exist") errs = packersdk.MultiErrorAppend(errs, err) } } else { p.config.AnsibleEnvVars = append(p.config.AnsibleEnvVars, "ANSIBLE_HOST_KEY_CHECKING=False") } if !p.config.UseSFTP { p.config.AnsibleEnvVars = append(p.config.AnsibleEnvVars, "ANSIBLE_SCP_IF_SSH=True") } if p.config.LocalPort > 65535 { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("local_port: %d must be a valid port", p.config.LocalPort)) } if len(p.config.InventoryDirectory) > 0 { err = validateInventoryDirectoryConfig(p.config.InventoryDirectory) if err != nil { log.Println(p.config.InventoryDirectory, "does not exist") errs = packersdk.MultiErrorAppend(errs, err) } } if !p.config.SkipVersionCheck { err = p.getVersion() if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } } if p.config.User == "" { p.config.userWasEmpty = true usr, err := user.Current() if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } else { p.config.User = usr.Username } } if p.config.User == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("user: could not determine current user from environment.")) } // These fields exist so that we can replace the functions for testing // logic inside of the Provision func; in actual use, these don't ever // need to get set. if p.setupAdapterFunc == nil { p.setupAdapterFunc = p.setupAdapter } if p.executeAnsibleFunc == nil { p.executeAnsibleFunc = p.executeAnsible } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) getVersion() error { out, err := exec.Command(p.config.Command, "--version").Output() if err != nil { return fmt.Errorf( "Error running \"%s --version\": %s", p.config.Command, err.Error()) } versionRe := regexp.MustCompile(`\w (\d+\.\d+[.\d+]*)`) matches := versionRe.FindStringSubmatch(string(out)) if matches == nil { return fmt.Errorf( "Could not find %s version in output:\n%s", p.config.Command, string(out)) } version := matches[1] log.Printf("%s version: %s", p.config.Command, version) p.ansibleVersion = version majVer, err := strconv.ParseUint(strings.Split(version, ".")[0], 10, 0) if err != nil { return fmt.Errorf("Could not parse major version from \"%s\".", version) } p.ansibleMajVersion = uint(majVer) return nil } func (p *Provisioner) setupAdapter(ui packersdk.Ui, comm packersdk.Communicator) (string, error) { ui.Message("Setting up proxy adapter for Ansible....") k, err := newUserKey(p.config.SSHAuthorizedKeyFile) if err != nil { return "", err } hostSigner, err := newSigner(p.config.SSHHostKeyFile) if err != nil { return "", fmt.Errorf("error creating host signer: %s", err) } keyChecker := ssh.CertChecker{ UserKeyFallback: func(conn ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error) { if user := conn.User(); user != p.config.User { return nil, fmt.Errorf("authentication failed: %s is not a valid user", user) } if !bytes.Equal(k.Marshal(), pubKey.Marshal()) { return nil, errors.New("authentication failed: unauthorized key") } return nil, nil }, IsUserAuthority: func(k ssh.PublicKey) bool { return true }, } config := &ssh.ServerConfig{ AuthLogCallback: func(conn ssh.ConnMetadata, method string, err error) { log.Printf("authentication attempt from %s to %s as %s using %s", conn.RemoteAddr(), conn.LocalAddr(), conn.User(), method) }, PublicKeyCallback: keyChecker.Authenticate, //NoClientAuth: true, } config.AddHostKey(hostSigner) localListener, err := func() (net.Listener, error) { port := p.config.LocalPort tries := 1 if port != 0 { tries = 10 } for i := 0; i < tries; i++ { l, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", port)) port++ if err != nil { ui.Say(err.Error()) continue } _, portStr, err := net.SplitHostPort(l.Addr().String()) if err != nil { ui.Say(err.Error()) continue } p.config.LocalPort, err = strconv.Atoi(portStr) if err != nil { ui.Say(err.Error()) continue } return l, nil } return nil, errors.New("Error setting up SSH proxy connection") }() if err != nil { return "", err } ui = &packersdk.SafeUi{ Sem: make(chan int, 1), Ui: ui, } p.adapter = adapter.NewAdapter(p.done, localListener, config, p.config.SFTPCmd, ui, comm) return k.privKeyFile, nil } const DefaultSSHInventoryFilev2 = "{{ .HostAlias }} ansible_host={{ .Host }} ansible_user={{ .User }} ansible_port={{ .Port }}\n" const DefaultSSHInventoryFilev1 = "{{ .HostAlias }} ansible_ssh_host={{ .Host }} ansible_ssh_user={{ .User }} ansible_ssh_port={{ .Port }}\n" const DefaultWinRMInventoryFilev2 = "{{ .HostAlias}} ansible_host={{ .Host }} ansible_connection=winrm ansible_winrm_transport=basic ansible_shell_type=powershell ansible_user={{ .User}} ansible_port={{ .Port }}\n" func (p *Provisioner) createInventoryFile() error { log.Printf("Creating inventory file for Ansible run...") tf, err := ioutil.TempFile(p.config.InventoryDirectory, "packer-provisioner-ansible") if err != nil { return fmt.Errorf("Error preparing inventory file: %s", err) } // If user has defiend their own inventory template, use it. hostTemplate := p.config.InventoryFileTemplate if hostTemplate == "" { // figure out which inventory line template to use hostTemplate = DefaultSSHInventoryFilev2 if p.ansibleMajVersion < 2 { hostTemplate = DefaultSSHInventoryFilev1 } if p.config.UseProxy.False() && p.generatedData["ConnType"] == "winrm" { hostTemplate = DefaultWinRMInventoryFilev2 } } // interpolate template to generate host with necessary vars. ctxData := p.generatedData ctxData["HostAlias"] = p.config.HostAlias ctxData["User"] = p.config.User if !p.config.UseProxy.False() { ctxData["Host"] = "127.0.0.1" ctxData["Port"] = p.config.LocalPort } p.config.ctx.Data = ctxData host, err := interpolate.Render(hostTemplate, &p.config.ctx) if err != nil { return fmt.Errorf("Error generating inventory file from template: %s", err) } w := bufio.NewWriter(tf) w.WriteString(host) for _, group := range p.config.Groups { fmt.Fprintf(w, "[%s]\n%s", group, host) } for _, group := range p.config.EmptyGroups { fmt.Fprintf(w, "[%s]\n", group) } if err := w.Flush(); err != nil { tf.Close() os.Remove(tf.Name()) return fmt.Errorf("Error preparing inventory file: %s", err) } tf.Close() p.config.InventoryFile = tf.Name() return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ui.Say("Provisioning with Ansible...") // Interpolate env vars to check for generated values like password and port p.generatedData = generatedData p.config.ctx.Data = generatedData for i, envVar := range p.config.AnsibleEnvVars { envVar, err := interpolate.Render(envVar, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate ansible env vars: %s", err) } p.config.AnsibleEnvVars[i] = envVar } // Interpolate extra vars to check for generated values like password and port for i, arg := range p.config.ExtraArguments { arg, err := interpolate.Render(arg, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate ansible env vars: %s", err) } p.config.ExtraArguments[i] = arg } // Set up proxy if host IP is missing or communicator type is wrong. if p.config.UseProxy.False() { hostIP := generatedData["Host"].(string) if hostIP == "" { ui.Error("Warning: use_proxy is false, but instance does" + " not have an IP address to give to Ansible. Falling back" + " to use localhost proxy.") p.config.UseProxy = config.TriTrue } connType := generatedData["ConnType"] if connType != "ssh" && connType != "winrm" { ui.Error("Warning: use_proxy is false, but communicator is " + "neither ssh nor winrm, so without the proxy ansible will not" + " function. Falling back to localhost proxy.") p.config.UseProxy = config.TriTrue } } privKeyFile := "" if !p.config.UseProxy.False() { // We set up the proxy if useProxy is either true or unset. pkf, err := p.setupAdapterFunc(ui, comm) if err != nil { return err } // This is necessary to avoid accidentally redeclaring // privKeyFile in the scope of this if statement. privKeyFile = pkf defer func() { log.Print("shutting down the SSH proxy") close(p.done) p.adapter.Shutdown() }() go p.adapter.Serve() // Remove the private key file if len(privKeyFile) > 0 { defer os.Remove(privKeyFile) } } else { connType := generatedData["ConnType"].(string) switch connType { case "ssh": ui.Message("Not using Proxy adapter for Ansible run:\n" + "\tUsing ssh keys from Packer communicator...") // In this situation, we need to make sure we have the // private key we actually use to access the instance. SSHPrivateKeyFile := generatedData["SSHPrivateKeyFile"].(string) SSHAgentAuth := generatedData["SSHAgentAuth"].(bool) if SSHPrivateKeyFile != "" || SSHAgentAuth { privKeyFile = SSHPrivateKeyFile } else { // See if we can get a private key and write that to a tmpfile SSHPrivateKey := generatedData["SSHPrivateKey"].(string) tmpSSHPrivateKey, err := tmp.File("ansible-key") if err != nil { return fmt.Errorf("Error writing private key to temp file for"+ "ansible connection: %v", err) } _, err = tmpSSHPrivateKey.WriteString(SSHPrivateKey) if err != nil { return errors.New("failed to write private key to temp file") } err = tmpSSHPrivateKey.Close() if err != nil { return errors.New("failed to close private key temp file") } privKeyFile = tmpSSHPrivateKey.Name() } // Also make sure that the username matches the SSH keys given. if p.config.userWasEmpty { p.config.User = generatedData["User"].(string) } case "winrm": ui.Message("Not using Proxy adapter for Ansible run:\n" + "\tUsing WinRM Password from Packer communicator...") } } if len(p.config.InventoryFile) == 0 { // Create the inventory file err := p.createInventoryFile() if err != nil { return err } if !p.config.KeepInventoryFile { // Delete the generated inventory file defer func() { os.Remove(p.config.InventoryFile) p.config.InventoryFile = "" }() } } if err := p.executeAnsibleFunc(ui, comm, privKeyFile); err != nil { return fmt.Errorf("Error executing Ansible: %s", err) } return nil } func (p *Provisioner) executeGalaxy(ui packersdk.Ui, comm packersdk.Communicator) error { galaxyFile := filepath.ToSlash(p.config.GalaxyFile) // ansible-galaxy install -r requirements.yml roleArgs := []string{"install", "-r", galaxyFile} // Instead of modifying args depending on config values and removing or modifying values from // the slice between role and collection installs, just use 2 slices and simplify everything collectionArgs := []string{"collection", "install", "-r", galaxyFile} // Add force to arguments if p.config.GalaxyForceInstall { roleArgs = append(roleArgs, "-f") collectionArgs = append(collectionArgs, "-f") } // Add roles_path argument if specified if p.config.RolesPath != "" { roleArgs = append(roleArgs, "-p", filepath.ToSlash(p.config.RolesPath)) } // Add collections_path argument if specified if p.config.CollectionsPath != "" { collectionArgs = append(collectionArgs, "-p", filepath.ToSlash(p.config.CollectionsPath)) } // Search galaxy_file for roles and collections keywords f, err := ioutil.ReadFile(galaxyFile) if err != nil { return err } hasRoles, _ := regexp.Match(`(?m)^roles:`, f) hasCollections, _ := regexp.Match(`(?m)^collections:`, f) // If if roles keyword present (v2 format), or no collections keywork present (v1), install roles if hasRoles || !hasCollections { if roleInstallError := p.invokeGalaxyCommand(roleArgs, ui, comm); roleInstallError != nil { return roleInstallError } } // If collections keyword present (v2 format), install collections if hasCollections { if collectionInstallError := p.invokeGalaxyCommand(collectionArgs, ui, comm); collectionInstallError != nil { return collectionInstallError } } return nil } // Intended to be invoked from p.executeGalaxy depending on the Ansible Galaxy parameters passed to Packer func (p *Provisioner) invokeGalaxyCommand(args []string, ui packersdk.Ui, comm packersdk.Communicator) error { ui.Message(fmt.Sprintf("Executing Ansible Galaxy")) cmd := exec.Command(p.config.GalaxyCommand, args...) stdout, err := cmd.StdoutPipe() if err != nil { return err } stderr, err := cmd.StderrPipe() if err != nil { return err } wg := sync.WaitGroup{} repeat := func(r io.ReadCloser) { reader := bufio.NewReader(r) for { line, err := reader.ReadString('\n') if line != "" { line = strings.TrimRightFunc(line, unicode.IsSpace) ui.Message(line) } if err != nil { if err == io.EOF { break } else { ui.Error(err.Error()) break } } } wg.Done() } wg.Add(2) go repeat(stdout) go repeat(stderr) if err := cmd.Start(); err != nil { return err } wg.Wait() err = cmd.Wait() if err != nil { return fmt.Errorf("Non-zero exit status: %s", err) } return nil } func (p *Provisioner) createCmdArgs(httpAddr, inventory, playbook, privKeyFile string) (args []string, envVars []string) { args = []string{} //Setting up AnsibleEnvVars at begining so additional checks can take them into account if len(p.config.AnsibleEnvVars) > 0 { envVars = append(envVars, p.config.AnsibleEnvVars...) } if p.config.PackerBuildName != "" { // HCL configs don't currently have the PakcerBuildName. Don't // cause weirdness with a half-set variable args = append(args, "-e", fmt.Sprintf("packer_build_name=%q", p.config.PackerBuildName)) } args = append(args, "-e", fmt.Sprintf("packer_builder_type=%s", p.config.PackerBuilderType)) // expose packer_http_addr extra variable if httpAddr != commonsteps.HttpAddrNotImplemented { args = append(args, "-e", fmt.Sprintf("packer_http_addr=%s", httpAddr)) } if p.generatedData["ConnType"] == "ssh" && len(privKeyFile) > 0 { // Add ssh extra args to set IdentitiesOnly if len(p.config.AnsibleSSHExtraArgs) > 0 { var sshExtraArgs string for _, sshExtraArg := range p.config.AnsibleSSHExtraArgs { sshExtraArgs = sshExtraArgs + sshExtraArg } args = append(args, "--ssh-extra-args", fmt.Sprintf("'%s'", sshExtraArgs)) } else { args = append(args, "--ssh-extra-args", "'-o IdentitiesOnly=yes'") } } args = append(args, p.config.ExtraArguments...) // Add password to ansible call. if !checkArg("ansible_password", args) && p.config.UseProxy.False() && p.generatedData["ConnType"] == "winrm" { args = append(args, "-e", fmt.Sprintf("ansible_password=%s", p.generatedData["Password"])) } if !checkArg("ansible_password", args) && len(privKeyFile) > 0 { // "-e ansible_ssh_private_key_file" is preferable to "--private-key" // because it is a higher priority variable and therefore won't get // overridden by dynamic variables. See #5852 for more details. args = append(args, "-e", fmt.Sprintf("ansible_ssh_private_key_file=%s", privKeyFile)) } if checkArg("ansible_password", args) && p.generatedData["ConnType"] == "ssh" { if !checkArg("ansible_host_key_checking", args) && !checkArg("ANSIBLE_HOST_KEY_CHECKING", envVars) { args = append(args, "-e", "ansible_host_key_checking=False") } } // This must be the last arg appended to args args = append(args, "-i", inventory, playbook) return args, envVars } func (p *Provisioner) executeAnsible(ui packersdk.Ui, comm packersdk.Communicator, privKeyFile string) error { playbook, _ := filepath.Abs(p.config.PlaybookFile) inventory := p.config.InventoryFile httpAddr := p.generatedData["PackerHTTPAddr"].(string) // Fetch external dependencies if len(p.config.GalaxyFile) > 0 { if err := p.executeGalaxy(ui, comm); err != nil { return fmt.Errorf("Error executing Ansible Galaxy: %s", err) } } args, envvars := p.createCmdArgs(httpAddr, inventory, playbook, privKeyFile) cmd := exec.Command(p.config.Command, args...) cmd.Env = os.Environ() if len(envvars) > 0 { cmd.Env = append(cmd.Env, envvars...) } stdout, err := cmd.StdoutPipe() if err != nil { return err } stderr, err := cmd.StderrPipe() if err != nil { return err } wg := sync.WaitGroup{} repeat := func(r io.ReadCloser) { reader := bufio.NewReader(r) for { line, err := reader.ReadString('\n') if line != "" { line = strings.TrimRightFunc(line, unicode.IsSpace) ui.Message(line) } if err != nil { if err == io.EOF { break } else { ui.Error(err.Error()) break } } } wg.Done() } wg.Add(2) go repeat(stdout) go repeat(stderr) // remove winrm password from command, if it's been added flattenedCmd := strings.Join(cmd.Args, " ") sanitized := flattenedCmd winRMPass, ok := p.generatedData["WinRMPassword"] if ok && winRMPass != "" { sanitized = strings.Replace(sanitized, winRMPass.(string), "*****", -1) } if checkArg("ansible_password", args) { usePass, ok := p.generatedData["Password"] if ok && usePass != "" { sanitized = strings.Replace(sanitized, usePass.(string), "*****", -1) } } ui.Say(fmt.Sprintf("Executing Ansible: %s", sanitized)) if err := cmd.Start(); err != nil { return err } wg.Wait() err = cmd.Wait() if err != nil { return fmt.Errorf("Non-zero exit status: %s", err) } return nil } func validateFileConfig(name string, config string, req bool) error { if req { if name == "" { return fmt.Errorf("%s must be specified.", config) } } info, err := os.Stat(name) if err != nil { return fmt.Errorf("%s: %s is invalid: %s", config, name, err) } else if info.IsDir() { return fmt.Errorf("%s: %s must point to a file", config, name) } return nil } func validateInventoryDirectoryConfig(name string) error { info, err := os.Stat(name) if err != nil { return fmt.Errorf("inventory_directory: %s is invalid: %s", name, err) } else if !info.IsDir() { return fmt.Errorf("inventory_directory: %s must point to a directory", name) } return nil } type userKey struct { ssh.PublicKey privKeyFile string } func newUserKey(pubKeyFile string) (*userKey, error) { userKey := new(userKey) if len(pubKeyFile) > 0 { pubKeyBytes, err := ioutil.ReadFile(pubKeyFile) if err != nil { return nil, errors.New("Failed to read public key") } userKey.PublicKey, _, _, _, err = ssh.ParseAuthorizedKey(pubKeyBytes) if err != nil { return nil, errors.New("Failed to parse authorized key") } return userKey, nil } key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { return nil, errors.New("Failed to generate key pair") } userKey.PublicKey, err = ssh.NewPublicKey(key.Public()) if err != nil { return nil, errors.New("Failed to extract public key from generated key pair") } // To support Ansible calling back to us we need to write // this file down privateKeyDer := x509.MarshalPKCS1PrivateKey(key) privateKeyBlock := pem.Block{ Type: "RSA PRIVATE KEY", Headers: nil, Bytes: privateKeyDer, } tf, err := tmp.File("ansible-key") if err != nil { return nil, errors.New("failed to create temp file for generated key") } _, err = tf.Write(pem.EncodeToMemory(&privateKeyBlock)) if err != nil { return nil, errors.New("failed to write private key to temp file") } err = tf.Close() if err != nil { return nil, errors.New("failed to close private key temp file") } userKey.privKeyFile = tf.Name() return userKey, nil } type signer struct { ssh.Signer } func newSigner(privKeyFile string) (*signer, error) { signer := new(signer) if len(privKeyFile) > 0 { privateBytes, err := ioutil.ReadFile(privKeyFile) if err != nil { return nil, errors.New("Failed to load private host key") } signer.Signer, err = ssh.ParsePrivateKey(privateBytes) if err != nil { return nil, errors.New("Failed to parse private host key") } return signer, nil } key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { return nil, errors.New("Failed to generate server key pair") } signer.Signer, err = ssh.NewSignerFromKey(key) if err != nil { return nil, errors.New("Failed to extract private key from generated key pair") } return signer, nil } //checkArg Evaluates if argname is in args func checkArg(argname string, args []string) bool { for _, arg := range args { for _, ansibleArg := range strings.Split(arg, "=") { if ansibleArg == argname { return true } } } return false } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/provisioner.hcl2spec.go����������������������������������������0000664�0000000�0000000�00000020447�13771713062�0024076�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package ansible import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Command *string `mapstructure:"command" cty:"command" hcl:"command"` ExtraArguments []string `mapstructure:"extra_arguments" cty:"extra_arguments" hcl:"extra_arguments"` AnsibleEnvVars []string `mapstructure:"ansible_env_vars" cty:"ansible_env_vars" hcl:"ansible_env_vars"` PlaybookFile *string `mapstructure:"playbook_file" required:"true" cty:"playbook_file" hcl:"playbook_file"` AnsibleSSHExtraArgs []string `mapstructure:"ansible_ssh_extra_args" cty:"ansible_ssh_extra_args" hcl:"ansible_ssh_extra_args"` Groups []string `mapstructure:"groups" cty:"groups" hcl:"groups"` EmptyGroups []string `mapstructure:"empty_groups" cty:"empty_groups" hcl:"empty_groups"` HostAlias *string `mapstructure:"host_alias" cty:"host_alias" hcl:"host_alias"` User *string `mapstructure:"user" cty:"user" hcl:"user"` LocalPort *int `mapstructure:"local_port" cty:"local_port" hcl:"local_port"` SSHHostKeyFile *string `mapstructure:"ssh_host_key_file" cty:"ssh_host_key_file" hcl:"ssh_host_key_file"` SSHAuthorizedKeyFile *string `mapstructure:"ssh_authorized_key_file" cty:"ssh_authorized_key_file" hcl:"ssh_authorized_key_file"` SFTPCmd *string `mapstructure:"sftp_command" cty:"sftp_command" hcl:"sftp_command"` SkipVersionCheck *bool `mapstructure:"skip_version_check" cty:"skip_version_check" hcl:"skip_version_check"` UseSFTP *bool `mapstructure:"use_sftp" cty:"use_sftp" hcl:"use_sftp"` InventoryDirectory *string `mapstructure:"inventory_directory" cty:"inventory_directory" hcl:"inventory_directory"` InventoryFileTemplate *string `mapstructure:"inventory_file_template" cty:"inventory_file_template" hcl:"inventory_file_template"` InventoryFile *string `mapstructure:"inventory_file" cty:"inventory_file" hcl:"inventory_file"` KeepInventoryFile *bool `mapstructure:"keep_inventory_file" cty:"keep_inventory_file" hcl:"keep_inventory_file"` GalaxyFile *string `mapstructure:"galaxy_file" cty:"galaxy_file" hcl:"galaxy_file"` GalaxyCommand *string `mapstructure:"galaxy_command" cty:"galaxy_command" hcl:"galaxy_command"` GalaxyForceInstall *bool `mapstructure:"galaxy_force_install" cty:"galaxy_force_install" hcl:"galaxy_force_install"` RolesPath *string `mapstructure:"roles_path" cty:"roles_path" hcl:"roles_path"` CollectionsPath *string `mapstructure:"collections_path" cty:"collections_path" hcl:"collections_path"` UseProxy *bool `mapstructure:"use_proxy" cty:"use_proxy" hcl:"use_proxy"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "command": &hcldec.AttrSpec{Name: "command", Type: cty.String, Required: false}, "extra_arguments": &hcldec.AttrSpec{Name: "extra_arguments", Type: cty.List(cty.String), Required: false}, "ansible_env_vars": &hcldec.AttrSpec{Name: "ansible_env_vars", Type: cty.List(cty.String), Required: false}, "playbook_file": &hcldec.AttrSpec{Name: "playbook_file", Type: cty.String, Required: false}, "ansible_ssh_extra_args": &hcldec.AttrSpec{Name: "ansible_ssh_extra_args", Type: cty.List(cty.String), Required: false}, "groups": &hcldec.AttrSpec{Name: "groups", Type: cty.List(cty.String), Required: false}, "empty_groups": &hcldec.AttrSpec{Name: "empty_groups", Type: cty.List(cty.String), Required: false}, "host_alias": &hcldec.AttrSpec{Name: "host_alias", Type: cty.String, Required: false}, "user": &hcldec.AttrSpec{Name: "user", Type: cty.String, Required: false}, "local_port": &hcldec.AttrSpec{Name: "local_port", Type: cty.Number, Required: false}, "ssh_host_key_file": &hcldec.AttrSpec{Name: "ssh_host_key_file", Type: cty.String, Required: false}, "ssh_authorized_key_file": &hcldec.AttrSpec{Name: "ssh_authorized_key_file", Type: cty.String, Required: false}, "sftp_command": &hcldec.AttrSpec{Name: "sftp_command", Type: cty.String, Required: false}, "skip_version_check": &hcldec.AttrSpec{Name: "skip_version_check", Type: cty.Bool, Required: false}, "use_sftp": &hcldec.AttrSpec{Name: "use_sftp", Type: cty.Bool, Required: false}, "inventory_directory": &hcldec.AttrSpec{Name: "inventory_directory", Type: cty.String, Required: false}, "inventory_file_template": &hcldec.AttrSpec{Name: "inventory_file_template", Type: cty.String, Required: false}, "inventory_file": &hcldec.AttrSpec{Name: "inventory_file", Type: cty.String, Required: false}, "keep_inventory_file": &hcldec.AttrSpec{Name: "keep_inventory_file", Type: cty.Bool, Required: false}, "galaxy_file": &hcldec.AttrSpec{Name: "galaxy_file", Type: cty.String, Required: false}, "galaxy_command": &hcldec.AttrSpec{Name: "galaxy_command", Type: cty.String, Required: false}, "galaxy_force_install": &hcldec.AttrSpec{Name: "galaxy_force_install", Type: cty.Bool, Required: false}, "roles_path": &hcldec.AttrSpec{Name: "roles_path", Type: cty.String, Required: false}, "collections_path": &hcldec.AttrSpec{Name: "collections_path", Type: cty.String, Required: false}, "use_proxy": &hcldec.AttrSpec{Name: "use_proxy", Type: cty.Bool, Required: false}, } return s } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/provisioner_test.go��������������������������������������������0000664�0000000�0000000�00000065154�13771713062�0023437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !windows package ansible import ( "bytes" "context" "crypto/rand" "fmt" "io" "io/ioutil" "os" "path" "strings" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" confighelper "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/stretchr/testify/assert" ) // Be sure to remove the Ansible stub file in each test with: // defer os.Remove(config["command"].(string)) func testConfig(t *testing.T) map[string]interface{} { m := make(map[string]interface{}) wd, err := os.Getwd() if err != nil { t.Fatalf("err: %s", err) } ansible_stub := path.Join(wd, "packer-ansible-stub.sh") err = ioutil.WriteFile(ansible_stub, []byte("#!/usr/bin/env bash\necho ansible 1.6.0"), 0777) if err != nil { t.Fatalf("err: %s", err) } m["command"] = ansible_stub return m } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) err := p.Prepare(config) if err == nil { t.Fatalf("should have error") } hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() config["ssh_authorized_key_file"] = publickey_file.Name() config["playbook_file"] = playbook_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) err = os.Unsetenv("USER") if err != nil { t.Fatalf("err: %s", err) } err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_PlaybookFile(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() config["ssh_authorized_key_file"] = publickey_file.Name() err = p.Prepare(config) if err == nil { t.Fatal("should have error") } playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["playbook_file"] = playbook_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_HostKeyFile(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) filename := make([]byte, 10) n, err := io.ReadFull(rand.Reader, filename) if n != len(filename) || err != nil { t.Fatal("could not create random file name") } config["ssh_host_key_file"] = fmt.Sprintf("%x", filename) config["ssh_authorized_key_file"] = publickey_file.Name() config["playbook_file"] = playbook_file.Name() err = p.Prepare(config) if err == nil { t.Fatal("should error if ssh_host_key_file does not exist") } hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_AuthorizedKeyFile(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) filename := make([]byte, 10) n, err := io.ReadFull(rand.Reader, filename) if n != len(filename) || err != nil { t.Fatal("could not create random file name") } config["ssh_host_key_file"] = hostkey_file.Name() config["playbook_file"] = playbook_file.Name() config["ssh_authorized_key_file"] = fmt.Sprintf("%x", filename) err = p.Prepare(config) if err == nil { t.Errorf("should error if ssh_authorized_key_file does not exist") } publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) config["ssh_authorized_key_file"] = publickey_file.Name() err = p.Prepare(config) if err != nil { t.Errorf("err: %s", err) } } func TestProvisionerPrepare_LocalPort(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() config["ssh_authorized_key_file"] = publickey_file.Name() config["playbook_file"] = playbook_file.Name() config["local_port"] = 65537 err = p.Prepare(config) if err == nil { t.Fatal("should have error") } config["local_port"] = 22222 err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_InventoryDirectory(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) playbook_file, err := ioutil.TempFile("", "playbook") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(playbook_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() config["ssh_authorized_key_file"] = publickey_file.Name() config["playbook_file"] = playbook_file.Name() config["inventory_directory"] = "doesnotexist" err = p.Prepare(config) if err == nil { t.Errorf("should error if inventory_directory does not exist") } inventoryDirectory, err := ioutil.TempDir("", "some_inventory_dir") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(inventoryDirectory) config["inventory_directory"] = inventoryDirectory err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestAnsibleGetVersion(t *testing.T) { if os.Getenv("PACKER_ACC") == "" { t.Skip("This test is only run with PACKER_ACC=1 and it requires Ansible to be installed") } var p Provisioner p.config.Command = "ansible-playbook" err := p.getVersion() if err != nil { t.Fatalf("err: %s", err) } } func TestAnsibleGetVersionError(t *testing.T) { var p Provisioner p.config.Command = "./test-fixtures/exit1" err := p.getVersion() if err == nil { t.Fatal("Should return error") } if !strings.Contains(err.Error(), "./test-fixtures/exit1 --version") { t.Fatal("Error message should include command name") } } func TestAnsibleLongMessages(t *testing.T) { if os.Getenv("PACKER_ACC") == "" { t.Skip("This test is only run with PACKER_ACC=1 and it requires Ansible to be installed") } var p Provisioner p.config.Command = "ansible-playbook" p.config.PlaybookFile = "./test-fixtures/long-debug-message.yml" err := p.Prepare() if err != nil { t.Fatalf("err: %s", err) } comm := &packersdk.MockCommunicator{} ui := &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatalf("err: %s", err) } } func TestCreateInventoryFile(t *testing.T) { type inventoryFileTestCases struct { AnsibleVersion uint User string Groups []string EmptyGroups []string UseProxy confighelper.Trilean GeneratedData map[string]interface{} Expected string } TestCases := []inventoryFileTestCases{ { AnsibleVersion: 1, User: "testuser", UseProxy: confighelper.TriFalse, GeneratedData: basicGenData(nil), Expected: "default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234\n", }, { AnsibleVersion: 2, User: "testuser", UseProxy: confighelper.TriFalse, GeneratedData: basicGenData(nil), Expected: "default ansible_host=123.45.67.89 ansible_user=testuser ansible_port=1234\n", }, { AnsibleVersion: 1, User: "testuser", Groups: []string{"Group1", "Group2"}, UseProxy: confighelper.TriFalse, GeneratedData: basicGenData(nil), Expected: `default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234 [Group1] default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234 [Group2] default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234 `, }, { AnsibleVersion: 1, User: "testuser", EmptyGroups: []string{"Group1", "Group2"}, UseProxy: confighelper.TriFalse, GeneratedData: basicGenData(nil), Expected: `default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234 [Group1] [Group2] `, }, { AnsibleVersion: 1, User: "testuser", Groups: []string{"Group1", "Group2"}, EmptyGroups: []string{"Group3"}, UseProxy: confighelper.TriFalse, GeneratedData: basicGenData(nil), Expected: `default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234 [Group1] default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234 [Group2] default ansible_ssh_host=123.45.67.89 ansible_ssh_user=testuser ansible_ssh_port=1234 [Group3] `, }, { AnsibleVersion: 2, User: "testuser", UseProxy: confighelper.TriFalse, GeneratedData: basicGenData(map[string]interface{}{ "ConnType": "winrm", "Password": "12345", }), Expected: "default ansible_host=123.45.67.89 ansible_connection=winrm ansible_winrm_transport=basic ansible_shell_type=powershell ansible_user=testuser ansible_port=1234\n", }, } for _, tc := range TestCases { var p Provisioner p.Prepare(testConfig(t)) defer os.Remove(p.config.Command) p.ansibleMajVersion = tc.AnsibleVersion p.config.User = tc.User p.config.Groups = tc.Groups p.config.EmptyGroups = tc.EmptyGroups p.config.UseProxy = tc.UseProxy p.generatedData = tc.GeneratedData err := p.createInventoryFile() if err != nil { t.Fatalf("error creating config using localhost and local port proxy") } if p.config.InventoryFile == "" { t.Fatalf("No inventory file was created") } defer os.Remove(p.config.InventoryFile) f, err := ioutil.ReadFile(p.config.InventoryFile) if err != nil { t.Fatalf("couldn't read created inventoryfile: %s", err) } expected := tc.Expected if fmt.Sprintf("%s", f) != expected { t.Fatalf("File didn't match expected:\n\n expected: \n%s\n; recieved: \n%s\n", expected, f) } } } func basicGenData(input map[string]interface{}) map[string]interface{} { gd := map[string]interface{}{ "Host": "123.45.67.89", "Port": int64(1234), "ConnType": "ssh", "SSHPrivateKeyFile": "", "SSHPrivateKey": "asdf", "SSHAgentAuth": false, "User": "PartyPacker", "PackerHTTPAddr": commonsteps.HttpAddrNotImplemented, "PackerHTTPIP": commonsteps.HttpIPNotImplemented, "PackerHTTPPort": commonsteps.HttpPortNotImplemented, } if input == nil { return gd } for k, v := range input { gd[k] = v } return gd } func TestCreateCmdArgs(t *testing.T) { type testcase struct { TestName string PackerBuildName string PackerBuilderType string UseProxy confighelper.Trilean generatedData map[string]interface{} AnsibleSSHExtraArgs []string ExtraArguments []string AnsibleEnvVars []string callArgs []string // httpAddr inventory playbook privKeyFile ExpectedArgs []string ExpectedEnvVars []string } TestCases := []testcase{ { // SSH with private key and an extra argument. TestName: "SSH with private key and an extra argument", PackerBuildName: "packerparty", generatedData: basicGenData(nil), ExtraArguments: []string{"-e", "hello-world"}, AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", "/path/to/privkey.pem"}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "-e", "ansible_ssh_private_key_file=/path/to/privkey.pem", "--ssh-extra-args", "'-o IdentitiesOnly=yes'", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, }, { // SSH with private key and an extra argument. TestName: "SSH with private key and an extra argument and a ssh extra argument", PackerBuildName: "packerparty", generatedData: basicGenData(nil), ExtraArguments: []string{"-e", "hello-world"}, AnsibleSSHExtraArgs: []string{"-o IdentitiesOnly=no"}, AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", "/path/to/privkey.pem"}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "--ssh-extra-args", "'-o IdentitiesOnly=no'", "-e", "ansible_ssh_private_key_file=/path/to/privkey.pem", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, }, { TestName: "SSH with private key and an extra argument and UseProxy", PackerBuildName: "packerparty", UseProxy: confighelper.TriTrue, generatedData: basicGenData(nil), ExtraArguments: []string{"-e", "hello-world"}, callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", "/path/to/privkey.pem"}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "-e", "ansible_ssh_private_key_file=/path/to/privkey.pem", "--ssh-extra-args", "'-o IdentitiesOnly=yes'", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{}, }, { // Winrm, but no_proxy is unset so we don't do anything with ansible_password. TestName: "Winrm, but no_proxy is unset so we don't do anything with ansible_password", PackerBuildName: "packerparty", generatedData: basicGenData(map[string]interface{}{ "ConnType": "winrm", }), ExtraArguments: []string{"-e", "hello-world"}, AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, }, { // HTTPAddr should be set. No env vars. TestName: "HTTPAddr should be set. No env vars", PackerBuildName: "packerparty", ExtraArguments: []string{"-e", "hello-world"}, generatedData: basicGenData(map[string]interface{}{ "PackerHTTPAddr": "123.45.67.89", }), callArgs: []string{"123.45.67.89", "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "-e", "packer_http_addr=123.45.67.89", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{}, }, { // Add ansible_password for proxyless winrm connection. TestName: "Add ansible_password for proxyless winrm connection.", UseProxy: confighelper.TriFalse, generatedData: basicGenData(map[string]interface{}{ "ConnType": "winrm", "Password": "ilovebananapancakes", "PackerHTTPAddr": "123.45.67.89", }), AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, callArgs: []string{"123.45.67.89", "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_builder_type=fakebuilder", "-e", "packer_http_addr=123.45.67.89", "-e", "ansible_password=ilovebananapancakes", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, }, { // Neither special ssh stuff, nor special windows stuff. This is docker! TestName: "Neither special ssh stuff, nor special windows stuff. This is docker!", PackerBuildName: "packerparty", generatedData: basicGenData(map[string]interface{}{ "ConnType": "docker", }), ExtraArguments: []string{"-e", "hello-world"}, AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, }, { // Windows, no proxy, with extra vars. TestName: "Windows, no proxy, with extra vars.", UseProxy: confighelper.TriFalse, generatedData: basicGenData(map[string]interface{}{ "ConnType": "winrm", "Password": "ilovebananapancakes", "PackerHTTPAddr": "123.45.67.89", }), ExtraArguments: []string{"-e", "hello-world"}, AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, callArgs: []string{"123.45.67.89", "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_builder_type=fakebuilder", "-e", "packer_http_addr=123.45.67.89", "-e", "ansible_password=ilovebananapancakes", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, }, { // SSH, use Password. TestName: "SSH, use ansible_password.", generatedData: basicGenData(map[string]interface{}{ "ConnType": "ssh", "Password": "ilovebananapancakes", "PackerHTTPAddr": "123.45.67.89", }), ExtraArguments: []string{"-e", "hello-world", "-e", "ansible_password=ilovebananapancakes"}, AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, callArgs: []string{"123.45.67.89", "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_builder_type=fakebuilder", "-e", "packer_http_addr=123.45.67.89", "-e", "hello-world", "-e", "ansible_password=ilovebananapancakes", "-e", "ansible_host_key_checking=False", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas"}, }, { // SSH, use Password . TestName: "SSH, already in ENV ansible_host_key_checking.", generatedData: basicGenData(map[string]interface{}{ "ConnType": "ssh", "Password": "ilovebananapancakes", "PackerHTTPAddr": "123.45.67.89", }), ExtraArguments: []string{"-e", "hello-world", "-e", "ansible_password=ilovebananapancakes"}, AnsibleEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas", "ANSIBLE_HOST_KEY_CHECKING=False"}, callArgs: []string{"123.45.67.89", "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_builder_type=fakebuilder", "-e", "packer_http_addr=123.45.67.89", "-e", "hello-world", "-e", "ansible_password=ilovebananapancakes", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{"ENV_1=pancakes", "ENV_2=bananas", "ANSIBLE_HOST_KEY_CHECKING=False"}, }, { TestName: "Use PrivateKey", PackerBuildName: "packerparty", UseProxy: confighelper.TriTrue, generatedData: basicGenData(nil), ExtraArguments: []string{"-e", "hello-world"}, callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", "/path/to/privkey.pem"}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "-e", "ansible_ssh_private_key_file=/path/to/privkey.pem", "--ssh-extra-args", "'-o IdentitiesOnly=yes'", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{}, }, { TestName: "Use PrivateKey and SSH Extra Arg", PackerBuildName: "packerparty", UseProxy: confighelper.TriTrue, generatedData: basicGenData(nil), AnsibleSSHExtraArgs: []string{"-o IdentitiesOnly=no"}, ExtraArguments: []string{"-e", "hello-world"}, callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", "/path/to/privkey.pem"}, ExpectedArgs: []string{"-e", "packer_build_name=\"packerparty\"", "-e", "packer_builder_type=fakebuilder", "-e", "ansible_ssh_private_key_file=/path/to/privkey.pem", "--ssh-extra-args", "'-o IdentitiesOnly=no'", "-e", "hello-world", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{}, }, { TestName: "Use SSH Agent", UseProxy: confighelper.TriTrue, generatedData: basicGenData(nil), callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_builder_type=fakebuilder", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{}, }, { // No builder name. This shouldn't cause an error, it just shouldn't be set. HCL, yo. TestName: "No builder name. This shouldn't cause an error, it just shouldn't be set. HCL, yo.", generatedData: basicGenData(nil), callArgs: []string{commonsteps.HttpAddrNotImplemented, "/var/inventory", "test-playbook.yml", ""}, ExpectedArgs: []string{"-e", "packer_builder_type=fakebuilder", "-i", "/var/inventory", "test-playbook.yml"}, ExpectedEnvVars: []string{}, }, } for _, tc := range TestCases { var p Provisioner p.Prepare(testConfig(t)) defer os.Remove(p.config.Command) p.config.UseProxy = tc.UseProxy p.config.PackerBuilderType = "fakebuilder" p.config.PackerBuildName = tc.PackerBuildName p.generatedData = tc.generatedData p.config.AnsibleSSHExtraArgs = tc.AnsibleSSHExtraArgs p.config.ExtraArguments = tc.ExtraArguments p.config.AnsibleEnvVars = tc.AnsibleEnvVars args, envVars := p.createCmdArgs(tc.callArgs[0], tc.callArgs[1], tc.callArgs[2], tc.callArgs[3]) assert.ElementsMatch(t, args, tc.ExpectedArgs, "TestName: %s\nArgs didn't match expected:\nexpected: \n%s\n; recieved: \n%s\n", tc.TestName, tc.ExpectedArgs, args) assert.ElementsMatch(t, envVars, tc.ExpectedEnvVars, "TestName: %s\nArgs didn't match expected:\n\nEnvVars didn't match expected:\n\n expected: \n%s\n; recieved: \n%s\n", tc.TestName, tc.ExpectedEnvVars, envVars) assert.EqualValues(t, tc.callArgs[2], args[len(args)-1], "TestName: %s\nPlayBook File Not Returned as last element: \nexpected: %s\nrecieved: %s\n", tc.TestName, tc.callArgs[2], args[len(args)-1]) } } func TestUseProxy(t *testing.T) { type testcase struct { UseProxy confighelper.Trilean generatedData map[string]interface{} expectedSetupAdapterCalled bool explanation string } tcs := []testcase{ { explanation: "use_proxy is true; we should set up adapter", UseProxy: confighelper.TriTrue, generatedData: basicGenData(nil), expectedSetupAdapterCalled: true, }, { explanation: "use_proxy is false but no IP addr is available; we should set up adapter anyway.", UseProxy: confighelper.TriFalse, generatedData: basicGenData(map[string]interface{}{ "Host": "", "Port": nil, }), expectedSetupAdapterCalled: true, }, { explanation: "use_proxy is false; we shouldn't set up adapter.", UseProxy: confighelper.TriFalse, generatedData: basicGenData(nil), expectedSetupAdapterCalled: false, }, { explanation: "use_proxy is false but connType isn't ssh or winrm.", UseProxy: confighelper.TriFalse, generatedData: basicGenData(map[string]interface{}{ "ConnType": "docker", }), expectedSetupAdapterCalled: true, }, { explanation: "use_proxy is unset; we should default to setting up the adapter (for now).", UseProxy: confighelper.TriUnset, generatedData: basicGenData(nil), expectedSetupAdapterCalled: true, }, { explanation: "use_proxy is false and connType is winRM. we should not set up the adapter.", UseProxy: confighelper.TriFalse, generatedData: basicGenData(map[string]interface{}{ "ConnType": "winrm", }), expectedSetupAdapterCalled: false, }, { explanation: "use_proxy is unset and connType is winRM. we should set up the adapter.", UseProxy: confighelper.TriUnset, generatedData: basicGenData(map[string]interface{}{ "ConnType": "winrm", }), expectedSetupAdapterCalled: true, }, } for _, tc := range tcs { var p Provisioner p.Prepare(testConfig(t)) p.config.UseProxy = tc.UseProxy defer os.Remove(p.config.Command) p.ansibleMajVersion = 1 var l provisionLogicTracker l.setupAdapterCalled = false p.setupAdapterFunc = l.setupAdapter p.executeAnsibleFunc = l.executeAnsible ctx := context.TODO() comm := new(packersdk.MockCommunicator) ui := &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } p.Provision(ctx, ui, comm, tc.generatedData) if l.setupAdapterCalled != tc.expectedSetupAdapterCalled { t.Fatalf("%s", tc.explanation) } os.Remove(p.config.Command) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/test-fixtures/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022305�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/test-fixtures/exit1��������������������������������������������0000775�0000000�0000000�00000000022�13771713062�0023257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh exit 1 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/test-fixtures/long-debug-message.yml���������������������������0000664�0000000�0000000�00000000417�13771713062�0026477�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������- name: Stub for Packer testing long Ansible messages hosts: localhost connection: local tasks: - name: Very long Ansible output (>65535 chars) (Issue https://github.com/hashicorp/packer/issues/3268) debug: msg: "{{ lipsum(n=300, html=false) }}" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/version/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021144�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/ansible/version/version.go���������������������������������������������0000664�0000000�0000000�00000000477�13771713062�0023170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var AnsiblePluginVersion *version.PluginVersion func init() { AnsiblePluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/azure-dtlartifact/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021467�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/azure-dtlartifact/provisioner.go���������������������������������������0000664�0000000�0000000�00000013126�13771713062�0024400�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config,DtlArtifact,ArtifactParameter package devtestlabsartifacts import ( "context" "fmt" "time" "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/builder/azure/common/client" dtlBuilder "github.com/hashicorp/packer/builder/azure/dtl" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type DtlArtifact struct { ArtifactName string `mapstructure:"artifact_name"` ArtifactId string `mapstructure:"artifact_id"` Parameters []ArtifactParameter `mapstructure:"parameters"` } type ArtifactParameter struct { Name string `mapstructure:"name"` Value string `mapstructure:"value"` Type string `mapstructure:"type"` } type Config struct { common.PackerConfig `mapstructure:",squash"` // Authentication via OAUTH ClientConfig client.Config `mapstructure:",squash"` DtlArtifacts []DtlArtifact `mapstructure:"dtl_artifacts"` LabName string `mapstructure:"lab_name"` ResourceGroupName string `mapstructure:"lab_resource_group_name"` VMName string `mapstructure:"vm_name"` // The default PollingDuration for azure is 15mins, this property will override // that value. See [Azure DefaultPollingDuration](https://godoc.org/github.com/Azure/go-autorest/autorest#pkg-constants) // If your Packer build is failing on the // ARM deployment step with the error `Original Error: // context deadline exceeded`, then you probably need to increase this timeout from // its default of "15m" (valid time units include `s` for seconds, `m` for // minutes, and `h` for hours.) PollingDurationTimeout time.Duration `mapstructure:"polling_duration_timeout" required:"false"` AzureTags map[string]*string `mapstructure:"azure_tags"` Json map[string]interface{} ctx interpolate.Context } type Provisioner struct { config Config communicator packersdk.Communicator } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { // // Create passthrough for winrm password so we can fill it in once we know // // it // p.config.ctx.Data = &EnvVarsTemplate{ // WinRMPassword: `{{.WinRMPassword}}`, // } err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "azure-dtlartifact", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", }, }, }, raws...) if err != nil { return err } p.config.ClientConfig.CloudEnvironmentName = "Public" return nil } func (p *Provisioner) Communicator() packersdk.Communicator { return p.communicator } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, _ map[string]interface{}) error { p.communicator = comm err := p.config.ClientConfig.SetDefaultValues() if err != nil { ui.Say(fmt.Sprintf("Error saving debug key: %s", err)) return nil } ///////////////////////////////////////////// // Polling Duration Timeout if p.config.PollingDurationTimeout == 0 { // In the sdk, the default is 15 m. p.config.PollingDurationTimeout = 15 * time.Minute } // FillParameters function captures authType and sets defaults. err = p.config.ClientConfig.FillParameters() if err != nil { return err } spnCloud, err := p.config.ClientConfig.GetServicePrincipalToken(ui.Say, p.config.ClientConfig.CloudEnvironment().ResourceManagerEndpoint) if err != nil { return err } ui.Message("Creating Azure Resource Manager (ARM) client ...") azureClient, err := dtlBuilder.NewAzureClient( p.config.ClientConfig.SubscriptionID, "", p.config.ClientConfig.CloudEnvironment(), p.config.PollingDurationTimeout, p.config.PollingDurationTimeout, spnCloud) if err != nil { ui.Say(fmt.Sprintf("Error saving debug key: %s", err)) return err } ui.Say("Installing Artifact DTL") dtlArtifacts := []dtl.ArtifactInstallProperties{} if p.config.DtlArtifacts != nil { for i := range p.config.DtlArtifacts { p.config.DtlArtifacts[i].ArtifactId = fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DevTestLab/labs/%s/artifactSources/public repo/artifacts/%s", p.config.ClientConfig.SubscriptionID, p.config.ResourceGroupName, p.config.LabName, p.config.DtlArtifacts[i].ArtifactName) dparams := []dtl.ArtifactParameterProperties{} for j := range p.config.DtlArtifacts[i].Parameters { dp := &dtl.ArtifactParameterProperties{} dp.Name = &p.config.DtlArtifacts[i].Parameters[j].Name dp.Value = &p.config.DtlArtifacts[i].Parameters[j].Value dparams = append(dparams, *dp) } Aip := dtl.ArtifactInstallProperties{ ArtifactID: &p.config.DtlArtifacts[i].ArtifactId, Parameters: &dparams, ArtifactTitle: &p.config.DtlArtifacts[i].ArtifactName, } dtlArtifacts = append(dtlArtifacts, Aip) } } dtlApplyArifactRequest := dtl.ApplyArtifactsRequest{ Artifacts: &dtlArtifacts, } ui.Say("Applying artifact ") f, err := azureClient.DtlVirtualMachineClient.ApplyArtifacts(ctx, p.config.ResourceGroupName, p.config.LabName, p.config.VMName, dtlApplyArifactRequest) if err == nil { err = f.WaitForCompletionRef(ctx, azureClient.DtlVirtualMachineClient.Client) } if err != nil { ui.Say(fmt.Sprintf("Error Applying artifact: %s", err)) } ui.Say("Aftifact installed") return err } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/azure-dtlartifact/provisioner.hcl2spec.go������������������������������0000664�0000000�0000000�00000022255�13771713062�0026105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config,DtlArtifact,ArtifactParameter"; DO NOT EDIT. package devtestlabsartifacts import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatArtifactParameter is an auto-generated flat version of ArtifactParameter. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatArtifactParameter struct { Name *string `mapstructure:"name" cty:"name" hcl:"name"` Value *string `mapstructure:"value" cty:"value" hcl:"value"` Type *string `mapstructure:"type" cty:"type" hcl:"type"` } // FlatMapstructure returns a new FlatArtifactParameter. // FlatArtifactParameter is an auto-generated flat version of ArtifactParameter. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*ArtifactParameter) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatArtifactParameter) } // HCL2Spec returns the hcl spec of a ArtifactParameter. // This spec is used by HCL to read the fields of ArtifactParameter. // The decoded values from this spec will then be applied to a FlatArtifactParameter. func (*FlatArtifactParameter) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "name": &hcldec.AttrSpec{Name: "name", Type: cty.String, Required: false}, "value": &hcldec.AttrSpec{Name: "value", Type: cty.String, Required: false}, "type": &hcldec.AttrSpec{Name: "type", Type: cty.String, Required: false}, } return s } // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` CloudEnvironmentName *string `mapstructure:"cloud_environment_name" required:"false" cty:"cloud_environment_name" hcl:"cloud_environment_name"` ClientID *string `mapstructure:"client_id" cty:"client_id" hcl:"client_id"` ClientSecret *string `mapstructure:"client_secret" cty:"client_secret" hcl:"client_secret"` ClientCertPath *string `mapstructure:"client_cert_path" cty:"client_cert_path" hcl:"client_cert_path"` ClientJWT *string `mapstructure:"client_jwt" cty:"client_jwt" hcl:"client_jwt"` ObjectID *string `mapstructure:"object_id" cty:"object_id" hcl:"object_id"` TenantID *string `mapstructure:"tenant_id" required:"false" cty:"tenant_id" hcl:"tenant_id"` SubscriptionID *string `mapstructure:"subscription_id" cty:"subscription_id" hcl:"subscription_id"` UseAzureCLIAuth *bool `mapstructure:"use_azure_cli_auth" required:"false" cty:"use_azure_cli_auth" hcl:"use_azure_cli_auth"` DtlArtifacts []FlatDtlArtifact `mapstructure:"dtl_artifacts" cty:"dtl_artifacts" hcl:"dtl_artifacts"` LabName *string `mapstructure:"lab_name" cty:"lab_name" hcl:"lab_name"` ResourceGroupName *string `mapstructure:"lab_resource_group_name" cty:"lab_resource_group_name" hcl:"lab_resource_group_name"` VMName *string `mapstructure:"vm_name" cty:"vm_name" hcl:"vm_name"` PollingDurationTimeout *string `mapstructure:"polling_duration_timeout" required:"false" cty:"polling_duration_timeout" hcl:"polling_duration_timeout"` AzureTags map[string]*string `mapstructure:"azure_tags" cty:"azure_tags" hcl:"azure_tags"` Json map[string]interface{} `cty:"json" hcl:"json"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "cloud_environment_name": &hcldec.AttrSpec{Name: "cloud_environment_name", Type: cty.String, Required: false}, "client_id": &hcldec.AttrSpec{Name: "client_id", Type: cty.String, Required: false}, "client_secret": &hcldec.AttrSpec{Name: "client_secret", Type: cty.String, Required: false}, "client_cert_path": &hcldec.AttrSpec{Name: "client_cert_path", Type: cty.String, Required: false}, "client_jwt": &hcldec.AttrSpec{Name: "client_jwt", Type: cty.String, Required: false}, "object_id": &hcldec.AttrSpec{Name: "object_id", Type: cty.String, Required: false}, "tenant_id": &hcldec.AttrSpec{Name: "tenant_id", Type: cty.String, Required: false}, "subscription_id": &hcldec.AttrSpec{Name: "subscription_id", Type: cty.String, Required: false}, "use_azure_cli_auth": &hcldec.AttrSpec{Name: "use_azure_cli_auth", Type: cty.Bool, Required: false}, "dtl_artifacts": &hcldec.BlockListSpec{TypeName: "dtl_artifacts", Nested: hcldec.ObjectSpec((*FlatDtlArtifact)(nil).HCL2Spec())}, "lab_name": &hcldec.AttrSpec{Name: "lab_name", Type: cty.String, Required: false}, "lab_resource_group_name": &hcldec.AttrSpec{Name: "lab_resource_group_name", Type: cty.String, Required: false}, "vm_name": &hcldec.AttrSpec{Name: "vm_name", Type: cty.String, Required: false}, "polling_duration_timeout": &hcldec.AttrSpec{Name: "polling_duration_timeout", Type: cty.String, Required: false}, "azure_tags": &hcldec.AttrSpec{Name: "azure_tags", Type: cty.Map(cty.String), Required: false}, "json": &hcldec.AttrSpec{Name: "json", Type: cty.Map(cty.String), Required: false}, } return s } // FlatDtlArtifact is an auto-generated flat version of DtlArtifact. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatDtlArtifact struct { ArtifactName *string `mapstructure:"artifact_name" cty:"artifact_name" hcl:"artifact_name"` ArtifactId *string `mapstructure:"artifact_id" cty:"artifact_id" hcl:"artifact_id"` Parameters []FlatArtifactParameter `mapstructure:"parameters" cty:"parameters" hcl:"parameters"` } // FlatMapstructure returns a new FlatDtlArtifact. // FlatDtlArtifact is an auto-generated flat version of DtlArtifact. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*DtlArtifact) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatDtlArtifact) } // HCL2Spec returns the hcl spec of a DtlArtifact. // This spec is used by HCL to read the fields of DtlArtifact. // The decoded values from this spec will then be applied to a FlatDtlArtifact. func (*FlatDtlArtifact) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "artifact_name": &hcldec.AttrSpec{Name: "artifact_name", Type: cty.String, Required: false}, "artifact_id": &hcldec.AttrSpec{Name: "artifact_id", Type: cty.String, Required: false}, "parameters": &hcldec.BlockListSpec{TypeName: "parameters", Nested: hcldec.ObjectSpec((*FlatArtifactParameter)(nil).HCL2Spec())}, } return s } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/azure-dtlartifact/version/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023154�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/azure-dtlartifact/version/version.go�����������������������������������0000664�0000000�0000000�00000000501�13771713062�0025164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var AzureDTLPluginVersion *version.PluginVersion func init() { AzureDTLPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/breakpoint/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020200�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/breakpoint/provisioner.go����������������������������������������������0000664�0000000�0000000�00000003732�13771713062�0023113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package breakpoint import ( "context" "fmt" "golang.org/x/sync/errgroup" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` Note string `mapstructure:"note"` Disable bool `mapstructure:"disable"` ctx interpolate.Context } type Provisioner struct { config Config } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "breakpoint", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, _ map[string]interface{}) error { if p.config.Disable { if p.config.Note != "" { ui.Say(fmt.Sprintf( "Breakpoint provisioner with note \"%s\" disabled; continuing...", p.config.Note)) } else { ui.Say("Breakpoint provisioner disabled; continuing...") } return nil } if p.config.Note != "" { ui.Say(fmt.Sprintf("Pausing at breakpoint provisioner with note \"%s\".", p.config.Note)) } else { ui.Say("Pausing at breakpoint provisioner.") } message := fmt.Sprintf( "Press enter to continue.") var g errgroup.Group result := make(chan string, 1) g.Go(func() error { line, err := ui.Ask(message) if err != nil { return fmt.Errorf("Error asking for input: %s", err) } result <- line return nil }) if err := g.Wait(); err != nil { return err } return nil } ��������������������������������������packer-1.6.6+ds1/provisioner/breakpoint/provisioner.hcl2spec.go�������������������������������������0000664�0000000�0000000�00000006200�13771713062�0024606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package breakpoint import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Note *string `mapstructure:"note" cty:"note" hcl:"note"` Disable *bool `mapstructure:"disable" cty:"disable" hcl:"disable"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "note": &hcldec.AttrSpec{Name: "note", Type: cty.String, Required: false}, "disable": &hcldec.AttrSpec{Name: "disable", Type: cty.Bool, Required: false}, } return s } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/breakpoint/version/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021665�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/breakpoint/version/version.go������������������������������������������0000664�0000000�0000000�00000000505�13771713062�0023701�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var BreakpointPluginVersion *version.PluginVersion func init() { BreakpointPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-client/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020223�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-client/provisioner.go���������������������������������������������0000664�0000000�0000000�00000053572�13771713062�0023145�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that uses // Chef to provision the remote machine, specifically with chef-client (that is, // with a Chef server). package chefclient import ( "bytes" "context" "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/guestexec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/pathing" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" ) type guestOSTypeConfig struct { executeCommand string installCommand string knifeCommand string stagingDir string } var guestOSTypeConfigs = map[string]guestOSTypeConfig{ guestexec.UnixOSType: { executeCommand: "{{if .Sudo}}sudo {{end}}chef-client --no-color -c {{.ConfigPath}} -j {{.JsonPath}}", installCommand: "curl -L https://omnitruck.chef.io/install.sh | {{if .Sudo}}sudo {{end}}bash -s --{{if .Version}} -v {{.Version}}{{end}}", knifeCommand: "{{if .Sudo}}sudo {{end}}knife {{.Args}} {{.Flags}}", stagingDir: "/tmp/packer-chef-client", }, guestexec.WindowsOSType: { executeCommand: "c:/opscode/chef/bin/chef-client.bat --no-color -c {{.ConfigPath}} -j {{.JsonPath}}", installCommand: "powershell.exe -Command \". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; Install-Project{{if .Version}} -version {{.Version}}{{end}}\"", knifeCommand: "c:/opscode/chef/bin/knife.bat {{.Args}} {{.Flags}}", stagingDir: "C:/Windows/Temp/packer-chef-client", }, } type Config struct { common.PackerConfig `mapstructure:",squash"` Json map[string]interface{} ChefEnvironment string `mapstructure:"chef_environment"` ChefLicense string `mapstructure:"chef_license"` ClientKey string `mapstructure:"client_key"` ConfigTemplate string `mapstructure:"config_template"` ElevatedUser string `mapstructure:"elevated_user"` ElevatedPassword string `mapstructure:"elevated_password"` EncryptedDataBagSecretPath string `mapstructure:"encrypted_data_bag_secret_path"` ExecuteCommand string `mapstructure:"execute_command"` GuestOSType string `mapstructure:"guest_os_type"` InstallCommand string `mapstructure:"install_command"` KnifeCommand string `mapstructure:"knife_command"` NodeName string `mapstructure:"node_name"` PolicyGroup string `mapstructure:"policy_group"` PolicyName string `mapstructure:"policy_name"` PreventSudo bool `mapstructure:"prevent_sudo"` RunList []string `mapstructure:"run_list"` ServerUrl string `mapstructure:"server_url"` SkipCleanClient bool `mapstructure:"skip_clean_client"` SkipCleanNode bool `mapstructure:"skip_clean_node"` SkipCleanStagingDirectory bool `mapstructure:"skip_clean_staging_directory"` SkipInstall bool `mapstructure:"skip_install"` SslVerifyMode string `mapstructure:"ssl_verify_mode"` TrustedCertsDir string `mapstructure:"trusted_certs_dir"` StagingDir string `mapstructure:"staging_directory"` ValidationClientName string `mapstructure:"validation_client_name"` ValidationKeyPath string `mapstructure:"validation_key_path"` Version string `mapstructure:"version"` ctx interpolate.Context } type Provisioner struct { config Config communicator packersdk.Communicator guestOSTypeConfig guestOSTypeConfig guestCommands *guestexec.GuestCommands generatedData map[string]interface{} } type ConfigTemplate struct { ChefEnvironment string ChefLicense string ClientKey string EncryptedDataBagSecretPath string NodeName string PolicyGroup string PolicyName string ServerUrl string SslVerifyMode string TrustedCertsDir string ValidationClientName string ValidationKeyPath string } type ExecuteTemplate struct { ConfigPath string JsonPath string Sudo bool } type InstallChefTemplate struct { Sudo bool Version string } type KnifeTemplate struct { Sudo bool Flags string Args string } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "chef-client", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", "install_command", "knife_command", }, }, }, raws...) if err != nil { return err } if p.config.GuestOSType == "" { p.config.GuestOSType = guestexec.DefaultOSType } p.config.GuestOSType = strings.ToLower(p.config.GuestOSType) var ok bool p.guestOSTypeConfig, ok = guestOSTypeConfigs[p.config.GuestOSType] if !ok { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } p.guestCommands, err = guestexec.NewGuestCommands(p.config.GuestOSType, !p.config.PreventSudo) if err != nil { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = p.guestOSTypeConfig.executeCommand } if p.config.InstallCommand == "" { p.config.InstallCommand = p.guestOSTypeConfig.installCommand } if p.config.RunList == nil { p.config.RunList = make([]string, 0) } if p.config.StagingDir == "" { p.config.StagingDir = p.guestOSTypeConfig.stagingDir } if p.config.KnifeCommand == "" { p.config.KnifeCommand = p.guestOSTypeConfig.knifeCommand } var errs *packersdk.MultiError if p.config.ConfigTemplate != "" { fi, err := os.Stat(p.config.ConfigTemplate) if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad config template path: %s", err)) } else if fi.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Config template path must be a file: %s", err)) } } if p.config.ServerUrl == "" { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("server_url must be set")) } if p.config.SkipInstall == false && p.config.InstallCommand == p.guestOSTypeConfig.installCommand { if p.config.ChefLicense == "" { p.config.ChefLicense = "accept-silent" } } if p.config.EncryptedDataBagSecretPath != "" { pFileInfo, err := os.Stat(p.config.EncryptedDataBagSecretPath) if err != nil || pFileInfo.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad encrypted data bag secret '%s': %s", p.config.EncryptedDataBagSecretPath, err)) } } if (p.config.PolicyName != "") != (p.config.PolicyGroup != "") { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("If either policy_name or policy_group are set, they must both be set.")) } jsonValid := true for k, v := range p.config.Json { p.config.Json[k], err = p.deepJsonFix(k, v) if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error processing JSON: %s", err)) jsonValid = false } } if jsonValid { // Process the user variables within the JSON and set the JSON. // Do this early so that we can validate and show errors. p.config.Json, err = p.processJsonUserVars() if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error processing user variables in JSON: %s", err)) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { p.generatedData = generatedData p.communicator = comm nodeName := p.config.NodeName if nodeName == "" { nodeName = fmt.Sprintf("packer-%s", uuid.TimeOrderedUUID()) } remoteValidationKeyPath := "" serverUrl := p.config.ServerUrl if !p.config.SkipInstall { if err := p.installChef(ui, comm, p.config.Version); err != nil { return fmt.Errorf("Error installing Chef: %s", err) } } if err := p.createDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error creating staging directory: %s", err) } if p.config.ClientKey == "" { p.config.ClientKey = fmt.Sprintf("%s/client.pem", p.config.StagingDir) } encryptedDataBagSecretPath := "" if p.config.EncryptedDataBagSecretPath != "" { encryptedDataBagSecretPath = fmt.Sprintf("%s/encrypted_data_bag_secret", p.config.StagingDir) if err := p.uploadFile(ui, comm, encryptedDataBagSecretPath, p.config.EncryptedDataBagSecretPath); err != nil { return fmt.Errorf("Error uploading encrypted data bag secret: %s", err) } } if p.config.ValidationKeyPath != "" { path, err := pathing.ExpandUser(p.config.ValidationKeyPath) if err != nil { return fmt.Errorf("Error while expanding a tilde in the validation key: %s", err) } remoteValidationKeyPath = fmt.Sprintf("%s/validation.pem", p.config.StagingDir) if err := p.uploadFile(ui, comm, remoteValidationKeyPath, path); err != nil { return fmt.Errorf("Error copying validation key: %s", err) } } configPath, err := p.createConfig( ui, comm, nodeName, serverUrl, p.config.ClientKey, p.config.ChefLicense, encryptedDataBagSecretPath, remoteValidationKeyPath, p.config.ValidationClientName, p.config.ChefEnvironment, p.config.PolicyGroup, p.config.PolicyName, p.config.SslVerifyMode, p.config.TrustedCertsDir) if err != nil { return fmt.Errorf("Error creating Chef config file: %s", err) } jsonPath, err := p.createJson(ui, comm) if err != nil { return fmt.Errorf("Error creating JSON attributes: %s", err) } err = p.executeChef(ui, comm, configPath, jsonPath) if !(p.config.SkipCleanNode && p.config.SkipCleanClient) { knifeConfigPath, knifeErr := p.createKnifeConfig( ui, comm, nodeName, serverUrl, p.config.ClientKey, p.config.SslVerifyMode, p.config.TrustedCertsDir) if knifeErr != nil { return fmt.Errorf("Error creating knife config on node: %s", knifeErr) } if !p.config.SkipCleanNode { if err := p.cleanNode(ui, comm, nodeName, knifeConfigPath); err != nil { return fmt.Errorf("Error cleaning up chef node: %s", err) } } if !p.config.SkipCleanClient { if err := p.cleanClient(ui, comm, nodeName, knifeConfigPath); err != nil { return fmt.Errorf("Error cleaning up chef client: %s", err) } } } if err != nil { return fmt.Errorf("Error executing Chef: %s", err) } if !p.config.SkipCleanStagingDirectory { if err := p.removeDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error removing %s: %s", p.config.StagingDir, err) } } return nil } func (p *Provisioner) uploadFile(ui packersdk.Ui, comm packersdk.Communicator, remotePath string, localPath string) error { ui.Message(fmt.Sprintf("Uploading %s...", localPath)) f, err := os.Open(localPath) if err != nil { return err } defer f.Close() return comm.Upload(remotePath, f, nil) } func (p *Provisioner) createConfig( ui packersdk.Ui, comm packersdk.Communicator, nodeName string, serverUrl string, clientKey string, chefLicense string, encryptedDataBagSecretPath, remoteKeyPath string, validationClientName string, chefEnvironment string, policyGroup string, policyName string, sslVerifyMode string, trustedCertsDir string) (string, error) { ui.Message("Creating configuration file 'client.rb'") // Read the template tpl := DefaultConfigTemplate if p.config.ConfigTemplate != "" { f, err := os.Open(p.config.ConfigTemplate) if err != nil { return "", err } defer f.Close() tplBytes, err := ioutil.ReadAll(f) if err != nil { return "", err } tpl = string(tplBytes) } ictx := p.config.ctx ictx.Data = &ConfigTemplate{ NodeName: nodeName, ServerUrl: serverUrl, ClientKey: clientKey, ChefLicense: chefLicense, ValidationKeyPath: remoteKeyPath, ValidationClientName: validationClientName, ChefEnvironment: chefEnvironment, PolicyGroup: policyGroup, PolicyName: policyName, SslVerifyMode: sslVerifyMode, TrustedCertsDir: trustedCertsDir, EncryptedDataBagSecretPath: encryptedDataBagSecretPath, } configString, err := interpolate.Render(tpl, &ictx) if err != nil { return "", err } remotePath := filepath.ToSlash(filepath.Join(p.config.StagingDir, "client.rb")) if err := comm.Upload(remotePath, bytes.NewReader([]byte(configString)), nil); err != nil { return "", err } return remotePath, nil } func (p *Provisioner) createKnifeConfig(ui packersdk.Ui, comm packersdk.Communicator, nodeName string, serverUrl string, clientKey string, sslVerifyMode string, trustedCertsDir string) (string, error) { ui.Message("Creating configuration file 'knife.rb'") // Read the template tpl := DefaultKnifeTemplate ictx := p.config.ctx ictx.Data = &ConfigTemplate{ NodeName: nodeName, ServerUrl: serverUrl, ClientKey: clientKey, SslVerifyMode: sslVerifyMode, TrustedCertsDir: trustedCertsDir, } configString, err := interpolate.Render(tpl, &ictx) if err != nil { return "", err } remotePath := filepath.ToSlash(filepath.Join(p.config.StagingDir, "knife.rb")) if err := comm.Upload(remotePath, bytes.NewReader([]byte(configString)), nil); err != nil { return "", err } return remotePath, nil } func (p *Provisioner) createJson(ui packersdk.Ui, comm packersdk.Communicator) (string, error) { ui.Message("Creating JSON attribute file") jsonData := make(map[string]interface{}) // Copy the configured JSON for k, v := range p.config.Json { jsonData[k] = v } // Set the run list if it was specified if len(p.config.RunList) > 0 { jsonData["run_list"] = p.config.RunList } jsonBytes, err := json.MarshalIndent(jsonData, "", " ") if err != nil { return "", err } // Upload the bytes remotePath := filepath.ToSlash(filepath.Join(p.config.StagingDir, "first-boot.json")) if err := comm.Upload(remotePath, bytes.NewReader(jsonBytes), nil); err != nil { return "", err } return remotePath, nil } func (p *Provisioner) createDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ctx := context.TODO() ui.Message(fmt.Sprintf("Creating directory: %s", dir)) cmd := &packersdk.RemoteCmd{Command: p.guestCommands.CreateDir(dir)} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more info.") } // Chmod the directory to 0777 just so that we can access it as our user cmd = &packersdk.RemoteCmd{Command: p.guestCommands.Chmod(dir, "0777")} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more info.") } return nil } func (p *Provisioner) cleanNode(ui packersdk.Ui, comm packersdk.Communicator, node string, knifeConfigPath string) error { ui.Say("Cleaning up chef node...") args := []string{"node", "delete", node} if err := p.knifeExec(ui, comm, node, knifeConfigPath, args); err != nil { return fmt.Errorf("Failed to cleanup node: %s", err) } return nil } func (p *Provisioner) cleanClient(ui packersdk.Ui, comm packersdk.Communicator, node string, knifeConfigPath string) error { ui.Say("Cleaning up chef client...") args := []string{"client", "delete", node} if err := p.knifeExec(ui, comm, node, knifeConfigPath, args); err != nil { return fmt.Errorf("Failed to cleanup client: %s", err) } return nil } func (p *Provisioner) knifeExec(ui packersdk.Ui, comm packersdk.Communicator, node string, knifeConfigPath string, args []string) error { flags := []string{ "-y", "-c", knifeConfigPath, } ctx := context.TODO() p.config.ctx.Data = &KnifeTemplate{ Sudo: !p.config.PreventSudo, Flags: strings.Join(flags, " "), Args: strings.Join(args, " "), } command, err := interpolate.Render(p.config.KnifeCommand, &p.config.ctx) if err != nil { return err } cmd := &packersdk.RemoteCmd{Command: command} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf( "Non-zero exit status. See output above for more info.\n\n"+ "Command: %s", command) } return nil } func (p *Provisioner) removeDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ui.Message(fmt.Sprintf("Removing directory: %s", dir)) ctx := context.TODO() cmd := &packersdk.RemoteCmd{Command: p.guestCommands.RemoveDir(dir)} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } return nil } func (p *Provisioner) executeChef(ui packersdk.Ui, comm packersdk.Communicator, config string, json string) error { p.config.ctx.Data = &ExecuteTemplate{ ConfigPath: config, JsonPath: json, Sudo: !p.config.PreventSudo, } ctx := context.TODO() command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return err } if p.config.ElevatedUser != "" { command, err = guestexec.GenerateElevatedRunner(command, p) if err != nil { return err } } ui.Message(fmt.Sprintf("Executing Chef: %s", command)) cmd := &packersdk.RemoteCmd{ Command: command, } if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status: %d", cmd.ExitStatus()) } return nil } func (p *Provisioner) installChef(ui packersdk.Ui, comm packersdk.Communicator, version string) error { ui.Message("Installing Chef...") ctx := context.TODO() p.config.ctx.Data = &InstallChefTemplate{ Sudo: !p.config.PreventSudo, Version: version, } command, err := interpolate.Render(p.config.InstallCommand, &p.config.ctx) if err != nil { return err } ui.Message(command) cmd := &packersdk.RemoteCmd{Command: command} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf( "Install script exited with non-zero exit status %d", cmd.ExitStatus()) } return nil } func (p *Provisioner) deepJsonFix(key string, current interface{}) (interface{}, error) { if current == nil { return nil, nil } switch c := current.(type) { case []interface{}: val := make([]interface{}, len(c)) for i, v := range c { var err error val[i], err = p.deepJsonFix(fmt.Sprintf("%s[%d]", key, i), v) if err != nil { return nil, err } } return val, nil case []uint8: return string(c), nil case map[interface{}]interface{}: val := make(map[string]interface{}) for k, v := range c { ks, ok := k.(string) if !ok { return nil, fmt.Errorf("%s: key is not string", key) } var err error val[ks], err = p.deepJsonFix( fmt.Sprintf("%s.%s", key, ks), v) if err != nil { return nil, err } } return val, nil default: return current, nil } } func (p *Provisioner) processJsonUserVars() (map[string]interface{}, error) { jsonBytes, err := json.Marshal(p.config.Json) if err != nil { // This really shouldn't happen since we literally just unmarshalled panic(err) } // Copy the user variables so that we can restore them later, and // make sure we make the quotes JSON-friendly in the user variables. originalUserVars := make(map[string]string) for k, v := range p.config.ctx.UserVariables { originalUserVars[k] = v } // Make sure we reset them no matter what defer func() { p.config.ctx.UserVariables = originalUserVars }() // Make the current user variables JSON string safe. for k, v := range p.config.ctx.UserVariables { v = strings.Replace(v, `\`, `\\`, -1) v = strings.Replace(v, `"`, `\"`, -1) p.config.ctx.UserVariables[k] = v } // Process the bytes with the template processor p.config.ctx.Data = nil jsonBytesProcessed, err := interpolate.Render(string(jsonBytes), &p.config.ctx) if err != nil { return nil, err } var result map[string]interface{} if err := json.Unmarshal([]byte(jsonBytesProcessed), &result); err != nil { return nil, err } return result, nil } func (p *Provisioner) Communicator() packersdk.Communicator { return p.communicator } func (p *Provisioner) ElevatedUser() string { return p.config.ElevatedUser } func (p *Provisioner) ElevatedPassword() string { // Replace ElevatedPassword for winrm users who used this feature p.config.ctx.Data = p.generatedData elevatedPassword, _ := interpolate.Render(p.config.ElevatedPassword, &p.config.ctx) return elevatedPassword } var DefaultConfigTemplate = ` log_level :info log_location STDOUT chef_server_url "{{.ServerUrl}}" client_key "{{.ClientKey}}" chef_license "{{.ChefLicense}}" {{if ne .EncryptedDataBagSecretPath ""}} encrypted_data_bag_secret "{{.EncryptedDataBagSecretPath}}" {{end}} {{if ne .ValidationClientName ""}} validation_client_name "{{.ValidationClientName}}" {{else}} validation_client_name "chef-validator" {{end}} {{if ne .ValidationKeyPath ""}} validation_key "{{.ValidationKeyPath}}" {{end}} node_name "{{.NodeName}}" {{if ne .ChefEnvironment ""}} environment "{{.ChefEnvironment}}" {{end}} {{if ne .PolicyGroup ""}} policy_group "{{.PolicyGroup}}" {{end}} {{if ne .PolicyName ""}} policy_name "{{.PolicyName}}" {{end}} {{if ne .SslVerifyMode ""}} ssl_verify_mode :{{.SslVerifyMode}} {{end}} {{if ne .TrustedCertsDir ""}} trusted_certs_dir "{{.TrustedCertsDir}}" {{end}} ` var DefaultKnifeTemplate = ` log_level :info log_location STDOUT chef_server_url "{{.ServerUrl}}" client_key "{{.ClientKey}}" node_name "{{.NodeName}}" {{if ne .SslVerifyMode ""}} ssl_verify_mode :{{.SslVerifyMode}} {{end}} {{if ne .TrustedCertsDir ""}} trusted_certs_dir "{{.TrustedCertsDir}}" {{end}} ` ��������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-client/provisioner.hcl2spec.go������������������������������������0000664�0000000�0000000�00000022667�13771713062�0024650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package chefclient import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Json map[string]interface{} `cty:"json" hcl:"json"` ChefEnvironment *string `mapstructure:"chef_environment" cty:"chef_environment" hcl:"chef_environment"` ChefLicense *string `mapstructure:"chef_license" cty:"chef_license" hcl:"chef_license"` ClientKey *string `mapstructure:"client_key" cty:"client_key" hcl:"client_key"` ConfigTemplate *string `mapstructure:"config_template" cty:"config_template" hcl:"config_template"` ElevatedUser *string `mapstructure:"elevated_user" cty:"elevated_user" hcl:"elevated_user"` ElevatedPassword *string `mapstructure:"elevated_password" cty:"elevated_password" hcl:"elevated_password"` EncryptedDataBagSecretPath *string `mapstructure:"encrypted_data_bag_secret_path" cty:"encrypted_data_bag_secret_path" hcl:"encrypted_data_bag_secret_path"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` InstallCommand *string `mapstructure:"install_command" cty:"install_command" hcl:"install_command"` KnifeCommand *string `mapstructure:"knife_command" cty:"knife_command" hcl:"knife_command"` NodeName *string `mapstructure:"node_name" cty:"node_name" hcl:"node_name"` PolicyGroup *string `mapstructure:"policy_group" cty:"policy_group" hcl:"policy_group"` PolicyName *string `mapstructure:"policy_name" cty:"policy_name" hcl:"policy_name"` PreventSudo *bool `mapstructure:"prevent_sudo" cty:"prevent_sudo" hcl:"prevent_sudo"` RunList []string `mapstructure:"run_list" cty:"run_list" hcl:"run_list"` ServerUrl *string `mapstructure:"server_url" cty:"server_url" hcl:"server_url"` SkipCleanClient *bool `mapstructure:"skip_clean_client" cty:"skip_clean_client" hcl:"skip_clean_client"` SkipCleanNode *bool `mapstructure:"skip_clean_node" cty:"skip_clean_node" hcl:"skip_clean_node"` SkipCleanStagingDirectory *bool `mapstructure:"skip_clean_staging_directory" cty:"skip_clean_staging_directory" hcl:"skip_clean_staging_directory"` SkipInstall *bool `mapstructure:"skip_install" cty:"skip_install" hcl:"skip_install"` SslVerifyMode *string `mapstructure:"ssl_verify_mode" cty:"ssl_verify_mode" hcl:"ssl_verify_mode"` TrustedCertsDir *string `mapstructure:"trusted_certs_dir" cty:"trusted_certs_dir" hcl:"trusted_certs_dir"` StagingDir *string `mapstructure:"staging_directory" cty:"staging_directory" hcl:"staging_directory"` ValidationClientName *string `mapstructure:"validation_client_name" cty:"validation_client_name" hcl:"validation_client_name"` ValidationKeyPath *string `mapstructure:"validation_key_path" cty:"validation_key_path" hcl:"validation_key_path"` Version *string `mapstructure:"version" cty:"version" hcl:"version"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "json": &hcldec.AttrSpec{Name: "json", Type: cty.Map(cty.String), Required: false}, "chef_environment": &hcldec.AttrSpec{Name: "chef_environment", Type: cty.String, Required: false}, "chef_license": &hcldec.AttrSpec{Name: "chef_license", Type: cty.String, Required: false}, "client_key": &hcldec.AttrSpec{Name: "client_key", Type: cty.String, Required: false}, "config_template": &hcldec.AttrSpec{Name: "config_template", Type: cty.String, Required: false}, "elevated_user": &hcldec.AttrSpec{Name: "elevated_user", Type: cty.String, Required: false}, "elevated_password": &hcldec.AttrSpec{Name: "elevated_password", Type: cty.String, Required: false}, "encrypted_data_bag_secret_path": &hcldec.AttrSpec{Name: "encrypted_data_bag_secret_path", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, "install_command": &hcldec.AttrSpec{Name: "install_command", Type: cty.String, Required: false}, "knife_command": &hcldec.AttrSpec{Name: "knife_command", Type: cty.String, Required: false}, "node_name": &hcldec.AttrSpec{Name: "node_name", Type: cty.String, Required: false}, "policy_group": &hcldec.AttrSpec{Name: "policy_group", Type: cty.String, Required: false}, "policy_name": &hcldec.AttrSpec{Name: "policy_name", Type: cty.String, Required: false}, "prevent_sudo": &hcldec.AttrSpec{Name: "prevent_sudo", Type: cty.Bool, Required: false}, "run_list": &hcldec.AttrSpec{Name: "run_list", Type: cty.List(cty.String), Required: false}, "server_url": &hcldec.AttrSpec{Name: "server_url", Type: cty.String, Required: false}, "skip_clean_client": &hcldec.AttrSpec{Name: "skip_clean_client", Type: cty.Bool, Required: false}, "skip_clean_node": &hcldec.AttrSpec{Name: "skip_clean_node", Type: cty.Bool, Required: false}, "skip_clean_staging_directory": &hcldec.AttrSpec{Name: "skip_clean_staging_directory", Type: cty.Bool, Required: false}, "skip_install": &hcldec.AttrSpec{Name: "skip_install", Type: cty.Bool, Required: false}, "ssl_verify_mode": &hcldec.AttrSpec{Name: "ssl_verify_mode", Type: cty.String, Required: false}, "trusted_certs_dir": &hcldec.AttrSpec{Name: "trusted_certs_dir", Type: cty.String, Required: false}, "staging_directory": &hcldec.AttrSpec{Name: "staging_directory", Type: cty.String, Required: false}, "validation_client_name": &hcldec.AttrSpec{Name: "validation_client_name", Type: cty.String, Required: false}, "validation_key_path": &hcldec.AttrSpec{Name: "validation_key_path", Type: cty.String, Required: false}, "version": &hcldec.AttrSpec{Name: "version", Type: cty.String, Required: false}, } return s } �������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-client/provisioner_test.go����������������������������������������0000664�0000000�0000000�00000014776�13771713062�0024207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chefclient import ( "bytes" "io/ioutil" "os" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "server_url": "foo", } } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_chefEnvironment(t *testing.T) { var p Provisioner config := testConfig() config["chef_environment"] = "some-env" err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefEnvironment != "some-env" { t.Fatalf("unexpected: %#v", p.config.ChefEnvironment) } } func TestProvisionerPrepare_configTemplate(t *testing.T) { var err error var p Provisioner // Test no config template config := testConfig() delete(config, "config_template") err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a file tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(tf.Name()) config = testConfig() config["config_template"] = tf.Name() p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a directory td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(td) config = testConfig() config["config_template"] = td p = Provisioner{} err = p.Prepare(config) if err == nil { t.Fatal("should have err") } } func TestProvisionerPrepare_commands(t *testing.T) { commands := []string{ "execute_command", "install_command", "knife_command", } for _, command := range commands { var p Provisioner // Test not set config := testConfig() delete(config, command) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test invalid template config = testConfig() config[command] = "{{if NOPE}}" err = p.Prepare(config) if err == nil { t.Fatal("should error") } // Test good template config = testConfig() config[command] = "{{.Foo}}" err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } } func TestProvisionerPrepare_serverUrl(t *testing.T) { var p Provisioner // Test not set config := testConfig() delete(config, "server_url") err := p.Prepare(config) if err == nil { t.Fatal("should error") } // Test set config = testConfig() config["server_url"] = "foo" err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_chefLicense(t *testing.T) { var p Provisioner // Test not set config := testConfig() err := p.Prepare(config) if err != nil { t.Fatal("should error") } if p.config.ChefLicense != "accept-silent" { t.Fatalf("unexpected: %#v", p.config.ChefLicense) } // Test set config = testConfig() config["chef_license"] = "accept" p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefLicense != "accept" { t.Fatalf("unexpected: %#v", p.config.ChefLicense) } // Test set skipInstall true config = testConfig() config["skip_install"] = true p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefLicense != "" { t.Fatalf("unexpected: %#v", "empty string") } // Test set installCommand true config = testConfig() config["install_command"] = "install chef" p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefLicense != "" { t.Fatalf("unexpected: %#v", "empty string") } } func TestProvisionerPrepare_encryptedDataBagSecretPath(t *testing.T) { var err error var p Provisioner // Test no config template config := testConfig() delete(config, "encrypted_data_bag_secret_path") err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a file tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(tf.Name()) config = testConfig() config["encrypted_data_bag_secret_path"] = tf.Name() p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a directory td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(td) config = testConfig() config["encrypted_data_bag_secret_path"] = td p = Provisioner{} err = p.Prepare(config) if err == nil { t.Fatal("should have err") } } func TestProvisioner_createDir(t *testing.T) { for _, sudo := range []bool{true, false} { config := testConfig() config["prevent_sudo"] = !sudo p := &Provisioner{} comm := &packersdk.MockCommunicator{} ui := &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if err := p.createDir(ui, comm, "/tmp/foo"); err != nil { t.Fatalf("err: %s", err) } if !sudo && strings.HasPrefix(comm.StartCmd.Command, "sudo") { t.Fatalf("createDir should not use sudo, got: \"%s\"", comm.StartCmd.Command) } if sudo && !strings.HasPrefix(comm.StartCmd.Command, "sudo") { t.Fatalf("createDir should use sudo, got: \"%s\"", comm.StartCmd.Command) } } } func TestProvisioner_removeDir(t *testing.T) { for _, sudo := range []bool{true, false} { config := testConfig() config["prevent_sudo"] = !sudo p := &Provisioner{} comm := &packersdk.MockCommunicator{} ui := &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), } err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if err := p.removeDir(ui, comm, "/tmp/foo"); err != nil { t.Fatalf("err: %s", err) } if !sudo && strings.HasPrefix(comm.StartCmd.Command, "sudo") { t.Fatalf("removeDir should not use sudo, got: \"%s\"", comm.StartCmd.Command) } if sudo && !strings.HasPrefix(comm.StartCmd.Command, "sudo") { t.Fatalf("removeDir should use sudo, got: \"%s\"", comm.StartCmd.Command) } } } func TestProvisionerPrepare_policy(t *testing.T) { var p Provisioner var policyTests = []struct { name string group string success bool }{ {"", "", true}, {"a", "b", true}, {"a", "", false}, {"", "a", false}, } for _, tt := range policyTests { config := testConfig() config["policy_name"] = tt.name config["policy_group"] = tt.group err := p.Prepare(config) if (err == nil) != tt.success { t.Fatalf("wasn't expecting %+v to fail: %s", tt, err.Error()) } } } ��packer-1.6.6+ds1/provisioner/chef-client/version/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021710�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-client/version/version.go�����������������������������������������0000664�0000000�0000000�00000000505�13771713062�0023724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ChefClientPluginVersion *version.PluginVersion func init() { ChefClientPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-solo/�������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017721�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-solo/provisioner.go�����������������������������������������������0000664�0000000�0000000�00000042750�13771713062�0022637�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that uses // Chef to provision the remote machine, specifically with chef-solo (that is, // without a Chef server). package chefsolo import ( "bytes" "context" "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/guestexec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type guestOSTypeConfig struct { executeCommand string installCommand string stagingDir string } var guestOSTypeConfigs = map[string]guestOSTypeConfig{ guestexec.UnixOSType: { executeCommand: "{{if .Sudo}}sudo {{end}}chef-solo --no-color -c {{.ConfigPath}} -j {{.JsonPath}}", installCommand: "curl -L https://omnitruck.chef.io/install.sh | {{if .Sudo}}sudo {{end}}bash -s --{{if .Version}} -v {{.Version}}{{end}}", stagingDir: "/tmp/packer-chef-solo", }, guestexec.WindowsOSType: { executeCommand: "c:/opscode/chef/bin/chef-solo.bat --no-color -c {{.ConfigPath}} -j {{.JsonPath}}", installCommand: "powershell.exe -Command \". { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; Install-Project{{if .Version}} -version {{.Version}}{{end}}\"", stagingDir: "C:/Windows/Temp/packer-chef-solo", }, } type Config struct { common.PackerConfig `mapstructure:",squash"` ChefEnvironment string `mapstructure:"chef_environment"` ChefLicense string `mapstructure:"chef_license"` ConfigTemplate string `mapstructure:"config_template"` CookbookPaths []string `mapstructure:"cookbook_paths"` RolesPath string `mapstructure:"roles_path"` DataBagsPath string `mapstructure:"data_bags_path"` EncryptedDataBagSecretPath string `mapstructure:"encrypted_data_bag_secret_path"` EnvironmentsPath string `mapstructure:"environments_path"` ExecuteCommand string `mapstructure:"execute_command"` InstallCommand string `mapstructure:"install_command"` RemoteCookbookPaths []string `mapstructure:"remote_cookbook_paths"` Json map[string]interface{} PreventSudo bool `mapstructure:"prevent_sudo"` RunList []string `mapstructure:"run_list"` SkipInstall bool `mapstructure:"skip_install"` StagingDir string `mapstructure:"staging_directory"` GuestOSType string `mapstructure:"guest_os_type"` Version string `mapstructure:"version"` ctx interpolate.Context } type Provisioner struct { config Config guestOSTypeConfig guestOSTypeConfig guestCommands *guestexec.GuestCommands } type ConfigTemplate struct { CookbookPaths string DataBagsPath string EncryptedDataBagSecretPath string RolesPath string EnvironmentsPath string ChefEnvironment string ChefLicense string // Templates don't support boolean statements until Go 1.2. In the // mean time, we do this. // TODO(mitchellh): Remove when Go 1.2 is released HasDataBagsPath bool HasEncryptedDataBagSecretPath bool HasRolesPath bool HasEnvironmentsPath bool } type ExecuteTemplate struct { ConfigPath string JsonPath string Sudo bool } type InstallChefTemplate struct { Sudo bool Version string } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "chef-solo", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", "install_command", }, }, }, raws...) if err != nil { return err } if p.config.GuestOSType == "" { p.config.GuestOSType = guestexec.DefaultOSType } p.config.GuestOSType = strings.ToLower(p.config.GuestOSType) var ok bool p.guestOSTypeConfig, ok = guestOSTypeConfigs[p.config.GuestOSType] if !ok { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } p.guestCommands, err = guestexec.NewGuestCommands(p.config.GuestOSType, !p.config.PreventSudo) if err != nil { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = p.guestOSTypeConfig.executeCommand } if p.config.InstallCommand == "" { p.config.InstallCommand = p.guestOSTypeConfig.installCommand } if p.config.RunList == nil { p.config.RunList = make([]string, 0) } if p.config.StagingDir == "" { p.config.StagingDir = p.guestOSTypeConfig.stagingDir } if p.config.SkipInstall == false && p.config.InstallCommand == p.guestOSTypeConfig.installCommand { if p.config.ChefLicense == "" { p.config.ChefLicense = "accept-silent" } } var errs *packersdk.MultiError if p.config.ConfigTemplate != "" { fi, err := os.Stat(p.config.ConfigTemplate) if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad config template path: %s", err)) } else if fi.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Config template path must be a file: %s", err)) } } for _, path := range p.config.CookbookPaths { pFileInfo, err := os.Stat(path) if err != nil || !pFileInfo.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad cookbook path '%s': %s", path, err)) } } if p.config.RolesPath != "" { pFileInfo, err := os.Stat(p.config.RolesPath) if err != nil || !pFileInfo.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad roles path '%s': %s", p.config.RolesPath, err)) } } if p.config.DataBagsPath != "" { pFileInfo, err := os.Stat(p.config.DataBagsPath) if err != nil || !pFileInfo.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad data bags path '%s': %s", p.config.DataBagsPath, err)) } } if p.config.EncryptedDataBagSecretPath != "" { pFileInfo, err := os.Stat(p.config.EncryptedDataBagSecretPath) if err != nil || pFileInfo.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad encrypted data bag secret '%s': %s", p.config.EncryptedDataBagSecretPath, err)) } } if p.config.EnvironmentsPath != "" { pFileInfo, err := os.Stat(p.config.EnvironmentsPath) if err != nil || !pFileInfo.IsDir() { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Bad environments path '%s': %s", p.config.EnvironmentsPath, err)) } } jsonValid := true for k, v := range p.config.Json { p.config.Json[k], err = p.deepJsonFix(k, v) if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error processing JSON: %s", err)) jsonValid = false } } if jsonValid { // Process the user variables within the JSON and set the JSON. // Do this early so that we can validate and show errors. p.config.Json, err = p.processJsonUserVars() if err != nil { errs = packersdk.MultiErrorAppend( errs, fmt.Errorf("Error processing user variables in JSON: %s", err)) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, _ map[string]interface{}) error { ui.Say("Provisioning with chef-solo") if !p.config.SkipInstall { if err := p.installChef(ui, comm, p.config.Version); err != nil { return fmt.Errorf("Error installing Chef: %s", err) } } if err := p.createDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error creating staging directory: %s", err) } cookbookPaths := make([]string, 0, len(p.config.CookbookPaths)) for i, path := range p.config.CookbookPaths { targetPath := fmt.Sprintf("%s/cookbooks-%d", p.config.StagingDir, i) if err := p.uploadDirectory(ui, comm, targetPath, path); err != nil { return fmt.Errorf("Error uploading cookbooks: %s", err) } cookbookPaths = append(cookbookPaths, targetPath) } rolesPath := "" if p.config.RolesPath != "" { rolesPath = fmt.Sprintf("%s/roles", p.config.StagingDir) if err := p.uploadDirectory(ui, comm, rolesPath, p.config.RolesPath); err != nil { return fmt.Errorf("Error uploading roles: %s", err) } } dataBagsPath := "" if p.config.DataBagsPath != "" { dataBagsPath = fmt.Sprintf("%s/data_bags", p.config.StagingDir) if err := p.uploadDirectory(ui, comm, dataBagsPath, p.config.DataBagsPath); err != nil { return fmt.Errorf("Error uploading data bags: %s", err) } } encryptedDataBagSecretPath := "" if p.config.EncryptedDataBagSecretPath != "" { encryptedDataBagSecretPath = fmt.Sprintf("%s/encrypted_data_bag_secret", p.config.StagingDir) if err := p.uploadFile(ui, comm, encryptedDataBagSecretPath, p.config.EncryptedDataBagSecretPath); err != nil { return fmt.Errorf("Error uploading encrypted data bag secret: %s", err) } } environmentsPath := "" if p.config.EnvironmentsPath != "" { environmentsPath = fmt.Sprintf("%s/environments", p.config.StagingDir) if err := p.uploadDirectory(ui, comm, environmentsPath, p.config.EnvironmentsPath); err != nil { return fmt.Errorf("Error uploading environments: %s", err) } } configPath, err := p.createConfig(ui, comm, cookbookPaths, rolesPath, dataBagsPath, encryptedDataBagSecretPath, environmentsPath, p.config.ChefEnvironment, p.config.ChefLicense) if err != nil { return fmt.Errorf("Error creating Chef config file: %s", err) } jsonPath, err := p.createJson(ui, comm) if err != nil { return fmt.Errorf("Error creating JSON attributes: %s", err) } if err := p.executeChef(ui, comm, configPath, jsonPath); err != nil { return fmt.Errorf("Error executing Chef: %s", err) } return nil } func (p *Provisioner) uploadDirectory(ui packersdk.Ui, comm packersdk.Communicator, dst string, src string) error { if err := p.createDir(ui, comm, dst); err != nil { return err } // Make sure there is a trailing "/" so that the directory isn't // created on the other side. if src[len(src)-1] != '/' { src = src + "/" } return comm.UploadDir(dst, src, nil) } func (p *Provisioner) uploadFile(ui packersdk.Ui, comm packersdk.Communicator, dst string, src string) error { f, err := os.Open(src) if err != nil { return err } defer f.Close() return comm.Upload(dst, f, nil) } func (p *Provisioner) createConfig(ui packersdk.Ui, comm packersdk.Communicator, localCookbooks []string, rolesPath string, dataBagsPath string, encryptedDataBagSecretPath string, environmentsPath string, chefEnvironment string, chefLicense string) (string, error) { ui.Message("Creating configuration file 'solo.rb'") cookbook_paths := make([]string, len(p.config.RemoteCookbookPaths)+len(localCookbooks)) for i, path := range p.config.RemoteCookbookPaths { cookbook_paths[i] = fmt.Sprintf(`"%s"`, path) } for i, path := range localCookbooks { i = len(p.config.RemoteCookbookPaths) + i cookbook_paths[i] = fmt.Sprintf(`"%s"`, path) } // Read the template tpl := DefaultConfigTemplate if p.config.ConfigTemplate != "" { f, err := os.Open(p.config.ConfigTemplate) if err != nil { return "", err } defer f.Close() tplBytes, err := ioutil.ReadAll(f) if err != nil { return "", err } tpl = string(tplBytes) } p.config.ctx.Data = &ConfigTemplate{ CookbookPaths: strings.Join(cookbook_paths, ","), RolesPath: rolesPath, DataBagsPath: dataBagsPath, EncryptedDataBagSecretPath: encryptedDataBagSecretPath, EnvironmentsPath: environmentsPath, HasRolesPath: rolesPath != "", HasDataBagsPath: dataBagsPath != "", HasEncryptedDataBagSecretPath: encryptedDataBagSecretPath != "", HasEnvironmentsPath: environmentsPath != "", ChefEnvironment: chefEnvironment, ChefLicense: chefLicense, } configString, err := interpolate.Render(tpl, &p.config.ctx) if err != nil { return "", err } remotePath := filepath.ToSlash(filepath.Join(p.config.StagingDir, "solo.rb")) if err := comm.Upload(remotePath, bytes.NewReader([]byte(configString)), nil); err != nil { return "", err } return remotePath, nil } func (p *Provisioner) createJson(ui packersdk.Ui, comm packersdk.Communicator) (string, error) { ui.Message("Creating JSON attribute file") jsonData := make(map[string]interface{}) // Copy the configured JSON for k, v := range p.config.Json { jsonData[k] = v } // Set the run list if it was specified if len(p.config.RunList) > 0 { jsonData["run_list"] = p.config.RunList } jsonBytes, err := json.MarshalIndent(jsonData, "", " ") if err != nil { return "", err } // Upload the bytes remotePath := filepath.ToSlash(filepath.Join(p.config.StagingDir, "node.json")) if err := comm.Upload(remotePath, bytes.NewReader(jsonBytes), nil); err != nil { return "", err } return remotePath, nil } func (p *Provisioner) createDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ui.Message(fmt.Sprintf("Creating directory: %s", dir)) ctx := context.TODO() cmd := &packersdk.RemoteCmd{Command: p.guestCommands.CreateDir(dir)} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more info.") } // Chmod the directory to 0777 just so that we can access it as our user cmd = &packersdk.RemoteCmd{Command: p.guestCommands.Chmod(dir, "0777")} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more info.") } return nil } func (p *Provisioner) executeChef(ui packersdk.Ui, comm packersdk.Communicator, config string, json string) error { p.config.ctx.Data = &ExecuteTemplate{ ConfigPath: config, JsonPath: json, Sudo: !p.config.PreventSudo, } command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return err } ui.Message(fmt.Sprintf("Executing Chef: %s", command)) cmd := &packersdk.RemoteCmd{ Command: command, } ctx := context.TODO() if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status: %d", cmd.ExitStatus()) } return nil } func (p *Provisioner) installChef(ui packersdk.Ui, comm packersdk.Communicator, version string) error { ui.Message("Installing Chef...") ctx := context.TODO() p.config.ctx.Data = &InstallChefTemplate{ Sudo: !p.config.PreventSudo, Version: version, } command, err := interpolate.Render(p.config.InstallCommand, &p.config.ctx) if err != nil { return err } cmd := &packersdk.RemoteCmd{Command: command} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf( "Install script exited with non-zero exit status %d", cmd.ExitStatus()) } return nil } func (p *Provisioner) deepJsonFix(key string, current interface{}) (interface{}, error) { if current == nil { return nil, nil } switch c := current.(type) { case []interface{}: val := make([]interface{}, len(c)) for i, v := range c { var err error val[i], err = p.deepJsonFix(fmt.Sprintf("%s[%d]", key, i), v) if err != nil { return nil, err } } return val, nil case []uint8: return string(c), nil case map[interface{}]interface{}: val := make(map[string]interface{}) for k, v := range c { ks, ok := k.(string) if !ok { return nil, fmt.Errorf("%s: key is not string", key) } var err error val[ks], err = p.deepJsonFix( fmt.Sprintf("%s.%s", key, ks), v) if err != nil { return nil, err } } return val, nil default: return current, nil } } func (p *Provisioner) processJsonUserVars() (map[string]interface{}, error) { jsonBytes, err := json.Marshal(p.config.Json) if err != nil { // This really shouldn't happen since we literally just unmarshalled panic(err) } // Copy the user variables so that we can restore them later, and // make sure we make the quotes JSON-friendly in the user variables. originalUserVars := make(map[string]string) for k, v := range p.config.ctx.UserVariables { originalUserVars[k] = v } // Make sure we reset them no matter what defer func() { p.config.ctx.UserVariables = originalUserVars }() // Make the current user variables JSON string safe. for k, v := range p.config.ctx.UserVariables { v = strings.Replace(v, `\`, `\\`, -1) v = strings.Replace(v, `"`, `\"`, -1) p.config.ctx.UserVariables[k] = v } // Process the bytes with the template processor p.config.ctx.Data = nil jsonBytesProcessed, err := interpolate.Render(string(jsonBytes), &p.config.ctx) if err != nil { return nil, err } var result map[string]interface{} if err := json.Unmarshal([]byte(jsonBytesProcessed), &result); err != nil { return nil, err } return result, nil } var DefaultConfigTemplate = ` chef_license "{{.ChefLicense}}" cookbook_path [{{.CookbookPaths}}] {{if .HasRolesPath}} role_path "{{.RolesPath}}" {{end}} {{if .HasDataBagsPath}} data_bag_path "{{.DataBagsPath}}" {{end}} {{if .HasEncryptedDataBagSecretPath}} encrypted_data_bag_secret "{{.EncryptedDataBagSecretPath}}" {{end}} {{if .HasEnvironmentsPath}} environment_path "{{.EnvironmentsPath}}" environment "{{.ChefEnvironment}}" {{end}} ` ������������������������packer-1.6.6+ds1/provisioner/chef-solo/provisioner.hcl2spec.go��������������������������������������0000664�0000000�0000000�00000016123�13771713062�0024334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package chefsolo import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` ChefEnvironment *string `mapstructure:"chef_environment" cty:"chef_environment" hcl:"chef_environment"` ChefLicense *string `mapstructure:"chef_license" cty:"chef_license" hcl:"chef_license"` ConfigTemplate *string `mapstructure:"config_template" cty:"config_template" hcl:"config_template"` CookbookPaths []string `mapstructure:"cookbook_paths" cty:"cookbook_paths" hcl:"cookbook_paths"` RolesPath *string `mapstructure:"roles_path" cty:"roles_path" hcl:"roles_path"` DataBagsPath *string `mapstructure:"data_bags_path" cty:"data_bags_path" hcl:"data_bags_path"` EncryptedDataBagSecretPath *string `mapstructure:"encrypted_data_bag_secret_path" cty:"encrypted_data_bag_secret_path" hcl:"encrypted_data_bag_secret_path"` EnvironmentsPath *string `mapstructure:"environments_path" cty:"environments_path" hcl:"environments_path"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` InstallCommand *string `mapstructure:"install_command" cty:"install_command" hcl:"install_command"` RemoteCookbookPaths []string `mapstructure:"remote_cookbook_paths" cty:"remote_cookbook_paths" hcl:"remote_cookbook_paths"` Json map[string]interface{} `cty:"json" hcl:"json"` PreventSudo *bool `mapstructure:"prevent_sudo" cty:"prevent_sudo" hcl:"prevent_sudo"` RunList []string `mapstructure:"run_list" cty:"run_list" hcl:"run_list"` SkipInstall *bool `mapstructure:"skip_install" cty:"skip_install" hcl:"skip_install"` StagingDir *string `mapstructure:"staging_directory" cty:"staging_directory" hcl:"staging_directory"` GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` Version *string `mapstructure:"version" cty:"version" hcl:"version"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "chef_environment": &hcldec.AttrSpec{Name: "chef_environment", Type: cty.String, Required: false}, "chef_license": &hcldec.AttrSpec{Name: "chef_license", Type: cty.String, Required: false}, "config_template": &hcldec.AttrSpec{Name: "config_template", Type: cty.String, Required: false}, "cookbook_paths": &hcldec.AttrSpec{Name: "cookbook_paths", Type: cty.List(cty.String), Required: false}, "roles_path": &hcldec.AttrSpec{Name: "roles_path", Type: cty.String, Required: false}, "data_bags_path": &hcldec.AttrSpec{Name: "data_bags_path", Type: cty.String, Required: false}, "encrypted_data_bag_secret_path": &hcldec.AttrSpec{Name: "encrypted_data_bag_secret_path", Type: cty.String, Required: false}, "environments_path": &hcldec.AttrSpec{Name: "environments_path", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "install_command": &hcldec.AttrSpec{Name: "install_command", Type: cty.String, Required: false}, "remote_cookbook_paths": &hcldec.AttrSpec{Name: "remote_cookbook_paths", Type: cty.List(cty.String), Required: false}, "json": &hcldec.AttrSpec{Name: "json", Type: cty.Map(cty.String), Required: false}, "prevent_sudo": &hcldec.AttrSpec{Name: "prevent_sudo", Type: cty.Bool, Required: false}, "run_list": &hcldec.AttrSpec{Name: "run_list", Type: cty.List(cty.String), Required: false}, "skip_install": &hcldec.AttrSpec{Name: "skip_install", Type: cty.Bool, Required: false}, "staging_directory": &hcldec.AttrSpec{Name: "staging_directory", Type: cty.String, Required: false}, "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, "version": &hcldec.AttrSpec{Name: "version", Type: cty.String, Required: false}, } return s } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-solo/provisioner_test.go������������������������������������������0000664�0000000�0000000�00000016201�13771713062�0023666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package chefsolo import ( "io/ioutil" "os" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{} } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_chefEnvironment(t *testing.T) { var p Provisioner config := testConfig() config["chef_environment"] = "some-env" err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefEnvironment != "some-env" { t.Fatalf("unexpected: %#v", p.config.ChefEnvironment) } } func TestProvisionerPrepare_chefLicense(t *testing.T) { var p Provisioner // Test not set config := testConfig() err := p.Prepare(config) if err != nil { t.Fatal("should error") } if p.config.ChefLicense != "accept-silent" { t.Fatalf("unexpected: %#v", p.config.ChefLicense) } // Test set config = testConfig() config["chef_license"] = "accept" p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefLicense != "accept" { t.Fatalf("unexpected: %#v", p.config.ChefLicense) } // Test set skipInstall true config = testConfig() config["skip_install"] = true p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefLicense != "" { t.Fatalf("unexpected: %#v", "empty string") } // Test set installCommand true config = testConfig() config["install_command"] = "install chef" p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ChefLicense != "" { t.Fatalf("unexpected: %#v", "empty string") } } func TestProvisionerPrepare_configTemplate(t *testing.T) { var err error var p Provisioner // Test no config template config := testConfig() delete(config, "config_template") err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a file tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(tf.Name()) config = testConfig() config["config_template"] = tf.Name() p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a directory td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(td) config = testConfig() config["config_template"] = td p = Provisioner{} err = p.Prepare(config) if err == nil { t.Fatal("should have err") } } func TestProvisionerPrepare_cookbookPaths(t *testing.T) { var p Provisioner path1, err := ioutil.TempDir("", "cookbooks_one") if err != nil { t.Fatalf("err: %s", err) } path2, err := ioutil.TempDir("", "cookbooks_two") if err != nil { t.Fatalf("err: %s", err) } rolesPath, err := ioutil.TempDir("", "roles") if err != nil { t.Fatalf("err: %s", err) } dataBagsPath, err := ioutil.TempDir("", "data_bags") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(path1) defer os.Remove(path2) defer os.Remove(rolesPath) defer os.Remove(dataBagsPath) config := testConfig() config["cookbook_paths"] = []string{path1, path2} config["roles_path"] = rolesPath config["data_bags_path"] = dataBagsPath err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if len(p.config.CookbookPaths) != 2 { t.Fatalf("unexpected: %#v", p.config.CookbookPaths) } if p.config.CookbookPaths[0] != path1 || p.config.CookbookPaths[1] != path2 { t.Fatalf("unexpected: %#v", p.config.CookbookPaths) } if p.config.RolesPath != rolesPath { t.Fatalf("unexpected: %#v", p.config.RolesPath) } if p.config.DataBagsPath != dataBagsPath { t.Fatalf("unexpected: %#v", p.config.DataBagsPath) } } func TestProvisionerPrepare_dataBagsPath(t *testing.T) { var p Provisioner dataBagsPath, err := ioutil.TempDir("", "data_bags") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(dataBagsPath) config := testConfig() config["data_bags_path"] = dataBagsPath err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.DataBagsPath != dataBagsPath { t.Fatalf("unexpected: %#v", p.config.DataBagsPath) } } func TestProvisionerPrepare_encryptedDataBagSecretPath(t *testing.T) { var err error var p Provisioner // Test no config template config := testConfig() delete(config, "encrypted_data_bag_secret_path") err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a file tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(tf.Name()) config = testConfig() config["encrypted_data_bag_secret_path"] = tf.Name() p = Provisioner{} err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a directory td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("err: %s", err) } defer os.RemoveAll(td) config = testConfig() config["encrypted_data_bag_secret_path"] = td p = Provisioner{} err = p.Prepare(config) if err == nil { t.Fatal("should have err") } } func TestProvisionerPrepare_environmentsPath(t *testing.T) { var p Provisioner environmentsPath, err := ioutil.TempDir("", "environments") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(environmentsPath) config := testConfig() config["environments_path"] = environmentsPath err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.EnvironmentsPath != environmentsPath { t.Fatalf("unexpected: %#v", p.config.EnvironmentsPath) } } func TestProvisionerPrepare_rolesPath(t *testing.T) { var p Provisioner rolesPath, err := ioutil.TempDir("", "roles") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(rolesPath) config := testConfig() config["roles_path"] = rolesPath err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.RolesPath != rolesPath { t.Fatalf("unexpected: %#v", p.config.RolesPath) } } func TestProvisionerPrepare_json(t *testing.T) { config := testConfig() config["json"] = map[string]interface{}{ "foo": "{{ user `foo` }}", } config[common.UserVariablesConfigKey] = map[string]string{ "foo": `"bar\baz"`, } var p Provisioner err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.Json["foo"] != `"bar\baz"` { t.Fatalf("bad: %#v", p.config.Json) } } func TestProvisionerPrepare_jsonNested(t *testing.T) { config := testConfig() config["json"] = map[string]interface{}{ "foo": map[interface{}]interface{}{ "bar": []uint8("baz"), }, "bar": []interface{}{ "foo", map[interface{}]interface{}{ "bar": "baz", }, }, "bFalse": false, "bTrue": true, "bNil": nil, "bStr": []uint8("bar"), "bInt": 1, "bFloat": 4.5, } var p Provisioner err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } fooMap := p.config.Json["foo"].(map[string]interface{}) if fooMap["bar"] != "baz" { t.Fatalf("nope: %#v", fooMap["bar"]) } if p.config.Json["bStr"] != "bar" { t.Fatalf("nope: %#v", fooMap["bar"]) } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-solo/version/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021406�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/chef-solo/version/version.go�������������������������������������������0000664�0000000�0000000�00000000501�13771713062�0023416�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ChefSoloPluginVersion *version.PluginVersion func init() { ChefSoloPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/converge/��������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017652�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/converge/provisioner.go������������������������������������������������0000664�0000000�0000000�00000015247�13771713062�0022571�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config,ModuleDir // This package implements a provisioner for Packer that executes // Converge to provision a remote machine package converge import ( "bytes" "context" "errors" "fmt" "strings" "encoding/json" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) // Config for Converge provisioner type Config struct { common.PackerConfig `mapstructure:",squash"` // Bootstrapping Bootstrap bool `mapstructure:"bootstrap"` Version string `mapstructure:"version"` BootstrapCommand string `mapstructure:"bootstrap_command"` PreventBootstrapSudo bool `mapstructure:"prevent_bootstrap_sudo"` // Modules ModuleDirs []ModuleDir `mapstructure:"module_dirs"` // Execution Module string `mapstructure:"module"` WorkingDirectory string `mapstructure:"working_directory"` Params map[string]string `mapstructure:"params"` ExecuteCommand string `mapstructure:"execute_command"` PreventSudo bool `mapstructure:"prevent_sudo"` ctx interpolate.Context } // ModuleDir is a directory to transfer to the remote system type ModuleDir struct { Source string `mapstructure:"source"` Destination string `mapstructure:"destination"` Exclude []string `mapstructure:"exclude"` } // Provisioner for Converge type Provisioner struct { config Config } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode( &p.config, &config.DecodeOpts{ PluginType: "converge", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", "bootstrap_command", }, }, }, raws..., ) if err != nil { return err } // require a single module if p.config.Module == "" { return errors.New("Converge requires a module to provision the system") } // set defaults if p.config.WorkingDirectory == "" { p.config.WorkingDirectory = "/tmp" } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = "cd {{.WorkingDirectory}} && {{if .Sudo}}sudo {{end}}converge apply --local --log-level=WARNING --paramsJSON '{{.ParamsJSON}}' {{.Module}}" } if p.config.BootstrapCommand == "" { p.config.BootstrapCommand = "curl -s https://get.converge.sh | {{if .Sudo}}sudo {{end}}sh {{if ne .Version \"\"}}-s -- -v {{.Version}}{{end}}" } // validate sources and destinations for i, dir := range p.config.ModuleDirs { if dir.Source == "" { return fmt.Errorf("Source (\"source\" key) is required in Converge module dir #%d", i) } if dir.Destination == "" { return fmt.Errorf("Destination (\"destination\" key) is required in Converge module dir #%d", i) } } return err } // Provision node somehow. TODO: actual docs func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, _ map[string]interface{}) error { ui.Say("Provisioning with Converge") // bootstrapping if err := p.maybeBootstrap(ui, comm); err != nil { return err // error messages are already user-friendly } // send module directories to the remote host if err := p.sendModuleDirectories(ui, comm); err != nil { return err // error messages are already user-friendly } // apply all the modules if err := p.applyModules(ui, comm); err != nil { return err // error messages are already user-friendly } return nil } func (p *Provisioner) maybeBootstrap(ui packersdk.Ui, comm packersdk.Communicator) error { ctx := context.TODO() if !p.config.Bootstrap { return nil } ui.Message("bootstrapping converge") p.config.ctx.Data = struct { Version string Sudo bool }{ Version: p.config.Version, Sudo: !p.config.PreventBootstrapSudo, } command, err := interpolate.Render(p.config.BootstrapCommand, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate bootstrap command: %s", err) } var out, outErr bytes.Buffer cmd := &packersdk.RemoteCmd{ Command: command, Stdin: nil, Stdout: &out, Stderr: &outErr, } if err = comm.Start(ctx, cmd); err != nil { return fmt.Errorf("Error bootstrapping converge: %s", err) } cmd.Wait() if cmd.ExitStatus() != 0 { ui.Error(out.String()) ui.Error(outErr.String()) return errors.New("Error bootstrapping converge") } ui.Message(strings.TrimSpace(out.String())) return nil } func (p *Provisioner) sendModuleDirectories(ui packersdk.Ui, comm packersdk.Communicator) error { for _, dir := range p.config.ModuleDirs { if err := comm.UploadDir(dir.Destination, dir.Source, dir.Exclude); err != nil { return fmt.Errorf("Could not upload %q: %s", dir.Source, err) } ui.Message(fmt.Sprintf("transferred %q to %q", dir.Source, dir.Destination)) } return nil } func (p *Provisioner) applyModules(ui packersdk.Ui, comm packersdk.Communicator) error { ctx := context.TODO() // create params JSON file params, err := json.Marshal(p.config.Params) if err != nil { return fmt.Errorf("Could not marshal parameters as JSON: %s", err) } p.config.ctx.Data = struct { ParamsJSON, WorkingDirectory, Module string Sudo bool }{ ParamsJSON: string(params), WorkingDirectory: p.config.WorkingDirectory, Module: p.config.Module, Sudo: !p.config.PreventSudo, } command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate execute command: %s", err) } // run Converge in the specified directory var runOut, runErr bytes.Buffer cmd := &packersdk.RemoteCmd{ Command: command, Stdin: nil, Stdout: &runOut, Stderr: &runErr, } if err := comm.Start(ctx, cmd); err != nil { return fmt.Errorf("Error applying %q: %s", p.config.Module, err) } cmd.Wait() if cmd.ExitStatus() == 127 { ui.Error("Could not find Converge. Is it installed and in PATH?") if !p.config.Bootstrap { ui.Error("Bootstrapping was disabled for this run. That might be why Converge isn't present.") } return errors.New("Could not find Converge") } else if cmd.ExitStatus() != 0 { ui.Error(strings.TrimSpace(runOut.String())) ui.Error(strings.TrimSpace(runErr.String())) ui.Error(fmt.Sprintf("Exited with error code %d.", cmd.ExitStatus())) return fmt.Errorf("Error applying %q", p.config.Module) } ui.Message(strings.TrimSpace(runOut.String())) return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/converge/provisioner.hcl2spec.go���������������������������������������0000664�0000000�0000000�00000014270�13771713062�0024266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config,ModuleDir"; DO NOT EDIT. package converge import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Bootstrap *bool `mapstructure:"bootstrap" cty:"bootstrap" hcl:"bootstrap"` Version *string `mapstructure:"version" cty:"version" hcl:"version"` BootstrapCommand *string `mapstructure:"bootstrap_command" cty:"bootstrap_command" hcl:"bootstrap_command"` PreventBootstrapSudo *bool `mapstructure:"prevent_bootstrap_sudo" cty:"prevent_bootstrap_sudo" hcl:"prevent_bootstrap_sudo"` ModuleDirs []FlatModuleDir `mapstructure:"module_dirs" cty:"module_dirs" hcl:"module_dirs"` Module *string `mapstructure:"module" cty:"module" hcl:"module"` WorkingDirectory *string `mapstructure:"working_directory" cty:"working_directory" hcl:"working_directory"` Params map[string]string `mapstructure:"params" cty:"params" hcl:"params"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` PreventSudo *bool `mapstructure:"prevent_sudo" cty:"prevent_sudo" hcl:"prevent_sudo"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "bootstrap": &hcldec.AttrSpec{Name: "bootstrap", Type: cty.Bool, Required: false}, "version": &hcldec.AttrSpec{Name: "version", Type: cty.String, Required: false}, "bootstrap_command": &hcldec.AttrSpec{Name: "bootstrap_command", Type: cty.String, Required: false}, "prevent_bootstrap_sudo": &hcldec.AttrSpec{Name: "prevent_bootstrap_sudo", Type: cty.Bool, Required: false}, "module_dirs": &hcldec.BlockListSpec{TypeName: "module_dirs", Nested: hcldec.ObjectSpec((*FlatModuleDir)(nil).HCL2Spec())}, "module": &hcldec.AttrSpec{Name: "module", Type: cty.String, Required: false}, "working_directory": &hcldec.AttrSpec{Name: "working_directory", Type: cty.String, Required: false}, "params": &hcldec.AttrSpec{Name: "params", Type: cty.Map(cty.String), Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "prevent_sudo": &hcldec.AttrSpec{Name: "prevent_sudo", Type: cty.Bool, Required: false}, } return s } // FlatModuleDir is an auto-generated flat version of ModuleDir. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatModuleDir struct { Source *string `mapstructure:"source" cty:"source" hcl:"source"` Destination *string `mapstructure:"destination" cty:"destination" hcl:"destination"` Exclude []string `mapstructure:"exclude" cty:"exclude" hcl:"exclude"` } // FlatMapstructure returns a new FlatModuleDir. // FlatModuleDir is an auto-generated flat version of ModuleDir. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*ModuleDir) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatModuleDir) } // HCL2Spec returns the hcl spec of a ModuleDir. // This spec is used by HCL to read the fields of ModuleDir. // The decoded values from this spec will then be applied to a FlatModuleDir. func (*FlatModuleDir) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "source": &hcldec.AttrSpec{Name: "source", Type: cty.String, Required: false}, "destination": &hcldec.AttrSpec{Name: "destination", Type: cty.String, Required: false}, "exclude": &hcldec.AttrSpec{Name: "exclude", Type: cty.List(cty.String), Required: false}, } return s } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/converge/provisioner_test.go�������������������������������������������0000664�0000000�0000000�00000005450�13771713062�0023623�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package converge import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "module_dirs": []map[string]interface{}{ { "source": "from", "destination": "/opt/converge", }, }, "module": "/opt/converge/test.hcl", } } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatal("must be a Provisioner") } } func TestProvisionerPrepare(t *testing.T) { t.Run("defaults", func(t *testing.T) { t.Run("working_directory", func(t *testing.T) { var p Provisioner config := testConfig() delete(config, "working_directory") if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } if p.config.WorkingDirectory != "/tmp" { t.Fatalf("unexpected module directory: %s", p.config.WorkingDirectory) } }) t.Run("execute_command", func(t *testing.T) { var p Provisioner config := testConfig() delete(config, "execute_command") if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } if p.config.ExecuteCommand == "" { t.Fatal("execute command unexpectedly blank") } }) t.Run("bootstrap_command", func(t *testing.T) { var p Provisioner config := testConfig() delete(config, "bootstrap_command") if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } if p.config.BootstrapCommand == "" { t.Fatal("bootstrap command unexpectedly blank") } }) }) t.Run("validate", func(t *testing.T) { t.Run("module dir", func(t *testing.T) { t.Run("missing source", func(t *testing.T) { var p Provisioner config := testConfig() delete(config["module_dirs"].([]map[string]interface{})[0], "source") err := p.Prepare(config) if err == nil { t.Error("expected error") } else if err.Error() != "Source (\"source\" key) is required in Converge module dir #0" { t.Errorf("bad error message: %s", err) } }) t.Run("missing destination", func(t *testing.T) { var p Provisioner config := testConfig() delete(config["module_dirs"].([]map[string]interface{})[0], "destination") err := p.Prepare(config) if err == nil { t.Error("expected error") } else if err.Error() != "Destination (\"destination\" key) is required in Converge module dir #0" { t.Errorf("bad error message: %s", err) } }) }) t.Run("no module specified", func(t *testing.T) { var p Provisioner config := testConfig() delete(config, "module") err := p.Prepare(config) if err == nil { t.Error("expected error") } else if err.Error() != "Converge requires a module to provision the system" { t.Errorf("bad error message: %s", err) } }) }) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/converge/version/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021337�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/converge/version/version.go��������������������������������������������0000664�0000000�0000000�00000000501�13771713062�0023347�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ConvergePluginVersion *version.PluginVersion func init() { ConvergePluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/file/������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016761�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/file/provisioner.go����������������������������������������������������0000664�0000000�0000000�00000017021�13771713062�0021670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config //go:generate struct-markdown package file import ( "context" "errors" "fmt" "io" "os" "path/filepath" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` // The path to a local file or directory to upload to the // machine. The path can be absolute or relative. If it is relative, it is // relative to the working directory when Packer is executed. If this is a // directory, the existence of a trailing slash is important. Read below on // uploading directories. Mandatory unless `sources` is set. Source string `mapstructure:"source" required:"true"` // A list of sources to upload. This can be used in place of the `source` // option if you have several files that you want to upload to the same // place. Note that the destination must be a directory with a trailing // slash, and that all files listed in `sources` will be uploaded to the // same directory with their file names preserved. Sources []string `mapstructure:"sources" required:"false"` // The path where the file will be uploaded to in the machine. This value // must be a writable location and any parent directories // must already exist. If the provisioning user (generally not root) cannot // write to this directory, you will receive a "Permission Denied" error. // If the source is a file, it's a good idea to make the destination a file // as well, but if you set your destination as a directory, at least make // sure that the destination ends in a trailing slash so that Packer knows // to use the source's basename in the final upload path. Failure to do so // may cause Packer to fail on file uploads. If the destination file // already exists, it will be overwritten. Destination string `mapstructure:"destination" required:"true"` // The direction of the file transfer. This defaults to "upload". If it is // set to "download" then the file "source" in the machine will be // downloaded locally to "destination" Direction string `mapstructure:"direction" required:"false"` // For advanced users only. If true, check the file existence only before // uploading, rather than upon pre-build validation. This allows users to // upload files created on-the-fly. This defaults to false. We // don't recommend using this feature, since it can cause Packer to become // dependent on system state. We would prefer you generate your files before // the Packer run, but realize that there are situations where this may be // unavoidable. Generated bool `mapstructure:"generated" required:"false"` ctx interpolate.Context } type Provisioner struct { config Config } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "file", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } if p.config.Direction == "" { p.config.Direction = "upload" } var errs *packersdk.MultiError if p.config.Direction != "download" && p.config.Direction != "upload" { errs = packersdk.MultiErrorAppend(errs, errors.New("Direction must be one of: download, upload.")) } if p.config.Source != "" { p.config.Sources = append(p.config.Sources, p.config.Source) } if p.config.Direction == "upload" { for _, src := range p.config.Sources { if _, err := os.Stat(src); p.config.Generated == false && err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Bad source '%s': %s", src, err)) } } } if len(p.config.Sources) < 1 { errs = packersdk.MultiErrorAppend(errs, errors.New("Source must be specified.")) } if p.config.Destination == "" { errs = packersdk.MultiErrorAppend(errs, errors.New("Destination must be specified.")) } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { if generatedData == nil { generatedData = make(map[string]interface{}) } p.config.ctx.Data = generatedData if p.config.Direction == "download" { return p.ProvisionDownload(ui, comm) } else { return p.ProvisionUpload(ui, comm) } } func (p *Provisioner) ProvisionDownload(ui packersdk.Ui, comm packersdk.Communicator) error { dst, err := interpolate.Render(p.config.Destination, &p.config.ctx) if err != nil { return fmt.Errorf("Error interpolating destination: %s", err) } for _, src := range p.config.Sources { src, err := interpolate.Render(src, &p.config.ctx) if err != nil { return fmt.Errorf("Error interpolating source: %s", err) } ui.Say(fmt.Sprintf("Downloading %s => %s", src, dst)) // ensure destination dir exists. p.config.Destination may either be a file or a dir. dir := dst // if it doesn't end with a /, set dir as the parent dir if !strings.HasSuffix(dst, "/") { dir = filepath.Dir(dir) } else if !strings.HasSuffix(src, "/") && !strings.HasSuffix(src, "*") { dst = filepath.Join(dst, filepath.Base(src)) } if dir != "" { err := os.MkdirAll(dir, os.FileMode(0755)) if err != nil { return err } } // if the src was a dir, download the dir if strings.HasSuffix(src, "/") || strings.ContainsAny(src, "*?[") { return comm.DownloadDir(src, dst, nil) } f, err := os.OpenFile(dst, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) if err != nil { return err } defer f.Close() // Create MultiWriter for the current progress pf := io.MultiWriter(f) // Download the file if err = comm.Download(src, pf); err != nil { ui.Error(fmt.Sprintf("Download failed: %s", err)) return err } } return nil } func (p *Provisioner) ProvisionUpload(ui packersdk.Ui, comm packersdk.Communicator) error { dst, err := interpolate.Render(p.config.Destination, &p.config.ctx) if err != nil { return fmt.Errorf("Error interpolating destination: %s", err) } for _, src := range p.config.Sources { src, err := interpolate.Render(src, &p.config.ctx) if err != nil { return fmt.Errorf("Error interpolating source: %s", err) } ui.Say(fmt.Sprintf("Uploading %s => %s", src, dst)) info, err := os.Stat(src) if err != nil { return err } // If we're uploading a directory, short circuit and do that if info.IsDir() { if err = comm.UploadDir(dst, src, nil); err != nil { ui.Error(fmt.Sprintf("Upload failed: %s", err)) return err } continue } // We're uploading a file... f, err := os.Open(src) if err != nil { return err } defer f.Close() fi, err := f.Stat() if err != nil { return err } filedst := dst if strings.HasSuffix(dst, "/") { filedst = dst + filepath.Base(src) } pf := ui.TrackProgress(filepath.Base(src), 0, info.Size(), f) defer pf.Close() // Upload the file if err = comm.Upload(filedst, pf, &fi); err != nil { if strings.Contains(err.Error(), "Error restoring file") { ui.Error(fmt.Sprintf("Upload failed: %s; this can occur when "+ "your file destination is a folder without a trailing "+ "slash.", err)) } ui.Error(fmt.Sprintf("Upload failed: %s", err)) return err } } return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/file/provisioner.hcl2spec.go�������������������������������������������0000664�0000000�0000000�00000007505�13771713062�0023400�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package file import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Source *string `mapstructure:"source" required:"true" cty:"source" hcl:"source"` Sources []string `mapstructure:"sources" required:"false" cty:"sources" hcl:"sources"` Destination *string `mapstructure:"destination" required:"true" cty:"destination" hcl:"destination"` Direction *string `mapstructure:"direction" required:"false" cty:"direction" hcl:"direction"` Generated *bool `mapstructure:"generated" required:"false" cty:"generated" hcl:"generated"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "source": &hcldec.AttrSpec{Name: "source", Type: cty.String, Required: false}, "sources": &hcldec.AttrSpec{Name: "sources", Type: cty.List(cty.String), Required: false}, "destination": &hcldec.AttrSpec{Name: "destination", Type: cty.String, Required: false}, "direction": &hcldec.AttrSpec{Name: "direction", Type: cty.String, Required: false}, "generated": &hcldec.AttrSpec{Name: "generated", Type: cty.Bool, Required: false}, } return s } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/file/provisioner_test.go�����������������������������������������������0000664�0000000�0000000�00000021531�13771713062�0022730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package file import ( "bytes" "context" "io/ioutil" "os" "path/filepath" "regexp" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "destination": "something", } } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a provisioner") } } func TestProvisionerPrepare_InvalidKey(t *testing.T) { var p Provisioner config := testConfig() // Add a random key config["i_should_not_be_valid"] = true err := p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_InvalidSource(t *testing.T) { var p Provisioner config := testConfig() config["source"] = "/this/should/not/exist" err := p.Prepare(config) if err == nil { t.Fatalf("should require existing file") } config["generated"] = false err = p.Prepare(config) if err == nil { t.Fatalf("should required existing file") } } func TestProvisionerPrepare_ValidSource(t *testing.T) { var p Provisioner tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config := testConfig() config["source"] = tf.Name() err = p.Prepare(config) if err != nil { t.Fatalf("should allow valid file: %s", err) } config["generated"] = false err = p.Prepare(config) if err != nil { t.Fatalf("should allow valid file: %s", err) } } func TestProvisionerPrepare_GeneratedSource(t *testing.T) { var p Provisioner config := testConfig() config["source"] = "/this/should/not/exist" config["generated"] = true err := p.Prepare(config) if err != nil { t.Fatalf("should allow non-existing file: %s", err) } } func TestProvisionerPrepare_EmptyDestination(t *testing.T) { var p Provisioner config := testConfig() delete(config, "destination") err := p.Prepare(config) if err == nil { t.Fatalf("should require destination path") } } func TestProvisionerProvision_SendsFile(t *testing.T) { var p Provisioner tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) if _, err = tf.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } config := map[string]interface{}{ "source": tf.Name(), "destination": "something", } if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } b := bytes.NewBuffer(nil) ui := &packersdk.BasicUi{ Writer: b, PB: &packersdk.NoopProgressTracker{}, } comm := &packersdk.MockCommunicator{} err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatalf("should successfully provision: %s", err) } if !strings.Contains(b.String(), tf.Name()) { t.Fatalf("should print source filename") } if !strings.Contains(b.String(), "something") { t.Fatalf("should print destination filename") } if comm.UploadPath != "something" { t.Fatalf("should upload to configured destination") } if comm.UploadData != "hello" { t.Fatalf("should upload with source file's data") } } func TestProvisionerProvision_SendsFileMultipleFiles(t *testing.T) { var p Provisioner tf1, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf1.Name()) if _, err = tf1.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } tf2, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf2.Name()) if _, err = tf2.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } config := map[string]interface{}{ "sources": []string{tf1.Name(), tf2.Name()}, "destination": "something", } if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } b := bytes.NewBuffer(nil) ui := &packersdk.BasicUi{ Writer: b, PB: &packersdk.NoopProgressTracker{}, } comm := &packersdk.MockCommunicator{} err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatalf("should successfully provision: %s", err) } if !strings.Contains(b.String(), tf1.Name()) { t.Fatalf("should print first source filename") } if !strings.Contains(b.String(), tf2.Name()) { t.Fatalf("should print second source filename") } } func TestProvisionerProvision_SendsFileMultipleDirs(t *testing.T) { var p Provisioner // Prepare the first directory td1, err := ioutil.TempDir("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td1) tf1, err := ioutil.TempFile(td1, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } if _, err = tf1.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } // Prepare the second directory td2, err := ioutil.TempDir("", "packerdir") if err != nil { t.Fatalf("error temp folder 1: %s", err) } defer os.Remove(td2) tf2, err := ioutil.TempFile(td2, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } if _, err = tf2.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } if _, err = tf1.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } // Run Provision config := map[string]interface{}{ "sources": []string{td1, td2}, "destination": "something", } if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } b := bytes.NewBuffer(nil) ui := &packersdk.BasicUi{ Writer: b, PB: &packersdk.NoopProgressTracker{}, } comm := &packersdk.MockCommunicator{} err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatalf("should successfully provision: %s", err) } if !strings.Contains(b.String(), td1) { t.Fatalf("should print first directory") } if !strings.Contains(b.String(), td2) { t.Fatalf("should print second directory") } } func TestProvisionerProvision_SendsFileMultipleFilesToFolder(t *testing.T) { var p Provisioner tf1, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf1.Name()) if _, err = tf1.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } tf2, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf2.Name()) if _, err = tf2.Write([]byte("hello")); err != nil { t.Fatalf("error writing tempfile: %s", err) } config := map[string]interface{}{ "sources": []string{tf1.Name(), tf2.Name()}, "destination": "something/", } if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } b := bytes.NewBuffer(nil) ui := &packersdk.BasicUi{ Writer: b, PB: &packersdk.NoopProgressTracker{}, } comm := &packersdk.MockCommunicator{} err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatalf("should successfully provision: %s", err) } if !strings.Contains(b.String(), tf1.Name()) { t.Fatalf("should print first source filename") } if !strings.Contains(b.String(), tf2.Name()) { t.Fatalf("should print second source filename") } dstRegex := regexp.MustCompile("something/\n") allDst := dstRegex.FindAllString(b.String(), -1) if len(allDst) != 2 { t.Fatalf("some destinations are broken; output: \n%s", b.String()) } } func TestProvisionDownloadMkdirAll(t *testing.T) { tests := []struct { path string }{ {"dir"}, {"dir/"}, {"dir/subdir"}, {"dir/subdir/"}, {"path/to/dir"}, {"path/to/dir/"}, } tmpDir, err := ioutil.TempDir("", "packer-file") if err != nil { t.Fatalf("error tempdir: %s", err) } defer os.RemoveAll(tmpDir) tf, err := ioutil.TempFile(tmpDir, "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config := map[string]interface{}{ "source": tf.Name(), } var p Provisioner for _, test := range tests { path := filepath.Join(tmpDir, test.path) config["destination"] = filepath.Join(path, "something") if err := p.Prepare(config); err != nil { t.Fatalf("err: %s", err) } b := bytes.NewBuffer(nil) ui := &packersdk.BasicUi{ Writer: b, PB: &packersdk.NoopProgressTracker{}, } comm := &packersdk.MockCommunicator{} err = p.ProvisionDownload(ui, comm) if err != nil { t.Fatalf("should successfully provision: %s", err) } if !strings.Contains(b.String(), tf.Name()) { t.Fatalf("should print source filename") } if !strings.Contains(b.String(), "something") { t.Fatalf("should print destination filename") } if _, err := os.Stat(path); err != nil { t.Fatalf("stat of download dir should not error: %s", err) } if _, err := os.Stat(config["destination"].(string)); err != nil { t.Fatalf("stat of destination file should not error: %s", err) } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/file/version/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020446�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/file/version/version.go������������������������������������������������0000664�0000000�0000000�00000000503�13771713062�0022460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var FileProvisionerVersion *version.PluginVersion func init() { FileProvisionerVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017323�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/provisioner.go��������������������������������������������������0000664�0000000�0000000�00000033543�13771713062�0022241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package inspec import ( "bufio" "bytes" "context" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "fmt" "io" "io/ioutil" "log" "net" "os" "os/exec" "os/user" "regexp" "strconv" "strings" "sync" "unicode" "golang.org/x/crypto/ssh" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/adapter" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) var SupportedBackends = map[string]bool{"docker": true, "local": true, "ssh": true, "winrm": true} type Config struct { common.PackerConfig `mapstructure:",squash"` ctx interpolate.Context // The command to invoke InSpec. Defaults to `inspec`. Command string `mapstructure-to-hcl2:"command"` SubCommand string `mapstructure-to-hcl2:",skip"` // Extra options to pass to the inspec command ExtraArguments []string `mapstructure:"extra_arguments"` InspecEnvVars []string `mapstructure:"inspec_env_vars"` // The profile to execute. Profile string `mapstructure:"profile"` AttributesDirectory string `mapstructure:"attributes_directory"` AttributesFiles []string `mapstructure:"attributes"` Backend string `mapstructure:"backend"` User string `mapstructure:"user"` Host string `mapstructure:"host"` LocalPort int `mapstructure:"local_port"` SSHHostKeyFile string `mapstructure:"ssh_host_key_file"` SSHAuthorizedKeyFile string `mapstructure:"ssh_authorized_key_file"` } type Provisioner struct { config Config adapter *adapter.Adapter done chan struct{} inspecVersion string inspecMajVersion uint } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { p.done = make(chan struct{}) err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "inspec", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } // Defaults if p.config.Command == "" { p.config.Command = "inspec" } if p.config.SubCommand == "" { p.config.SubCommand = "exec" } var errs *packersdk.MultiError err = validateProfileConfig(p.config.Profile) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } // Check that the authorized key file exists if len(p.config.SSHAuthorizedKeyFile) > 0 { err = validateFileConfig(p.config.SSHAuthorizedKeyFile, "ssh_authorized_key_file", true) if err != nil { log.Println(p.config.SSHAuthorizedKeyFile, "does not exist") errs = packersdk.MultiErrorAppend(errs, err) } } if len(p.config.SSHHostKeyFile) > 0 { err = validateFileConfig(p.config.SSHHostKeyFile, "ssh_host_key_file", true) if err != nil { log.Println(p.config.SSHHostKeyFile, "does not exist") errs = packersdk.MultiErrorAppend(errs, err) } } if p.config.Backend == "" { p.config.Backend = "ssh" } if _, ok := SupportedBackends[p.config.Backend]; !ok { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("backend: %s must be a valid backend", p.config.Backend)) } if p.config.Backend == "docker" && p.config.Host == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("backend: host must be specified for docker backend")) } if p.config.Host == "" { p.config.Host = "127.0.0.1" } if p.config.LocalPort > 65535 { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("local_port: %d must be a valid port", p.config.LocalPort)) } if len(p.config.AttributesDirectory) > 0 { err = validateDirectoryConfig(p.config.AttributesDirectory, "attrs") if err != nil { log.Println(p.config.AttributesDirectory, "does not exist") errs = packersdk.MultiErrorAppend(errs, err) } } if p.config.User == "" { usr, err := user.Current() if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } else { p.config.User = usr.Username } } if p.config.User == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("user: could not determine current user from environment.")) } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) getVersion() error { out, err := exec.Command(p.config.Command, "version").Output() if err != nil { return fmt.Errorf( "Error running \"%s version\": %s", p.config.Command, err.Error()) } versionRe := regexp.MustCompile(`\w (\d+\.\d+[.\d+]*)`) matches := versionRe.FindStringSubmatch(string(out)) if matches == nil { return fmt.Errorf( "Could not find %s version in output:\n%s", p.config.Command, string(out)) } version := matches[1] log.Printf("%s version: %s", p.config.Command, version) p.inspecVersion = version majVer, err := strconv.ParseUint(strings.Split(version, ".")[0], 10, 0) if err != nil { return fmt.Errorf("Could not parse major version from \"%s\".", version) } p.inspecMajVersion = uint(majVer) return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ui.Say("Provisioning with Inspec...") p.config.ctx.Data = generatedData userp, err := interpolate.Render(p.config.User, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate inspec user: %s", err) } p.config.User = userp host, err := interpolate.Render(p.config.Host, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate inspec user: %s", err) } p.config.Host = host for i, envVar := range p.config.InspecEnvVars { envVar, err := interpolate.Render(envVar, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate inspec env vars: %s", err) } p.config.InspecEnvVars[i] = envVar } for i, arg := range p.config.ExtraArguments { arg, err := interpolate.Render(arg, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate inspec extra arguments: %s", err) } p.config.ExtraArguments[i] = arg } for i, arg := range p.config.AttributesFiles { arg, err := interpolate.Render(arg, &p.config.ctx) if err != nil { return fmt.Errorf("Could not interpolate inspec attributes: %s", err) } p.config.AttributesFiles[i] = arg } k, err := newUserKey(p.config.SSHAuthorizedKeyFile) if err != nil { return err } hostSigner, err := newSigner(p.config.SSHHostKeyFile) if err != nil { return fmt.Errorf("error creating host signer: %s", err) } // Remove the private key file if len(k.privKeyFile) > 0 { defer os.Remove(k.privKeyFile) } keyChecker := ssh.CertChecker{ UserKeyFallback: func(conn ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error) { if user := conn.User(); user != p.config.User { return nil, errors.New(fmt.Sprintf("authentication failed: %s is not a valid user", user)) } if !bytes.Equal(k.Marshal(), pubKey.Marshal()) { return nil, errors.New("authentication failed: unauthorized key") } return nil, nil }, IsUserAuthority: func(k ssh.PublicKey) bool { return true }, } config := &ssh.ServerConfig{ AuthLogCallback: func(conn ssh.ConnMetadata, method string, err error) { log.Printf("authentication attempt from %s to %s as %s using %s", conn.RemoteAddr(), conn.LocalAddr(), conn.User(), method) }, PublicKeyCallback: keyChecker.Authenticate, //NoClientAuth: true, } config.AddHostKey(hostSigner) localListener, err := func() (net.Listener, error) { port := p.config.LocalPort tries := 1 if port != 0 { tries = 10 } for i := 0; i < tries; i++ { l, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", port)) port++ if err != nil { ui.Say(err.Error()) continue } _, portStr, err := net.SplitHostPort(l.Addr().String()) if err != nil { ui.Say(err.Error()) continue } p.config.LocalPort, err = strconv.Atoi(portStr) if err != nil { ui.Say(err.Error()) continue } return l, nil } return nil, errors.New("Error setting up SSH proxy connection") }() if err != nil { return err } ui = &packersdk.SafeUi{ Sem: make(chan int, 1), Ui: ui, } p.adapter = adapter.NewAdapter(p.done, localListener, config, "", ui, comm) defer func() { log.Print("shutting down the SSH proxy") close(p.done) p.adapter.Shutdown() }() go p.adapter.Serve() tf, err := ioutil.TempFile(p.config.AttributesDirectory, "packer-provisioner-inspec.*.yml") if err != nil { return fmt.Errorf("Error preparing packer attributes file: %s", err) } defer os.Remove(tf.Name()) w := bufio.NewWriter(tf) w.WriteString(fmt.Sprintf("packer_build_name: %s\n", p.config.PackerBuildName)) w.WriteString(fmt.Sprintf("packer_builder_type: %s\n", p.config.PackerBuilderType)) if err := w.Flush(); err != nil { tf.Close() return fmt.Errorf("Error preparing packer attributes file: %s", err) } tf.Close() p.config.AttributesFiles = append(p.config.AttributesFiles, tf.Name()) if err := p.executeInspec(ui, comm, k.privKeyFile); err != nil { return fmt.Errorf("Error executing Inspec: %s", err) } return nil } func (p *Provisioner) executeInspec(ui packersdk.Ui, comm packersdk.Communicator, privKeyFile string) error { var envvars []string args := []string{p.config.SubCommand, p.config.Profile} args = append(args, "--backend", p.config.Backend) args = append(args, "--host", p.config.Host) if p.config.User != "" { args = append(args, "--user", p.config.User) } if p.config.Backend == "ssh" { if len(privKeyFile) > 0 { args = append(args, "--key-files", privKeyFile) } args = append(args, "--port", strconv.Itoa(p.config.LocalPort)) } args = append(args, "--input-file") args = append(args, p.config.AttributesFiles...) args = append(args, p.config.ExtraArguments...) if len(p.config.InspecEnvVars) > 0 { envvars = append(envvars, p.config.InspecEnvVars...) } cmd := exec.Command(p.config.Command, args...) cmd.Env = os.Environ() if len(envvars) > 0 { cmd.Env = append(cmd.Env, envvars...) } stdout, err := cmd.StdoutPipe() if err != nil { return err } stderr, err := cmd.StderrPipe() if err != nil { return err } wg := sync.WaitGroup{} repeat := func(r io.ReadCloser) { reader := bufio.NewReader(r) for { line, err := reader.ReadString('\n') if line != "" { line = strings.TrimRightFunc(line, unicode.IsSpace) ui.Message(line) } if err != nil { if err == io.EOF { break } else { ui.Error(err.Error()) break } } } wg.Done() } wg.Add(2) go repeat(stdout) go repeat(stderr) ui.Say(fmt.Sprintf("Executing Inspec: %s", strings.Join(cmd.Args, " "))) if err := cmd.Start(); err != nil { return err } wg.Wait() err = cmd.Wait() if err != nil { return fmt.Errorf("Non-zero exit status: %s", err) } return nil } func validateFileConfig(name string, config string, req bool) error { if req { if name == "" { return fmt.Errorf("%s must be specified.", config) } } info, err := os.Stat(name) if err != nil { return fmt.Errorf("%s: %s is invalid: %s", config, name, err) } else if info.IsDir() { return fmt.Errorf("%s: %s must point to a file", config, name) } return nil } func validateProfileConfig(name string) error { if name == "" { return fmt.Errorf("profile must be specified.") } return nil } func validateDirectoryConfig(name string, config string) error { info, err := os.Stat(name) if err != nil { return fmt.Errorf("%s: %s is invalid: %s", config, name, err) } else if !info.IsDir() { return fmt.Errorf("%s: %s must point to a directory", config, name) } return nil } type userKey struct { ssh.PublicKey privKeyFile string } func newUserKey(pubKeyFile string) (*userKey, error) { userKey := new(userKey) if len(pubKeyFile) > 0 { pubKeyBytes, err := ioutil.ReadFile(pubKeyFile) if err != nil { return nil, errors.New("Failed to read public key") } userKey.PublicKey, _, _, _, err = ssh.ParseAuthorizedKey(pubKeyBytes) if err != nil { return nil, errors.New("Failed to parse authorized key") } return userKey, nil } key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { return nil, errors.New("Failed to generate key pair") } userKey.PublicKey, err = ssh.NewPublicKey(key.Public()) if err != nil { return nil, errors.New("Failed to extract public key from generated key pair") } // To support Inspec calling back to us we need to write // this file down privateKeyDer := x509.MarshalPKCS1PrivateKey(key) privateKeyBlock := pem.Block{ Type: "RSA PRIVATE KEY", Headers: nil, Bytes: privateKeyDer, } tf, err := ioutil.TempFile("", "packer-provisioner-inspec.*.key") if err != nil { return nil, errors.New("failed to create temp file for generated key") } _, err = tf.Write(pem.EncodeToMemory(&privateKeyBlock)) if err != nil { return nil, errors.New("failed to write private key to temp file") } err = tf.Close() if err != nil { return nil, errors.New("failed to close private key temp file") } userKey.privKeyFile = tf.Name() return userKey, nil } type signer struct { ssh.Signer } func newSigner(privKeyFile string) (*signer, error) { signer := new(signer) if len(privKeyFile) > 0 { privateBytes, err := ioutil.ReadFile(privKeyFile) if err != nil { return nil, errors.New("Failed to load private host key") } signer.Signer, err = ssh.ParsePrivateKey(privateBytes) if err != nil { return nil, errors.New("Failed to parse private host key") } return signer, nil } key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { return nil, errors.New("Failed to generate server key pair") } signer.Signer, err = ssh.NewSignerFromKey(key) if err != nil { return nil, errors.New("Failed to extract private key from generated key pair") } return signer, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/provisioner.hcl2spec.go�����������������������������������������0000664�0000000�0000000�00000012464�13771713062�0023742�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package inspec import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Command *string `mapstructure-to-hcl2:"command" cty:"command" hcl:"command"` ExtraArguments []string `mapstructure:"extra_arguments" cty:"extra_arguments" hcl:"extra_arguments"` InspecEnvVars []string `mapstructure:"inspec_env_vars" cty:"inspec_env_vars" hcl:"inspec_env_vars"` Profile *string `mapstructure:"profile" cty:"profile" hcl:"profile"` AttributesDirectory *string `mapstructure:"attributes_directory" cty:"attributes_directory" hcl:"attributes_directory"` AttributesFiles []string `mapstructure:"attributes" cty:"attributes" hcl:"attributes"` Backend *string `mapstructure:"backend" cty:"backend" hcl:"backend"` User *string `mapstructure:"user" cty:"user" hcl:"user"` Host *string `mapstructure:"host" cty:"host" hcl:"host"` LocalPort *int `mapstructure:"local_port" cty:"local_port" hcl:"local_port"` SSHHostKeyFile *string `mapstructure:"ssh_host_key_file" cty:"ssh_host_key_file" hcl:"ssh_host_key_file"` SSHAuthorizedKeyFile *string `mapstructure:"ssh_authorized_key_file" cty:"ssh_authorized_key_file" hcl:"ssh_authorized_key_file"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "command": &hcldec.AttrSpec{Name: "command", Type: cty.String, Required: false}, "extra_arguments": &hcldec.AttrSpec{Name: "extra_arguments", Type: cty.List(cty.String), Required: false}, "inspec_env_vars": &hcldec.AttrSpec{Name: "inspec_env_vars", Type: cty.List(cty.String), Required: false}, "profile": &hcldec.AttrSpec{Name: "profile", Type: cty.String, Required: false}, "attributes_directory": &hcldec.AttrSpec{Name: "attributes_directory", Type: cty.String, Required: false}, "attributes": &hcldec.AttrSpec{Name: "attributes", Type: cty.List(cty.String), Required: false}, "backend": &hcldec.AttrSpec{Name: "backend", Type: cty.String, Required: false}, "user": &hcldec.AttrSpec{Name: "user", Type: cty.String, Required: false}, "host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false}, "local_port": &hcldec.AttrSpec{Name: "local_port", Type: cty.Number, Required: false}, "ssh_host_key_file": &hcldec.AttrSpec{Name: "ssh_host_key_file", Type: cty.String, Required: false}, "ssh_authorized_key_file": &hcldec.AttrSpec{Name: "ssh_authorized_key_file", Type: cty.String, Required: false}, } return s } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/provisioner_test.go���������������������������������������������0000664�0000000�0000000�00000015232�13771713062�0023273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package inspec import ( "crypto/rand" "fmt" "io" "io/ioutil" "os" "path" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) // Be sure to remove the InSpec stub file in each test with: // defer os.Remove(config["command"].(string)) func testConfig(t *testing.T) map[string]interface{} { m := make(map[string]interface{}) wd, err := os.Getwd() if err != nil { t.Fatalf("err: %s", err) } inspec_stub := path.Join(wd, "packer-inspec-stub.sh") err = ioutil.WriteFile(inspec_stub, []byte("#!/usr/bin/env bash\necho 2.2.16"), 0777) if err != nil { t.Fatalf("err: %s", err) } m["command"] = inspec_stub return m } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) err := p.Prepare(config) if err == nil { t.Fatalf("should have error") } hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) profile_file, err := ioutil.TempFile("", "test") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(profile_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() config["ssh_authorized_key_file"] = publickey_file.Name() config["profile"] = profile_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(profile_file.Name()) err = os.Unsetenv("USER") if err != nil { t.Fatalf("err: %s", err) } err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_ProfileFile(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() config["ssh_authorized_key_file"] = publickey_file.Name() err = p.Prepare(config) if err == nil { t.Fatal("should have error") } profile_file, err := ioutil.TempFile("", "test") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(profile_file.Name()) config["profile"] = profile_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } test_dir, err := ioutil.TempDir("", "test") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(test_dir) config["profile"] = test_dir err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_HostKeyFile(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) profile_file, err := ioutil.TempFile("", "test") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(profile_file.Name()) filename := make([]byte, 10) n, err := io.ReadFull(rand.Reader, filename) if n != len(filename) || err != nil { t.Fatal("could not create random file name") } config["ssh_host_key_file"] = fmt.Sprintf("%x", filename) config["ssh_authorized_key_file"] = publickey_file.Name() config["profile"] = profile_file.Name() err = p.Prepare(config) if err == nil { t.Fatal("should error if ssh_host_key_file does not exist") } hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_AuthorizedKeyFiles(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) profile_file, err := ioutil.TempFile("", "test") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(profile_file.Name()) filename := make([]byte, 10) n, err := io.ReadFull(rand.Reader, filename) if n != len(filename) || err != nil { t.Fatal("could not create random file name") } config["ssh_host_key_file"] = hostkey_file.Name() config["profile"] = profile_file.Name() config["ssh_authorized_key_file"] = fmt.Sprintf("%x", filename) err = p.Prepare(config) if err == nil { t.Errorf("should error if ssh_authorized_key_file does not exist") } publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) config["ssh_authorized_key_file"] = publickey_file.Name() err = p.Prepare(config) if err != nil { t.Errorf("err: %s", err) } } func TestProvisionerPrepare_LocalPort(t *testing.T) { var p Provisioner config := testConfig(t) defer os.Remove(config["command"].(string)) hostkey_file, err := ioutil.TempFile("", "hostkey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(hostkey_file.Name()) publickey_file, err := ioutil.TempFile("", "publickey") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(publickey_file.Name()) profile_file, err := ioutil.TempFile("", "test") if err != nil { t.Fatalf("err: %s", err) } defer os.Remove(profile_file.Name()) config["ssh_host_key_file"] = hostkey_file.Name() config["ssh_authorized_key_file"] = publickey_file.Name() config["profile"] = profile_file.Name() config["local_port"] = 65537 err = p.Prepare(config) if err == nil { t.Fatal("should have error") } config["local_port"] = 22222 err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestInspecGetVersion(t *testing.T) { if os.Getenv("PACKER_ACC") == "" { t.Skip("This test is only run with PACKER_ACC=1 and it requires InSpec to be installed") } var p Provisioner p.config.Command = "inspec exec" err := p.getVersion() if err != nil { t.Fatalf("err: %s", err) } } func TestInspecGetVersionError(t *testing.T) { var p Provisioner p.config.Command = "./test-fixtures/exit1" err := p.getVersion() if err == nil { t.Fatal("Should return error") } if !strings.Contains(err.Error(), "./test-fixtures/exit1 version") { t.Fatal("Error message should include command name") } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/test-fixtures/��������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022151�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/test-fixtures/exit1���������������������������������������������0000775�0000000�0000000�00000000022�13771713062�0023123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh exit 1 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/version/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021010�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/inspec/version/version.go����������������������������������������������0000664�0000000�0000000�00000000475�13771713062�0023032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var InspecPluginVersion *version.PluginVersion func init() { InspecPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020226�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/execution_policy.go�����������������������������������������0000664�0000000�0000000�00000002104�13771713062�0024134�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate enumer -transform snake -trimprefix ExecutionPolicy -type ExecutionPolicy package powershell import ( "reflect" "strconv" ) // ExecutionPolicy setting to run the command(s). // For the powershell provider the default has historically been to bypass. type ExecutionPolicy int const ( ExecutionPolicyBypass ExecutionPolicy = iota ExecutionPolicyAllsigned ExecutionPolicyDefault ExecutionPolicyRemotesigned ExecutionPolicyRestricted ExecutionPolicyUndefined ExecutionPolicyUnrestricted ExecutionPolicyNone // not set ) func StringToExecutionPolicyHook(f reflect.Kind, t reflect.Kind, data interface{}) (interface{}, error) { if f != reflect.String || t != reflect.Int { return data, nil } raw := data.(string) // It's possible that the thing being read is not supposed to be an // execution policy; if the string provided is actally an int, just return // the int. i, err := strconv.Atoi(raw) if err == nil { return i, nil } // If it can't just be cast to an int, try to parse string into an // execution policy. return ExecutionPolicyString(raw) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/execution_policy_test.go������������������������������������0000664�0000000�0000000�00000000701�13771713062�0025174�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package powershell import ( "testing" ) func TestExecutionPolicy_Decode(t *testing.T) { config := map[string]interface{}{ "inline": []interface{}{"foo", "bar"}, "execution_policy": "allsigned", } p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatal(err) } if p.config.ExecutionPolicy != ExecutionPolicyAllsigned { t.Fatalf("Expected AllSigned execution policy; got: %s", p.config.ExecutionPolicy) } } ���������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/executionpolicy_enumer.go�����������������������������������0000664�0000000�0000000�00000003277�13771713062�0025364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "enumer -transform snake -trimprefix ExecutionPolicy -type ExecutionPolicy"; DO NOT EDIT. // package powershell import ( "fmt" ) const _ExecutionPolicyName = "bypassallsigneddefaultremotesignedrestrictedundefinedunrestrictednone" var _ExecutionPolicyIndex = [...]uint8{0, 6, 15, 22, 34, 44, 53, 65, 69} func (i ExecutionPolicy) String() string { if i < 0 || i >= ExecutionPolicy(len(_ExecutionPolicyIndex)-1) { return fmt.Sprintf("ExecutionPolicy(%d)", i) } return _ExecutionPolicyName[_ExecutionPolicyIndex[i]:_ExecutionPolicyIndex[i+1]] } var _ExecutionPolicyValues = []ExecutionPolicy{0, 1, 2, 3, 4, 5, 6, 7} var _ExecutionPolicyNameToValueMap = map[string]ExecutionPolicy{ _ExecutionPolicyName[0:6]: 0, _ExecutionPolicyName[6:15]: 1, _ExecutionPolicyName[15:22]: 2, _ExecutionPolicyName[22:34]: 3, _ExecutionPolicyName[34:44]: 4, _ExecutionPolicyName[44:53]: 5, _ExecutionPolicyName[53:65]: 6, _ExecutionPolicyName[65:69]: 7, } // ExecutionPolicyString retrieves an enum value from the enum constants string name. // Throws an error if the param is not part of the enum. func ExecutionPolicyString(s string) (ExecutionPolicy, error) { if val, ok := _ExecutionPolicyNameToValueMap[s]; ok { return val, nil } return 0, fmt.Errorf("%s does not belong to ExecutionPolicy values", s) } // ExecutionPolicyValues returns all values of the enum func ExecutionPolicyValues() []ExecutionPolicy { return _ExecutionPolicyValues } // IsAExecutionPolicy returns "true" if the value is listed in the enum definition. "false" otherwise func (i ExecutionPolicy) IsAExecutionPolicy() bool { for _, v := range _ExecutionPolicyValues { if i == v { return true } } return false } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/provisioner.go����������������������������������������������0000664�0000000�0000000�00000042350�13771713062�0023140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that executes powershell // scripts within the remote machine. package powershell import ( "bufio" "context" "errors" "fmt" "log" "os" "path/filepath" "sort" "strings" "time" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/guestexec" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" "github.com/hashicorp/packer/packer-plugin-sdk/shell" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" "github.com/hashicorp/packer/packer-plugin-sdk/uuid" ) var retryableSleep = 2 * time.Second var psEscape = strings.NewReplacer( "$", "`$", "\"", "`\"", "`", "``", "'", "`'", ) type Config struct { shell.Provisioner `mapstructure:",squash"` shell.ProvisionerRemoteSpecific `mapstructure:",squash"` // The remote path where the file containing the environment variables // will be uploaded to. This should be set to a writable file that is in a // pre-existing directory. RemoteEnvVarPath string `mapstructure:"remote_env_var_path"` // The command used to execute the elevated script. The '{{ .Path }}' // variable should be used to specify where the script goes, {{ .Vars }} // can be used to inject the environment_vars into the environment. ElevatedExecuteCommand string `mapstructure:"elevated_execute_command"` // Whether to clean scripts up after executing the provisioner. // Defaults to false. When true any script created by a non-elevated Powershell // provisioner will be removed from the remote machine. Elevated scripts, // along with the scheduled tasks, will always be removed regardless of the // value set for `skip_clean`. SkipClean bool `mapstructure:"skip_clean"` // The timeout for retrying to start the process. Until this timeout is // reached, if the provisioner can't start a process, it retries. This // can be set high to allow for reboots. StartRetryTimeout time.Duration `mapstructure:"start_retry_timeout"` // This is used in the template generation to format environment variables // inside the `ElevatedExecuteCommand` template. ElevatedEnvVarFormat string `mapstructure:"elevated_env_var_format"` // Instructs the communicator to run the remote script as a Windows // scheduled task, effectively elevating the remote user by impersonating // a logged-in user ElevatedUser string `mapstructure:"elevated_user"` ElevatedPassword string `mapstructure:"elevated_password"` ExecutionPolicy ExecutionPolicy `mapstructure:"execution_policy"` remoteCleanUpScriptPath string // If set, sets PowerShell's [PSDebug mode](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-psdebug?view=powershell-7) // in order to make script debugging easier. For instance, setting the // value to 1 results in adding this to the execute command: // // ``` powershell // Set-PSDebug -Trace 1 // ``` DebugMode int `mapstructure:"debug_mode"` ctx interpolate.Context } type Provisioner struct { config Config communicator packersdk.Communicator generatedData map[string]interface{} } func (p *Provisioner) defaultExecuteCommand() string { baseCmd := `& { if (Test-Path variable:global:ProgressPreference)` + `{set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};` if p.config.DebugMode != 0 { baseCmd += fmt.Sprintf(`Set-PsDebug -Trace %d;`, p.config.DebugMode) } baseCmd += `. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }` if p.config.ExecutionPolicy == ExecutionPolicyNone { return baseCmd } return fmt.Sprintf(`powershell -executionpolicy %s "%s"`, p.config.ExecutionPolicy, baseCmd) } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "powershell", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", "elevated_execute_command", }, }, DecodeHooks: append(config.DefaultDecodeHookFuncs, StringToExecutionPolicyHook), }, raws...) if err != nil { return err } if p.config.EnvVarFormat == "" { p.config.EnvVarFormat = `$env:%s="%s"; ` } if p.config.ElevatedEnvVarFormat == "" { p.config.ElevatedEnvVarFormat = `$env:%s="%s"; ` } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = p.defaultExecuteCommand() } if p.config.ElevatedExecuteCommand == "" { p.config.ElevatedExecuteCommand = p.defaultExecuteCommand() } if p.config.Inline != nil && len(p.config.Inline) == 0 { p.config.Inline = nil } if p.config.StartRetryTimeout == 0 { p.config.StartRetryTimeout = 5 * time.Minute } if p.config.RemotePath == "" { uuid := uuid.TimeOrderedUUID() p.config.RemotePath = fmt.Sprintf(`c:/Windows/Temp/script-%s.ps1`, uuid) } if p.config.RemoteEnvVarPath == "" { uuid := uuid.TimeOrderedUUID() p.config.RemoteEnvVarPath = fmt.Sprintf(`c:/Windows/Temp/packer-ps-env-vars-%s.ps1`, uuid) } if p.config.Scripts == nil { p.config.Scripts = make([]string, 0) } if p.config.Vars == nil { p.config.Vars = make([]string, 0) } p.config.remoteCleanUpScriptPath = fmt.Sprintf(`c:/Windows/Temp/packer-cleanup-%s.ps1`, uuid.TimeOrderedUUID()) var errs error if p.config.Script != "" && len(p.config.Scripts) > 0 { errs = packersdk.MultiErrorAppend(errs, errors.New("Only one of script or scripts can be specified.")) } if p.config.ElevatedUser == "" && p.config.ElevatedPassword != "" { errs = packersdk.MultiErrorAppend(errs, errors.New("Must supply an 'elevated_user' if 'elevated_password' provided")) } if p.config.Script != "" { p.config.Scripts = []string{p.config.Script} } if len(p.config.Scripts) == 0 && p.config.Inline == nil { errs = packersdk.MultiErrorAppend(errs, errors.New("Either a script file or inline script must be specified.")) } else if len(p.config.Scripts) > 0 && p.config.Inline != nil { errs = packersdk.MultiErrorAppend(errs, errors.New("Only a script file or an inline script can be specified, not both.")) } for _, path := range p.config.Scripts { if _, err := os.Stat(path); err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Bad script '%s': %s", path, err)) } } // Do a check for bad environment variables, such as '=foo', 'foobar' for _, kv := range p.config.Vars { vs := strings.SplitN(kv, "=", 2) if len(vs) != 2 || vs[0] == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Environment variable not in format 'key=value': %s", kv)) } } if p.config.ExecutionPolicy > 7 { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf(`Invalid execution `+ `policy provided. Please supply one of: "bypass", "allsigned",`+ ` "default", "remotesigned", "restricted", "undefined", `+ `"unrestricted", "none".`)) } if !(p.config.DebugMode >= 0 && p.config.DebugMode <= 2) { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("%d is an invalid Trace level for `debug_mode`; valid values are 0, 1, and 2", p.config.DebugMode)) } if errs != nil { return errs } return nil } // Takes the inline scripts, concatenates them into a temporary file and // returns a string containing the location of said file. func extractScript(p *Provisioner) (string, error) { temp, err := tmp.File("powershell-provisioner") if err != nil { return "", err } defer temp.Close() writer := bufio.NewWriter(temp) for _, command := range p.config.Inline { log.Printf("Found command: %s", command) if _, err := writer.WriteString(command + "\n"); err != nil { return "", fmt.Errorf("Error preparing powershell script: %s", err) } } if err := writer.Flush(); err != nil { return "", fmt.Errorf("Error preparing powershell script: %s", err) } return temp.Name(), nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ui.Say(fmt.Sprintf("Provisioning with Powershell...")) p.communicator = comm p.generatedData = generatedData scripts := make([]string, len(p.config.Scripts)) copy(scripts, p.config.Scripts) if p.config.Inline != nil { temp, err := extractScript(p) if err != nil { ui.Error(fmt.Sprintf("Unable to extract inline scripts into a file: %s", err)) } scripts = append(scripts, temp) // Remove temp script containing the inline commands when done defer os.Remove(temp) } // every provisioner run will only have one env var script file so lets add it first uploadedScripts := []string{p.config.RemoteEnvVarPath} for _, path := range scripts { ui.Say(fmt.Sprintf("Provisioning with powershell script: %s", path)) log.Printf("Opening %s for reading", path) fi, err := os.Stat(path) if err != nil { return fmt.Errorf("Error stating powershell script: %s", err) } if strings.HasSuffix(p.config.RemotePath, `\`) { // path is a directory p.config.RemotePath += filepath.Base((fi).Name()) } f, err := os.Open(path) if err != nil { return fmt.Errorf("Error opening powershell script: %s", err) } defer f.Close() command, err := p.createCommandText() if err != nil { return fmt.Errorf("Error processing command: %s", err) } // Upload the file and run the command. Do this in the context of a // single retryable function so that we don't end up with the case // that the upload succeeded, a restart is initiated, and then the // command is executed but the file doesn't exist any longer. var cmd *packersdk.RemoteCmd err = retry.Config{StartTimeout: p.config.StartRetryTimeout}.Run(ctx, func(ctx context.Context) error { if _, err := f.Seek(0, 0); err != nil { return err } if err := comm.Upload(p.config.RemotePath, f, &fi); err != nil { return fmt.Errorf("Error uploading script: %s", err) } cmd = &packersdk.RemoteCmd{Command: command} return cmd.RunWithUi(ctx, comm, ui) }) if err != nil { return err } // Close the original file since we copied it f.Close() // Record every other uploaded script file so we can clean it up later uploadedScripts = append(uploadedScripts, p.config.RemotePath) log.Printf("%s returned with exit code %d", p.config.RemotePath, cmd.ExitStatus()) if err := p.config.ValidExitCode(cmd.ExitStatus()); err != nil { return err } } if p.config.SkipClean { return nil } err := retry.Config{StartTimeout: time.Minute, RetryDelay: func() time.Duration { return 10 * time.Second }}.Run(ctx, func(ctx context.Context) error { command, err := p.createRemoteCleanUpCommand(uploadedScripts) if err != nil { log.Printf("failed to upload the remote cleanup script: %q", err) return err } cmd := &packersdk.RemoteCmd{Command: command} return cmd.RunWithUi(ctx, comm, ui) }) if err != nil { log.Printf("remote cleanup script failed to upload; skipping the removal of temporary files: %s; ", strings.Join(uploadedScripts, ",")) } return nil } // createRemoteCleanUpCommand will generated a powershell script that will remove remote files; // returning a command that can be executed remotely to do the cleanup. func (p *Provisioner) createRemoteCleanUpCommand(remoteFiles []string) (string, error) { if len(remoteFiles) == 0 { return "", fmt.Errorf("no remoteFiles provided for cleanup") } var b strings.Builder // This script should self destruct. remotePath := p.config.remoteCleanUpScriptPath remoteFiles = append(remoteFiles, remotePath) for _, filename := range remoteFiles { fmt.Fprintf(&b, "if (Test-Path %[1]s) {Remove-Item %[1]s}\n", filename) } if err := p.communicator.Upload(remotePath, strings.NewReader(b.String()), nil); err != nil { return "", fmt.Errorf("clean up script %q failed to upload: %s", remotePath, err) } data := p.generatedData data["Path"] = remotePath data["Vars"] = p.config.RemoteEnvVarPath p.config.ctx.Data = data p.config.ctx.Data = data return interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) } // Environment variables required within the remote environment are uploaded // within a PS script and then enabled by 'dot sourcing' the script // immediately prior to execution of the main command func (p *Provisioner) prepareEnvVars(elevated bool) (err error) { // Collate all required env vars into a plain string with required // formatting applied flattenedEnvVars := p.createFlattenedEnvVars(elevated) // Create a powershell script on the target build fs containing the // flattened env vars err = p.uploadEnvVars(flattenedEnvVars) if err != nil { return err } return } func (p *Provisioner) createFlattenedEnvVars(elevated bool) (flattened string) { flattened = "" envVars := make(map[string]string) // Always available Packer provided env vars envVars["PACKER_BUILD_NAME"] = p.config.PackerBuildName envVars["PACKER_BUILDER_TYPE"] = p.config.PackerBuilderType // expose ip address variables httpAddr := p.generatedData["PackerHTTPAddr"] if httpAddr != nil && httpAddr != commonsteps.HttpAddrNotImplemented { envVars["PACKER_HTTP_ADDR"] = httpAddr.(string) } httpIP := p.generatedData["PackerHTTPIP"] if httpIP != nil && httpIP != commonsteps.HttpIPNotImplemented { envVars["PACKER_HTTP_IP"] = httpIP.(string) } httpPort := p.generatedData["PackerHTTPPort"] if httpPort != nil && httpPort != commonsteps.HttpPortNotImplemented { envVars["PACKER_HTTP_PORT"] = httpPort.(string) } // interpolate environment variables p.config.ctx.Data = p.generatedData // Split vars into key/value components for _, envVar := range p.config.Vars { envVar, err := interpolate.Render(envVar, &p.config.ctx) if err != nil { return } keyValue := strings.SplitN(envVar, "=", 2) // Escape chars special to PS in each env var value escapedEnvVarValue := psEscape.Replace(keyValue[1]) if escapedEnvVarValue != keyValue[1] { log.Printf("Env var %s converted to %s after escaping chars special to PS", keyValue[1], escapedEnvVarValue) } envVars[keyValue[0]] = escapedEnvVarValue } // Create a list of env var keys in sorted order var keys []string for k := range envVars { keys = append(keys, k) } sort.Strings(keys) format := p.config.EnvVarFormat if elevated { format = p.config.ElevatedEnvVarFormat } // Re-assemble vars using OS specific format pattern and flatten for _, key := range keys { flattened += fmt.Sprintf(format, key, envVars[key]) } return } func (p *Provisioner) uploadEnvVars(flattenedEnvVars string) (err error) { ctx := context.TODO() // Upload all env vars to a powershell script on the target build file // system. Do this in the context of a single retryable function so that // we gracefully handle any errors created by transient conditions such as // a system restart envVarReader := strings.NewReader(flattenedEnvVars) log.Printf("Uploading env vars to %s", p.config.RemoteEnvVarPath) err = retry.Config{StartTimeout: p.config.StartRetryTimeout}.Run(ctx, func(context.Context) error { if err := p.communicator.Upload(p.config.RemoteEnvVarPath, envVarReader, nil); err != nil { return fmt.Errorf("Error uploading ps script containing env vars: %s", err) } return err }) return } func (p *Provisioner) createCommandText() (command string, err error) { // Return the interpolated command if p.config.ElevatedUser == "" { return p.createCommandTextNonPrivileged() } else { return p.createCommandTextPrivileged() } } func (p *Provisioner) createCommandTextNonPrivileged() (command string, err error) { // Prepare everything needed to enable the required env vars within the // remote environment err = p.prepareEnvVars(false) if err != nil { return "", err } ctxData := p.generatedData ctxData["Path"] = p.config.RemotePath ctxData["Vars"] = p.config.RemoteEnvVarPath p.config.ctx.Data = ctxData command, err = interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return "", fmt.Errorf("Error processing command: %s", err) } // Return the interpolated command return command, nil } func (p *Provisioner) createCommandTextPrivileged() (command string, err error) { // Prepare everything needed to enable the required env vars within the // remote environment err = p.prepareEnvVars(true) if err != nil { return "", err } ctxData := p.generatedData ctxData["Path"] = p.config.RemotePath ctxData["Vars"] = p.config.RemoteEnvVarPath p.config.ctx.Data = ctxData command, err = interpolate.Render(p.config.ElevatedExecuteCommand, &p.config.ctx) if err != nil { return "", fmt.Errorf("Error processing command: %s", err) } command, err = guestexec.GenerateElevatedRunner(command, p) if err != nil { return "", fmt.Errorf("Error generating elevated runner: %s", err) } return command, err } func (p *Provisioner) Communicator() packersdk.Communicator { return p.communicator } func (p *Provisioner) ElevatedUser() string { return p.config.ElevatedUser } func (p *Provisioner) ElevatedPassword() string { // Replace ElevatedPassword for winrm users who used this feature p.config.ctx.Data = p.generatedData elevatedPassword, _ := interpolate.Render(p.config.ElevatedPassword, &p.config.ctx) return elevatedPassword } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/provisioner.hcl2spec.go�������������������������������������0000664�0000000�0000000�00000015257�13771713062�0024650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package powershell import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Inline []string `cty:"inline" hcl:"inline"` Script *string `cty:"script" hcl:"script"` Scripts []string `cty:"scripts" hcl:"scripts"` ValidExitCodes []int `mapstructure:"valid_exit_codes" cty:"valid_exit_codes" hcl:"valid_exit_codes"` Vars []string `mapstructure:"environment_vars" cty:"environment_vars" hcl:"environment_vars"` EnvVarFormat *string `mapstructure:"env_var_format" cty:"env_var_format" hcl:"env_var_format"` Binary *bool `cty:"binary" hcl:"binary"` RemotePath *string `mapstructure:"remote_path" cty:"remote_path" hcl:"remote_path"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` RemoteEnvVarPath *string `mapstructure:"remote_env_var_path" cty:"remote_env_var_path" hcl:"remote_env_var_path"` ElevatedExecuteCommand *string `mapstructure:"elevated_execute_command" cty:"elevated_execute_command" hcl:"elevated_execute_command"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"` StartRetryTimeout *string `mapstructure:"start_retry_timeout" cty:"start_retry_timeout" hcl:"start_retry_timeout"` ElevatedEnvVarFormat *string `mapstructure:"elevated_env_var_format" cty:"elevated_env_var_format" hcl:"elevated_env_var_format"` ElevatedUser *string `mapstructure:"elevated_user" cty:"elevated_user" hcl:"elevated_user"` ElevatedPassword *string `mapstructure:"elevated_password" cty:"elevated_password" hcl:"elevated_password"` ExecutionPolicy *string `mapstructure:"execution_policy" cty:"execution_policy" hcl:"execution_policy"` DebugMode *int `mapstructure:"debug_mode" cty:"debug_mode" hcl:"debug_mode"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "inline": &hcldec.AttrSpec{Name: "inline", Type: cty.List(cty.String), Required: false}, "script": &hcldec.AttrSpec{Name: "script", Type: cty.String, Required: false}, "scripts": &hcldec.AttrSpec{Name: "scripts", Type: cty.List(cty.String), Required: false}, "valid_exit_codes": &hcldec.AttrSpec{Name: "valid_exit_codes", Type: cty.List(cty.Number), Required: false}, "environment_vars": &hcldec.AttrSpec{Name: "environment_vars", Type: cty.List(cty.String), Required: false}, "env_var_format": &hcldec.AttrSpec{Name: "env_var_format", Type: cty.String, Required: false}, "binary": &hcldec.AttrSpec{Name: "binary", Type: cty.Bool, Required: false}, "remote_path": &hcldec.AttrSpec{Name: "remote_path", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "remote_env_var_path": &hcldec.AttrSpec{Name: "remote_env_var_path", Type: cty.String, Required: false}, "elevated_execute_command": &hcldec.AttrSpec{Name: "elevated_execute_command", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "start_retry_timeout": &hcldec.AttrSpec{Name: "start_retry_timeout", Type: cty.String, Required: false}, "elevated_env_var_format": &hcldec.AttrSpec{Name: "elevated_env_var_format", Type: cty.String, Required: false}, "elevated_user": &hcldec.AttrSpec{Name: "elevated_user", Type: cty.String, Required: false}, "elevated_password": &hcldec.AttrSpec{Name: "elevated_password", Type: cty.String, Required: false}, "execution_policy": &hcldec.AttrSpec{Name: "execution_policy", Type: cty.String, Required: false}, "debug_mode": &hcldec.AttrSpec{Name: "debug_mode", Type: cty.Number, Required: false}, } return s } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/provisioner_acc_test.go�������������������������������������0000664�0000000�0000000�00000006130�13771713062�0025001�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package powershell_test import ( "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/provisioneracc" ) const TestProvisionerType = "powershell" func powershellIsCompatible(builder string, vmOS string) bool { return vmOS == "windows" } func fixtureDir() string { _, file, _, _ := runtime.Caller(0) return filepath.Join(filepath.Dir(file), "test-fixtures") } func LoadProvisionerFragment(templateFragmentPath string) (string, error) { dir := fixtureDir() fragmentAbsPath := filepath.Join(dir, templateFragmentPath) fragmentFile, err := os.Open(fragmentAbsPath) if err != nil { return "", fmt.Errorf("Unable find %s", fragmentAbsPath) } defer fragmentFile.Close() fragmentString, err := ioutil.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } return string(fragmentString), nil } func TestAccPowershellProvisioner_basic(t *testing.T) { templateString, err := LoadProvisionerFragment("powershell-provisioner-cleanup.txt") if err != nil { t.Fatalf("Couldn't load test fixture; %s", err.Error()) } testCase := &provisioneracc.ProvisionerTestCase{ IsCompatible: powershellIsCompatible, Name: "powershell-provisioner-cleanup", Template: templateString, Type: TestProvisionerType, Check: func(buildcommand *exec.Cmd, logfile string) error { if buildcommand.ProcessState != nil { if buildcommand.ProcessState.ExitCode() != 0 { return fmt.Errorf("Bad exit code. Logfile: %s", logfile) } } return nil }, } provisioneracc.TestProvisionersAgainstBuilders(testCase, t) } func TestAccPowershellProvisioner_Inline(t *testing.T) { templateString, err := LoadProvisionerFragment("powershell-inline-provisioner.txt") if err != nil { t.Fatalf("Couldn't load test fixture; %s", err.Error()) } testCase := &provisioneracc.ProvisionerTestCase{ IsCompatible: powershellIsCompatible, Name: "powershell-provisioner-inline", Template: templateString, Type: TestProvisionerType, Check: func(buildcommand *exec.Cmd, logfile string) error { if buildcommand.ProcessState != nil { if buildcommand.ProcessState.ExitCode() != 0 { return fmt.Errorf("Bad exit code. Logfile: %s", logfile) } } return nil }, } provisioneracc.TestProvisionersAgainstBuilders(testCase, t) } func TestAccPowershellProvisioner_Script(t *testing.T) { templateString, err := LoadProvisionerFragment("powershell-script-provisioner.txt") if err != nil { t.Fatalf("Couldn't load test fixture; %s", err.Error()) } testCase := &provisioneracc.ProvisionerTestCase{ IsCompatible: powershellIsCompatible, Name: "powershell-provisioner-script", Template: templateString, Type: TestProvisionerType, Check: func(buildcommand *exec.Cmd, logfile string) error { if buildcommand.ProcessState != nil { if buildcommand.ProcessState.ExitCode() != 0 { return fmt.Errorf("Bad exit code. Logfile: %s", logfile) } } return nil }, } provisioneracc.TestProvisionersAgainstBuilders(testCase, t) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/provisioner_test.go�����������������������������������������0000664�0000000�0000000�00000065400�13771713062�0024200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package powershell import ( "bytes" "context" "fmt" "io/ioutil" "os" "regexp" "strings" "testing" "time" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/stretchr/testify/assert" ) func TestProvisionerPrepare_extractScript(t *testing.T) { config := testConfig() p := new(Provisioner) _ = p.Prepare(config) file, err := extractScript(p) defer os.Remove(file) if err != nil { t.Fatalf("Should not be error: %s", err) } t.Logf("File: %s", file) if strings.Index(file, os.TempDir()) != 0 { t.Fatalf("Temp file should reside in %s. File location: %s", os.TempDir(), file) } // File contents should contain 2 lines concatenated by newlines: foo\nbar readFile, err := ioutil.ReadFile(file) expectedContents := "foo\nbar\n" if err != nil { t.Fatalf("Should not be error: %s", err) } s := string(readFile[:]) if s != expectedContents { t.Fatalf("Expected generated inlineScript to equal '%s', got '%s'", expectedContents, s) } } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } matched, _ := regexp.MatchString("c:/Windows/Temp/script-.*.ps1", p.config.RemotePath) if !matched { t.Errorf("unexpected remote path: %s", p.config.RemotePath) } if p.config.ElevatedUser != "" { t.Error("expected elevated_user to be empty") } if p.config.ElevatedPassword != "" { t.Error("expected elevated_password to be empty") } if p.config.ExecuteCommand != `powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }"` { t.Fatalf(`Default command should be 'powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }"', but got '%s'`, p.config.ExecuteCommand) } if p.config.ElevatedExecuteCommand != `powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }"` { t.Fatalf(`Default command should be 'powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }"', but got '%s'`, p.config.ElevatedExecuteCommand) } if p.config.ElevatedEnvVarFormat != `$env:%s="%s"; ` { t.Fatalf(`Default command should be powershell '$env:%%s="%%s"; ', but got %s`, p.config.ElevatedEnvVarFormat) } } func TestProvisionerPrepare_Config(t *testing.T) { config := testConfig() config["elevated_user"] = "{{user `user`}}" config["elevated_password"] = "{{user `password`}}" config[common.UserVariablesConfigKey] = map[string]string{ "user": "myusername", "password": "mypassword", } var p Provisioner err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ElevatedUser != "myusername" { t.Fatalf("Expected 'myusername' for key `elevated_user`: %s", p.config.ElevatedUser) } if p.config.ElevatedPassword != "mypassword" { t.Fatalf("Expected 'mypassword' for key `elevated_password`: %s", p.config.ElevatedPassword) } } func TestProvisionerPrepare_DebugMode(t *testing.T) { config := testConfig() config["debug_mode"] = 1 var p Provisioner err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } command := `powershell -executionpolicy bypass "& { if (Test-Path variable:global:ProgressPreference){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};Set-PsDebug -Trace 1;. {{.Vars}}; &'{{.Path}}'; exit $LastExitCode }"` if p.config.ExecuteCommand != command { t.Fatalf(fmt.Sprintf(`Expected command should be '%s' but got '%s'`, command, p.config.ExecuteCommand)) } } func TestProvisionerPrepare_InvalidDebugMode(t *testing.T) { config := testConfig() config["debug_mode"] = -1 var p Provisioner err := p.Prepare(config) if err == nil { t.Fatalf("should have error") } message := "invalid Trace level for `debug_mode`; valid values are 0, 1, and 2" if !strings.Contains(err.Error(), message) { t.Fatalf("expected Prepare() error %q to contain %q", err.Error(), message) } } func TestProvisionerPrepare_InvalidKey(t *testing.T) { var p Provisioner config := testConfig() // Add a random key config["i_should_not_be_valid"] = true err := p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_Elevated(t *testing.T) { var p Provisioner config := testConfig() // Add a random key config["elevated_user"] = "vagrant" err := p.Prepare(config) if err != nil { t.Fatal("should not have error") } config["elevated_password"] = "vagrant" err = p.Prepare(config) if err != nil { t.Fatal("should not have error") } } func TestProvisionerPrepare_Script(t *testing.T) { config := testConfig() delete(config, "inline") config["script"] = "/this/should/not/exist" p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["script"] = tf.Name() p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { var p Provisioner config := testConfig() delete(config, "inline") delete(config, "script") err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["inline"] = []interface{}{"foo"} config["script"] = tf.Name() err = p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { var p Provisioner config := testConfig() // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["inline"] = []interface{}{"foo"} config["scripts"] = []string{tf.Name()} err = p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_Scripts(t *testing.T) { config := testConfig() delete(config, "inline") config["scripts"] = []string{} p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["scripts"] = []string{tf.Name()} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerPrepare_EnvironmentVars(t *testing.T) { config := testConfig() // Test with a bad case config["environment_vars"] = []string{"badvar", "good=var"} p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a trickier case config["environment_vars"] = []string{"=bad"} p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good case // Note: baz= is a real env variable, just empty config["environment_vars"] = []string{"FOO=bar", "baz="} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value contains an equals sign config["environment_vars"] = []string{"good=withequals=true"} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value starts with an equals sign config["environment_vars"] = []string{"good==true"} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerQuote_EnvironmentVars(t *testing.T) { config := testConfig() config["environment_vars"] = []string{ "keyone=valueone", "keytwo=value\ntwo", "keythree='valuethree'", "keyfour='value\nfour'", "keyfive='value=five'", "keysix='=six'", } expected := []string{ "keyone=valueone", "keytwo=value\ntwo", "keythree='valuethree'", "keyfour='value\nfour'", "keyfive='value=five'", "keysix='=six'", } p := new(Provisioner) p.Prepare(config) for i, expectedValue := range expected { if p.config.Vars[i] != expectedValue { t.Fatalf("%s should be equal to %s", p.config.Vars[i], expectedValue) } } } func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), ErrorWriter: new(bytes.Buffer), } } func TestProvisionerProvision_ValidExitCodes(t *testing.T) { config := testConfig() delete(config, "inline") // Defaults provided by Packer config["remote_path"] = "c:/Windows/Temp/inlineScript.ps1" config["inline"] = []string{"whoami"} ui := testUi() p := new(Provisioner) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" p.config.ValidExitCodes = []int{0, 200} comm := new(packersdk.MockCommunicator) comm.StartExitStatus = 200 p.Prepare(config) err := p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } } func TestProvisionerProvision_InvalidExitCodes(t *testing.T) { config := testConfig() delete(config, "inline") // Defaults provided by Packer config["remote_path"] = "c:/Windows/Temp/inlineScript.ps1" config["inline"] = []string{"whoami"} ui := testUi() p := new(Provisioner) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" p.config.ValidExitCodes = []int{0, 200} comm := new(packersdk.MockCommunicator) comm.StartExitStatus = 201 // Invalid! p.Prepare(config) err := p.Provision(context.Background(), ui, comm, generatedData()) if err == nil { t.Fatal("should have error") } } func TestProvisionerProvision_Inline(t *testing.T) { // skip_clean is set to true otherwise the last command executed by the provisioner is the cleanup. config := testConfigWithSkipClean() delete(config, "inline") // Defaults provided by Packer config["remote_path"] = "c:/Windows/Temp/inlineScript.ps1" config["inline"] = []string{"whoami"} ui := testUi() p := new(Provisioner) // Defaults provided by Packer - env vars should not appear in cmd p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" comm := new(packersdk.MockCommunicator) _ = p.Prepare(config) err := p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } cmd := comm.StartCmd.Command re := regexp.MustCompile(`powershell -executionpolicy bypass "& { if \(Test-Path variable:global:ProgressPreference\){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};\. c:/Windows/Temp/packer-ps-env-vars-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1; &'c:/Windows/Temp/inlineScript.ps1'; exit \$LastExitCode }"`) matched := re.MatchString(cmd) if !matched { t.Fatalf("Got unexpected command: %s", cmd) } // User supplied env vars should not change things envVars := make([]string, 2) envVars[0] = "FOO=BAR" envVars[1] = "BAR=BAZ" config["environment_vars"] = envVars config["remote_path"] = "c:/Windows/Temp/inlineScript.ps1" p.Prepare(config) err = p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } cmd = comm.StartCmd.Command re = regexp.MustCompile(`powershell -executionpolicy bypass "& { if \(Test-Path variable:global:ProgressPreference\){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};\. c:/Windows/Temp/packer-ps-env-vars-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1; &'c:/Windows/Temp/inlineScript.ps1'; exit \$LastExitCode }"`) matched = re.MatchString(cmd) if !matched { t.Fatalf("Got unexpected command: %s", cmd) } } func TestProvisionerProvision_Scripts(t *testing.T) { tempFile, _ := ioutil.TempFile("", "packer") defer os.Remove(tempFile.Name()) defer tempFile.Close() // skip_clean is set to true otherwise the last command executed by the provisioner is the cleanup. config := testConfigWithSkipClean() delete(config, "inline") config["scripts"] = []string{tempFile.Name()} config["packer_build_name"] = "foobuild" config["packer_builder_type"] = "footype" config["remote_path"] = "c:/Windows/Temp/script.ps1" ui := testUi() p := new(Provisioner) comm := new(packersdk.MockCommunicator) p.Prepare(config) err := p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } cmd := comm.StartCmd.Command re := regexp.MustCompile(`powershell -executionpolicy bypass "& { if \(Test-Path variable:global:ProgressPreference\){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};\. c:/Windows/Temp/packer-ps-env-vars-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1; &'c:/Windows/Temp/script.ps1'; exit \$LastExitCode }"`) matched := re.MatchString(cmd) if !matched { t.Fatalf("Got unexpected command: %s", cmd) } } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { tempFile, _ := ioutil.TempFile("", "packer") ui := testUi() defer os.Remove(tempFile.Name()) defer tempFile.Close() // skip_clean is set to true otherwise the last command executed by the provisioner is the cleanup. config := testConfigWithSkipClean() delete(config, "inline") config["scripts"] = []string{tempFile.Name()} config["packer_build_name"] = "foobuild" config["packer_builder_type"] = "footype" // Env vars - currently should not effect them envVars := make([]string, 2) envVars[0] = "FOO=BAR" envVars[1] = "BAR=BAZ" config["environment_vars"] = envVars config["remote_path"] = "c:/Windows/Temp/script.ps1" p := new(Provisioner) comm := new(packersdk.MockCommunicator) p.Prepare(config) err := p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } cmd := comm.StartCmd.Command re := regexp.MustCompile(`powershell -executionpolicy bypass "& { if \(Test-Path variable:global:ProgressPreference\){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};\. c:/Windows/Temp/packer-ps-env-vars-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1; &'c:/Windows/Temp/script.ps1'; exit \$LastExitCode }"`) matched := re.MatchString(cmd) if !matched { t.Fatalf("Got unexpected command: %s", cmd) } } func TestProvisionerProvision_SkipClean(t *testing.T) { tempFile, _ := ioutil.TempFile("", "packer") defer func() { tempFile.Close() os.Remove(tempFile.Name()) }() config := map[string]interface{}{ "scripts": []string{tempFile.Name()}, "remote_path": "c:/Windows/Temp/script.ps1", } tt := []struct { SkipClean bool LastExecutedCommandRegex string }{ { SkipClean: true, LastExecutedCommandRegex: `powershell -executionpolicy bypass "& { if \(Test-Path variable:global:ProgressPreference\){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};\. c:/Windows/Temp/packer-ps-env-vars-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1; &'c:/Windows/Temp/script.ps1'; exit \$LastExitCode }"`, }, { SkipClean: false, LastExecutedCommandRegex: `powershell -executionpolicy bypass "& { if \(Test-Path variable:global:ProgressPreference\){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};\. c:/Windows/Temp/packer-ps-env-vars-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1; &'c:/Windows/Temp/packer-cleanup-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1'; exit \$LastExitCode }"`, }, } for _, tc := range tt { tc := tc p := new(Provisioner) ui := testUi() comm := new(packersdk.MockCommunicator) config["skip_clean"] = tc.SkipClean if err := p.Prepare(config); err != nil { t.Fatalf("failed to prepare config when SkipClean is %t: %s", tc.SkipClean, err) } err := p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } // When SkipClean is false the last executed command should be the clean up command; // otherwise it will be the execution command for the provisioning script. cmd := comm.StartCmd.Command re := regexp.MustCompile(tc.LastExecutedCommandRegex) matched := re.MatchString(cmd) if !matched { t.Fatalf(`Got unexpected command when SkipClean is %t: %s`, tc.SkipClean, cmd) } } } func TestProvisionerProvision_UploadFails(t *testing.T) { config := testConfig() ui := testUi() p := new(Provisioner) comm := new(packersdk.ScriptUploadErrorMockCommunicator) p.Prepare(config) p.config.StartRetryTimeout = 1 * time.Second err := p.Provision(context.Background(), ui, comm, generatedData()) if !strings.Contains(err.Error(), packersdk.ScriptUploadErrorMockCommunicatorError.Error()) { t.Fatalf("expected Provision() error %q to contain %q", err.Error(), packersdk.ScriptUploadErrorMockCommunicatorError.Error()) } } func TestProvisioner_createFlattenedElevatedEnvVars_windows(t *testing.T) { var flattenedEnvVars string config := testConfig() userEnvVarTests := [][]string{ {}, // No user env var {"FOO=bar"}, // Single user env var {"FOO=bar", "BAZ=qux"}, // Multiple user env vars {"FOO=bar=baz"}, // User env var with value containing equals {"FOO==bar"}, // User env var with value starting with equals // Test escaping of characters special to PowerShell {"FOO=bar$baz"}, // User env var with value containing dollar {"FOO=bar\"baz"}, // User env var with value containing a double quote {"FOO=bar'baz"}, // User env var with value containing a single quote {"FOO=bar`baz"}, // User env var with value containing a backtick } expected := []string{ `$env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:FOO="bar"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:BAZ="qux"; $env:FOO="bar"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:FOO="bar=baz"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:FOO="=bar"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, "$env:FOO=\"bar`$baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", "$env:FOO=\"bar`\"baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", "$env:FOO=\"bar`'baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", "$env:FOO=\"bar``baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", } p := new(Provisioner) p.generatedData = generatedData() p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" for i, expectedValue := range expected { p.config.Vars = userEnvVarTests[i] flattenedEnvVars = p.createFlattenedEnvVars(true) if flattenedEnvVars != expectedValue { t.Fatalf("expected flattened env vars to be: %s, got %s.", expectedValue, flattenedEnvVars) } } } func TestProvisionerCorrectlyInterpolatesValidExitCodes(t *testing.T) { type testCases struct { Input interface{} Expected []int } validExitCodeTests := []testCases{ {"0", []int{0}}, {[]string{"0"}, []int{0}}, {[]int{0, 12345}, []int{0, 12345}}, {[]string{"0", "12345"}, []int{0, 12345}}, {"0,12345", []int{0, 12345}}, } for _, tc := range validExitCodeTests { p := new(Provisioner) config := testConfig() config["valid_exit_codes"] = tc.Input err := p.Prepare(config) if err != nil { t.Fatalf("Shouldn't have had error interpolating exit codes") } assert.ElementsMatchf(t, p.config.ValidExitCodes, tc.Expected, fmt.Sprintf("expected exit codes to be: %#v, got %#v.", p.config.ValidExitCodes, tc.Expected)) } } func TestProvisionerCorrectlyInterpolatesExecutionPolicy(t *testing.T) { type testCases struct { Input interface{} Expected ExecutionPolicy ErrExpected bool } tests := []testCases{ { Input: "bypass", Expected: ExecutionPolicy(0), ErrExpected: false, }, { Input: "allsigned", Expected: ExecutionPolicy(1), ErrExpected: false, }, { Input: "default", Expected: ExecutionPolicy(2), ErrExpected: false, }, { Input: "remotesigned", Expected: ExecutionPolicy(3), ErrExpected: false, }, { Input: "restricted", Expected: ExecutionPolicy(4), ErrExpected: false, }, { Input: "undefined", Expected: ExecutionPolicy(5), ErrExpected: false, }, { Input: "unrestricted", Expected: ExecutionPolicy(6), ErrExpected: false, }, { Input: "none", Expected: ExecutionPolicy(7), ErrExpected: false, }, { Input: "0", // User can supply a valid number for policy, too Expected: 0, ErrExpected: false, }, { Input: "invalid", Expected: 0, ErrExpected: true, }, { Input: "100", // If number is invalid policy, reject. Expected: 100, ErrExpected: true, }, } for _, tc := range tests { p := new(Provisioner) config := testConfig() config["execution_policy"] = tc.Input err := p.Prepare(config) if (err != nil) != tc.ErrExpected { t.Fatalf("Either err was expected, or shouldn't have happened: %#v", tc) } if err == nil { assert.Equal(t, p.config.ExecutionPolicy, tc.Expected, fmt.Sprintf("expected %#v, got %#v.", p.config.ExecutionPolicy, tc.Expected)) } } } func TestProvisioner_createFlattenedEnvVars_windows(t *testing.T) { var flattenedEnvVars string config := testConfig() userEnvVarTests := [][]string{ {}, // No user env var {"FOO=bar"}, // Single user env var {"FOO=bar", "BAZ=qux"}, // Multiple user env vars {"FOO=bar=baz"}, // User env var with value containing equals {"FOO==bar"}, // User env var with value starting with equals // Test escaping of characters special to PowerShell {"FOO=bar$baz"}, // User env var with value containing dollar {"FOO=bar\"baz"}, // User env var with value containing a double quote {"FOO=bar'baz"}, // User env var with value containing a single quote {"FOO=bar`baz"}, // User env var with value containing a backtick } expected := []string{ `$env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:FOO="bar"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:BAZ="qux"; $env:FOO="bar"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:FOO="bar=baz"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, `$env:FOO="=bar"; $env:PACKER_BUILDER_TYPE="iso"; $env:PACKER_BUILD_NAME="vmware"; `, "$env:FOO=\"bar`$baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", "$env:FOO=\"bar`\"baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", "$env:FOO=\"bar`'baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", "$env:FOO=\"bar``baz\"; $env:PACKER_BUILDER_TYPE=\"iso\"; $env:PACKER_BUILD_NAME=\"vmware\"; ", } p := new(Provisioner) p.generatedData = generatedData() p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" for i, expectedValue := range expected { p.config.Vars = userEnvVarTests[i] flattenedEnvVars = p.createFlattenedEnvVars(false) if flattenedEnvVars != expectedValue { t.Fatalf("expected flattened env vars to be: %s, got %s.", expectedValue, flattenedEnvVars) } } } func TestProvision_createCommandText(t *testing.T) { config := testConfig() config["remote_path"] = "c:/Windows/Temp/script.ps1" p := new(Provisioner) comm := new(packersdk.MockCommunicator) p.communicator = comm _ = p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" // Non-elevated p.generatedData = make(map[string]interface{}) cmd, _ := p.createCommandText() re := regexp.MustCompile(`powershell -executionpolicy bypass "& { if \(Test-Path variable:global:ProgressPreference\){set-variable -name variable:global:ProgressPreference -value 'SilentlyContinue'};\. c:/Windows/Temp/packer-ps-env-vars-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1; &'c:/Windows/Temp/script.ps1'; exit \$LastExitCode }"`) matched := re.MatchString(cmd) if !matched { t.Fatalf("Got unexpected command: %s", cmd) } // Elevated p.config.ElevatedUser = "vagrant" p.config.ElevatedPassword = "vagrant" cmd, _ = p.createCommandText() re = regexp.MustCompile(`powershell -executionpolicy bypass -file "C:/Windows/Temp/packer-elevated-shell-[[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}\.ps1"`) matched = re.MatchString(cmd) if !matched { t.Fatalf("Got unexpected elevated command: %s", cmd) } } func TestProvision_uploadEnvVars(t *testing.T) { p := new(Provisioner) comm := new(packersdk.MockCommunicator) p.communicator = comm flattenedEnvVars := `$env:PACKER_BUILDER_TYPE="footype"; $env:PACKER_BUILD_NAME="foobuild";` err := p.uploadEnvVars(flattenedEnvVars) if err != nil { t.Fatalf("Did not expect error: %s", err.Error()) } if comm.UploadCalled != true { t.Fatalf("Failed to upload env var file") } } func TestCancel(t *testing.T) { // Don't actually call Cancel() as it performs an os.Exit(0) // which kills the 'go test' tool } func testConfig() map[string]interface{} { return map[string]interface{}{ "inline": []interface{}{"foo", "bar"}, } } func testConfigWithSkipClean() map[string]interface{} { return map[string]interface{}{ "inline": []interface{}{"foo", "bar"}, "skip_clean": true, } } func generatedData() map[string]interface{} { return map[string]interface{}{ "PackerHTTPAddr": commonsteps.HttpAddrNotImplemented, "PackerHTTPIP": commonsteps.HttpIPNotImplemented, "PackerHTTPPort": commonsteps.HttpPortNotImplemented, } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/test-fixtures/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023054�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/test-fixtures/powershell-inline-provisioner.txt�������������0000664�0000000�0000000�00000000302�13771713062�0031625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "type": "powershell", "environment_vars": "PackerRunUUID={{build `PackerRunUUID`}},ID={{build `ID`}}", "inline": [ "Write-Host \"$env:ID for provisioner.$env:PackerRunUUID\"" ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/test-fixtures/powershell-provisioner-cleanup.txt������������0000664�0000000�0000000�00000000626�13771713062�0032007�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "type": "powershell", "remote_path": "c:/Windows/Temp/packer-acc-test-script-test.ps1", "remote_env_var_path": "C:/Windows/Temp/packer-acc-test-vars.ps1", "inline": [ "Write-Host \"Total files found in Temp directory\" ( dir C:/Windows/Temp/packer-*.ps1 | measure).Count;" ] }, { "type": "windows-shell", "inline": ["dir C:\\Windows\\Temp\\packer-*.ps1"], "valid_exit_codes": ["1"] } ����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/test-fixtures/powershell-script-provisioner.txt�������������0000664�0000000�0000000�00000000341�13771713062�0031656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "type": "powershell", "script": "../../provisioner/powershell/test-fixtures/scripts/sample_script.ps1", "environment_vars": [ "VAR1=A$Dollar", "VAR2=A`Backtick", "VAR3=A'SingleQuote", "VAR4=A\"DoubleQuote" ] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/test-fixtures/scripts/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024543�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/test-fixtures/scripts/sample_script.ps1���������������������0000664�0000000�0000000�00000000611�13771713062�0030033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������write-output("packer_build_name is automatically set for you, or you can set it in your builder variables; the default for this builder is: " + $env:packer_build_name ) write-output("remember that escaping variables in powershell requires backticks; for example var1 from our config is " + $env:var1 ) write-output("likewise, var2 is " + $env:var2 ) write-output("and var3 is " + $env:var3 ) �����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/version/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021713�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/powershell/version/version.go������������������������������������������0000664�0000000�0000000�00000000505�13771713062�0023727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var PowershellPluginVersion *version.PluginVersion func init() { PowershellPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-masterless/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021537�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-masterless/provisioner.go���������������������������������������0000664�0000000�0000000�00000036363�13771713062�0024460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // Package puppetmasterless implements a provisioner for Packer that executes // Puppet on the remote machine, configured to apply a local manifest // versus connecting to a Puppet master. package puppetmasterless import ( "context" "fmt" "os" "path/filepath" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/guestexec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` ctx interpolate.Context // If true, staging directory is removed after executing puppet. CleanStagingDir bool `mapstructure:"clean_staging_directory"` // The Guest OS Type (unix or windows) GuestOSType string `mapstructure:"guest_os_type"` // The command used to execute Puppet. ExecuteCommand string `mapstructure:"execute_command"` // Additional arguments to pass when executing Puppet ExtraArguments []string `mapstructure:"extra_arguments"` // Additional facts to set when executing Puppet Facter map[string]string // Path to a hiera configuration file to upload and use. HieraConfigPath string `mapstructure:"hiera_config_path"` // If true, packer will ignore all exit-codes from a puppet run IgnoreExitCodes bool `mapstructure:"ignore_exit_codes"` // An array of local paths of modules to upload. ModulePaths []string `mapstructure:"module_paths"` // The main manifest file to apply to kick off the entire thing. ManifestFile string `mapstructure:"manifest_file"` // A directory of manifest files that will be uploaded to the remote // machine. ManifestDir string `mapstructure:"manifest_dir"` // If true, `sudo` will NOT be used to execute Puppet. PreventSudo bool `mapstructure:"prevent_sudo"` // The directory that contains the puppet binary. // E.g. if it can't be found on the standard path. PuppetBinDir string `mapstructure:"puppet_bin_dir"` // The directory where files will be uploaded. Packer requires write // permissions in this directory. StagingDir string `mapstructure:"staging_directory"` // The directory from which the command will be executed. // Packer requires the directory to exist when running puppet. WorkingDir string `mapstructure:"working_directory"` // Instructs the communicator to run the remote script as a Windows // scheduled task, effectively elevating the remote user by impersonating // a logged-in user ElevatedUser string `mapstructure:"elevated_user"` ElevatedPassword string `mapstructure:"elevated_password"` } type guestOSTypeConfig struct { executeCommand string facterVarsFmt string facterVarsJoiner string modulePathJoiner string stagingDir string tempDir string } // FIXME assumes both Packer host and target are same OS var guestOSTypeConfigs = map[string]guestOSTypeConfig{ guestexec.UnixOSType: { tempDir: "/tmp", stagingDir: "/tmp/packer-puppet-masterless", executeCommand: "cd {{.WorkingDir}} && " + `{{if ne .FacterVars ""}}{{.FacterVars}} {{end}}` + "{{if .Sudo}}sudo -E {{end}}" + `{{if ne .PuppetBinDir ""}}{{.PuppetBinDir}}/{{end}}` + "puppet apply --detailed-exitcodes " + "{{if .Debug}}--debug {{end}}" + `{{if ne .ModulePath ""}}--modulepath='{{.ModulePath}}' {{end}}` + `{{if ne .HieraConfigPath ""}}--hiera_config='{{.HieraConfigPath}}' {{end}}` + `{{if ne .ManifestDir ""}}--manifestdir='{{.ManifestDir}}' {{end}}` + `{{if ne .ExtraArguments ""}}{{.ExtraArguments}} {{end}}` + "{{.ManifestFile}}", facterVarsFmt: "FACTER_%s='%s'", facterVarsJoiner: " ", modulePathJoiner: ":", }, guestexec.WindowsOSType: { tempDir: filepath.ToSlash(os.Getenv("TEMP")), stagingDir: filepath.ToSlash(os.Getenv("SYSTEMROOT")) + "/Temp/packer-puppet-masterless", executeCommand: "cd {{.WorkingDir}} && " + `{{if ne .FacterVars ""}}{{.FacterVars}} && {{end}}` + `{{if ne .PuppetBinDir ""}}{{.PuppetBinDir}}/{{end}}` + "puppet apply --detailed-exitcodes " + "{{if .Debug}}--debug {{end}}" + `{{if ne .ModulePath ""}}--modulepath='{{.ModulePath}}' {{end}}` + `{{if ne .HieraConfigPath ""}}--hiera_config='{{.HieraConfigPath}}' {{end}}` + `{{if ne .ManifestDir ""}}--manifestdir='{{.ManifestDir}}' {{end}}` + `{{if ne .ExtraArguments ""}}{{.ExtraArguments}} {{end}}` + "{{.ManifestFile}}", facterVarsFmt: `SET "FACTER_%s=%s"`, facterVarsJoiner: " & ", modulePathJoiner: ";", }, } type Provisioner struct { config Config communicator packersdk.Communicator guestOSTypeConfig guestOSTypeConfig guestCommands *guestexec.GuestCommands generatedData map[string]interface{} } type ExecuteTemplate struct { Debug bool ExtraArguments string FacterVars string HieraConfigPath string ModulePath string ModulePathJoiner string ManifestFile string ManifestDir string PuppetBinDir string Sudo bool WorkingDir string } type EnvVarsTemplate struct { WinRMPassword string } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "puppet-masterless", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", "extra_arguments", }, }, }, raws...) if err != nil { return err } // Set some defaults if p.config.GuestOSType == "" { p.config.GuestOSType = guestexec.DefaultOSType } p.config.GuestOSType = strings.ToLower(p.config.GuestOSType) var ok bool p.guestOSTypeConfig, ok = guestOSTypeConfigs[p.config.GuestOSType] if !ok { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } p.guestCommands, err = guestexec.NewGuestCommands(p.config.GuestOSType, !p.config.PreventSudo) if err != nil { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = p.guestOSTypeConfig.executeCommand } if p.config.StagingDir == "" { p.config.StagingDir = p.guestOSTypeConfig.stagingDir } if p.config.WorkingDir == "" { p.config.WorkingDir = p.config.StagingDir } if p.config.Facter == nil { p.config.Facter = make(map[string]string) } p.config.Facter["packer_build_name"] = p.config.PackerBuildName p.config.Facter["packer_builder_type"] = p.config.PackerBuilderType // Validation var errs *packersdk.MultiError if p.config.HieraConfigPath != "" { info, err := os.Stat(p.config.HieraConfigPath) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("hiera_config_path is invalid: %s", err)) } else if info.IsDir() { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("hiera_config_path must point to a file")) } } if p.config.ManifestDir != "" { info, err := os.Stat(p.config.ManifestDir) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("manifest_dir is invalid: %s", err)) } else if !info.IsDir() { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("manifest_dir must point to a directory")) } } if p.config.ManifestFile == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("A manifest_file must be specified.")) } else { _, err := os.Stat(p.config.ManifestFile) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("manifest_file is invalid: %s", err)) } } for i, path := range p.config.ModulePaths { info, err := os.Stat(path) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("module_path[%d] is invalid: %s", i, err)) } else if !info.IsDir() { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("module_path[%d] must point to a directory", i)) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ui.Say("Provisioning with Puppet...") p.communicator = comm p.generatedData = generatedData ui.Message("Creating Puppet staging directory...") if err := p.createDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error creating staging directory: %s", err) } // Upload hiera config if set remoteHieraConfigPath := "" if p.config.HieraConfigPath != "" { var err error remoteHieraConfigPath, err = p.uploadHieraConfig(ui, comm) if err != nil { return fmt.Errorf("Error uploading hiera config: %s", err) } } // Upload manifest dir if set remoteManifestDir := "" if p.config.ManifestDir != "" { ui.Message(fmt.Sprintf( "Uploading manifest directory from: %s", p.config.ManifestDir)) remoteManifestDir = fmt.Sprintf("%s/manifests", p.config.StagingDir) err := p.uploadDirectory(ui, comm, remoteManifestDir, p.config.ManifestDir) if err != nil { return fmt.Errorf("Error uploading manifest dir: %s", err) } } // Upload all modules modulePaths := make([]string, 0, len(p.config.ModulePaths)) for i, path := range p.config.ModulePaths { ui.Message(fmt.Sprintf("Uploading local modules from: %s", path)) targetPath := fmt.Sprintf("%s/module-%d", p.config.StagingDir, i) if err := p.uploadDirectory(ui, comm, targetPath, path); err != nil { return fmt.Errorf("Error uploading modules: %s", err) } modulePaths = append(modulePaths, targetPath) } // Upload manifests remoteManifestFile, err := p.uploadManifests(ui, comm) if err != nil { return fmt.Errorf("Error uploading manifests: %s", err) } // Compile the facter variables facterVars := make([]string, 0, len(p.config.Facter)) for k, v := range p.config.Facter { facterVars = append(facterVars, fmt.Sprintf(p.guestOSTypeConfig.facterVarsFmt, k, v)) } data := ExecuteTemplate{ ExtraArguments: "", FacterVars: strings.Join(facterVars, p.guestOSTypeConfig.facterVarsJoiner), HieraConfigPath: remoteHieraConfigPath, ManifestDir: remoteManifestDir, ManifestFile: remoteManifestFile, ModulePath: strings.Join(modulePaths, p.guestOSTypeConfig.modulePathJoiner), ModulePathJoiner: p.guestOSTypeConfig.modulePathJoiner, PuppetBinDir: p.config.PuppetBinDir, Sudo: !p.config.PreventSudo, WorkingDir: p.config.WorkingDir, } p.config.ctx.Data = &data _ExtraArguments, err := interpolate.Render(strings.Join(p.config.ExtraArguments, " "), &p.config.ctx) if err != nil { return err } data.ExtraArguments = _ExtraArguments command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return err } if p.config.ElevatedUser != "" { command, err = guestexec.GenerateElevatedRunner(command, p) if err != nil { return err } } cmd := &packersdk.RemoteCmd{ Command: command, } ui.Message(fmt.Sprintf("Running Puppet: %s", command)) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return fmt.Errorf("Got an error starting command: %s", err) } if cmd.ExitStatus() != 0 && cmd.ExitStatus() != 2 && !p.config.IgnoreExitCodes { return fmt.Errorf("Puppet exited with a non-zero exit status: %d", cmd.ExitStatus()) } if p.config.CleanStagingDir { if err := p.removeDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error removing staging directory: %s", err) } } return nil } func (p *Provisioner) uploadHieraConfig(ui packersdk.Ui, comm packersdk.Communicator) (string, error) { ui.Message("Uploading hiera configuration...") f, err := os.Open(p.config.HieraConfigPath) if err != nil { return "", err } defer f.Close() path := fmt.Sprintf("%s/hiera.yaml", p.config.StagingDir) if err := comm.Upload(path, f, nil); err != nil { return "", err } return path, nil } func (p *Provisioner) uploadManifests(ui packersdk.Ui, comm packersdk.Communicator) (string, error) { // Create the remote manifests directory... ui.Message("Uploading manifests...") remoteManifestsPath := fmt.Sprintf("%s/manifests", p.config.StagingDir) if err := p.createDir(ui, comm, remoteManifestsPath); err != nil { return "", fmt.Errorf("Error creating manifests directory: %s", err) } // NOTE! manifest_file may either be a directory or a file, as puppet apply // now accepts either one. fi, err := os.Stat(p.config.ManifestFile) if err != nil { return "", fmt.Errorf("Error inspecting manifest file: %s", err) } if fi.IsDir() { // If manifest_file is a directory we'll upload the whole thing ui.Message(fmt.Sprintf( "Uploading manifest directory from: %s", p.config.ManifestFile)) remoteManifestDir := fmt.Sprintf("%s/manifests", p.config.StagingDir) err := p.uploadDirectory(ui, comm, remoteManifestDir, p.config.ManifestFile) if err != nil { return "", fmt.Errorf("Error uploading manifest dir: %s", err) } return remoteManifestDir, nil } // Otherwise manifest_file is a file and we'll upload it ui.Message(fmt.Sprintf( "Uploading manifest file from: %s", p.config.ManifestFile)) f, err := os.Open(p.config.ManifestFile) if err != nil { return "", err } defer f.Close() manifestFilename := filepath.Base(p.config.ManifestFile) remoteManifestFile := fmt.Sprintf("%s/%s", remoteManifestsPath, manifestFilename) if err := comm.Upload(remoteManifestFile, f, nil); err != nil { return "", err } return remoteManifestFile, nil } func (p *Provisioner) createDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ui.Message(fmt.Sprintf("Creating directory: %s", dir)) cmd := &packersdk.RemoteCmd{Command: p.guestCommands.CreateDir(dir)} ctx := context.TODO() if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status.") } // Chmod the directory to 0777 just so that we can access it as our user cmd = &packersdk.RemoteCmd{Command: p.guestCommands.Chmod(dir, "0777")} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more info.") } return nil } func (p *Provisioner) removeDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ctx := context.TODO() cmd := &packersdk.RemoteCmd{Command: p.guestCommands.RemoveDir(dir)} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status.") } return nil } func (p *Provisioner) uploadDirectory(ui packersdk.Ui, comm packersdk.Communicator, dst string, src string) error { if err := p.createDir(ui, comm, dst); err != nil { return err } // Make sure there is a trailing "/" so that the directory isn't // created on the other side. if src[len(src)-1] != '/' { src = src + "/" } return comm.UploadDir(dst, src, nil) } func (p *Provisioner) Communicator() packersdk.Communicator { return p.communicator } func (p *Provisioner) ElevatedUser() string { return p.config.ElevatedUser } func (p *Provisioner) ElevatedPassword() string { // Replace ElevatedPassword for winrm users who used this feature p.config.ctx.Data = p.generatedData elevatedPassword, _ := interpolate.Render(p.config.ElevatedPassword, &p.config.ctx) return elevatedPassword } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-masterless/provisioner.hcl2spec.go������������������������������0000664�0000000�0000000�00000014425�13771713062�0026155�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package puppetmasterless import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` CleanStagingDir *bool `mapstructure:"clean_staging_directory" cty:"clean_staging_directory" hcl:"clean_staging_directory"` GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` ExtraArguments []string `mapstructure:"extra_arguments" cty:"extra_arguments" hcl:"extra_arguments"` Facter map[string]string `cty:"facter" hcl:"facter"` HieraConfigPath *string `mapstructure:"hiera_config_path" cty:"hiera_config_path" hcl:"hiera_config_path"` IgnoreExitCodes *bool `mapstructure:"ignore_exit_codes" cty:"ignore_exit_codes" hcl:"ignore_exit_codes"` ModulePaths []string `mapstructure:"module_paths" cty:"module_paths" hcl:"module_paths"` ManifestFile *string `mapstructure:"manifest_file" cty:"manifest_file" hcl:"manifest_file"` ManifestDir *string `mapstructure:"manifest_dir" cty:"manifest_dir" hcl:"manifest_dir"` PreventSudo *bool `mapstructure:"prevent_sudo" cty:"prevent_sudo" hcl:"prevent_sudo"` PuppetBinDir *string `mapstructure:"puppet_bin_dir" cty:"puppet_bin_dir" hcl:"puppet_bin_dir"` StagingDir *string `mapstructure:"staging_directory" cty:"staging_directory" hcl:"staging_directory"` WorkingDir *string `mapstructure:"working_directory" cty:"working_directory" hcl:"working_directory"` ElevatedUser *string `mapstructure:"elevated_user" cty:"elevated_user" hcl:"elevated_user"` ElevatedPassword *string `mapstructure:"elevated_password" cty:"elevated_password" hcl:"elevated_password"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "clean_staging_directory": &hcldec.AttrSpec{Name: "clean_staging_directory", Type: cty.Bool, Required: false}, "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "extra_arguments": &hcldec.AttrSpec{Name: "extra_arguments", Type: cty.List(cty.String), Required: false}, "facter": &hcldec.AttrSpec{Name: "facter", Type: cty.Map(cty.String), Required: false}, "hiera_config_path": &hcldec.AttrSpec{Name: "hiera_config_path", Type: cty.String, Required: false}, "ignore_exit_codes": &hcldec.AttrSpec{Name: "ignore_exit_codes", Type: cty.Bool, Required: false}, "module_paths": &hcldec.AttrSpec{Name: "module_paths", Type: cty.List(cty.String), Required: false}, "manifest_file": &hcldec.AttrSpec{Name: "manifest_file", Type: cty.String, Required: false}, "manifest_dir": &hcldec.AttrSpec{Name: "manifest_dir", Type: cty.String, Required: false}, "prevent_sudo": &hcldec.AttrSpec{Name: "prevent_sudo", Type: cty.Bool, Required: false}, "puppet_bin_dir": &hcldec.AttrSpec{Name: "puppet_bin_dir", Type: cty.String, Required: false}, "staging_directory": &hcldec.AttrSpec{Name: "staging_directory", Type: cty.String, Required: false}, "working_directory": &hcldec.AttrSpec{Name: "working_directory", Type: cty.String, Required: false}, "elevated_user": &hcldec.AttrSpec{Name: "elevated_user", Type: cty.String, Required: false}, "elevated_password": &hcldec.AttrSpec{Name: "elevated_password", Type: cty.String, Required: false}, } return s } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-masterless/provisioner_test.go����������������������������������0000664�0000000�0000000�00000032114�13771713062�0025505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package puppetmasterless import ( "context" "fmt" "io/ioutil" "log" "os" "path/filepath" "strings" "testing" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/stretchr/testify/assert" ) func testConfig() (config map[string]interface{}, tf *os.File) { tf, err := ioutil.TempFile("", "packer") if err != nil { panic(err) } config = map[string]interface{}{ "manifest_file": tf.Name(), } return config, tf } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestGuestOSConfig_empty_unix(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Execute Puppet p.config.ctx.Data = &ExecuteTemplate{ ManifestFile: "/r/m/f", PuppetBinDir: p.config.PuppetBinDir, Sudo: !p.config.PreventSudo, WorkingDir: p.config.WorkingDir, } log.Println(p.config.ExecuteCommand) command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { t.Fatalf("err: %s", err) } expected := "cd /tmp/packer-puppet-masterless && " + "sudo -E puppet apply --detailed-exitcodes /r/m/f" assert.Equal(t, expected, command) } func TestGuestOSConfig_full_unix(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } facterVars := []string{ fmt.Sprintf(p.guestOSTypeConfig.facterVarsFmt, "lhs", "rhs"), fmt.Sprintf(p.guestOSTypeConfig.facterVarsFmt, "foo", "bar"), } modulePaths := []string{"/m/p", "/a/b"} // Execute Puppet p.config.ctx.Data = &ExecuteTemplate{ FacterVars: strings.Join(facterVars, p.guestOSTypeConfig.facterVarsJoiner), HieraConfigPath: "/h/c/p", ManifestDir: "/r/m/d", ManifestFile: "/r/m/f", ModulePath: strings.Join(modulePaths, p.guestOSTypeConfig.modulePathJoiner), PuppetBinDir: p.config.PuppetBinDir, Sudo: !p.config.PreventSudo, WorkingDir: p.config.WorkingDir, ExtraArguments: strings.Join(p.config.ExtraArguments, " "), } command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { t.Fatalf("err: %s", err) } expected := "cd /tmp/packer-puppet-masterless && FACTER_lhs='rhs' FACTER_foo='bar' " + "sudo -E puppet apply " + "--detailed-exitcodes --modulepath='/m/p:/a/b' --hiera_config='/h/c/p' " + "--manifestdir='/r/m/d' /r/m/f" assert.Equal(t, expected, command) } func TestGuestOSConfig_empty_windows(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() config["guest_os_type"] = "windows" p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Execute Puppet p.config.ctx.Data = &ExecuteTemplate{ ManifestFile: "/r/m/f", PuppetBinDir: p.config.PuppetBinDir, Sudo: !p.config.PreventSudo, WorkingDir: p.config.WorkingDir, } log.Println(p.config.ExecuteCommand) command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { t.Fatalf("err: %s", err) } expected := "cd " + filepath.ToSlash(os.Getenv("SYSTEMROOT")) + "/Temp/packer-puppet-masterless && puppet apply --detailed-exitcodes /r/m/f" assert.Equal(t, expected, command) } func TestGuestOSConfig_full_windows(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() config["guest_os_type"] = "windows" p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } facterVars := []string{ fmt.Sprintf(p.guestOSTypeConfig.facterVarsFmt, "lhs", "rhs"), fmt.Sprintf(p.guestOSTypeConfig.facterVarsFmt, "foo", "bar"), } modulePaths := []string{"/m/p", "/a/b"} // Execute Puppet p.config.ctx.Data = &ExecuteTemplate{ FacterVars: strings.Join(facterVars, p.guestOSTypeConfig.facterVarsJoiner), HieraConfigPath: "/h/c/p", ManifestDir: "/r/m/d", ManifestFile: "/r/m/f", ModulePath: strings.Join(modulePaths, p.guestOSTypeConfig.modulePathJoiner), PuppetBinDir: p.config.PuppetBinDir, Sudo: !p.config.PreventSudo, WorkingDir: p.config.WorkingDir, ExtraArguments: strings.Join(p.config.ExtraArguments, " "), } command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { t.Fatalf("err: %s", err) } expected := "cd " + filepath.ToSlash(os.Getenv("SYSTEMROOT")) + "/Temp/packer-puppet-masterless && " + "SET \"FACTER_lhs=rhs\" & SET \"FACTER_foo=bar\" && " + "puppet apply --detailed-exitcodes --modulepath='/m/p;/a/b' --hiera_config='/h/c/p' " + "--manifestdir='/r/m/d' /r/m/f" assert.Equal(t, expected, command) } func TestProvisionerPrepare_puppetBinDir(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "puppet_bin_dir") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["puppet_bin_dir"] = tf.Name() p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_hieraConfigPath(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "hiera_config_path") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["hiera_config_path"] = tf.Name() p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_manifestFile(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "manifest_file") p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should be an error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["manifest_file"] = tf.Name() p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_manifestDir(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "manifestdir") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a good one td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("error: %s", err) } defer os.RemoveAll(td) config["manifest_dir"] = td p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_modulePaths(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "module_paths") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with bad paths config["module_paths"] = []string{"i-should-not-exist"} p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should be an error") } // Test with a good one td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("error: %s", err) } defer os.RemoveAll(td) config["module_paths"] = []string{td} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_facterFacts(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "facter") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with malformed fact config["facter"] = "fact=stringified" p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should be an error") } // Test with a good one td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("error: %s", err) } defer os.RemoveAll(td) facts := make(map[string]string) facts["fact_name"] = "fact_value" config["facter"] = facts p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Make sure the default facts are present delete(config, "facter") p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.Facter == nil { t.Fatalf("err: Default facts are not set in the Puppet provisioner!") } if _, ok := p.config.Facter["packer_build_name"]; !ok { t.Fatalf("err: packer_build_name fact not set in the Puppet provisioner!") } if _, ok := p.config.Facter["packer_builder_type"]; !ok { t.Fatalf("err: packer_builder_type fact not set in the Puppet provisioner!") } } func TestProvisionerPrepare_extraArguments(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() // Test with missing parameter delete(config, "extra_arguments") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with malformed value config["extra_arguments"] = "{{}}" p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should be an error") } // Test with valid values config["extra_arguments"] = []string{ "arg", } p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_stagingDir(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "staging_directory") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Make sure the default staging directory is correct if p.config.StagingDir != "/tmp/packer-puppet-masterless" { t.Fatalf("err: Default staging_directory is not set in the Puppet provisioner!") } // Make sure default staging directory can be overridden config["staging_directory"] = "/tmp/override" p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.StagingDir != "/tmp/override" { t.Fatalf("err: Overridden staging_directory is not set correctly in the Puppet provisioner!") } } func TestProvisionerPrepare_workingDir(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "working_directory") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Make sure default working dir and staging dir are the same if p.config.WorkingDir != p.config.StagingDir { t.Fatalf("err: Default working_directory is not set to the same value as default staging_directory in the Puppet provisioner!") } // Make sure the default working directory is correct if p.config.WorkingDir != "/tmp/packer-puppet-masterless" { t.Fatalf("err: Default working_directory is not set in the Puppet provisioner!") } // Make sure default working directory can be overridden config["working_directory"] = "/tmp/override" p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.WorkingDir != "/tmp/override" { t.Fatalf("err: Overridden working_directory is not set correctly in the Puppet provisioner!") } } func TestProvisionerProvision_extraArguments(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() ui := &packer.MachineReadableUi{ Writer: ioutil.Discard, } comm := new(packersdk.MockCommunicator) extraArguments := []string{ "--some-arg=yup", "--some-other-arg", } config["extra_arguments"] = extraArguments // Test with valid values p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatalf("err: %s", err) } expectedArgs := strings.Join(extraArguments, " ") if !strings.Contains(comm.StartCmd.Command, expectedArgs) { t.Fatalf("Command %q doesn't contain the expected arguments %q", comm.StartCmd.Command, expectedArgs) } // Test with missing parameter delete(config, "extra_arguments") p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatalf("err: %s", err) } // Check the expected `extra_arguments` position for an empty value splitCommand := strings.Split(comm.StartCmd.Command, " ") if "" == splitCommand[len(splitCommand)-2] { t.Fatalf("Command %q contains an extra-space which may cause arg parsing issues", comm.StartCmd.Command) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-masterless/version/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023224�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-masterless/version/version.go�����������������������������������0000664�0000000�0000000�00000000521�13771713062�0025236�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var PuppetMasterlessPluginVersion *version.PluginVersion func init() { PuppetMasterlessPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-server/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020663�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-server/provisioner.go�������������������������������������������0000664�0000000�0000000�00000030276�13771713062�0023601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // Package puppetserver implements a provisioner for Packer that executes // Puppet on the remote machine connecting to a Puppet master. package puppetserver import ( "context" "fmt" "os" "path/filepath" "strings" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/guestexec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` ctx interpolate.Context // If true, staging directory is removed after executing puppet. CleanStagingDir bool `mapstructure:"clean_staging_directory"` // A path to the client certificate ClientCertPath string `mapstructure:"client_cert_path"` // A path to a directory containing the client private keys ClientPrivateKeyPath string `mapstructure:"client_private_key_path"` // The command used to execute Puppet. ExecuteCommand string `mapstructure:"execute_command"` // Additional argument to pass when executing Puppet. ExtraArguments []string `mapstructure:"extra_arguments"` // Additional facts to set when executing Puppet Facter map[string]string // The Guest OS Type (unix or windows) GuestOSType string `mapstructure:"guest_os_type"` // If true, packer will ignore all exit-codes from a puppet run IgnoreExitCodes bool `mapstructure:"ignore_exit_codes"` // If true, `sudo` will NOT be used to execute Puppet. PreventSudo bool `mapstructure:"prevent_sudo"` // The directory that contains the puppet binary. // E.g. if it can't be found on the standard path. PuppetBinDir string `mapstructure:"puppet_bin_dir"` // The hostname of the Puppet node. PuppetNode string `mapstructure:"puppet_node"` // The hostname of the Puppet server. PuppetServer string `mapstructure:"puppet_server"` // The directory where files will be uploaded. Packer requires write // permissions in this directory. StagingDir string `mapstructure:"staging_dir"` // The directory from which the command will be executed. // Packer requires the directory to exist when running puppet. WorkingDir string `mapstructure:"working_directory"` // Instructs the communicator to run the remote script as a Windows // scheduled task, effectively elevating the remote user by impersonating // a logged-in user ElevatedUser string `mapstructure:"elevated_user"` ElevatedPassword string `mapstructure:"elevated_password"` } type guestOSTypeConfig struct { executeCommand string facterVarsFmt string facterVarsJoiner string stagingDir string tempDir string } // FIXME assumes both Packer host and target are same OS var guestOSTypeConfigs = map[string]guestOSTypeConfig{ guestexec.UnixOSType: { tempDir: "/tmp", stagingDir: "/tmp/packer-puppet-server", executeCommand: "cd {{.WorkingDir}} && " + `{{if ne .FacterVars ""}}{{.FacterVars}} {{end}}` + "{{if .Sudo}}sudo -E {{end}}" + `{{if ne .PuppetBinDir ""}}{{.PuppetBinDir}}/{{end}}` + "puppet agent --onetime --no-daemonize --detailed-exitcodes " + "{{if .Debug}}--debug {{end}}" + `{{if ne .PuppetServer ""}}--server='{{.PuppetServer}}' {{end}}` + `{{if ne .PuppetNode ""}}--certname='{{.PuppetNode}}' {{end}}` + `{{if ne .ClientCertPath ""}}--certdir='{{.ClientCertPath}}' {{end}}` + `{{if ne .ClientPrivateKeyPath ""}}--privatekeydir='{{.ClientPrivateKeyPath}}' {{end}}` + `{{if ne .ExtraArguments ""}}{{.ExtraArguments}} {{end}}`, facterVarsFmt: "FACTER_%s='%s'", facterVarsJoiner: " ", }, guestexec.WindowsOSType: { tempDir: filepath.ToSlash(os.Getenv("TEMP")), stagingDir: filepath.ToSlash(os.Getenv("SYSTEMROOT")) + "/Temp/packer-puppet-server", executeCommand: "cd {{.WorkingDir}} && " + `{{if ne .FacterVars ""}}{{.FacterVars}} && {{end}}` + `{{if ne .PuppetBinDir ""}}{{.PuppetBinDir}}/{{end}}` + "puppet agent --onetime --no-daemonize --detailed-exitcodes " + "{{if .Debug}}--debug {{end}}" + `{{if ne .PuppetServer ""}}--server='{{.PuppetServer}}' {{end}}` + `{{if ne .PuppetNode ""}}--certname='{{.PuppetNode}}' {{end}}` + `{{if ne .ClientCertPath ""}}--certdir='{{.ClientCertPath}}' {{end}}` + `{{if ne .ClientPrivateKeyPath ""}}--privatekeydir='{{.ClientPrivateKeyPath}}' {{end}}` + `{{if ne .ExtraArguments ""}}{{.ExtraArguments}} {{end}}`, facterVarsFmt: `SET "FACTER_%s=%s"`, facterVarsJoiner: " & ", }, } type Provisioner struct { config Config communicator packersdk.Communicator guestOSTypeConfig guestOSTypeConfig guestCommands *guestexec.GuestCommands generatedData map[string]interface{} } type ExecuteTemplate struct { ClientCertPath string ClientPrivateKeyPath string Debug bool ExtraArguments string FacterVars string PuppetNode string PuppetServer string PuppetBinDir string Sudo bool WorkingDir string } type EnvVarsTemplate struct { WinRMPassword string } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "puppet-server", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", "extra_arguments", }, }, }, raws...) if err != nil { return err } if p.config.GuestOSType == "" { p.config.GuestOSType = guestexec.DefaultOSType } p.config.GuestOSType = strings.ToLower(p.config.GuestOSType) var ok bool p.guestOSTypeConfig, ok = guestOSTypeConfigs[p.config.GuestOSType] if !ok { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } p.guestCommands, err = guestexec.NewGuestCommands(p.config.GuestOSType, !p.config.PreventSudo) if err != nil { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = p.guestOSTypeConfig.executeCommand } if p.config.StagingDir == "" { p.config.StagingDir = p.guestOSTypeConfig.stagingDir } if p.config.WorkingDir == "" { p.config.WorkingDir = p.config.StagingDir } if p.config.Facter == nil { p.config.Facter = make(map[string]string) } p.config.Facter["packer_build_name"] = p.config.PackerBuildName p.config.Facter["packer_builder_type"] = p.config.PackerBuilderType var errs *packersdk.MultiError if p.config.ClientCertPath != "" { info, err := os.Stat(p.config.ClientCertPath) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_cert_dir is invalid: %s", err)) } else if !info.IsDir() { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_cert_dir must point to a directory")) } } if p.config.ClientPrivateKeyPath != "" { info, err := os.Stat(p.config.ClientPrivateKeyPath) if err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_private_key_dir is invalid: %s", err)) } else if !info.IsDir() { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("client_private_key_dir must point to a directory")) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ui.Say("Provisioning with Puppet...") p.communicator = comm p.generatedData = generatedData ui.Message("Creating Puppet staging directory...") if err := p.createDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error creating staging directory: %s", err) } // Upload client cert dir if set remoteClientCertPath := "" if p.config.ClientCertPath != "" { ui.Message(fmt.Sprintf( "Uploading client cert from: %s", p.config.ClientCertPath)) remoteClientCertPath = fmt.Sprintf("%s/certs", p.config.StagingDir) err := p.uploadDirectory(ui, comm, remoteClientCertPath, p.config.ClientCertPath) if err != nil { return fmt.Errorf("Error uploading client cert: %s", err) } } // Upload client cert dir if set remoteClientPrivateKeyPath := "" if p.config.ClientPrivateKeyPath != "" { ui.Message(fmt.Sprintf( "Uploading client private keys from: %s", p.config.ClientPrivateKeyPath)) remoteClientPrivateKeyPath = fmt.Sprintf("%s/private_keys", p.config.StagingDir) err := p.uploadDirectory(ui, comm, remoteClientPrivateKeyPath, p.config.ClientPrivateKeyPath) if err != nil { return fmt.Errorf("Error uploading client private keys: %s", err) } } // Compile the facter variables facterVars := make([]string, 0, len(p.config.Facter)) for k, v := range p.config.Facter { facterVars = append(facterVars, fmt.Sprintf(p.guestOSTypeConfig.facterVarsFmt, k, v)) } data := ExecuteTemplate{ ClientCertPath: remoteClientCertPath, ClientPrivateKeyPath: remoteClientPrivateKeyPath, ExtraArguments: "", FacterVars: strings.Join(facterVars, p.guestOSTypeConfig.facterVarsJoiner), PuppetNode: p.config.PuppetNode, PuppetServer: p.config.PuppetServer, PuppetBinDir: p.config.PuppetBinDir, Sudo: !p.config.PreventSudo, WorkingDir: p.config.WorkingDir, } p.config.ctx.Data = &data _ExtraArguments, err := interpolate.Render(strings.Join(p.config.ExtraArguments, " "), &p.config.ctx) if err != nil { return err } data.ExtraArguments = _ExtraArguments command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return err } if p.config.ElevatedUser != "" { command, err = guestexec.GenerateElevatedRunner(command, p) if err != nil { return err } } cmd := &packersdk.RemoteCmd{ Command: command, } ui.Message(fmt.Sprintf("Running Puppet: %s", command)) if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 && cmd.ExitStatus() != 2 && !p.config.IgnoreExitCodes { return fmt.Errorf("Puppet exited with a non-zero exit status: %d", cmd.ExitStatus()) } if p.config.CleanStagingDir { if err := p.removeDir(ui, comm, p.config.StagingDir); err != nil { return fmt.Errorf("Error removing staging directory: %s", err) } } return nil } func (p *Provisioner) createDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ui.Message(fmt.Sprintf("Creating directory: %s", dir)) ctx := context.TODO() cmd := &packersdk.RemoteCmd{Command: p.guestCommands.CreateDir(dir)} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more info.") } // Chmod the directory to 0777 just so that we can access it as our user cmd = &packersdk.RemoteCmd{Command: p.guestCommands.Chmod(dir, "0777")} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status. See output above for more info.") } return nil } func (p *Provisioner) removeDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ctx := context.TODO() cmd := &packersdk.RemoteCmd{Command: p.guestCommands.RemoveDir(dir)} if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status.") } return nil } func (p *Provisioner) uploadDirectory(ui packersdk.Ui, comm packersdk.Communicator, dst string, src string) error { if err := p.createDir(ui, comm, dst); err != nil { return err } // Make sure there is a trailing "/" so that the directory isn't // created on the other side. if src[len(src)-1] != '/' { src = src + "/" } return comm.UploadDir(dst, src, nil) } func (p *Provisioner) Communicator() packersdk.Communicator { return p.communicator } func (p *Provisioner) ElevatedUser() string { return p.config.ElevatedUser } func (p *Provisioner) ElevatedPassword() string { // Replace ElevatedPassword for winrm users who used this feature p.config.ctx.Data = p.generatedData elevatedPassword, _ := interpolate.Render(p.config.ElevatedPassword, &p.config.ctx) return elevatedPassword } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-server/provisioner.hcl2spec.go����������������������������������0000664�0000000�0000000�00000014453�13771713062�0025302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package puppetserver import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` CleanStagingDir *bool `mapstructure:"clean_staging_directory" cty:"clean_staging_directory" hcl:"clean_staging_directory"` ClientCertPath *string `mapstructure:"client_cert_path" cty:"client_cert_path" hcl:"client_cert_path"` ClientPrivateKeyPath *string `mapstructure:"client_private_key_path" cty:"client_private_key_path" hcl:"client_private_key_path"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` ExtraArguments []string `mapstructure:"extra_arguments" cty:"extra_arguments" hcl:"extra_arguments"` Facter map[string]string `cty:"facter" hcl:"facter"` GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` IgnoreExitCodes *bool `mapstructure:"ignore_exit_codes" cty:"ignore_exit_codes" hcl:"ignore_exit_codes"` PreventSudo *bool `mapstructure:"prevent_sudo" cty:"prevent_sudo" hcl:"prevent_sudo"` PuppetBinDir *string `mapstructure:"puppet_bin_dir" cty:"puppet_bin_dir" hcl:"puppet_bin_dir"` PuppetNode *string `mapstructure:"puppet_node" cty:"puppet_node" hcl:"puppet_node"` PuppetServer *string `mapstructure:"puppet_server" cty:"puppet_server" hcl:"puppet_server"` StagingDir *string `mapstructure:"staging_dir" cty:"staging_dir" hcl:"staging_dir"` WorkingDir *string `mapstructure:"working_directory" cty:"working_directory" hcl:"working_directory"` ElevatedUser *string `mapstructure:"elevated_user" cty:"elevated_user" hcl:"elevated_user"` ElevatedPassword *string `mapstructure:"elevated_password" cty:"elevated_password" hcl:"elevated_password"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "clean_staging_directory": &hcldec.AttrSpec{Name: "clean_staging_directory", Type: cty.Bool, Required: false}, "client_cert_path": &hcldec.AttrSpec{Name: "client_cert_path", Type: cty.String, Required: false}, "client_private_key_path": &hcldec.AttrSpec{Name: "client_private_key_path", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "extra_arguments": &hcldec.AttrSpec{Name: "extra_arguments", Type: cty.List(cty.String), Required: false}, "facter": &hcldec.AttrSpec{Name: "facter", Type: cty.Map(cty.String), Required: false}, "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, "ignore_exit_codes": &hcldec.AttrSpec{Name: "ignore_exit_codes", Type: cty.Bool, Required: false}, "prevent_sudo": &hcldec.AttrSpec{Name: "prevent_sudo", Type: cty.Bool, Required: false}, "puppet_bin_dir": &hcldec.AttrSpec{Name: "puppet_bin_dir", Type: cty.String, Required: false}, "puppet_node": &hcldec.AttrSpec{Name: "puppet_node", Type: cty.String, Required: false}, "puppet_server": &hcldec.AttrSpec{Name: "puppet_server", Type: cty.String, Required: false}, "staging_dir": &hcldec.AttrSpec{Name: "staging_dir", Type: cty.String, Required: false}, "working_directory": &hcldec.AttrSpec{Name: "working_directory", Type: cty.String, Required: false}, "elevated_user": &hcldec.AttrSpec{Name: "elevated_user", Type: cty.String, Required: false}, "elevated_password": &hcldec.AttrSpec{Name: "elevated_password", Type: cty.String, Required: false}, } return s } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-server/provisioner_test.go��������������������������������������0000664�0000000�0000000�00000011615�13771713062�0024634�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package puppetserver import ( "io/ioutil" "os" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() (config map[string]interface{}, tf *os.File) { tf, err := ioutil.TempFile("", "packer") if err != nil { panic(err) } config = map[string]interface{}{ "puppet_server": tf.Name(), } return config, tf } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_puppetBinDir(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "puppet_bin_dir") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["puppet_bin_dir"] = tf.Name() p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_clientPrivateKeyPath(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "client_private_key_path") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with bad paths config["client_private_key_path"] = "i-should-not-exist" p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should be an error") } // Test with a good one td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("error: %s", err) } defer os.RemoveAll(td) config["client_private_key_path"] = td p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_clientCertPath(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "client_cert_path") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with bad paths config["client_cert_path"] = "i-should-not-exist" p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should be an error") } // Test with a good one td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("error: %s", err) } defer os.RemoveAll(td) config["client_cert_path"] = td p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_executeCommand(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "execute_command") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_facterFacts(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "facter") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Test with malformed fact config["facter"] = "fact=stringified" p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should be an error") } // Test with a good one td, err := ioutil.TempDir("", "packer") if err != nil { t.Fatalf("error: %s", err) } defer os.RemoveAll(td) facts := make(map[string]string) facts["fact_name"] = "fact_value" config["facter"] = facts p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Make sure the default facts are present delete(config, "facter") p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.Facter == nil { t.Fatalf("err: Default facts are not set in the Puppet provisioner!") } if _, ok := p.config.Facter["packer_build_name"]; !ok { t.Fatalf("err: packer_build_name fact not set in the Puppet provisioner!") } if _, ok := p.config.Facter["packer_builder_type"]; !ok { t.Fatalf("err: packer_builder_type fact not set in the Puppet provisioner!") } } func TestProvisionerPrepare_stagingDir(t *testing.T) { config, tempfile := testConfig() defer os.Remove(tempfile.Name()) defer tempfile.Close() delete(config, "staging_dir") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } // Make sure the default staging directory is correct if p.config.StagingDir != "/tmp/packer-puppet-server" { t.Fatalf("err: Default staging_dir is not set in the Puppet provisioner!") } // Make sure default staging directory can be overridden config["staging_dir"] = "/tmp/override" p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.StagingDir != "/tmp/override" { t.Fatalf("err: Overridden staging_dir is not set correctly in the Puppet provisioner!") } } �������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-server/version/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022350�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/puppet-server/version/version.go���������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var PuppetServerPluginVersion *version.PluginVersion func init() { PuppetServerPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/salt-masterless/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021165�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/salt-masterless/provisioner.go�����������������������������������������0000664�0000000�0000000�00000047632�13771713062�0024107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that executes a // saltstack state within the remote machine package saltmasterless import ( "bytes" "context" "errors" "fmt" "os" "path/filepath" "regexp" "strings" "github.com/hashicorp/go-getter/v2" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" "github.com/hashicorp/packer/packer-plugin-sdk/guestexec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" ) type Config struct { common.PackerConfig `mapstructure:",squash"` // If true, run the salt-bootstrap script SkipBootstrap bool `mapstructure:"skip_bootstrap"` BootstrapArgs string `mapstructure:"bootstrap_args"` DisableSudo bool `mapstructure:"disable_sudo"` // Custom state to run instead of highstate CustomState string `mapstructure:"custom_state"` // Local path to the minion config MinionConfig string `mapstructure:"minion_config"` // Local path to the minion grains GrainsFile string `mapstructure:"grains_file"` // Local path to the salt state tree LocalStateTree string `mapstructure:"local_state_tree"` // Local path to the salt pillar roots LocalPillarRoots string `mapstructure:"local_pillar_roots"` // Remote path to the salt state tree RemoteStateTree string `mapstructure:"remote_state_tree"` // Remote path to the salt pillar roots RemotePillarRoots string `mapstructure:"remote_pillar_roots"` // Where files will be copied before moving to the /srv/salt directory TempConfigDir string `mapstructure:"temp_config_dir"` // Don't exit packer if salt-call returns an error code NoExitOnFailure bool `mapstructure:"no_exit_on_failure"` // Set the logging level for the salt-call run LogLevel string `mapstructure:"log_level"` // Arguments to pass to salt-call SaltCallArgs string `mapstructure:"salt_call_args"` // Directory containing salt-call SaltBinDir string `mapstructure:"salt_bin_dir"` // Command line args passed onto salt-call CmdArgs string `mapstructure-to-hcl2:",skip"` // The Guest OS Type (unix or windows) GuestOSType string `mapstructure:"guest_os_type"` // An array of private or community git source formulas Formulas []string `mapstructure:"formulas"` ctx interpolate.Context } type Provisioner struct { config Config guestOSTypeConfig guestOSTypeConfig guestCommands *guestexec.GuestCommands } type guestOSTypeConfig struct { tempDir string stateRoot string pillarRoot string configDir string bootstrapFetchCmd string bootstrapRunCmd string } var guestOSTypeConfigs = map[string]guestOSTypeConfig{ guestexec.UnixOSType: { configDir: "/etc/salt", tempDir: "/tmp/salt", stateRoot: "/srv/salt", pillarRoot: "/srv/pillar", bootstrapFetchCmd: "curl -L https://bootstrap.saltstack.com -o /tmp/install_salt.sh || wget -O /tmp/install_salt.sh https://bootstrap.saltstack.com", bootstrapRunCmd: "sh /tmp/install_salt.sh", }, guestexec.WindowsOSType: { configDir: "C:/salt/conf", tempDir: "C:/Windows/Temp/salt/", stateRoot: "C:/salt/state", pillarRoot: "C:/salt/pillar/", bootstrapFetchCmd: "powershell Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.ps1' -OutFile 'C:/Windows/Temp/bootstrap-salt.ps1'", bootstrapRunCmd: "Powershell C:/Windows/Temp/bootstrap-salt.ps1", }, } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "salt-masterless", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{}, }, }, raws...) if err != nil { return err } if p.config.GuestOSType == "" { p.config.GuestOSType = guestexec.DefaultOSType } else { p.config.GuestOSType = strings.ToLower(p.config.GuestOSType) } var ok bool p.guestOSTypeConfig, ok = guestOSTypeConfigs[p.config.GuestOSType] if !ok { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } p.guestCommands, err = guestexec.NewGuestCommands(p.config.GuestOSType, !p.config.DisableSudo) if err != nil { return fmt.Errorf("Invalid guest_os_type: \"%s\"", p.config.GuestOSType) } if p.config.TempConfigDir == "" { p.config.TempConfigDir = p.guestOSTypeConfig.tempDir } var errs *packersdk.MultiError // require a salt state tree err = validateDirConfig(p.config.LocalStateTree, "local_state_tree", true) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } if p.config.Formulas != nil && len(p.config.Formulas) > 0 { validURLs := hasValidFormulaURLs(p.config.Formulas) if !validURLs { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Invalid formula URL. Please verify the git URLs also contain a '//' subdir")) } } err = validateDirConfig(p.config.LocalPillarRoots, "local_pillar_roots", false) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } err = validateFileConfig(p.config.MinionConfig, "minion_config", false) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } if p.config.MinionConfig != "" && (p.config.RemoteStateTree != "" || p.config.RemotePillarRoots != "") { errs = packersdk.MultiErrorAppend(errs, errors.New("remote_state_tree and remote_pillar_roots only apply when minion_config is not used")) } err = validateFileConfig(p.config.GrainsFile, "grains_file", false) if err != nil { errs = packersdk.MultiErrorAppend(errs, err) } // build the command line args to pass onto salt var cmd_args bytes.Buffer if p.config.CustomState == "" { cmd_args.WriteString(" state.highstate") } else { cmd_args.WriteString(" state.sls ") cmd_args.WriteString(p.config.CustomState) } if p.config.MinionConfig == "" { // pass --file-root and --pillar-root if no minion_config is supplied if p.config.RemoteStateTree != "" { cmd_args.WriteString(" --file-root=") cmd_args.WriteString(p.config.RemoteStateTree) } else { cmd_args.WriteString(" --file-root=") cmd_args.WriteString(p.guestOSTypeConfig.stateRoot) } if p.config.RemotePillarRoots != "" { cmd_args.WriteString(" --pillar-root=") cmd_args.WriteString(p.config.RemotePillarRoots) } else { cmd_args.WriteString(" --pillar-root=") cmd_args.WriteString(p.guestOSTypeConfig.pillarRoot) } } if !p.config.NoExitOnFailure { cmd_args.WriteString(" --retcode-passthrough") } if p.config.LogLevel == "" { cmd_args.WriteString(" -l info") } else { cmd_args.WriteString(" -l ") cmd_args.WriteString(p.config.LogLevel) } if p.config.SaltCallArgs != "" { cmd_args.WriteString(" ") cmd_args.WriteString(p.config.SaltCallArgs) } p.config.CmdArgs = cmd_args.String() if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, _ map[string]interface{}) error { var err error var src, dst string var formulas []string if p.config.Formulas != nil && len(p.config.Formulas) > 0 { ui.Say("Downloading Salt formulas...") client := new(getter.Client) for _, i := range p.config.Formulas { req := getter.Request{ Src: i, } // Use //subdirectory name when creating in local_state_tree directory state := strings.Split(i, "//") last := state[len(state)-1] path := filepath.Join(p.config.LocalStateTree, last) formulas = append(formulas, path) if _, err := os.Stat(path); os.IsNotExist(err) { ui.Message(fmt.Sprintf("%s => %s", i, path)) if err = os.Mkdir(path, 0755); err != nil { return fmt.Errorf("Unable to create Salt state directory: %s", err) } req.Dst = path req.Mode = getter.ModeAny if _, err := client.Get(ctx, &req); err != nil { return fmt.Errorf("Unable to download Salt formula from %s: %s", i, err) } } else { ui.Message(fmt.Sprintf("Found existing formula at: %s", path)) } } } ui.Say("Provisioning with Salt...") if !p.config.SkipBootstrap { cmd := &packersdk.RemoteCmd{ // Fallback on wget if curl failed for any reason (such as not being installed) Command: fmt.Sprintf(p.guestOSTypeConfig.bootstrapFetchCmd), } ui.Message(fmt.Sprintf("Downloading saltstack bootstrap to /tmp/install_salt.sh")) if err = cmd.RunWithUi(ctx, comm, ui); err != nil { return fmt.Errorf("Unable to download Salt: %s", err) } cmd = &packersdk.RemoteCmd{ Command: fmt.Sprintf("%s %s", p.sudo(p.guestOSTypeConfig.bootstrapRunCmd), p.config.BootstrapArgs), } ui.Message(fmt.Sprintf("Installing Salt with command %s", cmd.Command)) if err = cmd.RunWithUi(ctx, comm, ui); err != nil { return fmt.Errorf("Unable to install Salt: %s", err) } } ui.Message(fmt.Sprintf("Creating remote temporary directory: %s", p.config.TempConfigDir)) if err := p.createDir(ui, comm, p.config.TempConfigDir); err != nil { return fmt.Errorf("Error creating remote temporary directory: %s", err) } if p.config.MinionConfig != "" { ui.Message(fmt.Sprintf("Uploading minion config: %s", p.config.MinionConfig)) src = p.config.MinionConfig dst = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "minion")) if err = p.uploadFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading local minion config file to remote: %s", err) } // move minion config into /etc/salt ui.Message(fmt.Sprintf("Make sure directory %s exists", p.guestOSTypeConfig.configDir)) if err := p.createDir(ui, comm, p.guestOSTypeConfig.configDir); err != nil { return fmt.Errorf("Error creating remote salt configuration directory: %s", err) } src = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "minion")) dst = filepath.ToSlash(filepath.Join(p.guestOSTypeConfig.configDir, "minion")) if err = p.moveFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Unable to move %s/minion to %s/minion: %s", p.config.TempConfigDir, p.guestOSTypeConfig.configDir, err) } } if p.config.GrainsFile != "" { ui.Message(fmt.Sprintf("Uploading grains file: %s", p.config.GrainsFile)) src = p.config.GrainsFile dst = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "grains")) if err = p.uploadFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Error uploading local grains file to remote: %s", err) } // move grains file into /etc/salt ui.Message(fmt.Sprintf("Make sure directory %s exists", p.guestOSTypeConfig.configDir)) if err := p.createDir(ui, comm, p.guestOSTypeConfig.configDir); err != nil { return fmt.Errorf("Error creating remote salt configuration directory: %s", err) } src = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "grains")) dst = filepath.ToSlash(filepath.Join(p.guestOSTypeConfig.configDir, "grains")) if err = p.moveFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Unable to move %s/grains to %s/grains: %s", p.config.TempConfigDir, p.guestOSTypeConfig.configDir, err) } } ui.Message(fmt.Sprintf("Uploading local state tree: %s", p.config.LocalStateTree)) src = p.config.LocalStateTree dst = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "states")) if err = p.uploadDir(ui, comm, dst, src, []string{".git"}); err != nil { return fmt.Errorf("Error uploading local state tree to remote: %s", err) } // move state tree from temporary directory src = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "states")) if p.config.RemoteStateTree != "" { dst = p.config.RemoteStateTree } else { dst = p.guestOSTypeConfig.stateRoot } if err = p.statPath(ui, comm, dst); err != nil { if err = p.removeDir(ui, comm, dst); err != nil { return fmt.Errorf("Unable to clear salt tree: %s", err) } } if err = p.moveFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Unable to move %s/states to %s: %s", p.config.TempConfigDir, dst, err) } // Remove the local Salt formulas if present if p.config.Formulas != nil { for _, f := range formulas { if _, err := os.Stat(f); !os.IsNotExist(err) && f != p.config.LocalStateTree { ui.Message(fmt.Sprintf("Removing Salt formula: %s", f)) defer os.RemoveAll(f) } } } if p.config.LocalPillarRoots != "" { ui.Message(fmt.Sprintf("Uploading local pillar roots: %s", p.config.LocalPillarRoots)) src = p.config.LocalPillarRoots dst = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "pillar")) if err = p.uploadDir(ui, comm, dst, src, []string{".git"}); err != nil { return fmt.Errorf("Error uploading local pillar roots to remote: %s", err) } // move pillar root from temporary directory src = filepath.ToSlash(filepath.Join(p.config.TempConfigDir, "pillar")) if p.config.RemotePillarRoots != "" { dst = p.config.RemotePillarRoots } else { dst = p.guestOSTypeConfig.pillarRoot } if err = p.statPath(ui, comm, dst); err != nil { if err = p.removeDir(ui, comm, dst); err != nil { return fmt.Errorf("Unable to clear pillar root: %s", err) } } if err = p.moveFile(ui, comm, dst, src); err != nil { return fmt.Errorf("Unable to move %s/pillar to %s: %s", p.config.TempConfigDir, dst, err) } } if p.config.GuestOSType == guestexec.WindowsOSType { ui.Message("Downloading Git for Windows") cmd1 := &packersdk.RemoteCmd{Command: fmt.Sprintf("powershell [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe -OutFile $env:TEMP/Git.exe")} if err = cmd1.RunWithUi(ctx, comm, ui); (err != nil || cmd1.ExitStatus() != 0) && !p.config.NoExitOnFailure { if err == nil { err = fmt.Errorf("Bad exit status: %d", cmd1.ExitStatus()) } return fmt.Errorf("Unable to Download Git for Windows: %s", err) } ui.Message("Installing Git for Windows") cmd2 := &packersdk.RemoteCmd{Command: fmt.Sprintf("powershell Start-Process -FilePath $env:TEMP/Git.exe /SILENT -Wait")} if err = cmd2.RunWithUi(ctx, comm, ui); (err != nil || cmd2.ExitStatus() != 0) && !p.config.NoExitOnFailure { if err == nil { err = fmt.Errorf("Bad exit status: %d", cmd2.ExitStatus()) } return fmt.Errorf("Unable to Install Git for Windows: %s", err) } ui.Message("Cleaning Up After Git for Windows") cmd3 := &packersdk.RemoteCmd{Command: fmt.Sprintf("powershell Remove-Item $env:TEMP/Git.exe")} if err = cmd3.RunWithUi(ctx, comm, ui); (err != nil || cmd3.ExitStatus() != 0) && !p.config.NoExitOnFailure { if err == nil { err = fmt.Errorf("Bad exit status: %d", cmd3.ExitStatus()) } return fmt.Errorf("Unable to Clean-up After Git for Windows: %s", err) } ui.Message("Running salt-call --local winrepo.update_git_repos") cmd4 := &packersdk.RemoteCmd{Command: fmt.Sprintf("%s --local winrepo.update_git_repos", filepath.Join(p.config.SaltBinDir, "salt-call"))} if err = cmd4.RunWithUi(ctx, comm, ui); (err != nil || cmd4.ExitStatus() != 0) && !p.config.NoExitOnFailure { if err == nil { err = fmt.Errorf("Bad exit status: %d", cmd4.ExitStatus()) } return fmt.Errorf("Error executing salt-call --local winrepo.update_git_repos: %s", err) } ui.Message("Running salt-call --local pkg.refresh_db") cmd5 := &packersdk.RemoteCmd{Command: fmt.Sprintf("%s --local pkg.refresh_db", filepath.Join(p.config.SaltBinDir, "salt-call"))} if err = cmd5.RunWithUi(ctx, comm, ui); (err != nil || cmd5.ExitStatus() != 0) && !p.config.NoExitOnFailure { if err == nil { err = fmt.Errorf("Bad exit status: %d", cmd5.ExitStatus()) } return fmt.Errorf("Error executing salt-call --local pkg.refresh_db: %s", err) } } ui.Message(fmt.Sprintf("Running: salt-call --local %s", p.config.CmdArgs)) cmd := &packersdk.RemoteCmd{Command: p.sudo(fmt.Sprintf("%s --local %s", filepath.Join(p.config.SaltBinDir, "salt-call"), p.config.CmdArgs))} if err = cmd.RunWithUi(ctx, comm, ui); (err != nil || cmd.ExitStatus() != 0) && !p.config.NoExitOnFailure { if err == nil { err = fmt.Errorf("Bad exit status: %d", cmd.ExitStatus()) } return fmt.Errorf("Error executing salt-call: %s", err) } return nil } // Prepends sudo to supplied command if config says to func (p *Provisioner) sudo(cmd string) string { if p.config.DisableSudo || (p.config.GuestOSType == guestexec.WindowsOSType) { return cmd } return "sudo " + cmd } func validateDirConfig(path string, name string, required bool) error { if required && path == "" { return fmt.Errorf("%s cannot be empty", name) } else if required == false && path == "" { return nil } info, err := os.Stat(path) if err != nil { return fmt.Errorf("%s: path '%s' is invalid: %s", name, path, err) } else if !info.IsDir() { return fmt.Errorf("%s: path '%s' must point to a directory", name, path) } return nil } func validateFileConfig(path string, name string, required bool) error { if required == true && path == "" { return fmt.Errorf("%s cannot be empty", name) } else if required == false && path == "" { return nil } info, err := os.Stat(path) if err != nil { return fmt.Errorf("%s: path '%s' is invalid: %s", name, path, err) } else if info.IsDir() { return fmt.Errorf("%s: path '%s' must point to a file", name, path) } return nil } func hasValidFormulaURLs(s []string) bool { re := regexp.MustCompile(`^(.*).git\/\/[a-zA-Z0-9-_]+(\?.*)?$`) for _, u := range s { if !re.MatchString(u) { return false } } return true } func (p *Provisioner) uploadFile(ui packersdk.Ui, comm packersdk.Communicator, dst, src string) error { f, err := os.Open(src) if err != nil { return fmt.Errorf("Error opening: %s", err) } defer f.Close() _, temp_dst := filepath.Split(dst) if err = comm.Upload(temp_dst, f, nil); err != nil { return fmt.Errorf("Error uploading %s: %s", src, err) } err = p.moveFile(ui, comm, dst, temp_dst) if err != nil { return fmt.Errorf("Error moving file to destination: %s", err) } return nil } func (p *Provisioner) moveFile(ui packersdk.Ui, comm packersdk.Communicator, dst string, src string) error { ctx := context.TODO() ui.Message(fmt.Sprintf("Moving %s to %s", src, dst)) cmd := &packersdk.RemoteCmd{ Command: p.sudo(p.guestCommands.MovePath(src, dst)), } if err := cmd.RunWithUi(ctx, comm, ui); err != nil || cmd.ExitStatus() != 0 { if err == nil { err = fmt.Errorf("Bad exit status: %d", cmd.ExitStatus()) } return fmt.Errorf("Unable to move %s to %s: %s", src, dst, err) } return nil } func (p *Provisioner) createDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ui.Message(fmt.Sprintf("Creating directory: %s", dir)) cmd := &packersdk.RemoteCmd{ Command: p.guestCommands.CreateDir(dir), } ctx := context.TODO() if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status.") } return nil } func (p *Provisioner) statPath(ui packersdk.Ui, comm packersdk.Communicator, path string) error { ctx := context.TODO() ui.Message(fmt.Sprintf("Verifying Path: %s", path)) cmd := &packersdk.RemoteCmd{ Command: p.guestCommands.StatPath(path), } if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status.") } return nil } func (p *Provisioner) removeDir(ui packersdk.Ui, comm packersdk.Communicator, dir string) error { ctx := context.TODO() ui.Message(fmt.Sprintf("Removing directory: %s", dir)) cmd := &packersdk.RemoteCmd{ Command: p.guestCommands.RemoveDir(dir), } if err := cmd.RunWithUi(ctx, comm, ui); err != nil { return err } if cmd.ExitStatus() != 0 { return fmt.Errorf("Non-zero exit status.") } return nil } func (p *Provisioner) uploadDir(ui packersdk.Ui, comm packersdk.Communicator, dst, src string, ignore []string) error { _, temp_dst := filepath.Split(dst) if err := comm.UploadDir(temp_dst, src, ignore); err != nil { return err } return p.moveFile(ui, comm, dst, temp_dst) } ������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/salt-masterless/provisioner.hcl2spec.go��������������������������������0000664�0000000�0000000�00000014704�13771713062�0025603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package saltmasterless import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` SkipBootstrap *bool `mapstructure:"skip_bootstrap" cty:"skip_bootstrap" hcl:"skip_bootstrap"` BootstrapArgs *string `mapstructure:"bootstrap_args" cty:"bootstrap_args" hcl:"bootstrap_args"` DisableSudo *bool `mapstructure:"disable_sudo" cty:"disable_sudo" hcl:"disable_sudo"` CustomState *string `mapstructure:"custom_state" cty:"custom_state" hcl:"custom_state"` MinionConfig *string `mapstructure:"minion_config" cty:"minion_config" hcl:"minion_config"` GrainsFile *string `mapstructure:"grains_file" cty:"grains_file" hcl:"grains_file"` LocalStateTree *string `mapstructure:"local_state_tree" cty:"local_state_tree" hcl:"local_state_tree"` LocalPillarRoots *string `mapstructure:"local_pillar_roots" cty:"local_pillar_roots" hcl:"local_pillar_roots"` RemoteStateTree *string `mapstructure:"remote_state_tree" cty:"remote_state_tree" hcl:"remote_state_tree"` RemotePillarRoots *string `mapstructure:"remote_pillar_roots" cty:"remote_pillar_roots" hcl:"remote_pillar_roots"` TempConfigDir *string `mapstructure:"temp_config_dir" cty:"temp_config_dir" hcl:"temp_config_dir"` NoExitOnFailure *bool `mapstructure:"no_exit_on_failure" cty:"no_exit_on_failure" hcl:"no_exit_on_failure"` LogLevel *string `mapstructure:"log_level" cty:"log_level" hcl:"log_level"` SaltCallArgs *string `mapstructure:"salt_call_args" cty:"salt_call_args" hcl:"salt_call_args"` SaltBinDir *string `mapstructure:"salt_bin_dir" cty:"salt_bin_dir" hcl:"salt_bin_dir"` GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type" hcl:"guest_os_type"` Formulas []string `mapstructure:"formulas" cty:"formulas" hcl:"formulas"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "skip_bootstrap": &hcldec.AttrSpec{Name: "skip_bootstrap", Type: cty.Bool, Required: false}, "bootstrap_args": &hcldec.AttrSpec{Name: "bootstrap_args", Type: cty.String, Required: false}, "disable_sudo": &hcldec.AttrSpec{Name: "disable_sudo", Type: cty.Bool, Required: false}, "custom_state": &hcldec.AttrSpec{Name: "custom_state", Type: cty.String, Required: false}, "minion_config": &hcldec.AttrSpec{Name: "minion_config", Type: cty.String, Required: false}, "grains_file": &hcldec.AttrSpec{Name: "grains_file", Type: cty.String, Required: false}, "local_state_tree": &hcldec.AttrSpec{Name: "local_state_tree", Type: cty.String, Required: false}, "local_pillar_roots": &hcldec.AttrSpec{Name: "local_pillar_roots", Type: cty.String, Required: false}, "remote_state_tree": &hcldec.AttrSpec{Name: "remote_state_tree", Type: cty.String, Required: false}, "remote_pillar_roots": &hcldec.AttrSpec{Name: "remote_pillar_roots", Type: cty.String, Required: false}, "temp_config_dir": &hcldec.AttrSpec{Name: "temp_config_dir", Type: cty.String, Required: false}, "no_exit_on_failure": &hcldec.AttrSpec{Name: "no_exit_on_failure", Type: cty.Bool, Required: false}, "log_level": &hcldec.AttrSpec{Name: "log_level", Type: cty.String, Required: false}, "salt_call_args": &hcldec.AttrSpec{Name: "salt_call_args", Type: cty.String, Required: false}, "salt_bin_dir": &hcldec.AttrSpec{Name: "salt_bin_dir", Type: cty.String, Required: false}, "guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false}, "formulas": &hcldec.AttrSpec{Name: "formulas", Type: cty.List(cty.String), Required: false}, } return s } ������������������������������������������������������������packer-1.6.6+ds1/provisioner/salt-masterless/provisioner_test.go������������������������������������0000664�0000000�0000000�00000017306�13771713062�0025141�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package saltmasterless import ( "io/ioutil" "os" "strings" "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "local_state_tree": os.TempDir(), } } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.TempConfigDir != p.guestOSTypeConfig.tempDir { t.Errorf("unexpected temp config dir: %s", p.config.TempConfigDir) } } func TestProvisionerPrepare_InvalidKey(t *testing.T) { var p Provisioner config := testConfig() // Add a random key config["i_should_not_be_valid"] = true err := p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_CustomState(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "state.") { t.Fatal("a state should be specified in CmdArgs") } config["custom_state"] = "birb" err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "state.sls birb") { t.Fatal("birb state should be specified in CmdArgs") } } func TestProvisionerPrepare_MinionConfig(t *testing.T) { var p Provisioner config := testConfig() config["minion_config"] = "/i/dont/exist/i/think" err := p.Prepare(config) if err == nil { t.Fatal("should have error") } tf, err := ioutil.TempFile("", "minion") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["minion_config"] = tf.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_MinionConfig_RemoteStateTree(t *testing.T) { var p Provisioner config := testConfig() config["minion_config"] = "/i/dont/exist/i/think" config["remote_state_tree"] = "/i/dont/exist/remote_state_tree" err := p.Prepare(config) if err == nil { t.Fatal("minion_config and remote_state_tree should cause error") } } func TestProvisionerPrepare_MinionConfig_RemotePillarRoots(t *testing.T) { var p Provisioner config := testConfig() config["minion_config"] = "/i/dont/exist/i/think" config["remote_pillar_roots"] = "/i/dont/exist/remote_pillar_roots" err := p.Prepare(config) if err == nil { t.Fatal("minion_config and remote_pillar_roots should cause error") } } func TestProvisionerPrepare_GrainsFile(t *testing.T) { var p Provisioner config := testConfig() config["grains_file"] = "/i/dont/exist/i/think" err := p.Prepare(config) if err == nil { t.Fatal("should have error") } tf, err := ioutil.TempFile("", "grains") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["grains_file"] = tf.Name() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_LocalStateTree(t *testing.T) { var p Provisioner config := testConfig() config["local_state_tree"] = "/i/dont/exist/i/think" err := p.Prepare(config) if err == nil { t.Fatal("should have error") } config["local_state_tree"] = os.TempDir() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerPrepare_LocalPillarRoots(t *testing.T) { var p Provisioner config := testConfig() config["local_pillar_roots"] = "/i/dont/exist/i/think" err := p.Prepare(config) if err == nil { t.Fatal("should have error") } config["local_pillar_roots"] = os.TempDir() err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } } func TestProvisionerSudo(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } withSudo := p.sudo("echo hello") if withSudo != "sudo echo hello" { t.Fatalf("sudo command not generated correctly") } config["disable_sudo"] = true err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } withoutSudo := p.sudo("echo hello") if withoutSudo != "echo hello" { t.Fatalf("sudo-less command not generated correctly") } } func TestProvisionerPrepare_RemoteStateTree(t *testing.T) { var p Provisioner config := testConfig() config["remote_state_tree"] = "/remote_state_tree" err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "--file-root=/remote_state_tree") { t.Fatal("--file-root should be set in CmdArgs") } } func TestProvisionerPrepare_RemotePillarRoots(t *testing.T) { var p Provisioner config := testConfig() config["remote_pillar_roots"] = "/remote_pillar_roots" err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "--pillar-root=/remote_pillar_roots") { t.Fatal("--pillar-root should be set in CmdArgs") } } func TestProvisionerPrepare_RemoteStateTree_Default(t *testing.T) { var p Provisioner config := testConfig() // no minion_config, no remote_state_tree err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "--file-root=/srv/salt") { t.Fatal("--file-root should be set in CmdArgs") } } func TestProvisionerPrepare_RemotePillarRoots_Default(t *testing.T) { var p Provisioner config := testConfig() // no minion_config, no remote_pillar_roots err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "--pillar-root=/srv/pillar") { t.Fatal("--pillar-root should be set in CmdArgs") } } func TestProvisionerPrepare_NoExitOnFailure(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "--retcode-passthrough") { t.Fatal("--retcode-passthrough should be set in CmdArgs") } config["no_exit_on_failure"] = true err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if strings.Contains(p.config.CmdArgs, "--retcode-passthrough") { t.Fatal("--retcode-passthrough should not be set in CmdArgs") } } func TestProvisionerPrepare_LogLevel(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "-l info") { t.Fatal("-l info should be set in CmdArgs") } config["log_level"] = "debug" err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if !strings.Contains(p.config.CmdArgs, "-l debug") { t.Fatal("-l debug should be set in CmdArgs") } } func TestProvisionerPrepare_GuestOSType(t *testing.T) { var p Provisioner config := testConfig() config["guest_os_type"] = "Windows" err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.GuestOSType != "windows" { t.Fatalf("GuestOSType should be 'windows'") } } func TestProvisionerPrepare_BadFormulaURL(t *testing.T) { var p Provisioner config := testConfig() config["formulas"] = []string{ "git::https://github.com/org/some-formula.git//", } err := p.Prepare(config) if err == nil { t.Fatalf("Expected invalid formula URL: %s", err) } } func TestProvisionerPrepare_ValidFormulaURLs(t *testing.T) { var p Provisioner config := testConfig() config["formulas"] = []string{ "git::https://github.com/org/some-formula.git//example", "git@github.com:org/some-formula.git//example", "git::https://github.com/org/some-formula.git//example?ref=example", } err := p.Prepare(config) if err != nil { t.Fatalf("Unexpected error in formula URLs: %s", err) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/salt-masterless/version/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022652�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/salt-masterless/version/version.go�������������������������������������0000664�0000000�0000000�00000000471�13771713062�0024670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var SaltPluginVersion *version.PluginVersion func init() { SaltPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020241�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/provisioner.go���������������������������������������������0000664�0000000�0000000�00000001420�13771713062�0023144�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import ( "context" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" sl "github.com/hashicorp/packer/packer-plugin-sdk/shell-local" ) type Provisioner struct { config sl.Config } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := sl.Decode(&p.config, raws...) if err != nil { return err } err = sl.Validate(&p.config) if err != nil { return err } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, _ packersdk.Communicator, generatedData map[string]interface{}) error { _, retErr := sl.Run(ctx, ui, &p.config, generatedData) return retErr } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/provisioner_acc_test.go������������������������������������0000664�0000000�0000000�00000003617�13771713062�0025023�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_test import ( "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "strings" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/provisioneracc" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/testutils" ) func fixtureDir() string { _, file, _, _ := runtime.Caller(0) return filepath.Join(filepath.Dir(file), "test-fixtures") } func loadFile(templateFragmentPath string) (string, error) { dir := fixtureDir() fragmentAbsPath := filepath.Join(dir, templateFragmentPath) fragmentFile, err := os.Open(fragmentAbsPath) if err != nil { return "", fmt.Errorf("Unable find %s", fragmentAbsPath) } defer fragmentFile.Close() fragmentString, err := ioutil.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } return string(fragmentString), nil } func IsCompatible(builder string, vmOS string) bool { return vmOS == "linux" } func TestAccShellProvisioner_basic(t *testing.T) { templateString, err := loadFile("shell-local-provisioner.txt") if err != nil { t.Fatalf("Couldn't load test fixture; %s", err.Error()) } testCase := &provisioneracc.ProvisionerTestCase{ IsCompatible: IsCompatible, Name: "shell-local-provisioner-basic", Teardown: func() error { testutils.CleanupFiles("test-fixtures/file.txt") return nil }, Template: templateString, Type: "shell-local", Check: func(buildcommand *exec.Cmd, logfile string) error { if buildcommand.ProcessState != nil { if buildcommand.ProcessState.ExitCode() != 0 { return fmt.Errorf("Bad exit code. Logfile: %s\n", logfile) } } filecontents, err := loadFile("file.txt") if err != nil { return err } if !strings.Contains(filecontents, "hello") { return fmt.Errorf("file contents were wrong: %s", filecontents) } return nil }, } provisioneracc.TestProvisionersAgainstBuilders(testCase, t) } �����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/provisioner_test.go����������������������������������������0000664�0000000�0000000�00000001762�13771713062�0024214�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import ( "testing" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func TestProvisioner_impl(t *testing.T) { var _ packersdk.Provisioner = new(Provisioner) } func TestConfigPrepare(t *testing.T) { cases := []struct { Key string Value interface{} Err bool }{ { "unknown_key", "bad", true, }, { "command", nil, true, }, } for _, tc := range cases { raw := testConfig(t) if tc.Value == nil { delete(raw, tc.Key) } else { raw[tc.Key] = tc.Value } var p Provisioner err := p.Prepare(raw) if tc.Err { testConfigErr(t, err, tc.Key) } else { testConfigOk(t, err) } } } func testConfig(t *testing.T) map[string]interface{} { return map[string]interface{}{ "command": "echo foo", } } func testConfigErr(t *testing.T, err error, extra string) { if err == nil { t.Fatalf("should error: %s", extra) } } func testConfigOk(t *testing.T, err error) { if err != nil { t.Fatalf("bad: %s", err) } } ��������������packer-1.6.6+ds1/provisioner/shell-local/test-fixtures/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023067�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/test-fixtures/script.sh������������������������������������0000775�0000000�0000000�00000000240�13771713062�0024726�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/bash # On first try, exits 1; on second try, passes. if [[ ! -f test-fixtures/file.txt ]] ; then echo 'hello' > test-fixtures/file.txt exit 1 fi����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/test-fixtures/shell-local-provisioner.txt������������������0000664�0000000�0000000�00000000135�13771713062�0030403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "type": "shell-local", "script": "test-fixtures/script.sh", "max_retries" : 5 }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/version/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021726�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell-local/version/version.go�����������������������������������������0000664�0000000�0000000�00000000517�13771713062�0023745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ShellLocalProvisionerVersion *version.PluginVersion func init() { ShellLocalProvisionerVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017151�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/provisioner.go���������������������������������������������������0000664�0000000�0000000�00000032241�13771713062�0022061�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that executes // shell scripts within the remote machine. package shell import ( "bufio" "context" "errors" "fmt" "io" "log" "math/rand" "os" "sort" "strings" "time" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" "github.com/hashicorp/packer/packer-plugin-sdk/shell" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) type Config struct { shell.Provisioner `mapstructure:",squash"` shell.ProvisionerRemoteSpecific `mapstructure:",squash"` // The shebang value used when running inline scripts. InlineShebang string `mapstructure:"inline_shebang"` // A duration of how long to pause after the provisioner PauseAfter time.Duration `mapstructure:"pause_after"` // Write the Vars to a file and source them from there rather than declaring // inline UseEnvVarFile bool `mapstructure:"use_env_var_file"` // The remote folder where the local shell script will be uploaded to. // This should be set to a pre-existing directory, it defaults to /tmp RemoteFolder string `mapstructure:"remote_folder"` // The remote file name of the local shell script. // This defaults to script_nnn.sh RemoteFile string `mapstructure:"remote_file"` // The timeout for retrying to start the process. Until this timeout // is reached, if the provisioner can't start a process, it retries. // This can be set high to allow for reboots. StartRetryTimeout time.Duration `mapstructure:"start_retry_timeout"` // Whether to clean scripts up SkipClean bool `mapstructure:"skip_clean"` ExpectDisconnect bool `mapstructure:"expect_disconnect"` // name of the tmp environment variable file, if UseEnvVarFile is true envVarFile string ctx interpolate.Context } type Provisioner struct { config Config generatedData map[string]interface{} } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "shell", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", }, }, }, raws...) if err != nil { return err } if p.config.EnvVarFormat == "" { p.config.EnvVarFormat = "%s='%s' " if p.config.UseEnvVarFile == true { p.config.EnvVarFormat = "export %s='%s'\n" } } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = "chmod +x {{.Path}}; {{.Vars}} {{.Path}}" if p.config.UseEnvVarFile == true { p.config.ExecuteCommand = "chmod +x {{.Path}}; . {{.EnvVarFile}} && {{.Path}}" } } if p.config.Inline != nil && len(p.config.Inline) == 0 { p.config.Inline = nil } if p.config.InlineShebang == "" { p.config.InlineShebang = "/bin/sh -e" } if p.config.StartRetryTimeout == 0 { p.config.StartRetryTimeout = 5 * time.Minute } if p.config.RemoteFolder == "" { p.config.RemoteFolder = "/tmp" } if p.config.RemoteFile == "" { p.config.RemoteFile = fmt.Sprintf("script_%d.sh", rand.Intn(9999)) } if p.config.RemotePath == "" { p.config.RemotePath = fmt.Sprintf("%s/%s", p.config.RemoteFolder, p.config.RemoteFile) } if p.config.Scripts == nil { p.config.Scripts = make([]string, 0) } if p.config.Vars == nil { p.config.Vars = make([]string, 0) } var errs *packersdk.MultiError if p.config.Script != "" && len(p.config.Scripts) > 0 { errs = packersdk.MultiErrorAppend(errs, errors.New("Only one of script or scripts can be specified.")) } if p.config.Script != "" { p.config.Scripts = []string{p.config.Script} } if len(p.config.Scripts) == 0 && p.config.Inline == nil { errs = packersdk.MultiErrorAppend(errs, errors.New("Either a script file or inline script must be specified.")) } else if len(p.config.Scripts) > 0 && p.config.Inline != nil { errs = packersdk.MultiErrorAppend(errs, errors.New("Only a script file or an inline script can be specified, not both.")) } for _, path := range p.config.Scripts { if _, err := os.Stat(path); err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Bad script '%s': %s", path, err)) } } // Do a check for bad environment variables, such as '=foo', 'foobar' for _, kv := range p.config.Vars { vs := strings.SplitN(kv, "=", 2) if len(vs) != 2 || vs[0] == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Environment variable not in format 'key=value': %s", kv)) } } if errs != nil && len(errs.Errors) > 0 { return errs } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { if generatedData == nil { generatedData = make(map[string]interface{}) } p.generatedData = generatedData scripts := make([]string, len(p.config.Scripts)) copy(scripts, p.config.Scripts) // If we have an inline script, then turn that into a temporary // shell script and use that. if p.config.Inline != nil { tf, err := tmp.File("packer-shell") if err != nil { return fmt.Errorf("Error preparing shell script: %s", err) } defer os.Remove(tf.Name()) // Set the path to the temporary file scripts = append(scripts, tf.Name()) // Write our contents to it writer := bufio.NewWriter(tf) writer.WriteString(fmt.Sprintf("#!%s\n", p.config.InlineShebang)) for _, command := range p.config.Inline { p.config.ctx.Data = generatedData command, err := interpolate.Render(command, &p.config.ctx) if err != nil { return fmt.Errorf("Error interpolating Inline: %s", err) } if _, err := writer.WriteString(command + "\n"); err != nil { return fmt.Errorf("Error preparing shell script: %s", err) } } if err := writer.Flush(); err != nil { return fmt.Errorf("Error preparing shell script: %s", err) } tf.Close() } if p.config.UseEnvVarFile == true { tf, err := tmp.File("packer-shell-vars") if err != nil { return fmt.Errorf("Error preparing shell script: %s", err) } defer os.Remove(tf.Name()) // Write our contents to it writer := bufio.NewWriter(tf) if _, err := writer.WriteString(p.createEnvVarFileContent()); err != nil { return fmt.Errorf("Error preparing shell script: %s", err) } if err := writer.Flush(); err != nil { return fmt.Errorf("Error preparing shell script: %s", err) } p.config.envVarFile = tf.Name() // upload the var file var cmd *packersdk.RemoteCmd err = retry.Config{StartTimeout: p.config.StartRetryTimeout}.Run(ctx, func(ctx context.Context) error { if _, err := tf.Seek(0, 0); err != nil { return err } var r io.Reader = tf if !p.config.Binary { r = &UnixReader{Reader: r} } remoteVFName := fmt.Sprintf("%s/%s", p.config.RemoteFolder, fmt.Sprintf("varfile_%d.sh", rand.Intn(9999))) if err := comm.Upload(remoteVFName, r, nil); err != nil { return fmt.Errorf("Error uploading envVarFile: %s", err) } tf.Close() cmd = &packersdk.RemoteCmd{ Command: fmt.Sprintf("chmod 0600 %s", remoteVFName), } if err := comm.Start(ctx, cmd); err != nil { return fmt.Errorf("Error chmodding script file to 0600 in remote machine: %s", err) } cmd.Wait() p.config.envVarFile = remoteVFName return nil }) if err != nil { return err } } // Create environment variables to set before executing the command flattenedEnvVars := p.createFlattenedEnvVars() for _, path := range scripts { ui.Say(fmt.Sprintf("Provisioning with shell script: %s", path)) log.Printf("Opening %s for reading", path) f, err := os.Open(path) if err != nil { return fmt.Errorf("Error opening shell script: %s", err) } defer f.Close() // Compile the command // These are extra variables that will be made available for interpolation. generatedData["Vars"] = flattenedEnvVars generatedData["EnvVarFile"] = p.config.envVarFile generatedData["Path"] = p.config.RemotePath p.config.ctx.Data = generatedData command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return fmt.Errorf("Error processing command: %s", err) } // Upload the file and run the command. Do this in the context of // a single retryable function so that we don't end up with // the case that the upload succeeded, a restart is initiated, // and then the command is executed but the file doesn't exist // any longer. var cmd *packersdk.RemoteCmd err = retry.Config{StartTimeout: p.config.StartRetryTimeout}.Run(ctx, func(ctx context.Context) error { if _, err := f.Seek(0, 0); err != nil { return err } var r io.Reader = f if !p.config.Binary { r = &UnixReader{Reader: r} } if err := comm.Upload(p.config.RemotePath, r, nil); err != nil { return fmt.Errorf("Error uploading script: %s", err) } cmd = &packersdk.RemoteCmd{ Command: fmt.Sprintf("chmod 0755 %s", p.config.RemotePath), } if err := comm.Start(ctx, cmd); err != nil { return fmt.Errorf( "Error chmodding script file to 0755 in remote "+ "machine: %s", err) } cmd.Wait() cmd = &packersdk.RemoteCmd{Command: command} return cmd.RunWithUi(ctx, comm, ui) }) if err != nil { return err } // If the exit code indicates a remote disconnect, fail unless // we were expecting it. if cmd.ExitStatus() == packersdk.CmdDisconnect { if !p.config.ExpectDisconnect { return fmt.Errorf("Script disconnected unexpectedly. " + "If you expected your script to disconnect, i.e. from a " + "restart, you can try adding `\"expect_disconnect\": true` " + "or `\"valid_exit_codes\": [0, 2300218]` to the shell " + "provisioner parameters.") } } else if err := p.config.ValidExitCode(cmd.ExitStatus()); err != nil { return err } if p.config.SkipClean { continue } // Delete the temporary file we created. We retry this a few times // since if the above rebooted we have to wait until the reboot // completes. if err := p.cleanupRemoteFile(p.config.RemotePath, comm); err != nil { return err } } if !p.config.SkipClean { if err := p.cleanupRemoteFile(p.config.envVarFile, comm); err != nil { return err } } if p.config.PauseAfter != 0 { ui.Say(fmt.Sprintf("Pausing %s after this provisioner...", p.config.PauseAfter)) select { case <-time.After(p.config.PauseAfter): return nil } } return nil } func (p *Provisioner) cleanupRemoteFile(path string, comm packersdk.Communicator) error { ctx := context.TODO() err := retry.Config{StartTimeout: p.config.StartRetryTimeout}.Run(ctx, func(ctx context.Context) error { cmd := &packersdk.RemoteCmd{ Command: fmt.Sprintf("rm -f %s", path), } if err := comm.Start(ctx, cmd); err != nil { return fmt.Errorf( "Error removing temporary script at %s: %s", path, err) } cmd.Wait() // treat disconnects as retryable by returning an error if cmd.ExitStatus() == packersdk.CmdDisconnect { return fmt.Errorf("Disconnect while removing temporary script.") } if cmd.ExitStatus() != 0 { return fmt.Errorf( "Error removing temporary script at %s!", path) } return nil }) if err != nil { return err } return nil } func (p *Provisioner) escapeEnvVars() ([]string, map[string]string) { envVars := make(map[string]string) // Always available Packer provided env vars envVars["PACKER_BUILD_NAME"] = p.config.PackerBuildName envVars["PACKER_BUILDER_TYPE"] = p.config.PackerBuilderType // expose ip address variables httpAddr := p.generatedData["PackerHTTPAddr"] if httpAddr != nil && httpAddr != commonsteps.HttpAddrNotImplemented { envVars["PACKER_HTTP_ADDR"] = httpAddr.(string) } httpIP := p.generatedData["PackerHTTPIP"] if httpIP != nil && httpIP != commonsteps.HttpIPNotImplemented { envVars["PACKER_HTTP_IP"] = httpIP.(string) } httpPort := p.generatedData["PackerHTTPPort"] if httpPort != nil && httpPort != commonsteps.HttpPortNotImplemented { envVars["PACKER_HTTP_PORT"] = httpPort.(string) } // Split vars into key/value components for _, envVar := range p.config.Vars { keyValue := strings.SplitN(envVar, "=", 2) // Store pair, replacing any single quotes in value so they parse // correctly with required environment variable format envVars[keyValue[0]] = strings.Replace(keyValue[1], "'", `'"'"'`, -1) } // Create a list of env var keys in sorted order var keys []string for k := range envVars { keys = append(keys, k) } sort.Strings(keys) return keys, envVars } func (p *Provisioner) createEnvVarFileContent() string { keys, envVars := p.escapeEnvVars() var flattened string for _, key := range keys { flattened += fmt.Sprintf(p.config.EnvVarFormat, key, envVars[key]) } return flattened } func (p *Provisioner) createFlattenedEnvVars() string { keys, envVars := p.escapeEnvVars() // Re-assemble vars into specified format and flatten var flattened string for _, key := range keys { flattened += fmt.Sprintf(p.config.EnvVarFormat, key, envVars[key]) } return flattened } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/provisioner.hcl2spec.go������������������������������������������0000664�0000000�0000000�00000014422�13771713062�0023564�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package shell import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Inline []string `cty:"inline" hcl:"inline"` Script *string `cty:"script" hcl:"script"` Scripts []string `cty:"scripts" hcl:"scripts"` ValidExitCodes []int `mapstructure:"valid_exit_codes" cty:"valid_exit_codes" hcl:"valid_exit_codes"` Vars []string `mapstructure:"environment_vars" cty:"environment_vars" hcl:"environment_vars"` EnvVarFormat *string `mapstructure:"env_var_format" cty:"env_var_format" hcl:"env_var_format"` Binary *bool `cty:"binary" hcl:"binary"` RemotePath *string `mapstructure:"remote_path" cty:"remote_path" hcl:"remote_path"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` InlineShebang *string `mapstructure:"inline_shebang" cty:"inline_shebang" hcl:"inline_shebang"` PauseAfter *string `mapstructure:"pause_after" cty:"pause_after" hcl:"pause_after"` UseEnvVarFile *bool `mapstructure:"use_env_var_file" cty:"use_env_var_file" hcl:"use_env_var_file"` RemoteFolder *string `mapstructure:"remote_folder" cty:"remote_folder" hcl:"remote_folder"` RemoteFile *string `mapstructure:"remote_file" cty:"remote_file" hcl:"remote_file"` StartRetryTimeout *string `mapstructure:"start_retry_timeout" cty:"start_retry_timeout" hcl:"start_retry_timeout"` SkipClean *bool `mapstructure:"skip_clean" cty:"skip_clean" hcl:"skip_clean"` ExpectDisconnect *bool `mapstructure:"expect_disconnect" cty:"expect_disconnect" hcl:"expect_disconnect"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "inline": &hcldec.AttrSpec{Name: "inline", Type: cty.List(cty.String), Required: false}, "script": &hcldec.AttrSpec{Name: "script", Type: cty.String, Required: false}, "scripts": &hcldec.AttrSpec{Name: "scripts", Type: cty.List(cty.String), Required: false}, "valid_exit_codes": &hcldec.AttrSpec{Name: "valid_exit_codes", Type: cty.List(cty.Number), Required: false}, "environment_vars": &hcldec.AttrSpec{Name: "environment_vars", Type: cty.List(cty.String), Required: false}, "env_var_format": &hcldec.AttrSpec{Name: "env_var_format", Type: cty.String, Required: false}, "binary": &hcldec.AttrSpec{Name: "binary", Type: cty.Bool, Required: false}, "remote_path": &hcldec.AttrSpec{Name: "remote_path", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "inline_shebang": &hcldec.AttrSpec{Name: "inline_shebang", Type: cty.String, Required: false}, "pause_after": &hcldec.AttrSpec{Name: "pause_after", Type: cty.String, Required: false}, "use_env_var_file": &hcldec.AttrSpec{Name: "use_env_var_file", Type: cty.Bool, Required: false}, "remote_folder": &hcldec.AttrSpec{Name: "remote_folder", Type: cty.String, Required: false}, "remote_file": &hcldec.AttrSpec{Name: "remote_file", Type: cty.String, Required: false}, "start_retry_timeout": &hcldec.AttrSpec{Name: "start_retry_timeout", Type: cty.String, Required: false}, "skip_clean": &hcldec.AttrSpec{Name: "skip_clean", Type: cty.Bool, Required: false}, "expect_disconnect": &hcldec.AttrSpec{Name: "expect_disconnect", Type: cty.Bool, Required: false}, } return s } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/provisioner_acc_test.go������������������������������������������0000664�0000000�0000000�00000004021�13771713062�0023721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell_test import ( "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "regexp" "runtime" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/provisioneracc" "github.com/hashicorp/packer/packer-plugin-sdk/acctest/testutils" ) func fixtureDir() string { _, file, _, _ := runtime.Caller(0) return filepath.Join(filepath.Dir(file), "test-fixtures") } func loadFile(templateFragmentPath string) (string, error) { dir := fixtureDir() fragmentAbsPath := filepath.Join(dir, templateFragmentPath) fragmentFile, err := os.Open(fragmentAbsPath) if err != nil { return "", fmt.Errorf("Unable find %s", fragmentAbsPath) } defer fragmentFile.Close() fragmentString, err := ioutil.ReadAll(fragmentFile) if err != nil { return "", fmt.Errorf("Unable to read %s", fragmentAbsPath) } return string(fragmentString), nil } func IsCompatible(builder string, vmOS string) bool { return vmOS == "linux" } func TestAccShellProvisioner_basic(t *testing.T) { templateString, err := loadFile("shell-provisioner.txt") if err != nil { t.Fatalf("Couldn't load test fixture; %s", err.Error()) } testCase := &provisioneracc.ProvisionerTestCase{ IsCompatible: IsCompatible, Name: "shell-provisioner-basic", Teardown: func() error { testutils.CleanupFiles("test-fixtures/provisioner.shell.txt") return nil }, Template: templateString, Type: "shell", Check: func(buildcommand *exec.Cmd, logfile string) error { if buildcommand.ProcessState != nil { if buildcommand.ProcessState.ExitCode() != 0 { return fmt.Errorf("Bad exit code. Logfile: %s", logfile) } } filecontents, err := loadFile("provisioner.shell.txt") if err != nil { return err } re := regexp.MustCompile(`build ID is .* and build UUID is [[:alnum:]]{8}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{4}-[[:alnum:]]{12}`) if !re.MatchString(filecontents) { return fmt.Errorf("Bad file contents \"%s\"", filecontents) } return nil }, } provisioneracc.TestProvisionersAgainstBuilders(testCase, t) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/provisioner_test.go����������������������������������������������0000664�0000000�0000000�00000034762�13771713062�0023132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import ( "io/ioutil" "os" "regexp" "strings" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "inline": []interface{}{"foo", "bar"}, } } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ExpectDisconnect != false { t.Errorf("expected ExpectDisconnect to default to false") } if p.config.RemotePath == "" { t.Errorf("unexpected remote path: %s", p.config.RemotePath) } } func TestProvisionerPrepare_ExpectDisconnect(t *testing.T) { config := testConfig() p := new(Provisioner) config["expect_disconnect"] = false err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ExpectDisconnect != false { t.Errorf("expected ExpectDisconnect to be false") } config["expect_disconnect"] = true p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.ExpectDisconnect != true { t.Errorf("expected ExpectDisconnect to be true") } } func TestProvisionerPrepare_InlineShebang(t *testing.T) { config := testConfig() delete(config, "inline_shebang") p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } if p.config.InlineShebang != "/bin/sh -e" { t.Fatalf("bad value: %s", p.config.InlineShebang) } // Test with a good one config["inline_shebang"] = "foo" p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } if p.config.InlineShebang != "foo" { t.Fatalf("bad value: %s", p.config.InlineShebang) } } func TestProvisionerPrepare_InvalidKey(t *testing.T) { var p Provisioner config := testConfig() // Add a random key config["i_should_not_be_valid"] = true err := p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_Script(t *testing.T) { config := testConfig() delete(config, "inline") config["script"] = "/this/should/not/exist" p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["script"] = tf.Name() p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { var p Provisioner config := testConfig() delete(config, "inline") delete(config, "script") err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["inline"] = []interface{}{"foo"} config["script"] = tf.Name() err = p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { var p Provisioner config := testConfig() // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["inline"] = []interface{}{"foo"} config["scripts"] = []string{tf.Name()} err = p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_Scripts(t *testing.T) { config := testConfig() delete(config, "inline") config["scripts"] = []string{} p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) config["scripts"] = []string{tf.Name()} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerPrepare_EnvironmentVars(t *testing.T) { config := testConfig() // Test with a bad case config["environment_vars"] = []string{"badvar", "good=var"} p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a trickier case config["environment_vars"] = []string{"=bad"} p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good case // Note: baz= is a real env variable, just empty config["environment_vars"] = []string{"FOO=bar", "baz="} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value contains an equals sign config["environment_vars"] = []string{"good=withequals=true"} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value starts with an equals sign config["environment_vars"] = []string{"good==true"} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisioner_createFlattenedEnvVars(t *testing.T) { var flattenedEnvVars string config := testConfig() userEnvVarTests := [][]string{ {}, // No user env var {"FOO=bar"}, // Single user env var {"FOO=bar's"}, // User env var with single quote in value {"FOO=bar", "BAZ=qux"}, // Multiple user env vars {"FOO=bar=baz"}, // User env var with value containing equals {"FOO==bar"}, // User env var with value starting with equals } expected := []string{ `PACKER_BUILDER_TYPE='iso' PACKER_BUILD_NAME='vmware' `, `FOO='bar' PACKER_BUILDER_TYPE='iso' PACKER_BUILD_NAME='vmware' `, `FOO='bar'"'"'s' PACKER_BUILDER_TYPE='iso' PACKER_BUILD_NAME='vmware' `, `BAZ='qux' FOO='bar' PACKER_BUILDER_TYPE='iso' PACKER_BUILD_NAME='vmware' `, `FOO='bar=baz' PACKER_BUILDER_TYPE='iso' PACKER_BUILD_NAME='vmware' `, `FOO='=bar' PACKER_BUILDER_TYPE='iso' PACKER_BUILD_NAME='vmware' `, } p := new(Provisioner) p.generatedData = generatedData() p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" for i, expectedValue := range expected { p.config.Vars = userEnvVarTests[i] flattenedEnvVars = p.createFlattenedEnvVars() if flattenedEnvVars != expectedValue { t.Fatalf("expected flattened env vars to be: %s, got %s.", expectedValue, flattenedEnvVars) } } } func TestProvisioner_createFlattenedEnvVars_withEnvVarFormat(t *testing.T) { var flattenedEnvVars string config := testConfig() userEnvVarTests := [][]string{ {}, // No user env var {"FOO=bar"}, // Single user env var {"FOO=bar's"}, // User env var with single quote in value {"FOO=bar", "BAZ=qux"}, // Multiple user env vars {"FOO=bar=baz"}, // User env var with value containing equals {"FOO==bar"}, // User env var with value starting with equals } expected := []string{ `PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `FOO=bar PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `FOO=bar'"'"'s PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `BAZ=qux FOO=bar PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `FOO=bar=baz PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `FOO==bar PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, } p := new(Provisioner) p.generatedData = generatedData() p.config.EnvVarFormat = "%s=%s " p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" for i, expectedValue := range expected { p.config.Vars = userEnvVarTests[i] flattenedEnvVars = p.createFlattenedEnvVars() if flattenedEnvVars != expectedValue { t.Fatalf("expected flattened env vars to be: %s, got %s.", expectedValue, flattenedEnvVars) } } } func TestProvisioner_createEnvVarFileContent(t *testing.T) { var flattenedEnvVars string config := testConfig() userEnvVarTests := [][]string{ {}, // No user env var {"FOO=bar"}, // Single user env var {"FOO=bar's"}, // User env var with single quote in value {"FOO=bar", "BAZ=qux"}, // Multiple user env vars {"FOO=bar=baz"}, // User env var with value containing equals {"FOO==bar"}, // User env var with value starting with equals } expected := []string{ `export PACKER_BUILDER_TYPE='iso' export PACKER_BUILD_NAME='vmware' `, `export FOO='bar' export PACKER_BUILDER_TYPE='iso' export PACKER_BUILD_NAME='vmware' `, `export FOO='bar'"'"'s' export PACKER_BUILDER_TYPE='iso' export PACKER_BUILD_NAME='vmware' `, `export BAZ='qux' export FOO='bar' export PACKER_BUILDER_TYPE='iso' export PACKER_BUILD_NAME='vmware' `, `export FOO='bar=baz' export PACKER_BUILDER_TYPE='iso' export PACKER_BUILD_NAME='vmware' `, `export FOO='=bar' export PACKER_BUILDER_TYPE='iso' export PACKER_BUILD_NAME='vmware' `, } p := new(Provisioner) p.generatedData = generatedData() p.config.UseEnvVarFile = true p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" for i, expectedValue := range expected { p.config.Vars = userEnvVarTests[i] flattenedEnvVars = p.createEnvVarFileContent() if flattenedEnvVars != expectedValue { t.Fatalf("expected flattened env vars to be: %s, got %s.", expectedValue, flattenedEnvVars) } } } func TestProvisioner_createEnvVarFileContent_withEnvVarFormat(t *testing.T) { var flattenedEnvVars string config := testConfig() userEnvVarTests := [][]string{ {}, // No user env var {"FOO=bar", "BAZ=qux"}, // Multiple user env vars {"FOO=bar=baz"}, // User env var with value containing equals {"FOO==bar"}, // User env var with value starting with equals } expected := []string{ `PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `BAZ=qux FOO=bar PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `FOO=bar=baz PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, `FOO==bar PACKER_BUILDER_TYPE=iso PACKER_BUILD_NAME=vmware `, } p := new(Provisioner) p.generatedData = generatedData() p.config.UseEnvVarFile = true //User provided env_var_format without export prefix p.config.EnvVarFormat = "%s=%s\n" p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" for i, expectedValue := range expected { p.config.Vars = userEnvVarTests[i] flattenedEnvVars = p.createEnvVarFileContent() if flattenedEnvVars != expectedValue { t.Fatalf("expected flattened env vars to be: %q, got %q.", expectedValue, flattenedEnvVars) } } } func TestProvisioner_RemoteFolderSetSuccessfully(t *testing.T) { config := testConfig() expectedRemoteFolder := "/example/path" config["remote_folder"] = expectedRemoteFolder p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } if !strings.Contains(p.config.RemotePath, expectedRemoteFolder) { t.Fatalf("remote path does not contain remote_folder") } } func TestProvisioner_RemoteFolderDefaultsToTmp(t *testing.T) { config := testConfig() p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } if p.config.RemoteFolder != "/tmp" { t.Fatalf("remote_folder did not default to /tmp") } if !strings.Contains(p.config.RemotePath, "/tmp") { t.Fatalf("remote path does not contain remote_folder") } } func TestProvisioner_RemoteFileSetSuccessfully(t *testing.T) { config := testConfig() expectedRemoteFile := "example.sh" config["remote_file"] = expectedRemoteFile p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } if !strings.Contains(p.config.RemotePath, expectedRemoteFile) { t.Fatalf("remote path does not contain remote_file") } } func TestProvisioner_RemoteFileDefaultsToScriptnnnn(t *testing.T) { config := testConfig() p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } remoteFileRegex := regexp.MustCompile("script_[0-9]{1,4}.sh") if !remoteFileRegex.MatchString(p.config.RemoteFile) { t.Fatalf("remote_file did not default to script_nnnn.sh: %q", p.config.RemoteFile) } if !remoteFileRegex.MatchString(p.config.RemotePath) { t.Fatalf("remote_path did not match script_nnnn.sh: %q", p.config.RemotePath) } } func TestProvisioner_RemotePathSetViaRemotePathAndRemoteFile(t *testing.T) { config := testConfig() expectedRemoteFile := "example.sh" expectedRemoteFolder := "/example/path" config["remote_file"] = expectedRemoteFile config["remote_folder"] = expectedRemoteFolder p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } if p.config.RemotePath != expectedRemoteFolder+"/"+expectedRemoteFile { t.Fatalf("remote path does not contain remote_file: %q", p.config.RemotePath) } } func TestProvisioner_RemotePathOverridesRemotePathAndRemoteFile(t *testing.T) { config := testConfig() expectedRemoteFile := "example.sh" expectedRemoteFolder := "/example/path" expectedRemotePath := "/example/remote/path/script.sh" config["remote_file"] = expectedRemoteFile config["remote_folder"] = expectedRemoteFolder config["remote_path"] = expectedRemotePath p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } if p.config.RemotePath != expectedRemotePath { t.Fatalf("remote path does not contain remote_path: %q", p.config.RemotePath) } } func TestProvisionerRemotePathDefaultsSuccessfully(t *testing.T) { config := testConfig() p := new(Provisioner) err := p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } remotePathRegex := regexp.MustCompile("/tmp/script_[0-9]{1,4}.sh") if !remotePathRegex.MatchString(p.config.RemotePath) { t.Fatalf("remote path does not match the expected default regex: %q", p.config.RemotePath) } } func generatedData() map[string]interface{} { return map[string]interface{}{ "PackerHTTPAddr": commonsteps.HttpAddrNotImplemented, "PackerHTTPIP": commonsteps.HttpIPNotImplemented, "PackerHTTPPort": commonsteps.HttpPortNotImplemented, } } ��������������packer-1.6.6+ds1/provisioner/shell/test-fixtures/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021777�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/test-fixtures/shell-provisioner.txt������������������������������0000664�0000000�0000000�00000000526�13771713062�0026227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "type": "shell", "inline": [ "echo build ID is {{ build `ID`}} and build UUID is {{ build `PackerRunUUID` }}> provisioner.{{ build `PackerRunUUID`}}.txt" ] }, { "type": "file", "source": "provisioner.{{ build `PackerRunUUID`}}.txt", "destination": "./test-fixtures/provisioner.shell.txt", "direction": "download" }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/unix_reader.go���������������������������������������������������0000664�0000000�0000000�00000002632�13771713062�0022010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import ( "bufio" "io" "sync" ) // UnixReader is a Reader implementation that automatically converts // Windows line endings to Unix line endings. type UnixReader struct { Reader io.Reader buf []byte once sync.Once scanner *bufio.Scanner } func (r *UnixReader) Read(p []byte) (n int, err error) { // Create the buffered reader once r.once.Do(func() { r.scanner = bufio.NewScanner(r.Reader) r.scanner.Split(scanUnixLine) }) // If we have no data in our buffer, scan to the next token if len(r.buf) == 0 { if !r.scanner.Scan() { err = r.scanner.Err() if err == nil { err = io.EOF } return 0, err } r.buf = r.scanner.Bytes() } // Write out as much data as we can to the buffer, storing the rest // for the next read. n = len(p) if n > len(r.buf) { n = len(r.buf) } copy(p, r.buf) r.buf = r.buf[n:] return } // scanUnixLine is a bufio.Scanner SplitFunc. It tokenizes on lines, but // only returns unix-style lines. So even if the line is "one\r\n", the // token returned will be "one\n". func scanUnixLine(data []byte, atEOF bool) (advance int, token []byte, err error) { advance, token, err = bufio.ScanLines(data, atEOF) if advance == 0 { // If we reached the end of a line without a newline, then // just return as it is. Otherwise the Scanner will keep trying // to scan, blocking forever. return } return advance, append(token, '\n'), err } ������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/unix_reader_test.go����������������������������������������������0000664�0000000�0000000�00000001716�13771713062�0023051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import ( "bytes" "io" "testing" ) func TestUnixReader_impl(t *testing.T) { var raw interface{} raw = new(UnixReader) if _, ok := raw.(io.Reader); !ok { t.Fatal("should be reader") } } func TestUnixReader(t *testing.T) { input := "one\r\ntwo\n\r\nthree\r\n" expected := "one\ntwo\n\nthree\n" unixReaderTest(t, input, expected) } func TestUnixReader_unixOnly(t *testing.T) { input := "\none\n\ntwo\nthree\n\n" expected := "\none\n\ntwo\nthree\n\n" unixReaderTest(t, input, expected) } func TestUnixReader_readsLastLine(t *testing.T) { input := "one\ntwo" expected := "one\ntwo\n" unixReaderTest(t, input, expected) } func unixReaderTest(t *testing.T, input string, expected string) { r := &UnixReader{ Reader: bytes.NewReader([]byte(input)), } result := new(bytes.Buffer) if _, err := io.Copy(result, r); err != nil { t.Fatalf("err: %s", err) } if result.String() != expected { t.Fatalf("bad: %#v", result.String()) } } ��������������������������������������������������packer-1.6.6+ds1/provisioner/shell/version/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020636�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/shell/version/version.go�����������������������������������������������0000664�0000000�0000000�00000000473�13771713062�0022656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var ShellPluginVersion *version.PluginVersion func init() { ShellPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/sleep/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017152�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/sleep/provisioner.go���������������������������������������������������0000664�0000000�0000000�00000001577�13771713062�0022072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Provisioner package sleep import ( "context" "time" "github.com/hashicorp/hcl/v2/hcldec" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" ) type Provisioner struct { Duration time.Duration } var _ packersdk.Provisioner = new(Provisioner) func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.FlatMapstructure().HCL2Spec() } func (p *Provisioner) FlatConfig() interface{} { return p.FlatMapstructure() } func (p *Provisioner) Prepare(raws ...interface{}) error { return config.Decode(&p, &config.DecodeOpts{}, raws...) } func (p *Provisioner) Provision(ctx context.Context, _ packersdk.Ui, _ packersdk.Communicator, _ map[string]interface{}) error { select { case <-ctx.Done(): return ctx.Err() case <-time.After(p.Duration): return nil } } ���������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/sleep/provisioner.hcl2spec.go������������������������������������������0000664�0000000�0000000�00000002132�13771713062�0023560�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Provisioner"; DO NOT EDIT. package sleep import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatProvisioner is an auto-generated flat version of Provisioner. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatProvisioner struct { Duration *string `cty:"duration" hcl:"duration"` } // FlatMapstructure returns a new FlatProvisioner. // FlatProvisioner is an auto-generated flat version of Provisioner. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Provisioner) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatProvisioner) } // HCL2Spec returns the hcl spec of a Provisioner. // This spec is used by HCL to read the fields of Provisioner. // The decoded values from this spec will then be applied to a FlatProvisioner. func (*FlatProvisioner) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "duration": &hcldec.AttrSpec{Name: "duration", Type: cty.String, Required: false}, } return s } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/sleep/provisioner_test.go����������������������������������������������0000664�0000000�0000000�00000002243�13771713062�0023120�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package sleep import ( "context" "testing" "time" ) func test1sConfig() map[string]interface{} { return map[string]interface{}{ "duration": "1s", } } func TestConfigPrepare_1s(t *testing.T) { raw := test1sConfig() var p Provisioner err := p.Prepare(raw) if err != nil { t.Fatalf("prerare failed: %v", err) } if p.Duration != time.Second { t.Fatal("wrong duration") } } func TestProvisioner_Provision(t *testing.T) { ctxCancelled, cancel := context.WithCancel(context.Background()) cancel() type fields struct { Duration time.Duration } type args struct { ctx context.Context } tests := []struct { name string fields fields args args wantErr bool }{ {"valid sleep", fields{1 * time.Millisecond}, args{context.Background()}, false}, {"timeout", fields{1 * time.Millisecond}, args{ctxCancelled}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { p := &Provisioner{ Duration: tt.fields.Duration, } if err := p.Provision(tt.args.ctx, nil, nil, make(map[string]interface{})); (err != nil) != tt.wantErr { t.Errorf("Provisioner.Provision() error = %v, wantErr %v", err, tt.wantErr) } }) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/sleep/version/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020637�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/sleep/version/version.go�����������������������������������������������0000664�0000000�0000000�00000000505�13771713062�0022653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var SleepProvisionerVersion *version.PluginVersion func init() { SleepProvisionerVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-restart/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021216�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-restart/provisioner.go�����������������������������������������0000664�0000000�0000000�00000021005�13771713062�0024122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config package restart import ( "bytes" "context" "fmt" "io" "log" "strings" "sync" "time" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/common" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/masterzen/winrm" ) var DefaultRestartCommand = `shutdown /r /f /t 0 /c "packer restart"` var DefaultRestartCheckCommand = winrm.Powershell(`echo ("{0} restarted." -f [System.Net.Dns]::GetHostName())`) var retryableSleep = 5 * time.Second var TryCheckReboot = `shutdown /r /f /t 60 /c "packer restart test"` var AbortReboot = `shutdown /a` var DefaultRegistryKeys = []string{ "HKLM:SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\RebootPending", "HKLM:SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\PackagesPending", "HKLM:Software\\Microsoft\\Windows\\CurrentVersion\\Component Based Servicing\\RebootInProgress", } type Config struct { common.PackerConfig `mapstructure:",squash"` // The command used to restart the guest machine RestartCommand string `mapstructure:"restart_command"` // The command used to check if the guest machine has restarted // The output of this command will be displayed to the user RestartCheckCommand string `mapstructure:"restart_check_command"` // The timeout for waiting for the machine to restart RestartTimeout time.Duration `mapstructure:"restart_timeout"` // Whether to check the registry (see RegistryKeys) for pending reboots CheckKey bool `mapstructure:"check_registry"` // custom keys to check for RegistryKeys []string `mapstructure:"registry_keys"` ctx interpolate.Context } type Provisioner struct { config Config comm packersdk.Communicator ui packersdk.Ui cancel chan struct{} cancelLock sync.Mutex } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "windows-restart", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", }, }, }, raws...) if err != nil { return err } if p.config.RestartCommand == "" { p.config.RestartCommand = DefaultRestartCommand } if p.config.RestartCheckCommand == "" { p.config.RestartCheckCommand = DefaultRestartCheckCommand } if p.config.RestartTimeout == 0 { p.config.RestartTimeout = 5 * time.Minute } if len(p.config.RegistryKeys) == 0 { p.config.RegistryKeys = DefaultRegistryKeys } return nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, _ map[string]interface{}) error { p.cancelLock.Lock() p.cancel = make(chan struct{}) p.cancelLock.Unlock() ui.Say("Restarting Machine") p.comm = comm p.ui = ui var cmd *packersdk.RemoteCmd command := p.config.RestartCommand err := retry.Config{StartTimeout: p.config.RestartTimeout}.Run(ctx, func(context.Context) error { cmd = &packersdk.RemoteCmd{Command: command} return cmd.RunWithUi(ctx, comm, ui) }) if err != nil { return err } if cmd.ExitStatus() != 0 && cmd.ExitStatus() != 1115 && cmd.ExitStatus() != 1190 { return fmt.Errorf("Restart script exited with non-zero exit status: %d", cmd.ExitStatus()) } return waitForRestart(ctx, p, comm) } var waitForRestart = func(ctx context.Context, p *Provisioner, comm packersdk.Communicator) error { ui := p.ui ui.Say("Waiting for machine to restart...") waitDone := make(chan bool, 1) timeout := time.After(p.config.RestartTimeout) var err error p.comm = comm var cmd *packersdk.RemoteCmd trycommand := TryCheckReboot abortcommand := AbortReboot // Stolen from Vagrant reboot checker for { log.Printf("Check if machine is rebooting...") cmd = &packersdk.RemoteCmd{Command: trycommand} err = cmd.RunWithUi(ctx, comm, ui) if err != nil { // Couldn't execute, we assume machine is rebooting already break } if cmd.ExitStatus() == 1 { // SSH provisioner, and we're already rebooting. SSH can reconnect // without our help; exit this wait loop. break } if cmd.ExitStatus() == 1115 || cmd.ExitStatus() == 1190 || cmd.ExitStatus() == 1717 { // Reboot already in progress but not completed log.Printf("Reboot already in progress, waiting...") time.Sleep(10 * time.Second) } if cmd.ExitStatus() == 0 { // Cancel reboot we created to test if machine was already rebooting cmd = &packersdk.RemoteCmd{Command: abortcommand} cmd.RunWithUi(ctx, comm, ui) break } } go func() { log.Printf("Waiting for machine to become available...") err = waitForCommunicator(ctx, p) waitDone <- true }() log.Printf("Waiting for machine to reboot with timeout: %s", p.config.RestartTimeout) WaitLoop: for { // Wait for either WinRM to become available, a timeout to occur, // or an interrupt to come through. select { case <-waitDone: if err != nil { ui.Error(fmt.Sprintf("Error waiting for machine to restart: %s", err)) return err } ui.Say("Machine successfully restarted, moving on") close(p.cancel) break WaitLoop case <-timeout: err := fmt.Errorf("Timeout waiting for machine to restart.") ui.Error(err.Error()) close(p.cancel) return err case <-p.cancel: close(waitDone) return fmt.Errorf("Interrupt detected, quitting waiting for machine to restart") } } return nil } var waitForCommunicator = func(ctx context.Context, p *Provisioner) error { runCustomRestartCheck := true if p.config.RestartCheckCommand == DefaultRestartCheckCommand { runCustomRestartCheck = false } // This command is configurable by the user to make sure that the // vm has met their necessary criteria for having restarted. If the // user doesn't set a special restart command, we just run the // default as cmdModuleLoad below. cmdRestartCheck := &packersdk.RemoteCmd{Command: p.config.RestartCheckCommand} log.Printf("Checking that communicator is connected with: '%s'", cmdRestartCheck.Command) for { select { case <-ctx.Done(): log.Println("Communicator wait canceled, exiting loop") return fmt.Errorf("Communicator wait canceled") case <-time.After(retryableSleep): } if runCustomRestartCheck { // run user-configured restart check err := cmdRestartCheck.RunWithUi(ctx, p.comm, p.ui) if err != nil { log.Printf("Communication connection err: %s", err) continue } log.Printf("Connected to machine") runCustomRestartCheck = false } // This is the non-user-configurable check that powershell // modules have loaded. // If we catch the restart in just the right place, we will be able // to run the restart check but the output will be an error message // about how it needs powershell modules to load, and we will start // provisioning before powershell is actually ready. // In this next check, we parse stdout to make sure that the command is // actually running as expected. cmdModuleLoad := &packersdk.RemoteCmd{Command: DefaultRestartCheckCommand} var buf, buf2 bytes.Buffer cmdModuleLoad.Stdout = &buf cmdModuleLoad.Stdout = io.MultiWriter(cmdModuleLoad.Stdout, &buf2) cmdModuleLoad.RunWithUi(ctx, p.comm, p.ui) stdoutToRead := buf2.String() if !strings.Contains(stdoutToRead, "restarted.") { log.Printf("echo didn't succeed; retrying...") continue } if p.config.CheckKey { log.Printf("Connected to machine") shouldContinue := false for _, RegKey := range p.config.RegistryKeys { KeyTestCommand := winrm.Powershell(fmt.Sprintf(`Test-Path "%s"`, RegKey)) cmdKeyCheck := &packersdk.RemoteCmd{Command: KeyTestCommand} log.Printf("Checking registry for pending reboots") var buf, buf2 bytes.Buffer cmdKeyCheck.Stdout = &buf cmdKeyCheck.Stdout = io.MultiWriter(cmdKeyCheck.Stdout, &buf2) err := cmdKeyCheck.RunWithUi(ctx, p.comm, p.ui) if err != nil { log.Printf("Communication connection err: %s", err) shouldContinue = true } stdoutToRead := buf2.String() if strings.Contains(stdoutToRead, "True") { log.Printf("RegistryKey %s exists; waiting...", KeyTestCommand) shouldContinue = true } else { log.Printf("No Registry keys found; exiting wait loop") } } if shouldContinue { continue } } break } return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-restart/provisioner.hcl2spec.go��������������������������������0000664�0000000�0000000�00000007605�13771713062�0025636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package restart import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` RestartCommand *string `mapstructure:"restart_command" cty:"restart_command" hcl:"restart_command"` RestartCheckCommand *string `mapstructure:"restart_check_command" cty:"restart_check_command" hcl:"restart_check_command"` RestartTimeout *string `mapstructure:"restart_timeout" cty:"restart_timeout" hcl:"restart_timeout"` CheckKey *bool `mapstructure:"check_registry" cty:"check_registry" hcl:"check_registry"` RegistryKeys []string `mapstructure:"registry_keys" cty:"registry_keys" hcl:"registry_keys"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "restart_command": &hcldec.AttrSpec{Name: "restart_command", Type: cty.String, Required: false}, "restart_check_command": &hcldec.AttrSpec{Name: "restart_check_command", Type: cty.String, Required: false}, "restart_timeout": &hcldec.AttrSpec{Name: "restart_timeout", Type: cty.String, Required: false}, "check_registry": &hcldec.AttrSpec{Name: "check_registry", Type: cty.Bool, Required: false}, "registry_keys": &hcldec.AttrSpec{Name: "registry_keys", Type: cty.List(cty.String), Required: false}, } return s } ���������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-restart/provisioner_test.go������������������������������������0000664�0000000�0000000�00000017725�13771713062�0025177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package restart import ( "bytes" "context" "fmt" "testing" "time" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{} } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.RestartTimeout != 5*time.Minute { t.Errorf("unexpected restart timeout: %s", p.config.RestartTimeout) } if p.config.RestartCommand != "shutdown /r /f /t 0 /c \"packer restart\"" { t.Errorf("unexpected restart command: %s", p.config.RestartCommand) } } func TestProvisionerPrepare_ConfigRetryTimeout(t *testing.T) { var p Provisioner config := testConfig() config["restart_timeout"] = "1m" err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.RestartTimeout != 1*time.Minute { t.Errorf("unexpected restart timeout: %s", p.config.RestartTimeout) } } func TestProvisionerPrepare_ConfigErrors(t *testing.T) { var p Provisioner config := testConfig() config["restart_timeout"] = "m" err := p.Prepare(config) if err == nil { t.Fatal("Expected error parsing restart_timeout but did not receive one.") } } func TestProvisionerPrepare_InvalidKey(t *testing.T) { var p Provisioner config := testConfig() // Add a random key config["i_should_not_be_valid"] = true err := p.Prepare(config) if err == nil { t.Fatal("should have error") } } func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), ErrorWriter: new(bytes.Buffer), } } func TestProvisionerProvision_Success(t *testing.T) { config := testConfig() // Defaults provided by Packer ui := testUi() p := new(Provisioner) // Defaults provided by Packer comm := new(packersdk.MockCommunicator) p.Prepare(config) waitForCommunicatorOld := waitForCommunicator waitForCommunicator = func(context.Context, *Provisioner) error { return nil } waitForRestartOld := waitForRestart waitForRestart = func(context.Context, *Provisioner, packersdk.Communicator) error { return nil } err := p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatal("should not have error") } expectedCommand := DefaultRestartCommand // Should run the command without alteration if comm.StartCmd.Command != expectedCommand { t.Fatalf("Expect command to be: %s, got %s", expectedCommand, comm.StartCmd.Command) } // Set this back! waitForCommunicator = waitForCommunicatorOld waitForRestart = waitForRestartOld } func TestProvisionerProvision_CustomCommand(t *testing.T) { config := testConfig() // Defaults provided by Packer ui := testUi() p := new(Provisioner) expectedCommand := "specialrestart.exe -NOW" config["restart_command"] = expectedCommand // Defaults provided by Packer comm := new(packersdk.MockCommunicator) p.Prepare(config) waitForCommunicatorOld := waitForCommunicator waitForCommunicator = func(context.Context, *Provisioner) error { return nil } waitForRestartOld := waitForRestart waitForRestart = func(context.Context, *Provisioner, packersdk.Communicator) error { return nil } err := p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err != nil { t.Fatal("should not have error") } // Should run the command without alteration if comm.StartCmd.Command != expectedCommand { t.Fatalf("Expect command to be: %s, got %s", expectedCommand, comm.StartCmd.Command) } // Set this back! waitForCommunicator = waitForCommunicatorOld waitForRestart = waitForRestartOld } func TestProvisionerProvision_RestartCommandFail(t *testing.T) { config := testConfig() ui := testUi() p := new(Provisioner) comm := new(packersdk.MockCommunicator) comm.StartStderr = "WinRM terminated" comm.StartExitStatus = 1 p.Prepare(config) err := p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err == nil { t.Fatal("should have error") } } func TestProvisionerProvision_WaitForRestartFail(t *testing.T) { config := testConfig() // Defaults provided by Packer ui := testUi() p := new(Provisioner) // Defaults provided by Packer comm := new(packersdk.MockCommunicator) p.Prepare(config) waitForCommunicatorOld := waitForCommunicator waitForCommunicator = func(context.Context, *Provisioner) error { return fmt.Errorf("Machine did not restart properly") } err := p.Provision(context.Background(), ui, comm, make(map[string]interface{})) if err == nil { t.Fatal("should have error") } // Set this back! waitForCommunicator = waitForCommunicatorOld } func TestProvision_waitForRestartTimeout(t *testing.T) { retryableSleep = 10 * time.Millisecond config := testConfig() config["restart_timeout"] = "1ms" ui := testUi() p := new(Provisioner) comm := new(packersdk.MockCommunicator) var err error p.Prepare(config) waitForCommunicatorOld := waitForCommunicator waitDone := make(chan bool) waitContinue := make(chan bool) // Block until cancel comes through waitForCommunicator = func(context.Context, *Provisioner) error { for { select { case <-waitDone: waitContinue <- true } } } go func() { err = p.Provision(context.Background(), ui, comm, make(map[string]interface{})) waitDone <- true }() <-waitContinue if err == nil { t.Fatal("should not have error") } // Set this back! waitForCommunicator = waitForCommunicatorOld } func TestProvision_waitForCommunicator(t *testing.T) { config := testConfig() // Defaults provided by Packer ui := testUi() p := new(Provisioner) // Defaults provided by Packer comm := new(packersdk.MockCommunicator) p.comm = comm p.ui = ui comm.StartStderr = "WinRM terminated" comm.StartStdout = "WIN-V4CEJ7MC5SN restarted." comm.StartExitStatus = 1 p.Prepare(config) err := waitForCommunicator(context.Background(), p) if err != nil { t.Fatalf("should not have error, got: %s", err.Error()) } expectedCommand := DefaultRestartCheckCommand // Should run the command without alteration if comm.StartCmd.Command != expectedCommand { t.Fatalf("Expect command to be: %s, got %s", expectedCommand, comm.StartCmd.Command) } } func TestProvision_waitForCommunicatorWithCancel(t *testing.T) { config := testConfig() // Defaults provided by Packer ui := testUi() p := new(Provisioner) // Defaults provided by Packer comm := new(packersdk.MockCommunicator) p.comm = comm p.ui = ui retryableSleep = 5 * time.Second p.cancel = make(chan struct{}) var err error ctx, cancel := context.WithCancel(context.Background()) comm.StartStderr = "WinRM terminated" comm.StartExitStatus = 1 // Always fail p.Prepare(config) // Run 2 goroutines; // 1st to call waitForCommunicator (that will always fail) // 2nd to cancel the operation waitStart := make(chan bool) waitDone := make(chan bool) go func() { waitStart <- true err = waitForCommunicator(ctx, p) waitDone <- true }() go func() { time.Sleep(10 * time.Millisecond) <-waitStart cancel() }() <-waitDone // Expect a Cancel error if err == nil { t.Fatalf("Should have err") } } func TestProvision_Cancel(t *testing.T) { config := testConfig() // Defaults provided by Packer ui := testUi() p := new(Provisioner) comm := new(packersdk.MockCommunicator) p.Prepare(config) done := make(chan error) topCtx, cancelTopCtx := context.WithCancel(context.Background()) // Block until cancel comes through waitForCommunicator = func(ctx context.Context, p *Provisioner) error { cancelTopCtx() <-ctx.Done() return ctx.Err() } // Create two go routines to provision and cancel in parallel // Provision will block until cancel happens go func() { done <- p.Provision(topCtx, ui, comm, make(map[string]interface{})) }() // Expect interrupt error if err := <-done; err == nil { t.Fatal("should have error") } } �������������������������������������������packer-1.6.6+ds1/provisioner/windows-restart/version/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022703�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-restart/version/version.go�������������������������������������0000664�0000000�0000000�00000000515�13771713062�0024720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var WindowsRestartPluginVersion *version.PluginVersion func init() { WindowsRestartPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-shell/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020641�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-shell/provisioner.go�������������������������������������������0000664�0000000�0000000�00000017304�13771713062�0023554�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//go:generate mapstructure-to-hcl2 -type Config // This package implements a provisioner for Packer that executes // shell scripts within the remote machine. package shell import ( "bufio" "context" "errors" "fmt" "log" "os" "sort" "strings" "time" "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/retry" "github.com/hashicorp/packer/packer-plugin-sdk/shell" "github.com/hashicorp/packer/packer-plugin-sdk/template/config" "github.com/hashicorp/packer/packer-plugin-sdk/template/interpolate" "github.com/hashicorp/packer/packer-plugin-sdk/tmp" ) //FIXME query remote host or use %SYSTEMROOT%, %TEMP% and more creative filename const DefaultRemotePath = "c:/Windows/Temp/script.bat" type Config struct { shell.Provisioner `mapstructure:",squash"` shell.ProvisionerRemoteSpecific `mapstructure:",squash"` // The timeout for retrying to start the process. Until this timeout // is reached, if the provisioner can't start a process, it retries. // This can be set high to allow for reboots. StartRetryTimeout time.Duration `mapstructure:"start_retry_timeout"` ctx interpolate.Context } type Provisioner struct { config Config generatedData map[string]interface{} } type ExecuteCommandTemplate struct { Vars string Path string } func (p *Provisioner) ConfigSpec() hcldec.ObjectSpec { return p.config.FlatMapstructure().HCL2Spec() } func (p *Provisioner) Prepare(raws ...interface{}) error { err := config.Decode(&p.config, &config.DecodeOpts{ PluginType: "windows-shell", Interpolate: true, InterpolateContext: &p.config.ctx, InterpolateFilter: &interpolate.RenderFilter{ Exclude: []string{ "execute_command", }, }, }, raws...) if err != nil { return err } if p.config.EnvVarFormat == "" { p.config.EnvVarFormat = `set "%s=%s" && ` } if p.config.ExecuteCommand == "" { p.config.ExecuteCommand = `{{.Vars}}"{{.Path}}"` } if p.config.Inline != nil && len(p.config.Inline) == 0 { p.config.Inline = nil } if p.config.StartRetryTimeout == 0 { p.config.StartRetryTimeout = 5 * time.Minute } if p.config.RemotePath == "" { p.config.RemotePath = DefaultRemotePath } if p.config.Scripts == nil { p.config.Scripts = make([]string, 0) } if p.config.Vars == nil { p.config.Vars = make([]string, 0) } var errs error if p.config.Script != "" && len(p.config.Scripts) > 0 { errs = packersdk.MultiErrorAppend(errs, errors.New("Only one of script or scripts can be specified.")) } if p.config.Script != "" { p.config.Scripts = []string{p.config.Script} } if len(p.config.Scripts) == 0 && p.config.Inline == nil { errs = packersdk.MultiErrorAppend(errs, errors.New("Either a script file or inline script must be specified.")) } else if len(p.config.Scripts) > 0 && p.config.Inline != nil { errs = packersdk.MultiErrorAppend(errs, errors.New("Only a script file or an inline script can be specified, not both.")) } for _, path := range p.config.Scripts { if _, err := os.Stat(path); err != nil { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Bad script '%s': %s", path, err)) } } // Do a check for bad environment variables, such as '=foo', 'foobar' for _, kv := range p.config.Vars { vs := strings.SplitN(kv, "=", 2) if len(vs) != 2 || vs[0] == "" { errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("Environment variable not in format 'key=value': %s", kv)) } } return errs } // This function takes the inline scripts, concatenates them // into a temporary file and returns a string containing the location // of said file. func extractScript(p *Provisioner) (string, error) { temp, err := tmp.File("windows-shell-provisioner") if err != nil { log.Printf("Unable to create temporary file for inline scripts: %s", err) return "", err } writer := bufio.NewWriter(temp) for _, command := range p.config.Inline { log.Printf("Found command: %s", command) if _, err := writer.WriteString(command + "\n"); err != nil { return "", fmt.Errorf("Error preparing shell script: %s", err) } } if err := writer.Flush(); err != nil { return "", fmt.Errorf("Error preparing shell script: %s", err) } temp.Close() return temp.Name(), nil } func (p *Provisioner) Provision(ctx context.Context, ui packersdk.Ui, comm packersdk.Communicator, generatedData map[string]interface{}) error { ui.Say("Provisioning with windows-shell...") scripts := make([]string, len(p.config.Scripts)) copy(scripts, p.config.Scripts) p.generatedData = generatedData if p.config.Inline != nil { temp, err := extractScript(p) if err != nil { ui.Error(fmt.Sprintf("Unable to extract inline scripts into a file: %s", err)) } scripts = append(scripts, temp) // Remove temp script containing the inline commands when done defer os.Remove(temp) } for _, path := range scripts { ui.Say(fmt.Sprintf("Provisioning with shell script: %s", path)) log.Printf("Opening %s for reading", path) f, err := os.Open(path) if err != nil { return fmt.Errorf("Error opening shell script: %s", err) } defer f.Close() // Create environment variables to set before executing the command flattenedVars := p.createFlattenedEnvVars() // Compile the command p.config.ctx.Data = &ExecuteCommandTemplate{ Vars: flattenedVars, Path: p.config.RemotePath, } command, err := interpolate.Render(p.config.ExecuteCommand, &p.config.ctx) if err != nil { return fmt.Errorf("Error processing command: %s", err) } // Upload the file and run the command. Do this in the context of // a single retryable function so that we don't end up with // the case that the upload succeeded, a restart is initiated, // and then the command is executed but the file doesn't exist // any longer. var cmd *packersdk.RemoteCmd err = retry.Config{StartTimeout: p.config.StartRetryTimeout}.Run(ctx, func(ctx context.Context) error { if _, err := f.Seek(0, 0); err != nil { return err } if err := comm.Upload(p.config.RemotePath, f, nil); err != nil { return fmt.Errorf("Error uploading script: %s", err) } cmd = &packersdk.RemoteCmd{Command: command} return cmd.RunWithUi(ctx, comm, ui) }) if err != nil { return err } // Close the original file since we copied it f.Close() if err := p.config.ValidExitCode(cmd.ExitStatus()); err != nil { return err } } return nil } func (p *Provisioner) createFlattenedEnvVars() (flattened string) { flattened = "" envVars := make(map[string]string) // Always available Packer provided env vars envVars["PACKER_BUILD_NAME"] = p.config.PackerBuildName envVars["PACKER_BUILDER_TYPE"] = p.config.PackerBuilderType // expose ip address variables httpAddr := p.generatedData["PackerHTTPAddr"] if httpAddr != nil && httpAddr != commonsteps.HttpAddrNotImplemented { envVars["PACKER_HTTP_ADDR"] = httpAddr.(string) } httpIP := p.generatedData["PackerHTTPIP"] if httpIP != nil && httpIP != commonsteps.HttpIPNotImplemented { envVars["PACKER_HTTP_IP"] = httpIP.(string) } httpPort := p.generatedData["PackerHTTPPort"] if httpPort != nil && httpPort != commonsteps.HttpPortNotImplemented { envVars["PACKER_HTTP_PORT"] = httpPort.(string) } // Split vars into key/value components for _, envVar := range p.config.Vars { keyValue := strings.SplitN(envVar, "=", 2) envVars[keyValue[0]] = keyValue[1] } // Create a list of env var keys in sorted order var keys []string for k := range envVars { keys = append(keys, k) } sort.Strings(keys) // Re-assemble vars using OS specific format pattern and flatten for _, key := range keys { flattened += fmt.Sprintf(p.config.EnvVarFormat, key, envVars[key]) } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-shell/provisioner.hcl2spec.go����������������������������������0000664�0000000�0000000�00000011436�13771713062�0025256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT. package shell import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/zclconf/go-cty/cty" ) // FlatConfig is an auto-generated flat version of Config. // Where the contents of a field with a `mapstructure:,squash` tag are bubbled up. type FlatConfig struct { PackerBuildName *string `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"` PackerBuilderType *string `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"` PackerCoreVersion *string `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"` PackerDebug *bool `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"` PackerForce *bool `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"` PackerOnError *string `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"` PackerUserVars map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"` PackerSensitiveVars []string `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"` Inline []string `cty:"inline" hcl:"inline"` Script *string `cty:"script" hcl:"script"` Scripts []string `cty:"scripts" hcl:"scripts"` ValidExitCodes []int `mapstructure:"valid_exit_codes" cty:"valid_exit_codes" hcl:"valid_exit_codes"` Vars []string `mapstructure:"environment_vars" cty:"environment_vars" hcl:"environment_vars"` EnvVarFormat *string `mapstructure:"env_var_format" cty:"env_var_format" hcl:"env_var_format"` Binary *bool `cty:"binary" hcl:"binary"` RemotePath *string `mapstructure:"remote_path" cty:"remote_path" hcl:"remote_path"` ExecuteCommand *string `mapstructure:"execute_command" cty:"execute_command" hcl:"execute_command"` StartRetryTimeout *string `mapstructure:"start_retry_timeout" cty:"start_retry_timeout" hcl:"start_retry_timeout"` } // FlatMapstructure returns a new FlatConfig. // FlatConfig is an auto-generated flat version of Config. // Where the contents a fields with a `mapstructure:,squash` tag are bubbled up. func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } { return new(FlatConfig) } // HCL2Spec returns the hcl spec of a Config. // This spec is used by HCL to read the fields of Config. // The decoded values from this spec will then be applied to a FlatConfig. func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec { s := map[string]hcldec.Spec{ "packer_build_name": &hcldec.AttrSpec{Name: "packer_build_name", Type: cty.String, Required: false}, "packer_builder_type": &hcldec.AttrSpec{Name: "packer_builder_type", Type: cty.String, Required: false}, "packer_core_version": &hcldec.AttrSpec{Name: "packer_core_version", Type: cty.String, Required: false}, "packer_debug": &hcldec.AttrSpec{Name: "packer_debug", Type: cty.Bool, Required: false}, "packer_force": &hcldec.AttrSpec{Name: "packer_force", Type: cty.Bool, Required: false}, "packer_on_error": &hcldec.AttrSpec{Name: "packer_on_error", Type: cty.String, Required: false}, "packer_user_variables": &hcldec.AttrSpec{Name: "packer_user_variables", Type: cty.Map(cty.String), Required: false}, "packer_sensitive_variables": &hcldec.AttrSpec{Name: "packer_sensitive_variables", Type: cty.List(cty.String), Required: false}, "inline": &hcldec.AttrSpec{Name: "inline", Type: cty.List(cty.String), Required: false}, "script": &hcldec.AttrSpec{Name: "script", Type: cty.String, Required: false}, "scripts": &hcldec.AttrSpec{Name: "scripts", Type: cty.List(cty.String), Required: false}, "valid_exit_codes": &hcldec.AttrSpec{Name: "valid_exit_codes", Type: cty.List(cty.Number), Required: false}, "environment_vars": &hcldec.AttrSpec{Name: "environment_vars", Type: cty.List(cty.String), Required: false}, "env_var_format": &hcldec.AttrSpec{Name: "env_var_format", Type: cty.String, Required: false}, "binary": &hcldec.AttrSpec{Name: "binary", Type: cty.Bool, Required: false}, "remote_path": &hcldec.AttrSpec{Name: "remote_path", Type: cty.String, Required: false}, "execute_command": &hcldec.AttrSpec{Name: "execute_command", Type: cty.String, Required: false}, "start_retry_timeout": &hcldec.AttrSpec{Name: "start_retry_timeout", Type: cty.String, Required: false}, } return s } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-shell/provisioner_test.go��������������������������������������0000664�0000000�0000000�00000026600�13771713062�0024612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package shell import ( "bytes" "context" "io/ioutil" "log" "os" "strings" "testing" "github.com/hashicorp/packer/packer-plugin-sdk/multistep/commonsteps" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func testConfig() map[string]interface{} { return map[string]interface{}{ "inline": []interface{}{"foo", "bar"}, } } func TestProvisionerPrepare_extractScript(t *testing.T) { config := testConfig() p := new(Provisioner) _ = p.Prepare(config) file, err := extractScript(p) defer os.Remove(file) if err != nil { t.Fatalf("Should not be error: %s", err) } log.Printf("File: %s", file) if strings.Index(file, os.TempDir()) != 0 { t.Fatalf("Temp file should reside in %s. File location: %s", os.TempDir(), file) } // File contents should contain 2 lines concatenated by newlines: foo\nbar readFile, err := ioutil.ReadFile(file) if err != nil { t.Fatalf("Should not be error: %s", err) } expectedContents := "foo\nbar\n" s := string(readFile[:]) if s != expectedContents { t.Fatalf("Expected generated inlineScript to equal '%s', got '%s'", expectedContents, s) } } func TestProvisioner_Impl(t *testing.T) { var raw interface{} raw = &Provisioner{} if _, ok := raw.(packersdk.Provisioner); !ok { t.Fatalf("must be a Provisioner") } } func TestProvisionerPrepare_Defaults(t *testing.T) { var p Provisioner config := testConfig() err := p.Prepare(config) if err != nil { t.Fatalf("err: %s", err) } if p.config.RemotePath != DefaultRemotePath { t.Errorf("unexpected remote path: %s", p.config.RemotePath) } if p.config.ExecuteCommand != "{{.Vars}}\"{{.Path}}\"" { t.Fatalf("Default command should be powershell {{.Vars}}\"{{.Path}}\", but got %s", p.config.ExecuteCommand) } } func TestProvisionerPrepare_Config(t *testing.T) { } func TestProvisionerPrepare_InvalidKey(t *testing.T) { var p Provisioner config := testConfig() // Add a random key config["i_should_not_be_valid"] = true err := p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_Script(t *testing.T) { config := testConfig() delete(config, "inline") config["script"] = "/this/should/not/exist" p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["script"] = tf.Name() p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerPrepare_ScriptAndInline(t *testing.T) { var p Provisioner config := testConfig() delete(config, "inline") delete(config, "script") err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["inline"] = []interface{}{"foo"} config["script"] = tf.Name() err = p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_ScriptAndScripts(t *testing.T) { var p Provisioner config := testConfig() // Test with both tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["inline"] = []interface{}{"foo"} config["scripts"] = []string{tf.Name()} err = p.Prepare(config) if err == nil { t.Fatal("should have error") } } func TestProvisionerPrepare_Scripts(t *testing.T) { config := testConfig() delete(config, "inline") config["scripts"] = []string{} p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good one tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config["scripts"] = []string{tf.Name()} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerPrepare_EnvironmentVars(t *testing.T) { config := testConfig() // Test with a bad case config["environment_vars"] = []string{"badvar", "good=var"} p := new(Provisioner) err := p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a trickier case config["environment_vars"] = []string{"=bad"} p = new(Provisioner) err = p.Prepare(config) if err == nil { t.Fatal("should have error") } // Test with a good case // Note: baz= is a real env variable, just empty config["environment_vars"] = []string{"FOO=bar", "baz="} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value contains an equals sign config["environment_vars"] = []string{"good=withequals=true"} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } // Test when the env variable value starts with an equals sign config["environment_vars"] = []string{"good==true"} p = new(Provisioner) err = p.Prepare(config) if err != nil { t.Fatalf("should not have error: %s", err) } } func TestProvisionerQuote_EnvironmentVars(t *testing.T) { config := testConfig() config["environment_vars"] = []string{ "keyone=valueone", "keytwo=value\ntwo", "keythree='valuethree'", "keyfour='value\nfour'", "keyfive='value=five'", "keysix='=six'", } expected := []string{ "keyone=valueone", "keytwo=value\ntwo", "keythree='valuethree'", "keyfour='value\nfour'", "keyfive='value=five'", "keysix='=six'", } p := new(Provisioner) p.Prepare(config) for i, expectedValue := range expected { if p.config.Vars[i] != expectedValue { t.Fatalf("%s should be equal to %s", p.config.Vars[i], expectedValue) } } } func testUi() *packersdk.BasicUi { return &packersdk.BasicUi{ Reader: new(bytes.Buffer), Writer: new(bytes.Buffer), ErrorWriter: new(bytes.Buffer), } } func TestProvisionerProvision_Inline(t *testing.T) { config := testConfig() delete(config, "inline") // Defaults provided by Packer config["remote_path"] = "c:/Windows/Temp/inlineScript.bat" config["inline"] = []string{"whoami"} ui := testUi() p := new(Provisioner) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" comm := new(packersdk.MockCommunicator) p.Prepare(config) err := p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } expectedCommand := `set "PACKER_BUILDER_TYPE=iso" && set "PACKER_BUILD_NAME=vmware" && "c:/Windows/Temp/inlineScript.bat"` // Should run the command without alteration if comm.StartCmd.Command != expectedCommand { t.Fatalf("Expect command to be: %s, got %s", expectedCommand, comm.StartCmd.Command) } envVars := make([]string, 2) envVars[0] = "FOO=BAR" envVars[1] = "BAR=BAZ" config["environment_vars"] = envVars config["remote_path"] = "c:/Windows/Temp/inlineScript.bat" p.Prepare(config) err = p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } expectedCommand = `set "BAR=BAZ" && set "FOO=BAR" && set "PACKER_BUILDER_TYPE=iso" && set "PACKER_BUILD_NAME=vmware" && "c:/Windows/Temp/inlineScript.bat"` // Should run the command without alteration if comm.StartCmd.Command != expectedCommand { t.Fatalf("Expect command to be: %s, got: %s", expectedCommand, comm.StartCmd.Command) } } func TestProvisionerProvision_Scripts(t *testing.T) { tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config := testConfig() delete(config, "inline") config["scripts"] = []string{tf.Name()} config["packer_build_name"] = "foobuild" config["packer_builder_type"] = "footype" ui := testUi() p := new(Provisioner) comm := new(packersdk.MockCommunicator) p.Prepare(config) err = p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } //powershell -Command "$env:PACKER_BUILDER_TYPE=''"; powershell -Command "$env:PACKER_BUILD_NAME='foobuild'"; powershell -Command c:/Windows/Temp/script.ps1 expectedCommand := `set "PACKER_BUILDER_TYPE=footype" && set "PACKER_BUILD_NAME=foobuild" && "c:/Windows/Temp/script.bat"` // Should run the command without alteration if comm.StartCmd.Command != expectedCommand { t.Fatalf("Expect command to be %s NOT %s", expectedCommand, comm.StartCmd.Command) } } func TestProvisionerProvision_ScriptsWithEnvVars(t *testing.T) { tf, err := ioutil.TempFile("", "packer") if err != nil { t.Fatalf("error tempfile: %s", err) } defer os.Remove(tf.Name()) defer tf.Close() config := testConfig() ui := testUi() delete(config, "inline") config["scripts"] = []string{tf.Name()} config["packer_build_name"] = "foobuild" config["packer_builder_type"] = "footype" // Env vars - currently should not effect them envVars := make([]string, 2) envVars[0] = "FOO=BAR" envVars[1] = "BAR=BAZ" config["environment_vars"] = envVars p := new(Provisioner) comm := new(packersdk.MockCommunicator) p.Prepare(config) err = p.Provision(context.Background(), ui, comm, generatedData()) if err != nil { t.Fatal("should not have error") } expectedCommand := `set "BAR=BAZ" && set "FOO=BAR" && set "PACKER_BUILDER_TYPE=footype" && set "PACKER_BUILD_NAME=foobuild" && "c:/Windows/Temp/script.bat"` // Should run the command without alteration if comm.StartCmd.Command != expectedCommand { t.Fatalf("Expect command to be %s NOT %s", expectedCommand, comm.StartCmd.Command) } } func TestProvisioner_createFlattenedEnvVars_windows(t *testing.T) { var flattenedEnvVars string config := testConfig() userEnvVarTests := [][]string{ {}, // No user env var {"FOO=bar"}, // Single user env var {"FOO=bar", "BAZ=qux"}, // Multiple user env vars {"FOO=bar=baz"}, // User env var with value containing equals {"FOO==bar"}, // User env var with value starting with equals } expected := []string{ `set "PACKER_BUILDER_TYPE=iso" && set "PACKER_BUILD_NAME=vmware" && `, `set "FOO=bar" && set "PACKER_BUILDER_TYPE=iso" && set "PACKER_BUILD_NAME=vmware" && `, `set "BAZ=qux" && set "FOO=bar" && set "PACKER_BUILDER_TYPE=iso" && set "PACKER_BUILD_NAME=vmware" && `, `set "FOO=bar=baz" && set "PACKER_BUILDER_TYPE=iso" && set "PACKER_BUILD_NAME=vmware" && `, `set "FOO==bar" && set "PACKER_BUILDER_TYPE=iso" && set "PACKER_BUILD_NAME=vmware" && `, } p := new(Provisioner) p.generatedData = generatedData() p.Prepare(config) // Defaults provided by Packer p.config.PackerBuildName = "vmware" p.config.PackerBuilderType = "iso" for i, expectedValue := range expected { p.config.Vars = userEnvVarTests[i] flattenedEnvVars = p.createFlattenedEnvVars() if flattenedEnvVars != expectedValue { t.Fatalf("expected flattened env vars to be: %s, got %s.", expectedValue, flattenedEnvVars) } } } func TestCancel(t *testing.T) { // Don't actually call Cancel() as it performs an os.Exit(0) // which kills the 'go test' tool } func generatedData() map[string]interface{} { return map[string]interface{}{ "PackerHTTPAddr": commonsteps.HttpAddrNotImplemented, "PackerHTTPIP": commonsteps.HttpIPNotImplemented, "PackerHTTPPort": commonsteps.HttpPortNotImplemented, } } ��������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-shell/version/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022326�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/provisioner/windows-shell/version/version.go���������������������������������������0000664�0000000�0000000�00000000511�13771713062�0024337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/packer/packer-plugin-sdk/version" packerVersion "github.com/hashicorp/packer/version" ) var WindowsShellPluginVersion *version.PluginVersion func init() { WindowsShellPluginVersion = version.InitializePluginVersion( packerVersion.Version, packerVersion.VersionPrerelease) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/���������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0015152�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/build.ps1������������������������������������������������������������������0000664�0000000�0000000�00000005072�13771713062�0016702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<# .Synopsis Build script for Packer. .Description Build script for Packer for all supported platforms and architectures. By default the following OSs and architectures are targeted. OS: * linux * darwin * windows * freebsd * openbsd Architecture: * 386 * amd64 * arm If the environment variable PACKER_DEV is defined, then the OS and architecture of the go binary in the path is used. The built binary is stamped with the current version number of Packer, the latest git commit, and +CHANGES if there are any outstanding changes in the current repository, e.g. Packer v0.10.1.dev (3c736322ba3a5fcb3a4e92394011a2e56f396da6+CHANGES) The build artifacts for the current OS and architecture are copied to bin and $GOPATH\bin. .Example .\scripts\build.ps1 #> # This script builds the application from source for multiple platforms. # Get the parent directory of where this script is. $DIR = [System.IO.Path]::GetDirectoryName($PSScriptRoot) # Change into that directory Push-Location $DIR | Out-Null # Get the git commit $GIT_COMMIT = $(git.exe rev-parse HEAD) git.exe status --porcelain | Out-Null if ($LastExitCode -eq 0) { $GIT_DIRTY = "+CHANGES" } # If its dev mode, only build for ourself if (Test-Path env:PACKER_DEV) { $XC_OS=$(go.exe env GOOS) $XC_ARCH=$(go.exe env GOARCH) } else { if (Test-Path env:XC_ARCH) { $XC_ARCH = $(Get-Content env:XC_ARCH) } else { $XC_ARCH="386 amd64 arm arm64 ppc64le" } if (Test-Path env:XC_OS) { $XC_OS = $(Get-Content env:XC_OS) } else { $XC_OS = "linux darwin windows freebsd openbsd solaris" } } # Delete the old dir echo "==> Removing old directory..." Remove-Item -Recurse -ErrorAction Ignore -Force "bin\" Remove-Item -Recurse -ErrorAction Ignore -Force "pkg\" New-Item -Type Directory -Name bin | Out-Null # Delete the old dir echo "==> Building..." gox.exe ` -os="${XC_OS}" ` -arch="${XC_ARCH}" ` -ldflags "-X github.com/hashicorp/packer/version.GitCommit=${GIT_COMMIT}${GIT_DIRTY}" ` -output "pkg/{{.OS}}_{{.Arch}}/packer" ` . if ($LastExitCode -ne 0) { exit 1 } # Move all the compiled things to the $GOPATH/bin $GOPATH=$(go.exe env GOPATH) # Copy our OS/Arch to the bin/ directory echo "==> Copying binaries for this platform..." Get-ChildItem ".\pkg\$(go env GOOS)_$(go env GOARCH)\" ` |? { !($_.PSIsContainer) } ` |% { Copy-Item $_.FullName "bin\" Copy-Item $_.FullName "${GOPATH}\bin\" } # Done! echo "`r`n==> Results:" Get-ChildItem bin\ ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/build.sh�������������������������������������������������������������������0000775�0000000�0000000�00000007743�13771713062�0016623�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash # This script builds the application from source for multiple platforms. # Determine the arch/os combos we're building for ALL_XC_ARCH="386 amd64 arm arm64 ppc64le mips mips64 mipsle mipsle64 s390x" ALL_XC_OS="linux darwin windows freebsd openbsd solaris" SKIPPED_OSARCH="!darwin/arm !darwin/arm64 !freebsd/arm !freebsd/arm64" # Exit immediately if a command fails set -e # Validates that a necessary tool is on the PATH function validateToolPresence { local TOOLNAME=$1 if ! which ${TOOLNAME} >/dev/null; then echo "${TOOLNAME} is not on the path. Exiting..." exit 1 fi } # Validates that all used tools are present; exits when any is not found function validatePreconditions { echo "==> Checking for necessary tools..." validateToolPresence realpath validateToolPresence dirname validateToolPresence tr validateToolPresence find } # Get the parent directory of where this script is. # NOTE: I'm unsure why you don't just use realpath like below function enterPackerSourceDir { echo "==> Entering Packer source dir..." local BUILD_SCRIPT_PATH="${BASH_SOURCE[0]}" SOURCEDIR=$(dirname $(dirname $(realpath "${BUILD_SCRIPT_PATH}"))) cd ${SOURCEDIR} } function ensureOutputStructure { echo "==> Ensuring output directories are present..." mkdir -p bin/ mkdir -p pkg/ } function cleanOutputDirs { echo "==> Removing old builds..." rm -f bin/* rm -fr pkg/* } function lowerCaseOSType { local OS_TYPE=${OSTYPE:=`uname`} echo "${OS_TYPE}" | tr "[:upper:]" "[:lower:]" } # Returns the OS appropriate path separator function getPathSeparator { # helpers for Cygwin-hosted builds case "$(lowerCaseOSType)" in mingw*|msys*|cygwin*) # cygwin only translates ';' to ':' on select environment variables echo ';' ;; *) echo ':' esac } function convertPathOnCygwin() { local flag local somePath if [ "${1:0:1}" = '-' ]; then flag=$1 somePath=$2 else somePath=$1 fi [ -n "${somePath}" ] || return 0 case "$(lowerCaseOSType)" in cygwin*) cygpath ${flag} -- "${somePath}" ;; *) echo "${somePath}" esac } validatePreconditions enterPackerSourceDir ensureOutputStructure cleanOutputDirs PATHSEP=$(getPathSeparator) # XXX works in MINGW? # FIXME: What if go is not in the PATH and GOROOT isn't set? which go &>/dev/null || PATH+=":`convertPathOnCygwin "${GOROOT:?}"`/bin" OLDIFS="${IFS}" # make sure GOPATH is consistent - Windows binaries can't handle Cygwin-style paths IFS="${PATHSEP}" for d in ${GOPATH:-$(go env GOPATH)}; do _GOPATH+="${_GOPATH:+${PATHSEP}}$(convertPathOnCygwin --windows "${d}")" done GOPATH="$_GOPATH" # locate 'gox' and traverse GOPATH if needed which "${GOX:=gox}" &>/dev/null || { for d in ${GOPATH}; do GOX="$(convertPathOnCygwin --unix "${d}")/bin/gox" [ -x "${GOX}" ] && break || unset GOX done } IFS="$OLDIFS" # Build! echo "==> Building..." # If in dev mode, only build for ourself if [ -n "${PACKER_DEV+x}" ]; then XC_OS=$(go env GOOS) XC_ARCH=$(go env GOARCH) fi export CGO_ENABLED=0 set +e ${GOX:?command not found} \ -os="${XC_OS:-$ALL_XC_OS}" \ -arch="${XC_ARCH:-$ALL_XC_ARCH}" \ -osarch="${SKIPPED_OSARCH}" \ -ldflags "${GOLDFLAGS}" \ -output "pkg/{{.OS}}_{{.Arch}}/packer" \ . set -e # trim GOPATH to first element IFS="${PATHSEP}" # FIXME: How do you know that the first path of GOPATH is the main GOPATH? Or is the main GOPATH meant to be the first path in GOPATH? MAIN_GOPATH=(${GOPATH}) MAIN_GOPATH="$(convertPathOnCygwin --unix "${MAIN_GOPATH[0]}")" IFS="${OLDIFS}" # Copy our OS/Arch to the bin/ directory echo "==> Copying binaries for this platform..." DEV_PLATFORM="./pkg/$(go env GOOS)_$(go env GOARCH)" for F in $(find ${DEV_PLATFORM} -mindepth 1 -maxdepth 1 -type f); do cp -v ${F} bin/ cp -v ${F} "${MAIN_GOPATH}/bin/" done # Done! echo echo "==> Results:" ls -hl bin/ �����������������������������packer-1.6.6+ds1/scripts/codesign_example.sh��������������������������������������������������������0000775�0000000�0000000�00000012323�13771713062�0021020�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/env bash set -euo pipefail # first makes some assertions about the environment and set some shared # variables before starting the script. if ! command -v jq > /dev/null 2>&1; then echo "This script requires jq to work properly." exit 1 fi if ! command -v sha256sum > /dev/null 2>&1; then if !command -v gsha256sum > /dev/null 2>&1; then echo "This script requires sha256sum (linux) or gsha256sum (osx) to work properly." exit 1 else SHASUM_PROG=gsha256sum fi else SHASUM_PROG=sha256sum fi PRODUCT_NAME="${PRODUCT_NAME:-""}" if [ -z "$PRODUCT_NAME" ]; then echo "Missing required product name: ${PRODUCT_NAME}" exit 1 fi TARGET_ZIP="${TARGET_ZIP:-""}" if [ -z "$TARGET_ZIP" ]; then echo "Missing required target path" exit 1 fi # Artifactory configuration ARTIFACTORY_ENDPOINT="${ARTIFACTORY_ENDPOINT:-"https://artifactory.hashicorp.engineering/artifactory"}" ARTIFACTORY_INPUT_REPO="${ARTIFACTORY_INPUT_REPO:-"hc-signing-input"}" ARTIFACTORY_OUTPUT_REPO="${ARTIFACTORY_OUTPUT_REPO:-"hc-signing-output"}" ARTIFACTORY_TOKEN="${ARTIFACTORY_TOKEN:-""}" ARTIFACTORY_USER="${ARTIFACTORY_USER:-""}" if [[ -z "$ARTIFACTORY_TOKEN" || -z "$ARTIFACTORY_USER" ]]; then echo "Missing required Artifactory credentials" exit 1 fi # Create the sign/notarize ID "SN_ID" if command -v uuidgen > /dev/null 2>&1; then uuid="$(uuidgen)" elif [ -f /proc/sys/kernel/random/uuid ]; then uuid="$(cat /proc/sys/kernel/random/uuid)" else echo "This script needs some way to generate a uuid." exit 1 fi SN_ID="$uuid" # CircleCI configuration CIRCLE_ENDPOINT="${CIRCLE_ENDPOINT:-"https://circleci.com/api/v2"}" CIRCLE_PROJECT="${CIRCLE_PROJECT:-"project/github/hashicorp/circle-codesign"}" CIRCLE_TOKEN="${CIRCLE_TOKEN:-""}" if [ -z "$CIRCLE_TOKEN" ]; then echo "Missing required CircleCI credentials" exit 1 fi # Next, upload an unsigned zip file to the Artifactory at # https://artifactory.hashicorp.engineering/artifactory/hc-signing-input/{PRODUCT}/{ID}.zip echo "Uploading unsigned zip to ${ARTIFACTORY_ENDPOINT}/${ARTIFACTORY_INPUT_REPO}/${PRODUCT_NAME}/${SN_ID}.zip" curl --show-error --silent --fail \ --user "${ARTIFACTORY_USER}:${ARTIFACTORY_TOKEN}" \ --request PUT \ "${ARTIFACTORY_ENDPOINT}/${ARTIFACTORY_INPUT_REPO}/${PRODUCT_NAME}/${SN_ID}.zip" \ --upload-file "$TARGET_ZIP" > /dev/null # Next, start the CircleCI Pipeline, then wait for a Workflow # to start. echo "Executing CircleCI job" res="$(curl --show-error --silent --fail --user "${CIRCLE_TOKEN}:" \ --request POST \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data "{ \"branch\": \"master\" ,\"parameters\": { \"PRODUCT\": \"${PRODUCT_NAME}\", \"PKG_NAME\": \"${SN_ID}.zip\" } }" \ "${CIRCLE_ENDPOINT}/${CIRCLE_PROJECT}/pipeline")" pipeline_id="$(echo "$res" | jq -r '.id')" echo "CircleCI Pipeline $pipeline_id started" echo -n "Retrieving CircleCI Workflow ID" # 24 * 5 seconds = 2 minutes counter=12 workflow_id="" # wait until a Workflow ID is found until [ "$workflow_id" != "" ]; do echo -n "." workflow_id=$(curl --silent --fail --user "${CIRCLE_TOKEN}:" \ --request GET \ --header 'Accept: application/json' \ "${CIRCLE_ENDPOINT}/pipeline/${pipeline_id}/workflow" \ | jq -r '.items[].id' ) if [ "$counter" -eq "0" ]; then echo "Tried too many times, but Pipeline ${pipeline_id} still has no Workflows" exit 1 fi counter=$((counter - 1)) sleep 5 done echo "" echo "CircleCI Workflow $workflow_id started" # Next, wait for the Workflow to reach a terminal state, then fails if it isn't # "success" echo -n "Waiting for CircleCI Workflow ID: ${workflow_id}" # 360 * 5 seconds = 30 minutes counter=360 finished="not_run" # wait for one of the terminal states: ["success", "failed", "error", "canceled"] until [[ "$finished" == "success" || "$finished" == "failed" || "$finished" == "error" || "$finished" == "canceled" ]]; do echo -n "." finished=$(curl --silent --fail --user "${CIRCLE_TOKEN}:" \ --header 'Accept: application/json' \ "${CIRCLE_ENDPOINT}/workflow/${workflow_id}" \ | jq -r '.status' ) if [ "$counter" -eq "0" ]; then echo "Tried too many times, but workflow is still in state ${finished}" exit 1 fi counter=$((counter - 1)) sleep 5 done echo "" if [ "$finished" != "success" ]; then echo "Workflow ID ${workflow_id} ${finished}" exit 1 fi # Next, download the signed zip from Artifactory at # https://artifactory.hashicorp.engineering/artifactory/hc-signing-output/{PRODUCT}/{ID}.zip echo "Retrieving signed zip from ${ARTIFACTORY_ENDPOINT}/${ARTIFACTORY_OUTPUT_REPO}/${PRODUCT_NAME}/${SN_ID}.zip" curl --show-error --silent --fail --user "${ARTIFACTORY_USER}:${ARTIFACTORY_TOKEN}" \ --request GET \ "${ARTIFACTORY_ENDPOINT}/${ARTIFACTORY_OUTPUT_REPO}/${PRODUCT_NAME}/${SN_ID}.zip" \ --output "signed_${SN_ID}.zip" signed_checksum=$( curl --silent --show-error --fail --user "${ARTIFACTORY_USER}:${ARTIFACTORY_TOKEN}" \ --head \ "${ARTIFACTORY_ENDPOINT}/${ARTIFACTORY_OUTPUT_REPO}/${PRODUCT_NAME}/${SN_ID}.zip" \ | grep -i "x-checksum-sha256" | awk 'gsub("[\r\n]", "", $2) {print $2;}' ) echo "${signed_checksum} signed_${SN_ID}.zip" | $SHASUM_PROG -c if [ $? -ne 0 ]; then exit 1 fi mv "signed_${SN_ID}.zip" "$TARGET_ZIP" �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/dist.sh��������������������������������������������������������������������0000775�0000000�0000000�00000002466�13771713062�0016464�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash set -e # Get the parent directory of where this script is. SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" # Change into that dir because we expect that cd $DIR # Get the version from the command line VERSION=$1 if [ -z $VERSION ]; then echo "Please specify version" exit 1 fi # Tag, unless told not to if [ -z $NOTAG ]; then echo "==> Tagging..." git commit --allow-empty -a --gpg-sign=348FFC4C -m "Cut version $VERSION" git tag -a -m "Version $VERSION" -s -u 348FFC4C "v${VERSION}" $RELBRANCH fi # Zip all the files rm -rf ./pkg/dist mkdir -p ./pkg/dist for PLATFORM in $(find ./pkg -mindepth 1 -maxdepth 1 -type d); do OSARCH=$(basename ${PLATFORM}) if [ $OSARCH = "dist" ]; then continue fi echo "--> ${OSARCH}" pushd $PLATFORM >/dev/null 2>&1 zip ../dist/packer_${VERSION}_${OSARCH}.zip ./* popd >/dev/null 2>&1 done ./scripts/sign.sh if [ $? -ne 0 ]; then exit 1 fi if [ -z $NOSIGN ]; then echo "==> Signing..." pushd ./pkg/dist rm -f ./packer_${VERSION}_SHA256SUMS* shasum -a256 * > ./packer_${VERSION}_SHA256SUMS gpg --default-key 348FFC4C --detach-sig ./packer_${VERSION}_SHA256SUMS popd fi hc-releases upload $DIR/pkg/dist/ hc-releases publish exit 0 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/generate-plugins.go��������������������������������������������������������0000664�0000000�0000000�00000022353�13771713062�0020757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Generate Plugins is a small program that updates the lists of plugins in // command/plugin.go so they will be compiled into the main packer binary. // // See https://github.com/hashicorp/packer/pull/2608 for details. package main import ( "fmt" "go/ast" "go/parser" "go/token" "io/ioutil" "log" "os" "path/filepath" "sort" "strings" "golang.org/x/tools/imports" ) const target = "command/plugin.go" func main() { wd, _ := os.Getwd() if filepath.Base(wd) != "packer" { log.Fatalf("This program must be invoked in the packer project root; in %s", wd) } // Collect all of the data we need about plugins we have in the project builders, err := discoverBuilders() if err != nil { log.Fatalf("Failed to discover builders: %s", err) } provisioners, err := discoverProvisioners() if err != nil { log.Fatalf("Failed to discover provisioners: %s", err) } postProcessors, err := discoverPostProcessors() if err != nil { log.Fatalf("Failed to discover post processors: %s", err) } // Do some simple code generation and templating output := source output = strings.Replace(output, "IMPORTS", makeImports(builders, provisioners, postProcessors), 1) output = strings.Replace(output, "BUILDERS", makeMap("Builders", "Builder", builders), 1) output = strings.Replace(output, "PROVISIONERS", makeMap("Provisioners", "Provisioner", provisioners), 1) output = strings.Replace(output, "POSTPROCESSORS", makeMap("PostProcessors", "PostProcessor", postProcessors), 1) // TODO sort the lists of plugins so we are not subjected to random OS ordering of the plugin lists // TODO format the file // Write our generated code to the command/plugin.go file file, err := os.Create(target) if err != nil { log.Fatalf("Failed to open %s for writing: %s", target, err) } defer file.Close() output = string(goFmt(target, []byte(output))) _, err = file.WriteString(output) if err != nil { log.Fatalf("Failed writing to %s: %s", target, err) } log.Printf("Generated %s", target) } func goFmt(filename string, b []byte) []byte { fb, err := imports.Process(filename, b, nil) if err != nil { log.Printf("formatting err: %v", err) return b } return fb } type plugin struct { Package string // This plugin's package name (iso) PluginName string // Name of plugin (vmware-iso) TypeName string // Type of plugin (builder) Path string // Path relative to packer root (builder/vmware/iso) ImportName string // PluginName+TypeName (vmwareisobuilder) } // makeMap creates a map named Name with type packer.Name that looks something // like this: // // var Builders = map[string]packersdk.Builder{ // "amazon-chroot": new(chroot.Builder), // "amazon-ebs": new(ebs.Builder), // "amazon-instance": new(instance.Builder), func makeMap(varName, varType string, items []plugin) string { output := "" output += fmt.Sprintf("var %s = map[string]packersdk.%s{\n", varName, varType) for _, item := range items { output += fmt.Sprintf("\t\"%s\": new(%s.%s),\n", item.PluginName, item.ImportName, item.TypeName) } output += "}\n" return output } func makeImports(builders, provisioners, postProcessors []plugin) string { plugins := []string{} for _, builder := range builders { plugins = append(plugins, fmt.Sprintf("\t%s \"github.com/hashicorp/packer/%s\"\n", builder.ImportName, filepath.ToSlash(builder.Path))) } for _, provisioner := range provisioners { plugins = append(plugins, fmt.Sprintf("\t%s \"github.com/hashicorp/packer/%s\"\n", provisioner.ImportName, filepath.ToSlash(provisioner.Path))) } for _, postProcessor := range postProcessors { plugins = append(plugins, fmt.Sprintf("\t%s \"github.com/hashicorp/packer/%s\"\n", postProcessor.ImportName, filepath.ToSlash(postProcessor.Path))) } // Make things pretty sort.Strings(plugins) return strings.Join(plugins, "") } // listDirectories recursively lists directories under the specified path func listDirectories(path string) ([]string, error) { names := []string{} items, err := ioutil.ReadDir(path) if err != nil { return names, err } for _, item := range items { // We only want directories if !item.IsDir() || item.Name() == "common" { continue } currentDir := filepath.Join(path, item.Name()) names = append(names, currentDir) // Do some recursion subNames, err := listDirectories(currentDir) if err == nil { names = append(names, subNames...) } } return names, nil } // deriveName determines the name of the plugin (what you'll see in a packer // template) based on the filesystem path. We use two rules: // // Start with -> builder/virtualbox/iso // // 1. Strip the root -> virtualbox/iso // 2. Switch slash / to dash - -> virtualbox-iso func deriveName(root, full string) string { short, _ := filepath.Rel(root, full) bits := strings.Split(short, string(os.PathSeparator)) return strings.Join(bits, "-") } // deriveImport will build a unique import identifier based on packageName and // the result of deriveName() // // This will be something like -> virtualboxisobuilder // // Which is long, but deterministic and unique. func deriveImport(typeName, derivedName string) string { return strings.Replace(derivedName, "-", "", -1) + strings.ToLower(typeName) } // discoverTypesInPath searches for types of typeID in path and returns a list // of plugins it finds. func discoverTypesInPath(path, typeID string) ([]plugin, error) { postProcessors := []plugin{} dirs, err := listDirectories(path) if err != nil { return postProcessors, err } for _, dir := range dirs { fset := token.NewFileSet() goPackages, err := parser.ParseDir(fset, dir, nil, parser.AllErrors) if err != nil { return postProcessors, fmt.Errorf("Failed parsing directory %s: %s", dir, err) } for _, goPackage := range goPackages { ast.PackageExports(goPackage) ast.Inspect(goPackage, func(n ast.Node) bool { switch x := n.(type) { case *ast.TypeSpec: if x.Name.Name == typeID { derivedName := deriveName(path, dir) postProcessors = append(postProcessors, plugin{ Package: goPackage.Name, PluginName: derivedName, ImportName: deriveImport(x.Name.Name, derivedName), TypeName: x.Name.Name, Path: dir, }) // The AST stops parsing when we return false. Once we // find the symbol we want we can stop parsing. // DEBUG: // fmt.Printf("package %#v\n", goPackage) return false } } return true }) } } return postProcessors, nil } func discoverBuilders() ([]plugin, error) { path := "./builder" typeID := "Builder" return discoverTypesInPath(path, typeID) } func discoverProvisioners() ([]plugin, error) { path := "./provisioner" typeID := "Provisioner" return discoverTypesInPath(path, typeID) } func discoverPostProcessors() ([]plugin, error) { path := "./post-processor" typeID := "PostProcessor" return discoverTypesInPath(path, typeID) } const source = `// // This file is automatically generated by scripts/generate-plugins.go -- Do not edit! // package command import ( "fmt" "log" "regexp" "strings" "github.com/hashicorp/packer/packer" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" "github.com/hashicorp/packer/packer-plugin-sdk/plugin" IMPORTS ) type PluginCommand struct { Meta } BUILDERS PROVISIONERS POSTPROCESSORS var pluginRegexp = regexp.MustCompile("packer-(builder|post-processor|provisioner)-(.+)") func (c *PluginCommand) Run(args []string) int { // This is an internal call (users should not call this directly) so we're // not going to do much input validation. If there's a problem we'll often // just crash. Error handling should be added to facilitate debugging. log.Printf("args: %#v", args) if len(args) != 1 { c.Ui.Error("Wrong number of args") return 1 } // Plugin will match something like "packer-builder-amazon-ebs" parts := pluginRegexp.FindStringSubmatch(args[0]) if len(parts) != 3 { c.Ui.Error(fmt.Sprintf("Error parsing plugin argument [DEBUG]: %#v", parts)) return 1 } pluginType := parts[1] // capture group 1 (builder|post-processor|provisioner) pluginName := parts[2] // capture group 2 (.+) server, err := plugin.Server() if err != nil { c.Ui.Error(fmt.Sprintf("Error starting plugin server: %s", err)) return 1 } switch pluginType { case "builder": builder, found := Builders[pluginName] if !found { c.Ui.Error(fmt.Sprintf("Could not load builder: %s", pluginName)) return 1 } server.RegisterBuilder(builder) case "provisioner": provisioner, found := Provisioners[pluginName] if !found { c.Ui.Error(fmt.Sprintf("Could not load provisioner: %s", pluginName)) return 1 } server.RegisterProvisioner(provisioner) case "post-processor": postProcessor, found := PostProcessors[pluginName] if !found { c.Ui.Error(fmt.Sprintf("Could not load post-processor: %s", pluginName)) return 1 } server.RegisterPostProcessor(postProcessor) } server.Serve() return 0 } func (*PluginCommand) Help() string { helpText := ` + "`" + ` Usage: packer plugin PLUGIN Runs an internally-compiled version of a plugin from the packer binary. NOTE: this is an internal command and you should not call it yourself. ` + "`" + ` return strings.TrimSpace(helpText) } func (c *PluginCommand) Synopsis() string { return "internal plugin command" } ` �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/off_gopath.sh��������������������������������������������������������������0000775�0000000�0000000�00000000472�13771713062�0017630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#! /usr/bin/env bash set -eu -o pipefail gpath=${GOPATH:-} if [ -z "$gpath" ]; then gpath=$HOME/go fi reldir=`dirname $0` curdir=`pwd` cd $reldir CUR_GO_DIR=`pwd` cd $curdir if [[ $CUR_GO_DIR == *"$gpath"* ]]; then # echo "You're on the gopath" exit 1 else # echo "You're not on the gopath" exit 0 fi������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/prepare_changelog.sh�������������������������������������������������������0000775�0000000�0000000�00000004467�13771713062�0021171�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/zsh LAST_RELEASE=$1 DO_PR_CHECK=1 set -o pipefail is_doc_or_tech_debt_pr(){ if ! (($+commands[jq])); then DO_PR_CHECK=0 echo "jq not found" return 1 fi out=$(cat pull.json | python -m json.tool \ | jq '[.labels[].name == "docs" or .labels[].name == "tech-debt" or .labels[].name == "website"] | any') grep -q true <<< $out return $? } if [ -z $LAST_RELEASE ]; then echo "you need to give the previous release version. prepare_changelog.sh v<version>" exit 1 fi get_prs(){ # git log v0.10.2...c3861d167533fb797b0fae0c380806625712e5f7 | git log HEAD...${LAST_RELEASE} --first-parent --oneline --grep="Merge pull request #[0-9]\+" --grep="(#[0-9]\+)$" | grep -o "#\([0-9]\+\)" | awk -F\# '{print $2}' | while read line do grep -q "GH-${line}" CHANGELOG.md if [ $? -ne 0 ]; then echo $line fi done | while read PR_NUM do if [[ -z "${GITHUB_TOKEN}" ]] || [[ -z "${GITHUB_USERNAME}" ]] ; then out=$(curl -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" -o pull.json) else # authenticated call out=$(curl -u ${GITHUB_USERNAME}:${GITHUB_TOKEN} -fsS "https://api.github.com/repos/hashicorp/packer/issues/${PR_NUM}" -o pull.json) fi exy="$?" if [ $exy -ne 0 ]; then echo "bad response from github: manually check PR ${PR_NUM}" continue fi if (($DO_PR_CHECK)) && is_doc_or_tech_debt_pr; then echo "Skipping PR ${PR_NUM}: labeled as tech debt, docs or website. (waiting a second so we don't get rate-limited...)" continue fi echo "$(cat pull.json | python -m json.tool | jq '.title') - https://github.com/hashicorp/packer/pull/${PR_NUM}" done } #is_doc_or_tech_debt_pr 52061111 # is_doc_or_tech_debt_pr 5206 # non-doc pr #is_doc_or_tech_debt_pr 5434 # doc pr #echo $? #exit # prpid=$! # trap 'kill -9 ${prpid}; exit' INT TERM get_prs | while read line; do echo $line if [[ "$line" =~ "bad" ]]; then exit 1 elif [[ "$line" =~ "Skipping" ]]; then sleep 1 # GH will rate limit us if we have several in a row continue fi rm -f pull.json vared -ch ok done #TODO: just generate it automatically using PR titles and tags ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/sign.sh��������������������������������������������������������������������0000775�0000000�0000000�00000001773�13771713062�0016461�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ #!/usr/bin/env bash # This script uploads the Darwin builds to artifactory, then triggers the # circle ci job that signs them. # ARTIFACTORY_USER="sa-circle-codesign" # export PRODUCT_NAME="packer" # export ARTIFACTORY_TOKEN=$ARTIFACTORY_TOKEN ARTIFACTORY_TOKEN="${ARTIFACTORY_TOKEN:-""}" if [ -z "$ARTIFACTORY_TOKEN" ]; then echo "Missing required Artifactory credentials" exit 1 fi # Get the parent directory of where this script is. SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" # Change into that dir because we expect that cd $DIR BIN_UUIDS=() BUILD_NUMBERS=() for DARWIN_BIN in $(find ./pkg/dist/*darwin_*.zip); do echo "signing $DARWIN_BIN" export ARTIFACTORY_USER="sa-circle-codesign" export PRODUCT_NAME="packer" export ARTIFACTORY_TOKEN=$ARTIFACTORY_TOKEN export TARGET_ZIP=$DARWIN_BIN echo $TARGET_ZIP ./scripts/codesign_example.sh if [ $? -ne 0 ]; then exit 1 fi done exit 0 �����packer-1.6.6+ds1/scripts/sort-md-list.py������������������������������������������������������������0000775�0000000�0000000�00000004140�13771713062�0020064�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env python """ sort-md-list.py sorts markdown lists Use this script to prepare sections of the changelog. this script expects a bulleted markdown list in stdout for example ./sort-md-list.py - <<EOF * builder/amazon: Only delete temporary key if we created one. [GH-4850] * core: Correctly reject config files which have junk after valid json. [GH-4906] * builder/azure: Replace calls to panic with error returns. [GH-4846] * communicator/winrm: Use KeepAlive to keep long-running connections open. [GH-4952] EOF output: * builder/amazon: Only delete temporary key if we created one. [GH-4850] * builder/azure: Replace calls to panic with error returns. [GH-4846] * communicator/winrm: Use KeepAlive to keep long-running connections open. [GH-4952] * core: Correctly reject config files which have junk after valid json. [GH-4906] As you can see, the output is sorted and spaced appropriately. Limitations: * nested lists are not supported * must be passed a list to stdin, it does not process the changelog * whitespace within the list is elided """ import fileinput import sys import textwrap if __name__ == '__main__': lines = [] working = [] for line in fileinput.input(): line = line.strip() if line.startswith('*'): if len(working): lines.append( " ".join(working)) working = [line] else: working.append(line) if len(working): lines.append( " ".join(working)) # take care of blank line at start of selection sys.stdin.seek(0) if sys.stdin.readlines()[0].strip() == "": print "" for line in sorted(lines, key=lambda s: s.lower()): if line.strip() == "": continue # print "-"*79 wrapped = textwrap.wrap(line, 79) print wrapped[0] indented = " ".join([s.strip() for s in wrapped[1:]]) for iline in textwrap.wrap(indented, 79-4): print " " + iline # take care of blank line at end of selection sys.stdin.seek(0) if sys.stdin.readlines()[-1].strip() == "": print "" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/vagrant-freebsd-priv-config.sh���������������������������������������������0000775�0000000�0000000�00000001266�13771713062�0023011�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh chown vagrant:wheel \ /opt/gopath \ /opt/gopath/src \ /opt/gopath/src/github.com \ /opt/gopath/src/github.com/hashicorp mkdir -p /usr/local/etc/pkg/repos cat <<EOT > /usr/local/etc/pkg/repos/FreeBSD.conf FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/\${ABI}/latest" } EOT pkg update pkg install -y \ editors/vim-console \ devel/git \ devel/gmake \ lang/go \ security/ca_root_nss \ shells/bash chsh -s /usr/local/bin/bash vagrant chsh -s /usr/local/bin/bash root cat <<EOT >> /home/vagrant/.profile export GOPATH=/opt/gopath export PATH=\$GOPATH/bin:\$PATH cd /opt/gopath/src/github.com/hashicorp/packer EOT ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/vagrant-freebsd-unpriv-bootstrap.sh����������������������������������������0000775�0000000�0000000�00000000207�13771713062�0024116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/bin/sh export GOPATH=/opt/gopath PATH=$GOPATH/bin:$PATH export PATH cd /opt/gopath/src/github.com/hashicorp/packer && gmake deps �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/vagrant-linux-priv-config.sh�����������������������������������������������0000775�0000000�0000000�00000000723�13771713062�0022533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash export DEBIAN_FRONTEND=noninteractive # Update and ensure we have apt-add-repository apt-get update apt-get install -y software-properties-common apt-get install -y bzr \ curl \ gcc \ git \ make \ mercurial \ zip # Ensure we cd into the working directory on login if ! grep "cd /opt/gopath/src/github.com/hashicorp/packer" /home/vagrant/.profile ; then echo 'cd /opt/gopath/src/github.com/hashicorp/packer' >> /home/vagrant/.profile fi ���������������������������������������������packer-1.6.6+ds1/scripts/vagrant-linux-priv-go.sh���������������������������������������������������0000775�0000000�0000000�00000001567�13771713062�0021702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash function install_go() { local go_version=1.13 local download= download="https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz" if [ -d /usr/local/go ] ; then return fi wget -q -O /tmp/go.tar.gz ${download} tar -C /tmp -xf /tmp/go.tar.gz sudo mv /tmp/go /usr/local sudo chown -R root:root /usr/local/go } install_go # Ensure that the GOPATH tree is owned by vagrant:vagrant mkdir -p /opt/gopath chown -R vagrant:vagrant /opt/gopath # Ensure Go is on PATH if [ ! -e /usr/bin/go ] ; then ln -s /usr/local/go/bin/go /usr/bin/go fi if [ ! -e /usr/bin/gofmt ] ; then ln -s /usr/local/go/bin/gofmt /usr/bin/gofmt fi # Ensure new sessions know about GOPATH if [ ! -f /etc/profile.d/gopath.sh ] ; then cat <<EOT > /etc/profile.d/gopath.sh export GOPATH="/opt/gopath" export PATH="/opt/gopath/bin:\$PATH" EOT chmod 755 /etc/profile.d/gopath.sh fi �����������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/scripts/vagrant-linux-unpriv-bootstrap.sh������������������������������������������0000775�0000000�0000000�00000000120�13771713062�0023635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash cd /opt/gopath/src/github.com/hashicorp/packer && make dev ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/������������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0014442�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/README.md���������������������������������������������������������������������0000664�0000000�0000000�00000004131�13771713062�0015720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Packer Black-Box Tests This folder contains tests that test Packer using a black-box approach: `packer` is executed directly (with whatever is on the PATH) and certain results are expected. Tests are run using [Bats](https://github.com/sstephenson/bats), and therefore Bash is required to run any tests. **Warning:** Many of these tests run using cloud infrastructure, and therefore have a real-world cost associated with running the tests. Be aware of that prior to running the tests. Additionally, many tests will leave left-over artifacts (AMIs) that you'll have to manually clean up. ## Running Tests ### Required Software Before running the tests, you'll need the following installed. If you're running on macOS, most of these are available with `brew`: * [Bats](https://github.com/sstephenson/bats) * [AWS cli](http://aws.amazon.com/cli/) for AWS tests as well as most of the components. * [gcutil](https://developers.google.com/compute/docs/gcutil/#install) for Google Compute Engine tests. * [h1-cli](https://github.com/hyperonecom/h1-client-go) for HyperOne tests. ### Configuring Tests **For tests that require AWS credentials:** Set the following self-explanatory environmental variables: * `AWS_ACCESS_KEY_ID` * `AWS_SECRET_ACCESS_KEY` **For tests that test Google Compute Engine:** Set the following environmental variables: * `GC_BUCKET_NAME` * `GC_ACCOUNT_FILE` * `GC_PROJECT_ID` **For tests that test HyperOne:** Set the following environmental variables: * `HYPERONE_TOKEN` * `HYPERONE_PROJECT` You have to be authenticated within the `h1` tool (use `h1 login`). ### Running These tests are meant to be run _one file at a time_. There are some test files (such as the amazon-chroot builder test) that simply won't run except in special environments, so running all test files will probably never work. If you're working on Packer and want to test that your change didn't adversely affect something, try running only the test that is related to your change. ``` $ bats builder_amazon_ebs.bats ``` Note: Working directory doesn't matter. You can call the bats test file from any directory. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/builder_googlecompute.bats����������������������������������������������������0000775�0000000�0000000�00000002105�13771713062�0021675�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the googlecompute builder. The teardown function will # delete any images with the text "packerbats" within the name. load test_helper fixtures builder-googlecompute # Required parameters : ${GC_ACCOUNT_FILE:?} : ${GC_PROJECT_ID:?} command -v gcloud >/dev/null 2>&1 || { echo "'gcloud' must be installed" >&2 exit 1 } USER_VARS="${USER_VARS} -var account_file=${GC_ACCOUNT_FILE}" USER_VARS="${USER_VARS} -var project_id=${GC_PROJECT_ID}" # This tests if GCE has an image that contains the given parameter. gc_has_image() { gcloud compute --format='table[no-heading](name)' --project=${GC_PROJECT_ID} images list \ | grep $1 | wc -l } teardown() { gcloud compute --format='table[no-heading](name)' --project=${GC_PROJECT_ID} images list \ | grep packerbats \ | xargs -n1 gcloud compute --project=${GC_PROJECT_ID} images delete } @test "googlecompute: build minimal.json" { run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-minimal")" -eq 1 ] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/builder_hyperone.bats���������������������������������������������������������0000775�0000000�0000000�00000002634�13771713062�0020664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the hyperone builder. The teardown function will # delete any images with the text "packerbats" within the name. load test_helper fixtures builder-hyperone # Required parameters : ${HYPERONE_TOKEN:?} : ${HYPERONE_PROJECT:?} command -v h1 >/dev/null 2>&1 || { echo "'h1' must be installed" >&2 exit 1 } USER_VARS="${USER_VARS} -var token=${HYPERONE_TOKEN}" USER_VARS="${USER_VARS} -var project=${HYPERONE_PROJECT}" hyperone_has_image() { h1 image list --project-select=${HYPERONE_PROJECT} --query "[?tag.${2}=='${3}']" --output=tsv | grep $1 -c } teardown() { h1 image list --project-select=${HYPERONE_PROJECT} --output=tsv \ | grep packerbats \ | awk '{print $1}' \ | xargs -n1 h1 image delete --project-select=${HYPERONE_PROJECT} --yes --image } @test "hyperone: build minimal.json" { run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json [ "$status" -eq 0 ] [ "$(hyperone_has_image "packerbats-minimal" "key" "value")" -eq 1 ] } @test "hyperone: build new-syntax.pkr.hcl" { run packer build ${USER_VARS} $FIXTURE_ROOT/new-syntax.pkr.hcl [ "$status" -eq 0 ] [ "$(hyperone_has_image "packerbats-hcl" "key" "value")" -eq 1 ] } @test "hyperone: build chroot.json" { run packer build ${USER_VARS} $FIXTURE_ROOT/chroot.json [ "$status" -eq 0 ] [ "$(hyperone_has_image "packerbats-chroot" "key2" "value2")" -eq 1 ] } ����������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/builder_lxc.bats��������������������������������������������������������������0000664�0000000�0000000�00000006125�13771713062�0017615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the lxc builder by creating minimal containers and checking that # custom lxc container configuration files are successfully applied. The # teardown function will delete any images in the output-lxc-* folders along # with the auto-generated lxc container configuration files and hook scripts. #load test_helper #fixtures builder-lxc FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures/builder-lxc" have_command() { command -v "$1" >/dev/null 2>&1 } # Required parameters have_command lxc-create || { echo "'lxc-create' must be installed via the lxc (or lxc1 for ubuntu >=16.04) package" >&2 exit 1 } DESTROY_HOOK_SCRIPT=$FIXTURE_ROOT/destroy-hook.sh DESTROY_HOOK_LOG=$FIXTURE_ROOT/destroy-hook.log printf > "$DESTROY_HOOK_SCRIPT" ' echo "$LXC_NAME" > "%s" ' "$DESTROY_HOOK_LOG" chmod +x "$DESTROY_HOOK_SCRIPT" INIT_CONFIG=$FIXTURE_ROOT/lxc.custom.conf printf > "$INIT_CONFIG" ' lxc.hook.destroy = %s ' "$DESTROY_HOOK_SCRIPT" teardown() { for f in "$INIT_CONFIG" "$DESTROY_HOOK_SCRIPT" "$DESTROY_HOOK_LOG"; do [ -e "$f" ] && rm -f "$f" done rm -rf output-lxc-* } assert_build() { local template_name="$1" shift local build_status=0 run packer build -var template_name="$template_name" "$@" [ "$status" -eq 0 ] || { echo "${template_name} build exited badly: $status" >&2 echo "$output" >&2 build_status="$status" } for expected in "output-lxc-${template_name}"/{rootfs.tar.gz,lxc-config}; do [ -f "$expected" ] || { echo "missing expected artifact '${expected}'" >&2 build_status=1 } done return $build_status } assert_container_name() { local container_name="$1" [ -f "$DESTROY_HOOK_LOG" ] || { echo "missing expected lxc.hook.destroy logfile '$DESTROY_HOOK_LOG'" return 1 } read -r lxc_name < "$DESTROY_HOOK_LOG" [ "$lxc_name" = "$container_name" ] } @test "lxc: build centos minimal.json" { have_command yum || skip "'yum' must be installed to build centos containers" local container_name=packer-lxc-centos assert_build centos -var init_config="$INIT_CONFIG" \ -var container_name="$container_name" \ $FIXTURE_ROOT/minimal.json assert_container_name "$container_name" } @test "lxc: build trusty minimal.json" { have_command debootstrap || skip "'debootstrap' must be installed to build ubuntu containers" local container_name=packer-lxc-ubuntu assert_build ubuntu -var init_config="$INIT_CONFIG" \ -var container_name="$container_name" \ -var template_parameters="SUITE=trusty" \ $FIXTURE_ROOT/minimal.json assert_container_name "$container_name" } @test "lxc: build debian minimal.json" { have_command debootstrap || skip "'debootstrap' must be installed to build debian containers" local container_name=packer-lxc-debian assert_build debian -var init_config="$INIT_CONFIG" \ -var container_name="$container_name" \ -var template_parameters="SUITE=jessie" \ $FIXTURE_ROOT/minimal.json assert_container_name "$container_name" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/cli.bats����������������������������������������������������������������������0000775�0000000�0000000�00000001413�13771713062�0016066�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the basic CLI functionality of Packer. It makes no network # requests and should be very fast. load test_helper @test "cli: packer should show help" { run packer [ "$status" -eq 1 ] [[ "$output" == *"usage: packer"* ]] } @test "cli: packer version" { run packer version [ "$status" -eq 0 ] [[ "$output" == *"Packer v"* ]] run packer -v [ "$status" -eq 1 ] [[ "$output" =~ ([0-9]+\.[0-9]+) ]] run packer --version [ "$status" -eq 1 ] [[ "$output" =~ ([0-9]+\.[0-9]+) ]] } @test "cli: packer version show help" { run packer version -h [ "$status" -eq 0 ] [[ "$output" == *"Packer v"* ]] run packer version --help [ "$status" -eq 0 ] [[ "$output" == *"Packer v"* ]] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/communicator_ssh.bats���������������������������������������������������������0000664�0000000�0000000�00000001415�13771713062�0020673�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the ssh communicator using AWS builder. The teardown function will automatically # delete any AMIs with a tag of `packer-test` being equal to "true" so # be sure any test cases set this. load test_helper verify_aws_cli fixtures communicator-ssh setup() { cd $FIXTURE_ROOT } teardown() { aws_ami_cleanup } @test "shell provisioner: local port tunneling" { run packer build $FIXTURE_ROOT/local-tunnel.json [ "$status" -eq 0 ] [[ "$output" == *"Connection to localhost port 10022 [tcp/*] succeeded"* ]] } @test "shell provisioner: remote port tunneling" { run packer build $FIXTURE_ROOT/remote-tunnel.json [ "$status" -eq 0 ] MY_LOCAL_IP=$(curl -s https://ifconfig.co/) [[ "$output" == *"$MY_LOCAL_IP"* ]] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/���������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0016313�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/amazon-ebs/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020347�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/amazon-ebs/ami_region_copy.json��������������������������������������0000664�0000000�0000000�00000000626�13771713062�0024411�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true", "packer-id": "ami_region_copy" }, "ami_regions": ["us-west-1", "us-west-2"] }] } ����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/amazon-ebs/minimal.json����������������������������������������������0000664�0000000�0000000�00000000467�13771713062�0022677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }] } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-googlecompute/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022610�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-googlecompute/minimal.json�����������������������������������0000664�0000000�0000000�00000000605�13771713062�0025132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "account_file": null, "project_id": null }, "builders": [{ "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-minimal-{{timestamp}}", "source_image": "debian-7-wheezy-v20141108", "zone": "us-central1-a" }] } ���������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-hyperone/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021570�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-hyperone/chroot.json�����������������������������������������0000664�0000000�0000000�00000001537�13771713062�0023767�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "token": null, "project": null }, "builders": [{ "token": "{{ user `token` }}", "project": "{{ user `project` }}", "type": "hyperone", "source_image": "ubuntu", "disk_size": 10, "vm_type": "a1.nano", "chroot_disk": true, "chroot_command_wrapper": "sudo {{.Command}}", "pre_mount_commands": [ "parted {{.Device}} mklabel msdos mkpart primary 1M 100% set 1 boot on print", "mkfs.ext4 {{.Device}}1" ], "post_mount_commands": [ "apt-get update", "apt-get install debootstrap", "debootstrap --arch amd64 bionic {{.MountPath}}" ], "image_name": "packerbats-chroot-{{timestamp}}", "image_tags": { "key2":"value2" } }], "provisioners": [] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-hyperone/minimal.json����������������������������������������0000664�0000000�0000000�00000000625�13771713062�0024114�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "token": null, "project": null }, "builders": [{ "token": "{{ user `token` }}", "project": "{{ user `project` }}", "type": "hyperone", "source_image": "ubuntu", "disk_size": 10, "vm_type": "a1.nano", "image_name": "packerbats-minimal-{{timestamp}}", "image_tags": { "key":"value" } }] } �����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-hyperone/new-syntax.pkr.hcl����������������������������������0000664�0000000�0000000�00000000646�13771713062�0025176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������variable "token" { type = string } variable "project" { type = string } source "hyperone" "new-syntax" { token = var.token project = var.project source_image = "debian" disk_size = 10 vm_type = "a1.nano" image_name = "packerbats-hcl-{{timestamp}}" image_tags = { key="value" } } build { sources = [ "source.hyperone.new-syntax" ] provisioner "shell" { inline = ["sleep 5"] } }������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-linode/������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021211�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-linode/minimal.json������������������������������������������0000664�0000000�0000000�00000001220�13771713062�0023525�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "linode_token": "{{env `LINODE_TOKEN`}}" }, "builders": [ { "type": "linode", "linode_token": "{{user `linode_token`}}", "region": "us-central", "swap_size": 256, "image": "linode/debian9", "instance_type": "g6-nanode-1", "instance_label": "packerbats-minimal-{{timestamp}}", "image_label": "packerbats-minimal-image-{{timestamp}}", "image_description": "packerbats", "ssh_username": "root" } ], "provisioners": [ { "type": "shell", "inline": ["echo Hello > /root/message.txt"] } ] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-lxc/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020525�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/builder-lxc/minimal.json���������������������������������������������0000664�0000000�0000000�00000001626�13771713062�0023053�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": { "template_name": "debian", "template_parameters": "SUITE=jessie", "container_name": "packer-lxc", "set_var": "hello" }, "provisioners": [ { "type": "shell", "inline": [ "if [ \"$SET_VAR\" != \"{{user `set_var`}}\" ]; then", " echo \"Got unexpected value '$SET_VAR' for SET_VAR\" 1>&2", " exit 1", "fi" ] } ], "builders": [ { "type": "lxc", "name": "lxc-{{user `template_name`}}", "template_name": "{{user `template_name`}}", "container_name": "{{user `container_name`}}", "create_options": [ "-f", "{{user `init_config`}}" ], "attach_options": [ "--clear-env", "--set-var", "SET_VAR={{user `set_var`}}" ], "config_file": "/usr/share/lxc/config/{{user `template_name`}}.common.conf", "template_environment_vars": [ "{{user `template_parameters`}}" ] } ] } ����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/communicator-ssh/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021606�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/communicator-ssh/local-tunnel.json�����������������������������������0000664�0000000�0000000�00000001003�13771713062�0025070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "ssh_local_tunnels": ["10022:localhost:22"], "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "shell-local", "inline": [ "echo | nc -G 5 -w 5 -v localhost 10022 2>&1" ] }] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/communicator-ssh/remote-tunnel.json����������������������������������0000664�0000000�0000000�00000001062�13771713062�0025276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "t2.micro", "region": "us-east-1", "ssh_username": "ubuntu", "ssh_remote_tunnels": ["8443:ifconfig.co:443"], "source_ami": "ami-0111e8c43a763eb71", "tags": { "packer-test": "true" } }], "provisioners": [{ "inline": [ "curl -kvs --connect-to ifconfig.co:443:localhost:8443 https://ifconfig.co/" ], "type": "shell" } ] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022305�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/all_options.json���������������������������������0000664�0000000�0000000�00000002256�13771713062�0025530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "shell-local", "command": "echo 'TODO(bhcleek): write the public key to $HOME/.ssh/known_hosts and stop using ANSIBLE_HOST_KEY_CHECKING=False'" }, { "type": "ansible", "playbook_file": "./playbook.yml", "extra_arguments": [ "--private-key", "ansible-test-id" ], "sftp_command": "/usr/lib/sftp-server -e -l INFO", "use_sftp": true, "ansible_env_vars": ["PACKER_ANSIBLE_TEST=1", "ANSIBLE_HOST_KEY_CHECKING=False"], "groups": ["PACKER_TEST"], "empty_groups": ["PACKER_EMPTY_GROUP"], "host_alias": "packer-test", "user": "packer", "local_port": 2222, "ssh_host_key_file": "ansible-server.key", "ssh_authorized_key_file": "ansible-test-id.pub" } ], "builders": [{ "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-alloptions-{{timestamp}}", "source_image": "debian-8-jessie-v20161027", "zone": "us-central1-a", "ssh_username": "debian" }] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/connection_plugins/������������������������������0000775�0000000�0000000�00000000000�13771713062�0026205�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/connection_plugins/packer.py���������������������0000664�0000000�0000000�00000000777�13771713062�0030037�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.connection.ssh import Connection as SSHConnection class Connection(SSHConnection): ''' ssh based connections for powershell via packer''' transport = 'packer' has_pipelining = True become_methods = [] allow_executable = False module_implementation_preferences = ('.ps1', '') def __init__(self, *args, **kwargs): super(Connection, self).__init__(*args, **kwargs) �packer-1.6.6+ds1/test/fixtures/provisioner-ansible/dir/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023063�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/dir/contents-only/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025677�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/dir/contents-only/file.txt�����������������������0000664�0000000�0000000�00000000104�13771713062�0027352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������this file's parent directory should not be transferred to the node. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/dir/file.txt�������������������������������������0000664�0000000�0000000�00000000017�13771713062�0024541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This is a file �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/dir/subdir/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024353�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/dir/subdir/file.txt������������������������������0000664�0000000�0000000�00000000106�13771713062�0026030�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������This file and its parent directory should be transferred to the node. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/docker.json��������������������������������������0000664�0000000�0000000�00000000771�13771713062�0024454�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "shell", "inline": [ "apt-get update", "apt-get -y install python" ] }, { "type": "ansible", "playbook_file": "./playbook.yml", "extra_arguments": [ ], "sftp_command": "/usr/bin/false", "use_sftp": false } ], "builders": [ { "type": "docker", "image": "debian:jessie", "discard": true } ] } �������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/galaxy-playbook.yml������������������������������0000664�0000000�0000000�00000002561�13771713062�0026137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- - hosts: default:packer-test gather_facts: no collections: - artis3n.github tasks: - name: touch raw: touch /tmp/ansible-raw-test - name: raw test raw: date - name: command test command: echo "the command module" - name: prepare remote directory command: mkdir /tmp/remote-dir args: creates: /tmp/remote-dir - name: transfer file.txt copy: src=dir/file.txt dest=/tmp/remote-dir/file.txt - name: fetch file.text fetch: src=/tmp/remote-dir/file.txt dest=fetched-dir validate=yes fail_on_missing=yes - name: copy contents of directory copy: src=dir/contents-only/ dest=/tmp/remote-dir - name: fetch contents of directory fetch: src=/tmp/remote-dir/file.txt dest="fetched-dir/{{ inventory_hostname }}/tmp/remote-dir/contents-only/" flat=yes validate=yes fail_on_missing=yes - name: copy directory recursively copy: src=dir/subdir dest=/tmp/remote-dir - name: fetch recursively copied directory fetch: src=/tmp/remote-dir/subdir/file.txt dest=fetched-dir validate=yes fail_on_missing=yes - copy: src=largish-file.txt dest=/tmp/largish-file.txt - name: test collection - fetch latest repo version set_fact: # Ansible will fail if collection is not installed packer_version: "{{ lookup('artis3n.github.latest_release', 'hashicorp/packer' }}" �����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/galaxy.json��������������������������������������0000664�0000000�0000000�00000000765�13771713062�0024475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "ansible", "playbook_file": "./galaxy-playbook.yml", "galaxy_file": "./requirements.yml" } ], "builders": [ { "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-galaxy-{{timestamp}}", "source_image": "debian-8-jessie-v20161027", "zone": "us-central1-a", "ssh_username": "debian" } ] } �����������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/largish-file.txt���������������������������������0000664�0000000�0000000�00000201774�13771713062�0025427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������sXȳa0v4[Un.FF3=<B8FX=cR`s!FF|ք3}I"T{Bg*]])Qn* `=&A&jʡرt'u 6uL#+cpԭmGk&8An_x]#k>nC;%U/ *ldoCeHmK d]F[ TYtN0hVwCS<a2p)ɳG1.h8*6XAO|a5ŏHP:J[-LFSsCM% 41ou`-cD [t)x�%lh:ZQuP%A_e?jSG-C芇6eqY* GG�wf'jA PK[8Lɯ=h5KqCӑ*+fve=V@ŋ1 Z^Rn5s9!2<ޤY v8"%e^ gGEcmu~A֔>hhvZYIśiV|PC7H_߽&%Z 0 AWxXs?*.fP0pli ͋Nx䩂si4l)N. G>cS-v,JJj|G5,`JHA'&8 �ִ=;Ld@ΆKEךka1ǚA T\L٢.s#Wkq|~Ь&Mg|$2ԉh3c JgG.P֦W̤W|YJJ(4O3_95?sTR15|,gEi#B΋Ii&%8UZY´u#N"aSƒ~Lǖfݓ(=u%aMGcC]f }ufh*kCUA$UdĨFLNNq,L-YYsf\fg2tI:[ʢDt+=$)ŸS킦jZge}a"B ̭3G<,xݙ^D1tn7.usS|kĠ'/ 󶢇ڹv1gƒ~;$WAҚ)| )v_zl}4QA]A9?ܙWJwX c ;mTKS=q M /[U0A.aG+|HiD ;G cO'8y*HG:O67Mk;tRQT ŌRܰ;訲K-J'LQp3~"}gUɋ]yF/;!曷vz9 487PxU%^aSȐ(z{nScQ'_ !C(C/HH=g;<YpUa, '?ߺ.#MW NgH&vV2$bt M^%h#Oqa칕^"e[Oj~-kf_} `_N. UN~ gu+ z/܊ԏ30fkEf%gQfȥp,vjSs6+7cD�O=YO[Wy( dIc.ɭUHIIEYn|{z+ R\ʄ`:il+d"ahJn_on}*xL/qϽfP#~H^_^lN3{-@OC?= rȾ:`Z~VJm:'Ns"yAU0&*D־p~ c^3#C7ZVe]o) |� EW >Oӻ v98ƀ<bTN^Z[ 0{$4ߕd ;X=&X3>Yw]ӈ0 &8П'3OΓ40 +Yդnymizl 2S`?g#Ae-u~I2ܻ5v<3S{|ɤTXhrw oTOĈmb 'eP E@\?K=YeL~r xL ̟,1Ę>i,zJQjż"Tyb:Gܿm eJWj/^6H~2*q>3sAA)O<V\jc`0lgmr :0LGHVN<"Z:!퇣KL&`W틨I^rZ!w-6<0Fu SVZ:H=ڕ<ik0 Js%{'Mv7o"�!]e86%k>�'-$�ܧn/d n)?R+h“\-u ?3bt%m+&3Ɩ8MhHB|YS|nOLqK8x%7M$fDn|0jkAiH %Kq8܈UjOH(GZ1hvC<B"bh }l<Yc=Ɓ quƜ0̅._{ֵ,,x@Z#Uŧ)Mͻ>bo y4UꥶP诹z*~ AG hLe'q߾Nh0wE>pXsMD) 4ΎL-vDM@<^7g߮p㫛H9]LgLm+;]=Fjo!<]E4Yue7>n )o0.6m IJ/Z{B -"Os_𺛨}yXr̢cQgF_[T+|!Uvn%pj%π:#}jnO˳",@.($B֏ԍ !vjc}MgIޝN$R9FwNĕ,g[ SBs]r<F?H|BkǮ͍؈ht'1@)Aֻ8-/%~YSgGca^ @RdĽh`Pq C:ե?d:\BYgiGvth67_ PMɌ(kGY+EpoE=[F;W%w*M} i]R47b5CeD?JOфm~`YxN u,"#Ju#b;W? ^.U~GVCEPOq/#mZ~ rrϼPoPx_{IW{נlH㣺^;dD8q@h M)ӦB*~Nl}XXFݝCi!-6=iR GK kKn<ĉ<uIJŧ/z<5E̩Zp2x6KH|E\{Cց1׏W6Х.=_m!$jIjIv0of}a%_=$FL,4N. LVHf,3ƥ` _)ߌH s"̇q x.jV*(V]|@4VA )xu1GORpHZ*VhD'34?["'2ӱ!�}-7fz }uz}_!#8|*QLw&@/͘k\p΁nR0 :< =vwo;G $.Hs@m k ĈSd1[f%_O {o =c$YF{"Y2nƪ3ICX~ i?Dvd/Uyq%`ñb*:v?TG<zK?)?gux? ݔ藷Z{jPq>U:L| pEGQm2k <qJ Ilb{>e|Yi]`<rgwT 4˥.)OTc/y[;-C:Ek͍z{z.O.9):S|7kN}ʹ)q\oHK6گ+mx-;JD ƜS+3[#=_JF%0GltT`6̭�'WMk}m(O|v6 y4n@y'ɶ)3=?ѹ! <1pZg EF3[%ZUqRoi&}iL ]QSDs2*ز1LPJ<q"Q&T O5^JN Ɵ+9C+DߨAanSئ[m,Gym V ]f󎯙\uswxGsP0@n6;Y[gVvqX~Tl|yiH:B BĖ &*u ƣ m>+H;]!e6Uג H٦le~py 0M0g`I6`וLb%7_@AD0 w4qmњ~dt_^iH Ց )ZLluAlkq'D\wvNDz* ^p͟馫a{vSO<{WS&~Xԏh6V7](M1*szZeS:ri8 ?gqD9ľ*]X 4uMUoY o_4FEVP=p"ϓ*Р7ܧ(<n39RGi)LΧ VY":RrbY/lI7rc^BbAa['Oxzrw$“N q2X$wԩoۀ3lڗyTP$Uf<׾ lO2Wo*`#BMT lYg?W�NO#L1sjJzoh3?OB~<MfN*J TI@3Y>HP" N@+fyUM^=x�~7! HP<d}%Y�S A%]Ys':+N=~[k11+Ԏ zc,lF YCҕbOϧ-2 HkbAEPh84=SC2^5CX}o/woX&]F. Dr鸕۝Jc<ڭzE0jn M`naId W<C):g 7Ss݇ՇLR>CU`ЕGjJ}*`_-r?Ba%l@kLQ;ڱΆ>C׽?N :%E;Zb6&TR<"H~f"Z'�k~W`|O6X8JgcKeV9=em+^4㐮ϡr'NwPn<V'EZƱ3WM`*Pi\gk_s~l#Hs!9>(X^1a1;oy \Xz*[=&RHZrU+xht]Spca?%Ayݲxd)\L_;H]E3MI)Trgή>RY$@Ei$GDa x/"IЛ[kṬGf65o{QZMqG%~lv0F1BQԨnWG(`x[l-Ili i\,bԊ-t,ᝲegzU>4(9p$Wsf `p8V7Ok;]3/ #eJ>'y}Q,iw6o41|DU[õYU:U+U�qgX23`ZUIG/_{,@LXYĕjگg7 IG~|Ȏ{ґ0yRoC hH 7,d $˕!y%,%_ˁ,}梤̩5P*v"Pޢ9t, "K:)Eg{y#W.F'%^.i<a%x$!+#@z jt<jH\FQ޶%c(<=N:W9F z~{zHʥL!= gL<cuJ`</ ce|(/Y q6\D3?^Rn#a:^Kll?(;㑽iQB󽩉KU]t;p7YDe DZ##1<,FwN<IֹgUǰH%K[ͅ< Y /³!&"RO)>`Һt,i q!qҭK唫.Q'?T/Qo ҁ&�tQfA*QN: Ӊ/s?#i#wWamlmE<Fӥy]@j8TVHHȐ F>aaxXiG+,/ X|1=O?<B#M㉝ĉ&Chd(sk7N޻F%չԖ +] |MJ}[:©"s脨?_VIg9Ѝ&%/m=V~${]q6.:œb-1Tw;B/҄0ZBX7*M<:n�X2b-</lص>H1iɼ>8ǣ֋, Y2䡪r<I}GR-}!hg(LEA!Z_Fuӧ2�12 =Xe콢E%-ۗ Y>A Hs ?I|l`G^$A ?\_=nރNtft(-V" y~vmxюp14(ڋ$Z:VR9֞5l '![%E~ZNNme� o\ j¬!"9ưM!ݬ7.3lK4[i9G¢!3QxH! h"UDAn}l~oe_,UNŠɭD m([FVҚѱ*ڶK]iB>qgm4˹P|^KXu j$UM<"t}= q(m2iÄ ͘$1--V t"QwOU�*t$&4U9 }Zũow,_9 ?ܨG&;V-^r]7jepEǣ~|R{>?+W�i9>>]~h!hjQ^56jP(ΐy L.^;Bڜܿb#+5N ) nqn^FX/(\Q<ǘw1\$z*M#~_cĖ_q9+9*ëi/r7xX.j'k)tA q(orb3T쒳*!FiˠK ذ?X1#ϫC ,MF.]84GZ\F\\H:ictVV[I_VWȒ)]r?bK6dA2 G`L2Z{.u o37IίU"[B/Fh1ev�+Y ?iesп/?x޷.*E5d<p)x`|\�{k(~mrQ[P?5a`|Bn[|fo3P" 1]NpppUaHdYDnw1&SV4RW:kܥe**G;͛I{cf/i&XXk tgaFL݆T1z hv+i )JsSe :4ZqgܥݛpD�~0ǟR*uhg!Gb{KbI+"dK=@Z׵;/AO[ >2JU5`2LMMc5vk*[ 5)ipUZ7lv1N{'3<.h7gTږXNf\+0[ĥtw@p~a>x@-/9 =P89x\^u/}F2=g.[5_/ MQw_ jTCDx" q! |F D3ژx2rZE?dZ*/ܰAC0d£2�&3v-h_6f(jj3ZuȪ!0Gn[-<P@m;BZj>EM$K`h:͚ZY>ݡ@]r`Z:H5?o @ 8Ij{'+!`-NP4[ ? f\)<?' BDB^PQ.c)Ӕ` EmW{8Re~^<5>]YXVJҵPv+{ 3Wi8CɬOͣIPțGU|Bں 0͋ǝSFB-϶o[łUnj:ҁ~Ŵ2˪hB=zf"^(^Gx⩓Ԍ݉OכMנQ U+,>M(y7jӍd*%~>b;沝2at䧫Jnl"е87zPAXg8-U`kf%ra[L~)&$\)9=pl)t0뽾M3rM*m!\ / X2\A:>Z3�JꌓtJ91ޞ;֘S1/xT瀻: X`cԼTڎ4NvG'o`ZI@8s`=7ZC$ ƃL ~W-,L{'}!]*\NMqofhO<2"Y&j=\}6p/c HW^2 J)Ih|SMÎ*8|u|8r:/pnXit{ c|MK"* "X୏ZU".P+:Td7p-4�ªts4;ӢR`U4zwi2ETODG8 )K"ղPkP=,�f $bzN\tK*IγPChBсI4~[jژ<UwKsĦ23?{q ǸO.](8#Yu _' 0NaUxpM r=Nʂf^cVL_6' &P�Nx/&A`*yu<RN-Vq]Z?eGA-zPs@ōxkoXX v+7s:D?"5s(U:c3?4�c*_["4L%�/fsm8lɱө-%ma/m j$Ivރ:/ ?B8X9UrۘȜ_S0|^Pа^1'Wv^k:E AOs 8n=A ) Z^W,Lhv[Ǩۈ5DU̽_*``Zr!{>v_P=m0>)Մι\2%b7,m�Dʱ8ԱܠVTRp>NpQن'8|V# Ssu߽5OV`|GXν9dž9ؼ Xw FHzxHx$$�C&UaυW+ 2![#pu* qzaU=^L'NZDL!krFY`偽'L])n5ӧ tg^<%iz2x%3{ycWsc)gCWCN7�[t>'iX2u !#=΄u%s}źuN]_ @w ØMmhKez  іIImrJ }\PyT³Tv gu-V] 3*۰:H4a�K�?.�9P XX3v]mHkG j?JLt%;tQ.;0סg TMR&3u`j"UhbPW&!OCI[4S�q*x5l0`�fV!>S}+NId0Ie<)'^ 5w8W&` iyJˌWY<}@ \]O?6YoGe+,WeetHLڀs@Ɔ{x>On8 #\<hYJ}s=$)qǩ*G /UZyQf \e9 V!q|&mVV#TztU<^4J"_kg+)Dmلv D� X/5Wvo=9< ԓT".0B9[s$rm"t%ٶFqF[]aL[$M#c5ɩF+p?{v3X[$ӧC>g[SR2>˻orˑ\Y)x_W,�[9$ `x-1gK<:P mKR˸wCr$̅ϛp K%foɄ@‹c.Idl0n&3q4ߗiWaI3 |bx!{s`0<x>Uf- [ |{)K/jQ49`!Pm<,`e`. �d.&k螱i{L0pL"&3he]is[ PƚX-~0.3Hs߼B�nR>d⧁wp]}AQ9qPV<W3Ҳ x n'PT1I}Լ^Έ5t'&F!5aLEMήB!Ę Gg6x:'^leK*5kU/2M!.#81@/&�َ UqMplth7@ gMN?v{9֦CDtTQzw<Sńo[_�bC8nYv6Fԩϣ9^,@[MG*?;ƚ 3@UTwLHf~HIg`)bryA ,,�f[ؘaPB[M>}gp;U3/Q\v^ݼwH\j Do'ugy%[;/W$h<Tk.|._1+⹦9iYG. }\+3:ߪR^ 00Ux{EҬ{*%r噔I0*`V, Mi= ~NoӻVM Ev`` XQAw&3wgx-wuum?D܊f>$WYHlHy{~q\SS\44W� 9Ԣiqѵfᰝvfl |Ӹ9(DTAHAuDT+/WK6sܟUZ"ۄyt7Z֍&[Z~*.: k=H4- =eUq}k׻==Pig}M 4Zi-;D]j9fY}IwKێ$"! C%Y D{O0~6dPx 6Ȝ_ՆO2.I)ݜ4,mJ"7auEZ!FS}NK8jQqzG2Ql0U4krbq8ӷdQMI=_Ym{Jj‡Jhp%NvĉwݩXK)\d=,^\)8z% be< Y]5P¾6jaXs 粠^2Dl ng9I GSD]kp;Lf9FiU/쵗 hg툜6hUdjUK?ux6YS?hd|kAl1\rQ|sWRaجiG)2}DC549%jj~Ya{tGqm<)1Td|6 o OOĸHI&02 �P`++{jh|8*$xزmV,jVTB?ջ &?>NX$(Gɳj< حyLǤO2;080[¼\j~r}@R6 (Ku~Yh &(o Uk7NA83NYυ&"%5Ee3Cox^IZ8tu?l'Dz$HV#͚FƖm�|1텵 NO^ý#c,63*\3Ȓ<T;GaH ~|` ֚P%D./;G*@7Np0!')K?D)4H~@Z "<M� fHv#k8?Щb+(a޺("9$H_7F>Kն<!ա8ݞ}E3.-eKp$|xrWH~_Ar]a'wɅoJbv2hBCrz#=aذǥV\@]gC0GNU.1%BaHlYamE_kOXG]5Sp%|B ޹=PY?CԢW/ bE:*$E/uTbiSu g|n *б{H{8n\+@z**OYf�V4UЬ23,@.X>w*GS_ jBCx[ u`;nD&<l�)w<:ϖ~gi8sl KAqO@1;?^}F^1N^ `Jsv-Mv^#m)*ȘJV oA\j~∴:hS팩\ҭ?smCdl~h]"7VkAնˎE])PH9TUIBOlǭ*H1 �[SKEE5k/F@ub|_|q3cUjĿu x_#,}sw!sRR.o+ (8k n~'54BO&VDv:gN A]8i j2<HMD7v{[ם qa?v q7K3k9'1*Q68AWF&5ܗAD8blu jA HR.JAQ_[xZ,*԰t+ţ BOYU,Eqy밼]TǎO3-3F8S{!`'aD@}lnrk/ C $3_D:Mb*d5o;7`;GpL#-@ R_M_(`p% ߃;x~xh:_ ;k qJ;&"DSok6S&a伄2|h8C=kY>9vfdﱅp/unez.-boڰS:šI*p+ R0uybϰm 30D,}v3B"'<7 |@K"#- {+%S<<za.cW7/VqfE/4^]2M庀ܫ `#YaNGǶ[~lQ \p6.OǛw5kXw L߾>.L|xΉSWXkaHh DyŠS[z'ebό*ۢ"S=JLKh>3̥mӒC[gߓJ*wZpi&@'&'|;p7 >PxX)CI'CkC lA |$T �vŲJK?lM϶\M׺@)bffOJdL ^ c\R>lHvhlv]#~Wm'vl ^ThȊqd\kT5i~dHП@U[6L*·wU"aV r_0 ߱>#$r9|xDɈINH0&gͻĔ/RO F:|H*l\eB,ӌ4,\nV4s˹ޓa麘vk}XYWi\_I=ITow B|BJ s=&T�BK@roTˀϸW)o?4۩4+kbqC8}y@ bړ;`{fi 4(R:dVG5g(feziy3fe|6bABډO, Zvdꛊ|C0tPfȢ@4UmU`;Olw}>2 �X".;!_B'N<=Ddؙf6eLd|5۬\<WyJާ]52 3aI.=/If ؎ݹ>4eIN gR\< ӒĴEҤ x#I،攵/Ԝh}7PvUIh1LD79pUE)kANfsAXVfɎe4vCg,V`GiVB�Űm}>4;ڏucڴt3M0ir,0!R C<Yz`K9u z_w(B-PcJWMb^+kٰO RcHQr$SG렂%aߦ'cQB}Sh+FՎ^pek} CJ-(Y7SSl7Ef5!Ѵ ㉃F2bSQJhR}%]M2K%oن1# -Za34k̈́ofŗ[̡O+)MJ/y(g'#=J.x/Tx �T:A]bU, õjh&LVeT9Ft.)|9Y4ɨ&MM2ɇnP:zU~^Ծے%9 tǓF{\$v[EB.yjKO@ 0J"ļp $\>@ y$J0|ec̄0I7XVq?(/;2C>XǏaT0^W"k`ffԣpoj2 A@79aNbm'lHPeuPD{_1Fs)#޴6~B4vx&$-ĭ^uND٨һa o�ު;@#Wё?5Nӹ=ow09f̪_@ryDQA;US1;!6 4Km&!䯒ԥϷ`hZ*8aJEUSFJdm@G>Sm41c e+{4♸S-m<P()sp>S&<ZB8S=v\N-`vp w K4IuM (!+1ZVA7쮼nPƶ*z9Ӑ2 t|2>p)F.X2Dܹ{uTp8.HTdGv4 2@|ZYW'r}E2ymbo*Q=x!$!OY]2/\gIj1;B_q58pӂk8a.?-qakw/5 ՗: 5G%}0QڼA]`'EY񰿺Y[̊w6J'Ӈ/Y;&[u6yw*S!Ck˾VǕ" codLR}֋c_9*!~YyʺL4h6 ק$`O&7>7`8h7W PؖN ũ5hcm0UFah 60k 6|yi$JYw6h>mCfo2߈&ΰcļվx@:~rSE o>�"YK&3~8znAGF &VKvFGWwh6U0(L"k)ating7~^=3o=lr :G"FMr_,tXZ8 jٳ#b!!s$\9sC@c"oS%9zez /@np8f6_VR`y&_C-.^7Ø^a pGTvz8{]biANq=aС.qPP ~{akߡfO ,Ѱ^2#nK18RKJ jv,簶tʼ)-kY (wLGXOVWόzВa[\H˛V$*~t_6l)8 <~ONlg~ӻFûv9bٮeX=-)92tbb-G%1HDĝi:{RU)Gr z`N57}I-J5Ka?exE-@ K9}{Jm8b%fm\>ЬVZeg\uYg,t!aDQH?RWqb_b:,R)|΃9rH:qGP}xl"58' R,@UoHeJpArP �pLjN]Zmj\ lGn5DŽ[X7׿! GJ'm'k~`;]'1M?Dz95T"q64_,=O{ ([29wT k9B'F�Q3Si]vDL8%DxC[$]Luta<\Z)š8+%g_UpN!hp寣.ً`ʀ6xE*SXQ|ƷR>$MYw[AcYm(<'^k;\| 6fH7\ӳ|~Nt'+>r݁Xm׊=P00yusjOai i(S?$Вzb 쭝_κ|%,`OGi%1邫QGQI,>gZjVMxN%1'An!DObx. _.n3wY&ܓw С{ݧK΂ֵ0˨yECc &ѿ6?ni:1h{Y\Y~:Lz?ڇ.4uU$)C̗jBs!7uC u!aP3=H 4t|`9 Fi gl۳1:թ eJFc|-=75uL]0B2;i;p/ z۲I> @JՒ7G~P<&q*KJ S>Oa-jOxND;x7aۍDΫD0DbsX Ôk2|**Kb"%W@c"|9B; \�cR O4K1 u *8 MA`�&yYM/}<++h \0[X~VU;VlSZq zT=)X.R?8RҎ'ySuNt5UW;l~K!XB/7\I)=Jf0@3 a|L8 0XP:o6o#ަV|AwVbS"Igj8dz~$^$lp15eI!AvEӅ4t0CT]C1B%t KvhПk<Jrf^c,Ne Ѯ(ݕr'8?0h$4r˂ss/8;'E.4)>@tr--^Ò|;sòIÇP7@O)w N^鯼I4J6,{7cm g_W5CK!m±;k1h)5tcM\kNd㗁{\i/ЈYgJH~r|2PLDT+suTҪ]]ËgX$^rGy9Jzq)9gҸU4֘q0zh ~$vr9<8@7Г".$!wVU`6<&i2de"!\oT@<F]SB[.P-](an=0dPɽF 7ÜAp0j@&'(J]> >t ud7BW~6k7 ٱzJ)zӓF4V|eo66;'.x*raJA{o!= >yH)e!#MB&uf%� ò3^%=X^8kIH`TT?3{zWURm-$_Z;T<ˆ>H u̡4@/+ͅ-4WBٺ,O[UmK 6ik3 MC]Ɣh/=rt,/Vx~Mb 9r::j>858`2�$d 8Օ6 #ȞǑcQ'.f VI,][lV>IK +v <H%ʱJVD+"ĥ dti\Yn!QGp�˘&=S%�auuRd;1s?:<N&1:Vs2Տ^V˒B,^HS[SdPkvFdhUTSqD¹[8B(,j)Tх>E浦.bLF?EW2uO+c* Y cգ/,CvȯU(k1PӮl jœq6=VawRkyc}ȁ\4t:Y[䁩6E EZXkO F|WOc/{ձ B?;.bz<e6fK+0`h3A2A8M}_g݉MKajr0axyP!1Xɡ-Un!ܕYD1ZJ^S v gѳt,oـ6˛iP,UBc0 6Pc.M̰sU*>ѶE :s,60lV(d5yV+{=4J`TđFPG<rX@TaJ x]މPK,qk2eV˸|(j8qJ7 02ӫ <Wb=vAeId[mq݋|̨ıfo͏<! SsEQ4Bp@9~4-K^vY]T띻>&p]$)znJ nFW/yztU7vcNM2ײ�MA�CݚּXH]\ȿܴη+Y@ e>۳KަM) !'UU]}/'P,ś \J7YfUi2*19gkR /XZ`g GU2p@-D FIb~dfGIsmF tF8t\0NK؍_TH^_`>En/ޔL(QH*Mc~,G< a2V2};IY)C)  -Hҗ3o9רuȓah"&_~.&`e% 4�6V"m+kw٩])}ː)@rO<ޅJ/ ho3_Bhk TbưUNU H3 )dUy˲}Ex;$CX!3pNvR9W<sO8[!Zo9U!P^ L898Zz= `3E>h{L!2cO/:H q9nR_\1 6x1tɊ&:YWJiʌxdLٚR5)EdVsy`p`:Ll@7%|'B$>h}VZazQMľ]&Էe&K,1/BI>҆ R[ԯB{CǗ;.cny%MR_|2.ũ ײK5϶'3)uPg+ (VTȜ30H/qڀwrۆ؍'2 r ^&`\Ƀa&߶rfX5mt^$3&xc.c-)w`dX0GD#u{qwZ.|YwlH CwZLXBТ�OwN(`tC^ݧ VO+D,xl}:NF.Gk6tXm`'"# $7U5cw~)vUlg �xHg)׳Qw#i֘^z;DF$m7S Z3& 'G7> DA1`=Wn[-\y/zV!grPIJZIO1߷ ݙRl-;Ҙ90i80PE _ᒅW`FUU O>gI2{S 6PGwǣ۴k  U%J]ih-)Y$+[܂V`Q|Y/.8_Pۈt0dj|n"w݃!~0풬A?B0ž8P2d$kEGEjUa-aU$fi4�if%t8aIS#c3/czP1>_ЛB9|P h6ml L ROr(Yי[~v[\?YډB1Ɇ\|V[;J6NJOԕ;e#jL>xRGɔO\�9q*`n!;T͝δ><x�8,.pH.Qqʉ �m.v&I x3fF_ Ў_Ie/1NRjҒxWs%b.k{㞝i1g5$V7$pU<8"o<ZtζV *X/Nbt3\;1G`{C]wԽ?L!$"W:RNίʸOU;hK'nahOf&XSaJ99U=/<" y8>Atq5=m{M2{ (ɯB IY}sC_ZDO/v+fD^䜀luiig\*Ӛ,Tj#[ddtt ˵ p'x:—#7ds�@866L `K :SIzSr-�DzaٛbrWy7Ņ?o!s-3YCa˙Ҝ |R0++t9'.،&SJ MjٮB.}N*ؒB31U˦߳hAĀn�3}D}ZWI6I9UURg5q 2T#!w пʏEnA9Jr];PZ2bXJG=5zmlIϲ~'' V.`%gu܂ zSUg !-W,v #>;7wB )9^Bv,Òd^'r(/sFz*k墴j˫_ץY< ua'o << eu+0p 3DF<F}XQ,{o1tLk"GG- fEd'nO ޻0ݕOW6"O00>=Sy ):o:[vJm_  ^g˪rCGEp50t+tJDf޻#b$BXSͥ�e6 h?0 _bÜQIjUVf>*w'PpNJvvKccI/_'VK*K"y\VܻlE7 B&S F.^ďOl/ 5K;#%֬�S!+oR;tOB#I oۤ~5 .YEɆ;�&u9oYӐ��&QIL[$ͱ�",|}#>q,Sa>,CO*"}KP~)#^iٮпp#Du%ݠ%OFIhMee]⇕U &ΟϘjS!weKDbx cUbBOH:ӹ'I`n==qM͂ff3ÑՅ48xN hG=C{K:v-b*x+WM1gAnELMwtV(rI�*>0|`D2Z HX>QmHEgvx1y`B U==)q;}kj>P@ՇPgo~ÚKʉԢ$8&]�//Ѥ};klg85?zF wh`2ɃNΥA<(|W Cn~D`|<RG,NF%_PKp>+ޣR;O|t%Uj| EUԶ2ݍ,<ʵ3is/'@>'~IBڼ[7t ^i<?Ⲙ /b?B_TB"(Xf%%b$MSua88<VTre5S%Z]LrUƑlƿG ͟2mdzevrJ� ='N(_w=A֍RԷz7|,-3T~#nidyu&X)[LP* d*qvڨ#hKJ}p۬H(!hm&5JXnR^$bۼѭ|"Q)<-_؋vXP;;Ԋ> h}>yްʲA|-k&}b#V, T;mTŸ]qH:Jɭ_s?%ra҇D#7R HwpCt3cŤ0܌E0Z!>w_ SO±aKEmF1wĢlx+VZ% Q< & 19'I Ť[%Syk5j*phbK vŵ@Skcd!+JlAa2,~f3[Oo3YvisD̕vv20em?tNqAMNV6(p^+_0ö k?v#3N"Z=q/vwȌf^ӢPŁÜrXˉUh=L׾l"O>ZbTd"\$o[g&'Pԧ6 <\Ү.7jCWfL|bK5EHB0`'\!d1P/we@gLL~Tv-uW<>Z<d{T Zs,|Ecu3VčhOvLZ 84!]lP[#RIL+�z; nXbQfnoĦj8C78ף[PHb`f!Bj6Mn;Jz&99`"lW8<63HMbH h4{dE+8o DżrҤ'Me&st=&�;*G%5=FA&#`.J}(\Lu_"q�}YXhtF%\ '(!H f<P pM$LOvNE%{y?Wek/]HtAm7òLK-Y5NcU!Ɓ%'t?P99AzOD.=!&?àav۶x7 K|c kvߣrIoޖ~8R�:h;{I<LPxNH]wm侤`==E-"gE*t X'GDQ_WV[(d@ˎ%Ϟ7޲ :[Of4|kEⴈ1=P9k%[;%f.Qd`z儼 B 9ӍOz㸒̅9O ˦)io>'ϗhGW'*Ԃaog(+&Ȝ7$TCbefgpbT5vZ& q@^]L{CR-wp 'B4kMO3H>Eﶄ$>+zT-}!!>iwt5(LS!P lMiq{-w>:<<7LW8&>P+0p(ke^º`cy/T~1.BAX>GH;s\/;t80`U ק{"fy]$-hhV/CP(q Jگ&=ɸQe#~PEbJa6 Q/"Y܂DCRIpT}g(ҝ3G%OA`",y.hӹ. 3U]Wϼ> 嗀U_FMo#NM ={QDfn6ִ*oVVb]AQ.n dJf…w@w!b~砣ҍ 36[y H9~dщ1((Zku)`fnk$ %1i2NJ_4CKAFމR#7V)Ce#e!.[3ǰWyb9*G(Jyr%1,A呐zxy< ܉ 뎩BAK]U}_d=jm6H ="%EwtBq[R%W JZ0>G%mgKiV[ K5w }/>{Aة?B)27xggj>pbL"2T`n«h>Ċ'BK?$Q/< 9^`^GUwWVÛy*}; sְ�M,G-^FxB,˄LJvMetr@~™`T\0bf[ԔǑD8<h ]ܰK.< r`V '[h!E#.ݬnMgܫCiԉV"gV.983iyzkpL,~j9!:7ɍ 9 *xa5퓷tF^E"8ӲD ۛŠ'NG5yDs\?RBƪxsd~ifT<6rm1Va\%kxgC߮�; oy3 ! uFې{ͽ!B$*)&0_ ;hAt,r " -sWlF.nw+7+֢d470I�l,huaSjܣъOg<R4QvVSrV:{Jp;i+C>t}/*ƽ+G(bJE`,(J>B)|`Z6s3;bo7ma=ͪ?`k;dE,*յ&<!=fΜ#cC̓od^pdNo2ӓɹ<-5ˌ杻$`y֥jE[9_^횹/cW{TICX'`Euo!pmA95R֥wUW&f=K1Uid?s<umm!좚aF`X>uLL(C9I!/MPYғ3u-HTg3F)N5|R))#FN�# .IE~cQGDH-X- aŪ:Qwn͕Tja"r*Q~n-,K~^.[A3Obe }F4j6<6Wf^0#[S!o'L8 B+c.N®ln*Z8s|g##N:j<( sۉtGq0MNjN7Y^ܮk6nW@\߂Wq#bE((�Xb5yyA'dg<# Y!yDWAqLtZF_uR: wO5u-Gj^'Z36? M,0s�e7~_نUh>_ro x;G=tGO)4-!{ );;KTuȏnqŴKd J~灪`+6ڣobRHx-ds`G2dI̛YTExk2ïKU%�N?.vo~5fr Kּ:p)~uFmN ܌+|�~ Nd Td@i:zςXWZn'զ7cx؅cnCPќr#u앋ٍzlJ <bri &WNv?1~;#qMIVBٳp3;:`o,-)vR_4y&U6=h YRQsd<x<noy?xPİj؄fu=ڭw^$Ig7,QITcL7y?Kt(uwPFf Sw})IO>)vbF!Eۯ(뷍dqs[kO@D=[;;D" vlp!Wx58uތu?u,/7I%KX'H-݈)|SƃUy+CÒ{FDu#Ӧ@@[gyGi)HHl~Owܶw/\ҲZ<4vH`"鳗﫴;,If8M`GQ{+rjCG\@6юwB`\[BbiMU.lJ>.xWL2\qe-T]~0^Y Y/^_m^d|4f&&.ddh}Fpfn4U 9bDOŮ\~3𝀂`zu ݁0x_4lՎ-+g?`z:1`HMO <#74}�;!0.EH,ÇQ~i몠=}QUAgHf/e9.dF癛pMX%s` +'yѳeÇ }ۚϧ}3I3UiBh"kET*NorT=:bTii݈ jps[ Obi5ܹ<]|ZX&g.f7%Uᢘ{Q]R1ϟ $%0͹ =6xT@"esL9@70Hn^M@Dî'K6Z*YG/5Q)Th)8@kN ?2T<. gGk?V[;J xK: O?٧#S+/☊aQ^.o_ufF>fMh3r58{Ǒm%}*R@F 8*Iqpyǩ̘͠pu   0Llk#8] n=-=^ A)>B0+gG/Ln;SRJIpg3 >3p}5'ɋ�WayԜ<Wkq* c%㠚X:8,ԅ=&a#S {6z;Լ+2SjHVEwfX@ U<g74kEof2LIԋq"a HA$kZlc/;ީUՐc ƥ8]ڢi"|\,N2Di^3{*w#PBInHF QhhcXќ7øor㲔S5ճKCxwIV㲷�b18#D@2Tr/ݫ&ZM" 82AS%@uǽEý}9Zn[g y$ ֣ss%tk*6Gl d Noۧb!lxiFjmI^ Jr"R6OO5OWW1'ˬrC&+HEmyͭ;(<lY9x'zBFOk_>Ozk p̱cmƩH#۪#.Li㎊P•&ffL&ft< ep KCJ|dk)Vg \gm_]RLJYj1VX"O Q b"N* N?-IܢD3AmER>@@�Q~&-zGsӬ=)re%Cet`@[�{<;ԗ2t4lcB& u_yyĂlXy#eҏ+*)8GPX8;Z-^mԬ :U4f$>o%볌Q~1u*5*WFFx[kpX瓰A( QP?CkvZ_r [([dM ^^Y!6f23iCDUk.2.@$i7ӍA:&Y@2@Z}l@lCǯ *>??6G`Qb4aٿZ0Db.@,(pU6:kr gQ;;2a\EMB\e~/EE&.Χ`&䜅#}"~kQ-NEr;=>IC'镲F5hV2H0_k-t݀m6:|o0TL'}iKrn8HL!^'QEC{['tc"f4N_G d_>lŬş|go=pJ;ow\N/ץTlX|Gw˘Xh#E=?Y2F ]fzjR.yR@F1Ο$K쮁GŠpiXHXHԤE$'𚘹"è J9 ɇ1U`y6azXHfX̙J , w12;RQ6'g^ѱn[QmBT/.cF$A k'> `MKz-eԙ�O[i픫Pk=F>oIEte$rյtQwH [.{!AW@7rWŔ\h>W4;*.tweZk6\t%.{QLV0S ֵX'$3{9Ƭ NRJM7|5*G T|^7/_&ץ|W$St>1#%pD.Mſ@V nuv 6ܲ\w?gQ;>oƒd/hAiK]&짥Q_fdo;KGRҲ~;_3}="!L D J*i|fpeWԘ+++-zgC<vGy?STL@+0slMMoj~Nw8C>ʪywtBP}E{9`?/5HLmٹ8wp\9گO %y#mue\iXL{eC]$=7aUݺV*oNO{%Ƿb-^gIz|[|V8.8]|/{AظrZ6O[<<PѴҟ`it�o|0"x<q8 G#"-C~saQ< 1GExC=0#Ua)<cUpXi_zMo 5+sTf=ÙQk>U O{>V/{p %#<|WX+?O7f]T J]h9 c#.Dv~BHXTC}�V3}HЈ7rdӀ!WAp{"EhWɡABB+#0:GqB DuDN]tm!Άap'-:A1 P=OIyK5Zr3`yjtmv9ufG 罂#R ˃aU|Lݕ++y`i Cf2'&dpe,ywXz{8aV<c�om[<hxi$=<La_"f\]Jf傉c'/5#fby4a!N=g "]WnN=%7Ro *I7uߺ"C3-boEg�ԥ[|m-kT|֜&Yi! 7N3Y% uИIZ\S]s.IQa[ k\fV&m08P/i !_vvYoK-|EAωz 2 O=pN+_ Z!㍘^,?]6?e7C4~6eDeĒ~7X»ny ?AUڪ~,42PGh_lGo1"At>95>5*OA)bsajIX‹Fq):-@YlbmH�p-x9]b/IAG<w"v(#. r04f.<FjA )>v l �e7 Nd"{tK`ovL*˟ƸrwTtRn0h_tv^7NKlНF.e}Q:i'I?"zT#K~M{~)%vW lĊ(N 'Ա0 BR@o[ƛ3[HT d@V8:OUl= Ht`lIr3 zc!BHh g{KDo@#.U,aѦokWn` kdo0M"%Wݹr` ׹cM�3̎Cn\DŽQV%+ǖ˹W68N2G*@?8aÖH_=EΑ<-ч~rQb aN SN)9@RoY6% ,Bf! E]HՒ}yŭVn[/pW32pQY<j7o)Thˢ;s@Ž'pQ3ZHavp Lv 9x7C%\S%{M撘@tǔ-lC: x'꧁LA<D%Ug6dxVպ",u4psp+ ;=ZR O5pe{J':|T|wKN7٫Xaҋtȳؗ8\<}MoD39gGaV0BHcorО;6ճeP!3.&JFnYJ6S&j˂!-D1%AQLЉ}[fz<D^Ѧ}Gs/,0*&ģYiWfT=f HT2/�GȤf,M, aHOlNHHe}ku@e9^ viU~plL'Q&f㢃h3ܔƷuO ³ZѩCmTdՍ]L3J~cx9 \N{QE;\X5m4@[i�E}udSƲ&jlqѭsZ0-,ڂrx'c.HQ>=>؛zza@SJ/]jzXS|snPδ+ <u0JU:<GQVK{)Kڿw7r0ctxK2') zeJXlyIt΍JEalR\!Q@D>F5,H˾s |U<M~(y[v:-p5)`I' TNcAM G$ajI ñϙ'B]CV#ov_(pXjf̱4!M�en^o ~8[Jg; ٣C;%Δ>:CcebOEIrd7$_j2Rֻ[>tj{65 ol?cnEޔ]e7Kj.9'+6 DTk\ ]5 aBl  8"B~M!=<[Ѿi A8Oq@M`딜Ь5̠_.n a]Hxu 54^Y.DdrO5ſo ch `DC{$J?̽)@WÄ;Aoq 9lg4d O\wDoDE`uHv57D~NFLp>=< CdJ\lT `A'(iKa:/rVS g_FS?rlՏ%nPa{.<>'xz4MTXP}^P\`p Y9'y=OC䵠cKtupMv#AA ծ(l } YL1J.Oַ"T D£.@kj(9vMZol]JfJI>UF71O@F1zRHp>&Clp=/_6?4:4@V+Zӏl;Ӱx7b]_ozB[O^cZz-`_pmGi^3Q O[2ћ8SF~B3i0\Q28XVi[-V $[wH)Vl}vIRb 6Iᑒ˴@] A֕Ö1ոuq�Bk*l~>A0QAVXY/AJT'BMM")Ar8lT2$W'/To-ypf0cqt^ ~_RhGvt$[[r mG 9%Z  /{젬ıڴ <Tڌ<d$9MMT%XpD,\#K|v+GzTCY�FW=U_|Mo\DVͤVoTn-:XjsB04\j_kEoR/`QKFK~psE(ݱRpWEv+58g8Cǘד08] *vzV=.w}zo();X *%PYW7gI%r -vN%=0Jkx uWX~؋?CYP*1ZY2~|2 =@"VziYz[//EyضzaϿR$(K#ow(j|b! 8C[}J&즅|CJzՌ)iRL\"а:RUQKOwunBP>[!a~0Tj?S@ШoB/ӂxOKz& QFu܍6>7 oIJOX $һ{XCMgSw"ρ)f^JDaeoVe&iD2$.'<nG J[xT^k3y,J!v# N7dVK0-t 9& Šf0OaOoA[/Vjqǥc'~{Y;k87+gJn!@=Qe[B)L ;U-K0ŵ6T:Dwvէzf1R7@-ec'J0@= `2vЩ2wI %:ݩ>=Αbf~ r3\|+ӛE әciܺm'4E m@{0/&.>أ1eT"g=1Mo^[2"I-#$p[Yf6<Cr|i (~\Z(KPOygD̟H)[0Y #.`mYI6f[/%M;;IKuQDvZIP o.jex@HZULC6}BH{w@Ψo"g,S@ҧ4T^h5630K=WZ5L-(;cpHL*aOBQ\9Y@9h\'>I>330Ы>g|p;|)~  Vgʸ8FVfP72jRE2Դ%wo:.%$R"ZiQ<Q2�UE}WblIіlvICm>$·6):|w%'\#@_G~/Mwx⎰{(IgS檒+ 0..{r9+p.wr@]Cyz@zMAv!{d^BVّQ-#R<eWjs߳|hge ;.>ꜶY)r%mTqB)^N<*z(`r,-qP6X>8:vU�2x4B->Xmݦ^}5W:߬KkN&[3qͰbI~TmKiҒohS_O0'g> bS:*szC\d)L`gS7ޒ qM x0^ x yde&{h�׹%s'?z@a|{Awv ?Dh3SZbQ Cݭ:iv6ٖUV؛r (D+LR%o|z<"DԃБ1;ޏcrH Qȇϑ<'\_Ʊ)e;5Qwσxw7N_a $ 3LM䦥٭.f58hcRn,c4 !|`d+@7Z,Wr7uϨ:YLmlK.Mx3߇K'BGc�@أ].1hOV9K[4U]_PP�0<_x p*c+Z _[~K "(~Mc}lr>jN~D2mNE5PrG'H(M0ᚔ! UR+ib Fh x8Za�[6v S`$<2!a.-w~%K)D:=~~ڇ Pqe%MfXx 4-:>غι;I )^cN/` N yGjĞXرSQx~ Uc7Cw!FFL]Qұ%= qNjs5v܎'k_GZx~F8owRx#ށEJjٜ6IX m` FtoHR :,]`itĠW/6?!bRC!&O" KT'"Kŧ#Y|b~΍m)N[@uw&p靍{ 0 [Wb#z>U>n~eP86^CpXpyi-U7T|?9: h]{+pB+2UH,-"H([PbcqqfuwƮ:rw Tp]<YmOeshc| v͈Nw*agBR3/X*(|qց:kx1޻x_IؾRA+*XW_Y>`{ &wy\񾉾W^&ʢ lD1.PC]-BY8Mtz{K(Q':Rz9MN`&Qlv fՌVeWJz[赍i;yTh va@7ˤ-/�.x[dXepck_Ģ\- 6{gWG@|--{r[_:ۅ_zd'; ~7C+bsUey*=' OwA>V}BV7aPcG9-putb0CxkP2m9/nA~$Z*cDz4TJͧ8Z(Yc;/]rj| #.kq ;$" ULmf3dS@� qd!G&ʭ_1@\M98ՙղ2gB"&j z.-rIoTy&,|\۠jxW` /օ ~" =aBaj3o]-80:t7\`;#aAo(g[�WBr0JRS\�LHY S0\Mca!YÔcUsG}pX}Bu͐B5>::Rp(3pLtę?숓M9&&@pS9#Q^hNOrV6{ZKo5ex;w3Qf}㙘Kwͳq9 Gc=p$}^d}}hmZ:-BHW�˧v4 HM/w})HH*w1P_;xѺTY_*Omx ey}bp@r瘀=S#i+7hF@Tk7)Q[l仜-[ii'KZh~%q`v Vd$ *"JRo<SzSIr Wd  #O'ԺD1|vW/ioUek1֬SoxDQ;c<,(8<L{ g`t#+>j!<a�\ JL5 &h8Fi??5:Z .W�ԂNAп HO\XT/*3dhm$M kHWۿ]&&ִt EW<tܱ4 sqe?R9u„ɨDO沞r쉠s 9ysH{ 3(GJ)B.'\m}ubWL#VF8^.n}Xp\JYtpHrK;l}%8Y;Pk0B_azxrəin&ER P>P2Xy.Gk"/6Os<ހňЙ:XvrPHg``3@2n1e &'sإPzτjѕC:K9CLJr3 3씹hvϻF)g׼*>ף?mƠʅՆ;ds@q *[M&K!pJRȢcfdƮvؖvE3UizA 9^ƮЀ} GY~NT0b{jgEȞOTJ^msa+1'pʉ`†E7n  jڸjy43'8Ⰼ1~-~qe)ʣpwФG kB| zߕdІ<4+chiTU:ȝB?zdt~ m7Eb574ud2pl7֯X/vMBgIM9j &\Wk!n$Ft%h )in $DnO/Ygn̆;t 2FR{k"K&&].Ħ%R`T90 7y_{bjAz*$|)&FyW]\:1oHl %| _Cw}p|ҝcE%j$ED4&/BƘf'#wyM+00-W{T3:)JL3L@mZfph6)$z&I|)~}$ 2qb].D>)"0TW dUcU5Y0 mX^ckVWjO_o W4Coе>WT{6ʖ=E!6]O5 WSء!` #tSm:jw0cfQǰ?]�3~;-ljLt?-{2ZiW2XS00ґw\\*<PxwFX]y8eGQ`O-}B<G<d_cۆt|TO 1CG]!x) e*ڈܗ孑a=Kk+Ix\L;J#?u"yZ֣,\dUMRs4bzspY|$Mft MmO(QłdٙıT6TrDE(ri7k^`NJqE'(@,?ĽNr>U+k0Ө]ZZcoZyJV,yc8U3}Υrz*G ~U9КfCӝӕ&y�J+ApGPO K3iZ004?uΙ3@C>o`sfLBYf O<u7<Ph;M]οjymD 7S6{؈bO ,2D3{4FR!cMU#lR u;%x 5U>" 9e9Ɩ6*Kr yċגxH־S`dC V ]iAPG=3KpNBi{~&`(F%pH+H!+WιS8 `/ԇABPSl �ѿI#eV.FqJ jk͵ ZX=z �.˨cE) A}:79d0c3PuljDo(b$)Z4$?+n#rG^])*Ơ:HK~aZN|Ibk _oD} x%7fC6^)Pij^R"ťմV'ύ,_?"b o*Ci}YBxz*Sb*z /F.f7,], ]o:M2Ndgϔs"$ Ï+<TXAJuLl%ipÛWvZmKsyݒ`CHND( HI?b5VVTDbgO]D$P6ygg%w/2H~^-ۯI7&Y?U݁w 4fCLu1 w\P/+rO Ӂb.4AۆTe?usbin8gG69-qc\Py>S sm}p|!^*@S{O$6.9w9p<v@$WНP8xAj 埏CLJFgv`м&jØ/~T K-Lb_;>$ y?L &'чJU=wtBdjSݷ�X ,f&: 濢$go?'ԣ55"eA$8QV1юAk�~?^j# u9`(bQt<"TCO܂JWLf2,Lm4J6ʴW+7!SWqp$fAt/?[ޖWgjEI'D {µUn#1|-'ƎKnUog.J3h^4q$uuk%USDq6 s^*QɱLѝwߡ}|2OA>&I;tWgg#A+j^**6)xdb=I7@ZXY'Ś9b?g= |a˲z-Ù얿t`<1�c/X3#"@aHǻz(:9B"5))BC) k4w"Y݉(r[yS_#km2ihhp4s&2M#es,rpTdB~:IFe3B0r:$ٲ,=՚CߧLhF}*.al+}f,T-7ʠM V{_Z@n4%fl 5 39`N釀9o}xx£VjW>O"<G鈩ύ6;KxTRhDA~*WacRjK3g_<•ݨX\^y(:$sVڃ9HVZ(h=dJO2ĨZ|0Y$Dž/7Lc&ί<8-LBA~f c^BJZ!Å.WPh $Qqyv;Cf`+o7tPK;Z)Cn89jasUGV#kGsTT<渔BC2+ZަgU.%18l0XGj@bq5blїr?0Z+#g/MЬ߾rP0�m(PWEZ lD.en*>4@ǟM\2xI^wW( լ35V!*/xL a2-!J]*.O5PI[%{Aܿ1ͶLWPoCxx*.@ tT3풶Y~0F1):S2QL٠D:UAſkppLNƧ sm5Isyjj$wDžN yFKJŃ$:uoib%u10z{D]-CrVB$(Ƃ(+SHX*;лax?גr Zރ�dIi47V Tμ2T:(*~dBVS_?별58oEUVgyxgL673UI^y#}t5UJhLBtJSSOfiVsJl@~FOuVex Zl2!d_#2ܯ.kkj@6jĬ ax=P VK1|] ڲnAG/h !jS4A=Yt?P~| ̲<iREQB8MH0WiYe;=2#TʖM\^ jk] ՝"ĔPŎgh§| FiJItB6kNd]T7*W!\R{\㦗M9W&PusI78U'Hgv t5n8-I7^19&щGbH FA^A%bd1 0876n$RmG25c4@ߕ"):FBݥeh aEݧP:"L(Z#~ZhNHVɪIwU2 لAphD:4XeJ k�q@s/ %`JL(`9m8:eWS+2X=OU�&zQ?�AiV:J7EņC&Fg-o3v=TZΕKV3-%d5>Vwմ#c<#8HKnukGt) ,ꙝCt`c7^Ru^\$R+p.J83: (xt E[(W,)%%�| N[A٤NI譢d`4[\!X ΥD¬%Wv I1|G}}m:E]V9JFe0o&; [3{Yp胕ӠCCO'V7,c?Cb![-+6ə_[Q5+_(c VA,8}>tM_34U2=9noj^ %uoe%-47V%_<5u_^o x0U g{$up'.fw7 6`A`M<;w~ &:$ʯ;2F6Z\Nd˺192APt4>ӄ[`�SAuee*` 7 7 @ZT ѼODf2u*=?8 pxژOHC6@&1LU~ \ b$!~]J[RtҾ`J]5: �Kz=) $Auyw7k1=W;>}=깠S䖻u8@pcH˒%Q\IIZĕwz;b.x{c_#\ R詨bgd2y8X`%;Ԁ"3HegAbKMx jJeeXuPNߌc�z>۱!̮tV!""_p#�~CRc2 k*@DFt9s`˲#ǩ3uƠ.D�Ζ[8pt~5=_⁈J/ouHe }KOf<Ъ'x98R0v,~u,x)tӟJ&$'3ͩk+BP58f#Wr<F\4uǬX*}|�Hh�Qtc_ |l΁jG< "6RWLaXӞ3tE}&M�4DfaɐM`ۿ11X �{([@vh>\w/؇@PczZg(_|+|x4,g. ZG'YN7*O _VL],\'o,B`U\%nH15-$H$=0LՁbSJ߳0�;縻aF _3p3eR[w[$ 60"jwrmͤL#Ó\{ʐ^5Z=>:4 &6[[M\/Z{AIݔQ`?m/9<G&G (.)/|FGWǰՓkG¼ۣgN$ĶMr-*H8| !CQ qo=לDb9?ͅ1�q/A! i |?`G'U|q!b_֞z HTJUu VkF>8_% #]E3$6ƝE w>y9ۈ}D#R� Qy-mM4FU)(ˋ<*@>5u lmKڍR:UDE}O4%9boW0v_!߽ih:{""_̮!&q-|Ya!eVr;&?A(:?>M~ f ܠH{ 1MrXGqEu;kr#ʙ ~s}p' |j3ZnEwȶznRn¼�%ԟ-d4pYde<.ϐZ*k"u=6Z]<n =M5sҖ)dE6{<㫬-tdevV94:L5^kZ? [k../QrC"`<X)Y~Haδ|^sN/!dJtk`awwW&F;G +V=a;10f%Ϯxa1R~N^cWSz)M@5eo\m]-[Vr ;Gv$apU5EfYzת𺋥R3F#`ennn(b`"xS"g )u8@5"]]1.KۿcH<tyvJ^| ZHBin {) QK=$4Js>IQ0 .PSBR97 Q[J/L ; #u ƍ~̯J괲)vkwxO[q@ N7s + 8uZő dQCbٍ\.x5{H%w`8`H]EoG@CzpEYlt#cw<=+ݍ2Lp*Nޢ`u_oHtad0AUHaYa=UKI秧m^b;m{d:j%zbr0g:F#\?⟆uгZ765o̊+ip|q'NkX+f^޴*|=R^_Õ~w\<tͶn3O$6KP"ӅOIBB0W\ mSzfi�|v(/0XO1QYWn@7ZcW,a~q&t?OΨm]-N".1~y~Җv5x^GRsgًJj}:@yk嘭rpNJD]XEِ. /L5:b;ӝ49-Vmҹ/\^~4VJ%1Ua:\g\$ 5 @X<a lBM¨� u&WSAsv1 ~`(킁Sa-* fqLV(>eOH!U>b簗f58qS<) z> zDb)7昞ue110\"ۯ Ot<BfCgB 7spG�Jv&\8N|F}Cײ}+,'4l=K"?ᴠ,�l-7Wo 7Zj[Ml2�=+%zlI_ͯ䡽Ii6# MW/J0ִdhUxTG,Ϩ SVt v[|7IwW5 Q=N[sr1$m[ n%`w묰2Lڵ-ͺnT v,t#2uVlj_N<gN߯CgaF-=}q  xJ2I6'ܤǃ'!koӜf˚RXmApQ*b8z.V\QD#oیYn?zVB8.I3g8Qk1-#Pj|V<Q݈S)|;nM;Y(<cJi.m)'5NXK"R71r|dܭ"oVX~axfBʑ[:*GîRx'a?elmJaJ%U ;^5tb^t^&ZkELo:IGf@/%p}O)$V:`1n}# ENԵjۇ:&"pSTL3'<ю kD|Lֱ7HD8=.ǒ"_Oa g^,g5ddeFn%q Wc36=5p wKTClڼ&irQ.5YP\!ڛiF B9HZuzd S9E<3VgFUIRI@ X8(I|nD~[k$OKh&?@H&ce!O١󦿘Ѣѡ36XH+Vr@XzDDⅆpwc<HpW{/kM MC=Q6MN� 9$ Kζ#%!;§+ I6xɉ"4m#}1^dOu:o Se"Nw+qOٵӬxIsQ1}*I}Q+~.Nfvg)!xG8G�ROcڄ;wA m祝z%y~7a}H<YJUX|UjEЇx׾nr *:_Ւq}P,X-Z[cS|!rR(Fb8a_y&GjFԬax?9}X=@(aleJyX(_8IU\cOHu3fVz\$?jI2Z1'GxDU ѡ)f `9 b<LM%c%g9ldZuͭPͬEh8=SjaQ?"-r)ہȸ'G .6rUp,BW !W/ׯl8򨙚@G)3WyX3Kb׃d#< kjQ恰4qMd 4Sy[vok)+G\tl_*zyy7ʨw})Ib("=Jsof`:AP=8c,9U}qkclYֹSYBAjʼn2߳5zpK@YI59G2�^S871A. ӟU(20]JM\ Yu=wfhxumaLOu)vA(w.W$$d?H[^j-o.}&?SH$ung˼,xJg/1k /Q[4A=|rIMl Š?jTo6O%5՚>+|*<'Qdz\yXS0ws9p粥5HPhŮg}!*25△OV__WQ}H#Wc3u<lCق21ۍX%\YmeYtYGT!bJ7qeY[{ ]d})F$ǥq q }RW|e[m)\7Fżҿ q1~u{S7=�&,|ͿAD9dr𣛾9!kCl![AL2cQYa7iërQ%1_\IYvjjV_rhaXS:l7qBZ4ntEnk'6-Mmqcw}L2PB@m@ g -^T9g>ۣsZ`U2 QR8~(Ը,17q?ܚzE,X ǠC+lLFA G�Nf_ $czGƣH|!NRdYLZ~J6yuq%K_sY6wtWn?u[ -1Y Jk+^ N*=#FHB,*O51cZ�=+ɣ02rJ66)O3 (mIK4M \HZ`Ux1�:pobԊP͏Yc+ஹ8-plي" TO18lǗG6nw]ϡEL"mĝ(yt}SyG\H֞ʼ<$P'"_JSig*qUp7<"X@FU8u27{-K�Zi;[o; Sn%*  ̸;8D/G %" d09k-<߾P} )c`$˭3k!s{;Y`!3Uɪ\;WPc 6P`@YR35~lZU5+rlWYd'T$Q_[ذfZ@p3Hzk I? ^IKw-O5̆t]gqotB�YBTp֒�S̚n*Lt#[h)!i&%::Cs^ 6vTOAE~fU>Eˤb|cg/|pO[,/h3$"˝uGyIo!${O?<_zaOئ۷8lm.?q+sr@6qc[bê]!LiJjE!"Iz;z &J["_:�Ĕ)eÑn(65 ΓLLp gA;S6扮U=Es+;Ɂ]o͕&AO %fx ֟jѿ{3f[dzԞ7L6�GDJMƮ( |Fw{'"I>kW {dMTklvsEǹd mc1ПC7Q֐@&yܠ@9:vE`Xࢪ$Vj%8Ree3BqudU+ٙxfg"%s$+ t(qK4I D7wb_:J- BWkw�*mj=rwQǸY~_ i6˪7Aev'<v|2k @=8̝_4@K?3inDbAɹ.`%ȧRG])99$'Aڢ9~vH67u 4[i1jf3Z̭ | ̢0zwoX"SrXIߘ uV|Vb4"%+ϝC "YXwpK@|Z\~W]8} zAGL4M\l8s@ҹ\WN@j�Ԇ|J$.1 4#H"Y ~?BF�k& 3Gނ.3n_;�ww6'-i7󒺌vFTZۗn/\q`cxط7. \C.sPZT-&6bC0xZ=.0Tg{ )oн8mn"Bfj*p_[n҄Mup]j$k7Zݹm@[)k;~uupW{6=t;~z}s^RѶzH;JRL;n(ŭAQ™&Bo�Rȍk2L\$AGѧim-y#(,h 1hhvǪK 9ǰ,_uΠH}E2ܻeY" 8VQ6f c6'zՏ3^"-@H3?n| @)w <ZC3kF@j|)e=~5e5[BSpu3rf;L{z`r(rnFXĭ)dbxwgCPVf2Atk3xhl&ƌs/kovap䊎ҷ>H/7T+~ 7F)|M7tpw'dK=G0,Np~Sq_.Û5 07/ejjC} xwJ X'n*`g_�{2WW1U$AН|Xf CB~2 PK\򘃫gϰYer0G7 s?-|.V#RW-h.L}s)iS8-yzE 2dӶiњ`UORՓ.!US44&ۏK8xH2EE =8 !<|{_ ry-PkVI\"__fwoU\@zc]A_ A-0W=N϶!罓/.O"e\W!>J՞3ԩ%NڔՙGZl(Il8`Av{ck`LNOL׳Eprl>򵟕vxؿw ٩3_UOwMdX!;GqMƒH<u[_֠(St8̿=5/[$B0̯!@[)I]y% c5�˂-Nt5eDuZG!f.wn^(r6 ygP;!ˬ 2h6&kV#<9l@-L,J> E1\ X/KPdȓࠣCl<&ݤ-dT^_ӭI-V&i_)F<*̚ql'?r,S2 l(Xyv̧D'#z_y vϖB?6*skOs7�F{pt**R,HejÙ3jMwc)rDU53EL1P6k̅K_H F 0ȌT`۲m=F/϶<D~%sZH=h*'P©7:_ɅRЩ'm(zp1mw<`;` 9hvgd3־,~%Uؕ = Nu0qg'cǕ웸0VoJ�J t|.R!j9g%&3 `ir%J9W+U!T`FƆ蚀\ Ls.AaH0ĚLYJ=b5Y4¶\2KFWM^*Lz1bO%^t1.RIPFTtm_&-'q#:L6wkϳѼ<uf.<cבgr@DdU¥qfL-/ ͏{ԣQnҌ,|T{ Q_ DK'ed&N2@TYVF2!IbbGm蛜08KB[يv ='�uBXVڻ_Jh÷C!tАߕx*[ych2FqS]<PJ5|B BByB40ot?1g<jE;WI&𿠗Ѝl(HD�6TX>]2aW-[M%Hjw&];,Q}XAx2~ALYQixg\hK{L';H wX:;C@YMP|OK-F˼ =tvt3{UV%V'PGG:-˯mP/CVYZr`WkwyU`(7<P#o uSA-k:T᫭ͳFwHo=�<Ĩ~xٌuH$t0YB2w nQZT:�1SƆ]`mtl׊b `0]GD/~LɋO_O9-aHE0]a,f{, jvNY] q+Ysal+Pz Mx`0Y[XwJӑ;QsHîL.s2%7)]!+wQٻ5TN/-*R:g]ZhF֔gM#@SygE{+fߗn[qͦ1;D;=I �<⽳6՟׮ _GBpߐ6Xl9#h?Ew0@o@,aXBEwΠM�{:Ey2k*l8)hwbWa^3Z-dV.iKRDYp֊Wj2ҿѶyJY*4 moS|AJqpČ@sGtJԌE |b;}fiQ=9<ie܌xnœi;;GGG/}hծ+ Uͨp赉&W|)قG#xbw8ߐ΁'٨Qx4G#_'H웝ہ1aD:1qr\"<qEw y 됀M9H&p-,0\a2<?@:R A74sQG~TX<FsK/jL_z^|w}0�̄ n)Ra4TYH@3W5;�E'xƗAiཟMҙb.+0![@ׁ@az\Y殓i~ٖV/^LK!U絶1f7Utqq WBh_Dc3^Y])}Owq>-H+9"<aBsl~@"4܂ $�}[Φ4'a.4K:#6~7R/8i. ؇3K?͸g2 ]<'EDb,m=:/kYNT\&yeQ<"a$AZ@J::f(5Ka-u7>Myx<y<;ž*8GQSl}xZGO>EHG<CN@U?z{_hʔM`5<o8JkMgcqJmG YD3MMvo>Oah wcUuУAB{u$tDk' DT bk?g&xYJ&]8�Gɼ}2~uw߃VNKmGFCBJV7]rSFKK&ǭo \k2 4 _�T W+l.{zDb&?d>P|t;ş$qmrDz3F~ n<rThxMkp`B<a9mF0b~#&lIӷA92 [j8"2Iz (|Q-{!o\բ&G>&^cP+hYUbWre8#s!3IX|RP\ PO*bCmҁx A޻$.gt`&t7[!EhGPՏcX3BX!/iK #wۻaL b.["!VU*]?^-GydT\|2f3*V]覸rOB[Xޯs؀I) *1p\-T 2+WaHaO]_(J/8F`ߖFU1&]_OءH+&B((' @má 'CWKPss+5fZfPvooBOp)bckXnulIƭ>H&,u7cAǒGvCG-omXWdUbS1W_Zc yC6?&pVfc<cU,"i>fP+sA/,t}`ᡨڂC)ycI S<A$(C%k6(IZfQ=UiF'&ߑv #z+|i-[9(]o6d:jv \U(u݆'~ꏾڟ϶z/H+4g�L-O9fSSд9uꐬSJ7Xhmo}yBw/S+V)G>Jsst $#]@(4MqFB\<1.BE+f' `+n;~YՀk�@>G:lT?qfRu;Y%>^c2stA=x1jrKïŒ9l`P+;1Ntd&d}^bE/b>.M2}J!bWXJn vzK u-e {lю-=<:|>~B%/LP+3g!U>OӐ G]ya6  lNaW;{4j&Ӿ},rzI )7-EjgʂOrAB~|0Z(c6·0F_^{W!z'j0Ht)=_/y‚m;W!e"Rgt C N5:E;%)ac׿ V,NRدySektیJ_rk3VeK R%cq?1%- %\jgncpxxwLa?7=v.Tܭ0)V#w–ݬ<+[&eL3A Ub)!5Q*a:_6弽26}҃r:/̾ض=uThl;Lm͔1Vz2`v/(X*,I鯗fuۙ WӺ-D+<O@ sK&}ߦW }Zp/YEj/Bh(pA&3+ݯ3Pjl WFv6Q6vdXhnY+v2GTؼ`8&!I]IM{_ncjKT`>?/!CgFZS`0ah-_H<cjoEb湈0God6!:=~$/̤-nþ*Gqωڭ =LާScՂ2z(&A,d=6DoWA;#BXӅߝԣh0+U=\H\^4y ~^'8/E}D'݅9]-t3cB[|d 0)%MQqF/F}\-~RK%#t>7HIlwBL38a$M u<Kx[∮zu:tÙ}Hx0?BArgVn~CZjgej~"ڞVu}_$ 􂐕MQ<lK0Uv}Hژn_ !Cw' Qrʎ7)~D|`a5 }A=p3!ȿ6KctU8//t'[s̙9|hYѱ#Y~"RA^s<kBص,T}>h d%Liu:8W:¸{%H>{lAfQg%dz1K�.l.өV yx0>'9.A&#\ō!mAI"އ(tƗ<9iv "bc[!>ԇg+<4 ί{E_5 1aA%`B ZW/-jUf)Km:{s[c] tk- 7gQQ!~U ?>D5x?K|oS]O25One hڮq-tgo$[t<%Lvt/9WJx 18%ad:DP}O "w:?i-rVOG.0&_] Bq׌|7E 1j.Tєdj>~M\ jފK ܶ6}`aWۛ!yOki[ A `9S™EFxܚY).�Mm/fȷ17N҂H64]VOH(WR1PR2'u >X\Q9-asBs8svAh'-c'@c~EJu8QMԥ!3U 3S'^j9l\TS?FNǠ<j)gC>'VՇ+ݙ1O7ixvԲlZn�׿:^wW3`\PZe'$4:P`RUAn Yző ׷b5,;Rؕ`_Ĝ85v@}8ȁ5fv}9 aZwU6Dv{/jN;%ωo23rg4{-祐Gl6`[xVL+G[_ �Q3rVp{5k0rPwa$;GȆyQyC9( x|ER-ڀ@~AYɼ#�( (qQx>7qVV &!`(]^,Xh6Uv'DT\Ɂ;ʶTp>!D8XÊYKoiRC|B[�iAg6,tpȑ7#tZu: m. ߝ-4GW-{w3D5`>8$h4gZ<UL8Ib]?7’o|7)A6G_(d޻ùYbgf!G [L\1 š# k RPd{.i_DH!rXmΜc: ^?}t7*pnm0+Xd:+Jx nF("2!m1:NiH:ʱT �B10SR(f6$jo"aK:bD8SM1lP `*/{胈%+S|4j"|0SVg۸jPF3'Iqٳ$%KLZ_US2HTq';<PNs 5 4*,C^(!TDe]oES33*+(%LQ9MtSW'‡=Ϣ=, #Q7'!|ޅ4'{ޏlcW<fEjjhz ! Ō^Fi"km�O) ȁ:,&Ek[_нDiP+Z{0WiXA3+xeE]xE\ -7wS�|A69C!K\,�v,e- /U̹EfFsb)݊y2P-rJ` qYw;t5>p%y>j,sr/RȊ^$S%x@A<W yux86''\Hv#qyZm`pʧfYR]m;9=NM4TVTgf1yt!;  �H&` m/ov {r#$3'eAQm' 0D\ܙ nS,FvAX>֕" [WaLܰ u=V}؀MDAǕJg)`<F$n ɌF҃PU6bUl_5:@Є ]F^t ;e3e'Ǡ.K:r-HRkQ#RZCX0Fa0>U1yňI/U\2KDnHfR̡¾j_`OB:#‘;pϞr%5'~vR!8Tbi($l-ZN5^�} UՃiEn=%%of4\\%!-_p0 4>°xH6(CQٶ-H_?N?xj9"{q'ƋT_VݦYjeʬjZI4@rˇ]." blLɃ3DZf2X@ |{,@Mz!/ʤw B,9tHP2|/89fpTzS`K Ci"/C9?f$D׵_ARF5k+eǶ!B6/:B)*z|gkܨGv)H%+n铯o9D:+x_V)NDflNfbzI|F �#q�c׺{`+fhqzi Xz]AU>*!*d'6oHHjfA<4I\ccD]"L.i(C#͐ch+NUJԿjZfbLذyv(W}׊i濸^ !Y8)֯Ӏ<;aގ_OSd.eF}E�/LOM@V^�WBphHfr3d<u=]<5EA|z&\?S5j%{\!E: Vvf@1[ZDbu!f�q}lC2VJ ?3,aM_"X*)s-\1]nwj vgW R8#:B'+GYG� Q}5y-ޤqa%3Z0]ѣ =" n)꾺$:`W)gIM^7+~\q$N0(ǒnhc5mSn !7nf["Ě}xb.>YiY|ӗ̱p{3y3RLШl7K]TG5V- H΋@B]FVQS-,XА<M3;Hy-E$zd6@Ҧ~S:S۽^]TE@'Tg /QZypyxK:eOe?Shtkn͠v2Վթ$mBa  (,`F..[Z(4j� u$1qK(vĻ.$7,ˏ0 $W\їyv+<,6)mekh7Hi3MLUBD[<R\HLSb 8x'p ܾ5MCo:SQ.u*Ysmr6N=֐o,: _E?!\e>XZ"ۉj]�^'W8s)TrVM˥Wc/.vPY%M\>d+*GIwHOz`', &znˀ KGU)ѥXC8sG$P\oTՅ sfx'>sxhgfF f4tX˛!+1цB<t<q 8"5.\kjt\N3$9B=Ѩ^=ӪgK]f?tu^MzͦYB[P9S#œtbَ_OKۇ# IK@G k9dz& שID)NrbIgk'ؙ]"$[1 LHPJB&gn~8|bOƜ m$&O$iJ$YeM3i{zQ~9mN5~NDJ2;S^ws'T mƟ!'~P^IcGk,US@ںc Y~ٝ!żtU)5װωkvɭ:5u->3d@; m;$XP?$)x8+%+H9Kt>c לĿ./VU: x8UKcjC'[[}..!cw<;2Vg9|�DrlKU |; <c}o x w0F.Ozu`e3;"fX5Ν7FG6D&x~g귪Ax{mDl/s LN{O\<}$S5'~B<@Sp?Ҏ>N]OjЮAsK̾hSyuh]1 '&> jjD)Bp)?=aFuR yO-PئljKW`&D (.{A09e Pkx^KaT m3!KՊܮM#qLV𔑏nv0te:s\\ĶDOB^@?Ǯn0T ;¿:,mIŅfJ^gT~CT@yibr]MF[GW2&@voWQ֪H# :֮1y8ݞKyG(qiOe<=;f'lh =1}[I�P1+NeUՄk&{3)qwEnf1nK2B}T9~a'.>(nDbBy(/C5nyQ1:126[;Q ZEYXF9n")${V e- Ӱ[RX Pܮ iX 8:II|R'LŎKßIQoh3PJ (<ex5Kp-j j+"w@.籖k=űc 5| ߺW.uCrBtN/堭22,$#W4c-Q9N\{]aI՗4q  3d#dL#+P=_>1Q1T&;bv{Lˀ/ L|!-^^|�бXP`)qv:C&'dͯ bhT(.RI^Fކ\w\e#"/Q 7\/,{B}s2jhx8,(c&//@>i+E�۾1֍<Q]d6$G#;~ 9䱺%6@ l+:O:,hObƢt,)$~16 (|9GW 5a9 MZyE I59^(|Rd^ ; ,yQa|Kɝj \ 㳷J.[D]E0#|?DV,}q0oRrcϑiSm=0O14Lvv&uFX~ƃ. |i">ų.xO' %уIr1AEIlL&YSJqFC2#']4 r =m@ q6btFe g'_W~r d"2i'Q~\B< Doޥg=\"o iubYb˞k<Ҵ^ wگ 4 eRos <H�ގ*h34I9%4!y;m%r+LCs3J!ϸTT ,aЉoɥ+R3[22 &,I34H TX;q7^GN潗Qr)φ�{4!ᄀFD̛ dNox'B:7}Y6,q ŤA&=3)/t{lk?s^6^nJumr!a"exCf|Ftpk(pDH?{1x KV ;8f߯L-dICMlFLB4TofLlR#YBH ̭xCܾ0+_%P-PDƛw�|j;Qv"6Of)C5z MuY$)v!nFn0 uNِYVA9tUt~ww~rBoMiS+-[w#7-jP›eo$_0n 1GQmTiedYlJ8\:"&/%ǎJv(lZvMIfo`)�2-W 01U8f[0*\�Mrr\֖v rO=g51Q$uԏ%Pm˝d:W~iXl<ȱvM:^9SǍ<RNH3Κ^~X)(3x6t67)ux|ҘfyE4W;vom:lqÓOA992&Ju )Fu=i%L3zbK{EL'�XZ^6D�fEL2Hz|/eM=Qȃ'-O}cpob mՊ`%Y(&YwAY%Xi=f::;<3\>Ji Wtl;Ys= vEp#P2 URN _VfknCe+:Tl.YvEH1H6&"Jg}yqPU29WRr_,p(Ta}tNÌ0Uy=^?B޽N@=nRl w^4AԽ=6[&(J=ܚ."M;QZJwhĺՒ:-jc0m! )ey[/Ԓ-SdMAMcҒOvkWTpTMpBj߉טZaOF6ڊl~Rܣ@l0"\  oR*T#ظէ7+ <A*wƹCy7_,cjҟ{Q!z%nѷg`"c%ZZd*K>h`8F`sc%)d�)"jbJ, / Oo ,wXA/ERwk??uDlv9"C(`Shݟo]y`tx/%k86}\c@14V낤 w`ʬn2 <qiQ'8iߢrλ9Xi?rQ JwFԢH(O. bP-78ڇQ~S]_xLF+8Th"4B iT[I^Kn{ܡogS'n,UkLd$qzu$@Jjy^"fe%c(mRg;֑>rI�xPY_`c;hܳ mA|blU#i!pwԒXf<% КPsz_W_Oo{_rAo歏"O3ċt$?Z}0R=yF~)cxJ> W%9Xb[αB@g ����packer-1.6.6+ds1/test/fixtures/provisioner-ansible/minimal.json�������������������������������������0000664�0000000�0000000�00000000750�13771713062�0024630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "ansible", "playbook_file": "./playbook.yml" } ], "builders": [ { "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-minimal-{{timestamp}}", "source_image": "debian-8-jessie-v20161027", "zone": "us-central1-a", "ssh_username": "debian" } ] } ������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/playbook.yml�������������������������������������0000664�0000000�0000000�00000002157�13771713062�0024655�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- - hosts: default:packer-test gather_facts: no tasks: - name: touch raw: touch /tmp/ansible-raw-test - name: raw test raw: date - name: command test command: echo "the command module" - name: prepare remote directory command: mkdir /tmp/remote-dir args: creates: /tmp/remote-dir - name: transfer file.txt copy: src=dir/file.txt dest=/tmp/remote-dir/file.txt - name: fetch file.text fetch: src=/tmp/remote-dir/file.txt dest=fetched-dir validate=yes fail_on_missing=yes - name: copy contents of directory copy: src=dir/contents-only/ dest=/tmp/remote-dir - name: fetch contents of directory fetch: src=/tmp/remote-dir/file.txt dest="fetched-dir/{{ inventory_hostname }}/tmp/remote-dir/contents-only/" flat=yes validate=yes fail_on_missing=yes - name: copy directory recursively copy: src=dir/subdir dest=/tmp/remote-dir - name: fetch recursively copied directory fetch: src=/tmp/remote-dir/subdir/file.txt dest=fetched-dir validate=yes fail_on_missing=yes - copy: src=largish-file.txt dest=/tmp/largish-file.txt �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/requirements.yml���������������������������������0000664�0000000�0000000�00000000046�13771713062�0025553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������collections: - name: artis3n.github ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/scp-to-sftp.json���������������������������������0000664�0000000�0000000�00000001205�13771713062�0025355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "ansible", "playbook_file": "./playbook.yml", "extra_arguments": [ ], "sftp_command": "/usr/bin/false", "use_sftp": false } ], "builders": [ { "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-scp-to-sftp-{{timestamp}}", "source_image": "debian-8-jessie-v20161027", "zone": "us-central1-a", "ssh_username": "debian", "ssh_file_transfer_method": "sftp" } ] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/scp.json�����������������������������������������0000664�0000000�0000000�00000001121�13771713062�0023760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "ansible", "playbook_file": "./playbook.yml", "extra_arguments": [ ], "sftp_command": "/usr/bin/false", "use_sftp": false } ], "builders": [ { "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-scp-{{timestamp}}", "source_image": "debian-8-jessie-v20161027", "zone": "us-central1-a", "ssh_username": "debian" } ] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/sftp.json����������������������������������������0000664�0000000�0000000�00000001072�13771713062�0024154�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "ansible", "playbook_file": "./playbook.yml", "sftp_command": "/usr/lib/sftp-server -e -l INFO", "use_sftp": true } ], "builders": [ { "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-sftp-{{timestamp}}", "source_image": "debian-8-jessie-v20161027", "zone": "us-central1-a", "ssh_username": "debian" } ] } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/win-playbook.yml���������������������������������0000664�0000000�0000000�00000001321�13771713062�0025440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- - hosts: default:packer-test gather_facts: no tasks: #- debug: msg="testing regular modules that function with Windows: raw, fetch, slurp, setup" - name: raw test raw: date /t - debug: msg="testing windows modules" #- win_file: path=tmp/remote-dir state=directory #- name: win_shell test #win_shell: date /t - name: win_copy test win_copy: src=dir/file.txt dest=file.txt #- win_copy: src=dir/file.txt dest=/tmp/remote-dir/file.txt #- fetch: src=/tmp/remote-dir/file.txt dest=fetched-dir validate=yes fail_on_missing=yes #- win_copy: src=largish-file.txt dest=/tmp/largish-file.txt - debug: msg="packer does not support downloading from windows" ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-ansible/winrm.json���������������������������������������0000664�0000000�0000000�00000001637�13771713062�0024343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "variables": {}, "provisioners": [ { "type": "ansible", "playbook_file": "./win-playbook.yml", "extra_arguments": [ "--connection", "packer", "--extra-vars", "ansible_shell_type=powershell ansible_shell_executable=None" ] } ], "builders": [ { "type": "googlecompute", "account_file": "{{user `account_file`}}", "project_id": "{{user `project_id`}}", "image_name": "packerbats-winrm-{{timestamp}}", "source_image": "windows-server-2012-r2-dc-v20160916", "communicator": "winrm", "zone": "us-central1-a", "disk_size": 50, "winrm_username": "packer", "winrm_use_ssl": true, "winrm_insecure": true, "metadata": { "sysprep-specialize-script-cmd": "winrm set winrm/config/service/auth @{Basic=\"true\"}" } } ] } �������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-file/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021607�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-file/dir/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022365�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-file/dir/file.txt����������������������������������������0000664�0000000�0000000�00000000012�13771713062�0024036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������337 miles ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-file/dir_no_trailing.json��������������������������������0000664�0000000�0000000�00000000764�13771713062�0025654�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "file", "source": "dir", "destination": "/tmp" }, { "type": "shell", "inline": ["cat /tmp/dir/file.txt"] }] } ������������packer-1.6.6+ds1/test/fixtures/provisioner-file/dir_no_trailing_sftp.json���������������������������0000664�0000000�0000000�00000001033�13771713062�0026676�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "t2.micro", "region": "us-east-1", "ssh_username": "ec2-user", "ssh_file_transfer_method": "sftp", "source_ami": "ami-8da458e6", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "file", "source": "dir", "destination": "/tmp" }, { "type": "shell", "inline": ["cat /tmp/dir/file.txt"] }] } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-file/dir_with_trailing.json������������������������������0000664�0000000�0000000�00000000761�13771713062�0026210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "file", "source": "dir/", "destination": "/tmp" }, { "type": "shell", "inline": ["cat /tmp/file.txt"] }] } ���������������packer-1.6.6+ds1/test/fixtures/provisioner-file/dir_with_trailing_sftp.json�������������������������0000664�0000000�0000000�00000001030�13771713062�0027232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "t2.micro", "region": "us-east-1", "ssh_username": "ec2-user", "ssh_file_transfer_method": "sftp", "source_ami": "ami-8da458e6", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "file", "source": "dir/", "destination": "/tmp" }, { "type": "shell", "inline": ["cat /tmp/file.txt"] }] } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-file/file.json�������������������������������������������0000664�0000000�0000000�00000000776�13771713062�0023433�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "file", "source": "file.txt", "destination": "/tmp/file.txt" }, { "type": "shell", "inline": ["cat /tmp/file.txt"] }] } ��packer-1.6.6+ds1/test/fixtures/provisioner-file/file.txt��������������������������������������������0000664�0000000�0000000�00000000014�13771713062�0023262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������24901 miles ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-file/file_sftp.json��������������������������������������0000664�0000000�0000000�00000001045�13771713062�0024455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "t2.micro", "region": "us-east-1", "ssh_username": "ec2-user", "ssh_file_transfer_method": "sftp", "source_ami": "ami-8da458e6", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "file", "source": "file.txt", "destination": "/tmp/file.txt" }, { "type": "shell", "inline": ["cat /tmp/file.txt"] }] } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-shell/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021777�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-shell/inline.json����������������������������������������0000664�0000000�0000000�00000000737�13771713062�0024157�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "shell", "inline": [ "bash -c 'echo HELLO I AM `whoami`'", "echo AND ANOTHER" ] }] } ���������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-shell/script.json����������������������������������������0000664�0000000�0000000�00000000616�13771713062�0024201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "shell", "script": "script.sh" }] } ������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-shell/script.sh������������������������������������������0000775�0000000�0000000�00000000051�13771713062�0023636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bash echo HELLO I AM DOG ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/fixtures/provisioner-shell/scripts.json���������������������������������������0000664�0000000�0000000�00000000647�13771713062�0024370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "builders": [{ "type": "amazon-ebs", "ami_name": "packer-test {{timestamp}}", "instance_type": "m1.small", "region": "us-east-1", "ssh_username": "ubuntu", "source_ami": "ami-0568456c", "tags": { "packer-test": "true" } }], "provisioners": [{ "type": "shell", "scripts": [ "script.sh" ] }] } �����������������������������������������������������������������������������������������packer-1.6.6+ds1/test/provisioner_ansible.bats������������������������������������������������������0000775�0000000�0000000�00000007022�13771713062�0021375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the ansible provisioner on Google Cloud Provider (i.e. # googlecompute). The teardown function will delete any images with the text # "packerbats" within the name. load test_helper fixtures provisioner-ansible # Required parameters : ${GC_ACCOUNT_FILE:?} : ${GC_PROJECT_ID:?} command -v gcloud >/dev/null 2>&1 || { echo "'gcloud' must be installed" >&2 exit 1 } USER_VARS="${USER_VARS} -var account_file=${GC_ACCOUNT_FILE}" USER_VARS="${USER_VARS} -var project_id=${GC_PROJECT_ID}" # This tests if GCE has an image that contains the given parameter. gc_has_image() { gcloud compute --format='table[no-heading](name)' --project=${GC_PROJECT_ID} images list \ | grep $1 | wc -l } setup(){ rm -f $FIXTURE_ROOT/ansible-test-id rm -f $FIXTURE_ROOT/ansible-server.key ssh-keygen -N "" -f $FIXTURE_ROOT/ansible-test-id ssh-keygen -N "" -f $FIXTURE_ROOT/ansible-server.key } teardown() { gcloud compute --format='table[no-heading](name)' --project=${GC_PROJECT_ID} images list \ | grep packerbats \ | xargs -n1 gcloud compute --project=${GC_PROJECT_ID} images delete rm -f $FIXTURE_ROOT/ansible-test-id rm -f $FIXTURE_ROOT/ansible-test-id.pub rm -f $FIXTURE_ROOT/ansible-server.key rm -f $FIXTURE_ROOT/ansible-server.key.pub rm -rf $FIXTURE_ROOT/fetched-dir } @test "ansible provisioner: build docker.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/docker.json [ "$status" -eq 0 ] diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null } @test "ansible provisioner: build minimal.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/minimal.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-minimal")" -eq 1 ] diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null } @test "ansible provisioner: build all_options.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/all_options.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-alloptions")" -eq 1 ] diff -r dir fetched-dir/packer-test/tmp/remote-dir > /dev/null } @test "ansible provisioner: build galaxy.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/galaxy.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-galaxy")" -eq 1 ] diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null } @test "ansible provisioner: build scp.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/scp.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-scp")" -eq 1 ] diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null } @test "ansible provisioner: build scp-to-sftp.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/scp-to-sftp.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-scp-to-sftp")" -eq 1 ] diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null } @test "ansible provisioner: build sftp.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/sftp.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-sftp")" -eq 1 ] diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null } @test "ansible provisioner: build winrm.json" { cd $FIXTURE_ROOT run packer build ${USER_VARS} $FIXTURE_ROOT/winrm.json [ "$status" -eq 0 ] [ "$(gc_has_image "packerbats-winrm")" -eq 1 ] echo "packer does not support downloading files from download, skipping verification" #diff -r dir fetched-dir/default/tmp/remote-dir > /dev/null } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/provisioner_file.bats���������������������������������������������������������0000775�0000000�0000000�00000002603�13771713062�0020677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the amazon-ebs builder. The teardown function will automatically # delete any AMIs with a tag of `packer-test` being equal to "true" so # be sure any test cases set this. load test_helper verify_aws_cli fixtures provisioner-file setup() { cd $FIXTURE_ROOT } teardown() { aws_ami_cleanup } @test "file provisioner: single file" { run packer build $FIXTURE_ROOT/file.json [ "$status" -eq 0 ] [[ "$output" == *"24901 miles"* ]] } @test "file provisioner: directory (no trailing slash)" { run packer build $FIXTURE_ROOT/dir_no_trailing.json [ "$status" -eq 0 ] [[ "$output" == *"337 miles"* ]] } @test "file provisioner: directory (with trailing slash)" { run packer build $FIXTURE_ROOT/dir_with_trailing.json [ "$status" -eq 0 ] [[ "$output" == *"337 miles"* ]] } @test "file provisioner: single file through sftp" { run packer build $FIXTURE_ROOT/file_sftp.json [ "$status" -eq 0 ] [[ "$output" == *"24901 miles"* ]] } @test "file provisioner: directory through sftp (no trailing slash)" { run packer build $FIXTURE_ROOT/dir_no_trailing_sftp.json [ "$status" -eq 0 ] [[ "$output" == *"337 miles"* ]] } @test "file provisioner: directory through sftp (with trailing slash)" { run packer build $FIXTURE_ROOT/dir_with_trailing_sftp.json [ "$status" -eq 0 ] [[ "$output" == *"337 miles"* ]] } �����������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/provisioner_shell.bats��������������������������������������������������������0000775�0000000�0000000�00000001514�13771713062�0021067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env bats # # This tests the amazon-ebs builder. The teardown function will automatically # delete any AMIs with a tag of `packer-test` being equal to "true" so # be sure any test cases set this. load test_helper verify_aws_cli fixtures provisioner-shell setup() { cd $FIXTURE_ROOT } teardown() { aws_ami_cleanup } @test "shell provisioner: inline scripts" { run packer build $FIXTURE_ROOT/inline.json [ "$status" -eq 0 ] [[ "$output" == *"HELLO I AM ubuntu"* ]] [[ "$output" == *"AND ANOTHER"* ]] } @test "shell provisioner: script" { run packer build $FIXTURE_ROOT/script.json [ "$status" -eq 0 ] [[ "$output" == *"HELLO I AM DOG"* ]] } @test "shell provisioner: scripts" { run packer build $FIXTURE_ROOT/scripts.json [ "$status" -eq 0 ] [[ "$output" == *"HELLO I AM DOG"* ]] } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/test/test_helper.bash��������������������������������������������������������������0000664�0000000�0000000�00000003061�13771713062�0017617�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Let's verify that the tools we need are installed verify_aws_cli() { declare -a required=(aws) for cmd in "${required[@]}"; do command -v $cmd >/dev/null 2>&1 || { echo "'$cmd' must be installed" >&2 exit 1 } done } #-------------------------------------------------------------------- # Bats modification #-------------------------------------------------------------------- # This allows us to override a function in Bash save_function() { local ORIG_FUNC=$(declare -f $1) local NEWNAME_FUNC="$2${ORIG_FUNC#$1}" eval "$NEWNAME_FUNC" } # Override the run function so that we always output the output save_function run old_run run() { old_run $@ # Output the command we ran echo "Executing: " $@ # "$output" gets rid of newlines. This will bring them back. for line in "${lines[@]}"; do echo $line done } #-------------------------------------------------------------------- # Helper functions #-------------------------------------------------------------------- # This sets the directory for fixtures by specifying the name of # the folder with fixtures. fixtures() { FIXTURE_ROOT="$BATS_TEST_DIRNAME/fixtures/$1" } # This deletes any AMIs with a tag "packer-test" of "true" aws_ami_cleanup() { local region=${1:-us-east-1} aws ec2 describe-images --region ${region} --owners self --output text \ --filters 'Name=tag:packer-test,Values=true' \ --query 'Images[*].ImageId' \ | xargs -n1 aws ec2 deregister-image --region ${region} --image-id } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/tty.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000000140�13771713062�0014625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !solaris package main import ( "github.com/mattn/go-tty" ) var openTTY = tty.Open ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/tty_solaris.go���������������������������������������������������������������������0000664�0000000�0000000�00000000305�13771713062�0016364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package main import ( "fmt" packersdk "github.com/hashicorp/packer/packer-plugin-sdk/packer" ) func openTTY() (packersdk.TTY, error) { return nil, fmt.Errorf("no TTY available on solaris") } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/����������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0014760�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017017�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/�����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017723�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025406�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/.gitignore��������������������0000664�0000000�0000000�00000000412�13771713062�0027373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/LICENSE�����������������������0000664�0000000�0000000�00000026126�13771713062�0026422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright (c) 2016 1&1 Internet SE Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/README.md���������������������0000664�0000000�0000000�00000215321�13771713062�0026671�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# 1&amp;1 Cloudserver Go SDK The 1&amp;1 Go SDK is a Go library designed for interaction with the 1&amp;1 cloud platform over the REST API. This guide contains instructions on getting started with the library and automating various management tasks available through the 1&amp;1 Cloud Panel UI. ## Table of Contents - [Overview](#overview) - [Getting Started](#getting-started) - [Installation](#installation) - [Authentication](#authentication) - [Operations](#operations) - [Servers](#servers) - [Images](#images) - [Shared Storages](#shared-storages) - [Firewall Policies](#firewall-policies) - [Load Balancers](#load-balancers) - [Public IPs](#public-ips) - [Private Networks](#private-networks) - [VPNs](#vpns) - [Monitoring Center](#monitoring-center) - [Monitoring Policies](#monitoring-policies) - [Logs](#logs) - [Users](#users) - [Roles](#roles) - [Usages](#usages) - [Server Appliances](#server-appliances) - [DVD ISO](#dvd-iso) - [Ping](#ping) - [Pricing](#pricing) - [Data Centers](#data-centers) - [Examples](#examples) - [Index](#index) ## Overview This SDK is a wrapper for the 1&amp;1 REST API written in Go(lang). All operations against the API are performed over SSL and authenticated using your 1&amp;1 token key. The Go library facilitates the access to the REST API either within an instance running on 1&amp;1 platform or directly across the Internet from any HTTPS-enabled application. For more information on the 1&1 Cloud Server SDK for Go, visit the [Community Portal](https://www.1and1.com/cloud-community/). ## Getting Started Before you begin you will need to have signed up for a 1&amp;1 account. The credentials you create during sign-up will be used to authenticate against the API. Install the Go language tools. Find the install package and instructions on the official <a href='https://golang.org/doc/install'>Go website</a>. Make sure that you have set up the `GOPATH` environment variable properly, as indicated in the instructions. ### Installation The official Go library is available from the 1&amp;1 GitHub account found <a href='https://github.com/1and1/oneandone-cloudserver-sdk-go'>here</a>. Use the following Go command to download oneandone-cloudserver-sdk-go to your configured GOPATH: `go get github.com/1and1/oneandone-cloudserver-sdk-go` Import the library in your Go code: `import "github.com/1and1/oneandone-cloudserver-sdk-go"` ### Authentication Set the authentication token and create the API client: ``` token := oneandone.SetToken("82ee732b8d47e451be5c6ad5b7b56c81") api := oneandone.New(token, oneandone.BaseUrl) ``` Refer to the [Examples](#examples) and [Operations](#operations) sections for additional information. ## Operations ### Servers **List all servers:** `servers, err := api.ListServers()` Alternatively, use the method with query parameters. `servers, err := api.ListServers(page, per_page, sort, query, fields)` To paginate the list of servers received in the response use `page` and `per_page` parameters. Set `per_page` to the number of servers that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of servers sorted in expected order pass a server property (e.g. `"name"`) in `sort` parameter. Use `query` parameter to search for a string in the response and return only the server instances that contain it. To retrieve a collection of servers containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,description,hardware.ram"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a single server:** `server, err := api.GetServer(server_id)` **List fixed-size server templates:** `fiss, err := api.ListFixedInstanceSizes()` **Retrieve information about a fixed-size server template:** `fis, err := api.GetFixedInstanceSize(fis_id)` **Retrieve information about a server's hardware:** `hardware, err := api.GetServerHardware(server_id)` **List a server's HDDs:** `hdds, err := api.ListServerHdds(server_id)` **Retrieve a single server HDD:** `hdd, err := api.GetServerHdd(server_id, hdd_id)` **Retrieve information about a server's image:** `image, err := api.GetServerImage(server_id)` **List a server's IPs:** `ips, err := api.ListServerIps(server_id)` **Retrieve information about a single server IP:** `ip, err := api.GetServerIp(server_id, ip_id)` **Retrieve information about a server's firewall policy:** `firewall, err := api.GetServerIpFirewallPolicy(server_id, ip_id)` **List all load balancers assigned to a server IP:** `lbs, err := api.ListServerIpLoadBalancers(server_id, ip_id)` **Retrieve information about a server's status:** `status, err := api.GetServerStatus(server_id)` **Retrieve information about the DVD loaded into the virtual DVD unit of a server:** `dvd, err := api.GetServerDvd(server_id)` **List a server's private networks:** `pns, err := api.ListServerPrivateNetworks(server_id)` **Retrieve information about a server's private network:** `pn, err := api.GetServerPrivateNetwork(server_id, pn_id)` **Retrieve information about a server's snapshot:** `snapshot, err := api.GetServerSnapshot(server_id)` **Create a server:** ``` req := oneandone.ServerRequest { Name: "Server Name", Description: "Server description.", ApplianceId: server_appliance_id, PowerOn: true, Hardware: oneandone.Hardware { Vcores: 1, CoresPerProcessor: 1, Ram: 2, Hdds: []oneandone.Hdd { oneandone.Hdd { Size: 100, IsMain: true, }, }, }, } server_id, server, err := api.CreateServer(&req) ``` **Create a fixed-size server and return back the server's IP address and first password:** ``` req := oneandone.ServerRequest { Name: server_name, ApplianceId: server_appliance_id, PowerOn: true_or_false, Hardware: oneandone.Hardware { FixedInsSizeId: fixed_instance_size_id, }, } ip_address, password, err := api.CreateServerEx(&req, timeout) ``` **Update a server:** `server, err := api.RenameServer(server_id, new_name, new_desc)` **Delete a server:** `server, err := api.DeleteServer(server_id, keep_ips)` Set `keep_ips` parameter to `true` for keeping server IPs after deleting a server. **Update a server's hardware:** ``` hardware := oneandone.Hardware { Vcores: 2, CoresPerProcessor: 1, Ram: 2, } server, err := api.UpdateServerHardware(server_id, &hardware) ``` **Add new hard disk(s) to a server:** ``` hdds := oneandone.ServerHdds { Hdds: []oneandone.Hdd { { Size: 50, IsMain: false, }, }, } server, err := api.AddServerHdds(server_id, &hdds) ``` **Resize a server's hard disk:** `server, err := api.ResizeServerHdd(server_id, hdd_id, new_size)` **Remove a server's hard disk:** `server, err := api.DeleteServerHdd(server_id, hdd_id)` **Load a DVD into the virtual DVD unit of a server:** `server, err := api.LoadServerDvd(server_id, dvd_id)` **Unload a DVD from the virtual DVD unit of a server:** `server, err := api.EjectServerDvd(server_id)` **Reinstall a new image into a server:** `server, err := api.ReinstallServerImage(server_id, image_id, password, fp_id)` **Assign a new IP to a server:** `server, err := api.AssignServerIp(server_id, ip_type)` **Release an IP and optionally remove it from a server:** `server, err := api.DeleteServerIp(server_id, ip_id, keep_ip)` Set `keep_ip` to true for releasing the IP without removing it. **Assign a new firewall policy to a server's IP:** `server, err := api.AssignServerIpFirewallPolicy(server_id, ip_id, fp_id)` **Remove a firewall policy from a server's IP:** `server, err := api.UnassignServerIpFirewallPolicy(server_id, ip_id)` **Assign a new load balancer to a server's IP:** `server, err := api.AssignServerIpLoadBalancer(server_id, ip_id, lb_id)` **Remove a load balancer from a server's IP:** `server, err := api.UnassignServerIpLoadBalancer(server_id, ip_id, lb_id)` **Start a server:** `server, err := api.StartServer(server_id)` **Reboot a server:** `server, err := api.RebootServer(server_id, is_hardware)` Set `is_hardware` to true for HARDWARE method of rebooting. Set `is_hardware` to false for SOFTWARE method of rebooting. **Shutdown a server:** `server, err := api.ShutdownServer(server_id, is_hardware)` Set `is_hardware` to true for HARDWARE method of powering off. Set `is_hardware` to false for SOFTWARE method of powering off. **Assign a private network to a server:** `server, err := api.AssignServerPrivateNetwork(server_id, pn_id)` **Remove a server's private network:** `server, err := api.RemoveServerPrivateNetwork(server_id, pn_id)` **Create a new server's snapshot:** `server, err := api.CreateServerSnapshot(server_id)` **Restore a server's snapshot:** `server, err := api.RestoreServerSnapshot(server_id, snapshot_id)` **Remove a server's snapshot:** `server, err := api.DeleteServerSnapshot(server_id, snapshot_id);` **Clone a server:** `server, err := api.CloneServer(server_id, new_name)` ### Images **List all images:** `images, err = api.ListImages()` Alternatively, use the method with query parameters. `images, err = api.ListImages(page, per_page, sort, query, fields)` To paginate the list of images received in the response use `page` and `per_page` parameters. set `per_page` to the number of images that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of images sorted in expected order pass an image property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the elements that contain it. To retrieve a collection of images containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,creation_date"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a single image:** `image, err = api.GetImage(image_id)` **Create an image:** ``` request := oneandone.ImageConfig { Name: image_name, Description: image_description, ServerId: server_id, Frequency: image_frequenct, NumImages: number_of_images, } image_id, image, err = api.CreateImage(&request) ``` All fields except `Description` are required. `Frequency` may be set to `"ONCE"`, `"DAILY"` or `"WEEKLY"`. **Update an image:** `image, err = api.UpdateImage(image_id, new_name, new_description, new_frequenct)` If any of the parameters `new_name`, `new_description` or `new_frequenct` is set to an empty string, it is ignored in the request. `Frequency` may be set to `"ONCE"`, `"DAILY"` or `"WEEKLY"`. **Delete an image:** `image, err = api.DeleteImage(image_id)` ### Shared Storages `ss, err := api.ListSharedStorages()` Alternatively, use the method with query parameters. `ss, err := api.ListSharedStorages(page, per_page, sort, query, fields)` To paginate the list of shared storages received in the response use `page` and `per_page` parameters. Set `per_page` to the number of volumes that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of shared storages sorted in expected order pass a volume property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the volume instances that contain it. To retrieve a collection of shared storages containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,size,size_used"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a shared storage:** `ss, err := api.GetSharedStorage(ss_id)` **Create a shared storage:** ``` request := oneandone.SharedStorageRequest { Name: test_ss_name, Description: test_ss_desc, Size: oneandone.Int2Pointer(size), } ss_id, ss, err := api.CreateSharedStorage(&request) ``` `Description` is optional parameter. **Update a shared storage:** ``` request := oneandone.SharedStorageRequest { Name: new_name, Description: new_desc, Size: oneandone.Int2Pointer(new_size), } ss, err := api.UpdateSharedStorage(ss_id, &request) ``` All request's parameters are optional. **Remove a shared storage:** `ss, err := api.DeleteSharedStorage(ss_id)` **List a shared storage servers:** `ss_servers, err := api.ListSharedStorageServers(ss_id)` **Retrieve a shared storage server:** `ss_server, err := api.GetSharedStorageServer(ss_id, server_id)` **Add servers to a shared storage:** ``` servers := []oneandone.SharedStorageServer { { Id: server_id, Rights: permissions, } , } ss, err := api.AddSharedStorageServers(ss_id, servers) ``` `Rights` may be set to `R` or `RW` string. **Remove a server from a shared storage:** `ss, err := api.DeleteSharedStorageServer(ss_id, server_id)` **Retrieve the credentials for accessing the shared storages:** `ss_credentials, err := api.GetSharedStorageCredentials()` **Change the password for accessing the shared storages:** `ss_credentials, err := api.UpdateSharedStorageCredentials(new_password)` ### Firewall Policies **List firewall policies:** `firewalls, err := api.ListFirewallPolicies()` Alternatively, use the method with query parameters. `firewalls, err := api.ListFirewallPolicies(page, per_page, sort, query, fields)` To paginate the list of firewall policies received in the response use `page` and `per_page` parameters. Set `per_page` to the number of firewall policies that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of firewall policies sorted in expected order pass a firewall policy property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the firewall policy instances that contain it. To retrieve a collection of firewall policies containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,creation_date"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a single firewall policy:** `firewall, err := api.GetFirewallPolicy(fp_id)` **Create a firewall policy:** ``` request := oneandone.FirewallPolicyRequest { Name: fp_name, Description: fp_desc, Rules: []oneandone.FirewallPolicyRule { { Protocol: protocol, PortFrom: oneandone.Int2Pointer(port_from), PortTo: oneandone.Int2Pointer(port_to), SourceIp: source_ip, }, }, } firewall_id, firewall, err := api.CreateFirewallPolicy(&request) ``` `SourceIp` and `Description` are optional parameters. **Update a firewall policy:** `firewall, err := api.UpdateFirewallPolicy(fp_id, fp_new_name, fp_new_description)` Passing an empty string in `fp_new_name` or `fp_new_description` skips updating the firewall policy name or description respectively. **Delete a firewall policy:** `firewall, err := api.DeleteFirewallPolicy(fp_id)` **List servers/IPs attached to a firewall policy:** `server_ips, err := api.ListFirewallPolicyServerIps(fp_id)` **Retrieve information about a server/IP assigned to a firewall policy:** `server_ip, err := api.GetFirewallPolicyServerIp(fp_id, ip_id)` **Add servers/IPs to a firewall policy:** `firewall, err := api.AddFirewallPolicyServerIps(fp_id, ip_ids)` `ip_ids` is a slice of IP ID's. **Remove a server/IP from a firewall policy:** `firewall, err := api.DeleteFirewallPolicyServerIp(fp_id, ip_id)` **List rules of a firewall policy:** `fp_rules, err := api.ListFirewallPolicyRules(fp_id)` **Retrieve information about a rule of a firewall policy:** `fp_rule, err := api.GetFirewallPolicyRule(fp_id, rule_id)` **Adds new rules to a firewall policy:** ``` fp_rules := []oneandone.FirewallPolicyRule { { Protocol: protocol1, PortFrom: oneandone.Int2Pointer(port_from1), PortTo: oneandone.Int2Pointer(port_to1), SourceIp: source_ip, }, { Protocol: protocol2, PortFrom: oneandone.Int2Pointer(port_from2), PortTo: oneandone.Int2Pointer(port_to2), }, } firewall, err := api.AddFirewallPolicyRules(fp_id, fp_rules) ``` **Remove a rule from a firewall policy:** `firewall, err := api.DeleteFirewallPolicyRule(fp_id, rule_id)` ### Load Balancers **List load balancers:** `loadbalancers, err := api.ListLoadBalancers()` Alternatively, use the method with query parameters. `loadbalancers, err := api.ListLoadBalancers(page, per_page, sort, query, fields)` To paginate the list of load balancers received in the response use `page` and `per_page` parameters. Set `per_page` to the number of load balancers that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of load balancers sorted in expected order pass a load balancer property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the load balancer instances that contain it. To retrieve a collection of load balancers containing only the requested fields pass a list of comma separated properties (e.g. `"ip,name,method"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a single load balancer:** `loadbalancer, err := api.GetLoadBalancer(lb_id)` **Create a load balancer:** ``` request := oneandone.LoadBalancerRequest { Name: lb_name, Description: lb_description, Method: lb_method, Persistence: oneandone.Bool2Pointer(true_or_false), PersistenceTime: oneandone.Int2Pointer(seconds1), HealthCheckTest: protocol1, HealthCheckInterval: oneandone.Int2Pointer(seconds2), HealthCheckPath: health_check_path, HealthCheckPathParser: health_check_path_parser, Rules: []oneandone.LoadBalancerRule { { Protocol: protocol1, PortBalancer: lb_port, PortServer: server_port, Source: source_ip, }, }, } loadbalancer_id, loadbalancer, err := api.CreateLoadBalancer(&request) ``` Optional parameters are `HealthCheckPath`, `HealthCheckPathParser`, `Source` and `Description`. Load balancer `Method` must be set to `"ROUND_ROBIN"` or `"LEAST_CONNECTIONS"`. **Update a load balancer:** ``` request := oneandone.LoadBalancerRequest { Name: new_name, Description: new_description, Persistence: oneandone.Bool2Pointer(true_or_false), PersistenceTime: oneandone.Int2Pointer(new_seconds1), HealthCheckTest: new_protocol, HealthCheckInterval: oneandone.Int2Pointer(new_seconds2), HealthCheckPath: new_path, HealthCheckPathParser: new_parser, Method: new_lb_method, } loadbalancer, err := api.UpdateLoadBalancer(lb_id, &request) ``` All updatable fields are optional. **Delete a load balancer:** `loadbalancer, err := api.DeleteLoadBalancer(lb_id)` **List servers/IPs attached to a load balancer:** `server_ips, err := api.ListLoadBalancerServerIps(lb_id)` **Retrieve information about a server/IP assigned to a load balancer:** `server_ip, err := api.GetLoadBalancerServerIp(lb_id, ip_id)` **Add servers/IPs to a load balancer:** `loadbalancer, err := api.AddLoadBalancerServerIps(lb_id, ip_ids)` `ip_ids` is a slice of IP ID's. **Remove a server/IP from a load balancer:** `loadbalancer, err := api.DeleteLoadBalancerServerIp(lb_id, ip_id)` **List rules of a load balancer:** `lb_rules, err := api.ListLoadBalancerRules(lb_id)` **Retrieve information about a rule of a load balancer:** `lb_rule, err := api.GetLoadBalancerRule(lb_id, rule_id)` **Adds new rules to a load balancer:** ``` lb_rules := []oneandone.LoadBalancerRule { { Protocol: protocol1, PortBalancer: lb_port1, PortServer: server_port1, Source: source_ip, }, { Protocol: protocol2, PortBalancer: lb_port2, PortServer: server_port2, }, } loadbalancer, err := api.AddLoadBalancerRules(lb_id, lb_rules) ``` **Remove a rule from a load balancer:** `loadbalancer, err := api.DeleteLoadBalancerRule(lb_id, rule_id)` ### Public IPs **Retrieve a list of your public IPs:** `public_ips, err := api.ListPublicIps()` Alternatively, use the method with query parameters. `public_ips, err := api.ListPublicIps(page, per_page, sort, query, fields)` To paginate the list of public IPs received in the response use `page` and `per_page` parameters. Set `per_page` to the number of public IPs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of public IPs sorted in expected order pass a public IP property (e.g. `"ip"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the public IP instances that contain it. To retrieve a collection of public IPs containing only the requested fields pass a list of comma separated properties (e.g. `"id,ip,reverse_dns"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a single public IP:** `public_ip, err := api.GetPublicIp(ip_id)` **Create a public IP:** `ip_id, public_ip, err := api.CreatePublicIp(ip_type, reverse_dns)` Both parameters are optional and may be left blank. `ip_type` may be set to `"IPV4"` or `"IPV6"`. Presently, only IPV4 is supported. **Update the reverse DNS of a public IP:** `public_ip, err := api.UpdatePublicIp(ip_id, reverse_dns)` If an empty string is passed in `reverse_dns,` it removes previous reverse dns of the public IP. **Remove a public IP:** `public_ip, err := api.DeletePublicIp(ip_id)` ### Private Networks **List all private networks:** `private_nets, err := api.ListPrivateNetworks()` Alternatively, use the method with query parameters. `private_nets, err := api.ListPrivateNetworks(page, per_page, sort, query, fields)` To paginate the list of private networks received in the response use `page` and `per_page` parameters. Set `per_page` to the number of private networks that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of private networks sorted in expected order pass a private network property (e.g. `"-creation_date"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the private network instances that contain it. To retrieve a collection of private networks containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,creation_date"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request. **Retrieve information about a private network:** `private_net, err := api.GetPrivateNetwork(pn_id)` **Create a new private network:** ``` request := oneandone.PrivateNetworkRequest { Name: pn_name, Description: pn_description, NetworkAddress: network_address, SubnetMask: subnet_mask, } pnet_id, private_net, err := api.CreatePrivateNetwork(&request) ``` Private network `Name` is required parameter. **Modify a private network:** ``` request := oneandone.PrivateNetworkRequest { Name: new_pn_name, Description: new_pn_description, NetworkAddress: new_network_address, SubnetMask: new_subnet_mask, } private_net, err := api.UpdatePrivateNetwork(pn_id, &request) ``` All parameters in the request are optional. **Delete a private network:** `private_net, err := api.DeletePrivateNetwork(pn_id)` **List all servers attached to a private network:** `servers, err = := api.ListPrivateNetworkServers(pn_id)` **Retrieve a server attached to a private network:** `server, err = := api.GetPrivateNetworkServer(pn_id, server_id)` **Attach servers to a private network:** `private_net, err := api.AttachPrivateNetworkServers(pn_id, server_ids)` `server_ids` is a slice of server ID's. *Note:* Servers cannot be attached to a private network if they currently have a snapshot. **Remove a server from a private network:** `private_net, err := api.DetachPrivateNetworkServer(pn_id, server_id)` *Note:* The server cannot be removed from a private network if it currently has a snapshot or it is powered on. ### VPNs **List all VPNs:** `vpns, err := api.ListVPNs()` Alternatively, use the method with query parameters. `vpns, err := api.ListVPNs(page, per_page, sort, query, fields)` To paginate the list of VPNs received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of VPNs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of VPNs sorted in expected order pass a VPN property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the VPN instances that contain it. To retrieve a collection of VPNs containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,creation_date"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve information about a VPN:** `vpn, err := api.GetVPN(vpn_id)` **Create a VPN:** `vpn, err := api.CreateVPN(vpn_name, vpn_description, datacenter_id)` **Modify a VPN:** `vpn, err := api.ModifyVPN(vpn_id, new_name, new_description)` **Delete a VPN:** `vpn, err := api.DeleteVPN(vpn_id)` **Retrieve a VPN's configuration file:** `base64_encoded_string, err := api.GetVPNConfigFile(vpn_id)` ### Monitoring Center **List all usages and alerts of monitoring servers:** `server_usages, err := api.ListMonitoringServersUsages()` Alternatively, use the method with query parameters. `server_usages, err := api.ListMonitoringServersUsages(page, per_page, sort, query, fields)` To paginate the list of server usages received in the response use `page` and `per_page` parameters. Set `per_page` to the number of server usages that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of server usages sorted in expected order pass a server usage property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the usage instances that contain it. To retrieve a collection of server usages containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,status.state"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request. **Retrieve the usages and alerts for a monitoring server:** `server_usage, err := api.GetMonitoringServerUsage(server_id, period)` `period` may be set to `"LAST_HOUR"`, `"LAST_24H"`, `"LAST_7D"`, `"LAST_30D"`, `"LAST_365D"` or `"CUSTOM"`. If `period` is set to `"CUSTOM"`, the `start_date` and `end_date` parameters are required to be set in **RFC 3339** date/time format (e.g. `2015-13-12T00:01:00Z`). `server_usage, err := api.GetMonitoringServerUsage(server_id, period, start_date, end_date)` ### Monitoring Policies **List all monitoring policies:** `mon_policies, err := api.ListMonitoringPolicies()` Alternatively, use the method with query parameters. `mon_policies, err := api.ListMonitoringPolicies(page, per_page, sort, query, fields)` To paginate the list of monitoring policies received in the response use `page` and `per_page` parameters. Set `per_page` to the number of monitoring policies that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of monitoring policies sorted in expected order pass a monitoring policy property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the monitoring policy instances that contain it. To retrieve a collection of monitoring policies containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,creation_date"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a single monitoring policy:** `mon_policy, err := api.GetMonitoringPolicy(mp_id)` **Create a monitoring policy:** ``` request := oneandone.MonitoringPolicy { Name: mp_name, Description: mp_desc, Email: mp_mail, Agent: true_or_false, Thresholds: &oneandone.MonitoringThreshold { Cpu: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, }, Ram: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, }, Disk: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, }, Transfer: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, }, InternalPing: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: threshold_value, Alert: true_or_false, }, }, }, Ports: []oneandone.MonitoringPort { { Protocol: protocol, Port: port, AlertIf: responding_or_not_responding, EmailNotification: true_or_false, }, }, Processes: []oneandone.MonitoringProcess { { Process: process_name, AlertIf: running_or_not_running, EmailNotification: true_or_false, }, }, } mpolicy_id, mon_policy, err := api.CreateMonitoringPolicy(&request) ``` All fields, except `Description`, are required. `AlertIf` property accepts values `"RESPONDING"`/`"NOT_RESPONDING"` for ports, and `"RUNNING"`/`"NOT_RUNNING"` for processes. **Update a monitoring policy:** ``` request := oneandone.MonitoringPolicy { Name: new_mp_name, Description: new_mp_desc, Email: new_mp_mail, Thresholds: &oneandone.MonitoringThreshold { Cpu: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, }, Ram: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, }, Disk: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, }, Transfer: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, }, InternalPing: &oneandone.MonitoringLevel { Warning: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, Critical: &oneandone.MonitoringValue { Value: new_threshold_value, Alert: true_or_false, }, }, }, } mon_policy, err := api.UpdateMonitoringPolicy(mp_id, &request) ``` All fields of the request are optional. When a threshold is specified in the request, the threshold fields are required. **Delete a monitoring policy:** `mon_policy, err := api.DeleteMonitoringPolicy(mp_id)` **List all ports of a monitoring policy:** `mp_ports, err := api.ListMonitoringPolicyPorts(mp_id)` **Retrieve information about a port of a monitoring policy:** `mp_port, err := api.GetMonitoringPolicyPort(mp_id, port_id)` **Add new ports to a monitoring policy:** ``` mp_ports := []oneandone.MonitoringPort { { Protocol: protocol1, Port: port1, AlertIf: responding_or_not_responding, EmailNotification: true_or_false, }, { Protocol: protocol2, Port: port2, AlertIf: responding_or_not_responding, EmailNotification: true_or_false, }, } mon_policy, err := api.AddMonitoringPolicyPorts(mp_id, mp_ports) ``` Port properties are mandatory. **Modify a port of a monitoring policy:** ``` mp_port := oneandone.MonitoringPort { Protocol: protocol, Port: port, AlertIf: responding_or_not_responding, EmailNotification: true_or_false, } mon_policy, err := api.ModifyMonitoringPolicyPort(mp_id, port_id, &mp_port) ``` *Note:* `Protocol` and `Port` cannot be changed. **Remove a port from a monitoring policy:** `mon_policy, err := api.DeleteMonitoringPolicyPort(mp_id, port_id)` **List the processes of a monitoring policy:** `mp_processes, err := api.ListMonitoringPolicyProcesses(mp_id)` **Retrieve information about a process of a monitoring policy:** `mp_process, err := api.GetMonitoringPolicyProcess(mp_id, process_id)` **Add new processes to a monitoring policy:** ``` processes := []oneandone.MonitoringProcess { { Process: process_name1, AlertIf: running_or_not_running, EmailNotification: true_or_false, }, { Process: process_name2, AlertIf: running_or_not_running, EmailNotification: true_or_false, }, } mon_policy, err := api.AddMonitoringPolicyProcesses(mp_id, processes) ``` All properties of the `MonitoringProcess` instance are required. **Modify a process of a monitoring policy:** ``` process := oneandone.MonitoringProcess { Process: process_name, AlertIf: running_or_not_running, EmailNotification: true_or_false, } mon_policy, err := api.ModifyMonitoringPolicyProcess(mp_id, process_id, &process) ``` *Note:* Process name cannot be changed. **Remove a process from a monitoring policy:** `mon_policy, err := api.DeleteMonitoringPolicyProcess(mp_id, process_id)` **List all servers attached to a monitoring policy:** `mp_servers, err := api.ListMonitoringPolicyServers(mp_id)` **Retrieve information about a server attached to a monitoring policy:** `mp_server, err := api.GetMonitoringPolicyServer(mp_id, server_id)` **Attach servers to a monitoring policy:** `mon_policy, err := api.AttachMonitoringPolicyServers(mp_id, server_ids)` `server_ids` is a slice of server ID's. **Remove a server from a monitoring policy:** `mon_policy, err := api.RemoveMonitoringPolicyServer(mp_id, server_id)` ### Logs **List all logs:** `logs, err := api.ListLogs(period, nil, nil)` `period` can be set to `"LAST_HOUR"`, `"LAST_24H"`, `"LAST_7D"`, `"LAST_30D"`, `"LAST_365D"` or `"CUSTOM"`. If `period` is set to `"CUSTOM"`, the `start_date` and `end_date` parameters are required to be set in **RFC 3339** date/time format (e.g. `2015-13-12T00:01:00Z`). `logs, err := api.ListLogs(period, start_date, end_date)` Additional query parameters can be used. `logs, err := api.ListLogs(period, start_date, end_date, page, per_page, sort, query, fields)` To paginate the list of logs received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of logs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of logs sorted in expected order pass a logs property (e.g. `"action"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the logs instances that contain it. To retrieve a collection of logs containing only the requested fields pass a list of comma separated properties (e.g. `"id,action,type"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve a single log:** `log, err := api.GetLog(log_id)` ### Users **List all users:** `users, err := api.ListUsers()` Alternatively, use the method with query parameters. `users, err := api.ListUsers(page, per_page, sort, query, fields)` To paginate the list of users received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of users that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of users sorted in expected order pass a user property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the user instances that contain it. To retrieve a collection of users containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,creation_date,email"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve information about a user:** `user, err := api.GetUser(user_id)` **Create a user:** ``` request := oneandone.UserRequest { Name: username, Description: user_description, Password: password, Email: user_email, } user_id, user, err := api.CreateUser(&request) ``` `Name` and `Password` are required parameters. The password must contain at least 8 characters using uppercase letters, numbers and other special symbols. **Modify a user:** ``` request := oneandone.UserRequest { Description: new_desc, Email: new_mail, Password: new_pass, State: state, } user, err := api.ModifyUser(user_id, &request) ``` All listed fields in the request are optional. `State` can be set to `"ACTIVE"` or `"DISABLED"`. **Delete a user:** `user, err := api.DeleteUser(user_id)` **Retrieve information about a user's API privileges:** `api_info, err := api.GetUserApi(user_id)` **Retrieve a user's API key:** `api_key, err := api.GetUserApiKey(user_id)` **List IP's from which API access is allowed for a user:** `allowed_ips, err := api.ListUserApiAllowedIps(user_id)` **Add new IP's to a user:** ``` user_ips := []string{ my_public_ip, "192.168.7.77", "10.81.12.101" } user, err := api.AddUserApiAlowedIps(user_id, user_ips) ``` **Remove an IP and forbid API access from it:** `user, err := api.RemoveUserApiAllowedIp(user_id, ip)` **Modify a user's API privileges:** `user, err := api.ModifyUserApi(user_id, is_active)` **Renew a user's API key:** `user, err := api.RenewUserApiKey(user_id)` **Retrieve current user permissions:** `permissions, err := api.GetCurrentUserPermissions()` ### Roles **List all roles:** `roles, err := api.ListRoles()` Alternatively, use the method with query parameters. `roles, err := api.ListRoles(page, per_page, sort, query, fields)` To paginate the list of roles received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of roles that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of roles sorted in expected order pass a role property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the role instances that contain it. To retrieve a collection of roles containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,creation_date"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. **Retrieve information about a role:** `role, err := api.GetRole(role_id)` **Create a role:** `role, err := api.CreateRole(role_name)` **Clone a role:** `role, err := api.CloneRole(role_id, new_role_name)` **Modify a role:** `role, err := api.ModifyRole(role_id, new_name, new_description, new_state)` `ACTIVE` and `DISABLE` are valid values for the state. **Delete a role:** `role, err := api.DeleteRole(role_id)` **Retrieve information about a role's permissions:** `permissions, err := api.GetRolePermissions(role_id)` **Modify a role's permissions:** `role, err := api.ModifyRolePermissions(role_id, permissions)` **Assign users to a role:** `role, err := api.AssignRoleUsers(role_id, user_ids)` `user_ids` is a slice of user ID's. **List a role's users:** `users, err := api.ListRoleUsers(role_id)` **Retrieve information about a role's user:** `user, err := api.GetRoleUser(role_id, user_id)` **Remove a role's user:** `role, err := api.RemoveRoleUser(role_id, user_id)` ### Usages **List your usages:** `usages, err := api.ListUsages(period, nil, nil)` `period` can be set to `"LAST_HOUR"`, `"LAST_24H"`, `"LAST_7D"`, `"LAST_30D"`, `"LAST_365D"` or `"CUSTOM"`. If `period` is set to `"CUSTOM"`, the `start_date` and `end_date` parameters are required to be set in **RFC 3339** date/time format (e.g. `2015-13-12T00:01:00Z`). `usages, err := api.ListUsages(period, start_date, end_date)` Additional query parameters can be used. `usages, err := api.ListUsages(period, start_date, end_date, page, per_page, sort, query, fields)` To paginate the list of usages received in the response use `page` and `per_page` parameters. Set ` per_page` to the number of usages that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of usages sorted in expected order pass a usages property (e.g. `"name"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the usages instances that contain it. To retrieve a collection of usages containing only the requested fields pass a list of comma separated properties (e.g. `"id,name"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is set to an empty string, it is ignored in the request. ### Server Appliances **List all the appliances that you can use to create a server:** `server_appliances, err := api.ListServerAppliances()` Alternatively, use the method with query parameters. `server_appliances, err := api.ListServerAppliances(page, per_page, sort, query, fields)` To paginate the list of server appliances received in the response use `page` and `per_page` parameters. Set `per_page` to the number of server appliances that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of server appliances sorted in expected order pass a server appliance property (e.g. `"os"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the server appliance instances that contain it. To retrieve a collection of server appliances containing only the requested fields pass a list of comma separated properties (e.g. `"id,os,architecture"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request. **Retrieve information about specific appliance:** `server_appliance, err := api.GetServerAppliance(appliance_id)` ### DVD ISO **List all operative systems and tools that you can load into your virtual DVD unit:** `dvd_isos, err := api.ListDvdIsos()` Alternatively, use the method with query parameters. `dvd_isos, err := api.ListDvdIsos(page, per_page, sort, query, fields)` To paginate the list of ISO DVDs received in the response use `page` and `per_page` parameters. Set `per_page` to the number of ISO DVDs that will be shown in each page. `page` indicates the current page. When set to an integer value that is less or equal to zero, the parameters are ignored by the framework. To receive the list of ISO DVDs sorted in expected order pass a ISO DVD property (e.g. `"type"`) in `sort` parameter. Prefix the sorting attribute with `-` sign for sorting in descending order. Use `query` parameter to search for a string in the response and return only the ISO DVD instances that contain it. To retrieve a collection of ISO DVDs containing only the requested fields pass a list of comma separated properties (e.g. `"id,name,type"`) in `fields` parameter. If any of the parameters `sort`, `query` or `fields` is blank, it is ignored in the request. **Retrieve a specific ISO image:** `dvd_iso, err := api.GetDvdIso(dvd_id)` ### Ping **Check if 1&amp;1 REST API is running:** `response, err := api.Ping()` If the API is running, the response is a single-element slice `["PONG"]`. **Validate if 1&amp;1 REST API is running and the authorization token is valid:** `response, err := api.PingAuth()` The response should be a single-element slice `["PONG"]` if the API is running and the token is valid. ### Pricing **Show prices for all available resources in the Cloud Panel:** `pricing, err := api.GetPricing()` ### Data Centers **List all 1&amp;1 Cloud Server data centers:** `datacenters, err := api.ListDatacenters()` Here is another example of an alternative form of the list function that includes query parameters. `datacenters, err := api.ListDatacenters(0, 0, "country_code", "DE", "id,country_code")` **Retrieve a specific data center:** `datacenter, err := api.GetDatacenter(datacenter_id)` ## Examples ```Go package main import ( "fmt" "github.com/1and1/oneandone-cloudserver-sdk-go" "time" ) func main() { //Set an authentication token token := oneandone.SetToken("82ee732b8d47e451be5c6ad5b7b56c81") //Create an API client api := oneandone.New(token, oneandone.BaseUrl) // List server appliances saps, err := api.ListServerAppliances() var sa oneandone.ServerAppliance for _, a := range saps { if a.Type == "IMAGE" { sa = a } } // Create a server req := oneandone.ServerRequest{ Name: "Example Server", Description: "Example server description.", ApplianceId: sa.Id, PowerOn: true, Hardware: oneandone.Hardware{ Vcores: 1, CoresPerProcessor: 1, Ram: 2, Hdds: []oneandone.Hdd { oneandone.Hdd { Size: sa.MinHddSize, IsMain: true, }, }, }, } server_id, server, err := api.CreateServer(&req) if err == nil { // Wait until server is created and powered on for at most 60 x 10 seconds err = api.WaitForState(server, "POWERED_ON", 10, 60) } // Get the server server, err = api.GetServer(server_id) // Create a load balancer lbr := oneandone.LoadBalancerRequest { Name: "Load Balancer Example", Description: "API created load balancer.", Method: "ROUND_ROBIN", Persistence: oneandone.Bool2Pointer(true), PersistenceTime: oneandone.Int2Pointer(1200), HealthCheckTest: "TCP", HealthCheckInterval: oneandone.Int2Pointer(40), Rules: []oneandone.LoadBalancerRule { { Protocol: "TCP", PortBalancer: 80, PortServer: 80, Source: "0.0.0.0", }, }, } var lb *oneandone.LoadBalancer var lb_id string lb_id, lb, err = api.CreateLoadBalancer(&lbr) if err != nil { api.WaitForState(lb, "ACTIVE", 10, 30) } // Get the load balancer lb, err = api.GetLoadBalancer(lb.Id) // Assign the load balancer to server's IP server, err = api.AssignServerIpLoadBalancer(server.Id, server.Ips[0].Id, lb_id) // Create a firewall policy fpr := oneandone.FirewallPolicyRequest{ Name: "Firewall Policy Example", Description: "API created firewall policy.", Rules: []oneandone.FirewallPolicyRule { { Protocol: "TCP", PortFrom: oneandone.Int2Pointer(80), PortTo: oneandone.Int2Pointer(80), }, }, } var fp *oneandone.FirewallPolicy fp_id, fp, err = api.CreateFirewallPolicy(&fpr) if err == nil { api.WaitForState(fp, "ACTIVE", 10, 30) } // Get the firewall policy fp, err = api.GetFirewallPolicy(fp_id) // Add servers IPs to the firewall policy. ips := []string{ server.Ips[0].Id } fp, err = api.AddFirewallPolicyServerIps(fp.Id, ips) if err == nil { api.WaitForState(fp, "ACTIVE", 10, 60) } //Shutdown the server using 'SOFTWARE' method server, err = api.ShutdownServer(server.Id, false) if err != nil { err = api.WaitForState(server, "POWERED_OFF", 5, 20) } // Delete the load balancer lb, err = api.DeleteLoadBalancer(lb.Id) if err != nil { err = api.WaitUntilDeleted(lb) } // Delete the firewall policy fp, err = api.DeleteFirewallPolicy(fp.Id) if err != nil { err = api.WaitUntilDeleted(fp) } // List usages in last 24h var usages *oneandone.Usages usages, err = api.ListUsages("LAST_24H", nil, nil) fmt.Println(usages.Servers) // List usages in last 5 hours n := time.Now() ed := time.Date(n.Year(), n.Month(), n.Day(), n.Hour(), n.Minute(), n.Second(), 0, time.UTC) sd := ed.Add(-(time.Hour * 5)) usages, err = api.ListUsages("CUSTOM", &sd, &ed) //Create a shared storage ssr := oneandone.SharedStorageRequest { Name: "Shared Storage Example", Description: "API alocated 100 GB disk.", Size: oneandone.Int2Pointer(100), } var ss *oneandone.SharedStorage var ss_id string ss_id, ss, err = api.CreateSharedStorage(&ssr) if err != nil { api.WaitForState(ss, "ACTIVE", 10, 30) } // List shared storages on page 1, 5 results per page and sort by 'name' field. // Include only 'name', 'size' and 'minimum_size_allowed' fields in the result. var shs []oneandone.SharedStorage shs, err = api.ListSharedStorages(1, 5, "name", "", "name,size,minimum_size_allowed") // List all shared storages that contain 'example' string shs, err = api.ListSharedStorages(0, 0, "", "example", "") // Delete the shared storage ss, err = api.DeleteSharedStorage(ss_id) if err == nil { err = api.WaitUntilDeleted(ss) } // Delete the server server, err = api.DeleteServer(server.Id, false) if err == nil { err = api.WaitUntilDeleted(server) } } ``` The next example illustrates how to create a `TYPO3` application server of a fixed size with an initial password and a firewall policy that has just been created. ```Go package main import "github.com/1and1/oneandone-cloudserver-sdk-go" func main() { token := oneandone.SetToken("bde36026df9d548f699ea97e75a7e87f") client := oneandone.New(token, oneandone.BaseUrl) // Create a new firewall policy fpr := oneandone.FirewallPolicyRequest{ Name: "HTTPS Traffic Policy", Rules: []oneandone.FirewallPolicyRule{ { Protocol: "TCP", PortFrom: oneandone.Int2Pointer(443), PortTo: oneandone.Int2Pointer(443), }, }, } _, fp, err := client.CreateFirewallPolicy(&fpr) if fp != nil && err == nil { client.WaitForState(fp, "ACTIVE", 5, 60) // Look for the TYPO3 application appliance saps, _ := client.ListServerAppliances(0, 0, "", "typo3", "") var sa oneandone.ServerAppliance for _, a := range saps { if a.Type == "APPLICATION" { sa = a break } } var fixed_flavours []oneandone.FixedInstanceInfo var fixed_size_id string fixed_flavours, err = client.ListFixedInstanceSizes() for _, fl := range fixed_flavours { //look for 'M' size if fl.Name == "M" { fixed_size_id = fl.Id break } } req := oneandone.ServerRequest{ Name: "TYPO3 Server", ApplianceId: sa.Id, PowerOn: true, Password: "ucr_kXW8,.2SdMU", Hardware: oneandone.Hardware{ FixedInsSizeId: fixed_size_id, }, FirewallPolicyId: fp.Id, } _, server, _ := client.CreateServer(&req) if server != nil { client.WaitForState(server, "POWERED_ON", 10, 90) } } } ``` ## Index ```Go func New(token string, url string) *API ``` ```Go func (api *API) AddFirewallPolicyRules(fp_id string, fp_rules []FirewallPolicyRule) (*FirewallPolicy, error) ``` ```Go func (api *API) AddFirewallPolicyServerIps(fp_id string, ip_ids []string) (*FirewallPolicy, error) ``` ```Go func (api *API) AddLoadBalancerRules(lb_id string, lb_rules []LoadBalancerRule) (*LoadBalancer, error) ``` ```Go func (api *API) AddLoadBalancerServerIps(lb_id string, ip_ids []string) (*LoadBalancer, error) ``` ```Go func (api *API) AddMonitoringPolicyPorts(mp_id string, mp_ports []MonitoringPort) (*MonitoringPolicy, error) ``` ```Go func (api *API) AddMonitoringPolicyProcesses(mp_id string, mp_procs []MonitoringProcess) (*MonitoringPolicy, error) ``` ```Go func (api *API) AddServerHdds(server_id string, hdds *ServerHdds) (*Server, error) ``` ```Go func (api *API) AddSharedStorageServers(st_id string, servers []SharedStorageServer) (*SharedStorage, error) ``` ```Go func (api *API) AddUserApiAlowedIps(user_id string, ips []string) (*User, error) ``` ```Go func (api *API) AssignRoleUsers(role_id string, user_ids []string) (*Role, error) ``` ```Go func (api *API) AssignServerIp(server_id string, ip_type string) (*Server, error) ``` ```Go func (api *API) AssignServerIpFirewallPolicy(server_id string, ip_id string, fp_id string) (*Server, error) ``` ```Go func (api *API) AssignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error) ``` ```Go func (api *API) AssignServerPrivateNetwork(server_id string, pn_id string) (*Server, error) ``` ```Go func (api *API) AttachMonitoringPolicyServers(mp_id string, sids []string) (*MonitoringPolicy, error) ``` ```Go func (api *API) AttachPrivateNetworkServers(pn_id string, sids []string) (*PrivateNetwork, error) ``` ```Go func (api *API) CloneRole(role_id string, name string) (*Role, error) ``` ```Go func (api *API) CloneServer(server_id string, new_name string, datacenter_id string) (*Server, error) ``` ```Go func (api *API) CreateFirewallPolicy(fp_data *FirewallPolicyRequest) (string, *FirewallPolicy, error) ``` ```Go func (api *API) CreateImage(request *ImageConfig) (string, *Image, error) ``` ```Go func (api *API) CreateLoadBalancer(request *LoadBalancerRequest) (string, *LoadBalancer, error) ``` ```Go func (api *API) CreateMonitoringPolicy(mp *MonitoringPolicy) (string, *MonitoringPolicy, error) ``` ```Go func (api *API) CreatePrivateNetwork(request *PrivateNetworkRequest) (string, *PrivateNetwork, error) ``` ```Go func (api *API) CreatePublicIp(ip_type string, reverse_dns string, datacenter_id string) (string, *PublicIp, error) ``` ```Go func (api *API) CreateRole(name string) (string, *Role, error) ``` ```Go func (api *API) CreateServer(request *ServerRequest) (string, *Server, error) ``` ```Go func (api *API) CreateServerEx(request *ServerRequest, timeout int) (string, string, error) ``` ```Go func (api *API) CreateServerSnapshot(server_id string) (*Server, error) ``` ```Go func (api *API) CreateSharedStorage(request *SharedStorageRequest) (string, *SharedStorage, error) ``` ```Go func (api *API) CreateUser(user *UserRequest) (string, *User, error) ``` ```Go func (api *API) CreateVPN(name string, description string, datacenter_id string) (string, *VPN, error) ``` ```Go func (api *API) DeleteFirewallPolicy(fp_id string) (*FirewallPolicy, error) ``` ```Go func (api *API) DeleteFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicy, error) ``` ```Go func (api *API) DeleteFirewallPolicyServerIp(fp_id string, ip_id string) (*FirewallPolicy, error) ``` ```Go func (api *API) DeleteImage(img_id string) (*Image, error) ``` ```Go func (api *API) DeleteLoadBalancer(lb_id string) (*LoadBalancer, error) ``` ```Go func (api *API) DeleteLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancer, error) ``` ```Go func (api *API) DeleteLoadBalancerServerIp(lb_id string, ip_id string) (*LoadBalancer, error) ``` ```Go func (api *API) DeleteMonitoringPolicy(mp_id string) (*MonitoringPolicy, error) ``` ```Go func (api *API) DeleteMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPolicy, error) ``` ```Go func (api *API) DeleteMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringPolicy, error) ``` ```Go func (api *API) DeletePrivateNetwork(pn_id string) (*PrivateNetwork, error) ``` ```Go func (api *API) DeletePublicIp(ip_id string) (*PublicIp, error) ``` ```Go func (api *API) DeleteRole(role_id string) (*Role, error) ``` ```Go func (api *API) DeleteServer(server_id string, keep_ips bool) (*Server, error) ``` ```Go func (api *API) DeleteServerHdd(server_id string, hdd_id string) (*Server, error) ``` ```Go func (api *API) DeleteServerIp(server_id string, ip_id string, keep_ip bool) (*Server, error) ``` ```Go func (api *API) DeleteServerSnapshot(server_id string, snapshot_id string) (*Server, error) ``` ```Go func (api *API) DeleteSharedStorage(ss_id string) (*SharedStorage, error) ``` ```Go func (api *API) DeleteSharedStorageServer(st_id string, ser_id string) (*SharedStorage, error) ``` ```Go func (api *API) DeleteUser(user_id string) (*User, error) ``` ```Go func (api *API) DeleteVPN(vpn_id string) (*VPN, error) ``` ```Go func (api *API) DetachPrivateNetworkServer(pn_id string, pns_id string) (*PrivateNetwork, error) ``` ```Go func (api *API) EjectServerDvd(server_id string) (*Server, error) ``` ```Go func (api *API) GetCurrentUserPermissions() (*Permissions, error) ``` ```Go func (api *API) GetDatacenter(dc_id string) (*Datacenter, error) ``` ```Go func (api *API) GetDvdIso(dvd_id string) (*DvdIso, error) ``` ```Go func (api *API) GetFirewallPolicy(fp_id string) (*FirewallPolicy, error) ``` ```Go func (api *API) GetFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicyRule, error) ``` ```Go func (api *API) GetFirewallPolicyServerIp(fp_id string, ip_id string) (*ServerIpInfo, error) ``` ```Go func (api *API) GetFixedInstanceSize(fis_id string) (*FixedInstanceInfo, error) ``` ```Go func (api *API) GetImage(img_id string) (*Image, error) ``` ```Go func (api *API) GetLoadBalancer(lb_id string) (*LoadBalancer, error) ``` ```Go func (api *API) GetLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancerRule, error) ``` ```Go func (api *API) GetLoadBalancerServerIp(lb_id string, ip_id string) (*ServerIpInfo, error) ``` ```Go func (api *API) GetLog(log_id string) (*Log, error) ``` ```Go func (api *API) GetMonitoringPolicy(mp_id string) (*MonitoringPolicy, error) ``` ```Go func (api *API) GetMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPort, error) ``` ```Go func (api *API) GetMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringProcess, error) ``` ```Go func (api *API) GetMonitoringPolicyServer(mp_id string, ser_id string) (*Identity, error) ``` ```Go func (api *API) GetMonitoringServerUsage(ser_id string, period string, dates ...time.Time) (*MonServerUsageDetails, error) ``` ```Go func (api *API) GetPricing() (*Pricing, error) ``` ```Go func (api *API) GetPrivateNetwork(pn_id string) (*PrivateNetwork, error) ``` ```Go func (api *API) GetPrivateNetworkServer(pn_id string, server_id string) (*Identity, error) ``` ```Go func (api *API) GetPublicIp(ip_id string) (*PublicIp, error) ``` ```Go func (api *API) GetRole(role_id string) (*Role, error) ``` ```Go func (api *API) GetRolePermissions(role_id string) (*Permissions, error) ``` ```Go func (api *API) GetRoleUser(role_id string, user_id string) (*Identity, error) ``` ```Go func (api *API) GetServer(server_id string) (*Server, error) ``` ```Go func (api *API) GetServerAppliance(sa_id string) (*ServerAppliance, error) ``` ```Go func (api *API) GetServerDvd(server_id string) (*Identity, error) ``` ```Go func (api *API) GetServerHardware(server_id string) (*Hardware, error) ``` ```Go func (api *API) GetServerHdd(server_id string, hdd_id string) (*Hdd, error) ``` ```Go func (api *API) GetServerImage(server_id string) (*Identity, error) ``` ```Go func (api *API) GetServerIp(server_id string, ip_id string) (*ServerIp, error) ``` ```Go func (api *API) GetServerIpFirewallPolicy(server_id string, ip_id string) (*Identity, error) ``` ```Go func (api *API) GetServerPrivateNetwork(server_id string, pn_id string) (*PrivateNetwork, error) ``` ```Go func (api *API) GetServerSnapshot(server_id string) (*ServerSnapshot, error) ``` ```Go func (api *API) GetServerStatus(server_id string) (*Status, error) ``` ```Go func (api *API) GetSharedStorage(ss_id string) (*SharedStorage, error) ``` ```Go func (api *API) GetSharedStorageCredentials() ([]SharedStorageAccess, error) ``` ```Go func (api *API) GetSharedStorageServer(st_id string, ser_id string) (*SharedStorageServer, error) ``` ```Go func (api *API) GetUser(user_id string) (*User, error) ``` ```Go func (api *API) GetUserApi(user_id string) (*UserApi, error) ``` ```Go func (api *API) GetUserApiKey(user_id string) (*UserApiKey, error) ``` ```Go func (api *API) GetVPN(vpn_id string) (*VPN, error) ``` ```Go func (api *API) GetVPNConfigFile(vpn_id string) (string, error) ``` ```Go func (api *API) ListDatacenters(args ...interface{}) ([]Datacenter, error) ``` ```Go func (api *API) ListDvdIsos(args ...interface{}) ([]DvdIso, error) ``` ```Go func (api *API) ListFirewallPolicies(args ...interface{}) ([]FirewallPolicy, error) ``` ```Go func (api *API) ListFirewallPolicyRules(fp_id string) ([]FirewallPolicyRule, error) ``` ```Go func (api *API) ListFirewallPolicyServerIps(fp_id string) ([]ServerIpInfo, error) ``` ```Go func (api *API) ListFixedInstanceSizes() ([]FixedInstanceInfo, error) ``` ```Go func (api *API) ListImages(args ...interface{}) ([]Image, error) ``` ```Go func (api *API) ListLoadBalancerRules(lb_id string) ([]LoadBalancerRule, error) ``` ```Go func (api *API) ListLoadBalancerServerIps(lb_id string) ([]ServerIpInfo, error) ``` ```Go func (api *API) ListLoadBalancers(args ...interface{}) ([]LoadBalancer, error) ``` ```Go func (api *API) ListLogs(period string, sd *time.Time, ed *time.Time, args ...interface{}) ([]Log, error) ``` ```Go func (api *API) ListMonitoringPolicies(args ...interface{}) ([]MonitoringPolicy, error) ``` ```Go func (api *API) ListMonitoringPolicyPorts(mp_id string) ([]MonitoringPort, error) ``` ```Go func (api *API) ListMonitoringPolicyProcesses(mp_id string) ([]MonitoringProcess, error) ``` ```Go func (api *API) ListMonitoringPolicyServers(mp_id string) ([]Identity, error) ``` ```Go func (api *API) ListMonitoringServersUsages(args ...interface{}) ([]MonServerUsageSummary, error) ``` ```Go func (api *API) ListPrivateNetworkServers(pn_id string) ([]Identity, error) ``` ```Go func (api *API) ListPrivateNetworks(args ...interface{}) ([]PrivateNetwork, error) ``` ```Go func (api *API) ListPublicIps(args ...interface{}) ([]PublicIp, error) ``` ```Go func (api *API) ListRoleUsers(role_id string) ([]Identity, error) ``` ```Go func (api *API) ListRoles(args ...interface{}) ([]Role, error) ``` ```Go func (api *API) ListServerAppliances(args ...interface{}) ([]ServerAppliance, error) ``` ```Go func (api *API) ListServerHdds(server_id string) ([]Hdd, error) ``` ```Go func (api *API) ListServerIpLoadBalancers(server_id string, ip_id string) ([]Identity, error) ``` ```Go func (api *API) ListServerIps(server_id string) ([]ServerIp, error) ``` ```Go func (api *API) ListServerPrivateNetworks(server_id string) ([]Identity, error) ``` ```Go func (api *API) ListServers(args ...interface{}) ([]Server, error) ``` ```Go func (api *API) ListSharedStorageServers(st_id string) ([]SharedStorageServer, error) ``` ```Go func (api *API) ListSharedStorages(args ...interface{}) ([]SharedStorage, error) ``` ```Go func (api *API) ListUsages(period string, sd *time.Time, ed *time.Time, args ...interface{}) (*Usages, error) ``` ```Go func (api *API) ListUserApiAllowedIps(user_id string) ([]string, error) ``` ```Go func (api *API) ListUsers(args ...interface{}) ([]User, error) ``` ```Go func (api *API) ListVPNs(args ...interface{}) ([]VPN, error) ``` ```Go func (api *API) LoadServerDvd(server_id string, dvd_id string) (*Server, error) ``` ```Go func (api *API) ModifyMonitoringPolicyPort(mp_id string, port_id string, mp_port *MonitoringPort) (*MonitoringPolicy, error) ``` ```Go func (api *API) ModifyMonitoringPolicyProcess(mp_id string, proc_id string, mp_proc *MonitoringProcess) (*MonitoringPolicy, error) ``` ```Go func (api *API) ModifyRole(role_id string, name string, description string, state string) (*Role, error) ``` ```Go func (api *API) ModifyRolePermissions(role_id string, perm *Permissions) (*Role, error) ``` ```Go func (api *API) ModifyUser(user_id string, user *UserRequest) (*User, error) ``` ```Go func (api *API) ModifyUserApi(user_id string, active bool) (*User, error) ``` ```Go func (api *API) ModifyVPN(vpn_id string, name string, description string) (*VPN, error) ``` ```Go func (api *API) Ping() ([]string, error) ``` ```Go func (api *API) PingAuth() ([]string, error) ``` ```Go func (api *API) RebootServer(server_id string, is_hardware bool) (*Server, error) ``` ```Go func (api *API) ReinstallServerImage(server_id string, image_id string, password string, fp_id string) (*Server, error) ``` ```Go func (api *API) RemoveMonitoringPolicyServer(mp_id string, ser_id string) (*MonitoringPolicy, error) ``` ```Go func (api *API) RemoveRoleUser(role_id string, user_id string) (*Role, error) ``` ```Go func (api *API) RemoveServerPrivateNetwork(server_id string, pn_id string) (*Server, error) ``` ```Go func (api *API) RemoveUserApiAllowedIp(user_id string, ip string) (*User, error) ``` ```Go func (api *API) RenameServer(server_id string, new_name string, new_desc string) (*Server, error) ``` ```Go func (api *API) RenewUserApiKey(user_id string) (*User, error) ``` ```Go func (api *API) ResizeServerHdd(server_id string, hdd_id string, new_size int) (*Server, error) ``` ```Go func (api *API) RestoreServerSnapshot(server_id string, snapshot_id string) (*Server, error) ``` ```Go func (api *API) ShutdownServer(server_id string, is_hardware bool) (*Server, error) ``` ```Go func (api *API) StartServer(server_id string) (*Server, error) ``` ```Go func (api *API) UnassignServerIpFirewallPolicy(server_id string, ip_id string) (*Server, error) ``` ```Go func (api *API) UnassignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error) ``` ```Go func (api *API) UpdateFirewallPolicy(fp_id string, fp_new_name string, fp_new_desc string) (*FirewallPolicy, error) ``` ```Go func (api *API) UpdateImage(img_id string, new_name string, new_desc string, new_freq string) (*Image, error) ``` ```Go func (api *API) UpdateLoadBalancer(lb_id string, request *LoadBalancerRequest) (*LoadBalancer, error) ``` ```Go func (api *API) UpdateMonitoringPolicy(mp_id string, mp *MonitoringPolicy) (*MonitoringPolicy, error) ``` ```Go func (api *API) UpdatePrivateNetwork(pn_id string, request *PrivateNetworkRequest) (*PrivateNetwork, error) ``` ```Go func (api *API) UpdatePublicIp(ip_id string, reverse_dns string) (*PublicIp, error) ``` ```Go func (api *API) UpdateServerHardware(server_id string, hardware *Hardware) (*Server, error) ``` ```Go func (api *API) UpdateSharedStorage(ss_id string, request *SharedStorageRequest) (*SharedStorage, error) ``` ```Go func (api *API) UpdateSharedStorageCredentials(new_pass string) ([]SharedStorageAccess, error) ``` ```Go func (api *API) WaitForState(in ApiInstance, state string, sec time.Duration, count int) error ``` ```Go func (api *API) WaitUntilDeleted(in ApiInstance) error ``` ```Go func (fp *FirewallPolicy) GetState() (string, error) ``` ```Go func (im *Image) GetState() (string, error) ``` ```Go func (lb *LoadBalancer) GetState() (string, error) ``` ```Go func (mp *MonitoringPolicy) GetState() (string, error) ``` ```Go func (pn *PrivateNetwork) GetState() (string, error) ``` ```Go func (ip *PublicIp) GetState() (string, error) ``` ```Go func (role *Role) GetState() (string, error) ``` ```Go func (s *Server) GetState() (string, error) ``` ```Go func (ss *SharedStorage) GetState() (string, error) ``` ```Go func (u *User) GetState() (string, error) ``` ```Go func (u *User) GetState() (string, error) ``` ```Go func (vpn *VPN) GetState() (string, error) ``` ```Go func Bool2Pointer(input bool) *bool ``` ```Go func Int2Pointer(input int) *int ``` ```Go func (bp *BackupPerm) SetAll(value bool) ``` ```Go func (fp *FirewallPerm) SetAll(value bool) ``` ```Go func (imp *ImagePerm) SetAll(value bool) ``` ```Go unc (inp *InvoicePerm) SetAll(value bool) ``` ```Go func (ipp *IPPerm) SetAll(value bool) ``` ```Go func (lbp *LoadBalancerPerm) SetAll(value bool) ``` ```Go func (lp *LogPerm) SetAll(value bool) ``` ```Go func (mcp *MonitorCenterPerm) SetAll(value bool) ``` ```Go func (mpp *MonitorPolicyPerm) SetAll(value bool) ``` ```Go func (p *Permissions) SetAll(v bool) ``` ```Go func (pnp *PrivateNetworkPerm) SetAll(value bool) ``` ```Go func (rp *RolePerm) SetAll(value bool) ``` ```Go func (sp *ServerPerm) SetAll(value bool) ``` ```Go func (ssp *SharedStoragePerm) SetAll(value bool) ``` ```Go func (up *UsagePerm) SetAll(value bool) ``` ```Go func (up *UserPerm) SetAll(value bool) ``` ```Go func (vpnp *VPNPerm) SetAll(value bool) ``` ```Go func SetBaseUrl(newbaseurl string) string ``` ```Go func SetToken(newtoken string) string ``` ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/datacenters.go����������������0000664�0000000�0000000�00000001471�13771713062�0030235�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" type Datacenter struct { idField CountryCode string `json:"country_code,omitempty"` Location string `json:"location,omitempty"` } // GET /datacenters func (api *API) ListDatacenters(args ...interface{}) ([]Datacenter, error) { url, err := processQueryParams(createUrl(api, datacenterPathSegment), args...) if err != nil { return nil, err } result := []Datacenter{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // GET /datacenters/{datacenter_id} func (api *API) GetDatacenter(dc_id string) (*Datacenter, error) { result := new(Datacenter) url := createUrl(api, datacenterPathSegment, dc_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/dvdisos.go��������������������0000664�0000000�0000000�00000002453�13771713062�0027414�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" // Struct to describe a ISO image that can be used to boot a server. // // Values of this type describe ISO images that can be inserted into the servers virtual DVD drive. // // type DvdIso struct { Identity OsFamily string `json:"os_family,omitempty"` Os string `json:"os,omitempty"` OsVersion string `json:"os_version,omitempty"` Type string `json:"type,omitempty"` AvailableDatacenters []string `json:"available_datacenters,omitempty"` Architecture interface{} `json:"os_architecture,omitempty"` ApiPtr } // GET /dvd_isos func (api *API) ListDvdIsos(args ...interface{}) ([]DvdIso, error) { url, err := processQueryParams(createUrl(api, dvdIsoPathSegment), args...) if err != nil { return nil, err } result := []DvdIso{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // GET /dvd_isos/{id} func (api *API) GetDvdIso(dvd_id string) (*DvdIso, error) { result := new(DvdIso) url := createUrl(api, dvdIsoPathSegment, dvd_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/errors.go���������������������0000664�0000000�0000000�00000000665�13771713062�0027260�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "fmt" ) type errorResponse struct { Type string `json:"type"` Message string `json:"message"` } type apiError struct { httpStatusCode int message string } func (e apiError) Error() string { return fmt.Sprintf("%d - %s", e.httpStatusCode, e.message) } func (e *apiError) HttpStatusCode() int { return e.httpStatusCode } func (e *apiError) Message() string { return e.message } ���������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/firewallpolicies.go�����������0000664�0000000�0000000�00000013775�13771713062�0031307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" ) type FirewallPolicy struct { Identity descField DefaultPolicy uint8 `json:"default"` CloudpanelId string `json:"cloudpanel_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` Rules []FirewallPolicyRule `json:"rules,omitempty"` ServerIps []ServerIpInfo `json:"server_ips,omitempty"` ApiPtr } type FirewallPolicyRule struct { idField Protocol string `json:"protocol,omitempty"` PortFrom *int `json:"port_from,omitempty"` PortTo *int `json:"port_to,omitempty"` SourceIp string `json:"source,omitempty"` } type FirewallPolicyRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Rules []FirewallPolicyRule `json:"rules,omitempty"` } // GET /firewall_policies func (api *API) ListFirewallPolicies(args ...interface{}) ([]FirewallPolicy, error) { url, err := processQueryParams(createUrl(api, firewallPolicyPathSegment), args...) if err != nil { return nil, err } result := []FirewallPolicy{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /firewall_policies func (api *API) CreateFirewallPolicy(fp_data *FirewallPolicyRequest) (string, *FirewallPolicy, error) { result := new(FirewallPolicy) url := createUrl(api, firewallPolicyPathSegment) err := api.Client.Post(url, &fp_data, &result, http.StatusAccepted) if err != nil { return "", nil, err } result.api = api return result.Id, result, nil } // GET /firewall_policies/{id} func (api *API) GetFirewallPolicy(fp_id string) (*FirewallPolicy, error) { result := new(FirewallPolicy) url := createUrl(api, firewallPolicyPathSegment, fp_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /firewall_policies/{id} func (api *API) DeleteFirewallPolicy(fp_id string) (*FirewallPolicy, error) { result := new(FirewallPolicy) url := createUrl(api, firewallPolicyPathSegment, fp_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // PUT /firewall_policies/{id} func (api *API) UpdateFirewallPolicy(fp_id string, fp_new_name string, fp_new_desc string) (*FirewallPolicy, error) { result := new(FirewallPolicy) data := FirewallPolicyRequest{ Name: fp_new_name, Description: fp_new_desc, } url := createUrl(api, firewallPolicyPathSegment, fp_id) err := api.Client.Put(url, &data, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // GET /firewall_policies/{id}/server_ips func (api *API) ListFirewallPolicyServerIps(fp_id string) ([]ServerIpInfo, error) { result := []ServerIpInfo{} url := createUrl(api, firewallPolicyPathSegment, fp_id, "server_ips") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // GET /firewall_policies/{id}/server_ips/{id} func (api *API) GetFirewallPolicyServerIp(fp_id string, ip_id string) (*ServerIpInfo, error) { result := new(ServerIpInfo) url := createUrl(api, firewallPolicyPathSegment, fp_id, "server_ips", ip_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /firewall_policies/{id}/server_ips func (api *API) AddFirewallPolicyServerIps(fp_id string, ip_ids []string) (*FirewallPolicy, error) { result := new(FirewallPolicy) request := serverIps{ ServerIps: ip_ids, } url := createUrl(api, firewallPolicyPathSegment, fp_id, "server_ips") err := api.Client.Post(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /firewall_policies/{id}/server_ips/{id} func (api *API) DeleteFirewallPolicyServerIp(fp_id string, ip_id string) (*FirewallPolicy, error) { result := new(FirewallPolicy) url := createUrl(api, firewallPolicyPathSegment, fp_id, "server_ips", ip_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /firewall_policies/{id}/rules func (api *API) ListFirewallPolicyRules(fp_id string) ([]FirewallPolicyRule, error) { result := []FirewallPolicyRule{} url := createUrl(api, firewallPolicyPathSegment, fp_id, "rules") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /firewall_policies/{id}/rules func (api *API) AddFirewallPolicyRules(fp_id string, fp_rules []FirewallPolicyRule) (*FirewallPolicy, error) { result := new(FirewallPolicy) data := struct { Rules []FirewallPolicyRule `json:"rules"` }{fp_rules} url := createUrl(api, firewallPolicyPathSegment, fp_id, "rules") err := api.Client.Post(url, &data, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /firewall_policies/{id}/rules/{id} func (api *API) GetFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicyRule, error) { result := new(FirewallPolicyRule) url := createUrl(api, firewallPolicyPathSegment, fp_id, "rules", rule_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /firewall_policies/{id}/rules/{id} func (api *API) DeleteFirewallPolicyRule(fp_id string, rule_id string) (*FirewallPolicy, error) { result := new(FirewallPolicy) url := createUrl(api, firewallPolicyPathSegment, fp_id, "rules", rule_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } func (fp *FirewallPolicy) GetState() (string, error) { in, err := fp.api.GetFirewallPolicy(fp.Id) if in == nil { return "", err } return in.State, err } ���packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/images.go���������������������0000664�0000000�0000000�00000005732�13771713062�0027211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" ) type Image struct { idField ImageConfig MinHddSize int `json:"min_hdd_size"` Architecture *int `json:"os_architecture"` CloudPanelId string `json:"cloudpanel_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` OsImageType string `json:"os_image_type,omitempty"` OsFamily string `json:"os_family,omitempty"` Os string `json:"os,omitempty"` OsVersion string `json:"os_version,omitempty"` Type string `json:"type,omitempty"` Licenses []License `json:"licenses,omitempty"` Hdds []Hdd `json:"hdds,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr } type ImageConfig struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Frequency string `json:"frequency,omitempty"` ServerId string `json:"server_id,omitempty"` NumImages int `json:"num_images"` } // GET /images func (api *API) ListImages(args ...interface{}) ([]Image, error) { url, err := processQueryParams(createUrl(api, imagePathSegment), args...) if err != nil { return nil, err } result := []Image{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /images func (api *API) CreateImage(request *ImageConfig) (string, *Image, error) { res := new(Image) url := createUrl(api, imagePathSegment) err := api.Client.Post(url, &request, &res, http.StatusAccepted) if err != nil { return "", nil, err } res.api = api return res.Id, res, nil } // GET /images/{id} func (api *API) GetImage(img_id string) (*Image, error) { result := new(Image) url := createUrl(api, imagePathSegment, img_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /images/{id} func (api *API) DeleteImage(img_id string) (*Image, error) { result := new(Image) url := createUrl(api, imagePathSegment, img_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // PUT /images/{id} func (api *API) UpdateImage(img_id string, new_name string, new_desc string, new_freq string) (*Image, error) { result := new(Image) req := struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Frequency string `json:"frequency,omitempty"` }{Name: new_name, Description: new_desc, Frequency: new_freq} url := createUrl(api, imagePathSegment, img_id) err := api.Client.Put(url, &req, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } func (im *Image) GetState() (string, error) { in, err := im.api.GetImage(im.Id) if in == nil { return "", err } return in.State, err } ��������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/loadbalancers.go��������������0000664�0000000�0000000�00000016250�13771713062�0030533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" ) type LoadBalancer struct { ApiPtr idField Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State string `json:"state,omitempty"` CreationDate string `json:"creation_date,omitempty"` Ip string `json:"ip,omitempty"` HealthCheckTest string `json:"health_check_test,omitempty"` HealthCheckInterval int `json:"health_check_interval"` HealthCheckPath string `json:"health_check_path,omitempty"` HealthCheckPathParser string `json:"health_check_path_parser,omitempty"` Persistence bool `json:"persistence"` PersistenceTime int `json:"persistence_time"` Method string `json:"method,omitempty"` Rules []LoadBalancerRule `json:"rules,omitempty"` ServerIps []ServerIpInfo `json:"server_ips,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` CloudPanelId string `json:"cloudpanel_id,omitempty"` } type LoadBalancerRule struct { idField Protocol string `json:"protocol,omitempty"` PortBalancer uint16 `json:"port_balancer"` PortServer uint16 `json:"port_server"` Source string `json:"source,omitempty"` } type LoadBalancerRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` DatacenterId string `json:"datacenter_id,omitempty"` HealthCheckTest string `json:"health_check_test,omitempty"` HealthCheckInterval *int `json:"health_check_interval"` HealthCheckPath string `json:"health_check_path,omitempty"` HealthCheckPathParser string `json:"health_check_path_parser,omitempty"` Persistence *bool `json:"persistence"` PersistenceTime *int `json:"persistence_time"` Method string `json:"method,omitempty"` Rules []LoadBalancerRule `json:"rules,omitempty"` } // GET /load_balancers func (api *API) ListLoadBalancers(args ...interface{}) ([]LoadBalancer, error) { url, err := processQueryParams(createUrl(api, loadBalancerPathSegment), args...) if err != nil { return nil, err } result := []LoadBalancer{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /load_balancers func (api *API) CreateLoadBalancer(request *LoadBalancerRequest) (string, *LoadBalancer, error) { url := createUrl(api, loadBalancerPathSegment) result := new(LoadBalancer) err := api.Client.Post(url, &request, &result, http.StatusAccepted) if err != nil { return "", nil, err } result.api = api return result.Id, result, nil } // GET /load_balancers/{id} func (api *API) GetLoadBalancer(lb_id string) (*LoadBalancer, error) { url := createUrl(api, loadBalancerPathSegment, lb_id) result := new(LoadBalancer) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /load_balancers/{id} func (api *API) DeleteLoadBalancer(lb_id string) (*LoadBalancer, error) { url := createUrl(api, loadBalancerPathSegment, lb_id) result := new(LoadBalancer) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // PUT /load_balancers/{id} func (api *API) UpdateLoadBalancer(lb_id string, request *LoadBalancerRequest) (*LoadBalancer, error) { url := createUrl(api, loadBalancerPathSegment, lb_id) result := new(LoadBalancer) err := api.Client.Put(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /load_balancers/{id}/server_ips func (api *API) ListLoadBalancerServerIps(lb_id string) ([]ServerIpInfo, error) { result := []ServerIpInfo{} url := createUrl(api, loadBalancerPathSegment, lb_id, "server_ips") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // GET /load_balancers/{id}/server_ips/{id} func (api *API) GetLoadBalancerServerIp(lb_id string, ip_id string) (*ServerIpInfo, error) { result := new(ServerIpInfo) url := createUrl(api, loadBalancerPathSegment, lb_id, "server_ips", ip_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /load_balancers/{id}/server_ips func (api *API) AddLoadBalancerServerIps(lb_id string, ip_ids []string) (*LoadBalancer, error) { result := new(LoadBalancer) request := serverIps{ ServerIps: ip_ids, } url := createUrl(api, loadBalancerPathSegment, lb_id, "server_ips") err := api.Client.Post(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /load_balancers/{id}/server_ips/{id} func (api *API) DeleteLoadBalancerServerIp(lb_id string, ip_id string) (*LoadBalancer, error) { result := new(LoadBalancer) url := createUrl(api, loadBalancerPathSegment, lb_id, "server_ips", ip_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /load_balancers/{load_balancer_id}/rules func (api *API) ListLoadBalancerRules(lb_id string) ([]LoadBalancerRule, error) { result := []LoadBalancerRule{} url := createUrl(api, loadBalancerPathSegment, lb_id, "rules") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /load_balancers/{load_balancer_id}/rules func (api *API) AddLoadBalancerRules(lb_id string, lb_rules []LoadBalancerRule) (*LoadBalancer, error) { result := new(LoadBalancer) data := struct { Rules []LoadBalancerRule `json:"rules"` }{lb_rules} url := createUrl(api, loadBalancerPathSegment, lb_id, "rules") err := api.Client.Post(url, &data, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /load_balancers/{load_balancer_id}/rules/{rule_id} func (api *API) GetLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancerRule, error) { result := new(LoadBalancerRule) url := createUrl(api, loadBalancerPathSegment, lb_id, "rules", rule_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /load_balancers/{load_balancer_id}/rules/{rule_id} func (api *API) DeleteLoadBalancerRule(lb_id string, rule_id string) (*LoadBalancer, error) { result := new(LoadBalancer) url := createUrl(api, loadBalancerPathSegment, lb_id, "rules", rule_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } func (lb *LoadBalancer) GetState() (string, error) { in, err := lb.api.GetLoadBalancer(lb.Id) if in == nil { return "", err } return in.State, err } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/logs.go�����������������������0000664�0000000�0000000�00000002364�13771713062�0026706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" "time" ) type Log struct { ApiPtr idField typeField CloudPanelId string `json:"cloudpanel_id,omitempty"` SiteId string `json:"site_id,omitempty"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` Action string `json:"action,omitempty"` Duration int `json:"duration"` Status *Status `json:"Status,omitempty"` Resource *Identity `json:"resource,omitempty"` User *Identity `json:"user,omitempty"` } // GET /logs func (api *API) ListLogs(period string, sd *time.Time, ed *time.Time, args ...interface{}) ([]Log, error) { result := []Log{} url, err := processQueryParamsExt(createUrl(api, logPathSegment), period, sd, ed, args...) if err != nil { return nil, err } err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // GET /logs/{id} func (api *API) GetLog(log_id string) (*Log, error) { result := new(Log) url := createUrl(api, logPathSegment, log_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/monitoringcenter.go�����������0000664�0000000�0000000�00000011234�13771713062�0031324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "errors" "net/http" "time" ) type MonServerUsageSummary struct { Identity Agent *monitoringAgent `json:"agent,omitempty"` Alerts *monitoringAlerts `json:"alerts,omitempty"` Status *monitoringStatus `json:"status,omitempty"` ApiPtr } type MonServerUsageDetails struct { Identity Status *statusState `json:"status,omitempty"` Agent *monitoringAgent `json:"agent,omitempty"` Alerts *monitoringAlerts `json:"alerts,omitempty"` CpuStatus *utilizationStatus `json:"cpu,omitempty"` DiskStatus *utilizationStatus `json:"disk,omitempty"` RamStatus *utilizationStatus `json:"ram,omitempty"` PingStatus *pingStatus `json:"internal_ping,omitempty"` TransferStatus *transferStatus `json:"transfer,omitempty"` ApiPtr } type monitoringStatus struct { State string `json:"state,omitempty"` Cpu *statusState `json:"cpu,omitempty"` Disk *statusState `json:"disk,omitempty"` InternalPing *statusState `json:"internal_ping,omitempty"` Ram *statusState `json:"ram,omitempty"` Transfer *statusState `json:"transfer,omitempty"` } type utilizationStatus struct { CriticalThreshold int `json:"critical,omitempty"` WarningThreshold int `json:"warning,omitempty"` Status string `json:"status,omitempty"` Data []usageData `json:"data,omitempty"` Unit *usageUnit `json:"unit,omitempty"` } type pingStatus struct { CriticalThreshold int `json:"critical,omitempty"` WarningThreshold int `json:"warning,omitempty"` Status string `json:"status,omitempty"` Data []pingData `json:"data,omitempty"` Unit *pingUnit `json:"unit,omitempty"` } type transferStatus struct { CriticalThreshold int `json:"critical,omitempty"` WarningThreshold int `json:"warning,omitempty"` Status string `json:"status,omitempty"` Data []transferData `json:"data,omitempty"` Unit *transferUnit `json:"unit,omitempty"` } type monitoringAgent struct { AgentInstalled bool `json:"agent_installed"` MissingAgentAlert bool `json:"missing_agent_alert"` MonitoringNeedsAgent bool `json:"monitoring_needs_agent"` } type monitoringAlerts struct { Ports *monitoringAlertInfo `json:"ports,omitempty"` Process *monitoringAlertInfo `json:"process,omitempty"` Resources *monitoringAlertInfo `json:"resources,omitempty"` } type monitoringAlertInfo struct { Ok int `json:"ok"` Warning int `json:"warning"` Critical int `json:"critical"` } type usageData struct { Date string `json:"date,omitempty"` UsedPercent float32 `json:"used_percent"` } type usageUnit struct { UsedPercent string `json:"used_percent,omitempty"` } type pingUnit struct { PackagesLost string `json:"pl,omitempty"` AccessTime string `json:"rta,omitempty"` } type pingData struct { Date string `json:"date,omitempty"` PackagesLost int `json:"pl"` AccessTime float32 `json:"rta"` } type transferUnit struct { Downstream string `json:"downstream,omitempty"` Upstream string `json:"upstream,omitempty"` } type transferData struct { Date string `json:"date,omitempty"` Downstream int `json:"downstream"` Upstream int `json:"upstream"` } // GET /monitoring_center func (api *API) ListMonitoringServersUsages(args ...interface{}) ([]MonServerUsageSummary, error) { url, err := processQueryParams(createUrl(api, monitorCenterPathSegment), args...) if err != nil { return nil, err } result := []MonServerUsageSummary{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // GET /monitoring_center/{server_id} func (api *API) GetMonitoringServerUsage(ser_id string, period string, dates ...time.Time) (*MonServerUsageDetails, error) { if period == "" { return nil, errors.New("Time period must be provided.") } params := make(map[string]interface{}, len(dates)+1) params["period"] = period if len(dates) == 2 { if dates[0].After(dates[1]) { return nil, errors.New("Start date cannot be after end date.") } params["start_date"] = dates[0].Format(time.RFC3339) params["end_date"] = dates[1].Format(time.RFC3339) } else if len(dates) > 0 { return nil, errors.New("Start and end dates must be provided.") } url := createUrl(api, monitorCenterPathSegment, ser_id) url = appendQueryParams(url, params) result := new(MonServerUsageDetails) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/monitoringpolicies.go���������0000664�0000000�0000000�00000022544�13771713062�0031661�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" ) type MonitoringPolicy struct { ApiPtr idField Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State string `json:"state,omitempty"` Default *int `json:"default,omitempty"` CreationDate string `json:"creation_date,omitempty"` Email string `json:"email,omitempty"` Agent bool `json:"agent"` Servers []Identity `json:"servers,omitempty"` Thresholds *MonitoringThreshold `json:"thresholds,omitempty"` Ports []MonitoringPort `json:"ports,omitempty"` Processes []MonitoringProcess `json:"processes,omitempty"` CloudPanelId string `json:"cloudpanel_id,omitempty"` } type MonitoringThreshold struct { Cpu *MonitoringLevel `json:"cpu,omitempty"` Ram *MonitoringLevel `json:"ram,omitempty"` Disk *MonitoringLevel `json:"disk,omitempty"` Transfer *MonitoringLevel `json:"transfer,omitempty"` InternalPing *MonitoringLevel `json:"internal_ping,omitempty"` } type MonitoringLevel struct { Warning *MonitoringValue `json:"warning,omitempty"` Critical *MonitoringValue `json:"critical,omitempty"` } type MonitoringValue struct { Value int `json:"value"` Alert bool `json:"alert"` } type MonitoringPort struct { idField Protocol string `json:"protocol,omitempty"` Port int `json:"port"` AlertIf string `json:"alert_if,omitempty"` EmailNotification bool `json:"email_notification"` } type MonitoringProcess struct { idField Process string `json:"process,omitempty"` AlertIf string `json:"alert_if,omitempty"` EmailNotification bool `json:"email_notification"` } // GET /monitoring_policies func (api *API) ListMonitoringPolicies(args ...interface{}) ([]MonitoringPolicy, error) { url, err := processQueryParams(createUrl(api, monitorPolicyPathSegment), args...) if err != nil { return nil, err } result := []MonitoringPolicy{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /monitoring_policies func (api *API) CreateMonitoringPolicy(mp *MonitoringPolicy) (string, *MonitoringPolicy, error) { result := new(MonitoringPolicy) url := createUrl(api, monitorPolicyPathSegment) err := api.Client.Post(url, &mp, &result, http.StatusCreated) if err != nil { return "", nil, err } result.api = api return result.Id, result, nil } // GET /monitoring_policies/{id} func (api *API) GetMonitoringPolicy(mp_id string) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) url := createUrl(api, monitorPolicyPathSegment, mp_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /monitoring_policies/{id} func (api *API) DeleteMonitoringPolicy(mp_id string) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) url := createUrl(api, monitorPolicyPathSegment, mp_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // PUT /monitoring_policies/{id} func (api *API) UpdateMonitoringPolicy(mp_id string, mp *MonitoringPolicy) (*MonitoringPolicy, error) { url := createUrl(api, monitorPolicyPathSegment, mp_id) result := new(MonitoringPolicy) err := api.Client.Put(url, &mp, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /monitoring_policies/{id}/ports func (api *API) ListMonitoringPolicyPorts(mp_id string) ([]MonitoringPort, error) { result := []MonitoringPort{} url := createUrl(api, monitorPolicyPathSegment, mp_id, "ports") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /monitoring_policies/{id}/ports func (api *API) AddMonitoringPolicyPorts(mp_id string, mp_ports []MonitoringPort) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) data := struct { Ports []MonitoringPort `json:"ports"` }{mp_ports} url := createUrl(api, monitorPolicyPathSegment, mp_id, "ports") err := api.Client.Post(url, &data, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /monitoring_policies/{id}/ports/{id} func (api *API) GetMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPort, error) { result := new(MonitoringPort) url := createUrl(api, monitorPolicyPathSegment, mp_id, "ports", port_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /monitoring_policies/{id}/ports/{id} func (api *API) DeleteMonitoringPolicyPort(mp_id string, port_id string) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) url := createUrl(api, monitorPolicyPathSegment, mp_id, "ports", port_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // PUT /monitoring_policies/{id}/ports/{id} func (api *API) ModifyMonitoringPolicyPort(mp_id string, port_id string, mp_port *MonitoringPort) (*MonitoringPolicy, error) { url := createUrl(api, monitorPolicyPathSegment, mp_id, "ports", port_id) result := new(MonitoringPolicy) req := struct { Ports *MonitoringPort `json:"ports"` }{mp_port} err := api.Client.Put(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /monitoring_policies/{id}/processes func (api *API) ListMonitoringPolicyProcesses(mp_id string) ([]MonitoringProcess, error) { result := []MonitoringProcess{} url := createUrl(api, monitorPolicyPathSegment, mp_id, "processes") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /monitoring_policies/{id}/processes func (api *API) AddMonitoringPolicyProcesses(mp_id string, mp_procs []MonitoringProcess) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) request := struct { Processes []MonitoringProcess `json:"processes"` }{mp_procs} url := createUrl(api, monitorPolicyPathSegment, mp_id, "processes") err := api.Client.Post(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /monitoring_policies/{id}/processes/{id} func (api *API) GetMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringProcess, error) { result := new(MonitoringProcess) url := createUrl(api, monitorPolicyPathSegment, mp_id, "processes", proc_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /monitoring_policies/{id}/processes/{id} func (api *API) DeleteMonitoringPolicyProcess(mp_id string, proc_id string) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) url := createUrl(api, monitorPolicyPathSegment, mp_id, "processes", proc_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // PUT /monitoring_policies/{id}/processes/{id} func (api *API) ModifyMonitoringPolicyProcess(mp_id string, proc_id string, mp_proc *MonitoringProcess) (*MonitoringPolicy, error) { url := createUrl(api, monitorPolicyPathSegment, mp_id, "processes", proc_id) result := new(MonitoringPolicy) req := struct { Processes *MonitoringProcess `json:"processes"` }{mp_proc} err := api.Client.Put(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /monitoring_policies/{id}/servers func (api *API) ListMonitoringPolicyServers(mp_id string) ([]Identity, error) { result := []Identity{} url := createUrl(api, monitorPolicyPathSegment, mp_id, "servers") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /monitoring_policies/{id}/servers func (api *API) AttachMonitoringPolicyServers(mp_id string, sids []string) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) request := servers{ Servers: sids, } url := createUrl(api, monitorPolicyPathSegment, mp_id, "servers") err := api.Client.Post(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /monitoring_policies/{id}/servers/{id} func (api *API) GetMonitoringPolicyServer(mp_id string, ser_id string) (*Identity, error) { result := new(Identity) url := createUrl(api, monitorPolicyPathSegment, mp_id, "servers", ser_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /monitoring_policies/{id}/servers/{id} func (api *API) RemoveMonitoringPolicyServer(mp_id string, ser_id string) (*MonitoringPolicy, error) { result := new(MonitoringPolicy) url := createUrl(api, monitorPolicyPathSegment, mp_id, "servers", ser_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } func (mp *MonitoringPolicy) GetState() (string, error) { in, err := mp.api.GetMonitoringPolicy(mp.Id) if in == nil { return "", err } return in.State, err } ������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/oneandone.go������������������0000664�0000000�0000000�00000007706�13771713062�0027715�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "errors" "net/http" "reflect" "time" ) // Struct to hold the required information for accessing the API. // // Instances of this type contain the URL of the endpoint to access the API as well as the API access token to be used. // They offer also all methods that allow to access the various objects that are returned by top level resources of // the API. type API struct { Endpoint string Client *restClient } type ApiPtr struct { api *API } type idField struct { Id string `json:"id,omitempty"` } type typeField struct { Type string `json:"type,omitempty"` } type nameField struct { Name string `json:"name,omitempty"` } type descField struct { Description string `json:"description,omitempty"` } type countField struct { Count int `json:"count,omitempty"` } type serverIps struct { ServerIps []string `json:"server_ips"` } type servers struct { Servers []string `json:"servers"` } type ApiInstance interface { GetState() (string, error) } const ( datacenterPathSegment = "datacenters" dvdIsoPathSegment = "dvd_isos" firewallPolicyPathSegment = "firewall_policies" imagePathSegment = "images" loadBalancerPathSegment = "load_balancers" logPathSegment = "logs" monitorCenterPathSegment = "monitoring_center" monitorPolicyPathSegment = "monitoring_policies" pingPathSegment = "ping" pingAuthPathSegment = "ping_auth" pricingPathSegment = "pricing" privateNetworkPathSegment = "private_networks" publicIpPathSegment = "public_ips" rolePathSegment = "roles" serverPathSegment = "servers" serverAppliancePathSegment = "server_appliances" sharedStoragePathSegment = "shared_storages" usagePathSegment = "usages" userPathSegment = "users" vpnPathSegment = "vpns" ) // Struct to hold the status of an API object. // // Values of this type are used to represent the status of API objects like servers, firewall policies and the like. // // The value of the "State" field can represent fixed states like "ACTIVE" or "POWERED_ON" but also transitional // states like "POWERING_ON" or "CONFIGURING". // // For fixed states the "Percent" field is empty where as for transitional states it contains the progress of the // transition in percent. type Status struct { State string `json:"state"` Percent int `json:"percent"` } type statusState struct { State string `json:"state,omitempty"` } type Identity struct { idField nameField } type License struct { nameField } // Creates a new API instance. // // Explanations about given token and url information can be found online under the following url TODO add url! func New(token string, url string) *API { api := new(API) api.Endpoint = url api.Client = newRestClient(token) return api } // Converts a given integer value into a pointer of the same type. func Int2Pointer(input int) *int { result := new(int) *result = input return result } // Converts a given boolean value into a pointer of the same type. func Bool2Pointer(input bool) *bool { result := new(bool) *result = input return result } // Performs busy-waiting for types that implement ApiInstance interface. func (api *API) WaitForState(in ApiInstance, state string, sec time.Duration, count int) error { if in != nil { for i := 0; i < count; i++ { s, err := in.GetState() if err != nil { return err } if s == state { return nil } time.Sleep(sec * time.Second) } return errors.New(reflect.ValueOf(in).Type().String() + " operation timeout.") } return nil } // Waits until instance is deleted for types that implement ApiInstance interface. func (api *API) WaitUntilDeleted(in ApiInstance) error { var err error for in != nil { _, err = in.GetState() if err != nil { if apiError, ok := err.(apiError); ok && apiError.httpStatusCode == http.StatusNotFound { return nil } else { return err } } time.Sleep(5 * time.Second) } return nil } ����������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/ping.go�����������������������0000664�0000000�0000000�00000001164�13771713062�0026674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" // GET /ping // Returns "PONG" if API is running func (api *API) Ping() ([]string, error) { url := createUrl(api, pingPathSegment) result := []string{} err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // GET /ping_auth // Returns "PONG" if the API is running and the authentication token is valid func (api *API) PingAuth() ([]string, error) { url := createUrl(api, pingAuthPathSegment) result := []string{} err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/pricing.go��������������������0000664�0000000�0000000�00000002152�13771713062�0027370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" type Pricing struct { Currency string `json:"currency,omitempty"` Plan *pricingPlan `json:"pricing_plans,omitempty"` } type pricingPlan struct { Image *pricingItem `json:"image,omitempty"` PublicIPs []pricingItem `json:"public_ips,omitempty"` Servers *serverPricing `json:"servers,omitempty"` SharedStorage *pricingItem `json:"shared_storage,omitempty"` SoftwareLicenses []pricingItem `json:"software_licences,omitempty"` } type serverPricing struct { FixedServers []pricingItem `json:"fixed_servers,omitempty"` FlexServers []pricingItem `json:"flexible_server,omitempty"` } type pricingItem struct { Name string `json:"name,omitempty"` GrossPrice string `json:"price_gross,omitempty"` NetPrice string `json:"price_net,omitempty"` Unit string `json:"unit,omitempty"` } // GET /pricing func (api *API) GetPricing() (*Pricing, error) { result := new(Pricing) url := createUrl(api, pricingPathSegment) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/privatenetworks.go������������0000664�0000000�0000000�00000010424�13771713062�0031205�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" ) type PrivateNetwork struct { Identity descField CloudpanelId string `json:"cloudpanel_id,omitempty"` NetworkAddress string `json:"network_address,omitempty"` SubnetMask string `json:"subnet_mask,omitempty"` State string `json:"state,omitempty"` SiteId string `json:"site_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` Servers []Identity `json:"servers,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr } type PrivateNetworkRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` DatacenterId string `json:"datacenter_id,omitempty"` NetworkAddress string `json:"network_address,omitempty"` SubnetMask string `json:"subnet_mask,omitempty"` } // GET /private_networks func (api *API) ListPrivateNetworks(args ...interface{}) ([]PrivateNetwork, error) { url, err := processQueryParams(createUrl(api, privateNetworkPathSegment), args...) if err != nil { return nil, err } result := []PrivateNetwork{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /private_networks func (api *API) CreatePrivateNetwork(request *PrivateNetworkRequest) (string, *PrivateNetwork, error) { result := new(PrivateNetwork) url := createUrl(api, privateNetworkPathSegment) err := api.Client.Post(url, &request, &result, http.StatusAccepted) if err != nil { return "", nil, err } result.api = api return result.Id, result, nil } // GET /private_networks/{id} func (api *API) GetPrivateNetwork(pn_id string) (*PrivateNetwork, error) { result := new(PrivateNetwork) url := createUrl(api, privateNetworkPathSegment, pn_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // PUT /private_networks/{id} func (api *API) UpdatePrivateNetwork(pn_id string, request *PrivateNetworkRequest) (*PrivateNetwork, error) { result := new(PrivateNetwork) url := createUrl(api, privateNetworkPathSegment, pn_id) err := api.Client.Put(url, &request, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /private_networks/{id} func (api *API) DeletePrivateNetwork(pn_id string) (*PrivateNetwork, error) { result := new(PrivateNetwork) url := createUrl(api, privateNetworkPathSegment, pn_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /private_networks/{id}/servers func (api *API) ListPrivateNetworkServers(pn_id string) ([]Identity, error) { result := []Identity{} url := createUrl(api, privateNetworkPathSegment, pn_id, "servers") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /private_networks/{id}/servers func (api *API) AttachPrivateNetworkServers(pn_id string, sids []string) (*PrivateNetwork, error) { result := new(PrivateNetwork) req := servers{ Servers: sids, } url := createUrl(api, privateNetworkPathSegment, pn_id, "servers") err := api.Client.Post(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /private_networks/{id}/servers/{id} func (api *API) GetPrivateNetworkServer(pn_id string, server_id string) (*Identity, error) { result := new(Identity) url := createUrl(api, privateNetworkPathSegment, pn_id, "servers", server_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /private_networks/{id}/servers/{id} func (api *API) DetachPrivateNetworkServer(pn_id string, pns_id string) (*PrivateNetwork, error) { result := new(PrivateNetwork) url := createUrl(api, privateNetworkPathSegment, pn_id, "servers", pns_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } func (pn *PrivateNetwork) GetState() (string, error) { in, err := pn.api.GetPrivateNetwork(pn.Id) if in == nil { return "", err } return in.State, err } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/publicips.go������������������0000664�0000000�0000000�00000005332�13771713062�0027732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" type PublicIp struct { idField typeField IpAddress string `json:"ip,omitempty"` AssignedTo *assignedTo `json:"assigned_to,omitempty"` ReverseDns string `json:"reverse_dns,omitempty"` IsDhcp *bool `json:"is_dhcp,omitempty"` State string `json:"state,omitempty"` SiteId string `json:"site_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr } type assignedTo struct { Identity typeField } const ( IpTypeV4 = "IPV4" IpTypeV6 = "IPV6" ) // GET /public_ips func (api *API) ListPublicIps(args ...interface{}) ([]PublicIp, error) { url, err := processQueryParams(createUrl(api, publicIpPathSegment), args...) if err != nil { return nil, err } result := []PublicIp{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /public_ips func (api *API) CreatePublicIp(ip_type string, reverse_dns string, datacenter_id string) (string, *PublicIp, error) { res := new(PublicIp) url := createUrl(api, publicIpPathSegment) req := struct { DatacenterId string `json:"datacenter_id,omitempty"` ReverseDns string `json:"reverse_dns,omitempty"` Type string `json:"type,omitempty"` }{DatacenterId: datacenter_id, ReverseDns: reverse_dns, Type: ip_type} err := api.Client.Post(url, &req, &res, http.StatusCreated) if err != nil { return "", nil, err } res.api = api return res.Id, res, nil } // GET /public_ips/{id} func (api *API) GetPublicIp(ip_id string) (*PublicIp, error) { result := new(PublicIp) url := createUrl(api, publicIpPathSegment, ip_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /public_ips/{id} func (api *API) DeletePublicIp(ip_id string) (*PublicIp, error) { result := new(PublicIp) url := createUrl(api, publicIpPathSegment, ip_id) err := api.Client.Delete(url, nil, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // PUT /public_ips/{id} func (api *API) UpdatePublicIp(ip_id string, reverse_dns string) (*PublicIp, error) { result := new(PublicIp) url := createUrl(api, publicIpPathSegment, ip_id) req := struct { ReverseDns string `json:"reverse_dns,omitempty"` }{reverse_dns} err := api.Client.Put(url, &req, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } func (ip *PublicIp) GetState() (string, error) { in, err := ip.api.GetPublicIp(ip.Id) if in == nil { return "", err } return in.State, err } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/restclient.go�����������������0000664�0000000�0000000�00000012611�13771713062�0030112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "bytes" "encoding/json" "errors" "fmt" "io" "io/ioutil" "net/http" p_url "net/url" "time" ) type restClient struct { token string } func newRestClient(token string) *restClient { restClient := new(restClient) restClient.token = token return restClient } func (c *restClient) Get(url string, result interface{}, expectedStatus int) error { return c.doRequest(url, "GET", nil, result, expectedStatus) } func (c *restClient) Delete(url string, requestBody interface{}, result interface{}, expectedStatus int) error { return c.doRequest(url, "DELETE", requestBody, result, expectedStatus) } func (c *restClient) Post(url string, requestBody interface{}, result interface{}, expectedStatus int) error { return c.doRequest(url, "POST", requestBody, result, expectedStatus) } func (c *restClient) Put(url string, requestBody interface{}, result interface{}, expectedStatus int) error { return c.doRequest(url, "PUT", requestBody, result, expectedStatus) } func (c *restClient) doRequest(url string, method string, requestBody interface{}, result interface{}, expectedStatus int) error { var bodyData io.Reader if requestBody != nil { data, _ := json.Marshal(requestBody) bodyData = bytes.NewBuffer(data) } request, err := http.NewRequest(method, url, bodyData) if err != nil { return err } request.Header.Add("X-Token", c.token) request.Header.Add("Content-Type", "application/json") client := http.Client{} response, err := client.Do(request) if err = isError(response, expectedStatus, err); err != nil { return err } defer response.Body.Close() body, err := ioutil.ReadAll(response.Body) if err != nil { return err } return c.unmarshal(body, result) } func (c *restClient) unmarshal(data []byte, result interface{}) error { err := json.Unmarshal(data, result) if err != nil { // handle the case when the result is an empty array instead of an object switch err.(type) { case *json.UnmarshalTypeError: var ra []interface{} e := json.Unmarshal(data, &ra) if e != nil { return e } else if len(ra) > 0 { return err } return nil default: return err } } return nil } func isError(response *http.Response, expectedStatus int, err error) error { if err != nil { return err } if response != nil { if response.StatusCode == expectedStatus { // we got a response with the expected HTTP status code, hence no error return nil } body, _ := ioutil.ReadAll(response.Body) // extract the API's error message to be returned later er_resp := new(errorResponse) err = json.Unmarshal(body, er_resp) if err != nil { return err } return apiError{response.StatusCode, fmt.Sprintf("Type: %s; Message: %s", er_resp.Type, er_resp.Message)} } return errors.New("Generic error - no response from the REST API service.") } func createUrl(api *API, sections ...interface{}) string { url := api.Endpoint for _, section := range sections { url += "/" + fmt.Sprint(section) } return url } func makeParameterMap(args ...interface{}) (map[string]interface{}, error) { qps := make(map[string]interface{}, len(args)) var is_true bool var page, per_page int var sort, query, fields string for i, p := range args { switch i { case 0: page, is_true = p.(int) if !is_true { return nil, errors.New("1st parameter must be a page number (integer).") } else if page > 0 { qps["page"] = page } case 1: per_page, is_true = p.(int) if !is_true { return nil, errors.New("2nd parameter must be a per_page number (integer).") } else if per_page > 0 { qps["per_page"] = per_page } case 2: sort, is_true = p.(string) if !is_true { return nil, errors.New("3rd parameter must be a sorting property string (e.g. 'name' or '-name').") } else if sort != "" { qps["sort"] = sort } case 3: query, is_true = p.(string) if !is_true { return nil, errors.New("4th parameter must be a query string to look for the response.") } else if query != "" { qps["q"] = query } case 4: fields, is_true = p.(string) if !is_true { return nil, errors.New("5th parameter must be fields properties string (e.g. 'id,name').") } else if fields != "" { qps["fields"] = fields } default: return nil, errors.New("Wrong number of parameters.") } } return qps, nil } func processQueryParams(url string, args ...interface{}) (string, error) { if len(args) > 0 { params, err := makeParameterMap(args...) if err != nil { return "", err } url = appendQueryParams(url, params) } return url, nil } func processQueryParamsExt(url string, period string, sd *time.Time, ed *time.Time, args ...interface{}) (string, error) { var qm map[string]interface{} var err error if len(args) > 0 { qm, err = makeParameterMap(args...) if err != nil { return "", err } } else { qm = make(map[string]interface{}, 3) } qm["period"] = period if sd != nil && ed != nil { if sd.After(*ed) { return "", errors.New("Start date cannot be after end date.") } qm["start_date"] = sd.Format(time.RFC3339) qm["end_date"] = ed.Format(time.RFC3339) } url = appendQueryParams(url, qm) return url, nil } func appendQueryParams(url string, params map[string]interface{}) string { queryUrl, _ := p_url.Parse(url) parameters := p_url.Values{} for key, value := range params { parameters.Add(key, fmt.Sprintf("%v", value)) } queryUrl.RawQuery = parameters.Encode() return queryUrl.String() } �����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/roles.go����������������������0000664�0000000�0000000�00000037142�13771713062�0027070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" type Role struct { Identity descField CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` Default *int `json:"default,omitempty"` Permissions *Permissions `json:"permissions,omitempty"` Users []Identity `json:"users,omitempty"` ApiPtr } type Permissions struct { Backups *BackupPerm `json:"backups,omitempty"` Firewalls *FirewallPerm `json:"firewall_policies,omitempty"` Images *ImagePerm `json:"images,omitempty"` Invoice *InvoicePerm `json:"interactive_invoices,omitempty"` IPs *IPPerm `json:"public_ips,omitempty"` LoadBalancers *LoadBalancerPerm `json:"load_balancers,omitempty"` Logs *LogPerm `json:"logs,omitempty"` MonitorCenter *MonitorCenterPerm `json:"monitoring_center,omitempty"` MonitorPolicies *MonitorPolicyPerm `json:"monitoring_policies,omitempty"` PrivateNetworks *PrivateNetworkPerm `json:"private_networks,omitempty"` Roles *RolePerm `json:"roles,omitempty"` Servers *ServerPerm `json:"servers,omitempty"` SharedStorage *SharedStoragePerm `json:"shared_storages,omitempty"` Usages *UsagePerm `json:"usages,omitempty"` Users *UserPerm `json:"users,omitempty"` VPNs *VPNPerm `json:"vpn,omitempty"` } type BackupPerm struct { Create bool `json:"create"` Delete bool `json:"delete"` Show bool `json:"show"` } type FirewallPerm struct { Clone bool `json:"clone"` Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServerIPs bool `json:"manage_attached_server_ips"` ManageRules bool `json:"manage_rules"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` } type ImagePerm struct { Create bool `json:"create"` Delete bool `json:"delete"` DisableAutoCreate bool `json:"disable_automatic_creation"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` } type InvoicePerm struct { Show bool `json:"show"` } type IPPerm struct { Create bool `json:"create"` Delete bool `json:"delete"` Release bool `json:"release"` SetReverseDNS bool `json:"set_reverse_dns"` Show bool `json:"show"` } type LoadBalancerPerm struct { Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServerIPs bool `json:"manage_attached_server_ips"` ManageRules bool `json:"manage_rules"` Modify bool `json:"modify"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` } type LogPerm struct { Show bool `json:"show"` } type MonitorCenterPerm struct { Show bool `json:"show"` } type MonitorPolicyPerm struct { Clone bool `json:"clone"` Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServers bool `json:"manage_attached_servers"` ManagePorts bool `json:"manage_ports"` ManageProcesses bool `json:"manage_processes"` ModifyResources bool `json:"modify_resources"` SetDescription bool `json:"set_description"` SetEmail bool `json:"set_email"` SetName bool `json:"set_name"` Show bool `json:"show"` } type PrivateNetworkPerm struct { Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServers bool `json:"manage_attached_servers"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` SetNetworkInfo bool `json:"set_network_info"` Show bool `json:"show"` } type RolePerm struct { Clone bool `json:"clone"` Create bool `json:"create"` Delete bool `json:"delete"` ManageUsers bool `json:"manage_users"` Modify bool `json:"modify"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` } type ServerPerm struct { AccessKVMConsole bool `json:"access_kvm_console"` AssignIP bool `json:"assign_ip"` Clone bool `json:"clone"` Create bool `json:"create"` Delete bool `json:"delete"` ManageDVD bool `json:"manage_dvd"` ManageSnapshot bool `json:"manage_snapshot"` Reinstall bool `json:"reinstall"` Resize bool `json:"resize"` Restart bool `json:"restart"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` Shutdown bool `json:"shutdown"` Start bool `json:"start"` } type SharedStoragePerm struct { Access bool `json:"access"` Create bool `json:"create"` Delete bool `json:"delete"` ManageAttachedServers bool `json:"manage_attached_servers"` Resize bool `json:"resize"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` } type UsagePerm struct { Show bool `json:"show"` } type UserPerm struct { ChangeRole bool `json:"change_role"` Create bool `json:"create"` Delete bool `json:"delete"` Disable bool `json:"disable"` Enable bool `json:"enable"` ManageAPI bool `json:"manage_api"` SetDescription bool `json:"set_description"` SetEmail bool `json:"set_email"` SetPassword bool `json:"set_password"` Show bool `json:"show"` } type VPNPerm struct { Create bool `json:"create"` Delete bool `json:"delete"` DownloadFile bool `json:"download_file"` SetDescription bool `json:"set_description"` SetName bool `json:"set_name"` Show bool `json:"show"` } // GET /roles func (api *API) ListRoles(args ...interface{}) ([]Role, error) { url, err := processQueryParams(createUrl(api, rolePathSegment), args...) if err != nil { return nil, err } result := []Role{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for _, role := range result { role.api = api } return result, nil } // POST /roles func (api *API) CreateRole(name string) (string, *Role, error) { result := new(Role) url := createUrl(api, rolePathSegment) req := struct { Name string `json:"name"` }{name} err := api.Client.Post(url, &req, &result, http.StatusCreated) if err != nil { return "", nil, err } result.api = api return result.Id, result, nil } // GET /roles/{role_id} func (api *API) GetRole(role_id string) (*Role, error) { result := new(Role) url := createUrl(api, rolePathSegment, role_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // PUT /roles/{role_id} func (api *API) ModifyRole(role_id string, name string, description string, state string) (*Role, error) { result := new(Role) url := createUrl(api, rolePathSegment, role_id) req := struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` State string `json:"state,omitempty"` }{Name: name, Description: description, State: state} err := api.Client.Put(url, &req, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /roles/{role_id} func (api *API) DeleteRole(role_id string) (*Role, error) { result := new(Role) url := createUrl(api, rolePathSegment, role_id) err := api.Client.Delete(url, nil, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // GET /roles/{role_id}/permissions func (api *API) GetRolePermissions(role_id string) (*Permissions, error) { result := new(Permissions) url := createUrl(api, rolePathSegment, role_id, "permissions") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // PUT /roles/{role_id}/permissions func (api *API) ModifyRolePermissions(role_id string, perm *Permissions) (*Role, error) { result := new(Role) url := createUrl(api, rolePathSegment, role_id, "permissions") err := api.Client.Put(url, &perm, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // GET /roles/{role_id}/users func (api *API) ListRoleUsers(role_id string) ([]Identity, error) { result := []Identity{} url := createUrl(api, rolePathSegment, role_id, "users") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /roles/{role_id}/users func (api *API) AssignRoleUsers(role_id string, user_ids []string) (*Role, error) { result := new(Role) url := createUrl(api, rolePathSegment, role_id, "users") req := struct { Users []string `json:"users"` }{user_ids} err := api.Client.Post(url, &req, &result, http.StatusCreated) if err != nil { return nil, err } result.api = api return result, nil } // GET /roles/{role_id}/users/{user_id} func (api *API) GetRoleUser(role_id string, user_id string) (*Identity, error) { result := new(Identity) url := createUrl(api, rolePathSegment, role_id, "users", user_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /roles/{role_id}/users/{user_id} func (api *API) RemoveRoleUser(role_id string, user_id string) (*Role, error) { result := new(Role) url := createUrl(api, rolePathSegment, role_id, "users", user_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // POST /roles/{role_id}/clone func (api *API) CloneRole(role_id string, name string) (*Role, error) { result := new(Role) url := createUrl(api, rolePathSegment, role_id, "clone") req := struct { Name string `json:"name"` }{name} err := api.Client.Post(url, &req, &result, http.StatusCreated) if err != nil { return nil, err } result.api = api return result, nil } func (role *Role) GetState() (string, error) { in, err := role.api.GetRole(role.Id) if in == nil { return "", err } return in.State, err } // Sets all backups' permissions func (bp *BackupPerm) SetAll(value bool) { bp.Create = value bp.Delete = value bp.Show = value } // Sets all firewall policies' permissions func (fp *FirewallPerm) SetAll(value bool) { fp.Clone = value fp.Create = value fp.Delete = value fp.ManageAttachedServerIPs = value fp.ManageRules = value fp.SetDescription = value fp.SetName = value fp.Show = value } // Sets all images' permissions func (imp *ImagePerm) SetAll(value bool) { imp.Create = value imp.Delete = value imp.DisableAutoCreate = value imp.SetDescription = value imp.SetName = value imp.Show = value } // Sets all invoice's permissions func (inp *InvoicePerm) SetAll(value bool) { inp.Show = value } // Sets all IPs' permissions func (ipp *IPPerm) SetAll(value bool) { ipp.Create = value ipp.Delete = value ipp.Release = value ipp.SetReverseDNS = value ipp.Show = value } // Sets all load balancers' permissions func (lbp *LoadBalancerPerm) SetAll(value bool) { lbp.Create = value lbp.Delete = value lbp.ManageAttachedServerIPs = value lbp.ManageRules = value lbp.Modify = value lbp.SetDescription = value lbp.SetName = value lbp.Show = value } // Sets all logs' permissions func (lp *LogPerm) SetAll(value bool) { lp.Show = value } // Sets all monitoring center's permissions func (mcp *MonitorCenterPerm) SetAll(value bool) { mcp.Show = value } // Sets all monitoring policies' permissions func (mpp *MonitorPolicyPerm) SetAll(value bool) { mpp.Clone = value mpp.Create = value mpp.Delete = value mpp.ManageAttachedServers = value mpp.ManagePorts = value mpp.ManageProcesses = value mpp.ModifyResources = value mpp.SetDescription = value mpp.SetEmail = value mpp.SetName = value mpp.Show = value } // Sets all private networks' permissions func (pnp *PrivateNetworkPerm) SetAll(value bool) { pnp.Create = value pnp.Delete = value pnp.ManageAttachedServers = value pnp.SetDescription = value pnp.SetName = value pnp.SetNetworkInfo = value pnp.Show = value } // Sets all roles' permissions func (rp *RolePerm) SetAll(value bool) { rp.Clone = value rp.Create = value rp.Delete = value rp.ManageUsers = value rp.Modify = value rp.SetDescription = value rp.SetName = value rp.Show = value } // Sets all servers' permissions func (sp *ServerPerm) SetAll(value bool) { sp.AccessKVMConsole = value sp.AssignIP = value sp.Clone = value sp.Create = value sp.Delete = value sp.ManageDVD = value sp.ManageSnapshot = value sp.Reinstall = value sp.Resize = value sp.Restart = value sp.SetDescription = value sp.SetName = value sp.Show = value sp.Shutdown = value sp.Start = value } // Sets all shared storages' permissions func (ssp *SharedStoragePerm) SetAll(value bool) { ssp.Access = value ssp.Create = value ssp.Delete = value ssp.ManageAttachedServers = value ssp.Resize = value ssp.SetDescription = value ssp.SetName = value ssp.Show = value } // Sets all usages' permissions func (up *UsagePerm) SetAll(value bool) { up.Show = value } // Sets all users' permissions func (up *UserPerm) SetAll(value bool) { up.ChangeRole = value up.Create = value up.Delete = value up.Disable = value up.Enable = value up.ManageAPI = value up.SetDescription = value up.SetEmail = value up.SetPassword = value up.Show = value } // Sets all VPNs' permissions func (vpnp *VPNPerm) SetAll(value bool) { vpnp.Create = value vpnp.Delete = value vpnp.DownloadFile = value vpnp.SetDescription = value vpnp.SetName = value vpnp.Show = value } // Sets all available permissions func (p *Permissions) SetAll(v bool) { if p.Backups == nil { p.Backups = &BackupPerm{v, v, v} } else { p.Backups.SetAll(v) } if p.Firewalls == nil { p.Firewalls = &FirewallPerm{v, v, v, v, v, v, v, v} } else { p.Firewalls.SetAll(v) } if p.Images == nil { p.Images = &ImagePerm{v, v, v, v, v, v} } else { p.Images.SetAll(v) } if p.Invoice == nil { p.Invoice = &InvoicePerm{v} } else { p.Invoice.SetAll(v) } if p.IPs == nil { p.IPs = &IPPerm{v, v, v, v, v} } else { p.IPs.SetAll(v) } if p.LoadBalancers == nil { p.LoadBalancers = &LoadBalancerPerm{v, v, v, v, v, v, v, v} } else { p.LoadBalancers.SetAll(v) } if p.Logs == nil { p.Logs = &LogPerm{v} } else { p.Logs.SetAll(v) } if p.MonitorCenter == nil { p.MonitorCenter = &MonitorCenterPerm{v} } else { p.MonitorCenter.SetAll(v) } if p.MonitorPolicies == nil { p.MonitorPolicies = &MonitorPolicyPerm{v, v, v, v, v, v, v, v, v, v, v} } else { p.MonitorPolicies.SetAll(v) } if p.PrivateNetworks == nil { p.PrivateNetworks = &PrivateNetworkPerm{v, v, v, v, v, v, v} } else { p.PrivateNetworks.SetAll(v) } if p.Roles == nil { p.Roles = &RolePerm{v, v, v, v, v, v, v, v} } else { p.Roles.SetAll(v) } if p.Servers == nil { p.Servers = &ServerPerm{v, v, v, v, v, v, v, v, v, v, v, v, v, v, v} } else { p.Servers.SetAll(v) } if p.SharedStorage == nil { p.SharedStorage = &SharedStoragePerm{v, v, v, v, v, v, v, v} } else { p.SharedStorage.SetAll(v) } if p.Usages == nil { p.Usages = &UsagePerm{v} } else { p.Usages.SetAll(v) } if p.Users == nil { p.Users = &UserPerm{v, v, v, v, v, v, v, v, v, v} } else { p.Users.SetAll(v) } if p.VPNs == nil { p.VPNs = &VPNPerm{v, v, v, v, v, v} } else { p.VPNs.SetAll(v) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/serverappliances.go�����������0000664�0000000�0000000�00000002610�13771713062�0031302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" type ServerAppliance struct { Identity typeField OsInstallBase string `json:"os_installation_base,omitempty"` OsFamily string `json:"os_family,omitempty"` Os string `json:"os,omitempty"` OsVersion string `json:"os_version,omitempty"` Version string `json:"version,omitempty"` MinHddSize int `json:"min_hdd_size"` Architecture interface{} `json:"os_architecture"` Licenses interface{} `json:"licenses,omitempty"` Categories []string `json:"categories,omitempty"` // AvailableDatacenters []string `json:"available_datacenters,omitempty"` ApiPtr } // GET /server_appliances func (api *API) ListServerAppliances(args ...interface{}) ([]ServerAppliance, error) { url, err := processQueryParams(createUrl(api, serverAppliancePathSegment), args...) if err != nil { return nil, err } res := []ServerAppliance{} err = api.Client.Get(url, &res, http.StatusOK) if err != nil { return nil, err } for index, _ := range res { res[index].api = api } return res, nil } // GET /server_appliances/{id} func (api *API) GetServerAppliance(sa_id string) (*ServerAppliance, error) { res := new(ServerAppliance) url := createUrl(api, serverAppliancePathSegment, sa_id) err := api.Client.Get(url, &res, http.StatusOK) if err != nil { return nil, err } // res.api = api return res, nil } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/servers.go��������������������0000664�0000000�0000000�00000056212�13771713062�0027434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "encoding/json" "errors" "math/big" "net/http" ) type Server struct { ApiPtr Identity descField CloudPanelId string `json:"cloudpanel_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` FirstPassword string `json:"first_password,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` Status *Status `json:"status,omitempty"` Hardware *Hardware `json:"hardware,omitempty"` Image *Identity `json:"image,omitempty"` Dvd *Identity `json:"dvd,omitempty"` MonPolicy *Identity `json:"monitoring_policy,omitempty"` Snapshot *ServerSnapshot `json:"snapshot,omitempty"` Ips []ServerIp `json:"ips,omitempty"` PrivateNets []Identity `json:"private_networks,omitempty"` Alerts *ServerAlerts `json:"-"` AlertsRaw *json.RawMessage `json:"alerts,omitempty"` } type Hardware struct { Vcores int `json:"vcore,omitempty"` CoresPerProcessor int `json:"cores_per_processor"` Ram float32 `json:"ram"` Hdds []Hdd `json:"hdds,omitempty"` FixedInsSizeId string `json:"fixed_instance_size_id,omitempty"` ApiPtr } type ServerHdds struct { Hdds []Hdd `json:"hdds,omitempty"` } type Hdd struct { idField Size int `json:"size,omitempty"` IsMain bool `json:"is_main,omitempty"` ApiPtr } type serverDeployImage struct { idField Password string `json:"password,omitempty"` Firewall *Identity `json:"firewall_policy,omitempty"` } type ServerIp struct { idField typeField Ip string `json:"ip,omitempty"` ReverseDns string `json:"reverse_dns,omitempty"` Firewall *Identity `json:"firewall_policy,omitempty"` LoadBalancers []Identity `json:"load_balancers,omitempty"` ApiPtr } type ServerIpInfo struct { idField // IP id Ip string `json:"ip,omitempty"` ServerName string `json:"server_name,omitempty"` } type ServerSnapshot struct { idField CreationDate string `json:"creation_date,omitempty"` DeletionDate string `json:"deletion_date,omitempty"` } type ServerAlerts struct { AlertSummary []serverAlertSummary AlertDetails *serverAlertDetails } type serverAlertSummary struct { countField typeField } type serverAlertDetails struct { Criticals []ServerAlert `json:"critical,omitempty"` Warnings []ServerAlert `json:"warning,omitempty"` } type ServerAlert struct { typeField descField Date string `json:"date"` } type ServerRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Hardware Hardware `json:"hardware"` ApplianceId string `json:"appliance_id,omitempty"` Password string `json:"password,omitempty"` PowerOn bool `json:"power_on"` FirewallPolicyId string `json:"firewall_policy_id,omitempty"` IpId string `json:"ip_id,omitempty"` LoadBalancerId string `json:"load_balancer_id,omitempty"` MonitoringPolicyId string `json:"monitoring_policy_id,omitempty"` DatacenterId string `json:"datacenter_id,omitempty"` SSHKey string `json:"rsa_key,omitempty"` } type ServerAction struct { Action string `json:"action,omitempty"` Method string `json:"method,omitempty"` } type FixedInstanceInfo struct { Identity Hardware *Hardware `json:"hardware,omitempty"` ApiPtr } // GET /servers func (api *API) ListServers(args ...interface{}) ([]Server, error) { url, err := processQueryParams(createUrl(api, serverPathSegment), args...) if err != nil { return nil, err } result := []Server{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for _, s := range result { s.api = api s.decodeRaws() } return result, nil } // POST /servers func (api *API) CreateServer(request *ServerRequest) (string, *Server, error) { result := new(Server) url := createUrl(api, serverPathSegment) insert2map := func(hasht map[string]interface{}, key string, value string) { if key != "" && value != "" { hasht[key] = value } } req := make(map[string]interface{}) hw := make(map[string]interface{}) req["name"] = request.Name req["description"] = request.Description req["appliance_id"] = request.ApplianceId req["power_on"] = request.PowerOn insert2map(req, "password", request.Password) insert2map(req, "firewall_policy_id", request.FirewallPolicyId) insert2map(req, "ip_id", request.IpId) insert2map(req, "load_balancer_id", request.LoadBalancerId) insert2map(req, "monitoring_policy_id", request.MonitoringPolicyId) insert2map(req, "datacenter_id", request.DatacenterId) insert2map(req, "rsa_key", request.SSHKey) req["hardware"] = hw if request.Hardware.FixedInsSizeId != "" { hw["fixed_instance_size_id"] = request.Hardware.FixedInsSizeId } else { hw["vcore"] = request.Hardware.Vcores hw["cores_per_processor"] = request.Hardware.CoresPerProcessor hw["ram"] = request.Hardware.Ram hw["hdds"] = request.Hardware.Hdds } err := api.Client.Post(url, &req, &result, http.StatusAccepted) if err != nil { return "", nil, err } result.api = api result.decodeRaws() return result.Id, result, nil } // This is a wraper function for `CreateServer` that returns the server's IP address and first password. // The function waits at most `timeout` seconds for the server to be created. // The initial `POST /servers` response does not contain the IP address, so we need to wait // until the server is created. func (api *API) CreateServerEx(request *ServerRequest, timeout int) (string, string, error) { id, server, err := api.CreateServer(request) if server != nil && err == nil { count := timeout / 5 if request.PowerOn { err = api.WaitForState(server, "POWERED_ON", 5, count) } else { err = api.WaitForState(server, "POWERED_OFF", 5, count) } if err != nil { return "", "", err } server, err := api.GetServer(id) if server != nil && err == nil && server.Ips[0].Ip != "" { if server.FirstPassword != "" { return server.Ips[0].Ip, server.FirstPassword, nil } if request.Password != "" { return server.Ips[0].Ip, request.Password, nil } // should never reach here return "", "", errors.New("No server's password was found.") } } return "", "", err } // GET /servers/{id} func (api *API) GetServer(server_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/fixed_instance_sizes func (api *API) ListFixedInstanceSizes() ([]FixedInstanceInfo, error) { result := []FixedInstanceInfo{} url := createUrl(api, serverPathSegment, "fixed_instance_sizes") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // GET /servers/fixed_instance_sizes/{fixed_instance_size_id} func (api *API) GetFixedInstanceSize(fis_id string) (*FixedInstanceInfo, error) { result := new(FixedInstanceInfo) url := createUrl(api, serverPathSegment, "fixed_instance_sizes", fis_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /servers/{id} func (api *API) DeleteServer(server_id string, keep_ips bool) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id) pm := make(map[string]interface{}, 1) pm["keep_ips"] = keep_ips url = appendQueryParams(url, pm) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // PUT /servers/{id} func (api *API) RenameServer(server_id string, new_name string, new_desc string) (*Server, error) { data := struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` }{Name: new_name, Description: new_desc} result := new(Server) url := createUrl(api, serverPathSegment, server_id) err := api.Client.Put(url, &data, &result, http.StatusOK) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{server_id}/hardware func (api *API) GetServerHardware(server_id string) (*Hardware, error) { result := new(Hardware) url := createUrl(api, serverPathSegment, server_id, "hardware") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // PUT /servers/{server_id}/hardware func (api *API) UpdateServerHardware(server_id string, hardware *Hardware) (*Server, error) { var vc, cpp *int var ram *float32 if hardware.Vcores > 0 { vc = new(int) *vc = hardware.Vcores } if hardware.CoresPerProcessor > 0 { cpp = new(int) *cpp = hardware.CoresPerProcessor } if big.NewFloat(float64(hardware.Ram)).Cmp(big.NewFloat(0)) != 0 { ram = new(float32) *ram = hardware.Ram } req := struct { VCores *int `json:"vcore,omitempty"` Cpp *int `json:"cores_per_processor,omitempty"` Ram *float32 `json:"ram,omitempty"` Flavor string `json:"fixed_instance_size_id,omitempty"` }{VCores: vc, Cpp: cpp, Ram: ram, Flavor: hardware.FixedInsSizeId} result := new(Server) url := createUrl(api, serverPathSegment, server_id, "hardware") err := api.Client.Put(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/hardware/hdds func (api *API) ListServerHdds(server_id string) ([]Hdd, error) { result := []Hdd{} url := createUrl(api, serverPathSegment, server_id, "hardware/hdds") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /servers/{id}/hardware/hdds func (api *API) AddServerHdds(server_id string, hdds *ServerHdds) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "hardware/hdds") err := api.Client.Post(url, &hdds, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/hardware/hdds/{id} func (api *API) GetServerHdd(server_id string, hdd_id string) (*Hdd, error) { result := new(Hdd) url := createUrl(api, serverPathSegment, server_id, "hardware/hdds", hdd_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /servers/{id}/hardware/hdds/{id} func (api *API) DeleteServerHdd(server_id string, hdd_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "hardware/hdds", hdd_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // PUT /servers/{id}/hardware/hdds/{id} func (api *API) ResizeServerHdd(server_id string, hdd_id string, new_size int) (*Server, error) { data := Hdd{Size: new_size} result := new(Server) url := createUrl(api, serverPathSegment, server_id, "hardware/hdds", hdd_id) err := api.Client.Put(url, &data, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/image func (api *API) GetServerImage(server_id string) (*Identity, error) { result := new(Identity) url := createUrl(api, serverPathSegment, server_id, "image") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // PUT /servers/{id}/image func (api *API) ReinstallServerImage(server_id string, image_id string, password string, fp_id string) (*Server, error) { data := new(serverDeployImage) data.Id = image_id data.Password = password if fp_id != "" { fp := new(Identity) fp.Id = fp_id data.Firewall = fp } result := new(Server) url := createUrl(api, serverPathSegment, server_id, "image") err := api.Client.Put(url, &data, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/ips func (api *API) ListServerIps(server_id string) ([]ServerIp, error) { result := []ServerIp{} url := createUrl(api, serverPathSegment, server_id, "ips") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /servers/{id}/ips func (api *API) AssignServerIp(server_id string, ip_type string) (*Server, error) { data := typeField{Type: ip_type} result := new(Server) url := createUrl(api, serverPathSegment, server_id, "ips") err := api.Client.Post(url, &data, &result, http.StatusCreated) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/ips/{id} func (api *API) GetServerIp(server_id string, ip_id string) (*ServerIp, error) { result := new(ServerIp) url := createUrl(api, serverPathSegment, server_id, "ips", ip_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /servers/{id}/ips/{id} func (api *API) DeleteServerIp(server_id string, ip_id string, keep_ip bool) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "ips", ip_id) qm := make(map[string]interface{}, 1) qm["keep_ip"] = keep_ip url = appendQueryParams(url, qm) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /servers/{id}/status func (api *API) GetServerStatus(server_id string) (*Status, error) { result := new(Status) url := createUrl(api, serverPathSegment, server_id, "status") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // PUT /servers/{id}/status/action (action = REBOOT) func (api *API) RebootServer(server_id string, is_hardware bool) (*Server, error) { result := new(Server) request := ServerAction{} request.Action = "REBOOT" if is_hardware { request.Method = "HARDWARE" } else { request.Method = "SOFTWARE" } url := createUrl(api, serverPathSegment, server_id, "status", "action") err := api.Client.Put(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // PUT /servers/{id}/status/action (action = POWER_OFF) func (api *API) ShutdownServer(server_id string, is_hardware bool) (*Server, error) { result := new(Server) request := ServerAction{} request.Action = "POWER_OFF" if is_hardware { request.Method = "HARDWARE" } else { request.Method = "SOFTWARE" } url := createUrl(api, serverPathSegment, server_id, "status", "action") err := api.Client.Put(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // PUT /servers/{id}/status/action (action = POWER_ON) func (api *API) StartServer(server_id string) (*Server, error) { result := new(Server) request := ServerAction{} request.Action = "POWER_ON" url := createUrl(api, serverPathSegment, server_id, "status", "action") err := api.Client.Put(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/dvd func (api *API) GetServerDvd(server_id string) (*Identity, error) { result := new(Identity) url := createUrl(api, serverPathSegment, server_id, "dvd") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /servers/{id}/dvd func (api *API) EjectServerDvd(server_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "dvd") err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // PUT /servers/{id}/dvd func (api *API) LoadServerDvd(server_id string, dvd_id string) (*Server, error) { request := Identity{} request.Id = dvd_id result := new(Server) url := createUrl(api, serverPathSegment, server_id, "dvd") err := api.Client.Put(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/private_networks func (api *API) ListServerPrivateNetworks(server_id string) ([]Identity, error) { result := []Identity{} url := createUrl(api, serverPathSegment, server_id, "private_networks") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /servers/{id}/private_networks func (api *API) AssignServerPrivateNetwork(server_id string, pn_id string) (*Server, error) { req := new(Identity) req.Id = pn_id result := new(Server) url := createUrl(api, serverPathSegment, server_id, "private_networks") err := api.Client.Post(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/private_networks/{id} func (api *API) GetServerPrivateNetwork(server_id string, pn_id string) (*PrivateNetwork, error) { result := new(PrivateNetwork) url := createUrl(api, serverPathSegment, server_id, "private_networks", pn_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /servers/{id}/private_networks/{id} func (api *API) RemoveServerPrivateNetwork(server_id string, pn_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "private_networks", pn_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{server_id}/ips/{ip_id}/load_balancers func (api *API) ListServerIpLoadBalancers(server_id string, ip_id string) ([]Identity, error) { result := []Identity{} url := createUrl(api, serverPathSegment, server_id, "ips", ip_id, "load_balancers") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /servers/{server_id}/ips/{ip_id}/load_balancers func (api *API) AssignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error) { req := struct { LbId string `json:"load_balancer_id"` }{lb_id} result := new(Server) url := createUrl(api, serverPathSegment, server_id, "ips", ip_id, "load_balancers") err := api.Client.Post(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // DELETE /servers/{server_id}/ips/{ip_id}/load_balancers func (api *API) UnassignServerIpLoadBalancer(server_id string, ip_id string, lb_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "ips", ip_id, "load_balancers", lb_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{server_id}/ips/{ip_id}/firewall_policy func (api *API) GetServerIpFirewallPolicy(server_id string, ip_id string) (*Identity, error) { result := new(Identity) url := createUrl(api, serverPathSegment, server_id, "ips", ip_id, "firewall_policy") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // PUT /servers/{server_id}/ips/{ip_id}/firewall_policy func (api *API) AssignServerIpFirewallPolicy(server_id string, ip_id string, fp_id string) (*Server, error) { req := idField{fp_id} result := new(Server) url := createUrl(api, serverPathSegment, server_id, "ips", ip_id, "firewall_policy") err := api.Client.Put(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // DELETE /servers/{server_id}/ips/{ip_id}/firewall_policy func (api *API) UnassignServerIpFirewallPolicy(server_id string, ip_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "ips", ip_id, "firewall_policy") err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // GET /servers/{id}/snapshots func (api *API) GetServerSnapshot(server_id string) (*ServerSnapshot, error) { result := new(ServerSnapshot) url := createUrl(api, serverPathSegment, server_id, "snapshots") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /servers/{id}/snapshots func (api *API) CreateServerSnapshot(server_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "snapshots") err := api.Client.Post(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // PUT /servers/{server_id}/snapshots/{snapshot_id} func (api *API) RestoreServerSnapshot(server_id string, snapshot_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "snapshots", snapshot_id) err := api.Client.Put(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // DELETE /servers/{server_id}/snapshots/{snapshot_id} func (api *API) DeleteServerSnapshot(server_id string, snapshot_id string) (*Server, error) { result := new(Server) url := createUrl(api, serverPathSegment, server_id, "snapshots", snapshot_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } // POST /servers/{server_id}/clone func (api *API) CloneServer(server_id string, new_name string, datacenter_id string) (*Server, error) { data := struct { Name string `json:"name"` DatacenterId string `json:"datacenter_id,omitempty"` }{Name: new_name, DatacenterId: datacenter_id} result := new(Server) url := createUrl(api, serverPathSegment, server_id, "clone") err := api.Client.Post(url, &data, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api result.decodeRaws() return result, nil } func (s *Server) GetState() (string, error) { st, err := s.api.GetServerStatus(s.Id) if st == nil { return "", err } return st.State, err } func (server *Server) decodeRaws() { if server.AlertsRaw != nil { server.Alerts = new(ServerAlerts) var sad serverAlertDetails if err := json.Unmarshal(*server.AlertsRaw, &sad); err == nil { server.Alerts.AlertDetails = &sad return } var sams []serverAlertSummary if err := json.Unmarshal(*server.AlertsRaw, &sams); err == nil { server.Alerts.AlertSummary = sams } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/setup.go����������������������0000664�0000000�0000000�00000000770�13771713062�0027101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone // The base url for 1&1 Cloud Server REST API. var BaseUrl = "https://cloudpanel-api.1and1.com/v1" // Authentication token var Token string // SetBaseUrl is intended to set the REST base url. BaseUrl is declared in setup.go func SetBaseUrl(newbaseurl string) string { BaseUrl = newbaseurl return BaseUrl } // SetToken is used to set authentication Token for the REST service. Token is declared in setup.go func SetToken(newtoken string) string { Token = newtoken return Token } ��������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/sharedstorages.go�������������0000664�0000000�0000000�00000013264�13771713062�0030761�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" ) type SharedStorage struct { Identity descField Size int `json:"size"` MinSizeAllowed int `json:"minimum_size_allowed"` SizeUsed string `json:"size_used,omitempty"` State string `json:"state,omitempty"` CloudPanelId string `json:"cloudpanel_id,omitempty"` SiteId string `json:"site_id,omitempty"` CifsPath string `json:"cifs_path,omitempty"` NfsPath string `json:"nfs_path,omitempty"` CreationDate string `json:"creation_date,omitempty"` Servers []SharedStorageServer `json:"servers,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr } type SharedStorageServer struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` Rights string `json:"rights,omitempty"` } type SharedStorageRequest struct { DatacenterId string `json:"datacenter_id,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Size *int `json:"size"` } type SharedStorageAccess struct { State string `json:"state,omitempty"` KerberosContentFile string `json:"kerberos_content_file,omitempty"` UserDomain string `json:"user_domain,omitempty"` SiteId string `json:"site_id,omitempty"` NeedsPasswordReset int `json:"needs_password_reset"` } // GET /shared_storages func (api *API) ListSharedStorages(args ...interface{}) ([]SharedStorage, error) { url, err := processQueryParams(createUrl(api, sharedStoragePathSegment), args...) if err != nil { return nil, err } result := []SharedStorage{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /shared_storages func (api *API) CreateSharedStorage(request *SharedStorageRequest) (string, *SharedStorage, error) { result := new(SharedStorage) url := createUrl(api, sharedStoragePathSegment) err := api.Client.Post(url, request, &result, http.StatusAccepted) if err != nil { return "", nil, err } result.api = api return result.Id, result, nil } // GET /shared_storages/{id} func (api *API) GetSharedStorage(ss_id string) (*SharedStorage, error) { result := new(SharedStorage) url := createUrl(api, sharedStoragePathSegment, ss_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /shared_storages/{id} func (api *API) DeleteSharedStorage(ss_id string) (*SharedStorage, error) { result := new(SharedStorage) url := createUrl(api, sharedStoragePathSegment, ss_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // PUT /shared_storages/{id} func (api *API) UpdateSharedStorage(ss_id string, request *SharedStorageRequest) (*SharedStorage, error) { result := new(SharedStorage) url := createUrl(api, sharedStoragePathSegment, ss_id) err := api.Client.Put(url, &request, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /shared_storages/{id}/servers func (api *API) ListSharedStorageServers(st_id string) ([]SharedStorageServer, error) { result := []SharedStorageServer{} url := createUrl(api, sharedStoragePathSegment, st_id, "servers") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /shared_storages/{id}/servers func (api *API) AddSharedStorageServers(st_id string, servers []SharedStorageServer) (*SharedStorage, error) { result := new(SharedStorage) req := struct { Servers []SharedStorageServer `json:"servers"` }{servers} url := createUrl(api, sharedStoragePathSegment, st_id, "servers") err := api.Client.Post(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /shared_storages/{id}/servers/{id} func (api *API) GetSharedStorageServer(st_id string, ser_id string) (*SharedStorageServer, error) { result := new(SharedStorageServer) url := createUrl(api, sharedStoragePathSegment, st_id, "servers", ser_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // DELETE /shared_storages/{id}/servers/{id} func (api *API) DeleteSharedStorageServer(st_id string, ser_id string) (*SharedStorage, error) { result := new(SharedStorage) url := createUrl(api, sharedStoragePathSegment, st_id, "servers", ser_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /shared_storages/access func (api *API) GetSharedStorageCredentials() ([]SharedStorageAccess, error) { result := []SharedStorageAccess{} url := createUrl(api, sharedStoragePathSegment, "access") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // PUT /shared_storages/access func (api *API) UpdateSharedStorageCredentials(new_pass string) ([]SharedStorageAccess, error) { result := []SharedStorageAccess{} req := struct { Password string `json:"password"` }{new_pass} url := createUrl(api, sharedStoragePathSegment, "access") err := api.Client.Put(url, &req, &result, http.StatusAccepted) if err != nil { return nil, err } return result, nil } func (ss *SharedStorage) GetState() (string, error) { in, err := ss.api.GetSharedStorage(ss.Id) if in == nil { return "", err } return in.State, err } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/usages.go���������������������0000664�0000000�0000000�00000002627�13771713062�0027233�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import ( "net/http" "time" ) type Usages struct { Images []usage `json:"IMAGES,omitempty"` LoadBalancers []usage `json:"LOAD BALANCERS,omitempty"` PublicIPs []usage `json:"PUBLIC IP,omitempty"` Servers []usage `json:"SERVERS,omitempty"` SharedStorages []usage `json:"SHARED STORAGE,omitempty"` ApiPtr } type usage struct { Identity Site int `json:"site"` Services []usageService `json:"services,omitempty"` } type usageService struct { AverageAmmount string `json:"avg_amount,omitempty"` Unit string `json:"unit,omitempty"` Usage int `json:"usage"` Details []usageDetails `json:"detail,omitempty"` typeField } type usageDetails struct { AverageAmmount string `json:"avg_amount,omitempty"` StartDate string `json:"start_date,omitempty"` EndDate string `json:"end_date,omitempty"` Unit string `json:"unit,omitempty"` Usage int `json:"usage,omitempty"` } // GET /usages func (api *API) ListUsages(period string, sd *time.Time, ed *time.Time, args ...interface{}) (*Usages, error) { result := new(Usages) url, err := processQueryParamsExt(createUrl(api, usagePathSegment), period, sd, ed, args...) if err != nil { return nil, err } err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/users.go����������������������0000664�0000000�0000000�00000011755�13771713062�0027107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" type User struct { Identity descField CreationDate string `json:"creation_date,omitempty"` Email string `json:"email,omitempty"` State string `json:"state,omitempty"` Role *Identity `json:"role,omitempty"` Api *UserApi `json:"api,omitempty"` ApiPtr } type UserApi struct { Active bool `json:"active"` AllowedIps []string `json:"allowed_ips,omitempty"` UserApiKey ApiPtr } type UserApiKey struct { Key string `json:"key,omitempty"` } type UserRequest struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Password string `json:"password,omitempty"` Email string `json:"email,omitempty"` State string `json:"state,omitempty"` } // GET /users func (api *API) ListUsers(args ...interface{}) ([]User, error) { url, err := processQueryParams(createUrl(api, userPathSegment), args...) if err != nil { return nil, err } result := []User{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for index, _ := range result { result[index].api = api } return result, nil } // POST /users func (api *API) CreateUser(user *UserRequest) (string, *User, error) { result := new(User) url := createUrl(api, userPathSegment) err := api.Client.Post(url, &user, &result, http.StatusCreated) if err != nil { return "", nil, err } result.api = api return result.Id, result, nil } // GET /users/{id} func (api *API) GetUser(user_id string) (*User, error) { result := new(User) url := createUrl(api, userPathSegment, user_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /users/{id} func (api *API) DeleteUser(user_id string) (*User, error) { result := new(User) url := createUrl(api, userPathSegment, user_id) err := api.Client.Delete(url, nil, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // PUT /users/{id} func (api *API) ModifyUser(user_id string, user *UserRequest) (*User, error) { result := new(User) url := createUrl(api, userPathSegment, user_id) err := api.Client.Put(url, &user, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // GET /users/{id}/api func (api *API) GetUserApi(user_id string) (*UserApi, error) { result := new(UserApi) url := createUrl(api, userPathSegment, user_id, "api") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // PUT /users/{id}/api func (api *API) ModifyUserApi(user_id string, active bool) (*User, error) { result := new(User) req := struct { Active bool `json:"active"` }{active} url := createUrl(api, userPathSegment, user_id, "api") err := api.Client.Put(url, &req, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // GET /users/{id}/api/key func (api *API) GetUserApiKey(user_id string) (*UserApiKey, error) { result := new(UserApiKey) url := createUrl(api, userPathSegment, user_id, "api/key") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // PUT /users/{id}/api/key func (api *API) RenewUserApiKey(user_id string) (*User, error) { result := new(User) url := createUrl(api, userPathSegment, user_id, "api/key") err := api.Client.Put(url, nil, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // GET /users/{id}/api/ips func (api *API) ListUserApiAllowedIps(user_id string) ([]string, error) { result := []string{} url := createUrl(api, userPathSegment, user_id, "api/ips") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } // POST /users/{id}/api/ips func (api *API) AddUserApiAlowedIps(user_id string, ips []string) (*User, error) { result := new(User) req := struct { Ips []string `json:"ips"` }{ips} url := createUrl(api, userPathSegment, user_id, "api/ips") err := api.Client.Post(url, &req, &result, http.StatusCreated) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /users/{id}/api/ips/{ip} func (api *API) RemoveUserApiAllowedIp(user_id string, ip string) (*User, error) { result := new(User) url := createUrl(api, userPathSegment, user_id, "api/ips", ip) err := api.Client.Delete(url, nil, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // GET /users/{id}/api/ips func (api *API) GetCurrentUserPermissions() (*Permissions, error) { result := new(Permissions) url := createUrl(api, userPathSegment, "current_user_permissions") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } return result, nil } func (u *User) GetState() (string, error) { in, err := u.api.GetUser(u.Id) if in == nil { return "", err } return in.State, err } �������������������packer-1.6.6+ds1/vendor/github.com/1and1/oneandone-cloudserver-sdk-go/vpns.go�����������������������0000664�0000000�0000000�00000005621�13771713062�0026727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package oneandone import "net/http" type VPN struct { Identity descField typeField CloudPanelId string `json:"cloudpanel_id,omitempty"` CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` IPs []string `json:"ips,omitempty"` Datacenter *Datacenter `json:"datacenter,omitempty"` ApiPtr } type configZipFile struct { Base64String string `json:"config_zip_file"` } // GET /vpns func (api *API) ListVPNs(args ...interface{}) ([]VPN, error) { url, err := processQueryParams(createUrl(api, vpnPathSegment), args...) if err != nil { return nil, err } result := []VPN{} err = api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } for _, vpn := range result { vpn.api = api } return result, nil } // POST /vpns func (api *API) CreateVPN(name string, description string, datacenter_id string) (string, *VPN, error) { res := new(VPN) url := createUrl(api, vpnPathSegment) req := struct { Name string `json:"name"` Description string `json:"description,omitempty"` DatacenterId string `json:"datacenter_id,omitempty"` }{Name: name, Description: description, DatacenterId: datacenter_id} err := api.Client.Post(url, &req, &res, http.StatusAccepted) if err != nil { return "", nil, err } res.api = api return res.Id, res, nil } // GET /vpns/{vpn_id} func (api *API) GetVPN(vpn_id string) (*VPN, error) { result := new(VPN) url := createUrl(api, vpnPathSegment, vpn_id) err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // PUT /vpns/{vpn_id} func (api *API) ModifyVPN(vpn_id string, name string, description string) (*VPN, error) { result := new(VPN) url := createUrl(api, vpnPathSegment, vpn_id) req := struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` }{Name: name, Description: description} err := api.Client.Put(url, &req, &result, http.StatusOK) if err != nil { return nil, err } result.api = api return result, nil } // DELETE /vpns/{vpn_id} func (api *API) DeleteVPN(vpn_id string) (*VPN, error) { result := new(VPN) url := createUrl(api, vpnPathSegment, vpn_id) err := api.Client.Delete(url, nil, &result, http.StatusAccepted) if err != nil { return nil, err } result.api = api return result, nil } // GET /vpns/{vpn_id}/configuration_file // Returns VPN configuration files (in a zip arhive) as a base64 encoded string func (api *API) GetVPNConfigFile(vpn_id string) (string, error) { result := new(configZipFile) url := createUrl(api, vpnPathSegment, vpn_id, "configuration_file") err := api.Client.Get(url, &result, http.StatusOK) if err != nil { return "", err } return result.Base64String, nil } func (vpn *VPN) GetState() (string, error) { in, err := vpn.api.GetVPN(vpn.Id) if in == nil { return "", err } return in.State, err } ���������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022566�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/�����������������������������0000775�0000000�0000000�00000000000�13771713062�0025561�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/LICENSE����������������������0000664�0000000�0000000�00000002055�13771713062�0026570�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright 2018 NAVER BUSINESS PLATFORM Corp. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/hmac/������������������������0000775�0000000�0000000�00000000000�13771713062�0026471�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/hmac/hmac.go�����������������0000664�0000000�0000000�00000002535�13771713062�0027735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hmac import ( "crypto" "crypto/hmac" "encoding/base64" "fmt" "net/url" ) func NewSigner(secretKey string, hashFunc crypto.Hash) *HMACSigner { return &HMACSigner{ secretKey: secretKey, hashFunc: hashFunc, } } type signer interface { Sign(method string, url string, accessKey string, apiKey string, timestamp string) (string, error) HashFunc() crypto.Hash Debug(enabled bool) } type HMACSigner struct { secretKey string hashFunc crypto.Hash debug bool } func (s *HMACSigner) Debug(enabled bool) { s.debug = enabled } func (s *HMACSigner) Sign(method string, reqUrl string, accessKey string, timestamp string) (string, error) { const space = " " const newLine = "\n" u, err := url.Parse(reqUrl) if err != nil { return "", err } if s.debug { fmt.Println("reqUrl: ", reqUrl) fmt.Println("accessKey: ", accessKey) } h := hmac.New(s.HashFunc().New, []byte(s.secretKey)) h.Write([]byte(method)) h.Write([]byte(space)) h.Write([]byte(u.RequestURI())) h.Write([]byte(newLine)) h.Write([]byte(timestamp)) h.Write([]byte(newLine)) h.Write([]byte(accessKey)) rawSignature := h.Sum(nil) base64signature := base64.StdEncoding.EncodeToString(rawSignature) if s.debug { fmt.Println("Base64 signature:", base64signature) } return base64signature, nil } func (s *HMACSigner) HashFunc() crypto.Hash { return s.hashFunc } �������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud/����������������������0000775�0000000�0000000�00000000000�13771713062�0027045�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud/configuration.go������0000664�0000000�0000000�00000002672�13771713062�0032252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ncloud import ( "bufio" "log" "net/http" "os" "os/user" "path/filepath" "strings" ) type APIKey struct { AccessKey string SecretKey string } type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client APIKey *APIKey } func Keys() *APIKey { apiKey := &APIKey{ AccessKey: "", SecretKey: "", } usr, err := user.Current() if err != nil { log.Fatal(err) return nil } if usr.HomeDir == "" { log.Fatal("use.HomeDir is nil") return nil } configureFile := filepath.Join(usr.HomeDir, ".ncloud", "configure") file, err := os.Open(configureFile) if err != nil { log.Fatal(err) return nil } defer file.Close() scanner := bufio.NewScanner(file) for scanner.Scan() { line := scanner.Text() s := strings.Split(line, "=") switch strings.TrimSpace(s[0]) { case "ncloud_access_key_id": apiKey.AccessKey = strings.TrimSpace(s[1]) case "ncloud_secret_access_key": apiKey.SecretKey = strings.TrimSpace(s[1]) } } if err := scanner.Err(); err != nil { log.Fatal(err) return nil } return apiKey } func (c *Configuration) AddDefaultHeader(key string, value string) { c.DefaultHeader[key] = value } ����������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud/convert_types.go������0000664�0000000�0000000�00000002555�13771713062�0032307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ncloud import ( "strconv" ) func String(v string) *string { return &v } func IntString(n int) *string { return String(strconv.Itoa(n)) } func StringInterfaceList(i []interface{}) []*string { vs := make([]*string, 0, len(i)) for _, v := range i { switch v.(type) { case *string: vs = append(vs, v.(*string)) default: vs = append(vs, String(v.(string))) } } return vs } func StringList(s []string) []*string { vs := make([]*string, 0, len(s)) for _, v := range s { vs = append(vs, String(v)) } return vs } func StringListValue(input []*string) []string { vs := make([]string, 0, len(input)) for _, v := range input { vs = append(vs, StringValue(v)) } return vs } func StringValue(v *string) string { if v != nil { return *v } return "" } func Bool(v bool) *bool { return &v } func BoolValue(v *bool) bool { if v != nil { return *v } return false } func Int(v int) *int { return &v } func IntValue(v *int) int { if v != nil { return *v } return 0 } func Int32(v int32) *int32 { return &v } func Int32Value(v *int32) int32 { if v != nil { return *v } return 0 } func Int64(v int64) *int64 { return &v } func Int64Value(v *int64) int64 { if v != nil { return *v } return 0 } func Float32(v float32) *float32 { return &v } func Float32Value(v *float32) float32 { if v != nil { return *v } return 0 } ���������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/��������������������0000775�0000000�0000000�00000000000�13771713062�0027404�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/�������������0000775�0000000�0000000�00000000000�13771713062�0030712�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/.travis.yml��0000664�0000000�0000000�00000000107�13771713062�0033021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������language: go install: - go get -d -v . script: - go build -v ./ ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/LICENSE������0000664�0000000�0000000�00000002055�13771713062�0031721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright 2018 NAVER BUSINESS PLATFORM Corp. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/README.md����0000664�0000000�0000000�00000042634�13771713062�0032202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Go API client for server <br/>https://ncloud.apigw.ntruss.com/server/v2 ## Overview This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. - API version: 2018-10-18T06:16:13Z - Package version: 1.1.0 - Build package: io.swagger.codegen.languages.NcpGoForNcloudClientCodegen ## Installation Put the package under your project folder and add the following in import: ``` "./server" ``` ## Documentation for API Endpoints All URIs are relative to *https://ncloud.apigw.ntruss.com/server/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *V2Api* | [**AddNasVolumeAccessControl**](docs/V2Api.md#addnasvolumeaccesscontrol) | **Post** /addNasVolumeAccessControl | *V2Api* | [**AddPortForwardingRules**](docs/V2Api.md#addportforwardingrules) | **Post** /addPortForwardingRules | *V2Api* | [**AssociatePublicIpWithServerInstance**](docs/V2Api.md#associatepublicipwithserverinstance) | **Post** /associatePublicIpWithServerInstance | *V2Api* | [**AttachBlockStorageInstance**](docs/V2Api.md#attachblockstorageinstance) | **Post** /attachBlockStorageInstance | *V2Api* | [**AttachNetworkInterface**](docs/V2Api.md#attachnetworkinterface) | **Post** /attachNetworkInterface | *V2Api* | [**ChangeNasVolumeSize**](docs/V2Api.md#changenasvolumesize) | **Post** /changeNasVolumeSize | *V2Api* | [**ChangeServerInstanceSpec**](docs/V2Api.md#changeserverinstancespec) | **Post** /changeServerInstanceSpec | *V2Api* | [**CreateBlockStorageInstance**](docs/V2Api.md#createblockstorageinstance) | **Post** /createBlockStorageInstance | *V2Api* | [**CreateBlockStorageSnapshotInstance**](docs/V2Api.md#createblockstoragesnapshotinstance) | **Post** /createBlockStorageSnapshotInstance | *V2Api* | [**CreateInstanceTags**](docs/V2Api.md#createinstancetags) | **Post** /createInstanceTags | *V2Api* | [**CreateLoginKey**](docs/V2Api.md#createloginkey) | **Post** /createLoginKey | *V2Api* | [**CreateMemberServerImage**](docs/V2Api.md#creatememberserverimage) | **Post** /createMemberServerImage | *V2Api* | [**CreateNasVolumeInstance**](docs/V2Api.md#createnasvolumeinstance) | **Post** /createNasVolumeInstance | *V2Api* | [**CreateNetworkInterface**](docs/V2Api.md#createnetworkinterface) | **Post** /createNetworkInterface | *V2Api* | [**CreatePublicIpInstance**](docs/V2Api.md#createpublicipinstance) | **Post** /createPublicIpInstance | *V2Api* | [**CreateServerInstances**](docs/V2Api.md#createserverinstances) | **Post** /createServerInstances | *V2Api* | [**DeleteBlockStorageInstances**](docs/V2Api.md#deleteblockstorageinstances) | **Post** /deleteBlockStorageInstances | *V2Api* | [**DeleteBlockStorageSnapshotInstances**](docs/V2Api.md#deleteblockstoragesnapshotinstances) | **Post** /deleteBlockStorageSnapshotInstances | *V2Api* | [**DeleteInstanceTags**](docs/V2Api.md#deleteinstancetags) | **Post** /deleteInstanceTags | *V2Api* | [**DeleteLoginKey**](docs/V2Api.md#deleteloginkey) | **Post** /deleteLoginKey | *V2Api* | [**DeleteMemberServerImages**](docs/V2Api.md#deletememberserverimages) | **Post** /deleteMemberServerImages | *V2Api* | [**DeleteNasVolumeInstance**](docs/V2Api.md#deletenasvolumeinstance) | **Post** /deleteNasVolumeInstance | *V2Api* | [**DeleteNetworkInterface**](docs/V2Api.md#deletenetworkinterface) | **Post** /deleteNetworkInterface | *V2Api* | [**DeletePortForwardingRules**](docs/V2Api.md#deleteportforwardingrules) | **Post** /deletePortForwardingRules | *V2Api* | [**DeletePublicIpInstances**](docs/V2Api.md#deletepublicipinstances) | **Post** /deletePublicIpInstances | *V2Api* | [**DetachBlockStorageInstances**](docs/V2Api.md#detachblockstorageinstances) | **Post** /detachBlockStorageInstances | *V2Api* | [**DetachNetworkInterface**](docs/V2Api.md#detachnetworkinterface) | **Post** /detachNetworkInterface | *V2Api* | [**DisassociatePublicIpFromServerInstance**](docs/V2Api.md#disassociatepublicipfromserverinstance) | **Post** /disassociatePublicIpFromServerInstance | *V2Api* | [**GetAccessControlGroupList**](docs/V2Api.md#getaccesscontrolgrouplist) | **Post** /getAccessControlGroupList | *V2Api* | [**GetAccessControlGroupServerInstanceList**](docs/V2Api.md#getaccesscontrolgroupserverinstancelist) | **Post** /getAccessControlGroupServerInstanceList | *V2Api* | [**GetAccessControlRuleList**](docs/V2Api.md#getaccesscontrolrulelist) | **Post** /getAccessControlRuleList | *V2Api* | [**GetBlockStorageInstanceList**](docs/V2Api.md#getblockstorageinstancelist) | **Post** /getBlockStorageInstanceList | *V2Api* | [**GetBlockStorageSnapshotInstanceList**](docs/V2Api.md#getblockstoragesnapshotinstancelist) | **Post** /getBlockStorageSnapshotInstanceList | *V2Api* | [**GetInstanceTagList**](docs/V2Api.md#getinstancetaglist) | **Post** /getInstanceTagList | *V2Api* | [**GetLoginKeyList**](docs/V2Api.md#getloginkeylist) | **Post** /getLoginKeyList | *V2Api* | [**GetMemberServerImageList**](docs/V2Api.md#getmemberserverimagelist) | **Post** /getMemberServerImageList | *V2Api* | [**GetNasVolumeInstanceList**](docs/V2Api.md#getnasvolumeinstancelist) | **Post** /getNasVolumeInstanceList | *V2Api* | [**GetNasVolumeInstanceRatingList**](docs/V2Api.md#getnasvolumeinstanceratinglist) | **Post** /getNasVolumeInstanceRatingList | *V2Api* | [**GetNetworkInterfaceList**](docs/V2Api.md#getnetworkinterfacelist) | **Post** /getNetworkInterfaceList | *V2Api* | [**GetPortForwardingRuleList**](docs/V2Api.md#getportforwardingrulelist) | **Post** /getPortForwardingRuleList | *V2Api* | [**GetPrivateSubnetInstanceList**](docs/V2Api.md#getprivatesubnetinstancelist) | **Post** /getPrivateSubnetInstanceList | *V2Api* | [**GetPublicIpInstanceList**](docs/V2Api.md#getpublicipinstancelist) | **Post** /getPublicIpInstanceList | *V2Api* | [**GetPublicIpTargetServerInstanceList**](docs/V2Api.md#getpubliciptargetserverinstancelist) | **Post** /getPublicIpTargetServerInstanceList | *V2Api* | [**GetRaidList**](docs/V2Api.md#getraidlist) | **Post** /getRaidList | *V2Api* | [**GetRegionList**](docs/V2Api.md#getregionlist) | **Post** /getRegionList | *V2Api* | [**GetRootPassword**](docs/V2Api.md#getrootpassword) | **Post** /getRootPassword | *V2Api* | [**GetServerImageProductList**](docs/V2Api.md#getserverimageproductlist) | **Post** /getServerImageProductList | *V2Api* | [**GetServerInstanceList**](docs/V2Api.md#getserverinstancelist) | **Post** /getServerInstanceList | *V2Api* | [**GetServerProductList**](docs/V2Api.md#getserverproductlist) | **Post** /getServerProductList | *V2Api* | [**GetZoneList**](docs/V2Api.md#getzonelist) | **Post** /getZoneList | *V2Api* | [**ImportLoginKey**](docs/V2Api.md#importloginkey) | **Post** /importLoginKey | *V2Api* | [**RebootServerInstances**](docs/V2Api.md#rebootserverinstances) | **Post** /rebootServerInstances | *V2Api* | [**RecreateServerInstance**](docs/V2Api.md#recreateserverinstance) | **Post** /recreateServerInstance | *V2Api* | [**RemoveNasVolumeAccessControl**](docs/V2Api.md#removenasvolumeaccesscontrol) | **Post** /removeNasVolumeAccessControl | *V2Api* | [**SetNasVolumeAccessControl**](docs/V2Api.md#setnasvolumeaccesscontrol) | **Post** /setNasVolumeAccessControl | *V2Api* | [**StartServerInstances**](docs/V2Api.md#startserverinstances) | **Post** /startServerInstances | *V2Api* | [**StopServerInstances**](docs/V2Api.md#stopserverinstances) | **Post** /stopServerInstances | *V2Api* | [**TerminateServerInstances**](docs/V2Api.md#terminateserverinstances) | **Post** /terminateServerInstances | ## Documentation For Models - [AccessControlGroup](docs/AccessControlGroup.md) - [AccessControlRule](docs/AccessControlRule.md) - [AddNasVolumeAccessControlRequest](docs/AddNasVolumeAccessControlRequest.md) - [AddNasVolumeAccessControlResponse](docs/AddNasVolumeAccessControlResponse.md) - [AddPortForwardingRulesRequest](docs/AddPortForwardingRulesRequest.md) - [AddPortForwardingRulesResponse](docs/AddPortForwardingRulesResponse.md) - [AssociatePublicIpWithServerInstanceRequest](docs/AssociatePublicIpWithServerInstanceRequest.md) - [AssociatePublicIpWithServerInstanceResponse](docs/AssociatePublicIpWithServerInstanceResponse.md) - [AttachBlockStorageInstanceRequest](docs/AttachBlockStorageInstanceRequest.md) - [AttachBlockStorageInstanceResponse](docs/AttachBlockStorageInstanceResponse.md) - [AttachNetworkInterfaceRequest](docs/AttachNetworkInterfaceRequest.md) - [AttachNetworkInterfaceResponse](docs/AttachNetworkInterfaceResponse.md) - [BlockStorageInstance](docs/BlockStorageInstance.md) - [BlockStorageSnapshotInstance](docs/BlockStorageSnapshotInstance.md) - [ChangeNasVolumeSizeRequest](docs/ChangeNasVolumeSizeRequest.md) - [ChangeNasVolumeSizeResponse](docs/ChangeNasVolumeSizeResponse.md) - [ChangeServerInstanceSpecRequest](docs/ChangeServerInstanceSpecRequest.md) - [ChangeServerInstanceSpecResponse](docs/ChangeServerInstanceSpecResponse.md) - [CommonCode](docs/CommonCode.md) - [CreateBlockStorageInstanceRequest](docs/CreateBlockStorageInstanceRequest.md) - [CreateBlockStorageInstanceResponse](docs/CreateBlockStorageInstanceResponse.md) - [CreateBlockStorageSnapshotInstanceRequest](docs/CreateBlockStorageSnapshotInstanceRequest.md) - [CreateBlockStorageSnapshotInstanceResponse](docs/CreateBlockStorageSnapshotInstanceResponse.md) - [CreateInstanceTagsRequest](docs/CreateInstanceTagsRequest.md) - [CreateInstanceTagsResponse](docs/CreateInstanceTagsResponse.md) - [CreateLoginKeyRequest](docs/CreateLoginKeyRequest.md) - [CreateLoginKeyResponse](docs/CreateLoginKeyResponse.md) - [CreateMemberServerImageRequest](docs/CreateMemberServerImageRequest.md) - [CreateMemberServerImageResponse](docs/CreateMemberServerImageResponse.md) - [CreateNasVolumeInstanceRequest](docs/CreateNasVolumeInstanceRequest.md) - [CreateNasVolumeInstanceResponse](docs/CreateNasVolumeInstanceResponse.md) - [CreateNetworkInterfaceRequest](docs/CreateNetworkInterfaceRequest.md) - [CreateNetworkInterfaceResponse](docs/CreateNetworkInterfaceResponse.md) - [CreatePublicIpInstanceRequest](docs/CreatePublicIpInstanceRequest.md) - [CreatePublicIpInstanceResponse](docs/CreatePublicIpInstanceResponse.md) - [CreateServerInstancesRequest](docs/CreateServerInstancesRequest.md) - [CreateServerInstancesResponse](docs/CreateServerInstancesResponse.md) - [DeleteBlockStorageInstancesRequest](docs/DeleteBlockStorageInstancesRequest.md) - [DeleteBlockStorageInstancesResponse](docs/DeleteBlockStorageInstancesResponse.md) - [DeleteBlockStorageSnapshotInstancesRequest](docs/DeleteBlockStorageSnapshotInstancesRequest.md) - [DeleteBlockStorageSnapshotInstancesResponse](docs/DeleteBlockStorageSnapshotInstancesResponse.md) - [DeleteInstanceTagsRequest](docs/DeleteInstanceTagsRequest.md) - [DeleteInstanceTagsResponse](docs/DeleteInstanceTagsResponse.md) - [DeleteLoginKeyRequest](docs/DeleteLoginKeyRequest.md) - [DeleteLoginKeyResponse](docs/DeleteLoginKeyResponse.md) - [DeleteMemberServerImagesRequest](docs/DeleteMemberServerImagesRequest.md) - [DeleteMemberServerImagesResponse](docs/DeleteMemberServerImagesResponse.md) - [DeleteNasVolumeInstanceRequest](docs/DeleteNasVolumeInstanceRequest.md) - [DeleteNasVolumeInstanceResponse](docs/DeleteNasVolumeInstanceResponse.md) - [DeleteNetworkInterfaceRequest](docs/DeleteNetworkInterfaceRequest.md) - [DeleteNetworkInterfaceResponse](docs/DeleteNetworkInterfaceResponse.md) - [DeletePortForwardingRulesRequest](docs/DeletePortForwardingRulesRequest.md) - [DeletePortForwardingRulesResponse](docs/DeletePortForwardingRulesResponse.md) - [DeletePublicIpInstancesRequest](docs/DeletePublicIpInstancesRequest.md) - [DeletePublicIpInstancesResponse](docs/DeletePublicIpInstancesResponse.md) - [DetachBlockStorageInstancesRequest](docs/DetachBlockStorageInstancesRequest.md) - [DetachBlockStorageInstancesResponse](docs/DetachBlockStorageInstancesResponse.md) - [DetachNetworkInterfaceRequest](docs/DetachNetworkInterfaceRequest.md) - [DetachNetworkInterfaceResponse](docs/DetachNetworkInterfaceResponse.md) - [DisassociatePublicIpFromServerInstanceRequest](docs/DisassociatePublicIpFromServerInstanceRequest.md) - [DisassociatePublicIpFromServerInstanceResponse](docs/DisassociatePublicIpFromServerInstanceResponse.md) - [GetAccessControlGroupListRequest](docs/GetAccessControlGroupListRequest.md) - [GetAccessControlGroupListResponse](docs/GetAccessControlGroupListResponse.md) - [GetAccessControlGroupServerInstanceListRequest](docs/GetAccessControlGroupServerInstanceListRequest.md) - [GetAccessControlGroupServerInstanceListResponse](docs/GetAccessControlGroupServerInstanceListResponse.md) - [GetAccessControlRuleListRequest](docs/GetAccessControlRuleListRequest.md) - [GetAccessControlRuleListResponse](docs/GetAccessControlRuleListResponse.md) - [GetBlockStorageInstanceListRequest](docs/GetBlockStorageInstanceListRequest.md) - [GetBlockStorageInstanceListResponse](docs/GetBlockStorageInstanceListResponse.md) - [GetBlockStorageSnapshotInstanceListRequest](docs/GetBlockStorageSnapshotInstanceListRequest.md) - [GetBlockStorageSnapshotInstanceListResponse](docs/GetBlockStorageSnapshotInstanceListResponse.md) - [GetInstanceTagListRequest](docs/GetInstanceTagListRequest.md) - [GetInstanceTagListResponse](docs/GetInstanceTagListResponse.md) - [GetLoginKeyListRequest](docs/GetLoginKeyListRequest.md) - [GetLoginKeyListResponse](docs/GetLoginKeyListResponse.md) - [GetMemberServerImageListRequest](docs/GetMemberServerImageListRequest.md) - [GetMemberServerImageListResponse](docs/GetMemberServerImageListResponse.md) - [GetNasVolumeInstanceListRequest](docs/GetNasVolumeInstanceListRequest.md) - [GetNasVolumeInstanceListResponse](docs/GetNasVolumeInstanceListResponse.md) - [GetNasVolumeInstanceRatingListRequest](docs/GetNasVolumeInstanceRatingListRequest.md) - [GetNasVolumeInstanceRatingListResponse](docs/GetNasVolumeInstanceRatingListResponse.md) - [GetNetworkInterfaceListRequest](docs/GetNetworkInterfaceListRequest.md) - [GetNetworkInterfaceListResponse](docs/GetNetworkInterfaceListResponse.md) - [GetPortForwardingRuleListRequest](docs/GetPortForwardingRuleListRequest.md) - [GetPortForwardingRuleListResponse](docs/GetPortForwardingRuleListResponse.md) - [GetPrivateSubnetInstanceListRequest](docs/GetPrivateSubnetInstanceListRequest.md) - [GetPrivateSubnetInstanceListResponse](docs/GetPrivateSubnetInstanceListResponse.md) - [GetPublicIpInstanceListRequest](docs/GetPublicIpInstanceListRequest.md) - [GetPublicIpInstanceListResponse](docs/GetPublicIpInstanceListResponse.md) - [GetPublicIpTargetServerInstanceListRequest](docs/GetPublicIpTargetServerInstanceListRequest.md) - [GetPublicIpTargetServerInstanceListResponse](docs/GetPublicIpTargetServerInstanceListResponse.md) - [GetRaidListRequest](docs/GetRaidListRequest.md) - [GetRaidListResponse](docs/GetRaidListResponse.md) - [GetRegionListRequest](docs/GetRegionListRequest.md) - [GetRegionListResponse](docs/GetRegionListResponse.md) - [GetRootPasswordRequest](docs/GetRootPasswordRequest.md) - [GetRootPasswordResponse](docs/GetRootPasswordResponse.md) - [GetServerImageProductListRequest](docs/GetServerImageProductListRequest.md) - [GetServerImageProductListResponse](docs/GetServerImageProductListResponse.md) - [GetServerInstanceListRequest](docs/GetServerInstanceListRequest.md) - [GetServerInstanceListResponse](docs/GetServerInstanceListResponse.md) - [GetServerProductListRequest](docs/GetServerProductListRequest.md) - [GetServerProductListResponse](docs/GetServerProductListResponse.md) - [GetZoneListRequest](docs/GetZoneListRequest.md) - [GetZoneListResponse](docs/GetZoneListResponse.md) - [ImportLoginKeyRequest](docs/ImportLoginKeyRequest.md) - [ImportLoginKeyResponse](docs/ImportLoginKeyResponse.md) - [InstanceTag](docs/InstanceTag.md) - [InstanceTagParameter](docs/InstanceTagParameter.md) - [LoginKey](docs/LoginKey.md) - [MemberServerImage](docs/MemberServerImage.md) - [NasVolumeInstance](docs/NasVolumeInstance.md) - [NasVolumeInstanceCustomIp](docs/NasVolumeInstanceCustomIp.md) - [NasVolumeInstanceRating](docs/NasVolumeInstanceRating.md) - [NetworkInterface](docs/NetworkInterface.md) - [PortForwardingRule](docs/PortForwardingRule.md) - [PortForwardingRuleParameter](docs/PortForwardingRuleParameter.md) - [PrivateSubnetInstance](docs/PrivateSubnetInstance.md) - [Product](docs/Product.md) - [PublicIpInstance](docs/PublicIpInstance.md) - [Raid](docs/Raid.md) - [RebootServerInstancesRequest](docs/RebootServerInstancesRequest.md) - [RebootServerInstancesResponse](docs/RebootServerInstancesResponse.md) - [RecreateServerInstanceRequest](docs/RecreateServerInstanceRequest.md) - [RecreateServerInstanceResponse](docs/RecreateServerInstanceResponse.md) - [Region](docs/Region.md) - [RemoveNasVolumeAccessControlRequest](docs/RemoveNasVolumeAccessControlRequest.md) - [RemoveNasVolumeAccessControlResponse](docs/RemoveNasVolumeAccessControlResponse.md) - [ServerInstance](docs/ServerInstance.md) - [SetNasVolumeAccessControlRequest](docs/SetNasVolumeAccessControlRequest.md) - [SetNasVolumeAccessControlResponse](docs/SetNasVolumeAccessControlResponse.md) - [StartServerInstancesRequest](docs/StartServerInstancesRequest.md) - [StartServerInstancesResponse](docs/StartServerInstancesResponse.md) - [StopServerInstancesRequest](docs/StopServerInstancesRequest.md) - [StopServerInstancesResponse](docs/StopServerInstancesResponse.md) - [TerminateServerInstancesRequest](docs/TerminateServerInstancesRequest.md) - [TerminateServerInstancesResponse](docs/TerminateServerInstancesResponse.md) - [Zone](docs/Zone.md) ����������������������������������������������������������������������������������������������������access_control_group.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000001351�13771713062�0035377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AccessControlGroup struct { // 접근제어그룹설정번호 AccessControlGroupConfigurationNo *string `json:"accessControlGroupConfigurationNo,omitempty"` // 접근제어그룹명 AccessControlGroupName *string `json:"accessControlGroupName,omitempty"` // 접근제어그룹설명 AccessControlGroupDescription *string `json:"accessControlGroupDescription,omitempty"` // 디폴트그룹여부 IsDefaultGroup *bool `json:"isDefaultGroup,omitempty"` // 생성일자 CreateDate *string `json:"createDate,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������access_control_rule.go������������������������������������������������������������������������������0000664�0000000�0000000�00000001707�13771713062�0035217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AccessControlRule struct { // 접근제어RULE설정번호 AccessControlRuleConfigurationNo *string `json:"accessControlRuleConfigurationNo,omitempty"` // 프로토콜구분 ProtocolType *CommonCode `json:"protocolType,omitempty"` // 소스IP SourceIp *string `json:"sourceIp,omitempty"` // 소스접근제어그룹번호 SourceAccessControlRuleConfigurationNo *string `json:"sourceAccessControlRuleConfigurationNo,omitempty"` // 소스접근제어그룹이름 SourceAccessControlRuleName *string `json:"sourceAccessControlRuleName,omitempty"` // 목적지포트 DestinationPort *string `json:"destinationPort,omitempty"` // 접근제어RULE설명 AccessControlRuleDescription *string `json:"accessControlRuleDescription,omitempty"` } ���������������������������������������������������������add_nas_volume_access_control_request.go������������������������������������������������������������0000664�0000000�0000000�00000001037�13771713062�0040774�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AddNasVolumeAccessControlRequest struct { // NAS볼륨인스턴스번호 NasVolumeInstanceNo *string `json:"nasVolumeInstanceNo"` // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList,omitempty"` // 커스텀IP리스트 CustomIpList []*string `json:"customIpList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������add_nas_volume_access_control_response.go�����������������������������������������������������������0000664�0000000�0000000�00000001045�13771713062�0041141�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AddNasVolumeAccessControlResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceList []*NasVolumeInstance `json:"nasVolumeInstanceList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������add_port_forwarding_rules_request.go����������������������������������������������������������������0000664�0000000�0000000�00000000751�13771713062�0040165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AddPortForwardingRulesRequest struct { // 포트포워딩설정번호 PortForwardingConfigurationNo *string `json:"portForwardingConfigurationNo"` // 포트포워딩RULE리스트 PortForwardingRuleList []*PortForwardingRuleParameter `json:"portForwardingRuleList"` } �����������������������add_port_forwarding_rules_response.go���������������������������������������������������������������0000664�0000000�0000000�00000001614�13771713062�0040332�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AddPortForwardingRulesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` // 포트포워딩설정번호 PortForwardingConfigurationNo *string `json:"portForwardingConfigurationNo,omitempty"` // 포트포워딩공인IP PortForwardingPublicIp *string `json:"portForwardingPublicIp,omitempty"` // ZONE Zone *Zone `json:"zone,omitempty"` // 인터넷회선구분 InternetLineType *CommonCode `json:"internetLineType,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PortForwardingRuleList []*PortForwardingRule `json:"portForwardingRuleList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/api_client.go0000664�0000000�0000000�00000030552�13771713062�0033355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server import ( "bytes" "crypto" "errors" "fmt" "io" "mime/multipart" "net/http" "net/url" "os" "path/filepath" "reflect" "regexp" "strconv" "strings" "time" "unicode" "unicode/utf8" "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/hmac" "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" ) var ( jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") ) // APIClient manages communication with the server API v2018-10-18T06:16:13Z // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *ncloud.Configuration common service // Reuse a single struct instead of allocating one for each service on the heap. // API Services V2Api *V2ApiService } type service struct { client *APIClient } // NewAPIClient creates a new API client. Requires a userAgent string describing your application. // optionally a custom http.Client to allow for advanced features such as caching. func NewAPIClient(cfg *ncloud.Configuration) *APIClient { if cfg.HTTPClient == nil { cfg.HTTPClient = http.DefaultClient } c := &APIClient{} c.cfg = cfg c.common.client = c // API Services c.V2Api = (*V2ApiService)(&c.common) return c } func atoi(in string) (int, error) { return strconv.Atoi(in) } // selectHeaderContentType select a content type from the available list. func selectHeaderContentType(contentTypes []string) string { if len(contentTypes) == 0 { return "" } if contains(contentTypes, "application/json") { return "application/json" } return contentTypes[0] // use the first content type specified in 'consumes' } // selectHeaderAccept join all accept types and return func selectHeaderAccept(accepts []string) string { if len(accepts) == 0 { return "" } if contains(accepts, "application/json") { return "application/json" } return strings.Join(accepts, ",") } // contains is a case insenstive match, finding needle in a haystack func contains(haystack []string, needle string) bool { for _, a := range haystack { if strings.ToLower(a) == strings.ToLower(needle) { return true } } return false } // Verify optional parameters are of the correct type. func typeCheckParameter(obj interface{}, expected string, name string) error { // Make sure there is an object. if obj == nil { return nil } // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) } return nil } // parameterToString convert interface{} parameters to string, using a delimiter if format is provided. func parameterToString(obj interface{}, collectionFormat string) string { var delimiter string switch collectionFormat { case "pipes": delimiter = "|" case "ssv": delimiter = " " case "tsv": delimiter = "\t" case "csv": delimiter = "," } if reflect.TypeOf(obj).Kind() == reflect.Slice { return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") } return fmt.Sprintf("%v", obj) } // callAPI do the request. func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { return c.cfg.HTTPClient.Do(request) } // Change base path to allow switching to mocks func (c *APIClient) ChangeBasePath(path string) { c.cfg.BasePath = path } // prepareRequest build the request func (c *APIClient) prepareRequest( path string, method string, postBody interface{}, headerParams map[string]string, queryParams url.Values, formParams url.Values, fileName string, fileBytes []byte) (localVarRequest *http.Request, err error) { var body *bytes.Buffer // Detect postBody type and post. if postBody != nil { contentType := headerParams["Content-Type"] if contentType == "" { contentType = detectContentType(postBody) headerParams["Content-Type"] = contentType } body, err = setBody(postBody, contentType) if err != nil { return nil, err } } // add form parameters and file if available. if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } body = &bytes.Buffer{} w := multipart.NewWriter(body) for k, v := range formParams { for _, iv := range v { if strings.HasPrefix(k, "@") { // file err = addFile(w, k[1:], iv) if err != nil { return nil, err } } else { // form value w.WriteField(k, iv) } } } if len(fileBytes) > 0 && fileName != "" { w.Boundary() //_, fileNm := filepath.Split(fileName) part, err := w.CreateFormFile("file", filepath.Base(fileName)) if err != nil { return nil, err } _, err = part.Write(fileBytes) if err != nil { return nil, err } // Set the Boundary in the Content-Type headerParams["Content-Type"] = w.FormDataContentType() } // Set Content-Length headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) w.Close() } // Setup path and query parameters url, err := url.Parse(path) if err != nil { return nil, err } // Adding Query Param query := url.Query() for k, v := range queryParams { for _, iv := range v { query.Add(k, iv) } } // Encode the parameters. url.RawQuery = query.Encode() // Generate a new request if body != nil { localVarRequest, err = http.NewRequest(method, url.String(), body) } else { localVarRequest, err = http.NewRequest(method, url.String(), nil) } if err != nil { return nil, err } // add header parameters, if any if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { headers.Set(h, v) } localVarRequest.Header = headers } // Override request host, if applicable if c.cfg.Host != "" { localVarRequest.Host = c.cfg.Host } // Add the user agent to the request. localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) // APIKey Authentication if auth := c.cfg.APIKey; auth != nil { timestamp := strconv.FormatInt(time.Now().UnixNano()/int64(time.Millisecond), 10) signer := hmac.NewSigner(auth.SecretKey, crypto.SHA256) signature, _ := signer.Sign(method, path, auth.AccessKey, timestamp) localVarRequest.Header.Add("x-ncp-apigw-timestamp", timestamp) localVarRequest.Header.Add("x-ncp-iam-access-key", auth.AccessKey) localVarRequest.Header.Add("x-ncp-apigw-signature-v1", signature) } for header, value := range c.cfg.DefaultHeader { localVarRequest.Header.Add(header, value) } return localVarRequest, nil } // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { file, err := os.Open(path) if err != nil { return err } defer file.Close() part, err := w.CreateFormFile(fieldName, filepath.Base(path)) if err != nil { return err } _, err = io.Copy(part, file) return err } // Prevent trying to import "fmt" func reportError(format string, a ...interface{}) error { return fmt.Errorf(format, a...) } func toLowerFirstChar(s string) string { a := []rune(s) a[0] = unicode.ToLower(a[0]) return string(a) } // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { bodyBuf = &bytes.Buffer{} } result := "responseFormatType=json" s := reflect.ValueOf(body).Elem() typeOfT := s.Type() for i := 0; i < s.NumField(); i++ { f := s.Field(i) if !f.IsNil() { key := toLowerFirstChar(typeOfT.Field(i).Name) if f.Kind() == reflect.Ptr { switch f.Type().String() { case "*string": result += fmt.Sprintf("&%s=%s", key, url.QueryEscape(ncloud.StringValue(f.Interface().(*string)))) case "*bool": result += fmt.Sprintf("&%s=%t", key, ncloud.BoolValue(f.Interface().(*bool))) case "*int": result += fmt.Sprintf("&%s=%d", key, ncloud.IntValue(f.Interface().(*int))) case "*int32": result += fmt.Sprintf("&%s=%d", key, ncloud.Int32Value(f.Interface().(*int32))) case "*int64": result += fmt.Sprintf("&%s=%d", key, ncloud.Int64Value(f.Interface().(*int64))) case "*float32": result += fmt.Sprintf("&%s=%f", key, ncloud.Float32Value(f.Interface().(*float32))) } } else if f.Kind() == reflect.Slice { for i := 0; i < f.Len(); i++ { item := f.Index(i) if item.Elem().Kind() == reflect.Struct { item := item.Elem() typeOfSubItem := item.Type() for j := 0; j < item.NumField(); j++ { subItem := item.Field(j) subKey := toLowerFirstChar(typeOfSubItem.Field(j).Name) switch subItem.Type().String() { case "*string": result += fmt.Sprintf("&%s.%d.%s=%s", key, i+1, subKey, url.QueryEscape(ncloud.StringValue(subItem.Interface().(*string)))) case "*bool": result += fmt.Sprintf("&%s.%d.%s=%t", key, i+1, subKey, ncloud.BoolValue(subItem.Interface().(*bool))) case "*int": result += fmt.Sprintf("&%s.%d.%s=%d", key, i+1, subKey, ncloud.IntValue(subItem.Interface().(*int))) case "*int32": result += fmt.Sprintf("&%s.%d.%s=%d", key, i+1, subKey, ncloud.Int32Value(subItem.Interface().(*int32))) case "*int64": result += fmt.Sprintf("&%s.%d.%s=%d", key, i+1, subKey, ncloud.Int64Value(subItem.Interface().(*int64))) case "*float32": result += fmt.Sprintf("&%s.%d.%s=%f", key, i+1, subKey, ncloud.Float32Value(subItem.Interface().(*float32))) } } } else { switch item.Type().String() { case "*string": result += fmt.Sprintf("&%s.%d=%s", key, i+1, url.QueryEscape(*item.Interface().(*string))) case "*bool": result += fmt.Sprintf("&%s.%d.%s=%t", key, i+1, ncloud.BoolValue(item.Interface().(*bool))) case "*int": result += fmt.Sprintf("&%s.%d.%s=%d", key, i+1, item.Interface().(*int)) case "*int32": result += fmt.Sprintf("&%s.%d.%s=%d", key, i+1, item.Interface().(*int32)) case "*int64": result += fmt.Sprintf("&%s.%d.%s=%d", key, i+1, item.Interface().(*int64)) case "*float32": result += fmt.Sprintf("&%s.%d.%s=%f", key, i+1, item.Interface().(*float32)) } } } } } } if err != nil { return nil, err } bodyBuf.WriteString(result) if bodyBuf.Len() == 0 { err = fmt.Errorf("Invalid body type %s", contentType) return nil, err } return bodyBuf, nil } // detectContentType method is used to figure out `Request.Body` content type for request header func detectContentType(body interface{}) string { contentType := "text/plain; charset=utf-8" kind := reflect.TypeOf(body).Kind() switch kind { case reflect.Struct, reflect.Map, reflect.Ptr: contentType = "application/json; charset=utf-8" case reflect.String: contentType = "text/plain; charset=utf-8" default: if b, ok := body.([]byte); ok { contentType = http.DetectContentType(b) } else if kind == reflect.Slice { contentType = "application/json; charset=utf-8" } } return contentType } // Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go type cacheControl map[string]string func parseCacheControl(headers http.Header) cacheControl { cc := cacheControl{} ccHeader := headers.Get("Cache-Control") for _, part := range strings.Split(ccHeader, ",") { part = strings.Trim(part, " ") if part == "" { continue } if strings.ContainsRune(part, '=') { keyval := strings.Split(part, "=") cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") } else { cc[part] = "" } } return cc } // CacheExpires helper function to determine remaining time before repeating a request. func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time now, err := time.Parse(time.RFC1123, r.Header.Get("date")) if err != nil { return time.Now() } respCacheControl := parseCacheControl(r.Header) if maxAge, ok := respCacheControl["max-age"]; ok { lifetime, err := time.ParseDuration(maxAge + "s") if err != nil { expires = now } expires = now.Add(lifetime) } else { expiresHeader := r.Header.Get("Expires") if expiresHeader != "" { expires, err = time.Parse(time.RFC1123, expiresHeader) if err != nil { expires = now } } } return expires } func strlen(s string) int { return utf8.RuneCountInString(s) } ������������������������������������������������������������������������������������������������������������������������������������������������������api_response.go�������������������������������������������������������������������������������������0000664�0000000�0000000�00000002325�13771713062�0033653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server import ( "net/http" ) type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` } func NewAPIResponse(r *http.Response) *APIResponse { response := &APIResponse{Response: r} return response } func NewAPIResponseWithError(errorMessage string) *APIResponse { response := &APIResponse{Message: errorMessage} return response } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������associate_public_ip_with_server_instance_request.go�������������������������������������������������0000664�0000000�0000000�00000000670�13771713062�0043243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AssociatePublicIpWithServerInstanceRequest struct { // 공인IP인스턴스번호 PublicIpInstanceNo *string `json:"publicIpInstanceNo"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` } ������������������������������������������������������������������������associate_public_ip_with_server_instance_response.go������������������������������������������������0000664�0000000�0000000�00000001054�13771713062�0043406�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AssociatePublicIpWithServerInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PublicIpInstanceList []*PublicIpInstance `json:"publicIpInstanceList,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������attach_block_storage_instance_request.go������������������������������������������������������������0000664�0000000�0000000�00000000701�13771713062�0040756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AttachBlockStorageInstanceRequest struct { // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` // 블록스토리지인스턴스번호 BlockStorageInstanceNo *string `json:"blockStorageInstanceNo"` } ���������������������������������������������������������������attach_block_storage_instance_response.go�����������������������������������������������������������0000664�0000000�0000000�00000001057�13771713062�0041131�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AttachBlockStorageInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageInstanceList []*BlockStorageInstance `json:"blockStorageInstanceList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������attach_network_interface_request.go�����������������������������������������������������������������0000664�0000000�0000000�00000000650�13771713062�0037770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AttachNetworkInterfaceRequest struct { // Network Interface번호 NetworkInterfaceNo *string `json:"networkInterfaceNo"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` } ����������������������������������������������������������������������������������������attach_network_interface_response.go����������������������������������������������������������������0000664�0000000�0000000�00000000636�13771713062�0040142�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type AttachNetworkInterfaceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` } ��������������������������������������������������������������������������������������������������block_storage_instance.go���������������������������������������������������������������������������0000664�0000000�0000000�00000003676�13771713062�0035700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type BlockStorageInstance struct { // 블록스토리지인스턴스번호 BlockStorageInstanceNo *string `json:"blockStorageInstanceNo,omitempty"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo,omitempty"` // 서버명 ServerName *string `json:"serverName,omitempty"` // 블록스토리지구분 BlockStorageType *CommonCode `json:"blockStorageType,omitempty"` // 블록스토리지명 BlockStorageName *string `json:"blockStorageName,omitempty"` // 블록스토리지사이즈 BlockStorageSize *int64 `json:"blockStorageSize,omitempty"` // 디바이스명 DeviceName *string `json:"deviceName,omitempty"` // 회원서버이미지번호 MemberServerImageNo *string `json:"memberServerImageNo,omitempty"` // 블록스토리지상품코드 BlockStorageProductCode *string `json:"blockStorageProductCode,omitempty"` // 블록스토리지인스턴스상태 BlockStorageInstanceStatus *CommonCode `json:"blockStorageInstanceStatus,omitempty"` // 블록스토리지인스턴스OP BlockStorageInstanceOperation *CommonCode `json:"blockStorageInstanceOperation,omitempty"` // 블록스토리지인스턴스상태명 BlockStorageInstanceStatusName *string `json:"blockStorageInstanceStatusName,omitempty"` // 생성일시 CreateDate *string `json:"createDate,omitempty"` // 블록스토리지인스턴스설명 BlockStorageInstanceDescription *string `json:"blockStorageInstanceDescription,omitempty"` // 디스크유형 DiskType *CommonCode `json:"diskType,omitempty"` // 디스크상세유형 DiskDetailType *CommonCode `json:"diskDetailType,omitempty"` // 최대 IOPS MaxIopsThroughput *int32 `json:"maxIopsThroughput,omitempty"` Region *Region `json:"region,omitempty"` Zone *Zone `json:"zone,omitempty"` } ������������������������������������������������������������������block_storage_snapshot_instance.go������������������������������������������������������������������0000664�0000000�0000000�00000003241�13771713062�0037603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type BlockStorageSnapshotInstance struct { // 블록스토리지스냅샷인스턴스번호 BlockStorageSnapshotInstanceNo *string `json:"blockStorageSnapshotInstanceNo,omitempty"` // 블록스토리지스냅샷명 BlockStorageSnapshotName *string `json:"blockStorageSnapshotName,omitempty"` // 블록스토지리볼륨사이즈 BlockStorageSnapshotVolumeSize *int64 `json:"blockStorageSnapshotVolumeSize,omitempty"` // 원본블록스토리지인스턴스번호 OriginalBlockStorageInstanceNo *string `json:"originalBlockStorageInstanceNo,omitempty"` // 원본블록스토리지명 OriginalBlockStorageName *string `json:"originalBlockStorageName,omitempty"` // 블록스토리지스냅샷인스턴스상태 BlockStorageSnapshotInstanceStatus *CommonCode `json:"blockStorageSnapshotInstanceStatus,omitempty"` // 블록스토리지스냅샷인스턴스OP BlockStorageSnapshotInstanceOperation *CommonCode `json:"blockStorageSnapshotInstanceOperation,omitempty"` BlockStorageSnapshotInstanceStatusName *string `json:"blockStorageSnapshotInstanceStatusName,omitempty"` // 생성일시 CreateDate *string `json:"createDate,omitempty"` // 블록스토리지스냅샷인스턴스설명 BlockStorageSnapshotInstanceDescription *string `json:"blockStorageSnapshotInstanceDescription,omitempty"` // 서버이미지상품코드 ServerImageProductCode *string `json:"serverImageProductCode,omitempty"` // OS정보 OsInformation *string `json:"osInformation,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_nas_volume_size_request.go�������������������������������������������������������������������0000664�0000000�0000000�00000000630�13771713062�0037440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type ChangeNasVolumeSizeRequest struct { // NAS볼륨인스턴스번호 NasVolumeInstanceNo *string `json:"nasVolumeInstanceNo"` // NAS볼륨사이즈 VolumeSize *int32 `json:"volumeSize"` } ��������������������������������������������������������������������������������������������������������change_nas_volume_size_response.go������������������������������������������������������������������0000664�0000000�0000000�00000001037�13771713062�0037610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type ChangeNasVolumeSizeResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceList []*NasVolumeInstance `json:"nasVolumeInstanceList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_server_instance_spec_request.go��������������������������������������������������������������0000664�0000000�0000000�00000000643�13771713062�0040446�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type ChangeServerInstanceSpecRequest struct { // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` // 서버상품코드 ServerProductCode *string `json:"serverProductCode"` } ���������������������������������������������������������������������������������������������change_server_instance_spec_response.go�������������������������������������������������������������0000664�0000000�0000000�00000001033�13771713062�0040606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type ChangeServerInstanceSpecResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������common_code.go��������������������������������������������������������������������������������������0000664�0000000�0000000�00000000535�13771713062�0033447�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CommonCode struct { // 코드 Code *string `json:"code,omitempty"` // 코드명 CodeName *string `json:"codeName,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������configuration.go������������������������������������������������������������������������������������0000664�0000000�0000000�00000001714�13771713062�0034034�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server import ( "github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud" "os" ) // contextKeys are used to identify the type of value in the context. // Since these are string, it is possible to get a short description of the // context key for logging and debugging using key.String(). type contextKey string func (c contextKey) String() string { return "auth " + string(c) } func NewConfiguration(apiKey *ncloud.APIKey) *ncloud.Configuration { cfg := &ncloud.Configuration{ BasePath: "https://ncloud.apigw.ntruss.com/server/v2", DefaultHeader: make(map[string]string), UserAgent: "server/1.1.0/go", APIKey: apiKey, } if os.Getenv("NCLOUD_API_GW") != "" { cfg.BasePath = os.Getenv("NCLOUD_API_GW") + "/server/v2" } return cfg } ����������������������������������������������������create_block_storage_instance_request.go������������������������������������������������������������0000664�0000000�0000000�00000001316�13771713062�0040760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateBlockStorageInstanceRequest struct { // 블럭스토리지명 BlockStorageName *string `json:"blockStorageName,omitempty"` // 블럭스토리지사이즈 BlockStorageSize *int64 `json:"blockStorageSize"` // 블럭스토리지설명 BlockStorageDescription *string `json:"blockStorageDescription,omitempty"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` // 디스크상세유형코드 DiskDetailTypeCode *string `json:"diskDetailTypeCode,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_block_storage_instance_response.go�����������������������������������������������������������0000664�0000000�0000000�00000001057�13771713062�0041130�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateBlockStorageInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageInstanceList []*BlockStorageInstance `json:"blockStorageInstanceList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_block_storage_snapshot_instance_request.go���������������������������������������������������0000664�0000000�0000000�00000001156�13771713062�0042701�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateBlockStorageSnapshotInstanceRequest struct { // 블록스토리지인스턴스번호 BlockStorageInstanceNo *string `json:"blockStorageInstanceNo"` // 블록스토리지스냅샷이름 BlockStorageSnapshotName *string `json:"blockStorageSnapshotName,omitempty"` // 블록스토리지스냅샷설명 BlockStorageSnapshotDescription *string `json:"blockStorageSnapshotDescription,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_block_storage_snapshot_instance_response.go��������������������������������������������������0000664�0000000�0000000�00000001117�13771713062�0043044�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateBlockStorageSnapshotInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageSnapshotInstanceList []*BlockStorageSnapshotInstance `json:"blockStorageSnapshotInstanceList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_instance_tags_request.go���������������������������������������������������������������������0000664�0000000�0000000�00000000663�13771713062�0037104�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateInstanceTagsRequest struct { // 인스턴스번호리스트 InstanceNoList []*string `json:"instanceNoList"` // 인스턴스태그리스트 InstanceTagList []*InstanceTagParameter `json:"instanceTagList"` } �����������������������������������������������������������������������������create_instance_tags_response.go��������������������������������������������������������������������0000664�0000000�0000000�00000001014�13771713062�0037241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateInstanceTagsResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` InstanceTagList []*InstanceTag `json:"instanceTagList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_login_key_request.go�������������������������������������������������������������������������0000664�0000000�0000000�00000000450�13771713062�0036234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateLoginKeyRequest struct { // 키명 KeyName *string `json:"keyName"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_login_key_response.go������������������������������������������������������������������������0000664�0000000�0000000�00000000710�13771713062�0036401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateLoginKeyResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` PrivateKey *string `json:"privateKey,omitempty"` } ��������������������������������������������������������create_member_server_image_request.go���������������������������������������������������������������0000664�0000000�0000000�00000001060�13771713062�0040251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateMemberServerImageRequest struct { // 회원서버이미지설명 MemberServerImageDescription *string `json:"memberServerImageDescription,omitempty"` // 회원서버이미지명 MemberServerImageName *string `json:"memberServerImageName,omitempty"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_member_server_image_response.go��������������������������������������������������������������0000664�0000000�0000000�00000001043�13771713062�0040420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateMemberServerImageResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` MemberServerImageList []*MemberServerImage `json:"memberServerImageList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_nas_volume_instance_request.go���������������������������������������������������������������0000664�0000000�0000000�00000002053�13771713062�0040311�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateNasVolumeInstanceRequest struct { // 볼륨이름 VolumeName *string `json:"volumeName"` // NAS볼륨사이즈 VolumeSize *int32 `json:"volumeSize"` // 볼륨할당프로토콜유형코드 VolumeAllotmentProtocolTypeCode *string `json:"volumeAllotmentProtocolTypeCode"` // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList,omitempty"` // 커스텀IP리스트 CustomIpList []*string `json:"customIpList,omitempty"` // CIFS유저이름 CifsUserName *string `json:"cifsUserName,omitempty"` // CIFS유저비밀번호 CifsUserPassword *string `json:"cifsUserPassword,omitempty"` // NAS볼륨설명 NasVolumeDescription *string `json:"nasVolumeDescription,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_nas_volume_instance_response.go��������������������������������������������������������������0000664�0000000�0000000�00000001043�13771713062�0040455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateNasVolumeInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceList []*NasVolumeInstance `json:"nasVolumeInstanceList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_network_interface_request.go�����������������������������������������������������������������0000664�0000000�0000000�00000001526�13771713062�0037772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateNetworkInterfaceRequest struct { // Private Subnet인스턴스번호 PrivateSubnetInstanceNo *string `json:"privateSubnetInstanceNo"` // Network Interface이름 NetworkInterfaceName *string `json:"networkInterfaceName"` // Network Interface IP NetworkInterfaceIp *string `json:"networkInterfaceIp"` // Network Interface설명 NetworkInterfaceDescription *string `json:"networkInterfaceDescription,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_network_interface_response.go����������������������������������������������������������������0000664�0000000�0000000�00000000636�13771713062�0040141�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateNetworkInterfaceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` } ��������������������������������������������������������������������������������������������������create_public_ip_instance_request.go����������������������������������������������������������������0000664�0000000�0000000�00000001223�13771713062�0040105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreatePublicIpInstanceRequest struct { // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo,omitempty"` // 공인IP설명 PublicIpDescription *string `json:"publicIpDescription,omitempty"` // 인터넷라인구분코드 InternetLineTypeCode *string `json:"internetLineTypeCode,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_public_ip_instance_response.go���������������������������������������������������������������0000664�0000000�0000000�00000001037�13771713062�0040256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreatePublicIpInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PublicIpInstanceList []*PublicIpInstance `json:"publicIpInstanceList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_server_instances_request.go������������������������������������������������������������������0000664�0000000�0000000�00000003233�13771713062�0037633�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateServerInstancesRequest struct { // 서버이미지상품코드 ServerImageProductCode *string `json:"serverImageProductCode,omitempty"` // 서버상품코드 ServerProductCode *string `json:"serverProductCode,omitempty"` // 회원서버이미지번호 MemberServerImageNo *string `json:"memberServerImageNo,omitempty"` // 서버명 ServerName *string `json:"serverName,omitempty"` // 서버설명 ServerDescription *string `json:"serverDescription,omitempty"` // 로그인키명 LoginKeyName *string `json:"loginKeyName,omitempty"` // 반납보호여부 IsProtectServerTermination *bool `json:"isProtectServerTermination,omitempty"` // 서버생성갯수 ServerCreateCount *int32 `json:"serverCreateCount,omitempty"` // 서버생성시작번호 ServerCreateStartNo *int32 `json:"serverCreateStartNo,omitempty"` // 인터넷라인구분코드 InternetLineTypeCode *string `json:"internetLineTypeCode,omitempty"` // 요금제구분코드 FeeSystemTypeCode *string `json:"feeSystemTypeCode,omitempty"` // 사용자데이터 UserData *string `json:"userData,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` // ACG설정번호리스트 AccessControlGroupConfigurationNoList []*string `json:"accessControlGroupConfigurationNoList,omitempty"` // RAID구분이름 RaidTypeName *string `json:"raidTypeName,omitempty"` // 인스턴스태그리스트 InstanceTagList []*InstanceTagParameter `json:"instanceTagList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_server_instances_response.go�����������������������������������������������������������������0000664�0000000�0000000�00000001030�13771713062�0037772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type CreateServerInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_block_storage_instances_request.go�����������������������������������������������������������0000664�0000000�0000000�00000000604�13771713062�0041141�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteBlockStorageInstancesRequest struct { // 블록스토리지인스턴스번호리스트 BlockStorageInstanceNoList []*string `json:"blockStorageInstanceNoList"` } ����������������������������������������������������������������������������������������������������������������������������delete_block_storage_instances_response.go����������������������������������������������������������0000664�0000000�0000000�00000001060�13771713062�0041304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteBlockStorageInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageInstanceList []*BlockStorageInstance `json:"blockStorageInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_block_storage_snapshot_instances_request.go��������������������������������������������������0000664�0000000�0000000�00000000645�13771713062�0043065�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteBlockStorageSnapshotInstancesRequest struct { // 블록스토리지스냅샷인스턴스번호리스트 BlockStorageSnapshotInstanceNoList []*string `json:"blockStorageSnapshotInstanceNoList"` } �������������������������������������������������������������������������������������������delete_block_storage_snapshot_instances_response.go�������������������������������������������������0000664�0000000�0000000�00000001120�13771713062�0043220�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteBlockStorageSnapshotInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageSnapshotInstanceList []*BlockStorageSnapshotInstance `json:"blockStorageSnapshotInstanceList,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_instance_tags_request.go���������������������������������������������������������������������0000664�0000000�0000000�00000000675�13771713062�0037106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteInstanceTagsRequest struct { // 인스턴스번호리스트 InstanceNoList []*string `json:"instanceNoList"` // 인스턴스태그리스트 InstanceTagList []*InstanceTagParameter `json:"instanceTagList,omitempty"` } �������������������������������������������������������������������delete_instance_tags_response.go��������������������������������������������������������������������0000664�0000000�0000000�00000000711�13771713062�0037243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteInstanceTagsResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` } �������������������������������������������������������delete_login_key_request.go�������������������������������������������������������������������������0000664�0000000�0000000�00000000450�13771713062�0036233�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteLoginKeyRequest struct { // 키명 KeyName *string `json:"keyName"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_login_key_response.go������������������������������������������������������������������������0000664�0000000�0000000�00000000626�13771713062�0036406�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteLoginKeyResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` } ����������������������������������������������������������������������������������������������������������delete_member_server_images_request.go��������������������������������������������������������������0000664�0000000�0000000�00000000562�13771713062�0040441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteMemberServerImagesRequest struct { // 회원서버이미지번호리스트 MemberServerImageNoList []*string `json:"memberServerImageNoList"` } ����������������������������������������������������������������������������������������������������������������������������������������������delete_member_server_images_response.go�������������������������������������������������������������0000664�0000000�0000000�00000001044�13771713062�0040603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteMemberServerImagesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` MemberServerImageList []*MemberServerImage `json:"memberServerImageList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_nas_volume_instance_request.go���������������������������������������������������������������0000664�0000000�0000000�00000000536�13771713062�0040314�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteNasVolumeInstanceRequest struct { // NAS볼륨인스턴스번호 NasVolumeInstanceNo *string `json:"nasVolumeInstanceNo"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_nas_volume_instance_response.go��������������������������������������������������������������0000664�0000000�0000000�00000001043�13771713062�0040454�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteNasVolumeInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceList []*NasVolumeInstance `json:"nasVolumeInstanceList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_network_interface_request.go�����������������������������������������������������������������0000664�0000000�0000000�00000000527�13771713062�0037771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteNetworkInterfaceRequest struct { // Network Interface번호 NetworkInterfaceNo *string `json:"networkInterfaceNo"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_network_interface_response.go����������������������������������������������������������������0000664�0000000�0000000�00000000636�13771713062�0040140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeleteNetworkInterfaceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` } ��������������������������������������������������������������������������������������������������delete_port_forwarding_rules_request.go�������������������������������������������������������������0000664�0000000�0000000�00000000754�13771713062�0040702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeletePortForwardingRulesRequest struct { // 포트포워딩설정번호 PortForwardingConfigurationNo *string `json:"portForwardingConfigurationNo"` // 포트포워딩RULE리스트 PortForwardingRuleList []*PortForwardingRuleParameter `json:"portForwardingRuleList"` } ��������������������delete_port_forwarding_rules_response.go������������������������������������������������������������0000664�0000000�0000000�00000001365�13771713062�0041047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeletePortForwardingRulesResponse struct { // 포트포워딩설정번호 PortForwardingConfigurationNo *string `json:"portForwardingConfigurationNo,omitempty"` // 포트포워딩공인IP PortForwardingPublicIp *string `json:"portForwardingPublicIp,omitempty"` // ZONE Zone *Zone `json:"zone,omitempty"` // 인터넷회선구분 InternetLineType *CommonCode `json:"internetLineType,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PortForwardingRuleList []*PortForwardingRule `json:"portForwardingRuleList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_public_ip_instances_request.go���������������������������������������������������������������0000664�0000000�0000000�00000000556�13771713062�0040277�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeletePublicIpInstancesRequest struct { // 공인IP인스턴스번호리스트 PublicIpInstanceNoList []*string `json:"publicIpInstanceNoList"` } ��������������������������������������������������������������������������������������������������������������������������������������������������delete_public_ip_instances_response.go��������������������������������������������������������������0000664�0000000�0000000�00000001040�13771713062�0040432�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DeletePublicIpInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PublicIpInstanceList []*PublicIpInstance `json:"publicIpInstanceList,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������detach_block_storage_instances_request.go�����������������������������������������������������������0000664�0000000�0000000�00000000604�13771713062�0041127�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DetachBlockStorageInstancesRequest struct { // 블록스토리지인스턴스번호리스트 BlockStorageInstanceNoList []*string `json:"blockStorageInstanceNoList"` } ����������������������������������������������������������������������������������������������������������������������������detach_block_storage_instances_response.go����������������������������������������������������������0000664�0000000�0000000�00000001060�13771713062�0041272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DetachBlockStorageInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageInstanceList []*BlockStorageInstance `json:"blockStorageInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������detach_network_interface_request.go�����������������������������������������������������������������0000664�0000000�0000000�00000000650�13771713062�0037754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DetachNetworkInterfaceRequest struct { // Network Interface번호 NetworkInterfaceNo *string `json:"networkInterfaceNo"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` } ����������������������������������������������������������������������������������������detach_network_interface_response.go����������������������������������������������������������������0000664�0000000�0000000�00000000636�13771713062�0040126�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DetachNetworkInterfaceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` } ��������������������������������������������������������������������������������������������������disassociate_public_ip_from_server_instance_request.go����������������������������������������������0000664�0000000�0000000�00000000552�13771713062�0043732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DisassociatePublicIpFromServerInstanceRequest struct { // 공인IP인스턴스번호 PublicIpInstanceNo *string `json:"publicIpInstanceNo"` } ������������������������������������������������������������������������������������������������������������������������������������������������������disassociate_public_ip_from_server_instance_response.go���������������������������������������������0000664�0000000�0000000�00000001057�13771713062�0044101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type DisassociatePublicIpFromServerInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PublicIpInstanceList []*PublicIpInstance `json:"publicIpInstanceList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_access_control_group_list_request.go������������������������������������������������������������0000664�0000000�0000000�00000001303�13771713062�0041036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetAccessControlGroupListRequest struct { // 접근제어그룹설정번호리스트 AccessControlGroupConfigurationNoList []*string `json:"accessControlGroupConfigurationNoList,omitempty"` // 디폴트여부 IsDefault *bool `json:"isDefault,omitempty"` // 접근제어그룹명 AccessControlGroupName *string `json:"accessControlGroupName,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_access_control_group_list_response.go�����������������������������������������������������������0000664�0000000�0000000�00000001050�13771713062�0041203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetAccessControlGroupListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` AccessControlGroupList []*AccessControlGroup `json:"accessControlGroupList,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_access_control_group_server_instance_list_request.go��������������������������������������������0000664�0000000�0000000�00000000615�13771713062�0044315�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetAccessControlGroupServerInstanceListRequest struct { // 접근제어그룹설정번호 AccessControlGroupConfigurationNo *string `json:"accessControlGroupConfigurationNo"` } �������������������������������������������������������������������������������������������������������������������get_access_control_group_server_instance_list_response.go�������������������������������������������0000664�0000000�0000000�00000001052�13771713062�0044457�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetAccessControlGroupServerInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_access_control_rule_list_request.go�������������������������������������������������������������0000664�0000000�0000000�00000000576�13771713062�0040664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetAccessControlRuleListRequest struct { // 접근제어그룹설정번호 AccessControlGroupConfigurationNo *string `json:"accessControlGroupConfigurationNo"` } ����������������������������������������������������������������������������������������������������������������������������������get_access_control_rule_list_response.go������������������������������������������������������������0000664�0000000�0000000�00000001044�13771713062�0041021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetAccessControlRuleListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` AccessControlRuleList []*AccessControlRule `json:"accessControlRuleList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_block_storage_instance_list_request.go����������������������������������������������������������0000664�0000000�0000000�00000002713�13771713062�0041331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetBlockStorageInstanceListRequest struct { // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo,omitempty"` // 블록스토리지인스턴스번호리스트 BlockStorageInstanceNoList []*string `json:"blockStorageInstanceNoList,omitempty"` // 검색할필터명 SearchFilterName *string `json:"searchFilterName,omitempty"` // 검색할필터값 SearchFilterValue *string `json:"searchFilterValue,omitempty"` // 블록스토리지구분코드리스트 BlockStorageTypeCodeList []*string `json:"blockStorageTypeCodeList,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` // 블록스토리지인스턴스상태코드 BlockStorageInstanceStatusCode *string `json:"blockStorageInstanceStatusCode,omitempty"` // 디스크유형코드 DiskTypeCode *string `json:"diskTypeCode,omitempty"` // 디스크유형상세코드 DiskDetailTypeCode *string `json:"diskDetailTypeCode,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` // 소팅대상 SortedBy *string `json:"sortedBy,omitempty"` // 소팅순서 SortingOrder *string `json:"sortingOrder,omitempty"` } �����������������������������������������������������get_block_storage_instance_list_response.go���������������������������������������������������������0000664�0000000�0000000�00000001060�13771713062�0041471�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetBlockStorageInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageInstanceList []*BlockStorageInstance `json:"blockStorageInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_block_storage_snapshot_instance_list_request.go�������������������������������������������������0000664�0000000�0000000�00000001413�13771713062�0043244�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetBlockStorageSnapshotInstanceListRequest struct { // 블록스토리지스냅샷인스턴스번호리스트 BlockStorageSnapshotInstanceNoList []*string `json:"blockStorageSnapshotInstanceNoList,omitempty"` // 원본블록스토리지인스턴스번호리스트 OriginalBlockStorageInstanceNoList []*string `json:"originalBlockStorageInstanceNoList,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_block_storage_snapshot_instance_list_response.go������������������������������������������������0000664�0000000�0000000�00000001120�13771713062�0043405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetBlockStorageSnapshotInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` BlockStorageSnapshotInstanceList []*BlockStorageSnapshotInstance `json:"blockStorageSnapshotInstanceList,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_instance_tag_list_request.go��������������������������������������������������������������������0000664�0000000�0000000�00000001166�13771713062�0037267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetInstanceTagListRequest struct { // 인스턴스번호리스트 InstanceNoList []*string `json:"instanceNoList,omitempty"` // 태그키리스트 TagKeyList []*string `json:"tagKeyList,omitempty"` // 태그값리스트 TagValueList []*string `json:"tagValueList,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_instance_tag_list_response.go�������������������������������������������������������������������0000664�0000000�0000000�00000001014�13771713062�0037425�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetInstanceTagListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` InstanceTagList []*InstanceTag `json:"instanceTagList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_login_key_list_request.go�����������������������������������������������������������������������0000664�0000000�0000000�00000000664�13771713062�0036612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetLoginKeyListRequest struct { // 키명 KeyName *string `json:"keyName,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` } ����������������������������������������������������������������������������get_login_key_list_response.go����������������������������������������������������������������������0000664�0000000�0000000�00000001000�13771713062�0036741�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetLoginKeyListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` LoginKeyList []*LoginKey `json:"loginKeyList,omitempty"` } get_member_server_image_list_request.go�������������������������������������������������������������0000664�0000000�0000000�00000001455�13771713062�0040630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetMemberServerImageListRequest struct { // 회원서버이미지번호리스트 MemberServerImageNoList []*string `json:"memberServerImageNoList,omitempty"` // 플랫폼타입코드리스트 PlatformTypeCodeList []*string `json:"platformTypeCodeList,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // 소팅대상 SortedBy *string `json:"sortedBy,omitempty"` // 소팅순서 SortingOrder *string `json:"sortingOrder,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_member_server_image_list_response.go������������������������������������������������������������0000664�0000000�0000000�00000001044�13771713062�0040770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetMemberServerImageListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` MemberServerImageList []*MemberServerImage `json:"memberServerImageList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_nas_volume_instance_list_request.go�������������������������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0040655�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetNasVolumeInstanceListRequest struct { // 볼륨할당프로토콜유형코드 VolumeAllotmentProtocolTypeCode *string `json:"volumeAllotmentProtocolTypeCode,omitempty"` // 이벤트설정여부 IsEventConfiguration *bool `json:"isEventConfiguration,omitempty"` // 스냅샷볼륨설정여부 IsSnapshotConfiguration *bool `json:"isSnapshotConfiguration,omitempty"` // NAS볼륨인스턴스번호리스트 NasVolumeInstanceNoList []*string `json:"nasVolumeInstanceNoList,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_nas_volume_instance_list_response.go������������������������������������������������������������0000664�0000000�0000000�00000001044�13771713062�0041025�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetNasVolumeInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceList []*NasVolumeInstance `json:"nasVolumeInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_nas_volume_instance_rating_list_request.go������������������������������������������������������0000664�0000000�0000000�00000001020�13771713062�0042215�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetNasVolumeInstanceRatingListRequest struct { // 측정종료시간 EndTime *string `json:"endTime"` // 측정간격 Interval *string `json:"interval"` // NAS볼륨인스턴스번호 NasVolumeInstanceNo *string `json:"nasVolumeInstanceNo"` // 측정시작시간 StartTime *string `json:"startTime"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_nas_volume_instance_rating_list_response.go�����������������������������������������������������0000664�0000000�0000000�00000001074�13771713062�0042374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetNasVolumeInstanceRatingListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceRatingList []*NasVolumeInstanceRating `json:"nasVolumeInstanceRatingList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_network_interface_list_request.go���������������������������������������������������������������0000664�0000000�0000000�00000000775�13771713062�0040346�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetNetworkInterfaceListRequest struct { // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` } ���get_network_interface_list_response.go��������������������������������������������������������������0000664�0000000�0000000�00000001040�13771713062�0040476�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetNetworkInterfaceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NetworkInterfaceList []*NetworkInterface `json:"networkInterfaceList,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_port_forwarding_rule_list_request.go������������������������������������������������������������0000664�0000000�0000000�00000000744�13771713062�0041066�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPortForwardingRuleListRequest struct { // 인터넷라인구분코드 InternetLineTypeCode *string `json:"internetLineTypeCode,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` } ����������������������������get_port_forwarding_rule_list_response.go�����������������������������������������������������������0000664�0000000�0000000�00000001373�13771713062�0041233�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPortForwardingRuleListResponse struct { // 포트포워딩설정번호 PortForwardingConfigurationNo *string `json:"portForwardingConfigurationNo,omitempty"` // 포트포워딩공인IP PortForwardingPublicIp *string `json:"portForwardingPublicIp,omitempty"` // ZONE객체 Zone *Zone `json:"zone,omitempty"` // 인터넷라인구분 InternetLineType *CommonCode `json:"internetLineType,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PortForwardingRuleList []*PortForwardingRule `json:"portForwardingRuleList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_private_subnet_instance_list_request.go���������������������������������������������������������0000664�0000000�0000000�00000000711�13771713062�0041541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPrivateSubnetInstanceListRequest struct { // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` } �������������������������������������������������������get_private_subnet_instance_list_response.go��������������������������������������������������������0000664�0000000�0000000�00000001064�13771713062�0041711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPrivateSubnetInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PrivateSubnetInstanceList []*PrivateSubnetInstance `json:"privateSubnetInstanceList,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_public_ip_instance_list_request.go��������������������������������������������������������������0000664�0000000�0000000�00000002234�13771713062�0040457�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPublicIpInstanceListRequest struct { // 할당여부 IsAssociated *bool `json:"isAssociated,omitempty"` // 공인IP인스턴스번호리스트 PublicIpInstanceNoList []*string `json:"publicIpInstanceNoList,omitempty"` // 공인IP리스트 PublicIpList []*string `json:"publicIpList,omitempty"` // 검색할필터명 SearchFilterName *string `json:"searchFilterName,omitempty"` // 검색할필터값 SearchFilterValue *string `json:"searchFilterValue,omitempty"` // 인터넷라인구분코드 InternetLineTypeCode *string `json:"internetLineTypeCode,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` // 소팅대상 SortedBy *string `json:"sortedBy,omitempty"` // 소팅순서 SortingOrder *string `json:"sortingOrder,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_public_ip_instance_list_response.go�������������������������������������������������������������0000664�0000000�0000000�00000001040�13771713062�0040617�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPublicIpInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` PublicIpInstanceList []*PublicIpInstance `json:"publicIpInstanceList,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_public_ip_target_server_instance_list_request.go������������������������������������������������0000664�0000000�0000000�00000000756�13771713062�0043422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPublicIpTargetServerInstanceListRequest struct { // 인터넷라인구분코드 InternetLineTypeCode *string `json:"internetLineTypeCode,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` } ������������������get_public_ip_target_server_instance_list_response.go�����������������������������������������������0000664�0000000�0000000�00000001046�13771713062�0043561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetPublicIpTargetServerInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_raid_list_request.go����������������������������������������������������������������������������0000664�0000000�0000000�00000000370�13771713062�0035543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetRaidListRequest struct { } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_raid_list_response.go���������������������������������������������������������������������������0000664�0000000�0000000�00000000760�13771713062�0035714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetRaidListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` RaidList []*Raid `json:"raidList,omitempty"` } ����������������get_region_list_request.go��������������������������������������������������������������������������0000664�0000000�0000000�00000000372�13771713062�0036111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetRegionListRequest struct { } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_region_list_response.go�������������������������������������������������������������������������0000664�0000000�0000000�00000000770�13771713062�0036261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetRegionListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` RegionList []*Region `json:"regionList,omitempty"` } ��������get_root_password_request.go������������������������������������������������������������������������0000664�0000000�0000000�00000000615�13771713062�0036500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetRootPasswordRequest struct { // 개인키 PrivateKey *string `json:"privateKey,omitempty"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` } �������������������������������������������������������������������������������������������������������������������get_root_password_response.go�����������������������������������������������������������������������0000664�0000000�0000000�00000000774�13771713062�0036654�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetRootPasswordResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` RootPassword *string `json:"rootPassword,omitempty"` } ����get_server_image_product_list_request.go������������������������������������������������������������0000664�0000000�0000000�00000001465�13771713062�0041042�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetServerImageProductListRequest struct { // 제외할상품코드 ExclusionProductCode *string `json:"exclusionProductCode,omitempty"` // 조회할상품코드 ProductCode *string `json:"productCode,omitempty"` // 플랫폼유형코드리스트 PlatformTypeCodeList []*string `json:"platformTypeCodeList,omitempty"` // 블록스토리지사이즈 BlockStorageSize *int32 `json:"blockStorageSize,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // 인프라자원상세구분코드 InfraResourceDetailTypeCode *string `json:"infraResourceDetailTypeCode,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_server_image_product_list_response.go�����������������������������������������������������������0000664�0000000�0000000�00000001007�13771713062�0041200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetServerImageProductListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` ProductList []*Product `json:"productList,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_server_instance_list_request.go�����������������������������������������������������������������0000664�0000000�0000000�00000003204�13771713062�0040015�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetServerInstanceListRequest struct { // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList,omitempty"` // 검색필터명 SearchFilterName *string `json:"searchFilterName,omitempty"` // 검색필터값 SearchFilterValue *string `json:"searchFilterValue,omitempty"` // 페이지번호 PageNo *int32 `json:"pageNo,omitempty"` // 페이지사이즈 PageSize *int32 `json:"pageSize,omitempty"` // 서버인스턴스상태코드 ServerInstanceStatusCode *string `json:"serverInstanceStatusCode,omitempty"` // 인터넷라인구분코드 InternetLineTypeCode *string `json:"internetLineTypeCode,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // zone번호 ZoneNo *string `json:"zoneNo,omitempty"` // 서버디스크유형코드 BaseBlockStorageDiskTypeCode *string `json:"baseBlockStorageDiskTypeCode,omitempty"` // 서버디스크상세유형코드 BaseBlockStorageDiskDetailTypeCode *string `json:"baseBlockStorageDiskDetailTypeCode,omitempty"` // 소팅대상 SortedBy *string `json:"sortedBy,omitempty"` // 소팅순서 SortingOrder *string `json:"sortingOrder,omitempty"` // 서비인스턴스구분코드리스트 ServerInstanceTypeCodeList []*string `json:"serverInstanceTypeCodeList,omitempty"` // 태그키리스트 TagKeyList []*string `json:"tagKeyList,omitempty"` // 태그값리스트 TagValueList []*string `json:"tagValueList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_server_instance_list_response.go����������������������������������������������������������������0000664�0000000�0000000�00000001030�13771713062�0040156�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetServerInstanceListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_server_product_list_request.go������������������������������������������������������������������0000664�0000000�0000000�00000001355�13771713062�0037676�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetServerProductListRequest struct { // 제외할상품코드 ExclusionProductCode *string `json:"exclusionProductCode,omitempty"` // 인터넷라인구분코드 InternetLineTypeCode *string `json:"internetLineTypeCode,omitempty"` // 조회할상품코드 ProductCode *string `json:"productCode,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` // 서버이미지상품코드 ServerImageProductCode *string `json:"serverImageProductCode"` // ZONE번호 ZoneNo *string `json:"zoneNo,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_server_product_list_response.go�����������������������������������������������������������������0000664�0000000�0000000�00000001002�13771713062�0040031�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetServerProductListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` ProductList []*Product `json:"productList,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_zone_list_request.go����������������������������������������������������������������������������0000664�0000000�0000000�00000000467�13771713062�0035606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetZoneListRequest struct { // 리전번호 RegionNo *string `json:"regionNo,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_zone_list_response.go���������������������������������������������������������������������������0000664�0000000�0000000�00000000701�13771713062�0035743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type GetZoneListResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` ZoneList []*Zone `json:"zoneList,omitempty"` } ���������������������������������������������������������������import_login_key_request.go�������������������������������������������������������������������������0000664�0000000�0000000�00000000534�13771713062�0036306�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type ImportLoginKeyRequest struct { // 키명 KeyName *string `json:"keyName"` // 공개키 PublicKey *string `json:"publicKey"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������import_login_key_response.go������������������������������������������������������������������������0000664�0000000�0000000�00000000777�13771713062�0036465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type ImportLoginKeyResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` LoginKeyList []*LoginKey `json:"loginKeyList,omitempty"` } �instance_tag.go�������������������������������������������������������������������������������������0000664�0000000�0000000�00000000777�13771713062�0033634�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type InstanceTag struct { // 인스턴스번호 InstanceNo *string `json:"instanceNo,omitempty"` // 인스턴스유형 InstanceType *CommonCode `json:"instanceType,omitempty"` // 태그키 TagKey *string `json:"tagKey,omitempty"` // 태그값 TagValue *string `json:"tagValue,omitempty"` } �instance_tag_parameter.go���������������������������������������������������������������������������0000664�0000000�0000000�00000000556�13771713062�0035667�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type InstanceTagParameter struct { // 태그키 TagKey *string `json:"tagKey,omitempty"` // 태그값 TagValue *string `json:"tagValue,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/login_key.go�0000664�0000000�0000000�00000000660�13771713062�0033223�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type LoginKey struct { // 핑거프린트 Fingerprint *string `json:"fingerprint,omitempty"` // 키명 KeyName *string `json:"keyName,omitempty"` // 생성일자 CreateDate *string `json:"createDate,omitempty"` } ��������������������������������������������������������������������������������member_server_image.go������������������������������������������������������������������������������0000664�0000000�0000000�00000004405�13771713062�0035164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type MemberServerImage struct { // 회원서버이미지번호 MemberServerImageNo *string `json:"memberServerImageNo,omitempty"` // 회원서버이미지명 MemberServerImageName *string `json:"memberServerImageName,omitempty"` // 회원서버이미지설명 MemberServerImageDescription *string `json:"memberServerImageDescription,omitempty"` // 원본서버인스턴스번호 OriginalServerInstanceNo *string `json:"originalServerInstanceNo,omitempty"` // 원본서버상품코드 OriginalServerProductCode *string `json:"originalServerProductCode,omitempty"` // 원본서버명 OriginalServerName *string `json:"originalServerName,omitempty"` // 원본서버기본블록스토리지디스크유형 OriginalBaseBlockStorageDiskType *CommonCode `json:"originalBaseBlockStorageDiskType,omitempty"` // 원본서버이미지상품코드 OriginalServerImageProductCode *string `json:"originalServerImageProductCode,omitempty"` // 원본OS정보 OriginalOsInformation *string `json:"originalOsInformation,omitempty"` // 원본서버이미지명 OriginalServerImageName *string `json:"originalServerImageName,omitempty"` // 원본서버이미지상태명 MemberServerImageStatusName *string `json:"memberServerImageStatusName,omitempty"` // 원본서버이미지상태 MemberServerImageStatus *CommonCode `json:"memberServerImageStatus,omitempty"` // 원본서버이미지OP MemberServerImageOperation *CommonCode `json:"memberServerImageOperation,omitempty"` // 회원서버이미지플랫폼구분 MemberServerImagePlatformType *CommonCode `json:"memberServerImagePlatformType,omitempty"` // 리전 Region *Region `json:"region,omitempty"` // ZONE Zone *Zone `json:"zone,omitempty"` // 생성일시 CreateDate *string `json:"createDate,omitempty"` // 회원서버이미지블록스토리지인스턴스총 개수 MemberServerImageBlockStorageTotalRows *int32 `json:"memberServerImageBlockStorageTotalRows,omitempty"` // 회원서버이미지총사이즈 MemberServerImageBlockStorageTotalSize *int64 `json:"memberServerImageBlockStorageTotalSize,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������nas_volume_instance.go������������������������������������������������������������������������������0000664�0000000�0000000�00000005171�13771713062�0035222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type NasVolumeInstance struct { // NAS볼륨인스턴스번호 NasVolumeInstanceNo *string `json:"nasVolumeInstanceNo,omitempty"` // NAS볼륨인스턴스상태 NasVolumeInstanceStatus *CommonCode `json:"nasVolumeInstanceStatus,omitempty"` // NAS볼륨인스턴스OP NasVolumeInstanceOperation *CommonCode `json:"nasVolumeInstanceOperation,omitempty"` // 볼륨인스턴스상태명 NasVolumeInstanceStatusName *string `json:"nasVolumeInstanceStatusName,omitempty"` // 생성일시 CreateDate *string `json:"createDate,omitempty"` // NAS볼륨인스턴스설명 NasVolumeInstanceDescription *string `json:"nasVolumeInstanceDescription,omitempty"` // 마운트정보 MountInformation *string `json:"mountInformation,omitempty"` // 볼륨할당프로토콜구분 VolumeAllotmentProtocolType *CommonCode `json:"volumeAllotmentProtocolType,omitempty"` // 볼륨명 VolumeName *string `json:"volumeName,omitempty"` // 볼륨총사이즈 VolumeTotalSize *int64 `json:"volumeTotalSize,omitempty"` // 볼륨사이즈 VolumeSize *int64 `json:"volumeSize,omitempty"` // 볼륨사용사이즈 VolumeUseSize *int64 `json:"volumeUseSize,omitempty"` // 볼륨사용비율 VolumeUseRatio *float32 `json:"volumeUseRatio,omitempty"` // 스냅샷볼륨설정비율 SnapshotVolumeConfigurationRatio *float32 `json:"snapshotVolumeConfigurationRatio,omitempty"` // 스냅샷볼륨설정기간구분 SnapshotVolumeConfigPeriodType *CommonCode `json:"snapshotVolumeConfigPeriodType,omitempty"` // 스냅샷볼륨설정시간 SnapshotVolumeConfigTime *int32 `json:"snapshotVolumeConfigTime,omitempty"` // 스냅샷사이즈 SnapshotVolumeSize *int64 `json:"snapshotVolumeSize,omitempty"` // 스냅사용사이즈 SnapshotVolumeUseSize *int64 `json:"snapshotVolumeUseSize,omitempty"` // 스냅샷사용비율 SnapshotVolumeUseRatio *float32 `json:"snapshotVolumeUseRatio,omitempty"` // 스냅샷설정여부 IsSnapshotConfiguration *bool `json:"isSnapshotConfiguration,omitempty"` // 이벤트설정여부 IsEventConfiguration *bool `json:"isEventConfiguration,omitempty"` // 리전 Region *Region `json:"region,omitempty"` // ZONE Zone *Zone `json:"zone,omitempty"` // NAS볼륨커스텀IP리스트 NasVolumeInstanceCustomIpList []*NasVolumeInstanceCustomIp `json:"nasVolumeInstanceCustomIpList,omitempty"` // NAS볼륨서버인스턴스리스트 NasVolumeServerInstanceList []*ServerInstance `json:"nasVolumeServerInstanceList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������nas_volume_instance_custom_ip.go��������������������������������������������������������������������0000664�0000000�0000000�00000000475�13771713062�0037306�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type NasVolumeInstanceCustomIp struct { // 커스텀IP CustomIp *string `json:"customIp,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������nas_volume_instance_rating.go�����������������������������������������������������������������������0000664�0000000�0000000�00000004476�13771713062�0036575�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type NasVolumeInstanceRating struct { // 측정시간 RatingTime *string `json:"ratingTime,omitempty"` // 볼륨사이즈 VolumeSize *int64 `json:"volumeSize,omitempty"` // 볼륨사용사이즈 VolumeUseSize *int64 `json:"volumeUseSize,omitempty"` // 볼륨사용비율 VolumeUseRatio *float32 `json:"volumeUseRatio,omitempty"` // 평균볼륨사이즈 AverageVolumeSize *int64 `json:"averageVolumeSize,omitempty"` // 평균볼륨사용사이즈 AverageVolumeUseSize *int64 `json:"averageVolumeUseSize,omitempty"` // 평균볼륨사용비율 AverageVolumeUseRatio *float32 `json:"averageVolumeUseRatio,omitempty"` // 최대볼륨사용사이즈 MaxVolumeUseSize *int64 `json:"maxVolumeUseSize,omitempty"` // 최대볼륨사용비율 MaxVolumeUseRatio *float32 `json:"maxVolumeUseRatio,omitempty"` // 최소볼륨사용사이즈 MinVolumeUseSize *int64 `json:"minVolumeUseSize,omitempty"` // 최소볼륨사용비율 MinVolumeUseRatio *float32 `json:"minVolumeUseRatio,omitempty"` // 스냅샷볼륨사이즈 SnapshotVolumeSize *int64 `json:"snapshotVolumeSize,omitempty"` // 스냅샷볼륨사용사이즈 SnapshotVolumeUseSize *int64 `json:"snapshotVolumeUseSize,omitempty"` // 스냅샷볼륨사용비율 SnapshotVolumeUseRatio *float32 `json:"snapshotVolumeUseRatio,omitempty"` // 평균스냅샷볼륨사이즈 SnapshotAverageVolumeSize *int64 `json:"snapshotAverageVolumeSize,omitempty"` // 평균스냅샷볼륨사용사이즈 SnapshotAverageVolumeUseSize *int64 `json:"snapshotAverageVolumeUseSize,omitempty"` // 평균스냅샷볼륨사용비율 SnapshotAverageVolumeUseRatio *float32 `json:"snapshotAverageVolumeUseRatio,omitempty"` // 최대스냅샷볼륨사용사이즈 SnapshotMaxVolumeUseSize *int64 `json:"snapshotMaxVolumeUseSize,omitempty"` // 최대스냅샷볼륨사용비율 SnapshotMaxVolumeUseRatio *float32 `json:"snapshotMaxVolumeUseRatio,omitempty"` // 최소스냅샷볼륨사용사이즈 SnapshotMinVolumeUseSize *int64 `json:"snapshotMinVolumeUseSize,omitempty"` // 최소스냅샷볼륨사용비율 SnapshotMinVolumeUseRatio *float32 `json:"snapshotMinVolumeUseRatio,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������network_interface.go��������������������������������������������������������������������������������0000664�0000000�0000000�00000001602�13771713062�0034672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type NetworkInterface struct { // Network Interface번호 NetworkInterfaceNo *string `json:"networkInterfaceNo,omitempty"` // Network Interface이름 NetworkInterfaceName *string `json:"networkInterfaceName,omitempty"` // Network Interface IP NetworkInterfaceIp *string `json:"networkInterfaceIp,omitempty"` // Network Interface 설명 NetworkInterfaceDescription *string `json:"networkInterfaceDescription,omitempty"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo,omitempty"` // 상태코드 StatusCode *string `json:"statusCode,omitempty"` // 리전 Region *Region `json:"region,omitempty"` // ZONE Zone *Zone `json:"zone,omitempty"` } ������������������������������������������������������������������������������������������������������������������������������port_forwarding_rule.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000001063�13771713062�0035417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type PortForwardingRule struct { // 포트포워딩외부포트 PortForwardingExternalPort *int32 `json:"portForwardingExternalPort,omitempty"` // 포트포워딩내부포트 PortForwardingInternalPort *int32 `json:"portForwardingInternalPort,omitempty"` // 서버인스턴스 ServerInstance *ServerInstance `json:"serverInstance,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������port_forwarding_rule_parameter.go�������������������������������������������������������������������0000664�0000000�0000000�00000001040�13771713062�0037452�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type PortForwardingRuleParameter struct { // 포트포워딩외부포트 PortForwardingExternalPort *int32 `json:"portForwardingExternalPort"` // 포트포워딩내부포트 PortForwardingInternalPort *int32 `json:"portForwardingInternalPort"` // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������private_subnet_instance.go��������������������������������������������������������������������������0000664�0000000�0000000�00000002034�13771713062�0036077�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type PrivateSubnetInstance struct { // Private Subnet인스턴스번호 PrivateSubnetInstanceNo *string `json:"privateSubnetInstanceNo,omitempty"` // 서브넷 Subnet *string `json:"subnet,omitempty"` // Private Subnet설명 PrivateSubnetDescription *string `json:"privateSubnetDescription,omitempty"` // 생성일시 CreateDate *string `json:"createDate,omitempty"` // Private Subnet인스턴스상태 PrivateSubnetInstanceStatus *CommonCode `json:"privateSubnetInstanceStatus,omitempty"` // Private Subnet OP PrivateSubnetInstanceOperation *CommonCode `json:"privateSubnetInstanceOperation,omitempty"` // Private Subnet상태이름 PrivateSubnetInstanceStatusName *string `json:"privateSubnetInstanceStatusName,omitempty"` // 리전 Region *Region `json:"region,omitempty"` // ZONE Zone *Zone `json:"zone,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/product.go���0000664�0000000�0000000�00000002520�13771713062�0032720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type Product struct { // 상품코드 ProductCode *string `json:"productCode,omitempty"` // 상품명 ProductName *string `json:"productName,omitempty"` // 상품유형 ProductType *CommonCode `json:"productType,omitempty"` // 상품설명 ProductDescription *string `json:"productDescription,omitempty"` // 인프라자원구분 InfraResourceType *CommonCode `json:"infraResourceType,omitempty"` // 인프라자원상세구분 InfraResourceDetailType *CommonCode `json:"infraResourceDetailType,omitempty"` // CPU수 CpuCount *int32 `json:"cpuCount,omitempty"` // 메모리사이즈 MemorySize *int64 `json:"memorySize,omitempty"` // 기본블록스토리지사이즈 BaseBlockStorageSize *int64 `json:"baseBlockStorageSize,omitempty"` // 플랫폼구분 PlatformType *CommonCode `json:"platformType,omitempty"` // OS정보 OsInformation *string `json:"osInformation,omitempty"` // 디스크유형 DiskType *CommonCode `json:"diskType,omitempty"` // DB유형코드 DbKindCode *string `json:"dbKindCode,omitempty"` // 추가블록스토리지사이즈 AddBlockStorageSize *int64 `json:"addBlockStorageSize,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������public_ip_instance.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000002453�13771713062�0035020�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type PublicIpInstance struct { // 공인IP인스턴스번호 PublicIpInstanceNo *string `json:"publicIpInstanceNo,omitempty"` // 공인IP PublicIp *string `json:"publicIp,omitempty"` // 공인IP설명 PublicIpDescription *string `json:"publicIpDescription,omitempty"` // 생성일시 CreateDate *string `json:"createDate,omitempty"` // 인터넷라인구분 InternetLineType *CommonCode `json:"internetLineType,omitempty"` // 공인IP인스턴스상태명 PublicIpInstanceStatusName *string `json:"publicIpInstanceStatusName,omitempty"` // 공인IP인스턴스상태 PublicIpInstanceStatus *CommonCode `json:"publicIpInstanceStatus,omitempty"` // 공인IP인스턴스OP PublicIpInstanceOperation *CommonCode `json:"publicIpInstanceOperation,omitempty"` // 공인IP종류구분 PublicIpKindType *CommonCode `json:"publicIpKindType,omitempty"` // 공인IP할당된서버인스턴스 ServerInstanceAssociatedWithPublicIp *ServerInstance `json:"serverInstanceAssociatedWithPublicIp,omitempty"` // 리전 Region *Region `json:"region,omitempty"` // ZONE Zone *Zone `json:"zone,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/raid.go������0000664�0000000�0000000�00000000562�13771713062�0032163�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type Raid struct { // RAID구분이름 RaidTypeName *string `json:"raidTypeName,omitempty"` // RAID이름 RaidName *string `json:"raidName,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������reboot_server_instances_request.go������������������������������������������������������������������0000664�0000000�0000000�00000000546�13771713062�0037666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type RebootServerInstancesRequest struct { // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������reboot_server_instances_response.go�����������������������������������������������������������������0000664�0000000�0000000�00000001030�13771713062�0040021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type RebootServerInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������recreate_server_instance_request.go�����������������������������������������������������������������0000664�0000000�0000000�00000001330�13771713062�0037773�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type RecreateServerInstanceRequest struct { // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo,omitempty"` // 서버인스턴스이름 ServerInstanceName *string `json:"serverInstanceName,omitempty"` // 서버이미지상품코드 ServerImageProductCode *string `json:"serverImageProductCode,omitempty"` // 사용자데이터 UserData *string `json:"userData,omitempty"` // 인스턴스태그리스트 InstanceTagList []*InstanceTagParameter `json:"instanceTagList,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������recreate_server_instance_response.go����������������������������������������������������������������0000664�0000000�0000000�00000001031�13771713062�0040137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type RecreateServerInstanceResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/region.go����0000664�0000000�0000000�00000000576�13771713062�0032534�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type Region struct { RegionNo *string `json:"regionNo,omitempty"` RegionCode *string `json:"regionCode,omitempty"` RegionName *string `json:"regionName,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������remove_nas_volume_access_control_request.go���������������������������������������������������������0000664�0000000�0000000�00000001042�13771713062�0041535�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type RemoveNasVolumeAccessControlRequest struct { // NAS볼륨인스턴스번호 NasVolumeInstanceNo *string `json:"nasVolumeInstanceNo"` // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList,omitempty"` // 커스텀IP리스트 CustomIpList []*string `json:"customIpList,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������remove_nas_volume_access_control_response.go��������������������������������������������������������0000664�0000000�0000000�00000001050�13771713062�0041702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type RemoveNasVolumeAccessControlResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceList []*NasVolumeInstance `json:"nasVolumeInstanceList,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������server_instance.go����������������������������������������������������������������������������������0000664�0000000�0000000�00000005776�13771713062�0034373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type ServerInstance struct { // 서버인스턴스번호 ServerInstanceNo *string `json:"serverInstanceNo,omitempty"` // 서버명 ServerName *string `json:"serverName,omitempty"` // 서버설명 ServerDescription *string `json:"serverDescription,omitempty"` // CPU수 CpuCount *int32 `json:"cpuCount,omitempty"` // 메모리사이즈 MemorySize *int64 `json:"memorySize,omitempty"` // 기본블럭스토리지사이즈 BaseBlockStorageSize *int64 `json:"baseBlockStorageSize,omitempty"` // 플랫폼구분 PlatformType *CommonCode `json:"platformType,omitempty"` // 로그인키명 LoginKeyName *string `json:"loginKeyName,omitempty"` // 유료모니터링여부 IsFeeChargingMonitoring *bool `json:"isFeeChargingMonitoring,omitempty"` // 공인IP PublicIp *string `json:"publicIp,omitempty"` // 사설IP PrivateIp *string `json:"privateIp,omitempty"` // 서버이미지명 ServerImageName *string `json:"serverImageName,omitempty"` // 서버인스턴스상태 ServerInstanceStatus *CommonCode `json:"serverInstanceStatus,omitempty"` // 서버인스턴스OP ServerInstanceOperation *CommonCode `json:"serverInstanceOperation,omitempty"` // 서버인스턴스상태명 ServerInstanceStatusName *string `json:"serverInstanceStatusName,omitempty"` // 생성일자 CreateDate *string `json:"createDate,omitempty"` // UPTIME Uptime *string `json:"uptime,omitempty"` // 서버이미지상품코드 ServerImageProductCode *string `json:"serverImageProductCode,omitempty"` // 서버상품코드 ServerProductCode *string `json:"serverProductCode,omitempty"` // 반납보호여부 IsProtectServerTermination *bool `json:"isProtectServerTermination,omitempty"` // portForwarding 공인 Ip PortForwardingPublicIp *string `json:"portForwardingPublicIp,omitempty"` // portForwarding 외부 포트 PortForwardingExternalPort *int32 `json:"portForwardingExternalPort,omitempty"` // portForwarding 내부 포트 PortForwardingInternalPort *int32 `json:"portForwardingInternalPort,omitempty"` // Zone Zone *Zone `json:"zone,omitempty"` // 리전 Region *Region `json:"region,omitempty"` // 기본블록스토리지디스크유형 BaseBlockStorageDiskType *CommonCode `json:"baseBlockStorageDiskType,omitempty"` // 기본블록스토리지디스크상세유형 BaseBlockStroageDiskDetailType *CommonCode `json:"baseBlockStroageDiskDetailType,omitempty"` // 인터넷라인구분 InternetLineType *CommonCode `json:"internetLineType,omitempty"` // 서버인스턴스구분 ServerInstanceType *CommonCode `json:"serverInstanceType,omitempty"` // 사용자데이타 UserData *string `json:"userData,omitempty"` // ACG리스트 AccessControlGroupList []*AccessControlGroup `json:"accessControlGroupList,omitempty"` // 인스턴스태그리스트 InstanceTagList []*InstanceTag `json:"instanceTagList,omitempty"` } ��set_nas_volume_access_control_request.go������������������������������������������������������������0000664�0000000�0000000�00000001037�13771713062�0041037�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type SetNasVolumeAccessControlRequest struct { // NAS볼륨인스턴스번호 NasVolumeInstanceNo *string `json:"nasVolumeInstanceNo"` // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList,omitempty"` // 커스텀IP리스트 CustomIpList []*string `json:"customIpList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������set_nas_volume_access_control_response.go�����������������������������������������������������������0000664�0000000�0000000�00000001045�13771713062�0041204�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type SetNasVolumeAccessControlResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` NasVolumeInstanceList []*NasVolumeInstance `json:"nasVolumeInstanceList,omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������start_server_instances_request.go�������������������������������������������������������������������0000664�0000000�0000000�00000000545�13771713062�0037530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type StartServerInstancesRequest struct { // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������start_server_instances_response.go������������������������������������������������������������������0000664�0000000�0000000�00000001027�13771713062�0037672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type StartServerInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������stop_server_instances_request.go��������������������������������������������������������������������0000664�0000000�0000000�00000000544�13771713062�0037357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type StopServerInstancesRequest struct { // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������stop_server_instances_response.go�������������������������������������������������������������������0000664�0000000�0000000�00000001026�13771713062�0037521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type StopServerInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������terminate_server_instances_request.go���������������������������������������������������������������0000664�0000000�0000000�00000000551�13771713062�0040360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type TerminateServerInstancesRequest struct { // 서버인스턴스번호리스트 ServerInstanceNoList []*string `json:"serverInstanceNoList"` } �������������������������������������������������������������������������������������������������������������������������������������������������������terminate_server_instances_response.go��������������������������������������������������������������0000664�0000000�0000000�00000001033�13771713062�0040522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server���������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type TerminateServerInstancesResponse struct { RequestId *string `json:"requestId,omitempty"` ReturnCode *string `json:"returnCode,omitempty"` ReturnMessage *string `json:"returnMessage,omitempty"` TotalRows *int32 `json:"totalRows,omitempty"` ServerInstanceList []*ServerInstance `json:"serverInstanceList,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/v2_api.go����0000664�0000000�0000000�00000456714�13771713062�0032442�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server import ( "encoding/base64" "encoding/json" "io/ioutil" "net/url" "reflect" "strings" "bytes" "golang.org/x/net/context" ) // Linger please var ( _ context.Context ) type V2ApiService service /* V2ApiService NAS볼륨인스턴스접근제어추가 @param addNasVolumeAccessControlRequest addNasVolumeAccessControlRequest @return *AddNasVolumeAccessControlResponse*/ func (a *V2ApiService) AddNasVolumeAccessControl(addNasVolumeAccessControlRequest *AddNasVolumeAccessControlRequest) (*AddNasVolumeAccessControlResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload AddNasVolumeAccessControlResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/addNasVolumeAccessControl" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = addNasVolumeAccessControlRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 포트포워딩Rule추가 @param addPortForwardingRulesRequest addPortForwardingRulesRequest @return *AddPortForwardingRulesResponse*/ func (a *V2ApiService) AddPortForwardingRules(addPortForwardingRulesRequest *AddPortForwardingRulesRequest) (*AddPortForwardingRulesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload AddPortForwardingRulesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/addPortForwardingRules" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = addPortForwardingRulesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 공인IP를서버인스턴스에할당 @param associatePublicIpWithServerInstanceRequest associatePublicIpWithServerInstanceRequest @return *AssociatePublicIpWithServerInstanceResponse*/ func (a *V2ApiService) AssociatePublicIpWithServerInstance(associatePublicIpWithServerInstanceRequest *AssociatePublicIpWithServerInstanceRequest) (*AssociatePublicIpWithServerInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload AssociatePublicIpWithServerInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/associatePublicIpWithServerInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = associatePublicIpWithServerInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지인스턴스할당 @param attachBlockStorageInstanceRequest attachBlockStorageInstanceRequest @return *AttachBlockStorageInstanceResponse*/ func (a *V2ApiService) AttachBlockStorageInstance(attachBlockStorageInstanceRequest *AttachBlockStorageInstanceRequest) (*AttachBlockStorageInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload AttachBlockStorageInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/attachBlockStorageInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = attachBlockStorageInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService Network Interface Attach @param attachNetworkInterfaceRequest attachNetworkInterfaceRequest @return *AttachNetworkInterfaceResponse*/ func (a *V2ApiService) AttachNetworkInterface(attachNetworkInterfaceRequest *AttachNetworkInterfaceRequest) (*AttachNetworkInterfaceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload AttachNetworkInterfaceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/attachNetworkInterface" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = attachNetworkInterfaceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService NAS볼륨사이즈변경 @param changeNasVolumeSizeRequest changeNasVolumeSizeRequest @return *ChangeNasVolumeSizeResponse*/ func (a *V2ApiService) ChangeNasVolumeSize(changeNasVolumeSizeRequest *ChangeNasVolumeSizeRequest) (*ChangeNasVolumeSizeResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload ChangeNasVolumeSizeResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/changeNasVolumeSize" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = changeNasVolumeSizeRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스스팩변경 @param changeServerInstanceSpecRequest changeServerInstanceSpecRequest @return *ChangeServerInstanceSpecResponse*/ func (a *V2ApiService) ChangeServerInstanceSpec(changeServerInstanceSpecRequest *ChangeServerInstanceSpecRequest) (*ChangeServerInstanceSpecResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload ChangeServerInstanceSpecResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/changeServerInstanceSpec" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = changeServerInstanceSpecRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지인스턴스생성 @param createBlockStorageInstanceRequest createBlockStorageInstanceRequest @return *CreateBlockStorageInstanceResponse*/ func (a *V2ApiService) CreateBlockStorageInstance(createBlockStorageInstanceRequest *CreateBlockStorageInstanceRequest) (*CreateBlockStorageInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateBlockStorageInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createBlockStorageInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createBlockStorageInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지스냅샷인스턴스생성 @param createBlockStorageSnapshotInstanceRequest createBlockStorageSnapshotInstanceRequest @return *CreateBlockStorageSnapshotInstanceResponse*/ func (a *V2ApiService) CreateBlockStorageSnapshotInstance(createBlockStorageSnapshotInstanceRequest *CreateBlockStorageSnapshotInstanceRequest) (*CreateBlockStorageSnapshotInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateBlockStorageSnapshotInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createBlockStorageSnapshotInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createBlockStorageSnapshotInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 인스턴스태그생성 @param createInstanceTagsRequest createInstanceTagsRequest @return *CreateInstanceTagsResponse*/ func (a *V2ApiService) CreateInstanceTags(createInstanceTagsRequest *CreateInstanceTagsRequest) (*CreateInstanceTagsResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateInstanceTagsResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createInstanceTags" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createInstanceTagsRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 로그인키생성 @param createLoginKeyRequest createLoginKeyRequest @return *CreateLoginKeyResponse*/ func (a *V2ApiService) CreateLoginKey(createLoginKeyRequest *CreateLoginKeyRequest) (*CreateLoginKeyResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateLoginKeyResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createLoginKey" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createLoginKeyRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 회원서버이미지생성 @param createMemberServerImageRequest createMemberServerImageRequest @return *CreateMemberServerImageResponse*/ func (a *V2ApiService) CreateMemberServerImage(createMemberServerImageRequest *CreateMemberServerImageRequest) (*CreateMemberServerImageResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateMemberServerImageResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createMemberServerImage" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createMemberServerImageRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService NAS볼륨인스턴스생성 @param createNasVolumeInstanceRequest createNasVolumeInstanceRequest @return *CreateNasVolumeInstanceResponse*/ func (a *V2ApiService) CreateNasVolumeInstance(createNasVolumeInstanceRequest *CreateNasVolumeInstanceRequest) (*CreateNasVolumeInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateNasVolumeInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createNasVolumeInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createNasVolumeInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService Network Interface 생성 @param createNetworkInterfaceRequest createNetworkInterfaceRequest @return *CreateNetworkInterfaceResponse*/ func (a *V2ApiService) CreateNetworkInterface(createNetworkInterfaceRequest *CreateNetworkInterfaceRequest) (*CreateNetworkInterfaceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateNetworkInterfaceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createNetworkInterface" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createNetworkInterfaceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 공인IP인스턴스생성 @param createPublicIpInstanceRequest createPublicIpInstanceRequest @return *CreatePublicIpInstanceResponse*/ func (a *V2ApiService) CreatePublicIpInstance(createPublicIpInstanceRequest *CreatePublicIpInstanceRequest) (*CreatePublicIpInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreatePublicIpInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createPublicIpInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createPublicIpInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스생성 @param createServerInstancesRequest createServerInstancesRequest @return *CreateServerInstancesResponse*/ func (a *V2ApiService) CreateServerInstances(createServerInstancesRequest *CreateServerInstancesRequest) (*CreateServerInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload CreateServerInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/createServerInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = createServerInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지인스턴스삭제 @param deleteBlockStorageInstancesRequest deleteBlockStorageInstancesRequest @return *DeleteBlockStorageInstancesResponse*/ func (a *V2ApiService) DeleteBlockStorageInstances(deleteBlockStorageInstancesRequest *DeleteBlockStorageInstancesRequest) (*DeleteBlockStorageInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeleteBlockStorageInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deleteBlockStorageInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deleteBlockStorageInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지스냅샷인스턴스삭제 @param deleteBlockStorageSnapshotInstancesRequest deleteBlockStorageSnapshotInstancesRequest @return *DeleteBlockStorageSnapshotInstancesResponse*/ func (a *V2ApiService) DeleteBlockStorageSnapshotInstances(deleteBlockStorageSnapshotInstancesRequest *DeleteBlockStorageSnapshotInstancesRequest) (*DeleteBlockStorageSnapshotInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeleteBlockStorageSnapshotInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deleteBlockStorageSnapshotInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deleteBlockStorageSnapshotInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 인스턴스태그삭제 @param deleteInstanceTagsRequest deleteInstanceTagsRequest @return *DeleteInstanceTagsResponse*/ func (a *V2ApiService) DeleteInstanceTags(deleteInstanceTagsRequest *DeleteInstanceTagsRequest) (*DeleteInstanceTagsResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeleteInstanceTagsResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deleteInstanceTags" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deleteInstanceTagsRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 로그인키삭제 @param deleteLoginKeyRequest deleteLoginKeyRequest @return *DeleteLoginKeyResponse*/ func (a *V2ApiService) DeleteLoginKey(deleteLoginKeyRequest *DeleteLoginKeyRequest) (*DeleteLoginKeyResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeleteLoginKeyResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deleteLoginKey" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deleteLoginKeyRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 회원서버이미지삭제 @param deleteMemberServerImagesRequest deleteMemberServerImagesRequest @return *DeleteMemberServerImagesResponse*/ func (a *V2ApiService) DeleteMemberServerImages(deleteMemberServerImagesRequest *DeleteMemberServerImagesRequest) (*DeleteMemberServerImagesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeleteMemberServerImagesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deleteMemberServerImages" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deleteMemberServerImagesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService NAS볼륨인스턴스삭제 @param deleteNasVolumeInstanceRequest deleteNasVolumeInstanceRequest @return *DeleteNasVolumeInstanceResponse*/ func (a *V2ApiService) DeleteNasVolumeInstance(deleteNasVolumeInstanceRequest *DeleteNasVolumeInstanceRequest) (*DeleteNasVolumeInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeleteNasVolumeInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deleteNasVolumeInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deleteNasVolumeInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService Network Interface 삭제 @param deleteNetworkInterfaceRequest deleteNetworkInterfaceRequest @return *DeleteNetworkInterfaceResponse*/ func (a *V2ApiService) DeleteNetworkInterface(deleteNetworkInterfaceRequest *DeleteNetworkInterfaceRequest) (*DeleteNetworkInterfaceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeleteNetworkInterfaceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deleteNetworkInterface" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deleteNetworkInterfaceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 포트포워딩Rule삭제 @param deletePortForwardingRulesRequest deletePortForwardingRulesRequest @return *DeletePortForwardingRulesResponse*/ func (a *V2ApiService) DeletePortForwardingRules(deletePortForwardingRulesRequest *DeletePortForwardingRulesRequest) (*DeletePortForwardingRulesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeletePortForwardingRulesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deletePortForwardingRules" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deletePortForwardingRulesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 공인IP인스턴스삭제 @param deletePublicIpInstancesRequest deletePublicIpInstancesRequest @return *DeletePublicIpInstancesResponse*/ func (a *V2ApiService) DeletePublicIpInstances(deletePublicIpInstancesRequest *DeletePublicIpInstancesRequest) (*DeletePublicIpInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DeletePublicIpInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/deletePublicIpInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = deletePublicIpInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지인스턴스할당해제 @param detachBlockStorageInstancesRequest detachBlockStorageInstancesRequest @return *DetachBlockStorageInstancesResponse*/ func (a *V2ApiService) DetachBlockStorageInstances(detachBlockStorageInstancesRequest *DetachBlockStorageInstancesRequest) (*DetachBlockStorageInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DetachBlockStorageInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/detachBlockStorageInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = detachBlockStorageInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService Network Interface Detach @param detachNetworkInterfaceRequest detachNetworkInterfaceRequest @return *DetachNetworkInterfaceResponse*/ func (a *V2ApiService) DetachNetworkInterface(detachNetworkInterfaceRequest *DetachNetworkInterfaceRequest) (*DetachNetworkInterfaceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DetachNetworkInterfaceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/detachNetworkInterface" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = detachNetworkInterfaceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 공인IP를서버인스턴스에할당해제 @param disassociatePublicIpFromServerInstanceRequest disassociatePublicIpFromServerInstanceRequest @return *DisassociatePublicIpFromServerInstanceResponse*/ func (a *V2ApiService) DisassociatePublicIpFromServerInstance(disassociatePublicIpFromServerInstanceRequest *DisassociatePublicIpFromServerInstanceRequest) (*DisassociatePublicIpFromServerInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload DisassociatePublicIpFromServerInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/disassociatePublicIpFromServerInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = disassociatePublicIpFromServerInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 접근제어그룹리스트조회 @param getAccessControlGroupListRequest getAccessControlGroupListRequest @return *GetAccessControlGroupListResponse*/ func (a *V2ApiService) GetAccessControlGroupList(getAccessControlGroupListRequest *GetAccessControlGroupListRequest) (*GetAccessControlGroupListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetAccessControlGroupListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getAccessControlGroupList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getAccessControlGroupListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 접근제어그룹적용된서버인스턴스리스트조회 @param getAccessControlGroupServerInstanceListRequest getAccessControlGroupServerInstanceListRequest @return *GetAccessControlGroupServerInstanceListResponse*/ func (a *V2ApiService) GetAccessControlGroupServerInstanceList(getAccessControlGroupServerInstanceListRequest *GetAccessControlGroupServerInstanceListRequest) (*GetAccessControlGroupServerInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetAccessControlGroupServerInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getAccessControlGroupServerInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getAccessControlGroupServerInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 접근제어규칙리스트조회 @param getAccessControlRuleListRequest getAccessControlRuleListRequest @return *GetAccessControlRuleListResponse*/ func (a *V2ApiService) GetAccessControlRuleList(getAccessControlRuleListRequest *GetAccessControlRuleListRequest) (*GetAccessControlRuleListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetAccessControlRuleListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getAccessControlRuleList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getAccessControlRuleListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지인스턴스리스트조회 @param getBlockStorageInstanceListRequest getBlockStorageInstanceListRequest @return *GetBlockStorageInstanceListResponse*/ func (a *V2ApiService) GetBlockStorageInstanceList(getBlockStorageInstanceListRequest *GetBlockStorageInstanceListRequest) (*GetBlockStorageInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetBlockStorageInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getBlockStorageInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getBlockStorageInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 블록스토리지스냅샷인스턴스리스트조회 @param getBlockStorageSnapshotInstanceListRequest getBlockStorageSnapshotInstanceListRequest @return *GetBlockStorageSnapshotInstanceListResponse*/ func (a *V2ApiService) GetBlockStorageSnapshotInstanceList(getBlockStorageSnapshotInstanceListRequest *GetBlockStorageSnapshotInstanceListRequest) (*GetBlockStorageSnapshotInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetBlockStorageSnapshotInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getBlockStorageSnapshotInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getBlockStorageSnapshotInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 인스턴스태그리스트조회 @param getInstanceTagListRequest getInstanceTagListRequest @return *GetInstanceTagListResponse*/ func (a *V2ApiService) GetInstanceTagList(getInstanceTagListRequest *GetInstanceTagListRequest) (*GetInstanceTagListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetInstanceTagListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getInstanceTagList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getInstanceTagListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 로그인키리스트조회 @param getLoginKeyListRequest getLoginKeyListRequest @return *GetLoginKeyListResponse*/ func (a *V2ApiService) GetLoginKeyList(getLoginKeyListRequest *GetLoginKeyListRequest) (*GetLoginKeyListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetLoginKeyListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getLoginKeyList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getLoginKeyListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 회원서버이미지리스트조회 @param getMemberServerImageListRequest getMemberServerImageListRequest @return *GetMemberServerImageListResponse*/ func (a *V2ApiService) GetMemberServerImageList(getMemberServerImageListRequest *GetMemberServerImageListRequest) (*GetMemberServerImageListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetMemberServerImageListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getMemberServerImageList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getMemberServerImageListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService NAS볼륨인스턴스리스트조회 @param getNasVolumeInstanceListRequest getNasVolumeInstanceListRequest @return *GetNasVolumeInstanceListResponse*/ func (a *V2ApiService) GetNasVolumeInstanceList(getNasVolumeInstanceListRequest *GetNasVolumeInstanceListRequest) (*GetNasVolumeInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetNasVolumeInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getNasVolumeInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getNasVolumeInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService NAS볼륨인스턴스측정리스트조회 @param getNasVolumeInstanceRatingListRequest getNasVolumeInstanceRatingListRequest @return *GetNasVolumeInstanceRatingListResponse*/ func (a *V2ApiService) GetNasVolumeInstanceRatingList(getNasVolumeInstanceRatingListRequest *GetNasVolumeInstanceRatingListRequest) (*GetNasVolumeInstanceRatingListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetNasVolumeInstanceRatingListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getNasVolumeInstanceRatingList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getNasVolumeInstanceRatingListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService Network Interface 리스트조회 @param getNetworkInterfaceListRequest getNetworkInterfaceListRequest @return *GetNetworkInterfaceListResponse*/ func (a *V2ApiService) GetNetworkInterfaceList(getNetworkInterfaceListRequest *GetNetworkInterfaceListRequest) (*GetNetworkInterfaceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetNetworkInterfaceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getNetworkInterfaceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getNetworkInterfaceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 포트포워딩Rule리스트조회 @param getPortForwardingRuleListRequest getPortForwardingRuleListRequest @return *GetPortForwardingRuleListResponse*/ func (a *V2ApiService) GetPortForwardingRuleList(getPortForwardingRuleListRequest *GetPortForwardingRuleListRequest) (*GetPortForwardingRuleListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetPortForwardingRuleListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getPortForwardingRuleList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getPortForwardingRuleListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService Private Subnet 인스턴스리스트조회 @param getPrivateSubnetInstanceListRequest getPrivateSubnetInstanceListRequest @return *GetPrivateSubnetInstanceListResponse*/ func (a *V2ApiService) GetPrivateSubnetInstanceList(getPrivateSubnetInstanceListRequest *GetPrivateSubnetInstanceListRequest) (*GetPrivateSubnetInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetPrivateSubnetInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getPrivateSubnetInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getPrivateSubnetInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 공인IP인스턴스리스트조회 @param getPublicIpInstanceListRequest getPublicIpInstanceListRequest @return *GetPublicIpInstanceListResponse*/ func (a *V2ApiService) GetPublicIpInstanceList(getPublicIpInstanceListRequest *GetPublicIpInstanceListRequest) (*GetPublicIpInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetPublicIpInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getPublicIpInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getPublicIpInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 공인IP할당(가능)서버인스턴스리스트조회 @param getPublicIpTargetServerInstanceListRequest getPublicIpTargetServerInstanceListRequest @return *GetPublicIpTargetServerInstanceListResponse*/ func (a *V2ApiService) GetPublicIpTargetServerInstanceList(getPublicIpTargetServerInstanceListRequest *GetPublicIpTargetServerInstanceListRequest) (*GetPublicIpTargetServerInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetPublicIpTargetServerInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getPublicIpTargetServerInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getPublicIpTargetServerInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService RAID리스트조회 @param getRaidListRequest getRaidListRequest @return *GetRaidListResponse*/ func (a *V2ApiService) GetRaidList(getRaidListRequest *GetRaidListRequest) (*GetRaidListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetRaidListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getRaidList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getRaidListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService REGION리스트조회 @param getRegionListRequest getRegionListRequest @return *GetRegionListResponse*/ func (a *V2ApiService) GetRegionList(getRegionListRequest *GetRegionListRequest) (*GetRegionListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetRegionListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getRegionList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getRegionListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 루트패스워드조회 @param getRootPasswordRequest getRootPasswordRequest @return *GetRootPasswordResponse*/ func (a *V2ApiService) GetRootPassword(getRootPasswordRequest *GetRootPasswordRequest) (*GetRootPasswordResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetRootPasswordResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getRootPassword" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getRootPasswordRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버이미지상품리스트조회 @param getServerImageProductListRequest getServerImageProductListRequest @return *GetServerImageProductListResponse*/ func (a *V2ApiService) GetServerImageProductList(getServerImageProductListRequest *GetServerImageProductListRequest) (*GetServerImageProductListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetServerImageProductListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getServerImageProductList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getServerImageProductListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스리스트조회 @param getServerInstanceListRequest getServerInstanceListRequest @return *GetServerInstanceListResponse*/ func (a *V2ApiService) GetServerInstanceList(getServerInstanceListRequest *GetServerInstanceListRequest) (*GetServerInstanceListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetServerInstanceListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getServerInstanceList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getServerInstanceListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버상품리스트조회 @param getServerProductListRequest getServerProductListRequest @return *GetServerProductListResponse*/ func (a *V2ApiService) GetServerProductList(getServerProductListRequest *GetServerProductListRequest) (*GetServerProductListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetServerProductListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getServerProductList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getServerProductListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService ZONE리스트조회 @param getZoneListRequest getZoneListRequest @return *GetZoneListResponse*/ func (a *V2ApiService) GetZoneList(getZoneListRequest *GetZoneListRequest) (*GetZoneListResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload GetZoneListResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/getZoneList" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = getZoneListRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 로그인키IMPORT @param importLoginKeyRequest importLoginKeyRequest @return *ImportLoginKeyResponse*/ func (a *V2ApiService) ImportLoginKey(importLoginKeyRequest *ImportLoginKeyRequest) (*ImportLoginKeyResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload ImportLoginKeyResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/importLoginKey" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = importLoginKeyRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스재시작 @param rebootServerInstancesRequest rebootServerInstancesRequest @return *RebootServerInstancesResponse*/ func (a *V2ApiService) RebootServerInstances(rebootServerInstancesRequest *RebootServerInstancesRequest) (*RebootServerInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload RebootServerInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/rebootServerInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = rebootServerInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스재생성 @param recreateServerInstanceRequest recreateServerInstanceRequest @return *RecreateServerInstanceResponse*/ func (a *V2ApiService) RecreateServerInstance(recreateServerInstanceRequest *RecreateServerInstanceRequest) (*RecreateServerInstanceResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload RecreateServerInstanceResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/recreateServerInstance" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = recreateServerInstanceRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService NAS볼륨인스턴스접근제어제거 @param removeNasVolumeAccessControlRequest removeNasVolumeAccessControlRequest @return *RemoveNasVolumeAccessControlResponse*/ func (a *V2ApiService) RemoveNasVolumeAccessControl(removeNasVolumeAccessControlRequest *RemoveNasVolumeAccessControlRequest) (*RemoveNasVolumeAccessControlResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload RemoveNasVolumeAccessControlResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/removeNasVolumeAccessControl" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = removeNasVolumeAccessControlRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService NAS볼륨인스턴스접근제어설정 @param setNasVolumeAccessControlRequest setNasVolumeAccessControlRequest @return *SetNasVolumeAccessControlResponse*/ func (a *V2ApiService) SetNasVolumeAccessControl(setNasVolumeAccessControlRequest *SetNasVolumeAccessControlRequest) (*SetNasVolumeAccessControlResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload SetNasVolumeAccessControlResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/setNasVolumeAccessControl" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = setNasVolumeAccessControlRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스시작 @param startServerInstancesRequest startServerInstancesRequest @return *StartServerInstancesResponse*/ func (a *V2ApiService) StartServerInstances(startServerInstancesRequest *StartServerInstancesRequest) (*StartServerInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload StartServerInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/startServerInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = startServerInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스종료 @param stopServerInstancesRequest stopServerInstancesRequest @return *StopServerInstancesResponse*/ func (a *V2ApiService) StopServerInstances(stopServerInstancesRequest *StopServerInstancesRequest) (*StopServerInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload StopServerInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/stopServerInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = stopServerInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } /* V2ApiService 서버인스턴스반납 @param terminateServerInstancesRequest terminateServerInstancesRequest @return *TerminateServerInstancesResponse*/ func (a *V2ApiService) TerminateServerInstances(terminateServerInstancesRequest *TerminateServerInstancesRequest) (*TerminateServerInstancesResponse, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} localVarFileName string localVarFileBytes []byte successPayload TerminateServerInstancesResponse ) // create path and map variables localVarPath := a.client.cfg.BasePath + "/terminateServerInstances" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} // to determine the Content-Type header localVarHttpContentTypes := []string{ "application/x-www-form-urlencoded", } // set Content-Type header localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) if localVarHttpContentType != "" { localVarHeaderParams["Content-Type"] = localVarHttpContentType } // to determine the Accept header localVarHttpHeaderAccepts := []string{ } // set Accept header localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } // body params localVarPostBody = terminateServerInstancesRequest v := reflect.ValueOf(localVarPostBody).Elem().FieldByName("UserData") if v.IsValid() && v.CanAddr() { ptr := v.Addr().Interface().(**string) if *ptr != nil { **ptr = base64.StdEncoding.EncodeToString([]byte(**ptr)) } } r, err := a.client.prepareRequest(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) if err != nil { return &successPayload, err } localVarHttpResponse, err := a.client.callAPI(r) if err != nil || localVarHttpResponse == nil { return &successPayload, err } defer localVarHttpResponse.Body.Close() bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) if localVarHttpResponse.StatusCode >= 300 || (localVarHttpResponse.StatusCode < 300 && !strings.HasPrefix(string(bodyBytes), `{`)) { return &successPayload, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) } if !strings.Contains(string(bodyBytes), `{"error"`) && strings.HasPrefix(string(bodyBytes), `{`) { if err = json.Unmarshal(bodyBytes[bytes.IndexAny(bytes.Trim(bodyBytes, "{"), "{"):len(bodyBytes)-1], &successPayload); err != nil { return &successPayload, err } } return &successPayload, err } ����������������������������������������������������packer-1.6.6+ds1/vendor/github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server/zone.go������0000664�0000000�0000000�00000001071�13771713062�0032213�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * server * * <br/>https://ncloud.apigw.ntruss.com/server/v2 * * API version: 2018-10-18T06:16:13Z * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package server type Zone struct { // 존(Zone)번호 ZoneNo *string `json:"zoneNo,omitempty"` // 존(Zone)명 ZoneName *string `json:"zoneName,omitempty"` // 존(Zone) 코드 ZoneCode *string `json:"zoneCode,omitempty"` // 존(Zone)설명 ZoneDescription *string `json:"zoneDescription,omitempty"` // 리전번호 RegionNo *string `json:"regionNo,omitempty"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/���������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020412�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023300�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/LICENSE�����������������������������������0000664�0000000�0000000�00000002075�13771713062�0024311�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The MIT License (MIT) Copyright (c) 2017 <copyright holders> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/proxmox/����������������������������������0000775�0000000�0000000�00000000000�13771713062�0025014�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/proxmox/client.go�������������������������0000664�0000000�0000000�00000062656�13771713062�0026640�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package proxmox // inspired by https://github.com/Telmate/vagrant-proxmox/blob/master/lib/vagrant-proxmox/proxmox/connection.rb import ( "bytes" "crypto/tls" "encoding/json" "errors" "fmt" "io" "io/ioutil" "mime/multipart" "net" "net/http" "os" "regexp" "strconv" "strings" "time" ) // TaskTimeout - default async task call timeout in seconds const TaskTimeout = 300 // TaskStatusCheckInterval - time between async checks in seconds const TaskStatusCheckInterval = 2 const exitStatusSuccess = "OK" // Client - URL, user and password to specifc Proxmox node type Client struct { session *Session ApiUrl string Username string Password string Otp string } // VmRef - virtual machine ref parts // map[type:qemu node:proxmox1-xx id:qemu/132 diskread:5.57424738e+08 disk:0 netin:5.9297450593e+10 mem:3.3235968e+09 uptime:1.4567097e+07 vmid:132 template:0 maxcpu:2 netout:6.053310416e+09 maxdisk:3.4359738368e+10 maxmem:8.592031744e+09 diskwrite:1.49663619584e+12 status:running cpu:0.00386980694947209 name:appt-app1-dev.xxx.xx] type VmRef struct { vmId int node string pool string vmType string haState string } func (vmr *VmRef) SetNode(node string) { vmr.node = node return } func (vmr *VmRef) SetPool(pool string) { vmr.pool = pool } func (vmr *VmRef) SetVmType(vmType string) { vmr.vmType = vmType return } func (vmr *VmRef) GetVmType() string { return vmr.vmType } func (vmr *VmRef) VmId() int { return vmr.vmId } func (vmr *VmRef) Node() string { return vmr.node } func (vmr *VmRef) Pool() string { return vmr.pool } func (vmr *VmRef) HaState() string { return vmr.haState } func NewVmRef(vmId int) (vmr *VmRef) { vmr = &VmRef{vmId: vmId, node: "", vmType: ""} return } func NewClient(apiUrl string, hclient *http.Client, tls *tls.Config) (client *Client, err error) { var sess *Session sess, err = NewSession(apiUrl, hclient, tls) if err == nil { client = &Client{session: sess, ApiUrl: apiUrl} } return client, err } func (c *Client) Login(username string, password string, otp string) (err error) { c.Username = username c.Password = password c.Otp = otp return c.session.Login(username, password, otp) } func (c *Client) GetJsonRetryable(url string, data *map[string]interface{}, tries int) error { var statErr error for ii := 0; ii < tries; ii++ { _, statErr = c.session.GetJSON(url, nil, nil, data) if statErr == nil { return nil } // if statErr != io.ErrUnexpectedEOF { // don't give up on ErrUnexpectedEOF // return statErr // } time.Sleep(5 * time.Second) } return statErr } func (c *Client) GetNodeList() (list map[string]interface{}, err error) { err = c.GetJsonRetryable("/nodes", &list, 3) return } func (c *Client) GetVmList() (list map[string]interface{}, err error) { err = c.GetJsonRetryable("/cluster/resources?type=vm", &list, 3) return } func (c *Client) CheckVmRef(vmr *VmRef) (err error) { if vmr.node == "" || vmr.vmType == "" { _, err = c.GetVmInfo(vmr) } return } func (c *Client) GetVmInfo(vmr *VmRef) (vmInfo map[string]interface{}, err error) { resp, err := c.GetVmList() vms := resp["data"].([]interface{}) for vmii := range vms { vm := vms[vmii].(map[string]interface{}) if int(vm["vmid"].(float64)) == vmr.vmId { vmInfo = vm vmr.node = vmInfo["node"].(string) vmr.vmType = vmInfo["type"].(string) vmr.pool = "" if vmInfo["pool"] != nil { vmr.pool = vmInfo["pool"].(string) } if vmInfo["hastate"] != nil { vmr.haState = vmInfo["hastate"].(string) } return } } return nil, errors.New(fmt.Sprintf("Vm '%d' not found", vmr.vmId)) } func (c *Client) GetVmRefByName(vmName string) (vmr *VmRef, err error) { resp, err := c.GetVmList() vms := resp["data"].([]interface{}) for vmii := range vms { vm := vms[vmii].(map[string]interface{}) if vm["name"] != nil && vm["name"].(string) == vmName { vmr = NewVmRef(int(vm["vmid"].(float64))) vmr.node = vm["node"].(string) vmr.vmType = vm["type"].(string) vmr.pool = "" if vm["pool"] != nil { vmr.pool = vm["pool"].(string) } if vm["hastate"] != nil { vmr.haState = vm["hastate"].(string) } return } } return nil, errors.New(fmt.Sprintf("Vm '%s' not found", vmName)) } func (c *Client) GetVmState(vmr *VmRef) (vmState map[string]interface{}, err error) { err = c.CheckVmRef(vmr) if err != nil { return nil, err } var data map[string]interface{} url := fmt.Sprintf("/nodes/%s/%s/%d/status/current", vmr.node, vmr.vmType, vmr.vmId) err = c.GetJsonRetryable(url, &data, 3) if err != nil { return nil, err } if data["data"] == nil { return nil, errors.New("Vm STATE not readable") } vmState = data["data"].(map[string]interface{}) return } func (c *Client) GetVmConfig(vmr *VmRef) (vmConfig map[string]interface{}, err error) { err = c.CheckVmRef(vmr) if err != nil { return nil, err } var data map[string]interface{} url := fmt.Sprintf("/nodes/%s/%s/%d/config", vmr.node, vmr.vmType, vmr.vmId) err = c.GetJsonRetryable(url, &data, 3) if err != nil { return nil, err } if data["data"] == nil { return nil, errors.New("Vm CONFIG not readable") } vmConfig = data["data"].(map[string]interface{}) return } func (c *Client) GetVmSpiceProxy(vmr *VmRef) (vmSpiceProxy map[string]interface{}, err error) { err = c.CheckVmRef(vmr) if err != nil { return nil, err } var data map[string]interface{} url := fmt.Sprintf("/nodes/%s/%s/%d/spiceproxy", vmr.node, vmr.vmType, vmr.vmId) _, err = c.session.PostJSON(url, nil, nil, nil, &data) if err != nil { return nil, err } if data["data"] == nil { return nil, errors.New("Vm SpiceProxy not readable") } vmSpiceProxy = data["data"].(map[string]interface{}) return } type AgentNetworkInterface struct { MACAddress string IPAddresses []net.IP Name string Statistics map[string]int64 } func (a *AgentNetworkInterface) UnmarshalJSON(b []byte) error { var intermediate struct { HardwareAddress string `json:"hardware-address"` IPAddresses []struct { IPAddress string `json:"ip-address"` IPAddressType string `json:"ip-address-type"` Prefix int `json:"prefix"` } `json:"ip-addresses"` Name string `json:"name"` Statistics map[string]int64 `json:"statistics"` } err := json.Unmarshal(b, &intermediate) if err != nil { return err } a.IPAddresses = make([]net.IP, len(intermediate.IPAddresses)) for idx, ip := range intermediate.IPAddresses { a.IPAddresses[idx] = net.ParseIP(ip.IPAddress) if a.IPAddresses[idx] == nil { return fmt.Errorf("Could not parse %s as IP", ip.IPAddress) } } a.MACAddress = intermediate.HardwareAddress a.Name = intermediate.Name a.Statistics = intermediate.Statistics return nil } func (c *Client) GetVmAgentNetworkInterfaces(vmr *VmRef) ([]AgentNetworkInterface, error) { var ifs []AgentNetworkInterface err := c.doAgentGet(vmr, "network-get-interfaces", &ifs) return ifs, err } func (c *Client) doAgentGet(vmr *VmRef, command string, output interface{}) error { err := c.CheckVmRef(vmr) if err != nil { return err } url := fmt.Sprintf("/nodes/%s/%s/%d/agent/%s", vmr.node, vmr.vmType, vmr.vmId, command) resp, err := c.session.Get(url, nil, nil) if err != nil { return err } return TypedResponse(resp, output) } func (c *Client) CreateTemplate(vmr *VmRef) error { err := c.CheckVmRef(vmr) if err != nil { return err } url := fmt.Sprintf("/nodes/%s/%s/%d/template", vmr.node, vmr.vmType, vmr.vmId) _, err = c.session.Post(url, nil, nil, nil) if err != nil { return err } return nil } func (c *Client) MonitorCmd(vmr *VmRef, command string) (monitorRes map[string]interface{}, err error) { err = c.CheckVmRef(vmr) if err != nil { return nil, err } reqbody := ParamsToBody(map[string]interface{}{"command": command}) url := fmt.Sprintf("/nodes/%s/%s/%d/monitor", vmr.node, vmr.vmType, vmr.vmId) resp, err := c.session.Post(url, nil, nil, &reqbody) if err != nil { return nil, err } monitorRes, err = ResponseJSON(resp) return } func (c *Client) Sendkey(vmr *VmRef, qmKey string) error { err := c.CheckVmRef(vmr) if err != nil { return err } reqbody := ParamsToBody(map[string]interface{}{"key": qmKey}) url := fmt.Sprintf("/nodes/%s/%s/%d/sendkey", vmr.node, vmr.vmType, vmr.vmId) // No return, even for errors: https://bugzilla.proxmox.com/show_bug.cgi?id=2275 _, err = c.session.Put(url, nil, nil, &reqbody) return err } // WaitForCompletion - poll the API for task completion func (c *Client) WaitForCompletion(taskResponse map[string]interface{}) (waitExitStatus string, err error) { if taskResponse["errors"] != nil { errJSON, _ := json.MarshalIndent(taskResponse["errors"], "", " ") return string(errJSON), errors.New("Error reponse") } if taskResponse["data"] == nil { return "", nil } waited := 0 taskUpid := taskResponse["data"].(string) for waited < TaskTimeout { exitStatus, statErr := c.GetTaskExitstatus(taskUpid) if statErr != nil { if statErr != io.ErrUnexpectedEOF { // don't give up on ErrUnexpectedEOF return "", statErr } } if exitStatus != nil { waitExitStatus = exitStatus.(string) return } time.Sleep(TaskStatusCheckInterval * time.Second) waited = waited + TaskStatusCheckInterval } return "", errors.New("Wait timeout for:" + taskUpid) } var rxTaskNode = regexp.MustCompile("UPID:(.*?):") func (c *Client) GetTaskExitstatus(taskUpid string) (exitStatus interface{}, err error) { node := rxTaskNode.FindStringSubmatch(taskUpid)[1] url := fmt.Sprintf("/nodes/%s/tasks/%s/status", node, taskUpid) var data map[string]interface{} _, err = c.session.GetJSON(url, nil, nil, &data) if err == nil { exitStatus = data["data"].(map[string]interface{})["exitstatus"] } if exitStatus != nil && exitStatus != exitStatusSuccess { err = errors.New(exitStatus.(string)) } return } func (c *Client) StatusChangeVm(vmr *VmRef, setStatus string) (exitStatus string, err error) { err = c.CheckVmRef(vmr) if err != nil { return "", err } url := fmt.Sprintf("/nodes/%s/%s/%d/status/%s", vmr.node, vmr.vmType, vmr.vmId, setStatus) var taskResponse map[string]interface{} for i := 0; i < 3; i++ { _, err = c.session.PostJSON(url, nil, nil, nil, &taskResponse) exitStatus, err = c.WaitForCompletion(taskResponse) if exitStatus == "" { time.Sleep(TaskStatusCheckInterval * time.Second) } else { return } } return } func (c *Client) StartVm(vmr *VmRef) (exitStatus string, err error) { return c.StatusChangeVm(vmr, "start") } func (c *Client) StopVm(vmr *VmRef) (exitStatus string, err error) { return c.StatusChangeVm(vmr, "stop") } func (c *Client) ShutdownVm(vmr *VmRef) (exitStatus string, err error) { return c.StatusChangeVm(vmr, "shutdown") } func (c *Client) ResetVm(vmr *VmRef) (exitStatus string, err error) { return c.StatusChangeVm(vmr, "reset") } func (c *Client) SuspendVm(vmr *VmRef) (exitStatus string, err error) { return c.StatusChangeVm(vmr, "suspend") } func (c *Client) ResumeVm(vmr *VmRef) (exitStatus string, err error) { return c.StatusChangeVm(vmr, "resume") } func (c *Client) DeleteVm(vmr *VmRef) (exitStatus string, err error) { err = c.CheckVmRef(vmr) if err != nil { return "", err } //Remove HA if required if vmr.haState != "" { url := fmt.Sprintf("/cluster/ha/resources/%d", vmr.vmId) resp, err := c.session.Delete(url, nil, nil) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return "", err } exitStatus, err = c.WaitForCompletion(taskResponse) if err != nil { return "", err } } } url := fmt.Sprintf("/nodes/%s/%s/%d", vmr.node, vmr.vmType, vmr.vmId) var taskResponse map[string]interface{} _, err = c.session.RequestJSON("DELETE", url, nil, nil, nil, &taskResponse) exitStatus, err = c.WaitForCompletion(taskResponse) return } func (c *Client) CreateQemuVm(node string, vmParams map[string]interface{}) (exitStatus string, err error) { // Create VM disks first to ensure disks names. createdDisks, createdDisksErr := c.createVMDisks(node, vmParams) if createdDisksErr != nil { return "", createdDisksErr } // Then create the VM itself. reqbody := ParamsToBody(vmParams) url := fmt.Sprintf("/nodes/%s/qemu", node) var resp *http.Response resp, err = c.session.Post(url, nil, nil, &reqbody) defer resp.Body.Close() if err != nil { // This might not work if we never got a body. We'll ignore errors in trying to read, // but extract the body if possible to give any error information back in the exitStatus b, _ := ioutil.ReadAll(resp.Body) exitStatus = string(b) return exitStatus, err } taskResponse, err := ResponseJSON(resp) if err != nil { return "", err } exitStatus, err = c.WaitForCompletion(taskResponse) // Delete VM disks if the VM didn't create. if exitStatus != "OK" { deleteDisksErr := c.DeleteVMDisks(node, createdDisks) if deleteDisksErr != nil { return "", deleteDisksErr } } return } func (c *Client) CreateLxcContainer(node string, vmParams map[string]interface{}) (exitStatus string, err error) { reqbody := ParamsToBody(vmParams) url := fmt.Sprintf("/nodes/%s/lxc", node) var resp *http.Response resp, err = c.session.Post(url, nil, nil, &reqbody) defer resp.Body.Close() if err != nil { // This might not work if we never got a body. We'll ignore errors in trying to read, // but extract the body if possible to give any error information back in the exitStatus b, _ := ioutil.ReadAll(resp.Body) exitStatus = string(b) return exitStatus, err } taskResponse, err := ResponseJSON(resp) if err != nil { return "", err } exitStatus, err = c.WaitForCompletion(taskResponse) return } func (c *Client) CloneQemuVm(vmr *VmRef, vmParams map[string]interface{}) (exitStatus string, err error) { reqbody := ParamsToBody(vmParams) url := fmt.Sprintf("/nodes/%s/qemu/%d/clone", vmr.node, vmr.vmId) resp, err := c.session.Post(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return "", err } exitStatus, err = c.WaitForCompletion(taskResponse) } return } func (c *Client) RollbackQemuVm(vmr *VmRef, snapshot string) (exitStatus string, err error) { err = c.CheckVmRef(vmr) if err != nil { return "", err } url := fmt.Sprintf("/nodes/%s/%s/%d/snapshot/%s/rollback", vmr.node, vmr.vmType, vmr.vmId, snapshot) var taskResponse map[string]interface{} _, err = c.session.PostJSON(url, nil, nil, nil, &taskResponse) exitStatus, err = c.WaitForCompletion(taskResponse) return } // SetVmConfig - send config options func (c *Client) SetVmConfig(vmr *VmRef, vmParams map[string]interface{}) (exitStatus interface{}, err error) { reqbody := ParamsToBody(vmParams) url := fmt.Sprintf("/nodes/%s/%s/%d/config", vmr.node, vmr.vmType, vmr.vmId) resp, err := c.session.Post(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) } return } // SetLxcConfig - send config options func (c *Client) SetLxcConfig(vmr *VmRef, vmParams map[string]interface{}) (exitStatus interface{}, err error) { reqbody := ParamsToBody(vmParams) url := fmt.Sprintf("/nodes/%s/%s/%d/config", vmr.node, vmr.vmType, vmr.vmId) resp, err := c.session.Put(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) } return } // MigrateNode - Migrate a VM func (c *Client) MigrateNode(vmr *VmRef, newTargetNode string, online bool) (exitStatus interface{}, err error) { reqbody := ParamsToBody(map[string]interface{}{"target": newTargetNode, "online": online}) url := fmt.Sprintf("/nodes/%s/%s/%d/migrate", vmr.node, vmr.vmType, vmr.vmId) resp, err := c.session.Post(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) return exitStatus, err } return nil, err } func (c *Client) ResizeQemuDisk(vmr *VmRef, disk string, moreSizeGB int) (exitStatus interface{}, err error) { // PUT //disk:virtio0 //size:+2G if disk == "" { disk = "virtio0" } size := fmt.Sprintf("+%dG", moreSizeGB) reqbody := ParamsToBody(map[string]interface{}{"disk": disk, "size": size}) url := fmt.Sprintf("/nodes/%s/%s/%d/resize", vmr.node, vmr.vmType, vmr.vmId) resp, err := c.session.Put(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) } return } func (c *Client) MoveQemuDisk(vmr *VmRef, disk string, storage string) (exitStatus interface{}, err error) { if disk == "" { disk = "virtio0" } reqbody := ParamsToBody(map[string]interface{}{"disk": disk, "storage": storage, "delete": true}) url := fmt.Sprintf("/nodes/%s/%s/%d/move_disk", vmr.node, vmr.vmType, vmr.vmId) resp, err := c.session.Post(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) } return } // GetNextID - Get next free VMID func (c *Client) GetNextID(currentID int) (nextID int, err error) { var data map[string]interface{} var url string if currentID >= 100 { url = fmt.Sprintf("/cluster/nextid?vmid=%d", currentID) } else { url = "/cluster/nextid" } _, err = c.session.GetJSON(url, nil, nil, &data) if err == nil { if data["errors"] != nil { if currentID >= 100 { return c.GetNextID(currentID + 1) } else { return -1, errors.New("error using /cluster/nextid") } } nextID, err = strconv.Atoi(data["data"].(string)) } else if strings.HasPrefix(err.Error(), "400 ") { return c.GetNextID(currentID + 1) } return } // CreateVMDisk - Create single disk for VM on host node. func (c *Client) CreateVMDisk( nodeName string, storageName string, fullDiskName string, diskParams map[string]interface{}, ) error { reqbody := ParamsToBody(diskParams) url := fmt.Sprintf("/nodes/%s/storage/%s/content", nodeName, storageName) resp, err := c.session.Post(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return err } if diskName, containsData := taskResponse["data"]; !containsData || diskName != fullDiskName { return errors.New(fmt.Sprintf("Cannot create VM disk %s", fullDiskName)) } } else { return err } return nil } // createVMDisks - Make disks parameters and create all VM disks on host node. func (c *Client) createVMDisks( node string, vmParams map[string]interface{}, ) (disks []string, err error) { var createdDisks []string vmID := vmParams["vmid"].(int) for deviceName, deviceConf := range vmParams { rxStorageModels := `(ide|sata|scsi|virtio)\d+` if matched, _ := regexp.MatchString(rxStorageModels, deviceName); matched { deviceConfMap := ParseConf(deviceConf.(string), ",", "=") // This if condition to differentiate between `disk` and `cdrom`. if media, containsFile := deviceConfMap["media"]; containsFile && media == "disk" { fullDiskName := deviceConfMap["file"].(string) storageName, volumeName := getStorageAndVolumeName(fullDiskName, ":") diskParams := map[string]interface{}{ "vmid": vmID, "filename": volumeName, "size": deviceConfMap["size"], } err := c.CreateVMDisk(node, storageName, fullDiskName, diskParams) if err != nil { return createdDisks, err } else { createdDisks = append(createdDisks, fullDiskName) } } } } return createdDisks, nil } // DeleteVMDisks - Delete VM disks from host node. // By default the VM disks are deteled when the VM is deleted, // so mainly this is used to delete the disks in case VM creation didn't complete. func (c *Client) DeleteVMDisks( node string, disks []string, ) error { for _, fullDiskName := range disks { storageName, volumeName := getStorageAndVolumeName(fullDiskName, ":") url := fmt.Sprintf("/nodes/%s/storage/%s/content/%s", node, storageName, volumeName) _, err := c.session.Post(url, nil, nil, nil) if err != nil { return err } } return nil } func (c *Client) Upload(node string, storage string, contentType string, filename string, file io.Reader) error { var doStreamingIO bool var fileSize int64 var contentLength int64 if f, ok := file.(*os.File); ok { doStreamingIO = true fileInfo, err := f.Stat() if err != nil { return err } fileSize = fileInfo.Size() } var body io.Reader var mimetype string var err error if doStreamingIO { body, mimetype, contentLength, err = createStreamedUploadBody(contentType, filename, fileSize, file) } else { body, mimetype, err = createUploadBody(contentType, filename, file) } if err != nil { return err } url := fmt.Sprintf("%s/nodes/%s/storage/%s/upload", c.session.ApiUrl, node, storage) req, err := c.session.NewRequest(http.MethodPost, url, nil, body) if err != nil { return err } req.Header.Add("Content-Type", mimetype) req.Header.Add("Accept", "application/json") if doStreamingIO { req.ContentLength = contentLength } resp, err := c.session.Do(req) if err != nil { return err } taskResponse, err := ResponseJSON(resp) if err != nil { return err } exitStatus, err := c.WaitForCompletion(taskResponse) if err != nil { return err } if exitStatus != exitStatusSuccess { return fmt.Errorf("Moving file to destination failed: %v", exitStatus) } return nil } func createUploadBody(contentType string, filename string, r io.Reader) (io.Reader, string, error) { var buf bytes.Buffer w := multipart.NewWriter(&buf) err := w.WriteField("content", contentType) if err != nil { return nil, "", err } fw, err := w.CreateFormFile("filename", filename) if err != nil { return nil, "", err } _, err = io.Copy(fw, r) if err != nil { return nil, "", err } err = w.Close() if err != nil { return nil, "", err } return &buf, w.FormDataContentType(), nil } // createStreamedUploadBody - Use MultiReader to create the multipart body from the file reader, // avoiding allocation of large files in memory before upload (useful e.g. for Windows ISOs). func createStreamedUploadBody(contentType string, filename string, fileSize int64, r io.Reader) (io.Reader, string, int64, error) { var buf bytes.Buffer w := multipart.NewWriter(&buf) err := w.WriteField("content", contentType) if err != nil { return nil, "", 0, err } _, err = w.CreateFormFile("filename", filename) if err != nil { return nil, "", 0, err } headerSize := buf.Len() err = w.Close() if err != nil { return nil, "", 0, err } mr := io.MultiReader(bytes.NewReader(buf.Bytes()[:headerSize]), r, bytes.NewReader(buf.Bytes()[headerSize:])) contentLength := int64(buf.Len()) + fileSize return mr, w.FormDataContentType(), contentLength, nil } // getStorageAndVolumeName - Extract disk storage and disk volume, since disk name is saved // in Proxmox with its storage. func getStorageAndVolumeName( fullDiskName string, separator string, ) (storageName string, diskName string) { storageAndVolumeName := strings.Split(fullDiskName, separator) storageName, volumeName := storageAndVolumeName[0], storageAndVolumeName[1] // when disk type is dir, volumeName is `file=local:100/vm-100-disk-0.raw` re := regexp.MustCompile(`\d+/(?P<filename>\S+.\S+)`) match := re.FindStringSubmatch(volumeName) if len(match) == 2 { volumeName = match[1] } return storageName, volumeName } func (c *Client) UpdateVMPool(vmr *VmRef, pool string) (exitStatus interface{}, err error) { // Same pool if vmr.pool == pool { return } // Remove from old pool if vmr.pool != "" { paramMap := map[string]interface{}{ "vms": vmr.vmId, "delete": 1, } reqbody := ParamsToBody(paramMap) url := fmt.Sprintf("/pools/%s", vmr.pool) resp, err := c.session.Put(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) if err != nil { return nil, err } } } // Add to the new pool if pool != "" { paramMap := map[string]interface{}{ "vms": vmr.vmId, } reqbody := ParamsToBody(paramMap) url := fmt.Sprintf("/pools/%s", pool) resp, err := c.session.Put(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) } else { return nil, err } } return } func (c *Client) UpdateVMHA(vmr *VmRef, haState string) (exitStatus interface{}, err error) { // Same hastate if vmr.haState == haState { return } //Remove HA if haState == "" { url := fmt.Sprintf("/cluster/ha/resources/%d", vmr.vmId) resp, err := c.session.Delete(url, nil, nil) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) } return nil, err } //Activate HA if vmr.haState == "" { paramMap := map[string]interface{}{ "sid": vmr.vmId, } reqbody := ParamsToBody(paramMap) resp, err := c.session.Post("/cluster/ha/resources", nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) if err != nil { return nil, err } } } //Set wanted state paramMap := map[string]interface{}{ "state": haState, } reqbody := ParamsToBody(paramMap) url := fmt.Sprintf("/cluster/ha/resources/%d", vmr.vmId) resp, err := c.session.Put(url, nil, nil, &reqbody) if err == nil { taskResponse, err := ResponseJSON(resp) if err != nil { return nil, err } exitStatus, err = c.WaitForCompletion(taskResponse) } return } ����������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/proxmox/config_lxc.go���������������������0000664�0000000�0000000�00000031513�13771713062�0027461�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package proxmox import ( "encoding/json" "fmt" "io" "log" "strconv" "strings" ) // LXC options for the Proxmox API type configLxc struct { Ostemplate string `json:"ostemplate"` Arch string `json:"arch"` BWLimit int `json:"bwlimit,omitempty"` CMode string `json:"cmode"` Console bool `json:"console"` Cores int `json:"cores,omitempty"` CPULimit int `json:"cpulimit"` CPUUnits int `json:"cpuunits"` Description string `json:"description,omitempty"` Features QemuDevice `json:"features,omitempty"` Force bool `json:"force,omitempty"` Hookscript string `json:"hookscript,omitempty"` Hostname string `json:"hostname,omitempty"` IgnoreUnpackErrors bool `json:"ignore-unpack-errors,omitempty"` Lock string `json:"lock,omitempty"` Memory int `json:"memory"` Mountpoints QemuDevices `json:"mountpoints,omitempty"` Nameserver string `json:"nameserver,omitempty"` Networks QemuDevices `json:"networks,omitempty"` OnBoot bool `json:"onboot"` OsType string `json:"ostype,omitempty"` Password string `json:"password,omitempty"` Pool string `json:"pool,omitempty"` Protection bool `json:"protection"` Restore bool `json:"restore,omitempty"` RootFs string `json:"rootfs,omitempty"` SearchDomain string `json:"searchdomain,omitempty"` SSHPublicKeys string `json:"ssh-public-keys,omitempty"` Start bool `json:"start"` Startup string `json:"startup,omitempty"` Storage string `json:"storage"` Swap int `json:"swap"` Template bool `json:"template,omitempty"` Tty int `json:"tty"` Unique bool `json:"unique,omitempty"` Unprivileged bool `json:"unprivileged"` Unused []string `json:"unused,omitempty"` } func NewConfigLxc() configLxc { return configLxc{ Arch: "amd64", CMode: "tty", Console: true, CPULimit: 0, CPUUnits: 1024, Memory: 512, OnBoot: false, Protection: false, Start: false, Storage: "local", Swap: 512, Template: false, Tty: 2, Unprivileged: false, } } func NewConfigLxcFromJson(io io.Reader) (config configLxc, err error) { config = NewConfigLxc() err = json.NewDecoder(io).Decode(config) if err != nil { log.Fatal(err) return config, err } log.Println(config) return } func NewConfigLxcFromApi(vmr *VmRef, client *Client) (config *configLxc, err error) { // prepare json map to receive the information from the api var lxcConfig map[string]interface{} lxcConfig, err = client.GetVmConfig(vmr) if err != nil { log.Fatal(err) return nil, err } // prepare a new lxc config to store and return\ // the information from api newConfig := NewConfigLxc() config = &newConfig arch := "" if _, isSet := lxcConfig["arch"]; isSet { arch = lxcConfig["arch"].(string) } cmode := "" if _, isSet := lxcConfig["cmode"]; isSet { cmode = lxcConfig["cmode"].(string) } console := true if _, isSet := lxcConfig["console"]; isSet { console = Itob(int(lxcConfig["console"].(float64))) } cores := 1 if _, isSet := lxcConfig["cores"]; isSet { cores = int(lxcConfig["cores"].(float64)) } cpulimit := 0 if _, isSet := lxcConfig["cpulimit"]; isSet { cpulimit, _ = strconv.Atoi(lxcConfig["cpulimit"].(string)) } cpuunits := 1024 if _, isSet := lxcConfig["cpuunits"]; isSet { cpuunits = int(lxcConfig["cpuunits"].(float64)) } description := "" if _, isSet := lxcConfig["description"]; isSet { description = lxcConfig["description"].(string) } // add features, if any if features, isSet := lxcConfig["features"]; isSet { featureList := strings.Split(features.(string), ",") // create new device map to store features featureMap := QemuDevice{} // add all features to device map featureMap.readDeviceConfig(featureList) // prepare empty feature map if config.Features == nil { config.Features = QemuDevice{} } // and device config to networks if len(featureMap) > 0 { config.Features = featureMap } } hookscript := "" if _, isSet := lxcConfig["hookscript"]; isSet { hookscript = lxcConfig["hookscript"].(string) } hostname := "" if _, isSet := lxcConfig["hostname"]; isSet { hostname = lxcConfig["hostname"].(string) } lock := "" if _, isSet := lxcConfig["lock"]; isSet { lock = lxcConfig["lock"].(string) } memory := 512 if _, isSet := lxcConfig["memory"]; isSet { memory = int(lxcConfig["memory"].(float64)) } // add mountpoints mpNames := []string{} for k, _ := range lxcConfig { if mpName := rxMpName.FindStringSubmatch(k); len(mpName) > 0 { mpNames = append(mpNames, mpName[0]) } } for _, mpName := range mpNames { mpConfStr := lxcConfig[mpName] mpConfList := strings.Split(mpConfStr.(string), ",") id := rxDeviceID.FindStringSubmatch(mpName) mpID, _ := strconv.Atoi(id[0]) // add mp id mpConfMap := QemuDevice{ "id": mpID, } // add rest of device config mpConfMap.readDeviceConfig(mpConfList) // prepare empty mountpoint map if config.Mountpoints == nil { config.Mountpoints = QemuDevices{} } // and device config to mountpoints if len(mpConfMap) > 0 { config.Mountpoints[mpID] = mpConfMap } } nameserver := "" if _, isSet := lxcConfig["nameserver"]; isSet { nameserver = lxcConfig["nameserver"].(string) } // add networks nicNames := []string{} for k, _ := range lxcConfig { if nicName := rxNicName.FindStringSubmatch(k); len(nicName) > 0 { nicNames = append(nicNames, nicName[0]) } } for _, nicName := range nicNames { nicConfStr := lxcConfig[nicName] nicConfList := strings.Split(nicConfStr.(string), ",") id := rxDeviceID.FindStringSubmatch(nicName) nicID, _ := strconv.Atoi(id[0]) // add nic id nicConfMap := QemuDevice{ "id": nicID, } // add rest of device config nicConfMap.readDeviceConfig(nicConfList) // prepare empty network map if config.Networks == nil { config.Networks = QemuDevices{} } // and device config to networks if len(nicConfMap) > 0 { config.Networks[nicID] = nicConfMap } } onboot := false if _, isSet := lxcConfig["onboot"]; isSet { onboot = Itob(int(lxcConfig["onboot"].(float64))) } ostype := "" if _, isSet := lxcConfig["ostype"]; isSet { ostype = lxcConfig["ostype"].(string) } protection := false if _, isSet := lxcConfig["protection"]; isSet { protection = Itob(int(lxcConfig["protection"].(float64))) } rootfs := "" if _, isSet := lxcConfig["rootfs"]; isSet { rootfs = lxcConfig["rootfs"].(string) } searchdomain := "" if _, isSet := lxcConfig["searchdomain"]; isSet { searchdomain = lxcConfig["searchdomain"].(string) } startup := "" if _, isSet := lxcConfig["startup"]; isSet { startup = lxcConfig["startup"].(string) } swap := 512 if _, isSet := lxcConfig["swap"]; isSet { swap = int(lxcConfig["swap"].(float64)) } template := false if _, isSet := lxcConfig["template"]; isSet { template = Itob(int(lxcConfig["template"].(float64))) } tty := 2 if _, isSet := lxcConfig["tty"]; isSet { tty = int(lxcConfig["tty"].(float64)) } unprivileged := false if _, isset := lxcConfig["unprivileged"]; isset { unprivileged = Itob(int(lxcConfig["unprivileged"].(float64))) } var unused []string if _, isset := lxcConfig["unused"]; isset { unused = lxcConfig["unused"].([]string) } config.Arch = arch config.CMode = cmode config.Console = console config.Cores = cores config.CPULimit = cpulimit config.CPUUnits = cpuunits config.Description = description config.OnBoot = onboot config.Hookscript = hookscript config.Hostname = hostname config.Lock = lock config.Memory = memory config.Nameserver = nameserver config.OnBoot = onboot config.OsType = ostype config.Protection = protection config.RootFs = rootfs config.SearchDomain = searchdomain config.Startup = startup config.Swap = swap config.Template = template config.Tty = tty config.Unprivileged = unprivileged config.Unused = unused return } // create LXC container using the Proxmox API func (config configLxc) CreateLxc(vmr *VmRef, client *Client) (err error) { vmr.SetVmType("lxc") // convert config to map params, _ := json.Marshal(&config) var paramMap map[string]interface{} json.Unmarshal(params, &paramMap) // build list of features // add features as parameter list to lxc parameters // this overwrites the orginal formatting with a // comma separated list of "key=value" pairs featuresParam := QemuDeviceParam{} featuresParam = featuresParam.createDeviceParam(config.Features, nil) if len(featuresParam) > 0 { paramMap["features"] = strings.Join(featuresParam, ",") } // build list of mountpoints // this does the same as for the feature list // except that there can be multiple of these mountpoint sets // and each mountpoint set comes with a new id for mpID, mpConfMap := range config.Mountpoints { mpConfParam := QemuDeviceParam{} mpConfParam = mpConfParam.createDeviceParam(mpConfMap, nil) // add mp to lxc parameters mpName := fmt.Sprintf("mp%v", mpID) paramMap[mpName] = strings.Join(mpConfParam, ",") } // build list of network parameters for nicID, nicConfMap := range config.Networks { nicConfParam := QemuDeviceParam{} nicConfParam = nicConfParam.createDeviceParam(nicConfMap, nil) // add nic to lxc parameters nicName := fmt.Sprintf("net%v", nicID) paramMap[nicName] = strings.Join(nicConfParam, ",") } // build list of unused volumes for sake of completenes, // even if it is not recommended to change these volumes manually for volID, vol := range config.Unused { // add volume to lxc parameters volName := fmt.Sprintf("unused%v", volID) paramMap[volName] = vol } // now that we concatenated the key value parameter // list for the networks, mountpoints and unused volumes, // remove the original keys, since the Proxmox API does // not know how to handle this key delete(paramMap, "networks") delete(paramMap, "mountpoints") delete(paramMap, "unused") // amend vmid paramMap["vmid"] = vmr.vmId exitStatus, err := client.CreateLxcContainer(vmr.node, paramMap) if err != nil { return fmt.Errorf("Error creating LXC container: %v, error status: %s (params: %v)", err, exitStatus, params) } return } func (config configLxc) UpdateConfig(vmr *VmRef, client *Client) (err error) { // convert config to map params, _ := json.Marshal(&config) var paramMap map[string]interface{} json.Unmarshal(params, &paramMap) // build list of features // add features as parameter list to lxc parameters // this overwrites the orginal formatting with a // comma separated list of "key=value" pairs featuresParam := QemuDeviceParam{} featuresParam = featuresParam.createDeviceParam(config.Features, nil) paramMap["features"] = strings.Join(featuresParam, ",") // build list of mountpoints // this does the same as for the feature list // except that there can be multiple of these mountpoint sets // and each mountpoint set comes with a new id for mpID, mpConfMap := range config.Mountpoints { mpConfParam := QemuDeviceParam{} mpConfParam = mpConfParam.createDeviceParam(mpConfMap, nil) // add mp to lxc parameters mpName := fmt.Sprintf("mp%v", mpID) paramMap[mpName] = strings.Join(mpConfParam, ",") } // build list of network parameters for nicID, nicConfMap := range config.Networks { nicConfParam := QemuDeviceParam{} nicConfParam = nicConfParam.createDeviceParam(nicConfMap, nil) // add nic to lxc parameters nicName := fmt.Sprintf("net%v", nicID) paramMap[nicName] = strings.Join(nicConfParam, ",") } // build list of unused volumes for sake of completenes, // even if it is not recommended to change these volumes manually for volID, vol := range config.Unused { // add volume to lxc parameters volName := fmt.Sprintf("unused%v", volID) paramMap[volName] = vol } // now that we concatenated the key value parameter // list for the networks, mountpoints and unused volumes, // remove the original keys, since the Proxmox API does // not know how to handle this key delete(paramMap, "networks") delete(paramMap, "mountpoints") delete(paramMap, "unused") // delete parameters wich are not supported in updated operations delete(paramMap, "pool") delete(paramMap, "storage") delete(paramMap, "password") delete(paramMap, "ostemplate") delete(paramMap, "start") // even though it is listed as a PUT option in the API documentation // we remove it here because "it should not be modified manually"; // also, error "500 unable to modify read-only option: 'unprivileged'" delete(paramMap, "unprivileged") _, err = client.SetLxcConfig(vmr, paramMap) return err } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/proxmox/config_qemu.go��������������������0000664�0000000�0000000�00000063036�13771713062�0027647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package proxmox import ( "encoding/json" "errors" "fmt" "io" "log" "math/rand" "net" "net/url" "regexp" "strconv" "strings" "time" ) type ( QemuDevices map[int]map[string]interface{} QemuDevice map[string]interface{} QemuDeviceParam []string ) // ConfigQemu - Proxmox API QEMU options type ConfigQemu struct { VmID int `json:"vmid"` Name string `json:"name"` Description string `json:"desc"` Pool string `json:"pool,omitempty"` Bios string `json:"bios"` Onboot bool `json:"onboot"` Agent int `json:"agent"` Memory int `json:"memory"` Balloon int `json:"balloon"` QemuOs string `json:"os"` QemuCores int `json:"cores"` QemuSockets int `json:"sockets"` QemuVcpus int `json:"vcpus"` QemuCpu string `json:"cpu"` QemuNuma bool `json:"numa"` QemuKVM bool `json:"kvm"` Hotplug string `json:"hotplug"` QemuIso string `json:"iso"` FullClone *int `json:"fullclone"` Boot string `json:"boot"` BootDisk string `json:"bootdisk,omitempty"` Scsihw string `json:"scsihw,omitempty"` QemuDisks QemuDevices `json:"disk"` QemuVga QemuDevice `json:"vga,omitempty"` QemuNetworks QemuDevices `json:"network"` QemuSerials QemuDevices `json:"serial,omitempty"` HaState string `json:"hastate,omitempty"` // Deprecated single disk. DiskSize float64 `json:"diskGB"` Storage string `json:"storage"` StorageType string `json:"storageType"` // virtio|scsi (cloud-init defaults to scsi) // Deprecated single nic. QemuNicModel string `json:"nic"` QemuBrige string `json:"bridge"` QemuVlanTag int `json:"vlan"` QemuMacAddr string `json:"mac"` // cloud-init options CIuser string `json:"ciuser"` CIpassword string `json:"cipassword"` CIcustom string `json:"cicustom"` Searchdomain string `json:"searchdomain"` Nameserver string `json:"nameserver"` Sshkeys string `json:"sshkeys"` // arrays are hard, support 3 interfaces for now Ipconfig0 string `json:"ipconfig0"` Ipconfig1 string `json:"ipconfig1"` Ipconfig2 string `json:"ipconfig2"` } // CreateVm - Tell Proxmox API to make the VM func (config ConfigQemu) CreateVm(vmr *VmRef, client *Client) (err error) { if config.HasCloudInit() { return errors.New("Cloud-init parameters only supported on clones or updates") } vmr.SetVmType("qemu") params := map[string]interface{}{ "vmid": vmr.vmId, "name": config.Name, "onboot": config.Onboot, "agent": config.Agent, "ide2": config.QemuIso + ",media=cdrom", "ostype": config.QemuOs, "sockets": config.QemuSockets, "cores": config.QemuCores, "cpu": config.QemuCpu, "numa": config.QemuNuma, "kvm": config.QemuKVM, "hotplug": config.Hotplug, "memory": config.Memory, "boot": config.Boot, "description": config.Description, } if config.Bios != "" { params["bios"] = config.Bios } if config.Balloon >= 1 { params["balloon"] = config.Balloon } if config.QemuVcpus >= 1 { params["vcpus"] = config.QemuVcpus } if vmr.pool != "" { params["pool"] = vmr.pool } if config.BootDisk != "" { params["bootdisk"] = config.BootDisk } if config.Scsihw != "" { params["scsihw"] = config.Scsihw } // Create disks config. config.CreateQemuDisksParams(vmr.vmId, params, false) // Create vga config. vgaParam := QemuDeviceParam{} vgaParam = vgaParam.createDeviceParam(config.QemuVga, nil) if len(vgaParam) > 0 { params["vga"] = strings.Join(vgaParam, ",") } // Create networks config. config.CreateQemuNetworksParams(vmr.vmId, params) // Create serial interfaces config.CreateQemuSerialsParams(vmr.vmId, params) exitStatus, err := client.CreateQemuVm(vmr.node, params) if err != nil { return fmt.Errorf("Error creating VM: %v, error status: %s (params: %v)", err, exitStatus, params) } client.UpdateVMHA(vmr, config.HaState) return } // HasCloudInit - are there cloud-init options? func (config ConfigQemu) HasCloudInit() bool { return config.CIuser != "" || config.CIpassword != "" || config.Searchdomain != "" || config.Nameserver != "" || config.Sshkeys != "" || config.Ipconfig0 != "" || config.Ipconfig1 != "" || config.CIcustom != "" } /* CloneVm Example: Request nodes/proxmox1-xx/qemu/1012/clone newid:145 name:tf-clone1 target:proxmox1-xx full:1 storage:xxx */ func (config ConfigQemu) CloneVm(sourceVmr *VmRef, vmr *VmRef, client *Client) (err error) { vmr.SetVmType("qemu") fullclone := "1" if config.FullClone != nil { fullclone = strconv.Itoa(*config.FullClone) } storage := config.Storage if disk0Storage, ok := config.QemuDisks[0]["storage"].(string); ok && len(disk0Storage) > 0 { storage = disk0Storage } params := map[string]interface{}{ "newid": vmr.vmId, "target": vmr.node, "name": config.Name, "full": fullclone, } if vmr.pool != "" { params["pool"] = vmr.pool } if fullclone == "1" { params["storage"] = storage } _, err = client.CloneQemuVm(sourceVmr, params) return err } func (config ConfigQemu) UpdateConfig(vmr *VmRef, client *Client) (err error) { configParams := map[string]interface{}{ "name": config.Name, "description": config.Description, "onboot": config.Onboot, "agent": config.Agent, "sockets": config.QemuSockets, "cores": config.QemuCores, "cpu": config.QemuCpu, "numa": config.QemuNuma, "kvm": config.QemuKVM, "hotplug": config.Hotplug, "memory": config.Memory, "boot": config.Boot, } //Array to list deleted parameters deleteParams := []string{} if config.Bios != "" { configParams["bios"] = config.Bios } if config.Balloon >= 1 { configParams["balloon"] = config.Balloon } else { deleteParams = append(deleteParams, "balloon") } if config.QemuVcpus >= 1 { configParams["vcpus"] = config.QemuVcpus } else { deleteParams = append(deleteParams, "vcpus") } if config.BootDisk != "" { configParams["bootdisk"] = config.BootDisk } if config.Scsihw != "" { configParams["scsihw"] = config.Scsihw } // Create disks config. configParamsDisk := map[string]interface{}{ "vmid": vmr.vmId, } config.CreateQemuDisksParams(vmr.vmId, configParamsDisk, false) client.createVMDisks(vmr.node, configParamsDisk) //Copy the disks to the global configParams for key, value := range configParamsDisk { //vmid is only required in createVMDisks if key != "vmid" { configParams[key] = value } } // Create networks config. config.CreateQemuNetworksParams(vmr.vmId, configParams) // Create vga config. vgaParam := QemuDeviceParam{} vgaParam = vgaParam.createDeviceParam(config.QemuVga, nil) if len(vgaParam) > 0 { configParams["vga"] = strings.Join(vgaParam, ",") } else { deleteParams = append(deleteParams, "vga") } // Create serial interfaces config.CreateQemuSerialsParams(vmr.vmId, configParams) // cloud-init options if config.CIuser != "" { configParams["ciuser"] = config.CIuser } if config.CIpassword != "" { configParams["cipassword"] = config.CIpassword } if config.CIcustom != "" { configParams["cicustom"] = config.CIcustom } if config.Searchdomain != "" { configParams["searchdomain"] = config.Searchdomain } if config.Nameserver != "" { configParams["nameserver"] = config.Nameserver } if config.Sshkeys != "" { sshkeyEnc := url.PathEscape(config.Sshkeys + "\n") sshkeyEnc = strings.Replace(sshkeyEnc, "+", "%2B", -1) sshkeyEnc = strings.Replace(sshkeyEnc, "@", "%40", -1) sshkeyEnc = strings.Replace(sshkeyEnc, "=", "%3D", -1) configParams["sshkeys"] = sshkeyEnc } if config.Ipconfig0 != "" { configParams["ipconfig0"] = config.Ipconfig0 } if config.Ipconfig1 != "" { configParams["ipconfig1"] = config.Ipconfig1 } if config.Ipconfig2 != "" { configParams["ipconfig2"] = config.Ipconfig2 } if len(deleteParams) > 0 { configParams["delete"] = strings.Join(deleteParams, ", ") } _, err = client.SetVmConfig(vmr, configParams) if err != nil { log.Print(err) return err } client.UpdateVMHA(vmr, config.HaState) _, err = client.UpdateVMPool(vmr, config.Pool) return err } func NewConfigQemuFromJson(io io.Reader) (config *ConfigQemu, err error) { config = &ConfigQemu{QemuVlanTag: -1, QemuKVM: true} err = json.NewDecoder(io).Decode(config) if err != nil { log.Fatal(err) return nil, err } log.Println(config) return } var ( rxIso = regexp.MustCompile(`(.*?),media`) rxDeviceID = regexp.MustCompile(`\d+`) rxDiskName = regexp.MustCompile(`(virtio|scsi)\d+`) rxDiskType = regexp.MustCompile(`\D+`) rxNicName = regexp.MustCompile(`net\d+`) rxMpName = regexp.MustCompile(`mp\d+`) rxSerialName = regexp.MustCompile(`serial\d+`) ) func NewConfigQemuFromApi(vmr *VmRef, client *Client) (config *ConfigQemu, err error) { var vmConfig map[string]interface{} for ii := 0; ii < 3; ii++ { vmConfig, err = client.GetVmConfig(vmr) if err != nil { log.Fatal(err) return nil, err } // this can happen: // {"data":{"lock":"clone","digest":"eb54fb9d9f120ba0c3bdf694f73b10002c375c38","description":" qmclone temporary file\n"}}) if vmConfig["lock"] == nil { break } else { time.Sleep(8 * time.Second) } } if vmConfig["lock"] != nil { return nil, errors.New("vm locked, could not obtain config") } // vmConfig Sample: map[ cpu:host // net0:virtio=62:DF:XX:XX:XX:XX,bridge=vmbr0 // ide2:local:iso/xxx-xx.iso,media=cdrom memory:2048 // smbios1:uuid=8b3bf833-aad8-4545-xxx-xxxxxxx digest:aa6ce5xxxxx1b9ce33e4aaeff564d4 sockets:1 // name:terraform-ubuntu1404-template bootdisk:virtio0 // virtio0:ProxmoxxxxISCSI:vm-1014-disk-2,size=4G // description:Base image // cores:2 ostype:l26 name := "" if _, isSet := vmConfig["name"]; isSet { name = vmConfig["name"].(string) } description := "" if _, isSet := vmConfig["description"]; isSet { description = vmConfig["description"].(string) } bios := "seabios" if _, isSet := vmConfig["bios"]; isSet { bios = vmConfig["bios"].(string) } onboot := true if _, isSet := vmConfig["onboot"]; isSet { onboot = Itob(int(vmConfig["onboot"].(float64))) } agent := 0 if _, isSet := vmConfig["agent"]; isSet { switch vmConfig["agent"].(type) { case float64: agent = int(vmConfig["agent"].(float64)) case string: agent, _ = strconv.Atoi(vmConfig["agent"].(string)) } } ostype := "other" if _, isSet := vmConfig["ostype"]; isSet { ostype = vmConfig["ostype"].(string) } memory := 0.0 if _, isSet := vmConfig["memory"]; isSet { memory = vmConfig["memory"].(float64) } balloon := 0.0 if _, isSet := vmConfig["balloon"]; isSet { balloon = vmConfig["balloon"].(float64) } cores := 1.0 if _, isSet := vmConfig["cores"]; isSet { cores = vmConfig["cores"].(float64) } vcpus := 0.0 if _, isSet := vmConfig["vcpus"]; isSet { vcpus = vmConfig["vcpus"].(float64) } sockets := 1.0 if _, isSet := vmConfig["sockets"]; isSet { sockets = vmConfig["sockets"].(float64) } cpu := "host" if _, isSet := vmConfig["cpu"]; isSet { cpu = vmConfig["cpu"].(string) } numa := false if _, isSet := vmConfig["numa"]; isSet { numa = Itob(int(vmConfig["numa"].(float64))) } //Can be network,disk,cpu,memory,usb hotplug := "network,disk,usb" if _, isSet := vmConfig["hotplug"]; isSet { hotplug = vmConfig["hotplug"].(string) } //boot by default from hard disk (c), CD-ROM (d), network (n). boot := "cdn" if _, isSet := vmConfig["boot"]; isSet { boot = vmConfig["boot"].(string) } bootdisk := "" if _, isSet := vmConfig["bootdisk"]; isSet { bootdisk = vmConfig["bootdisk"].(string) } kvm := true if _, isSet := vmConfig["kvm"]; isSet { kvm = Itob(int(vmConfig["kvm"].(float64))) } scsihw := "lsi" if _, isSet := vmConfig["scsihw"]; isSet { scsihw = vmConfig["scsihw"].(string) } hastate := "" if _, isSet := vmConfig["hastate"]; isSet { hastate = vmConfig["hastate"].(string) } config = &ConfigQemu{ Name: name, Description: strings.TrimSpace(description), Bios: bios, Onboot: onboot, Agent: agent, QemuOs: ostype, Memory: int(memory), QemuCores: int(cores), QemuSockets: int(sockets), QemuCpu: cpu, QemuNuma: numa, QemuKVM: kvm, Hotplug: hotplug, QemuVlanTag: -1, Boot: boot, BootDisk: bootdisk, Scsihw: scsihw, HaState: hastate, QemuDisks: QemuDevices{}, QemuVga: QemuDevice{}, QemuNetworks: QemuDevices{}, QemuSerials: QemuDevices{}, } if balloon >= 1 { config.Balloon = int(balloon) } if vcpus >= 1 { config.QemuVcpus = int(vcpus) } if vmConfig["ide2"] != nil { isoMatch := rxIso.FindStringSubmatch(vmConfig["ide2"].(string)) config.QemuIso = isoMatch[1] } if _, isSet := vmConfig["ciuser"]; isSet { config.CIuser = vmConfig["ciuser"].(string) } if _, isSet := vmConfig["cipassword"]; isSet { config.CIpassword = vmConfig["cipassword"].(string) } if _, isSet := vmConfig["cicustom"]; isSet { config.CIcustom = vmConfig["cicustom"].(string) } if _, isSet := vmConfig["searchdomain"]; isSet { config.Searchdomain = vmConfig["searchdomain"].(string) } if _, isSet := vmConfig["nameserver"]; isSet { config.Nameserver = vmConfig["nameserver"].(string) } if _, isSet := vmConfig["sshkeys"]; isSet { config.Sshkeys, _ = url.PathUnescape(vmConfig["sshkeys"].(string)) } if _, isSet := vmConfig["ipconfig0"]; isSet { config.Ipconfig0 = vmConfig["ipconfig0"].(string) } if _, isSet := vmConfig["ipconfig1"]; isSet { config.Ipconfig1 = vmConfig["ipconfig1"].(string) } if _, isSet := vmConfig["ipconfig2"]; isSet { config.Ipconfig2 = vmConfig["ipconfig2"].(string) } // Add disks. diskNames := []string{} for k, _ := range vmConfig { if diskName := rxDiskName.FindStringSubmatch(k); len(diskName) > 0 { diskNames = append(diskNames, diskName[0]) } } for _, diskName := range diskNames { diskConfStr := vmConfig[diskName] diskConfList := strings.Split(diskConfStr.(string), ",") // id := rxDeviceID.FindStringSubmatch(diskName) diskID, _ := strconv.Atoi(id[0]) diskType := rxDiskType.FindStringSubmatch(diskName)[0] storageName, fileName := ParseSubConf(diskConfList[0], ":") // diskConfMap := QemuDevice{ "id": diskID, "type": diskType, "storage": storageName, "file": fileName, } // Add rest of device config. diskConfMap.readDeviceConfig(diskConfList[1:]) // And device config to disks map. if len(diskConfMap) > 0 { config.QemuDisks[diskID] = diskConfMap } } //Display if vga, isSet := vmConfig["vga"]; isSet { vgaList := strings.Split(vga.(string), ",") vgaMap := QemuDevice{} vgaMap.readDeviceConfig(vgaList) if len(vgaMap) > 0 { config.QemuVga = vgaMap } } // Add networks. nicNames := []string{} for k, _ := range vmConfig { if nicName := rxNicName.FindStringSubmatch(k); len(nicName) > 0 { nicNames = append(nicNames, nicName[0]) } } for _, nicName := range nicNames { nicConfStr := vmConfig[nicName] nicConfList := strings.Split(nicConfStr.(string), ",") id := rxDeviceID.FindStringSubmatch(nicName) nicID, _ := strconv.Atoi(id[0]) model, macaddr := ParseSubConf(nicConfList[0], "=") // Add model and MAC address. nicConfMap := QemuDevice{ "id": nicID, "model": model, "macaddr": macaddr, } // Add rest of device config. nicConfMap.readDeviceConfig(nicConfList[1:]) // And device config to networks. if len(nicConfMap) > 0 { config.QemuNetworks[nicID] = nicConfMap } } // Add serials serialNames := []string{} for k, _ := range vmConfig { if serialName := rxSerialName.FindStringSubmatch(k); len(serialName) > 0 { serialNames = append(serialNames, serialName[0]) } } for _, serialName := range serialNames { id := rxDeviceID.FindStringSubmatch(serialName) serialID, _ := strconv.Atoi(id[0]) serialConfMap := QemuDevice{ "id": serialID, "type": vmConfig[serialName], } // And device config to serials map. if len(serialConfMap) > 0 { config.QemuSerials[serialID] = serialConfMap } } return } // Useful waiting for ISO install to complete func WaitForShutdown(vmr *VmRef, client *Client) (err error) { for ii := 0; ii < 100; ii++ { vmState, err := client.GetVmState(vmr) if err != nil { log.Print("Wait error:") log.Println(err) } else if vmState["status"] == "stopped" { return nil } time.Sleep(5 * time.Second) } return errors.New("Not shutdown within wait time") } // This is because proxmox create/config API won't let us make usernet devices func SshForwardUsernet(vmr *VmRef, client *Client) (sshPort string, err error) { vmState, err := client.GetVmState(vmr) if err != nil { return "", err } if vmState["status"] == "stopped" { return "", errors.New("VM must be running first") } sshPort = strconv.Itoa(vmr.VmId() + 22000) _, err = client.MonitorCmd(vmr, "netdev_add user,id=net1,hostfwd=tcp::"+sshPort+"-:22") if err != nil { return "", err } _, err = client.MonitorCmd(vmr, "device_add virtio-net-pci,id=net1,netdev=net1,addr=0x13") if err != nil { return "", err } return } // device_del net1 // netdev_del net1 func RemoveSshForwardUsernet(vmr *VmRef, client *Client) (err error) { vmState, err := client.GetVmState(vmr) if err != nil { return err } if vmState["status"] == "stopped" { return errors.New("VM must be running first") } _, err = client.MonitorCmd(vmr, "device_del net1") if err != nil { return err } _, err = client.MonitorCmd(vmr, "netdev_del net1") if err != nil { return err } return nil } func MaxVmId(client *Client) (max int, err error) { resp, err := client.GetVmList() vms := resp["data"].([]interface{}) max = 100 for vmii := range vms { vm := vms[vmii].(map[string]interface{}) vmid := int(vm["vmid"].(float64)) if vmid > max { max = vmid } } return } func SendKeysString(vmr *VmRef, client *Client, keys string) (err error) { vmState, err := client.GetVmState(vmr) if err != nil { return err } if vmState["status"] == "stopped" { return errors.New("VM must be running first") } for _, r := range keys { c := string(r) lower := strings.ToLower(c) if c != lower { c = "shift-" + lower } else { switch c { case "!": c = "shift-1" case "@": c = "shift-2" case "#": c = "shift-3" case "$": c = "shift-4" case "%%": c = "shift-5" case "^": c = "shift-6" case "&": c = "shift-7" case "*": c = "shift-8" case "(": c = "shift-9" case ")": c = "shift-0" case "_": c = "shift-minus" case "+": c = "shift-equal" case " ": c = "spc" case "/": c = "slash" case "\\": c = "backslash" case ",": c = "comma" case "-": c = "minus" case "=": c = "equal" case ".": c = "dot" case "?": c = "shift-slash" } } _, err = client.MonitorCmd(vmr, "sendkey "+c) if err != nil { return err } time.Sleep(100) } return nil } // Create parameters for each Nic device. func (c ConfigQemu) CreateQemuNetworksParams(vmID int, params map[string]interface{}) error { // For backward compatibility. if len(c.QemuNetworks) == 0 && len(c.QemuNicModel) > 0 { deprecatedStyleMap := QemuDevice{ "id": 0, "model": c.QemuNicModel, "bridge": c.QemuBrige, "macaddr": c.QemuMacAddr, } if c.QemuVlanTag > 0 { deprecatedStyleMap["tag"] = strconv.Itoa(c.QemuVlanTag) } c.QemuNetworks[0] = deprecatedStyleMap } // For new style with multi net device. for nicID, nicConfMap := range c.QemuNetworks { nicConfParam := QemuDeviceParam{} // Set Nic name. qemuNicName := "net" + strconv.Itoa(nicID) // Set Mac address. if nicConfMap["macaddr"] == nil || nicConfMap["macaddr"].(string) == "" { // Generate Mac based on VmID and NicID so it will be the same always. macaddr := make(net.HardwareAddr, 6) rand.Seed(time.Now().UnixNano()) rand.Read(macaddr) macaddr[0] = (macaddr[0] | 2) & 0xfe // fix from github issue #18 macAddrUppr := strings.ToUpper(fmt.Sprintf("%v", macaddr)) // use model=mac format for older proxmox compatability macAddr := fmt.Sprintf("%v=%v", nicConfMap["model"], macAddrUppr) // Add Mac to source map so it will be returned. (useful for some use case like Terraform) nicConfMap["macaddr"] = macAddrUppr // and also add it to the parameters which will be sent to Proxmox API. nicConfParam = append(nicConfParam, macAddr) } else { macAddr := fmt.Sprintf("%v=%v", nicConfMap["model"], nicConfMap["macaddr"].(string)) nicConfParam = append(nicConfParam, macAddr) } // Set bridge if not nat. if nicConfMap["bridge"].(string) != "nat" { bridge := fmt.Sprintf("bridge=%v", nicConfMap["bridge"]) nicConfParam = append(nicConfParam, bridge) } // Keys that are not used as real/direct conf. ignoredKeys := []string{"id", "bridge", "macaddr", "model"} // Rest of config. nicConfParam = nicConfParam.createDeviceParam(nicConfMap, ignoredKeys) // Add nic to Qemu prams. params[qemuNicName] = strings.Join(nicConfParam, ",") } return nil } // Create parameters for each disk. func (c ConfigQemu) CreateQemuDisksParams( vmID int, params map[string]interface{}, cloned bool, ) error { // For backward compatibility. if len(c.QemuDisks) == 0 && len(c.Storage) > 0 { dType := c.StorageType if dType == "" { if c.HasCloudInit() { dType = "scsi" } else { dType = "virtio" } } deprecatedStyleMap := QemuDevice{ "id": 0, "type": dType, "storage": c.Storage, "size": c.DiskSize, "storage_type": "lvm", // default old style "cache": "none", // default old value } if c.QemuDisks == nil { c.QemuDisks = make(QemuDevices) } c.QemuDisks[0] = deprecatedStyleMap } // For new style with multi disk device. for diskID, diskConfMap := range c.QemuDisks { // skip the first disk for clones (may not always be right, but a template probably has at least 1 disk) if diskID == 0 && cloned { continue } diskConfParam := QemuDeviceParam{ "media=disk", } // Device name. deviceType := diskConfMap["type"].(string) qemuDiskName := deviceType + strconv.Itoa(diskID) // Set disk storage. // Disk size. diskSizeGB := fmt.Sprintf("size=%v", diskConfMap["size"]) diskConfParam = append(diskConfParam, diskSizeGB) // Disk name. var diskFile string // Currently ZFS local, LVM, Ceph RBD, CephFS and Directory are considered. // Other formats are not verified, but could be added if they're needed. rxStorageTypes := `(zfspool|lvm|rbd|cephfs)` storageType := diskConfMap["storage_type"].(string) if matched, _ := regexp.MatchString(rxStorageTypes, storageType); matched { diskFile = fmt.Sprintf("file=%v:vm-%v-disk-%v", diskConfMap["storage"], vmID, diskID) } else { diskFile = fmt.Sprintf("file=%v:%v/vm-%v-disk-%v.%v", diskConfMap["storage"], vmID, vmID, diskID, diskConfMap["format"]) } diskConfParam = append(diskConfParam, diskFile) // Set cache if not none (default). if diskConfMap["cache"].(string) != "none" { diskCache := fmt.Sprintf("cache=%v", diskConfMap["cache"]) diskConfParam = append(diskConfParam, diskCache) } // Keys that are not used as real/direct conf. ignoredKeys := []string{"id", "type", "storage", "storage_type", "size", "cache"} // Rest of config. diskConfParam = diskConfParam.createDeviceParam(diskConfMap, ignoredKeys) // Add back to Qemu prams. params[qemuDiskName] = strings.Join(diskConfParam, ",") } return nil } // Create the parameters for each device that will be sent to Proxmox API. func (p QemuDeviceParam) createDeviceParam( deviceConfMap QemuDevice, ignoredKeys []string, ) QemuDeviceParam { for key, value := range deviceConfMap { if ignored := inArray(ignoredKeys, key); !ignored { var confValue interface{} if bValue, ok := value.(bool); ok && bValue { confValue = "1" } else if sValue, ok := value.(string); ok && len(sValue) > 0 { confValue = sValue } else if iValue, ok := value.(int); ok && iValue > 0 { confValue = iValue } if confValue != nil { deviceConf := fmt.Sprintf("%v=%v", key, confValue) p = append(p, deviceConf) } } } return p } // readDeviceConfig - get standard sub-conf strings where `key=value` and update conf map. func (confMap QemuDevice) readDeviceConfig(confList []string) error { // Add device config. for _, conf := range confList { key, value := ParseSubConf(conf, "=") confMap[key] = value } return nil } func (c ConfigQemu) String() string { jsConf, _ := json.Marshal(c) return string(jsConf) } // Create parameters for serial interface func (c ConfigQemu) CreateQemuSerialsParams( vmID int, params map[string]interface{}, ) error { // For new style with multi disk device. for serialID, serialConfMap := range c.QemuSerials { // Device name. deviceType := serialConfMap["type"].(string) qemuSerialName := "serial" + strconv.Itoa(serialID) // Add back to Qemu prams. params[qemuSerialName] = deviceType } return nil } // NextId - Get next free VMID func (c *Client) NextId() (id int, err error) { var data map[string]interface{} _, err = c.session.GetJSON("/cluster/nextid", nil, nil, &data) if err != nil { return -1, err } if data["data"] == nil || data["errors"] != nil { return -1, fmt.Errorf(data["errors"].(string)) } i, err := strconv.Atoi(data["data"].(string)) if err != nil { return -1, err } return i, nil } // VMIdExists - If you pass an VMID that exists it will raise an error otherwise it will return the vmID func (c *Client) VMIdExists(vmID int) (id int, err error) { _, err = c.session.Get(fmt.Sprintf("/cluster/nextid?vmid=%d", vmID), nil, nil) if err != nil { return -1, err } return vmID, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/proxmox/session.go������������������������0000664�0000000�0000000�00000017207�13771713062�0027035�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package proxmox // inspired by https://github.com/openstack/golang-client/blob/master/openstack/session.go import ( "bytes" "crypto/tls" "encoding/json" "errors" "fmt" "io" "io/ioutil" "log" "net/http" "net/http/httputil" "net/url" ) var Debug = new(bool) type Response struct { Resp *http.Response Body []byte } type Session struct { httpClient *http.Client ApiUrl string AuthTicket string CsrfToken string Headers http.Header } func NewSession(apiUrl string, hclient *http.Client, tls *tls.Config) (session *Session, err error) { if hclient == nil { // Only build a transport if we're also building the client tr := &http.Transport{ TLSClientConfig: tls, DisableCompression: true, } hclient = &http.Client{Transport: tr} } session = &Session{ httpClient: hclient, ApiUrl: apiUrl, AuthTicket: "", CsrfToken: "", Headers: http.Header{}, } return session, nil } func ParamsToBody(params map[string]interface{}) (body []byte) { vals := url.Values{} for k, intrV := range params { var v string switch intrV.(type) { // Convert true/false bool to 1/0 string where Proxmox API can understand it. case bool: if intrV.(bool) { v = "1" } else { v = "0" } default: v = fmt.Sprintf("%v", intrV) } if v != "" { vals.Set(k, v) } } body = bytes.NewBufferString(vals.Encode()).Bytes() return } func decodeResponse(resp *http.Response, v interface{}) error { if resp.Body == nil { return nil } rbody, err := ioutil.ReadAll(resp.Body) if err != nil { return fmt.Errorf("error reading response body: %s", err) } if err = json.Unmarshal(rbody, &v); err != nil { return err } return nil } func ResponseJSON(resp *http.Response) (jbody map[string]interface{}, err error) { err = decodeResponse(resp, &jbody) return jbody, err } func TypedResponse(resp *http.Response, v interface{}) error { var intermediate struct { Data struct { Result json.RawMessage `json:"result"` } `json:"data"` } err := decodeResponse(resp, &intermediate) if err != nil { return fmt.Errorf("error reading response envelope: %v", err) } if err = json.Unmarshal(intermediate.Data.Result, v); err != nil { return fmt.Errorf("error unmarshalling result %v", err) } return nil } func (s *Session) Login(username string, password string, otp string) (err error) { reqUser := map[string]interface{}{"username": username, "password": password} if otp != "" { reqUser["otp"] = otp } reqbody := ParamsToBody(reqUser) olddebug := *Debug *Debug = false // don't share passwords in debug log resp, err := s.Post("/access/ticket", nil, nil, &reqbody) *Debug = olddebug if err != nil { return err } if resp == nil { return errors.New("Login error reading response") } dr, _ := httputil.DumpResponse(resp, true) jbody, err := ResponseJSON(resp) if err != nil { return err } if jbody == nil || jbody["data"] == nil { return fmt.Errorf("Invalid login response:\n-----\n%s\n-----", dr) } dat := jbody["data"].(map[string]interface{}) //Check if the 2FA was required if dat["NeedTFA"] == 1.0 { return errors.New("Missing TFA code") } s.AuthTicket = dat["ticket"].(string) s.CsrfToken = dat["CSRFPreventionToken"].(string) return nil } func (s *Session) NewRequest(method, url string, headers *http.Header, body io.Reader) (req *http.Request, err error) { req, err = http.NewRequest(method, url, body) if err != nil { return nil, err } if headers != nil { req.Header = *headers } if s.AuthTicket != "" { req.Header.Add("Cookie", "PVEAuthCookie="+s.AuthTicket) req.Header.Add("CSRFPreventionToken", s.CsrfToken) } return } func (s *Session) Do(req *http.Request) (*http.Response, error) { // Add session headers for k := range s.Headers { req.Header.Set(k, s.Headers.Get(k)) } if *Debug { d, _ := httputil.DumpRequestOut(req, true) log.Printf(">>>>>>>>>> REQUEST:\n%v", string(d)) } resp, err := s.httpClient.Do(req) if err != nil { return nil, err } // The response body reader needs to be closed, but lots of places call // session.Do, and they might not be able to reliably close it themselves. // Therefore, read the body out, close the original, then replace it with // a NopCloser over the bytes, which does not need to be closed downsteam. respBody, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, err } resp.Body.Close() resp.Body = ioutil.NopCloser(bytes.NewReader(respBody)) if *Debug { dr, _ := httputil.DumpResponse(resp, true) log.Printf("<<<<<<<<<< RESULT:\n%v", string(dr)) } if resp.StatusCode < 200 || resp.StatusCode > 299 { return resp, errors.New(resp.Status) } return resp, nil } // Perform a simple get to an endpoint func (s *Session) Request( method string, url string, params *url.Values, headers *http.Header, body *[]byte, ) (resp *http.Response, err error) { // add params to url here url = s.ApiUrl + url if params != nil { url = url + "?" + params.Encode() } // Get the body if one is present var buf io.Reader if body != nil { buf = bytes.NewReader(*body) } req, err := s.NewRequest(method, url, headers, buf) if err != nil { return nil, err } req.Header.Set("Accept", "application/json") return s.Do(req) } // Perform a simple get to an endpoint and unmarshall returned JSON func (s *Session) RequestJSON( method string, url string, params *url.Values, headers *http.Header, body interface{}, responseContainer interface{}, ) (resp *http.Response, err error) { var bodyjson []byte if body != nil { bodyjson, err = json.Marshal(body) if err != nil { return nil, err } } // if headers == nil { // headers = &http.Header{} // headers.Add("Content-Type", "application/json") // } resp, err = s.Request(method, url, params, headers, &bodyjson) if err != nil { return resp, err } // err = util.CheckHTTPResponseStatusCode(resp) // if err != nil { // return nil, err // } rbody, err := ioutil.ReadAll(resp.Body) if err != nil { return resp, errors.New("error reading response body") } if err = json.Unmarshal(rbody, &responseContainer); err != nil { return resp, err } return resp, nil } func (s *Session) Delete( url string, params *url.Values, headers *http.Header, ) (resp *http.Response, err error) { return s.Request("DELETE", url, params, headers, nil) } func (s *Session) Get( url string, params *url.Values, headers *http.Header, ) (resp *http.Response, err error) { return s.Request("GET", url, params, headers, nil) } func (s *Session) GetJSON( url string, params *url.Values, headers *http.Header, responseContainer interface{}, ) (resp *http.Response, err error) { return s.RequestJSON("GET", url, params, headers, nil, responseContainer) } func (s *Session) Head( url string, params *url.Values, headers *http.Header, ) (resp *http.Response, err error) { return s.Request("HEAD", url, params, headers, nil) } func (s *Session) Post( url string, params *url.Values, headers *http.Header, body *[]byte, ) (resp *http.Response, err error) { if headers == nil { headers = &http.Header{} headers.Add("Content-Type", "application/x-www-form-urlencoded") } return s.Request("POST", url, params, headers, body) } func (s *Session) PostJSON( url string, params *url.Values, headers *http.Header, body interface{}, responseContainer interface{}, ) (resp *http.Response, err error) { return s.RequestJSON("POST", url, params, headers, body, responseContainer) } func (s *Session) Put( url string, params *url.Values, headers *http.Header, body *[]byte, ) (resp *http.Response, err error) { if headers == nil { headers = &http.Header{} headers.Add("Content-Type", "application/x-www-form-urlencoded") } return s.Request("PUT", url, params, headers, body) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/Telmate/proxmox-api-go/proxmox/util.go���������������������������0000664�0000000�0000000�00000002436�13771713062�0026325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package proxmox import ( "strconv" "strings" ) func inArray(arr []string, str string) bool { for _, elem := range arr { if elem == str { return true } } return false } func Itob(i int) bool { if i == 1 { return true } return false } // ParseSubConf - Parse standard sub-conf strings `key=value`. func ParseSubConf( element string, separator string, ) (key string, value interface{}) { if strings.Contains(element, separator) { conf := strings.Split(element, separator) key, value := conf[0], conf[1] var interValue interface{} // Make sure to add value in right type, // because all subconfig are returned as strings from Proxmox API. if iValue, err := strconv.ParseInt(value, 10, 64); err == nil { interValue = int(iValue) } else if bValue, err := strconv.ParseBool(value); err == nil { interValue = bValue } else { interValue = value } return key, interValue } return } // ParseConf - Parse standard device conf string `key1=val1,key2=val2`. func ParseConf( kvString string, confSeparator string, subConfSeparator string, ) QemuDevice { var confMap = QemuDevice{} confList := strings.Split(kvString, confSeparator) for _, item := range confList { key, value := ParseSubConf(item, subConfSeparator) confMap[key] = value } return confMap } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020320�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/�������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024161�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/LICENSE������������������������������0000664�0000000�0000000�00000026135�13771713062�0025175�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/���������������������������������0000775�0000000�0000000�00000000000�13771713062�0024742�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/����������������������������0000775�0000000�0000000�00000000000�13771713062�0025703�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credential.go���������������0000664�0000000�0000000�00000001133�13771713062�0030342�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package auth type Credential interface { } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/����������������0000775�0000000�0000000�00000000000�13771713062�0030200�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������access_key_credential.go����������������������������������������������������������������������������0000664�0000000�0000000�00000001566�13771713062�0034763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials������������������������������������������������������������������������������������package credentials // Deprecated: Use AccessKeyCredential in this package instead. type BaseCredential struct { AccessKeyId string AccessKeySecret string } type AccessKeyCredential struct { AccessKeyId string AccessKeySecret string } // Deprecated: Use NewAccessKeyCredential in this package instead. func NewBaseCredential(accessKeyId, accessKeySecret string) *BaseCredential { return &BaseCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, } } func (baseCred *BaseCredential) ToAccessKeyCredential() *AccessKeyCredential { return &AccessKeyCredential{ AccessKeyId: baseCred.AccessKeyId, AccessKeySecret: baseCred.AccessKeySecret, } } func NewAccessKeyCredential(accessKeyId, accessKeySecret string) *AccessKeyCredential { return &AccessKeyCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, } } ������������������������������������������������������������������������������������������������������������������������������������������bearer_token_credential.go��������������������������������������������������������������������������0000664�0000000�0000000�00000000422�13771713062�0035300�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials������������������������������������������������������������������������������������package credentials type BearerTokenCredential struct { BearerToken string } // NewBearerTokenCredential return a BearerTokenCredential object func NewBearerTokenCredential(token string) *BearerTokenCredential { return &BearerTokenCredential{ BearerToken: token, } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/ecs_ram_role.go�0000664�0000000�0000000�00000001300�13771713062�0033153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package credentials func (oldCred *StsRoleNameOnEcsCredential) ToEcsRamRoleCredential() *EcsRamRoleCredential { return &EcsRamRoleCredential{ RoleName: oldCred.RoleName, } } type EcsRamRoleCredential struct { RoleName string } func NewEcsRamRoleCredential(roleName string) *EcsRamRoleCredential { return &EcsRamRoleCredential{ RoleName: roleName, } } // Deprecated: Use EcsRamRoleCredential in this package instead. type StsRoleNameOnEcsCredential struct { RoleName string } // Deprecated: Use NewEcsRamRoleCredential in this package instead. func NewStsRoleNameOnEcsCredential(roleName string) *StsRoleNameOnEcsCredential { return &StsRoleNameOnEcsCredential{ RoleName: roleName, } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/�������0000775�0000000�0000000�00000000000�13771713062�0032032�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider/env.go�0000664�0000000�0000000�00000001352�13771713062�0033152�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package provider import ( "errors" "os" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" ) type EnvProvider struct{} var ProviderEnv = new(EnvProvider) func NewEnvProvider() Provider { return &EnvProvider{} } func (p *EnvProvider) Resolve() (auth.Credential, error) { accessKeyID, ok1 := os.LookupEnv(ENVAccessKeyID) accessKeySecret, ok2 := os.LookupEnv(ENVAccessKeySecret) if !ok1 || !ok2 { return nil, nil } if accessKeyID == "" || accessKeySecret == "" { return nil, errors.New("Environmental variable (ALIBABACLOUD_ACCESS_KEY_ID or ALIBABACLOUD_ACCESS_KEY_SECRET) is empty") } return credentials.NewAccessKeyCredential(accessKeyID, accessKeySecret), nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_credentials.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000004341�13771713062�0036465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider���������������������������������������������������������������������������package provider import ( "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "os" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" ) var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/" type InstanceCredentialsProvider struct{} var ProviderInstance = new(InstanceCredentialsProvider) var HookGet = func(fn func(string) (int, []byte, error)) func(string) (int, []byte, error) { return fn } func NewInstanceCredentialsProvider() Provider { return &InstanceCredentialsProvider{} } func (p *InstanceCredentialsProvider) Resolve() (auth.Credential, error) { roleName, ok := os.LookupEnv(ENVEcsMetadata) if !ok { return nil, nil } if roleName == "" { return nil, errors.New("Environmental variable 'ALIBABA_CLOUD_ECS_METADATA' are empty") } status, content, err := HookGet(get)(securityCredURL + roleName) if err != nil { return nil, err } if status != 200 { if status == 404 { return nil, fmt.Errorf("The role was not found in the instance") } return nil, fmt.Errorf("Received %d when getting security credentials for %s", status, roleName) } body := make(map[string]interface{}) if err := json.Unmarshal(content, &body); err != nil { return nil, err } accessKeyID, err := extractString(body, "AccessKeyId") if err != nil { return nil, err } accessKeySecret, err := extractString(body, "AccessKeySecret") if err != nil { return nil, err } securityToken, err := extractString(body, "SecurityToken") if err != nil { return nil, err } return credentials.NewStsTokenCredential(accessKeyID, accessKeySecret, securityToken), nil } func get(url string) (status int, content []byte, err error) { httpClient := http.DefaultClient httpClient.Timeout = time.Second * 1 resp, err := httpClient.Get(url) if err != nil { return } defer resp.Body.Close() content, err = ioutil.ReadAll(resp.Body) return resp.StatusCode, content, err } func extractString(m map[string]interface{}, key string) (string, error) { raw, ok := m[key] if !ok { return "", fmt.Errorf("%s not in map", key) } str, ok := raw.(string) if !ok { return "", fmt.Errorf("%s is not a string in map", key) } return str, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������profile_credentials.go������������������������������������������������������������������������������0000664�0000000�0000000�00000010733�13771713062�0036323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider���������������������������������������������������������������������������package provider import ( "bufio" "errors" "os" "runtime" "strings" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" ini "gopkg.in/ini.v1" ) type ProfileProvider struct { Profile string } var ProviderProfile = NewProfileProvider() // NewProfileProvider receive zero or more parameters, // when length of name is 0, the value of field Profile will be "default", // and when there are multiple inputs, the function will take the // first one and discard the other values. func NewProfileProvider(name ...string) Provider { p := new(ProfileProvider) if len(name) == 0 { p.Profile = "default" } else { p.Profile = name[0] } return p } // Resolve implements the Provider interface // when credential type is rsa_key_pair, the content of private_key file // must be able to be parsed directly into the required string // that NewRsaKeyPairCredential function needed func (p *ProfileProvider) Resolve() (auth.Credential, error) { path, ok := os.LookupEnv(ENVCredentialFile) if !ok { path, err := checkDefaultPath() if err != nil { return nil, err } if path == "" { return nil, nil } } else if path == "" { return nil, errors.New("Environment variable '" + ENVCredentialFile + "' cannot be empty") } ini, err := ini.Load(path) if err != nil { return nil, errors.New("ERROR: Can not open file" + err.Error()) } section, err := ini.GetSection(p.Profile) if err != nil { return nil, errors.New("ERROR: Can not load section" + err.Error()) } value, err := section.GetKey("type") if err != nil { return nil, errors.New("ERROR: Can not find credential type" + err.Error()) } switch value.String() { case "access_key": value1, err1 := section.GetKey("access_key_id") value2, err2 := section.GetKey("access_key_secret") if err1 != nil || err2 != nil { return nil, errors.New("ERROR: Failed to get value") } if value1.String() == "" || value2.String() == "" { return nil, errors.New("ERROR: Value can't be empty") } return credentials.NewAccessKeyCredential(value1.String(), value2.String()), nil case "ecs_ram_role": value1, err1 := section.GetKey("role_name") if err1 != nil { return nil, errors.New("ERROR: Failed to get value") } if value1.String() == "" { return nil, errors.New("ERROR: Value can't be empty") } return credentials.NewEcsRamRoleCredential(value1.String()), nil case "ram_role_arn": value1, err1 := section.GetKey("access_key_id") value2, err2 := section.GetKey("access_key_secret") value3, err3 := section.GetKey("role_arn") value4, err4 := section.GetKey("role_session_name") if err1 != nil || err2 != nil || err3 != nil || err4 != nil { return nil, errors.New("ERROR: Failed to get value") } if value1.String() == "" || value2.String() == "" || value3.String() == "" || value4.String() == "" { return nil, errors.New("ERROR: Value can't be empty") } return credentials.NewRamRoleArnCredential(value1.String(), value2.String(), value3.String(), value4.String(), 3600), nil case "rsa_key_pair": value1, err1 := section.GetKey("public_key_id") value2, err2 := section.GetKey("private_key_file") if err1 != nil || err2 != nil { return nil, errors.New("ERROR: Failed to get value") } if value1.String() == "" || value2.String() == "" { return nil, errors.New("ERROR: Value can't be empty") } file, err := os.Open(value2.String()) if err != nil { return nil, errors.New("ERROR: Can not get private_key") } defer file.Close() var privateKey string scan := bufio.NewScanner(file) var data string for scan.Scan() { if strings.HasPrefix(scan.Text(), "----") { continue } data += scan.Text() + "\n" } return credentials.NewRsaKeyPairCredential(privateKey, value1.String(), 3600), nil default: return nil, errors.New("ERROR: Failed to get credential") } } // GetHomePath return home directory according to the system. // if the environmental virables does not exist, will return empty func GetHomePath() string { if runtime.GOOS == "windows" { path, ok := os.LookupEnv("USERPROFILE") if !ok { return "" } return path } path, ok := os.LookupEnv("HOME") if !ok { return "" } return path } func checkDefaultPath() (path string, err error) { path = GetHomePath() if path == "" { return "", errors.New("The default credential file path is invalid") } path = strings.Replace("~/.alibabacloud/credentials", "~", path, 1) _, err = os.Stat(path) if err != nil { return "", nil } return path, nil } �������������������������������������provider.go�����������������������������������������������������������������������������������������0000664�0000000�0000000�00000001104�13771713062�0034130�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider���������������������������������������������������������������������������package provider import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" ) //Environmental virables that may be used by the provider const ( ENVAccessKeyID = "ALIBABA_CLOUD_ACCESS_KEY_ID" ENVAccessKeySecret = "ALIBABA_CLOUD_ACCESS_KEY_SECRET" ENVCredentialFile = "ALIBABA_CLOUD_CREDENTIALS_FILE" ENVEcsMetadata = "ALIBABA_CLOUD_ECS_METADATA" PATHCredentialFile = "~/.alibabacloud/credentials" ) // When you want to customize the provider, you only need to implement the method of the interface. type Provider interface { Resolve() (auth.Credential, error) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������provider_chain.go�����������������������������������������������������������������������������������0000664�0000000�0000000�00000001266�13771713062�0035303�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider���������������������������������������������������������������������������package provider import ( "errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" ) type ProviderChain struct { Providers []Provider } var defaultproviders = []Provider{ProviderEnv, ProviderProfile, ProviderInstance} var DefaultChain = NewProviderChain(defaultproviders) func NewProviderChain(providers []Provider) Provider { return &ProviderChain{ Providers: providers, } } func (p *ProviderChain) Resolve() (auth.Credential, error) { for _, provider := range p.Providers { creds, err := provider.Resolve() if err != nil { return nil, err } else if err == nil && creds == nil { continue } return creds, err } return nil, errors.New("No credential found") } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rsa_key_pair_credential.go��������������������������������������������������������������������������0000664�0000000�0000000�00000000601�13771713062�0035307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials������������������������������������������������������������������������������������package credentials type RsaKeyPairCredential struct { PrivateKey string PublicKeyId string SessionExpiration int } func NewRsaKeyPairCredential(privateKey, publicKeyId string, sessionExpiration int) *RsaKeyPairCredential { return &RsaKeyPairCredential{ PrivateKey: privateKey, PublicKeyId: publicKeyId, SessionExpiration: sessionExpiration, } } �������������������������������������������������������������������������������������������������������������������������������sts_credential.go�����������������������������������������������������������������������������������0000664�0000000�0000000�00000000602�13771713062�0033451�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials������������������������������������������������������������������������������������package credentials type StsTokenCredential struct { AccessKeyId string AccessKeySecret string AccessKeyStsToken string } func NewStsTokenCredential(accessKeyId, accessKeySecret, accessKeyStsToken string) *StsTokenCredential { return &StsTokenCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, AccessKeyStsToken: accessKeyStsToken, } } ������������������������������������������������������������������������������������������������������������������������������sts_role_arn_credential.go��������������������������������������������������������������������������0000664�0000000�0000000�00000004110�13771713062�0035330�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials������������������������������������������������������������������������������������package credentials // Deprecated: Use RamRoleArnCredential in this package instead. type StsRoleArnCredential struct { AccessKeyId string AccessKeySecret string RoleArn string RoleSessionName string RoleSessionExpiration int } type RamRoleArnCredential struct { AccessKeyId string AccessKeySecret string RoleArn string RoleSessionName string RoleSessionExpiration int Policy string } // Deprecated: Use RamRoleArnCredential in this package instead. func NewStsRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *StsRoleArnCredential { return &StsRoleArnCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, RoleArn: roleArn, RoleSessionName: roleSessionName, RoleSessionExpiration: roleSessionExpiration, } } func (oldCred *StsRoleArnCredential) ToRamRoleArnCredential() *RamRoleArnCredential { return &RamRoleArnCredential{ AccessKeyId: oldCred.AccessKeyId, AccessKeySecret: oldCred.AccessKeySecret, RoleArn: oldCred.RoleArn, RoleSessionName: oldCred.RoleSessionName, RoleSessionExpiration: oldCred.RoleSessionExpiration, } } func NewRamRoleArnCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName string, roleSessionExpiration int) *RamRoleArnCredential { return &RamRoleArnCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, RoleArn: roleArn, RoleSessionName: roleSessionName, RoleSessionExpiration: roleSessionExpiration, } } func NewRamRoleArnWithPolicyCredential(accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string, roleSessionExpiration int) *RamRoleArnCredential { return &RamRoleArnCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, RoleArn: roleArn, RoleSessionName: roleSessionName, RoleSessionExpiration: roleSessionExpiration, Policy: policy, } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/roa_signature_composer.go���0000664�0000000�0000000�00000010176�13771713062�0033010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package auth import ( "bytes" "sort" "strings" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) var debug utils.Debug var hookGetDate = func(fn func() string) string { return fn() } func init() { debug = utils.Init("sdk") } func signRoaRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) { completeROASignParams(request, signer, regionId) stringToSign := buildRoaStringToSign(request) request.SetStringToSign(stringToSign) signature := signer.Sign(stringToSign, "") accessKeyId, err := signer.GetAccessKeyId() if err != nil { return nil } request.GetHeaders()["Authorization"] = "acs " + accessKeyId + ":" + signature return } func completeROASignParams(request requests.AcsRequest, signer Signer, regionId string) { headerParams := request.GetHeaders() // complete query params queryParams := request.GetQueryParams() //if _, ok := queryParams["RegionId"]; !ok { // queryParams["RegionId"] = regionId //} if extraParam := signer.GetExtraParam(); extraParam != nil { for key, value := range extraParam { if key == "SecurityToken" { headerParams["x-acs-security-token"] = value continue } if key == "BearerToken" { headerParams["x-acs-bearer-token"] = value continue } queryParams[key] = value } } // complete header params headerParams["Date"] = hookGetDate(utils.GetTimeInFormatRFC2616) headerParams["x-acs-signature-method"] = signer.GetName() headerParams["x-acs-signature-version"] = signer.GetVersion() if request.GetFormParams() != nil && len(request.GetFormParams()) > 0 { formString := utils.GetUrlFormedMap(request.GetFormParams()) request.SetContent([]byte(formString)) headerParams["Content-Type"] = requests.Form } contentMD5 := utils.GetMD5Base64(request.GetContent()) headerParams["Content-MD5"] = contentMD5 if _, contains := headerParams["Content-Type"]; !contains { headerParams["Content-Type"] = requests.Raw } switch format := request.GetAcceptFormat(); format { case "JSON": headerParams["Accept"] = requests.Json case "XML": headerParams["Accept"] = requests.Xml default: headerParams["Accept"] = requests.Raw } } func buildRoaStringToSign(request requests.AcsRequest) (stringToSign string) { headers := request.GetHeaders() stringToSignBuilder := bytes.Buffer{} stringToSignBuilder.WriteString(request.GetMethod()) stringToSignBuilder.WriteString(requests.HeaderSeparator) // append header keys for sign appendIfContain(headers, &stringToSignBuilder, "Accept", requests.HeaderSeparator) appendIfContain(headers, &stringToSignBuilder, "Content-MD5", requests.HeaderSeparator) appendIfContain(headers, &stringToSignBuilder, "Content-Type", requests.HeaderSeparator) appendIfContain(headers, &stringToSignBuilder, "Date", requests.HeaderSeparator) // sort and append headers witch starts with 'x-acs-' var acsHeaders []string for key := range headers { if strings.HasPrefix(key, "x-acs-") { acsHeaders = append(acsHeaders, key) } } sort.Strings(acsHeaders) for _, key := range acsHeaders { stringToSignBuilder.WriteString(key + ":" + headers[key]) stringToSignBuilder.WriteString(requests.HeaderSeparator) } // append query params stringToSignBuilder.WriteString(request.BuildQueries()) stringToSign = stringToSignBuilder.String() debug("stringToSign: %s", stringToSign) return } func appendIfContain(sourceMap map[string]string, target *bytes.Buffer, key, separator string) { if value, contain := sourceMap[key]; contain && len(value) > 0 { target.WriteString(sourceMap[key]) target.WriteString(separator) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/rpc_signature_composer.go���0000664�0000000�0000000�00000005703�13771713062�0033013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package auth import ( "net/url" "strings" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) var hookGetUUIDV4 = func(fn func() string) string { return fn() } func signRpcRequest(request requests.AcsRequest, signer Signer, regionId string) (err error) { err = completeRpcSignParams(request, signer, regionId) if err != nil { return } // remove while retry if _, containsSign := request.GetQueryParams()["Signature"]; containsSign { delete(request.GetQueryParams(), "Signature") } stringToSign := buildRpcStringToSign(request) request.SetStringToSign(stringToSign) signature := signer.Sign(stringToSign, "&") request.GetQueryParams()["Signature"] = signature return } func completeRpcSignParams(request requests.AcsRequest, signer Signer, regionId string) (err error) { queryParams := request.GetQueryParams() queryParams["Version"] = request.GetVersion() queryParams["Action"] = request.GetActionName() queryParams["Format"] = request.GetAcceptFormat() queryParams["Timestamp"] = hookGetDate(utils.GetTimeInFormatISO8601) queryParams["SignatureMethod"] = signer.GetName() queryParams["SignatureType"] = signer.GetType() queryParams["SignatureVersion"] = signer.GetVersion() queryParams["SignatureNonce"] = hookGetUUIDV4(utils.GetUUIDV4) queryParams["AccessKeyId"], err = signer.GetAccessKeyId() if err != nil { return } if _, contains := queryParams["RegionId"]; !contains { queryParams["RegionId"] = regionId } if extraParam := signer.GetExtraParam(); extraParam != nil { for key, value := range extraParam { queryParams[key] = value } } request.GetHeaders()["Content-Type"] = requests.Form formString := utils.GetUrlFormedMap(request.GetFormParams()) request.SetContent([]byte(formString)) return } func buildRpcStringToSign(request requests.AcsRequest) (stringToSign string) { signParams := make(map[string]string) for key, value := range request.GetQueryParams() { signParams[key] = value } for key, value := range request.GetFormParams() { signParams[key] = value } stringToSign = utils.GetUrlFormedMap(signParams) stringToSign = strings.Replace(stringToSign, "+", "%20", -1) stringToSign = strings.Replace(stringToSign, "*", "%2A", -1) stringToSign = strings.Replace(stringToSign, "%7E", "~", -1) stringToSign = url.QueryEscape(stringToSign) stringToSign = request.GetMethod() + "&%2F&" + stringToSign return } �������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signer.go�������������������0000664�0000000�0000000�00000006046�13771713062�0027527�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package auth import ( "fmt" "reflect" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) type Signer interface { GetName() string GetType() string GetVersion() string GetAccessKeyId() (string, error) GetExtraParam() map[string]string Sign(stringToSign, secretSuffix string) string } func NewSignerWithCredential(credential Credential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer Signer, err error) { switch instance := credential.(type) { case *credentials.AccessKeyCredential: { signer = signers.NewAccessKeySigner(instance) } case *credentials.StsTokenCredential: { signer = signers.NewStsTokenSigner(instance) } case *credentials.BearerTokenCredential: { signer = signers.NewBearerTokenSigner(instance) } case *credentials.RamRoleArnCredential: { signer, err = signers.NewRamRoleArnSigner(instance, commonApi) } case *credentials.RsaKeyPairCredential: { signer, err = signers.NewSignerKeyPair(instance, commonApi) } case *credentials.EcsRamRoleCredential: { signer = signers.NewEcsRamRoleSigner(instance, commonApi) } case *credentials.BaseCredential: // deprecated user interface { signer = signers.NewAccessKeySigner(instance.ToAccessKeyCredential()) } case *credentials.StsRoleArnCredential: // deprecated user interface { signer, err = signers.NewRamRoleArnSigner(instance.ToRamRoleArnCredential(), commonApi) } case *credentials.StsRoleNameOnEcsCredential: // deprecated user interface { signer = signers.NewEcsRamRoleSigner(instance.ToEcsRamRoleCredential(), commonApi) } default: message := fmt.Sprintf(errors.UnsupportedCredentialErrorMessage, reflect.TypeOf(credential)) err = errors.NewClientError(errors.UnsupportedCredentialErrorCode, message, nil) } return } func Sign(request requests.AcsRequest, signer Signer, regionId string) (err error) { switch request.GetStyle() { case requests.ROA: { err = signRoaRequest(request, signer, regionId) } case requests.RPC: { err = signRpcRequest(request, signer, regionId) } default: message := fmt.Sprintf(errors.UnknownRequestTypeErrorMessage, reflect.TypeOf(request)) err = errors.NewClientError(errors.UnknownRequestTypeErrorCode, message, nil) } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/��������������������0000775�0000000�0000000�00000000000�13771713062�0027355�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/algorithms.go�������0000664�0000000�0000000�00000002725�13771713062�0032063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "crypto" "crypto/hmac" "crypto/rand" "crypto/rsa" "crypto/sha1" "crypto/x509" "encoding/base64" ) func ShaHmac1(source, secret string) string { key := []byte(secret) hmac := hmac.New(sha1.New, key) hmac.Write([]byte(source)) signedBytes := hmac.Sum(nil) signedString := base64.StdEncoding.EncodeToString(signedBytes) return signedString } func Sha256WithRsa(source, secret string) string { // block, _ := pem.Decode([]byte(secret)) decodeString, err := base64.StdEncoding.DecodeString(secret) if err != nil { panic(err) } private, err := x509.ParsePKCS8PrivateKey(decodeString) if err != nil { panic(err) } h := crypto.Hash.New(crypto.SHA256) h.Write([]byte(source)) hashed := h.Sum(nil) signature, err := rsa.SignPKCS1v15(rand.Reader, private.(*rsa.PrivateKey), crypto.SHA256, hashed) if err != nil { panic(err) } return base64.StdEncoding.EncodeToString(signature) } �������������������������������������������credential_updater.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000003253�13771713062�0033466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers����������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) const defaultInAdvanceScale = 0.95 type credentialUpdater struct { credentialExpiration int lastUpdateTimestamp int64 inAdvanceScale float64 buildRequestMethod func() (*requests.CommonRequest, error) responseCallBack func(response *responses.CommonResponse) error refreshApi func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) } func (updater *credentialUpdater) needUpdateCredential() (result bool) { if updater.inAdvanceScale == 0 { updater.inAdvanceScale = defaultInAdvanceScale } return time.Now().Unix()-updater.lastUpdateTimestamp >= int64(float64(updater.credentialExpiration)*updater.inAdvanceScale) } func (updater *credentialUpdater) updateCredential() (err error) { request, err := updater.buildRequestMethod() if err != nil { return } response, err := updater.refreshApi(request) if err != nil { return } updater.lastUpdateTimestamp = time.Now().Unix() err = updater.responseCallBack(response) return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������session_credential.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000000173�13771713062�0033503�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers����������������������������������������������������������������������������������������package signers type SessionCredential struct { AccessKeyId string AccessKeySecret string StsToken string } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_access_key.go0000664�0000000�0000000�00000002654�13771713062�0033373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" ) type AccessKeySigner struct { credential *credentials.AccessKeyCredential } func (signer *AccessKeySigner) GetExtraParam() map[string]string { return nil } func NewAccessKeySigner(credential *credentials.AccessKeyCredential) *AccessKeySigner { return &AccessKeySigner{ credential: credential, } } func (*AccessKeySigner) GetName() string { return "HMAC-SHA1" } func (*AccessKeySigner) GetType() string { return "" } func (*AccessKeySigner) GetVersion() string { return "1.0" } func (signer *AccessKeySigner) GetAccessKeyId() (accessKeyId string, err error) { return signer.credential.AccessKeyId, nil } func (signer *AccessKeySigner) Sign(stringToSign, secretSuffix string) string { secret := signer.credential.AccessKeySecret + secretSuffix return ShaHmac1(stringToSign, secret) } ������������������������������������������������������������������������������������signer_bearer_token.go������������������������������������������������������������������������������0000664�0000000�0000000�00000001534�13771713062�0033637�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers����������������������������������������������������������������������������������������package signers import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" ) type BearerTokenSigner struct { credential *credentials.BearerTokenCredential } func NewBearerTokenSigner(credential *credentials.BearerTokenCredential) *BearerTokenSigner { return &BearerTokenSigner{ credential: credential, } } func (signer *BearerTokenSigner) GetExtraParam() map[string]string { return map[string]string{"BearerToken": signer.credential.BearerToken} } func (*BearerTokenSigner) GetName() string { return "" } func (*BearerTokenSigner) GetType() string { return "BEARERTOKEN" } func (*BearerTokenSigner) GetVersion() string { return "1.0" } func (signer *BearerTokenSigner) GetAccessKeyId() (accessKeyId string, err error) { return "", nil } func (signer *BearerTokenSigner) Sign(stringToSign, secretSuffix string) string { return "" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������signer_ecs_ram_role.go������������������������������������������������������������������������������0000664�0000000�0000000�00000012741�13771713062�0033633�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers����������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "encoding/json" "fmt" "net/http" "strings" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" jmespath "github.com/jmespath/go-jmespath" ) var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/" type EcsRamRoleSigner struct { *credentialUpdater sessionCredential *SessionCredential credential *credentials.EcsRamRoleCredential commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) } func NewEcsRamRoleSigner(credential *credentials.EcsRamRoleCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *EcsRamRoleSigner) { signer = &EcsRamRoleSigner{ credential: credential, commonApi: commonApi, } signer.credentialUpdater = &credentialUpdater{ credentialExpiration: defaultDurationSeconds / 60, buildRequestMethod: signer.buildCommonRequest, responseCallBack: signer.refreshCredential, refreshApi: signer.refreshApi, } return signer } func (*EcsRamRoleSigner) GetName() string { return "HMAC-SHA1" } func (*EcsRamRoleSigner) GetType() string { return "" } func (*EcsRamRoleSigner) GetVersion() string { return "1.0" } func (signer *EcsRamRoleSigner) GetAccessKeyId() (accessKeyId string, err error) { if signer.sessionCredential == nil || signer.needUpdateCredential() { err = signer.updateCredential() if err != nil { return } } if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { return "", nil } return signer.sessionCredential.AccessKeyId, nil } func (signer *EcsRamRoleSigner) GetExtraParam() map[string]string { if signer.sessionCredential == nil { return make(map[string]string) } if len(signer.sessionCredential.StsToken) <= 0 { return make(map[string]string) } return map[string]string{"SecurityToken": signer.sessionCredential.StsToken} } func (signer *EcsRamRoleSigner) Sign(stringToSign, secretSuffix string) string { secret := signer.sessionCredential.AccessKeySecret + secretSuffix return ShaHmac1(stringToSign, secret) } func (signer *EcsRamRoleSigner) buildCommonRequest() (request *requests.CommonRequest, err error) { return } func (signer *EcsRamRoleSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { requestUrl := securityCredURL + signer.credential.RoleName httpRequest, err := http.NewRequest(requests.GET, requestUrl, strings.NewReader("")) if err != nil { err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error()) return } httpClient := &http.Client{} httpResponse, err := httpClient.Do(httpRequest) if err != nil { err = fmt.Errorf("refresh Ecs sts token err: %s", err.Error()) return } response = responses.NewCommonResponse() err = responses.Unmarshal(response, httpResponse, "") return } func (signer *EcsRamRoleSigner) refreshCredential(response *responses.CommonResponse) (err error) { if response.GetHttpStatus() != http.StatusOK { return fmt.Errorf("refresh Ecs sts token err, httpStatus: %d, message = %s", response.GetHttpStatus(), response.GetHttpContentString()) } var data interface{} err = json.Unmarshal(response.GetHttpContentBytes(), &data) if err != nil { return fmt.Errorf("refresh Ecs sts token err, json.Unmarshal fail: %s", err.Error()) } code, err := jmespath.Search("Code", data) if err != nil { return fmt.Errorf("refresh Ecs sts token err, fail to get Code: %s", err.Error()) } if code.(string) != "Success" { return fmt.Errorf("refresh Ecs sts token err, Code is not Success") } accessKeyId, err := jmespath.Search("AccessKeyId", data) if err != nil { return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeyId: %s", err.Error()) } accessKeySecret, err := jmespath.Search("AccessKeySecret", data) if err != nil { return fmt.Errorf("refresh Ecs sts token err, fail to get AccessKeySecret: %s", err.Error()) } securityToken, err := jmespath.Search("SecurityToken", data) if err != nil { return fmt.Errorf("refresh Ecs sts token err, fail to get SecurityToken: %s", err.Error()) } expiration, err := jmespath.Search("Expiration", data) if err != nil { return fmt.Errorf("refresh Ecs sts token err, fail to get Expiration: %s", err.Error()) } if accessKeyId == nil || accessKeySecret == nil || securityToken == nil || expiration == nil { return } expirationTime, err := time.Parse("2006-01-02T15:04:05Z", expiration.(string)) signer.credentialExpiration = int(expirationTime.Unix() - time.Now().Unix()) signer.sessionCredential = &SessionCredential{ AccessKeyId: accessKeyId.(string), AccessKeySecret: accessKeySecret.(string), StsToken: securityToken.(string), } return } func (signer *EcsRamRoleSigner) GetSessionCredential() *SessionCredential { return signer.sessionCredential } �������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_key_pair.go��0000664�0000000�0000000�00000011437�13771713062�0033064�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "encoding/json" "fmt" "net/http" "strconv" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" jmespath "github.com/jmespath/go-jmespath" ) type SignerKeyPair struct { *credentialUpdater sessionCredential *SessionCredential credential *credentials.RsaKeyPairCredential commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) } func NewSignerKeyPair(credential *credentials.RsaKeyPairCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerKeyPair, err error) { signer = &SignerKeyPair{ credential: credential, commonApi: commonApi, } signer.credentialUpdater = &credentialUpdater{ credentialExpiration: credential.SessionExpiration, buildRequestMethod: signer.buildCommonRequest, responseCallBack: signer.refreshCredential, refreshApi: signer.refreshApi, } if credential.SessionExpiration > 0 { if credential.SessionExpiration >= 900 && credential.SessionExpiration <= 3600 { signer.credentialExpiration = credential.SessionExpiration } else { err = errors.NewClientError(errors.InvalidParamErrorCode, "Key Pair session duration should be in the range of 15min - 1Hr", nil) } } else { signer.credentialExpiration = defaultDurationSeconds } return } func (*SignerKeyPair) GetName() string { return "HMAC-SHA1" } func (*SignerKeyPair) GetType() string { return "" } func (*SignerKeyPair) GetVersion() string { return "1.0" } func (signer *SignerKeyPair) ensureCredential() error { if signer.sessionCredential == nil || signer.needUpdateCredential() { return signer.updateCredential() } return nil } func (signer *SignerKeyPair) GetAccessKeyId() (accessKeyId string, err error) { err = signer.ensureCredential() if err != nil { return } if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { accessKeyId = "" return } accessKeyId = signer.sessionCredential.AccessKeyId return } func (signer *SignerKeyPair) GetExtraParam() map[string]string { return make(map[string]string) } func (signer *SignerKeyPair) Sign(stringToSign, secretSuffix string) string { secret := signer.sessionCredential.AccessKeySecret + secretSuffix return ShaHmac1(stringToSign, secret) } func (signer *SignerKeyPair) buildCommonRequest() (request *requests.CommonRequest, err error) { request = requests.NewCommonRequest() request.Product = "Sts" request.Version = "2015-04-01" request.ApiName = "GenerateSessionAccessKey" request.Scheme = requests.HTTPS request.SetDomain("sts.ap-northeast-1.aliyuncs.com") request.QueryParams["PublicKeyId"] = signer.credential.PublicKeyId request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration) return } func (signer *SignerKeyPair) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { signerV2 := NewSignerV2(signer.credential) return signer.commonApi(request, signerV2) } func (signer *SignerKeyPair) refreshCredential(response *responses.CommonResponse) (err error) { if response.GetHttpStatus() != http.StatusOK { message := "refresh session AccessKey failed" err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message) return } var data interface{} err = json.Unmarshal(response.GetHttpContentBytes(), &data) if err != nil { return fmt.Errorf("refresh KeyPair err, json.Unmarshal fail: %s", err.Error()) } accessKeyId, err := jmespath.Search("SessionAccessKey.SessionAccessKeyId", data) if err != nil { return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeyId: %s", err.Error()) } accessKeySecret, err := jmespath.Search("SessionAccessKey.SessionAccessKeySecret", data) if err != nil { return fmt.Errorf("refresh KeyPair err, fail to get SessionAccessKeySecret: %s", err.Error()) } if accessKeyId == nil || accessKeySecret == nil { return } signer.sessionCredential = &SessionCredential{ AccessKeyId: accessKeyId.(string), AccessKeySecret: accessKeySecret.(string), } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������signer_ram_role_arn.go������������������������������������������������������������������������������0000664�0000000�0000000�00000013575�13771713062�0033647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers����������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "encoding/json" "fmt" "net/http" "strconv" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" jmespath "github.com/jmespath/go-jmespath" ) const ( defaultDurationSeconds = 3600 ) type RamRoleArnSigner struct { *credentialUpdater roleSessionName string sessionCredential *SessionCredential credential *credentials.RamRoleArnCredential commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error) } func NewRamRoleArnSigner(credential *credentials.RamRoleArnCredential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer *RamRoleArnSigner, err error) { signer = &RamRoleArnSigner{ credential: credential, commonApi: commonApi, } signer.credentialUpdater = &credentialUpdater{ credentialExpiration: credential.RoleSessionExpiration, buildRequestMethod: signer.buildCommonRequest, responseCallBack: signer.refreshCredential, refreshApi: signer.refreshApi, } if len(credential.RoleSessionName) > 0 { signer.roleSessionName = credential.RoleSessionName } else { signer.roleSessionName = "aliyun-go-sdk-" + strconv.FormatInt(time.Now().UnixNano()/1000, 10) } if credential.RoleSessionExpiration > 0 { if credential.RoleSessionExpiration >= 900 && credential.RoleSessionExpiration <= 3600 { signer.credentialExpiration = credential.RoleSessionExpiration } else { err = errors.NewClientError(errors.InvalidParamErrorCode, "Assume Role session duration should be in the range of 15min - 1Hr", nil) } } else { signer.credentialExpiration = defaultDurationSeconds } return } func (*RamRoleArnSigner) GetName() string { return "HMAC-SHA1" } func (*RamRoleArnSigner) GetType() string { return "" } func (*RamRoleArnSigner) GetVersion() string { return "1.0" } func (signer *RamRoleArnSigner) GetAccessKeyId() (accessKeyId string, err error) { if signer.sessionCredential == nil || signer.needUpdateCredential() { err = signer.updateCredential() if err != nil { return } } if signer.sessionCredential == nil || len(signer.sessionCredential.AccessKeyId) <= 0 { return "", err } return signer.sessionCredential.AccessKeyId, nil } func (signer *RamRoleArnSigner) GetExtraParam() map[string]string { if signer.sessionCredential == nil || signer.needUpdateCredential() { signer.updateCredential() } if signer.sessionCredential == nil || len(signer.sessionCredential.StsToken) <= 0 { return make(map[string]string) } return map[string]string{"SecurityToken": signer.sessionCredential.StsToken} } func (signer *RamRoleArnSigner) Sign(stringToSign, secretSuffix string) string { secret := signer.sessionCredential.AccessKeySecret + secretSuffix return ShaHmac1(stringToSign, secret) } func (signer *RamRoleArnSigner) buildCommonRequest() (request *requests.CommonRequest, err error) { request = requests.NewCommonRequest() request.Product = "Sts" request.Version = "2015-04-01" request.ApiName = "AssumeRole" request.Scheme = requests.HTTPS request.QueryParams["RoleArn"] = signer.credential.RoleArn if signer.credential.Policy != "" { request.QueryParams["Policy"] = signer.credential.Policy } request.QueryParams["RoleSessionName"] = signer.credential.RoleSessionName request.QueryParams["DurationSeconds"] = strconv.Itoa(signer.credentialExpiration) return } func (signer *RamRoleArnSigner) refreshApi(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { credential := &credentials.AccessKeyCredential{ AccessKeyId: signer.credential.AccessKeyId, AccessKeySecret: signer.credential.AccessKeySecret, } signerV1 := NewAccessKeySigner(credential) return signer.commonApi(request, signerV1) } func (signer *RamRoleArnSigner) refreshCredential(response *responses.CommonResponse) (err error) { if response.GetHttpStatus() != http.StatusOK { message := "refresh session token failed" err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), message) return } var data interface{} err = json.Unmarshal(response.GetHttpContentBytes(), &data) if err != nil { return fmt.Errorf("refresh RoleArn sts token err, json.Unmarshal fail: %s", err.Error()) } accessKeyId, err := jmespath.Search("Credentials.AccessKeyId", data) if err != nil { return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeyId: %s", err.Error()) } accessKeySecret, err := jmespath.Search("Credentials.AccessKeySecret", data) if err != nil { return fmt.Errorf("refresh RoleArn sts token err, fail to get AccessKeySecret: %s", err.Error()) } securityToken, err := jmespath.Search("Credentials.SecurityToken", data) if err != nil { return fmt.Errorf("refresh RoleArn sts token err, fail to get SecurityToken: %s", err.Error()) } if accessKeyId == nil || accessKeySecret == nil || securityToken == nil { return } signer.sessionCredential = &SessionCredential{ AccessKeyId: accessKeyId.(string), AccessKeySecret: accessKeySecret.(string), StsToken: securityToken.(string), } return } func (signer *RamRoleArnSigner) GetSessionCredential() *SessionCredential { return signer.sessionCredential } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_sts_token.go�0000664�0000000�0000000�00000002744�13771713062�0033273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" ) type StsTokenSigner struct { credential *credentials.StsTokenCredential } func NewStsTokenSigner(credential *credentials.StsTokenCredential) *StsTokenSigner { return &StsTokenSigner{ credential: credential, } } func (*StsTokenSigner) GetName() string { return "HMAC-SHA1" } func (*StsTokenSigner) GetType() string { return "" } func (*StsTokenSigner) GetVersion() string { return "1.0" } func (signer *StsTokenSigner) GetAccessKeyId() (accessKeyId string, err error) { return signer.credential.AccessKeyId, nil } func (signer *StsTokenSigner) GetExtraParam() map[string]string { return map[string]string{"SecurityToken": signer.credential.AccessKeyStsToken} } func (signer *StsTokenSigner) Sign(stringToSign, secretSuffix string) string { secret := signer.credential.AccessKeySecret + secretSuffix return ShaHmac1(stringToSign, secret) } ����������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers/signer_v2.go��������0000664�0000000�0000000�00000002547�13771713062�0031612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package signers import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" ) type SignerV2 struct { credential *credentials.RsaKeyPairCredential } func (signer *SignerV2) GetExtraParam() map[string]string { return nil } func NewSignerV2(credential *credentials.RsaKeyPairCredential) *SignerV2 { return &SignerV2{ credential: credential, } } func (*SignerV2) GetName() string { return "SHA256withRSA" } func (*SignerV2) GetType() string { return "PRIVATEKEY" } func (*SignerV2) GetVersion() string { return "1.0" } func (signer *SignerV2) GetAccessKeyId() (accessKeyId string, err error) { return signer.credential.PublicKeyId, err } func (signer *SignerV2) Sign(stringToSign, secretSuffix string) string { secret := signer.credential.PrivateKey return Sha256WithRsa(stringToSign, secret) } ���������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/client.go������������������������0000664�0000000�0000000�00000053351�13771713062�0026556�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sdk import ( "context" "crypto/tls" "fmt" "net" "net/http" "net/url" "os" "runtime" "strconv" "strings" "sync" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) var debug utils.Debug func init() { debug = utils.Init("sdk") } // Version this value will be replaced while build: -ldflags="-X sdk.version=x.x.x" var Version = "0.0.1" var defaultConnectTimeout = 5 * time.Second var defaultReadTimeout = 10 * time.Second var DefaultUserAgent = fmt.Sprintf("AlibabaCloud (%s; %s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version) var hookDo = func(fn func(req *http.Request) (*http.Response, error)) func(req *http.Request) (*http.Response, error) { return fn } // Client the type Client type Client struct { isInsecure bool regionId string config *Config httpProxy string httpsProxy string noProxy string logger *Logger userAgent map[string]string signer auth.Signer httpClient *http.Client asyncTaskQueue chan func() readTimeout time.Duration connectTimeout time.Duration debug bool isRunning bool // void "panic(write to close channel)" cause of addAsync() after Shutdown() asyncChanLock *sync.RWMutex } func (client *Client) Init() (err error) { panic("not support yet") } func (client *Client) SetHTTPSInsecure(isInsecure bool) { client.isInsecure = isInsecure } func (client *Client) GetHTTPSInsecure() bool { return client.isInsecure } func (client *Client) SetHttpsProxy(httpsProxy string) { client.httpsProxy = httpsProxy } func (client *Client) GetHttpsProxy() string { return client.httpsProxy } func (client *Client) SetHttpProxy(httpProxy string) { client.httpProxy = httpProxy } func (client *Client) GetHttpProxy() string { return client.httpProxy } func (client *Client) SetNoProxy(noProxy string) { client.noProxy = noProxy } func (client *Client) GetNoProxy() string { return client.noProxy } // InitWithProviderChain will get credential from the providerChain, // the RsaKeyPairCredential Only applicable to regionID `ap-northeast-1`, // if your providerChain may return a credential type with RsaKeyPairCredential, // please ensure your regionID is `ap-northeast-1`. func (client *Client) InitWithProviderChain(regionId string, provider provider.Provider) (err error) { config := client.InitClientConfig() credential, err := provider.Resolve() if err != nil { return } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitWithOptions(regionId string, config *Config, credential auth.Credential) (err error) { client.isRunning = true client.asyncChanLock = new(sync.RWMutex) client.regionId = regionId client.config = config client.httpClient = &http.Client{} if config.HttpTransport != nil { client.httpClient.Transport = config.HttpTransport } if config.Timeout > 0 { client.httpClient.Timeout = config.Timeout } if config.EnableAsync { client.EnableAsync(config.GoRoutinePoolSize, config.MaxTaskQueueSize) } client.signer, err = auth.NewSignerWithCredential(credential, client.ProcessCommonRequestWithSigner) return } func (client *Client) SetReadTimeout(readTimeout time.Duration) { client.readTimeout = readTimeout } func (client *Client) SetConnectTimeout(connectTimeout time.Duration) { client.connectTimeout = connectTimeout } func (client *Client) GetReadTimeout() time.Duration { return client.readTimeout } func (client *Client) GetConnectTimeout() time.Duration { return client.connectTimeout } func (client *Client) getHttpProxy(scheme string) (proxy *url.URL, err error) { if scheme == "https" { if client.GetHttpsProxy() != "" { proxy, err = url.Parse(client.httpsProxy) } else if rawurl := os.Getenv("HTTPS_PROXY"); rawurl != "" { proxy, err = url.Parse(rawurl) } else if rawurl := os.Getenv("https_proxy"); rawurl != "" { proxy, err = url.Parse(rawurl) } } else { if client.GetHttpProxy() != "" { proxy, err = url.Parse(client.httpProxy) } else if rawurl := os.Getenv("HTTP_PROXY"); rawurl != "" { proxy, err = url.Parse(rawurl) } else if rawurl := os.Getenv("http_proxy"); rawurl != "" { proxy, err = url.Parse(rawurl) } } return proxy, err } func (client *Client) getNoProxy(scheme string) []string { var urls []string if client.GetNoProxy() != "" { urls = strings.Split(client.noProxy, ",") } else if rawurl := os.Getenv("NO_PROXY"); rawurl != "" { urls = strings.Split(rawurl, ",") } else if rawurl := os.Getenv("no_proxy"); rawurl != "" { urls = strings.Split(rawurl, ",") } return urls } // EnableAsync enable the async task queue func (client *Client) EnableAsync(routinePoolSize, maxTaskQueueSize int) { client.asyncTaskQueue = make(chan func(), maxTaskQueueSize) for i := 0; i < routinePoolSize; i++ { go func() { for client.isRunning { select { case task, notClosed := <-client.asyncTaskQueue: if notClosed { task() } } } }() } } func (client *Client) InitWithAccessKey(regionId, accessKeyId, accessKeySecret string) (err error) { config := client.InitClientConfig() credential := &credentials.BaseCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitWithStsToken(regionId, accessKeyId, accessKeySecret, securityToken string) (err error) { config := client.InitClientConfig() credential := &credentials.StsTokenCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, AccessKeyStsToken: securityToken, } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error) { config := client.InitClientConfig() credential := &credentials.RamRoleArnCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, RoleArn: roleArn, RoleSessionName: roleSessionName, } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (err error) { config := client.InitClientConfig() credential := &credentials.RamRoleArnCredential{ AccessKeyId: accessKeyId, AccessKeySecret: accessKeySecret, RoleArn: roleArn, RoleSessionName: roleSessionName, Policy: policy, } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) { config := client.InitClientConfig() credential := &credentials.RsaKeyPairCredential{ PrivateKey: privateKey, PublicKeyId: publicKeyId, SessionExpiration: sessionExpiration, } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitWithEcsRamRole(regionId, roleName string) (err error) { config := client.InitClientConfig() credential := &credentials.EcsRamRoleCredential{ RoleName: roleName, } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitWithBearerToken(regionId, bearerToken string) (err error) { config := client.InitClientConfig() credential := &credentials.BearerTokenCredential{ BearerToken: bearerToken, } return client.InitWithOptions(regionId, config, credential) } func (client *Client) InitClientConfig() (config *Config) { if client.config != nil { return client.config } else { return NewConfig() } } func (client *Client) DoAction(request requests.AcsRequest, response responses.AcsResponse) (err error) { return client.DoActionWithSigner(request, response, nil) } func (client *Client) buildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (httpRequest *http.Request, err error) { // add clientVersion request.GetHeaders()["x-sdk-core-version"] = Version regionId := client.regionId if len(request.GetRegionId()) > 0 { regionId = request.GetRegionId() } // resolve endpoint resolveParam := &endpoints.ResolveParam{ Domain: request.GetDomain(), Product: request.GetProduct(), RegionId: regionId, LocationProduct: request.GetLocationServiceCode(), LocationEndpointType: request.GetLocationEndpointType(), CommonApi: client.ProcessCommonRequest, } endpoint, err := endpoints.Resolve(resolveParam) if err != nil { return } request.SetDomain(endpoint) if request.GetScheme() == "" { request.SetScheme(client.config.Scheme) } // init request params err = requests.InitParams(request) if err != nil { return } // signature var finalSigner auth.Signer if signer != nil { finalSigner = signer } else { finalSigner = client.signer } httpRequest, err = buildHttpRequest(request, finalSigner, regionId) if err == nil { userAgent := DefaultUserAgent + getSendUserAgent(client.config.UserAgent, client.userAgent, request.GetUserAgent()) httpRequest.Header.Set("User-Agent", userAgent) } return } func getSendUserAgent(configUserAgent string, clientUserAgent, requestUserAgent map[string]string) string { realUserAgent := "" for key1, value1 := range clientUserAgent { for key2, _ := range requestUserAgent { if key1 == key2 { key1 = "" } } if key1 != "" { realUserAgent += fmt.Sprintf(" %s/%s", key1, value1) } } for key, value := range requestUserAgent { realUserAgent += fmt.Sprintf(" %s/%s", key, value) } if configUserAgent != "" { return realUserAgent + fmt.Sprintf(" Extra/%s", configUserAgent) } return realUserAgent } func (client *Client) AppendUserAgent(key, value string) { newkey := true if client.userAgent == nil { client.userAgent = make(map[string]string) } if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" { for tag, _ := range client.userAgent { if tag == key { client.userAgent[tag] = value newkey = false } } if newkey { client.userAgent[key] = value } } } func (client *Client) BuildRequestWithSigner(request requests.AcsRequest, signer auth.Signer) (err error) { _, err = client.buildRequestWithSigner(request, signer) return } func (client *Client) getTimeout(request requests.AcsRequest) (time.Duration, time.Duration) { readTimeout := defaultReadTimeout connectTimeout := defaultConnectTimeout reqReadTimeout := request.GetReadTimeout() reqConnectTimeout := request.GetConnectTimeout() if reqReadTimeout != 0*time.Millisecond { readTimeout = reqReadTimeout } else if client.readTimeout != 0*time.Millisecond { readTimeout = client.readTimeout } else if client.httpClient.Timeout != 0 && client.httpClient.Timeout != 10000000000 { readTimeout = client.httpClient.Timeout } if reqConnectTimeout != 0*time.Millisecond { connectTimeout = reqConnectTimeout } else if client.connectTimeout != 0*time.Millisecond { connectTimeout = client.connectTimeout } return readTimeout, connectTimeout } func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error) { return func(ctx context.Context, network, address string) (net.Conn, error) { return (&net.Dialer{ Timeout: connectTimeout, DualStack: true, }).DialContext(ctx, network, address) } } func (client *Client) setTimeout(request requests.AcsRequest) { readTimeout, connectTimeout := client.getTimeout(request) client.httpClient.Timeout = readTimeout if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil { trans.DialContext = Timeout(connectTimeout) client.httpClient.Transport = trans } else { client.httpClient.Transport = &http.Transport{ DialContext: Timeout(connectTimeout), } } } func (client *Client) getHTTPSInsecure(request requests.AcsRequest) (insecure bool) { if request.GetHTTPSInsecure() != nil { insecure = *request.GetHTTPSInsecure() } else { insecure = client.GetHTTPSInsecure() } return insecure } func (client *Client) DoActionWithSigner(request requests.AcsRequest, response responses.AcsResponse, signer auth.Signer) (err error) { fieldMap := make(map[string]string) initLogMsg(fieldMap) defer func() { client.printLog(fieldMap, err) }() httpRequest, err := client.buildRequestWithSigner(request, signer) if err != nil { return } client.setTimeout(request) proxy, err := client.getHttpProxy(httpRequest.URL.Scheme) if err != nil { return err } noProxy := client.getNoProxy(httpRequest.URL.Scheme) var flag bool for _, value := range noProxy { if value == httpRequest.Host { flag = true break } } // Set whether to ignore certificate validation. // Default InsecureSkipVerify is false. if trans, ok := client.httpClient.Transport.(*http.Transport); ok && trans != nil { trans.TLSClientConfig = &tls.Config{ InsecureSkipVerify: client.getHTTPSInsecure(request), } if proxy != nil && !flag { trans.Proxy = http.ProxyURL(proxy) } client.httpClient.Transport = trans } var httpResponse *http.Response for retryTimes := 0; retryTimes <= client.config.MaxRetryTime; retryTimes++ { if proxy != nil && proxy.User != nil { if password, passwordSet := proxy.User.Password(); passwordSet { httpRequest.SetBasicAuth(proxy.User.Username(), password) } } if retryTimes > 0 { client.printLog(fieldMap, err) initLogMsg(fieldMap) } putMsgToMap(fieldMap, httpRequest) debug("> %s %s %s", httpRequest.Method, httpRequest.URL.RequestURI(), httpRequest.Proto) debug("> Host: %s", httpRequest.Host) for key, value := range httpRequest.Header { debug("> %s: %v", key, strings.Join(value, "")) } debug(">") debug(" Retry Times: %d.", retryTimes) startTime := time.Now() fieldMap["{start_time}"] = startTime.Format("2006-01-02 15:04:05") httpResponse, err = hookDo(client.httpClient.Do)(httpRequest) fieldMap["{cost}"] = time.Now().Sub(startTime).String() if err == nil { fieldMap["{code}"] = strconv.Itoa(httpResponse.StatusCode) fieldMap["{res_headers}"] = TransToString(httpResponse.Header) debug("< %s %s", httpResponse.Proto, httpResponse.Status) for key, value := range httpResponse.Header { debug("< %s: %v", key, strings.Join(value, "")) } } debug("<") // receive error if err != nil { debug(" Error: %s.", err.Error()) if !client.config.AutoRetry { return } else if retryTimes >= client.config.MaxRetryTime { // timeout but reached the max retry times, return times := strconv.Itoa(retryTimes + 1) timeoutErrorMsg := fmt.Sprintf(errors.TimeoutErrorMessage, times, times) if strings.Contains(err.Error(), "Client.Timeout") { timeoutErrorMsg += " Read timeout. Please set a valid ReadTimeout." } else { timeoutErrorMsg += " Connect timeout. Please set a valid ConnectTimeout." } err = errors.NewClientError(errors.TimeoutErrorCode, timeoutErrorMsg, err) return } } // if status code >= 500 or timeout, will trigger retry if client.config.AutoRetry && (err != nil || isServerError(httpResponse)) { client.setTimeout(request) // rewrite signatureNonce and signature httpRequest, err = client.buildRequestWithSigner(request, signer) // buildHttpRequest(request, finalSigner, regionId) if err != nil { return } continue } break } err = responses.Unmarshal(response, httpResponse, request.GetAcceptFormat()) // wrap server errors if serverErr, ok := err.(*errors.ServerError); ok { var wrapInfo = map[string]string{} wrapInfo["StringToSign"] = request.GetStringToSign() err = errors.WrapServerError(serverErr, wrapInfo) } return } func putMsgToMap(fieldMap map[string]string, request *http.Request) { fieldMap["{host}"] = request.Host fieldMap["{method}"] = request.Method fieldMap["{uri}"] = request.URL.RequestURI() fieldMap["{pid}"] = strconv.Itoa(os.Getpid()) fieldMap["{version}"] = strings.Split(request.Proto, "/")[1] hostname, _ := os.Hostname() fieldMap["{hostname}"] = hostname fieldMap["{req_headers}"] = TransToString(request.Header) fieldMap["{target}"] = request.URL.Path + request.URL.RawQuery } func buildHttpRequest(request requests.AcsRequest, singer auth.Signer, regionId string) (httpRequest *http.Request, err error) { err = auth.Sign(request, singer, regionId) if err != nil { return } requestMethod := request.GetMethod() requestUrl := request.BuildUrl() body := request.GetBodyReader() httpRequest, err = http.NewRequest(requestMethod, requestUrl, body) if err != nil { return } for key, value := range request.GetHeaders() { httpRequest.Header[key] = []string{value} } // host is a special case if host, containsHost := request.GetHeaders()["Host"]; containsHost { httpRequest.Host = host } return } func isServerError(httpResponse *http.Response) bool { return httpResponse.StatusCode >= http.StatusInternalServerError } /** only block when any one of the following occurs: 1. the asyncTaskQueue is full, increase the queue size to avoid this 2. Shutdown() in progressing, the client is being closed **/ func (client *Client) AddAsyncTask(task func()) (err error) { if client.asyncTaskQueue != nil { client.asyncChanLock.RLock() defer client.asyncChanLock.RUnlock() if client.isRunning { client.asyncTaskQueue <- task } } else { err = errors.NewClientError(errors.AsyncFunctionNotEnabledCode, errors.AsyncFunctionNotEnabledMessage, nil) } return } func (client *Client) GetConfig() *Config { return client.config } func NewClient() (client *Client, err error) { client = &Client{} err = client.Init() return } func NewClientWithProvider(regionId string, providers ...provider.Provider) (client *Client, err error) { client = &Client{} var pc provider.Provider if len(providers) == 0 { pc = provider.DefaultChain } else { pc = provider.NewProviderChain(providers) } err = client.InitWithProviderChain(regionId, pc) return } func NewClientWithOptions(regionId string, config *Config, credential auth.Credential) (client *Client, err error) { client = &Client{} err = client.InitWithOptions(regionId, config, credential) return } func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) { client = &Client{} err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret) return } func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) { client = &Client{} err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken) return } func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { client = &Client{} err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) return } func NewClientWithRamRoleArnAndPolicy(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy string) (client *Client, err error) { client = &Client{} err = client.InitWithRamRoleArnAndPolicy(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy) return } func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) { client = &Client{} err = client.InitWithEcsRamRole(regionId, roleName) return } func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) { client = &Client{} err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration) return } func NewClientWithBearerToken(regionId, bearerToken string) (client *Client, err error) { client = &Client{} err = client.InitWithBearerToken(regionId, bearerToken) return } func (client *Client) ProcessCommonRequest(request *requests.CommonRequest) (response *responses.CommonResponse, err error) { request.TransToAcsRequest() response = responses.NewCommonResponse() err = client.DoAction(request, response) return } func (client *Client) ProcessCommonRequestWithSigner(request *requests.CommonRequest, signerInterface interface{}) (response *responses.CommonResponse, err error) { if signer, isSigner := signerInterface.(auth.Signer); isSigner { request.TransToAcsRequest() response = responses.NewCommonResponse() err = client.DoActionWithSigner(request, response, signer) return } panic("should not be here") } func (client *Client) Shutdown() { // lock the addAsync() client.asyncChanLock.Lock() defer client.asyncChanLock.Unlock() if client.asyncTaskQueue != nil { close(client.asyncTaskQueue) } client.isRunning = false } // Deprecated: Use NewClientWithRamRoleArn in this package instead. func NewClientWithStsRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { return NewClientWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) } // Deprecated: Use NewClientWithEcsRamRole in this package instead. func NewClientWithStsRoleNameOnEcs(regionId string, roleName string) (client *Client, err error) { return NewClientWithEcsRamRole(regionId, roleName) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/config.go������������������������0000664�0000000�0000000�00000004451�13771713062�0026542�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package sdk import ( "net/http" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) type Config struct { AutoRetry bool `default:"true"` MaxRetryTime int `default:"3"` UserAgent string `default:""` Debug bool `default:"false"` Timeout time.Duration `default:"10000000000"` HttpTransport *http.Transport `default:""` EnableAsync bool `default:"false"` MaxTaskQueueSize int `default:"1000"` GoRoutinePoolSize int `default:"5"` Scheme string `default:"HTTP"` } func NewConfig() (config *Config) { config = &Config{} utils.InitStructWithDefaultTag(config) return } func (c *Config) WithAutoRetry(isAutoRetry bool) *Config { c.AutoRetry = isAutoRetry return c } func (c *Config) WithMaxRetryTime(maxRetryTime int) *Config { c.MaxRetryTime = maxRetryTime return c } func (c *Config) WithUserAgent(userAgent string) *Config { c.UserAgent = userAgent return c } func (c *Config) WithDebug(isDebug bool) *Config { c.Debug = isDebug return c } func (c *Config) WithTimeout(timeout time.Duration) *Config { c.Timeout = timeout return c } func (c *Config) WithHttpTransport(httpTransport *http.Transport) *Config { c.HttpTransport = httpTransport return c } func (c *Config) WithEnableAsync(isEnableAsync bool) *Config { c.EnableAsync = isEnableAsync return c } func (c *Config) WithMaxTaskQueueSize(maxTaskQueueSize int) *Config { c.MaxTaskQueueSize = maxTaskQueueSize return c } func (c *Config) WithGoRoutinePoolSize(goRoutinePoolSize int) *Config { c.GoRoutinePoolSize = goRoutinePoolSize return c } func (c *Config) WithScheme(scheme string) *Config { c.Scheme = scheme return c } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/�����������������������0000775�0000000�0000000�00000000000�13771713062�0026745�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/endpoints_config.go����0000664�0000000�0000000�00000112214�13771713062�0032625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ package endpoints import ( "encoding/json" "fmt" "sync" ) const endpointsJson =`{ "products": [ { "code": "ecs", "document_id": "25484", "location_service_code": "ecs", "regional_endpoints": [ { "region": "cn-shanghai", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "ecs.eu-west-1.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "ecs.cn-huhehaote.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "ecs.me-east-1.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "ecs.ap-southeast-3.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "ecs.ap-southeast-2.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "ecs.ap-south-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "ecs.ap-northeast-1.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "ecs.ap-southeast-5.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "ecs.eu-central-1.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "ecs.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "ecs-cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "ecs-cn-hangzhou.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "chatbot", "document_id": "60760", "location_service_code": "beebot", "regional_endpoints": [ { "region": "cn-shanghai", "endpoint": "chatbot.cn-shanghai.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "chatbot.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "chatbot.[RegionId].aliyuncs.com" }, { "code": "alidns", "document_id": "29739", "location_service_code": "alidns", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "alidns.aliyuncs.com" } ], "global_endpoint": "alidns.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "itaas", "document_id": "55759", "location_service_code": "itaas", "regional_endpoints": null, "global_endpoint": "itaas.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "csb", "document_id": "64837", "location_service_code": "csb", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "csb.cn-hangzhou.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "csb.cn-beijing.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "csb.[RegionId].aliyuncs.com" }, { "code": "slb", "document_id": "27565", "location_service_code": "slb", "regional_endpoints": [ { "region": "cn-hongkong", "endpoint": "slb.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "slb.me-east-1.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "slb.ap-southeast-5.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "slb.ap-southeast-2.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "slb.ap-south-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "slb.eu-central-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "slb.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "slb.eu-west-1.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "slb.cn-huhehaote.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "slb.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "slb.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "slb.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "slb.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "slb.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "slb.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "slb.ap-southeast-3.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "slb.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "slb.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "slb.ap-northeast-1.aliyuncs.com" } ], "global_endpoint": "slb.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "cloudwf", "document_id": "58111", "location_service_code": "cloudwf", "regional_endpoints": null, "global_endpoint": "cloudwf.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "cloudphoto", "document_id": "59902", "location_service_code": "cloudphoto", "regional_endpoints": [ { "region": "cn-shanghai", "endpoint": "cloudphoto.cn-shanghai.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "cloudphoto.[RegionId].aliyuncs.com" }, { "code": "dds", "document_id": "61715", "location_service_code": "dds", "regional_endpoints": [ { "region": "ap-southeast-5", "endpoint": "mongodb.ap-southeast-5.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "mongodb.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "mongodb.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "mongodb.eu-west-1.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "mongodb.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "mongodb.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "mongodb.me-east-1.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "mongodb.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "mongodb.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "mongodb.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "mongodb.ap-northeast-1.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "mongodb.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "mongodb.ap-southeast-2.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "mongodb.ap-southeast-3.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "mongodb.ap-south-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "mongodb.eu-central-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "mongodb.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "mongodb.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "mongodb.cn-huhehaote.aliyuncs.com" } ], "global_endpoint": "mongodb.aliyuncs.com", "regional_endpoint_pattern": "mongodb.[RegionId].aliyuncs.com" }, { "code": "dm", "document_id": "29434", "location_service_code": "dm", "regional_endpoints": [ { "region": "ap-southeast-2", "endpoint": "dm.ap-southeast-2.aliyuncs.com" } ], "global_endpoint": "dm.aliyuncs.com", "regional_endpoint_pattern": "dm.[RegionId].aliyuncs.com" }, { "code": "ons", "document_id": "44416", "location_service_code": "ons", "regional_endpoints": [ { "region": "cn-zhangjiakou", "endpoint": "ons.cn-zhangjiakou.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "ons.us-west-1.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "ons.me-east-1.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "ons.us-east-1.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "ons.ap-northeast-1.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "ons.ap-southeast-2.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "ons.ap-southeast-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "ons.cn-shanghai.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "ons.cn-shenzhen.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "ons.cn-hangzhou.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "ons.cn-hangzhou.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "ons.eu-central-1.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "ons.eu-west-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "ons.cn-beijing.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "ons.ap-southeast-3.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "ons.cn-huhehaote.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "ons.cn-hongkong.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "ons.cn-qingdao.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "" }, { "code": "polardb", "document_id": "58764", "location_service_code": "polardb", "regional_endpoints": [ { "region": "cn-qingdao", "endpoint": "polardb.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "polardb.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "polardb.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "polardb.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "polardb.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "polardb.cn-huhehaote.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "polardb.ap-southeast-5.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "polardb.ap-south-1.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "polardb.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "polardb.aliyuncs.com" }, { "code": "batchcompute", "document_id": "44717", "location_service_code": "batchcompute", "regional_endpoints": [ { "region": "us-west-1", "endpoint": "batchcompute.us-west-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "batchcompute.cn-beijing.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "batchcompute.cn-hangzhou.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "batchcompute.cn-shanghai.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "batchcompute.ap-southeast-1.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "batchcompute.cn-huhehaote.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "batchcompute.cn-qingdao.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "batchcompute.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "batchcompute.cn-shenzhen.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "batchcompute.[RegionId].aliyuncs.com" }, { "code": "cloudauth", "document_id": "60687", "location_service_code": "cloudauth", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "cloudauth.aliyuncs.com" } ], "global_endpoint": "cloudauth.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "vod", "document_id": "60574", "location_service_code": "vod", "regional_endpoints": [ { "region": "cn-beijing", "endpoint": "vod.cn-shanghai.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "vod.ap-southeast-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "vod.eu-central-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "vod.cn-shanghai.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "vod.cn-shanghai.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "vod.cn-shanghai.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "" }, { "code": "ram", "document_id": "28672", "location_service_code": "ram", "regional_endpoints": null, "global_endpoint": "ram.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "ess", "document_id": "25925", "location_service_code": "ess", "regional_endpoints": [ { "region": "me-east-1", "endpoint": "ess.me-east-1.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "ess.ap-northeast-1.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "ess.ap-south-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "ess.eu-central-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "ess.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "ess.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "ess.cn-huhehaote.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "ess.ap-southeast-2.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "ess.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "ess.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "ess.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "ess.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "ess.ap-southeast-5.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "ess.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "ess.ap-southeast-3.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "ess.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "ess.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "ess.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "ess.eu-west-1.aliyuncs.com" } ], "global_endpoint": "ess.aliyuncs.com", "regional_endpoint_pattern": "ess.[RegionId].aliyuncs.com" }, { "code": "live", "document_id": "48207", "location_service_code": "live", "regional_endpoints": [ { "region": "cn-beijing", "endpoint": "live.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "live.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "live.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "live.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "live.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "live.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "live.aliyuncs.com" } ], "global_endpoint": "live.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "hpc", "document_id": "35201", "location_service_code": "hpc", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "hpc.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "hpc.aliyuncs.com" } ], "global_endpoint": "hpc.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "rds", "document_id": "26223", "location_service_code": "rds", "regional_endpoints": [ { "region": "me-east-1", "endpoint": "rds.me-east-1.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "rds.ap-south-1.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "rds.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "rds.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "rds.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "rds.ap-southeast-3.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "rds.ap-southeast-2.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "rds.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "rds.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "rds.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "rds.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "rds.ap-southeast-5.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "rds.eu-central-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "rds.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "rds.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "rds.eu-west-1.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "rds.cn-huhehaote.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "rds.ap-northeast-1.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "rds.aliyuncs.com" } ], "global_endpoint": "rds.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "cloudapi", "document_id": "43590", "location_service_code": "apigateway", "regional_endpoints": [ { "region": "cn-beijing", "endpoint": "apigateway.cn-beijing.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "apigateway.ap-southeast-2.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "apigateway.ap-south-1.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "apigateway.us-east-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "apigateway.cn-shanghai.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "apigateway.us-west-1.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "apigateway.ap-southeast-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "apigateway.eu-central-1.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "apigateway.cn-qingdao.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "apigateway.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "apigateway.cn-huhehaote.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "apigateway.eu-west-1.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "apigateway.me-east-1.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "apigateway.cn-hangzhou.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "apigateway.ap-northeast-1.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "apigateway.ap-southeast-5.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "apigateway.cn-hongkong.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "apigateway.cn-shenzhen.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "apigateway.ap-southeast-3.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "apigateway.[RegionId].aliyuncs.com" }, { "code": "sas-api", "document_id": "28498", "location_service_code": "sas", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "sas.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "" }, { "code": "cs", "document_id": "26043", "location_service_code": "cs", "regional_endpoints": null, "global_endpoint": "cs.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "jaq", "document_id": "35037", "location_service_code": "jaq", "regional_endpoints": null, "global_endpoint": "jaq.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "r-kvstore", "document_id": "60831", "location_service_code": "redisa", "regional_endpoints": [ { "region": "cn-huhehaote", "endpoint": "r-kvstore.cn-huhehaote.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "r-kvstore.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "r-kvstore.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "r-kvstore.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "r-kvstore.ap-south-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "r-kvstore.eu-central-1.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "r-kvstore.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "r-kvstore.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "r-kvstore.me-east-1.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "r-kvstore.ap-northeast-1.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "r-kvstore.cn-hongkong.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "r-kvstore.ap-southeast-2.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "r-kvstore.eu-west-1.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "r-kvstore.ap-southeast-5.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "r-kvstore.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "r-kvstore.ap-southeast-1.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "r-kvstore.ap-southeast-3.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "r-kvstore.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "r-kvstore.aliyuncs.com" } ], "global_endpoint": "r-kvstore.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "drds", "document_id": "51111", "location_service_code": "drds", "regional_endpoints": [ { "region": "ap-southeast-1", "endpoint": "drds.ap-southeast-1.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "drds.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "drds.aliyuncs.com", "regional_endpoint_pattern": "drds.aliyuncs.com" }, { "code": "waf", "document_id": "62847", "location_service_code": "waf", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "wafopenapi.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "" }, { "code": "sts", "document_id": "28756", "location_service_code": "sts", "regional_endpoints": null, "global_endpoint": "sts.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "cr", "document_id": "60716", "location_service_code": "cr", "regional_endpoints": null, "global_endpoint": "cr.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "arms", "document_id": "42924", "location_service_code": "arms", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "arms.cn-hangzhou.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "arms.cn-shanghai.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "arms.cn-hongkong.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "arms.ap-southeast-1.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "arms.cn-shenzhen.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "arms.cn-qingdao.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "arms.cn-beijing.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "arms.[RegionId].aliyuncs.com" }, { "code": "iot", "document_id": "30557", "location_service_code": "iot", "regional_endpoints": [ { "region": "us-east-1", "endpoint": "iot.us-east-1.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "iot.ap-northeast-1.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "iot.us-west-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "iot.eu-central-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "iot.cn-shanghai.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "iot.ap-southeast-1.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "iot.[RegionId].aliyuncs.com" }, { "code": "vpc", "document_id": "34962", "location_service_code": "vpc", "regional_endpoints": [ { "region": "us-west-1", "endpoint": "vpc.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "vpc.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "vpc.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "vpc.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "vpc.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "vpc.cn-huhehaote.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "vpc.me-east-1.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "vpc.ap-northeast-1.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "vpc.ap-southeast-3.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "vpc.eu-central-1.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "vpc.ap-southeast-5.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "vpc.ap-south-1.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "vpc.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "vpc.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "vpc.ap-southeast-2.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "vpc.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "vpc.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "vpc.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "vpc.eu-west-1.aliyuncs.com" } ], "global_endpoint": "vpc.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "aegis", "document_id": "28449", "location_service_code": "vipaegis", "regional_endpoints": [ { "region": "ap-southeast-3", "endpoint": "aegis.ap-southeast-3.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "aegis.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "aegis.cn-hangzhou.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "domain", "document_id": "42875", "location_service_code": "domain", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "domain.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "domain-intl.aliyuncs.com" } ], "global_endpoint": "domain.aliyuncs.com", "regional_endpoint_pattern": "domain.aliyuncs.com" }, { "code": "cdn", "document_id": "27148", "location_service_code": "cdn", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "cdn.aliyuncs.com" } ], "global_endpoint": "cdn.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "qualitycheck", "document_id": "50807", "location_service_code": "qualitycheck", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "qualitycheck.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "" }, { "code": "emr", "document_id": "28140", "location_service_code": "emr", "regional_endpoints": [ { "region": "us-east-1", "endpoint": "emr.us-east-1.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "emr.ap-southeast-5.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "emr.eu-central-1.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "emr.eu-west-1.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "emr.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "emr.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "emr.ap-south-1.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "emr.me-east-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "emr.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "emr.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "emr.cn-hongkong.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "emr.cn-huhehaote.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "emr.ap-northeast-1.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "emr.ap-southeast-3.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "emr.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "emr.ap-southeast-2.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "emr.cn-zhangjiakou.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "emr.cn-qingdao.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "emr.aliyuncs.com" } ], "global_endpoint": "emr.aliyuncs.com", "regional_endpoint_pattern": "emr.[RegionId].aliyuncs.com" }, { "code": "httpdns", "document_id": "52679", "location_service_code": "httpdns", "regional_endpoints": null, "global_endpoint": "httpdns-api.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "push", "document_id": "30074", "location_service_code": "push", "regional_endpoints": null, "global_endpoint": "cloudpush.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "cms", "document_id": "28615", "location_service_code": "cms", "regional_endpoints": [ { "region": "cn-qingdao", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "metrics.eu-west-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "metrics.ap-northeast-1.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "metrics.ap-south-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "ap-southeast-5", "endpoint": "metrics.ap-southeast-5.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "metrics.cn-huhehaote.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "me-east-1", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "metrics.ap-southeast-3.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "metrics.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "metrics.cn-hangzhou.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "nas", "document_id": "62598", "location_service_code": "nas", "regional_endpoints": [ { "region": "ap-southeast-5", "endpoint": "nas.ap-southeast-5.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "nas.ap-south-1.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "nas.us-west-1.aliyuncs.com" }, { "region": "ap-southeast-3", "endpoint": "nas.ap-southeast-3.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "nas.cn-zhangjiakou.aliyuncs.com" }, { "region": "ap-northeast-1", "endpoint": "nas.ap-northeast-1.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "nas.cn-hangzhou.aliyuncs.com" }, { "region": "cn-qingdao", "endpoint": "nas.cn-qingdao.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "nas.cn-beijing.aliyuncs.com" }, { "region": "ap-southeast-2", "endpoint": "nas.ap-southeast-2.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "nas.cn-shenzhen.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "nas.eu-central-1.aliyuncs.com" }, { "region": "cn-huhehaote", "endpoint": "nas.cn-huhehaote.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "nas.cn-shanghai.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "nas.cn-hongkong.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "nas.ap-southeast-1.aliyuncs.com" }, { "region": "us-east-1", "endpoint": "nas.us-east-1.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "" }, { "code": "cds", "document_id": "62887", "location_service_code": "codepipeline", "regional_endpoints": [ { "region": "cn-beijing", "endpoint": "cds.cn-beijing.aliyuncs.com" } ], "global_endpoint": "cds.cn-beijing.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "green", "document_id": "28427", "location_service_code": "green", "regional_endpoints": [ { "region": "us-west-1", "endpoint": "green.us-west-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "green.cn-beijing.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "green.ap-southeast-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "green.cn-shanghai.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "green.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "green.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "ccc", "document_id": "63027", "location_service_code": "ccc", "regional_endpoints": [ { "region": "cn-shanghai", "endpoint": "ccc.cn-shanghai.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "ccc.cn-hangzhou.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "ccc.[RegionId].aliyuncs.com" }, { "code": "ros", "document_id": "28899", "location_service_code": "ros", "regional_endpoints": [ { "region": "cn-hangzhou", "endpoint": "ros.aliyuncs.com" } ], "global_endpoint": "ros.aliyuncs.com", "regional_endpoint_pattern": "" }, { "code": "mts", "document_id": "29212", "location_service_code": "mts", "regional_endpoints": [ { "region": "ap-northeast-1", "endpoint": "mts.ap-northeast-1.aliyuncs.com" }, { "region": "cn-shanghai", "endpoint": "mts.cn-shanghai.aliyuncs.com" }, { "region": "cn-hongkong", "endpoint": "mts.cn-hongkong.aliyuncs.com" }, { "region": "cn-shenzhen", "endpoint": "mts.cn-shenzhen.aliyuncs.com" }, { "region": "us-west-1", "endpoint": "mts.us-west-1.aliyuncs.com" }, { "region": "cn-zhangjiakou", "endpoint": "mts.cn-zhangjiakou.aliyuncs.com" }, { "region": "eu-west-1", "endpoint": "mts.eu-west-1.aliyuncs.com" }, { "region": "ap-south-1", "endpoint": "mts.ap-south-1.aliyuncs.com" }, { "region": "cn-beijing", "endpoint": "mts.cn-beijing.aliyuncs.com" }, { "region": "cn-hangzhou", "endpoint": "mts.cn-hangzhou.aliyuncs.com" }, { "region": "ap-southeast-1", "endpoint": "mts.ap-southeast-1.aliyuncs.com" }, { "region": "eu-central-1", "endpoint": "mts.eu-central-1.aliyuncs.com" } ], "global_endpoint": "", "regional_endpoint_pattern": "" } ] }` var initOnce sync.Once var data interface{} func getEndpointConfigData() interface{} { initOnce.Do(func() { err := json.Unmarshal([]byte(endpointsJson), &data) if err != nil { panic(fmt.Sprintf("init endpoint config data failed. %s", err)) } }) return data } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������local_global_resolver.go����������������������������������������������������������������������������0000664�0000000�0000000�00000002465�13771713062�0033557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints�������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package endpoints import ( "fmt" "strings" "github.com/jmespath/go-jmespath" ) type LocalGlobalResolver struct { } func (resolver *LocalGlobalResolver) GetName() (name string) { name = "local global resolver" return } func (resolver *LocalGlobalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { // get the global endpoints configs endpointExpression := fmt.Sprintf("products[?code=='%s'].global_endpoint", strings.ToLower(param.Product)) endpointData, err := jmespath.Search(endpointExpression, getEndpointConfigData()) if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 { endpoint = endpointData.([]interface{})[0].(string) support = len(endpoint) > 0 return } support = false return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������local_regional_resolver.go��������������������������������������������������������������������������0000664�0000000�0000000�00000003146�13771713062�0034114�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints�������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package endpoints import ( "fmt" "strings" "github.com/jmespath/go-jmespath" ) type LocalRegionalResolver struct { } func (resolver *LocalRegionalResolver) GetName() (name string) { name = "local regional resolver" return } func (resolver *LocalRegionalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { // get the regional endpoints configs regionalExpression := fmt.Sprintf("products[?code=='%s'].regional_endpoints", strings.ToLower(param.Product)) regionalData, err := jmespath.Search(regionalExpression, getEndpointConfigData()) if err == nil && regionalData != nil && len(regionalData.([]interface{})) > 0 { endpointExpression := fmt.Sprintf("[0][?region=='%s'].endpoint", strings.ToLower(param.RegionId)) var endpointData interface{} endpointData, err = jmespath.Search(endpointExpression, regionalData) if err == nil && endpointData != nil && len(endpointData.([]interface{})) > 0 { endpoint = endpointData.([]interface{})[0].(string) support = len(endpoint) > 0 return } } support = false return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/location_resolver.go���0000664�0000000�0000000�00000010047�13771713062�0033027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package endpoints import ( "encoding/json" "sync" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" ) const ( // EndpointCacheExpireTime ... EndpointCacheExpireTime = 3600 //Seconds ) // Cache caches endpoint for specific product and region type Cache struct { sync.RWMutex cache map[string]interface{} } // Get ... func (c *Cache) Get(k string) (v interface{}) { c.RLock() v = c.cache[k] c.RUnlock() return } // Set ... func (c *Cache) Set(k string, v interface{}) { c.Lock() c.cache[k] = v c.Unlock() } var lastClearTimePerProduct = &Cache{cache: make(map[string]interface{})} var endpointCache = &Cache{cache: make(map[string]interface{})} // LocationResolver ... type LocationResolver struct { } func (resolver *LocationResolver) GetName() (name string) { name = "location resolver" return } // TryResolve resolves endpoint giving product and region func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { if len(param.LocationProduct) <= 0 { support = false return } //get from cache cacheKey := param.Product + "#" + param.RegionId var ok bool endpoint, ok = endpointCache.Get(cacheKey).(string) if ok && len(endpoint) > 0 && !CheckCacheIsExpire(cacheKey) { support = true return } //get from remote getEndpointRequest := requests.NewCommonRequest() getEndpointRequest.Product = "Location" getEndpointRequest.Version = "2015-06-12" getEndpointRequest.ApiName = "DescribeEndpoints" getEndpointRequest.Domain = "location-readonly.aliyuncs.com" getEndpointRequest.Method = "GET" getEndpointRequest.Scheme = requests.HTTPS getEndpointRequest.QueryParams["Id"] = param.RegionId getEndpointRequest.QueryParams["ServiceCode"] = param.LocationProduct if len(param.LocationEndpointType) > 0 { getEndpointRequest.QueryParams["Type"] = param.LocationEndpointType } else { getEndpointRequest.QueryParams["Type"] = "openAPI" } response, err := param.CommonApi(getEndpointRequest) if err != nil { support = false return } if !response.IsSuccess() { support = false return } var getEndpointResponse GetEndpointResponse err = json.Unmarshal([]byte(response.GetHttpContentString()), &getEndpointResponse) if err != nil { support = false return } if !getEndpointResponse.Success || getEndpointResponse.Endpoints == nil { support = false return } if len(getEndpointResponse.Endpoints.Endpoint) <= 0 { support = false return } if len(getEndpointResponse.Endpoints.Endpoint[0].Endpoint) > 0 { endpoint = getEndpointResponse.Endpoints.Endpoint[0].Endpoint endpointCache.Set(cacheKey, endpoint) lastClearTimePerProduct.Set(cacheKey, time.Now().Unix()) support = true return } support = false return } // CheckCacheIsExpire ... func CheckCacheIsExpire(cacheKey string) bool { lastClearTime, ok := lastClearTimePerProduct.Get(cacheKey).(int64) if !ok { return true } if lastClearTime <= 0 { lastClearTime = time.Now().Unix() lastClearTimePerProduct.Set(cacheKey, lastClearTime) } now := time.Now().Unix() elapsedTime := now - lastClearTime if elapsedTime > EndpointCacheExpireTime { return true } return false } // GetEndpointResponse ... type GetEndpointResponse struct { Endpoints *EndpointsObj RequestId string Success bool } // EndpointsObj ... type EndpointsObj struct { Endpoint []EndpointObj } // EndpointObj ... type EndpointObj struct { // Protocols map[string]string Type string Namespace string Id string SerivceCode string Endpoint string } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/mapping_resolver.go����0000664�0000000�0000000�00000003063�13771713062�0032652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package endpoints import ( "fmt" "strings" ) const keyFormatter = "%s::%s" var endpointMapping = make(map[string]string) // AddEndpointMapping Use product id and region id as key to store the endpoint into inner map func AddEndpointMapping(regionId, productId, endpoint string) (err error) { key := fmt.Sprintf(keyFormatter, strings.ToLower(regionId), strings.ToLower(productId)) endpointMapping[key] = endpoint return nil } // MappingResolver the mapping resolver type type MappingResolver struct { } // GetName get the resolver name: "mapping resolver" func (resolver *MappingResolver) GetName() (name string) { name = "mapping resolver" return } // TryResolve use Product and RegionId as key to find endpoint from inner map func (resolver *MappingResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { key := fmt.Sprintf(keyFormatter, strings.ToLower(param.RegionId), strings.ToLower(param.Product)) endpoint, contains := endpointMapping[key] return endpoint, contains, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/resolver.go������������0000664�0000000�0000000�00000005112�13771713062�0031134�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package endpoints import ( "encoding/json" "fmt" "sync" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) var debug utils.Debug func init() { debug = utils.Init("sdk") } const ( ResolveEndpointUserGuideLink = "" ) var once sync.Once var resolvers []Resolver type Resolver interface { TryResolve(param *ResolveParam) (endpoint string, support bool, err error) GetName() (name string) } // Resolve resolve endpoint with params // It will resolve with each supported resolver until anyone resolved func Resolve(param *ResolveParam) (endpoint string, err error) { supportedResolvers := getAllResolvers() var lastErr error for _, resolver := range supportedResolvers { endpoint, supported, resolveErr := resolver.TryResolve(param) if resolveErr != nil { lastErr = resolveErr } if supported { debug("resolve endpoint with %s\n", param) debug("\t%s by resolver(%s)\n", endpoint, resolver.GetName()) return endpoint, nil } } // not support errorMsg := fmt.Sprintf(errors.CanNotResolveEndpointErrorMessage, param, ResolveEndpointUserGuideLink) err = errors.NewClientError(errors.CanNotResolveEndpointErrorCode, errorMsg, lastErr) return } func getAllResolvers() []Resolver { once.Do(func() { resolvers = []Resolver{ &SimpleHostResolver{}, &MappingResolver{}, &LocationResolver{}, &LocalRegionalResolver{}, &LocalGlobalResolver{}, } }) return resolvers } type ResolveParam struct { Domain string Product string RegionId string LocationProduct string LocationEndpointType string CommonApi func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) `json:"-"` } func (param *ResolveParam) String() string { jsonBytes, err := json.Marshal(param) if err != nil { return fmt.Sprint("ResolveParam.String() process error:", err) } return string(jsonBytes) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints/simple_host_resolver.go0000664�0000000�0000000�00000002101�13771713062�0033535�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package endpoints // SimpleHostResolver the simple host resolver type type SimpleHostResolver struct { } // GetName get the resolver name: "simple host resolver" func (resolver *SimpleHostResolver) GetName() (name string) { name = "simple host resolver" return } // TryResolve if the Domain exist in param, use it as endpoint func (resolver *SimpleHostResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error) { if support = len(param.Domain) > 0; support { endpoint = param.Domain } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/��������������������������0000775�0000000�0000000�00000000000�13771713062�0026256�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/client_error.go�����������0000664�0000000�0000000�00000005577�13771713062�0031312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package errors import "fmt" const ( DefaultClientErrorStatus = 400 DefaultClientErrorCode = "SDK.ClientError" UnsupportedCredentialErrorCode = "SDK.UnsupportedCredential" UnsupportedCredentialErrorMessage = "Specified credential (type = %s) is not supported, please check" CanNotResolveEndpointErrorCode = "SDK.CanNotResolveEndpoint" CanNotResolveEndpointErrorMessage = "Can not resolve endpoint(param = %s), please check your accessKey with secret, and read the user guide\n %s" UnsupportedParamPositionErrorCode = "SDK.UnsupportedParamPosition" UnsupportedParamPositionErrorMessage = "Specified param position (%s) is not supported, please upgrade sdk and retry" AsyncFunctionNotEnabledCode = "SDK.AsyncFunctionNotEnabled" AsyncFunctionNotEnabledMessage = "Async function is not enabled in client, please invoke 'client.EnableAsync' function" UnknownRequestTypeErrorCode = "SDK.UnknownRequestType" UnknownRequestTypeErrorMessage = "Unknown Request Type: %s" MissingParamErrorCode = "SDK.MissingParam" InvalidParamErrorCode = "SDK.InvalidParam" JsonUnmarshalErrorCode = "SDK.JsonUnmarshalError" JsonUnmarshalErrorMessage = "Failed to unmarshal response, but you can get the data via response.GetHttpStatusCode() and response.GetHttpContentString()" TimeoutErrorCode = "SDK.TimeoutError" TimeoutErrorMessage = "The request timed out %s times(%s for retry), perhaps we should have the threshold raised a little?" ) type ClientError struct { errorCode string message string originError error } func NewClientError(errorCode, message string, originErr error) Error { return &ClientError{ errorCode: errorCode, message: message, originError: originErr, } } func (err *ClientError) Error() string { clientErrMsg := fmt.Sprintf("[%s] %s", err.ErrorCode(), err.message) if err.originError != nil { return clientErrMsg + "\ncaused by:\n" + err.originError.Error() } return clientErrMsg } func (err *ClientError) OriginError() error { return err.originError } func (*ClientError) HttpStatus() int { return DefaultClientErrorStatus } func (err *ClientError) ErrorCode() string { if err.errorCode == "" { return DefaultClientErrorCode } else { return err.errorCode } } func (err *ClientError) Message() string { return err.message } func (err *ClientError) String() string { return err.Error() } ���������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/error.go������������������0000664�0000000�0000000�00000001254�13771713062�0027740�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package errors type Error interface { error HttpStatus() int ErrorCode() string Message() string OriginError() error } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors/server_error.go�����������0000664�0000000�0000000�00000005445�13771713062�0031334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package errors import ( "encoding/json" "fmt" "github.com/jmespath/go-jmespath" ) var wrapperList = []ServerErrorWrapper{ &SignatureDostNotMatchWrapper{}, } type ServerError struct { httpStatus int requestId string hostId string errorCode string recommend string message string comment string } type ServerErrorWrapper interface { tryWrap(error *ServerError, wrapInfo map[string]string) bool } func (err *ServerError) Error() string { return fmt.Sprintf("SDK.ServerError\nErrorCode: %s\nRecommend: %s\nRequestId: %s\nMessage: %s", err.errorCode, err.comment+err.recommend, err.requestId, err.message) } func NewServerError(httpStatus int, responseContent, comment string) Error { result := &ServerError{ httpStatus: httpStatus, message: responseContent, comment: comment, } var data interface{} err := json.Unmarshal([]byte(responseContent), &data) if err == nil { requestId, _ := jmespath.Search("RequestId", data) hostId, _ := jmespath.Search("HostId", data) errorCode, _ := jmespath.Search("Code", data) recommend, _ := jmespath.Search("Recommend", data) message, _ := jmespath.Search("Message", data) if requestId != nil { result.requestId = requestId.(string) } if hostId != nil { result.hostId = hostId.(string) } if errorCode != nil { result.errorCode = errorCode.(string) } if recommend != nil { result.recommend = recommend.(string) } if message != nil { result.message = message.(string) } } return result } func WrapServerError(originError *ServerError, wrapInfo map[string]string) *ServerError { for _, wrapper := range wrapperList { ok := wrapper.tryWrap(originError, wrapInfo) if ok { return originError } } return originError } func (err *ServerError) HttpStatus() int { return err.httpStatus } func (err *ServerError) ErrorCode() string { return err.errorCode } func (err *ServerError) Message() string { return err.message } func (err *ServerError) OriginError() error { return nil } func (err *ServerError) HostId() string { return err.hostId } func (err *ServerError) RequestId() string { return err.requestId } func (err *ServerError) Recommend() string { return err.recommend } func (err *ServerError) Comment() string { return err.comment } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������signature_does_not_match_wrapper.go�����������������������������������������������������������������0000664�0000000�0000000�00000002525�13771713062�0035341�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors����������������������������������������������������������������������������������������������package errors import ( "strings" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) const SignatureDostNotMatchErrorCode = "SignatureDoesNotMatch" const IncompleteSignatureErrorCode = "IncompleteSignature" const MessageContain = "server string to sign is:" var debug utils.Debug func init() { debug = utils.Init("sdk") } type SignatureDostNotMatchWrapper struct { } func (*SignatureDostNotMatchWrapper) tryWrap(error *ServerError, wrapInfo map[string]string) (ok bool) { clientStringToSign := wrapInfo["StringToSign"] if (error.errorCode == SignatureDostNotMatchErrorCode || error.errorCode == IncompleteSignatureErrorCode) && clientStringToSign != "" { message := error.message if strings.Contains(message, MessageContain) { str := strings.Split(message, MessageContain) serverStringToSign := str[1] if clientStringToSign == serverStringToSign { // user secret is error error.recommend = "InvalidAccessKeySecret: Please check you AccessKeySecret" } else { debug("Client StringToSign: %s", clientStringToSign) debug("Server StringToSign: %s", serverStringToSign) error.recommend = "This may be a bug with the SDK and we hope you can submit this question in the " + "github issue(https://github.com/aliyun/alibaba-cloud-sdk-go/issues), thanks very much" } } ok = true return } ok = false return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/logger.go������������������������0000664�0000000�0000000�00000005145�13771713062�0026555�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package sdk import ( "encoding/json" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" "io" "log" "os" "strings" "time" ) var logChannel string var defaultChannel = "AlibabaCloud" type Logger struct { *log.Logger formatTemplate string isOpen bool lastLogMsg string } var defaultLoggerTemplate = `{time} {channel}: "{method} {uri} HTTP/{version}" {code} {cost} {hostname}` var loggerParam = []string{"{time}", "{start_time}", "{ts}", "{channel}", "{pid}", "{host}", "{method}", "{uri}", "{version}", "{target}", "{hostname}", "{code}", "{error}", "{req_headers}", "{res_headers}", "{cost}"} func initLogMsg(fieldMap map[string]string) { for _, value := range loggerParam { fieldMap[value] = "" } } func (client *Client) GetLogger() *Logger { return client.logger } func (client *Client) GetLoggerMsg() string { if client.logger == nil { client.SetLogger("", "", os.Stdout, "") } return client.logger.lastLogMsg } func (client *Client) SetLogger(level string, channel string, out io.Writer, template string) { if level == "" { level = "info" } logChannel = "AlibabaCloud" if channel != "" { logChannel = channel } log := log.New(out, "["+strings.ToUpper(level)+"]", log.Lshortfile) if template == "" { template = defaultLoggerTemplate } client.logger = &Logger{ Logger: log, formatTemplate: template, isOpen: true, } } func (client *Client) OpenLogger() { if client.logger == nil { client.SetLogger("", "", os.Stdout, "") } client.logger.isOpen = true } func (client *Client) CloseLogger() { if client.logger != nil { client.logger.isOpen = false } } func (client *Client) SetTemplate(template string) { if client.logger == nil { client.SetLogger("", "", os.Stdout, "") } client.logger.formatTemplate = template } func (client *Client) GetTemplate() string { if client.logger == nil { client.SetLogger("", "", os.Stdout, "") } return client.logger.formatTemplate } func TransToString(object interface{}) string { byt, err := json.Marshal(object) if err != nil { return "" } return string(byt) } func (client *Client) printLog(fieldMap map[string]string, err error) { if err != nil { fieldMap["{error}"] = err.Error() } fieldMap["{time}"] = time.Now().Format("2006-01-02 15:04:05") fieldMap["{ts}"] = utils.GetTimeInFormatISO8601() fieldMap["{channel}"] = logChannel if client.logger != nil { logMsg := client.logger.formatTemplate for key, value := range fieldMap { logMsg = strings.Replace(logMsg, key, value, -1) } client.logger.lastLogMsg = logMsg if client.logger.isOpen == true { client.logger.Output(2, logMsg) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/������������������������0000775�0000000�0000000�00000000000�13771713062�0026615�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/acs_request.go����������0000664�0000000�0000000�00000021332�13771713062�0031463�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package requests import ( "encoding/json" "fmt" "io" "reflect" "strconv" "strings" "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" ) const ( RPC = "RPC" ROA = "ROA" HTTP = "HTTP" HTTPS = "HTTPS" DefaultHttpPort = "80" GET = "GET" PUT = "PUT" POST = "POST" DELETE = "DELETE" HEAD = "HEAD" OPTIONS = "OPTIONS" Json = "application/json" Xml = "application/xml" Raw = "application/octet-stream" Form = "application/x-www-form-urlencoded" Header = "Header" Query = "Query" Body = "Body" Path = "Path" HeaderSeparator = "\n" ) // interface type AcsRequest interface { GetScheme() string GetMethod() string GetDomain() string GetPort() string GetRegionId() string GetHeaders() map[string]string GetQueryParams() map[string]string GetFormParams() map[string]string GetContent() []byte GetBodyReader() io.Reader GetStyle() string GetProduct() string GetVersion() string GetActionName() string GetAcceptFormat() string GetLocationServiceCode() string GetLocationEndpointType() string GetReadTimeout() time.Duration GetConnectTimeout() time.Duration SetReadTimeout(readTimeout time.Duration) SetConnectTimeout(connectTimeout time.Duration) SetHTTPSInsecure(isInsecure bool) GetHTTPSInsecure() *bool GetUserAgent() map[string]string SetStringToSign(stringToSign string) GetStringToSign() string SetDomain(domain string) SetContent(content []byte) SetScheme(scheme string) BuildUrl() string BuildQueries() string addHeaderParam(key, value string) addQueryParam(key, value string) addFormParam(key, value string) addPathParam(key, value string) } // base class type baseRequest struct { Scheme string Method string Domain string Port string RegionId string ReadTimeout time.Duration ConnectTimeout time.Duration isInsecure *bool userAgent map[string]string product string version string actionName string AcceptFormat string QueryParams map[string]string Headers map[string]string FormParams map[string]string Content []byte locationServiceCode string locationEndpointType string queries string stringToSign string } func (request *baseRequest) GetQueryParams() map[string]string { return request.QueryParams } func (request *baseRequest) GetFormParams() map[string]string { return request.FormParams } func (request *baseRequest) GetReadTimeout() time.Duration { return request.ReadTimeout } func (request *baseRequest) GetConnectTimeout() time.Duration { return request.ConnectTimeout } func (request *baseRequest) SetReadTimeout(readTimeout time.Duration) { request.ReadTimeout = readTimeout } func (request *baseRequest) SetConnectTimeout(connectTimeout time.Duration) { request.ConnectTimeout = connectTimeout } func (request *baseRequest) GetHTTPSInsecure() *bool { return request.isInsecure } func (request *baseRequest) SetHTTPSInsecure(isInsecure bool) { request.isInsecure = &isInsecure } func (request *baseRequest) GetContent() []byte { return request.Content } func (request *baseRequest) GetVersion() string { return request.version } func (request *baseRequest) GetActionName() string { return request.actionName } func (request *baseRequest) SetContent(content []byte) { request.Content = content } func (request *baseRequest) GetUserAgent() map[string]string { return request.userAgent } func (request *baseRequest) AppendUserAgent(key, value string) { newkey := true if request.userAgent == nil { request.userAgent = make(map[string]string) } if strings.ToLower(key) != "core" && strings.ToLower(key) != "go" { for tag, _ := range request.userAgent { if tag == key { request.userAgent[tag] = value newkey = false } } if newkey { request.userAgent[key] = value } } } func (request *baseRequest) addHeaderParam(key, value string) { request.Headers[key] = value } func (request *baseRequest) addQueryParam(key, value string) { request.QueryParams[key] = value } func (request *baseRequest) addFormParam(key, value string) { request.FormParams[key] = value } func (request *baseRequest) GetAcceptFormat() string { return request.AcceptFormat } func (request *baseRequest) GetLocationServiceCode() string { return request.locationServiceCode } func (request *baseRequest) GetLocationEndpointType() string { return request.locationEndpointType } func (request *baseRequest) GetProduct() string { return request.product } func (request *baseRequest) GetScheme() string { return request.Scheme } func (request *baseRequest) SetScheme(scheme string) { request.Scheme = scheme } func (request *baseRequest) GetMethod() string { return request.Method } func (request *baseRequest) GetDomain() string { return request.Domain } func (request *baseRequest) SetDomain(host string) { request.Domain = host } func (request *baseRequest) GetPort() string { return request.Port } func (request *baseRequest) GetRegionId() string { return request.RegionId } func (request *baseRequest) GetHeaders() map[string]string { return request.Headers } func (request *baseRequest) SetContentType(contentType string) { request.addHeaderParam("Content-Type", contentType) } func (request *baseRequest) GetContentType() (contentType string, contains bool) { contentType, contains = request.Headers["Content-Type"] return } func (request *baseRequest) SetStringToSign(stringToSign string) { request.stringToSign = stringToSign } func (request *baseRequest) GetStringToSign() string { return request.stringToSign } func defaultBaseRequest() (request *baseRequest) { request = &baseRequest{ Scheme: "", AcceptFormat: "JSON", Method: GET, QueryParams: make(map[string]string), Headers: map[string]string{ "x-sdk-client": "golang/1.0.0", "x-sdk-invoke-type": "normal", "Accept-Encoding": "identity", }, FormParams: make(map[string]string), } return } func InitParams(request AcsRequest) (err error) { requestValue := reflect.ValueOf(request).Elem() err = flatRepeatedList(requestValue, request, "", "") return } func flatRepeatedList(dataValue reflect.Value, request AcsRequest, position, prefix string) (err error) { dataType := dataValue.Type() for i := 0; i < dataType.NumField(); i++ { field := dataType.Field(i) name, containsNameTag := field.Tag.Lookup("name") fieldPosition := position if fieldPosition == "" { fieldPosition, _ = field.Tag.Lookup("position") } typeTag, containsTypeTag := field.Tag.Lookup("type") if containsNameTag { if !containsTypeTag { // simple param key := prefix + name value := dataValue.Field(i).String() if dataValue.Field(i).Kind().String() == "map" { byt, _ := json.Marshal(dataValue.Field(i).Interface()) value = string(byt) } err = addParam(request, fieldPosition, key, value) if err != nil { return } } else if typeTag == "Repeated" { // repeated param repeatedFieldValue := dataValue.Field(i) if repeatedFieldValue.Kind() != reflect.Slice { // possible value: {"[]string", "*[]struct"}, we must call Elem() in the last condition repeatedFieldValue = repeatedFieldValue.Elem() } if repeatedFieldValue.IsValid() && !repeatedFieldValue.IsNil() { for m := 0; m < repeatedFieldValue.Len(); m++ { elementValue := repeatedFieldValue.Index(m) key := prefix + name + "." + strconv.Itoa(m+1) if elementValue.Type().Kind().String() == "string" { value := elementValue.String() err = addParam(request, fieldPosition, key, value) if err != nil { return } } else { err = flatRepeatedList(elementValue, request, fieldPosition, key+".") if err != nil { return } } } } } } } return } func addParam(request AcsRequest, position, name, value string) (err error) { if len(value) > 0 { switch position { case Header: request.addHeaderParam(name, value) case Query: request.addQueryParam(name, value) case Path: request.addPathParam(name, value) case Body: request.addFormParam(name, value) default: errMsg := fmt.Sprintf(errors.UnsupportedParamPositionErrorMessage, position) err = errors.NewClientError(errors.UnsupportedParamPositionErrorCode, errMsg, nil) } } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/common_request.go�������0000664�0000000�0000000�00000004542�13771713062�0032211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package requests import ( "bytes" "fmt" "io" "sort" "strings" ) type CommonRequest struct { *baseRequest Version string ApiName string Product string ServiceCode string // roa params PathPattern string PathParams map[string]string Ontology AcsRequest } func NewCommonRequest() (request *CommonRequest) { request = &CommonRequest{ baseRequest: defaultBaseRequest(), } request.Headers["x-sdk-invoke-type"] = "common" request.PathParams = make(map[string]string) return } func (request *CommonRequest) String() string { request.TransToAcsRequest() resultBuilder := bytes.Buffer{} mapOutput := func(m map[string]string) { if len(m) > 0 { sortedKeys := make([]string, 0) for k := range m { sortedKeys = append(sortedKeys, k) } // sort 'string' key in increasing order sort.Strings(sortedKeys) for _, key := range sortedKeys { resultBuilder.WriteString(key + ": " + m[key] + "\n") } } } // Request Line resultBuilder.WriteString(fmt.Sprintf("%s %s %s/1.1\n", request.Method, request.BuildQueries(), strings.ToUpper(request.Scheme))) // Headers resultBuilder.WriteString("Host" + ": " + request.Domain + "\n") mapOutput(request.Headers) resultBuilder.WriteString("\n") // Body if len(request.Content) > 0 { resultBuilder.WriteString(string(request.Content) + "\n") } else { mapOutput(request.FormParams) } return resultBuilder.String() } func (request *CommonRequest) TransToAcsRequest() { if len(request.PathPattern) > 0 { roaRequest := &RoaRequest{} roaRequest.initWithCommonRequest(request) request.Ontology = roaRequest } else { rpcRequest := &RpcRequest{} rpcRequest.baseRequest = request.baseRequest rpcRequest.product = request.Product rpcRequest.version = request.Version rpcRequest.locationServiceCode = request.ServiceCode rpcRequest.actionName = request.ApiName request.Ontology = rpcRequest } } func (request *CommonRequest) BuildUrl() string { return request.Ontology.BuildUrl() } func (request *CommonRequest) BuildQueries() string { return request.Ontology.BuildQueries() } func (request *CommonRequest) GetBodyReader() io.Reader { return request.Ontology.GetBodyReader() } func (request *CommonRequest) GetStyle() string { return request.Ontology.GetStyle() } func (request *CommonRequest) addPathParam(key, value string) { request.PathParams[key] = value } ��������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/roa_request.go����������0000664�0000000�0000000�00000010211�13771713062�0031470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package requests import ( "bytes" "fmt" "io" "net/url" "sort" "strings" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) type RoaRequest struct { *baseRequest pathPattern string PathParams map[string]string } func (*RoaRequest) GetStyle() string { return ROA } func (request *RoaRequest) GetBodyReader() io.Reader { if request.FormParams != nil && len(request.FormParams) > 0 { formString := utils.GetUrlFormedMap(request.FormParams) return strings.NewReader(formString) } else if len(request.Content) > 0 { return bytes.NewReader(request.Content) } else { return nil } } // for sign method, need not url encoded func (request *RoaRequest) BuildQueries() string { return request.buildQueries() } func (request *RoaRequest) buildPath() string { path := request.pathPattern for key, value := range request.PathParams { path = strings.Replace(path, "["+key+"]", value, 1) } return path } func (request *RoaRequest) buildQueries() string { // replace path params with value path := request.buildPath() queryParams := request.QueryParams // sort QueryParams by key var queryKeys []string for key := range queryParams { queryKeys = append(queryKeys, key) } sort.Strings(queryKeys) // append urlBuilder urlBuilder := bytes.Buffer{} urlBuilder.WriteString(path) if len(queryKeys) > 0 { urlBuilder.WriteString("?") } for i := 0; i < len(queryKeys); i++ { queryKey := queryKeys[i] urlBuilder.WriteString(queryKey) if value := queryParams[queryKey]; len(value) > 0 { urlBuilder.WriteString("=") urlBuilder.WriteString(value) } if i < len(queryKeys)-1 { urlBuilder.WriteString("&") } } result := urlBuilder.String() result = popStandardUrlencode(result) return result } func (request *RoaRequest) buildQueryString() string { queryParams := request.QueryParams // sort QueryParams by key q := url.Values{} for key, value := range queryParams { q.Add(key, value) } return q.Encode() } func popStandardUrlencode(stringToSign string) (result string) { result = strings.Replace(stringToSign, "+", "%20", -1) result = strings.Replace(result, "*", "%2A", -1) result = strings.Replace(result, "%7E", "~", -1) return } func (request *RoaRequest) BuildUrl() string { // for network trans, need url encoded scheme := strings.ToLower(request.Scheme) domain := request.Domain port := request.Port path := request.buildPath() url := fmt.Sprintf("%s://%s:%s%s", scheme, domain, port, path) querystring := request.buildQueryString() if len(querystring) > 0 { url = fmt.Sprintf("%s?%s", url, querystring) } return url } func (request *RoaRequest) addPathParam(key, value string) { request.PathParams[key] = value } func (request *RoaRequest) InitWithApiInfo(product, version, action, uriPattern, serviceCode, endpointType string) { request.baseRequest = defaultBaseRequest() request.PathParams = make(map[string]string) request.Headers["x-acs-version"] = version request.pathPattern = uriPattern request.locationServiceCode = serviceCode request.locationEndpointType = endpointType request.product = product //request.version = version //request.actionName = action } func (request *RoaRequest) initWithCommonRequest(commonRequest *CommonRequest) { request.baseRequest = commonRequest.baseRequest request.PathParams = commonRequest.PathParams request.product = commonRequest.Product //request.version = commonRequest.Version request.Headers["x-acs-version"] = commonRequest.Version //request.actionName = commonRequest.ApiName request.pathPattern = commonRequest.PathPattern request.locationServiceCode = commonRequest.ServiceCode request.locationEndpointType = "" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/rpc_request.go����������0000664�0000000�0000000�00000004015�13771713062�0031500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package requests import ( "fmt" "io" "strings" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) type RpcRequest struct { *baseRequest } func (request *RpcRequest) init() { request.baseRequest = defaultBaseRequest() request.Method = POST } func (*RpcRequest) GetStyle() string { return RPC } func (request *RpcRequest) GetBodyReader() io.Reader { if request.FormParams != nil && len(request.FormParams) > 0 { formString := utils.GetUrlFormedMap(request.FormParams) return strings.NewReader(formString) } else { return strings.NewReader("") } } func (request *RpcRequest) BuildQueries() string { request.queries = "/?" + utils.GetUrlFormedMap(request.QueryParams) return request.queries } func (request *RpcRequest) BuildUrl() string { url := fmt.Sprintf("%s://%s", strings.ToLower(request.Scheme), request.Domain) if len(request.Port) > 0 { url = fmt.Sprintf("%s:%s", url, request.Port) } return url + request.BuildQueries() } func (request *RpcRequest) GetVersion() string { return request.version } func (request *RpcRequest) GetActionName() string { return request.actionName } func (request *RpcRequest) addPathParam(key, value string) { panic("not support") } func (request *RpcRequest) InitWithApiInfo(product, version, action, serviceCode, endpointType string) { request.init() request.product = product request.version = version request.actionName = action request.locationServiceCode = serviceCode request.locationEndpointType = endpointType } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests/types.go����������������0000664�0000000�0000000�00000001774�13771713062�0030321�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package requests import "strconv" type Integer string func NewInteger(integer int) Integer { return Integer(strconv.Itoa(integer)) } func (integer Integer) HasValue() bool { return integer != "" } func (integer Integer) GetValue() (int, error) { return strconv.Atoi(string(integer)) } func NewInteger64(integer int64) Integer { return Integer(strconv.FormatInt(integer, 10)) } func (integer Integer) GetValue64() (int64, error) { return strconv.ParseInt(string(integer), 10, 0) } type Boolean string func NewBoolean(bool bool) Boolean { return Boolean(strconv.FormatBool(bool)) } func (boolean Boolean) HasValue() bool { return boolean != "" } func (boolean Boolean) GetValue() (bool, error) { return strconv.ParseBool(string(boolean)) } type Float string func NewFloat(f float64) Float { return Float(strconv.FormatFloat(f, 'f', 6, 64)) } func (float Float) HasValue() bool { return float != "" } func (float Float) GetValue() (float64, error) { return strconv.ParseFloat(string(float), 64) } ����packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/�����������������������0000775�0000000�0000000�00000000000�13771713062�0026763�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/json_parser.go���������0000664�0000000�0000000�00000022242�13771713062�0031641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package responses import ( "encoding/json" "io" "math" "strconv" "strings" "sync" "unsafe" jsoniter "github.com/json-iterator/go" ) const maxUint = ^uint(0) const maxInt = int(maxUint >> 1) const minInt = -maxInt - 1 var jsonParser jsoniter.API var initJson = &sync.Once{} func initJsonParserOnce() { initJson.Do(func() { registerBetterFuzzyDecoder() jsonParser = jsoniter.Config{ EscapeHTML: true, SortMapKeys: true, ValidateJsonRawMessage: true, CaseSensitive: true, }.Froze() }) } func registerBetterFuzzyDecoder() { jsoniter.RegisterTypeDecoder("string", &nullableFuzzyStringDecoder{}) jsoniter.RegisterTypeDecoder("bool", &fuzzyBoolDecoder{}) jsoniter.RegisterTypeDecoder("float32", &nullableFuzzyFloat32Decoder{}) jsoniter.RegisterTypeDecoder("float64", &nullableFuzzyFloat64Decoder{}) jsoniter.RegisterTypeDecoder("int", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(maxInt) || val < float64(minInt) { iter.ReportError("fuzzy decode int", "exceed range") return } *((*int)(ptr)) = int(val) } else { *((*int)(ptr)) = iter.ReadInt() } }}) jsoniter.RegisterTypeDecoder("uint", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(maxUint) || val < 0 { iter.ReportError("fuzzy decode uint", "exceed range") return } *((*uint)(ptr)) = uint(val) } else { *((*uint)(ptr)) = iter.ReadUint() } }}) jsoniter.RegisterTypeDecoder("int8", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxInt8) || val < float64(math.MinInt8) { iter.ReportError("fuzzy decode int8", "exceed range") return } *((*int8)(ptr)) = int8(val) } else { *((*int8)(ptr)) = iter.ReadInt8() } }}) jsoniter.RegisterTypeDecoder("uint8", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxUint8) || val < 0 { iter.ReportError("fuzzy decode uint8", "exceed range") return } *((*uint8)(ptr)) = uint8(val) } else { *((*uint8)(ptr)) = iter.ReadUint8() } }}) jsoniter.RegisterTypeDecoder("int16", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxInt16) || val < float64(math.MinInt16) { iter.ReportError("fuzzy decode int16", "exceed range") return } *((*int16)(ptr)) = int16(val) } else { *((*int16)(ptr)) = iter.ReadInt16() } }}) jsoniter.RegisterTypeDecoder("uint16", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxUint16) || val < 0 { iter.ReportError("fuzzy decode uint16", "exceed range") return } *((*uint16)(ptr)) = uint16(val) } else { *((*uint16)(ptr)) = iter.ReadUint16() } }}) jsoniter.RegisterTypeDecoder("int32", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxInt32) || val < float64(math.MinInt32) { iter.ReportError("fuzzy decode int32", "exceed range") return } *((*int32)(ptr)) = int32(val) } else { *((*int32)(ptr)) = iter.ReadInt32() } }}) jsoniter.RegisterTypeDecoder("uint32", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxUint32) || val < 0 { iter.ReportError("fuzzy decode uint32", "exceed range") return } *((*uint32)(ptr)) = uint32(val) } else { *((*uint32)(ptr)) = iter.ReadUint32() } }}) jsoniter.RegisterTypeDecoder("int64", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxInt64) || val < float64(math.MinInt64) { iter.ReportError("fuzzy decode int64", "exceed range") return } *((*int64)(ptr)) = int64(val) } else { *((*int64)(ptr)) = iter.ReadInt64() } }}) jsoniter.RegisterTypeDecoder("uint64", &nullableFuzzyIntegerDecoder{func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) { if isFloat { val := iter.ReadFloat64() if val > float64(math.MaxUint64) || val < 0 { iter.ReportError("fuzzy decode uint64", "exceed range") return } *((*uint64)(ptr)) = uint64(val) } else { *((*uint64)(ptr)) = iter.ReadUint64() } }}) } type nullableFuzzyStringDecoder struct { } func (decoder *nullableFuzzyStringDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { valueType := iter.WhatIsNext() switch valueType { case jsoniter.NumberValue: var number json.Number iter.ReadVal(&number) *((*string)(ptr)) = string(number) case jsoniter.StringValue: *((*string)(ptr)) = iter.ReadString() case jsoniter.BoolValue: *((*string)(ptr)) = strconv.FormatBool(iter.ReadBool()) case jsoniter.NilValue: iter.ReadNil() *((*string)(ptr)) = "" default: iter.ReportError("fuzzyStringDecoder", "not number or string or bool") } } type fuzzyBoolDecoder struct { } func (decoder *fuzzyBoolDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { valueType := iter.WhatIsNext() switch valueType { case jsoniter.BoolValue: *((*bool)(ptr)) = iter.ReadBool() case jsoniter.NumberValue: var number json.Number iter.ReadVal(&number) num, err := number.Int64() if err != nil { iter.ReportError("fuzzyBoolDecoder", "get value from json.number failed") } if num == 0 { *((*bool)(ptr)) = false } else { *((*bool)(ptr)) = true } case jsoniter.StringValue: strValue := strings.ToLower(iter.ReadString()) if strValue == "true" { *((*bool)(ptr)) = true } else if strValue == "false" || strValue == "" { *((*bool)(ptr)) = false } else { iter.ReportError("fuzzyBoolDecoder", "unsupported bool value: "+strValue) } case jsoniter.NilValue: iter.ReadNil() *((*bool)(ptr)) = false default: iter.ReportError("fuzzyBoolDecoder", "not number or string or nil") } } type nullableFuzzyIntegerDecoder struct { fun func(isFloat bool, ptr unsafe.Pointer, iter *jsoniter.Iterator) } func (decoder *nullableFuzzyIntegerDecoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { valueType := iter.WhatIsNext() var str string switch valueType { case jsoniter.NumberValue: var number json.Number iter.ReadVal(&number) str = string(number) case jsoniter.StringValue: str = iter.ReadString() // support empty string if str == "" { str = "0" } case jsoniter.BoolValue: if iter.ReadBool() { str = "1" } else { str = "0" } case jsoniter.NilValue: iter.ReadNil() str = "0" default: iter.ReportError("fuzzyIntegerDecoder", "not number or string") } newIter := iter.Pool().BorrowIterator([]byte(str)) defer iter.Pool().ReturnIterator(newIter) isFloat := strings.IndexByte(str, '.') != -1 decoder.fun(isFloat, ptr, newIter) if newIter.Error != nil && newIter.Error != io.EOF { iter.Error = newIter.Error } } type nullableFuzzyFloat32Decoder struct { } func (decoder *nullableFuzzyFloat32Decoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { valueType := iter.WhatIsNext() var str string switch valueType { case jsoniter.NumberValue: *((*float32)(ptr)) = iter.ReadFloat32() case jsoniter.StringValue: str = iter.ReadString() // support empty string if str == "" { *((*float32)(ptr)) = 0 return } newIter := iter.Pool().BorrowIterator([]byte(str)) defer iter.Pool().ReturnIterator(newIter) *((*float32)(ptr)) = newIter.ReadFloat32() if newIter.Error != nil && newIter.Error != io.EOF { iter.Error = newIter.Error } case jsoniter.BoolValue: // support bool to float32 if iter.ReadBool() { *((*float32)(ptr)) = 1 } else { *((*float32)(ptr)) = 0 } case jsoniter.NilValue: iter.ReadNil() *((*float32)(ptr)) = 0 default: iter.ReportError("nullableFuzzyFloat32Decoder", "not number or string") } } type nullableFuzzyFloat64Decoder struct { } func (decoder *nullableFuzzyFloat64Decoder) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) { valueType := iter.WhatIsNext() var str string switch valueType { case jsoniter.NumberValue: *((*float64)(ptr)) = iter.ReadFloat64() case jsoniter.StringValue: str = iter.ReadString() // support empty string if str == "" { *((*float64)(ptr)) = 0 return } newIter := iter.Pool().BorrowIterator([]byte(str)) defer iter.Pool().ReturnIterator(newIter) *((*float64)(ptr)) = newIter.ReadFloat64() if newIter.Error != nil && newIter.Error != io.EOF { iter.Error = newIter.Error } case jsoniter.BoolValue: // support bool to float64 if iter.ReadBool() { *((*float64)(ptr)) = 1 } else { *((*float64)(ptr)) = 0 } case jsoniter.NilValue: // support empty string iter.ReadNil() *((*float64)(ptr)) = 0 default: iter.ReportError("nullableFuzzyFloat64Decoder", "not number or string") } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses/response.go������������0000664�0000000�0000000�00000010157�13771713062�0031154�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package responses import ( "bytes" "encoding/xml" "fmt" "io/ioutil" "net/http" "strings" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" ) type AcsResponse interface { IsSuccess() bool GetHttpStatus() int GetHttpHeaders() map[string][]string GetHttpContentString() string GetHttpContentBytes() []byte GetOriginHttpResponse() *http.Response parseFromHttpResponse(httpResponse *http.Response) error } var debug utils.Debug func init() { debug = utils.Init("sdk") } // Unmarshal object from http response body to target Response func Unmarshal(response AcsResponse, httpResponse *http.Response, format string) (err error) { err = response.parseFromHttpResponse(httpResponse) if err != nil { return } if !response.IsSuccess() { err = errors.NewServerError(response.GetHttpStatus(), response.GetHttpContentString(), "") return } if _, isCommonResponse := response.(*CommonResponse); isCommonResponse { // common response need not unmarshal return } if len(response.GetHttpContentBytes()) == 0 { return } if strings.ToUpper(format) == "JSON" { initJsonParserOnce() err = jsonParser.Unmarshal(response.GetHttpContentBytes(), response) if err != nil { err = errors.NewClientError(errors.JsonUnmarshalErrorCode, errors.JsonUnmarshalErrorMessage, err) } } else if strings.ToUpper(format) == "XML" { err = xml.Unmarshal(response.GetHttpContentBytes(), response) } return } type BaseResponse struct { httpStatus int httpHeaders map[string][]string httpContentString string httpContentBytes []byte originHttpResponse *http.Response } func (baseResponse *BaseResponse) GetHttpStatus() int { return baseResponse.httpStatus } func (baseResponse *BaseResponse) GetHttpHeaders() map[string][]string { return baseResponse.httpHeaders } func (baseResponse *BaseResponse) GetHttpContentString() string { return baseResponse.httpContentString } func (baseResponse *BaseResponse) GetHttpContentBytes() []byte { return baseResponse.httpContentBytes } func (baseResponse *BaseResponse) GetOriginHttpResponse() *http.Response { return baseResponse.originHttpResponse } func (baseResponse *BaseResponse) IsSuccess() bool { if baseResponse.GetHttpStatus() >= 200 && baseResponse.GetHttpStatus() < 300 { return true } return false } func (baseResponse *BaseResponse) parseFromHttpResponse(httpResponse *http.Response) (err error) { defer httpResponse.Body.Close() body, err := ioutil.ReadAll(httpResponse.Body) if err != nil { return } debug("%s", string(body)) baseResponse.httpStatus = httpResponse.StatusCode baseResponse.httpHeaders = httpResponse.Header baseResponse.httpContentBytes = body baseResponse.httpContentString = string(body) baseResponse.originHttpResponse = httpResponse return } func (baseResponse *BaseResponse) String() string { resultBuilder := bytes.Buffer{} // statusCode // resultBuilder.WriteString("\n") resultBuilder.WriteString(fmt.Sprintf("%s %s\n", baseResponse.originHttpResponse.Proto, baseResponse.originHttpResponse.Status)) // httpHeaders //resultBuilder.WriteString("Headers:\n") for key, value := range baseResponse.httpHeaders { resultBuilder.WriteString(key + ": " + strings.Join(value, ";") + "\n") } resultBuilder.WriteString("\n") // content //resultBuilder.WriteString("Content:\n") resultBuilder.WriteString(baseResponse.httpContentString + "\n") return resultBuilder.String() } type CommonResponse struct { *BaseResponse } func NewCommonResponse() (response *CommonResponse) { return &CommonResponse{ BaseResponse: &BaseResponse{}, } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/���������������������������0000775�0000000�0000000�00000000000�13771713062�0026102�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/debug.go�������������������0000664�0000000�0000000�00000001013�13771713062�0027512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package utils import ( "fmt" "os" "strings" ) type Debug func(format string, v ...interface{}) var hookGetEnv = func() string { return os.Getenv("DEBUG") } var hookPrint = func(input string) { fmt.Println(input) } func Init(flag string) Debug { enable := false env := hookGetEnv() parts := strings.Split(env, ",") for _, part := range parts { if part == flag { enable = true break } } return func(format string, v ...interface{}) { if enable { hookPrint(fmt.Sprintf(format, v...)) } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils/utils.go�������������������0000664�0000000�0000000�00000004264�13771713062�0027577�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package utils import ( "crypto/md5" "encoding/base64" "encoding/hex" "net/url" "reflect" "strconv" "time" "github.com/satori/go.uuid" ) func GetUUIDV4() (uuidHex string) { uuidV4 := uuid.NewV4() uuidHex = hex.EncodeToString(uuidV4.Bytes()) return } func GetMD5Base64(bytes []byte) (base64Value string) { md5Ctx := md5.New() md5Ctx.Write(bytes) md5Value := md5Ctx.Sum(nil) base64Value = base64.StdEncoding.EncodeToString(md5Value) return } func GetTimeInFormatISO8601() (timeStr string) { gmt := time.FixedZone("GMT", 0) return time.Now().In(gmt).Format("2006-01-02T15:04:05Z") } func GetTimeInFormatRFC2616() (timeStr string) { gmt := time.FixedZone("GMT", 0) return time.Now().In(gmt).Format("Mon, 02 Jan 2006 15:04:05 GMT") } func GetUrlFormedMap(source map[string]string) (urlEncoded string) { urlEncoder := url.Values{} for key, value := range source { urlEncoder.Add(key, value) } urlEncoded = urlEncoder.Encode() return } func InitStructWithDefaultTag(bean interface{}) { configType := reflect.TypeOf(bean) for i := 0; i < configType.Elem().NumField(); i++ { field := configType.Elem().Field(i) defaultValue := field.Tag.Get("default") if defaultValue == "" { continue } setter := reflect.ValueOf(bean).Elem().Field(i) switch field.Type.String() { case "int": intValue, _ := strconv.ParseInt(defaultValue, 10, 64) setter.SetInt(intValue) case "time.Duration": intValue, _ := strconv.ParseInt(defaultValue, 10, 64) setter.SetInt(intValue) case "string": setter.SetString(defaultValue) case "bool": boolValue, _ := strconv.ParseBool(defaultValue) setter.SetBool(boolValue) } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/����������������������������0000775�0000000�0000000�00000000000�13771713062�0026004�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/������������������������0000775�0000000�0000000�00000000000�13771713062�0026556�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������accept_inquired_system_event.go���������������������������������������������������������������������0000664�0000000�0000000�00000010423�13771713062�0034772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AcceptInquiredSystemEvent invokes the ecs.AcceptInquiredSystemEvent API synchronously // api document: https://help.aliyun.com/api/ecs/acceptinquiredsystemevent.html func (client *Client) AcceptInquiredSystemEvent(request *AcceptInquiredSystemEventRequest) (response *AcceptInquiredSystemEventResponse, err error) { response = CreateAcceptInquiredSystemEventResponse() err = client.DoAction(request, response) return } // AcceptInquiredSystemEventWithChan invokes the ecs.AcceptInquiredSystemEvent API asynchronously // api document: https://help.aliyun.com/api/ecs/acceptinquiredsystemevent.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AcceptInquiredSystemEventWithChan(request *AcceptInquiredSystemEventRequest) (<-chan *AcceptInquiredSystemEventResponse, <-chan error) { responseChan := make(chan *AcceptInquiredSystemEventResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AcceptInquiredSystemEvent(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AcceptInquiredSystemEventWithCallback invokes the ecs.AcceptInquiredSystemEvent API asynchronously // api document: https://help.aliyun.com/api/ecs/acceptinquiredsystemevent.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AcceptInquiredSystemEventWithCallback(request *AcceptInquiredSystemEventRequest, callback func(response *AcceptInquiredSystemEventResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AcceptInquiredSystemEventResponse var err error defer close(result) response, err = client.AcceptInquiredSystemEvent(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AcceptInquiredSystemEventRequest is the request struct for api AcceptInquiredSystemEvent type AcceptInquiredSystemEventRequest struct { *requests.RpcRequest EventId string `position:"Query" name:"EventId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AcceptInquiredSystemEventResponse is the response struct for api AcceptInquiredSystemEvent type AcceptInquiredSystemEventResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAcceptInquiredSystemEventRequest creates a request to invoke AcceptInquiredSystemEvent API func CreateAcceptInquiredSystemEventRequest() (request *AcceptInquiredSystemEventRequest) { request = &AcceptInquiredSystemEventRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AcceptInquiredSystemEvent", "ecs", "openAPI") return } // CreateAcceptInquiredSystemEventResponse creates a response to parse from AcceptInquiredSystemEvent response func CreateAcceptInquiredSystemEventResponse() (response *AcceptInquiredSystemEventResponse) { response = &AcceptInquiredSystemEventResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������activate_router_interface.go������������������������������������������������������������������������0000664�0000000�0000000�00000010177�13771713062�0034254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ActivateRouterInterface invokes the ecs.ActivateRouterInterface API synchronously // api document: https://help.aliyun.com/api/ecs/activaterouterinterface.html func (client *Client) ActivateRouterInterface(request *ActivateRouterInterfaceRequest) (response *ActivateRouterInterfaceResponse, err error) { response = CreateActivateRouterInterfaceResponse() err = client.DoAction(request, response) return } // ActivateRouterInterfaceWithChan invokes the ecs.ActivateRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/activaterouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ActivateRouterInterfaceWithChan(request *ActivateRouterInterfaceRequest) (<-chan *ActivateRouterInterfaceResponse, <-chan error) { responseChan := make(chan *ActivateRouterInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ActivateRouterInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ActivateRouterInterfaceWithCallback invokes the ecs.ActivateRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/activaterouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ActivateRouterInterfaceWithCallback(request *ActivateRouterInterfaceRequest, callback func(response *ActivateRouterInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ActivateRouterInterfaceResponse var err error defer close(result) response, err = client.ActivateRouterInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ActivateRouterInterfaceRequest is the request struct for api ActivateRouterInterface type ActivateRouterInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` } // ActivateRouterInterfaceResponse is the response struct for api ActivateRouterInterface type ActivateRouterInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateActivateRouterInterfaceRequest creates a request to invoke ActivateRouterInterface API func CreateActivateRouterInterfaceRequest() (request *ActivateRouterInterfaceRequest) { request = &ActivateRouterInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ActivateRouterInterface", "ecs", "openAPI") return } // CreateActivateRouterInterfaceResponse creates a response to parse from ActivateRouterInterface response func CreateActivateRouterInterfaceResponse() (response *ActivateRouterInterfaceResponse) { response = &ActivateRouterInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������add_bandwidth_package_ips.go������������������������������������������������������������������������0000664�0000000�0000000�00000010474�13771713062�0034136�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AddBandwidthPackageIps invokes the ecs.AddBandwidthPackageIps API synchronously // api document: https://help.aliyun.com/api/ecs/addbandwidthpackageips.html func (client *Client) AddBandwidthPackageIps(request *AddBandwidthPackageIpsRequest) (response *AddBandwidthPackageIpsResponse, err error) { response = CreateAddBandwidthPackageIpsResponse() err = client.DoAction(request, response) return } // AddBandwidthPackageIpsWithChan invokes the ecs.AddBandwidthPackageIps API asynchronously // api document: https://help.aliyun.com/api/ecs/addbandwidthpackageips.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AddBandwidthPackageIpsWithChan(request *AddBandwidthPackageIpsRequest) (<-chan *AddBandwidthPackageIpsResponse, <-chan error) { responseChan := make(chan *AddBandwidthPackageIpsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AddBandwidthPackageIps(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AddBandwidthPackageIpsWithCallback invokes the ecs.AddBandwidthPackageIps API asynchronously // api document: https://help.aliyun.com/api/ecs/addbandwidthpackageips.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AddBandwidthPackageIpsWithCallback(request *AddBandwidthPackageIpsRequest, callback func(response *AddBandwidthPackageIpsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AddBandwidthPackageIpsResponse var err error defer close(result) response, err = client.AddBandwidthPackageIps(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AddBandwidthPackageIpsRequest is the request struct for api AddBandwidthPackageIps type AddBandwidthPackageIpsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` IpCount string `position:"Query" name:"IpCount"` } // AddBandwidthPackageIpsResponse is the response struct for api AddBandwidthPackageIps type AddBandwidthPackageIpsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAddBandwidthPackageIpsRequest creates a request to invoke AddBandwidthPackageIps API func CreateAddBandwidthPackageIpsRequest() (request *AddBandwidthPackageIpsRequest) { request = &AddBandwidthPackageIpsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AddBandwidthPackageIps", "ecs", "openAPI") return } // CreateAddBandwidthPackageIpsResponse creates a response to parse from AddBandwidthPackageIps response func CreateAddBandwidthPackageIpsResponse() (response *AddBandwidthPackageIpsResponse) { response = &AddBandwidthPackageIpsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/add_tags.go�������������0000664�0000000�0000000�00000007453�13771713062�0030664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AddTags invokes the ecs.AddTags API synchronously // api document: https://help.aliyun.com/api/ecs/addtags.html func (client *Client) AddTags(request *AddTagsRequest) (response *AddTagsResponse, err error) { response = CreateAddTagsResponse() err = client.DoAction(request, response) return } // AddTagsWithChan invokes the ecs.AddTags API asynchronously // api document: https://help.aliyun.com/api/ecs/addtags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AddTagsWithChan(request *AddTagsRequest) (<-chan *AddTagsResponse, <-chan error) { responseChan := make(chan *AddTagsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AddTags(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AddTagsWithCallback invokes the ecs.AddTags API asynchronously // api document: https://help.aliyun.com/api/ecs/addtags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AddTagsWithCallback(request *AddTagsRequest, callback func(response *AddTagsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AddTagsResponse var err error defer close(result) response, err = client.AddTags(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AddTagsRequest is the request struct for api AddTags type AddTagsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceId string `position:"Query" name:"ResourceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Tag *[]AddTagsTag `position:"Query" name:"Tag" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` } // AddTagsTag is a repeated param struct in AddTagsRequest type AddTagsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // AddTagsResponse is the response struct for api AddTags type AddTagsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAddTagsRequest creates a request to invoke AddTags API func CreateAddTagsRequest() (request *AddTagsRequest) { request = &AddTagsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AddTags", "ecs", "openAPI") return } // CreateAddTagsResponse creates a response to parse from AddTags response func CreateAddTagsResponse() (response *AddTagsResponse) { response = &AddTagsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������allocate_dedicated_hosts.go�������������������������������������������������������������������������0000664�0000000�0000000�00000014255�13771713062�0034027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AllocateDedicatedHosts invokes the ecs.AllocateDedicatedHosts API synchronously // api document: https://help.aliyun.com/api/ecs/allocatededicatedhosts.html func (client *Client) AllocateDedicatedHosts(request *AllocateDedicatedHostsRequest) (response *AllocateDedicatedHostsResponse, err error) { response = CreateAllocateDedicatedHostsResponse() err = client.DoAction(request, response) return } // AllocateDedicatedHostsWithChan invokes the ecs.AllocateDedicatedHosts API asynchronously // api document: https://help.aliyun.com/api/ecs/allocatededicatedhosts.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AllocateDedicatedHostsWithChan(request *AllocateDedicatedHostsRequest) (<-chan *AllocateDedicatedHostsResponse, <-chan error) { responseChan := make(chan *AllocateDedicatedHostsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AllocateDedicatedHosts(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AllocateDedicatedHostsWithCallback invokes the ecs.AllocateDedicatedHosts API asynchronously // api document: https://help.aliyun.com/api/ecs/allocatededicatedhosts.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AllocateDedicatedHostsWithCallback(request *AllocateDedicatedHostsRequest, callback func(response *AllocateDedicatedHostsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AllocateDedicatedHostsResponse var err error defer close(result) response, err = client.AllocateDedicatedHosts(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AllocateDedicatedHostsRequest is the request struct for api AllocateDedicatedHosts type AllocateDedicatedHostsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ClientToken string `position:"Query" name:"ClientToken"` Description string `position:"Query" name:"Description"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` ActionOnMaintenance string `position:"Query" name:"ActionOnMaintenance"` Tag *[]AllocateDedicatedHostsTag `position:"Query" name:"Tag" type:"Repeated"` DedicatedHostType string `position:"Query" name:"DedicatedHostType"` AutoRenewPeriod requests.Integer `position:"Query" name:"AutoRenewPeriod"` Period requests.Integer `position:"Query" name:"Period"` Quantity requests.Integer `position:"Query" name:"Quantity"` DedicatedHostName string `position:"Query" name:"DedicatedHostName"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PeriodUnit string `position:"Query" name:"PeriodUnit"` AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` NetworkAttributesSlbUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.SlbUdpTimeout"` ZoneId string `position:"Query" name:"ZoneId"` ChargeType string `position:"Query" name:"ChargeType"` NetworkAttributesUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.UdpTimeout"` } // AllocateDedicatedHostsTag is a repeated param struct in AllocateDedicatedHostsRequest type AllocateDedicatedHostsTag struct { Key string `name:"Key"` Value string `name:"Value"` } // AllocateDedicatedHostsResponse is the response struct for api AllocateDedicatedHosts type AllocateDedicatedHostsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` DedicatedHostIdSets DedicatedHostIdSets `json:"DedicatedHostIdSets" xml:"DedicatedHostIdSets"` } // CreateAllocateDedicatedHostsRequest creates a request to invoke AllocateDedicatedHosts API func CreateAllocateDedicatedHostsRequest() (request *AllocateDedicatedHostsRequest) { request = &AllocateDedicatedHostsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AllocateDedicatedHosts", "ecs", "openAPI") return } // CreateAllocateDedicatedHostsResponse creates a response to parse from AllocateDedicatedHosts response func CreateAllocateDedicatedHostsResponse() (response *AllocateDedicatedHostsResponse) { response = &AllocateDedicatedHostsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/allocate_eip_address.go�0000664�0000000�0000000�00000010536�13771713062�0033240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AllocateEipAddress invokes the ecs.AllocateEipAddress API synchronously // api document: https://help.aliyun.com/api/ecs/allocateeipaddress.html func (client *Client) AllocateEipAddress(request *AllocateEipAddressRequest) (response *AllocateEipAddressResponse, err error) { response = CreateAllocateEipAddressResponse() err = client.DoAction(request, response) return } // AllocateEipAddressWithChan invokes the ecs.AllocateEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/allocateeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AllocateEipAddressWithChan(request *AllocateEipAddressRequest) (<-chan *AllocateEipAddressResponse, <-chan error) { responseChan := make(chan *AllocateEipAddressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AllocateEipAddress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AllocateEipAddressWithCallback invokes the ecs.AllocateEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/allocateeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AllocateEipAddressWithCallback(request *AllocateEipAddressRequest, callback func(response *AllocateEipAddressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AllocateEipAddressResponse var err error defer close(result) response, err = client.AllocateEipAddress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AllocateEipAddressRequest is the request struct for api AllocateEipAddress type AllocateEipAddressRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Bandwidth string `position:"Query" name:"Bandwidth"` ClientToken string `position:"Query" name:"ClientToken"` InternetChargeType string `position:"Query" name:"InternetChargeType"` ISP string `position:"Query" name:"ISP"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AllocateEipAddressResponse is the response struct for api AllocateEipAddress type AllocateEipAddressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AllocationId string `json:"AllocationId" xml:"AllocationId"` EipAddress string `json:"EipAddress" xml:"EipAddress"` } // CreateAllocateEipAddressRequest creates a request to invoke AllocateEipAddress API func CreateAllocateEipAddressRequest() (request *AllocateEipAddressRequest) { request = &AllocateEipAddressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AllocateEipAddress", "ecs", "openAPI") return } // CreateAllocateEipAddressResponse creates a response to parse from AllocateEipAddress response func CreateAllocateEipAddressResponse() (response *AllocateEipAddressResponse) { response = &AllocateEipAddressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������allocate_public_ip_address.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010616�13771713062�0034351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AllocatePublicIpAddress invokes the ecs.AllocatePublicIpAddress API synchronously // api document: https://help.aliyun.com/api/ecs/allocatepublicipaddress.html func (client *Client) AllocatePublicIpAddress(request *AllocatePublicIpAddressRequest) (response *AllocatePublicIpAddressResponse, err error) { response = CreateAllocatePublicIpAddressResponse() err = client.DoAction(request, response) return } // AllocatePublicIpAddressWithChan invokes the ecs.AllocatePublicIpAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/allocatepublicipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AllocatePublicIpAddressWithChan(request *AllocatePublicIpAddressRequest) (<-chan *AllocatePublicIpAddressResponse, <-chan error) { responseChan := make(chan *AllocatePublicIpAddressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AllocatePublicIpAddress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AllocatePublicIpAddressWithCallback invokes the ecs.AllocatePublicIpAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/allocatepublicipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AllocatePublicIpAddressWithCallback(request *AllocatePublicIpAddressRequest, callback func(response *AllocatePublicIpAddressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AllocatePublicIpAddressResponse var err error defer close(result) response, err = client.AllocatePublicIpAddress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AllocatePublicIpAddressRequest is the request struct for api AllocatePublicIpAddress type AllocatePublicIpAddressRequest struct { *requests.RpcRequest IpAddress string `position:"Query" name:"IpAddress"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VlanId string `position:"Query" name:"VlanId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AllocatePublicIpAddressResponse is the response struct for api AllocatePublicIpAddress type AllocatePublicIpAddressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` IpAddress string `json:"IpAddress" xml:"IpAddress"` } // CreateAllocatePublicIpAddressRequest creates a request to invoke AllocatePublicIpAddress API func CreateAllocatePublicIpAddressRequest() (request *AllocatePublicIpAddressRequest) { request = &AllocatePublicIpAddressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AllocatePublicIpAddress", "ecs", "openAPI") return } // CreateAllocatePublicIpAddressResponse creates a response to parse from AllocatePublicIpAddress response func CreateAllocatePublicIpAddressResponse() (response *AllocatePublicIpAddressResponse) { response = &AllocatePublicIpAddressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������apply_auto_snapshot_policy.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010313�13771713062�0034477�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ApplyAutoSnapshotPolicy invokes the ecs.ApplyAutoSnapshotPolicy API synchronously // api document: https://help.aliyun.com/api/ecs/applyautosnapshotpolicy.html func (client *Client) ApplyAutoSnapshotPolicy(request *ApplyAutoSnapshotPolicyRequest) (response *ApplyAutoSnapshotPolicyResponse, err error) { response = CreateApplyAutoSnapshotPolicyResponse() err = client.DoAction(request, response) return } // ApplyAutoSnapshotPolicyWithChan invokes the ecs.ApplyAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/applyautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ApplyAutoSnapshotPolicyWithChan(request *ApplyAutoSnapshotPolicyRequest) (<-chan *ApplyAutoSnapshotPolicyResponse, <-chan error) { responseChan := make(chan *ApplyAutoSnapshotPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ApplyAutoSnapshotPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ApplyAutoSnapshotPolicyWithCallback invokes the ecs.ApplyAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/applyautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ApplyAutoSnapshotPolicyWithCallback(request *ApplyAutoSnapshotPolicyRequest, callback func(response *ApplyAutoSnapshotPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ApplyAutoSnapshotPolicyResponse var err error defer close(result) response, err = client.ApplyAutoSnapshotPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ApplyAutoSnapshotPolicyRequest is the request struct for api ApplyAutoSnapshotPolicy type ApplyAutoSnapshotPolicyRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` AutoSnapshotPolicyId string `position:"Query" name:"autoSnapshotPolicyId"` DiskIds string `position:"Query" name:"diskIds"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ApplyAutoSnapshotPolicyResponse is the response struct for api ApplyAutoSnapshotPolicy type ApplyAutoSnapshotPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateApplyAutoSnapshotPolicyRequest creates a request to invoke ApplyAutoSnapshotPolicy API func CreateApplyAutoSnapshotPolicyRequest() (request *ApplyAutoSnapshotPolicyRequest) { request = &ApplyAutoSnapshotPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ApplyAutoSnapshotPolicy", "ecs", "openAPI") return } // CreateApplyAutoSnapshotPolicyResponse creates a response to parse from ApplyAutoSnapshotPolicy response func CreateApplyAutoSnapshotPolicyResponse() (response *ApplyAutoSnapshotPolicyResponse) { response = &ApplyAutoSnapshotPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/assign_ipv6_addresses.go0000664�0000000�0000000�00000010336�13771713062�0033375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AssignIpv6Addresses invokes the ecs.AssignIpv6Addresses API synchronously // api document: https://help.aliyun.com/api/ecs/assignipv6addresses.html func (client *Client) AssignIpv6Addresses(request *AssignIpv6AddressesRequest) (response *AssignIpv6AddressesResponse, err error) { response = CreateAssignIpv6AddressesResponse() err = client.DoAction(request, response) return } // AssignIpv6AddressesWithChan invokes the ecs.AssignIpv6Addresses API asynchronously // api document: https://help.aliyun.com/api/ecs/assignipv6addresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssignIpv6AddressesWithChan(request *AssignIpv6AddressesRequest) (<-chan *AssignIpv6AddressesResponse, <-chan error) { responseChan := make(chan *AssignIpv6AddressesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AssignIpv6Addresses(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AssignIpv6AddressesWithCallback invokes the ecs.AssignIpv6Addresses API asynchronously // api document: https://help.aliyun.com/api/ecs/assignipv6addresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssignIpv6AddressesWithCallback(request *AssignIpv6AddressesRequest, callback func(response *AssignIpv6AddressesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AssignIpv6AddressesResponse var err error defer close(result) response, err = client.AssignIpv6Addresses(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AssignIpv6AddressesRequest is the request struct for api AssignIpv6Addresses type AssignIpv6AddressesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Ipv6AddressCount requests.Integer `position:"Query" name:"Ipv6AddressCount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` Ipv6Address *[]string `position:"Query" name:"Ipv6Address" type:"Repeated"` } // AssignIpv6AddressesResponse is the response struct for api AssignIpv6Addresses type AssignIpv6AddressesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAssignIpv6AddressesRequest creates a request to invoke AssignIpv6Addresses API func CreateAssignIpv6AddressesRequest() (request *AssignIpv6AddressesRequest) { request = &AssignIpv6AddressesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AssignIpv6Addresses", "ecs", "openAPI") return } // CreateAssignIpv6AddressesResponse creates a response to parse from AssignIpv6Addresses response func CreateAssignIpv6AddressesResponse() (response *AssignIpv6AddressesResponse) { response = &AssignIpv6AddressesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������assign_private_ip_addresses.go����������������������������������������������������������������������0000664�0000000�0000000�00000010777�13771713062�0034605�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AssignPrivateIpAddresses invokes the ecs.AssignPrivateIpAddresses API synchronously // api document: https://help.aliyun.com/api/ecs/assignprivateipaddresses.html func (client *Client) AssignPrivateIpAddresses(request *AssignPrivateIpAddressesRequest) (response *AssignPrivateIpAddressesResponse, err error) { response = CreateAssignPrivateIpAddressesResponse() err = client.DoAction(request, response) return } // AssignPrivateIpAddressesWithChan invokes the ecs.AssignPrivateIpAddresses API asynchronously // api document: https://help.aliyun.com/api/ecs/assignprivateipaddresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssignPrivateIpAddressesWithChan(request *AssignPrivateIpAddressesRequest) (<-chan *AssignPrivateIpAddressesResponse, <-chan error) { responseChan := make(chan *AssignPrivateIpAddressesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AssignPrivateIpAddresses(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AssignPrivateIpAddressesWithCallback invokes the ecs.AssignPrivateIpAddresses API asynchronously // api document: https://help.aliyun.com/api/ecs/assignprivateipaddresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssignPrivateIpAddressesWithCallback(request *AssignPrivateIpAddressesRequest, callback func(response *AssignPrivateIpAddressesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AssignPrivateIpAddressesResponse var err error defer close(result) response, err = client.AssignPrivateIpAddresses(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AssignPrivateIpAddressesRequest is the request struct for api AssignPrivateIpAddresses type AssignPrivateIpAddressesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SecondaryPrivateIpAddressCount requests.Integer `position:"Query" name:"SecondaryPrivateIpAddressCount"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PrivateIpAddress *[]string `position:"Query" name:"PrivateIpAddress" type:"Repeated"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // AssignPrivateIpAddressesResponse is the response struct for api AssignPrivateIpAddresses type AssignPrivateIpAddressesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAssignPrivateIpAddressesRequest creates a request to invoke AssignPrivateIpAddresses API func CreateAssignPrivateIpAddressesRequest() (request *AssignPrivateIpAddressesRequest) { request = &AssignPrivateIpAddressesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AssignPrivateIpAddresses", "ecs", "openAPI") return } // CreateAssignPrivateIpAddressesResponse creates a response to parse from AssignPrivateIpAddresses response func CreateAssignPrivateIpAddressesResponse() (response *AssignPrivateIpAddressesResponse) { response = &AssignPrivateIpAddressesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_eip_address.go0000664�0000000�0000000�00000010302�13771713062�0033416�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AssociateEipAddress invokes the ecs.AssociateEipAddress API synchronously // api document: https://help.aliyun.com/api/ecs/associateeipaddress.html func (client *Client) AssociateEipAddress(request *AssociateEipAddressRequest) (response *AssociateEipAddressResponse, err error) { response = CreateAssociateEipAddressResponse() err = client.DoAction(request, response) return } // AssociateEipAddressWithChan invokes the ecs.AssociateEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/associateeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssociateEipAddressWithChan(request *AssociateEipAddressRequest) (<-chan *AssociateEipAddressResponse, <-chan error) { responseChan := make(chan *AssociateEipAddressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AssociateEipAddress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AssociateEipAddressWithCallback invokes the ecs.AssociateEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/associateeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssociateEipAddressWithCallback(request *AssociateEipAddressRequest, callback func(response *AssociateEipAddressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AssociateEipAddressResponse var err error defer close(result) response, err = client.AssociateEipAddress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AssociateEipAddressRequest is the request struct for api AssociateEipAddress type AssociateEipAddressRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InstanceType string `position:"Query" name:"InstanceType"` AllocationId string `position:"Query" name:"AllocationId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AssociateEipAddressResponse is the response struct for api AssociateEipAddress type AssociateEipAddressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAssociateEipAddressRequest creates a request to invoke AssociateEipAddress API func CreateAssociateEipAddressRequest() (request *AssociateEipAddressRequest) { request = &AssociateEipAddressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AssociateEipAddress", "ecs", "openAPI") return } // CreateAssociateEipAddressResponse creates a response to parse from AssociateEipAddress response func CreateAssociateEipAddressResponse() (response *AssociateEipAddressResponse) { response = &AssociateEipAddressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/associate_ha_vip.go�����0000664�0000000�0000000�00000007764�13771713062�0032424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AssociateHaVip invokes the ecs.AssociateHaVip API synchronously // api document: https://help.aliyun.com/api/ecs/associatehavip.html func (client *Client) AssociateHaVip(request *AssociateHaVipRequest) (response *AssociateHaVipResponse, err error) { response = CreateAssociateHaVipResponse() err = client.DoAction(request, response) return } // AssociateHaVipWithChan invokes the ecs.AssociateHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/associatehavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssociateHaVipWithChan(request *AssociateHaVipRequest) (<-chan *AssociateHaVipResponse, <-chan error) { responseChan := make(chan *AssociateHaVipResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AssociateHaVip(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AssociateHaVipWithCallback invokes the ecs.AssociateHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/associatehavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AssociateHaVipWithCallback(request *AssociateHaVipRequest, callback func(response *AssociateHaVipResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AssociateHaVipResponse var err error defer close(result) response, err = client.AssociateHaVip(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AssociateHaVipRequest is the request struct for api AssociateHaVip type AssociateHaVipRequest struct { *requests.RpcRequest HaVipId string `position:"Query" name:"HaVipId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AssociateHaVipResponse is the response struct for api AssociateHaVip type AssociateHaVipResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAssociateHaVipRequest creates a request to invoke AssociateHaVip API func CreateAssociateHaVipRequest() (request *AssociateHaVipRequest) { request = &AssociateHaVipRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AssociateHaVip", "ecs", "openAPI") return } // CreateAssociateHaVipResponse creates a response to parse from AssociateHaVip response func CreateAssociateHaVipResponse() (response *AssociateHaVipResponse) { response = &AssociateHaVipResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������attach_classic_link_vpc.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010107�13771713062�0033657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachClassicLinkVpc invokes the ecs.AttachClassicLinkVpc API synchronously // api document: https://help.aliyun.com/api/ecs/attachclassiclinkvpc.html func (client *Client) AttachClassicLinkVpc(request *AttachClassicLinkVpcRequest) (response *AttachClassicLinkVpcResponse, err error) { response = CreateAttachClassicLinkVpcResponse() err = client.DoAction(request, response) return } // AttachClassicLinkVpcWithChan invokes the ecs.AttachClassicLinkVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/attachclassiclinkvpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachClassicLinkVpcWithChan(request *AttachClassicLinkVpcRequest) (<-chan *AttachClassicLinkVpcResponse, <-chan error) { responseChan := make(chan *AttachClassicLinkVpcResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachClassicLinkVpc(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachClassicLinkVpcWithCallback invokes the ecs.AttachClassicLinkVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/attachclassiclinkvpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachClassicLinkVpcWithCallback(request *AttachClassicLinkVpcRequest, callback func(response *AttachClassicLinkVpcResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachClassicLinkVpcResponse var err error defer close(result) response, err = client.AttachClassicLinkVpc(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachClassicLinkVpcRequest is the request struct for api AttachClassicLinkVpc type AttachClassicLinkVpcRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VpcId string `position:"Query" name:"VpcId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AttachClassicLinkVpcResponse is the response struct for api AttachClassicLinkVpc type AttachClassicLinkVpcResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAttachClassicLinkVpcRequest creates a request to invoke AttachClassicLinkVpc API func CreateAttachClassicLinkVpcRequest() (request *AttachClassicLinkVpcRequest) { request = &AttachClassicLinkVpcRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AttachClassicLinkVpc", "ecs", "openAPI") return } // CreateAttachClassicLinkVpcResponse creates a response to parse from AttachClassicLinkVpc response func CreateAttachClassicLinkVpcResponse() (response *AttachClassicLinkVpcResponse) { response = &AttachClassicLinkVpcResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_disk.go����������0000664�0000000�0000000�00000007642�13771713062�0031374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachDisk invokes the ecs.AttachDisk API synchronously // api document: https://help.aliyun.com/api/ecs/attachdisk.html func (client *Client) AttachDisk(request *AttachDiskRequest) (response *AttachDiskResponse, err error) { response = CreateAttachDiskResponse() err = client.DoAction(request, response) return } // AttachDiskWithChan invokes the ecs.AttachDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/attachdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachDiskWithChan(request *AttachDiskRequest) (<-chan *AttachDiskResponse, <-chan error) { responseChan := make(chan *AttachDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachDiskWithCallback invokes the ecs.AttachDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/attachdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachDiskWithCallback(request *AttachDiskRequest, callback func(response *AttachDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachDiskResponse var err error defer close(result) response, err = client.AttachDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachDiskRequest is the request struct for api AttachDisk type AttachDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DiskId string `position:"Query" name:"DiskId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Device string `position:"Query" name:"Device"` DeleteWithInstance requests.Boolean `position:"Query" name:"DeleteWithInstance"` } // AttachDiskResponse is the response struct for api AttachDisk type AttachDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAttachDiskRequest creates a request to invoke AttachDisk API func CreateAttachDiskRequest() (request *AttachDiskRequest) { request = &AttachDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AttachDisk", "ecs", "openAPI") return } // CreateAttachDiskResponse creates a response to parse from AttachDisk response func CreateAttachDiskResponse() (response *AttachDiskResponse) { response = &AttachDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������attach_instance_ram_role.go�������������������������������������������������������������������������0000664�0000000�0000000�00000011103�13771713062�0034032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachInstanceRamRole invokes the ecs.AttachInstanceRamRole API synchronously // api document: https://help.aliyun.com/api/ecs/attachinstanceramrole.html func (client *Client) AttachInstanceRamRole(request *AttachInstanceRamRoleRequest) (response *AttachInstanceRamRoleResponse, err error) { response = CreateAttachInstanceRamRoleResponse() err = client.DoAction(request, response) return } // AttachInstanceRamRoleWithChan invokes the ecs.AttachInstanceRamRole API asynchronously // api document: https://help.aliyun.com/api/ecs/attachinstanceramrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachInstanceRamRoleWithChan(request *AttachInstanceRamRoleRequest) (<-chan *AttachInstanceRamRoleResponse, <-chan error) { responseChan := make(chan *AttachInstanceRamRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachInstanceRamRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachInstanceRamRoleWithCallback invokes the ecs.AttachInstanceRamRole API asynchronously // api document: https://help.aliyun.com/api/ecs/attachinstanceramrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachInstanceRamRoleWithCallback(request *AttachInstanceRamRoleRequest, callback func(response *AttachInstanceRamRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachInstanceRamRoleResponse var err error defer close(result) response, err = client.AttachInstanceRamRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachInstanceRamRoleRequest is the request struct for api AttachInstanceRamRole type AttachInstanceRamRoleRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` InstanceIds string `position:"Query" name:"InstanceIds"` RamRoleName string `position:"Query" name:"RamRoleName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AttachInstanceRamRoleResponse is the response struct for api AttachInstanceRamRole type AttachInstanceRamRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` FailCount int `json:"FailCount" xml:"FailCount"` RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` AttachInstanceRamRoleResults AttachInstanceRamRoleResults `json:"AttachInstanceRamRoleResults" xml:"AttachInstanceRamRoleResults"` } // CreateAttachInstanceRamRoleRequest creates a request to invoke AttachInstanceRamRole API func CreateAttachInstanceRamRoleRequest() (request *AttachInstanceRamRoleRequest) { request = &AttachInstanceRamRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AttachInstanceRamRole", "ecs", "openAPI") return } // CreateAttachInstanceRamRoleResponse creates a response to parse from AttachInstanceRamRole response func CreateAttachInstanceRamRoleResponse() (response *AttachInstanceRamRoleResponse) { response = &AttachInstanceRamRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/attach_key_pair.go������0000664�0000000�0000000�00000010146�13771713062�0032236�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachKeyPair invokes the ecs.AttachKeyPair API synchronously // api document: https://help.aliyun.com/api/ecs/attachkeypair.html func (client *Client) AttachKeyPair(request *AttachKeyPairRequest) (response *AttachKeyPairResponse, err error) { response = CreateAttachKeyPairResponse() err = client.DoAction(request, response) return } // AttachKeyPairWithChan invokes the ecs.AttachKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/attachkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachKeyPairWithChan(request *AttachKeyPairRequest) (<-chan *AttachKeyPairResponse, <-chan error) { responseChan := make(chan *AttachKeyPairResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachKeyPair(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachKeyPairWithCallback invokes the ecs.AttachKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/attachkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachKeyPairWithCallback(request *AttachKeyPairRequest, callback func(response *AttachKeyPairResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachKeyPairResponse var err error defer close(result) response, err = client.AttachKeyPair(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachKeyPairRequest is the request struct for api AttachKeyPair type AttachKeyPairRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` InstanceIds string `position:"Query" name:"InstanceIds"` KeyPairName string `position:"Query" name:"KeyPairName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // AttachKeyPairResponse is the response struct for api AttachKeyPair type AttachKeyPairResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount string `json:"TotalCount" xml:"TotalCount"` FailCount string `json:"FailCount" xml:"FailCount"` KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` Results ResultsInAttachKeyPair `json:"Results" xml:"Results"` } // CreateAttachKeyPairRequest creates a request to invoke AttachKeyPair API func CreateAttachKeyPairRequest() (request *AttachKeyPairRequest) { request = &AttachKeyPairRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AttachKeyPair", "ecs", "openAPI") return } // CreateAttachKeyPairResponse creates a response to parse from AttachKeyPair response func CreateAttachKeyPairResponse() (response *AttachKeyPairResponse) { response = &AttachKeyPairResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������attach_network_interface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000010362�13771713062�0034065�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachNetworkInterface invokes the ecs.AttachNetworkInterface API synchronously // api document: https://help.aliyun.com/api/ecs/attachnetworkinterface.html func (client *Client) AttachNetworkInterface(request *AttachNetworkInterfaceRequest) (response *AttachNetworkInterfaceResponse, err error) { response = CreateAttachNetworkInterfaceResponse() err = client.DoAction(request, response) return } // AttachNetworkInterfaceWithChan invokes the ecs.AttachNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/attachnetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachNetworkInterfaceWithChan(request *AttachNetworkInterfaceRequest) (<-chan *AttachNetworkInterfaceResponse, <-chan error) { responseChan := make(chan *AttachNetworkInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachNetworkInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachNetworkInterfaceWithCallback invokes the ecs.AttachNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/attachnetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachNetworkInterfaceWithCallback(request *AttachNetworkInterfaceRequest, callback func(response *AttachNetworkInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachNetworkInterfaceResponse var err error defer close(result) response, err = client.AttachNetworkInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachNetworkInterfaceRequest is the request struct for api AttachNetworkInterface type AttachNetworkInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // AttachNetworkInterfaceResponse is the response struct for api AttachNetworkInterface type AttachNetworkInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAttachNetworkInterfaceRequest creates a request to invoke AttachNetworkInterface API func CreateAttachNetworkInterfaceRequest() (request *AttachNetworkInterfaceRequest) { request = &AttachNetworkInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AttachNetworkInterface", "ecs", "openAPI") return } // CreateAttachNetworkInterfaceResponse creates a response to parse from AttachNetworkInterface response func CreateAttachNetworkInterfaceResponse() (response *AttachNetworkInterfaceResponse) { response = &AttachNetworkInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������authorize_security_group.go�������������������������������������������������������������������������0000664�0000000�0000000�00000012564�13771713062�0034213�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AuthorizeSecurityGroup invokes the ecs.AuthorizeSecurityGroup API synchronously // api document: https://help.aliyun.com/api/ecs/authorizesecuritygroup.html func (client *Client) AuthorizeSecurityGroup(request *AuthorizeSecurityGroupRequest) (response *AuthorizeSecurityGroupResponse, err error) { response = CreateAuthorizeSecurityGroupResponse() err = client.DoAction(request, response) return } // AuthorizeSecurityGroupWithChan invokes the ecs.AuthorizeSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/authorizesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AuthorizeSecurityGroupWithChan(request *AuthorizeSecurityGroupRequest) (<-chan *AuthorizeSecurityGroupResponse, <-chan error) { responseChan := make(chan *AuthorizeSecurityGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AuthorizeSecurityGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AuthorizeSecurityGroupWithCallback invokes the ecs.AuthorizeSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/authorizesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AuthorizeSecurityGroupWithCallback(request *AuthorizeSecurityGroupRequest, callback func(response *AuthorizeSecurityGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AuthorizeSecurityGroupResponse var err error defer close(result) response, err = client.AuthorizeSecurityGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AuthorizeSecurityGroupRequest is the request struct for api AuthorizeSecurityGroup type AuthorizeSecurityGroupRequest struct { *requests.RpcRequest NicType string `position:"Query" name:"NicType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SourcePortRange string `position:"Query" name:"SourcePortRange"` ClientToken string `position:"Query" name:"ClientToken"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` SourceGroupOwnerId requests.Integer `position:"Query" name:"SourceGroupOwnerId"` SourceGroupOwnerAccount string `position:"Query" name:"SourceGroupOwnerAccount"` Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` Policy string `position:"Query" name:"Policy"` PortRange string `position:"Query" name:"PortRange"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SourceCidrIp string `position:"Query" name:"SourceCidrIp"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Priority string `position:"Query" name:"Priority"` DestCidrIp string `position:"Query" name:"DestCidrIp"` SourceGroupId string `position:"Query" name:"SourceGroupId"` } // AuthorizeSecurityGroupResponse is the response struct for api AuthorizeSecurityGroup type AuthorizeSecurityGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAuthorizeSecurityGroupRequest creates a request to invoke AuthorizeSecurityGroup API func CreateAuthorizeSecurityGroupRequest() (request *AuthorizeSecurityGroupRequest) { request = &AuthorizeSecurityGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AuthorizeSecurityGroup", "ecs", "openAPI") return } // CreateAuthorizeSecurityGroupResponse creates a response to parse from AuthorizeSecurityGroup response func CreateAuthorizeSecurityGroupResponse() (response *AuthorizeSecurityGroupResponse) { response = &AuthorizeSecurityGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������authorize_security_group_egress.go������������������������������������������������������������������0000664�0000000�0000000�00000013066�13771713062�0035561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AuthorizeSecurityGroupEgress invokes the ecs.AuthorizeSecurityGroupEgress API synchronously // api document: https://help.aliyun.com/api/ecs/authorizesecuritygroupegress.html func (client *Client) AuthorizeSecurityGroupEgress(request *AuthorizeSecurityGroupEgressRequest) (response *AuthorizeSecurityGroupEgressResponse, err error) { response = CreateAuthorizeSecurityGroupEgressResponse() err = client.DoAction(request, response) return } // AuthorizeSecurityGroupEgressWithChan invokes the ecs.AuthorizeSecurityGroupEgress API asynchronously // api document: https://help.aliyun.com/api/ecs/authorizesecuritygroupegress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AuthorizeSecurityGroupEgressWithChan(request *AuthorizeSecurityGroupEgressRequest) (<-chan *AuthorizeSecurityGroupEgressResponse, <-chan error) { responseChan := make(chan *AuthorizeSecurityGroupEgressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AuthorizeSecurityGroupEgress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AuthorizeSecurityGroupEgressWithCallback invokes the ecs.AuthorizeSecurityGroupEgress API asynchronously // api document: https://help.aliyun.com/api/ecs/authorizesecuritygroupegress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AuthorizeSecurityGroupEgressWithCallback(request *AuthorizeSecurityGroupEgressRequest, callback func(response *AuthorizeSecurityGroupEgressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AuthorizeSecurityGroupEgressResponse var err error defer close(result) response, err = client.AuthorizeSecurityGroupEgress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AuthorizeSecurityGroupEgressRequest is the request struct for api AuthorizeSecurityGroupEgress type AuthorizeSecurityGroupEgressRequest struct { *requests.RpcRequest NicType string `position:"Query" name:"NicType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SourcePortRange string `position:"Query" name:"SourcePortRange"` ClientToken string `position:"Query" name:"ClientToken"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` Policy string `position:"Query" name:"Policy"` PortRange string `position:"Query" name:"PortRange"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SourceCidrIp string `position:"Query" name:"SourceCidrIp"` DestGroupId string `position:"Query" name:"DestGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DestGroupOwnerAccount string `position:"Query" name:"DestGroupOwnerAccount"` Priority string `position:"Query" name:"Priority"` DestCidrIp string `position:"Query" name:"DestCidrIp"` DestGroupOwnerId requests.Integer `position:"Query" name:"DestGroupOwnerId"` } // AuthorizeSecurityGroupEgressResponse is the response struct for api AuthorizeSecurityGroupEgress type AuthorizeSecurityGroupEgressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAuthorizeSecurityGroupEgressRequest creates a request to invoke AuthorizeSecurityGroupEgress API func CreateAuthorizeSecurityGroupEgressRequest() (request *AuthorizeSecurityGroupEgressRequest) { request = &AuthorizeSecurityGroupEgressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "AuthorizeSecurityGroupEgress", "ecs", "openAPI") return } // CreateAuthorizeSecurityGroupEgressResponse creates a response to parse from AuthorizeSecurityGroupEgress response func CreateAuthorizeSecurityGroupEgressResponse() (response *AuthorizeSecurityGroupEgressResponse) { response = &AuthorizeSecurityGroupEgressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cancel_auto_snapshot_policy.go����������������������������������������������������������������������0000664�0000000�0000000�00000010235�13771713062�0034602�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CancelAutoSnapshotPolicy invokes the ecs.CancelAutoSnapshotPolicy API synchronously // api document: https://help.aliyun.com/api/ecs/cancelautosnapshotpolicy.html func (client *Client) CancelAutoSnapshotPolicy(request *CancelAutoSnapshotPolicyRequest) (response *CancelAutoSnapshotPolicyResponse, err error) { response = CreateCancelAutoSnapshotPolicyResponse() err = client.DoAction(request, response) return } // CancelAutoSnapshotPolicyWithChan invokes the ecs.CancelAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelAutoSnapshotPolicyWithChan(request *CancelAutoSnapshotPolicyRequest) (<-chan *CancelAutoSnapshotPolicyResponse, <-chan error) { responseChan := make(chan *CancelAutoSnapshotPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CancelAutoSnapshotPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CancelAutoSnapshotPolicyWithCallback invokes the ecs.CancelAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelAutoSnapshotPolicyWithCallback(request *CancelAutoSnapshotPolicyRequest, callback func(response *CancelAutoSnapshotPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CancelAutoSnapshotPolicyResponse var err error defer close(result) response, err = client.CancelAutoSnapshotPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CancelAutoSnapshotPolicyRequest is the request struct for api CancelAutoSnapshotPolicy type CancelAutoSnapshotPolicyRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` DiskIds string `position:"Query" name:"diskIds"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CancelAutoSnapshotPolicyResponse is the response struct for api CancelAutoSnapshotPolicy type CancelAutoSnapshotPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateCancelAutoSnapshotPolicyRequest creates a request to invoke CancelAutoSnapshotPolicy API func CreateCancelAutoSnapshotPolicyRequest() (request *CancelAutoSnapshotPolicyRequest) { request = &CancelAutoSnapshotPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CancelAutoSnapshotPolicy", "ecs", "openAPI") return } // CreateCancelAutoSnapshotPolicyResponse creates a response to parse from CancelAutoSnapshotPolicy response func CreateCancelAutoSnapshotPolicyResponse() (response *CancelAutoSnapshotPolicyResponse) { response = &CancelAutoSnapshotPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_copy_image.go����0000664�0000000�0000000�00000007603�13771713062�0032534�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CancelCopyImage invokes the ecs.CancelCopyImage API synchronously // api document: https://help.aliyun.com/api/ecs/cancelcopyimage.html func (client *Client) CancelCopyImage(request *CancelCopyImageRequest) (response *CancelCopyImageResponse, err error) { response = CreateCancelCopyImageResponse() err = client.DoAction(request, response) return } // CancelCopyImageWithChan invokes the ecs.CancelCopyImage API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelcopyimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelCopyImageWithChan(request *CancelCopyImageRequest) (<-chan *CancelCopyImageResponse, <-chan error) { responseChan := make(chan *CancelCopyImageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CancelCopyImage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CancelCopyImageWithCallback invokes the ecs.CancelCopyImage API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelcopyimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelCopyImageWithCallback(request *CancelCopyImageRequest, callback func(response *CancelCopyImageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CancelCopyImageResponse var err error defer close(result) response, err = client.CancelCopyImage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CancelCopyImageRequest is the request struct for api CancelCopyImage type CancelCopyImageRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CancelCopyImageResponse is the response struct for api CancelCopyImage type CancelCopyImageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateCancelCopyImageRequest creates a request to invoke CancelCopyImage API func CreateCancelCopyImageRequest() (request *CancelCopyImageRequest) { request = &CancelCopyImageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CancelCopyImage", "ecs", "openAPI") return } // CreateCancelCopyImageResponse creates a response to parse from CancelCopyImage response func CreateCancelCopyImageResponse() (response *CancelCopyImageResponse) { response = &CancelCopyImageResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������cancel_physical_connection.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010617�13771713062�0034373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CancelPhysicalConnection invokes the ecs.CancelPhysicalConnection API synchronously // api document: https://help.aliyun.com/api/ecs/cancelphysicalconnection.html func (client *Client) CancelPhysicalConnection(request *CancelPhysicalConnectionRequest) (response *CancelPhysicalConnectionResponse, err error) { response = CreateCancelPhysicalConnectionResponse() err = client.DoAction(request, response) return } // CancelPhysicalConnectionWithChan invokes the ecs.CancelPhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelphysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelPhysicalConnectionWithChan(request *CancelPhysicalConnectionRequest) (<-chan *CancelPhysicalConnectionResponse, <-chan error) { responseChan := make(chan *CancelPhysicalConnectionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CancelPhysicalConnection(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CancelPhysicalConnectionWithCallback invokes the ecs.CancelPhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelphysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelPhysicalConnectionWithCallback(request *CancelPhysicalConnectionRequest, callback func(response *CancelPhysicalConnectionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CancelPhysicalConnectionResponse var err error defer close(result) response, err = client.CancelPhysicalConnection(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CancelPhysicalConnectionRequest is the request struct for api CancelPhysicalConnection type CancelPhysicalConnectionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CancelPhysicalConnectionResponse is the response struct for api CancelPhysicalConnection type CancelPhysicalConnectionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateCancelPhysicalConnectionRequest creates a request to invoke CancelPhysicalConnection API func CreateCancelPhysicalConnectionRequest() (request *CancelPhysicalConnectionRequest) { request = &CancelPhysicalConnectionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CancelPhysicalConnection", "ecs", "openAPI") return } // CreateCancelPhysicalConnectionResponse creates a response to parse from CancelPhysicalConnection response func CreateCancelPhysicalConnectionResponse() (response *CancelPhysicalConnectionResponse) { response = &CancelPhysicalConnectionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������cancel_simulated_system_events.go�������������������������������������������������������������������0000664�0000000�0000000�00000010564�13771713062�0035320�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CancelSimulatedSystemEvents invokes the ecs.CancelSimulatedSystemEvents API synchronously // api document: https://help.aliyun.com/api/ecs/cancelsimulatedsystemevents.html func (client *Client) CancelSimulatedSystemEvents(request *CancelSimulatedSystemEventsRequest) (response *CancelSimulatedSystemEventsResponse, err error) { response = CreateCancelSimulatedSystemEventsResponse() err = client.DoAction(request, response) return } // CancelSimulatedSystemEventsWithChan invokes the ecs.CancelSimulatedSystemEvents API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelsimulatedsystemevents.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelSimulatedSystemEventsWithChan(request *CancelSimulatedSystemEventsRequest) (<-chan *CancelSimulatedSystemEventsResponse, <-chan error) { responseChan := make(chan *CancelSimulatedSystemEventsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CancelSimulatedSystemEvents(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CancelSimulatedSystemEventsWithCallback invokes the ecs.CancelSimulatedSystemEvents API asynchronously // api document: https://help.aliyun.com/api/ecs/cancelsimulatedsystemevents.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelSimulatedSystemEventsWithCallback(request *CancelSimulatedSystemEventsRequest, callback func(response *CancelSimulatedSystemEventsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CancelSimulatedSystemEventsResponse var err error defer close(result) response, err = client.CancelSimulatedSystemEvents(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CancelSimulatedSystemEventsRequest is the request struct for api CancelSimulatedSystemEvents type CancelSimulatedSystemEventsRequest struct { *requests.RpcRequest EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CancelSimulatedSystemEventsResponse is the response struct for api CancelSimulatedSystemEvents type CancelSimulatedSystemEventsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateCancelSimulatedSystemEventsRequest creates a request to invoke CancelSimulatedSystemEvents API func CreateCancelSimulatedSystemEventsRequest() (request *CancelSimulatedSystemEventsRequest) { request = &CancelSimulatedSystemEventsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CancelSimulatedSystemEvents", "ecs", "openAPI") return } // CreateCancelSimulatedSystemEventsResponse creates a response to parse from CancelSimulatedSystemEvents response func CreateCancelSimulatedSystemEventsResponse() (response *CancelSimulatedSystemEventsResponse) { response = &CancelSimulatedSystemEventsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/cancel_task.go����������0000664�0000000�0000000�00000007154�13771713062�0031363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CancelTask invokes the ecs.CancelTask API synchronously // api document: https://help.aliyun.com/api/ecs/canceltask.html func (client *Client) CancelTask(request *CancelTaskRequest) (response *CancelTaskResponse, err error) { response = CreateCancelTaskResponse() err = client.DoAction(request, response) return } // CancelTaskWithChan invokes the ecs.CancelTask API asynchronously // api document: https://help.aliyun.com/api/ecs/canceltask.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelTaskWithChan(request *CancelTaskRequest) (<-chan *CancelTaskResponse, <-chan error) { responseChan := make(chan *CancelTaskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CancelTask(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CancelTaskWithCallback invokes the ecs.CancelTask API asynchronously // api document: https://help.aliyun.com/api/ecs/canceltask.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CancelTaskWithCallback(request *CancelTaskRequest, callback func(response *CancelTaskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CancelTaskResponse var err error defer close(result) response, err = client.CancelTask(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CancelTaskRequest is the request struct for api CancelTask type CancelTaskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` TaskId string `position:"Query" name:"TaskId"` } // CancelTaskResponse is the response struct for api CancelTask type CancelTaskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateCancelTaskRequest creates a request to invoke CancelTask API func CreateCancelTaskRequest() (request *CancelTaskRequest) { request = &CancelTaskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CancelTask", "ecs", "openAPI") return } // CreateCancelTaskResponse creates a response to parse from CancelTask response func CreateCancelTaskResponse() (response *CancelTaskResponse) { response = &CancelTaskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/client.go���������������0000664�0000000�0000000�00000006267�13771713062�0030376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" ) // Client is the sdk client struct, each func corresponds to an OpenAPI type Client struct { sdk.Client } // NewClient creates a sdk client with environment variables func NewClient() (client *Client, err error) { client = &Client{} err = client.Init() return } // NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential // this is the common api to create a sdk client func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) { client = &Client{} err = client.InitWithOptions(regionId, config, credential) return } // NewClientWithAccessKey is a shortcut to create sdk client with accesskey // usage: https://help.aliyun.com/document_detail/66217.html func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) { client = &Client{} err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret) return } // NewClientWithStsToken is a shortcut to create sdk client with sts token // usage: https://help.aliyun.com/document_detail/66222.html func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) { client = &Client{} err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken) return } // NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn // usage: https://help.aliyun.com/document_detail/66222.html func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { client = &Client{} err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) return } // NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role // usage: https://help.aliyun.com/document_detail/66223.html func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) { client = &Client{} err = client.InitWithEcsRamRole(regionId, roleName) return } // NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair // attention: rsa key pair auth is only Japan regions available func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) { client = &Client{} err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration) return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������connect_router_interface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000010127�13771713062�0034100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ConnectRouterInterface invokes the ecs.ConnectRouterInterface API synchronously // api document: https://help.aliyun.com/api/ecs/connectrouterinterface.html func (client *Client) ConnectRouterInterface(request *ConnectRouterInterfaceRequest) (response *ConnectRouterInterfaceResponse, err error) { response = CreateConnectRouterInterfaceResponse() err = client.DoAction(request, response) return } // ConnectRouterInterfaceWithChan invokes the ecs.ConnectRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/connectrouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ConnectRouterInterfaceWithChan(request *ConnectRouterInterfaceRequest) (<-chan *ConnectRouterInterfaceResponse, <-chan error) { responseChan := make(chan *ConnectRouterInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ConnectRouterInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ConnectRouterInterfaceWithCallback invokes the ecs.ConnectRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/connectrouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ConnectRouterInterfaceWithCallback(request *ConnectRouterInterfaceRequest, callback func(response *ConnectRouterInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ConnectRouterInterfaceResponse var err error defer close(result) response, err = client.ConnectRouterInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ConnectRouterInterfaceRequest is the request struct for api ConnectRouterInterface type ConnectRouterInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` } // ConnectRouterInterfaceResponse is the response struct for api ConnectRouterInterface type ConnectRouterInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateConnectRouterInterfaceRequest creates a request to invoke ConnectRouterInterface API func CreateConnectRouterInterfaceRequest() (request *ConnectRouterInterfaceRequest) { request = &ConnectRouterInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ConnectRouterInterface", "ecs", "openAPI") return } // CreateConnectRouterInterfaceResponse creates a response to parse from ConnectRouterInterface response func CreateConnectRouterInterfaceResponse() (response *ConnectRouterInterfaceResponse) { response = &ConnectRouterInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������convert_nat_public_ip_to_eip.go���������������������������������������������������������������������0000664�0000000�0000000�00000010170�13771713062�0034734�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ConvertNatPublicIpToEip invokes the ecs.ConvertNatPublicIpToEip API synchronously // api document: https://help.aliyun.com/api/ecs/convertnatpubliciptoeip.html func (client *Client) ConvertNatPublicIpToEip(request *ConvertNatPublicIpToEipRequest) (response *ConvertNatPublicIpToEipResponse, err error) { response = CreateConvertNatPublicIpToEipResponse() err = client.DoAction(request, response) return } // ConvertNatPublicIpToEipWithChan invokes the ecs.ConvertNatPublicIpToEip API asynchronously // api document: https://help.aliyun.com/api/ecs/convertnatpubliciptoeip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ConvertNatPublicIpToEipWithChan(request *ConvertNatPublicIpToEipRequest) (<-chan *ConvertNatPublicIpToEipResponse, <-chan error) { responseChan := make(chan *ConvertNatPublicIpToEipResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ConvertNatPublicIpToEip(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ConvertNatPublicIpToEipWithCallback invokes the ecs.ConvertNatPublicIpToEip API asynchronously // api document: https://help.aliyun.com/api/ecs/convertnatpubliciptoeip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ConvertNatPublicIpToEipWithCallback(request *ConvertNatPublicIpToEipRequest, callback func(response *ConvertNatPublicIpToEipResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ConvertNatPublicIpToEipResponse var err error defer close(result) response, err = client.ConvertNatPublicIpToEip(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ConvertNatPublicIpToEipRequest is the request struct for api ConvertNatPublicIpToEip type ConvertNatPublicIpToEipRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` } // ConvertNatPublicIpToEipResponse is the response struct for api ConvertNatPublicIpToEip type ConvertNatPublicIpToEipResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateConvertNatPublicIpToEipRequest creates a request to invoke ConvertNatPublicIpToEip API func CreateConvertNatPublicIpToEipRequest() (request *ConvertNatPublicIpToEipRequest) { request = &ConvertNatPublicIpToEipRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ConvertNatPublicIpToEip", "ecs", "openAPI") return } // CreateConvertNatPublicIpToEipResponse creates a response to parse from ConvertNatPublicIpToEip response func CreateConvertNatPublicIpToEipResponse() (response *ConvertNatPublicIpToEipResponse) { response = &ConvertNatPublicIpToEipResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/copy_image.go�����������0000664�0000000�0000000�00000010421�13771713062�0031217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CopyImage invokes the ecs.CopyImage API synchronously // api document: https://help.aliyun.com/api/ecs/copyimage.html func (client *Client) CopyImage(request *CopyImageRequest) (response *CopyImageResponse, err error) { response = CreateCopyImageResponse() err = client.DoAction(request, response) return } // CopyImageWithChan invokes the ecs.CopyImage API asynchronously // api document: https://help.aliyun.com/api/ecs/copyimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CopyImageWithChan(request *CopyImageRequest) (<-chan *CopyImageResponse, <-chan error) { responseChan := make(chan *CopyImageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CopyImage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CopyImageWithCallback invokes the ecs.CopyImage API asynchronously // api document: https://help.aliyun.com/api/ecs/copyimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CopyImageWithCallback(request *CopyImageRequest, callback func(response *CopyImageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CopyImageResponse var err error defer close(result) response, err = client.CopyImage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CopyImageRequest is the request struct for api CopyImage type CopyImageRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` DestinationImageName string `position:"Query" name:"DestinationImageName"` DestinationRegionId string `position:"Query" name:"DestinationRegionId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Encrypted requests.Boolean `position:"Query" name:"Encrypted"` Tag *[]CopyImageTag `position:"Query" name:"Tag" type:"Repeated"` DestinationDescription string `position:"Query" name:"DestinationDescription"` } // CopyImageTag is a repeated param struct in CopyImageRequest type CopyImageTag struct { Value string `name:"Value"` Key string `name:"Key"` } // CopyImageResponse is the response struct for api CopyImage type CopyImageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` ImageId string `json:"ImageId" xml:"ImageId"` } // CreateCopyImageRequest creates a request to invoke CopyImage API func CreateCopyImageRequest() (request *CopyImageRequest) { request = &CopyImageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CopyImage", "ecs", "openAPI") return } // CreateCopyImageResponse creates a response to parse from CopyImage response func CreateCopyImageResponse() (response *CopyImageResponse) { response = &CopyImageResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_auto_snapshot_policy.go����������������������������������������������������������������������0000664�0000000�0000000�00000011006�13771713062�0034615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateAutoSnapshotPolicy invokes the ecs.CreateAutoSnapshotPolicy API synchronously // api document: https://help.aliyun.com/api/ecs/createautosnapshotpolicy.html func (client *Client) CreateAutoSnapshotPolicy(request *CreateAutoSnapshotPolicyRequest) (response *CreateAutoSnapshotPolicyResponse, err error) { response = CreateCreateAutoSnapshotPolicyResponse() err = client.DoAction(request, response) return } // CreateAutoSnapshotPolicyWithChan invokes the ecs.CreateAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/createautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateAutoSnapshotPolicyWithChan(request *CreateAutoSnapshotPolicyRequest) (<-chan *CreateAutoSnapshotPolicyResponse, <-chan error) { responseChan := make(chan *CreateAutoSnapshotPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateAutoSnapshotPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateAutoSnapshotPolicyWithCallback invokes the ecs.CreateAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/createautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateAutoSnapshotPolicyWithCallback(request *CreateAutoSnapshotPolicyRequest, callback func(response *CreateAutoSnapshotPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateAutoSnapshotPolicyResponse var err error defer close(result) response, err = client.CreateAutoSnapshotPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateAutoSnapshotPolicyRequest is the request struct for api CreateAutoSnapshotPolicy type CreateAutoSnapshotPolicyRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` TimePoints string `position:"Query" name:"timePoints"` RetentionDays requests.Integer `position:"Query" name:"retentionDays"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` RepeatWeekdays string `position:"Query" name:"repeatWeekdays"` AutoSnapshotPolicyName string `position:"Query" name:"autoSnapshotPolicyName"` } // CreateAutoSnapshotPolicyResponse is the response struct for api CreateAutoSnapshotPolicy type CreateAutoSnapshotPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AutoSnapshotPolicyId string `json:"AutoSnapshotPolicyId" xml:"AutoSnapshotPolicyId"` } // CreateCreateAutoSnapshotPolicyRequest creates a request to invoke CreateAutoSnapshotPolicy API func CreateCreateAutoSnapshotPolicyRequest() (request *CreateAutoSnapshotPolicyRequest) { request = &CreateAutoSnapshotPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateAutoSnapshotPolicy", "ecs", "openAPI") return } // CreateCreateAutoSnapshotPolicyResponse creates a response to parse from CreateAutoSnapshotPolicy response func CreateCreateAutoSnapshotPolicyResponse() (response *CreateAutoSnapshotPolicyResponse) { response = &CreateAutoSnapshotPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_command.go�������0000664�0000000�0000000�00000010335�13771713062�0032050�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateCommand invokes the ecs.CreateCommand API synchronously // api document: https://help.aliyun.com/api/ecs/createcommand.html func (client *Client) CreateCommand(request *CreateCommandRequest) (response *CreateCommandResponse, err error) { response = CreateCreateCommandResponse() err = client.DoAction(request, response) return } // CreateCommandWithChan invokes the ecs.CreateCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/createcommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateCommandWithChan(request *CreateCommandRequest) (<-chan *CreateCommandResponse, <-chan error) { responseChan := make(chan *CreateCommandResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateCommand(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateCommandWithCallback invokes the ecs.CreateCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/createcommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateCommandWithCallback(request *CreateCommandRequest, callback func(response *CreateCommandResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateCommandResponse var err error defer close(result) response, err = client.CreateCommand(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateCommandRequest is the request struct for api CreateCommand type CreateCommandRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` WorkingDir string `position:"Query" name:"WorkingDir"` Description string `position:"Query" name:"Description"` Type string `position:"Query" name:"Type"` CommandContent string `position:"Query" name:"CommandContent"` Timeout requests.Integer `position:"Query" name:"Timeout"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Name string `position:"Query" name:"Name"` } // CreateCommandResponse is the response struct for api CreateCommand type CreateCommandResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` CommandId string `json:"CommandId" xml:"CommandId"` } // CreateCreateCommandRequest creates a request to invoke CreateCommand API func CreateCreateCommandRequest() (request *CreateCommandRequest) { request = &CreateCommandRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateCommand", "ecs", "openAPI") return } // CreateCreateCommandResponse creates a response to parse from CreateCommand response func CreateCreateCommandResponse() (response *CreateCommandResponse) { response = &CreateCommandResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_deployment_set.go0000664�0000000�0000000�00000011331�13771713062�0033462�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateDeploymentSet invokes the ecs.CreateDeploymentSet API synchronously // api document: https://help.aliyun.com/api/ecs/createdeploymentset.html func (client *Client) CreateDeploymentSet(request *CreateDeploymentSetRequest) (response *CreateDeploymentSetResponse, err error) { response = CreateCreateDeploymentSetResponse() err = client.DoAction(request, response) return } // CreateDeploymentSetWithChan invokes the ecs.CreateDeploymentSet API asynchronously // api document: https://help.aliyun.com/api/ecs/createdeploymentset.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateDeploymentSetWithChan(request *CreateDeploymentSetRequest) (<-chan *CreateDeploymentSetResponse, <-chan error) { responseChan := make(chan *CreateDeploymentSetResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateDeploymentSet(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateDeploymentSetWithCallback invokes the ecs.CreateDeploymentSet API asynchronously // api document: https://help.aliyun.com/api/ecs/createdeploymentset.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateDeploymentSetWithCallback(request *CreateDeploymentSetRequest, callback func(response *CreateDeploymentSetResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateDeploymentSetResponse var err error defer close(result) response, err = client.CreateDeploymentSet(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateDeploymentSetRequest is the request struct for api CreateDeploymentSet type CreateDeploymentSetRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` DeploymentSetName string `position:"Query" name:"DeploymentSetName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` OnUnableToRedeployFailedInstance string `position:"Query" name:"OnUnableToRedeployFailedInstance"` Granularity string `position:"Query" name:"Granularity"` Domain string `position:"Query" name:"Domain"` Strategy string `position:"Query" name:"Strategy"` } // CreateDeploymentSetResponse is the response struct for api CreateDeploymentSet type CreateDeploymentSetResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` DeploymentSetId string `json:"DeploymentSetId" xml:"DeploymentSetId"` } // CreateCreateDeploymentSetRequest creates a request to invoke CreateDeploymentSet API func CreateCreateDeploymentSetRequest() (request *CreateDeploymentSetRequest) { request = &CreateDeploymentSetRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateDeploymentSet", "ecs", "openAPI") return } // CreateCreateDeploymentSetResponse creates a response to parse from CreateDeploymentSet response func CreateCreateDeploymentSetResponse() (response *CreateDeploymentSetResponse) { response = &CreateDeploymentSetResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_disk.go����������0000664�0000000�0000000�00000012005�13771713062�0031360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateDisk invokes the ecs.CreateDisk API synchronously // api document: https://help.aliyun.com/api/ecs/createdisk.html func (client *Client) CreateDisk(request *CreateDiskRequest) (response *CreateDiskResponse, err error) { response = CreateCreateDiskResponse() err = client.DoAction(request, response) return } // CreateDiskWithChan invokes the ecs.CreateDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/createdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateDiskWithChan(request *CreateDiskRequest) (<-chan *CreateDiskResponse, <-chan error) { responseChan := make(chan *CreateDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateDiskWithCallback invokes the ecs.CreateDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/createdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateDiskWithCallback(request *CreateDiskRequest, callback func(response *CreateDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateDiskResponse var err error defer close(result) response, err = client.CreateDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateDiskRequest is the request struct for api CreateDisk type CreateDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotId string `position:"Query" name:"SnapshotId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DiskName string `position:"Query" name:"DiskName"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` Size requests.Integer `position:"Query" name:"Size"` Encrypted requests.Boolean `position:"Query" name:"Encrypted"` DiskCategory string `position:"Query" name:"DiskCategory"` ZoneId string `position:"Query" name:"ZoneId"` Tag *[]CreateDiskTag `position:"Query" name:"Tag" type:"Repeated"` Arn *[]CreateDiskArn `position:"Query" name:"Arn" type:"Repeated"` KMSKeyId string `position:"Query" name:"KMSKeyId"` AdvancedFeatures string `position:"Query" name:"AdvancedFeatures"` } // CreateDiskTag is a repeated param struct in CreateDiskRequest type CreateDiskTag struct { Value string `name:"Value"` Key string `name:"Key"` } // CreateDiskArn is a repeated param struct in CreateDiskRequest type CreateDiskArn struct { Rolearn string `name:"Rolearn"` RoleType string `name:"RoleType"` AssumeRoleFor string `name:"AssumeRoleFor"` } // CreateDiskResponse is the response struct for api CreateDisk type CreateDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` DiskId string `json:"DiskId" xml:"DiskId"` } // CreateCreateDiskRequest creates a request to invoke CreateDisk API func CreateCreateDiskRequest() (request *CreateDiskRequest) { request = &CreateDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateDisk", "ecs", "openAPI") return } // CreateCreateDiskResponse creates a response to parse from CreateDisk response func CreateCreateDiskResponse() (response *CreateDiskResponse) { response = &CreateDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_forward_entry.go�0000664�0000000�0000000�00000010713�13771713062�0033317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateForwardEntry invokes the ecs.CreateForwardEntry API synchronously // api document: https://help.aliyun.com/api/ecs/createforwardentry.html func (client *Client) CreateForwardEntry(request *CreateForwardEntryRequest) (response *CreateForwardEntryResponse, err error) { response = CreateCreateForwardEntryResponse() err = client.DoAction(request, response) return } // CreateForwardEntryWithChan invokes the ecs.CreateForwardEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/createforwardentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateForwardEntryWithChan(request *CreateForwardEntryRequest) (<-chan *CreateForwardEntryResponse, <-chan error) { responseChan := make(chan *CreateForwardEntryResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateForwardEntry(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateForwardEntryWithCallback invokes the ecs.CreateForwardEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/createforwardentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateForwardEntryWithCallback(request *CreateForwardEntryRequest, callback func(response *CreateForwardEntryResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateForwardEntryResponse var err error defer close(result) response, err = client.CreateForwardEntry(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateForwardEntryRequest is the request struct for api CreateForwardEntry type CreateForwardEntryRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` InternalPort string `position:"Query" name:"InternalPort"` OwnerAccount string `position:"Query" name:"OwnerAccount"` ForwardTableId string `position:"Query" name:"ForwardTableId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ExternalIp string `position:"Query" name:"ExternalIp"` ExternalPort string `position:"Query" name:"ExternalPort"` InternalIp string `position:"Query" name:"InternalIp"` } // CreateForwardEntryResponse is the response struct for api CreateForwardEntry type CreateForwardEntryResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` ForwardEntryId string `json:"ForwardEntryId" xml:"ForwardEntryId"` } // CreateCreateForwardEntryRequest creates a request to invoke CreateForwardEntry API func CreateCreateForwardEntryRequest() (request *CreateForwardEntryRequest) { request = &CreateForwardEntryRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateForwardEntry", "ecs", "openAPI") return } // CreateCreateForwardEntryResponse creates a response to parse from CreateForwardEntry response func CreateCreateForwardEntryResponse() (response *CreateForwardEntryResponse) { response = &CreateForwardEntryResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_ha_vip.go��������0000664�0000000�0000000�00000007773�13771713062�0031714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateHaVip invokes the ecs.CreateHaVip API synchronously // api document: https://help.aliyun.com/api/ecs/createhavip.html func (client *Client) CreateHaVip(request *CreateHaVipRequest) (response *CreateHaVipResponse, err error) { response = CreateCreateHaVipResponse() err = client.DoAction(request, response) return } // CreateHaVipWithChan invokes the ecs.CreateHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/createhavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateHaVipWithChan(request *CreateHaVipRequest) (<-chan *CreateHaVipResponse, <-chan error) { responseChan := make(chan *CreateHaVipResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateHaVip(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateHaVipWithCallback invokes the ecs.CreateHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/createhavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateHaVipWithCallback(request *CreateHaVipRequest, callback func(response *CreateHaVipResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateHaVipResponse var err error defer close(result) response, err = client.CreateHaVip(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateHaVipRequest is the request struct for api CreateHaVip type CreateHaVipRequest struct { *requests.RpcRequest VSwitchId string `position:"Query" name:"VSwitchId"` IpAddress string `position:"Query" name:"IpAddress"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CreateHaVipResponse is the response struct for api CreateHaVip type CreateHaVipResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` HaVipId string `json:"HaVipId" xml:"HaVipId"` } // CreateCreateHaVipRequest creates a request to invoke CreateHaVip API func CreateCreateHaVipRequest() (request *CreateHaVipRequest) { request = &CreateHaVipRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateHaVip", "ecs", "openAPI") return } // CreateCreateHaVipResponse creates a response to parse from CreateHaVip response func CreateCreateHaVipResponse() (response *CreateHaVipResponse) { response = &CreateHaVipResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_hpc_cluster.go���0000664�0000000�0000000�00000010203�13771713062�0032737�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateHpcCluster invokes the ecs.CreateHpcCluster API synchronously // api document: https://help.aliyun.com/api/ecs/createhpccluster.html func (client *Client) CreateHpcCluster(request *CreateHpcClusterRequest) (response *CreateHpcClusterResponse, err error) { response = CreateCreateHpcClusterResponse() err = client.DoAction(request, response) return } // CreateHpcClusterWithChan invokes the ecs.CreateHpcCluster API asynchronously // api document: https://help.aliyun.com/api/ecs/createhpccluster.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateHpcClusterWithChan(request *CreateHpcClusterRequest) (<-chan *CreateHpcClusterResponse, <-chan error) { responseChan := make(chan *CreateHpcClusterResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateHpcCluster(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateHpcClusterWithCallback invokes the ecs.CreateHpcCluster API asynchronously // api document: https://help.aliyun.com/api/ecs/createhpccluster.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateHpcClusterWithCallback(request *CreateHpcClusterRequest, callback func(response *CreateHpcClusterResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateHpcClusterResponse var err error defer close(result) response, err = client.CreateHpcCluster(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateHpcClusterRequest is the request struct for api CreateHpcCluster type CreateHpcClusterRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ClientToken string `position:"Query" name:"ClientToken"` Description string `position:"Query" name:"Description"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Name string `position:"Query" name:"Name"` } // CreateHpcClusterResponse is the response struct for api CreateHpcCluster type CreateHpcClusterResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` HpcClusterId string `json:"HpcClusterId" xml:"HpcClusterId"` } // CreateCreateHpcClusterRequest creates a request to invoke CreateHpcCluster API func CreateCreateHpcClusterRequest() (request *CreateHpcClusterRequest) { request = &CreateHpcClusterRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateHpcCluster", "ecs", "openAPI") return } // CreateCreateHpcClusterResponse creates a response to parse from CreateHpcCluster response func CreateCreateHpcClusterResponse() (response *CreateHpcClusterResponse) { response = &CreateHpcClusterResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_image.go���������0000664�0000000�0000000�00000012304�13771713062�0031512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateImage invokes the ecs.CreateImage API synchronously // api document: https://help.aliyun.com/api/ecs/createimage.html func (client *Client) CreateImage(request *CreateImageRequest) (response *CreateImageResponse, err error) { response = CreateCreateImageResponse() err = client.DoAction(request, response) return } // CreateImageWithChan invokes the ecs.CreateImage API asynchronously // api document: https://help.aliyun.com/api/ecs/createimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateImageWithChan(request *CreateImageRequest) (<-chan *CreateImageResponse, <-chan error) { responseChan := make(chan *CreateImageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateImage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateImageWithCallback invokes the ecs.CreateImage API asynchronously // api document: https://help.aliyun.com/api/ecs/createimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateImageWithCallback(request *CreateImageRequest, callback func(response *CreateImageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateImageResponse var err error defer close(result) response, err = client.CreateImage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateImageRequest is the request struct for api CreateImage type CreateImageRequest struct { *requests.RpcRequest DiskDeviceMapping *[]CreateImageDiskDeviceMapping `position:"Query" name:"DiskDeviceMapping" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotId string `position:"Query" name:"SnapshotId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Platform string `position:"Query" name:"Platform"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` InstanceId string `position:"Query" name:"InstanceId"` ImageName string `position:"Query" name:"ImageName"` ImageVersion string `position:"Query" name:"ImageVersion"` Tag *[]CreateImageTag `position:"Query" name:"Tag" type:"Repeated"` Architecture string `position:"Query" name:"Architecture"` } // CreateImageDiskDeviceMapping is a repeated param struct in CreateImageRequest type CreateImageDiskDeviceMapping struct { SnapshotId string `name:"SnapshotId"` Size string `name:"Size"` DiskType string `name:"DiskType"` Device string `name:"Device"` } // CreateImageTag is a repeated param struct in CreateImageRequest type CreateImageTag struct { Value string `name:"Value"` Key string `name:"Key"` } // CreateImageResponse is the response struct for api CreateImage type CreateImageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` ImageId string `json:"ImageId" xml:"ImageId"` } // CreateCreateImageRequest creates a request to invoke CreateImage API func CreateCreateImageRequest() (request *CreateImageRequest) { request = &CreateImageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateImage", "ecs", "openAPI") return } // CreateCreateImageResponse creates a response to parse from CreateImage response func CreateCreateImageResponse() (response *CreateImageResponse) { response = &CreateImageResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_instance.go������0000664�0000000�0000000�00000023034�13771713062�0032236�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateInstance invokes the ecs.CreateInstance API synchronously // api document: https://help.aliyun.com/api/ecs/createinstance.html func (client *Client) CreateInstance(request *CreateInstanceRequest) (response *CreateInstanceResponse, err error) { response = CreateCreateInstanceResponse() err = client.DoAction(request, response) return } // CreateInstanceWithChan invokes the ecs.CreateInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/createinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateInstanceWithChan(request *CreateInstanceRequest) (<-chan *CreateInstanceResponse, <-chan error) { responseChan := make(chan *CreateInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateInstanceWithCallback invokes the ecs.CreateInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/createinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateInstanceWithCallback(request *CreateInstanceRequest, callback func(response *CreateInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateInstanceResponse var err error defer close(result) response, err = client.CreateInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateInstanceRequest is the request struct for api CreateInstance type CreateInstanceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` HpcClusterId string `position:"Query" name:"HpcClusterId"` SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` KeyPairName string `position:"Query" name:"KeyPairName"` SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` DeletionProtection requests.Boolean `position:"Query" name:"DeletionProtection"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` HostName string `position:"Query" name:"HostName"` Password string `position:"Query" name:"Password"` Tag *[]CreateInstanceTag `position:"Query" name:"Tag" type:"Repeated"` AutoRenewPeriod requests.Integer `position:"Query" name:"AutoRenewPeriod"` NodeControllerId string `position:"Query" name:"NodeControllerId"` Period requests.Integer `position:"Query" name:"Period"` DryRun requests.Boolean `position:"Query" name:"DryRun"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` CapacityReservationPreference string `position:"Query" name:"CapacityReservationPreference"` VSwitchId string `position:"Query" name:"VSwitchId"` PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` SpotStrategy string `position:"Query" name:"SpotStrategy"` PeriodUnit string `position:"Query" name:"PeriodUnit"` InstanceName string `position:"Query" name:"InstanceName"` AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` InternetChargeType string `position:"Query" name:"InternetChargeType"` ZoneId string `position:"Query" name:"ZoneId"` InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` UseAdditionalService requests.Boolean `position:"Query" name:"UseAdditionalService"` ImageId string `position:"Query" name:"ImageId"` ClientToken string `position:"Query" name:"ClientToken"` VlanId string `position:"Query" name:"VlanId"` SpotInterruptionBehavior string `position:"Query" name:"SpotInterruptionBehavior"` IoOptimized string `position:"Query" name:"IoOptimized"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` Description string `position:"Query" name:"Description"` SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` CapacityReservationId string `position:"Query" name:"CapacityReservationId"` UserData string `position:"Query" name:"UserData"` PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` InstanceType string `position:"Query" name:"InstanceType"` Arn *[]CreateInstanceArn `position:"Query" name:"Arn" type:"Repeated"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` DeploymentSetId string `position:"Query" name:"DeploymentSetId"` InnerIpAddress string `position:"Query" name:"InnerIpAddress"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SystemDiskDiskName string `position:"Query" name:"SystemDisk.DiskName"` RamRoleName string `position:"Query" name:"RamRoleName"` DedicatedHostId string `position:"Query" name:"DedicatedHostId"` ClusterId string `position:"Query" name:"ClusterId"` CreditSpecification string `position:"Query" name:"CreditSpecification"` DataDisk *[]CreateInstanceDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` } // CreateInstanceTag is a repeated param struct in CreateInstanceRequest type CreateInstanceTag struct { Value string `name:"Value"` Key string `name:"Key"` } // CreateInstanceArn is a repeated param struct in CreateInstanceRequest type CreateInstanceArn struct { Rolearn string `name:"Rolearn"` RoleType string `name:"RoleType"` AssumeRoleFor string `name:"AssumeRoleFor"` } // CreateInstanceDataDisk is a repeated param struct in CreateInstanceRequest type CreateInstanceDataDisk struct { DiskName string `name:"DiskName"` SnapshotId string `name:"SnapshotId"` Size string `name:"Size"` Encrypted string `name:"Encrypted"` Description string `name:"Description"` Category string `name:"Category"` KMSKeyId string `name:"KMSKeyId"` Device string `name:"Device"` DeleteWithInstance string `name:"DeleteWithInstance"` } // CreateInstanceResponse is the response struct for api CreateInstance type CreateInstanceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` } // CreateCreateInstanceRequest creates a request to invoke CreateInstance API func CreateCreateInstanceRequest() (request *CreateInstanceRequest) { request = &CreateInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateInstance", "ecs", "openAPI") return } // CreateCreateInstanceResponse creates a response to parse from CreateInstance response func CreateCreateInstanceResponse() (response *CreateInstanceResponse) { response = &CreateInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_key_pair.go������0000664�0000000�0000000�00000010544�13771713062�0032237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateKeyPair invokes the ecs.CreateKeyPair API synchronously // api document: https://help.aliyun.com/api/ecs/createkeypair.html func (client *Client) CreateKeyPair(request *CreateKeyPairRequest) (response *CreateKeyPairResponse, err error) { response = CreateCreateKeyPairResponse() err = client.DoAction(request, response) return } // CreateKeyPairWithChan invokes the ecs.CreateKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/createkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateKeyPairWithChan(request *CreateKeyPairRequest) (<-chan *CreateKeyPairResponse, <-chan error) { responseChan := make(chan *CreateKeyPairResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateKeyPair(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateKeyPairWithCallback invokes the ecs.CreateKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/createkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateKeyPairWithCallback(request *CreateKeyPairRequest, callback func(response *CreateKeyPairResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateKeyPairResponse var err error defer close(result) response, err = client.CreateKeyPair(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateKeyPairRequest is the request struct for api CreateKeyPair type CreateKeyPairRequest struct { *requests.RpcRequest ResourceGroupId string `position:"Query" name:"ResourceGroupId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` KeyPairName string `position:"Query" name:"KeyPairName"` Tag *[]CreateKeyPairTag `position:"Query" name:"Tag" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CreateKeyPairTag is a repeated param struct in CreateKeyPairRequest type CreateKeyPairTag struct { Value string `name:"Value"` Key string `name:"Key"` } // CreateKeyPairResponse is the response struct for api CreateKeyPair type CreateKeyPairResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` KeyPairId string `json:"KeyPairId" xml:"KeyPairId"` KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` KeyPairFingerPrint string `json:"KeyPairFingerPrint" xml:"KeyPairFingerPrint"` PrivateKeyBody string `json:"PrivateKeyBody" xml:"PrivateKeyBody"` } // CreateCreateKeyPairRequest creates a request to invoke CreateKeyPair API func CreateCreateKeyPairRequest() (request *CreateKeyPairRequest) { request = &CreateKeyPairRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateKeyPair", "ecs", "openAPI") return } // CreateCreateKeyPairResponse creates a response to parse from CreateKeyPair response func CreateCreateKeyPairResponse() (response *CreateKeyPairResponse) { response = &CreateKeyPairResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������create_launch_template.go���������������������������������������������������������������������������0000664�0000000�0000000�00000023517�13771713062�0033526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateLaunchTemplate invokes the ecs.CreateLaunchTemplate API synchronously // api document: https://help.aliyun.com/api/ecs/createlaunchtemplate.html func (client *Client) CreateLaunchTemplate(request *CreateLaunchTemplateRequest) (response *CreateLaunchTemplateResponse, err error) { response = CreateCreateLaunchTemplateResponse() err = client.DoAction(request, response) return } // CreateLaunchTemplateWithChan invokes the ecs.CreateLaunchTemplate API asynchronously // api document: https://help.aliyun.com/api/ecs/createlaunchtemplate.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateLaunchTemplateWithChan(request *CreateLaunchTemplateRequest) (<-chan *CreateLaunchTemplateResponse, <-chan error) { responseChan := make(chan *CreateLaunchTemplateResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateLaunchTemplate(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateLaunchTemplateWithCallback invokes the ecs.CreateLaunchTemplate API asynchronously // api document: https://help.aliyun.com/api/ecs/createlaunchtemplate.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateLaunchTemplateWithCallback(request *CreateLaunchTemplateRequest, callback func(response *CreateLaunchTemplateResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateLaunchTemplateResponse var err error defer close(result) response, err = client.CreateLaunchTemplate(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateLaunchTemplateRequest is the request struct for api CreateLaunchTemplate type CreateLaunchTemplateRequest struct { *requests.RpcRequest LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` NetworkType string `position:"Query" name:"NetworkType"` KeyPairName string `position:"Query" name:"KeyPairName"` SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` ImageOwnerAlias string `position:"Query" name:"ImageOwnerAlias"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` HostName string `position:"Query" name:"HostName"` SystemDiskIops requests.Integer `position:"Query" name:"SystemDisk.Iops"` TemplateTag *[]CreateLaunchTemplateTemplateTag `position:"Query" name:"TemplateTag" type:"Repeated"` Tag *[]CreateLaunchTemplateTag `position:"Query" name:"Tag" type:"Repeated"` Period requests.Integer `position:"Query" name:"Period"` TemplateResourceGroupId string `position:"Query" name:"TemplateResourceGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` VSwitchId string `position:"Query" name:"VSwitchId"` SpotStrategy string `position:"Query" name:"SpotStrategy"` InstanceName string `position:"Query" name:"InstanceName"` InternetChargeType string `position:"Query" name:"InternetChargeType"` ZoneId string `position:"Query" name:"ZoneId"` InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` VersionDescription string `position:"Query" name:"VersionDescription"` ImageId string `position:"Query" name:"ImageId"` IoOptimized string `position:"Query" name:"IoOptimized"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` Description string `position:"Query" name:"Description"` SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` UserData string `position:"Query" name:"UserData"` PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` InstanceType string `position:"Query" name:"InstanceType"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` EnableVmOsConfig requests.Boolean `position:"Query" name:"EnableVmOsConfig"` NetworkInterface *[]CreateLaunchTemplateNetworkInterface `position:"Query" name:"NetworkInterface" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SystemDiskDiskName string `position:"Query" name:"SystemDisk.DiskName"` RamRoleName string `position:"Query" name:"RamRoleName"` AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` SpotDuration requests.Integer `position:"Query" name:"SpotDuration"` DataDisk *[]CreateLaunchTemplateDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` VpcId string `position:"Query" name:"VpcId"` SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` } // CreateLaunchTemplateTemplateTag is a repeated param struct in CreateLaunchTemplateRequest type CreateLaunchTemplateTemplateTag struct { Key string `name:"Key"` Value string `name:"Value"` } // CreateLaunchTemplateTag is a repeated param struct in CreateLaunchTemplateRequest type CreateLaunchTemplateTag struct { Key string `name:"Key"` Value string `name:"Value"` } // CreateLaunchTemplateNetworkInterface is a repeated param struct in CreateLaunchTemplateRequest type CreateLaunchTemplateNetworkInterface struct { PrimaryIpAddress string `name:"PrimaryIpAddress"` VSwitchId string `name:"VSwitchId"` SecurityGroupId string `name:"SecurityGroupId"` NetworkInterfaceName string `name:"NetworkInterfaceName"` Description string `name:"Description"` } // CreateLaunchTemplateDataDisk is a repeated param struct in CreateLaunchTemplateRequest type CreateLaunchTemplateDataDisk struct { Size string `name:"Size"` SnapshotId string `name:"SnapshotId"` Category string `name:"Category"` Encrypted string `name:"Encrypted"` DiskName string `name:"DiskName"` Description string `name:"Description"` DeleteWithInstance string `name:"DeleteWithInstance"` Device string `name:"Device"` } // CreateLaunchTemplateResponse is the response struct for api CreateLaunchTemplate type CreateLaunchTemplateResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` LaunchTemplateId string `json:"LaunchTemplateId" xml:"LaunchTemplateId"` } // CreateCreateLaunchTemplateRequest creates a request to invoke CreateLaunchTemplate API func CreateCreateLaunchTemplateRequest() (request *CreateLaunchTemplateRequest) { request = &CreateLaunchTemplateRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateLaunchTemplate", "ecs", "openAPI") return } // CreateCreateLaunchTemplateResponse creates a response to parse from CreateLaunchTemplate response func CreateCreateLaunchTemplateResponse() (response *CreateLaunchTemplateResponse) { response = &CreateLaunchTemplateResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_launch_template_version.go�������������������������������������������������������������������0000664�0000000�0000000�00000024266�13771713062�0035275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateLaunchTemplateVersion invokes the ecs.CreateLaunchTemplateVersion API synchronously // api document: https://help.aliyun.com/api/ecs/createlaunchtemplateversion.html func (client *Client) CreateLaunchTemplateVersion(request *CreateLaunchTemplateVersionRequest) (response *CreateLaunchTemplateVersionResponse, err error) { response = CreateCreateLaunchTemplateVersionResponse() err = client.DoAction(request, response) return } // CreateLaunchTemplateVersionWithChan invokes the ecs.CreateLaunchTemplateVersion API asynchronously // api document: https://help.aliyun.com/api/ecs/createlaunchtemplateversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateLaunchTemplateVersionWithChan(request *CreateLaunchTemplateVersionRequest) (<-chan *CreateLaunchTemplateVersionResponse, <-chan error) { responseChan := make(chan *CreateLaunchTemplateVersionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateLaunchTemplateVersion(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateLaunchTemplateVersionWithCallback invokes the ecs.CreateLaunchTemplateVersion API asynchronously // api document: https://help.aliyun.com/api/ecs/createlaunchtemplateversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateLaunchTemplateVersionWithCallback(request *CreateLaunchTemplateVersionRequest, callback func(response *CreateLaunchTemplateVersionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateLaunchTemplateVersionResponse var err error defer close(result) response, err = client.CreateLaunchTemplateVersion(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateLaunchTemplateVersionRequest is the request struct for api CreateLaunchTemplateVersion type CreateLaunchTemplateVersionRequest struct { *requests.RpcRequest LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` NetworkType string `position:"Query" name:"NetworkType"` KeyPairName string `position:"Query" name:"KeyPairName"` SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` ImageOwnerAlias string `position:"Query" name:"ImageOwnerAlias"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` HostName string `position:"Query" name:"HostName"` SystemDiskIops requests.Integer `position:"Query" name:"SystemDisk.Iops"` Tag *[]CreateLaunchTemplateVersionTag `position:"Query" name:"Tag" type:"Repeated"` Period requests.Integer `position:"Query" name:"Period"` LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` VSwitchId string `position:"Query" name:"VSwitchId"` SpotStrategy string `position:"Query" name:"SpotStrategy"` InstanceName string `position:"Query" name:"InstanceName"` InternetChargeType string `position:"Query" name:"InternetChargeType"` ZoneId string `position:"Query" name:"ZoneId"` InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` VersionDescription string `position:"Query" name:"VersionDescription"` ImageId string `position:"Query" name:"ImageId"` IoOptimized string `position:"Query" name:"IoOptimized"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` Description string `position:"Query" name:"Description"` SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` UserData string `position:"Query" name:"UserData"` PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` InstanceType string `position:"Query" name:"InstanceType"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` EnableVmOsConfig requests.Boolean `position:"Query" name:"EnableVmOsConfig"` NetworkInterface *[]CreateLaunchTemplateVersionNetworkInterface `position:"Query" name:"NetworkInterface" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SystemDiskDiskName string `position:"Query" name:"SystemDisk.DiskName"` RamRoleName string `position:"Query" name:"RamRoleName"` AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` SpotDuration requests.Integer `position:"Query" name:"SpotDuration"` DataDisk *[]CreateLaunchTemplateVersionDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` VpcId string `position:"Query" name:"VpcId"` SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` } // CreateLaunchTemplateVersionTag is a repeated param struct in CreateLaunchTemplateVersionRequest type CreateLaunchTemplateVersionTag struct { Key string `name:"Key"` Value string `name:"Value"` } // CreateLaunchTemplateVersionNetworkInterface is a repeated param struct in CreateLaunchTemplateVersionRequest type CreateLaunchTemplateVersionNetworkInterface struct { PrimaryIpAddress string `name:"PrimaryIpAddress"` VSwitchId string `name:"VSwitchId"` SecurityGroupId string `name:"SecurityGroupId"` NetworkInterfaceName string `name:"NetworkInterfaceName"` Description string `name:"Description"` } // CreateLaunchTemplateVersionDataDisk is a repeated param struct in CreateLaunchTemplateVersionRequest type CreateLaunchTemplateVersionDataDisk struct { Size string `name:"Size"` SnapshotId string `name:"SnapshotId"` Category string `name:"Category"` Encrypted string `name:"Encrypted"` DiskName string `name:"DiskName"` Description string `name:"Description"` DeleteWithInstance string `name:"DeleteWithInstance"` Device string `name:"Device"` } // CreateLaunchTemplateVersionResponse is the response struct for api CreateLaunchTemplateVersion type CreateLaunchTemplateVersionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` LaunchTemplateVersionNumber int `json:"LaunchTemplateVersionNumber" xml:"LaunchTemplateVersionNumber"` } // CreateCreateLaunchTemplateVersionRequest creates a request to invoke CreateLaunchTemplateVersion API func CreateCreateLaunchTemplateVersionRequest() (request *CreateLaunchTemplateVersionRequest) { request = &CreateLaunchTemplateVersionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateLaunchTemplateVersion", "ecs", "openAPI") return } // CreateCreateLaunchTemplateVersionResponse creates a response to parse from CreateLaunchTemplateVersion response func CreateCreateLaunchTemplateVersionResponse() (response *CreateLaunchTemplateVersionResponse) { response = &CreateLaunchTemplateVersionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_nat_gateway.go���0000664�0000000�0000000�00000011764�13771713062�0032744�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateNatGateway invokes the ecs.CreateNatGateway API synchronously // api document: https://help.aliyun.com/api/ecs/createnatgateway.html func (client *Client) CreateNatGateway(request *CreateNatGatewayRequest) (response *CreateNatGatewayResponse, err error) { response = CreateCreateNatGatewayResponse() err = client.DoAction(request, response) return } // CreateNatGatewayWithChan invokes the ecs.CreateNatGateway API asynchronously // api document: https://help.aliyun.com/api/ecs/createnatgateway.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateNatGatewayWithChan(request *CreateNatGatewayRequest) (<-chan *CreateNatGatewayResponse, <-chan error) { responseChan := make(chan *CreateNatGatewayResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateNatGateway(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateNatGatewayWithCallback invokes the ecs.CreateNatGateway API asynchronously // api document: https://help.aliyun.com/api/ecs/createnatgateway.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateNatGatewayWithCallback(request *CreateNatGatewayRequest, callback func(response *CreateNatGatewayResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateNatGatewayResponse var err error defer close(result) response, err = client.CreateNatGateway(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateNatGatewayRequest is the request struct for api CreateNatGateway type CreateNatGatewayRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` VpcId string `position:"Query" name:"VpcId"` Name string `position:"Query" name:"Name"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` BandwidthPackage *[]CreateNatGatewayBandwidthPackage `position:"Query" name:"BandwidthPackage" type:"Repeated"` } // CreateNatGatewayBandwidthPackage is a repeated param struct in CreateNatGatewayRequest type CreateNatGatewayBandwidthPackage struct { Bandwidth string `name:"Bandwidth"` Zone string `name:"Zone"` IpCount string `name:"IpCount"` } // CreateNatGatewayResponse is the response struct for api CreateNatGateway type CreateNatGatewayResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` ForwardTableIds ForwardTableIdsInCreateNatGateway `json:"ForwardTableIds" xml:"ForwardTableIds"` BandwidthPackageIds BandwidthPackageIdsInCreateNatGateway `json:"BandwidthPackageIds" xml:"BandwidthPackageIds"` } // CreateCreateNatGatewayRequest creates a request to invoke CreateNatGateway API func CreateCreateNatGatewayRequest() (request *CreateNatGatewayRequest) { request = &CreateNatGatewayRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateNatGateway", "ecs", "openAPI") return } // CreateCreateNatGatewayResponse creates a response to parse from CreateNatGateway response func CreateCreateNatGatewayResponse() (response *CreateNatGatewayResponse) { response = &CreateNatGatewayResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������create_network_interface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000012453�13771713062�0034067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateNetworkInterface invokes the ecs.CreateNetworkInterface API synchronously // api document: https://help.aliyun.com/api/ecs/createnetworkinterface.html func (client *Client) CreateNetworkInterface(request *CreateNetworkInterfaceRequest) (response *CreateNetworkInterfaceResponse, err error) { response = CreateCreateNetworkInterfaceResponse() err = client.DoAction(request, response) return } // CreateNetworkInterfaceWithChan invokes the ecs.CreateNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/createnetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateNetworkInterfaceWithChan(request *CreateNetworkInterfaceRequest) (<-chan *CreateNetworkInterfaceResponse, <-chan error) { responseChan := make(chan *CreateNetworkInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateNetworkInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateNetworkInterfaceWithCallback invokes the ecs.CreateNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/createnetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateNetworkInterfaceWithCallback(request *CreateNetworkInterfaceRequest, callback func(response *CreateNetworkInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateNetworkInterfaceResponse var err error defer close(result) response, err = client.CreateNetworkInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateNetworkInterfaceRequest is the request struct for api CreateNetworkInterface type CreateNetworkInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ClientToken string `position:"Query" name:"ClientToken"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` BusinessType string `position:"Query" name:"BusinessType"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` Tag *[]CreateNetworkInterfaceTag `position:"Query" name:"Tag" type:"Repeated"` NetworkInterfaceName string `position:"Query" name:"NetworkInterfaceName"` Visible requests.Boolean `position:"Query" name:"Visible"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` VSwitchId string `position:"Query" name:"VSwitchId"` PrimaryIpAddress string `position:"Query" name:"PrimaryIpAddress"` } // CreateNetworkInterfaceTag is a repeated param struct in CreateNetworkInterfaceRequest type CreateNetworkInterfaceTag struct { Key string `name:"Key"` Value string `name:"Value"` } // CreateNetworkInterfaceResponse is the response struct for api CreateNetworkInterface type CreateNetworkInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` } // CreateCreateNetworkInterfaceRequest creates a request to invoke CreateNetworkInterface API func CreateCreateNetworkInterfaceRequest() (request *CreateNetworkInterfaceRequest) { request = &CreateNetworkInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateNetworkInterface", "ecs", "openAPI") return } // CreateCreateNetworkInterfaceResponse creates a response to parse from CreateNetworkInterface response func CreateCreateNetworkInterfaceResponse() (response *CreateNetworkInterfaceResponse) { response = &CreateNetworkInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_network_interface_permission.go��������������������������������������������������������������0000664�0000000�0000000�00000011556�13771713062�0036342�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateNetworkInterfacePermission invokes the ecs.CreateNetworkInterfacePermission API synchronously // api document: https://help.aliyun.com/api/ecs/createnetworkinterfacepermission.html func (client *Client) CreateNetworkInterfacePermission(request *CreateNetworkInterfacePermissionRequest) (response *CreateNetworkInterfacePermissionResponse, err error) { response = CreateCreateNetworkInterfacePermissionResponse() err = client.DoAction(request, response) return } // CreateNetworkInterfacePermissionWithChan invokes the ecs.CreateNetworkInterfacePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/createnetworkinterfacepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateNetworkInterfacePermissionWithChan(request *CreateNetworkInterfacePermissionRequest) (<-chan *CreateNetworkInterfacePermissionResponse, <-chan error) { responseChan := make(chan *CreateNetworkInterfacePermissionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateNetworkInterfacePermission(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateNetworkInterfacePermissionWithCallback invokes the ecs.CreateNetworkInterfacePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/createnetworkinterfacepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateNetworkInterfacePermissionWithCallback(request *CreateNetworkInterfacePermissionRequest, callback func(response *CreateNetworkInterfacePermissionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateNetworkInterfacePermissionResponse var err error defer close(result) response, err = client.CreateNetworkInterfacePermission(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateNetworkInterfacePermissionRequest is the request struct for api CreateNetworkInterfacePermission type CreateNetworkInterfacePermissionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` AccountId requests.Integer `position:"Query" name:"AccountId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Permission string `position:"Query" name:"Permission"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // CreateNetworkInterfacePermissionResponse is the response struct for api CreateNetworkInterfacePermission type CreateNetworkInterfacePermissionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` NetworkInterfacePermission NetworkInterfacePermission `json:"NetworkInterfacePermission" xml:"NetworkInterfacePermission"` } // CreateCreateNetworkInterfacePermissionRequest creates a request to invoke CreateNetworkInterfacePermission API func CreateCreateNetworkInterfacePermissionRequest() (request *CreateNetworkInterfacePermissionRequest) { request = &CreateNetworkInterfacePermissionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateNetworkInterfacePermission", "ecs", "openAPI") return } // CreateCreateNetworkInterfacePermissionResponse creates a response to parse from CreateNetworkInterfacePermission response func CreateCreateNetworkInterfacePermissionResponse() (response *CreateNetworkInterfacePermissionResponse) { response = &CreateNetworkInterfacePermissionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������create_physical_connection.go�����������������������������������������������������������������������0000664�0000000�0000000�00000012457�13771713062�0034415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreatePhysicalConnection invokes the ecs.CreatePhysicalConnection API synchronously // api document: https://help.aliyun.com/api/ecs/createphysicalconnection.html func (client *Client) CreatePhysicalConnection(request *CreatePhysicalConnectionRequest) (response *CreatePhysicalConnectionResponse, err error) { response = CreateCreatePhysicalConnectionResponse() err = client.DoAction(request, response) return } // CreatePhysicalConnectionWithChan invokes the ecs.CreatePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/createphysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreatePhysicalConnectionWithChan(request *CreatePhysicalConnectionRequest) (<-chan *CreatePhysicalConnectionResponse, <-chan error) { responseChan := make(chan *CreatePhysicalConnectionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreatePhysicalConnection(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreatePhysicalConnectionWithCallback invokes the ecs.CreatePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/createphysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreatePhysicalConnectionWithCallback(request *CreatePhysicalConnectionRequest, callback func(response *CreatePhysicalConnectionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreatePhysicalConnectionResponse var err error defer close(result) response, err = client.CreatePhysicalConnection(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreatePhysicalConnectionRequest is the request struct for api CreatePhysicalConnection type CreatePhysicalConnectionRequest struct { *requests.RpcRequest AccessPointId string `position:"Query" name:"AccessPointId"` RedundantPhysicalConnectionId string `position:"Query" name:"RedundantPhysicalConnectionId"` PeerLocation string `position:"Query" name:"PeerLocation"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PortType string `position:"Query" name:"PortType"` CircuitCode string `position:"Query" name:"CircuitCode"` Bandwidth requests.Integer `position:"Query" name:"bandwidth"` ClientToken string `position:"Query" name:"ClientToken"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` Type string `position:"Query" name:"Type"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` LineOperator string `position:"Query" name:"LineOperator"` Name string `position:"Query" name:"Name"` UserCidr string `position:"Query" name:"UserCidr"` } // CreatePhysicalConnectionResponse is the response struct for api CreatePhysicalConnection type CreatePhysicalConnectionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` } // CreateCreatePhysicalConnectionRequest creates a request to invoke CreatePhysicalConnection API func CreateCreatePhysicalConnectionRequest() (request *CreatePhysicalConnectionRequest) { request = &CreatePhysicalConnectionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreatePhysicalConnection", "ecs", "openAPI") return } // CreateCreatePhysicalConnectionResponse creates a response to parse from CreatePhysicalConnection response func CreateCreatePhysicalConnectionResponse() (response *CreatePhysicalConnectionResponse) { response = &CreatePhysicalConnectionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_route_entry.go���0000664�0000000�0000000�00000011247�13771713062�0033014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateRouteEntry invokes the ecs.CreateRouteEntry API synchronously // api document: https://help.aliyun.com/api/ecs/createrouteentry.html func (client *Client) CreateRouteEntry(request *CreateRouteEntryRequest) (response *CreateRouteEntryResponse, err error) { response = CreateCreateRouteEntryResponse() err = client.DoAction(request, response) return } // CreateRouteEntryWithChan invokes the ecs.CreateRouteEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/createrouteentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateRouteEntryWithChan(request *CreateRouteEntryRequest) (<-chan *CreateRouteEntryResponse, <-chan error) { responseChan := make(chan *CreateRouteEntryResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateRouteEntry(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateRouteEntryWithCallback invokes the ecs.CreateRouteEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/createrouteentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateRouteEntryWithCallback(request *CreateRouteEntryRequest, callback func(response *CreateRouteEntryResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateRouteEntryResponse var err error defer close(result) response, err = client.CreateRouteEntry(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateRouteEntryRequest is the request struct for api CreateRouteEntry type CreateRouteEntryRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` DestinationCidrBlock string `position:"Query" name:"DestinationCidrBlock"` OwnerAccount string `position:"Query" name:"OwnerAccount"` NextHopId string `position:"Query" name:"NextHopId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NextHopType string `position:"Query" name:"NextHopType"` NextHopList *[]CreateRouteEntryNextHopList `position:"Query" name:"NextHopList" type:"Repeated"` RouteTableId string `position:"Query" name:"RouteTableId"` } // CreateRouteEntryNextHopList is a repeated param struct in CreateRouteEntryRequest type CreateRouteEntryNextHopList struct { NextHopId string `name:"NextHopId"` NextHopType string `name:"NextHopType"` } // CreateRouteEntryResponse is the response struct for api CreateRouteEntry type CreateRouteEntryResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateCreateRouteEntryRequest creates a request to invoke CreateRouteEntry API func CreateCreateRouteEntryRequest() (request *CreateRouteEntryRequest) { request = &CreateRouteEntryRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateRouteEntry", "ecs", "openAPI") return } // CreateCreateRouteEntryResponse creates a response to parse from CreateRouteEntry response func CreateCreateRouteEntryResponse() (response *CreateRouteEntryResponse) { response = &CreateRouteEntryResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_router_interface.go��������������������������������������������������������������������������0000664�0000000�0000000�00000013622�13771713062�0033715�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateRouterInterface invokes the ecs.CreateRouterInterface API synchronously // api document: https://help.aliyun.com/api/ecs/createrouterinterface.html func (client *Client) CreateRouterInterface(request *CreateRouterInterfaceRequest) (response *CreateRouterInterfaceResponse, err error) { response = CreateCreateRouterInterfaceResponse() err = client.DoAction(request, response) return } // CreateRouterInterfaceWithChan invokes the ecs.CreateRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/createrouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateRouterInterfaceWithChan(request *CreateRouterInterfaceRequest) (<-chan *CreateRouterInterfaceResponse, <-chan error) { responseChan := make(chan *CreateRouterInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateRouterInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateRouterInterfaceWithCallback invokes the ecs.CreateRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/createrouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateRouterInterfaceWithCallback(request *CreateRouterInterfaceRequest, callback func(response *CreateRouterInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateRouterInterfaceResponse var err error defer close(result) response, err = client.CreateRouterInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateRouterInterfaceRequest is the request struct for api CreateRouterInterface type CreateRouterInterfaceRequest struct { *requests.RpcRequest AccessPointId string `position:"Query" name:"AccessPointId"` OppositeRouterId string `position:"Query" name:"OppositeRouterId"` OppositeAccessPointId string `position:"Query" name:"OppositeAccessPointId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Role string `position:"Query" name:"Role"` ClientToken string `position:"Query" name:"ClientToken"` HealthCheckTargetIp string `position:"Query" name:"HealthCheckTargetIp"` Description string `position:"Query" name:"Description"` Spec string `position:"Query" name:"Spec"` UserCidr string `position:"Query" name:"UserCidr"` OppositeInterfaceId string `position:"Query" name:"OppositeInterfaceId"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` Period requests.Integer `position:"Query" name:"Period"` AutoPay requests.Boolean `position:"Query" name:"AutoPay"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OppositeRegionId string `position:"Query" name:"OppositeRegionId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` OppositeInterfaceOwnerId string `position:"Query" name:"OppositeInterfaceOwnerId"` RouterType string `position:"Query" name:"RouterType"` HealthCheckSourceIp string `position:"Query" name:"HealthCheckSourceIp"` RouterId string `position:"Query" name:"RouterId"` OppositeRouterType string `position:"Query" name:"OppositeRouterType"` Name string `position:"Query" name:"Name"` PricingCycle string `position:"Query" name:"PricingCycle"` } // CreateRouterInterfaceResponse is the response struct for api CreateRouterInterface type CreateRouterInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RouterInterfaceId string `json:"RouterInterfaceId" xml:"RouterInterfaceId"` OrderId int `json:"OrderId" xml:"OrderId"` } // CreateCreateRouterInterfaceRequest creates a request to invoke CreateRouterInterface API func CreateCreateRouterInterfaceRequest() (request *CreateRouterInterfaceRequest) { request = &CreateRouterInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateRouterInterface", "ecs", "openAPI") return } // CreateCreateRouterInterfaceResponse creates a response to parse from CreateRouterInterface response func CreateCreateRouterInterfaceResponse() (response *CreateRouterInterfaceResponse) { response = &CreateRouterInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_security_group.go0000664�0000000�0000000�00000011417�13771713062�0033517�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateSecurityGroup invokes the ecs.CreateSecurityGroup API synchronously // api document: https://help.aliyun.com/api/ecs/createsecuritygroup.html func (client *Client) CreateSecurityGroup(request *CreateSecurityGroupRequest) (response *CreateSecurityGroupResponse, err error) { response = CreateCreateSecurityGroupResponse() err = client.DoAction(request, response) return } // CreateSecurityGroupWithChan invokes the ecs.CreateSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/createsecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateSecurityGroupWithChan(request *CreateSecurityGroupRequest) (<-chan *CreateSecurityGroupResponse, <-chan error) { responseChan := make(chan *CreateSecurityGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateSecurityGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateSecurityGroupWithCallback invokes the ecs.CreateSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/createsecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateSecurityGroupWithCallback(request *CreateSecurityGroupRequest, callback func(response *CreateSecurityGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateSecurityGroupResponse var err error defer close(result) response, err = client.CreateSecurityGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateSecurityGroupRequest is the request struct for api CreateSecurityGroup type CreateSecurityGroupRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` SecurityGroupName string `position:"Query" name:"SecurityGroupName"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` VpcId string `position:"Query" name:"VpcId"` Tag *[]CreateSecurityGroupTag `position:"Query" name:"Tag" type:"Repeated"` } // CreateSecurityGroupTag is a repeated param struct in CreateSecurityGroupRequest type CreateSecurityGroupTag struct { Value string `name:"Value"` Key string `name:"Key"` } // CreateSecurityGroupResponse is the response struct for api CreateSecurityGroup type CreateSecurityGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` } // CreateCreateSecurityGroupRequest creates a request to invoke CreateSecurityGroup API func CreateCreateSecurityGroupRequest() (request *CreateSecurityGroupRequest) { request = &CreateSecurityGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateSecurityGroup", "ecs", "openAPI") return } // CreateCreateSecurityGroupResponse creates a response to parse from CreateSecurityGroup response func CreateCreateSecurityGroupResponse() (response *CreateSecurityGroupResponse) { response = &CreateSecurityGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_simulated_system_events.go�������������������������������������������������������������������0000664�0000000�0000000�00000011116�13771713062�0035330�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateSimulatedSystemEvents invokes the ecs.CreateSimulatedSystemEvents API synchronously // api document: https://help.aliyun.com/api/ecs/createsimulatedsystemevents.html func (client *Client) CreateSimulatedSystemEvents(request *CreateSimulatedSystemEventsRequest) (response *CreateSimulatedSystemEventsResponse, err error) { response = CreateCreateSimulatedSystemEventsResponse() err = client.DoAction(request, response) return } // CreateSimulatedSystemEventsWithChan invokes the ecs.CreateSimulatedSystemEvents API asynchronously // api document: https://help.aliyun.com/api/ecs/createsimulatedsystemevents.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateSimulatedSystemEventsWithChan(request *CreateSimulatedSystemEventsRequest) (<-chan *CreateSimulatedSystemEventsResponse, <-chan error) { responseChan := make(chan *CreateSimulatedSystemEventsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateSimulatedSystemEvents(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateSimulatedSystemEventsWithCallback invokes the ecs.CreateSimulatedSystemEvents API asynchronously // api document: https://help.aliyun.com/api/ecs/createsimulatedsystemevents.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateSimulatedSystemEventsWithCallback(request *CreateSimulatedSystemEventsRequest, callback func(response *CreateSimulatedSystemEventsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateSimulatedSystemEventsResponse var err error defer close(result) response, err = client.CreateSimulatedSystemEvents(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateSimulatedSystemEventsRequest is the request struct for api CreateSimulatedSystemEvents type CreateSimulatedSystemEventsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` NotBefore string `position:"Query" name:"NotBefore"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` EventType string `position:"Query" name:"EventType"` } // CreateSimulatedSystemEventsResponse is the response struct for api CreateSimulatedSystemEvents type CreateSimulatedSystemEventsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` EventIdSet EventIdSet `json:"EventIdSet" xml:"EventIdSet"` } // CreateCreateSimulatedSystemEventsRequest creates a request to invoke CreateSimulatedSystemEvents API func CreateCreateSimulatedSystemEventsRequest() (request *CreateSimulatedSystemEventsRequest) { request = &CreateSimulatedSystemEventsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateSimulatedSystemEvents", "ecs", "openAPI") return } // CreateCreateSimulatedSystemEventsResponse creates a response to parse from CreateSimulatedSystemEvents response func CreateCreateSimulatedSystemEventsResponse() (response *CreateSimulatedSystemEventsResponse) { response = &CreateSimulatedSystemEventsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_snapshot.go������0000664�0000000�0000000�00000010631�13771713062�0032270�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateSnapshot invokes the ecs.CreateSnapshot API synchronously // api document: https://help.aliyun.com/api/ecs/createsnapshot.html func (client *Client) CreateSnapshot(request *CreateSnapshotRequest) (response *CreateSnapshotResponse, err error) { response = CreateCreateSnapshotResponse() err = client.DoAction(request, response) return } // CreateSnapshotWithChan invokes the ecs.CreateSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/createsnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateSnapshotWithChan(request *CreateSnapshotRequest) (<-chan *CreateSnapshotResponse, <-chan error) { responseChan := make(chan *CreateSnapshotResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateSnapshot(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateSnapshotWithCallback invokes the ecs.CreateSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/createsnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateSnapshotWithCallback(request *CreateSnapshotRequest, callback func(response *CreateSnapshotResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateSnapshotResponse var err error defer close(result) response, err = client.CreateSnapshot(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateSnapshotRequest is the request struct for api CreateSnapshot type CreateSnapshotRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` DiskId string `position:"Query" name:"DiskId"` SnapshotName string `position:"Query" name:"SnapshotName"` Tag *[]CreateSnapshotTag `position:"Query" name:"Tag" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CreateSnapshotTag is a repeated param struct in CreateSnapshotRequest type CreateSnapshotTag struct { Value string `name:"Value"` Key string `name:"Key"` } // CreateSnapshotResponse is the response struct for api CreateSnapshot type CreateSnapshotResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` } // CreateCreateSnapshotRequest creates a request to invoke CreateSnapshot API func CreateCreateSnapshotRequest() (request *CreateSnapshotRequest) { request = &CreateSnapshotRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateSnapshot", "ecs", "openAPI") return } // CreateCreateSnapshotResponse creates a response to parse from CreateSnapshot response func CreateCreateSnapshotResponse() (response *CreateSnapshotResponse) { response = &CreateSnapshotResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_v_switch.go������0000664�0000000�0000000�00000010340�13771713062�0032254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateVSwitch invokes the ecs.CreateVSwitch API synchronously // api document: https://help.aliyun.com/api/ecs/createvswitch.html func (client *Client) CreateVSwitch(request *CreateVSwitchRequest) (response *CreateVSwitchResponse, err error) { response = CreateCreateVSwitchResponse() err = client.DoAction(request, response) return } // CreateVSwitchWithChan invokes the ecs.CreateVSwitch API asynchronously // api document: https://help.aliyun.com/api/ecs/createvswitch.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVSwitchWithChan(request *CreateVSwitchRequest) (<-chan *CreateVSwitchResponse, <-chan error) { responseChan := make(chan *CreateVSwitchResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateVSwitch(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateVSwitchWithCallback invokes the ecs.CreateVSwitch API asynchronously // api document: https://help.aliyun.com/api/ecs/createvswitch.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVSwitchWithCallback(request *CreateVSwitchRequest, callback func(response *CreateVSwitchResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateVSwitchResponse var err error defer close(result) response, err = client.CreateVSwitch(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateVSwitchRequest is the request struct for api CreateVSwitch type CreateVSwitchRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` VpcId string `position:"Query" name:"VpcId"` VSwitchName string `position:"Query" name:"VSwitchName"` OwnerAccount string `position:"Query" name:"OwnerAccount"` CidrBlock string `position:"Query" name:"CidrBlock"` ZoneId string `position:"Query" name:"ZoneId"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CreateVSwitchResponse is the response struct for api CreateVSwitch type CreateVSwitchResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` } // CreateCreateVSwitchRequest creates a request to invoke CreateVSwitch API func CreateCreateVSwitchRequest() (request *CreateVSwitchRequest) { request = &CreateVSwitchRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateVSwitch", "ecs", "openAPI") return } // CreateCreateVSwitchResponse creates a response to parse from CreateVSwitch response func CreateCreateVSwitchResponse() (response *CreateVSwitchResponse) { response = &CreateVSwitchResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_virtual_border_router.go���������������������������������������������������������������������0000664�0000000�0000000�00000012112�13771713062�0034771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateVirtualBorderRouter invokes the ecs.CreateVirtualBorderRouter API synchronously // api document: https://help.aliyun.com/api/ecs/createvirtualborderrouter.html func (client *Client) CreateVirtualBorderRouter(request *CreateVirtualBorderRouterRequest) (response *CreateVirtualBorderRouterResponse, err error) { response = CreateCreateVirtualBorderRouterResponse() err = client.DoAction(request, response) return } // CreateVirtualBorderRouterWithChan invokes the ecs.CreateVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/createvirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVirtualBorderRouterWithChan(request *CreateVirtualBorderRouterRequest) (<-chan *CreateVirtualBorderRouterResponse, <-chan error) { responseChan := make(chan *CreateVirtualBorderRouterResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateVirtualBorderRouter(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateVirtualBorderRouterWithCallback invokes the ecs.CreateVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/createvirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVirtualBorderRouterWithCallback(request *CreateVirtualBorderRouterRequest, callback func(response *CreateVirtualBorderRouterResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateVirtualBorderRouterResponse var err error defer close(result) response, err = client.CreateVirtualBorderRouter(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateVirtualBorderRouterRequest is the request struct for api CreateVirtualBorderRouter type CreateVirtualBorderRouterRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` CircuitCode string `position:"Query" name:"CircuitCode"` VlanId requests.Integer `position:"Query" name:"VlanId"` ClientToken string `position:"Query" name:"ClientToken"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PeerGatewayIp string `position:"Query" name:"PeerGatewayIp"` PeeringSubnetMask string `position:"Query" name:"PeeringSubnetMask"` PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` Name string `position:"Query" name:"Name"` LocalGatewayIp string `position:"Query" name:"LocalGatewayIp"` UserCidr string `position:"Query" name:"UserCidr"` VbrOwnerId requests.Integer `position:"Query" name:"VbrOwnerId"` } // CreateVirtualBorderRouterResponse is the response struct for api CreateVirtualBorderRouter type CreateVirtualBorderRouterResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` VbrId string `json:"VbrId" xml:"VbrId"` } // CreateCreateVirtualBorderRouterRequest creates a request to invoke CreateVirtualBorderRouter API func CreateCreateVirtualBorderRouterRequest() (request *CreateVirtualBorderRouterRequest) { request = &CreateVirtualBorderRouterRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateVirtualBorderRouter", "ecs", "openAPI") return } // CreateCreateVirtualBorderRouterResponse creates a response to parse from CreateVirtualBorderRouter response func CreateCreateVirtualBorderRouterResponse() (response *CreateVirtualBorderRouterResponse) { response = &CreateVirtualBorderRouterResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/create_vpc.go�����������0000664�0000000�0000000�00000010153�13771713062�0031220�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateVpc invokes the ecs.CreateVpc API synchronously // api document: https://help.aliyun.com/api/ecs/createvpc.html func (client *Client) CreateVpc(request *CreateVpcRequest) (response *CreateVpcResponse, err error) { response = CreateCreateVpcResponse() err = client.DoAction(request, response) return } // CreateVpcWithChan invokes the ecs.CreateVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/createvpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVpcWithChan(request *CreateVpcRequest) (<-chan *CreateVpcResponse, <-chan error) { responseChan := make(chan *CreateVpcResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateVpc(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateVpcWithCallback invokes the ecs.CreateVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/createvpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVpcWithCallback(request *CreateVpcRequest, callback func(response *CreateVpcResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateVpcResponse var err error defer close(result) response, err = client.CreateVpc(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateVpcRequest is the request struct for api CreateVpc type CreateVpcRequest struct { *requests.RpcRequest VpcName string `position:"Query" name:"VpcName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` CidrBlock string `position:"Query" name:"CidrBlock"` Description string `position:"Query" name:"Description"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // CreateVpcResponse is the response struct for api CreateVpc type CreateVpcResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` VpcId string `json:"VpcId" xml:"VpcId"` VRouterId string `json:"VRouterId" xml:"VRouterId"` RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` } // CreateCreateVpcRequest creates a request to invoke CreateVpc API func CreateCreateVpcRequest() (request *CreateVpcRequest) { request = &CreateVpcRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "CreateVpc", "ecs", "openAPI") return } // CreateCreateVpcResponse creates a response to parse from CreateVpc response func CreateCreateVpcResponse() (response *CreateVpcResponse) { response = &CreateVpcResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������deactivate_router_interface.go����������������������������������������������������������������������0000664�0000000�0000000�00000010317�13771713062�0034561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeactivateRouterInterface invokes the ecs.DeactivateRouterInterface API synchronously // api document: https://help.aliyun.com/api/ecs/deactivaterouterinterface.html func (client *Client) DeactivateRouterInterface(request *DeactivateRouterInterfaceRequest) (response *DeactivateRouterInterfaceResponse, err error) { response = CreateDeactivateRouterInterfaceResponse() err = client.DoAction(request, response) return } // DeactivateRouterInterfaceWithChan invokes the ecs.DeactivateRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/deactivaterouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeactivateRouterInterfaceWithChan(request *DeactivateRouterInterfaceRequest) (<-chan *DeactivateRouterInterfaceResponse, <-chan error) { responseChan := make(chan *DeactivateRouterInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeactivateRouterInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeactivateRouterInterfaceWithCallback invokes the ecs.DeactivateRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/deactivaterouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeactivateRouterInterfaceWithCallback(request *DeactivateRouterInterfaceRequest, callback func(response *DeactivateRouterInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeactivateRouterInterfaceResponse var err error defer close(result) response, err = client.DeactivateRouterInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeactivateRouterInterfaceRequest is the request struct for api DeactivateRouterInterface type DeactivateRouterInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` } // DeactivateRouterInterfaceResponse is the response struct for api DeactivateRouterInterface type DeactivateRouterInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeactivateRouterInterfaceRequest creates a request to invoke DeactivateRouterInterface API func CreateDeactivateRouterInterfaceRequest() (request *DeactivateRouterInterfaceRequest) { request = &DeactivateRouterInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeactivateRouterInterface", "ecs", "openAPI") return } // CreateDeactivateRouterInterfaceResponse creates a response to parse from DeactivateRouterInterface response func CreateDeactivateRouterInterfaceResponse() (response *DeactivateRouterInterfaceResponse) { response = &DeactivateRouterInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_auto_snapshot_policy.go����������������������������������������������������������������������0000664�0000000�0000000�00000010252�13771713062�0034616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteAutoSnapshotPolicy invokes the ecs.DeleteAutoSnapshotPolicy API synchronously // api document: https://help.aliyun.com/api/ecs/deleteautosnapshotpolicy.html func (client *Client) DeleteAutoSnapshotPolicy(request *DeleteAutoSnapshotPolicyRequest) (response *DeleteAutoSnapshotPolicyResponse, err error) { response = CreateDeleteAutoSnapshotPolicyResponse() err = client.DoAction(request, response) return } // DeleteAutoSnapshotPolicyWithChan invokes the ecs.DeleteAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteAutoSnapshotPolicyWithChan(request *DeleteAutoSnapshotPolicyRequest) (<-chan *DeleteAutoSnapshotPolicyResponse, <-chan error) { responseChan := make(chan *DeleteAutoSnapshotPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteAutoSnapshotPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteAutoSnapshotPolicyWithCallback invokes the ecs.DeleteAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteAutoSnapshotPolicyWithCallback(request *DeleteAutoSnapshotPolicyRequest, callback func(response *DeleteAutoSnapshotPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteAutoSnapshotPolicyResponse var err error defer close(result) response, err = client.DeleteAutoSnapshotPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteAutoSnapshotPolicyRequest is the request struct for api DeleteAutoSnapshotPolicy type DeleteAutoSnapshotPolicyRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` AutoSnapshotPolicyId string `position:"Query" name:"autoSnapshotPolicyId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteAutoSnapshotPolicyResponse is the response struct for api DeleteAutoSnapshotPolicy type DeleteAutoSnapshotPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteAutoSnapshotPolicyRequest creates a request to invoke DeleteAutoSnapshotPolicy API func CreateDeleteAutoSnapshotPolicyRequest() (request *DeleteAutoSnapshotPolicyRequest) { request = &DeleteAutoSnapshotPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteAutoSnapshotPolicy", "ecs", "openAPI") return } // CreateDeleteAutoSnapshotPolicyResponse creates a response to parse from DeleteAutoSnapshotPolicy response func CreateDeleteAutoSnapshotPolicyResponse() (response *DeleteAutoSnapshotPolicyResponse) { response = &DeleteAutoSnapshotPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_bandwidth_package.go�������������������������������������������������������������������������0000664�0000000�0000000�00000010246�13771713062�0033772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteBandwidthPackage invokes the ecs.DeleteBandwidthPackage API synchronously // api document: https://help.aliyun.com/api/ecs/deletebandwidthpackage.html func (client *Client) DeleteBandwidthPackage(request *DeleteBandwidthPackageRequest) (response *DeleteBandwidthPackageResponse, err error) { response = CreateDeleteBandwidthPackageResponse() err = client.DoAction(request, response) return } // DeleteBandwidthPackageWithChan invokes the ecs.DeleteBandwidthPackage API asynchronously // api document: https://help.aliyun.com/api/ecs/deletebandwidthpackage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteBandwidthPackageWithChan(request *DeleteBandwidthPackageRequest) (<-chan *DeleteBandwidthPackageResponse, <-chan error) { responseChan := make(chan *DeleteBandwidthPackageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteBandwidthPackage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteBandwidthPackageWithCallback invokes the ecs.DeleteBandwidthPackage API asynchronously // api document: https://help.aliyun.com/api/ecs/deletebandwidthpackage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteBandwidthPackageWithCallback(request *DeleteBandwidthPackageRequest, callback func(response *DeleteBandwidthPackageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteBandwidthPackageResponse var err error defer close(result) response, err = client.DeleteBandwidthPackage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteBandwidthPackageRequest is the request struct for api DeleteBandwidthPackage type DeleteBandwidthPackageRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteBandwidthPackageResponse is the response struct for api DeleteBandwidthPackage type DeleteBandwidthPackageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteBandwidthPackageRequest creates a request to invoke DeleteBandwidthPackage API func CreateDeleteBandwidthPackageRequest() (request *DeleteBandwidthPackageRequest) { request = &DeleteBandwidthPackageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteBandwidthPackage", "ecs", "openAPI") return } // CreateDeleteBandwidthPackageResponse creates a response to parse from DeleteBandwidthPackage response func CreateDeleteBandwidthPackageResponse() (response *DeleteBandwidthPackageResponse) { response = &DeleteBandwidthPackageResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_command.go�������0000664�0000000�0000000�00000007465�13771713062�0032061�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteCommand invokes the ecs.DeleteCommand API synchronously // api document: https://help.aliyun.com/api/ecs/deletecommand.html func (client *Client) DeleteCommand(request *DeleteCommandRequest) (response *DeleteCommandResponse, err error) { response = CreateDeleteCommandResponse() err = client.DoAction(request, response) return } // DeleteCommandWithChan invokes the ecs.DeleteCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/deletecommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteCommandWithChan(request *DeleteCommandRequest) (<-chan *DeleteCommandResponse, <-chan error) { responseChan := make(chan *DeleteCommandResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteCommand(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteCommandWithCallback invokes the ecs.DeleteCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/deletecommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteCommandWithCallback(request *DeleteCommandRequest, callback func(response *DeleteCommandResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteCommandResponse var err error defer close(result) response, err = client.DeleteCommand(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteCommandRequest is the request struct for api DeleteCommand type DeleteCommandRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` CommandId string `position:"Query" name:"CommandId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteCommandResponse is the response struct for api DeleteCommand type DeleteCommandResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteCommandRequest creates a request to invoke DeleteCommand API func CreateDeleteCommandRequest() (request *DeleteCommandRequest) { request = &DeleteCommandRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteCommand", "ecs", "openAPI") return } // CreateDeleteCommandResponse creates a response to parse from DeleteCommand response func CreateDeleteCommandResponse() (response *DeleteCommandResponse) { response = &DeleteCommandResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_deployment_set.go0000664�0000000�0000000�00000010053�13771713062�0033461�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteDeploymentSet invokes the ecs.DeleteDeploymentSet API synchronously // api document: https://help.aliyun.com/api/ecs/deletedeploymentset.html func (client *Client) DeleteDeploymentSet(request *DeleteDeploymentSetRequest) (response *DeleteDeploymentSetResponse, err error) { response = CreateDeleteDeploymentSetResponse() err = client.DoAction(request, response) return } // DeleteDeploymentSetWithChan invokes the ecs.DeleteDeploymentSet API asynchronously // api document: https://help.aliyun.com/api/ecs/deletedeploymentset.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteDeploymentSetWithChan(request *DeleteDeploymentSetRequest) (<-chan *DeleteDeploymentSetResponse, <-chan error) { responseChan := make(chan *DeleteDeploymentSetResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteDeploymentSet(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteDeploymentSetWithCallback invokes the ecs.DeleteDeploymentSet API asynchronously // api document: https://help.aliyun.com/api/ecs/deletedeploymentset.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteDeploymentSetWithCallback(request *DeleteDeploymentSetRequest, callback func(response *DeleteDeploymentSetResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteDeploymentSetResponse var err error defer close(result) response, err = client.DeleteDeploymentSet(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteDeploymentSetRequest is the request struct for api DeleteDeploymentSet type DeleteDeploymentSetRequest struct { *requests.RpcRequest DeploymentSetId string `position:"Query" name:"DeploymentSetId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteDeploymentSetResponse is the response struct for api DeleteDeploymentSet type DeleteDeploymentSetResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteDeploymentSetRequest creates a request to invoke DeleteDeploymentSet API func CreateDeleteDeploymentSetRequest() (request *DeleteDeploymentSetRequest) { request = &DeleteDeploymentSetRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteDeploymentSet", "ecs", "openAPI") return } // CreateDeleteDeploymentSetResponse creates a response to parse from DeleteDeploymentSet response func CreateDeleteDeploymentSetResponse() (response *DeleteDeploymentSetResponse) { response = &DeleteDeploymentSetResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_disk.go����������0000664�0000000�0000000�00000007272�13771713062�0031371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteDisk invokes the ecs.DeleteDisk API synchronously // api document: https://help.aliyun.com/api/ecs/deletedisk.html func (client *Client) DeleteDisk(request *DeleteDiskRequest) (response *DeleteDiskResponse, err error) { response = CreateDeleteDiskResponse() err = client.DoAction(request, response) return } // DeleteDiskWithChan invokes the ecs.DeleteDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/deletedisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteDiskWithChan(request *DeleteDiskRequest) (<-chan *DeleteDiskResponse, <-chan error) { responseChan := make(chan *DeleteDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteDiskWithCallback invokes the ecs.DeleteDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/deletedisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteDiskWithCallback(request *DeleteDiskRequest, callback func(response *DeleteDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteDiskResponse var err error defer close(result) response, err = client.DeleteDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteDiskRequest is the request struct for api DeleteDisk type DeleteDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DiskId string `position:"Query" name:"DiskId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteDiskResponse is the response struct for api DeleteDisk type DeleteDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteDiskRequest creates a request to invoke DeleteDisk API func CreateDeleteDiskRequest() (request *DeleteDiskRequest) { request = &DeleteDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteDisk", "ecs", "openAPI") return } // CreateDeleteDiskResponse creates a response to parse from DeleteDisk response func CreateDeleteDiskResponse() (response *DeleteDiskResponse) { response = &DeleteDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_forward_entry.go�0000664�0000000�0000000�00000010122�13771713062�0033310�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteForwardEntry invokes the ecs.DeleteForwardEntry API synchronously // api document: https://help.aliyun.com/api/ecs/deleteforwardentry.html func (client *Client) DeleteForwardEntry(request *DeleteForwardEntryRequest) (response *DeleteForwardEntryResponse, err error) { response = CreateDeleteForwardEntryResponse() err = client.DoAction(request, response) return } // DeleteForwardEntryWithChan invokes the ecs.DeleteForwardEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteforwardentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteForwardEntryWithChan(request *DeleteForwardEntryRequest) (<-chan *DeleteForwardEntryResponse, <-chan error) { responseChan := make(chan *DeleteForwardEntryResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteForwardEntry(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteForwardEntryWithCallback invokes the ecs.DeleteForwardEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteforwardentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteForwardEntryWithCallback(request *DeleteForwardEntryRequest, callback func(response *DeleteForwardEntryResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteForwardEntryResponse var err error defer close(result) response, err = client.DeleteForwardEntry(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteForwardEntryRequest is the request struct for api DeleteForwardEntry type DeleteForwardEntryRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ForwardEntryId string `position:"Query" name:"ForwardEntryId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` ForwardTableId string `position:"Query" name:"ForwardTableId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteForwardEntryResponse is the response struct for api DeleteForwardEntry type DeleteForwardEntryResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteForwardEntryRequest creates a request to invoke DeleteForwardEntry API func CreateDeleteForwardEntryRequest() (request *DeleteForwardEntryRequest) { request = &DeleteForwardEntryRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteForwardEntry", "ecs", "openAPI") return } // CreateDeleteForwardEntryResponse creates a response to parse from DeleteForwardEntry response func CreateDeleteForwardEntryResponse() (response *DeleteForwardEntryResponse) { response = &DeleteForwardEntryResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_ha_vip.go��������0000664�0000000�0000000�00000007460�13771713062�0031704�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteHaVip invokes the ecs.DeleteHaVip API synchronously // api document: https://help.aliyun.com/api/ecs/deletehavip.html func (client *Client) DeleteHaVip(request *DeleteHaVipRequest) (response *DeleteHaVipResponse, err error) { response = CreateDeleteHaVipResponse() err = client.DoAction(request, response) return } // DeleteHaVipWithChan invokes the ecs.DeleteHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/deletehavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteHaVipWithChan(request *DeleteHaVipRequest) (<-chan *DeleteHaVipResponse, <-chan error) { responseChan := make(chan *DeleteHaVipResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteHaVip(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteHaVipWithCallback invokes the ecs.DeleteHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/deletehavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteHaVipWithCallback(request *DeleteHaVipRequest, callback func(response *DeleteHaVipResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteHaVipResponse var err error defer close(result) response, err = client.DeleteHaVip(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteHaVipRequest is the request struct for api DeleteHaVip type DeleteHaVipRequest struct { *requests.RpcRequest HaVipId string `position:"Query" name:"HaVipId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteHaVipResponse is the response struct for api DeleteHaVip type DeleteHaVipResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteHaVipRequest creates a request to invoke DeleteHaVip API func CreateDeleteHaVipRequest() (request *DeleteHaVipRequest) { request = &DeleteHaVipRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteHaVip", "ecs", "openAPI") return } // CreateDeleteHaVipResponse creates a response to parse from DeleteHaVip response func CreateDeleteHaVipResponse() (response *DeleteHaVipResponse) { response = &DeleteHaVipResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_hpc_cluster.go���0000664�0000000�0000000�00000007775�13771713062�0032762�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteHpcCluster invokes the ecs.DeleteHpcCluster API synchronously // api document: https://help.aliyun.com/api/ecs/deletehpccluster.html func (client *Client) DeleteHpcCluster(request *DeleteHpcClusterRequest) (response *DeleteHpcClusterResponse, err error) { response = CreateDeleteHpcClusterResponse() err = client.DoAction(request, response) return } // DeleteHpcClusterWithChan invokes the ecs.DeleteHpcCluster API asynchronously // api document: https://help.aliyun.com/api/ecs/deletehpccluster.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteHpcClusterWithChan(request *DeleteHpcClusterRequest) (<-chan *DeleteHpcClusterResponse, <-chan error) { responseChan := make(chan *DeleteHpcClusterResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteHpcCluster(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteHpcClusterWithCallback invokes the ecs.DeleteHpcCluster API asynchronously // api document: https://help.aliyun.com/api/ecs/deletehpccluster.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteHpcClusterWithCallback(request *DeleteHpcClusterRequest, callback func(response *DeleteHpcClusterResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteHpcClusterResponse var err error defer close(result) response, err = client.DeleteHpcCluster(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteHpcClusterRequest is the request struct for api DeleteHpcCluster type DeleteHpcClusterRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` HpcClusterId string `position:"Query" name:"HpcClusterId"` ClientToken string `position:"Query" name:"ClientToken"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteHpcClusterResponse is the response struct for api DeleteHpcCluster type DeleteHpcClusterResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteHpcClusterRequest creates a request to invoke DeleteHpcCluster API func CreateDeleteHpcClusterRequest() (request *DeleteHpcClusterRequest) { request = &DeleteHpcClusterRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteHpcCluster", "ecs", "openAPI") return } // CreateDeleteHpcClusterResponse creates a response to parse from DeleteHpcCluster response func CreateDeleteHpcClusterResponse() (response *DeleteHpcClusterResponse) { response = &DeleteHpcClusterResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_image.go���������0000664�0000000�0000000�00000007452�13771713062�0031521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteImage invokes the ecs.DeleteImage API synchronously // api document: https://help.aliyun.com/api/ecs/deleteimage.html func (client *Client) DeleteImage(request *DeleteImageRequest) (response *DeleteImageResponse, err error) { response = CreateDeleteImageResponse() err = client.DoAction(request, response) return } // DeleteImageWithChan invokes the ecs.DeleteImage API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteImageWithChan(request *DeleteImageRequest) (<-chan *DeleteImageResponse, <-chan error) { responseChan := make(chan *DeleteImageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteImage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteImageWithCallback invokes the ecs.DeleteImage API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteImageWithCallback(request *DeleteImageRequest, callback func(response *DeleteImageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteImageResponse var err error defer close(result) response, err = client.DeleteImage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteImageRequest is the request struct for api DeleteImage type DeleteImageRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Force requests.Boolean `position:"Query" name:"Force"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteImageResponse is the response struct for api DeleteImage type DeleteImageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteImageRequest creates a request to invoke DeleteImage API func CreateDeleteImageRequest() (request *DeleteImageRequest) { request = &DeleteImageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteImage", "ecs", "openAPI") return } // CreateDeleteImageResponse creates a response to parse from DeleteImage response func CreateDeleteImageResponse() (response *DeleteImageResponse) { response = &DeleteImageResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_instance.go������0000664�0000000�0000000�00000010003�13771713062�0032225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteInstance invokes the ecs.DeleteInstance API synchronously // api document: https://help.aliyun.com/api/ecs/deleteinstance.html func (client *Client) DeleteInstance(request *DeleteInstanceRequest) (response *DeleteInstanceResponse, err error) { response = CreateDeleteInstanceResponse() err = client.DoAction(request, response) return } // DeleteInstanceWithChan invokes the ecs.DeleteInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteInstanceWithChan(request *DeleteInstanceRequest) (<-chan *DeleteInstanceResponse, <-chan error) { responseChan := make(chan *DeleteInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteInstanceWithCallback invokes the ecs.DeleteInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/deleteinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteInstanceWithCallback(request *DeleteInstanceRequest, callback func(response *DeleteInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteInstanceResponse var err error defer close(result) response, err = client.DeleteInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteInstanceRequest is the request struct for api DeleteInstance type DeleteInstanceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` TerminateSubscription requests.Boolean `position:"Query" name:"TerminateSubscription"` Force requests.Boolean `position:"Query" name:"Force"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteInstanceResponse is the response struct for api DeleteInstance type DeleteInstanceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteInstanceRequest creates a request to invoke DeleteInstance API func CreateDeleteInstanceRequest() (request *DeleteInstanceRequest) { request = &DeleteInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteInstance", "ecs", "openAPI") return } // CreateDeleteInstanceResponse creates a response to parse from DeleteInstance response func CreateDeleteInstanceResponse() (response *DeleteInstanceResponse) { response = &DeleteInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_key_pairs.go�����0000664�0000000�0000000�00000007422�13771713062�0032422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteKeyPairs invokes the ecs.DeleteKeyPairs API synchronously // api document: https://help.aliyun.com/api/ecs/deletekeypairs.html func (client *Client) DeleteKeyPairs(request *DeleteKeyPairsRequest) (response *DeleteKeyPairsResponse, err error) { response = CreateDeleteKeyPairsResponse() err = client.DoAction(request, response) return } // DeleteKeyPairsWithChan invokes the ecs.DeleteKeyPairs API asynchronously // api document: https://help.aliyun.com/api/ecs/deletekeypairs.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteKeyPairsWithChan(request *DeleteKeyPairsRequest) (<-chan *DeleteKeyPairsResponse, <-chan error) { responseChan := make(chan *DeleteKeyPairsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteKeyPairs(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteKeyPairsWithCallback invokes the ecs.DeleteKeyPairs API asynchronously // api document: https://help.aliyun.com/api/ecs/deletekeypairs.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteKeyPairsWithCallback(request *DeleteKeyPairsRequest, callback func(response *DeleteKeyPairsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteKeyPairsResponse var err error defer close(result) response, err = client.DeleteKeyPairs(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteKeyPairsRequest is the request struct for api DeleteKeyPairs type DeleteKeyPairsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` KeyPairNames string `position:"Query" name:"KeyPairNames"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteKeyPairsResponse is the response struct for api DeleteKeyPairs type DeleteKeyPairsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteKeyPairsRequest creates a request to invoke DeleteKeyPairs API func CreateDeleteKeyPairsRequest() (request *DeleteKeyPairsRequest) { request = &DeleteKeyPairsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteKeyPairs", "ecs", "openAPI") return } // CreateDeleteKeyPairsResponse creates a response to parse from DeleteKeyPairs response func CreateDeleteKeyPairsResponse() (response *DeleteKeyPairsResponse) { response = &DeleteKeyPairsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_launch_template.go���������������������������������������������������������������������������0000664�0000000�0000000�00000010250�13771713062�0033513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteLaunchTemplate invokes the ecs.DeleteLaunchTemplate API synchronously // api document: https://help.aliyun.com/api/ecs/deletelaunchtemplate.html func (client *Client) DeleteLaunchTemplate(request *DeleteLaunchTemplateRequest) (response *DeleteLaunchTemplateResponse, err error) { response = CreateDeleteLaunchTemplateResponse() err = client.DoAction(request, response) return } // DeleteLaunchTemplateWithChan invokes the ecs.DeleteLaunchTemplate API asynchronously // api document: https://help.aliyun.com/api/ecs/deletelaunchtemplate.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteLaunchTemplateWithChan(request *DeleteLaunchTemplateRequest) (<-chan *DeleteLaunchTemplateResponse, <-chan error) { responseChan := make(chan *DeleteLaunchTemplateResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteLaunchTemplate(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteLaunchTemplateWithCallback invokes the ecs.DeleteLaunchTemplate API asynchronously // api document: https://help.aliyun.com/api/ecs/deletelaunchtemplate.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteLaunchTemplateWithCallback(request *DeleteLaunchTemplateRequest, callback func(response *DeleteLaunchTemplateResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteLaunchTemplateResponse var err error defer close(result) response, err = client.DeleteLaunchTemplate(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteLaunchTemplateRequest is the request struct for api DeleteLaunchTemplate type DeleteLaunchTemplateRequest struct { *requests.RpcRequest LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteLaunchTemplateResponse is the response struct for api DeleteLaunchTemplate type DeleteLaunchTemplateResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteLaunchTemplateRequest creates a request to invoke DeleteLaunchTemplate API func CreateDeleteLaunchTemplateRequest() (request *DeleteLaunchTemplateRequest) { request = &DeleteLaunchTemplateRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteLaunchTemplate", "ecs", "openAPI") return } // CreateDeleteLaunchTemplateResponse creates a response to parse from DeleteLaunchTemplate response func CreateDeleteLaunchTemplateResponse() (response *DeleteLaunchTemplateResponse) { response = &DeleteLaunchTemplateResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_launch_template_version.go�������������������������������������������������������������������0000664�0000000�0000000�00000011040�13771713062�0035256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteLaunchTemplateVersion invokes the ecs.DeleteLaunchTemplateVersion API synchronously // api document: https://help.aliyun.com/api/ecs/deletelaunchtemplateversion.html func (client *Client) DeleteLaunchTemplateVersion(request *DeleteLaunchTemplateVersionRequest) (response *DeleteLaunchTemplateVersionResponse, err error) { response = CreateDeleteLaunchTemplateVersionResponse() err = client.DoAction(request, response) return } // DeleteLaunchTemplateVersionWithChan invokes the ecs.DeleteLaunchTemplateVersion API asynchronously // api document: https://help.aliyun.com/api/ecs/deletelaunchtemplateversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteLaunchTemplateVersionWithChan(request *DeleteLaunchTemplateVersionRequest) (<-chan *DeleteLaunchTemplateVersionResponse, <-chan error) { responseChan := make(chan *DeleteLaunchTemplateVersionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteLaunchTemplateVersion(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteLaunchTemplateVersionWithCallback invokes the ecs.DeleteLaunchTemplateVersion API asynchronously // api document: https://help.aliyun.com/api/ecs/deletelaunchtemplateversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteLaunchTemplateVersionWithCallback(request *DeleteLaunchTemplateVersionRequest, callback func(response *DeleteLaunchTemplateVersionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteLaunchTemplateVersionResponse var err error defer close(result) response, err = client.DeleteLaunchTemplateVersion(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteLaunchTemplateVersionRequest is the request struct for api DeleteLaunchTemplateVersion type DeleteLaunchTemplateVersionRequest struct { *requests.RpcRequest LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` DeleteVersion *[]string `position:"Query" name:"DeleteVersion" type:"Repeated"` LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteLaunchTemplateVersionResponse is the response struct for api DeleteLaunchTemplateVersion type DeleteLaunchTemplateVersionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteLaunchTemplateVersionRequest creates a request to invoke DeleteLaunchTemplateVersion API func CreateDeleteLaunchTemplateVersionRequest() (request *DeleteLaunchTemplateVersionRequest) { request = &DeleteLaunchTemplateVersionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteLaunchTemplateVersion", "ecs", "openAPI") return } // CreateDeleteLaunchTemplateVersionResponse creates a response to parse from DeleteLaunchTemplateVersion response func CreateDeleteLaunchTemplateVersionResponse() (response *DeleteLaunchTemplateVersionResponse) { response = &DeleteLaunchTemplateVersionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_nat_gateway.go���0000664�0000000�0000000�00000007660�13771713062�0032743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteNatGateway invokes the ecs.DeleteNatGateway API synchronously // api document: https://help.aliyun.com/api/ecs/deletenatgateway.html func (client *Client) DeleteNatGateway(request *DeleteNatGatewayRequest) (response *DeleteNatGatewayResponse, err error) { response = CreateDeleteNatGatewayResponse() err = client.DoAction(request, response) return } // DeleteNatGatewayWithChan invokes the ecs.DeleteNatGateway API asynchronously // api document: https://help.aliyun.com/api/ecs/deletenatgateway.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteNatGatewayWithChan(request *DeleteNatGatewayRequest) (<-chan *DeleteNatGatewayResponse, <-chan error) { responseChan := make(chan *DeleteNatGatewayResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteNatGateway(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteNatGatewayWithCallback invokes the ecs.DeleteNatGateway API asynchronously // api document: https://help.aliyun.com/api/ecs/deletenatgateway.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteNatGatewayWithCallback(request *DeleteNatGatewayRequest, callback func(response *DeleteNatGatewayResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteNatGatewayResponse var err error defer close(result) response, err = client.DeleteNatGateway(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteNatGatewayRequest is the request struct for api DeleteNatGateway type DeleteNatGatewayRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` NatGatewayId string `position:"Query" name:"NatGatewayId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteNatGatewayResponse is the response struct for api DeleteNatGateway type DeleteNatGatewayResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteNatGatewayRequest creates a request to invoke DeleteNatGateway API func CreateDeleteNatGatewayRequest() (request *DeleteNatGatewayRequest) { request = &DeleteNatGatewayRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteNatGateway", "ecs", "openAPI") return } // CreateDeleteNatGatewayResponse creates a response to parse from DeleteNatGateway response func CreateDeleteNatGatewayResponse() (response *DeleteNatGatewayResponse) { response = &DeleteNatGatewayResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������delete_network_interface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000010246�13771713062�0034064�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteNetworkInterface invokes the ecs.DeleteNetworkInterface API synchronously // api document: https://help.aliyun.com/api/ecs/deletenetworkinterface.html func (client *Client) DeleteNetworkInterface(request *DeleteNetworkInterfaceRequest) (response *DeleteNetworkInterfaceResponse, err error) { response = CreateDeleteNetworkInterfaceResponse() err = client.DoAction(request, response) return } // DeleteNetworkInterfaceWithChan invokes the ecs.DeleteNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/deletenetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteNetworkInterfaceWithChan(request *DeleteNetworkInterfaceRequest) (<-chan *DeleteNetworkInterfaceResponse, <-chan error) { responseChan := make(chan *DeleteNetworkInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteNetworkInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteNetworkInterfaceWithCallback invokes the ecs.DeleteNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/deletenetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteNetworkInterfaceWithCallback(request *DeleteNetworkInterfaceRequest, callback func(response *DeleteNetworkInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteNetworkInterfaceResponse var err error defer close(result) response, err = client.DeleteNetworkInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteNetworkInterfaceRequest is the request struct for api DeleteNetworkInterface type DeleteNetworkInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // DeleteNetworkInterfaceResponse is the response struct for api DeleteNetworkInterface type DeleteNetworkInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteNetworkInterfaceRequest creates a request to invoke DeleteNetworkInterface API func CreateDeleteNetworkInterfaceRequest() (request *DeleteNetworkInterfaceRequest) { request = &DeleteNetworkInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteNetworkInterface", "ecs", "openAPI") return } // CreateDeleteNetworkInterfaceResponse creates a response to parse from DeleteNetworkInterface response func CreateDeleteNetworkInterfaceResponse() (response *DeleteNetworkInterfaceResponse) { response = &DeleteNetworkInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_network_interface_permission.go��������������������������������������������������������������0000664�0000000�0000000�00000011267�13771713062�0036340�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteNetworkInterfacePermission invokes the ecs.DeleteNetworkInterfacePermission API synchronously // api document: https://help.aliyun.com/api/ecs/deletenetworkinterfacepermission.html func (client *Client) DeleteNetworkInterfacePermission(request *DeleteNetworkInterfacePermissionRequest) (response *DeleteNetworkInterfacePermissionResponse, err error) { response = CreateDeleteNetworkInterfacePermissionResponse() err = client.DoAction(request, response) return } // DeleteNetworkInterfacePermissionWithChan invokes the ecs.DeleteNetworkInterfacePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/deletenetworkinterfacepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteNetworkInterfacePermissionWithChan(request *DeleteNetworkInterfacePermissionRequest) (<-chan *DeleteNetworkInterfacePermissionResponse, <-chan error) { responseChan := make(chan *DeleteNetworkInterfacePermissionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteNetworkInterfacePermission(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteNetworkInterfacePermissionWithCallback invokes the ecs.DeleteNetworkInterfacePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/deletenetworkinterfacepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteNetworkInterfacePermissionWithCallback(request *DeleteNetworkInterfacePermissionRequest, callback func(response *DeleteNetworkInterfacePermissionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteNetworkInterfacePermissionResponse var err error defer close(result) response, err = client.DeleteNetworkInterfacePermission(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteNetworkInterfacePermissionRequest is the request struct for api DeleteNetworkInterfacePermission type DeleteNetworkInterfacePermissionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` NetworkInterfacePermissionId string `position:"Query" name:"NetworkInterfacePermissionId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Force requests.Boolean `position:"Query" name:"Force"` } // DeleteNetworkInterfacePermissionResponse is the response struct for api DeleteNetworkInterfacePermission type DeleteNetworkInterfacePermissionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteNetworkInterfacePermissionRequest creates a request to invoke DeleteNetworkInterfacePermission API func CreateDeleteNetworkInterfacePermissionRequest() (request *DeleteNetworkInterfacePermissionRequest) { request = &DeleteNetworkInterfacePermissionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteNetworkInterfacePermission", "ecs", "openAPI") return } // CreateDeleteNetworkInterfacePermissionResponse creates a response to parse from DeleteNetworkInterfacePermission response func CreateDeleteNetworkInterfacePermissionResponse() (response *DeleteNetworkInterfacePermissionResponse) { response = &DeleteNetworkInterfacePermissionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_physical_connection.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010505�13771713062�0034404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeletePhysicalConnection invokes the ecs.DeletePhysicalConnection API synchronously // api document: https://help.aliyun.com/api/ecs/deletephysicalconnection.html func (client *Client) DeletePhysicalConnection(request *DeletePhysicalConnectionRequest) (response *DeletePhysicalConnectionResponse, err error) { response = CreateDeletePhysicalConnectionResponse() err = client.DoAction(request, response) return } // DeletePhysicalConnectionWithChan invokes the ecs.DeletePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/deletephysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePhysicalConnectionWithChan(request *DeletePhysicalConnectionRequest) (<-chan *DeletePhysicalConnectionResponse, <-chan error) { responseChan := make(chan *DeletePhysicalConnectionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeletePhysicalConnection(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeletePhysicalConnectionWithCallback invokes the ecs.DeletePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/deletephysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePhysicalConnectionWithCallback(request *DeletePhysicalConnectionRequest, callback func(response *DeletePhysicalConnectionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeletePhysicalConnectionResponse var err error defer close(result) response, err = client.DeletePhysicalConnection(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeletePhysicalConnectionRequest is the request struct for api DeletePhysicalConnection type DeletePhysicalConnectionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeletePhysicalConnectionResponse is the response struct for api DeletePhysicalConnection type DeletePhysicalConnectionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeletePhysicalConnectionRequest creates a request to invoke DeletePhysicalConnection API func CreateDeletePhysicalConnectionRequest() (request *DeletePhysicalConnectionRequest) { request = &DeletePhysicalConnectionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeletePhysicalConnection", "ecs", "openAPI") return } // CreateDeletePhysicalConnectionResponse creates a response to parse from DeletePhysicalConnection response func CreateDeletePhysicalConnectionResponse() (response *DeletePhysicalConnectionResponse) { response = &DeletePhysicalConnectionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_route_entry.go���0000664�0000000�0000000�00000010761�13771713062�0033013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteRouteEntry invokes the ecs.DeleteRouteEntry API synchronously // api document: https://help.aliyun.com/api/ecs/deleterouteentry.html func (client *Client) DeleteRouteEntry(request *DeleteRouteEntryRequest) (response *DeleteRouteEntryResponse, err error) { response = CreateDeleteRouteEntryResponse() err = client.DoAction(request, response) return } // DeleteRouteEntryWithChan invokes the ecs.DeleteRouteEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/deleterouteentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteRouteEntryWithChan(request *DeleteRouteEntryRequest) (<-chan *DeleteRouteEntryResponse, <-chan error) { responseChan := make(chan *DeleteRouteEntryResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteRouteEntry(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteRouteEntryWithCallback invokes the ecs.DeleteRouteEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/deleterouteentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteRouteEntryWithCallback(request *DeleteRouteEntryRequest, callback func(response *DeleteRouteEntryResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteRouteEntryResponse var err error defer close(result) response, err = client.DeleteRouteEntry(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteRouteEntryRequest is the request struct for api DeleteRouteEntry type DeleteRouteEntryRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` DestinationCidrBlock string `position:"Query" name:"DestinationCidrBlock"` OwnerAccount string `position:"Query" name:"OwnerAccount"` NextHopId string `position:"Query" name:"NextHopId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NextHopList *[]DeleteRouteEntryNextHopList `position:"Query" name:"NextHopList" type:"Repeated"` RouteTableId string `position:"Query" name:"RouteTableId"` } // DeleteRouteEntryNextHopList is a repeated param struct in DeleteRouteEntryRequest type DeleteRouteEntryNextHopList struct { NextHopId string `name:"NextHopId"` NextHopType string `name:"NextHopType"` } // DeleteRouteEntryResponse is the response struct for api DeleteRouteEntry type DeleteRouteEntryResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteRouteEntryRequest creates a request to invoke DeleteRouteEntry API func CreateDeleteRouteEntryRequest() (request *DeleteRouteEntryRequest) { request = &DeleteRouteEntryRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteRouteEntry", "ecs", "openAPI") return } // CreateDeleteRouteEntryResponse creates a response to parse from DeleteRouteEntry response func CreateDeleteRouteEntryResponse() (response *DeleteRouteEntryResponse) { response = &DeleteRouteEntryResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������delete_router_interface.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010424�13771713062�0033711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteRouterInterface invokes the ecs.DeleteRouterInterface API synchronously // api document: https://help.aliyun.com/api/ecs/deleterouterinterface.html func (client *Client) DeleteRouterInterface(request *DeleteRouterInterfaceRequest) (response *DeleteRouterInterfaceResponse, err error) { response = CreateDeleteRouterInterfaceResponse() err = client.DoAction(request, response) return } // DeleteRouterInterfaceWithChan invokes the ecs.DeleteRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/deleterouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteRouterInterfaceWithChan(request *DeleteRouterInterfaceRequest) (<-chan *DeleteRouterInterfaceResponse, <-chan error) { responseChan := make(chan *DeleteRouterInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteRouterInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteRouterInterfaceWithCallback invokes the ecs.DeleteRouterInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/deleterouterinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteRouterInterfaceWithCallback(request *DeleteRouterInterfaceRequest, callback func(response *DeleteRouterInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteRouterInterfaceResponse var err error defer close(result) response, err = client.DeleteRouterInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteRouterInterfaceRequest is the request struct for api DeleteRouterInterface type DeleteRouterInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteRouterInterfaceResponse is the response struct for api DeleteRouterInterface type DeleteRouterInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteRouterInterfaceRequest creates a request to invoke DeleteRouterInterface API func CreateDeleteRouterInterfaceRequest() (request *DeleteRouterInterfaceRequest) { request = &DeleteRouterInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteRouterInterface", "ecs", "openAPI") return } // CreateDeleteRouterInterfaceResponse creates a response to parse from DeleteRouterInterface response func CreateDeleteRouterInterfaceResponse() (response *DeleteRouterInterfaceResponse) { response = &DeleteRouterInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_security_group.go0000664�0000000�0000000�00000010053�13771713062�0033511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteSecurityGroup invokes the ecs.DeleteSecurityGroup API synchronously // api document: https://help.aliyun.com/api/ecs/deletesecuritygroup.html func (client *Client) DeleteSecurityGroup(request *DeleteSecurityGroupRequest) (response *DeleteSecurityGroupResponse, err error) { response = CreateDeleteSecurityGroupResponse() err = client.DoAction(request, response) return } // DeleteSecurityGroupWithChan invokes the ecs.DeleteSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/deletesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteSecurityGroupWithChan(request *DeleteSecurityGroupRequest) (<-chan *DeleteSecurityGroupResponse, <-chan error) { responseChan := make(chan *DeleteSecurityGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteSecurityGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteSecurityGroupWithCallback invokes the ecs.DeleteSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/deletesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteSecurityGroupWithCallback(request *DeleteSecurityGroupRequest, callback func(response *DeleteSecurityGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteSecurityGroupResponse var err error defer close(result) response, err = client.DeleteSecurityGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteSecurityGroupRequest is the request struct for api DeleteSecurityGroup type DeleteSecurityGroupRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteSecurityGroupResponse is the response struct for api DeleteSecurityGroup type DeleteSecurityGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteSecurityGroupRequest creates a request to invoke DeleteSecurityGroup API func CreateDeleteSecurityGroupRequest() (request *DeleteSecurityGroupRequest) { request = &DeleteSecurityGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteSecurityGroup", "ecs", "openAPI") return } // CreateDeleteSecurityGroupResponse creates a response to parse from DeleteSecurityGroup response func CreateDeleteSecurityGroupResponse() (response *DeleteSecurityGroupResponse) { response = &DeleteSecurityGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_snapshot.go������0000664�0000000�0000000�00000007645�13771713062�0032302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteSnapshot invokes the ecs.DeleteSnapshot API synchronously // api document: https://help.aliyun.com/api/ecs/deletesnapshot.html func (client *Client) DeleteSnapshot(request *DeleteSnapshotRequest) (response *DeleteSnapshotResponse, err error) { response = CreateDeleteSnapshotResponse() err = client.DoAction(request, response) return } // DeleteSnapshotWithChan invokes the ecs.DeleteSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/deletesnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteSnapshotWithChan(request *DeleteSnapshotRequest) (<-chan *DeleteSnapshotResponse, <-chan error) { responseChan := make(chan *DeleteSnapshotResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteSnapshot(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteSnapshotWithCallback invokes the ecs.DeleteSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/deletesnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteSnapshotWithCallback(request *DeleteSnapshotRequest, callback func(response *DeleteSnapshotResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteSnapshotResponse var err error defer close(result) response, err = client.DeleteSnapshot(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteSnapshotRequest is the request struct for api DeleteSnapshot type DeleteSnapshotRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotId string `position:"Query" name:"SnapshotId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Force requests.Boolean `position:"Query" name:"Force"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteSnapshotResponse is the response struct for api DeleteSnapshot type DeleteSnapshotResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteSnapshotRequest creates a request to invoke DeleteSnapshot API func CreateDeleteSnapshotRequest() (request *DeleteSnapshotRequest) { request = &DeleteSnapshotRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteSnapshot", "ecs", "openAPI") return } // CreateDeleteSnapshotResponse creates a response to parse from DeleteSnapshot response func CreateDeleteSnapshotResponse() (response *DeleteSnapshotResponse) { response = &DeleteSnapshotResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_v_switch.go������0000664�0000000�0000000�00000007465�13771713062�0032271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteVSwitch invokes the ecs.DeleteVSwitch API synchronously // api document: https://help.aliyun.com/api/ecs/deletevswitch.html func (client *Client) DeleteVSwitch(request *DeleteVSwitchRequest) (response *DeleteVSwitchResponse, err error) { response = CreateDeleteVSwitchResponse() err = client.DoAction(request, response) return } // DeleteVSwitchWithChan invokes the ecs.DeleteVSwitch API asynchronously // api document: https://help.aliyun.com/api/ecs/deletevswitch.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVSwitchWithChan(request *DeleteVSwitchRequest) (<-chan *DeleteVSwitchResponse, <-chan error) { responseChan := make(chan *DeleteVSwitchResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteVSwitch(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteVSwitchWithCallback invokes the ecs.DeleteVSwitch API asynchronously // api document: https://help.aliyun.com/api/ecs/deletevswitch.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVSwitchWithCallback(request *DeleteVSwitchRequest, callback func(response *DeleteVSwitchResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteVSwitchResponse var err error defer close(result) response, err = client.DeleteVSwitch(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteVSwitchRequest is the request struct for api DeleteVSwitch type DeleteVSwitchRequest struct { *requests.RpcRequest VSwitchId string `position:"Query" name:"VSwitchId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteVSwitchResponse is the response struct for api DeleteVSwitch type DeleteVSwitchResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteVSwitchRequest creates a request to invoke DeleteVSwitch API func CreateDeleteVSwitchRequest() (request *DeleteVSwitchRequest) { request = &DeleteVSwitchRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteVSwitch", "ecs", "openAPI") return } // CreateDeleteVSwitchResponse creates a response to parse from DeleteVSwitch response func CreateDeleteVSwitchResponse() (response *DeleteVSwitchResponse) { response = &DeleteVSwitchResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_virtual_border_router.go���������������������������������������������������������������������0000664�0000000�0000000�00000010650�13771713062�0034775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteVirtualBorderRouter invokes the ecs.DeleteVirtualBorderRouter API synchronously // api document: https://help.aliyun.com/api/ecs/deletevirtualborderrouter.html func (client *Client) DeleteVirtualBorderRouter(request *DeleteVirtualBorderRouterRequest) (response *DeleteVirtualBorderRouterResponse, err error) { response = CreateDeleteVirtualBorderRouterResponse() err = client.DoAction(request, response) return } // DeleteVirtualBorderRouterWithChan invokes the ecs.DeleteVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/deletevirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVirtualBorderRouterWithChan(request *DeleteVirtualBorderRouterRequest) (<-chan *DeleteVirtualBorderRouterResponse, <-chan error) { responseChan := make(chan *DeleteVirtualBorderRouterResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteVirtualBorderRouter(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteVirtualBorderRouterWithCallback invokes the ecs.DeleteVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/deletevirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVirtualBorderRouterWithCallback(request *DeleteVirtualBorderRouterRequest, callback func(response *DeleteVirtualBorderRouterResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteVirtualBorderRouterResponse var err error defer close(result) response, err = client.DeleteVirtualBorderRouter(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteVirtualBorderRouterRequest is the request struct for api DeleteVirtualBorderRouter type DeleteVirtualBorderRouterRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` VbrId string `position:"Query" name:"VbrId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteVirtualBorderRouterResponse is the response struct for api DeleteVirtualBorderRouter type DeleteVirtualBorderRouterResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteVirtualBorderRouterRequest creates a request to invoke DeleteVirtualBorderRouter API func CreateDeleteVirtualBorderRouterRequest() (request *DeleteVirtualBorderRouterRequest) { request = &DeleteVirtualBorderRouterRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteVirtualBorderRouter", "ecs", "openAPI") return } // CreateDeleteVirtualBorderRouterResponse creates a response to parse from DeleteVirtualBorderRouter response func CreateDeleteVirtualBorderRouterResponse() (response *DeleteVirtualBorderRouterResponse) { response = &DeleteVirtualBorderRouterResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/delete_vpc.go�����������0000664�0000000�0000000�00000007221�13771713062�0031221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteVpc invokes the ecs.DeleteVpc API synchronously // api document: https://help.aliyun.com/api/ecs/deletevpc.html func (client *Client) DeleteVpc(request *DeleteVpcRequest) (response *DeleteVpcResponse, err error) { response = CreateDeleteVpcResponse() err = client.DoAction(request, response) return } // DeleteVpcWithChan invokes the ecs.DeleteVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/deletevpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVpcWithChan(request *DeleteVpcRequest) (<-chan *DeleteVpcResponse, <-chan error) { responseChan := make(chan *DeleteVpcResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteVpc(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteVpcWithCallback invokes the ecs.DeleteVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/deletevpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVpcWithCallback(request *DeleteVpcRequest, callback func(response *DeleteVpcResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteVpcResponse var err error defer close(result) response, err = client.DeleteVpc(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteVpcRequest is the request struct for api DeleteVpc type DeleteVpcRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VpcId string `position:"Query" name:"VpcId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DeleteVpcResponse is the response struct for api DeleteVpc type DeleteVpcResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteVpcRequest creates a request to invoke DeleteVpc API func CreateDeleteVpcRequest() (request *DeleteVpcRequest) { request = &DeleteVpcRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DeleteVpc", "ecs", "openAPI") return } // CreateDeleteVpcResponse creates a response to parse from DeleteVpc response func CreateDeleteVpcResponse() (response *DeleteVpcResponse) { response = &DeleteVpcResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_access_points.go���������������������������������������������������������������������������0000664�0000000�0000000�00000011467�13771713062�0033534�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeAccessPoints invokes the ecs.DescribeAccessPoints API synchronously // api document: https://help.aliyun.com/api/ecs/describeaccesspoints.html func (client *Client) DescribeAccessPoints(request *DescribeAccessPointsRequest) (response *DescribeAccessPointsResponse, err error) { response = CreateDescribeAccessPointsResponse() err = client.DoAction(request, response) return } // DescribeAccessPointsWithChan invokes the ecs.DescribeAccessPoints API asynchronously // api document: https://help.aliyun.com/api/ecs/describeaccesspoints.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAccessPointsWithChan(request *DescribeAccessPointsRequest) (<-chan *DescribeAccessPointsResponse, <-chan error) { responseChan := make(chan *DescribeAccessPointsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeAccessPoints(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeAccessPointsWithCallback invokes the ecs.DescribeAccessPoints API asynchronously // api document: https://help.aliyun.com/api/ecs/describeaccesspoints.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAccessPointsWithCallback(request *DescribeAccessPointsRequest, callback func(response *DescribeAccessPointsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeAccessPointsResponse var err error defer close(result) response, err = client.DescribeAccessPoints(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeAccessPointsRequest is the request struct for api DescribeAccessPoints type DescribeAccessPointsRequest struct { *requests.RpcRequest Filter *[]DescribeAccessPointsFilter `position:"Query" name:"Filter" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Type string `position:"Query" name:"Type"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeAccessPointsFilter is a repeated param struct in DescribeAccessPointsRequest type DescribeAccessPointsFilter struct { Value *[]string `name:"Value" type:"Repeated"` Key string `name:"Key"` } // DescribeAccessPointsResponse is the response struct for api DescribeAccessPoints type DescribeAccessPointsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` TotalCount int `json:"TotalCount" xml:"TotalCount"` AccessPointSet AccessPointSet `json:"AccessPointSet" xml:"AccessPointSet"` } // CreateDescribeAccessPointsRequest creates a request to invoke DescribeAccessPoints API func CreateDescribeAccessPointsRequest() (request *DescribeAccessPointsRequest) { request = &DescribeAccessPointsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAccessPoints", "ecs", "openAPI") return } // CreateDescribeAccessPointsResponse creates a response to parse from DescribeAccessPoints response func CreateDescribeAccessPointsResponse() (response *DescribeAccessPointsResponse) { response = &DescribeAccessPointsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_account_attributes.go����������������������������������������������������������������������0000664�0000000�0000000�00000010647�13771713062�0034600�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeAccountAttributes invokes the ecs.DescribeAccountAttributes API synchronously // api document: https://help.aliyun.com/api/ecs/describeaccountattributes.html func (client *Client) DescribeAccountAttributes(request *DescribeAccountAttributesRequest) (response *DescribeAccountAttributesResponse, err error) { response = CreateDescribeAccountAttributesResponse() err = client.DoAction(request, response) return } // DescribeAccountAttributesWithChan invokes the ecs.DescribeAccountAttributes API asynchronously // api document: https://help.aliyun.com/api/ecs/describeaccountattributes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAccountAttributesWithChan(request *DescribeAccountAttributesRequest) (<-chan *DescribeAccountAttributesResponse, <-chan error) { responseChan := make(chan *DescribeAccountAttributesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeAccountAttributes(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeAccountAttributesWithCallback invokes the ecs.DescribeAccountAttributes API asynchronously // api document: https://help.aliyun.com/api/ecs/describeaccountattributes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAccountAttributesWithCallback(request *DescribeAccountAttributesRequest, callback func(response *DescribeAccountAttributesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeAccountAttributesResponse var err error defer close(result) response, err = client.DescribeAccountAttributes(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeAccountAttributesRequest is the request struct for api DescribeAccountAttributes type DescribeAccountAttributesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` AttributeName *[]string `position:"Query" name:"AttributeName" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ZoneId string `position:"Query" name:"ZoneId"` } // DescribeAccountAttributesResponse is the response struct for api DescribeAccountAttributes type DescribeAccountAttributesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AccountAttributeItems AccountAttributeItems `json:"AccountAttributeItems" xml:"AccountAttributeItems"` } // CreateDescribeAccountAttributesRequest creates a request to invoke DescribeAccountAttributes API func CreateDescribeAccountAttributesRequest() (request *DescribeAccountAttributesRequest) { request = &DescribeAccountAttributesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAccountAttributes", "ecs", "openAPI") return } // CreateDescribeAccountAttributesResponse creates a response to parse from DescribeAccountAttributes response func CreateDescribeAccountAttributesResponse() (response *DescribeAccountAttributesResponse) { response = &DescribeAccountAttributesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������describe_auto_snapshot_policy_ex.go�����������������������������������������������������������������0000664�0000000�0000000�00000011627�13771713062�0035637�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeAutoSnapshotPolicyEx invokes the ecs.DescribeAutoSnapshotPolicyEx API synchronously // api document: https://help.aliyun.com/api/ecs/describeautosnapshotpolicyex.html func (client *Client) DescribeAutoSnapshotPolicyEx(request *DescribeAutoSnapshotPolicyExRequest) (response *DescribeAutoSnapshotPolicyExResponse, err error) { response = CreateDescribeAutoSnapshotPolicyExResponse() err = client.DoAction(request, response) return } // DescribeAutoSnapshotPolicyExWithChan invokes the ecs.DescribeAutoSnapshotPolicyEx API asynchronously // api document: https://help.aliyun.com/api/ecs/describeautosnapshotpolicyex.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAutoSnapshotPolicyExWithChan(request *DescribeAutoSnapshotPolicyExRequest) (<-chan *DescribeAutoSnapshotPolicyExResponse, <-chan error) { responseChan := make(chan *DescribeAutoSnapshotPolicyExResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeAutoSnapshotPolicyEx(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeAutoSnapshotPolicyExWithCallback invokes the ecs.DescribeAutoSnapshotPolicyEx API asynchronously // api document: https://help.aliyun.com/api/ecs/describeautosnapshotpolicyex.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAutoSnapshotPolicyExWithCallback(request *DescribeAutoSnapshotPolicyExRequest, callback func(response *DescribeAutoSnapshotPolicyExResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeAutoSnapshotPolicyExResponse var err error defer close(result) response, err = client.DescribeAutoSnapshotPolicyEx(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeAutoSnapshotPolicyExRequest is the request struct for api DescribeAutoSnapshotPolicyEx type DescribeAutoSnapshotPolicyExRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` AutoSnapshotPolicyId string `position:"Query" name:"AutoSnapshotPolicyId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeAutoSnapshotPolicyExResponse is the response struct for api DescribeAutoSnapshotPolicyEx type DescribeAutoSnapshotPolicyExResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` AutoSnapshotPolicies AutoSnapshotPolicies `json:"AutoSnapshotPolicies" xml:"AutoSnapshotPolicies"` } // CreateDescribeAutoSnapshotPolicyExRequest creates a request to invoke DescribeAutoSnapshotPolicyEx API func CreateDescribeAutoSnapshotPolicyExRequest() (request *DescribeAutoSnapshotPolicyExRequest) { request = &DescribeAutoSnapshotPolicyExRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAutoSnapshotPolicyEx", "ecs", "openAPI") return } // CreateDescribeAutoSnapshotPolicyExResponse creates a response to parse from DescribeAutoSnapshotPolicyEx response func CreateDescribeAutoSnapshotPolicyExResponse() (response *DescribeAutoSnapshotPolicyExResponse) { response = &DescribeAutoSnapshotPolicyExResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������describe_available_resource.go����������������������������������������������������������������������0000664�0000000�0000000�00000012637�13771713062�0034526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeAvailableResource invokes the ecs.DescribeAvailableResource API synchronously // api document: https://help.aliyun.com/api/ecs/describeavailableresource.html func (client *Client) DescribeAvailableResource(request *DescribeAvailableResourceRequest) (response *DescribeAvailableResourceResponse, err error) { response = CreateDescribeAvailableResourceResponse() err = client.DoAction(request, response) return } // DescribeAvailableResourceWithChan invokes the ecs.DescribeAvailableResource API asynchronously // api document: https://help.aliyun.com/api/ecs/describeavailableresource.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAvailableResourceWithChan(request *DescribeAvailableResourceRequest) (<-chan *DescribeAvailableResourceResponse, <-chan error) { responseChan := make(chan *DescribeAvailableResourceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeAvailableResource(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeAvailableResourceWithCallback invokes the ecs.DescribeAvailableResource API asynchronously // api document: https://help.aliyun.com/api/ecs/describeavailableresource.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeAvailableResourceWithCallback(request *DescribeAvailableResourceRequest, callback func(response *DescribeAvailableResourceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeAvailableResourceResponse var err error defer close(result) response, err = client.DescribeAvailableResource(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeAvailableResourceRequest is the request struct for api DescribeAvailableResource type DescribeAvailableResourceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Memory requests.Float `position:"Query" name:"Memory"` IoOptimized string `position:"Query" name:"IoOptimized"` DataDiskCategory string `position:"Query" name:"DataDiskCategory"` Cores requests.Integer `position:"Query" name:"Cores"` SystemDiskCategory string `position:"Query" name:"SystemDiskCategory"` Scope string `position:"Query" name:"Scope"` InstanceType string `position:"Query" name:"InstanceType"` NetworkCategory string `position:"Query" name:"NetworkCategory"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DedicatedHostId string `position:"Query" name:"DedicatedHostId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` SpotStrategy string `position:"Query" name:"SpotStrategy"` DestinationResource string `position:"Query" name:"DestinationResource"` ZoneId string `position:"Query" name:"ZoneId"` } // DescribeAvailableResourceResponse is the response struct for api DescribeAvailableResource type DescribeAvailableResourceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AvailableZones AvailableZonesInDescribeAvailableResource `json:"AvailableZones" xml:"AvailableZones"` } // CreateDescribeAvailableResourceRequest creates a request to invoke DescribeAvailableResource API func CreateDescribeAvailableResourceRequest() (request *DescribeAvailableResourceRequest) { request = &DescribeAvailableResourceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeAvailableResource", "ecs", "openAPI") return } // CreateDescribeAvailableResourceResponse creates a response to parse from DescribeAvailableResource response func CreateDescribeAvailableResourceResponse() (response *DescribeAvailableResourceResponse) { response = &DescribeAvailableResourceResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������describe_bandwidth_limitation.go��������������������������������������������������������������������0000664�0000000�0000000�00000011346�13771713062�0035070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeBandwidthLimitation invokes the ecs.DescribeBandwidthLimitation API synchronously // api document: https://help.aliyun.com/api/ecs/describebandwidthlimitation.html func (client *Client) DescribeBandwidthLimitation(request *DescribeBandwidthLimitationRequest) (response *DescribeBandwidthLimitationResponse, err error) { response = CreateDescribeBandwidthLimitationResponse() err = client.DoAction(request, response) return } // DescribeBandwidthLimitationWithChan invokes the ecs.DescribeBandwidthLimitation API asynchronously // api document: https://help.aliyun.com/api/ecs/describebandwidthlimitation.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeBandwidthLimitationWithChan(request *DescribeBandwidthLimitationRequest) (<-chan *DescribeBandwidthLimitationResponse, <-chan error) { responseChan := make(chan *DescribeBandwidthLimitationResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeBandwidthLimitation(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeBandwidthLimitationWithCallback invokes the ecs.DescribeBandwidthLimitation API asynchronously // api document: https://help.aliyun.com/api/ecs/describebandwidthlimitation.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeBandwidthLimitationWithCallback(request *DescribeBandwidthLimitationRequest, callback func(response *DescribeBandwidthLimitationResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeBandwidthLimitationResponse var err error defer close(result) response, err = client.DescribeBandwidthLimitation(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeBandwidthLimitationRequest is the request struct for api DescribeBandwidthLimitation type DescribeBandwidthLimitationRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceType string `position:"Query" name:"InstanceType"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` ResourceId string `position:"Query" name:"ResourceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OperationType string `position:"Query" name:"OperationType"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` SpotStrategy string `position:"Query" name:"SpotStrategy"` } // DescribeBandwidthLimitationResponse is the response struct for api DescribeBandwidthLimitation type DescribeBandwidthLimitationResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Bandwidths Bandwidths `json:"Bandwidths" xml:"Bandwidths"` } // CreateDescribeBandwidthLimitationRequest creates a request to invoke DescribeBandwidthLimitation API func CreateDescribeBandwidthLimitationRequest() (request *DescribeBandwidthLimitationRequest) { request = &DescribeBandwidthLimitationRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeBandwidthLimitation", "ecs", "openAPI") return } // CreateDescribeBandwidthLimitationResponse creates a response to parse from DescribeBandwidthLimitation response func CreateDescribeBandwidthLimitationResponse() (response *DescribeBandwidthLimitationResponse) { response = &DescribeBandwidthLimitationResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_bandwidth_packages.go����������������������������������������������������������������������0000664�0000000�0000000�00000011507�13771713062�0034474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeBandwidthPackages invokes the ecs.DescribeBandwidthPackages API synchronously // api document: https://help.aliyun.com/api/ecs/describebandwidthpackages.html func (client *Client) DescribeBandwidthPackages(request *DescribeBandwidthPackagesRequest) (response *DescribeBandwidthPackagesResponse, err error) { response = CreateDescribeBandwidthPackagesResponse() err = client.DoAction(request, response) return } // DescribeBandwidthPackagesWithChan invokes the ecs.DescribeBandwidthPackages API asynchronously // api document: https://help.aliyun.com/api/ecs/describebandwidthpackages.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeBandwidthPackagesWithChan(request *DescribeBandwidthPackagesRequest) (<-chan *DescribeBandwidthPackagesResponse, <-chan error) { responseChan := make(chan *DescribeBandwidthPackagesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeBandwidthPackages(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeBandwidthPackagesWithCallback invokes the ecs.DescribeBandwidthPackages API asynchronously // api document: https://help.aliyun.com/api/ecs/describebandwidthpackages.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeBandwidthPackagesWithCallback(request *DescribeBandwidthPackagesRequest, callback func(response *DescribeBandwidthPackagesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeBandwidthPackagesResponse var err error defer close(result) response, err = client.DescribeBandwidthPackages(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeBandwidthPackagesRequest is the request struct for api DescribeBandwidthPackages type DescribeBandwidthPackagesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` NatGatewayId string `position:"Query" name:"NatGatewayId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeBandwidthPackagesResponse is the response struct for api DescribeBandwidthPackages type DescribeBandwidthPackagesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` BandwidthPackages BandwidthPackages `json:"BandwidthPackages" xml:"BandwidthPackages"` } // CreateDescribeBandwidthPackagesRequest creates a request to invoke DescribeBandwidthPackages API func CreateDescribeBandwidthPackagesRequest() (request *DescribeBandwidthPackagesRequest) { request = &DescribeBandwidthPackagesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeBandwidthPackages", "ecs", "openAPI") return } // CreateDescribeBandwidthPackagesResponse creates a response to parse from DescribeBandwidthPackages response func CreateDescribeBandwidthPackagesResponse() (response *DescribeBandwidthPackagesResponse) { response = &DescribeBandwidthPackagesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_classic_link_instances.go������������������������������������������������������������������0000664�0000000�0000000�00000011360�13771713062�0035374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeClassicLinkInstances invokes the ecs.DescribeClassicLinkInstances API synchronously // api document: https://help.aliyun.com/api/ecs/describeclassiclinkinstances.html func (client *Client) DescribeClassicLinkInstances(request *DescribeClassicLinkInstancesRequest) (response *DescribeClassicLinkInstancesResponse, err error) { response = CreateDescribeClassicLinkInstancesResponse() err = client.DoAction(request, response) return } // DescribeClassicLinkInstancesWithChan invokes the ecs.DescribeClassicLinkInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/describeclassiclinkinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeClassicLinkInstancesWithChan(request *DescribeClassicLinkInstancesRequest) (<-chan *DescribeClassicLinkInstancesResponse, <-chan error) { responseChan := make(chan *DescribeClassicLinkInstancesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeClassicLinkInstances(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeClassicLinkInstancesWithCallback invokes the ecs.DescribeClassicLinkInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/describeclassiclinkinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeClassicLinkInstancesWithCallback(request *DescribeClassicLinkInstancesRequest, callback func(response *DescribeClassicLinkInstancesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeClassicLinkInstancesResponse var err error defer close(result) response, err = client.DescribeClassicLinkInstances(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeClassicLinkInstancesRequest is the request struct for api DescribeClassicLinkInstances type DescribeClassicLinkInstancesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VpcId string `position:"Query" name:"VpcId"` PageSize string `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber string `position:"Query" name:"PageNumber"` } // DescribeClassicLinkInstancesResponse is the response struct for api DescribeClassicLinkInstances type DescribeClassicLinkInstancesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Links Links `json:"Links" xml:"Links"` } // CreateDescribeClassicLinkInstancesRequest creates a request to invoke DescribeClassicLinkInstances API func CreateDescribeClassicLinkInstancesRequest() (request *DescribeClassicLinkInstancesRequest) { request = &DescribeClassicLinkInstancesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeClassicLinkInstances", "ecs", "openAPI") return } // CreateDescribeClassicLinkInstancesResponse creates a response to parse from DescribeClassicLinkInstances response func CreateDescribeClassicLinkInstancesResponse() (response *DescribeClassicLinkInstancesResponse) { response = &DescribeClassicLinkInstancesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_cloud_assistant_status.go������������������������������������������������������������������0000664�0000000�0000000�00000011136�13771713062�0035472�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeCloudAssistantStatus invokes the ecs.DescribeCloudAssistantStatus API synchronously // api document: https://help.aliyun.com/api/ecs/describecloudassistantstatus.html func (client *Client) DescribeCloudAssistantStatus(request *DescribeCloudAssistantStatusRequest) (response *DescribeCloudAssistantStatusResponse, err error) { response = CreateDescribeCloudAssistantStatusResponse() err = client.DoAction(request, response) return } // DescribeCloudAssistantStatusWithChan invokes the ecs.DescribeCloudAssistantStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describecloudassistantstatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeCloudAssistantStatusWithChan(request *DescribeCloudAssistantStatusRequest) (<-chan *DescribeCloudAssistantStatusResponse, <-chan error) { responseChan := make(chan *DescribeCloudAssistantStatusResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeCloudAssistantStatus(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeCloudAssistantStatusWithCallback invokes the ecs.DescribeCloudAssistantStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describecloudassistantstatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeCloudAssistantStatusWithCallback(request *DescribeCloudAssistantStatusRequest, callback func(response *DescribeCloudAssistantStatusResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeCloudAssistantStatusResponse var err error defer close(result) response, err = client.DescribeCloudAssistantStatus(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeCloudAssistantStatusRequest is the request struct for api DescribeCloudAssistantStatus type DescribeCloudAssistantStatusRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` } // DescribeCloudAssistantStatusResponse is the response struct for api DescribeCloudAssistantStatus type DescribeCloudAssistantStatusResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceCloudAssistantStatusSet InstanceCloudAssistantStatusSet `json:"InstanceCloudAssistantStatusSet" xml:"InstanceCloudAssistantStatusSet"` } // CreateDescribeCloudAssistantStatusRequest creates a request to invoke DescribeCloudAssistantStatus API func CreateDescribeCloudAssistantStatusRequest() (request *DescribeCloudAssistantStatusRequest) { request = &DescribeCloudAssistantStatusRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeCloudAssistantStatus", "ecs", "openAPI") return } // CreateDescribeCloudAssistantStatusResponse creates a response to parse from DescribeCloudAssistantStatus response func CreateDescribeCloudAssistantStatusResponse() (response *DescribeCloudAssistantStatusResponse) { response = &DescribeCloudAssistantStatusResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_clusters.go����0000664�0000000�0000000�00000007631�13771713062�0032620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeClusters invokes the ecs.DescribeClusters API synchronously // api document: https://help.aliyun.com/api/ecs/describeclusters.html func (client *Client) DescribeClusters(request *DescribeClustersRequest) (response *DescribeClustersResponse, err error) { response = CreateDescribeClustersResponse() err = client.DoAction(request, response) return } // DescribeClustersWithChan invokes the ecs.DescribeClusters API asynchronously // api document: https://help.aliyun.com/api/ecs/describeclusters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeClustersWithChan(request *DescribeClustersRequest) (<-chan *DescribeClustersResponse, <-chan error) { responseChan := make(chan *DescribeClustersResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeClusters(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeClustersWithCallback invokes the ecs.DescribeClusters API asynchronously // api document: https://help.aliyun.com/api/ecs/describeclusters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeClustersWithCallback(request *DescribeClustersRequest, callback func(response *DescribeClustersResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeClustersResponse var err error defer close(result) response, err = client.DescribeClusters(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeClustersRequest is the request struct for api DescribeClusters type DescribeClustersRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeClustersResponse is the response struct for api DescribeClusters type DescribeClustersResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Clusters Clusters `json:"Clusters" xml:"Clusters"` } // CreateDescribeClustersRequest creates a request to invoke DescribeClusters API func CreateDescribeClustersRequest() (request *DescribeClustersRequest) { request = &DescribeClustersRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeClusters", "ecs", "openAPI") return } // CreateDescribeClustersResponse creates a response to parse from DescribeClusters response func CreateDescribeClustersResponse() (response *DescribeClustersResponse) { response = &DescribeClustersResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_commands.go����0000664�0000000�0000000�00000010777�13771713062�0032562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeCommands invokes the ecs.DescribeCommands API synchronously // api document: https://help.aliyun.com/api/ecs/describecommands.html func (client *Client) DescribeCommands(request *DescribeCommandsRequest) (response *DescribeCommandsResponse, err error) { response = CreateDescribeCommandsResponse() err = client.DoAction(request, response) return } // DescribeCommandsWithChan invokes the ecs.DescribeCommands API asynchronously // api document: https://help.aliyun.com/api/ecs/describecommands.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeCommandsWithChan(request *DescribeCommandsRequest) (<-chan *DescribeCommandsResponse, <-chan error) { responseChan := make(chan *DescribeCommandsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeCommands(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeCommandsWithCallback invokes the ecs.DescribeCommands API asynchronously // api document: https://help.aliyun.com/api/ecs/describecommands.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeCommandsWithCallback(request *DescribeCommandsRequest, callback func(response *DescribeCommandsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeCommandsResponse var err error defer close(result) response, err = client.DescribeCommands(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeCommandsRequest is the request struct for api DescribeCommands type DescribeCommandsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Description string `position:"Query" name:"Description"` Type string `position:"Query" name:"Type"` CommandId string `position:"Query" name:"CommandId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Name string `position:"Query" name:"Name"` } // DescribeCommandsResponse is the response struct for api DescribeCommands type DescribeCommandsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Commands Commands `json:"Commands" xml:"Commands"` } // CreateDescribeCommandsRequest creates a request to invoke DescribeCommands API func CreateDescribeCommandsRequest() (request *DescribeCommandsRequest) { request = &DescribeCommandsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeCommands", "ecs", "openAPI") return } // CreateDescribeCommandsResponse creates a response to parse from DescribeCommands response func CreateDescribeCommandsResponse() (response *DescribeCommandsResponse) { response = &DescribeCommandsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �describe_dedicated_host_auto_renew.go���������������������������������������������������������������0000664�0000000�0000000�00000011221�13771713062�0036056�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDedicatedHostAutoRenew invokes the ecs.DescribeDedicatedHostAutoRenew API synchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhostautorenew.html func (client *Client) DescribeDedicatedHostAutoRenew(request *DescribeDedicatedHostAutoRenewRequest) (response *DescribeDedicatedHostAutoRenewResponse, err error) { response = CreateDescribeDedicatedHostAutoRenewResponse() err = client.DoAction(request, response) return } // DescribeDedicatedHostAutoRenewWithChan invokes the ecs.DescribeDedicatedHostAutoRenew API asynchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhostautorenew.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDedicatedHostAutoRenewWithChan(request *DescribeDedicatedHostAutoRenewRequest) (<-chan *DescribeDedicatedHostAutoRenewResponse, <-chan error) { responseChan := make(chan *DescribeDedicatedHostAutoRenewResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDedicatedHostAutoRenew(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDedicatedHostAutoRenewWithCallback invokes the ecs.DescribeDedicatedHostAutoRenew API asynchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhostautorenew.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDedicatedHostAutoRenewWithCallback(request *DescribeDedicatedHostAutoRenewRequest, callback func(response *DescribeDedicatedHostAutoRenewResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDedicatedHostAutoRenewResponse var err error defer close(result) response, err = client.DescribeDedicatedHostAutoRenew(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDedicatedHostAutoRenewRequest is the request struct for api DescribeDedicatedHostAutoRenew type DescribeDedicatedHostAutoRenewRequest struct { *requests.RpcRequest DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeDedicatedHostAutoRenewResponse is the response struct for api DescribeDedicatedHostAutoRenew type DescribeDedicatedHostAutoRenewResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` DedicatedHostRenewAttributes DedicatedHostRenewAttributes `json:"DedicatedHostRenewAttributes" xml:"DedicatedHostRenewAttributes"` } // CreateDescribeDedicatedHostAutoRenewRequest creates a request to invoke DescribeDedicatedHostAutoRenew API func CreateDescribeDedicatedHostAutoRenewRequest() (request *DescribeDedicatedHostAutoRenewRequest) { request = &DescribeDedicatedHostAutoRenewRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDedicatedHostAutoRenew", "ecs", "openAPI") return } // CreateDescribeDedicatedHostAutoRenewResponse creates a response to parse from DescribeDedicatedHostAutoRenew response func CreateDescribeDedicatedHostAutoRenewResponse() (response *DescribeDedicatedHostAutoRenewResponse) { response = &DescribeDedicatedHostAutoRenewResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_dedicated_host_types.go��������������������������������������������������������������������0000664�0000000�0000000�00000011075�13771713062�0035061�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDedicatedHostTypes invokes the ecs.DescribeDedicatedHostTypes API synchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhosttypes.html func (client *Client) DescribeDedicatedHostTypes(request *DescribeDedicatedHostTypesRequest) (response *DescribeDedicatedHostTypesResponse, err error) { response = CreateDescribeDedicatedHostTypesResponse() err = client.DoAction(request, response) return } // DescribeDedicatedHostTypesWithChan invokes the ecs.DescribeDedicatedHostTypes API asynchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhosttypes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDedicatedHostTypesWithChan(request *DescribeDedicatedHostTypesRequest) (<-chan *DescribeDedicatedHostTypesResponse, <-chan error) { responseChan := make(chan *DescribeDedicatedHostTypesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDedicatedHostTypes(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDedicatedHostTypesWithCallback invokes the ecs.DescribeDedicatedHostTypes API asynchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhosttypes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDedicatedHostTypesWithCallback(request *DescribeDedicatedHostTypesRequest, callback func(response *DescribeDedicatedHostTypesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDedicatedHostTypesResponse var err error defer close(result) response, err = client.DescribeDedicatedHostTypes(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDedicatedHostTypesRequest is the request struct for api DescribeDedicatedHostTypes type DescribeDedicatedHostTypesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SupportedInstanceTypeFamily string `position:"Query" name:"SupportedInstanceTypeFamily"` DedicatedHostType string `position:"Query" name:"DedicatedHostType"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeDedicatedHostTypesResponse is the response struct for api DescribeDedicatedHostTypes type DescribeDedicatedHostTypesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` DedicatedHostTypes DedicatedHostTypes `json:"DedicatedHostTypes" xml:"DedicatedHostTypes"` } // CreateDescribeDedicatedHostTypesRequest creates a request to invoke DescribeDedicatedHostTypes API func CreateDescribeDedicatedHostTypesRequest() (request *DescribeDedicatedHostTypesRequest) { request = &DescribeDedicatedHostTypesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDedicatedHostTypes", "ecs", "openAPI") return } // CreateDescribeDedicatedHostTypesResponse creates a response to parse from DescribeDedicatedHostTypes response func CreateDescribeDedicatedHostTypesResponse() (response *DescribeDedicatedHostTypesResponse) { response = &DescribeDedicatedHostTypesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_dedicated_hosts.go�������������������������������������������������������������������������0000664�0000000�0000000�00000012750�13771713062�0034021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDedicatedHosts invokes the ecs.DescribeDedicatedHosts API synchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhosts.html func (client *Client) DescribeDedicatedHosts(request *DescribeDedicatedHostsRequest) (response *DescribeDedicatedHostsResponse, err error) { response = CreateDescribeDedicatedHostsResponse() err = client.DoAction(request, response) return } // DescribeDedicatedHostsWithChan invokes the ecs.DescribeDedicatedHosts API asynchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhosts.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDedicatedHostsWithChan(request *DescribeDedicatedHostsRequest) (<-chan *DescribeDedicatedHostsResponse, <-chan error) { responseChan := make(chan *DescribeDedicatedHostsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDedicatedHosts(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDedicatedHostsWithCallback invokes the ecs.DescribeDedicatedHosts API asynchronously // api document: https://help.aliyun.com/api/ecs/describededicatedhosts.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDedicatedHostsWithCallback(request *DescribeDedicatedHostsRequest, callback func(response *DescribeDedicatedHostsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDedicatedHostsResponse var err error defer close(result) response, err = client.DescribeDedicatedHosts(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDedicatedHostsRequest is the request struct for api DescribeDedicatedHosts type DescribeDedicatedHostsRequest struct { *requests.RpcRequest DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` DedicatedHostName string `position:"Query" name:"DedicatedHostName"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` LockReason string `position:"Query" name:"LockReason"` PageSize requests.Integer `position:"Query" name:"PageSize"` ZoneId string `position:"Query" name:"ZoneId"` DedicatedHostType string `position:"Query" name:"DedicatedHostType"` Tag *[]DescribeDedicatedHostsTag `position:"Query" name:"Tag" type:"Repeated"` Status string `position:"Query" name:"Status"` } // DescribeDedicatedHostsTag is a repeated param struct in DescribeDedicatedHostsRequest type DescribeDedicatedHostsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeDedicatedHostsResponse is the response struct for api DescribeDedicatedHosts type DescribeDedicatedHostsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` DedicatedHosts DedicatedHosts `json:"DedicatedHosts" xml:"DedicatedHosts"` } // CreateDescribeDedicatedHostsRequest creates a request to invoke DescribeDedicatedHosts API func CreateDescribeDedicatedHostsRequest() (request *DescribeDedicatedHostsRequest) { request = &DescribeDedicatedHostsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDedicatedHosts", "ecs", "openAPI") return } // CreateDescribeDedicatedHostsResponse creates a response to parse from DescribeDedicatedHosts response func CreateDescribeDedicatedHostsResponse() (response *DescribeDedicatedHostsResponse) { response = &DescribeDedicatedHostsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_demands.go�����0000664�0000000�0000000�00000012004�13771713062�0032355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDemands invokes the ecs.DescribeDemands API synchronously // api document: https://help.aliyun.com/api/ecs/describedemands.html func (client *Client) DescribeDemands(request *DescribeDemandsRequest) (response *DescribeDemandsResponse, err error) { response = CreateDescribeDemandsResponse() err = client.DoAction(request, response) return } // DescribeDemandsWithChan invokes the ecs.DescribeDemands API asynchronously // api document: https://help.aliyun.com/api/ecs/describedemands.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDemandsWithChan(request *DescribeDemandsRequest) (<-chan *DescribeDemandsResponse, <-chan error) { responseChan := make(chan *DescribeDemandsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDemands(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDemandsWithCallback invokes the ecs.DescribeDemands API asynchronously // api document: https://help.aliyun.com/api/ecs/describedemands.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDemandsWithCallback(request *DescribeDemandsRequest, callback func(response *DescribeDemandsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDemandsResponse var err error defer close(result) response, err = client.DescribeDemands(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDemandsRequest is the request struct for api DescribeDemands type DescribeDemandsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` InstanceType string `position:"Query" name:"InstanceType"` Tag *[]DescribeDemandsTag `position:"Query" name:"Tag" type:"Repeated"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InstanceTypeFamily string `position:"Query" name:"InstanceTypeFamily"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DemandStatus *[]string `position:"Query" name:"DemandStatus" type:"Repeated"` ZoneId string `position:"Query" name:"ZoneId"` } // DescribeDemandsTag is a repeated param struct in DescribeDemandsRequest type DescribeDemandsTag struct { Key string `name:"Key"` Value string `name:"Value"` } // DescribeDemandsResponse is the response struct for api DescribeDemands type DescribeDemandsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` RegionId string `json:"RegionId" xml:"RegionId"` Demands Demands `json:"Demands" xml:"Demands"` } // CreateDescribeDemandsRequest creates a request to invoke DescribeDemands API func CreateDescribeDemandsRequest() (request *DescribeDemandsRequest) { request = &DescribeDemandsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDemands", "ecs", "openAPI") return } // CreateDescribeDemandsResponse creates a response to parse from DescribeDemands response func CreateDescribeDemandsResponse() (response *DescribeDemandsResponse) { response = &DescribeDemandsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_deployment_sets.go�������������������������������������������������������������������������0000664�0000000�0000000�00000012032�13771713062�0034102�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDeploymentSets invokes the ecs.DescribeDeploymentSets API synchronously // api document: https://help.aliyun.com/api/ecs/describedeploymentsets.html func (client *Client) DescribeDeploymentSets(request *DescribeDeploymentSetsRequest) (response *DescribeDeploymentSetsResponse, err error) { response = CreateDescribeDeploymentSetsResponse() err = client.DoAction(request, response) return } // DescribeDeploymentSetsWithChan invokes the ecs.DescribeDeploymentSets API asynchronously // api document: https://help.aliyun.com/api/ecs/describedeploymentsets.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDeploymentSetsWithChan(request *DescribeDeploymentSetsRequest) (<-chan *DescribeDeploymentSetsResponse, <-chan error) { responseChan := make(chan *DescribeDeploymentSetsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDeploymentSets(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDeploymentSetsWithCallback invokes the ecs.DescribeDeploymentSets API asynchronously // api document: https://help.aliyun.com/api/ecs/describedeploymentsets.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDeploymentSetsWithCallback(request *DescribeDeploymentSetsRequest, callback func(response *DescribeDeploymentSetsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDeploymentSetsResponse var err error defer close(result) response, err = client.DescribeDeploymentSets(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDeploymentSetsRequest is the request struct for api DescribeDeploymentSets type DescribeDeploymentSetsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` NetworkType string `position:"Query" name:"NetworkType"` DeploymentSetName string `position:"Query" name:"DeploymentSetName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` DeploymentSetIds string `position:"Query" name:"DeploymentSetIds"` Granularity string `position:"Query" name:"Granularity"` Domain string `position:"Query" name:"Domain"` PageSize requests.Integer `position:"Query" name:"PageSize"` Strategy string `position:"Query" name:"Strategy"` } // DescribeDeploymentSetsResponse is the response struct for api DescribeDeploymentSets type DescribeDeploymentSetsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` DeploymentSets DeploymentSets `json:"DeploymentSets" xml:"DeploymentSets"` } // CreateDescribeDeploymentSetsRequest creates a request to invoke DescribeDeploymentSets API func CreateDescribeDeploymentSetsRequest() (request *DescribeDeploymentSetsRequest) { request = &DescribeDeploymentSetsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDeploymentSets", "ecs", "openAPI") return } // CreateDescribeDeploymentSetsResponse creates a response to parse from DescribeDeploymentSets response func CreateDescribeDeploymentSetsResponse() (response *DescribeDeploymentSetsResponse) { response = &DescribeDeploymentSetsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_disk_monitor_data.go�����������������������������������������������������������������������0000664�0000000�0000000�00000011156�13771713062�0034364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDiskMonitorData invokes the ecs.DescribeDiskMonitorData API synchronously // api document: https://help.aliyun.com/api/ecs/describediskmonitordata.html func (client *Client) DescribeDiskMonitorData(request *DescribeDiskMonitorDataRequest) (response *DescribeDiskMonitorDataResponse, err error) { response = CreateDescribeDiskMonitorDataResponse() err = client.DoAction(request, response) return } // DescribeDiskMonitorDataWithChan invokes the ecs.DescribeDiskMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describediskmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDiskMonitorDataWithChan(request *DescribeDiskMonitorDataRequest) (<-chan *DescribeDiskMonitorDataResponse, <-chan error) { responseChan := make(chan *DescribeDiskMonitorDataResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDiskMonitorData(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDiskMonitorDataWithCallback invokes the ecs.DescribeDiskMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describediskmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDiskMonitorDataWithCallback(request *DescribeDiskMonitorDataRequest, callback func(response *DescribeDiskMonitorDataResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDiskMonitorDataResponse var err error defer close(result) response, err = client.DescribeDiskMonitorData(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDiskMonitorDataRequest is the request struct for api DescribeDiskMonitorData type DescribeDiskMonitorDataRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` StartTime string `position:"Query" name:"StartTime"` DiskId string `position:"Query" name:"DiskId"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeDiskMonitorDataResponse is the response struct for api DescribeDiskMonitorData type DescribeDiskMonitorDataResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` MonitorData MonitorDataInDescribeDiskMonitorData `json:"MonitorData" xml:"MonitorData"` } // CreateDescribeDiskMonitorDataRequest creates a request to invoke DescribeDiskMonitorData API func CreateDescribeDiskMonitorDataRequest() (request *DescribeDiskMonitorDataRequest) { request = &DescribeDiskMonitorDataRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDiskMonitorData", "ecs", "openAPI") return } // CreateDescribeDiskMonitorDataResponse creates a response to parse from DescribeDiskMonitorData response func CreateDescribeDiskMonitorDataResponse() (response *DescribeDiskMonitorDataResponse) { response = &DescribeDiskMonitorDataResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_disks.go�������0000664�0000000�0000000�00000015333�13771713062�0032067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDisks invokes the ecs.DescribeDisks API synchronously // api document: https://help.aliyun.com/api/ecs/describedisks.html func (client *Client) DescribeDisks(request *DescribeDisksRequest) (response *DescribeDisksResponse, err error) { response = CreateDescribeDisksResponse() err = client.DoAction(request, response) return } // DescribeDisksWithChan invokes the ecs.DescribeDisks API asynchronously // api document: https://help.aliyun.com/api/ecs/describedisks.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDisksWithChan(request *DescribeDisksRequest) (<-chan *DescribeDisksResponse, <-chan error) { responseChan := make(chan *DescribeDisksResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDisks(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDisksWithCallback invokes the ecs.DescribeDisks API asynchronously // api document: https://help.aliyun.com/api/ecs/describedisks.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDisksWithCallback(request *DescribeDisksRequest, callback func(response *DescribeDisksResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDisksResponse var err error defer close(result) response, err = client.DescribeDisks(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDisksRequest is the request struct for api DescribeDisks type DescribeDisksRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotId string `position:"Query" name:"SnapshotId"` Filter2Value string `position:"Query" name:"Filter.2.Value"` AutoSnapshotPolicyId string `position:"Query" name:"AutoSnapshotPolicyId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` DiskName string `position:"Query" name:"DiskName"` DeleteAutoSnapshot requests.Boolean `position:"Query" name:"DeleteAutoSnapshot"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` DiskChargeType string `position:"Query" name:"DiskChargeType"` LockReason string `position:"Query" name:"LockReason"` Filter1Key string `position:"Query" name:"Filter.1.Key"` PageSize requests.Integer `position:"Query" name:"PageSize"` DiskIds string `position:"Query" name:"DiskIds"` Tag *[]DescribeDisksTag `position:"Query" name:"Tag" type:"Repeated"` DeleteWithInstance requests.Boolean `position:"Query" name:"DeleteWithInstance"` EnableAutoSnapshot requests.Boolean `position:"Query" name:"EnableAutoSnapshot"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Filter1Value string `position:"Query" name:"Filter.1.Value"` Portable requests.Boolean `position:"Query" name:"Portable"` EnableAutomatedSnapshotPolicy requests.Boolean `position:"Query" name:"EnableAutomatedSnapshotPolicy"` Filter2Key string `position:"Query" name:"Filter.2.Key"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DiskType string `position:"Query" name:"DiskType"` AdditionalAttributes *[]string `position:"Query" name:"AdditionalAttributes" type:"Repeated"` EnableShared requests.Boolean `position:"Query" name:"EnableShared"` InstanceId string `position:"Query" name:"InstanceId"` Encrypted requests.Boolean `position:"Query" name:"Encrypted"` ZoneId string `position:"Query" name:"ZoneId"` Category string `position:"Query" name:"Category"` KMSKeyId string `position:"Query" name:"KMSKeyId"` Status string `position:"Query" name:"Status"` } // DescribeDisksTag is a repeated param struct in DescribeDisksRequest type DescribeDisksTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeDisksResponse is the response struct for api DescribeDisks type DescribeDisksResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Disks Disks `json:"Disks" xml:"Disks"` } // CreateDescribeDisksRequest creates a request to invoke DescribeDisks API func CreateDescribeDisksRequest() (request *DescribeDisksRequest) { request = &DescribeDisksRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDisks", "ecs", "openAPI") return } // CreateDescribeDisksResponse creates a response to parse from DescribeDisks response func CreateDescribeDisksResponse() (response *DescribeDisksResponse) { response = &DescribeDisksResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_disks_full_status.go�����������������������������������������������������������������������0000664�0000000�0000000�00000012211�13771713062�0034425�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeDisksFullStatus invokes the ecs.DescribeDisksFullStatus API synchronously // api document: https://help.aliyun.com/api/ecs/describedisksfullstatus.html func (client *Client) DescribeDisksFullStatus(request *DescribeDisksFullStatusRequest) (response *DescribeDisksFullStatusResponse, err error) { response = CreateDescribeDisksFullStatusResponse() err = client.DoAction(request, response) return } // DescribeDisksFullStatusWithChan invokes the ecs.DescribeDisksFullStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describedisksfullstatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDisksFullStatusWithChan(request *DescribeDisksFullStatusRequest) (<-chan *DescribeDisksFullStatusResponse, <-chan error) { responseChan := make(chan *DescribeDisksFullStatusResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeDisksFullStatus(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeDisksFullStatusWithCallback invokes the ecs.DescribeDisksFullStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describedisksfullstatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeDisksFullStatusWithCallback(request *DescribeDisksFullStatusRequest, callback func(response *DescribeDisksFullStatusResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeDisksFullStatusResponse var err error defer close(result) response, err = client.DescribeDisksFullStatus(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeDisksFullStatusRequest is the request struct for api DescribeDisksFullStatus type DescribeDisksFullStatusRequest struct { *requests.RpcRequest EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` EventTimeStart string `position:"Query" name:"EventTime.Start"` PageSize requests.Integer `position:"Query" name:"PageSize"` DiskId *[]string `position:"Query" name:"DiskId" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` EventTimeEnd string `position:"Query" name:"EventTime.End"` HealthStatus string `position:"Query" name:"HealthStatus"` EventType string `position:"Query" name:"EventType"` Status string `position:"Query" name:"Status"` } // DescribeDisksFullStatusResponse is the response struct for api DescribeDisksFullStatus type DescribeDisksFullStatusResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` DiskFullStatusSet DiskFullStatusSet `json:"DiskFullStatusSet" xml:"DiskFullStatusSet"` } // CreateDescribeDisksFullStatusRequest creates a request to invoke DescribeDisksFullStatus API func CreateDescribeDisksFullStatusRequest() (request *DescribeDisksFullStatusRequest) { request = &DescribeDisksFullStatusRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeDisksFullStatus", "ecs", "openAPI") return } // CreateDescribeDisksFullStatusResponse creates a response to parse from DescribeDisksFullStatus response func CreateDescribeDisksFullStatusResponse() (response *DescribeDisksFullStatusResponse) { response = &DescribeDisksFullStatusResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_eip_addresses.go���������������������������������������������������������������������������0000664�0000000�0000000�00000012556�13771713062�0033511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeEipAddresses invokes the ecs.DescribeEipAddresses API synchronously // api document: https://help.aliyun.com/api/ecs/describeeipaddresses.html func (client *Client) DescribeEipAddresses(request *DescribeEipAddressesRequest) (response *DescribeEipAddressesResponse, err error) { response = CreateDescribeEipAddressesResponse() err = client.DoAction(request, response) return } // DescribeEipAddressesWithChan invokes the ecs.DescribeEipAddresses API asynchronously // api document: https://help.aliyun.com/api/ecs/describeeipaddresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeEipAddressesWithChan(request *DescribeEipAddressesRequest) (<-chan *DescribeEipAddressesResponse, <-chan error) { responseChan := make(chan *DescribeEipAddressesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeEipAddresses(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeEipAddressesWithCallback invokes the ecs.DescribeEipAddresses API asynchronously // api document: https://help.aliyun.com/api/ecs/describeeipaddresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeEipAddressesWithCallback(request *DescribeEipAddressesRequest, callback func(response *DescribeEipAddressesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeEipAddressesResponse var err error defer close(result) response, err = client.DescribeEipAddresses(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeEipAddressesRequest is the request struct for api DescribeEipAddresses type DescribeEipAddressesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Filter2Value string `position:"Query" name:"Filter.2.Value"` ISP string `position:"Query" name:"ISP"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AllocationId string `position:"Query" name:"AllocationId"` Filter1Value string `position:"Query" name:"Filter.1.Value"` Filter2Key string `position:"Query" name:"Filter.2.Key"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` EipAddress string `position:"Query" name:"EipAddress"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` LockReason string `position:"Query" name:"LockReason"` Filter1Key string `position:"Query" name:"Filter.1.Key"` AssociatedInstanceType string `position:"Query" name:"AssociatedInstanceType"` PageSize requests.Integer `position:"Query" name:"PageSize"` ChargeType string `position:"Query" name:"ChargeType"` AssociatedInstanceId string `position:"Query" name:"AssociatedInstanceId"` Status string `position:"Query" name:"Status"` } // DescribeEipAddressesResponse is the response struct for api DescribeEipAddresses type DescribeEipAddressesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` EipAddresses EipAddresses `json:"EipAddresses" xml:"EipAddresses"` } // CreateDescribeEipAddressesRequest creates a request to invoke DescribeEipAddresses API func CreateDescribeEipAddressesRequest() (request *DescribeEipAddressesRequest) { request = &DescribeEipAddressesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeEipAddresses", "ecs", "openAPI") return } // CreateDescribeEipAddressesResponse creates a response to parse from DescribeEipAddresses response func CreateDescribeEipAddressesResponse() (response *DescribeEipAddressesResponse) { response = &DescribeEipAddressesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������describe_eip_monitor_data.go������������������������������������������������������������������������0000664�0000000�0000000�00000011013�13771713062�0034177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeEipMonitorData invokes the ecs.DescribeEipMonitorData API synchronously // api document: https://help.aliyun.com/api/ecs/describeeipmonitordata.html func (client *Client) DescribeEipMonitorData(request *DescribeEipMonitorDataRequest) (response *DescribeEipMonitorDataResponse, err error) { response = CreateDescribeEipMonitorDataResponse() err = client.DoAction(request, response) return } // DescribeEipMonitorDataWithChan invokes the ecs.DescribeEipMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeeipmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeEipMonitorDataWithChan(request *DescribeEipMonitorDataRequest) (<-chan *DescribeEipMonitorDataResponse, <-chan error) { responseChan := make(chan *DescribeEipMonitorDataResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeEipMonitorData(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeEipMonitorDataWithCallback invokes the ecs.DescribeEipMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeeipmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeEipMonitorDataWithCallback(request *DescribeEipMonitorDataRequest, callback func(response *DescribeEipMonitorDataResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeEipMonitorDataResponse var err error defer close(result) response, err = client.DescribeEipMonitorData(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeEipMonitorDataRequest is the request struct for api DescribeEipMonitorData type DescribeEipMonitorDataRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` AllocationId string `position:"Query" name:"AllocationId"` StartTime string `position:"Query" name:"StartTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeEipMonitorDataResponse is the response struct for api DescribeEipMonitorData type DescribeEipMonitorDataResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` EipMonitorDatas EipMonitorDatasInDescribeEipMonitorData `json:"EipMonitorDatas" xml:"EipMonitorDatas"` } // CreateDescribeEipMonitorDataRequest creates a request to invoke DescribeEipMonitorData API func CreateDescribeEipMonitorDataRequest() (request *DescribeEipMonitorDataRequest) { request = &DescribeEipMonitorDataRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeEipMonitorData", "ecs", "openAPI") return } // CreateDescribeEipMonitorDataResponse creates a response to parse from DescribeEipMonitorData response func CreateDescribeEipMonitorDataResponse() (response *DescribeEipMonitorDataResponse) { response = &DescribeEipMonitorDataResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_eni_monitor_data.go������������������������������������������������������������������������0000664�0000000�0000000�00000011216�13771713062�0034202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeEniMonitorData invokes the ecs.DescribeEniMonitorData API synchronously // api document: https://help.aliyun.com/api/ecs/describeenimonitordata.html func (client *Client) DescribeEniMonitorData(request *DescribeEniMonitorDataRequest) (response *DescribeEniMonitorDataResponse, err error) { response = CreateDescribeEniMonitorDataResponse() err = client.DoAction(request, response) return } // DescribeEniMonitorDataWithChan invokes the ecs.DescribeEniMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeenimonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeEniMonitorDataWithChan(request *DescribeEniMonitorDataRequest) (<-chan *DescribeEniMonitorDataResponse, <-chan error) { responseChan := make(chan *DescribeEniMonitorDataResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeEniMonitorData(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeEniMonitorDataWithCallback invokes the ecs.DescribeEniMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeenimonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeEniMonitorDataWithCallback(request *DescribeEniMonitorDataRequest, callback func(response *DescribeEniMonitorDataResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeEniMonitorDataResponse var err error defer close(result) response, err = client.DescribeEniMonitorData(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeEniMonitorDataRequest is the request struct for api DescribeEniMonitorData type DescribeEniMonitorDataRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` StartTime string `position:"Query" name:"StartTime"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` EniId string `position:"Query" name:"EniId"` } // DescribeEniMonitorDataResponse is the response struct for api DescribeEniMonitorData type DescribeEniMonitorDataResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` MonitorData MonitorDataInDescribeEniMonitorData `json:"MonitorData" xml:"MonitorData"` } // CreateDescribeEniMonitorDataRequest creates a request to invoke DescribeEniMonitorData API func CreateDescribeEniMonitorDataRequest() (request *DescribeEniMonitorDataRequest) { request = &DescribeEniMonitorDataRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeEniMonitorData", "ecs", "openAPI") return } // CreateDescribeEniMonitorDataResponse creates a response to parse from DescribeEniMonitorData response func CreateDescribeEniMonitorDataResponse() (response *DescribeEniMonitorDataResponse) { response = &DescribeEniMonitorDataResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_forward_table_entries.go�������������������������������������������������������������������0000664�0000000�0000000�00000011655�13771713062�0035242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeForwardTableEntries invokes the ecs.DescribeForwardTableEntries API synchronously // api document: https://help.aliyun.com/api/ecs/describeforwardtableentries.html func (client *Client) DescribeForwardTableEntries(request *DescribeForwardTableEntriesRequest) (response *DescribeForwardTableEntriesResponse, err error) { response = CreateDescribeForwardTableEntriesResponse() err = client.DoAction(request, response) return } // DescribeForwardTableEntriesWithChan invokes the ecs.DescribeForwardTableEntries API asynchronously // api document: https://help.aliyun.com/api/ecs/describeforwardtableentries.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeForwardTableEntriesWithChan(request *DescribeForwardTableEntriesRequest) (<-chan *DescribeForwardTableEntriesResponse, <-chan error) { responseChan := make(chan *DescribeForwardTableEntriesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeForwardTableEntries(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeForwardTableEntriesWithCallback invokes the ecs.DescribeForwardTableEntries API asynchronously // api document: https://help.aliyun.com/api/ecs/describeforwardtableentries.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeForwardTableEntriesWithCallback(request *DescribeForwardTableEntriesRequest, callback func(response *DescribeForwardTableEntriesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeForwardTableEntriesResponse var err error defer close(result) response, err = client.DescribeForwardTableEntries(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeForwardTableEntriesRequest is the request struct for api DescribeForwardTableEntries type DescribeForwardTableEntriesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ForwardEntryId string `position:"Query" name:"ForwardEntryId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` ForwardTableId string `position:"Query" name:"ForwardTableId"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeForwardTableEntriesResponse is the response struct for api DescribeForwardTableEntries type DescribeForwardTableEntriesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` ForwardTableEntries ForwardTableEntries `json:"ForwardTableEntries" xml:"ForwardTableEntries"` } // CreateDescribeForwardTableEntriesRequest creates a request to invoke DescribeForwardTableEntries API func CreateDescribeForwardTableEntriesRequest() (request *DescribeForwardTableEntriesRequest) { request = &DescribeForwardTableEntriesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeForwardTableEntries", "ecs", "openAPI") return } // CreateDescribeForwardTableEntriesResponse creates a response to parse from DescribeForwardTableEntries response func CreateDescribeForwardTableEntriesResponse() (response *DescribeForwardTableEntriesResponse) { response = &DescribeForwardTableEntriesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_ha_vips.go�����0000664�0000000�0000000�00000010707�13771713062�0032403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeHaVips invokes the ecs.DescribeHaVips API synchronously // api document: https://help.aliyun.com/api/ecs/describehavips.html func (client *Client) DescribeHaVips(request *DescribeHaVipsRequest) (response *DescribeHaVipsResponse, err error) { response = CreateDescribeHaVipsResponse() err = client.DoAction(request, response) return } // DescribeHaVipsWithChan invokes the ecs.DescribeHaVips API asynchronously // api document: https://help.aliyun.com/api/ecs/describehavips.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeHaVipsWithChan(request *DescribeHaVipsRequest) (<-chan *DescribeHaVipsResponse, <-chan error) { responseChan := make(chan *DescribeHaVipsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeHaVips(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeHaVipsWithCallback invokes the ecs.DescribeHaVips API asynchronously // api document: https://help.aliyun.com/api/ecs/describehavips.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeHaVipsWithCallback(request *DescribeHaVipsRequest, callback func(response *DescribeHaVipsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeHaVipsResponse var err error defer close(result) response, err = client.DescribeHaVips(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeHaVipsRequest is the request struct for api DescribeHaVips type DescribeHaVipsRequest struct { *requests.RpcRequest Filter *[]DescribeHaVipsFilter `position:"Query" name:"Filter" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeHaVipsFilter is a repeated param struct in DescribeHaVipsRequest type DescribeHaVipsFilter struct { Value *[]string `name:"Value" type:"Repeated"` Key string `name:"Key"` } // DescribeHaVipsResponse is the response struct for api DescribeHaVips type DescribeHaVipsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` HaVips HaVips `json:"HaVips" xml:"HaVips"` } // CreateDescribeHaVipsRequest creates a request to invoke DescribeHaVips API func CreateDescribeHaVipsRequest() (request *DescribeHaVipsRequest) { request = &DescribeHaVipsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeHaVips", "ecs", "openAPI") return } // CreateDescribeHaVipsResponse creates a response to parse from DescribeHaVips response func CreateDescribeHaVipsResponse() (response *DescribeHaVipsResponse) { response = &DescribeHaVipsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_hpc_clusters.go0000664�0000000�0000000�00000011011�13771713062�0033435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeHpcClusters invokes the ecs.DescribeHpcClusters API synchronously // api document: https://help.aliyun.com/api/ecs/describehpcclusters.html func (client *Client) DescribeHpcClusters(request *DescribeHpcClustersRequest) (response *DescribeHpcClustersResponse, err error) { response = CreateDescribeHpcClustersResponse() err = client.DoAction(request, response) return } // DescribeHpcClustersWithChan invokes the ecs.DescribeHpcClusters API asynchronously // api document: https://help.aliyun.com/api/ecs/describehpcclusters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeHpcClustersWithChan(request *DescribeHpcClustersRequest) (<-chan *DescribeHpcClustersResponse, <-chan error) { responseChan := make(chan *DescribeHpcClustersResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeHpcClusters(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeHpcClustersWithCallback invokes the ecs.DescribeHpcClusters API asynchronously // api document: https://help.aliyun.com/api/ecs/describehpcclusters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeHpcClustersWithCallback(request *DescribeHpcClustersRequest, callback func(response *DescribeHpcClustersResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeHpcClustersResponse var err error defer close(result) response, err = client.DescribeHpcClusters(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeHpcClustersRequest is the request struct for api DescribeHpcClusters type DescribeHpcClustersRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ClientToken string `position:"Query" name:"ClientToken"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` HpcClusterIds string `position:"Query" name:"HpcClusterIds"` } // DescribeHpcClustersResponse is the response struct for api DescribeHpcClusters type DescribeHpcClustersResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` HpcClusters HpcClusters `json:"HpcClusters" xml:"HpcClusters"` } // CreateDescribeHpcClustersRequest creates a request to invoke DescribeHpcClusters API func CreateDescribeHpcClustersRequest() (request *DescribeHpcClustersRequest) { request = &DescribeHpcClustersRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeHpcClusters", "ecs", "openAPI") return } // CreateDescribeHpcClustersResponse creates a response to parse from DescribeHpcClusters response func CreateDescribeHpcClustersResponse() (response *DescribeHpcClustersResponse) { response = &DescribeHpcClustersResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_image_share_permission.go������������������������������������������������������������������0000664�0000000�0000000�00000011712�13771713062�0035404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeImageSharePermission invokes the ecs.DescribeImageSharePermission API synchronously // api document: https://help.aliyun.com/api/ecs/describeimagesharepermission.html func (client *Client) DescribeImageSharePermission(request *DescribeImageSharePermissionRequest) (response *DescribeImageSharePermissionResponse, err error) { response = CreateDescribeImageSharePermissionResponse() err = client.DoAction(request, response) return } // DescribeImageSharePermissionWithChan invokes the ecs.DescribeImageSharePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/describeimagesharepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeImageSharePermissionWithChan(request *DescribeImageSharePermissionRequest) (<-chan *DescribeImageSharePermissionResponse, <-chan error) { responseChan := make(chan *DescribeImageSharePermissionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeImageSharePermission(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeImageSharePermissionWithCallback invokes the ecs.DescribeImageSharePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/describeimagesharepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeImageSharePermissionWithCallback(request *DescribeImageSharePermissionRequest, callback func(response *DescribeImageSharePermissionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeImageSharePermissionResponse var err error defer close(result) response, err = client.DescribeImageSharePermission(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeImageSharePermissionRequest is the request struct for api DescribeImageSharePermission type DescribeImageSharePermissionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeImageSharePermissionResponse is the response struct for api DescribeImageSharePermission type DescribeImageSharePermissionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` ImageId string `json:"ImageId" xml:"ImageId"` ShareGroups ShareGroups `json:"ShareGroups" xml:"ShareGroups"` Accounts Accounts `json:"Accounts" xml:"Accounts"` } // CreateDescribeImageSharePermissionRequest creates a request to invoke DescribeImageSharePermission API func CreateDescribeImageSharePermissionRequest() (request *DescribeImageSharePermissionRequest) { request = &DescribeImageSharePermissionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeImageSharePermission", "ecs", "openAPI") return } // CreateDescribeImageSharePermissionResponse creates a response to parse from DescribeImageSharePermission response func CreateDescribeImageSharePermissionResponse() (response *DescribeImageSharePermissionResponse) { response = &DescribeImageSharePermissionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������describe_image_support_instance_types.go������������������������������������������������������������0000664�0000000�0000000�00000012602�13771713062�0036655�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeImageSupportInstanceTypes invokes the ecs.DescribeImageSupportInstanceTypes API synchronously // api document: https://help.aliyun.com/api/ecs/describeimagesupportinstancetypes.html func (client *Client) DescribeImageSupportInstanceTypes(request *DescribeImageSupportInstanceTypesRequest) (response *DescribeImageSupportInstanceTypesResponse, err error) { response = CreateDescribeImageSupportInstanceTypesResponse() err = client.DoAction(request, response) return } // DescribeImageSupportInstanceTypesWithChan invokes the ecs.DescribeImageSupportInstanceTypes API asynchronously // api document: https://help.aliyun.com/api/ecs/describeimagesupportinstancetypes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeImageSupportInstanceTypesWithChan(request *DescribeImageSupportInstanceTypesRequest) (<-chan *DescribeImageSupportInstanceTypesResponse, <-chan error) { responseChan := make(chan *DescribeImageSupportInstanceTypesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeImageSupportInstanceTypes(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeImageSupportInstanceTypesWithCallback invokes the ecs.DescribeImageSupportInstanceTypes API asynchronously // api document: https://help.aliyun.com/api/ecs/describeimagesupportinstancetypes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeImageSupportInstanceTypesWithCallback(request *DescribeImageSupportInstanceTypesRequest, callback func(response *DescribeImageSupportInstanceTypesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeImageSupportInstanceTypesResponse var err error defer close(result) response, err = client.DescribeImageSupportInstanceTypes(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeImageSupportInstanceTypesRequest is the request struct for api DescribeImageSupportInstanceTypes type DescribeImageSupportInstanceTypesRequest struct { *requests.RpcRequest ActionType string `position:"Query" name:"ActionType"` Filter *[]DescribeImageSupportInstanceTypesFilter `position:"Query" name:"Filter" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeImageSupportInstanceTypesFilter is a repeated param struct in DescribeImageSupportInstanceTypesRequest type DescribeImageSupportInstanceTypesFilter struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeImageSupportInstanceTypesResponse is the response struct for api DescribeImageSupportInstanceTypes type DescribeImageSupportInstanceTypesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` ImageId string `json:"ImageId" xml:"ImageId"` InstanceTypes InstanceTypesInDescribeImageSupportInstanceTypes `json:"InstanceTypes" xml:"InstanceTypes"` } // CreateDescribeImageSupportInstanceTypesRequest creates a request to invoke DescribeImageSupportInstanceTypes API func CreateDescribeImageSupportInstanceTypesRequest() (request *DescribeImageSupportInstanceTypesRequest) { request = &DescribeImageSupportInstanceTypesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeImageSupportInstanceTypes", "ecs", "openAPI") return } // CreateDescribeImageSupportInstanceTypesResponse creates a response to parse from DescribeImageSupportInstanceTypes response func CreateDescribeImageSupportInstanceTypesResponse() (response *DescribeImageSupportInstanceTypesResponse) { response = &DescribeImageSupportInstanceTypesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_images.go������0000664�0000000�0000000�00000013717�13771713062�0032223�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeImages invokes the ecs.DescribeImages API synchronously // api document: https://help.aliyun.com/api/ecs/describeimages.html func (client *Client) DescribeImages(request *DescribeImagesRequest) (response *DescribeImagesResponse, err error) { response = CreateDescribeImagesResponse() err = client.DoAction(request, response) return } // DescribeImagesWithChan invokes the ecs.DescribeImages API asynchronously // api document: https://help.aliyun.com/api/ecs/describeimages.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeImagesWithChan(request *DescribeImagesRequest) (<-chan *DescribeImagesResponse, <-chan error) { responseChan := make(chan *DescribeImagesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeImages(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeImagesWithCallback invokes the ecs.DescribeImages API asynchronously // api document: https://help.aliyun.com/api/ecs/describeimages.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeImagesWithCallback(request *DescribeImagesRequest, callback func(response *DescribeImagesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeImagesResponse var err error defer close(result) response, err = client.DescribeImages(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeImagesRequest is the request struct for api DescribeImages type DescribeImagesRequest struct { *requests.RpcRequest ActionType string `position:"Query" name:"ActionType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` SnapshotId string `position:"Query" name:"SnapshotId"` Usage string `position:"Query" name:"Usage"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` ImageOwnerAlias string `position:"Query" name:"ImageOwnerAlias"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` IsSupportIoOptimized requests.Boolean `position:"Query" name:"IsSupportIoOptimized"` ImageName string `position:"Query" name:"ImageName"` IsSupportCloudinit requests.Boolean `position:"Query" name:"IsSupportCloudinit"` PageSize requests.Integer `position:"Query" name:"PageSize"` InstanceType string `position:"Query" name:"InstanceType"` Tag *[]DescribeImagesTag `position:"Query" name:"Tag" type:"Repeated"` Architecture string `position:"Query" name:"Architecture"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` ShowExpired requests.Boolean `position:"Query" name:"ShowExpired"` OSType string `position:"Query" name:"OSType"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Filter *[]DescribeImagesFilter `position:"Query" name:"Filter" type:"Repeated"` Status string `position:"Query" name:"Status"` } // DescribeImagesTag is a repeated param struct in DescribeImagesRequest type DescribeImagesTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeImagesFilter is a repeated param struct in DescribeImagesRequest type DescribeImagesFilter struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeImagesResponse is the response struct for api DescribeImages type DescribeImagesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Images Images `json:"Images" xml:"Images"` } // CreateDescribeImagesRequest creates a request to invoke DescribeImages API func CreateDescribeImagesRequest() (request *DescribeImagesRequest) { request = &DescribeImagesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeImages", "ecs", "openAPI") return } // CreateDescribeImagesResponse creates a response to parse from DescribeImages response func CreateDescribeImagesResponse() (response *DescribeImagesResponse) { response = &DescribeImagesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������describe_instance_attribute.go����������������������������������������������������������������������0000664�0000000�0000000�00000017263�13771713062�0034566�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceAttribute invokes the ecs.DescribeInstanceAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceattribute.html func (client *Client) DescribeInstanceAttribute(request *DescribeInstanceAttributeRequest) (response *DescribeInstanceAttributeResponse, err error) { response = CreateDescribeInstanceAttributeResponse() err = client.DoAction(request, response) return } // DescribeInstanceAttributeWithChan invokes the ecs.DescribeInstanceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceAttributeWithChan(request *DescribeInstanceAttributeRequest) (<-chan *DescribeInstanceAttributeResponse, <-chan error) { responseChan := make(chan *DescribeInstanceAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceAttributeWithCallback invokes the ecs.DescribeInstanceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceAttributeWithCallback(request *DescribeInstanceAttributeRequest, callback func(response *DescribeInstanceAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceAttributeResponse var err error defer close(result) response, err = client.DescribeInstanceAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceAttributeRequest is the request struct for api DescribeInstanceAttribute type DescribeInstanceAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeInstanceAttributeResponse is the response struct for api DescribeInstanceAttribute type DescribeInstanceAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` InstanceName string `json:"InstanceName" xml:"InstanceName"` ImageId string `json:"ImageId" xml:"ImageId"` RegionId string `json:"RegionId" xml:"RegionId"` ZoneId string `json:"ZoneId" xml:"ZoneId"` ClusterId string `json:"ClusterId" xml:"ClusterId"` InstanceType string `json:"InstanceType" xml:"InstanceType"` Cpu int `json:"Cpu" xml:"Cpu"` Memory int `json:"Memory" xml:"Memory"` HostName string `json:"HostName" xml:"HostName"` Status string `json:"Status" xml:"Status"` InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` InternetMaxBandwidthIn int `json:"InternetMaxBandwidthIn" xml:"InternetMaxBandwidthIn"` InternetMaxBandwidthOut int `json:"InternetMaxBandwidthOut" xml:"InternetMaxBandwidthOut"` VlanId string `json:"VlanId" xml:"VlanId"` SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` CreationTime string `json:"CreationTime" xml:"CreationTime"` Description string `json:"Description" xml:"Description"` InstanceNetworkType string `json:"InstanceNetworkType" xml:"InstanceNetworkType"` IoOptimized string `json:"IoOptimized" xml:"IoOptimized"` InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` StoppedMode string `json:"StoppedMode" xml:"StoppedMode"` CreditSpecification string `json:"CreditSpecification" xml:"CreditSpecification"` SecurityGroupIds SecurityGroupIdsInDescribeInstanceAttribute `json:"SecurityGroupIds" xml:"SecurityGroupIds"` PublicIpAddress PublicIpAddressInDescribeInstanceAttribute `json:"PublicIpAddress" xml:"PublicIpAddress"` InnerIpAddress InnerIpAddressInDescribeInstanceAttribute `json:"InnerIpAddress" xml:"InnerIpAddress"` VpcAttributes VpcAttributes `json:"VpcAttributes" xml:"VpcAttributes"` EipAddress EipAddress `json:"EipAddress" xml:"EipAddress"` DedicatedHostAttribute DedicatedHostAttribute `json:"DedicatedHostAttribute" xml:"DedicatedHostAttribute"` OperationLocks OperationLocksInDescribeInstanceAttribute `json:"OperationLocks" xml:"OperationLocks"` } // CreateDescribeInstanceAttributeRequest creates a request to invoke DescribeInstanceAttribute API func CreateDescribeInstanceAttributeRequest() (request *DescribeInstanceAttributeRequest) { request = &DescribeInstanceAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceAttribute", "ecs", "openAPI") return } // CreateDescribeInstanceAttributeResponse creates a response to parse from DescribeInstanceAttribute response func CreateDescribeInstanceAttributeResponse() (response *DescribeInstanceAttributeResponse) { response = &DescribeInstanceAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_auto_renew_attribute.go�����������������������������������������������������������0000664�0000000�0000000�00000012360�13771713062�0037007�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceAutoRenewAttribute invokes the ecs.DescribeInstanceAutoRenewAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceautorenewattribute.html func (client *Client) DescribeInstanceAutoRenewAttribute(request *DescribeInstanceAutoRenewAttributeRequest) (response *DescribeInstanceAutoRenewAttributeResponse, err error) { response = CreateDescribeInstanceAutoRenewAttributeResponse() err = client.DoAction(request, response) return } // DescribeInstanceAutoRenewAttributeWithChan invokes the ecs.DescribeInstanceAutoRenewAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceautorenewattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceAutoRenewAttributeWithChan(request *DescribeInstanceAutoRenewAttributeRequest) (<-chan *DescribeInstanceAutoRenewAttributeResponse, <-chan error) { responseChan := make(chan *DescribeInstanceAutoRenewAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceAutoRenewAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceAutoRenewAttributeWithCallback invokes the ecs.DescribeInstanceAutoRenewAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceautorenewattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceAutoRenewAttributeWithCallback(request *DescribeInstanceAutoRenewAttributeRequest, callback func(response *DescribeInstanceAutoRenewAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceAutoRenewAttributeResponse var err error defer close(result) response, err = client.DescribeInstanceAutoRenewAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceAutoRenewAttributeRequest is the request struct for api DescribeInstanceAutoRenewAttribute type DescribeInstanceAutoRenewAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` RenewalStatus string `position:"Query" name:"RenewalStatus"` PageSize string `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber string `position:"Query" name:"PageNumber"` } // DescribeInstanceAutoRenewAttributeResponse is the response struct for api DescribeInstanceAutoRenewAttribute type DescribeInstanceAutoRenewAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` TotalCount int `json:"TotalCount" xml:"TotalCount"` InstanceRenewAttributes InstanceRenewAttributes `json:"InstanceRenewAttributes" xml:"InstanceRenewAttributes"` } // CreateDescribeInstanceAutoRenewAttributeRequest creates a request to invoke DescribeInstanceAutoRenewAttribute API func CreateDescribeInstanceAutoRenewAttributeRequest() (request *DescribeInstanceAutoRenewAttributeRequest) { request = &DescribeInstanceAutoRenewAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceAutoRenewAttribute", "ecs", "openAPI") return } // CreateDescribeInstanceAutoRenewAttributeResponse creates a response to parse from DescribeInstanceAutoRenewAttribute response func CreateDescribeInstanceAutoRenewAttributeResponse() (response *DescribeInstanceAutoRenewAttributeResponse) { response = &DescribeInstanceAutoRenewAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_history_events.go�����������������������������������������������������������������0000664�0000000�0000000�00000013441�13771713062�0035642�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceHistoryEvents invokes the ecs.DescribeInstanceHistoryEvents API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancehistoryevents.html func (client *Client) DescribeInstanceHistoryEvents(request *DescribeInstanceHistoryEventsRequest) (response *DescribeInstanceHistoryEventsResponse, err error) { response = CreateDescribeInstanceHistoryEventsResponse() err = client.DoAction(request, response) return } // DescribeInstanceHistoryEventsWithChan invokes the ecs.DescribeInstanceHistoryEvents API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancehistoryevents.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceHistoryEventsWithChan(request *DescribeInstanceHistoryEventsRequest) (<-chan *DescribeInstanceHistoryEventsResponse, <-chan error) { responseChan := make(chan *DescribeInstanceHistoryEventsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceHistoryEvents(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceHistoryEventsWithCallback invokes the ecs.DescribeInstanceHistoryEvents API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancehistoryevents.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceHistoryEventsWithCallback(request *DescribeInstanceHistoryEventsRequest, callback func(response *DescribeInstanceHistoryEventsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceHistoryEventsResponse var err error defer close(result) response, err = client.DescribeInstanceHistoryEvents(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceHistoryEventsRequest is the request struct for api DescribeInstanceHistoryEvents type DescribeInstanceHistoryEventsRequest struct { *requests.RpcRequest EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` EventCycleStatus string `position:"Query" name:"EventCycleStatus"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` InstanceEventCycleStatus *[]string `position:"Query" name:"InstanceEventCycleStatus" type:"Repeated"` EventPublishTimeEnd string `position:"Query" name:"EventPublishTime.End"` InstanceEventType *[]string `position:"Query" name:"InstanceEventType" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` NotBeforeStart string `position:"Query" name:"NotBefore.Start"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` EventPublishTimeStart string `position:"Query" name:"EventPublishTime.Start"` InstanceId string `position:"Query" name:"InstanceId"` NotBeforeEnd string `position:"Query" name:"NotBefore.End"` EventType string `position:"Query" name:"EventType"` } // DescribeInstanceHistoryEventsResponse is the response struct for api DescribeInstanceHistoryEvents type DescribeInstanceHistoryEventsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` InstanceSystemEventSet InstanceSystemEventSet `json:"InstanceSystemEventSet" xml:"InstanceSystemEventSet"` } // CreateDescribeInstanceHistoryEventsRequest creates a request to invoke DescribeInstanceHistoryEvents API func CreateDescribeInstanceHistoryEventsRequest() (request *DescribeInstanceHistoryEventsRequest) { request = &DescribeInstanceHistoryEventsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceHistoryEvents", "ecs", "openAPI") return } // CreateDescribeInstanceHistoryEventsResponse creates a response to parse from DescribeInstanceHistoryEvents response func CreateDescribeInstanceHistoryEventsResponse() (response *DescribeInstanceHistoryEventsResponse) { response = &DescribeInstanceHistoryEventsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_monitor_data.go�������������������������������������������������������������������0000664�0000000�0000000�00000011303�13771713062�0035230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceMonitorData invokes the ecs.DescribeInstanceMonitorData API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancemonitordata.html func (client *Client) DescribeInstanceMonitorData(request *DescribeInstanceMonitorDataRequest) (response *DescribeInstanceMonitorDataResponse, err error) { response = CreateDescribeInstanceMonitorDataResponse() err = client.DoAction(request, response) return } // DescribeInstanceMonitorDataWithChan invokes the ecs.DescribeInstanceMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancemonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceMonitorDataWithChan(request *DescribeInstanceMonitorDataRequest) (<-chan *DescribeInstanceMonitorDataResponse, <-chan error) { responseChan := make(chan *DescribeInstanceMonitorDataResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceMonitorData(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceMonitorDataWithCallback invokes the ecs.DescribeInstanceMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancemonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceMonitorDataWithCallback(request *DescribeInstanceMonitorDataRequest, callback func(response *DescribeInstanceMonitorDataResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceMonitorDataResponse var err error defer close(result) response, err = client.DescribeInstanceMonitorData(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceMonitorDataRequest is the request struct for api DescribeInstanceMonitorData type DescribeInstanceMonitorDataRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` StartTime string `position:"Query" name:"StartTime"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` } // DescribeInstanceMonitorDataResponse is the response struct for api DescribeInstanceMonitorData type DescribeInstanceMonitorDataResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` MonitorData MonitorDataInDescribeInstanceMonitorData `json:"MonitorData" xml:"MonitorData"` } // CreateDescribeInstanceMonitorDataRequest creates a request to invoke DescribeInstanceMonitorData API func CreateDescribeInstanceMonitorDataRequest() (request *DescribeInstanceMonitorDataRequest) { request = &DescribeInstanceMonitorDataRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceMonitorData", "ecs", "openAPI") return } // CreateDescribeInstanceMonitorDataResponse creates a response to parse from DescribeInstanceMonitorData response func CreateDescribeInstanceMonitorDataResponse() (response *DescribeInstanceMonitorDataResponse) { response = &DescribeInstanceMonitorDataResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_physical_attribute.go�������������������������������������������������������������0000664�0000000�0000000�00000011521�13771713062�0036451�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstancePhysicalAttribute invokes the ecs.DescribeInstancePhysicalAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancephysicalattribute.html func (client *Client) DescribeInstancePhysicalAttribute(request *DescribeInstancePhysicalAttributeRequest) (response *DescribeInstancePhysicalAttributeResponse, err error) { response = CreateDescribeInstancePhysicalAttributeResponse() err = client.DoAction(request, response) return } // DescribeInstancePhysicalAttributeWithChan invokes the ecs.DescribeInstancePhysicalAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancephysicalattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstancePhysicalAttributeWithChan(request *DescribeInstancePhysicalAttributeRequest) (<-chan *DescribeInstancePhysicalAttributeResponse, <-chan error) { responseChan := make(chan *DescribeInstancePhysicalAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstancePhysicalAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstancePhysicalAttributeWithCallback invokes the ecs.DescribeInstancePhysicalAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancephysicalattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstancePhysicalAttributeWithCallback(request *DescribeInstancePhysicalAttributeRequest, callback func(response *DescribeInstancePhysicalAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstancePhysicalAttributeResponse var err error defer close(result) response, err = client.DescribeInstancePhysicalAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstancePhysicalAttributeRequest is the request struct for api DescribeInstancePhysicalAttribute type DescribeInstancePhysicalAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeInstancePhysicalAttributeResponse is the response struct for api DescribeInstancePhysicalAttribute type DescribeInstancePhysicalAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` VlanId string `json:"VlanId" xml:"VlanId"` NodeControllerId string `json:"NodeControllerId" xml:"NodeControllerId"` RackId string `json:"RackId" xml:"RackId"` } // CreateDescribeInstancePhysicalAttributeRequest creates a request to invoke DescribeInstancePhysicalAttribute API func CreateDescribeInstancePhysicalAttributeRequest() (request *DescribeInstancePhysicalAttributeRequest) { request = &DescribeInstancePhysicalAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstancePhysicalAttribute", "ecs", "openAPI") return } // CreateDescribeInstancePhysicalAttributeResponse creates a response to parse from DescribeInstancePhysicalAttribute response func CreateDescribeInstancePhysicalAttributeResponse() (response *DescribeInstancePhysicalAttributeResponse) { response = &DescribeInstancePhysicalAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_ram_role.go�����������������������������������������������������������������������0000664�0000000�0000000�00000011317�13771713062�0034355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceRamRole invokes the ecs.DescribeInstanceRamRole API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceramrole.html func (client *Client) DescribeInstanceRamRole(request *DescribeInstanceRamRoleRequest) (response *DescribeInstanceRamRoleResponse, err error) { response = CreateDescribeInstanceRamRoleResponse() err = client.DoAction(request, response) return } // DescribeInstanceRamRoleWithChan invokes the ecs.DescribeInstanceRamRole API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceramrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceRamRoleWithChan(request *DescribeInstanceRamRoleRequest) (<-chan *DescribeInstanceRamRoleResponse, <-chan error) { responseChan := make(chan *DescribeInstanceRamRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceRamRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceRamRoleWithCallback invokes the ecs.DescribeInstanceRamRole API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstanceramrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceRamRoleWithCallback(request *DescribeInstanceRamRoleRequest, callback func(response *DescribeInstanceRamRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceRamRoleResponse var err error defer close(result) response, err = client.DescribeInstanceRamRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceRamRoleRequest is the request struct for api DescribeInstanceRamRole type DescribeInstanceRamRoleRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` InstanceIds string `position:"Query" name:"InstanceIds"` PageSize requests.Integer `position:"Query" name:"PageSize"` RamRoleName string `position:"Query" name:"RamRoleName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeInstanceRamRoleResponse is the response struct for api DescribeInstanceRamRole type DescribeInstanceRamRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` InstanceRamRoleSets InstanceRamRoleSetsInDescribeInstanceRamRole `json:"InstanceRamRoleSets" xml:"InstanceRamRoleSets"` } // CreateDescribeInstanceRamRoleRequest creates a request to invoke DescribeInstanceRamRole API func CreateDescribeInstanceRamRoleRequest() (request *DescribeInstanceRamRoleRequest) { request = &DescribeInstanceRamRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceRamRole", "ecs", "openAPI") return } // CreateDescribeInstanceRamRoleResponse creates a response to parse from DescribeInstanceRamRole response func CreateDescribeInstanceRamRoleResponse() (response *DescribeInstanceRamRoleResponse) { response = &DescribeInstanceRamRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_status.go�������������������������������������������������������������������������0000664�0000000�0000000�00000011264�13771713062�0034101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceStatus invokes the ecs.DescribeInstanceStatus API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancestatus.html func (client *Client) DescribeInstanceStatus(request *DescribeInstanceStatusRequest) (response *DescribeInstanceStatusResponse, err error) { response = CreateDescribeInstanceStatusResponse() err = client.DoAction(request, response) return } // DescribeInstanceStatusWithChan invokes the ecs.DescribeInstanceStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancestatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceStatusWithChan(request *DescribeInstanceStatusRequest) (<-chan *DescribeInstanceStatusResponse, <-chan error) { responseChan := make(chan *DescribeInstanceStatusResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceStatus(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceStatusWithCallback invokes the ecs.DescribeInstanceStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancestatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceStatusWithCallback(request *DescribeInstanceStatusRequest, callback func(response *DescribeInstanceStatusResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceStatusResponse var err error defer close(result) response, err = client.DescribeInstanceStatus(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceStatusRequest is the request struct for api DescribeInstanceStatus type DescribeInstanceStatusRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` ZoneId string `position:"Query" name:"ZoneId"` ClusterId string `position:"Query" name:"ClusterId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeInstanceStatusResponse is the response struct for api DescribeInstanceStatus type DescribeInstanceStatusResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` InstanceStatuses InstanceStatuses `json:"InstanceStatuses" xml:"InstanceStatuses"` } // CreateDescribeInstanceStatusRequest creates a request to invoke DescribeInstanceStatus API func CreateDescribeInstanceStatusRequest() (request *DescribeInstanceStatusRequest) { request = &DescribeInstanceStatusRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceStatus", "ecs", "openAPI") return } // CreateDescribeInstanceStatusResponse creates a response to parse from DescribeInstanceStatus response func CreateDescribeInstanceStatusResponse() (response *DescribeInstanceStatusResponse) { response = &DescribeInstanceStatusResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_topology.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010334�13771713062�0034427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceTopology invokes the ecs.DescribeInstanceTopology API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetopology.html func (client *Client) DescribeInstanceTopology(request *DescribeInstanceTopologyRequest) (response *DescribeInstanceTopologyResponse, err error) { response = CreateDescribeInstanceTopologyResponse() err = client.DoAction(request, response) return } // DescribeInstanceTopologyWithChan invokes the ecs.DescribeInstanceTopology API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetopology.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceTopologyWithChan(request *DescribeInstanceTopologyRequest) (<-chan *DescribeInstanceTopologyResponse, <-chan error) { responseChan := make(chan *DescribeInstanceTopologyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceTopology(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceTopologyWithCallback invokes the ecs.DescribeInstanceTopology API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetopology.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceTopologyWithCallback(request *DescribeInstanceTopologyRequest, callback func(response *DescribeInstanceTopologyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceTopologyResponse var err error defer close(result) response, err = client.DescribeInstanceTopology(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceTopologyRequest is the request struct for api DescribeInstanceTopology type DescribeInstanceTopologyRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` InstanceIds string `position:"Query" name:"InstanceIds"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeInstanceTopologyResponse is the response struct for api DescribeInstanceTopology type DescribeInstanceTopologyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Topologys Topologys `json:"Topologys" xml:"Topologys"` } // CreateDescribeInstanceTopologyRequest creates a request to invoke DescribeInstanceTopology API func CreateDescribeInstanceTopologyRequest() (request *DescribeInstanceTopologyRequest) { request = &DescribeInstanceTopologyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceTopology", "ecs", "openAPI") return } // CreateDescribeInstanceTopologyResponse creates a response to parse from DescribeInstanceTopology response func CreateDescribeInstanceTopologyResponse() (response *DescribeInstanceTopologyResponse) { response = &DescribeInstanceTopologyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_type_families.go������������������������������������������������������������������0000664�0000000�0000000�00000011107�13771713062�0035404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceTypeFamilies invokes the ecs.DescribeInstanceTypeFamilies API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetypefamilies.html func (client *Client) DescribeInstanceTypeFamilies(request *DescribeInstanceTypeFamiliesRequest) (response *DescribeInstanceTypeFamiliesResponse, err error) { response = CreateDescribeInstanceTypeFamiliesResponse() err = client.DoAction(request, response) return } // DescribeInstanceTypeFamiliesWithChan invokes the ecs.DescribeInstanceTypeFamilies API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetypefamilies.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceTypeFamiliesWithChan(request *DescribeInstanceTypeFamiliesRequest) (<-chan *DescribeInstanceTypeFamiliesResponse, <-chan error) { responseChan := make(chan *DescribeInstanceTypeFamiliesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceTypeFamilies(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceTypeFamiliesWithCallback invokes the ecs.DescribeInstanceTypeFamilies API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetypefamilies.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceTypeFamiliesWithCallback(request *DescribeInstanceTypeFamiliesRequest, callback func(response *DescribeInstanceTypeFamiliesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceTypeFamiliesResponse var err error defer close(result) response, err = client.DescribeInstanceTypeFamilies(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceTypeFamiliesRequest is the request struct for api DescribeInstanceTypeFamilies type DescribeInstanceTypeFamiliesRequest struct { *requests.RpcRequest Generation string `position:"Query" name:"Generation"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeInstanceTypeFamiliesResponse is the response struct for api DescribeInstanceTypeFamilies type DescribeInstanceTypeFamiliesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceTypeFamilies InstanceTypeFamiliesInDescribeInstanceTypeFamilies `json:"InstanceTypeFamilies" xml:"InstanceTypeFamilies"` } // CreateDescribeInstanceTypeFamiliesRequest creates a request to invoke DescribeInstanceTypeFamilies API func CreateDescribeInstanceTypeFamiliesRequest() (request *DescribeInstanceTypeFamiliesRequest) { request = &DescribeInstanceTypeFamiliesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceTypeFamilies", "ecs", "openAPI") return } // CreateDescribeInstanceTypeFamiliesResponse creates a response to parse from DescribeInstanceTypeFamilies response func CreateDescribeInstanceTypeFamiliesResponse() (response *DescribeInstanceTypeFamiliesResponse) { response = &DescribeInstanceTypeFamiliesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_types.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010377�13771713062�0033726�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceTypes invokes the ecs.DescribeInstanceTypes API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetypes.html func (client *Client) DescribeInstanceTypes(request *DescribeInstanceTypesRequest) (response *DescribeInstanceTypesResponse, err error) { response = CreateDescribeInstanceTypesResponse() err = client.DoAction(request, response) return } // DescribeInstanceTypesWithChan invokes the ecs.DescribeInstanceTypes API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetypes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceTypesWithChan(request *DescribeInstanceTypesRequest) (<-chan *DescribeInstanceTypesResponse, <-chan error) { responseChan := make(chan *DescribeInstanceTypesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceTypes(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceTypesWithCallback invokes the ecs.DescribeInstanceTypes API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancetypes.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceTypesWithCallback(request *DescribeInstanceTypesRequest, callback func(response *DescribeInstanceTypesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceTypesResponse var err error defer close(result) response, err = client.DescribeInstanceTypes(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceTypesRequest is the request struct for api DescribeInstanceTypes type DescribeInstanceTypesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InstanceTypeFamily string `position:"Query" name:"InstanceTypeFamily"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeInstanceTypesResponse is the response struct for api DescribeInstanceTypes type DescribeInstanceTypesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceTypes InstanceTypesInDescribeInstanceTypes `json:"InstanceTypes" xml:"InstanceTypes"` } // CreateDescribeInstanceTypesRequest creates a request to invoke DescribeInstanceTypes API func CreateDescribeInstanceTypesRequest() (request *DescribeInstanceTypesRequest) { request = &DescribeInstanceTypesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceTypes", "ecs", "openAPI") return } // CreateDescribeInstanceTypesResponse creates a response to parse from DescribeInstanceTypes response func CreateDescribeInstanceTypesResponse() (response *DescribeInstanceTypesResponse) { response = &DescribeInstanceTypesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_vnc_passwd.go���������������������������������������������������������������������0000664�0000000�0000000�00000010513�13771713062�0034721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceVncPasswd invokes the ecs.DescribeInstanceVncPasswd API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancevncpasswd.html func (client *Client) DescribeInstanceVncPasswd(request *DescribeInstanceVncPasswdRequest) (response *DescribeInstanceVncPasswdResponse, err error) { response = CreateDescribeInstanceVncPasswdResponse() err = client.DoAction(request, response) return } // DescribeInstanceVncPasswdWithChan invokes the ecs.DescribeInstanceVncPasswd API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancevncpasswd.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceVncPasswdWithChan(request *DescribeInstanceVncPasswdRequest) (<-chan *DescribeInstanceVncPasswdResponse, <-chan error) { responseChan := make(chan *DescribeInstanceVncPasswdResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceVncPasswd(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceVncPasswdWithCallback invokes the ecs.DescribeInstanceVncPasswd API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancevncpasswd.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceVncPasswdWithCallback(request *DescribeInstanceVncPasswdRequest, callback func(response *DescribeInstanceVncPasswdResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceVncPasswdResponse var err error defer close(result) response, err = client.DescribeInstanceVncPasswd(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceVncPasswdRequest is the request struct for api DescribeInstanceVncPasswd type DescribeInstanceVncPasswdRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeInstanceVncPasswdResponse is the response struct for api DescribeInstanceVncPasswd type DescribeInstanceVncPasswdResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` VncPasswd string `json:"VncPasswd" xml:"VncPasswd"` } // CreateDescribeInstanceVncPasswdRequest creates a request to invoke DescribeInstanceVncPasswd API func CreateDescribeInstanceVncPasswdRequest() (request *DescribeInstanceVncPasswdRequest) { request = &DescribeInstanceVncPasswdRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceVncPasswd", "ecs", "openAPI") return } // CreateDescribeInstanceVncPasswdResponse creates a response to parse from DescribeInstanceVncPasswd response func CreateDescribeInstanceVncPasswdResponse() (response *DescribeInstanceVncPasswdResponse) { response = &DescribeInstanceVncPasswdResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_instance_vnc_url.go������������������������������������������������������������������������0000664�0000000�0000000�00000010315�13771713062�0034222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstanceVncUrl invokes the ecs.DescribeInstanceVncUrl API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancevncurl.html func (client *Client) DescribeInstanceVncUrl(request *DescribeInstanceVncUrlRequest) (response *DescribeInstanceVncUrlResponse, err error) { response = CreateDescribeInstanceVncUrlResponse() err = client.DoAction(request, response) return } // DescribeInstanceVncUrlWithChan invokes the ecs.DescribeInstanceVncUrl API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancevncurl.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceVncUrlWithChan(request *DescribeInstanceVncUrlRequest) (<-chan *DescribeInstanceVncUrlResponse, <-chan error) { responseChan := make(chan *DescribeInstanceVncUrlResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstanceVncUrl(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstanceVncUrlWithCallback invokes the ecs.DescribeInstanceVncUrl API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancevncurl.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstanceVncUrlWithCallback(request *DescribeInstanceVncUrlRequest, callback func(response *DescribeInstanceVncUrlResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstanceVncUrlResponse var err error defer close(result) response, err = client.DescribeInstanceVncUrl(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstanceVncUrlRequest is the request struct for api DescribeInstanceVncUrl type DescribeInstanceVncUrlRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeInstanceVncUrlResponse is the response struct for api DescribeInstanceVncUrl type DescribeInstanceVncUrlResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` VncUrl string `json:"VncUrl" xml:"VncUrl"` } // CreateDescribeInstanceVncUrlRequest creates a request to invoke DescribeInstanceVncUrl API func CreateDescribeInstanceVncUrlRequest() (request *DescribeInstanceVncUrlRequest) { request = &DescribeInstanceVncUrlRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstanceVncUrl", "ecs", "openAPI") return } // CreateDescribeInstanceVncUrlResponse creates a response to parse from DescribeInstanceVncUrl response func CreateDescribeInstanceVncUrlResponse() (response *DescribeInstanceVncUrlResponse) { response = &DescribeInstanceVncUrlResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_instances.go���0000664�0000000�0000000�00000016776�13771713062�0032755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstances invokes the ecs.DescribeInstances API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstances.html func (client *Client) DescribeInstances(request *DescribeInstancesRequest) (response *DescribeInstancesResponse, err error) { response = CreateDescribeInstancesResponse() err = client.DoAction(request, response) return } // DescribeInstancesWithChan invokes the ecs.DescribeInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstancesWithChan(request *DescribeInstancesRequest) (<-chan *DescribeInstancesResponse, <-chan error) { responseChan := make(chan *DescribeInstancesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstances(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstancesWithCallback invokes the ecs.DescribeInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstancesWithCallback(request *DescribeInstancesRequest, callback func(response *DescribeInstancesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstancesResponse var err error defer close(result) response, err = client.DescribeInstances(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstancesRequest is the request struct for api DescribeInstances type DescribeInstancesRequest struct { *requests.RpcRequest InnerIpAddresses string `position:"Query" name:"InnerIpAddresses"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` PrivateIpAddresses string `position:"Query" name:"PrivateIpAddresses"` HpcClusterId string `position:"Query" name:"HpcClusterId"` Filter2Value string `position:"Query" name:"Filter.2.Value"` Filter4Value string `position:"Query" name:"Filter.4.Value"` IoOptimized requests.Boolean `position:"Query" name:"IoOptimized"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` KeyPairName string `position:"Query" name:"KeyPairName"` Filter4Key string `position:"Query" name:"Filter.4.Key"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` LockReason string `position:"Query" name:"LockReason"` Filter1Key string `position:"Query" name:"Filter.1.Key"` RdmaIpAddresses string `position:"Query" name:"RdmaIpAddresses"` DeviceAvailable requests.Boolean `position:"Query" name:"DeviceAvailable"` PageSize requests.Integer `position:"Query" name:"PageSize"` PublicIpAddresses string `position:"Query" name:"PublicIpAddresses"` InstanceType string `position:"Query" name:"InstanceType"` Tag *[]DescribeInstancesTag `position:"Query" name:"Tag" type:"Repeated"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` Filter3Value string `position:"Query" name:"Filter.3.Value"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InstanceTypeFamily string `position:"Query" name:"InstanceTypeFamily"` Filter1Value string `position:"Query" name:"Filter.1.Value"` NeedSaleCycle requests.Boolean `position:"Query" name:"NeedSaleCycle"` Filter2Key string `position:"Query" name:"Filter.2.Key"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` VSwitchId string `position:"Query" name:"VSwitchId"` EipAddresses string `position:"Query" name:"EipAddresses"` InstanceName string `position:"Query" name:"InstanceName"` InstanceIds string `position:"Query" name:"InstanceIds"` InternetChargeType string `position:"Query" name:"InternetChargeType"` VpcId string `position:"Query" name:"VpcId"` ZoneId string `position:"Query" name:"ZoneId"` Filter3Key string `position:"Query" name:"Filter.3.Key"` InstanceNetworkType string `position:"Query" name:"InstanceNetworkType"` Status string `position:"Query" name:"Status"` } // DescribeInstancesTag is a repeated param struct in DescribeInstancesRequest type DescribeInstancesTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeInstancesResponse is the response struct for api DescribeInstances type DescribeInstancesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Instances InstancesInDescribeInstances `json:"Instances" xml:"Instances"` } // CreateDescribeInstancesRequest creates a request to invoke DescribeInstances API func CreateDescribeInstancesRequest() (request *DescribeInstancesRequest) { request = &DescribeInstancesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstances", "ecs", "openAPI") return } // CreateDescribeInstancesResponse creates a response to parse from DescribeInstances response func CreateDescribeInstancesResponse() (response *DescribeInstancesResponse) { response = &DescribeInstancesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��describe_instances_full_status.go�������������������������������������������������������������������0000664�0000000�0000000�00000013177�13771713062�0035313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInstancesFullStatus invokes the ecs.DescribeInstancesFullStatus API synchronously // api document: https://help.aliyun.com/api/ecs/describeinstancesfullstatus.html func (client *Client) DescribeInstancesFullStatus(request *DescribeInstancesFullStatusRequest) (response *DescribeInstancesFullStatusResponse, err error) { response = CreateDescribeInstancesFullStatusResponse() err = client.DoAction(request, response) return } // DescribeInstancesFullStatusWithChan invokes the ecs.DescribeInstancesFullStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancesfullstatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstancesFullStatusWithChan(request *DescribeInstancesFullStatusRequest) (<-chan *DescribeInstancesFullStatusResponse, <-chan error) { responseChan := make(chan *DescribeInstancesFullStatusResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInstancesFullStatus(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInstancesFullStatusWithCallback invokes the ecs.DescribeInstancesFullStatus API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinstancesfullstatus.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInstancesFullStatusWithCallback(request *DescribeInstancesFullStatusRequest, callback func(response *DescribeInstancesFullStatusResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInstancesFullStatusResponse var err error defer close(result) response, err = client.DescribeInstancesFullStatus(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInstancesFullStatusRequest is the request struct for api DescribeInstancesFullStatus type DescribeInstancesFullStatusRequest struct { *requests.RpcRequest EventId *[]string `position:"Query" name:"EventId" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` EventPublishTimeEnd string `position:"Query" name:"EventPublishTime.End"` InstanceEventType *[]string `position:"Query" name:"InstanceEventType" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` NotBeforeStart string `position:"Query" name:"NotBefore.Start"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` EventPublishTimeStart string `position:"Query" name:"EventPublishTime.Start"` InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` NotBeforeEnd string `position:"Query" name:"NotBefore.End"` HealthStatus string `position:"Query" name:"HealthStatus"` EventType string `position:"Query" name:"EventType"` Status string `position:"Query" name:"Status"` } // DescribeInstancesFullStatusResponse is the response struct for api DescribeInstancesFullStatus type DescribeInstancesFullStatusResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` InstanceFullStatusSet InstanceFullStatusSet `json:"InstanceFullStatusSet" xml:"InstanceFullStatusSet"` } // CreateDescribeInstancesFullStatusRequest creates a request to invoke DescribeInstancesFullStatus API func CreateDescribeInstancesFullStatusRequest() (request *DescribeInstancesFullStatusRequest) { request = &DescribeInstancesFullStatusRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInstancesFullStatus", "ecs", "openAPI") return } // CreateDescribeInstancesFullStatusResponse creates a response to parse from DescribeInstancesFullStatus response func CreateDescribeInstancesFullStatusResponse() (response *DescribeInstancesFullStatusResponse) { response = &DescribeInstancesFullStatusResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_invocation_results.go����������������������������������������������������������������������0000664�0000000�0000000�00000011326�13771713062�0034623�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInvocationResults invokes the ecs.DescribeInvocationResults API synchronously // api document: https://help.aliyun.com/api/ecs/describeinvocationresults.html func (client *Client) DescribeInvocationResults(request *DescribeInvocationResultsRequest) (response *DescribeInvocationResultsResponse, err error) { response = CreateDescribeInvocationResultsResponse() err = client.DoAction(request, response) return } // DescribeInvocationResultsWithChan invokes the ecs.DescribeInvocationResults API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinvocationresults.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInvocationResultsWithChan(request *DescribeInvocationResultsRequest) (<-chan *DescribeInvocationResultsResponse, <-chan error) { responseChan := make(chan *DescribeInvocationResultsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInvocationResults(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInvocationResultsWithCallback invokes the ecs.DescribeInvocationResults API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinvocationresults.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInvocationResultsWithCallback(request *DescribeInvocationResultsRequest, callback func(response *DescribeInvocationResultsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInvocationResultsResponse var err error defer close(result) response, err = client.DescribeInvocationResults(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInvocationResultsRequest is the request struct for api DescribeInvocationResults type DescribeInvocationResultsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` CommandId string `position:"Query" name:"CommandId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` InvokeId string `position:"Query" name:"InvokeId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` InvokeRecordStatus string `position:"Query" name:"InvokeRecordStatus"` } // DescribeInvocationResultsResponse is the response struct for api DescribeInvocationResults type DescribeInvocationResultsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Invocation Invocation `json:"Invocation" xml:"Invocation"` } // CreateDescribeInvocationResultsRequest creates a request to invoke DescribeInvocationResults API func CreateDescribeInvocationResultsRequest() (request *DescribeInvocationResultsRequest) { request = &DescribeInvocationResultsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInvocationResults", "ecs", "openAPI") return } // CreateDescribeInvocationResultsResponse creates a response to parse from DescribeInvocationResults response func CreateDescribeInvocationResultsResponse() (response *DescribeInvocationResultsResponse) { response = &DescribeInvocationResultsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_invocations.go�0000664�0000000�0000000�00000011575�13771713062�0033312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeInvocations invokes the ecs.DescribeInvocations API synchronously // api document: https://help.aliyun.com/api/ecs/describeinvocations.html func (client *Client) DescribeInvocations(request *DescribeInvocationsRequest) (response *DescribeInvocationsResponse, err error) { response = CreateDescribeInvocationsResponse() err = client.DoAction(request, response) return } // DescribeInvocationsWithChan invokes the ecs.DescribeInvocations API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinvocations.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInvocationsWithChan(request *DescribeInvocationsRequest) (<-chan *DescribeInvocationsResponse, <-chan error) { responseChan := make(chan *DescribeInvocationsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeInvocations(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeInvocationsWithCallback invokes the ecs.DescribeInvocations API asynchronously // api document: https://help.aliyun.com/api/ecs/describeinvocations.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeInvocationsWithCallback(request *DescribeInvocationsRequest, callback func(response *DescribeInvocationsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeInvocationsResponse var err error defer close(result) response, err = client.DescribeInvocations(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeInvocationsRequest is the request struct for api DescribeInvocations type DescribeInvocationsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InvokeStatus string `position:"Query" name:"InvokeStatus"` CommandId string `position:"Query" name:"CommandId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` InvokeId string `position:"Query" name:"InvokeId"` Timed requests.Boolean `position:"Query" name:"Timed"` CommandName string `position:"Query" name:"CommandName"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` CommandType string `position:"Query" name:"CommandType"` InstanceId string `position:"Query" name:"InstanceId"` } // DescribeInvocationsResponse is the response struct for api DescribeInvocations type DescribeInvocationsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Invocations Invocations `json:"Invocations" xml:"Invocations"` } // CreateDescribeInvocationsRequest creates a request to invoke DescribeInvocations API func CreateDescribeInvocationsRequest() (request *DescribeInvocationsRequest) { request = &DescribeInvocationsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeInvocations", "ecs", "openAPI") return } // CreateDescribeInvocationsResponse creates a response to parse from DescribeInvocations response func CreateDescribeInvocationsResponse() (response *DescribeInvocationsResponse) { response = &DescribeInvocationsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_key_pairs.go���0000664�0000000�0000000�00000011265�13771713062�0032740�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeKeyPairs invokes the ecs.DescribeKeyPairs API synchronously // api document: https://help.aliyun.com/api/ecs/describekeypairs.html func (client *Client) DescribeKeyPairs(request *DescribeKeyPairsRequest) (response *DescribeKeyPairsResponse, err error) { response = CreateDescribeKeyPairsResponse() err = client.DoAction(request, response) return } // DescribeKeyPairsWithChan invokes the ecs.DescribeKeyPairs API asynchronously // api document: https://help.aliyun.com/api/ecs/describekeypairs.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeKeyPairsWithChan(request *DescribeKeyPairsRequest) (<-chan *DescribeKeyPairsResponse, <-chan error) { responseChan := make(chan *DescribeKeyPairsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeKeyPairs(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeKeyPairsWithCallback invokes the ecs.DescribeKeyPairs API asynchronously // api document: https://help.aliyun.com/api/ecs/describekeypairs.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeKeyPairsWithCallback(request *DescribeKeyPairsRequest, callback func(response *DescribeKeyPairsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeKeyPairsResponse var err error defer close(result) response, err = client.DescribeKeyPairs(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeKeyPairsRequest is the request struct for api DescribeKeyPairs type DescribeKeyPairsRequest struct { *requests.RpcRequest ResourceGroupId string `position:"Query" name:"ResourceGroupId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` KeyPairFingerPrint string `position:"Query" name:"KeyPairFingerPrint"` PageSize requests.Integer `position:"Query" name:"PageSize"` KeyPairName string `position:"Query" name:"KeyPairName"` Tag *[]DescribeKeyPairsTag `position:"Query" name:"Tag" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeKeyPairsTag is a repeated param struct in DescribeKeyPairsRequest type DescribeKeyPairsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeKeyPairsResponse is the response struct for api DescribeKeyPairs type DescribeKeyPairsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` KeyPairs KeyPairs `json:"KeyPairs" xml:"KeyPairs"` } // CreateDescribeKeyPairsRequest creates a request to invoke DescribeKeyPairs API func CreateDescribeKeyPairsRequest() (request *DescribeKeyPairsRequest) { request = &DescribeKeyPairsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeKeyPairs", "ecs", "openAPI") return } // CreateDescribeKeyPairsResponse creates a response to parse from DescribeKeyPairs response func CreateDescribeKeyPairsResponse() (response *DescribeKeyPairsResponse) { response = &DescribeKeyPairsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_launch_template_versions.go����������������������������������������������������������������0000664�0000000�0000000�00000013034�13771713062�0035764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeLaunchTemplateVersions invokes the ecs.DescribeLaunchTemplateVersions API synchronously // api document: https://help.aliyun.com/api/ecs/describelaunchtemplateversions.html func (client *Client) DescribeLaunchTemplateVersions(request *DescribeLaunchTemplateVersionsRequest) (response *DescribeLaunchTemplateVersionsResponse, err error) { response = CreateDescribeLaunchTemplateVersionsResponse() err = client.DoAction(request, response) return } // DescribeLaunchTemplateVersionsWithChan invokes the ecs.DescribeLaunchTemplateVersions API asynchronously // api document: https://help.aliyun.com/api/ecs/describelaunchtemplateversions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeLaunchTemplateVersionsWithChan(request *DescribeLaunchTemplateVersionsRequest) (<-chan *DescribeLaunchTemplateVersionsResponse, <-chan error) { responseChan := make(chan *DescribeLaunchTemplateVersionsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeLaunchTemplateVersions(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeLaunchTemplateVersionsWithCallback invokes the ecs.DescribeLaunchTemplateVersions API asynchronously // api document: https://help.aliyun.com/api/ecs/describelaunchtemplateversions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeLaunchTemplateVersionsWithCallback(request *DescribeLaunchTemplateVersionsRequest, callback func(response *DescribeLaunchTemplateVersionsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeLaunchTemplateVersionsResponse var err error defer close(result) response, err = client.DescribeLaunchTemplateVersions(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeLaunchTemplateVersionsRequest is the request struct for api DescribeLaunchTemplateVersions type DescribeLaunchTemplateVersionsRequest struct { *requests.RpcRequest LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` MaxVersion requests.Integer `position:"Query" name:"MaxVersion"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` DefaultVersion requests.Boolean `position:"Query" name:"DefaultVersion"` MinVersion requests.Integer `position:"Query" name:"MinVersion"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` LaunchTemplateVersion *[]string `position:"Query" name:"LaunchTemplateVersion" type:"Repeated"` DetailFlag requests.Boolean `position:"Query" name:"DetailFlag"` } // DescribeLaunchTemplateVersionsResponse is the response struct for api DescribeLaunchTemplateVersions type DescribeLaunchTemplateVersionsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` LaunchTemplateVersionSets LaunchTemplateVersionSets `json:"LaunchTemplateVersionSets" xml:"LaunchTemplateVersionSets"` } // CreateDescribeLaunchTemplateVersionsRequest creates a request to invoke DescribeLaunchTemplateVersions API func CreateDescribeLaunchTemplateVersionsRequest() (request *DescribeLaunchTemplateVersionsRequest) { request = &DescribeLaunchTemplateVersionsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeLaunchTemplateVersions", "ecs", "openAPI") return } // CreateDescribeLaunchTemplateVersionsResponse creates a response to parse from DescribeLaunchTemplateVersions response func CreateDescribeLaunchTemplateVersionsResponse() (response *DescribeLaunchTemplateVersionsResponse) { response = &DescribeLaunchTemplateVersionsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_launch_templates.go������������������������������������������������������������������������0000664�0000000�0000000�00000012637�13771713062�0034227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeLaunchTemplates invokes the ecs.DescribeLaunchTemplates API synchronously // api document: https://help.aliyun.com/api/ecs/describelaunchtemplates.html func (client *Client) DescribeLaunchTemplates(request *DescribeLaunchTemplatesRequest) (response *DescribeLaunchTemplatesResponse, err error) { response = CreateDescribeLaunchTemplatesResponse() err = client.DoAction(request, response) return } // DescribeLaunchTemplatesWithChan invokes the ecs.DescribeLaunchTemplates API asynchronously // api document: https://help.aliyun.com/api/ecs/describelaunchtemplates.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeLaunchTemplatesWithChan(request *DescribeLaunchTemplatesRequest) (<-chan *DescribeLaunchTemplatesResponse, <-chan error) { responseChan := make(chan *DescribeLaunchTemplatesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeLaunchTemplates(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeLaunchTemplatesWithCallback invokes the ecs.DescribeLaunchTemplates API asynchronously // api document: https://help.aliyun.com/api/ecs/describelaunchtemplates.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeLaunchTemplatesWithCallback(request *DescribeLaunchTemplatesRequest, callback func(response *DescribeLaunchTemplatesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeLaunchTemplatesResponse var err error defer close(result) response, err = client.DescribeLaunchTemplates(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeLaunchTemplatesRequest is the request struct for api DescribeLaunchTemplates type DescribeLaunchTemplatesRequest struct { *requests.RpcRequest LaunchTemplateName *[]string `position:"Query" name:"LaunchTemplateName" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` TemplateTag *[]DescribeLaunchTemplatesTemplateTag `position:"Query" name:"TemplateTag" type:"Repeated"` LaunchTemplateId *[]string `position:"Query" name:"LaunchTemplateId" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` TemplateResourceGroupId string `position:"Query" name:"TemplateResourceGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeLaunchTemplatesTemplateTag is a repeated param struct in DescribeLaunchTemplatesRequest type DescribeLaunchTemplatesTemplateTag struct { Key string `name:"Key"` Value string `name:"Value"` } // DescribeLaunchTemplatesResponse is the response struct for api DescribeLaunchTemplates type DescribeLaunchTemplatesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` LaunchTemplateSets LaunchTemplateSets `json:"LaunchTemplateSets" xml:"LaunchTemplateSets"` } // CreateDescribeLaunchTemplatesRequest creates a request to invoke DescribeLaunchTemplates API func CreateDescribeLaunchTemplatesRequest() (request *DescribeLaunchTemplatesRequest) { request = &DescribeLaunchTemplatesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeLaunchTemplates", "ecs", "openAPI") return } // CreateDescribeLaunchTemplatesResponse creates a response to parse from DescribeLaunchTemplates response func CreateDescribeLaunchTemplatesResponse() (response *DescribeLaunchTemplatesResponse) { response = &DescribeLaunchTemplatesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_limitation.go��0000664�0000000�0000000�00000010145�13771713062�0033117�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeLimitation invokes the ecs.DescribeLimitation API synchronously // api document: https://help.aliyun.com/api/ecs/describelimitation.html func (client *Client) DescribeLimitation(request *DescribeLimitationRequest) (response *DescribeLimitationResponse, err error) { response = CreateDescribeLimitationResponse() err = client.DoAction(request, response) return } // DescribeLimitationWithChan invokes the ecs.DescribeLimitation API asynchronously // api document: https://help.aliyun.com/api/ecs/describelimitation.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeLimitationWithChan(request *DescribeLimitationRequest) (<-chan *DescribeLimitationResponse, <-chan error) { responseChan := make(chan *DescribeLimitationResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeLimitation(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeLimitationWithCallback invokes the ecs.DescribeLimitation API asynchronously // api document: https://help.aliyun.com/api/ecs/describelimitation.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeLimitationWithCallback(request *DescribeLimitationRequest, callback func(response *DescribeLimitationResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeLimitationResponse var err error defer close(result) response, err = client.DescribeLimitation(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeLimitationRequest is the request struct for api DescribeLimitation type DescribeLimitationRequest struct { *requests.RpcRequest Limitation string `position:"Query" name:"Limitation"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeLimitationResponse is the response struct for api DescribeLimitation type DescribeLimitationResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Limitation string `json:"Limitation" xml:"Limitation"` Value string `json:"Value" xml:"Value"` } // CreateDescribeLimitationRequest creates a request to invoke DescribeLimitation API func CreateDescribeLimitationRequest() (request *DescribeLimitationRequest) { request = &DescribeLimitationRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeLimitation", "ecs", "openAPI") return } // CreateDescribeLimitationResponse creates a response to parse from DescribeLimitation response func CreateDescribeLimitationResponse() (response *DescribeLimitationResponse) { response = &DescribeLimitationResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_nat_gateways.go0000664�0000000�0000000�00000011002�13771713062�0033425�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeNatGateways invokes the ecs.DescribeNatGateways API synchronously // api document: https://help.aliyun.com/api/ecs/describenatgateways.html func (client *Client) DescribeNatGateways(request *DescribeNatGatewaysRequest) (response *DescribeNatGatewaysResponse, err error) { response = CreateDescribeNatGatewaysResponse() err = client.DoAction(request, response) return } // DescribeNatGatewaysWithChan invokes the ecs.DescribeNatGateways API asynchronously // api document: https://help.aliyun.com/api/ecs/describenatgateways.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNatGatewaysWithChan(request *DescribeNatGatewaysRequest) (<-chan *DescribeNatGatewaysResponse, <-chan error) { responseChan := make(chan *DescribeNatGatewaysResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeNatGateways(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeNatGatewaysWithCallback invokes the ecs.DescribeNatGateways API asynchronously // api document: https://help.aliyun.com/api/ecs/describenatgateways.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNatGatewaysWithCallback(request *DescribeNatGatewaysRequest, callback func(response *DescribeNatGatewaysResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeNatGatewaysResponse var err error defer close(result) response, err = client.DescribeNatGateways(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeNatGatewaysRequest is the request struct for api DescribeNatGateways type DescribeNatGatewaysRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` VpcId string `position:"Query" name:"VpcId"` PageSize requests.Integer `position:"Query" name:"PageSize"` NatGatewayId string `position:"Query" name:"NatGatewayId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeNatGatewaysResponse is the response struct for api DescribeNatGateways type DescribeNatGatewaysResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` NatGateways NatGateways `json:"NatGateways" xml:"NatGateways"` } // CreateDescribeNatGatewaysRequest creates a request to invoke DescribeNatGateways API func CreateDescribeNatGatewaysRequest() (request *DescribeNatGatewaysRequest) { request = &DescribeNatGatewaysRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNatGateways", "ecs", "openAPI") return } // CreateDescribeNatGatewaysResponse creates a response to parse from DescribeNatGateways response func CreateDescribeNatGatewaysResponse() (response *DescribeNatGatewaysResponse) { response = &DescribeNatGatewaysResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_network_interface_permissions.go�����������������������������������������������������������0000664�0000000�0000000�00000012660�13771713062�0037037�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeNetworkInterfacePermissions invokes the ecs.DescribeNetworkInterfacePermissions API synchronously // api document: https://help.aliyun.com/api/ecs/describenetworkinterfacepermissions.html func (client *Client) DescribeNetworkInterfacePermissions(request *DescribeNetworkInterfacePermissionsRequest) (response *DescribeNetworkInterfacePermissionsResponse, err error) { response = CreateDescribeNetworkInterfacePermissionsResponse() err = client.DoAction(request, response) return } // DescribeNetworkInterfacePermissionsWithChan invokes the ecs.DescribeNetworkInterfacePermissions API asynchronously // api document: https://help.aliyun.com/api/ecs/describenetworkinterfacepermissions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNetworkInterfacePermissionsWithChan(request *DescribeNetworkInterfacePermissionsRequest) (<-chan *DescribeNetworkInterfacePermissionsResponse, <-chan error) { responseChan := make(chan *DescribeNetworkInterfacePermissionsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeNetworkInterfacePermissions(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeNetworkInterfacePermissionsWithCallback invokes the ecs.DescribeNetworkInterfacePermissions API asynchronously // api document: https://help.aliyun.com/api/ecs/describenetworkinterfacepermissions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNetworkInterfacePermissionsWithCallback(request *DescribeNetworkInterfacePermissionsRequest, callback func(response *DescribeNetworkInterfacePermissionsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeNetworkInterfacePermissionsResponse var err error defer close(result) response, err = client.DescribeNetworkInterfacePermissions(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeNetworkInterfacePermissionsRequest is the request struct for api DescribeNetworkInterfacePermissions type DescribeNetworkInterfacePermissionsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` PageSize requests.Integer `position:"Query" name:"PageSize"` NetworkInterfacePermissionId *[]string `position:"Query" name:"NetworkInterfacePermissionId" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // DescribeNetworkInterfacePermissionsResponse is the response struct for api DescribeNetworkInterfacePermissions type DescribeNetworkInterfacePermissionsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` NetworkInterfacePermissions NetworkInterfacePermissions `json:"NetworkInterfacePermissions" xml:"NetworkInterfacePermissions"` } // CreateDescribeNetworkInterfacePermissionsRequest creates a request to invoke DescribeNetworkInterfacePermissions API func CreateDescribeNetworkInterfacePermissionsRequest() (request *DescribeNetworkInterfacePermissionsRequest) { request = &DescribeNetworkInterfacePermissionsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNetworkInterfacePermissions", "ecs", "openAPI") return } // CreateDescribeNetworkInterfacePermissionsResponse creates a response to parse from DescribeNetworkInterfacePermissions response func CreateDescribeNetworkInterfacePermissionsResponse() (response *DescribeNetworkInterfacePermissionsResponse) { response = &DescribeNetworkInterfacePermissionsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������describe_network_interfaces.go����������������������������������������������������������������������0000664�0000000�0000000�00000014006�13771713062�0034563�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeNetworkInterfaces invokes the ecs.DescribeNetworkInterfaces API synchronously // api document: https://help.aliyun.com/api/ecs/describenetworkinterfaces.html func (client *Client) DescribeNetworkInterfaces(request *DescribeNetworkInterfacesRequest) (response *DescribeNetworkInterfacesResponse, err error) { response = CreateDescribeNetworkInterfacesResponse() err = client.DoAction(request, response) return } // DescribeNetworkInterfacesWithChan invokes the ecs.DescribeNetworkInterfaces API asynchronously // api document: https://help.aliyun.com/api/ecs/describenetworkinterfaces.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNetworkInterfacesWithChan(request *DescribeNetworkInterfacesRequest) (<-chan *DescribeNetworkInterfacesResponse, <-chan error) { responseChan := make(chan *DescribeNetworkInterfacesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeNetworkInterfaces(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeNetworkInterfacesWithCallback invokes the ecs.DescribeNetworkInterfaces API asynchronously // api document: https://help.aliyun.com/api/ecs/describenetworkinterfaces.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNetworkInterfacesWithCallback(request *DescribeNetworkInterfacesRequest, callback func(response *DescribeNetworkInterfacesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeNetworkInterfacesResponse var err error defer close(result) response, err = client.DescribeNetworkInterfaces(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeNetworkInterfacesRequest is the request struct for api DescribeNetworkInterfaces type DescribeNetworkInterfacesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ServiceManaged requests.Boolean `position:"Query" name:"ServiceManaged"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Type string `position:"Query" name:"Type"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` PageSize requests.Integer `position:"Query" name:"PageSize"` Tag *[]DescribeNetworkInterfacesTag `position:"Query" name:"Tag" type:"Repeated"` NetworkInterfaceName string `position:"Query" name:"NetworkInterfaceName"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` VSwitchId string `position:"Query" name:"VSwitchId"` InstanceId string `position:"Query" name:"InstanceId"` VpcId string `position:"Query" name:"VpcId"` PrimaryIpAddress string `position:"Query" name:"PrimaryIpAddress"` NetworkInterfaceId *[]string `position:"Query" name:"NetworkInterfaceId" type:"Repeated"` } // DescribeNetworkInterfacesTag is a repeated param struct in DescribeNetworkInterfacesRequest type DescribeNetworkInterfacesTag struct { Key string `name:"Key"` Value string `name:"Value"` } // DescribeNetworkInterfacesResponse is the response struct for api DescribeNetworkInterfaces type DescribeNetworkInterfacesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` NetworkInterfaceSets NetworkInterfaceSets `json:"NetworkInterfaceSets" xml:"NetworkInterfaceSets"` } // CreateDescribeNetworkInterfacesRequest creates a request to invoke DescribeNetworkInterfaces API func CreateDescribeNetworkInterfacesRequest() (request *DescribeNetworkInterfacesRequest) { request = &DescribeNetworkInterfacesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNetworkInterfaces", "ecs", "openAPI") return } // CreateDescribeNetworkInterfacesResponse creates a response to parse from DescribeNetworkInterfaces response func CreateDescribeNetworkInterfacesResponse() (response *DescribeNetworkInterfacesResponse) { response = &DescribeNetworkInterfacesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_new_project_eip_monitor_data.go������������������������������������������������������������0000664�0000000�0000000�00000011657�13771713062�0036614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeNewProjectEipMonitorData invokes the ecs.DescribeNewProjectEipMonitorData API synchronously // api document: https://help.aliyun.com/api/ecs/describenewprojecteipmonitordata.html func (client *Client) DescribeNewProjectEipMonitorData(request *DescribeNewProjectEipMonitorDataRequest) (response *DescribeNewProjectEipMonitorDataResponse, err error) { response = CreateDescribeNewProjectEipMonitorDataResponse() err = client.DoAction(request, response) return } // DescribeNewProjectEipMonitorDataWithChan invokes the ecs.DescribeNewProjectEipMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describenewprojecteipmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNewProjectEipMonitorDataWithChan(request *DescribeNewProjectEipMonitorDataRequest) (<-chan *DescribeNewProjectEipMonitorDataResponse, <-chan error) { responseChan := make(chan *DescribeNewProjectEipMonitorDataResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeNewProjectEipMonitorData(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeNewProjectEipMonitorDataWithCallback invokes the ecs.DescribeNewProjectEipMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describenewprojecteipmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeNewProjectEipMonitorDataWithCallback(request *DescribeNewProjectEipMonitorDataRequest, callback func(response *DescribeNewProjectEipMonitorDataResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeNewProjectEipMonitorDataResponse var err error defer close(result) response, err = client.DescribeNewProjectEipMonitorData(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeNewProjectEipMonitorDataRequest is the request struct for api DescribeNewProjectEipMonitorData type DescribeNewProjectEipMonitorDataRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` AllocationId string `position:"Query" name:"AllocationId"` StartTime string `position:"Query" name:"StartTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeNewProjectEipMonitorDataResponse is the response struct for api DescribeNewProjectEipMonitorData type DescribeNewProjectEipMonitorDataResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` EipMonitorDatas EipMonitorDatasInDescribeNewProjectEipMonitorData `json:"EipMonitorDatas" xml:"EipMonitorDatas"` } // CreateDescribeNewProjectEipMonitorDataRequest creates a request to invoke DescribeNewProjectEipMonitorData API func CreateDescribeNewProjectEipMonitorDataRequest() (request *DescribeNewProjectEipMonitorDataRequest) { request = &DescribeNewProjectEipMonitorDataRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeNewProjectEipMonitorData", "ecs", "openAPI") return } // CreateDescribeNewProjectEipMonitorDataResponse creates a response to parse from DescribeNewProjectEipMonitorData response func CreateDescribeNewProjectEipMonitorDataResponse() (response *DescribeNewProjectEipMonitorDataResponse) { response = &DescribeNewProjectEipMonitorDataResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������describe_physical_connections.go��������������������������������������������������������������������0000664�0000000�0000000�00000012660�13771713062�0035111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribePhysicalConnections invokes the ecs.DescribePhysicalConnections API synchronously // api document: https://help.aliyun.com/api/ecs/describephysicalconnections.html func (client *Client) DescribePhysicalConnections(request *DescribePhysicalConnectionsRequest) (response *DescribePhysicalConnectionsResponse, err error) { response = CreateDescribePhysicalConnectionsResponse() err = client.DoAction(request, response) return } // DescribePhysicalConnectionsWithChan invokes the ecs.DescribePhysicalConnections API asynchronously // api document: https://help.aliyun.com/api/ecs/describephysicalconnections.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribePhysicalConnectionsWithChan(request *DescribePhysicalConnectionsRequest) (<-chan *DescribePhysicalConnectionsResponse, <-chan error) { responseChan := make(chan *DescribePhysicalConnectionsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribePhysicalConnections(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribePhysicalConnectionsWithCallback invokes the ecs.DescribePhysicalConnections API asynchronously // api document: https://help.aliyun.com/api/ecs/describephysicalconnections.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribePhysicalConnectionsWithCallback(request *DescribePhysicalConnectionsRequest, callback func(response *DescribePhysicalConnectionsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribePhysicalConnectionsResponse var err error defer close(result) response, err = client.DescribePhysicalConnections(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribePhysicalConnectionsRequest is the request struct for api DescribePhysicalConnections type DescribePhysicalConnectionsRequest struct { *requests.RpcRequest Filter *[]DescribePhysicalConnectionsFilter `position:"Query" name:"Filter" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribePhysicalConnectionsFilter is a repeated param struct in DescribePhysicalConnectionsRequest type DescribePhysicalConnectionsFilter struct { Value *[]string `name:"Value" type:"Repeated"` Key string `name:"Key"` } // DescribePhysicalConnectionsResponse is the response struct for api DescribePhysicalConnections type DescribePhysicalConnectionsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PhysicalConnectionSet PhysicalConnectionSet `json:"PhysicalConnectionSet" xml:"PhysicalConnectionSet"` } // CreateDescribePhysicalConnectionsRequest creates a request to invoke DescribePhysicalConnections API func CreateDescribePhysicalConnectionsRequest() (request *DescribePhysicalConnectionsRequest) { request = &DescribePhysicalConnectionsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribePhysicalConnections", "ecs", "openAPI") return } // CreateDescribePhysicalConnectionsResponse creates a response to parse from DescribePhysicalConnections response func CreateDescribePhysicalConnectionsResponse() (response *DescribePhysicalConnectionsResponse) { response = &DescribePhysicalConnectionsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_price.go�������0000664�0000000�0000000�00000012672�13771713062�0032057�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribePrice invokes the ecs.DescribePrice API synchronously // api document: https://help.aliyun.com/api/ecs/describeprice.html func (client *Client) DescribePrice(request *DescribePriceRequest) (response *DescribePriceResponse, err error) { response = CreateDescribePriceResponse() err = client.DoAction(request, response) return } // DescribePriceWithChan invokes the ecs.DescribePrice API asynchronously // api document: https://help.aliyun.com/api/ecs/describeprice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribePriceWithChan(request *DescribePriceRequest) (<-chan *DescribePriceResponse, <-chan error) { responseChan := make(chan *DescribePriceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribePrice(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribePriceWithCallback invokes the ecs.DescribePrice API asynchronously // api document: https://help.aliyun.com/api/ecs/describeprice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribePriceWithCallback(request *DescribePriceRequest, callback func(response *DescribePriceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribePriceResponse var err error defer close(result) response, err = client.DescribePrice(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribePriceRequest is the request struct for api DescribePrice type DescribePriceRequest struct { *requests.RpcRequest DataDisk3Size requests.Integer `position:"Query" name:"DataDisk.3.Size"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` DataDisk3Category string `position:"Query" name:"DataDisk.3.Category"` IoOptimized string `position:"Query" name:"IoOptimized"` InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` DataDisk4Category string `position:"Query" name:"DataDisk.4.Category"` DataDisk4Size requests.Integer `position:"Query" name:"DataDisk.4.Size"` PriceUnit string `position:"Query" name:"PriceUnit"` InstanceType string `position:"Query" name:"InstanceType"` DataDisk2Category string `position:"Query" name:"DataDisk.2.Category"` DataDisk1Size requests.Integer `position:"Query" name:"DataDisk.1.Size"` Period requests.Integer `position:"Query" name:"Period"` Amount requests.Integer `position:"Query" name:"Amount"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DataDisk2Size requests.Integer `position:"Query" name:"DataDisk.2.Size"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` DataDisk1Category string `position:"Query" name:"DataDisk.1.Category"` SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` InternetChargeType string `position:"Query" name:"InternetChargeType"` InstanceNetworkType string `position:"Query" name:"InstanceNetworkType"` } // DescribePriceResponse is the response struct for api DescribePrice type DescribePriceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PriceInfo PriceInfo `json:"PriceInfo" xml:"PriceInfo"` } // CreateDescribePriceRequest creates a request to invoke DescribePrice API func CreateDescribePriceRequest() (request *DescribePriceRequest) { request = &DescribePriceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribePrice", "ecs", "openAPI") return } // CreateDescribePriceResponse creates a response to parse from DescribePrice response func CreateDescribePriceResponse() (response *DescribePriceResponse) { response = &DescribePriceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������describe_recommend_instance_type.go�����������������������������������������������������������������0000664�0000000�0000000�00000011632�13771713062�0035567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeRecommendInstanceType invokes the ecs.DescribeRecommendInstanceType API synchronously // api document: https://help.aliyun.com/api/ecs/describerecommendinstancetype.html func (client *Client) DescribeRecommendInstanceType(request *DescribeRecommendInstanceTypeRequest) (response *DescribeRecommendInstanceTypeResponse, err error) { response = CreateDescribeRecommendInstanceTypeResponse() err = client.DoAction(request, response) return } // DescribeRecommendInstanceTypeWithChan invokes the ecs.DescribeRecommendInstanceType API asynchronously // api document: https://help.aliyun.com/api/ecs/describerecommendinstancetype.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRecommendInstanceTypeWithChan(request *DescribeRecommendInstanceTypeRequest) (<-chan *DescribeRecommendInstanceTypeResponse, <-chan error) { responseChan := make(chan *DescribeRecommendInstanceTypeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeRecommendInstanceType(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeRecommendInstanceTypeWithCallback invokes the ecs.DescribeRecommendInstanceType API asynchronously // api document: https://help.aliyun.com/api/ecs/describerecommendinstancetype.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRecommendInstanceTypeWithCallback(request *DescribeRecommendInstanceTypeRequest, callback func(response *DescribeRecommendInstanceTypeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeRecommendInstanceTypeResponse var err error defer close(result) response, err = client.DescribeRecommendInstanceType(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeRecommendInstanceTypeRequest is the request struct for api DescribeRecommendInstanceType type DescribeRecommendInstanceTypeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Channel string `position:"Query" name:"channel"` NetworkType string `position:"Query" name:"NetworkType"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Operator string `position:"Query" name:"operator"` Token string `position:"Query" name:"token"` Scene string `position:"Query" name:"Scene"` InstanceType string `position:"Query" name:"InstanceType"` ProxyId string `position:"Query" name:"proxyId"` } // DescribeRecommendInstanceTypeResponse is the response struct for api DescribeRecommendInstanceType type DescribeRecommendInstanceTypeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Data Data `json:"Data" xml:"Data"` } // CreateDescribeRecommendInstanceTypeRequest creates a request to invoke DescribeRecommendInstanceType API func CreateDescribeRecommendInstanceTypeRequest() (request *DescribeRecommendInstanceTypeRequest) { request = &DescribeRecommendInstanceTypeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRecommendInstanceType", "ecs", "openAPI") return } // CreateDescribeRecommendInstanceTypeResponse creates a response to parse from DescribeRecommendInstanceType response func CreateDescribeRecommendInstanceTypeResponse() (response *DescribeRecommendInstanceTypeResponse) { response = &DescribeRecommendInstanceTypeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_regions.go�����0000664�0000000�0000000�00000010137�13771713062�0032415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeRegions invokes the ecs.DescribeRegions API synchronously // api document: https://help.aliyun.com/api/ecs/describeregions.html func (client *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { response = CreateDescribeRegionsResponse() err = client.DoAction(request, response) return } // DescribeRegionsWithChan invokes the ecs.DescribeRegions API asynchronously // api document: https://help.aliyun.com/api/ecs/describeregions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRegionsWithChan(request *DescribeRegionsRequest) (<-chan *DescribeRegionsResponse, <-chan error) { responseChan := make(chan *DescribeRegionsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeRegions(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeRegionsWithCallback invokes the ecs.DescribeRegions API asynchronously // api document: https://help.aliyun.com/api/ecs/describeregions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRegionsWithCallback(request *DescribeRegionsRequest, callback func(response *DescribeRegionsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeRegionsResponse var err error defer close(result) response, err = client.DescribeRegions(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeRegionsRequest is the request struct for api DescribeRegions type DescribeRegionsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AcceptLanguage string `position:"Query" name:"AcceptLanguage"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` ResourceType string `position:"Query" name:"ResourceType"` } // DescribeRegionsResponse is the response struct for api DescribeRegions type DescribeRegionsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Regions Regions `json:"Regions" xml:"Regions"` } // CreateDescribeRegionsRequest creates a request to invoke DescribeRegions API func CreateDescribeRegionsRequest() (request *DescribeRegionsRequest) { request = &DescribeRegionsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRegions", "ecs", "openAPI") return } // CreateDescribeRegionsResponse creates a response to parse from DescribeRegions response func CreateDescribeRegionsResponse() (response *DescribeRegionsResponse) { response = &DescribeRegionsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_renewal_price.go���������������������������������������������������������������������������0000664�0000000�0000000�00000010552�13771713062�0033510�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeRenewalPrice invokes the ecs.DescribeRenewalPrice API synchronously // api document: https://help.aliyun.com/api/ecs/describerenewalprice.html func (client *Client) DescribeRenewalPrice(request *DescribeRenewalPriceRequest) (response *DescribeRenewalPriceResponse, err error) { response = CreateDescribeRenewalPriceResponse() err = client.DoAction(request, response) return } // DescribeRenewalPriceWithChan invokes the ecs.DescribeRenewalPrice API asynchronously // api document: https://help.aliyun.com/api/ecs/describerenewalprice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRenewalPriceWithChan(request *DescribeRenewalPriceRequest) (<-chan *DescribeRenewalPriceResponse, <-chan error) { responseChan := make(chan *DescribeRenewalPriceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeRenewalPrice(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeRenewalPriceWithCallback invokes the ecs.DescribeRenewalPrice API asynchronously // api document: https://help.aliyun.com/api/ecs/describerenewalprice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRenewalPriceWithCallback(request *DescribeRenewalPriceRequest, callback func(response *DescribeRenewalPriceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeRenewalPriceResponse var err error defer close(result) response, err = client.DescribeRenewalPrice(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeRenewalPriceRequest is the request struct for api DescribeRenewalPrice type DescribeRenewalPriceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceId string `position:"Query" name:"ResourceId"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PriceUnit string `position:"Query" name:"PriceUnit"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` } // DescribeRenewalPriceResponse is the response struct for api DescribeRenewalPrice type DescribeRenewalPriceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PriceInfo PriceInfo `json:"PriceInfo" xml:"PriceInfo"` } // CreateDescribeRenewalPriceRequest creates a request to invoke DescribeRenewalPrice API func CreateDescribeRenewalPriceRequest() (request *DescribeRenewalPriceRequest) { request = &DescribeRenewalPriceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRenewalPrice", "ecs", "openAPI") return } // CreateDescribeRenewalPriceResponse creates a response to parse from DescribeRenewalPrice response func CreateDescribeRenewalPriceResponse() (response *DescribeRenewalPriceResponse) { response = &DescribeRenewalPriceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������describe_reserved_instances.go����������������������������������������������������������������������0000664�0000000�0000000�00000012604�13771713062�0034557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeReservedInstances invokes the ecs.DescribeReservedInstances API synchronously // api document: https://help.aliyun.com/api/ecs/describereservedinstances.html func (client *Client) DescribeReservedInstances(request *DescribeReservedInstancesRequest) (response *DescribeReservedInstancesResponse, err error) { response = CreateDescribeReservedInstancesResponse() err = client.DoAction(request, response) return } // DescribeReservedInstancesWithChan invokes the ecs.DescribeReservedInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/describereservedinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeReservedInstancesWithChan(request *DescribeReservedInstancesRequest) (<-chan *DescribeReservedInstancesResponse, <-chan error) { responseChan := make(chan *DescribeReservedInstancesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeReservedInstances(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeReservedInstancesWithCallback invokes the ecs.DescribeReservedInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/describereservedinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeReservedInstancesWithCallback(request *DescribeReservedInstancesRequest, callback func(response *DescribeReservedInstancesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeReservedInstancesResponse var err error defer close(result) response, err = client.DescribeReservedInstances(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeReservedInstancesRequest is the request struct for api DescribeReservedInstances type DescribeReservedInstancesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` LockReason string `position:"Query" name:"LockReason"` Scope string `position:"Query" name:"Scope"` PageSize requests.Integer `position:"Query" name:"PageSize"` InstanceType string `position:"Query" name:"InstanceType"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InstanceTypeFamily string `position:"Query" name:"InstanceTypeFamily"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ReservedInstanceId *[]string `position:"Query" name:"ReservedInstanceId" type:"Repeated"` OfferingType string `position:"Query" name:"OfferingType"` ZoneId string `position:"Query" name:"ZoneId"` ReservedInstanceName string `position:"Query" name:"ReservedInstanceName"` Status *[]string `position:"Query" name:"Status" type:"Repeated"` } // DescribeReservedInstancesResponse is the response struct for api DescribeReservedInstances type DescribeReservedInstancesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` ReservedInstances ReservedInstances `json:"ReservedInstances" xml:"ReservedInstances"` } // CreateDescribeReservedInstancesRequest creates a request to invoke DescribeReservedInstances API func CreateDescribeReservedInstancesRequest() (request *DescribeReservedInstancesRequest) { request = &DescribeReservedInstancesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeReservedInstances", "ecs", "openAPI") return } // CreateDescribeReservedInstancesResponse creates a response to parse from DescribeReservedInstances response func CreateDescribeReservedInstancesResponse() (response *DescribeReservedInstancesResponse) { response = &DescribeReservedInstancesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������describe_resource_by_tags.go������������������������������������������������������������������������0000664�0000000�0000000�00000011470�13771713062�0034230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeResourceByTags invokes the ecs.DescribeResourceByTags API synchronously // api document: https://help.aliyun.com/api/ecs/describeresourcebytags.html func (client *Client) DescribeResourceByTags(request *DescribeResourceByTagsRequest) (response *DescribeResourceByTagsResponse, err error) { response = CreateDescribeResourceByTagsResponse() err = client.DoAction(request, response) return } // DescribeResourceByTagsWithChan invokes the ecs.DescribeResourceByTags API asynchronously // api document: https://help.aliyun.com/api/ecs/describeresourcebytags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeResourceByTagsWithChan(request *DescribeResourceByTagsRequest) (<-chan *DescribeResourceByTagsResponse, <-chan error) { responseChan := make(chan *DescribeResourceByTagsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeResourceByTags(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeResourceByTagsWithCallback invokes the ecs.DescribeResourceByTags API asynchronously // api document: https://help.aliyun.com/api/ecs/describeresourcebytags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeResourceByTagsWithCallback(request *DescribeResourceByTagsRequest, callback func(response *DescribeResourceByTagsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeResourceByTagsResponse var err error defer close(result) response, err = client.DescribeResourceByTags(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeResourceByTagsRequest is the request struct for api DescribeResourceByTags type DescribeResourceByTagsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` Tag *[]DescribeResourceByTagsTag `position:"Query" name:"Tag" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeResourceByTagsTag is a repeated param struct in DescribeResourceByTagsRequest type DescribeResourceByTagsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeResourceByTagsResponse is the response struct for api DescribeResourceByTags type DescribeResourceByTagsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageSize int `json:"PageSize" xml:"PageSize"` PageNumber int `json:"PageNumber" xml:"PageNumber"` TotalCount int `json:"TotalCount" xml:"TotalCount"` Resources Resources `json:"Resources" xml:"Resources"` } // CreateDescribeResourceByTagsRequest creates a request to invoke DescribeResourceByTags API func CreateDescribeResourceByTagsRequest() (request *DescribeResourceByTagsRequest) { request = &DescribeResourceByTagsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeResourceByTags", "ecs", "openAPI") return } // CreateDescribeResourceByTagsResponse creates a response to parse from DescribeResourceByTags response func CreateDescribeResourceByTagsResponse() (response *DescribeResourceByTagsResponse) { response = &DescribeResourceByTagsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_resources_modification.go������������������������������������������������������������������0000664�0000000�0000000�00000012041�13771713062�0035423�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeResourcesModification invokes the ecs.DescribeResourcesModification API synchronously // api document: https://help.aliyun.com/api/ecs/describeresourcesmodification.html func (client *Client) DescribeResourcesModification(request *DescribeResourcesModificationRequest) (response *DescribeResourcesModificationResponse, err error) { response = CreateDescribeResourcesModificationResponse() err = client.DoAction(request, response) return } // DescribeResourcesModificationWithChan invokes the ecs.DescribeResourcesModification API asynchronously // api document: https://help.aliyun.com/api/ecs/describeresourcesmodification.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeResourcesModificationWithChan(request *DescribeResourcesModificationRequest) (<-chan *DescribeResourcesModificationResponse, <-chan error) { responseChan := make(chan *DescribeResourcesModificationResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeResourcesModification(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeResourcesModificationWithCallback invokes the ecs.DescribeResourcesModification API asynchronously // api document: https://help.aliyun.com/api/ecs/describeresourcesmodification.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeResourcesModificationWithCallback(request *DescribeResourcesModificationRequest, callback func(response *DescribeResourcesModificationResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeResourcesModificationResponse var err error defer close(result) response, err = client.DescribeResourcesModification(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeResourcesModificationRequest is the request struct for api DescribeResourcesModification type DescribeResourcesModificationRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Memory requests.Float `position:"Query" name:"Memory"` Cores requests.Integer `position:"Query" name:"Cores"` MigrateAcrossZone requests.Boolean `position:"Query" name:"MigrateAcrossZone"` InstanceType string `position:"Query" name:"InstanceType"` ResourceId string `position:"Query" name:"ResourceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OperationType string `position:"Query" name:"OperationType"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DestinationResource string `position:"Query" name:"DestinationResource"` } // DescribeResourcesModificationResponse is the response struct for api DescribeResourcesModification type DescribeResourcesModificationResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AvailableZones AvailableZonesInDescribeResourcesModification `json:"AvailableZones" xml:"AvailableZones"` } // CreateDescribeResourcesModificationRequest creates a request to invoke DescribeResourcesModification API func CreateDescribeResourcesModificationRequest() (request *DescribeResourcesModificationRequest) { request = &DescribeResourcesModificationRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeResourcesModification", "ecs", "openAPI") return } // CreateDescribeResourcesModificationResponse creates a response to parse from DescribeResourcesModification response func CreateDescribeResourcesModificationResponse() (response *DescribeResourcesModificationResponse) { response = &DescribeResourcesModificationResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_route_tables.go0000664�0000000�0000000�00000011354�13771713062�0033441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeRouteTables invokes the ecs.DescribeRouteTables API synchronously // api document: https://help.aliyun.com/api/ecs/describeroutetables.html func (client *Client) DescribeRouteTables(request *DescribeRouteTablesRequest) (response *DescribeRouteTablesResponse, err error) { response = CreateDescribeRouteTablesResponse() err = client.DoAction(request, response) return } // DescribeRouteTablesWithChan invokes the ecs.DescribeRouteTables API asynchronously // api document: https://help.aliyun.com/api/ecs/describeroutetables.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRouteTablesWithChan(request *DescribeRouteTablesRequest) (<-chan *DescribeRouteTablesResponse, <-chan error) { responseChan := make(chan *DescribeRouteTablesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeRouteTables(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeRouteTablesWithCallback invokes the ecs.DescribeRouteTables API asynchronously // api document: https://help.aliyun.com/api/ecs/describeroutetables.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRouteTablesWithCallback(request *DescribeRouteTablesRequest, callback func(response *DescribeRouteTablesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeRouteTablesResponse var err error defer close(result) response, err = client.DescribeRouteTables(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeRouteTablesRequest is the request struct for api DescribeRouteTables type DescribeRouteTablesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` VRouterId string `position:"Query" name:"VRouterId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` RouterType string `position:"Query" name:"RouterType"` RouteTableName string `position:"Query" name:"RouteTableName"` RouterId string `position:"Query" name:"RouterId"` PageSize requests.Integer `position:"Query" name:"PageSize"` RouteTableId string `position:"Query" name:"RouteTableId"` } // DescribeRouteTablesResponse is the response struct for api DescribeRouteTables type DescribeRouteTablesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` RouteTables RouteTables `json:"RouteTables" xml:"RouteTables"` } // CreateDescribeRouteTablesRequest creates a request to invoke DescribeRouteTables API func CreateDescribeRouteTablesRequest() (request *DescribeRouteTablesRequest) { request = &DescribeRouteTablesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRouteTables", "ecs", "openAPI") return } // CreateDescribeRouteTablesResponse creates a response to parse from DescribeRouteTables response func CreateDescribeRouteTablesResponse() (response *DescribeRouteTablesResponse) { response = &DescribeRouteTablesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_router_interfaces.go�����������������������������������������������������������������������0000664�0000000�0000000�00000011730�13771713062�0034413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeRouterInterfaces invokes the ecs.DescribeRouterInterfaces API synchronously // api document: https://help.aliyun.com/api/ecs/describerouterinterfaces.html func (client *Client) DescribeRouterInterfaces(request *DescribeRouterInterfacesRequest) (response *DescribeRouterInterfacesResponse, err error) { response = CreateDescribeRouterInterfacesResponse() err = client.DoAction(request, response) return } // DescribeRouterInterfacesWithChan invokes the ecs.DescribeRouterInterfaces API asynchronously // api document: https://help.aliyun.com/api/ecs/describerouterinterfaces.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRouterInterfacesWithChan(request *DescribeRouterInterfacesRequest) (<-chan *DescribeRouterInterfacesResponse, <-chan error) { responseChan := make(chan *DescribeRouterInterfacesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeRouterInterfaces(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeRouterInterfacesWithCallback invokes the ecs.DescribeRouterInterfaces API asynchronously // api document: https://help.aliyun.com/api/ecs/describerouterinterfaces.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeRouterInterfacesWithCallback(request *DescribeRouterInterfacesRequest, callback func(response *DescribeRouterInterfacesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeRouterInterfacesResponse var err error defer close(result) response, err = client.DescribeRouterInterfaces(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeRouterInterfacesRequest is the request struct for api DescribeRouterInterfaces type DescribeRouterInterfacesRequest struct { *requests.RpcRequest Filter *[]DescribeRouterInterfacesFilter `position:"Query" name:"Filter" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeRouterInterfacesFilter is a repeated param struct in DescribeRouterInterfacesRequest type DescribeRouterInterfacesFilter struct { Value *[]string `name:"Value" type:"Repeated"` Key string `name:"Key"` } // DescribeRouterInterfacesResponse is the response struct for api DescribeRouterInterfaces type DescribeRouterInterfacesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` TotalCount int `json:"TotalCount" xml:"TotalCount"` RouterInterfaceSet RouterInterfaceSet `json:"RouterInterfaceSet" xml:"RouterInterfaceSet"` } // CreateDescribeRouterInterfacesRequest creates a request to invoke DescribeRouterInterfaces API func CreateDescribeRouterInterfacesRequest() (request *DescribeRouterInterfacesRequest) { request = &DescribeRouterInterfacesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeRouterInterfaces", "ecs", "openAPI") return } // CreateDescribeRouterInterfacesResponse creates a response to parse from DescribeRouterInterfaces response func CreateDescribeRouterInterfacesResponse() (response *DescribeRouterInterfacesResponse) { response = &DescribeRouterInterfacesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������describe_security_group_attribute.go����������������������������������������������������������������0000664�0000000�0000000�00000012174�13771713062�0036041�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSecurityGroupAttribute invokes the ecs.DescribeSecurityGroupAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroupattribute.html func (client *Client) DescribeSecurityGroupAttribute(request *DescribeSecurityGroupAttributeRequest) (response *DescribeSecurityGroupAttributeResponse, err error) { response = CreateDescribeSecurityGroupAttributeResponse() err = client.DoAction(request, response) return } // DescribeSecurityGroupAttributeWithChan invokes the ecs.DescribeSecurityGroupAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroupattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSecurityGroupAttributeWithChan(request *DescribeSecurityGroupAttributeRequest) (<-chan *DescribeSecurityGroupAttributeResponse, <-chan error) { responseChan := make(chan *DescribeSecurityGroupAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSecurityGroupAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSecurityGroupAttributeWithCallback invokes the ecs.DescribeSecurityGroupAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroupattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSecurityGroupAttributeWithCallback(request *DescribeSecurityGroupAttributeRequest, callback func(response *DescribeSecurityGroupAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSecurityGroupAttributeResponse var err error defer close(result) response, err = client.DescribeSecurityGroupAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSecurityGroupAttributeRequest is the request struct for api DescribeSecurityGroupAttribute type DescribeSecurityGroupAttributeRequest struct { *requests.RpcRequest NicType string `position:"Query" name:"NicType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Direction string `position:"Query" name:"Direction"` } // DescribeSecurityGroupAttributeResponse is the response struct for api DescribeSecurityGroupAttribute type DescribeSecurityGroupAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` Description string `json:"Description" xml:"Description"` SecurityGroupName string `json:"SecurityGroupName" xml:"SecurityGroupName"` VpcId string `json:"VpcId" xml:"VpcId"` InnerAccessPolicy string `json:"InnerAccessPolicy" xml:"InnerAccessPolicy"` Permissions Permissions `json:"Permissions" xml:"Permissions"` } // CreateDescribeSecurityGroupAttributeRequest creates a request to invoke DescribeSecurityGroupAttribute API func CreateDescribeSecurityGroupAttributeRequest() (request *DescribeSecurityGroupAttributeRequest) { request = &DescribeSecurityGroupAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSecurityGroupAttribute", "ecs", "openAPI") return } // CreateDescribeSecurityGroupAttributeResponse creates a response to parse from DescribeSecurityGroupAttribute response func CreateDescribeSecurityGroupAttributeResponse() (response *DescribeSecurityGroupAttributeResponse) { response = &DescribeSecurityGroupAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_security_group_references.go���������������������������������������������������������������0000664�0000000�0000000�00000011253�13771713062�0036154�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSecurityGroupReferences invokes the ecs.DescribeSecurityGroupReferences API synchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroupreferences.html func (client *Client) DescribeSecurityGroupReferences(request *DescribeSecurityGroupReferencesRequest) (response *DescribeSecurityGroupReferencesResponse, err error) { response = CreateDescribeSecurityGroupReferencesResponse() err = client.DoAction(request, response) return } // DescribeSecurityGroupReferencesWithChan invokes the ecs.DescribeSecurityGroupReferences API asynchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroupreferences.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSecurityGroupReferencesWithChan(request *DescribeSecurityGroupReferencesRequest) (<-chan *DescribeSecurityGroupReferencesResponse, <-chan error) { responseChan := make(chan *DescribeSecurityGroupReferencesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSecurityGroupReferences(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSecurityGroupReferencesWithCallback invokes the ecs.DescribeSecurityGroupReferences API asynchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroupreferences.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSecurityGroupReferencesWithCallback(request *DescribeSecurityGroupReferencesRequest, callback func(response *DescribeSecurityGroupReferencesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSecurityGroupReferencesResponse var err error defer close(result) response, err = client.DescribeSecurityGroupReferences(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSecurityGroupReferencesRequest is the request struct for api DescribeSecurityGroupReferences type DescribeSecurityGroupReferencesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId *[]string `position:"Query" name:"SecurityGroupId" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeSecurityGroupReferencesResponse is the response struct for api DescribeSecurityGroupReferences type DescribeSecurityGroupReferencesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` SecurityGroupReferences SecurityGroupReferences `json:"SecurityGroupReferences" xml:"SecurityGroupReferences"` } // CreateDescribeSecurityGroupReferencesRequest creates a request to invoke DescribeSecurityGroupReferences API func CreateDescribeSecurityGroupReferencesRequest() (request *DescribeSecurityGroupReferencesRequest) { request = &DescribeSecurityGroupReferencesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSecurityGroupReferences", "ecs", "openAPI") return } // CreateDescribeSecurityGroupReferencesResponse creates a response to parse from DescribeSecurityGroupReferences response func CreateDescribeSecurityGroupReferencesResponse() (response *DescribeSecurityGroupReferencesResponse) { response = &DescribeSecurityGroupReferencesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_security_groups.go�������������������������������������������������������������������������0000664�0000000�0000000�00000013333�13771713062�0034137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSecurityGroups invokes the ecs.DescribeSecurityGroups API synchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroups.html func (client *Client) DescribeSecurityGroups(request *DescribeSecurityGroupsRequest) (response *DescribeSecurityGroupsResponse, err error) { response = CreateDescribeSecurityGroupsResponse() err = client.DoAction(request, response) return } // DescribeSecurityGroupsWithChan invokes the ecs.DescribeSecurityGroups API asynchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroups.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSecurityGroupsWithChan(request *DescribeSecurityGroupsRequest) (<-chan *DescribeSecurityGroupsResponse, <-chan error) { responseChan := make(chan *DescribeSecurityGroupsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSecurityGroups(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSecurityGroupsWithCallback invokes the ecs.DescribeSecurityGroups API asynchronously // api document: https://help.aliyun.com/api/ecs/describesecuritygroups.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSecurityGroupsWithCallback(request *DescribeSecurityGroupsRequest, callback func(response *DescribeSecurityGroupsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSecurityGroupsResponse var err error defer close(result) response, err = client.DescribeSecurityGroups(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSecurityGroupsRequest is the request struct for api DescribeSecurityGroups type DescribeSecurityGroupsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` DryRun requests.Boolean `position:"Query" name:"DryRun"` FuzzyQuery requests.Boolean `position:"Query" name:"FuzzyQuery"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` IsQueryEcsCount requests.Boolean `position:"Query" name:"IsQueryEcsCount"` NetworkType string `position:"Query" name:"NetworkType"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` SecurityGroupIds string `position:"Query" name:"SecurityGroupIds"` SecurityGroupName string `position:"Query" name:"SecurityGroupName"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` VpcId string `position:"Query" name:"VpcId"` PageSize requests.Integer `position:"Query" name:"PageSize"` Tag *[]DescribeSecurityGroupsTag `position:"Query" name:"Tag" type:"Repeated"` } // DescribeSecurityGroupsTag is a repeated param struct in DescribeSecurityGroupsRequest type DescribeSecurityGroupsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeSecurityGroupsResponse is the response struct for api DescribeSecurityGroups type DescribeSecurityGroupsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` SecurityGroups SecurityGroups `json:"SecurityGroups" xml:"SecurityGroups"` } // CreateDescribeSecurityGroupsRequest creates a request to invoke DescribeSecurityGroups API func CreateDescribeSecurityGroupsRequest() (request *DescribeSecurityGroupsRequest) { request = &DescribeSecurityGroupsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSecurityGroups", "ecs", "openAPI") return } // CreateDescribeSecurityGroupsResponse creates a response to parse from DescribeSecurityGroups response func CreateDescribeSecurityGroupsResponse() (response *DescribeSecurityGroupsResponse) { response = &DescribeSecurityGroupsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_snapshot_links.go��������������������������������������������������������������������������0000664�0000000�0000000�00000011273�13771713062�0033731�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSnapshotLinks invokes the ecs.DescribeSnapshotLinks API synchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotlinks.html func (client *Client) DescribeSnapshotLinks(request *DescribeSnapshotLinksRequest) (response *DescribeSnapshotLinksResponse, err error) { response = CreateDescribeSnapshotLinksResponse() err = client.DoAction(request, response) return } // DescribeSnapshotLinksWithChan invokes the ecs.DescribeSnapshotLinks API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotlinks.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotLinksWithChan(request *DescribeSnapshotLinksRequest) (<-chan *DescribeSnapshotLinksResponse, <-chan error) { responseChan := make(chan *DescribeSnapshotLinksResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSnapshotLinks(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSnapshotLinksWithCallback invokes the ecs.DescribeSnapshotLinks API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotlinks.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotLinksWithCallback(request *DescribeSnapshotLinksRequest, callback func(response *DescribeSnapshotLinksResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSnapshotLinksResponse var err error defer close(result) response, err = client.DescribeSnapshotLinks(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSnapshotLinksRequest is the request struct for api DescribeSnapshotLinks type DescribeSnapshotLinksRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` DiskIds string `position:"Query" name:"DiskIds"` SnapshotLinkIds string `position:"Query" name:"SnapshotLinkIds"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeSnapshotLinksResponse is the response struct for api DescribeSnapshotLinks type DescribeSnapshotLinksResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` SnapshotLinks SnapshotLinks `json:"SnapshotLinks" xml:"SnapshotLinks"` } // CreateDescribeSnapshotLinksRequest creates a request to invoke DescribeSnapshotLinks API func CreateDescribeSnapshotLinksRequest() (request *DescribeSnapshotLinksRequest) { request = &DescribeSnapshotLinksRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotLinks", "ecs", "openAPI") return } // CreateDescribeSnapshotLinksResponse creates a response to parse from DescribeSnapshotLinks response func CreateDescribeSnapshotLinksResponse() (response *DescribeSnapshotLinksResponse) { response = &DescribeSnapshotLinksResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_snapshot_monitor_data.go�������������������������������������������������������������������0000664�0000000�0000000�00000011167�13771713062�0035273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSnapshotMonitorData invokes the ecs.DescribeSnapshotMonitorData API synchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotmonitordata.html func (client *Client) DescribeSnapshotMonitorData(request *DescribeSnapshotMonitorDataRequest) (response *DescribeSnapshotMonitorDataResponse, err error) { response = CreateDescribeSnapshotMonitorDataResponse() err = client.DoAction(request, response) return } // DescribeSnapshotMonitorDataWithChan invokes the ecs.DescribeSnapshotMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotMonitorDataWithChan(request *DescribeSnapshotMonitorDataRequest) (<-chan *DescribeSnapshotMonitorDataResponse, <-chan error) { responseChan := make(chan *DescribeSnapshotMonitorDataResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSnapshotMonitorData(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSnapshotMonitorDataWithCallback invokes the ecs.DescribeSnapshotMonitorData API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotmonitordata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotMonitorDataWithCallback(request *DescribeSnapshotMonitorDataRequest, callback func(response *DescribeSnapshotMonitorDataResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSnapshotMonitorDataResponse var err error defer close(result) response, err = client.DescribeSnapshotMonitorData(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSnapshotMonitorDataRequest is the request struct for api DescribeSnapshotMonitorData type DescribeSnapshotMonitorDataRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` StartTime string `position:"Query" name:"StartTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeSnapshotMonitorDataResponse is the response struct for api DescribeSnapshotMonitorData type DescribeSnapshotMonitorDataResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` MonitorData MonitorDataInDescribeSnapshotMonitorData `json:"MonitorData" xml:"MonitorData"` } // CreateDescribeSnapshotMonitorDataRequest creates a request to invoke DescribeSnapshotMonitorData API func CreateDescribeSnapshotMonitorDataRequest() (request *DescribeSnapshotMonitorDataRequest) { request = &DescribeSnapshotMonitorDataRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotMonitorData", "ecs", "openAPI") return } // CreateDescribeSnapshotMonitorDataResponse creates a response to parse from DescribeSnapshotMonitorData response func CreateDescribeSnapshotMonitorDataResponse() (response *DescribeSnapshotMonitorDataResponse) { response = &DescribeSnapshotMonitorDataResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_snapshot_package.go������������������������������������������������������������������������0000664�0000000�0000000�00000011111�13771713062�0034173�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSnapshotPackage invokes the ecs.DescribeSnapshotPackage API synchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotpackage.html func (client *Client) DescribeSnapshotPackage(request *DescribeSnapshotPackageRequest) (response *DescribeSnapshotPackageResponse, err error) { response = CreateDescribeSnapshotPackageResponse() err = client.DoAction(request, response) return } // DescribeSnapshotPackageWithChan invokes the ecs.DescribeSnapshotPackage API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotpackage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotPackageWithChan(request *DescribeSnapshotPackageRequest) (<-chan *DescribeSnapshotPackageResponse, <-chan error) { responseChan := make(chan *DescribeSnapshotPackageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSnapshotPackage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSnapshotPackageWithCallback invokes the ecs.DescribeSnapshotPackage API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotpackage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotPackageWithCallback(request *DescribeSnapshotPackageRequest, callback func(response *DescribeSnapshotPackageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSnapshotPackageResponse var err error defer close(result) response, err = client.DescribeSnapshotPackage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSnapshotPackageRequest is the request struct for api DescribeSnapshotPackage type DescribeSnapshotPackageRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeSnapshotPackageResponse is the response struct for api DescribeSnapshotPackage type DescribeSnapshotPackageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` SnapshotPackages SnapshotPackages `json:"SnapshotPackages" xml:"SnapshotPackages"` } // CreateDescribeSnapshotPackageRequest creates a request to invoke DescribeSnapshotPackage API func CreateDescribeSnapshotPackageRequest() (request *DescribeSnapshotPackageRequest) { request = &DescribeSnapshotPackageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotPackage", "ecs", "openAPI") return } // CreateDescribeSnapshotPackageResponse creates a response to parse from DescribeSnapshotPackage response func CreateDescribeSnapshotPackageResponse() (response *DescribeSnapshotPackageResponse) { response = &DescribeSnapshotPackageResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_snapshots.go���0000664�0000000�0000000�00000013713�13771713062�0032774�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSnapshots invokes the ecs.DescribeSnapshots API synchronously // api document: https://help.aliyun.com/api/ecs/describesnapshots.html func (client *Client) DescribeSnapshots(request *DescribeSnapshotsRequest) (response *DescribeSnapshotsResponse, err error) { response = CreateDescribeSnapshotsResponse() err = client.DoAction(request, response) return } // DescribeSnapshotsWithChan invokes the ecs.DescribeSnapshots API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshots.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotsWithChan(request *DescribeSnapshotsRequest) (<-chan *DescribeSnapshotsResponse, <-chan error) { responseChan := make(chan *DescribeSnapshotsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSnapshots(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSnapshotsWithCallback invokes the ecs.DescribeSnapshots API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshots.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotsWithCallback(request *DescribeSnapshotsRequest, callback func(response *DescribeSnapshotsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSnapshotsResponse var err error defer close(result) response, err = client.DescribeSnapshots(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSnapshotsRequest is the request struct for api DescribeSnapshots type DescribeSnapshotsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Filter2Value string `position:"Query" name:"Filter.2.Value"` SnapshotIds string `position:"Query" name:"SnapshotIds"` Usage string `position:"Query" name:"Usage"` SnapshotLinkId string `position:"Query" name:"SnapshotLinkId"` SnapshotName string `position:"Query" name:"SnapshotName"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` Filter1Key string `position:"Query" name:"Filter.1.Key"` PageSize requests.Integer `position:"Query" name:"PageSize"` DiskId string `position:"Query" name:"DiskId"` Tag *[]DescribeSnapshotsTag `position:"Query" name:"Tag" type:"Repeated"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SourceDiskType string `position:"Query" name:"SourceDiskType"` Filter1Value string `position:"Query" name:"Filter.1.Value"` Filter2Key string `position:"Query" name:"Filter.2.Key"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` Encrypted requests.Boolean `position:"Query" name:"Encrypted"` SnapshotType string `position:"Query" name:"SnapshotType"` KMSKeyId string `position:"Query" name:"KMSKeyId"` Status string `position:"Query" name:"Status"` } // DescribeSnapshotsTag is a repeated param struct in DescribeSnapshotsRequest type DescribeSnapshotsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeSnapshotsResponse is the response struct for api DescribeSnapshots type DescribeSnapshotsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Snapshots Snapshots `json:"Snapshots" xml:"Snapshots"` } // CreateDescribeSnapshotsRequest creates a request to invoke DescribeSnapshots API func CreateDescribeSnapshotsRequest() (request *DescribeSnapshotsRequest) { request = &DescribeSnapshotsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshots", "ecs", "openAPI") return } // CreateDescribeSnapshotsResponse creates a response to parse from DescribeSnapshots response func CreateDescribeSnapshotsResponse() (response *DescribeSnapshotsResponse) { response = &DescribeSnapshotsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������describe_snapshots_usage.go�������������������������������������������������������������������������0000664�0000000�0000000�00000010326�13771713062�0034076�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSnapshotsUsage invokes the ecs.DescribeSnapshotsUsage API synchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotsusage.html func (client *Client) DescribeSnapshotsUsage(request *DescribeSnapshotsUsageRequest) (response *DescribeSnapshotsUsageResponse, err error) { response = CreateDescribeSnapshotsUsageResponse() err = client.DoAction(request, response) return } // DescribeSnapshotsUsageWithChan invokes the ecs.DescribeSnapshotsUsage API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotsusage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotsUsageWithChan(request *DescribeSnapshotsUsageRequest) (<-chan *DescribeSnapshotsUsageResponse, <-chan error) { responseChan := make(chan *DescribeSnapshotsUsageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSnapshotsUsage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSnapshotsUsageWithCallback invokes the ecs.DescribeSnapshotsUsage API asynchronously // api document: https://help.aliyun.com/api/ecs/describesnapshotsusage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSnapshotsUsageWithCallback(request *DescribeSnapshotsUsageRequest, callback func(response *DescribeSnapshotsUsageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSnapshotsUsageResponse var err error defer close(result) response, err = client.DescribeSnapshotsUsage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSnapshotsUsageRequest is the request struct for api DescribeSnapshotsUsage type DescribeSnapshotsUsageRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeSnapshotsUsageResponse is the response struct for api DescribeSnapshotsUsage type DescribeSnapshotsUsageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` SnapshotCount int `json:"SnapshotCount" xml:"SnapshotCount"` SnapshotSize int `json:"SnapshotSize" xml:"SnapshotSize"` } // CreateDescribeSnapshotsUsageRequest creates a request to invoke DescribeSnapshotsUsage API func CreateDescribeSnapshotsUsageRequest() (request *DescribeSnapshotsUsageRequest) { request = &DescribeSnapshotsUsageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSnapshotsUsage", "ecs", "openAPI") return } // CreateDescribeSnapshotsUsageResponse creates a response to parse from DescribeSnapshotsUsage response func CreateDescribeSnapshotsUsageResponse() (response *DescribeSnapshotsUsageResponse) { response = &DescribeSnapshotsUsageResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_spot_price_history.go����������������������������������������������������������������������0000664�0000000�0000000�00000011653�13771713062�0034624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeSpotPriceHistory invokes the ecs.DescribeSpotPriceHistory API synchronously // api document: https://help.aliyun.com/api/ecs/describespotpricehistory.html func (client *Client) DescribeSpotPriceHistory(request *DescribeSpotPriceHistoryRequest) (response *DescribeSpotPriceHistoryResponse, err error) { response = CreateDescribeSpotPriceHistoryResponse() err = client.DoAction(request, response) return } // DescribeSpotPriceHistoryWithChan invokes the ecs.DescribeSpotPriceHistory API asynchronously // api document: https://help.aliyun.com/api/ecs/describespotpricehistory.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSpotPriceHistoryWithChan(request *DescribeSpotPriceHistoryRequest) (<-chan *DescribeSpotPriceHistoryResponse, <-chan error) { responseChan := make(chan *DescribeSpotPriceHistoryResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeSpotPriceHistory(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeSpotPriceHistoryWithCallback invokes the ecs.DescribeSpotPriceHistory API asynchronously // api document: https://help.aliyun.com/api/ecs/describespotpricehistory.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeSpotPriceHistoryWithCallback(request *DescribeSpotPriceHistoryRequest, callback func(response *DescribeSpotPriceHistoryResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeSpotPriceHistoryResponse var err error defer close(result) response, err = client.DescribeSpotPriceHistory(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeSpotPriceHistoryRequest is the request struct for api DescribeSpotPriceHistory type DescribeSpotPriceHistoryRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` IoOptimized string `position:"Query" name:"IoOptimized"` NetworkType string `position:"Query" name:"NetworkType"` StartTime string `position:"Query" name:"StartTime"` InstanceType string `position:"Query" name:"InstanceType"` Offset requests.Integer `position:"Query" name:"Offset"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` OSType string `position:"Query" name:"OSType"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ZoneId string `position:"Query" name:"ZoneId"` } // DescribeSpotPriceHistoryResponse is the response struct for api DescribeSpotPriceHistory type DescribeSpotPriceHistoryResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` NextOffset int `json:"NextOffset" xml:"NextOffset"` Currency string `json:"Currency" xml:"Currency"` SpotPrices SpotPrices `json:"SpotPrices" xml:"SpotPrices"` } // CreateDescribeSpotPriceHistoryRequest creates a request to invoke DescribeSpotPriceHistory API func CreateDescribeSpotPriceHistoryRequest() (request *DescribeSpotPriceHistoryRequest) { request = &DescribeSpotPriceHistoryRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeSpotPriceHistory", "ecs", "openAPI") return } // CreateDescribeSpotPriceHistoryResponse creates a response to parse from DescribeSpotPriceHistory response func CreateDescribeSpotPriceHistoryResponse() (response *DescribeSpotPriceHistoryResponse) { response = &DescribeSpotPriceHistoryResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tags.go��������0000664�0000000�0000000�00000010665�13771713062�0031713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeTags invokes the ecs.DescribeTags API synchronously // api document: https://help.aliyun.com/api/ecs/describetags.html func (client *Client) DescribeTags(request *DescribeTagsRequest) (response *DescribeTagsResponse, err error) { response = CreateDescribeTagsResponse() err = client.DoAction(request, response) return } // DescribeTagsWithChan invokes the ecs.DescribeTags API asynchronously // api document: https://help.aliyun.com/api/ecs/describetags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeTagsWithChan(request *DescribeTagsRequest) (<-chan *DescribeTagsResponse, <-chan error) { responseChan := make(chan *DescribeTagsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeTags(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeTagsWithCallback invokes the ecs.DescribeTags API asynchronously // api document: https://help.aliyun.com/api/ecs/describetags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeTagsWithCallback(request *DescribeTagsRequest, callback func(response *DescribeTagsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeTagsResponse var err error defer close(result) response, err = client.DescribeTags(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeTagsRequest is the request struct for api DescribeTags type DescribeTagsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceId string `position:"Query" name:"ResourceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` Tag *[]DescribeTagsTag `position:"Query" name:"Tag" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeTagsTag is a repeated param struct in DescribeTagsRequest type DescribeTagsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // DescribeTagsResponse is the response struct for api DescribeTags type DescribeTagsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageSize int `json:"PageSize" xml:"PageSize"` PageNumber int `json:"PageNumber" xml:"PageNumber"` TotalCount int `json:"TotalCount" xml:"TotalCount"` Tags TagsInDescribeTags `json:"Tags" xml:"Tags"` } // CreateDescribeTagsRequest creates a request to invoke DescribeTags API func CreateDescribeTagsRequest() (request *DescribeTagsRequest) { request = &DescribeTagsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeTags", "ecs", "openAPI") return } // CreateDescribeTagsResponse creates a response to parse from DescribeTags response func CreateDescribeTagsResponse() (response *DescribeTagsResponse) { response = &DescribeTagsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������describe_task_attribute.go��������������������������������������������������������������������������0000664�0000000�0000000�00000012033�13771713062�0033712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeTaskAttribute invokes the ecs.DescribeTaskAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/describetaskattribute.html func (client *Client) DescribeTaskAttribute(request *DescribeTaskAttributeRequest) (response *DescribeTaskAttributeResponse, err error) { response = CreateDescribeTaskAttributeResponse() err = client.DoAction(request, response) return } // DescribeTaskAttributeWithChan invokes the ecs.DescribeTaskAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describetaskattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeTaskAttributeWithChan(request *DescribeTaskAttributeRequest) (<-chan *DescribeTaskAttributeResponse, <-chan error) { responseChan := make(chan *DescribeTaskAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeTaskAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeTaskAttributeWithCallback invokes the ecs.DescribeTaskAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/describetaskattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeTaskAttributeWithCallback(request *DescribeTaskAttributeRequest, callback func(response *DescribeTaskAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeTaskAttributeResponse var err error defer close(result) response, err = client.DescribeTaskAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeTaskAttributeRequest is the request struct for api DescribeTaskAttribute type DescribeTaskAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` TaskId string `position:"Query" name:"TaskId"` } // DescribeTaskAttributeResponse is the response struct for api DescribeTaskAttribute type DescribeTaskAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TaskId string `json:"TaskId" xml:"TaskId"` RegionId string `json:"RegionId" xml:"RegionId"` TaskAction string `json:"TaskAction" xml:"TaskAction"` TaskStatus string `json:"TaskStatus" xml:"TaskStatus"` TaskProcess string `json:"TaskProcess" xml:"TaskProcess"` SupportCancel string `json:"SupportCancel" xml:"SupportCancel"` TotalCount int `json:"TotalCount" xml:"TotalCount"` SuccessCount int `json:"SuccessCount" xml:"SuccessCount"` FailedCount int `json:"FailedCount" xml:"FailedCount"` CreationTime string `json:"CreationTime" xml:"CreationTime"` FinishedTime string `json:"FinishedTime" xml:"FinishedTime"` OperationProgressSet OperationProgressSet `json:"OperationProgressSet" xml:"OperationProgressSet"` } // CreateDescribeTaskAttributeRequest creates a request to invoke DescribeTaskAttribute API func CreateDescribeTaskAttributeRequest() (request *DescribeTaskAttributeRequest) { request = &DescribeTaskAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeTaskAttribute", "ecs", "openAPI") return } // CreateDescribeTaskAttributeResponse creates a response to parse from DescribeTaskAttribute response func CreateDescribeTaskAttributeResponse() (response *DescribeTaskAttributeResponse) { response = &DescribeTaskAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_tasks.go�������0000664�0000000�0000000�00000011006�13771713062�0032070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeTasks invokes the ecs.DescribeTasks API synchronously // api document: https://help.aliyun.com/api/ecs/describetasks.html func (client *Client) DescribeTasks(request *DescribeTasksRequest) (response *DescribeTasksResponse, err error) { response = CreateDescribeTasksResponse() err = client.DoAction(request, response) return } // DescribeTasksWithChan invokes the ecs.DescribeTasks API asynchronously // api document: https://help.aliyun.com/api/ecs/describetasks.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeTasksWithChan(request *DescribeTasksRequest) (<-chan *DescribeTasksResponse, <-chan error) { responseChan := make(chan *DescribeTasksResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeTasks(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeTasksWithCallback invokes the ecs.DescribeTasks API asynchronously // api document: https://help.aliyun.com/api/ecs/describetasks.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeTasksWithCallback(request *DescribeTasksRequest, callback func(response *DescribeTasksResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeTasksResponse var err error defer close(result) response, err = client.DescribeTasks(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeTasksRequest is the request struct for api DescribeTasks type DescribeTasksRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` EndTime string `position:"Query" name:"EndTime"` StartTime string `position:"Query" name:"StartTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` TaskIds string `position:"Query" name:"TaskIds"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` TaskStatus string `position:"Query" name:"TaskStatus"` PageSize requests.Integer `position:"Query" name:"PageSize"` TaskAction string `position:"Query" name:"TaskAction"` } // DescribeTasksResponse is the response struct for api DescribeTasks type DescribeTasksResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` TaskSet TaskSet `json:"TaskSet" xml:"TaskSet"` } // CreateDescribeTasksRequest creates a request to invoke DescribeTasks API func CreateDescribeTasksRequest() (request *DescribeTasksRequest) { request = &DescribeTasksRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeTasks", "ecs", "openAPI") return } // CreateDescribeTasksResponse creates a response to parse from DescribeTasks response func CreateDescribeTasksResponse() (response *DescribeTasksResponse) { response = &DescribeTasksResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_user_business_behavior.go������������������������������������������������������������������0000664�0000000�0000000�00000010712�13771713062�0035437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeUserBusinessBehavior invokes the ecs.DescribeUserBusinessBehavior API synchronously // api document: https://help.aliyun.com/api/ecs/describeuserbusinessbehavior.html func (client *Client) DescribeUserBusinessBehavior(request *DescribeUserBusinessBehaviorRequest) (response *DescribeUserBusinessBehaviorResponse, err error) { response = CreateDescribeUserBusinessBehaviorResponse() err = client.DoAction(request, response) return } // DescribeUserBusinessBehaviorWithChan invokes the ecs.DescribeUserBusinessBehavior API asynchronously // api document: https://help.aliyun.com/api/ecs/describeuserbusinessbehavior.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeUserBusinessBehaviorWithChan(request *DescribeUserBusinessBehaviorRequest) (<-chan *DescribeUserBusinessBehaviorResponse, <-chan error) { responseChan := make(chan *DescribeUserBusinessBehaviorResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeUserBusinessBehavior(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeUserBusinessBehaviorWithCallback invokes the ecs.DescribeUserBusinessBehavior API asynchronously // api document: https://help.aliyun.com/api/ecs/describeuserbusinessbehavior.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeUserBusinessBehaviorWithCallback(request *DescribeUserBusinessBehaviorRequest, callback func(response *DescribeUserBusinessBehaviorResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeUserBusinessBehaviorResponse var err error defer close(result) response, err = client.DescribeUserBusinessBehavior(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeUserBusinessBehaviorRequest is the request struct for api DescribeUserBusinessBehavior type DescribeUserBusinessBehaviorRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` StatusKey string `position:"Query" name:"statusKey"` } // DescribeUserBusinessBehaviorResponse is the response struct for api DescribeUserBusinessBehavior type DescribeUserBusinessBehaviorResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` StatusValue string `json:"StatusValue" xml:"StatusValue"` } // CreateDescribeUserBusinessBehaviorRequest creates a request to invoke DescribeUserBusinessBehavior API func CreateDescribeUserBusinessBehaviorRequest() (request *DescribeUserBusinessBehaviorRequest) { request = &DescribeUserBusinessBehaviorRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeUserBusinessBehavior", "ecs", "openAPI") return } // CreateDescribeUserBusinessBehaviorResponse creates a response to parse from DescribeUserBusinessBehavior response func CreateDescribeUserBusinessBehaviorResponse() (response *DescribeUserBusinessBehaviorResponse) { response = &DescribeUserBusinessBehaviorResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_user_data.go���0000664�0000000�0000000�00000010001�13771713062�0032704�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeUserData invokes the ecs.DescribeUserData API synchronously // api document: https://help.aliyun.com/api/ecs/describeuserdata.html func (client *Client) DescribeUserData(request *DescribeUserDataRequest) (response *DescribeUserDataResponse, err error) { response = CreateDescribeUserDataResponse() err = client.DoAction(request, response) return } // DescribeUserDataWithChan invokes the ecs.DescribeUserData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeuserdata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeUserDataWithChan(request *DescribeUserDataRequest) (<-chan *DescribeUserDataResponse, <-chan error) { responseChan := make(chan *DescribeUserDataResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeUserData(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeUserDataWithCallback invokes the ecs.DescribeUserData API asynchronously // api document: https://help.aliyun.com/api/ecs/describeuserdata.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeUserDataWithCallback(request *DescribeUserDataRequest, callback func(response *DescribeUserDataResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeUserDataResponse var err error defer close(result) response, err = client.DescribeUserData(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeUserDataRequest is the request struct for api DescribeUserData type DescribeUserDataRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeUserDataResponse is the response struct for api DescribeUserData type DescribeUserDataResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` RegionId string `json:"RegionId" xml:"RegionId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` UserData string `json:"UserData" xml:"UserData"` } // CreateDescribeUserDataRequest creates a request to invoke DescribeUserData API func CreateDescribeUserDataRequest() (request *DescribeUserDataRequest) { request = &DescribeUserDataRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeUserData", "ecs", "openAPI") return } // CreateDescribeUserDataResponse creates a response to parse from DescribeUserData response func CreateDescribeUserDataResponse() (response *DescribeUserDataResponse) { response = &DescribeUserDataResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_routers.go���0000664�0000000�0000000�00000010446�13771713062�0033002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeVRouters invokes the ecs.DescribeVRouters API synchronously // api document: https://help.aliyun.com/api/ecs/describevrouters.html func (client *Client) DescribeVRouters(request *DescribeVRoutersRequest) (response *DescribeVRoutersResponse, err error) { response = CreateDescribeVRoutersResponse() err = client.DoAction(request, response) return } // DescribeVRoutersWithChan invokes the ecs.DescribeVRouters API asynchronously // api document: https://help.aliyun.com/api/ecs/describevrouters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVRoutersWithChan(request *DescribeVRoutersRequest) (<-chan *DescribeVRoutersResponse, <-chan error) { responseChan := make(chan *DescribeVRoutersResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeVRouters(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeVRoutersWithCallback invokes the ecs.DescribeVRouters API asynchronously // api document: https://help.aliyun.com/api/ecs/describevrouters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVRoutersWithCallback(request *DescribeVRoutersRequest, callback func(response *DescribeVRoutersResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeVRoutersResponse var err error defer close(result) response, err = client.DescribeVRouters(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeVRoutersRequest is the request struct for api DescribeVRouters type DescribeVRoutersRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` VRouterId string `position:"Query" name:"VRouterId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeVRoutersResponse is the response struct for api DescribeVRouters type DescribeVRoutersResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` VRouters VRouters `json:"VRouters" xml:"VRouters"` } // CreateDescribeVRoutersRequest creates a request to invoke DescribeVRouters API func CreateDescribeVRoutersRequest() (request *DescribeVRoutersRequest) { request = &DescribeVRoutersRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVRouters", "ecs", "openAPI") return } // CreateDescribeVRoutersResponse creates a response to parse from DescribeVRouters response func CreateDescribeVRoutersResponse() (response *DescribeVRoutersResponse) { response = &DescribeVRoutersResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_v_switches.go��0000664�0000000�0000000�00000011057�13771713062�0033127�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeVSwitches invokes the ecs.DescribeVSwitches API synchronously // api document: https://help.aliyun.com/api/ecs/describevswitches.html func (client *Client) DescribeVSwitches(request *DescribeVSwitchesRequest) (response *DescribeVSwitchesResponse, err error) { response = CreateDescribeVSwitchesResponse() err = client.DoAction(request, response) return } // DescribeVSwitchesWithChan invokes the ecs.DescribeVSwitches API asynchronously // api document: https://help.aliyun.com/api/ecs/describevswitches.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVSwitchesWithChan(request *DescribeVSwitchesRequest) (<-chan *DescribeVSwitchesResponse, <-chan error) { responseChan := make(chan *DescribeVSwitchesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeVSwitches(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeVSwitchesWithCallback invokes the ecs.DescribeVSwitches API asynchronously // api document: https://help.aliyun.com/api/ecs/describevswitches.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVSwitchesWithCallback(request *DescribeVSwitchesRequest, callback func(response *DescribeVSwitchesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeVSwitchesResponse var err error defer close(result) response, err = client.DescribeVSwitches(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeVSwitchesRequest is the request struct for api DescribeVSwitches type DescribeVSwitchesRequest struct { *requests.RpcRequest VSwitchId string `position:"Query" name:"VSwitchId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VpcId string `position:"Query" name:"VpcId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` ZoneId string `position:"Query" name:"ZoneId"` IsDefault requests.Boolean `position:"Query" name:"IsDefault"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeVSwitchesResponse is the response struct for api DescribeVSwitches type DescribeVSwitchesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` VSwitches VSwitches `json:"VSwitches" xml:"VSwitches"` } // CreateDescribeVSwitchesRequest creates a request to invoke DescribeVSwitches API func CreateDescribeVSwitchesRequest() (request *DescribeVSwitchesRequest) { request = &DescribeVSwitchesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVSwitches", "ecs", "openAPI") return } // CreateDescribeVSwitchesResponse creates a response to parse from DescribeVSwitches response func CreateDescribeVSwitchesResponse() (response *DescribeVSwitchesResponse) { response = &DescribeVSwitchesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_virtual_border_routers.go������������������������������������������������������������������0000664�0000000�0000000�00000012314�13771713062�0035475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeVirtualBorderRouters invokes the ecs.DescribeVirtualBorderRouters API synchronously // api document: https://help.aliyun.com/api/ecs/describevirtualborderrouters.html func (client *Client) DescribeVirtualBorderRouters(request *DescribeVirtualBorderRoutersRequest) (response *DescribeVirtualBorderRoutersResponse, err error) { response = CreateDescribeVirtualBorderRoutersResponse() err = client.DoAction(request, response) return } // DescribeVirtualBorderRoutersWithChan invokes the ecs.DescribeVirtualBorderRouters API asynchronously // api document: https://help.aliyun.com/api/ecs/describevirtualborderrouters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVirtualBorderRoutersWithChan(request *DescribeVirtualBorderRoutersRequest) (<-chan *DescribeVirtualBorderRoutersResponse, <-chan error) { responseChan := make(chan *DescribeVirtualBorderRoutersResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeVirtualBorderRouters(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeVirtualBorderRoutersWithCallback invokes the ecs.DescribeVirtualBorderRouters API asynchronously // api document: https://help.aliyun.com/api/ecs/describevirtualborderrouters.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVirtualBorderRoutersWithCallback(request *DescribeVirtualBorderRoutersRequest, callback func(response *DescribeVirtualBorderRoutersResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeVirtualBorderRoutersResponse var err error defer close(result) response, err = client.DescribeVirtualBorderRouters(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeVirtualBorderRoutersRequest is the request struct for api DescribeVirtualBorderRouters type DescribeVirtualBorderRoutersRequest struct { *requests.RpcRequest Filter *[]DescribeVirtualBorderRoutersFilter `position:"Query" name:"Filter" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeVirtualBorderRoutersFilter is a repeated param struct in DescribeVirtualBorderRoutersRequest type DescribeVirtualBorderRoutersFilter struct { Value *[]string `name:"Value" type:"Repeated"` Key string `name:"Key"` } // DescribeVirtualBorderRoutersResponse is the response struct for api DescribeVirtualBorderRouters type DescribeVirtualBorderRoutersResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` TotalCount int `json:"TotalCount" xml:"TotalCount"` VirtualBorderRouterSet VirtualBorderRouterSet `json:"VirtualBorderRouterSet" xml:"VirtualBorderRouterSet"` } // CreateDescribeVirtualBorderRoutersRequest creates a request to invoke DescribeVirtualBorderRouters API func CreateDescribeVirtualBorderRoutersRequest() (request *DescribeVirtualBorderRoutersRequest) { request = &DescribeVirtualBorderRoutersRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVirtualBorderRouters", "ecs", "openAPI") return } // CreateDescribeVirtualBorderRoutersResponse creates a response to parse from DescribeVirtualBorderRouters response func CreateDescribeVirtualBorderRoutersResponse() (response *DescribeVirtualBorderRoutersResponse) { response = &DescribeVirtualBorderRoutersResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������describe_virtual_border_routers_for_physical_connection.go������������������������������������������0000664�0000000�0000000�00000015115�13771713062�0042460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeVirtualBorderRoutersForPhysicalConnection invokes the ecs.DescribeVirtualBorderRoutersForPhysicalConnection API synchronously // api document: https://help.aliyun.com/api/ecs/describevirtualborderroutersforphysicalconnection.html func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnection(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) (response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, err error) { response = CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse() err = client.DoAction(request, response) return } // DescribeVirtualBorderRoutersForPhysicalConnectionWithChan invokes the ecs.DescribeVirtualBorderRoutersForPhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/describevirtualborderroutersforphysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnectionWithChan(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) (<-chan *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, <-chan error) { responseChan := make(chan *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeVirtualBorderRoutersForPhysicalConnection(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeVirtualBorderRoutersForPhysicalConnectionWithCallback invokes the ecs.DescribeVirtualBorderRoutersForPhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/describevirtualborderroutersforphysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVirtualBorderRoutersForPhysicalConnectionWithCallback(request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest, callback func(response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse var err error defer close(result) response, err = client.DescribeVirtualBorderRoutersForPhysicalConnection(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeVirtualBorderRoutersForPhysicalConnectionRequest is the request struct for api DescribeVirtualBorderRoutersForPhysicalConnection type DescribeVirtualBorderRoutersForPhysicalConnectionRequest struct { *requests.RpcRequest Filter *[]DescribeVirtualBorderRoutersForPhysicalConnectionFilter `position:"Query" name:"Filter" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` PageSize requests.Integer `position:"Query" name:"PageSize"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeVirtualBorderRoutersForPhysicalConnectionFilter is a repeated param struct in DescribeVirtualBorderRoutersForPhysicalConnectionRequest type DescribeVirtualBorderRoutersForPhysicalConnectionFilter struct { Value *[]string `name:"Value" type:"Repeated"` Key string `name:"Key"` } // DescribeVirtualBorderRoutersForPhysicalConnectionResponse is the response struct for api DescribeVirtualBorderRoutersForPhysicalConnection type DescribeVirtualBorderRoutersForPhysicalConnectionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` TotalCount int `json:"TotalCount" xml:"TotalCount"` VirtualBorderRouterForPhysicalConnectionSet VirtualBorderRouterForPhysicalConnectionSet `json:"VirtualBorderRouterForPhysicalConnectionSet" xml:"VirtualBorderRouterForPhysicalConnectionSet"` } // CreateDescribeVirtualBorderRoutersForPhysicalConnectionRequest creates a request to invoke DescribeVirtualBorderRoutersForPhysicalConnection API func CreateDescribeVirtualBorderRoutersForPhysicalConnectionRequest() (request *DescribeVirtualBorderRoutersForPhysicalConnectionRequest) { request = &DescribeVirtualBorderRoutersForPhysicalConnectionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVirtualBorderRoutersForPhysicalConnection", "ecs", "openAPI") return } // CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse creates a response to parse from DescribeVirtualBorderRoutersForPhysicalConnection response func CreateDescribeVirtualBorderRoutersForPhysicalConnectionResponse() (response *DescribeVirtualBorderRoutersForPhysicalConnectionResponse) { response = &DescribeVirtualBorderRoutersForPhysicalConnectionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_vpcs.go��������0000664�0000000�0000000�00000010273�13771713062�0031723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeVpcs invokes the ecs.DescribeVpcs API synchronously // api document: https://help.aliyun.com/api/ecs/describevpcs.html func (client *Client) DescribeVpcs(request *DescribeVpcsRequest) (response *DescribeVpcsResponse, err error) { response = CreateDescribeVpcsResponse() err = client.DoAction(request, response) return } // DescribeVpcsWithChan invokes the ecs.DescribeVpcs API asynchronously // api document: https://help.aliyun.com/api/ecs/describevpcs.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVpcsWithChan(request *DescribeVpcsRequest) (<-chan *DescribeVpcsResponse, <-chan error) { responseChan := make(chan *DescribeVpcsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeVpcs(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeVpcsWithCallback invokes the ecs.DescribeVpcs API asynchronously // api document: https://help.aliyun.com/api/ecs/describevpcs.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeVpcsWithCallback(request *DescribeVpcsRequest, callback func(response *DescribeVpcsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeVpcsResponse var err error defer close(result) response, err = client.DescribeVpcs(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeVpcsRequest is the request struct for api DescribeVpcs type DescribeVpcsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VpcId string `position:"Query" name:"VpcId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` PageSize requests.Integer `position:"Query" name:"PageSize"` IsDefault requests.Boolean `position:"Query" name:"IsDefault"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` } // DescribeVpcsResponse is the response struct for api DescribeVpcs type DescribeVpcsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageNumber int `json:"PageNumber" xml:"PageNumber"` PageSize int `json:"PageSize" xml:"PageSize"` Vpcs Vpcs `json:"Vpcs" xml:"Vpcs"` } // CreateDescribeVpcsRequest creates a request to invoke DescribeVpcs API func CreateDescribeVpcsRequest() (request *DescribeVpcsRequest) { request = &DescribeVpcsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeVpcs", "ecs", "openAPI") return } // CreateDescribeVpcsResponse creates a response to parse from DescribeVpcs response func CreateDescribeVpcsResponse() (response *DescribeVpcsResponse) { response = &DescribeVpcsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/describe_zones.go�������0000664�0000000�0000000�00000010156�13771713062�0032106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DescribeZones invokes the ecs.DescribeZones API synchronously // api document: https://help.aliyun.com/api/ecs/describezones.html func (client *Client) DescribeZones(request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { response = CreateDescribeZonesResponse() err = client.DoAction(request, response) return } // DescribeZonesWithChan invokes the ecs.DescribeZones API asynchronously // api document: https://help.aliyun.com/api/ecs/describezones.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeZonesWithChan(request *DescribeZonesRequest) (<-chan *DescribeZonesResponse, <-chan error) { responseChan := make(chan *DescribeZonesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeZones(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeZonesWithCallback invokes the ecs.DescribeZones API asynchronously // api document: https://help.aliyun.com/api/ecs/describezones.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeZonesWithCallback(request *DescribeZonesRequest, callback func(response *DescribeZonesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeZonesResponse var err error defer close(result) response, err = client.DescribeZones(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeZonesRequest is the request struct for api DescribeZones type DescribeZonesRequest struct { *requests.RpcRequest SpotStrategy string `position:"Query" name:"SpotStrategy"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AcceptLanguage string `position:"Query" name:"AcceptLanguage"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` Verbose requests.Boolean `position:"Query" name:"Verbose"` } // DescribeZonesResponse is the response struct for api DescribeZones type DescribeZonesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Zones ZonesInDescribeZones `json:"Zones" xml:"Zones"` } // CreateDescribeZonesRequest creates a request to invoke DescribeZones API func CreateDescribeZonesRequest() (request *DescribeZonesRequest) { request = &DescribeZonesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DescribeZones", "ecs", "openAPI") return } // CreateDescribeZonesResponse creates a response to parse from DescribeZones response func CreateDescribeZonesResponse() (response *DescribeZonesResponse) { response = &DescribeZonesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������detach_classic_link_vpc.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010107�13771713062�0033643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachClassicLinkVpc invokes the ecs.DetachClassicLinkVpc API synchronously // api document: https://help.aliyun.com/api/ecs/detachclassiclinkvpc.html func (client *Client) DetachClassicLinkVpc(request *DetachClassicLinkVpcRequest) (response *DetachClassicLinkVpcResponse, err error) { response = CreateDetachClassicLinkVpcResponse() err = client.DoAction(request, response) return } // DetachClassicLinkVpcWithChan invokes the ecs.DetachClassicLinkVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/detachclassiclinkvpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachClassicLinkVpcWithChan(request *DetachClassicLinkVpcRequest) (<-chan *DetachClassicLinkVpcResponse, <-chan error) { responseChan := make(chan *DetachClassicLinkVpcResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachClassicLinkVpc(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachClassicLinkVpcWithCallback invokes the ecs.DetachClassicLinkVpc API asynchronously // api document: https://help.aliyun.com/api/ecs/detachclassiclinkvpc.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachClassicLinkVpcWithCallback(request *DetachClassicLinkVpcRequest, callback func(response *DetachClassicLinkVpcResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachClassicLinkVpcResponse var err error defer close(result) response, err = client.DetachClassicLinkVpc(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachClassicLinkVpcRequest is the request struct for api DetachClassicLinkVpc type DetachClassicLinkVpcRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VpcId string `position:"Query" name:"VpcId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DetachClassicLinkVpcResponse is the response struct for api DetachClassicLinkVpc type DetachClassicLinkVpcResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDetachClassicLinkVpcRequest creates a request to invoke DetachClassicLinkVpc API func CreateDetachClassicLinkVpcRequest() (request *DetachClassicLinkVpcRequest) { request = &DetachClassicLinkVpcRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DetachClassicLinkVpc", "ecs", "openAPI") return } // CreateDetachClassicLinkVpcResponse creates a response to parse from DetachClassicLinkVpc response func CreateDetachClassicLinkVpcResponse() (response *DetachClassicLinkVpcResponse) { response = &DetachClassicLinkVpcResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_disk.go����������0000664�0000000�0000000�00000007406�13771713062�0031356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachDisk invokes the ecs.DetachDisk API synchronously // api document: https://help.aliyun.com/api/ecs/detachdisk.html func (client *Client) DetachDisk(request *DetachDiskRequest) (response *DetachDiskResponse, err error) { response = CreateDetachDiskResponse() err = client.DoAction(request, response) return } // DetachDiskWithChan invokes the ecs.DetachDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/detachdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachDiskWithChan(request *DetachDiskRequest) (<-chan *DetachDiskResponse, <-chan error) { responseChan := make(chan *DetachDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachDiskWithCallback invokes the ecs.DetachDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/detachdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachDiskWithCallback(request *DetachDiskRequest, callback func(response *DetachDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachDiskResponse var err error defer close(result) response, err = client.DetachDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachDiskRequest is the request struct for api DetachDisk type DetachDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DiskId string `position:"Query" name:"DiskId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DetachDiskResponse is the response struct for api DetachDisk type DetachDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDetachDiskRequest creates a request to invoke DetachDisk API func CreateDetachDiskRequest() (request *DetachDiskRequest) { request = &DetachDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DetachDisk", "ecs", "openAPI") return } // CreateDetachDiskResponse creates a response to parse from DetachDisk response func CreateDetachDiskResponse() (response *DetachDiskResponse) { response = &DetachDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������detach_instance_ram_role.go�������������������������������������������������������������������������0000664�0000000�0000000�00000011103�13771713062�0034016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachInstanceRamRole invokes the ecs.DetachInstanceRamRole API synchronously // api document: https://help.aliyun.com/api/ecs/detachinstanceramrole.html func (client *Client) DetachInstanceRamRole(request *DetachInstanceRamRoleRequest) (response *DetachInstanceRamRoleResponse, err error) { response = CreateDetachInstanceRamRoleResponse() err = client.DoAction(request, response) return } // DetachInstanceRamRoleWithChan invokes the ecs.DetachInstanceRamRole API asynchronously // api document: https://help.aliyun.com/api/ecs/detachinstanceramrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachInstanceRamRoleWithChan(request *DetachInstanceRamRoleRequest) (<-chan *DetachInstanceRamRoleResponse, <-chan error) { responseChan := make(chan *DetachInstanceRamRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachInstanceRamRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachInstanceRamRoleWithCallback invokes the ecs.DetachInstanceRamRole API asynchronously // api document: https://help.aliyun.com/api/ecs/detachinstanceramrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachInstanceRamRoleWithCallback(request *DetachInstanceRamRoleRequest, callback func(response *DetachInstanceRamRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachInstanceRamRoleResponse var err error defer close(result) response, err = client.DetachInstanceRamRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachInstanceRamRoleRequest is the request struct for api DetachInstanceRamRole type DetachInstanceRamRoleRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` InstanceIds string `position:"Query" name:"InstanceIds"` RamRoleName string `position:"Query" name:"RamRoleName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DetachInstanceRamRoleResponse is the response struct for api DetachInstanceRamRole type DetachInstanceRamRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount int `json:"TotalCount" xml:"TotalCount"` FailCount int `json:"FailCount" xml:"FailCount"` RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` DetachInstanceRamRoleResults DetachInstanceRamRoleResults `json:"DetachInstanceRamRoleResults" xml:"DetachInstanceRamRoleResults"` } // CreateDetachInstanceRamRoleRequest creates a request to invoke DetachInstanceRamRole API func CreateDetachInstanceRamRoleRequest() (request *DetachInstanceRamRoleRequest) { request = &DetachInstanceRamRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DetachInstanceRamRole", "ecs", "openAPI") return } // CreateDetachInstanceRamRoleResponse creates a response to parse from DetachInstanceRamRole response func CreateDetachInstanceRamRoleResponse() (response *DetachInstanceRamRoleResponse) { response = &DetachInstanceRamRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/detach_key_pair.go������0000664�0000000�0000000�00000010146�13771713062�0032222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachKeyPair invokes the ecs.DetachKeyPair API synchronously // api document: https://help.aliyun.com/api/ecs/detachkeypair.html func (client *Client) DetachKeyPair(request *DetachKeyPairRequest) (response *DetachKeyPairResponse, err error) { response = CreateDetachKeyPairResponse() err = client.DoAction(request, response) return } // DetachKeyPairWithChan invokes the ecs.DetachKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/detachkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachKeyPairWithChan(request *DetachKeyPairRequest) (<-chan *DetachKeyPairResponse, <-chan error) { responseChan := make(chan *DetachKeyPairResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachKeyPair(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachKeyPairWithCallback invokes the ecs.DetachKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/detachkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachKeyPairWithCallback(request *DetachKeyPairRequest, callback func(response *DetachKeyPairResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachKeyPairResponse var err error defer close(result) response, err = client.DetachKeyPair(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachKeyPairRequest is the request struct for api DetachKeyPair type DetachKeyPairRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` InstanceIds string `position:"Query" name:"InstanceIds"` KeyPairName string `position:"Query" name:"KeyPairName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DetachKeyPairResponse is the response struct for api DetachKeyPair type DetachKeyPairResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TotalCount string `json:"TotalCount" xml:"TotalCount"` FailCount string `json:"FailCount" xml:"FailCount"` KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` Results ResultsInDetachKeyPair `json:"Results" xml:"Results"` } // CreateDetachKeyPairRequest creates a request to invoke DetachKeyPair API func CreateDetachKeyPairRequest() (request *DetachKeyPairRequest) { request = &DetachKeyPairRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DetachKeyPair", "ecs", "openAPI") return } // CreateDetachKeyPairResponse creates a response to parse from DetachKeyPair response func CreateDetachKeyPairResponse() (response *DetachKeyPairResponse) { response = &DetachKeyPairResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������detach_network_interface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000010362�13771713062�0034051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachNetworkInterface invokes the ecs.DetachNetworkInterface API synchronously // api document: https://help.aliyun.com/api/ecs/detachnetworkinterface.html func (client *Client) DetachNetworkInterface(request *DetachNetworkInterfaceRequest) (response *DetachNetworkInterfaceResponse, err error) { response = CreateDetachNetworkInterfaceResponse() err = client.DoAction(request, response) return } // DetachNetworkInterfaceWithChan invokes the ecs.DetachNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/detachnetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachNetworkInterfaceWithChan(request *DetachNetworkInterfaceRequest) (<-chan *DetachNetworkInterfaceResponse, <-chan error) { responseChan := make(chan *DetachNetworkInterfaceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachNetworkInterface(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachNetworkInterfaceWithCallback invokes the ecs.DetachNetworkInterface API asynchronously // api document: https://help.aliyun.com/api/ecs/detachnetworkinterface.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachNetworkInterfaceWithCallback(request *DetachNetworkInterfaceRequest, callback func(response *DetachNetworkInterfaceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachNetworkInterfaceResponse var err error defer close(result) response, err = client.DetachNetworkInterface(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachNetworkInterfaceRequest is the request struct for api DetachNetworkInterface type DetachNetworkInterfaceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // DetachNetworkInterfaceResponse is the response struct for api DetachNetworkInterface type DetachNetworkInterfaceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDetachNetworkInterfaceRequest creates a request to invoke DetachNetworkInterface API func CreateDetachNetworkInterfaceRequest() (request *DetachNetworkInterfaceRequest) { request = &DetachNetworkInterfaceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "DetachNetworkInterface", "ecs", "openAPI") return } // CreateDetachNetworkInterfaceResponse creates a response to parse from DetachNetworkInterface response func CreateDetachNetworkInterfaceResponse() (response *DetachNetworkInterfaceResponse) { response = &DetachNetworkInterfaceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_params.go������0000664�0000000�0000000�00000010177�13771713062�0032241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // EipFillParams invokes the ecs.EipFillParams API synchronously // api document: https://help.aliyun.com/api/ecs/eipfillparams.html func (client *Client) EipFillParams(request *EipFillParamsRequest) (response *EipFillParamsResponse, err error) { response = CreateEipFillParamsResponse() err = client.DoAction(request, response) return } // EipFillParamsWithChan invokes the ecs.EipFillParams API asynchronously // api document: https://help.aliyun.com/api/ecs/eipfillparams.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EipFillParamsWithChan(request *EipFillParamsRequest) (<-chan *EipFillParamsResponse, <-chan error) { responseChan := make(chan *EipFillParamsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.EipFillParams(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // EipFillParamsWithCallback invokes the ecs.EipFillParams API asynchronously // api document: https://help.aliyun.com/api/ecs/eipfillparams.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EipFillParamsWithCallback(request *EipFillParamsRequest, callback func(response *EipFillParamsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *EipFillParamsResponse var err error defer close(result) response, err = client.EipFillParams(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // EipFillParamsRequest is the request struct for api EipFillParams type EipFillParamsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Data string `position:"Query" name:"data"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // EipFillParamsResponse is the response struct for api EipFillParams type EipFillParamsResponse struct { *responses.BaseResponse RequestId string `json:"requestId" xml:"requestId"` Data string `json:"data" xml:"data"` Code string `json:"code" xml:"code"` Success bool `json:"success" xml:"success"` Message string `json:"message" xml:"message"` } // CreateEipFillParamsRequest creates a request to invoke EipFillParams API func CreateEipFillParamsRequest() (request *EipFillParamsRequest) { request = &EipFillParamsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "EipFillParams", "ecs", "openAPI") return } // CreateEipFillParamsResponse creates a response to parse from EipFillParams response func CreateEipFillParamsResponse() (response *EipFillParamsResponse) { response = &EipFillParamsResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_fill_product.go�����0000664�0000000�0000000�00000010247�13771713062�0032434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // EipFillProduct invokes the ecs.EipFillProduct API synchronously // api document: https://help.aliyun.com/api/ecs/eipfillproduct.html func (client *Client) EipFillProduct(request *EipFillProductRequest) (response *EipFillProductResponse, err error) { response = CreateEipFillProductResponse() err = client.DoAction(request, response) return } // EipFillProductWithChan invokes the ecs.EipFillProduct API asynchronously // api document: https://help.aliyun.com/api/ecs/eipfillproduct.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EipFillProductWithChan(request *EipFillProductRequest) (<-chan *EipFillProductResponse, <-chan error) { responseChan := make(chan *EipFillProductResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.EipFillProduct(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // EipFillProductWithCallback invokes the ecs.EipFillProduct API asynchronously // api document: https://help.aliyun.com/api/ecs/eipfillproduct.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EipFillProductWithCallback(request *EipFillProductRequest, callback func(response *EipFillProductResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *EipFillProductResponse var err error defer close(result) response, err = client.EipFillProduct(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // EipFillProductRequest is the request struct for api EipFillProduct type EipFillProductRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Data string `position:"Query" name:"data"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // EipFillProductResponse is the response struct for api EipFillProduct type EipFillProductResponse struct { *responses.BaseResponse RequestId string `json:"requestId" xml:"requestId"` Data string `json:"data" xml:"data"` Code string `json:"code" xml:"code"` Success bool `json:"success" xml:"success"` Message string `json:"message" xml:"message"` } // CreateEipFillProductRequest creates a request to invoke EipFillProduct API func CreateEipFillProductRequest() (request *EipFillProductRequest) { request = &EipFillProductRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "EipFillProduct", "ecs", "openAPI") return } // CreateEipFillProductResponse creates a response to parse from EipFillProduct response func CreateEipFillProductResponse() (response *EipFillProductResponse) { response = &EipFillProductResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/eip_notify_paid.go������0000664�0000000�0000000�00000010177�13771713062�0032255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // EipNotifyPaid invokes the ecs.EipNotifyPaid API synchronously // api document: https://help.aliyun.com/api/ecs/eipnotifypaid.html func (client *Client) EipNotifyPaid(request *EipNotifyPaidRequest) (response *EipNotifyPaidResponse, err error) { response = CreateEipNotifyPaidResponse() err = client.DoAction(request, response) return } // EipNotifyPaidWithChan invokes the ecs.EipNotifyPaid API asynchronously // api document: https://help.aliyun.com/api/ecs/eipnotifypaid.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EipNotifyPaidWithChan(request *EipNotifyPaidRequest) (<-chan *EipNotifyPaidResponse, <-chan error) { responseChan := make(chan *EipNotifyPaidResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.EipNotifyPaid(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // EipNotifyPaidWithCallback invokes the ecs.EipNotifyPaid API asynchronously // api document: https://help.aliyun.com/api/ecs/eipnotifypaid.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EipNotifyPaidWithCallback(request *EipNotifyPaidRequest, callback func(response *EipNotifyPaidResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *EipNotifyPaidResponse var err error defer close(result) response, err = client.EipNotifyPaid(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // EipNotifyPaidRequest is the request struct for api EipNotifyPaid type EipNotifyPaidRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Data string `position:"Query" name:"data"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // EipNotifyPaidResponse is the response struct for api EipNotifyPaid type EipNotifyPaidResponse struct { *responses.BaseResponse RequestId string `json:"requestId" xml:"requestId"` Data string `json:"data" xml:"data"` Code string `json:"code" xml:"code"` Message string `json:"message" xml:"message"` Success bool `json:"success" xml:"success"` } // CreateEipNotifyPaidRequest creates a request to invoke EipNotifyPaid API func CreateEipNotifyPaidRequest() (request *EipNotifyPaidRequest) { request = &EipNotifyPaidRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "EipNotifyPaid", "ecs", "openAPI") return } // CreateEipNotifyPaidResponse creates a response to parse from EipNotifyPaid response func CreateEipNotifyPaidResponse() (response *EipNotifyPaidResponse) { response = &EipNotifyPaidResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������enable_physical_connection.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010617�13771713062�0034374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // EnablePhysicalConnection invokes the ecs.EnablePhysicalConnection API synchronously // api document: https://help.aliyun.com/api/ecs/enablephysicalconnection.html func (client *Client) EnablePhysicalConnection(request *EnablePhysicalConnectionRequest) (response *EnablePhysicalConnectionResponse, err error) { response = CreateEnablePhysicalConnectionResponse() err = client.DoAction(request, response) return } // EnablePhysicalConnectionWithChan invokes the ecs.EnablePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/enablephysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EnablePhysicalConnectionWithChan(request *EnablePhysicalConnectionRequest) (<-chan *EnablePhysicalConnectionResponse, <-chan error) { responseChan := make(chan *EnablePhysicalConnectionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.EnablePhysicalConnection(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // EnablePhysicalConnectionWithCallback invokes the ecs.EnablePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/enablephysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) EnablePhysicalConnectionWithCallback(request *EnablePhysicalConnectionRequest, callback func(response *EnablePhysicalConnectionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *EnablePhysicalConnectionResponse var err error defer close(result) response, err = client.EnablePhysicalConnection(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // EnablePhysicalConnectionRequest is the request struct for api EnablePhysicalConnection type EnablePhysicalConnectionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // EnablePhysicalConnectionResponse is the response struct for api EnablePhysicalConnection type EnablePhysicalConnectionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateEnablePhysicalConnectionRequest creates a request to invoke EnablePhysicalConnection API func CreateEnablePhysicalConnectionRequest() (request *EnablePhysicalConnectionRequest) { request = &EnablePhysicalConnectionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "EnablePhysicalConnection", "ecs", "openAPI") return } // CreateEnablePhysicalConnectionResponse creates a response to parse from EnablePhysicalConnection response func CreateEnablePhysicalConnectionResponse() (response *EnablePhysicalConnectionResponse) { response = &EnablePhysicalConnectionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_image.go���������0000664�0000000�0000000�00000010044�13771713062�0031567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ExportImage invokes the ecs.ExportImage API synchronously // api document: https://help.aliyun.com/api/ecs/exportimage.html func (client *Client) ExportImage(request *ExportImageRequest) (response *ExportImageResponse, err error) { response = CreateExportImageResponse() err = client.DoAction(request, response) return } // ExportImageWithChan invokes the ecs.ExportImage API asynchronously // api document: https://help.aliyun.com/api/ecs/exportimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ExportImageWithChan(request *ExportImageRequest) (<-chan *ExportImageResponse, <-chan error) { responseChan := make(chan *ExportImageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ExportImage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ExportImageWithCallback invokes the ecs.ExportImage API asynchronously // api document: https://help.aliyun.com/api/ecs/exportimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ExportImageWithCallback(request *ExportImageRequest, callback func(response *ExportImageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ExportImageResponse var err error defer close(result) response, err = client.ExportImage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ExportImageRequest is the request struct for api ExportImage type ExportImageRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` OSSBucket string `position:"Query" name:"OSSBucket"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OSSPrefix string `position:"Query" name:"OSSPrefix"` RoleName string `position:"Query" name:"RoleName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ImageFormat string `position:"Query" name:"ImageFormat"` } // ExportImageResponse is the response struct for api ExportImage type ExportImageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TaskId string `json:"TaskId" xml:"TaskId"` RegionId string `json:"RegionId" xml:"RegionId"` } // CreateExportImageRequest creates a request to invoke ExportImage API func CreateExportImageRequest() (request *ExportImageRequest) { request = &ExportImageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ExportImage", "ecs", "openAPI") return } // CreateExportImageResponse creates a response to parse from ExportImage response func CreateExportImageResponse() (response *ExportImageResponse) { response = &ExportImageResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/export_snapshot.go������0000664�0000000�0000000�00000007724�13771713062�0032357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ExportSnapshot invokes the ecs.ExportSnapshot API synchronously // api document: https://help.aliyun.com/api/ecs/exportsnapshot.html func (client *Client) ExportSnapshot(request *ExportSnapshotRequest) (response *ExportSnapshotResponse, err error) { response = CreateExportSnapshotResponse() err = client.DoAction(request, response) return } // ExportSnapshotWithChan invokes the ecs.ExportSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/exportsnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ExportSnapshotWithChan(request *ExportSnapshotRequest) (<-chan *ExportSnapshotResponse, <-chan error) { responseChan := make(chan *ExportSnapshotResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ExportSnapshot(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ExportSnapshotWithCallback invokes the ecs.ExportSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/exportsnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ExportSnapshotWithCallback(request *ExportSnapshotRequest, callback func(response *ExportSnapshotResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ExportSnapshotResponse var err error defer close(result) response, err = client.ExportSnapshot(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ExportSnapshotRequest is the request struct for api ExportSnapshot type ExportSnapshotRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotId string `position:"Query" name:"SnapshotId"` OssBucket string `position:"Query" name:"OssBucket"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` RoleName string `position:"Query" name:"RoleName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ExportSnapshotResponse is the response struct for api ExportSnapshot type ExportSnapshotResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TaskId string `json:"TaskId" xml:"TaskId"` } // CreateExportSnapshotRequest creates a request to invoke ExportSnapshot API func CreateExportSnapshotRequest() (request *ExportSnapshotRequest) { request = &ExportSnapshotRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ExportSnapshot", "ecs", "openAPI") return } // CreateExportSnapshotResponse creates a response to parse from ExportSnapshot response func CreateExportSnapshotResponse() (response *ExportSnapshotResponse) { response = &ExportSnapshotResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������get_instance_console_output.go����������������������������������������������������������������������0000664�0000000�0000000�00000010665�13771713062�0034643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetInstanceConsoleOutput invokes the ecs.GetInstanceConsoleOutput API synchronously // api document: https://help.aliyun.com/api/ecs/getinstanceconsoleoutput.html func (client *Client) GetInstanceConsoleOutput(request *GetInstanceConsoleOutputRequest) (response *GetInstanceConsoleOutputResponse, err error) { response = CreateGetInstanceConsoleOutputResponse() err = client.DoAction(request, response) return } // GetInstanceConsoleOutputWithChan invokes the ecs.GetInstanceConsoleOutput API asynchronously // api document: https://help.aliyun.com/api/ecs/getinstanceconsoleoutput.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetInstanceConsoleOutputWithChan(request *GetInstanceConsoleOutputRequest) (<-chan *GetInstanceConsoleOutputResponse, <-chan error) { responseChan := make(chan *GetInstanceConsoleOutputResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetInstanceConsoleOutput(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetInstanceConsoleOutputWithCallback invokes the ecs.GetInstanceConsoleOutput API asynchronously // api document: https://help.aliyun.com/api/ecs/getinstanceconsoleoutput.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetInstanceConsoleOutputWithCallback(request *GetInstanceConsoleOutputRequest, callback func(response *GetInstanceConsoleOutputResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetInstanceConsoleOutputResponse var err error defer close(result) response, err = client.GetInstanceConsoleOutput(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetInstanceConsoleOutputRequest is the request struct for api GetInstanceConsoleOutput type GetInstanceConsoleOutputRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` } // GetInstanceConsoleOutputResponse is the response struct for api GetInstanceConsoleOutput type GetInstanceConsoleOutputResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` ConsoleOutput string `json:"ConsoleOutput" xml:"ConsoleOutput"` LastUpdateTime string `json:"LastUpdateTime" xml:"LastUpdateTime"` } // CreateGetInstanceConsoleOutputRequest creates a request to invoke GetInstanceConsoleOutput API func CreateGetInstanceConsoleOutputRequest() (request *GetInstanceConsoleOutputRequest) { request = &GetInstanceConsoleOutputRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "GetInstanceConsoleOutput", "ecs", "openAPI") return } // CreateGetInstanceConsoleOutputResponse creates a response to parse from GetInstanceConsoleOutput response func CreateGetInstanceConsoleOutputResponse() (response *GetInstanceConsoleOutputResponse) { response = &GetInstanceConsoleOutputResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������get_instance_screenshot.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010457�13771713062�0033735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetInstanceScreenshot invokes the ecs.GetInstanceScreenshot API synchronously // api document: https://help.aliyun.com/api/ecs/getinstancescreenshot.html func (client *Client) GetInstanceScreenshot(request *GetInstanceScreenshotRequest) (response *GetInstanceScreenshotResponse, err error) { response = CreateGetInstanceScreenshotResponse() err = client.DoAction(request, response) return } // GetInstanceScreenshotWithChan invokes the ecs.GetInstanceScreenshot API asynchronously // api document: https://help.aliyun.com/api/ecs/getinstancescreenshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetInstanceScreenshotWithChan(request *GetInstanceScreenshotRequest) (<-chan *GetInstanceScreenshotResponse, <-chan error) { responseChan := make(chan *GetInstanceScreenshotResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetInstanceScreenshot(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetInstanceScreenshotWithCallback invokes the ecs.GetInstanceScreenshot API asynchronously // api document: https://help.aliyun.com/api/ecs/getinstancescreenshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetInstanceScreenshotWithCallback(request *GetInstanceScreenshotRequest, callback func(response *GetInstanceScreenshotResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetInstanceScreenshotResponse var err error defer close(result) response, err = client.GetInstanceScreenshot(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetInstanceScreenshotRequest is the request struct for api GetInstanceScreenshot type GetInstanceScreenshotRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` WakeUp requests.Boolean `position:"Query" name:"WakeUp"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` } // GetInstanceScreenshotResponse is the response struct for api GetInstanceScreenshot type GetInstanceScreenshotResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` Screenshot string `json:"Screenshot" xml:"Screenshot"` } // CreateGetInstanceScreenshotRequest creates a request to invoke GetInstanceScreenshot API func CreateGetInstanceScreenshotRequest() (request *GetInstanceScreenshotRequest) { request = &GetInstanceScreenshotRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "GetInstanceScreenshot", "ecs", "openAPI") return } // CreateGetInstanceScreenshotResponse creates a response to parse from GetInstanceScreenshot response func CreateGetInstanceScreenshotResponse() (response *GetInstanceScreenshotResponse) { response = &GetInstanceScreenshotResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_image.go���������0000664�0000000�0000000�00000011417�13771713062�0031565�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ImportImage invokes the ecs.ImportImage API synchronously // api document: https://help.aliyun.com/api/ecs/importimage.html func (client *Client) ImportImage(request *ImportImageRequest) (response *ImportImageResponse, err error) { response = CreateImportImageResponse() err = client.DoAction(request, response) return } // ImportImageWithChan invokes the ecs.ImportImage API asynchronously // api document: https://help.aliyun.com/api/ecs/importimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ImportImageWithChan(request *ImportImageRequest) (<-chan *ImportImageResponse, <-chan error) { responseChan := make(chan *ImportImageResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ImportImage(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ImportImageWithCallback invokes the ecs.ImportImage API asynchronously // api document: https://help.aliyun.com/api/ecs/importimage.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ImportImageWithCallback(request *ImportImageRequest, callback func(response *ImportImageResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ImportImageResponse var err error defer close(result) response, err = client.ImportImage(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ImportImageRequest is the request struct for api ImportImage type ImportImageRequest struct { *requests.RpcRequest DiskDeviceMapping *[]ImportImageDiskDeviceMapping `position:"Query" name:"DiskDeviceMapping" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` RoleName string `position:"Query" name:"RoleName"` Description string `position:"Query" name:"Description"` OSType string `position:"Query" name:"OSType"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Platform string `position:"Query" name:"Platform"` ImageName string `position:"Query" name:"ImageName"` Architecture string `position:"Query" name:"Architecture"` } // ImportImageDiskDeviceMapping is a repeated param struct in ImportImageRequest type ImportImageDiskDeviceMapping struct { OSSBucket string `name:"OSSBucket"` DiskImSize string `name:"DiskImSize"` Format string `name:"Format"` Device string `name:"Device"` OSSObject string `name:"OSSObject"` DiskImageSize string `name:"DiskImageSize"` } // ImportImageResponse is the response struct for api ImportImage type ImportImageResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TaskId string `json:"TaskId" xml:"TaskId"` RegionId string `json:"RegionId" xml:"RegionId"` ImageId string `json:"ImageId" xml:"ImageId"` } // CreateImportImageRequest creates a request to invoke ImportImage API func CreateImportImageRequest() (request *ImportImageRequest) { request = &ImportImageRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ImportImage", "ecs", "openAPI") return } // CreateImportImageResponse creates a response to parse from ImportImage response func CreateImportImageResponse() (response *ImportImageResponse) { response = &ImportImageResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_key_pair.go������0000664�0000000�0000000�00000007723�13771713062�0032313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ImportKeyPair invokes the ecs.ImportKeyPair API synchronously // api document: https://help.aliyun.com/api/ecs/importkeypair.html func (client *Client) ImportKeyPair(request *ImportKeyPairRequest) (response *ImportKeyPairResponse, err error) { response = CreateImportKeyPairResponse() err = client.DoAction(request, response) return } // ImportKeyPairWithChan invokes the ecs.ImportKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/importkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ImportKeyPairWithChan(request *ImportKeyPairRequest) (<-chan *ImportKeyPairResponse, <-chan error) { responseChan := make(chan *ImportKeyPairResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ImportKeyPair(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ImportKeyPairWithCallback invokes the ecs.ImportKeyPair API asynchronously // api document: https://help.aliyun.com/api/ecs/importkeypair.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ImportKeyPairWithCallback(request *ImportKeyPairRequest, callback func(response *ImportKeyPairResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ImportKeyPairResponse var err error defer close(result) response, err = client.ImportKeyPair(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ImportKeyPairRequest is the request struct for api ImportKeyPair type ImportKeyPairRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` PublicKeyBody string `position:"Query" name:"PublicKeyBody"` KeyPairName string `position:"Query" name:"KeyPairName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ImportKeyPairResponse is the response struct for api ImportKeyPair type ImportKeyPairResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` KeyPairFingerPrint string `json:"KeyPairFingerPrint" xml:"KeyPairFingerPrint"` } // CreateImportKeyPairRequest creates a request to invoke ImportKeyPair API func CreateImportKeyPairRequest() (request *ImportKeyPairRequest) { request = &ImportKeyPairRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ImportKeyPair", "ecs", "openAPI") return } // CreateImportKeyPairResponse creates a response to parse from ImportKeyPair response func CreateImportKeyPairResponse() (response *ImportKeyPairResponse) { response = &ImportKeyPairResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/import_snapshot.go������0000664�0000000�0000000�00000010133�13771713062�0032334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ImportSnapshot invokes the ecs.ImportSnapshot API synchronously // api document: https://help.aliyun.com/api/ecs/importsnapshot.html func (client *Client) ImportSnapshot(request *ImportSnapshotRequest) (response *ImportSnapshotResponse, err error) { response = CreateImportSnapshotResponse() err = client.DoAction(request, response) return } // ImportSnapshotWithChan invokes the ecs.ImportSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/importsnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ImportSnapshotWithChan(request *ImportSnapshotRequest) (<-chan *ImportSnapshotResponse, <-chan error) { responseChan := make(chan *ImportSnapshotResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ImportSnapshot(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ImportSnapshotWithCallback invokes the ecs.ImportSnapshot API asynchronously // api document: https://help.aliyun.com/api/ecs/importsnapshot.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ImportSnapshotWithCallback(request *ImportSnapshotRequest, callback func(response *ImportSnapshotResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ImportSnapshotResponse var err error defer close(result) response, err = client.ImportSnapshot(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ImportSnapshotRequest is the request struct for api ImportSnapshot type ImportSnapshotRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotName string `position:"Query" name:"SnapshotName"` OssObject string `position:"Query" name:"OssObject"` OssBucket string `position:"Query" name:"OssBucket"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` RoleName string `position:"Query" name:"RoleName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ImportSnapshotResponse is the response struct for api ImportSnapshot type ImportSnapshotResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TaskId string `json:"TaskId" xml:"TaskId"` SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` } // CreateImportSnapshotRequest creates a request to invoke ImportSnapshot API func CreateImportSnapshotRequest() (request *ImportSnapshotRequest) { request = &ImportSnapshotRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ImportSnapshot", "ecs", "openAPI") return } // CreateImportSnapshotResponse creates a response to parse from ImportSnapshot response func CreateImportSnapshotResponse() (response *ImportSnapshotResponse) { response = &ImportSnapshotResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������install_cloud_assistant.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010207�13771713062�0033753�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // InstallCloudAssistant invokes the ecs.InstallCloudAssistant API synchronously // api document: https://help.aliyun.com/api/ecs/installcloudassistant.html func (client *Client) InstallCloudAssistant(request *InstallCloudAssistantRequest) (response *InstallCloudAssistantResponse, err error) { response = CreateInstallCloudAssistantResponse() err = client.DoAction(request, response) return } // InstallCloudAssistantWithChan invokes the ecs.InstallCloudAssistant API asynchronously // api document: https://help.aliyun.com/api/ecs/installcloudassistant.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) InstallCloudAssistantWithChan(request *InstallCloudAssistantRequest) (<-chan *InstallCloudAssistantResponse, <-chan error) { responseChan := make(chan *InstallCloudAssistantResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.InstallCloudAssistant(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // InstallCloudAssistantWithCallback invokes the ecs.InstallCloudAssistant API asynchronously // api document: https://help.aliyun.com/api/ecs/installcloudassistant.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) InstallCloudAssistantWithCallback(request *InstallCloudAssistantRequest, callback func(response *InstallCloudAssistantResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *InstallCloudAssistantResponse var err error defer close(result) response, err = client.InstallCloudAssistant(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // InstallCloudAssistantRequest is the request struct for api InstallCloudAssistant type InstallCloudAssistantRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` } // InstallCloudAssistantResponse is the response struct for api InstallCloudAssistant type InstallCloudAssistantResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateInstallCloudAssistantRequest creates a request to invoke InstallCloudAssistant API func CreateInstallCloudAssistantRequest() (request *InstallCloudAssistantRequest) { request = &InstallCloudAssistantRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "InstallCloudAssistant", "ecs", "openAPI") return } // CreateInstallCloudAssistantResponse creates a response to parse from InstallCloudAssistant response func CreateInstallCloudAssistantResponse() (response *InstallCloudAssistantResponse) { response = &InstallCloudAssistantResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/invoke_command.go�������0000664�0000000�0000000�00000010127�13771713062�0032077�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // InvokeCommand invokes the ecs.InvokeCommand API synchronously // api document: https://help.aliyun.com/api/ecs/invokecommand.html func (client *Client) InvokeCommand(request *InvokeCommandRequest) (response *InvokeCommandResponse, err error) { response = CreateInvokeCommandResponse() err = client.DoAction(request, response) return } // InvokeCommandWithChan invokes the ecs.InvokeCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/invokecommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) InvokeCommandWithChan(request *InvokeCommandRequest) (<-chan *InvokeCommandResponse, <-chan error) { responseChan := make(chan *InvokeCommandResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.InvokeCommand(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // InvokeCommandWithCallback invokes the ecs.InvokeCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/invokecommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) InvokeCommandWithCallback(request *InvokeCommandRequest, callback func(response *InvokeCommandResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *InvokeCommandResponse var err error defer close(result) response, err = client.InvokeCommand(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // InvokeCommandRequest is the request struct for api InvokeCommand type InvokeCommandRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` CommandId string `position:"Query" name:"CommandId"` Frequency string `position:"Query" name:"Frequency"` Timed requests.Boolean `position:"Query" name:"Timed"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` } // InvokeCommandResponse is the response struct for api InvokeCommand type InvokeCommandResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InvokeId string `json:"InvokeId" xml:"InvokeId"` } // CreateInvokeCommandRequest creates a request to invoke InvokeCommand API func CreateInvokeCommandRequest() (request *InvokeCommandRequest) { request = &InvokeCommandRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "InvokeCommand", "ecs", "openAPI") return } // CreateInvokeCommandResponse creates a response to parse from InvokeCommand response func CreateInvokeCommandResponse() (response *InvokeCommandResponse) { response = &InvokeCommandResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_resource_group.go��0000664�0000000�0000000�00000010165�13771713062�0033172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // JoinResourceGroup invokes the ecs.JoinResourceGroup API synchronously // api document: https://help.aliyun.com/api/ecs/joinresourcegroup.html func (client *Client) JoinResourceGroup(request *JoinResourceGroupRequest) (response *JoinResourceGroupResponse, err error) { response = CreateJoinResourceGroupResponse() err = client.DoAction(request, response) return } // JoinResourceGroupWithChan invokes the ecs.JoinResourceGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/joinresourcegroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) JoinResourceGroupWithChan(request *JoinResourceGroupRequest) (<-chan *JoinResourceGroupResponse, <-chan error) { responseChan := make(chan *JoinResourceGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.JoinResourceGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // JoinResourceGroupWithCallback invokes the ecs.JoinResourceGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/joinresourcegroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) JoinResourceGroupWithCallback(request *JoinResourceGroupRequest, callback func(response *JoinResourceGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *JoinResourceGroupResponse var err error defer close(result) response, err = client.JoinResourceGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // JoinResourceGroupRequest is the request struct for api JoinResourceGroup type JoinResourceGroupRequest struct { *requests.RpcRequest ResourceGroupId string `position:"Query" name:"ResourceGroupId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceId string `position:"Query" name:"ResourceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` } // JoinResourceGroupResponse is the response struct for api JoinResourceGroup type JoinResourceGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateJoinResourceGroupRequest creates a request to invoke JoinResourceGroup API func CreateJoinResourceGroupRequest() (request *JoinResourceGroupRequest) { request = &JoinResourceGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "JoinResourceGroup", "ecs", "openAPI") return } // CreateJoinResourceGroupResponse creates a response to parse from JoinResourceGroup response func CreateJoinResourceGroupResponse() (response *JoinResourceGroupResponse) { response = &JoinResourceGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/join_security_group.go��0000664�0000000�0000000�00000010047�13771713062�0033211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // JoinSecurityGroup invokes the ecs.JoinSecurityGroup API synchronously // api document: https://help.aliyun.com/api/ecs/joinsecuritygroup.html func (client *Client) JoinSecurityGroup(request *JoinSecurityGroupRequest) (response *JoinSecurityGroupResponse, err error) { response = CreateJoinSecurityGroupResponse() err = client.DoAction(request, response) return } // JoinSecurityGroupWithChan invokes the ecs.JoinSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/joinsecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) JoinSecurityGroupWithChan(request *JoinSecurityGroupRequest) (<-chan *JoinSecurityGroupResponse, <-chan error) { responseChan := make(chan *JoinSecurityGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.JoinSecurityGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // JoinSecurityGroupWithCallback invokes the ecs.JoinSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/joinsecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) JoinSecurityGroupWithCallback(request *JoinSecurityGroupRequest, callback func(response *JoinSecurityGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *JoinSecurityGroupResponse var err error defer close(result) response, err = client.JoinSecurityGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // JoinSecurityGroupRequest is the request struct for api JoinSecurityGroup type JoinSecurityGroupRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // JoinSecurityGroupResponse is the response struct for api JoinSecurityGroup type JoinSecurityGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateJoinSecurityGroupRequest creates a request to invoke JoinSecurityGroup API func CreateJoinSecurityGroupRequest() (request *JoinSecurityGroupRequest) { request = &JoinSecurityGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "JoinSecurityGroup", "ecs", "openAPI") return } // CreateJoinSecurityGroupResponse creates a response to parse from JoinSecurityGroup response func CreateJoinSecurityGroupResponse() (response *JoinSecurityGroupResponse) { response = &JoinSecurityGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/leave_security_group.go�0000664�0000000�0000000�00000010117�13771713062�0033344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // LeaveSecurityGroup invokes the ecs.LeaveSecurityGroup API synchronously // api document: https://help.aliyun.com/api/ecs/leavesecuritygroup.html func (client *Client) LeaveSecurityGroup(request *LeaveSecurityGroupRequest) (response *LeaveSecurityGroupResponse, err error) { response = CreateLeaveSecurityGroupResponse() err = client.DoAction(request, response) return } // LeaveSecurityGroupWithChan invokes the ecs.LeaveSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/leavesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) LeaveSecurityGroupWithChan(request *LeaveSecurityGroupRequest) (<-chan *LeaveSecurityGroupResponse, <-chan error) { responseChan := make(chan *LeaveSecurityGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.LeaveSecurityGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // LeaveSecurityGroupWithCallback invokes the ecs.LeaveSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/leavesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) LeaveSecurityGroupWithCallback(request *LeaveSecurityGroupRequest, callback func(response *LeaveSecurityGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *LeaveSecurityGroupResponse var err error defer close(result) response, err = client.LeaveSecurityGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // LeaveSecurityGroupRequest is the request struct for api LeaveSecurityGroup type LeaveSecurityGroupRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // LeaveSecurityGroupResponse is the response struct for api LeaveSecurityGroup type LeaveSecurityGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateLeaveSecurityGroupRequest creates a request to invoke LeaveSecurityGroup API func CreateLeaveSecurityGroupRequest() (request *LeaveSecurityGroupRequest) { request = &LeaveSecurityGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "LeaveSecurityGroup", "ecs", "openAPI") return } // CreateLeaveSecurityGroupResponse creates a response to parse from LeaveSecurityGroup response func CreateLeaveSecurityGroupResponse() (response *LeaveSecurityGroupResponse) { response = &LeaveSecurityGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/list_tag_resources.go���0000664�0000000�0000000�00000011023�13771713062�0033002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListTagResources invokes the ecs.ListTagResources API synchronously // api document: https://help.aliyun.com/api/ecs/listtagresources.html func (client *Client) ListTagResources(request *ListTagResourcesRequest) (response *ListTagResourcesResponse, err error) { response = CreateListTagResourcesResponse() err = client.DoAction(request, response) return } // ListTagResourcesWithChan invokes the ecs.ListTagResources API asynchronously // api document: https://help.aliyun.com/api/ecs/listtagresources.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListTagResourcesWithChan(request *ListTagResourcesRequest) (<-chan *ListTagResourcesResponse, <-chan error) { responseChan := make(chan *ListTagResourcesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListTagResources(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListTagResourcesWithCallback invokes the ecs.ListTagResources API asynchronously // api document: https://help.aliyun.com/api/ecs/listtagresources.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListTagResourcesWithCallback(request *ListTagResourcesRequest, callback func(response *ListTagResourcesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListTagResourcesResponse var err error defer close(result) response, err = client.ListTagResources(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListTagResourcesRequest is the request struct for api ListTagResources type ListTagResourcesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` NextToken string `position:"Query" name:"NextToken"` Tag *[]ListTagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` } // ListTagResourcesTag is a repeated param struct in ListTagResourcesRequest type ListTagResourcesTag struct { Key string `name:"Key"` Value string `name:"Value"` } // ListTagResourcesResponse is the response struct for api ListTagResources type ListTagResourcesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` NextToken string `json:"NextToken" xml:"NextToken"` TagResources TagResources `json:"TagResources" xml:"TagResources"` } // CreateListTagResourcesRequest creates a request to invoke ListTagResources API func CreateListTagResourcesRequest() (request *ListTagResourcesRequest) { request = &ListTagResourcesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ListTagResources", "ecs", "openAPI") return } // CreateListTagResourcesResponse creates a response to parse from ListTagResources response func CreateListTagResourcesResponse() (response *ListTagResourcesResponse) { response = &ListTagResourcesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_auto_snapshot_policy.go����������������������������������������������������������������������0000664�0000000�0000000�00000012044�13771713062�0034644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyAutoSnapshotPolicy invokes the ecs.ModifyAutoSnapshotPolicy API synchronously // api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicy.html func (client *Client) ModifyAutoSnapshotPolicy(request *ModifyAutoSnapshotPolicyRequest) (response *ModifyAutoSnapshotPolicyResponse, err error) { response = CreateModifyAutoSnapshotPolicyResponse() err = client.DoAction(request, response) return } // ModifyAutoSnapshotPolicyWithChan invokes the ecs.ModifyAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyAutoSnapshotPolicyWithChan(request *ModifyAutoSnapshotPolicyRequest) (<-chan *ModifyAutoSnapshotPolicyResponse, <-chan error) { responseChan := make(chan *ModifyAutoSnapshotPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyAutoSnapshotPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyAutoSnapshotPolicyWithCallback invokes the ecs.ModifyAutoSnapshotPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyAutoSnapshotPolicyWithCallback(request *ModifyAutoSnapshotPolicyRequest, callback func(response *ModifyAutoSnapshotPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyAutoSnapshotPolicyResponse var err error defer close(result) response, err = client.ModifyAutoSnapshotPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyAutoSnapshotPolicyRequest is the request struct for api ModifyAutoSnapshotPolicy type ModifyAutoSnapshotPolicyRequest struct { *requests.RpcRequest DataDiskPolicyEnabled requests.Boolean `position:"Query" name:"DataDiskPolicyEnabled"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` DataDiskPolicyRetentionDays requests.Integer `position:"Query" name:"DataDiskPolicyRetentionDays"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` SystemDiskPolicyRetentionLastWeek requests.Boolean `position:"Query" name:"SystemDiskPolicyRetentionLastWeek"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SystemDiskPolicyTimePeriod requests.Integer `position:"Query" name:"SystemDiskPolicyTimePeriod"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DataDiskPolicyRetentionLastWeek requests.Boolean `position:"Query" name:"DataDiskPolicyRetentionLastWeek"` SystemDiskPolicyRetentionDays requests.Integer `position:"Query" name:"SystemDiskPolicyRetentionDays"` DataDiskPolicyTimePeriod requests.Integer `position:"Query" name:"DataDiskPolicyTimePeriod"` SystemDiskPolicyEnabled requests.Boolean `position:"Query" name:"SystemDiskPolicyEnabled"` } // ModifyAutoSnapshotPolicyResponse is the response struct for api ModifyAutoSnapshotPolicy type ModifyAutoSnapshotPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyAutoSnapshotPolicyRequest creates a request to invoke ModifyAutoSnapshotPolicy API func CreateModifyAutoSnapshotPolicyRequest() (request *ModifyAutoSnapshotPolicyRequest) { request = &ModifyAutoSnapshotPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyAutoSnapshotPolicy", "ecs", "openAPI") return } // CreateModifyAutoSnapshotPolicyResponse creates a response to parse from ModifyAutoSnapshotPolicy response func CreateModifyAutoSnapshotPolicyResponse() (response *ModifyAutoSnapshotPolicyResponse) { response = &ModifyAutoSnapshotPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_auto_snapshot_policy_ex.go�������������������������������������������������������������������0000664�0000000�0000000�00000011115�13771713062�0035336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyAutoSnapshotPolicyEx invokes the ecs.ModifyAutoSnapshotPolicyEx API synchronously // api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicyex.html func (client *Client) ModifyAutoSnapshotPolicyEx(request *ModifyAutoSnapshotPolicyExRequest) (response *ModifyAutoSnapshotPolicyExResponse, err error) { response = CreateModifyAutoSnapshotPolicyExResponse() err = client.DoAction(request, response) return } // ModifyAutoSnapshotPolicyExWithChan invokes the ecs.ModifyAutoSnapshotPolicyEx API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicyex.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyAutoSnapshotPolicyExWithChan(request *ModifyAutoSnapshotPolicyExRequest) (<-chan *ModifyAutoSnapshotPolicyExResponse, <-chan error) { responseChan := make(chan *ModifyAutoSnapshotPolicyExResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyAutoSnapshotPolicyEx(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyAutoSnapshotPolicyExWithCallback invokes the ecs.ModifyAutoSnapshotPolicyEx API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyautosnapshotpolicyex.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyAutoSnapshotPolicyExWithCallback(request *ModifyAutoSnapshotPolicyExRequest, callback func(response *ModifyAutoSnapshotPolicyExResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyAutoSnapshotPolicyExResponse var err error defer close(result) response, err = client.ModifyAutoSnapshotPolicyEx(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyAutoSnapshotPolicyExRequest is the request struct for api ModifyAutoSnapshotPolicyEx type ModifyAutoSnapshotPolicyExRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` AutoSnapshotPolicyId string `position:"Query" name:"autoSnapshotPolicyId"` TimePoints string `position:"Query" name:"timePoints"` RetentionDays requests.Integer `position:"Query" name:"retentionDays"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` RepeatWeekdays string `position:"Query" name:"repeatWeekdays"` AutoSnapshotPolicyName string `position:"Query" name:"autoSnapshotPolicyName"` } // ModifyAutoSnapshotPolicyExResponse is the response struct for api ModifyAutoSnapshotPolicyEx type ModifyAutoSnapshotPolicyExResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyAutoSnapshotPolicyExRequest creates a request to invoke ModifyAutoSnapshotPolicyEx API func CreateModifyAutoSnapshotPolicyExRequest() (request *ModifyAutoSnapshotPolicyExRequest) { request = &ModifyAutoSnapshotPolicyExRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyAutoSnapshotPolicyEx", "ecs", "openAPI") return } // CreateModifyAutoSnapshotPolicyExResponse creates a response to parse from ModifyAutoSnapshotPolicyEx response func CreateModifyAutoSnapshotPolicyExResponse() (response *ModifyAutoSnapshotPolicyExResponse) { response = &ModifyAutoSnapshotPolicyExResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_bandwidth_package_spec.go��������������������������������������������������������������������0000664�0000000�0000000�00000010621�13771713062�0035026�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyBandwidthPackageSpec invokes the ecs.ModifyBandwidthPackageSpec API synchronously // api document: https://help.aliyun.com/api/ecs/modifybandwidthpackagespec.html func (client *Client) ModifyBandwidthPackageSpec(request *ModifyBandwidthPackageSpecRequest) (response *ModifyBandwidthPackageSpecResponse, err error) { response = CreateModifyBandwidthPackageSpecResponse() err = client.DoAction(request, response) return } // ModifyBandwidthPackageSpecWithChan invokes the ecs.ModifyBandwidthPackageSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifybandwidthpackagespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyBandwidthPackageSpecWithChan(request *ModifyBandwidthPackageSpecRequest) (<-chan *ModifyBandwidthPackageSpecResponse, <-chan error) { responseChan := make(chan *ModifyBandwidthPackageSpecResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyBandwidthPackageSpec(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyBandwidthPackageSpecWithCallback invokes the ecs.ModifyBandwidthPackageSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifybandwidthpackagespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyBandwidthPackageSpecWithCallback(request *ModifyBandwidthPackageSpecRequest, callback func(response *ModifyBandwidthPackageSpecResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyBandwidthPackageSpecResponse var err error defer close(result) response, err = client.ModifyBandwidthPackageSpec(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyBandwidthPackageSpecRequest is the request struct for api ModifyBandwidthPackageSpec type ModifyBandwidthPackageSpecRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Bandwidth string `position:"Query" name:"Bandwidth"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyBandwidthPackageSpecResponse is the response struct for api ModifyBandwidthPackageSpec type ModifyBandwidthPackageSpecResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyBandwidthPackageSpecRequest creates a request to invoke ModifyBandwidthPackageSpec API func CreateModifyBandwidthPackageSpecRequest() (request *ModifyBandwidthPackageSpecRequest) { request = &ModifyBandwidthPackageSpecRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyBandwidthPackageSpec", "ecs", "openAPI") return } // CreateModifyBandwidthPackageSpecResponse creates a response to parse from ModifyBandwidthPackageSpec response func CreateModifyBandwidthPackageSpecResponse() (response *ModifyBandwidthPackageSpecResponse) { response = &ModifyBandwidthPackageSpecResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_command.go�������0000664�0000000�0000000�00000010255�13771713062�0032075�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyCommand invokes the ecs.ModifyCommand API synchronously // api document: https://help.aliyun.com/api/ecs/modifycommand.html func (client *Client) ModifyCommand(request *ModifyCommandRequest) (response *ModifyCommandResponse, err error) { response = CreateModifyCommandResponse() err = client.DoAction(request, response) return } // ModifyCommandWithChan invokes the ecs.ModifyCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/modifycommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyCommandWithChan(request *ModifyCommandRequest) (<-chan *ModifyCommandResponse, <-chan error) { responseChan := make(chan *ModifyCommandResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyCommand(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyCommandWithCallback invokes the ecs.ModifyCommand API asynchronously // api document: https://help.aliyun.com/api/ecs/modifycommand.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyCommandWithCallback(request *ModifyCommandRequest, callback func(response *ModifyCommandResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyCommandResponse var err error defer close(result) response, err = client.ModifyCommand(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyCommandRequest is the request struct for api ModifyCommand type ModifyCommandRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` WorkingDir string `position:"Query" name:"WorkingDir"` Description string `position:"Query" name:"Description"` CommandId string `position:"Query" name:"CommandId"` CommandContent string `position:"Query" name:"CommandContent"` Timeout requests.Integer `position:"Query" name:"Timeout"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Name string `position:"Query" name:"Name"` } // ModifyCommandResponse is the response struct for api ModifyCommand type ModifyCommandResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyCommandRequest creates a request to invoke ModifyCommand API func CreateModifyCommandRequest() (request *ModifyCommandRequest) { request = &ModifyCommandRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyCommand", "ecs", "openAPI") return } // CreateModifyCommandResponse creates a response to parse from ModifyCommand response func CreateModifyCommandResponse() (response *ModifyCommandResponse) { response = &ModifyCommandResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_dedicated_host_attribute.go������������������������������������������������������������������0000664�0000000�0000000�00000011653�13771713062�0035431�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyDedicatedHostAttribute invokes the ecs.ModifyDedicatedHostAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostattribute.html func (client *Client) ModifyDedicatedHostAttribute(request *ModifyDedicatedHostAttributeRequest) (response *ModifyDedicatedHostAttributeResponse, err error) { response = CreateModifyDedicatedHostAttributeResponse() err = client.DoAction(request, response) return } // ModifyDedicatedHostAttributeWithChan invokes the ecs.ModifyDedicatedHostAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDedicatedHostAttributeWithChan(request *ModifyDedicatedHostAttributeRequest) (<-chan *ModifyDedicatedHostAttributeResponse, <-chan error) { responseChan := make(chan *ModifyDedicatedHostAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyDedicatedHostAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyDedicatedHostAttributeWithCallback invokes the ecs.ModifyDedicatedHostAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDedicatedHostAttributeWithCallback(request *ModifyDedicatedHostAttributeRequest, callback func(response *ModifyDedicatedHostAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyDedicatedHostAttributeResponse var err error defer close(result) response, err = client.ModifyDedicatedHostAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyDedicatedHostAttributeRequest is the request struct for api ModifyDedicatedHostAttribute type ModifyDedicatedHostAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Description string `position:"Query" name:"Description"` ActionOnMaintenance string `position:"Query" name:"ActionOnMaintenance"` DedicatedHostName string `position:"Query" name:"DedicatedHostName"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DedicatedHostId string `position:"Query" name:"DedicatedHostId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NetworkAttributesSlbUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.SlbUdpTimeout"` NetworkAttributesUdpTimeout requests.Integer `position:"Query" name:"NetworkAttributes.UdpTimeout"` } // ModifyDedicatedHostAttributeResponse is the response struct for api ModifyDedicatedHostAttribute type ModifyDedicatedHostAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyDedicatedHostAttributeRequest creates a request to invoke ModifyDedicatedHostAttribute API func CreateModifyDedicatedHostAttributeRequest() (request *ModifyDedicatedHostAttributeRequest) { request = &ModifyDedicatedHostAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDedicatedHostAttribute", "ecs", "openAPI") return } // CreateModifyDedicatedHostAttributeResponse creates a response to parse from ModifyDedicatedHostAttribute response func CreateModifyDedicatedHostAttributeResponse() (response *ModifyDedicatedHostAttributeResponse) { response = &ModifyDedicatedHostAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������modify_dedicated_host_auto_release_time.go����������������������������������������������������������0000664�0000000�0000000�00000011324�13771713062�0037107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyDedicatedHostAutoReleaseTime invokes the ecs.ModifyDedicatedHostAutoReleaseTime API synchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautoreleasetime.html func (client *Client) ModifyDedicatedHostAutoReleaseTime(request *ModifyDedicatedHostAutoReleaseTimeRequest) (response *ModifyDedicatedHostAutoReleaseTimeResponse, err error) { response = CreateModifyDedicatedHostAutoReleaseTimeResponse() err = client.DoAction(request, response) return } // ModifyDedicatedHostAutoReleaseTimeWithChan invokes the ecs.ModifyDedicatedHostAutoReleaseTime API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautoreleasetime.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDedicatedHostAutoReleaseTimeWithChan(request *ModifyDedicatedHostAutoReleaseTimeRequest) (<-chan *ModifyDedicatedHostAutoReleaseTimeResponse, <-chan error) { responseChan := make(chan *ModifyDedicatedHostAutoReleaseTimeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyDedicatedHostAutoReleaseTime(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyDedicatedHostAutoReleaseTimeWithCallback invokes the ecs.ModifyDedicatedHostAutoReleaseTime API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautoreleasetime.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDedicatedHostAutoReleaseTimeWithCallback(request *ModifyDedicatedHostAutoReleaseTimeRequest, callback func(response *ModifyDedicatedHostAutoReleaseTimeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyDedicatedHostAutoReleaseTimeResponse var err error defer close(result) response, err = client.ModifyDedicatedHostAutoReleaseTime(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyDedicatedHostAutoReleaseTimeRequest is the request struct for api ModifyDedicatedHostAutoReleaseTime type ModifyDedicatedHostAutoReleaseTimeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` DedicatedHostId string `position:"Query" name:"DedicatedHostId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyDedicatedHostAutoReleaseTimeResponse is the response struct for api ModifyDedicatedHostAutoReleaseTime type ModifyDedicatedHostAutoReleaseTimeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyDedicatedHostAutoReleaseTimeRequest creates a request to invoke ModifyDedicatedHostAutoReleaseTime API func CreateModifyDedicatedHostAutoReleaseTimeRequest() (request *ModifyDedicatedHostAutoReleaseTimeRequest) { request = &ModifyDedicatedHostAutoReleaseTimeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDedicatedHostAutoReleaseTime", "ecs", "openAPI") return } // CreateModifyDedicatedHostAutoReleaseTimeResponse creates a response to parse from ModifyDedicatedHostAutoReleaseTime response func CreateModifyDedicatedHostAutoReleaseTimeResponse() (response *ModifyDedicatedHostAutoReleaseTimeResponse) { response = &ModifyDedicatedHostAutoReleaseTimeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_dedicated_host_auto_renew_attribute.go�������������������������������������������������������0000664�0000000�0000000�00000012054�13771713062�0037655�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyDedicatedHostAutoRenewAttribute invokes the ecs.ModifyDedicatedHostAutoRenewAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautorenewattribute.html func (client *Client) ModifyDedicatedHostAutoRenewAttribute(request *ModifyDedicatedHostAutoRenewAttributeRequest) (response *ModifyDedicatedHostAutoRenewAttributeResponse, err error) { response = CreateModifyDedicatedHostAutoRenewAttributeResponse() err = client.DoAction(request, response) return } // ModifyDedicatedHostAutoRenewAttributeWithChan invokes the ecs.ModifyDedicatedHostAutoRenewAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautorenewattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDedicatedHostAutoRenewAttributeWithChan(request *ModifyDedicatedHostAutoRenewAttributeRequest) (<-chan *ModifyDedicatedHostAutoRenewAttributeResponse, <-chan error) { responseChan := make(chan *ModifyDedicatedHostAutoRenewAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyDedicatedHostAutoRenewAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyDedicatedHostAutoRenewAttributeWithCallback invokes the ecs.ModifyDedicatedHostAutoRenewAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydedicatedhostautorenewattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDedicatedHostAutoRenewAttributeWithCallback(request *ModifyDedicatedHostAutoRenewAttributeRequest, callback func(response *ModifyDedicatedHostAutoRenewAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyDedicatedHostAutoRenewAttributeResponse var err error defer close(result) response, err = client.ModifyDedicatedHostAutoRenewAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyDedicatedHostAutoRenewAttributeRequest is the request struct for api ModifyDedicatedHostAutoRenewAttribute type ModifyDedicatedHostAutoRenewAttributeRequest struct { *requests.RpcRequest Duration requests.Integer `position:"Query" name:"Duration"` DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PeriodUnit string `position:"Query" name:"PeriodUnit"` AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` RenewalStatus string `position:"Query" name:"RenewalStatus"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyDedicatedHostAutoRenewAttributeResponse is the response struct for api ModifyDedicatedHostAutoRenewAttribute type ModifyDedicatedHostAutoRenewAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyDedicatedHostAutoRenewAttributeRequest creates a request to invoke ModifyDedicatedHostAutoRenewAttribute API func CreateModifyDedicatedHostAutoRenewAttributeRequest() (request *ModifyDedicatedHostAutoRenewAttributeRequest) { request = &ModifyDedicatedHostAutoRenewAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDedicatedHostAutoRenewAttribute", "ecs", "openAPI") return } // CreateModifyDedicatedHostAutoRenewAttributeResponse creates a response to parse from ModifyDedicatedHostAutoRenewAttribute response func CreateModifyDedicatedHostAutoRenewAttributeResponse() (response *ModifyDedicatedHostAutoRenewAttributeResponse) { response = &ModifyDedicatedHostAutoRenewAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_deployment_set_attribute.go������������������������������������������������������������������0000664�0000000�0000000�00000011063�13771713062�0035514�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyDeploymentSetAttribute invokes the ecs.ModifyDeploymentSetAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifydeploymentsetattribute.html func (client *Client) ModifyDeploymentSetAttribute(request *ModifyDeploymentSetAttributeRequest) (response *ModifyDeploymentSetAttributeResponse, err error) { response = CreateModifyDeploymentSetAttributeResponse() err = client.DoAction(request, response) return } // ModifyDeploymentSetAttributeWithChan invokes the ecs.ModifyDeploymentSetAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydeploymentsetattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDeploymentSetAttributeWithChan(request *ModifyDeploymentSetAttributeRequest) (<-chan *ModifyDeploymentSetAttributeResponse, <-chan error) { responseChan := make(chan *ModifyDeploymentSetAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyDeploymentSetAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyDeploymentSetAttributeWithCallback invokes the ecs.ModifyDeploymentSetAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydeploymentsetattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDeploymentSetAttributeWithCallback(request *ModifyDeploymentSetAttributeRequest, callback func(response *ModifyDeploymentSetAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyDeploymentSetAttributeResponse var err error defer close(result) response, err = client.ModifyDeploymentSetAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyDeploymentSetAttributeRequest is the request struct for api ModifyDeploymentSetAttribute type ModifyDeploymentSetAttributeRequest struct { *requests.RpcRequest DeploymentSetId string `position:"Query" name:"DeploymentSetId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` DeploymentSetName string `position:"Query" name:"DeploymentSetName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyDeploymentSetAttributeResponse is the response struct for api ModifyDeploymentSetAttribute type ModifyDeploymentSetAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyDeploymentSetAttributeRequest creates a request to invoke ModifyDeploymentSetAttribute API func CreateModifyDeploymentSetAttributeRequest() (request *ModifyDeploymentSetAttributeRequest) { request = &ModifyDeploymentSetAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDeploymentSetAttribute", "ecs", "openAPI") return } // CreateModifyDeploymentSetAttributeResponse creates a response to parse from ModifyDeploymentSetAttribute response func CreateModifyDeploymentSetAttributeResponse() (response *ModifyDeploymentSetAttributeResponse) { response = &ModifyDeploymentSetAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_disk_attribute.go0000664�0000000�0000000�00000010665�13771713062�0033501�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyDiskAttribute invokes the ecs.ModifyDiskAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifydiskattribute.html func (client *Client) ModifyDiskAttribute(request *ModifyDiskAttributeRequest) (response *ModifyDiskAttributeResponse, err error) { response = CreateModifyDiskAttributeResponse() err = client.DoAction(request, response) return } // ModifyDiskAttributeWithChan invokes the ecs.ModifyDiskAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydiskattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDiskAttributeWithChan(request *ModifyDiskAttributeRequest) (<-chan *ModifyDiskAttributeResponse, <-chan error) { responseChan := make(chan *ModifyDiskAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyDiskAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyDiskAttributeWithCallback invokes the ecs.ModifyDiskAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydiskattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDiskAttributeWithCallback(request *ModifyDiskAttributeRequest, callback func(response *ModifyDiskAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyDiskAttributeResponse var err error defer close(result) response, err = client.ModifyDiskAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyDiskAttributeRequest is the request struct for api ModifyDiskAttribute type ModifyDiskAttributeRequest struct { *requests.RpcRequest DiskName string `position:"Query" name:"DiskName"` DeleteAutoSnapshot requests.Boolean `position:"Query" name:"DeleteAutoSnapshot"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` EnableAutoSnapshot requests.Boolean `position:"Query" name:"EnableAutoSnapshot"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` DiskId string `position:"Query" name:"DiskId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DeleteWithInstance requests.Boolean `position:"Query" name:"DeleteWithInstance"` } // ModifyDiskAttributeResponse is the response struct for api ModifyDiskAttribute type ModifyDiskAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyDiskAttributeRequest creates a request to invoke ModifyDiskAttribute API func CreateModifyDiskAttributeRequest() (request *ModifyDiskAttributeRequest) { request = &ModifyDiskAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDiskAttribute", "ecs", "openAPI") return } // CreateModifyDiskAttributeResponse creates a response to parse from ModifyDiskAttribute response func CreateModifyDiskAttributeResponse() (response *ModifyDiskAttributeResponse) { response = &ModifyDiskAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������modify_disk_charge_type.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010656�13771713062�0033711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyDiskChargeType invokes the ecs.ModifyDiskChargeType API synchronously // api document: https://help.aliyun.com/api/ecs/modifydiskchargetype.html func (client *Client) ModifyDiskChargeType(request *ModifyDiskChargeTypeRequest) (response *ModifyDiskChargeTypeResponse, err error) { response = CreateModifyDiskChargeTypeResponse() err = client.DoAction(request, response) return } // ModifyDiskChargeTypeWithChan invokes the ecs.ModifyDiskChargeType API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydiskchargetype.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDiskChargeTypeWithChan(request *ModifyDiskChargeTypeRequest) (<-chan *ModifyDiskChargeTypeResponse, <-chan error) { responseChan := make(chan *ModifyDiskChargeTypeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyDiskChargeType(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyDiskChargeTypeWithCallback invokes the ecs.ModifyDiskChargeType API asynchronously // api document: https://help.aliyun.com/api/ecs/modifydiskchargetype.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyDiskChargeTypeWithCallback(request *ModifyDiskChargeTypeRequest, callback func(response *ModifyDiskChargeTypeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyDiskChargeTypeResponse var err error defer close(result) response, err = client.ModifyDiskChargeType(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyDiskChargeTypeRequest is the request struct for api ModifyDiskChargeType type ModifyDiskChargeTypeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` DiskChargeType string `position:"Query" name:"DiskChargeType"` InstanceId string `position:"Query" name:"InstanceId"` AutoPay requests.Boolean `position:"Query" name:"AutoPay"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DiskIds string `position:"Query" name:"DiskIds"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyDiskChargeTypeResponse is the response struct for api ModifyDiskChargeType type ModifyDiskChargeTypeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` OrderId string `json:"OrderId" xml:"OrderId"` } // CreateModifyDiskChargeTypeRequest creates a request to invoke ModifyDiskChargeType API func CreateModifyDiskChargeTypeRequest() (request *ModifyDiskChargeTypeRequest) { request = &ModifyDiskChargeTypeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyDiskChargeType", "ecs", "openAPI") return } // CreateModifyDiskChargeTypeResponse creates a response to parse from ModifyDiskChargeType response func CreateModifyDiskChargeTypeResponse() (response *ModifyDiskChargeTypeResponse) { response = &ModifyDiskChargeTypeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������modify_eip_address_attribute.go���������������������������������������������������������������������0000664�0000000�0000000�00000010543�13771713062�0034745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyEipAddressAttribute invokes the ecs.ModifyEipAddressAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyeipaddressattribute.html func (client *Client) ModifyEipAddressAttribute(request *ModifyEipAddressAttributeRequest) (response *ModifyEipAddressAttributeResponse, err error) { response = CreateModifyEipAddressAttributeResponse() err = client.DoAction(request, response) return } // ModifyEipAddressAttributeWithChan invokes the ecs.ModifyEipAddressAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyeipaddressattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyEipAddressAttributeWithChan(request *ModifyEipAddressAttributeRequest) (<-chan *ModifyEipAddressAttributeResponse, <-chan error) { responseChan := make(chan *ModifyEipAddressAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyEipAddressAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyEipAddressAttributeWithCallback invokes the ecs.ModifyEipAddressAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyeipaddressattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyEipAddressAttributeWithCallback(request *ModifyEipAddressAttributeRequest, callback func(response *ModifyEipAddressAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyEipAddressAttributeResponse var err error defer close(result) response, err = client.ModifyEipAddressAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyEipAddressAttributeRequest is the request struct for api ModifyEipAddressAttribute type ModifyEipAddressAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Bandwidth string `position:"Query" name:"Bandwidth"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AllocationId string `position:"Query" name:"AllocationId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyEipAddressAttributeResponse is the response struct for api ModifyEipAddressAttribute type ModifyEipAddressAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyEipAddressAttributeRequest creates a request to invoke ModifyEipAddressAttribute API func CreateModifyEipAddressAttributeRequest() (request *ModifyEipAddressAttributeRequest) { request = &ModifyEipAddressAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyEipAddressAttribute", "ecs", "openAPI") return } // CreateModifyEipAddressAttributeResponse creates a response to parse from ModifyEipAddressAttribute response func CreateModifyEipAddressAttributeResponse() (response *ModifyEipAddressAttributeResponse) { response = &ModifyEipAddressAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_forward_entry.go�0000664�0000000�0000000�00000010722�13771713062�0033343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyForwardEntry invokes the ecs.ModifyForwardEntry API synchronously // api document: https://help.aliyun.com/api/ecs/modifyforwardentry.html func (client *Client) ModifyForwardEntry(request *ModifyForwardEntryRequest) (response *ModifyForwardEntryResponse, err error) { response = CreateModifyForwardEntryResponse() err = client.DoAction(request, response) return } // ModifyForwardEntryWithChan invokes the ecs.ModifyForwardEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyforwardentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyForwardEntryWithChan(request *ModifyForwardEntryRequest) (<-chan *ModifyForwardEntryResponse, <-chan error) { responseChan := make(chan *ModifyForwardEntryResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyForwardEntry(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyForwardEntryWithCallback invokes the ecs.ModifyForwardEntry API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyforwardentry.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyForwardEntryWithCallback(request *ModifyForwardEntryRequest, callback func(response *ModifyForwardEntryResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyForwardEntryResponse var err error defer close(result) response, err = client.ModifyForwardEntry(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyForwardEntryRequest is the request struct for api ModifyForwardEntry type ModifyForwardEntryRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` OwnerAccount string `position:"Query" name:"OwnerAccount"` ForwardTableId string `position:"Query" name:"ForwardTableId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InternalIp string `position:"Query" name:"InternalIp"` ForwardEntryId string `position:"Query" name:"ForwardEntryId"` InternalPort string `position:"Query" name:"InternalPort"` ExternalIp string `position:"Query" name:"ExternalIp"` ExternalPort string `position:"Query" name:"ExternalPort"` } // ModifyForwardEntryResponse is the response struct for api ModifyForwardEntry type ModifyForwardEntryResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyForwardEntryRequest creates a request to invoke ModifyForwardEntry API func CreateModifyForwardEntryRequest() (request *ModifyForwardEntryRequest) { request = &ModifyForwardEntryRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyForwardEntry", "ecs", "openAPI") return } // CreateModifyForwardEntryResponse creates a response to parse from ModifyForwardEntry response func CreateModifyForwardEntryResponse() (response *ModifyForwardEntryResponse) { response = &ModifyForwardEntryResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������modify_ha_vip_attribute.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010345�13771713062�0033731�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyHaVipAttribute invokes the ecs.ModifyHaVipAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyhavipattribute.html func (client *Client) ModifyHaVipAttribute(request *ModifyHaVipAttributeRequest) (response *ModifyHaVipAttributeResponse, err error) { response = CreateModifyHaVipAttributeResponse() err = client.DoAction(request, response) return } // ModifyHaVipAttributeWithChan invokes the ecs.ModifyHaVipAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyhavipattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyHaVipAttributeWithChan(request *ModifyHaVipAttributeRequest) (<-chan *ModifyHaVipAttributeResponse, <-chan error) { responseChan := make(chan *ModifyHaVipAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyHaVipAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyHaVipAttributeWithCallback invokes the ecs.ModifyHaVipAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyhavipattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyHaVipAttributeWithCallback(request *ModifyHaVipAttributeRequest, callback func(response *ModifyHaVipAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyHaVipAttributeResponse var err error defer close(result) response, err = client.ModifyHaVipAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyHaVipAttributeRequest is the request struct for api ModifyHaVipAttribute type ModifyHaVipAttributeRequest struct { *requests.RpcRequest HaVipId string `position:"Query" name:"HaVipId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyHaVipAttributeResponse is the response struct for api ModifyHaVipAttribute type ModifyHaVipAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyHaVipAttributeRequest creates a request to invoke ModifyHaVipAttribute API func CreateModifyHaVipAttributeRequest() (request *ModifyHaVipAttributeRequest) { request = &ModifyHaVipAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyHaVipAttribute", "ecs", "openAPI") return } // CreateModifyHaVipAttributeResponse creates a response to parse from ModifyHaVipAttribute response func CreateModifyHaVipAttributeResponse() (response *ModifyHaVipAttributeResponse) { response = &ModifyHaVipAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_hpc_cluster_attribute.go���������������������������������������������������������������������0000664�0000000�0000000�00000010770�13771713062�0035000�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyHpcClusterAttribute invokes the ecs.ModifyHpcClusterAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyhpcclusterattribute.html func (client *Client) ModifyHpcClusterAttribute(request *ModifyHpcClusterAttributeRequest) (response *ModifyHpcClusterAttributeResponse, err error) { response = CreateModifyHpcClusterAttributeResponse() err = client.DoAction(request, response) return } // ModifyHpcClusterAttributeWithChan invokes the ecs.ModifyHpcClusterAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyhpcclusterattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyHpcClusterAttributeWithChan(request *ModifyHpcClusterAttributeRequest) (<-chan *ModifyHpcClusterAttributeResponse, <-chan error) { responseChan := make(chan *ModifyHpcClusterAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyHpcClusterAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyHpcClusterAttributeWithCallback invokes the ecs.ModifyHpcClusterAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyhpcclusterattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyHpcClusterAttributeWithCallback(request *ModifyHpcClusterAttributeRequest, callback func(response *ModifyHpcClusterAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyHpcClusterAttributeResponse var err error defer close(result) response, err = client.ModifyHpcClusterAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyHpcClusterAttributeRequest is the request struct for api ModifyHpcClusterAttribute type ModifyHpcClusterAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` HpcClusterId string `position:"Query" name:"HpcClusterId"` ClientToken string `position:"Query" name:"ClientToken"` Description string `position:"Query" name:"Description"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Name string `position:"Query" name:"Name"` } // ModifyHpcClusterAttributeResponse is the response struct for api ModifyHpcClusterAttribute type ModifyHpcClusterAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyHpcClusterAttributeRequest creates a request to invoke ModifyHpcClusterAttribute API func CreateModifyHpcClusterAttributeRequest() (request *ModifyHpcClusterAttributeRequest) { request = &ModifyHpcClusterAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyHpcClusterAttribute", "ecs", "openAPI") return } // CreateModifyHpcClusterAttributeResponse creates a response to parse from ModifyHpcClusterAttribute response func CreateModifyHpcClusterAttributeResponse() (response *ModifyHpcClusterAttributeResponse) { response = &ModifyHpcClusterAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������modify_image_attribute.go���������������������������������������������������������������������������0000664�0000000�0000000�00000010343�13771713062�0033543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyImageAttribute invokes the ecs.ModifyImageAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyimageattribute.html func (client *Client) ModifyImageAttribute(request *ModifyImageAttributeRequest) (response *ModifyImageAttributeResponse, err error) { response = CreateModifyImageAttributeResponse() err = client.DoAction(request, response) return } // ModifyImageAttributeWithChan invokes the ecs.ModifyImageAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyimageattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyImageAttributeWithChan(request *ModifyImageAttributeRequest) (<-chan *ModifyImageAttributeResponse, <-chan error) { responseChan := make(chan *ModifyImageAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyImageAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyImageAttributeWithCallback invokes the ecs.ModifyImageAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyimageattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyImageAttributeWithCallback(request *ModifyImageAttributeRequest, callback func(response *ModifyImageAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyImageAttributeResponse var err error defer close(result) response, err = client.ModifyImageAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyImageAttributeRequest is the request struct for api ModifyImageAttribute type ModifyImageAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ImageName string `position:"Query" name:"ImageName"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyImageAttributeResponse is the response struct for api ModifyImageAttribute type ModifyImageAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyImageAttributeRequest creates a request to invoke ModifyImageAttribute API func CreateModifyImageAttributeRequest() (request *ModifyImageAttributeRequest) { request = &ModifyImageAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyImageAttribute", "ecs", "openAPI") return } // CreateModifyImageAttributeResponse creates a response to parse from ModifyImageAttribute response func CreateModifyImageAttributeResponse() (response *ModifyImageAttributeResponse) { response = &ModifyImageAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_image_share_group_permission.go��������������������������������������������������������������0000664�0000000�0000000�00000011236�13771713062�0036330�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyImageShareGroupPermission invokes the ecs.ModifyImageShareGroupPermission API synchronously // api document: https://help.aliyun.com/api/ecs/modifyimagesharegrouppermission.html func (client *Client) ModifyImageShareGroupPermission(request *ModifyImageShareGroupPermissionRequest) (response *ModifyImageShareGroupPermissionResponse, err error) { response = CreateModifyImageShareGroupPermissionResponse() err = client.DoAction(request, response) return } // ModifyImageShareGroupPermissionWithChan invokes the ecs.ModifyImageShareGroupPermission API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyimagesharegrouppermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyImageShareGroupPermissionWithChan(request *ModifyImageShareGroupPermissionRequest) (<-chan *ModifyImageShareGroupPermissionResponse, <-chan error) { responseChan := make(chan *ModifyImageShareGroupPermissionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyImageShareGroupPermission(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyImageShareGroupPermissionWithCallback invokes the ecs.ModifyImageShareGroupPermission API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyimagesharegrouppermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyImageShareGroupPermissionWithCallback(request *ModifyImageShareGroupPermissionRequest, callback func(response *ModifyImageShareGroupPermissionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyImageShareGroupPermissionResponse var err error defer close(result) response, err = client.ModifyImageShareGroupPermission(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyImageShareGroupPermissionRequest is the request struct for api ModifyImageShareGroupPermission type ModifyImageShareGroupPermissionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` AddGroup1 string `position:"Query" name:"AddGroup.1"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` RemoveGroup1 string `position:"Query" name:"RemoveGroup.1"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyImageShareGroupPermissionResponse is the response struct for api ModifyImageShareGroupPermission type ModifyImageShareGroupPermissionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyImageShareGroupPermissionRequest creates a request to invoke ModifyImageShareGroupPermission API func CreateModifyImageShareGroupPermissionRequest() (request *ModifyImageShareGroupPermissionRequest) { request = &ModifyImageShareGroupPermissionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyImageShareGroupPermission", "ecs", "openAPI") return } // CreateModifyImageShareGroupPermissionResponse creates a response to parse from ModifyImageShareGroupPermission response func CreateModifyImageShareGroupPermissionResponse() (response *ModifyImageShareGroupPermissionResponse) { response = &ModifyImageShareGroupPermissionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_image_share_permission.go��������������������������������������������������������������������0000664�0000000�0000000�00000010770�13771713062�0035116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyImageSharePermission invokes the ecs.ModifyImageSharePermission API synchronously // api document: https://help.aliyun.com/api/ecs/modifyimagesharepermission.html func (client *Client) ModifyImageSharePermission(request *ModifyImageSharePermissionRequest) (response *ModifyImageSharePermissionResponse, err error) { response = CreateModifyImageSharePermissionResponse() err = client.DoAction(request, response) return } // ModifyImageSharePermissionWithChan invokes the ecs.ModifyImageSharePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyimagesharepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyImageSharePermissionWithChan(request *ModifyImageSharePermissionRequest) (<-chan *ModifyImageSharePermissionResponse, <-chan error) { responseChan := make(chan *ModifyImageSharePermissionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyImageSharePermission(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyImageSharePermissionWithCallback invokes the ecs.ModifyImageSharePermission API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyimagesharepermission.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyImageSharePermissionWithCallback(request *ModifyImageSharePermissionRequest, callback func(response *ModifyImageSharePermissionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyImageSharePermissionResponse var err error defer close(result) response, err = client.ModifyImageSharePermission(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyImageSharePermissionRequest is the request struct for api ModifyImageSharePermission type ModifyImageSharePermissionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` AddAccount *[]string `position:"Query" name:"AddAccount" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` RemoveAccount *[]string `position:"Query" name:"RemoveAccount" type:"Repeated"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyImageSharePermissionResponse is the response struct for api ModifyImageSharePermission type ModifyImageSharePermissionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyImageSharePermissionRequest creates a request to invoke ModifyImageSharePermission API func CreateModifyImageSharePermissionRequest() (request *ModifyImageSharePermissionRequest) { request = &ModifyImageSharePermissionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyImageSharePermission", "ecs", "openAPI") return } // CreateModifyImageSharePermissionResponse creates a response to parse from ModifyImageSharePermission response func CreateModifyImageSharePermissionResponse() (response *ModifyImageSharePermissionResponse) { response = &ModifyImageSharePermissionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������modify_instance_attribute.go������������������������������������������������������������������������0000664�0000000�0000000�00000011464�13771713062�0034272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceAttribute invokes the ecs.ModifyInstanceAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceattribute.html func (client *Client) ModifyInstanceAttribute(request *ModifyInstanceAttributeRequest) (response *ModifyInstanceAttributeResponse, err error) { response = CreateModifyInstanceAttributeResponse() err = client.DoAction(request, response) return } // ModifyInstanceAttributeWithChan invokes the ecs.ModifyInstanceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceAttributeWithChan(request *ModifyInstanceAttributeRequest) (<-chan *ModifyInstanceAttributeResponse, <-chan error) { responseChan := make(chan *ModifyInstanceAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceAttributeWithCallback invokes the ecs.ModifyInstanceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceAttributeWithCallback(request *ModifyInstanceAttributeRequest, callback func(response *ModifyInstanceAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceAttributeResponse var err error defer close(result) response, err = client.ModifyInstanceAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceAttributeRequest is the request struct for api ModifyInstanceAttribute type ModifyInstanceAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Recyclable requests.Boolean `position:"Query" name:"Recyclable"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` CreditSpecification string `position:"Query" name:"CreditSpecification"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DeletionProtection requests.Boolean `position:"Query" name:"DeletionProtection"` UserData string `position:"Query" name:"UserData"` Password string `position:"Query" name:"Password"` HostName string `position:"Query" name:"HostName"` InstanceId string `position:"Query" name:"InstanceId"` InstanceName string `position:"Query" name:"InstanceName"` } // ModifyInstanceAttributeResponse is the response struct for api ModifyInstanceAttribute type ModifyInstanceAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyInstanceAttributeRequest creates a request to invoke ModifyInstanceAttribute API func CreateModifyInstanceAttributeRequest() (request *ModifyInstanceAttributeRequest) { request = &ModifyInstanceAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceAttribute", "ecs", "openAPI") return } // CreateModifyInstanceAttributeResponse creates a response to parse from ModifyInstanceAttribute response func CreateModifyInstanceAttributeResponse() (response *ModifyInstanceAttributeResponse) { response = &ModifyInstanceAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_instance_auto_release_time.go����������������������������������������������������������������0000664�0000000�0000000�00000011007�13771713062�0035746�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceAutoReleaseTime invokes the ecs.ModifyInstanceAutoReleaseTime API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceautoreleasetime.html func (client *Client) ModifyInstanceAutoReleaseTime(request *ModifyInstanceAutoReleaseTimeRequest) (response *ModifyInstanceAutoReleaseTimeResponse, err error) { response = CreateModifyInstanceAutoReleaseTimeResponse() err = client.DoAction(request, response) return } // ModifyInstanceAutoReleaseTimeWithChan invokes the ecs.ModifyInstanceAutoReleaseTime API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceautoreleasetime.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceAutoReleaseTimeWithChan(request *ModifyInstanceAutoReleaseTimeRequest) (<-chan *ModifyInstanceAutoReleaseTimeResponse, <-chan error) { responseChan := make(chan *ModifyInstanceAutoReleaseTimeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceAutoReleaseTime(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceAutoReleaseTimeWithCallback invokes the ecs.ModifyInstanceAutoReleaseTime API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceautoreleasetime.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceAutoReleaseTimeWithCallback(request *ModifyInstanceAutoReleaseTimeRequest, callback func(response *ModifyInstanceAutoReleaseTimeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceAutoReleaseTimeResponse var err error defer close(result) response, err = client.ModifyInstanceAutoReleaseTime(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceAutoReleaseTimeRequest is the request struct for api ModifyInstanceAutoReleaseTime type ModifyInstanceAutoReleaseTimeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyInstanceAutoReleaseTimeResponse is the response struct for api ModifyInstanceAutoReleaseTime type ModifyInstanceAutoReleaseTimeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyInstanceAutoReleaseTimeRequest creates a request to invoke ModifyInstanceAutoReleaseTime API func CreateModifyInstanceAutoReleaseTimeRequest() (request *ModifyInstanceAutoReleaseTimeRequest) { request = &ModifyInstanceAutoReleaseTimeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceAutoReleaseTime", "ecs", "openAPI") return } // CreateModifyInstanceAutoReleaseTimeResponse creates a response to parse from ModifyInstanceAutoReleaseTime response func CreateModifyInstanceAutoReleaseTimeResponse() (response *ModifyInstanceAutoReleaseTimeResponse) { response = &ModifyInstanceAutoReleaseTimeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_instance_auto_renew_attribute.go�������������������������������������������������������������0000664�0000000�0000000�00000011536�13771713062�0036522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceAutoRenewAttribute invokes the ecs.ModifyInstanceAutoRenewAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceautorenewattribute.html func (client *Client) ModifyInstanceAutoRenewAttribute(request *ModifyInstanceAutoRenewAttributeRequest) (response *ModifyInstanceAutoRenewAttributeResponse, err error) { response = CreateModifyInstanceAutoRenewAttributeResponse() err = client.DoAction(request, response) return } // ModifyInstanceAutoRenewAttributeWithChan invokes the ecs.ModifyInstanceAutoRenewAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceautorenewattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceAutoRenewAttributeWithChan(request *ModifyInstanceAutoRenewAttributeRequest) (<-chan *ModifyInstanceAutoRenewAttributeResponse, <-chan error) { responseChan := make(chan *ModifyInstanceAutoRenewAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceAutoRenewAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceAutoRenewAttributeWithCallback invokes the ecs.ModifyInstanceAutoRenewAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstanceautorenewattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceAutoRenewAttributeWithCallback(request *ModifyInstanceAutoRenewAttributeRequest, callback func(response *ModifyInstanceAutoRenewAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceAutoRenewAttributeResponse var err error defer close(result) response, err = client.ModifyInstanceAutoRenewAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceAutoRenewAttributeRequest is the request struct for api ModifyInstanceAutoRenewAttribute type ModifyInstanceAutoRenewAttributeRequest struct { *requests.RpcRequest Duration requests.Integer `position:"Query" name:"Duration"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PeriodUnit string `position:"Query" name:"PeriodUnit"` InstanceId string `position:"Query" name:"InstanceId"` AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` RenewalStatus string `position:"Query" name:"RenewalStatus"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyInstanceAutoRenewAttributeResponse is the response struct for api ModifyInstanceAutoRenewAttribute type ModifyInstanceAutoRenewAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyInstanceAutoRenewAttributeRequest creates a request to invoke ModifyInstanceAutoRenewAttribute API func CreateModifyInstanceAutoRenewAttributeRequest() (request *ModifyInstanceAutoRenewAttributeRequest) { request = &ModifyInstanceAutoRenewAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceAutoRenewAttribute", "ecs", "openAPI") return } // CreateModifyInstanceAutoRenewAttributeResponse creates a response to parse from ModifyInstanceAutoRenewAttribute response func CreateModifyInstanceAutoRenewAttributeResponse() (response *ModifyInstanceAutoRenewAttributeResponse) { response = &ModifyInstanceAutoRenewAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_instance_charge_type.go����������������������������������������������������������������������0000664�0000000�0000000�00000011470�13771713062�0034556�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceChargeType invokes the ecs.ModifyInstanceChargeType API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancechargetype.html func (client *Client) ModifyInstanceChargeType(request *ModifyInstanceChargeTypeRequest) (response *ModifyInstanceChargeTypeResponse, err error) { response = CreateModifyInstanceChargeTypeResponse() err = client.DoAction(request, response) return } // ModifyInstanceChargeTypeWithChan invokes the ecs.ModifyInstanceChargeType API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancechargetype.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceChargeTypeWithChan(request *ModifyInstanceChargeTypeRequest) (<-chan *ModifyInstanceChargeTypeResponse, <-chan error) { responseChan := make(chan *ModifyInstanceChargeTypeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceChargeType(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceChargeTypeWithCallback invokes the ecs.ModifyInstanceChargeType API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancechargetype.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceChargeTypeWithCallback(request *ModifyInstanceChargeTypeRequest, callback func(response *ModifyInstanceChargeTypeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceChargeTypeResponse var err error defer close(result) response, err = client.ModifyInstanceChargeType(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceChargeTypeRequest is the request struct for api ModifyInstanceChargeType type ModifyInstanceChargeTypeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Period requests.Integer `position:"Query" name:"Period"` DryRun requests.Boolean `position:"Query" name:"DryRun"` AutoPay requests.Boolean `position:"Query" name:"AutoPay"` IncludeDataDisks requests.Boolean `position:"Query" name:"IncludeDataDisks"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PeriodUnit string `position:"Query" name:"PeriodUnit"` InstanceIds string `position:"Query" name:"InstanceIds"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` } // ModifyInstanceChargeTypeResponse is the response struct for api ModifyInstanceChargeType type ModifyInstanceChargeTypeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` OrderId string `json:"OrderId" xml:"OrderId"` } // CreateModifyInstanceChargeTypeRequest creates a request to invoke ModifyInstanceChargeType API func CreateModifyInstanceChargeTypeRequest() (request *ModifyInstanceChargeTypeRequest) { request = &ModifyInstanceChargeTypeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceChargeType", "ecs", "openAPI") return } // CreateModifyInstanceChargeTypeResponse creates a response to parse from ModifyInstanceChargeType response func CreateModifyInstanceChargeTypeResponse() (response *ModifyInstanceChargeTypeResponse) { response = &ModifyInstanceChargeTypeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_instance_deployment.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010727�13771713062�0034450�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceDeployment invokes the ecs.ModifyInstanceDeployment API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancedeployment.html func (client *Client) ModifyInstanceDeployment(request *ModifyInstanceDeploymentRequest) (response *ModifyInstanceDeploymentResponse, err error) { response = CreateModifyInstanceDeploymentResponse() err = client.DoAction(request, response) return } // ModifyInstanceDeploymentWithChan invokes the ecs.ModifyInstanceDeployment API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancedeployment.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceDeploymentWithChan(request *ModifyInstanceDeploymentRequest) (<-chan *ModifyInstanceDeploymentResponse, <-chan error) { responseChan := make(chan *ModifyInstanceDeploymentResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceDeployment(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceDeploymentWithCallback invokes the ecs.ModifyInstanceDeployment API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancedeployment.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceDeploymentWithCallback(request *ModifyInstanceDeploymentRequest, callback func(response *ModifyInstanceDeploymentResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceDeploymentResponse var err error defer close(result) response, err = client.ModifyInstanceDeployment(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceDeploymentRequest is the request struct for api ModifyInstanceDeployment type ModifyInstanceDeploymentRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` DeploymentSetId string `position:"Query" name:"DeploymentSetId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DedicatedHostId string `position:"Query" name:"DedicatedHostId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` Force requests.Boolean `position:"Query" name:"Force"` } // ModifyInstanceDeploymentResponse is the response struct for api ModifyInstanceDeployment type ModifyInstanceDeploymentResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyInstanceDeploymentRequest creates a request to invoke ModifyInstanceDeployment API func CreateModifyInstanceDeploymentRequest() (request *ModifyInstanceDeploymentRequest) { request = &ModifyInstanceDeploymentRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceDeployment", "ecs", "openAPI") return } // CreateModifyInstanceDeploymentResponse creates a response to parse from ModifyInstanceDeployment response func CreateModifyInstanceDeploymentResponse() (response *ModifyInstanceDeploymentResponse) { response = &ModifyInstanceDeploymentResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������modify_instance_network_spec.go���������������������������������������������������������������������0000664�0000000�0000000�00000011756�13771713062�0034776�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceNetworkSpec invokes the ecs.ModifyInstanceNetworkSpec API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancenetworkspec.html func (client *Client) ModifyInstanceNetworkSpec(request *ModifyInstanceNetworkSpecRequest) (response *ModifyInstanceNetworkSpecResponse, err error) { response = CreateModifyInstanceNetworkSpecResponse() err = client.DoAction(request, response) return } // ModifyInstanceNetworkSpecWithChan invokes the ecs.ModifyInstanceNetworkSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancenetworkspec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceNetworkSpecWithChan(request *ModifyInstanceNetworkSpecRequest) (<-chan *ModifyInstanceNetworkSpecResponse, <-chan error) { responseChan := make(chan *ModifyInstanceNetworkSpecResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceNetworkSpec(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceNetworkSpecWithCallback invokes the ecs.ModifyInstanceNetworkSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancenetworkspec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceNetworkSpecWithCallback(request *ModifyInstanceNetworkSpecRequest, callback func(response *ModifyInstanceNetworkSpecResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceNetworkSpecResponse var err error defer close(result) response, err = client.ModifyInstanceNetworkSpec(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceNetworkSpecRequest is the request struct for api ModifyInstanceNetworkSpec type ModifyInstanceNetworkSpecRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` AutoPay requests.Boolean `position:"Query" name:"AutoPay"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` EndTime string `position:"Query" name:"EndTime"` StartTime string `position:"Query" name:"StartTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` NetworkChargeType string `position:"Query" name:"NetworkChargeType"` InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` AllocatePublicIp requests.Boolean `position:"Query" name:"AllocatePublicIp"` } // ModifyInstanceNetworkSpecResponse is the response struct for api ModifyInstanceNetworkSpec type ModifyInstanceNetworkSpecResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` OrderId string `json:"OrderId" xml:"OrderId"` } // CreateModifyInstanceNetworkSpecRequest creates a request to invoke ModifyInstanceNetworkSpec API func CreateModifyInstanceNetworkSpecRequest() (request *ModifyInstanceNetworkSpecRequest) { request = &ModifyInstanceNetworkSpecRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceNetworkSpec", "ecs", "openAPI") return } // CreateModifyInstanceNetworkSpecResponse creates a response to parse from ModifyInstanceNetworkSpec response func CreateModifyInstanceNetworkSpecResponse() (response *ModifyInstanceNetworkSpecResponse) { response = &ModifyInstanceNetworkSpecResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_instance_spec.go�0000664�0000000�0000000�00000011775�13771713062�0033305�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceSpec invokes the ecs.ModifyInstanceSpec API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancespec.html func (client *Client) ModifyInstanceSpec(request *ModifyInstanceSpecRequest) (response *ModifyInstanceSpecResponse, err error) { response = CreateModifyInstanceSpecResponse() err = client.DoAction(request, response) return } // ModifyInstanceSpecWithChan invokes the ecs.ModifyInstanceSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceSpecWithChan(request *ModifyInstanceSpecRequest) (<-chan *ModifyInstanceSpecResponse, <-chan error) { responseChan := make(chan *ModifyInstanceSpecResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceSpec(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceSpecWithCallback invokes the ecs.ModifyInstanceSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceSpecWithCallback(request *ModifyInstanceSpecRequest, callback func(response *ModifyInstanceSpecResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceSpecResponse var err error defer close(result) response, err = client.ModifyInstanceSpec(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceSpecRequest is the request struct for api ModifyInstanceSpec type ModifyInstanceSpecRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` AllowMigrateAcrossZone requests.Boolean `position:"Query" name:"AllowMigrateAcrossZone"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` TemporaryInternetMaxBandwidthOut requests.Integer `position:"Query" name:"Temporary.InternetMaxBandwidthOut"` SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` TemporaryStartTime string `position:"Query" name:"Temporary.StartTime"` Async requests.Boolean `position:"Query" name:"Async"` InstanceId string `position:"Query" name:"InstanceId"` InstanceType string `position:"Query" name:"InstanceType"` TemporaryEndTime string `position:"Query" name:"Temporary.EndTime"` InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` } // ModifyInstanceSpecResponse is the response struct for api ModifyInstanceSpec type ModifyInstanceSpecResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyInstanceSpecRequest creates a request to invoke ModifyInstanceSpec API func CreateModifyInstanceSpecRequest() (request *ModifyInstanceSpecRequest) { request = &ModifyInstanceSpecRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceSpec", "ecs", "openAPI") return } // CreateModifyInstanceSpecResponse creates a response to parse from ModifyInstanceSpec response func CreateModifyInstanceSpecResponse() (response *ModifyInstanceSpecResponse) { response = &ModifyInstanceSpecResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���modify_instance_vnc_passwd.go�����������������������������������������������������������������������0000664�0000000�0000000�00000010423�13771713062�0034430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceVncPasswd invokes the ecs.ModifyInstanceVncPasswd API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancevncpasswd.html func (client *Client) ModifyInstanceVncPasswd(request *ModifyInstanceVncPasswdRequest) (response *ModifyInstanceVncPasswdResponse, err error) { response = CreateModifyInstanceVncPasswdResponse() err = client.DoAction(request, response) return } // ModifyInstanceVncPasswdWithChan invokes the ecs.ModifyInstanceVncPasswd API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancevncpasswd.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceVncPasswdWithChan(request *ModifyInstanceVncPasswdRequest) (<-chan *ModifyInstanceVncPasswdResponse, <-chan error) { responseChan := make(chan *ModifyInstanceVncPasswdResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceVncPasswd(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceVncPasswdWithCallback invokes the ecs.ModifyInstanceVncPasswd API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancevncpasswd.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceVncPasswdWithCallback(request *ModifyInstanceVncPasswdRequest, callback func(response *ModifyInstanceVncPasswdResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceVncPasswdResponse var err error defer close(result) response, err = client.ModifyInstanceVncPasswd(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceVncPasswdRequest is the request struct for api ModifyInstanceVncPasswd type ModifyInstanceVncPasswdRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` VncPassword string `position:"Query" name:"VncPassword"` } // ModifyInstanceVncPasswdResponse is the response struct for api ModifyInstanceVncPasswd type ModifyInstanceVncPasswdResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyInstanceVncPasswdRequest creates a request to invoke ModifyInstanceVncPasswd API func CreateModifyInstanceVncPasswdRequest() (request *ModifyInstanceVncPasswdRequest) { request = &ModifyInstanceVncPasswdRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceVncPasswd", "ecs", "openAPI") return } // CreateModifyInstanceVncPasswdResponse creates a response to parse from ModifyInstanceVncPasswd response func CreateModifyInstanceVncPasswdResponse() (response *ModifyInstanceVncPasswdResponse) { response = &ModifyInstanceVncPasswdResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_instance_vpc_attribute.go��������������������������������������������������������������������0000664�0000000�0000000�00000010733�13771713062�0035140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyInstanceVpcAttribute invokes the ecs.ModifyInstanceVpcAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancevpcattribute.html func (client *Client) ModifyInstanceVpcAttribute(request *ModifyInstanceVpcAttributeRequest) (response *ModifyInstanceVpcAttributeResponse, err error) { response = CreateModifyInstanceVpcAttributeResponse() err = client.DoAction(request, response) return } // ModifyInstanceVpcAttributeWithChan invokes the ecs.ModifyInstanceVpcAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancevpcattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceVpcAttributeWithChan(request *ModifyInstanceVpcAttributeRequest) (<-chan *ModifyInstanceVpcAttributeResponse, <-chan error) { responseChan := make(chan *ModifyInstanceVpcAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyInstanceVpcAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyInstanceVpcAttributeWithCallback invokes the ecs.ModifyInstanceVpcAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyinstancevpcattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyInstanceVpcAttributeWithCallback(request *ModifyInstanceVpcAttributeRequest, callback func(response *ModifyInstanceVpcAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyInstanceVpcAttributeResponse var err error defer close(result) response, err = client.ModifyInstanceVpcAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyInstanceVpcAttributeRequest is the request struct for api ModifyInstanceVpcAttribute type ModifyInstanceVpcAttributeRequest struct { *requests.RpcRequest VSwitchId string `position:"Query" name:"VSwitchId"` PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyInstanceVpcAttributeResponse is the response struct for api ModifyInstanceVpcAttribute type ModifyInstanceVpcAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyInstanceVpcAttributeRequest creates a request to invoke ModifyInstanceVpcAttribute API func CreateModifyInstanceVpcAttributeRequest() (request *ModifyInstanceVpcAttributeRequest) { request = &ModifyInstanceVpcAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyInstanceVpcAttribute", "ecs", "openAPI") return } // CreateModifyInstanceVpcAttributeResponse creates a response to parse from ModifyInstanceVpcAttribute response func CreateModifyInstanceVpcAttributeResponse() (response *ModifyInstanceVpcAttributeResponse) { response = &ModifyInstanceVpcAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������modify_launch_template_default_version.go�����������������������������������������������������������0000664�0000000�0000000�00000011456�13771713062�0037022�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyLaunchTemplateDefaultVersion invokes the ecs.ModifyLaunchTemplateDefaultVersion API synchronously // api document: https://help.aliyun.com/api/ecs/modifylaunchtemplatedefaultversion.html func (client *Client) ModifyLaunchTemplateDefaultVersion(request *ModifyLaunchTemplateDefaultVersionRequest) (response *ModifyLaunchTemplateDefaultVersionResponse, err error) { response = CreateModifyLaunchTemplateDefaultVersionResponse() err = client.DoAction(request, response) return } // ModifyLaunchTemplateDefaultVersionWithChan invokes the ecs.ModifyLaunchTemplateDefaultVersion API asynchronously // api document: https://help.aliyun.com/api/ecs/modifylaunchtemplatedefaultversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyLaunchTemplateDefaultVersionWithChan(request *ModifyLaunchTemplateDefaultVersionRequest) (<-chan *ModifyLaunchTemplateDefaultVersionResponse, <-chan error) { responseChan := make(chan *ModifyLaunchTemplateDefaultVersionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyLaunchTemplateDefaultVersion(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyLaunchTemplateDefaultVersionWithCallback invokes the ecs.ModifyLaunchTemplateDefaultVersion API asynchronously // api document: https://help.aliyun.com/api/ecs/modifylaunchtemplatedefaultversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyLaunchTemplateDefaultVersionWithCallback(request *ModifyLaunchTemplateDefaultVersionRequest, callback func(response *ModifyLaunchTemplateDefaultVersionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyLaunchTemplateDefaultVersionResponse var err error defer close(result) response, err = client.ModifyLaunchTemplateDefaultVersion(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyLaunchTemplateDefaultVersionRequest is the request struct for api ModifyLaunchTemplateDefaultVersion type ModifyLaunchTemplateDefaultVersionRequest struct { *requests.RpcRequest LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DefaultVersionNumber requests.Integer `position:"Query" name:"DefaultVersionNumber"` } // ModifyLaunchTemplateDefaultVersionResponse is the response struct for api ModifyLaunchTemplateDefaultVersion type ModifyLaunchTemplateDefaultVersionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyLaunchTemplateDefaultVersionRequest creates a request to invoke ModifyLaunchTemplateDefaultVersion API func CreateModifyLaunchTemplateDefaultVersionRequest() (request *ModifyLaunchTemplateDefaultVersionRequest) { request = &ModifyLaunchTemplateDefaultVersionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyLaunchTemplateDefaultVersion", "ecs", "openAPI") return } // CreateModifyLaunchTemplateDefaultVersionResponse creates a response to parse from ModifyLaunchTemplateDefaultVersion response func CreateModifyLaunchTemplateDefaultVersionResponse() (response *ModifyLaunchTemplateDefaultVersionResponse) { response = &ModifyLaunchTemplateDefaultVersionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_network_interface_attribute.go���������������������������������������������������������������0000664�0000000�0000000�00000011423�13771713062�0036172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyNetworkInterfaceAttribute invokes the ecs.ModifyNetworkInterfaceAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifynetworkinterfaceattribute.html func (client *Client) ModifyNetworkInterfaceAttribute(request *ModifyNetworkInterfaceAttributeRequest) (response *ModifyNetworkInterfaceAttributeResponse, err error) { response = CreateModifyNetworkInterfaceAttributeResponse() err = client.DoAction(request, response) return } // ModifyNetworkInterfaceAttributeWithChan invokes the ecs.ModifyNetworkInterfaceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifynetworkinterfaceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyNetworkInterfaceAttributeWithChan(request *ModifyNetworkInterfaceAttributeRequest) (<-chan *ModifyNetworkInterfaceAttributeResponse, <-chan error) { responseChan := make(chan *ModifyNetworkInterfaceAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyNetworkInterfaceAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyNetworkInterfaceAttributeWithCallback invokes the ecs.ModifyNetworkInterfaceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifynetworkinterfaceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyNetworkInterfaceAttributeWithCallback(request *ModifyNetworkInterfaceAttributeRequest, callback func(response *ModifyNetworkInterfaceAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyNetworkInterfaceAttributeResponse var err error defer close(result) response, err = client.ModifyNetworkInterfaceAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyNetworkInterfaceAttributeRequest is the request struct for api ModifyNetworkInterfaceAttribute type ModifyNetworkInterfaceAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SecurityGroupId *[]string `position:"Query" name:"SecurityGroupId" type:"Repeated"` Description string `position:"Query" name:"Description"` NetworkInterfaceName string `position:"Query" name:"NetworkInterfaceName"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // ModifyNetworkInterfaceAttributeResponse is the response struct for api ModifyNetworkInterfaceAttribute type ModifyNetworkInterfaceAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyNetworkInterfaceAttributeRequest creates a request to invoke ModifyNetworkInterfaceAttribute API func CreateModifyNetworkInterfaceAttributeRequest() (request *ModifyNetworkInterfaceAttributeRequest) { request = &ModifyNetworkInterfaceAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyNetworkInterfaceAttribute", "ecs", "openAPI") return } // CreateModifyNetworkInterfaceAttributeResponse creates a response to parse from ModifyNetworkInterfaceAttribute response func CreateModifyNetworkInterfaceAttributeResponse() (response *ModifyNetworkInterfaceAttributeResponse) { response = &ModifyNetworkInterfaceAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_physical_connection_attribute.go�������������������������������������������������������������0000664�0000000�0000000�00000012756�13771713062�0036526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyPhysicalConnectionAttribute invokes the ecs.ModifyPhysicalConnectionAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyphysicalconnectionattribute.html func (client *Client) ModifyPhysicalConnectionAttribute(request *ModifyPhysicalConnectionAttributeRequest) (response *ModifyPhysicalConnectionAttributeResponse, err error) { response = CreateModifyPhysicalConnectionAttributeResponse() err = client.DoAction(request, response) return } // ModifyPhysicalConnectionAttributeWithChan invokes the ecs.ModifyPhysicalConnectionAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyphysicalconnectionattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyPhysicalConnectionAttributeWithChan(request *ModifyPhysicalConnectionAttributeRequest) (<-chan *ModifyPhysicalConnectionAttributeResponse, <-chan error) { responseChan := make(chan *ModifyPhysicalConnectionAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyPhysicalConnectionAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyPhysicalConnectionAttributeWithCallback invokes the ecs.ModifyPhysicalConnectionAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyphysicalconnectionattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyPhysicalConnectionAttributeWithCallback(request *ModifyPhysicalConnectionAttributeRequest, callback func(response *ModifyPhysicalConnectionAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyPhysicalConnectionAttributeResponse var err error defer close(result) response, err = client.ModifyPhysicalConnectionAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyPhysicalConnectionAttributeRequest is the request struct for api ModifyPhysicalConnectionAttribute type ModifyPhysicalConnectionAttributeRequest struct { *requests.RpcRequest RedundantPhysicalConnectionId string `position:"Query" name:"RedundantPhysicalConnectionId"` PeerLocation string `position:"Query" name:"PeerLocation"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PortType string `position:"Query" name:"PortType"` CircuitCode string `position:"Query" name:"CircuitCode"` Bandwidth requests.Integer `position:"Query" name:"bandwidth"` ClientToken string `position:"Query" name:"ClientToken"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` LineOperator string `position:"Query" name:"LineOperator"` PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` Name string `position:"Query" name:"Name"` UserCidr string `position:"Query" name:"UserCidr"` } // ModifyPhysicalConnectionAttributeResponse is the response struct for api ModifyPhysicalConnectionAttribute type ModifyPhysicalConnectionAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyPhysicalConnectionAttributeRequest creates a request to invoke ModifyPhysicalConnectionAttribute API func CreateModifyPhysicalConnectionAttributeRequest() (request *ModifyPhysicalConnectionAttributeRequest) { request = &ModifyPhysicalConnectionAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyPhysicalConnectionAttribute", "ecs", "openAPI") return } // CreateModifyPhysicalConnectionAttributeResponse creates a response to parse from ModifyPhysicalConnectionAttribute response func CreateModifyPhysicalConnectionAttributeResponse() (response *ModifyPhysicalConnectionAttributeResponse) { response = &ModifyPhysicalConnectionAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������modify_prepay_instance_spec.go����������������������������������������������������������������������0000664�0000000�0000000�00000011371�13771713062�0034576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyPrepayInstanceSpec invokes the ecs.ModifyPrepayInstanceSpec API synchronously // api document: https://help.aliyun.com/api/ecs/modifyprepayinstancespec.html func (client *Client) ModifyPrepayInstanceSpec(request *ModifyPrepayInstanceSpecRequest) (response *ModifyPrepayInstanceSpecResponse, err error) { response = CreateModifyPrepayInstanceSpecResponse() err = client.DoAction(request, response) return } // ModifyPrepayInstanceSpecWithChan invokes the ecs.ModifyPrepayInstanceSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyprepayinstancespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyPrepayInstanceSpecWithChan(request *ModifyPrepayInstanceSpecRequest) (<-chan *ModifyPrepayInstanceSpecResponse, <-chan error) { responseChan := make(chan *ModifyPrepayInstanceSpecResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyPrepayInstanceSpec(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyPrepayInstanceSpecWithCallback invokes the ecs.ModifyPrepayInstanceSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyprepayinstancespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyPrepayInstanceSpecWithCallback(request *ModifyPrepayInstanceSpecRequest, callback func(response *ModifyPrepayInstanceSpecResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyPrepayInstanceSpecResponse var err error defer close(result) response, err = client.ModifyPrepayInstanceSpec(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyPrepayInstanceSpecRequest is the request struct for api ModifyPrepayInstanceSpec type ModifyPrepayInstanceSpecRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` AutoPay requests.Boolean `position:"Query" name:"AutoPay"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` OperatorType string `position:"Query" name:"OperatorType"` SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` InstanceId string `position:"Query" name:"InstanceId"` MigrateAcrossZone requests.Boolean `position:"Query" name:"MigrateAcrossZone"` InstanceType string `position:"Query" name:"InstanceType"` } // ModifyPrepayInstanceSpecResponse is the response struct for api ModifyPrepayInstanceSpec type ModifyPrepayInstanceSpecResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` OrderId string `json:"OrderId" xml:"OrderId"` } // CreateModifyPrepayInstanceSpecRequest creates a request to invoke ModifyPrepayInstanceSpec API func CreateModifyPrepayInstanceSpecRequest() (request *ModifyPrepayInstanceSpecRequest) { request = &ModifyPrepayInstanceSpecRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyPrepayInstanceSpec", "ecs", "openAPI") return } // CreateModifyPrepayInstanceSpecResponse creates a response to parse from ModifyPrepayInstanceSpec response func CreateModifyPrepayInstanceSpecResponse() (response *ModifyPrepayInstanceSpecResponse) { response = &ModifyPrepayInstanceSpecResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_reserved_instances.go������������������������������������������������������������������������0000664�0000000�0000000�00000012033�13771713062�0034262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyReservedInstances invokes the ecs.ModifyReservedInstances API synchronously // api document: https://help.aliyun.com/api/ecs/modifyreservedinstances.html func (client *Client) ModifyReservedInstances(request *ModifyReservedInstancesRequest) (response *ModifyReservedInstancesResponse, err error) { response = CreateModifyReservedInstancesResponse() err = client.DoAction(request, response) return } // ModifyReservedInstancesWithChan invokes the ecs.ModifyReservedInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyreservedinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyReservedInstancesWithChan(request *ModifyReservedInstancesRequest) (<-chan *ModifyReservedInstancesResponse, <-chan error) { responseChan := make(chan *ModifyReservedInstancesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyReservedInstances(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyReservedInstancesWithCallback invokes the ecs.ModifyReservedInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyreservedinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyReservedInstancesWithCallback(request *ModifyReservedInstancesRequest, callback func(response *ModifyReservedInstancesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyReservedInstancesResponse var err error defer close(result) response, err = client.ModifyReservedInstances(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyReservedInstancesRequest is the request struct for api ModifyReservedInstances type ModifyReservedInstancesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Configuration *[]ModifyReservedInstancesConfiguration `position:"Query" name:"Configuration" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ReservedInstanceId *[]string `position:"Query" name:"ReservedInstanceId" type:"Repeated"` } // ModifyReservedInstancesConfiguration is a repeated param struct in ModifyReservedInstancesRequest type ModifyReservedInstancesConfiguration struct { ZoneId string `name:"ZoneId"` ReservedInstanceName string `name:"ReservedInstanceName"` InstanceType string `name:"InstanceType"` Scope string `name:"Scope"` InstanceAmount string `name:"InstanceAmount"` } // ModifyReservedInstancesResponse is the response struct for api ModifyReservedInstances type ModifyReservedInstancesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` ReservedInstanceIdSets ReservedInstanceIdSetsInModifyReservedInstances `json:"ReservedInstanceIdSets" xml:"ReservedInstanceIdSets"` } // CreateModifyReservedInstancesRequest creates a request to invoke ModifyReservedInstances API func CreateModifyReservedInstancesRequest() (request *ModifyReservedInstancesRequest) { request = &ModifyReservedInstancesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyReservedInstances", "ecs", "openAPI") return } // CreateModifyReservedInstancesResponse creates a response to parse from ModifyReservedInstances response func CreateModifyReservedInstancesResponse() (response *ModifyReservedInstancesResponse) { response = &ModifyReservedInstancesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_router_interface_attribute.go����������������������������������������������������������������0000664�0000000�0000000�00000012131�13771713062�0036016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyRouterInterfaceAttribute invokes the ecs.ModifyRouterInterfaceAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyrouterinterfaceattribute.html func (client *Client) ModifyRouterInterfaceAttribute(request *ModifyRouterInterfaceAttributeRequest) (response *ModifyRouterInterfaceAttributeResponse, err error) { response = CreateModifyRouterInterfaceAttributeResponse() err = client.DoAction(request, response) return } // ModifyRouterInterfaceAttributeWithChan invokes the ecs.ModifyRouterInterfaceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyrouterinterfaceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyRouterInterfaceAttributeWithChan(request *ModifyRouterInterfaceAttributeRequest) (<-chan *ModifyRouterInterfaceAttributeResponse, <-chan error) { responseChan := make(chan *ModifyRouterInterfaceAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyRouterInterfaceAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyRouterInterfaceAttributeWithCallback invokes the ecs.ModifyRouterInterfaceAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyrouterinterfaceattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyRouterInterfaceAttributeWithCallback(request *ModifyRouterInterfaceAttributeRequest, callback func(response *ModifyRouterInterfaceAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyRouterInterfaceAttributeResponse var err error defer close(result) response, err = client.ModifyRouterInterfaceAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyRouterInterfaceAttributeRequest is the request struct for api ModifyRouterInterfaceAttribute type ModifyRouterInterfaceAttributeRequest struct { *requests.RpcRequest OppositeRouterId string `position:"Query" name:"OppositeRouterId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Description string `position:"Query" name:"Description"` HealthCheckTargetIp string `position:"Query" name:"HealthCheckTargetIp"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` OppositeInterfaceOwnerId requests.Integer `position:"Query" name:"OppositeInterfaceOwnerId"` HealthCheckSourceIp string `position:"Query" name:"HealthCheckSourceIp"` Name string `position:"Query" name:"Name"` OppositeRouterType string `position:"Query" name:"OppositeRouterType"` OppositeInterfaceId string `position:"Query" name:"OppositeInterfaceId"` } // ModifyRouterInterfaceAttributeResponse is the response struct for api ModifyRouterInterfaceAttribute type ModifyRouterInterfaceAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyRouterInterfaceAttributeRequest creates a request to invoke ModifyRouterInterfaceAttribute API func CreateModifyRouterInterfaceAttributeRequest() (request *ModifyRouterInterfaceAttributeRequest) { request = &ModifyRouterInterfaceAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyRouterInterfaceAttribute", "ecs", "openAPI") return } // CreateModifyRouterInterfaceAttributeResponse creates a response to parse from ModifyRouterInterfaceAttribute response func CreateModifyRouterInterfaceAttributeResponse() (response *ModifyRouterInterfaceAttributeResponse) { response = &ModifyRouterInterfaceAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_router_interface_spec.go���������������������������������������������������������������������0000664�0000000�0000000�00000011045�13771713062�0034750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyRouterInterfaceSpec invokes the ecs.ModifyRouterInterfaceSpec API synchronously // api document: https://help.aliyun.com/api/ecs/modifyrouterinterfacespec.html func (client *Client) ModifyRouterInterfaceSpec(request *ModifyRouterInterfaceSpecRequest) (response *ModifyRouterInterfaceSpecResponse, err error) { response = CreateModifyRouterInterfaceSpecResponse() err = client.DoAction(request, response) return } // ModifyRouterInterfaceSpecWithChan invokes the ecs.ModifyRouterInterfaceSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyrouterinterfacespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyRouterInterfaceSpecWithChan(request *ModifyRouterInterfaceSpecRequest) (<-chan *ModifyRouterInterfaceSpecResponse, <-chan error) { responseChan := make(chan *ModifyRouterInterfaceSpecResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyRouterInterfaceSpec(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyRouterInterfaceSpecWithCallback invokes the ecs.ModifyRouterInterfaceSpec API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyrouterinterfacespec.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyRouterInterfaceSpecWithCallback(request *ModifyRouterInterfaceSpecRequest, callback func(response *ModifyRouterInterfaceSpecResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyRouterInterfaceSpecResponse var err error defer close(result) response, err = client.ModifyRouterInterfaceSpec(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyRouterInterfaceSpecRequest is the request struct for api ModifyRouterInterfaceSpec type ModifyRouterInterfaceSpecRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` RouterInterfaceId string `position:"Query" name:"RouterInterfaceId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Spec string `position:"Query" name:"Spec"` } // ModifyRouterInterfaceSpecResponse is the response struct for api ModifyRouterInterfaceSpec type ModifyRouterInterfaceSpecResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Spec string `json:"Spec" xml:"Spec"` } // CreateModifyRouterInterfaceSpecRequest creates a request to invoke ModifyRouterInterfaceSpec API func CreateModifyRouterInterfaceSpecRequest() (request *ModifyRouterInterfaceSpecRequest) { request = &ModifyRouterInterfaceSpecRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyRouterInterfaceSpec", "ecs", "openAPI") return } // CreateModifyRouterInterfaceSpecResponse creates a response to parse from ModifyRouterInterfaceSpec response func CreateModifyRouterInterfaceSpecResponse() (response *ModifyRouterInterfaceSpecResponse) { response = &ModifyRouterInterfaceSpecResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_security_group_attribute.go������������������������������������������������������������������0000664�0000000�0000000�00000011063�13771713062�0035544�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifySecurityGroupAttribute invokes the ecs.ModifySecurityGroupAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygroupattribute.html func (client *Client) ModifySecurityGroupAttribute(request *ModifySecurityGroupAttributeRequest) (response *ModifySecurityGroupAttributeResponse, err error) { response = CreateModifySecurityGroupAttributeResponse() err = client.DoAction(request, response) return } // ModifySecurityGroupAttributeWithChan invokes the ecs.ModifySecurityGroupAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygroupattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupAttributeWithChan(request *ModifySecurityGroupAttributeRequest) (<-chan *ModifySecurityGroupAttributeResponse, <-chan error) { responseChan := make(chan *ModifySecurityGroupAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifySecurityGroupAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifySecurityGroupAttributeWithCallback invokes the ecs.ModifySecurityGroupAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygroupattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupAttributeWithCallback(request *ModifySecurityGroupAttributeRequest, callback func(response *ModifySecurityGroupAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifySecurityGroupAttributeResponse var err error defer close(result) response, err = client.ModifySecurityGroupAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifySecurityGroupAttributeRequest is the request struct for api ModifySecurityGroupAttribute type ModifySecurityGroupAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` SecurityGroupName string `position:"Query" name:"SecurityGroupName"` } // ModifySecurityGroupAttributeResponse is the response struct for api ModifySecurityGroupAttribute type ModifySecurityGroupAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifySecurityGroupAttributeRequest creates a request to invoke ModifySecurityGroupAttribute API func CreateModifySecurityGroupAttributeRequest() (request *ModifySecurityGroupAttributeRequest) { request = &ModifySecurityGroupAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupAttribute", "ecs", "openAPI") return } // CreateModifySecurityGroupAttributeResponse creates a response to parse from ModifySecurityGroupAttribute response func CreateModifySecurityGroupAttributeResponse() (response *ModifySecurityGroupAttributeResponse) { response = &ModifySecurityGroupAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_security_group_egress_rule.go����������������������������������������������������������������0000664�0000000�0000000�00000013136�13771713062�0036063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifySecurityGroupEgressRule invokes the ecs.ModifySecurityGroupEgressRule API synchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygroupegressrule.html func (client *Client) ModifySecurityGroupEgressRule(request *ModifySecurityGroupEgressRuleRequest) (response *ModifySecurityGroupEgressRuleResponse, err error) { response = CreateModifySecurityGroupEgressRuleResponse() err = client.DoAction(request, response) return } // ModifySecurityGroupEgressRuleWithChan invokes the ecs.ModifySecurityGroupEgressRule API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygroupegressrule.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupEgressRuleWithChan(request *ModifySecurityGroupEgressRuleRequest) (<-chan *ModifySecurityGroupEgressRuleResponse, <-chan error) { responseChan := make(chan *ModifySecurityGroupEgressRuleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifySecurityGroupEgressRule(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifySecurityGroupEgressRuleWithCallback invokes the ecs.ModifySecurityGroupEgressRule API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygroupegressrule.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupEgressRuleWithCallback(request *ModifySecurityGroupEgressRuleRequest, callback func(response *ModifySecurityGroupEgressRuleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifySecurityGroupEgressRuleResponse var err error defer close(result) response, err = client.ModifySecurityGroupEgressRule(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifySecurityGroupEgressRuleRequest is the request struct for api ModifySecurityGroupEgressRule type ModifySecurityGroupEgressRuleRequest struct { *requests.RpcRequest NicType string `position:"Query" name:"NicType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SourcePortRange string `position:"Query" name:"SourcePortRange"` ClientToken string `position:"Query" name:"ClientToken"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` Policy string `position:"Query" name:"Policy"` PortRange string `position:"Query" name:"PortRange"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SourceCidrIp string `position:"Query" name:"SourceCidrIp"` DestGroupId string `position:"Query" name:"DestGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DestGroupOwnerAccount string `position:"Query" name:"DestGroupOwnerAccount"` Priority string `position:"Query" name:"Priority"` DestCidrIp string `position:"Query" name:"DestCidrIp"` DestGroupOwnerId requests.Integer `position:"Query" name:"DestGroupOwnerId"` } // ModifySecurityGroupEgressRuleResponse is the response struct for api ModifySecurityGroupEgressRule type ModifySecurityGroupEgressRuleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifySecurityGroupEgressRuleRequest creates a request to invoke ModifySecurityGroupEgressRule API func CreateModifySecurityGroupEgressRuleRequest() (request *ModifySecurityGroupEgressRuleRequest) { request = &ModifySecurityGroupEgressRuleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupEgressRule", "ecs", "openAPI") return } // CreateModifySecurityGroupEgressRuleResponse creates a response to parse from ModifySecurityGroupEgressRule response func CreateModifySecurityGroupEgressRuleResponse() (response *ModifySecurityGroupEgressRuleResponse) { response = &ModifySecurityGroupEgressRuleResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_security_group_policy.go���������������������������������������������������������������������0000664�0000000�0000000�00000010673�13771713062�0035046�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifySecurityGroupPolicy invokes the ecs.ModifySecurityGroupPolicy API synchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygrouppolicy.html func (client *Client) ModifySecurityGroupPolicy(request *ModifySecurityGroupPolicyRequest) (response *ModifySecurityGroupPolicyResponse, err error) { response = CreateModifySecurityGroupPolicyResponse() err = client.DoAction(request, response) return } // ModifySecurityGroupPolicyWithChan invokes the ecs.ModifySecurityGroupPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygrouppolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupPolicyWithChan(request *ModifySecurityGroupPolicyRequest) (<-chan *ModifySecurityGroupPolicyResponse, <-chan error) { responseChan := make(chan *ModifySecurityGroupPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifySecurityGroupPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifySecurityGroupPolicyWithCallback invokes the ecs.ModifySecurityGroupPolicy API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygrouppolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupPolicyWithCallback(request *ModifySecurityGroupPolicyRequest, callback func(response *ModifySecurityGroupPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifySecurityGroupPolicyResponse var err error defer close(result) response, err = client.ModifySecurityGroupPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifySecurityGroupPolicyRequest is the request struct for api ModifySecurityGroupPolicy type ModifySecurityGroupPolicyRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ClientToken string `position:"Query" name:"ClientToken"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InnerAccessPolicy string `position:"Query" name:"InnerAccessPolicy"` } // ModifySecurityGroupPolicyResponse is the response struct for api ModifySecurityGroupPolicy type ModifySecurityGroupPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifySecurityGroupPolicyRequest creates a request to invoke ModifySecurityGroupPolicy API func CreateModifySecurityGroupPolicyRequest() (request *ModifySecurityGroupPolicyRequest) { request = &ModifySecurityGroupPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupPolicy", "ecs", "openAPI") return } // CreateModifySecurityGroupPolicyResponse creates a response to parse from ModifySecurityGroupPolicy response func CreateModifySecurityGroupPolicyResponse() (response *ModifySecurityGroupPolicyResponse) { response = &ModifySecurityGroupPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������modify_security_group_rule.go�����������������������������������������������������������������������0000664�0000000�0000000�00000012634�13771713062�0034515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifySecurityGroupRule invokes the ecs.ModifySecurityGroupRule API synchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygrouprule.html func (client *Client) ModifySecurityGroupRule(request *ModifySecurityGroupRuleRequest) (response *ModifySecurityGroupRuleResponse, err error) { response = CreateModifySecurityGroupRuleResponse() err = client.DoAction(request, response) return } // ModifySecurityGroupRuleWithChan invokes the ecs.ModifySecurityGroupRule API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygrouprule.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupRuleWithChan(request *ModifySecurityGroupRuleRequest) (<-chan *ModifySecurityGroupRuleResponse, <-chan error) { responseChan := make(chan *ModifySecurityGroupRuleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifySecurityGroupRule(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifySecurityGroupRuleWithCallback invokes the ecs.ModifySecurityGroupRule API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysecuritygrouprule.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySecurityGroupRuleWithCallback(request *ModifySecurityGroupRuleRequest, callback func(response *ModifySecurityGroupRuleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifySecurityGroupRuleResponse var err error defer close(result) response, err = client.ModifySecurityGroupRule(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifySecurityGroupRuleRequest is the request struct for api ModifySecurityGroupRule type ModifySecurityGroupRuleRequest struct { *requests.RpcRequest NicType string `position:"Query" name:"NicType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SourcePortRange string `position:"Query" name:"SourcePortRange"` ClientToken string `position:"Query" name:"ClientToken"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` SourceGroupOwnerId requests.Integer `position:"Query" name:"SourceGroupOwnerId"` SourceGroupOwnerAccount string `position:"Query" name:"SourceGroupOwnerAccount"` Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` Policy string `position:"Query" name:"Policy"` PortRange string `position:"Query" name:"PortRange"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SourceCidrIp string `position:"Query" name:"SourceCidrIp"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Priority string `position:"Query" name:"Priority"` DestCidrIp string `position:"Query" name:"DestCidrIp"` SourceGroupId string `position:"Query" name:"SourceGroupId"` } // ModifySecurityGroupRuleResponse is the response struct for api ModifySecurityGroupRule type ModifySecurityGroupRuleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifySecurityGroupRuleRequest creates a request to invoke ModifySecurityGroupRule API func CreateModifySecurityGroupRuleRequest() (request *ModifySecurityGroupRuleRequest) { request = &ModifySecurityGroupRuleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySecurityGroupRule", "ecs", "openAPI") return } // CreateModifySecurityGroupRuleResponse creates a response to parse from ModifySecurityGroupRule response func CreateModifySecurityGroupRuleResponse() (response *ModifySecurityGroupRuleResponse) { response = &ModifySecurityGroupRuleResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������modify_snapshot_attribute.go������������������������������������������������������������������������0000664�0000000�0000000�00000010541�13771713062�0034320�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifySnapshotAttribute invokes the ecs.ModifySnapshotAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifysnapshotattribute.html func (client *Client) ModifySnapshotAttribute(request *ModifySnapshotAttributeRequest) (response *ModifySnapshotAttributeResponse, err error) { response = CreateModifySnapshotAttributeResponse() err = client.DoAction(request, response) return } // ModifySnapshotAttributeWithChan invokes the ecs.ModifySnapshotAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysnapshotattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySnapshotAttributeWithChan(request *ModifySnapshotAttributeRequest) (<-chan *ModifySnapshotAttributeResponse, <-chan error) { responseChan := make(chan *ModifySnapshotAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifySnapshotAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifySnapshotAttributeWithCallback invokes the ecs.ModifySnapshotAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifysnapshotattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifySnapshotAttributeWithCallback(request *ModifySnapshotAttributeRequest, callback func(response *ModifySnapshotAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifySnapshotAttributeResponse var err error defer close(result) response, err = client.ModifySnapshotAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifySnapshotAttributeRequest is the request struct for api ModifySnapshotAttribute type ModifySnapshotAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotId string `position:"Query" name:"SnapshotId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` SnapshotName string `position:"Query" name:"SnapshotName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifySnapshotAttributeResponse is the response struct for api ModifySnapshotAttribute type ModifySnapshotAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifySnapshotAttributeRequest creates a request to invoke ModifySnapshotAttribute API func CreateModifySnapshotAttributeRequest() (request *ModifySnapshotAttributeRequest) { request = &ModifySnapshotAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifySnapshotAttribute", "ecs", "openAPI") return } // CreateModifySnapshotAttributeResponse creates a response to parse from ModifySnapshotAttribute response func CreateModifySnapshotAttributeResponse() (response *ModifySnapshotAttributeResponse) { response = &ModifySnapshotAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������modify_user_business_behavior.go��������������������������������������������������������������������0000664�0000000�0000000�00000010612�13771713062�0035145�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyUserBusinessBehavior invokes the ecs.ModifyUserBusinessBehavior API synchronously // api document: https://help.aliyun.com/api/ecs/modifyuserbusinessbehavior.html func (client *Client) ModifyUserBusinessBehavior(request *ModifyUserBusinessBehaviorRequest) (response *ModifyUserBusinessBehaviorResponse, err error) { response = CreateModifyUserBusinessBehaviorResponse() err = client.DoAction(request, response) return } // ModifyUserBusinessBehaviorWithChan invokes the ecs.ModifyUserBusinessBehavior API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyuserbusinessbehavior.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyUserBusinessBehaviorWithChan(request *ModifyUserBusinessBehaviorRequest) (<-chan *ModifyUserBusinessBehaviorResponse, <-chan error) { responseChan := make(chan *ModifyUserBusinessBehaviorResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyUserBusinessBehavior(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyUserBusinessBehaviorWithCallback invokes the ecs.ModifyUserBusinessBehavior API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyuserbusinessbehavior.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyUserBusinessBehaviorWithCallback(request *ModifyUserBusinessBehaviorRequest, callback func(response *ModifyUserBusinessBehaviorResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyUserBusinessBehaviorResponse var err error defer close(result) response, err = client.ModifyUserBusinessBehavior(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyUserBusinessBehaviorRequest is the request struct for api ModifyUserBusinessBehavior type ModifyUserBusinessBehaviorRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` StatusValue string `position:"Query" name:"statusValue"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` StatusKey string `position:"Query" name:"statusKey"` } // ModifyUserBusinessBehaviorResponse is the response struct for api ModifyUserBusinessBehavior type ModifyUserBusinessBehaviorResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyUserBusinessBehaviorRequest creates a request to invoke ModifyUserBusinessBehavior API func CreateModifyUserBusinessBehaviorRequest() (request *ModifyUserBusinessBehaviorRequest) { request = &ModifyUserBusinessBehaviorRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyUserBusinessBehavior", "ecs", "openAPI") return } // CreateModifyUserBusinessBehaviorResponse creates a response to parse from ModifyUserBusinessBehavior response func CreateModifyUserBusinessBehaviorResponse() (response *ModifyUserBusinessBehaviorResponse) { response = &ModifyUserBusinessBehaviorResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������modify_v_router_attribute.go������������������������������������������������������������������������0000664�0000000�0000000�00000010467�13771713062�0034335�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyVRouterAttribute invokes the ecs.ModifyVRouterAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyvrouterattribute.html func (client *Client) ModifyVRouterAttribute(request *ModifyVRouterAttributeRequest) (response *ModifyVRouterAttributeResponse, err error) { response = CreateModifyVRouterAttributeResponse() err = client.DoAction(request, response) return } // ModifyVRouterAttributeWithChan invokes the ecs.ModifyVRouterAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvrouterattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVRouterAttributeWithChan(request *ModifyVRouterAttributeRequest) (<-chan *ModifyVRouterAttributeResponse, <-chan error) { responseChan := make(chan *ModifyVRouterAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyVRouterAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyVRouterAttributeWithCallback invokes the ecs.ModifyVRouterAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvrouterattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVRouterAttributeWithCallback(request *ModifyVRouterAttributeRequest, callback func(response *ModifyVRouterAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyVRouterAttributeResponse var err error defer close(result) response, err = client.ModifyVRouterAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyVRouterAttributeRequest is the request struct for api ModifyVRouterAttribute type ModifyVRouterAttributeRequest struct { *requests.RpcRequest VRouterName string `position:"Query" name:"VRouterName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` VRouterId string `position:"Query" name:"VRouterId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyVRouterAttributeResponse is the response struct for api ModifyVRouterAttribute type ModifyVRouterAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyVRouterAttributeRequest creates a request to invoke ModifyVRouterAttribute API func CreateModifyVRouterAttributeRequest() (request *ModifyVRouterAttributeRequest) { request = &ModifyVRouterAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVRouterAttribute", "ecs", "openAPI") return } // CreateModifyVRouterAttributeResponse creates a response to parse from ModifyVRouterAttribute response func CreateModifyVRouterAttributeResponse() (response *ModifyVRouterAttributeResponse) { response = &ModifyVRouterAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_v_switch_attribute.go������������������������������������������������������������������������0000664�0000000�0000000�00000010467�13771713062�0034316�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyVSwitchAttribute invokes the ecs.ModifyVSwitchAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyvswitchattribute.html func (client *Client) ModifyVSwitchAttribute(request *ModifyVSwitchAttributeRequest) (response *ModifyVSwitchAttributeResponse, err error) { response = CreateModifyVSwitchAttributeResponse() err = client.DoAction(request, response) return } // ModifyVSwitchAttributeWithChan invokes the ecs.ModifyVSwitchAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvswitchattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVSwitchAttributeWithChan(request *ModifyVSwitchAttributeRequest) (<-chan *ModifyVSwitchAttributeResponse, <-chan error) { responseChan := make(chan *ModifyVSwitchAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyVSwitchAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyVSwitchAttributeWithCallback invokes the ecs.ModifyVSwitchAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvswitchattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVSwitchAttributeWithCallback(request *ModifyVSwitchAttributeRequest, callback func(response *ModifyVSwitchAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyVSwitchAttributeResponse var err error defer close(result) response, err = client.ModifyVSwitchAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyVSwitchAttributeRequest is the request struct for api ModifyVSwitchAttribute type ModifyVSwitchAttributeRequest struct { *requests.RpcRequest VSwitchId string `position:"Query" name:"VSwitchId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VSwitchName string `position:"Query" name:"VSwitchName"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyVSwitchAttributeResponse is the response struct for api ModifyVSwitchAttribute type ModifyVSwitchAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyVSwitchAttributeRequest creates a request to invoke ModifyVSwitchAttribute API func CreateModifyVSwitchAttributeRequest() (request *ModifyVSwitchAttributeRequest) { request = &ModifyVSwitchAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVSwitchAttribute", "ecs", "openAPI") return } // CreateModifyVSwitchAttributeResponse creates a response to parse from ModifyVSwitchAttribute response func CreateModifyVSwitchAttributeResponse() (response *ModifyVSwitchAttributeResponse) { response = &ModifyVSwitchAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������modify_virtual_border_router_attribute.go�����������������������������������������������������������0000664�0000000�0000000�00000012452�13771713062�0037107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyVirtualBorderRouterAttribute invokes the ecs.ModifyVirtualBorderRouterAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyvirtualborderrouterattribute.html func (client *Client) ModifyVirtualBorderRouterAttribute(request *ModifyVirtualBorderRouterAttributeRequest) (response *ModifyVirtualBorderRouterAttributeResponse, err error) { response = CreateModifyVirtualBorderRouterAttributeResponse() err = client.DoAction(request, response) return } // ModifyVirtualBorderRouterAttributeWithChan invokes the ecs.ModifyVirtualBorderRouterAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvirtualborderrouterattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVirtualBorderRouterAttributeWithChan(request *ModifyVirtualBorderRouterAttributeRequest) (<-chan *ModifyVirtualBorderRouterAttributeResponse, <-chan error) { responseChan := make(chan *ModifyVirtualBorderRouterAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyVirtualBorderRouterAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyVirtualBorderRouterAttributeWithCallback invokes the ecs.ModifyVirtualBorderRouterAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvirtualborderrouterattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVirtualBorderRouterAttributeWithCallback(request *ModifyVirtualBorderRouterAttributeRequest, callback func(response *ModifyVirtualBorderRouterAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyVirtualBorderRouterAttributeResponse var err error defer close(result) response, err = client.ModifyVirtualBorderRouterAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyVirtualBorderRouterAttributeRequest is the request struct for api ModifyVirtualBorderRouterAttribute type ModifyVirtualBorderRouterAttributeRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` CircuitCode string `position:"Query" name:"CircuitCode"` VlanId requests.Integer `position:"Query" name:"VlanId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Description string `position:"Query" name:"Description"` VbrId string `position:"Query" name:"VbrId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PeerGatewayIp string `position:"Query" name:"PeerGatewayIp"` PeeringSubnetMask string `position:"Query" name:"PeeringSubnetMask"` Name string `position:"Query" name:"Name"` LocalGatewayIp string `position:"Query" name:"LocalGatewayIp"` UserCidr string `position:"Query" name:"UserCidr"` } // ModifyVirtualBorderRouterAttributeResponse is the response struct for api ModifyVirtualBorderRouterAttribute type ModifyVirtualBorderRouterAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyVirtualBorderRouterAttributeRequest creates a request to invoke ModifyVirtualBorderRouterAttribute API func CreateModifyVirtualBorderRouterAttributeRequest() (request *ModifyVirtualBorderRouterAttributeRequest) { request = &ModifyVirtualBorderRouterAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVirtualBorderRouterAttribute", "ecs", "openAPI") return } // CreateModifyVirtualBorderRouterAttributeResponse creates a response to parse from ModifyVirtualBorderRouterAttribute response func CreateModifyVirtualBorderRouterAttributeResponse() (response *ModifyVirtualBorderRouterAttributeResponse) { response = &ModifyVirtualBorderRouterAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/modify_vpc_attribute.go�0000664�0000000�0000000�00000010444�13771713062�0033332�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ModifyVpcAttribute invokes the ecs.ModifyVpcAttribute API synchronously // api document: https://help.aliyun.com/api/ecs/modifyvpcattribute.html func (client *Client) ModifyVpcAttribute(request *ModifyVpcAttributeRequest) (response *ModifyVpcAttributeResponse, err error) { response = CreateModifyVpcAttributeResponse() err = client.DoAction(request, response) return } // ModifyVpcAttributeWithChan invokes the ecs.ModifyVpcAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvpcattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVpcAttributeWithChan(request *ModifyVpcAttributeRequest) (<-chan *ModifyVpcAttributeResponse, <-chan error) { responseChan := make(chan *ModifyVpcAttributeResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ModifyVpcAttribute(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ModifyVpcAttributeWithCallback invokes the ecs.ModifyVpcAttribute API asynchronously // api document: https://help.aliyun.com/api/ecs/modifyvpcattribute.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ModifyVpcAttributeWithCallback(request *ModifyVpcAttributeRequest, callback func(response *ModifyVpcAttributeResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ModifyVpcAttributeResponse var err error defer close(result) response, err = client.ModifyVpcAttribute(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ModifyVpcAttributeRequest is the request struct for api ModifyVpcAttribute type ModifyVpcAttributeRequest struct { *requests.RpcRequest VpcName string `position:"Query" name:"VpcName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` VpcId string `position:"Query" name:"VpcId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` CidrBlock string `position:"Query" name:"CidrBlock"` Description string `position:"Query" name:"Description"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ModifyVpcAttributeResponse is the response struct for api ModifyVpcAttribute type ModifyVpcAttributeResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateModifyVpcAttributeRequest creates a request to invoke ModifyVpcAttribute API func CreateModifyVpcAttributeRequest() (request *ModifyVpcAttributeRequest) { request = &ModifyVpcAttributeRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ModifyVpcAttribute", "ecs", "openAPI") return } // CreateModifyVpcAttributeResponse creates a response to parse from ModifyVpcAttribute response func CreateModifyVpcAttributeResponse() (response *ModifyVpcAttributeResponse) { response = &ModifyVpcAttributeResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������purchase_reserved_instances_offering.go�������������������������������������������������������������0000664�0000000�0000000�00000013051�13771713062�0036465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // PurchaseReservedInstancesOffering invokes the ecs.PurchaseReservedInstancesOffering API synchronously // api document: https://help.aliyun.com/api/ecs/purchasereservedinstancesoffering.html func (client *Client) PurchaseReservedInstancesOffering(request *PurchaseReservedInstancesOfferingRequest) (response *PurchaseReservedInstancesOfferingResponse, err error) { response = CreatePurchaseReservedInstancesOfferingResponse() err = client.DoAction(request, response) return } // PurchaseReservedInstancesOfferingWithChan invokes the ecs.PurchaseReservedInstancesOffering API asynchronously // api document: https://help.aliyun.com/api/ecs/purchasereservedinstancesoffering.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) PurchaseReservedInstancesOfferingWithChan(request *PurchaseReservedInstancesOfferingRequest) (<-chan *PurchaseReservedInstancesOfferingResponse, <-chan error) { responseChan := make(chan *PurchaseReservedInstancesOfferingResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.PurchaseReservedInstancesOffering(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // PurchaseReservedInstancesOfferingWithCallback invokes the ecs.PurchaseReservedInstancesOffering API asynchronously // api document: https://help.aliyun.com/api/ecs/purchasereservedinstancesoffering.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) PurchaseReservedInstancesOfferingWithCallback(request *PurchaseReservedInstancesOfferingRequest, callback func(response *PurchaseReservedInstancesOfferingResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *PurchaseReservedInstancesOfferingResponse var err error defer close(result) response, err = client.PurchaseReservedInstancesOffering(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // PurchaseReservedInstancesOfferingRequest is the request struct for api PurchaseReservedInstancesOffering type PurchaseReservedInstancesOfferingRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ClientToken string `position:"Query" name:"ClientToken"` Description string `position:"Query" name:"Description"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` Scope string `position:"Query" name:"Scope"` InstanceType string `position:"Query" name:"InstanceType"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PeriodUnit string `position:"Query" name:"PeriodUnit"` OfferingType string `position:"Query" name:"OfferingType"` ZoneId string `position:"Query" name:"ZoneId"` ReservedInstanceName string `position:"Query" name:"ReservedInstanceName"` InstanceAmount requests.Integer `position:"Query" name:"InstanceAmount"` } // PurchaseReservedInstancesOfferingResponse is the response struct for api PurchaseReservedInstancesOffering type PurchaseReservedInstancesOfferingResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` ReservedInstanceIdSets ReservedInstanceIdSetsInPurchaseReservedInstancesOffering `json:"ReservedInstanceIdSets" xml:"ReservedInstanceIdSets"` } // CreatePurchaseReservedInstancesOfferingRequest creates a request to invoke PurchaseReservedInstancesOffering API func CreatePurchaseReservedInstancesOfferingRequest() (request *PurchaseReservedInstancesOfferingRequest) { request = &PurchaseReservedInstancesOfferingRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "PurchaseReservedInstancesOffering", "ecs", "openAPI") return } // CreatePurchaseReservedInstancesOfferingResponse creates a response to parse from PurchaseReservedInstancesOffering response func CreatePurchaseReservedInstancesOfferingResponse() (response *PurchaseReservedInstancesOfferingResponse) { response = &PurchaseReservedInstancesOfferingResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_activate_instances.go0000664�0000000�0000000�00000010046�13771713062�0033443�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ReActivateInstances invokes the ecs.ReActivateInstances API synchronously // api document: https://help.aliyun.com/api/ecs/reactivateinstances.html func (client *Client) ReActivateInstances(request *ReActivateInstancesRequest) (response *ReActivateInstancesResponse, err error) { response = CreateReActivateInstancesResponse() err = client.DoAction(request, response) return } // ReActivateInstancesWithChan invokes the ecs.ReActivateInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/reactivateinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReActivateInstancesWithChan(request *ReActivateInstancesRequest) (<-chan *ReActivateInstancesResponse, <-chan error) { responseChan := make(chan *ReActivateInstancesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ReActivateInstances(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ReActivateInstancesWithCallback invokes the ecs.ReActivateInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/reactivateinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReActivateInstancesWithCallback(request *ReActivateInstancesRequest, callback func(response *ReActivateInstancesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ReActivateInstancesResponse var err error defer close(result) response, err = client.ReActivateInstances(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ReActivateInstancesRequest is the request struct for api ReActivateInstances type ReActivateInstancesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ReActivateInstancesResponse is the response struct for api ReActivateInstances type ReActivateInstancesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateReActivateInstancesRequest creates a request to invoke ReActivateInstances API func CreateReActivateInstancesRequest() (request *ReActivateInstancesRequest) { request = &ReActivateInstancesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ReActivateInstances", "ecs", "openAPI") return } // CreateReActivateInstancesResponse creates a response to parse from ReActivateInstances response func CreateReActivateInstancesResponse() (response *ReActivateInstancesResponse) { response = &ReActivateInstancesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/re_init_disk.go���������0000664�0000000�0000000�00000010100�13771713062�0031540�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ReInitDisk invokes the ecs.ReInitDisk API synchronously // api document: https://help.aliyun.com/api/ecs/reinitdisk.html func (client *Client) ReInitDisk(request *ReInitDiskRequest) (response *ReInitDiskResponse, err error) { response = CreateReInitDiskResponse() err = client.DoAction(request, response) return } // ReInitDiskWithChan invokes the ecs.ReInitDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/reinitdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReInitDiskWithChan(request *ReInitDiskRequest) (<-chan *ReInitDiskResponse, <-chan error) { responseChan := make(chan *ReInitDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ReInitDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ReInitDiskWithCallback invokes the ecs.ReInitDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/reinitdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReInitDiskWithCallback(request *ReInitDiskRequest, callback func(response *ReInitDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ReInitDiskResponse var err error defer close(result) response, err = client.ReInitDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ReInitDiskRequest is the request struct for api ReInitDisk type ReInitDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Password string `position:"Query" name:"Password"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` AutoStartInstance requests.Boolean `position:"Query" name:"AutoStartInstance"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DiskId string `position:"Query" name:"DiskId"` SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` KeyPairName string `position:"Query" name:"KeyPairName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ReInitDiskResponse is the response struct for api ReInitDisk type ReInitDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateReInitDiskRequest creates a request to invoke ReInitDisk API func CreateReInitDiskRequest() (request *ReInitDiskRequest) { request = &ReInitDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ReInitDisk", "ecs", "openAPI") return } // CreateReInitDiskResponse creates a response to parse from ReInitDisk response func CreateReInitDiskResponse() (response *ReInitDiskResponse) { response = &ReInitDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reboot_instance.go������0000664�0000000�0000000�00000007761�13771713062�0032276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RebootInstance invokes the ecs.RebootInstance API synchronously // api document: https://help.aliyun.com/api/ecs/rebootinstance.html func (client *Client) RebootInstance(request *RebootInstanceRequest) (response *RebootInstanceResponse, err error) { response = CreateRebootInstanceResponse() err = client.DoAction(request, response) return } // RebootInstanceWithChan invokes the ecs.RebootInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/rebootinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RebootInstanceWithChan(request *RebootInstanceRequest) (<-chan *RebootInstanceResponse, <-chan error) { responseChan := make(chan *RebootInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RebootInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RebootInstanceWithCallback invokes the ecs.RebootInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/rebootinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RebootInstanceWithCallback(request *RebootInstanceRequest, callback func(response *RebootInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RebootInstanceResponse var err error defer close(result) response, err = client.RebootInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RebootInstanceRequest is the request struct for api RebootInstance type RebootInstanceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ForceStop requests.Boolean `position:"Query" name:"ForceStop"` } // RebootInstanceResponse is the response struct for api RebootInstance type RebootInstanceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRebootInstanceRequest creates a request to invoke RebootInstance API func CreateRebootInstanceRequest() (request *RebootInstanceRequest) { request = &RebootInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RebootInstance", "ecs", "openAPI") return } // CreateRebootInstanceResponse creates a response to parse from RebootInstance response func CreateRebootInstanceResponse() (response *RebootInstanceResponse) { response = &RebootInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������recover_virtual_border_router.go��������������������������������������������������������������������0000664�0000000�0000000�00000010720�13771713062�0035176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RecoverVirtualBorderRouter invokes the ecs.RecoverVirtualBorderRouter API synchronously // api document: https://help.aliyun.com/api/ecs/recovervirtualborderrouter.html func (client *Client) RecoverVirtualBorderRouter(request *RecoverVirtualBorderRouterRequest) (response *RecoverVirtualBorderRouterResponse, err error) { response = CreateRecoverVirtualBorderRouterResponse() err = client.DoAction(request, response) return } // RecoverVirtualBorderRouterWithChan invokes the ecs.RecoverVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/recovervirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RecoverVirtualBorderRouterWithChan(request *RecoverVirtualBorderRouterRequest) (<-chan *RecoverVirtualBorderRouterResponse, <-chan error) { responseChan := make(chan *RecoverVirtualBorderRouterResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RecoverVirtualBorderRouter(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RecoverVirtualBorderRouterWithCallback invokes the ecs.RecoverVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/recovervirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RecoverVirtualBorderRouterWithCallback(request *RecoverVirtualBorderRouterRequest, callback func(response *RecoverVirtualBorderRouterResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RecoverVirtualBorderRouterResponse var err error defer close(result) response, err = client.RecoverVirtualBorderRouter(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RecoverVirtualBorderRouterRequest is the request struct for api RecoverVirtualBorderRouter type RecoverVirtualBorderRouterRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` VbrId string `position:"Query" name:"VbrId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // RecoverVirtualBorderRouterResponse is the response struct for api RecoverVirtualBorderRouter type RecoverVirtualBorderRouterResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRecoverVirtualBorderRouterRequest creates a request to invoke RecoverVirtualBorderRouter API func CreateRecoverVirtualBorderRouterRequest() (request *RecoverVirtualBorderRouterRequest) { request = &RecoverVirtualBorderRouterRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RecoverVirtualBorderRouter", "ecs", "openAPI") return } // CreateRecoverVirtualBorderRouterResponse creates a response to parse from RecoverVirtualBorderRouter response func CreateRecoverVirtualBorderRouterResponse() (response *RecoverVirtualBorderRouterResponse) { response = &RecoverVirtualBorderRouterResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/redeploy_instance.go����0000664�0000000�0000000�00000010050�13771713062�0032610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RedeployInstance invokes the ecs.RedeployInstance API synchronously // api document: https://help.aliyun.com/api/ecs/redeployinstance.html func (client *Client) RedeployInstance(request *RedeployInstanceRequest) (response *RedeployInstanceResponse, err error) { response = CreateRedeployInstanceResponse() err = client.DoAction(request, response) return } // RedeployInstanceWithChan invokes the ecs.RedeployInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/redeployinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RedeployInstanceWithChan(request *RedeployInstanceRequest) (<-chan *RedeployInstanceResponse, <-chan error) { responseChan := make(chan *RedeployInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RedeployInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RedeployInstanceWithCallback invokes the ecs.RedeployInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/redeployinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RedeployInstanceWithCallback(request *RedeployInstanceRequest, callback func(response *RedeployInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RedeployInstanceResponse var err error defer close(result) response, err = client.RedeployInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RedeployInstanceRequest is the request struct for api RedeployInstance type RedeployInstanceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ForceStop requests.Boolean `position:"Query" name:"ForceStop"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId string `position:"Query" name:"InstanceId"` } // RedeployInstanceResponse is the response struct for api RedeployInstance type RedeployInstanceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` TaskId string `json:"TaskId" xml:"TaskId"` } // CreateRedeployInstanceRequest creates a request to invoke RedeployInstance API func CreateRedeployInstanceRequest() (request *RedeployInstanceRequest) { request = &RedeployInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RedeployInstance", "ecs", "openAPI") return } // CreateRedeployInstanceResponse creates a response to parse from RedeployInstance response func CreateRedeployInstanceResponse() (response *RedeployInstanceResponse) { response = &RedeployInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������release_dedicated_host.go���������������������������������������������������������������������������0000664�0000000�0000000�00000010123�13771713062�0033466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ReleaseDedicatedHost invokes the ecs.ReleaseDedicatedHost API synchronously // api document: https://help.aliyun.com/api/ecs/releasededicatedhost.html func (client *Client) ReleaseDedicatedHost(request *ReleaseDedicatedHostRequest) (response *ReleaseDedicatedHostResponse, err error) { response = CreateReleaseDedicatedHostResponse() err = client.DoAction(request, response) return } // ReleaseDedicatedHostWithChan invokes the ecs.ReleaseDedicatedHost API asynchronously // api document: https://help.aliyun.com/api/ecs/releasededicatedhost.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReleaseDedicatedHostWithChan(request *ReleaseDedicatedHostRequest) (<-chan *ReleaseDedicatedHostResponse, <-chan error) { responseChan := make(chan *ReleaseDedicatedHostResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ReleaseDedicatedHost(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ReleaseDedicatedHostWithCallback invokes the ecs.ReleaseDedicatedHost API asynchronously // api document: https://help.aliyun.com/api/ecs/releasededicatedhost.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReleaseDedicatedHostWithCallback(request *ReleaseDedicatedHostRequest, callback func(response *ReleaseDedicatedHostResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ReleaseDedicatedHostResponse var err error defer close(result) response, err = client.ReleaseDedicatedHost(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ReleaseDedicatedHostRequest is the request struct for api ReleaseDedicatedHost type ReleaseDedicatedHostRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DedicatedHostId string `position:"Query" name:"DedicatedHostId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ReleaseDedicatedHostResponse is the response struct for api ReleaseDedicatedHost type ReleaseDedicatedHostResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateReleaseDedicatedHostRequest creates a request to invoke ReleaseDedicatedHost API func CreateReleaseDedicatedHostRequest() (request *ReleaseDedicatedHostRequest) { request = &ReleaseDedicatedHostRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ReleaseDedicatedHost", "ecs", "openAPI") return } // CreateReleaseDedicatedHostResponse creates a response to parse from ReleaseDedicatedHost response func CreateReleaseDedicatedHostResponse() (response *ReleaseDedicatedHostResponse) { response = &ReleaseDedicatedHostResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/release_eip_address.go��0000664�0000000�0000000�00000007730�13771713062�0033076�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ReleaseEipAddress invokes the ecs.ReleaseEipAddress API synchronously // api document: https://help.aliyun.com/api/ecs/releaseeipaddress.html func (client *Client) ReleaseEipAddress(request *ReleaseEipAddressRequest) (response *ReleaseEipAddressResponse, err error) { response = CreateReleaseEipAddressResponse() err = client.DoAction(request, response) return } // ReleaseEipAddressWithChan invokes the ecs.ReleaseEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/releaseeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReleaseEipAddressWithChan(request *ReleaseEipAddressRequest) (<-chan *ReleaseEipAddressResponse, <-chan error) { responseChan := make(chan *ReleaseEipAddressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ReleaseEipAddress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ReleaseEipAddressWithCallback invokes the ecs.ReleaseEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/releaseeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReleaseEipAddressWithCallback(request *ReleaseEipAddressRequest, callback func(response *ReleaseEipAddressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ReleaseEipAddressResponse var err error defer close(result) response, err = client.ReleaseEipAddress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ReleaseEipAddressRequest is the request struct for api ReleaseEipAddress type ReleaseEipAddressRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` AllocationId string `position:"Query" name:"AllocationId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ReleaseEipAddressResponse is the response struct for api ReleaseEipAddress type ReleaseEipAddressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateReleaseEipAddressRequest creates a request to invoke ReleaseEipAddress API func CreateReleaseEipAddressRequest() (request *ReleaseEipAddressRequest) { request = &ReleaseEipAddressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ReleaseEipAddress", "ecs", "openAPI") return } // CreateReleaseEipAddressResponse creates a response to parse from ReleaseEipAddress response func CreateReleaseEipAddressResponse() (response *ReleaseEipAddressResponse) { response = &ReleaseEipAddressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������release_public_ip_address.go������������������������������������������������������������������������0000664�0000000�0000000�00000010357�13771713062�0034207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ReleasePublicIpAddress invokes the ecs.ReleasePublicIpAddress API synchronously // api document: https://help.aliyun.com/api/ecs/releasepublicipaddress.html func (client *Client) ReleasePublicIpAddress(request *ReleasePublicIpAddressRequest) (response *ReleasePublicIpAddressResponse, err error) { response = CreateReleasePublicIpAddressResponse() err = client.DoAction(request, response) return } // ReleasePublicIpAddressWithChan invokes the ecs.ReleasePublicIpAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/releasepublicipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReleasePublicIpAddressWithChan(request *ReleasePublicIpAddressRequest) (<-chan *ReleasePublicIpAddressResponse, <-chan error) { responseChan := make(chan *ReleasePublicIpAddressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ReleasePublicIpAddress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ReleasePublicIpAddressWithCallback invokes the ecs.ReleasePublicIpAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/releasepublicipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReleasePublicIpAddressWithCallback(request *ReleasePublicIpAddressRequest, callback func(response *ReleasePublicIpAddressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ReleasePublicIpAddressResponse var err error defer close(result) response, err = client.ReleasePublicIpAddress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ReleasePublicIpAddressRequest is the request struct for api ReleasePublicIpAddress type ReleasePublicIpAddressRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` PublicIpAddress string `position:"Query" name:"PublicIpAddress"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ReleasePublicIpAddressResponse is the response struct for api ReleasePublicIpAddress type ReleasePublicIpAddressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateReleasePublicIpAddressRequest creates a request to invoke ReleasePublicIpAddress API func CreateReleasePublicIpAddressRequest() (request *ReleasePublicIpAddressRequest) { request = &ReleasePublicIpAddressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ReleasePublicIpAddress", "ecs", "openAPI") return } // CreateReleasePublicIpAddressResponse creates a response to parse from ReleasePublicIpAddress response func CreateReleasePublicIpAddressResponse() (response *ReleasePublicIpAddressResponse) { response = &ReleasePublicIpAddressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������remove_bandwidth_package_ips.go���������������������������������������������������������������������0000664�0000000�0000000�00000010720�13771713062�0034675�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RemoveBandwidthPackageIps invokes the ecs.RemoveBandwidthPackageIps API synchronously // api document: https://help.aliyun.com/api/ecs/removebandwidthpackageips.html func (client *Client) RemoveBandwidthPackageIps(request *RemoveBandwidthPackageIpsRequest) (response *RemoveBandwidthPackageIpsResponse, err error) { response = CreateRemoveBandwidthPackageIpsResponse() err = client.DoAction(request, response) return } // RemoveBandwidthPackageIpsWithChan invokes the ecs.RemoveBandwidthPackageIps API asynchronously // api document: https://help.aliyun.com/api/ecs/removebandwidthpackageips.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RemoveBandwidthPackageIpsWithChan(request *RemoveBandwidthPackageIpsRequest) (<-chan *RemoveBandwidthPackageIpsResponse, <-chan error) { responseChan := make(chan *RemoveBandwidthPackageIpsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RemoveBandwidthPackageIps(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RemoveBandwidthPackageIpsWithCallback invokes the ecs.RemoveBandwidthPackageIps API asynchronously // api document: https://help.aliyun.com/api/ecs/removebandwidthpackageips.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RemoveBandwidthPackageIpsWithCallback(request *RemoveBandwidthPackageIpsRequest, callback func(response *RemoveBandwidthPackageIpsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RemoveBandwidthPackageIpsResponse var err error defer close(result) response, err = client.RemoveBandwidthPackageIps(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RemoveBandwidthPackageIpsRequest is the request struct for api RemoveBandwidthPackageIps type RemoveBandwidthPackageIpsRequest struct { *requests.RpcRequest RemovedIpAddresses *[]string `position:"Query" name:"RemovedIpAddresses" type:"Repeated"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` BandwidthPackageId string `position:"Query" name:"BandwidthPackageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // RemoveBandwidthPackageIpsResponse is the response struct for api RemoveBandwidthPackageIps type RemoveBandwidthPackageIpsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRemoveBandwidthPackageIpsRequest creates a request to invoke RemoveBandwidthPackageIps API func CreateRemoveBandwidthPackageIpsRequest() (request *RemoveBandwidthPackageIpsRequest) { request = &RemoveBandwidthPackageIpsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RemoveBandwidthPackageIps", "ecs", "openAPI") return } // CreateRemoveBandwidthPackageIpsResponse creates a response to parse from RemoveBandwidthPackageIps response func CreateRemoveBandwidthPackageIpsResponse() (response *RemoveBandwidthPackageIpsResponse) { response = &RemoveBandwidthPackageIpsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/remove_tags.go����������0000664�0000000�0000000�00000007654�13771713062�0031434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RemoveTags invokes the ecs.RemoveTags API synchronously // api document: https://help.aliyun.com/api/ecs/removetags.html func (client *Client) RemoveTags(request *RemoveTagsRequest) (response *RemoveTagsResponse, err error) { response = CreateRemoveTagsResponse() err = client.DoAction(request, response) return } // RemoveTagsWithChan invokes the ecs.RemoveTags API asynchronously // api document: https://help.aliyun.com/api/ecs/removetags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RemoveTagsWithChan(request *RemoveTagsRequest) (<-chan *RemoveTagsResponse, <-chan error) { responseChan := make(chan *RemoveTagsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RemoveTags(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RemoveTagsWithCallback invokes the ecs.RemoveTags API asynchronously // api document: https://help.aliyun.com/api/ecs/removetags.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RemoveTagsWithCallback(request *RemoveTagsRequest, callback func(response *RemoveTagsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RemoveTagsResponse var err error defer close(result) response, err = client.RemoveTags(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RemoveTagsRequest is the request struct for api RemoveTags type RemoveTagsRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceId string `position:"Query" name:"ResourceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` Tag *[]RemoveTagsTag `position:"Query" name:"Tag" type:"Repeated"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` } // RemoveTagsTag is a repeated param struct in RemoveTagsRequest type RemoveTagsTag struct { Value string `name:"Value"` Key string `name:"Key"` } // RemoveTagsResponse is the response struct for api RemoveTags type RemoveTagsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRemoveTagsRequest creates a request to invoke RemoveTags API func CreateRemoveTagsRequest() (request *RemoveTagsRequest) { request = &RemoveTagsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RemoveTags", "ecs", "openAPI") return } // CreateRemoveTagsResponse creates a response to parse from RemoveTags response func CreateRemoveTagsResponse() (response *RemoveTagsResponse) { response = &RemoveTagsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_dedicated_hosts.go0000664�0000000�0000000�00000010415�13771713062�0033434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RenewDedicatedHosts invokes the ecs.RenewDedicatedHosts API synchronously // api document: https://help.aliyun.com/api/ecs/renewdedicatedhosts.html func (client *Client) RenewDedicatedHosts(request *RenewDedicatedHostsRequest) (response *RenewDedicatedHostsResponse, err error) { response = CreateRenewDedicatedHostsResponse() err = client.DoAction(request, response) return } // RenewDedicatedHostsWithChan invokes the ecs.RenewDedicatedHosts API asynchronously // api document: https://help.aliyun.com/api/ecs/renewdedicatedhosts.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RenewDedicatedHostsWithChan(request *RenewDedicatedHostsRequest) (<-chan *RenewDedicatedHostsResponse, <-chan error) { responseChan := make(chan *RenewDedicatedHostsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RenewDedicatedHosts(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RenewDedicatedHostsWithCallback invokes the ecs.RenewDedicatedHosts API asynchronously // api document: https://help.aliyun.com/api/ecs/renewdedicatedhosts.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RenewDedicatedHostsWithCallback(request *RenewDedicatedHostsRequest, callback func(response *RenewDedicatedHostsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RenewDedicatedHostsResponse var err error defer close(result) response, err = client.RenewDedicatedHosts(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RenewDedicatedHostsRequest is the request struct for api RenewDedicatedHosts type RenewDedicatedHostsRequest struct { *requests.RpcRequest DedicatedHostIds string `position:"Query" name:"DedicatedHostIds"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ClientToken string `position:"Query" name:"ClientToken"` Period requests.Integer `position:"Query" name:"Period"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PeriodUnit string `position:"Query" name:"PeriodUnit"` } // RenewDedicatedHostsResponse is the response struct for api RenewDedicatedHosts type RenewDedicatedHostsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRenewDedicatedHostsRequest creates a request to invoke RenewDedicatedHosts API func CreateRenewDedicatedHostsRequest() (request *RenewDedicatedHostsRequest) { request = &RenewDedicatedHostsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RenewDedicatedHosts", "ecs", "openAPI") return } // CreateRenewDedicatedHostsResponse creates a response to parse from RenewDedicatedHosts response func CreateRenewDedicatedHostsResponse() (response *RenewDedicatedHostsResponse) { response = &RenewDedicatedHostsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/renew_instance.go�������0000664�0000000�0000000�00000010027�13771713062�0032111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RenewInstance invokes the ecs.RenewInstance API synchronously // api document: https://help.aliyun.com/api/ecs/renewinstance.html func (client *Client) RenewInstance(request *RenewInstanceRequest) (response *RenewInstanceResponse, err error) { response = CreateRenewInstanceResponse() err = client.DoAction(request, response) return } // RenewInstanceWithChan invokes the ecs.RenewInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/renewinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RenewInstanceWithChan(request *RenewInstanceRequest) (<-chan *RenewInstanceResponse, <-chan error) { responseChan := make(chan *RenewInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RenewInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RenewInstanceWithCallback invokes the ecs.RenewInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/renewinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RenewInstanceWithCallback(request *RenewInstanceRequest, callback func(response *RenewInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RenewInstanceResponse var err error defer close(result) response, err = client.RenewInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RenewInstanceRequest is the request struct for api RenewInstance type RenewInstanceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Period requests.Integer `position:"Query" name:"Period"` PeriodUnit string `position:"Query" name:"PeriodUnit"` InstanceId string `position:"Query" name:"InstanceId"` ClientToken string `position:"Query" name:"ClientToken"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // RenewInstanceResponse is the response struct for api RenewInstance type RenewInstanceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRenewInstanceRequest creates a request to invoke RenewInstance API func CreateRenewInstanceRequest() (request *RenewInstanceRequest) { request = &RenewInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RenewInstance", "ecs", "openAPI") return } // CreateRenewInstanceResponse creates a response to parse from RenewInstance response func CreateRenewInstanceResponse() (response *RenewInstanceResponse) { response = &RenewInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/replace_system_disk.go��0000664�0000000�0000000�00000011727�13771713062�0033146�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ReplaceSystemDisk invokes the ecs.ReplaceSystemDisk API synchronously // api document: https://help.aliyun.com/api/ecs/replacesystemdisk.html func (client *Client) ReplaceSystemDisk(request *ReplaceSystemDiskRequest) (response *ReplaceSystemDiskResponse, err error) { response = CreateReplaceSystemDiskResponse() err = client.DoAction(request, response) return } // ReplaceSystemDiskWithChan invokes the ecs.ReplaceSystemDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/replacesystemdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReplaceSystemDiskWithChan(request *ReplaceSystemDiskRequest) (<-chan *ReplaceSystemDiskResponse, <-chan error) { responseChan := make(chan *ReplaceSystemDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ReplaceSystemDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ReplaceSystemDiskWithCallback invokes the ecs.ReplaceSystemDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/replacesystemdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ReplaceSystemDiskWithCallback(request *ReplaceSystemDiskRequest, callback func(response *ReplaceSystemDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ReplaceSystemDiskResponse var err error defer close(result) response, err = client.ReplaceSystemDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ReplaceSystemDiskRequest is the request struct for api ReplaceSystemDisk type ReplaceSystemDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ImageId string `position:"Query" name:"ImageId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` KeyPairName string `position:"Query" name:"KeyPairName"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Platform string `position:"Query" name:"Platform"` Password string `position:"Query" name:"Password"` InstanceId string `position:"Query" name:"InstanceId"` PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` SystemDiskSize requests.Integer `position:"Query" name:"SystemDisk.Size"` DiskId string `position:"Query" name:"DiskId"` UseAdditionalService requests.Boolean `position:"Query" name:"UseAdditionalService"` Architecture string `position:"Query" name:"Architecture"` } // ReplaceSystemDiskResponse is the response struct for api ReplaceSystemDisk type ReplaceSystemDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` DiskId string `json:"DiskId" xml:"DiskId"` } // CreateReplaceSystemDiskRequest creates a request to invoke ReplaceSystemDisk API func CreateReplaceSystemDiskRequest() (request *ReplaceSystemDiskRequest) { request = &ReplaceSystemDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ReplaceSystemDisk", "ecs", "openAPI") return } // CreateReplaceSystemDiskResponse creates a response to parse from ReplaceSystemDisk response func CreateReplaceSystemDiskResponse() (response *ReplaceSystemDiskResponse) { response = &ReplaceSystemDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/reset_disk.go�����������0000664�0000000�0000000�00000007336�13771713062�0031252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ResetDisk invokes the ecs.ResetDisk API synchronously // api document: https://help.aliyun.com/api/ecs/resetdisk.html func (client *Client) ResetDisk(request *ResetDiskRequest) (response *ResetDiskResponse, err error) { response = CreateResetDiskResponse() err = client.DoAction(request, response) return } // ResetDiskWithChan invokes the ecs.ResetDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/resetdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ResetDiskWithChan(request *ResetDiskRequest) (<-chan *ResetDiskResponse, <-chan error) { responseChan := make(chan *ResetDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ResetDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ResetDiskWithCallback invokes the ecs.ResetDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/resetdisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ResetDiskWithCallback(request *ResetDiskRequest, callback func(response *ResetDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ResetDiskResponse var err error defer close(result) response, err = client.ResetDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ResetDiskRequest is the request struct for api ResetDisk type ResetDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SnapshotId string `position:"Query" name:"SnapshotId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` DiskId string `position:"Query" name:"DiskId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // ResetDiskResponse is the response struct for api ResetDisk type ResetDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateResetDiskRequest creates a request to invoke ResetDisk API func CreateResetDiskRequest() (request *ResetDiskRequest) { request = &ResetDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ResetDisk", "ecs", "openAPI") return } // CreateResetDiskResponse creates a response to parse from ResetDisk response func CreateResetDiskResponse() (response *ResetDiskResponse) { response = &ResetDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/resize_disk.go����������0000664�0000000�0000000�00000007626�13771713062�0031433�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ResizeDisk invokes the ecs.ResizeDisk API synchronously // api document: https://help.aliyun.com/api/ecs/resizedisk.html func (client *Client) ResizeDisk(request *ResizeDiskRequest) (response *ResizeDiskResponse, err error) { response = CreateResizeDiskResponse() err = client.DoAction(request, response) return } // ResizeDiskWithChan invokes the ecs.ResizeDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/resizedisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ResizeDiskWithChan(request *ResizeDiskRequest) (<-chan *ResizeDiskResponse, <-chan error) { responseChan := make(chan *ResizeDiskResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ResizeDisk(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ResizeDiskWithCallback invokes the ecs.ResizeDisk API asynchronously // api document: https://help.aliyun.com/api/ecs/resizedisk.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ResizeDiskWithCallback(request *ResizeDiskRequest, callback func(response *ResizeDiskResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ResizeDiskResponse var err error defer close(result) response, err = client.ResizeDisk(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ResizeDiskRequest is the request struct for api ResizeDisk type ResizeDiskRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` NewSize requests.Integer `position:"Query" name:"NewSize"` DiskId string `position:"Query" name:"DiskId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Type string `position:"Query" name:"Type"` } // ResizeDiskResponse is the response struct for api ResizeDisk type ResizeDiskResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateResizeDiskRequest creates a request to invoke ResizeDisk API func CreateResizeDiskRequest() (request *ResizeDiskRequest) { request = &ResizeDiskRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "ResizeDisk", "ecs", "openAPI") return } // CreateResizeDiskResponse creates a response to parse from ResizeDisk response func CreateResizeDiskResponse() (response *ResizeDiskResponse) { response = &ResizeDiskResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/revoke_security_group.go0000664�0000000�0000000�00000012374�13771713062�0033552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RevokeSecurityGroup invokes the ecs.RevokeSecurityGroup API synchronously // api document: https://help.aliyun.com/api/ecs/revokesecuritygroup.html func (client *Client) RevokeSecurityGroup(request *RevokeSecurityGroupRequest) (response *RevokeSecurityGroupResponse, err error) { response = CreateRevokeSecurityGroupResponse() err = client.DoAction(request, response) return } // RevokeSecurityGroupWithChan invokes the ecs.RevokeSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/revokesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RevokeSecurityGroupWithChan(request *RevokeSecurityGroupRequest) (<-chan *RevokeSecurityGroupResponse, <-chan error) { responseChan := make(chan *RevokeSecurityGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RevokeSecurityGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RevokeSecurityGroupWithCallback invokes the ecs.RevokeSecurityGroup API asynchronously // api document: https://help.aliyun.com/api/ecs/revokesecuritygroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RevokeSecurityGroupWithCallback(request *RevokeSecurityGroupRequest, callback func(response *RevokeSecurityGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RevokeSecurityGroupResponse var err error defer close(result) response, err = client.RevokeSecurityGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RevokeSecurityGroupRequest is the request struct for api RevokeSecurityGroup type RevokeSecurityGroupRequest struct { *requests.RpcRequest NicType string `position:"Query" name:"NicType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SourcePortRange string `position:"Query" name:"SourcePortRange"` ClientToken string `position:"Query" name:"ClientToken"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` SourceGroupOwnerId requests.Integer `position:"Query" name:"SourceGroupOwnerId"` SourceGroupOwnerAccount string `position:"Query" name:"SourceGroupOwnerAccount"` Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` Policy string `position:"Query" name:"Policy"` PortRange string `position:"Query" name:"PortRange"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SourceCidrIp string `position:"Query" name:"SourceCidrIp"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Priority string `position:"Query" name:"Priority"` DestCidrIp string `position:"Query" name:"DestCidrIp"` SourceGroupId string `position:"Query" name:"SourceGroupId"` } // RevokeSecurityGroupResponse is the response struct for api RevokeSecurityGroup type RevokeSecurityGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRevokeSecurityGroupRequest creates a request to invoke RevokeSecurityGroup API func CreateRevokeSecurityGroupRequest() (request *RevokeSecurityGroupRequest) { request = &RevokeSecurityGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RevokeSecurityGroup", "ecs", "openAPI") return } // CreateRevokeSecurityGroupResponse creates a response to parse from RevokeSecurityGroup response func CreateRevokeSecurityGroupResponse() (response *RevokeSecurityGroupResponse) { response = &RevokeSecurityGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������revoke_security_group_egress.go���������������������������������������������������������������������0000664�0000000�0000000�00000012676�13771713062�0035050�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RevokeSecurityGroupEgress invokes the ecs.RevokeSecurityGroupEgress API synchronously // api document: https://help.aliyun.com/api/ecs/revokesecuritygroupegress.html func (client *Client) RevokeSecurityGroupEgress(request *RevokeSecurityGroupEgressRequest) (response *RevokeSecurityGroupEgressResponse, err error) { response = CreateRevokeSecurityGroupEgressResponse() err = client.DoAction(request, response) return } // RevokeSecurityGroupEgressWithChan invokes the ecs.RevokeSecurityGroupEgress API asynchronously // api document: https://help.aliyun.com/api/ecs/revokesecuritygroupegress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RevokeSecurityGroupEgressWithChan(request *RevokeSecurityGroupEgressRequest) (<-chan *RevokeSecurityGroupEgressResponse, <-chan error) { responseChan := make(chan *RevokeSecurityGroupEgressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RevokeSecurityGroupEgress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RevokeSecurityGroupEgressWithCallback invokes the ecs.RevokeSecurityGroupEgress API asynchronously // api document: https://help.aliyun.com/api/ecs/revokesecuritygroupegress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RevokeSecurityGroupEgressWithCallback(request *RevokeSecurityGroupEgressRequest, callback func(response *RevokeSecurityGroupEgressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RevokeSecurityGroupEgressResponse var err error defer close(result) response, err = client.RevokeSecurityGroupEgress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RevokeSecurityGroupEgressRequest is the request struct for api RevokeSecurityGroupEgress type RevokeSecurityGroupEgressRequest struct { *requests.RpcRequest NicType string `position:"Query" name:"NicType"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` SourcePortRange string `position:"Query" name:"SourcePortRange"` ClientToken string `position:"Query" name:"ClientToken"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` Description string `position:"Query" name:"Description"` Ipv6DestCidrIp string `position:"Query" name:"Ipv6DestCidrIp"` Ipv6SourceCidrIp string `position:"Query" name:"Ipv6SourceCidrIp"` Policy string `position:"Query" name:"Policy"` PortRange string `position:"Query" name:"PortRange"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` IpProtocol string `position:"Query" name:"IpProtocol"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SourceCidrIp string `position:"Query" name:"SourceCidrIp"` DestGroupId string `position:"Query" name:"DestGroupId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` DestGroupOwnerAccount string `position:"Query" name:"DestGroupOwnerAccount"` Priority string `position:"Query" name:"Priority"` DestCidrIp string `position:"Query" name:"DestCidrIp"` DestGroupOwnerId requests.Integer `position:"Query" name:"DestGroupOwnerId"` } // RevokeSecurityGroupEgressResponse is the response struct for api RevokeSecurityGroupEgress type RevokeSecurityGroupEgressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRevokeSecurityGroupEgressRequest creates a request to invoke RevokeSecurityGroupEgress API func CreateRevokeSecurityGroupEgressRequest() (request *RevokeSecurityGroupEgressRequest) { request = &RevokeSecurityGroupEgressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RevokeSecurityGroupEgress", "ecs", "openAPI") return } // CreateRevokeSecurityGroupEgressResponse creates a response to parse from RevokeSecurityGroupEgress response func CreateRevokeSecurityGroupEgressResponse() (response *RevokeSecurityGroupEgressResponse) { response = &RevokeSecurityGroupEgressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/run_instances.go��������0000664�0000000�0000000�00000024760�13771713062�0031771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RunInstances invokes the ecs.RunInstances API synchronously // api document: https://help.aliyun.com/api/ecs/runinstances.html func (client *Client) RunInstances(request *RunInstancesRequest) (response *RunInstancesResponse, err error) { response = CreateRunInstancesResponse() err = client.DoAction(request, response) return } // RunInstancesWithChan invokes the ecs.RunInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/runinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RunInstancesWithChan(request *RunInstancesRequest) (<-chan *RunInstancesResponse, <-chan error) { responseChan := make(chan *RunInstancesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RunInstances(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RunInstancesWithCallback invokes the ecs.RunInstances API asynchronously // api document: https://help.aliyun.com/api/ecs/runinstances.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RunInstancesWithCallback(request *RunInstancesRequest, callback func(response *RunInstancesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RunInstancesResponse var err error defer close(result) response, err = client.RunInstances(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RunInstancesRequest is the request struct for api RunInstances type RunInstancesRequest struct { *requests.RpcRequest LaunchTemplateName string `position:"Query" name:"LaunchTemplateName"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` UniqueSuffix requests.Boolean `position:"Query" name:"UniqueSuffix"` HpcClusterId string `position:"Query" name:"HpcClusterId"` SecurityEnhancementStrategy string `position:"Query" name:"SecurityEnhancementStrategy"` KeyPairName string `position:"Query" name:"KeyPairName"` MinAmount requests.Integer `position:"Query" name:"MinAmount"` SpotPriceLimit requests.Float `position:"Query" name:"SpotPriceLimit"` DeletionProtection requests.Boolean `position:"Query" name:"DeletionProtection"` ResourceGroupId string `position:"Query" name:"ResourceGroupId"` HostName string `position:"Query" name:"HostName"` Password string `position:"Query" name:"Password"` Tag *[]RunInstancesTag `position:"Query" name:"Tag" type:"Repeated"` AutoRenewPeriod requests.Integer `position:"Query" name:"AutoRenewPeriod"` Period requests.Integer `position:"Query" name:"Period"` DryRun requests.Boolean `position:"Query" name:"DryRun"` LaunchTemplateId string `position:"Query" name:"LaunchTemplateId"` Ipv6AddressCount requests.Integer `position:"Query" name:"Ipv6AddressCount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` CapacityReservationPreference string `position:"Query" name:"CapacityReservationPreference"` VSwitchId string `position:"Query" name:"VSwitchId"` SpotStrategy string `position:"Query" name:"SpotStrategy"` PrivateIpAddress string `position:"Query" name:"PrivateIpAddress"` PeriodUnit string `position:"Query" name:"PeriodUnit"` InstanceName string `position:"Query" name:"InstanceName"` AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"` InternetChargeType string `position:"Query" name:"InternetChargeType"` ZoneId string `position:"Query" name:"ZoneId"` Ipv6Address *[]string `position:"Query" name:"Ipv6Address" type:"Repeated"` InternetMaxBandwidthIn requests.Integer `position:"Query" name:"InternetMaxBandwidthIn"` ImageId string `position:"Query" name:"ImageId"` SpotInterruptionBehavior string `position:"Query" name:"SpotInterruptionBehavior"` ClientToken string `position:"Query" name:"ClientToken"` IoOptimized string `position:"Query" name:"IoOptimized"` SecurityGroupId string `position:"Query" name:"SecurityGroupId"` InternetMaxBandwidthOut requests.Integer `position:"Query" name:"InternetMaxBandwidthOut"` Description string `position:"Query" name:"Description"` SystemDiskCategory string `position:"Query" name:"SystemDisk.Category"` CapacityReservationId string `position:"Query" name:"CapacityReservationId"` UserData string `position:"Query" name:"UserData"` PasswordInherit requests.Boolean `position:"Query" name:"PasswordInherit"` InstanceType string `position:"Query" name:"InstanceType"` HibernationConfigured requests.Boolean `position:"Query" name:"HibernationConfigured"` InstanceChargeType string `position:"Query" name:"InstanceChargeType"` NetworkInterface *[]RunInstancesNetworkInterface `position:"Query" name:"NetworkInterface" type:"Repeated"` DeploymentSetId string `position:"Query" name:"DeploymentSetId"` Amount requests.Integer `position:"Query" name:"Amount"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` SystemDiskDiskName string `position:"Query" name:"SystemDisk.DiskName"` RamRoleName string `position:"Query" name:"RamRoleName"` AutoReleaseTime string `position:"Query" name:"AutoReleaseTime"` DedicatedHostId string `position:"Query" name:"DedicatedHostId"` CreditSpecification string `position:"Query" name:"CreditSpecification"` DataDisk *[]RunInstancesDataDisk `position:"Query" name:"DataDisk" type:"Repeated"` LaunchTemplateVersion requests.Integer `position:"Query" name:"LaunchTemplateVersion"` SystemDiskSize string `position:"Query" name:"SystemDisk.Size"` SystemDiskDescription string `position:"Query" name:"SystemDisk.Description"` } // RunInstancesTag is a repeated param struct in RunInstancesRequest type RunInstancesTag struct { Key string `name:"Key"` Value string `name:"Value"` } // RunInstancesNetworkInterface is a repeated param struct in RunInstancesRequest type RunInstancesNetworkInterface struct { PrimaryIpAddress string `name:"PrimaryIpAddress"` VSwitchId string `name:"VSwitchId"` SecurityGroupId string `name:"SecurityGroupId"` NetworkInterfaceName string `name:"NetworkInterfaceName"` Description string `name:"Description"` } // RunInstancesDataDisk is a repeated param struct in RunInstancesRequest type RunInstancesDataDisk struct { Size string `name:"Size"` SnapshotId string `name:"SnapshotId"` Category string `name:"Category"` Encrypted string `name:"Encrypted"` KMSKeyId string `name:"KMSKeyId"` DiskName string `name:"DiskName"` Description string `name:"Description"` Device string `name:"Device"` DeleteWithInstance string `name:"DeleteWithInstance"` } // RunInstancesResponse is the response struct for api RunInstances type RunInstancesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` InstanceIdSets InstanceIdSets `json:"InstanceIdSets" xml:"InstanceIdSets"` } // CreateRunInstancesRequest creates a request to invoke RunInstances API func CreateRunInstancesRequest() (request *RunInstancesRequest) { request = &RunInstancesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "RunInstances", "ecs", "openAPI") return } // CreateRunInstancesResponse creates a response to parse from RunInstances response func CreateRunInstancesResponse() (response *RunInstancesResponse) { response = &RunInstancesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/start_instance.go�������0000664�0000000�0000000�00000010035�13771713062�0032125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // StartInstance invokes the ecs.StartInstance API synchronously // api document: https://help.aliyun.com/api/ecs/startinstance.html func (client *Client) StartInstance(request *StartInstanceRequest) (response *StartInstanceResponse, err error) { response = CreateStartInstanceResponse() err = client.DoAction(request, response) return } // StartInstanceWithChan invokes the ecs.StartInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/startinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) StartInstanceWithChan(request *StartInstanceRequest) (<-chan *StartInstanceResponse, <-chan error) { responseChan := make(chan *StartInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.StartInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // StartInstanceWithCallback invokes the ecs.StartInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/startinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) StartInstanceWithCallback(request *StartInstanceRequest, callback func(response *StartInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *StartInstanceResponse var err error defer close(result) response, err = client.StartInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // StartInstanceRequest is the request struct for api StartInstance type StartInstanceRequest struct { *requests.RpcRequest SourceRegionId string `position:"Query" name:"SourceRegionId"` InitLocalDisk requests.Boolean `position:"Query" name:"InitLocalDisk"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // StartInstanceResponse is the response struct for api StartInstance type StartInstanceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateStartInstanceRequest creates a request to invoke StartInstance API func CreateStartInstanceRequest() (request *StartInstanceRequest) { request = &StartInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "StartInstance", "ecs", "openAPI") return } // CreateStartInstanceResponse creates a response to parse from StartInstance response func CreateStartInstanceResponse() (response *StartInstanceResponse) { response = &StartInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_instance.go��������0000664�0000000�0000000�00000010206�13771713062�0031755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // StopInstance invokes the ecs.StopInstance API synchronously // api document: https://help.aliyun.com/api/ecs/stopinstance.html func (client *Client) StopInstance(request *StopInstanceRequest) (response *StopInstanceResponse, err error) { response = CreateStopInstanceResponse() err = client.DoAction(request, response) return } // StopInstanceWithChan invokes the ecs.StopInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/stopinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) StopInstanceWithChan(request *StopInstanceRequest) (<-chan *StopInstanceResponse, <-chan error) { responseChan := make(chan *StopInstanceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.StopInstance(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // StopInstanceWithCallback invokes the ecs.StopInstance API asynchronously // api document: https://help.aliyun.com/api/ecs/stopinstance.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) StopInstanceWithCallback(request *StopInstanceRequest, callback func(response *StopInstanceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *StopInstanceResponse var err error defer close(result) response, err = client.StopInstance(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // StopInstanceRequest is the request struct for api StopInstance type StopInstanceRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` DryRun requests.Boolean `position:"Query" name:"DryRun"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ConfirmStop requests.Boolean `position:"Query" name:"ConfirmStop"` OwnerAccount string `position:"Query" name:"OwnerAccount"` StoppedMode string `position:"Query" name:"StoppedMode"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` Hibernate requests.Boolean `position:"Query" name:"Hibernate"` ForceStop requests.Boolean `position:"Query" name:"ForceStop"` } // StopInstanceResponse is the response struct for api StopInstance type StopInstanceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateStopInstanceRequest creates a request to invoke StopInstance API func CreateStopInstanceRequest() (request *StopInstanceRequest) { request = &StopInstanceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "StopInstance", "ecs", "openAPI") return } // CreateStopInstanceResponse creates a response to parse from StopInstance response func CreateStopInstanceResponse() (response *StopInstanceResponse) { response = &StopInstanceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/stop_invocation.go������0000664�0000000�0000000�00000007671�13771713062�0032336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // StopInvocation invokes the ecs.StopInvocation API synchronously // api document: https://help.aliyun.com/api/ecs/stopinvocation.html func (client *Client) StopInvocation(request *StopInvocationRequest) (response *StopInvocationResponse, err error) { response = CreateStopInvocationResponse() err = client.DoAction(request, response) return } // StopInvocationWithChan invokes the ecs.StopInvocation API asynchronously // api document: https://help.aliyun.com/api/ecs/stopinvocation.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) StopInvocationWithChan(request *StopInvocationRequest) (<-chan *StopInvocationResponse, <-chan error) { responseChan := make(chan *StopInvocationResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.StopInvocation(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // StopInvocationWithCallback invokes the ecs.StopInvocation API asynchronously // api document: https://help.aliyun.com/api/ecs/stopinvocation.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) StopInvocationWithCallback(request *StopInvocationRequest, callback func(response *StopInvocationResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *StopInvocationResponse var err error defer close(result) response, err = client.StopInvocation(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // StopInvocationRequest is the request struct for api StopInvocation type StopInvocationRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InvokeId string `position:"Query" name:"InvokeId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` InstanceId *[]string `position:"Query" name:"InstanceId" type:"Repeated"` } // StopInvocationResponse is the response struct for api StopInvocation type StopInvocationResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateStopInvocationRequest creates a request to invoke StopInvocation API func CreateStopInvocationRequest() (request *StopInvocationRequest) { request = &StopInvocationRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "StopInvocation", "ecs", "openAPI") return } // CreateStopInvocationResponse creates a response to parse from StopInvocation response func CreateStopInvocationResponse() (response *StopInvocationResponse) { response = &StopInvocationResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������struct_access_point_set.go��������������������������������������������������������������������������0000664�0000000�0000000�00000001541�13771713062�0033760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccessPointSet is a nested struct in ecs response type AccessPointSet struct { AccessPointType []AccessPointType `json:"AccessPointType" xml:"AccessPointType"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������struct_access_point_type.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002365�13771713062�0034153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccessPointType is a nested struct in ecs response type AccessPointType struct { AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` Status string `json:"Status" xml:"Status"` Type string `json:"Type" xml:"Type"` AttachedRegionNo string `json:"AttachedRegionNo" xml:"AttachedRegionNo"` Location string `json:"Location" xml:"Location"` HostOperator string `json:"HostOperator" xml:"HostOperator"` Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_account.go�������0000664�0000000�0000000�00000001463�13771713062�0032151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Account is a nested struct in ecs response type Account struct { AliyunId string `json:"AliyunId" xml:"AliyunId"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_account_attribute_item.go��������������������������������������������������������������������0000664�0000000�0000000�00000001667�13771713062�0035201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccountAttributeItem is a nested struct in ecs response type AccountAttributeItem struct { AttributeName string `json:"AttributeName" xml:"AttributeName"` AttributeValues AttributeValues `json:"AttributeValues" xml:"AttributeValues"` } �������������������������������������������������������������������������struct_account_attribute_items.go�������������������������������������������������������������������0000664�0000000�0000000�00000001603�13771713062�0035352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccountAttributeItems is a nested struct in ecs response type AccountAttributeItems struct { AccountAttributeItem []AccountAttributeItem `json:"AccountAttributeItem" xml:"AccountAttributeItem"` } �����������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_accounts.go������0000664�0000000�0000000�00000001465�13771713062�0032336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Accounts is a nested struct in ecs response type Accounts struct { Account []Account `json:"Account" xml:"Account"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_associated_eip_addresses.go������������������������������������������������������������������0000664�0000000�0000000�00000001572�13771713062�0035450�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AssociatedEipAddresses is a nested struct in ecs response type AssociatedEipAddresses struct { AssociatedEipAddresse []string `json:"associatedEipAddresse" xml:"associatedEipAddresse"` } ��������������������������������������������������������������������������������������������������������������������������������������struct_associated_instances.go����������������������������������������������������������������������0000664�0000000�0000000�00000001553�13771713062�0034624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AssociatedInstances is a nested struct in ecs response type AssociatedInstances struct { AssociatedInstance []string `json:"associatedInstance" xml:"associatedInstance"` } �����������������������������������������������������������������������������������������������������������������������������������������������������struct_associated_public_ip.go����������������������������������������������������������������������0000664�0000000�0000000�00000001637�13771713062�0034606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AssociatedPublicIp is a nested struct in ecs response type AssociatedPublicIp struct { PublicIpAddress string `json:"PublicIpAddress" xml:"PublicIpAddress"` AllocationId string `json:"AllocationId" xml:"AllocationId"` } �������������������������������������������������������������������������������������������������struct_attach_instance_ram_role_result.go�����������������������������������������������������������0000664�0000000�0000000�00000001761�13771713062�0037045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AttachInstanceRamRoleResult is a nested struct in ecs response type AttachInstanceRamRoleResult struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` Success bool `json:"Success" xml:"Success"` Code string `json:"Code" xml:"Code"` Message string `json:"Message" xml:"Message"` } ���������������struct_attach_instance_ram_role_results.go����������������������������������������������������������0000664�0000000�0000000�00000001655�13771713062�0037232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AttachInstanceRamRoleResults is a nested struct in ecs response type AttachInstanceRamRoleResults struct { AttachInstanceRamRoleResult []AttachInstanceRamRoleResult `json:"AttachInstanceRamRoleResult" xml:"AttachInstanceRamRoleResult"` } �����������������������������������������������������������������������������������struct_attribute_values.go��������������������������������������������������������������������������0000664�0000000�0000000�00000001513�13771713062�0034014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AttributeValues is a nested struct in ecs response type AttributeValues struct { ValueItem []ValueItem `json:"ValueItem" xml:"ValueItem"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_auto_snapshot_policies.go��������������������������������������������������������������������0000664�0000000�0000000�00000001571�13771713062�0035214�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AutoSnapshotPolicies is a nested struct in ecs response type AutoSnapshotPolicies struct { AutoSnapshotPolicy []AutoSnapshotPolicy `json:"AutoSnapshotPolicy" xml:"AutoSnapshotPolicy"` } ���������������������������������������������������������������������������������������������������������������������������������������struct_auto_snapshot_policy.go����������������������������������������������������������������������0000664�0000000�0000000�00000002755�13771713062�0034711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AutoSnapshotPolicy is a nested struct in ecs response type AutoSnapshotPolicy struct { AutoSnapshotPolicyId string `json:"AutoSnapshotPolicyId" xml:"AutoSnapshotPolicyId"` RegionId string `json:"RegionId" xml:"RegionId"` AutoSnapshotPolicyName string `json:"AutoSnapshotPolicyName" xml:"AutoSnapshotPolicyName"` TimePoints string `json:"TimePoints" xml:"TimePoints"` RepeatWeekdays string `json:"RepeatWeekdays" xml:"RepeatWeekdays"` RetentionDays int `json:"RetentionDays" xml:"RetentionDays"` DiskNums int `json:"DiskNums" xml:"DiskNums"` VolumeNums int `json:"VolumeNums" xml:"VolumeNums"` CreationTime string `json:"CreationTime" xml:"CreationTime"` Status string `json:"Status" xml:"Status"` } �������������������struct_available_dedicated_host_types.go������������������������������������������������������������0000664�0000000�0000000�00000001570�13771713062�0036624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableDedicatedHostTypes is a nested struct in ecs response type AvailableDedicatedHostTypes struct { DedicatedHostType []string `json:"DedicatedHostType" xml:"DedicatedHostType"` } ����������������������������������������������������������������������������������������������������������������������������������������struct_available_disk_categories.go�����������������������������������������������������������������0000664�0000000�0000000�00000001547�13771713062�0035600�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableDiskCategories is a nested struct in ecs response type AvailableDiskCategories struct { DiskCategories []string `json:"DiskCategories" xml:"DiskCategories"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������struct_available_instance_types.go������������������������������������������������������������������0000664�0000000�0000000�00000001542�13771713062�0035464�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableInstanceTypes is a nested struct in ecs response type AvailableInstanceTypes struct { InstanceTypes []string `json:"InstanceTypes" xml:"InstanceTypes"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������struct_available_resource.go������������������������������������������������������������������������0000664�0000000�0000000�00000001757�13771713062�0034273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableResource is a nested struct in ecs response type AvailableResource struct { Type string `json:"Type" xml:"Type"` SupportedResources SupportedResourcesInDescribeResourcesModification `json:"SupportedResources" xml:"SupportedResources"` } �����������������struct_available_resource_creation.go���������������������������������������������������������������0000664�0000000�0000000�00000001550�13771713062�0036146�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableResourceCreation is a nested struct in ecs response type AvailableResourceCreation struct { ResourceTypes []string `json:"ResourceTypes" xml:"ResourceTypes"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������struct_available_resources_in_describe_available_resource.go����������������������������������������0000664�0000000�0000000�00000001647�13771713062�0042711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableResourcesInDescribeAvailableResource is a nested struct in ecs response type AvailableResourcesInDescribeAvailableResource struct { AvailableResource []AvailableResource `json:"AvailableResource" xml:"AvailableResource"` } �����������������������������������������������������������������������������������������struct_available_resources_in_describe_resources_modification.go������������������������������������0000664�0000000�0000000�00000001657�13771713062�0043622�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableResourcesInDescribeResourcesModification is a nested struct in ecs response type AvailableResourcesInDescribeResourcesModification struct { AvailableResource []AvailableResource `json:"AvailableResource" xml:"AvailableResource"` } ���������������������������������������������������������������������������������struct_available_resources_in_describe_zones.go�����������������������������������������������������0000664�0000000�0000000�00000001577�13771713062�0040222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableResourcesInDescribeZones is a nested struct in ecs response type AvailableResourcesInDescribeZones struct { ResourcesInfo []ResourcesInfo `json:"ResourcesInfo" xml:"ResourcesInfo"` } ���������������������������������������������������������������������������������������������������������������������������������struct_available_volume_categories.go���������������������������������������������������������������0000664�0000000�0000000�00000001561�13771713062�0036151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableVolumeCategories is a nested struct in ecs response type AvailableVolumeCategories struct { VolumeCategories []string `json:"VolumeCategories" xml:"VolumeCategories"` } �����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_available_zone.go0000664�0000000�0000000�00000002450�13771713062�0033465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableZone is a nested struct in ecs response type AvailableZone struct { RegionId string `json:"RegionId" xml:"RegionId"` ZoneId string `json:"ZoneId" xml:"ZoneId"` StatusCategory string `json:"StatusCategory" xml:"StatusCategory"` Status string `json:"Status" xml:"Status"` AvailableResources AvailableResourcesInDescribeResourcesModification `json:"AvailableResources" xml:"AvailableResources"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_available_zones_in_describe_available_resource.go��������������������������������������������0000664�0000000�0000000�00000001617�13771713062�0042032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableZonesInDescribeAvailableResource is a nested struct in ecs response type AvailableZonesInDescribeAvailableResource struct { AvailableZone []AvailableZone `json:"AvailableZone" xml:"AvailableZone"` } �����������������������������������������������������������������������������������������������������������������struct_available_zones_in_describe_resources_modification.go����������������������������������������0000664�0000000�0000000�00000001627�13771713062�0042743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AvailableZonesInDescribeResourcesModification is a nested struct in ecs response type AvailableZonesInDescribeResourcesModification struct { AvailableZone []AvailableZone `json:"AvailableZone" xml:"AvailableZone"` } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidth.go�����0000664�0000000�0000000�00000001755�13771713062�0032465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Bandwidth is a nested struct in ecs response type Bandwidth struct { InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` Min int `json:"Min" xml:"Min"` Max int `json:"Max" xml:"Max"` Unit string `json:"Unit" xml:"Unit"` } �������������������struct_bandwidth_package.go�������������������������������������������������������������������������0000664�0000000�0000000�00000003622�13771713062�0034054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // BandwidthPackage is a nested struct in ecs response type BandwidthPackage struct { BandwidthPackageId string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` RegionId string `json:"RegionId" xml:"RegionId"` Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` ZoneId string `json:"ZoneId" xml:"ZoneId"` NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` IpCount string `json:"IpCount" xml:"IpCount"` ISP string `json:"ISP" xml:"ISP"` CreationTime string `json:"CreationTime" xml:"CreationTime"` Status string `json:"Status" xml:"Status"` PublicIpAddresses PublicIpAddresses `json:"PublicIpAddresses" xml:"PublicIpAddresses"` } ��������������������������������������������������������������������������������������������������������������struct_bandwidth_package_ids_in_create_nat_gateway.go�����������������������������������������������0000664�0000000�0000000�00000001617�13771713062�0041311�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // BandwidthPackageIdsInCreateNatGateway is a nested struct in ecs response type BandwidthPackageIdsInCreateNatGateway struct { BandwidthPackageId []string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` } �����������������������������������������������������������������������������������������������������������������struct_bandwidth_package_ids_in_describe_nat_gateways.go��������������������������������������������0000664�0000000�0000000�00000001625�13771713062�0042010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // BandwidthPackageIdsInDescribeNatGateways is a nested struct in ecs response type BandwidthPackageIdsInDescribeNatGateways struct { BandwidthPackageId []string `json:"BandwidthPackageId" xml:"BandwidthPackageId"` } �����������������������������������������������������������������������������������������������������������struct_bandwidth_packages.go������������������������������������������������������������������������0000664�0000000�0000000�00000001553�13771713062�0034240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // BandwidthPackages is a nested struct in ecs response type BandwidthPackages struct { BandwidthPackage []BandwidthPackage `json:"BandwidthPackage" xml:"BandwidthPackage"` } �����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_bandwidths.go����0000664�0000000�0000000�00000001501�13771713062�0032635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Bandwidths is a nested struct in ecs response type Bandwidths struct { Bandwidth []Bandwidth `json:"Bandwidth" xml:"Bandwidth"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_capacity.go������0000664�0000000�0000000�00000002673�13771713062�0032316�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Capacity is a nested struct in ecs response type Capacity struct { TotalVcpus int `json:"TotalVcpus" xml:"TotalVcpus"` AvailableVcpus int `json:"AvailableVcpus" xml:"AvailableVcpus"` TotalVgpus int `json:"TotalVgpus" xml:"TotalVgpus"` AvailableVgpus int `json:"AvailableVgpus" xml:"AvailableVgpus"` TotalMemory float64 `json:"TotalMemory" xml:"TotalMemory"` AvailableMemory float64 `json:"AvailableMemory" xml:"AvailableMemory"` TotalLocalStorage int `json:"TotalLocalStorage" xml:"TotalLocalStorage"` AvailableLocalStorage int `json:"AvailableLocalStorage" xml:"AvailableLocalStorage"` LocalStorageCategory string `json:"LocalStorageCategory" xml:"LocalStorageCategory"` } ���������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_cluster.go�������0000664�0000000�0000000�00000001466�13771713062�0032201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Cluster is a nested struct in ecs response type Cluster struct { ClusterId string `json:"ClusterId" xml:"ClusterId"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_clusters.go������0000664�0000000�0000000�00000001465�13771713062�0032363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Clusters is a nested struct in ecs response type Clusters struct { Cluster []Cluster `json:"Cluster" xml:"Cluster"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_command.go�������0000664�0000000�0000000�00000002317�13771713062�0032132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Command is a nested struct in ecs response type Command struct { CommandId string `json:"CommandId" xml:"CommandId"` Name string `json:"Name" xml:"Name"` Type string `json:"Type" xml:"Type"` Description string `json:"Description" xml:"Description"` CommandContent string `json:"CommandContent" xml:"CommandContent"` WorkingDir string `json:"WorkingDir" xml:"WorkingDir"` Timeout int `json:"Timeout" xml:"Timeout"` CreationTime string `json:"CreationTime" xml:"CreationTime"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_commands.go������0000664�0000000�0000000�00000001465�13771713062�0032320�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Commands is a nested struct in ecs response type Commands struct { Command []Command `json:"Command" xml:"Command"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data.go����������0000664�0000000�0000000�00000001545�13771713062�0031427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Data is a nested struct in ecs response type Data struct { RecommendInstanceType []RecommendInstanceType `json:"RecommendInstanceType" xml:"RecommendInstanceType"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disk.go�����0000664�0000000�0000000�00000002367�13771713062�0032444�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DataDisk is a nested struct in ecs response type DataDisk struct { Size int `json:"Size" xml:"Size"` SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` Category string `json:"Category" xml:"Category"` Encrypted string `json:"Encrypted" xml:"Encrypted"` DiskName string `json:"DiskName" xml:"DiskName"` Description string `json:"Description" xml:"Description"` DeleteWithInstance bool `json:"DeleteWithInstance" xml:"DeleteWithInstance"` Device string `json:"Device" xml:"Device"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_data_disk_categories.go����������������������������������������������������������������������0000664�0000000�0000000�00000001576�13771713062�0034573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DataDiskCategories is a nested struct in ecs response type DataDiskCategories struct { SupportedDataDiskCategory []string `json:"supportedDataDiskCategory" xml:"supportedDataDiskCategory"` } ����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_disks.go����0000664�0000000�0000000�00000001473�13771713062�0032624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DataDisks is a nested struct in ecs response type DataDisks struct { DataDisk []DataDisk `json:"DataDisk" xml:"DataDisk"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_data_point.go����0000664�0000000�0000000�00000001545�13771713062�0032640�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DataPoint is a nested struct in ecs response type DataPoint struct { TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` Size int `json:"Size" xml:"Size"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_dedicated_host.go0000664�0000000�0000000�00000007745�13771713062�0033471�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHost is a nested struct in ecs response type DedicatedHost struct { DedicatedHostId string `json:"DedicatedHostId" xml:"DedicatedHostId"` RegionId string `json:"RegionId" xml:"RegionId"` ZoneId string `json:"ZoneId" xml:"ZoneId"` DedicatedHostName string `json:"DedicatedHostName" xml:"DedicatedHostName"` MachineId string `json:"MachineId" xml:"MachineId"` Description string `json:"Description" xml:"Description"` DedicatedHostType string `json:"DedicatedHostType" xml:"DedicatedHostType"` Sockets int `json:"Sockets" xml:"Sockets"` Cores int `json:"Cores" xml:"Cores"` PhysicalGpus int `json:"PhysicalGpus" xml:"PhysicalGpus"` GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` ActionOnMaintenance string `json:"ActionOnMaintenance" xml:"ActionOnMaintenance"` Status string `json:"Status" xml:"Status"` CreationTime string `json:"CreationTime" xml:"CreationTime"` ChargeType string `json:"ChargeType" xml:"ChargeType"` SaleCycle string `json:"SaleCycle" xml:"SaleCycle"` ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` AutoReleaseTime string `json:"AutoReleaseTime" xml:"AutoReleaseTime"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` SupportedInstanceTypeFamilies SupportedInstanceTypeFamiliesInDescribeDedicatedHosts `json:"SupportedInstanceTypeFamilies" xml:"SupportedInstanceTypeFamilies"` SupportedInstanceTypesList SupportedInstanceTypesListInDescribeDedicatedHosts `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` Capacity Capacity `json:"Capacity" xml:"Capacity"` NetworkAttributes NetworkAttributes `json:"NetworkAttributes" xml:"NetworkAttributes"` Instances InstancesInDescribeDedicatedHosts `json:"Instances" xml:"Instances"` OperationLocks OperationLocksInDescribeDedicatedHosts `json:"OperationLocks" xml:"OperationLocks"` Tags TagsInDescribeDedicatedHosts `json:"Tags" xml:"Tags"` } ���������������������������struct_dedicated_host_attribute.go������������������������������������������������������������������0000664�0000000�0000000�00000001665�13771713062�0035470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHostAttribute is a nested struct in ecs response type DedicatedHostAttribute struct { DedicatedHostName string `json:"DedicatedHostName" xml:"DedicatedHostName"` DedicatedHostId string `json:"DedicatedHostId" xml:"DedicatedHostId"` } ���������������������������������������������������������������������������struct_dedicated_host_generations.go����������������������������������������������������������������0000664�0000000�0000000�00000001604�13771713062�0035774�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHostGenerations is a nested struct in ecs response type DedicatedHostGenerations struct { DedicatedHostGeneration []string `json:"DedicatedHostGeneration" xml:"DedicatedHostGeneration"` } ����������������������������������������������������������������������������������������������������������������������������struct_dedicated_host_id_sets.go��������������������������������������������������������������������0000664�0000000�0000000�00000001542�13771713062�0035111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHostIdSets is a nested struct in ecs response type DedicatedHostIdSets struct { DedicatedHostId []string `json:"DedicatedHostId" xml:"DedicatedHostId"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������struct_dedicated_host_renew_attribute.go������������������������������������������������������������0000664�0000000�0000000�00000002167�13771713062�0036666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHostRenewAttribute is a nested struct in ecs response type DedicatedHostRenewAttribute struct { DedicatedHostId string `json:"DedicatedHostId" xml:"DedicatedHostId"` AutoRenewEnabled bool `json:"AutoRenewEnabled" xml:"AutoRenewEnabled"` Duration int `json:"Duration" xml:"Duration"` PeriodUnit string `json:"PeriodUnit" xml:"PeriodUnit"` RenewalStatus string `json:"RenewalStatus" xml:"RenewalStatus"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_dedicated_host_renew_attributes.go�����������������������������������������������������������0000664�0000000�0000000�00000001655�13771713062�0037052�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHostRenewAttributes is a nested struct in ecs response type DedicatedHostRenewAttributes struct { DedicatedHostRenewAttribute []DedicatedHostRenewAttribute `json:"DedicatedHostRenewAttribute" xml:"DedicatedHostRenewAttribute"` } �����������������������������������������������������������������������������������struct_dedicated_host_type.go�����������������������������������������������������������������������0000664�0000000�0000000�00000004765�13771713062�0034452�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHostType is a nested struct in ecs response type DedicatedHostType struct { DedicatedHostType string `json:"DedicatedHostType" xml:"DedicatedHostType"` Sockets int `json:"Sockets" xml:"Sockets"` TotalVcpus int `json:"TotalVcpus" xml:"TotalVcpus"` TotalVgpus int `json:"TotalVgpus" xml:"TotalVgpus"` Cores int `json:"Cores" xml:"Cores"` PhysicalGpus int `json:"PhysicalGpus" xml:"PhysicalGpus"` MemorySize float64 `json:"MemorySize" xml:"MemorySize"` LocalStorageCapacity int `json:"LocalStorageCapacity" xml:"LocalStorageCapacity"` LocalStorageAmount int `json:"LocalStorageAmount" xml:"LocalStorageAmount"` LocalStorageCategory string `json:"LocalStorageCategory" xml:"LocalStorageCategory"` GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` SupportedInstanceTypeFamilies SupportedInstanceTypeFamiliesInDescribeDedicatedHostTypes `json:"SupportedInstanceTypeFamilies" xml:"SupportedInstanceTypeFamilies"` SupportedInstanceTypesList SupportedInstanceTypesListInDescribeDedicatedHostTypes `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` } �����������struct_dedicated_host_types.go����������������������������������������������������������������������0000664�0000000�0000000�00000001561�13771713062�0034624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHostTypes is a nested struct in ecs response type DedicatedHostTypes struct { DedicatedHostType []DedicatedHostType `json:"DedicatedHostType" xml:"DedicatedHostType"` } �����������������������������������������������������������������������������������������������������������������������������������������������struct_dedicated_hosts.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001531�13771713062�0033560�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DedicatedHosts is a nested struct in ecs response type DedicatedHosts struct { DedicatedHost []DedicatedHost `json:"DedicatedHost" xml:"DedicatedHost"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demand.go��������0000664�0000000�0000000�00000003464�13771713062�0031750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Demand is a nested struct in ecs response type Demand struct { ZoneId string `json:"ZoneId" xml:"ZoneId"` DemandTime string `json:"DemandTime" xml:"DemandTime"` InstanceTypeFamily string `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` InstanceType string `json:"InstanceType" xml:"InstanceType"` InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` Period int `json:"Period" xml:"Period"` PeriodUnit string `json:"PeriodUnit" xml:"PeriodUnit"` StartTime string `json:"StartTime" xml:"StartTime"` EndTime string `json:"EndTime" xml:"EndTime"` DemandStatus string `json:"DemandStatus" xml:"DemandStatus"` TotalAmount int `json:"TotalAmount" xml:"TotalAmount"` AvailableAmount int `json:"AvailableAmount" xml:"AvailableAmount"` UsedAmount int `json:"UsedAmount" xml:"UsedAmount"` DeliveringAmount int `json:"DeliveringAmount" xml:"DeliveringAmount"` SupplyInfos SupplyInfos `json:"SupplyInfos" xml:"SupplyInfos"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_demands.go�������0000664�0000000�0000000�00000001457�13771713062�0032133�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Demands is a nested struct in ecs response type Demands struct { Demand []Demand `json:"Demand" xml:"Demand"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_deployment_set.go0000664�0000000�0000000�00000003103�13771713062�0033541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DeploymentSet is a nested struct in ecs response type DeploymentSet struct { DeploymentSetId string `json:"DeploymentSetId" xml:"DeploymentSetId"` DeploymentSetDescription string `json:"DeploymentSetDescription" xml:"DeploymentSetDescription"` DeploymentSetName string `json:"DeploymentSetName" xml:"DeploymentSetName"` Strategy string `json:"Strategy" xml:"Strategy"` DeploymentStrategy string `json:"DeploymentStrategy" xml:"DeploymentStrategy"` Domain string `json:"Domain" xml:"Domain"` Granularity string `json:"Granularity" xml:"Granularity"` InstanceAmount int `json:"InstanceAmount" xml:"InstanceAmount"` CreationTime string `json:"CreationTime" xml:"CreationTime"` InstanceIds InstanceIds `json:"InstanceIds" xml:"InstanceIds"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_deployment_sets.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001531�13771713062�0033650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DeploymentSets is a nested struct in ecs response type DeploymentSets struct { DeploymentSet []DeploymentSet `json:"DeploymentSet" xml:"DeploymentSet"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_detach_instance_ram_role_result.go�����������������������������������������������������������0000664�0000000�0000000�00000002434�13771713062�0037027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DetachInstanceRamRoleResult is a nested struct in ecs response type DetachInstanceRamRoleResult struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` Success bool `json:"Success" xml:"Success"` Code string `json:"Code" xml:"Code"` Message string `json:"Message" xml:"Message"` InstanceRamRoleSets InstanceRamRoleSetsInDetachInstanceRamRole `json:"InstanceRamRoleSets" xml:"InstanceRamRoleSets"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_detach_instance_ram_role_results.go����������������������������������������������������������0000664�0000000�0000000�00000001655�13771713062�0037216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DetachInstanceRamRoleResults is a nested struct in ecs response type DetachInstanceRamRoleResults struct { DetachInstanceRamRoleResult []DetachInstanceRamRoleResult `json:"DetachInstanceRamRoleResult" xml:"DetachInstanceRamRoleResult"` } �����������������������������������������������������������������������������������struct_detail_infos_in_describe_price.go������������������������������������������������������������0000664�0000000�0000000�00000001605�13771713062�0036604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DetailInfosInDescribePrice is a nested struct in ecs response type DetailInfosInDescribePrice struct { ResourcePriceModel []ResourcePriceModel `json:"ResourcePriceModel" xml:"ResourcePriceModel"` } ���������������������������������������������������������������������������������������������������������������������������struct_detail_infos_in_describe_renewal_price.go����������������������������������������������������0000664�0000000�0000000�00000001623�13771713062�0040321�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DetailInfosInDescribeRenewalPrice is a nested struct in ecs response type DetailInfosInDescribeRenewalPrice struct { ResourcePriceModel []ResourcePriceModel `json:"ResourcePriceModel" xml:"ResourcePriceModel"` } �������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk.go����������0000664�0000000�0000000�00000010245�13771713062�0031445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Disk is a nested struct in ecs response type Disk struct { DiskId string `json:"DiskId" xml:"DiskId"` RegionId string `json:"RegionId" xml:"RegionId"` ZoneId string `json:"ZoneId" xml:"ZoneId"` DiskName string `json:"DiskName" xml:"DiskName"` Description string `json:"Description" xml:"Description"` Type string `json:"Type" xml:"Type"` Category string `json:"Category" xml:"Category"` Size int `json:"Size" xml:"Size"` ImageId string `json:"ImageId" xml:"ImageId"` SourceSnapshotId string `json:"SourceSnapshotId" xml:"SourceSnapshotId"` AutoSnapshotPolicyId string `json:"AutoSnapshotPolicyId" xml:"AutoSnapshotPolicyId"` ProductCode string `json:"ProductCode" xml:"ProductCode"` Portable bool `json:"Portable" xml:"Portable"` Status string `json:"Status" xml:"Status"` InstanceId string `json:"InstanceId" xml:"InstanceId"` Device string `json:"Device" xml:"Device"` DeleteWithInstance bool `json:"DeleteWithInstance" xml:"DeleteWithInstance"` DeleteAutoSnapshot bool `json:"DeleteAutoSnapshot" xml:"DeleteAutoSnapshot"` EnableAutoSnapshot bool `json:"EnableAutoSnapshot" xml:"EnableAutoSnapshot"` EnableAutomatedSnapshotPolicy bool `json:"EnableAutomatedSnapshotPolicy" xml:"EnableAutomatedSnapshotPolicy"` CreationTime string `json:"CreationTime" xml:"CreationTime"` AttachedTime string `json:"AttachedTime" xml:"AttachedTime"` DetachedTime string `json:"DetachedTime" xml:"DetachedTime"` DiskChargeType string `json:"DiskChargeType" xml:"DiskChargeType"` ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` Encrypted bool `json:"Encrypted" xml:"Encrypted"` MountInstanceNum int `json:"MountInstanceNum" xml:"MountInstanceNum"` IOPS int `json:"IOPS" xml:"IOPS"` IOPSRead int `json:"IOPSRead" xml:"IOPSRead"` IOPSWrite int `json:"IOPSWrite" xml:"IOPSWrite"` KMSKeyId string `json:"KMSKeyId" xml:"KMSKeyId"` OperationLocks OperationLocksInDescribeDisks `json:"OperationLocks" xml:"OperationLocks"` MountInstances MountInstances `json:"MountInstances" xml:"MountInstances"` Tags TagsInDescribeDisks `json:"Tags" xml:"Tags"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_disk_device_mapping.go�����������������������������������������������������������������������0000664�0000000�0000000�00000002442�13771713062�0034420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DiskDeviceMapping is a nested struct in ecs response type DiskDeviceMapping struct { SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` Size string `json:"Size" xml:"Size"` Device string `json:"Device" xml:"Device"` Type string `json:"Type" xml:"Type"` Format string `json:"Format" xml:"Format"` ImportOSSBucket string `json:"ImportOSSBucket" xml:"ImportOSSBucket"` ImportOSSObject string `json:"ImportOSSObject" xml:"ImportOSSObject"` Progress string `json:"Progress" xml:"Progress"` RemainTime int `json:"RemainTime" xml:"RemainTime"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_disk_device_mappings.go����������������������������������������������������������������������0000664�0000000�0000000�00000001561�13771713062�0034604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DiskDeviceMappings is a nested struct in ecs response type DiskDeviceMappings struct { DiskDeviceMapping []DiskDeviceMapping `json:"DiskDeviceMapping" xml:"DiskDeviceMapping"` } �����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disk_event_set.go0000664�0000000�0000000�00000001525�13771713062�0033522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DiskEventSet is a nested struct in ecs response type DiskEventSet struct { DiskEventType []DiskEventType `json:"DiskEventType" xml:"DiskEventType"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_disk_event_type.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001773�13771713062�0033636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DiskEventType is a nested struct in ecs response type DiskEventType struct { EventId string `json:"EventId" xml:"EventId"` EventTime string `json:"EventTime" xml:"EventTime"` EventEndTime string `json:"EventEndTime" xml:"EventEndTime"` EventType EventType `json:"EventType" xml:"EventType"` } �����struct_disk_full_status_set.go����������������������������������������������������������������������0000664�0000000�0000000�00000001563�13771713062�0034671�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DiskFullStatusSet is a nested struct in ecs response type DiskFullStatusSet struct { DiskFullStatusType []DiskFullStatusType `json:"DiskFullStatusType" xml:"DiskFullStatusType"` } ���������������������������������������������������������������������������������������������������������������������������������������������struct_disk_full_status_type.go���������������������������������������������������������������������0000664�0000000�0000000�00000002207�13771713062�0035053�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DiskFullStatusType is a nested struct in ecs response type DiskFullStatusType struct { DiskId string `json:"DiskId" xml:"DiskId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` Device string `json:"Device" xml:"Device"` Status Status `json:"Status" xml:"Status"` HealthStatus HealthStatus `json:"HealthStatus" xml:"HealthStatus"` DiskEventSet DiskEventSet `json:"DiskEventSet" xml:"DiskEventSet"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_disk_monitor_data.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002473�13771713062�0034132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // DiskMonitorData is a nested struct in ecs response type DiskMonitorData struct { DiskId string `json:"DiskId" xml:"DiskId"` IOPSRead int `json:"IOPSRead" xml:"IOPSRead"` IOPSWrite int `json:"IOPSWrite" xml:"IOPSWrite"` IOPSTotal int `json:"IOPSTotal" xml:"IOPSTotal"` BPSRead int `json:"BPSRead" xml:"BPSRead"` BPSWrite int `json:"BPSWrite" xml:"BPSWrite"` BPSTotal int `json:"BPSTotal" xml:"BPSTotal"` LatencyRead int `json:"LatencyRead" xml:"LatencyRead"` LatencyWrite int `json:"LatencyWrite" xml:"LatencyWrite"` TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_disks.go���������0000664�0000000�0000000�00000001443�13771713062�0031630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Disks is a nested struct in ecs response type Disks struct { Disk []Disk `json:"Disk" xml:"Disk"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_ecs_capacity_reservation_attr.go�������������������������������������������������������������0000664�0000000�0000000�00000001771�13771713062�0036542�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EcsCapacityReservationAttr is a nested struct in ecs response type EcsCapacityReservationAttr struct { CapacityReservationId string `json:"CapacityReservationId" xml:"CapacityReservationId"` CapacityReservationPreference string `json:"CapacityReservationPreference" xml:"CapacityReservationPreference"` } �������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_address.go���0000664�0000000�0000000�00000002165�13771713062�0032777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EipAddress is a nested struct in ecs response type EipAddress struct { Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` IsSupportUnassociate bool `json:"IsSupportUnassociate" xml:"IsSupportUnassociate"` IpAddress string `json:"IpAddress" xml:"IpAddress"` InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` AllocationId string `json:"AllocationId" xml:"AllocationId"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_eip_address_in_describe_eip_addresses.go�����������������������������������������������������0000664�0000000�0000000�00000004027�13771713062�0040137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EipAddressInDescribeEipAddresses is a nested struct in ecs response type EipAddressInDescribeEipAddresses struct { RegionId string `json:"RegionId" xml:"RegionId"` IpAddress string `json:"IpAddress" xml:"IpAddress"` AllocationId string `json:"AllocationId" xml:"AllocationId"` Status string `json:"Status" xml:"Status"` InstanceId string `json:"InstanceId" xml:"InstanceId"` Bandwidth string `json:"Bandwidth" xml:"Bandwidth"` EipBandwidth string `json:"EipBandwidth" xml:"EipBandwidth"` InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` AllocationTime string `json:"AllocationTime" xml:"AllocationTime"` InstanceType string `json:"InstanceType" xml:"InstanceType"` ChargeType string `json:"ChargeType" xml:"ChargeType"` ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` OperationLocks OperationLocksInDescribeEipAddresses `json:"OperationLocks" xml:"OperationLocks"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_eip_addresses.go�0000664�0000000�0000000�00000001537�13771713062�0033331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EipAddresses is a nested struct in ecs response type EipAddresses struct { EipAddress []EipAddressInDescribeEipAddresses `json:"EipAddress" xml:"EipAddress"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������struct_eip_monitor_data.go��������������������������������������������������������������������������0000664�0000000�0000000�00000002123�13771713062�0033745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EipMonitorData is a nested struct in ecs response type EipMonitorData struct { EipPackets int `json:"EipPackets" xml:"EipPackets"` TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` EipFlow int `json:"EipFlow" xml:"EipFlow"` EipRX int `json:"EipRX" xml:"EipRX"` EipBandwidth int `json:"EipBandwidth" xml:"EipBandwidth"` EipTX int `json:"EipTX" xml:"EipTX"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_eip_monitor_datas_in_describe_eip_monitor_data.go��������������������������������������������0000664�0000000�0000000�00000001617�13771713062�0042062�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EipMonitorDatasInDescribeEipMonitorData is a nested struct in ecs response type EipMonitorDatasInDescribeEipMonitorData struct { EipMonitorData []EipMonitorData `json:"EipMonitorData" xml:"EipMonitorData"` } �����������������������������������������������������������������������������������������������������������������struct_eip_monitor_datas_in_describe_new_project_eip_monitor_data.go��������������������������������0000664�0000000�0000000�00000001643�13771713062�0044460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EipMonitorDatasInDescribeNewProjectEipMonitorData is a nested struct in ecs response type EipMonitorDatasInDescribeNewProjectEipMonitorData struct { EipMonitorData []EipMonitorData `json:"EipMonitorData" xml:"EipMonitorData"` } ���������������������������������������������������������������������������������������������struct_eni_monitor_data.go��������������������������������������������������������������������������0000664�0000000�0000000�00000002323�13771713062�0033745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EniMonitorData is a nested struct in ecs response type EniMonitorData struct { EniId string `json:"EniId" xml:"EniId"` TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` PacketTx string `json:"PacketTx" xml:"PacketTx"` PacketRx string `json:"PacketRx" xml:"PacketRx"` IntranetTx string `json:"IntranetTx" xml:"IntranetTx"` IntranetRx string `json:"IntranetRx" xml:"IntranetRx"` DropPacketTx string `json:"DropPacketTx" xml:"DropPacketTx"` DropPacketRx string `json:"DropPacketRx" xml:"DropPacketRx"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_event_cycle_status.go������������������������������������������������������������������������0000664�0000000�0000000�00000001537�13771713062�0034343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EventCycleStatus is a nested struct in ecs response type EventCycleStatus struct { Name string `json:"Name" xml:"Name"` Code int `json:"Code" xml:"Code"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_id_set.go��0000664�0000000�0000000�00000001470�13771713062�0033163�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EventIdSet is a nested struct in ecs response type EventIdSet struct { EventId []string `json:"EventId" xml:"EventId"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_event_type.go����0000664�0000000�0000000�00000001521�13771713062�0032672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // EventType is a nested struct in ecs response type EventType struct { Name string `json:"Name" xml:"Name"` Code int `json:"Code" xml:"Code"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_extended_attribute.go������������������������������������������������������������������������0000664�0000000�0000000�00000001555�13771713062�0034323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ExtendedAttribute is a nested struct in ecs response type ExtendedAttribute struct { Device string `json:"Device" xml:"Device"` DiskId string `json:"DiskId" xml:"DiskId"` } ���������������������������������������������������������������������������������������������������������������������������������������������������struct_forward_table_entries.go���������������������������������������������������������������������0000664�0000000�0000000�00000001563�13771713062�0035003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ForwardTableEntries is a nested struct in ecs response type ForwardTableEntries struct { ForwardTableEntry []ForwardTableEntry `json:"ForwardTableEntry" xml:"ForwardTableEntry"` } ���������������������������������������������������������������������������������������������������������������������������������������������struct_forward_table_entry.go�����������������������������������������������������������������������0000664�0000000�0000000�00000002405�13771713062�0034467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ForwardTableEntry is a nested struct in ecs response type ForwardTableEntry struct { ForwardTableId string `json:"ForwardTableId" xml:"ForwardTableId"` ForwardEntryId string `json:"ForwardEntryId" xml:"ForwardEntryId"` ExternalIp string `json:"ExternalIp" xml:"ExternalIp"` ExternalPort string `json:"ExternalPort" xml:"ExternalPort"` IpProtocol string `json:"IpProtocol" xml:"IpProtocol"` InternalIp string `json:"InternalIp" xml:"InternalIp"` InternalPort string `json:"InternalPort" xml:"InternalPort"` Status string `json:"Status" xml:"Status"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_forward_table_ids_in_create_nat_gateway.go���������������������������������������������������0000664�0000000�0000000�00000001573�13771713062�0040506�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ForwardTableIdsInCreateNatGateway is a nested struct in ecs response type ForwardTableIdsInCreateNatGateway struct { ForwardTableId []string `json:"ForwardTableId" xml:"ForwardTableId"` } �������������������������������������������������������������������������������������������������������������������������������������struct_forward_table_ids_in_describe_nat_gateways.go������������������������������������������������0000664�0000000�0000000�00000001601�13771713062�0041176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ForwardTableIdsInDescribeNatGateways is a nested struct in ecs response type ForwardTableIdsInDescribeNatGateways struct { ForwardTableId []string `json:"ForwardTableId" xml:"ForwardTableId"` } �������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vip.go��������0000664�0000000�0000000�00000003261�13771713062�0031761�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // HaVip is a nested struct in ecs response type HaVip struct { HaVipId string `json:"HaVipId" xml:"HaVipId"` RegionId string `json:"RegionId" xml:"RegionId"` VpcId string `json:"VpcId" xml:"VpcId"` VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` IpAddress string `json:"IpAddress" xml:"IpAddress"` Status string `json:"Status" xml:"Status"` MasterInstanceId string `json:"MasterInstanceId" xml:"MasterInstanceId"` Description string `json:"Description" xml:"Description"` CreateTime string `json:"CreateTime" xml:"CreateTime"` AssociatedInstances AssociatedInstances `json:"AssociatedInstances" xml:"AssociatedInstances"` AssociatedEipAddresses AssociatedEipAddresses `json:"AssociatedEipAddresses" xml:"AssociatedEipAddresses"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ha_vips.go�������0000664�0000000�0000000�00000001451�13771713062�0032143�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // HaVips is a nested struct in ecs response type HaVips struct { HaVip []HaVip `json:"HaVip" xml:"HaVip"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_health_status.go�0000664�0000000�0000000�00000001527�13771713062�0033366�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // HealthStatus is a nested struct in ecs response type HealthStatus struct { Name string `json:"Name" xml:"Name"` Code int `json:"Code" xml:"Code"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_cluster.go���0000664�0000000�0000000�00000001657�13771713062�0033035�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // HpcCluster is a nested struct in ecs response type HpcCluster struct { HpcClusterId string `json:"HpcClusterId" xml:"HpcClusterId"` Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` } ���������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_hpc_clusters.go��0000664�0000000�0000000�00000001507�13771713062�0033212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // HpcClusters is a nested struct in ecs response type HpcClusters struct { HpcCluster []HpcCluster `json:"HpcCluster" xml:"HpcCluster"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_image.go���������0000664�0000000�0000000�00000005213�13771713062�0031574�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Image is a nested struct in ecs response type Image struct { Progress string `json:"Progress" xml:"Progress"` ImageId string `json:"ImageId" xml:"ImageId"` ImageName string `json:"ImageName" xml:"ImageName"` ImageVersion string `json:"ImageVersion" xml:"ImageVersion"` Description string `json:"Description" xml:"Description"` Size int `json:"Size" xml:"Size"` ImageOwnerAlias string `json:"ImageOwnerAlias" xml:"ImageOwnerAlias"` IsSupportIoOptimized bool `json:"IsSupportIoOptimized" xml:"IsSupportIoOptimized"` IsSupportCloudinit bool `json:"IsSupportCloudinit" xml:"IsSupportCloudinit"` OSName string `json:"OSName" xml:"OSName"` OSNameEn string `json:"OSNameEn" xml:"OSNameEn"` Architecture string `json:"Architecture" xml:"Architecture"` Status string `json:"Status" xml:"Status"` ProductCode string `json:"ProductCode" xml:"ProductCode"` IsSubscribed bool `json:"IsSubscribed" xml:"IsSubscribed"` CreationTime string `json:"CreationTime" xml:"CreationTime"` IsSelfShared string `json:"IsSelfShared" xml:"IsSelfShared"` OSType string `json:"OSType" xml:"OSType"` Platform string `json:"Platform" xml:"Platform"` Usage string `json:"Usage" xml:"Usage"` IsCopied bool `json:"IsCopied" xml:"IsCopied"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` DiskDeviceMappings DiskDeviceMappings `json:"DiskDeviceMappings" xml:"DiskDeviceMappings"` Tags TagsInDescribeImages `json:"Tags" xml:"Tags"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_images.go��������0000664�0000000�0000000�00000001451�13771713062�0031757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Images is a nested struct in ecs response type Images struct { Image []Image `json:"Image" xml:"Image"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_inner_ip_address_in_describe_instance_attribute.go�������������������������������������������0000664�0000000�0000000�00000001574�13771713062�0042246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InnerIpAddressInDescribeInstanceAttribute is a nested struct in ecs response type InnerIpAddressInDescribeInstanceAttribute struct { IpAddress []string `json:"IpAddress" xml:"IpAddress"` } ������������������������������������������������������������������������������������������������������������������������������������struct_inner_ip_address_in_describe_instances.go����������������������������������������������������0000664�0000000�0000000�00000001554�13771713062�0040344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InnerIpAddressInDescribeInstances is a nested struct in ecs response type InnerIpAddressInDescribeInstances struct { IpAddress []string `json:"IpAddress" xml:"IpAddress"` } ����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance.go������0000664�0000000�0000000�00000015007�13771713062�0032320�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Instance is a nested struct in ecs response type Instance struct { ImageId string `json:"ImageId" xml:"ImageId"` InstanceType string `json:"InstanceType" xml:"InstanceType"` AutoReleaseTime string `json:"AutoReleaseTime" xml:"AutoReleaseTime"` DeviceAvailable bool `json:"DeviceAvailable" xml:"DeviceAvailable"` InstanceNetworkType string `json:"InstanceNetworkType" xml:"InstanceNetworkType"` LocalStorageAmount int `json:"LocalStorageAmount" xml:"LocalStorageAmount"` InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` ClusterId string `json:"ClusterId" xml:"ClusterId"` InstanceName string `json:"InstanceName" xml:"InstanceName"` CreditSpecification string `json:"CreditSpecification" xml:"CreditSpecification"` GPUAmount int `json:"GPUAmount" xml:"GPUAmount"` StartTime string `json:"StartTime" xml:"StartTime"` ZoneId string `json:"ZoneId" xml:"ZoneId"` InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` InternetMaxBandwidthIn int `json:"InternetMaxBandwidthIn" xml:"InternetMaxBandwidthIn"` HostName string `json:"HostName" xml:"HostName"` Cpu int `json:"Cpu" xml:"Cpu"` Status string `json:"Status" xml:"Status"` SpotPriceLimit float64 `json:"SpotPriceLimit" xml:"SpotPriceLimit"` OSName string `json:"OSName" xml:"OSName"` OSNameEn string `json:"OSNameEn" xml:"OSNameEn"` SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` RegionId string `json:"RegionId" xml:"RegionId"` InternetMaxBandwidthOut int `json:"InternetMaxBandwidthOut" xml:"InternetMaxBandwidthOut"` IoOptimized bool `json:"IoOptimized" xml:"IoOptimized"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` InstanceTypeFamily string `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` InstanceId string `json:"InstanceId" xml:"InstanceId"` DeploymentSetId string `json:"DeploymentSetId" xml:"DeploymentSetId"` GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` Description string `json:"Description" xml:"Description"` Recyclable bool `json:"Recyclable" xml:"Recyclable"` SaleCycle string `json:"SaleCycle" xml:"SaleCycle"` ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` OSType string `json:"OSType" xml:"OSType"` Memory int `json:"Memory" xml:"Memory"` CreationTime string `json:"CreationTime" xml:"CreationTime"` KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` HpcClusterId string `json:"HpcClusterId" xml:"HpcClusterId"` LocalStorageCapacity int `json:"LocalStorageCapacity" xml:"LocalStorageCapacity"` VlanId string `json:"VlanId" xml:"VlanId"` StoppedMode string `json:"StoppedMode" xml:"StoppedMode"` SpotStrategy string `json:"SpotStrategy" xml:"SpotStrategy"` DeletionProtection bool `json:"DeletionProtection" xml:"DeletionProtection"` SecurityGroupIds SecurityGroupIdsInDescribeInstances `json:"SecurityGroupIds" xml:"SecurityGroupIds"` InnerIpAddress InnerIpAddressInDescribeInstances `json:"InnerIpAddress" xml:"InnerIpAddress"` PublicIpAddress PublicIpAddressInDescribeInstances `json:"PublicIpAddress" xml:"PublicIpAddress"` RdmaIpAddress RdmaIpAddress `json:"RdmaIpAddress" xml:"RdmaIpAddress"` EipAddress EipAddress `json:"EipAddress" xml:"EipAddress"` EcsCapacityReservationAttr EcsCapacityReservationAttr `json:"EcsCapacityReservationAttr" xml:"EcsCapacityReservationAttr"` DedicatedHostAttribute DedicatedHostAttribute `json:"DedicatedHostAttribute" xml:"DedicatedHostAttribute"` VpcAttributes VpcAttributes `json:"VpcAttributes" xml:"VpcAttributes"` NetworkInterfaces NetworkInterfacesInDescribeInstances `json:"NetworkInterfaces" xml:"NetworkInterfaces"` OperationLocks OperationLocksInDescribeInstances `json:"OperationLocks" xml:"OperationLocks"` Tags TagsInDescribeInstances `json:"Tags" xml:"Tags"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_instance_cloud_assistant_status.go�����������������������������������������������������������0000664�0000000�0000000�00000001703�13771713062�0037121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceCloudAssistantStatus is a nested struct in ecs response type InstanceCloudAssistantStatus struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` CloudAssistantStatus string `json:"CloudAssistantStatus" xml:"CloudAssistantStatus"` } �������������������������������������������������������������struct_instance_cloud_assistant_status_set.go�������������������������������������������������������0000664�0000000�0000000�00000001667�13771713062�0040005�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceCloudAssistantStatusSet is a nested struct in ecs response type InstanceCloudAssistantStatusSet struct { InstanceCloudAssistantStatus []InstanceCloudAssistantStatus `json:"InstanceCloudAssistantStatus" xml:"InstanceCloudAssistantStatus"` } �������������������������������������������������������������������������struct_instance_full_status_set.go������������������������������������������������������������������0000664�0000000�0000000�00000001613�13771713062�0035537�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceFullStatusSet is a nested struct in ecs response type InstanceFullStatusSet struct { InstanceFullStatusType []InstanceFullStatusType `json:"InstanceFullStatusType" xml:"InstanceFullStatusType"` } ���������������������������������������������������������������������������������������������������������������������struct_instance_full_status_type.go�����������������������������������������������������������������0000664�0000000�0000000�00000002215�13771713062�0035724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceFullStatusType is a nested struct in ecs response type InstanceFullStatusType struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` Status Status `json:"Status" xml:"Status"` HealthStatus HealthStatus `json:"HealthStatus" xml:"HealthStatus"` ScheduledSystemEventSet ScheduledSystemEventSet `json:"ScheduledSystemEventSet" xml:"ScheduledSystemEventSet"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_instance_generations.go����������������������������������������������������������������������0000664�0000000�0000000�00000001606�13771713062�0034637�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceGenerations is a nested struct in ecs response type InstanceGenerations struct { SupportedInstanceGeneration []string `json:"supportedInstanceGeneration" xml:"supportedInstanceGeneration"` } ��������������������������������������������������������������������������������������������������������������������������struct_instance_id_sets.go��������������������������������������������������������������������������0000664�0000000�0000000�00000001522�13771713062�0033750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceIdSets is a nested struct in ecs response type InstanceIdSets struct { InstanceIdSet []string `json:"InstanceIdSet" xml:"InstanceIdSet"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_ids.go��0000664�0000000�0000000�00000001503�13771713062�0033153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceIds is a nested struct in ecs response type InstanceIds struct { InstanceId []string `json:"InstanceId" xml:"InstanceId"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_instance_monitor_data.go���������������������������������������������������������������������0000664�0000000�0000000�00000004142�13771713062�0034777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceMonitorData is a nested struct in ecs response type InstanceMonitorData struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` CPU int `json:"CPU" xml:"CPU"` IntranetRX int `json:"IntranetRX" xml:"IntranetRX"` IntranetTX int `json:"IntranetTX" xml:"IntranetTX"` IntranetBandwidth int `json:"IntranetBandwidth" xml:"IntranetBandwidth"` InternetRX int `json:"InternetRX" xml:"InternetRX"` InternetTX int `json:"InternetTX" xml:"InternetTX"` InternetBandwidth int `json:"InternetBandwidth" xml:"InternetBandwidth"` IOPSRead int `json:"IOPSRead" xml:"IOPSRead"` IOPSWrite int `json:"IOPSWrite" xml:"IOPSWrite"` BPSRead int `json:"BPSRead" xml:"BPSRead"` BPSWrite int `json:"BPSWrite" xml:"BPSWrite"` CPUCreditUsage float64 `json:"CPUCreditUsage" xml:"CPUCreditUsage"` CPUCreditBalance float64 `json:"CPUCreditBalance" xml:"CPUCreditBalance"` CPUAdvanceCreditBalance float64 `json:"CPUAdvanceCreditBalance" xml:"CPUAdvanceCreditBalance"` CPUNotpaidSurplusCreditUsage float64 `json:"CPUNotpaidSurplusCreditUsage" xml:"CPUNotpaidSurplusCreditUsage"` TimeStamp string `json:"TimeStamp" xml:"TimeStamp"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_instance_ram_role_set.go���������������������������������������������������������������������0000664�0000000�0000000�00000001613�13771713062�0034772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceRamRoleSet is a nested struct in ecs response type InstanceRamRoleSet struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` } ���������������������������������������������������������������������������������������������������������������������struct_instance_ram_role_sets_in_describe_instance_ram_role.go��������������������������������������0000664�0000000�0000000�00000001651�13771713062�0043251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceRamRoleSetsInDescribeInstanceRamRole is a nested struct in ecs response type InstanceRamRoleSetsInDescribeInstanceRamRole struct { InstanceRamRoleSet []InstanceRamRoleSet `json:"InstanceRamRoleSet" xml:"InstanceRamRoleSet"` } ���������������������������������������������������������������������������������������struct_instance_ram_role_sets_in_detach_instance_ram_role.go����������������������������������������0000664�0000000�0000000�00000001645�13771713062�0042724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceRamRoleSetsInDetachInstanceRamRole is a nested struct in ecs response type InstanceRamRoleSetsInDetachInstanceRamRole struct { InstanceRamRoleSet []InstanceRamRoleSet `json:"InstanceRamRoleSet" xml:"InstanceRamRoleSet"` } �������������������������������������������������������������������������������������������struct_instance_renew_attribute.go������������������������������������������������������������������0000664�0000000�0000000�00000002143�13771713062�0035521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceRenewAttribute is a nested struct in ecs response type InstanceRenewAttribute struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` AutoRenewEnabled bool `json:"AutoRenewEnabled" xml:"AutoRenewEnabled"` Duration int `json:"Duration" xml:"Duration"` PeriodUnit string `json:"PeriodUnit" xml:"PeriodUnit"` RenewalStatus string `json:"RenewalStatus" xml:"RenewalStatus"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_instance_renew_attributes.go�����������������������������������������������������������������0000664�0000000�0000000�00000001617�13771713062�0035711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceRenewAttributes is a nested struct in ecs response type InstanceRenewAttributes struct { InstanceRenewAttribute []InstanceRenewAttribute `json:"InstanceRenewAttribute" xml:"InstanceRenewAttribute"` } �����������������������������������������������������������������������������������������������������������������struct_instance_status.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001567�13771713062�0033652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceStatus is a nested struct in ecs response type InstanceStatus struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` Status string `json:"Status" xml:"Status"` } �����������������������������������������������������������������������������������������������������������������������������������������struct_instance_statuses.go�������������������������������������������������������������������������0000664�0000000�0000000�00000001541�13771713062�0034172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceStatuses is a nested struct in ecs response type InstanceStatuses struct { InstanceStatus []InstanceStatus `json:"InstanceStatus" xml:"InstanceStatus"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������struct_instance_system_event_set.go�����������������������������������������������������������������0000664�0000000�0000000�00000001621�13771713062�0035716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceSystemEventSet is a nested struct in ecs response type InstanceSystemEventSet struct { InstanceSystemEventType []InstanceSystemEventType `json:"InstanceSystemEventType" xml:"InstanceSystemEventType"` } ���������������������������������������������������������������������������������������������������������������struct_instance_system_event_type.go����������������������������������������������������������������0000664�0000000�0000000�00000002627�13771713062�0036113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceSystemEventType is a nested struct in ecs response type InstanceSystemEventType struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` EventId string `json:"EventId" xml:"EventId"` EventPublishTime string `json:"EventPublishTime" xml:"EventPublishTime"` NotBefore string `json:"NotBefore" xml:"NotBefore"` EventFinishTime string `json:"EventFinishTime" xml:"EventFinishTime"` EventType EventType `json:"EventType" xml:"EventType"` EventCycleStatus EventCycleStatus `json:"EventCycleStatus" xml:"EventCycleStatus"` ExtendedAttribute ExtendedAttribute `json:"ExtendedAttribute" xml:"ExtendedAttribute"` } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_tag.go��0000664�0000000�0000000�00000001527�13771713062�0033155�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceTag is a nested struct in ecs response type InstanceTag struct { Key string `json:"Key" xml:"Key"` Value string `json:"Value" xml:"Value"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_instance_type.go�0000664�0000000�0000000�00000005163�13771713062�0033363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceType is a nested struct in ecs response type InstanceType struct { MemorySize float64 `json:"MemorySize" xml:"MemorySize"` EniPrivateIpAddressQuantity int `json:"EniPrivateIpAddressQuantity" xml:"EniPrivateIpAddressQuantity"` InstancePpsRx int `json:"InstancePpsRx" xml:"InstancePpsRx"` CpuCoreCount int `json:"CpuCoreCount" xml:"CpuCoreCount"` Cores int `json:"Cores" xml:"Cores"` Memory int `json:"Memory" xml:"Memory"` InstanceTypeId string `json:"InstanceTypeId" xml:"InstanceTypeId"` InstanceBandwidthRx int `json:"InstanceBandwidthRx" xml:"InstanceBandwidthRx"` InstanceType string `json:"InstanceType" xml:"InstanceType"` BaselineCredit int `json:"BaselineCredit" xml:"BaselineCredit"` EniQuantity int `json:"EniQuantity" xml:"EniQuantity"` Generation string `json:"Generation" xml:"Generation"` GPUAmount int `json:"GPUAmount" xml:"GPUAmount"` SupportIoOptimized string `json:"SupportIoOptimized" xml:"SupportIoOptimized"` InstanceTypeFamily string `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` InitialCredit int `json:"InitialCredit" xml:"InitialCredit"` InstancePpsTx int `json:"InstancePpsTx" xml:"InstancePpsTx"` LocalStorageAmount int `json:"LocalStorageAmount" xml:"LocalStorageAmount"` InstanceFamilyLevel string `json:"InstanceFamilyLevel" xml:"InstanceFamilyLevel"` LocalStorageCapacity int `json:"LocalStorageCapacity" xml:"LocalStorageCapacity"` GPUSpec string `json:"GPUSpec" xml:"GPUSpec"` LocalStorageCategory string `json:"LocalStorageCategory" xml:"LocalStorageCategory"` InstanceBandwidthTx int `json:"InstanceBandwidthTx" xml:"InstanceBandwidthTx"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_instance_type_families_in_describe_instance_type_families.go���������������������������������0000664�0000000�0000000�00000001665�13771713062�0044304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceTypeFamiliesInDescribeInstanceTypeFamilies is a nested struct in ecs response type InstanceTypeFamiliesInDescribeInstanceTypeFamilies struct { InstanceTypeFamily []InstanceTypeFamily `json:"InstanceTypeFamily" xml:"InstanceTypeFamily"` } ���������������������������������������������������������������������������struct_instance_type_families_in_describe_zones.go��������������������������������������������������0000664�0000000�0000000�00000001646�13771713062�0040723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceTypeFamiliesInDescribeZones is a nested struct in ecs response type InstanceTypeFamiliesInDescribeZones struct { SupportedInstanceTypeFamily []string `json:"supportedInstanceTypeFamily" xml:"supportedInstanceTypeFamily"` } ������������������������������������������������������������������������������������������struct_instance_type_family.go����������������������������������������������������������������������0000664�0000000�0000000�00000001657�13771713062�0034651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceTypeFamily is a nested struct in ecs response type InstanceTypeFamily struct { InstanceTypeFamilyId string `json:"InstanceTypeFamilyId" xml:"InstanceTypeFamilyId"` Generation string `json:"Generation" xml:"Generation"` } ���������������������������������������������������������������������������������struct_instance_types_in_describe_image_support_instance_types.go�����������������������������������0000664�0000000�0000000�00000001631�13771713062�0044057�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceTypesInDescribeImageSupportInstanceTypes is a nested struct in ecs response type InstanceTypesInDescribeImageSupportInstanceTypes struct { InstanceType []InstanceType `json:"InstanceType" xml:"InstanceType"` } �������������������������������������������������������������������������������������������������������struct_instance_types_in_describe_instance_types.go�������������������������������������������������0000664�0000000�0000000�00000001601�13771713062�0041116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceTypesInDescribeInstanceTypes is a nested struct in ecs response type InstanceTypesInDescribeInstanceTypes struct { InstanceType []InstanceType `json:"InstanceType" xml:"InstanceType"` } �������������������������������������������������������������������������������������������������������������������������������struct_instance_types_in_describe_zones.go����������������������������������������������������������0000664�0000000�0000000�00000001606�13771713062�0037231�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstanceTypesInDescribeZones is a nested struct in ecs response type InstanceTypesInDescribeZones struct { SupportedInstanceType []string `json:"supportedInstanceType" xml:"supportedInstanceType"` } ��������������������������������������������������������������������������������������������������������������������������struct_instances_in_describe_dedicated_hosts.go�����������������������������������������������������0000664�0000000�0000000�00000001553�13771713062�0040161�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstancesInDescribeDedicatedHosts is a nested struct in ecs response type InstancesInDescribeDedicatedHosts struct { Instance []Instance `json:"Instance" xml:"Instance"` } �����������������������������������������������������������������������������������������������������������������������������������������������������struct_instances_in_describe_instances.go�����������������������������������������������������������0000664�0000000�0000000�00000001541�13771713062�0037017�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InstancesInDescribeInstances is a nested struct in ecs response type InstancesInDescribeInstances struct { Instance []Instance `json:"Instance" xml:"Instance"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocation.go����0000664�0000000�0000000�00000003211�13771713062�0032657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Invocation is a nested struct in ecs response type Invocation struct { CommandId string `json:"CommandId" xml:"CommandId"` PageNumber int `json:"PageNumber" xml:"PageNumber"` CommandName string `json:"CommandName" xml:"CommandName"` TotalCount int `json:"TotalCount" xml:"TotalCount"` PageSize int `json:"PageSize" xml:"PageSize"` InvokeId string `json:"InvokeId" xml:"InvokeId"` InvokeStatus string `json:"InvokeStatus" xml:"InvokeStatus"` Timed bool `json:"Timed" xml:"Timed"` Frequency string `json:"Frequency" xml:"Frequency"` CommandType string `json:"CommandType" xml:"CommandType"` InvocationResults InvocationResults `json:"InvocationResults" xml:"InvocationResults"` InvokeInstances InvokeInstances `json:"InvokeInstances" xml:"InvokeInstances"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_invocation_result.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002325�13771713062�0034203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InvocationResult is a nested struct in ecs response type InvocationResult struct { CommandId string `json:"CommandId" xml:"CommandId"` InvokeId string `json:"InvokeId" xml:"InvokeId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` FinishedTime string `json:"FinishedTime" xml:"FinishedTime"` Output string `json:"Output" xml:"Output"` InvokeRecordStatus string `json:"InvokeRecordStatus" xml:"InvokeRecordStatus"` ExitCode int `json:"ExitCode" xml:"ExitCode"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_invocation_results.go������������������������������������������������������������������������0000664�0000000�0000000�00000001553�13771713062�0034370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InvocationResults is a nested struct in ecs response type InvocationResults struct { InvocationResult []InvocationResult `json:"InvocationResult" xml:"InvocationResult"` } �����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_invocations.go���0000664�0000000�0000000�00000001507�13771713062�0033050�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Invocations is a nested struct in ecs response type Invocations struct { Invocation []Invocation `json:"Invocation" xml:"Invocation"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_invoke_instance.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001647�13771713062�0033621�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InvokeInstance is a nested struct in ecs response type InvokeInstance struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` InstanceInvokeStatus string `json:"InstanceInvokeStatus" xml:"InstanceInvokeStatus"` } �����������������������������������������������������������������������������������������struct_invoke_instances.go��������������������������������������������������������������������������0000664�0000000�0000000�00000001537�13771713062�0034002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // InvokeInstances is a nested struct in ecs response type InvokeInstances struct { InvokeInstance []InvokeInstance `json:"InvokeInstance" xml:"InvokeInstance"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_set.go������0000664�0000000�0000000�00000001474�13771713062�0032256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Ipv6Set is a nested struct in ecs response type Ipv6Set struct { Ipv6Address string `json:"Ipv6Address" xml:"Ipv6Address"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_ipv6_sets.go�����0000664�0000000�0000000�00000001465�13771713062�0032441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Ipv6Sets is a nested struct in ecs response type Ipv6Sets struct { Ipv6Set []Ipv6Set `json:"Ipv6Set" xml:"Ipv6Set"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pair.go������0000664�0000000�0000000�00000002121�13771713062�0032310�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // KeyPair is a nested struct in ecs response type KeyPair struct { KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` KeyPairFingerPrint string `json:"KeyPairFingerPrint" xml:"KeyPairFingerPrint"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` Tags TagsInDescribeKeyPairs `json:"Tags" xml:"Tags"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_key_pairs.go�����0000664�0000000�0000000�00000001465�13771713062�0032505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // KeyPairs is a nested struct in ecs response type KeyPairs struct { KeyPair []KeyPair `json:"KeyPair" xml:"KeyPair"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_launch_template_data.go����������������������������������������������������������������������0000664�0000000�0000000�00000012141�13771713062�0034567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LaunchTemplateData is a nested struct in ecs response type LaunchTemplateData struct { ImageId string `json:"ImageId" xml:"ImageId"` ImageOwnerAlias string `json:"ImageOwnerAlias" xml:"ImageOwnerAlias"` PasswordInherit bool `json:"PasswordInherit" xml:"PasswordInherit"` InstanceType string `json:"InstanceType" xml:"InstanceType"` SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` VpcId string `json:"VpcId" xml:"VpcId"` VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` InstanceName string `json:"InstanceName" xml:"InstanceName"` Description string `json:"Description" xml:"Description"` InternetMaxBandwidthIn int `json:"InternetMaxBandwidthIn" xml:"InternetMaxBandwidthIn"` InternetMaxBandwidthOut int `json:"InternetMaxBandwidthOut" xml:"InternetMaxBandwidthOut"` HostName string `json:"HostName" xml:"HostName"` ZoneId string `json:"ZoneId" xml:"ZoneId"` SystemDiskSize int `json:"SystemDisk.Size" xml:"SystemDisk.Size"` SystemDiskCategory string `json:"SystemDisk.Category" xml:"SystemDisk.Category"` SystemDiskDiskName string `json:"SystemDisk.DiskName" xml:"SystemDisk.DiskName"` SystemDiskDescription string `json:"SystemDisk.Description" xml:"SystemDisk.Description"` SystemDiskIops int `json:"SystemDisk.Iops" xml:"SystemDisk.Iops"` IoOptimized string `json:"IoOptimized" xml:"IoOptimized"` InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` Period int `json:"Period" xml:"Period"` InternetChargeType string `json:"InternetChargeType" xml:"InternetChargeType"` EnableVmOsConfig bool `json:"EnableVmOsConfig" xml:"EnableVmOsConfig"` NetworkType string `json:"NetworkType" xml:"NetworkType"` UserData string `json:"UserData" xml:"UserData"` KeyPairName string `json:"KeyPairName" xml:"KeyPairName"` RamRoleName string `json:"RamRoleName" xml:"RamRoleName"` AutoReleaseTime string `json:"AutoReleaseTime" xml:"AutoReleaseTime"` SpotStrategy string `json:"SpotStrategy" xml:"SpotStrategy"` SpotPriceLimit float64 `json:"SpotPriceLimit" xml:"SpotPriceLimit"` SpotDuration int `json:"SpotDuration" xml:"SpotDuration"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` SecurityEnhancementStrategy string `json:"SecurityEnhancementStrategy" xml:"SecurityEnhancementStrategy"` DataDisks DataDisks `json:"DataDisks" xml:"DataDisks"` NetworkInterfaces NetworkInterfacesInDescribeLaunchTemplateVersions `json:"NetworkInterfaces" xml:"NetworkInterfaces"` Tags TagsInDescribeLaunchTemplateVersions `json:"Tags" xml:"Tags"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_launch_template_set.go�����������������������������������������������������������������������0000664�0000000�0000000�00000003170�13771713062�0034453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LaunchTemplateSet is a nested struct in ecs response type LaunchTemplateSet struct { CreateTime string `json:"CreateTime" xml:"CreateTime"` ModifiedTime string `json:"ModifiedTime" xml:"ModifiedTime"` LaunchTemplateId string `json:"LaunchTemplateId" xml:"LaunchTemplateId"` LaunchTemplateName string `json:"LaunchTemplateName" xml:"LaunchTemplateName"` DefaultVersionNumber int `json:"DefaultVersionNumber" xml:"DefaultVersionNumber"` LatestVersionNumber int `json:"LatestVersionNumber" xml:"LatestVersionNumber"` CreatedBy string `json:"CreatedBy" xml:"CreatedBy"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` Tags TagsInDescribeLaunchTemplates `json:"Tags" xml:"Tags"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_launch_template_sets.go����������������������������������������������������������������������0000664�0000000�0000000�00000001561�13771713062�0034640�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LaunchTemplateSets is a nested struct in ecs response type LaunchTemplateSets struct { LaunchTemplateSet []LaunchTemplateSet `json:"LaunchTemplateSet" xml:"LaunchTemplateSet"` } �����������������������������������������������������������������������������������������������������������������������������������������������struct_launch_template_version_set.go���������������������������������������������������������������0000664�0000000�0000000�00000003033�13771713062�0036216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LaunchTemplateVersionSet is a nested struct in ecs response type LaunchTemplateVersionSet struct { CreateTime string `json:"CreateTime" xml:"CreateTime"` ModifiedTime string `json:"ModifiedTime" xml:"ModifiedTime"` LaunchTemplateId string `json:"LaunchTemplateId" xml:"LaunchTemplateId"` LaunchTemplateName string `json:"LaunchTemplateName" xml:"LaunchTemplateName"` DefaultVersion bool `json:"DefaultVersion" xml:"DefaultVersion"` VersionNumber int `json:"VersionNumber" xml:"VersionNumber"` VersionDescription string `json:"VersionDescription" xml:"VersionDescription"` CreatedBy string `json:"CreatedBy" xml:"CreatedBy"` LaunchTemplateData LaunchTemplateData `json:"LaunchTemplateData" xml:"LaunchTemplateData"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_launch_template_version_sets.go��������������������������������������������������������������0000664�0000000�0000000�00000001633�13771713062�0036405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LaunchTemplateVersionSets is a nested struct in ecs response type LaunchTemplateVersionSets struct { LaunchTemplateVersionSet []LaunchTemplateVersionSet `json:"LaunchTemplateVersionSet" xml:"LaunchTemplateVersionSet"` } �����������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_link.go����������0000664�0000000�0000000�00000001541�13771713062�0031447�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Link is a nested struct in ecs response type Link struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` VpcId string `json:"VpcId" xml:"VpcId"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_links.go���������0000664�0000000�0000000�00000001443�13771713062�0031633�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Links is a nested struct in ecs response type Links struct { Link []Link `json:"Link" xml:"Link"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_lock_reason.go���0000664�0000000�0000000�00000001561�13771713062�0033013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LockReason is a nested struct in ecs response type LockReason struct { LockReason string `json:"LockReason" xml:"LockReason"` LockMsg string `json:"LockMsg" xml:"LockMsg"` } �����������������������������������������������������������������������������������������������������������������������������������������������struct_monitor_data_in_describe_disk_monitor_data.go������������������������������������������������0000664�0000000�0000000�00000001615�13771713062�0041215�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MonitorDataInDescribeDiskMonitorData is a nested struct in ecs response type MonitorDataInDescribeDiskMonitorData struct { DiskMonitorData []DiskMonitorData `json:"DiskMonitorData" xml:"DiskMonitorData"` } �������������������������������������������������������������������������������������������������������������������struct_monitor_data_in_describe_eni_monitor_data.go�������������������������������������������������0000664�0000000�0000000�00000001607�13771713062�0041037�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MonitorDataInDescribeEniMonitorData is a nested struct in ecs response type MonitorDataInDescribeEniMonitorData struct { EniMonitorData []EniMonitorData `json:"EniMonitorData" xml:"EniMonitorData"` } �������������������������������������������������������������������������������������������������������������������������struct_monitor_data_in_describe_instance_monitor_data.go��������������������������������������������0000664�0000000�0000000�00000001645�13771713062�0042072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MonitorDataInDescribeInstanceMonitorData is a nested struct in ecs response type MonitorDataInDescribeInstanceMonitorData struct { InstanceMonitorData []InstanceMonitorData `json:"InstanceMonitorData" xml:"InstanceMonitorData"` } �������������������������������������������������������������������������������������������struct_monitor_data_in_describe_snapshot_monitor_data.go��������������������������������������������0000664�0000000�0000000�00000001575�13771713062�0042127�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MonitorDataInDescribeSnapshotMonitorData is a nested struct in ecs response type MonitorDataInDescribeSnapshotMonitorData struct { DataPoint []DataPoint `json:"DataPoint" xml:"DataPoint"` } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_mount_instance.go0000664�0000000�0000000�00000001667�13771713062�0033551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MountInstance is a nested struct in ecs response type MountInstance struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` Device string `json:"Device" xml:"Device"` AttachedTime string `json:"AttachedTime" xml:"AttachedTime"` } �������������������������������������������������������������������������struct_mount_instances.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001531�13771713062�0033643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MountInstances is a nested struct in ecs response type MountInstances struct { MountInstance []MountInstance `json:"MountInstance" xml:"MountInstance"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateway.go���0000664�0000000�0000000�00000003673�13771713062�0033025�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NatGateway is a nested struct in ecs response type NatGateway struct { NatGatewayId string `json:"NatGatewayId" xml:"NatGatewayId"` RegionId string `json:"RegionId" xml:"RegionId"` Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` VpcId string `json:"VpcId" xml:"VpcId"` Spec string `json:"Spec" xml:"Spec"` InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` CreationTime string `json:"CreationTime" xml:"CreationTime"` Status string `json:"Status" xml:"Status"` ForwardTableIds ForwardTableIdsInDescribeNatGateways `json:"ForwardTableIds" xml:"ForwardTableIds"` BandwidthPackageIds BandwidthPackageIdsInDescribeNatGateways `json:"BandwidthPackageIds" xml:"BandwidthPackageIds"` } ���������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_nat_gateways.go��0000664�0000000�0000000�00000001507�13771713062�0033202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NatGateways is a nested struct in ecs response type NatGateways struct { NatGateway []NatGateway `json:"NatGateway" xml:"NatGateway"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_network_attributes.go������������������������������������������������������������������������0000664�0000000�0000000�00000001613�13771713062�0034372�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkAttributes is a nested struct in ecs response type NetworkAttributes struct { SlbUdpTimeout int `json:"SlbUdpTimeout" xml:"SlbUdpTimeout"` UdpTimeout int `json:"UdpTimeout" xml:"UdpTimeout"` } ���������������������������������������������������������������������������������������������������������������������struct_network_interface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002433�13771713062�0034145�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkInterface is a nested struct in ecs response type NetworkInterface struct { SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` PrimaryIpAddress string `json:"PrimaryIpAddress" xml:"PrimaryIpAddress"` MacAddress string `json:"MacAddress" xml:"MacAddress"` Description string `json:"Description" xml:"Description"` NetworkInterfaceName string `json:"NetworkInterfaceName" xml:"NetworkInterfaceName"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_network_interface_permission.go��������������������������������������������������������������0000664�0000000�0000000�00000002441�13771713062�0036414�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkInterfacePermission is a nested struct in ecs response type NetworkInterfacePermission struct { Permission string `json:"Permission" xml:"Permission"` AccountId int `json:"AccountId" xml:"AccountId"` NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` ServiceName string `json:"ServiceName" xml:"ServiceName"` NetworkInterfacePermissionId string `json:"NetworkInterfacePermissionId" xml:"NetworkInterfacePermissionId"` PermissionState string `json:"PermissionState" xml:"PermissionState"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_network_interface_permissions.go�������������������������������������������������������������0000664�0000000�0000000�00000001647�13771713062�0036606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkInterfacePermissions is a nested struct in ecs response type NetworkInterfacePermissions struct { NetworkInterfacePermission []NetworkInterfacePermission `json:"NetworkInterfacePermission" xml:"NetworkInterfacePermission"` } �����������������������������������������������������������������������������������������struct_network_interface_set.go���������������������������������������������������������������������0000664�0000000�0000000�00000005525�13771713062�0035025�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkInterfaceSet is a nested struct in ecs response type NetworkInterfaceSet struct { NetworkInterfaceId string `json:"NetworkInterfaceId" xml:"NetworkInterfaceId"` Status string `json:"Status" xml:"Status"` Type string `json:"Type" xml:"Type"` VpcId string `json:"VpcId" xml:"VpcId"` VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` ZoneId string `json:"ZoneId" xml:"ZoneId"` PrivateIpAddress string `json:"PrivateIpAddress" xml:"PrivateIpAddress"` MacAddress string `json:"MacAddress" xml:"MacAddress"` NetworkInterfaceName string `json:"NetworkInterfaceName" xml:"NetworkInterfaceName"` Description string `json:"Description" xml:"Description"` InstanceId string `json:"InstanceId" xml:"InstanceId"` CreationTime string `json:"CreationTime" xml:"CreationTime"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` ServiceID int `json:"ServiceID" xml:"ServiceID"` ServiceManaged bool `json:"ServiceManaged" xml:"ServiceManaged"` SecurityGroupIds SecurityGroupIdsInDescribeNetworkInterfaces `json:"SecurityGroupIds" xml:"SecurityGroupIds"` AssociatedPublicIp AssociatedPublicIp `json:"AssociatedPublicIp" xml:"AssociatedPublicIp"` PrivateIpSets PrivateIpSets `json:"PrivateIpSets" xml:"PrivateIpSets"` Ipv6Sets Ipv6Sets `json:"Ipv6Sets" xml:"Ipv6Sets"` Tags TagsInDescribeNetworkInterfaces `json:"Tags" xml:"Tags"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_network_interface_sets.go��������������������������������������������������������������������0000664�0000000�0000000�00000001575�13771713062�0035211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkInterfaceSets is a nested struct in ecs response type NetworkInterfaceSets struct { NetworkInterfaceSet []NetworkInterfaceSet `json:"NetworkInterfaceSet" xml:"NetworkInterfaceSet"` } �����������������������������������������������������������������������������������������������������������������������������������struct_network_interfaces_in_describe_instances.go��������������������������������������������������0000664�0000000�0000000�00000001621�13771713062�0040723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkInterfacesInDescribeInstances is a nested struct in ecs response type NetworkInterfacesInDescribeInstances struct { NetworkInterface []NetworkInterface `json:"NetworkInterface" xml:"NetworkInterface"` } ���������������������������������������������������������������������������������������������������������������struct_network_interfaces_in_describe_launch_template_versions.go�����������������������������������0000664�0000000�0000000�00000001653�13771713062�0044036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkInterfacesInDescribeLaunchTemplateVersions is a nested struct in ecs response type NetworkInterfacesInDescribeLaunchTemplateVersions struct { NetworkInterface []NetworkInterface `json:"NetworkInterface" xml:"NetworkInterface"` } �������������������������������������������������������������������������������������struct_network_types_in_describe_recommend_instance_type.go�����������������������������������������0000664�0000000�0000000�00000001606�13771713062�0042656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkTypesInDescribeRecommendInstanceType is a nested struct in ecs response type NetworkTypesInDescribeRecommendInstanceType struct { NetworkType []string `json:"NetworkType" xml:"NetworkType"` } ��������������������������������������������������������������������������������������������������������������������������struct_network_types_in_describe_zones.go�����������������������������������������������������������0000664�0000000�0000000�00000001615�13771713062�0037116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NetworkTypesInDescribeZones is a nested struct in ecs response type NetworkTypesInDescribeZones struct { SupportedNetworkCategory []string `json:"supportedNetworkCategory" xml:"supportedNetworkCategory"` } �������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hop.go������0000664�0000000�0000000�00000001727�13771713062�0032344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NextHop is a nested struct in ecs response type NextHop struct { NextHopType string `json:"NextHopType" xml:"NextHopType"` NextHopId string `json:"NextHopId" xml:"NextHopId"` Enabled int `json:"Enabled" xml:"Enabled"` Weight int `json:"Weight" xml:"Weight"` } �����������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_next_hops.go�����0000664�0000000�0000000�00000001465�13771713062�0032526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // NextHops is a nested struct in ecs response type NextHops struct { NextHop []NextHop `json:"NextHop" xml:"NextHop"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_operation_lock.go0000664�0000000�0000000�00000001505�13771713062�0033522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationLock is a nested struct in ecs response type OperationLock struct { LockReason string `json:"LockReason" xml:"LockReason"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_operation_locks_in_describe_dedicated_hosts.go�����������������������������������������������0000664�0000000�0000000�00000001611�13771713062�0041360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationLocksInDescribeDedicatedHosts is a nested struct in ecs response type OperationLocksInDescribeDedicatedHosts struct { OperationLock []OperationLock `json:"OperationLock" xml:"OperationLock"` } �����������������������������������������������������������������������������������������������������������������������struct_operation_locks_in_describe_disks.go���������������������������������������������������������0000664�0000000�0000000�00000001567�13771713062�0037361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationLocksInDescribeDisks is a nested struct in ecs response type OperationLocksInDescribeDisks struct { OperationLock []OperationLock `json:"OperationLock" xml:"OperationLock"` } �����������������������������������������������������������������������������������������������������������������������������������������struct_operation_locks_in_describe_eip_addresses.go�������������������������������������������������0000664�0000000�0000000�00000001571�13771713062�0041051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationLocksInDescribeEipAddresses is a nested struct in ecs response type OperationLocksInDescribeEipAddresses struct { LockReason []LockReason `json:"LockReason" xml:"LockReason"` } ���������������������������������������������������������������������������������������������������������������������������������������struct_operation_locks_in_describe_instance_attribute.go��������������������������������������������0000664�0000000�0000000�00000001603�13771713062�0042122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationLocksInDescribeInstanceAttribute is a nested struct in ecs response type OperationLocksInDescribeInstanceAttribute struct { LockReason []LockReason `json:"LockReason" xml:"LockReason"` } �����������������������������������������������������������������������������������������������������������������������������struct_operation_locks_in_describe_instances.go�����������������������������������������������������0000664�0000000�0000000�00000001563�13771713062�0040227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationLocksInDescribeInstances is a nested struct in ecs response type OperationLocksInDescribeInstances struct { LockReason []LockReason `json:"LockReason" xml:"LockReason"` } ���������������������������������������������������������������������������������������������������������������������������������������������struct_operation_locks_in_describe_reserved_instances.go��������������������������������������������0000664�0000000�0000000�00000001617�13771713062�0042126�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationLocksInDescribeReservedInstances is a nested struct in ecs response type OperationLocksInDescribeReservedInstances struct { OperationLock []OperationLock `json:"OperationLock" xml:"OperationLock"` } �����������������������������������������������������������������������������������������������������������������struct_operation_progress.go������������������������������������������������������������������������0000664�0000000�0000000�00000002065�13771713062�0034361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationProgress is a nested struct in ecs response type OperationProgress struct { OperationStatus string `json:"OperationStatus" xml:"OperationStatus"` ErrorCode string `json:"ErrorCode" xml:"ErrorCode"` ErrorMsg string `json:"ErrorMsg" xml:"ErrorMsg"` RelatedItemSet RelatedItemSet `json:"RelatedItemSet" xml:"RelatedItemSet"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_operation_progress_set.go��������������������������������������������������������������������0000664�0000000�0000000�00000001565�13771713062�0035240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // OperationProgressSet is a nested struct in ecs response type OperationProgressSet struct { OperationProgress []OperationProgress `json:"OperationProgress" xml:"OperationProgress"` } �������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permission.go����0000664�0000000�0000000�00000004174�13771713062�0032707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Permission is a nested struct in ecs response type Permission struct { IpProtocol string `json:"IpProtocol" xml:"IpProtocol"` PortRange string `json:"PortRange" xml:"PortRange"` SourcePortRange string `json:"SourcePortRange" xml:"SourcePortRange"` SourceGroupId string `json:"SourceGroupId" xml:"SourceGroupId"` SourceGroupName string `json:"SourceGroupName" xml:"SourceGroupName"` SourceCidrIp string `json:"SourceCidrIp" xml:"SourceCidrIp"` Ipv6SourceCidrIp string `json:"Ipv6SourceCidrIp" xml:"Ipv6SourceCidrIp"` Policy string `json:"Policy" xml:"Policy"` NicType string `json:"NicType" xml:"NicType"` SourceGroupOwnerAccount string `json:"SourceGroupOwnerAccount" xml:"SourceGroupOwnerAccount"` DestGroupId string `json:"DestGroupId" xml:"DestGroupId"` DestGroupName string `json:"DestGroupName" xml:"DestGroupName"` DestCidrIp string `json:"DestCidrIp" xml:"DestCidrIp"` Ipv6DestCidrIp string `json:"Ipv6DestCidrIp" xml:"Ipv6DestCidrIp"` DestGroupOwnerAccount string `json:"DestGroupOwnerAccount" xml:"DestGroupOwnerAccount"` Priority string `json:"Priority" xml:"Priority"` Direction string `json:"Direction" xml:"Direction"` Description string `json:"Description" xml:"Description"` CreateTime string `json:"CreateTime" xml:"CreateTime"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_permissions.go���0000664�0000000�0000000�00000001507�13771713062�0033067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Permissions is a nested struct in ecs response type Permissions struct { Permission []Permission `json:"Permission" xml:"Permission"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_physical_connection_set.go�������������������������������������������������������������������0000664�0000000�0000000�00000001613�13771713062�0035341�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PhysicalConnectionSet is a nested struct in ecs response type PhysicalConnectionSet struct { PhysicalConnectionType []PhysicalConnectionType `json:"PhysicalConnectionType" xml:"PhysicalConnectionType"` } ���������������������������������������������������������������������������������������������������������������������struct_physical_connection_type.go������������������������������������������������������������������0000664�0000000�0000000�00000004215�13771713062�0035530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PhysicalConnectionType is a nested struct in ecs response type PhysicalConnectionType struct { PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` Type string `json:"Type" xml:"Type"` Status string `json:"Status" xml:"Status"` BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` CreationTime string `json:"CreationTime" xml:"CreationTime"` EnabledTime string `json:"EnabledTime" xml:"EnabledTime"` LineOperator string `json:"LineOperator" xml:"LineOperator"` Spec string `json:"Spec" xml:"Spec"` PeerLocation string `json:"PeerLocation" xml:"PeerLocation"` PortType string `json:"PortType" xml:"PortType"` RedundantPhysicalConnectionId string `json:"RedundantPhysicalConnectionId" xml:"RedundantPhysicalConnectionId"` Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` AdLocation string `json:"AdLocation" xml:"AdLocation"` PortNumber string `json:"PortNumber" xml:"PortNumber"` CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` Bandwidth int `json:"Bandwidth" xml:"Bandwidth"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price.go���������0000664�0000000�0000000�00000002265�13771713062�0031620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Price is a nested struct in ecs response type Price struct { DiscountPrice float64 `json:"DiscountPrice" xml:"DiscountPrice"` TradePrice float64 `json:"TradePrice" xml:"TradePrice"` OriginalPrice float64 `json:"OriginalPrice" xml:"OriginalPrice"` Currency string `json:"Currency" xml:"Currency"` DetailInfos DetailInfosInDescribeRenewalPrice `json:"DetailInfos" xml:"DetailInfos"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_price_info.go����0000664�0000000�0000000�00000001601�13771713062�0032624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PriceInfo is a nested struct in ecs response type PriceInfo struct { Price Price `json:"Price" xml:"Price"` Rules RulesInDescribeRenewalPrice `json:"Rules" xml:"Rules"` } �������������������������������������������������������������������������������������������������������������������������������struct_private_ip_address_in_describe_instance_attribute.go�����������������������������������������0000664�0000000�0000000�00000001600�13771713062�0042573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PrivateIpAddressInDescribeInstanceAttribute is a nested struct in ecs response type PrivateIpAddressInDescribeInstanceAttribute struct { IpAddress []string `json:"IpAddress" xml:"IpAddress"` } ��������������������������������������������������������������������������������������������������������������������������������struct_private_ip_address_in_describe_instances.go��������������������������������������������������0000664�0000000�0000000�00000001560�13771713062�0040700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PrivateIpAddressInDescribeInstances is a nested struct in ecs response type PrivateIpAddressInDescribeInstances struct { IpAddress []string `json:"IpAddress" xml:"IpAddress"` } ������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_private_ip_set.go0000664�0000000�0000000�00000002005�13771713062�0033523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PrivateIpSet is a nested struct in ecs response type PrivateIpSet struct { PrivateIpAddress string `json:"PrivateIpAddress" xml:"PrivateIpAddress"` Primary bool `json:"Primary" xml:"Primary"` AssociatedPublicIp AssociatedPublicIp `json:"AssociatedPublicIp" xml:"AssociatedPublicIp"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_private_ip_sets.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001523�13771713062�0033633�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PrivateIpSets is a nested struct in ecs response type PrivateIpSets struct { PrivateIpSet []PrivateIpSet `json:"PrivateIpSet" xml:"PrivateIpSet"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_public_ip_address_in_describe_instance_attribute.go������������������������������������������0000664�0000000�0000000�00000001576�13771713062�0042413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PublicIpAddressInDescribeInstanceAttribute is a nested struct in ecs response type PublicIpAddressInDescribeInstanceAttribute struct { IpAddress []string `json:"IpAddress" xml:"IpAddress"` } ����������������������������������������������������������������������������������������������������������������������������������struct_public_ip_address_in_describe_instances.go���������������������������������������������������0000664�0000000�0000000�00000001556�13771713062�0040511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PublicIpAddressInDescribeInstances is a nested struct in ecs response type PublicIpAddressInDescribeInstances struct { IpAddress []string `json:"IpAddress" xml:"IpAddress"` } ��������������������������������������������������������������������������������������������������������������������������������������������������struct_public_ip_addresse.go������������������������������������������������������������������������0000664�0000000�0000000�00000001611�13771713062�0034251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PublicIpAddresse is a nested struct in ecs response type PublicIpAddresse struct { AllocationId string `json:"AllocationId" xml:"AllocationId"` IpAddress string `json:"IpAddress" xml:"IpAddress"` } �����������������������������������������������������������������������������������������������������������������������struct_public_ip_addresses.go�����������������������������������������������������������������������0000664�0000000�0000000�00000001553�13771713062�0034441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PublicIpAddresses is a nested struct in ecs response type PublicIpAddresses struct { PublicIpAddresse []PublicIpAddresse `json:"PublicIpAddresse" xml:"PublicIpAddresse"` } �����������������������������������������������������������������������������������������������������������������������������������������������������struct_rdma_ip_address.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001504�13771713062�0033552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RdmaIpAddress is a nested struct in ecs response type RdmaIpAddress struct { IpAddress []string `json:"IpAddress" xml:"IpAddress"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_recommend_instance_type.go�������������������������������������������������������������������0000664�0000000�0000000�00000002314�13771713062�0035330�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RecommendInstanceType is a nested struct in ecs response type RecommendInstanceType struct { RegionNo string `json:"RegionNo" xml:"RegionNo"` CommodityCode string `json:"CommodityCode" xml:"CommodityCode"` Scene string `json:"Scene" xml:"Scene"` InstanceType InstanceType `json:"InstanceType" xml:"InstanceType"` Zones ZonesInDescribeRecommendInstanceType `json:"Zones" xml:"Zones"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_referencing_security_group.go����������������������������������������������������������������0000664�0000000�0000000�00000001637�13771713062�0036073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ReferencingSecurityGroup is a nested struct in ecs response type ReferencingSecurityGroup struct { AliUid string `json:"AliUid" xml:"AliUid"` SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` } �������������������������������������������������������������������������������������������������struct_referencing_security_groups.go���������������������������������������������������������������0000664�0000000�0000000�00000001633�13771713062�0036252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ReferencingSecurityGroups is a nested struct in ecs response type ReferencingSecurityGroups struct { ReferencingSecurityGroup []ReferencingSecurityGroup `json:"ReferencingSecurityGroup" xml:"ReferencingSecurityGroup"` } �����������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_region.go��������0000664�0000000�0000000�00000001751�13771713062�0032000�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Region is a nested struct in ecs response type Region struct { RegionId string `json:"RegionId" xml:"RegionId"` LocalName string `json:"LocalName" xml:"LocalName"` RegionEndpoint string `json:"RegionEndpoint" xml:"RegionEndpoint"` Status string `json:"Status" xml:"Status"` } �����������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_regions.go�������0000664�0000000�0000000�00000001457�13771713062�0032166�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Regions is a nested struct in ecs response type Regions struct { Region []Region `json:"Region" xml:"Region"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_related_item.go��0000664�0000000�0000000�00000001531�13771713062�0033147�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RelatedItem is a nested struct in ecs response type RelatedItem struct { Name string `json:"Name" xml:"Name"` Value string `json:"Value" xml:"Value"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_related_item_set.go��������������������������������������������������������������������������0000664�0000000�0000000�00000001521�13771713062�0033742�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RelatedItemSet is a nested struct in ecs response type RelatedItemSet struct { RelatedItem []RelatedItem `json:"RelatedItem" xml:"RelatedItem"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_reserved_instance.go�������������������������������������������������������������������������0000664�0000000�0000000�00000004454�13771713062�0034144�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ReservedInstance is a nested struct in ecs response type ReservedInstance struct { ReservedInstanceId string `json:"ReservedInstanceId" xml:"ReservedInstanceId"` RegionId string `json:"RegionId" xml:"RegionId"` ZoneId string `json:"ZoneId" xml:"ZoneId"` ReservedInstanceName string `json:"ReservedInstanceName" xml:"ReservedInstanceName"` Description string `json:"Description" xml:"Description"` InstanceType string `json:"InstanceType" xml:"InstanceType"` Scope string `json:"Scope" xml:"Scope"` OfferingType string `json:"OfferingType" xml:"OfferingType"` InstanceAmount int `json:"InstanceAmount" xml:"InstanceAmount"` Status string `json:"Status" xml:"Status"` CreationTime string `json:"CreationTime" xml:"CreationTime"` ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` StartTime string `json:"StartTime" xml:"StartTime"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` OperationLocks OperationLocksInDescribeReservedInstances `json:"OperationLocks" xml:"OperationLocks"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_reserved_instance_id_sets_in_modify_reserved_instances.go������������������������������������0000664�0000000�0000000�00000001643�13771713062�0043656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ReservedInstanceIdSetsInModifyReservedInstances is a nested struct in ecs response type ReservedInstanceIdSetsInModifyReservedInstances struct { ReservedInstanceId []string `json:"ReservedInstanceId" xml:"ReservedInstanceId"` } ���������������������������������������������������������������������������������������������struct_reserved_instance_id_sets_in_purchase_reserved_instances_offering.go�������������������������0000664�0000000�0000000�00000001667�13771713062�0046066�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ReservedInstanceIdSetsInPurchaseReservedInstancesOffering is a nested struct in ecs response type ReservedInstanceIdSetsInPurchaseReservedInstancesOffering struct { ReservedInstanceId []string `json:"ReservedInstanceId" xml:"ReservedInstanceId"` } �������������������������������������������������������������������������struct_reserved_instances.go������������������������������������������������������������������������0000664�0000000�0000000�00000001553�13771713062�0034324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ReservedInstances is a nested struct in ecs response type ReservedInstances struct { ReservedInstance []ReservedInstance `json:"ReservedInstance" xml:"ReservedInstance"` } �����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resource.go������0000664�0000000�0000000�00000001661�13771713062�0032344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Resource is a nested struct in ecs response type Resource struct { ResourceId string `json:"ResourceId" xml:"ResourceId"` ResourceType string `json:"ResourceType" xml:"ResourceType"` RegionId string `json:"RegionId" xml:"RegionId"` } �������������������������������������������������������������������������������struct_resource_price_model.go����������������������������������������������������������������������0000664�0000000�0000000�00000002272�13771713062�0034626�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ResourcePriceModel is a nested struct in ecs response type ResourcePriceModel struct { DiscountPrice float64 `json:"DiscountPrice" xml:"DiscountPrice"` TradePrice float64 `json:"TradePrice" xml:"TradePrice"` OriginalPrice float64 `json:"OriginalPrice" xml:"OriginalPrice"` Resource string `json:"Resource" xml:"Resource"` SubRules SubRulesInDescribeRenewalPrice `json:"SubRules" xml:"SubRules"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_resource_type_count.go�����������������������������������������������������������������������0000664�0000000�0000000�00000002425�13771713062�0034535�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ResourceTypeCount is a nested struct in ecs response type ResourceTypeCount struct { Instance int `json:"Instance" xml:"Instance"` Disk int `json:"Disk" xml:"Disk"` Volume int `json:"Volume" xml:"Volume"` Image int `json:"Image" xml:"Image"` Snapshot int `json:"Snapshot" xml:"Snapshot"` Securitygroup int `json:"Securitygroup" xml:"Securitygroup"` LaunchTemplate int `json:"LaunchTemplate" xml:"LaunchTemplate"` Eni int `json:"Eni" xml:"Eni"` Ddh int `json:"Ddh" xml:"Ddh"` KeyPair int `json:"KeyPair" xml:"KeyPair"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources.go�����0000664�0000000�0000000�00000001473�13771713062�0032530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Resources is a nested struct in ecs response type Resources struct { Resource []Resource `json:"Resource" xml:"Resource"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_resources_info.go0000664�0000000�0000000�00000002774�13771713062�0033550�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ResourcesInfo is a nested struct in ecs response type ResourcesInfo struct { IoOptimized bool `json:"IoOptimized" xml:"IoOptimized"` SystemDiskCategories SystemDiskCategories `json:"SystemDiskCategories" xml:"SystemDiskCategories"` DataDiskCategories DataDiskCategories `json:"DataDiskCategories" xml:"DataDiskCategories"` NetworkTypes NetworkTypesInDescribeZones `json:"NetworkTypes" xml:"NetworkTypes"` InstanceTypes InstanceTypesInDescribeZones `json:"InstanceTypes" xml:"InstanceTypes"` InstanceTypeFamilies InstanceTypeFamiliesInDescribeZones `json:"InstanceTypeFamilies" xml:"InstanceTypeFamilies"` InstanceGenerations InstanceGenerations `json:"InstanceGenerations" xml:"InstanceGenerations"` } ����packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_result.go��������0000664�0000000�0000000�00000001707�13771713062�0032034�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Result is a nested struct in ecs response type Result struct { Message string `json:"Message" xml:"Message"` Success string `json:"Success" xml:"Success"` Code string `json:"Code" xml:"Code"` InstanceId string `json:"InstanceId" xml:"InstanceId"` } ���������������������������������������������������������struct_results_in_attach_key_pair.go����������������������������������������������������������������0000664�0000000�0000000�00000001515�13771713062�0036032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ResultsInAttachKeyPair is a nested struct in ecs response type ResultsInAttachKeyPair struct { Result []Result `json:"Result" xml:"Result"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_results_in_detach_key_pair.go����������������������������������������������������������������0000664�0000000�0000000�00000001515�13771713062�0036016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ResultsInDetachKeyPair is a nested struct in ecs response type ResultsInDetachKeyPair struct { Result []Result `json:"Result" xml:"Result"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entry.go���0000664�0000000�0000000�00000002345�13771713062�0033074�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RouteEntry is a nested struct in ecs response type RouteEntry struct { RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` DestinationCidrBlock string `json:"DestinationCidrBlock" xml:"DestinationCidrBlock"` Type string `json:"Type" xml:"Type"` Status string `json:"Status" xml:"Status"` InstanceId string `json:"InstanceId" xml:"InstanceId"` NextHopType string `json:"NextHopType" xml:"NextHopType"` NextHops NextHops `json:"NextHops" xml:"NextHops"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_entrys.go��0000664�0000000�0000000�00000001507�13771713062�0033256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RouteEntrys is a nested struct in ecs response type RouteEntrys struct { RouteEntry []RouteEntry `json:"RouteEntry" xml:"RouteEntry"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_table.go���0000664�0000000�0000000�00000002255�13771713062�0033022�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RouteTable is a nested struct in ecs response type RouteTable struct { VRouterId string `json:"VRouterId" xml:"VRouterId"` RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` RouteTableType string `json:"RouteTableType" xml:"RouteTableType"` CreationTime string `json:"CreationTime" xml:"CreationTime"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` RouteEntrys RouteEntrys `json:"RouteEntrys" xml:"RouteEntrys"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_route_table_ids.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001515�13771713062�0033600�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RouteTableIds is a nested struct in ecs response type RouteTableIds struct { RouteTableId []string `json:"RouteTableId" xml:"RouteTableId"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_route_tables.go��0000664�0000000�0000000�00000001507�13771713062�0033204�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RouteTables is a nested struct in ecs response type RouteTables struct { RouteTable []RouteTable `json:"RouteTable" xml:"RouteTable"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_router_interface_set.go����������������������������������������������������������������������0000664�0000000�0000000�00000001571�13771713062�0034651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RouterInterfaceSet is a nested struct in ecs response type RouterInterfaceSet struct { RouterInterfaceType []RouterInterfaceType `json:"RouterInterfaceType" xml:"RouterInterfaceType"` } ���������������������������������������������������������������������������������������������������������������������������������������struct_router_interface_type.go���������������������������������������������������������������������0000664�0000000�0000000�00000005572�13771713062�0035044�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RouterInterfaceType is a nested struct in ecs response type RouterInterfaceType struct { RouterInterfaceId string `json:"RouterInterfaceId" xml:"RouterInterfaceId"` OppositeRegionId string `json:"OppositeRegionId" xml:"OppositeRegionId"` Role string `json:"Role" xml:"Role"` Spec string `json:"Spec" xml:"Spec"` Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` RouterId string `json:"RouterId" xml:"RouterId"` RouterType string `json:"RouterType" xml:"RouterType"` CreationTime string `json:"CreationTime" xml:"CreationTime"` EndTime string `json:"EndTime" xml:"EndTime"` ChargeType string `json:"ChargeType" xml:"ChargeType"` Status string `json:"Status" xml:"Status"` BusinessStatus string `json:"BusinessStatus" xml:"BusinessStatus"` ConnectedTime string `json:"ConnectedTime" xml:"ConnectedTime"` OppositeInterfaceId string `json:"OppositeInterfaceId" xml:"OppositeInterfaceId"` OppositeInterfaceSpec string `json:"OppositeInterfaceSpec" xml:"OppositeInterfaceSpec"` OppositeInterfaceStatus string `json:"OppositeInterfaceStatus" xml:"OppositeInterfaceStatus"` OppositeInterfaceBusinessStatus string `json:"OppositeInterfaceBusinessStatus" xml:"OppositeInterfaceBusinessStatus"` OppositeRouterId string `json:"OppositeRouterId" xml:"OppositeRouterId"` OppositeRouterType string `json:"OppositeRouterType" xml:"OppositeRouterType"` OppositeInterfaceOwnerId string `json:"OppositeInterfaceOwnerId" xml:"OppositeInterfaceOwnerId"` AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` OppositeAccessPointId string `json:"OppositeAccessPointId" xml:"OppositeAccessPointId"` HealthCheckSourceIp string `json:"HealthCheckSourceIp" xml:"HealthCheckSourceIp"` HealthCheckTargetIp string `json:"HealthCheckTargetIp" xml:"HealthCheckTargetIp"` } ��������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_rule.go����������0000664�0000000�0000000�00000001547�13771713062�0031467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Rule is a nested struct in ecs response type Rule struct { RuleId int `json:"RuleId" xml:"RuleId"` Description string `json:"Description" xml:"Description"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������struct_rules_in_describe_price.go�������������������������������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0035271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RulesInDescribePrice is a nested struct in ecs response type RulesInDescribePrice struct { Rule []Rule `json:"Rule" xml:"Rule"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_rules_in_describe_renewal_price.go�����������������������������������������������������������0000664�0000000�0000000�00000001517�13771713062�0037015�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RulesInDescribeRenewalPrice is a nested struct in ecs response type RulesInDescribeRenewalPrice struct { Rule []Rule `json:"Rule" xml:"Rule"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_scheduled_system_event_set.go����������������������������������������������������������������0000664�0000000�0000000�00000001627�13771713062�0036060�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ScheduledSystemEventSet is a nested struct in ecs response type ScheduledSystemEventSet struct { ScheduledSystemEventType []ScheduledSystemEventType `json:"ScheduledSystemEventType" xml:"ScheduledSystemEventType"` } ���������������������������������������������������������������������������������������������������������struct_scheduled_system_event_type.go���������������������������������������������������������������0000664�0000000�0000000�00000002373�13771713062�0036245�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ScheduledSystemEventType is a nested struct in ecs response type ScheduledSystemEventType struct { EventId string `json:"EventId" xml:"EventId"` EventPublishTime string `json:"EventPublishTime" xml:"EventPublishTime"` NotBefore string `json:"NotBefore" xml:"NotBefore"` EventCycleStatus EventCycleStatus `json:"EventCycleStatus" xml:"EventCycleStatus"` EventType EventType `json:"EventType" xml:"EventType"` ExtendedAttribute ExtendedAttribute `json:"ExtendedAttribute" xml:"ExtendedAttribute"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_security_group.go0000664�0000000�0000000�00000003150�13771713062�0033573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityGroup is a nested struct in ecs response type SecurityGroup struct { SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` Description string `json:"Description" xml:"Description"` SecurityGroupName string `json:"SecurityGroupName" xml:"SecurityGroupName"` VpcId string `json:"VpcId" xml:"VpcId"` CreationTime string `json:"CreationTime" xml:"CreationTime"` AvailableInstanceAmount int `json:"AvailableInstanceAmount" xml:"AvailableInstanceAmount"` EcsCount int `json:"EcsCount" xml:"EcsCount"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` Tags TagsInDescribeSecurityGroups `json:"Tags" xml:"Tags"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_security_group_ids_in_describe_instance_attribute.go�����������������������������������������0000664�0000000�0000000�00000001622�13771713062�0042652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityGroupIdsInDescribeInstanceAttribute is a nested struct in ecs response type SecurityGroupIdsInDescribeInstanceAttribute struct { SecurityGroupId []string `json:"SecurityGroupId" xml:"SecurityGroupId"` } ��������������������������������������������������������������������������������������������������������������struct_security_group_ids_in_describe_instances.go��������������������������������������������������0000664�0000000�0000000�00000001602�13771713062�0040750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityGroupIdsInDescribeInstances is a nested struct in ecs response type SecurityGroupIdsInDescribeInstances struct { SecurityGroupId []string `json:"SecurityGroupId" xml:"SecurityGroupId"` } ������������������������������������������������������������������������������������������������������������������������������struct_security_group_ids_in_describe_network_interfaces.go�����������������������������������������0000664�0000000�0000000�00000001622�13771713062�0042657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityGroupIdsInDescribeNetworkInterfaces is a nested struct in ecs response type SecurityGroupIdsInDescribeNetworkInterfaces struct { SecurityGroupId []string `json:"SecurityGroupId" xml:"SecurityGroupId"` } ��������������������������������������������������������������������������������������������������������������struct_security_group_reference.go������������������������������������������������������������������0000664�0000000�0000000�00000001773�13771713062�0035543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityGroupReference is a nested struct in ecs response type SecurityGroupReference struct { SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"` ReferencingSecurityGroups ReferencingSecurityGroups `json:"ReferencingSecurityGroups" xml:"ReferencingSecurityGroups"` } �����struct_security_group_references.go�����������������������������������������������������������������0000664�0000000�0000000�00000001617�13771713062�0035723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityGroupReferences is a nested struct in ecs response type SecurityGroupReferences struct { SecurityGroupReference []SecurityGroupReference `json:"SecurityGroupReference" xml:"SecurityGroupReference"` } �����������������������������������������������������������������������������������������������������������������struct_security_groups.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001531�13771713062�0033700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityGroups is a nested struct in ecs response type SecurityGroups struct { SecurityGroup []SecurityGroup `json:"SecurityGroup" xml:"SecurityGroup"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_group.go���0000664�0000000�0000000�00000001460�13771713062�0033030�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ShareGroup is a nested struct in ecs response type ShareGroup struct { Group string `json:"Group" xml:"Group"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_share_groups.go��0000664�0000000�0000000�00000001507�13771713062�0033215�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ShareGroups is a nested struct in ecs response type ShareGroups struct { ShareGroup []ShareGroup `json:"ShareGroup" xml:"ShareGroup"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot.go������0000664�0000000�0000000�00000004271�13771713062�0032354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Snapshot is a nested struct in ecs response type Snapshot struct { SnapshotId string `json:"SnapshotId" xml:"SnapshotId"` SnapshotName string `json:"SnapshotName" xml:"SnapshotName"` Progress string `json:"Progress" xml:"Progress"` ProductCode string `json:"ProductCode" xml:"ProductCode"` SourceDiskId string `json:"SourceDiskId" xml:"SourceDiskId"` SourceDiskType string `json:"SourceDiskType" xml:"SourceDiskType"` RetentionDays int `json:"RetentionDays" xml:"RetentionDays"` Encrypted bool `json:"Encrypted" xml:"Encrypted"` SourceDiskSize string `json:"SourceDiskSize" xml:"SourceDiskSize"` Description string `json:"Description" xml:"Description"` CreationTime string `json:"CreationTime" xml:"CreationTime"` Status string `json:"Status" xml:"Status"` Usage string `json:"Usage" xml:"Usage"` SourceStorageType string `json:"SourceStorageType" xml:"SourceStorageType"` RemainTime int `json:"RemainTime" xml:"RemainTime"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` KMSKeyId string `json:"KMSKeyId" xml:"KMSKeyId"` Tags TagsInDescribeSnapshots `json:"Tags" xml:"Tags"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_link.go�0000664�0000000�0000000�00000002605�13771713062�0033370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SnapshotLink is a nested struct in ecs response type SnapshotLink struct { SnapshotLinkId string `json:"SnapshotLinkId" xml:"SnapshotLinkId"` RegionId string `json:"RegionId" xml:"RegionId"` InstanceId string `json:"InstanceId" xml:"InstanceId"` InstanceName string `json:"InstanceName" xml:"InstanceName"` SourceDiskId string `json:"SourceDiskId" xml:"SourceDiskId"` SourceDiskName string `json:"SourceDiskName" xml:"SourceDiskName"` SourceDiskSize int `json:"SourceDiskSize" xml:"SourceDiskSize"` SourceDiskType string `json:"SourceDiskType" xml:"SourceDiskType"` TotalSize int `json:"TotalSize" xml:"TotalSize"` TotalCount int `json:"TotalCount" xml:"TotalCount"` } ���������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshot_links.go0000664�0000000�0000000�00000001523�13771713062�0033551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SnapshotLinks is a nested struct in ecs response type SnapshotLinks struct { SnapshotLink []SnapshotLink `json:"SnapshotLink" xml:"SnapshotLink"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_snapshot_package.go��������������������������������������������������������������������������0000664�0000000�0000000�00000001767�13771713062�0033757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SnapshotPackage is a nested struct in ecs response type SnapshotPackage struct { StartTime string `json:"StartTime" xml:"StartTime"` EndTime string `json:"EndTime" xml:"EndTime"` InitCapacity int `json:"InitCapacity" xml:"InitCapacity"` DisplayName string `json:"DisplayName" xml:"DisplayName"` } ���������struct_snapshot_packages.go�������������������������������������������������������������������������0000664�0000000�0000000�00000001545�13771713062�0034134�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SnapshotPackages is a nested struct in ecs response type SnapshotPackages struct { SnapshotPackage []SnapshotPackage `json:"SnapshotPackage" xml:"SnapshotPackage"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_snapshots.go�����0000664�0000000�0000000�00000001473�13771713062�0032540�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Snapshots is a nested struct in ecs response type Snapshots struct { Snapshot []Snapshot `json:"Snapshot" xml:"Snapshot"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_spot_price_type.go���������������������������������������������������������������������������0000664�0000000�0000000�00000002250�13771713062�0033641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SpotPriceType is a nested struct in ecs response type SpotPriceType struct { ZoneId string `json:"ZoneId" xml:"ZoneId"` InstanceType string `json:"InstanceType" xml:"InstanceType"` IoOptimized string `json:"IoOptimized" xml:"IoOptimized"` Timestamp string `json:"Timestamp" xml:"Timestamp"` NetworkType string `json:"NetworkType" xml:"NetworkType"` SpotPrice float64 `json:"SpotPrice" xml:"SpotPrice"` OriginPrice float64 `json:"OriginPrice" xml:"OriginPrice"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_spot_prices.go���0000664�0000000�0000000�00000001521�13771713062�0033042�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SpotPrices is a nested struct in ecs response type SpotPrices struct { SpotPriceType []SpotPriceType `json:"SpotPriceType" xml:"SpotPriceType"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_status.go��������0000664�0000000�0000000�00000001513�13771713062�0032034�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Status is a nested struct in ecs response type Status struct { Name string `json:"Name" xml:"Name"` Code int `json:"Code" xml:"Code"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_sub_rules_in_describe_price.go���������������������������������������������������������������0000664�0000000�0000000�00000001507�13771713062�0036150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SubRulesInDescribePrice is a nested struct in ecs response type SubRulesInDescribePrice struct { Rule []Rule `json:"Rule" xml:"Rule"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_sub_rules_in_describe_renewal_price.go�������������������������������������������������������0000664�0000000�0000000�00000001525�13771713062�0037665�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SubRulesInDescribeRenewalPrice is a nested struct in ecs response type SubRulesInDescribeRenewalPrice struct { Rule []Rule `json:"Rule" xml:"Rule"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_info.go���0000664�0000000�0000000�00000002007�13771713062�0033057�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupplyInfo is a nested struct in ecs response type SupplyInfo struct { Amount int `json:"Amount" xml:"Amount"` SupplyStatus string `json:"SupplyStatus" xml:"SupplyStatus"` SupplyStartTime string `json:"SupplyStartTime" xml:"SupplyStartTime"` SupplyEndTime string `json:"SupplyEndTime" xml:"SupplyEndTime"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_supply_infos.go��0000664�0000000�0000000�00000001507�13771713062�0033246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupplyInfos is a nested struct in ecs response type SupplyInfos struct { SupplyInfo []SupplyInfo `json:"SupplyInfo" xml:"SupplyInfo"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_supported_instance_type_families_in_describe_dedicated_host_types.go�������������������������0000664�0000000�0000000�00000001722�13771713062�0046054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupportedInstanceTypeFamiliesInDescribeDedicatedHostTypes is a nested struct in ecs response type SupportedInstanceTypeFamiliesInDescribeDedicatedHostTypes struct { SupportedInstanceTypeFamily []string `json:"SupportedInstanceTypeFamily" xml:"SupportedInstanceTypeFamily"` } ����������������������������������������������struct_supported_instance_type_families_in_describe_dedicated_hosts.go������������������������������0000664�0000000�0000000�00000001712�13771713062�0045012�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupportedInstanceTypeFamiliesInDescribeDedicatedHosts is a nested struct in ecs response type SupportedInstanceTypeFamiliesInDescribeDedicatedHosts struct { SupportedInstanceTypeFamily []string `json:"SupportedInstanceTypeFamily" xml:"SupportedInstanceTypeFamily"` } ������������������������������������������������������struct_supported_instance_types_list_in_describe_dedicated_host_types.go����������������������������0000664�0000000�0000000�00000001711�13771713062�0045417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupportedInstanceTypesListInDescribeDedicatedHostTypes is a nested struct in ecs response type SupportedInstanceTypesListInDescribeDedicatedHostTypes struct { SupportedInstanceTypesList []string `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` } �������������������������������������������������������struct_supported_instance_types_list_in_describe_dedicated_hosts.go���������������������������������0000664�0000000�0000000�00000001701�13771713062�0044355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupportedInstanceTypesListInDescribeDedicatedHosts is a nested struct in ecs response type SupportedInstanceTypesListInDescribeDedicatedHosts struct { SupportedInstanceTypesList []string `json:"SupportedInstanceTypesList" xml:"SupportedInstanceTypesList"` } ���������������������������������������������������������������struct_supported_resource.go������������������������������������������������������������������������0000664�0000000�0000000�00000002113�13771713062�0034363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupportedResource is a nested struct in ecs response type SupportedResource struct { Value string `json:"Value" xml:"Value"` Max int `json:"Max" xml:"Max"` Unit string `json:"Unit" xml:"Unit"` StatusCategory string `json:"StatusCategory" xml:"StatusCategory"` Status string `json:"Status" xml:"Status"` Min int `json:"Min" xml:"Min"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_supported_resources_in_describe_available_resource.go����������������������������������������0000664�0000000�0000000�00000001647�13771713062�0043016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupportedResourcesInDescribeAvailableResource is a nested struct in ecs response type SupportedResourcesInDescribeAvailableResource struct { SupportedResource []SupportedResource `json:"SupportedResource" xml:"SupportedResource"` } �����������������������������������������������������������������������������������������struct_supported_resources_in_describe_resources_modification.go������������������������������������0000664�0000000�0000000�00000001657�13771713062�0043727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SupportedResourcesInDescribeResourcesModification is a nested struct in ecs response type SupportedResourcesInDescribeResourcesModification struct { SupportedResource []SupportedResource `json:"SupportedResource" xml:"SupportedResource"` } ���������������������������������������������������������������������������������struct_system_disk_categories.go��������������������������������������������������������������������0000664�0000000�0000000�00000001610�13771713062�0035173�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SystemDiskCategories is a nested struct in ecs response type SystemDiskCategories struct { SupportedSystemDiskCategory []string `json:"supportedSystemDiskCategory" xml:"supportedSystemDiskCategory"` } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag.go�����������0000664�0000000�0000000�00000001731�13771713062�0031266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Tag is a nested struct in ecs response type Tag struct { TagValue string `json:"TagValue" xml:"TagValue"` TagKey string `json:"TagKey" xml:"TagKey"` ResourceTypeCount ResourceTypeCount `json:"ResourceTypeCount" xml:"ResourceTypeCount"` } ���������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resource.go��0000664�0000000�0000000�00000001751�13771713062�0033177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagResource is a nested struct in ecs response type TagResource struct { ResourceType string `json:"ResourceType" xml:"ResourceType"` ResourceId string `json:"ResourceId" xml:"ResourceId"` TagKey string `json:"TagKey" xml:"TagKey"` TagValue string `json:"TagValue" xml:"TagValue"` } �����������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_tag_resources.go�0000664�0000000�0000000�00000001515�13771713062�0033360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagResources is a nested struct in ecs response type TagResources struct { TagResource []TagResource `json:"TagResource" xml:"TagResource"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_dedicated_hosts.go����������������������������������������������������������0000664�0000000�0000000�00000001515�13771713062�0037126�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeDedicatedHosts is a nested struct in ecs response type TagsInDescribeDedicatedHosts struct { Tag []Tag `json:"Tag" xml:"Tag"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_disks.go��������������������������������������������������������������������0000664�0000000�0000000�00000001473�13771713062�0035120�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeDisks is a nested struct in ecs response type TagsInDescribeDisks struct { Tag []Tag `json:"Tag" xml:"Tag"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_images.go�������������������������������������������������������������������0000664�0000000�0000000�00000001475�13771713062�0035252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeImages is a nested struct in ecs response type TagsInDescribeImages struct { Tag []Tag `json:"Tag" xml:"Tag"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_instances.go����������������������������������������������������������������0000664�0000000�0000000�00000001503�13771713062�0035764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeInstances is a nested struct in ecs response type TagsInDescribeInstances struct { Tag []Tag `json:"Tag" xml:"Tag"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_key_pairs.go����������������������������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0035761�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeKeyPairs is a nested struct in ecs response type TagsInDescribeKeyPairs struct { Tag []Tag `json:"Tag" xml:"Tag"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_launch_template_versions.go�������������������������������������������������0000664�0000000�0000000�00000001575�13771713062�0041103�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeLaunchTemplateVersions is a nested struct in ecs response type TagsInDescribeLaunchTemplateVersions struct { InstanceTag []InstanceTag `json:"InstanceTag" xml:"InstanceTag"` } �����������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_launch_templates.go���������������������������������������������������������0000664�0000000�0000000�00000001517�13771713062�0037332�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeLaunchTemplates is a nested struct in ecs response type TagsInDescribeLaunchTemplates struct { Tag []Tag `json:"Tag" xml:"Tag"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_network_interfaces.go�������������������������������������������������������0000664�0000000�0000000�00000001523�13771713062�0037673�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeNetworkInterfaces is a nested struct in ecs response type TagsInDescribeNetworkInterfaces struct { Tag []Tag `json:"Tag" xml:"Tag"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_security_groups.go����������������������������������������������������������0000664�0000000�0000000�00000001515�13771713062�0037246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeSecurityGroups is a nested struct in ecs response type TagsInDescribeSecurityGroups struct { Tag []Tag `json:"Tag" xml:"Tag"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_snapshots.go����������������������������������������������������������������0000664�0000000�0000000�00000001503�13771713062�0036017�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeSnapshots is a nested struct in ecs response type TagsInDescribeSnapshots struct { Tag []Tag `json:"Tag" xml:"Tag"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_tags_in_describe_tags.go���������������������������������������������������������������������0000664�0000000�0000000�00000001471�13771713062�0034737�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TagsInDescribeTags is a nested struct in ecs response type TagsInDescribeTags struct { Tag []Tag `json:"Tag" xml:"Tag"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task.go����������0000664�0000000�0000000�00000002143�13771713062�0031453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Task is a nested struct in ecs response type Task struct { TaskId string `json:"TaskId" xml:"TaskId"` TaskAction string `json:"TaskAction" xml:"TaskAction"` TaskStatus string `json:"TaskStatus" xml:"TaskStatus"` SupportCancel string `json:"SupportCancel" xml:"SupportCancel"` CreationTime string `json:"CreationTime" xml:"CreationTime"` FinishedTime string `json:"FinishedTime" xml:"FinishedTime"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_task_set.go������0000664�0000000�0000000�00000001447�13771713062�0032334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // TaskSet is a nested struct in ecs response type TaskSet struct { Task []Task `json:"Task" xml:"Task"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topology.go������0000664�0000000�0000000�00000001553�13771713062�0032371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Topology is a nested struct in ecs response type Topology struct { InstanceId string `json:"InstanceId" xml:"InstanceId"` HostId string `json:"HostId" xml:"HostId"` } �����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_topologys.go�����0000664�0000000�0000000�00000001473�13771713062�0032555�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Topologys is a nested struct in ecs response type Topologys struct { Topology []Topology `json:"Topology" xml:"Topology"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_user_cidrs.go����0000664�0000000�0000000�00000001471�13771713062�0032656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // UserCidrs is a nested struct in ecs response type UserCidrs struct { UserCidr []string `json:"UserCidr" xml:"UserCidr"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_router.go������0000664�0000000�0000000�00000002315�13771713062�0032357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VRouter is a nested struct in ecs response type VRouter struct { RegionId string `json:"RegionId" xml:"RegionId"` VpcId string `json:"VpcId" xml:"VpcId"` VRouterName string `json:"VRouterName" xml:"VRouterName"` Description string `json:"Description" xml:"Description"` VRouterId string `json:"VRouterId" xml:"VRouterId"` CreationTime string `json:"CreationTime" xml:"CreationTime"` RouteTableIds RouteTableIds `json:"RouteTableIds" xml:"RouteTableIds"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_routers.go�����0000664�0000000�0000000�00000001465�13771713062�0032547�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VRouters is a nested struct in ecs response type VRouters struct { VRouter []VRouter `json:"VRouter" xml:"VRouter"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch.go������0000664�0000000�0000000�00000003004�13771713062�0032334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VSwitch is a nested struct in ecs response type VSwitch struct { VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` VpcId string `json:"VpcId" xml:"VpcId"` Status string `json:"Status" xml:"Status"` CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` ZoneId string `json:"ZoneId" xml:"ZoneId"` AvailableIpAddressCount int `json:"AvailableIpAddressCount" xml:"AvailableIpAddressCount"` Description string `json:"Description" xml:"Description"` VSwitchName string `json:"VSwitchName" xml:"VSwitchName"` CreationTime string `json:"CreationTime" xml:"CreationTime"` IsDefault bool `json:"IsDefault" xml:"IsDefault"` ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switch_ids.go��0000664�0000000�0000000�00000001476�13771713062�0033206�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VSwitchIds is a nested struct in ecs response type VSwitchIds struct { VSwitchId []string `json:"VSwitchId" xml:"VSwitchId"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_v_switches.go����0000664�0000000�0000000�00000001467�13771713062�0032677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VSwitches is a nested struct in ecs response type VSwitches struct { VSwitch []VSwitch `json:"VSwitch" xml:"VSwitch"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_value_item.go����0000664�0000000�0000000�00000002177�13771713062�0032652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ValueItem is a nested struct in ecs response type ValueItem struct { Value string `json:"Value" xml:"Value"` ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"` ZoneId string `json:"ZoneId" xml:"ZoneId"` InstanceChargeType string `json:"InstanceChargeType" xml:"InstanceChargeType"` InstanceType string `json:"InstanceType" xml:"InstanceType"` Count int `json:"Count" xml:"Count"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_virtual_border_router_for_physical_connection_set.go�����������������������������������������0000664�0000000�0000000�00000002017�13771713062�0042711�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VirtualBorderRouterForPhysicalConnectionSet is a nested struct in ecs response type VirtualBorderRouterForPhysicalConnectionSet struct { VirtualBorderRouterForPhysicalConnectionType []VirtualBorderRouterForPhysicalConnectionType `json:"VirtualBorderRouterForPhysicalConnectionType" xml:"VirtualBorderRouterForPhysicalConnectionType"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_virtual_border_router_for_physical_connection_type.go����������������������������������������0000664�0000000�0000000�00000002477�13771713062�0043111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VirtualBorderRouterForPhysicalConnectionType is a nested struct in ecs response type VirtualBorderRouterForPhysicalConnectionType struct { VbrId string `json:"VbrId" xml:"VbrId"` VbrOwnerUid int `json:"VbrOwnerUid" xml:"VbrOwnerUid"` CreationTime string `json:"CreationTime" xml:"CreationTime"` ActivationTime string `json:"ActivationTime" xml:"ActivationTime"` TerminationTime string `json:"TerminationTime" xml:"TerminationTime"` RecoveryTime string `json:"RecoveryTime" xml:"RecoveryTime"` VlanId int `json:"VlanId" xml:"VlanId"` CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_virtual_border_router_set.go�����������������������������������������������������������������0000664�0000000�0000000�00000001621�13771713062�0035730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VirtualBorderRouterSet is a nested struct in ecs response type VirtualBorderRouterSet struct { VirtualBorderRouterType []VirtualBorderRouterType `json:"VirtualBorderRouterType" xml:"VirtualBorderRouterType"` } ���������������������������������������������������������������������������������������������������������������struct_virtual_border_router_type.go����������������������������������������������������������������0000664�0000000�0000000�00000004735�13771713062�0036127�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VirtualBorderRouterType is a nested struct in ecs response type VirtualBorderRouterType struct { VbrId string `json:"VbrId" xml:"VbrId"` CreationTime string `json:"CreationTime" xml:"CreationTime"` ActivationTime string `json:"ActivationTime" xml:"ActivationTime"` TerminationTime string `json:"TerminationTime" xml:"TerminationTime"` RecoveryTime string `json:"RecoveryTime" xml:"RecoveryTime"` Status string `json:"Status" xml:"Status"` VlanId int `json:"VlanId" xml:"VlanId"` CircuitCode string `json:"CircuitCode" xml:"CircuitCode"` RouteTableId string `json:"RouteTableId" xml:"RouteTableId"` VlanInterfaceId string `json:"VlanInterfaceId" xml:"VlanInterfaceId"` LocalGatewayIp string `json:"LocalGatewayIp" xml:"LocalGatewayIp"` PeerGatewayIp string `json:"PeerGatewayIp" xml:"PeerGatewayIp"` PeeringSubnetMask string `json:"PeeringSubnetMask" xml:"PeeringSubnetMask"` PhysicalConnectionId string `json:"PhysicalConnectionId" xml:"PhysicalConnectionId"` PhysicalConnectionStatus string `json:"PhysicalConnectionStatus" xml:"PhysicalConnectionStatus"` PhysicalConnectionBusinessStatus string `json:"PhysicalConnectionBusinessStatus" xml:"PhysicalConnectionBusinessStatus"` PhysicalConnectionOwnerUid string `json:"PhysicalConnectionOwnerUid" xml:"PhysicalConnectionOwnerUid"` AccessPointId string `json:"AccessPointId" xml:"AccessPointId"` Name string `json:"Name" xml:"Name"` Description string `json:"Description" xml:"Description"` } �����������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc.go�����������0000664�0000000�0000000�00000002605�13771713062�0031304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Vpc is a nested struct in ecs response type Vpc struct { VpcId string `json:"VpcId" xml:"VpcId"` RegionId string `json:"RegionId" xml:"RegionId"` Status string `json:"Status" xml:"Status"` VpcName string `json:"VpcName" xml:"VpcName"` CreationTime string `json:"CreationTime" xml:"CreationTime"` CidrBlock string `json:"CidrBlock" xml:"CidrBlock"` VRouterId string `json:"VRouterId" xml:"VRouterId"` Description string `json:"Description" xml:"Description"` IsDefault bool `json:"IsDefault" xml:"IsDefault"` VSwitchIds VSwitchIds `json:"VSwitchIds" xml:"VSwitchIds"` UserCidrs UserCidrs `json:"UserCidrs" xml:"UserCidrs"` } ���������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpc_attributes.go0000664�0000000�0000000�00000002175�13771713062�0033554�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VpcAttributes is a nested struct in ecs response type VpcAttributes struct { VSwitchId string `json:"VSwitchId" xml:"VSwitchId"` VpcId string `json:"VpcId" xml:"VpcId"` NatIpAddress string `json:"NatIpAddress" xml:"NatIpAddress"` PrivateIpAddress PrivateIpAddressInDescribeInstances `json:"PrivateIpAddress" xml:"PrivateIpAddress"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_vpcs.go����������0000664�0000000�0000000�00000001435�13771713062�0031467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Vpcs is a nested struct in ecs response type Vpcs struct { Vpc []Vpc `json:"Vpc" xml:"Vpc"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/struct_zone.go����������0000664�0000000�0000000�00000004143�13771713062�0031466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Zone is a nested struct in ecs response type Zone struct { ZoneNo string `json:"ZoneNo" xml:"ZoneNo"` ZoneId string `json:"ZoneId" xml:"ZoneId"` LocalName string `json:"LocalName" xml:"LocalName"` AvailableResourceCreation AvailableResourceCreation `json:"AvailableResourceCreation" xml:"AvailableResourceCreation"` AvailableVolumeCategories AvailableVolumeCategories `json:"AvailableVolumeCategories" xml:"AvailableVolumeCategories"` AvailableInstanceTypes AvailableInstanceTypes `json:"AvailableInstanceTypes" xml:"AvailableInstanceTypes"` AvailableDedicatedHostTypes AvailableDedicatedHostTypes `json:"AvailableDedicatedHostTypes" xml:"AvailableDedicatedHostTypes"` NetworkTypes NetworkTypesInDescribeRecommendInstanceType `json:"NetworkTypes" xml:"NetworkTypes"` AvailableDiskCategories AvailableDiskCategories `json:"AvailableDiskCategories" xml:"AvailableDiskCategories"` DedicatedHostGenerations DedicatedHostGenerations `json:"DedicatedHostGenerations" xml:"DedicatedHostGenerations"` AvailableResources AvailableResourcesInDescribeZones `json:"AvailableResources" xml:"AvailableResources"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_zones_in_describe_recommend_instance_type.go�������������������������������������������������0000664�0000000�0000000�00000001541�13771713062�0041075�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ZonesInDescribeRecommendInstanceType is a nested struct in ecs response type ZonesInDescribeRecommendInstanceType struct { Zone []Zone `json:"zone" xml:"zone"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������struct_zones_in_describe_zones.go�������������������������������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0035331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ZonesInDescribeZones is a nested struct in ecs response type ZonesInDescribeZones struct { Zone []Zone `json:"Zone" xml:"Zone"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/tag_resources.go��������0000664�0000000�0000000�00000010034�13771713062�0031750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // TagResources invokes the ecs.TagResources API synchronously // api document: https://help.aliyun.com/api/ecs/tagresources.html func (client *Client) TagResources(request *TagResourcesRequest) (response *TagResourcesResponse, err error) { response = CreateTagResourcesResponse() err = client.DoAction(request, response) return } // TagResourcesWithChan invokes the ecs.TagResources API asynchronously // api document: https://help.aliyun.com/api/ecs/tagresources.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) TagResourcesWithChan(request *TagResourcesRequest) (<-chan *TagResourcesResponse, <-chan error) { responseChan := make(chan *TagResourcesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.TagResources(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // TagResourcesWithCallback invokes the ecs.TagResources API asynchronously // api document: https://help.aliyun.com/api/ecs/tagresources.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) TagResourcesWithCallback(request *TagResourcesRequest, callback func(response *TagResourcesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *TagResourcesResponse var err error defer close(result) response, err = client.TagResources(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // TagResourcesRequest is the request struct for api TagResources type TagResourcesRequest struct { *requests.RpcRequest Tag *[]TagResourcesTag `position:"Query" name:"Tag" type:"Repeated"` ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` } // TagResourcesTag is a repeated param struct in TagResourcesRequest type TagResourcesTag struct { Key string `name:"Key"` Value string `name:"Value"` } // TagResourcesResponse is the response struct for api TagResources type TagResourcesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateTagResourcesRequest creates a request to invoke TagResources API func CreateTagResourcesRequest() (request *TagResourcesRequest) { request = &TagResourcesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "TagResources", "ecs", "openAPI") return } // CreateTagResourcesResponse creates a response to parse from TagResources response func CreateTagResourcesResponse() (response *TagResourcesResponse) { response = &TagResourcesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������terminate_physical_connection.go��������������������������������������������������������������������0000664�0000000�0000000�00000011007�13771713062�0035130�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // TerminatePhysicalConnection invokes the ecs.TerminatePhysicalConnection API synchronously // api document: https://help.aliyun.com/api/ecs/terminatephysicalconnection.html func (client *Client) TerminatePhysicalConnection(request *TerminatePhysicalConnectionRequest) (response *TerminatePhysicalConnectionResponse, err error) { response = CreateTerminatePhysicalConnectionResponse() err = client.DoAction(request, response) return } // TerminatePhysicalConnectionWithChan invokes the ecs.TerminatePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/terminatephysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) TerminatePhysicalConnectionWithChan(request *TerminatePhysicalConnectionRequest) (<-chan *TerminatePhysicalConnectionResponse, <-chan error) { responseChan := make(chan *TerminatePhysicalConnectionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.TerminatePhysicalConnection(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // TerminatePhysicalConnectionWithCallback invokes the ecs.TerminatePhysicalConnection API asynchronously // api document: https://help.aliyun.com/api/ecs/terminatephysicalconnection.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) TerminatePhysicalConnectionWithCallback(request *TerminatePhysicalConnectionRequest, callback func(response *TerminatePhysicalConnectionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *TerminatePhysicalConnectionResponse var err error defer close(result) response, err = client.TerminatePhysicalConnection(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // TerminatePhysicalConnectionRequest is the request struct for api TerminatePhysicalConnection type TerminatePhysicalConnectionRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` PhysicalConnectionId string `position:"Query" name:"PhysicalConnectionId"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // TerminatePhysicalConnectionResponse is the response struct for api TerminatePhysicalConnection type TerminatePhysicalConnectionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateTerminatePhysicalConnectionRequest creates a request to invoke TerminatePhysicalConnection API func CreateTerminatePhysicalConnectionRequest() (request *TerminatePhysicalConnectionRequest) { request = &TerminatePhysicalConnectionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "TerminatePhysicalConnection", "ecs", "openAPI") return } // CreateTerminatePhysicalConnectionResponse creates a response to parse from TerminatePhysicalConnection response func CreateTerminatePhysicalConnectionResponse() (response *TerminatePhysicalConnectionResponse) { response = &TerminatePhysicalConnectionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������terminate_virtual_border_router.go������������������������������������������������������������������0000664�0000000�0000000�00000011040�13771713062�0035515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // TerminateVirtualBorderRouter invokes the ecs.TerminateVirtualBorderRouter API synchronously // api document: https://help.aliyun.com/api/ecs/terminatevirtualborderrouter.html func (client *Client) TerminateVirtualBorderRouter(request *TerminateVirtualBorderRouterRequest) (response *TerminateVirtualBorderRouterResponse, err error) { response = CreateTerminateVirtualBorderRouterResponse() err = client.DoAction(request, response) return } // TerminateVirtualBorderRouterWithChan invokes the ecs.TerminateVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/terminatevirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) TerminateVirtualBorderRouterWithChan(request *TerminateVirtualBorderRouterRequest) (<-chan *TerminateVirtualBorderRouterResponse, <-chan error) { responseChan := make(chan *TerminateVirtualBorderRouterResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.TerminateVirtualBorderRouter(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // TerminateVirtualBorderRouterWithCallback invokes the ecs.TerminateVirtualBorderRouter API asynchronously // api document: https://help.aliyun.com/api/ecs/terminatevirtualborderrouter.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) TerminateVirtualBorderRouterWithCallback(request *TerminateVirtualBorderRouterRequest, callback func(response *TerminateVirtualBorderRouterResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *TerminateVirtualBorderRouterResponse var err error defer close(result) response, err = client.TerminateVirtualBorderRouter(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // TerminateVirtualBorderRouterRequest is the request struct for api TerminateVirtualBorderRouter type TerminateVirtualBorderRouterRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` UserCidr string `position:"Query" name:"UserCidr"` VbrId string `position:"Query" name:"VbrId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // TerminateVirtualBorderRouterResponse is the response struct for api TerminateVirtualBorderRouter type TerminateVirtualBorderRouterResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateTerminateVirtualBorderRouterRequest creates a request to invoke TerminateVirtualBorderRouter API func CreateTerminateVirtualBorderRouterRequest() (request *TerminateVirtualBorderRouterRequest) { request = &TerminateVirtualBorderRouterRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "TerminateVirtualBorderRouter", "ecs", "openAPI") return } // CreateTerminateVirtualBorderRouterResponse creates a response to parse from TerminateVirtualBorderRouter response func CreateTerminateVirtualBorderRouterResponse() (response *TerminateVirtualBorderRouterResponse) { response = &TerminateVirtualBorderRouterResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������unassign_ipv6_addresses.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010334�13771713062�0033657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UnassignIpv6Addresses invokes the ecs.UnassignIpv6Addresses API synchronously // api document: https://help.aliyun.com/api/ecs/unassignipv6addresses.html func (client *Client) UnassignIpv6Addresses(request *UnassignIpv6AddressesRequest) (response *UnassignIpv6AddressesResponse, err error) { response = CreateUnassignIpv6AddressesResponse() err = client.DoAction(request, response) return } // UnassignIpv6AddressesWithChan invokes the ecs.UnassignIpv6Addresses API asynchronously // api document: https://help.aliyun.com/api/ecs/unassignipv6addresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassignIpv6AddressesWithChan(request *UnassignIpv6AddressesRequest) (<-chan *UnassignIpv6AddressesResponse, <-chan error) { responseChan := make(chan *UnassignIpv6AddressesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UnassignIpv6Addresses(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UnassignIpv6AddressesWithCallback invokes the ecs.UnassignIpv6Addresses API asynchronously // api document: https://help.aliyun.com/api/ecs/unassignipv6addresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassignIpv6AddressesWithCallback(request *UnassignIpv6AddressesRequest, callback func(response *UnassignIpv6AddressesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UnassignIpv6AddressesResponse var err error defer close(result) response, err = client.UnassignIpv6Addresses(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UnassignIpv6AddressesRequest is the request struct for api UnassignIpv6Addresses type UnassignIpv6AddressesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` Ipv6Address *[]string `position:"Query" name:"Ipv6Address" type:"Repeated"` } // UnassignIpv6AddressesResponse is the response struct for api UnassignIpv6Addresses type UnassignIpv6AddressesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUnassignIpv6AddressesRequest creates a request to invoke UnassignIpv6Addresses API func CreateUnassignIpv6AddressesRequest() (request *UnassignIpv6AddressesRequest) { request = &UnassignIpv6AddressesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "UnassignIpv6Addresses", "ecs", "openAPI") return } // CreateUnassignIpv6AddressesResponse creates a response to parse from UnassignIpv6Addresses response func CreateUnassignIpv6AddressesResponse() (response *UnassignIpv6AddressesResponse) { response = &UnassignIpv6AddressesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������unassign_private_ip_addresses.go��������������������������������������������������������������������0000664�0000000�0000000�00000010651�13771713062�0035137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UnassignPrivateIpAddresses invokes the ecs.UnassignPrivateIpAddresses API synchronously // api document: https://help.aliyun.com/api/ecs/unassignprivateipaddresses.html func (client *Client) UnassignPrivateIpAddresses(request *UnassignPrivateIpAddressesRequest) (response *UnassignPrivateIpAddressesResponse, err error) { response = CreateUnassignPrivateIpAddressesResponse() err = client.DoAction(request, response) return } // UnassignPrivateIpAddressesWithChan invokes the ecs.UnassignPrivateIpAddresses API asynchronously // api document: https://help.aliyun.com/api/ecs/unassignprivateipaddresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassignPrivateIpAddressesWithChan(request *UnassignPrivateIpAddressesRequest) (<-chan *UnassignPrivateIpAddressesResponse, <-chan error) { responseChan := make(chan *UnassignPrivateIpAddressesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UnassignPrivateIpAddresses(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UnassignPrivateIpAddressesWithCallback invokes the ecs.UnassignPrivateIpAddresses API asynchronously // api document: https://help.aliyun.com/api/ecs/unassignprivateipaddresses.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassignPrivateIpAddressesWithCallback(request *UnassignPrivateIpAddressesRequest, callback func(response *UnassignPrivateIpAddressesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UnassignPrivateIpAddressesResponse var err error defer close(result) response, err = client.UnassignPrivateIpAddresses(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UnassignPrivateIpAddressesRequest is the request struct for api UnassignPrivateIpAddresses type UnassignPrivateIpAddressesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` PrivateIpAddress *[]string `position:"Query" name:"PrivateIpAddress" type:"Repeated"` NetworkInterfaceId string `position:"Query" name:"NetworkInterfaceId"` } // UnassignPrivateIpAddressesResponse is the response struct for api UnassignPrivateIpAddresses type UnassignPrivateIpAddressesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUnassignPrivateIpAddressesRequest creates a request to invoke UnassignPrivateIpAddresses API func CreateUnassignPrivateIpAddressesRequest() (request *UnassignPrivateIpAddressesRequest) { request = &UnassignPrivateIpAddressesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "UnassignPrivateIpAddresses", "ecs", "openAPI") return } // CreateUnassignPrivateIpAddressesResponse creates a response to parse from UnassignPrivateIpAddresses response func CreateUnassignPrivateIpAddressesResponse() (response *UnassignPrivateIpAddressesResponse) { response = &UnassignPrivateIpAddressesResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������unassociate_eip_address.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010422�13771713062�0033705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs��������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UnassociateEipAddress invokes the ecs.UnassociateEipAddress API synchronously // api document: https://help.aliyun.com/api/ecs/unassociateeipaddress.html func (client *Client) UnassociateEipAddress(request *UnassociateEipAddressRequest) (response *UnassociateEipAddressResponse, err error) { response = CreateUnassociateEipAddressResponse() err = client.DoAction(request, response) return } // UnassociateEipAddressWithChan invokes the ecs.UnassociateEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/unassociateeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassociateEipAddressWithChan(request *UnassociateEipAddressRequest) (<-chan *UnassociateEipAddressResponse, <-chan error) { responseChan := make(chan *UnassociateEipAddressResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UnassociateEipAddress(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UnassociateEipAddressWithCallback invokes the ecs.UnassociateEipAddress API asynchronously // api document: https://help.aliyun.com/api/ecs/unassociateeipaddress.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassociateEipAddressWithCallback(request *UnassociateEipAddressRequest, callback func(response *UnassociateEipAddressResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UnassociateEipAddressResponse var err error defer close(result) response, err = client.UnassociateEipAddress(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UnassociateEipAddressRequest is the request struct for api UnassociateEipAddress type UnassociateEipAddressRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` InstanceType string `position:"Query" name:"InstanceType"` AllocationId string `position:"Query" name:"AllocationId"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // UnassociateEipAddressResponse is the response struct for api UnassociateEipAddress type UnassociateEipAddressResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUnassociateEipAddressRequest creates a request to invoke UnassociateEipAddress API func CreateUnassociateEipAddressRequest() (request *UnassociateEipAddressRequest) { request = &UnassociateEipAddressRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "UnassociateEipAddress", "ecs", "openAPI") return } // CreateUnassociateEipAddressResponse creates a response to parse from UnassociateEipAddress response func CreateUnassociateEipAddressResponse() (response *UnassociateEipAddressResponse) { response = &UnassociateEipAddressResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/unassociate_ha_vip.go���0000664�0000000�0000000�00000010213�13771713062�0032746�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UnassociateHaVip invokes the ecs.UnassociateHaVip API synchronously // api document: https://help.aliyun.com/api/ecs/unassociatehavip.html func (client *Client) UnassociateHaVip(request *UnassociateHaVipRequest) (response *UnassociateHaVipResponse, err error) { response = CreateUnassociateHaVipResponse() err = client.DoAction(request, response) return } // UnassociateHaVipWithChan invokes the ecs.UnassociateHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/unassociatehavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassociateHaVipWithChan(request *UnassociateHaVipRequest) (<-chan *UnassociateHaVipResponse, <-chan error) { responseChan := make(chan *UnassociateHaVipResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UnassociateHaVip(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UnassociateHaVipWithCallback invokes the ecs.UnassociateHaVip API asynchronously // api document: https://help.aliyun.com/api/ecs/unassociatehavip.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnassociateHaVipWithCallback(request *UnassociateHaVipRequest, callback func(response *UnassociateHaVipResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UnassociateHaVipResponse var err error defer close(result) response, err = client.UnassociateHaVip(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UnassociateHaVipRequest is the request struct for api UnassociateHaVip type UnassociateHaVipRequest struct { *requests.RpcRequest HaVipId string `position:"Query" name:"HaVipId"` ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` InstanceId string `position:"Query" name:"InstanceId"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` ClientToken string `position:"Query" name:"ClientToken"` OwnerAccount string `position:"Query" name:"OwnerAccount"` Force string `position:"Query" name:"Force"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // UnassociateHaVipResponse is the response struct for api UnassociateHaVip type UnassociateHaVipResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUnassociateHaVipRequest creates a request to invoke UnassociateHaVip API func CreateUnassociateHaVipRequest() (request *UnassociateHaVipRequest) { request = &UnassociateHaVipRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "UnassociateHaVip", "ecs", "openAPI") return } // CreateUnassociateHaVipResponse creates a response to parse from UnassociateHaVip response func CreateUnassociateHaVipResponse() (response *UnassociateHaVipResponse) { response = &UnassociateHaVipResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ecs/untag_resources.go������0000664�0000000�0000000�00000010133�13771713062�0032313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ecs //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UntagResources invokes the ecs.UntagResources API synchronously // api document: https://help.aliyun.com/api/ecs/untagresources.html func (client *Client) UntagResources(request *UntagResourcesRequest) (response *UntagResourcesResponse, err error) { response = CreateUntagResourcesResponse() err = client.DoAction(request, response) return } // UntagResourcesWithChan invokes the ecs.UntagResources API asynchronously // api document: https://help.aliyun.com/api/ecs/untagresources.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UntagResourcesWithChan(request *UntagResourcesRequest) (<-chan *UntagResourcesResponse, <-chan error) { responseChan := make(chan *UntagResourcesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UntagResources(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UntagResourcesWithCallback invokes the ecs.UntagResources API asynchronously // api document: https://help.aliyun.com/api/ecs/untagresources.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UntagResourcesWithCallback(request *UntagResourcesRequest, callback func(response *UntagResourcesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UntagResourcesResponse var err error defer close(result) response, err = client.UntagResources(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UntagResourcesRequest is the request struct for api UntagResources type UntagResourcesRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` All requests.Boolean `position:"Query" name:"All"` ResourceId *[]string `position:"Query" name:"ResourceId" type:"Repeated"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` ResourceType string `position:"Query" name:"ResourceType"` TagKey *[]string `position:"Query" name:"TagKey" type:"Repeated"` } // UntagResourcesResponse is the response struct for api UntagResources type UntagResourcesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUntagResourcesRequest creates a request to invoke UntagResources API func CreateUntagResourcesRequest() (request *UntagResourcesRequest) { request = &UntagResourcesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ecs", "2014-05-26", "UntagResources", "ecs", "openAPI") return } // CreateUntagResourcesResponse creates a response to parse from UntagResources response func CreateUntagResourcesResponse() (response *UntagResourcesResponse) { response = &UntagResourcesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/������������������������0000775�0000000�0000000�00000000000�13771713062�0026563�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/add_user_to_group.go����0000664�0000000�0000000�00000007077�13771713062�0032631�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AddUserToGroup invokes the ram.AddUserToGroup API synchronously // api document: https://help.aliyun.com/api/ram/addusertogroup.html func (client *Client) AddUserToGroup(request *AddUserToGroupRequest) (response *AddUserToGroupResponse, err error) { response = CreateAddUserToGroupResponse() err = client.DoAction(request, response) return } // AddUserToGroupWithChan invokes the ram.AddUserToGroup API asynchronously // api document: https://help.aliyun.com/api/ram/addusertogroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AddUserToGroupWithChan(request *AddUserToGroupRequest) (<-chan *AddUserToGroupResponse, <-chan error) { responseChan := make(chan *AddUserToGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AddUserToGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AddUserToGroupWithCallback invokes the ram.AddUserToGroup API asynchronously // api document: https://help.aliyun.com/api/ram/addusertogroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AddUserToGroupWithCallback(request *AddUserToGroupRequest, callback func(response *AddUserToGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AddUserToGroupResponse var err error defer close(result) response, err = client.AddUserToGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AddUserToGroupRequest is the request struct for api AddUserToGroup type AddUserToGroupRequest struct { *requests.RpcRequest GroupName string `position:"Query" name:"GroupName"` UserName string `position:"Query" name:"UserName"` } // AddUserToGroupResponse is the response struct for api AddUserToGroup type AddUserToGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAddUserToGroupRequest creates a request to invoke AddUserToGroup API func CreateAddUserToGroupRequest() (request *AddUserToGroupRequest) { request = &AddUserToGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "AddUserToGroup", "ram", "openAPI") return } // CreateAddUserToGroupResponse creates a response to parse from AddUserToGroup response func CreateAddUserToGroupResponse() (response *AddUserToGroupResponse) { response = &AddUserToGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������attach_policy_to_group.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007503�13771713062�0033601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachPolicyToGroup invokes the ram.AttachPolicyToGroup API synchronously // api document: https://help.aliyun.com/api/ram/attachpolicytogroup.html func (client *Client) AttachPolicyToGroup(request *AttachPolicyToGroupRequest) (response *AttachPolicyToGroupResponse, err error) { response = CreateAttachPolicyToGroupResponse() err = client.DoAction(request, response) return } // AttachPolicyToGroupWithChan invokes the ram.AttachPolicyToGroup API asynchronously // api document: https://help.aliyun.com/api/ram/attachpolicytogroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachPolicyToGroupWithChan(request *AttachPolicyToGroupRequest) (<-chan *AttachPolicyToGroupResponse, <-chan error) { responseChan := make(chan *AttachPolicyToGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachPolicyToGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachPolicyToGroupWithCallback invokes the ram.AttachPolicyToGroup API asynchronously // api document: https://help.aliyun.com/api/ram/attachpolicytogroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachPolicyToGroupWithCallback(request *AttachPolicyToGroupRequest, callback func(response *AttachPolicyToGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachPolicyToGroupResponse var err error defer close(result) response, err = client.AttachPolicyToGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachPolicyToGroupRequest is the request struct for api AttachPolicyToGroup type AttachPolicyToGroupRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` GroupName string `position:"Query" name:"GroupName"` } // AttachPolicyToGroupResponse is the response struct for api AttachPolicyToGroup type AttachPolicyToGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAttachPolicyToGroupRequest creates a request to invoke AttachPolicyToGroup API func CreateAttachPolicyToGroupRequest() (request *AttachPolicyToGroupRequest) { request = &AttachPolicyToGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "AttachPolicyToGroup", "ram", "openAPI") return } // CreateAttachPolicyToGroupResponse creates a response to parse from AttachPolicyToGroup response func CreateAttachPolicyToGroupResponse() (response *AttachPolicyToGroupResponse) { response = &AttachPolicyToGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_role.go0000664�0000000�0000000�00000007432�13771713062�0033466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachPolicyToRole invokes the ram.AttachPolicyToRole API synchronously // api document: https://help.aliyun.com/api/ram/attachpolicytorole.html func (client *Client) AttachPolicyToRole(request *AttachPolicyToRoleRequest) (response *AttachPolicyToRoleResponse, err error) { response = CreateAttachPolicyToRoleResponse() err = client.DoAction(request, response) return } // AttachPolicyToRoleWithChan invokes the ram.AttachPolicyToRole API asynchronously // api document: https://help.aliyun.com/api/ram/attachpolicytorole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachPolicyToRoleWithChan(request *AttachPolicyToRoleRequest) (<-chan *AttachPolicyToRoleResponse, <-chan error) { responseChan := make(chan *AttachPolicyToRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachPolicyToRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachPolicyToRoleWithCallback invokes the ram.AttachPolicyToRole API asynchronously // api document: https://help.aliyun.com/api/ram/attachpolicytorole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachPolicyToRoleWithCallback(request *AttachPolicyToRoleRequest, callback func(response *AttachPolicyToRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachPolicyToRoleResponse var err error defer close(result) response, err = client.AttachPolicyToRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachPolicyToRoleRequest is the request struct for api AttachPolicyToRole type AttachPolicyToRoleRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` RoleName string `position:"Query" name:"RoleName"` PolicyName string `position:"Query" name:"PolicyName"` } // AttachPolicyToRoleResponse is the response struct for api AttachPolicyToRole type AttachPolicyToRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAttachPolicyToRoleRequest creates a request to invoke AttachPolicyToRole API func CreateAttachPolicyToRoleRequest() (request *AttachPolicyToRoleRequest) { request = &AttachPolicyToRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "AttachPolicyToRole", "ram", "openAPI") return } // CreateAttachPolicyToRoleResponse creates a response to parse from AttachPolicyToRole response func CreateAttachPolicyToRoleResponse() (response *AttachPolicyToRoleResponse) { response = &AttachPolicyToRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/attach_policy_to_user.go0000664�0000000�0000000�00000007432�13771713062�0033503�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // AttachPolicyToUser invokes the ram.AttachPolicyToUser API synchronously // api document: https://help.aliyun.com/api/ram/attachpolicytouser.html func (client *Client) AttachPolicyToUser(request *AttachPolicyToUserRequest) (response *AttachPolicyToUserResponse, err error) { response = CreateAttachPolicyToUserResponse() err = client.DoAction(request, response) return } // AttachPolicyToUserWithChan invokes the ram.AttachPolicyToUser API asynchronously // api document: https://help.aliyun.com/api/ram/attachpolicytouser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachPolicyToUserWithChan(request *AttachPolicyToUserRequest) (<-chan *AttachPolicyToUserResponse, <-chan error) { responseChan := make(chan *AttachPolicyToUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.AttachPolicyToUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // AttachPolicyToUserWithCallback invokes the ram.AttachPolicyToUser API asynchronously // api document: https://help.aliyun.com/api/ram/attachpolicytouser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) AttachPolicyToUserWithCallback(request *AttachPolicyToUserRequest, callback func(response *AttachPolicyToUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *AttachPolicyToUserResponse var err error defer close(result) response, err = client.AttachPolicyToUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // AttachPolicyToUserRequest is the request struct for api AttachPolicyToUser type AttachPolicyToUserRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` UserName string `position:"Query" name:"UserName"` } // AttachPolicyToUserResponse is the response struct for api AttachPolicyToUser type AttachPolicyToUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateAttachPolicyToUserRequest creates a request to invoke AttachPolicyToUser API func CreateAttachPolicyToUserRequest() (request *AttachPolicyToUserRequest) { request = &AttachPolicyToUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "AttachPolicyToUser", "ram", "openAPI") return } // CreateAttachPolicyToUserResponse creates a response to parse from AttachPolicyToUser response func CreateAttachPolicyToUserResponse() (response *AttachPolicyToUserResponse) { response = &AttachPolicyToUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/bind_mfa_device.go������0000664�0000000�0000000�00000007302�13771713062�0032172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // BindMFADevice invokes the ram.BindMFADevice API synchronously // api document: https://help.aliyun.com/api/ram/bindmfadevice.html func (client *Client) BindMFADevice(request *BindMFADeviceRequest) (response *BindMFADeviceResponse, err error) { response = CreateBindMFADeviceResponse() err = client.DoAction(request, response) return } // BindMFADeviceWithChan invokes the ram.BindMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/bindmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) BindMFADeviceWithChan(request *BindMFADeviceRequest) (<-chan *BindMFADeviceResponse, <-chan error) { responseChan := make(chan *BindMFADeviceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.BindMFADevice(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // BindMFADeviceWithCallback invokes the ram.BindMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/bindmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) BindMFADeviceWithCallback(request *BindMFADeviceRequest, callback func(response *BindMFADeviceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *BindMFADeviceResponse var err error defer close(result) response, err = client.BindMFADevice(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // BindMFADeviceRequest is the request struct for api BindMFADevice type BindMFADeviceRequest struct { *requests.RpcRequest SerialNumber string `position:"Query" name:"SerialNumber"` AuthenticationCode2 string `position:"Query" name:"AuthenticationCode2"` AuthenticationCode1 string `position:"Query" name:"AuthenticationCode1"` UserName string `position:"Query" name:"UserName"` } // BindMFADeviceResponse is the response struct for api BindMFADevice type BindMFADeviceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateBindMFADeviceRequest creates a request to invoke BindMFADevice API func CreateBindMFADeviceRequest() (request *BindMFADeviceRequest) { request = &BindMFADeviceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "BindMFADevice", "ram", "openAPI") return } // CreateBindMFADeviceResponse creates a response to parse from BindMFADevice response func CreateBindMFADeviceResponse() (response *BindMFADeviceResponse) { response = &BindMFADeviceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/change_password.go������0000664�0000000�0000000�00000007110�13771713062�0032260�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ChangePassword invokes the ram.ChangePassword API synchronously // api document: https://help.aliyun.com/api/ram/changepassword.html func (client *Client) ChangePassword(request *ChangePasswordRequest) (response *ChangePasswordResponse, err error) { response = CreateChangePasswordResponse() err = client.DoAction(request, response) return } // ChangePasswordWithChan invokes the ram.ChangePassword API asynchronously // api document: https://help.aliyun.com/api/ram/changepassword.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ChangePasswordWithChan(request *ChangePasswordRequest) (<-chan *ChangePasswordResponse, <-chan error) { responseChan := make(chan *ChangePasswordResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ChangePassword(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ChangePasswordWithCallback invokes the ram.ChangePassword API asynchronously // api document: https://help.aliyun.com/api/ram/changepassword.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ChangePasswordWithCallback(request *ChangePasswordRequest, callback func(response *ChangePasswordResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ChangePasswordResponse var err error defer close(result) response, err = client.ChangePassword(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ChangePasswordRequest is the request struct for api ChangePassword type ChangePasswordRequest struct { *requests.RpcRequest OldPassword string `position:"Query" name:"OldPassword"` NewPassword string `position:"Query" name:"NewPassword"` } // ChangePasswordResponse is the response struct for api ChangePassword type ChangePasswordResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateChangePasswordRequest creates a request to invoke ChangePassword API func CreateChangePasswordRequest() (request *ChangePasswordRequest) { request = &ChangePasswordRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ChangePassword", "ram", "openAPI") return } // CreateChangePasswordResponse creates a response to parse from ChangePassword response func CreateChangePasswordResponse() (response *ChangePasswordResponse) { response = &ChangePasswordResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/clear_account_alias.go��0000664�0000000�0000000�00000007114�13771713062�0033070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ClearAccountAlias invokes the ram.ClearAccountAlias API synchronously // api document: https://help.aliyun.com/api/ram/clearaccountalias.html func (client *Client) ClearAccountAlias(request *ClearAccountAliasRequest) (response *ClearAccountAliasResponse, err error) { response = CreateClearAccountAliasResponse() err = client.DoAction(request, response) return } // ClearAccountAliasWithChan invokes the ram.ClearAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/clearaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ClearAccountAliasWithChan(request *ClearAccountAliasRequest) (<-chan *ClearAccountAliasResponse, <-chan error) { responseChan := make(chan *ClearAccountAliasResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ClearAccountAlias(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ClearAccountAliasWithCallback invokes the ram.ClearAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/clearaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ClearAccountAliasWithCallback(request *ClearAccountAliasRequest, callback func(response *ClearAccountAliasResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ClearAccountAliasResponse var err error defer close(result) response, err = client.ClearAccountAlias(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ClearAccountAliasRequest is the request struct for api ClearAccountAlias type ClearAccountAliasRequest struct { *requests.RpcRequest } // ClearAccountAliasResponse is the response struct for api ClearAccountAlias type ClearAccountAliasResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateClearAccountAliasRequest creates a request to invoke ClearAccountAlias API func CreateClearAccountAliasRequest() (request *ClearAccountAliasRequest) { request = &ClearAccountAliasRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ClearAccountAlias", "ram", "openAPI") return } // CreateClearAccountAliasResponse creates a response to parse from ClearAccountAlias response func CreateClearAccountAliasResponse() (response *ClearAccountAliasResponse) { response = &ClearAccountAliasResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/client.go���������������0000664�0000000�0000000�00000006267�13771713062�0030403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" ) // Client is the sdk client struct, each func corresponds to an OpenAPI type Client struct { sdk.Client } // NewClient creates a sdk client with environment variables func NewClient() (client *Client, err error) { client = &Client{} err = client.Init() return } // NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential // this is the common api to create a sdk client func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) { client = &Client{} err = client.InitWithOptions(regionId, config, credential) return } // NewClientWithAccessKey is a shortcut to create sdk client with accesskey // usage: https://help.aliyun.com/document_detail/66217.html func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) { client = &Client{} err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret) return } // NewClientWithStsToken is a shortcut to create sdk client with sts token // usage: https://help.aliyun.com/document_detail/66222.html func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) { client = &Client{} err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken) return } // NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn // usage: https://help.aliyun.com/document_detail/66222.html func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) { client = &Client{} err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName) return } // NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role // usage: https://help.aliyun.com/document_detail/66223.html func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) { client = &Client{} err = client.InitWithEcsRamRole(regionId, roleName) return } // NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair // attention: rsa key pair auth is only Japan regions available func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) { client = &Client{} err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration) return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_access_key.go����0000664�0000000�0000000�00000007153�13771713062�0032554�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateAccessKey invokes the ram.CreateAccessKey API synchronously // api document: https://help.aliyun.com/api/ram/createaccesskey.html func (client *Client) CreateAccessKey(request *CreateAccessKeyRequest) (response *CreateAccessKeyResponse, err error) { response = CreateCreateAccessKeyResponse() err = client.DoAction(request, response) return } // CreateAccessKeyWithChan invokes the ram.CreateAccessKey API asynchronously // api document: https://help.aliyun.com/api/ram/createaccesskey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateAccessKeyWithChan(request *CreateAccessKeyRequest) (<-chan *CreateAccessKeyResponse, <-chan error) { responseChan := make(chan *CreateAccessKeyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateAccessKey(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateAccessKeyWithCallback invokes the ram.CreateAccessKey API asynchronously // api document: https://help.aliyun.com/api/ram/createaccesskey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateAccessKeyWithCallback(request *CreateAccessKeyRequest, callback func(response *CreateAccessKeyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateAccessKeyResponse var err error defer close(result) response, err = client.CreateAccessKey(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateAccessKeyRequest is the request struct for api CreateAccessKey type CreateAccessKeyRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // CreateAccessKeyResponse is the response struct for api CreateAccessKey type CreateAccessKeyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AccessKey AccessKey `json:"AccessKey" xml:"AccessKey"` } // CreateCreateAccessKeyRequest creates a request to invoke CreateAccessKey API func CreateCreateAccessKeyRequest() (request *CreateAccessKeyRequest) { request = &CreateAccessKeyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreateAccessKey", "ram", "openAPI") return } // CreateCreateAccessKeyResponse creates a response to parse from CreateAccessKey response func CreateCreateAccessKeyResponse() (response *CreateAccessKeyResponse) { response = &CreateAccessKeyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_group.go���������0000664�0000000�0000000�00000006764�13771713062�0031606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateGroup invokes the ram.CreateGroup API synchronously // api document: https://help.aliyun.com/api/ram/creategroup.html func (client *Client) CreateGroup(request *CreateGroupRequest) (response *CreateGroupResponse, err error) { response = CreateCreateGroupResponse() err = client.DoAction(request, response) return } // CreateGroupWithChan invokes the ram.CreateGroup API asynchronously // api document: https://help.aliyun.com/api/ram/creategroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateGroupWithChan(request *CreateGroupRequest) (<-chan *CreateGroupResponse, <-chan error) { responseChan := make(chan *CreateGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateGroupWithCallback invokes the ram.CreateGroup API asynchronously // api document: https://help.aliyun.com/api/ram/creategroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateGroupWithCallback(request *CreateGroupRequest, callback func(response *CreateGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateGroupResponse var err error defer close(result) response, err = client.CreateGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateGroupRequest is the request struct for api CreateGroup type CreateGroupRequest struct { *requests.RpcRequest Comments string `position:"Query" name:"Comments"` GroupName string `position:"Query" name:"GroupName"` } // CreateGroupResponse is the response struct for api CreateGroup type CreateGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Group Group `json:"Group" xml:"Group"` } // CreateCreateGroupRequest creates a request to invoke CreateGroup API func CreateCreateGroupRequest() (request *CreateGroupRequest) { request = &CreateGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreateGroup", "ram", "openAPI") return } // CreateCreateGroupResponse creates a response to parse from CreateGroup response func CreateCreateGroupResponse() (response *CreateGroupResponse) { response = &CreateGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_login_profile.go�0000664�0000000�0000000�00000010001�13771713062�0033255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateLoginProfile invokes the ram.CreateLoginProfile API synchronously // api document: https://help.aliyun.com/api/ram/createloginprofile.html func (client *Client) CreateLoginProfile(request *CreateLoginProfileRequest) (response *CreateLoginProfileResponse, err error) { response = CreateCreateLoginProfileResponse() err = client.DoAction(request, response) return } // CreateLoginProfileWithChan invokes the ram.CreateLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/createloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateLoginProfileWithChan(request *CreateLoginProfileRequest) (<-chan *CreateLoginProfileResponse, <-chan error) { responseChan := make(chan *CreateLoginProfileResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateLoginProfile(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateLoginProfileWithCallback invokes the ram.CreateLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/createloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateLoginProfileWithCallback(request *CreateLoginProfileRequest, callback func(response *CreateLoginProfileResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateLoginProfileResponse var err error defer close(result) response, err = client.CreateLoginProfile(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateLoginProfileRequest is the request struct for api CreateLoginProfile type CreateLoginProfileRequest struct { *requests.RpcRequest Password string `position:"Query" name:"Password"` PasswordResetRequired requests.Boolean `position:"Query" name:"PasswordResetRequired"` MFABindRequired requests.Boolean `position:"Query" name:"MFABindRequired"` UserName string `position:"Query" name:"UserName"` } // CreateLoginProfileResponse is the response struct for api CreateLoginProfile type CreateLoginProfileResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` LoginProfile LoginProfile `json:"LoginProfile" xml:"LoginProfile"` } // CreateCreateLoginProfileRequest creates a request to invoke CreateLoginProfile API func CreateCreateLoginProfileRequest() (request *CreateLoginProfileRequest) { request = &CreateLoginProfileRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreateLoginProfile", "ram", "openAPI") return } // CreateCreateLoginProfileResponse creates a response to parse from CreateLoginProfile response func CreateCreateLoginProfileResponse() (response *CreateLoginProfileResponse) { response = &CreateLoginProfileResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy.go��������0000664�0000000�0000000�00000007154�13771713062�0031743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreatePolicy invokes the ram.CreatePolicy API synchronously // api document: https://help.aliyun.com/api/ram/createpolicy.html func (client *Client) CreatePolicy(request *CreatePolicyRequest) (response *CreatePolicyResponse, err error) { response = CreateCreatePolicyResponse() err = client.DoAction(request, response) return } // CreatePolicyWithChan invokes the ram.CreatePolicy API asynchronously // api document: https://help.aliyun.com/api/ram/createpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreatePolicyWithChan(request *CreatePolicyRequest) (<-chan *CreatePolicyResponse, <-chan error) { responseChan := make(chan *CreatePolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreatePolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreatePolicyWithCallback invokes the ram.CreatePolicy API asynchronously // api document: https://help.aliyun.com/api/ram/createpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreatePolicyWithCallback(request *CreatePolicyRequest, callback func(response *CreatePolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreatePolicyResponse var err error defer close(result) response, err = client.CreatePolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreatePolicyRequest is the request struct for api CreatePolicy type CreatePolicyRequest struct { *requests.RpcRequest Description string `position:"Query" name:"Description"` PolicyName string `position:"Query" name:"PolicyName"` PolicyDocument string `position:"Query" name:"PolicyDocument"` } // CreatePolicyResponse is the response struct for api CreatePolicy type CreatePolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Policy Policy `json:"Policy" xml:"Policy"` } // CreateCreatePolicyRequest creates a request to invoke CreatePolicy API func CreateCreatePolicyRequest() (request *CreatePolicyRequest) { request = &CreatePolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreatePolicy", "ram", "openAPI") return } // CreateCreatePolicyResponse creates a response to parse from CreatePolicy response func CreateCreatePolicyResponse() (response *CreatePolicyResponse) { response = &CreatePolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_policy_version.go0000664�0000000�0000000�00000007707�13771713062�0033514�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreatePolicyVersion invokes the ram.CreatePolicyVersion API synchronously // api document: https://help.aliyun.com/api/ram/createpolicyversion.html func (client *Client) CreatePolicyVersion(request *CreatePolicyVersionRequest) (response *CreatePolicyVersionResponse, err error) { response = CreateCreatePolicyVersionResponse() err = client.DoAction(request, response) return } // CreatePolicyVersionWithChan invokes the ram.CreatePolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/createpolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreatePolicyVersionWithChan(request *CreatePolicyVersionRequest) (<-chan *CreatePolicyVersionResponse, <-chan error) { responseChan := make(chan *CreatePolicyVersionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreatePolicyVersion(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreatePolicyVersionWithCallback invokes the ram.CreatePolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/createpolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreatePolicyVersionWithCallback(request *CreatePolicyVersionRequest, callback func(response *CreatePolicyVersionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreatePolicyVersionResponse var err error defer close(result) response, err = client.CreatePolicyVersion(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreatePolicyVersionRequest is the request struct for api CreatePolicyVersion type CreatePolicyVersionRequest struct { *requests.RpcRequest SetAsDefault requests.Boolean `position:"Query" name:"SetAsDefault"` PolicyName string `position:"Query" name:"PolicyName"` PolicyDocument string `position:"Query" name:"PolicyDocument"` } // CreatePolicyVersionResponse is the response struct for api CreatePolicyVersion type CreatePolicyVersionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PolicyVersion PolicyVersion `json:"PolicyVersion" xml:"PolicyVersion"` } // CreateCreatePolicyVersionRequest creates a request to invoke CreatePolicyVersion API func CreateCreatePolicyVersionRequest() (request *CreatePolicyVersionRequest) { request = &CreatePolicyVersionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreatePolicyVersion", "ram", "openAPI") return } // CreateCreatePolicyVersionResponse creates a response to parse from CreatePolicyVersion response func CreateCreatePolicyVersionResponse() (response *CreatePolicyVersionResponse) { response = &CreatePolicyVersionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_role.go����������0000664�0000000�0000000�00000007076�13771713062�0031410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateRole invokes the ram.CreateRole API synchronously // api document: https://help.aliyun.com/api/ram/createrole.html func (client *Client) CreateRole(request *CreateRoleRequest) (response *CreateRoleResponse, err error) { response = CreateCreateRoleResponse() err = client.DoAction(request, response) return } // CreateRoleWithChan invokes the ram.CreateRole API asynchronously // api document: https://help.aliyun.com/api/ram/createrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateRoleWithChan(request *CreateRoleRequest) (<-chan *CreateRoleResponse, <-chan error) { responseChan := make(chan *CreateRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateRoleWithCallback invokes the ram.CreateRole API asynchronously // api document: https://help.aliyun.com/api/ram/createrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateRoleWithCallback(request *CreateRoleRequest, callback func(response *CreateRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateRoleResponse var err error defer close(result) response, err = client.CreateRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateRoleRequest is the request struct for api CreateRole type CreateRoleRequest struct { *requests.RpcRequest RoleName string `position:"Query" name:"RoleName"` Description string `position:"Query" name:"Description"` AssumeRolePolicyDocument string `position:"Query" name:"AssumeRolePolicyDocument"` } // CreateRoleResponse is the response struct for api CreateRole type CreateRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Role Role `json:"Role" xml:"Role"` } // CreateCreateRoleRequest creates a request to invoke CreateRole API func CreateCreateRoleRequest() (request *CreateRoleRequest) { request = &CreateRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreateRole", "ram", "openAPI") return } // CreateCreateRoleResponse creates a response to parse from CreateRole response func CreateCreateRoleResponse() (response *CreateRoleResponse) { response = &CreateRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/create_user.go����������0000664�0000000�0000000�00000007165�13771713062�0031424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateUser invokes the ram.CreateUser API synchronously // api document: https://help.aliyun.com/api/ram/createuser.html func (client *Client) CreateUser(request *CreateUserRequest) (response *CreateUserResponse, err error) { response = CreateCreateUserResponse() err = client.DoAction(request, response) return } // CreateUserWithChan invokes the ram.CreateUser API asynchronously // api document: https://help.aliyun.com/api/ram/createuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateUserWithChan(request *CreateUserRequest) (<-chan *CreateUserResponse, <-chan error) { responseChan := make(chan *CreateUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateUserWithCallback invokes the ram.CreateUser API asynchronously // api document: https://help.aliyun.com/api/ram/createuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateUserWithCallback(request *CreateUserRequest, callback func(response *CreateUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateUserResponse var err error defer close(result) response, err = client.CreateUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateUserRequest is the request struct for api CreateUser type CreateUserRequest struct { *requests.RpcRequest Comments string `position:"Query" name:"Comments"` DisplayName string `position:"Query" name:"DisplayName"` MobilePhone string `position:"Query" name:"MobilePhone"` Email string `position:"Query" name:"Email"` UserName string `position:"Query" name:"UserName"` } // CreateUserResponse is the response struct for api CreateUser type CreateUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` User User `json:"User" xml:"User"` } // CreateCreateUserRequest creates a request to invoke CreateUser API func CreateCreateUserRequest() (request *CreateUserRequest) { request = &CreateUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreateUser", "ram", "openAPI") return } // CreateCreateUserResponse creates a response to parse from CreateUser response func CreateCreateUserResponse() (response *CreateUserResponse) { response = &CreateUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_virtual_mfa_device.go������������������������������������������������������������������������0000664�0000000�0000000�00000007705�13771713062�0034217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // CreateVirtualMFADevice invokes the ram.CreateVirtualMFADevice API synchronously // api document: https://help.aliyun.com/api/ram/createvirtualmfadevice.html func (client *Client) CreateVirtualMFADevice(request *CreateVirtualMFADeviceRequest) (response *CreateVirtualMFADeviceResponse, err error) { response = CreateCreateVirtualMFADeviceResponse() err = client.DoAction(request, response) return } // CreateVirtualMFADeviceWithChan invokes the ram.CreateVirtualMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/createvirtualmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVirtualMFADeviceWithChan(request *CreateVirtualMFADeviceRequest) (<-chan *CreateVirtualMFADeviceResponse, <-chan error) { responseChan := make(chan *CreateVirtualMFADeviceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.CreateVirtualMFADevice(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // CreateVirtualMFADeviceWithCallback invokes the ram.CreateVirtualMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/createvirtualmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) CreateVirtualMFADeviceWithCallback(request *CreateVirtualMFADeviceRequest, callback func(response *CreateVirtualMFADeviceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *CreateVirtualMFADeviceResponse var err error defer close(result) response, err = client.CreateVirtualMFADevice(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // CreateVirtualMFADeviceRequest is the request struct for api CreateVirtualMFADevice type CreateVirtualMFADeviceRequest struct { *requests.RpcRequest VirtualMFADeviceName string `position:"Query" name:"VirtualMFADeviceName"` } // CreateVirtualMFADeviceResponse is the response struct for api CreateVirtualMFADevice type CreateVirtualMFADeviceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` VirtualMFADevice VirtualMFADevice `json:"VirtualMFADevice" xml:"VirtualMFADevice"` } // CreateCreateVirtualMFADeviceRequest creates a request to invoke CreateVirtualMFADevice API func CreateCreateVirtualMFADeviceRequest() (request *CreateVirtualMFADeviceRequest) { request = &CreateVirtualMFADeviceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "CreateVirtualMFADevice", "ram", "openAPI") return } // CreateCreateVirtualMFADeviceResponse creates a response to parse from CreateVirtualMFADevice response func CreateCreateVirtualMFADeviceResponse() (response *CreateVirtualMFADeviceResponse) { response = &CreateVirtualMFADeviceResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_access_key.go����0000664�0000000�0000000�00000007171�13771713062�0032553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteAccessKey invokes the ram.DeleteAccessKey API synchronously // api document: https://help.aliyun.com/api/ram/deleteaccesskey.html func (client *Client) DeleteAccessKey(request *DeleteAccessKeyRequest) (response *DeleteAccessKeyResponse, err error) { response = CreateDeleteAccessKeyResponse() err = client.DoAction(request, response) return } // DeleteAccessKeyWithChan invokes the ram.DeleteAccessKey API asynchronously // api document: https://help.aliyun.com/api/ram/deleteaccesskey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteAccessKeyWithChan(request *DeleteAccessKeyRequest) (<-chan *DeleteAccessKeyResponse, <-chan error) { responseChan := make(chan *DeleteAccessKeyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteAccessKey(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteAccessKeyWithCallback invokes the ram.DeleteAccessKey API asynchronously // api document: https://help.aliyun.com/api/ram/deleteaccesskey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteAccessKeyWithCallback(request *DeleteAccessKeyRequest, callback func(response *DeleteAccessKeyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteAccessKeyResponse var err error defer close(result) response, err = client.DeleteAccessKey(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteAccessKeyRequest is the request struct for api DeleteAccessKey type DeleteAccessKeyRequest struct { *requests.RpcRequest UserAccessKeyId string `position:"Query" name:"UserAccessKeyId"` UserName string `position:"Query" name:"UserName"` } // DeleteAccessKeyResponse is the response struct for api DeleteAccessKey type DeleteAccessKeyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteAccessKeyRequest creates a request to invoke DeleteAccessKey API func CreateDeleteAccessKeyRequest() (request *DeleteAccessKeyRequest) { request = &DeleteAccessKeyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeleteAccessKey", "ram", "openAPI") return } // CreateDeleteAccessKeyResponse creates a response to parse from DeleteAccessKey response func CreateDeleteAccessKeyResponse() (response *DeleteAccessKeyResponse) { response = &DeleteAccessKeyResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_group.go���������0000664�0000000�0000000�00000006622�13771713062�0031576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteGroup invokes the ram.DeleteGroup API synchronously // api document: https://help.aliyun.com/api/ram/deletegroup.html func (client *Client) DeleteGroup(request *DeleteGroupRequest) (response *DeleteGroupResponse, err error) { response = CreateDeleteGroupResponse() err = client.DoAction(request, response) return } // DeleteGroupWithChan invokes the ram.DeleteGroup API asynchronously // api document: https://help.aliyun.com/api/ram/deletegroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteGroupWithChan(request *DeleteGroupRequest) (<-chan *DeleteGroupResponse, <-chan error) { responseChan := make(chan *DeleteGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteGroupWithCallback invokes the ram.DeleteGroup API asynchronously // api document: https://help.aliyun.com/api/ram/deletegroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteGroupWithCallback(request *DeleteGroupRequest, callback func(response *DeleteGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteGroupResponse var err error defer close(result) response, err = client.DeleteGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteGroupRequest is the request struct for api DeleteGroup type DeleteGroupRequest struct { *requests.RpcRequest GroupName string `position:"Query" name:"GroupName"` } // DeleteGroupResponse is the response struct for api DeleteGroup type DeleteGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteGroupRequest creates a request to invoke DeleteGroup API func CreateDeleteGroupRequest() (request *DeleteGroupRequest) { request = &DeleteGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeleteGroup", "ram", "openAPI") return } // CreateDeleteGroupResponse creates a response to parse from DeleteGroup response func CreateDeleteGroupResponse() (response *DeleteGroupResponse) { response = &DeleteGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_login_profile.go�0000664�0000000�0000000�00000007250�13771713062�0033270�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteLoginProfile invokes the ram.DeleteLoginProfile API synchronously // api document: https://help.aliyun.com/api/ram/deleteloginprofile.html func (client *Client) DeleteLoginProfile(request *DeleteLoginProfileRequest) (response *DeleteLoginProfileResponse, err error) { response = CreateDeleteLoginProfileResponse() err = client.DoAction(request, response) return } // DeleteLoginProfileWithChan invokes the ram.DeleteLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/deleteloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteLoginProfileWithChan(request *DeleteLoginProfileRequest) (<-chan *DeleteLoginProfileResponse, <-chan error) { responseChan := make(chan *DeleteLoginProfileResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteLoginProfile(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteLoginProfileWithCallback invokes the ram.DeleteLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/deleteloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteLoginProfileWithCallback(request *DeleteLoginProfileRequest, callback func(response *DeleteLoginProfileResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteLoginProfileResponse var err error defer close(result) response, err = client.DeleteLoginProfile(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteLoginProfileRequest is the request struct for api DeleteLoginProfile type DeleteLoginProfileRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // DeleteLoginProfileResponse is the response struct for api DeleteLoginProfile type DeleteLoginProfileResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteLoginProfileRequest creates a request to invoke DeleteLoginProfile API func CreateDeleteLoginProfileRequest() (request *DeleteLoginProfileRequest) { request = &DeleteLoginProfileRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeleteLoginProfile", "ram", "openAPI") return } // CreateDeleteLoginProfileResponse creates a response to parse from DeleteLoginProfile response func CreateDeleteLoginProfileResponse() (response *DeleteLoginProfileResponse) { response = &DeleteLoginProfileResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy.go��������0000664�0000000�0000000�00000006674�13771713062�0031750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeletePolicy invokes the ram.DeletePolicy API synchronously // api document: https://help.aliyun.com/api/ram/deletepolicy.html func (client *Client) DeletePolicy(request *DeletePolicyRequest) (response *DeletePolicyResponse, err error) { response = CreateDeletePolicyResponse() err = client.DoAction(request, response) return } // DeletePolicyWithChan invokes the ram.DeletePolicy API asynchronously // api document: https://help.aliyun.com/api/ram/deletepolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePolicyWithChan(request *DeletePolicyRequest) (<-chan *DeletePolicyResponse, <-chan error) { responseChan := make(chan *DeletePolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeletePolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeletePolicyWithCallback invokes the ram.DeletePolicy API asynchronously // api document: https://help.aliyun.com/api/ram/deletepolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePolicyWithCallback(request *DeletePolicyRequest, callback func(response *DeletePolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeletePolicyResponse var err error defer close(result) response, err = client.DeletePolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeletePolicyRequest is the request struct for api DeletePolicy type DeletePolicyRequest struct { *requests.RpcRequest PolicyName string `position:"Query" name:"PolicyName"` } // DeletePolicyResponse is the response struct for api DeletePolicy type DeletePolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeletePolicyRequest creates a request to invoke DeletePolicy API func CreateDeletePolicyRequest() (request *DeletePolicyRequest) { request = &DeletePolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeletePolicy", "ram", "openAPI") return } // CreateDeletePolicyResponse creates a response to parse from DeletePolicy response func CreateDeletePolicyResponse() (response *DeletePolicyResponse) { response = &DeletePolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_policy_version.go0000664�0000000�0000000�00000007413�13771713062�0033505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeletePolicyVersion invokes the ram.DeletePolicyVersion API synchronously // api document: https://help.aliyun.com/api/ram/deletepolicyversion.html func (client *Client) DeletePolicyVersion(request *DeletePolicyVersionRequest) (response *DeletePolicyVersionResponse, err error) { response = CreateDeletePolicyVersionResponse() err = client.DoAction(request, response) return } // DeletePolicyVersionWithChan invokes the ram.DeletePolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/deletepolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePolicyVersionWithChan(request *DeletePolicyVersionRequest) (<-chan *DeletePolicyVersionResponse, <-chan error) { responseChan := make(chan *DeletePolicyVersionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeletePolicyVersion(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeletePolicyVersionWithCallback invokes the ram.DeletePolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/deletepolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePolicyVersionWithCallback(request *DeletePolicyVersionRequest, callback func(response *DeletePolicyVersionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeletePolicyVersionResponse var err error defer close(result) response, err = client.DeletePolicyVersion(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeletePolicyVersionRequest is the request struct for api DeletePolicyVersion type DeletePolicyVersionRequest struct { *requests.RpcRequest VersionId string `position:"Query" name:"VersionId"` PolicyName string `position:"Query" name:"PolicyName"` } // DeletePolicyVersionResponse is the response struct for api DeletePolicyVersion type DeletePolicyVersionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeletePolicyVersionRequest creates a request to invoke DeletePolicyVersion API func CreateDeletePolicyVersionRequest() (request *DeletePolicyVersionRequest) { request = &DeletePolicyVersionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeletePolicyVersion", "ram", "openAPI") return } // CreateDeletePolicyVersionResponse creates a response to parse from DeletePolicyVersion response func CreateDeletePolicyVersionResponse() (response *DeletePolicyVersionResponse) { response = &DeletePolicyVersionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_public_key.go����0000664�0000000�0000000�00000007171�13771713062�0032570�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeletePublicKey invokes the ram.DeletePublicKey API synchronously // api document: https://help.aliyun.com/api/ram/deletepublickey.html func (client *Client) DeletePublicKey(request *DeletePublicKeyRequest) (response *DeletePublicKeyResponse, err error) { response = CreateDeletePublicKeyResponse() err = client.DoAction(request, response) return } // DeletePublicKeyWithChan invokes the ram.DeletePublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/deletepublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePublicKeyWithChan(request *DeletePublicKeyRequest) (<-chan *DeletePublicKeyResponse, <-chan error) { responseChan := make(chan *DeletePublicKeyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeletePublicKey(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeletePublicKeyWithCallback invokes the ram.DeletePublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/deletepublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeletePublicKeyWithCallback(request *DeletePublicKeyRequest, callback func(response *DeletePublicKeyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeletePublicKeyResponse var err error defer close(result) response, err = client.DeletePublicKey(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeletePublicKeyRequest is the request struct for api DeletePublicKey type DeletePublicKeyRequest struct { *requests.RpcRequest UserPublicKeyId string `position:"Query" name:"UserPublicKeyId"` UserName string `position:"Query" name:"UserName"` } // DeletePublicKeyResponse is the response struct for api DeletePublicKey type DeletePublicKeyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeletePublicKeyRequest creates a request to invoke DeletePublicKey API func CreateDeletePublicKeyRequest() (request *DeletePublicKeyRequest) { request = &DeletePublicKeyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeletePublicKey", "ram", "openAPI") return } // CreateDeletePublicKeyResponse creates a response to parse from DeletePublicKey response func CreateDeletePublicKeyResponse() (response *DeletePublicKeyResponse) { response = &DeletePublicKeyResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_role.go����������0000664�0000000�0000000�00000006550�13771713062�0031403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteRole invokes the ram.DeleteRole API synchronously // api document: https://help.aliyun.com/api/ram/deleterole.html func (client *Client) DeleteRole(request *DeleteRoleRequest) (response *DeleteRoleResponse, err error) { response = CreateDeleteRoleResponse() err = client.DoAction(request, response) return } // DeleteRoleWithChan invokes the ram.DeleteRole API asynchronously // api document: https://help.aliyun.com/api/ram/deleterole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteRoleWithChan(request *DeleteRoleRequest) (<-chan *DeleteRoleResponse, <-chan error) { responseChan := make(chan *DeleteRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteRoleWithCallback invokes the ram.DeleteRole API asynchronously // api document: https://help.aliyun.com/api/ram/deleterole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteRoleWithCallback(request *DeleteRoleRequest, callback func(response *DeleteRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteRoleResponse var err error defer close(result) response, err = client.DeleteRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteRoleRequest is the request struct for api DeleteRole type DeleteRoleRequest struct { *requests.RpcRequest RoleName string `position:"Query" name:"RoleName"` } // DeleteRoleResponse is the response struct for api DeleteRole type DeleteRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteRoleRequest creates a request to invoke DeleteRole API func CreateDeleteRoleRequest() (request *DeleteRoleRequest) { request = &DeleteRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeleteRole", "ram", "openAPI") return } // CreateDeleteRoleResponse creates a response to parse from DeleteRole response func CreateDeleteRoleResponse() (response *DeleteRoleResponse) { response = &DeleteRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/delete_user.go����������0000664�0000000�0000000�00000006550�13771713062�0031420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteUser invokes the ram.DeleteUser API synchronously // api document: https://help.aliyun.com/api/ram/deleteuser.html func (client *Client) DeleteUser(request *DeleteUserRequest) (response *DeleteUserResponse, err error) { response = CreateDeleteUserResponse() err = client.DoAction(request, response) return } // DeleteUserWithChan invokes the ram.DeleteUser API asynchronously // api document: https://help.aliyun.com/api/ram/deleteuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteUserWithChan(request *DeleteUserRequest) (<-chan *DeleteUserResponse, <-chan error) { responseChan := make(chan *DeleteUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteUserWithCallback invokes the ram.DeleteUser API asynchronously // api document: https://help.aliyun.com/api/ram/deleteuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteUserWithCallback(request *DeleteUserRequest, callback func(response *DeleteUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteUserResponse var err error defer close(result) response, err = client.DeleteUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteUserRequest is the request struct for api DeleteUser type DeleteUserRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // DeleteUserResponse is the response struct for api DeleteUser type DeleteUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteUserRequest creates a request to invoke DeleteUser API func CreateDeleteUserRequest() (request *DeleteUserRequest) { request = &DeleteUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeleteUser", "ram", "openAPI") return } // CreateDeleteUserResponse creates a response to parse from DeleteUser response func CreateDeleteUserResponse() (response *DeleteUserResponse) { response = &DeleteUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������delete_virtual_mfa_device.go������������������������������������������������������������������������0000664�0000000�0000000�00000007520�13771713062�0034211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DeleteVirtualMFADevice invokes the ram.DeleteVirtualMFADevice API synchronously // api document: https://help.aliyun.com/api/ram/deletevirtualmfadevice.html func (client *Client) DeleteVirtualMFADevice(request *DeleteVirtualMFADeviceRequest) (response *DeleteVirtualMFADeviceResponse, err error) { response = CreateDeleteVirtualMFADeviceResponse() err = client.DoAction(request, response) return } // DeleteVirtualMFADeviceWithChan invokes the ram.DeleteVirtualMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/deletevirtualmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVirtualMFADeviceWithChan(request *DeleteVirtualMFADeviceRequest) (<-chan *DeleteVirtualMFADeviceResponse, <-chan error) { responseChan := make(chan *DeleteVirtualMFADeviceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DeleteVirtualMFADevice(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DeleteVirtualMFADeviceWithCallback invokes the ram.DeleteVirtualMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/deletevirtualmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DeleteVirtualMFADeviceWithCallback(request *DeleteVirtualMFADeviceRequest, callback func(response *DeleteVirtualMFADeviceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DeleteVirtualMFADeviceResponse var err error defer close(result) response, err = client.DeleteVirtualMFADevice(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DeleteVirtualMFADeviceRequest is the request struct for api DeleteVirtualMFADevice type DeleteVirtualMFADeviceRequest struct { *requests.RpcRequest SerialNumber string `position:"Query" name:"SerialNumber"` } // DeleteVirtualMFADeviceResponse is the response struct for api DeleteVirtualMFADevice type DeleteVirtualMFADeviceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDeleteVirtualMFADeviceRequest creates a request to invoke DeleteVirtualMFADevice API func CreateDeleteVirtualMFADeviceRequest() (request *DeleteVirtualMFADeviceRequest) { request = &DeleteVirtualMFADeviceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DeleteVirtualMFADevice", "ram", "openAPI") return } // CreateDeleteVirtualMFADeviceResponse creates a response to parse from DeleteVirtualMFADevice response func CreateDeleteVirtualMFADeviceResponse() (response *DeleteVirtualMFADeviceResponse) { response = &DeleteVirtualMFADeviceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������detach_policy_from_group.go�������������������������������������������������������������������������0000664�0000000�0000000�00000007623�13771713062�0034111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachPolicyFromGroup invokes the ram.DetachPolicyFromGroup API synchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromgroup.html func (client *Client) DetachPolicyFromGroup(request *DetachPolicyFromGroupRequest) (response *DetachPolicyFromGroupResponse, err error) { response = CreateDetachPolicyFromGroupResponse() err = client.DoAction(request, response) return } // DetachPolicyFromGroupWithChan invokes the ram.DetachPolicyFromGroup API asynchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachPolicyFromGroupWithChan(request *DetachPolicyFromGroupRequest) (<-chan *DetachPolicyFromGroupResponse, <-chan error) { responseChan := make(chan *DetachPolicyFromGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachPolicyFromGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachPolicyFromGroupWithCallback invokes the ram.DetachPolicyFromGroup API asynchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachPolicyFromGroupWithCallback(request *DetachPolicyFromGroupRequest, callback func(response *DetachPolicyFromGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachPolicyFromGroupResponse var err error defer close(result) response, err = client.DetachPolicyFromGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachPolicyFromGroupRequest is the request struct for api DetachPolicyFromGroup type DetachPolicyFromGroupRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` GroupName string `position:"Query" name:"GroupName"` } // DetachPolicyFromGroupResponse is the response struct for api DetachPolicyFromGroup type DetachPolicyFromGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDetachPolicyFromGroupRequest creates a request to invoke DetachPolicyFromGroup API func CreateDetachPolicyFromGroupRequest() (request *DetachPolicyFromGroupRequest) { request = &DetachPolicyFromGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DetachPolicyFromGroup", "ram", "openAPI") return } // CreateDetachPolicyFromGroupResponse creates a response to parse from DetachPolicyFromGroup response func CreateDetachPolicyFromGroupResponse() (response *DetachPolicyFromGroupResponse) { response = &DetachPolicyFromGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������detach_policy_from_role.go��������������������������������������������������������������������������0000664�0000000�0000000�00000007552�13771713062�0033717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachPolicyFromRole invokes the ram.DetachPolicyFromRole API synchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromrole.html func (client *Client) DetachPolicyFromRole(request *DetachPolicyFromRoleRequest) (response *DetachPolicyFromRoleResponse, err error) { response = CreateDetachPolicyFromRoleResponse() err = client.DoAction(request, response) return } // DetachPolicyFromRoleWithChan invokes the ram.DetachPolicyFromRole API asynchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachPolicyFromRoleWithChan(request *DetachPolicyFromRoleRequest) (<-chan *DetachPolicyFromRoleResponse, <-chan error) { responseChan := make(chan *DetachPolicyFromRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachPolicyFromRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachPolicyFromRoleWithCallback invokes the ram.DetachPolicyFromRole API asynchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachPolicyFromRoleWithCallback(request *DetachPolicyFromRoleRequest, callback func(response *DetachPolicyFromRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachPolicyFromRoleResponse var err error defer close(result) response, err = client.DetachPolicyFromRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachPolicyFromRoleRequest is the request struct for api DetachPolicyFromRole type DetachPolicyFromRoleRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` RoleName string `position:"Query" name:"RoleName"` PolicyName string `position:"Query" name:"PolicyName"` } // DetachPolicyFromRoleResponse is the response struct for api DetachPolicyFromRole type DetachPolicyFromRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDetachPolicyFromRoleRequest creates a request to invoke DetachPolicyFromRole API func CreateDetachPolicyFromRoleRequest() (request *DetachPolicyFromRoleRequest) { request = &DetachPolicyFromRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DetachPolicyFromRole", "ram", "openAPI") return } // CreateDetachPolicyFromRoleResponse creates a response to parse from DetachPolicyFromRole response func CreateDetachPolicyFromRoleResponse() (response *DetachPolicyFromRoleResponse) { response = &DetachPolicyFromRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������detach_policy_from_user.go��������������������������������������������������������������������������0000664�0000000�0000000�00000007552�13771713062�0033734�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // DetachPolicyFromUser invokes the ram.DetachPolicyFromUser API synchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromuser.html func (client *Client) DetachPolicyFromUser(request *DetachPolicyFromUserRequest) (response *DetachPolicyFromUserResponse, err error) { response = CreateDetachPolicyFromUserResponse() err = client.DoAction(request, response) return } // DetachPolicyFromUserWithChan invokes the ram.DetachPolicyFromUser API asynchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachPolicyFromUserWithChan(request *DetachPolicyFromUserRequest) (<-chan *DetachPolicyFromUserResponse, <-chan error) { responseChan := make(chan *DetachPolicyFromUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DetachPolicyFromUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DetachPolicyFromUserWithCallback invokes the ram.DetachPolicyFromUser API asynchronously // api document: https://help.aliyun.com/api/ram/detachpolicyfromuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DetachPolicyFromUserWithCallback(request *DetachPolicyFromUserRequest, callback func(response *DetachPolicyFromUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DetachPolicyFromUserResponse var err error defer close(result) response, err = client.DetachPolicyFromUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DetachPolicyFromUserRequest is the request struct for api DetachPolicyFromUser type DetachPolicyFromUserRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` UserName string `position:"Query" name:"UserName"` } // DetachPolicyFromUserResponse is the response struct for api DetachPolicyFromUser type DetachPolicyFromUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateDetachPolicyFromUserRequest creates a request to invoke DetachPolicyFromUser API func CreateDetachPolicyFromUserRequest() (request *DetachPolicyFromUserRequest) { request = &DetachPolicyFromUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "DetachPolicyFromUser", "ram", "openAPI") return } // CreateDetachPolicyFromUserResponse creates a response to parse from DetachPolicyFromUser response func CreateDetachPolicyFromUserResponse() (response *DetachPolicyFromUserResponse) { response = &DetachPolicyFromUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������get_access_key_last_used.go�������������������������������������������������������������������������0000664�0000000�0000000�00000007654�13771713062�0034062�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetAccessKeyLastUsed invokes the ram.GetAccessKeyLastUsed API synchronously // api document: https://help.aliyun.com/api/ram/getaccesskeylastused.html func (client *Client) GetAccessKeyLastUsed(request *GetAccessKeyLastUsedRequest) (response *GetAccessKeyLastUsedResponse, err error) { response = CreateGetAccessKeyLastUsedResponse() err = client.DoAction(request, response) return } // GetAccessKeyLastUsedWithChan invokes the ram.GetAccessKeyLastUsed API asynchronously // api document: https://help.aliyun.com/api/ram/getaccesskeylastused.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetAccessKeyLastUsedWithChan(request *GetAccessKeyLastUsedRequest) (<-chan *GetAccessKeyLastUsedResponse, <-chan error) { responseChan := make(chan *GetAccessKeyLastUsedResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetAccessKeyLastUsed(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetAccessKeyLastUsedWithCallback invokes the ram.GetAccessKeyLastUsed API asynchronously // api document: https://help.aliyun.com/api/ram/getaccesskeylastused.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetAccessKeyLastUsedWithCallback(request *GetAccessKeyLastUsedRequest, callback func(response *GetAccessKeyLastUsedResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetAccessKeyLastUsedResponse var err error defer close(result) response, err = client.GetAccessKeyLastUsed(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetAccessKeyLastUsedRequest is the request struct for api GetAccessKeyLastUsed type GetAccessKeyLastUsedRequest struct { *requests.RpcRequest UserAccessKeyId string `position:"Query" name:"UserAccessKeyId"` UserName string `position:"Query" name:"UserName"` } // GetAccessKeyLastUsedResponse is the response struct for api GetAccessKeyLastUsed type GetAccessKeyLastUsedResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AccessKeyLastUsed AccessKeyLastUsed `json:"AccessKeyLastUsed" xml:"AccessKeyLastUsed"` } // CreateGetAccessKeyLastUsedRequest creates a request to invoke GetAccessKeyLastUsed API func CreateGetAccessKeyLastUsedRequest() (request *GetAccessKeyLastUsedRequest) { request = &GetAccessKeyLastUsedRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetAccessKeyLastUsed", "ram", "openAPI") return } // CreateGetAccessKeyLastUsedResponse creates a response to parse from GetAccessKeyLastUsed response func CreateGetAccessKeyLastUsedResponse() (response *GetAccessKeyLastUsedResponse) { response = &GetAccessKeyLastUsedResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_account_alias.go����0000664�0000000�0000000�00000007075�13771713062�0032567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetAccountAlias invokes the ram.GetAccountAlias API synchronously // api document: https://help.aliyun.com/api/ram/getaccountalias.html func (client *Client) GetAccountAlias(request *GetAccountAliasRequest) (response *GetAccountAliasResponse, err error) { response = CreateGetAccountAliasResponse() err = client.DoAction(request, response) return } // GetAccountAliasWithChan invokes the ram.GetAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/getaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetAccountAliasWithChan(request *GetAccountAliasRequest) (<-chan *GetAccountAliasResponse, <-chan error) { responseChan := make(chan *GetAccountAliasResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetAccountAlias(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetAccountAliasWithCallback invokes the ram.GetAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/getaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetAccountAliasWithCallback(request *GetAccountAliasRequest, callback func(response *GetAccountAliasResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetAccountAliasResponse var err error defer close(result) response, err = client.GetAccountAlias(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetAccountAliasRequest is the request struct for api GetAccountAlias type GetAccountAliasRequest struct { *requests.RpcRequest } // GetAccountAliasResponse is the response struct for api GetAccountAlias type GetAccountAliasResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AccountAlias string `json:"AccountAlias" xml:"AccountAlias"` } // CreateGetAccountAliasRequest creates a request to invoke GetAccountAlias API func CreateGetAccountAliasRequest() (request *GetAccountAliasRequest) { request = &GetAccountAliasRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetAccountAlias", "ram", "openAPI") return } // CreateGetAccountAliasResponse creates a response to parse from GetAccountAlias response func CreateGetAccountAliasResponse() (response *GetAccountAliasResponse) { response = &GetAccountAliasResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_group.go������������0000664�0000000�0000000�00000006507�13771713062�0031115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetGroup invokes the ram.GetGroup API synchronously // api document: https://help.aliyun.com/api/ram/getgroup.html func (client *Client) GetGroup(request *GetGroupRequest) (response *GetGroupResponse, err error) { response = CreateGetGroupResponse() err = client.DoAction(request, response) return } // GetGroupWithChan invokes the ram.GetGroup API asynchronously // api document: https://help.aliyun.com/api/ram/getgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetGroupWithChan(request *GetGroupRequest) (<-chan *GetGroupResponse, <-chan error) { responseChan := make(chan *GetGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetGroupWithCallback invokes the ram.GetGroup API asynchronously // api document: https://help.aliyun.com/api/ram/getgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetGroupWithCallback(request *GetGroupRequest, callback func(response *GetGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetGroupResponse var err error defer close(result) response, err = client.GetGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetGroupRequest is the request struct for api GetGroup type GetGroupRequest struct { *requests.RpcRequest GroupName string `position:"Query" name:"GroupName"` } // GetGroupResponse is the response struct for api GetGroup type GetGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Group Group `json:"Group" xml:"Group"` } // CreateGetGroupRequest creates a request to invoke GetGroup API func CreateGetGroupRequest() (request *GetGroupRequest) { request = &GetGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetGroup", "ram", "openAPI") return } // CreateGetGroupResponse creates a response to parse from GetGroup response func CreateGetGroupResponse() (response *GetGroupResponse) { response = &GetGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_login_profile.go����0000664�0000000�0000000�00000007175�13771713062�0032613�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetLoginProfile invokes the ram.GetLoginProfile API synchronously // api document: https://help.aliyun.com/api/ram/getloginprofile.html func (client *Client) GetLoginProfile(request *GetLoginProfileRequest) (response *GetLoginProfileResponse, err error) { response = CreateGetLoginProfileResponse() err = client.DoAction(request, response) return } // GetLoginProfileWithChan invokes the ram.GetLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/getloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetLoginProfileWithChan(request *GetLoginProfileRequest) (<-chan *GetLoginProfileResponse, <-chan error) { responseChan := make(chan *GetLoginProfileResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetLoginProfile(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetLoginProfileWithCallback invokes the ram.GetLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/getloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetLoginProfileWithCallback(request *GetLoginProfileRequest, callback func(response *GetLoginProfileResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetLoginProfileResponse var err error defer close(result) response, err = client.GetLoginProfile(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetLoginProfileRequest is the request struct for api GetLoginProfile type GetLoginProfileRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // GetLoginProfileResponse is the response struct for api GetLoginProfile type GetLoginProfileResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` LoginProfile LoginProfile `json:"LoginProfile" xml:"LoginProfile"` } // CreateGetLoginProfileRequest creates a request to invoke GetLoginProfile API func CreateGetLoginProfileRequest() (request *GetLoginProfileRequest) { request = &GetLoginProfileRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetLoginProfile", "ram", "openAPI") return } // CreateGetLoginProfileResponse creates a response to parse from GetLoginProfile response func CreateGetLoginProfileResponse() (response *GetLoginProfileResponse) { response = &GetLoginProfileResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_password_policy.go��0000664�0000000�0000000�00000007245�13771713062�0033202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetPasswordPolicy invokes the ram.GetPasswordPolicy API synchronously // api document: https://help.aliyun.com/api/ram/getpasswordpolicy.html func (client *Client) GetPasswordPolicy(request *GetPasswordPolicyRequest) (response *GetPasswordPolicyResponse, err error) { response = CreateGetPasswordPolicyResponse() err = client.DoAction(request, response) return } // GetPasswordPolicyWithChan invokes the ram.GetPasswordPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/getpasswordpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPasswordPolicyWithChan(request *GetPasswordPolicyRequest) (<-chan *GetPasswordPolicyResponse, <-chan error) { responseChan := make(chan *GetPasswordPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetPasswordPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetPasswordPolicyWithCallback invokes the ram.GetPasswordPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/getpasswordpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPasswordPolicyWithCallback(request *GetPasswordPolicyRequest, callback func(response *GetPasswordPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetPasswordPolicyResponse var err error defer close(result) response, err = client.GetPasswordPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetPasswordPolicyRequest is the request struct for api GetPasswordPolicy type GetPasswordPolicyRequest struct { *requests.RpcRequest } // GetPasswordPolicyResponse is the response struct for api GetPasswordPolicy type GetPasswordPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PasswordPolicy PasswordPolicy `json:"PasswordPolicy" xml:"PasswordPolicy"` } // CreateGetPasswordPolicyRequest creates a request to invoke GetPasswordPolicy API func CreateGetPasswordPolicyRequest() (request *GetPasswordPolicyRequest) { request = &GetPasswordPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetPasswordPolicy", "ram", "openAPI") return } // CreateGetPasswordPolicyResponse creates a response to parse from GetPasswordPolicy response func CreateGetPasswordPolicyResponse() (response *GetPasswordPolicyResponse) { response = &GetPasswordPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy.go�����������0000664�0000000�0000000�00000006653�13771713062�0031262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetPolicy invokes the ram.GetPolicy API synchronously // api document: https://help.aliyun.com/api/ram/getpolicy.html func (client *Client) GetPolicy(request *GetPolicyRequest) (response *GetPolicyResponse, err error) { response = CreateGetPolicyResponse() err = client.DoAction(request, response) return } // GetPolicyWithChan invokes the ram.GetPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/getpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPolicyWithChan(request *GetPolicyRequest) (<-chan *GetPolicyResponse, <-chan error) { responseChan := make(chan *GetPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetPolicyWithCallback invokes the ram.GetPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/getpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPolicyWithCallback(request *GetPolicyRequest, callback func(response *GetPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetPolicyResponse var err error defer close(result) response, err = client.GetPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetPolicyRequest is the request struct for api GetPolicy type GetPolicyRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` } // GetPolicyResponse is the response struct for api GetPolicy type GetPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Policy Policy `json:"Policy" xml:"Policy"` } // CreateGetPolicyRequest creates a request to invoke GetPolicy API func CreateGetPolicyRequest() (request *GetPolicyRequest) { request = &GetPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetPolicy", "ram", "openAPI") return } // CreateGetPolicyResponse creates a response to parse from GetPolicy response func CreateGetPolicyResponse() (response *GetPolicyResponse) { response = &GetPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_policy_version.go���0000664�0000000�0000000�00000007436�13771713062�0033027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetPolicyVersion invokes the ram.GetPolicyVersion API synchronously // api document: https://help.aliyun.com/api/ram/getpolicyversion.html func (client *Client) GetPolicyVersion(request *GetPolicyVersionRequest) (response *GetPolicyVersionResponse, err error) { response = CreateGetPolicyVersionResponse() err = client.DoAction(request, response) return } // GetPolicyVersionWithChan invokes the ram.GetPolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/getpolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPolicyVersionWithChan(request *GetPolicyVersionRequest) (<-chan *GetPolicyVersionResponse, <-chan error) { responseChan := make(chan *GetPolicyVersionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetPolicyVersion(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetPolicyVersionWithCallback invokes the ram.GetPolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/getpolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPolicyVersionWithCallback(request *GetPolicyVersionRequest, callback func(response *GetPolicyVersionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetPolicyVersionResponse var err error defer close(result) response, err = client.GetPolicyVersion(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetPolicyVersionRequest is the request struct for api GetPolicyVersion type GetPolicyVersionRequest struct { *requests.RpcRequest VersionId string `position:"Query" name:"VersionId"` PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` } // GetPolicyVersionResponse is the response struct for api GetPolicyVersion type GetPolicyVersionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PolicyVersion PolicyVersion `json:"PolicyVersion" xml:"PolicyVersion"` } // CreateGetPolicyVersionRequest creates a request to invoke GetPolicyVersion API func CreateGetPolicyVersionRequest() (request *GetPolicyVersionRequest) { request = &GetPolicyVersionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetPolicyVersion", "ram", "openAPI") return } // CreateGetPolicyVersionResponse creates a response to parse from GetPolicyVersion response func CreateGetPolicyVersionResponse() (response *GetPolicyVersionResponse) { response = &GetPolicyVersionResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_public_key.go�������0000664�0000000�0000000�00000007074�13771713062�0032107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetPublicKey invokes the ram.GetPublicKey API synchronously // api document: https://help.aliyun.com/api/ram/getpublickey.html func (client *Client) GetPublicKey(request *GetPublicKeyRequest) (response *GetPublicKeyResponse, err error) { response = CreateGetPublicKeyResponse() err = client.DoAction(request, response) return } // GetPublicKeyWithChan invokes the ram.GetPublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/getpublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPublicKeyWithChan(request *GetPublicKeyRequest) (<-chan *GetPublicKeyResponse, <-chan error) { responseChan := make(chan *GetPublicKeyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetPublicKey(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetPublicKeyWithCallback invokes the ram.GetPublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/getpublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetPublicKeyWithCallback(request *GetPublicKeyRequest, callback func(response *GetPublicKeyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetPublicKeyResponse var err error defer close(result) response, err = client.GetPublicKey(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetPublicKeyRequest is the request struct for api GetPublicKey type GetPublicKeyRequest struct { *requests.RpcRequest UserPublicKeyId string `position:"Query" name:"UserPublicKeyId"` UserName string `position:"Query" name:"UserName"` } // GetPublicKeyResponse is the response struct for api GetPublicKey type GetPublicKeyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PublicKey PublicKey `json:"PublicKey" xml:"PublicKey"` } // CreateGetPublicKeyRequest creates a request to invoke GetPublicKey API func CreateGetPublicKeyRequest() (request *GetPublicKeyRequest) { request = &GetPublicKeyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetPublicKey", "ram", "openAPI") return } // CreateGetPublicKeyResponse creates a response to parse from GetPublicKey response func CreateGetPublicKeyResponse() (response *GetPublicKeyResponse) { response = &GetPublicKeyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_role.go�������������0000664�0000000�0000000�00000006433�13771713062�0030720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetRole invokes the ram.GetRole API synchronously // api document: https://help.aliyun.com/api/ram/getrole.html func (client *Client) GetRole(request *GetRoleRequest) (response *GetRoleResponse, err error) { response = CreateGetRoleResponse() err = client.DoAction(request, response) return } // GetRoleWithChan invokes the ram.GetRole API asynchronously // api document: https://help.aliyun.com/api/ram/getrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetRoleWithChan(request *GetRoleRequest) (<-chan *GetRoleResponse, <-chan error) { responseChan := make(chan *GetRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetRoleWithCallback invokes the ram.GetRole API asynchronously // api document: https://help.aliyun.com/api/ram/getrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetRoleWithCallback(request *GetRoleRequest, callback func(response *GetRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetRoleResponse var err error defer close(result) response, err = client.GetRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetRoleRequest is the request struct for api GetRole type GetRoleRequest struct { *requests.RpcRequest RoleName string `position:"Query" name:"RoleName"` } // GetRoleResponse is the response struct for api GetRole type GetRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Role Role `json:"Role" xml:"Role"` } // CreateGetRoleRequest creates a request to invoke GetRole API func CreateGetRoleRequest() (request *GetRoleRequest) { request = &GetRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetRole", "ram", "openAPI") return } // CreateGetRoleResponse creates a response to parse from GetRole response func CreateGetRoleResponse() (response *GetRoleResponse) { response = &GetRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_security_preference.go��������������������������������������������������������������������������0000664�0000000�0000000�00000007535�13771713062�0033751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetSecurityPreference invokes the ram.GetSecurityPreference API synchronously // api document: https://help.aliyun.com/api/ram/getsecuritypreference.html func (client *Client) GetSecurityPreference(request *GetSecurityPreferenceRequest) (response *GetSecurityPreferenceResponse, err error) { response = CreateGetSecurityPreferenceResponse() err = client.DoAction(request, response) return } // GetSecurityPreferenceWithChan invokes the ram.GetSecurityPreference API asynchronously // api document: https://help.aliyun.com/api/ram/getsecuritypreference.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetSecurityPreferenceWithChan(request *GetSecurityPreferenceRequest) (<-chan *GetSecurityPreferenceResponse, <-chan error) { responseChan := make(chan *GetSecurityPreferenceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetSecurityPreference(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetSecurityPreferenceWithCallback invokes the ram.GetSecurityPreference API asynchronously // api document: https://help.aliyun.com/api/ram/getsecuritypreference.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetSecurityPreferenceWithCallback(request *GetSecurityPreferenceRequest, callback func(response *GetSecurityPreferenceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetSecurityPreferenceResponse var err error defer close(result) response, err = client.GetSecurityPreference(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetSecurityPreferenceRequest is the request struct for api GetSecurityPreference type GetSecurityPreferenceRequest struct { *requests.RpcRequest } // GetSecurityPreferenceResponse is the response struct for api GetSecurityPreference type GetSecurityPreferenceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` SecurityPreference SecurityPreference `json:"SecurityPreference" xml:"SecurityPreference"` } // CreateGetSecurityPreferenceRequest creates a request to invoke GetSecurityPreference API func CreateGetSecurityPreferenceRequest() (request *GetSecurityPreferenceRequest) { request = &GetSecurityPreferenceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetSecurityPreference", "ram", "openAPI") return } // CreateGetSecurityPreferenceResponse creates a response to parse from GetSecurityPreference response func CreateGetSecurityPreferenceResponse() (response *GetSecurityPreferenceResponse) { response = &GetSecurityPreferenceResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user.go�������������0000664�0000000�0000000�00000006433�13771713062�0030735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetUser invokes the ram.GetUser API synchronously // api document: https://help.aliyun.com/api/ram/getuser.html func (client *Client) GetUser(request *GetUserRequest) (response *GetUserResponse, err error) { response = CreateGetUserResponse() err = client.DoAction(request, response) return } // GetUserWithChan invokes the ram.GetUser API asynchronously // api document: https://help.aliyun.com/api/ram/getuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetUserWithChan(request *GetUserRequest) (<-chan *GetUserResponse, <-chan error) { responseChan := make(chan *GetUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetUserWithCallback invokes the ram.GetUser API asynchronously // api document: https://help.aliyun.com/api/ram/getuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetUserWithCallback(request *GetUserRequest, callback func(response *GetUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetUserResponse var err error defer close(result) response, err = client.GetUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetUserRequest is the request struct for api GetUser type GetUserRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // GetUserResponse is the response struct for api GetUser type GetUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` User User `json:"User" xml:"User"` } // CreateGetUserRequest creates a request to invoke GetUser API func CreateGetUserRequest() (request *GetUserRequest) { request = &GetUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetUser", "ram", "openAPI") return } // CreateGetUserResponse creates a response to parse from GetUser response func CreateGetUserResponse() (response *GetUserResponse) { response = &GetUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/get_user_mfa_info.go����0000664�0000000�0000000�00000007103�13771713062�0032566�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // GetUserMFAInfo invokes the ram.GetUserMFAInfo API synchronously // api document: https://help.aliyun.com/api/ram/getusermfainfo.html func (client *Client) GetUserMFAInfo(request *GetUserMFAInfoRequest) (response *GetUserMFAInfoResponse, err error) { response = CreateGetUserMFAInfoResponse() err = client.DoAction(request, response) return } // GetUserMFAInfoWithChan invokes the ram.GetUserMFAInfo API asynchronously // api document: https://help.aliyun.com/api/ram/getusermfainfo.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetUserMFAInfoWithChan(request *GetUserMFAInfoRequest) (<-chan *GetUserMFAInfoResponse, <-chan error) { responseChan := make(chan *GetUserMFAInfoResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.GetUserMFAInfo(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // GetUserMFAInfoWithCallback invokes the ram.GetUserMFAInfo API asynchronously // api document: https://help.aliyun.com/api/ram/getusermfainfo.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) GetUserMFAInfoWithCallback(request *GetUserMFAInfoRequest, callback func(response *GetUserMFAInfoResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *GetUserMFAInfoResponse var err error defer close(result) response, err = client.GetUserMFAInfo(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // GetUserMFAInfoRequest is the request struct for api GetUserMFAInfo type GetUserMFAInfoRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // GetUserMFAInfoResponse is the response struct for api GetUserMFAInfo type GetUserMFAInfoResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` MFADevice MFADevice `json:"MFADevice" xml:"MFADevice"` } // CreateGetUserMFAInfoRequest creates a request to invoke GetUserMFAInfo API func CreateGetUserMFAInfoRequest() (request *GetUserMFAInfoRequest) { request = &GetUserMFAInfoRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "GetUserMFAInfo", "ram", "openAPI") return } // CreateGetUserMFAInfoResponse creates a response to parse from GetUserMFAInfo response func CreateGetUserMFAInfoResponse() (response *GetUserMFAInfoResponse) { response = &GetUserMFAInfoResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_access_keys.go�����0000664�0000000�0000000�00000007111�13771713062�0032441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListAccessKeys invokes the ram.ListAccessKeys API synchronously // api document: https://help.aliyun.com/api/ram/listaccesskeys.html func (client *Client) ListAccessKeys(request *ListAccessKeysRequest) (response *ListAccessKeysResponse, err error) { response = CreateListAccessKeysResponse() err = client.DoAction(request, response) return } // ListAccessKeysWithChan invokes the ram.ListAccessKeys API asynchronously // api document: https://help.aliyun.com/api/ram/listaccesskeys.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListAccessKeysWithChan(request *ListAccessKeysRequest) (<-chan *ListAccessKeysResponse, <-chan error) { responseChan := make(chan *ListAccessKeysResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListAccessKeys(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListAccessKeysWithCallback invokes the ram.ListAccessKeys API asynchronously // api document: https://help.aliyun.com/api/ram/listaccesskeys.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListAccessKeysWithCallback(request *ListAccessKeysRequest, callback func(response *ListAccessKeysResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListAccessKeysResponse var err error defer close(result) response, err = client.ListAccessKeys(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListAccessKeysRequest is the request struct for api ListAccessKeys type ListAccessKeysRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // ListAccessKeysResponse is the response struct for api ListAccessKeys type ListAccessKeysResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` AccessKeys AccessKeys `json:"AccessKeys" xml:"AccessKeys"` } // CreateListAccessKeysRequest creates a request to invoke ListAccessKeys API func CreateListAccessKeysRequest() (request *ListAccessKeysRequest) { request = &ListAccessKeysRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListAccessKeys", "ram", "openAPI") return } // CreateListAccessKeysResponse creates a response to parse from ListAccessKeys response func CreateListAccessKeysResponse() (response *ListAccessKeysResponse) { response = &ListAccessKeysResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_entities_for_policy.go�������������������������������������������������������������������������0000664�0000000�0000000�00000010101�13771713062�0034130�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListEntitiesForPolicy invokes the ram.ListEntitiesForPolicy API synchronously // api document: https://help.aliyun.com/api/ram/listentitiesforpolicy.html func (client *Client) ListEntitiesForPolicy(request *ListEntitiesForPolicyRequest) (response *ListEntitiesForPolicyResponse, err error) { response = CreateListEntitiesForPolicyResponse() err = client.DoAction(request, response) return } // ListEntitiesForPolicyWithChan invokes the ram.ListEntitiesForPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/listentitiesforpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListEntitiesForPolicyWithChan(request *ListEntitiesForPolicyRequest) (<-chan *ListEntitiesForPolicyResponse, <-chan error) { responseChan := make(chan *ListEntitiesForPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListEntitiesForPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListEntitiesForPolicyWithCallback invokes the ram.ListEntitiesForPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/listentitiesforpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListEntitiesForPolicyWithCallback(request *ListEntitiesForPolicyRequest, callback func(response *ListEntitiesForPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListEntitiesForPolicyResponse var err error defer close(result) response, err = client.ListEntitiesForPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListEntitiesForPolicyRequest is the request struct for api ListEntitiesForPolicy type ListEntitiesForPolicyRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` } // ListEntitiesForPolicyResponse is the response struct for api ListEntitiesForPolicy type ListEntitiesForPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Groups GroupsInListEntitiesForPolicy `json:"Groups" xml:"Groups"` Users UsersInListEntitiesForPolicy `json:"Users" xml:"Users"` Roles RolesInListEntitiesForPolicy `json:"Roles" xml:"Roles"` } // CreateListEntitiesForPolicyRequest creates a request to invoke ListEntitiesForPolicy API func CreateListEntitiesForPolicyRequest() (request *ListEntitiesForPolicyRequest) { request = &ListEntitiesForPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListEntitiesForPolicy", "ram", "openAPI") return } // CreateListEntitiesForPolicyResponse creates a response to parse from ListEntitiesForPolicy response func CreateListEntitiesForPolicyResponse() (response *ListEntitiesForPolicyResponse) { response = &ListEntitiesForPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups.go����������0000664�0000000�0000000�00000007175�13771713062�0031476�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListGroups invokes the ram.ListGroups API synchronously // api document: https://help.aliyun.com/api/ram/listgroups.html func (client *Client) ListGroups(request *ListGroupsRequest) (response *ListGroupsResponse, err error) { response = CreateListGroupsResponse() err = client.DoAction(request, response) return } // ListGroupsWithChan invokes the ram.ListGroups API asynchronously // api document: https://help.aliyun.com/api/ram/listgroups.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListGroupsWithChan(request *ListGroupsRequest) (<-chan *ListGroupsResponse, <-chan error) { responseChan := make(chan *ListGroupsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListGroups(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListGroupsWithCallback invokes the ram.ListGroups API asynchronously // api document: https://help.aliyun.com/api/ram/listgroups.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListGroupsWithCallback(request *ListGroupsRequest, callback func(response *ListGroupsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListGroupsResponse var err error defer close(result) response, err = client.ListGroups(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListGroupsRequest is the request struct for api ListGroups type ListGroupsRequest struct { *requests.RpcRequest Marker string `position:"Query" name:"Marker"` MaxItems requests.Integer `position:"Query" name:"MaxItems"` } // ListGroupsResponse is the response struct for api ListGroups type ListGroupsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` Marker string `json:"Marker" xml:"Marker"` Groups GroupsInListGroups `json:"Groups" xml:"Groups"` } // CreateListGroupsRequest creates a request to invoke ListGroups API func CreateListGroupsRequest() (request *ListGroupsRequest) { request = &ListGroupsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListGroups", "ram", "openAPI") return } // CreateListGroupsResponse creates a response to parse from ListGroups response func CreateListGroupsResponse() (response *ListGroupsResponse) { response = &ListGroupsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_groups_for_user.go�0000664�0000000�0000000�00000007325�13771713062�0033377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListGroupsForUser invokes the ram.ListGroupsForUser API synchronously // api document: https://help.aliyun.com/api/ram/listgroupsforuser.html func (client *Client) ListGroupsForUser(request *ListGroupsForUserRequest) (response *ListGroupsForUserResponse, err error) { response = CreateListGroupsForUserResponse() err = client.DoAction(request, response) return } // ListGroupsForUserWithChan invokes the ram.ListGroupsForUser API asynchronously // api document: https://help.aliyun.com/api/ram/listgroupsforuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListGroupsForUserWithChan(request *ListGroupsForUserRequest) (<-chan *ListGroupsForUserResponse, <-chan error) { responseChan := make(chan *ListGroupsForUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListGroupsForUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListGroupsForUserWithCallback invokes the ram.ListGroupsForUser API asynchronously // api document: https://help.aliyun.com/api/ram/listgroupsforuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListGroupsForUserWithCallback(request *ListGroupsForUserRequest, callback func(response *ListGroupsForUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListGroupsForUserResponse var err error defer close(result) response, err = client.ListGroupsForUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListGroupsForUserRequest is the request struct for api ListGroupsForUser type ListGroupsForUserRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // ListGroupsForUserResponse is the response struct for api ListGroupsForUser type ListGroupsForUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Groups GroupsInListGroupsForUser `json:"Groups" xml:"Groups"` } // CreateListGroupsForUserRequest creates a request to invoke ListGroupsForUser API func CreateListGroupsForUserRequest() (request *ListGroupsForUserRequest) { request = &ListGroupsForUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListGroupsForUser", "ram", "openAPI") return } // CreateListGroupsForUserResponse creates a response to parse from ListGroupsForUser response func CreateListGroupsForUserResponse() (response *ListGroupsForUserResponse) { response = &ListGroupsForUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policies.go��������0000664�0000000�0000000�00000007447�13771713062�0031770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListPolicies invokes the ram.ListPolicies API synchronously // api document: https://help.aliyun.com/api/ram/listpolicies.html func (client *Client) ListPolicies(request *ListPoliciesRequest) (response *ListPoliciesResponse, err error) { response = CreateListPoliciesResponse() err = client.DoAction(request, response) return } // ListPoliciesWithChan invokes the ram.ListPolicies API asynchronously // api document: https://help.aliyun.com/api/ram/listpolicies.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesWithChan(request *ListPoliciesRequest) (<-chan *ListPoliciesResponse, <-chan error) { responseChan := make(chan *ListPoliciesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListPolicies(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListPoliciesWithCallback invokes the ram.ListPolicies API asynchronously // api document: https://help.aliyun.com/api/ram/listpolicies.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesWithCallback(request *ListPoliciesRequest, callback func(response *ListPoliciesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListPoliciesResponse var err error defer close(result) response, err = client.ListPolicies(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListPoliciesRequest is the request struct for api ListPolicies type ListPoliciesRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` Marker string `position:"Query" name:"Marker"` MaxItems requests.Integer `position:"Query" name:"MaxItems"` } // ListPoliciesResponse is the response struct for api ListPolicies type ListPoliciesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` Marker string `json:"Marker" xml:"Marker"` Policies PoliciesInListPolicies `json:"Policies" xml:"Policies"` } // CreateListPoliciesRequest creates a request to invoke ListPolicies API func CreateListPoliciesRequest() (request *ListPoliciesRequest) { request = &ListPoliciesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListPolicies", "ram", "openAPI") return } // CreateListPoliciesResponse creates a response to parse from ListPolicies response func CreateListPoliciesResponse() (response *ListPoliciesResponse) { response = &ListPoliciesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_policies_for_group.go��������������������������������������������������������������������������0000664�0000000�0000000�00000007535�13771713062�0033771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListPoliciesForGroup invokes the ram.ListPoliciesForGroup API synchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforgroup.html func (client *Client) ListPoliciesForGroup(request *ListPoliciesForGroupRequest) (response *ListPoliciesForGroupResponse, err error) { response = CreateListPoliciesForGroupResponse() err = client.DoAction(request, response) return } // ListPoliciesForGroupWithChan invokes the ram.ListPoliciesForGroup API asynchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesForGroupWithChan(request *ListPoliciesForGroupRequest) (<-chan *ListPoliciesForGroupResponse, <-chan error) { responseChan := make(chan *ListPoliciesForGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListPoliciesForGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListPoliciesForGroupWithCallback invokes the ram.ListPoliciesForGroup API asynchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesForGroupWithCallback(request *ListPoliciesForGroupRequest, callback func(response *ListPoliciesForGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListPoliciesForGroupResponse var err error defer close(result) response, err = client.ListPoliciesForGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListPoliciesForGroupRequest is the request struct for api ListPoliciesForGroup type ListPoliciesForGroupRequest struct { *requests.RpcRequest GroupName string `position:"Query" name:"GroupName"` } // ListPoliciesForGroupResponse is the response struct for api ListPoliciesForGroup type ListPoliciesForGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Policies PoliciesInListPoliciesForGroup `json:"Policies" xml:"Policies"` } // CreateListPoliciesForGroupRequest creates a request to invoke ListPoliciesForGroup API func CreateListPoliciesForGroupRequest() (request *ListPoliciesForGroupRequest) { request = &ListPoliciesForGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListPoliciesForGroup", "ram", "openAPI") return } // CreateListPoliciesForGroupResponse creates a response to parse from ListPoliciesForGroup response func CreateListPoliciesForGroupResponse() (response *ListPoliciesForGroupResponse) { response = &ListPoliciesForGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������list_policies_for_role.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007461�13771713062�0033574�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListPoliciesForRole invokes the ram.ListPoliciesForRole API synchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforrole.html func (client *Client) ListPoliciesForRole(request *ListPoliciesForRoleRequest) (response *ListPoliciesForRoleResponse, err error) { response = CreateListPoliciesForRoleResponse() err = client.DoAction(request, response) return } // ListPoliciesForRoleWithChan invokes the ram.ListPoliciesForRole API asynchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesForRoleWithChan(request *ListPoliciesForRoleRequest) (<-chan *ListPoliciesForRoleResponse, <-chan error) { responseChan := make(chan *ListPoliciesForRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListPoliciesForRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListPoliciesForRoleWithCallback invokes the ram.ListPoliciesForRole API asynchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforrole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesForRoleWithCallback(request *ListPoliciesForRoleRequest, callback func(response *ListPoliciesForRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListPoliciesForRoleResponse var err error defer close(result) response, err = client.ListPoliciesForRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListPoliciesForRoleRequest is the request struct for api ListPoliciesForRole type ListPoliciesForRoleRequest struct { *requests.RpcRequest RoleName string `position:"Query" name:"RoleName"` } // ListPoliciesForRoleResponse is the response struct for api ListPoliciesForRole type ListPoliciesForRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Policies PoliciesInListPoliciesForRole `json:"Policies" xml:"Policies"` } // CreateListPoliciesForRoleRequest creates a request to invoke ListPoliciesForRole API func CreateListPoliciesForRoleRequest() (request *ListPoliciesForRoleRequest) { request = &ListPoliciesForRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListPoliciesForRole", "ram", "openAPI") return } // CreateListPoliciesForRoleResponse creates a response to parse from ListPoliciesForRole response func CreateListPoliciesForRoleResponse() (response *ListPoliciesForRoleResponse) { response = &ListPoliciesForRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_policies_for_user.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007461�13771713062�0033611�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListPoliciesForUser invokes the ram.ListPoliciesForUser API synchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforuser.html func (client *Client) ListPoliciesForUser(request *ListPoliciesForUserRequest) (response *ListPoliciesForUserResponse, err error) { response = CreateListPoliciesForUserResponse() err = client.DoAction(request, response) return } // ListPoliciesForUserWithChan invokes the ram.ListPoliciesForUser API asynchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesForUserWithChan(request *ListPoliciesForUserRequest) (<-chan *ListPoliciesForUserResponse, <-chan error) { responseChan := make(chan *ListPoliciesForUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListPoliciesForUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListPoliciesForUserWithCallback invokes the ram.ListPoliciesForUser API asynchronously // api document: https://help.aliyun.com/api/ram/listpoliciesforuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPoliciesForUserWithCallback(request *ListPoliciesForUserRequest, callback func(response *ListPoliciesForUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListPoliciesForUserResponse var err error defer close(result) response, err = client.ListPoliciesForUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListPoliciesForUserRequest is the request struct for api ListPoliciesForUser type ListPoliciesForUserRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // ListPoliciesForUserResponse is the response struct for api ListPoliciesForUser type ListPoliciesForUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Policies PoliciesInListPoliciesForUser `json:"Policies" xml:"Policies"` } // CreateListPoliciesForUserRequest creates a request to invoke ListPoliciesForUser API func CreateListPoliciesForUserRequest() (request *ListPoliciesForUserRequest) { request = &ListPoliciesForUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListPoliciesForUser", "ram", "openAPI") return } // CreateListPoliciesForUserResponse creates a response to parse from ListPoliciesForUser response func CreateListPoliciesForUserResponse() (response *ListPoliciesForUserResponse) { response = &ListPoliciesForUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_policy_versions.go�0000664�0000000�0000000�00000007475�13771713062�0033411�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListPolicyVersions invokes the ram.ListPolicyVersions API synchronously // api document: https://help.aliyun.com/api/ram/listpolicyversions.html func (client *Client) ListPolicyVersions(request *ListPolicyVersionsRequest) (response *ListPolicyVersionsResponse, err error) { response = CreateListPolicyVersionsResponse() err = client.DoAction(request, response) return } // ListPolicyVersionsWithChan invokes the ram.ListPolicyVersions API asynchronously // api document: https://help.aliyun.com/api/ram/listpolicyversions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPolicyVersionsWithChan(request *ListPolicyVersionsRequest) (<-chan *ListPolicyVersionsResponse, <-chan error) { responseChan := make(chan *ListPolicyVersionsResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListPolicyVersions(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListPolicyVersionsWithCallback invokes the ram.ListPolicyVersions API asynchronously // api document: https://help.aliyun.com/api/ram/listpolicyversions.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPolicyVersionsWithCallback(request *ListPolicyVersionsRequest, callback func(response *ListPolicyVersionsResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListPolicyVersionsResponse var err error defer close(result) response, err = client.ListPolicyVersions(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListPolicyVersionsRequest is the request struct for api ListPolicyVersions type ListPolicyVersionsRequest struct { *requests.RpcRequest PolicyType string `position:"Query" name:"PolicyType"` PolicyName string `position:"Query" name:"PolicyName"` } // ListPolicyVersionsResponse is the response struct for api ListPolicyVersions type ListPolicyVersionsResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PolicyVersions PolicyVersions `json:"PolicyVersions" xml:"PolicyVersions"` } // CreateListPolicyVersionsRequest creates a request to invoke ListPolicyVersions API func CreateListPolicyVersionsRequest() (request *ListPolicyVersionsRequest) { request = &ListPolicyVersionsRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListPolicyVersions", "ram", "openAPI") return } // CreateListPolicyVersionsResponse creates a response to parse from ListPolicyVersions response func CreateListPolicyVersionsResponse() (response *ListPolicyVersionsResponse) { response = &ListPolicyVersionsResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_public_keys.go�����0000664�0000000�0000000�00000007111�13771713062�0032456�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListPublicKeys invokes the ram.ListPublicKeys API synchronously // api document: https://help.aliyun.com/api/ram/listpublickeys.html func (client *Client) ListPublicKeys(request *ListPublicKeysRequest) (response *ListPublicKeysResponse, err error) { response = CreateListPublicKeysResponse() err = client.DoAction(request, response) return } // ListPublicKeysWithChan invokes the ram.ListPublicKeys API asynchronously // api document: https://help.aliyun.com/api/ram/listpublickeys.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPublicKeysWithChan(request *ListPublicKeysRequest) (<-chan *ListPublicKeysResponse, <-chan error) { responseChan := make(chan *ListPublicKeysResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListPublicKeys(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListPublicKeysWithCallback invokes the ram.ListPublicKeys API asynchronously // api document: https://help.aliyun.com/api/ram/listpublickeys.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListPublicKeysWithCallback(request *ListPublicKeysRequest, callback func(response *ListPublicKeysResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListPublicKeysResponse var err error defer close(result) response, err = client.ListPublicKeys(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListPublicKeysRequest is the request struct for api ListPublicKeys type ListPublicKeysRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // ListPublicKeysResponse is the response struct for api ListPublicKeys type ListPublicKeysResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PublicKeys PublicKeys `json:"PublicKeys" xml:"PublicKeys"` } // CreateListPublicKeysRequest creates a request to invoke ListPublicKeys API func CreateListPublicKeysRequest() (request *ListPublicKeysRequest) { request = &ListPublicKeysRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListPublicKeys", "ram", "openAPI") return } // CreateListPublicKeysResponse creates a response to parse from ListPublicKeys response func CreateListPublicKeysResponse() (response *ListPublicKeysResponse) { response = &ListPublicKeysResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_roles.go�����������0000664�0000000�0000000�00000007113�13771713062�0031273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListRoles invokes the ram.ListRoles API synchronously // api document: https://help.aliyun.com/api/ram/listroles.html func (client *Client) ListRoles(request *ListRolesRequest) (response *ListRolesResponse, err error) { response = CreateListRolesResponse() err = client.DoAction(request, response) return } // ListRolesWithChan invokes the ram.ListRoles API asynchronously // api document: https://help.aliyun.com/api/ram/listroles.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListRolesWithChan(request *ListRolesRequest) (<-chan *ListRolesResponse, <-chan error) { responseChan := make(chan *ListRolesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListRoles(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListRolesWithCallback invokes the ram.ListRoles API asynchronously // api document: https://help.aliyun.com/api/ram/listroles.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListRolesWithCallback(request *ListRolesRequest, callback func(response *ListRolesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListRolesResponse var err error defer close(result) response, err = client.ListRoles(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListRolesRequest is the request struct for api ListRoles type ListRolesRequest struct { *requests.RpcRequest Marker string `position:"Query" name:"Marker"` MaxItems requests.Integer `position:"Query" name:"MaxItems"` } // ListRolesResponse is the response struct for api ListRoles type ListRolesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` Marker string `json:"Marker" xml:"Marker"` Roles RolesInListRoles `json:"Roles" xml:"Roles"` } // CreateListRolesRequest creates a request to invoke ListRoles API func CreateListRolesRequest() (request *ListRolesRequest) { request = &ListRolesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListRoles", "ram", "openAPI") return } // CreateListRolesResponse creates a response to parse from ListRoles response func CreateListRolesResponse() (response *ListRolesResponse) { response = &ListRolesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users.go�����������0000664�0000000�0000000�00000007113�13771713062�0031310�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListUsers invokes the ram.ListUsers API synchronously // api document: https://help.aliyun.com/api/ram/listusers.html func (client *Client) ListUsers(request *ListUsersRequest) (response *ListUsersResponse, err error) { response = CreateListUsersResponse() err = client.DoAction(request, response) return } // ListUsersWithChan invokes the ram.ListUsers API asynchronously // api document: https://help.aliyun.com/api/ram/listusers.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListUsersWithChan(request *ListUsersRequest) (<-chan *ListUsersResponse, <-chan error) { responseChan := make(chan *ListUsersResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListUsers(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListUsersWithCallback invokes the ram.ListUsers API asynchronously // api document: https://help.aliyun.com/api/ram/listusers.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListUsersWithCallback(request *ListUsersRequest, callback func(response *ListUsersResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListUsersResponse var err error defer close(result) response, err = client.ListUsers(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListUsersRequest is the request struct for api ListUsers type ListUsersRequest struct { *requests.RpcRequest Marker string `position:"Query" name:"Marker"` MaxItems requests.Integer `position:"Query" name:"MaxItems"` } // ListUsersResponse is the response struct for api ListUsers type ListUsersResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` Marker string `json:"Marker" xml:"Marker"` Users UsersInListUsers `json:"Users" xml:"Users"` } // CreateListUsersRequest creates a request to invoke ListUsers API func CreateListUsersRequest() (request *ListUsersRequest) { request = &ListUsersRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListUsers", "ram", "openAPI") return } // CreateListUsersResponse creates a response to parse from ListUsers response func CreateListUsersResponse() (response *ListUsersResponse) { response = &ListUsersResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/list_users_for_group.go�0000664�0000000�0000000�00000007755�13771713062�0033406�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListUsersForGroup invokes the ram.ListUsersForGroup API synchronously // api document: https://help.aliyun.com/api/ram/listusersforgroup.html func (client *Client) ListUsersForGroup(request *ListUsersForGroupRequest) (response *ListUsersForGroupResponse, err error) { response = CreateListUsersForGroupResponse() err = client.DoAction(request, response) return } // ListUsersForGroupWithChan invokes the ram.ListUsersForGroup API asynchronously // api document: https://help.aliyun.com/api/ram/listusersforgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListUsersForGroupWithChan(request *ListUsersForGroupRequest) (<-chan *ListUsersForGroupResponse, <-chan error) { responseChan := make(chan *ListUsersForGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListUsersForGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListUsersForGroupWithCallback invokes the ram.ListUsersForGroup API asynchronously // api document: https://help.aliyun.com/api/ram/listusersforgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListUsersForGroupWithCallback(request *ListUsersForGroupRequest, callback func(response *ListUsersForGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListUsersForGroupResponse var err error defer close(result) response, err = client.ListUsersForGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListUsersForGroupRequest is the request struct for api ListUsersForGroup type ListUsersForGroupRequest struct { *requests.RpcRequest Marker string `position:"Query" name:"Marker"` MaxItems requests.Integer `position:"Query" name:"MaxItems"` GroupName string `position:"Query" name:"GroupName"` } // ListUsersForGroupResponse is the response struct for api ListUsersForGroup type ListUsersForGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` IsTruncated bool `json:"IsTruncated" xml:"IsTruncated"` Marker string `json:"Marker" xml:"Marker"` Users UsersInListUsersForGroup `json:"Users" xml:"Users"` } // CreateListUsersForGroupRequest creates a request to invoke ListUsersForGroup API func CreateListUsersForGroupRequest() (request *ListUsersForGroupRequest) { request = &ListUsersForGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListUsersForGroup", "ram", "openAPI") return } // CreateListUsersForGroupResponse creates a response to parse from ListUsersForGroup response func CreateListUsersForGroupResponse() (response *ListUsersForGroupResponse) { response = &ListUsersForGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������list_virtual_mfa_devices.go�������������������������������������������������������������������������0000664�0000000�0000000�00000007527�13771713062�0034114�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // ListVirtualMFADevices invokes the ram.ListVirtualMFADevices API synchronously // api document: https://help.aliyun.com/api/ram/listvirtualmfadevices.html func (client *Client) ListVirtualMFADevices(request *ListVirtualMFADevicesRequest) (response *ListVirtualMFADevicesResponse, err error) { response = CreateListVirtualMFADevicesResponse() err = client.DoAction(request, response) return } // ListVirtualMFADevicesWithChan invokes the ram.ListVirtualMFADevices API asynchronously // api document: https://help.aliyun.com/api/ram/listvirtualmfadevices.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListVirtualMFADevicesWithChan(request *ListVirtualMFADevicesRequest) (<-chan *ListVirtualMFADevicesResponse, <-chan error) { responseChan := make(chan *ListVirtualMFADevicesResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.ListVirtualMFADevices(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // ListVirtualMFADevicesWithCallback invokes the ram.ListVirtualMFADevices API asynchronously // api document: https://help.aliyun.com/api/ram/listvirtualmfadevices.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) ListVirtualMFADevicesWithCallback(request *ListVirtualMFADevicesRequest, callback func(response *ListVirtualMFADevicesResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *ListVirtualMFADevicesResponse var err error defer close(result) response, err = client.ListVirtualMFADevices(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // ListVirtualMFADevicesRequest is the request struct for api ListVirtualMFADevices type ListVirtualMFADevicesRequest struct { *requests.RpcRequest } // ListVirtualMFADevicesResponse is the response struct for api ListVirtualMFADevices type ListVirtualMFADevicesResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` VirtualMFADevices VirtualMFADevices `json:"VirtualMFADevices" xml:"VirtualMFADevices"` } // CreateListVirtualMFADevicesRequest creates a request to invoke ListVirtualMFADevices API func CreateListVirtualMFADevicesRequest() (request *ListVirtualMFADevicesRequest) { request = &ListVirtualMFADevicesRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "ListVirtualMFADevices", "ram", "openAPI") return } // CreateListVirtualMFADevicesResponse creates a response to parse from ListVirtualMFADevices response func CreateListVirtualMFADevicesResponse() (response *ListVirtualMFADevicesResponse) { response = &ListVirtualMFADevicesResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������remove_user_from_group.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007407�13771713062�0033635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // RemoveUserFromGroup invokes the ram.RemoveUserFromGroup API synchronously // api document: https://help.aliyun.com/api/ram/removeuserfromgroup.html func (client *Client) RemoveUserFromGroup(request *RemoveUserFromGroupRequest) (response *RemoveUserFromGroupResponse, err error) { response = CreateRemoveUserFromGroupResponse() err = client.DoAction(request, response) return } // RemoveUserFromGroupWithChan invokes the ram.RemoveUserFromGroup API asynchronously // api document: https://help.aliyun.com/api/ram/removeuserfromgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RemoveUserFromGroupWithChan(request *RemoveUserFromGroupRequest) (<-chan *RemoveUserFromGroupResponse, <-chan error) { responseChan := make(chan *RemoveUserFromGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.RemoveUserFromGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // RemoveUserFromGroupWithCallback invokes the ram.RemoveUserFromGroup API asynchronously // api document: https://help.aliyun.com/api/ram/removeuserfromgroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) RemoveUserFromGroupWithCallback(request *RemoveUserFromGroupRequest, callback func(response *RemoveUserFromGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *RemoveUserFromGroupResponse var err error defer close(result) response, err = client.RemoveUserFromGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // RemoveUserFromGroupRequest is the request struct for api RemoveUserFromGroup type RemoveUserFromGroupRequest struct { *requests.RpcRequest GroupName string `position:"Query" name:"GroupName"` UserName string `position:"Query" name:"UserName"` } // RemoveUserFromGroupResponse is the response struct for api RemoveUserFromGroup type RemoveUserFromGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateRemoveUserFromGroupRequest creates a request to invoke RemoveUserFromGroup API func CreateRemoveUserFromGroupRequest() (request *RemoveUserFromGroupRequest) { request = &RemoveUserFromGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "RemoveUserFromGroup", "ram", "openAPI") return } // CreateRemoveUserFromGroupResponse creates a response to parse from RemoveUserFromGroup response func CreateRemoveUserFromGroupResponse() (response *RemoveUserFromGroupResponse) { response = &RemoveUserFromGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_account_alias.go����0000664�0000000�0000000�00000007070�13771713062�0032576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // SetAccountAlias invokes the ram.SetAccountAlias API synchronously // api document: https://help.aliyun.com/api/ram/setaccountalias.html func (client *Client) SetAccountAlias(request *SetAccountAliasRequest) (response *SetAccountAliasResponse, err error) { response = CreateSetAccountAliasResponse() err = client.DoAction(request, response) return } // SetAccountAliasWithChan invokes the ram.SetAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/setaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetAccountAliasWithChan(request *SetAccountAliasRequest) (<-chan *SetAccountAliasResponse, <-chan error) { responseChan := make(chan *SetAccountAliasResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.SetAccountAlias(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // SetAccountAliasWithCallback invokes the ram.SetAccountAlias API asynchronously // api document: https://help.aliyun.com/api/ram/setaccountalias.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetAccountAliasWithCallback(request *SetAccountAliasRequest, callback func(response *SetAccountAliasResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *SetAccountAliasResponse var err error defer close(result) response, err = client.SetAccountAlias(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // SetAccountAliasRequest is the request struct for api SetAccountAlias type SetAccountAliasRequest struct { *requests.RpcRequest AccountAlias string `position:"Query" name:"AccountAlias"` } // SetAccountAliasResponse is the response struct for api SetAccountAlias type SetAccountAliasResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateSetAccountAliasRequest creates a request to invoke SetAccountAlias API func CreateSetAccountAliasRequest() (request *SetAccountAliasRequest) { request = &SetAccountAliasRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "SetAccountAlias", "ram", "openAPI") return } // CreateSetAccountAliasResponse creates a response to parse from SetAccountAlias response func CreateSetAccountAliasResponse() (response *SetAccountAliasResponse) { response = &SetAccountAliasResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������set_default_policy_version.go�����������������������������������������������������������������������0000664�0000000�0000000�00000007653�13771713062�0034471�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // SetDefaultPolicyVersion invokes the ram.SetDefaultPolicyVersion API synchronously // api document: https://help.aliyun.com/api/ram/setdefaultpolicyversion.html func (client *Client) SetDefaultPolicyVersion(request *SetDefaultPolicyVersionRequest) (response *SetDefaultPolicyVersionResponse, err error) { response = CreateSetDefaultPolicyVersionResponse() err = client.DoAction(request, response) return } // SetDefaultPolicyVersionWithChan invokes the ram.SetDefaultPolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/setdefaultpolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetDefaultPolicyVersionWithChan(request *SetDefaultPolicyVersionRequest) (<-chan *SetDefaultPolicyVersionResponse, <-chan error) { responseChan := make(chan *SetDefaultPolicyVersionResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.SetDefaultPolicyVersion(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // SetDefaultPolicyVersionWithCallback invokes the ram.SetDefaultPolicyVersion API asynchronously // api document: https://help.aliyun.com/api/ram/setdefaultpolicyversion.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetDefaultPolicyVersionWithCallback(request *SetDefaultPolicyVersionRequest, callback func(response *SetDefaultPolicyVersionResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *SetDefaultPolicyVersionResponse var err error defer close(result) response, err = client.SetDefaultPolicyVersion(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // SetDefaultPolicyVersionRequest is the request struct for api SetDefaultPolicyVersion type SetDefaultPolicyVersionRequest struct { *requests.RpcRequest VersionId string `position:"Query" name:"VersionId"` PolicyName string `position:"Query" name:"PolicyName"` } // SetDefaultPolicyVersionResponse is the response struct for api SetDefaultPolicyVersion type SetDefaultPolicyVersionResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateSetDefaultPolicyVersionRequest creates a request to invoke SetDefaultPolicyVersion API func CreateSetDefaultPolicyVersionRequest() (request *SetDefaultPolicyVersionRequest) { request = &SetDefaultPolicyVersionRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "SetDefaultPolicyVersion", "ram", "openAPI") return } // CreateSetDefaultPolicyVersionResponse creates a response to parse from SetDefaultPolicyVersion response func CreateSetDefaultPolicyVersionResponse() (response *SetDefaultPolicyVersionResponse) { response = &SetDefaultPolicyVersionResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/set_password_policy.go��0000664�0000000�0000000�00000010720�13771713062�0033206�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // SetPasswordPolicy invokes the ram.SetPasswordPolicy API synchronously // api document: https://help.aliyun.com/api/ram/setpasswordpolicy.html func (client *Client) SetPasswordPolicy(request *SetPasswordPolicyRequest) (response *SetPasswordPolicyResponse, err error) { response = CreateSetPasswordPolicyResponse() err = client.DoAction(request, response) return } // SetPasswordPolicyWithChan invokes the ram.SetPasswordPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/setpasswordpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetPasswordPolicyWithChan(request *SetPasswordPolicyRequest) (<-chan *SetPasswordPolicyResponse, <-chan error) { responseChan := make(chan *SetPasswordPolicyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.SetPasswordPolicy(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // SetPasswordPolicyWithCallback invokes the ram.SetPasswordPolicy API asynchronously // api document: https://help.aliyun.com/api/ram/setpasswordpolicy.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetPasswordPolicyWithCallback(request *SetPasswordPolicyRequest, callback func(response *SetPasswordPolicyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *SetPasswordPolicyResponse var err error defer close(result) response, err = client.SetPasswordPolicy(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // SetPasswordPolicyRequest is the request struct for api SetPasswordPolicy type SetPasswordPolicyRequest struct { *requests.RpcRequest RequireNumbers requests.Boolean `position:"Query" name:"RequireNumbers"` PasswordReusePrevention requests.Integer `position:"Query" name:"PasswordReusePrevention"` RequireUppercaseCharacters requests.Boolean `position:"Query" name:"RequireUppercaseCharacters"` MaxPasswordAge requests.Integer `position:"Query" name:"MaxPasswordAge"` MaxLoginAttemps requests.Integer `position:"Query" name:"MaxLoginAttemps"` HardExpiry requests.Boolean `position:"Query" name:"HardExpiry"` MinimumPasswordLength requests.Integer `position:"Query" name:"MinimumPasswordLength"` RequireLowercaseCharacters requests.Boolean `position:"Query" name:"RequireLowercaseCharacters"` RequireSymbols requests.Boolean `position:"Query" name:"RequireSymbols"` } // SetPasswordPolicyResponse is the response struct for api SetPasswordPolicy type SetPasswordPolicyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PasswordPolicy PasswordPolicy `json:"PasswordPolicy" xml:"PasswordPolicy"` } // CreateSetPasswordPolicyRequest creates a request to invoke SetPasswordPolicy API func CreateSetPasswordPolicyRequest() (request *SetPasswordPolicyRequest) { request = &SetPasswordPolicyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "SetPasswordPolicy", "ram", "openAPI") return } // CreateSetPasswordPolicyResponse creates a response to parse from SetPasswordPolicy response func CreateSetPasswordPolicyResponse() (response *SetPasswordPolicyResponse) { response = &SetPasswordPolicyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ������������������������������������������������set_security_preference.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010776�13771713062�0033766�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // SetSecurityPreference invokes the ram.SetSecurityPreference API synchronously // api document: https://help.aliyun.com/api/ram/setsecuritypreference.html func (client *Client) SetSecurityPreference(request *SetSecurityPreferenceRequest) (response *SetSecurityPreferenceResponse, err error) { response = CreateSetSecurityPreferenceResponse() err = client.DoAction(request, response) return } // SetSecurityPreferenceWithChan invokes the ram.SetSecurityPreference API asynchronously // api document: https://help.aliyun.com/api/ram/setsecuritypreference.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetSecurityPreferenceWithChan(request *SetSecurityPreferenceRequest) (<-chan *SetSecurityPreferenceResponse, <-chan error) { responseChan := make(chan *SetSecurityPreferenceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.SetSecurityPreference(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // SetSecurityPreferenceWithCallback invokes the ram.SetSecurityPreference API asynchronously // api document: https://help.aliyun.com/api/ram/setsecuritypreference.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) SetSecurityPreferenceWithCallback(request *SetSecurityPreferenceRequest, callback func(response *SetSecurityPreferenceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *SetSecurityPreferenceResponse var err error defer close(result) response, err = client.SetSecurityPreference(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // SetSecurityPreferenceRequest is the request struct for api SetSecurityPreference type SetSecurityPreferenceRequest struct { *requests.RpcRequest AllowUserToManageAccessKeys requests.Boolean `position:"Query" name:"AllowUserToManageAccessKeys"` AllowUserToManageMFADevices requests.Boolean `position:"Query" name:"AllowUserToManageMFADevices"` AllowUserToManagePublicKeys requests.Boolean `position:"Query" name:"AllowUserToManagePublicKeys"` EnableSaveMFATicket requests.Boolean `position:"Query" name:"EnableSaveMFATicket"` LoginNetworkMasks string `position:"Query" name:"LoginNetworkMasks"` AllowUserToChangePassword requests.Boolean `position:"Query" name:"AllowUserToChangePassword"` LoginSessionDuration requests.Integer `position:"Query" name:"LoginSessionDuration"` } // SetSecurityPreferenceResponse is the response struct for api SetSecurityPreference type SetSecurityPreferenceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` SecurityPreference SecurityPreference `json:"SecurityPreference" xml:"SecurityPreference"` } // CreateSetSecurityPreferenceRequest creates a request to invoke SetSecurityPreference API func CreateSetSecurityPreferenceRequest() (request *SetSecurityPreferenceRequest) { request = &SetSecurityPreferenceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "SetSecurityPreference", "ram", "openAPI") return } // CreateSetSecurityPreferenceResponse creates a response to parse from SetSecurityPreference response func CreateSetSecurityPreferenceResponse() (response *SetSecurityPreferenceResponse) { response = &SetSecurityPreferenceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_key.go����0000664�0000000�0000000�00000001775�13771713062�0032641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccessKey is a nested struct in ram response type AccessKey struct { AccessKeySecret string `json:"AccessKeySecret" xml:"AccessKeySecret"` CreateDate string `json:"CreateDate" xml:"CreateDate"` Status string `json:"Status" xml:"Status"` AccessKeyId string `json:"AccessKeyId" xml:"AccessKeyId"` } ���struct_access_key_last_used.go����������������������������������������������������������������������0000664�0000000�0000000�00000001523�13771713062�0034614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccessKeyLastUsed is a nested struct in ram response type AccessKeyLastUsed struct { LastUsedDate string `json:"LastUsedDate" xml:"LastUsedDate"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_access_key_preference.go���������������������������������������������������������������������0000664�0000000�0000000�00000001602�13771713062�0034745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccessKeyPreference is a nested struct in ram response type AccessKeyPreference struct { AllowUserToManageAccessKeys bool `json:"AllowUserToManageAccessKeys" xml:"AllowUserToManageAccessKeys"` } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_access_keys.go���0000664�0000000�0000000�00000001501�13771713062�0033007�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // AccessKeys is a nested struct in ram response type AccessKeys struct { AccessKey []AccessKey `json:"AccessKey" xml:"AccessKey"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_group.go���������0000664�0000000�0000000�00000002103�13771713062�0031646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Group is a nested struct in ram response type Group struct { Comments string `json:"Comments" xml:"Comments"` AttachDate string `json:"AttachDate" xml:"AttachDate"` CreateDate string `json:"CreateDate" xml:"CreateDate"` UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` GroupName string `json:"GroupName" xml:"GroupName"` JoinDate string `json:"JoinDate" xml:"JoinDate"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_groups_in_list_entities_for_policy.go��������������������������������������������������������0000664�0000000�0000000�00000001527�13771713062�0037635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // GroupsInListEntitiesForPolicy is a nested struct in ram response type GroupsInListEntitiesForPolicy struct { Group []Group `json:"Group" xml:"Group"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_groups_in_list_groups.go���������������������������������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0035073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // GroupsInListGroups is a nested struct in ram response type GroupsInListGroups struct { Group []Group `json:"Group" xml:"Group"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_groups_in_list_groups_for_user.go������������������������������������������������������������0000664�0000000�0000000�00000001517�13771713062�0037006�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // GroupsInListGroupsForUser is a nested struct in ram response type GroupsInListGroupsForUser struct { Group []Group `json:"Group" xml:"Group"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_login_profile.go�0000664�0000000�0000000�00000002063�13771713062�0033347�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LoginProfile is a nested struct in ram response type LoginProfile struct { MFABindRequired bool `json:"MFABindRequired" xml:"MFABindRequired"` CreateDate string `json:"CreateDate" xml:"CreateDate"` UserName string `json:"UserName" xml:"UserName"` PasswordResetRequired bool `json:"PasswordResetRequired" xml:"PasswordResetRequired"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_login_profile_preference.go������������������������������������������������������������������0000664�0000000�0000000�00000002215�13771713062�0035465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // LoginProfilePreference is a nested struct in ram response type LoginProfilePreference struct { LoginNetworkMasks string `json:"LoginNetworkMasks" xml:"LoginNetworkMasks"` LoginSessionDuration int `json:"LoginSessionDuration" xml:"LoginSessionDuration"` EnableSaveMFATicket bool `json:"EnableSaveMFATicket" xml:"EnableSaveMFATicket"` AllowUserToChangePassword bool `json:"AllowUserToChangePassword" xml:"AllowUserToChangePassword"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_device.go����0000664�0000000�0000000�00000001503�13771713062�0032577�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MFADevice is a nested struct in ram response type MFADevice struct { SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_mfa_preference.go0000664�0000000�0000000�00000001566�13771713062�0033467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // MFAPreference is a nested struct in ram response type MFAPreference struct { AllowUserToManageMFADevices bool `json:"AllowUserToManageMFADevices" xml:"AllowUserToManageMFADevices"` } ������������������������������������������������������������������������������������������������������������������������������������������struct_password_policy.go���������������������������������������������������������������������������0000664�0000000�0000000�00000003027�13771713062�0033662�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PasswordPolicy is a nested struct in ram response type PasswordPolicy struct { RequireUppercaseCharacters bool `json:"RequireUppercaseCharacters" xml:"RequireUppercaseCharacters"` MaxPasswordAge int `json:"MaxPasswordAge" xml:"MaxPasswordAge"` RequireSymbols bool `json:"RequireSymbols" xml:"RequireSymbols"` RequireLowercaseCharacters bool `json:"RequireLowercaseCharacters" xml:"RequireLowercaseCharacters"` PasswordReusePrevention int `json:"PasswordReusePrevention" xml:"PasswordReusePrevention"` HardExpiry bool `json:"HardExpiry" xml:"HardExpiry"` MaxLoginAttemps int `json:"MaxLoginAttemps" xml:"MaxLoginAttemps"` MinimumPasswordLength int `json:"MinimumPasswordLength" xml:"MinimumPasswordLength"` RequireNumbers bool `json:"RequireNumbers" xml:"RequireNumbers"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_policies_in_list_policies.go�����������������������������������������������������������������0000664�0000000�0000000�00000001515�13771713062�0035660�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PoliciesInListPolicies is a nested struct in ram response type PoliciesInListPolicies struct { Policy []Policy `json:"Policy" xml:"Policy"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_policies_in_list_policies_for_group.go�������������������������������������������������������0000664�0000000�0000000�00000001535�13771713062�0037744�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PoliciesInListPoliciesForGroup is a nested struct in ram response type PoliciesInListPoliciesForGroup struct { Policy []Policy `json:"Policy" xml:"Policy"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_policies_in_list_policies_for_role.go��������������������������������������������������������0000664�0000000�0000000�00000001533�13771713062�0037547�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PoliciesInListPoliciesForRole is a nested struct in ram response type PoliciesInListPoliciesForRole struct { Policy []Policy `json:"Policy" xml:"Policy"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_policies_in_list_policies_for_user.go��������������������������������������������������������0000664�0000000�0000000�00000001533�13771713062�0037564�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PoliciesInListPoliciesForUser is a nested struct in ram response type PoliciesInListPoliciesForUser struct { Policy []Policy `json:"Policy" xml:"Policy"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy.go��������0000664�0000000�0000000�00000002500�13771713062�0032012�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Policy is a nested struct in ram response type Policy struct { PolicyDocument string `json:"PolicyDocument" xml:"PolicyDocument"` AttachDate string `json:"AttachDate" xml:"AttachDate"` CreateDate string `json:"CreateDate" xml:"CreateDate"` PolicyType string `json:"PolicyType" xml:"PolicyType"` UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` AttachmentCount int `json:"AttachmentCount" xml:"AttachmentCount"` PolicyName string `json:"PolicyName" xml:"PolicyName"` DefaultVersion string `json:"DefaultVersion" xml:"DefaultVersion"` Description string `json:"Description" xml:"Description"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_policy_version.go0000664�0000000�0000000�00000002027�13771713062�0033563�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PolicyVersion is a nested struct in ram response type PolicyVersion struct { VersionId string `json:"VersionId" xml:"VersionId"` PolicyDocument string `json:"PolicyDocument" xml:"PolicyDocument"` CreateDate string `json:"CreateDate" xml:"CreateDate"` IsDefaultVersion bool `json:"IsDefaultVersion" xml:"IsDefaultVersion"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_policy_versions.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001531�13771713062�0033666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PolicyVersions is a nested struct in ram response type PolicyVersions struct { PolicyVersion []PolicyVersion `json:"PolicyVersion" xml:"PolicyVersion"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_key.go����0000664�0000000�0000000�00000001761�13771713062�0032651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PublicKey is a nested struct in ram response type PublicKey struct { CreateDate string `json:"CreateDate" xml:"CreateDate"` PublicKeyId string `json:"PublicKeyId" xml:"PublicKeyId"` Status string `json:"Status" xml:"Status"` PublicKeySpec string `json:"PublicKeySpec" xml:"PublicKeySpec"` } ���������������struct_public_key_preference.go���������������������������������������������������������������������0000664�0000000�0000000�00000001602�13771713062�0034762�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PublicKeyPreference is a nested struct in ram response type PublicKeyPreference struct { AllowUserToManagePublicKeys bool `json:"AllowUserToManagePublicKeys" xml:"AllowUserToManagePublicKeys"` } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_public_keys.go���0000664�0000000�0000000�00000001501�13771713062�0033024�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // PublicKeys is a nested struct in ram response type PublicKeys struct { PublicKey []PublicKey `json:"PublicKey" xml:"PublicKey"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_role.go����������0000664�0000000�0000000�00000002457�13771713062�0031467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Role is a nested struct in ram response type Role struct { RoleId string `json:"RoleId" xml:"RoleId"` CreateDate string `json:"CreateDate" xml:"CreateDate"` AttachDate string `json:"AttachDate" xml:"AttachDate"` Arn string `json:"Arn" xml:"Arn"` UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` Description string `json:"Description" xml:"Description"` RoleName string `json:"RoleName" xml:"RoleName"` AssumeRolePolicyDocument string `json:"AssumeRolePolicyDocument" xml:"AssumeRolePolicyDocument"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_roles_in_list_entities_for_policy.go���������������������������������������������������������0000664�0000000�0000000�00000001521�13771713062�0037434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RolesInListEntitiesForPolicy is a nested struct in ram response type RolesInListEntitiesForPolicy struct { Role []Role `json:"Role" xml:"Role"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_roles_in_list_roles.go�����������������������������������������������������������������������0000664�0000000�0000000�00000001471�13771713062�0034513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // RolesInListRoles is a nested struct in ram response type RolesInListRoles struct { Role []Role `json:"Role" xml:"Role"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_security_preference.go�����������������������������������������������������������������������0000664�0000000�0000000�00000002251�13771713062�0034504�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // SecurityPreference is a nested struct in ram response type SecurityPreference struct { MFAPreference MFAPreference `json:"MFAPreference" xml:"MFAPreference"` LoginProfilePreference LoginProfilePreference `json:"LoginProfilePreference" xml:"LoginProfilePreference"` PublicKeyPreference PublicKeyPreference `json:"PublicKeyPreference" xml:"PublicKeyPreference"` AccessKeyPreference AccessKeyPreference `json:"AccessKeyPreference" xml:"AccessKeyPreference"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/struct_user.go����������0000664�0000000�0000000�00000002560�13771713062�0031477�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // User is a nested struct in ram response type User struct { MobilePhone string `json:"MobilePhone" xml:"MobilePhone"` Comments string `json:"Comments" xml:"Comments"` CreateDate string `json:"CreateDate" xml:"CreateDate"` AttachDate string `json:"AttachDate" xml:"AttachDate"` Email string `json:"Email" xml:"Email"` UserId string `json:"UserId" xml:"UserId"` UpdateDate string `json:"UpdateDate" xml:"UpdateDate"` UserName string `json:"UserName" xml:"UserName"` JoinDate string `json:"JoinDate" xml:"JoinDate"` LastLoginDate string `json:"LastLoginDate" xml:"LastLoginDate"` DisplayName string `json:"DisplayName" xml:"DisplayName"` } ������������������������������������������������������������������������������������������������������������������������������������������������struct_users_in_list_entities_for_policy.go���������������������������������������������������������0000664�0000000�0000000�00000001521�13771713062�0037451�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // UsersInListEntitiesForPolicy is a nested struct in ram response type UsersInListEntitiesForPolicy struct { User []User `json:"User" xml:"User"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_users_in_list_users.go�����������������������������������������������������������������������0000664�0000000�0000000�00000001471�13771713062�0034545�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // UsersInListUsers is a nested struct in ram response type UsersInListUsers struct { User []User `json:"User" xml:"User"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_users_in_list_users_for_group.go�������������������������������������������������������������0000664�0000000�0000000�00000001511�13771713062�0036622�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // UsersInListUsersForGroup is a nested struct in ram response type UsersInListUsersForGroup struct { User []User `json:"User" xml:"User"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_virtual_mfa_device.go������������������������������������������������������������������������0000664�0000000�0000000�00000002117�13771713062�0034270�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VirtualMFADevice is a nested struct in ram response type VirtualMFADevice struct { QRCodePNG string `json:"QRCodePNG" xml:"QRCodePNG"` ActivateDate string `json:"ActivateDate" xml:"ActivateDate"` Base32StringSeed string `json:"Base32StringSeed" xml:"Base32StringSeed"` SerialNumber string `json:"SerialNumber" xml:"SerialNumber"` User User `json:"User" xml:"User"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������struct_virtual_mfa_devices.go�����������������������������������������������������������������������0000664�0000000�0000000�00000001553�13771713062�0034456�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram��������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // VirtualMFADevices is a nested struct in ram response type VirtualMFADevices struct { VirtualMFADevice []VirtualMFADevice `json:"VirtualMFADevice" xml:"VirtualMFADevice"` } �����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/unbind_mfa_device.go����0000664�0000000�0000000�00000007153�13771713062�0032541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UnbindMFADevice invokes the ram.UnbindMFADevice API synchronously // api document: https://help.aliyun.com/api/ram/unbindmfadevice.html func (client *Client) UnbindMFADevice(request *UnbindMFADeviceRequest) (response *UnbindMFADeviceResponse, err error) { response = CreateUnbindMFADeviceResponse() err = client.DoAction(request, response) return } // UnbindMFADeviceWithChan invokes the ram.UnbindMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/unbindmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnbindMFADeviceWithChan(request *UnbindMFADeviceRequest) (<-chan *UnbindMFADeviceResponse, <-chan error) { responseChan := make(chan *UnbindMFADeviceResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UnbindMFADevice(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UnbindMFADeviceWithCallback invokes the ram.UnbindMFADevice API asynchronously // api document: https://help.aliyun.com/api/ram/unbindmfadevice.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UnbindMFADeviceWithCallback(request *UnbindMFADeviceRequest, callback func(response *UnbindMFADeviceResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UnbindMFADeviceResponse var err error defer close(result) response, err = client.UnbindMFADevice(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UnbindMFADeviceRequest is the request struct for api UnbindMFADevice type UnbindMFADeviceRequest struct { *requests.RpcRequest UserName string `position:"Query" name:"UserName"` } // UnbindMFADeviceResponse is the response struct for api UnbindMFADevice type UnbindMFADeviceResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` MFADevice MFADevice `json:"MFADevice" xml:"MFADevice"` } // CreateUnbindMFADeviceRequest creates a request to invoke UnbindMFADevice API func CreateUnbindMFADeviceRequest() (request *UnbindMFADeviceRequest) { request = &UnbindMFADeviceRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UnbindMFADevice", "ram", "openAPI") return } // CreateUnbindMFADeviceResponse creates a response to parse from UnbindMFADevice response func CreateUnbindMFADeviceResponse() (response *UnbindMFADeviceResponse) { response = &UnbindMFADeviceResponse{ BaseResponse: &responses.BaseResponse{}, } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_access_key.go����0000664�0000000�0000000�00000007262�13771713062�0032574�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UpdateAccessKey invokes the ram.UpdateAccessKey API synchronously // api document: https://help.aliyun.com/api/ram/updateaccesskey.html func (client *Client) UpdateAccessKey(request *UpdateAccessKeyRequest) (response *UpdateAccessKeyResponse, err error) { response = CreateUpdateAccessKeyResponse() err = client.DoAction(request, response) return } // UpdateAccessKeyWithChan invokes the ram.UpdateAccessKey API asynchronously // api document: https://help.aliyun.com/api/ram/updateaccesskey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateAccessKeyWithChan(request *UpdateAccessKeyRequest) (<-chan *UpdateAccessKeyResponse, <-chan error) { responseChan := make(chan *UpdateAccessKeyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UpdateAccessKey(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UpdateAccessKeyWithCallback invokes the ram.UpdateAccessKey API asynchronously // api document: https://help.aliyun.com/api/ram/updateaccesskey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateAccessKeyWithCallback(request *UpdateAccessKeyRequest, callback func(response *UpdateAccessKeyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UpdateAccessKeyResponse var err error defer close(result) response, err = client.UpdateAccessKey(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UpdateAccessKeyRequest is the request struct for api UpdateAccessKey type UpdateAccessKeyRequest struct { *requests.RpcRequest UserAccessKeyId string `position:"Query" name:"UserAccessKeyId"` UserName string `position:"Query" name:"UserName"` Status string `position:"Query" name:"Status"` } // UpdateAccessKeyResponse is the response struct for api UpdateAccessKey type UpdateAccessKeyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUpdateAccessKeyRequest creates a request to invoke UpdateAccessKey API func CreateUpdateAccessKeyRequest() (request *UpdateAccessKeyRequest) { request = &UpdateAccessKeyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UpdateAccessKey", "ram", "openAPI") return } // CreateUpdateAccessKeyResponse creates a response to parse from UpdateAccessKey response func CreateUpdateAccessKeyResponse() (response *UpdateAccessKeyResponse) { response = &UpdateAccessKeyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_group.go���������0000664�0000000�0000000�00000007071�13771713062�0031615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UpdateGroup invokes the ram.UpdateGroup API synchronously // api document: https://help.aliyun.com/api/ram/updategroup.html func (client *Client) UpdateGroup(request *UpdateGroupRequest) (response *UpdateGroupResponse, err error) { response = CreateUpdateGroupResponse() err = client.DoAction(request, response) return } // UpdateGroupWithChan invokes the ram.UpdateGroup API asynchronously // api document: https://help.aliyun.com/api/ram/updategroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateGroupWithChan(request *UpdateGroupRequest) (<-chan *UpdateGroupResponse, <-chan error) { responseChan := make(chan *UpdateGroupResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UpdateGroup(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UpdateGroupWithCallback invokes the ram.UpdateGroup API asynchronously // api document: https://help.aliyun.com/api/ram/updategroup.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateGroupWithCallback(request *UpdateGroupRequest, callback func(response *UpdateGroupResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UpdateGroupResponse var err error defer close(result) response, err = client.UpdateGroup(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UpdateGroupRequest is the request struct for api UpdateGroup type UpdateGroupRequest struct { *requests.RpcRequest NewGroupName string `position:"Query" name:"NewGroupName"` NewComments string `position:"Query" name:"NewComments"` GroupName string `position:"Query" name:"GroupName"` } // UpdateGroupResponse is the response struct for api UpdateGroup type UpdateGroupResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Group Group `json:"Group" xml:"Group"` } // CreateUpdateGroupRequest creates a request to invoke UpdateGroup API func CreateUpdateGroupRequest() (request *UpdateGroupRequest) { request = &UpdateGroupRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UpdateGroup", "ram", "openAPI") return } // CreateUpdateGroupResponse creates a response to parse from UpdateGroup response func CreateUpdateGroupResponse() (response *UpdateGroupResponse) { response = &UpdateGroupResponse{ BaseResponse: &responses.BaseResponse{}, } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_login_profile.go�0000664�0000000�0000000�00000007664�13771713062�0033321�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UpdateLoginProfile invokes the ram.UpdateLoginProfile API synchronously // api document: https://help.aliyun.com/api/ram/updateloginprofile.html func (client *Client) UpdateLoginProfile(request *UpdateLoginProfileRequest) (response *UpdateLoginProfileResponse, err error) { response = CreateUpdateLoginProfileResponse() err = client.DoAction(request, response) return } // UpdateLoginProfileWithChan invokes the ram.UpdateLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/updateloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateLoginProfileWithChan(request *UpdateLoginProfileRequest) (<-chan *UpdateLoginProfileResponse, <-chan error) { responseChan := make(chan *UpdateLoginProfileResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UpdateLoginProfile(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UpdateLoginProfileWithCallback invokes the ram.UpdateLoginProfile API asynchronously // api document: https://help.aliyun.com/api/ram/updateloginprofile.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateLoginProfileWithCallback(request *UpdateLoginProfileRequest, callback func(response *UpdateLoginProfileResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UpdateLoginProfileResponse var err error defer close(result) response, err = client.UpdateLoginProfile(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UpdateLoginProfileRequest is the request struct for api UpdateLoginProfile type UpdateLoginProfileRequest struct { *requests.RpcRequest Password string `position:"Query" name:"Password"` PasswordResetRequired requests.Boolean `position:"Query" name:"PasswordResetRequired"` MFABindRequired requests.Boolean `position:"Query" name:"MFABindRequired"` UserName string `position:"Query" name:"UserName"` } // UpdateLoginProfileResponse is the response struct for api UpdateLoginProfile type UpdateLoginProfileResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUpdateLoginProfileRequest creates a request to invoke UpdateLoginProfile API func CreateUpdateLoginProfileRequest() (request *UpdateLoginProfileRequest) { request = &UpdateLoginProfileRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UpdateLoginProfile", "ram", "openAPI") return } // CreateUpdateLoginProfileResponse creates a response to parse from UpdateLoginProfile response func CreateUpdateLoginProfileResponse() (response *UpdateLoginProfileResponse) { response = &UpdateLoginProfileResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_public_key.go����0000664�0000000�0000000�00000007262�13771713062�0032611�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UpdatePublicKey invokes the ram.UpdatePublicKey API synchronously // api document: https://help.aliyun.com/api/ram/updatepublickey.html func (client *Client) UpdatePublicKey(request *UpdatePublicKeyRequest) (response *UpdatePublicKeyResponse, err error) { response = CreateUpdatePublicKeyResponse() err = client.DoAction(request, response) return } // UpdatePublicKeyWithChan invokes the ram.UpdatePublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/updatepublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdatePublicKeyWithChan(request *UpdatePublicKeyRequest) (<-chan *UpdatePublicKeyResponse, <-chan error) { responseChan := make(chan *UpdatePublicKeyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UpdatePublicKey(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UpdatePublicKeyWithCallback invokes the ram.UpdatePublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/updatepublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdatePublicKeyWithCallback(request *UpdatePublicKeyRequest, callback func(response *UpdatePublicKeyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UpdatePublicKeyResponse var err error defer close(result) response, err = client.UpdatePublicKey(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UpdatePublicKeyRequest is the request struct for api UpdatePublicKey type UpdatePublicKeyRequest struct { *requests.RpcRequest UserPublicKeyId string `position:"Query" name:"UserPublicKeyId"` UserName string `position:"Query" name:"UserName"` Status string `position:"Query" name:"Status"` } // UpdatePublicKeyResponse is the response struct for api UpdatePublicKey type UpdatePublicKeyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` } // CreateUpdatePublicKeyRequest creates a request to invoke UpdatePublicKey API func CreateUpdatePublicKeyRequest() (request *UpdatePublicKeyRequest) { request = &UpdatePublicKeyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UpdatePublicKey", "ram", "openAPI") return } // CreateUpdatePublicKeyResponse creates a response to parse from UpdatePublicKey response func CreateUpdatePublicKeyResponse() (response *UpdatePublicKeyResponse) { response = &UpdatePublicKeyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_role.go����������0000664�0000000�0000000�00000007000�13771713062�0031412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UpdateRole invokes the ram.UpdateRole API synchronously // api document: https://help.aliyun.com/api/ram/updaterole.html func (client *Client) UpdateRole(request *UpdateRoleRequest) (response *UpdateRoleResponse, err error) { response = CreateUpdateRoleResponse() err = client.DoAction(request, response) return } // UpdateRoleWithChan invokes the ram.UpdateRole API asynchronously // api document: https://help.aliyun.com/api/ram/updaterole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateRoleWithChan(request *UpdateRoleRequest) (<-chan *UpdateRoleResponse, <-chan error) { responseChan := make(chan *UpdateRoleResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UpdateRole(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UpdateRoleWithCallback invokes the ram.UpdateRole API asynchronously // api document: https://help.aliyun.com/api/ram/updaterole.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateRoleWithCallback(request *UpdateRoleRequest, callback func(response *UpdateRoleResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UpdateRoleResponse var err error defer close(result) response, err = client.UpdateRole(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UpdateRoleRequest is the request struct for api UpdateRole type UpdateRoleRequest struct { *requests.RpcRequest NewAssumeRolePolicyDocument string `position:"Query" name:"NewAssumeRolePolicyDocument"` RoleName string `position:"Query" name:"RoleName"` } // UpdateRoleResponse is the response struct for api UpdateRole type UpdateRoleResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` Role Role `json:"Role" xml:"Role"` } // CreateUpdateRoleRequest creates a request to invoke UpdateRole API func CreateUpdateRoleRequest() (request *UpdateRoleRequest) { request = &UpdateRoleRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UpdateRole", "ram", "openAPI") return } // CreateUpdateRoleResponse creates a response to parse from UpdateRole response func CreateUpdateRoleResponse() (response *UpdateRoleResponse) { response = &UpdateRoleResponse{ BaseResponse: &responses.BaseResponse{}, } return } packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/update_user.go����������0000664�0000000�0000000�00000007315�13771713062�0031440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UpdateUser invokes the ram.UpdateUser API synchronously // api document: https://help.aliyun.com/api/ram/updateuser.html func (client *Client) UpdateUser(request *UpdateUserRequest) (response *UpdateUserResponse, err error) { response = CreateUpdateUserResponse() err = client.DoAction(request, response) return } // UpdateUserWithChan invokes the ram.UpdateUser API asynchronously // api document: https://help.aliyun.com/api/ram/updateuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateUserWithChan(request *UpdateUserRequest) (<-chan *UpdateUserResponse, <-chan error) { responseChan := make(chan *UpdateUserResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UpdateUser(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UpdateUserWithCallback invokes the ram.UpdateUser API asynchronously // api document: https://help.aliyun.com/api/ram/updateuser.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UpdateUserWithCallback(request *UpdateUserRequest, callback func(response *UpdateUserResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UpdateUserResponse var err error defer close(result) response, err = client.UpdateUser(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UpdateUserRequest is the request struct for api UpdateUser type UpdateUserRequest struct { *requests.RpcRequest NewUserName string `position:"Query" name:"NewUserName"` NewDisplayName string `position:"Query" name:"NewDisplayName"` NewMobilePhone string `position:"Query" name:"NewMobilePhone"` NewComments string `position:"Query" name:"NewComments"` NewEmail string `position:"Query" name:"NewEmail"` UserName string `position:"Query" name:"UserName"` } // UpdateUserResponse is the response struct for api UpdateUser type UpdateUserResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` User User `json:"User" xml:"User"` } // CreateUpdateUserRequest creates a request to invoke UpdateUser API func CreateUpdateUserRequest() (request *UpdateUserRequest) { request = &UpdateUserRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UpdateUser", "ram", "openAPI") return } // CreateUpdateUserResponse creates a response to parse from UpdateUser response func CreateUpdateUserResponse() (response *UpdateUserResponse) { response = &UpdateUserResponse{ BaseResponse: &responses.BaseResponse{}, } return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/aliyun/alibaba-cloud-sdk-go/services/ram/upload_public_key.go����0000664�0000000�0000000�00000007256�13771713062�0032616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ram //Licensed under the Apache License, Version 2.0 (the "License"); //you may not use this file except in compliance with the License. //You may obtain a copy of the License at // //http://www.apache.org/licenses/LICENSE-2.0 // //Unless required by applicable law or agreed to in writing, software //distributed under the License is distributed on an "AS IS" BASIS, //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //See the License for the specific language governing permissions and //limitations under the License. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // UploadPublicKey invokes the ram.UploadPublicKey API synchronously // api document: https://help.aliyun.com/api/ram/uploadpublickey.html func (client *Client) UploadPublicKey(request *UploadPublicKeyRequest) (response *UploadPublicKeyResponse, err error) { response = CreateUploadPublicKeyResponse() err = client.DoAction(request, response) return } // UploadPublicKeyWithChan invokes the ram.UploadPublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/uploadpublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UploadPublicKeyWithChan(request *UploadPublicKeyRequest) (<-chan *UploadPublicKeyResponse, <-chan error) { responseChan := make(chan *UploadPublicKeyResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.UploadPublicKey(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // UploadPublicKeyWithCallback invokes the ram.UploadPublicKey API asynchronously // api document: https://help.aliyun.com/api/ram/uploadpublickey.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) UploadPublicKeyWithCallback(request *UploadPublicKeyRequest, callback func(response *UploadPublicKeyResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *UploadPublicKeyResponse var err error defer close(result) response, err = client.UploadPublicKey(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // UploadPublicKeyRequest is the request struct for api UploadPublicKey type UploadPublicKeyRequest struct { *requests.RpcRequest PublicKeySpec string `position:"Query" name:"PublicKeySpec"` UserName string `position:"Query" name:"UserName"` } // UploadPublicKeyResponse is the response struct for api UploadPublicKey type UploadPublicKeyResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` PublicKey PublicKey `json:"PublicKey" xml:"PublicKey"` } // CreateUploadPublicKeyRequest creates a request to invoke UploadPublicKey API func CreateUploadPublicKeyRequest() (request *UploadPublicKeyRequest) { request = &UploadPublicKeyRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Ram", "2015-05-01", "UploadPublicKey", "ram", "openAPI") return } // CreateUploadPublicKeyResponse creates a response to parse from UploadPublicKey response func CreateUploadPublicKeyResponse() (response *UploadPublicKeyResponse) { response = &UploadPublicKeyResponse{ BaseResponse: &responses.BaseResponse{}, } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020622�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022404�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/.codeclimate.yml�������������������������������0000664�0000000�0000000�00000000744�13771713062�0025463�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������version: "2" checks: argument-count: enabled: false complex-logic: enabled: false file-lines: enabled: false method-complexity: enabled: false method-count: enabled: false method-lines: enabled: false nested-control-flow: enabled: false return-statements: enabled: false similar-code: enabled: false identical-code: enabled: false plugins: gofmt: enabled: true golint: enabled: true govet: enabled: true ����������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/.gitignore�������������������������������������0000664�0000000�0000000�00000000050�13771713062�0024367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������.token dist ops.asc vendor listApis.json����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/.golangci.yml����������������������������������0000664�0000000�0000000�00000000632�13771713062�0024771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������linters-settings: golint: min-confidence: 0.3 gocyclo: min-complexity: 28 goimports: local-prefixes: github.com linters: enable: - deadcode - dupl - errcheck - gocyclo - goimports - golint - gosimple - govet - ineffassign - megacheck - nakedret - scopelint - staticcheck - structcheck - unused - varcheck disable-all: true ������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/.gometalinter.json�����������������������������0000664�0000000�0000000�00000000653�13771713062�0026053�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������{ "Test": false, "Enable": [ "deadcode", "errcheck", "golint", "gosimple", "gotype", "ineffassign", "interfacer", "misspell", "structcheck", "unconvert", "varcheck", "vet", "vetshadow" ], "Disable": [ "goconst", "gocyclo", "gosec", "maligned" ], "Skip": ["vendor"] } �������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/.travis.yml������������������������������������0000664�0000000�0000000�00000002050�13771713062�0024512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������language: go dist: xenial sudo: required go: - "1.7.x" - "1.8.x" - "1.9.x" - "1.10.x" - "1.11.x" - "1.12.x" - tip env: - GOLANGCI_LINT_VERSION=1.15.0 GO111MODULES=on cache: apt addons: apt: update: true packages: - rpm install: - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v${GOLANGCI_LINT_VERSION} - npm i codeclimate-test-reporter - '[ "$(echo "$TRAVIS_GO_VERSION" | perl -pe "s/\\.[x\\d]+$//")" = "1.11" ] && go mod vendor || go get -u github.com/gofrs/uuid' before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - go test -race -coverprofile=c.out -covermode=atomic . after_script: - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT jobs: include: - stage: golangci-lint go: 1.10.x if: type = pull_request script: - go get -u github.com/gofrs/uuid - golangci-lint run . ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/AUTHORS����������������������������������������0000664�0000000�0000000�00000000243�13771713062�0023453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Pierre-Yves Ritschard Vincent Bernat Chris Baumbauer Marc-Aurèle Brothier Sebastien Goasguen Yoan Blanc Stefano Marengo Pierre-Emmanuel Jacquier Fabrizio Steiner �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/CHANGELOG.md�����������������������������������0000664�0000000�0000000�00000024266�13771713062�0024227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Changelog ========= 0.18.1 ------ - change: make the "User-Agent" HTTP request header more informative and exposed 0.18.0 ------ - feature: add method `DeepCopy` on type `AsyncJobResult` (#403) 0.17.2 ------ - remove: remove the `IsFeatured` parameter from call `RegisterCustomTemplate` (#402) 0.17.1 ------ - feature: add parameter `RescueProfile` to call `StartVirtualMachine` (#401) 0.17.0 ------ - feature: add new call `RegisterCustomTemplate` (#400) - feature: add new call `DeleteTemplate` (#399) 0.16.0 ------ - feature: Add `Healthcheck*` parameters to call `UpdateIPAddress` - change: Replace satori/go.uuid by gofrs/uuid 0.15.0 ------ - change: prefix the healthcheck-related params with `Healthcheck` on call `AssociateIPAddress` - EIP: the healthcheck should be a pointer - ip addresses: Add the Healthcheck parameters - readme: point to new lego org (#395) - dns: user_id is not sent back (#394) 0.14.3 ------ - fix: `AffinityGroup` lists virtual machines with `UUID` rather than string 0.14.2 ------ - fix: `ListVirtualMachines` by `IDs` to accept `UUID` rather than string 0.14.1 ------ - fix: `GetRunstatusPage` to always contain the subresources - fix: `ListRunstatus*` to fetch all the subresources - feature: `PaginateRunstatus*` used by list 0.14.0 ------ - change: all DNS calls require a context - fix: `CreateAffinityGroup` allows empty `name` 0.13.3 ------ - fix: runstatus unmarshalling errors - feature: `UUID` implements DeepCopy, DeepCopyInto - change: export `BooleanResponse` 0.13.2 ------ - feat: initial Runstatus API support - feat: `admin` namespace containing `ListVirtualMachines` for admin usage 0.13.1 ------ - feat: `Iso` support `ListIsos`, `AttachIso`, and `DetachIso` 0.13.0 ------ - change: `Paginate` to accept `Listable` - change: `ListCommand` is also `Listable` - change: `client.Get` doesn't modify the given resource, returns a new one - change: `Command` and `AsyncCommand` are fully public, thus extensible - remove: `Gettable` 0.12.5 ------ - fix: `AuthorizeSecurityGroupEgress` could return `authorizeSecurityGroupIngress` as name 0.12.4 ------ - feat: `Snapshot` is `Listable` 0.12.3 ------ - change: replace dep by Go modules - change: remove domainid,domain,regionid,listall,isrecursive,... fields - remove: `MigrateVirtualMachine`, `CreateUser`, `EnableAccount`, and other admin calls 0.12.2 ------ - fix: `ListNics` has no virtualmachineid limitations anymore - fix: `PCIDevice` ids are not UUIDs 0.12.1 ------ - fix: `UpdateVMNicIP` is async 0.12.0 ------ - feat: new VM state `Moving` - feat: `UpdateNetwork` with `startip`, `endip`, `netmask` - feat: `NetworkOffering` is `Listable` - feat: when it fails parsing the body, it shows it - fix: `Snapshot.State` is a string, rather than an scalar - change: signature are now using the v3 version with expires by default 0.11.6 ------ - fix: `Network.ListRequest` accepts a `Name` argument - change: `SecurityGroup` and the rules aren't `Taggable` anymore 0.11.5 ------ - feat: addition of `UpdateVMNicIP` - fix: `UpdateVMAffinityGroup` expected response 0.11.4 ------ *no changes in the core library* 0.11.3 ------ *no changes in the core library* 0.11.2 ------ - fix: empty list responses 0.11.1 ------ - fix: `client.Sign` handles correctly the brackets (kudos to @stffabi) - change: `client.Payload` returns a `url.Values` 0.11.0 ------ - feat: `listOSCategories` and `OSCategory` type - feat: `listApis` supports recursive response structures - feat: `GetRecordsWithFilters` to list records with name or record_type filters - fix: better `DNSErrorResponse` - fix: `ListResourceLimits` type - change: use UUID everywhere 0.10.5 ------ - feat: `Client.Logger` to plug in any `*log.Logger` - feat: `Client.TraceOn`/`ClientTraceOff` to toggle the HTTP tracing 0.10.4 ------ - feat: `CIDR` to replace string string - fix: prevent panic on nil 0.10.3 ------ - feat: `Account` is Listable - feat: `MACAddress` to replace string type - fix: Go 1.7 support 0.10.2 ------ - fix: ActivateIP6 response 0.10.1 ------ - feat: expose `SyncRequest` and `SyncRequestWithContext` - feat: addition of reverse DNS calls - feat: addition of `SecurityGroup.UserSecurityGroup` 0.10.0 ------ - global: cloudstack documentation links are moved into cs - global: removal of all the `...Response` types - feat: `Network` is `Listable` - feat: addition of `deleteUser` - feat: addition of `listHosts` - feat: addition of `updateHost` - feat: exo cmd (kudos to @pierre-emmanuelJ) - change: refactor `Gettable` to use `ListRequest` 0.9.31 ------ - fix: `IPAddress`.`ListRequest` with boolean fields - fix: `Network`.`ListRequest` with boolean fields - fix: `ServiceOffering`.`ListRequest` with boolean fields 0.9.30 ------ - fix: `VirtualMachine` `PCIDevice` representation was incomplete 0.9.29 ------ - change: `DNSErrorResponse` is a proper `error` 0.9.28 ------ - feat: addition of `GetDomains` - fix: `UpdateDomain` may contain more empty fields than `CreateDomain` 0.9.27 ------ - fix: expects body to be `application/json` 0.9.26 ------ - change: async timeout strategy wait two seconds and not fib(n) seconds 0.9.25 ------ - fix: `GetVirtualUserData` response with `Decode` method handling base64 and gzip 0.9.24 ------ - feat: `Template` is `Gettable` - feat: `ServiceOffering` is `Gettable` - feat: addition of `GetAPILimit` - feat: addition of `CreateTemplate`, `PrepareTemplate`, `CopyTemplate`, `UpdateTemplate`, `RegisterTemplate` - feat: addition of `MigrateVirtualMachine` - feat: cmd cli - change: remove useless fields related to Project and VPC 0.9.23 ------ - feat: `booleanResponse` supports true booleans: https://github.com/apache/cloudstack/pull/2428 0.9.22 ------ - feat: `ListUsers`, `CreateUser`, `UpdateUser` - feat: `ListResourceDetails` - feat: `SecurityGroup` helper `RuleByID` - feat: `Sign` signs the payload - feat: `UpdateNetworkOffering` - feat: `GetVirtualMachineUserData` - feat: `EnableAccount` and `DisableAccount` (admin stuff) - feat: `AsyncRequest` and `AsyncRequestWithContext` to examine the polling - fix: `AuthorizeSecurityGroupIngress` support for ICMPv6 - change: move `APIName()` into the `Client`, nice godoc - change: `Payload` doesn't sign the request anymore - change: `Client` exposes more of its underlying data - change: requests are sent as GET unless it body size is too big 0.9.21 ------ - feat: `Network` is `Listable` - feat: `Zone` is `Gettable` - feat: `Client.Payload` to help preview the HTTP parameters - feat: generate command utility - fix: `CreateSnapshot` was missing the `Name` attribute - fix: `ListSnapshots` was missing the `IDs` attribute - fix: `ListZones` was missing the `NetworkType` attribute - fix: `ListAsyncJobs` was missing the `ListAll` attribute - change: ICMP Type/Code are uint8 and TCP/UDP port are uint16 0.9.20 ------ - feat: `Template` is `Listable` - feat: `IPAddress` is `Listable` - change: `List` and `Paginate` return pointers - fix: `Template` was missing `tags` 0.9.19 ------ - feat: `SSHKeyPair` is `Listable` 0.9.18 ------ - feat: `VirtualMachine` is `Listable` - feat: new `Client.Paginate` and `Client.PaginateWithContext` - change: the inner logic of `Listable` - remove: not working `Client.AsyncList` 0.9.17 ------ - fix: `AuthorizeSecurityGroup(In|E)gress` startport may be zero 0.9.16 ------ - feat: new `Listable` interface - feat: `Nic` is `Listable` - feat: `Volume` is `Listable` - feat: `Zone` is `Listable` - feat: `AffinityGroup` is `Listable` - remove: deprecated methods `ListNics`, `AddIPToNic`, and `RemoveIPFromNic` - remove: deprecated method `GetRootVolumeForVirtualMachine` 0.9.15 ------ - feat: `IPAddress` is `Gettable` and `Deletable` - fix: serialization of *bool 0.9.14 ------ - fix: `GetVMPassword` response - remove: deprecated `GetTopology`, `GetImages`, and al 0.9.13 ------ - feat: IP4 and IP6 flags to DeployVirtualMachine - feat: add ActivateIP6 - fix: error message was gobbled on 40x 0.9.12 ------ - feat: add `BooleanRequestWithContext` - feat: add `client.Get`, `client.GetWithContext` to fetch a resource - feat: add `cleint.Delete`, `client.DeleteWithContext` to delete a resource - feat: `SSHKeyPair` is `Gettable` and `Deletable` - feat: `VirtualMachine` is `Gettable` and `Deletable` - feat: `AffinityGroup` is `Gettable` and `Deletable` - feat: `SecurityGroup` is `Gettable` and `Deletable` - remove: deprecated methods `CreateAffinityGroup`, `DeleteAffinityGroup` - remove: deprecated methods `CreateKeypair`, `DeleteKeypair`, `RegisterKeypair` - remove: deprecated method `GetSecurityGroupID` 0.9.11 ------ - feat: CloudStack API name is now public `APIName()` - feat: enforce the mutual exclusivity of some fields - feat: add `context.Context` to `RequestWithContext` - change: `AsyncRequest` and `BooleanAsyncRequest` are gone, use `Request` and `BooleanRequest` instead. - change: `AsyncInfo` is no more 0.9.10 ------ - fix: typo made ListAll required in ListPublicIPAddresses - fix: all bool are now *bool, respecting CS default value - feat: (*VM).DefaultNic() to obtain the main Nic 0.9.9 ----- - fix: affinity groups virtualmachineIds attribute - fix: uuidList is not a list of strings 0.9.8 ----- - feat: add RootDiskSize to RestoreVirtualMachine - fix: monotonic polling using Context 0.9.7 ----- - feat: add Taggable interface to expose ResourceType - feat: add (Create|Update|Delete|List)InstanceGroup(s) - feat: add RegisterUserKeys - feat: add ListResourceLimits - feat: add ListAccounts 0.9.6 ----- - fix: update UpdateVirtualMachine userdata - fix: Network's name/displaytext might be empty 0.9.5 ----- - fix: serialization of slice 0.9.4 ----- - fix: constants 0.9.3 ----- - change: userdata expects a string - change: no pointer in sub-struct's 0.9.2 ----- - bug: createNetwork is a sync call - bug: typo in listVirtualMachines' domainid - bug: serialization of map[string], e.g. UpdateVirtualMachine - change: IPAddress's use net.IP type - feat: helpers VM.NicsByType, VM.NicByNetworkID, VM.NicByID - feat: addition of CloudStack ApiErrorCode constants 0.9.1 ----- - bug: sync calls returns succes as a string rather than a bool - change: unexport BooleanResponse types - feat: original CloudStack error response can be obtained 0.9.0 ----- Big refactoring, addition of the documentation, compliance to golint. 0.1.0 ----- Initial library ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/LICENSE����������������������������������������0000664�0000000�0000000�00000026055�13771713062�0023421�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2014 exoscale(tm) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/README.md��������������������������������������0000664�0000000�0000000�00000003256�13771713062�0023671�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������--- title: Egoscale description: the Go library for Exoscale --- <a href="https://gopherize.me/gopher/9c1bc7cfe1d84cf43e477dbfc4aa86332065f1fd"><img src="gopher.png" align="right" alt=""></a> [![Build Status](https://travis-ci.org/exoscale/egoscale.svg?branch=master)](https://travis-ci.org/exoscale/egoscale) [![Maintainability](https://api.codeclimate.com/v1/badges/fcab3b624b7d3ca96a9d/maintainability)](https://codeclimate.com/github/exoscale/egoscale/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/fcab3b624b7d3ca96a9d/test_coverage)](https://codeclimate.com/github/exoscale/egoscale/test_coverage) [![GoDoc](https://godoc.org/github.com/exoscale/egoscale?status.svg)](https://godoc.org/github.com/exoscale/egoscale) [![Go Report Card](https://goreportcard.com/badge/github.com/exoscale/egoscale)](https://goreportcard.com/report/github.com/exoscale/egoscale) A wrapper for the [Exoscale public cloud](https://www.exoscale.com) API. ## Known users - [Exoscale CLI](https://github.com/exoscale/cli) - [Exoscale Terraform provider](https://github.com/exoscale/terraform-provider-exoscale) - [ExoIP](https://github.com/exoscale/exoip): IP Watchdog - [Lego](https://github.com/go-acme/lego): Let's Encrypt and ACME library - Kubernetes Incubator: [External DNS](https://github.com/kubernetes-incubator/external-dns) - [Docker machine](https://docs.docker.com/machine/drivers/exoscale/) - [etc.](https://godoc.org/github.com/exoscale/egoscale?importers) ## License Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/accounts.go������������������������������������0000664�0000000�0000000�00000017174�13771713062�0024564�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // Account provides the detailed account information type Account struct { AccountDetails map[string]string `json:"accountdetails,omitempty" doc:"details for the account"` CPUAvailable string `json:"cpuavailable,omitempty" doc:"the total number of cpu cores available to be created for this account"` CPULimit string `json:"cpulimit,omitempty" doc:"the total number of cpu cores the account can own"` CPUTotal int64 `json:"cputotal,omitempty" doc:"the total number of cpu cores owned by account"` DefaultZoneID *UUID `json:"defaultzoneid,omitempty" doc:"the default zone of the account"` EipLimit string `json:"eiplimit,omitempty" doc:"the total number of public elastic ip addresses this account can acquire"` Groups []string `json:"groups,omitempty" doc:"the list of acl groups that account belongs to"` ID *UUID `json:"id,omitempty" doc:"the id of the account"` IPAvailable string `json:"ipavailable,omitempty" doc:"the total number of public ip addresses available for this account to acquire"` IPLimit string `json:"iplimit,omitempty" doc:"the total number of public ip addresses this account can acquire"` IPTotal int64 `json:"iptotal,omitempty" doc:"the total number of public ip addresses allocated for this account"` IsCleanupRequired bool `json:"iscleanuprequired,omitempty" doc:"true if the account requires cleanup"` IsDefault bool `json:"isdefault,omitempty" doc:"true if account is default, false otherwise"` MemoryAvailable string `json:"memoryavailable,omitempty" doc:"the total memory (in MB) available to be created for this account"` MemoryLimit string `json:"memorylimit,omitempty" doc:"the total memory (in MB) the account can own"` MemoryTotal int64 `json:"memorytotal,omitempty" doc:"the total memory (in MB) owned by account"` Name string `json:"name,omitempty" doc:"the name of the account"` NetworkAvailable string `json:"networkavailable,omitempty" doc:"the total number of networks available to be created for this account"` NetworkDomain string `json:"networkdomain,omitempty" doc:"the network domain"` NetworkLimit string `json:"networklimit,omitempty" doc:"the total number of networks the account can own"` NetworkTotal int64 `json:"networktotal,omitempty" doc:"the total number of networks owned by account"` PrimaryStorageAvailable string `json:"primarystorageavailable,omitempty" doc:"the total primary storage space (in GiB) available to be used for this account"` PrimaryStorageLimit string `json:"primarystoragelimit,omitempty" doc:"the total primary storage space (in GiB) the account can own"` PrimaryStorageTotal int64 `json:"primarystoragetotal,omitempty" doc:"the total primary storage space (in GiB) owned by account"` ProjectAvailable string `json:"projectavailable,omitempty" doc:"the total number of projects available for administration by this account"` ProjectLimit string `json:"projectlimit,omitempty" doc:"the total number of projects the account can own"` ProjectTotal int64 `json:"projecttotal,omitempty" doc:"the total number of projects being administrated by this account"` SecondaryStorageAvailable string `json:"secondarystorageavailable,omitempty" doc:"the total secondary storage space (in GiB) available to be used for this account"` SecondaryStorageLimit string `json:"secondarystoragelimit,omitempty" doc:"the total secondary storage space (in GiB) the account can own"` SecondaryStorageTotal int64 `json:"secondarystoragetotal,omitempty" doc:"the total secondary storage space (in GiB) owned by account"` SMTP bool `json:"smtp,omitempty" doc:"if SMTP outbound is allowed"` SnapshotAvailable string `json:"snapshotavailable,omitempty" doc:"the total number of snapshots available for this account"` SnapshotLimit string `json:"snapshotlimit,omitempty" doc:"the total number of snapshots which can be stored by this account"` SnapshotTotal int64 `json:"snapshottotal,omitempty" doc:"the total number of snapshots stored by this account"` State string `json:"state,omitempty" doc:"the state of the account"` TemplateAvailable string `json:"templateavailable,omitempty" doc:"the total number of templates available to be created by this account"` TemplateLimit string `json:"templatelimit,omitempty" doc:"the total number of templates which can be created by this account"` TemplateTotal int64 `json:"templatetotal,omitempty" doc:"the total number of templates which have been created by this account"` User []User `json:"user,omitempty" doc:"the list of users associated with account"` VMAvailable string `json:"vmavailable,omitempty" doc:"the total number of virtual machines available for this account to acquire"` VMLimit string `json:"vmlimit,omitempty" doc:"the total number of virtual machines that can be deployed by this account"` VMRunning int `json:"vmrunning,omitempty" doc:"the total number of virtual machines running for this account"` VMStopped int `json:"vmstopped,omitempty" doc:"the total number of virtual machines stopped for this account"` VMTotal int64 `json:"vmtotal,omitempty" doc:"the total number of virtual machines deployed by this account"` VolumeAvailable string `json:"volumeavailable,omitempty" doc:"the total volume available for this account"` VolumeLimit string `json:"volumelimit,omitempty" doc:"the total volume which can be used by this account"` VolumeTotal int64 `json:"volumetotal,omitempty" doc:"the total volume being used by this account"` } // ListRequest builds the ListAccountsGroups request func (a Account) ListRequest() (ListCommand, error) { return &ListAccounts{ ID: a.ID, State: a.State, }, nil } //go:generate go run generate/main.go -interface=Listable ListAccounts // ListAccounts represents a query to display the accounts type ListAccounts struct { ID *UUID `json:"id,omitempty" doc:"List account by account ID"` IsCleanUpRequired *bool `json:"iscleanuprequired,omitempty" doc:"list accounts by cleanuprequired attribute (values are true or false)"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"List account by account name"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` State string `json:"state,omitempty" doc:"List accounts by state. Valid states are enabled, disabled, and locked."` _ bool `name:"listAccounts" description:"Lists accounts and provides detailed account information for listed accounts"` } // ListAccountsResponse represents a list of accounts type ListAccountsResponse struct { Count int `json:"count"` Account []Account `json:"account"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/accounts_response.go���������������������������0000664�0000000�0000000�00000001713�13771713062�0026472�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListAccounts) Response() interface{} { return new(ListAccountsResponse) } // ListRequest returns itself func (ls *ListAccounts) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListAccounts) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListAccounts) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListAccounts) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListAccountsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListAccountsResponse was expected, got %T", resp)) return } for i := range items.Account { if !callback(&items.Account[i], nil) { break } } } �����������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/addresses.go�����������������������������������0000664�0000000�0000000�00000027747�13771713062�0024731�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "fmt" "net" ) // Healthcheck represents an Healthcheck attached to an IP type Healthcheck struct { Interval int64 `json:"interval,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 10, minimum: 5"` Mode string `json:"mode,omitempty" doc:"healthcheck definition: healthcheck mode can be either 'tcp' or 'http'"` Path string `json:"path,omitempty" doc:"healthcheck definition: the path against which the 'http' healthcheck will be performed. Required if mode is 'http', ignored otherwise."` Port int64 `json:"port,omitempty" doc:"healthcheck definition: the port against which the healthcheck will be performed. Required if a 'mode' is provided."` StrikesFail int64 `json:"strikes-fail,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'dead'. Default: 3"` StrikesOk int64 `json:"strikes-ok,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'alive'. Default: 2"` Timeout int64 `json:"timeout,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 2, cannot be greater than interval."` } // IPAddress represents an IP Address type IPAddress struct { Allocated string `json:"allocated,omitempty" doc:"date the public IP address was acquired"` Associated string `json:"associated,omitempty" doc:"date the public IP address was associated"` AssociatedNetworkID *UUID `json:"associatednetworkid,omitempty" doc:"the ID of the Network associated with the IP address"` AssociatedNetworkName string `json:"associatednetworkname,omitempty" doc:"the name of the Network associated with the IP address"` ForVirtualNetwork bool `json:"forvirtualnetwork,omitempty" doc:"the virtual network for the IP address"` Healthcheck *Healthcheck `json:"healthcheck,omitempty" doc:"The IP healthcheck configuration"` ID *UUID `json:"id,omitempty" doc:"public IP address id"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"public IP address"` IsElastic bool `json:"iselastic,omitempty" doc:"is an elastic ip"` IsPortable bool `json:"isportable,omitempty" doc:"is public IP portable across the zones"` IsSourceNat bool `json:"issourcenat,omitempty" doc:"true if the IP address is a source nat address, false otherwise"` IsStaticNat *bool `json:"isstaticnat,omitempty" doc:"true if this ip is for static nat, false otherwise"` IsSystem bool `json:"issystem,omitempty" doc:"true if this ip is system ip (was allocated as a part of deployVm or createLbRule)"` NetworkID *UUID `json:"networkid,omitempty" doc:"the ID of the Network where ip belongs to"` PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"the physical network this belongs to"` Purpose string `json:"purpose,omitempty" doc:"purpose of the IP address. In Acton this value is not null for Ips with isSystem=true, and can have either StaticNat or LB value"` ReverseDNS []ReverseDNS `json:"reversedns,omitempty" doc:"the list of PTR record(s) associated with the ip address"` State string `json:"state,omitempty" doc:"State of the ip address. Can be: Allocatin, Allocated and Releasing"` Tags []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with ip address"` VirtualMachineDisplayName string `json:"virtualmachinedisplayname,omitempty" doc:"virtual machine display name the ip address is assigned to (not null only for static nat Ip)"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"virtual machine id the ip address is assigned to (not null only for static nat Ip)"` VirtualMachineName string `json:"virtualmachinename,omitempty" doc:"virtual machine name the ip address is assigned to (not null only for static nat Ip)"` VlanID *UUID `json:"vlanid,omitempty" doc:"the ID of the VLAN associated with the IP address. This parameter is visible to ROOT admins only"` VlanName string `json:"vlanname,omitempty" doc:"the VLAN associated with the IP address"` VMIPAddress net.IP `json:"vmipaddress,omitempty" doc:"virtual machine (dnat) ip address (not null only for static nat Ip)"` ZoneID *UUID `json:"zoneid,omitempty" doc:"the ID of the zone the public IP address belongs to"` ZoneName string `json:"zonename,omitempty" doc:"the name of the zone the public IP address belongs to"` } // ResourceType returns the type of the resource func (IPAddress) ResourceType() string { return "PublicIpAddress" } // ListRequest builds the ListAdresses request func (ipaddress IPAddress) ListRequest() (ListCommand, error) { req := &ListPublicIPAddresses{ AssociatedNetworkID: ipaddress.AssociatedNetworkID, ID: ipaddress.ID, IPAddress: ipaddress.IPAddress, PhysicalNetworkID: ipaddress.PhysicalNetworkID, VlanID: ipaddress.VlanID, ZoneID: ipaddress.ZoneID, } if ipaddress.IsElastic { req.IsElastic = &ipaddress.IsElastic } if ipaddress.IsSourceNat { req.IsSourceNat = &ipaddress.IsSourceNat } if ipaddress.ForVirtualNetwork { req.ForVirtualNetwork = &ipaddress.ForVirtualNetwork } return req, nil } // Delete removes the resource func (ipaddress IPAddress) Delete(ctx context.Context, client *Client) error { if ipaddress.ID == nil { return fmt.Errorf("an IPAddress may only be deleted using ID") } return client.BooleanRequestWithContext(ctx, &DisassociateIPAddress{ ID: ipaddress.ID, }) } // AssociateIPAddress (Async) represents the IP creation type AssociateIPAddress struct { HealthcheckInterval int64 `json:"interval,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 10, minimum: 5"` HealthcheckMode string `json:"mode,omitempty" doc:"healthcheck definition: healthcheck mode can be either 'tcp' or 'http'"` HealthcheckPath string `json:"path,omitempty" doc:"healthcheck definition: the path against which the 'http' healthcheck will be performed. Required if mode is 'http', ignored otherwise."` HealthcheckPort int64 `json:"port,omitempty" doc:"healthcheck definition: the port against which the healthcheck will be performed. Required if a 'mode' is provided."` HealthcheckStrikesFail int64 `json:"strikes-fail,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'dead'. Default: 3"` HealthcheckStrikesOk int64 `json:"strikes-ok,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'alive'. Default: 2"` HealthcheckTimeout int64 `json:"timeout,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 2, cannot be greater than interval."` ZoneID *UUID `json:"zoneid,omitempty" doc:"the ID of the availability zone you want to acquire a public IP address from"` _ bool `name:"associateIpAddress" description:"Acquires and associates a public IP to an account."` } // Response returns the struct to unmarshal func (AssociateIPAddress) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (AssociateIPAddress) AsyncResponse() interface{} { return new(IPAddress) } // DisassociateIPAddress (Async) represents the IP deletion type DisassociateIPAddress struct { ID *UUID `json:"id" doc:"the id of the public ip address to disassociate"` _ bool `name:"disassociateIpAddress" description:"Disassociates an ip address from the account."` } // Response returns the struct to unmarshal func (DisassociateIPAddress) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DisassociateIPAddress) AsyncResponse() interface{} { return new(BooleanResponse) } // UpdateIPAddress (Async) represents the IP modification type UpdateIPAddress struct { HealthcheckInterval int64 `json:"interval,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 10, minimum: 5"` HealthcheckMode string `json:"mode,omitempty" doc:"healthcheck definition: healthcheck mode can be either 'tcp' or 'http'"` HealthcheckPath string `json:"path,omitempty" doc:"healthcheck definition: the path against which the 'http' healthcheck will be performed. Required if mode is 'http', ignored otherwise."` HealthcheckPort int64 `json:"port,omitempty" doc:"healthcheck definition: the port against which the healthcheck will be performed. Required if a 'mode' is provided."` HealthcheckStrikesFail int64 `json:"strikes-fail,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'dead'. Default: 3"` HealthcheckStrikesOk int64 `json:"strikes-ok,omitempty" doc:"healthcheck definition: number of times to retry before declaring the healthcheck 'alive'. Default: 2"` HealthcheckTimeout int64 `json:"timeout,omitempty" doc:"healthcheck definition: time in seconds to wait for each check. Default: 2, cannot be greater than interval."` ID *UUID `json:"id" doc:"the id of the public IP address to update"` _ bool `name:"updateIpAddress" description:"Updates an IP address"` } // Response returns the struct to unmarshal func (UpdateIPAddress) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (UpdateIPAddress) AsyncResponse() interface{} { return new(IPAddress) } //go:generate go run generate/main.go -interface=Listable ListPublicIPAddresses // ListPublicIPAddresses represents a search for public IP addresses type ListPublicIPAddresses struct { AllocatedOnly *bool `json:"allocatedonly,omitempty" doc:"limits search results to allocated public IP addresses"` AssociatedNetworkID *UUID `json:"associatednetworkid,omitempty" doc:"lists all public IP addresses associated to the network specified"` ForLoadBalancing *bool `json:"forloadbalancing,omitempty" doc:"list only ips used for load balancing"` ForVirtualNetwork *bool `json:"forvirtualnetwork,omitempty" doc:"the virtual network for the IP address"` ID *UUID `json:"id,omitempty" doc:"lists ip address by id"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"lists the specified IP address"` IsElastic *bool `json:"iselastic,omitempty" doc:"list only elastic ip addresses"` IsSourceNat *bool `json:"issourcenat,omitempty" doc:"list only source nat ip addresses"` IsStaticNat *bool `json:"isstaticnat,omitempty" doc:"list only static nat ip addresses"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"lists all public IP addresses by physical network id"` Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"` VlanID *UUID `json:"vlanid,omitempty" doc:"lists all public IP addresses by VLAN ID"` ZoneID *UUID `json:"zoneid,omitempty" doc:"lists all public IP addresses by Zone ID"` _ bool `name:"listPublicIpAddresses" description:"Lists all public ip addresses"` } // ListPublicIPAddressesResponse represents a list of public IP addresses type ListPublicIPAddressesResponse struct { Count int `json:"count"` PublicIPAddress []IPAddress `json:"publicipaddress"` } �������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/affinity_groups.go�����������������������������0000664�0000000�0000000�00000015073�13771713062�0026151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "fmt" "net/url" ) // AffinityGroup represents an (anti-)affinity group // // Affinity and Anti-Affinity groups provide a way to influence where VMs should run. // See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html#affinity-groups type AffinityGroup struct { Account string `json:"account,omitempty" doc:"the account owning the affinity group"` Description string `json:"description,omitempty" doc:"the description of the affinity group"` ID *UUID `json:"id,omitempty" doc:"the ID of the affinity group"` Name string `json:"name,omitempty" doc:"the name of the affinity group"` Type string `json:"type,omitempty" doc:"the type of the affinity group"` VirtualMachineIDs []UUID `json:"virtualmachineIds,omitempty" doc:"virtual machine Ids associated with this affinity group"` } // ListRequest builds the ListAffinityGroups request func (ag AffinityGroup) ListRequest() (ListCommand, error) { return &ListAffinityGroups{ ID: ag.ID, Name: ag.Name, }, nil } // Delete removes the given Affinity Group func (ag AffinityGroup) Delete(ctx context.Context, client *Client) error { if ag.ID == nil && ag.Name == "" { return fmt.Errorf("an Affinity Group may only be deleted using ID or Name") } req := &DeleteAffinityGroup{} if ag.ID != nil { req.ID = ag.ID } else { req.Name = ag.Name } return client.BooleanRequestWithContext(ctx, req) } // AffinityGroupType represent an affinity group type type AffinityGroupType struct { Type string `json:"type,omitempty" doc:"the type of the affinity group"` } // CreateAffinityGroup (Async) represents a new (anti-)affinity group type CreateAffinityGroup struct { Description string `json:"description,omitempty" doc:"Optional description of the affinity group"` Name string `json:"name,omitempty" doc:"Name of the affinity group"` Type string `json:"type" doc:"Type of the affinity group from the available affinity/anti-affinity group types"` _ bool `name:"createAffinityGroup" description:"Creates an affinity/anti-affinity group"` } func (req CreateAffinityGroup) onBeforeSend(params url.Values) error { // Name must be set, but can be empty if req.Name == "" { params.Set("name", "") } return nil } // Response returns the struct to unmarshal func (CreateAffinityGroup) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (CreateAffinityGroup) AsyncResponse() interface{} { return new(AffinityGroup) } // UpdateVMAffinityGroup (Async) represents a modification of a (anti-)affinity group type UpdateVMAffinityGroup struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` AffinityGroupIDs []UUID `json:"affinitygroupids,omitempty" doc:"comma separated list of affinity groups id that are going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter"` AffinityGroupNames []string `json:"affinitygroupnames,omitempty" doc:"comma separated list of affinity groups names that are going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter"` _ bool `name:"updateVMAffinityGroup" description:"Updates the affinity/anti-affinity group associations of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect."` } func (req UpdateVMAffinityGroup) onBeforeSend(params url.Values) error { // Either AffinityGroupIDs or AffinityGroupNames must be set if len(req.AffinityGroupIDs) == 0 && len(req.AffinityGroupNames) == 0 { params.Set("affinitygroupids", "") } return nil } // Response returns the struct to unmarshal func (UpdateVMAffinityGroup) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (UpdateVMAffinityGroup) AsyncResponse() interface{} { return new(VirtualMachine) } // DeleteAffinityGroup (Async) represents an (anti-)affinity group to be deleted type DeleteAffinityGroup struct { ID *UUID `json:"id,omitempty" doc:"The ID of the affinity group. Mutually exclusive with name parameter"` Name string `json:"name,omitempty" doc:"The name of the affinity group. Mutually exclusive with ID parameter"` _ bool `name:"deleteAffinityGroup" description:"Deletes affinity group"` } // Response returns the struct to unmarshal func (DeleteAffinityGroup) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DeleteAffinityGroup) AsyncResponse() interface{} { return new(BooleanResponse) } //go:generate go run generate/main.go -interface=Listable ListAffinityGroups // ListAffinityGroups represents an (anti-)affinity groups search type ListAffinityGroups struct { ID *UUID `json:"id,omitempty" doc:"List the affinity group by the ID provided"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"Lists affinity groups by name"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` Type string `json:"type,omitempty" doc:"Lists affinity groups by type"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"Lists affinity groups by virtual machine ID"` _ bool `name:"listAffinityGroups" description:"Lists affinity groups"` } // ListAffinityGroupsResponse represents a list of (anti-)affinity groups type ListAffinityGroupsResponse struct { Count int `json:"count"` AffinityGroup []AffinityGroup `json:"affinitygroup"` } // ListAffinityGroupTypes represents an (anti-)affinity groups search type ListAffinityGroupTypes struct { Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` _ bool `name:"listAffinityGroupTypes" description:"Lists affinity group types available"` } // Response returns the struct to unmarshal func (ListAffinityGroupTypes) Response() interface{} { return new(ListAffinityGroupTypesResponse) } // ListAffinityGroupTypesResponse represents a list of (anti-)affinity group types type ListAffinityGroupTypesResponse struct { Count int `json:"count"` AffinityGroupType []AffinityGroupType `json:"affinitygrouptype"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/affinitygroups_response.go���������������������0000664�0000000�0000000�00000002007�13771713062�0027721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListAffinityGroups) Response() interface{} { return new(ListAffinityGroupsResponse) } // ListRequest returns itself func (ls *ListAffinityGroups) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListAffinityGroups) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListAffinityGroups) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListAffinityGroups) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListAffinityGroupsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListAffinityGroupsResponse was expected, got %T", resp)) return } for i := range items.AffinityGroup { if !callback(&items.AffinityGroup[i], nil) { break } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/apis.go����������������������������������������0000664�0000000�0000000�00000003322�13771713062�0023667�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // API represents an API service type API struct { Description string `json:"description,omitempty" doc:"description of the api"` IsAsync bool `json:"isasync" doc:"true if api is asynchronous"` Name string `json:"name,omitempty" doc:"the name of the api command"` Related string `json:"related,omitempty" doc:"comma separated related apis"` Since string `json:"since,omitempty" doc:"version of CloudStack the api was introduced in"` Type string `json:"type,omitempty" doc:"response field type"` Params []APIParam `json:"params,omitempty" doc:"the list params the api accepts"` Response []APIField `json:"response,omitempty" doc:"api response fields"` } // APIParam represents an API parameter field type APIParam struct { Description string `json:"description"` Length int64 `json:"length"` Name string `json:"name"` Required bool `json:"required"` Since string `json:"since,omitempty"` Type string `json:"type"` } // APIField represents an API response field type APIField struct { Description string `json:"description"` Name string `json:"name"` Response []APIField `json:"response,omitempty"` Type string `json:"type"` } // ListAPIs represents a query to list the api type ListAPIs struct { Name string `json:"name,omitempty" doc:"API name"` _ bool `name:"listApis" description:"lists all available apis on the server"` } // ListAPIsResponse represents a list of API type ListAPIsResponse struct { Count int `json:"count"` API []API `json:"api"` } // Response returns the struct to unmarshal func (*ListAPIs) Response() interface{} { return new(ListAPIsResponse) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/async_jobs.go����������������������������������0000664�0000000�0000000�00000011126�13771713062�0025066�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "encoding/json" "errors" ) // AsyncJobResult represents an asynchronous job result type AsyncJobResult struct { AccountID *UUID `json:"accountid,omitempty" doc:"the account that executed the async command"` Cmd string `json:"cmd,omitempty" doc:"the async command executed"` Created string `json:"created,omitempty" doc:"the created date of the job"` JobID *UUID `json:"jobid" doc:"extra field for the initial async call"` JobInstanceID *UUID `json:"jobinstanceid,omitempty" doc:"the unique ID of the instance/entity object related to the job"` JobInstanceType string `json:"jobinstancetype,omitempty" doc:"the instance/entity object related to the job"` JobProcStatus int `json:"jobprocstatus,omitempty" doc:"the progress information of the PENDING job"` JobResult *json.RawMessage `json:"jobresult,omitempty" doc:"the result reason"` JobResultCode int `json:"jobresultcode,omitempty" doc:"the result code for the job"` JobResultType string `json:"jobresulttype,omitempty" doc:"the result type"` JobStatus JobStatusType `json:"jobstatus,omitempty" doc:"the current job status-should be 0 for PENDING"` UserID *UUID `json:"userid,omitempty" doc:"the user that executed the async command"` } // DeepCopy create a true copy of the receiver. func (a *AsyncJobResult) DeepCopy() *AsyncJobResult { if a == nil { return nil } return &AsyncJobResult{ AccountID: a.AccountID.DeepCopy(), Cmd: a.Cmd, Created: a.Created, JobID: a.JobID.DeepCopy(), JobInstanceID: a.JobInstanceID.DeepCopy(), JobInstanceType: a.JobInstanceType, JobProcStatus: a.JobProcStatus, JobResult: a.JobResult, JobResultCode: a.JobResultCode, JobResultType: a.JobResultType, JobStatus: a.JobStatus, UserID: a.UserID.DeepCopy(), } } // DeepCopyInto copies the receiver into out. // // In (a) must be non nil. out must be non nil func (a *AsyncJobResult) DeepCopyInto(out *AsyncJobResult) { *out = AsyncJobResult{ AccountID: a.AccountID.DeepCopy(), Cmd: a.Cmd, Created: a.Created, JobID: a.JobID.DeepCopy(), JobInstanceID: a.JobInstanceID.DeepCopy(), JobInstanceType: a.JobInstanceType, JobProcStatus: a.JobProcStatus, JobResult: a.JobResult, JobResultCode: a.JobResultCode, JobResultType: a.JobResultType, JobStatus: a.JobStatus, UserID: a.UserID.DeepCopy(), } } // ListRequest buils the (empty) ListAsyncJobs request func (a AsyncJobResult) ListRequest() (ListCommand, error) { req := &ListAsyncJobs{ StartDate: a.Created, } return req, nil } // Error builds an error message from the result func (a AsyncJobResult) Error() error { r := new(ErrorResponse) if e := json.Unmarshal(*a.JobResult, r); e != nil { return e } return r } // QueryAsyncJobResult represents a query to fetch the status of async job type QueryAsyncJobResult struct { JobID *UUID `json:"jobid" doc:"the ID of the asynchronous job"` _ bool `name:"queryAsyncJobResult" description:"Retrieves the current status of asynchronous job."` } // Response returns the struct to unmarshal func (QueryAsyncJobResult) Response() interface{} { return new(AsyncJobResult) } //go:generate go run generate/main.go -interface=Listable ListAsyncJobs // ListAsyncJobs list the asynchronous jobs type ListAsyncJobs struct { Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` StartDate string `json:"startdate,omitempty" doc:"the start date of the async job"` _ bool `name:"listAsyncJobs" description:"Lists all pending asynchronous jobs for the account."` } // ListAsyncJobsResponse represents a list of job results type ListAsyncJobsResponse struct { Count int `json:"count"` AsyncJob []AsyncJobResult `json:"asyncjobs"` } // Result unmarshals the result of an AsyncJobResult into the given interface func (a AsyncJobResult) Result(i interface{}) error { if a.JobStatus == Failure { return a.Error() } if a.JobStatus == Success { m := map[string]json.RawMessage{} err := json.Unmarshal(*(a.JobResult), &m) if err == nil { if len(m) >= 1 { if _, ok := m["success"]; ok { return json.Unmarshal(*(a.JobResult), i) } // otherwise, pick the first key for k := range m { return json.Unmarshal(m[k], i) } } return errors.New("empty response") } } return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/asyncjobs_response.go��������������������������0000664�0000000�0000000�00000001725�13771713062�0026651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListAsyncJobs) Response() interface{} { return new(ListAsyncJobsResponse) } // ListRequest returns itself func (ls *ListAsyncJobs) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListAsyncJobs) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListAsyncJobs) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListAsyncJobs) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListAsyncJobsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListAsyncJobsResponse was expected, got %T", resp)) return } for i := range items.AsyncJob { if !callback(&items.AsyncJob[i], nil) { break } } } �������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/cidr.go����������������������������������������0000664�0000000�0000000�00000002277�13771713062�0023664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "bytes" "encoding/json" "fmt" "net" ) // CIDR represents a nicely JSON serializable net.IPNet type CIDR struct { net.IPNet } // UnmarshalJSON unmarshals the raw JSON into the MAC address func (cidr *CIDR) UnmarshalJSON(b []byte) error { var s string if err := json.Unmarshal(b, &s); err != nil { return err } c, err := ParseCIDR(s) if err != nil { return err } *cidr = CIDR{c.IPNet} return nil } // MarshalJSON converts the CIDR to a string representation func (cidr CIDR) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf("%q", cidr)), nil } // String returns the string representation of a CIDR func (cidr CIDR) String() string { return cidr.IPNet.String() } // ParseCIDR parses a CIDR from a string func ParseCIDR(s string) (*CIDR, error) { _, net, err := net.ParseCIDR(s) if err != nil { return nil, err } return &CIDR{*net}, nil } // MustParseCIDR forces parseCIDR or panics func MustParseCIDR(s string) *CIDR { cidr, err := ParseCIDR(s) if err != nil { panic(err) } return cidr } // Equal compare two CIDR func (cidr CIDR) Equal(c CIDR) bool { return (cidr.IPNet.IP.Equal(c.IPNet.IP) && bytes.Equal(cidr.IPNet.Mask, c.IPNet.Mask)) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/client.go��������������������������������������0000664�0000000�0000000�00000024366�13771713062�0024224�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "fmt" "io/ioutil" "log" "net/http" "net/http/httputil" "os" "reflect" "runtime" "strings" "time" ) // UserAgent is the "User-Agent" HTTP request header added to outgoing HTTP requests. var UserAgent = fmt.Sprintf("egoscale/%s (%s; %s/%s)", Version, runtime.Version(), runtime.GOOS, runtime.GOARCH) // Taggable represents a resource to which tags can be attached // // This is a helper to fill the resourcetype of a CreateTags call type Taggable interface { // ResourceType is the name of the Taggable type ResourceType() string } // Deletable represents an Interface that can be "Delete" by the client type Deletable interface { // Delete removes the given resource(s) or throws Delete(context context.Context, client *Client) error } // Listable represents an Interface that can be "List" by the client type Listable interface { // ListRequest builds the list command ListRequest() (ListCommand, error) } // Client represents the API client type Client struct { // HTTPClient holds the HTTP client HTTPClient *http.Client // Endpoint is the HTTP URL Endpoint string // APIKey is the API identifier APIKey string // apisecret is the API secret, hence non exposed apiSecret string // PageSize represents the default size for a paginated result PageSize int // Timeout represents the default timeout for the async requests Timeout time.Duration // Expiration representation how long a signed payload may be used Expiration time.Duration // RetryStrategy represents the waiting strategy for polling the async requests RetryStrategy RetryStrategyFunc // Logger contains any log, plug your own Logger *log.Logger } // RetryStrategyFunc represents a how much time to wait between two calls to the API type RetryStrategyFunc func(int64) time.Duration // IterateItemFunc represents the callback to iterate a list of results, if false stops type IterateItemFunc func(interface{}, error) bool // WaitAsyncJobResultFunc represents the callback to wait a results of an async request, if false stops type WaitAsyncJobResultFunc func(*AsyncJobResult, error) bool // NewClient creates an API client with default timeout (60) // // Timeout is set to both the HTTP client and the client itself. func NewClient(endpoint, apiKey, apiSecret string) *Client { timeout := 60 * time.Second expiration := 10 * time.Minute httpClient := &http.Client{ Transport: http.DefaultTransport, } client := &Client{ HTTPClient: httpClient, Endpoint: endpoint, APIKey: apiKey, apiSecret: apiSecret, PageSize: 50, Timeout: timeout, Expiration: expiration, RetryStrategy: MonotonicRetryStrategyFunc(2), Logger: log.New(ioutil.Discard, "", 0), } if prefix, ok := os.LookupEnv("EXOSCALE_TRACE"); ok { client.Logger = log.New(os.Stderr, prefix, log.LstdFlags) client.TraceOn() } return client } // Get populates the given resource or fails func (client *Client) Get(ls Listable) (interface{}, error) { ctx, cancel := context.WithTimeout(context.Background(), client.Timeout) defer cancel() return client.GetWithContext(ctx, ls) } // GetWithContext populates the given resource or fails func (client *Client) GetWithContext(ctx context.Context, ls Listable) (interface{}, error) { gs, err := client.ListWithContext(ctx, ls) if err != nil { return nil, err } count := len(gs) if count != 1 { req, err := ls.ListRequest() if err != nil { return nil, err } params, err := client.Payload(req) if err != nil { return nil, err } // removing sensitive/useless informations params.Del("expires") params.Del("response") params.Del("signature") params.Del("signatureversion") // formatting the query string nicely payload := params.Encode() payload = strings.Replace(payload, "&", ", ", -1) if count == 0 { return nil, &ErrorResponse{ CSErrorCode: ServerAPIException, ErrorCode: ParamError, ErrorText: fmt.Sprintf("not found, query: %s", payload), } } return nil, fmt.Errorf("more than one element found: %s", payload) } return gs[0], nil } // Delete removes the given resource of fails func (client *Client) Delete(g Deletable) error { ctx, cancel := context.WithTimeout(context.Background(), client.Timeout) defer cancel() return client.DeleteWithContext(ctx, g) } // DeleteWithContext removes the given resource of fails func (client *Client) DeleteWithContext(ctx context.Context, g Deletable) error { return g.Delete(ctx, client) } // List lists the given resource (and paginate till the end) func (client *Client) List(g Listable) ([]interface{}, error) { ctx, cancel := context.WithTimeout(context.Background(), client.Timeout) defer cancel() return client.ListWithContext(ctx, g) } // ListWithContext lists the given resources (and paginate till the end) func (client *Client) ListWithContext(ctx context.Context, g Listable) (s []interface{}, err error) { s = make([]interface{}, 0) defer func() { if e := recover(); e != nil { if g == nil || reflect.ValueOf(g).IsNil() { err = fmt.Errorf("g Listable shouldn't be nil, got %#v", g) return } panic(e) } }() req, e := g.ListRequest() if e != nil { err = e return } client.PaginateWithContext(ctx, req, func(item interface{}, e error) bool { if item != nil { s = append(s, item) return true } err = e return false }) return } // AsyncListWithContext lists the given resources (and paginate till the end) // // // // NB: goroutine may leak if not read until the end. Create a proper context! // ctx, cancel := context.WithCancel(context.Background()) // defer cancel() // // outChan, errChan := client.AsyncListWithContext(ctx, new(egoscale.VirtualMachine)) // // for { // select { // case i, ok := <- outChan: // if ok { // vm := i.(egoscale.VirtualMachine) // // ... // } else { // outChan = nil // } // case err, ok := <- errChan: // if ok { // // do something // } // // Once an error has been received, you can expect the channels to be closed. // errChan = nil // } // if errChan == nil && outChan == nil { // break // } // } // func (client *Client) AsyncListWithContext(ctx context.Context, g Listable) (<-chan interface{}, <-chan error) { outChan := make(chan interface{}, client.PageSize) errChan := make(chan error) go func() { defer close(outChan) defer close(errChan) req, err := g.ListRequest() if err != nil { errChan <- err return } client.PaginateWithContext(ctx, req, func(item interface{}, e error) bool { if item != nil { outChan <- item return true } errChan <- e return false }) }() return outChan, errChan } // Paginate runs the ListCommand and paginates func (client *Client) Paginate(g Listable, callback IterateItemFunc) { ctx, cancel := context.WithTimeout(context.Background(), client.Timeout) defer cancel() client.PaginateWithContext(ctx, g, callback) } // PaginateWithContext runs the ListCommand as long as the ctx is valid func (client *Client) PaginateWithContext(ctx context.Context, g Listable, callback IterateItemFunc) { req, err := g.ListRequest() if err != nil { callback(nil, err) return } pageSize := client.PageSize page := 1 for { req.SetPage(page) req.SetPageSize(pageSize) resp, err := client.RequestWithContext(ctx, req) if err != nil { // in case of 431, the response is knowingly empty if errResponse, ok := err.(*ErrorResponse); ok && page == 1 && errResponse.ErrorCode == ParamError { break } callback(nil, err) break } size := 0 didErr := false req.Each(resp, func(element interface{}, err error) bool { // If the context was cancelled, kill it in flight if e := ctx.Err(); e != nil { element = nil err = e } if callback(element, err) { size++ return true } didErr = true return false }) if size < pageSize || didErr { break } page++ } } // APIName returns the name of the given command func (client *Client) APIName(command Command) string { // This is due to a limitation of Go<=1.7 _, ok := command.(*AuthorizeSecurityGroupEgress) _, okPtr := command.(AuthorizeSecurityGroupEgress) if ok || okPtr { return "authorizeSecurityGroupEgress" } info, err := info(command) if err != nil { panic(err) } return info.Name } // APIDescription returns the description of the given command func (client *Client) APIDescription(command Command) string { info, err := info(command) if err != nil { return "*missing description*" } return info.Description } // Response returns the response structure of the given command func (client *Client) Response(command Command) interface{} { switch c := command.(type) { case AsyncCommand: return c.AsyncResponse() default: return command.Response() } } // TraceOn activates the HTTP tracer func (client *Client) TraceOn() { if _, ok := client.HTTPClient.Transport.(*traceTransport); !ok { client.HTTPClient.Transport = &traceTransport{ transport: client.HTTPClient.Transport, logger: client.Logger, } } } // TraceOff deactivates the HTTP tracer func (client *Client) TraceOff() { if rt, ok := client.HTTPClient.Transport.(*traceTransport); ok { client.HTTPClient.Transport = rt.transport } } // traceTransport contains the original HTTP transport to enable it to be reverted type traceTransport struct { transport http.RoundTripper logger *log.Logger } // RoundTrip executes a single HTTP transaction func (t *traceTransport) RoundTrip(req *http.Request) (*http.Response, error) { if dump, err := httputil.DumpRequest(req, true); err == nil { t.logger.Printf("%s", dump) } resp, err := t.transport.RoundTrip(req) if err != nil { return nil, err } if dump, err := httputil.DumpResponse(resp, true); err == nil { t.logger.Printf("%s", dump) } return resp, nil } // MonotonicRetryStrategyFunc returns a function that waits for n seconds for each iteration func MonotonicRetryStrategyFunc(seconds int) RetryStrategyFunc { return func(iteration int64) time.Duration { return time.Duration(seconds) * time.Second } } // FibonacciRetryStrategy waits for an increasing amount of time following the Fibonacci sequence func FibonacciRetryStrategy(iteration int64) time.Duration { var a, b, i, tmp int64 a = 0 b = 1 for i = 0; i < iteration; i++ { tmp = a + b a = b b = tmp } return time.Duration(a) * time.Second } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/cserrorcode_string.go��������������������������0000664�0000000�0000000�00000004173�13771713062�0026640�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "stringer -type CSErrorCode"; DO NOT EDIT. package egoscale import "strconv" const _CSErrorCode_name = "CloudRuntimeExceptionExecutionExceptionHypervisorVersionChangedExceptionCloudExceptionAccountLimitExceptionAgentUnavailableExceptionCloudAuthenticationExceptionConcurrentOperationExceptionConflictingNetworkSettingsExceptionDiscoveredWithErrorExceptionHAStateExceptionInsufficientAddressCapacityExceptionInsufficientCapacityExceptionInsufficientNetworkCapacityExceptionInsufficientServerCapacityExceptionInsufficientStorageCapacityExceptionInternalErrorExceptionInvalidParameterValueExceptionManagementServerExceptionNetworkRuleConflictExceptionPermissionDeniedExceptionResourceAllocationExceptionResourceInUseExceptionResourceUnavailableExceptionStorageUnavailableExceptionUnsupportedServiceExceptionVirtualMachineMigrationExceptionAsyncCommandQueuedRequestLimitExceptionServerAPIException" var _CSErrorCode_map = map[CSErrorCode]string{ 4250: _CSErrorCode_name[0:21], 4260: _CSErrorCode_name[21:39], 4265: _CSErrorCode_name[39:72], 4275: _CSErrorCode_name[72:86], 4280: _CSErrorCode_name[86:107], 4285: _CSErrorCode_name[107:132], 4290: _CSErrorCode_name[132:160], 4300: _CSErrorCode_name[160:188], 4305: _CSErrorCode_name[188:223], 4310: _CSErrorCode_name[223:251], 4315: _CSErrorCode_name[251:267], 4320: _CSErrorCode_name[267:303], 4325: _CSErrorCode_name[303:332], 4330: _CSErrorCode_name[332:368], 4335: _CSErrorCode_name[368:403], 4340: _CSErrorCode_name[403:439], 4345: _CSErrorCode_name[439:461], 4350: _CSErrorCode_name[461:491], 4355: _CSErrorCode_name[491:516], 4360: _CSErrorCode_name[516:544], 4365: _CSErrorCode_name[544:569], 4370: _CSErrorCode_name[569:596], 4375: _CSErrorCode_name[596:618], 4380: _CSErrorCode_name[618:646], 4385: _CSErrorCode_name[646:673], 4390: _CSErrorCode_name[673:700], 4395: _CSErrorCode_name[700:732], 4540: _CSErrorCode_name[732:750], 4545: _CSErrorCode_name[750:771], 9999: _CSErrorCode_name[771:789], } func (i CSErrorCode) String() string { if str, ok := _CSErrorCode_map[i]; ok { return str } return "CSErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/dns.go�����������������������������������������0000664�0000000�0000000�00000021406�13771713062�0023522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "encoding/json" "fmt" "io/ioutil" "net/http" "net/url" "strconv" "strings" ) // DNSDomain represents a domain type DNSDomain struct { ID int64 `json:"id"` Name string `json:"name"` UnicodeName string `json:"unicode_name"` Token string `json:"token"` State string `json:"state"` Language string `json:"language,omitempty"` Lockable bool `json:"lockable"` AutoRenew bool `json:"auto_renew"` WhoisProtected bool `json:"whois_protected"` RecordCount int64 `json:"record_count"` ServiceCount int64 `json:"service_count"` ExpiresOn string `json:"expires_on,omitempty"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` } // DNSDomainResponse represents a domain creation response type DNSDomainResponse struct { Domain *DNSDomain `json:"domain"` } // DNSRecord represents a DNS record type DNSRecord struct { ID int64 `json:"id,omitempty"` DomainID int64 `json:"domain_id,omitempty"` Name string `json:"name"` TTL int `json:"ttl,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Content string `json:"content"` RecordType string `json:"record_type"` Prio int `json:"prio,omitempty"` } // DNSRecordResponse represents the creation of a DNS record type DNSRecordResponse struct { Record DNSRecord `json:"record"` } // UpdateDNSRecord represents a DNS record type UpdateDNSRecord struct { ID int64 `json:"id,omitempty"` DomainID int64 `json:"domain_id,omitempty"` Name string `json:"name,omitempty"` TTL int `json:"ttl,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Content string `json:"content,omitempty"` RecordType string `json:"record_type,omitempty"` Prio int `json:"prio,omitempty"` } // UpdateDNSRecordResponse represents the creation of a DNS record type UpdateDNSRecordResponse struct { Record UpdateDNSRecord `json:"record"` } // DNSErrorResponse represents an error in the API type DNSErrorResponse struct { Message string `json:"message,omitempty"` Errors map[string][]string `json:"errors"` } // Record represent record type type Record int //go:generate stringer -type=Record const ( // A record type A Record = iota // AAAA record type AAAA // ALIAS record type ALIAS // CNAME record type CNAME // HINFO record type HINFO // MX record type MX // NAPTR record type NAPTR // NS record type NS // POOL record type POOL // SPF record type SPF // SRV record type SRV // SSHFP record type SSHFP // TXT record type TXT // URL record type URL ) // Error formats the DNSerror into a string func (req *DNSErrorResponse) Error() string { if len(req.Errors) > 0 { errs := []string{} for name, ss := range req.Errors { if len(ss) > 0 { errs = append(errs, fmt.Sprintf("%s: %s", name, strings.Join(ss, ", "))) } } return fmt.Sprintf("dns error: %s (%s)", req.Message, strings.Join(errs, "; ")) } return fmt.Sprintf("dns error: %s", req.Message) } // CreateDomain creates a DNS domain func (client *Client) CreateDomain(ctx context.Context, name string) (*DNSDomain, error) { m, err := json.Marshal(DNSDomainResponse{ Domain: &DNSDomain{ Name: name, }, }) if err != nil { return nil, err } resp, err := client.dnsRequest(ctx, "/v1/domains", nil, string(m), "POST") if err != nil { return nil, err } var d *DNSDomainResponse if err := json.Unmarshal(resp, &d); err != nil { return nil, err } return d.Domain, nil } // GetDomain gets a DNS domain func (client *Client) GetDomain(ctx context.Context, name string) (*DNSDomain, error) { resp, err := client.dnsRequest(ctx, "/v1/domains/"+name, nil, "", "GET") if err != nil { return nil, err } var d *DNSDomainResponse if err := json.Unmarshal(resp, &d); err != nil { return nil, err } return d.Domain, nil } // GetDomains gets DNS domains func (client *Client) GetDomains(ctx context.Context) ([]DNSDomain, error) { resp, err := client.dnsRequest(ctx, "/v1/domains", nil, "", "GET") if err != nil { return nil, err } var d []DNSDomainResponse if err := json.Unmarshal(resp, &d); err != nil { return nil, err } domains := make([]DNSDomain, len(d)) for i := range d { domains[i] = *d[i].Domain } return domains, nil } // DeleteDomain delets a DNS domain func (client *Client) DeleteDomain(ctx context.Context, name string) error { _, err := client.dnsRequest(ctx, "/v1/domains/"+name, nil, "", "DELETE") return err } // GetRecord returns a DNS record func (client *Client) GetRecord(ctx context.Context, domain string, recordID int64) (*DNSRecord, error) { id := strconv.FormatInt(recordID, 10) resp, err := client.dnsRequest(ctx, "/v1/domains/"+domain+"/records/"+id, nil, "", "GET") if err != nil { return nil, err } var r DNSRecordResponse if err = json.Unmarshal(resp, &r); err != nil { return nil, err } return &(r.Record), nil } // GetRecords returns the DNS records func (client *Client) GetRecords(ctx context.Context, domain string) ([]DNSRecord, error) { resp, err := client.dnsRequest(ctx, "/v1/domains/"+domain+"/records", nil, "", "GET") if err != nil { return nil, err } var r []DNSRecordResponse if err = json.Unmarshal(resp, &r); err != nil { return nil, err } records := make([]DNSRecord, 0, len(r)) for _, rec := range r { records = append(records, rec.Record) } return records, nil } // GetRecordsWithFilters returns the DNS records (filters can be empty) func (client *Client) GetRecordsWithFilters(ctx context.Context, domain, name, recordType string) ([]DNSRecord, error) { filters := url.Values{} if name != "" { filters.Add("name", name) } if recordType != "" { filters.Add("record_type", recordType) } resp, err := client.dnsRequest(ctx, "/v1/domains/"+domain+"/records", filters, "", "GET") if err != nil { return nil, err } var r []DNSRecordResponse if err = json.Unmarshal(resp, &r); err != nil { return nil, err } records := make([]DNSRecord, 0, len(r)) for _, rec := range r { records = append(records, rec.Record) } return records, nil } // CreateRecord creates a DNS record func (client *Client) CreateRecord(ctx context.Context, name string, rec DNSRecord) (*DNSRecord, error) { body, err := json.Marshal(DNSRecordResponse{ Record: rec, }) if err != nil { return nil, err } resp, err := client.dnsRequest(ctx, "/v1/domains/"+name+"/records", nil, string(body), "POST") if err != nil { return nil, err } var r DNSRecordResponse if err = json.Unmarshal(resp, &r); err != nil { return nil, err } return &(r.Record), nil } // UpdateRecord updates a DNS record func (client *Client) UpdateRecord(ctx context.Context, name string, rec UpdateDNSRecord) (*DNSRecord, error) { body, err := json.Marshal(UpdateDNSRecordResponse{ Record: rec, }) if err != nil { return nil, err } id := strconv.FormatInt(rec.ID, 10) resp, err := client.dnsRequest(ctx, "/v1/domains/"+name+"/records/"+id, nil, string(body), "PUT") if err != nil { return nil, err } var r DNSRecordResponse if err = json.Unmarshal(resp, &r); err != nil { return nil, err } return &(r.Record), nil } // DeleteRecord deletes a record func (client *Client) DeleteRecord(ctx context.Context, name string, recordID int64) error { id := strconv.FormatInt(recordID, 10) _, err := client.dnsRequest(ctx, "/v1/domains/"+name+"/records/"+id, nil, "", "DELETE") return err } func (client *Client) dnsRequest(ctx context.Context, uri string, urlValues url.Values, params, method string) (json.RawMessage, error) { rawURL := client.Endpoint + uri url, err := url.Parse(rawURL) if err != nil { return nil, err } q := url.Query() for k, vs := range urlValues { for _, v := range vs { q.Add(k, v) } } url.RawQuery = q.Encode() req, err := http.NewRequest(method, url.String(), strings.NewReader(params)) if err != nil { return nil, err } var hdr = make(http.Header) hdr.Add("X-DNS-TOKEN", client.APIKey+":"+client.apiSecret) hdr.Add("User-Agent", UserAgent) hdr.Add("Accept", "application/json") if params != "" { hdr.Add("Content-Type", "application/json") } req.Header = hdr resp, err := client.HTTPClient.Do(req.WithContext(ctx)) if err != nil { return nil, err } defer resp.Body.Close() // nolint: errcheck contentType := resp.Header.Get("content-type") if !strings.Contains(contentType, "application/json") { return nil, fmt.Errorf(`response content-type expected to be "application/json", got %q`, contentType) } b, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, err } if resp.StatusCode >= 400 { e := new(DNSErrorResponse) if err := json.Unmarshal(b, e); err != nil { return nil, err } return nil, e } return b, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/doc.go�����������������������������������������0000664�0000000�0000000�00000012541�13771713062�0023503�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package egoscale is a mapping for the Exoscale API (https://community.exoscale.com/api/compute/). Requests and Responses To build a request, construct the adequate struct. This library expects a pointer for efficiency reasons only. The response is a struct corresponding to the data at stake. E.g. DeployVirtualMachine gives a VirtualMachine, as a pointer as well to avoid big copies. Then everything within the struct is not a pointer. Find below some examples of how egoscale may be used. If anything feels odd or unclear, please let us know: https://github.com/exoscale/egoscale/issues req := &egoscale.DeployVirtualMachine{ Size: 10, ServiceOfferingID: egoscale.MustParseUUID("..."), TemplateID: egoscale.MustParseUUID("..."), ZoneID: egoscale.MastParseUUID("..."), } fmt.Println("Deployment started") resp, err := cs.Request(req) if err != nil { panic(err) } vm := resp.(*egoscale.VirtualMachine) fmt.Printf("Virtual Machine ID: %s\n", vm.ID) This example deploys a virtual machine while controlling the job status as it goes. It enables a finer control over errors, e.g. HTTP timeout, and eventually a way to kill it of (from the client side). req := &egoscale.DeployVirtualMachine{ Size: 10, ServiceOfferingID: egoscale.MustParseUUID("..."), TemplateID: egoscale.MustParseUUID("..."), ZoneID: egoscale.MustParseUUID("..."), } vm := &egoscale.VirtualMachine{} fmt.Println("Deployment started") cs.AsyncRequest(req, func(jobResult *egoscale.AsyncJobResult, err error) bool { if err != nil { // any kind of error panic(err) } // Keep waiting if jobResult.JobStatus == egoscale.Pending { fmt.Println("wait...") return true } // Unmarshal the response into the response struct if err := jobResult.Response(vm); err != nil { // JSON unmarshaling error panic(err) } // Stop waiting return false }) fmt.Printf("Virtual Machine ID: %s\n", vm.ID) Debugging and traces As this library is mostly an HTTP client, you can reuse all the existing tools around it. cs := egoscale.NewClient("https://api.exoscale.com/compute", "EXO...", "...") // sets a logger on stderr cs.Logger = log.New(os.Stderr, "prefix", log.LstdFlags) // activates the HTTP traces cs.TraceOn() Nota bene: when running the tests or the egoscale library via another tool, e.g. the exo cli, the environment variable EXOSCALE_TRACE=prefix does the above configuration for you. As a developer using egoscale as a library, you'll find it more convenient to plug your favorite io.Writer as it's a Logger. APIs All the available APIs on the server and provided by the API Discovery plugin. cs := egoscale.NewClient("https://api.exoscale.com/compute", "EXO...", "...") resp, err := cs.Request(&egoscale.ListAPIs{}) if err != nil { panic(err) } for _, api := range resp.(*egoscale.ListAPIsResponse).API { fmt.Printf("%s %s\n", api.Name, api.Description) } // Output: // listNetworks Lists all available networks // ... Security Groups Security Groups provide a way to isolate traffic to VMs. Rules are added via the two Authorization commands. resp, err := cs.Request(&egoscale.CreateSecurityGroup{ Name: "Load balancer", Description: "Open HTTP/HTTPS ports from the outside world", }) securityGroup := resp.(*egoscale.SecurityGroup) resp, err = cs.Request(&egoscale.AuthorizeSecurityGroupIngress{ Description: "SSH traffic", SecurityGroupID: securityGroup.ID, CidrList: []CIDR{ *egoscale.MustParseCIDR("0.0.0.0/0"), *egoscale.MustParseCIDR("::/0"), }, Protocol: "tcp", StartPort: 22, EndPort: 22, }) // The modified SecurityGroup is returned securityGroup := resp.(*egoscale.SecurityGroup) // ... err = client.BooleanRequest(&egoscale.DeleteSecurityGroup{ ID: securityGroup.ID, }) // ... Security Group also implement the generic List, Get and Delete interfaces (Listable and Deletable). // List all Security Groups sgs, _ := cs.List(&egoscale.SecurityGroup{}) for _, s := range sgs { sg := s.(egoscale.SecurityGroup) // ... } // Get a Security Group sgQuery := &egoscale.SecurityGroup{Name: "Load balancer"} resp, err := cs.Get(sgQuery); err != nil { ... } sg := resp.(*egoscale.SecurityGroup) if err := cs.Delete(sg); err != nil { ... } // The SecurityGroup has been deleted See: https://community.exoscale.com/documentation/compute/security-groups/ Zones A Zone corresponds to a Data Center. You may list them. Zone implements the Listable interface, which let you perform a list in two different ways. The first exposes the underlying request while the second one hide them and you only manipulate the structs of your interest. // Using ListZones request req := &egoscale.ListZones{} resp, err := client.Request(req) if err != nil { panic(err) } for _, zone := range resp.(*egoscale.ListZonesResponse) { ... } // Using client.List zone := &egoscale.Zone{} zones, err := client.List(zone) if err != nil { panic(err) } for _, z := range zones { zone := z.(egoscale.Zone) ... } Elastic IPs An Elastic IP is a way to attach an IP address to many Virtual Machines. The API side of the story configures the external environment, like the routing. Some work is required within the machine to properly configure the interfaces. See: https://community.exoscale.com/documentation/compute/eip/ */ package egoscale ���������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/errorcode_string.go����������������������������0000664�0000000�0000000�00000002114�13771713062�0026303�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "stringer -type ErrorCode"; DO NOT EDIT. package egoscale import "strconv" const ( _ErrorCode_name_0 = "Unauthorized" _ErrorCode_name_1 = "MethodNotAllowed" _ErrorCode_name_2 = "UnsupportedActionError" _ErrorCode_name_3 = "APILimitExceededMalformedParameterErrorParamError" _ErrorCode_name_4 = "InternalErrorAccountErrorAccountResourceLimitErrorInsufficientCapacityErrorResourceUnavailableErrorResourceAllocationErrorResourceInUseErrorNetworkRuleConflictError" ) var ( _ErrorCode_index_3 = [...]uint8{0, 16, 39, 49} _ErrorCode_index_4 = [...]uint8{0, 13, 25, 50, 75, 99, 122, 140, 164} ) func (i ErrorCode) String() string { switch { case i == 401: return _ErrorCode_name_0 case i == 405: return _ErrorCode_name_1 case i == 422: return _ErrorCode_name_2 case 429 <= i && i <= 431: i -= 429 return _ErrorCode_name_3[_ErrorCode_index_3[i]:_ErrorCode_index_3[i+1]] case 530 <= i && i <= 537: i -= 530 return _ErrorCode_name_4[_ErrorCode_index_4[i]:_ErrorCode_index_4[i+1]] default: return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/events.go��������������������������������������0000664�0000000�0000000�00000006516�13771713062�0024247�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // Event represents an event in the system type Event struct { Account string `json:"account,omitempty" doc:"the account name for the account that owns the object being acted on in the event (e.g. the owner of the virtual machine, ip address, or security group)"` Created string `json:"created,omitempty" doc:"the date the event was created"` Description string `json:"description,omitempty" doc:"a brief description of the event"` ID *UUID `json:"id" doc:"the ID of the event"` Level string `json:"level,omitempty" doc:"the event level (INFO, WARN, ERROR)"` ParentID *UUID `json:"parentid,omitempty" doc:"whether the event is parented"` State string `json:"state,omitempty" doc:"the state of the event"` Type string `json:"type,omitempty" doc:"the type of the event (see event types)"` UserName string `json:"username,omitempty" doc:"the name of the user who performed the action (can be different from the account if an admin is performing an action for a user, e.g. starting/stopping a user's virtual machine)"` } // ListRequest builds the ListEvents request func (event Event) ListRequest() (ListCommand, error) { req := &ListEvents{ ID: event.ID, Level: event.Level, Type: event.Type, } return req, nil } // EventType represent a type of event type EventType struct { Name string `json:"name,omitempty" doc:"Event Type"` } // ListRequest builds the ListEventTypes request func (EventType) ListRequest() (ListCommand, error) { req := &ListEventTypes{} return req, nil } //go:generate go run generate/main.go -interface=Listable ListEvents // ListEvents list the events type ListEvents struct { Duration int `json:"duration,omitempty" doc:"the duration of the event"` EndDate string `json:"enddate,omitempty" doc:"the end date range of the list you want to retrieve (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-dd HH:mm:ss\")"` EntryTime int `json:"entrytime,omitempty" doc:"the time the event was entered"` ID *UUID `json:"id,omitempty" doc:"the ID of the event"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Level string `json:"level,omitempty" doc:"the event level (INFO, WARN, ERROR)"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` StartDate string `json:"startdate,omitempty" doc:"the start date range of the list you want to retrieve (use format \"yyyy-MM-dd\" or the new format \"yyyy-MM-dd HH:mm:ss\")"` Type string `json:"type,omitempty" doc:"the event type (see event types)"` _ bool `name:"listEvents" description:"A command to list events."` } // ListEventsResponse represents a response of a list query type ListEventsResponse struct { Count int `json:"count"` Event []Event `json:"event"` } //go:generate go run generate/main.go -interface=Listable ListEventTypes // ListEventTypes list the event types type ListEventTypes struct { Page int `json:"page,omitempty"` // fake PageSize int `json:"pagesize,omitempty"` // fake _ bool `name:"listEventTypes" description:"List Event Types"` } // ListEventTypesResponse represents a response of a list query type ListEventTypesResponse struct { Count int `json:"count"` EventType []EventType `json:"eventtype"` _ bool `name:"listEventTypes" description:"List Event Types"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/events_response.go�����������������������������0000664�0000000�0000000�00000001667�13771713062�0026167�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListEvents) Response() interface{} { return new(ListEventsResponse) } // ListRequest returns itself func (ls *ListEvents) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListEvents) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListEvents) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListEvents) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListEventsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListEventsResponse was expected, got %T", resp)) return } for i := range items.Event { if !callback(&items.Event[i], nil) { break } } } �������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/eventtypes_response.go�������������������������0000664�0000000�0000000�00000001737�13771713062�0027067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListEventTypes) Response() interface{} { return new(ListEventTypesResponse) } // ListRequest returns itself func (ls *ListEventTypes) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListEventTypes) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListEventTypes) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListEventTypes) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListEventTypesResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListEventTypesResponse was expected, got %T", resp)) return } for i := range items.EventType { if !callback(&items.EventType[i], nil) { break } } } ���������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/go.mod�����������������������������������������0000664�0000000�0000000�00000000127�13771713062�0023512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/exoscale/egoscale require github.com/gofrs/uuid v3.2.0+incompatible �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/go.sum�����������������������������������������0000664�0000000�0000000�00000000273�13771713062�0023541�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/gopher.png�������������������������������������0000664�0000000�0000000�00000173131�13771713062�0024404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������PNG  ��� IHDR�������j;���bKGD������ pHYs�� �� ����tIME 8&h|�� �IDATxwxe?3Cc (X"]u]O]uW]]ˮ*A )H :c.$yy3m3==9                                                                        ')A8}0 �mr rA� v S% -l0o,9e <b^{2M& -+QJ9 p.PwA敗m_}ƫc )QANu^OG kuq#ݢ[Pp6&9pxV{GfJ <񱱠Z1 ˂+' ()�A8.$ޡ( ]t!:u+xw֍\tGV)UAWہe?-d6�5.L, rjA ]j93.ՠvvM=(UtA8~$w:s& p)ֱC8 9 !c $>>338s,ٟ .LJ.(A>_t!9H&A <c4fX>GrAA:zv$Ըw ޫ`d," 4@|< Az4~v{@jAA8;xG "~.zVDjAAf2doQv=MらB*ZDAh>bSV9+gɩtAuLcĸXzgwޝtA;ƲCn.==&&::trAAl6|Lү{PIfΔS." 4=YU4LONU۵+v-9 .Bӓ,23,k(t]bZD  .B z&D2RCrA]%9XгRӎ]4UA]c'!XS- �>_B-*]N дHIh"AַO#iUN tԫ4.w]m22R  M9t6`6'MN 4XC z3ڭ@G^E_F z 2M V/{QI 114w? .1b z]5vWR 0W p B zStP_we5Jf\ AAV5JS>~ܽ�ur5A]c[uj&~~-w4U۰Ω#WCDA8Je6Zq]! wӮg*qr)A]&-S~~PN^^n$}\AAуMn7w=D&_,X33UuʥyA|~z2Ը=ay^^Î=ErIA,tAҎ#>f3DGx N:]/Yqz{=�VA]u-t̠4Bhk6+xŌl&KVO뚖ȓwekM[,<>\A8Y,A$`0/Nvvt #9& UQP]5^/9lܺ֯K( a1Ѭ=LX!r`\AA82:;1TUխaVEokjo]e?A׷nGCseA#?G*GM=e^wio\klG@\Ah]ˀ7v23ng҄Ӡnm;v)/uc%tA#8AbQ#f2OKSV&wqc8eH#h "KfƜϿ>L .B| Q{G{O<FVj*US}(.+�UUۉ!-)Y$tKi_E[K.We,L4`D[gU+ȱt5KϺvfIVb`\.Ah[:tAho;{gw[fBݘe%" π[<x<'igMTddA@\2AA>gu=~tn|ws zI >bNK&" 3?tbpqHd .B~TG5;dd';3)cԓy\6AA.LYt:cA$�qrA]Cc* Q#': DGbA]NvTBoitjW[DʥtA%B z t]')w X  H xYPt,U .ҏ*Eo)Pr>t .BX$E|{ʊ " BG/cV&BA ± RtJ+hy*vև ˆw #V ! X@P*/ 8 \߷ t}\|j%`;-hO=yہZ`> .-t9yX0lߓ@Gج[ZWy}AA:jlܶ (x=^K.O Fsv` Ll� ׁ/0r{  / /;w:V+|aOyO?SUd4M n\`󁯀2Z~AA;r%o^ғS-0r<ˬڼF+bb t $Cb28cdjL+躱V] 0rwžm3ɯ3` tAh&/@;v3/YݯinCyv5~ͿߚSWd4àk/،ԵG(GQ![Q灵+`"X-�hý9c_1$b^j A8vL\?sϟn(G(:+,dW^m pxކ8~E;[H3P^˂WKټf3-V]?5?Ay$!2KDnAA]` sƼԘ8fXuqj^ˮ<v[V/8Y3.Oni~ȣ<4}1E1M& Aߵ~ ?1\G��O!rtA8εw.C.ֺ~6mʒXf-躎hZ㫶0MN$+~gLxo>4UP۱i~ƿ`F # .Qa�n\Ĭ/ rew^>srض'_v$?TUUғѿ? UU(o̘Kfh:O9o>*5uFMf Kg wT;ۀo"/" `~ul6e$'sƘќ2t }ǎܷ+fݏ>]z:O۷ qu"PV,4,aKg7DA8"1=ӓ~\xtБvhXcو?Ҋ33zNr/V#x {^|pS`0#լ YLr IL<Gd㌌$9> #sˌy̾VN3̤$6+&-j囥ic@jigYUå7@Uw]T B051.xRIML"#%dwhOС7QXE$WgwT|o.goGJȦ( [6 FoĘDAHQ:�Gҿ{wK3$ғIKJ$:2͊n'n'bL!44^#_,\Tg·dLV$SHahC}n}r+ "p`Xc05HLt4?|="< <Ӂkﹷ[. ; L&fkFƻh45QBHb(5pUc?ފf 7Վ,xGzv'>&9b~#sᾧ[�bԁtAhCwaT yNm?SF&2+()%zj0ǂλ>̺,a˽X>MnA]Z?݀O :0I$D8?BǮZvƨ<tAh}1\雁125h qн Lӧ赱Zi 'yinя+>_nDnjR=tA]Z> {A BxkcT_ LjǎM̬}D~A}v+i5p_Z/]EhMH=tdl 1 3W68q|Ű|u}ݾirӫW/L&Z#Cq�hzۼ|^;�7<P`{tA,tAh؀IE| ) 9?/!++`gN8-~�ݲK]um] ~'x HH<1nn$ ‰e,6F9sB&T7.uu| zKcHuW}EZ&O߇ᧄku3AqA].h`.nsYx ͭrCqI}:wnbݥK]^FOPrvKO\5н/<*\pN-]KA 8.3+@nJ67C#zBeu}ɉG5.uʖ/B;6FK7Dy<|ĄjW]k.ѡiq 8li q8oȡ|^VxrBn 4p}Θ߁. )e[mw9cNp{<XDDmr907pdVaTm! B!qgOOB^n&((f6#hy_IY<]j4k=?9>/dt> ,gH .-nPca2v+[wn= γ{/y`"#B\mˏxm.PU.(%QAc60u FF64CH jfZ+ v>Lj7I.9,L ϭ:TU] }?uA] ciZ={HfsDA`Mgպc'/ zؼ;˧a'ƵLåcok1 XX "pxBV`/oM{dw?Umۂv'Cb<|2dy2R}L֖3iL<^P-cI* Bx.p |q&0|`>҃,f\Yak \p9v>~=DFy ?-hۑnQ!-+T<\ .A< L O՘{<-68(Ree\# E[:..;Qwm bc?G0g xO\s[u>P-z߇| p2Dɮ %LU:ދtN5DNj/~w ^n2TVugDG aO8%p¼oe>PVvLM3|3t {7Ƃp \EkSiFSoǕXyfl6+A?SAЧ{v?̃`FFGD_CZ8oҝ2NS @��:_;G)tX ~~h;撋O-!@Ou5.5Au۟:e5KW8ovmKxiQ0v2Zy Tҵfr F60F6%8㔖׋%;F ȇO=NRbbY+*+yWyWxL+∃ 5> W̪_:QT X,JX@/<3yNx4*ߦ}j뚐((+ݿ'?^{D|l,5kAQzf|Ev; #~^E}*/ h6ѐz*~tذ >?bd7Ѕ6˩ӂ y ƈbWr(,}PRePU 5.ghQU-(XHN�GRAv=iNu.n.-F2ә8n!OXfs`3Q;o.cX5rؗ̆ A?Z,PV <L68>[[+J/q)cD :F}<y ByE|fiPCTը}v2oO$v?7gs 7[$r)\>,ejÙĪzhYn=_./;vxp{l6Jʆ]c~v΅ׁ/X7W_6TUpeP-|t-;`'jϞZV1N= #LiQ % oUZ86 ̰~}۵+]ڷEuMG5\9{uNoʊi#6Ӓ ?b~�/{´~ Eo.xo> 'ga$t3cZ& z[0QUun&1ރކ%?LO<>/^~kΟ @M3̆ 7M'w:Z �> < .:z.Zۗ7 .u>z\|.:k8|W;N NdpD5ah'Ofi;\ Um  \ /A]h H|@RUŤnhUQQ(8RcpaaVMM&^/JҚ*UWZLaU9Z:~MïkGیy..&&GxMx3#mzOs .x>5}9 p… *6EY¥7Vz(lwQ!BRSS)((y,::6a8!9'F:Ɉ'Gfl]蒘JDH{DhRK4Ű4?Ugw>v(Ņ_^LNi1.O.wlOe3vbU۹CYxHI1àkO 6n75a\z\'D; m M_ u-JAAoX|>^UU F~~~kYamkا㴮}9%Ce%1IBD4V# zp4?eՕ쯪`U; a&u hnXc 38V^wCnr 'XWQemuX!҃Fp�� �IDATaSuqF^\ $ā#%л {W0#i;]Q'g?xJz Sl߾ dbDTe,Fƨ>l ~|G~G[SXXJ7R�OZl19P1ӺEQwSWy|~/V{~@oc ٧7Np뽽҆:{B6Xl=DO t…gRFz088OQ|]׿>G߿-?пOVxz$0xPP蘘N\<h4 6a-"`/,e.GiMTgCvG88e_[pPj J4VPUx^xp- <Ԃ}-AFFZGUUo&=Ke{յnc$hiG2pwJt[ZQ@5DYy kv|>Y7J#i4`yKP߅c 6$b wfv{("-"譔{@oPU@|3_/C7HOO?x6p p3kyDb1[fEA5^/+yǯxrg7bmbw\uI\OpU7J#m ^ns4'0IN E(]td NQ0:PA[i⒒55 NrrD[ii&(u3]Wn=[ 4rs- L^b5JaJA<z c`)o:b QQFbp*PY ~fpF>x xLfx#rCj \0d`p0VQ̣x} QmOQ^s t;ddR-EQ5Θ;tutt:EUvAW?x.,m&Q܍-$IQNf UNgqғ~u+|,a_..9. bۺn~0m{½ރÉ_+&MV\W2315==5d2Mu EQNi=>ug R-8I](J㢪а"l6tr)v Q#wX.߻},vT?uw =\+3.CB1h%e(Ta#>۰/5=V޶H~ W PbaimkYŠڳ]=+b1Lw+2�,J4{Cnn4QAo!`LQ kXlqgоK7 ZVEEi19;jGJX,h~cMu]??''oyYQX{;5蜘;W=9laOQ>w|:_AsAxon.p9Ψ?~*4˽Up4(-բ8?:==<#UFFMQ8SQg t]mAtJy8"=x#NBPMܮ*|>V?ը((dp`RLq2oZ*͖ @7Hb/YHgpilֱ쬥YdrwrJ>ˮ1%oشf+ֆisrȶ3c%0ص-T /F-m32҇*rpQ BC=oWVV>^ZZz ##U4VqUUҡkou6A1*rw_'[6&6>puќ;=xH uprJض(LU/)b <K`p_8c mwfE6CoATQ -`@N:X8.b^a0>IQ vQUŊjRuχl1c۱_V\PP*V#-- IIPc`Tમϐ+l5OO˫O܇j;u]w_dEm\noVM}yo0"-ry5E~-;l>^~ zdsboW so·ۖU|yҺG {IHH:ַFQ|^/D#ܣ/ ilTWYu?-t?G$ژg?i~`J@A?Vy2dfOW%kw?% QM&ለ0/>z;6j5u99ywޟlfnPӃtJLsdqખY-S3(ֲ.wՇO` r- HDm '<(Pjy= {VhnTj mbTk[TyUUWx=v;i5h8#OBPUj\!`;pDD_i2J X 4mZnnzĦMۥCKh,FjO?ERGd4�&,XEQDF0#Z5(d3:w-bc;RVVĂQP 㝙2sOc)мh}uܮ3^`M[`5AV V7zW Be0vq M4XMemN6#33}ҭyx<;g9bsDP]YIMu>` QS]ظDDc9"ټgLfSCϲsھ}OnffB?~dfMUֹ)^͸3/uԵUUټg۰X =\?[.V`$fJ:O󳫸>x/64rjQo+ar#΁b<:[\%5ZxnnrՐ֮W|NSCZGkt-W~*dyVI/ t:_U%^Wu\v]pDFndvBZf'V-]]fVed�Lf<*rLW. FUT#\:4&w˦yT Q7ܯbb(V[8QQ0jy-S7ʓvF2ᴳaB(. ըaXl9G&?oMMM5ihM<u?;gh}TU \JPӢ%%E "JzzjGUUX,Tg4Z^V5ݏ#2 M<Щ{ouϋkCnoߟ| nd[tinrZ~? )\5jC2:** r,ړ K6źuK ] 2<߇ //y}tZ ^C\"L5հ~e=׋TWX,q<IkיpbQ͖f@L! (t9#޼dd$RQQMlP"hՑ)ӯ]ӈrg[&ӣ"1"V%H,/ Q9Xp4yKD@)))=qTyݬ%;AsÈA#`p8u$(DKaĶ4cYS{o^/FᠪCF1?cwDqZD5[uQ IDDFaІFbEbb"բ"DEqs8o� I]Jbj::<!%u]'!%{D,`PXX42CY_tJN孥*QL7gSa%xCY5W ߯B|ͤ[+iP? ka1q!E.=F\\n5,e6ՕED99u]s~Zʲp?oyy""NjjJɤջ UϿ ~0nbbtqH35oo6HtrY1\6 &tOSVLuU 5.kxpiB+pPPkB(QpŷzQ0jyxC_;_X@BrqFR:Vł=jCbչ+?f5>ZZQQ-))It#&ƙ(o ʴ:1q ?eyGFE7i:СE%\a a cKڊKjW7C:Zu|^28P3Gwl]Ubh|cۚn 0ut _| PKK`HHLktݸVG艆7"~cǖMZ\IBr*^uMڟ~`ώdGMUQ-ytɆ(*98"G鴑S82եvLfsSZV4id6cX\躎ڀir⩩zm~ĨX6J]݈ Nko)3`wCy] 6C/Ó L5vLJlD9cxs0Lt8{50!WILB,>}~~$ztFwTJl5gLC\Q:&vn=Ãw^%cRҩ(-npy(L&R2ڱyk˒[NVByj0yH2g_U%xw?0mVtQ8$u/a0H ¦5йE1qg@n(7} ~bGO :&󣺪'r#Ivl^бp27]ILNǯ?vrk-/-"GtttWEQ.'n<}y(#ףfvٳvƠ ˾vUcwDs] "v޿ n-p'>Q&+-Rrˊ[0!!|#l tD5X³K{X=عȕ^X )Z{!!&_�Ba>2ٰjKJz&:`wDpn(xΟ{Lt]ڲWVE9R] 3Ea2C|^\55̆Xqpj(߃(pJ^x>\5d/]|v/b~2kOcMcPV_V]?Ǟ3/0ZǀB˜ӌ`÷0zhvkO¹C;~ѷGM?ބKIeo}>2:t"51eytM 9ά(ztTfb5zaTX1(Pj~iQTPX}>_Xw73sȉR$n0sV/zӻ'!2[Rx=}>X‡_PR% +xn aTՕꂊ υEኛK\jtMCQs(syRU^)gM>%ظpE(3<.sxt!kCiq)AsNF1EP\Ux=n|>lgl<ѱq#gMk6~2Wu5% q%`2ΫO=IJ~;r"yTLVFebn~lصׯu?Ӯ-|0ccsa@o2 ,鼜b1:P ƒO᪒V¿Am#f$i-nyvؾ~ [6mlAQnZK5㺎4ꊊc)xV$J:z2T\7̀*'>9]7GDP]YN\bETEuejZºnw :eqOX,6TTUUSyٻ>Cuᡩe.^ޞGΖ<SQoQ+lH#z0CH{ =ͧpP.%[t &K&84iiKTհUw^u?C}fwpE3lh~Mx?9`Pb6*JgAof *E 3T M¥44Ҳz=ۛCBr:%QTWV{AOL]S]'DQѹ{?V/]b$d(/-Vw|MU%9yg-Yy *R"Hv/VVwo[Q{UE>~/)=pp80RpaLY� &OK?'_ vRQfls7(8ej,7[q ^se ρ[7s}!:&{iz FAk~QRSUu0u|."JT KU(/އlnt<<:,V ) Ϙ1qY7WM5Օ_vЩG>/bD뚟{HhW'l2UK_O]\*!ng˙}E|i[O*g{ v@dB驐hHIK!!>5Nj } �_~8J]cХt 1Ⓦt&: =+r0E1,nU5Nb>_h.Ma*i\Ų8FOބ36ۍ#"yIeY QN# 6!.=}A:CUC5DЛMXU)e}USu0kaE}>EEuf3Q֭X5ILd䄳2n*~v8"e4=Ik[,VV-[w_|X41^)d'WQʞ}|j1?vTo]U VbnX'B׎Э38#| (SaFUُ- (EF#!$K 2Q,{gX>1_^ %P r ?@U%TU^r jqʔr ҳ:�FvI1[LSD:ED|rZX#t*|bp"J~~+++c;0&)0o1qus;ojG:,mI>{%.t3JL&YW+0?砘+BUe>p>YϒBn{.12hdv䎉糿V+2g{�=:kb-n6 t0Tli@|O8WQjig!s7J(D;c|:m2fEQxlvPLdγb ~<8YEaoޮp-? IeDЛ!C|r@_,&u+~߰TU7h뺆3.>.?zMxdl64dȤ .s>?nlvѢ  Wla$:'poUm^柇ą q鿡ekYeUQD te,f� -0ZPJdD:tQ=p(~sy EU0[lMDd:ѱq1"ܮb1[,u++s#aumt(fs4}*jqwask>™0mײ諏ٵq]rwn's yigG[7>CQg|]Z5=.tϋyp|x~ 3PɄUllf36ɌjnnA?4j-_x=D qSXYƶ}{WX{qg�� �IDATZ^_]k)?t4du#e'2X,V f$W, ] h%|n E//-ʛ1 GqQfŌd{Hl0pᖭyt],(+9G01fV8Eo+ ]~X Wױll]w^x #G{RT3zTUrխѮSW^x.;^>mj[׊^/{+K)0,Šr +( [QFQU9wG]?ߟu.$[a"-V :qjU9uu~[VQk*= =nqwa}xA>ޯ_~t}%VϗV{ɾf@`g0!`F)vs\+ܹyA >`% C�o=rch`Og;vnۈ6.ST<KD,a綍ص}3*+A>- C AVzQh$ ""Ϯ( "�; *E1 אGM]um-C7GP4උDr55uPB?p쨫k|:F@$8ݸәyMyZ/=]1RK"HhNIs_]w돝}1JhuAσրm~Z}^h{ ̢R-ǣ(�s1$�yoGIfZ4 ǔ AϋuW]9AA鄩]醢�,BQ][Q(hb4 y-4Z:!7$L?t  @:(V[NLBkomF}Mj܄&5 ϋh$31!τ05L&̹`=x(:Z_@4nRW`A ~r<,˩,UQ :|w>E#\ǐowu)5PWreIuq(XFW <S[[w "J9P B!tcOtv1$dQAsC!,ʚaQh΁ݔW.s̳j-Dq~!"?ϖ8X-*L x5 5xcjg7X<?Q:g]p9f[If2` Â`Og;<]uu׃߇@σ`p(H(p81,I{ð`FM9N9Za#@ I!Fm# CbsqO8ї-rX BQbؗ Y!h4hn/ _ &cJ3p撥ȷ961Pe=},nbXxz<ER438aq<-X6vţ4+<córlNmMMMT( o&Q{ttCGFp0+o\t"!C?굼�-ìcڠY2sa8NRқz尾r;]6VoFgП4>̚wz}VdJIrXQ})WlY˲ $Q~ֱߛŎɻ~^j*YcUxd)0  _] ’n/3`QB`!9 dY)�>K4:=֯O=p3ڙvIR>BwSBUB7F.  EAn *>z%[)fǨD7Y$   J1\9qx\|k�&^%.'Ŀ ȱ?ފ"+݊X+]08,= FG㠉@ Z#VF#xwݪ:SO5A;]<$1o^)/�`k /BߢfvU"x!? sqhc/Şt?kk/v{'FSSg10~=aybigdKYar�˲hkH4Z4Z-4B:h4Z F_:z zZ>3tju5�<8^zM(�64&6IbhppPP(}@�~>x5}EuTi5q!(aP<__ v<{hkg+6`C]VVlOkR5߆ g~ {X X[/O0 lOrޮN;gȱ_LHGج$Bzq  xΫclT~/Eg6|E?MJR5Zd!-q~Muho@8[xe> ANg�vUo}nJR9)āՄ@6 #  ## # "  {X[ڭ+H`ꐫ7"GgӒIa!(I2HH?#qQXU+wn&4y;ѕiuzu:{.EC@l6Ezr#iM‹4ZȒxH-!b4E@~;O( Ĩ9~EQ‰_P%bYkx畿%?ߤ(ɵpBއʪh$&L%~OG3 xꁛޚI1qU7# />߾vD՞mعm*lm,)! ]<㜃19eA(0Zš{ci@4{+mXUk!e] ȳ'^]Ek*dEoom5Sh"c wl Z�AЂ01% vWw@ "2,L /Ag[3F5,ぺ:ZyJ H*Ձn JN=h/˲x?bw`T_!~YXz}IU2D  Ǽh4 1(Fc=X1QE8<tW -:=,{+h !͈e90 &ToE厭عc3ZފhK (CQN>9VsXah8Z<A`XZe%VW FF Du{ *ۚ;jaRr92+C[wQ42?LhrPl\x{W�¿C_0qhuzCX$a_`,rgsb -V�{XԌ6YƙuuuA בIw:XٛDja4~sDU,lǿcFUItbE˯(P9cI7͝okj@kSښhGE8ޫ&D]1|`D|,v:F̹y9(paw F0D$XA|eOW'ڛ܈=ؽ}3voE͞c;Lq b8&t^EYQ EDDVǴ)3O)30d$!2$QB7N E.ccN86xzy  dEs,0LlxLN7Bɕɒ sN.z#dI,Kq9 -#:3;_bNk/E'c(֟Iz!<(F1EGNSV/&՟ pYq5BX:â;n@UV)ߊzȒ-K-9q! k(qFQ&}xVQ 296{wVl~-6 vn8|f9'/X砡#žeւ];PwjBCu%|.(#_E{ k*iDtah4Z5v8 ZaP_]nFH\% 㺻~ wq :EQ,:oʱo܉u.;,3v{Y(/1r2J W0JFE$θHln5GaQdeYƠpm{7cMعub,)ʒEQ`-(ĘI'ap )dh+ݟճEQP]Y[7awVToEG[3¡¡X (:c'I' a$)6%K$(߇PVھU;ay:b8؈K) oQ(9vy^Zp흏`DلBY`B! ˢbpY*C BUU5((9K�2� A\}#:r ~_FB܈瞼P_$1t "GP&d( + 9Vx =K'@haXl<,^Z҄tMhomFg{+:ڏhdpO<v'l7 n]( Igg+PSٳUXm-Pd  ~PahFC5aB52kza, ]Ϊ'K|,Y(<a'eJ nmBpNr%_=BGZЊ,Cg0[.C(?lh+aQѮė͹y;y&f-8yNv ߀�1WBX$JhiC[s#:Z <m~_Z_`07aα"ǚ<mv8\k<xAW^NظK|6!v{ D#a,MP0[NexƋjE:C7RBp8hhhj5 �ddk=N; Fzf4TWޥnM;PӆEl6 O)  Ldw$>=4oU(a'cq@QTW5>w_@0O0d:Zp`DĤwA%/]T9gњlr]3y55ueHݎF8Ω,KVB7�"lAasTz^kOWU,Cx5NNV ��V N AtXN,H^E hplK0E(D0/^1+Q!8WA+Qň10y\?}((L<MP՟b+DQ_MJ,deW3s|Bʛ0fI`XeA@ӁysNJw^dNcWTSSq% *Buu n祄�pꞦތ^b 8ǖWǼyB!Ȳ Cva6a2a0!nM|Ŷ#u *'Cxց=Xl۶ `FI+XC~㧝\QHqD ݵ}&vn݀ζfȲrDs{*2<bɅblF~~rrr`6[`4ƌhFӭcsP�>_�O >]]]zZ<�3, 0DM: Z]Qh4ZlYo>X!WhIMM*D]ݪF vr]%%K#J'@>_ .feA1r(L6 cƔ!77&)n`HGGyt: n#phmmAEE/_ ;wjbTq*%\|-&ΘC/ E‚Fڳذ (|ƴ(`YnCQVVR8Nzt:{rI0A,B@@mщ;wbؼy jkkP]]3|}Q.ML; Lq*8? ՞]Qs P[B% Ӊz�@Qu�S=_Sfboө:8&AR6/ˆ#0~l6C4F#D"iM'yl$5j):f|X+lٲuuuhoohdD#?#L/hp u0 >Wp0lxRF#`4h0F25 FZ("BD@ zPQQ7bǎصkZZZǃH$A2aErz31]>-%/_q #m[7 xNx 5`k/BCy z=ƍ3gcԨpݰZhCXv0aq\w. swtt` |n:, mJYs4:,?CG90A8]mX2lX)ښd/nc8q  !I0ӑ;绍dFmd]4E[[{.l޼_}% `43"DMN w^;tCR(چjł.z) p8 =eYF(°apa9?D8y xPν%bO>Ѩ!v0܋0gђcnP`Y}?Gtug.=qK1~n9Syeh4d2u]oʗ(E555䓏+`Ί"c;'�I!(u/݅ysJ)\/)#OK`Z1~,^ƍy`Z(D(؈_|.DR:b43k`w#ѾEe4e ?|:Qh`1s,a'1"Jj0iGzX5|ݏԝCo"%n  )RO(ɓ'`PT4ph-h񊖖,_!| ]6-$Z`s~òԳ CfŇ6VuB!t:|)3g&M|ᴋHj :cXr%>h9*** CG4KsJ-JKap&!df  a_Æ &tqBF#f34~I^/VZ555;0,1SfVGI}aYCAaocK#k;3qWnwO$l6l6w$ ]]]?[l^H(|kmm}*)(7pG^^> a^`IGpo̙V$jtшܬ˲wxà F#p+ov7% ϿAkcaeAQ<ѣG㗿 eec2, 2 CUUUw[lFοE�v;)SB6wn<{d$Iƍ 3$x"�^ј`;vl_;5ɽFs.V6;:IL#QkV~_}^OXK)?(b8qi9u:L& À?Y;ocٲ_gsi6-+�^ZJNŲ�fYQa2p 7b֬MLQhZXVhڬD"Xf5NTVVPF]p,YiJeI²g~^1I.XEt:t8`6& 77߬?۷[Sϵw|)z,=ݞ/|afqW&O~cǎqi,efY 2/ݻQYYyX/!Q7ߏsիyPQ;>Ə�a2j86 yyyY+Æࢋ.,KذaF�� �IDATC:u !dbc4>o,]z! y yy90 y@B\ λ� G /^9s`Zi&xqعe=|.0lނe?^6E(Z⊫p=㸴5.,b֬٘;w.BMMM:O`fd\k].%]@A �EE aPyߏ ԩҾѮ6 fzi`1c6mڄSErx:P6y=Iq݇-?@H169`ʔ)q'g^W& 6 &ʟ l6.< . _~B& #d2߻z :A< $&¹\y aM[ng(t/T H_|>yuI12R}F<hN$I8㦛nΘ !l0DKK .lذ>VEyu_.lz/va]$pa32iZ8Nt:zGzY?OՉ-[$0 j*tb) `m-xfOF]ɲ V/7ˌG$t:\.^SttckqsM&ӚƦ1g KFaMl0ĉq`ʔ)i%`Z\e uvF|ɉeQSYBJJCJ҄{*գ.| K\q%//t9sra|BZBbɼndN WPXXu%ÐHZ#"N;m~: )ap8h`I())o2kF؝4t-8v$z]ۓ1*ݎ'NJkTrqHp 3g.>3ttt2B0l6x].+^ZN ȉF\Y C^26s,<iDqIC|#Gĸq'%Wax۝@F~dYFaa!{ >R\|̟:+24Y]]KCuJ= ˉz9BEwwρN3p:G�" J ?ȱSRcX2pId$cȐ!x'0jԨ&L&1bgرc{*=g{ֵx<>z{=bc�=+I.W_}5&^6pm=1c`Z{H8=3yx+} .{>&#*((..?gD湹4_ 0 7oZ[[aÆ!Lw=)ͦ �R= p㍿!LF�ƍ`Ċz 6Ae?X0 vno<{HJ�~- 4 N9Tl߾UUUdlOmmC$QDA r9ށ\=˓=1{l<o@I;n2`A!N χ~AekF:hHȲDlǿQ4~>,CLQlf8gq&֭vL2"x<OuBQ،QB��TUt0oɞ 3g.pw2AcڴiشiڶK#7B+{Ez^#̙n e(((܇`ؾ}vؑ*~lߵk6[:;=&zv6aYj*b.+n<ϧj4׏?=Ţ]! WC0@syzX+PeYƭކ)SMX^^=>dGL01$RUUAzfki¾@L1r`Y�!??Zl[R{|JzXZ11,k?/>tي,˘;w..\ah1ݏPXX' R*9BȋN[M-٬# rTfӢx`iMr8tSS?nGn|zǁ`έ<s.tz=cH8eMu{U_EEEExǡ2j)ϼ'?y+ᑫ=f#p&ٜirӂŒSDy#wp睿Ƃgd+,,@?cԨQ]Q,WWbƼEkǦow{i?evzp?Đ!C0h`I鄐i®U|7vU`Q{N$̝;g}NFٍF#t@;Bnnq(=֬0m̑Ux璦="(**hbq9K/K2 C^/,,455BГd[uWBNO\n^{!iXE^^'1bNBW{ L{c/nj(={6ΝQKXVz8zm(.*y�%tu] 1dA\y()vNeӑ.bsιB7/W-=Q{^>4Zu:W]umF5( //t=Nt:#&5 !\(bڴi�@j_(8dDi+LC})|Ao"㫏߅Kb{HbRC9 1cJ6GV/t z-rz-nDOk?A uuup'B`PM&@saiq шhTĚ5_uuh`DD Ɨ Y%F1z x  M<tҴqO> C� wN=n Z)7H:ꫯjM[qBK<Cprl+y ] h;b0֬P0)1uׯ7gNb<hN%\6SBrpB5ɞ=z4N9Ԍ]5 f3=v\rjG!etM wc,IqY0x ZqSN9sIFuSB��,C*/sx-9ppbРA4 b7zGX_!lpŒJ !ɡ�-^~_\[mmBJ �p !ԞEÇE_g2w0ap}WyW+)d}÷(X*tY1u4Sw.2f38@PRR&Ŗ5beK�oO(k�΂F#`YSI`?>N<qzNYvuЃ;g| IgFQ\{uq4:6pͷxh{@q:EY/O~�n�IH$SOǧ=BQЪAtToACzPD=vlMIRpuE~wN8 <Bpwu0vvSBJ8v`�+hp% x=3fDIII2ͪh{e ~]4⊫ Z�Ŝ9sPV*BnV�C)g; ,�\?~ + :n�ra٪{=CL]mjS4駟*M& PXVG Imfmm%%lC}}Qy6!TpꩧBes- ŋ% OsuՕ߻[?^F?eY:ncɒ jSrO׌FCF}v|;FVq<_B4\0 I_6Çg…g%i"s8)g AjHSO= 6-p_u]w]A3 ZkF4LĖu_S2TW_ছnJY̲Mг]H$K/,]犢P ˰pY󻊂@=t5p<\pX};wnFM&ݦ%phYI3!dQϬt!<rk(b֬YlPI2,Yr!EQ| >M $cW+KaÆbر4:F]w}67˲)g za<�!h_FAEPنCԣ2Muho #Q8 *4UFX䂤;Ռ'NG/0rHL0!g 3ۊAQ�&2QFet:Q- 1l0 6\<]ۻ 5Ĩ*9 |)i�о,hļyiE<m{VfUaLJSQL49*Z(+(oBwH8;TG"fΜ^yqtgB6 O<16KB@)ζYE�(3) &@I?|Dzlƽ</`qaMfx;T7sM{ R3i1jl,v{R_ -ʦ Yr')% V{l`QHW'BًӧB܀f:5n?t6EkX,>|xFt: EY,.J  50+3.+mB,Lj#7H$7ei;UfeC3.>;iDLq8 j[zKKK-XuY1jԨ3 ]CբTőa8])EwvȲJ%%%O_,Kwg9ydN9t \<BPLBN>w,d2QHzoXAeFQPsshq:thҽQh¤IS Y�%%VJ 0�hl6cQiBB��̝;SA?Zjh$EQw7a0rȴ] 8#$[XhծYSg@݊v�daР"Jo0=|hooG$ð0L0˃LWl6 TwqHjv!6eQ$QDhPR2<a2� &ppvJ12!qPSIJO(FsTX];wBSS#:G I!& #Fœ93ΤU ` PW͆1kψaXت+"DOҨ�`Ȑ!p\hjjRB0�i7pDpI'=n2ďXjc?F8$IeC~^0D @cc#6n܈zEEOSIG2e*V^}ȂYO>,b׶ `U wA&c5_~% բH<#'ǂ"v̛7& yբBȬ97\5君 ә2BxψЫ3< JO,cϞ=?.{ia^?ĉD MD1G$zף(Ǝ2JwE"`Xl6o]02( ֭[kcƔn(-wyGU(q8l|CCsA�AЭ<Xy;*_3<[g\+^zETTTo{iI!CY8zcv_0vBR tL,ȪUV᭷hmm`HٶJ0x>=yB|-(++'`С6Epz�~L6G I{Q;#AIN\rx䑇cCh9k_"cلU0aPj3,{T)&\|EXzxAANNĨіؖ7 bb *}ÑHQ� !N(6$#Rd氄؀/>7=^8[7x>N՚Jb4ߗX:RYe8.pvh?Ɣ)+عs7TUݏgg, ߏŋG}D%'Gr kYAVku o7q =պ 6`9˒Ʉ٧ \3f希r`0୷G-R݇h4UW(Aڳd v(dY(Bq\Ƅ C /h_ynXQ`ĉx7 .<:F?ꫯ@2󑓓4]b$浬ȡty&rrr3O++wn2$ Jwz GdE;=oވ[o5G5JQg}fͦ,"//e/ˢOg&)zR/btp7߃F#%!/"݆WF?M^!-{yyyT0z F1e(�|G=�B �UjOJK{vV8l&1j8(´N_x ֣Mi&lٲJv_YժJ$! dٮNq=Y~=K+X0XDdd05K@lܸ*^59S|. %9tE�</d)YxÇ~x+χ|9Sҵ#FG9>})-+AbI eQDUeYFaaa6݂x~|!n\<8о0qe2j4O륂ы(,ܸ)h�&XAx&B#<|@GQZ<m BTd�L4zkDŽn2'20d'˲P@UKNE`x``(>REY�]'όT0zyy֤t>@ IۂVVxqD!J׃~dðGYƍd'5 Ilx( DQD4MJ,N&؂GA ǚoրgS+7 Qt:^}^Dn5(p�T<OɃ,ˇ(J|s !耧i( #B$IĖ-[dR5Jb䈼h$ ERx薌BĽ޻XCd?5G』W}ukQFGyy9`<+g:~>k0ry8JkujcC=T<GY3SE'L!D'z./߁_|=ʷmL<`cn>vȲro[ذa=^bIub]e~Mi(ظq"jn`4py? '+t'W直RCBW Ĩ9t)y!Qy~│IڽB�|j%6m؀a%1rh>l۲{" T?ag*Ff(ˡ>@@R4,1"vڙRpo{veW\NB:;<LƅyIi\%Eo8J;C`z`,$LpϿc ߬aQ=9Q% & [<tZ9�bmmUDsOxDID] =)tWz$.a.#ٵWE. *+_Wi\Oy= A PBh0䈅Tdi VC8¶�67i f:$ I XAZa$A2Iz4ю3HΧ SB8<geձ\.R r�1wrwT^o07Cs(zK }*C/Sy"F#d¡�� �IDATN5*4Iԁc^z;{3Zk#0r(*{EN%x  R焮(2\1a|q,.OFiTi{[GtAQpheːEQh !(G<JKO�2}|EL2_(l$ITU(,Bꐽ@I񤭈EInbAnnn'ONKS2 L�PZZ\kABNqO/E]0QD{z1s-!$V7B-0 Z[[2R y`0ŋ/g, ( gM209]?PT4OߠhĴi'Ҷ>;=tΐ{ !0- Cؘ!z8>Lpg}6^ErX}-W'p#W<=9BTI8>9' 3hnn(~A}0.\>C:mYMtvvG",p8�?E4hpޱĩ*}ߟt쮠`d� ab2d/E ( qy?BhoH!mpYBJPT]h4eQ2f?}2zU+݇x<PA 9';@|bCtI}_upݽBpEn>@[[KEi>Pt !at&н-' ͞=^zi !w 5JtbmI Ie(<Cu+!--ҏ%3Ы'󫯾 Dy)zJ(�$'tOF?OeUBgY7tK F1c&.r*}kBѨ6砬.VT9yIvH{z::�\y啘9sV/GZ翠@VRB hhh�hN3R$ \.<04( rrrOV~-[6]<J?G709|L<M6=\c?_Mqkl.^,ɫI%%*fXEUUUƄDwf͚~i)#!wq'JKPicATT'C(*7%IkH d6a׮k EI;%^x%\t%Dz%Ij4MF ٙ2ȵSvW!J0 ɨh)|~ƌxͷv{*?.2*�wF[[E/p (P,QT:faڵHz$~!d£>CD0rh| ̚5 B=(tPBXأF à>?m/H$rX%=zhۘ4i9j.28Ýwޅ;+Z'Xrt:!(0Zgsd/`"ːe C,aƵ5Qw~Kvw?tt$2HuׯjէTmmmJr=�_6C֬OURG�+LiI `4�VTTmKxch4f+@ ѣG㮻Ə~ߝzתq(biaxeEU83 6--EPz>_t_a͚oy&TUUu&FI,qc֬Y?tښ֏/)g7�?!kH$;+P\\v@ pXB�ct8s/y ;q\Rbe PFw}.|iX<A^۶mS,Eưc!Ƕ80`X ?{'W]9gΙ^od7WB !ԀHQD\Q( x՟"^])BIB:mn6ۦS?fgdgfK6^+Μ#[ ϞwG(#kĎ-1hMd۶m,^|ʐWe"Ȱ=+3fdƌ\}'Famʞ={B$)n'eee44L`Ix<^^o{!HiZNݲXX155U!#IҀ*2+_2,@bTVV9JKK꫹YMz!^z* ky\x\vGp8SFٴixON%cw2k>(w;ȲܗVm6t*AX$DO4 lOϏj(%>${L?:?xر]ׇ$d2Ⰼ˅墪SЛ0 #7~HKKIгiׯ6˛eYy /`@Bm?xYVk9 aQS?; ډtwڼfZ5i+m{l'"�YBдa IQ5;>j&P0ʚ:ʫ먪(4tyVo8=k8ԌbS9H$vA, O6Uv|`n�ZK Okk+ [ri/+|I2d9 nYfppQG$xM,M"|"# ,@KwBt}iٳ/j.( *q{}DRKK `pȀ"mD"l߾-_d'iY" oJ70 ֭cٲsEݚJ,H2͛7o3y\$idBd$_$J(6J"1?8E~/LJ&joe+y?W| 28a�%e�2oٳg٨N&}EkE[[z9.;Z7nh"fk\rY1Msڊrl֭ow Q1~D;c揜_{Myj(TUETsEyߑP5I:]^jz?ǰYd RQYre!rgKKkkЏ1iS!x4G$D(4<lKYQƞ<cy=ʚ:J+^aYn=|F#N]Bx;o`U*xN%;7~۶ml߾}Ƞ^4M{ �ӦM.(BU!mo?޽]H$kQN1 ksI8cNggҢ|: r{u%I$,L4̓pn'mRLàa 4װy'8ޱXH4Fe޽ݻ/(x`E@?d9�;9s**t:}Dxr;bc Kr"𻲌$sغ5C gL$dEAQl8v|~?U3y$&OD]m-%%%8TMCQ,kP0x.X)a%Y9@M:;"scX̍dxƨ\d2a~,ǘ*{͍U%IZ 9묳<)+P谫݋_W9H˲ka21xn7JoB]\�t:q98Nv;b)8].욆f;c0H:Dx<NOOHH4$IuvX=^j peYBV䃆i͆7V$I"/lٲ!NU˰=7x0ǘ<S9be[[klݻܼ? ҫK1Yz~5X36^9gOOXKs|=v͖̳@\VZʔ)SHuU5%�NMNEAa}?10^pEy9 L<-ȑ.2P?S<� !-Iro;b:'O&XY˲X!olJ0ŽB{`L1k%X tRX{a֭#jC*޲1 rKʙwRAH<O ٽgͦv\ MkBJKK\D9?<b۱lvNgIEyy޿wܬ۟Ic0A*JcEQTf/\smƞ={/Px8ǐl޼|7x ǨR71UU{d!HǢpl֭[Yzu׌t vp^Z|R}grbv;ilyBdYtXavMcΝ(`a&\0 Ι)Sr-3hmya0} 8<Wիbq4YjU1[$ !S�矧k^#;_ϱo߾ޫ˂g %�YQx埏tyC##o. Y4fiN]G"lڼu]f8&N0@[k_CMUsEe6NiHO<׃iPư+X_Q@GK/f: /P^lIL^+===WB0e|* ~dAb�&9 ˴2irC ߆c8vN_&vvu aT4N$$X+~l9fҌy9EaƍYzѲA}娑۷nݺ|zc2Y@VS<4===nau\ޢ/ ۷o˩Dl6s}$Y! !CYL>/rX!6rX)]g)Lhl0 oo~xd* !pyC~E!+\p".w~}͏>3bu$RHxXq 9\-e>eL|uttjժa%IcDr+)g)g \ ۝HL_TY oO0˅eYXɁvEA4vƖ;$AnZKIi$vIΜAiES,4k{n'q8-eb.<d~!!3--ƤW5]xV3ɒNyG,św w_j&յu]p GZO ;a`rUU #,i'ˈEø=mw|{Nsy(v?B1,ӂ&Ӵk3]_D"(#cvy�kYe՜rECHqlo zA/<Hr!>`&[otP>|$zb9=je\ ={^|a}d2I4-cLBcyϦbUk55cdhLzs~Ks)ݶXae{XXriYy_MՆ1N?'ՎmM$668tGzn͙3ilh`]Cx"@eJ+xwo4/>^INu4N%9F,y> !.ޏ1y I$hiiS⍵ivߏ'ڲ,:::#Dzk.~b΢S%ɂ_'D#`L&ٹ) }KHtZ?lO=S]]Mgg'MMM{?!p8]D]<~n@˕61ĥ +xge\i:::X,O<HBl^k4nA+2mmm/t:Gx >/Vdq)g_=T5YQ,]v:o 6(hJDZO-X00=_ww7&&(hRfچ7^˿~, +'e,ۘsb^?k臄!G$2Q:;;͛7 ,1x=I$`x<7}DMY.μ?9/bjښwRkTvo­8t2rF"SA}‘0"�v˲"Hdֳ9kt~6KJ>*ʈF3J}ngݪ7iT۝Μ!,jObʬ9r-iwa}?Y B|1 /I$NVkҲLC~HfϞ={L$\c:,q' 2J$h69EyoeqyIJt+? Y"Iiݷ}sKK:2!h,a4\$4TIMS544UE7 o@y+%I"ygʬy}&B(<AW[ ozEKpөʭwk'1�eYZ&O<TV"tZWS|M/ _u~@&rIeYZƝ]pxV2v(q[ N9.`e,KS)nBTRг4M˙7.}AGg'd}Дl?x*δ2j� &o܈<p;UeHjEl֔7r%+ x[6re9MA;x{9M$lSOzLA"vaQ}B[$ TƋ>nF%I(tuuQZZƼyF9iH$p\EP?szs²ʸ+wF'WMUraRYQƕ\ŽxoYIw Yd/DH$0- ˲i l!ɝ_EfglȄZlIWw$Mc1z6FZGQm$9-d\}#lG:DKDkk+xaѼf)Hx x`Ly{%{|>O$I�UM8zGT.IRԏry7^,|8ef!w˲[ݱ�(e'Op9\~ѹnLbެiD ܃�;Zuh,J$! GD"pvZgP ɲD(+7e-&'>L1'/=ͨ@Pl۸ĢSBOЍ4F>{ i97Afn:'0k֬!2Ja}"YG4T<EDqhi9.␂li_|Ɉ[%I²,DQu#¥^B,˻/y_[zz5G̈́$IDQ>}1wi3̝92l؂6HV6` 41 ]3?75;ru3qHM8v:r)^ gQ9>EKʫh-7ODW_cҥ3^a?:B ޟq̊+XHtnT@I.%D}xf̘1d=U@Rظqc$W}UTYQp穷H:g/= 9H zUI ښ*fLHӞfԈׇ+BLӢ_4>5\|Y<«tBr<Ҵu3'~.MM <-k_%=$4 vi-fSGtF+PnBBp]4m/VHcc=`k$I:#飯ʶm[Y4\.׈?+K$8b{,3~/_bK ¹=>vȩL丹39 dYEZ^Ϟ@GHtDE$k6|Oy j �ar9jz::i!WP?a b#L5N7UuK}r`&'4|$IW^L}|r}ټyJ%Dqe.H$K:dBpqSf===#2<#|kw/z:Y]Y]3^?e+T-gw, YbѼضcdjPp<x<8|ϞK3I,>�� �IDATy7r~GYVk\0LAhY& 4[m۸q#ee̝;oXŚL~_p:yx!k:`^rH$|k%I_w7mҥQVVvԮBzzz}ҋ|WiZPi3_@gz(8tﻫzu;>ɲL}M58s wtLHX8|-L=,8/׾xlF+{QID<2L|²H&'U5nBt d^ziӦ8lcIJ,bX(P(č7^_pžꪉD^Hyo$iR!mk֬ /BUQh4(2ʲj*3.}MwP]Px,SiMnjT:ͧ>v e%#,S]Y)',dTVQvT5٢L]p0e} 9T*=jjfOgk ,|6:^zMERdyFBiVΓseW_]s7nܰcZ$zE~S~A.#E0?T`׾ OuO?{Tr>S^^^܈#(;w#YT]xZP{uM#5"0LfϘ¥< ӲFM$E0LRi0zEBV$4UnW\x<..'.]P GSPF*|a,|ۈEBDB$zHRPl6o^ǟ~~J8˲{θq#fu /{ 6K..4:ذ,qR0ز=RZZi%`( --A\.'fjd]qŶ# --A=\X ]O.(搩l߾y=O>�Z4M3OlYXB씗_S:Nj`&5X_CJKKy8"#VFKF{Xe뀜(X|hV@NXjq8lۼ6g>=;}?x>^ّD v/˻(t.R~"볂"}))eY"[֭opqTTT$d2W_덞lڴ.0]]y,=λA=X!>)?ѓ$29kI=۴L4祡i__MIә9'B%^2͜6}lJ)ʹ9()�$dE!Jk5 Ǣە7DX%N>y1~?dx%Bp ױf͚Bۅ>]ǹ(.\N񍯓JF5Cb믿'?y y4 f.8?tfoZ-"J$}ɇY�vڪ*fMČ)(+-A��`wv躑#yv8]8.rD}h2ʽo>;#@VxaG!`j}@J90Rsƾ}ip0 OGGGqsCy>K M`´Y|Kr}<>}Z1uJ#1r@7M&1oڑ} 9~ldEqݹuJ{:fo&:ȲLSNn:?]imm% /7xyjnn+@UUUqъ>% 覡ρ*ƍ瞻M0$Nh`.pA.,I7ֿj8瞶 BY(/-y_xzv-'6ގ,+wIyeEu%O޲ڼkЯ[Bvڤ(K0BD[[[[qኀ>d)'Gma|?4ҩT?TUxGF$F`8.XΝw~˙-d´\ه $ݙ3<oSm̘6Sy[ BPS]H2#t?Pe%HT}-N7VVM]~<8VFS  ꫯeR_\"ġtaYʪw0i< V~CVXnuO0 :;; Eotuuq &P6Ffc_Vi>820E,/4>!y=Μ-O;۲(ߊλw$ַ{efS`G[I7ym6$=)IRMqՊ>ZYq{Ȋ?{;%y/(|˷K/ Y!d{Ŋ oW^3NcÆ (Rso݋A5́最k&XF_;͆yWҩ$"O J /}baպB!ZZZ)}xcD#\"ɶ \i˗_^y^F2W]q vbѩg[5Ao uJDyI`HuJ|\Na W.O=2M\^?W5j&5Bp8xgݺu8{Dfa,w{pŕ+B9 UE;?4.R}D˗kG=?rhmmY85 nݛ\r?Apde+=bд,DOOο\n'#yg4))cZF%sZ.ݑ!mϏ5 qu_~T #D<UUy~fQ$I!" ۆ we~t:@8ù6[>KPTg_eqe\*IHSx㍼kGlJȈD"޽H$2fso!raKs_墫g3t= [)tvP9ݒ$&֖x|̽(g$+)>Ȍ!koOf?1o;dR$;P] 8p`Յ4M{~?xD$;E@ha9Y좂ݮ/~Rj  ŎYbY/"er  (j[,>碂3͇axmoc^T cSEAe!Hy¾+ FִDNf<b|ʱ;醞#]8%.|WOGlxgYK8.{ gۃ9r"a?<^I\nKν!#4eYf8кy9VrpqGB=[ CXkW~?ɏٳgϠT"N嚛ƄFMʊ kسi&3N$F1:tt"D1zzI$d*ē$RiRt&t/FT;=h~عy@ſe,:uSggp:䟡5LAŸ:vl^yiF2dʗشiUUUL0q]1wF_-@Լ#y7}MQFhȰU@÷v T0kT"浯,ˆo>n#Z!8dd2I("߷L&뮻RpxU7쒏#+ʨzMs()0eY4Mz $I #fMQ%膉aL_Gey) $MTJ4QEb OEJ fg´Ȋ5}xHHD#�fGݝ_M{뾜C]k qn,[v_8E2=Mgg'p \`&I',T.M9a)+|$Y*+RN@W5;6-_MF۹Ꮋٴm<_[o] A{{;n)ٿ+Vp# `quOh2 HOeU5H2 _++ [ws1FaE$,gi $H?NB(D]7KF Mr:)+ PSUzO@c} %~N]CA`YCi*ar~__ ?(¡A &/'~׿iyǴf gy_^M7K1_aAN'c~Kkk+_ʗy'2BdY̋>)\eJJdY,bTЇ"T% @k4^M-?~m<|ʚϡJUUeŊ~[n"  `$ 4  p8p\\#Vw8kW=gz)lٌ-Bew)_j ώTLCgY0�Mmꦬ$9 YPw:`vGN$ 2ȊatUݡ]ٰ˲4ʲRkX_Ô LĆzF2&LbY;^CîN{5_Miy=²p=(B$]B\tL>z DUվ93 7d21l`ed2IKK ۍuFɣAV\ɝw~R-^Ϲ40 I9V^"%؋>(O͑$y $1uB>?4AA0 {X' �P6v5O~t:WK,h?*f@755qw/ %` >;8}N'YYVo'8}rRiV^6ư5hKv^$e8~,;q8YD5ۿ<9<5ĢOclYvtzHktG[˓|\p|t:Ae\.@Cb mˮ ?U=/w'^_ >Xw67~TE@Ԝ( Z,(I=~ 7݂}l6XÃ|RSSIuzV{<n7 H-"az~_u 5,N<\>tPladGn/O=�y'8r !W]W|IbXq,cZiv^Y[; v* )cI*HPˁja&z9  Lĩy)G".CY$lڕdœztLu4M+/p8 9UU \Gtw|UQzޥ}peY 0E*=HOz3㚛F21<z'k ]/xI .� ,4=nGUU4MfeZF! X~/?ؼy3 A0tl6',/c⌹XG9-= sN 3MqUNnDucі kJ8e}voޮilGG5[> SIμ .ҩW2' cƠjݝX'K$|G*dN>y1 ,dREN#^RUηG"ay~_Դ`J4 |%}ɕ,\|&"=;]/ PD"k.$\ /B"3` J, ˌ3'aŤ飂3:dWU>}VgC:/2=W֮]K[~h{Uδqq v=빷T^Y~JreaSl>7S'QVU"QkaƷhi=@2F7 rfio<TȲL'΂ŧsu/);bgHdO왶,faZfzKM(++g̙\zet ȲfCUU\.N=˹#DzOdϞݘ9(rIE5泌HIYŀ#!v|x|9 ;o_"R}HR__~50\9O{Yiom|!+ 4ill䪫3\{GGy˲ƍyxDet2r.z|ѱD"w~Mk^.X<)IT ]7) N H$ff\NLjAuoLWPZR LNFD"RTHIxOE͕78\GV#'r(l&ww MTVVql2&L-8{;͆nti /A;NJ,GeVX/hnny7܊ҊB|l.ON ^TD"C]tFio ><{k; |e 4MR^%KpI'3yd4 ]GR3{6 H$ŢtvvʎY~ׯ##Iv}XKư1OƢS椳pVm<oұUU Gv  1d,ax>+b<П@$spS'_B}sM-}{6ҳaz:Myu-g^QN<D(|ϧN J& >6UEOYsl\{,sXkYdM%KNeΜ9444P^^Get]޽Bʲ%}~VOd00M9M !`׮]< CjBQlLS8�<Q!,ҩ^u.ګ ^D"$\[Ţ%gJ5sӼ ܳ`̡0 dYSYYE]]SLeܹL8r\.W_nNepPQUxP(D[~oζmhiim?! CGF.D39Գh</eG%W}*@> ގzypEQ89444R^^rE@bzx<v'RVV4-|XF"+Ȋۭ& A$=N|LsT" $ zZ kfxYvoߌMQdj[fj9s& .rt= ޙYlJra--AV~_[Ғ>(ʐ"kit{83kb4MWZVW O/Ұ&+3HKpT<g>?8sdYuq'3y\|oCVY,#Դ^x˲픔R[[Ì3>}:55|>~?N"?\N;JCOOX.ˮ];پ};FFr}˦PZ<.}J4N.7}wUhѣ$h4JYY97tKaϐge9WOg&L3ڿKRL�]Oud"iY(tQVY͌y'2s1iNQv<ց?zp;"ahAB`N`悓״O<Dpa}tnyx晧TWWh,\zq=| ٲ6vj_d7hmm%Nt7 Ʃ5lW 3H;HvT!*BUЇ".eYx|Q-r<\qmڹ<޺9hY�%I`ªUHȲnwi*vK$p"I67əĉ{ukҲ @Uվ\Be<^?{?\J+I'm~ׁ|s_aOjA]]=w>}:D7XϬ ˲LWW�k…Ԍ"�� �IDAT| D'Ig)2MLBjA"AOS)Tw+@ NX8Nge1~t>siں; w L{ {[6uN'^ &MDCC%|><NM0 !E ̤H$B8foFSSDѾᴍfpI(Ig~㖜hv;@Gevd"׾(6C%y\kܾt*I\wc[Xڋ}9]4mEcYl ,1MD < ,`Qq{|4NɌ'1aL'LtakoIvNYv1;mײqܲt:flȲrPM19s?~<]]]ydzB>K,X /g&) wubF/O-IXWReG l6@YTDT">>4I& f0~ gvnYη7plUE%Iî]M}QUPUbCT'IRPaA*Jz tiO_d#7# , ЩSfd"3_�Ű2p"ݹD(JЇ OrkO5 fCW ?FG[f47P{MV-pSm*gp2m"%zLKZ}{Lb)(y'.eI:MoouѲg'Pb- PZeoSPϛٳD$8/�h/޺dzεfn_<�hvfxCRށ66?Tf/:dVh A0 �ȤF;.%UrZp6 SQDJt8Z$(E@m(Ą.YFzAE(>}kWNpNzS}2*J&'t{ϼNcEWbYfWz߽EX#c̔4!eӑa V/ ʨ[|9y7<NR4444 >X$3HHhhJ%IB츽>.7ae`yUҊ*R$=L`g\q\N:_i&"NRDhqmmN*Yts-At IӍI!v<6!"}p)/$)פ5MPv8һ`ni,8t:ZiںݹֽMD#!t='Wd0=k^K f/PJUmյTՎa5'+)ʠ4$+ wJ$z+eL QfM%P˲Xp!̞=d2AfG"$ٝ=;(iv&He^)J&⤒!1elCդSI:Zhݳ}ikˁ^8eʰe5z'AJ>&S7q*SfR7aJk':Ép0qӻi^!Iv НvW: &󗖳p?4==tg߮m޶7EI%VdaDglD6+Nn75h2:'q8hv6Uv@oFDH 4{]:+͖]:bORs̡23aӴ%otP$2v;J۲LʪơivW4߯ RP5;.I:'t;ƍWQ^YCeu-[NN%hkeoYG{kda d7E߲i +6|&͜ǔ W?ӅeL-hv^YBp5 !"<Tse n'R]pq8ݔTT1e|$)p7-vF˞m"&LdGt&k"z eƪvNյTS1jʫk*^?"ZXn�J$E1gx:B=Bn7} ;mBzzrr?b2x²(9 -%Qˍ!LH }"bt?hv݁Ws8+$AZdη9вhT2ZsFMIR_@<*3y<&Lb\]7_ BXVޔe/܌n#1@sR!'r2W'w-ЛuyL�I2zou2'JfBz:՛()EU3<f<Ӊr#J2$"Oΐ W-aLL&SɾB7!j&=IAQza0}J\!=k{ <˃ۻxcAmw8;N2GO0t=j K/d*3[Q]KU]'=0hHw'v".(Dt2I*Ȅ T[G$weEAe*UUæhv'NӅ PVAiyr|lJaFHSN'NWf'e) ًڤC!4 ǗQz rL� rty9R^{/Ց,[ٛs6upwGV$p8w^fQR2VTT u!BGG3 dDkktyX~LJ$Ia\ TrDneaә +624N nX|a`Y4fͰG;ȊׯnCٰT;7F˴ѦHR ˝Pl}5Q4oʴsZzIwzI:鐅` lDTDPF>W qAEq!lAL K;wm3Jz~~Ztu5ԩ=}߰�4>$熅Źe]=kbhnj XIQP0$:;;FG{{[84`͠UT eq"]o2߻AjZ8VH%H!IC_{ޘ"<펷\t?xRCK1 E Rk :}||n,Z? ,}O&jyb%0L jB)%ri طdb[6W޳c\0UPkjh�sVOkշ4HR.ҩR ?eS\1> ˝˲bmdHER >=PR^ "2iK*@SIΩ@{Q҂1A޺JcZkClll@*S[ W4VxQ !$""X=vߙlOUZN4 iQM9X)wMCXϴ0NAPW=EyE%\N&wl00~ F I:qc]3WTT tء=`˖- aZ;bY6bE1pU* /}: s]vwv__aGl:_mPb:/9 |.-w RePG{.̅67M%8s"t%%XQ\z{7hrw_>P-¢#Wz]Ķ3y\l+Uy#B\!%a5~Sǵ[̆'1 !aNiN;[GT;wΝ;P]] x'q߇MMiӫ(--#DN4ں6N~xE1YbėSѷ~//ZG8e0x?D9?k VREL upecZjQVV#߅;oq? Y#PV1_rŤ*W1-B3Q-~PnC:Pk_Mdo}UHTvB`MXy"[6 w=}XU}vRg)!L :]yN0 M "N=Q^Y(™LwԴx 4Ɩj z!.W_hhm{;,2D&]mv0!$~HkX0-7%d*>|࿻]ss0ކ/}GII :::}mmBh,9˳>K./؟ .OW"?M#ԡe4=l3!ȭ[E iEHaL3ο?}D*ƒ ojkqir6oޜh)%˱k.߈;vg>VaXw5L;!$5א!;6(}<aZD ő)[ה¢e+pEw~N$ `}͚'?e|***ّt!|wm+W2$zJpɿ�4ŜL:ׄ@LJH Ϯؐ)g_ю?(U!nmn7wtE"1<C/i%GĹo{NCz�(pͫ-+:fa$dH&�f#"{aEd򥨍7͸K߄4b<0 sZ s!D*;K^!&)ζx-)~HbNTѥg:ttw5Rƃ&[#f/5NkHi}ˏ=]06o\ vG,!DX:D:¼%xw]2<&SiFE`ȝ~Sh4NB B7f,Z3oO }p1D"\RʀeN544L:L: ǝ|&N:|_x/D$Ǎ, w#]cRt褠 4y /-G]RסiNl޸VRI(׃.R´lD151~ j1J�** M,+C(Q%gJ+DKJySHB4G4^t2oV@&ts[+w M\& xi ˂<9]FłeRK褐xv"EMk ˉ@)SPuRBHo~a~l=x^#dܢd",UXXJR=/"Z)Dc%P )`aG0ptZ9vO#K#_ڥ!=?aeX.BI ) Ä0ByJiC�@u6"!L(2_8Sҝ!hC!S%JBKkAA5B᷌_B CkSϟrB v!YE`�w(yO, !< (P`]Hba"B2QFxSk :=/:P$LBB!C9IAO4_WBȗ!$uwK i0CBPu*(SxMg9B&^r'C%:!L9J! HIA')?sBABHחBD!`HپcPJ8% z 6ƏBD;tF!z!g~7a�04O2rOH! r CˈŨG/K#VF.H` PsWױc!y NS!Zk#el_^U#=F}?烢 IRaϓHȤdpL:L&7B&} dy<W<ׅ\x\/'MyPy, m)M:oLÂ4M#ղm ˴a:,ӆ88(HN$h4;E$BCE6x]zfL γq8 zfk�0{_!J"N!J"J!N!N9\DSRRsBD&B:5I_: IC+5ҙ{ȁ!` هv.~6czpb;|.�y p#)C}ȥ}ʳ"˲`G"HDDcp"Q8(H hhhV$v﷝H7B1݀癰Y0q0M!)k!}&Yǖ}M@`}ݝB_Oۅ.vc}Hu]ͺ.<7uY;1Ԭ@ _�燽6hO!@210r0*\?iFL5"b`Z-RWe(-DٜJUTb.H JyPZA+ Tq@5`6ցwFDA_R f9 J ]-lkAg[+:Zٞ}ւάw0GJLi<? l4%=h#8CEM-Vܚ[;Uuya&L*qCC,b=pMy釘 MlN%Ӎ6tw =}]</{+SXN!fg$hܳ 圹RW˶Q>U([5DQ= mgX8_ Ʉ!桳:=tℤiWS'?(0J&ޜumjoAW{z:ۑCb`�D?þPJ4ۉI$>0�tv@o۔j@ !/A4G4^h%e娨Ee<TVܚ3R~X_yKX&Kö t>x~;;;9qt8ظE}h߀!gPLY&?A=ktH z,X /%Qpz<t ?mrN8\wmll@hij@ˁF475 eAB;d= ~j`&ms~8 u0~1/ZDea)~X]oBrlFȺKqpEuB+7$s}}ho;ζEtu=@Og;v-rfZ -vp?6>J)Ns1gn T_+硪U6F]i&_ +T`/Y7L$zgf4ގѸ{;z:dϱ"<&dR?ưV6iY,e#~QX,Xlϊh`� a[ )m4náa`T va-ػ}3nߌ\8ӳ)5GX|k& 1.45`ݚGӴ8r Xv _4af Lz5&K)Db1@@3f`nٮnR</{sw6m\g aHwm};6my☿h)/ƼQ55QY=h,/Z| x)Ѓ ߓ#ﲽLvnŞ[w&4ۍ>$G*od]m; wVֽ߽AC##VRxijac0ob(W^qkhP&̦ <Cl<[^֗cKkg:d2́ IݑBwG‹>h9XyXyXc!1(E(ێt7MGCAPjDݝDˁFپ{m¾[f20L0s!gu$G~vdűXvXt1[jD%|!J�Sg)@`I 0~B0LvmǮbMh=䧋 9ПK 3Y !d2}q-`禍ʪZTTb^b,[q\y"J+r[ܵR#hzTKC+B!% i L`Ocke ~SOxM>y]'\7fwʙDPʛVaR@`aH:ṵq0-#?p8��IDAT[-M 90vw`�l!dX svnڀ3qgb1'lebeg5X˝>y/ H`ؽ4ށvy>if!d -`DXx2,X<K9Up]N^a&t6smoEABS8%;6T2n3|NZ)۵ vmź5v"Xd9N9B|* LkWZ!A,oIAt}A! u�x2 �+!uxusFc8soGUm,džĈ>dzc zńr(,L?G<pr8,9X,: (3뾎2v !NP&O`TB!OZ`<#TVa7Zt2韷6ˉ 2ɣy#!w)Izp?Z4⯏=y ‹߇Ǿ2HfnO]Bĸw! l܋n⤳ނ'KylְQeik `]B8jݏgW?#aIG S�a wa^0NAw`EB$$aT{;6ݏS{Dƴ{5dxT]kyČBRH?b<thij繐Y! )EXН=߆@!Seـx? 'W-Zc}<Cb3tBreHx5زop1CN6}�\Dֈb0 f♳릃B- k9RtB ڴEk�4MOR:+ॸx)BHNӂmGsgB0NA'R] sB)z,Gнo BH w}BR�8(J)(`Z8"(,?2t]DHӐRBʉۓks%8#(ǁ4 (NH Rw"d1  :!<w<8\ u/րHOcsC}j 6BghL&Q6gN;LMo’2J=p@a]7˯YplgB73! `cBA'p(JpYgᓟ$Vjc/� /;< >S?0^cVJm\Ჷ랃񗧀S wk `[8kn5)0pƗͯkSAȡ?+CϥQ�]x…uo(L?QE72`Yx3iX˖#oGcCØ CP8g~:>Gpsm 7?=Wkއ_cL TJy-lj:BAiwJ)\c'}? a�a䜷シ'ྟB])yqH'H D yK* އg/a2ywpTF2SJSLK);Gj*Nm,pΡ 齻amxy&=WΝk{yϟ5HP=�iB{_D}s.MhL$e&&Oyn.+I)uW__ Ger! d, Ӹ |܀1vK,? ;H?B�B cO][%& u(LL]v>\W}?&J;nÕ%H)u~[?Ԇ�c@*,ɥæs<(L T ww; =B'Qtґ+6?a?p/2^' -ͨ}gm(yrG<yX4TT/|*8* CMm-wdkxg%HVlxf$IN2;Qh d U5%T[Ĝс??۾|KL]/"+O`L'igfNSU]Y 15OF~ "rj~wD�%&̟_r1+ɑ v:Q !d>z"t�˹ĺƒqT熛vQwjj,#2a^NA'djQJm s+H ȩζ-,Xh. *!a`ڷy/fNv±<G' P Zw^S[s=v2ͻqG3}^>칠vQ :<ʕ{fo*p;E 8!DR!7L/^hkՆB'Q1) u3dښZ*4+A)ne`{U2k`a :!S+iB(5;3�)N&C@A'd*]ҩ;N8lV,szriky! 10k;> u tuu1N&HւhȤ ޽{c!ή$ :O} C&0yf�zf9vl j:==ps--h>Ø돆eņ -:}gD\sϽ˩ksn+N&Lfip=, nV aU`^D/C`L l*mHaA�!e~8catXIa؋SOUj*x0Esa2ae)L=}}}?#daΊZ k^u'rh)#d?dRU΃ݬU / =xÝP8(SW2K~6Ai5V+[߉HQ2s Tp9dV?(>_gnBCKqۗtd"i. Lek_/,Vԩ&E+nlxq m :!3V̌sLj{pG:N&!4Ctns+BFx)\~-[Ŗmj'NsrQwz;LpέE(KrJ{ȫ_ɌXB~�JqdJwRq>:s�_ IDb :!eYxiK?>L"y XPb㺺81E&u\ ±R>[[Nyn~Q<4PbI£ŏ\{+,Imy+�<t2=.n-8vEEsTlg?g{bN}&6D',m?#<5 ~r WGWܜ zA,\A]]meup-.; )0ok�Ҹ%|#eY|$/}|`)�~4ª5Pbxe{F~>S7GOZT09Jgws?/|;cL:=N> z:! aH&gngNGʝ4Jm|x7E$¬!B(腧 s[|jybHHOPS(poC# B Y5+ő7܈OƯ=䟮 xg.[O3�֮{avB(mPIa9h4;xO_^=HqUn/سw/Ŝ z`j)LxGԄIl[�ck^ :>uלL+2εC@[N 0~z\oiW/9ҐyByU bsk.۠BA/m+zw= /t}\s78Ŝb(++B\`:7tO?4 k!O|8Spe q? 7PIAFo~#C> ?]7^)k +-qpu?W}}8x Ŝ z*+ő"Ķmʫ#3RcoAɜظBnÊ=<Otҩ4Ŝ ɬeCs9gHȥDOO/֬y FhҎ־p U+_O>sRy.ro6f$L[W1RdCap^^ZW҈oTBN3t2CW^e_gzA<WAy Ǟ },<77 HpH1JJW�fȝ0H$ѣZ.J87"vt?nWk`69) 7ű CFfSZՏaËpwb'ݯ|RJ&?ؠۢgX̨hkk%\X,q8(Pg֏2Nf[wbNxchR;@QwB)t5cBA"}23B#BA (EN!E( ~wuB)4FFBA40-BC9tNB)%ZMNAdXȝBH˻MA@)EwN!Ey+,B)jLArC!w^#b0bNA(B ܑ~ 7},#x)B>} ٜ6wCHiZyC!&t X\s!] z;!z1qxN!*s/GoBHш< P !FA!h:8 0r^#9.tB!^S SC8B)(PX/B!N!I&NA'Rtt2JACjqRC@Aσ]eT2`>Nig:!ІtK z^|J!d%}  z>tRvB sCB@A7 BHJz+ǀN!|ti ! ]k :='G :GB pQ)v|N!Ebwq (q1 0\I:QVIBKo z7%:!<]Rtp;G[r :1FkdPNAu{�H  Kk`>�+V{bB]k#` :NR!z-ˊr$HQR)ܿjil<0G$3f����IENDB`���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/instance_groups.go�����������������������������0000664�0000000�0000000�00000004602�13771713062�0026140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // InstanceGroup represents a group of VM type InstanceGroup struct { Account string `json:"account,omitempty" doc:"the account owning the instance group"` Created string `json:"created,omitempty" doc:"time and date the instance group was created"` ID *UUID `json:"id,omitempty" doc:"the id of the instance group"` Name string `json:"name,omitempty" doc:"the name of the instance group"` } // ListRequest builds the ListInstanceGroups request func (ig InstanceGroup) ListRequest() (ListCommand, error) { req := &ListInstanceGroups{ ID: ig.ID, Name: ig.Name, } return req, nil } // CreateInstanceGroup creates a VM group type CreateInstanceGroup struct { Name string `json:"name" doc:"the name of the instance group"` _ bool `name:"createInstanceGroup" description:"Creates a vm group"` } // Response returns the struct to unmarshal func (CreateInstanceGroup) Response() interface{} { return new(InstanceGroup) } // UpdateInstanceGroup updates a VM group type UpdateInstanceGroup struct { ID *UUID `json:"id" doc:"Instance group ID"` Name string `json:"name,omitempty" doc:"new instance group name"` _ bool `name:"updateInstanceGroup" description:"Updates a vm group"` } // Response returns the struct to unmarshal func (UpdateInstanceGroup) Response() interface{} { return new(InstanceGroup) } // DeleteInstanceGroup deletes a VM group type DeleteInstanceGroup struct { ID *UUID `json:"id" doc:"the ID of the instance group"` _ bool `name:"deleteInstanceGroup" description:"Deletes a vm group"` } // Response returns the struct to unmarshal func (DeleteInstanceGroup) Response() interface{} { return new(BooleanResponse) } //go:generate go run generate/main.go -interface=Listable ListInstanceGroups // ListInstanceGroups lists VM groups type ListInstanceGroups struct { ID *UUID `json:"id,omitempty" doc:"List instance groups by ID"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"List instance groups by name"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` _ bool `name:"listInstanceGroups" description:"Lists vm groups"` } // ListInstanceGroupsResponse represents a list of instance groups type ListInstanceGroupsResponse struct { Count int `json:"count"` InstanceGroup []InstanceGroup `json:"instancegroup"` } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/instancegroups_response.go���������������������0000664�0000000�0000000�00000002007�13771713062�0027714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListInstanceGroups) Response() interface{} { return new(ListInstanceGroupsResponse) } // ListRequest returns itself func (ls *ListInstanceGroups) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListInstanceGroups) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListInstanceGroups) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListInstanceGroups) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListInstanceGroupsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListInstanceGroupsResponse was expected, got %T", resp)) return } for i := range items.InstanceGroup { if !callback(&items.InstanceGroup[i], nil) { break } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/isos.go����������������������������������������0000664�0000000�0000000�00000007511�13771713062�0023714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // ISO represents an attachable ISO disc type ISO Template // ResourceType returns the type of the resource func (ISO) ResourceType() string { return "ISO" } // ListRequest produces the ListIsos command. func (iso ISO) ListRequest() (ListCommand, error) { req := &ListISOs{ ID: iso.ID, Name: iso.Name, ZoneID: iso.ZoneID, } if iso.Bootable { *req.Bootable = true } if iso.IsFeatured { req.IsoFilter = "featured" } if iso.IsPublic { *req.IsPublic = true } if iso.IsReady { *req.IsReady = true } for i := range iso.Tags { req.Tags = append(req.Tags, iso.Tags[i]) } return req, nil } //go:generate go run generate/main.go -interface=Listable ListISOs // ListISOs represents the list all available ISO files request type ListISOs struct { _ bool `name:"listIsos" description:"Lists all available ISO files."` Bootable *bool `json:"bootable,omitempty" doc:"True if the ISO is bootable, false otherwise"` ID *UUID `json:"id,omitempty" doc:"List ISO by id"` IsoFilter string `json:"isofilter,omitempty" doc:"Possible values are \"featured\", \"self\", \"selfexecutable\",\"sharedexecutable\",\"executable\", and \"community\". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured. * all : all templates (only usable by admins)."` IsPublic *bool `json:"ispublic,omitempty" doc:"True if the ISO is publicly available to all users, false otherwise."` IsReady *bool `json:"isready,omitempty" doc:"True if this ISO is ready to be deployed"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"List all isos by name"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` ShowRemoved *bool `json:"showremoved,omitempty" doc:"Show removed ISOs as well"` Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"` ZoneID *UUID `json:"zoneid,omitempty" doc:"The ID of the zone"` } // ListISOsResponse represents a list of ISO files type ListISOsResponse struct { Count int `json:"count"` ISO []ISO `json:"iso"` } // AttachISO represents the request to attach an ISO to a virtual machine. type AttachISO struct { _ bool `name:"attachIso" description:"Attaches an ISO to a virtual machine."` ID *UUID `json:"id" doc:"the ID of the ISO file"` VirtualMachineID *UUID `json:"virtualmachineid" doc:"the ID of the virtual machine"` } // Response returns the struct to unmarshal func (AttachISO) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (AttachISO) AsyncResponse() interface{} { return new(VirtualMachine) } // DetachISO represents the request to detach an ISO to a virtual machine. type DetachISO struct { _ bool `name:"detachIso" description:"Detaches any ISO file (if any) currently attached to a virtual machine."` VirtualMachineID *UUID `json:"virtualmachineid" doc:"The ID of the virtual machine"` } // Response returns the struct to unmarshal func (DetachISO) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DetachISO) AsyncResponse() interface{} { return new(VirtualMachine) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/isos_response.go�������������������������������0000664�0000000�0000000�00000001643�13771713062�0025632�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListISOs) Response() interface{} { return new(ListISOsResponse) } // ListRequest returns itself func (ls *ListISOs) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListISOs) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListISOs) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListISOs) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListISOsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListISOsResponse was expected, got %T", resp)) return } for i := range items.ISO { if !callback(&items.ISO[i], nil) { break } } } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/jobstatustype_string.go������������������������0000664�0000000�0000000�00000000717�13771713062�0027246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "stringer -type JobStatusType"; DO NOT EDIT. package egoscale import "strconv" const _JobStatusType_name = "PendingSuccessFailure" var _JobStatusType_index = [...]uint8{0, 7, 14, 21} func (i JobStatusType) String() string { if i < 0 || i >= JobStatusType(len(_JobStatusType_index)-1) { return "JobStatusType(" + strconv.FormatInt(int64(i), 10) + ")" } return _JobStatusType_name[_JobStatusType_index[i]:_JobStatusType_index[i+1]] } �������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/macaddress.go����������������������������������0000664�0000000�0000000�00000002435�13771713062�0025045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "encoding/json" "fmt" "net" ) // MACAddress is a nicely JSON serializable net.HardwareAddr type MACAddress net.HardwareAddr // String returns the MAC address in standard format func (mac MACAddress) String() string { return (net.HardwareAddr)(mac).String() } // MAC48 builds a MAC-48 MACAddress func MAC48(a, b, c, d, e, f byte) MACAddress { m := make(MACAddress, 6) m[0] = a m[1] = b m[2] = c m[3] = d m[4] = e m[5] = f return m } // UnmarshalJSON unmarshals the raw JSON into the MAC address func (mac *MACAddress) UnmarshalJSON(b []byte) error { var addr string if err := json.Unmarshal(b, &addr); err != nil { return err } hw, err := ParseMAC(addr) if err != nil { return err } *mac = make(MACAddress, 6) copy(*mac, hw) return nil } // MarshalJSON converts the MAC Address to a string representation func (mac MACAddress) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf("%q", mac.String())), nil } // ParseMAC converts a string into a MACAddress func ParseMAC(s string) (MACAddress, error) { hw, err := net.ParseMAC(s) return (MACAddress)(hw), err } // MustParseMAC acts like ParseMAC but panics if in case of an error func MustParseMAC(s string) MACAddress { mac, err := ParseMAC(s) if err != nil { panic(err) } return mac } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/network_offerings.go���������������������������0000664�0000000�0000000�00000016412�13771713062�0026472�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // NetworkOffering corresponds to the Compute Offerings type NetworkOffering struct { Availability string `json:"availability,omitempty" doc:"availability of the network offering"` ConserveMode bool `json:"conservemode,omitempty" doc:"true if network offering is ip conserve mode enabled"` Created string `json:"created,omitempty" doc:"the date this network offering was created"` Details map[string]string `json:"details,omitempty" doc:"additional key/value details tied with network offering"` DisplayText string `json:"displaytext,omitempty" doc:"an alternate display text of the network offering."` EgressDefaultPolicy bool `json:"egressdefaultpolicy,omitempty" doc:"true if guest network default egress policy is allow; false if default egress policy is deny"` GuestIPType string `json:"guestiptype,omitempty" doc:"guest type of the network offering, can be Shared or Isolated"` ID *UUID `json:"id,omitempty" doc:"the id of the network offering"` IsDefault bool `json:"isdefault,omitempty" doc:"true if network offering is default, false otherwise"` IsPersistent bool `json:"ispersistent,omitempty" doc:"true if network offering supports persistent networks, false otherwise"` MaxConnections int `json:"maxconnections,omitempty" doc:"maximum number of concurrents connections to be handled by lb"` Name string `json:"name,omitempty" doc:"the name of the network offering"` NetworkRate int `json:"networkrate,omitempty" doc:"data transfer rate in megabits per second allowed."` Service []Service `json:"service,omitempty" doc:"the list of supported services"` ServiceOfferingID *UUID `json:"serviceofferingid,omitempty" doc:"the ID of the service offering used by virtual router provider"` SpecifyIPRanges bool `json:"specifyipranges,omitempty" doc:"true if network offering supports specifying ip ranges, false otherwise"` SpecifyVlan bool `json:"specifyvlan,omitempty" doc:"true if network offering supports vlans, false otherwise"` State string `json:"state,omitempty" doc:"state of the network offering. Can be Disabled/Enabled/Inactive"` SupportsStrechedL2Subnet bool `json:"supportsstrechedl2subnet,omitempty" doc:"true if network offering supports network that span multiple zones"` Tags string `json:"tags,omitempty" doc:"the tags for the network offering"` TrafficType string `json:"traffictype,omitempty" doc:"the traffic type for the network offering, supported types are Public, Management, Control, Guest, Vlan or Storage."` } // ListRequest builds the ListNetworkOfferings request // // This doesn't take into account the IsDefault flag as the default value is true. func (no NetworkOffering) ListRequest() (ListCommand, error) { req := &ListNetworkOfferings{ Availability: no.Availability, ID: no.ID, Name: no.Name, State: no.State, TrafficType: no.TrafficType, } return req, nil } //go:generate go run generate/main.go -interface=Listable ListNetworkOfferings // ListNetworkOfferings represents a query for network offerings type ListNetworkOfferings struct { Availability string `json:"availability,omitempty" doc:"the availability of network offering. Default value is Required"` DisplayText string `json:"displaytext,omitempty" doc:"list network offerings by display text"` GuestIPType string `json:"guestiptype,omitempty" doc:"list network offerings by guest type: Shared or Isolated"` ID *UUID `json:"id,omitempty" doc:"list network offerings by id"` IsDefault *bool `json:"isdefault,omitempty" doc:"true if need to list only default network offerings. Default value is false"` IsTagged *bool `json:"istagged,omitempty" doc:"true if offering has tags specified"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"list network offerings by name"` NetworkID *UUID `json:"networkid,omitempty" doc:"the ID of the network. Pass this in if you want to see the available network offering that a network can be changed to."` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` SourceNATSupported *bool `json:"sourcenatsupported,omitempty" doc:"true if need to list only netwok offerings where source nat is supported, false otherwise"` SpecifyIPRanges *bool `json:"specifyipranges,omitempty" doc:"true if need to list only network offerings which support specifying ip ranges"` SpecifyVlan *bool `json:"specifyvlan,omitempty" doc:"the tags for the network offering."` State string `json:"state,omitempty" doc:"list network offerings by state"` SupportedServices []Service `json:"supportedservices,omitempty" doc:"list network offerings supporting certain services"` Tags string `json:"tags,omitempty" doc:"list network offerings by tags"` TrafficType string `json:"traffictype,omitempty" doc:"list by traffic type"` ZoneID *UUID `json:"zoneid,omitempty" doc:"list network offerings available for network creation in specific zone"` _ bool `name:"listNetworkOfferings" description:"Lists all available network offerings."` } // ListNetworkOfferingsResponse represents a list of service offerings type ListNetworkOfferingsResponse struct { Count int `json:"count"` NetworkOffering []NetworkOffering `json:"networkoffering"` } // UpdateNetworkOffering represents a modification of a network offering type UpdateNetworkOffering struct { Availability string `json:"availability,omitempty" doc:"the availability of network offering. Default value is Required for Guest Virtual network offering; Optional for Guest Direct network offering"` DisplayText string `json:"displaytext,omitempty" doc:"the display text of the network offering"` ID *UUID `json:"id,omitempty" doc:"the id of the network offering"` KeepAliveEnabled *bool `json:"keepaliveenabled,omitempty" doc:"if true keepalive will be turned on in the loadbalancer. At the time of writing this has only an effect on haproxy; the mode http and httpclose options are unset in the haproxy conf file."` MaxConnections int `json:"maxconnections,omitempty" doc:"maximum number of concurrent connections supported by the network offering"` Name string `json:"name,omitempty" doc:"the name of the network offering"` SortKey int `json:"sortkey,omitempty" doc:"sort key of the network offering, integer"` State string `json:"state,omitempty" doc:"update state for the network offering"` _ bool `name:"updateNetworkOffering" description:"Updates a network offering."` } // Response returns the struct to unmarshal func (UpdateNetworkOffering) Response() interface{} { return new(NetworkOffering) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/networkofferings_response.go�������������������0000664�0000000�0000000�00000002033�13771713062�0030243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListNetworkOfferings) Response() interface{} { return new(ListNetworkOfferingsResponse) } // ListRequest returns itself func (ls *ListNetworkOfferings) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListNetworkOfferings) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListNetworkOfferings) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListNetworkOfferings) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListNetworkOfferingsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListNetworkOfferingsResponse was expected, got %T", resp)) return } for i := range items.NetworkOffering { if !callback(&items.NetworkOffering[i], nil) { break } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/networks.go������������������������������������0000664�0000000�0000000�00000034004�13771713062�0024610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "net" "net/url" ) // Network represents a network // // See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/networking_and_traffic.html type Network struct { Account string `json:"account,omitempty" doc:"the owner of the network"` AccountID *UUID `json:"accountid,omitempty" doc:"the owner ID of the network"` BroadcastDomainType string `json:"broadcastdomaintype,omitempty" doc:"Broadcast domain type of the network"` BroadcastURI string `json:"broadcasturi,omitempty" doc:"broadcast uri of the network."` CanUseForDeploy bool `json:"canusefordeploy,omitempty" doc:"list networks available for vm deployment"` CIDR *CIDR `json:"cidr,omitempty" doc:"Cloudstack managed address space, all CloudStack managed VMs get IP address from CIDR"` DisplayText string `json:"displaytext,omitempty" doc:"the displaytext of the network"` DNS1 net.IP `json:"dns1,omitempty" doc:"the first DNS for the network"` DNS2 net.IP `json:"dns2,omitempty" doc:"the second DNS for the network"` EndIP net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. Required for managed networks."` Gateway net.IP `json:"gateway,omitempty" doc:"the network's gateway"` ID *UUID `json:"id,omitempty" doc:"the id of the network"` IP6CIDR *CIDR `json:"ip6cidr,omitempty" doc:"the cidr of IPv6 network"` IP6Gateway net.IP `json:"ip6gateway,omitempty" doc:"the gateway of IPv6 network"` IsDefault bool `json:"isdefault,omitempty" doc:"true if network is default, false otherwise"` IsPersistent bool `json:"ispersistent,omitempty" doc:"list networks that are persistent"` IsSystem bool `json:"issystem,omitempty" doc:"true if network is system, false otherwise"` Name string `json:"name,omitempty" doc:"the name of the network"` Netmask net.IP `json:"netmask,omitempty" doc:"the network's netmask"` NetworkCIDR *CIDR `json:"networkcidr,omitempty" doc:"the network CIDR of the guest network configured with IP reservation. It is the summation of CIDR and RESERVED_IP_RANGE"` NetworkDomain string `json:"networkdomain,omitempty" doc:"the network domain"` NetworkOfferingAvailability string `json:"networkofferingavailability,omitempty" doc:"availability of the network offering the network is created from"` NetworkOfferingConserveMode bool `json:"networkofferingconservemode,omitempty" doc:"true if network offering is ip conserve mode enabled"` NetworkOfferingDisplayText string `json:"networkofferingdisplaytext,omitempty" doc:"display text of the network offering the network is created from"` NetworkOfferingID *UUID `json:"networkofferingid,omitempty" doc:"network offering id the network is created from"` NetworkOfferingName string `json:"networkofferingname,omitempty" doc:"name of the network offering the network is created from"` PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"the physical network id"` Related string `json:"related,omitempty" doc:"related to what other network configuration"` ReservedIPRange string `json:"reservediprange,omitempty" doc:"the network's IP range not to be used by CloudStack guest VMs and can be used for non CloudStack purposes"` RestartRequired bool `json:"restartrequired,omitempty" doc:"true network requires restart"` Service []Service `json:"service,omitempty" doc:"the list of services"` SpecifyIPRanges bool `json:"specifyipranges,omitempty" doc:"true if network supports specifying ip ranges, false otherwise"` StartIP net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range. Required for managed networks."` State string `json:"state,omitempty" doc:"state of the network"` StrechedL2Subnet bool `json:"strechedl2subnet,omitempty" doc:"true if network can span multiple zones"` SubdomainAccess bool `json:"subdomainaccess,omitempty" doc:"true if users from subdomains can access the domain level network"` Tags []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with network"` TrafficType string `json:"traffictype,omitempty" doc:"the traffic type of the network"` Type string `json:"type,omitempty" doc:"the type of the network"` Vlan string `json:"vlan,omitemtpy" doc:"The vlan of the network. This parameter is visible to ROOT admins only"` ZoneID *UUID `json:"zoneid,omitempty" doc:"zone id of the network"` ZoneName string `json:"zonename,omitempty" doc:"the name of the zone the network belongs to"` ZonesNetworkSpans []Zone `json:"zonesnetworkspans,omitempty" doc:"If a network is enabled for 'streched l2 subnet' then represents zones on which network currently spans"` } // ListRequest builds the ListNetworks request func (network Network) ListRequest() (ListCommand, error) { //TODO add tags support req := &ListNetworks{ ID: network.ID, Keyword: network.Name, // this is a hack as listNetworks doesn't support to search by name. PhysicalNetworkID: network.PhysicalNetworkID, TrafficType: network.TrafficType, Type: network.Type, ZoneID: network.ZoneID, } if network.CanUseForDeploy { req.CanUseForDeploy = &network.CanUseForDeploy } if network.RestartRequired { req.RestartRequired = &network.RestartRequired } return req, nil } // ResourceType returns the type of the resource func (Network) ResourceType() string { return "Network" } // Service is a feature of a network type Service struct { Capability []ServiceCapability `json:"capability,omitempty"` Name string `json:"name"` Provider []ServiceProvider `json:"provider,omitempty"` } // ServiceCapability represents optional capability of a service type ServiceCapability struct { CanChooseServiceCapability bool `json:"canchooseservicecapability"` Name string `json:"name"` Value string `json:"value"` } // ServiceProvider represents the provider of the service type ServiceProvider struct { CanEnableIndividualService bool `json:"canenableindividualservice"` DestinationPhysicalNetworkID *UUID `json:"destinationphysicalnetworkid"` ID *UUID `json:"id"` Name string `json:"name"` PhysicalNetworkID *UUID `json:"physicalnetworkid"` ServiceList []string `json:"servicelist,omitempty"` } // CreateNetwork creates a network type CreateNetwork struct { DisplayText string `json:"displaytext,omitempty" doc:"the display text of the network"` // This field is required but might be empty EndIP net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. Required for managed networks."` EndIpv6 net.IP `json:"endipv6,omitempty" doc:"the ending IPv6 address in the IPv6 network range"` Gateway net.IP `json:"gateway,omitempty" doc:"the gateway of the network. Required for Shared networks and Isolated networks when it belongs to VPC"` IP6CIDR *CIDR `json:"ip6cidr,omitempty" doc:"the CIDR of IPv6 network, must be at least /64"` IP6Gateway net.IP `json:"ip6gateway,omitempty" doc:"the gateway of the IPv6 network. Required for Shared networks and Isolated networks when it belongs to VPC"` IsolatedPVlan string `json:"isolatedpvlan,omitempty" doc:"the isolated private vlan for this network"` Name string `json:"name,omitempty" doc:"the name of the network"` // This field is required but might be empty Netmask net.IP `json:"netmask,omitempty" doc:"the netmask of the network. Required for managed networks."` NetworkDomain string `json:"networkdomain,omitempty" doc:"network domain"` NetworkOfferingID *UUID `json:"networkofferingid" doc:"the network offering id"` PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"the Physical Network ID the network belongs to"` StartIP net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range. Required for managed networks."` StartIpv6 net.IP `json:"startipv6,omitempty" doc:"the beginning IPv6 address in the IPv6 network range"` Vlan string `json:"vlan,omitempty" doc:"the ID or VID of the network"` ZoneID *UUID `json:"zoneid" doc:"the Zone ID for the network"` _ bool `name:"createNetwork" description:"Creates a network"` } // Response returns the struct to unmarshal func (CreateNetwork) Response() interface{} { return new(Network) } func (req CreateNetwork) onBeforeSend(params url.Values) error { // Those fields are required but might be empty if req.Name == "" { params.Set("name", "") } if req.DisplayText == "" { params.Set("displaytext", "") } return nil } // UpdateNetwork (Async) updates a network type UpdateNetwork struct { _ bool `name:"updateNetwork" description:"Updates a network"` ChangeCIDR *bool `json:"changecidr,omitempty" doc:"Force update even if cidr type is different"` DisplayText string `json:"displaytext,omitempty" doc:"the new display text for the network"` EndIP net.IP `json:"endip,omitempty" doc:"the ending IP address in the network IP range. Required for managed networks."` GuestVMCIDR *CIDR `json:"guestvmcidr,omitempty" doc:"CIDR for Guest VMs,Cloudstack allocates IPs to Guest VMs only from this CIDR"` ID *UUID `json:"id" doc:"the ID of the network"` Name string `json:"name,omitempty" doc:"the new name for the network"` Netmask net.IP `json:"netmask,omitempty" doc:"the netmask of the network. Required for managed networks."` NetworkDomain string `json:"networkdomain,omitempty" doc:"network domain"` NetworkOfferingID *UUID `json:"networkofferingid,omitempty" doc:"network offering ID"` StartIP net.IP `json:"startip,omitempty" doc:"the beginning IP address in the network IP range. Required for managed networks."` } // Response returns the struct to unmarshal func (UpdateNetwork) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (UpdateNetwork) AsyncResponse() interface{} { return new(Network) } // RestartNetwork (Async) updates a network type RestartNetwork struct { ID *UUID `json:"id" doc:"The id of the network to restart."` Cleanup *bool `json:"cleanup,omitempty" doc:"If cleanup old network elements"` _ bool `name:"restartNetwork" description:"Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules"` } // Response returns the struct to unmarshal func (RestartNetwork) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RestartNetwork) AsyncResponse() interface{} { return new(Network) } // DeleteNetwork deletes a network type DeleteNetwork struct { ID *UUID `json:"id" doc:"the ID of the network"` Forced *bool `json:"forced,omitempty" doc:"Force delete a network. Network will be marked as 'Destroy' even when commands to shutdown and cleanup to the backend fails."` _ bool `name:"deleteNetwork" description:"Deletes a network"` } // Response returns the struct to unmarshal func (DeleteNetwork) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DeleteNetwork) AsyncResponse() interface{} { return new(BooleanResponse) } //go:generate go run generate/main.go -interface=Listable ListNetworks // ListNetworks represents a query to a network type ListNetworks struct { CanUseForDeploy *bool `json:"canusefordeploy,omitempty" doc:"List networks available for vm deployment"` ID *UUID `json:"id,omitempty" doc:"List networks by id"` IsSystem *bool `json:"issystem,omitempty" doc:"true If network is system, false otherwise"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` PhysicalNetworkID *UUID `json:"physicalnetworkid,omitempty" doc:"List networks by physical network id"` RestartRequired *bool `json:"restartrequired,omitempty" doc:"List networks by restartRequired"` SpecifyIPRanges *bool `json:"specifyipranges,omitempty" doc:"True if need to list only networks which support specifying ip ranges"` SupportedServices []Service `json:"supportedservices,omitempty" doc:"List networks supporting certain services"` Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"` TrafficType string `json:"traffictype,omitempty" doc:"Type of the traffic"` Type string `json:"type,omitempty" doc:"The type of the network. Supported values are: Isolated and Shared"` ZoneID *UUID `json:"zoneid,omitempty" doc:"The Zone ID of the network"` _ bool `name:"listNetworks" description:"Lists all available networks."` } // ListNetworksResponse represents the list of networks type ListNetworksResponse struct { Count int `json:"count"` Network []Network `json:"network"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/networks_response.go���������������������������0000664�0000000�0000000�00000001713�13771713062�0026527�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListNetworks) Response() interface{} { return new(ListNetworksResponse) } // ListRequest returns itself func (ls *ListNetworks) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListNetworks) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListNetworks) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListNetworks) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListNetworksResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListNetworksResponse was expected, got %T", resp)) return } for i := range items.Network { if !callback(&items.Network[i], nil) { break } } } �����������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/nics.go����������������������������������������0000664�0000000�0000000�00000012631�13771713062�0023672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "net" ) // Nic represents a Network Interface Controller (NIC) // // See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/networking_and_traffic.html#configuring-multiple-ip-addresses-on-a-single-nic type Nic struct { BroadcastURI string `json:"broadcasturi,omitempty" doc:"the broadcast uri of the nic"` DeviceID *UUID `json:"deviceid,omitempty" doc:"device id for the network when plugged into the virtual machine"` Gateway net.IP `json:"gateway,omitempty" doc:"the gateway of the nic"` ID *UUID `json:"id,omitempty" doc:"the ID of the nic"` IP6Address net.IP `json:"ip6address,omitempty" doc:"the IPv6 address of network"` IP6CIDR *CIDR `json:"ip6cidr,omitempty" doc:"the cidr of IPv6 network"` IP6Gateway net.IP `json:"ip6gateway,omitempty" doc:"the gateway of IPv6 network"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"the ip address of the nic"` IsDefault bool `json:"isdefault,omitempty" doc:"true if nic is default, false otherwise"` IsolationURI string `json:"isolationuri,omitempty" doc:"the isolation uri of the nic"` MACAddress MACAddress `json:"macaddress,omitempty" doc:"true if nic is default, false otherwise"` Netmask net.IP `json:"netmask,omitempty" doc:"the netmask of the nic"` NetworkID *UUID `json:"networkid,omitempty" doc:"the ID of the corresponding network"` NetworkName string `json:"networkname,omitempty" doc:"the name of the corresponding network"` ReverseDNS []ReverseDNS `json:"reversedns,omitempty" doc:"the list of PTR record(s) associated with the virtual machine"` SecondaryIP []NicSecondaryIP `json:"secondaryip,omitempty" doc:"the Secondary ipv4 addr of nic"` TrafficType string `json:"traffictype,omitempty" doc:"the traffic type of the nic"` Type string `json:"type,omitempty" doc:"the type of the nic"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"Id of the vm to which the nic belongs"` } // ListRequest build a ListNics request from the given Nic func (nic Nic) ListRequest() (ListCommand, error) { req := &ListNics{ VirtualMachineID: nic.VirtualMachineID, NicID: nic.ID, NetworkID: nic.NetworkID, } return req, nil } // NicSecondaryIP represents a link between NicID and IPAddress type NicSecondaryIP struct { ID *UUID `json:"id,omitempty" doc:"the ID of the secondary private IP addr"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"Secondary IP address"` NetworkID *UUID `json:"networkid,omitempty" doc:"the ID of the network"` NicID *UUID `json:"nicid,omitempty" doc:"the ID of the nic"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"the ID of the vm"` } //go:generate go run generate/main.go -interface=Listable ListNics // ListNics represents the NIC search type ListNics struct { Keyword string `json:"keyword,omitempty" doc:"List by keyword"` NetworkID *UUID `json:"networkid,omitempty" doc:"list nic of the specific vm's network"` NicID *UUID `json:"nicid,omitempty" doc:"the ID of the nic to to list IPs"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"the ID of the vm"` _ bool `name:"listNics" description:"list the vm nics IP to NIC"` } // ListNicsResponse represents a list of templates type ListNicsResponse struct { Count int `json:"count"` Nic []Nic `json:"nic"` } // AddIPToNic (Async) represents the assignation of a secondary IP type AddIPToNic struct { NicID *UUID `json:"nicid" doc:"the ID of the nic to which you want to assign private IP"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"Secondary IP Address"` _ bool `name:"addIpToNic" description:"Assigns secondary IP to NIC"` } // Response returns the struct to unmarshal func (AddIPToNic) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (AddIPToNic) AsyncResponse() interface{} { return new(NicSecondaryIP) } // RemoveIPFromNic (Async) represents a deletion request type RemoveIPFromNic struct { ID *UUID `json:"id" doc:"the ID of the secondary ip address to nic"` _ bool `name:"removeIpFromNic" description:"Removes secondary IP from the NIC."` } // Response returns the struct to unmarshal func (RemoveIPFromNic) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RemoveIPFromNic) AsyncResponse() interface{} { return new(BooleanResponse) } // ActivateIP6 (Async) activates the IP6 on the given NIC // // Exoscale specific API: https://community.exoscale.ch/api/compute/#activateip6_GET type ActivateIP6 struct { NicID *UUID `json:"nicid" doc:"the ID of the nic to which you want to assign the IPv6"` _ bool `name:"activateIp6" description:"Activate the IPv6 on the VM's nic"` } // Response returns the struct to unmarshal func (ActivateIP6) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (ActivateIP6) AsyncResponse() interface{} { return new(Nic) } �������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/nics_response.go�������������������������������0000664�0000000�0000000�00000001643�13771713062�0025611�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListNics) Response() interface{} { return new(ListNicsResponse) } // ListRequest returns itself func (ls *ListNics) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListNics) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListNics) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListNics) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListNicsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListNicsResponse was expected, got %T", resp)) return } for i := range items.Nic { if !callback(&items.Nic[i], nil) { break } } } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/oscategories_response.go�����������������������0000664�0000000�0000000�00000001761�13771713062�0027345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListOSCategories) Response() interface{} { return new(ListOSCategoriesResponse) } // ListRequest returns itself func (ls *ListOSCategories) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListOSCategories) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListOSCategories) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListOSCategories) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListOSCategoriesResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListOSCategoriesResponse was expected, got %T", resp)) return } for i := range items.OSCategory { if !callback(&items.OSCategory[i], nil) { break } } } ���������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/publicipaddresses_response.go������������������0000664�0000000�0000000�00000002043�13771713062�0030355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListPublicIPAddresses) Response() interface{} { return new(ListPublicIPAddressesResponse) } // ListRequest returns itself func (ls *ListPublicIPAddresses) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListPublicIPAddresses) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListPublicIPAddresses) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListPublicIPAddresses) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListPublicIPAddressesResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListPublicIPAddressesResponse was expected, got %T", resp)) return } for i := range items.PublicIPAddress { if !callback(&items.PublicIPAddress[i], nil) { break } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/record_string.go�������������������������������0000664�0000000�0000000�00000000721�13771713062�0025577�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "stringer -type=Record"; DO NOT EDIT. package egoscale import "strconv" const _Record_name = "AAAAAALIASCNAMEHINFOMXNAPTRNSPOOLSPFSRVSSHFPTXTURL" var _Record_index = [...]uint8{0, 1, 5, 10, 15, 20, 22, 27, 29, 33, 36, 39, 44, 47, 50} func (i Record) String() string { if i < 0 || i >= Record(len(_Record_index)-1) { return "Record(" + strconv.FormatInt(int64(i), 10) + ")" } return _Record_name[_Record_index[i]:_Record_index[i+1]] } �����������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/request.go�������������������������������������0000664�0000000�0000000�00000024125�13771713062�0024427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "bytes" "context" "crypto/hmac" "crypto/sha1" "encoding/base64" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/url" "sort" "strconv" "strings" "time" ) // Error formats a CloudStack error into a standard error func (e ErrorResponse) Error() string { return fmt.Sprintf("API error %s %d (%s %d): %s", e.ErrorCode, e.ErrorCode, e.CSErrorCode, e.CSErrorCode, e.ErrorText) } // Error formats a CloudStack job response into a standard error func (e BooleanResponse) Error() error { if !e.Success { return fmt.Errorf("API error: %s", e.DisplayText) } return nil } func responseKey(key string) (string, bool) { // XXX: addIpToNic, activateIp6, restorevmresponse are kind of special var responseKeys = map[string]string{ "addiptonicresponse": "addiptovmnicresponse", "activateip6response": "activateip6nicresponse", "restorevirtualmachineresponse": "restorevmresponse", "updatevmaffinitygroupresponse": "updatevirtualmachineresponse", } k, ok := responseKeys[key] return k, ok } func (client *Client) parseResponse(resp *http.Response, apiName string) (json.RawMessage, error) { b, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, err } m := map[string]json.RawMessage{} if err := json.Unmarshal(b, &m); err != nil { return nil, err } key := fmt.Sprintf("%sresponse", strings.ToLower(apiName)) response, ok := m[key] if !ok { if resp.StatusCode >= 400 { response, ok = m["errorresponse"] } if !ok { // try again with the special keys value, ok := responseKey(key) if ok { key = value } response, ok = m[key] if !ok { return nil, fmt.Errorf("malformed JSON response %d, %q was expected.\n%s", resp.StatusCode, key, b) } } } if resp.StatusCode >= 400 { errorResponse := new(ErrorResponse) if e := json.Unmarshal(response, errorResponse); e != nil && errorResponse.ErrorCode <= 0 { return nil, fmt.Errorf("%d %s", resp.StatusCode, b) } return nil, errorResponse } n := map[string]json.RawMessage{} if err := json.Unmarshal(response, &n); err != nil { return nil, err } // list response may contain only one key if len(n) > 1 || strings.HasPrefix(key, "list") { return response, nil } if len(n) == 1 { for k := range n { // boolean response and asyncjob result may also contain // only one key if k == "success" || k == "jobid" { return response, nil } return n[k], nil } } return response, nil } // asyncRequest perform an asynchronous job with a context func (client *Client) asyncRequest(ctx context.Context, asyncCommand AsyncCommand) (interface{}, error) { var err error resp := asyncCommand.AsyncResponse() client.AsyncRequestWithContext( ctx, asyncCommand, func(j *AsyncJobResult, e error) bool { if e != nil { err = e return false } if j.JobStatus != Pending { if r := j.Result(resp); r != nil { err = r } return false } return true }, ) return resp, err } // SyncRequestWithContext performs a sync request with a context func (client *Client) SyncRequestWithContext(ctx context.Context, command Command) (interface{}, error) { body, err := client.request(ctx, command) if err != nil { return nil, err } response := command.Response() b, ok := response.(*BooleanResponse) if ok { m := make(map[string]interface{}) if errUnmarshal := json.Unmarshal(body, &m); errUnmarshal != nil { return nil, errUnmarshal } b.DisplayText, _ = m["displaytext"].(string) if success, okSuccess := m["success"].(string); okSuccess { b.Success = success == "true" } if success, okSuccess := m["success"].(bool); okSuccess { b.Success = success } return b, nil } if err := json.Unmarshal(body, response); err != nil { errResponse := new(ErrorResponse) if e := json.Unmarshal(body, errResponse); e == nil && errResponse.ErrorCode > 0 { return errResponse, nil } return nil, err } return response, nil } // BooleanRequest performs the given boolean command func (client *Client) BooleanRequest(command Command) error { resp, err := client.Request(command) if err != nil { return err } if b, ok := resp.(*BooleanResponse); ok { return b.Error() } panic(fmt.Errorf("command %q is not a proper boolean response. %#v", client.APIName(command), resp)) } // BooleanRequestWithContext performs the given boolean command func (client *Client) BooleanRequestWithContext(ctx context.Context, command Command) error { resp, err := client.RequestWithContext(ctx, command) if err != nil { return err } if b, ok := resp.(*BooleanResponse); ok { return b.Error() } panic(fmt.Errorf("command %q is not a proper boolean response. %#v", client.APIName(command), resp)) } // Request performs the given command func (client *Client) Request(command Command) (interface{}, error) { ctx, cancel := context.WithTimeout(context.Background(), client.Timeout) defer cancel() return client.RequestWithContext(ctx, command) } // RequestWithContext preforms a command with a context func (client *Client) RequestWithContext(ctx context.Context, command Command) (interface{}, error) { switch c := command.(type) { case AsyncCommand: return client.asyncRequest(ctx, c) default: return client.SyncRequestWithContext(ctx, command) } } // SyncRequest performs the command as is func (client *Client) SyncRequest(command Command) (interface{}, error) { ctx, cancel := context.WithTimeout(context.Background(), client.Timeout) defer cancel() return client.SyncRequestWithContext(ctx, command) } // AsyncRequest performs the given command func (client *Client) AsyncRequest(asyncCommand AsyncCommand, callback WaitAsyncJobResultFunc) { ctx, cancel := context.WithTimeout(context.Background(), client.Timeout) defer cancel() client.AsyncRequestWithContext(ctx, asyncCommand, callback) } // AsyncRequestWithContext preforms a request with a context func (client *Client) AsyncRequestWithContext(ctx context.Context, asyncCommand AsyncCommand, callback WaitAsyncJobResultFunc) { result, err := client.SyncRequestWithContext(ctx, asyncCommand) if err != nil { if !callback(nil, err) { return } } jobResult, ok := result.(*AsyncJobResult) if !ok { callback(nil, fmt.Errorf("wrong type, AsyncJobResult was expected instead of %T", result)) } // Successful response if jobResult.JobID == nil || jobResult.JobStatus != Pending { callback(jobResult, nil) // without a JobID, the next requests will only fail return } for iteration := 0; ; iteration++ { time.Sleep(client.RetryStrategy(int64(iteration))) req := &QueryAsyncJobResult{JobID: jobResult.JobID} resp, err := client.SyncRequestWithContext(ctx, req) if err != nil && !callback(nil, err) { return } result, ok := resp.(*AsyncJobResult) if !ok { if !callback(nil, fmt.Errorf("wrong type. AsyncJobResult expected, got %T", resp)) { return } } if !callback(result, nil) { return } } } // Payload builds the HTTP request params from the given command func (client *Client) Payload(command Command) (url.Values, error) { params, err := prepareValues("", command) if err != nil { return nil, err } if hookReq, ok := command.(onBeforeHook); ok { if err := hookReq.onBeforeSend(params); err != nil { return params, err } } params.Set("apikey", client.APIKey) params.Set("command", client.APIName(command)) params.Set("response", "json") if params.Get("expires") == "" && client.Expiration >= 0 { params.Set("signatureversion", "3") params.Set("expires", time.Now().Add(client.Expiration).Local().Format("2006-01-02T15:04:05-0700")) } return params, nil } // Sign signs the HTTP request and returns the signature as as base64 encoding func (client *Client) Sign(params url.Values) (string, error) { query := encodeValues(params) query = strings.ToLower(query) mac := hmac.New(sha1.New, []byte(client.apiSecret)) _, err := mac.Write([]byte(query)) if err != nil { return "", err } signature := base64.StdEncoding.EncodeToString(mac.Sum(nil)) return signature, nil } // request makes a Request while being close to the metal func (client *Client) request(ctx context.Context, command Command) (json.RawMessage, error) { params, err := client.Payload(command) if err != nil { return nil, err } signature, err := client.Sign(params) if err != nil { return nil, err } params.Add("signature", signature) method := "GET" query := params.Encode() url := fmt.Sprintf("%s?%s", client.Endpoint, query) var body io.Reader // respect Internet Explorer limit of 2048 if len(url) > 2048 { url = client.Endpoint method = "POST" body = strings.NewReader(query) } request, err := http.NewRequest(method, url, body) if err != nil { return nil, err } request = request.WithContext(ctx) request.Header.Add("User-Agent", UserAgent) if method == "POST" { request.Header.Add("Content-Type", "application/x-www-form-urlencoded") request.Header.Add("Content-Length", strconv.Itoa(len(query))) } resp, err := client.HTTPClient.Do(request) if err != nil { return nil, err } defer resp.Body.Close() // nolint: errcheck contentType := resp.Header.Get("content-type") if !strings.Contains(contentType, "application/json") { return nil, fmt.Errorf(`body content-type response expected "application/json", got %q`, contentType) } text, err := client.parseResponse(resp, client.APIName(command)) if err != nil { return nil, err } return text, nil } func encodeValues(params url.Values) string { // This code is borrowed from net/url/url.go // The way it's encoded by net/url doesn't match // how CloudStack works to determine the signature. // // CloudStack only encodes the values of the query parameters // and furthermore doesn't use '+' for whitespaces. Therefore // after encoding the values all '+' are replaced with '%20'. if params == nil { return "" } var buf bytes.Buffer keys := make([]string, 0, len(params)) for k := range params { keys = append(keys, k) } sort.Strings(keys) for _, k := range keys { prefix := k + "=" for _, v := range params[k] { if buf.Len() > 0 { buf.WriteByte('&') } buf.WriteString(prefix) buf.WriteString(csEncode(v)) } } return buf.String() } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/request_type.go��������������������������������0000664�0000000�0000000�00000014535�13771713062�0025474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "net/url" ) // Command represents a generic request type Command interface { Response() interface{} } // AsyncCommand represents a async request type AsyncCommand interface { Command AsyncResponse() interface{} } // ListCommand represents a listing request type ListCommand interface { Listable Command // SetPage defines the current pages SetPage(int) // SetPageSize defines the size of the page SetPageSize(int) // Each reads the data from the response and feeds channels, and returns true if we are on the last page Each(interface{}, IterateItemFunc) } // onBeforeHook represents an action to be done on the params before sending them // // This little took helps with issue of relying on JSON serialization logic only. // `omitempty` may make sense in some cases but not all the time. type onBeforeHook interface { onBeforeSend(params url.Values) error } // CommandInfo represents the meta data related to a Command type CommandInfo struct { Name string Description string RootOnly bool } // JobStatusType represents the status of a Job type JobStatusType int //go:generate stringer -type JobStatusType const ( // Pending represents a job in progress Pending JobStatusType = iota // Success represents a successfully completed job Success // Failure represents a job that has failed to complete Failure ) // ErrorCode represents the CloudStack ApiErrorCode enum // // See: https://github.com/apache/cloudstack/blob/master/api/src/main/java/org/apache/cloudstack/api/ApiErrorCode.java type ErrorCode int //go:generate stringer -type ErrorCode const ( // Unauthorized represents ... (TODO) Unauthorized ErrorCode = 401 // MethodNotAllowed represents ... (TODO) MethodNotAllowed ErrorCode = 405 // UnsupportedActionError represents ... (TODO) UnsupportedActionError ErrorCode = 422 // APILimitExceeded represents ... (TODO) APILimitExceeded ErrorCode = 429 // MalformedParameterError represents ... (TODO) MalformedParameterError ErrorCode = 430 // ParamError represents ... (TODO) ParamError ErrorCode = 431 // InternalError represents a server error InternalError ErrorCode = 530 // AccountError represents ... (TODO) AccountError ErrorCode = 531 // AccountResourceLimitError represents ... (TODO) AccountResourceLimitError ErrorCode = 532 // InsufficientCapacityError represents ... (TODO) InsufficientCapacityError ErrorCode = 533 // ResourceUnavailableError represents ... (TODO) ResourceUnavailableError ErrorCode = 534 // ResourceAllocationError represents ... (TODO) ResourceAllocationError ErrorCode = 535 // ResourceInUseError represents ... (TODO) ResourceInUseError ErrorCode = 536 // NetworkRuleConflictError represents ... (TODO) NetworkRuleConflictError ErrorCode = 537 ) // CSErrorCode represents the CloudStack CSExceptionErrorCode enum // // See: https://github.com/apache/cloudstack/blob/master/utils/src/main/java/com/cloud/utils/exception/CSExceptionErrorCode.java type CSErrorCode int //go:generate stringer -type CSErrorCode const ( // CloudRuntimeException ... (TODO) CloudRuntimeException CSErrorCode = 4250 // ExecutionException ... (TODO) ExecutionException CSErrorCode = 4260 // HypervisorVersionChangedException ... (TODO) HypervisorVersionChangedException CSErrorCode = 4265 // CloudException ... (TODO) CloudException CSErrorCode = 4275 // AccountLimitException ... (TODO) AccountLimitException CSErrorCode = 4280 // AgentUnavailableException ... (TODO) AgentUnavailableException CSErrorCode = 4285 // CloudAuthenticationException ... (TODO) CloudAuthenticationException CSErrorCode = 4290 // ConcurrentOperationException ... (TODO) ConcurrentOperationException CSErrorCode = 4300 // ConflictingNetworksException ... (TODO) ConflictingNetworkSettingsException CSErrorCode = 4305 // DiscoveredWithErrorException ... (TODO) DiscoveredWithErrorException CSErrorCode = 4310 // HAStateException ... (TODO) HAStateException CSErrorCode = 4315 // InsufficientAddressCapacityException ... (TODO) InsufficientAddressCapacityException CSErrorCode = 4320 // InsufficientCapacityException ... (TODO) InsufficientCapacityException CSErrorCode = 4325 // InsufficientNetworkCapacityException ... (TODO) InsufficientNetworkCapacityException CSErrorCode = 4330 // InsufficientServerCapaticyException ... (TODO) InsufficientServerCapacityException CSErrorCode = 4335 // InsufficientStorageCapacityException ... (TODO) InsufficientStorageCapacityException CSErrorCode = 4340 // InternalErrorException ... (TODO) InternalErrorException CSErrorCode = 4345 // InvalidParameterValueException ... (TODO) InvalidParameterValueException CSErrorCode = 4350 // ManagementServerException ... (TODO) ManagementServerException CSErrorCode = 4355 // NetworkRuleConflictException ... (TODO) NetworkRuleConflictException CSErrorCode = 4360 // PermissionDeniedException ... (TODO) PermissionDeniedException CSErrorCode = 4365 // ResourceAllocationException ... (TODO) ResourceAllocationException CSErrorCode = 4370 // ResourceInUseException ... (TODO) ResourceInUseException CSErrorCode = 4375 // ResourceUnavailableException ... (TODO) ResourceUnavailableException CSErrorCode = 4380 // StorageUnavailableException ... (TODO) StorageUnavailableException CSErrorCode = 4385 // UnsupportedServiceException ... (TODO) UnsupportedServiceException CSErrorCode = 4390 // VirtualMachineMigrationException ... (TODO) VirtualMachineMigrationException CSErrorCode = 4395 // AsyncCommandQueued ... (TODO) AsyncCommandQueued CSErrorCode = 4540 // RequestLimitException ... (TODO) RequestLimitException CSErrorCode = 4545 // ServerAPIException ... (TODO) ServerAPIException CSErrorCode = 9999 ) // ErrorResponse represents the standard error response type ErrorResponse struct { CSErrorCode CSErrorCode `json:"cserrorcode"` ErrorCode ErrorCode `json:"errorcode"` ErrorText string `json:"errortext"` UUIDList []UUIDItem `json:"uuidList,omitempty"` // uuid*L*ist is not a typo } // UUIDItem represents an item of the UUIDList part of an ErrorResponse type UUIDItem struct { Description string `json:"description,omitempty"` SerialVersionUID int64 `json:"serialVersionUID,omitempty"` UUID string `json:"uuid"` } // BooleanResponse represents a boolean response (usually after a deletion) type BooleanResponse struct { DisplayText string `json:"displaytext,omitempty"` Success bool `json:"success"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/resource_limits.go�����������������������������0000664�0000000�0000000�00000014140�13771713062�0026143�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // https://github.com/apache/cloudstack/blob/master/api/src/main/java/com/cloud/configuration/Resource.java // ResourceTypeName represents the name of a resource type (for limits) type ResourceTypeName string const ( // VirtualMachineTypeName is the resource type name of a VM VirtualMachineTypeName ResourceTypeName = "user_vm" // IPAddressTypeName is the resource type name of an IP address IPAddressTypeName ResourceTypeName = "public_ip" // VolumeTypeName is the resource type name of a volume VolumeTypeName ResourceTypeName = "volume" // SnapshotTypeName is the resource type name of a snapshot SnapshotTypeName ResourceTypeName = "snapshot" // TemplateTypeName is the resource type name of a template TemplateTypeName ResourceTypeName = "template" // ProjectTypeName is the resource type name of a project ProjectTypeName ResourceTypeName = "project" // NetworkTypeName is the resource type name of a network NetworkTypeName ResourceTypeName = "network" // VPCTypeName is the resource type name of a VPC VPCTypeName ResourceTypeName = "vpc" // CPUTypeName is the resource type name of a CPU CPUTypeName ResourceTypeName = "cpu" // MemoryTypeName is the resource type name of Memory MemoryTypeName ResourceTypeName = "memory" // PrimaryStorageTypeName is the resource type name of primary storage PrimaryStorageTypeName ResourceTypeName = "primary_storage" // SecondaryStorageTypeName is the resource type name of secondary storage SecondaryStorageTypeName ResourceTypeName = "secondary_storage" ) // ResourceType represents the ID of a resource type (for limits) type ResourceType string const ( // VirtualMachineType is the resource type ID of a VM VirtualMachineType ResourceType = "0" // IPAddressType is the resource type ID of an IP address IPAddressType ResourceType = "1" // VolumeType is the resource type ID of a volume VolumeType ResourceType = "2" // SnapshotType is the resource type ID of a snapshot SnapshotType ResourceType = "3" // TemplateType is the resource type ID of a template TemplateType ResourceType = "4" // ProjectType is the resource type ID of a project ProjectType ResourceType = "5" // NetworkType is the resource type ID of a network NetworkType ResourceType = "6" // VPCType is the resource type ID of a VPC VPCType ResourceType = "7" // CPUType is the resource type ID of a CPU CPUType ResourceType = "8" // MemoryType is the resource type ID of Memory MemoryType ResourceType = "9" // PrimaryStorageType is the resource type ID of primary storage PrimaryStorageType ResourceType = "10" // SecondaryStorageType is the resource type ID of secondary storage SecondaryStorageType ResourceType = "11" ) // ResourceLimit represents the limit on a particular resource type ResourceLimit struct { Max int64 `json:"max,omitempty" doc:"the maximum number of the resource. A -1 means the resource currently has no limit."` ResourceType ResourceType `json:"resourcetype,omitempty" doc:"resource type. Values include 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11. See the resourceType parameter for more information on these values."` ResourceTypeName string `json:"resourcetypename,omitempty" doc:"resource type name. Values include user_vm, public_ip, volume, snapshot, template, network, cpu, memory, primary_storage, secondary_storage."` } // ListRequest builds the ListResourceLimits request func (limit ResourceLimit) ListRequest() (ListCommand, error) { req := &ListResourceLimits{ ResourceType: limit.ResourceType, ResourceTypeName: limit.ResourceTypeName, } return req, nil } //go:generate go run generate/main.go -interface=Listable ListResourceLimits // ListResourceLimits lists the resource limits type ListResourceLimits struct { ID int64 `json:"id,omitempty" doc:"Lists resource limits by ID."` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` ResourceType ResourceType `json:"resourcetype,omitempty" doc:"Type of resource. Values are 0, 1, 2, 3, 4, 6, 8, 9, 10, 11, 12, and 13. 0 - Instance. Number of instances a user can create. 1 - IP. Number of public IP addresses an account can own. 2 - Volume. Number of disk volumes an account can own. 3 - Snapshot. Number of snapshots an account can own. 4 - Template. Number of templates an account can register/create. 6 - Network. Number of networks an account can own. 8 - CPU. Number of CPU an account can allocate for his resources. 9 - Memory. Amount of RAM an account can allocate for his resources. 10 - PrimaryStorage. Total primary storage space (in GiB) a user can use. 11 - SecondaryStorage. Total secondary storage space (in GiB) a user can use. 12 - Elastic IP. Number of public elastic IP addresses an account can own. 13 - SMTP. If the account is allowed SMTP outbound traffic."` ResourceTypeName string `json:"resourcetypename,omitempty" doc:"Type of resource (wins over resourceType if both are provided). Values are: user_vm - Instance. Number of instances a user can create. public_ip - IP. Number of public IP addresses an account can own. volume - Volume. Number of disk volumes an account can own. snapshot - Snapshot. Number of snapshots an account can own. template - Template. Number of templates an account can register/create. network - Network. Number of networks an account can own. cpu - CPU. Number of CPU an account can allocate for his resources. memory - Memory. Amount of RAM an account can allocate for his resources. primary_storage - PrimaryStorage. Total primary storage space (in GiB) a user can use. secondary_storage - SecondaryStorage. Total secondary storage space (in GiB) a user can use. public_elastic_ip - IP. Number of public elastic IP addresses an account can own. smtp - SG. If the account is allowed SMTP outbound traffic."` _ bool `name:"listResourceLimits" description:"Lists resource limits."` } // ListResourceLimitsResponse represents a list of resource limits type ListResourceLimitsResponse struct { Count int `json:"count"` ResourceLimit []ResourceLimit `json:"resourcelimit"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/resource_metadata.go���������������������������0000664�0000000�0000000�00000003057�13771713062�0026427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import "fmt" // ResourceDetail represents extra details type ResourceDetail ResourceTag // ListRequest builds the ListResourceDetails request func (detail ResourceDetail) ListRequest() (ListCommand, error) { if detail.ResourceType == "" { return nil, fmt.Errorf("the resourcetype parameter is required") } req := &ListResourceDetails{ ResourceType: detail.ResourceType, ResourceID: detail.ResourceID, } return req, nil } //go:generate go run generate/main.go -interface=Listable ListResourceDetails // ListResourceDetails lists the resource tag(s) (but different from listTags...) type ListResourceDetails struct { ResourceType string `json:"resourcetype" doc:"list by resource type"` ForDisplay bool `json:"fordisplay,omitempty" doc:"if set to true, only details marked with display=true, are returned. False by default"` Key string `json:"key,omitempty" doc:"list by key"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` ResourceID *UUID `json:"resourceid,omitempty" doc:"list by resource id"` Value string `json:"value,omitempty" doc:"list by key, value. Needs to be passed only along with key"` _ bool `name:"listResourceDetails" description:"List resource detail(s)"` } // ListResourceDetailsResponse represents a list of resource details type ListResourceDetailsResponse struct { Count int `json:"count"` ResourceDetail []ResourceTag `json:"resourcedetail"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/resourcedetails_response.go��������������������0000664�0000000�0000000�00000002021�13771713062�0030041�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListResourceDetails) Response() interface{} { return new(ListResourceDetailsResponse) } // ListRequest returns itself func (ls *ListResourceDetails) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListResourceDetails) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListResourceDetails) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListResourceDetails) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListResourceDetailsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListResourceDetailsResponse was expected, got %T", resp)) return } for i := range items.ResourceDetail { if !callback(&items.ResourceDetail[i], nil) { break } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/resourcelimits_response.go���������������������0000664�0000000�0000000�00000002007�13771713062�0027721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListResourceLimits) Response() interface{} { return new(ListResourceLimitsResponse) } // ListRequest returns itself func (ls *ListResourceLimits) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListResourceLimits) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListResourceLimits) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListResourceLimits) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListResourceLimitsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListResourceLimitsResponse was expected, got %T", resp)) return } for i := range items.ResourceLimit { if !callback(&items.ResourceLimit[i], nil) { break } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/reversedns.go����������������������������������0000664�0000000�0000000�00000007750�13771713062�0025124�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "net" ) // ReverseDNS represents the PTR record linked with an IPAddress or IP6Address belonging to a Virtual Machine or a Public IP Address (Elastic IP) instance type ReverseDNS struct { DomainName string `json:"domainname,omitempty" doc:"the domain name of the PTR record"` IP6Address net.IP `json:"ip6address,omitempty" doc:"the IPv6 address linked with the PTR record (mutually exclusive with ipaddress)"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"the IPv4 address linked with the PTR record (mutually exclusive with ip6address)"` NicID *UUID `json:"nicid,omitempty" doc:"the virtual machine default NIC ID"` PublicIPID *UUID `json:"publicipid,omitempty" doc:"the public IP address ID"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"the virtual machine ID"` } // DeleteReverseDNSFromPublicIPAddress is a command to create/delete the PTR record of a public IP address type DeleteReverseDNSFromPublicIPAddress struct { ID *UUID `json:"id,omitempty" doc:"the ID of the public IP address"` _ bool `name:"deleteReverseDnsFromPublicIpAddress" description:"delete the PTR DNS record from the public IP address"` } // Response returns the struct to unmarshal func (*DeleteReverseDNSFromPublicIPAddress) Response() interface{} { return new(BooleanResponse) } // DeleteReverseDNSFromVirtualMachine is a command to create/delete the PTR record(s) of a virtual machine type DeleteReverseDNSFromVirtualMachine struct { ID *UUID `json:"id,omitempty" doc:"the ID of the virtual machine"` _ bool `name:"deleteReverseDnsFromVirtualMachine" description:"Delete the PTR DNS record(s) from the virtual machine"` } // Response returns the struct to unmarshal func (*DeleteReverseDNSFromVirtualMachine) Response() interface{} { return new(BooleanResponse) } // QueryReverseDNSForPublicIPAddress is a command to create/query the PTR record of a public IP address type QueryReverseDNSForPublicIPAddress struct { ID *UUID `json:"id,omitempty" doc:"the ID of the public IP address"` _ bool `name:"queryReverseDnsForPublicIpAddress" description:"Query the PTR DNS record for the public IP address"` } // Response returns the struct to unmarshal func (*QueryReverseDNSForPublicIPAddress) Response() interface{} { return new(IPAddress) } // QueryReverseDNSForVirtualMachine is a command to create/query the PTR record(s) of a virtual machine type QueryReverseDNSForVirtualMachine struct { ID *UUID `json:"id,omitempty" doc:"the ID of the virtual machine"` _ bool `name:"queryReverseDnsForVirtualMachine" description:"Query the PTR DNS record(s) for the virtual machine"` } // Response returns the struct to unmarshal func (*QueryReverseDNSForVirtualMachine) Response() interface{} { return new(VirtualMachine) } // UpdateReverseDNSForPublicIPAddress is a command to create/update the PTR record of a public IP address type UpdateReverseDNSForPublicIPAddress struct { DomainName string `json:"domainname,omitempty" doc:"the domain name for the PTR record. It must have a valid TLD"` ID *UUID `json:"id,omitempty" doc:"the ID of the public IP address"` _ bool `name:"updateReverseDnsForPublicIpAddress" description:"Update/create the PTR DNS record for the public IP address"` } // Response returns the struct to unmarshal func (*UpdateReverseDNSForPublicIPAddress) Response() interface{} { return new(IPAddress) } // UpdateReverseDNSForVirtualMachine is a command to create/update the PTR record(s) of a virtual machine type UpdateReverseDNSForVirtualMachine struct { DomainName string `json:"domainname,omitempty" doc:"the domain name for the PTR record(s). It must have a valid TLD"` ID *UUID `json:"id,omitempty" doc:"the ID of the virtual machine"` _ bool `name:"updateReverseDnsForVirtualMachine" description:"Update/create the PTR DNS record(s) for the virtual machine"` } // Response returns the struct to unmarshal func (*UpdateReverseDNSForVirtualMachine) Response() interface{} { return new(VirtualMachine) } ������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/runstatus.go�����������������������������������0000664�0000000�0000000�00000006214�13771713062�0025006�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "crypto/hmac" "crypto/sha256" "encoding/hex" "encoding/json" "fmt" "io/ioutil" "net/http" "net/url" "strings" "time" ) // RunstatusValidationErrorResponse represents an error in the API type RunstatusValidationErrorResponse map[string][]string // RunstatusErrorResponse represents the default errors type RunstatusErrorResponse struct { Detail string `json:"detail"` } // runstatusPagesURL is the only URL that cannot be guessed const runstatusPagesURL = "/pages" // Error formats the DNSerror into a string func (req RunstatusErrorResponse) Error() string { return fmt.Sprintf("Runstatus error: %s", req.Detail) } // Error formats the DNSerror into a string func (req RunstatusValidationErrorResponse) Error() string { if len(req) > 0 { errs := []string{} for name, ss := range req { if len(ss) > 0 { errs = append(errs, fmt.Sprintf("%s: %s", name, strings.Join(ss, ", "))) } } return fmt.Sprintf("Runstatus error: %s", strings.Join(errs, "; ")) } return fmt.Sprintf("Runstatus error") } func (client *Client) runstatusRequest(ctx context.Context, uri string, structParam interface{}, method string) (json.RawMessage, error) { reqURL, err := url.Parse(uri) if err != nil { return nil, err } if reqURL.Scheme == "" { return nil, fmt.Errorf("only absolute URI are considered valid, got %q", uri) } var params string if structParam != nil { m, err := json.Marshal(structParam) if err != nil { return nil, err } params = string(m) } req, err := http.NewRequest(method, reqURL.String(), strings.NewReader(params)) if err != nil { return nil, err } time := time.Now().Local().Format("2006-01-02T15:04:05-0700") payload := fmt.Sprintf("%s%s%s", req.URL.String(), time, params) mac := hmac.New(sha256.New, []byte(client.apiSecret)) _, err = mac.Write([]byte(payload)) if err != nil { return nil, err } signature := hex.EncodeToString(mac.Sum(nil)) var hdr = make(http.Header) hdr.Add("Authorization", fmt.Sprintf("Exoscale-HMAC-SHA256 %s:%s", client.APIKey, signature)) hdr.Add("Exoscale-Date", time) hdr.Add("User-Agent", UserAgent) hdr.Add("Accept", "application/json") if params != "" { hdr.Add("Content-Type", "application/json") } req.Header = hdr req = req.WithContext(ctx) resp, err := client.HTTPClient.Do(req) if err != nil { return nil, err } defer resp.Body.Close() // nolint: errcheck if resp.StatusCode == 204 { if method != "DELETE" { return nil, fmt.Errorf("only DELETE is expected to produce 204, was %q", method) } return nil, nil } contentType := resp.Header.Get("content-type") if !strings.Contains(contentType, "application/json") { return nil, fmt.Errorf(`response %d content-type expected to be "application/json", got %q`, resp.StatusCode, contentType) } b, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, err } if resp.StatusCode >= 400 { rerr := new(RunstatusValidationErrorResponse) if err := json.Unmarshal(b, rerr); err == nil { return nil, rerr } rverr := new(RunstatusErrorResponse) if err := json.Unmarshal(b, rverr); err != nil { return nil, err } return nil, rverr } return b, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/runstatus_event.go�����������������������������0000664�0000000�0000000�00000002223�13771713062�0026203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "fmt" "time" ) //RunstatusEvent is a runstatus event type RunstatusEvent struct { Created *time.Time `json:"created,omitempty"` State string `json:"state,omitempty"` Status string `json:"status"` Text string `json:"text"` } // UpdateRunstatusIncident create runstatus incident event // Events can be updates or final message with status completed. func (client *Client) UpdateRunstatusIncident(ctx context.Context, incident RunstatusIncident, event RunstatusEvent) error { if incident.EventsURL == "" { return fmt.Errorf("empty Events URL for %#v", incident) } _, err := client.runstatusRequest(ctx, incident.EventsURL, event, "POST") return err } // UpdateRunstatusMaintenance adds a event to a maintenance. // Events can be updates or final message with status completed. func (client *Client) UpdateRunstatusMaintenance(ctx context.Context, maintenance RunstatusMaintenance, event RunstatusEvent) error { if maintenance.EventsURL == "" { return fmt.Errorf("empty Events URL for %#v", maintenance) } _, err := client.runstatusRequest(ctx, maintenance.EventsURL, event, "POST") return err } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/runstatus_incident.go��������������������������0000664�0000000�0000000�00000011200�13771713062�0026652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "encoding/json" "fmt" "time" ) //RunstatusIncident is a runstatus incident type RunstatusIncident struct { EndDate *time.Time `json:"end_date,omitempty"` Events []RunstatusEvent `json:"events,omitempty"` EventsURL string `json:"events_url,omitempty"` ID int `json:"id,omitempty"` PageURL string `json:"page_url,omitempty"` // fake field PostMortem string `json:"post_mortem,omitempty"` RealTime bool `json:"real_time,omitempty"` Services []string `json:"services"` StartDate *time.Time `json:"start_date,omitempty"` State string `json:"state"` Status string `json:"status"` StatusText string `json:"status_text"` Title string `json:"title"` URL string `json:"url,omitempty"` } // Match returns true if the other incident has got similarities with itself func (incident RunstatusIncident) Match(other RunstatusIncident) bool { if other.Title != "" && incident.Title == other.Title { return true } if other.ID > 0 && incident.ID == other.ID { return true } return false } //RunstatusIncidentList is a list of incident type RunstatusIncidentList struct { Next string `json:"next"` Previous string `json:"previous"` Incidents []RunstatusIncident `json:"results"` } // GetRunstatusIncident retrieves the details of a specific incident. func (client *Client) GetRunstatusIncident(ctx context.Context, incident RunstatusIncident) (*RunstatusIncident, error) { if incident.URL != "" { return client.getRunstatusIncident(ctx, incident.URL) } if incident.PageURL == "" { return nil, fmt.Errorf("empty Page URL for %#v", incident) } page, err := client.getRunstatusPage(ctx, incident.PageURL) if err != nil { return nil, err } for i := range page.Incidents { j := &page.Incidents[i] if j.Match(incident) { return j, nil } } return nil, fmt.Errorf("%#v not found", incident) } func (client *Client) getRunstatusIncident(ctx context.Context, incidentURL string) (*RunstatusIncident, error) { resp, err := client.runstatusRequest(ctx, incidentURL, nil, "GET") if err != nil { return nil, err } i := new(RunstatusIncident) if err := json.Unmarshal(resp, i); err != nil { return nil, err } return i, nil } // ListRunstatusIncidents lists the incidents for a specific page. func (client *Client) ListRunstatusIncidents(ctx context.Context, page RunstatusPage) ([]RunstatusIncident, error) { if page.IncidentsURL == "" { return nil, fmt.Errorf("empty Incidents URL for %#v", page) } results := make([]RunstatusIncident, 0) var err error client.PaginateRunstatusIncidents(ctx, page, func(incident *RunstatusIncident, e error) bool { if e != nil { err = e return false } results = append(results, *incident) return true }) return results, err } // PaginateRunstatusIncidents paginate Incidents func (client *Client) PaginateRunstatusIncidents(ctx context.Context, page RunstatusPage, callback func(*RunstatusIncident, error) bool) { if page.IncidentsURL == "" { callback(nil, fmt.Errorf("empty Incidents URL for %#v", page)) return } incidentsURL := page.IncidentsURL for incidentsURL != "" { resp, err := client.runstatusRequest(ctx, incidentsURL, nil, "GET") if err != nil { callback(nil, err) return } var is *RunstatusIncidentList if err := json.Unmarshal(resp, &is); err != nil { callback(nil, err) return } for i := range is.Incidents { if cont := callback(&is.Incidents[i], nil); !cont { return } } incidentsURL = is.Next } } // CreateRunstatusIncident create runstatus incident func (client *Client) CreateRunstatusIncident(ctx context.Context, incident RunstatusIncident) (*RunstatusIncident, error) { if incident.PageURL == "" { return nil, fmt.Errorf("empty Page URL for %#v", incident) } page, err := client.getRunstatusPage(ctx, incident.PageURL) if err != nil { return nil, err } if page.IncidentsURL == "" { return nil, fmt.Errorf("empty Incidents URL for %#v", page) } resp, err := client.runstatusRequest(ctx, page.IncidentsURL, incident, "POST") if err != nil { return nil, err } i := &RunstatusIncident{} if err := json.Unmarshal(resp, &i); err != nil { return nil, err } return i, nil } // DeleteRunstatusIncident delete runstatus incident func (client *Client) DeleteRunstatusIncident(ctx context.Context, incident RunstatusIncident) error { if incident.URL == "" { return fmt.Errorf("empty URL for %#v", incident) } _, err := client.runstatusRequest(ctx, incident.URL, nil, "DELETE") return err } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/runstatus_maintenance.go�����������������������0000664�0000000�0000000�00000013046�13771713062�0027351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "encoding/json" "fmt" "log" "net/url" "path" "strconv" "time" ) // RunstatusMaintenance is a runstatus maintenance type RunstatusMaintenance struct { Created *time.Time `json:"created,omitempty"` Description string `json:"description,omitempty"` EndDate *time.Time `json:"end_date"` Events []RunstatusEvent `json:"events,omitempty"` EventsURL string `json:"events_url,omitempty"` ID int `json:"id,omitempty"` // missing field PageURL string `json:"page_url,omitempty"` // fake field RealTime bool `json:"real_time,omitempty"` Services []string `json:"services"` StartDate *time.Time `json:"start_date"` Status string `json:"status"` Title string `json:"title"` URL string `json:"url,omitempty"` } // Match returns true if the other maintenance has got similarities with itself func (maintenance RunstatusMaintenance) Match(other RunstatusMaintenance) bool { if other.Title != "" && maintenance.Title == other.Title { return true } if other.ID > 0 && maintenance.ID == other.ID { return true } return false } // FakeID fills up the ID field as it's currently missing func (maintenance *RunstatusMaintenance) FakeID() error { if maintenance.ID > 0 { return nil } if maintenance.URL == "" { return fmt.Errorf("empty URL for %#v", maintenance) } u, err := url.Parse(maintenance.URL) if err != nil { return err } s := path.Base(u.Path) id, err := strconv.Atoi(s) if err != nil { return err } maintenance.ID = id return nil } // RunstatusMaintenanceList is a list of incident type RunstatusMaintenanceList struct { Next string `json:"next"` Previous string `json:"previous"` Maintenances []RunstatusMaintenance `json:"results"` } // GetRunstatusMaintenance retrieves the details of a specific maintenance. func (client *Client) GetRunstatusMaintenance(ctx context.Context, maintenance RunstatusMaintenance) (*RunstatusMaintenance, error) { if maintenance.URL != "" { return client.getRunstatusMaintenance(ctx, maintenance.URL) } if maintenance.PageURL == "" { return nil, fmt.Errorf("empty Page URL for %#v", maintenance) } page, err := client.getRunstatusPage(ctx, maintenance.PageURL) if err != nil { return nil, err } for i := range page.Maintenances { m := &page.Maintenances[i] if m.Match(maintenance) { if err := m.FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", m, err) } return m, nil } } return nil, fmt.Errorf("%#v not found", maintenance) } func (client *Client) getRunstatusMaintenance(ctx context.Context, maintenanceURL string) (*RunstatusMaintenance, error) { resp, err := client.runstatusRequest(ctx, maintenanceURL, nil, "GET") if err != nil { return nil, err } m := new(RunstatusMaintenance) if err := json.Unmarshal(resp, m); err != nil { return nil, err } return m, nil } // ListRunstatusMaintenances returns the list of maintenances for the page. func (client *Client) ListRunstatusMaintenances(ctx context.Context, page RunstatusPage) ([]RunstatusMaintenance, error) { if page.MaintenancesURL == "" { return nil, fmt.Errorf("empty Maintenances URL for %#v", page) } results := make([]RunstatusMaintenance, 0) var err error client.PaginateRunstatusMaintenances(ctx, page, func(maintenance *RunstatusMaintenance, e error) bool { if e != nil { err = e return false } results = append(results, *maintenance) return true }) return results, err } // PaginateRunstatusMaintenances paginate Maintenances func (client *Client) PaginateRunstatusMaintenances(ctx context.Context, page RunstatusPage, callback func(*RunstatusMaintenance, error) bool) { // nolint: dupl if page.MaintenancesURL == "" { callback(nil, fmt.Errorf("empty Maintenances URL for %#v", page)) return } maintenancesURL := page.MaintenancesURL for maintenancesURL != "" { resp, err := client.runstatusRequest(ctx, maintenancesURL, nil, "GET") if err != nil { callback(nil, err) return } var ms *RunstatusMaintenanceList if err := json.Unmarshal(resp, &ms); err != nil { callback(nil, err) return } for i := range ms.Maintenances { if err := ms.Maintenances[i].FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", ms.Maintenances[i], err) } if cont := callback(&ms.Maintenances[i], nil); !cont { return } } maintenancesURL = ms.Next } } // CreateRunstatusMaintenance create runstatus Maintenance func (client *Client) CreateRunstatusMaintenance(ctx context.Context, maintenance RunstatusMaintenance) (*RunstatusMaintenance, error) { if maintenance.PageURL == "" { return nil, fmt.Errorf("empty Page URL for %#v", maintenance) } page, err := client.getRunstatusPage(ctx, maintenance.PageURL) if err != nil { return nil, err } resp, err := client.runstatusRequest(ctx, page.MaintenancesURL, maintenance, "POST") if err != nil { return nil, err } m := &RunstatusMaintenance{} if err := json.Unmarshal(resp, &m); err != nil { return nil, err } if err := m.FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", m, err) } return m, nil } // DeleteRunstatusMaintenance delete runstatus Maintenance func (client *Client) DeleteRunstatusMaintenance(ctx context.Context, maintenance RunstatusMaintenance) error { if maintenance.URL == "" { return fmt.Errorf("empty URL for %#v", maintenance) } _, err := client.runstatusRequest(ctx, maintenance.URL, nil, "DELETE") return err } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/runstatus_page.go������������������������������0000664�0000000�0000000�00000012167�13771713062�0026006�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "encoding/json" "fmt" "log" "time" ) // RunstatusPage runstatus page type RunstatusPage struct { Created *time.Time `json:"created,omitempty"` DarkTheme bool `json:"dark_theme,omitempty"` Domain string `json:"domain,omitempty"` GradientEnd string `json:"gradient_end,omitempty"` GradientStart string `json:"gradient_start,omitempty"` HeaderBackground string `json:"header_background,omitempty"` ID int `json:"id,omitempty"` Incidents []RunstatusIncident `json:"incidents,omitempty"` IncidentsURL string `json:"incidents_url,omitempty"` Logo string `json:"logo,omitempty"` Maintenances []RunstatusMaintenance `json:"maintenances,omitempty"` MaintenancesURL string `json:"maintenances_url,omitempty"` Name string `json:"name"` //fake field (used to post a new runstatus page) OkText string `json:"ok_text,omitempty"` Plan string `json:"plan,omitempty"` PublicURL string `json:"public_url,omitempty"` Services []RunstatusService `json:"services,omitempty"` ServicesURL string `json:"services_url,omitempty"` State string `json:"state,omitempty"` Subdomain string `json:"subdomain"` SupportEmail string `json:"support_email,omitempty"` TimeZone string `json:"time_zone,omitempty"` Title string `json:"title,omitempty"` TitleColor string `json:"title_color,omitempty"` TwitterUsername string `json:"twitter_username,omitempty"` URL string `json:"url,omitempty"` } // Match returns true if the other page has got similarities with itself func (page RunstatusPage) Match(other RunstatusPage) bool { if other.Subdomain != "" && page.Subdomain == other.Subdomain { return true } if other.ID > 0 && page.ID == other.ID { return true } return false } // RunstatusPageList runstatus page list type RunstatusPageList struct { Next string `json:"next"` Previous string `json:"previous"` Pages []RunstatusPage `json:"results"` } // CreateRunstatusPage create runstatus page func (client *Client) CreateRunstatusPage(ctx context.Context, page RunstatusPage) (*RunstatusPage, error) { resp, err := client.runstatusRequest(ctx, client.Endpoint+runstatusPagesURL, page, "POST") if err != nil { return nil, err } var p *RunstatusPage if err := json.Unmarshal(resp, &p); err != nil { return nil, err } return p, nil } // DeleteRunstatusPage delete runstatus page func (client *Client) DeleteRunstatusPage(ctx context.Context, page RunstatusPage) error { if page.URL == "" { return fmt.Errorf("empty URL for %#v", page) } _, err := client.runstatusRequest(ctx, page.URL, nil, "DELETE") return err } // GetRunstatusPage fetches the runstatus page func (client *Client) GetRunstatusPage(ctx context.Context, page RunstatusPage) (*RunstatusPage, error) { if page.URL != "" { return client.getRunstatusPage(ctx, page.URL) } ps, err := client.ListRunstatusPages(ctx) if err != nil { return nil, err } for i := range ps { if ps[i].Match(page) { return client.getRunstatusPage(ctx, ps[i].URL) } } return nil, fmt.Errorf("%#v not found", page) } func (client *Client) getRunstatusPage(ctx context.Context, pageURL string) (*RunstatusPage, error) { resp, err := client.runstatusRequest(ctx, pageURL, nil, "GET") if err != nil { return nil, err } p := new(RunstatusPage) if err := json.Unmarshal(resp, p); err != nil { return nil, err } // NOTE: fix the missing IDs for i := range p.Maintenances { if err := p.Maintenances[i].FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", p.Maintenances[i], err) } } for i := range p.Services { if err := p.Services[i].FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", p.Services[i], err) } } return p, nil } // ListRunstatusPages list all the runstatus pages func (client *Client) ListRunstatusPages(ctx context.Context) ([]RunstatusPage, error) { resp, err := client.runstatusRequest(ctx, client.Endpoint+runstatusPagesURL, nil, "GET") if err != nil { return nil, err } var p *RunstatusPageList if err := json.Unmarshal(resp, &p); err != nil { return nil, err } return p.Pages, nil } //PaginateRunstatusPages paginate on runstatus pages func (client *Client) PaginateRunstatusPages(ctx context.Context, callback func(pages []RunstatusPage, e error) bool) { pageURL := client.Endpoint + runstatusPagesURL for pageURL != "" { resp, err := client.runstatusRequest(ctx, pageURL, nil, "GET") if err != nil { callback(nil, err) return } var p *RunstatusPageList if err := json.Unmarshal(resp, &p); err != nil { callback(nil, err) return } if ok := callback(p.Pages, nil); ok { return } pageURL = p.Next } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/runstatus_service.go���������������������������0000664�0000000�0000000�00000011221�13771713062�0026520�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "encoding/json" "fmt" "log" "net/url" "path" "strconv" ) // RunstatusService is a runstatus service type RunstatusService struct { ID int `json:"id"` // missing field Name string `json:"name"` PageURL string `json:"page_url,omitempty"` // fake field State string `json:"state,omitempty"` URL string `json:"url,omitempty"` } // FakeID fills up the ID field as it's currently missing func (service *RunstatusService) FakeID() error { if service.ID > 0 { return nil } if service.URL == "" { return fmt.Errorf("empty URL for %#v", service) } u, err := url.Parse(service.URL) if err != nil { return err } s := path.Base(u.Path) id, err := strconv.Atoi(s) if err != nil { return err } service.ID = id return nil } // Match returns true if the other service has got similarities with itself func (service RunstatusService) Match(other RunstatusService) bool { if other.Name != "" && service.Name == other.Name { return true } if other.ID > 0 && service.ID == other.ID { return true } return false } // RunstatusServiceList service list type RunstatusServiceList struct { Next string `json:"next"` Previous string `json:"previous"` Services []RunstatusService `json:"results"` } // DeleteRunstatusService delete runstatus service func (client *Client) DeleteRunstatusService(ctx context.Context, service RunstatusService) error { if service.URL == "" { return fmt.Errorf("empty URL for %#v", service) } _, err := client.runstatusRequest(ctx, service.URL, nil, "DELETE") return err } // CreateRunstatusService create runstatus service func (client *Client) CreateRunstatusService(ctx context.Context, service RunstatusService) (*RunstatusService, error) { if service.PageURL == "" { return nil, fmt.Errorf("empty Page URL for %#v", service) } page, err := client.GetRunstatusPage(ctx, RunstatusPage{URL: service.PageURL}) if err != nil { return nil, err } resp, err := client.runstatusRequest(ctx, page.ServicesURL, service, "POST") if err != nil { return nil, err } s := &RunstatusService{} if err := json.Unmarshal(resp, s); err != nil { return nil, err } return s, nil } // GetRunstatusService displays service detail. func (client *Client) GetRunstatusService(ctx context.Context, service RunstatusService) (*RunstatusService, error) { if service.URL != "" { return client.getRunstatusService(ctx, service.URL) } if service.PageURL == "" { return nil, fmt.Errorf("empty Page URL in %#v", service) } page, err := client.getRunstatusPage(ctx, service.PageURL) if err != nil { return nil, err } for i := range page.Services { s := &page.Services[i] if s.Match(service) { if err := s.FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", s, err) } return s, nil } } return nil, fmt.Errorf("%#v not found", service) } func (client *Client) getRunstatusService(ctx context.Context, serviceURL string) (*RunstatusService, error) { resp, err := client.runstatusRequest(ctx, serviceURL, nil, "GET") if err != nil { return nil, err } s := &RunstatusService{} if err := json.Unmarshal(resp, &s); err != nil { return nil, err } if err := s.FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", s, err) } return s, nil } // ListRunstatusServices displays the list of services. func (client *Client) ListRunstatusServices(ctx context.Context, page RunstatusPage) ([]RunstatusService, error) { if page.ServicesURL == "" { return nil, fmt.Errorf("empty Services URL for %#v", page) } results := make([]RunstatusService, 0) var err error client.PaginateRunstatusServices(ctx, page, func(service *RunstatusService, e error) bool { if e != nil { err = e return false } results = append(results, *service) return true }) return results, err } // PaginateRunstatusServices paginates Services func (client *Client) PaginateRunstatusServices(ctx context.Context, page RunstatusPage, callback func(*RunstatusService, error) bool) { // nolint: dupl if page.ServicesURL == "" { callback(nil, fmt.Errorf("empty Services URL for %#v", page)) return } servicesURL := page.ServicesURL for servicesURL != "" { resp, err := client.runstatusRequest(ctx, servicesURL, nil, "GET") if err != nil { callback(nil, err) return } var ss *RunstatusServiceList if err := json.Unmarshal(resp, &ss); err != nil { callback(nil, err) return } for i := range ss.Services { if err := ss.Services[i].FakeID(); err != nil { log.Printf("bad fake ID for %#v, %s", ss.Services[i], err) } if cont := callback(&ss.Services[i], nil); !cont { return } } servicesURL = ss.Next } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/security_groups.go�����������������������������0000664�0000000�0000000�00000022215�13771713062�0026203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "fmt" "net/url" "strconv" "strings" ) // SecurityGroup represent a firewalling set of rules type SecurityGroup struct { Account string `json:"account,omitempty" doc:"the account owning the security group"` Description string `json:"description,omitempty" doc:"the description of the security group"` EgressRule []EgressRule `json:"egressrule,omitempty" doc:"the list of egress rules associated with the security group"` ID *UUID `json:"id" doc:"the ID of the security group"` IngressRule []IngressRule `json:"ingressrule,omitempty" doc:"the list of ingress rules associated with the security group"` Name string `json:"name,omitempty" doc:"the name of the security group"` } // UserSecurityGroup converts a SecurityGroup to a UserSecurityGroup func (sg SecurityGroup) UserSecurityGroup() UserSecurityGroup { return UserSecurityGroup{ Group: sg.Name, } } // ListRequest builds the ListSecurityGroups request func (sg SecurityGroup) ListRequest() (ListCommand, error) { req := &ListSecurityGroups{ ID: sg.ID, SecurityGroupName: sg.Name, } return req, nil } // Delete deletes the given Security Group func (sg SecurityGroup) Delete(ctx context.Context, client *Client) error { if sg.ID == nil && sg.Name == "" { return fmt.Errorf("a SecurityGroup may only be deleted using ID or Name") } req := &DeleteSecurityGroup{} if sg.ID != nil { req.ID = sg.ID } else { req.Name = sg.Name } return client.BooleanRequestWithContext(ctx, req) } // RuleByID returns IngressRule or EgressRule by a rule ID func (sg SecurityGroup) RuleByID(ruleID UUID) (*IngressRule, *EgressRule) { for i, in := range sg.IngressRule { if in.RuleID.Equal(ruleID) { return &sg.IngressRule[i], nil } } for i, out := range sg.EgressRule { if out.RuleID.Equal(ruleID) { return nil, &sg.EgressRule[i] } } return nil, nil } // IngressRule represents the ingress rule type IngressRule struct { CIDR *CIDR `json:"cidr,omitempty" doc:"the CIDR notation for the base IP address of the security group rule"` Description string `json:"description,omitempty" doc:"description of the security group rule"` EndPort uint16 `json:"endport,omitempty" doc:"the ending port of the security group rule "` IcmpCode uint8 `json:"icmpcode,omitempty" doc:"the code for the ICMP message response"` IcmpType uint8 `json:"icmptype,omitempty" doc:"the type of the ICMP message response"` Protocol string `json:"protocol,omitempty" doc:"the protocol of the security group rule"` RuleID *UUID `json:"ruleid" doc:"the id of the security group rule"` SecurityGroupName string `json:"securitygroupname,omitempty" doc:"security group name"` StartPort uint16 `json:"startport,omitempty" doc:"the starting port of the security group rule"` } // EgressRule represents the ingress rule type EgressRule IngressRule // UserSecurityGroup represents the traffic of another security group type UserSecurityGroup struct { Group string `json:"group,omitempty"` } // String gives the UserSecurityGroup name func (usg UserSecurityGroup) String() string { return usg.Group } // CreateSecurityGroup represents a security group creation type CreateSecurityGroup struct { Name string `json:"name" doc:"name of the security group"` Description string `json:"description,omitempty" doc:"the description of the security group"` _ bool `name:"createSecurityGroup" description:"Creates a security group"` } // Response returns the struct to unmarshal func (CreateSecurityGroup) Response() interface{} { return new(SecurityGroup) } // DeleteSecurityGroup represents a security group deletion type DeleteSecurityGroup struct { ID *UUID `json:"id,omitempty" doc:"The ID of the security group. Mutually exclusive with name parameter"` Name string `json:"name,omitempty" doc:"The ID of the security group. Mutually exclusive with id parameter"` _ bool `name:"deleteSecurityGroup" description:"Deletes security group"` } // Response returns the struct to unmarshal func (DeleteSecurityGroup) Response() interface{} { return new(BooleanResponse) } // AuthorizeSecurityGroupIngress (Async) represents the ingress rule creation type AuthorizeSecurityGroupIngress struct { CIDRList []CIDR `json:"cidrlist,omitempty" doc:"the cidr list associated"` Description string `json:"description,omitempty" doc:"the description of the ingress/egress rule"` EndPort uint16 `json:"endport,omitempty" doc:"end port for this ingress/egress rule"` IcmpCode uint8 `json:"icmpcode,omitempty" doc:"error code for this icmp message"` IcmpType uint8 `json:"icmptype,omitempty" doc:"type of the icmp message being sent"` Protocol string `json:"protocol,omitempty" doc:"TCP is default. UDP, ICMP, ICMPv6, AH, ESP, GRE, IPIP are the other supported protocols"` SecurityGroupID *UUID `json:"securitygroupid,omitempty" doc:"The ID of the security group. Mutually exclusive with securitygroupname parameter"` SecurityGroupName string `json:"securitygroupname,omitempty" doc:"The name of the security group. Mutually exclusive with securitygroupid parameter"` StartPort uint16 `json:"startport,omitempty" doc:"start port for this ingress/egress rule"` UserSecurityGroupList []UserSecurityGroup `json:"usersecuritygrouplist,omitempty" doc:"user to security group mapping"` _ bool `name:"authorizeSecurityGroupIngress" description:"Authorize a particular ingress/egress rule for this security group"` } // Response returns the struct to unmarshal func (AuthorizeSecurityGroupIngress) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (AuthorizeSecurityGroupIngress) AsyncResponse() interface{} { return new(SecurityGroup) } func (req AuthorizeSecurityGroupIngress) onBeforeSend(params url.Values) error { // ICMP code and type may be zero but can also be omitted... if strings.HasPrefix(strings.ToLower(req.Protocol), "icmp") { params.Set("icmpcode", strconv.FormatInt(int64(req.IcmpCode), 10)) params.Set("icmptype", strconv.FormatInt(int64(req.IcmpType), 10)) } // StartPort may be zero but can also be omitted... if req.EndPort != 0 && req.StartPort == 0 { params.Set("startport", "0") } return nil } // AuthorizeSecurityGroupEgress (Async) represents the egress rule creation type AuthorizeSecurityGroupEgress AuthorizeSecurityGroupIngress // Response returns the struct to unmarshal func (AuthorizeSecurityGroupEgress) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (AuthorizeSecurityGroupEgress) AsyncResponse() interface{} { return new(SecurityGroup) } func (req AuthorizeSecurityGroupEgress) onBeforeSend(params url.Values) error { return (AuthorizeSecurityGroupIngress)(req).onBeforeSend(params) } // RevokeSecurityGroupIngress (Async) represents the ingress/egress rule deletion type RevokeSecurityGroupIngress struct { ID *UUID `json:"id" doc:"The ID of the ingress rule"` _ bool `name:"revokeSecurityGroupIngress" description:"Deletes a particular ingress rule from this security group"` } // Response returns the struct to unmarshal func (RevokeSecurityGroupIngress) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RevokeSecurityGroupIngress) AsyncResponse() interface{} { return new(BooleanResponse) } // RevokeSecurityGroupEgress (Async) represents the ingress/egress rule deletion type RevokeSecurityGroupEgress struct { ID *UUID `json:"id" doc:"The ID of the egress rule"` _ bool `name:"revokeSecurityGroupEgress" description:"Deletes a particular egress rule from this security group"` } // Response returns the struct to unmarshal func (RevokeSecurityGroupEgress) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RevokeSecurityGroupEgress) AsyncResponse() interface{} { return new(BooleanResponse) } //go:generate go run generate/main.go -interface=Listable ListSecurityGroups // ListSecurityGroups represents a search for security groups type ListSecurityGroups struct { ID *UUID `json:"id,omitempty" doc:"list the security group by the id provided"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` SecurityGroupName string `json:"securitygroupname,omitempty" doc:"lists security groups by name"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"lists security groups by virtual machine id"` _ bool `name:"listSecurityGroups" description:"Lists security groups"` } // ListSecurityGroupsResponse represents a list of security groups type ListSecurityGroupsResponse struct { Count int `json:"count"` SecurityGroup []SecurityGroup `json:"securitygroup"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/securitygroups_response.go���������������������0000664�0000000�0000000�00000002007�13771713062�0027757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListSecurityGroups) Response() interface{} { return new(ListSecurityGroupsResponse) } // ListRequest returns itself func (ls *ListSecurityGroups) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListSecurityGroups) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListSecurityGroups) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListSecurityGroups) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListSecurityGroupsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListSecurityGroupsResponse was expected, got %T", resp)) return } for i := range items.SecurityGroup { if !callback(&items.SecurityGroup[i], nil) { break } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/serialization.go�������������������������������0000664�0000000�0000000�00000021563�13771713062�0025617�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "encoding/base64" "fmt" "log" "net" "net/url" "reflect" "strconv" "strings" ) func csQuotePlus(s string) string { s = strings.Replace(s, "+", "%20", -1) return s } func csEncode(s string) string { return csQuotePlus(url.QueryEscape(s)) } // info returns the meta info of a command // // command is not a Command so it's easier to Test func info(command interface{}) (*CommandInfo, error) { typeof := reflect.TypeOf(command) // Going up the pointer chain to find the underlying struct for typeof.Kind() == reflect.Ptr { typeof = typeof.Elem() } field, ok := typeof.FieldByName("_") if !ok { return nil, fmt.Errorf(`missing meta ("_") field in %#v`, command) } name, nameOk := field.Tag.Lookup("name") description, _ := field.Tag.Lookup("description") if !nameOk { return nil, fmt.Errorf(`missing "name" key in the tag string of %#v`, command) } info := &CommandInfo{ Name: name, Description: description, } return info, nil } // prepareValues uses a command to build a POST request // // command is not a Command so it's easier to Test func prepareValues(prefix string, command interface{}) (url.Values, error) { params := url.Values{} value := reflect.ValueOf(command) typeof := reflect.TypeOf(command) // Going up the pointer chain to find the underlying struct for typeof.Kind() == reflect.Ptr { typeof = typeof.Elem() value = value.Elem() } // Checking for nil commands if !value.IsValid() { return nil, fmt.Errorf("cannot serialize the invalid value %#v", command) } for i := 0; i < typeof.NumField(); i++ { field := typeof.Field(i) if field.Name == "_" { continue } val := value.Field(i) tag := field.Tag var err error var name string var value interface{} if json, ok := tag.Lookup("json"); ok { n, required := ExtractJSONTag(field.Name, json) name = prefix + n switch val.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: value, err = prepareInt(val.Int(), required) case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: value, err = prepareUint(val.Uint(), required) case reflect.Float32, reflect.Float64: value, err = prepareFloat(val.Float(), required) case reflect.String: value, err = prepareString(val.String(), required) case reflect.Bool: value, err = prepareBool(val.Bool(), required) case reflect.Map: if val.Len() == 0 { if required { err = fmt.Errorf("field is required, got empty map") } } else { value, err = prepareMap(name, val.Interface()) } case reflect.Ptr: value, err = preparePtr(field.Type.Elem().Kind(), val, required) case reflect.Slice: value, err = prepareSlice(name, field.Type, val, required) case reflect.Struct: value, err = prepareStruct(val.Interface(), required) default: if required { err = fmt.Errorf("unsupported type") } } } else { switch val.Kind() { case reflect.Struct: value, err = prepareEmbedStruct(val.Interface()) default: log.Printf("[SKIP] %s.%s no json label found", typeof.Name(), field.Name) } } if err != nil { return nil, fmt.Errorf("%s.%s (%v) %s", typeof.Name(), field.Name, val.Kind(), err) } switch v := value.(type) { case *string: if name != "" && v != nil { params.Set(name, *v) } case url.Values: for k, xs := range v { for _, x := range xs { params.Add(k, x) } } } } return params, nil } func prepareInt(v int64, required bool) (*string, error) { if v == 0 { if required { return nil, fmt.Errorf("field is required, got %d", v) } return nil, nil } value := strconv.FormatInt(v, 10) return &value, nil } func prepareUint(v uint64, required bool) (*string, error) { if v == 0 { if required { return nil, fmt.Errorf("field is required, got %d", v) } return nil, nil } value := strconv.FormatUint(v, 10) return &value, nil } func prepareFloat(v float64, required bool) (*string, error) { if v == 0 { if required { return nil, fmt.Errorf("field is required, got %f", v) } return nil, nil } value := strconv.FormatFloat(v, 'f', -1, 64) return &value, nil } func prepareString(v string, required bool) (*string, error) { if v == "" { if required { return nil, fmt.Errorf("field is required, got %q", v) } return nil, nil } return &v, nil } func prepareBool(v bool, required bool) (*string, error) { value := strconv.FormatBool(v) if !v { if required { return &value, nil } return nil, nil } return &value, nil } func prepareList(prefix string, slice interface{}) (url.Values, error) { params := url.Values{} value := reflect.ValueOf(slice) for i := 0; i < value.Len(); i++ { ps, err := prepareValues(fmt.Sprintf("%s[%d].", prefix, i), value.Index(i).Interface()) if err != nil { return nil, err } for k, xs := range ps { for _, x := range xs { params.Add(k, x) } } } return params, nil } func prepareMap(prefix string, m interface{}) (url.Values, error) { value := url.Values{} v := reflect.ValueOf(m) for i, key := range v.MapKeys() { var keyName string var keyValue string switch key.Kind() { case reflect.String: keyName = key.String() default: return value, fmt.Errorf("only map[string]string are supported (XXX)") } val := v.MapIndex(key) switch val.Kind() { case reflect.String: keyValue = val.String() default: return value, fmt.Errorf("only map[string]string are supported (XXX)") } value.Set(fmt.Sprintf("%s[%d].%s", prefix, i, keyName), keyValue) } return value, nil } func preparePtr(kind reflect.Kind, val reflect.Value, required bool) (*string, error) { if val.IsNil() { if required { return nil, fmt.Errorf("field is required, got empty ptr") } return nil, nil } switch kind { case reflect.Bool: return prepareBool(val.Elem().Bool(), true) case reflect.Struct: return prepareStruct(val.Interface(), required) default: return nil, fmt.Errorf("kind %v is not supported as a ptr", kind) } } func prepareSlice(name string, fieldType reflect.Type, val reflect.Value, required bool) (interface{}, error) { switch fieldType.Elem().Kind() { case reflect.Uint8: switch fieldType { case reflect.TypeOf(net.IPv4zero): ip := (net.IP)(val.Bytes()) if ip == nil || ip.Equal(net.IP{}) { if required { return nil, fmt.Errorf("field is required, got zero IPv4 address") } } else { value := ip.String() return &value, nil } case reflect.TypeOf(MAC48(0, 0, 0, 0, 0, 0)): mac := val.Interface().(MACAddress) s := mac.String() if s == "" { if required { return nil, fmt.Errorf("field is required, got empty MAC address") } } else { return &s, nil } default: if val.Len() == 0 { if required { return nil, fmt.Errorf("field is required, got empty slice") } } else { value := base64.StdEncoding.EncodeToString(val.Bytes()) return &value, nil } } case reflect.String: if val.Len() == 0 { if required { return nil, fmt.Errorf("field is required, got empty slice") } } else { elems := make([]string, 0, val.Len()) for i := 0; i < val.Len(); i++ { // XXX what if the value contains a comma? Double encode? s := val.Index(i).String() elems = append(elems, s) } value := strings.Join(elems, ",") return &value, nil } default: switch fieldType.Elem() { case reflect.TypeOf(CIDR{}), reflect.TypeOf(UUID{}): if val.Len() == 0 { if required { return nil, fmt.Errorf("field is required, got empty slice") } } else { v := reflect.ValueOf(val.Interface()) ss := make([]string, val.Len()) for i := 0; i < v.Len(); i++ { e := v.Index(i).Interface() s, ok := e.(fmt.Stringer) if !ok { return nil, fmt.Errorf("not a String, %T", e) } ss[i] = s.String() } value := strings.Join(ss, ",") return &value, nil } default: if val.Len() == 0 { if required { return nil, fmt.Errorf("field is required, got empty slice") } } else { return prepareList(name, val.Interface()) } } } return nil, nil } func prepareStruct(i interface{}, required bool) (*string, error) { s, ok := i.(fmt.Stringer) if !ok { return nil, fmt.Errorf("struct field not a Stringer") } if s == nil { if required { return nil, fmt.Errorf("field is required, got %#v", s) } } return prepareString(s.String(), required) } func prepareEmbedStruct(i interface{}) (url.Values, error) { return prepareValues("", i) } // ExtractJSONTag returns the variable name or defaultName as well as if the field is required (!omitempty) func ExtractJSONTag(defaultName, jsonTag string) (string, bool) { tags := strings.Split(jsonTag, ",") name := tags[0] required := true for _, tag := range tags { if tag == "omitempty" { required = false } } if name == "" || name == "omitempty" { name = defaultName } return name, required } ���������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/service_offerings.go���������������������������0000664�0000000�0000000�00000013562�13771713062�0026444�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // ServiceOffering corresponds to the Compute Offerings // // A service offering correspond to some hardware features (CPU, RAM). // // See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/service_offerings.html type ServiceOffering struct { Authorized bool `json:"authorized,omitempty" doc:"is the account/domain authorized to use this service offering"` CPUNumber int `json:"cpunumber,omitempty" doc:"the number of CPU"` CPUSpeed int `json:"cpuspeed,omitempty" doc:"the clock rate CPU speed in Mhz"` Created string `json:"created,omitempty" doc:"the date this service offering was created"` DefaultUse bool `json:"defaultuse,omitempty" doc:"is this a default system vm offering"` DeploymentPlanner string `json:"deploymentplanner,omitempty" doc:"deployment strategy used to deploy VM."` DiskBytesReadRate int64 `json:"diskBytesReadRate,omitempty" doc:"bytes read rate of the service offering"` DiskBytesWriteRate int64 `json:"diskBytesWriteRate,omitempty" doc:"bytes write rate of the service offering"` DiskIopsReadRate int64 `json:"diskIopsReadRate,omitempty" doc:"io requests read rate of the service offering"` DiskIopsWriteRate int64 `json:"diskIopsWriteRate,omitempty" doc:"io requests write rate of the service offering"` Displaytext string `json:"displaytext,omitempty" doc:"an alternate display text of the service offering."` HostTags string `json:"hosttags,omitempty" doc:"the host tag for the service offering"` HypervisorSnapshotReserve int `json:"hypervisorsnapshotreserve,omitempty" doc:"Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)"` ID *UUID `json:"id" doc:"the id of the service offering"` IsCustomized bool `json:"iscustomized,omitempty" doc:"is true if the offering is customized"` IsCustomizedIops bool `json:"iscustomizediops,omitempty" doc:"true if disk offering uses custom iops, false otherwise"` IsSystem bool `json:"issystem,omitempty" doc:"is this a system vm offering"` IsVolatile bool `json:"isvolatile,omitempty" doc:"true if the vm needs to be volatile, i.e., on every reboot of vm from API root disk is discarded and creates a new root disk"` LimitCPUUse bool `json:"limitcpuuse,omitempty" doc:"restrict the CPU usage to committed service offering"` MaxIops int64 `json:"maxiops,omitempty" doc:"the max iops of the disk offering"` Memory int `json:"memory,omitempty" doc:"the memory in MB"` MinIops int64 `json:"miniops,omitempty" doc:"the min iops of the disk offering"` Name string `json:"name,omitempty" doc:"the name of the service offering"` NetworkRate int `json:"networkrate,omitempty" doc:"data transfer rate in megabits per second allowed."` OfferHA bool `json:"offerha,omitempty" doc:"the ha support in the service offering"` Restricted bool `json:"restricted,omitempty" doc:"is this offering restricted"` ServiceOfferingDetails map[string]string `json:"serviceofferingdetails,omitempty" doc:"additional key/value details tied with this service offering"` StorageType string `json:"storagetype,omitempty" doc:"the storage type for this service offering"` SystemVMType string `json:"systemvmtype,omitempty" doc:"is this a the systemvm type for system vm offering"` Tags string `json:"tags,omitempty" doc:"the tags for the service offering"` } // ListRequest builds the ListSecurityGroups request func (so ServiceOffering) ListRequest() (ListCommand, error) { // Restricted cannot be applied here because it really has three states req := &ListServiceOfferings{ ID: so.ID, Name: so.Name, SystemVMType: so.SystemVMType, } if so.IsSystem { req.IsSystem = &so.IsSystem } return req, nil } //go:generate go run generate/main.go -interface=Listable ListServiceOfferings // ListServiceOfferings represents a query for service offerings type ListServiceOfferings struct { ID *UUID `json:"id,omitempty" doc:"ID of the service offering"` IsSystem *bool `json:"issystem,omitempty" doc:"is this a system vm offering"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"name of the service offering"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` Restricted *bool `json:"restricted,omitempty" doc:"filter by the restriction flag: true to list only the restricted service offerings, false to list non-restricted service offerings, or nothing for all."` SystemVMType string `json:"systemvmtype,omitempty" doc:"the system VM type. Possible types are \"consoleproxy\", \"secondarystoragevm\" or \"domainrouter\"."` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"the ID of the virtual machine. Pass this in if you want to see the available service offering that a virtual machine can be changed to."` _ bool `name:"listServiceOfferings" description:"Lists all available service offerings."` } // ListServiceOfferingsResponse represents a list of service offerings type ListServiceOfferingsResponse struct { Count int `json:"count"` ServiceOffering []ServiceOffering `json:"serviceoffering"` } ����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/serviceofferings_response.go�������������������0000664�0000000�0000000�00000002033�13771713062�0030212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListServiceOfferings) Response() interface{} { return new(ListServiceOfferingsResponse) } // ListRequest returns itself func (ls *ListServiceOfferings) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListServiceOfferings) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListServiceOfferings) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListServiceOfferings) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListServiceOfferingsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListServiceOfferingsResponse was expected, got %T", resp)) return } for i := range items.ServiceOffering { if !callback(&items.ServiceOffering[i], nil) { break } } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/snapshots.go�����������������������������������0000664�0000000�0000000�00000013651�13771713062�0024763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // SnapshotState represents the Snapshot.State enum // // See: https://github.com/apache/cloudstack/blob/master/api/src/main/java/com/cloud/storage/Snapshot.java type SnapshotState string const ( // Allocated ... (TODO) Allocated SnapshotState = "Allocated" // Creating ... (TODO) Creating SnapshotState = "Creating" // CreatedOnPrimary ... (TODO) CreatedOnPrimary SnapshotState = "CreatedOnPrimary" // BackingUp ... (TODO) BackingUp SnapshotState = "BackingUp" // BackedUp ... (TODO) BackedUp SnapshotState = "BackedUp" // Copying ... (TODO) Copying SnapshotState = "Copying" // Destroying ... (TODO) Destroying SnapshotState = "Destroying" // Destroyed ... (TODO) Destroyed SnapshotState = "Destroyed" // Error is a state where the user can't see the snapshot while the snapshot may still exist on the storage Error SnapshotState = "Error" ) // Snapshot represents a volume snapshot type Snapshot struct { Account string `json:"account,omitempty" doc:"the account associated with the snapshot"` AccountID *UUID `json:"accountid,omitempty" doc:"the account ID associated with the snapshot"` Created string `json:"created,omitempty" doc:"the date the snapshot was created"` ID *UUID `json:"id,omitempty" doc:"ID of the snapshot"` IntervalType string `json:"intervaltype,omitempty" doc:"valid types are hourly, daily, weekly, monthy, template, and none."` Name string `json:"name,omitempty" doc:"name of the snapshot"` PhysicalSize int64 `json:"physicalsize,omitempty" doc:"physical size of the snapshot on image store"` Revertable *bool `json:"revertable,omitempty" doc:"indicates whether the underlying storage supports reverting the volume to this snapshot"` Size int64 `json:"size,omitempty" doc:"the size of original volume"` SnapshotType string `json:"snapshottype,omitempty" doc:"the type of the snapshot"` State string `json:"state,omitempty" doc:"the state of the snapshot. BackedUp means that snapshot is ready to be used; Creating - the snapshot is being allocated on the primary storage; BackingUp - the snapshot is being backed up on secondary storage"` Tags []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with snapshot"` VolumeID *UUID `json:"volumeid,omitempty" doc:"ID of the disk volume"` VolumeName string `json:"volumename,omitempty" doc:"name of the disk volume"` VolumeType string `json:"volumetype,omitempty" doc:"type of the disk volume"` ZoneID *UUID `json:"zoneid,omitempty" doc:"id of the availability zone"` } // ResourceType returns the type of the resource func (Snapshot) ResourceType() string { return "Snapshot" } // CreateSnapshot (Async) creates an instant snapshot of a volume type CreateSnapshot struct { VolumeID *UUID `json:"volumeid" doc:"The ID of the disk volume"` QuiesceVM *bool `json:"quiescevm,omitempty" doc:"quiesce vm if true"` _ bool `name:"createSnapshot" description:"Creates an instant snapshot of a volume."` } // Response returns the struct to unmarshal func (CreateSnapshot) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (CreateSnapshot) AsyncResponse() interface{} { return new(Snapshot) } // ListRequest builds the ListSnapshot request func (ss Snapshot) ListRequest() (ListCommand, error) { // Restricted cannot be applied here because it really has three states req := &ListSnapshots{ ID: ss.ID, Name: ss.Name, VolumeID: ss.VolumeID, SnapshotType: ss.SnapshotType, ZoneID: ss.ZoneID, // TODO: tags } return req, nil } //go:generate go run generate/main.go -interface=Listable ListSnapshots // ListSnapshots lists the volume snapshots type ListSnapshots struct { ID *UUID `json:"id,omitempty" doc:"lists snapshot by snapshot ID"` IntervalType string `json:"intervaltype,omitempty" doc:"valid values are HOURLY, DAILY, WEEKLY, and MONTHLY."` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"lists snapshot by snapshot name"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` SnapshotType string `json:"snapshottype,omitempty" doc:"valid values are MANUAL or RECURRING."` Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"` VolumeID *UUID `json:"volumeid,omitempty" doc:"the ID of the disk volume"` ZoneID *UUID `json:"zoneid,omitempty" doc:"list snapshots by zone id"` _ bool `name:"listSnapshots" description:"Lists all available snapshots for the account."` } // ListSnapshotsResponse represents a list of volume snapshots type ListSnapshotsResponse struct { Count int `json:"count"` Snapshot []Snapshot `json:"snapshot"` } // DeleteSnapshot (Async) deletes a snapshot of a disk volume type DeleteSnapshot struct { ID *UUID `json:"id" doc:"The ID of the snapshot"` _ bool `name:"deleteSnapshot" description:"Deletes a snapshot of a disk volume."` } // Response returns the struct to unmarshal func (DeleteSnapshot) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DeleteSnapshot) AsyncResponse() interface{} { return new(BooleanResponse) } // RevertSnapshot (Async) reverts a volume snapshot type RevertSnapshot struct { ID *UUID `json:"id" doc:"The ID of the snapshot"` _ bool `name:"revertSnapshot" description:"revert a volume snapshot."` } // Response returns the struct to unmarshal func (RevertSnapshot) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RevertSnapshot) AsyncResponse() interface{} { return new(BooleanResponse) } ���������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/snapshots_response.go��������������������������0000664�0000000�0000000�00000001725�13771713062�0026700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListSnapshots) Response() interface{} { return new(ListSnapshotsResponse) } // ListRequest returns itself func (ls *ListSnapshots) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListSnapshots) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListSnapshots) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListSnapshots) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListSnapshotsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListSnapshotsResponse was expected, got %T", resp)) return } for i := range items.Snapshot { if !callback(&items.Snapshot[i], nil) { break } } } �������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/ssh_keypairs.go��������������������������������0000664�0000000�0000000�00000007222�13771713062�0025442�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "context" "fmt" ) // SSHKeyPair represents an SSH key pair // // See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html#creating-the-ssh-keypair type SSHKeyPair struct { Fingerprint string `json:"fingerprint,omitempty" doc:"Fingerprint of the public key"` Name string `json:"name,omitempty" doc:"Name of the keypair"` PrivateKey string `json:"privatekey,omitempty" doc:"Private key"` } // Delete removes the given SSH key, by Name func (ssh SSHKeyPair) Delete(ctx context.Context, client *Client) error { if ssh.Name == "" { return fmt.Errorf("an SSH Key Pair may only be deleted using Name") } return client.BooleanRequestWithContext(ctx, &DeleteSSHKeyPair{ Name: ssh.Name, }) } // ListRequest builds the ListSSHKeyPairs request func (ssh SSHKeyPair) ListRequest() (ListCommand, error) { req := &ListSSHKeyPairs{ Fingerprint: ssh.Fingerprint, Name: ssh.Name, } return req, nil } // CreateSSHKeyPair represents a new keypair to be created type CreateSSHKeyPair struct { Name string `json:"name" doc:"Name of the keypair"` _ bool `name:"createSSHKeyPair" description:"Create a new keypair and returns the private key"` } // Response returns the struct to unmarshal func (CreateSSHKeyPair) Response() interface{} { return new(SSHKeyPair) } // DeleteSSHKeyPair represents a new keypair to be created type DeleteSSHKeyPair struct { Name string `json:"name" doc:"Name of the keypair"` _ bool `name:"deleteSSHKeyPair" description:"Deletes a keypair by name"` } // Response returns the struct to unmarshal func (DeleteSSHKeyPair) Response() interface{} { return new(BooleanResponse) } // RegisterSSHKeyPair represents a new registration of a public key in a keypair type RegisterSSHKeyPair struct { Name string `json:"name" doc:"Name of the keypair"` PublicKey string `json:"publickey" doc:"Public key material of the keypair"` _ bool `name:"registerSSHKeyPair" description:"Register a public key in a keypair under a certain name"` } // Response returns the struct to unmarshal func (RegisterSSHKeyPair) Response() interface{} { return new(SSHKeyPair) } //go:generate go run generate/main.go -interface=Listable ListSSHKeyPairs // ListSSHKeyPairs represents a query for a list of SSH KeyPairs type ListSSHKeyPairs struct { Fingerprint string `json:"fingerprint,omitempty" doc:"A public key fingerprint to look for"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"A key pair name to look for"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` _ bool `name:"listSSHKeyPairs" description:"List registered keypairs"` } // ListSSHKeyPairsResponse represents a list of SSH key pairs type ListSSHKeyPairsResponse struct { Count int `json:"count"` SSHKeyPair []SSHKeyPair `json:"sshkeypair"` } // ResetSSHKeyForVirtualMachine (Async) represents a change for the key pairs type ResetSSHKeyForVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` KeyPair string `json:"keypair" doc:"Name of the ssh key pair used to login to the virtual machine"` _ bool `name:"resetSSHKeyForVirtualMachine" description:"Resets the SSH Key for virtual machine. The virtual machine must be in a \"Stopped\" state."` } // Response returns the struct to unmarshal func (ResetSSHKeyForVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (ResetSSHKeyForVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/sshkeypairs_response.go������������������������0000664�0000000�0000000�00000001751�13771713062�0027222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListSSHKeyPairs) Response() interface{} { return new(ListSSHKeyPairsResponse) } // ListRequest returns itself func (ls *ListSSHKeyPairs) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListSSHKeyPairs) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListSSHKeyPairs) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListSSHKeyPairs) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListSSHKeyPairsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListSSHKeyPairsResponse was expected, got %T", resp)) return } for i := range items.SSHKeyPair { if !callback(&items.SSHKeyPair[i], nil) { break } } } �����������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/tags.go����������������������������������������0000664�0000000�0000000�00000006416�13771713062�0023700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // ResourceTag is a tag associated with a resource // // https://community.exoscale.com/documentation/compute/instance-tags/ type ResourceTag struct { Account string `json:"account,omitempty" doc:"the account associated with the tag"` Customer string `json:"customer,omitempty" doc:"customer associated with the tag"` Key string `json:"key,omitempty" doc:"tag key name"` ResourceID *UUID `json:"resourceid,omitempty" doc:"id of the resource"` ResourceType string `json:"resourcetype,omitempty" doc:"resource type"` Value string `json:"value,omitempty" doc:"tag value"` } // ListRequest builds the ListZones request func (tag ResourceTag) ListRequest() (ListCommand, error) { req := &ListTags{ Customer: tag.Customer, Key: tag.Key, ResourceID: tag.ResourceID, ResourceType: tag.ResourceType, Value: tag.Value, } return req, nil } // CreateTags (Async) creates resource tag(s) type CreateTags struct { ResourceIDs []UUID `json:"resourceids" doc:"list of resources to create the tags for"` ResourceType string `json:"resourcetype" doc:"type of the resource"` Tags []ResourceTag `json:"tags" doc:"Map of tags (key/value pairs)"` Customer string `json:"customer,omitempty" doc:"identifies client specific tag. When the value is not null, the tag can't be used by cloudStack code internally"` _ bool `name:"createTags" description:"Creates resource tag(s)"` } // Response returns the struct to unmarshal func (CreateTags) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (CreateTags) AsyncResponse() interface{} { return new(BooleanResponse) } // DeleteTags (Async) deletes the resource tag(s) type DeleteTags struct { ResourceIDs []UUID `json:"resourceids" doc:"Delete tags for resource id(s)"` ResourceType string `json:"resourcetype" doc:"Delete tag by resource type"` Tags []ResourceTag `json:"tags,omitempty" doc:"Delete tags matching key/value pairs"` _ bool `name:"deleteTags" description:"Deleting resource tag(s)"` } // Response returns the struct to unmarshal func (DeleteTags) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DeleteTags) AsyncResponse() interface{} { return new(BooleanResponse) } //go:generate go run generate/main.go -interface=Listable ListTags // ListTags list resource tag(s) type ListTags struct { Customer string `json:"customer,omitempty" doc:"list by customer name"` Key string `json:"key,omitempty" doc:"list by key"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` ResourceID *UUID `json:"resourceid,omitempty" doc:"list by resource id"` ResourceType string `json:"resourcetype,omitempty" doc:"list by resource type"` Value string `json:"value,omitempty" doc:"list by value"` _ bool `name:"listTags" description:"List resource tag(s)"` } // ListTagsResponse represents a list of resource tags type ListTagsResponse struct { Count int `json:"count"` Tag []ResourceTag `json:"tag"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/tags_response.go�������������������������������0000664�0000000�0000000�00000001643�13771713062�0025613�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListTags) Response() interface{} { return new(ListTagsResponse) } // ListRequest returns itself func (ls *ListTags) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListTags) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListTags) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListTags) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListTagsResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListTagsResponse was expected, got %T", resp)) return } for i := range items.Tag { if !callback(&items.Tag[i], nil) { break } } } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/templates.go�����������������������������������0000664�0000000�0000000�00000023111�13771713062�0024727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // Template represents a machine to be deployed. type Template struct { Account string `json:"account,omitempty" doc:"the account name to which the template belongs"` AccountID *UUID `json:"accountid,omitempty" doc:"the account id to which the template belongs"` Bootable bool `json:"bootable,omitempty" doc:"true if the ISO is bootable, false otherwise"` Checksum string `json:"checksum,omitempty" doc:"checksum of the template"` Created string `json:"created,omitempty" doc:"the date this template was created"` CrossZones bool `json:"crossZones,omitempty" doc:"true if the template is managed across all Zones, false otherwise"` Details map[string]string `json:"details,omitempty" doc:"additional key/value details tied with template"` DisplayText string `json:"displaytext,omitempty" doc:"the template display text"` Format string `json:"format,omitempty" doc:"the format of the template."` HostID *UUID `json:"hostid,omitempty" doc:"the ID of the secondary storage host for the template"` HostName string `json:"hostname,omitempty" doc:"the name of the secondary storage host for the template"` Hypervisor string `json:"hypervisor,omitempty" doc:"the target hypervisor for the template"` ID *UUID `json:"id,omitempty" doc:"the template ID"` IsDynamicallyScalable bool `json:"isdynamicallyscalable,omitempty" doc:"true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory"` IsExtractable bool `json:"isextractable,omitempty" doc:"true if the template is extractable, false otherwise"` IsFeatured bool `json:"isfeatured,omitempty" doc:"true if this template is a featured template, false otherwise"` IsPublic bool `json:"ispublic,omitempty" doc:"true if this template is a public template, false otherwise"` IsReady bool `json:"isready,omitempty" doc:"true if the template is ready to be deployed from, false otherwise."` Name string `json:"name,omitempty" doc:"the template name"` OsCategoryID *UUID `json:"oscategoryid,omitempty" doc:"the ID of the OS category for this template"` OsCategoryName string `json:"oscategoryname,omitempty" doc:"the name of the OS category for this template"` OsTypeID *UUID `json:"ostypeid,omitempty" doc:"the ID of the OS type for this template"` OsTypeName string `json:"ostypename,omitempty" doc:"the name of the OS type for this template"` PasswordEnabled bool `json:"passwordenabled,omitempty" doc:"true if the reset password feature is enabled, false otherwise"` Removed string `json:"removed,omitempty" doc:"the date this template was removed"` Size int64 `json:"size,omitempty" doc:"the size of the template"` SourceTemplateID *UUID `json:"sourcetemplateid,omitempty" doc:"the template ID of the parent template if present"` SSHKeyEnabled bool `json:"sshkeyenabled,omitempty" doc:"true if template is sshkey enabled, false otherwise"` Status string `json:"status,omitempty" doc:"the status of the template"` Tags []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with tempate"` TemplateDirectory string `json:"templatedirectory,omitempty" doc:"Template directory"` TemplateTag string `json:"templatetag,omitempty" doc:"the tag of this template"` TemplateType string `json:"templatetype,omitempty" doc:"the type of the template"` URL string `json:"url,omitempty" doc:"Original URL of the template where it was downloaded"` ZoneID *UUID `json:"zoneid,omitempty" doc:"the ID of the zone for this template"` ZoneName string `json:"zonename,omitempty" doc:"the name of the zone for this template"` } // ResourceType returns the type of the resource func (Template) ResourceType() string { return "Template" } // ListRequest builds the ListTemplates request func (template Template) ListRequest() (ListCommand, error) { req := &ListTemplates{ ID: template.ID, Name: template.Name, ZoneID: template.ZoneID, } if template.IsFeatured { req.TemplateFilter = "featured" } if template.Removed != "" { *req.ShowRemoved = true } for i := range template.Tags { req.Tags = append(req.Tags, template.Tags[i]) } return req, nil } //go:generate go run generate/main.go -interface=Listable ListTemplates // ListTemplates represents a template query filter type ListTemplates struct { TemplateFilter string `json:"templatefilter" doc:"Possible values are \"featured\", \"self\", \"selfexecutable\",\"sharedexecutable\",\"executable\", and \"community\". * featured : templates that have been marked as featured and public. * self : templates that have been registered or created by the calling user. * selfexecutable : same as self, but only returns templates that can be used to deploy a new VM. * sharedexecutable : templates ready to be deployed that have been granted to the calling user by another user. * executable : templates that are owned by the calling user, or public templates, that can be used to deploy a VM. * community : templates that have been marked as public but not featured."` ID *UUID `json:"id,omitempty" doc:"the template ID"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"the template name"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` ShowRemoved *bool `json:"showremoved,omitempty" doc:"Show removed templates as well"` Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"` ZoneID *UUID `json:"zoneid,omitempty" doc:"list templates by zoneid"` _ bool `name:"listTemplates" description:"List all public, private, and privileged templates."` } // ListTemplatesResponse represents a list of templates type ListTemplatesResponse struct { Count int `json:"count"` Template []Template `json:"template"` } // OSCategory represents an OS category type OSCategory struct { ID *UUID `json:"id,omitempty" doc:"the ID of the OS category"` Name string `json:"name,omitempty" doc:"the name of the OS category"` } // ListRequest builds the ListOSCategories request func (osCat OSCategory) ListRequest() (ListCommand, error) { req := &ListOSCategories{ Name: osCat.Name, ID: osCat.ID, } return req, nil } //go:generate go run generate/main.go -interface=Listable ListOSCategories // ListOSCategories lists the OS categories type ListOSCategories struct { ID *UUID `json:"id,omitempty" doc:"list Os category by id"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"list os category by name"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` _ bool `name:"listOsCategories" description:"Lists all supported OS categories for this cloud."` } // ListOSCategoriesResponse represents a list of OS categories type ListOSCategoriesResponse struct { Count int `json:"count"` OSCategory []OSCategory `json:"oscategory"` } // DeleteTemplate deletes a template by ID type DeleteTemplate struct { _ bool `name:"deleteTemplate" description:"Deletes a template"` ID *UUID `json:"id" doc:"the ID of the template"` } // Response returns the struct to unmarshal func (DeleteTemplate) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DeleteTemplate) AsyncResponse() interface{} { return new(BooleanResponse) } // RegisterCustomTemplate registers a new template type RegisterCustomTemplate struct { _ bool `name:"registerCustomTemplate" description:"Register a new template."` Checksum string `json:"checksum" doc:"the MD5 checksum value of this template"` Details map[string]string `json:"details,omitempty" doc:"Template details in key/value pairs"` Displaytext string `json:"displaytext" doc:"the display text of the template"` Name string `json:"name" doc:"the name of the template"` PasswordEnabled *bool `json:"passwordenabled,omitempty" doc:"true if the template supports the password reset feature; default is false"` SSHKeyEnabled *bool `json:"sshkeyenabled,omitempty" doc:"true if the template supports the sshkey upload feature; default is false"` TemplateTag string `json:"templatetag,omitempty" doc:"the tag for this template"` URL string `json:"url" doc:"the URL of where the template is hosted"` ZoneID *UUID `json:"zoneid" doc:"the ID of the zone the template is to be hosted on"` } // Response returns the struct to unmarshal func (RegisterCustomTemplate) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RegisterCustomTemplate) AsyncResponse() interface{} { return new([]Template) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/templates_response.go��������������������������0000664�0000000�0000000�00000001725�13771713062�0026654�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListTemplates) Response() interface{} { return new(ListTemplatesResponse) } // ListRequest returns itself func (ls *ListTemplates) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListTemplates) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListTemplates) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListTemplates) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListTemplatesResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListTemplatesResponse was expected, got %T", resp)) return } for i := range items.Template { if !callback(&items.Template[i], nil) { break } } } �������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/users.go���������������������������������������0000664�0000000�0000000�00000005627�13771713062�0024106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // User represents a User type User struct { APIKey string `json:"apikey,omitempty" doc:"the api key of the user"` Account string `json:"account,omitempty" doc:"the account name of the user"` AccountID *UUID `json:"accountid,omitempty" doc:"the account ID of the user"` Created string `json:"created,omitempty" doc:"the date and time the user account was created"` Email string `json:"email,omitempty" doc:"the user email address"` FirstName string `json:"firstname,omitempty" doc:"the user firstname"` ID *UUID `json:"id,omitempty" doc:"the user ID"` IsDefault bool `json:"isdefault,omitempty" doc:"true if user is default, false otherwise"` LastName string `json:"lastname,omitempty" doc:"the user lastname"` RoleID *UUID `json:"roleid,omitempty" doc:"the ID of the role"` RoleName string `json:"rolename,omitempty" doc:"the name of the role"` RoleType string `json:"roletype,omitempty" doc:"the type of the role"` SecretKey string `json:"secretkey,omitempty" doc:"the secret key of the user"` State string `json:"state,omitempty" doc:"the user state"` Timezone string `json:"timezone,omitempty" doc:"the timezone user was created in"` UserName string `json:"username,omitempty" doc:"the user name"` } // ListRequest builds the ListUsers request func (user User) ListRequest() (ListCommand, error) { req := &ListUsers{ ID: user.ID, UserName: user.UserName, } return req, nil } // RegisterUserKeys registers a new set of key of the given user // // NB: only the APIKey and SecretKey will be filled type RegisterUserKeys struct { ID *UUID `json:"id" doc:"User id"` _ bool `name:"registerUserKeys" description:"This command allows a user to register for the developer API, returning a secret key and an API key. This request is made through the integration API port, so it is a privileged command and must be made on behalf of a user. It is up to the implementer just how the username and password are entered, and then how that translates to an integration API request. Both secret key and API key should be returned to the user"` } // Response returns the struct to unmarshal func (RegisterUserKeys) Response() interface{} { return new(User) } //go:generate go run generate/main.go -interface=Listable ListUsers // ListUsers represents the search for Users type ListUsers struct { ID *UUID `json:"id,omitempty" doc:"List user by ID."` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` State string `json:"state,omitempty" doc:"List users by state of the user account."` UserName string `json:"username,omitempty" doc:"List user by the username"` _ bool `name:"listUsers" description:"Lists user accounts"` } // ListUsersResponse represents a list of users type ListUsersResponse struct { Count int `json:"count"` User []User `json:"user"` } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/users_response.go������������������������������0000664�0000000�0000000�00000001655�13771713062�0026021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListUsers) Response() interface{} { return new(ListUsersResponse) } // ListRequest returns itself func (ls *ListUsers) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListUsers) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListUsers) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListUsers) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListUsersResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListUsersResponse was expected, got %T", resp)) return } for i := range items.User { if !callback(&items.User[i], nil) { break } } } �����������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/uuid.go����������������������������������������0000664�0000000�0000000�00000002615�13771713062�0023705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "encoding/json" "fmt" uuid "github.com/gofrs/uuid" ) // UUID holds a UUID v4 type UUID struct { uuid.UUID } // DeepCopy create a true copy of the receiver. func (u *UUID) DeepCopy() *UUID { if u == nil { return nil } out := [uuid.Size]byte{} copy(out[:], u.Bytes()) return &UUID{ (uuid.UUID)(out), } } // DeepCopyInto copies the receiver into out. // // In must be non nil. func (u *UUID) DeepCopyInto(out *UUID) { o := [uuid.Size]byte{} copy(o[:], u.Bytes()) out.UUID = (uuid.UUID)(o) } // Equal returns true if itself is equal to other. func (u UUID) Equal(other UUID) bool { return u == other } // UnmarshalJSON unmarshals the raw JSON into the UUID. func (u *UUID) UnmarshalJSON(b []byte) error { var s string if err := json.Unmarshal(b, &s); err != nil { return err } new, err := ParseUUID(s) if err == nil { u.UUID = new.UUID } return err } // MarshalJSON converts the UUID to a string representation. func (u UUID) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf("%q", u.String())), nil } // ParseUUID parses a string into a UUID. func ParseUUID(s string) (*UUID, error) { u, err := uuid.FromString(s) if err != nil { return nil, err } return &UUID{u}, nil } // MustParseUUID acts like ParseUUID but panic in case of a failure. func MustParseUUID(s string) *UUID { u, e := ParseUUID(s) if e != nil { panic(e) } return u } �������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/version.go�������������������������������������0000664�0000000�0000000�00000000105�13771713062�0024414�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // Version of the library const Version = "0.18.1" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/virtual_machines.go����������������������������0000664�0000000�0000000�00000101110�13771713062�0026262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "bytes" "compress/gzip" "context" "encoding/base64" "fmt" "io/ioutil" "net" "net/url" ) // VirtualMachineState holds the state of the instance // // https://github.com/apache/cloudstack/blob/master/api/src/main/java/com/cloud/vm/VirtualMachine.java type VirtualMachineState string const ( // VirtualMachineStarting VM is being started. At this state, you should find host id filled which means it's being started on that host VirtualMachineStarting VirtualMachineState = "Starting" // VirtualMachineRunning VM is running. host id has the host that it is running on VirtualMachineRunning VirtualMachineState = "Running" // VirtualMachineStopping VM is being stopped. host id has the host that it is being stopped on VirtualMachineStopping VirtualMachineState = "Stopping" // VirtualMachineStopped VM is stopped. host id should be null VirtualMachineStopped VirtualMachineState = "Stopped" // VirtualMachineDestroyed VM is marked for destroy VirtualMachineDestroyed VirtualMachineState = "Destroyed" // VirtualMachineExpunging "VM is being expunged VirtualMachineExpunging VirtualMachineState = "Expunging" // VirtualMachineMigrating VM is being live migrated. host id holds destination host, last host id holds source host VirtualMachineMigrating VirtualMachineState = "Migrating" // VirtualMachineMoving VM is being migrated offline (volume is being moved). VirtualMachineMoving VirtualMachineState = "Moving" // VirtualMachineError VM is in error VirtualMachineError VirtualMachineState = "Error" // VirtualMachineUnknown VM state is unknown VirtualMachineUnknown VirtualMachineState = "Unknown" // VirtualMachineShutdowned VM is shutdowned from inside VirtualMachineShutdowned VirtualMachineState = "Shutdowned" ) // VirtualMachine represents a virtual machine // // See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/stable/virtual_machines.html type VirtualMachine struct { Account string `json:"account,omitempty" doc:"the account associated with the virtual machine"` AccountID *UUID `json:"accountid,omitempty" doc:"the account ID associated with the virtual machine"` AffinityGroup []AffinityGroup `json:"affinitygroup,omitempty" doc:"list of affinity groups associated with the virtual machine"` ClusterID *UUID `json:"clusterid,omitempty" doc:"the ID of the vm's cluster"` ClusterName string `json:"clustername,omitempty" doc:"the name of the vm's cluster"` CPUNumber int `json:"cpunumber,omitempty" doc:"the number of cpu this virtual machine is running with"` CPUSpeed int `json:"cpuspeed,omitempty" doc:"the speed of each cpu"` CPUUsed string `json:"cpuused,omitempty" doc:"the amount of the vm's CPU currently used"` Created string `json:"created,omitempty" doc:"the date when this virtual machine was created"` Details map[string]string `json:"details,omitempty" doc:"Vm details in key/value pairs."` DiskIoRead int64 `json:"diskioread,omitempty" doc:"the read (io) of disk on the vm"` DiskIoWrite int64 `json:"diskiowrite,omitempty" doc:"the write (io) of disk on the vm"` DiskKbsRead int64 `json:"diskkbsread,omitempty" doc:"the read (bytes) of disk on the vm"` DiskKbsWrite int64 `json:"diskkbswrite,omitempty" doc:"the write (bytes) of disk on the vm"` DiskOfferingID *UUID `json:"diskofferingid,omitempty" doc:"the ID of the disk offering of the virtual machine"` DiskOfferingName string `json:"diskofferingname,omitempty" doc:"the name of the disk offering of the virtual machine"` DisplayName string `json:"displayname,omitempty" doc:"user generated name. The name of the virtual machine is returned if no displayname exists."` ForVirtualNetwork bool `json:"forvirtualnetwork,omitempty" doc:"the virtual network for the service offering"` Group string `json:"group,omitempty" doc:"the group name of the virtual machine"` GroupID *UUID `json:"groupid,omitempty" doc:"the group ID of the virtual machine"` HAEnable bool `json:"haenable,omitempty" doc:"true if high-availability is enabled, false otherwise"` HostName string `json:"hostname,omitempty" doc:"the name of the host for the virtual machine"` ID *UUID `json:"id,omitempty" doc:"the ID of the virtual machine"` InstanceName string `json:"instancename,omitempty" doc:"instance name of the user vm; this parameter is returned to the ROOT admin only"` IsoDisplayText string `json:"isodisplaytext,omitempty" doc:"an alternate display text of the ISO attached to the virtual machine"` IsoID *UUID `json:"isoid,omitempty" doc:"the ID of the ISO attached to the virtual machine"` IsoName string `json:"isoname,omitempty" doc:"the name of the ISO attached to the virtual machine"` KeyPair string `json:"keypair,omitempty" doc:"ssh key-pair"` Memory int `json:"memory,omitempty" doc:"the memory allocated for the virtual machine"` Name string `json:"name,omitempty" doc:"the name of the virtual machine"` NetworkKbsRead int64 `json:"networkkbsread,omitempty" doc:"the incoming network traffic on the vm"` NetworkKbsWrite int64 `json:"networkkbswrite,omitempty" doc:"the outgoing network traffic on the host"` Nic []Nic `json:"nic,omitempty" doc:"the list of nics associated with vm"` OSCategoryID *UUID `json:"oscategoryid,omitempty" doc:"Os category ID of the virtual machine"` OSCategoryName string `json:"oscategoryname,omitempty" doc:"Os category name of the virtual machine"` OSTypeID *UUID `json:"ostypeid,omitempty" doc:"OS type id of the vm"` Password string `json:"password,omitempty" doc:"the password (if exists) of the virtual machine"` PasswordEnabled bool `json:"passwordenabled,omitempty" doc:"true if the password rest feature is enabled, false otherwise"` PCIDevices []PCIDevice `json:"pcidevices,omitempty" doc:"list of PCI devices"` PodID *UUID `json:"podid,omitempty" doc:"the ID of the vm's pod"` PodName string `json:"podname,omitempty" doc:"the name of the vm's pod"` PublicIP string `json:"publicip,omitempty" doc:"public IP address id associated with vm via Static nat rule"` PublicIPID *UUID `json:"publicipid,omitempty" doc:"public IP address id associated with vm via Static nat rule"` RootDeviceID int64 `json:"rootdeviceid,omitempty" doc:"device ID of the root volume"` RootDeviceType string `json:"rootdevicetype,omitempty" doc:"device type of the root volume"` SecurityGroup []SecurityGroup `json:"securitygroup,omitempty" doc:"list of security groups associated with the virtual machine"` ServiceOfferingID *UUID `json:"serviceofferingid,omitempty" doc:"the ID of the service offering of the virtual machine"` ServiceOfferingName string `json:"serviceofferingname,omitempty" doc:"the name of the service offering of the virtual machine"` ServiceState string `json:"servicestate,omitempty" doc:"State of the Service from LB rule"` State string `json:"state,omitempty" doc:"the state of the virtual machine"` Tags []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with vm"` TemplateDisplayText string `json:"templatedisplaytext,omitempty" doc:"an alternate display text of the template for the virtual machine"` TemplateID *UUID `json:"templateid,omitempty" doc:"the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file."` TemplateName string `json:"templatename,omitempty" doc:"the name of the template for the virtual machine"` ZoneID *UUID `json:"zoneid,omitempty" doc:"the ID of the availablility zone for the virtual machine"` ZoneName string `json:"zonename,omitempty" doc:"the name of the availability zone for the virtual machine"` } // ResourceType returns the type of the resource func (VirtualMachine) ResourceType() string { return "UserVM" } // Delete destroys the VM func (vm VirtualMachine) Delete(ctx context.Context, client *Client) error { _, err := client.RequestWithContext(ctx, &DestroyVirtualMachine{ ID: vm.ID, }) return err } // ListRequest builds the ListVirtualMachines request func (vm VirtualMachine) ListRequest() (ListCommand, error) { // XXX: AffinityGroupID, SecurityGroupID req := &ListVirtualMachines{ GroupID: vm.GroupID, ID: vm.ID, Name: vm.Name, State: vm.State, TemplateID: vm.TemplateID, ZoneID: vm.ZoneID, } nic := vm.DefaultNic() if nic != nil { req.IPAddress = nic.IPAddress } for i := range vm.Tags { req.Tags = append(req.Tags, vm.Tags[i]) } return req, nil } // DefaultNic returns the default nic func (vm VirtualMachine) DefaultNic() *Nic { for i, nic := range vm.Nic { if nic.IsDefault { return &vm.Nic[i] } } return nil } // IP returns the default nic IP address func (vm VirtualMachine) IP() *net.IP { nic := vm.DefaultNic() if nic != nil { ip := nic.IPAddress return &ip } return nil } // NicsByType returns the corresponding interfaces base on the given type func (vm VirtualMachine) NicsByType(nicType string) []Nic { nics := make([]Nic, 0) for _, nic := range vm.Nic { if nic.Type == nicType { // XXX The API forgets to specify it n := nic n.VirtualMachineID = vm.ID nics = append(nics, n) } } return nics } // NicByNetworkID returns the corresponding interface based on the given NetworkID // // A VM cannot be connected twice to a same network. func (vm VirtualMachine) NicByNetworkID(networkID UUID) *Nic { for _, nic := range vm.Nic { if nic.NetworkID.Equal(networkID) { n := nic n.VirtualMachineID = vm.ID return &n } } return nil } // NicByID returns the corresponding interface base on its ID func (vm VirtualMachine) NicByID(nicID UUID) *Nic { for _, nic := range vm.Nic { if nic.ID.Equal(nicID) { n := nic n.VirtualMachineID = vm.ID return &n } } return nil } // IPToNetwork represents a mapping between ip and networks type IPToNetwork struct { IP net.IP `json:"ip,omitempty"` Ipv6 net.IP `json:"ipv6,omitempty"` NetworkID *UUID `json:"networkid,omitempty"` } // PCIDevice represents a PCI card present in the host type PCIDevice struct { PCIVendorName string `json:"pcivendorname,omitempty" doc:"Device vendor name of pci card"` DeviceID string `json:"deviceid,omitempty" doc:"Device model ID of pci card"` RemainingCapacity int `json:"remainingcapacity,omitempty" doc:"Remaining capacity in terms of no. of more VMs that can be deployped with this vGPU type"` MaxCapacity int `json:"maxcapacity,omitempty" doc:"Maximum vgpu can be created with this vgpu type on the given pci group"` PCIVendorID string `json:"pcivendorid,omitempty" doc:"Device vendor ID of pci card"` PCIDeviceName string `json:"pcidevicename,omitempty" doc:"Device model name of pci card"` } // Password represents an encrypted password // // TODO: method to decrypt it, https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=34014652 type Password struct { EncryptedPassword string `json:"encryptedpassword"` } // VirtualMachineUserData represents the base64 encoded user-data type VirtualMachineUserData struct { UserData string `json:"userdata" doc:"Base 64 encoded VM user data"` VirtualMachineID *UUID `json:"virtualmachineid" doc:"the ID of the virtual machine"` } // Decode decodes as a readable string the content of the user-data (base64 · gzip) func (userdata VirtualMachineUserData) Decode() (string, error) { data, err := base64.StdEncoding.DecodeString(userdata.UserData) if err != nil { return "", err } // 0x1f8b is the magic number for gzip if len(data) < 2 || data[0] != 0x1f || data[1] != 0x8b { return string(data), nil } gr, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { return "", err } defer gr.Close() // nolint: errcheck str, err := ioutil.ReadAll(gr) if err != nil { return "", err } return string(str), nil } // DeployVirtualMachine (Async) represents the machine creation // // Regarding the UserData field, the client is responsible to base64 (and probably gzip) it. Doing it within this library would make the integration with other tools, e.g. Terraform harder. type DeployVirtualMachine struct { AffinityGroupIDs []UUID `json:"affinitygroupids,omitempty" doc:"comma separated list of affinity groups id that are going to be applied to the virtual machine. Mutually exclusive with affinitygroupnames parameter"` AffinityGroupNames []string `json:"affinitygroupnames,omitempty" doc:"comma separated list of affinity groups names that are going to be applied to the virtual machine.Mutually exclusive with affinitygroupids parameter"` Details map[string]string `json:"details,omitempty" doc:"used to specify the custom parameters."` DiskOfferingID *UUID `json:"diskofferingid,omitempty" doc:"the ID of the disk offering for the virtual machine. If the template is of ISO format, the diskofferingid is for the root disk volume. Otherwise this parameter is used to indicate the offering for the data disk volume. If the templateid parameter passed is from a Template object, the diskofferingid refers to a DATA Disk Volume created. If the templateid parameter passed is from an ISO object, the diskofferingid refers to a ROOT Disk Volume created."` DisplayName string `json:"displayname,omitempty" doc:"an optional user generated name for the virtual machine"` Group string `json:"group,omitempty" doc:"an optional group for the virtual machine"` IP4 *bool `json:"ip4,omitempty" doc:"True to set an IPv4 to the default interface"` IP6 *bool `json:"ip6,omitempty" doc:"True to set an IPv6 to the default interface"` IP6Address net.IP `json:"ip6address,omitempty" doc:"the ipv6 address for default vm's network"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"the ip address for default vm's network"` Keyboard string `json:"keyboard,omitempty" doc:"an optional keyboard device type for the virtual machine. valid value can be one of de,de-ch,es,fi,fr,fr-be,fr-ch,is,it,jp,nl-be,no,pt,uk,us"` KeyPair string `json:"keypair,omitempty" doc:"name of the ssh key pair used to login to the virtual machine"` Name string `json:"name,omitempty" doc:"host name for the virtual machine"` NetworkIDs []UUID `json:"networkids,omitempty" doc:"list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter"` RootDiskSize int64 `json:"rootdisksize,omitempty" doc:"Optional field to resize root disk on deploy. Value is in GB. Only applies to template-based deployments. Analogous to details[0].rootdisksize, which takes precedence over this parameter if both are provided"` SecurityGroupIDs []UUID `json:"securitygroupids,omitempty" doc:"comma separated list of security groups id that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupnames parameter"` SecurityGroupNames []string `json:"securitygroupnames,omitempty" doc:"comma separated list of security groups names that going to be applied to the virtual machine. Should be passed only when vm is created from a zone with Basic Network support. Mutually exclusive with securitygroupids parameter"` ServiceOfferingID *UUID `json:"serviceofferingid" doc:"the ID of the service offering for the virtual machine"` Size int64 `json:"size,omitempty" doc:"the arbitrary size for the DATADISK volume. Mutually exclusive with diskofferingid"` StartVM *bool `json:"startvm,omitempty" doc:"true if start vm after creating. Default value is true"` TemplateID *UUID `json:"templateid" doc:"the ID of the template for the virtual machine"` UserData string `json:"userdata,omitempty" doc:"an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding."` ZoneID *UUID `json:"zoneid" doc:"availability zone for the virtual machine"` _ bool `name:"deployVirtualMachine" description:"Creates and automatically starts a virtual machine based on a service offering, disk offering, and template."` } func (req DeployVirtualMachine) onBeforeSend(_ url.Values) error { // Either AffinityGroupIDs or AffinityGroupNames must be set if len(req.AffinityGroupIDs) > 0 && len(req.AffinityGroupNames) > 0 { return fmt.Errorf("either AffinityGroupIDs or AffinityGroupNames must be set") } // Either SecurityGroupIDs or SecurityGroupNames must be set if len(req.SecurityGroupIDs) > 0 && len(req.SecurityGroupNames) > 0 { return fmt.Errorf("either SecurityGroupIDs or SecurityGroupNames must be set") } return nil } // Response returns the struct to unmarshal func (DeployVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DeployVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // StartVirtualMachine (Async) represents the creation of the virtual machine type StartVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` RescueProfile string `json:"rescueprofile,omitempty" doc:"An optional rescue profile to use when booting"` _ bool `name:"startVirtualMachine" description:"Starts a virtual machine."` } // Response returns the struct to unmarshal func (StartVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (StartVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // StopVirtualMachine (Async) represents the stopping of the virtual machine type StopVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` Forced *bool `json:"forced,omitempty" doc:"Force stop the VM (vm is marked as Stopped even when command fails to be send to the backend). The caller knows the VM is stopped."` _ bool `name:"stopVirtualMachine" description:"Stops a virtual machine."` } // Response returns the struct to unmarshal func (StopVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (StopVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // RebootVirtualMachine (Async) represents the rebooting of the virtual machine type RebootVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` _ bool `name:"rebootVirtualMachine" description:"Reboots a virtual machine."` } // Response returns the struct to unmarshal func (RebootVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RebootVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // RestoreVirtualMachine (Async) represents the restoration of the virtual machine type RestoreVirtualMachine struct { VirtualMachineID *UUID `json:"virtualmachineid" doc:"Virtual Machine ID"` TemplateID *UUID `json:"templateid,omitempty" doc:"an optional template Id to restore vm from the new template. This can be an ISO id in case of restore vm deployed using ISO"` RootDiskSize int64 `json:"rootdisksize,omitempty" doc:"Optional field to resize root disk on restore. Value is in GB. Only applies to template-based deployments."` _ bool `name:"restoreVirtualMachine" description:"Restore a VM to original template/ISO or new template/ISO"` } // Response returns the struct to unmarshal func (RestoreVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RestoreVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // RecoverVirtualMachine represents the restoration of the virtual machine type RecoverVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` _ bool `name:"recoverVirtualMachine" description:"Recovers a virtual machine."` } // Response returns the struct to unmarshal func (RecoverVirtualMachine) Response() interface{} { return new(VirtualMachine) } // DestroyVirtualMachine (Async) represents the destruction of the virtual machine type DestroyVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` _ bool `name:"destroyVirtualMachine" description:"Destroys a virtual machine."` } // Response returns the struct to unmarshal func (DestroyVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (DestroyVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // UpdateVirtualMachine represents the update of the virtual machine type UpdateVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` Details map[string]string `json:"details,omitempty" doc:"Details in key/value pairs."` DisplayName string `json:"displayname,omitempty" doc:"user generated name"` Group string `json:"group,omitempty" doc:"group of the virtual machine"` Name string `json:"name,omitempty" doc:"new host name of the vm. The VM has to be stopped/started for this update to take affect"` SecurityGroupIDs []UUID `json:"securitygroupids,omitempty" doc:"list of security group ids to be applied on the virtual machine."` UserData string `json:"userdata,omitempty" doc:"an optional binary data that can be sent to the virtual machine upon a successful deployment. This binary data must be base64 encoded before adding it to the request. Using HTTP GET (via querystring), you can send up to 2KB of data after base64 encoding. Using HTTP POST(via POST body), you can send up to 32K of data after base64 encoding."` _ bool `name:"updateVirtualMachine" description:"Updates properties of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. Therefore, stop the VM manually before issuing this call."` } // Response returns the struct to unmarshal func (UpdateVirtualMachine) Response() interface{} { return new(VirtualMachine) } // ExpungeVirtualMachine represents the annihilation of a VM type ExpungeVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` _ bool `name:"expungeVirtualMachine" description:"Expunge a virtual machine. Once expunged, it cannot be recoverd."` } // Response returns the struct to unmarshal func (ExpungeVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (ExpungeVirtualMachine) AsyncResponse() interface{} { return new(BooleanResponse) } // ScaleVirtualMachine (Async) scales the virtual machine to a new service offering. // // ChangeServiceForVirtualMachine does the same thing but returns the // new Virtual Machine which is more consistent with the rest of the API. type ScaleVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` ServiceOfferingID *UUID `json:"serviceofferingid" doc:"the ID of the service offering for the virtual machine"` Details map[string]string `json:"details,omitempty" doc:"name value pairs of custom parameters for cpu,memory and cpunumber. example details[i].name=value"` _ bool `name:"scaleVirtualMachine" description:"Scales the virtual machine to a new service offering."` } // Response returns the struct to unmarshal func (ScaleVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (ScaleVirtualMachine) AsyncResponse() interface{} { return new(BooleanResponse) } // ChangeServiceForVirtualMachine changes the service offering for a virtual machine. The virtual machine must be in a "Stopped" state for this command to take effect. type ChangeServiceForVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` ServiceOfferingID *UUID `json:"serviceofferingid" doc:"the service offering ID to apply to the virtual machine"` Details map[string]string `json:"details,omitempty" doc:"name value pairs of custom parameters for cpu, memory and cpunumber. example details[i].name=value"` _ bool `name:"changeServiceForVirtualMachine" description:"Changes the service offering for a virtual machine. The virtual machine must be in a \"Stopped\" state for this command to take effect."` } // Response returns the struct to unmarshal func (ChangeServiceForVirtualMachine) Response() interface{} { return new(VirtualMachine) } // ResetPasswordForVirtualMachine resets the password for virtual machine. The virtual machine must be in a "Stopped" state... type ResetPasswordForVirtualMachine struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` _ bool `name:"resetPasswordForVirtualMachine" description:"Resets the password for virtual machine. The virtual machine must be in a \"Stopped\" state and the template must already support this feature for this command to take effect."` } // Response returns the struct to unmarshal func (ResetPasswordForVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (ResetPasswordForVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // GetVMPassword asks for an encrypted password type GetVMPassword struct { ID *UUID `json:"id" doc:"The ID of the virtual machine"` _ bool `name:"getVMPassword" description:"Returns an encrypted password for the VM"` } // Response returns the struct to unmarshal func (GetVMPassword) Response() interface{} { return new(Password) } //go:generate go run generate/main.go -interface=Listable ListVirtualMachines // ListVirtualMachines represents a search for a VM type ListVirtualMachines struct { AffinityGroupID *UUID `json:"affinitygroupid,omitempty" doc:"list vms by affinity group"` Details []string `json:"details,omitempty" doc:"comma separated list of host details requested, value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, diskoff, iso, volume, min, affgrp]. If no parameter is passed in, the details will be defaulted to all"` ForVirtualNetwork *bool `json:"forvirtualnetwork,omitempty" doc:"list by network type; true if need to list vms using Virtual Network, false otherwise"` GroupID *UUID `json:"groupid,omitempty" doc:"the group ID"` ID *UUID `json:"id,omitempty" doc:"the ID of the virtual machine"` IDs []UUID `json:"ids,omitempty" doc:"the IDs of the virtual machines, mutually exclusive with id"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"an IP address to filter the result"` IsoID *UUID `json:"isoid,omitempty" doc:"list vms by iso"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"name of the virtual machine"` NetworkID *UUID `json:"networkid,omitempty" doc:"list by network id"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` ServiceOfferindID *UUID `json:"serviceofferingid,omitempty" doc:"list by the service offering"` State string `json:"state,omitempty" doc:"state of the virtual machine"` Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"` TemplateID *UUID `json:"templateid,omitempty" doc:"list vms by template"` ZoneID *UUID `json:"zoneid,omitempty" doc:"the availability zone ID"` _ bool `name:"listVirtualMachines" description:"List the virtual machines owned by the account."` } // ListVirtualMachinesResponse represents a list of virtual machines type ListVirtualMachinesResponse struct { Count int `json:"count"` VirtualMachine []VirtualMachine `json:"virtualmachine"` } // AddNicToVirtualMachine (Async) adds a NIC to a VM type AddNicToVirtualMachine struct { NetworkID *UUID `json:"networkid" doc:"Network ID"` VirtualMachineID *UUID `json:"virtualmachineid" doc:"Virtual Machine ID"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"Static IP address lease for the corresponding NIC and network which should be in the range defined in the network"` _ bool `name:"addNicToVirtualMachine" description:"Adds VM to specified network by creating a NIC"` } // Response returns the struct to unmarshal func (AddNicToVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (AddNicToVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // RemoveNicFromVirtualMachine (Async) removes a NIC from a VM type RemoveNicFromVirtualMachine struct { NicID *UUID `json:"nicid" doc:"NIC ID"` VirtualMachineID *UUID `json:"virtualmachineid" doc:"Virtual Machine ID"` _ bool `name:"removeNicFromVirtualMachine" description:"Removes VM from specified network by deleting a NIC"` } // Response returns the struct to unmarshal func (RemoveNicFromVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RemoveNicFromVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // UpdateDefaultNicForVirtualMachine (Async) adds a NIC to a VM type UpdateDefaultNicForVirtualMachine struct { NicID *UUID `json:"nicid" doc:"NIC ID"` VirtualMachineID *UUID `json:"virtualmachineid" doc:"Virtual Machine ID"` _ bool `name:"updateDefaultNicForVirtualMachine" description:"Changes the default NIC on a VM"` } // Response returns the struct to unmarshal func (UpdateDefaultNicForVirtualMachine) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (UpdateDefaultNicForVirtualMachine) AsyncResponse() interface{} { return new(VirtualMachine) } // GetVirtualMachineUserData returns the user-data of the given VM type GetVirtualMachineUserData struct { VirtualMachineID *UUID `json:"virtualmachineid" doc:"The ID of the virtual machine"` _ bool `name:"getVirtualMachineUserData" description:"Returns user data associated with the VM"` } // Response returns the struct to unmarshal func (GetVirtualMachineUserData) Response() interface{} { return new(VirtualMachineUserData) } // UpdateVMNicIP updates the default IP address of a VM Nic type UpdateVMNicIP struct { _ bool `name:"updateVmNicIp" description:"Update the default Ip of a VM Nic"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"Static IP address lease for the corresponding NIC and network which should be in the range defined in the network. If absent, the call removes the lease associated with the nic."` NicID *UUID `json:"nicid" doc:"the ID of the nic."` } // Response returns the struct to unmarshal func (UpdateVMNicIP) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (UpdateVMNicIP) AsyncResponse() interface{} { return new(VirtualMachine) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/virtualmachines_response.go��������������������0000664�0000000�0000000�00000002021�13771713062�0030042�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListVirtualMachines) Response() interface{} { return new(ListVirtualMachinesResponse) } // ListRequest returns itself func (ls *ListVirtualMachines) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListVirtualMachines) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListVirtualMachines) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListVirtualMachines) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListVirtualMachinesResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListVirtualMachinesResponse was expected, got %T", resp)) return } for i := range items.VirtualMachine { if !callback(&items.VirtualMachine[i], nil) { break } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/volumes.go�������������������������������������0000664�0000000�0000000�00000020406�13771713062�0024427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale // Volume represents a volume linked to a VM type Volume struct { Account string `json:"account,omitempty" doc:"the account associated with the disk volume"` Attached string `json:"attached,omitempty" doc:"the date the volume was attached to a VM instance"` ChainInfo string `json:"chaininfo,omitempty" doc:"the chain info of the volume"` ClusterID *UUID `json:"clusterid,omitempty" doc:"ID of the cluster"` ClusterName string `json:"clustername,omitempty" doc:"name of the cluster"` Created string `json:"created,omitempty" doc:"the date the disk volume was created"` Destroyed bool `json:"destroyed,omitempty" doc:"the boolean state of whether the volume is destroyed or not"` DeviceID int64 `json:"deviceid,omitempty" doc:"the ID of the device on user vm the volume is attahed to. This tag is not returned when the volume is detached."` DiskBytesReadRate int64 `json:"diskBytesReadRate,omitempty" doc:"bytes read rate of the disk volume"` DiskBytesWriteRate int64 `json:"diskBytesWriteRate,omitempty" doc:"bytes write rate of the disk volume"` DiskIopsReadRate int64 `json:"diskIopsReadRate,omitempty" doc:"io requests read rate of the disk volume"` DiskIopsWriteRate int64 `json:"diskIopsWriteRate,omitempty" doc:"io requests write rate of the disk volume"` DiskOfferingDisplayText string `json:"diskofferingdisplaytext,omitempty" doc:"the display text of the disk offering"` DiskOfferingID *UUID `json:"diskofferingid,omitempty" doc:"ID of the disk offering"` DiskOfferingName string `json:"diskofferingname,omitempty" doc:"name of the disk offering"` DisplayVolume bool `json:"displayvolume,omitempty" doc:"an optional field whether to the display the volume to the end user or not."` Hypervisor string `json:"hypervisor,omitempty" doc:"Hypervisor the volume belongs to"` ID *UUID `json:"id,omitempty" doc:"ID of the disk volume"` IsExtractable *bool `json:"isextractable,omitempty" doc:"true if the volume is extractable, false otherwise"` IsoDisplayText string `json:"isodisplaytext,omitempty" doc:"an alternate display text of the ISO attached to the virtual machine"` IsoID *UUID `json:"isoid,omitempty" doc:"the ID of the ISO attached to the virtual machine"` IsoName string `json:"isoname,omitempty" doc:"the name of the ISO attached to the virtual machine"` MaxIops int64 `json:"maxiops,omitempty" doc:"max iops of the disk volume"` MinIops int64 `json:"miniops,omitempty" doc:"min iops of the disk volume"` Name string `json:"name,omitempty" doc:"name of the disk volume"` Path string `json:"path,omitempty" doc:"the path of the volume"` PodID *UUID `json:"podid,omitempty" doc:"ID of the pod"` PodName string `json:"podname,omitempty" doc:"name of the pod"` QuiesceVM bool `json:"quiescevm,omitempty" doc:"need quiesce vm or not when taking snapshot"` ServiceOfferingDisplayText string `json:"serviceofferingdisplaytext,omitempty" doc:"the display text of the service offering for root disk"` ServiceOfferingID *UUID `json:"serviceofferingid,omitempty" doc:"ID of the service offering for root disk"` ServiceOfferingName string `json:"serviceofferingname,omitempty" doc:"name of the service offering for root disk"` Size uint64 `json:"size,omitempty" doc:"size of the disk volume"` SnapshotID *UUID `json:"snapshotid,omitempty" doc:"ID of the snapshot from which this volume was created"` State string `json:"state,omitempty" doc:"the state of the disk volume"` Status string `json:"status,omitempty" doc:"the status of the volume"` Storage string `json:"storage,omitempty" doc:"name of the primary storage hosting the disk volume"` StorageID *UUID `json:"storageid,omitempty" doc:"id of the primary storage hosting the disk volume; returned to admin user only"` StorageType string `json:"storagetype,omitempty" doc:"shared or local storage"` Tags []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with volume"` TemplateDisplayText string `json:"templatedisplaytext,omitempty" doc:"an alternate display text of the template for the virtual machine"` TemplateID *UUID `json:"templateid,omitempty" doc:"the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file."` // no *UUID because of the -1 thingy... TemplateName string `json:"templatename,omitempty" doc:"the name of the template for the virtual machine"` Type string `json:"type,omitempty" doc:"type of the disk volume (ROOT or DATADISK)"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"id of the virtual machine"` VMDisplayName string `json:"vmdisplayname,omitempty" doc:"display name of the virtual machine"` VMName string `json:"vmname,omitempty" doc:"name of the virtual machine"` VMState string `json:"vmstate,omitempty" doc:"state of the virtual machine"` ZoneID *UUID `json:"zoneid,omitempty" doc:"ID of the availability zone"` ZoneName string `json:"zonename,omitempty" doc:"name of the availability zone"` } // ResourceType returns the type of the resource func (Volume) ResourceType() string { return "Volume" } // ListRequest builds the ListVolumes request func (vol Volume) ListRequest() (ListCommand, error) { req := &ListVolumes{ Name: vol.Name, Type: vol.Type, VirtualMachineID: vol.VirtualMachineID, ZoneID: vol.ZoneID, } return req, nil } // ResizeVolume (Async) resizes a volume type ResizeVolume struct { ID *UUID `json:"id" doc:"the ID of the disk volume"` DiskOfferingID *UUID `json:"diskofferingid,omitempty" doc:"new disk offering id"` Size int64 `json:"size,omitempty" doc:"New volume size in G (must be larger than current size since shrinking the disk is not supported)"` _ bool `name:"resizeVolume" description:"Resizes a volume"` } // Response returns the struct to unmarshal func (ResizeVolume) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (ResizeVolume) AsyncResponse() interface{} { return new(Volume) } //go:generate go run generate/main.go -interface=Listable ListVolumes // ListVolumes represents a query listing volumes type ListVolumes struct { DiskOfferingID *UUID `json:"diskofferingid,omitempty" doc:"List volumes by disk offering"` ID *UUID `json:"id,omitempty" doc:"The ID of the disk volume"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"The name of the disk volume"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` Tags []ResourceTag `json:"tags,omitempty" doc:"List resources by tags (key/value pairs)"` Type string `json:"type,omitempty" doc:"The type of disk volume"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"The ID of the virtual machine"` ZoneID *UUID `json:"zoneid,omitempty" doc:"The ID of the availability zone"` _ bool `name:"listVolumes" description:"Lists all volumes."` } // ListVolumesResponse represents a list of volumes type ListVolumesResponse struct { Count int `json:"count"` Volume []Volume `json:"volume"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/volumes_response.go����������������������������0000664�0000000�0000000�00000001701�13771713062�0026342�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListVolumes) Response() interface{} { return new(ListVolumesResponse) } // ListRequest returns itself func (ls *ListVolumes) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListVolumes) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListVolumes) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListVolumes) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListVolumesResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListVolumesResponse was expected, got %T", resp)) return } for i := range items.Volume { if !callback(&items.Volume[i], nil) { break } } } ���������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/zones.go���������������������������������������0000664�0000000�0000000�00000007120�13771713062�0024071�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package egoscale import ( "net" ) // Zone represents a data center // // TODO: represent correctly the capacity field. type Zone struct { AllocationState string `json:"allocationstate,omitempty" doc:"the allocation state of the cluster"` Description string `json:"description,omitempty" doc:"Zone description"` DhcpProvider string `json:"dhcpprovider,omitempty" doc:"the dhcp Provider for the Zone"` DisplayText string `json:"displaytext,omitempty" doc:"the display text of the zone"` DNS1 net.IP `json:"dns1,omitempty" doc:"the first DNS for the Zone"` DNS2 net.IP `json:"dns2,omitempty" doc:"the second DNS for the Zone"` GuestCIDRAddress *CIDR `json:"guestcidraddress,omitempty" doc:"the guest CIDR address for the Zone"` ID *UUID `json:"id,omitempty" doc:"Zone id"` InternalDNS1 net.IP `json:"internaldns1,omitempty" doc:"the first internal DNS for the Zone"` InternalDNS2 net.IP `json:"internaldns2,omitempty" doc:"the second internal DNS for the Zone"` IP6DNS1 net.IP `json:"ip6dns1,omitempty" doc:"the first IPv6 DNS for the Zone"` IP6DNS2 net.IP `json:"ip6dns2,omitempty" doc:"the second IPv6 DNS for the Zone"` LocalStorageEnabled *bool `json:"localstorageenabled,omitempty" doc:"true if local storage offering enabled, false otherwise"` Name string `json:"name,omitempty" doc:"Zone name"` NetworkType string `json:"networktype,omitempty" doc:"the network type of the zone; can be Basic or Advanced"` ResourceDetails map[string]string `json:"resourcedetails,omitempty" doc:"Meta data associated with the zone (key/value pairs)"` SecurityGroupsEnabled *bool `json:"securitygroupsenabled,omitempty" doc:"true if security groups support is enabled, false otherwise"` Tags []ResourceTag `json:"tags,omitempty" doc:"the list of resource tags associated with zone."` Vlan string `json:"vlan,omitempty" doc:"the vlan range of the zone"` ZoneToken string `json:"zonetoken,omitempty" doc:"Zone Token"` } // ListRequest builds the ListZones request func (zone Zone) ListRequest() (ListCommand, error) { req := &ListZones{ ID: zone.ID, Name: zone.Name, } return req, nil } //go:generate go run generate/main.go -interface=Listable ListZones // ListZones represents a query for zones type ListZones struct { Available *bool `json:"available,omitempty" doc:"true if you want to retrieve all available Zones. False if you only want to return the Zones from which you have at least one VM. Default is false."` ID *UUID `json:"id,omitempty" doc:"the ID of the zone"` Keyword string `json:"keyword,omitempty" doc:"List by keyword"` Name string `json:"name,omitempty" doc:"the name of the zone"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` ShowCapacities *bool `json:"showcapacities,omitempty" doc:"flag to display the capacity of the zones"` Tags []ResourceTag `json:"tags,omitempty" doc:"List zones by resource tags (key/value pairs)"` _ bool `name:"listZones" description:"Lists zones"` } // ListZonesResponse represents a list of zones type ListZonesResponse struct { Count int `json:"count"` Zone []Zone `json:"zone"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/exoscale/egoscale/zones_response.go������������������������������0000664�0000000�0000000�00000001655�13771713062�0026016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// code generated; DO NOT EDIT. package egoscale import "fmt" // Response returns the struct to unmarshal func (ListZones) Response() interface{} { return new(ListZonesResponse) } // ListRequest returns itself func (ls *ListZones) ListRequest() (ListCommand, error) { if ls == nil { return nil, fmt.Errorf("%T cannot be nil", ls) } return ls, nil } // SetPage sets the current apge func (ls *ListZones) SetPage(page int) { ls.Page = page } // SetPageSize sets the page size func (ls *ListZones) SetPageSize(pageSize int) { ls.PageSize = pageSize } // Each triggers the callback for each, valid answer or any non 404 issue func (ListZones) Each(resp interface{}, callback IterateItemFunc) { items, ok := resp.(*ListZonesResponse) if !ok { callback(nil, fmt.Errorf("wrong type, ListZonesResponse was expected, got %T", resp)) return } for i := range items.Zone { if !callback(&items.Zone[i], nil) { break } } } �����������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017741�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021403�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/.gitignore������������������������������������������0000664�0000000�0000000�00000000412�13771713062�0023370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/.travis.yml�����������������������������������������0000664�0000000�0000000�00000000471�13771713062�0023516�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������language: go go: - 1.5 - 1.6 - 1.7 - 1.8 - 1.9 - tip before_install: - go get golang.org/x/tools/cmd/cover script: - GOARCH=386 go test # test 32bit architectures. - go test -coverprofile=coverage.txt -covermode=atomic after_success: - bash <(curl -s https://codecov.io/bash) sudo: false �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/CODE_OF_CONDUCT.md����������������������������������0000664�0000000�0000000�00000006223�13771713062�0024205�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at wesley@hakobaito.co.uk. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/CONTRIBUTING.md�������������������������������������0000664�0000000�0000000�00000000524�13771713062�0023635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Contributing Contributions are welcome! Fork this repo and add your changes and submit a PR. If you would like to fix a bug, add a feature or provide feedback you can do so in the issues section. You can run tests by runnning `go test`. Running `go test; go vet; golint` is recommended. durafmt is also tested against `gometalinter`. ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/LICENSE���������������������������������������������0000664�0000000�0000000�00000002066�13771713062�0022414�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������The MIT License (MIT) Copyright (c) 2016 Wesley Hill Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/README.md�������������������������������������������0000664�0000000�0000000�00000005460�13771713062�0022667�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# durafmt [![Build Status](https://travis-ci.org/hako/durafmt.svg?branch=master)](https://travis-ci.org/hako/durafmt) [![Go Report Card](https://goreportcard.com/badge/github.com/hako/durafmt)](https://goreportcard.com/report/github.com/hako/durafmt) [![codecov](https://codecov.io/gh/hako/durafmt/branch/master/graph/badge.svg)](https://codecov.io/gh/hako/durafmt) [![GoDoc](https://godoc.org/github.com/hako/durafmt?status.svg)](https://godoc.org/github.com/hako/durafmt) [![Open Source Helpers](https://www.codetriage.com/hako/durafmt/badges/users.svg)](https://www.codetriage.com/hako/durafmt) durafmt is a tiny Go library that formats `time.Duration` strings (and types) into a human readable format. ``` go get github.com/hako/durafmt ``` # Why If you've worked with `time.Duration` in Go, you most likely have come across this: ``` 53m28.587093086s // :) ``` The above seems very easy to read, unless your duration looks like this: ``` 354h22m3.24s // :S ``` # Usage ### durafmt.ParseString() ```go package main import ( "fmt" "github.com/hako/durafmt" ) func main() { duration, err := durafmt.ParseString("354h22m3.24s") if err != nil { fmt.Println(err) } fmt.Println(duration) // 2 weeks 18 hours 22 minutes 3 seconds // duration.String() // String representation. "2 weeks 18 hours 22 minutes 3 seconds" } ``` ### durafmt.ParseStringShort() Version of `durafmt.ParseString()` that only returns the first part of the duration string. ```go package main import ( "fmt" "github.com/hako/durafmt" ) func main() { duration, err := durafmt.ParseStringShort("354h22m3.24s") if err != nil { fmt.Println(err) } fmt.Println(duration) // 2 weeks // duration.String() // String short representation. "2 weeks" } ``` ### durafmt.Parse() ```go package main import ( "fmt" "time" "github.com/hako/durafmt" ) func main() { timeduration := (354 * time.Hour) + (22 * time.Minute) + (3 * time.Second) duration := durafmt.Parse(timeduration).String() fmt.Println(duration) // 2 weeks 18 hours 22 minutes 3 seconds } ``` #### LimitFirstN() Like `durafmt.ParseStringShort()` but for limiting the first N parts of the duration string. ```go package main import ( "fmt" "time" "github.com/hako/durafmt" ) func main() { timeduration := (354 * time.Hour) + (22 * time.Minute) + (3 * time.Second) duration := durafmt.Parse(timeduration).LimitFirstN(2) // // limit first two parts. fmt.Println(duration) // 2 weeks 18 hours } ``` # Contributing Contributions are welcome! Fork this repo, add your changes and submit a PR. If you would like to fix a bug, add a feature or provide feedback you can do so in the issues section. durafmt is tested against `golangci-lint` and you can run tests with `go test`. When contributing, running `go test; go vet; golint` or `golangci-lint` is recommended. # License MIT����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hako/durafmt/durafmt.go������������������������������������������0000664�0000000�0000000�00000013012�13771713062�0023371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package durafmt formats time.Duration into a human readable format. package durafmt import ( "errors" "fmt" "regexp" "strconv" "strings" "time" ) var ( units = []string{"years", "weeks", "days", "hours", "minutes", "seconds", "milliseconds", "microseconds"} unitsShort = []string{"y", "w", "d", "h", "m", "s", "ms", "µs"} ) // Durafmt holds the parsed duration and the original input duration. type Durafmt struct { duration time.Duration input string // Used as reference. limitN int // Non-zero to limit only first N elements to output. limitUnit string // Non-empty to limit max unit } // LimitToUnit sets the output format, you will not have unit bigger than the UNIT specified. UNIT = "" means no restriction. func (d *Durafmt) LimitToUnit(unit string) *Durafmt { d.limitUnit = unit return d } // LimitFirstN sets the output format, outputing only first N elements. n == 0 means no limit. func (d *Durafmt) LimitFirstN(n int) *Durafmt { d.limitN = n return d } func (d *Durafmt) Duration() time.Duration { return d.duration } // Parse creates a new *Durafmt struct, returns error if input is invalid. func Parse(dinput time.Duration) *Durafmt { input := dinput.String() return &Durafmt{dinput, input, 0, ""} } // ParseShort creates a new *Durafmt struct, short form, returns error if input is invalid. // It's shortcut for `Parse(dur).LimitFirstN(1)` func ParseShort(dinput time.Duration) *Durafmt { input := dinput.String() return &Durafmt{dinput, input, 1, ""} } // ParseString creates a new *Durafmt struct from a string. // returns an error if input is invalid. func ParseString(input string) (*Durafmt, error) { if input == "0" || input == "-0" { return nil, errors.New("durafmt: missing unit in duration " + input) } duration, err := time.ParseDuration(input) if err != nil { return nil, err } return &Durafmt{duration, input, 0, ""}, nil } // ParseStringShort creates a new *Durafmt struct from a string, short form // returns an error if input is invalid. // It's shortcut for `ParseString(durStr)` and then calling `LimitFirstN(1)` func ParseStringShort(input string) (*Durafmt, error) { if input == "0" || input == "-0" { return nil, errors.New("durafmt: missing unit in duration " + input) } duration, err := time.ParseDuration(input) if err != nil { return nil, err } return &Durafmt{duration, input, 1, ""}, nil } // String parses d *Durafmt into a human readable duration. func (d *Durafmt) String() string { var duration string // Check for minus durations. if string(d.input[0]) == "-" { duration += "-" d.duration = -d.duration } var microseconds int64 var milliseconds int64 var seconds int64 var minutes int64 var hours int64 var days int64 var weeks int64 var years int64 var shouldConvert = false remainingSecondsToConvert := int64(d.duration / time.Microsecond) // Convert duration. if d.limitUnit == "" { shouldConvert = true } if d.limitUnit == "years" || shouldConvert { years = remainingSecondsToConvert / (365 * 24 * 3600 * 1000000) remainingSecondsToConvert -= years * 365 * 24 * 3600 * 1000000 shouldConvert = true } if d.limitUnit == "weeks" || shouldConvert { weeks = remainingSecondsToConvert / (7 * 24 * 3600 * 1000000) remainingSecondsToConvert -= weeks * 7 * 24 * 3600 * 1000000 shouldConvert = true } if d.limitUnit == "days" || shouldConvert { days = remainingSecondsToConvert / (24 * 3600 * 1000000) remainingSecondsToConvert -= days * 24 * 3600 * 1000000 shouldConvert = true } if d.limitUnit == "hours" || shouldConvert { hours = remainingSecondsToConvert / (3600 * 1000000) remainingSecondsToConvert -= hours * 3600 * 1000000 shouldConvert = true } if d.limitUnit == "minutes" || shouldConvert { minutes = remainingSecondsToConvert / (60 * 1000000) remainingSecondsToConvert -= minutes * 60 * 1000000 shouldConvert = true } if d.limitUnit == "seconds" || shouldConvert { seconds = remainingSecondsToConvert / 1000000 remainingSecondsToConvert -= seconds * 1000000 shouldConvert = true } if d.limitUnit == "milliseconds" || shouldConvert { milliseconds = remainingSecondsToConvert / 1000 remainingSecondsToConvert -= milliseconds * 1000 } microseconds = remainingSecondsToConvert // Create a map of the converted duration time. durationMap := map[string]int64{ "microseconds": microseconds, "milliseconds": milliseconds, "seconds": seconds, "minutes": minutes, "hours": hours, "days": days, "weeks": weeks, "years": years, } // Construct duration string. for i := range units { u := units[i] v := durationMap[u] strval := strconv.FormatInt(v, 10) switch { // add to the duration string if v > 1. case v > 1: duration += strval + " " + u + " " // remove the plural 's', if v is 1. case v == 1: duration += strval + " " + strings.TrimRight(u, "s") + " " // omit any value with 0s or 0. case d.duration.String() == "0" || d.duration.String() == "0s": pattern := fmt.Sprintf("^-?0%s$", unitsShort[i]) isMatch, err := regexp.MatchString(pattern, d.input) if err != nil { return "" } if isMatch { duration += strval + " " + u } // omit any value with 0. case v == 0: continue } } // trim any remaining spaces. duration = strings.TrimSpace(duration) // if more than 2 spaces present return the first 2 strings // if short version is requested if d.limitN > 0 { parts := strings.Split(duration, " ") if len(parts) > d.limitN*2 { duration = strings.Join(parts[:d.limitN*2], " ") } } return duration } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/�������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020777�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023663�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/.golangci.yml��������������������������0000664�0000000�0000000�00000000564�13771713062�0026254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������issues: max-per-linter: 0 max-same-issues: 0 linters: disable-all: true enable: - deadcode - dogsled - errcheck - goconst - gofmt - gomnd - gosimple - ineffassign - interfacer - misspell - scopelint - staticcheck - structcheck - unconvert - unparam - unused - typecheck - varcheck - vet ��������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/CHANGELOG.md���������������������������0000664�0000000�0000000�00000004326�13771713062�0025501�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# v0.6.0 (unreleased) BREAKING CHANGES * AWS error checking function have been moved to `tfawserr` package. `IsAWSErr` has been renamed to `ErrMessageContains` and `IsAWSErrExtended` has been renamed to `ErrMessageAndOrigErrContain`. #37 ENHANCEMENTS * Additional AWS error checking function have been added to the `tfawserr` package - `ErrCodeEquals`, `ErrCodeContains` and `ErrStatusCodeEquals`. # v0.5.0 (June 4, 2020) BREAKING CHANGES * Credential ordering has changed from static, environment, shared credentials, EC2 metadata, default AWS Go SDK (shared configuration, web identity, ECS, EC2 Metadata) to static, environment, shared credentials, default AWS Go SDK (shared configuration, web identity, ECS, EC2 Metadata). #20 * The `AWS_METADATA_TIMEOUT` environment variable no longer has any effect as we now depend on the default AWS Go SDK EC2 Metadata client timeout of one second with two retries. #20 / #44 ENHANCEMENTS * Always enable AWS shared configuration file support (no longer require `AWS_SDK_LOAD_CONFIG` environment variable) #38 * Automatically expand `~` prefix for home directories in shared credentials filename handling #40 * Support assume role duration, policy ARNs, tags, and transitive tag keys via configuration #39 * Add `CannotAssumeRoleError` and `NoValidCredentialSourcesError` error types with helpers #42 BUG FIXES * Properly use custom STS endpoint during AssumeRole API calls triggered by Terraform AWS Provider and S3 Backend configurations #32 * Properly use custom EC2 metadata endpoint during API calls triggered by fallback credentials lookup #32 * Prefer shared configuration handling over EC2 metadata #20 * Prefer ECS credentials over EC2 metadata #20 * Remove hardcoded AWS Provider messaging in error messages #31 / #42 # v0.4.0 (October 3, 2019) BUG FIXES * awsauth: fixed credentials retrieval, validation, and error handling # v0.3.0 (February 26, 2019) BUG FIXES * session: Return error instead of logging with AWS Account ID lookup failure [GH-3] # v0.2.0 (February 20, 2019) ENHANCEMENTS * validation: Add `ValidateAccountID` and `ValidateRegion` functions [GH-1] # v0.1.0 (February 18, 2019) * Initial release after split from github.com/terraform-providers/terraform-provider-aws ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/GNUmakefile����������������������������0000664�0000000�0000000�00000000514�13771713062�0025735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������default: test lint fmt: @echo "==> Fixing source code with gofmt..." gofmt -s -w ./ lint: @echo "==> Checking source code against linters..." @golangci-lint run ./... test: go test -timeout=30s -parallel=4 ./... tools: GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint .PHONY: lint test tools ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/LICENSE��������������������������������0000664�0000000�0000000�00000040525�13771713062�0024676�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/README.md������������������������������0000664�0000000�0000000�00000003276�13771713062�0025152�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# aws-sdk-go-base An opinionated [AWS Go SDK](https://github.com/aws/aws-sdk-go) library for consistent authentication configuration between projects and additional helper functions. This library was originally started in [HashiCorp Terraform](https://github.com/hashicorp/terraform), migrated with the [Terraform AWS Provider](https://github.com/terraform-providers/terraform-provider-aws) during the Terraform 0.10 Core and Provider split, and now is offered as a separate library to allow easier dependency management in the Terraform ecosystem. **NOTE:** This library is not currently designed or intended for usage outside the [Terraform S3 Backend](https://www.terraform.io/docs/backends/types/s3.html) and the [Terraform AWS Provider](https://www.terraform.io/docs/providers/aws/index.html). ## Requirements - [Go](https://golang.org/doc/install) 1.13 ## Development Testing this project can be done through Go standard library functionality or if [Make](https://www.gnu.org/software/make/) is available: ```sh $ go test -v ./... # Optionally if Make is available; both run the same testing $ make test ``` Code quality assurance uses [golangci-lint](https://github.com/golangci/golangci-lint): ```sh $ golangci-lint run ./... # Optionally if Make is available; both run the same linting $ make lint ``` ## Release Process - Push a new `vX.Y.Z` tag to the repository - Close associated `vX.Y.Z` milestone - For Terraform AWS Provider: Renovate will automatically detect the update and submit a dependency pull request (usually within an hour) - For Terraform S3 Backend: Submit a new dependency pull request by running: ```sh go get github.com/hashicorp/aws-sdk-go-base@vX.Y.Z go mod tidy go mod vendor ``` ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/awsauth.go�����������������������������0000664�0000000�0000000�00000025247�13771713062�0025700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase import ( "errors" "fmt" "log" "os" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" awsCredentials "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/sts" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/go-cleanhttp" "github.com/hashicorp/go-multierror" homedir "github.com/mitchellh/go-homedir" ) const ( // Default amount of time for EC2/ECS metadata client operations. // Keep this value low to prevent long delays in non-EC2/ECS environments. DefaultMetadataClientTimeout = 100 * time.Millisecond ) // GetAccountIDAndPartition gets the account ID and associated partition. func GetAccountIDAndPartition(iamconn *iam.IAM, stsconn *sts.STS, authProviderName string) (string, string, error) { var accountID, partition string var err, errors error if authProviderName == ec2rolecreds.ProviderName { accountID, partition, err = GetAccountIDAndPartitionFromEC2Metadata() } else { accountID, partition, err = GetAccountIDAndPartitionFromIAMGetUser(iamconn) } if accountID != "" { return accountID, partition, nil } errors = multierror.Append(errors, err) accountID, partition, err = GetAccountIDAndPartitionFromSTSGetCallerIdentity(stsconn) if accountID != "" { return accountID, partition, nil } errors = multierror.Append(errors, err) accountID, partition, err = GetAccountIDAndPartitionFromIAMListRoles(iamconn) if accountID != "" { return accountID, partition, nil } errors = multierror.Append(errors, err) return accountID, partition, errors } // GetAccountIDAndPartitionFromEC2Metadata gets the account ID and associated // partition from EC2 metadata. func GetAccountIDAndPartitionFromEC2Metadata() (string, string, error) { log.Println("[DEBUG] Trying to get account information via EC2 Metadata") cfg := &aws.Config{} setOptionalEndpoint(cfg) sess, err := session.NewSession(cfg) if err != nil { return "", "", fmt.Errorf("error creating EC2 Metadata session: %w", err) } metadataClient := ec2metadata.New(sess) info, err := metadataClient.IAMInfo() if err != nil { // We can end up here if there's an issue with the instance metadata service // or if we're getting credentials from AdRoll's Hologram (in which case IAMInfo will // error out). err = fmt.Errorf("failed getting account information via EC2 Metadata IAM information: %w", err) log.Printf("[DEBUG] %s", err) return "", "", err } return parseAccountIDAndPartitionFromARN(info.InstanceProfileArn) } // GetAccountIDAndPartitionFromIAMGetUser gets the account ID and associated // partition from IAM. func GetAccountIDAndPartitionFromIAMGetUser(iamconn *iam.IAM) (string, string, error) { log.Println("[DEBUG] Trying to get account information via iam:GetUser") output, err := iamconn.GetUser(&iam.GetUserInput{}) if err != nil { // AccessDenied and ValidationError can be raised // if credentials belong to federated profile, so we ignore these if awsErr, ok := err.(awserr.Error); ok { switch awsErr.Code() { case "AccessDenied", "InvalidClientTokenId", "ValidationError": return "", "", nil } } err = fmt.Errorf("failed getting account information via iam:GetUser: %w", err) log.Printf("[DEBUG] %s", err) return "", "", err } if output == nil || output.User == nil { err = errors.New("empty iam:GetUser response") log.Printf("[DEBUG] %s", err) return "", "", err } return parseAccountIDAndPartitionFromARN(aws.StringValue(output.User.Arn)) } // GetAccountIDAndPartitionFromIAMListRoles gets the account ID and associated // partition from listing IAM roles. func GetAccountIDAndPartitionFromIAMListRoles(iamconn *iam.IAM) (string, string, error) { log.Println("[DEBUG] Trying to get account information via iam:ListRoles") output, err := iamconn.ListRoles(&iam.ListRolesInput{ MaxItems: aws.Int64(int64(1)), }) if err != nil { err = fmt.Errorf("failed getting account information via iam:ListRoles: %w", err) log.Printf("[DEBUG] %s", err) return "", "", err } if output == nil || len(output.Roles) < 1 { err = fmt.Errorf("empty iam:ListRoles response") log.Printf("[DEBUG] %s", err) return "", "", err } return parseAccountIDAndPartitionFromARN(aws.StringValue(output.Roles[0].Arn)) } // GetAccountIDAndPartitionFromSTSGetCallerIdentity gets the account ID and associated // partition from STS caller identity. func GetAccountIDAndPartitionFromSTSGetCallerIdentity(stsconn *sts.STS) (string, string, error) { log.Println("[DEBUG] Trying to get account information via sts:GetCallerIdentity") output, err := stsconn.GetCallerIdentity(&sts.GetCallerIdentityInput{}) if err != nil { return "", "", fmt.Errorf("error calling sts:GetCallerIdentity: %w", err) } if output == nil || output.Arn == nil { err = errors.New("empty sts:GetCallerIdentity response") log.Printf("[DEBUG] %s", err) return "", "", err } return parseAccountIDAndPartitionFromARN(aws.StringValue(output.Arn)) } func parseAccountIDAndPartitionFromARN(inputARN string) (string, string, error) { arn, err := arn.Parse(inputARN) if err != nil { return "", "", fmt.Errorf("error parsing ARN (%s): %s", inputARN, err) } return arn.AccountID, arn.Partition, nil } // GetCredentialsFromSession returns credentials derived from a session. A // session uses the AWS SDK Go chain of providers so may use a provider (e.g., // ProcessProvider) that is not part of the Terraform provider chain. func GetCredentialsFromSession(c *Config) (*awsCredentials.Credentials, error) { log.Printf("[INFO] Attempting to use session-derived credentials") // Avoid setting HTTPClient here as it will prevent the ec2metadata // client from automatically lowering the timeout to 1 second. options := &session.Options{ Config: aws.Config{ EndpointResolver: c.EndpointResolver(), MaxRetries: aws.Int(0), Region: aws.String(c.Region), }, Profile: c.Profile, SharedConfigState: session.SharedConfigEnable, } sess, err := session.NewSessionWithOptions(*options) if err != nil { if tfawserr.ErrCodeEquals(err, "NoCredentialProviders") { return nil, c.NewNoValidCredentialSourcesError(err) } return nil, fmt.Errorf("Error creating AWS session: %w", err) } creds := sess.Config.Credentials cp, err := sess.Config.Credentials.Get() if err != nil { return nil, c.NewNoValidCredentialSourcesError(err) } log.Printf("[INFO] Successfully derived credentials from session") log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) return creds, nil } // GetCredentials gets credentials from the environment, shared credentials, // the session (which may include a credential process), or ECS/EC2 metadata endpoints. // GetCredentials also validates the credentials and the ability to assume a role // or will return an error if unsuccessful. func GetCredentials(c *Config) (*awsCredentials.Credentials, error) { sharedCredentialsFilename, err := homedir.Expand(c.CredsFilename) if err != nil { return nil, fmt.Errorf("error expanding shared credentials filename: %w", err) } // build a chain provider, lazy-evaluated by aws-sdk providers := []awsCredentials.Provider{ &awsCredentials.StaticProvider{Value: awsCredentials.Value{ AccessKeyID: c.AccessKey, SecretAccessKey: c.SecretKey, SessionToken: c.Token, }}, &awsCredentials.EnvProvider{}, &awsCredentials.SharedCredentialsProvider{ Filename: sharedCredentialsFilename, Profile: c.Profile, }, } // Validate the credentials before returning them creds := awsCredentials.NewChainCredentials(providers) cp, err := creds.Get() if err != nil { if tfawserr.ErrCodeEquals(err, "NoCredentialProviders") { creds, err = GetCredentialsFromSession(c) if err != nil { return nil, err } } else { return nil, fmt.Errorf("Error loading credentials for AWS Provider: %w", err) } } else { log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) } // This is the "normal" flow (i.e. not assuming a role) if c.AssumeRoleARN == "" { return creds, nil } // Otherwise we need to construct an STS client with the main credentials, and verify // that we can assume the defined role. log.Printf("[INFO] Attempting to AssumeRole %s (SessionName: %q, ExternalId: %q)", c.AssumeRoleARN, c.AssumeRoleSessionName, c.AssumeRoleExternalID) awsConfig := &aws.Config{ Credentials: creds, EndpointResolver: c.EndpointResolver(), Region: aws.String(c.Region), MaxRetries: aws.Int(c.MaxRetries), HTTPClient: cleanhttp.DefaultClient(), } assumeRoleSession, err := session.NewSession(awsConfig) if err != nil { return nil, fmt.Errorf("error creating assume role session: %w", err) } stsclient := sts.New(assumeRoleSession) assumeRoleProvider := &stscreds.AssumeRoleProvider{ Client: stsclient, RoleARN: c.AssumeRoleARN, } if c.AssumeRoleDurationSeconds > 0 { assumeRoleProvider.Duration = time.Duration(c.AssumeRoleDurationSeconds) * time.Second } if c.AssumeRoleExternalID != "" { assumeRoleProvider.ExternalID = aws.String(c.AssumeRoleExternalID) } if c.AssumeRolePolicy != "" { assumeRoleProvider.Policy = aws.String(c.AssumeRolePolicy) } if len(c.AssumeRolePolicyARNs) > 0 { var policyDescriptorTypes []*sts.PolicyDescriptorType for _, policyARN := range c.AssumeRolePolicyARNs { policyDescriptorType := &sts.PolicyDescriptorType{ Arn: aws.String(policyARN), } policyDescriptorTypes = append(policyDescriptorTypes, policyDescriptorType) } assumeRoleProvider.PolicyArns = policyDescriptorTypes } if c.AssumeRoleSessionName != "" { assumeRoleProvider.RoleSessionName = c.AssumeRoleSessionName } if len(c.AssumeRoleTags) > 0 { var tags []*sts.Tag for k, v := range c.AssumeRoleTags { tag := &sts.Tag{ Key: aws.String(k), Value: aws.String(v), } tags = append(tags, tag) } assumeRoleProvider.Tags = tags } if len(c.AssumeRoleTransitiveTagKeys) > 0 { assumeRoleProvider.TransitiveTagKeys = aws.StringSlice(c.AssumeRoleTransitiveTagKeys) } providers = []awsCredentials.Provider{assumeRoleProvider} assumeRoleCreds := awsCredentials.NewChainCredentials(providers) _, err = assumeRoleCreds.Get() if err != nil { return nil, c.NewCannotAssumeRoleError(err) } return assumeRoleCreds, nil } func setOptionalEndpoint(cfg *aws.Config) string { endpoint := os.Getenv("AWS_METADATA_URL") if endpoint != "" { log.Printf("[INFO] Setting custom metadata endpoint: %q", endpoint) cfg.Endpoint = aws.String(endpoint) return endpoint } return "" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/config.go������������������������������0000664�0000000�0000000�00000002014�13771713062�0025454�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase type Config struct { AccessKey string AssumeRoleARN string AssumeRoleDurationSeconds int AssumeRoleExternalID string AssumeRolePolicy string AssumeRolePolicyARNs []string AssumeRoleSessionName string AssumeRoleTags map[string]string AssumeRoleTransitiveTagKeys []string CallerDocumentationURL string CallerName string CredsFilename string DebugLogging bool IamEndpoint string Insecure bool MaxRetries int Profile string Region string SecretKey string SkipCredsValidation bool SkipMetadataApiCheck bool SkipRequestingAccountId bool StsEndpoint string Token string UserAgentProducts []*UserAgentProduct } type UserAgentProduct struct { Extra []string Name string Version string } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/endpoints.go���������������������������0000664�0000000�0000000�00000002572�13771713062�0026223�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase import ( "log" "os" "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/sts" ) func (c *Config) EndpointResolver() endpoints.Resolver { resolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) { // Ensure we pass all existing information (e.g. SigningRegion) and // only override the URL, otherwise a MissingRegion error can occur // when aws.Config.Region is not defined. resolvedEndpoint, err := endpoints.DefaultResolver().EndpointFor(service, region, optFns...) if err != nil { return resolvedEndpoint, err } switch service { case ec2metadata.ServiceName: if endpoint := os.Getenv("AWS_METADATA_URL"); endpoint != "" { log.Printf("[INFO] Setting custom EC2 metadata endpoint: %s", endpoint) resolvedEndpoint.URL = endpoint } case iam.ServiceName: if endpoint := c.IamEndpoint; endpoint != "" { log.Printf("[INFO] Setting custom IAM endpoint: %s", endpoint) resolvedEndpoint.URL = endpoint } case sts.ServiceName: if endpoint := c.StsEndpoint; endpoint != "" { log.Printf("[INFO] Setting custom STS endpoint: %s", endpoint) resolvedEndpoint.URL = endpoint } } return resolvedEndpoint, nil } return endpoints.ResolverFunc(resolver) } ��������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/errors.go������������������������������0000664�0000000�0000000�00000004002�13771713062�0025522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase import ( "errors" "fmt" ) // CannotAssumeRoleError occurs when AssumeRole cannot complete. type CannotAssumeRoleError struct { Config *Config Err error } func (e CannotAssumeRoleError) Error() string { if e.Config == nil { return fmt.Sprintf("cannot assume role: %s", e.Err) } return fmt.Sprintf(`IAM Role (%s) cannot be assumed. There are a number of possible causes of this - the most common are: * The credentials used in order to assume the role are invalid * The credentials do not have appropriate permission to assume the role * The role ARN is not valid Error: %s `, e.Config.AssumeRoleARN, e.Err) } func (e CannotAssumeRoleError) Unwrap() error { return e.Err } // IsCannotAssumeRoleError returns true if the error contains the CannotAssumeRoleError type. func IsCannotAssumeRoleError(err error) bool { var e CannotAssumeRoleError return errors.As(err, &e) } func (c *Config) NewCannotAssumeRoleError(err error) CannotAssumeRoleError { return CannotAssumeRoleError{Config: c, Err: err} } // NoValidCredentialSourcesError occurs when all credential lookup methods have been exhausted without results. type NoValidCredentialSourcesError struct { Config *Config Err error } func (e NoValidCredentialSourcesError) Error() string { if e.Config == nil { return fmt.Sprintf("no valid credential sources found: %s", e.Err) } return fmt.Sprintf(`no valid credential sources for %s found. Please see %s for more information about providing credentials. Error: %s `, e.Config.CallerName, e.Config.CallerDocumentationURL, e.Err) } func (e NoValidCredentialSourcesError) Unwrap() error { return e.Err } // IsNoValidCredentialSourcesError returns true if the error contains the NoValidCredentialSourcesError type. func IsNoValidCredentialSourcesError(err error) bool { var e NoValidCredentialSourcesError return errors.As(err, &e) } func (c *Config) NewNoValidCredentialSourcesError(err error) NoValidCredentialSourcesError { return NoValidCredentialSourcesError{Config: c, Err: err} } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/go.mod���������������������������������0000664�0000000�0000000�00000000342�13771713062�0024770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/aws-sdk-go-base require ( github.com/aws/aws-sdk-go v1.31.9 github.com/hashicorp/go-cleanhttp v0.5.0 github.com/hashicorp/go-multierror v1.0.0 github.com/mitchellh/go-homedir v1.1.0 ) go 1.13 ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/go.sum���������������������������������0000664�0000000�0000000�00000005362�13771713062�0025024�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������github.com/aws/aws-sdk-go v1.31.9 h1:n+b34ydVfgC30j0Qm69yaapmjejQPW2BoDBX7Uy/tLI= github.com/aws/aws-sdk-go v1.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/logger.go������������������������������0000664�0000000�0000000�00000000520�13771713062�0025466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase import ( "log" "strings" ) type DebugLogger struct{} func (l DebugLogger) Log(args ...interface{}) { tokens := make([]string, 0, len(args)) for _, arg := range args { if token, ok := arg.(string); ok { tokens = append(tokens, token) } } log.Printf("[DEBUG] [aws-sdk-go] %s", strings.Join(tokens, " ")) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/mock.go��������������������������������0000664�0000000�0000000�00000045014�13771713062�0025147�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase import ( "bytes" "encoding/json" "fmt" "log" "net/http" "net/http/httptest" "net/url" "os" "time" "github.com/aws/aws-sdk-go/aws" awsCredentials "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds" "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/session" ) const ( MockEc2MetadataAccessKey = `Ec2MetadataAccessKey` MockEc2MetadataSecretKey = `Ec2MetadataSecretKey` MockEc2MetadataSessionToken = `Ec2MetadataSessionToken` MockEcsCredentialsAccessKey = `EcsCredentialsAccessKey` MockEcsCredentialsSecretKey = `EcsCredentialsSecretKey` MockEcsCredentialsSessionToken = `EcsCredentialsSessionToken` MockEnvAccessKey = `EnvAccessKey` MockEnvSecretKey = `EnvSecretKey` MockEnvSessionToken = `EnvSessionToken` MockStaticAccessKey = `StaticAccessKey` MockStaticSecretKey = `StaticSecretKey` MockStsAssumeRoleAccessKey = `AssumeRoleAccessKey` MockStsAssumeRoleArn = `arn:aws:iam::555555555555:role/AssumeRole` MockStsAssumeRoleExternalId = `AssumeRoleExternalId` MockStsAssumeRoleInvalidResponseBodyInvalidClientTokenId = `<ErrorResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <Error> <Type>Sender</Type> <Code>InvalidClientTokenId</Code> <Message>The security token included in the request is invalid.</Message> </Error> <RequestId>4d0cf5ec-892a-4d3f-84e4-30e9987d9bdd</RequestId> </ErrorResponse>` MockStsAssumeRolePolicy = `{ "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "*", "Resource": "*", } }` MockStsAssumeRolePolicyArn = `arn:aws:iam::555555555555:policy/AssumeRolePolicy1` MockStsAssumeRoleSecretKey = `AssumeRoleSecretKey` MockStsAssumeRoleSessionName = `AssumeRoleSessionName` MockStsAssumeRoleSessionToken = `AssumeRoleSessionToken` MockStsAssumeRoleTagKey = `AssumeRoleTagKey` MockStsAssumeRoleTagValue = `AssumeRoleTagValue` MockStsAssumeRoleTransitiveTagKey = `AssumeRoleTagKey` MockStsAssumeRoleValidResponseBody = `<AssumeRoleResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <AssumeRoleResult> <AssumedRoleUser> <Arn>arn:aws:sts::555555555555:assumed-role/role/AssumeRoleSessionName</Arn> <AssumedRoleId>ARO123EXAMPLE123:AssumeRoleSessionName</AssumedRoleId> </AssumedRoleUser> <Credentials> <AccessKeyId>AssumeRoleAccessKey</AccessKeyId> <SecretAccessKey>AssumeRoleSecretKey</SecretAccessKey> <SessionToken>AssumeRoleSessionToken</SessionToken> <Expiration>2099-12-31T23:59:59Z</Expiration> </Credentials> </AssumeRoleResult> <ResponseMetadata> <RequestId>01234567-89ab-cdef-0123-456789abcdef</RequestId> </ResponseMetadata> </AssumeRoleResponse>` MockStsAssumeRoleWithWebIdentityAccessKey = `AssumeRoleWithWebIdentityAccessKey` MockStsAssumeRoleWithWebIdentityArn = `arn:aws:iam::666666666666:role/WebIdentityToken` MockStsAssumeRoleWithWebIdentitySecretKey = `AssumeRoleWithWebIdentitySecretKey` MockStsAssumeRoleWithWebIdentitySessionName = `AssumeRoleWithWebIdentitySessionName` MockStsAssumeRoleWithWebIdentitySessionToken = `AssumeRoleWithWebIdentitySessionToken` MockStsAssumeRoleWithWebIdentityValidResponseBody = `<AssumeRoleWithWebIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <AssumeRoleWithWebIdentityResult> <SubjectFromWebIdentityToken>amzn1.account.AF6RHO7KZU5XRVQJGXK6HB56KR2A</SubjectFromWebIdentityToken> <Audience>client.6666666666666666666.6666@apps.example.com</Audience> <AssumedRoleUser> <Arn>arn:aws:sts::666666666666:assumed-role/FederatedWebIdentityRole/AssumeRoleWithWebIdentitySessionName</Arn> <AssumedRoleId>ARO123EXAMPLE123:AssumeRoleWithWebIdentitySessionName</AssumedRoleId> </AssumedRoleUser> <Credentials> <SessionToken>AssumeRoleWithWebIdentitySessionToken</SessionToken> <SecretAccessKey>AssumeRoleWithWebIdentitySecretKey</SecretAccessKey> <Expiration>2099-12-31T23:59:59Z</Expiration> <AccessKeyId>AssumeRoleWithWebIdentityAccessKey</AccessKeyId> </Credentials> <Provider>www.amazon.com</Provider> </AssumeRoleWithWebIdentityResult> <ResponseMetadata> <RequestId>01234567-89ab-cdef-0123-456789abcdef</RequestId> </ResponseMetadata> </AssumeRoleWithWebIdentityResponse>` MockStsGetCallerIdentityAccountID = `222222222222` MockStsGetCallerIdentityInvalidResponseBodyAccessDenied = `<ErrorResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <Error> <Type>Sender</Type> <Code>AccessDenied</Code> <Message>User: arn:aws:iam::123456789012:user/Bob is not authorized to perform: sts:GetCallerIdentity</Message> </Error> <RequestId>01234567-89ab-cdef-0123-456789abcdef</RequestId> </ErrorResponse>` MockStsGetCallerIdentityPartition = `aws` MockStsGetCallerIdentityValidResponseBody = `<GetCallerIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <GetCallerIdentityResult> <Arn>arn:aws:iam::222222222222:user/Alice</Arn> <UserId>AKIAI44QH8DHBEXAMPLE</UserId> <Account>222222222222</Account> </GetCallerIdentityResult> <ResponseMetadata> <RequestId>01234567-89ab-cdef-0123-456789abcdef</RequestId> </ResponseMetadata> </GetCallerIdentityResponse>` MockWebIdentityToken = `WebIdentityToken` ) var ( MockEc2MetadataCredentials = awsCredentials.Value{ AccessKeyID: MockEc2MetadataAccessKey, ProviderName: ec2rolecreds.ProviderName, SecretAccessKey: MockEc2MetadataSecretKey, SessionToken: MockEc2MetadataSessionToken, } MockEcsCredentialsCredentials = awsCredentials.Value{ AccessKeyID: MockEcsCredentialsAccessKey, ProviderName: endpointcreds.ProviderName, SecretAccessKey: MockEcsCredentialsSecretKey, SessionToken: MockEcsCredentialsSessionToken, } MockEnvCredentials = awsCredentials.Value{ AccessKeyID: MockEnvAccessKey, ProviderName: awsCredentials.EnvProviderName, SecretAccessKey: MockEnvSecretKey, } MockEnvCredentialsWithSessionToken = awsCredentials.Value{ AccessKeyID: MockEnvAccessKey, ProviderName: awsCredentials.EnvProviderName, SecretAccessKey: MockEnvSecretKey, SessionToken: MockEnvSessionToken, } MockStaticCredentials = awsCredentials.Value{ AccessKeyID: MockStaticAccessKey, ProviderName: awsCredentials.StaticProviderName, SecretAccessKey: MockStaticSecretKey, } MockStsAssumeRoleCredentials = awsCredentials.Value{ AccessKeyID: MockStsAssumeRoleAccessKey, ProviderName: stscreds.ProviderName, SecretAccessKey: MockStsAssumeRoleSecretKey, SessionToken: MockStsAssumeRoleSessionToken, } MockStsAssumeRoleInvalidEndpointInvalidClientTokenId = &MockEndpoint{ Request: &MockRequest{ Body: url.Values{ "Action": []string{"AssumeRole"}, "DurationSeconds": []string{"900"}, "RoleArn": []string{MockStsAssumeRoleArn}, "RoleSessionName": []string{MockStsAssumeRoleSessionName}, "Version": []string{"2011-06-15"}, }.Encode(), Method: http.MethodPost, Uri: "/", }, Response: &MockResponse{ Body: MockStsAssumeRoleInvalidResponseBodyInvalidClientTokenId, ContentType: "text/xml", StatusCode: http.StatusForbidden, }, } MockStsAssumeRoleValidEndpoint = &MockEndpoint{ Request: &MockRequest{ Body: url.Values{ "Action": []string{"AssumeRole"}, "DurationSeconds": []string{"900"}, "RoleArn": []string{MockStsAssumeRoleArn}, "RoleSessionName": []string{MockStsAssumeRoleSessionName}, "Version": []string{"2011-06-15"}, }.Encode(), Method: http.MethodPost, Uri: "/", }, Response: &MockResponse{ Body: MockStsAssumeRoleValidResponseBody, ContentType: "text/xml", StatusCode: http.StatusOK, }, } MockStsAssumeRoleWithWebIdentityValidEndpoint = &MockEndpoint{ Request: &MockRequest{ Body: url.Values{ "Action": []string{"AssumeRoleWithWebIdentity"}, "RoleArn": []string{MockStsAssumeRoleWithWebIdentityArn}, "RoleSessionName": []string{MockStsAssumeRoleWithWebIdentitySessionName}, "Version": []string{"2011-06-15"}, "WebIdentityToken": []string{MockWebIdentityToken}, }.Encode(), Method: http.MethodPost, Uri: "/", }, Response: &MockResponse{ Body: MockStsAssumeRoleWithWebIdentityValidResponseBody, ContentType: "text/xml", StatusCode: http.StatusOK, }, } MockStsAssumeRoleWithWebIdentityCredentials = awsCredentials.Value{ AccessKeyID: MockStsAssumeRoleWithWebIdentityAccessKey, ProviderName: stscreds.WebIdentityProviderName, SecretAccessKey: MockStsAssumeRoleWithWebIdentitySecretKey, SessionToken: MockStsAssumeRoleWithWebIdentitySessionToken, } MockStsGetCallerIdentityInvalidEndpointAccessDenied = &MockEndpoint{ Request: &MockRequest{ Body: url.Values{ "Action": []string{"GetCallerIdentity"}, "Version": []string{"2011-06-15"}, }.Encode(), Method: http.MethodPost, Uri: "/", }, Response: &MockResponse{ Body: MockStsGetCallerIdentityInvalidResponseBodyAccessDenied, ContentType: "text/xml", StatusCode: http.StatusForbidden, }, } MockStsGetCallerIdentityValidEndpoint = &MockEndpoint{ Request: &MockRequest{ Body: url.Values{ "Action": []string{"GetCallerIdentity"}, "Version": []string{"2011-06-15"}, }.Encode(), Method: http.MethodPost, Uri: "/", }, Response: &MockResponse{ Body: MockStsGetCallerIdentityValidResponseBody, ContentType: "text/xml", StatusCode: http.StatusOK, }, } ) // MockAwsApiServer establishes a httptest server to simulate behaviour of a real AWS API server func MockAwsApiServer(svcName string, endpoints []*MockEndpoint) *httptest.Server { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { buf := new(bytes.Buffer) if _, err := buf.ReadFrom(r.Body); err != nil { w.WriteHeader(http.StatusInternalServerError) fmt.Fprintf(w, "Error reading from HTTP Request Body: %s", err) return } requestBody := buf.String() log.Printf("[DEBUG] Received %s API %q request to %q: %s", svcName, r.Method, r.RequestURI, requestBody) for _, e := range endpoints { if r.Method == e.Request.Method && r.RequestURI == e.Request.Uri && requestBody == e.Request.Body { log.Printf("[DEBUG] Mocked %s API responding with %d: %s", svcName, e.Response.StatusCode, e.Response.Body) w.WriteHeader(e.Response.StatusCode) w.Header().Set("Content-Type", e.Response.ContentType) w.Header().Set("X-Amzn-Requestid", "1b206dd1-f9a8-11e5-becf-051c60f11c4a") w.Header().Set("Date", time.Now().Format(time.RFC1123)) fmt.Fprintln(w, e.Response.Body) return } } w.WriteHeader(http.StatusBadRequest) })) return ts } // GetMockedAwsApiSession establishes an AWS session to a simulated AWS API server for a given service and route endpoints. func GetMockedAwsApiSession(svcName string, endpoints []*MockEndpoint) (func(), *session.Session, error) { ts := MockAwsApiServer(svcName, endpoints) sc := awsCredentials.NewStaticCredentials("accessKey", "secretKey", "") sess, err := session.NewSession(&aws.Config{ Credentials: sc, Region: aws.String("us-east-1"), Endpoint: aws.String(ts.URL), CredentialsChainVerboseErrors: aws.Bool(true), }) return ts.Close, sess, err } // awsMetadataApiMock establishes a httptest server to mock out the internal AWS Metadata // service. IAM Credentials are retrieved by the EC2RoleProvider, which makes // API calls to this internal URL. By replacing the server with a test server, // we can simulate an AWS environment func awsMetadataApiMock(responses []*MetadataResponse) func() { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain") w.Header().Add("Server", "MockEC2") log.Printf("[DEBUG] Mock EC2 metadata server received request: %s", r.RequestURI) for _, e := range responses { if r.RequestURI == e.Uri { fmt.Fprintln(w, e.Body) return } } w.WriteHeader(http.StatusBadRequest) })) os.Setenv("AWS_METADATA_URL", ts.URL+"/latest") return ts.Close } // ecsCredentialsApiMock establishes a httptest server to mock out the ECS credentials API. func ecsCredentialsApiMock() func() { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") w.Header().Add("Server", "MockECS") log.Printf("[DEBUG] Mock ECS credentials server received request: %s", r.RequestURI) if r.RequestURI == "/creds" { _ = json.NewEncoder(w).Encode(map[string]string{ "AccessKeyId": MockEcsCredentialsAccessKey, "Expiration": time.Now().UTC().Format(time.RFC3339), "RoleArn": "arn:aws:iam::000000000000:role/EcsCredentials", "SecretAccessKey": MockEcsCredentialsSecretKey, "Token": MockEcsCredentialsSessionToken, }) return } w.WriteHeader(http.StatusBadRequest) })) os.Setenv("AWS_CONTAINER_CREDENTIALS_FULL_URI", ts.URL+"/creds") return ts.Close } // MockStsAssumeRoleValidEndpointWithOptions returns a valid STS AssumeRole response with configurable request options. func MockStsAssumeRoleValidEndpointWithOptions(options map[string]string) *MockEndpoint { urlValues := url.Values{ "Action": []string{"AssumeRole"}, "DurationSeconds": []string{"900"}, "RoleArn": []string{MockStsAssumeRoleArn}, "RoleSessionName": []string{MockStsAssumeRoleSessionName}, "Version": []string{"2011-06-15"}, } for k, v := range options { urlValues.Set(k, v) } return &MockEndpoint{ Request: &MockRequest{ Body: urlValues.Encode(), Method: http.MethodPost, Uri: "/", }, Response: &MockResponse{ Body: MockStsAssumeRoleValidResponseBody, ContentType: "text/xml", StatusCode: http.StatusOK, }, } } // MockEndpoint represents a basic request and response that can be used for creating simple httptest server routes. type MockEndpoint struct { Request *MockRequest Response *MockResponse } // MockRequest represents a basic HTTP request type MockRequest struct { Method string Uri string Body string } // MockResponse represents a basic HTTP response. type MockResponse struct { StatusCode int Body string ContentType string } // MetadataResponse represents a metadata server response URI and body type MetadataResponse struct { Uri string `json:"uri"` Body string `json:"body"` } var ec2metadata_instanceIdEndpoint = &MetadataResponse{ Uri: "/latest/meta-data/instance-id", Body: "mock-instance-id", } var ec2metadata_securityCredentialsEndpoints = []*MetadataResponse{ { Uri: "/latest/api/token", Body: "Ec2MetadataApiToken", }, { Uri: "/latest/meta-data/iam/security-credentials/", Body: "test_role", }, { Uri: "/latest/meta-data/iam/security-credentials/test_role", Body: "{\"Code\":\"Success\",\"LastUpdated\":\"2015-12-11T17:17:25Z\",\"Type\":\"AWS-HMAC\",\"AccessKeyId\":\"Ec2MetadataAccessKey\",\"SecretAccessKey\":\"Ec2MetadataSecretKey\",\"Token\":\"Ec2MetadataSessionToken\"}", }, } var ec2metadata_iamInfoEndpoint = &MetadataResponse{ Uri: "/latest/meta-data/iam/info", Body: "{\"Code\": \"Success\",\"LastUpdated\": \"2016-03-17T12:27:32Z\",\"InstanceProfileArn\": \"arn:aws:iam::000000000000:instance-profile/my-instance-profile\",\"InstanceProfileId\": \"AIPAABCDEFGHIJKLMN123\"}", } const ec2metadata_iamInfoEndpoint_expectedAccountID = `000000000000` const ec2metadata_iamInfoEndpoint_expectedPartition = `aws` const iamResponse_GetUser_valid = `<GetUserResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <GetUserResult> <User> <UserId>AIDACKCEVSQ6C2EXAMPLE</UserId> <Path>/division_abc/subdivision_xyz/</Path> <UserName>Bob</UserName> <Arn>arn:aws:iam::111111111111:user/division_abc/subdivision_xyz/Bob</Arn> <CreateDate>2013-10-02T17:01:44Z</CreateDate> <PasswordLastUsed>2014-10-10T14:37:51Z</PasswordLastUsed> </User> </GetUserResult> <ResponseMetadata> <RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId> </ResponseMetadata> </GetUserResponse>` const iamResponse_GetUser_valid_expectedAccountID = `111111111111` const iamResponse_GetUser_valid_expectedPartition = `aws` const iamResponse_GetUser_unauthorized = `<ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <Error> <Type>Sender</Type> <Code>AccessDenied</Code> <Message>User: arn:aws:iam::123456789012:user/Bob is not authorized to perform: iam:GetUser on resource: arn:aws:iam::123456789012:user/Bob</Message> </Error> <RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId> </ErrorResponse>` const iamResponse_GetUser_federatedFailure = `<ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <Error> <Type>Sender</Type> <Code>ValidationError</Code> <Message>Must specify userName when calling with non-User credentials</Message> </Error> <RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId> </ErrorResponse>` const iamResponse_ListRoles_valid = `<ListRolesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <ListRolesResult> <IsTruncated>true</IsTruncated> <Marker>AWceSSsKsazQ4IEplT9o4hURCzBs00iavlEvEXAMPLE</Marker> <Roles> <member> <Path>/</Path> <AssumeRolePolicyDocument>%7B%22Version%22%3A%222008-10-17%22%2C%22Statement%22%3A%5B%7B%22Sid%22%3A%22%22%2C%22Effect%22%3A%22Allow%22%2C%22Principal%22%3A%7B%22Service%22%3A%22ec2.amazonaws.com%22%7D%2C%22Action%22%3A%22sts%3AAssumeRole%22%7D%5D%7D</AssumeRolePolicyDocument> <RoleId>AROACKCEVSQ6C2EXAMPLE</RoleId> <RoleName>elasticbeanstalk-role</RoleName> <Arn>arn:aws:iam::444444444444:role/elasticbeanstalk-role</Arn> <CreateDate>2013-10-02T17:01:44Z</CreateDate> </member> </Roles> </ListRolesResult> <ResponseMetadata> <RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId> </ResponseMetadata> </ListRolesResponse>` const iamResponse_ListRoles_valid_expectedAccountID = `444444444444` const iamResponse_ListRoles_valid_expectedPartition = `aws` const iamResponse_ListRoles_unauthorized = `<ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <Error> <Type>Sender</Type> <Code>AccessDenied</Code> <Message>User: arn:aws:iam::123456789012:user/Bob is not authorized to perform: iam:ListRoles on resource: arn:aws:iam::123456789012:role/</Message> </Error> <RequestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestId> </ErrorResponse>` ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/session.go�����������������������������0000664�0000000�0000000�00000014501�13771713062�0025676�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase import ( "crypto/tls" "fmt" "log" "net/http" "os" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/sts" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/go-cleanhttp" ) const ( // AppendUserAgentEnvVar is a conventionally used environment variable // containing additional HTTP User-Agent information. // If present and its value is non-empty, it is directly appended to the // User-Agent header for HTTP requests. AppendUserAgentEnvVar = "TF_APPEND_USER_AGENT" // Maximum network retries. // We depend on the AWS Go SDK DefaultRetryer exponential backoff. // Ensure that if the AWS Config MaxRetries is set high (which it is by // default), that we only retry for a few seconds with typically // unrecoverable network errors, such as DNS lookup failures. MaxNetworkRetryCount = 9 ) // GetSessionOptions attempts to return valid AWS Go SDK session authentication // options based on pre-existing credential provider, configured profile, or // fallback to automatically a determined session via the AWS Go SDK. func GetSessionOptions(c *Config) (*session.Options, error) { options := &session.Options{ Config: aws.Config{ EndpointResolver: c.EndpointResolver(), HTTPClient: cleanhttp.DefaultClient(), MaxRetries: aws.Int(0), Region: aws.String(c.Region), }, Profile: c.Profile, SharedConfigState: session.SharedConfigEnable, } // get and validate credentials creds, err := GetCredentials(c) if err != nil { return nil, err } // add the validated credentials to the session options options.Config.Credentials = creds if c.Insecure { transport := options.Config.HTTPClient.Transport.(*http.Transport) transport.TLSClientConfig = &tls.Config{ InsecureSkipVerify: true, } } if c.DebugLogging { options.Config.LogLevel = aws.LogLevel(aws.LogDebugWithHTTPBody | aws.LogDebugWithRequestRetries | aws.LogDebugWithRequestErrors) options.Config.Logger = DebugLogger{} } return options, nil } // GetSession attempts to return valid AWS Go SDK session. func GetSession(c *Config) (*session.Session, error) { if c.SkipMetadataApiCheck { os.Setenv("AWS_EC2_METADATA_DISABLED", "true") } options, err := GetSessionOptions(c) if err != nil { return nil, err } sess, err := session.NewSessionWithOptions(*options) if err != nil { if tfawserr.ErrCodeEquals(err, "NoCredentialProviders") { return nil, c.NewNoValidCredentialSourcesError(err) } return nil, fmt.Errorf("Error creating AWS session: %w", err) } if c.MaxRetries > 0 { sess = sess.Copy(&aws.Config{MaxRetries: aws.Int(c.MaxRetries)}) } for _, product := range c.UserAgentProducts { sess.Handlers.Build.PushBack(request.MakeAddToUserAgentHandler(product.Name, product.Version, product.Extra...)) } // Add custom input from ENV to the User-Agent request header // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/9149 if v := os.Getenv(AppendUserAgentEnvVar); v != "" { log.Printf("[DEBUG] Using additional User-Agent Info: %s", v) sess.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler(v)) } // Generally, we want to configure a lower retry theshold for networking issues // as the session retry threshold is very high by default and can mask permanent // networking failures, such as a non-existent service endpoint. // MaxRetries will override this logic if it has a lower retry threshold. // NOTE: This logic can be fooled by other request errors raising the retry count // before any networking error occurs sess.Handlers.Retry.PushBack(func(r *request.Request) { if r.RetryCount < MaxNetworkRetryCount { return } // RequestError: send request failed // caused by: Post https://FQDN/: dial tcp: lookup FQDN: no such host if tfawserr.ErrMessageAndOrigErrContain(r.Error, "RequestError", "send request failed", "no such host") { log.Printf("[WARN] Disabling retries after next request due to networking issue") r.Retryable = aws.Bool(false) } // RequestError: send request failed // caused by: Post https://FQDN/: dial tcp IPADDRESS:443: connect: connection refused if tfawserr.ErrMessageAndOrigErrContain(r.Error, "RequestError", "send request failed", "connection refused") { log.Printf("[WARN] Disabling retries after next request due to networking issue") r.Retryable = aws.Bool(false) } }) if !c.SkipCredsValidation { if _, _, err := GetAccountIDAndPartitionFromSTSGetCallerIdentity(sts.New(sess)); err != nil { return nil, fmt.Errorf("error validating provider credentials: %w", err) } } return sess, nil } // GetSessionWithAccountIDAndPartition attempts to return valid AWS Go SDK session // along with account ID and partition information if available func GetSessionWithAccountIDAndPartition(c *Config) (*session.Session, string, string, error) { sess, err := GetSession(c) if err != nil { return nil, "", "", err } if c.AssumeRoleARN != "" { accountID, partition, _ := parseAccountIDAndPartitionFromARN(c.AssumeRoleARN) return sess, accountID, partition, nil } iamClient := iam.New(sess) stsClient := sts.New(sess) if !c.SkipCredsValidation { accountID, partition, err := GetAccountIDAndPartitionFromSTSGetCallerIdentity(stsClient) if err != nil { return nil, "", "", fmt.Errorf("error validating provider credentials: %w", err) } return sess, accountID, partition, nil } if !c.SkipRequestingAccountId { credentialsProviderName := "" if credentialsValue, err := sess.Config.Credentials.Get(); err == nil { credentialsProviderName = credentialsValue.ProviderName } accountID, partition, err := GetAccountIDAndPartition(iamClient, stsClient, credentialsProviderName) if err == nil { return sess, accountID, partition, nil } return nil, "", "", fmt.Errorf( "AWS account ID not previously found and failed retrieving via all available methods. "+ "See https://www.terraform.io/docs/providers/aws/index.html#skip_requesting_account_id for workaround and implications. "+ "Errors: %w", err) } var partition string if p, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), c.Region); ok { partition = p.ID() } return sess, "", partition, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/tfawserr/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025520�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/tfawserr/awserr.go���������������������0000664�0000000�0000000�00000004307�13771713062�0027356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package tfawserr import ( "errors" "strings" "github.com/aws/aws-sdk-go/aws/awserr" ) // ErrMessageAndOrigErrContain returns true if the error matches all these conditions: // * err is of type awserr.Error // * Error.Code() matches code // * Error.Message() contains message // * Error.OrigErr() contains origErrMessage func ErrMessageAndOrigErrContain(err error, code string, message string, origErrMessage string) bool { if !ErrMessageContains(err, code, message) { return false } if origErrMessage == "" { return true } // Ensure OrigErr() is non-nil, to prevent panics if origErr := err.(awserr.Error).OrigErr(); origErr != nil { return strings.Contains(origErr.Error(), origErrMessage) } return false } // ErrCodeEquals returns true if the error matches all these conditions: // * err is of type awserr.Error // * Error.Code() equals code func ErrCodeEquals(err error, code string) bool { var awsErr awserr.Error if errors.As(err, &awsErr) { return awsErr.Code() == code } return false } // ErrCodeContains returns true if the error matches all these conditions: // * err is of type awserr.Error // * Error.Code() contains code func ErrCodeContains(err error, code string) bool { var awsErr awserr.Error if errors.As(err, &awsErr) { return strings.Contains(awsErr.Code(), code) } return false } // ErrMessageContains returns true if the error matches all these conditions: // * err is of type awserr.Error // * Error.Code() equals code // * Error.Message() contains message func ErrMessageContains(err error, code string, message string) bool { var awsErr awserr.Error if errors.As(err, &awsErr) { return awsErr.Code() == code && strings.Contains(awsErr.Message(), message) } return false } // ErrStatusCodeEquals returns true if the error matches all these conditions: // * err is of type awserr.RequestFailure // * RequestFailure.StatusCode() equals statusCode // It is always preferable to use ErrMessageContains() except in older APIs (e.g. S3) // that sometimes only respond with status codes. func ErrStatusCodeEquals(err error, statusCode int) bool { var awsErr awserr.RequestFailure if errors.As(err, &awsErr) { return awsErr.StatusCode() == statusCode } return false } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/aws-sdk-go-base/validation.go��������������������������0000664�0000000�0000000�00000002223�13771713062�0026343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package awsbase import ( "fmt" "github.com/aws/aws-sdk-go/aws/endpoints" ) // ValidateAccountID checks if the given AWS account ID is specifically allowed or forbidden. // The allowedAccountIDs can be used as a whitelist and forbiddenAccountIDs can be used as a blacklist. func ValidateAccountID(accountID string, allowedAccountIDs, forbiddenAccountIDs []string) error { if len(forbiddenAccountIDs) > 0 { for _, forbiddenAccountID := range forbiddenAccountIDs { if accountID == forbiddenAccountID { return fmt.Errorf("Forbidden AWS Account ID: %s", accountID) } } } if len(allowedAccountIDs) > 0 { for _, allowedAccountID := range allowedAccountIDs { if accountID == allowedAccountID { return nil } } return fmt.Errorf("AWS Account ID not allowed: %s", accountID) } return nil } // ValidateRegion checks if the given region is a valid AWS region. func ValidateRegion(region string) error { for _, partition := range endpoints.DefaultPartitions() { for _, partitionRegion := range partition.Regions() { if region == partitionRegion.ID() { return nil } } } return fmt.Errorf("Invalid AWS Region: %s", region) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022302�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/��������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023053�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/LICENSE�������������������������������������0000664�0000000�0000000�00000037151�13771713062�0024067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/README.md�����������������������������������0000664�0000000�0000000�00000002531�13771713062�0024333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Consul API client ================= This package provides the `api` package which attempts to provide programmatic access to the full Consul API. Currently, all of the Consul APIs included in version 0.6.0 are supported. Documentation ============= The full documentation is available on [Godoc](https://godoc.org/github.com/hashicorp/consul/api) Usage ===== Below is an example of using the Consul client: ```go package main import "github.com/hashicorp/consul/api" import "fmt" func main() { // Get a new client client, err := api.NewClient(api.DefaultConfig()) if err != nil { panic(err) } // Get a handle to the KV API kv := client.KV() // PUT a new KV pair p := &api.KVPair{Key: "REDIS_MAXCLIENTS", Value: []byte("1000")} _, err = kv.Put(p, nil) if err != nil { panic(err) } // Lookup the pair pair, _, err := kv.Get("REDIS_MAXCLIENTS", nil) if err != nil { panic(err) } fmt.Printf("KV: %v %s\n", pair.Key, pair.Value) } ``` To run this example, start a Consul server: ```bash consul agent -dev ``` Copy the code above into a file such as `main.go`. Install and run. You'll see a key (`REDIS_MAXCLIENTS`) and value (`1000`) printed. ```bash $ go get $ go run main.go KV: REDIS_MAXCLIENTS 1000 ``` After running the code, you can also view the values in the Consul UI on your local machine at http://localhost:8500/ui/dc1/kv �����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/acl.go��������������������������������������0000664�0000000�0000000�00000074450�13771713062�0024153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "fmt" "io" "io/ioutil" "net/url" "time" "github.com/mitchellh/mapstructure" ) const ( // ACLClientType is the client type token ACLClientType = "client" // ACLManagementType is the management type token ACLManagementType = "management" ) type ACLLink struct { ID string Name string } type ACLTokenPolicyLink = ACLLink type ACLTokenRoleLink = ACLLink // ACLToken represents an ACL Token type ACLToken struct { CreateIndex uint64 ModifyIndex uint64 AccessorID string SecretID string Description string Policies []*ACLTokenPolicyLink `json:",omitempty"` Roles []*ACLTokenRoleLink `json:",omitempty"` ServiceIdentities []*ACLServiceIdentity `json:",omitempty"` Local bool ExpirationTTL time.Duration `json:",omitempty"` ExpirationTime *time.Time `json:",omitempty"` CreateTime time.Time `json:",omitempty"` Hash []byte `json:",omitempty"` // DEPRECATED (ACL-Legacy-Compat) // Rules will only be present for legacy tokens returned via the new APIs Rules string `json:",omitempty"` // Namespace is the namespace the ACLToken is associated with. // Namespaces is a Consul Enterprise feature. Namespace string `json:",omitempty"` } type ACLTokenListEntry struct { CreateIndex uint64 ModifyIndex uint64 AccessorID string Description string Policies []*ACLTokenPolicyLink `json:",omitempty"` Roles []*ACLTokenRoleLink `json:",omitempty"` ServiceIdentities []*ACLServiceIdentity `json:",omitempty"` Local bool ExpirationTime *time.Time `json:",omitempty"` CreateTime time.Time Hash []byte Legacy bool // Namespace is the namespace the ACLTokenListEntry is associated with. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } // ACLEntry is used to represent a legacy ACL token // The legacy tokens are deprecated. type ACLEntry struct { CreateIndex uint64 ModifyIndex uint64 ID string Name string Type string Rules string } // ACLReplicationStatus is used to represent the status of ACL replication. type ACLReplicationStatus struct { Enabled bool Running bool SourceDatacenter string ReplicationType string ReplicatedIndex uint64 ReplicatedRoleIndex uint64 ReplicatedTokenIndex uint64 LastSuccess time.Time LastError time.Time } // ACLServiceIdentity represents a high-level grant of all necessary privileges // to assume the identity of the named Service in the Catalog and within // Connect. type ACLServiceIdentity struct { ServiceName string Datacenters []string `json:",omitempty"` } // ACLPolicy represents an ACL Policy. type ACLPolicy struct { ID string Name string Description string Rules string Datacenters []string Hash []byte CreateIndex uint64 ModifyIndex uint64 // Namespace is the namespace the ACLPolicy is associated with. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } type ACLPolicyListEntry struct { ID string Name string Description string Datacenters []string Hash []byte CreateIndex uint64 ModifyIndex uint64 // Namespace is the namespace the ACLPolicyListEntry is associated with. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } type ACLRolePolicyLink = ACLLink // ACLRole represents an ACL Role. type ACLRole struct { ID string Name string Description string Policies []*ACLRolePolicyLink `json:",omitempty"` ServiceIdentities []*ACLServiceIdentity `json:",omitempty"` Hash []byte CreateIndex uint64 ModifyIndex uint64 // Namespace is the namespace the ACLRole is associated with. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } // BindingRuleBindType is the type of binding rule mechanism used. type BindingRuleBindType string const ( // BindingRuleBindTypeService binds to a service identity with the given name. BindingRuleBindTypeService BindingRuleBindType = "service" // BindingRuleBindTypeRole binds to pre-existing roles with the given name. BindingRuleBindTypeRole BindingRuleBindType = "role" ) type ACLBindingRule struct { ID string Description string AuthMethod string Selector string BindType BindingRuleBindType BindName string CreateIndex uint64 ModifyIndex uint64 // Namespace is the namespace the ACLBindingRule is associated with. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } type ACLAuthMethod struct { Name string Type string Description string // Configuration is arbitrary configuration for the auth method. This // should only contain primitive values and containers (such as lists and // maps). Config map[string]interface{} CreateIndex uint64 ModifyIndex uint64 // Namespace is the namespace the ACLAuthMethod is associated with. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } type ACLAuthMethodListEntry struct { Name string Type string Description string CreateIndex uint64 ModifyIndex uint64 // Namespace is the namespace the ACLAuthMethodListEntry is associated with. // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } // ParseKubernetesAuthMethodConfig takes a raw config map and returns a parsed // KubernetesAuthMethodConfig. func ParseKubernetesAuthMethodConfig(raw map[string]interface{}) (*KubernetesAuthMethodConfig, error) { var config KubernetesAuthMethodConfig decodeConf := &mapstructure.DecoderConfig{ Result: &config, WeaklyTypedInput: true, } decoder, err := mapstructure.NewDecoder(decodeConf) if err != nil { return nil, err } if err := decoder.Decode(raw); err != nil { return nil, fmt.Errorf("error decoding config: %s", err) } return &config, nil } // KubernetesAuthMethodConfig is the config for the built-in Consul auth method // for Kubernetes. type KubernetesAuthMethodConfig struct { Host string `json:",omitempty"` CACert string `json:",omitempty"` ServiceAccountJWT string `json:",omitempty"` } // RenderToConfig converts this into a map[string]interface{} suitable for use // in the ACLAuthMethod.Config field. func (c *KubernetesAuthMethodConfig) RenderToConfig() map[string]interface{} { return map[string]interface{}{ "Host": c.Host, "CACert": c.CACert, "ServiceAccountJWT": c.ServiceAccountJWT, } } type ACLLoginParams struct { AuthMethod string BearerToken string Meta map[string]string `json:",omitempty"` } // ACL can be used to query the ACL endpoints type ACL struct { c *Client } // ACL returns a handle to the ACL endpoints func (c *Client) ACL() *ACL { return &ACL{c} } // Bootstrap is used to perform a one-time ACL bootstrap operation on a cluster // to get the first management token. func (a *ACL) Bootstrap() (*ACLToken, *WriteMeta, error) { r := a.c.newRequest("PUT", "/v1/acl/bootstrap") rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLToken if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // Create is used to generate a new token with the given parameters // // Deprecated: Use TokenCreate instead. func (a *ACL) Create(acl *ACLEntry, q *WriteOptions) (string, *WriteMeta, error) { r := a.c.newRequest("PUT", "/v1/acl/create") r.setWriteOptions(q) r.obj = acl rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return "", nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out struct{ ID string } if err := decodeBody(resp, &out); err != nil { return "", nil, err } return out.ID, wm, nil } // Update is used to update the rules of an existing token // // Deprecated: Use TokenUpdate instead. func (a *ACL) Update(acl *ACLEntry, q *WriteOptions) (*WriteMeta, error) { r := a.c.newRequest("PUT", "/v1/acl/update") r.setWriteOptions(q) r.obj = acl rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } // Destroy is used to destroy a given ACL token ID // // Deprecated: Use TokenDelete instead. func (a *ACL) Destroy(id string, q *WriteOptions) (*WriteMeta, error) { r := a.c.newRequest("PUT", "/v1/acl/destroy/"+id) r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } // Clone is used to return a new token cloned from an existing one // // Deprecated: Use TokenClone instead. func (a *ACL) Clone(id string, q *WriteOptions) (string, *WriteMeta, error) { r := a.c.newRequest("PUT", "/v1/acl/clone/"+id) r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return "", nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out struct{ ID string } if err := decodeBody(resp, &out); err != nil { return "", nil, err } return out.ID, wm, nil } // Info is used to query for information about an ACL token // // Deprecated: Use TokenRead instead. func (a *ACL) Info(id string, q *QueryOptions) (*ACLEntry, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/info/"+id) r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*ACLEntry if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } if len(entries) > 0 { return entries[0], qm, nil } return nil, qm, nil } // List is used to get all the ACL tokens // // Deprecated: Use TokenList instead. func (a *ACL) List(q *QueryOptions) ([]*ACLEntry, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/list") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*ACLEntry if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // Replication returns the status of the ACL replication process in the datacenter func (a *ACL) Replication(q *QueryOptions) (*ACLReplicationStatus, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/replication") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries *ACLReplicationStatus if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // TokenCreate creates a new ACL token. If either the AccessorID or SecretID fields // of the ACLToken structure are empty they will be filled in by Consul. func (a *ACL) TokenCreate(token *ACLToken, q *WriteOptions) (*ACLToken, *WriteMeta, error) { r := a.c.newRequest("PUT", "/v1/acl/token") r.setWriteOptions(q) r.obj = token rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLToken if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // TokenUpdate updates a token in place without modifying its AccessorID or SecretID. A valid // AccessorID must be set in the ACLToken structure passed to this function but the SecretID may // be omitted and will be filled in by Consul with its existing value. func (a *ACL) TokenUpdate(token *ACLToken, q *WriteOptions) (*ACLToken, *WriteMeta, error) { if token.AccessorID == "" { return nil, nil, fmt.Errorf("Must specify an AccessorID for Token Updating") } r := a.c.newRequest("PUT", "/v1/acl/token/"+token.AccessorID) r.setWriteOptions(q) r.obj = token rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLToken if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // TokenClone will create a new token with the same policies and locality as the original // token but will have its own auto-generated AccessorID and SecretID as well having the // description passed to this function. The tokenID parameter must be a valid Accessor ID // of an existing token. func (a *ACL) TokenClone(tokenID string, description string, q *WriteOptions) (*ACLToken, *WriteMeta, error) { if tokenID == "" { return nil, nil, fmt.Errorf("Must specify a tokenID for Token Cloning") } r := a.c.newRequest("PUT", "/v1/acl/token/"+tokenID+"/clone") r.setWriteOptions(q) r.obj = struct{ Description string }{description} rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLToken if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // TokenDelete removes a single ACL token. The tokenID parameter must be a valid // Accessor ID of an existing token. func (a *ACL) TokenDelete(tokenID string, q *WriteOptions) (*WriteMeta, error) { r := a.c.newRequest("DELETE", "/v1/acl/token/"+tokenID) r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } // TokenRead retrieves the full token details. The tokenID parameter must be a valid // Accessor ID of an existing token. func (a *ACL) TokenRead(tokenID string, q *QueryOptions) (*ACLToken, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/token/"+tokenID) r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out ACLToken if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // TokenReadSelf retrieves the full token details of the token currently // assigned to the API Client. In this manner its possible to read a token // by its Secret ID. func (a *ACL) TokenReadSelf(q *QueryOptions) (*ACLToken, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/token/self") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out ACLToken if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // TokenList lists all tokens. The listing does not contain any SecretIDs as those // may only be retrieved by a call to TokenRead. func (a *ACL) TokenList(q *QueryOptions) ([]*ACLTokenListEntry, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/tokens") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*ACLTokenListEntry if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // PolicyCreate will create a new policy. It is not allowed for the policy parameters // ID field to be set as this will be generated by Consul while processing the request. func (a *ACL) PolicyCreate(policy *ACLPolicy, q *WriteOptions) (*ACLPolicy, *WriteMeta, error) { if policy.ID != "" { return nil, nil, fmt.Errorf("Cannot specify an ID in Policy Creation") } r := a.c.newRequest("PUT", "/v1/acl/policy") r.setWriteOptions(q) r.obj = policy rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLPolicy if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // PolicyUpdate updates a policy. The ID field of the policy parameter must be set to an // existing policy ID func (a *ACL) PolicyUpdate(policy *ACLPolicy, q *WriteOptions) (*ACLPolicy, *WriteMeta, error) { if policy.ID == "" { return nil, nil, fmt.Errorf("Must specify an ID in Policy Update") } r := a.c.newRequest("PUT", "/v1/acl/policy/"+policy.ID) r.setWriteOptions(q) r.obj = policy rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLPolicy if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // PolicyDelete deletes a policy given its ID. func (a *ACL) PolicyDelete(policyID string, q *WriteOptions) (*WriteMeta, error) { r := a.c.newRequest("DELETE", "/v1/acl/policy/"+policyID) r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } // PolicyRead retrieves the policy details including the rule set. func (a *ACL) PolicyRead(policyID string, q *QueryOptions) (*ACLPolicy, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/policy/"+policyID) r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out ACLPolicy if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // PolicyList retrieves a listing of all policies. The listing does not include the // rules for any policy as those should be retrieved by subsequent calls to PolicyRead. func (a *ACL) PolicyList(q *QueryOptions) ([]*ACLPolicyListEntry, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/policies") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*ACLPolicyListEntry if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // RulesTranslate translates the legacy rule syntax into the current syntax. // // Deprecated: Support for the legacy syntax translation will be removed // when legacy ACL support is removed. func (a *ACL) RulesTranslate(rules io.Reader) (string, error) { r := a.c.newRequest("POST", "/v1/acl/rules/translate") r.body = rules rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return "", err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt ruleBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return "", fmt.Errorf("Failed to read translated rule body: %v", err) } return string(ruleBytes), nil } // RulesTranslateToken translates the rules associated with the legacy syntax // into the current syntax and returns the results. // // Deprecated: Support for the legacy syntax translation will be removed // when legacy ACL support is removed. func (a *ACL) RulesTranslateToken(tokenID string) (string, error) { r := a.c.newRequest("GET", "/v1/acl/rules/translate/"+tokenID) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return "", err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt ruleBytes, err := ioutil.ReadAll(resp.Body) if err != nil { return "", fmt.Errorf("Failed to read translated rule body: %v", err) } return string(ruleBytes), nil } // RoleCreate will create a new role. It is not allowed for the role parameters // ID field to be set as this will be generated by Consul while processing the request. func (a *ACL) RoleCreate(role *ACLRole, q *WriteOptions) (*ACLRole, *WriteMeta, error) { if role.ID != "" { return nil, nil, fmt.Errorf("Cannot specify an ID in Role Creation") } r := a.c.newRequest("PUT", "/v1/acl/role") r.setWriteOptions(q) r.obj = role rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLRole if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // RoleUpdate updates a role. The ID field of the role parameter must be set to an // existing role ID func (a *ACL) RoleUpdate(role *ACLRole, q *WriteOptions) (*ACLRole, *WriteMeta, error) { if role.ID == "" { return nil, nil, fmt.Errorf("Must specify an ID in Role Update") } r := a.c.newRequest("PUT", "/v1/acl/role/"+role.ID) r.setWriteOptions(q) r.obj = role rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLRole if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // RoleDelete deletes a role given its ID. func (a *ACL) RoleDelete(roleID string, q *WriteOptions) (*WriteMeta, error) { r := a.c.newRequest("DELETE", "/v1/acl/role/"+roleID) r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } // RoleRead retrieves the role details (by ID). Returns nil if not found. func (a *ACL) RoleRead(roleID string, q *QueryOptions) (*ACLRole, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/role/"+roleID) r.setQueryOptions(q) found, rtt, resp, err := requireNotFoundOrOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if !found { return nil, qm, nil } var out ACLRole if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // RoleReadByName retrieves the role details (by name). Returns nil if not found. func (a *ACL) RoleReadByName(roleName string, q *QueryOptions) (*ACLRole, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/role/name/"+url.QueryEscape(roleName)) r.setQueryOptions(q) found, rtt, resp, err := requireNotFoundOrOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if !found { return nil, qm, nil } var out ACLRole if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // RoleList retrieves a listing of all roles. The listing does not include some // metadata for the role as those should be retrieved by subsequent calls to // RoleRead. func (a *ACL) RoleList(q *QueryOptions) ([]*ACLRole, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/roles") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*ACLRole if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // AuthMethodCreate will create a new auth method. func (a *ACL) AuthMethodCreate(method *ACLAuthMethod, q *WriteOptions) (*ACLAuthMethod, *WriteMeta, error) { if method.Name == "" { return nil, nil, fmt.Errorf("Must specify a Name in Auth Method Creation") } r := a.c.newRequest("PUT", "/v1/acl/auth-method") r.setWriteOptions(q) r.obj = method rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLAuthMethod if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // AuthMethodUpdate updates an auth method. func (a *ACL) AuthMethodUpdate(method *ACLAuthMethod, q *WriteOptions) (*ACLAuthMethod, *WriteMeta, error) { if method.Name == "" { return nil, nil, fmt.Errorf("Must specify a Name in Auth Method Update") } r := a.c.newRequest("PUT", "/v1/acl/auth-method/"+url.QueryEscape(method.Name)) r.setWriteOptions(q) r.obj = method rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLAuthMethod if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // AuthMethodDelete deletes an auth method given its Name. func (a *ACL) AuthMethodDelete(methodName string, q *WriteOptions) (*WriteMeta, error) { if methodName == "" { return nil, fmt.Errorf("Must specify a Name in Auth Method Delete") } r := a.c.newRequest("DELETE", "/v1/acl/auth-method/"+url.QueryEscape(methodName)) r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } // AuthMethodRead retrieves the auth method. Returns nil if not found. func (a *ACL) AuthMethodRead(methodName string, q *QueryOptions) (*ACLAuthMethod, *QueryMeta, error) { if methodName == "" { return nil, nil, fmt.Errorf("Must specify a Name in Auth Method Read") } r := a.c.newRequest("GET", "/v1/acl/auth-method/"+url.QueryEscape(methodName)) r.setQueryOptions(q) found, rtt, resp, err := requireNotFoundOrOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if !found { return nil, qm, nil } var out ACLAuthMethod if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // AuthMethodList retrieves a listing of all auth methods. The listing does not // include some metadata for the auth method as those should be retrieved by // subsequent calls to AuthMethodRead. func (a *ACL) AuthMethodList(q *QueryOptions) ([]*ACLAuthMethodListEntry, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/auth-methods") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*ACLAuthMethodListEntry if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // BindingRuleCreate will create a new binding rule. It is not allowed for the // binding rule parameter's ID field to be set as this will be generated by // Consul while processing the request. func (a *ACL) BindingRuleCreate(rule *ACLBindingRule, q *WriteOptions) (*ACLBindingRule, *WriteMeta, error) { if rule.ID != "" { return nil, nil, fmt.Errorf("Cannot specify an ID in Binding Rule Creation") } r := a.c.newRequest("PUT", "/v1/acl/binding-rule") r.setWriteOptions(q) r.obj = rule rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLBindingRule if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // BindingRuleUpdate updates a binding rule. The ID field of the role binding // rule parameter must be set to an existing binding rule ID. func (a *ACL) BindingRuleUpdate(rule *ACLBindingRule, q *WriteOptions) (*ACLBindingRule, *WriteMeta, error) { if rule.ID == "" { return nil, nil, fmt.Errorf("Must specify an ID in Binding Rule Update") } r := a.c.newRequest("PUT", "/v1/acl/binding-rule/"+rule.ID) r.setWriteOptions(q) r.obj = rule rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLBindingRule if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // BindingRuleDelete deletes a binding rule given its ID. func (a *ACL) BindingRuleDelete(bindingRuleID string, q *WriteOptions) (*WriteMeta, error) { r := a.c.newRequest("DELETE", "/v1/acl/binding-rule/"+bindingRuleID) r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } // BindingRuleRead retrieves the binding rule details. Returns nil if not found. func (a *ACL) BindingRuleRead(bindingRuleID string, q *QueryOptions) (*ACLBindingRule, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/binding-rule/"+bindingRuleID) r.setQueryOptions(q) found, rtt, resp, err := requireNotFoundOrOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if !found { return nil, qm, nil } var out ACLBindingRule if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // BindingRuleList retrieves a listing of all binding rules. func (a *ACL) BindingRuleList(methodName string, q *QueryOptions) ([]*ACLBindingRule, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/acl/binding-rules") if methodName != "" { r.params.Set("authmethod", methodName) } r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*ACLBindingRule if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // Login is used to exchange auth method credentials for a newly-minted Consul Token. func (a *ACL) Login(auth *ACLLoginParams, q *WriteOptions) (*ACLToken, *WriteMeta, error) { r := a.c.newRequest("POST", "/v1/acl/login") r.setWriteOptions(q) r.obj = auth rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out ACLToken if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } // Logout is used to destroy a Consul Token created via Login(). func (a *ACL) Logout(q *WriteOptions) (*WriteMeta, error) { r := a.c.newRequest("POST", "/v1/acl/logout") r.setWriteOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/agent.go������������������������������������0000664�0000000�0000000�00000100643�13771713062�0024504�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bufio" "bytes" "fmt" "io" "net/http" "net/url" ) // ServiceKind is the kind of service being registered. type ServiceKind string const ( // ServiceKindTypical is a typical, classic Consul service. This is // represented by the absence of a value. This was chosen for ease of // backwards compatibility: existing services in the catalog would // default to the typical service. ServiceKindTypical ServiceKind = "" // ServiceKindConnectProxy is a proxy for the Connect feature. This // service proxies another service within Consul and speaks the connect // protocol. ServiceKindConnectProxy ServiceKind = "connect-proxy" // ServiceKindMeshGateway is a Mesh Gateway for the Connect feature. This // service will proxy connections based off the SNI header set by other // connect proxies ServiceKindMeshGateway ServiceKind = "mesh-gateway" ) // UpstreamDestType is the type of upstream discovery mechanism. type UpstreamDestType string const ( // UpstreamDestTypeService discovers instances via healthy service lookup. UpstreamDestTypeService UpstreamDestType = "service" // UpstreamDestTypePreparedQuery discovers instances via prepared query // execution. UpstreamDestTypePreparedQuery UpstreamDestType = "prepared_query" ) // AgentCheck represents a check known to the agent type AgentCheck struct { Node string CheckID string Name string Status string Notes string Output string ServiceID string ServiceName string Type string Definition HealthCheckDefinition Namespace string `json:",omitempty"` } // AgentWeights represent optional weights for a service type AgentWeights struct { Passing int Warning int } // AgentService represents a service known to the agent type AgentService struct { Kind ServiceKind `json:",omitempty"` ID string Service string Tags []string Meta map[string]string Port int Address string TaggedAddresses map[string]ServiceAddress `json:",omitempty"` Weights AgentWeights EnableTagOverride bool CreateIndex uint64 `json:",omitempty" bexpr:"-"` ModifyIndex uint64 `json:",omitempty" bexpr:"-"` ContentHash string `json:",omitempty" bexpr:"-"` Proxy *AgentServiceConnectProxyConfig `json:",omitempty"` Connect *AgentServiceConnect `json:",omitempty"` // NOTE: If we ever set the ContentHash outside of singular service lookup then we may need // to include the Namespace in the hash. When we do, then we are in for lots of fun with tests. // For now though, ignoring it works well enough. Namespace string `json:",omitempty" bexpr:"-" hash:"ignore"` } // AgentServiceChecksInfo returns information about a Service and its checks type AgentServiceChecksInfo struct { AggregatedStatus string Service *AgentService Checks HealthChecks } // AgentServiceConnect represents the Connect configuration of a service. type AgentServiceConnect struct { Native bool `json:",omitempty"` SidecarService *AgentServiceRegistration `json:",omitempty" bexpr:"-"` } // AgentServiceConnectProxyConfig is the proxy configuration in a connect-proxy // ServiceDefinition or response. type AgentServiceConnectProxyConfig struct { DestinationServiceName string `json:",omitempty"` DestinationServiceID string `json:",omitempty"` LocalServiceAddress string `json:",omitempty"` LocalServicePort int `json:",omitempty"` Config map[string]interface{} `json:",omitempty" bexpr:"-"` Upstreams []Upstream `json:",omitempty"` MeshGateway MeshGatewayConfig `json:",omitempty"` Expose ExposeConfig `json:",omitempty"` } // AgentMember represents a cluster member known to the agent type AgentMember struct { Name string Addr string Port uint16 Tags map[string]string Status int ProtocolMin uint8 ProtocolMax uint8 ProtocolCur uint8 DelegateMin uint8 DelegateMax uint8 DelegateCur uint8 } // AllSegments is used to select for all segments in MembersOpts. const AllSegments = "_all" // MembersOpts is used for querying member information. type MembersOpts struct { // WAN is whether to show members from the WAN. WAN bool // Segment is the LAN segment to show members for. Setting this to the // AllSegments value above will show members in all segments. Segment string } // AgentServiceRegistration is used to register a new service type AgentServiceRegistration struct { Kind ServiceKind `json:",omitempty"` ID string `json:",omitempty"` Name string `json:",omitempty"` Tags []string `json:",omitempty"` Port int `json:",omitempty"` Address string `json:",omitempty"` TaggedAddresses map[string]ServiceAddress `json:",omitempty"` EnableTagOverride bool `json:",omitempty"` Meta map[string]string `json:",omitempty"` Weights *AgentWeights `json:",omitempty"` Check *AgentServiceCheck Checks AgentServiceChecks Proxy *AgentServiceConnectProxyConfig `json:",omitempty"` Connect *AgentServiceConnect `json:",omitempty"` Namespace string `json:",omitempty" bexpr:"-" hash:"ignore"` } //ServiceRegisterOpts is used to pass extra options to the service register. type ServiceRegisterOpts struct { //Missing healthchecks will be deleted from the agent. //Using this parameter allows to idempotently register a service and its checks without //having to manually deregister checks. ReplaceExistingChecks bool } // AgentCheckRegistration is used to register a new check type AgentCheckRegistration struct { ID string `json:",omitempty"` Name string `json:",omitempty"` Notes string `json:",omitempty"` ServiceID string `json:",omitempty"` AgentServiceCheck Namespace string `json:",omitempty"` } // AgentServiceCheck is used to define a node or service level check type AgentServiceCheck struct { CheckID string `json:",omitempty"` Name string `json:",omitempty"` Args []string `json:"ScriptArgs,omitempty"` DockerContainerID string `json:",omitempty"` Shell string `json:",omitempty"` // Only supported for Docker. Interval string `json:",omitempty"` Timeout string `json:",omitempty"` TTL string `json:",omitempty"` HTTP string `json:",omitempty"` Header map[string][]string `json:",omitempty"` Method string `json:",omitempty"` Body string `json:",omitempty"` TCP string `json:",omitempty"` Status string `json:",omitempty"` Notes string `json:",omitempty"` TLSSkipVerify bool `json:",omitempty"` GRPC string `json:",omitempty"` GRPCUseTLS bool `json:",omitempty"` AliasNode string `json:",omitempty"` AliasService string `json:",omitempty"` // In Consul 0.7 and later, checks that are associated with a service // may also contain this optional DeregisterCriticalServiceAfter field, // which is a timeout in the same Go time format as Interval and TTL. If // a check is in the critical state for more than this configured value, // then its associated service (and all of its associated checks) will // automatically be deregistered. DeregisterCriticalServiceAfter string `json:",omitempty"` } type AgentServiceChecks []*AgentServiceCheck // AgentToken is used when updating ACL tokens for an agent. type AgentToken struct { Token string } // Metrics info is used to store different types of metric values from the agent. type MetricsInfo struct { Timestamp string Gauges []GaugeValue Points []PointValue Counters []SampledValue Samples []SampledValue } // GaugeValue stores one value that is updated as time goes on, such as // the amount of memory allocated. type GaugeValue struct { Name string Value float32 Labels map[string]string } // PointValue holds a series of points for a metric. type PointValue struct { Name string Points []float32 } // SampledValue stores info about a metric that is incremented over time, // such as the number of requests to an HTTP endpoint. type SampledValue struct { Name string Count int Sum float64 Min float64 Max float64 Mean float64 Stddev float64 Labels map[string]string } // AgentAuthorizeParams are the request parameters for authorizing a request. type AgentAuthorizeParams struct { Target string ClientCertURI string ClientCertSerial string } // AgentAuthorize is the response structure for Connect authorization. type AgentAuthorize struct { Authorized bool Reason string } // ConnectProxyConfig is the response structure for agent-local proxy // configuration. type ConnectProxyConfig struct { ProxyServiceID string TargetServiceID string TargetServiceName string ContentHash string Config map[string]interface{} `bexpr:"-"` Upstreams []Upstream } // Upstream is the response structure for a proxy upstream configuration. type Upstream struct { DestinationType UpstreamDestType `json:",omitempty"` DestinationNamespace string `json:",omitempty"` DestinationName string Datacenter string `json:",omitempty"` LocalBindAddress string `json:",omitempty"` LocalBindPort int `json:",omitempty"` Config map[string]interface{} `json:",omitempty" bexpr:"-"` MeshGateway MeshGatewayConfig `json:",omitempty"` } // Agent can be used to query the Agent endpoints type Agent struct { c *Client // cache the node name nodeName string } // Agent returns a handle to the agent endpoints func (c *Client) Agent() *Agent { return &Agent{c: c} } // Self is used to query the agent we are speaking to for // information about itself func (a *Agent) Self() (map[string]map[string]interface{}, error) { r := a.c.newRequest("GET", "/v1/agent/self") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out map[string]map[string]interface{} if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // Host is used to retrieve information about the host the // agent is running on such as CPU, memory, and disk. Requires // a operator:read ACL token. func (a *Agent) Host() (map[string]interface{}, error) { r := a.c.newRequest("GET", "/v1/agent/host") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out map[string]interface{} if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // Metrics is used to query the agent we are speaking to for // its current internal metric data func (a *Agent) Metrics() (*MetricsInfo, error) { r := a.c.newRequest("GET", "/v1/agent/metrics") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out *MetricsInfo if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // Reload triggers a configuration reload for the agent we are connected to. func (a *Agent) Reload() error { r := a.c.newRequest("PUT", "/v1/agent/reload") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // NodeName is used to get the node name of the agent func (a *Agent) NodeName() (string, error) { if a.nodeName != "" { return a.nodeName, nil } info, err := a.Self() if err != nil { return "", err } name := info["Config"]["NodeName"].(string) a.nodeName = name return name, nil } // Checks returns the locally registered checks func (a *Agent) Checks() (map[string]*AgentCheck, error) { return a.ChecksWithFilter("") } // ChecksWithFilter returns a subset of the locally registered checks that match // the given filter expression func (a *Agent) ChecksWithFilter(filter string) (map[string]*AgentCheck, error) { r := a.c.newRequest("GET", "/v1/agent/checks") r.filterQuery(filter) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out map[string]*AgentCheck if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // Services returns the locally registered services func (a *Agent) Services() (map[string]*AgentService, error) { return a.ServicesWithFilter("") } // ServicesWithFilter returns a subset of the locally registered services that match // the given filter expression func (a *Agent) ServicesWithFilter(filter string) (map[string]*AgentService, error) { r := a.c.newRequest("GET", "/v1/agent/services") r.filterQuery(filter) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out map[string]*AgentService if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // AgentHealthServiceByID returns for a given serviceID: the aggregated health status, the service definition or an error if any // - If the service is not found, will return status (critical, nil, nil) // - If the service is found, will return (critical|passing|warning), AgentServiceChecksInfo, nil) // - In all other cases, will return an error func (a *Agent) AgentHealthServiceByID(serviceID string) (string, *AgentServiceChecksInfo, error) { path := fmt.Sprintf("/v1/agent/health/service/id/%v", url.PathEscape(serviceID)) r := a.c.newRequest("GET", path) r.params.Add("format", "json") r.header.Set("Accept", "application/json") _, resp, err := a.c.doRequest(r) if err != nil { return "", nil, err } defer resp.Body.Close() // Service not Found if resp.StatusCode == http.StatusNotFound { return HealthCritical, nil, nil } var out *AgentServiceChecksInfo if err := decodeBody(resp, &out); err != nil { return HealthCritical, out, err } switch resp.StatusCode { case http.StatusOK: return HealthPassing, out, nil case http.StatusTooManyRequests: return HealthWarning, out, nil case http.StatusServiceUnavailable: return HealthCritical, out, nil } return HealthCritical, out, fmt.Errorf("Unexpected Error Code %v for %s", resp.StatusCode, path) } // AgentHealthServiceByName returns for a given service name: the aggregated health status for all services // having the specified name. // - If no service is not found, will return status (critical, [], nil) // - If the service is found, will return (critical|passing|warning), []api.AgentServiceChecksInfo, nil) // - In all other cases, will return an error func (a *Agent) AgentHealthServiceByName(service string) (string, []AgentServiceChecksInfo, error) { path := fmt.Sprintf("/v1/agent/health/service/name/%v", url.PathEscape(service)) r := a.c.newRequest("GET", path) r.params.Add("format", "json") r.header.Set("Accept", "application/json") _, resp, err := a.c.doRequest(r) if err != nil { return "", nil, err } defer resp.Body.Close() // Service not Found if resp.StatusCode == http.StatusNotFound { return HealthCritical, nil, nil } var out []AgentServiceChecksInfo if err := decodeBody(resp, &out); err != nil { return HealthCritical, out, err } switch resp.StatusCode { case http.StatusOK: return HealthPassing, out, nil case http.StatusTooManyRequests: return HealthWarning, out, nil case http.StatusServiceUnavailable: return HealthCritical, out, nil } return HealthCritical, out, fmt.Errorf("Unexpected Error Code %v for %s", resp.StatusCode, path) } // Service returns a locally registered service instance and allows for // hash-based blocking. // // Note that this uses an unconventional blocking mechanism since it's // agent-local state. That means there is no persistent raft index so we block // based on object hash instead. func (a *Agent) Service(serviceID string, q *QueryOptions) (*AgentService, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/agent/service/"+serviceID) r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out *AgentService if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // Members returns the known gossip members. The WAN // flag can be used to query a server for WAN members. func (a *Agent) Members(wan bool) ([]*AgentMember, error) { r := a.c.newRequest("GET", "/v1/agent/members") if wan { r.params.Set("wan", "1") } _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out []*AgentMember if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // MembersOpts returns the known gossip members and can be passed // additional options for WAN/segment filtering. func (a *Agent) MembersOpts(opts MembersOpts) ([]*AgentMember, error) { r := a.c.newRequest("GET", "/v1/agent/members") r.params.Set("segment", opts.Segment) if opts.WAN { r.params.Set("wan", "1") } _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out []*AgentMember if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // ServiceRegister is used to register a new service with // the local agent func (a *Agent) ServiceRegister(service *AgentServiceRegistration) error { opts := ServiceRegisterOpts{ ReplaceExistingChecks: false, } return a.serviceRegister(service, opts) } // ServiceRegister is used to register a new service with // the local agent and can be passed additional options. func (a *Agent) ServiceRegisterOpts(service *AgentServiceRegistration, opts ServiceRegisterOpts) error { return a.serviceRegister(service, opts) } func (a *Agent) serviceRegister(service *AgentServiceRegistration, opts ServiceRegisterOpts) error { r := a.c.newRequest("PUT", "/v1/agent/service/register") r.obj = service if opts.ReplaceExistingChecks { r.params.Set("replace-existing-checks", "true") } _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // ServiceDeregister is used to deregister a service with // the local agent func (a *Agent) ServiceDeregister(serviceID string) error { r := a.c.newRequest("PUT", "/v1/agent/service/deregister/"+serviceID) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // PassTTL is used to set a TTL check to the passing state. // // DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). // The client interface will be removed in 0.8 or changed to use // UpdateTTL()'s endpoint and the server endpoints will be removed in 0.9. func (a *Agent) PassTTL(checkID, note string) error { return a.updateTTL(checkID, note, "pass") } // WarnTTL is used to set a TTL check to the warning state. // // DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). // The client interface will be removed in 0.8 or changed to use // UpdateTTL()'s endpoint and the server endpoints will be removed in 0.9. func (a *Agent) WarnTTL(checkID, note string) error { return a.updateTTL(checkID, note, "warn") } // FailTTL is used to set a TTL check to the failing state. // // DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). // The client interface will be removed in 0.8 or changed to use // UpdateTTL()'s endpoint and the server endpoints will be removed in 0.9. func (a *Agent) FailTTL(checkID, note string) error { return a.updateTTL(checkID, note, "fail") } // updateTTL is used to update the TTL of a check. This is the internal // method that uses the old API that's present in Consul versions prior to // 0.6.4. Since Consul didn't have an analogous "update" API before it seemed // ok to break this (former) UpdateTTL in favor of the new UpdateTTL below, // but keep the old Pass/Warn/Fail methods using the old API under the hood. // // DEPRECATION NOTICE: This interface is deprecated in favor of UpdateTTL(). // The client interface will be removed in 0.8 and the server endpoints will // be removed in 0.9. func (a *Agent) updateTTL(checkID, note, status string) error { switch status { case "pass": case "warn": case "fail": default: return fmt.Errorf("Invalid status: %s", status) } endpoint := fmt.Sprintf("/v1/agent/check/%s/%s", status, checkID) r := a.c.newRequest("PUT", endpoint) r.params.Set("note", note) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // checkUpdate is the payload for a PUT for a check update. type checkUpdate struct { // Status is one of the api.Health* states: HealthPassing // ("passing"), HealthWarning ("warning"), or HealthCritical // ("critical"). Status string // Output is the information to post to the UI for operators as the // output of the process that decided to hit the TTL check. This is // different from the note field that's associated with the check // itself. Output string } // UpdateTTL is used to update the TTL of a check. This uses the newer API // that was introduced in Consul 0.6.4 and later. We translate the old status // strings for compatibility (though a newer version of Consul will still be // required to use this API). func (a *Agent) UpdateTTL(checkID, output, status string) error { switch status { case "pass", HealthPassing: status = HealthPassing case "warn", HealthWarning: status = HealthWarning case "fail", HealthCritical: status = HealthCritical default: return fmt.Errorf("Invalid status: %s", status) } endpoint := fmt.Sprintf("/v1/agent/check/update/%s", checkID) r := a.c.newRequest("PUT", endpoint) r.obj = &checkUpdate{ Status: status, Output: output, } _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // CheckRegister is used to register a new check with // the local agent func (a *Agent) CheckRegister(check *AgentCheckRegistration) error { r := a.c.newRequest("PUT", "/v1/agent/check/register") r.obj = check _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // CheckDeregister is used to deregister a check with // the local agent func (a *Agent) CheckDeregister(checkID string) error { r := a.c.newRequest("PUT", "/v1/agent/check/deregister/"+checkID) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // Join is used to instruct the agent to attempt a join to // another cluster member func (a *Agent) Join(addr string, wan bool) error { r := a.c.newRequest("PUT", "/v1/agent/join/"+addr) if wan { r.params.Set("wan", "1") } _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // Leave is used to have the agent gracefully leave the cluster and shutdown func (a *Agent) Leave() error { r := a.c.newRequest("PUT", "/v1/agent/leave") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // ForceLeave is used to have the agent eject a failed node func (a *Agent) ForceLeave(node string) error { r := a.c.newRequest("PUT", "/v1/agent/force-leave/"+node) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } //ForceLeavePrune is used to have an a failed agent removed //from the list of members func (a *Agent) ForceLeavePrune(node string) error { r := a.c.newRequest("PUT", "/v1/agent/force-leave/"+node) r.params.Set("prune", "1") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // ConnectAuthorize is used to authorize an incoming connection // to a natively integrated Connect service. func (a *Agent) ConnectAuthorize(auth *AgentAuthorizeParams) (*AgentAuthorize, error) { r := a.c.newRequest("POST", "/v1/agent/connect/authorize") r.obj = auth _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out AgentAuthorize if err := decodeBody(resp, &out); err != nil { return nil, err } return &out, nil } // ConnectCARoots returns the list of roots. func (a *Agent) ConnectCARoots(q *QueryOptions) (*CARootList, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/agent/connect/ca/roots") r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out CARootList if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // ConnectCALeaf gets the leaf certificate for the given service ID. func (a *Agent) ConnectCALeaf(serviceID string, q *QueryOptions) (*LeafCert, *QueryMeta, error) { r := a.c.newRequest("GET", "/v1/agent/connect/ca/leaf/"+serviceID) r.setQueryOptions(q) rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out LeafCert if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // EnableServiceMaintenance toggles service maintenance mode on // for the given service ID. func (a *Agent) EnableServiceMaintenance(serviceID, reason string) error { r := a.c.newRequest("PUT", "/v1/agent/service/maintenance/"+serviceID) r.params.Set("enable", "true") r.params.Set("reason", reason) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // DisableServiceMaintenance toggles service maintenance mode off // for the given service ID. func (a *Agent) DisableServiceMaintenance(serviceID string) error { r := a.c.newRequest("PUT", "/v1/agent/service/maintenance/"+serviceID) r.params.Set("enable", "false") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // EnableNodeMaintenance toggles node maintenance mode on for the // agent we are connected to. func (a *Agent) EnableNodeMaintenance(reason string) error { r := a.c.newRequest("PUT", "/v1/agent/maintenance") r.params.Set("enable", "true") r.params.Set("reason", reason) _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // DisableNodeMaintenance toggles node maintenance mode off for the // agent we are connected to. func (a *Agent) DisableNodeMaintenance() error { r := a.c.newRequest("PUT", "/v1/agent/maintenance") r.params.Set("enable", "false") _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // Monitor returns a channel which will receive streaming logs from the agent // Providing a non-nil stopCh can be used to close the connection and stop the // log stream. An empty string will be sent down the given channel when there's // nothing left to stream, after which the caller should close the stopCh. func (a *Agent) Monitor(loglevel string, stopCh <-chan struct{}, q *QueryOptions) (chan string, error) { return a.monitor(loglevel, false, stopCh, q) } // MonitorJSON is like Monitor except it returns logs in JSON format. func (a *Agent) MonitorJSON(loglevel string, stopCh <-chan struct{}, q *QueryOptions) (chan string, error) { return a.monitor(loglevel, true, stopCh, q) } func (a *Agent) monitor(loglevel string, logJSON bool, stopCh <-chan struct{}, q *QueryOptions) (chan string, error) { r := a.c.newRequest("GET", "/v1/agent/monitor") r.setQueryOptions(q) if loglevel != "" { r.params.Add("loglevel", loglevel) } if logJSON { r.params.Set("logjson", "true") } _, resp, err := requireOK(a.c.doRequest(r)) if err != nil { return nil, err } logCh := make(chan string, 64) go func() { defer resp.Body.Close() scanner := bufio.NewScanner(resp.Body) for { select { case <-stopCh: close(logCh) return default: } if scanner.Scan() { // An empty string signals to the caller that // the scan is done, so make sure we only emit // that when the scanner says it's done, not if // we happen to ingest an empty line. if text := scanner.Text(); text != "" { logCh <- text } else { logCh <- " " } } else { logCh <- "" } } }() return logCh, nil } // UpdateACLToken updates the agent's "acl_token". See updateToken for more // details. // // DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateDefaultACLToken for v1.4.3 and above func (a *Agent) UpdateACLToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_token", token, q) } // UpdateACLAgentToken updates the agent's "acl_agent_token". See updateToken // for more details. // // DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateAgentACLToken for v1.4.3 and above func (a *Agent) UpdateACLAgentToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_agent_token", token, q) } // UpdateACLAgentMasterToken updates the agent's "acl_agent_master_token". See // updateToken for more details. // // DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateAgentMasterACLToken for v1.4.3 and above func (a *Agent) UpdateACLAgentMasterToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_agent_master_token", token, q) } // UpdateACLReplicationToken updates the agent's "acl_replication_token". See // updateToken for more details. // // DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateReplicationACLToken for v1.4.3 and above func (a *Agent) UpdateACLReplicationToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_replication_token", token, q) } // UpdateDefaultACLToken updates the agent's "default" token. See updateToken // for more details func (a *Agent) UpdateDefaultACLToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateTokenFallback("default", "acl_token", token, q) } // UpdateAgentACLToken updates the agent's "agent" token. See updateToken // for more details func (a *Agent) UpdateAgentACLToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateTokenFallback("agent", "acl_agent_token", token, q) } // UpdateAgentMasterACLToken updates the agent's "agent_master" token. See updateToken // for more details func (a *Agent) UpdateAgentMasterACLToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateTokenFallback("agent_master", "acl_agent_master_token", token, q) } // UpdateReplicationACLToken updates the agent's "replication" token. See updateToken // for more details func (a *Agent) UpdateReplicationACLToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateTokenFallback("replication", "acl_replication_token", token, q) } // updateToken can be used to update one of an agent's ACL tokens after the agent has // started. The tokens are may not be persisted, so will need to be updated again if // the agent is restarted unless the agent is configured to persist them. func (a *Agent) updateToken(target, token string, q *WriteOptions) (*WriteMeta, error) { meta, _, err := a.updateTokenOnce(target, token, q) return meta, err } func (a *Agent) updateTokenFallback(target, fallback, token string, q *WriteOptions) (*WriteMeta, error) { meta, status, err := a.updateTokenOnce(target, token, q) if err != nil && status == 404 { meta, _, err = a.updateTokenOnce(fallback, token, q) } return meta, err } func (a *Agent) updateTokenOnce(target, token string, q *WriteOptions) (*WriteMeta, int, error) { r := a.c.newRequest("PUT", fmt.Sprintf("/v1/agent/token/%s", target)) r.setWriteOptions(q) r.obj = &AgentToken{Token: token} rtt, resp, err := a.c.doRequest(r) if err != nil { return nil, 0, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} if resp.StatusCode != 200 { var buf bytes.Buffer io.Copy(&buf, resp.Body) return wm, resp.StatusCode, fmt.Errorf("Unexpected response code: %d (%s)", resp.StatusCode, buf.Bytes()) } return wm, resp.StatusCode, nil } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/api.go��������������������������������������0000664�0000000�0000000�00000072605�13771713062�0024165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "context" "crypto/tls" "encoding/json" "fmt" "io" "io/ioutil" "net" "net/http" "net/url" "os" "strconv" "strings" "time" "github.com/hashicorp/go-cleanhttp" "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-rootcerts" ) const ( // HTTPAddrEnvName defines an environment variable name which sets // the HTTP address if there is no -http-addr specified. HTTPAddrEnvName = "CONSUL_HTTP_ADDR" // HTTPTokenEnvName defines an environment variable name which sets // the HTTP token. HTTPTokenEnvName = "CONSUL_HTTP_TOKEN" // HTTPTokenFileEnvName defines an environment variable name which sets // the HTTP token file. HTTPTokenFileEnvName = "CONSUL_HTTP_TOKEN_FILE" // HTTPAuthEnvName defines an environment variable name which sets // the HTTP authentication header. HTTPAuthEnvName = "CONSUL_HTTP_AUTH" // HTTPSSLEnvName defines an environment variable name which sets // whether or not to use HTTPS. HTTPSSLEnvName = "CONSUL_HTTP_SSL" // HTTPCAFile defines an environment variable name which sets the // CA file to use for talking to Consul over TLS. HTTPCAFile = "CONSUL_CACERT" // HTTPCAPath defines an environment variable name which sets the // path to a directory of CA certs to use for talking to Consul over TLS. HTTPCAPath = "CONSUL_CAPATH" // HTTPClientCert defines an environment variable name which sets the // client cert file to use for talking to Consul over TLS. HTTPClientCert = "CONSUL_CLIENT_CERT" // HTTPClientKey defines an environment variable name which sets the // client key file to use for talking to Consul over TLS. HTTPClientKey = "CONSUL_CLIENT_KEY" // HTTPTLSServerName defines an environment variable name which sets the // server name to use as the SNI host when connecting via TLS HTTPTLSServerName = "CONSUL_TLS_SERVER_NAME" // HTTPSSLVerifyEnvName defines an environment variable name which sets // whether or not to disable certificate checking. HTTPSSLVerifyEnvName = "CONSUL_HTTP_SSL_VERIFY" // GRPCAddrEnvName defines an environment variable name which sets the gRPC // address for consul connect envoy. Note this isn't actually used by the api // client in this package but is defined here for consistency with all the // other ENV names we use. GRPCAddrEnvName = "CONSUL_GRPC_ADDR" // HTTPNamespaceEnvVar defines an environment variable name which sets // the HTTP Namespace to be used by default. This can still be overridden. HTTPNamespaceEnvName = "CONSUL_NAMESPACE" ) // QueryOptions are used to parameterize a query type QueryOptions struct { // Namespace overrides the `default` namespace // Note: Namespaces are available only in Consul Enterprise Namespace string // Providing a datacenter overwrites the DC provided // by the Config Datacenter string // AllowStale allows any Consul server (non-leader) to service // a read. This allows for lower latency and higher throughput AllowStale bool // RequireConsistent forces the read to be fully consistent. // This is more expensive but prevents ever performing a stale // read. RequireConsistent bool // UseCache requests that the agent cache results locally. See // https://www.consul.io/api/features/caching.html for more details on the // semantics. UseCache bool // MaxAge limits how old a cached value will be returned if UseCache is true. // If there is a cached response that is older than the MaxAge, it is treated // as a cache miss and a new fetch invoked. If the fetch fails, the error is // returned. Clients that wish to allow for stale results on error can set // StaleIfError to a longer duration to change this behavior. It is ignored // if the endpoint supports background refresh caching. See // https://www.consul.io/api/features/caching.html for more details. MaxAge time.Duration // StaleIfError specifies how stale the client will accept a cached response // if the servers are unavailable to fetch a fresh one. Only makes sense when // UseCache is true and MaxAge is set to a lower, non-zero value. It is // ignored if the endpoint supports background refresh caching. See // https://www.consul.io/api/features/caching.html for more details. StaleIfError time.Duration // WaitIndex is used to enable a blocking query. Waits // until the timeout or the next index is reached WaitIndex uint64 // WaitHash is used by some endpoints instead of WaitIndex to perform blocking // on state based on a hash of the response rather than a monotonic index. // This is required when the state being blocked on is not stored in Raft, for // example agent-local proxy configuration. WaitHash string // WaitTime is used to bound the duration of a wait. // Defaults to that of the Config, but can be overridden. WaitTime time.Duration // Token is used to provide a per-request ACL token // which overrides the agent's default token. Token string // Near is used to provide a node name that will sort the results // in ascending order based on the estimated round trip time from // that node. Setting this to "_agent" will use the agent's node // for the sort. Near string // NodeMeta is used to filter results by nodes with the given // metadata key/value pairs. Currently, only one key/value pair can // be provided for filtering. NodeMeta map[string]string // RelayFactor is used in keyring operations to cause responses to be // relayed back to the sender through N other random nodes. Must be // a value from 0 to 5 (inclusive). RelayFactor uint8 // LocalOnly is used in keyring list operation to force the keyring // query to only hit local servers (no WAN traffic). LocalOnly bool // Connect filters prepared query execution to only include Connect-capable // services. This currently affects prepared query execution. Connect bool // ctx is an optional context pass through to the underlying HTTP // request layer. Use Context() and WithContext() to manage this. ctx context.Context // Filter requests filtering data prior to it being returned. The string // is a go-bexpr compatible expression. Filter string } func (o *QueryOptions) Context() context.Context { if o != nil && o.ctx != nil { return o.ctx } return context.Background() } func (o *QueryOptions) WithContext(ctx context.Context) *QueryOptions { o2 := new(QueryOptions) if o != nil { *o2 = *o } o2.ctx = ctx return o2 } // WriteOptions are used to parameterize a write type WriteOptions struct { // Namespace overrides the `default` namespace // Note: Namespaces are available only in Consul Enterprise Namespace string // Providing a datacenter overwrites the DC provided // by the Config Datacenter string // Token is used to provide a per-request ACL token // which overrides the agent's default token. Token string // RelayFactor is used in keyring operations to cause responses to be // relayed back to the sender through N other random nodes. Must be // a value from 0 to 5 (inclusive). RelayFactor uint8 // ctx is an optional context pass through to the underlying HTTP // request layer. Use Context() and WithContext() to manage this. ctx context.Context } func (o *WriteOptions) Context() context.Context { if o != nil && o.ctx != nil { return o.ctx } return context.Background() } func (o *WriteOptions) WithContext(ctx context.Context) *WriteOptions { o2 := new(WriteOptions) if o != nil { *o2 = *o } o2.ctx = ctx return o2 } // QueryMeta is used to return meta data about a query type QueryMeta struct { // LastIndex. This can be used as a WaitIndex to perform // a blocking query LastIndex uint64 // LastContentHash. This can be used as a WaitHash to perform a blocking query // for endpoints that support hash-based blocking. Endpoints that do not // support it will return an empty hash. LastContentHash string // Time of last contact from the leader for the // server servicing the request LastContact time.Duration // Is there a known leader KnownLeader bool // How long did the request take RequestTime time.Duration // Is address translation enabled for HTTP responses on this agent AddressTranslationEnabled bool // CacheHit is true if the result was served from agent-local cache. CacheHit bool // CacheAge is set if request was ?cached and indicates how stale the cached // response is. CacheAge time.Duration } // WriteMeta is used to return meta data about a write type WriteMeta struct { // How long did the request take RequestTime time.Duration } // HttpBasicAuth is used to authenticate http client with HTTP Basic Authentication type HttpBasicAuth struct { // Username to use for HTTP Basic Authentication Username string // Password to use for HTTP Basic Authentication Password string } // Config is used to configure the creation of a client type Config struct { // Address is the address of the Consul server Address string // Scheme is the URI scheme for the Consul server Scheme string // Datacenter to use. If not provided, the default agent datacenter is used. Datacenter string // Transport is the Transport to use for the http client. Transport *http.Transport // HttpClient is the client to use. Default will be // used if not provided. HttpClient *http.Client // HttpAuth is the auth info to use for http access. HttpAuth *HttpBasicAuth // WaitTime limits how long a Watch will block. If not provided, // the agent default values will be used. WaitTime time.Duration // Token is used to provide a per-request ACL token // which overrides the agent's default token. Token string // TokenFile is a file containing the current token to use for this client. // If provided it is read once at startup and never again. TokenFile string // Namespace is the name of the namespace to send along for the request // when no other Namespace ispresent in the QueryOptions Namespace string TLSConfig TLSConfig } // TLSConfig is used to generate a TLSClientConfig that's useful for talking to // Consul using TLS. type TLSConfig struct { // Address is the optional address of the Consul server. The port, if any // will be removed from here and this will be set to the ServerName of the // resulting config. Address string // CAFile is the optional path to the CA certificate used for Consul // communication, defaults to the system bundle if not specified. CAFile string // CAPath is the optional path to a directory of CA certificates to use for // Consul communication, defaults to the system bundle if not specified. CAPath string // CAPem is the optional PEM-encoded CA certificate used for Consul // communication, defaults to the system bundle if not specified. CAPem []byte // CertFile is the optional path to the certificate for Consul // communication. If this is set then you need to also set KeyFile. CertFile string // CertPEM is the optional PEM-encoded certificate for Consul // communication. If this is set then you need to also set KeyPEM. CertPEM []byte // KeyFile is the optional path to the private key for Consul communication. // If this is set then you need to also set CertFile. KeyFile string // KeyPEM is the optional PEM-encoded private key for Consul communication. // If this is set then you need to also set CertPEM. KeyPEM []byte // InsecureSkipVerify if set to true will disable TLS host verification. InsecureSkipVerify bool } // DefaultConfig returns a default configuration for the client. By default this // will pool and reuse idle connections to Consul. If you have a long-lived // client object, this is the desired behavior and should make the most efficient // use of the connections to Consul. If you don't reuse a client object, which // is not recommended, then you may notice idle connections building up over // time. To avoid this, use the DefaultNonPooledConfig() instead. func DefaultConfig() *Config { return defaultConfig(nil, cleanhttp.DefaultPooledTransport) } // DefaultConfigWithLogger returns a default configuration for the client. It // is exactly the same as DefaultConfig, but allows for a pre-configured logger // object to be passed through. func DefaultConfigWithLogger(logger hclog.Logger) *Config { return defaultConfig(logger, cleanhttp.DefaultPooledTransport) } // DefaultNonPooledConfig returns a default configuration for the client which // does not pool connections. This isn't a recommended configuration because it // will reconnect to Consul on every request, but this is useful to avoid the // accumulation of idle connections if you make many client objects during the // lifetime of your application. func DefaultNonPooledConfig() *Config { return defaultConfig(nil, cleanhttp.DefaultTransport) } // defaultConfig returns the default configuration for the client, using the // given function to make the transport. func defaultConfig(logger hclog.Logger, transportFn func() *http.Transport) *Config { if logger == nil { logger = hclog.New(&hclog.LoggerOptions{ Name: "consul-api", }) } config := &Config{ Address: "127.0.0.1:8500", Scheme: "http", Transport: transportFn(), } if addr := os.Getenv(HTTPAddrEnvName); addr != "" { config.Address = addr } if tokenFile := os.Getenv(HTTPTokenFileEnvName); tokenFile != "" { config.TokenFile = tokenFile } if token := os.Getenv(HTTPTokenEnvName); token != "" { config.Token = token } if auth := os.Getenv(HTTPAuthEnvName); auth != "" { var username, password string if strings.Contains(auth, ":") { split := strings.SplitN(auth, ":", 2) username = split[0] password = split[1] } else { username = auth } config.HttpAuth = &HttpBasicAuth{ Username: username, Password: password, } } if ssl := os.Getenv(HTTPSSLEnvName); ssl != "" { enabled, err := strconv.ParseBool(ssl) if err != nil { logger.Warn(fmt.Sprintf("could not parse %s", HTTPSSLEnvName), "error", err) } if enabled { config.Scheme = "https" } } if v := os.Getenv(HTTPTLSServerName); v != "" { config.TLSConfig.Address = v } if v := os.Getenv(HTTPCAFile); v != "" { config.TLSConfig.CAFile = v } if v := os.Getenv(HTTPCAPath); v != "" { config.TLSConfig.CAPath = v } if v := os.Getenv(HTTPClientCert); v != "" { config.TLSConfig.CertFile = v } if v := os.Getenv(HTTPClientKey); v != "" { config.TLSConfig.KeyFile = v } if v := os.Getenv(HTTPSSLVerifyEnvName); v != "" { doVerify, err := strconv.ParseBool(v) if err != nil { logger.Warn(fmt.Sprintf("could not parse %s", HTTPSSLVerifyEnvName), "error", err) } if !doVerify { config.TLSConfig.InsecureSkipVerify = true } } if v := os.Getenv(HTTPNamespaceEnvName); v != "" { config.Namespace = v } return config } // TLSConfig is used to generate a TLSClientConfig that's useful for talking to // Consul using TLS. func SetupTLSConfig(tlsConfig *TLSConfig) (*tls.Config, error) { tlsClientConfig := &tls.Config{ InsecureSkipVerify: tlsConfig.InsecureSkipVerify, } if tlsConfig.Address != "" { server := tlsConfig.Address hasPort := strings.LastIndex(server, ":") > strings.LastIndex(server, "]") if hasPort { var err error server, _, err = net.SplitHostPort(server) if err != nil { return nil, err } } tlsClientConfig.ServerName = server } if len(tlsConfig.CertPEM) != 0 && len(tlsConfig.KeyPEM) != 0 { tlsCert, err := tls.X509KeyPair(tlsConfig.CertPEM, tlsConfig.KeyPEM) if err != nil { return nil, err } tlsClientConfig.Certificates = []tls.Certificate{tlsCert} } else if len(tlsConfig.CertPEM) != 0 || len(tlsConfig.KeyPEM) != 0 { return nil, fmt.Errorf("both client cert and client key must be provided") } if tlsConfig.CertFile != "" && tlsConfig.KeyFile != "" { tlsCert, err := tls.LoadX509KeyPair(tlsConfig.CertFile, tlsConfig.KeyFile) if err != nil { return nil, err } tlsClientConfig.Certificates = []tls.Certificate{tlsCert} } else if tlsConfig.CertFile != "" || tlsConfig.KeyFile != "" { return nil, fmt.Errorf("both client cert and client key must be provided") } if tlsConfig.CAFile != "" || tlsConfig.CAPath != "" || len(tlsConfig.CAPem) != 0 { rootConfig := &rootcerts.Config{ CAFile: tlsConfig.CAFile, CAPath: tlsConfig.CAPath, CACertificate: tlsConfig.CAPem, } if err := rootcerts.ConfigureTLS(tlsClientConfig, rootConfig); err != nil { return nil, err } } return tlsClientConfig, nil } func (c *Config) GenerateEnv() []string { env := make([]string, 0, 10) env = append(env, fmt.Sprintf("%s=%s", HTTPAddrEnvName, c.Address), fmt.Sprintf("%s=%s", HTTPTokenEnvName, c.Token), fmt.Sprintf("%s=%s", HTTPTokenFileEnvName, c.TokenFile), fmt.Sprintf("%s=%t", HTTPSSLEnvName, c.Scheme == "https"), fmt.Sprintf("%s=%s", HTTPCAFile, c.TLSConfig.CAFile), fmt.Sprintf("%s=%s", HTTPCAPath, c.TLSConfig.CAPath), fmt.Sprintf("%s=%s", HTTPClientCert, c.TLSConfig.CertFile), fmt.Sprintf("%s=%s", HTTPClientKey, c.TLSConfig.KeyFile), fmt.Sprintf("%s=%s", HTTPTLSServerName, c.TLSConfig.Address), fmt.Sprintf("%s=%t", HTTPSSLVerifyEnvName, !c.TLSConfig.InsecureSkipVerify)) if c.HttpAuth != nil { env = append(env, fmt.Sprintf("%s=%s:%s", HTTPAuthEnvName, c.HttpAuth.Username, c.HttpAuth.Password)) } else { env = append(env, fmt.Sprintf("%s=", HTTPAuthEnvName)) } return env } // Client provides a client to the Consul API type Client struct { config Config } // NewClient returns a new client func NewClient(config *Config) (*Client, error) { // bootstrap the config defConfig := DefaultConfig() if len(config.Address) == 0 { config.Address = defConfig.Address } if len(config.Scheme) == 0 { config.Scheme = defConfig.Scheme } if config.Transport == nil { config.Transport = defConfig.Transport } if config.TLSConfig.Address == "" { config.TLSConfig.Address = defConfig.TLSConfig.Address } if config.TLSConfig.CAFile == "" { config.TLSConfig.CAFile = defConfig.TLSConfig.CAFile } if config.TLSConfig.CAPath == "" { config.TLSConfig.CAPath = defConfig.TLSConfig.CAPath } if config.TLSConfig.CertFile == "" { config.TLSConfig.CertFile = defConfig.TLSConfig.CertFile } if config.TLSConfig.KeyFile == "" { config.TLSConfig.KeyFile = defConfig.TLSConfig.KeyFile } if !config.TLSConfig.InsecureSkipVerify { config.TLSConfig.InsecureSkipVerify = defConfig.TLSConfig.InsecureSkipVerify } if config.HttpClient == nil { var err error config.HttpClient, err = NewHttpClient(config.Transport, config.TLSConfig) if err != nil { return nil, err } } parts := strings.SplitN(config.Address, "://", 2) if len(parts) == 2 { switch parts[0] { case "http": config.Scheme = "http" case "https": config.Scheme = "https" case "unix": trans := cleanhttp.DefaultTransport() trans.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) { return net.Dial("unix", parts[1]) } config.HttpClient = &http.Client{ Transport: trans, } default: return nil, fmt.Errorf("Unknown protocol scheme: %s", parts[0]) } config.Address = parts[1] } // If the TokenFile is set, always use that, even if a Token is configured. // This is because when TokenFile is set it is read into the Token field. // We want any derived clients to have to re-read the token file. if config.TokenFile != "" { data, err := ioutil.ReadFile(config.TokenFile) if err != nil { return nil, fmt.Errorf("Error loading token file: %s", err) } if token := strings.TrimSpace(string(data)); token != "" { config.Token = token } } if config.Token == "" { config.Token = defConfig.Token } return &Client{config: *config}, nil } // NewHttpClient returns an http client configured with the given Transport and TLS // config. func NewHttpClient(transport *http.Transport, tlsConf TLSConfig) (*http.Client, error) { client := &http.Client{ Transport: transport, } // TODO (slackpad) - Once we get some run time on the HTTP/2 support we // should turn it on by default if TLS is enabled. We would basically // just need to call http2.ConfigureTransport(transport) here. We also // don't want to introduce another external dependency on // golang.org/x/net/http2 at this time. For a complete recipe for how // to enable HTTP/2 support on a transport suitable for the API client // library see agent/http_test.go:TestHTTPServer_H2. if transport.TLSClientConfig == nil { tlsClientConfig, err := SetupTLSConfig(&tlsConf) if err != nil { return nil, err } transport.TLSClientConfig = tlsClientConfig } return client, nil } // request is used to help build up a request type request struct { config *Config method string url *url.URL params url.Values body io.Reader header http.Header obj interface{} ctx context.Context } // setQueryOptions is used to annotate the request with // additional query options func (r *request) setQueryOptions(q *QueryOptions) { if q == nil { return } if q.Namespace != "" { r.params.Set("ns", q.Namespace) } if q.Datacenter != "" { r.params.Set("dc", q.Datacenter) } if q.AllowStale { r.params.Set("stale", "") } if q.RequireConsistent { r.params.Set("consistent", "") } if q.WaitIndex != 0 { r.params.Set("index", strconv.FormatUint(q.WaitIndex, 10)) } if q.WaitTime != 0 { r.params.Set("wait", durToMsec(q.WaitTime)) } if q.WaitHash != "" { r.params.Set("hash", q.WaitHash) } if q.Token != "" { r.header.Set("X-Consul-Token", q.Token) } if q.Near != "" { r.params.Set("near", q.Near) } if q.Filter != "" { r.params.Set("filter", q.Filter) } if len(q.NodeMeta) > 0 { for key, value := range q.NodeMeta { r.params.Add("node-meta", key+":"+value) } } if q.RelayFactor != 0 { r.params.Set("relay-factor", strconv.Itoa(int(q.RelayFactor))) } if q.LocalOnly { r.params.Set("local-only", fmt.Sprintf("%t", q.LocalOnly)) } if q.Connect { r.params.Set("connect", "true") } if q.UseCache && !q.RequireConsistent { r.params.Set("cached", "") cc := []string{} if q.MaxAge > 0 { cc = append(cc, fmt.Sprintf("max-age=%.0f", q.MaxAge.Seconds())) } if q.StaleIfError > 0 { cc = append(cc, fmt.Sprintf("stale-if-error=%.0f", q.StaleIfError.Seconds())) } if len(cc) > 0 { r.header.Set("Cache-Control", strings.Join(cc, ", ")) } } r.ctx = q.ctx } // durToMsec converts a duration to a millisecond specified string. If the // user selected a positive value that rounds to 0 ms, then we will use 1 ms // so they get a short delay, otherwise Consul will translate the 0 ms into // a huge default delay. func durToMsec(dur time.Duration) string { ms := dur / time.Millisecond if dur > 0 && ms == 0 { ms = 1 } return fmt.Sprintf("%dms", ms) } // serverError is a string we look for to detect 500 errors. const serverError = "Unexpected response code: 500" // IsRetryableError returns true for 500 errors from the Consul servers, and // network connection errors. These are usually retryable at a later time. // This applies to reads but NOT to writes. This may return true for errors // on writes that may have still gone through, so do not use this to retry // any write operations. func IsRetryableError(err error) bool { if err == nil { return false } if _, ok := err.(net.Error); ok { return true } // TODO (slackpad) - Make a real error type here instead of using // a string check. return strings.Contains(err.Error(), serverError) } // setWriteOptions is used to annotate the request with // additional write options func (r *request) setWriteOptions(q *WriteOptions) { if q == nil { return } if q.Namespace != "" { r.params.Set("ns", q.Namespace) } if q.Datacenter != "" { r.params.Set("dc", q.Datacenter) } if q.Token != "" { r.header.Set("X-Consul-Token", q.Token) } if q.RelayFactor != 0 { r.params.Set("relay-factor", strconv.Itoa(int(q.RelayFactor))) } r.ctx = q.ctx } // toHTTP converts the request to an HTTP request func (r *request) toHTTP() (*http.Request, error) { // Encode the query parameters r.url.RawQuery = r.params.Encode() // Check if we should encode the body if r.body == nil && r.obj != nil { b, err := encodeBody(r.obj) if err != nil { return nil, err } r.body = b } // Create the HTTP request req, err := http.NewRequest(r.method, r.url.RequestURI(), r.body) if err != nil { return nil, err } req.URL.Host = r.url.Host req.URL.Scheme = r.url.Scheme req.Host = r.url.Host req.Header = r.header // Setup auth if r.config.HttpAuth != nil { req.SetBasicAuth(r.config.HttpAuth.Username, r.config.HttpAuth.Password) } if r.ctx != nil { return req.WithContext(r.ctx), nil } return req, nil } // newRequest is used to create a new request func (c *Client) newRequest(method, path string) *request { r := &request{ config: &c.config, method: method, url: &url.URL{ Scheme: c.config.Scheme, Host: c.config.Address, Path: path, }, params: make(map[string][]string), header: make(http.Header), } if c.config.Datacenter != "" { r.params.Set("dc", c.config.Datacenter) } if c.config.Namespace != "" { r.params.Set("ns", c.config.Namespace) } if c.config.WaitTime != 0 { r.params.Set("wait", durToMsec(r.config.WaitTime)) } if c.config.Token != "" { r.header.Set("X-Consul-Token", r.config.Token) } return r } // doRequest runs a request with our client func (c *Client) doRequest(r *request) (time.Duration, *http.Response, error) { req, err := r.toHTTP() if err != nil { return 0, nil, err } start := time.Now() resp, err := c.config.HttpClient.Do(req) diff := time.Since(start) return diff, resp, err } // Query is used to do a GET request against an endpoint // and deserialize the response into an interface using // standard Consul conventions. func (c *Client) query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) { r := c.newRequest("GET", endpoint) r.setQueryOptions(q) rtt, resp, err := c.doRequest(r) if err != nil { return nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if err := decodeBody(resp, out); err != nil { return nil, err } return qm, nil } // write is used to do a PUT request against an endpoint // and serialize/deserialized using the standard Consul conventions. func (c *Client) write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) { r := c.newRequest("PUT", endpoint) r.setWriteOptions(q) r.obj = in rtt, resp, err := requireOK(c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} if out != nil { if err := decodeBody(resp, &out); err != nil { return nil, err } } else if _, err := ioutil.ReadAll(resp.Body); err != nil { return nil, err } return wm, nil } // parseQueryMeta is used to help parse query meta-data // // TODO(rb): bug? the error from this function is never handled func parseQueryMeta(resp *http.Response, q *QueryMeta) error { header := resp.Header // Parse the X-Consul-Index (if it's set - hash based blocking queries don't // set this) if indexStr := header.Get("X-Consul-Index"); indexStr != "" { index, err := strconv.ParseUint(indexStr, 10, 64) if err != nil { return fmt.Errorf("Failed to parse X-Consul-Index: %v", err) } q.LastIndex = index } q.LastContentHash = header.Get("X-Consul-ContentHash") // Parse the X-Consul-LastContact last, err := strconv.ParseUint(header.Get("X-Consul-LastContact"), 10, 64) if err != nil { return fmt.Errorf("Failed to parse X-Consul-LastContact: %v", err) } q.LastContact = time.Duration(last) * time.Millisecond // Parse the X-Consul-KnownLeader switch header.Get("X-Consul-KnownLeader") { case "true": q.KnownLeader = true default: q.KnownLeader = false } // Parse X-Consul-Translate-Addresses switch header.Get("X-Consul-Translate-Addresses") { case "true": q.AddressTranslationEnabled = true default: q.AddressTranslationEnabled = false } // Parse Cache info if cacheStr := header.Get("X-Cache"); cacheStr != "" { q.CacheHit = strings.EqualFold(cacheStr, "HIT") } if ageStr := header.Get("Age"); ageStr != "" { age, err := strconv.ParseUint(ageStr, 10, 64) if err != nil { return fmt.Errorf("Failed to parse Age Header: %v", err) } q.CacheAge = time.Duration(age) * time.Second } return nil } // decodeBody is used to JSON decode a body func decodeBody(resp *http.Response, out interface{}) error { dec := json.NewDecoder(resp.Body) return dec.Decode(out) } // encodeBody is used to encode a request body func encodeBody(obj interface{}) (io.Reader, error) { buf := bytes.NewBuffer(nil) enc := json.NewEncoder(buf) if err := enc.Encode(obj); err != nil { return nil, err } return buf, nil } // requireOK is used to wrap doRequest and check for a 200 func requireOK(d time.Duration, resp *http.Response, e error) (time.Duration, *http.Response, error) { if e != nil { if resp != nil { resp.Body.Close() } return d, nil, e } if resp.StatusCode != 200 { return d, nil, generateUnexpectedResponseCodeError(resp) } return d, resp, nil } func (req *request) filterQuery(filter string) { if filter == "" { return } req.params.Set("filter", filter) } // generateUnexpectedResponseCodeError consumes the rest of the body, closes // the body stream and generates an error indicating the status code was // unexpected. func generateUnexpectedResponseCodeError(resp *http.Response) error { var buf bytes.Buffer io.Copy(&buf, resp.Body) resp.Body.Close() return fmt.Errorf("Unexpected response code: %d (%s)", resp.StatusCode, buf.Bytes()) } func requireNotFoundOrOK(d time.Duration, resp *http.Response, e error) (bool, time.Duration, *http.Response, error) { if e != nil { if resp != nil { resp.Body.Close() } return false, d, nil, e } switch resp.StatusCode { case 200: return true, d, resp, nil case 404: return false, d, resp, nil default: return false, d, nil, generateUnexpectedResponseCodeError(resp) } } ���������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/catalog.go����������������������������������0000664�0000000�0000000�00000016465�13771713062�0025030�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "net" "strconv" ) type Weights struct { Passing int Warning int } type Node struct { ID string Node string Address string Datacenter string TaggedAddresses map[string]string Meta map[string]string CreateIndex uint64 ModifyIndex uint64 } type ServiceAddress struct { Address string Port int } type CatalogService struct { ID string Node string Address string Datacenter string TaggedAddresses map[string]string NodeMeta map[string]string ServiceID string ServiceName string ServiceAddress string ServiceTaggedAddresses map[string]ServiceAddress ServiceTags []string ServiceMeta map[string]string ServicePort int ServiceWeights Weights ServiceEnableTagOverride bool ServiceProxy *AgentServiceConnectProxyConfig CreateIndex uint64 Checks HealthChecks ModifyIndex uint64 Namespace string `json:",omitempty"` } type CatalogNode struct { Node *Node Services map[string]*AgentService } type CatalogNodeServiceList struct { Node *Node Services []*AgentService } type CatalogRegistration struct { ID string Node string Address string TaggedAddresses map[string]string NodeMeta map[string]string Datacenter string Service *AgentService Check *AgentCheck Checks HealthChecks SkipNodeUpdate bool } type CatalogDeregistration struct { Node string Address string `json:",omitempty"` // Obsolete. Datacenter string ServiceID string CheckID string Namespace string `json:",omitempty"` } // Catalog can be used to query the Catalog endpoints type Catalog struct { c *Client } // Catalog returns a handle to the catalog endpoints func (c *Client) Catalog() *Catalog { return &Catalog{c} } func (c *Catalog) Register(reg *CatalogRegistration, q *WriteOptions) (*WriteMeta, error) { r := c.c.newRequest("PUT", "/v1/catalog/register") r.setWriteOptions(q) r.obj = reg rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt return wm, nil } func (c *Catalog) Deregister(dereg *CatalogDeregistration, q *WriteOptions) (*WriteMeta, error) { r := c.c.newRequest("PUT", "/v1/catalog/deregister") r.setWriteOptions(q) r.obj = dereg rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt return wm, nil } // Datacenters is used to query for all the known datacenters func (c *Catalog) Datacenters() ([]string, error) { r := c.c.newRequest("GET", "/v1/catalog/datacenters") _, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out []string if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // Nodes is used to query all the known nodes func (c *Catalog) Nodes(q *QueryOptions) ([]*Node, *QueryMeta, error) { r := c.c.newRequest("GET", "/v1/catalog/nodes") r.setQueryOptions(q) rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out []*Node if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // Services is used to query for all known services func (c *Catalog) Services(q *QueryOptions) (map[string][]string, *QueryMeta, error) { r := c.c.newRequest("GET", "/v1/catalog/services") r.setQueryOptions(q) rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out map[string][]string if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // Service is used to query catalog entries for a given service func (c *Catalog) Service(service, tag string, q *QueryOptions) ([]*CatalogService, *QueryMeta, error) { var tags []string if tag != "" { tags = []string{tag} } return c.service(service, tags, q, false) } // Supports multiple tags for filtering func (c *Catalog) ServiceMultipleTags(service string, tags []string, q *QueryOptions) ([]*CatalogService, *QueryMeta, error) { return c.service(service, tags, q, false) } // Connect is used to query catalog entries for a given Connect-enabled service func (c *Catalog) Connect(service, tag string, q *QueryOptions) ([]*CatalogService, *QueryMeta, error) { var tags []string if tag != "" { tags = []string{tag} } return c.service(service, tags, q, true) } // Supports multiple tags for filtering func (c *Catalog) ConnectMultipleTags(service string, tags []string, q *QueryOptions) ([]*CatalogService, *QueryMeta, error) { return c.service(service, tags, q, true) } func (c *Catalog) service(service string, tags []string, q *QueryOptions, connect bool) ([]*CatalogService, *QueryMeta, error) { path := "/v1/catalog/service/" + service if connect { path = "/v1/catalog/connect/" + service } r := c.c.newRequest("GET", path) r.setQueryOptions(q) if len(tags) > 0 { for _, tag := range tags { r.params.Add("tag", tag) } } rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out []*CatalogService if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // Node is used to query for service information about a single node func (c *Catalog) Node(node string, q *QueryOptions) (*CatalogNode, *QueryMeta, error) { r := c.c.newRequest("GET", "/v1/catalog/node/"+node) r.setQueryOptions(q) rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out *CatalogNode if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // NodeServiceList is used to query for service information about a single node. It differs from // the Node function only in its return type which will contain a list of services as opposed to // a map of service ids to services. This different structure allows for using the wildcard specifier // '*' for the Namespace in the QueryOptions. func (c *Catalog) NodeServiceList(node string, q *QueryOptions) (*CatalogNodeServiceList, *QueryMeta, error) { r := c.c.newRequest("GET", "/v1/catalog/node-services/"+node) r.setQueryOptions(q) rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out *CatalogNodeServiceList if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } func ParseServiceAddr(addrPort string) (ServiceAddress, error) { port := 0 host, portStr, err := net.SplitHostPort(addrPort) if err == nil { port, err = strconv.Atoi(portStr) } return ServiceAddress{Address: host, Port: port}, err } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/config_entry.go�����������������������������0000664�0000000�0000000�00000022456�13771713062�0026101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "encoding/json" "fmt" "io" "strconv" "strings" "github.com/mitchellh/mapstructure" ) const ( ServiceDefaults string = "service-defaults" ProxyDefaults string = "proxy-defaults" ServiceRouter string = "service-router" ServiceSplitter string = "service-splitter" ServiceResolver string = "service-resolver" ProxyConfigGlobal string = "global" ) type ConfigEntry interface { GetKind() string GetName() string GetCreateIndex() uint64 GetModifyIndex() uint64 } type MeshGatewayMode string const ( // MeshGatewayModeDefault represents no specific mode and should // be used to indicate that a different layer of the configuration // chain should take precedence MeshGatewayModeDefault MeshGatewayMode = "" // MeshGatewayModeNone represents that the Upstream Connect connections // should be direct and not flow through a mesh gateway. MeshGatewayModeNone MeshGatewayMode = "none" // MeshGatewayModeLocal represents that the Upstrea Connect connections // should be made to a mesh gateway in the local datacenter. This is MeshGatewayModeLocal MeshGatewayMode = "local" // MeshGatewayModeRemote represents that the Upstream Connect connections // should be made to a mesh gateway in a remote datacenter. MeshGatewayModeRemote MeshGatewayMode = "remote" ) // MeshGatewayConfig controls how Mesh Gateways are used for upstream Connect // services type MeshGatewayConfig struct { // Mode is the mode that should be used for the upstream connection. Mode MeshGatewayMode `json:",omitempty"` } // ExposeConfig describes HTTP paths to expose through Envoy outside of Connect. // Users can expose individual paths and/or all HTTP/GRPC paths for checks. type ExposeConfig struct { // Checks defines whether paths associated with Consul checks will be exposed. // This flag triggers exposing all HTTP and GRPC check paths registered for the service. Checks bool `json:",omitempty"` // Paths is the list of paths exposed through the proxy. Paths []ExposePath `json:",omitempty"` } type ExposePath struct { // ListenerPort defines the port of the proxy's listener for exposed paths. ListenerPort int `json:",omitempty"` // Path is the path to expose through the proxy, ie. "/metrics." Path string `json:",omitempty"` // LocalPathPort is the port that the service is listening on for the given path. LocalPathPort int `json:",omitempty"` // Protocol describes the upstream's service protocol. // Valid values are "http" and "http2", defaults to "http" Protocol string `json:",omitempty"` // ParsedFromCheck is set if this path was parsed from a registered check ParsedFromCheck bool } type ServiceConfigEntry struct { Kind string Name string Namespace string `json:",omitempty"` Protocol string `json:",omitempty"` MeshGateway MeshGatewayConfig `json:",omitempty"` Expose ExposeConfig `json:",omitempty"` ExternalSNI string `json:",omitempty"` CreateIndex uint64 ModifyIndex uint64 } func (s *ServiceConfigEntry) GetKind() string { return s.Kind } func (s *ServiceConfigEntry) GetName() string { return s.Name } func (s *ServiceConfigEntry) GetCreateIndex() uint64 { return s.CreateIndex } func (s *ServiceConfigEntry) GetModifyIndex() uint64 { return s.ModifyIndex } type ProxyConfigEntry struct { Kind string Name string Namespace string `json:",omitempty"` Config map[string]interface{} `json:",omitempty"` MeshGateway MeshGatewayConfig `json:",omitempty"` Expose ExposeConfig `json:",omitempty"` CreateIndex uint64 ModifyIndex uint64 } func (p *ProxyConfigEntry) GetKind() string { return p.Kind } func (p *ProxyConfigEntry) GetName() string { return p.Name } func (p *ProxyConfigEntry) GetCreateIndex() uint64 { return p.CreateIndex } func (p *ProxyConfigEntry) GetModifyIndex() uint64 { return p.ModifyIndex } type rawEntryListResponse struct { kind string Entries []map[string]interface{} } func makeConfigEntry(kind, name string) (ConfigEntry, error) { switch kind { case ServiceDefaults: return &ServiceConfigEntry{Kind: kind, Name: name}, nil case ProxyDefaults: return &ProxyConfigEntry{Kind: kind, Name: name}, nil case ServiceRouter: return &ServiceRouterConfigEntry{Kind: kind, Name: name}, nil case ServiceSplitter: return &ServiceSplitterConfigEntry{Kind: kind, Name: name}, nil case ServiceResolver: return &ServiceResolverConfigEntry{Kind: kind, Name: name}, nil default: return nil, fmt.Errorf("invalid config entry kind: %s", kind) } } func MakeConfigEntry(kind, name string) (ConfigEntry, error) { return makeConfigEntry(kind, name) } // DecodeConfigEntry will decode the result of using json.Unmarshal of a config // entry into a map[string]interface{}. // // Important caveats: // // - This will NOT work if the map[string]interface{} was produced using HCL // decoding as that requires more extensive parsing to work around the issues // with map[string][]interface{} that arise. // // - This will only decode fields using their camel case json field // representations. func DecodeConfigEntry(raw map[string]interface{}) (ConfigEntry, error) { var entry ConfigEntry kindVal, ok := raw["Kind"] if !ok { kindVal, ok = raw["kind"] } if !ok { return nil, fmt.Errorf("Payload does not contain a kind/Kind key at the top level") } if kindStr, ok := kindVal.(string); ok { newEntry, err := makeConfigEntry(kindStr, "") if err != nil { return nil, err } entry = newEntry } else { return nil, fmt.Errorf("Kind value in payload is not a string") } decodeConf := &mapstructure.DecoderConfig{ DecodeHook: mapstructure.StringToTimeDurationHookFunc(), Result: &entry, WeaklyTypedInput: true, } decoder, err := mapstructure.NewDecoder(decodeConf) if err != nil { return nil, err } return entry, decoder.Decode(raw) } func DecodeConfigEntryFromJSON(data []byte) (ConfigEntry, error) { var raw map[string]interface{} if err := json.Unmarshal(data, &raw); err != nil { return nil, err } return DecodeConfigEntry(raw) } func decodeConfigEntrySlice(raw []map[string]interface{}) ([]ConfigEntry, error) { var entries []ConfigEntry for _, rawEntry := range raw { entry, err := DecodeConfigEntry(rawEntry) if err != nil { return nil, err } entries = append(entries, entry) } return entries, nil } // ConfigEntries can be used to query the Config endpoints type ConfigEntries struct { c *Client } // Config returns a handle to the Config endpoints func (c *Client) ConfigEntries() *ConfigEntries { return &ConfigEntries{c} } func (conf *ConfigEntries) Get(kind string, name string, q *QueryOptions) (ConfigEntry, *QueryMeta, error) { if kind == "" || name == "" { return nil, nil, fmt.Errorf("Both kind and name parameters must not be empty") } entry, err := makeConfigEntry(kind, name) if err != nil { return nil, nil, err } r := conf.c.newRequest("GET", fmt.Sprintf("/v1/config/%s/%s", kind, name)) r.setQueryOptions(q) rtt, resp, err := requireOK(conf.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if err := decodeBody(resp, entry); err != nil { return nil, nil, err } return entry, qm, nil } func (conf *ConfigEntries) List(kind string, q *QueryOptions) ([]ConfigEntry, *QueryMeta, error) { if kind == "" { return nil, nil, fmt.Errorf("The kind parameter must not be empty") } r := conf.c.newRequest("GET", fmt.Sprintf("/v1/config/%s", kind)) r.setQueryOptions(q) rtt, resp, err := requireOK(conf.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var raw []map[string]interface{} if err := decodeBody(resp, &raw); err != nil { return nil, nil, err } entries, err := decodeConfigEntrySlice(raw) if err != nil { return nil, nil, err } return entries, qm, nil } func (conf *ConfigEntries) Set(entry ConfigEntry, w *WriteOptions) (bool, *WriteMeta, error) { return conf.set(entry, nil, w) } func (conf *ConfigEntries) CAS(entry ConfigEntry, index uint64, w *WriteOptions) (bool, *WriteMeta, error) { return conf.set(entry, map[string]string{"cas": strconv.FormatUint(index, 10)}, w) } func (conf *ConfigEntries) set(entry ConfigEntry, params map[string]string, w *WriteOptions) (bool, *WriteMeta, error) { r := conf.c.newRequest("PUT", "/v1/config") r.setWriteOptions(w) for param, value := range params { r.params.Set(param, value) } r.obj = entry rtt, resp, err := requireOK(conf.c.doRequest(r)) if err != nil { return false, nil, err } defer resp.Body.Close() var buf bytes.Buffer if _, err := io.Copy(&buf, resp.Body); err != nil { return false, nil, fmt.Errorf("Failed to read response: %v", err) } res := strings.Contains(buf.String(), "true") wm := &WriteMeta{RequestTime: rtt} return res, wm, nil } func (conf *ConfigEntries) Delete(kind string, name string, w *WriteOptions) (*WriteMeta, error) { if kind == "" || name == "" { return nil, fmt.Errorf("Both kind and name parameters must not be empty") } r := conf.c.newRequest("DELETE", fmt.Sprintf("/v1/config/%s/%s", kind, name)) r.setWriteOptions(w) rtt, resp, err := requireOK(conf.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/config_entry_discoverychain.go��������������0000664�0000000�0000000�00000013213�13771713062�0031162�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "encoding/json" "time" ) type ServiceRouterConfigEntry struct { Kind string Name string Namespace string `json:",omitempty"` Routes []ServiceRoute `json:",omitempty"` CreateIndex uint64 ModifyIndex uint64 } func (e *ServiceRouterConfigEntry) GetKind() string { return e.Kind } func (e *ServiceRouterConfigEntry) GetName() string { return e.Name } func (e *ServiceRouterConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex } func (e *ServiceRouterConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex } type ServiceRoute struct { Match *ServiceRouteMatch `json:",omitempty"` Destination *ServiceRouteDestination `json:",omitempty"` } type ServiceRouteMatch struct { HTTP *ServiceRouteHTTPMatch `json:",omitempty"` } type ServiceRouteHTTPMatch struct { PathExact string `json:",omitempty"` PathPrefix string `json:",omitempty"` PathRegex string `json:",omitempty"` Header []ServiceRouteHTTPMatchHeader `json:",omitempty"` QueryParam []ServiceRouteHTTPMatchQueryParam `json:",omitempty"` Methods []string `json:",omitempty"` } type ServiceRouteHTTPMatchHeader struct { Name string Present bool `json:",omitempty"` Exact string `json:",omitempty"` Prefix string `json:",omitempty"` Suffix string `json:",omitempty"` Regex string `json:",omitempty"` Invert bool `json:",omitempty"` } type ServiceRouteHTTPMatchQueryParam struct { Name string Present bool `json:",omitempty"` Exact string `json:",omitempty"` Regex string `json:",omitempty"` } type ServiceRouteDestination struct { Service string `json:",omitempty"` ServiceSubset string `json:",omitempty"` Namespace string `json:",omitempty"` PrefixRewrite string `json:",omitempty"` RequestTimeout time.Duration `json:",omitempty"` NumRetries uint32 `json:",omitempty"` RetryOnConnectFailure bool `json:",omitempty"` RetryOnStatusCodes []uint32 `json:",omitempty"` } func (e *ServiceRouteDestination) MarshalJSON() ([]byte, error) { type Alias ServiceRouteDestination exported := &struct { RequestTimeout string `json:",omitempty"` *Alias }{ RequestTimeout: e.RequestTimeout.String(), Alias: (*Alias)(e), } if e.RequestTimeout == 0 { exported.RequestTimeout = "" } return json.Marshal(exported) } func (e *ServiceRouteDestination) UnmarshalJSON(data []byte) error { type Alias ServiceRouteDestination aux := &struct { RequestTimeout string *Alias }{ Alias: (*Alias)(e), } if err := json.Unmarshal(data, &aux); err != nil { return err } var err error if aux.RequestTimeout != "" { if e.RequestTimeout, err = time.ParseDuration(aux.RequestTimeout); err != nil { return err } } return nil } type ServiceSplitterConfigEntry struct { Kind string Name string Namespace string `json:",omitempty"` Splits []ServiceSplit `json:",omitempty"` CreateIndex uint64 ModifyIndex uint64 } func (e *ServiceSplitterConfigEntry) GetKind() string { return e.Kind } func (e *ServiceSplitterConfigEntry) GetName() string { return e.Name } func (e *ServiceSplitterConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex } func (e *ServiceSplitterConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex } type ServiceSplit struct { Weight float32 Service string `json:",omitempty"` ServiceSubset string `json:",omitempty"` Namespace string `json:",omitempty"` } type ServiceResolverConfigEntry struct { Kind string Name string Namespace string `json:",omitempty"` DefaultSubset string `json:",omitempty"` Subsets map[string]ServiceResolverSubset `json:",omitempty"` Redirect *ServiceResolverRedirect `json:",omitempty"` Failover map[string]ServiceResolverFailover `json:",omitempty"` ConnectTimeout time.Duration `json:",omitempty"` CreateIndex uint64 ModifyIndex uint64 } func (e *ServiceResolverConfigEntry) MarshalJSON() ([]byte, error) { type Alias ServiceResolverConfigEntry exported := &struct { ConnectTimeout string `json:",omitempty"` *Alias }{ ConnectTimeout: e.ConnectTimeout.String(), Alias: (*Alias)(e), } if e.ConnectTimeout == 0 { exported.ConnectTimeout = "" } return json.Marshal(exported) } func (e *ServiceResolverConfigEntry) UnmarshalJSON(data []byte) error { type Alias ServiceResolverConfigEntry aux := &struct { ConnectTimeout string *Alias }{ Alias: (*Alias)(e), } if err := json.Unmarshal(data, &aux); err != nil { return err } var err error if aux.ConnectTimeout != "" { if e.ConnectTimeout, err = time.ParseDuration(aux.ConnectTimeout); err != nil { return err } } return nil } func (e *ServiceResolverConfigEntry) GetKind() string { return e.Kind } func (e *ServiceResolverConfigEntry) GetName() string { return e.Name } func (e *ServiceResolverConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex } func (e *ServiceResolverConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex } type ServiceResolverSubset struct { Filter string `json:",omitempty"` OnlyPassing bool `json:",omitempty"` } type ServiceResolverRedirect struct { Service string `json:",omitempty"` ServiceSubset string `json:",omitempty"` Namespace string `json:",omitempty"` Datacenter string `json:",omitempty"` } type ServiceResolverFailover struct { Service string `json:",omitempty"` ServiceSubset string `json:",omitempty"` Namespace string `json:",omitempty"` Datacenters []string `json:",omitempty"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/connect.go����������������������������������0000664�0000000�0000000�00000000453�13771713062�0025035�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // Connect can be used to work with endpoints related to Connect, the // feature for securely connecting services within Consul. type Connect struct { c *Client } // Connect returns a handle to the connect-related endpoints func (c *Client) Connect() *Connect { return &Connect{c} } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/connect_ca.go�������������������������������0000664�0000000�0000000�00000011550�13771713062�0025500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "fmt" "time" "github.com/mitchellh/mapstructure" ) // CAConfig is the structure for the Connect CA configuration. type CAConfig struct { // Provider is the CA provider implementation to use. Provider string // Configuration is arbitrary configuration for the provider. This // should only contain primitive values and containers (such as lists // and maps). Config map[string]interface{} // State is read-only data that the provider might have persisted for use // after restart or leadership transition. For example this might include // UUIDs of resources it has created. Setting this when writing a // configuration is an error. State map[string]string CreateIndex uint64 ModifyIndex uint64 } // CommonCAProviderConfig is the common options available to all CA providers. type CommonCAProviderConfig struct { LeafCertTTL time.Duration SkipValidate bool CSRMaxPerSecond float32 CSRMaxConcurrent int } // ConsulCAProviderConfig is the config for the built-in Consul CA provider. type ConsulCAProviderConfig struct { CommonCAProviderConfig `mapstructure:",squash"` PrivateKey string RootCert string RotationPeriod time.Duration IntermediateCertTTL time.Duration } // ParseConsulCAConfig takes a raw config map and returns a parsed // ConsulCAProviderConfig. func ParseConsulCAConfig(raw map[string]interface{}) (*ConsulCAProviderConfig, error) { var config ConsulCAProviderConfig decodeConf := &mapstructure.DecoderConfig{ DecodeHook: mapstructure.StringToTimeDurationHookFunc(), Result: &config, WeaklyTypedInput: true, } decoder, err := mapstructure.NewDecoder(decodeConf) if err != nil { return nil, err } if err := decoder.Decode(raw); err != nil { return nil, fmt.Errorf("error decoding config: %s", err) } return &config, nil } // CARootList is the structure for the results of listing roots. type CARootList struct { ActiveRootID string TrustDomain string Roots []*CARoot } // CARoot represents a root CA certificate that is trusted. type CARoot struct { // ID is a globally unique ID (UUID) representing this CA root. ID string // Name is a human-friendly name for this CA root. This value is // opaque to Consul and is not used for anything internally. Name string // RootCertPEM is the PEM-encoded public certificate. RootCertPEM string `json:"RootCert"` // Active is true if this is the current active CA. This must only // be true for exactly one CA. For any method that modifies roots in the // state store, tests should be written to verify that multiple roots // cannot be active. Active bool CreateIndex uint64 ModifyIndex uint64 } // LeafCert is a certificate that has been issued by a Connect CA. type LeafCert struct { // SerialNumber is the unique serial number for this certificate. // This is encoded in standard hex separated by :. SerialNumber string // CertPEM and PrivateKeyPEM are the PEM-encoded certificate and private // key for that cert, respectively. This should not be stored in the // state store, but is present in the sign API response. CertPEM string `json:",omitempty"` PrivateKeyPEM string `json:",omitempty"` // Service is the name of the service for which the cert was issued. // ServiceURI is the cert URI value. Service string ServiceURI string // ValidAfter and ValidBefore are the validity periods for the // certificate. ValidAfter time.Time ValidBefore time.Time CreateIndex uint64 ModifyIndex uint64 } // CARoots queries the list of available roots. func (h *Connect) CARoots(q *QueryOptions) (*CARootList, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/connect/ca/roots") r.setQueryOptions(q) rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out CARootList if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // CAGetConfig returns the current CA configuration. func (h *Connect) CAGetConfig(q *QueryOptions) (*CAConfig, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/connect/ca/configuration") r.setQueryOptions(q) rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out CAConfig if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // CASetConfig sets the current CA configuration. func (h *Connect) CASetConfig(conf *CAConfig, q *WriteOptions) (*WriteMeta, error) { r := h.c.newRequest("PUT", "/v1/connect/ca/configuration") r.setWriteOptions(q) r.obj = conf rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt return wm, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/connect_intention.go������������������������0000664�0000000�0000000�00000021746�13771713062�0027134�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "fmt" "io" "time" ) // Intention defines an intention for the Connect Service Graph. This defines // the allowed or denied behavior of a connection between two services using // Connect. type Intention struct { // ID is the UUID-based ID for the intention, always generated by Consul. ID string // Description is a human-friendly description of this intention. // It is opaque to Consul and is only stored and transferred in API // requests. Description string // SourceNS, SourceName are the namespace and name, respectively, of // the source service. Either of these may be the wildcard "*", but only // the full value can be a wildcard. Partial wildcards are not allowed. // The source may also be a non-Consul service, as specified by SourceType. // // DestinationNS, DestinationName is the same, but for the destination // service. The same rules apply. The destination is always a Consul // service. SourceNS, SourceName string DestinationNS, DestinationName string // SourceType is the type of the value for the source. SourceType IntentionSourceType // Action is whether this is a whitelist or blacklist intention. Action IntentionAction // DefaultAddr, DefaultPort of the local listening proxy (if any) to // make this connection. DefaultAddr string DefaultPort int // Meta is arbitrary metadata associated with the intention. This is // opaque to Consul but is served in API responses. Meta map[string]string // Precedence is the order that the intention will be applied, with // larger numbers being applied first. This is a read-only field, on // any intention update it is updated. Precedence int // CreatedAt and UpdatedAt keep track of when this record was created // or modified. CreatedAt, UpdatedAt time.Time // Hash of the contents of the intention // // This is needed mainly for replication purposes. When replicating from // one DC to another keeping the content Hash will allow us to detect // content changes more efficiently than checking every single field Hash []byte CreateIndex uint64 ModifyIndex uint64 } // String returns human-friendly output describing ths intention. func (i *Intention) String() string { return fmt.Sprintf("%s => %s (%s)", i.SourceString(), i.DestinationString(), i.Action) } // SourceString returns the namespace/name format for the source, or // just "name" if the namespace is the default namespace. func (i *Intention) SourceString() string { return i.partString(i.SourceNS, i.SourceName) } // DestinationString returns the namespace/name format for the source, or // just "name" if the namespace is the default namespace. func (i *Intention) DestinationString() string { return i.partString(i.DestinationNS, i.DestinationName) } func (i *Intention) partString(ns, n string) string { // For now we omit the default namespace from the output. In the future // we might want to look at this and show this in a multi-namespace world. if ns != "" && ns != IntentionDefaultNamespace { n = ns + "/" + n } return n } // IntentionDefaultNamespace is the default namespace value. const IntentionDefaultNamespace = "default" // IntentionAction is the action that the intention represents. This // can be "allow" or "deny" to whitelist or blacklist intentions. type IntentionAction string const ( IntentionActionAllow IntentionAction = "allow" IntentionActionDeny IntentionAction = "deny" ) // IntentionSourceType is the type of the source within an intention. type IntentionSourceType string const ( // IntentionSourceConsul is a service within the Consul catalog. IntentionSourceConsul IntentionSourceType = "consul" ) // IntentionMatch are the arguments for the intention match API. type IntentionMatch struct { By IntentionMatchType Names []string } // IntentionMatchType is the target for a match request. For example, // matching by source will look for all intentions that match the given // source value. type IntentionMatchType string const ( IntentionMatchSource IntentionMatchType = "source" IntentionMatchDestination IntentionMatchType = "destination" ) // IntentionCheck are the arguments for the intention check API. For // more documentation see the IntentionCheck function. type IntentionCheck struct { // Source and Destination are the source and destination values to // check. The destination is always a Consul service, but the source // may be other values as defined by the SourceType. Source, Destination string // SourceType is the type of the value for the source. SourceType IntentionSourceType } // Intentions returns the list of intentions. func (h *Connect) Intentions(q *QueryOptions) ([]*Intention, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/connect/intentions") r.setQueryOptions(q) rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out []*Intention if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // IntentionGet retrieves a single intention. func (h *Connect) IntentionGet(id string, q *QueryOptions) (*Intention, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/connect/intentions/"+id) r.setQueryOptions(q) rtt, resp, err := h.c.doRequest(r) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if resp.StatusCode == 404 { return nil, qm, nil } else if resp.StatusCode != 200 { var buf bytes.Buffer io.Copy(&buf, resp.Body) return nil, nil, fmt.Errorf( "Unexpected response %d: %s", resp.StatusCode, buf.String()) } var out Intention if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } // IntentionDelete deletes a single intention. func (h *Connect) IntentionDelete(id string, q *WriteOptions) (*WriteMeta, error) { r := h.c.newRequest("DELETE", "/v1/connect/intentions/"+id) r.setWriteOptions(q) rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() qm := &WriteMeta{} qm.RequestTime = rtt return qm, nil } // IntentionMatch returns the list of intentions that match a given source // or destination. The returned intentions are ordered by precedence where // result[0] is the highest precedence (if that matches, then that rule overrides // all other rules). // // Matching can be done for multiple names at the same time. The resulting // map is keyed by the given names. Casing is preserved. func (h *Connect) IntentionMatch(args *IntentionMatch, q *QueryOptions) (map[string][]*Intention, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/connect/intentions/match") r.setQueryOptions(q) r.params.Set("by", string(args.By)) for _, name := range args.Names { r.params.Add("name", name) } rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out map[string][]*Intention if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // IntentionCheck returns whether a given source/destination would be allowed // or not given the current set of intentions and the configuration of Consul. func (h *Connect) IntentionCheck(args *IntentionCheck, q *QueryOptions) (bool, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/connect/intentions/check") r.setQueryOptions(q) r.params.Set("source", args.Source) r.params.Set("destination", args.Destination) if args.SourceType != "" { r.params.Set("source-type", string(args.SourceType)) } rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return false, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out struct{ Allowed bool } if err := decodeBody(resp, &out); err != nil { return false, nil, err } return out.Allowed, qm, nil } // IntentionCreate will create a new intention. The ID in the given // structure must be empty and a generate ID will be returned on // success. func (c *Connect) IntentionCreate(ixn *Intention, q *WriteOptions) (string, *WriteMeta, error) { r := c.c.newRequest("POST", "/v1/connect/intentions") r.setWriteOptions(q) r.obj = ixn rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return "", nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt var out struct{ ID string } if err := decodeBody(resp, &out); err != nil { return "", nil, err } return out.ID, wm, nil } // IntentionUpdate will update an existing intention. The ID in the given // structure must be non-empty. func (c *Connect) IntentionUpdate(ixn *Intention, q *WriteOptions) (*WriteMeta, error) { r := c.c.newRequest("PUT", "/v1/connect/intentions/"+ixn.ID) r.setWriteOptions(q) r.obj = ixn rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt return wm, nil } ��������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/coordinate.go�������������������������������0000664�0000000�0000000�00000005227�13771713062�0025537�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "github.com/hashicorp/serf/coordinate" ) // CoordinateEntry represents a node and its associated network coordinate. type CoordinateEntry struct { Node string Segment string Coord *coordinate.Coordinate } // CoordinateDatacenterMap has the coordinates for servers in a given datacenter // and area. Network coordinates are only compatible within the same area. type CoordinateDatacenterMap struct { Datacenter string AreaID string Coordinates []CoordinateEntry } // Coordinate can be used to query the coordinate endpoints type Coordinate struct { c *Client } // Coordinate returns a handle to the coordinate endpoints func (c *Client) Coordinate() *Coordinate { return &Coordinate{c} } // Datacenters is used to return the coordinates of all the servers in the WAN // pool. func (c *Coordinate) Datacenters() ([]*CoordinateDatacenterMap, error) { r := c.c.newRequest("GET", "/v1/coordinate/datacenters") _, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out []*CoordinateDatacenterMap if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // Nodes is used to return the coordinates of all the nodes in the LAN pool. func (c *Coordinate) Nodes(q *QueryOptions) ([]*CoordinateEntry, *QueryMeta, error) { r := c.c.newRequest("GET", "/v1/coordinate/nodes") r.setQueryOptions(q) rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out []*CoordinateEntry if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // Update inserts or updates the LAN coordinate of a node. func (c *Coordinate) Update(coord *CoordinateEntry, q *WriteOptions) (*WriteMeta, error) { r := c.c.newRequest("PUT", "/v1/coordinate/update") r.setWriteOptions(q) r.obj = coord rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt return wm, nil } // Node is used to return the coordinates of a single node in the LAN pool. func (c *Coordinate) Node(node string, q *QueryOptions) ([]*CoordinateEntry, *QueryMeta, error) { r := c.c.newRequest("GET", "/v1/coordinate/node/"+node) r.setQueryOptions(q) rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out []*CoordinateEntry if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/debug.go������������������������������������0000664�0000000�0000000�00000005334�13771713062�0024475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "fmt" "io/ioutil" "strconv" ) // Debug can be used to query the /debug/pprof endpoints to gather // profiling information about the target agent.Debug // // The agent must have enable_debug set to true for profiling to be enabled // and for these endpoints to function. type Debug struct { c *Client } // Debug returns a handle that exposes the internal debug endpoints. func (c *Client) Debug() *Debug { return &Debug{c} } // Heap returns a pprof heap dump func (d *Debug) Heap() ([]byte, error) { r := d.c.newRequest("GET", "/debug/pprof/heap") _, resp, err := d.c.doRequest(r) if err != nil { return nil, fmt.Errorf("error making request: %s", err) } defer resp.Body.Close() // We return a raw response because we're just passing through a response // from the pprof handlers body, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("error decoding body: %s", err) } return body, nil } // Profile returns a pprof CPU profile for the specified number of seconds func (d *Debug) Profile(seconds int) ([]byte, error) { r := d.c.newRequest("GET", "/debug/pprof/profile") // Capture a profile for the specified number of seconds r.params.Set("seconds", strconv.Itoa(seconds)) _, resp, err := d.c.doRequest(r) if err != nil { return nil, fmt.Errorf("error making request: %s", err) } defer resp.Body.Close() // We return a raw response because we're just passing through a response // from the pprof handlers body, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("error decoding body: %s", err) } return body, nil } // Trace returns an execution trace func (d *Debug) Trace(seconds int) ([]byte, error) { r := d.c.newRequest("GET", "/debug/pprof/trace") // Capture a trace for the specified number of seconds r.params.Set("seconds", strconv.Itoa(seconds)) _, resp, err := d.c.doRequest(r) if err != nil { return nil, fmt.Errorf("error making request: %s", err) } defer resp.Body.Close() // We return a raw response because we're just passing through a response // from the pprof handlers body, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("error decoding body: %s", err) } return body, nil } // Goroutine returns a pprof goroutine profile func (d *Debug) Goroutine() ([]byte, error) { r := d.c.newRequest("GET", "/debug/pprof/goroutine") _, resp, err := d.c.doRequest(r) if err != nil { return nil, fmt.Errorf("error making request: %s", err) } defer resp.Body.Close() // We return a raw response because we're just passing through a response // from the pprof handlers body, err := ioutil.ReadAll(resp.Body) if err != nil { return nil, fmt.Errorf("error decoding body: %s", err) } return body, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/discovery_chain.go��������������������������0000664�0000000�0000000�00000013132�13771713062�0026553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "encoding/json" "fmt" "time" ) // DiscoveryChain can be used to query the discovery-chain endpoints type DiscoveryChain struct { c *Client } // DiscoveryChain returns a handle to the discovery-chain endpoints func (c *Client) DiscoveryChain() *DiscoveryChain { return &DiscoveryChain{c} } func (d *DiscoveryChain) Get(name string, opts *DiscoveryChainOptions, q *QueryOptions) (*DiscoveryChainResponse, *QueryMeta, error) { if name == "" { return nil, nil, fmt.Errorf("Name parameter must not be empty") } method := "GET" if opts != nil && opts.requiresPOST() { method = "POST" } r := d.c.newRequest(method, fmt.Sprintf("/v1/discovery-chain/%s", name)) r.setQueryOptions(q) if opts != nil { if opts.EvaluateInDatacenter != "" { r.params.Set("compile-dc", opts.EvaluateInDatacenter) } } if method == "POST" { r.obj = opts } rtt, resp, err := requireOK(d.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out DiscoveryChainResponse if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } type DiscoveryChainOptions struct { EvaluateInDatacenter string `json:"-"` // OverrideMeshGateway allows for the mesh gateway setting to be overridden // for any resolver in the compiled chain. OverrideMeshGateway MeshGatewayConfig `json:",omitempty"` // OverrideProtocol allows for the final protocol for the chain to be // altered. // // - If the chain ordinarily would be TCP and an L7 protocol is passed here // the chain will not include Routers or Splitters. // // - If the chain ordinarily would be L7 and TCP is passed here the chain // will not include Routers or Splitters. OverrideProtocol string `json:",omitempty"` // OverrideConnectTimeout allows for the ConnectTimeout setting to be // overridden for any resolver in the compiled chain. OverrideConnectTimeout time.Duration `json:",omitempty"` } func (o *DiscoveryChainOptions) requiresPOST() bool { if o == nil { return false } return o.OverrideMeshGateway.Mode != "" || o.OverrideProtocol != "" || o.OverrideConnectTimeout != 0 } type DiscoveryChainResponse struct { Chain *CompiledDiscoveryChain } type CompiledDiscoveryChain struct { ServiceName string Namespace string Datacenter string // CustomizationHash is a unique hash of any data that affects the // compilation of the discovery chain other than config entries or the // name/namespace/datacenter evaluation criteria. // // If set, this value should be used to prefix/suffix any generated load // balancer data plane objects to avoid sharing customized and // non-customized versions. CustomizationHash string // Protocol is the overall protocol shared by everything in the chain. Protocol string // StartNode is the first key into the Nodes map that should be followed // when walking the discovery chain. StartNode string // Nodes contains all nodes available for traversal in the chain keyed by a // unique name. You can walk this by starting with StartNode. // // NOTE: The names should be treated as opaque values and are only // guaranteed to be consistent within a single compilation. Nodes map[string]*DiscoveryGraphNode // Targets is a list of all targets used in this chain. // // NOTE: The names should be treated as opaque values and are only // guaranteed to be consistent within a single compilation. Targets map[string]*DiscoveryTarget } const ( DiscoveryGraphNodeTypeRouter = "router" DiscoveryGraphNodeTypeSplitter = "splitter" DiscoveryGraphNodeTypeResolver = "resolver" ) // DiscoveryGraphNode is a single node in the compiled discovery chain. type DiscoveryGraphNode struct { Type string Name string // this is NOT necessarily a service // fields for Type==router Routes []*DiscoveryRoute // fields for Type==splitter Splits []*DiscoverySplit // fields for Type==resolver Resolver *DiscoveryResolver } // compiled form of ServiceRoute type DiscoveryRoute struct { Definition *ServiceRoute NextNode string } // compiled form of ServiceSplit type DiscoverySplit struct { Weight float32 NextNode string } // compiled form of ServiceResolverConfigEntry type DiscoveryResolver struct { Default bool ConnectTimeout time.Duration Target string Failover *DiscoveryFailover } func (r *DiscoveryResolver) MarshalJSON() ([]byte, error) { type Alias DiscoveryResolver exported := &struct { ConnectTimeout string `json:",omitempty"` *Alias }{ ConnectTimeout: r.ConnectTimeout.String(), Alias: (*Alias)(r), } if r.ConnectTimeout == 0 { exported.ConnectTimeout = "" } return json.Marshal(exported) } func (r *DiscoveryResolver) UnmarshalJSON(data []byte) error { type Alias DiscoveryResolver aux := &struct { ConnectTimeout string *Alias }{ Alias: (*Alias)(r), } if err := json.Unmarshal(data, &aux); err != nil { return err } var err error if aux.ConnectTimeout != "" { if r.ConnectTimeout, err = time.ParseDuration(aux.ConnectTimeout); err != nil { return err } } return nil } // compiled form of ServiceResolverFailover type DiscoveryFailover struct { Targets []string } // DiscoveryTarget represents all of the inputs necessary to use a resolver // config entry to execute a catalog query to generate a list of service // instances during discovery. type DiscoveryTarget struct { ID string Service string ServiceSubset string Namespace string Datacenter string MeshGateway MeshGatewayConfig Subset ServiceResolverSubset External bool SNI string Name string } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/event.go������������������������������������0000664�0000000�0000000�00000005166�13771713062�0024533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "strconv" ) // Event can be used to query the Event endpoints type Event struct { c *Client } // UserEvent represents an event that was fired by the user type UserEvent struct { ID string Name string Payload []byte NodeFilter string ServiceFilter string TagFilter string Version int LTime uint64 } // Event returns a handle to the event endpoints func (c *Client) Event() *Event { return &Event{c} } // Fire is used to fire a new user event. Only the Name, Payload and Filters // are respected. This returns the ID or an associated error. Cross DC requests // are supported. func (e *Event) Fire(params *UserEvent, q *WriteOptions) (string, *WriteMeta, error) { r := e.c.newRequest("PUT", "/v1/event/fire/"+params.Name) r.setWriteOptions(q) if params.NodeFilter != "" { r.params.Set("node", params.NodeFilter) } if params.ServiceFilter != "" { r.params.Set("service", params.ServiceFilter) } if params.TagFilter != "" { r.params.Set("tag", params.TagFilter) } if params.Payload != nil { r.body = bytes.NewReader(params.Payload) } rtt, resp, err := requireOK(e.c.doRequest(r)) if err != nil { return "", nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out UserEvent if err := decodeBody(resp, &out); err != nil { return "", nil, err } return out.ID, wm, nil } // List is used to get the most recent events an agent has received. // This list can be optionally filtered by the name. This endpoint supports // quasi-blocking queries. The index is not monotonic, nor does it provide provide // LastContact or KnownLeader. func (e *Event) List(name string, q *QueryOptions) ([]*UserEvent, *QueryMeta, error) { r := e.c.newRequest("GET", "/v1/event/list") r.setQueryOptions(q) if name != "" { r.params.Set("name", name) } rtt, resp, err := requireOK(e.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var entries []*UserEvent if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // IDToIndex is a bit of a hack. This simulates the index generation to // convert an event ID into a WaitIndex. func (e *Event) IDToIndex(uuid string) uint64 { lower := uuid[0:8] + uuid[9:13] + uuid[14:18] upper := uuid[19:23] + uuid[24:36] lowVal, err := strconv.ParseUint(lower, 16, 64) if err != nil { panic("Failed to convert " + lower) } highVal, err := strconv.ParseUint(upper, 16, 64) if err != nil { panic("Failed to convert " + upper) } return lowVal ^ highVal } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/go.mod��������������������������������������0000664�0000000�0000000�00000000650�13771713062�0024162�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/consul/api go 1.12 replace github.com/hashicorp/consul/sdk => ../sdk require ( github.com/hashicorp/consul/sdk v0.4.0 github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-hclog v0.12.0 github.com/hashicorp/go-rootcerts v1.0.2 github.com/hashicorp/go-uuid v1.0.1 github.com/hashicorp/serf v0.8.2 github.com/mitchellh/mapstructure v1.1.2 github.com/stretchr/testify v1.4.0 ) ����������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/go.sum��������������������������������������0000664�0000000�0000000�00000024532�13771713062�0024214�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/hashicorp/consul/sdk v0.4.0 h1:zBtCfKJZcJDBvSCkQJch4ulp59m1rATFLKwNo/LYY30= github.com/hashicorp/consul/sdk v0.4.0/go.mod h1:fY08Y9z5SvJqevyZNy6WWPXiG3KwBPAvlcdx16zZ0fM= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.12.0 h1:d4QkX8FRTYaKaCZBoXYY8zJX2BXjWxurN/GA2tkrmZM= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3 h1:KYQXGkl6vs02hK7pK4eIbw0NpNPedieTSTEiJ//bwGs= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5 h1:x6r4Jo0KNzOOzYd8lbcRsqjuqEASK6ob3auvWYM4/8U= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= ����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/health.go�����������������������������������0000664�0000000�0000000�00000023404�13771713062�0024652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "encoding/json" "fmt" "strings" "time" ) const ( // HealthAny is special, and is used as a wild card, // not as a specific state. HealthAny = "any" HealthPassing = "passing" HealthWarning = "warning" HealthCritical = "critical" HealthMaint = "maintenance" ) const ( // NodeMaint is the special key set by a node in maintenance mode. NodeMaint = "_node_maintenance" // ServiceMaintPrefix is the prefix for a service in maintenance mode. ServiceMaintPrefix = "_service_maintenance:" ) // HealthCheck is used to represent a single check type HealthCheck struct { Node string CheckID string Name string Status string Notes string Output string ServiceID string ServiceName string ServiceTags []string Type string Namespace string `json:",omitempty"` Definition HealthCheckDefinition CreateIndex uint64 ModifyIndex uint64 } // HealthCheckDefinition is used to store the details about // a health check's execution. type HealthCheckDefinition struct { HTTP string Header map[string][]string Method string Body string TLSSkipVerify bool TCP string IntervalDuration time.Duration `json:"-"` TimeoutDuration time.Duration `json:"-"` DeregisterCriticalServiceAfterDuration time.Duration `json:"-"` // DEPRECATED in Consul 1.4.1. Use the above time.Duration fields instead. Interval ReadableDuration Timeout ReadableDuration DeregisterCriticalServiceAfter ReadableDuration } func (d *HealthCheckDefinition) MarshalJSON() ([]byte, error) { type Alias HealthCheckDefinition out := &struct { Interval string Timeout string DeregisterCriticalServiceAfter string *Alias }{ Interval: d.Interval.String(), Timeout: d.Timeout.String(), DeregisterCriticalServiceAfter: d.DeregisterCriticalServiceAfter.String(), Alias: (*Alias)(d), } if d.IntervalDuration != 0 { out.Interval = d.IntervalDuration.String() } else if d.Interval != 0 { out.Interval = d.Interval.String() } if d.TimeoutDuration != 0 { out.Timeout = d.TimeoutDuration.String() } else if d.Timeout != 0 { out.Timeout = d.Timeout.String() } if d.DeregisterCriticalServiceAfterDuration != 0 { out.DeregisterCriticalServiceAfter = d.DeregisterCriticalServiceAfterDuration.String() } else if d.DeregisterCriticalServiceAfter != 0 { out.DeregisterCriticalServiceAfter = d.DeregisterCriticalServiceAfter.String() } return json.Marshal(out) } func (t *HealthCheckDefinition) UnmarshalJSON(data []byte) (err error) { type Alias HealthCheckDefinition aux := &struct { IntervalDuration interface{} TimeoutDuration interface{} DeregisterCriticalServiceAfterDuration interface{} *Alias }{ Alias: (*Alias)(t), } if err := json.Unmarshal(data, &aux); err != nil { return err } // Parse the values into both the time.Duration and old ReadableDuration fields. if aux.IntervalDuration == nil { t.IntervalDuration = time.Duration(t.Interval) } else { switch v := aux.IntervalDuration.(type) { case string: if t.IntervalDuration, err = time.ParseDuration(v); err != nil { return err } case float64: t.IntervalDuration = time.Duration(v) } t.Interval = ReadableDuration(t.IntervalDuration) } if aux.TimeoutDuration == nil { t.TimeoutDuration = time.Duration(t.Timeout) } else { switch v := aux.TimeoutDuration.(type) { case string: if t.TimeoutDuration, err = time.ParseDuration(v); err != nil { return err } case float64: t.TimeoutDuration = time.Duration(v) } t.Timeout = ReadableDuration(t.TimeoutDuration) } if aux.DeregisterCriticalServiceAfterDuration == nil { t.DeregisterCriticalServiceAfterDuration = time.Duration(t.DeregisterCriticalServiceAfter) } else { switch v := aux.DeregisterCriticalServiceAfterDuration.(type) { case string: if t.DeregisterCriticalServiceAfterDuration, err = time.ParseDuration(v); err != nil { return err } case float64: t.DeregisterCriticalServiceAfterDuration = time.Duration(v) } t.DeregisterCriticalServiceAfter = ReadableDuration(t.DeregisterCriticalServiceAfterDuration) } return nil } // HealthChecks is a collection of HealthCheck structs. type HealthChecks []*HealthCheck // AggregatedStatus returns the "best" status for the list of health checks. // Because a given entry may have many service and node-level health checks // attached, this function determines the best representative of the status as // as single string using the following heuristic: // // maintenance > critical > warning > passing // func (c HealthChecks) AggregatedStatus() string { var passing, warning, critical, maintenance bool for _, check := range c { id := string(check.CheckID) if id == NodeMaint || strings.HasPrefix(id, ServiceMaintPrefix) { maintenance = true continue } switch check.Status { case HealthPassing: passing = true case HealthWarning: warning = true case HealthCritical: critical = true default: return "" } } switch { case maintenance: return HealthMaint case critical: return HealthCritical case warning: return HealthWarning case passing: return HealthPassing default: return HealthPassing } } // ServiceEntry is used for the health service endpoint type ServiceEntry struct { Node *Node Service *AgentService Checks HealthChecks } // Health can be used to query the Health endpoints type Health struct { c *Client } // Health returns a handle to the health endpoints func (c *Client) Health() *Health { return &Health{c} } // Node is used to query for checks belonging to a given node func (h *Health) Node(node string, q *QueryOptions) (HealthChecks, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/health/node/"+node) r.setQueryOptions(q) rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out HealthChecks if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // Checks is used to return the checks associated with a service func (h *Health) Checks(service string, q *QueryOptions) (HealthChecks, *QueryMeta, error) { r := h.c.newRequest("GET", "/v1/health/checks/"+service) r.setQueryOptions(q) rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out HealthChecks if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // Service is used to query health information along with service info // for a given service. It can optionally do server-side filtering on a tag // or nodes with passing health checks only. func (h *Health) Service(service, tag string, passingOnly bool, q *QueryOptions) ([]*ServiceEntry, *QueryMeta, error) { var tags []string if tag != "" { tags = []string{tag} } return h.service(service, tags, passingOnly, q, false) } func (h *Health) ServiceMultipleTags(service string, tags []string, passingOnly bool, q *QueryOptions) ([]*ServiceEntry, *QueryMeta, error) { return h.service(service, tags, passingOnly, q, false) } // Connect is equivalent to Service except that it will only return services // which are Connect-enabled and will returns the connection address for Connect // client's to use which may be a proxy in front of the named service. If // passingOnly is true only instances where both the service and any proxy are // healthy will be returned. func (h *Health) Connect(service, tag string, passingOnly bool, q *QueryOptions) ([]*ServiceEntry, *QueryMeta, error) { var tags []string if tag != "" { tags = []string{tag} } return h.service(service, tags, passingOnly, q, true) } func (h *Health) ConnectMultipleTags(service string, tags []string, passingOnly bool, q *QueryOptions) ([]*ServiceEntry, *QueryMeta, error) { return h.service(service, tags, passingOnly, q, true) } func (h *Health) service(service string, tags []string, passingOnly bool, q *QueryOptions, connect bool) ([]*ServiceEntry, *QueryMeta, error) { path := "/v1/health/service/" + service if connect { path = "/v1/health/connect/" + service } r := h.c.newRequest("GET", path) r.setQueryOptions(q) if len(tags) > 0 { for _, tag := range tags { r.params.Add("tag", tag) } } if passingOnly { r.params.Set(HealthPassing, "1") } rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out []*ServiceEntry if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } // State is used to retrieve all the checks in a given state. // The wildcard "any" state can also be used for all checks. func (h *Health) State(state string, q *QueryOptions) (HealthChecks, *QueryMeta, error) { switch state { case HealthAny: case HealthWarning: case HealthCritical: case HealthPassing: default: return nil, nil, fmt.Errorf("Unsupported state: %v", state) } r := h.c.newRequest("GET", "/v1/health/state/"+state) r.setQueryOptions(q) rtt, resp, err := requireOK(h.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt var out HealthChecks if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/kv.go���������������������������������������0000664�0000000�0000000�00000017771�13771713062�0024037�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "fmt" "io" "net/http" "strconv" "strings" ) // KVPair is used to represent a single K/V entry type KVPair struct { // Key is the name of the key. It is also part of the URL path when accessed // via the API. Key string // CreateIndex holds the index corresponding the creation of this KVPair. This // is a read-only field. CreateIndex uint64 // ModifyIndex is used for the Check-And-Set operations and can also be fed // back into the WaitIndex of the QueryOptions in order to perform blocking // queries. ModifyIndex uint64 // LockIndex holds the index corresponding to a lock on this key, if any. This // is a read-only field. LockIndex uint64 // Flags are any user-defined flags on the key. It is up to the implementer // to check these values, since Consul does not treat them specially. Flags uint64 // Value is the value for the key. This can be any value, but it will be // base64 encoded upon transport. Value []byte // Session is a string representing the ID of the session. Any other // interactions with this key over the same session must specify the same // session ID. Session string // Namespace is the namespace the KVPair is associated with // Namespacing is a Consul Enterprise feature. Namespace string `json:",omitempty"` } // KVPairs is a list of KVPair objects type KVPairs []*KVPair // KV is used to manipulate the K/V API type KV struct { c *Client } // KV is used to return a handle to the K/V apis func (c *Client) KV() *KV { return &KV{c} } // Get is used to lookup a single key. The returned pointer // to the KVPair will be nil if the key does not exist. func (k *KV) Get(key string, q *QueryOptions) (*KVPair, *QueryMeta, error) { resp, qm, err := k.getInternal(key, nil, q) if err != nil { return nil, nil, err } if resp == nil { return nil, qm, nil } defer resp.Body.Close() var entries []*KVPair if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } if len(entries) > 0 { return entries[0], qm, nil } return nil, qm, nil } // List is used to lookup all keys under a prefix func (k *KV) List(prefix string, q *QueryOptions) (KVPairs, *QueryMeta, error) { resp, qm, err := k.getInternal(prefix, map[string]string{"recurse": ""}, q) if err != nil { return nil, nil, err } if resp == nil { return nil, qm, nil } defer resp.Body.Close() var entries []*KVPair if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } // Keys is used to list all the keys under a prefix. Optionally, // a separator can be used to limit the responses. func (k *KV) Keys(prefix, separator string, q *QueryOptions) ([]string, *QueryMeta, error) { params := map[string]string{"keys": ""} if separator != "" { params["separator"] = separator } resp, qm, err := k.getInternal(prefix, params, q) if err != nil { return nil, nil, err } if resp == nil { return nil, qm, nil } defer resp.Body.Close() var entries []string if err := decodeBody(resp, &entries); err != nil { return nil, nil, err } return entries, qm, nil } func (k *KV) getInternal(key string, params map[string]string, q *QueryOptions) (*http.Response, *QueryMeta, error) { r := k.c.newRequest("GET", "/v1/kv/"+strings.TrimPrefix(key, "/")) r.setQueryOptions(q) for param, val := range params { r.params.Set(param, val) } rtt, resp, err := k.c.doRequest(r) if err != nil { return nil, nil, err } qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if resp.StatusCode == 404 { resp.Body.Close() return nil, qm, nil } else if resp.StatusCode != 200 { resp.Body.Close() return nil, nil, fmt.Errorf("Unexpected response code: %d", resp.StatusCode) } return resp, qm, nil } // Put is used to write a new value. Only the // Key, Flags and Value is respected. func (k *KV) Put(p *KVPair, q *WriteOptions) (*WriteMeta, error) { params := make(map[string]string, 1) if p.Flags != 0 { params["flags"] = strconv.FormatUint(p.Flags, 10) } _, wm, err := k.put(p.Key, params, p.Value, q) return wm, err } // CAS is used for a Check-And-Set operation. The Key, // ModifyIndex, Flags and Value are respected. Returns true // on success or false on failures. func (k *KV) CAS(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { params := make(map[string]string, 2) if p.Flags != 0 { params["flags"] = strconv.FormatUint(p.Flags, 10) } params["cas"] = strconv.FormatUint(p.ModifyIndex, 10) return k.put(p.Key, params, p.Value, q) } // Acquire is used for a lock acquisition operation. The Key, // Flags, Value and Session are respected. Returns true // on success or false on failures. func (k *KV) Acquire(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { params := make(map[string]string, 2) if p.Flags != 0 { params["flags"] = strconv.FormatUint(p.Flags, 10) } params["acquire"] = p.Session return k.put(p.Key, params, p.Value, q) } // Release is used for a lock release operation. The Key, // Flags, Value and Session are respected. Returns true // on success or false on failures. func (k *KV) Release(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { params := make(map[string]string, 2) if p.Flags != 0 { params["flags"] = strconv.FormatUint(p.Flags, 10) } params["release"] = p.Session return k.put(p.Key, params, p.Value, q) } func (k *KV) put(key string, params map[string]string, body []byte, q *WriteOptions) (bool, *WriteMeta, error) { if len(key) > 0 && key[0] == '/' { return false, nil, fmt.Errorf("Invalid key. Key must not begin with a '/': %s", key) } r := k.c.newRequest("PUT", "/v1/kv/"+key) r.setWriteOptions(q) for param, val := range params { r.params.Set(param, val) } r.body = bytes.NewReader(body) rtt, resp, err := requireOK(k.c.doRequest(r)) if err != nil { return false, nil, err } defer resp.Body.Close() qm := &WriteMeta{} qm.RequestTime = rtt var buf bytes.Buffer if _, err := io.Copy(&buf, resp.Body); err != nil { return false, nil, fmt.Errorf("Failed to read response: %v", err) } res := strings.Contains(buf.String(), "true") return res, qm, nil } // Delete is used to delete a single key func (k *KV) Delete(key string, w *WriteOptions) (*WriteMeta, error) { _, qm, err := k.deleteInternal(key, nil, w) return qm, err } // DeleteCAS is used for a Delete Check-And-Set operation. The Key // and ModifyIndex are respected. Returns true on success or false on failures. func (k *KV) DeleteCAS(p *KVPair, q *WriteOptions) (bool, *WriteMeta, error) { params := map[string]string{ "cas": strconv.FormatUint(p.ModifyIndex, 10), } return k.deleteInternal(p.Key, params, q) } // DeleteTree is used to delete all keys under a prefix func (k *KV) DeleteTree(prefix string, w *WriteOptions) (*WriteMeta, error) { _, qm, err := k.deleteInternal(prefix, map[string]string{"recurse": ""}, w) return qm, err } func (k *KV) deleteInternal(key string, params map[string]string, q *WriteOptions) (bool, *WriteMeta, error) { r := k.c.newRequest("DELETE", "/v1/kv/"+strings.TrimPrefix(key, "/")) r.setWriteOptions(q) for param, val := range params { r.params.Set(param, val) } rtt, resp, err := requireOK(k.c.doRequest(r)) if err != nil { return false, nil, err } defer resp.Body.Close() qm := &WriteMeta{} qm.RequestTime = rtt var buf bytes.Buffer if _, err := io.Copy(&buf, resp.Body); err != nil { return false, nil, fmt.Errorf("Failed to read response: %v", err) } res := strings.Contains(buf.String(), "true") return res, qm, nil } // The Txn function has been deprecated from the KV object; please see the Txn // object for more information about Transactions. func (k *KV) Txn(txn KVTxnOps, q *QueryOptions) (bool, *KVTxnResponse, *QueryMeta, error) { var ops TxnOps for _, op := range txn { ops = append(ops, &TxnOp{KV: op}) } respOk, txnResp, qm, err := k.c.txn(ops, q) if err != nil { return false, nil, nil, err } // Convert from the internal format. kvResp := KVTxnResponse{ Errors: txnResp.Errors, } for _, result := range txnResp.Results { kvResp.Results = append(kvResp.Results, result.KV) } return respOk, &kvResp, qm, nil } �������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/lock.go�������������������������������������0000664�0000000�0000000�00000025742�13771713062�0024344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "fmt" "sync" "time" ) const ( // DefaultLockSessionName is the Session Name we assign if none is provided DefaultLockSessionName = "Consul API Lock" // DefaultLockSessionTTL is the default session TTL if no Session is provided // when creating a new Lock. This is used because we do not have another // other check to depend upon. DefaultLockSessionTTL = "15s" // DefaultLockWaitTime is how long we block for at a time to check if lock // acquisition is possible. This affects the minimum time it takes to cancel // a Lock acquisition. DefaultLockWaitTime = 15 * time.Second // DefaultLockRetryTime is how long we wait after a failed lock acquisition // before attempting to do the lock again. This is so that once a lock-delay // is in effect, we do not hot loop retrying the acquisition. DefaultLockRetryTime = 5 * time.Second // DefaultMonitorRetryTime is how long we wait after a failed monitor check // of a lock (500 response code). This allows the monitor to ride out brief // periods of unavailability, subject to the MonitorRetries setting in the // lock options which is by default set to 0, disabling this feature. This // affects locks and semaphores. DefaultMonitorRetryTime = 2 * time.Second // LockFlagValue is a magic flag we set to indicate a key // is being used for a lock. It is used to detect a potential // conflict with a semaphore. LockFlagValue = 0x2ddccbc058a50c18 ) var ( // ErrLockHeld is returned if we attempt to double lock ErrLockHeld = fmt.Errorf("Lock already held") // ErrLockNotHeld is returned if we attempt to unlock a lock // that we do not hold. ErrLockNotHeld = fmt.Errorf("Lock not held") // ErrLockInUse is returned if we attempt to destroy a lock // that is in use. ErrLockInUse = fmt.Errorf("Lock in use") // ErrLockConflict is returned if the flags on a key // used for a lock do not match expectation ErrLockConflict = fmt.Errorf("Existing key does not match lock use") ) // Lock is used to implement client-side leader election. It is follows the // algorithm as described here: https://www.consul.io/docs/guides/leader-election.html. type Lock struct { c *Client opts *LockOptions isHeld bool sessionRenew chan struct{} lockSession string l sync.Mutex } // LockOptions is used to parameterize the Lock behavior. type LockOptions struct { Key string // Must be set and have write permissions Value []byte // Optional, value to associate with the lock Session string // Optional, created if not specified SessionOpts *SessionEntry // Optional, options to use when creating a session SessionName string // Optional, defaults to DefaultLockSessionName (ignored if SessionOpts is given) SessionTTL string // Optional, defaults to DefaultLockSessionTTL (ignored if SessionOpts is given) MonitorRetries int // Optional, defaults to 0 which means no retries MonitorRetryTime time.Duration // Optional, defaults to DefaultMonitorRetryTime LockWaitTime time.Duration // Optional, defaults to DefaultLockWaitTime LockTryOnce bool // Optional, defaults to false which means try forever Namespace string `json:",omitempty"` // Optional, defaults to API client config, namespace of ACL token, or "default" namespace } // LockKey returns a handle to a lock struct which can be used // to acquire and release the mutex. The key used must have // write permissions. func (c *Client) LockKey(key string) (*Lock, error) { opts := &LockOptions{ Key: key, } return c.LockOpts(opts) } // LockOpts returns a handle to a lock struct which can be used // to acquire and release the mutex. The key used must have // write permissions. func (c *Client) LockOpts(opts *LockOptions) (*Lock, error) { if opts.Key == "" { return nil, fmt.Errorf("missing key") } if opts.SessionName == "" { opts.SessionName = DefaultLockSessionName } if opts.SessionTTL == "" { opts.SessionTTL = DefaultLockSessionTTL } else { if _, err := time.ParseDuration(opts.SessionTTL); err != nil { return nil, fmt.Errorf("invalid SessionTTL: %v", err) } } if opts.MonitorRetryTime == 0 { opts.MonitorRetryTime = DefaultMonitorRetryTime } if opts.LockWaitTime == 0 { opts.LockWaitTime = DefaultLockWaitTime } l := &Lock{ c: c, opts: opts, } return l, nil } // Lock attempts to acquire the lock and blocks while doing so. // Providing a non-nil stopCh can be used to abort the lock attempt. // Returns a channel that is closed if our lock is lost or an error. // This channel could be closed at any time due to session invalidation, // communication errors, operator intervention, etc. It is NOT safe to // assume that the lock is held until Unlock() unless the Session is specifically // created without any associated health checks. By default Consul sessions // prefer liveness over safety and an application must be able to handle // the lock being lost. func (l *Lock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error) { // Hold the lock as we try to acquire l.l.Lock() defer l.l.Unlock() // Check if we already hold the lock if l.isHeld { return nil, ErrLockHeld } wOpts := WriteOptions{ Namespace: l.opts.Namespace, } // Check if we need to create a session first l.lockSession = l.opts.Session if l.lockSession == "" { s, err := l.createSession() if err != nil { return nil, fmt.Errorf("failed to create session: %v", err) } l.sessionRenew = make(chan struct{}) l.lockSession = s session := l.c.Session() go session.RenewPeriodic(l.opts.SessionTTL, s, &wOpts, l.sessionRenew) // If we fail to acquire the lock, cleanup the session defer func() { if !l.isHeld { close(l.sessionRenew) l.sessionRenew = nil } }() } // Setup the query options kv := l.c.KV() qOpts := QueryOptions{ WaitTime: l.opts.LockWaitTime, Namespace: l.opts.Namespace, } start := time.Now() attempts := 0 WAIT: // Check if we should quit select { case <-stopCh: return nil, nil default: } // Handle the one-shot mode. if l.opts.LockTryOnce && attempts > 0 { elapsed := time.Since(start) if elapsed > l.opts.LockWaitTime { return nil, nil } // Query wait time should not exceed the lock wait time qOpts.WaitTime = l.opts.LockWaitTime - elapsed } attempts++ // Look for an existing lock, blocking until not taken pair, meta, err := kv.Get(l.opts.Key, &qOpts) if err != nil { return nil, fmt.Errorf("failed to read lock: %v", err) } if pair != nil && pair.Flags != LockFlagValue { return nil, ErrLockConflict } locked := false if pair != nil && pair.Session == l.lockSession { goto HELD } if pair != nil && pair.Session != "" { qOpts.WaitIndex = meta.LastIndex goto WAIT } // Try to acquire the lock pair = l.lockEntry(l.lockSession) locked, _, err = kv.Acquire(pair, &wOpts) if err != nil { return nil, fmt.Errorf("failed to acquire lock: %v", err) } // Handle the case of not getting the lock if !locked { // Determine why the lock failed qOpts.WaitIndex = 0 pair, meta, err = kv.Get(l.opts.Key, &qOpts) if pair != nil && pair.Session != "" { //If the session is not null, this means that a wait can safely happen //using a long poll qOpts.WaitIndex = meta.LastIndex goto WAIT } else { // If the session is empty and the lock failed to acquire, then it means // a lock-delay is in effect and a timed wait must be used select { case <-time.After(DefaultLockRetryTime): goto WAIT case <-stopCh: return nil, nil } } } HELD: // Watch to ensure we maintain leadership leaderCh := make(chan struct{}) go l.monitorLock(l.lockSession, leaderCh) // Set that we own the lock l.isHeld = true // Locked! All done return leaderCh, nil } // Unlock released the lock. It is an error to call this // if the lock is not currently held. func (l *Lock) Unlock() error { // Hold the lock as we try to release l.l.Lock() defer l.l.Unlock() // Ensure the lock is actually held if !l.isHeld { return ErrLockNotHeld } // Set that we no longer own the lock l.isHeld = false // Stop the session renew if l.sessionRenew != nil { defer func() { close(l.sessionRenew) l.sessionRenew = nil }() } // Get the lock entry, and clear the lock session lockEnt := l.lockEntry(l.lockSession) l.lockSession = "" // Release the lock explicitly kv := l.c.KV() w := WriteOptions{Namespace: l.opts.Namespace} _, _, err := kv.Release(lockEnt, &w) if err != nil { return fmt.Errorf("failed to release lock: %v", err) } return nil } // Destroy is used to cleanup the lock entry. It is not necessary // to invoke. It will fail if the lock is in use. func (l *Lock) Destroy() error { // Hold the lock as we try to release l.l.Lock() defer l.l.Unlock() // Check if we already hold the lock if l.isHeld { return ErrLockHeld } // Look for an existing lock kv := l.c.KV() q := QueryOptions{Namespace: l.opts.Namespace} pair, _, err := kv.Get(l.opts.Key, &q) if err != nil { return fmt.Errorf("failed to read lock: %v", err) } // Nothing to do if the lock does not exist if pair == nil { return nil } // Check for possible flag conflict if pair.Flags != LockFlagValue { return ErrLockConflict } // Check if it is in use if pair.Session != "" { return ErrLockInUse } // Attempt the delete w := WriteOptions{Namespace: l.opts.Namespace} didRemove, _, err := kv.DeleteCAS(pair, &w) if err != nil { return fmt.Errorf("failed to remove lock: %v", err) } if !didRemove { return ErrLockInUse } return nil } // createSession is used to create a new managed session func (l *Lock) createSession() (string, error) { session := l.c.Session() se := l.opts.SessionOpts if se == nil { se = &SessionEntry{ Name: l.opts.SessionName, TTL: l.opts.SessionTTL, } } w := WriteOptions{Namespace: l.opts.Namespace} id, _, err := session.Create(se, &w) if err != nil { return "", err } return id, nil } // lockEntry returns a formatted KVPair for the lock func (l *Lock) lockEntry(session string) *KVPair { return &KVPair{ Key: l.opts.Key, Value: l.opts.Value, Session: session, Flags: LockFlagValue, } } // monitorLock is a long running routine to monitor a lock ownership // It closes the stopCh if we lose our leadership. func (l *Lock) monitorLock(session string, stopCh chan struct{}) { defer close(stopCh) kv := l.c.KV() opts := QueryOptions{ RequireConsistent: true, Namespace: l.opts.Namespace, } WAIT: retries := l.opts.MonitorRetries RETRY: pair, meta, err := kv.Get(l.opts.Key, &opts) if err != nil { // If configured we can try to ride out a brief Consul unavailability // by doing retries. Note that we have to attempt the retry in a non- // blocking fashion so that we have a clean place to reset the retry // counter if service is restored. if retries > 0 && IsRetryableError(err) { time.Sleep(l.opts.MonitorRetryTime) retries-- opts.WaitIndex = 0 goto RETRY } return } if pair != nil && pair.Session == session { opts.WaitIndex = meta.LastIndex goto WAIT } } ������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/namespace.go��������������������������������0000664�0000000�0000000�00000010526�13771713062�0025342�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "fmt" "time" ) // Namespace is the configuration of a single namespace. Namespacing is a Consul Enterprise feature. type Namespace struct { // Name is the name of the Namespace. It must be unique and // must be a DNS hostname. There are also other reserved names // that may not be used. Name string `json:"Name"` // Description is where the user puts any information they want // about the namespace. It is not used internally. Description string `json:"Description,omitempty"` // ACLs is the configuration of ACLs for this namespace. It has its // own struct so that we can add more to it in the future. // This is nullable so that we can omit if empty when encoding in JSON ACLs *NamespaceACLConfig `json:"ACLs,omitempty"` // Meta is a map that can be used to add kv metadata to the namespace definition Meta map[string]string `json:"Meta,omitempty"` // DeletedAt is the time when the Namespace was marked for deletion // This is nullable so that we can omit if empty when encoding in JSON DeletedAt *time.Time `json:"DeletedAt,omitempty"` // CreateIndex is the Raft index at which the Namespace was created CreateIndex uint64 `json:"CreateIndex,omitempty"` // ModifyIndex is the latest Raft index at which the Namespace was modified. ModifyIndex uint64 `json:"ModifyIndex,omitempty"` } // NamespaceACLConfig is the Namespace specific ACL configuration container type NamespaceACLConfig struct { // PolicyDefaults is the list of policies that should be used for the parent authorizer // of all tokens in the associated namespace. PolicyDefaults []ACLLink `json:"PolicyDefaults"` // RoleDefaults is the list of roles that should be used for the parent authorizer // of all tokens in the associated namespace. RoleDefaults []ACLLink `json:"RoleDefaults"` } // Namespaces can be used to manage Namespaces in Consul Enterprise.. type Namespaces struct { c *Client } // Operator returns a handle to the operator endpoints. func (c *Client) Namespaces() *Namespaces { return &Namespaces{c} } func (n *Namespaces) Create(ns *Namespace, q *WriteOptions) (*Namespace, *WriteMeta, error) { if ns.Name == "" { return nil, nil, fmt.Errorf("Must specify a Name for Namespace creation") } r := n.c.newRequest("PUT", "/v1/namespace") r.setWriteOptions(q) r.obj = ns rtt, resp, err := requireOK(n.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out Namespace if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } func (n *Namespaces) Update(ns *Namespace, q *WriteOptions) (*Namespace, *WriteMeta, error) { if ns.Name == "" { return nil, nil, fmt.Errorf("Must specify a Name for Namespace updating") } r := n.c.newRequest("PUT", "/v1/namespace/"+ns.Name) r.setWriteOptions(q) r.obj = ns rtt, resp, err := requireOK(n.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} var out Namespace if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, wm, nil } func (n *Namespaces) Read(name string, q *QueryOptions) (*Namespace, *QueryMeta, error) { var out Namespace r := n.c.newRequest("GET", "/v1/namespace/"+name) r.setQueryOptions(q) found, rtt, resp, err := requireNotFoundOrOK(n.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if !found { return nil, qm, nil } if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return &out, qm, nil } func (n *Namespaces) Delete(name string, q *WriteOptions) (*WriteMeta, error) { r := n.c.newRequest("DELETE", "/v1/namespace/"+name) r.setWriteOptions(q) rtt, resp, err := requireOK(n.c.doRequest(r)) if err != nil { return nil, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} return wm, nil } func (n *Namespaces) List(q *QueryOptions) ([]*Namespace, *QueryMeta, error) { var out []*Namespace r := n.c.newRequest("GET", "/v1/namespaces") r.setQueryOptions(q) rtt, resp, err := requireOK(n.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, qm, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/operator.go���������������������������������0000664�0000000�0000000�00000000361�13771713062�0025235�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // Operator can be used to perform low-level operator tasks for Consul. type Operator struct { c *Client } // Operator returns a handle to the operator endpoints. func (c *Client) Operator() *Operator { return &Operator{c} } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/operator_area.go����������������������������0000664�0000000�0000000�00000012563�13771713062�0026234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // The /v1/operator/area endpoints are available only in Consul Enterprise and // interact with its network area subsystem. Network areas are used to link // together Consul servers in different Consul datacenters. With network areas, // Consul datacenters can be linked together in ways other than a fully-connected // mesh, as is required for Consul's WAN. import ( "net" "time" ) // Area defines a network area. type Area struct { // ID is this identifier for an area (a UUID). This must be left empty // when creating a new area. ID string // PeerDatacenter is the peer Consul datacenter that will make up the // other side of this network area. Network areas always involve a pair // of datacenters: the datacenter where the area was created, and the // peer datacenter. This is required. PeerDatacenter string // RetryJoin specifies the address of Consul servers to join to, such as // an IPs or hostnames with an optional port number. This is optional. RetryJoin []string // UseTLS specifies whether gossip over this area should be encrypted with TLS // if possible. UseTLS bool } // AreaJoinResponse is returned when a join occurs and gives the result for each // address. type AreaJoinResponse struct { // The address that was joined. Address string // Whether or not the join was a success. Joined bool // If we couldn't join, this is the message with information. Error string } // SerfMember is a generic structure for reporting information about members in // a Serf cluster. This is only used by the area endpoints right now, but this // could be expanded to other endpoints in the future. type SerfMember struct { // ID is the node identifier (a UUID). ID string // Name is the node name. Name string // Addr has the IP address. Addr net.IP // Port is the RPC port. Port uint16 // Datacenter is the DC name. Datacenter string // Role is "client", "server", or "unknown". Role string // Build has the version of the Consul agent. Build string // Protocol is the protocol of the Consul agent. Protocol int // Status is the Serf health status "none", "alive", "leaving", "left", // or "failed". Status string // RTT is the estimated round trip time from the server handling the // request to the this member. This will be negative if no RTT estimate // is available. RTT time.Duration } // AreaCreate will create a new network area. The ID in the given structure must // be empty and a generated ID will be returned on success. func (op *Operator) AreaCreate(area *Area, q *WriteOptions) (string, *WriteMeta, error) { r := op.c.newRequest("POST", "/v1/operator/area") r.setWriteOptions(q) r.obj = area rtt, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return "", nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt var out struct{ ID string } if err := decodeBody(resp, &out); err != nil { return "", nil, err } return out.ID, wm, nil } // AreaUpdate will update the configuration of the network area with the given ID. func (op *Operator) AreaUpdate(areaID string, area *Area, q *WriteOptions) (string, *WriteMeta, error) { r := op.c.newRequest("PUT", "/v1/operator/area/"+areaID) r.setWriteOptions(q) r.obj = area rtt, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return "", nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt var out struct{ ID string } if err := decodeBody(resp, &out); err != nil { return "", nil, err } return out.ID, wm, nil } // AreaGet returns a single network area. func (op *Operator) AreaGet(areaID string, q *QueryOptions) ([]*Area, *QueryMeta, error) { var out []*Area qm, err := op.c.query("/v1/operator/area/"+areaID, &out, q) if err != nil { return nil, nil, err } return out, qm, nil } // AreaList returns all the available network areas. func (op *Operator) AreaList(q *QueryOptions) ([]*Area, *QueryMeta, error) { var out []*Area qm, err := op.c.query("/v1/operator/area", &out, q) if err != nil { return nil, nil, err } return out, qm, nil } // AreaDelete deletes the given network area. func (op *Operator) AreaDelete(areaID string, q *WriteOptions) (*WriteMeta, error) { r := op.c.newRequest("DELETE", "/v1/operator/area/"+areaID) r.setWriteOptions(q) rtt, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt return wm, nil } // AreaJoin attempts to join the given set of join addresses to the given // network area. See the Area structure for details about join addresses. func (op *Operator) AreaJoin(areaID string, addresses []string, q *WriteOptions) ([]*AreaJoinResponse, *WriteMeta, error) { r := op.c.newRequest("PUT", "/v1/operator/area/"+areaID+"/join") r.setWriteOptions(q) r.obj = addresses rtt, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt var out []*AreaJoinResponse if err := decodeBody(resp, &out); err != nil { return nil, nil, err } return out, wm, nil } // AreaMembers lists the Serf information about the members in the given area. func (op *Operator) AreaMembers(areaID string, q *QueryOptions) ([]*SerfMember, *QueryMeta, error) { var out []*SerfMember qm, err := op.c.query("/v1/operator/area/"+areaID+"/members", &out, q) if err != nil { return nil, nil, err } return out, qm, nil } ���������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/operator_autopilot.go�����������������������0000664�0000000�0000000�00000015464�13771713062�0027347�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "fmt" "io" "strconv" "strings" "time" ) // AutopilotConfiguration is used for querying/setting the Autopilot configuration. // Autopilot helps manage operator tasks related to Consul servers like removing // failed servers from the Raft quorum. type AutopilotConfiguration struct { // CleanupDeadServers controls whether to remove dead servers from the Raft // peer list when a new server joins CleanupDeadServers bool // LastContactThreshold is the limit on the amount of time a server can go // without leader contact before being considered unhealthy. LastContactThreshold *ReadableDuration // MaxTrailingLogs is the amount of entries in the Raft Log that a server can // be behind before being considered unhealthy. MaxTrailingLogs uint64 // MinQuorum sets the minimum number of servers allowed in a cluster before // autopilot can prune dead servers. MinQuorum uint // ServerStabilizationTime is the minimum amount of time a server must be // in a stable, healthy state before it can be added to the cluster. Only // applicable with Raft protocol version 3 or higher. ServerStabilizationTime *ReadableDuration // (Enterprise-only) RedundancyZoneTag is the node tag to use for separating // servers into zones for redundancy. If left blank, this feature will be disabled. RedundancyZoneTag string // (Enterprise-only) DisableUpgradeMigration will disable Autopilot's upgrade migration // strategy of waiting until enough newer-versioned servers have been added to the // cluster before promoting them to voters. DisableUpgradeMigration bool // (Enterprise-only) UpgradeVersionTag is the node tag to use for version info when // performing upgrade migrations. If left blank, the Consul version will be used. UpgradeVersionTag string // CreateIndex holds the index corresponding the creation of this configuration. // This is a read-only field. CreateIndex uint64 // ModifyIndex will be set to the index of the last update when retrieving the // Autopilot configuration. Resubmitting a configuration with // AutopilotCASConfiguration will perform a check-and-set operation which ensures // there hasn't been a subsequent update since the configuration was retrieved. ModifyIndex uint64 } // ServerHealth is the health (from the leader's point of view) of a server. type ServerHealth struct { // ID is the raft ID of the server. ID string // Name is the node name of the server. Name string // Address is the address of the server. Address string // The status of the SerfHealth check for the server. SerfStatus string // Version is the Consul version of the server. Version string // Leader is whether this server is currently the leader. Leader bool // LastContact is the time since this node's last contact with the leader. LastContact *ReadableDuration // LastTerm is the highest leader term this server has a record of in its Raft log. LastTerm uint64 // LastIndex is the last log index this server has a record of in its Raft log. LastIndex uint64 // Healthy is whether or not the server is healthy according to the current // Autopilot config. Healthy bool // Voter is whether this is a voting server. Voter bool // StableSince is the last time this server's Healthy value changed. StableSince time.Time } // OperatorHealthReply is a representation of the overall health of the cluster type OperatorHealthReply struct { // Healthy is true if all the servers in the cluster are healthy. Healthy bool // FailureTolerance is the number of healthy servers that could be lost without // an outage occurring. FailureTolerance int // Servers holds the health of each server. Servers []ServerHealth } // ReadableDuration is a duration type that is serialized to JSON in human readable format. type ReadableDuration time.Duration func NewReadableDuration(dur time.Duration) *ReadableDuration { d := ReadableDuration(dur) return &d } func (d *ReadableDuration) String() string { return d.Duration().String() } func (d *ReadableDuration) Duration() time.Duration { if d == nil { return time.Duration(0) } return time.Duration(*d) } func (d *ReadableDuration) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, d.Duration().String())), nil } func (d *ReadableDuration) UnmarshalJSON(raw []byte) (err error) { if d == nil { return fmt.Errorf("cannot unmarshal to nil pointer") } var dur time.Duration str := string(raw) if len(str) >= 2 && str[0] == '"' && str[len(str)-1] == '"' { // quoted string dur, err = time.ParseDuration(str[1 : len(str)-1]) if err != nil { return err } } else { // no quotes, not a string v, err := strconv.ParseFloat(str, 64) if err != nil { return err } dur = time.Duration(v) } *d = ReadableDuration(dur) return nil } // AutopilotGetConfiguration is used to query the current Autopilot configuration. func (op *Operator) AutopilotGetConfiguration(q *QueryOptions) (*AutopilotConfiguration, error) { r := op.c.newRequest("GET", "/v1/operator/autopilot/configuration") r.setQueryOptions(q) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out AutopilotConfiguration if err := decodeBody(resp, &out); err != nil { return nil, err } return &out, nil } // AutopilotSetConfiguration is used to set the current Autopilot configuration. func (op *Operator) AutopilotSetConfiguration(conf *AutopilotConfiguration, q *WriteOptions) error { r := op.c.newRequest("PUT", "/v1/operator/autopilot/configuration") r.setWriteOptions(q) r.obj = conf _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // AutopilotCASConfiguration is used to perform a Check-And-Set update on the // Autopilot configuration. The ModifyIndex value will be respected. Returns // true on success or false on failures. func (op *Operator) AutopilotCASConfiguration(conf *AutopilotConfiguration, q *WriteOptions) (bool, error) { r := op.c.newRequest("PUT", "/v1/operator/autopilot/configuration") r.setWriteOptions(q) r.params.Set("cas", strconv.FormatUint(conf.ModifyIndex, 10)) r.obj = conf _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return false, err } defer resp.Body.Close() var buf bytes.Buffer if _, err := io.Copy(&buf, resp.Body); err != nil { return false, fmt.Errorf("Failed to read response: %v", err) } res := strings.Contains(buf.String(), "true") return res, nil } // AutopilotServerHealth func (op *Operator) AutopilotServerHealth(q *QueryOptions) (*OperatorHealthReply, error) { r := op.c.newRequest("GET", "/v1/operator/autopilot/health") r.setQueryOptions(q) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out OperatorHealthReply if err := decodeBody(resp, &out); err != nil { return nil, err } return &out, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/operator_keyring.go�������������������������0000664�0000000�0000000�00000004322�13771713062�0026766�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // keyringRequest is used for performing Keyring operations type keyringRequest struct { Key string } // KeyringResponse is returned when listing the gossip encryption keys type KeyringResponse struct { // Whether this response is for a WAN ring WAN bool // The datacenter name this request corresponds to Datacenter string // Segment has the network segment this request corresponds to. Segment string // Messages has information or errors from serf Messages map[string]string `json:",omitempty"` // A map of the encryption keys to the number of nodes they're installed on Keys map[string]int // The total number of nodes in this ring NumNodes int } // KeyringInstall is used to install a new gossip encryption key into the cluster func (op *Operator) KeyringInstall(key string, q *WriteOptions) error { r := op.c.newRequest("POST", "/v1/operator/keyring") r.setWriteOptions(q) r.obj = keyringRequest{ Key: key, } _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // KeyringList is used to list the gossip keys installed in the cluster func (op *Operator) KeyringList(q *QueryOptions) ([]*KeyringResponse, error) { r := op.c.newRequest("GET", "/v1/operator/keyring") r.setQueryOptions(q) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out []*KeyringResponse if err := decodeBody(resp, &out); err != nil { return nil, err } return out, nil } // KeyringRemove is used to remove a gossip encryption key from the cluster func (op *Operator) KeyringRemove(key string, q *WriteOptions) error { r := op.c.newRequest("DELETE", "/v1/operator/keyring") r.setWriteOptions(q) r.obj = keyringRequest{ Key: key, } _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // KeyringUse is used to change the active gossip encryption key func (op *Operator) KeyringUse(key string, q *WriteOptions) error { r := op.c.newRequest("PUT", "/v1/operator/keyring") r.setWriteOptions(q) r.obj = keyringRequest{ Key: key, } _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/operator_license.go�������������������������0000664�0000000�0000000�00000005267�13771713062�0026751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "io/ioutil" "strings" "time" ) type License struct { // The unique identifier of the license LicenseID string `json:"license_id"` // The customer ID associated with the license CustomerID string `json:"customer_id"` // If set, an identifier that should be used to lock the license to a // particular site, cluster, etc. InstallationID string `json:"installation_id"` // The time at which the license was issued IssueTime time.Time `json:"issue_time"` // The time at which the license starts being valid StartTime time.Time `json:"start_time"` // The time after which the license expires ExpirationTime time.Time `json:"expiration_time"` // The time at which the license ceases to function and can // no longer be used in any capacity TerminationTime time.Time `json:"termination_time"` // The product the license is valid for Product string `json:"product"` // License Specific Flags Flags map[string]interface{} `json:"flags"` // List of features enabled by the license Features []string `json:"features"` } type LicenseReply struct { Valid bool License *License Warnings []string } func (op *Operator) LicenseGet(q *QueryOptions) (*LicenseReply, error) { var reply LicenseReply if _, err := op.c.query("/v1/operator/license", &reply, q); err != nil { return nil, err } else { return &reply, nil } } func (op *Operator) LicenseGetSigned(q *QueryOptions) (string, error) { r := op.c.newRequest("GET", "/v1/operator/license") r.params.Set("signed", "1") r.setQueryOptions(q) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return "", err } defer resp.Body.Close() data, err := ioutil.ReadAll(resp.Body) if err != nil { return "", err } return string(data), nil } // LicenseReset will reset the license to the builtin one if it is still valid. // If the builtin license is invalid, the current license stays active. func (op *Operator) LicenseReset(opts *WriteOptions) (*LicenseReply, error) { var reply LicenseReply r := op.c.newRequest("DELETE", "/v1/operator/license") r.setWriteOptions(opts) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() if err := decodeBody(resp, &reply); err != nil { return nil, err } return &reply, nil } func (op *Operator) LicensePut(license string, opts *WriteOptions) (*LicenseReply, error) { var reply LicenseReply r := op.c.newRequest("PUT", "/v1/operator/license") r.setWriteOptions(opts) r.body = strings.NewReader(license) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() if err := decodeBody(resp, &reply); err != nil { return nil, err } return &reply, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/operator_raft.go����������������������������0000664�0000000�0000000�00000005036�13771713062�0026255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // RaftServer has information about a server in the Raft configuration. type RaftServer struct { // ID is the unique ID for the server. These are currently the same // as the address, but they will be changed to a real GUID in a future // release of Consul. ID string // Node is the node name of the server, as known by Consul, or this // will be set to "(unknown)" otherwise. Node string // Address is the IP:port of the server, used for Raft communications. Address string // Leader is true if this server is the current cluster leader. Leader bool // Protocol version is the raft protocol version used by the server ProtocolVersion string // Voter is true if this server has a vote in the cluster. This might // be false if the server is staging and still coming online, or if // it's a non-voting server, which will be added in a future release of // Consul. Voter bool } // RaftConfiguration is returned when querying for the current Raft configuration. type RaftConfiguration struct { // Servers has the list of servers in the Raft configuration. Servers []*RaftServer // Index has the Raft index of this configuration. Index uint64 } // RaftGetConfiguration is used to query the current Raft peer set. func (op *Operator) RaftGetConfiguration(q *QueryOptions) (*RaftConfiguration, error) { r := op.c.newRequest("GET", "/v1/operator/raft/configuration") r.setQueryOptions(q) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var out RaftConfiguration if err := decodeBody(resp, &out); err != nil { return nil, err } return &out, nil } // RaftRemovePeerByAddress is used to kick a stale peer (one that it in the Raft // quorum but no longer known to Serf or the catalog) by address in the form of // "IP:port". func (op *Operator) RaftRemovePeerByAddress(address string, q *WriteOptions) error { r := op.c.newRequest("DELETE", "/v1/operator/raft/peer") r.setWriteOptions(q) r.params.Set("address", string(address)) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } // RaftRemovePeerByID is used to kick a stale peer (one that it in the Raft // quorum but no longer known to Serf or the catalog) by ID. func (op *Operator) RaftRemovePeerByID(id string, q *WriteOptions) error { r := op.c.newRequest("DELETE", "/v1/operator/raft/peer") r.setWriteOptions(q) r.params.Set("id", string(id)) _, resp, err := requireOK(op.c.doRequest(r)) if err != nil { return err } resp.Body.Close() return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/operator_segment.go�������������������������0000664�0000000�0000000�00000000441�13771713062�0026756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // SegmentList returns all the available LAN segments. func (op *Operator) SegmentList(q *QueryOptions) ([]string, *QueryMeta, error) { var out []string qm, err := op.c.query("/v1/operator/segment", &out, q) if err != nil { return nil, nil, err } return out, qm, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/prepared_query.go���������������������������0000664�0000000�0000000�00000016431�13771713062�0026436�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // QueryDatacenterOptions sets options about how we fail over if there are no // healthy nodes in the local datacenter. type QueryDatacenterOptions struct { // NearestN is set to the number of remote datacenters to try, based on // network coordinates. NearestN int // Datacenters is a fixed list of datacenters to try after NearestN. We // never try a datacenter multiple times, so those are subtracted from // this list before proceeding. Datacenters []string } // QueryDNSOptions controls settings when query results are served over DNS. type QueryDNSOptions struct { // TTL is the time to live for the served DNS results. TTL string } // ServiceQuery is used to query for a set of healthy nodes offering a specific // service. type ServiceQuery struct { // Service is the service to query. Service string // Namespace of the service to query Namespace string `json:",omitempty"` // Near allows baking in the name of a node to automatically distance- // sort from. The magic "_agent" value is supported, which sorts near // the agent which initiated the request by default. Near string // Failover controls what we do if there are no healthy nodes in the // local datacenter. Failover QueryDatacenterOptions // IgnoreCheckIDs is an optional list of health check IDs to ignore when // considering which nodes are healthy. It is useful as an emergency measure // to temporarily override some health check that is producing false negatives // for example. IgnoreCheckIDs []string // If OnlyPassing is true then we will only include nodes with passing // health checks (critical AND warning checks will cause a node to be // discarded) OnlyPassing bool // Tags are a set of required and/or disallowed tags. If a tag is in // this list it must be present. If the tag is preceded with "!" then // it is disallowed. Tags []string // NodeMeta is a map of required node metadata fields. If a key/value // pair is in this map it must be present on the node in order for the // service entry to be returned. NodeMeta map[string]string // ServiceMeta is a map of required service metadata fields. If a key/value // pair is in this map it must be present on the node in order for the // service entry to be returned. ServiceMeta map[string]string // Connect if true will filter the prepared query results to only // include Connect-capable services. These include both native services // and proxies for matching services. Note that if a proxy matches, // the constraints in the query above (Near, OnlyPassing, etc.) apply // to the _proxy_ and not the service being proxied. In practice, proxies // should be directly next to their services so this isn't an issue. Connect bool } // QueryTemplate carries the arguments for creating a templated query. type QueryTemplate struct { // Type specifies the type of the query template. Currently only // "name_prefix_match" is supported. This field is required. Type string // Regexp allows specifying a regex pattern to match against the name // of the query being executed. Regexp string } // PreparedQueryDefinition defines a complete prepared query. type PreparedQueryDefinition struct { // ID is this UUID-based ID for the query, always generated by Consul. ID string // Name is an optional friendly name for the query supplied by the // user. NOTE - if this feature is used then it will reduce the security // of any read ACL associated with this query/service since this name // can be used to locate nodes with supplying any ACL. Name string // Session is an optional session to tie this query's lifetime to. If // this is omitted then the query will not expire. Session string // Token is the ACL token used when the query was created, and it is // used when a query is subsequently executed. This token, or a token // with management privileges, must be used to change the query later. Token string // Service defines a service query (leaving things open for other types // later). Service ServiceQuery // DNS has options that control how the results of this query are // served over DNS. DNS QueryDNSOptions // Template is used to pass through the arguments for creating a // prepared query with an attached template. If a template is given, // interpolations are possible in other struct fields. Template QueryTemplate } // PreparedQueryExecuteResponse has the results of executing a query. type PreparedQueryExecuteResponse struct { // Service is the service that was queried. Service string // Namespace of the service that was queried Namespace string `json:",omitempty"` // Nodes has the nodes that were output by the query. Nodes []ServiceEntry // DNS has the options for serving these results over DNS. DNS QueryDNSOptions // Datacenter is the datacenter that these results came from. Datacenter string // Failovers is a count of how many times we had to query a remote // datacenter. Failovers int } // PreparedQuery can be used to query the prepared query endpoints. type PreparedQuery struct { c *Client } // PreparedQuery returns a handle to the prepared query endpoints. func (c *Client) PreparedQuery() *PreparedQuery { return &PreparedQuery{c} } // Create makes a new prepared query. The ID of the new query is returned. func (c *PreparedQuery) Create(query *PreparedQueryDefinition, q *WriteOptions) (string, *WriteMeta, error) { r := c.c.newRequest("POST", "/v1/query") r.setWriteOptions(q) r.obj = query rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return "", nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt var out struct{ ID string } if err := decodeBody(resp, &out); err != nil { return "", nil, err } return out.ID, wm, nil } // Update makes updates to an existing prepared query. func (c *PreparedQuery) Update(query *PreparedQueryDefinition, q *WriteOptions) (*WriteMeta, error) { return c.c.write("/v1/query/"+query.ID, query, nil, q) } // List is used to fetch all the prepared queries (always requires a management // token). func (c *PreparedQuery) List(q *QueryOptions) ([]*PreparedQueryDefinition, *QueryMeta, error) { var out []*PreparedQueryDefinition qm, err := c.c.query("/v1/query", &out, q) if err != nil { return nil, nil, err } return out, qm, nil } // Get is used to fetch a specific prepared query. func (c *PreparedQuery) Get(queryID string, q *QueryOptions) ([]*PreparedQueryDefinition, *QueryMeta, error) { var out []*PreparedQueryDefinition qm, err := c.c.query("/v1/query/"+queryID, &out, q) if err != nil { return nil, nil, err } return out, qm, nil } // Delete is used to delete a specific prepared query. func (c *PreparedQuery) Delete(queryID string, q *WriteOptions) (*WriteMeta, error) { r := c.c.newRequest("DELETE", "/v1/query/"+queryID) r.setWriteOptions(q) rtt, resp, err := requireOK(c.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() wm := &WriteMeta{} wm.RequestTime = rtt return wm, nil } // Execute is used to execute a specific prepared query. You can execute using // a query ID or name. func (c *PreparedQuery) Execute(queryIDOrName string, q *QueryOptions) (*PreparedQueryExecuteResponse, *QueryMeta, error) { var out *PreparedQueryExecuteResponse qm, err := c.c.query("/v1/query/"+queryIDOrName+"/execute", &out, q) if err != nil { return nil, nil, err } return out, qm, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/raw.go��������������������������������������0000664�0000000�0000000�00000001355�13771713062�0024177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // Raw can be used to do raw queries against custom endpoints type Raw struct { c *Client } // Raw returns a handle to query endpoints func (c *Client) Raw() *Raw { return &Raw{c} } // Query is used to do a GET request against an endpoint // and deserialize the response into an interface using // standard Consul conventions. func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) { return raw.c.query(endpoint, out, q) } // Write is used to do a PUT request against an endpoint // and serialize/deserialized using the standard Consul conventions. func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) { return raw.c.write(endpoint, in, out, q) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/semaphore.go��������������������������������0000664�0000000�0000000�00000034522�13771713062�0025373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "encoding/json" "fmt" "path" "sync" "time" ) const ( // DefaultSemaphoreSessionName is the Session Name we assign if none is provided DefaultSemaphoreSessionName = "Consul API Semaphore" // DefaultSemaphoreSessionTTL is the default session TTL if no Session is provided // when creating a new Semaphore. This is used because we do not have another // other check to depend upon. DefaultSemaphoreSessionTTL = "15s" // DefaultSemaphoreWaitTime is how long we block for at a time to check if semaphore // acquisition is possible. This affects the minimum time it takes to cancel // a Semaphore acquisition. DefaultSemaphoreWaitTime = 15 * time.Second // DefaultSemaphoreKey is the key used within the prefix to // use for coordination between all the contenders. DefaultSemaphoreKey = ".lock" // SemaphoreFlagValue is a magic flag we set to indicate a key // is being used for a semaphore. It is used to detect a potential // conflict with a lock. SemaphoreFlagValue = 0xe0f69a2baa414de0 ) var ( // ErrSemaphoreHeld is returned if we attempt to double lock ErrSemaphoreHeld = fmt.Errorf("Semaphore already held") // ErrSemaphoreNotHeld is returned if we attempt to unlock a semaphore // that we do not hold. ErrSemaphoreNotHeld = fmt.Errorf("Semaphore not held") // ErrSemaphoreInUse is returned if we attempt to destroy a semaphore // that is in use. ErrSemaphoreInUse = fmt.Errorf("Semaphore in use") // ErrSemaphoreConflict is returned if the flags on a key // used for a semaphore do not match expectation ErrSemaphoreConflict = fmt.Errorf("Existing key does not match semaphore use") ) // Semaphore is used to implement a distributed semaphore // using the Consul KV primitives. type Semaphore struct { c *Client opts *SemaphoreOptions isHeld bool sessionRenew chan struct{} lockSession string l sync.Mutex } // SemaphoreOptions is used to parameterize the Semaphore type SemaphoreOptions struct { Prefix string // Must be set and have write permissions Limit int // Must be set, and be positive Value []byte // Optional, value to associate with the contender entry Session string // Optional, created if not specified SessionName string // Optional, defaults to DefaultLockSessionName SessionTTL string // Optional, defaults to DefaultLockSessionTTL MonitorRetries int // Optional, defaults to 0 which means no retries MonitorRetryTime time.Duration // Optional, defaults to DefaultMonitorRetryTime SemaphoreWaitTime time.Duration // Optional, defaults to DefaultSemaphoreWaitTime SemaphoreTryOnce bool // Optional, defaults to false which means try forever Namespace string `json:",omitempty"` // Optional, defaults to API client config, namespace of ACL token, or "default" namespace } // semaphoreLock is written under the DefaultSemaphoreKey and // is used to coordinate between all the contenders. type semaphoreLock struct { // Limit is the integer limit of holders. This is used to // verify that all the holders agree on the value. Limit int // Holders is a list of all the semaphore holders. // It maps the session ID to true. It is used as a set effectively. Holders map[string]bool } // SemaphorePrefix is used to created a Semaphore which will operate // at the given KV prefix and uses the given limit for the semaphore. // The prefix must have write privileges, and the limit must be agreed // upon by all contenders. func (c *Client) SemaphorePrefix(prefix string, limit int) (*Semaphore, error) { opts := &SemaphoreOptions{ Prefix: prefix, Limit: limit, } return c.SemaphoreOpts(opts) } // SemaphoreOpts is used to create a Semaphore with the given options. // The prefix must have write privileges, and the limit must be agreed // upon by all contenders. If a Session is not provided, one will be created. func (c *Client) SemaphoreOpts(opts *SemaphoreOptions) (*Semaphore, error) { if opts.Prefix == "" { return nil, fmt.Errorf("missing prefix") } if opts.Limit <= 0 { return nil, fmt.Errorf("semaphore limit must be positive") } if opts.SessionName == "" { opts.SessionName = DefaultSemaphoreSessionName } if opts.SessionTTL == "" { opts.SessionTTL = DefaultSemaphoreSessionTTL } else { if _, err := time.ParseDuration(opts.SessionTTL); err != nil { return nil, fmt.Errorf("invalid SessionTTL: %v", err) } } if opts.MonitorRetryTime == 0 { opts.MonitorRetryTime = DefaultMonitorRetryTime } if opts.SemaphoreWaitTime == 0 { opts.SemaphoreWaitTime = DefaultSemaphoreWaitTime } s := &Semaphore{ c: c, opts: opts, } return s, nil } // Acquire attempts to reserve a slot in the semaphore, blocking until // success, interrupted via the stopCh or an error is encountered. // Providing a non-nil stopCh can be used to abort the attempt. // On success, a channel is returned that represents our slot. // This channel could be closed at any time due to session invalidation, // communication errors, operator intervention, etc. It is NOT safe to // assume that the slot is held until Release() unless the Session is specifically // created without any associated health checks. By default Consul sessions // prefer liveness over safety and an application must be able to handle // the session being lost. func (s *Semaphore) Acquire(stopCh <-chan struct{}) (<-chan struct{}, error) { // Hold the lock as we try to acquire s.l.Lock() defer s.l.Unlock() // Check if we already hold the semaphore if s.isHeld { return nil, ErrSemaphoreHeld } // Check if we need to create a session first s.lockSession = s.opts.Session if s.lockSession == "" { sess, err := s.createSession() if err != nil { return nil, fmt.Errorf("failed to create session: %v", err) } s.sessionRenew = make(chan struct{}) s.lockSession = sess session := s.c.Session() go session.RenewPeriodic(s.opts.SessionTTL, sess, nil, s.sessionRenew) // If we fail to acquire the lock, cleanup the session defer func() { if !s.isHeld { close(s.sessionRenew) s.sessionRenew = nil } }() } // Create the contender entry kv := s.c.KV() wOpts := WriteOptions{Namespace: s.opts.Namespace} made, _, err := kv.Acquire(s.contenderEntry(s.lockSession), &wOpts) if err != nil || !made { return nil, fmt.Errorf("failed to make contender entry: %v", err) } // Setup the query options qOpts := QueryOptions{ WaitTime: s.opts.SemaphoreWaitTime, Namespace: s.opts.Namespace, } start := time.Now() attempts := 0 WAIT: // Check if we should quit select { case <-stopCh: return nil, nil default: } // Handle the one-shot mode. if s.opts.SemaphoreTryOnce && attempts > 0 { elapsed := time.Since(start) if elapsed > s.opts.SemaphoreWaitTime { return nil, nil } // Query wait time should not exceed the semaphore wait time qOpts.WaitTime = s.opts.SemaphoreWaitTime - elapsed } attempts++ // Read the prefix pairs, meta, err := kv.List(s.opts.Prefix, &qOpts) if err != nil { return nil, fmt.Errorf("failed to read prefix: %v", err) } // Decode the lock lockPair := s.findLock(pairs) if lockPair.Flags != SemaphoreFlagValue { return nil, ErrSemaphoreConflict } lock, err := s.decodeLock(lockPair) if err != nil { return nil, err } // Verify we agree with the limit if lock.Limit != s.opts.Limit { return nil, fmt.Errorf("semaphore limit conflict (lock: %d, local: %d)", lock.Limit, s.opts.Limit) } // Prune the dead holders s.pruneDeadHolders(lock, pairs) // Check if the lock is held if len(lock.Holders) >= lock.Limit { qOpts.WaitIndex = meta.LastIndex goto WAIT } // Create a new lock with us as a holder lock.Holders[s.lockSession] = true newLock, err := s.encodeLock(lock, lockPair.ModifyIndex) if err != nil { return nil, err } // Attempt the acquisition didSet, _, err := kv.CAS(newLock, &wOpts) if err != nil { return nil, fmt.Errorf("failed to update lock: %v", err) } if !didSet { // Update failed, could have been a race with another contender, // retry the operation goto WAIT } // Watch to ensure we maintain ownership of the slot lockCh := make(chan struct{}) go s.monitorLock(s.lockSession, lockCh) // Set that we own the lock s.isHeld = true // Acquired! All done return lockCh, nil } // Release is used to voluntarily give up our semaphore slot. It is // an error to call this if the semaphore has not been acquired. func (s *Semaphore) Release() error { // Hold the lock as we try to release s.l.Lock() defer s.l.Unlock() // Ensure the lock is actually held if !s.isHeld { return ErrSemaphoreNotHeld } // Set that we no longer own the lock s.isHeld = false // Stop the session renew if s.sessionRenew != nil { defer func() { close(s.sessionRenew) s.sessionRenew = nil }() } // Get and clear the lock session lockSession := s.lockSession s.lockSession = "" // Remove ourselves as a lock holder kv := s.c.KV() key := path.Join(s.opts.Prefix, DefaultSemaphoreKey) wOpts := WriteOptions{Namespace: s.opts.Namespace} qOpts := QueryOptions{Namespace: s.opts.Namespace} READ: pair, _, err := kv.Get(key, &qOpts) if err != nil { return err } if pair == nil { pair = &KVPair{} } lock, err := s.decodeLock(pair) if err != nil { return err } // Create a new lock without us as a holder if _, ok := lock.Holders[lockSession]; ok { delete(lock.Holders, lockSession) newLock, err := s.encodeLock(lock, pair.ModifyIndex) if err != nil { return err } // Swap the locks didSet, _, err := kv.CAS(newLock, &wOpts) if err != nil { return fmt.Errorf("failed to update lock: %v", err) } if !didSet { goto READ } } // Destroy the contender entry contenderKey := path.Join(s.opts.Prefix, lockSession) if _, err := kv.Delete(contenderKey, &wOpts); err != nil { return err } return nil } // Destroy is used to cleanup the semaphore entry. It is not necessary // to invoke. It will fail if the semaphore is in use. func (s *Semaphore) Destroy() error { // Hold the lock as we try to acquire s.l.Lock() defer s.l.Unlock() // Check if we already hold the semaphore if s.isHeld { return ErrSemaphoreHeld } // List for the semaphore kv := s.c.KV() q := QueryOptions{Namespace: s.opts.Namespace} pairs, _, err := kv.List(s.opts.Prefix, &q) if err != nil { return fmt.Errorf("failed to read prefix: %v", err) } // Find the lock pair, bail if it doesn't exist lockPair := s.findLock(pairs) if lockPair.ModifyIndex == 0 { return nil } if lockPair.Flags != SemaphoreFlagValue { return ErrSemaphoreConflict } // Decode the lock lock, err := s.decodeLock(lockPair) if err != nil { return err } // Prune the dead holders s.pruneDeadHolders(lock, pairs) // Check if there are any holders if len(lock.Holders) > 0 { return ErrSemaphoreInUse } // Attempt the delete w := WriteOptions{Namespace: s.opts.Namespace} didRemove, _, err := kv.DeleteCAS(lockPair, &w) if err != nil { return fmt.Errorf("failed to remove semaphore: %v", err) } if !didRemove { return ErrSemaphoreInUse } return nil } // createSession is used to create a new managed session func (s *Semaphore) createSession() (string, error) { session := s.c.Session() se := &SessionEntry{ Name: s.opts.SessionName, TTL: s.opts.SessionTTL, Behavior: SessionBehaviorDelete, } w := WriteOptions{Namespace: s.opts.Namespace} id, _, err := session.Create(se, &w) if err != nil { return "", err } return id, nil } // contenderEntry returns a formatted KVPair for the contender func (s *Semaphore) contenderEntry(session string) *KVPair { return &KVPair{ Key: path.Join(s.opts.Prefix, session), Value: s.opts.Value, Session: session, Flags: SemaphoreFlagValue, } } // findLock is used to find the KV Pair which is used for coordination func (s *Semaphore) findLock(pairs KVPairs) *KVPair { key := path.Join(s.opts.Prefix, DefaultSemaphoreKey) for _, pair := range pairs { if pair.Key == key { return pair } } return &KVPair{Flags: SemaphoreFlagValue} } // decodeLock is used to decode a semaphoreLock from an // entry in Consul func (s *Semaphore) decodeLock(pair *KVPair) (*semaphoreLock, error) { // Handle if there is no lock if pair == nil || pair.Value == nil { return &semaphoreLock{ Limit: s.opts.Limit, Holders: make(map[string]bool), }, nil } l := &semaphoreLock{} if err := json.Unmarshal(pair.Value, l); err != nil { return nil, fmt.Errorf("lock decoding failed: %v", err) } return l, nil } // encodeLock is used to encode a semaphoreLock into a KVPair // that can be PUT func (s *Semaphore) encodeLock(l *semaphoreLock, oldIndex uint64) (*KVPair, error) { enc, err := json.Marshal(l) if err != nil { return nil, fmt.Errorf("lock encoding failed: %v", err) } pair := &KVPair{ Key: path.Join(s.opts.Prefix, DefaultSemaphoreKey), Value: enc, Flags: SemaphoreFlagValue, ModifyIndex: oldIndex, } return pair, nil } // pruneDeadHolders is used to remove all the dead lock holders func (s *Semaphore) pruneDeadHolders(lock *semaphoreLock, pairs KVPairs) { // Gather all the live holders alive := make(map[string]struct{}, len(pairs)) for _, pair := range pairs { if pair.Session != "" { alive[pair.Session] = struct{}{} } } // Remove any holders that are dead for holder := range lock.Holders { if _, ok := alive[holder]; !ok { delete(lock.Holders, holder) } } } // monitorLock is a long running routine to monitor a semaphore ownership // It closes the stopCh if we lose our slot. func (s *Semaphore) monitorLock(session string, stopCh chan struct{}) { defer close(stopCh) kv := s.c.KV() opts := QueryOptions{ RequireConsistent: true, Namespace: s.opts.Namespace, } WAIT: retries := s.opts.MonitorRetries RETRY: pairs, meta, err := kv.List(s.opts.Prefix, &opts) if err != nil { // If configured we can try to ride out a brief Consul unavailability // by doing retries. Note that we have to attempt the retry in a non- // blocking fashion so that we have a clean place to reset the retry // counter if service is restored. if retries > 0 && IsRetryableError(err) { time.Sleep(s.opts.MonitorRetryTime) retries-- opts.WaitIndex = 0 goto RETRY } return } lockPair := s.findLock(pairs) lock, err := s.decodeLock(lockPair) if err != nil { return } s.pruneDeadHolders(lock, pairs) if _, ok := lock.Holders[session]; ok { opts.WaitIndex = meta.LastIndex goto WAIT } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/session.go����������������������������������0000664�0000000�0000000�00000013613�13771713062�0025071�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "errors" "fmt" "time" ) const ( // SessionBehaviorRelease is the default behavior and causes // all associated locks to be released on session invalidation. SessionBehaviorRelease = "release" // SessionBehaviorDelete is new in Consul 0.5 and changes the // behavior to delete all associated locks on session invalidation. // It can be used in a way similar to Ephemeral Nodes in ZooKeeper. SessionBehaviorDelete = "delete" ) var ErrSessionExpired = errors.New("session expired") // SessionEntry represents a session in consul type SessionEntry struct { CreateIndex uint64 ID string Name string Node string LockDelay time.Duration Behavior string TTL string Namespace string `json:",omitempty"` // Deprecated for Consul Enterprise in v1.7.0. Checks []string // NodeChecks and ServiceChecks are new in Consul 1.7.0. // When associating checks with sessions, namespaces can be specified for service checks. NodeChecks []string ServiceChecks []ServiceCheck } type ServiceCheck struct { ID string Namespace string } // Session can be used to query the Session endpoints type Session struct { c *Client } // Session returns a handle to the session endpoints func (c *Client) Session() *Session { return &Session{c} } // CreateNoChecks is like Create but is used specifically to create // a session with no associated health checks. func (s *Session) CreateNoChecks(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) { body := make(map[string]interface{}) body["NodeChecks"] = []string{} if se != nil { if se.Name != "" { body["Name"] = se.Name } if se.Node != "" { body["Node"] = se.Node } if se.LockDelay != 0 { body["LockDelay"] = durToMsec(se.LockDelay) } if se.Behavior != "" { body["Behavior"] = se.Behavior } if se.TTL != "" { body["TTL"] = se.TTL } } return s.create(body, q) } // Create makes a new session. Providing a session entry can // customize the session. It can also be nil to use defaults. func (s *Session) Create(se *SessionEntry, q *WriteOptions) (string, *WriteMeta, error) { var obj interface{} if se != nil { body := make(map[string]interface{}) obj = body if se.Name != "" { body["Name"] = se.Name } if se.Node != "" { body["Node"] = se.Node } if se.LockDelay != 0 { body["LockDelay"] = durToMsec(se.LockDelay) } if len(se.Checks) > 0 { body["Checks"] = se.Checks } if len(se.NodeChecks) > 0 { body["NodeChecks"] = se.NodeChecks } if len(se.ServiceChecks) > 0 { body["ServiceChecks"] = se.ServiceChecks } if se.Behavior != "" { body["Behavior"] = se.Behavior } if se.TTL != "" { body["TTL"] = se.TTL } } return s.create(obj, q) } func (s *Session) create(obj interface{}, q *WriteOptions) (string, *WriteMeta, error) { var out struct{ ID string } wm, err := s.c.write("/v1/session/create", obj, &out, q) if err != nil { return "", nil, err } return out.ID, wm, nil } // Destroy invalidates a given session func (s *Session) Destroy(id string, q *WriteOptions) (*WriteMeta, error) { wm, err := s.c.write("/v1/session/destroy/"+id, nil, nil, q) if err != nil { return nil, err } return wm, nil } // Renew renews the TTL on a given session func (s *Session) Renew(id string, q *WriteOptions) (*SessionEntry, *WriteMeta, error) { r := s.c.newRequest("PUT", "/v1/session/renew/"+id) r.setWriteOptions(q) rtt, resp, err := s.c.doRequest(r) if err != nil { return nil, nil, err } defer resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} if resp.StatusCode == 404 { return nil, wm, nil } else if resp.StatusCode != 200 { return nil, nil, fmt.Errorf("Unexpected response code: %d", resp.StatusCode) } var entries []*SessionEntry if err := decodeBody(resp, &entries); err != nil { return nil, nil, fmt.Errorf("Failed to read response: %v", err) } if len(entries) > 0 { return entries[0], wm, nil } return nil, wm, nil } // RenewPeriodic is used to periodically invoke Session.Renew on a // session until a doneCh is closed. This is meant to be used in a long running // goroutine to ensure a session stays valid. func (s *Session) RenewPeriodic(initialTTL string, id string, q *WriteOptions, doneCh <-chan struct{}) error { ctx := q.Context() ttl, err := time.ParseDuration(initialTTL) if err != nil { return err } waitDur := ttl / 2 lastRenewTime := time.Now() var lastErr error for { if time.Since(lastRenewTime) > ttl { return lastErr } select { case <-time.After(waitDur): entry, _, err := s.Renew(id, q) if err != nil { waitDur = time.Second lastErr = err continue } if entry == nil { return ErrSessionExpired } // Handle the server updating the TTL ttl, _ = time.ParseDuration(entry.TTL) waitDur = ttl / 2 lastRenewTime = time.Now() case <-doneCh: // Attempt a session destroy s.Destroy(id, q) return nil case <-ctx.Done(): // Bail immediately since attempting the destroy would // use the canceled context in q, which would just bail. return ctx.Err() } } } // Info looks up a single session func (s *Session) Info(id string, q *QueryOptions) (*SessionEntry, *QueryMeta, error) { var entries []*SessionEntry qm, err := s.c.query("/v1/session/info/"+id, &entries, q) if err != nil { return nil, nil, err } if len(entries) > 0 { return entries[0], qm, nil } return nil, qm, nil } // List gets sessions for a node func (s *Session) Node(node string, q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) { var entries []*SessionEntry qm, err := s.c.query("/v1/session/node/"+node, &entries, q) if err != nil { return nil, nil, err } return entries, qm, nil } // List gets all active sessions func (s *Session) List(q *QueryOptions) ([]*SessionEntry, *QueryMeta, error) { var entries []*SessionEntry qm, err := s.c.query("/v1/session/list", &entries, q) if err != nil { return nil, nil, err } return entries, qm, nil } ���������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/snapshot.go���������������������������������0000664�0000000�0000000�00000002361�13771713062�0025243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "io" ) // Snapshot can be used to query the /v1/snapshot endpoint to take snapshots of // Consul's internal state and restore snapshots for disaster recovery. type Snapshot struct { c *Client } // Snapshot returns a handle that exposes the snapshot endpoints. func (c *Client) Snapshot() *Snapshot { return &Snapshot{c} } // Save requests a new snapshot and provides an io.ReadCloser with the snapshot // data to save. If this doesn't return an error, then it's the responsibility // of the caller to close it. Only a subset of the QueryOptions are supported: // Datacenter, AllowStale, and Token. func (s *Snapshot) Save(q *QueryOptions) (io.ReadCloser, *QueryMeta, error) { r := s.c.newRequest("GET", "/v1/snapshot") r.setQueryOptions(q) rtt, resp, err := requireOK(s.c.doRequest(r)) if err != nil { return nil, nil, err } qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt return resp.Body, qm, nil } // Restore streams in an existing snapshot and attempts to restore it. func (s *Snapshot) Restore(q *WriteOptions, in io.Reader) error { r := s.c.newRequest("PUT", "/v1/snapshot") r.body = in r.setWriteOptions(q) _, _, err := requireOK(s.c.doRequest(r)) if err != nil { return err } return nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/status.go�����������������������������������0000664�0000000�0000000�00000001644�13771713062�0024732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // Status can be used to query the Status endpoints type Status struct { c *Client } // Status returns a handle to the status endpoints func (c *Client) Status() *Status { return &Status{c} } // Leader is used to query for a known leader func (s *Status) Leader() (string, error) { r := s.c.newRequest("GET", "/v1/status/leader") _, resp, err := requireOK(s.c.doRequest(r)) if err != nil { return "", err } defer resp.Body.Close() var leader string if err := decodeBody(resp, &leader); err != nil { return "", err } return leader, nil } // Peers is used to query for a known raft peers func (s *Status) Peers() ([]string, error) { r := s.c.newRequest("GET", "/v1/status/peers") _, resp, err := requireOK(s.c.doRequest(r)) if err != nil { return nil, err } defer resp.Body.Close() var peers []string if err := decodeBody(resp, &peers); err != nil { return nil, err } return peers, nil } ��������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/consul/api/txn.go��������������������������������������0000664�0000000�0000000�00000015005�13771713062�0024214�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "fmt" "io" "net/http" ) // Txn is used to manipulate the Txn API type Txn struct { c *Client } // Txn is used to return a handle to the K/V apis func (c *Client) Txn() *Txn { return &Txn{c} } // TxnOp is the internal format we send to Consul. Currently only K/V and // check operations are supported. type TxnOp struct { KV *KVTxnOp Node *NodeTxnOp Service *ServiceTxnOp Check *CheckTxnOp } // TxnOps is a list of transaction operations. type TxnOps []*TxnOp // TxnResult is the internal format we receive from Consul. type TxnResult struct { KV *KVPair Node *Node Service *CatalogService Check *HealthCheck } // TxnResults is a list of TxnResult objects. type TxnResults []*TxnResult // TxnError is used to return information about an operation in a transaction. type TxnError struct { OpIndex int What string } // TxnErrors is a list of TxnError objects. type TxnErrors []*TxnError // TxnResponse is the internal format we receive from Consul. type TxnResponse struct { Results TxnResults Errors TxnErrors } // KVOp constants give possible operations available in a transaction. type KVOp string const ( KVSet KVOp = "set" KVDelete KVOp = "delete" KVDeleteCAS KVOp = "delete-cas" KVDeleteTree KVOp = "delete-tree" KVCAS KVOp = "cas" KVLock KVOp = "lock" KVUnlock KVOp = "unlock" KVGet KVOp = "get" KVGetTree KVOp = "get-tree" KVCheckSession KVOp = "check-session" KVCheckIndex KVOp = "check-index" KVCheckNotExists KVOp = "check-not-exists" ) // KVTxnOp defines a single operation inside a transaction. type KVTxnOp struct { Verb KVOp Key string Value []byte Flags uint64 Index uint64 Session string Namespace string `json:",omitempty"` } // KVTxnOps defines a set of operations to be performed inside a single // transaction. type KVTxnOps []*KVTxnOp // KVTxnResponse has the outcome of a transaction. type KVTxnResponse struct { Results []*KVPair Errors TxnErrors } // SessionOp constants give possible operations available in a transaction. type SessionOp string const ( SessionDelete SessionOp = "delete" ) // SessionTxnOp defines a single operation inside a transaction. type SessionTxnOp struct { Verb SessionOp Session Session } // NodeOp constants give possible operations available in a transaction. type NodeOp string const ( NodeGet NodeOp = "get" NodeSet NodeOp = "set" NodeCAS NodeOp = "cas" NodeDelete NodeOp = "delete" NodeDeleteCAS NodeOp = "delete-cas" ) // NodeTxnOp defines a single operation inside a transaction. type NodeTxnOp struct { Verb NodeOp Node Node } // ServiceOp constants give possible operations available in a transaction. type ServiceOp string const ( ServiceGet ServiceOp = "get" ServiceSet ServiceOp = "set" ServiceCAS ServiceOp = "cas" ServiceDelete ServiceOp = "delete" ServiceDeleteCAS ServiceOp = "delete-cas" ) // ServiceTxnOp defines a single operation inside a transaction. type ServiceTxnOp struct { Verb ServiceOp Node string Service AgentService } // CheckOp constants give possible operations available in a transaction. type CheckOp string const ( CheckGet CheckOp = "get" CheckSet CheckOp = "set" CheckCAS CheckOp = "cas" CheckDelete CheckOp = "delete" CheckDeleteCAS CheckOp = "delete-cas" ) // CheckTxnOp defines a single operation inside a transaction. type CheckTxnOp struct { Verb CheckOp Check HealthCheck } // Txn is used to apply multiple Consul operations in a single, atomic transaction. // // Note that Go will perform the required base64 encoding on the values // automatically because the type is a byte slice. Transactions are defined as a // list of operations to perform, using the different fields in the TxnOp structure // to define operations. If any operation fails, none of the changes are applied // to the state store. // // Even though this is generally a write operation, we take a QueryOptions input // and return a QueryMeta output. If the transaction contains only read ops, then // Consul will fast-path it to a different endpoint internally which supports // consistency controls, but not blocking. If there are write operations then // the request will always be routed through raft and any consistency settings // will be ignored. // // Here's an example: // // ops := KVTxnOps{ // &KVTxnOp{ // Verb: KVLock, // Key: "test/lock", // Session: "adf4238a-882b-9ddc-4a9d-5b6758e4159e", // Value: []byte("hello"), // }, // &KVTxnOp{ // Verb: KVGet, // Key: "another/key", // }, // &CheckTxnOp{ // Verb: CheckSet, // HealthCheck: HealthCheck{ // Node: "foo", // CheckID: "redis:a", // Name: "Redis Health Check", // Status: "passing", // }, // } // } // ok, response, _, err := kv.Txn(&ops, nil) // // If there is a problem making the transaction request then an error will be // returned. Otherwise, the ok value will be true if the transaction succeeded // or false if it was rolled back. The response is a structured return value which // will have the outcome of the transaction. Its Results member will have entries // for each operation. For KV operations, Deleted keys will have a nil entry in the // results, and to save space, the Value of each key in the Results will be nil // unless the operation is a KVGet. If the transaction was rolled back, the Errors // member will have entries referencing the index of the operation that failed // along with an error message. func (t *Txn) Txn(txn TxnOps, q *QueryOptions) (bool, *TxnResponse, *QueryMeta, error) { return t.c.txn(txn, q) } func (c *Client) txn(txn TxnOps, q *QueryOptions) (bool, *TxnResponse, *QueryMeta, error) { r := c.newRequest("PUT", "/v1/txn") r.setQueryOptions(q) r.obj = txn rtt, resp, err := c.doRequest(r) if err != nil { return false, nil, nil, err } defer resp.Body.Close() qm := &QueryMeta{} parseQueryMeta(resp, qm) qm.RequestTime = rtt if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusConflict { var txnResp TxnResponse if err := decodeBody(resp, &txnResp); err != nil { return false, nil, nil, err } return resp.StatusCode == http.StatusOK, &txnResp, qm, nil } var buf bytes.Buffer if _, err := io.Copy(&buf, resp.Body); err != nil { return false, nil, nil, fmt.Errorf("Failed to read response: %v", err) } return false, nil, nil, fmt.Errorf("Failed request: %s", buf.String()) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023315�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/LICENSE�����������������������������������0000664�0000000�0000000�00000037151�13771713062�0024331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/cidr/�������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024236�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/cidr/host.go������������������������������0000664�0000000�0000000�00000002342�13771713062�0025543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package cidr import ( "fmt" "net" "github.com/apparentlymart/go-cidr/cidr" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/gocty" ) // HostFunc is a function that calculates a full host IP address within a given // IP network address prefix. var HostFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "prefix", Type: cty.String, }, { Name: "hostnum", Type: cty.Number, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { var hostNum int if err := gocty.FromCtyValue(args[1], &hostNum); err != nil { return cty.UnknownVal(cty.String), err } _, network, err := net.ParseCIDR(args[0].AsString()) if err != nil { return cty.UnknownVal(cty.String), fmt.Errorf("invalid CIDR expression: %s", err) } ip, err := cidr.Host(network, hostNum) if err != nil { return cty.UnknownVal(cty.String), err } return cty.StringVal(ip.String()), nil }, }) // Host calculates a full host IP address within a given IP network address prefix. func Host(prefix, hostnum cty.Value) (cty.Value, error) { return HostFunc.Call([]cty.Value{prefix, hostnum}) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/cidr/netmask.go���������������������������0000664�0000000�0000000�00000001622�13771713062�0026230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package cidr import ( "fmt" "net" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // NetmaskFunc is a function that converts an IPv4 address prefix given in CIDR // notation into a subnet mask address. var NetmaskFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "prefix", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { _, network, err := net.ParseCIDR(args[0].AsString()) if err != nil { return cty.UnknownVal(cty.String), fmt.Errorf("invalid CIDR expression: %s", err) } return cty.StringVal(net.IP(network.Mask).String()), nil }, }) // Netmask converts an IPv4 address prefix given in CIDR notation into a subnet mask address. func Netmask(prefix cty.Value) (cty.Value, error) { return NetmaskFunc.Call([]cty.Value{prefix}) } ��������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/cidr/subnet.go����������������������������0000664�0000000�0000000�00000003442�13771713062�0026070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package cidr import ( "fmt" "net" "github.com/apparentlymart/go-cidr/cidr" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/gocty" ) // SubnetFunc is a function that calculates a subnet address within a given // IP network address prefix. var SubnetFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "prefix", Type: cty.String, }, { Name: "newbits", Type: cty.Number, }, { Name: "netnum", Type: cty.Number, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { var newbits int if err := gocty.FromCtyValue(args[1], &newbits); err != nil { return cty.UnknownVal(cty.String), err } var netnum int if err := gocty.FromCtyValue(args[2], &netnum); err != nil { return cty.UnknownVal(cty.String), err } _, network, err := net.ParseCIDR(args[0].AsString()) if err != nil { return cty.UnknownVal(cty.String), fmt.Errorf("invalid CIDR expression: %s", err) } // For portability with 32-bit systems where the subnet number will be // a 32-bit int, we only allow extension of 32 bits in one call even if // we're running on a 64-bit machine. (Of course, this is significant // only for IPv6.) if newbits > 32 { return cty.UnknownVal(cty.String), fmt.Errorf("may not extend prefix by more than 32 bits") } newNetwork, err := cidr.Subnet(network, newbits, netnum) if err != nil { return cty.UnknownVal(cty.String), err } return cty.StringVal(newNetwork.String()), nil }, }) // Subnet calculates a subnet address within a given IP network address prefix. func Subnet(prefix, newbits, netnum cty.Value) (cty.Value, error) { return SubnetFunc.Call([]cty.Value{prefix, newbits, netnum}) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/cidr/subnets.go���������������������������0000664�0000000�0000000�00000006454�13771713062�0026261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package cidr import ( "net" "github.com/apparentlymart/go-cidr/cidr" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/gocty" ) // SubnetsFunc is similar to SubnetFunc but calculates many consecutive subnet // addresses at once, rather than just a single subnet extension. var SubnetsFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "prefix", Type: cty.String, }, }, VarParam: &function.Parameter{ Name: "newbits", Type: cty.Number, }, Type: function.StaticReturnType(cty.List(cty.String)), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { _, network, err := net.ParseCIDR(args[0].AsString()) if err != nil { return cty.UnknownVal(cty.String), function.NewArgErrorf(0, "invalid CIDR expression: %s", err) } startPrefixLen, _ := network.Mask.Size() prefixLengthArgs := args[1:] if len(prefixLengthArgs) == 0 { return cty.ListValEmpty(cty.String), nil } var firstLength int if err := gocty.FromCtyValue(prefixLengthArgs[0], &firstLength); err != nil { return cty.UnknownVal(cty.String), function.NewArgError(1, err) } firstLength += startPrefixLen retVals := make([]cty.Value, len(prefixLengthArgs)) current, _ := cidr.PreviousSubnet(network, firstLength) for i, lengthArg := range prefixLengthArgs { var length int if err := gocty.FromCtyValue(lengthArg, &length); err != nil { return cty.UnknownVal(cty.String), function.NewArgError(i+1, err) } if length < 1 { return cty.UnknownVal(cty.String), function.NewArgErrorf(i+1, "must extend prefix by at least one bit") } // For portability with 32-bit systems where the subnet number // will be a 32-bit int, we only allow extension of 32 bits in // one call even if we're running on a 64-bit machine. // (Of course, this is significant only for IPv6.) if length > 32 { return cty.UnknownVal(cty.String), function.NewArgErrorf(i+1, "may not extend prefix by more than 32 bits") } length += startPrefixLen if length > (len(network.IP) * 8) { protocol := "IP" switch len(network.IP) * 8 { case 32: protocol = "IPv4" case 128: protocol = "IPv6" } return cty.UnknownVal(cty.String), function.NewArgErrorf(i+1, "would extend prefix to %d bits, which is too long for an %s address", length, protocol) } next, rollover := cidr.NextSubnet(current, length) if rollover || !network.Contains(next.IP) { // If we run out of suffix bits in the base CIDR prefix then // NextSubnet will start incrementing the prefix bits, which // we don't allow because it would then allocate addresses // outside of the caller's given prefix. return cty.UnknownVal(cty.String), function.NewArgErrorf(i+1, "not enough remaining address space for a subnet with a prefix of %d bits after %s", length, current.String()) } current = next retVals[i] = cty.StringVal(current.String()) } return cty.ListVal(retVals), nil }, }) // Subnets calculates a sequence of consecutive subnet prefixes that may be of // different prefix lengths under a common base prefix. func Subnets(prefix cty.Value, newbits ...cty.Value) (cty.Value, error) { args := make([]cty.Value, len(newbits)+1) args[0] = prefix copy(args[1:], newbits) return SubnetsFunc.Call(args) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/collection/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025450�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/collection/coalesce.go��������������������0000664�0000000�0000000�00000003406�13771713062�0027560�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package collection import ( "errors" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" ) // Coalesce takes any number of arguments and returns the first one that isn't // empty. func Coalesce(args ...cty.Value) (cty.Value, error) { return CoalesceFunc.Call(args) } // CoalesceFunc constructs a function that takes any number of arguments and // returns the first one that isn't empty. This function was copied from go-cty // stdlib and modified so that it returns the first *non-empty* non-null // element from a sequence, instead of merely the first non-null. var CoalesceFunc = function.New(&function.Spec{ Params: []function.Parameter{}, VarParam: &function.Parameter{ Name: "vals", Type: cty.DynamicPseudoType, AllowUnknown: true, AllowDynamicType: true, AllowNull: true, }, Type: func(args []cty.Value) (ret cty.Type, err error) { argTypes := make([]cty.Type, len(args)) for i, val := range args { argTypes[i] = val.Type() } retType, _ := convert.UnifyUnsafe(argTypes) if retType == cty.NilType { return cty.NilType, errors.New("all arguments must have the same type") } return retType, nil }, Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { for _, argVal := range args { // We already know this will succeed because of the checks in our // Type func above argVal, _ = convert.Convert(argVal, retType) if !argVal.IsKnown() { return cty.UnknownVal(retType), nil } if argVal.IsNull() { continue } if retType == cty.String && argVal.RawEquals(cty.StringVal("")) { continue } return argVal, nil } return cty.NilVal, errors.New("no non-null, non-empty-string arguments") }, }) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/crypto/�����������������������������������0000775�0000000�0000000�00000000000�13771713062�0024635�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/crypto/bcrypt.go��������������������������0000664�0000000�0000000�00000003024�13771713062�0026466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package crypto import ( "fmt" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/gocty" "golang.org/x/crypto/bcrypt" ) // BcryptFunc is a function that computes a hash of the given string using the // Blowfish cipher. var BcryptFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "str", Type: cty.String, }, }, VarParam: &function.Parameter{ Name: "cost", Type: cty.Number, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { defaultCost := 10 if len(args) > 1 { var val int if err := gocty.FromCtyValue(args[1], &val); err != nil { return cty.UnknownVal(cty.String), err } defaultCost = val } if len(args) > 2 { return cty.UnknownVal(cty.String), fmt.Errorf("bcrypt() takes no more than two arguments") } input := args[0].AsString() out, err := bcrypt.GenerateFromPassword([]byte(input), defaultCost) if err != nil { return cty.UnknownVal(cty.String), fmt.Errorf("error occured generating password %s", err.Error()) } return cty.StringVal(string(out)), nil }, }) // Bcrypt computes a hash of the given string using the Blowfish cipher, // returning a string in the Modular Crypt Format usually expected in the // shadow password file on many Unix systems. func Bcrypt(str cty.Value, cost ...cty.Value) (cty.Value, error) { args := make([]cty.Value, len(cost)+1) args[0] = str copy(args[1:], cost) return BcryptFunc.Call(args) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/crypto/hash.go����������������������������0000664�0000000�0000000�00000001112�13771713062�0026102�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package crypto import ( "hash" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) func makeStringHashFunction(hf func() hash.Hash, enc func([]byte) string) function.Function { return function.New(&function.Spec{ Params: []function.Parameter{ { Name: "str", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { s := args[0].AsString() h := hf() h.Write([]byte(s)) rv := enc(h.Sum(nil)) return cty.StringVal(rv), nil }, }) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/crypto/md5.go�����������������������������0000664�0000000�0000000�00000000700�13771713062�0025646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package crypto import ( "crypto/md5" "encoding/hex" "github.com/zclconf/go-cty/cty" ) // Md5Func is a function that computes the MD5 hash of a given string and // encodes it with hexadecimal digits. var Md5Func = makeStringHashFunction(md5.New, hex.EncodeToString) // Md5 computes the MD5 hash of a given string and encodes it with hexadecimal // digits. func Md5(str cty.Value) (cty.Value, error) { return Md5Func.Call([]cty.Value{str}) } ����������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/crypto/rsa.go�����������������������������0000664�0000000�0000000�00000003233�13771713062�0025752�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package crypto import ( "crypto/rsa" "crypto/x509" "encoding/base64" "encoding/pem" "fmt" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // RsaDecryptFunc is a function that decrypts an RSA-encrypted ciphertext. var RsaDecryptFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "ciphertext", Type: cty.String, }, { Name: "privatekey", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { s := args[0].AsString() key := args[1].AsString() b, err := base64.StdEncoding.DecodeString(s) if err != nil { return cty.UnknownVal(cty.String), fmt.Errorf("failed to decode input %q: cipher text must be base64-encoded", s) } block, _ := pem.Decode([]byte(key)) if block == nil { return cty.UnknownVal(cty.String), fmt.Errorf("failed to parse key: no key found") } if block.Headers["Proc-Type"] == "4,ENCRYPTED" { return cty.UnknownVal(cty.String), fmt.Errorf( "failed to parse key: password protected keys are not supported. Please decrypt the key prior to use", ) } x509Key, err := x509.ParsePKCS1PrivateKey(block.Bytes) if err != nil { return cty.UnknownVal(cty.String), err } out, err := rsa.DecryptPKCS1v15(nil, x509Key, b) if err != nil { return cty.UnknownVal(cty.String), err } return cty.StringVal(string(out)), nil }, }) // RsaDecrypt decrypts an RSA-encrypted ciphertext, returning the corresponding // cleartext. func RsaDecrypt(ciphertext, privatekey cty.Value) (cty.Value, error) { return RsaDecryptFunc.Call([]cty.Value{ciphertext, privatekey}) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/crypto/sha.go�����������������������������0000664�0000000�0000000�00000002345�13771713062�0025743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package crypto import ( "crypto/sha1" "crypto/sha256" "crypto/sha512" "encoding/hex" "github.com/zclconf/go-cty/cty" ) // Sha1Func is a function that computes the SHA1 hash of a given string and // encodes it with hexadecimal digits. var Sha1Func = makeStringHashFunction(sha1.New, hex.EncodeToString) // Sha256Func is a function that computes the SHA256 hash of a given string and // encodes it with hexadecimal digits. var Sha256Func = makeStringHashFunction(sha256.New, hex.EncodeToString) // Sha512Func is a function that computes the SHA512 hash of a given string and // encodes it with hexadecimal digits. var Sha512Func = makeStringHashFunction(sha512.New, hex.EncodeToString) // Sha1 computes the SHA1 hash of a given string and encodes it with // hexadecimal digits. func Sha1(str cty.Value) (cty.Value, error) { return Sha1Func.Call([]cty.Value{str}) } // Sha256 computes the SHA256 hash of a given string and encodes it with // hexadecimal digits. func Sha256(str cty.Value) (cty.Value, error) { return Sha256Func.Call([]cty.Value{str}) } // Sha512 computes the SHA512 hash of a given string and encodes it with // hexadecimal digits. func Sha512(str cty.Value) (cty.Value, error) { return Sha512Func.Call([]cty.Value{str}) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/encoding/���������������������������������0000775�0000000�0000000�00000000000�13771713062�0025103�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/encoding/base64.go������������������������0000664�0000000�0000000�00000004525�13771713062�0026524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package encoding import ( "encoding/base64" "fmt" "log" "unicode/utf8" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // Base64DecodeFunc is a function that decodes a string containing a base64 sequence. var Base64DecodeFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "str", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { s := args[0].AsString() sDec, err := base64.StdEncoding.DecodeString(s) if err != nil { return cty.UnknownVal(cty.String), fmt.Errorf("failed to decode base64 data '%s'", s) } if !utf8.Valid([]byte(sDec)) { log.Printf("[DEBUG] the result of decoding the the provided string is not valid UTF-8: %s", sDec) return cty.UnknownVal(cty.String), fmt.Errorf("the result of decoding the the provided string is not valid UTF-8") } return cty.StringVal(string(sDec)), nil }, }) // Base64EncodeFunc is a function that encodes a string to a base64 sequence. var Base64EncodeFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "str", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return cty.StringVal(base64.StdEncoding.EncodeToString([]byte(args[0].AsString()))), nil }, }) // Base64Decode decodes a string containing a base64 sequence. // // Terraform uses the "standard" Base64 alphabet as defined in RFC 4648 section 4. // // Strings in the Terraform language are sequences of unicode characters rather // than bytes, so this function will also interpret the resulting bytes as // UTF-8. If the bytes after Base64 decoding are _not_ valid UTF-8, this function // produces an error. func Base64Decode(str cty.Value) (cty.Value, error) { return Base64DecodeFunc.Call([]cty.Value{str}) } // Base64Encode applies Base64 encoding to a string. // // Terraform uses the "standard" Base64 alphabet as defined in RFC 4648 section 4. // // Strings in the Terraform language are sequences of unicode characters rather // than bytes, so this function will first encode the characters from the string // as UTF-8, and then apply Base64 encoding to the result. func Base64Encode(str cty.Value) (cty.Value, error) { return Base64EncodeFunc.Call([]cty.Value{str}) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/encoding/url.go���������������������������0000664�0000000�0000000�00000002003�13771713062�0026227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package encoding import ( "net/url" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // URLEncodeFunc is a function that applies URL encoding to a given string. var URLEncodeFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "str", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return cty.StringVal(url.QueryEscape(args[0].AsString())), nil }, }) // URLEncode applies URL encoding to a given string. // // This function identifies characters in the given string that would have a // special meaning when included as a query string argument in a URL and // escapes them using RFC 3986 "percent encoding". // // If the given string contains non-ASCII characters, these are first encoded as // UTF-8 and then percent encoding is applied separately to each UTF-8 byte. func URLEncode(str cty.Value) (cty.Value, error) { return URLEncodeFunc.Call([]cty.Value{str}) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/filesystem/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025501�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/filesystem/filesystem.go������������������0000664�0000000�0000000�00000023100�13771713062�0030210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package filesystem import ( "encoding/base64" "fmt" "io/ioutil" "os" "path/filepath" "unicode/utf8" "github.com/bmatcuk/doublestar" homedir "github.com/mitchellh/go-homedir" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // MakeFileFunc constructs a function that takes a file path and returns the // contents of that file, either directly as a string (where valid UTF-8 is // required) or as a string containing base64 bytes. func MakeFileFunc(baseDir string, encBase64 bool) function.Function { return function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { path := args[0].AsString() src, err := readFileBytes(baseDir, path) if err != nil { return cty.UnknownVal(cty.String), err } switch { case encBase64: enc := base64.StdEncoding.EncodeToString(src) return cty.StringVal(enc), nil default: if !utf8.Valid(src) { return cty.UnknownVal(cty.String), fmt.Errorf("contents of %s are not valid UTF-8; use the filebase64 function to obtain the Base64 encoded contents or the other file functions (e.g. filemd5, filesha256) to obtain file hashing results instead", path) } return cty.StringVal(string(src)), nil } }, }) } // MakeFileExistsFunc is a function that takes a path and determines whether a // file exists at that path. // // MakeFileExistsFunc will try to expand a path starting with a '~' to the home // folder using github.com/mitchellh/go-homedir func MakeFileExistsFunc(baseDir string) function.Function { return function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, }, Type: function.StaticReturnType(cty.Bool), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { path := args[0].AsString() path, err := homedir.Expand(path) if err != nil { return cty.UnknownVal(cty.Bool), fmt.Errorf("failed to expand ~: %s", err) } if !filepath.IsAbs(path) { path = filepath.Join(baseDir, path) } // Ensure that the path is canonical for the host OS path = filepath.Clean(path) fi, err := os.Stat(path) if err != nil { if os.IsNotExist(err) { return cty.False, nil } return cty.UnknownVal(cty.Bool), fmt.Errorf("failed to stat %s", path) } if fi.Mode().IsRegular() { return cty.True, nil } return cty.False, fmt.Errorf("%s is not a regular file, but %q", path, fi.Mode().String()) }, }) } // MakeFileSetFunc is a function that takes a glob pattern // and enumerates a file set from that pattern func MakeFileSetFunc(baseDir string) function.Function { return function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, { Name: "pattern", Type: cty.String, }, }, Type: function.StaticReturnType(cty.Set(cty.String)), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { path := args[0].AsString() pattern := args[1].AsString() if !filepath.IsAbs(path) { path = filepath.Join(baseDir, path) } // Join the path to the glob pattern, while ensuring the full // pattern is canonical for the host OS. The joined path is // automatically cleaned during this operation. pattern = filepath.Join(path, pattern) matches, err := doublestar.Glob(pattern) if err != nil { return cty.UnknownVal(cty.Set(cty.String)), fmt.Errorf("failed to glob pattern (%s): %s", pattern, err) } var matchVals []cty.Value for _, match := range matches { fi, err := os.Stat(match) if err != nil { return cty.UnknownVal(cty.Set(cty.String)), fmt.Errorf("failed to stat (%s): %s", match, err) } if !fi.Mode().IsRegular() { continue } // Remove the path and file separator from matches. match, err = filepath.Rel(path, match) if err != nil { return cty.UnknownVal(cty.Set(cty.String)), fmt.Errorf("failed to trim path of match (%s): %s", match, err) } // Replace any remaining file separators with forward slash (/) // separators for cross-system compatibility. match = filepath.ToSlash(match) matchVals = append(matchVals, cty.StringVal(match)) } if len(matchVals) == 0 { return cty.SetValEmpty(cty.String), nil } return cty.SetVal(matchVals), nil }, }) } // BasenameFunc is a function that takes a string containing a filesystem path // and removes all except the last portion from it. var BasenameFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return cty.StringVal(filepath.Base(args[0].AsString())), nil }, }) // DirnameFunc is a function that takes a string containing a filesystem path // and removes the last portion from it. var DirnameFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return cty.StringVal(filepath.Dir(args[0].AsString())), nil }, }) // AbsPathFunc is a function that converts a filesystem path to an absolute path var AbsPathFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { absPath, err := filepath.Abs(args[0].AsString()) return cty.StringVal(filepath.ToSlash(absPath)), err }, }) // PathExpandFunc is a function that expands a leading ~ character to the current user's home directory. var PathExpandFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "path", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { homePath, err := homedir.Expand(args[0].AsString()) return cty.StringVal(homePath), err }, }) func readFileBytes(baseDir, path string) ([]byte, error) { path, err := homedir.Expand(path) if err != nil { return nil, fmt.Errorf("failed to expand ~: %s", err) } if !filepath.IsAbs(path) { path = filepath.Join(baseDir, path) } // Ensure that the path is canonical for the host OS path = filepath.Clean(path) src, err := ioutil.ReadFile(path) if err != nil { // ReadFile does not return Terraform-user-friendly error // messages, so we'll provide our own. if os.IsNotExist(err) { return nil, fmt.Errorf("no file exists at %s", path) } return nil, fmt.Errorf("failed to read %s", path) } return src, nil } // File reads the contents of the file at the given path. // // The file must contain valid UTF-8 bytes, or this function will return an error. // // The underlying function implementation works relative to a particular base // directory, so this wrapper takes a base directory string and uses it to // construct the underlying function before calling it. func File(baseDir string, path cty.Value) (cty.Value, error) { fn := MakeFileFunc(baseDir, false) return fn.Call([]cty.Value{path}) } // FileExists determines whether a file exists at the given path. // // The underlying function implementation works relative to a particular base // directory, so this wrapper takes a base directory string and uses it to // construct the underlying function before calling it. func FileExists(baseDir string, path cty.Value) (cty.Value, error) { fn := MakeFileExistsFunc(baseDir) return fn.Call([]cty.Value{path}) } // FileSet enumerates a set of files given a glob pattern // // The underlying function implementation works relative to a particular base // directory, so this wrapper takes a base directory string and uses it to // construct the underlying function before calling it. func FileSet(baseDir string, path, pattern cty.Value) (cty.Value, error) { fn := MakeFileSetFunc(baseDir) return fn.Call([]cty.Value{path, pattern}) } // Basename takes a string containing a filesystem path and removes all except the last portion from it. // // The underlying function implementation works only with the path string and does not access the filesystem itself. // It is therefore unable to take into account filesystem features such as symlinks. // // If the path is empty then the result is ".", representing the current working directory. func Basename(path cty.Value) (cty.Value, error) { return BasenameFunc.Call([]cty.Value{path}) } // Dirname takes a string containing a filesystem path and removes the last portion from it. // // The underlying function implementation works only with the path string and does not access the filesystem itself. // It is therefore unable to take into account filesystem features such as symlinks. // // If the path is empty then the result is ".", representing the current working directory. func Dirname(path cty.Value) (cty.Value, error) { return DirnameFunc.Call([]cty.Value{path}) } // Pathexpand takes a string that might begin with a `~` segment, and if so it replaces that segment with // the current user's home directory path. // // The underlying function implementation works only with the path string and does not access the filesystem itself. // It is therefore unable to take into account filesystem features such as symlinks. // // If the leading segment in the path is not `~` then the given path is returned unmodified. func Pathexpand(path cty.Value) (cty.Value, error) { return PathExpandFunc.Call([]cty.Value{path}) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/uuid/�������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024263�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/uuid/uuid_v4.go���������������������������0000664�0000000�0000000�00000001307�13771713062�0026172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package uuid import ( "github.com/google/uuid" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) var V4Func = function.New(&function.Spec{ Params: []function.Parameter{}, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { uuid, err := uuid.NewRandom() if err != nil { return cty.UnknownVal(cty.String), err } return cty.StringVal(uuid.String()), nil }, }) // V4 generates and returns a Type-4 UUID in the standard hexadecimal string // format. // // This is not a "pure" function: it will generate a different result for each // call. func V4() (cty.Value, error) { return V4Func.Call(nil) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-cty-funcs/uuid/uuid_v5.go���������������������������0000664�0000000�0000000�00000002553�13771713062�0026177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package uuid import ( "fmt" uuidv5 "github.com/google/uuid" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) var V5Func = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "namespace", Type: cty.String, }, { Name: "name", Type: cty.String, }, }, Type: function.StaticReturnType(cty.String), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { var namespace uuidv5.UUID switch { case args[0].AsString() == "dns": namespace = uuidv5.NameSpaceDNS case args[0].AsString() == "url": namespace = uuidv5.NameSpaceURL case args[0].AsString() == "oid": namespace = uuidv5.NameSpaceOID case args[0].AsString() == "x500": namespace = uuidv5.NameSpaceX500 default: if namespace, err = uuidv5.Parse(args[0].AsString()); err != nil { return cty.UnknownVal(cty.String), fmt.Errorf("uuidv5() doesn't support namespace %s (%v)", args[0].AsString(), err) } } val := args[1].AsString() return cty.StringVal(uuidv5.NewSHA1(namespace, []byte(val)).String()), nil }, }) // V5 generates and returns a Type-5 UUID in the standard hexadecimal // string format. // // This is not a "pure" function: it will generate a different result for each // call. func V5(namespace cty.Value, name cty.Value) (cty.Value, error) { return V5Func.Call([]cty.Value{namespace, name}) } �����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022674�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/gcs/�����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023450�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/gcs/v2/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023777�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/gcs/v2/LICENSE�������������������������������0000664�0000000�0000000�00000037151�13771713062�0025013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/gcs/v2/detect_gcs.go�������������������������0000664�0000000�0000000�00000001616�13771713062�0026436�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package gcs import ( "fmt" "net/url" "strings" ) // Detector implements Detector to detect GCS URLs and turn // them into URLs that the GCSGetter can understand. type Detector struct{} func (d *Detector) Detect(src, _ string) (string, bool, error) { if len(src) == 0 { return "", false, nil } if strings.Contains(src, "googleapis.com/") { return d.detectHTTP(src) } return "", false, nil } func (d *Detector) detectHTTP(src string) (string, bool, error) { parts := strings.Split(src, "/") if len(parts) < 5 { return "", false, fmt.Errorf( "URL is not a valid GCS URL") } version := parts[2] bucket := parts[3] object := strings.Join(parts[4:], "/") url, err := url.Parse(fmt.Sprintf("https://www.googleapis.com/storage/%s/%s/%s", version, bucket, object)) if err != nil { return "", false, fmt.Errorf("error parsing GCS URL: %s", err) } return url.String(), true, nil } ������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/gcs/v2/get_gcs.go����������������������������0000664�0000000�0000000�00000011050�13771713062�0025736�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package gcs import ( "context" "fmt" "net/url" "os" "path/filepath" "strings" "cloud.google.com/go/storage" "github.com/hashicorp/go-getter/v2" "google.golang.org/api/iterator" ) // Getter is a Getter implementation that will download a module from // a GCS bucket. type Getter struct {} func (g *Getter) Mode(ctx context.Context, u *url.URL) (getter.Mode, error) { // Parse URL bucket, object, err := g.parseURL(u) if err != nil { return 0, err } client, err := storage.NewClient(ctx) if err != nil { return 0, err } iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) for { obj, err := iter.Next() if err != nil && err != iterator.Done { return 0, err } if err == iterator.Done { break } if strings.HasSuffix(obj.Name, "/") { // A directory matched the prefix search, so this must be a directory return getter.ModeDir, nil } else if obj.Name != object { // A file matched the prefix search and doesn't have the same name // as the query, so this must be a directory return getter.ModeDir, nil } } // There are no directories or subdirectories, and if a match was returned, // it was exactly equal to the prefix search. So return File mode return getter.ModeFile, nil } func (g *Getter) Get(ctx context.Context, req *getter.Request) error { // Parse URL bucket, object, err := g.parseURL(req.URL()) if err != nil { return err } // Remove destination if it already exists _, err = os.Stat(req.Dst) if err != nil && !os.IsNotExist(err) { return err } if err == nil { // Remove the destination if err := os.RemoveAll(req.Dst); err != nil { return err } } // Create all the parent directories if err := os.MkdirAll(filepath.Dir(req.Dst), 0755); err != nil { return err } client, err := storage.NewClient(ctx) if err != nil { return err } // Iterate through all matching objects. iter := client.Bucket(bucket).Objects(ctx, &storage.Query{Prefix: object}) for { obj, err := iter.Next() if err != nil && err != iterator.Done { return err } if err == iterator.Done { break } if !strings.HasSuffix(obj.Name, "/") { // Get the object destination path objDst, err := filepath.Rel(object, obj.Name) if err != nil { return err } objDst = filepath.Join(req.Dst, objDst) // Download the matching object. err = g.getObject(ctx, client, objDst, bucket, obj.Name) if err != nil { return err } } } return nil } func (g *Getter) GetFile(ctx context.Context, req *getter.Request) error { // Parse URL bucket, object, err := g.parseURL(req.URL()) if err != nil { return err } client, err := storage.NewClient(ctx) if err != nil { return err } return g.getObject(ctx, client, req.Dst, bucket, object) } func (g *Getter) getObject(ctx context.Context, client *storage.Client, dst, bucket, object string) error { rc, err := client.Bucket(bucket).Object(object).NewReader(ctx) if err != nil { return err } defer rc.Close() // Create all the parent directories if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { return err } f, err := os.Create(dst) if err != nil { return err } defer f.Close() _, err = getter.Copy(ctx, f, rc) return err } func (g *Getter) parseURL(u *url.URL) (bucket, path string, err error) { if strings.Contains(u.Host, "googleapis.com") { hostParts := strings.Split(u.Host, ".") if len(hostParts) != 3 { err = fmt.Errorf("URL is not a valid GCS URL") return } pathParts := strings.SplitN(u.Path, "/", 5) if len(pathParts) != 5 { err = fmt.Errorf("URL is not a valid GCS URL") return } bucket = pathParts[3] path = pathParts[4] } return } func (g *Getter) Detect(req *getter.Request) (bool, error) { src := req.Src if len(src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being forced if !g.validScheme(req.Forced) { // Current getter is not the forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } // Valid url with a scheme that is not valid for current getter return false, nil } src, ok, err := new(Detector).Detect(src, req.Pwd) if err != nil { return ok, err } if ok { req.Src = src return ok, nil } return false, nil } func (g *Getter) validScheme(scheme string) bool { return scheme == "gcs" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/gcs/v2/go.mod��������������������������������0000664�0000000�0000000�00000000376�13771713062�0025113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/go-getter/gcs/v2 go 1.14 replace github.com/hashicorp/go-getter/v2 => ../ require ( cloud.google.com/go/storage v1.6.0 github.com/hashicorp/go-getter/v2 v2.0.0-20200511090339-3107ec4af37a google.golang.org/api v0.21.0 ) ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/gcs/v2/go.sum��������������������������������0000664�0000000�0000000�00000073137�13771713062�0025145�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0 h1:UDpwYIwla4jHGzZJaEJYx1tOejbgSoNqsAfHAUYe2r8= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-getter v1.4.1 h1:3A2Mh8smGFcf5M+gmcv898mZdrxpseik45IpcyISLsA= github.com/hashicorp/go-getter v1.4.1/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367 h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0 h1:MsuvTghUPjX762sGLnGsxC3HM0B5r83wEtYcYR8/vRs= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2 h1:L/G4KZvrQn7FWLN/LlulBtBzrLUhqjiGfTWWDmrh+IQ= golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.21.0 h1:zS+Q/CJJnVlXpXQVIz+lH0ZT2lBuT2ac7XD8Y/3w6hY= google.golang.org/api v0.21.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 h1:YzfoEYWbODU5Fbt37+h7X16BWQbad7Q4S6gclTKFXM8= google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/s3/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023221�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/s3/v2/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023550�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/s3/v2/LICENSE��������������������������������0000664�0000000�0000000�00000037151�13771713062�0024564�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/s3/v2/detect_s3.go���������������������������0000664�0000000�0000000�00000003045�13771713062�0025756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package s3 import ( "fmt" "net/url" "strings" ) // Detector implements Detector to detect S3 URLs and turn // them into URLs that the S3 getter can understand. type Detector struct{} func (d *Detector) Detect(src, _ string) (string, bool, error) { if len(src) == 0 { return "", false, nil } if strings.Contains(src, ".amazonaws.com/") { return d.detectHTTP(src) } return "", false, nil } func (d *Detector) detectHTTP(src string) (string, bool, error) { parts := strings.Split(src, "/") if len(parts) < 2 { return "", false, fmt.Errorf( "URL is not a valid S3 URL") } hostParts := strings.Split(parts[0], ".") if len(hostParts) == 3 { return d.detectPathStyle(hostParts[0], parts[1:]) } else if len(hostParts) == 4 { return d.detectVhostStyle(hostParts[1], hostParts[0], parts[1:]) } else { return "", false, fmt.Errorf( "URL is not a valid S3 URL") } } func (d *Detector) detectPathStyle(region string, parts []string) (string, bool, error) { urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s", region, strings.Join(parts, "/")) url, err := url.Parse(urlStr) if err != nil { return "", false, fmt.Errorf("error parsing S3 URL: %s", err) } return url.String(), true, nil } func (d *Detector) detectVhostStyle(region, bucket string, parts []string) (string, bool, error) { urlStr := fmt.Sprintf("https://%s.amazonaws.com/%s/%s", region, bucket, strings.Join(parts, "/")) url, err := url.Parse(urlStr) if err != nil { return "", false, fmt.Errorf("error parsing S3 URL: %s", err) } return url.String(), true, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/s3/v2/get_s3.go������������������������������0000664�0000000�0000000�00000016567�13771713062�0025302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package s3 import ( "context" "fmt" "net/url" "os" "path/filepath" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds" "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/go-getter/v2" ) // Getter is a Getter implementation that will download a module from // a S3 bucket. type Getter struct{} func (g *Getter) Mode(ctx context.Context, u *url.URL) (getter.Mode, error) { // Parse URL region, bucket, path, _, creds, err := g.parseUrl(u) if err != nil { return 0, err } // Create client config config := g.getAWSConfig(region, u, creds) sess := session.New(config) client := s3.New(sess) // List the object(s) at the given prefix req := &s3.ListObjectsInput{ Bucket: aws.String(bucket), Prefix: aws.String(path), } resp, err := client.ListObjects(req) if err != nil { return 0, err } for _, o := range resp.Contents { // Use file mode on exact match. if *o.Key == path { return getter.ModeFile, nil } // Use dir mode if child keys are found. if strings.HasPrefix(*o.Key, path+"/") { return getter.ModeDir, nil } } // There was no match, so just return file mode. The download is going // to fail but we will let S3 return the proper error later. return getter.ModeFile, nil } func (g *Getter) Get(ctx context.Context, req *getter.Request) error { // Parse URL region, bucket, path, _, creds, err := g.parseUrl(req.URL()) if err != nil { return err } // Remove destination if it already exists _, err = os.Stat(req.Dst) if err != nil && !os.IsNotExist(err) { return err } if err == nil { // Remove the destination if err := os.RemoveAll(req.Dst); err != nil { return err } } // Create all the parent directories if err := os.MkdirAll(filepath.Dir(req.Dst), 0755); err != nil { return err } config := g.getAWSConfig(region, req.URL(), creds) sess := session.New(config) client := s3.New(sess) // List files in path, keep listing until no more objects are found lastMarker := "" hasMore := true for hasMore { s3Req := &s3.ListObjectsInput{ Bucket: aws.String(bucket), Prefix: aws.String(path), } if lastMarker != "" { s3Req.Marker = aws.String(lastMarker) } resp, err := client.ListObjects(s3Req) if err != nil { return err } hasMore = aws.BoolValue(resp.IsTruncated) // Get each object storing each file relative to the destination path for _, object := range resp.Contents { lastMarker = aws.StringValue(object.Key) objPath := aws.StringValue(object.Key) // If the key ends with a backslash assume it is a directory and ignore if strings.HasSuffix(objPath, "/") { continue } // Get the object destination path objDst, err := filepath.Rel(path, objPath) if err != nil { return err } objDst = filepath.Join(req.Dst, objDst) if err := g.getObject(ctx, client, objDst, bucket, objPath, ""); err != nil { return err } } } return nil } func (g *Getter) GetFile(ctx context.Context, req *getter.Request) error { region, bucket, path, version, creds, err := g.parseUrl(req.URL()) if err != nil { return err } config := g.getAWSConfig(region, req.URL(), creds) sess := session.New(config) client := s3.New(sess) return g.getObject(ctx, client, req.Dst, bucket, path, version) } func (g *Getter) getObject(ctx context.Context, client *s3.S3, dst, bucket, key, version string) error { req := &s3.GetObjectInput{ Bucket: aws.String(bucket), Key: aws.String(key), } if version != "" { req.VersionId = aws.String(version) } resp, err := client.GetObject(req) if err != nil { return err } // Create all the parent directories if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { return err } f, err := os.Create(dst) if err != nil { return err } defer f.Close() _, err = getter.Copy(ctx, f, resp.Body) return err } func (g *Getter) getAWSConfig(region string, url *url.URL, creds *credentials.Credentials) *aws.Config { conf := &aws.Config{} if creds == nil { // Grab the metadata URL metadataURL := os.Getenv("AWS_METADATA_URL") if metadataURL == "" { metadataURL = "http://169.254.169.254:80/latest" } creds = credentials.NewChainCredentials( []credentials.Provider{ &credentials.EnvProvider{}, &credentials.SharedCredentialsProvider{Filename: "", Profile: ""}, &ec2rolecreds.EC2RoleProvider{ Client: ec2metadata.New(session.New(&aws.Config{ Endpoint: aws.String(metadataURL), })), }, }) } if creds != nil { conf.Endpoint = &url.Host conf.S3ForcePathStyle = aws.Bool(true) if url.Scheme == "http" { conf.DisableSSL = aws.Bool(true) } } conf.Credentials = creds if region != "" { conf.Region = aws.String(region) } return conf } func (g *Getter) parseUrl(u *url.URL) (region, bucket, path, version string, creds *credentials.Credentials, err error) { // This just check whether we are dealing with S3 or // any other S3 compliant service. S3 has a predictable // url as others do not if strings.Contains(u.Host, "amazonaws.com") { // Expected host style: s3.amazonaws.com. They always have 3 parts, // although the first may differ if we're accessing a specific region. hostParts := strings.Split(u.Host, ".") if len(hostParts) != 3 { err = fmt.Errorf("URL is not a valid S3 URL") return } // Parse the region out of the first part of the host region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") if region == "" { region = "us-east-1" } pathParts := strings.SplitN(u.Path, "/", 3) if len(pathParts) != 3 { err = fmt.Errorf("URL is not a valid S3 URL") return } bucket = pathParts[1] path = pathParts[2] version = u.Query().Get("version") } else { pathParts := strings.SplitN(u.Path, "/", 3) if len(pathParts) != 3 { err = fmt.Errorf("URL is not a valid S3 complaint URL") return } bucket = pathParts[1] path = pathParts[2] version = u.Query().Get("version") region = u.Query().Get("region") if region == "" { region = "us-east-1" } } _, hasAwsId := u.Query()["aws_access_key_id"] _, hasAwsSecret := u.Query()["aws_access_key_secret"] _, hasAwsToken := u.Query()["aws_access_token"] if hasAwsId || hasAwsSecret || hasAwsToken { creds = credentials.NewStaticCredentials( u.Query().Get("aws_access_key_id"), u.Query().Get("aws_access_key_secret"), u.Query().Get("aws_access_token"), ) } return } func (g *Getter) Detect(req *getter.Request) (bool, error) { src := req.Src if len(src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being forced if !g.validScheme(req.Forced) { // Current getter is not the forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } // Valid url with a scheme that is not valid for current getter return false, nil } src, ok, err := new(Detector).Detect(src, req.Pwd) if err != nil { return ok, err } if ok { req.Src = src } return ok, nil } func (g *Getter) validScheme(scheme string) bool { return scheme == "s3" } �����������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/s3/v2/go.mod���������������������������������0000664�0000000�0000000�00000000335�13771713062�0024657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/go-getter/s3/v2 go 1.14 replace github.com/hashicorp/go-getter/v2 => ../ require ( github.com/aws/aws-sdk-go v1.30.8 github.com/hashicorp/go-getter/v2 v2.0.0-20200511090339-3107ec4af37a ) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/s3/v2/go.sum���������������������������������0000664�0000000�0000000�00000036010�13771713062�0024703�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.30.8 h1:4BHbh8K3qKmcnAgToZ2LShldRF9inoqIBccpCLNCy3I= github.com/aws/aws-sdk-go v1.30.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-getter v1.4.1 h1:3A2Mh8smGFcf5M+gmcv898mZdrxpseik45IpcyISLsA= github.com/hashicorp/go-getter v1.4.1/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023223�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/.gitignore��������������������������������0000664�0000000�0000000�00000000007�13771713062�0025210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������vendor �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/Dockerfile��������������������������������0000664�0000000�0000000�00000000356�13771713062�0025221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Dockerfile to create a go-getter container with smbclient dependency that is used by the get_smb.go tests FROM golang:latest COPY . /go-getter WORKDIR /go-getter RUN go mod download RUN apt-get update RUN apt-get -y install smbclient ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/Dockerfile-smbserver����������������������0000664�0000000�0000000�00000000705�13771713062�0027225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Dockerfile to create a smb server that is used by the get_smb.go tests FROM dperson/samba # Create shared folders RUN mkdir -p /public && mkdir -p /private # Create shared files and directories under the shared folders (data and mnt) RUN echo 'Hello' > /public/file.txt && mkdir -p /public/subdir && echo 'Hello' > /public/subdir/file.txt RUN echo 'Hello' > /private/file.txt && mkdir -p /private/subdir && echo 'Hello' > /private/subdir/file.txt �����������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/LICENSE�����������������������������������0000664�0000000�0000000�00000037151�13771713062�0024237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/Makefile����������������������������������0000664�0000000�0000000�00000000420�13771713062�0024657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������start-smb: @docker-compose build docker-compose up -d samba smbtests-prepare: @docker-compose build @docker-compose up -d @sleep 60 smbtests: @docker cp ./ gogetter:/go-getter/ @docker exec -it gogetter bash -c "env ACC_SMB_TEST=1 go test -v ./... -run=TestSmb_" ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/README.md���������������������������������0000664�0000000�0000000�00000040127�13771713062�0024506�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# go-getter [![CircleCI](https://circleci.com/gh/hashicorp/go-getter/tree/master.svg?style=svg)][circleci] [![Build status](https://ci.appveyor.com/api/projects/status/ulq3qr43n62croyq/branch/master?svg=true)][appveyor] [![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] [circleci]: https://circleci.com/gh/hashicorp/go-getter/tree/master [godocs]: http://godoc.org/github.com/hashicorp/go-getter [appveyor]: https://ci.appveyor.com/project/hashicorp/go-getter/branch/master go-getter is a library for Go (golang) for downloading files or directories from various sources using a URL as the primary form of input. The power of this library is being flexible in being able to download from a number of different sources (file paths, Git, HTTP, Mercurial, etc.) using a single string as input. This removes the burden of knowing how to download from a variety of sources from the implementer. The concept of a _detector_ automatically turns invalid URLs into proper URLs. For example: "github.com/hashicorp/go-getter" would turn into a Git URL. Or "./foo" would turn into a file URL. These are extensible. This library is used by [Terraform](https://terraform.io) for downloading modules and [Nomad](https://nomadproject.io) for downloading binaries. ## Installation and Usage Package documentation can be found on [GoDoc](http://godoc.org/github.com/hashicorp/go-getter). Installation can be done with a normal `go get`: ``` $ go get github.com/hashicorp/go-getter ``` go-getter also has a command you can use to test URL strings: ``` $ go install github.com/hashicorp/go-getter/cmd/go-getter ... $ go-getter github.com/foo/bar ./foo ... ``` The command is useful for verifying URL structures. ## URL Format go-getter uses a single string URL as input to download from a variety of protocols. go-getter has various "tricks" with this URL to do certain things. This section documents the URL format. ### Supported Protocols and Detectors **Protocols** are used to download files/directories using a specific mechanism. Example protocols are Git and HTTP. **Detectors** are used to transform a valid or invalid URL into another URL if it matches a certain pattern. Example: "github.com/user/repo" is automatically transformed into a fully valid Git URL. This allows go-getter to be very user friendly. go-getter out of the box supports the following protocols. Additional protocols can be augmented at runtime by implementing the `Getter` interface. * Local files * Git * Mercurial * HTTP * Amazon S3 * Google GCP * SMB In addition to the above protocols, go-getter has what are called "detectors." These take a URL and attempt to automatically choose the best protocol for it, which might involve even changing the protocol. The following detection is built-in by default: * File paths such as "./foo" are automatically changed to absolute file URLs. * GitHub URLs, such as "github.com/mitchellh/vagrant" are automatically changed to Git protocol over HTTP. * BitBucket URLs, such as "bitbucket.org/mitchellh/vagrant" are automatically changed to a Git or mercurial protocol using the BitBucket API. ### Forced Protocol In some cases, the protocol to use is ambiguous depending on the source URL. For example, "http://github.com/mitchellh/vagrant.git" could reference an HTTP URL or a Git URL. Forced protocol syntax is used to disambiguate this URL. Forced protocol can be done by prefixing the URL with the protocol followed by double colons. For example: `git::http://github.com/mitchellh/vagrant.git` would download the given HTTP URL using the Git protocol. Forced protocols will also override any detectors. In the absence of a forced protocol, detectors may be run on the URL, transforming the protocol anyways. The above example would've used the Git protocol either way since the Git detector would've detected it was a GitHub URL. ### Protocol-Specific Options Each protocol can support protocol-specific options to configure that protocol. For example, the `git` protocol supports specifying a `ref` query parameter that tells it what ref to checkout for that Git repository. The options are specified as query parameters on the URL (or URL-like string) given to go-getter. Using the Git example above, the URL below is a valid input to go-getter: github.com/hashicorp/go-getter?ref=abcd1234 The protocol-specific options are documented below the URL format section. But because they are part of the URL, we point it out here so you know they exist. ### Subdirectories If you want to download only a specific subdirectory from a downloaded directory, you can specify a subdirectory after a double-slash `//`. go-getter will first download the URL specified _before_ the double-slash (as if you didn't specify a double-slash), but will then copy the path after the double slash into the target directory. For example, if you're downloading this GitHub repository, but you only want to download the `testdata` directory, you can do the following: ``` https://github.com/hashicorp/go-getter.git//testdata ``` If you downloaded this to the `/tmp` directory, then the file `/tmp/archive.gz` would exist. Notice that this file is in the `testdata` directory in this repository, but because we specified a subdirectory, go-getter automatically copied only that directory contents. Subdirectory paths may also use filesystem glob patterns. The path must match _exactly one_ entry or go-getter will return an error. This is useful if you're not sure the exact directory name but it follows a predictable naming structure. For example, the following URL would also work: ``` https://github.com/hashicorp/go-getter.git//test-* ``` ### Checksumming For file downloads of any protocol, go-getter can automatically verify a checksum for you. Note that checksumming only works for downloading files, not directories, but checksumming will work for any protocol. To checksum a file, append a `checksum` query parameter to the URL. go-getter will parse out this query parameter automatically and use it to verify the checksum. The parameter value can be in the format of `type:value` or just `value`, where type is "md5", "sha1", "sha256", "sha512" or "file" . The "value" should be the actual checksum value or download URL for "file". When `type` part is omitted, type will be guessed based on the length of the checksum string. Examples: ``` ./foo.txt?checksum=md5:b7d96c89d09d9e204f5fedc4d5d55b21 ``` ``` ./foo.txt?checksum=b7d96c89d09d9e204f5fedc4d5d55b21 ``` ``` ./foo.txt?checksum=file:./foo.txt.sha256sum ``` When checksumming from a file - ex: with `checksum=file:url` - go-getter will get the file linked in the URL after `file:` using the same configuration. For example, in `file:http://releases.ubuntu.com/cosmic/MD5SUMS` go-getter will download a checksum file under the aforementioned url using the http protocol. All protocols supported by go-getter can be used. The checksum file will be downloaded in a temporary file then parsed. The destination of the temporary file can be changed by setting system specific environment variables: `TMPDIR` for unix; `TMP`, `TEMP` or `USERPROFILE` on windows. Read godoc of [os.TempDir](https://golang.org/pkg/os/#TempDir) for more information on the temporary directory selection. Content of files are expected to be BSD or GNU style. Once go-getter is done with the checksum file; it is deleted. The checksum query parameter is never sent to the backend protocol implementation. It is used at a higher level by go-getter itself. If the destination file exists and the checksums match: download will be skipped. ### Unarchiving go-getter will automatically unarchive files into a file or directory based on the extension of the file being requested (over any protocol). This works for both file and directory downloads. go-getter looks for an `archive` query parameter to specify the format of the archive. If this isn't specified, go-getter will use the extension of the path to see if it appears archived. Unarchiving can be explicitly disabled by setting the `archive` query parameter to `false`. The following archive formats are supported: * `tar.gz` and `tgz` * `tar.bz2` and `tbz2` * `tar.xz` and `txz` * `zip` * `gz` * `bz2` * `xz` For example, an example URL is shown below: ``` ./foo.zip ``` This will automatically be inferred to be a ZIP file and will be extracted. You can also be explicit about the archive type: ``` ./some/other/path?archive=zip ``` And finally, you can disable archiving completely: ``` ./some/path?archive=false ``` You can combine unarchiving with the other features of go-getter such as checksumming. The special `archive` query parameter will be removed from the URL before going to the final protocol downloader. ## Protocol-Specific Options This section documents the protocol-specific options that can be specified for go-getter. These options should be appended to the input as normal query parameters ([HTTP headers](#headers) are an exception to this, however). Depending on the usage of go-getter, applications may provide alternate ways of inputting options. For example, [Nomad](https://www.nomadproject.io) provides a nice options block for specifying options rather than in the URL. ## General (All Protocols) The options below are available to all protocols: * `archive` - The archive format to use to unarchive this file, or "" (empty string) to disable unarchiving. For more details, see the complete section on archive support above. * `checksum` - Checksum to verify the downloaded file or archive. See the entire section on checksumming above for format and more details. * `filename` - When in file download mode, allows specifying the name of the downloaded file on disk. Has no effect in directory mode. ### Local Files (`file`) None ### Git (`git`) * `ref` - The Git ref to checkout. This is a ref, so it can point to a commit SHA, a branch name, etc. If it is a named ref such as a branch name, go-getter will update it to the latest on each get. * `sshkey` - An SSH private key to use during clones. The provided key must be a base64-encoded string. For example, to generate a suitable `sshkey` from a private key file on disk, you would run `base64 -w0 <file>`. **Note**: Git 2.3+ is required to use this feature. * `depth` - The Git clone depth. The provided number specifies the last `n` revisions to clone from the repository. The `git` getter accepts both URL-style SSH addresses like `git::ssh://git@example.com/foo/bar`, and "scp-style" addresses like `git::git@example.com/foo/bar`. In the latter case, omitting the `git::` force prefix is allowed if the username prefix is exactly `git@`. The "scp-style" addresses _cannot_ be used in conjunction with the `ssh://` scheme prefix, because in that case the colon is used to mark an optional port number to connect on, rather than to delimit the path from the host. ### Mercurial (`hg`) * `rev` - The Mercurial revision to checkout. ### HTTP (`http`) #### Basic Authentication To use HTTP basic authentication with go-getter, simply prepend `username:password@` to the hostname in the URL such as `https://Aladdin:OpenSesame@www.example.com/index.html`. All special characters, including the username and password, must be URL encoded. #### Headers Optional request headers can be added by supplying them in a custom [`HttpGetter`](https://godoc.org/github.com/hashicorp/go-getter#HttpGetter) (_not_ as query parameters like most other options). These headers will be sent out on every request the getter in question makes. ### S3 (`s3`) S3 takes various access configurations in the URL. Note that it will also read these from standard AWS environment variables if they're set. S3 compliant servers like Minio are also supported. If the query parameters are present, these take priority. * `aws_access_key_id` - AWS access key. * `aws_access_key_secret` - AWS access key secret. * `aws_access_token` - AWS access token if this is being used. #### Using IAM Instance Profiles with S3 If you use go-getter and want to use an EC2 IAM Instance Profile to avoid using credentials, then just omit these and the profile, if available will be used automatically. ### Using S3 with Minio If you use go-gitter for Minio support, you must consider the following: * `aws_access_key_id` (required) - Minio access key. * `aws_access_key_secret` (required) - Minio access key secret. * `region` (optional - defaults to us-east-1) - Region identifier to use. * `version` (optional - defaults to Minio default) - Configuration file format. #### S3 Bucket Examples S3 has several addressing schemes used to reference your bucket. These are listed here: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro Some examples for these addressing schemes: - s3::https://s3.amazonaws.com/bucket/foo - s3::https://s3-eu-west-1.amazonaws.com/bucket/foo - bucket.s3.amazonaws.com/foo - bucket.s3-eu-west-1.amazonaws.com/foo/bar - "s3::http://127.0.0.1:9000/test-bucket/hello.txt?aws_access_key_id=KEYID&aws_access_key_secret=SECRETKEY&region=us-east-2" ### GCS (`gcs`) #### GCS Authentication In order to access to GCS, authentication credentials should be provided. More information can be found [here](https://cloud.google.com/docs/authentication/getting-started) #### GCS Bucket Examples - gcs::https://www.googleapis.com/storage/v1/bucket - gcs::https://www.googleapis.com/storage/v1/bucket/foo.zip - www.googleapis.com/storage/v1/bucket/foo #### GCS Testing The tests for `get_gcs.go` require you to have GCP credentials set in your environment. These credentials can have any level of permissions to any project, they just need to exist. This means setting `GOOGLE_APPLICATION_CREDENTIALS="~/path/to/credentials.json"` or `GOOGLE_CREDENTIALS="{stringified-credentials-json}"`. Due to this configuration, `get_gcs_test.go` will fail for external contributors in CircleCI. ### SMB (smb) There are two options that go-getter will use to download a file in a smb shared folder. The first option uses [`smbclient`](https://www.samba.org/samba/docs/current/man-html/smbclient.1.html) and the second one uses the file system to look for a file in a local mount of the shared folder in the OS specific volume folder. go-getter will try to download files from a smb shared folder whenever the url is prefixed with `smb://`. ⚠️ The [`smbclient`](https://www.samba.org/samba/docs/current/man-html/smbclient.1.html) command is available only for Linux. This is the ONLY option for a Linux user and therefore the client must be installed. The `smbclient` cli is not available for Windows and MacOS. The go-getter will try to get files using the file system, when this happens the getter uses the FileGetter implementation. When connecting to a smb server, the OS creates a local mount in a system specific volume folder, and go-getter will try to access the following folders when looking for local mounts. - MacOS: /Volumes/<shared_path> - Windows: \\\\\<host>\\\<shared_path> The following examples work for all the OSes: - smb://host/shared/dir (downloads directory content) - smb://host/shared/dir/file (downloads file) The following examples work for Linux: - smb://username:password@host/shared/dir (downloads directory content) - smb://username@host/shared/dir - smb://username:password@host/shared/dir/file (downloads file) - smb://username@host/shared/dir/file ⚠️ The above examples also work on the other OSes but the authentication is not used to access the file system. #### SMB Testing The test for `get_smb.go` requires a smb server running which can be started inside a docker container by running `make start-smb`. Once the container is up the shared folder can be accessed via `smb://<ip|name>/public/<dir|file>` or `smb://user:password@<ip|name>/private/<dir|file>` by another container or machine in the same network. To run the tests inside `get_smb_test.go` and `client_test.go`, prepare the environment with `make smbtests-prepare`. On prepare some mock files and directories will be added to the shared folder and a go-getter container will start together with the samba server. Once the environment for testing is prepared, run `make smbtests` to run the tests. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/checksum.go�������������������������������0000664�0000000�0000000�00000021342�13771713062�0025356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "bufio" "bytes" "context" "crypto/md5" "crypto/sha1" "crypto/sha256" "crypto/sha512" "encoding/hex" "fmt" "hash" "io" "os" "path/filepath" "strings" urlhelper "github.com/hashicorp/go-getter/v2/helper/url" ) // FileChecksum helps verifying the checksum for a file. type FileChecksum struct { Type string Hash hash.Hash Value []byte Filename string } // String returns the hash type and the hash separated by a colon, for example: // "md5:090992ba9fd140077b0661cb75f7ce13" // "sha1:ebfb681885ddf1234c18094a45bbeafd91467911" func (c *FileChecksum) String() string { return c.Type + ":" + hex.EncodeToString(c.Value) } // A ChecksumError is returned when a checksum differs type ChecksumError struct { Hash hash.Hash Actual []byte Expected []byte File string } func (cerr *ChecksumError) Error() string { if cerr == nil { return "<nil>" } return fmt.Sprintf( "Checksums did not match for %s.\nExpected: %s\nGot: %s\n%T", cerr.File, hex.EncodeToString(cerr.Expected), hex.EncodeToString(cerr.Actual), cerr.Hash, // ex: *sha256.digest ) } // Checksum computes the Checksum for filePath using the hashing algorithm from // c.Hash and compares it to c.Value. If those values differ a ChecksumError // will be returned. func (c *FileChecksum) Checksum(filePath string) error { f, err := os.Open(filePath) if err != nil { return fmt.Errorf("Failed to open file for checksum: %s", err) } defer f.Close() c.Hash.Reset() if _, err := io.Copy(c.Hash, f); err != nil { return fmt.Errorf("Failed to hash: %s", err) } if actual := c.Hash.Sum(nil); !bytes.Equal(actual, c.Value) { return &ChecksumError{ Hash: c.Hash, Actual: actual, Expected: c.Value, File: filePath, } } return nil } // GetChecksum extracts the checksum from the `checksum` parameter // of the src of the Request // ex: // http://hashicorp.com/terraform?checksum=<checksumValue> // http://hashicorp.com/terraform?checksum=<checksumType>:<checksumValue> // http://hashicorp.com/terraform?checksum=file:<checksum_url> // when the checksum is in a file, GetChecksum will first client.Get it // in a temporary directory, parse the content of the file and finally delete it. // The content of a checksum file is expected to be BSD style or GNU style. // For security reasons GetChecksum does not try to get the current working directory // and as a result, relative files will only be found when Request.Pwd is set. // // BSD-style checksum: // MD5 (file1) = <checksum> // MD5 (file2) = <checksum> // // GNU-style: // <checksum> file1 // <checksum> *file2 func (c *Client) GetChecksum(ctx context.Context, req *Request) (*FileChecksum, error) { var err error if req.u == nil { req.u, err = urlhelper.Parse(req.Src) if err != nil { return nil, err } } q := req.u.Query() v := q.Get("checksum") if v == "" { return nil, nil } vs := strings.SplitN(v, ":", 2) switch len(vs) { case 2: break // good default: // here, we try to guess the checksum from it's length // if the type was not passed return newChecksumFromValue(v, filepath.Base(req.u.EscapedPath())) } checksumType, checksumValue := vs[0], vs[1] switch checksumType { case "file": return c.checksumFromFile(ctx, checksumValue, req.u.Path, req.Pwd) default: return newChecksumFromType(checksumType, checksumValue, filepath.Base(req.u.EscapedPath())) } } func newChecksum(checksumValue, filename string) (*FileChecksum, error) { c := &FileChecksum{ Filename: filename, } var err error c.Value, err = hex.DecodeString(checksumValue) if err != nil { return nil, fmt.Errorf("invalid checksum: %s", err) } return c, nil } func newChecksumFromType(checksumType, checksumValue, filename string) (*FileChecksum, error) { c, err := newChecksum(checksumValue, filename) if err != nil { return nil, err } c.Type = strings.ToLower(checksumType) switch c.Type { case "md5": c.Hash = md5.New() case "sha1": c.Hash = sha1.New() case "sha256": c.Hash = sha256.New() case "sha512": c.Hash = sha512.New() default: return nil, fmt.Errorf( "unsupported checksum type: %s", checksumType) } return c, nil } func newChecksumFromValue(checksumValue, filename string) (*FileChecksum, error) { c, err := newChecksum(checksumValue, filename) if err != nil { return nil, err } switch len(c.Value) { case md5.Size: c.Hash = md5.New() c.Type = "md5" case sha1.Size: c.Hash = sha1.New() c.Type = "sha1" case sha256.Size: c.Hash = sha256.New() c.Type = "sha256" case sha512.Size: c.Hash = sha512.New() c.Type = "sha512" default: return nil, fmt.Errorf("Unknown type for checksum %s", checksumValue) } return c, nil } // checksumFromFile will return the first file checksum found in the // `checksumURL` file that corresponds to the `checksummedPath` path. // // checksumFromFile will infer the hashing algorithm based on the checksumURL // file content. // // checksumFromFile will only return checksums for files that match // checksummedPath, which is the object being checksummed. func (c *Client) checksumFromFile(ctx context.Context, checksumURL string, checksummedPath string, pwd string) (*FileChecksum, error) { checksumFileURL, err := urlhelper.Parse(checksumURL) if err != nil { return nil, err } tempfile, err := tmpFile("", filepath.Base(checksumFileURL.Path)) if err != nil { return nil, err } defer os.Remove(tempfile) req := &Request{ Pwd: pwd, Mode: ModeFile, Src: checksumURL, Dst: tempfile, // ProgressListener: c.ProgressListener, TODO(adrien): pass progress bar ? } if _, err = c.Get(ctx, req); err != nil { return nil, fmt.Errorf( "Error downloading checksum file: %s", err) } filename := filepath.Base(checksummedPath) absPath, err := filepath.Abs(checksummedPath) if err != nil { return nil, err } checksumFileDir := filepath.Dir(checksumFileURL.Path) relpath, err := filepath.Rel(checksumFileDir, absPath) switch { case err == nil || err.Error() == "Rel: can't make "+absPath+" relative to "+checksumFileDir: // ex: on windows C:\gopath\...\content.txt cannot be relative to \ // which is okay, may be another expected path will work. break default: return nil, err } // possible file identifiers: options := []string{ filename, // ubuntu-14.04.1-server-amd64.iso "*" + filename, // *ubuntu-14.04.1-server-amd64.iso Standard checksum "?" + filename, // ?ubuntu-14.04.1-server-amd64.iso shasum -p relpath, // dir/ubuntu-14.04.1-server-amd64.iso "./" + relpath, // ./dir/ubuntu-14.04.1-server-amd64.iso absPath, // fullpath; set if local } f, err := os.Open(tempfile) if err != nil { return nil, fmt.Errorf( "Error opening downloaded file: %s", err) } defer f.Close() rd := bufio.NewReader(f) for { line, err := rd.ReadString('\n') if err != nil { if err != io.EOF { return nil, fmt.Errorf( "Error reading checksum file: %s", err) } break } checksum, err := parseChecksumLine(line) if err != nil || checksum == nil { continue } if checksum.Filename == "" { // filename not sure, let's try return checksum, nil } // make sure the checksum is for the right file for _, option := range options { if option != "" && checksum.Filename == option { // any checksum will work so we return the first one return checksum, nil } } // The checksum filename can contain a sub folder to differ versions. // e.g. ./netboot/mini.iso and ./hwe-netboot/mini.iso // In this case we remove root folder characters to compare with the checksummed path fn := strings.TrimLeft(checksum.Filename, "./") if strings.Contains(checksummedPath, fn) { return checksum, nil } } return nil, fmt.Errorf("no checksum found in: %s", checksumURL) } // parseChecksumLine takes a line from a checksum file and returns // checksumType, checksumValue and filename parseChecksumLine guesses the style // of the checksum BSD vs GNU by splitting the line and by counting the parts. // of a line. // for BSD type sums parseChecksumLine guesses the hashing algorithm // by checking the length of the checksum. func parseChecksumLine(line string) (*FileChecksum, error) { parts := strings.Fields(line) switch len(parts) { case 4: // BSD-style checksum: // MD5 (file1) = <checksum> // MD5 (file2) = <checksum> if len(parts[1]) <= 2 || parts[1][0] != '(' || parts[1][len(parts[1])-1] != ')' { return nil, fmt.Errorf( "Unexpected BSD-style-checksum filename format: %s", line) } filename := parts[1][1 : len(parts[1])-1] return newChecksumFromType(parts[0], parts[3], filename) case 2: // GNU-style: // <checksum> file1 // <checksum> *file2 return newChecksumFromValue(parts[0], parts[1]) case 0: return nil, nil // empty line default: return newChecksumFromValue(parts[0], "") } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/client.go���������������������������������0000664�0000000�0000000�00000021070�13771713062�0025030�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "fmt" "io/ioutil" "os" "path/filepath" "strconv" "strings" urlhelper "github.com/hashicorp/go-getter/v2/helper/url" "github.com/hashicorp/go-multierror" safetemp "github.com/hashicorp/go-safetemp" ) // Client is a client for downloading things. // // Top-level functions such as Get are shortcuts for interacting with a client. // Using a client directly allows more fine-grained control over how downloading // is done, as well as customizing the protocols supported. type Client struct { // Decompressors is the map of decompressors supported by this client. // If this is nil, then the default value is the Decompressors global. Decompressors map[string]Decompressor // Getters is the list of protocols supported by this client. If this // is nil, then the default Getters variable will be used. Getters []Getter } // GetResult is the result of a Client.Get type GetResult struct { // Local destination of the gotten object. Dst string } // Get downloads the configured source to the destination. func (c *Client) Get(ctx context.Context, req *Request) (*GetResult, error) { if err := c.configure(); err != nil { return nil, err } // Store this locally since there are cases we swap this if req.Mode == ModeInvalid { req.Mode = ModeAny } // If there is a subdir component, then we download the root separately // and then copy over the proper subdir. req.Src, req.subDir = SourceDirSubdir(req.Src) if req.subDir != "" { td, tdcloser, err := safetemp.Dir("", "getter") if err != nil { return nil, err } defer tdcloser.Close() req.realDst = req.Dst req.Dst = td } var multierr []error for _, g := range c.Getters { shouldDownload, err := Detect(req, g) if err != nil { return nil, err } if !shouldDownload { // the request should not be processed by that getter continue } result, getErr := c.get(ctx, req, g) if getErr != nil { if getErr.Fatal { return nil, getErr.Err } multierr = append(multierr, getErr.Err) continue } return result, nil } if len(multierr) == 1 { // This is for keeping the error original format return nil, multierr[0] } if multierr != nil { var result *multierror.Error result = multierror.Append(result, multierr...) return nil, fmt.Errorf("error downloading '%s': %s", req.Src, result.Error()) } return nil, fmt.Errorf("error downloading '%s'", req.Src) } // getError is the Error response object returned by get(context.Context, *Request, Getter) // to tell the client whether to halt (Fatal) Get or to keep trying to get an artifact. type getError struct { // When Fatal is true something went wrong with get(context.Context, *Request, Getter) // and the client should halt and return the Err. Fatal bool Err error } func (ge *getError) Error() string { return ge.Err.Error() } func (c *Client) get(ctx context.Context, req *Request, g Getter) (*GetResult, *getError) { u, err := urlhelper.Parse(req.Src) req.u = u if err != nil { return nil, &getError{true, err} } // We have magic query parameters that we use to signal different features q := req.u.Query() // Determine if we have an archive type archiveV := q.Get("archive") if archiveV != "" { // Delete the paramter since it is a magic parameter we don't // want to pass on to the Getter q.Del("archive") req.u.RawQuery = q.Encode() // If we can parse the value as a bool and it is false, then // set the archive to "-" which should never map to a decompressor if b, err := strconv.ParseBool(archiveV); err == nil && !b { archiveV = "-" } } else { // We don't appear to... but is it part of the filename? matchingLen := 0 for k := range c.Decompressors { if strings.HasSuffix(req.u.Path, "."+k) && len(k) > matchingLen { archiveV = k matchingLen = len(k) } } } // If we have a decompressor, then we need to change the destination // to download to a temporary path. We unarchive this into the final, // real path. var decompressDst string var decompressDir bool decompressor := c.Decompressors[archiveV] if decompressor != nil { // Create a temporary directory to store our archive. We delete // this at the end of everything. td, err := ioutil.TempDir("", "getter") if err != nil { return nil, &getError{true, fmt.Errorf( "Error creating temporary directory for archive: %s", err)} } defer os.RemoveAll(td) // Swap the download directory to be our temporary path and // store the old values. decompressDst = req.Dst decompressDir = req.Mode != ModeFile req.Dst = filepath.Join(td, "archive") req.Mode = ModeFile } // Determine checksum if we have one checksum, err := c.GetChecksum(ctx, req) if err != nil { return nil, &getError{true, fmt.Errorf("invalid checksum: %s", err)} } // Delete the query parameter if we have it. q.Del("checksum") req.u.RawQuery = q.Encode() if req.Mode == ModeAny { // Ask the getter which client mode to use req.Mode, err = g.Mode(ctx, req.u) if err != nil { return nil, &getError{false, err} } // Destination is the base name of the URL path in "any" mode when // a file source is detected. if req.Mode == ModeFile { filename := filepath.Base(req.u.Path) // Determine if we have a custom file name if v := q.Get("filename"); v != "" { // Delete the query parameter if we have it. q.Del("filename") req.u.RawQuery = q.Encode() filename = v } req.Dst = filepath.Join(req.Dst, filename) } } // If we're not downloading a directory, then just download the file // and return. if req.Mode == ModeFile { getFile := true if checksum != nil { if err := checksum.Checksum(req.Dst); err == nil { // don't get the file if the checksum of dst is correct getFile = false } } if getFile { if err := g.GetFile(ctx, req); err != nil { return nil, &getError{false, err} } if checksum != nil { if err := checksum.Checksum(req.Dst); err != nil { return nil, &getError{true, err} } } } if decompressor != nil { // We have a decompressor, so decompress the current destination // into the final destination with the proper mode. err := decompressor.Decompress(decompressDst, req.Dst, decompressDir) if err != nil { return nil, &getError{true, err} } // Swap the information back req.Dst = decompressDst if decompressDir { req.Mode = ModeAny } else { req.Mode = ModeFile } } // We check the dir value again because it can be switched back // if we were unarchiving. If we're still only Get-ing a file, then // we're done. if req.Mode == ModeFile { return &GetResult{req.Dst}, nil } } // If we're at this point we're either downloading a directory or we've // downloaded and unarchived a directory and we're just checking subdir. // In the case we have a decompressor we don't Get because it was Get // above. if decompressor == nil { // If we're getting a directory, then this is an error. You cannot // checksum a directory. TODO: test if checksum != nil { return nil, &getError{true, fmt.Errorf( "checksum cannot be specified for directory download")} } // We're downloading a directory, which might require a bit more work // if we're specifying a subdir. if err := g.Get(ctx, req); err != nil { return nil, &getError{false, err} } } // If we have a subdir, copy that over if req.subDir != "" { if err := os.RemoveAll(req.realDst); err != nil { return nil, &getError{true, err} } if err := os.MkdirAll(req.realDst, 0755); err != nil { return nil, &getError{true, err} } // Process any globs subDir, err := SubdirGlob(req.Dst, req.subDir) if err != nil { return nil, &getError{true, err} } err = copyDir(ctx, req.realDst, subDir, false) if err != nil { return nil, &getError{false, err} } return &GetResult{req.realDst}, nil } return &GetResult{req.Dst}, nil } func (c *Client) checkArchive(req *Request) string { q := req.u.Query() archiveV := q.Get("archive") if archiveV != "" { // Delete the paramter since it is a magic parameter we don't // want to pass on to the Getter q.Del("archive") req.u.RawQuery = q.Encode() // If we can parse the value as a bool and it is false, then // set the archive to "-" which should never map to a decompressor if b, err := strconv.ParseBool(archiveV); err == nil && !b { archiveV = "-" } } if archiveV == "" { // We don't appear to... but is it part of the filename? matchingLen := 0 for k := range c.Decompressors { if strings.HasSuffix(req.u.Path, "."+k) && len(k) > matchingLen { archiveV = k matchingLen = len(k) } } } return archiveV } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/client_option.go��������������������������0000664�0000000�0000000�00000000436�13771713062�0026423�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter // configure configures a client with options. func (c *Client) configure() error { // Default decompressor values if c.Decompressors == nil { c.Decompressors = Decompressors } // Default getter values if c.Getters == nil { c.Getters = Getters } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/client_option_progress.go�����������������0000664�0000000�0000000�00000001441�13771713062�0030344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "io" ) // ProgressTracker allows to track the progress of downloads. type ProgressTracker interface { // TrackProgress should be called when // a new object is being downloaded. // src is the location the file is // downloaded from. // currentSize is the current size of // the file in case it is a partial // download. // totalSize is the total size in bytes, // size can be zero if the file size // is not known. // stream is the file being downloaded, every // written byte will add up to processed size. // // TrackProgress returns a ReadCloser that wraps the // download in progress ( stream ). // When the download is finished, body shall be closed. TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/common.go���������������������������������0000664�0000000�0000000�00000000316�13771713062�0025042�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "io/ioutil" ) func tmpFile(dir, pattern string) (string, error) { f, err := ioutil.TempFile(dir, pattern) if err != nil { return "", err } f.Close() return f.Name(), nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/copy_dir.go�������������������������������0000664�0000000�0000000�00000003042�13771713062�0025361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "os" "path/filepath" "strings" ) // copyDir copies the src directory contents into dst. Both directories // should already exist. // // If ignoreDot is set to true, then dot-prefixed files/folders are ignored. func copyDir(ctx context.Context, dst string, src string, ignoreDot bool) error { src, err := filepath.EvalSymlinks(src) if err != nil { return err } walkFn := func(path string, info os.FileInfo, err error) error { if err != nil { return err } if path == src { return nil } if ignoreDot && strings.HasPrefix(filepath.Base(path), ".") { // Skip any dot files if info.IsDir() { return filepath.SkipDir } else { return nil } } // The "path" has the src prefixed to it. We need to join our // destination with the path without the src on it. dstPath := filepath.Join(dst, path[len(src):]) // If we have a directory, make that subdirectory, then continue // the walk. if info.IsDir() { if path == filepath.Join(src, dst) { // dst is in src; don't walk it. return nil } if err := os.MkdirAll(dstPath, 0755); err != nil { return err } return nil } // If we have a file, copy the contents. srcF, err := os.Open(path) if err != nil { return err } defer srcF.Close() dstF, err := os.Create(dstPath) if err != nil { return err } defer dstF.Close() if _, err := Copy(ctx, dstF, srcF); err != nil { return err } // Chmod it return os.Chmod(dstPath, info.Mode()) } return filepath.Walk(src, walkFn) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress.go�����������������������������0000664�0000000�0000000�00000003365�13771713062�0025725�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "strings" ) // Decompressor defines the interface that must be implemented to add // support for decompressing a type. // // Important: if you're implementing a decompressor, please use the // containsDotDot helper in this file to ensure that files can't be // decompressed outside of the specified directory. type Decompressor interface { // Decompress should decompress src to dst. dir specifies whether dst // is a directory or single file. src is guaranteed to be a single file // that exists. dst is not guaranteed to exist already. Decompress(dst, src string, dir bool) error } // Decompressors is the mapping of extension to the Decompressor implementation // that will decompress that extension/type. var Decompressors map[string]Decompressor func init() { tbzDecompressor := new(TarBzip2Decompressor) tgzDecompressor := new(TarGzipDecompressor) txzDecompressor := new(TarXzDecompressor) Decompressors = map[string]Decompressor{ "bz2": new(Bzip2Decompressor), "gz": new(GzipDecompressor), "xz": new(XzDecompressor), "tar.bz2": tbzDecompressor, "tar.gz": tgzDecompressor, "tar.xz": txzDecompressor, "tbz2": tbzDecompressor, "tgz": tgzDecompressor, "txz": txzDecompressor, "zip": new(ZipDecompressor), } } // containsDotDot checks if the filepath value v contains a ".." entry. // This will check filepath components by splitting along / or \. This // function is copied directly from the Go net/http implementation. func containsDotDot(v string) bool { if !strings.Contains(v, "..") { return false } for _, ent := range strings.FieldsFunc(v, isSlashRune) { if ent == ".." { return true } } return false } func isSlashRune(r rune) bool { return r == '/' || r == '\\' } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_bzip2.go�����������������������0000664�0000000�0000000�00000001523�13771713062�0027025�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "compress/bzip2" "fmt" "io" "os" "path/filepath" ) // Bzip2Decompressor is an implementation of Decompressor that can // decompress bz2 files. type Bzip2Decompressor struct{} func (d *Bzip2Decompressor) Decompress(dst, src string, dir bool) error { // Directory isn't supported at all if dir { return fmt.Errorf("bzip2-compressed files can only unarchive to a single file") } // If we're going into a directory we should make that first if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { return err } // File first f, err := os.Open(src) if err != nil { return err } defer f.Close() // Bzip2 compression is second bzipR := bzip2.NewReader(f) // Copy it out dstF, err := os.Create(dst) if err != nil { return err } defer dstF.Close() _, err = io.Copy(dstF, bzipR) return err } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_gzip.go������������������������0000664�0000000�0000000�00000001610�13771713062�0026745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "compress/gzip" "fmt" "io" "os" "path/filepath" ) // GzipDecompressor is an implementation of Decompressor that can // decompress gzip files. type GzipDecompressor struct{} func (d *GzipDecompressor) Decompress(dst, src string, dir bool) error { // Directory isn't supported at all if dir { return fmt.Errorf("gzip-compressed files can only unarchive to a single file") } // If we're going into a directory we should make that first if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { return err } // File first f, err := os.Open(src) if err != nil { return err } defer f.Close() // gzip compression is second gzipR, err := gzip.NewReader(f) if err != nil { return err } defer gzipR.Close() // Copy it out dstF, err := os.Create(dst) if err != nil { return err } defer dstF.Close() _, err = io.Copy(dstF, gzipR) return err } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_tar.go�������������������������0000664�0000000�0000000�00000007105�13771713062�0026567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "archive/tar" "fmt" "io" "os" "path/filepath" "time" ) // untar is a shared helper for untarring an archive. The reader should provide // an uncompressed view of the tar archive. func untar(input io.Reader, dst, src string, dir bool) error { tarR := tar.NewReader(input) done := false dirHdrs := []*tar.Header{} now := time.Now() for { hdr, err := tarR.Next() if err == io.EOF { if !done { // Empty archive return fmt.Errorf("empty archive: %s", src) } break } if err != nil { return err } if hdr.Typeflag == tar.TypeXGlobalHeader || hdr.Typeflag == tar.TypeXHeader { // don't unpack extended headers as files continue } path := dst if dir { // Disallow parent traversal if containsDotDot(hdr.Name) { return fmt.Errorf("entry contains '..': %s", hdr.Name) } path = filepath.Join(path, hdr.Name) } if hdr.FileInfo().IsDir() { if !dir { return fmt.Errorf("expected a single file: %s", src) } // A directory, just make the directory and continue unarchiving... if err := os.MkdirAll(path, 0755); err != nil { return err } // Record the directory information so that we may set its attributes // after all files have been extracted dirHdrs = append(dirHdrs, hdr) continue } else { // There is no ordering guarantee that a file in a directory is // listed before the directory dstPath := filepath.Dir(path) // Check that the directory exists, otherwise create it if _, err := os.Stat(dstPath); os.IsNotExist(err) { if err := os.MkdirAll(dstPath, 0755); err != nil { return err } } } // We have a file. If we already decoded, then it is an error if !dir && done { return fmt.Errorf("expected a single file, got multiple: %s", src) } // Mark that we're done so future in single file mode errors done = true // Open the file for writing dstF, err := os.Create(path) if err != nil { return err } _, err = io.Copy(dstF, tarR) dstF.Close() if err != nil { return err } // Chmod the file if err := os.Chmod(path, hdr.FileInfo().Mode()); err != nil { return err } // Set the access and modification time if valid, otherwise default to current time aTime := now mTime := now if hdr.AccessTime.Unix() > 0 { aTime = hdr.AccessTime } if hdr.ModTime.Unix() > 0 { mTime = hdr.ModTime } if err := os.Chtimes(path, aTime, mTime); err != nil { return err } } // Perform a final pass over extracted directories to update metadata for _, dirHdr := range dirHdrs { path := filepath.Join(dst, dirHdr.Name) // Chmod the directory since they might be created before we know the mode flags if err := os.Chmod(path, dirHdr.FileInfo().Mode()); err != nil { return err } // Set the mtime/atime attributes since they would have been changed during extraction aTime := now mTime := now if dirHdr.AccessTime.Unix() > 0 { aTime = dirHdr.AccessTime } if dirHdr.ModTime.Unix() > 0 { mTime = dirHdr.ModTime } if err := os.Chtimes(path, aTime, mTime); err != nil { return err } } return nil } // tarDecompressor is an implementation of Decompressor that can // unpack tar files. type tarDecompressor struct{} func (d *tarDecompressor) Decompress(dst, src string, dir bool) error { // If we're going into a directory we should make that first mkdir := dst if !dir { mkdir = filepath.Dir(dst) } if err := os.MkdirAll(mkdir, 0755); err != nil { return err } // File first f, err := os.Open(src) if err != nil { return err } defer f.Close() return untar(f, dst, src, dir) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_tbz2.go������������������������0000664�0000000�0000000�00000001217�13771713062�0026660�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "compress/bzip2" "os" "path/filepath" ) // TarBzip2Decompressor is an implementation of Decompressor that can // decompress tar.bz2 files. type TarBzip2Decompressor struct{} func (d *TarBzip2Decompressor) Decompress(dst, src string, dir bool) error { // If we're going into a directory we should make that first mkdir := dst if !dir { mkdir = filepath.Dir(dst) } if err := os.MkdirAll(mkdir, 0755); err != nil { return err } // File first f, err := os.Open(src) if err != nil { return err } defer f.Close() // Bzip2 compression is second bzipR := bzip2.NewReader(f) return untar(bzipR, dst, src, dir) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_testing.go���������������������0000664�0000000�0000000�00000010123�13771713062�0027450�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "crypto/md5" "encoding/hex" "io" "io/ioutil" "os" "path/filepath" "reflect" "runtime" "sort" "strings" "time" "github.com/mitchellh/go-testing-interface" ) // TestDecompressCase is a single test case for testing decompressors type TestDecompressCase struct { Input string // Input is the complete path to the input file Dir bool // Dir is whether or not we're testing directory mode Err bool // Err is whether we expect an error or not DirList []string // DirList is the list of files for Dir mode FileMD5 string // FileMD5 is the expected MD5 for a single file Mtime *time.Time // Mtime is the optionally expected mtime for a single file (or all files if in Dir mode) } // TestDecompressor is a helper function for testing generic decompressors. func TestDecompressor(t testing.T, d Decompressor, cases []TestDecompressCase) { t.Helper() for _, tc := range cases { t.Logf("Testing: %s", tc.Input) // Temporary dir to store stuff td, err := ioutil.TempDir("", "getter") if err != nil { t.Fatalf("err: %s", err) } // Destination is always joining result so that we have a new path dst := filepath.Join(td, "subdir", "result") // We use a function so defers work func() { defer os.RemoveAll(td) // Decompress err := d.Decompress(dst, tc.Input, tc.Dir) if (err != nil) != tc.Err { t.Fatalf("err %s: %s", tc.Input, err) } if tc.Err { return } // If it isn't a directory, then check for a single file if !tc.Dir { fi, err := os.Stat(dst) if err != nil { t.Fatalf("err %s: %s", tc.Input, err) } if fi.IsDir() { t.Fatalf("err %s: expected file, got directory", tc.Input) } if tc.FileMD5 != "" { actual := testMD5(t, dst) expected := tc.FileMD5 if actual != expected { t.Fatalf("err %s: expected MD5 %s, got %s", tc.Input, expected, actual) } } if tc.Mtime != nil { actual := fi.ModTime() if tc.Mtime.Unix() > 0 { expected := *tc.Mtime if actual != expected { t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), dst, actual.String()) } } else if actual.Unix() <= 0 { t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) } } return } // Convert expected for windows expected := tc.DirList if runtime.GOOS == "windows" { for i, v := range expected { expected[i] = strings.Replace(v, "/", "\\", -1) } } // Directory, check for the correct contents actual := testListDir(t, dst) if !reflect.DeepEqual(actual, expected) { t.Fatalf("bad %s\n\n%#v\n\n%#v", tc.Input, actual, expected) } // Check for correct atime/mtime for _, dir := range actual { path := filepath.Join(dst, dir) if tc.Mtime != nil { fi, err := os.Stat(path) if err != nil { t.Fatalf("err: %s", err) } actual := fi.ModTime() if tc.Mtime.Unix() > 0 { expected := *tc.Mtime if actual != expected { t.Fatalf("err %s: expected mtime '%s' for %s, got '%s'", tc.Input, expected.String(), path, actual.String()) } } else if actual.Unix() < 0 { t.Fatalf("err %s: expected mtime to be > 0, got '%s'", actual.String()) } } } }() } } func testListDir(t testing.T, path string) []string { var result []string err := filepath.Walk(path, func(sub string, info os.FileInfo, err error) error { if err != nil { return err } sub = strings.TrimPrefix(sub, path) if sub == "" { return nil } sub = sub[1:] // Trim the leading path sep. // If it is a dir, add trailing sep if info.IsDir() { sub += string(os.PathSeparator) } result = append(result, sub) return nil }) if err != nil { t.Fatalf("err: %s", err) } sort.Strings(result) return result } func testMD5(t testing.T, path string) string { f, err := os.Open(path) if err != nil { t.Fatalf("err: %s", err) } defer f.Close() h := md5.New() _, err = io.Copy(h, f) if err != nil { t.Fatalf("err: %s", err) } result := h.Sum(nil) return hex.EncodeToString(result) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_tgz.go�������������������������0000664�0000000�0000000�00000001410�13771713062�0026576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "compress/gzip" "fmt" "os" "path/filepath" ) // TarGzipDecompressor is an implementation of Decompressor that can // decompress tar.gzip files. type TarGzipDecompressor struct{} func (d *TarGzipDecompressor) Decompress(dst, src string, dir bool) error { // If we're going into a directory we should make that first mkdir := dst if !dir { mkdir = filepath.Dir(dst) } if err := os.MkdirAll(mkdir, 0755); err != nil { return err } // File first f, err := os.Open(src) if err != nil { return err } defer f.Close() // Gzip compression is second gzipR, err := gzip.NewReader(f) if err != nil { return fmt.Errorf("Error opening a gzip reader for %s: %s", src, err) } defer gzipR.Close() return untar(gzipR, dst, src, dir) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_txz.go�������������������������0000664�0000000�0000000�00000001357�13771713062�0026631�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "os" "path/filepath" "github.com/ulikunitz/xz" ) // TarXzDecompressor is an implementation of Decompressor that can // decompress tar.xz files. type TarXzDecompressor struct{} func (d *TarXzDecompressor) Decompress(dst, src string, dir bool) error { // If we're going into a directory we should make that first mkdir := dst if !dir { mkdir = filepath.Dir(dst) } if err := os.MkdirAll(mkdir, 0755); err != nil { return err } // File first f, err := os.Open(src) if err != nil { return err } defer f.Close() // xz compression is second txzR, err := xz.NewReader(f) if err != nil { return fmt.Errorf("Error opening an xz reader for %s: %s", src, err) } return untar(txzR, dst, src, dir) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_xz.go��������������������������0000664�0000000�0000000�00000001554�13771713062�0026444�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "io" "os" "path/filepath" "github.com/ulikunitz/xz" ) // XzDecompressor is an implementation of Decompressor that can // decompress xz files. type XzDecompressor struct{} func (d *XzDecompressor) Decompress(dst, src string, dir bool) error { // Directory isn't supported at all if dir { return fmt.Errorf("xz-compressed files can only unarchive to a single file") } // If we're going into a directory we should make that first if err := os.MkdirAll(filepath.Dir(dst), 0755); err != nil { return err } // File first f, err := os.Open(src) if err != nil { return err } defer f.Close() // xz compression is second xzR, err := xz.NewReader(f) if err != nil { return err } // Copy it out dstF, err := os.Create(dst) if err != nil { return err } defer dstF.Close() _, err = io.Copy(dstF, xzR) return err } ����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/decompress_zip.go�������������������������0000664�0000000�0000000�00000003644�13771713062�0026607�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "archive/zip" "fmt" "io" "os" "path/filepath" ) // ZipDecompressor is an implementation of Decompressor that can decompress zip // files. type ZipDecompressor struct{} func (d *ZipDecompressor) Decompress(dst, src string, dir bool) error { // If we're going into a directory we should make that first mkdir := dst if !dir { mkdir = filepath.Dir(dst) } if err := os.MkdirAll(mkdir, 0755); err != nil { return err } // Open the zip zipR, err := zip.OpenReader(src) if err != nil { return err } defer zipR.Close() // Check the zip integrity if len(zipR.File) == 0 { // Empty archive return fmt.Errorf("empty archive: %s", src) } if !dir && len(zipR.File) > 1 { return fmt.Errorf("expected a single file: %s", src) } // Go through and unarchive for _, f := range zipR.File { path := dst if dir { // Disallow parent traversal if containsDotDot(f.Name) { return fmt.Errorf("entry contains '..': %s", f.Name) } path = filepath.Join(path, f.Name) } if f.FileInfo().IsDir() { if !dir { return fmt.Errorf("expected a single file: %s", src) } // A directory, just make the directory and continue unarchiving... if err := os.MkdirAll(path, 0755); err != nil { return err } continue } // Create the enclosing directories if we must. ZIP files aren't // required to contain entries for just the directories so this // can happen. if dir { if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil { return err } } // Open the file for reading srcF, err := f.Open() if err != nil { return err } // Open the file for writing dstF, err := os.Create(path) if err != nil { srcF.Close() return err } _, err = io.Copy(dstF, srcF) srcF.Close() dstF.Close() if err != nil { return err } // Chmod the file if err := os.Chmod(path, f.Mode()); err != nil { return err } } return nil } ��������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/detect.go���������������������������������0000664�0000000�0000000�00000002637�13771713062�0025032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "github.com/hashicorp/go-getter/v2/helper/url" ) // Detector defines the interface that an invalid URL or a URL with a blank // scheme is passed through in order to determine if its shorthand for // something else well-known. type Detector interface { // Detect will detect whether the string matches a known pattern to // turn it into a proper URL. Detect(string, string) (string, bool, error) } // Detect is a method used to detect if a Getter is a candidate for downloading an artifact // by calling the Getter.Detect(*Request) method func Detect(req *Request, getter Getter) (bool, error) { originalSrc := req.Src getForce, getSrc := getForcedGetter(req.Src) if getForce != "" { req.Forced = getForce } req.Src = getSrc ok, err := getter.Detect(req) if err != nil { return true, err } if !ok { // Write back the original source req.Src = originalSrc return ok, nil } result, detectSubdir := SourceDirSubdir(req.Src) // If we have a subdir from the detection, then prepend it to our // requested subdir. if detectSubdir != "" { u, err := url.Parse(result) if err != nil { return true, fmt.Errorf("Error parsing URL: %s", err) } u.Path += "//" + detectSubdir // a subdir may contain wildcards, but in order to support them we // have to ensure the path isn't escaped. u.RawPath = u.Path result = u.String() } req.Src = result return true, nil } �������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/detect_bitbucket.go�����������������������0000664�0000000�0000000�00000003140�13771713062�0027054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "encoding/json" "fmt" "net/http" "net/url" "strings" ) // BitBucketDetector implements Detector to detect BitBucket URLs and turn // them into URLs that the Git or Hg Getter can understand. type BitBucketDetector struct{} func (d *BitBucketDetector) Detect(src, _ string) (string, bool, error) { if len(src) == 0 { return "", false, nil } if strings.HasPrefix(src, "bitbucket.org/") { return d.detectHTTP(src) } return "", false, nil } func (d *BitBucketDetector) detectHTTP(src string) (string, bool, error) { u, err := url.Parse("https://" + src) if err != nil { return "", true, fmt.Errorf("error parsing BitBucket URL: %s", err) } // We need to get info on this BitBucket repository to determine whether // it is Git or Hg. var info struct { SCM string `json:"scm"` } infoUrl := "https://api.bitbucket.org/2.0/repositories" + u.Path resp, err := http.Get(infoUrl) if err != nil { return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) } if resp.StatusCode == 403 { // A private repo return "", true, fmt.Errorf( "shorthand BitBucket URL can't be used for private repos, " + "please use a full URL") } dec := json.NewDecoder(resp.Body) if err := dec.Decode(&info); err != nil { return "", true, fmt.Errorf("error looking up BitBucket URL: %s", err) } switch info.SCM { case "git": if !strings.HasSuffix(u.Path, ".git") { u.Path += ".git" } return "git::" + u.String(), true, nil case "hg": return "hg::" + u.String(), true, nil default: return "", true, fmt.Errorf("unknown BitBucket SCM type: %s", info.SCM) } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/detect_file.go����������������������������0000664�0000000�0000000�00000002572�13771713062�0026027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "os" "path/filepath" "runtime" ) // FileDetector implements Detector to detect file paths. type FileDetector struct{} func (d *FileDetector) Detect(src, pwd string) (string, bool, error) { if len(src) == 0 { return "", false, nil } if !filepath.IsAbs(src) { if pwd == "" { return "", true, fmt.Errorf( "relative paths require a module with a pwd") } // Stat the pwd to determine if its a symbolic link. If it is, // then the pwd becomes the original directory. Otherwise, // `filepath.Join` below does some weird stuff. // // We just ignore if the pwd doesn't exist. That error will be // caught later when we try to use the URL. if fi, err := os.Lstat(pwd); !os.IsNotExist(err) { if err != nil { return "", true, err } if fi.Mode()&os.ModeSymlink != 0 { pwd, err = filepath.EvalSymlinks(pwd) if err != nil { return "", true, err } // The symlink itself might be a relative path, so we have to // resolve this to have a correctly rooted URL. pwd, err = filepath.Abs(pwd) if err != nil { return "", true, err } } } src = filepath.Join(pwd, src) } return fmtFileURL(src), true, nil } func fmtFileURL(path string) string { if runtime.GOOS == "windows" { // Make sure we're using "/" on Windows. URLs are "/"-based. path = filepath.ToSlash(path) } return path } ��������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/detect_git.go�����������������������������0000664�0000000�0000000�00000001075�13771713062�0025670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter // GitDetector implements Detector to detect Git SSH URLs such as // git@host.com:dir1/dir2 and converts them to proper URLs. type GitDetector struct{} func (d *GitDetector) Detect(src, _ string) (string, bool, error) { if len(src) == 0 { return "", false, nil } u, err := detectSSH(src) if err != nil { return "", true, err } if u == nil { return "", false, nil } // We require the username to be "git" to assume that this is a Git URL if u.User.Username() != "git" { return "", false, nil } return "git::" + u.String(), true, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/detect_github.go��������������������������0000664�0000000�0000000�00000001773�13771713062�0026374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "net/url" "strings" ) // GitHubDetector implements Detector to detect GitHub URLs and turn // them into URLs that the Git Getter can understand. type GitHubDetector struct{} func (d *GitHubDetector) Detect(src, _ string) (string, bool, error) { if len(src) == 0 { return "", false, nil } if strings.HasPrefix(src, "github.com/") { return d.detectHTTP(src) } return "", false, nil } func (d *GitHubDetector) detectHTTP(src string) (string, bool, error) { parts := strings.Split(src, "/") if len(parts) < 3 { return "", false, fmt.Errorf( "GitHub URLs should be github.com/username/repo") } urlStr := fmt.Sprintf("https://%s", strings.Join(parts[:3], "/")) url, err := url.Parse(urlStr) if err != nil { return "", true, fmt.Errorf("error parsing GitHub URL: %s", err) } if !strings.HasSuffix(url.Path, ".git") { url.Path += ".git" } if len(parts) > 3 { url.Path += "//" + strings.Join(parts[3:], "/") } return "git::" + url.String(), true, nil } �����packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/detect_ssh.go�����������������������������0000664�0000000�0000000�00000002206�13771713062�0025677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "net/url" "regexp" "strings" ) // Note that we do not have an SSH-getter currently so this file serves // only to hold the detectSSH helper that is used by other detectors. // sshPattern matches SCP-like SSH patterns (user@host:path) var sshPattern = regexp.MustCompile("^(?:([^@]+)@)?([^:]+):/?(.+)$") // detectSSH determines if the src string matches an SSH-like URL and // converts it into a net.URL compatible string. This returns nil if the // string doesn't match the SSH pattern. // // This function is tested indirectly via detect_git_test.go func detectSSH(src string) (*url.URL, error) { matched := sshPattern.FindStringSubmatch(src) if matched == nil { return nil, nil } user := matched[1] host := matched[2] path := matched[3] qidx := strings.Index(path, "?") if qidx == -1 { qidx = len(path) } var u url.URL u.Scheme = "ssh" u.User = url.User(user) u.Host = host u.Path = path[0:qidx] if qidx < len(path) { q, err := url.ParseQuery(path[qidx+1:]) if err != nil { return nil, fmt.Errorf("error parsing GitHub SSH URL: %s", err) } u.RawQuery = q.Encode() } return &u, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/docker-compose.yml������������������������0000664�0000000�0000000�00000001206�13771713062�0026657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������version: '3.2' services: samba: build: dockerfile: Dockerfile-smbserver context: . container_name: samba environment: USERID: "0" GROUPID: "0" networks: - default ports: - "139:139/tcp" # default smb port - "445:445/tcp" # default smb port volumes: - /mnt:/mnt:z command: '-s "public;/public" -s "private;/private;yes;no;no;user" -u "user;password" -p' gogetter: build: context: . container_name: gogetter depends_on: - samba networks: - default volumes: - /mnt:/mnt command: tail -f /dev/null networks: default: ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/folder_storage.go�������������������������0000664�0000000�0000000�00000002745�13771713062�0026561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "crypto/md5" "encoding/hex" "fmt" "os" "path/filepath" ) // FolderStorage is an implementation of the Storage interface that manages // modules on the disk. type FolderStorage struct { // StorageDir is the directory where the modules will be stored. StorageDir string } // Dir implements Storage.Dir func (s *FolderStorage) Dir(key string) (d string, e bool, err error) { d = s.dir(key) _, err = os.Stat(d) if err == nil { // Directory exists e = true return } if os.IsNotExist(err) { // Directory doesn't exist d = "" e = false err = nil return } // An error d = "" e = false return } // Get implements Storage.Get func (s *FolderStorage) Get(ctx context.Context, key string, source string, update bool) error { dir := s.dir(key) if !update { if _, err := os.Stat(dir); err == nil { // If the directory already exists, then we're done since // we're not updating. return nil } else if !os.IsNotExist(err) { // If the error we got wasn't a file-not-exist error, then // something went wrong and we should report it. return fmt.Errorf("Error reading module directory: %s", err) } } // Get the source. This always forces an update. _, err := Get(ctx, dir, source) return err } // dir returns the directory name internally that we'll use to map to // internally. func (s *FolderStorage) dir(key string) string { sum := md5.Sum([]byte(key)) return filepath.Join(s.StorageDir, hex.EncodeToString(sum[:])) } ���������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get.go������������������������������������0000664�0000000�0000000�00000011613�13771713062�0024333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// getter is a package for downloading files or directories from a variety of // protocols. // // getter is unique in its ability to download both directories and files. // It also detects certain source strings to be protocol-specific URLs. For // example, "github.com/hashicorp/go-getter/v2" would turn into a Git URL and // use the Git protocol. // // Protocols and detectors are extensible. // // To get started, see Client. package getter import ( "bytes" "context" "fmt" "net/url" "os/exec" "regexp" "syscall" cleanhttp "github.com/hashicorp/go-cleanhttp" ) // Getter defines the interface that schemes must implement to download // things. type Getter interface { // Get downloads the given URL into the given directory. This always // assumes that we're updating and gets the latest version that it can. // // The directory may already exist (if we're updating). If it is in a // format that isn't understood, an error should be returned. Get shouldn't // simply nuke the directory. Get(context.Context, *Request) error // GetFile downloads the give URL into the given path. The URL must // reference a single file. If possible, the Getter should check if // the remote end contains the same file and no-op this operation. GetFile(context.Context, *Request) error // Mode returns the mode based on the given URL. This is used to // allow clients to let the getters decide which mode to use. Mode(context.Context, *url.URL) (Mode, error) // Detect detects whether the Request.Src matches a known pattern to // turn it into a proper URL, and also transforms and update Request.Src // when necessary. // The Getter must validate if the Request.Src is a valid URL // with a valid scheme for the Getter, and also check if the // current Getter is the forced one and return true if that's the case. Detect(*Request) (bool, error) } // Getters is the mapping of scheme to the Getter implementation that will // be used to get a dependency. var Getters []Getter // forcedRegexp is the regular expression that finds Forced getters. This // syntax is schema::url, example: git::https://foo.com var forcedRegexp = regexp.MustCompile(`^([A-Za-z0-9]+)::(.+)$`) // httpClient is the default client to be used by HttpGetters. var httpClient = cleanhttp.DefaultClient() var DefaultClient = &Client{ Getters: Getters, Decompressors: Decompressors, } func init() { httpGetter := &HttpGetter{ Netrc: true, } // The order of the Getters in the list may affect the result // depending if the Request.Src is detected as valid by multiple getters Getters = []Getter{ &GitGetter{[]Detector{ new(GitHubDetector), new(GitDetector), new(BitBucketDetector), }, }, new(HgGetter), new(SmbClientGetter), new(SmbMountGetter), httpGetter, new(FileGetter), } } // Get downloads the directory specified by src into the folder specified by // dst. If dst already exists, Get will attempt to update it. // // src is a URL, whereas dst is always just a file path to a folder. This // folder doesn't need to exist. It will be created if it doesn't exist. func Get(ctx context.Context, dst, src string) (*GetResult, error) { req := &Request{ Src: src, Dst: dst, Mode: ModeDir, } return DefaultClient.Get(ctx, req) } // GetAny downloads a URL into the given destination. Unlike Get or // GetFile, both directories and files are supported. // // dst must be a directory. If src is a file, it will be downloaded // into dst with the basename of the URL. If src is a directory or // archive, it will be unpacked directly into dst. func GetAny(ctx context.Context, dst, src string) (*GetResult, error) { req := &Request{ Src: src, Dst: dst, Mode: ModeAny, } return DefaultClient.Get(ctx, req) } // GetFile downloads the file specified by src into the path specified by // dst. func GetFile(ctx context.Context, dst, src string) (*GetResult, error) { req := &Request{ Src: src, Dst: dst, Mode: ModeFile, } return DefaultClient.Get(ctx, req) } // getRunCommand is a helper that will run a command and capture the output // in the case an error happens. func getRunCommand(cmd *exec.Cmd) error { var buf bytes.Buffer cmd.Stdout = &buf cmd.Stderr = &buf err := cmd.Run() if err == nil { return nil } if exiterr, ok := err.(*exec.ExitError); ok { // The program has exited with an exit code != 0 if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { return fmt.Errorf( "%s exited with %d: %s", cmd.Path, status.ExitStatus(), buf.String()) } } return fmt.Errorf("error running %s: %s", cmd.Path, buf.String()) } // getForcedGetter takes a source and returns the tuple of the forced // getter and the raw URL (without the force syntax). // For example "git::https://...". returns "git" "https://". func getForcedGetter(src string) (string, string) { var forced string if ms := forcedRegexp.FindStringSubmatch(src); ms != nil { forced = ms[1] src = ms[2] } return forced, src } ���������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_file.go�������������������������������0000664�0000000�0000000�00000007730�13771713062�0025337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "fmt" "net/url" "os" "path/filepath" "runtime" ) // FileGetter is a Getter implementation that will download a module from // a file scheme. type FileGetter struct{} func (g *FileGetter) Mode(ctx context.Context, u *url.URL) (Mode, error) { path := u.Path if u.RawPath != "" { path = u.RawPath } fi, err := os.Stat(path) if err != nil { return 0, err } // Check if the source is a directory. if fi.IsDir() { return ModeDir, nil } return ModeFile, nil } func (g *FileGetter) Get(ctx context.Context, req *Request) error { path := req.u.Path if req.u.RawPath != "" { path = req.u.RawPath } // The source path must exist and be a directory to be usable. if fi, err := os.Stat(path); err != nil { return fmt.Errorf("source path error: %s", err) } else if !fi.IsDir() { return fmt.Errorf("source path must be a directory") } fi, err := os.Lstat(req.Dst) if err != nil && !os.IsNotExist(err) { return err } if req.Inplace { req.Dst = path return nil } // If the destination already exists, it must be a symlink if err == nil { mode := fi.Mode() if mode&os.ModeSymlink == 0 { return fmt.Errorf("destination exists and is not a symlink") } // Remove the destination if err := os.Remove(req.Dst); err != nil { return err } } // Create all the parent directories if err := os.MkdirAll(filepath.Dir(req.Dst), 0755); err != nil { return err } return SymlinkAny(path, req.Dst) } func (g *FileGetter) GetFile(ctx context.Context, req *Request) error { path := req.u.Path if req.u.RawPath != "" { path = req.u.RawPath } // The source path must exist and be a file to be usable. if fi, err := os.Stat(path); err != nil { return fmt.Errorf("source path error: %s", err) } else if fi.IsDir() { return fmt.Errorf("source path must be a file") } if req.Inplace { req.Dst = path return nil } _, err := os.Lstat(req.Dst) if err != nil && !os.IsNotExist(err) { return err } // If the destination already exists, it must be a symlink if err == nil { // Remove the destination if err := os.Remove(req.Dst); err != nil { return err } } // Create all the parent directories if err := os.MkdirAll(filepath.Dir(req.Dst), 0755); err != nil { return err } // If we're not copying, just symlink and we're done if !req.Copy { if err = os.Symlink(path, req.Dst); err == nil { return err } lerr, ok := err.(*os.LinkError) if !ok { return err } switch lerr.Err { case ErrUnauthorized: // On windows this means we don't have // symlink privilege, let's // fallback to a copy to avoid an error. break default: return err } } // Copy srcF, err := os.Open(path) if err != nil { return err } defer srcF.Close() dstF, err := os.Create(req.Dst) if err != nil { return err } defer dstF.Close() _, err = Copy(ctx, dstF, srcF) return err } func (g *FileGetter) Detect(req *Request) (bool, error) { var src, pwd string src = req.Src pwd = req.Pwd if len(src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being Forced if !g.validScheme(req.Forced) { // Current getter is not the Forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the Forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } if !(runtime.GOOS == "windows" && len(u.Scheme) == 1) { return false, nil } // For windows, we try to get the artifact // if it has a non valid scheme with 1 char // e.g. C:/foo/bar for other cases a prefix file:// is necessary } src, ok, err := new(FileDetector).Detect(src, pwd) if err != nil { return ok, err } if ok { req.Src = src return ok, nil } return true, nil } func (g *FileGetter) validScheme(scheme string) bool { return scheme == "file" } ����������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_file_copy.go��������������������������0000664�0000000�0000000�00000001433�13771713062�0026363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "io" ) // readerFunc is syntactic sugar for read interface. type readerFunc func(p []byte) (n int, err error) func (rf readerFunc) Read(p []byte) (n int, err error) { return rf(p) } // Copy is a io.Copy cancellable by context func Copy(ctx context.Context, dst io.Writer, src io.Reader) (int64, error) { // Copy will call the Reader and Writer interface multiple time, in order // to copy by chunk (avoiding loading the whole file in memory). return io.Copy(dst, readerFunc(func(p []byte) (int, error) { select { case <-ctx.Done(): // context has been canceled // stop process and propagate "context canceled" error return 0, ctx.Err() default: // otherwise just run default io.Reader implementation return src.Read(p) } })) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_file_symlink.go�����������������������0000664�0000000�0000000�00000000171�13771713062�0027075�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !windows package getter import ( "os" ) var ErrUnauthorized = os.ErrPermission var SymlinkAny = os.Symlink �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_file_symlink_windows.go���������������0000664�0000000�0000000�00000000746�13771713062�0030657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "os/exec" "path/filepath" "syscall" ) func SymlinkAny(oldname, newname string) error { sourcePath := filepath.FromSlash(oldname) // Use mklink to create a junction point output, err := exec.Command("cmd", "/c", "mklink", "/J", newname, sourcePath).CombinedOutput() if err != nil { return fmt.Errorf("failed to run mklink %v %v: %v %q", newname, sourcePath, err, output) } return nil } var ErrUnauthorized = syscall.ERROR_PRIVILEGE_NOT_HELD ��������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_git.go��������������������������������0000664�0000000�0000000�00000023317�13771713062�0025202�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "bytes" "context" "encoding/base64" "fmt" "io/ioutil" "net/url" "os" "os/exec" "path/filepath" "regexp" "runtime" "strconv" "strings" urlhelper "github.com/hashicorp/go-getter/v2/helper/url" safetemp "github.com/hashicorp/go-safetemp" version "github.com/hashicorp/go-version" ) // GitGetter is a Getter implementation that will download a module from // a git repository. type GitGetter struct { Detectors []Detector } var defaultBranchRegexp = regexp.MustCompile(`\s->\sorigin/(.*)`) func (g *GitGetter) Mode(_ context.Context, u *url.URL) (Mode, error) { return ModeDir, nil } func (g *GitGetter) Get(ctx context.Context, req *Request) error { if _, err := exec.LookPath("git"); err != nil { return fmt.Errorf("git must be available and on the PATH") } // The port number must be parseable as an integer. If not, the user // was probably trying to use a scp-style address, in which case the // ssh:// prefix must be removed to indicate that. // // This is not necessary in versions of Go which have patched // CVE-2019-14809 (e.g. Go 1.12.8+) if portStr := req.u.Port(); portStr != "" { if _, err := strconv.ParseUint(portStr, 10, 16); err != nil { return fmt.Errorf("invalid port number %q; if using the \"scp-like\" git address scheme where a colon introduces the path instead, remove the ssh:// portion and use just the git:: prefix", portStr) } } // Extract some query parameters we use var ref, sshKey string var depth int q := req.u.Query() if len(q) > 0 { ref = q.Get("ref") q.Del("ref") sshKey = q.Get("sshkey") q.Del("sshkey") if n, err := strconv.Atoi(q.Get("depth")); err == nil { depth = n } q.Del("depth") // Copy the URL var newU url.URL = *req.u req.u = &newU req.u.RawQuery = q.Encode() } var sshKeyFile string if sshKey != "" { // Check that the git version is sufficiently new. if err := checkGitVersion("2.3"); err != nil { return fmt.Errorf("Error using ssh key: %v", err) } // We have an SSH key - decode it. raw, err := base64.StdEncoding.DecodeString(sshKey) if err != nil { return err } // Create a temp file for the key and ensure it is removed. fh, err := ioutil.TempFile("", "go-getter") if err != nil { return err } sshKeyFile = fh.Name() defer os.Remove(sshKeyFile) // Set the permissions prior to writing the key material. if err := os.Chmod(sshKeyFile, 0600); err != nil { return err } // Write the raw key into the temp file. _, err = fh.Write(raw) fh.Close() if err != nil { return err } } // Clone or update the repository _, err := os.Stat(req.Dst) if err != nil && !os.IsNotExist(err) { return err } if err == nil { err = g.update(ctx, req.Dst, sshKeyFile, ref, depth) } else { err = g.clone(ctx, sshKeyFile, depth, req) } if err != nil { return err } // Next: check out the proper tag/branch if it is specified, and checkout if ref != "" { if err := g.checkout(req.Dst, ref); err != nil { return err } } // Lastly, download any/all submodules. return g.fetchSubmodules(ctx, req.Dst, sshKeyFile, depth) } // GetFile for Git doesn't support updating at this time. It will download // the file every time. func (g *GitGetter) GetFile(ctx context.Context, req *Request) error { td, tdcloser, err := safetemp.Dir("", "getter") if err != nil { return err } defer tdcloser.Close() // Get the filename, and strip the filename from the URL so we can // just get the repository directly. filename := filepath.Base(req.u.Path) req.u.Path = filepath.Dir(req.u.Path) dst := req.Dst req.Dst = td // Get the full repository if err := g.Get(ctx, req); err != nil { return err } // Copy the single file req.u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) if err != nil { return err } fg := &FileGetter{} req.Copy = true req.Dst = dst return fg.GetFile(ctx, req) } func (g *GitGetter) checkout(dst string, ref string) error { cmd := exec.Command("git", "checkout", ref) cmd.Dir = dst return getRunCommand(cmd) } func (g *GitGetter) clone(ctx context.Context, sshKeyFile string, depth int, req *Request) error { args := []string{"clone"} if depth > 0 { args = append(args, "--depth", strconv.Itoa(depth)) } args = append(args, req.u.String(), req.Dst) cmd := exec.CommandContext(ctx, "git", args...) setupGitEnv(cmd, sshKeyFile) return getRunCommand(cmd) } func (g *GitGetter) update(ctx context.Context, dst, sshKeyFile, ref string, depth int) error { // Determine if we're a branch. If we're NOT a branch, then we just // switch to master prior to checking out cmd := exec.CommandContext(ctx, "git", "show-ref", "-q", "--verify", "refs/heads/"+ref) cmd.Dir = dst if getRunCommand(cmd) != nil { // Not a branch, switch to default branch. This will also catch // non-existent branches, in which case we want to switch to default // and then checkout the proper branch later. ref = findDefaultBranch(dst) } // We have to be on a branch to pull if err := g.checkout(dst, ref); err != nil { return err } if depth > 0 { cmd = exec.Command("git", "pull", "--depth", strconv.Itoa(depth), "--ff-only") } else { cmd = exec.Command("git", "pull", "--ff-only") } cmd.Dir = dst setupGitEnv(cmd, sshKeyFile) return getRunCommand(cmd) } // fetchSubmodules downloads any configured submodules recursively. func (g *GitGetter) fetchSubmodules(ctx context.Context, dst, sshKeyFile string, depth int) error { args := []string{"submodule", "update", "--init", "--recursive"} if depth > 0 { args = append(args, "--depth", strconv.Itoa(depth)) } cmd := exec.CommandContext(ctx, "git", args...) cmd.Dir = dst setupGitEnv(cmd, sshKeyFile) return getRunCommand(cmd) } // findDefaultBranch checks the repo's origin remote for its default branch // (generally "master"). "master" is returned if an origin default branch // can't be determined. func findDefaultBranch(dst string) string { var stdoutbuf bytes.Buffer cmd := exec.Command("git", "branch", "-r", "--points-at", "refs/remotes/origin/HEAD") cmd.Dir = dst cmd.Stdout = &stdoutbuf err := cmd.Run() matches := defaultBranchRegexp.FindStringSubmatch(stdoutbuf.String()) if err != nil || matches == nil { return "master" } return matches[len(matches)-1] } // setupGitEnv sets up the environment for the given command. This is used to // pass configuration data to git and ssh and enables advanced cloning methods. func setupGitEnv(cmd *exec.Cmd, sshKeyFile string) { const gitSSHCommand = "GIT_SSH_COMMAND=" var sshCmd []string // If we have an existing GIT_SSH_COMMAND, we need to append our options. // We will also remove our old entry to make sure the behavior is the same // with versions of Go < 1.9. env := os.Environ() for i, v := range env { if strings.HasPrefix(v, gitSSHCommand) && len(v) > len(gitSSHCommand) { sshCmd = []string{v} env[i], env[len(env)-1] = env[len(env)-1], env[i] env = env[:len(env)-1] break } } if len(sshCmd) == 0 { sshCmd = []string{gitSSHCommand + "ssh"} } if sshKeyFile != "" { // We have an SSH key temp file configured, tell ssh about this. if runtime.GOOS == "windows" { sshKeyFile = strings.Replace(sshKeyFile, `\`, `/`, -1) } sshCmd = append(sshCmd, "-i", sshKeyFile) } env = append(env, strings.Join(sshCmd, " ")) cmd.Env = env } // checkGitVersion is used to check the version of git installed on the system // against a known minimum version. Returns an error if the installed version // is older than the given minimum. func checkGitVersion(min string) error { want, err := version.NewVersion(min) if err != nil { return err } out, err := exec.Command("git", "version").Output() if err != nil { return err } fields := strings.Fields(string(out)) if len(fields) < 3 { return fmt.Errorf("Unexpected 'git version' output: %q", string(out)) } v := fields[2] if runtime.GOOS == "windows" && strings.Contains(v, ".windows.") { // on windows, git version will return for example: // git version 2.20.1.windows.1 // Which does not follow the semantic versionning specs // https://semver.org. We remove that part in order for // go-version to not error. v = v[:strings.Index(v, ".windows.")] } have, err := version.NewVersion(v) if err != nil { return err } if have.LessThan(want) { return fmt.Errorf("Required git version = %s, have %s", want, have) } return nil } func (g *GitGetter) Detect(req *Request) (bool, error) { src := req.Src if len(src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being Forced if !g.validScheme(req.Forced) { // Current getter is not the Forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the Forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } // Valid url with a scheme that is not valid for current getter return false, nil } for _, d := range g.Detectors { src, ok, err := d.Detect(src, req.Pwd) if err != nil { return ok, err } forced, src := getForcedGetter(src) if ok && g.validScheme(forced) { req.Src = src return ok, nil } } if _, err = url.Parse(req.Src); err != nil { return true, nil } if isForcedGetter { // Is the Forced getter and should be used to download the artifact if req.Pwd != "" && !filepath.IsAbs(src) { // Make sure to add pwd to relative paths src = filepath.Join(req.Pwd, src) } // Make sure we're using "/" on Windows. URLs are "/"-based. req.Src = filepath.ToSlash(src) return true, nil } return false, nil } func (g *GitGetter) validScheme(scheme string) bool { return scheme == "git" || scheme == "ssh" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_hg.go���������������������������������0000664�0000000�0000000�00000011234�13771713062�0025010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "fmt" "net/url" "os" "os/exec" "path/filepath" "runtime" urlhelper "github.com/hashicorp/go-getter/v2/helper/url" safetemp "github.com/hashicorp/go-safetemp" ) // HgGetter is a Getter implementation that will download a module from // a Mercurial repository. type HgGetter struct{} func (g *HgGetter) Mode(ctx context.Context, _ *url.URL) (Mode, error) { return ModeDir, nil } func (g *HgGetter) Get(ctx context.Context, req *Request) error { if _, err := exec.LookPath("hg"); err != nil { return fmt.Errorf("hg must be available and on the PATH") } newURL, err := urlhelper.Parse(req.u.String()) if err != nil { return err } if fixWindowsDrivePath(newURL) { // See valid file path form on http://www.selenic.com/hg/help/urls newURL.Path = fmt.Sprintf("/%s", newURL.Path) } // Extract some query parameters we use var rev string q := newURL.Query() if len(q) > 0 { rev = q.Get("rev") q.Del("rev") newURL.RawQuery = q.Encode() } _, err = os.Stat(req.Dst) if err != nil && !os.IsNotExist(err) { return err } if err != nil { if err := g.clone(req.Dst, newURL); err != nil { return err } } if err := g.pull(req.Dst, newURL); err != nil { return err } return g.update(ctx, req.Dst, newURL, rev) } // GetFile for Hg doesn't support updating at this time. It will download // the file every time. func (g *HgGetter) GetFile(ctx context.Context, req *Request) error { // Create a temporary directory to store the full source. This has to be // a non-existent directory. td, tdcloser, err := safetemp.Dir("", "getter") if err != nil { return err } defer tdcloser.Close() // Get the filename, and strip the filename from the URL so we can // just get the repository directly. filename := filepath.Base(req.u.Path) req.u.Path = filepath.Dir(req.u.Path) dst := req.Dst req.Dst = td // If we're on Windows, we need to set the host to "localhost" for hg if runtime.GOOS == "windows" { req.u.Host = "localhost" } // Get the full repository if err := g.Get(ctx, req); err != nil { return err } // Copy the single file req.u, err = urlhelper.Parse(fmtFileURL(filepath.Join(td, filename))) if err != nil { return err } fg := &FileGetter{} req.Copy = true req.Dst = dst return fg.GetFile(ctx, req) } func (g *HgGetter) clone(dst string, u *url.URL) error { cmd := exec.Command("hg", "clone", "-U", u.String(), dst) return getRunCommand(cmd) } func (g *HgGetter) pull(dst string, u *url.URL) error { cmd := exec.Command("hg", "pull") cmd.Dir = dst return getRunCommand(cmd) } func (g *HgGetter) update(ctx context.Context, dst string, u *url.URL, rev string) error { args := []string{"update"} if rev != "" { args = append(args, rev) } cmd := exec.CommandContext(ctx, "hg", args...) cmd.Dir = dst return getRunCommand(cmd) } func (g *HgGetter) Detect(req *Request) (bool, error) { src := req.Src if len(src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being Forced if !g.validScheme(req.Forced) { // Current getter is not the Forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the Forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } // Valid url with a scheme that is not valid for current getter return false, nil } src, ok, err := new(BitBucketDetector).Detect(src, req.Pwd) if err != nil { return ok, err } forced, src := getForcedGetter(src) if ok && g.validScheme(forced) { req.Src = src return ok, nil } if isForcedGetter { // Is the Forced getter and should be used to download the artifact if req.Pwd != "" && !filepath.IsAbs(src) { // Make sure to add pwd to relative paths src = filepath.Join(req.Pwd, src) } // Make sure we're using "/" on Windows. URLs are "/"-based. req.Src = filepath.ToSlash(src) return true, nil } return false, nil } func (g *HgGetter) validScheme(scheme string) bool { return scheme == "hg" } func fixWindowsDrivePath(u *url.URL) bool { // hg assumes a file:/// prefix for Windows drive letter file paths. // (e.g. file:///c:/foo/bar) // If the URL Path does not begin with a '/' character, the resulting URL // path will have a file:// prefix. (e.g. file://c:/foo/bar) // See http://www.selenic.com/hg/help/urls and the examples listed in // http://selenic.com/repo/hg-stable/file/1265a3a71d75/mercurial/util.py#l1936 return runtime.GOOS == "windows" && u.Scheme == "file" && len(u.Path) > 1 && u.Path[0] != '/' && u.Path[1] == ':' } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_http.go�������������������������������0000664�0000000�0000000�00000022165�13771713062�0025376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "encoding/xml" "fmt" "io" "net/http" "net/url" "os" "path/filepath" "strings" safetemp "github.com/hashicorp/go-safetemp" ) // HttpGetter is a Getter implementation that will download from an HTTP // endpoint. // // For file downloads, HTTP is used directly. // // The protocol for downloading a directory from an HTTP endpoint is as follows: // // An HTTP GET request is made to the URL with the additional GET parameter // "terraform-get=1". This lets you handle that scenario specially if you // wish. The response must be a 2xx. // // First, a header is looked for "X-Terraform-Get" which should contain // a source URL to download. // // If the header is not present, then a meta tag is searched for named // "terraform-get" and the content should be a source URL. // // The source URL, whether from the header or meta tag, must be a fully // formed URL. The shorthand syntax of "github.com/foo/bar" or relative // paths are not allowed. type HttpGetter struct { // Netrc, if true, will lookup and use auth information found // in the user's netrc file if available. Netrc bool // Client is the http.Client to use for Get requests. // This defaults to a cleanhttp.DefaultClient if left unset. Client *http.Client // Header contains optional request header fields that should be included // with every HTTP request. Note that the zero value of this field is nil, // and as such it needs to be initialized before use, via something like // make(http.Header). Header http.Header } func (g *HttpGetter) Mode(ctx context.Context, u *url.URL) (Mode, error) { if strings.HasSuffix(u.Path, "/") { return ModeDir, nil } return ModeFile, nil } func (g *HttpGetter) Get(ctx context.Context, req *Request) error { // Copy the URL so we can modify it var newU url.URL = *req.u req.u = &newU if g.Netrc { // Add auth from netrc if we can if err := addAuthFromNetrc(req.u); err != nil { return err } } if g.Client == nil { g.Client = httpClient } // Add terraform-get to the parameter. q := req.u.Query() q.Add("terraform-get", "1") req.u.RawQuery = q.Encode() // Get the URL httpReq, err := http.NewRequest("GET", req.u.String(), nil) if err != nil { return err } if g.Header != nil { httpReq.Header = g.Header.Clone() } resp, err := g.Client.Do(httpReq) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { return fmt.Errorf("bad response code: %d", resp.StatusCode) } // Extract the source URL var source string if v := resp.Header.Get("X-Terraform-Get"); v != "" { source = v } else { source, err = g.parseMeta(resp.Body) if err != nil { return err } } if source == "" { return fmt.Errorf("no source URL was returned") } // If there is a subdir component, then we download the root separately // into a temporary directory, then copy over the proper subdir. source, subDir := SourceDirSubdir(source) req = &Request{ Mode: ModeDir, Src: source, Dst: req.Dst, } if subDir == "" { _, err = DefaultClient.Get(ctx, req) return err } // We have a subdir, time to jump some hoops return g.getSubdir(ctx, req.Dst, source, subDir) } // GetFile fetches the file from src and stores it at dst. // If the server supports Accept-Range, HttpGetter will attempt a range // request. This means it is the caller's responsibility to ensure that an // older version of the destination file does not exist, else it will be either // falsely identified as being replaced, or corrupted with extra bytes // appended. func (g *HttpGetter) GetFile(ctx context.Context, req *Request) error { if g.Netrc { // Add auth from netrc if we can if err := addAuthFromNetrc(req.u); err != nil { return err } } // Create all the parent directories if needed if err := os.MkdirAll(filepath.Dir(req.Dst), 0755); err != nil { return err } f, err := os.OpenFile(req.Dst, os.O_RDWR|os.O_CREATE, os.FileMode(0666)) if err != nil { return err } defer f.Close() if g.Client == nil { g.Client = httpClient } var currentFileSize int64 // We first make a HEAD request so we can check // if the server supports range queries. If the server/URL doesn't // support HEAD requests, we just fall back to GET. httpReq, err := http.NewRequest("HEAD", req.u.String(), nil) if err != nil { return err } if g.Header != nil { httpReq.Header = g.Header.Clone() } headResp, err := g.Client.Do(httpReq) if err == nil { headResp.Body.Close() if headResp.StatusCode == 200 { // If the HEAD request succeeded, then attempt to set the range // query if we can. if headResp.Header.Get("Accept-Ranges") == "bytes" && headResp.ContentLength >= 0 { if fi, err := f.Stat(); err == nil { if _, err = f.Seek(0, io.SeekEnd); err == nil { currentFileSize = fi.Size() httpReq.Header.Set("Range", fmt.Sprintf("bytes=%d-", currentFileSize)) if currentFileSize >= headResp.ContentLength { // file already present return nil } } } } } } httpReq.Method = "GET" resp, err := g.Client.Do(httpReq) if err != nil { return err } switch resp.StatusCode { case http.StatusOK, http.StatusPartialContent: // all good default: resp.Body.Close() return fmt.Errorf("bad response code: %d", resp.StatusCode) } body := resp.Body if req.ProgressListener != nil { // track download fn := filepath.Base(req.u.EscapedPath()) body = req.ProgressListener.TrackProgress(fn, currentFileSize, currentFileSize+resp.ContentLength, resp.Body) } defer body.Close() n, err := Copy(ctx, f, body) if err == nil && n < resp.ContentLength { err = io.ErrShortWrite } return err } // getSubdir downloads the source into the destination, but with // the proper subdir. func (g *HttpGetter) getSubdir(ctx context.Context, dst, source, subDir string) error { // Create a temporary directory to store the full source. This has to be // a non-existent directory. td, tdcloser, err := safetemp.Dir("", "getter") if err != nil { return err } defer tdcloser.Close() // Download that into the given directory if _, err := Get(ctx, td, source); err != nil { return err } // Process any globbing sourcePath, err := SubdirGlob(td, subDir) if err != nil { return err } // Make sure the subdir path actually exists if _, err := os.Stat(sourcePath); err != nil { return fmt.Errorf( "Error downloading %s: %s", source, err) } // Copy the subdirectory into our actual destination. if err := os.RemoveAll(dst); err != nil { return err } // Make the final destination if err := os.MkdirAll(dst, 0755); err != nil { return err } return copyDir(ctx, dst, sourcePath, false) } // parseMeta looks for the first meta tag in the given reader that // will give us the source URL. func (g *HttpGetter) parseMeta(r io.Reader) (string, error) { d := xml.NewDecoder(r) d.CharsetReader = charsetReader d.Strict = false var err error var t xml.Token for { t, err = d.Token() if err != nil { if err == io.EOF { err = nil } return "", err } if e, ok := t.(xml.StartElement); ok && strings.EqualFold(e.Name.Local, "body") { return "", nil } if e, ok := t.(xml.EndElement); ok && strings.EqualFold(e.Name.Local, "head") { return "", nil } e, ok := t.(xml.StartElement) if !ok || !strings.EqualFold(e.Name.Local, "meta") { continue } if attrValue(e.Attr, "name") != "terraform-get" { continue } if f := attrValue(e.Attr, "content"); f != "" { return f, nil } } } // attrValue returns the attribute value for the case-insensitive key // `name', or the empty string if nothing is found. func attrValue(attrs []xml.Attr, name string) string { for _, a := range attrs { if strings.EqualFold(a.Name.Local, name) { return a.Value } } return "" } // charsetReader returns a reader for the given charset. Currently // it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful // error which is printed by go get, so the user can find why the package // wasn't downloaded if the encoding is not supported. Note that, in // order to reduce potential errors, ASCII is treated as UTF-8 (i.e. characters // greater than 0x7f are not rejected). func charsetReader(charset string, input io.Reader) (io.Reader, error) { switch strings.ToLower(charset) { case "ascii": return input, nil default: return nil, fmt.Errorf("can't decode XML document using charset %q", charset) } } func (g *HttpGetter) Detect(req *Request) (bool, error) { if len(req.Src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being Forced if !g.validScheme(req.Forced) { // Current getter is not the Forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(req.Src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the Forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } // Valid url with a scheme that is not valid for current getter return false, nil } return false, nil } func (g *HttpGetter) validScheme(scheme string) bool { return scheme == "http" || scheme == "https" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_mock.go�������������������������������0000664�0000000�0000000�00000002247�13771713062�0025347�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "net/url" ) // MockGetter is an implementation of Getter that can be used for tests. type MockGetter struct { // Proxy, if set, will be called after recording the calls below. // If it isn't set, then the *Err values will be returned. Proxy Getter GetCalled bool GetDst string GetURL *url.URL GetErr error GetFileCalled bool GetFileDst string GetFileURL *url.URL GetFileErr error } func (g *MockGetter) Get(ctx context.Context, req *Request) error { g.GetCalled = true g.GetDst = req.Dst g.GetURL = req.u if g.Proxy != nil { return g.Proxy.Get(ctx, req) } return g.GetErr } func (g *MockGetter) GetFile(ctx context.Context, req *Request) error { g.GetFileCalled = true g.GetFileDst = req.Dst g.GetFileURL = req.u if g.Proxy != nil { return g.Proxy.GetFile(ctx, req) } return g.GetFileErr } func (g *MockGetter) Mode(ctx context.Context, u *url.URL) (Mode, error) { if l := len(u.Path); l > 0 && u.Path[l-1:] == "/" { return ModeDir, nil } return ModeFile, nil } func (g *MockGetter) Detect(req *Request) (bool, error) { if g.Proxy != nil { return g.Proxy.Detect(req) } return true, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_smb_mount.go��������������������������0000664�0000000�0000000�00000005134�13771713062�0026417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "context" "net/url" "os" "path/filepath" "runtime" ) // SmbMountGetter is a Getter implementation that will download an artifact from // a shared folder using the file system using FileGetter implementation. // For Unix and MacOS users, the Getter will look for usual system specific mount paths such as: // /Volumes/ for MacOS // /run/user/1000/gvfs/smb-share:server=<hostIP>,share=<path> for Unix type SmbMountGetter struct{} func (g *SmbMountGetter) Mode(ctx context.Context, u *url.URL) (Mode, error) { if u.Host == "" || u.Path == "" { return 0, new(smbPathError) } prefix, path := g.findPrefixAndPath(u) u.Path = prefix + path return new(FileGetter).Mode(ctx, u) } func (g *SmbMountGetter) Get(ctx context.Context, req *Request) error { if req.u.Host == "" || req.u.Path == "" { return new(smbPathError) } prefix, path := g.findPrefixAndPath(req.u) req.u.Path = prefix + path return new(FileGetter).Get(ctx, req) } func (g *SmbMountGetter) GetFile(ctx context.Context, req *Request) error { if req.u.Host == "" || req.u.Path == "" { return new(smbPathError) } prefix, path := g.findPrefixAndPath(req.u) req.u.Path = prefix + path return new(FileGetter).GetFile(ctx, req) } func (g *SmbMountGetter) findPrefixAndPath(u *url.URL) (string, string) { var prefix, path string switch runtime.GOOS { case "windows": prefix = string(os.PathSeparator) + string(os.PathSeparator) path = filepath.Join(u.Host, u.Path) case "darwin": prefix = string(os.PathSeparator) path = filepath.Join("Volumes", u.Path) } return prefix, path } func (g *SmbMountGetter) Detect(req *Request) (bool, error) { if runtime.GOOS == "linux" { // Linux has the smbclient command which is a safer approach to retrieve an artifact from a samba shared folder. // Therefore, this should be used instead of looking in the file system. return false, nil } if len(req.Src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being Forced if !g.validScheme(req.Forced) { // Current getter is not the Forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(req.Src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the Forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } // Valid url with a scheme that is not valid for current getter return false, nil } return false, nil } func (g *SmbMountGetter) validScheme(scheme string) bool { return scheme == "smb" } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/get_smbclient.go��������������������������0000664�0000000�0000000�00000020307�13771713062�0026373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "bytes" "context" "fmt" "net/url" "os" "os/exec" "path/filepath" "regexp" "strings" "syscall" ) // SmbClientGetter is a Getter implementation that will download a module from // a shared folder using smbclient cli. type SmbClientGetter struct{} func (g *SmbClientGetter) Mode(ctx context.Context, u *url.URL) (Mode, error) { if u.Host == "" || u.Path == "" { return 0, new(smbPathError) } // Use smbclient cli to verify mode mode, err := g.smbClientMode(u) if err == nil { return mode, nil } return 0, &smbGeneralError{err} } func (g *SmbClientGetter) smbClientMode(u *url.URL) (Mode, error) { hostPath, filePath, err := g.findHostAndFilePath(u) if err != nil { return 0, err } file := "" // Get file and subdirectory name when existent if strings.Contains(filePath, "/") { i := strings.LastIndex(filePath, "/") file = filePath[i+1:] filePath = filePath[:i] } else { file = filePath filePath = "." } cmdArgs := g.smbclientCmdArgs(u.User, hostPath, filePath) // check if file exists in the smb shared folder and check the mode isDir, err := g.isDirectory(cmdArgs, file) if err != nil { return 0, err } if isDir { return ModeDir, nil } return ModeFile, nil } func (g *SmbClientGetter) Get(ctx context.Context, req *Request) error { if req.u.Host == "" || req.u.Path == "" { return new(smbPathError) } // If dst folder doesn't exists, we need to remove the created on later in case of failures dstExisted := false if req.Dst != "" { if _, err := os.Lstat(req.Dst); err == nil { dstExisted = true } } // Download the directory content using smbclient cli err := g.smbclientGet(req) if err == nil { return nil } if !dstExisted { // Remove the destination created for smbclient os.Remove(req.Dst) } return &smbGeneralError{err} } func (g *SmbClientGetter) smbclientGet(req *Request) error { hostPath, directory, err := g.findHostAndFilePath(req.u) if err != nil { return err } cmdArgs := g.smbclientCmdArgs(req.u.User, hostPath, ".") // check directory exists in the smb shared folder and is a directory isDir, err := g.isDirectory(cmdArgs, directory) if err != nil { return err } if !isDir { return fmt.Errorf("%s source path must be a directory", directory) } // download everything that's inside the directory (files and subdirectories) cmdArgs = append(cmdArgs, "-c") cmdArgs = append(cmdArgs, "prompt OFF;recurse ON; mget *") if req.Dst != "" { _, err := os.Lstat(req.Dst) if err != nil { if os.IsNotExist(err) { // Create destination folder if it doesn't exist if err := os.MkdirAll(req.Dst, 0755); err != nil { return fmt.Errorf("failed to create destination path: %s", err.Error()) } } else { return err } } } _, err = g.runSmbClientCommand(req.Dst, cmdArgs) return err } func (g *SmbClientGetter) GetFile(ctx context.Context, req *Request) error { if req.u.Host == "" || req.u.Path == "" { return new(smbPathError) } // If dst folder doesn't exist, we need to remove the created one later in case of failures dstExisted := false if req.Dst != "" { if _, err := os.Lstat(req.Dst); err == nil { dstExisted = true } } // If not mounted, try downloading the file using smbclient cli err := g.smbclientGetFile(req) if err == nil { return nil } if !dstExisted { // Remove the destination created for smbclient os.Remove(req.Dst) } return &smbGeneralError{err} } func (g *SmbClientGetter) smbclientGetFile(req *Request) error { hostPath, filePath, err := g.findHostAndFilePath(req.u) if err != nil { return err } // Get file and subdirectory name when existent file := "" if strings.Contains(filePath, "/") { i := strings.LastIndex(filePath, "/") file = filePath[i+1:] filePath = filePath[:i] } else { file = filePath filePath = "." } cmdArgs := g.smbclientCmdArgs(req.u.User, hostPath, filePath) // check file exists in the smb shared folder and is not a directory isDir, err := g.isDirectory(cmdArgs, file) if err != nil { return err } if isDir { return fmt.Errorf("%s source path must be a file", file) } // download file cmdArgs = append(cmdArgs, "-c") if req.Dst != "" { _, err := os.Lstat(req.Dst) if err != nil { if os.IsNotExist(err) { // Create destination folder if it doesn't exist if err := os.MkdirAll(filepath.Dir(req.Dst), 0755); err != nil { return fmt.Errorf("failed to creat destination path: %s", err.Error()) } } else { return err } } cmdArgs = append(cmdArgs, fmt.Sprintf("get %s %s", file, req.Dst)) } else { cmdArgs = append(cmdArgs, fmt.Sprintf("get %s", file)) } _, err = g.runSmbClientCommand("", cmdArgs) return err } func (g *SmbClientGetter) smbclientCmdArgs(used *url.Userinfo, hostPath string, fileDir string) (baseCmd []string) { baseCmd = append(baseCmd, "-N") // Append auth user and password to baseCmd auth := used.Username() if auth != "" { if password, ok := used.Password(); ok { auth = auth + "%" + password } baseCmd = append(baseCmd, "-U") baseCmd = append(baseCmd, auth) } baseCmd = append(baseCmd, hostPath) baseCmd = append(baseCmd, "--directory") baseCmd = append(baseCmd, fileDir) return baseCmd } func (g *SmbClientGetter) findHostAndFilePath(u *url.URL) (string, string, error) { // Host path hostPath := "//" + u.Host // Get shared directory path := strings.TrimPrefix(u.Path, "/") splt := regexp.MustCompile(`/`) directories := splt.Split(path, 2) if len(directories) > 0 { hostPath = hostPath + "/" + directories[0] } // Check file path if len(directories) <= 1 || directories[1] == "" { return "", "", fmt.Errorf("can not find file path and/or name in the smb url") } return hostPath, directories[1], nil } func (g *SmbClientGetter) isDirectory(args []string, object string) (bool, error) { args = append(args, "-c") args = append(args, fmt.Sprintf("allinfo %s", object)) output, err := g.runSmbClientCommand("", args) if err != nil { return false, err } if strings.Contains(output, "OBJECT_NAME_NOT_FOUND") { return false, fmt.Errorf("source path not found: %s", output) } return strings.Contains(output, "attributes: D"), nil } func (g *SmbClientGetter) runSmbClientCommand(dst string, args []string) (string, error) { cmd := exec.Command("smbclient", args...) if dst != "" { cmd.Dir = dst } var buf bytes.Buffer cmd.Stdout = &buf cmd.Stderr = &buf err := cmd.Run() if err == nil { return buf.String(), nil } if exiterr, ok := err.(*exec.ExitError); ok { // The program has exited with an exit code != 0 if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { return buf.String(), fmt.Errorf( "%s exited with %d: %s", cmd.Path, status.ExitStatus(), buf.String()) } } return buf.String(), fmt.Errorf("error running %s: %s", cmd.Path, buf.String()) } func (g *SmbClientGetter) Detect(req *Request) (bool, error) { if len(req.Src) == 0 { return false, nil } if req.Forced != "" { // There's a getter being Forced if !g.validScheme(req.Forced) { // Current getter is not the Forced one // Don't use it to try to download the artifact return false, nil } } isForcedGetter := req.Forced != "" && g.validScheme(req.Forced) u, err := url.Parse(req.Src) if err == nil && u.Scheme != "" { if isForcedGetter { // Is the Forced getter and source is a valid url return true, nil } if g.validScheme(u.Scheme) { return true, nil } // Valid url with a scheme that is not valid for current getter return false, nil } return false, nil } func (g *SmbClientGetter) validScheme(scheme string) bool { return scheme == "smb" } type smbPathError struct { Path string } func (e *smbPathError) Error() string { if e.Path == "" { return "samba path should contain valid host, filepath, and authentication if necessary (smb://<user>:<password>@<host>/<file_path>)" } return fmt.Sprintf("samba path should contain valid host, filepath, and authentication if necessary (%s)", e.Path) } type smbGeneralError struct { err error } func (e *smbGeneralError) Error() string { if e != nil { return fmt.Sprintf("smbclient cli needs to be installed and credentials provided when necessary. \n err: %s", e.err.Error()) } return "smbclient cli needs to be installed and credentials provided when necessary." } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/go.mod������������������������������������0000664�0000000�0000000�00000000700�13771713062�0024326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/go-getter/v2 require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d github.com/google/go-cmp v0.3.0 github.com/hashicorp/go-cleanhttp v0.5.0 github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/go-safetemp v1.0.0 github.com/hashicorp/go-version v1.1.0 github.com/mitchellh/go-homedir v1.0.0 github.com/mitchellh/go-testing-interface v1.0.0 github.com/ulikunitz/xz v0.5.5 ) go 1.13 ����������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/go.sum������������������������������������0000664�0000000�0000000�00000003476�13771713062�0024370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= github.com/hashicorp/go-version v1.1.0 h1:bPIoEKD27tNdebFGGxxYwcL4nepeY4j1QP23PFRGzg0= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/helper/�����������������������������������0000775�0000000�0000000�00000000000�13771713062�0024502�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/helper/url/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025304�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/helper/url/url.go�������������������������0000664�0000000�0000000�00000001012�13771713062�0026427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package url import ( "net/url" ) // Parse parses rawURL into a URL structure. // The rawURL may be relative or absolute. // // Parse is a wrapper for the Go stdlib net/url Parse function, but returns // Windows "safe" URLs on Windows platforms. func Parse(rawURL string) (*url.URL, error) { return parse(rawURL) } // MustParse calls Parse but panics if it errors; it should be mainly used to // make tests shorter. func MustParse(s string) *url.URL { u, err := Parse(s) if err != nil { panic(err) } return u } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/helper/url/url_unix.go��������������������0000664�0000000�0000000�00000000202�13771713062�0027472�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// +build !windows package url import ( "net/url" ) func parse(rawURL string) (*url.URL, error) { return url.Parse(rawURL) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/helper/url/url_windows.go�����������������0000664�0000000�0000000�00000001646�13771713062�0030216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package url import ( "fmt" "net/url" "path/filepath" "strings" ) func parse(rawURL string) (*url.URL, error) { // Make sure we're using "/" since URLs are "/"-based. rawURL = filepath.ToSlash(rawURL) if len(rawURL) > 1 && rawURL[1] == ':' { // Assume we're dealing with a drive letter. In which case we // force the 'file' scheme to avoid "net/url" URL.String() prepending // our url with "./". rawURL = "file://" + rawURL } u, err := url.Parse(rawURL) if err != nil { return nil, err } if len(u.Host) > 1 && u.Host[1] == ':' && strings.HasPrefix(rawURL, "file://") { // Assume we're dealing with a drive letter file path where the drive // letter has been parsed into the URL Host. u.Path = fmt.Sprintf("%s%s", u.Host, u.Path) u.Host = "" } // Remove leading slash for absolute file paths. if len(u.Path) > 2 && u.Path[0] == '/' && u.Path[2] == ':' { u.Path = u.Path[1:] } return u, err } ������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/mode.go�����������������������������������0000664�0000000�0000000�00000001314�13771713062�0024475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter // Mode is the mode that the client operates in. type Mode uint const ( ModeInvalid Mode = iota // ModeAny downloads anything it can. In this mode, dst must // be a directory. If src is a file, it is saved into the directory // with the basename of the URL. If src is a directory or archive, // it is unpacked directly into dst. ModeAny // ModeFile downloads a single file. In this mode, dst must // be a file path (doesn't have to exist). src must point to a single // file. It is saved as dst. ModeFile // ModeDir downloads a directory. In this mode, dst must be // a directory path (doesn't have to exist). src must point to an // archive or directory (such as in s3). ModeDir ) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/netrc.go����������������������������������0000664�0000000�0000000�00000002612�13771713062�0024666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "net/url" "os" "runtime" "github.com/bgentry/go-netrc/netrc" "github.com/mitchellh/go-homedir" ) // addAuthFromNetrc adds auth information to the URL from the user's // netrc file if it can be found. This will only add the auth info // if the URL doesn't already have auth info specified and the // the username is blank. func addAuthFromNetrc(u *url.URL) error { // If the URL already has auth information, do nothing if u.User != nil && u.User.Username() != "" { return nil } // Get the netrc file path path := os.Getenv("NETRC") if path == "" { filename := ".netrc" if runtime.GOOS == "windows" { filename = "_netrc" } var err error path, err = homedir.Expand("~/" + filename) if err != nil { return err } } // If the file is not a file, then do nothing if fi, err := os.Stat(path); err != nil { // File doesn't exist, do nothing if os.IsNotExist(err) { return nil } // Some other error! return err } else if fi.IsDir() { // File is directory, ignore return nil } // Load up the netrc file net, err := netrc.ParseFile(path) if err != nil { return fmt.Errorf("Error parsing netrc file at %q: %s", path, err) } machine := net.FindMachine(u.Host) if machine == nil { // Machine not found, no problem return nil } // Set the user info u.User = url.UserPassword(machine.Login, machine.Password) return nil } ����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/request.go��������������������������������0000664�0000000�0000000�00000003602�13771713062�0025243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "net/url" ) type Request struct { // Src is the source URL to get. // // Dst is the path to save the downloaded thing as. If Dir is set to // true, then this should be a directory. If the directory doesn't exist, // it will be created for you. // // Pwd is the working directory for detection. If this isn't set, some // detection may fail. Client will not default pwd to the current // working directory for security reasons. Src string Dst string Pwd string // Forced is the forced getter detected in the Src string during the // Getter detection. Forcing a getter means that go-getter will try // to download the artifact only with the Getter that is being forced. // // For example: // // Request.Src Forced // git::ssh://git@git.example.com:2222/foo/bar.git git // // This field is used by the Getters to validate when they are forced to download // the artifact. // If both Request.Src and Forced contains a forced getter, the one in the Request.Src will // be considered and will override the value of this field. Forced string // Mode is the method of download the client will use. See Mode // for documentation. Mode Mode // Copy, in local file mode if set to true, will copy data instead of using // a symlink. If false, attempts to symlink to speed up the operation and // to lower the disk space usage. If the symlink fails, may attempt to copy // on windows. Copy bool // Inplace, in local file mode if set to true, do nothing and the returned // operation will simply contain the source file path. Inplace has precedence // over Copy. Inplace bool // ProgressListener allows to track file downloads. // By default a no op progress listener is used. ProgressListener ProgressTracker u *url.URL subDir, realDst string } func (req *Request) URL() *url.URL { return req.u } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/source.go���������������������������������0000664�0000000�0000000�00000003445�13771713062�0025060�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import ( "fmt" "path/filepath" "strings" ) // SourceDirSubdir takes a source URL and returns a tuple of the URL without // the subdir and the subdir. // // ex: // dom.com/path/?q=p => dom.com/path/?q=p, "" // proto://dom.com/path//*?q=p => proto://dom.com/path?q=p, "*" // proto://dom.com/path//path2?q=p => proto://dom.com/path?q=p, "path2" // func SourceDirSubdir(src string) (string, string) { // URL might contains another url in query parameters stop := len(src) if idx := strings.Index(src, "?"); idx > -1 { stop = idx } // Calculate an offset to avoid accidentally marking the scheme // as the dir. var offset int if idx := strings.Index(src[:stop], "://"); idx > -1 { offset = idx + 3 } // First see if we even have an explicit subdir idx := strings.Index(src[offset:stop], "//") if idx == -1 { return src, "" } idx += offset subdir := src[idx+2:] src = src[:idx] // Next, check if we have query parameters and push them onto the // URL. if idx = strings.Index(subdir, "?"); idx > -1 { query := subdir[idx:] subdir = subdir[:idx] src += query } return src, subdir } // SubdirGlob returns the actual subdir with globbing processed. // // dst should be a destination directory that is already populated (the // download is complete) and subDir should be the set subDir. If subDir // is an empty string, this returns an empty string. // // The returned path is the full absolute path. func SubdirGlob(dst, subDir string) (string, error) { matches, err := filepath.Glob(filepath.Join(dst, subDir)) if err != nil { return "", err } if len(matches) == 0 { return "", fmt.Errorf("subdir %q not found", subDir) } if len(matches) > 1 { return "", fmt.Errorf("subdir %q matches multiple paths", subDir) } return matches[0], nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-getter/v2/storage.go��������������������������������0000664�0000000�0000000�00000000734�13771713062�0025222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package getter import "context" // Storage is an interface that knows how to lookup downloaded directories // as well as download and update directories from their sources into the // proper location. type Storage interface { // Dir returns the directory on local disk where the directory source // can be loaded from. Dir(string) (string, bool, error) // Get will download and optionally update the given directory. Get(context.Context, string, string, bool) error } ������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/�����������������������������������0000775�0000000�0000000�00000000000�13771713062�0024646�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/LICENSE����������������������������0000664�0000000�0000000�00000040525�13771713062�0025661�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/client/����������������������������0000775�0000000�0000000�00000000000�13771713062�0026124�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/client/client.go�������������������0000664�0000000�0000000�00000021207�13771713062�0027733�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package client import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "math/rand" "mime/multipart" "net/http" "net/url" "runtime" "strings" "time" "github.com/hashicorp/go-oracle-terraform/opc" ) const defaultMaxRetries = 1 const userAgentHeader = "User-Agent" var ( // defaultUserAgent builds a string containing the Go version, system archityecture and OS, // and the go-autorest version. defaultUserAgent = fmt.Sprintf("Go/%s (%s-%s) go-oracle-terraform/%s", runtime.Version(), runtime.GOARCH, runtime.GOOS, Version(), ) ) // Client represents an authenticated compute client, with compute credentials and an api client. type Client struct { IdentityDomain *string UserName *string Password *string APIEndpoint *url.URL httpClient *http.Client MaxRetries *int UserAgent *string logger opc.Logger loglevel opc.LogLevelType } // NewClient returns a new client func NewClient(c *opc.Config) (*Client, error) { // First create a client client := &Client{ IdentityDomain: c.IdentityDomain, UserName: c.Username, Password: c.Password, APIEndpoint: c.APIEndpoint, UserAgent: &defaultUserAgent, httpClient: c.HTTPClient, MaxRetries: c.MaxRetries, loglevel: c.LogLevel, } if c.UserAgent != nil { client.UserAgent = c.UserAgent } // Setup logger; defaults to stdout if c.Logger == nil { client.logger = opc.NewDefaultLogger() } else { client.logger = c.Logger } // If LogLevel was not set to something different, // double check for env var if c.LogLevel == 0 { client.loglevel = opc.LogLevel() } // Default max retries if unset if c.MaxRetries == nil { client.MaxRetries = opc.Int(defaultMaxRetries) } // Protect against any nil http client if c.HTTPClient == nil { return nil, fmt.Errorf("No HTTP client specified in config") } return client, nil } // MarshallRequestBody marshalls the request body and returns the resulting byte slice // This is split out of the BuildRequestBody method so as to allow // the developer to print a debug string of the request body if they // should so choose. func (c *Client) MarshallRequestBody(body interface{}) ([]byte, error) { // Verify interface isnt' nil if body == nil { return nil, nil } return json.Marshal(body) } // BuildRequestBody builds an HTTP Request that accepts a pre-marshaled body parameter as a raw byte array // Returns the raw HTTP Request and any error occured func (c *Client) BuildRequestBody(method, path string, body []byte) (*http.Request, error) { // Parse URL Path urlPath, err := url.Parse(path) if err != nil { return nil, err } var requestBody io.ReadSeeker if len(body) != 0 { requestBody = bytes.NewReader(body) } // Create Request req, err := http.NewRequest(method, c.formatURL(urlPath), requestBody) if err != nil { return nil, err } // Adding UserAgent Header req.Header.Add(userAgentHeader, *c.UserAgent) return req, nil } // BuildNonJSONRequest builds a new HTTP request that doesn't marshall the request body func (c *Client) BuildNonJSONRequest(method, path string, body io.Reader) (*http.Request, error) { // Parse URL Path urlPath, err := url.Parse(path) if err != nil { return nil, err } // Create request req, err := http.NewRequest(method, c.formatURL(urlPath), body) if err != nil { return nil, err } // Adding UserAgentHeader req.Header.Add(userAgentHeader, *c.UserAgent) return req, nil } // BuildMultipartFormRequest builds a new HTTP Request for a multipart form request from specifies attributes func (c *Client) BuildMultipartFormRequest(method, path string, files map[string][]byte, parameters map[string]interface{}) (*http.Request, error) { urlPath, err := url.Parse(path) if err != nil { return nil, err } body := new(bytes.Buffer) writer := multipart.NewWriter(body) var ( part io.Writer ) for fileName, fileContents := range files { part, err = writer.CreateFormFile(fileName, fmt.Sprintf("%s.json", fileName)) if err != nil { return nil, err } _, err = part.Write(fileContents) if err != nil { return nil, err } } // Add additional parameters to the writer for key, val := range parameters { if val.(string) != "" { _ = writer.WriteField(key, val.(string)) } } err = writer.Close() if err != nil { return nil, err } req, err := http.NewRequest(method, c.formatURL(urlPath), body) req.Header.Set("Content-Type", writer.FormDataContentType()) return req, err } // ExecuteRequest executes the http.Request from the BuildRequest method. // It is split up to add additional authentication that is Oracle API dependent. func (c *Client) ExecuteRequest(req *http.Request) (*http.Response, error) { // Execute request with supplied client resp, err := c.retryRequest(req) if err != nil { return resp, err } if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { return resp, nil } oracleErr := &opc.OracleError{ StatusCode: resp.StatusCode, } // Even though the returned body will be in json form, it's undocumented what // fields are actually returned. Once we get documentation of the actual // error fields that are possible to be returned we can have stricter error types. if resp.Body != nil { buf := new(bytes.Buffer) _, err = buf.ReadFrom(resp.Body) if err != nil { return resp, nil } oracleErr.Message = buf.String() } // Should return the response object regardless of error, // some resources need to verify and check status code on errors to // determine if an error actually occurs or not. return resp, oracleErr } // Allow retrying the request until it either returns no error, // or we exceed the number of max retries func (c *Client) retryRequest(req *http.Request) (*http.Response, error) { // Double check maxRetries is not nil var retries int if c.MaxRetries == nil { retries = defaultMaxRetries } else { retries = *c.MaxRetries } var statusCode int var errMessage string // Cache the body content for retries. // This is to allow reuse of the original request for the retries attempts // as the act of reading the body (when doing the httpClient.Do()) closes the // Reader. var body []byte if req.Body != nil { var err error body, err = ioutil.ReadAll(req.Body) if err != nil { return nil, err } } // Initial sleep time between retries sleep := 1 * time.Second for i := retries; i > 0; i-- { // replace body with new unread Reader before each request if len(body) > 0 { req.Body = ioutil.NopCloser(bytes.NewBuffer(body)) } resp, err := c.httpClient.Do(req) if err != nil { return resp, err } if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { return resp, nil } buf := new(bytes.Buffer) _, err = buf.ReadFrom(resp.Body) if err != nil { return resp, err } errMessage = buf.String() statusCode = resp.StatusCode c.DebugLogString(fmt.Sprintf("%s %s Encountered HTTP (%d) Error: %s", req.Method, req.URL, statusCode, errMessage)) if i != 1 { c.DebugLogString(fmt.Sprintf("%d of %d retries remaining. Next retry in %ds", i-1, retries, sleep/time.Second)) time.Sleep(sleep) // increase sleep time for next retry (exponential backoff with jitter) // up to a maximum of ~60 seconds if sleep <= 30*time.Second { jitter := time.Duration(rand.Int63n(int64(sleep))) / 2 sleep = (sleep * 2) + jitter } } } oracleErr := &opc.OracleError{ StatusCode: statusCode, Message: errMessage, } // We ran out of retries to make, return the error and response return nil, oracleErr } func (c *Client) formatURL(path *url.URL) string { return c.APIEndpoint.ResolveReference(path).String() } // WaitFor - Retry function func (c *Client) WaitFor(description string, pollInterval, timeout time.Duration, test func() (bool, error)) error { timeoutSeconds := int(timeout.Seconds()) pollIntervalSeconds := int(pollInterval.Seconds()) c.DebugLogString(fmt.Sprintf("Starting Wait For %s, polling every %d for %d seconds ", description, pollIntervalSeconds, timeoutSeconds)) for i := 0; i < timeoutSeconds; i += pollIntervalSeconds { c.DebugLogString(fmt.Sprintf("Waiting %d seconds for %s (%d/%ds)", pollIntervalSeconds, description, i, timeoutSeconds)) time.Sleep(pollInterval) completed, err := test() if err != nil || completed { return err } } return fmt.Errorf("Timeout after %d seconds waiting for %s", timeoutSeconds, description) } // WasNotFoundError Used to determine if the checked resource was found or not. func WasNotFoundError(e error) bool { err, ok := e.(*opc.OracleError) if ok { if strings.Contains(err.Error(), "No such service exits") { return true } return err.StatusCode == 404 } return false } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/client/logging.go������������������0000664�0000000�0000000�00000000361�13771713062�0030101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package client import ( "github.com/hashicorp/go-oracle-terraform/opc" ) // DebugLogString logs a string if debug logs are on func (c *Client) DebugLogString(str string) { if c.loglevel != opc.LogDebug { return } c.logger.Log(str) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/client/version.go������������������0000664�0000000�0000000�00000001156�13771713062�0030143�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package client import ( "bytes" "fmt" "strings" "sync" ) const ( major = 0 minor = 6 patch = 2 tag = "" ) var once sync.Once var version string // Version returns the semantic version (see http://semver.org). func Version() string { once.Do(func() { semver := fmt.Sprintf("%d.%d.%d", major, minor, patch) verBuilder := bytes.NewBufferString(semver) if tag != "" && tag != "-" { updated := strings.TrimPrefix(tag, "-") _, err := verBuilder.WriteString("-" + updated) if err == nil { verBuilder = bytes.NewBufferString(semver) } } version = verBuilder.String() }) return version } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/���������������������������0000775�0000000�0000000�00000000000�13771713062�0026322�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/acl.go���������������������0000664�0000000�0000000�00000007240�13771713062�0027413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // ACLsClient is a client for the ACLs functions of the Compute API. type ACLsClient struct { ResourceClient } const ( aclDescription = "acl" aclContainerPath = "/network/v1/acl/" aclResourcePath = "/network/v1/acl" ) // ACLs obtains a ACLsClient which can be used to access to the // ACLs functions of the Compute API func (c *Client) ACLs() *ACLsClient { return &ACLsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: aclDescription, ContainerPath: aclContainerPath, ResourceRootPath: aclResourcePath, }} } // ACLInfo describes an existing ACL. type ACLInfo struct { // Description of the ACL Description string `json:"description"` // Indicates whether the ACL is enabled Enabled bool `json:"enabledFlag"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the ACL Name string // Tags associated with the ACL Tags []string `json:"tags"` // Uniform Resource Identifier for the ACL URI string `json:"uri"` } // CreateACLInput defines a ACL to be created. type CreateACLInput struct { // Description of the ACL // Optional Description string `json:"description"` // Enables or disables the ACL. Set to true by default. //Set this to false to disable the ACL. // Optional Enabled bool `json:"enabledFlag"` // The name of the ACL to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Strings that you can use to tag the ACL. // Optional Tags []string `json:"tags"` } // CreateACL creates a new ACL. func (c *ACLsClient) CreateACL(createInput *CreateACLInput) (*ACLInfo, error) { createInput.Name = c.getQualifiedName(createInput.Name) var aclInfo ACLInfo if err := c.createResource(createInput, &aclInfo); err != nil { return nil, err } return c.success(&aclInfo) } // GetACLInput describes the ACL to get type GetACLInput struct { // The name of the ACL to query for // Required Name string `json:"name"` } // GetACL retrieves the ACL with the given name. func (c *ACLsClient) GetACL(getInput *GetACLInput) (*ACLInfo, error) { var aclInfo ACLInfo if err := c.getResource(getInput.Name, &aclInfo); err != nil { return nil, err } return c.success(&aclInfo) } // UpdateACLInput describes a secruity rule to update type UpdateACLInput struct { // Description of the ACL // Optional Description string `json:"description"` // Enables or disables the ACL. Set to true by default. //Set this to false to disable the ACL. // Optional Enabled bool `json:"enabledFlag"` // The name of the ACL to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Strings that you can use to tag the ACL. // Optional Tags []string `json:"tags"` } // UpdateACL modifies the properties of the ACL with the given name. func (c *ACLsClient) UpdateACL(updateInput *UpdateACLInput) (*ACLInfo, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) var aclInfo ACLInfo if err := c.updateResource(updateInput.Name, updateInput, &aclInfo); err != nil { return nil, err } return c.success(&aclInfo) } // DeleteACLInput describes the ACL to delete type DeleteACLInput struct { // The name of the ACL to delete. // Required Name string `json:"name"` } // DeleteACL deletes the ACL with the given name. func (c *ACLsClient) DeleteACL(deleteInput *DeleteACLInput) error { return c.deleteResource(deleteInput.Name) } func (c *ACLsClient) success(aclInfo *ACLInfo) (*ACLInfo, error) { aclInfo.Name = c.getUnqualifiedName(aclInfo.FQDN) return aclInfo, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/authentication.go����������0000664�0000000�0000000�00000001355�13771713062�0031674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "time" ) // AuthenticationReq represents the body of an authentication request. type AuthenticationReq struct { User string `json:"user"` Password string `json:"password"` } // Get a new auth cookie for the compute client func (c *Client) getAuthenticationCookie() error { req := AuthenticationReq{ User: c.getUserName(), Password: *c.client.Password, } rsp, err := c.executeRequest("POST", "/authenticate/", req) if err != nil { return err } if len(rsp.Cookies()) == 0 { return fmt.Errorf("No authentication cookie found in response %#v", rsp) } c.client.DebugLogString("Successfully authenticated to OPC") c.authCookie = rsp.Cookies()[0] c.cookieIssued = time.Now() return nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/compute_client.go����������0000664�0000000�0000000�00000010607�13771713062�0031667�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "net/http" "regexp" "strings" "time" "github.com/hashicorp/go-oracle-terraform/client" "github.com/hashicorp/go-oracle-terraform/opc" ) const cmpACME = "/Compute-%s" const cmpUsername = "/Compute-%s/%s" const cmpQualifiedName = "%s/%s" // Client represents an authenticated compute client, with compute credentials and an api client. type Client struct { client *client.Client authCookie *http.Cookie cookieIssued time.Time } // NewComputeClient returns a compute client to interact with the Oracle Compute Infrastructure - Classic APIs func NewComputeClient(c *opc.Config) (*Client, error) { computeClient := &Client{} client, err := client.NewClient(c) if err != nil { return nil, err } computeClient.client = client if err := computeClient.getAuthenticationCookie(); err != nil { return nil, err } return computeClient, nil } func (c *Client) executeRequest(method, path string, body interface{}) (*http.Response, error) { reqBody, err := c.client.MarshallRequestBody(body) if err != nil { return nil, err } req, err := c.client.BuildRequestBody(method, path, reqBody) if err != nil { return nil, err } debugReqString := fmt.Sprintf("HTTP %s Req (%s)", method, path) if body != nil { req.Header.Set("Content-Type", "application/oracle-compute-v3+json") // Don't leak credentials in STDERR if path != "/authenticate/" { debugReqString = fmt.Sprintf("%s:\n %+v", debugReqString, string(reqBody)) } } // Log the request before the authentication cookie, so as not to leak credentials c.client.DebugLogString(debugReqString) // If we have an authentication cookie, let's authenticate, refreshing cookie if need be if c.authCookie != nil { if time.Since(c.cookieIssued).Minutes() > 25 { c.authCookie = nil if err = c.getAuthenticationCookie(); err != nil { return nil, err } } req.AddCookie(c.authCookie) } resp, err := c.client.ExecuteRequest(req) if err != nil { return nil, err } return resp, nil } func (c *Client) getACME() string { return fmt.Sprintf(cmpACME, *c.client.IdentityDomain) } func (c *Client) getUserName() string { return fmt.Sprintf(cmpUsername, *c.client.IdentityDomain, *c.client.UserName) } func (c *Client) getQualifiedACMEName(name string) string { if name == "" { return "" } if strings.HasPrefix(name, "/Compute-") && len(strings.Split(name, "/")) == 1 { return name } return fmt.Sprintf(cmpQualifiedName, c.getACME(), name) } // From compute_client // GetObjectName returns the fully-qualified name of an OPC object, e.g. /identity-domain/user@email/{name} func (c *Client) getQualifiedName(name string) string { if name == "" { return "" } if strings.HasPrefix(name, "/oracle") || strings.HasPrefix(name, "/Compute-") { return name } return fmt.Sprintf(cmpQualifiedName, c.getUserName(), name) } func (c *Client) getObjectPath(root, name string) string { return fmt.Sprintf("%s%s", root, c.getQualifiedName(name)) } // GetUnqualifiedName returns the unqualified name of an OPC object, e.g. the {name} part of /identity-domain/user@email/{name} func (c *Client) getUnqualifiedName(name string) string { if name == "" { return name } if strings.HasPrefix(name, "/oracle") { return name } if !strings.Contains(name, "/") { return name } nameParts := strings.Split(name, "/") return strings.Join(nameParts[3:], "/") } func (c *Client) unqualify(names ...*string) { for _, name := range names { *name = c.getUnqualifiedName(*name) } } func (c *Client) unqualifyURL(url *string) { var validID = regexp.MustCompile(`(\/(Compute[^\/\s]+))(\/[^\/\s]+)(\/[^\/\s]+)`) name := validID.FindString(*url) *url = c.getUnqualifiedName(name) } func (c *Client) getQualifiedList(list []string) []string { for i, name := range list { list[i] = c.getQualifiedName(name) } return list } func (c *Client) getUnqualifiedList(list []string) []string { for i, name := range list { list[i] = c.getUnqualifiedName(name) } return list } func (c *Client) getQualifiedListName(name string) string { nameParts := strings.Split(name, ":") listType := nameParts[0] listName := nameParts[1] return fmt.Sprintf("%s:%s", listType, c.getQualifiedName(listName)) } func (c *Client) unqualifyListName(qualifiedName string) string { nameParts := strings.Split(qualifiedName, ":") listType := nameParts[0] listName := nameParts[1] return fmt.Sprintf("%s:%s", listType, c.getUnqualifiedName(listName)) } �������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/compute_resource_client.go�0000664�0000000�0000000�00000005234�13771713062�0033576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "bytes" "encoding/json" "fmt" "net/http" "github.com/mitchellh/mapstructure" ) // ResourceClient is an AuthenticatedClient with some additional information about the resources to be addressed. type ResourceClient struct { *Client ResourceDescription string ContainerPath string ResourceRootPath string } func (c *ResourceClient) createResource(requestBody interface{}, responseBody interface{}) error { resp, err := c.executeRequest("POST", c.ContainerPath, requestBody) if err != nil { return err } return c.unmarshalResponseBody(resp, responseBody) } func (c *ResourceClient) updateResource(name string, requestBody interface{}, responseBody interface{}) error { resp, err := c.executeRequest("PUT", c.getObjectPath(c.ResourceRootPath, name), requestBody) if err != nil { return err } return c.unmarshalResponseBody(resp, responseBody) } func (c *ResourceClient) getResource(name string, responseBody interface{}) error { var objectPath string if name != "" { objectPath = c.getObjectPath(c.ResourceRootPath, name) } else { objectPath = c.ResourceRootPath } resp, err := c.executeRequest("GET", objectPath, nil) if err != nil { return err } return c.unmarshalResponseBody(resp, responseBody) } func (c *ResourceClient) deleteResource(name string) error { var objectPath string if name != "" { objectPath = c.getObjectPath(c.ResourceRootPath, name) } else { objectPath = c.ResourceRootPath } _, err := c.executeRequest("DELETE", objectPath, nil) return err } func (c *ResourceClient) deleteOrchestration(name string) error { var objectPath string if name != "" { objectPath = c.getObjectPath(c.ResourceRootPath, name) } else { objectPath = c.ResourceRootPath } // Set terminate to true as we always want to delete an orchestration objectPath = fmt.Sprintf("%s?terminate=True", objectPath) _, err := c.executeRequest("DELETE", objectPath, nil) return err } func (c *ResourceClient) unmarshalResponseBody(resp *http.Response, iface interface{}) error { buf := new(bytes.Buffer) _, err := buf.ReadFrom(resp.Body) if err != nil { return err } c.client.DebugLogString(fmt.Sprintf("HTTP Resp (%d): %s", resp.StatusCode, buf.String())) // JSON decode response into interface var tmp interface{} dcd := json.NewDecoder(buf) if err = dcd.Decode(&tmp); err != nil { return err } // Use mapstructure to weakly decode into the resulting interface msdcd, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ WeaklyTypedInput: true, Result: iface, TagName: "json", }) if err != nil { return err } if err := msdcd.Decode(tmp); err != nil { return err } return nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/image_list.go��������������0000664�0000000�0000000�00000011520�13771713062�0030765�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( imageListDescription = "Image List" imageListContainerPath = "/imagelist/" imageListResourcePath = "/imagelist" ) // ImageListClient is a client for the Image List functions of the Compute API. type ImageListClient struct { ResourceClient } // ImageList obtains an ImageListClient which can be used to access to the // Image List functions of the Compute API func (c *Client) ImageList() *ImageListClient { return &ImageListClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: imageListDescription, ContainerPath: imageListContainerPath, ResourceRootPath: imageListResourcePath, }} } // ImageListEntry details the attributes from an image list entry type ImageListEntry struct { // User-defined parameters, in JSON format, that can be passed to an instance of this machine image when it is launched. Attributes map[string]interface{} `json:"attributes"` // Name of the Image List. ImageList string `json:"imagelist"` // A list of machine images. MachineImages []string `json:"machineimages"` // Uniform Resource Identifier. URI string `json:"uri"` // Version number of these Machine Images in the Image List. Version int `json:"version"` } // ImageList describes an existing Image List. type ImageList struct { // The image list entry to be used, by default, when launching instances using this image list Default int `json:"default"` // A description of this image list. Description string `json:"description"` // Each machine image in an image list is identified by an image list entry. Entries []ImageListEntry `json:"entries"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the Image List Name string // Uniform Resource Identifier URI string `json:"uri"` } // CreateImageListInput defines an Image List to be created. type CreateImageListInput struct { // The image list entry to be used, by default, when launching instances using this image list. // If you don't specify this value, it is set to 1. // Optional Default int `json:"default"` // A description of this image list. // Required Description string `json:"description"` // The name of the Image List // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` } // CreateImageList creates a new Image List with the given name, key and enabled flag. func (c *ImageListClient) CreateImageList(createInput *CreateImageListInput) (*ImageList, error) { var imageList ImageList createInput.Name = c.getQualifiedName(createInput.Name) if err := c.createResource(&createInput, &imageList); err != nil { return nil, err } return c.success(&imageList) } // DeleteImageListInput describes the image list to delete type DeleteImageListInput struct { // The name of the Image List Name string `json:"name"` } // DeleteImageList deletes the Image List with the given name. func (c *ImageListClient) DeleteImageList(deleteInput *DeleteImageListInput) error { deleteInput.Name = c.getQualifiedName(deleteInput.Name) return c.deleteResource(deleteInput.Name) } // GetImageListInput describes the image list to get type GetImageListInput struct { // The name of the Image List Name string `json:"name"` } // GetImageList retrieves the Image List with the given name. func (c *ImageListClient) GetImageList(getInput *GetImageListInput) (*ImageList, error) { getInput.Name = c.getQualifiedName(getInput.Name) var imageList ImageList if err := c.getResource(getInput.Name, &imageList); err != nil { return nil, err } return c.success(&imageList) } // UpdateImageListInput defines an Image List to be updated type UpdateImageListInput struct { // The image list entry to be used, by default, when launching instances using this image list. // If you don't specify this value, it is set to 1. // Optional Default int `json:"default"` // A description of this image list. // Required Description string `json:"description"` // The name of the Image List // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` } // UpdateImageList updates the key and enabled flag of the Image List with the given name. func (c *ImageListClient) UpdateImageList(updateInput *UpdateImageListInput) (*ImageList, error) { var imageList ImageList updateInput.Name = c.getQualifiedName(updateInput.Name) if err := c.updateResource(updateInput.Name, updateInput, &imageList); err != nil { return nil, err } return c.success(&imageList) } func (c *ImageListClient) success(imageList *ImageList) (*ImageList, error) { imageList.Name = c.getUnqualifiedName(imageList.FQDN) for _, v := range imageList.Entries { v.MachineImages = c.getUnqualifiedList(v.MachineImages) } return imageList, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/image_list_entries.go������0000664�0000000�0000000�00000011553�13771713062�0032524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import "fmt" const ( imageListEntryDescription = "image list entry" imageListEntryContainerPath = "/imagelist" imageListEntryResourcePath = "/imagelist" ) // ImageListEntriesClient specifies the parameters for an image list entries client type ImageListEntriesClient struct { ResourceClient } // ImageListEntries returns an ImageListEntriesClient that can be used to access the // necessary CRUD functions for Image List Entry's. func (c *Client) ImageListEntries() *ImageListEntriesClient { return &ImageListEntriesClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: imageListEntryDescription, ContainerPath: imageListEntryContainerPath, ResourceRootPath: imageListEntryResourcePath, }, } } // ImageListEntryInfo contains the exported fields necessary to hold all the information about an // Image List Entry type ImageListEntryInfo struct { // User-defined parameters, in JSON format, that can be passed to an instance of this machine // image when it is launched. This field can be used, for example, to specify the location of // a database server and login details. Instance metadata, including user-defined data is available // at http://192.0.0.192/ within an instance. See Retrieving User-Defined Instance Attributes in Using // Oracle Compute Cloud Service (IaaS). Attributes map[string]interface{} `json:"attributes"` // Name of the imagelist. Name string `json:"imagelist"` // A list of machine images. MachineImages []string `json:"machineimages"` // Uniform Resource Identifier for the Image List Entry URI string `json:"uri"` // Version number of these machineImages in the imagelist. Version int `json:"version"` } // CreateImageListEntryInput specifies the parameters needed to creat an image list entry type CreateImageListEntryInput struct { // The name of the Image List Name string // User-defined parameters, in JSON format, that can be passed to an instance of this machine // image when it is launched. This field can be used, for example, to specify the location of // a database server and login details. Instance metadata, including user-defined data is //available at http://192.0.0.192/ within an instance. See Retrieving User-Defined Instance //Attributes in Using Oracle Compute Cloud Service (IaaS). // Optional Attributes map[string]interface{} `json:"attributes"` // A list of machine images. // Required MachineImages []string `json:"machineimages"` // The unique version of the entry in the image list. // Required Version int `json:"version"` } // CreateImageListEntry creates a new Image List Entry from an ImageListEntriesClient and an input struct. // Returns a populated Info struct for the Image List Entry, and any errors func (c *ImageListEntriesClient) CreateImageListEntry(input *CreateImageListEntryInput) (*ImageListEntryInfo, error) { c.updateClientPaths(input.Name, -1) var imageListEntryInfo ImageListEntryInfo if err := c.createResource(&input, &imageListEntryInfo); err != nil { return nil, err } return c.success(&imageListEntryInfo) } // GetImageListEntryInput details the parameters needed to retrive an image list entry type GetImageListEntryInput struct { // The name of the Image List Name string // Version number of these machineImages in the imagelist. Version int } // GetImageListEntry returns a populated ImageListEntryInfo struct from an input struct func (c *ImageListEntriesClient) GetImageListEntry(input *GetImageListEntryInput) (*ImageListEntryInfo, error) { c.updateClientPaths(input.Name, input.Version) var imageListEntryInfo ImageListEntryInfo if err := c.getResource("", &imageListEntryInfo); err != nil { return nil, err } return c.success(&imageListEntryInfo) } // DeleteImageListEntryInput details the parameters needed to delete an image list entry type DeleteImageListEntryInput struct { // The name of the Image List Name string // Version number of these machineImages in the imagelist. Version int } // DeleteImageListEntry deletes the specified image list entry func (c *ImageListEntriesClient) DeleteImageListEntry(input *DeleteImageListEntryInput) error { c.updateClientPaths(input.Name, input.Version) return c.deleteResource("") } func (c *ImageListEntriesClient) updateClientPaths(name string, version int) { var containerPath, resourcePath string name = c.getQualifiedName(name) containerPath = imageListEntryContainerPath + name + "/entry/" resourcePath = imageListEntryContainerPath + name + "/entry" if version != -1 { containerPath = fmt.Sprintf("%s%d", containerPath, version) resourcePath = fmt.Sprintf("%s/%d", resourcePath, version) } c.ContainerPath = containerPath c.ResourceRootPath = resourcePath } // Unqualifies any qualified fields in the IPNetworkInfo struct func (c *ImageListEntriesClient) success(info *ImageListEntryInfo) (*ImageListEntryInfo, error) { c.unqualifyURL(&info.URI) return info, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/instances.go���������������0000664�0000000�0000000�00000065504�13771713062�0030652�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "errors" "fmt" "strings" "time" "github.com/hashicorp/go-oracle-terraform/client" ) const waitForInstanceReadyPollInterval = 10 * time.Second const waitForInstanceReadyTimeout = 3600 * time.Second const waitForInstanceDeletePollInterval = 10 * time.Second const waitForInstanceDeleteTimeout = 3600 * time.Second // InstancesClient is a client for the Instance functions of the Compute API. type InstancesClient struct { ResourceClient } // Instances obtains an InstancesClient which can be used to access to the // Instance functions of the Compute API func (c *Client) Instances() *InstancesClient { return &InstancesClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "instance", ContainerPath: "/launchplan/", ResourceRootPath: "/instance", }} } // InstanceState specifies the constants that an instance state can be in type InstanceState string const ( // InstanceRunning - running InstanceRunning InstanceState = "running" // InstanceInitializing - initializing InstanceInitializing InstanceState = "initializing" // InstancePreparing - preparing InstancePreparing InstanceState = "preparing" // InstanceStarting - starting InstanceStarting InstanceState = "starting" // InstanceStopping - stopping InstanceStopping InstanceState = "stopping" // InstanceShutdown - shutdown InstanceShutdown InstanceState = "shutdown" // InstanceQueued - queued InstanceQueued InstanceState = "queued" // InstanceError - error InstanceError InstanceState = "error" ) // InstanceDesiredState specifies the constants that for a desired instance state type InstanceDesiredState string const ( // InstanceDesiredRunning - running InstanceDesiredRunning InstanceDesiredState = "running" // InstanceDesiredShutdown - shutdown InstanceDesiredShutdown InstanceDesiredState = "shutdown" ) // InstanceInfo represents the Compute API's view of the state of an instance. type InstanceInfo struct { // The ID for the instance. Set by the SDK based on the request - not the API. ID string // The availability domain for the instance AvailabilityDomain string `json:"availability_domain"` // The default domain to use for the hostname and DNS lookups Domain string `json:"domain"` // The desired state of an instance DesiredState InstanceDesiredState `json:"desired_state"` // The reason for the instance going to error state, if available. ErrorReason string `json:"error_reason"` // SSH Server Fingerprint presented by the instance Fingerprint string `json:"fingerprint"` // Fully Qualified Domain Name FQDN string `json:"name"` // The hostname for the instance Hostname string `json:"hostname"` // The format of the image ImageFormat string `json:"image_format"` // Name of imagelist to be launched. ImageList string `json:"imagelist"` // IP address of the instance. IPAddress string `json:"ip"` // A label assigned by the user, specifically for defining inter-instance relationships. Label string `json:"label"` // Name of this instance, generated by the server. Name string // A list of strings specifying arbitrary tags on nodes to be matched on placement. PlacementRequirements []string `json:"placement_requirements"` // The OS platform for the instance. Platform string `json:"platform"` // The priority at which this instance will be run Priority string `json:"priority"` // Reference to the QuotaReservation, to be destroyed with the instance QuotaReservation string `json:"quota_reservation"` // Array of relationship specifications to be satisfied on this instance's placement Relationships []string `json:"relationships"` // Resolvers to use instead of the default resolvers Resolvers []string `json:"resolvers"` // Type of instance, as defined on site configuration. Shape string `json:"shape"` // Site to run on Site string `json:"site"` // ID's of SSH keys that will be exposed to the instance. SSHKeys []string `json:"sshkeys"` // The start time of the instance StartTime string `json:"start_time"` // State of the instance. State InstanceState `json:"state"` // The Storage Attachment information. Storage []StorageAttachment `json:"storage_attachments"` // Array of tags associated with the instance. Tags []string `json:"tags"` // vCable for this instance. VCableID string `json:"vcable_id"` // IP Address and port of the VNC console for the instance VNC string `json:"vnc"` // Add PTR records for the hostname ReverseDNS bool `json:"reverse_dns"` // Specify if the devices created for the instance are virtio devices. If not specified, the default // will come from the cluster configuration file Virtio bool `json:"virtio,omitempty"` // Optional ImageListEntry number. Default will be used if not specified Entry int `json:"entry"` // Boot order list. BootOrder []int `json:"boot_order"` // A dictionary of attributes to be made available to the instance. // A value with the key "userdata" will be made available in an EC2-compatible manner. Attributes map[string]interface{} `json:"attributes"` // Mapping of to network specifiers for virtual NICs to be attached to this instance. Networking map[string]NetworkingInfo `json:"networking"` } // StorageAttachment specifies the parameters for a storage attachment type StorageAttachment struct { // The index number for the volume. Index int `json:"index"` // The three-part name (/Compute-identity_domain/user/object) of the storage attachment. Name string `json:"name"` // The three-part name (/Compute-identity_domain/user/object) of the storage volume attached to the instance. StorageVolumeName string `json:"storage_volume_name"` } func (i *InstanceInfo) getInstanceName() string { return fmt.Sprintf(cmpQualifiedName, i.Name, i.ID) } // CreateInstanceInput specifies the parameters needed to create an instance type CreateInstanceInput struct { // A dictionary of user-defined attributes to be made available to the instance. // Optional Attributes map[string]interface{} `json:"attributes"` // Boot order list // Optional BootOrder []int `json:"boot_order,omitempty"` // The desired state of the opc instance. Can only be `running` or `shutdown` // Omits if empty. // Optional DesiredState InstanceDesiredState `json:"desired_state,omitempty"` // ImageListEntry number. Default will be used if not specified // Optional Entry int `json:"entry,omitempty"` // The host name assigned to the instance. On an Oracle Linux instance, // this host name is displayed in response to the hostname command. // Only relative DNS is supported. The domain name is suffixed to the host name // that you specify. The host name must not end with a period. If you don't specify a // host name, then a name is generated automatically. // Optional Hostname string `json:"hostname"` // Name of imagelist to be launched. // Optional ImageList string `json:"imagelist"` // A label assigned by the user, specifically for defining inter-instance relationships. // Optional Label string `json:"label"` // Name of this instance, generated by the server. // Optional Name string `json:"name"` // Networking information. // Optional Networking map[string]NetworkingInfo `json:"networking"` // If set to true (default), then reverse DNS records are created. // If set to false, no reverse DNS records are created. // Optional ReverseDNS bool `json:"reverse_dns,omitempty"` // Type of instance, as defined on site configuration. // Required Shape string `json:"shape"` // A list of the Storage Attachments you want to associate with the instance. // Optional Storage []StorageAttachmentInput `json:"storage_attachments,omitempty"` // A list of the SSH public keys that you want to associate with the instance. // Optional SSHKeys []string `json:"sshkeys"` // A list of tags to be supplied to the instance // Optional Tags []string `json:"tags"` // Time to wait for an instance to be ready Timeout time.Duration `json:"-"` } // StorageAttachmentInput specifies the attributes needed to attach a storage attachment type StorageAttachmentInput struct { // The index number for the volume. The allowed range is 1 to 10. // If you want to use a storage volume as the boot disk for an instance, you must specify the index number for that volume as 1. // The index determines the device name by which the volume is exposed to the instance. Index int `json:"index"` // The three-part name (/Compute-identity_domain/user/object) of the storage volume that you want to attach to the instance. // Note that volumes attached to an instance at launch time can't be detached. Volume string `json:"volume"` } // ReservationPrefix - ipreservation const ReservationPrefix = "ipreservation" // ReservationIPPrefix - network/v1/ipreservation const ReservationIPPrefix = "network/v1/ipreservation" // NICModel specifies the constants that a nic model can be in type NICModel string const ( // NICDefaultModel - e1000 NICDefaultModel NICModel = "e1000" ) // NetworkingInfo struct of Networking info from a populated instance, or to be used as input to create an instance type NetworkingInfo struct { // The DNS name for the Shared network (Required) // DNS A Record for an IP Network (Optional) DNS []string `json:"dns,omitempty"` // IP Network only. // If you want to associate a static private IP Address, // specify that here within the range of the supplied IPNetwork attribute. // Optional IPAddress string `json:"ip,omitempty"` // IP Network only. // The name of the IP Network you want to add the instance to. // Required IPNetwork string `json:"ipnetwork,omitempty"` // IP Network only. // Set interface as default gateway for all traffic // Optional IsDefaultGateway bool `json:"is_default_gateway,omitempty"` // IP Network only. // The hexadecimal MAC Address of the interface // Optional MACAddress string `json:"address,omitempty"` // Shared Network only. // The type of NIC used. Must be set to 'e1000' // Required Model NICModel `json:"model,omitempty"` // IP Network and Shared Network // The name servers that are sent through DHCP as option 6. // You can specify a maximum of eight name server IP addresses per interface. // Optional NameServers []string `json:"name_servers,omitempty"` // The names of an IP Reservation to associate in an IP Network (Optional) // Indicates whether a temporary or permanent public IP Address should be assigned // in a Shared Network (Required) Nat []string `json:"nat,omitempty"` // IP Network and Shared Network // The search domains that should be sent through DHCP as option 119. // You can enter a maximum of eight search domain zones per interface. // Optional SearchDomains []string `json:"search_domains,omitempty"` // Shared Network only. // The security lists that you want to add the instance to // Required SecLists []string `json:"seclists,omitempty"` // IP Network Only // The name of the vNIC // Optional Vnic string `json:"vnic,omitempty"` // IP Network only. // The names of the vNICSets you want to add the interface to. // Optional VnicSets []string `json:"vnicsets,omitempty"` } // LaunchPlanInput defines a launch plan, used to launch instances with the supplied InstanceSpec(s) type LaunchPlanInput struct { // Describes an array of instances which should be launched Instances []CreateInstanceInput `json:"instances"` // Time to wait between polls to check status PollInterval time.Duration `json:"-"` // Time to wait for instance boot Timeout time.Duration `json:"-"` } // LaunchPlanResponse details the response recieved when submitting a launchplan type LaunchPlanResponse struct { // An array of instances which have been launched Instances []InstanceInfo `json:"instances"` } // CreateInstance creates and submits a LaunchPlan to launch a new instance. func (c *InstancesClient) CreateInstance(input *CreateInstanceInput) (*InstanceInfo, error) { qualifiedSSHKeys := []string{} for _, key := range input.SSHKeys { qualifiedSSHKeys = append(qualifiedSSHKeys, c.getQualifiedName(key)) } input.SSHKeys = qualifiedSSHKeys qualifiedStorageAttachments := []StorageAttachmentInput{} for _, attachment := range input.Storage { qualifiedStorageAttachments = append(qualifiedStorageAttachments, StorageAttachmentInput{ Index: attachment.Index, Volume: c.getQualifiedName(attachment.Volume), }) } input.Storage = qualifiedStorageAttachments input.Networking = c.qualifyNetworking(input.Networking) input.Name = c.getQualifiedName(input.Name) plan := LaunchPlanInput{ Instances: []CreateInstanceInput{*input}, Timeout: input.Timeout, } var ( instanceInfo *InstanceInfo instanceError error ) for i := 0; i < *c.Client.client.MaxRetries; i++ { c.client.DebugLogString(fmt.Sprintf("(Iteration: %d of %d) Creating instance with name %s\n Plan: %+v", i, *c.Client.client.MaxRetries, input.Name, plan)) instanceInfo, instanceError = c.startInstance(input.Name, plan) if instanceError == nil { c.client.DebugLogString(fmt.Sprintf("(Iteration: %d of %d) Finished creating instance with name %s\n Info: %+v", i, *c.Client.client.MaxRetries, input.Name, instanceInfo)) return instanceInfo, nil } } return nil, instanceError } func (c *InstancesClient) startInstance(name string, plan LaunchPlanInput) (*InstanceInfo, error) { var responseBody LaunchPlanResponse if err := c.createResource(&plan, &responseBody); err != nil { return nil, err } if len(responseBody.Instances) == 0 { return nil, fmt.Errorf("No instance information returned: %#v", responseBody) } // Call wait for instance ready now, as creating the instance is an eventually consistent operation getInput := &GetInstanceInput{ Name: name, ID: responseBody.Instances[0].ID, } if plan.PollInterval == 0 { plan.PollInterval = waitForInstanceReadyPollInterval } if plan.Timeout == 0 { plan.Timeout = waitForInstanceReadyTimeout } // Wait for instance to be ready and return the result // Don't have to unqualify any objects, as the GetInstance method will handle that instanceInfo, instanceError := c.WaitForInstanceRunning(getInput, plan.PollInterval, plan.Timeout) // If the instance enters an error state we need to delete the instance and retry if instanceError != nil { deleteInput := &DeleteInstanceInput{ Name: name, ID: responseBody.Instances[0].ID, } err := c.DeleteInstance(deleteInput) if err != nil { return nil, fmt.Errorf("Error deleting instance %s: %s", name, err) } return nil, instanceError } return instanceInfo, nil } // GetInstanceInput specifies the parameters needed to retrieve an instance type GetInstanceInput struct { // The Unqualified Name of this Instance // Required Name string // The Unqualified ID of this Instance // Required ID string } func (g *GetInstanceInput) String() string { return fmt.Sprintf(cmpQualifiedName, g.Name, g.ID) } // GetInstance retrieves information about an instance. func (c *InstancesClient) GetInstance(input *GetInstanceInput) (*InstanceInfo, error) { if input.ID == "" || input.Name == "" { return nil, errors.New("Both instance name and ID need to be specified") } var responseBody InstanceInfo if err := c.getResource(input.String(), &responseBody); err != nil { return nil, err } if responseBody.FQDN == "" { return nil, fmt.Errorf("Empty response body when requesting instance %s", input.Name) } // The returned 'Name' attribute is the fully qualified instance name + "/" + ID // Split these out to accurately populate the fields nID := strings.Split(c.getUnqualifiedName(responseBody.FQDN), "/") responseBody.Name = nID[0] responseBody.ID = nID[1] c.unqualify(&responseBody.VCableID) // Unqualify SSH Key names sshKeyNames := []string{} for _, sshKeyRef := range responseBody.SSHKeys { sshKeyNames = append(sshKeyNames, c.getUnqualifiedName(sshKeyRef)) } responseBody.SSHKeys = sshKeyNames var networkingErr error responseBody.Networking, networkingErr = c.unqualifyNetworking(responseBody.Networking) if networkingErr != nil { return nil, networkingErr } responseBody.Storage = c.unqualifyStorage(responseBody.Storage) return &responseBody, nil } // InstancesInfo specifies a list of instances type InstancesInfo struct { Instances []InstanceInfo `json:"result"` } // GetInstanceIDInput specifies the parameters needed to retrieve an instance type GetInstanceIDInput struct { // Name of the instance you want to get Name string } // GetInstanceFromName loops through all the instances and finds the instance for the given name // This is needed for orchestration since it doesn't return the id for the instance it creates. func (c *InstancesClient) GetInstanceFromName(input *GetInstanceIDInput) (*InstanceInfo, error) { input.Name = c.getQualifiedName(input.Name) var instancesInfo InstancesInfo if err := c.getResource(fmt.Sprintf("%s/", c.getUserName()), &instancesInfo); err != nil { return nil, err } for _, i := range instancesInfo.Instances { if strings.Contains(i.FQDN, input.Name) { if i.Name == "" { return nil, fmt.Errorf("Empty response body when requesting instance %s", input.Name) } // The returned 'Name' attribute is the fully qualified instance name + "/" + ID // Split these out to accurately populate the fields nID := strings.Split(c.getUnqualifiedName(i.FQDN), "/") i.Name = nID[0] i.ID = nID[1] c.unqualify(&i.VCableID) // Unqualify SSH Key names sshKeyNames := []string{} for _, sshKeyRef := range i.SSHKeys { sshKeyNames = append(sshKeyNames, c.getUnqualifiedName(sshKeyRef)) } i.SSHKeys = sshKeyNames var networkingErr error i.Networking, networkingErr = c.unqualifyNetworking(i.Networking) if networkingErr != nil { return nil, networkingErr } i.Storage = c.unqualifyStorage(i.Storage) return &i, nil } } return nil, fmt.Errorf("Unable to find instance: %q", input.Name) } // UpdateInstanceInput specifies the parameters needed to update an instance type UpdateInstanceInput struct { // Name of this instance, generated by the server. // Required Name string `json:"name"` // The desired state of the opc instance. Can only be `running` or `shutdown` // Omits if empty. // Optional DesiredState InstanceDesiredState `json:"desired_state,omitempty"` // The ID of the instance // Required ID string `json:"-"` // A list of tags to be supplied to the instance // Optional Tags []string `json:"tags,omitempty"` // Time to wait between polls for instance state PollInterval time.Duration `json:"-"` // Time to wait for instance to be ready, or shutdown depending on desired state Timeout time.Duration `json:"-"` } func (g *UpdateInstanceInput) String() string { return fmt.Sprintf(cmpQualifiedName, g.Name, g.ID) } // UpdateInstance updates an instance with the specified attributes func (c *InstancesClient) UpdateInstance(input *UpdateInstanceInput) (*InstanceInfo, error) { if input.Name == "" || input.ID == "" { return nil, errors.New("Both instance name and ID need to be specified") } input.Name = fmt.Sprintf(cmpQualifiedName, c.getUserName(), input.Name) var responseBody InstanceInfo if err := c.updateResource(input.String(), input, &responseBody); err != nil { return nil, err } getInput := &GetInstanceInput{ Name: input.Name, ID: input.ID, } if input.PollInterval == 0 { input.PollInterval = waitForInstanceReadyPollInterval } if input.Timeout == 0 { input.Timeout = waitForInstanceReadyTimeout } // Wait for the correct instance action depending on the current desired state. // If the instance is already running, and the desired state is to be "running", the // wait loop will only execute a single time to verify the instance state. Otherwise // we wait until the correct action has finalized, either a shutdown or restart, catching // any intermittent errors during the process. if responseBody.DesiredState == InstanceDesiredRunning { return c.WaitForInstanceRunning(getInput, input.PollInterval, input.Timeout) } return c.WaitForInstanceShutdown(getInput, input.PollInterval, input.Timeout) } // DeleteInstanceInput specifies the parameters needed to delete an instance type DeleteInstanceInput struct { // The Unqualified Name of this Instance Name string // The Unqualified ID of this Instance ID string // Time to wait between polls to check status PollInterval time.Duration // Time to wait for instance to be deleted Timeout time.Duration } func (d *DeleteInstanceInput) String() string { return fmt.Sprintf(cmpQualifiedName, d.Name, d.ID) } // DeleteInstance deletes an instance. func (c *InstancesClient) DeleteInstance(input *DeleteInstanceInput) error { // Call to delete the instance if err := c.deleteResource(input.String()); err != nil { return err } if input.PollInterval == 0 { input.PollInterval = waitForInstanceDeletePollInterval } if input.Timeout == 0 { input.Timeout = waitForInstanceDeleteTimeout } // Wait for instance to be deleted return c.WaitForInstanceDeleted(input, input.PollInterval, input.Timeout) } // WaitForInstanceRunning waits for an instance to be completely initialized and available. func (c *InstancesClient) WaitForInstanceRunning(input *GetInstanceInput, pollInterval, timeout time.Duration) (*InstanceInfo, error) { var info *InstanceInfo var getErr error err := c.client.WaitFor("instance to be ready", pollInterval, timeout, func() (bool, error) { info, getErr = c.GetInstance(input) if getErr != nil { return false, getErr } c.client.DebugLogString(fmt.Sprintf("Instance name is %v, Instance info is %+v", info.Name, info)) switch s := info.State; s { case InstanceError: return false, fmt.Errorf("Error initializing instance: %s", info.ErrorReason) case InstanceRunning: // Target State c.client.DebugLogString("Instance Running") return true, nil case InstanceQueued: c.client.DebugLogString("Instance Queuing") return false, nil case InstanceInitializing: c.client.DebugLogString("Instance Initializing") return false, nil case InstancePreparing: c.client.DebugLogString("Instance Preparing") return false, nil case InstanceStarting: c.client.DebugLogString("Instance Starting") return false, nil default: c.client.DebugLogString(fmt.Sprintf("Unknown instance state: %s, waiting", s)) return false, nil } }) return info, err } // WaitForInstanceShutdown waits for an instance to be shutdown func (c *InstancesClient) WaitForInstanceShutdown(input *GetInstanceInput, pollInterval, timeout time.Duration) (*InstanceInfo, error) { var info *InstanceInfo var getErr error err := c.client.WaitFor("instance to be shutdown", pollInterval, timeout, func() (bool, error) { info, getErr = c.GetInstance(input) if getErr != nil { return false, getErr } switch s := info.State; s { case InstanceError: return false, fmt.Errorf("Error initializing instance: %s", info.ErrorReason) case InstanceRunning: c.client.DebugLogString("Instance Running") return false, nil case InstanceQueued: c.client.DebugLogString("Instance Queuing") return false, nil case InstanceInitializing: c.client.DebugLogString("Instance Initializing") return false, nil case InstancePreparing: c.client.DebugLogString("Instance Preparing") return false, nil case InstanceStarting: c.client.DebugLogString("Instance Starting") return false, nil case InstanceShutdown: // Target State c.client.DebugLogString("Instance Shutdown") return true, nil default: c.client.DebugLogString(fmt.Sprintf("Unknown instance state: %s, waiting", s)) return false, nil } }) return info, err } // WaitForInstanceDeleted waits for an instance to be fully deleted. func (c *InstancesClient) WaitForInstanceDeleted(input fmt.Stringer, pollInterval, timeout time.Duration) error { return c.client.WaitFor("instance to be deleted", pollInterval, timeout, func() (bool, error) { var info InstanceInfo if err := c.getResource(input.String(), &info); err != nil { if client.WasNotFoundError(err) { // Instance could not be found, thus deleted return true, nil } // Some other error occurred trying to get instance, exit return false, err } switch s := info.State; s { case InstanceError: return false, fmt.Errorf("Error stopping instance: %s", info.ErrorReason) case InstanceStopping: c.client.DebugLogString("Instance stopping") return false, nil default: c.client.DebugLogString(fmt.Sprintf("Unknown instance state: %s, waiting", s)) return false, nil } }) } func (c *InstancesClient) qualifyNetworking(info map[string]NetworkingInfo) map[string]NetworkingInfo { qualifiedNetworks := map[string]NetworkingInfo{} for k, v := range info { qfd := v sharedNetwork := false if v.IPNetwork != "" { // Network interface is for an IP Network qfd.IPNetwork = c.getQualifiedName(v.IPNetwork) sharedNetwork = true } if v.Vnic != "" { qfd.Vnic = c.getQualifiedName(v.Vnic) } if v.Nat != nil { qfd.Nat = c.qualifyNat(v.Nat, sharedNetwork) } if v.VnicSets != nil { qfd.VnicSets = c.getQualifiedList(v.VnicSets) } if v.SecLists != nil { // Network interface is for the shared network qfd.SecLists = c.getQualifiedList(v.SecLists) } qualifiedNetworks[k] = qfd } return qualifiedNetworks } func (c *InstancesClient) unqualifyNetworking(info map[string]NetworkingInfo) (map[string]NetworkingInfo, error) { // Unqualify ip network var err error unqualifiedNetworks := map[string]NetworkingInfo{} for k, v := range info { unq := v if v.IPNetwork != "" { unq.IPNetwork = c.getUnqualifiedName(v.IPNetwork) } if v.Vnic != "" { unq.Vnic = c.getUnqualifiedName(v.Vnic) } if v.Nat != nil { unq.Nat, err = c.unqualifyNat(v.Nat) if err != nil { return nil, err } } if v.VnicSets != nil { unq.VnicSets = c.getUnqualifiedList(v.VnicSets) } if v.SecLists != nil { unq.SecLists = c.getUnqualifiedList(v.SecLists) } unqualifiedNetworks[k] = unq } return unqualifiedNetworks, nil } func (c *InstancesClient) qualifyNat(nat []string, shared bool) []string { qualifiedNats := []string{} for _, v := range nat { if strings.HasPrefix(v, "ippool:/oracle") { qualifiedNats = append(qualifiedNats, v) continue } prefix := ReservationPrefix if shared { prefix = ReservationIPPrefix } qualifiedNats = append(qualifiedNats, fmt.Sprintf("%s:%s", prefix, c.getQualifiedName(v))) } return qualifiedNats } func (c *InstancesClient) unqualifyNat(nat []string) ([]string, error) { unQualifiedNats := []string{} for _, v := range nat { if strings.HasPrefix(v, "ippool:/oracle") { unQualifiedNats = append(unQualifiedNats, v) continue } n := strings.Split(v, ":") if len(n) < 1 { return nil, fmt.Errorf("Error unqualifying NAT: %s", v) } u := n[1] unQualifiedNats = append(unQualifiedNats, c.getUnqualifiedName(u)) } return unQualifiedNats, nil } func (c *InstancesClient) unqualifyStorage(attachments []StorageAttachment) []StorageAttachment { unqAttachments := []StorageAttachment{} for _, v := range attachments { if v.StorageVolumeName != "" { v.StorageVolumeName = c.getUnqualifiedName(v.StorageVolumeName) } unqAttachments = append(unqAttachments, v) } return unqAttachments } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ip_address_associations.go�0000664�0000000�0000000�00000011023�13771713062�0033542�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( iPAddressAssociationDescription = "ip address association" iPAddressAssociationContainerPath = "/network/v1/ipassociation/" iPAddressAssociationResourcePath = "/network/v1/ipassociation" ) // IPAddressAssociationsClient details the parameters for an ip address association client type IPAddressAssociationsClient struct { ResourceClient } // IPAddressAssociations returns an IPAddressAssociationsClient that can be used to access the // necessary CRUD functions for IP Address Associations. func (c *Client) IPAddressAssociations() *IPAddressAssociationsClient { return &IPAddressAssociationsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: iPAddressAssociationDescription, ContainerPath: iPAddressAssociationContainerPath, ResourceRootPath: iPAddressAssociationResourcePath, }, } } // IPAddressAssociationInfo contains the exported fields necessary to hold all the information about an // IP Address Association type IPAddressAssociationInfo struct { // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the NAT IP address reservation. IPAddressReservation string `json:"ipAddressReservation"` // Name of the virtual NIC associated with this NAT IP reservation. Vnic string `json:"vnic"` // The name of the IP Address Association Name string // Description of the IP Address Association Description string `json:"description"` // Slice of tags associated with the IP Address Association Tags []string `json:"tags"` // Uniform Resource Identifier for the IP Address Association URI string `json:"uri"` } // CreateIPAddressAssociationInput details the attributes needed to create an ip address association type CreateIPAddressAssociationInput struct { // The name of the IP Address Association to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // The name of the NAT IP address reservation. // Optional IPAddressReservation string `json:"ipAddressReservation,omitempty"` // Name of the virtual NIC associated with this NAT IP reservation. // Optional Vnic string `json:"vnic,omitempty"` // Description of the IPAddressAssociation // Optional Description string `json:"description"` // String slice of tags to apply to the IP Address Association object // Optional Tags []string `json:"tags"` } // CreateIPAddressAssociation creates a new IP Address Association from an IPAddressAssociationsClient and an input struct. // Returns a populated Info struct for the IP Address Association, and any errors func (c *IPAddressAssociationsClient) CreateIPAddressAssociation(input *CreateIPAddressAssociationInput) (*IPAddressAssociationInfo, error) { input.Name = c.getQualifiedName(input.Name) input.IPAddressReservation = c.getQualifiedName(input.IPAddressReservation) input.Vnic = c.getQualifiedName(input.Vnic) var ipInfo IPAddressAssociationInfo if err := c.createResource(&input, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // GetIPAddressAssociationInput details the parameters needed to retrieve an ip address association type GetIPAddressAssociationInput struct { // The name of the IP Address Association to query for. Case-sensitive // Required Name string `json:"name"` } // GetIPAddressAssociation returns a populated IPAddressAssociationInfo struct from an input struct func (c *IPAddressAssociationsClient) GetIPAddressAssociation(input *GetIPAddressAssociationInput) (*IPAddressAssociationInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo IPAddressAssociationInfo if err := c.getResource(input.Name, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // DeleteIPAddressAssociationInput details the parameters neccessary to delete an ip address association type DeleteIPAddressAssociationInput struct { // The name of the IP Address Association to query for. Case-sensitive // Required Name string `json:"name"` } // DeleteIPAddressAssociation deletes the specified ip address association func (c *IPAddressAssociationsClient) DeleteIPAddressAssociation(input *DeleteIPAddressAssociationInput) error { return c.deleteResource(input.Name) } // Unqualifies any qualified fields in the IPAddressAssociationInfo struct func (c *IPAddressAssociationsClient) success(info *IPAddressAssociationInfo) (*IPAddressAssociationInfo, error) { info.Name = c.getUnqualifiedName(info.FQDN) c.unqualify(&info.Vnic) c.unqualify(&info.IPAddressReservation) return info, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ip_address_prefix_set.go���0000664�0000000�0000000�00000012132�13771713062�0033215�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( iPAddressPrefixSetDescription = "ip address prefix set" iPAddressPrefixSetContainerPath = "/network/v1/ipaddressprefixset/" iPAddressPrefixSetResourcePath = "/network/v1/ipaddressprefixset" ) // IPAddressPrefixSetsClient details the parameters for an ipaddress prefix set client type IPAddressPrefixSetsClient struct { ResourceClient } // IPAddressPrefixSets returns an IPAddressPrefixSetsClient that can be used to access the // necessary CRUD functions for IP Address Prefix Sets. func (c *Client) IPAddressPrefixSets() *IPAddressPrefixSetsClient { return &IPAddressPrefixSetsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: iPAddressPrefixSetDescription, ContainerPath: iPAddressPrefixSetContainerPath, ResourceRootPath: iPAddressPrefixSetResourcePath, }, } } // IPAddressPrefixSetInfo contains the exported fields necessary to hold all the information about an // IP Address Prefix Set type IPAddressPrefixSetInfo struct { // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the IP Address Prefix Set Name string // Description of the IP Address Prefix Set Description string `json:"description"` // List of CIDR IPv4 prefixes assigned in the virtual network. IPAddressPrefixes []string `json:"ipAddressPrefixes"` // Slice of tags associated with the IP Address Prefix Set Tags []string `json:"tags"` // Uniform Resource Identifier for the IP Address Prefix Set URI string `json:"uri"` } // CreateIPAddressPrefixSetInput details the parameters to create an ip address prefix set type CreateIPAddressPrefixSetInput struct { // The name of the IP Address Prefix Set to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Description of the IPAddressPrefixSet // Optional Description string `json:"description"` // List of CIDR IPv4 prefixes assigned in the virtual network. // Optional IPAddressPrefixes []string `json:"ipAddressPrefixes"` // String slice of tags to apply to the IP Address Prefix Set object // Optional Tags []string `json:"tags"` } // CreateIPAddressPrefixSet creates a new IP Address Prefix Set from an IPAddressPrefixSetsClient and an input struct. // Returns a populated Info struct for the IP Address Prefix Set, and any errors func (c *IPAddressPrefixSetsClient) CreateIPAddressPrefixSet(input *CreateIPAddressPrefixSetInput) (*IPAddressPrefixSetInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo IPAddressPrefixSetInfo if err := c.createResource(&input, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // GetIPAddressPrefixSetInput details the parameters to retrieve an ip address prefix set type GetIPAddressPrefixSetInput struct { // The name of the IP Address Prefix Set to query for. Case-sensitive // Required Name string `json:"name"` } // GetIPAddressPrefixSet returns a populated IPAddressPrefixSetInfo struct from an input struct func (c *IPAddressPrefixSetsClient) GetIPAddressPrefixSet(input *GetIPAddressPrefixSetInput) (*IPAddressPrefixSetInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo IPAddressPrefixSetInfo if err := c.getResource(input.Name, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // UpdateIPAddressPrefixSetInput defines what to update in a ip address prefix set type UpdateIPAddressPrefixSetInput struct { // The name of the IP Address Prefix Set to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Description of the IPAddressPrefixSet // Optional Description string `json:"description"` // List of CIDR IPv4 prefixes assigned in the virtual network. IPAddressPrefixes []string `json:"ipAddressPrefixes"` // String slice of tags to apply to the IP Address Prefix Set object // Optional Tags []string `json:"tags"` } // UpdateIPAddressPrefixSet update the ip address prefix set func (c *IPAddressPrefixSetsClient) UpdateIPAddressPrefixSet(updateInput *UpdateIPAddressPrefixSetInput) (*IPAddressPrefixSetInfo, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) var ipInfo IPAddressPrefixSetInfo if err := c.updateResource(updateInput.Name, updateInput, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // DeleteIPAddressPrefixSetInput details the parameters to delete an ip address prefix set type DeleteIPAddressPrefixSetInput struct { // The name of the IP Address Prefix Set to query for. Case-sensitive // Required Name string `json:"name"` } // DeleteIPAddressPrefixSet deletes the specified ip address prefix set func (c *IPAddressPrefixSetsClient) DeleteIPAddressPrefixSet(input *DeleteIPAddressPrefixSetInput) error { return c.deleteResource(input.Name) } // Unqualifies any qualified fields in the IPAddressPrefixSetInfo struct func (c *IPAddressPrefixSetsClient) success(info *IPAddressPrefixSetInfo) (*IPAddressPrefixSetInfo, error) { info.Name = c.getUnqualifiedName(info.FQDN) return info, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ip_address_reservations.go�0000664�0000000�0000000�00000014536�13771713062�0033603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "path/filepath" ) // IPAddressReservationsClient is a client to manage ip address reservation resources type IPAddressReservationsClient struct { *ResourceClient } const ( iPAddressReservationDescription = "IP Address Reservation" iPAddressReservationContainerPath = "/network/v1/ipreservation/" iPAddressReservationResourcePath = "/network/v1/ipreservation" iPAddressReservationQualifier = "/oracle/public" ) // IPAddressReservations returns an IPAddressReservationsClient to manage IP address reservation // resources func (c *Client) IPAddressReservations() *IPAddressReservationsClient { return &IPAddressReservationsClient{ ResourceClient: &ResourceClient{ Client: c, ResourceDescription: iPAddressReservationDescription, ContainerPath: iPAddressReservationContainerPath, ResourceRootPath: iPAddressReservationResourcePath, }, } } // IPAddressReservation describes an IP Address reservation type IPAddressReservation struct { // Description of the IP Address Reservation Description string `json:"description"` // Fully Qualified Domain Name FQDN string `json:"name"` // Reserved NAT IPv4 address from the IP Address Pool IPAddress string `json:"ipAddress"` // Name of the IP Address pool to reserve the NAT IP from IPAddressPool string `json:"ipAddressPool"` // Name of the reservation Name string // Tags associated with the object Tags []string `json:"tags"` // Uniform Resource Identified for the reservation URI string `json:"uri"` } const ( // PublicIPAddressPool - public-ippool PublicIPAddressPool = "public-ippool" // PrivateIPAddressPool - cloud-ippool PrivateIPAddressPool = "cloud-ippool" ) // CreateIPAddressReservationInput defines input parameters to create an ip address reservation type CreateIPAddressReservationInput struct { // Description of the IP Address Reservation // Optional Description string `json:"description"` // IP Address pool from which to reserve an IP Address. // Can be one of the following: // // 'public-ippool' - When you attach an IP Address from this pool to an instance, you enable // access between the public Internet and the instance // 'cloud-ippool' - When you attach an IP Address from this pool to an instance, the instance // can communicate privately with other Oracle Cloud Services // Optional IPAddressPool string `json:"ipAddressPool"` // The name of the reservation to create // Required Name string `json:"name"` // Tags to associate with the IP Reservation // Optional Tags []string `json:"tags"` } // CreateIPAddressReservation creates an IP Address reservation, and returns the info struct and any errors func (c *IPAddressReservationsClient) CreateIPAddressReservation(input *CreateIPAddressReservationInput) (*IPAddressReservation, error) { var ipAddrRes IPAddressReservation // Qualify supplied name input.Name = c.getQualifiedName(input.Name) // Qualify supplied address pool if not nil if input.IPAddressPool != "" { input.IPAddressPool = c.qualifyIPAddressPool(input.IPAddressPool) } if err := c.createResource(input, &ipAddrRes); err != nil { return nil, err } return c.success(&ipAddrRes) } // GetIPAddressReservationInput details the parameters to retrieve information on an ip address reservation type GetIPAddressReservationInput struct { // Name of the IP Reservation // Required Name string `json:"name"` } // GetIPAddressReservation returns an IP Address Reservation and any errors func (c *IPAddressReservationsClient) GetIPAddressReservation(input *GetIPAddressReservationInput) (*IPAddressReservation, error) { var ipAddrRes IPAddressReservation input.Name = c.getQualifiedName(input.Name) if err := c.getResource(input.Name, &ipAddrRes); err != nil { return nil, err } return c.success(&ipAddrRes) } // UpdateIPAddressReservationInput details the parameters to update an IP Address reservation type UpdateIPAddressReservationInput struct { // Description of the IP Address Reservation // Optional Description string `json:"description"` // IP Address pool from which to reserve an IP Address. // Can be one of the following: // // 'public-ippool' - When you attach an IP Address from this pool to an instance, you enable // access between the public Internet and the instance // 'cloud-ippool' - When you attach an IP Address from this pool to an instance, the instance // can communicate privately with other Oracle Cloud Services // Optional IPAddressPool string `json:"ipAddressPool"` // The name of the reservation to create // Required Name string `json:"name"` // Tags to associate with the IP Reservation // Optional Tags []string `json:"tags"` } // UpdateIPAddressReservation updates the specified ip address reservation func (c *IPAddressReservationsClient) UpdateIPAddressReservation(input *UpdateIPAddressReservationInput) (*IPAddressReservation, error) { var ipAddrRes IPAddressReservation // Qualify supplied name input.Name = c.getQualifiedName(input.Name) // Qualify supplied address pool if not nil if input.IPAddressPool != "" { input.IPAddressPool = c.qualifyIPAddressPool(input.IPAddressPool) } if err := c.updateResource(input.Name, input, &ipAddrRes); err != nil { return nil, err } return c.success(&ipAddrRes) } // DeleteIPAddressReservationInput details the parameters to delete an IP Address Reservation type DeleteIPAddressReservationInput struct { // The name of the reservation to delete Name string `json:"name"` } // DeleteIPAddressReservation deletes the specified ip address reservation func (c *IPAddressReservationsClient) DeleteIPAddressReservation(input *DeleteIPAddressReservationInput) error { input.Name = c.getQualifiedName(input.Name) return c.deleteResource(input.Name) } func (c *IPAddressReservationsClient) success(result *IPAddressReservation) (*IPAddressReservation, error) { result.Name = c.getUnqualifiedName(result.FQDN) if result.IPAddressPool != "" { result.IPAddressPool = c.unqualifyIPAddressPool(result.IPAddressPool) } return result, nil } func (c *IPAddressReservationsClient) qualifyIPAddressPool(input string) string { // Add '/oracle/public/' return fmt.Sprintf("%s/%s", iPAddressReservationQualifier, input) } func (c *IPAddressReservationsClient) unqualifyIPAddressPool(input string) string { // Remove '/oracle/public/' return filepath.Base(input) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ip_associations.go���������0000664�0000000�0000000�00000010643�13771713062�0032044�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "strings" ) // IPAssociationsClient is a client for the IP Association functions of the Compute API. type IPAssociationsClient struct { *ResourceClient } // IPAssociations obtains a IPAssociationsClient which can be used to access to the // IP Association functions of the Compute API func (c *Client) IPAssociations() *IPAssociationsClient { return &IPAssociationsClient{ ResourceClient: &ResourceClient{ Client: c, ResourceDescription: "ip association", ContainerPath: "/ip/association/", ResourceRootPath: "/ip/association", }} } // IPAssociationInfo describes an existing IP association. type IPAssociationInfo struct { // TODO: it'd probably make sense to expose the `ip` field here too? // Fully Qualified Domain Name FQDN string `json:"name"` // The three-part name of the object (/Compute-identity_domain/user/object). Name string // The three-part name of the IP reservation object in the format (/Compute-identity_domain/user/object). // An IP reservation is a public IP address which is attached to an Oracle Compute Cloud Service instance that requires access to or from the Internet. Reservation string `json:"reservation"` // The type of IP Address to associate with this instance // for a Dynamic IP address specify `ippool:/oracle/public/ippool`. // for a Static IP address specify the three part name of the existing IP reservation ParentPool string `json:"parentpool"` // Uniform Resource Identifier for the IP Association URI string `json:"uri"` // The three-part name of a vcable ID of an instance that is associated with the IP reservation. VCable string `json:"vcable"` } // CreateIPAssociationInput details the attributes neccessary to create an ip association type CreateIPAssociationInput struct { // The type of IP Address to associate with this instance // for a Dynamic IP address specify `ippool:/oracle/public/ippool`. // for a Static IP address specify the three part name of the existing IP reservation // Required ParentPool string `json:"parentpool"` // The three-part name of the vcable ID of the instance that you want to associate with an IP address. The three-part name is in the format: /Compute-identity_domain/user/object. // Required VCable string `json:"vcable"` } // CreateIPAssociation creates a new IP association with the supplied vcable and parentpool. func (c *IPAssociationsClient) CreateIPAssociation(input *CreateIPAssociationInput) (*IPAssociationInfo, error) { input.VCable = c.getQualifiedName(input.VCable) input.ParentPool = c.getQualifiedParentPoolName(input.ParentPool) var assocInfo IPAssociationInfo if err := c.createResource(input, &assocInfo); err != nil { return nil, err } return c.success(&assocInfo) } // GetIPAssociationInput details the attributes neccessary to retrieve an ip association type GetIPAssociationInput struct { // The three-part name of the IP Association // Required. Name string `json:"name"` } // GetIPAssociation retrieves the IP association with the given name. func (c *IPAssociationsClient) GetIPAssociation(input *GetIPAssociationInput) (*IPAssociationInfo, error) { var assocInfo IPAssociationInfo if err := c.getResource(input.Name, &assocInfo); err != nil { return nil, err } return c.success(&assocInfo) } // DeleteIPAssociationInput details the attributes neccessary to delete an ip association type DeleteIPAssociationInput struct { // The three-part name of the IP Association // Required. Name string `json:"name"` } // DeleteIPAssociation deletes the IP association with the given name. func (c *IPAssociationsClient) DeleteIPAssociation(input *DeleteIPAssociationInput) error { return c.deleteResource(input.Name) } func (c *IPAssociationsClient) getQualifiedParentPoolName(parentpool string) string { parts := strings.Split(parentpool, ":") pooltype := parts[0] name := parts[1] return fmt.Sprintf("%s:%s", pooltype, c.getQualifiedName(name)) } func (c *IPAssociationsClient) unqualifyParentPoolName(parentpool *string) { parts := strings.Split(*parentpool, ":") pooltype := parts[0] name := parts[1] *parentpool = fmt.Sprintf("%s:%s", pooltype, c.getUnqualifiedName(name)) } // Unqualifies identifiers func (c *IPAssociationsClient) success(assocInfo *IPAssociationInfo) (*IPAssociationInfo, error) { assocInfo.Name = c.getUnqualifiedName(assocInfo.FQDN) c.unqualify(&assocInfo.VCable) c.unqualifyParentPoolName(&assocInfo.ParentPool) return assocInfo, nil } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ip_network_exchange.go�����0000664�0000000�0000000�00000007315�13771713062�0032702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( iPNetworkExchangeDescription = "ip network exchange" iPNetworkExchangeContainerPath = "/network/v1/ipnetworkexchange/" iPNetworkExchangeResourcePath = "/network/v1/ipnetworkexchange" ) // IPNetworkExchangesClient details the ip network exchange client type IPNetworkExchangesClient struct { ResourceClient } // IPNetworkExchanges returns an IPNetworkExchangesClient that can be used to access the // necessary CRUD functions for IP Network Exchanges. func (c *Client) IPNetworkExchanges() *IPNetworkExchangesClient { return &IPNetworkExchangesClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: iPNetworkExchangeDescription, ContainerPath: iPNetworkExchangeContainerPath, ResourceRootPath: iPNetworkExchangeResourcePath, }, } } // IPNetworkExchangeInfo contains the exported fields necessary to hold all the information about an // IP Network Exchange type IPNetworkExchangeInfo struct { // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the IP Network Exchange Name string // Description of the IP Network Exchange Description string `json:"description"` // Slice of tags associated with the IP Network Exchange Tags []string `json:"tags"` // Uniform Resource Identifier for the IP Network Exchange URI string `json:"uri"` } // CreateIPNetworkExchangeInput details the attributes needed to create an ip network exchange type CreateIPNetworkExchangeInput struct { // The name of the IP Network Exchange to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Description of the IPNetworkExchange // Optional Description string `json:"description"` // String slice of tags to apply to the IP Network Exchange object // Optional Tags []string `json:"tags"` } // CreateIPNetworkExchange creates a new IP Network Exchange from an IPNetworkExchangesClient and an input struct. // Returns a populated Info struct for the IP Network Exchange, and any errors func (c *IPNetworkExchangesClient) CreateIPNetworkExchange(input *CreateIPNetworkExchangeInput) (*IPNetworkExchangeInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo IPNetworkExchangeInfo if err := c.createResource(&input, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // GetIPNetworkExchangeInput details the attributes needed to retrieve an ip network exchange type GetIPNetworkExchangeInput struct { // The name of the IP Network Exchange to query for. Case-sensitive // Required Name string `json:"name"` } // GetIPNetworkExchange returns a populated IPNetworkExchangeInfo struct from an input struct func (c *IPNetworkExchangesClient) GetIPNetworkExchange(input *GetIPNetworkExchangeInput) (*IPNetworkExchangeInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo IPNetworkExchangeInfo if err := c.getResource(input.Name, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // DeleteIPNetworkExchangeInput details the attributes neccessary to delete an ip network exchange type DeleteIPNetworkExchangeInput struct { // The name of the IP Network Exchange to query for. Case-sensitive // Required Name string `json:"name"` } // DeleteIPNetworkExchange deletes the specified ip network exchange func (c *IPNetworkExchangesClient) DeleteIPNetworkExchange(input *DeleteIPNetworkExchangeInput) error { return c.deleteResource(input.Name) } // Unqualifies any qualified fields in the IPNetworkExchangeInfo struct func (c *IPNetworkExchangesClient) success(info *IPNetworkExchangeInfo) (*IPNetworkExchangeInfo, error) { info.Name = c.getUnqualifiedName(info.FQDN) return info, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ip_networks.go�������������0000664�0000000�0000000�00000017214�13771713062�0031222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( iPNetworkDescription = "ip network" iPNetworkContainerPath = "/network/v1/ipnetwork/" iPNetworkResourcePath = "/network/v1/ipnetwork" ) // IPNetworksClient specifies the ip networks client type IPNetworksClient struct { ResourceClient } // IPNetworks returns an IPNetworksClient that can be used to access the // necessary CRUD functions for IP Networks. func (c *Client) IPNetworks() *IPNetworksClient { return &IPNetworksClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: iPNetworkDescription, ContainerPath: iPNetworkContainerPath, ResourceRootPath: iPNetworkResourcePath, }, } } // IPNetworkInfo contains the exported fields necessary to hold all the information about an // IP Network type IPNetworkInfo struct { // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the IP Network Name string // The CIDR IPv4 prefix associated with the IP Network IPAddressPrefix string `json:"ipAddressPrefix"` // Name of the IP Network Exchange associated with the IP Network IPNetworkExchange string `json:"ipNetworkExchange,omitempty"` // Description of the IP Network Description string `json:"description"` // Whether public internet access was enabled using NAPT for VNICs without any public IP reservation PublicNaptEnabled bool `json:"publicNaptEnabledFlag"` // Slice of tags associated with the IP Network Tags []string `json:"tags"` // Uniform Resource Identifier for the IP Network URI string `json:"uri"` } // CreateIPNetworkInput details the attributes needed to create an ip network type CreateIPNetworkInput struct { // The name of the IP Network to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Specify the size of the IP Subnet. It is a range of IPv4 addresses assigned in the virtual // network, in CIDR address prefix format. // While specifying the IP address prefix take care of the following points: // //* These IP addresses aren't part of the common pool of Oracle-provided IP addresses used by the shared network. // //* There's no conflict with the range of IP addresses used in another IP network, the IP addresses used your on-premises network, or with the range of private IP addresses used in the shared network. If IP networks with overlapping IP subnets are linked to an IP exchange, packets going to and from those IP networks are dropped. // //* The upper limit of the CIDR block size for an IP network is /16. // //Note: The first IP address of any IP network is reserved for the default gateway, the DHCP server, and the DNS server of that IP network. // Required IPAddressPrefix string `json:"ipAddressPrefix"` //Specify the IP network exchange to which the IP network belongs. //You can add an IP network to only one IP network exchange, but an IP network exchange //can include multiple IP networks. An IP network exchange enables access between IP networks //that have non-overlapping addresses, so that instances on these networks can exchange packets //with each other without NAT. // Optional IPNetworkExchange string `json:"ipNetworkExchange,omitempty"` // Description of the IPNetwork // Optional Description string `json:"description"` // Enable public internet access using NAPT for VNICs without any public IP reservation // Optional PublicNaptEnabled bool `json:"publicNaptEnabledFlag"` // String slice of tags to apply to the IP Network object // Optional Tags []string `json:"tags"` } // CreateIPNetwork creates a new IP Network from an IPNetworksClient and an input struct. // Returns a populated Info struct for the IP Network, and any errors func (c *IPNetworksClient) CreateIPNetwork(input *CreateIPNetworkInput) (*IPNetworkInfo, error) { input.Name = c.getQualifiedName(input.Name) input.IPNetworkExchange = c.getQualifiedName(input.IPNetworkExchange) var ipInfo IPNetworkInfo if err := c.createResource(&input, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // GetIPNetworkInput details the attributes needed to retrieve an ip network type GetIPNetworkInput struct { // The name of the IP Network to query for. Case-sensitive // Required Name string `json:"name"` } // GetIPNetwork returns a populated IPNetworkInfo struct from an input struct func (c *IPNetworksClient) GetIPNetwork(input *GetIPNetworkInput) (*IPNetworkInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo IPNetworkInfo if err := c.getResource(input.Name, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // UpdateIPNetworkInput details the attributes needed to update an ip network type UpdateIPNetworkInput struct { // The name of the IP Network to update. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Specify the size of the IP Subnet. It is a range of IPv4 addresses assigned in the virtual // network, in CIDR address prefix format. // While specifying the IP address prefix take care of the following points: // //* These IP addresses aren't part of the common pool of Oracle-provided IP addresses used by the shared network. // //* There's no conflict with the range of IP addresses used in another IP network, the IP addresses used your on-premises network, or with the range of private IP addresses used in the shared network. If IP networks with overlapping IP subnets are linked to an IP exchange, packets going to and from those IP networks are dropped. // //* The upper limit of the CIDR block size for an IP network is /16. // //Note: The first IP address of any IP network is reserved for the default gateway, the DHCP server, and the DNS server of that IP network. // Required IPAddressPrefix string `json:"ipAddressPrefix"` //Specify the IP network exchange to which the IP network belongs. //You can add an IP network to only one IP network exchange, but an IP network exchange //can include multiple IP networks. An IP network exchange enables access between IP networks //that have non-overlapping addresses, so that instances on these networks can exchange packets //with each other without NAT. // Optional IPNetworkExchange string `json:"ipNetworkExchange,omitempty"` // Description of the IPNetwork // Optional Description string `json:"description"` // Enable public internet access using NAPT for VNICs without any public IP reservation // Optional PublicNaptEnabled bool `json:"publicNaptEnabledFlag"` // String slice of tags to apply to the IP Network object // Optional Tags []string `json:"tags"` } // UpdateIPNetwork updates the specified ip network func (c *IPNetworksClient) UpdateIPNetwork(input *UpdateIPNetworkInput) (*IPNetworkInfo, error) { input.Name = c.getQualifiedName(input.Name) input.IPNetworkExchange = c.getQualifiedName(input.IPNetworkExchange) var ipInfo IPNetworkInfo if err := c.updateResource(input.Name, &input, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // DeleteIPNetworkInput specifies the attributes needed to delete an ip network type DeleteIPNetworkInput struct { // The name of the IP Network to query for. Case-sensitive // Required Name string `json:"name"` } // DeleteIPNetwork deletes the specified ip network func (c *IPNetworksClient) DeleteIPNetwork(input *DeleteIPNetworkInput) error { return c.deleteResource(input.Name) } // Unqualifies any qualified fields in the IPNetworkInfo struct func (c *IPNetworksClient) success(info *IPNetworkInfo) (*IPNetworkInfo, error) { info.Name = c.getUnqualifiedName(info.FQDN) c.unqualify(&info.IPNetworkExchange) return info, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ip_reservations.go���������0000664�0000000�0000000�00000012107�13771713062�0032066�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // IPReservationsClient is a client for the IP Reservations functions of the Compute API. type IPReservationsClient struct { *ResourceClient } const ( iPReservationDesc = "ip reservation" iPReservationContainerPath = "/ip/reservation/" iPReservataionResourcePath = "/ip/reservation" ) // IPReservations obtains an IPReservationsClient which can be used to access to the // IP Reservations functions of the Compute API func (c *Client) IPReservations() *IPReservationsClient { return &IPReservationsClient{ ResourceClient: &ResourceClient{ Client: c, ResourceDescription: iPReservationDesc, ContainerPath: iPReservationContainerPath, ResourceRootPath: iPReservataionResourcePath, }} } // IPReservationPool details the constants for the ip reservation pool attribute type IPReservationPool string const ( // PublicReservationPool - /oracle/public/ippool PublicReservationPool IPReservationPool = "/oracle/public/ippool" ) // IPReservation describes an existing IP reservation. type IPReservation struct { // Shows the default account for your identity domain. Account string `json:"account"` // Fully Qualified Domain Name FQDN string `json:"name"` // Public IP address. IP string `json:"ip"` // The three-part name of the IP Reservation (/Compute-identity_domain/user/object). Name string // Pool of public IP addresses ParentPool IPReservationPool `json:"parentpool"` // A comma-separated list of strings which helps you to identify IP reservation. Tags []string `json:"tags"` // Uniform Resource Identifier URI string `json:"uri"` // Is the IP Reservation Persistent (i.e. static) or not (i.e. Dynamic)? Permanent bool `json:"permanent"` // Is the IP reservation associated with an instance? Used bool `json:"used"` } // CreateIPReservationInput defines an IP reservation to be created. type CreateIPReservationInput struct { // The name of the object // If you don't specify a name for this object, then the name is generated automatically. // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. // Object names are case-sensitive. // Optional Name string `json:"name"` // Pool of public IP addresses. This must be set to `ippool` // Required ParentPool IPReservationPool `json:"parentpool"` // Is the IP Reservation Persistent (i.e. static) or not (i.e. Dynamic)? // Required Permanent bool `json:"permanent"` // A comma-separated list of strings which helps you to identify IP reservations. // Optional Tags []string `json:"tags"` } // CreateIPReservation creates a new IP reservation with the given parentpool, tags and permanent flag. func (c *IPReservationsClient) CreateIPReservation(input *CreateIPReservationInput) (*IPReservation, error) { var ipInput IPReservation input.Name = c.getQualifiedName(input.Name) if err := c.createResource(input, &ipInput); err != nil { return nil, err } return c.success(&ipInput) } // GetIPReservationInput defines an IP Reservation to get type GetIPReservationInput struct { // The name of the IP Reservation // Required Name string } // GetIPReservation retrieves the IP reservation with the given name. func (c *IPReservationsClient) GetIPReservation(input *GetIPReservationInput) (*IPReservation, error) { var ipInput IPReservation input.Name = c.getQualifiedName(input.Name) if err := c.getResource(input.Name, &ipInput); err != nil { return nil, err } return c.success(&ipInput) } // UpdateIPReservationInput defines an IP Reservation to be updated type UpdateIPReservationInput struct { // The name of the object // If you don't specify a name for this object, then the name is generated automatically. // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. // Object names are case-sensitive. // Required Name string `json:"name"` // Pool of public IP addresses. // Required ParentPool IPReservationPool `json:"parentpool"` // Is the IP Reservation Persistent (i.e. static) or not (i.e. Dynamic)? // Required Permanent bool `json:"permanent"` // A comma-separated list of strings which helps you to identify IP reservations. // Optional Tags []string `json:"tags"` } // UpdateIPReservation updates the IP reservation. func (c *IPReservationsClient) UpdateIPReservation(input *UpdateIPReservationInput) (*IPReservation, error) { var updateOutput IPReservation input.Name = c.getQualifiedName(input.Name) if err := c.updateResource(input.Name, input, &updateOutput); err != nil { return nil, err } return c.success(&updateOutput) } // DeleteIPReservationInput defines an IP Reservation to delete type DeleteIPReservationInput struct { // The name of the IP Reservation // Required Name string } // DeleteIPReservation deletes the IP reservation with the given name. func (c *IPReservationsClient) DeleteIPReservation(input *DeleteIPReservationInput) error { input.Name = c.getQualifiedName(input.Name) return c.deleteResource(input.Name) } func (c *IPReservationsClient) success(result *IPReservation) (*IPReservation, error) { result.Name = c.getUnqualifiedName(result.FQDN) return result, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/machine_images.go����������0000664�0000000�0000000�00000010533�13771713062�0031604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // MachineImagesClient is a client for the MachineImage functions of the Compute API. type MachineImagesClient struct { ResourceClient } // MachineImages obtains an MachineImagesClient which can be used to access to the // MachineImage functions of the Compute API func (c *Client) MachineImages() *MachineImagesClient { return &MachineImagesClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "MachineImage", ContainerPath: "/machineimage/", ResourceRootPath: "/machineimage", }} } // MachineImage describes an existing Machine Image. type MachineImage struct { // account of the associated Object Storage Classic instance Account string `json:"account"` // Dictionary of attributes to be made available to the instance Attributes map[string]interface{} `json:"attributes"` // Last time when this image was audited Audited string `json:"audited"` // Describing the image Description string `json:"description"` // Description of the state of the machine image if there is an error ErrorReason string `json:"error_reason"` // Fully Qualified Domain Name FQDN string `json:"name"` // dictionary of hypervisor-specific attributes Hypervisor map[string]interface{} `json:"hypervisor"` // The format of the image ImageFormat string `json:"image_format"` // name of the machine image file uploaded to Object Storage Classic File string `json:"file"` // name of the machine image Name string // Indicates that the image file is available in Object Storage Classic NoUpload bool `json:"no_upload"` // The OS platform of the image Platform string `json:"platform"` // Size values of the image file Sizes map[string]interface{} `json:"sizes"` // The state of the uploaded machine image State string `json:"state"` // Uniform Resource Identifier URI string `json:"uri"` } // CreateMachineImageInput defines an Image List to be created. type CreateMachineImageInput struct { // account of the associated Object Storage Classic instance Account string `json:"account"` // Dictionary of attributes to be made available to the instance Attributes map[string]interface{} `json:"attributes,omitempty"` // Describing the image Description string `json:"description,omitempty"` // name of the machine image file uploaded to Object Storage Classic File string `json:"file,omitempty"` // name of the machine image Name string `json:"name"` // Indicates that the image file is available in Object Storage Classic NoUpload bool `json:"no_upload"` // Size values of the image file Sizes map[string]interface{} `json:"sizes"` } // CreateMachineImage creates a new Machine Image with the given parameters. func (c *MachineImagesClient) CreateMachineImage(createInput *CreateMachineImageInput) (*MachineImage, error) { var machineImage MachineImage // If `sizes` is not set then is mst be defaulted to {"total": 0} if createInput.Sizes == nil { createInput.Sizes = map[string]interface{}{"total": 0} } // `no_upload` must always be true createInput.NoUpload = true createInput.Name = c.getQualifiedName(createInput.Name) if err := c.createResource(createInput, &machineImage); err != nil { return nil, err } return c.success(&machineImage) } // DeleteMachineImageInput describes the MachineImage to delete type DeleteMachineImageInput struct { // The name of the MachineImage Name string `json:"name"` } // DeleteMachineImage deletes the MachineImage with the given name. func (c *MachineImagesClient) DeleteMachineImage(deleteInput *DeleteMachineImageInput) error { return c.deleteResource(deleteInput.Name) } // GetMachineImageInput describes the MachineImage to get type GetMachineImageInput struct { // account of the associated Object Storage Classic instance Account string `json:"account"` // The name of the Machine Image Name string `json:"name"` } // GetMachineImage retrieves the MachineImage with the given name. func (c *MachineImagesClient) GetMachineImage(getInput *GetMachineImageInput) (*MachineImage, error) { getInput.Name = c.getQualifiedName(getInput.Name) var machineImage MachineImage if err := c.getResource(getInput.Name, &machineImage); err != nil { return nil, err } return c.success(&machineImage) } func (c *MachineImagesClient) success(result *MachineImage) (*MachineImage, error) { result.Name = c.getUnqualifiedName(result.FQDN) return result, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/orchestration.go�����������0000664�0000000�0000000�00000052261�13771713062�0031543�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "time" "github.com/hashicorp/go-oracle-terraform/client" ) const waitForOrchestrationActivePollInterval = 10 * time.Second const waitForOrchestrationActiveTimeout = 3600 * time.Second const waitForOrchestrationDeletePollInterval = 10 * time.Second const waitForOrchestrationDeleteTimeout = 3600 * time.Second // OrchestrationsClient is a client for the Orchestration functions of the Compute API. type OrchestrationsClient struct { ResourceClient } // Orchestrations obtains an OrchestrationsClient which can be used to access to the // Orchestration functions of the Compute API func (c *Client) Orchestrations() *OrchestrationsClient { return &OrchestrationsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "Orchestration", ContainerPath: "/platform/v1/orchestration/", ResourceRootPath: "/platform/v1/orchestration", }} } // OrchestrationDesiredState defines the different desired states a orchestration can be in type OrchestrationDesiredState string const ( // OrchestrationDesiredStateActive - Creates all the orchestration objects defined in the orchestration. OrchestrationDesiredStateActive OrchestrationDesiredState = "active" // OrchestrationDesiredStateInactive - Adds the orchestration to Oracle Compute Cloud Service, but does not create any of the orchestration OrchestrationDesiredStateInactive OrchestrationDesiredState = "inactive" // OrchestrationDesiredStateSuspend - Suspends all orchestration objects defined in the orchestration OrchestrationDesiredStateSuspend OrchestrationDesiredState = "suspend" ) // OrchestrationStatus defines the different status a orchestration can be in type OrchestrationStatus string const ( // OrchestrationStatusActive - active OrchestrationStatusActive OrchestrationStatus = "active" // OrchestrationStatusInactive - inactive OrchestrationStatusInactive OrchestrationStatus = "inactive" // OrchestrationStatusSuspend - suspend OrchestrationStatusSuspend OrchestrationStatus = "suspend" // OrchestrationStatusActivating - activating OrchestrationStatusActivating OrchestrationStatus = "activating" // OrchestrationStatusDeleting - deleting OrchestrationStatusDeleting OrchestrationStatus = "deleting" // OrchestrationStatusError - terminal_error OrchestrationStatusError OrchestrationStatus = "terminal_error" // OrchestrationStatusStopping - stopping OrchestrationStatusStopping OrchestrationStatus = "stopping" // OrchestrationStatusSuspending - suspending OrchestrationStatusSuspending OrchestrationStatus = "suspending" // OrchestrationStatusStarting - starting OrchestrationStatusStarting OrchestrationStatus = "starting" // OrchestrationStatusDeactivating - deactivating OrchestrationStatusDeactivating OrchestrationStatus = "deactivating" // OrchestrationStatusSuspended - suspended OrchestrationStatusSuspended OrchestrationStatus = "suspended" ) // OrchestrationType defines the type of orchestrations that can be managed type OrchestrationType string const ( // OrchestrationTypeInstance - Instance OrchestrationTypeInstance OrchestrationType = "Instance" ) // OrchestrationRelationshipType defines the orchestration relationship type for an orchestration type OrchestrationRelationshipType string const ( // OrchestrationRelationshipTypeDepends - the orchestration relationship depends on a resource OrchestrationRelationshipTypeDepends OrchestrationRelationshipType = "depends" ) // Orchestration describes an existing Orchestration. type Orchestration struct { // The default Oracle Compute Cloud Service account, such as /Compute-acme/default. Account string `json:"account"` // Description of this orchestration Description string `json:"description"` // The desired_state specified in the orchestration JSON file. A unique identifier for this orchestration. DesiredState OrchestrationDesiredState `json:"desired_state"` // Unique identifier of this orchestration ID string `json:"id"` // Fully Qualified Domain Name FQDN string `json:"name"` // The three-part name of the Orchestration Name string // List of orchestration objects Objects []Object `json:"objects"` // Current status of this orchestration Status OrchestrationStatus `json:"status"` // Strings that describe the orchestration and help you identify it. Tags []string `json:"tags"` // Time the orchestration was last audited TimeAudited string `json:"time_audited"` // The time when the orchestration was added to Oracle Compute Cloud Service. TimeCreated string `json:"time_created"` // The time when the orchestration was last updated in Oracle Compute Cloud Service. TimeUpdated string `json:"time_updated"` // Unique Resource Identifier URI string `json:"uri"` // Name of the user who added this orchestration or made the most recent update to this orchestration. User string `json:"user"` // Version of this orchestration. It is automatically generated by the server. Version int `json:"version"` } // CreateOrchestrationInput defines an Orchestration to be created. type CreateOrchestrationInput struct { // The default Oracle Compute Cloud Service account, such as /Compute-acme/default. // Optional Account string `json:"account,omitempty"` // Description of this orchestration // Optional Description string `json:"description,omitempty"` // Specify the desired state of this orchestration: active, inactive, or suspend. // You can manage the state of the orchestration objects by changing the desired state of the orchestration. // * active: Creates all the orchestration objects defined in the orchestration. // * inactive: Adds the orchestration to Oracle Compute Cloud Service, but does not create any of the orchestration // objects defined in the orchestration. // Required DesiredState OrchestrationDesiredState `json:"desired_state"` // The three-part name of the Orchestration (/Compute-identity_domain/user/object). // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` // The list of objects in the orchestration. An object is the primary building block of an orchestration. // An orchestration can contain up to 100 objects. // Required Objects []Object `json:"objects"` // Strings that describe the orchestration and help you identify it. Tags []string `json:"tags,omitempty"` // Version of this orchestration. It is automatically generated by the server. Version int `json:"version,omitempty"` // Time to wait between polls to check status PollInterval time.Duration `json:"-"` // Time to wait for an orchestration to be ready Timeout time.Duration `json:"-"` } // Object defines an object inside an orchestration type Object struct { // The default Oracle Compute Cloud Service account, such as /Compute-acme/default. // Optional Account string `json:"account,omitempty"` // Description of this orchestration // Optional Description string `json:"description,omitempty"` // The desired state of the object // Optional DesiredState OrchestrationDesiredState `json:"desired_state,omitempty"` // Dictionary containing the current state of the object Health Health `json:"health,omitempty"` // A text string describing the object. Labels can't include spaces. In an orchestration, the label for // each object must be unique. Maximum length is 256 characters. // Required Label string `json:"label"` // The four-part name of the object (/Compute-identity_domain/user/orchestration/object). If you don't specify a name // for this object, the name is generated automatically. Object names can contain only alphanumeric characters, hyphens, // underscores, and periods. Object names are case-sensitive. When you specify the object name, ensure that an object of // the same type and with the same name doesn't already exist. If such a object already exists, then another // object of the same type and with the same name won't be created and the existing object won't be updated. // Optional Name string `json:"name,omitempty"` // The three-part name (/Compute-identity_domain/user/object) of the orchestration to which the object belongs. // Required Orchestration string `json:"orchestration"` // Specifies whether the object should persist when the orchestration is suspended. Specify one of the following: // * true: The object persists when the orchestration is suspended. // * false: The object is deleted when the orchestration is suspended. // By default, persistent is set to false. It is recommended that you specify true for storage // volumes and other critical objects. Persistence applies only when you're suspending an orchestration. // When you terminate an orchestration, all the objects defined in it are deleted. // Optional Persistent bool `json:"persistent,omitempty"` // The relationship between the objects that are created by this orchestration. The // only supported relationship is depends, indicating that the specified target objects must be created first. // Note that when recovering from a failure, the orchestration doesn't consider object relationships. // Orchestrations v2 use object references to recover interdependent objects to a healthy state. SeeObject // References and Relationships in Using Oracle Compute Cloud Service (IaaS). Relationships []Relationship `json:"relationships,omitempty"` // The template attribute defines the properties or characteristics of the Oracle Compute Cloud Service object // that you want to create, as specified by the type attribute. // The fields in the template section vary depending on the specified type. See Orchestration v2 Attributes // Specific to Each Object Type in Using Oracle Compute Cloud Service (IaaS) to determine the parameters that are // specific to each object type that you want to create. // For example, if you want to create a storage volume, the type would be StorageVolume, and the template would include // size and bootable. If you want to create an instance, the type would be Instance, and the template would include // instance-specific attributes, such as imagelist and shape. // Required Template interface{} `json:"template"` // Specify one of the following object types that you want to create. // The only allowed type is Instance // Required Type OrchestrationType `json:"type"` // Version of this object, generated by the server // Optional Version int `json:"version,omitempty"` } // Health defines the health of an object type Health struct { // The status of the object Status OrchestrationStatus `json:"status,omitempty"` // What caused the status of the object Cause string `json:"cause,omitempty"` // The specific details for what happened to the object Detail string `json:"detail,omitempty"` // Any errors associated with creation of the object Error string `json:"error,omitempty"` } // Relationship defines the relationship between objects type Relationship struct { // The type of Relationship // The only type is depends // Required Type OrchestrationRelationshipType `json:"type"` // What objects the relationship depends on // Required Targets []string `json:"targets"` } // CreateOrchestration creates a new Orchestration with the given name, key and enabled flag. func (c *OrchestrationsClient) CreateOrchestration(input *CreateOrchestrationInput) (*Orchestration, error) { var createdOrchestration Orchestration input.Name = c.getQualifiedName(input.Name) for _, i := range input.Objects { i.Orchestration = c.getQualifiedName(i.Orchestration) if i.Type == OrchestrationTypeInstance { instanceClient := c.Client.Instances() instanceInput := i.Template.(*CreateInstanceInput) instanceInput.Name = c.getQualifiedName(instanceInput.Name) qualifiedSSHKeys := []string{} for _, key := range instanceInput.SSHKeys { qualifiedSSHKeys = append(qualifiedSSHKeys, c.getQualifiedName(key)) } instanceInput.SSHKeys = qualifiedSSHKeys qualifiedStorageAttachments := []StorageAttachmentInput{} for _, attachment := range instanceInput.Storage { qualifiedStorageAttachments = append(qualifiedStorageAttachments, StorageAttachmentInput{ Index: attachment.Index, Volume: c.getQualifiedName(attachment.Volume), }) } instanceInput.Storage = qualifiedStorageAttachments instanceInput.Networking = instanceClient.qualifyNetworking(instanceInput.Networking) } } if err := c.createResource(&input, &createdOrchestration); err != nil { return nil, err } // Call wait for orchestration ready now, as creating the orchestration is an eventually consistent operation getInput := &GetOrchestrationInput{ Name: createdOrchestration.Name, } if input.PollInterval == 0 { input.PollInterval = waitForOrchestrationActivePollInterval } if input.Timeout == 0 { input.Timeout = waitForOrchestrationActiveTimeout } // Wait for orchestration to be ready and return the result // Don't have to unqualify any objects, as the GetOrchestration method will handle that orchestrationInfo, orchestrationError := c.WaitForOrchestrationState(getInput, input.PollInterval, input.Timeout) if orchestrationError != nil { deleteInput := &DeleteOrchestrationInput{ Name: createdOrchestration.Name, } err := c.DeleteOrchestration(deleteInput) if err != nil { return nil, fmt.Errorf("Error deleting orchestration %s: %s", getInput.Name, err) } return nil, fmt.Errorf("Error creating orchestration %s: %s", getInput.Name, orchestrationError) } return orchestrationInfo, nil } // GetOrchestrationInput describes the Orchestration to get type GetOrchestrationInput struct { // The three-part name of the Orchestration (/Compute-identity_domain/user/object). Name string `json:"name"` } // GetOrchestration retrieves the Orchestration with the given name. func (c *OrchestrationsClient) GetOrchestration(input *GetOrchestrationInput) (*Orchestration, error) { var orchestrationInfo Orchestration if err := c.getResource(input.Name, &orchestrationInfo); err != nil { return nil, err } return c.success(&orchestrationInfo) } // UpdateOrchestrationInput defines an Orchestration to be updated type UpdateOrchestrationInput struct { // The default Oracle Compute Cloud Service account, such as /Compute-acme/default. // Optional Account string `json:"account,omitempty"` // Description of this orchestration // Optional Description string `json:"description,omitempty"` // Specify the desired state of this orchestration: active, inactive, or suspend. // You can manage the state of the orchestration objects by changing the desired state of the orchestration. // * active: Creates all the orchestration objects defined in the orchestration. // * inactive: Adds the orchestration to Oracle Compute Cloud Service, but does not create any of the orchestration // objects defined in the orchestration. // Required DesiredState OrchestrationDesiredState `json:"desired_state"` // The three-part name of the Orchestration (/Compute-identity_domain/user/object). // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` // The list of objects in the orchestration. An object is the primary building block of an orchestration. // An orchestration can contain up to 100 objects. // Required Objects []Object `json:"objects"` // Strings that describe the orchestration and help you identify it. Tags []string `json:"tags,omitempty"` // Version of this orchestration. It is automatically generated by the server. Version int `json:"version,omitempty"` // Time to wait between polls to check status PollInterval time.Duration `json:"-"` // Time to wait for an orchestration to be ready Timeout time.Duration `json:"-"` } // UpdateOrchestration updates the orchestration. func (c *OrchestrationsClient) UpdateOrchestration(input *UpdateOrchestrationInput) (*Orchestration, error) { var updatedOrchestration Orchestration input.Name = c.getQualifiedName(input.Name) for _, i := range input.Objects { i.Orchestration = c.getQualifiedName(i.Orchestration) if i.Type == OrchestrationTypeInstance { instanceInput := i.Template.(map[string]interface{}) instanceInput["name"] = c.getQualifiedName(instanceInput["name"].(string)) } } if err := c.updateResource(input.Name, input, &updatedOrchestration); err != nil { return nil, err } // Call wait for orchestration ready now, as creating the orchestration is an eventually consistent operation getInput := &GetOrchestrationInput{ Name: updatedOrchestration.Name, } if input.PollInterval == 0 { input.PollInterval = waitForOrchestrationActivePollInterval } if input.Timeout == 0 { input.Timeout = waitForOrchestrationActiveTimeout } // Wait for orchestration to be ready and return the result // Don't have to unqualify any objects, as the GetOrchestration method will handle that orchestrationInfo, orchestrationError := c.WaitForOrchestrationState(getInput, input.PollInterval, input.Timeout) if orchestrationError != nil { return nil, orchestrationError } return orchestrationInfo, nil } // DeleteOrchestrationInput describes the Orchestration to delete type DeleteOrchestrationInput struct { // The three-part name of the Orchestration (/Compute-identity_domain/user/object). // Required Name string `json:"name"` // Poll Interval for delete request PollInterval time.Duration `json:"-"` // Timeout for delete request Timeout time.Duration `json:"-"` } // DeleteOrchestration deletes the Orchestration with the given name. func (c *OrchestrationsClient) DeleteOrchestration(input *DeleteOrchestrationInput) error { if err := c.deleteOrchestration(input.Name); err != nil { return err } if input.PollInterval == 0 { input.PollInterval = waitForOrchestrationDeletePollInterval } if input.Timeout == 0 { input.Timeout = waitForOrchestrationDeleteTimeout } return c.WaitForOrchestrationDeleted(input, input.PollInterval, input.Timeout) } func (c *OrchestrationsClient) success(info *Orchestration) (*Orchestration, error) { info.Name = c.getUnqualifiedName(info.FQDN) for _, i := range info.Objects { c.unqualify(&i.Orchestration) if i.Type == OrchestrationTypeInstance { instanceInput := i.Template.(map[string]interface{}) instanceInput["name"] = c.getUnqualifiedName(instanceInput["name"].(string)) } } return info, nil } // WaitForOrchestrationState waits for an orchestration to be in the specified state func (c *OrchestrationsClient) WaitForOrchestrationState(input *GetOrchestrationInput, pollInterval, timeout time.Duration) (*Orchestration, error) { var info *Orchestration var getErr error err := c.client.WaitFor("orchestration to be ready", pollInterval, timeout, func() (bool, error) { info, getErr = c.GetOrchestration(input) if getErr != nil { return false, getErr } c.client.DebugLogString(fmt.Sprintf("Orchestration name is %v, Orchestration info is %+v", info.Name, info)) switch s := info.Status; s { case OrchestrationStatusError: // We need to check and see if an object the orchestration is trying to create is giving us an error instead of just the orchestration as a whole. for _, object := range info.Objects { if object.Health.Status == OrchestrationStatusError { return false, fmt.Errorf("Error creating instance %s: %+v", object.Name, object.Health) } } return false, fmt.Errorf("Error initializing orchestration: %+v", info) case OrchestrationStatus(info.DesiredState): c.client.DebugLogString(fmt.Sprintf("Orchestration %s", info.DesiredState)) return true, nil case OrchestrationStatusActivating: c.client.DebugLogString("Orchestration activating") return false, nil case OrchestrationStatusStopping: c.client.DebugLogString("Orchestration stopping") return false, nil case OrchestrationStatusSuspending: c.client.DebugLogString("Orchestration suspending") return false, nil case OrchestrationStatusDeactivating: c.client.DebugLogString("Orchestration deactivating") return false, nil case OrchestrationStatusSuspended: c.client.DebugLogString("Orchestration suspended") if info.DesiredState == OrchestrationDesiredStateSuspend { return true, nil } return false, nil default: return false, fmt.Errorf("Unknown orchestration state: %s, erroring", s) } }) return info, err } // WaitForOrchestrationDeleted waits for an orchestration to be fully deleted. func (c *OrchestrationsClient) WaitForOrchestrationDeleted(input *DeleteOrchestrationInput, pollInterval, timeout time.Duration) error { return c.client.WaitFor("orchestration to be deleted", pollInterval, timeout, func() (bool, error) { var info Orchestration if err := c.getResource(input.Name, &info); err != nil { if client.WasNotFoundError(err) { // Orchestration could not be found, thus deleted return true, nil } // Some other error occurred trying to get Orchestration, exit return false, err } switch s := info.Status; s { case OrchestrationStatusError: return false, fmt.Errorf("Error stopping orchestration: %+v", info) case OrchestrationStatusStopping: c.client.DebugLogString("Orchestration stopping") return false, nil case OrchestrationStatusDeleting: c.client.DebugLogString("Orchestration deleting") return false, nil case OrchestrationStatusActive: c.client.DebugLogString("Orchestration active") return false, nil default: return false, fmt.Errorf("Unknown orchestration state: %s, erroring", s) } }) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/routes.go������������������0000664�0000000�0000000�00000013013�13771713062�0030170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( routesDescription = "IP Network Route" routesContainerPath = "/network/v1/route/" routesResourcePath = "/network/v1/route" ) // RoutesClient specifies the attributes of a route client type RoutesClient struct { ResourceClient } // Routes returns a route client func (c *Client) Routes() *RoutesClient { return &RoutesClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: routesDescription, ContainerPath: routesContainerPath, ResourceRootPath: routesResourcePath, }, } } // RouteInfo details the attributes for a route type RouteInfo struct { // Admin distance associated with this route AdminDistance int `json:"adminDistance"` // Description of the route Description string `json:"description"` // Fully Qualified Domain Name FQDN string `json:"name"` // CIDR IPv4 Prefix associated with this route IPAddressPrefix string `json:"ipAddressPrefix"` // Name of the route Name string // Name of the VNIC set associated with the route NextHopVnicSet string `json:"nextHopVnicSet"` // Slice of Tags associated with the route Tags []string `json:"tags,omitempty"` // Uniform resource identifier associated with the route URI string `json:"uri"` } // CreateRouteInput details the attributes needed to create a route type CreateRouteInput struct { // Specify 0,1, or 2 as the route's administrative distance. // If you do not specify a value, the default value is 0. // The same prefix can be used in multiple routes. In this case, packets are routed over all the matching // routes with the lowest administrative distance. // In the case multiple routes with the same lowest administrative distance match, // routing occurs over all these routes using ECMP. // Optional AdminDistance int `json:"adminDistance"` // Description of the route // Optional Description string `json:"description"` // The IPv4 address prefix in CIDR format, of the external network (external to the vNIC set) // from which you want to route traffic // Required IPAddressPrefix string `json:"ipAddressPrefix"` // Name of the route. // Names can only contain alphanumeric, underscore, dash, and period characters. Case-sensitive // Required Name string `json:"name"` // Name of the virtual NIC set to route matching packets to. // Routed flows are load-balanced among all the virtual NICs in the virtual NIC set // Required NextHopVnicSet string `json:"nextHopVnicSet"` // Slice of tags to be associated with the route // Optional Tags []string `json:"tags,omitempty"` } // CreateRoute creates the requested route func (c *RoutesClient) CreateRoute(input *CreateRouteInput) (*RouteInfo, error) { input.Name = c.getQualifiedName(input.Name) input.NextHopVnicSet = c.getQualifiedName(input.NextHopVnicSet) var routeInfo RouteInfo if err := c.createResource(&input, &routeInfo); err != nil { return nil, err } return c.success(&routeInfo) } // GetRouteInput details the attributes needed to retrive a route type GetRouteInput struct { // Name of the Route to query for. Case-sensitive // Required Name string `json:"name"` } // GetRoute retrieves the specified route func (c *RoutesClient) GetRoute(input *GetRouteInput) (*RouteInfo, error) { input.Name = c.getQualifiedName(input.Name) var routeInfo RouteInfo if err := c.getResource(input.Name, &routeInfo); err != nil { return nil, err } return c.success(&routeInfo) } // UpdateRouteInput details the attributes needed to update a route type UpdateRouteInput struct { // Specify 0,1, or 2 as the route's administrative distance. // If you do not specify a value, the default value is 0. // The same prefix can be used in multiple routes. In this case, packets are routed over all the matching // routes with the lowest administrative distance. // In the case multiple routes with the same lowest administrative distance match, // routing occurs over all these routes using ECMP. // Optional AdminDistance int `json:"adminDistance"` // Description of the route // Optional Description string `json:"description"` // The IPv4 address prefix in CIDR format, of the external network (external to the vNIC set) // from which you want to route traffic // Required IPAddressPrefix string `json:"ipAddressPrefix"` // Name of the route. // Names can only contain alphanumeric, underscore, dash, and period characters. Case-sensitive // Required Name string `json:"name"` // Name of the virtual NIC set to route matching packets to. // Routed flows are load-balanced among all the virtual NICs in the virtual NIC set // Required NextHopVnicSet string `json:"nextHopVnicSet"` // Slice of tags to be associated with the route // Optional Tags []string `json:"tags"` } // UpdateRoute updates the specified route func (c *RoutesClient) UpdateRoute(input *UpdateRouteInput) (*RouteInfo, error) { input.Name = c.getQualifiedName(input.Name) input.NextHopVnicSet = c.getQualifiedName(input.NextHopVnicSet) var routeInfo RouteInfo if err := c.updateResource(input.Name, &input, &routeInfo); err != nil { return nil, err } return c.success(&routeInfo) } // DeleteRouteInput details the route to delete type DeleteRouteInput struct { // Name of the Route to delete. Case-sensitive // Required Name string `json:"name"` } // DeleteRoute deletes the specified route func (c *RoutesClient) DeleteRoute(input *DeleteRouteInput) error { return c.deleteResource(input.Name) } func (c *RoutesClient) success(info *RouteInfo) (*RouteInfo, error) { info.Name = c.getUnqualifiedName(info.FQDN) c.unqualify(&info.NextHopVnicSet) return info, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/sec_rules.go���������������0000664�0000000�0000000�00000014616�13771713062�0030645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // SecRulesClient is a client for the Sec Rules functions of the Compute API. type SecRulesClient struct { ResourceClient } // SecRules obtains a SecRulesClient which can be used to access to the // Sec Rules functions of the Compute API func (c *Client) SecRules() *SecRulesClient { return &SecRulesClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "security ip list", ContainerPath: "/secrule/", ResourceRootPath: "/secrule", }} } // SecRuleInfo describes an existing sec rule. type SecRuleInfo struct { // Set this parameter to PERMIT. Action string `json:"action"` // The name of the security application Application string `json:"application"` // A description of the sec rule Description string `json:"description"` // Indicates whether the security rule is enabled Disabled bool `json:"disabled"` // The name of the destination security list or security IP list. DestinationList string `json:"dst_list"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the sec rule Name string // The name of the source security list or security IP list. SourceList string `json:"src_list"` // Uniform Resource Identifier for the sec rule URI string `json:"uri"` } // CreateSecRuleInput defines a sec rule to be created. type CreateSecRuleInput struct { // Set this parameter to PERMIT. // Required Action string `json:"action"` // The name of the security application for user-defined or predefined security applications. // Required Application string `json:"application"` // Description of the IP Network // Optional Description string `json:"description"` // Indicates whether the sec rule is enabled (set to false) or disabled (true). // The default setting is false. // Optional Disabled bool `json:"disabled"` // The name of the destination security list or security IP list. // // You must use the prefix seclist: or seciplist: to identify the list type. // // You can specify a security IP list as the destination in a secrule, // provided src_list is a security list that has DENY as its outbound policy. // // You cannot specify any of the security IP lists in the /oracle/public container // as a destination in a secrule. // Required DestinationList string `json:"dst_list"` // The name of the Sec Rule to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // The name of the source security list or security IP list. // // You must use the prefix seclist: or seciplist: to identify the list type. // // Required SourceList string `json:"src_list"` } // CreateSecRule creates a new sec rule. func (c *SecRulesClient) CreateSecRule(createInput *CreateSecRuleInput) (*SecRuleInfo, error) { createInput.Name = c.getQualifiedName(createInput.Name) createInput.SourceList = c.getQualifiedListName(createInput.SourceList) createInput.DestinationList = c.getQualifiedListName(createInput.DestinationList) createInput.Application = c.getQualifiedName(createInput.Application) var ruleInfo SecRuleInfo if err := c.createResource(createInput, &ruleInfo); err != nil { return nil, err } return c.success(&ruleInfo) } // GetSecRuleInput describes the Sec Rule to get type GetSecRuleInput struct { // The name of the Sec Rule to query for // Required Name string `json:"name"` } // GetSecRule retrieves the sec rule with the given name. func (c *SecRulesClient) GetSecRule(getInput *GetSecRuleInput) (*SecRuleInfo, error) { var ruleInfo SecRuleInfo if err := c.getResource(getInput.Name, &ruleInfo); err != nil { return nil, err } return c.success(&ruleInfo) } // UpdateSecRuleInput describes a secruity rule to update type UpdateSecRuleInput struct { // Set this parameter to PERMIT. // Required Action string `json:"action"` // The name of the security application for user-defined or predefined security applications. // Required Application string `json:"application"` // Description of the IP Network // Optional Description string `json:"description"` // Indicates whether the sec rule is enabled (set to false) or disabled (true). // The default setting is false. // Optional Disabled bool `json:"disabled"` // The name of the destination security list or security IP list. // // You must use the prefix seclist: or seciplist: to identify the list type. // // You can specify a security IP list as the destination in a secrule, // provided src_list is a security list that has DENY as its outbound policy. // // You cannot specify any of the security IP lists in the /oracle/public container // as a destination in a secrule. // Required DestinationList string `json:"dst_list"` // The name of the Sec Rule to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // The name of the source security list or security IP list. // // You must use the prefix seclist: or seciplist: to identify the list type. // // Required SourceList string `json:"src_list"` } // UpdateSecRule modifies the properties of the sec rule with the given name. func (c *SecRulesClient) UpdateSecRule(updateInput *UpdateSecRuleInput) (*SecRuleInfo, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) updateInput.SourceList = c.getQualifiedListName(updateInput.SourceList) updateInput.DestinationList = c.getQualifiedListName(updateInput.DestinationList) updateInput.Application = c.getQualifiedName(updateInput.Application) var ruleInfo SecRuleInfo if err := c.updateResource(updateInput.Name, updateInput, &ruleInfo); err != nil { return nil, err } return c.success(&ruleInfo) } // DeleteSecRuleInput describes the sec rule to delete type DeleteSecRuleInput struct { // The name of the Sec Rule to delete. // Required Name string `json:"name"` } // DeleteSecRule deletes the sec rule with the given name. func (c *SecRulesClient) DeleteSecRule(deleteInput *DeleteSecRuleInput) error { return c.deleteResource(deleteInput.Name) } func (c *SecRulesClient) success(ruleInfo *SecRuleInfo) (*SecRuleInfo, error) { ruleInfo.Name = c.getUnqualifiedName(ruleInfo.FQDN) ruleInfo.SourceList = c.unqualifyListName(ruleInfo.SourceList) ruleInfo.DestinationList = c.unqualifyListName(ruleInfo.DestinationList) ruleInfo.Application = c.getUnqualifiedName(ruleInfo.Application) return ruleInfo, nil } ������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/security_applications.go���0000664�0000000�0000000�00000014501�13771713062�0033267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // SecurityApplicationsClient is a client for the Security Application functions of the Compute API. type SecurityApplicationsClient struct { ResourceClient } // SecurityApplications obtains a SecurityApplicationsClient which can be used to access to the // Security Application functions of the Compute API func (c *Client) SecurityApplications() *SecurityApplicationsClient { return &SecurityApplicationsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "security application", ContainerPath: "/secapplication/", ResourceRootPath: "/secapplication", }} } // SecurityApplicationInfo describes an existing security application. type SecurityApplicationInfo struct { // A description of the security application. Description string `json:"description"` // The TCP or UDP destination port number. This can be a port range, such as 5900-5999 for TCP. DPort string `json:"dport"` // Fully Qualified Domain Name FQDN string `json:"name"` // The ICMP code. ICMPCode SecurityApplicationICMPCode `json:"icmpcode"` // The ICMP type. ICMPType SecurityApplicationICMPType `json:"icmptype"` // The three-part name of the Security Application (/Compute-identity_domain/user/object). Name string // The protocol to use. Protocol SecurityApplicationProtocol `json:"protocol"` // The Uniform Resource Identifier URI string `json:"uri"` } // SecurityApplicationProtocol defines the constants for a security application protocol type SecurityApplicationProtocol string const ( // All - all All SecurityApplicationProtocol = "all" // AH - ah AH SecurityApplicationProtocol = "ah" // ESP - esp ESP SecurityApplicationProtocol = "esp" // ICMP - icmp ICMP SecurityApplicationProtocol = "icmp" // ICMPV6 - icmpv6 ICMPV6 SecurityApplicationProtocol = "icmpv6" // IGMP - igmp IGMP SecurityApplicationProtocol = "igmp" // IPIP - ipip IPIP SecurityApplicationProtocol = "ipip" // GRE - gre GRE SecurityApplicationProtocol = "gre" // MPLSIP - mplsip MPLSIP SecurityApplicationProtocol = "mplsip" // OSPF - ospf OSPF SecurityApplicationProtocol = "ospf" // PIM - pim PIM SecurityApplicationProtocol = "pim" // RDP - rdp RDP SecurityApplicationProtocol = "rdp" // SCTP - sctp SCTP SecurityApplicationProtocol = "sctp" // TCP - tcp TCP SecurityApplicationProtocol = "tcp" // UDP - udp UDP SecurityApplicationProtocol = "udp" ) // SecurityApplicationICMPCode defines the constants an icmp code can be type SecurityApplicationICMPCode string const ( // Admin - admin Admin SecurityApplicationICMPCode = "admin" // Df - df Df SecurityApplicationICMPCode = "df" // Host - host Host SecurityApplicationICMPCode = "host" // Network - network Network SecurityApplicationICMPCode = "network" // Port - port Port SecurityApplicationICMPCode = "port" // Protocol - protocol Protocol SecurityApplicationICMPCode = "protocol" ) // SecurityApplicationICMPType defines the constants an icmp type can be type SecurityApplicationICMPType string const ( // Echo - echo Echo SecurityApplicationICMPType = "echo" // Reply - reply Reply SecurityApplicationICMPType = "reply" // TTL - ttl TTL SecurityApplicationICMPType = "ttl" // TraceRoute - traceroute TraceRoute SecurityApplicationICMPType = "traceroute" // Unreachable - unreachable Unreachable SecurityApplicationICMPType = "unreachable" ) func (c *SecurityApplicationsClient) success(result *SecurityApplicationInfo) (*SecurityApplicationInfo, error) { result.Name = c.getUnqualifiedName(result.FQDN) return result, nil } // CreateSecurityApplicationInput describes the Security Application to create type CreateSecurityApplicationInput struct { // A description of the security application. // Optional Description string `json:"description"` // The TCP or UDP destination port number. // You can also specify a port range, such as 5900-5999 for TCP. // This parameter isn't relevant to the icmp protocol. // Required if the Protocol is TCP or UDP DPort string `json:"dport"` // The ICMP code. This parameter is relevant only if you specify ICMP as the protocol. // If you specify icmp as the protocol and don't specify icmptype or icmpcode, then all ICMP packets are matched. // Optional ICMPCode SecurityApplicationICMPCode `json:"icmpcode,omitempty"` // This parameter is relevant only if you specify ICMP as the protocol. // If you specify icmp as the protocol and don't specify icmptype or icmpcode, then all ICMP packets are matched. // Optional ICMPType SecurityApplicationICMPType `json:"icmptype,omitempty"` // The three-part name of the Security Application (/Compute-identity_domain/user/object). // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` // The protocol to use. // Required Protocol SecurityApplicationProtocol `json:"protocol"` } // CreateSecurityApplication creates a new security application. func (c *SecurityApplicationsClient) CreateSecurityApplication(input *CreateSecurityApplicationInput) (*SecurityApplicationInfo, error) { input.Name = c.getQualifiedName(input.Name) var appInfo SecurityApplicationInfo if err := c.createResource(&input, &appInfo); err != nil { return nil, err } return c.success(&appInfo) } // GetSecurityApplicationInput describes the Security Application to obtain type GetSecurityApplicationInput struct { // The three-part name of the Security Application (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // GetSecurityApplication retrieves the security application with the given name. func (c *SecurityApplicationsClient) GetSecurityApplication(input *GetSecurityApplicationInput) (*SecurityApplicationInfo, error) { var appInfo SecurityApplicationInfo if err := c.getResource(input.Name, &appInfo); err != nil { return nil, err } return c.success(&appInfo) } // DeleteSecurityApplicationInput describes the Security Application to delete type DeleteSecurityApplicationInput struct { // The three-part name of the Security Application (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // DeleteSecurityApplication deletes the security application with the given name. func (c *SecurityApplicationsClient) DeleteSecurityApplication(input *DeleteSecurityApplicationInput) error { return c.deleteResource(input.Name) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/security_associations.go���0000664�0000000�0000000�00000007474�13771713062�0033313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // SecurityAssociationsClient is a client for the Security Association functions of the Compute API. type SecurityAssociationsClient struct { ResourceClient } // SecurityAssociations obtains a SecurityAssociationsClient which can be used to access to the // Security Association functions of the Compute API func (c *Client) SecurityAssociations() *SecurityAssociationsClient { return &SecurityAssociationsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "security association", ContainerPath: "/secassociation/", ResourceRootPath: "/secassociation", }} } // SecurityAssociationInfo describes an existing security association. type SecurityAssociationInfo struct { // Fully Qualified Domain Name FQDN string `json:"name"` // The three-part name of the Security Association Name string // The name of the Security List that you want to associate with the instance. SecList string `json:"seclist"` // vCable of the instance that you want to associate with the security list. VCable string `json:"vcable"` // Uniform Resource Identifier URI string `json:"uri"` } // CreateSecurityAssociationInput defines a security association to be created. type CreateSecurityAssociationInput struct { // The three-part name of the Security Association (/Compute-identity_domain/user/object). // If you don't specify a name for this object, then the name is generated automatically. // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Optional Name string `json:"name"` // The name of the Security list that you want to associate with the instance. // Required SecList string `json:"seclist"` // The name of the vCable of the instance that you want to associate with the security list. // Required VCable string `json:"vcable"` } // CreateSecurityAssociation creates a security association between the given VCable and security list. func (c *SecurityAssociationsClient) CreateSecurityAssociation(createInput *CreateSecurityAssociationInput) (*SecurityAssociationInfo, error) { if createInput.Name != "" { createInput.Name = c.getQualifiedName(createInput.Name) } createInput.VCable = c.getQualifiedName(createInput.VCable) createInput.SecList = c.getQualifiedName(createInput.SecList) var assocInfo SecurityAssociationInfo if err := c.createResource(&createInput, &assocInfo); err != nil { return nil, err } return c.success(&assocInfo) } // GetSecurityAssociationInput describes the security association to get type GetSecurityAssociationInput struct { // The three-part name of the Security Association (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // GetSecurityAssociation retrieves the security association with the given name. func (c *SecurityAssociationsClient) GetSecurityAssociation(getInput *GetSecurityAssociationInput) (*SecurityAssociationInfo, error) { var assocInfo SecurityAssociationInfo if err := c.getResource(getInput.Name, &assocInfo); err != nil { return nil, err } return c.success(&assocInfo) } // DeleteSecurityAssociationInput describes the security association to delete type DeleteSecurityAssociationInput struct { // The three-part name of the Security Association (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // DeleteSecurityAssociation deletes the security association with the given name. func (c *SecurityAssociationsClient) DeleteSecurityAssociation(deleteInput *DeleteSecurityAssociationInput) error { return c.deleteResource(deleteInput.Name) } func (c *SecurityAssociationsClient) success(assocInfo *SecurityAssociationInfo) (*SecurityAssociationInfo, error) { assocInfo.Name = c.getUnqualifiedName(assocInfo.FQDN) c.unqualify(&assocInfo.SecList, &assocInfo.VCable) return assocInfo, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/security_ip_lists.go�������0000664�0000000�0000000�00000010316�13771713062�0032427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // SecurityIPListsClient is a client for the Security IP List functions of the Compute API. type SecurityIPListsClient struct { ResourceClient } // SecurityIPLists obtains a SecurityIPListsClient which can be used to access to the // Security IP List functions of the Compute API func (c *Client) SecurityIPLists() *SecurityIPListsClient { return &SecurityIPListsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "security ip list", ContainerPath: "/seciplist/", ResourceRootPath: "/seciplist", }} } // SecurityIPListInfo describes an existing security IP list. type SecurityIPListInfo struct { // A description of the security IP list. Description string `json:"description"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the object Name string // A comma-separated list of the subnets (in CIDR format) or IPv4 addresses for which you want to create this security IP list. SecIPEntries []string `json:"secipentries"` // Uniform Resource Identifier URI string `json:"uri"` } // CreateSecurityIPListInput defines a security IP list to be created. type CreateSecurityIPListInput struct { // A description of the security IP list. // Optional Description string `json:"description"` // The three-part name of the object (/Compute-identity_domain/user/object). // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` // A comma-separated list of the subnets (in CIDR format) or IPv4 addresses for which you want to create this security IP list. // Required SecIPEntries []string `json:"secipentries"` } // CreateSecurityIPList creates a security IP list with the given name and entries. func (c *SecurityIPListsClient) CreateSecurityIPList(createInput *CreateSecurityIPListInput) (*SecurityIPListInfo, error) { createInput.Name = c.getQualifiedName(createInput.Name) var listInfo SecurityIPListInfo if err := c.createResource(createInput, &listInfo); err != nil { return nil, err } return c.success(&listInfo) } // GetSecurityIPListInput describes the Security IP List to obtain type GetSecurityIPListInput struct { // The three-part name of the object (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // GetSecurityIPList gets the security IP list with the given name. func (c *SecurityIPListsClient) GetSecurityIPList(getInput *GetSecurityIPListInput) (*SecurityIPListInfo, error) { var listInfo SecurityIPListInfo if err := c.getResource(getInput.Name, &listInfo); err != nil { return nil, err } return c.success(&listInfo) } // UpdateSecurityIPListInput describes the security ip list to update type UpdateSecurityIPListInput struct { // A description of the security IP list. // Optional Description string `json:"description"` // The three-part name of the object (/Compute-identity_domain/user/object). // Required Name string `json:"name"` // A comma-separated list of the subnets (in CIDR format) or IPv4 addresses for which you want to create this security IP list. // Required SecIPEntries []string `json:"secipentries"` } // UpdateSecurityIPList modifies the entries in the security IP list with the given name. func (c *SecurityIPListsClient) UpdateSecurityIPList(updateInput *UpdateSecurityIPListInput) (*SecurityIPListInfo, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) var listInfo SecurityIPListInfo if err := c.updateResource(updateInput.Name, updateInput, &listInfo); err != nil { return nil, err } return c.success(&listInfo) } // DeleteSecurityIPListInput describes the security ip list to delete. type DeleteSecurityIPListInput struct { // The three-part name of the object (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // DeleteSecurityIPList deletes the security IP list with the given name. func (c *SecurityIPListsClient) DeleteSecurityIPList(deleteInput *DeleteSecurityIPListInput) error { return c.deleteResource(deleteInput.Name) } func (c *SecurityIPListsClient) success(listInfo *SecurityIPListInfo) (*SecurityIPListInfo, error) { listInfo.Name = c.getUnqualifiedName(listInfo.FQDN) return listInfo, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/security_lists.go����������0000664�0000000�0000000�00000011564�13771713062�0031745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // SecurityListsClient is a client for the Security List functions of the Compute API. type SecurityListsClient struct { ResourceClient } // SecurityLists obtains a SecurityListsClient which can be used to access to the // Security List functions of the Compute API func (c *Client) SecurityLists() *SecurityListsClient { return &SecurityListsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "security list", ContainerPath: "/seclist/", ResourceRootPath: "/seclist", }} } // SecurityListPolicy defines the constants a security list policy can be type SecurityListPolicy string const ( // SecurityListPolicyDeny - deny SecurityListPolicyDeny SecurityListPolicy = "deny" // SecurityListPolicyReject - reject SecurityListPolicyReject SecurityListPolicy = "reject" // SecurityListPolicyPermit - permit SecurityListPolicyPermit SecurityListPolicy = "permit" ) // SecurityListInfo describes an existing security list. type SecurityListInfo struct { // Shows the default account for your identity domain. Account string `json:"account"` // A description of the security list. Description string `json:"description"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the security list Name string // The policy for outbound traffic from the security list. OutboundCIDRPolicy SecurityListPolicy `json:"outbound_cidr_policy"` // The policy for inbound traffic to the security list Policy SecurityListPolicy `json:"policy"` // Uniform Resource Identifier URI string `json:"uri"` } // CreateSecurityListInput defines a security list to be created. type CreateSecurityListInput struct { // A description of the security list. // Optional Description string `json:"description"` // The three-part name of the Security List (/Compute-identity_domain/user/object). // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` // The policy for outbound traffic from the security list. // Optional (defaults to `permit`) OutboundCIDRPolicy SecurityListPolicy `json:"outbound_cidr_policy"` // The policy for inbound traffic to the security list. // Optional (defaults to `deny`) Policy SecurityListPolicy `json:"policy"` } // CreateSecurityList creates a new security list with the given name, policy and outbound CIDR policy. func (c *SecurityListsClient) CreateSecurityList(createInput *CreateSecurityListInput) (*SecurityListInfo, error) { createInput.Name = c.getQualifiedName(createInput.Name) var listInfo SecurityListInfo if err := c.createResource(createInput, &listInfo); err != nil { return nil, err } return c.success(&listInfo) } // GetSecurityListInput describes the security list you want to get type GetSecurityListInput struct { // The three-part name of the Security List (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // GetSecurityList retrieves the security list with the given name. func (c *SecurityListsClient) GetSecurityList(getInput *GetSecurityListInput) (*SecurityListInfo, error) { var listInfo SecurityListInfo if err := c.getResource(getInput.Name, &listInfo); err != nil { return nil, err } return c.success(&listInfo) } // UpdateSecurityListInput defines what to update in a security list type UpdateSecurityListInput struct { // A description of the security list. // Optional Description string `json:"description"` // The three-part name of the Security List (/Compute-identity_domain/user/object). // Required Name string `json:"name"` // The policy for outbound traffic from the security list. // Optional (defaults to `permit`) OutboundCIDRPolicy SecurityListPolicy `json:"outbound_cidr_policy"` // The policy for inbound traffic to the security list. // Optional (defaults to `deny`) Policy SecurityListPolicy `json:"policy"` } // UpdateSecurityList updates the policy and outbound CIDR pol func (c *SecurityListsClient) UpdateSecurityList(updateInput *UpdateSecurityListInput) (*SecurityListInfo, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) var listInfo SecurityListInfo if err := c.updateResource(updateInput.Name, updateInput, &listInfo); err != nil { return nil, err } return c.success(&listInfo) } // DeleteSecurityListInput describes the security list to destroy type DeleteSecurityListInput struct { // The three-part name of the Security List (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // DeleteSecurityList deletes the security list with the given name. func (c *SecurityListsClient) DeleteSecurityList(deleteInput *DeleteSecurityListInput) error { return c.deleteResource(deleteInput.Name) } func (c *SecurityListsClient) success(listInfo *SecurityListInfo) (*SecurityListInfo, error) { listInfo.Name = c.getUnqualifiedName(listInfo.FQDN) return listInfo, nil } ��������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/security_protocols.go������0000664�0000000�0000000�00000017456�13771713062�0032641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( securityProtocolDescription = "security protocol" securityProtocolContainerPath = "/network/v1/secprotocol/" securityProtocolResourcePath = "/network/v1/secprotocol" ) // SecurityProtocolsClient details the security protocols client type SecurityProtocolsClient struct { ResourceClient } // SecurityProtocols returns an SecurityProtocolsClient that can be used to access the // necessary CRUD functions for Security Protocols. func (c *Client) SecurityProtocols() *SecurityProtocolsClient { return &SecurityProtocolsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: securityProtocolDescription, ContainerPath: securityProtocolContainerPath, ResourceRootPath: securityProtocolResourcePath, }, } } // SecurityProtocolInfo contains the exported fields necessary to hold all the information about an // Security Protocol type SecurityProtocolInfo struct { // List of port numbers or port range strings to match the packet's destination port. DstPortSet []string `json:"dstPortSet"` // Protocol used in the data portion of the IP datagram. IPProtocol string `json:"ipProtocol"` // List of port numbers or port range strings to match the packet's source port. SrcPortSet []string `json:"srcPortSet"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the Security Protocol Name string // Description of the Security Protocol Description string `json:"description"` // Slice of tags associated with the Security Protocol Tags []string `json:"tags"` // Uniform Resource Identifier for the Security Protocol URI string `json:"uri"` } // CreateSecurityProtocolInput details the attributes of the security protocol to create type CreateSecurityProtocolInput struct { // The name of the Security Protocol to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Description of the SecurityProtocol // Optional Description string `json:"description"` // Enter a list of port numbers or port range strings. //Traffic is enabled by a security rule when a packet's destination port matches the // ports specified here. // For TCP, SCTP, and UDP, each port is a destination transport port, between 0 and 65535, // inclusive. For ICMP, each port is an ICMP type, between 0 and 255, inclusive. // If no destination ports are specified, all destination ports or ICMP types are allowed. // Optional DstPortSet []string `json:"dstPortSet"` // The protocol used in the data portion of the IP datagram. // Specify one of the permitted values or enter a number in the range 0–254 to // represent the protocol that you want to specify. See Assigned Internet Protocol Numbers. // Permitted values are: tcp, udp, icmp, igmp, ipip, rdp, esp, ah, gre, icmpv6, ospf, pim, sctp, // mplsip, all. // Traffic is enabled by a security rule when the protocol in the packet matches the // protocol specified here. If no protocol is specified, all protocols are allowed. // Optional IPProtocol string `json:"ipProtocol"` // Enter a list of port numbers or port range strings. // Traffic is enabled by a security rule when a packet's source port matches the // ports specified here. // For TCP, SCTP, and UDP, each port is a source transport port, // between 0 and 65535, inclusive. // For ICMP, each port is an ICMP type, between 0 and 255, inclusive. // If no source ports are specified, all source ports or ICMP types are allowed. // Optional SrcPortSet []string `json:"srcPortSet"` // String slice of tags to apply to the Security Protocol object // Optional Tags []string `json:"tags"` } // CreateSecurityProtocol creates a new Security Protocol from an SecurityProtocolsClient and an input struct. // Returns a populated Info struct for the Security Protocol, and any errors func (c *SecurityProtocolsClient) CreateSecurityProtocol(input *CreateSecurityProtocolInput) (*SecurityProtocolInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo SecurityProtocolInfo if err := c.createResource(&input, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // GetSecurityProtocolInput details the security protocol input to retrive type GetSecurityProtocolInput struct { // The name of the Security Protocol to query for. Case-sensitive // Required Name string `json:"name"` } // GetSecurityProtocol returns a populated SecurityProtocolInfo struct from an input struct func (c *SecurityProtocolsClient) GetSecurityProtocol(input *GetSecurityProtocolInput) (*SecurityProtocolInfo, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo SecurityProtocolInfo if err := c.getResource(input.Name, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // UpdateSecurityProtocolInput defines what to update in a security protocol type UpdateSecurityProtocolInput struct { // The name of the Security Protocol to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // Description of the SecurityProtocol // Optional Description string `json:"description"` // Enter a list of port numbers or port range strings. //Traffic is enabled by a security rule when a packet's destination port matches the // ports specified here. // For TCP, SCTP, and UDP, each port is a destination transport port, between 0 and 65535, // inclusive. For ICMP, each port is an ICMP type, between 0 and 255, inclusive. // If no destination ports are specified, all destination ports or ICMP types are allowed. DstPortSet []string `json:"dstPortSet"` // The protocol used in the data portion of the IP datagram. // Specify one of the permitted values or enter a number in the range 0–254 to // represent the protocol that you want to specify. See Assigned Internet Protocol Numbers. // Permitted values are: tcp, udp, icmp, igmp, ipip, rdp, esp, ah, gre, icmpv6, ospf, pim, sctp, // mplsip, all. // Traffic is enabled by a security rule when the protocol in the packet matches the // protocol specified here. If no protocol is specified, all protocols are allowed. IPProtocol string `json:"ipProtocol"` // Enter a list of port numbers or port range strings. // Traffic is enabled by a security rule when a packet's source port matches the // ports specified here. // For TCP, SCTP, and UDP, each port is a source transport port, // between 0 and 65535, inclusive. // For ICMP, each port is an ICMP type, between 0 and 255, inclusive. // If no source ports are specified, all source ports or ICMP types are allowed. SrcPortSet []string `json:"srcPortSet"` // String slice of tags to apply to the Security Protocol object // Optional Tags []string `json:"tags"` } // UpdateSecurityProtocol update the security protocol func (c *SecurityProtocolsClient) UpdateSecurityProtocol(updateInput *UpdateSecurityProtocolInput) (*SecurityProtocolInfo, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) var ipInfo SecurityProtocolInfo if err := c.updateResource(updateInput.Name, updateInput, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // DeleteSecurityProtocolInput details the security protocal to delete type DeleteSecurityProtocolInput struct { // The name of the Security Protocol to query for. Case-sensitive // Required Name string `json:"name"` } // DeleteSecurityProtocol deletes the specified security protocol func (c *SecurityProtocolsClient) DeleteSecurityProtocol(input *DeleteSecurityProtocolInput) error { return c.deleteResource(input.Name) } // Unqualifies any qualified fields in the SecurityProtocolInfo struct func (c *SecurityProtocolsClient) success(info *SecurityProtocolInfo) (*SecurityProtocolInfo, error) { info.Name = c.getUnqualifiedName(info.FQDN) return info, nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/security_rules.go����������0000664�0000000�0000000�00000026747�13771713062�0031752�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute const ( securityRuleDescription = "security rules" securityRuleContainerPath = "/network/v1/secrule/" securityRuleResourcePath = "/network/v1/secrule" ) // SecurityRuleClient defines the security rule client type SecurityRuleClient struct { ResourceClient } // SecurityRules returns an SecurityRulesClient that can be used to access the // necessary CRUD functions for Security Rules. func (c *Client) SecurityRules() *SecurityRuleClient { return &SecurityRuleClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: securityRuleDescription, ContainerPath: securityRuleContainerPath, ResourceRootPath: securityRuleResourcePath, }, } } // SecurityRuleInfo contains the exported fields necessary to hold all the information about a // Security Rule type SecurityRuleInfo struct { // Name of the ACL that contains this rule. ACL string `json:"acl"` // Description of the Security Rule Description string `json:"description"` // List of IP address prefix set names to match the packet's destination IP address. DstIPAddressPrefixSets []string `json:"dstIpAddressPrefixSets"` // Name of virtual NIC set containing the packet's destination virtual NIC. DstVnicSet string `json:"dstVnicSet"` // Allows the security rule to be disabled. Enabled bool `json:"enabledFlag"` // Direction of the flow; Can be "egress" or "ingress". FlowDirection string `json:"FlowDirection"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the Security Rule Name string // List of security protocol names to match the packet's protocol and port. SecProtocols []string `json:"secProtocols"` // List of multipart names of IP address prefix set to match the packet's source IP address. SrcIPAddressPrefixSets []string `json:"srcIpAddressPrefixSets"` // Name of virtual NIC set containing the packet's source virtual NIC. SrcVnicSet string `json:"srcVnicSet"` // Slice of tags associated with the Security Rule Tags []string `json:"tags"` // Uniform Resource Identifier for the Security Rule URI string `json:"uri"` } // CreateSecurityRuleInput defines the attributes needed to create a security rule type CreateSecurityRuleInput struct { //Select the name of the access control list (ACL) that you want to add this // security rule to. Security rules are applied to vNIC sets by using ACLs. // Optional ACL string `json:"acl,omitempty"` // Description of the Security Rule // Optional Description string `json:"description"` // A list of IP address prefix sets to which you want to permit traffic. // Only packets to IP addresses in the specified IP address prefix sets are permitted. // When no destination IP address prefix sets are specified, traffic to any // IP address is permitted. // Optional DstIPAddressPrefixSets []string `json:"dstIpAddressPrefixSets"` // The vNICset to which you want to permit traffic. Only packets to vNICs in the // specified vNICset are permitted. When no destination vNICset is specified, traffic // to any vNIC is permitted. // Optional DstVnicSet string `json:"dstVnicSet,omitempty"` // Allows the security rule to be enabled or disabled. This parameter is set to // true by default. Specify false to disable the security rule. // Optional Enabled bool `json:"enabledFlag"` // Specify the direction of flow of traffic, which is relative to the instances, // for this security rule. Allowed values are ingress or egress. // An ingress packet is a packet received by a virtual NIC, for example from // another virtual NIC or from the public Internet. // An egress packet is a packet sent by a virtual NIC, for example to another // virtual NIC or to the public Internet. // Required FlowDirection string `json:"flowDirection"` // The name of the Security Rule // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. // Object names are case-sensitive. When you specify the object name, ensure that an object // of the same type and with the same name doesn't already exist. // If such an object already exists, another object of the same type and with the same name won't // be created and the existing object won't be updated. // Required Name string `json:"name"` // A list of security protocols for which you want to permit traffic. Only packets that // match the specified protocols and ports are permitted. When no security protocols are // specified, traffic using any protocol over any port is permitted. // Optional SecProtocols []string `json:"secProtocols"` // A list of IP address prefix sets from which you want to permit traffic. Only packets // from IP addresses in the specified IP address prefix sets are permitted. When no source // IP address prefix sets are specified, traffic from any IP address is permitted. // Optional SrcIPAddressPrefixSets []string `json:"srcIpAddressPrefixSets"` // The vNICset from which you want to permit traffic. Only packets from vNICs in the // specified vNICset are permitted. When no source vNICset is specified, traffic from any // vNIC is permitted. // Optional SrcVnicSet string `json:"srcVnicSet,omitempty"` // Strings that you can use to tag the security rule. // Optional Tags []string `json:"tags"` } // CreateSecurityRule creates a new Security Rule from an SecurityRuleClient and an input struct. // Returns a populated Info struct for the Security Rule, and any errors func (c *SecurityRuleClient) CreateSecurityRule(input *CreateSecurityRuleInput) (*SecurityRuleInfo, error) { input.Name = c.getQualifiedName(input.Name) input.ACL = c.getQualifiedName(input.ACL) input.SrcVnicSet = c.getQualifiedName(input.SrcVnicSet) input.DstVnicSet = c.getQualifiedName(input.DstVnicSet) input.SrcIPAddressPrefixSets = c.getQualifiedList(input.SrcIPAddressPrefixSets) input.DstIPAddressPrefixSets = c.getQualifiedList(input.DstIPAddressPrefixSets) input.SecProtocols = c.getQualifiedList(input.SecProtocols) var securityRuleInfo SecurityRuleInfo if err := c.createResource(&input, &securityRuleInfo); err != nil { return nil, err } return c.success(&securityRuleInfo) } // GetSecurityRuleInput defines which security rule to obtain type GetSecurityRuleInput struct { // The name of the Security Rule to query for. Case-sensitive // Required Name string `json:"name"` } // GetSecurityRule returns a populated SecurityRuleInfo struct from an input struct func (c *SecurityRuleClient) GetSecurityRule(input *GetSecurityRuleInput) (*SecurityRuleInfo, error) { input.Name = c.getQualifiedName(input.Name) var securityRuleInfo SecurityRuleInfo if err := c.getResource(input.Name, &securityRuleInfo); err != nil { return nil, err } return c.success(&securityRuleInfo) } // UpdateSecurityRuleInput describes a secruity rule to update type UpdateSecurityRuleInput struct { //Select the name of the access control list (ACL) that you want to add this // security rule to. Security rules are applied to vNIC sets by using ACLs. // Optional ACL string `json:"acl,omitempty"` // Description of the Security Rule // Optional Description string `json:"description"` // A list of IP address prefix sets to which you want to permit traffic. // Only packets to IP addresses in the specified IP address prefix sets are permitted. // When no destination IP address prefix sets are specified, traffic to any // IP address is permitted. // Optional DstIPAddressPrefixSets []string `json:"dstIpAddressPrefixSets"` // The vNICset to which you want to permit traffic. Only packets to vNICs in the // specified vNICset are permitted. When no destination vNICset is specified, traffic // to any vNIC is permitted. // Optional DstVnicSet string `json:"dstVnicSet,omitempty"` // Allows the security rule to be enabled or disabled. This parameter is set to // true by default. Specify false to disable the security rule. // Optional Enabled bool `json:"enabledFlag"` // Specify the direction of flow of traffic, which is relative to the instances, // for this security rule. Allowed values are ingress or egress. // An ingress packet is a packet received by a virtual NIC, for example from // another virtual NIC or from the public Internet. // An egress packet is a packet sent by a virtual NIC, for example to another // virtual NIC or to the public Internet. // Required FlowDirection string `json:"flowDirection"` // The name of the Security Rule // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. // Object names are case-sensitive. When you specify the object name, ensure that an object // of the same type and with the same name doesn't already exist. // If such an object already exists, another object of the same type and with the same name won't // be created and the existing object won't be updated. // Required Name string `json:"name"` // A list of security protocols for which you want to permit traffic. Only packets that // match the specified protocols and ports are permitted. When no security protocols are // specified, traffic using any protocol over any port is permitted. // Optional SecProtocols []string `json:"secProtocols"` // A list of IP address prefix sets from which you want to permit traffic. Only packets // from IP addresses in the specified IP address prefix sets are permitted. When no source // IP address prefix sets are specified, traffic from any IP address is permitted. // Optional SrcIPAddressPrefixSets []string `json:"srcIpAddressPrefixSets"` // The vNICset from which you want to permit traffic. Only packets from vNICs in the // specified vNICset are permitted. When no source vNICset is specified, traffic from any // vNIC is permitted. // Optional SrcVnicSet string `json:"srcVnicSet,omitempty"` // Strings that you can use to tag the security rule. // Optional Tags []string `json:"tags"` } // UpdateSecurityRule modifies the properties of the sec rule with the given name. func (c *SecurityRuleClient) UpdateSecurityRule(updateInput *UpdateSecurityRuleInput) (*SecurityRuleInfo, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) updateInput.ACL = c.getQualifiedName(updateInput.ACL) updateInput.SrcVnicSet = c.getQualifiedName(updateInput.SrcVnicSet) updateInput.DstVnicSet = c.getQualifiedName(updateInput.DstVnicSet) updateInput.SrcIPAddressPrefixSets = c.getQualifiedList(updateInput.SrcIPAddressPrefixSets) updateInput.DstIPAddressPrefixSets = c.getQualifiedList(updateInput.DstIPAddressPrefixSets) updateInput.SecProtocols = c.getQualifiedList(updateInput.SecProtocols) var securityRuleInfo SecurityRuleInfo if err := c.updateResource(updateInput.Name, updateInput, &securityRuleInfo); err != nil { return nil, err } return c.success(&securityRuleInfo) } // DeleteSecurityRuleInput specifies which security rule to delete type DeleteSecurityRuleInput struct { // The name of the Security Rule to query for. Case-sensitive // Required Name string `json:"name"` } // DeleteSecurityRule deletes the specifies security rule func (c *SecurityRuleClient) DeleteSecurityRule(input *DeleteSecurityRuleInput) error { return c.deleteResource(input.Name) } // Unqualifies any qualified fields in the IPNetworkExchangeInfo struct func (c *SecurityRuleClient) success(info *SecurityRuleInfo) (*SecurityRuleInfo, error) { info.Name = c.getUnqualifiedName(info.FQDN) c.unqualify(&info.ACL, &info.SrcVnicSet, &info.DstVnicSet) info.SrcIPAddressPrefixSets = c.getUnqualifiedList(info.SrcIPAddressPrefixSets) info.DstIPAddressPrefixSets = c.getUnqualifiedList(info.DstIPAddressPrefixSets) info.SecProtocols = c.getUnqualifiedList(info.SecProtocols) return info, nil } �������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/snapshots.go���������������0000664�0000000�0000000�00000021400�13771713062�0030670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "time" ) const waitForSnapshotCompletePollInterval = 30 * time.Second const waitForSnapshotCompleteTimeout = 600 * time.Second // SnapshotsClient is a client for the Snapshot functions of the Compute API. type SnapshotsClient struct { ResourceClient } // Snapshots obtains an SnapshotsClient which can be used to access to the // Snapshot functions of the Compute API func (c *Client) Snapshots() *SnapshotsClient { return &SnapshotsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "Snapshot", ContainerPath: "/snapshot/", ResourceRootPath: "/snapshot", }} } // SnapshotState defines the constant states a snapshot can be in type SnapshotState string const ( // SnapshotActive - active SnapshotActive SnapshotState = "active" // SnapshotComplete - complete SnapshotComplete SnapshotState = "complete" // SnapshotQueued - queued SnapshotQueued SnapshotState = "queued" // SnapshotError - error SnapshotError SnapshotState = "error" ) // SnapshotDelay defines the constant values snapshot delay can be type SnapshotDelay string const ( // SnapshotDelayShutdown - shutdown SnapshotDelayShutdown SnapshotDelay = "shutdown" ) // Snapshot describes an existing Snapshot. type Snapshot struct { // Shows the default account for your identity domain. Account string `json:"account"` // Timestamp when this request was created. CreationTime string `json:"creation_time"` // Snapshot of the instance is not taken immediately. Delay SnapshotDelay `json:"delay"` // A description of the reason this request entered "error" state. ErrorReason string `json:"error_reason"` // Fully Qualified Domain Name FQDN string `json:"name"` // Name of the instance Instance string `json:"instance"` // Name of the machine image generated from the instance snapshot request. MachineImage string `json:"machineimage"` // Name of the instance snapshot request. Name string // Not used Quota string `json:"quota"` // The state of the request. State SnapshotState `json:"state"` // Uniform Resource Identifier URI string `json:"uri"` } // CreateSnapshotInput defines an Snapshot to be created. type CreateSnapshotInput struct { // The name of the account that contains the credentials and access details of // Oracle Storage Cloud Service. The machine image file is uploaded to the Oracle // Storage Cloud Service account that you specify. // Optional Account string `json:"account,omitempty"` // Use this option when you want to preserve the custom changes you have made // to an instance before deleting the instance. The only permitted value is shutdown. // Snapshot of the instance is not taken immediately. It creates a machine image which // preserves the changes you have made to the instance, and then the instance is deleted. // Note: This option has no effect if you shutdown the instance from inside it. Any pending // snapshot request on that instance goes into error state. You must delete the instance // (DELETE /instance/{name}). // Optional Delay SnapshotDelay `json:"delay,omitempty"` // Name of the instance that you want to clone. // Required Instance string `json:"instance"` // Specify the name of the machine image created by the snapshot request. // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. // Object names are case-sensitive. // If you don't specify a name for this object, then the name is generated automatically. // Optional MachineImage string `json:"machineimage,omitempty"` // Time to wait between polling snapshot status PollInterval time.Duration `json:"-"` // Time to wait for snapshot to be completed Timeout time.Duration `json:"-"` } // CreateSnapshot creates a new Snapshot func (c *SnapshotsClient) CreateSnapshot(input *CreateSnapshotInput) (*Snapshot, error) { input.Account = c.getQualifiedACMEName(input.Account) input.Instance = c.getQualifiedName(input.Instance) input.MachineImage = c.getQualifiedName(input.MachineImage) var snapshotInfo Snapshot if err := c.createResource(&input, &snapshotInfo); err != nil { return nil, err } // Call wait for snapshot complete now, as creating the snashot is an eventually consistent operation getInput := &GetSnapshotInput{ Name: snapshotInfo.Name, } if input.PollInterval == 0 { input.PollInterval = waitForSnapshotCompletePollInterval } if input.Timeout == 0 { input.Timeout = waitForSnapshotCompleteTimeout } // Wait for snapshot to be complete and return the result return c.WaitForSnapshotComplete(getInput, input.PollInterval, input.Timeout) } // GetSnapshotInput describes the snapshot to get type GetSnapshotInput struct { // The name of the Snapshot // Required Name string `json:"name"` } // GetSnapshot retrieves the Snapshot with the given name. func (c *SnapshotsClient) GetSnapshot(getInput *GetSnapshotInput) (*Snapshot, error) { getInput.Name = c.getQualifiedName(getInput.Name) var snapshotInfo Snapshot if err := c.getResource(getInput.Name, &snapshotInfo); err != nil { return nil, err } return c.success(&snapshotInfo) } // DeleteSnapshotInput describes the snapshot to delete type DeleteSnapshotInput struct { // The name of the Snapshot // Required Snapshot string // The name of the machine image // Required MachineImage string // Time to wait between polls to check snapshot status PollInterval time.Duration // Time to wait for snapshot to be deleted Timeout time.Duration } // DeleteSnapshot deletes the Snapshot with the given name. // A machine image gets created with the associated snapshot and needs to be deleted as well. func (c *SnapshotsClient) DeleteSnapshot(machineImagesClient *MachineImagesClient, input *DeleteSnapshotInput) error { // Wait for snapshot complete in case delay is active and the corresponding instance needs to be deleted first getInput := &GetSnapshotInput{ Name: input.Snapshot, } if input.PollInterval == 0 { input.PollInterval = waitForSnapshotCompletePollInterval } if input.Timeout == 0 { input.Timeout = waitForSnapshotCompleteTimeout } if _, err := c.WaitForSnapshotComplete(getInput, input.PollInterval, input.Timeout); err != nil { return fmt.Errorf("Could not delete snapshot: %s", err) } if err := c.deleteResource(input.Snapshot); err != nil { return fmt.Errorf("Could not delete snapshot: %s", err) } deleteMachineImageRequest := &DeleteMachineImageInput{ Name: input.MachineImage, } if err := machineImagesClient.DeleteMachineImage(deleteMachineImageRequest); err != nil { return fmt.Errorf("Could not delete machine image associated with snapshot: %s", err) } return nil } // DeleteSnapshotResourceOnly deletes the Snapshot with the given name. // The machine image that gets created with the associated snapshot is not // deleted by this method. func (c *SnapshotsClient) DeleteSnapshotResourceOnly(input *DeleteSnapshotInput) error { // Wait for snapshot complete in case delay is active and the corresponding // instance needs to be deleted first getInput := &GetSnapshotInput{ Name: input.Snapshot, } if input.PollInterval == 0 { input.PollInterval = waitForSnapshotCompletePollInterval } if input.Timeout == 0 { input.Timeout = waitForSnapshotCompleteTimeout } if _, err := c.WaitForSnapshotComplete(getInput, input.PollInterval, input.Timeout); err != nil { return fmt.Errorf("Could not delete snapshot: %s", err) } if err := c.deleteResource(input.Snapshot); err != nil { return fmt.Errorf("Could not delete snapshot: %s", err) } return nil } // WaitForSnapshotComplete waits for an snapshot to be completely initialized and available. func (c *SnapshotsClient) WaitForSnapshotComplete(input *GetSnapshotInput, pollInterval, timeout time.Duration) (*Snapshot, error) { var info *Snapshot var getErr error err := c.client.WaitFor("snapshot to be complete", pollInterval, timeout, func() (bool, error) { info, getErr = c.GetSnapshot(input) if getErr != nil { return false, getErr } switch s := info.State; s { case SnapshotError: return false, fmt.Errorf("Error initializing snapshot: %s", info.ErrorReason) case SnapshotComplete: c.client.DebugLogString("Snapshot Complete") return true, nil case SnapshotQueued: c.client.DebugLogString("Snapshot Queuing") return false, nil case SnapshotActive: c.client.DebugLogString("Snapshot Active") if info.Delay == SnapshotDelayShutdown { return true, nil } return false, nil default: c.client.DebugLogString(fmt.Sprintf("Unknown snapshot state: %s, waiting", s)) return false, nil } }) return info, err } func (c *SnapshotsClient) success(snapshotInfo *Snapshot) (*Snapshot, error) { c.unqualify(&snapshotInfo.Account) c.unqualify(&snapshotInfo.Instance) c.unqualify(&snapshotInfo.MachineImage) snapshotInfo.Name = c.getUnqualifiedName(snapshotInfo.FQDN) return snapshotInfo, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/ssh_keys.go����������������0000664�0000000�0000000�00000010052�13771713062�0030477�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // SSHKeysClient is a client for the SSH key functions of the Compute API. type SSHKeysClient struct { ResourceClient } // SSHKeys obtains an SSHKeysClient which can be used to access to the // SSH key functions of the Compute API func (c *Client) SSHKeys() *SSHKeysClient { return &SSHKeysClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "SSH key", ContainerPath: "/sshkey/", ResourceRootPath: "/sshkey", }} } // SSHKey describes an existing SSH key. type SSHKey struct { // Indicates whether the key is enabled (true) or disabled. Enabled bool `json:"enabled"` // Fully Qualified Domain Name FQDN string `json:"name"` // The SSH public key value. Key string `json:"key"` // The three-part name of the SSH Key (/Compute-identity_domain/user/object). Name string // Unique Resource Identifier URI string `json:"uri"` } // CreateSSHKeyInput defines an SSH key to be created. type CreateSSHKeyInput struct { // The three-part name of the SSH Key (/Compute-identity_domain/user/object). // Object names can contain only alphanumeric characters, hyphens, underscores, and periods. Object names are case-sensitive. // Required Name string `json:"name"` // The SSH public key value. // Required Key string `json:"key"` // Indicates whether the key must be enabled (default) or disabled. Note that disabled keys cannot be associated with instances. // To explicitly enable the key, specify true. To disable the key, specify false. // Optional Enabled bool `json:"enabled"` } // CreateSSHKey creates a new SSH key with the given name, key and enabled flag. func (c *SSHKeysClient) CreateSSHKey(createInput *CreateSSHKeyInput) (*SSHKey, error) { var keyInfo SSHKey // We have to update after create to get the full ssh key into opc updateSSHKeyInput := UpdateSSHKeyInput{ Name: createInput.Name, Key: createInput.Key, Enabled: createInput.Enabled, } createInput.Name = c.getQualifiedName(createInput.Name) if err := c.createResource(&createInput, &keyInfo); err != nil { return nil, err } _, err := c.UpdateSSHKey(&updateSSHKeyInput) if err != nil { return nil, err } return c.success(&keyInfo) } // GetSSHKeyInput describes the ssh key to get type GetSSHKeyInput struct { // The three-part name of the SSH Key (/Compute-identity_domain/user/object). Name string `json:"name"` } // GetSSHKey retrieves the SSH key with the given name. func (c *SSHKeysClient) GetSSHKey(getInput *GetSSHKeyInput) (*SSHKey, error) { var keyInfo SSHKey if err := c.getResource(getInput.Name, &keyInfo); err != nil { return nil, err } return c.success(&keyInfo) } // UpdateSSHKeyInput defines an SSH key to be updated type UpdateSSHKeyInput struct { // The three-part name of the object (/Compute-identity_domain/user/object). Name string `json:"name"` // The SSH public key value. // Required Key string `json:"key"` // Indicates whether the key must be enabled (default) or disabled. Note that disabled keys cannot be associated with instances. // To explicitly enable the key, specify true. To disable the key, specify false. // Optional // TODO/NOTE: isn't this required? Enabled bool `json:"enabled"` } // UpdateSSHKey updates the key and enabled flag of the SSH key with the given name. func (c *SSHKeysClient) UpdateSSHKey(updateInput *UpdateSSHKeyInput) (*SSHKey, error) { var keyInfo SSHKey updateInput.Name = c.getQualifiedName(updateInput.Name) if err := c.updateResource(updateInput.Name, updateInput, &keyInfo); err != nil { return nil, err } return c.success(&keyInfo) } // DeleteSSHKeyInput describes the ssh key to delete type DeleteSSHKeyInput struct { // The three-part name of the SSH Key (/Compute-identity_domain/user/object). Name string `json:"name"` } // DeleteSSHKey deletes the SSH key with the given name. func (c *SSHKeysClient) DeleteSSHKey(deleteInput *DeleteSSHKeyInput) error { return c.deleteResource(deleteInput.Name) } func (c *SSHKeysClient) success(keyInfo *SSHKey) (*SSHKey, error) { keyInfo.Name = c.getUnqualifiedName(keyInfo.FQDN) return keyInfo, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������storage_volume_attachments.go�����������������������������������������������������������������������0000664�0000000�0000000�00000015660�13771713062�0034230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute�����������������������������������������������������������������������������������������������package compute import ( "time" "github.com/hashicorp/go-oracle-terraform/client" ) const waitForVolumeAttachmentDeletePollInterval = 1 * time.Second const waitForVolumeAttachmentDeleteTimeout = 30 * time.Second const waitForVolumeAttachmentReadyPollInterval = 1 * time.Second const waitForVolumeAttachmentReadyTimeout = 30 * time.Second // StorageAttachmentsClient is a client for the Storage Attachment functions of the Compute API. type StorageAttachmentsClient struct { ResourceClient } // StorageAttachments obtains a StorageAttachmentsClient which can be used to access to the // Storage Attachment functions of the Compute API func (c *Client) StorageAttachments() *StorageAttachmentsClient { return &StorageAttachmentsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "storage volume attachment", ContainerPath: "/storage/attachment/", ResourceRootPath: "/storage/attachment", }} } // StorageAttachmentState defines all the storage attachment states type StorageAttachmentState string const ( // Attaching - attaching Attaching StorageAttachmentState = "attaching" // Attached - attached Attached StorageAttachmentState = "attached" // Detaching - detaching Detaching StorageAttachmentState = "detaching" // Unavailable - unavailable Unavailable StorageAttachmentState = "unavailable" // Unknown - unkown Unknown StorageAttachmentState = "unknown" ) // StorageAttachmentInfo describes an existing storage attachment. type StorageAttachmentInfo struct { // Fully Qualified Domain Name FQDN string `json:"name"` // Name of this attachment, generated by the server. Name string // Index number for the volume. The allowed range is 1-10 // An attachment with index 1 is exposed to the instance as /dev/xvdb, an attachment with index 2 is exposed as /dev/xvdc, and so on. Index int `json:"index"` // Multipart name of the instance attached to the storage volume. InstanceName string `json:"instance_name"` // Multipart name of the volume attached to the instance. StorageVolumeName string `json:"storage_volume_name"` // The State of the Storage Attachment State StorageAttachmentState `json:"state"` } func (c *StorageAttachmentsClient) success(attachmentInfo *StorageAttachmentInfo) (*StorageAttachmentInfo, error) { attachmentInfo.Name = c.getQualifiedName(attachmentInfo.FQDN) c.unqualify(&attachmentInfo.InstanceName, &attachmentInfo.StorageVolumeName) return attachmentInfo, nil } // CreateStorageAttachmentInput defines the attributes to create a storage attachment type CreateStorageAttachmentInput struct { // Index number for the volume. The allowed range is 1-10 // An attachment with index 1 is exposed to the instance as /dev/xvdb, an attachment with index 2 is exposed as /dev/xvdc, and so on. // Required. Index int `json:"index"` // Multipart name of the instance to which you want to attach the volume. // Required. InstanceName string `json:"instance_name"` // Multipart name of the volume that you want to attach. // Required. StorageVolumeName string `json:"storage_volume_name"` // Time to wait between polls to check volume attachment status PollInterval time.Duration `json:"-"` // Time to wait for storage volume attachment Timeout time.Duration `json:"-"` } // CreateStorageAttachment creates a storage attachment attaching the given volume to the given instance at the given index. func (c *StorageAttachmentsClient) CreateStorageAttachment(input *CreateStorageAttachmentInput) (*StorageAttachmentInfo, error) { input.InstanceName = c.getQualifiedName(input.InstanceName) input.StorageVolumeName = c.getQualifiedName(input.StorageVolumeName) var attachmentInfo *StorageAttachmentInfo if err := c.createResource(&input, &attachmentInfo); err != nil { return nil, err } if input.PollInterval == 0 { input.PollInterval = waitForVolumeAttachmentReadyPollInterval } if input.Timeout == 0 { input.Timeout = waitForVolumeAttachmentReadyTimeout } return c.waitForStorageAttachmentToFullyAttach(attachmentInfo.Name, input.PollInterval, input.Timeout) } // DeleteStorageAttachmentInput represents the body of an API request to delete a Storage Attachment. type DeleteStorageAttachmentInput struct { // The three-part name of the Storage Attachment (/Compute-identity_domain/user/object). // Required Name string `json:"name"` // Time to wait between polls to check volume attachment status PollInterval time.Duration `json:"-"` // Time to wait for storage volume snapshot Timeout time.Duration `json:"-"` } // DeleteStorageAttachment deletes the storage attachment with the given name. func (c *StorageAttachmentsClient) DeleteStorageAttachment(input *DeleteStorageAttachmentInput) error { if err := c.deleteResource(input.Name); err != nil { return err } if input.PollInterval == 0 { input.PollInterval = waitForVolumeAttachmentDeletePollInterval } if input.Timeout == 0 { input.Timeout = waitForVolumeAttachmentDeleteTimeout } return c.waitForStorageAttachmentToBeDeleted(input.Name, input.PollInterval, input.Timeout) } // GetStorageAttachmentInput represents the body of an API request to obtain a Storage Attachment. type GetStorageAttachmentInput struct { // The three-part name of the Storage Attachment (/Compute-identity_domain/user/object). // Required Name string `json:"name"` } // GetStorageAttachment retrieves the storage attachment with the given name. func (c *StorageAttachmentsClient) GetStorageAttachment(input *GetStorageAttachmentInput) (*StorageAttachmentInfo, error) { var attachmentInfo *StorageAttachmentInfo if err := c.getResource(input.Name, &attachmentInfo); err != nil { return nil, err } return c.success(attachmentInfo) } // waitForStorageAttachmentToFullyAttach waits for the storage attachment with the given name to be fully attached, or times out. func (c *StorageAttachmentsClient) waitForStorageAttachmentToFullyAttach(name string, pollInterval, timeout time.Duration) (*StorageAttachmentInfo, error) { var waitResult *StorageAttachmentInfo err := c.client.WaitFor("storage attachment to be attached", pollInterval, timeout, func() (bool, error) { input := &GetStorageAttachmentInput{ Name: name, } info, err := c.GetStorageAttachment(input) if err != nil { return false, err } if info != nil { if info.State == Attached { waitResult = info return true, nil } } return false, nil }) return waitResult, err } // waitForStorageAttachmentToBeDeleted waits for the storage attachment with the given name to be fully deleted, or times out. func (c *StorageAttachmentsClient) waitForStorageAttachmentToBeDeleted(name string, pollInterval, timeout time.Duration) error { return c.client.WaitFor("storage attachment to be deleted", pollInterval, timeout, func() (bool, error) { input := &GetStorageAttachmentInput{ Name: name, } _, err := c.GetStorageAttachment(input) if err != nil { if client.WasNotFoundError(err) { return true, nil } return false, err } return false, nil }) } ��������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/storage_volume_snapshots.go0000664�0000000�0000000�00000020524�13771713062�0034011�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "strings" "time" "github.com/hashicorp/go-oracle-terraform/client" ) const ( storageVolumeSnapshotDescription = "storage volume snapshot" storageVolumeSnapshotContainerPath = "/storage/snapshot/" storageVolumeSnapshotResourcePath = "/storage/snapshot" waitForSnapshotCreatePollInterval = 30 * time.Second waitForSnapshotCreateTimeout = 2400 * time.Second waitForSnapshotDeletePollInterval = 30 * time.Second waitForSnapshotDeleteTimeout = 1500 * time.Second // SnapshotPropertyCollocated - Collocated Snapshot Property SnapshotPropertyCollocated = "/oracle/private/storage/snapshot/collocated" ) // StorageVolumeSnapshotClient is a client for the Storage Volume Snapshot functions of the Compute API. type StorageVolumeSnapshotClient struct { ResourceClient } // StorageVolumeSnapshots returns a storage volume snapshot client func (c *Client) StorageVolumeSnapshots() *StorageVolumeSnapshotClient { return &StorageVolumeSnapshotClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: storageVolumeSnapshotDescription, ContainerPath: storageVolumeSnapshotContainerPath, ResourceRootPath: storageVolumeSnapshotResourcePath, }, } } // StorageVolumeSnapshotInfo represents the information retrieved from the service about a storage volume snapshot type StorageVolumeSnapshotInfo struct { // Account to use for snapshots Account string `json:"account"` // Description of the snapshot Description string `json:"description"` // Fully Qualified Domain Name FQDN string `json:"name"` // The name of the machine image that's used in the boot volume from which this snapshot is taken MachineImageName string `json:"machineimage_name"` // Name of the snapshot Name string // String indicating whether the parent volume is bootable or not ParentVolumeBootable string `json:"parent_volume_bootable"` // Platform the snapshot is compatible with Platform string `json:"platform"` // String determining whether the snapshot is remote or collocated Property string `json:"property"` // The size of the snapshot in GB Size string `json:"size"` // The ID of the snapshot. Generated by the server SnapshotID string `json:"snapshot_id"` // The timestamp of the storage snapshot SnapshotTimestamp string `json:"snapshot_timestamp"` // Timestamp for when the operation started StartTimestamp string `json:"start_timestamp"` // Status of the snapshot Status string `json:"status"` // Status Detail of the storage snapshot StatusDetail string `json:"status_detail"` // Indicates the time that the current view of the storage volume snapshot was generated. StatusTimestamp string `json:"status_timestamp"` // Array of tags for the snapshot Tags []string `json:"tags,omitempty"` // Uniform Resource Identifier URI string `json:"uri"` // Name of the parent storage volume for the snapshot Volume string `json:"volume"` } // CreateStorageVolumeSnapshotInput represents the body of an API request to create a new storage volume snapshot type CreateStorageVolumeSnapshotInput struct { // Description of the snapshot // Optional Description string `json:"description,omitempty"` // Name of the snapshot // Optional, will be generated if not specified Name string `json:"name,omitempty"` // Whether or not the parent volume is bootable // Optional ParentVolumeBootable string `json:"parent_volume_bootable,omitempty"` // Whether collocated or remote // Optional, will be remote if unspecified Property string `json:"property,omitempty"` // Array of tags for the snapshot // Optional Tags []string `json:"tags,omitempty"` // Name of the volume to create the snapshot from // Required Volume string `json:"volume"` // Timeout to wait between polling snapshot status. Will use default if unspecified PollInterval time.Duration `json:"-"` // Timeout to wait for snapshot to be completed. Will use default if unspecified Timeout time.Duration `json:"-"` } // CreateStorageVolumeSnapshot creates a snapshot based on the supplied information struct func (c *StorageVolumeSnapshotClient) CreateStorageVolumeSnapshot(input *CreateStorageVolumeSnapshotInput) (*StorageVolumeSnapshotInfo, error) { if input.Name != "" { input.Name = c.getQualifiedName(input.Name) } input.Volume = c.getQualifiedName(input.Volume) var storageSnapshotInfo StorageVolumeSnapshotInfo if err := c.createResource(&input, &storageSnapshotInfo); err != nil { return nil, err } if input.PollInterval == 0 { input.PollInterval = waitForSnapshotCreatePollInterval } if input.Timeout == 0 { input.Timeout = waitForSnapshotCreateTimeout } // The name of the snapshot could have been generated. Use the response name as input return c.waitForStorageSnapshotAvailable(storageSnapshotInfo.Name, input.PollInterval, input.Timeout) } // GetStorageVolumeSnapshotInput represents the body of an API request to get information on a storage volume snapshot type GetStorageVolumeSnapshotInput struct { // Name of the snapshot Name string `json:"name"` } // GetStorageVolumeSnapshot makes an API request to populate information on a storage volume snapshot func (c *StorageVolumeSnapshotClient) GetStorageVolumeSnapshot(input *GetStorageVolumeSnapshotInput) (*StorageVolumeSnapshotInfo, error) { var storageSnapshot StorageVolumeSnapshotInfo input.Name = c.getQualifiedName(input.Name) if err := c.getResource(input.Name, &storageSnapshot); err != nil { if client.WasNotFoundError(err) { return nil, nil } return nil, err } return c.success(&storageSnapshot) } // DeleteStorageVolumeSnapshotInput represents the body of an API request to delete a storage volume snapshot type DeleteStorageVolumeSnapshotInput struct { // Name of the snapshot to delete Name string `json:"name"` // Timeout to wait between polling snapshot status, will use default if unspecified PollInterval time.Duration `json:"-"` // Timeout to wait for deletion, will use default if unspecified Timeout time.Duration `json:"-"` } // DeleteStorageVolumeSnapshot makes an API request to delete a storage volume snapshot func (c *StorageVolumeSnapshotClient) DeleteStorageVolumeSnapshot(input *DeleteStorageVolumeSnapshotInput) error { input.Name = c.getQualifiedName(input.Name) if err := c.deleteResource(input.Name); err != nil { return err } if input.PollInterval == 0 { input.PollInterval = waitForSnapshotDeletePollInterval } if input.Timeout == 0 { input.Timeout = waitForSnapshotDeleteTimeout } return c.waitForStorageSnapshotDeleted(input.Name, input.PollInterval, input.Timeout) } func (c *StorageVolumeSnapshotClient) success(result *StorageVolumeSnapshotInfo) (*StorageVolumeSnapshotInfo, error) { result.Name = c.getUnqualifiedName(result.FQDN) c.unqualify(&result.Volume) sizeInGigaBytes, err := sizeInGigaBytes(result.Size) if err != nil { return nil, err } result.Size = sizeInGigaBytes return result, nil } // Waits for a storage snapshot to become available func (c *StorageVolumeSnapshotClient) waitForStorageSnapshotAvailable(name string, pollInterval, timeout time.Duration) (*StorageVolumeSnapshotInfo, error) { var result *StorageVolumeSnapshotInfo err := c.client.WaitFor( fmt.Sprintf("storage volume snapshot %s to become available", c.getQualifiedName(name)), pollInterval, timeout, func() (bool, error) { req := &GetStorageVolumeSnapshotInput{ Name: name, } res, err := c.GetStorageVolumeSnapshot(req) if err != nil { return false, err } if res != nil { result = res if strings.ToLower(result.Status) == "completed" { return true, nil } else if strings.ToLower(result.Status) == "error" { return false, fmt.Errorf("Snapshot '%s' failed to create successfully. Status: %s Status Detail: %s", result.Name, result.Status, result.StatusDetail) } } return false, nil }) return result, err } // Waits for a storage snapshot to be deleted func (c *StorageVolumeSnapshotClient) waitForStorageSnapshotDeleted(name string, pollInterval, timeout time.Duration) error { return c.client.WaitFor( fmt.Sprintf("storage volume snapshot %s to be deleted", c.getQualifiedName(name)), pollInterval, timeout, func() (bool, error) { req := &GetStorageVolumeSnapshotInput{ Name: name, } res, err := c.GetStorageVolumeSnapshot(req) if res == nil { return true, nil } if err != nil { return false, err } return res == nil, nil }) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/storage_volumes.go���������0000664�0000000�0000000�00000033130�13771713062�0032067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "strconv" "strings" "time" "github.com/hashicorp/go-oracle-terraform/client" ) const waitForVolumeReadyPollInterval = 10 * time.Second const waitForVolumeReadyTimeout = 600 * time.Second const waitForVolumeDeletePollInterval = 10 * time.Second const waitForVolumeDeleteTimeout = 600 * time.Second // StorageVolumeClient is a client for the Storage Volume functions of the Compute API. type StorageVolumeClient struct { ResourceClient } // StorageVolumes obtains a StorageVolumeClient which can be used to access to the // Storage Volume functions of the Compute API func (c *Client) StorageVolumes() *StorageVolumeClient { return &StorageVolumeClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "storage volume", ContainerPath: "/storage/volume/", ResourceRootPath: "/storage/volume", }} } // StorageVolumeKind defines the kinds of storage volumes that can be managed type StorageVolumeKind string const ( // StorageVolumeKindDefault - "/oracle/public/storage/default" StorageVolumeKindDefault StorageVolumeKind = "/oracle/public/storage/default" // StorageVolumeKindLatency - "/oracle/public/storage/latency" StorageVolumeKindLatency StorageVolumeKind = "/oracle/public/storage/latency" // StorageVolumeKindSSD - "/oracle/public/storage/ssd/gpl" StorageVolumeKindSSD StorageVolumeKind = "/oracle/public/storage/ssd/gpl" ) // StorageVolumeInfo represents information retrieved from the service about a Storage Volume. type StorageVolumeInfo struct { // Shows the default account for your identity domain. Account string `json:"account,omitempty"` // The description of the storage volume. Description string `json:"description,omitempty"` // Fully Qualified Domain Name FQDN string `json:"name"` // The hypervisor that this volume is compatible with. Hypervisor string `json:"hypervisor,omitempty"` // Name of machine image to extract onto this volume when created. This information is provided only for bootable storage volumes. ImageList string `json:"imagelist,omitempty"` // Three-part name of the machine image. This information is available if the volume is a bootable storage volume. MachineImage string `json:"machineimage_name,omitempty"` // The three-part name of the object (/Compute-identity_domain/user/object). Name string // The OS platform this volume is compatible with. Platform string `json:"platform,omitempty"` // The storage-pool property: /oracle/public/storage/latency or /oracle/public/storage/default. Properties []string `json:"properties,omitempty"` // The size of this storage volume in GB. Size string `json:"size"` // Name of the parent snapshot from which the storage volume is restored or cloned. Snapshot string `json:"snapshot,omitempty"` // Account of the parent snapshot from which the storage volume is restored. SnapshotAccount string `json:"snapshot_account,omitempty"` // Id of the parent snapshot from which the storage volume is restored or cloned. SnapshotID string `json:"snapshot_id,omitempty"` // TODO: this should become a Constant, if/when we have the values // The current state of the storage volume. Status string `json:"status,omitempty"` // Details about the latest state of the storage volume. StatusDetail string `json:"status_detail,omitempty"` // It indicates the time that the current view of the storage volume was generated. StatusTimestamp string `json:"status_timestamp,omitempty"` // The storage pool from which this volume is allocated. StoragePool string `json:"storage_pool,omitempty"` // Comma-separated strings that tag the storage volume. Tags []string `json:"tags,omitempty"` // Uniform Resource Identifier URI string `json:"uri,omitempty"` // true indicates that the storage volume can also be used as a boot disk for an instance. // If you set the value to true, then you must specify values for the `ImageList` and `ImageListEntry` fields. Bootable bool `json:"bootable,omitempty"` // All volumes are managed volumes. Default value is true. Managed bool `json:"managed,omitempty"` // Boolean field indicating whether this volume can be attached as readonly. If set to False the volume will be attached as read-write. ReadOnly bool `json:"readonly,omitempty"` // Specific imagelist entry version to extract. ImageListEntry int `json:"imagelist_entry,omitempty"` } func (c *StorageVolumeClient) getStorageVolumePath(name string) string { return c.getObjectPath("/storage/volume", name) } // CreateStorageVolumeInput represents the body of an API request to create a new Storage Volume. type CreateStorageVolumeInput struct { // true indicates that the storage volume can also be used as a boot disk for an instance. // If you set the value to true, then you must specify values for the `ImageList` and `ImageListEntry` fields. Bootable bool `json:"bootable,omitempty"` // The description of the storage volume. Description string `json:"description,omitempty"` // Name of machine image to extract onto this volume when created. This information is provided only for bootable storage volumes. ImageList string `json:"imagelist,omitempty"` // Specific imagelist entry version to extract. ImageListEntry int `json:"imagelist_entry,omitempty"` // The three-part name of the object (/Compute-identity_domain/user/object). Name string `json:"name"` // The storage-pool property: /oracle/public/storage/latency or /oracle/public/storage/default. Properties []string `json:"properties,omitempty"` // The size of this storage volume in GB. Size string `json:"size"` // Name of the parent snapshot from which the storage volume is restored or cloned. Snapshot string `json:"snapshot,omitempty"` // Account of the parent snapshot from which the storage volume is restored. SnapshotAccount string `json:"snapshot_account,omitempty"` // Id of the parent snapshot from which the storage volume is restored or cloned. SnapshotID string `json:"snapshot_id,omitempty"` // Comma-separated strings that tag the storage volume. Tags []string `json:"tags,omitempty"` // Timeout to wait polling storage volume status. PollInterval time.Duration `json:"-"` // Timeout to wait for storage volume creation. Timeout time.Duration `json:"-"` } // CreateStorageVolume uses the given CreateStorageVolumeInput to create a new Storage Volume. func (c *StorageVolumeClient) CreateStorageVolume(input *CreateStorageVolumeInput) (*StorageVolumeInfo, error) { input.Name = c.getQualifiedName(input.Name) input.ImageList = c.getQualifiedName(input.ImageList) sizeInBytes, err := sizeInBytes(input.Size) if err != nil { return nil, err } input.Size = sizeInBytes var storageInfo StorageVolumeInfo if err = c.createResource(&input, &storageInfo); err != nil { return nil, err } // Should never be nil, as we set this in the provider; but protect against it anyways. if input.PollInterval == 0 { input.PollInterval = waitForVolumeReadyPollInterval } if input.Timeout == 0 { input.Timeout = waitForVolumeReadyTimeout } volume, err := c.waitForStorageVolumeToBecomeAvailable(input.Name, input.PollInterval, input.Timeout) if err != nil { if volume != nil { deleteInput := &DeleteStorageVolumeInput{ Name: volume.Name, } if err = c.DeleteStorageVolume(deleteInput); err != nil { return nil, err } } } return volume, err } // DeleteStorageVolumeInput represents the body of an API request to delete a Storage Volume. type DeleteStorageVolumeInput struct { // The three-part name of the object (/Compute-identity_domain/user/object). Name string `json:"name"` // Timeout to wait betweeon polling storage volume status PollInterval time.Duration `json:"-"` // Timeout to wait for storage volume deletion Timeout time.Duration `json:"-"` } // DeleteStorageVolume deletes the specified storage volume. func (c *StorageVolumeClient) DeleteStorageVolume(input *DeleteStorageVolumeInput) error { if err := c.deleteResource(input.Name); err != nil { return err } // Should never be nil, but protect against it anyways if input.PollInterval == 0 { input.PollInterval = waitForVolumeDeletePollInterval } if input.Timeout == 0 { input.Timeout = waitForVolumeDeleteTimeout } return c.waitForStorageVolumeToBeDeleted(input.Name, input.PollInterval, input.Timeout) } // GetStorageVolumeInput represents the body of an API request to obtain a Storage Volume. type GetStorageVolumeInput struct { // The three-part name of the object (/Compute-identity_domain/user/object). Name string `json:"name"` } func (c *StorageVolumeClient) success(result *StorageVolumeInfo) (*StorageVolumeInfo, error) { c.unqualify(&result.ImageList) result.Name = c.getUnqualifiedName(result.FQDN) c.unqualify(&result.Snapshot) sizeInMegaBytes, err := sizeInGigaBytes(result.Size) if err != nil { return nil, err } result.Size = sizeInMegaBytes return result, nil } // GetStorageVolume gets Storage Volume information for the specified storage volume. func (c *StorageVolumeClient) GetStorageVolume(input *GetStorageVolumeInput) (*StorageVolumeInfo, error) { var storageVolume StorageVolumeInfo if err := c.getResource(input.Name, &storageVolume); err != nil { if client.WasNotFoundError(err) { return nil, nil } return nil, err } return c.success(&storageVolume) } // UpdateStorageVolumeInput represents the body of an API request to update a Storage Volume. type UpdateStorageVolumeInput struct { // The description of the storage volume. Description string `json:"description,omitempty"` // Name of machine image to extract onto this volume when created. This information is provided only for bootable storage volumes. ImageList string `json:"imagelist,omitempty"` // Specific imagelist entry version to extract. ImageListEntry int `json:"imagelist_entry,omitempty"` // The three-part name of the object (/Compute-identity_domain/user/object). Name string `json:"name"` // The storage-pool property: /oracle/public/storage/latency or /oracle/public/storage/default. Properties []string `json:"properties,omitempty"` // The size of this storage volume in GB. Size string `json:"size"` // Name of the parent snapshot from which the storage volume is restored or cloned. Snapshot string `json:"snapshot,omitempty"` // Account of the parent snapshot from which the storage volume is restored. SnapshotAccount string `json:"snapshot_account,omitempty"` // Id of the parent snapshot from which the storage volume is restored or cloned. SnapshotID string `json:"snapshot_id,omitempty"` // Comma-separated strings that tag the storage volume. Tags []string `json:"tags,omitempty"` // Time to wait between polling storage volume status PollInterval time.Duration `json:"-"` // Time to wait for storage volume ready Timeout time.Duration `json:"-"` } // UpdateStorageVolume updates the specified storage volume, optionally modifying size, description and tags. func (c *StorageVolumeClient) UpdateStorageVolume(input *UpdateStorageVolumeInput) (*StorageVolumeInfo, error) { input.Name = c.getQualifiedName(input.Name) input.ImageList = c.getQualifiedName(input.ImageList) sizeInBytes, err := sizeInBytes(input.Size) if err != nil { return nil, err } input.Size = sizeInBytes path := c.getStorageVolumePath(input.Name) _, err = c.executeRequest("PUT", path, input) if err != nil { return nil, err } if input.PollInterval == 0 { input.PollInterval = waitForVolumeReadyPollInterval } if input.Timeout == 0 { input.Timeout = waitForVolumeReadyTimeout } volumeInfo, err := c.waitForStorageVolumeToBecomeAvailable(input.Name, input.PollInterval, input.Timeout) if err != nil { return nil, err } return volumeInfo, nil } // waitForStorageVolumeToBecomeAvailable waits until a new Storage Volume is available (i.e. has finished initialising or updating). func (c *StorageVolumeClient) waitForStorageVolumeToBecomeAvailable(name string, pollInterval, timeout time.Duration) (*StorageVolumeInfo, error) { var waitResult *StorageVolumeInfo err := c.client.WaitFor( fmt.Sprintf("storage volume %s to become available", c.getQualifiedName(name)), pollInterval, timeout, func() (bool, error) { getRequest := &GetStorageVolumeInput{ Name: name, } result, err := c.GetStorageVolume(getRequest) if err != nil { return false, err } if result != nil { waitResult = result if strings.ToLower(waitResult.Status) == "online" { return true, nil } if strings.ToLower(waitResult.Status) == "error" { return false, fmt.Errorf("Error Creating Storage Volume: %s", waitResult.StatusDetail) } } return false, nil }) return waitResult, err } // waitForStorageVolumeToBeDeleted waits until the specified storage volume has been deleted. func (c *StorageVolumeClient) waitForStorageVolumeToBeDeleted(name string, pollInterval, timeout time.Duration) error { return c.client.WaitFor( fmt.Sprintf("storage volume %s to be deleted", c.getQualifiedName(name)), pollInterval, timeout, func() (bool, error) { getRequest := &GetStorageVolumeInput{ Name: name, } result, err := c.GetStorageVolume(getRequest) if result == nil { return true, nil } if err != nil { return false, err } return result == nil, nil }) } func sizeInGigaBytes(input string) (string, error) { sizeInBytes, err := strconv.Atoi(input) if err != nil { return "", err } sizeInKB := sizeInBytes / 1024 sizeInMB := sizeInKB / 1024 sizeInGb := sizeInMB / 1024 return strconv.Itoa(sizeInGb), nil } func sizeInBytes(input string) (string, error) { sizeInGB, err := strconv.Atoi(input) if err != nil { return "", err } sizeInMB := sizeInGB * 1024 sizeInKB := sizeInMB * 1024 sizeInBytes := sizeInKB * 1024 return strconv.Itoa(sizeInBytes), nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/test_utils.go��������������0000664�0000000�0000000�00000005414�13771713062�0031054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "bytes" "encoding/json" "log" "net/http" "net/http/httptest" "net/url" "os" "testing" "time" "github.com/hashicorp/go-oracle-terraform/opc" ) const ( _ClientTestUser = "test-user" _ClientTestDomain = "test-domain" ) func newAuthenticatingServer(handler func(w http.ResponseWriter, r *http.Request)) *httptest.Server { return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if os.Getenv("ORACLE_LOG") != "" { log.Printf("[DEBUG] Received request: %s, %s\n", r.Method, r.URL) } if r.URL.Path == "/authenticate/" { http.SetCookie(w, &http.Cookie{Name: "testAuthCookie", Value: "cookie value"}) // w.WriteHeader(200) } else { handler(w, r) } })) } func getTestClient(c *opc.Config) (*Client, error) { // Build up config with default values if omitted if c.APIEndpoint == nil { if os.Getenv("OPC_ENDPOINT") == "" { panic("OPC_ENDPOINT not set in environment") } endpoint, err := url.Parse(os.Getenv("OPC_ENDPOINT")) if err != nil { return nil, err } c.APIEndpoint = endpoint } if c.IdentityDomain == nil { domain := os.Getenv("OPC_IDENTITY_DOMAIN") c.IdentityDomain = &domain } if c.Username == nil { username := os.Getenv("OPC_USERNAME") c.Username = &username } if c.Password == nil { password := os.Getenv("OPC_PASSWORD") c.Password = &password } if c.HTTPClient == nil { c.HTTPClient = &http.Client{ Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, TLSHandshakeTimeout: 120 * time.Second}, } } return NewComputeClient(c) } // nolint: deadcode func getBlankTestClient() (*Client, *httptest.Server, error) { server := newAuthenticatingServer(func(w http.ResponseWriter, r *http.Request) { }) endpoint, err := url.Parse(server.URL) if err != nil { server.Close() return nil, nil, err } client, err := getTestClient(&opc.Config{ IdentityDomain: opc.String(_ClientTestDomain), Username: opc.String(_ClientTestUser), APIEndpoint: endpoint, }) if err != nil { server.Close() return nil, nil, err } return client, server, nil } // Returns a stub client with default values, and a custom API Endpoint // nolint: deadcode func getStubClient(endpoint *url.URL) (*Client, error) { testAttr := "test" config := &opc.Config{ IdentityDomain: &testAttr, Username: &testAttr, Password: &testAttr, APIEndpoint: endpoint, } return getTestClient(config) } // nolint: deadcode func unmarshalRequestBody(t *testing.T, r *http.Request, target interface{}) { buf := new(bytes.Buffer) _, err := buf.ReadFrom(r.Body) if err != nil { t.Fatalf("Error reading buffer: %s", err) } err = json.Unmarshal(buf.Bytes(), target) if err != nil { t.Fatalf("Error marshalling request: %s", err) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/virtual_nic.go�������������0000664�0000000�0000000�00000003255�13771713062�0031175�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // VirtNICsClient defines a vritual nics client type VirtNICsClient struct { ResourceClient } // VirtNICs returns a virtual nics client func (c *Client) VirtNICs() *VirtNICsClient { return &VirtNICsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "Virtual NIC", ContainerPath: "/network/v1/vnic/", ResourceRootPath: "/network/v1/vnic", }, } } // VirtualNIC defines the attributes in a virtual nic type VirtualNIC struct { // Description of the object. Description string `json:"description"` // Fully Qualified Domain Name FQDN string `json:"name"` // MAC address of this VNIC. MACAddress string `json:"macAddress"` // The three-part name (/Compute-identity_domain/user/object) of the Virtual NIC. Name string // Tags associated with the object. Tags []string `json:"tags"` // True if the VNIC is of type "transit". TransitFlag bool `json:"transitFlag"` // Uniform Resource Identifier URI string `json:"uri"` } // GetVirtualNICInput Can only GET a virtual NIC, not update, create, or delete type GetVirtualNICInput struct { // The three-part name (/Compute-identity_domain/user/object) of the Virtual NIC. // Required Name string `json:"name"` } // GetVirtualNIC returns the specified virtual nic func (c *VirtNICsClient) GetVirtualNIC(input *GetVirtualNICInput) (*VirtualNIC, error) { var virtNIC VirtualNIC input.Name = c.getQualifiedName(input.Name) if err := c.getResource(input.Name, &virtNIC); err != nil { return nil, err } return c.success(&virtNIC) } func (c *VirtNICsClient) success(info *VirtualNIC) (*VirtualNIC, error) { info.Name = c.getUnqualifiedName(info.FQDN) return info, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/virtual_nic_sets.go��������0000664�0000000�0000000�00000012523�13771713062�0032231�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute // VirtNICSetsClient defines a virtual set nic client type VirtNICSetsClient struct { ResourceClient } // VirtNICSets returns a virtual nic sets client func (c *Client) VirtNICSets() *VirtNICSetsClient { return &VirtNICSetsClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: "Virtual NIC Set", ContainerPath: "/network/v1/vnicset/", ResourceRootPath: "/network/v1/vnicset", }, } } // VirtualNICSet describes an existing virtual nic set type VirtualNICSet struct { // List of ACLs applied to the VNICs in the set. AppliedACLs []string `json:"appliedAcls"` // Description of the VNIC Set. Description string `json:"description"` // Fully Qualified Domain Name FQDN string `json:"name"` // Name of the VNIC set. Name string // The three-part name (/Compute-identity_domain/user/object) of the virtual NIC set. Tags []string `json:"tags"` // Uniform Resource Identifier URI string `json:"uri"` // List of VNICs associated with this VNIC set. VirtualNICs []string `json:"vnics"` } // CreateVirtualNICSetInput specifies the details of the virutal nic set to create type CreateVirtualNICSetInput struct { // List of ACLs applied to the VNICs in the set. // Optional AppliedACLs []string `json:"appliedAcls"` // Description of the object. // Optional Description string `json:"description"` // The three-part name (/Compute-identity_domain/user/object) of the virtual NIC set. // Object names can contain only alphanumeric, underscore (_), dash (-), and period (.) characters. Object names are case-sensitive. // Required Name string `json:"name"` // Tags associated with this VNIC set. // Optional Tags []string `json:"tags"` // List of VNICs associated with this VNIC set. // Optional VirtualNICs []string `json:"vnics"` } // CreateVirtualNICSet creates a new virtual nic set func (c *VirtNICSetsClient) CreateVirtualNICSet(input *CreateVirtualNICSetInput) (*VirtualNICSet, error) { input.Name = c.getQualifiedName(input.Name) input.AppliedACLs = c.getQualifiedAcls(input.AppliedACLs) qualifiedNics := c.getQualifiedList(input.VirtualNICs) if len(qualifiedNics) != 0 { input.VirtualNICs = qualifiedNics } var virtNicSet VirtualNICSet if err := c.createResource(input, &virtNicSet); err != nil { return nil, err } return c.success(&virtNicSet) } // GetVirtualNICSetInput specifies which virutal nic to obtain type GetVirtualNICSetInput struct { // The three-part name (/Compute-identity_domain/user/object) of the virtual NIC set. // Required Name string `json:"name"` } // GetVirtualNICSet retrieves the specified virtual nic set func (c *VirtNICSetsClient) GetVirtualNICSet(input *GetVirtualNICSetInput) (*VirtualNICSet, error) { var virtNicSet VirtualNICSet // Qualify Name input.Name = c.getQualifiedName(input.Name) if err := c.getResource(input.Name, &virtNicSet); err != nil { return nil, err } return c.success(&virtNicSet) } // UpdateVirtualNICSetInput specifies the information that will be updated in the virtual nic set type UpdateVirtualNICSetInput struct { // List of ACLs applied to the VNICs in the set. // Optional AppliedACLs []string `json:"appliedAcls"` // Description of the object. // Optional Description string `json:"description"` // The three-part name (/Compute-identity_domain/user/object) of the virtual NIC set. // Object names can contain only alphanumeric, underscore (_), dash (-), and period (.) characters. Object names are case-sensitive. // Required Name string `json:"name"` // Tags associated with this VNIC set. // Optional Tags []string `json:"tags"` // List of VNICs associated with this VNIC set. // Optional VirtualNICs []string `json:"vnics"` } // UpdateVirtualNICSet updates the specified virtual nic set func (c *VirtNICSetsClient) UpdateVirtualNICSet(input *UpdateVirtualNICSetInput) (*VirtualNICSet, error) { input.Name = c.getQualifiedName(input.Name) input.AppliedACLs = c.getQualifiedAcls(input.AppliedACLs) // Qualify VirtualNICs qualifiedVNICs := c.getQualifiedList(input.VirtualNICs) if len(qualifiedVNICs) != 0 { input.VirtualNICs = qualifiedVNICs } var virtNICSet VirtualNICSet if err := c.updateResource(input.Name, input, &virtNICSet); err != nil { return nil, err } return c.success(&virtNICSet) } // DeleteVirtualNICSetInput specifies the virtual nic set to delete type DeleteVirtualNICSetInput struct { // The name of the virtual NIC set. // Required Name string `json:"name"` } // DeleteVirtualNICSet deletes the specified virtual nic set func (c *VirtNICSetsClient) DeleteVirtualNICSet(input *DeleteVirtualNICSetInput) error { input.Name = c.getQualifiedName(input.Name) return c.deleteResource(input.Name) } func (c *VirtNICSetsClient) getQualifiedAcls(acls []string) []string { qualifiedAcls := []string{} for _, acl := range acls { qualifiedAcls = append(qualifiedAcls, c.getQualifiedName(acl)) } return qualifiedAcls } func (c *VirtNICSetsClient) unqualifyAcls(acls []string) []string { unqualifiedAcls := []string{} for _, acl := range acls { unqualifiedAcls = append(unqualifiedAcls, c.getUnqualifiedName(acl)) } return unqualifiedAcls } func (c *VirtNICSetsClient) success(info *VirtualNICSet) (*VirtualNICSet, error) { info.Name = c.getUnqualifiedName(info.FQDN) info.AppliedACLs = c.unqualifyAcls(info.AppliedACLs) info.VirtualNICs = c.getUnqualifiedList(info.VirtualNICs) return info, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/compute/vpn_endpoint_v2.go���������0000664�0000000�0000000�00000047753�13771713062�0032003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compute import ( "fmt" "time" "github.com/hashicorp/go-oracle-terraform/client" ) const ( vpnEndpointV2Description = "vpn endpoint v2" vpnEndpointV2ContainerPath = "/vpnendpoint/v2/" vpnEndpointV2ResourcePath = "/vpnendpoint/v2" waitForVPNEndpointV2ActivePollInterval = 10 * time.Second waitForVPNEndpointV2ActiveTimeout = 3600 * time.Second waitForVPNEndpointV2DeletePollInterval = 10 * time.Second waitForVPNEndpointV2DeleteTimeout = 3600 * time.Second ) // VPNEndpointV2sClient returns a VPNEndpointV2 client type VPNEndpointV2sClient struct { ResourceClient } // VPNEndpointV2s returns an VPNEndpointV2sClient that can be used to access the // necessary CRUD functions for VPN Endpoint V2s. func (c *Client) VPNEndpointV2s() *VPNEndpointV2sClient { return &VPNEndpointV2sClient{ ResourceClient: ResourceClient{ Client: c, ResourceDescription: vpnEndpointV2Description, ContainerPath: vpnEndpointV2ContainerPath, ResourceRootPath: vpnEndpointV2ResourcePath, }, } } // VPNEndpointTunnelStatus defines the different statuses a VPN Endpoint tunnel can be in type VPNEndpointTunnelStatus string const ( // VPNEndpointTunnelStatusPending - the tunnel is in a pending state VPNEndpointTunnelStatusPending VPNEndpointTunnelStatus = "PENDING" // VPNEndpointTunnelStatusUp - the tunnel is in a up state VPNEndpointTunnelStatusUp VPNEndpointTunnelStatus = "UP" // VPNEndpointTunnelStatusDown - the tunnel is in a down state VPNEndpointTunnelStatusDown VPNEndpointTunnelStatus = "DOWN" // VPNEndpointTunnelStatusError - the tunnel is in a error state VPNEndpointTunnelStatusError VPNEndpointTunnelStatus = "ERROR" ) // VPNEndpointLifeCycleState defines the different lifecycle states a VPN Endpoint can be in type VPNEndpointLifeCycleState string const ( // VPNEndpointLifeCycleStateProvisioning - the endpoint is in a provisioning state VPNEndpointLifeCycleStateProvisioning VPNEndpointLifeCycleState = "provisioning" // VPNEndpointLifeCycleStateReady - the endpoint is in a ready state VPNEndpointLifeCycleStateReady VPNEndpointLifeCycleState = "ready" // VPNEndpointLifeCycleStateDeleting - the endpoint is in a ready state VPNEndpointLifeCycleStateDeleting VPNEndpointLifeCycleState = "deleting" // VPNEndpointLifeCycleStateError - the endpoint is in a error state VPNEndpointLifeCycleStateError VPNEndpointLifeCycleState = "error" // VPNEndpointLifeCycleStateUpdating - the endpoint is in a updating state VPNEndpointLifeCycleStateUpdating VPNEndpointLifeCycleState = "updating" ) // VPNEndpointV2Info contains the exported fields necessary to hold all the information about an // VPN Endpoint V2 type VPNEndpointV2Info struct { // IP address of the VPN gateway in your data center through which you want // to connect to the Oracle Cloud VPN gateway. CustomerVPNGateway string `json:"customer_vpn_gateway"` // Whether the tunnel is enabled or disabled // Optional Enabled bool `json:"enabled"` // The Internet Key Exchange (IKE) ID that you have specified. The default // value is the public IP address of the cloud gateway. IKEIdentifier string `json:"ikeIdentifier"` // The name of the IP network on which the cloud gateway is created by VPNaaS. IPNetwork string `json:"ipNetwork"` // The name of the VPN Endpoint V2 Name string `json:"name"` // The lifecycle state the VPNEndpointV2 is in LifeCycleState VPNEndpointLifeCycleState `json:"lifecycleState"` // Indicates whether Perfect Forward Secrecy (PFS) is required and your third-party device supports PFS. PFSFlag bool `json:"pfsFlag"` // Settings for Phase 1 of protocol (IKE). Phase1Settings Phase1Settings `json:"phase1Settings"` // Settings for Phase 2 of protocol (IPSEC). Phase2Settings Phase2Settings `json:"phase2Settings"` // The pre-shared VPN key. PSK string `json:"psk"` // List of routes (CIDR prefixes) that are reachable through this VPN tunnel. ReachableRoutes []string `json:"reachable_routes"` // Current status of the tunnel. The tunnel can be in one of the following states: // PENDING: indicates that your VPN connection is being set up. // UP: indicates that your VPN connection is established. // DOWN: indicates that your VPN connection is down. // ERROR: indicates that your VPN connection is in the error state. TunnelStatus VPNEndpointTunnelStatus `json:"tunnelStatus"` // Uniform Resource Identifier for the VPN Endpoint V2 URI string `json:"uri"` // Comma-separated list of vNIC sets. Traffic is allowed to and // from these vNIC sets to the cloud gateway's vNIC set. VNICSets []string `json:"vnicSets"` } // Phase1Settings define the attributes related to Phase 1 Protocol (IKE) type Phase1Settings struct { // Encryption options for IKE. Permissible values are aes128, aes192, aes256. Encryption string `json:"encryption"` // Authentication options for IKE. Permissible values are sha1, sha2_256, and md5. Hash string `json:"hash"` // Diffie-Hellman group for both IKE and ESP. It is applicable for ESP only if PFS is enabled. // Permissible values are group5, group14, group22, group23, and group24. DHGroup string `json:"dhGroup"` } // Phase2Settings define the attributes related to Phase 2 Protocol (IPSEC) type Phase2Settings struct { // Encryption options for IKE. Permissible values are aes128, aes192, aes256. Encryption string `json:"encryption"` // Authentication options for IKE. Permissible values are sha1, sha2_256, and md5. Hash string `json:"hash"` } // CreateVPNEndpointV2Input define the attributes related to creating a vpn endpoint v2 type CreateVPNEndpointV2Input struct { // Specify the IP address of the VPN gateway in your data center through which you want // to connect to the Oracle Cloud VPN gateway. Your gateway device must support route-based // VPN and IKE (Internet Key Exchange) configuration using pre-shared keys. // Required CustomerVPNGateway string `json:"customer_vpn_gateway"` // Description of the VPN Endpoint Description string `json:"description,omitempty"` // Enable/Disable the tunnel // Optional Enabled bool `json:"enabled,omitempty"` // The Internet Key Exchange (IKE) ID. If you don't specify a value, the default value is // the public IP address of the cloud gateway. You can specify either an alternative IP address, // or any text string that you want to use as the IKE ID. If you specify a text string, you must // prefix the string with @. For example, if you want to specify the text IKEID-for-VPN1, specify // @IKEID-for-VPN1 as the value in request body. If you specify an IP address, don't prefix it with @. // The IKE ID is case sensitive and can contain a maximum of 255 ASCII alphanumeric characters // including special characters, period (.), hyphen (-), and underscore (_). The IKE ID can't contain // embedded space characters. // Note: If you specify the IKE ID, ensure that you specify the Peer ID type as Domain Name on the // third-party device in your data center. Other Peer ID types, such as email address, firewall // identifier or key identifier, aren't supported. // Optional IKEIdentifier string `json:"ikeIdentifier,omitempty"` // Specify the name of the IP network // which you want to create the cloud gateway. When you send a request to create a VPN connection, // a cloud gateway is created and this is assigned an available IP address from the IP network that // you specify. So, the cloud gateway is directly connected to the IP network that you specify. // You can only specify a single IP network. All other IP networks with are connected to the // specified IP network through an IP network exchange are discovered and added automatically to // the VPN connection. // Required IPNetwork string `json:"ipNetwork"` // The name of the VPN Endpoint V2 to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // This is enabled (set to true) by default. If your third-party device supports Perfect Forward // Secrecy (PFS), set this parameter to true to require PFS. // Optional. Default true PFSFlag bool `json:"pfsFlag,omitmepty"` // Settings for Phase 1 of protocol (IKE). // Optional Phase1Settings *Phase1Settings `json:"phase1Settings,omitempty"` // Settings for Phase 2 of protocol (IPSEC). // Optional Phase2Settings *Phase2Settings `json:"phase2Settings,omitempty"` // Pre-shared VPN key. This secret key is shared between your network gateway and // the Oracle Cloud network for authentication. Specify the full path and name of // the text file that contains the pre-shared key. Ensure that the permission level // of the text file is set to 400. The pre-shared VPN key must not exceed 256 characters. // Required PSK string `json:"psk"` // Specify a list of routes (CIDR prefixes) that are reachable through this VPN tunnel. // You can specify a maximum of 20 IP subnet addresses. Specify IPv4 addresses in dot-decimal // notation with or without mask. // Required ReachableRoutes []string `json:"reachable_routes"` // An array of tags Tags []string `json:"tags"` // Comma-separated list of vNIC sets. Traffic is allowed to and from these vNIC sets to the // cloud gateway's vNIC set. // Required VNICSets []string `json:"vnicSets"` // Time to wait between polls to check status PollInterval time.Duration `json:"-"` // Time to wait for an vpn endoint v2 to be ready Timeout time.Duration `json:"-"` } // CreateVPNEndpointV2 creates a new VPN Endpoint V2 from an VPNEndpointV2sClient and an input struct. // Returns a populated Info struct for the VPN Endpoint V2, and any errors func (c *VPNEndpointV2sClient) CreateVPNEndpointV2(input *CreateVPNEndpointV2Input) (*VPNEndpointV2Info, error) { input.Name = c.getQualifiedName(input.Name) input.IPNetwork = c.getQualifiedName(input.IPNetwork) input.VNICSets = c.getQualifiedList(input.VNICSets) var createdVPNEndpointV2Info VPNEndpointV2Info if err := c.createResource(&input, &createdVPNEndpointV2Info); err != nil { return nil, err } // Call wait for vpn endpoint ready now, as creating the vpn endpoint v2 takes time getInput := &GetVPNEndpointV2Input{ Name: input.Name, } if input.PollInterval == 0 { input.PollInterval = waitForVPNEndpointV2ActivePollInterval } if input.Timeout == 0 { input.Timeout = waitForVPNEndpointV2ActiveTimeout } // Wait for vpn endpoint v2 to be ready and return the result vpnEndpointV2Info, vpnEndpointV2InfoError := c.WaitForVPNEndpointV2Ready(getInput, input.PollInterval, input.Timeout) if vpnEndpointV2InfoError != nil { return nil, fmt.Errorf("Error creating VPNEndpointV2 %q: %s", getInput.Name, vpnEndpointV2InfoError) } return vpnEndpointV2Info, nil } // GetVPNEndpointV2Input specifies the information needed to retrive a VPNEndpointV2 type GetVPNEndpointV2Input struct { // The name of the VPN Endpoint V2 to query for. Case-sensitive // Required Name string `json:"name"` } // GetVPNEndpointV2 returns a populated VPNEndpointV2Info struct from an input struct func (c *VPNEndpointV2sClient) GetVPNEndpointV2(input *GetVPNEndpointV2Input) (*VPNEndpointV2Info, error) { input.Name = c.getQualifiedName(input.Name) var ipInfo VPNEndpointV2Info if err := c.getResource(input.Name, &ipInfo); err != nil { return nil, err } return c.success(&ipInfo) } // UpdateVPNEndpointV2Input defines what to update in a VPN Endpoint V2 // Only PSK and ReachableRoutes are updatable type UpdateVPNEndpointV2Input struct { // Specify the IP address of the VPN gateway in your data center through which you want // to connect to the Oracle Cloud VPN gateway. Your gateway device must support route-based // VPN and IKE (Internet Key Exchange) configuration using pre-shared keys. // Required CustomerVPNGateway string `json:"customer_vpn_gateway"` // Description of the VPNGatewayV2 Description string `json:"description,omitempty"` // Enable/Disable the tunnel // Optional Enabled bool `json:"enabled,omitempty"` // The Internet Key Exchange (IKE) ID. If you don't specify a value, the default value is // the public IP address of the cloud gateway. You can specify either an alternative IP address, // or any text string that you want to use as the IKE ID. If you specify a text string, you must // prefix the string with @. For example, if you want to specify the text IKEID-for-VPN1, specify // @IKEID-for-VPN1 as the value in request body. If you specify an IP address, don't prefix it with @. // The IKE ID is case sensitive and can contain a maximum of 255 ASCII alphanumeric characters // including special characters, period (.), hyphen (-), and underscore (_). The IKE ID can't contain // embedded space characters. // Note: If you specify the IKE ID, ensure that you specify the Peer ID type as Domain Name on the // third-party device in your data center. Other Peer ID types, such as email address, firewall // identifier or key identifier, aren't supported. // Optional IKEIdentifier string `json:"ikeIdentifier,omitempty"` // Specify the name of the IP network // which you want to create the cloud gateway. When you send a request to create a VPN connection, // a cloud gateway is created and this is assigned an available IP address from the IP network that // you specify. So, the cloud gateway is directly connected to the IP network that you specify. // You can only specify a single IP network. All other IP networks with are connected to the // specified IP network through an IP network exchange are discovered and added automatically to // the VPN connection. // Required IPNetwork string `json:"ipNetwork"` // The name of the VPN Endpoint V2 to create. Object names can only contain alphanumeric, // underscore, dash, and period characters. Names are case-sensitive. // Required Name string `json:"name"` // This is enabled (set to true) by default. If your third-party device supports Perfect Forward // Secrecy (PFS), set this parameter to true to require PFS. // Optional. Default true PFSFlag bool `json:"pfsFlag,omitempty"` // Settings for Phase 1 of protocol (IKE). // Optional Phase1Settings *Phase1Settings `json:"phase1Settings,omitempty"` // Settings for Phase 2 of protocol (IPSEC). // Optional Phase2Settings *Phase2Settings `json:"phase2Settings,omitempty"` // Pre-shared VPN key. This secret key is shared between your network gateway and // the Oracle Cloud network for authentication. Specify the full path and name of // the text file that contains the pre-shared key. Ensure that the permission level // of the text file is set to 400. The pre-shared VPN key must not exceed 256 characters. // Required. PSK string `json:"psk"` // Specify a list of routes (CIDR prefixes) that are reachable through this VPN tunnel. // You can specify a maximum of 20 IP subnet addresses. Specify IPv4 addresses in dot-decimal // notation with or without mask. // Required ReachableRoutes []string `json:"reachable_routes"` // Array of tags Tags []string `json:"tags,omitempty"` // Comma-separated list of vNIC sets. Traffic is allowed to and from these vNIC sets to the // cloud gateway's vNIC set. // Required VNICSets []string `json:"vnicSets"` // Time to wait between polls to check status PollInterval time.Duration `json:"-"` // Time to wait for an vpn endoint v2 to be ready Timeout time.Duration `json:"-"` } // UpdateVPNEndpointV2 update the VPN Endpoint V2 func (c *VPNEndpointV2sClient) UpdateVPNEndpointV2(updateInput *UpdateVPNEndpointV2Input) (*VPNEndpointV2Info, error) { updateInput.Name = c.getQualifiedName(updateInput.Name) updateInput.IPNetwork = c.getQualifiedName(updateInput.IPNetwork) updateInput.VNICSets = c.getQualifiedList(updateInput.VNICSets) var ipInfo VPNEndpointV2Info if err := c.updateResource(updateInput.Name, updateInput, &ipInfo); err != nil { return nil, err } // Call wait for vpn endpoint ready now, as creating the vpn endpoint v2 takes time getInput := &GetVPNEndpointV2Input{ Name: updateInput.Name, } if updateInput.PollInterval == 0 { updateInput.PollInterval = waitForVPNEndpointV2ActivePollInterval } if updateInput.Timeout == 0 { updateInput.Timeout = waitForVPNEndpointV2ActiveTimeout } // Wait for vpn endpoint v2 to be ready and return the result vpnEndpointV2Info, vpnEndpointV2InfoError := c.WaitForVPNEndpointV2Ready(getInput, updateInput.PollInterval, updateInput.Timeout) if vpnEndpointV2InfoError != nil { return nil, fmt.Errorf("Error creating VPNEndpointV2 %q: %s", getInput.Name, vpnEndpointV2InfoError) } return vpnEndpointV2Info, nil } // DeleteVPNEndpointV2Input defines the attributes required for deleting a vpn endpoint v2 type DeleteVPNEndpointV2Input struct { // The name of the VPN Endpoint V2 to query for. Case-sensitive // Required Name string `json:"name"` // Poll Interval for delete request PollInterval time.Duration `json:"-"` // Timeout for delete request Timeout time.Duration `json:"-"` } // DeleteVPNEndpointV2 deletes the specified vpn endpoint v2 func (c *VPNEndpointV2sClient) DeleteVPNEndpointV2(input *DeleteVPNEndpointV2Input) error { if err := c.deleteResource(input.Name); err != nil { return err } if input.PollInterval == 0 { input.PollInterval = waitForVPNEndpointV2DeletePollInterval } if input.Timeout == 0 { input.Timeout = waitForVPNEndpointV2DeleteTimeout } return c.WaitForVPNEndpointV2Deleted(input, input.PollInterval, input.Timeout) } // Unqualifies any qualified fields in the VPNEndpointV2Info struct func (c *VPNEndpointV2sClient) success(info *VPNEndpointV2Info) (*VPNEndpointV2Info, error) { c.unqualify(&info.Name) c.unqualify(&info.IPNetwork) info.VNICSets = c.getUnqualifiedList(info.VNICSets) return info, nil } // WaitForVPNEndpointV2Ready waits for an vpn endpoint to be in an up or down state func (c *VPNEndpointV2sClient) WaitForVPNEndpointV2Ready(input *GetVPNEndpointV2Input, pollInterval, timeout time.Duration) (*VPNEndpointV2Info, error) { var info *VPNEndpointV2Info var getErr error err := c.client.WaitFor("vpn endpoint to be ready", pollInterval, timeout, func() (bool, error) { info, getErr = c.GetVPNEndpointV2(input) if getErr != nil { return false, getErr } c.client.DebugLogString(fmt.Sprintf("VPNEndpointV2 name is %q, VPNEndpointV2 info is %+v", info.Name, info)) switch s := info.LifeCycleState; s { case VPNEndpointLifeCycleStateProvisioning: return false, nil case VPNEndpointLifeCycleStateUpdating: return false, nil case VPNEndpointLifeCycleStateReady: c.client.DebugLogString(fmt.Sprintf("VPNEndpointV2 %s", info.LifeCycleState)) return true, nil case VPNEndpointLifeCycleStateError: return false, fmt.Errorf("Error waiting for VPNEndpointV2 %q to be ready", info.Name) case VPNEndpointLifeCycleStateDeleting: return false, fmt.Errorf("Error waiting for VPNEndpointV2 %q to be ready", info.Name) default: return false, fmt.Errorf("Unknown VPNEndpointV2 lifecycle state: %s, erroring", s) } }) return info, err } // WaitForVPNEndpointV2Deleted waits for an VPNEndpointV2to be fully deleted. func (c *VPNEndpointV2sClient) WaitForVPNEndpointV2Deleted(input *DeleteVPNEndpointV2Input, pollInterval, timeout time.Duration) error { return c.client.WaitFor("VPNEndpointV2 to be deleted", pollInterval, timeout, func() (bool, error) { var info VPNEndpointV2Info if err := c.getResource(input.Name, &info); err != nil { if client.WasNotFoundError(err) { // VPNEndpointV2 could not be found, thus deleted return true, nil } // Some other error occurred trying to get VPNEndpointV2, exit return false, err } switch s := info.LifeCycleState; s { case VPNEndpointLifeCycleStateProvisioning: return false, fmt.Errorf("Error deleting VPNEndpointV2: %+v", info) case VPNEndpointLifeCycleStateDeleting: c.client.DebugLogString("VPNEndpointV2 deleting") return false, nil case VPNEndpointLifeCycleStateReady: c.client.DebugLogString("VPNEndpointV2 deleting") return false, nil case VPNEndpointLifeCycleStateUpdating: c.client.DebugLogString("VPNEndpointV2 updating") return false, nil case VPNEndpointLifeCycleStateError: c.client.DebugLogString("VPNEndpointV2 deleting") return false, nil default: return false, fmt.Errorf("Unknown VPNEndpointV2 lifecycle state: %s, erroring", s) } }) } ���������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/opc/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025427�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/opc/config.go����������������������0000664�0000000�0000000�00000001022�13771713062�0027216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package opc import ( "net/http" "net/url" ) // Config details the parameters needed to authenticate with Oracle Clouds API type Config struct { Username *string Password *string IdentityDomain *string APIEndpoint *url.URL MaxRetries *int LogLevel LogLevelType Logger Logger HTTPClient *http.Client UserAgent *string } // NewConfig returns a blank config to populate with the neccessary fields to authenitcate with Oracle's API func NewConfig() *Config { return &Config{} } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/opc/convert.go���������������������0000664�0000000�0000000�00000000252�13771713062�0027435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package opc // String returns a pointer to a string func String(v string) *string { return &v } // Int returns a pointer to an int func Int(v int) *int { return &v } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/opc/errors.go����������������������0000664�0000000�0000000�00000000407�13771713062�0027273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package opc import "fmt" // OracleError details the parameters of an error returned from Oracle's API type OracleError struct { StatusCode int Message string } func (e OracleError) Error() string { return fmt.Sprintf("%d: %s", e.StatusCode, e.Message) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/go-oracle-terraform/opc/logger.go����������������������0000664�0000000�0000000�00000003013�13771713062�0027232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package opc import ( "io" "io/ioutil" "log" "os" ) const ( // LogOff turns logging off LogOff LogLevelType = 0 // LogDebug turns logging to debug LogDebug LogLevelType = 1 ) // LogLevelType details the constants that log level can be in type LogLevelType uint // Logger interface. Should be satisfied by Terraform's logger as well as the Default logger type Logger interface { Log(...interface{}) } // LoggerFunc details the logger functions type LoggerFunc func(...interface{}) // Log logs the specified messages func (f LoggerFunc) Log(args ...interface{}) { f(args...) } // NewDefaultLogger returns a default logger if one isn't specified during configuration func NewDefaultLogger() Logger { logWriter, err := LogOutput() if err != nil { log.Fatalf("Error setting up log writer: %s", err) } return &defaultLogger{ logger: log.New(logWriter, "", log.LstdFlags), } } // Default logger to satisfy the logger interface type defaultLogger struct { logger *log.Logger } func (l defaultLogger) Log(args ...interface{}) { l.logger.Println(args...) } // LogOutput outputs the requested messages func LogOutput() (logOutput io.Writer, err error) { // Default to nil logOutput = ioutil.Discard logLevel := LogLevel() if logLevel == LogOff { return } // Logging is on, set output to STDERR logOutput = os.Stderr return } // LogLevel gets current Log Level from the ORACLE_LOG env var func LogLevel() LogLevelType { envLevel := os.Getenv("ORACLE_LOG") if envLevel == "" { return LogOff } return LogDebug } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/���������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021545�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/.gitignore�����������������������������������������0000664�0000000�0000000�00000000102�13771713062�0023526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������y.output # ignore intellij files .idea *.iml *.ipr *.iws *.test ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/.travis.yml����������������������������������������0000664�0000000�0000000�00000000142�13771713062�0023653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������sudo: false language: go go: - 1.x - tip branches: only: - master script: make test ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/LICENSE��������������������������������������������0000664�0000000�0000000�00000037151�13771713062�0022561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/Makefile�������������������������������������������0000664�0000000�0000000�00000000366�13771713062�0023212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������TEST?=./... default: test fmt: generate go fmt ./... test: generate go get -t ./... go test $(TEST) $(TESTARGS) generate: go generate ./... updatedeps: go get -u golang.org/x/tools/cmd/stringer .PHONY: default generate test updatedeps ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/README.md������������������������������������������0000664�0000000�0000000�00000010266�13771713062�0023031�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL [![GoDoc](https://godoc.org/github.com/hashicorp/hcl?status.png)](https://godoc.org/github.com/hashicorp/hcl) [![Build Status](https://travis-ci.org/hashicorp/hcl.svg?branch=master)](https://travis-ci.org/hashicorp/hcl) HCL (HashiCorp Configuration Language) is a configuration language built by HashiCorp. The goal of HCL is to build a structured configuration language that is both human and machine friendly for use with command-line tools, but specifically targeted towards DevOps tools, servers, etc. HCL is also fully JSON compatible. That is, JSON can be used as completely valid input to a system expecting HCL. This helps makes systems interoperable with other systems. HCL is heavily inspired by [libucl](https://github.com/vstakhov/libucl), nginx configuration, and others similar. ## Why? A common question when viewing HCL is to ask the question: why not JSON, YAML, etc.? Prior to HCL, the tools we built at [HashiCorp](http://www.hashicorp.com) used a variety of configuration languages from full programming languages such as Ruby to complete data structure languages such as JSON. What we learned is that some people wanted human-friendly configuration languages and some people wanted machine-friendly languages. JSON fits a nice balance in this, but is fairly verbose and most importantly doesn't support comments. With YAML, we found that beginners had a really hard time determining what the actual structure was, and ended up guessing more often than not whether to use a hyphen, colon, etc. in order to represent some configuration key. Full programming languages such as Ruby enable complex behavior a configuration language shouldn't usually allow, and also forces people to learn some set of Ruby. Because of this, we decided to create our own configuration language that is JSON-compatible. Our configuration language (HCL) is designed to be written and modified by humans. The API for HCL allows JSON as an input so that it is also machine-friendly (machines can generate JSON instead of trying to generate HCL). Our goal with HCL is not to alienate other configuration languages. It is instead to provide HCL as a specialized language for our tools, and JSON as the interoperability layer. ## Syntax For a complete grammar, please see the parser itself. A high-level overview of the syntax and grammar is listed here. * Single line comments start with `#` or `//` * Multi-line comments are wrapped in `/*` and `*/`. Nested block comments are not allowed. A multi-line comment (also known as a block comment) terminates at the first `*/` found. * Values are assigned with the syntax `key = value` (whitespace doesn't matter). The value can be any primitive: a string, number, boolean, object, or list. * Strings are double-quoted and can contain any UTF-8 characters. Example: `"Hello, World"` * Multi-line strings start with `<<EOF` at the end of a line, and end with `EOF` on its own line ([here documents](https://en.wikipedia.org/wiki/Here_document)). Any text may be used in place of `EOF`. Example: ``` <<FOO hello world FOO ``` * Numbers are assumed to be base 10. If you prefix a number with 0x, it is treated as a hexadecimal. If it is prefixed with 0, it is treated as an octal. Numbers can be in scientific notation: "1e10". * Boolean values: `true`, `false` * Arrays can be made by wrapping it in `[]`. Example: `["foo", "bar", 42]`. Arrays can contain primitives, other arrays, and objects. As an alternative, lists of objects can be created with repeated blocks, using this structure: ```hcl service { key = "value" } service { key = "value" } ``` Objects and nested objects are created using the structure shown below: ``` variable "ami" { description = "the AMI to use" } ``` This would be equivalent to the following json: ``` json { "variable": { "ami": { "description": "the AMI to use" } } } ``` ## Thanks Thanks to: * [@vstakhov](https://github.com/vstakhov) - The original libucl parser and syntax that HCL was based off of. * [@fatih](https://github.com/fatih) - The rewritten HCL parser in pure Go (no goyacc) and support for a printer. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/appveyor.yml���������������������������������������0000664�0000000�0000000�00000000477�13771713062�0024145�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������version: "build-{branch}-{build}" image: Visual Studio 2015 clone_folder: c:\gopath\src\github.com\hashicorp\hcl environment: GOPATH: c:\gopath init: - git config --global core.autocrlf false install: - cmd: >- echo %Path% go version go env go get -t ./... build_script: - cmd: go test -v ./... �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/decoder.go�����������������������������������������0000664�0000000�0000000�00000043620�13771713062�0023506�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "errors" "fmt" "reflect" "sort" "strconv" "strings" "github.com/hashicorp/hcl/hcl/ast" "github.com/hashicorp/hcl/hcl/parser" "github.com/hashicorp/hcl/hcl/token" ) // This is the tag to use with structures to have settings for HCL const tagName = "hcl" var ( // nodeType holds a reference to the type of ast.Node nodeType reflect.Type = findNodeType() ) // Unmarshal accepts a byte slice as input and writes the // data to the value pointed to by v. func Unmarshal(bs []byte, v interface{}) error { root, err := parse(bs) if err != nil { return err } return DecodeObject(v, root) } // Decode reads the given input and decodes it into the structure // given by `out`. func Decode(out interface{}, in string) error { obj, err := Parse(in) if err != nil { return err } return DecodeObject(out, obj) } // DecodeObject is a lower-level version of Decode. It decodes a // raw Object into the given output. func DecodeObject(out interface{}, n ast.Node) error { val := reflect.ValueOf(out) if val.Kind() != reflect.Ptr { return errors.New("result must be a pointer") } // If we have the file, we really decode the root node if f, ok := n.(*ast.File); ok { n = f.Node } var d decoder return d.decode("root", n, val.Elem()) } type decoder struct { stack []reflect.Kind } func (d *decoder) decode(name string, node ast.Node, result reflect.Value) error { k := result // If we have an interface with a valid value, we use that // for the check. if result.Kind() == reflect.Interface { elem := result.Elem() if elem.IsValid() { k = elem } } // Push current onto stack unless it is an interface. if k.Kind() != reflect.Interface { d.stack = append(d.stack, k.Kind()) // Schedule a pop defer func() { d.stack = d.stack[:len(d.stack)-1] }() } switch k.Kind() { case reflect.Bool: return d.decodeBool(name, node, result) case reflect.Float32, reflect.Float64: return d.decodeFloat(name, node, result) case reflect.Int, reflect.Int32, reflect.Int64: return d.decodeInt(name, node, result) case reflect.Interface: // When we see an interface, we make our own thing return d.decodeInterface(name, node, result) case reflect.Map: return d.decodeMap(name, node, result) case reflect.Ptr: return d.decodePtr(name, node, result) case reflect.Slice: return d.decodeSlice(name, node, result) case reflect.String: return d.decodeString(name, node, result) case reflect.Struct: return d.decodeStruct(name, node, result) default: return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: unknown kind to decode into: %s", name, k.Kind()), } } } func (d *decoder) decodeBool(name string, node ast.Node, result reflect.Value) error { switch n := node.(type) { case *ast.LiteralType: if n.Token.Type == token.BOOL { v, err := strconv.ParseBool(n.Token.Text) if err != nil { return err } result.Set(reflect.ValueOf(v)) return nil } } return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: unknown type %T", name, node), } } func (d *decoder) decodeFloat(name string, node ast.Node, result reflect.Value) error { switch n := node.(type) { case *ast.LiteralType: if n.Token.Type == token.FLOAT || n.Token.Type == token.NUMBER { v, err := strconv.ParseFloat(n.Token.Text, 64) if err != nil { return err } result.Set(reflect.ValueOf(v).Convert(result.Type())) return nil } } return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: unknown type %T", name, node), } } func (d *decoder) decodeInt(name string, node ast.Node, result reflect.Value) error { switch n := node.(type) { case *ast.LiteralType: switch n.Token.Type { case token.NUMBER: v, err := strconv.ParseInt(n.Token.Text, 0, 0) if err != nil { return err } if result.Kind() == reflect.Interface { result.Set(reflect.ValueOf(int(v))) } else { result.SetInt(v) } return nil case token.STRING: v, err := strconv.ParseInt(n.Token.Value().(string), 0, 0) if err != nil { return err } if result.Kind() == reflect.Interface { result.Set(reflect.ValueOf(int(v))) } else { result.SetInt(v) } return nil } } return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: unknown type %T", name, node), } } func (d *decoder) decodeInterface(name string, node ast.Node, result reflect.Value) error { // When we see an ast.Node, we retain the value to enable deferred decoding. // Very useful in situations where we want to preserve ast.Node information // like Pos if result.Type() == nodeType && result.CanSet() { result.Set(reflect.ValueOf(node)) return nil } var set reflect.Value redecode := true // For testing types, ObjectType should just be treated as a list. We // set this to a temporary var because we want to pass in the real node. testNode := node if ot, ok := node.(*ast.ObjectType); ok { testNode = ot.List } switch n := testNode.(type) { case *ast.ObjectList: // If we're at the root or we're directly within a slice, then we // decode objects into map[string]interface{}, otherwise we decode // them into lists. if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { var temp map[string]interface{} tempVal := reflect.ValueOf(temp) result := reflect.MakeMap( reflect.MapOf( reflect.TypeOf(""), tempVal.Type().Elem())) set = result } else { var temp []map[string]interface{} tempVal := reflect.ValueOf(temp) result := reflect.MakeSlice( reflect.SliceOf(tempVal.Type().Elem()), 0, len(n.Items)) set = result } case *ast.ObjectType: // If we're at the root or we're directly within a slice, then we // decode objects into map[string]interface{}, otherwise we decode // them into lists. if len(d.stack) == 0 || d.stack[len(d.stack)-1] == reflect.Slice { var temp map[string]interface{} tempVal := reflect.ValueOf(temp) result := reflect.MakeMap( reflect.MapOf( reflect.TypeOf(""), tempVal.Type().Elem())) set = result } else { var temp []map[string]interface{} tempVal := reflect.ValueOf(temp) result := reflect.MakeSlice( reflect.SliceOf(tempVal.Type().Elem()), 0, 1) set = result } case *ast.ListType: var temp []interface{} tempVal := reflect.ValueOf(temp) result := reflect.MakeSlice( reflect.SliceOf(tempVal.Type().Elem()), 0, 0) set = result case *ast.LiteralType: switch n.Token.Type { case token.BOOL: var result bool set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) case token.FLOAT: var result float64 set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) case token.NUMBER: var result int set = reflect.Indirect(reflect.New(reflect.TypeOf(result))) case token.STRING, token.HEREDOC: set = reflect.Indirect(reflect.New(reflect.TypeOf(""))) default: return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: cannot decode into interface: %T", name, node), } } default: return fmt.Errorf( "%s: cannot decode into interface: %T", name, node) } // Set the result to what its supposed to be, then reset // result so we don't reflect into this method anymore. result.Set(set) if redecode { // Revisit the node so that we can use the newly instantiated // thing and populate it. if err := d.decode(name, node, result); err != nil { return err } } return nil } func (d *decoder) decodeMap(name string, node ast.Node, result reflect.Value) error { if item, ok := node.(*ast.ObjectItem); ok { node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} } if ot, ok := node.(*ast.ObjectType); ok { node = ot.List } n, ok := node.(*ast.ObjectList) if !ok { return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: not an object type for map (%T)", name, node), } } // If we have an interface, then we can address the interface, // but not the slice itself, so get the element but set the interface set := result if result.Kind() == reflect.Interface { result = result.Elem() } resultType := result.Type() resultElemType := resultType.Elem() resultKeyType := resultType.Key() if resultKeyType.Kind() != reflect.String { return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: map must have string keys", name), } } // Make a map if it is nil resultMap := result if result.IsNil() { resultMap = reflect.MakeMap( reflect.MapOf(resultKeyType, resultElemType)) } // Go through each element and decode it. done := make(map[string]struct{}) for _, item := range n.Items { if item.Val == nil { continue } // github.com/hashicorp/terraform/issue/5740 if len(item.Keys) == 0 { return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: map must have string keys", name), } } // Get the key we're dealing with, which is the first item keyStr := item.Keys[0].Token.Value().(string) // If we've already processed this key, then ignore it if _, ok := done[keyStr]; ok { continue } // Determine the value. If we have more than one key, then we // get the objectlist of only these keys. itemVal := item.Val if len(item.Keys) > 1 { itemVal = n.Filter(keyStr) done[keyStr] = struct{}{} } // Make the field name fieldName := fmt.Sprintf("%s.%s", name, keyStr) // Get the key/value as reflection values key := reflect.ValueOf(keyStr) val := reflect.Indirect(reflect.New(resultElemType)) // If we have a pre-existing value in the map, use that oldVal := resultMap.MapIndex(key) if oldVal.IsValid() { val.Set(oldVal) } // Decode! if err := d.decode(fieldName, itemVal, val); err != nil { return err } // Set the value on the map resultMap.SetMapIndex(key, val) } // Set the final map if we can set.Set(resultMap) return nil } func (d *decoder) decodePtr(name string, node ast.Node, result reflect.Value) error { // Create an element of the concrete (non pointer) type and decode // into that. Then set the value of the pointer to this type. resultType := result.Type() resultElemType := resultType.Elem() val := reflect.New(resultElemType) if err := d.decode(name, node, reflect.Indirect(val)); err != nil { return err } result.Set(val) return nil } func (d *decoder) decodeSlice(name string, node ast.Node, result reflect.Value) error { // If we have an interface, then we can address the interface, // but not the slice itself, so get the element but set the interface set := result if result.Kind() == reflect.Interface { result = result.Elem() } // Create the slice if it isn't nil resultType := result.Type() resultElemType := resultType.Elem() if result.IsNil() { resultSliceType := reflect.SliceOf(resultElemType) result = reflect.MakeSlice( resultSliceType, 0, 0) } // Figure out the items we'll be copying into the slice var items []ast.Node switch n := node.(type) { case *ast.ObjectList: items = make([]ast.Node, len(n.Items)) for i, item := range n.Items { items[i] = item } case *ast.ObjectType: items = []ast.Node{n} case *ast.ListType: items = n.List default: return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("unknown slice type: %T", node), } } for i, item := range items { fieldName := fmt.Sprintf("%s[%d]", name, i) // Decode val := reflect.Indirect(reflect.New(resultElemType)) // if item is an object that was decoded from ambiguous JSON and // flattened, make sure it's expanded if it needs to decode into a // defined structure. item := expandObject(item, val) if err := d.decode(fieldName, item, val); err != nil { return err } // Append it onto the slice result = reflect.Append(result, val) } set.Set(result) return nil } // expandObject detects if an ambiguous JSON object was flattened to a List which // should be decoded into a struct, and expands the ast to properly deocode. func expandObject(node ast.Node, result reflect.Value) ast.Node { item, ok := node.(*ast.ObjectItem) if !ok { return node } elemType := result.Type() // our target type must be a struct switch elemType.Kind() { case reflect.Ptr: switch elemType.Elem().Kind() { case reflect.Struct: //OK default: return node } case reflect.Struct: //OK default: return node } // A list value will have a key and field name. If it had more fields, // it wouldn't have been flattened. if len(item.Keys) != 2 { return node } keyToken := item.Keys[0].Token item.Keys = item.Keys[1:] // we need to un-flatten the ast enough to decode newNode := &ast.ObjectItem{ Keys: []*ast.ObjectKey{ &ast.ObjectKey{ Token: keyToken, }, }, Val: &ast.ObjectType{ List: &ast.ObjectList{ Items: []*ast.ObjectItem{item}, }, }, } return newNode } func (d *decoder) decodeString(name string, node ast.Node, result reflect.Value) error { switch n := node.(type) { case *ast.LiteralType: switch n.Token.Type { case token.NUMBER: result.Set(reflect.ValueOf(n.Token.Text).Convert(result.Type())) return nil case token.STRING, token.HEREDOC: result.Set(reflect.ValueOf(n.Token.Value()).Convert(result.Type())) return nil } } return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: unknown type for string %T", name, node), } } func (d *decoder) decodeStruct(name string, node ast.Node, result reflect.Value) error { var item *ast.ObjectItem if it, ok := node.(*ast.ObjectItem); ok { item = it node = it.Val } if ot, ok := node.(*ast.ObjectType); ok { node = ot.List } // Handle the special case where the object itself is a literal. Previously // the yacc parser would always ensure top-level elements were arrays. The new // parser does not make the same guarantees, thus we need to convert any // top-level literal elements into a list. if _, ok := node.(*ast.LiteralType); ok && item != nil { node = &ast.ObjectList{Items: []*ast.ObjectItem{item}} } list, ok := node.(*ast.ObjectList) if !ok { return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: not an object type for struct (%T)", name, node), } } // This slice will keep track of all the structs we'll be decoding. // There can be more than one struct if there are embedded structs // that are squashed. structs := make([]reflect.Value, 1, 5) structs[0] = result // Compile the list of all the fields that we're going to be decoding // from all the structs. type field struct { field reflect.StructField val reflect.Value } fields := []field{} for len(structs) > 0 { structVal := structs[0] structs = structs[1:] structType := structVal.Type() for i := 0; i < structType.NumField(); i++ { fieldType := structType.Field(i) tagParts := strings.Split(fieldType.Tag.Get(tagName), ",") // Ignore fields with tag name "-" if tagParts[0] == "-" { continue } if fieldType.Anonymous { fieldKind := fieldType.Type.Kind() if fieldKind != reflect.Struct { return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: unsupported type to struct: %s", fieldType.Name, fieldKind), } } // We have an embedded field. We "squash" the fields down // if specified in the tag. squash := false for _, tag := range tagParts[1:] { if tag == "squash" { squash = true break } } if squash { structs = append( structs, result.FieldByName(fieldType.Name)) continue } } // Normal struct field, store it away fields = append(fields, field{fieldType, structVal.Field(i)}) } } usedKeys := make(map[string]struct{}) decodedFields := make([]string, 0, len(fields)) decodedFieldsVal := make([]reflect.Value, 0) unusedKeysVal := make([]reflect.Value, 0) for _, f := range fields { field, fieldValue := f.field, f.val if !fieldValue.IsValid() { // This should never happen panic("field is not valid") } // If we can't set the field, then it is unexported or something, // and we just continue onwards. if !fieldValue.CanSet() { continue } fieldName := field.Name tagValue := field.Tag.Get(tagName) tagParts := strings.SplitN(tagValue, ",", 2) if len(tagParts) >= 2 { switch tagParts[1] { case "decodedFields": decodedFieldsVal = append(decodedFieldsVal, fieldValue) continue case "key": if item == nil { return &parser.PosError{ Pos: node.Pos(), Err: fmt.Errorf("%s: %s asked for 'key', impossible", name, fieldName), } } fieldValue.SetString(item.Keys[0].Token.Value().(string)) continue case "unusedKeys": unusedKeysVal = append(unusedKeysVal, fieldValue) continue } } if tagParts[0] != "" { fieldName = tagParts[0] } // Determine the element we'll use to decode. If it is a single // match (only object with the field), then we decode it exactly. // If it is a prefix match, then we decode the matches. filter := list.Filter(fieldName) prefixMatches := filter.Children() matches := filter.Elem() if len(matches.Items) == 0 && len(prefixMatches.Items) == 0 { continue } // Track the used key usedKeys[fieldName] = struct{}{} // Create the field name and decode. We range over the elements // because we actually want the value. fieldName = fmt.Sprintf("%s.%s", name, fieldName) if len(prefixMatches.Items) > 0 { if err := d.decode(fieldName, prefixMatches, fieldValue); err != nil { return err } } for _, match := range matches.Items { var decodeNode ast.Node = match.Val if ot, ok := decodeNode.(*ast.ObjectType); ok { decodeNode = &ast.ObjectList{Items: ot.List.Items} } if err := d.decode(fieldName, decodeNode, fieldValue); err != nil { return err } } decodedFields = append(decodedFields, field.Name) } if len(decodedFieldsVal) > 0 { // Sort it so that it is deterministic sort.Strings(decodedFields) for _, v := range decodedFieldsVal { v.Set(reflect.ValueOf(decodedFields)) } } return nil } // findNodeType returns the type of ast.Node func findNodeType() reflect.Type { var nodeContainer struct { Node ast.Node } value := reflect.ValueOf(nodeContainer).FieldByName("Node") return value.Type() } ����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/go.mod���������������������������������������������0000664�0000000�0000000�00000000113�13771713062�0022646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/hcl require github.com/davecgh/go-spew v1.1.1 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/go.sum���������������������������������������������0000664�0000000�0000000�00000000253�13771713062�0022700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl.go���������������������������������������������0000664�0000000�0000000�00000000740�13771713062�0022643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package hcl decodes HCL into usable Go structures. // // hcl input can come in either pure HCL format or JSON format. // It can be parsed into an AST, and then decoded into a structure, // or it can be decoded directly from a string into a structure. // // If you choose to parse HCL into a raw AST, the benefit is that you // can write custom visitor implementations to implement custom // semantic checks. By default, HCL does not perform any semantic // checks. package hcl ��������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022313�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/ast/�������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023102�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/ast/ast.go�������������������������������������0000664�0000000�0000000�00000012575�13771713062�0024232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package ast declares the types used to represent syntax trees for HCL // (HashiCorp Configuration Language) package ast import ( "fmt" "strings" "github.com/hashicorp/hcl/hcl/token" ) // Node is an element in the abstract syntax tree. type Node interface { node() Pos() token.Pos } func (File) node() {} func (ObjectList) node() {} func (ObjectKey) node() {} func (ObjectItem) node() {} func (Comment) node() {} func (CommentGroup) node() {} func (ObjectType) node() {} func (LiteralType) node() {} func (ListType) node() {} // File represents a single HCL file type File struct { Node Node // usually a *ObjectList Comments []*CommentGroup // list of all comments in the source } func (f *File) Pos() token.Pos { return f.Node.Pos() } // ObjectList represents a list of ObjectItems. An HCL file itself is an // ObjectList. type ObjectList struct { Items []*ObjectItem } func (o *ObjectList) Add(item *ObjectItem) { o.Items = append(o.Items, item) } // Filter filters out the objects with the given key list as a prefix. // // The returned list of objects contain ObjectItems where the keys have // this prefix already stripped off. This might result in objects with // zero-length key lists if they have no children. // // If no matches are found, an empty ObjectList (non-nil) is returned. func (o *ObjectList) Filter(keys ...string) *ObjectList { var result ObjectList for _, item := range o.Items { // If there aren't enough keys, then ignore this if len(item.Keys) < len(keys) { continue } match := true for i, key := range item.Keys[:len(keys)] { key := key.Token.Value().(string) if key != keys[i] && !strings.EqualFold(key, keys[i]) { match = false break } } if !match { continue } // Strip off the prefix from the children newItem := *item newItem.Keys = newItem.Keys[len(keys):] result.Add(&newItem) } return &result } // Children returns further nested objects (key length > 0) within this // ObjectList. This should be used with Filter to get at child items. func (o *ObjectList) Children() *ObjectList { var result ObjectList for _, item := range o.Items { if len(item.Keys) > 0 { result.Add(item) } } return &result } // Elem returns items in the list that are direct element assignments // (key length == 0). This should be used with Filter to get at elements. func (o *ObjectList) Elem() *ObjectList { var result ObjectList for _, item := range o.Items { if len(item.Keys) == 0 { result.Add(item) } } return &result } func (o *ObjectList) Pos() token.Pos { // always returns the uninitiliazed position return o.Items[0].Pos() } // ObjectItem represents a HCL Object Item. An item is represented with a key // (or keys). It can be an assignment or an object (both normal and nested) type ObjectItem struct { // keys is only one length long if it's of type assignment. If it's a // nested object it can be larger than one. In that case "assign" is // invalid as there is no assignments for a nested object. Keys []*ObjectKey // assign contains the position of "=", if any Assign token.Pos // val is the item itself. It can be an object,list, number, bool or a // string. If key length is larger than one, val can be only of type // Object. Val Node LeadComment *CommentGroup // associated lead comment LineComment *CommentGroup // associated line comment } func (o *ObjectItem) Pos() token.Pos { // I'm not entirely sure what causes this, but removing this causes // a test failure. We should investigate at some point. if len(o.Keys) == 0 { return token.Pos{} } return o.Keys[0].Pos() } // ObjectKeys are either an identifier or of type string. type ObjectKey struct { Token token.Token } func (o *ObjectKey) Pos() token.Pos { return o.Token.Pos } // LiteralType represents a literal of basic type. Valid types are: // token.NUMBER, token.FLOAT, token.BOOL and token.STRING type LiteralType struct { Token token.Token // comment types, only used when in a list LeadComment *CommentGroup LineComment *CommentGroup } func (l *LiteralType) Pos() token.Pos { return l.Token.Pos } // ListStatement represents a HCL List type type ListType struct { Lbrack token.Pos // position of "[" Rbrack token.Pos // position of "]" List []Node // the elements in lexical order } func (l *ListType) Pos() token.Pos { return l.Lbrack } func (l *ListType) Add(node Node) { l.List = append(l.List, node) } // ObjectType represents a HCL Object Type type ObjectType struct { Lbrace token.Pos // position of "{" Rbrace token.Pos // position of "}" List *ObjectList // the nodes in lexical order } func (o *ObjectType) Pos() token.Pos { return o.Lbrace } // Comment node represents a single //, # style or /*- style commment type Comment struct { Start token.Pos // position of / or # Text string } func (c *Comment) Pos() token.Pos { return c.Start } // CommentGroup node represents a sequence of comments with no other tokens and // no empty lines between. type CommentGroup struct { List []*Comment // len(List) > 0 } func (c *CommentGroup) Pos() token.Pos { return c.List[0].Pos() } //------------------------------------------------------------------- // GoStringer //------------------------------------------------------------------- func (o *ObjectKey) GoString() string { return fmt.Sprintf("*%#v", *o) } func (o *ObjectList) GoString() string { return fmt.Sprintf("*%#v", *o) } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/ast/walk.go������������������������������������0000664�0000000�0000000�00000002373�13771713062�0024374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package ast import "fmt" // WalkFunc describes a function to be called for each node during a Walk. The // returned node can be used to rewrite the AST. Walking stops the returned // bool is false. type WalkFunc func(Node) (Node, bool) // Walk traverses an AST in depth-first order: It starts by calling fn(node); // node must not be nil. If fn returns true, Walk invokes fn recursively for // each of the non-nil children of node, followed by a call of fn(nil). The // returned node of fn can be used to rewrite the passed node to fn. func Walk(node Node, fn WalkFunc) Node { rewritten, ok := fn(node) if !ok { return rewritten } switch n := node.(type) { case *File: n.Node = Walk(n.Node, fn) case *ObjectList: for i, item := range n.Items { n.Items[i] = Walk(item, fn).(*ObjectItem) } case *ObjectKey: // nothing to do case *ObjectItem: for i, k := range n.Keys { n.Keys[i] = Walk(k, fn).(*ObjectKey) } if n.Val != nil { n.Val = Walk(n.Val, fn) } case *LiteralType: // nothing to do case *ListType: for i, l := range n.List { n.List[i] = Walk(l, fn) } case *ObjectType: n.List = Walk(n.List, fn).(*ObjectList) default: // should we panic here? fmt.Printf("unknown type: %T\n", n) } fn(nil) return rewritten } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/parser/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023607�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/parser/error.go��������������������������������0000664�0000000�0000000�00000000412�13771713062�0025264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package parser import ( "fmt" "github.com/hashicorp/hcl/hcl/token" ) // PosError is a parse error that contains a position. type PosError struct { Pos token.Pos Err error } func (e *PosError) Error() string { return fmt.Sprintf("At %s: %s", e.Pos, e.Err) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/parser/parser.go�������������������������������0000664�0000000�0000000�00000031113�13771713062�0025431�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package parser implements a parser for HCL (HashiCorp Configuration // Language) package parser import ( "bytes" "errors" "fmt" "strings" "github.com/hashicorp/hcl/hcl/ast" "github.com/hashicorp/hcl/hcl/scanner" "github.com/hashicorp/hcl/hcl/token" ) type Parser struct { sc *scanner.Scanner // Last read token tok token.Token commaPrev token.Token comments []*ast.CommentGroup leadComment *ast.CommentGroup // last lead comment lineComment *ast.CommentGroup // last line comment enableTrace bool indent int n int // buffer size (max = 1) } func newParser(src []byte) *Parser { return &Parser{ sc: scanner.New(src), } } // Parse returns the fully parsed source and returns the abstract syntax tree. func Parse(src []byte) (*ast.File, error) { // normalize all line endings // since the scanner and output only work with "\n" line endings, we may // end up with dangling "\r" characters in the parsed data. src = bytes.Replace(src, []byte("\r\n"), []byte("\n"), -1) p := newParser(src) return p.Parse() } var errEofToken = errors.New("EOF token found") // Parse returns the fully parsed source and returns the abstract syntax tree. func (p *Parser) Parse() (*ast.File, error) { f := &ast.File{} var err, scerr error p.sc.Error = func(pos token.Pos, msg string) { scerr = &PosError{Pos: pos, Err: errors.New(msg)} } f.Node, err = p.objectList(false) if scerr != nil { return nil, scerr } if err != nil { return nil, err } f.Comments = p.comments return f, nil } // objectList parses a list of items within an object (generally k/v pairs). // The parameter" obj" tells this whether to we are within an object (braces: // '{', '}') or just at the top level. If we're within an object, we end // at an RBRACE. func (p *Parser) objectList(obj bool) (*ast.ObjectList, error) { defer un(trace(p, "ParseObjectList")) node := &ast.ObjectList{} for { if obj { tok := p.scan() p.unscan() if tok.Type == token.RBRACE { break } } n, err := p.objectItem() if err == errEofToken { break // we are finished } // we don't return a nil node, because might want to use already // collected items. if err != nil { return node, err } node.Add(n) // object lists can be optionally comma-delimited e.g. when a list of maps // is being expressed, so a comma is allowed here - it's simply consumed tok := p.scan() if tok.Type != token.COMMA { p.unscan() } } return node, nil } func (p *Parser) consumeComment() (comment *ast.Comment, endline int) { endline = p.tok.Pos.Line // count the endline if it's multiline comment, ie starting with /* if len(p.tok.Text) > 1 && p.tok.Text[1] == '*' { // don't use range here - no need to decode Unicode code points for i := 0; i < len(p.tok.Text); i++ { if p.tok.Text[i] == '\n' { endline++ } } } comment = &ast.Comment{Start: p.tok.Pos, Text: p.tok.Text} p.tok = p.sc.Scan() return } func (p *Parser) consumeCommentGroup(n int) (comments *ast.CommentGroup, endline int) { var list []*ast.Comment endline = p.tok.Pos.Line for p.tok.Type == token.COMMENT && p.tok.Pos.Line <= endline+n { var comment *ast.Comment comment, endline = p.consumeComment() list = append(list, comment) } // add comment group to the comments list comments = &ast.CommentGroup{List: list} p.comments = append(p.comments, comments) return } // objectItem parses a single object item func (p *Parser) objectItem() (*ast.ObjectItem, error) { defer un(trace(p, "ParseObjectItem")) keys, err := p.objectKey() if len(keys) > 0 && err == errEofToken { // We ignore eof token here since it is an error if we didn't // receive a value (but we did receive a key) for the item. err = nil } if len(keys) > 0 && err != nil && p.tok.Type == token.RBRACE { // This is a strange boolean statement, but what it means is: // We have keys with no value, and we're likely in an object // (since RBrace ends an object). For this, we set err to nil so // we continue and get the error below of having the wrong value // type. err = nil // Reset the token type so we don't think it completed fine. See // objectType which uses p.tok.Type to check if we're done with // the object. p.tok.Type = token.EOF } if err != nil { return nil, err } o := &ast.ObjectItem{ Keys: keys, } if p.leadComment != nil { o.LeadComment = p.leadComment p.leadComment = nil } switch p.tok.Type { case token.ASSIGN: o.Assign = p.tok.Pos o.Val, err = p.object() if err != nil { return nil, err } case token.LBRACE: o.Val, err = p.objectType() if err != nil { return nil, err } default: keyStr := make([]string, 0, len(keys)) for _, k := range keys { keyStr = append(keyStr, k.Token.Text) } return nil, &PosError{ Pos: p.tok.Pos, Err: fmt.Errorf( "key '%s' expected start of object ('{') or assignment ('=')", strings.Join(keyStr, " ")), } } // key=#comment // val if p.lineComment != nil { o.LineComment, p.lineComment = p.lineComment, nil } // do a look-ahead for line comment p.scan() if len(keys) > 0 && o.Val.Pos().Line == keys[0].Pos().Line && p.lineComment != nil { o.LineComment = p.lineComment p.lineComment = nil } p.unscan() return o, nil } // objectKey parses an object key and returns a ObjectKey AST func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { keyCount := 0 keys := make([]*ast.ObjectKey, 0) for { tok := p.scan() switch tok.Type { case token.EOF: // It is very important to also return the keys here as well as // the error. This is because we need to be able to tell if we // did parse keys prior to finding the EOF, or if we just found // a bare EOF. return keys, errEofToken case token.ASSIGN: // assignment or object only, but not nested objects. this is not // allowed: `foo bar = {}` if keyCount > 1 { return nil, &PosError{ Pos: p.tok.Pos, Err: fmt.Errorf("nested object expected: LBRACE got: %s", p.tok.Type), } } if keyCount == 0 { return nil, &PosError{ Pos: p.tok.Pos, Err: errors.New("no object keys found!"), } } return keys, nil case token.LBRACE: var err error // If we have no keys, then it is a syntax error. i.e. {{}} is not // allowed. if len(keys) == 0 { err = &PosError{ Pos: p.tok.Pos, Err: fmt.Errorf("expected: IDENT | STRING got: %s", p.tok.Type), } } // object return keys, err case token.IDENT, token.STRING: keyCount++ keys = append(keys, &ast.ObjectKey{Token: p.tok}) case token.ILLEGAL: return keys, &PosError{ Pos: p.tok.Pos, Err: fmt.Errorf("illegal character"), } default: return keys, &PosError{ Pos: p.tok.Pos, Err: fmt.Errorf("expected: IDENT | STRING | ASSIGN | LBRACE got: %s", p.tok.Type), } } } } // object parses any type of object, such as number, bool, string, object or // list. func (p *Parser) object() (ast.Node, error) { defer un(trace(p, "ParseType")) tok := p.scan() switch tok.Type { case token.NUMBER, token.FLOAT, token.BOOL, token.STRING, token.HEREDOC: return p.literalType() case token.LBRACE: return p.objectType() case token.LBRACK: return p.listType() case token.COMMENT: // implement comment case token.EOF: return nil, errEofToken } return nil, &PosError{ Pos: tok.Pos, Err: fmt.Errorf("Unknown token: %+v", tok), } } // objectType parses an object type and returns a ObjectType AST func (p *Parser) objectType() (*ast.ObjectType, error) { defer un(trace(p, "ParseObjectType")) // we assume that the currently scanned token is a LBRACE o := &ast.ObjectType{ Lbrace: p.tok.Pos, } l, err := p.objectList(true) // if we hit RBRACE, we are good to go (means we parsed all Items), if it's // not a RBRACE, it's an syntax error and we just return it. if err != nil && p.tok.Type != token.RBRACE { return nil, err } // No error, scan and expect the ending to be a brace if tok := p.scan(); tok.Type != token.RBRACE { return nil, &PosError{ Pos: tok.Pos, Err: fmt.Errorf("object expected closing RBRACE got: %s", tok.Type), } } o.List = l o.Rbrace = p.tok.Pos // advanced via parseObjectList return o, nil } // listType parses a list type and returns a ListType AST func (p *Parser) listType() (*ast.ListType, error) { defer un(trace(p, "ParseListType")) // we assume that the currently scanned token is a LBRACK l := &ast.ListType{ Lbrack: p.tok.Pos, } needComma := false for { tok := p.scan() if needComma { switch tok.Type { case token.COMMA, token.RBRACK: default: return nil, &PosError{ Pos: tok.Pos, Err: fmt.Errorf( "error parsing list, expected comma or list end, got: %s", tok.Type), } } } switch tok.Type { case token.BOOL, token.NUMBER, token.FLOAT, token.STRING, token.HEREDOC: node, err := p.literalType() if err != nil { return nil, err } // If there is a lead comment, apply it if p.leadComment != nil { node.LeadComment = p.leadComment p.leadComment = nil } l.Add(node) needComma = true case token.COMMA: // get next list item or we are at the end // do a look-ahead for line comment p.scan() if p.lineComment != nil && len(l.List) > 0 { lit, ok := l.List[len(l.List)-1].(*ast.LiteralType) if ok { lit.LineComment = p.lineComment l.List[len(l.List)-1] = lit p.lineComment = nil } } p.unscan() needComma = false continue case token.LBRACE: // Looks like a nested object, so parse it out node, err := p.objectType() if err != nil { return nil, &PosError{ Pos: tok.Pos, Err: fmt.Errorf( "error while trying to parse object within list: %s", err), } } l.Add(node) needComma = true case token.LBRACK: node, err := p.listType() if err != nil { return nil, &PosError{ Pos: tok.Pos, Err: fmt.Errorf( "error while trying to parse list within list: %s", err), } } l.Add(node) case token.RBRACK: // finished l.Rbrack = p.tok.Pos return l, nil default: return nil, &PosError{ Pos: tok.Pos, Err: fmt.Errorf("unexpected token while parsing list: %s", tok.Type), } } } } // literalType parses a literal type and returns a LiteralType AST func (p *Parser) literalType() (*ast.LiteralType, error) { defer un(trace(p, "ParseLiteral")) return &ast.LiteralType{ Token: p.tok, }, nil } // scan returns the next token from the underlying scanner. If a token has // been unscanned then read that instead. In the process, it collects any // comment groups encountered, and remembers the last lead and line comments. func (p *Parser) scan() token.Token { // If we have a token on the buffer, then return it. if p.n != 0 { p.n = 0 return p.tok } // Otherwise read the next token from the scanner and Save it to the buffer // in case we unscan later. prev := p.tok p.tok = p.sc.Scan() if p.tok.Type == token.COMMENT { var comment *ast.CommentGroup var endline int // fmt.Printf("p.tok.Pos.Line = %+v prev: %d endline %d \n", // p.tok.Pos.Line, prev.Pos.Line, endline) if p.tok.Pos.Line == prev.Pos.Line { // The comment is on same line as the previous token; it // cannot be a lead comment but may be a line comment. comment, endline = p.consumeCommentGroup(0) if p.tok.Pos.Line != endline { // The next token is on a different line, thus // the last comment group is a line comment. p.lineComment = comment } } // consume successor comments, if any endline = -1 for p.tok.Type == token.COMMENT { comment, endline = p.consumeCommentGroup(1) } if endline+1 == p.tok.Pos.Line && p.tok.Type != token.RBRACE { switch p.tok.Type { case token.RBRACE, token.RBRACK: // Do not count for these cases default: // The next token is following on the line immediately after the // comment group, thus the last comment group is a lead comment. p.leadComment = comment } } } return p.tok } // unscan pushes the previously read token back onto the buffer. func (p *Parser) unscan() { p.n = 1 } // ---------------------------------------------------------------------------- // Parsing support func (p *Parser) printTrace(a ...interface{}) { if !p.enableTrace { return } const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " const n = len(dots) fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) i := 2 * p.indent for i > n { fmt.Print(dots) i -= n } // i <= n fmt.Print(dots[0:i]) fmt.Println(a...) } func trace(p *Parser, msg string) *Parser { p.printTrace(msg, "(") p.indent++ return p } // Usage pattern: defer un(trace(p, "...")) func un(p *Parser) { p.indent-- p.printTrace(")") } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/scanner/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023744�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/scanner/scanner.go�����������������������������0000664�0000000�0000000�00000034702�13771713062�0025732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package scanner implements a scanner for HCL (HashiCorp Configuration // Language) source text. package scanner import ( "bytes" "fmt" "os" "regexp" "unicode" "unicode/utf8" "github.com/hashicorp/hcl/hcl/token" ) // eof represents a marker rune for the end of the reader. const eof = rune(0) // Scanner defines a lexical scanner type Scanner struct { buf *bytes.Buffer // Source buffer for advancing and scanning src []byte // Source buffer for immutable access // Source Position srcPos token.Pos // current position prevPos token.Pos // previous position, used for peek() method lastCharLen int // length of last character in bytes lastLineLen int // length of last line in characters (for correct column reporting) tokStart int // token text start position tokEnd int // token text end position // Error is called for each error encountered. If no Error // function is set, the error is reported to os.Stderr. Error func(pos token.Pos, msg string) // ErrorCount is incremented by one for each error encountered. ErrorCount int // tokPos is the start position of most recently scanned token; set by // Scan. The Filename field is always left untouched by the Scanner. If // an error is reported (via Error) and Position is invalid, the scanner is // not inside a token. tokPos token.Pos } // New creates and initializes a new instance of Scanner using src as // its source content. func New(src []byte) *Scanner { // even though we accept a src, we read from a io.Reader compatible type // (*bytes.Buffer). So in the future we might easily change it to streaming // read. b := bytes.NewBuffer(src) s := &Scanner{ buf: b, src: src, } // srcPosition always starts with 1 s.srcPos.Line = 1 return s } // next reads the next rune from the bufferred reader. Returns the rune(0) if // an error occurs (or io.EOF is returned). func (s *Scanner) next() rune { ch, size, err := s.buf.ReadRune() if err != nil { // advance for error reporting s.srcPos.Column++ s.srcPos.Offset += size s.lastCharLen = size return eof } // remember last position s.prevPos = s.srcPos s.srcPos.Column++ s.lastCharLen = size s.srcPos.Offset += size if ch == utf8.RuneError && size == 1 { s.err("illegal UTF-8 encoding") return ch } if ch == '\n' { s.srcPos.Line++ s.lastLineLen = s.srcPos.Column s.srcPos.Column = 0 } if ch == '\x00' { s.err("unexpected null character (0x00)") return eof } if ch == '\uE123' { s.err("unicode code point U+E123 reserved for internal use") return utf8.RuneError } // debug // fmt.Printf("ch: %q, offset:column: %d:%d\n", ch, s.srcPos.Offset, s.srcPos.Column) return ch } // unread unreads the previous read Rune and updates the source position func (s *Scanner) unread() { if err := s.buf.UnreadRune(); err != nil { panic(err) // this is user fault, we should catch it } s.srcPos = s.prevPos // put back last position } // peek returns the next rune without advancing the reader. func (s *Scanner) peek() rune { peek, _, err := s.buf.ReadRune() if err != nil { return eof } s.buf.UnreadRune() return peek } // Scan scans the next token and returns the token. func (s *Scanner) Scan() token.Token { ch := s.next() // skip white space for isWhitespace(ch) { ch = s.next() } var tok token.Type // token text markings s.tokStart = s.srcPos.Offset - s.lastCharLen // token position, initial next() is moving the offset by one(size of rune // actually), though we are interested with the starting point s.tokPos.Offset = s.srcPos.Offset - s.lastCharLen if s.srcPos.Column > 0 { // common case: last character was not a '\n' s.tokPos.Line = s.srcPos.Line s.tokPos.Column = s.srcPos.Column } else { // last character was a '\n' // (we cannot be at the beginning of the source // since we have called next() at least once) s.tokPos.Line = s.srcPos.Line - 1 s.tokPos.Column = s.lastLineLen } switch { case isLetter(ch): tok = token.IDENT lit := s.scanIdentifier() if lit == "true" || lit == "false" { tok = token.BOOL } case isDecimal(ch): tok = s.scanNumber(ch) default: switch ch { case eof: tok = token.EOF case '"': tok = token.STRING s.scanString() case '#', '/': tok = token.COMMENT s.scanComment(ch) case '.': tok = token.PERIOD ch = s.peek() if isDecimal(ch) { tok = token.FLOAT ch = s.scanMantissa(ch) ch = s.scanExponent(ch) } case '<': tok = token.HEREDOC s.scanHeredoc() case '[': tok = token.LBRACK case ']': tok = token.RBRACK case '{': tok = token.LBRACE case '}': tok = token.RBRACE case ',': tok = token.COMMA case '=': tok = token.ASSIGN case '+': tok = token.ADD case '-': if isDecimal(s.peek()) { ch := s.next() tok = s.scanNumber(ch) } else { tok = token.SUB } default: s.err("illegal char") } } // finish token ending s.tokEnd = s.srcPos.Offset // create token literal var tokenText string if s.tokStart >= 0 { tokenText = string(s.src[s.tokStart:s.tokEnd]) } s.tokStart = s.tokEnd // ensure idempotency of tokenText() call return token.Token{ Type: tok, Pos: s.tokPos, Text: tokenText, } } func (s *Scanner) scanComment(ch rune) { // single line comments if ch == '#' || (ch == '/' && s.peek() != '*') { if ch == '/' && s.peek() != '/' { s.err("expected '/' for comment") return } ch = s.next() for ch != '\n' && ch >= 0 && ch != eof { ch = s.next() } if ch != eof && ch >= 0 { s.unread() } return } // be sure we get the character after /* This allows us to find comment's // that are not erminated if ch == '/' { s.next() ch = s.next() // read character after "/*" } // look for /* - style comments for { if ch < 0 || ch == eof { s.err("comment not terminated") break } ch0 := ch ch = s.next() if ch0 == '*' && ch == '/' { break } } } // scanNumber scans a HCL number definition starting with the given rune func (s *Scanner) scanNumber(ch rune) token.Type { if ch == '0' { // check for hexadecimal, octal or float ch = s.next() if ch == 'x' || ch == 'X' { // hexadecimal ch = s.next() found := false for isHexadecimal(ch) { ch = s.next() found = true } if !found { s.err("illegal hexadecimal number") } if ch != eof { s.unread() } return token.NUMBER } // now it's either something like: 0421(octal) or 0.1231(float) illegalOctal := false for isDecimal(ch) { ch = s.next() if ch == '8' || ch == '9' { // this is just a possibility. For example 0159 is illegal, but // 0159.23 is valid. So we mark a possible illegal octal. If // the next character is not a period, we'll print the error. illegalOctal = true } } if ch == 'e' || ch == 'E' { ch = s.scanExponent(ch) return token.FLOAT } if ch == '.' { ch = s.scanFraction(ch) if ch == 'e' || ch == 'E' { ch = s.next() ch = s.scanExponent(ch) } return token.FLOAT } if illegalOctal { s.err("illegal octal number") } if ch != eof { s.unread() } return token.NUMBER } s.scanMantissa(ch) ch = s.next() // seek forward if ch == 'e' || ch == 'E' { ch = s.scanExponent(ch) return token.FLOAT } if ch == '.' { ch = s.scanFraction(ch) if ch == 'e' || ch == 'E' { ch = s.next() ch = s.scanExponent(ch) } return token.FLOAT } if ch != eof { s.unread() } return token.NUMBER } // scanMantissa scans the mantissa beginning from the rune. It returns the next // non decimal rune. It's used to determine wheter it's a fraction or exponent. func (s *Scanner) scanMantissa(ch rune) rune { scanned := false for isDecimal(ch) { ch = s.next() scanned = true } if scanned && ch != eof { s.unread() } return ch } // scanFraction scans the fraction after the '.' rune func (s *Scanner) scanFraction(ch rune) rune { if ch == '.' { ch = s.peek() // we peek just to see if we can move forward ch = s.scanMantissa(ch) } return ch } // scanExponent scans the remaining parts of an exponent after the 'e' or 'E' // rune. func (s *Scanner) scanExponent(ch rune) rune { if ch == 'e' || ch == 'E' { ch = s.next() if ch == '-' || ch == '+' { ch = s.next() } ch = s.scanMantissa(ch) } return ch } // scanHeredoc scans a heredoc string func (s *Scanner) scanHeredoc() { // Scan the second '<' in example: '<<EOF' if s.next() != '<' { s.err("heredoc expected second '<', didn't see it") return } // Get the original offset so we can read just the heredoc ident offs := s.srcPos.Offset // Scan the identifier ch := s.next() // Indented heredoc syntax if ch == '-' { ch = s.next() } for isLetter(ch) || isDigit(ch) { ch = s.next() } // If we reached an EOF then that is not good if ch == eof { s.err("heredoc not terminated") return } // Ignore the '\r' in Windows line endings if ch == '\r' { if s.peek() == '\n' { ch = s.next() } } // If we didn't reach a newline then that is also not good if ch != '\n' { s.err("invalid characters in heredoc anchor") return } // Read the identifier identBytes := s.src[offs : s.srcPos.Offset-s.lastCharLen] if len(identBytes) == 0 || (len(identBytes) == 1 && identBytes[0] == '-') { s.err("zero-length heredoc anchor") return } var identRegexp *regexp.Regexp if identBytes[0] == '-' { identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\r*\z`, identBytes[1:])) } else { identRegexp = regexp.MustCompile(fmt.Sprintf(`^[[:space:]]*%s\r*\z`, identBytes)) } // Read the actual string value lineStart := s.srcPos.Offset for { ch := s.next() // Special newline handling. if ch == '\n' { // Math is fast, so we first compare the byte counts to see if we have a chance // of seeing the same identifier - if the length is less than the number of bytes // in the identifier, this cannot be a valid terminator. lineBytesLen := s.srcPos.Offset - s.lastCharLen - lineStart if lineBytesLen >= len(identBytes) && identRegexp.Match(s.src[lineStart:s.srcPos.Offset-s.lastCharLen]) { break } // Not an anchor match, record the start of a new line lineStart = s.srcPos.Offset } if ch == eof { s.err("heredoc not terminated") return } } return } // scanString scans a quoted string func (s *Scanner) scanString() { braces := 0 for { // '"' opening already consumed // read character after quote ch := s.next() if (ch == '\n' && braces == 0) || ch < 0 || ch == eof { s.err("literal not terminated") return } if ch == '"' && braces == 0 { break } // If we're going into a ${} then we can ignore quotes for awhile if braces == 0 && ch == '$' && s.peek() == '{' { braces++ s.next() } else if braces > 0 && ch == '{' { braces++ } if braces > 0 && ch == '}' { braces-- } if ch == '\\' { s.scanEscape() } } return } // scanEscape scans an escape sequence func (s *Scanner) scanEscape() rune { // http://en.cppreference.com/w/cpp/language/escape ch := s.next() // read character after '/' switch ch { case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': // nothing to do case '0', '1', '2', '3', '4', '5', '6', '7': // octal notation ch = s.scanDigits(ch, 8, 3) case 'x': // hexademical notation ch = s.scanDigits(s.next(), 16, 2) case 'u': // universal character name ch = s.scanDigits(s.next(), 16, 4) case 'U': // universal character name ch = s.scanDigits(s.next(), 16, 8) default: s.err("illegal char escape") } return ch } // scanDigits scans a rune with the given base for n times. For example an // octal notation \184 would yield in scanDigits(ch, 8, 3) func (s *Scanner) scanDigits(ch rune, base, n int) rune { start := n for n > 0 && digitVal(ch) < base { ch = s.next() if ch == eof { // If we see an EOF, we halt any more scanning of digits // immediately. break } n-- } if n > 0 { s.err("illegal char escape") } if n != start && ch != eof { // we scanned all digits, put the last non digit char back, // only if we read anything at all s.unread() } return ch } // scanIdentifier scans an identifier and returns the literal string func (s *Scanner) scanIdentifier() string { offs := s.srcPos.Offset - s.lastCharLen ch := s.next() for isLetter(ch) || isDigit(ch) || ch == '-' || ch == '.' { ch = s.next() } if ch != eof { s.unread() // we got identifier, put back latest char } return string(s.src[offs:s.srcPos.Offset]) } // recentPosition returns the position of the character immediately after the // character or token returned by the last call to Scan. func (s *Scanner) recentPosition() (pos token.Pos) { pos.Offset = s.srcPos.Offset - s.lastCharLen switch { case s.srcPos.Column > 0: // common case: last character was not a '\n' pos.Line = s.srcPos.Line pos.Column = s.srcPos.Column case s.lastLineLen > 0: // last character was a '\n' // (we cannot be at the beginning of the source // since we have called next() at least once) pos.Line = s.srcPos.Line - 1 pos.Column = s.lastLineLen default: // at the beginning of the source pos.Line = 1 pos.Column = 1 } return } // err prints the error of any scanning to s.Error function. If the function is // not defined, by default it prints them to os.Stderr func (s *Scanner) err(msg string) { s.ErrorCount++ pos := s.recentPosition() if s.Error != nil { s.Error(pos, msg) return } fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) } // isHexadecimal returns true if the given rune is a letter func isLetter(ch rune) bool { return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) } // isDigit returns true if the given rune is a decimal digit func isDigit(ch rune) bool { return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) } // isDecimal returns true if the given rune is a decimal number func isDecimal(ch rune) bool { return '0' <= ch && ch <= '9' } // isHexadecimal returns true if the given rune is an hexadecimal number func isHexadecimal(ch rune) bool { return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' } // isWhitespace returns true if the rune is a space, tab, newline or carriage return func isWhitespace(ch rune) bool { return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' } // digitVal returns the integer value of a given octal,decimal or hexadecimal rune func digitVal(ch rune) int { switch { case '0' <= ch && ch <= '9': return int(ch - '0') case 'a' <= ch && ch <= 'f': return int(ch - 'a' + 10) case 'A' <= ch && ch <= 'F': return int(ch - 'A' + 10) } return 16 // larger than any legal digit val } ��������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/strconv/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024011�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/strconv/quote.go�������������������������������0000664�0000000�0000000�00000011076�13771713062�0025502�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package strconv import ( "errors" "unicode/utf8" ) // ErrSyntax indicates that a value does not have the right syntax for the target type. var ErrSyntax = errors.New("invalid syntax") // Unquote interprets s as a single-quoted, double-quoted, // or backquoted Go string literal, returning the string value // that s quotes. (If s is single-quoted, it would be a Go // character literal; Unquote returns the corresponding // one-character string.) func Unquote(s string) (t string, err error) { n := len(s) if n < 2 { return "", ErrSyntax } quote := s[0] if quote != s[n-1] { return "", ErrSyntax } s = s[1 : n-1] if quote != '"' { return "", ErrSyntax } if !contains(s, '$') && !contains(s, '{') && contains(s, '\n') { return "", ErrSyntax } // Is it trivial? Avoid allocation. if !contains(s, '\\') && !contains(s, quote) && !contains(s, '$') { switch quote { case '"': return s, nil case '\'': r, size := utf8.DecodeRuneInString(s) if size == len(s) && (r != utf8.RuneError || size != 1) { return s, nil } } } var runeTmp [utf8.UTFMax]byte buf := make([]byte, 0, 3*len(s)/2) // Try to avoid more allocations. for len(s) > 0 { // If we're starting a '${}' then let it through un-unquoted. // Specifically: we don't unquote any characters within the `${}` // section. if s[0] == '$' && len(s) > 1 && s[1] == '{' { buf = append(buf, '$', '{') s = s[2:] // Continue reading until we find the closing brace, copying as-is braces := 1 for len(s) > 0 && braces > 0 { r, size := utf8.DecodeRuneInString(s) if r == utf8.RuneError { return "", ErrSyntax } s = s[size:] n := utf8.EncodeRune(runeTmp[:], r) buf = append(buf, runeTmp[:n]...) switch r { case '{': braces++ case '}': braces-- } } if braces != 0 { return "", ErrSyntax } if len(s) == 0 { // If there's no string left, we're done! break } else { // If there's more left, we need to pop back up to the top of the loop // in case there's another interpolation in this string. continue } } if s[0] == '\n' { return "", ErrSyntax } c, multibyte, ss, err := unquoteChar(s, quote) if err != nil { return "", err } s = ss if c < utf8.RuneSelf || !multibyte { buf = append(buf, byte(c)) } else { n := utf8.EncodeRune(runeTmp[:], c) buf = append(buf, runeTmp[:n]...) } if quote == '\'' && len(s) != 0 { // single-quoted must be single character return "", ErrSyntax } } return string(buf), nil } // contains reports whether the string contains the byte c. func contains(s string, c byte) bool { for i := 0; i < len(s); i++ { if s[i] == c { return true } } return false } func unhex(b byte) (v rune, ok bool) { c := rune(b) switch { case '0' <= c && c <= '9': return c - '0', true case 'a' <= c && c <= 'f': return c - 'a' + 10, true case 'A' <= c && c <= 'F': return c - 'A' + 10, true } return } func unquoteChar(s string, quote byte) (value rune, multibyte bool, tail string, err error) { // easy cases switch c := s[0]; { case c == quote && (quote == '\'' || quote == '"'): err = ErrSyntax return case c >= utf8.RuneSelf: r, size := utf8.DecodeRuneInString(s) return r, true, s[size:], nil case c != '\\': return rune(s[0]), false, s[1:], nil } // hard case: c is backslash if len(s) <= 1 { err = ErrSyntax return } c := s[1] s = s[2:] switch c { case 'a': value = '\a' case 'b': value = '\b' case 'f': value = '\f' case 'n': value = '\n' case 'r': value = '\r' case 't': value = '\t' case 'v': value = '\v' case 'x', 'u', 'U': n := 0 switch c { case 'x': n = 2 case 'u': n = 4 case 'U': n = 8 } var v rune if len(s) < n { err = ErrSyntax return } for j := 0; j < n; j++ { x, ok := unhex(s[j]) if !ok { err = ErrSyntax return } v = v<<4 | x } s = s[n:] if c == 'x' { // single-byte string, possibly not UTF-8 value = v break } if v > utf8.MaxRune { err = ErrSyntax return } value = v multibyte = true case '0', '1', '2', '3', '4', '5', '6', '7': v := rune(c) - '0' if len(s) < 2 { err = ErrSyntax return } for j := 0; j < 2; j++ { // one digit already; two more x := rune(s[j]) - '0' if x < 0 || x > 7 { err = ErrSyntax return } v = (v << 3) | x } s = s[2:] if v > 255 { err = ErrSyntax return } value = v case '\\': value = '\\' case '\'', '"': if c != quote { err = ErrSyntax return } value = rune(c) default: err = ErrSyntax return } tail = s return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/token/�����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023433�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/token/position.go������������������������������0000664�0000000�0000000�00000002312�13771713062�0025624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package token import "fmt" // Pos describes an arbitrary source position // including the file, line, and column location. // A Position is valid if the line number is > 0. type Pos struct { Filename string // filename, if any Offset int // offset, starting at 0 Line int // line number, starting at 1 Column int // column number, starting at 1 (character count) } // IsValid returns true if the position is valid. func (p *Pos) IsValid() bool { return p.Line > 0 } // String returns a string in one of several forms: // // file:line:column valid position with file name // line:column valid position without file name // file invalid position with file name // - invalid position without file name func (p Pos) String() string { s := p.Filename if p.IsValid() { if s != "" { s += ":" } s += fmt.Sprintf("%d:%d", p.Line, p.Column) } if s == "" { s = "-" } return s } // Before reports whether the position p is before u. func (p Pos) Before(u Pos) bool { return u.Offset > p.Offset || u.Line > p.Line } // After reports whether the position p is after u. func (p Pos) After(u Pos) bool { return u.Offset < p.Offset || u.Line < p.Line } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/hcl/token/token.go���������������������������������0000664�0000000�0000000�00000011664�13771713062�0025112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package token defines constants representing the lexical tokens for HCL // (HashiCorp Configuration Language) package token import ( "fmt" "strconv" "strings" hclstrconv "github.com/hashicorp/hcl/hcl/strconv" ) // Token defines a single HCL token which can be obtained via the Scanner type Token struct { Type Type Pos Pos Text string JSON bool } // Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) type Type int const ( // Special tokens ILLEGAL Type = iota EOF COMMENT identifier_beg IDENT // literals literal_beg NUMBER // 12345 FLOAT // 123.45 BOOL // true,false STRING // "abc" HEREDOC // <<FOO\nbar\nFOO literal_end identifier_end operator_beg LBRACK // [ LBRACE // { COMMA // , PERIOD // . RBRACK // ] RBRACE // } ASSIGN // = ADD // + SUB // - operator_end ) var tokens = [...]string{ ILLEGAL: "ILLEGAL", EOF: "EOF", COMMENT: "COMMENT", IDENT: "IDENT", NUMBER: "NUMBER", FLOAT: "FLOAT", BOOL: "BOOL", STRING: "STRING", LBRACK: "LBRACK", LBRACE: "LBRACE", COMMA: "COMMA", PERIOD: "PERIOD", HEREDOC: "HEREDOC", RBRACK: "RBRACK", RBRACE: "RBRACE", ASSIGN: "ASSIGN", ADD: "ADD", SUB: "SUB", } // String returns the string corresponding to the token tok. func (t Type) String() string { s := "" if 0 <= t && t < Type(len(tokens)) { s = tokens[t] } if s == "" { s = "token(" + strconv.Itoa(int(t)) + ")" } return s } // IsIdentifier returns true for tokens corresponding to identifiers and basic // type literals; it returns false otherwise. func (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end } // IsLiteral returns true for tokens corresponding to basic type literals; it // returns false otherwise. func (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end } // IsOperator returns true for tokens corresponding to operators and // delimiters; it returns false otherwise. func (t Type) IsOperator() bool { return operator_beg < t && t < operator_end } // String returns the token's literal text. Note that this is only // applicable for certain token types, such as token.IDENT, // token.STRING, etc.. func (t Token) String() string { return fmt.Sprintf("%s %s %s", t.Pos.String(), t.Type.String(), t.Text) } // Value returns the properly typed value for this token. The type of // the returned interface{} is guaranteed based on the Type field. // // This can only be called for literal types. If it is called for any other // type, this will panic. func (t Token) Value() interface{} { switch t.Type { case BOOL: if t.Text == "true" { return true } else if t.Text == "false" { return false } panic("unknown bool value: " + t.Text) case FLOAT: v, err := strconv.ParseFloat(t.Text, 64) if err != nil { panic(err) } return float64(v) case NUMBER: v, err := strconv.ParseInt(t.Text, 0, 64) if err != nil { panic(err) } return int64(v) case IDENT: return t.Text case HEREDOC: return unindentHeredoc(t.Text) case STRING: // Determine the Unquote method to use. If it came from JSON, // then we need to use the built-in unquote since we have to // escape interpolations there. f := hclstrconv.Unquote if t.JSON { f = strconv.Unquote } // This case occurs if json null is used if t.Text == "" { return "" } v, err := f(t.Text) if err != nil { panic(fmt.Sprintf("unquote %s err: %s", t.Text, err)) } return v default: panic(fmt.Sprintf("unimplemented Value for type: %s", t.Type)) } } // unindentHeredoc returns the string content of a HEREDOC if it is started with << // and the content of a HEREDOC with the hanging indent removed if it is started with // a <<-, and the terminating line is at least as indented as the least indented line. func unindentHeredoc(heredoc string) string { // We need to find the end of the marker idx := strings.IndexByte(heredoc, '\n') if idx == -1 { panic("heredoc doesn't contain newline") } unindent := heredoc[2] == '-' // We can optimize if the heredoc isn't marked for indentation if !unindent { return string(heredoc[idx+1 : len(heredoc)-idx+1]) } // We need to unindent each line based on the indentation level of the marker lines := strings.Split(string(heredoc[idx+1:len(heredoc)-idx+2]), "\n") whitespacePrefix := lines[len(lines)-1] isIndented := true for _, v := range lines { if strings.HasPrefix(v, whitespacePrefix) { continue } isIndented = false break } // If all lines are not at least as indented as the terminating mark, return the // heredoc as is, but trim the leading space from the marker on the final line. if !isIndented { return strings.TrimRight(string(heredoc[idx+1:len(heredoc)-idx+1]), " \t") } unindentedLines := make([]string, len(lines)) for k, v := range lines { if k == len(lines)-1 { unindentedLines[k] = "" break } unindentedLines[k] = strings.TrimPrefix(v, whitespacePrefix) } return strings.Join(unindentedLines, "\n") } ����������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022516�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/parser/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024012�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/parser/flatten.go�����������������������������0000664�0000000�0000000�00000006055�13771713062�0026004�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package parser import "github.com/hashicorp/hcl/hcl/ast" // flattenObjects takes an AST node, walks it, and flattens func flattenObjects(node ast.Node) { ast.Walk(node, func(n ast.Node) (ast.Node, bool) { // We only care about lists, because this is what we modify list, ok := n.(*ast.ObjectList) if !ok { return n, true } // Rebuild the item list items := make([]*ast.ObjectItem, 0, len(list.Items)) frontier := make([]*ast.ObjectItem, len(list.Items)) copy(frontier, list.Items) for len(frontier) > 0 { // Pop the current item n := len(frontier) item := frontier[n-1] frontier = frontier[:n-1] switch v := item.Val.(type) { case *ast.ObjectType: items, frontier = flattenObjectType(v, item, items, frontier) case *ast.ListType: items, frontier = flattenListType(v, item, items, frontier) default: items = append(items, item) } } // Reverse the list since the frontier model runs things backwards for i := len(items)/2 - 1; i >= 0; i-- { opp := len(items) - 1 - i items[i], items[opp] = items[opp], items[i] } // Done! Set the original items list.Items = items return n, true }) } func flattenListType( ot *ast.ListType, item *ast.ObjectItem, items []*ast.ObjectItem, frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { // If the list is empty, keep the original list if len(ot.List) == 0 { items = append(items, item) return items, frontier } // All the elements of this object must also be objects! for _, subitem := range ot.List { if _, ok := subitem.(*ast.ObjectType); !ok { items = append(items, item) return items, frontier } } // Great! We have a match go through all the items and flatten for _, elem := range ot.List { // Add it to the frontier so that we can recurse frontier = append(frontier, &ast.ObjectItem{ Keys: item.Keys, Assign: item.Assign, Val: elem, LeadComment: item.LeadComment, LineComment: item.LineComment, }) } return items, frontier } func flattenObjectType( ot *ast.ObjectType, item *ast.ObjectItem, items []*ast.ObjectItem, frontier []*ast.ObjectItem) ([]*ast.ObjectItem, []*ast.ObjectItem) { // If the list has no items we do not have to flatten anything if ot.List.Items == nil { items = append(items, item) return items, frontier } // All the elements of this object must also be objects! for _, subitem := range ot.List.Items { if _, ok := subitem.Val.(*ast.ObjectType); !ok { items = append(items, item) return items, frontier } } // Great! We have a match go through all the items and flatten for _, subitem := range ot.List.Items { // Copy the new key keys := make([]*ast.ObjectKey, len(item.Keys)+len(subitem.Keys)) copy(keys, item.Keys) copy(keys[len(item.Keys):], subitem.Keys) // Add it to the frontier so that we can recurse frontier = append(frontier, &ast.ObjectItem{ Keys: keys, Assign: item.Assign, Val: subitem.Val, LeadComment: item.LeadComment, LineComment: item.LineComment, }) } return items, frontier } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/parser/parser.go������������������������������0000664�0000000�0000000�00000015243�13771713062�0025642�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package parser import ( "errors" "fmt" "github.com/hashicorp/hcl/hcl/ast" hcltoken "github.com/hashicorp/hcl/hcl/token" "github.com/hashicorp/hcl/json/scanner" "github.com/hashicorp/hcl/json/token" ) type Parser struct { sc *scanner.Scanner // Last read token tok token.Token commaPrev token.Token enableTrace bool indent int n int // buffer size (max = 1) } func newParser(src []byte) *Parser { return &Parser{ sc: scanner.New(src), } } // Parse returns the fully parsed source and returns the abstract syntax tree. func Parse(src []byte) (*ast.File, error) { p := newParser(src) return p.Parse() } var errEofToken = errors.New("EOF token found") // Parse returns the fully parsed source and returns the abstract syntax tree. func (p *Parser) Parse() (*ast.File, error) { f := &ast.File{} var err, scerr error p.sc.Error = func(pos token.Pos, msg string) { scerr = fmt.Errorf("%s: %s", pos, msg) } // The root must be an object in JSON object, err := p.object() if scerr != nil { return nil, scerr } if err != nil { return nil, err } // We make our final node an object list so it is more HCL compatible f.Node = object.List // Flatten it, which finds patterns and turns them into more HCL-like // AST trees. flattenObjects(f.Node) return f, nil } func (p *Parser) objectList() (*ast.ObjectList, error) { defer un(trace(p, "ParseObjectList")) node := &ast.ObjectList{} for { n, err := p.objectItem() if err == errEofToken { break // we are finished } // we don't return a nil node, because might want to use already // collected items. if err != nil { return node, err } node.Add(n) // Check for a followup comma. If it isn't a comma, then we're done if tok := p.scan(); tok.Type != token.COMMA { break } } return node, nil } // objectItem parses a single object item func (p *Parser) objectItem() (*ast.ObjectItem, error) { defer un(trace(p, "ParseObjectItem")) keys, err := p.objectKey() if err != nil { return nil, err } o := &ast.ObjectItem{ Keys: keys, } switch p.tok.Type { case token.COLON: pos := p.tok.Pos o.Assign = hcltoken.Pos{ Filename: pos.Filename, Offset: pos.Offset, Line: pos.Line, Column: pos.Column, } o.Val, err = p.objectValue() if err != nil { return nil, err } } return o, nil } // objectKey parses an object key and returns a ObjectKey AST func (p *Parser) objectKey() ([]*ast.ObjectKey, error) { keyCount := 0 keys := make([]*ast.ObjectKey, 0) for { tok := p.scan() switch tok.Type { case token.EOF: return nil, errEofToken case token.STRING: keyCount++ keys = append(keys, &ast.ObjectKey{ Token: p.tok.HCLToken(), }) case token.COLON: // If we have a zero keycount it means that we never got // an object key, i.e. `{ :`. This is a syntax error. if keyCount == 0 { return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) } // Done return keys, nil case token.ILLEGAL: return nil, errors.New("illegal") default: return nil, fmt.Errorf("expected: STRING got: %s", p.tok.Type) } } } // object parses any type of object, such as number, bool, string, object or // list. func (p *Parser) objectValue() (ast.Node, error) { defer un(trace(p, "ParseObjectValue")) tok := p.scan() switch tok.Type { case token.NUMBER, token.FLOAT, token.BOOL, token.NULL, token.STRING: return p.literalType() case token.LBRACE: return p.objectType() case token.LBRACK: return p.listType() case token.EOF: return nil, errEofToken } return nil, fmt.Errorf("Expected object value, got unknown token: %+v", tok) } // object parses any type of object, such as number, bool, string, object or // list. func (p *Parser) object() (*ast.ObjectType, error) { defer un(trace(p, "ParseType")) tok := p.scan() switch tok.Type { case token.LBRACE: return p.objectType() case token.EOF: return nil, errEofToken } return nil, fmt.Errorf("Expected object, got unknown token: %+v", tok) } // objectType parses an object type and returns a ObjectType AST func (p *Parser) objectType() (*ast.ObjectType, error) { defer un(trace(p, "ParseObjectType")) // we assume that the currently scanned token is a LBRACE o := &ast.ObjectType{} l, err := p.objectList() // if we hit RBRACE, we are good to go (means we parsed all Items), if it's // not a RBRACE, it's an syntax error and we just return it. if err != nil && p.tok.Type != token.RBRACE { return nil, err } o.List = l return o, nil } // listType parses a list type and returns a ListType AST func (p *Parser) listType() (*ast.ListType, error) { defer un(trace(p, "ParseListType")) // we assume that the currently scanned token is a LBRACK l := &ast.ListType{} for { tok := p.scan() switch tok.Type { case token.NUMBER, token.FLOAT, token.STRING: node, err := p.literalType() if err != nil { return nil, err } l.Add(node) case token.COMMA: continue case token.LBRACE: node, err := p.objectType() if err != nil { return nil, err } l.Add(node) case token.BOOL: // TODO(arslan) should we support? not supported by HCL yet case token.LBRACK: // TODO(arslan) should we support nested lists? Even though it's // written in README of HCL, it's not a part of the grammar // (not defined in parse.y) case token.RBRACK: // finished return l, nil default: return nil, fmt.Errorf("unexpected token while parsing list: %s", tok.Type) } } } // literalType parses a literal type and returns a LiteralType AST func (p *Parser) literalType() (*ast.LiteralType, error) { defer un(trace(p, "ParseLiteral")) return &ast.LiteralType{ Token: p.tok.HCLToken(), }, nil } // scan returns the next token from the underlying scanner. If a token has // been unscanned then read that instead. func (p *Parser) scan() token.Token { // If we have a token on the buffer, then return it. if p.n != 0 { p.n = 0 return p.tok } p.tok = p.sc.Scan() return p.tok } // unscan pushes the previously read token back onto the buffer. func (p *Parser) unscan() { p.n = 1 } // ---------------------------------------------------------------------------- // Parsing support func (p *Parser) printTrace(a ...interface{}) { if !p.enableTrace { return } const dots = ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . " const n = len(dots) fmt.Printf("%5d:%3d: ", p.tok.Pos.Line, p.tok.Pos.Column) i := 2 * p.indent for i > n { fmt.Print(dots) i -= n } // i <= n fmt.Print(dots[0:i]) fmt.Println(a...) } func trace(p *Parser, msg string) *Parser { p.printTrace(msg, "(") p.indent++ return p } // Usage pattern: defer un(trace(p, "...")) func un(p *Parser) { p.indent-- p.printTrace(")") } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/scanner/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024147�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/scanner/scanner.go����������������������������0000664�0000000�0000000�00000024562�13771713062�0026140�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scanner import ( "bytes" "fmt" "os" "unicode" "unicode/utf8" "github.com/hashicorp/hcl/json/token" ) // eof represents a marker rune for the end of the reader. const eof = rune(0) // Scanner defines a lexical scanner type Scanner struct { buf *bytes.Buffer // Source buffer for advancing and scanning src []byte // Source buffer for immutable access // Source Position srcPos token.Pos // current position prevPos token.Pos // previous position, used for peek() method lastCharLen int // length of last character in bytes lastLineLen int // length of last line in characters (for correct column reporting) tokStart int // token text start position tokEnd int // token text end position // Error is called for each error encountered. If no Error // function is set, the error is reported to os.Stderr. Error func(pos token.Pos, msg string) // ErrorCount is incremented by one for each error encountered. ErrorCount int // tokPos is the start position of most recently scanned token; set by // Scan. The Filename field is always left untouched by the Scanner. If // an error is reported (via Error) and Position is invalid, the scanner is // not inside a token. tokPos token.Pos } // New creates and initializes a new instance of Scanner using src as // its source content. func New(src []byte) *Scanner { // even though we accept a src, we read from a io.Reader compatible type // (*bytes.Buffer). So in the future we might easily change it to streaming // read. b := bytes.NewBuffer(src) s := &Scanner{ buf: b, src: src, } // srcPosition always starts with 1 s.srcPos.Line = 1 return s } // next reads the next rune from the bufferred reader. Returns the rune(0) if // an error occurs (or io.EOF is returned). func (s *Scanner) next() rune { ch, size, err := s.buf.ReadRune() if err != nil { // advance for error reporting s.srcPos.Column++ s.srcPos.Offset += size s.lastCharLen = size return eof } if ch == utf8.RuneError && size == 1 { s.srcPos.Column++ s.srcPos.Offset += size s.lastCharLen = size s.err("illegal UTF-8 encoding") return ch } // remember last position s.prevPos = s.srcPos s.srcPos.Column++ s.lastCharLen = size s.srcPos.Offset += size if ch == '\n' { s.srcPos.Line++ s.lastLineLen = s.srcPos.Column s.srcPos.Column = 0 } // debug // fmt.Printf("ch: %q, offset:column: %d:%d\n", ch, s.srcPos.Offset, s.srcPos.Column) return ch } // unread unreads the previous read Rune and updates the source position func (s *Scanner) unread() { if err := s.buf.UnreadRune(); err != nil { panic(err) // this is user fault, we should catch it } s.srcPos = s.prevPos // put back last position } // peek returns the next rune without advancing the reader. func (s *Scanner) peek() rune { peek, _, err := s.buf.ReadRune() if err != nil { return eof } s.buf.UnreadRune() return peek } // Scan scans the next token and returns the token. func (s *Scanner) Scan() token.Token { ch := s.next() // skip white space for isWhitespace(ch) { ch = s.next() } var tok token.Type // token text markings s.tokStart = s.srcPos.Offset - s.lastCharLen // token position, initial next() is moving the offset by one(size of rune // actually), though we are interested with the starting point s.tokPos.Offset = s.srcPos.Offset - s.lastCharLen if s.srcPos.Column > 0 { // common case: last character was not a '\n' s.tokPos.Line = s.srcPos.Line s.tokPos.Column = s.srcPos.Column } else { // last character was a '\n' // (we cannot be at the beginning of the source // since we have called next() at least once) s.tokPos.Line = s.srcPos.Line - 1 s.tokPos.Column = s.lastLineLen } switch { case isLetter(ch): lit := s.scanIdentifier() if lit == "true" || lit == "false" { tok = token.BOOL } else if lit == "null" { tok = token.NULL } else { s.err("illegal char") } case isDecimal(ch): tok = s.scanNumber(ch) default: switch ch { case eof: tok = token.EOF case '"': tok = token.STRING s.scanString() case '.': tok = token.PERIOD ch = s.peek() if isDecimal(ch) { tok = token.FLOAT ch = s.scanMantissa(ch) ch = s.scanExponent(ch) } case '[': tok = token.LBRACK case ']': tok = token.RBRACK case '{': tok = token.LBRACE case '}': tok = token.RBRACE case ',': tok = token.COMMA case ':': tok = token.COLON case '-': if isDecimal(s.peek()) { ch := s.next() tok = s.scanNumber(ch) } else { s.err("illegal char") } default: s.err("illegal char: " + string(ch)) } } // finish token ending s.tokEnd = s.srcPos.Offset // create token literal var tokenText string if s.tokStart >= 0 { tokenText = string(s.src[s.tokStart:s.tokEnd]) } s.tokStart = s.tokEnd // ensure idempotency of tokenText() call return token.Token{ Type: tok, Pos: s.tokPos, Text: tokenText, } } // scanNumber scans a HCL number definition starting with the given rune func (s *Scanner) scanNumber(ch rune) token.Type { zero := ch == '0' pos := s.srcPos s.scanMantissa(ch) ch = s.next() // seek forward if ch == 'e' || ch == 'E' { ch = s.scanExponent(ch) return token.FLOAT } if ch == '.' { ch = s.scanFraction(ch) if ch == 'e' || ch == 'E' { ch = s.next() ch = s.scanExponent(ch) } return token.FLOAT } if ch != eof { s.unread() } // If we have a larger number and this is zero, error if zero && pos != s.srcPos { s.err("numbers cannot start with 0") } return token.NUMBER } // scanMantissa scans the mantissa beginning from the rune. It returns the next // non decimal rune. It's used to determine wheter it's a fraction or exponent. func (s *Scanner) scanMantissa(ch rune) rune { scanned := false for isDecimal(ch) { ch = s.next() scanned = true } if scanned && ch != eof { s.unread() } return ch } // scanFraction scans the fraction after the '.' rune func (s *Scanner) scanFraction(ch rune) rune { if ch == '.' { ch = s.peek() // we peek just to see if we can move forward ch = s.scanMantissa(ch) } return ch } // scanExponent scans the remaining parts of an exponent after the 'e' or 'E' // rune. func (s *Scanner) scanExponent(ch rune) rune { if ch == 'e' || ch == 'E' { ch = s.next() if ch == '-' || ch == '+' { ch = s.next() } ch = s.scanMantissa(ch) } return ch } // scanString scans a quoted string func (s *Scanner) scanString() { braces := 0 for { // '"' opening already consumed // read character after quote ch := s.next() if ch == '\n' || ch < 0 || ch == eof { s.err("literal not terminated") return } if ch == '"' { break } // If we're going into a ${} then we can ignore quotes for awhile if braces == 0 && ch == '$' && s.peek() == '{' { braces++ s.next() } else if braces > 0 && ch == '{' { braces++ } if braces > 0 && ch == '}' { braces-- } if ch == '\\' { s.scanEscape() } } return } // scanEscape scans an escape sequence func (s *Scanner) scanEscape() rune { // http://en.cppreference.com/w/cpp/language/escape ch := s.next() // read character after '/' switch ch { case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', '"': // nothing to do case '0', '1', '2', '3', '4', '5', '6', '7': // octal notation ch = s.scanDigits(ch, 8, 3) case 'x': // hexademical notation ch = s.scanDigits(s.next(), 16, 2) case 'u': // universal character name ch = s.scanDigits(s.next(), 16, 4) case 'U': // universal character name ch = s.scanDigits(s.next(), 16, 8) default: s.err("illegal char escape") } return ch } // scanDigits scans a rune with the given base for n times. For example an // octal notation \184 would yield in scanDigits(ch, 8, 3) func (s *Scanner) scanDigits(ch rune, base, n int) rune { for n > 0 && digitVal(ch) < base { ch = s.next() n-- } if n > 0 { s.err("illegal char escape") } // we scanned all digits, put the last non digit char back s.unread() return ch } // scanIdentifier scans an identifier and returns the literal string func (s *Scanner) scanIdentifier() string { offs := s.srcPos.Offset - s.lastCharLen ch := s.next() for isLetter(ch) || isDigit(ch) || ch == '-' { ch = s.next() } if ch != eof { s.unread() // we got identifier, put back latest char } return string(s.src[offs:s.srcPos.Offset]) } // recentPosition returns the position of the character immediately after the // character or token returned by the last call to Scan. func (s *Scanner) recentPosition() (pos token.Pos) { pos.Offset = s.srcPos.Offset - s.lastCharLen switch { case s.srcPos.Column > 0: // common case: last character was not a '\n' pos.Line = s.srcPos.Line pos.Column = s.srcPos.Column case s.lastLineLen > 0: // last character was a '\n' // (we cannot be at the beginning of the source // since we have called next() at least once) pos.Line = s.srcPos.Line - 1 pos.Column = s.lastLineLen default: // at the beginning of the source pos.Line = 1 pos.Column = 1 } return } // err prints the error of any scanning to s.Error function. If the function is // not defined, by default it prints them to os.Stderr func (s *Scanner) err(msg string) { s.ErrorCount++ pos := s.recentPosition() if s.Error != nil { s.Error(pos, msg) return } fmt.Fprintf(os.Stderr, "%s: %s\n", pos, msg) } // isHexadecimal returns true if the given rune is a letter func isLetter(ch rune) bool { return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch >= 0x80 && unicode.IsLetter(ch) } // isHexadecimal returns true if the given rune is a decimal digit func isDigit(ch rune) bool { return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) } // isHexadecimal returns true if the given rune is a decimal number func isDecimal(ch rune) bool { return '0' <= ch && ch <= '9' } // isHexadecimal returns true if the given rune is an hexadecimal number func isHexadecimal(ch rune) bool { return '0' <= ch && ch <= '9' || 'a' <= ch && ch <= 'f' || 'A' <= ch && ch <= 'F' } // isWhitespace returns true if the rune is a space, tab, newline or carriage return func isWhitespace(ch rune) bool { return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' } // digitVal returns the integer value of a given octal,decimal or hexadecimal rune func digitVal(ch rune) int { switch { case '0' <= ch && ch <= '9': return int(ch - '0') case 'a' <= ch && ch <= 'f': return int(ch - 'a' + 10) case 'A' <= ch && ch <= 'F': return int(ch - 'A' + 10) } return 16 // larger than any legal digit val } ����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/token/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023636�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/token/position.go�����������������������������0000664�0000000�0000000�00000002312�13771713062�0026027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package token import "fmt" // Pos describes an arbitrary source position // including the file, line, and column location. // A Position is valid if the line number is > 0. type Pos struct { Filename string // filename, if any Offset int // offset, starting at 0 Line int // line number, starting at 1 Column int // column number, starting at 1 (character count) } // IsValid returns true if the position is valid. func (p *Pos) IsValid() bool { return p.Line > 0 } // String returns a string in one of several forms: // // file:line:column valid position with file name // line:column valid position without file name // file invalid position with file name // - invalid position without file name func (p Pos) String() string { s := p.Filename if p.IsValid() { if s != "" { s += ":" } s += fmt.Sprintf("%d:%d", p.Line, p.Column) } if s == "" { s = "-" } return s } // Before reports whether the position p is before u. func (p Pos) Before(u Pos) bool { return u.Offset > p.Offset || u.Line > p.Line } // After reports whether the position p is after u. func (p Pos) After(u Pos) bool { return u.Offset < p.Offset || u.Line < p.Line } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/json/token/token.go��������������������������������0000664�0000000�0000000�00000005131�13771713062�0025305�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package token import ( "fmt" "strconv" hcltoken "github.com/hashicorp/hcl/hcl/token" ) // Token defines a single HCL token which can be obtained via the Scanner type Token struct { Type Type Pos Pos Text string } // Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language) type Type int const ( // Special tokens ILLEGAL Type = iota EOF identifier_beg literal_beg NUMBER // 12345 FLOAT // 123.45 BOOL // true,false STRING // "abc" NULL // null literal_end identifier_end operator_beg LBRACK // [ LBRACE // { COMMA // , PERIOD // . COLON // : RBRACK // ] RBRACE // } operator_end ) var tokens = [...]string{ ILLEGAL: "ILLEGAL", EOF: "EOF", NUMBER: "NUMBER", FLOAT: "FLOAT", BOOL: "BOOL", STRING: "STRING", NULL: "NULL", LBRACK: "LBRACK", LBRACE: "LBRACE", COMMA: "COMMA", PERIOD: "PERIOD", COLON: "COLON", RBRACK: "RBRACK", RBRACE: "RBRACE", } // String returns the string corresponding to the token tok. func (t Type) String() string { s := "" if 0 <= t && t < Type(len(tokens)) { s = tokens[t] } if s == "" { s = "token(" + strconv.Itoa(int(t)) + ")" } return s } // IsIdentifier returns true for tokens corresponding to identifiers and basic // type literals; it returns false otherwise. func (t Type) IsIdentifier() bool { return identifier_beg < t && t < identifier_end } // IsLiteral returns true for tokens corresponding to basic type literals; it // returns false otherwise. func (t Type) IsLiteral() bool { return literal_beg < t && t < literal_end } // IsOperator returns true for tokens corresponding to operators and // delimiters; it returns false otherwise. func (t Type) IsOperator() bool { return operator_beg < t && t < operator_end } // String returns the token's literal text. Note that this is only // applicable for certain token types, such as token.IDENT, // token.STRING, etc.. func (t Token) String() string { return fmt.Sprintf("%s %s %s", t.Pos.String(), t.Type.String(), t.Text) } // HCLToken converts this token to an HCL token. // // The token type must be a literal type or this will panic. func (t Token) HCLToken() hcltoken.Token { switch t.Type { case BOOL: return hcltoken.Token{Type: hcltoken.BOOL, Text: t.Text} case FLOAT: return hcltoken.Token{Type: hcltoken.FLOAT, Text: t.Text} case NULL: return hcltoken.Token{Type: hcltoken.STRING, Text: ""} case NUMBER: return hcltoken.Token{Type: hcltoken.NUMBER, Text: t.Text} case STRING: return hcltoken.Token{Type: hcltoken.STRING, Text: t.Text, JSON: true} default: panic(fmt.Sprintf("unimplemented HCLToken for type: %s", t.Type)) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/lex.go���������������������������������������������0000664�0000000�0000000�00000000756�13771713062�0022674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "unicode" "unicode/utf8" ) type lexModeValue byte const ( lexModeUnknown lexModeValue = iota lexModeHcl lexModeJson ) // lexMode returns whether we're going to be parsing in JSON // mode or HCL mode. func lexMode(v []byte) lexModeValue { var ( r rune w int offset int ) for { r, w = utf8.DecodeRune(v[offset:]) offset += w if unicode.IsSpace(r) { continue } if r == '{' { return lexModeJson } break } return lexModeHcl } ������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/parse.go�������������������������������������������0000664�0000000�0000000�00000001574�13771713062�0023215�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "fmt" "github.com/hashicorp/hcl/hcl/ast" hclParser "github.com/hashicorp/hcl/hcl/parser" jsonParser "github.com/hashicorp/hcl/json/parser" ) // ParseBytes accepts as input byte slice and returns ast tree. // // Input can be either JSON or HCL func ParseBytes(in []byte) (*ast.File, error) { return parse(in) } // ParseString accepts input as a string and returns ast tree. func ParseString(input string) (*ast.File, error) { return parse([]byte(input)) } func parse(in []byte) (*ast.File, error) { switch lexMode(in) { case lexModeHcl: return hclParser.Parse(in) case lexModeJson: return jsonParser.Parse(in) } return nil, fmt.Errorf("unknown config format") } // Parse parses the given input and returns the root object. // // The input format can be either HCL or JSON. func Parse(input string) (*ast.File, error) { return parse([]byte(input)) } ������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022074�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md������������������������������������0000664�0000000�0000000�00000013006�13771713062�0023705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL Changelog ## v2.6.0 (June 4, 2020) ### Enhancements * hcldec: Add a new `Spec`, `ValidateSpec`, which allows custom validation of values at decode-time. ([#387](https://github.com/hashicorp/hcl/pull/387)) ### Bugs Fixed * hclsyntax: Fix panic with combination of sequences and null arguments ([#386](https://github.com/hashicorp/hcl/pull/386)) * hclsyntax: Fix handling of unknown values and sequences ([#386](https://github.com/hashicorp/hcl/pull/386)) ## v2.5.1 (May 14, 2020) ### Bugs Fixed * hclwrite: handle legacy dot access of numeric indexes. ([#369](https://github.com/hashicorp/hcl/pull/369)) * hclwrite: Fix panic for dotted full splat (`foo.*`) ([#374](https://github.com/hashicorp/hcl/pull/374)) ## v2.5.0 (May 6, 2020) ### Enhancements * hclwrite: Generate multi-line objects and maps. ([#372](https://github.com/hashicorp/hcl/pull/372)) ## v2.4.0 (Apr 13, 2020) ### Enhancements * The Unicode data tables that HCL uses to produce user-perceived "column" positions in diagnostics and other source ranges are now updated to Unicode 12.0.0, which will cause HCL to produce more accurate column numbers for combining characters introduced to Unicode since Unicode 9.0.0. ### Bugs Fixed * json: Fix panic when parsing malformed JSON. ([#358](https://github.com/hashicorp/hcl/pull/358)) ## v2.3.0 (Jan 3, 2020) ### Enhancements * ext/tryfunc: Optional functions `try` and `can` to include in your `hcl.EvalContext` when evaluating expressions, which allow users to make decisions based on the success of expressions. ([#330](https://github.com/hashicorp/hcl/pull/330)) * ext/typeexpr: Now has an optional function `convert` which you can include in your `hcl.EvalContext` when evaluating expressions, allowing users to convert values to specific type constraints using the type constraint expression syntax. ([#330](https://github.com/hashicorp/hcl/pull/330)) * ext/typeexpr: A new `cty` capsule type `typeexpr.TypeConstraintType` which, when used as either a type constraint for a function parameter or as a type constraint for a `hcldec` attribute specification will cause the given expression to be interpreted as a type constraint expression rather than a value expression. ([#330](https://github.com/hashicorp/hcl/pull/330)) * ext/customdecode: An optional extension that allows overriding the static decoding behavior for expressions either in function arguments or `hcldec` attribute specifications. ([#330](https://github.com/hashicorp/hcl/pull/330)) * ext/customdecode: New `cty` capsuletypes `customdecode.ExpressionType` and `customdecode.ExpressionClosureType` which, when used as either a type constraint for a function parameter or as a type constraint for a `hcldec` attribute specification will cause the given expression (and, for the closure type, also the `hcl.EvalContext` it was evaluated in) to be captured for later analysis, rather than immediately evaluated. ([#330](https://github.com/hashicorp/hcl/pull/330)) ## v2.2.0 (Dec 11, 2019) ### Enhancements * hcldec: Attribute evaluation (as part of `AttrSpec` or `BlockAttrsSpec`) now captures expression evaluation metadata in any errors it produces during type conversions, allowing for better feedback in calling applications that are able to make use of this metadata when printing diagnostic messages. ([#329](https://github.com/hashicorp/hcl/pull/329)) ### Bugs Fixed * hclsyntax: `IndexExpr`, `SplatExpr`, and `RelativeTraversalExpr` will now report a source range that covers all of their child expression nodes. Previously they would report only the operator part, such as `["foo"]`, `[*]`, or `.foo`, which was problematic for callers using source ranges for code analysis. ([#328](https://github.com/hashicorp/hcl/pull/328)) * hclwrite: Parser will no longer panic when the input includes index, splat, or relative traversal syntax. ([#328](https://github.com/hashicorp/hcl/pull/328)) ## v2.1.0 (Nov 19, 2019) ### Enhancements * gohcl: When decoding into a struct value with some fields already populated, those values will be retained if not explicitly overwritten in the given HCL body, with similar overriding/merging behavior as `json.Unmarshal` in the Go standard library. * hclwrite: New interface to set the expression for an attribute to be a raw token sequence, with no special processing. This has some caveats, so if you intend to use it please refer to the godoc comments. ([#320](https://github.com/hashicorp/hcl/pull/320)) ### Bugs Fixed * hclwrite: The `Body.Blocks` method was returing the blocks in an indefined order, rather than preserving the order of declaration in the source input. ([#313](https://github.com/hashicorp/hcl/pull/313)) * hclwrite: The `TokensForTraversal` function (and thus in turn the `Body.SetAttributeTraversal` method) was not correctly handling index steps in traversals, and thus producing invalid results. ([#319](https://github.com/hashicorp/hcl/pull/319)) ## v2.0.0 (Oct 2, 2019) Initial release of HCL 2, which is a new implementating combining the HCL 1 language with the HIL expression language to produce a single language supporting both nested configuration structures and arbitrary expressions. HCL 2 has an entirely new Go library API and so is _not_ a drop-in upgrade relative to HCL 1. It's possible to import both versions of HCL into a single program using Go's _semantic import versioning_ mechanism: ``` import ( hcl1 "github.com/hashicorp/hcl" hcl2 "github.com/hashicorp/hcl/v2" ) ``` --- Prior to v2.0.0 there was not a curated changelog. Consult the git history from the latest v1.x.x tag for information on the changes to HCL 1. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/LICENSE�����������������������������������������0000664�0000000�0000000�00000037150�13771713062�0023107�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. “Contributor” means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. “Contributor Version” means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. 1.3. “Contribution” means Covered Software of a particular Contributor. 1.4. “Covered Software” means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. “Incompatible With Secondary Licenses” means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. “Executable Form” means any form of the work other than Source Code Form. 1.7. “Larger Work” means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. “License” means this document. 1.9. “Licensable” means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. “Modifications” means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. “Patent Claims” of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. “Secondary License” means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. “Source Code Form” means the form of the work preferred for making modifications. 1.14. “You” (or “Your”) means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/README.md���������������������������������������0000664�0000000�0000000�00000015477�13771713062�0023371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL HCL is a toolkit for creating structured configuration languages that are both human- and machine-friendly, for use with command-line tools. Although intended to be generally useful, it is primarily targeted towards devops tools, servers, etc. > **NOTE:** This is major version 2 of HCL, whose Go API is incompatible with > major version 1. Both versions are available for selection in Go Modules > projects. HCL 2 _cannot_ be imported from Go projects that are not using Go Modules. For more information, see > [our version selection guide](https://github.com/hashicorp/hcl/wiki/Version-Selection). HCL has both a _native syntax_, intended to be pleasant to read and write for humans, and a JSON-based variant that is easier for machines to generate and parse. The HCL native syntax is inspired by [libucl](https://github.com/vstakhov/libucl), [nginx configuration](http://nginx.org/en/docs/beginners_guide.html#conf_structure), and others. It includes an expression syntax that allows basic inline computation and, with support from the calling application, use of variables and functions for more dynamic configuration languages. HCL provides a set of constructs that can be used by a calling application to construct a configuration language. The application defines which attribute names and nested block types are expected, and HCL parses the configuration file, verifies that it conforms to the expected structure, and returns high-level objects that the application can use for further processing. ```go package main import ( "log" "github.com/hashicorp/hcl/v2/hclsimple" ) type Config struct { LogLevel string `hcl:"log_level"` } func main() { var config Config err := hclsimple.DecodeFile("config.hcl", nil, &config) if err != nil { log.Fatalf("Failed to load configuration: %s", err) } log.Printf("Configuration is %#v", config) } ``` A lower-level API is available for applications that need more control over the parsing, decoding, and evaluation of configuration. For more information, see [the package documentation](https://pkg.go.dev/github.com/hashicorp/hcl/v2). ## Why? Newcomers to HCL often ask: why not JSON, YAML, etc? Whereas JSON and YAML are formats for serializing data structures, HCL is a syntax and API specifically designed for building structured configuration formats. HCL attempts to strike a compromise between generic serialization formats such as JSON and configuration formats built around full programming languages such as Ruby. HCL syntax is designed to be easily read and written by humans, and allows _declarative_ logic to permit its use in more complex applications. HCL is intended as a base syntax for configuration formats built around key-value pairs and hierarchical blocks whose structure is well-defined by the calling application, and this definition of the configuration structure allows for better error messages and more convenient definition within the calling application. It can't be denied that JSON is very convenient as a _lingua franca_ for interoperability between different pieces of software. Because of this, HCL defines a common configuration model that can be parsed from either its native syntax or from a well-defined equivalent JSON structure. This allows configuration to be provided as a mixture of human-authored configuration files in the native syntax and machine-generated files in JSON. ## Information Model and Syntax HCL is built around two primary concepts: _attributes_ and _blocks_. In native syntax, a configuration file for a hypothetical application might look something like this: ```hcl io_mode = "async" service "http" "web_proxy" { listen_addr = "127.0.0.1:8080" process "main" { command = ["/usr/local/bin/awesome-app", "server"] } process "mgmt" { command = ["/usr/local/bin/awesome-app", "mgmt"] } } ``` The JSON equivalent of this configuration is the following: ```json { "io_mode": "async", "service": { "http": { "web_proxy": { "listen_addr": "127.0.0.1:8080", "process": { "main": { "command": ["/usr/local/bin/awesome-app", "server"] }, "mgmt": { "command": ["/usr/local/bin/awesome-app", "mgmt"] }, } } } } } ``` Regardless of which syntax is used, the API within the calling application is the same. It can either work directly with the low-level attributes and blocks, for more advanced use-cases, or it can use one of the _decoder_ packages to declaratively extract into either Go structs or dynamic value structures. Attribute values can be expressions as well as just literal values: ```hcl # Arithmetic with literals and application-provided variables sum = 1 + addend # String interpolation and templates message = "Hello, ${name}!" # Application-provided functions shouty_message = upper(message) ``` Although JSON syntax doesn't permit direct use of expressions, the interpolation syntax allows use of arbitrary expressions within JSON strings: ```json { "sum": "${1 + addend}", "message": "Hello, ${name}!", "shouty_message": "${upper(message)}" } ``` For more information, see the detailed specifications: * [Syntax-agnostic Information Model](spec.md) * [HCL Native Syntax](hclsyntax/spec.md) * [JSON Representation](json/spec.md) ## Changes in 2.0 Version 2.0 of HCL combines the features of HCL 1.0 with those of the interpolation language HIL to produce a single configuration language that supports arbitrary expressions. This new version has a completely new parser and Go API, with no direct migration path. Although the syntax is similar, the implementation takes some very different approaches to improve on some "rough edges" that existed with the original implementation and to allow for more robust error handling. It's possible to import both HCL 1 and HCL 2 into the same program using Go's _semantic import versioning_ mechanism: ```go import ( hcl1 "github.com/hashicorp/hcl" hcl2 "github.com/hashicorp/hcl/v2" ) ``` ## Acknowledgements HCL was heavily inspired by [libucl](https://github.com/vstakhov/libucl), by [Vsevolod Stakhov](https://github.com/vstakhov). HCL and HIL originate in [HashiCorp Terraform](https://terraform.io/), with the original parsers for each written by [Mitchell Hashimoto](https://github.com/mitchellh). The original HCL parser was ported to pure Go (from yacc) by [Fatih Arslan](https://github.com/fatih). The structure-related portions of the new native syntax parser build on that work. The original HIL parser was ported to pure Go (from yacc) by [Martin Atkins](https://github.com/apparentlymart). The expression-related portions of the new native syntax parser build on that work. HCL 2, which merged the original HCL and HIL languages into this single new language, builds on design and prototyping work by [Martin Atkins](https://github.com/apparentlymart) in [zcl](https://github.com/zclconf/go-zcl). �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/appveyor.yml������������������������������������0000664�0000000�0000000�00000000303�13771713062�0024460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������build: off clone_folder: c:\gopath\src\github.com\hashicorp\hcl environment: GOPATH: c:\gopath GO111MODULE: on GOPROXY: https://goproxy.io stack: go 1.12 test_script: - go test ./... �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/diagnostic.go�����������������������������������0000664�0000000�0000000�00000011257�13771713062�0024555�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "fmt" ) // DiagnosticSeverity represents the severity of a diagnostic. type DiagnosticSeverity int const ( // DiagInvalid is the invalid zero value of DiagnosticSeverity DiagInvalid DiagnosticSeverity = iota // DiagError indicates that the problem reported by a diagnostic prevents // further progress in parsing and/or evaluating the subject. DiagError // DiagWarning indicates that the problem reported by a diagnostic warrants // user attention but does not prevent further progress. It is most // commonly used for showing deprecation notices. DiagWarning ) // Diagnostic represents information to be presented to a user about an // error or anomaly in parsing or evaluating configuration. type Diagnostic struct { Severity DiagnosticSeverity // Summary and Detail contain the English-language description of the // problem. Summary is a terse description of the general problem and // detail is a more elaborate, often-multi-sentence description of // the problem and what might be done to solve it. Summary string Detail string // Subject and Context are both source ranges relating to the diagnostic. // // Subject is a tight range referring to exactly the construct that // is problematic, while Context is an optional broader range (which should // fully contain Subject) that ought to be shown around Subject when // generating isolated source-code snippets in diagnostic messages. // If Context is nil, the Subject is also the Context. // // Some diagnostics have no source ranges at all. If Context is set then // Subject should always also be set. Subject *Range Context *Range // For diagnostics that occur when evaluating an expression, Expression // may refer to that expression and EvalContext may point to the // EvalContext that was active when evaluating it. This may allow for the // inclusion of additional useful information when rendering a diagnostic // message to the user. // // It is not always possible to select a single EvalContext for a // diagnostic, and so in some cases this field may be nil even when an // expression causes a problem. // // EvalContexts form a tree, so the given EvalContext may refer to a parent // which in turn refers to another parent, etc. For a full picture of all // of the active variables and functions the caller must walk up this // chain, preferring definitions that are "closer" to the expression in // case of colliding names. Expression Expression EvalContext *EvalContext } // Diagnostics is a list of Diagnostic instances. type Diagnostics []*Diagnostic // error implementation, so that diagnostics can be returned via APIs // that normally deal in vanilla Go errors. // // This presents only minimal context about the error, for compatibility // with usual expectations about how errors will present as strings. func (d *Diagnostic) Error() string { return fmt.Sprintf("%s: %s; %s", d.Subject, d.Summary, d.Detail) } // error implementation, so that sets of diagnostics can be returned via // APIs that normally deal in vanilla Go errors. func (d Diagnostics) Error() string { count := len(d) switch { case count == 0: return "no diagnostics" case count == 1: return d[0].Error() default: return fmt.Sprintf("%s, and %d other diagnostic(s)", d[0].Error(), count-1) } } // Append appends a new error to a Diagnostics and return the whole Diagnostics. // // This is provided as a convenience for returning from a function that // collects and then returns a set of diagnostics: // // return nil, diags.Append(&hcl.Diagnostic{ ... }) // // Note that this modifies the array underlying the diagnostics slice, so // must be used carefully within a single codepath. It is incorrect (and rude) // to extend a diagnostics created by a different subsystem. func (d Diagnostics) Append(diag *Diagnostic) Diagnostics { return append(d, diag) } // Extend concatenates the given Diagnostics with the receiver and returns // the whole new Diagnostics. // // This is similar to Append but accepts multiple diagnostics to add. It has // all the same caveats and constraints. func (d Diagnostics) Extend(diags Diagnostics) Diagnostics { return append(d, diags...) } // HasErrors returns true if the receiver contains any diagnostics of // severity DiagError. func (d Diagnostics) HasErrors() bool { for _, diag := range d { if diag.Severity == DiagError { return true } } return false } func (d Diagnostics) Errs() []error { var errs []error for _, diag := range d { if diag.Severity == DiagError { errs = append(errs, diag) } } return errs } // A DiagnosticWriter emits diagnostics somehow. type DiagnosticWriter interface { WriteDiagnostic(*Diagnostic) error WriteDiagnostics(Diagnostics) error } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/diagnostic_text.go������������������������������0000664�0000000�0000000�00000020457�13771713062�0025623�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "bufio" "bytes" "errors" "fmt" "io" "sort" wordwrap "github.com/mitchellh/go-wordwrap" "github.com/zclconf/go-cty/cty" ) type diagnosticTextWriter struct { files map[string]*File wr io.Writer width uint color bool } // NewDiagnosticTextWriter creates a DiagnosticWriter that writes diagnostics // to the given writer as formatted text. // // It is designed to produce text appropriate to print in a monospaced font // in a terminal of a particular width, or optionally with no width limit. // // The given width may be zero to disable word-wrapping of the detail text // and truncation of source code snippets. // // If color is set to true, the output will include VT100 escape sequences to // color-code the severity indicators. It is suggested to turn this off if // the target writer is not a terminal. func NewDiagnosticTextWriter(wr io.Writer, files map[string]*File, width uint, color bool) DiagnosticWriter { return &diagnosticTextWriter{ files: files, wr: wr, width: width, color: color, } } func (w *diagnosticTextWriter) WriteDiagnostic(diag *Diagnostic) error { if diag == nil { return errors.New("nil diagnostic") } var colorCode, highlightCode, resetCode string if w.color { switch diag.Severity { case DiagError: colorCode = "\x1b[31m" case DiagWarning: colorCode = "\x1b[33m" } resetCode = "\x1b[0m" highlightCode = "\x1b[1;4m" } var severityStr string switch diag.Severity { case DiagError: severityStr = "Error" case DiagWarning: severityStr = "Warning" default: // should never happen severityStr = "???????" } fmt.Fprintf(w.wr, "%s%s%s: %s\n\n", colorCode, severityStr, resetCode, diag.Summary) if diag.Subject != nil { snipRange := *diag.Subject highlightRange := snipRange if diag.Context != nil { // Show enough of the source code to include both the subject // and context ranges, which overlap in all reasonable // situations. snipRange = RangeOver(snipRange, *diag.Context) } // We can't illustrate an empty range, so we'll turn such ranges into // single-character ranges, which might not be totally valid (may point // off the end of a line, or off the end of the file) but are good // enough for the bounds checks we do below. if snipRange.Empty() { snipRange.End.Byte++ snipRange.End.Column++ } if highlightRange.Empty() { highlightRange.End.Byte++ highlightRange.End.Column++ } file := w.files[diag.Subject.Filename] if file == nil || file.Bytes == nil { fmt.Fprintf(w.wr, " on %s line %d:\n (source code not available)\n\n", diag.Subject.Filename, diag.Subject.Start.Line) } else { var contextLine string if diag.Subject != nil { contextLine = contextString(file, diag.Subject.Start.Byte) if contextLine != "" { contextLine = ", in " + contextLine } } fmt.Fprintf(w.wr, " on %s line %d%s:\n", diag.Subject.Filename, diag.Subject.Start.Line, contextLine) src := file.Bytes sc := NewRangeScanner(src, diag.Subject.Filename, bufio.ScanLines) for sc.Scan() { lineRange := sc.Range() if !lineRange.Overlaps(snipRange) { continue } beforeRange, highlightedRange, afterRange := lineRange.PartitionAround(highlightRange) if highlightedRange.Empty() { fmt.Fprintf(w.wr, "%4d: %s\n", lineRange.Start.Line, sc.Bytes()) } else { before := beforeRange.SliceBytes(src) highlighted := highlightedRange.SliceBytes(src) after := afterRange.SliceBytes(src) fmt.Fprintf( w.wr, "%4d: %s%s%s%s%s\n", lineRange.Start.Line, before, highlightCode, highlighted, resetCode, after, ) } } w.wr.Write([]byte{'\n'}) } if diag.Expression != nil && diag.EvalContext != nil { // We will attempt to render the values for any variables // referenced in the given expression as additional context, for // situations where the same expression is evaluated multiple // times in different scopes. expr := diag.Expression ctx := diag.EvalContext vars := expr.Variables() stmts := make([]string, 0, len(vars)) seen := make(map[string]struct{}, len(vars)) for _, traversal := range vars { val, diags := traversal.TraverseAbs(ctx) if diags.HasErrors() { // Skip anything that generates errors, since we probably // already have the same error in our diagnostics set // already. continue } traversalStr := w.traversalStr(traversal) if _, exists := seen[traversalStr]; exists { continue // don't show duplicates when the same variable is referenced multiple times } switch { case !val.IsKnown(): // Can't say anything about this yet, then. continue case val.IsNull(): stmts = append(stmts, fmt.Sprintf("%s set to null", traversalStr)) default: stmts = append(stmts, fmt.Sprintf("%s as %s", traversalStr, w.valueStr(val))) } seen[traversalStr] = struct{}{} } sort.Strings(stmts) // FIXME: Should maybe use a traversal-aware sort that can sort numeric indexes properly? last := len(stmts) - 1 for i, stmt := range stmts { switch i { case 0: w.wr.Write([]byte{'w', 'i', 't', 'h', ' '}) default: w.wr.Write([]byte{' ', ' ', ' ', ' ', ' '}) } w.wr.Write([]byte(stmt)) switch i { case last: w.wr.Write([]byte{'.', '\n', '\n'}) default: w.wr.Write([]byte{',', '\n'}) } } } } if diag.Detail != "" { detail := diag.Detail if w.width != 0 { detail = wordwrap.WrapString(detail, w.width) } fmt.Fprintf(w.wr, "%s\n\n", detail) } return nil } func (w *diagnosticTextWriter) WriteDiagnostics(diags Diagnostics) error { for _, diag := range diags { err := w.WriteDiagnostic(diag) if err != nil { return err } } return nil } func (w *diagnosticTextWriter) traversalStr(traversal Traversal) string { // This is a specialized subset of traversal rendering tailored to // producing helpful contextual messages in diagnostics. It is not // comprehensive nor intended to be used for other purposes. var buf bytes.Buffer for _, step := range traversal { switch tStep := step.(type) { case TraverseRoot: buf.WriteString(tStep.Name) case TraverseAttr: buf.WriteByte('.') buf.WriteString(tStep.Name) case TraverseIndex: buf.WriteByte('[') if keyTy := tStep.Key.Type(); keyTy.IsPrimitiveType() { buf.WriteString(w.valueStr(tStep.Key)) } else { // We'll just use a placeholder for more complex values, // since otherwise our result could grow ridiculously long. buf.WriteString("...") } buf.WriteByte(']') } } return buf.String() } func (w *diagnosticTextWriter) valueStr(val cty.Value) string { // This is a specialized subset of value rendering tailored to producing // helpful but concise messages in diagnostics. It is not comprehensive // nor intended to be used for other purposes. ty := val.Type() switch { case val.IsNull(): return "null" case !val.IsKnown(): // Should never happen here because we should filter before we get // in here, but we'll do something reasonable rather than panic. return "(not yet known)" case ty == cty.Bool: if val.True() { return "true" } return "false" case ty == cty.Number: bf := val.AsBigFloat() return bf.Text('g', 10) case ty == cty.String: // Go string syntax is not exactly the same as HCL native string syntax, // but we'll accept the minor edge-cases where this is different here // for now, just to get something reasonable here. return fmt.Sprintf("%q", val.AsString()) case ty.IsCollectionType() || ty.IsTupleType(): l := val.LengthInt() switch l { case 0: return "empty " + ty.FriendlyName() case 1: return ty.FriendlyName() + " with 1 element" default: return fmt.Sprintf("%s with %d elements", ty.FriendlyName(), l) } case ty.IsObjectType(): atys := ty.AttributeTypes() l := len(atys) switch l { case 0: return "object with no attributes" case 1: var name string for k := range atys { name = k } return fmt.Sprintf("object with 1 attribute %q", name) default: return fmt.Sprintf("object with %d attributes", l) } default: return ty.FriendlyName() } } func contextString(file *File, offset int) string { type contextStringer interface { ContextString(offset int) string } if cser, ok := file.Nav.(contextStringer); ok { return cser.ContextString(offset) } return "" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/didyoumean.go�����������������������������������0000664�0000000�0000000�00000001447�13771713062�0024567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "github.com/agext/levenshtein" ) // nameSuggestion tries to find a name from the given slice of suggested names // that is close to the given name and returns it if found. If no suggestion // is close enough, returns the empty string. // // The suggestions are tried in order, so earlier suggestions take precedence // if the given string is similar to two or more suggestions. // // This function is intended to be used with a relatively-small number of // suggestions. It's not optimized for hundreds or thousands of them. func nameSuggestion(given string, suggestions []string) string { for _, suggestion := range suggestions { dist := levenshtein.Distance(given, suggestion, nil) if dist < 3 { // threshold determined experimentally return suggestion } } return "" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/doc.go������������������������������������������0000664�0000000�0000000�00000002233�13771713062�0023170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package hcl contains the main modelling types and general utility functions // for HCL. // // For a simple entry point into HCL, see the package in the subdirectory // "hclsimple", which has an opinionated function Decode that can decode HCL // configurations in either native HCL syntax or JSON syntax into a Go struct // type: // // package main // // import ( // "log" // "github.com/hashicorp/hcl/v2/hclsimple" // ) // // type Config struct { // LogLevel string `hcl:"log_level"` // } // // func main() { // var config Config // err := hclsimple.DecodeFile("config.hcl", nil, &config) // if err != nil { // log.Fatalf("Failed to load configuration: %s", err) // } // log.Printf("Configuration is %#v", config) // } // // If your application needs more control over the evaluation of the // configuration, you can use the functions in the subdirectories hclparse, // gohcl, hcldec, etc. Splitting the handling of configuration into multiple // phases allows for advanced patterns such as allowing expressions in one // part of the configuration to refer to data defined in another part. package hcl ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/eval_context.go���������������������������������0000664�0000000�0000000�00000001204�13771713062�0025113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // An EvalContext provides the variables and functions that should be used // to evaluate an expression. type EvalContext struct { Variables map[string]cty.Value Functions map[string]function.Function parent *EvalContext } // NewChild returns a new EvalContext that is a child of the receiver. func (ctx *EvalContext) NewChild() *EvalContext { return &EvalContext{parent: ctx} } // Parent returns the parent of the receiver, or nil if the receiver has // no parent. func (ctx *EvalContext) Parent() *EvalContext { return ctx.parent } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/expr_call.go������������������������������������0000664�0000000�0000000�00000002612�13771713062�0024375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl // ExprCall tests if the given expression is a function call and, // if so, extracts the function name and the expressions that represent // the arguments. If the given expression is not statically a function call, // error diagnostics are returned. // // A particular Expression implementation can support this function by // offering a method called ExprCall that takes no arguments and returns // *StaticCall. This method should return nil if a static call cannot // be extracted. Alternatively, an implementation can support // UnwrapExpression to delegate handling of this function to a wrapped // Expression object. func ExprCall(expr Expression) (*StaticCall, Diagnostics) { type exprCall interface { ExprCall() *StaticCall } physExpr := UnwrapExpressionUntil(expr, func(expr Expression) bool { _, supported := expr.(exprCall) return supported }) if exC, supported := physExpr.(exprCall); supported { if call := exC.ExprCall(); call != nil { return call, nil } } return nil, Diagnostics{ &Diagnostic{ Severity: DiagError, Summary: "Invalid expression", Detail: "A static function call is required.", Subject: expr.StartRange().Ptr(), }, } } // StaticCall represents a function call that was extracted statically from // an expression using ExprCall. type StaticCall struct { Name string NameRange Range Arguments []Expression ArgsRange Range } ����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/expr_list.go������������������������������������0000664�0000000�0000000�00000002243�13771713062�0024435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl // ExprList tests if the given expression is a static list construct and, // if so, extracts the expressions that represent the list elements. // If the given expression is not a static list, error diagnostics are // returned. // // A particular Expression implementation can support this function by // offering a method called ExprList that takes no arguments and returns // []Expression. This method should return nil if a static list cannot // be extracted. Alternatively, an implementation can support // UnwrapExpression to delegate handling of this function to a wrapped // Expression object. func ExprList(expr Expression) ([]Expression, Diagnostics) { type exprList interface { ExprList() []Expression } physExpr := UnwrapExpressionUntil(expr, func(expr Expression) bool { _, supported := expr.(exprList) return supported }) if exL, supported := physExpr.(exprList); supported { if list := exL.ExprList(); list != nil { return list, nil } } return nil, Diagnostics{ &Diagnostic{ Severity: DiagError, Summary: "Invalid expression", Detail: "A static list expression is required.", Subject: expr.StartRange().Ptr(), }, } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/expr_map.go�������������������������������������0000664�0000000�0000000�00000002536�13771713062�0024244�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl // ExprMap tests if the given expression is a static map construct and, // if so, extracts the expressions that represent the map elements. // If the given expression is not a static map, error diagnostics are // returned. // // A particular Expression implementation can support this function by // offering a method called ExprMap that takes no arguments and returns // []KeyValuePair. This method should return nil if a static map cannot // be extracted. Alternatively, an implementation can support // UnwrapExpression to delegate handling of this function to a wrapped // Expression object. func ExprMap(expr Expression) ([]KeyValuePair, Diagnostics) { type exprMap interface { ExprMap() []KeyValuePair } physExpr := UnwrapExpressionUntil(expr, func(expr Expression) bool { _, supported := expr.(exprMap) return supported }) if exM, supported := physExpr.(exprMap); supported { if pairs := exM.ExprMap(); pairs != nil { return pairs, nil } } return nil, Diagnostics{ &Diagnostic{ Severity: DiagError, Summary: "Invalid expression", Detail: "A static map expression is required.", Subject: expr.StartRange().Ptr(), }, } } // KeyValuePair represents a pair of expressions that serve as a single item // within a map or object definition construct. type KeyValuePair struct { Key Expression Value Expression } ������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/expr_unwrap.go����������������������������������0000664�0000000�0000000�00000004711�13771713062�0025000�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl type unwrapExpression interface { UnwrapExpression() Expression } // UnwrapExpression removes any "wrapper" expressions from the given expression, // to recover the representation of the physical expression given in source // code. // // Sometimes wrapping expressions are used to modify expression behavior, e.g. // in extensions that need to make some local variables available to certain // sub-trees of the configuration. This can make it difficult to reliably // type-assert on the physical AST types used by the underlying syntax. // // Unwrapping an expression may modify its behavior by stripping away any // additional constraints or capabilities being applied to the Value and // Variables methods, so this function should generally only be used prior // to operations that concern themselves with the static syntax of the input // configuration, and not with the effective value of the expression. // // Wrapper expression types must support unwrapping by implementing a method // called UnwrapExpression that takes no arguments and returns the embedded // Expression. Implementations of this method should peel away only one level // of wrapping, if multiple are present. This method may return nil to // indicate _dynamically_ that no wrapped expression is available, for // expression types that might only behave as wrappers in certain cases. func UnwrapExpression(expr Expression) Expression { for { unwrap, wrapped := expr.(unwrapExpression) if !wrapped { return expr } innerExpr := unwrap.UnwrapExpression() if innerExpr == nil { return expr } expr = innerExpr } } // UnwrapExpressionUntil is similar to UnwrapExpression except it gives the // caller an opportunity to test each level of unwrapping to see each a // particular expression is accepted. // // This could be used, for example, to unwrap until a particular other // interface is satisfied, regardless of wrap wrapping level it is satisfied // at. // // The given callback function must return false to continue wrapping, or // true to accept and return the proposed expression given. If the callback // function rejects even the final, physical expression then the result of // this function is nil. func UnwrapExpressionUntil(expr Expression, until func(Expression) bool) Expression { for { if until(expr) { return expr } unwrap, wrapped := expr.(unwrapExpression) if !wrapped { return nil } expr = unwrap.UnwrapExpression() if expr == nil { return nil } } } �������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/��������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022674�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/customdecode/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025352�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/customdecode/README.md����������������������0000664�0000000�0000000�00000021572�13771713062�0026640�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL Custom Static Decoding Extension This HCL extension provides a mechanism for defining arguments in an HCL-based language whose values are derived using custom decoding rules against the HCL expression syntax, overriding the usual behavior of normal expression evaluation. "Arguments", for the purpose of this extension, currently includes the following two contexts: * For applications using `hcldec` for dynamic decoding, a `hcldec.AttrSpec` or `hcldec.BlockAttrsSpec` can be given a special type constraint that opts in to custom decoding behavior for the attribute(s) that are selected by that specification. * When working with the HCL native expression syntax, a function given in the `hcl.EvalContext` during evaluation can have parameters with special type constraints that opt in to custom decoding behavior for the argument expression associated with that parameter in any call. The above use-cases are rather abstract, so we'll consider a motivating real-world example: sometimes we (language designers) need to allow users to specify type constraints directly in the language itself, such as in [Terraform's Input Variables](https://www.terraform.io/docs/configuration/variables.html). Terraform's `variable` blocks include an argument called `type` which takes a type constraint given using HCL expression building-blocks as defined by [the HCL `typeexpr` extension](../typeexpr/README.md). A "type constraint expression" of that sort is not an expression intended to be evaluated in the usual way. Instead, the physical expression is deconstructed using [the static analysis operations](../../spec.md#static-analysis) to produce a `cty.Type` as the result, rather than a `cty.Value`. The purpose of this Custom Static Decoding Extension, then, is to provide a bridge to allow that sort of custom decoding to be used via mechanisms that normally deal in `cty.Value`, such as `hcldec` and native syntax function calls as listed above. (Note: [`gohcl`](https://pkg.go.dev/github.com/hashicorp/hcl/v2/gohcl) has its own mechanism to support this use case, exploiting the fact that it is working directly with "normal" Go types. Decoding into a struct field of type `hcl.Expression` obtains the expression directly without evaluating it first. The Custom Static Decoding Extension is not necessary for that `gohcl` technique. You can also implement custom decoding by working directly with the lowest-level HCL API, which separates extraction of and evaluation of expressions into two steps.) ## Custom Decoding Types This extension relies on a convention implemented in terms of [_Capsule Types_ in the underlying `cty` type system](https://github.com/zclconf/go-cty/blob/master/docs/types.md#capsule-types). `cty` allows a capsule type to carry arbitrary extension metadata values as an aid to creating higher-level abstractions like this extension. A custom argument decoding mode, then, is implemented by creating a new `cty` capsule type that implements the `ExtensionData` custom operation to return a decoding function when requested. For example: ```go var keywordType cty.Type keywordType = cty.CapsuleWithOps("keyword", reflect.TypeOf(""), &cty.CapsuleOps{ ExtensionData: func(key interface{}) interface{} { switch key { case customdecode.CustomExpressionDecoder: return customdecode.CustomExpressionDecoderFunc( func(expr hcl.Expression, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics kw := hcl.ExprAsKeyword(expr) if kw == "" { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid keyword", Detail: "A keyword is required", Subject: expr.Range().Ptr(), }) return cty.UnkownVal(keywordType), diags } return cty.CapsuleVal(keywordType, &kw) }, ) default: return nil } }, }) ``` The boilerplate here is a bit fussy, but the important part for our purposes is the `case customdecode.CustomExpressionDecoder:` clause, which uses a custom extension key type defined in this package to recognize when a component implementing this extension is checking to see if a target type has a custom decode implementation. In the above case we've defined a type that decodes expressions as static keywords, so a keyword like `foo` would decode as an encapsulated `"foo"` string, while any other sort of expression like `"baz"` or `1 + 1` would return an error. We could then use `keywordType` as a type constraint either for a function parameter or a `hcldec` attribute specification, which would require the argument for that function parameter or the expression for the matching attributes to be a static keyword, rather than an arbitrary expression. For example, in a `hcldec.AttrSpec`: ```go keywordSpec := &hcldec.AttrSpec{ Name: "keyword", Type: keywordType, } ``` The above would accept input like the following and would set its result to a `cty.Value` of `keywordType`, after decoding: ```hcl keyword = foo ``` ## The Expression and Expression Closure `cty` types Building on the above, this package also includes two capsule types that use the above mechanism to allow calling applications to capture expressions directly and thus defer analysis to a later step, after initial decoding. The `customdecode.ExpressionType` type encapsulates an `hcl.Expression` alone, for situations like our type constraint expression example above where it's the static structure of the expression we want to inspect, and thus any variables and functions defined in the evaluation context are irrelevant. The `customdecode.ExpressionClosureType` type encapsulates a `*customdecode.ExpressionClosure` value, which binds the given expression to the `hcl.EvalContext` it was asked to evaluate against and thus allows the receiver of that result to later perform normal evaluation of the expression with all the same variables and functions that would've been available to it naturally. Both of these types can be used as type constraints either for `hcldec` attribute specifications or for function arguments. Here's an example of `ExpressionClosureType` to implement a function that can evaluate an expression with some additional variables defined locally, which we'll call the `with(...)` function: ```go var WithFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "variables", Type: cty.DynamicPseudoType, }, { Name: "expression", Type: customdecode.ExpressionClosureType, }, }, Type: func(args []cty.Value) (cty.Type, error) { varsVal := args[0] exprVal := args[1] if !varsVal.Type().IsObjectType() { return cty.NilVal, function.NewArgErrorf(0, "must be an object defining local variables") } if !varsVal.IsKnown() { // We can't predict our result type until the variables object // is known. return cty.DynamicPseudoType, nil } vars := varsVal.AsValueMap() closure := customdecode.ExpressionClosureFromVal(exprVal) result, err := evalWithLocals(vars, closure) if err != nil { return cty.NilVal, err } return result.Type(), nil }, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { varsVal := args[0] exprVal := args[1] vars := varsVal.AsValueMap() closure := customdecode.ExpressionClosureFromVal(exprVal) return evalWithLocals(vars, closure) }, }) func evalWithLocals(locals map[string]cty.Value, closure *customdecode.ExpressionClosure) (cty.Value, error) { childCtx := closure.EvalContext.NewChild() childCtx.Variables = locals val, diags := closure.Expression.Value(childCtx) if diags.HasErrors() { return cty.NilVal, function.NewArgErrorf(1, "couldn't evaluate expression: %s", diags.Error()) } return val, nil } ``` If the above function were placed into an `hcl.EvalContext` as `with`, it could be used in a native syntax call to that function as follows: ```hcl foo = with({name = "Cory"}, "${greeting}, ${name}!") ``` The above assumes a variable in the main context called `greeting`, to which the `with` function adds `name` before evaluating the expression given in its second argument. This makes that second argument context-sensitive -- it would behave differently if the user wrote the same thing somewhere else -- so this capability should be used with care to make sure it doesn't cause confusion for the end-users of your language. There are some other examples of this capability to evaluate expressions in unusual ways in the `tryfunc` directory that is a sibling of this one. ��������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/customdecode/customdecode.go����������������0000664�0000000�0000000�00000004662�13771713062�0030367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package customdecode contains a HCL extension that allows, in certain // contexts, expression evaluation to be overridden by custom static analysis. // // This mechanism is only supported in certain specific contexts where // expressions are decoded with a specific target type in mind. For more // information, see the documentation on CustomExpressionDecoder. package customdecode import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) type customDecoderImpl int // CustomExpressionDecoder is a value intended to be used as a cty capsule // type ExtensionData key for capsule types whose values are to be obtained // by static analysis of an expression rather than normal evaluation of that // expression. // // When a cooperating capsule type is asked for ExtensionData with this key, // it must return a non-nil CustomExpressionDecoderFunc value. // // This mechanism is not universally supported; instead, it's handled in a few // specific places where expressions are evaluated with the intent of producing // a cty.Value of a type given by the calling application. // // Specifically, this currently works for type constraints given in // hcldec.AttrSpec and hcldec.BlockAttrsSpec, and it works for arguments to // function calls in the HCL native syntax. HCL extensions implemented outside // of the main HCL module may also implement this; consult their own // documentation for details. const CustomExpressionDecoder = customDecoderImpl(1) // CustomExpressionDecoderFunc is the type of value that must be returned by // a capsule type handling the key CustomExpressionDecoder in its ExtensionData // implementation. // // If no error diagnostics are returned, the result value MUST be of the // capsule type that the decoder function was derived from. If the returned // error diagnostics prevent producing a value at all, return cty.NilVal. type CustomExpressionDecoderFunc func(expr hcl.Expression, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) // CustomExpressionDecoderForType takes any cty type and returns its // custom expression decoder implementation if it has one. If it is not a // capsule type or it does not implement a custom expression decoder, this // function returns nil. func CustomExpressionDecoderForType(ty cty.Type) CustomExpressionDecoderFunc { if !ty.IsCapsuleType() { return nil } if fn, ok := ty.CapsuleExtensionData(CustomExpressionDecoder).(CustomExpressionDecoderFunc); ok { return fn } return nil } ������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/customdecode/expression_type.go�������������0000664�0000000�0000000�00000012323�13771713062�0031142�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package customdecode import ( "fmt" "reflect" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) // ExpressionType is a cty capsule type that carries hcl.Expression values. // // This type implements custom decoding in the most general way possible: it // just captures whatever expression is given to it, with no further processing // whatsoever. It could therefore be useful in situations where an application // must defer processing of the expression content until a later step. // // ExpressionType only captures the expression, not the evaluation context it // was destined to be evaluated in. That means this type can be fine for // situations where the recipient of the value only intends to do static // analysis, but ExpressionClosureType is more appropriate in situations where // the recipient will eventually evaluate the given expression. var ExpressionType cty.Type // ExpressionVal returns a new cty value of type ExpressionType, wrapping the // given expression. func ExpressionVal(expr hcl.Expression) cty.Value { return cty.CapsuleVal(ExpressionType, &expr) } // ExpressionFromVal returns the expression encapsulated in the given value, or // panics if the value is not a known value of ExpressionType. func ExpressionFromVal(v cty.Value) hcl.Expression { if !v.Type().Equals(ExpressionType) { panic("value is not of ExpressionType") } ptr := v.EncapsulatedValue().(*hcl.Expression) return *ptr } // ExpressionClosureType is a cty capsule type that carries hcl.Expression // values along with their original evaluation contexts. // // This is similar to ExpressionType except that during custom decoding it // also captures the hcl.EvalContext that was provided, allowing callers to // evaluate the expression later in the same context where it would originally // have been evaluated, or a context derived from that one. var ExpressionClosureType cty.Type // ExpressionClosure is the type encapsulated in ExpressionClosureType type ExpressionClosure struct { Expression hcl.Expression EvalContext *hcl.EvalContext } // ExpressionClosureVal returns a new cty value of type ExpressionClosureType, // wrapping the given expression closure. func ExpressionClosureVal(closure *ExpressionClosure) cty.Value { return cty.CapsuleVal(ExpressionClosureType, closure) } // Value evaluates the closure's expression using the closure's EvalContext, // returning the result. func (c *ExpressionClosure) Value() (cty.Value, hcl.Diagnostics) { return c.Expression.Value(c.EvalContext) } // ExpressionClosureFromVal returns the expression closure encapsulated in the // given value, or panics if the value is not a known value of // ExpressionClosureType. // // The caller MUST NOT modify the returned closure or the EvalContext inside // it. To derive a new EvalContext, either create a child context or make // a copy. func ExpressionClosureFromVal(v cty.Value) *ExpressionClosure { if !v.Type().Equals(ExpressionClosureType) { panic("value is not of ExpressionClosureType") } return v.EncapsulatedValue().(*ExpressionClosure) } func init() { // Getting hold of a reflect.Type for hcl.Expression is a bit tricky because // it's an interface type, but we can do it with some indirection. goExpressionType := reflect.TypeOf((*hcl.Expression)(nil)).Elem() ExpressionType = cty.CapsuleWithOps("expression", goExpressionType, &cty.CapsuleOps{ ExtensionData: func(key interface{}) interface{} { switch key { case CustomExpressionDecoder: return CustomExpressionDecoderFunc( func(expr hcl.Expression, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return ExpressionVal(expr), nil }, ) default: return nil } }, TypeGoString: func(_ reflect.Type) string { return "customdecode.ExpressionType" }, GoString: func(raw interface{}) string { exprPtr := raw.(*hcl.Expression) return fmt.Sprintf("customdecode.ExpressionVal(%#v)", *exprPtr) }, RawEquals: func(a, b interface{}) bool { aPtr := a.(*hcl.Expression) bPtr := b.(*hcl.Expression) return reflect.DeepEqual(*aPtr, *bPtr) }, }) ExpressionClosureType = cty.CapsuleWithOps("expression closure", reflect.TypeOf(ExpressionClosure{}), &cty.CapsuleOps{ ExtensionData: func(key interface{}) interface{} { switch key { case CustomExpressionDecoder: return CustomExpressionDecoderFunc( func(expr hcl.Expression, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return ExpressionClosureVal(&ExpressionClosure{ Expression: expr, EvalContext: ctx, }), nil }, ) default: return nil } }, TypeGoString: func(_ reflect.Type) string { return "customdecode.ExpressionClosureType" }, GoString: func(raw interface{}) string { closure := raw.(*ExpressionClosure) return fmt.Sprintf("customdecode.ExpressionClosureVal(%#v)", closure) }, RawEquals: func(a, b interface{}) bool { closureA := a.(*ExpressionClosure) closureB := b.(*ExpressionClosure) // The expression itself compares by deep equality, but EvalContexts // conventionally compare by pointer identity, so we'll comply // with both conventions here by testing them separately. return closureA.EvalContext == closureB.EvalContext && reflect.DeepEqual(closureA.Expression, closureB.Expression) }, }) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/�����������������������������������0000775�0000000�0000000�00000000000�13771713062�0024501�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/README.md��������������������������0000664�0000000�0000000�00000014457�13771713062�0025773�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL Dynamic Blocks Extension This HCL extension implements a special block type named "dynamic" that can be used to dynamically generate blocks of other types by iterating over collection values. Normally the block structure in an HCL configuration file is rigid, even though dynamic expressions can be used within attribute values. This is convenient for most applications since it allows the overall structure of the document to be decoded easily, but in some applications it is desirable to allow dynamic block generation within certain portions of the configuration. Dynamic block generation is performed using the `dynamic` block type: ```hcl toplevel { nested { foo = "static block 1" } dynamic "nested" { for_each = ["a", "b", "c"] iterator = nested content { foo = "dynamic block ${nested.value}" } } nested { foo = "static block 2" } } ``` The above is interpreted as if it were written as follows: ```hcl toplevel { nested { foo = "static block 1" } nested { foo = "dynamic block a" } nested { foo = "dynamic block b" } nested { foo = "dynamic block c" } nested { foo = "static block 2" } } ``` Since HCL block syntax is not normally exposed to the possibility of unknown values, this extension must make some compromises when asked to iterate over an unknown collection. If the length of the collection cannot be statically recognized (because it is an unknown value of list, map, or set type) then the `dynamic` construct will generate a _single_ dynamic block whose iterator key and value are both unknown values of the dynamic pseudo-type, thus causing any attribute values derived from iteration to appear as unknown values. There is no explicit representation of the fact that the length of the collection may eventually be different than one. ## Usage Pass a body to function `Expand` to obtain a new body that will, on access to its content, evaluate and expand any nested `dynamic` blocks. Dynamic block processing is also automatically propagated into any nested blocks that are returned, allowing users to nest dynamic blocks inside one another and to nest dynamic blocks inside other static blocks. HCL structural decoding does not normally have access to an `EvalContext`, so any variables and functions that should be available to the `for_each` and `labels` expressions must be passed in when calling `Expand`. Expressions within the `content` block are evaluated separately and so can be passed a separate `EvalContext` if desired, during normal attribute expression evaluation. ## Detecting Variables Some applications dynamically generate an `EvalContext` by analyzing which variables are referenced by an expression before evaluating it. This unfortunately requires some extra effort when this analysis is required for the context passed to `Expand`: the HCL API requires a schema to be provided in order to do any analysis of the blocks in a body, but the low-level schema model provides a description of only one level of nested blocks at a time, and thus a new schema must be provided for each additional level of nesting. To make this arduous process as convenient as possible, this package provides a helper function `WalkForEachVariables`, which returns a `WalkVariablesNode` instance that can be used to find variables directly in a given body and also determine which nested blocks require recursive calls. Using this mechanism requires that the caller be able to look up a schema given a nested block type. For _simple_ formats where a specific block type name always has the same schema regardless of context, a walk can be implemented as follows: ```go func walkVariables(node dynblock.WalkVariablesNode, schema *hcl.BodySchema) []hcl.Traversal { vars, children := node.Visit(schema) for _, child := range children { var childSchema *hcl.BodySchema switch child.BlockTypeName { case "a": childSchema = &hcl.BodySchema{ Blocks: []hcl.BlockHeaderSchema{ { Type: "b", LabelNames: []string{"key"}, }, }, } case "b": childSchema = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { Name: "val", Required: true, }, }, } default: // Should never happen, because the above cases should be exhaustive // for the application's configuration format. panic(fmt.Errorf("can't find schema for unknown block type %q", child.BlockTypeName)) } vars = append(vars, testWalkAndAccumVars(child.Node, childSchema)...) } } ``` ### Detecting Variables with `hcldec` Specifications For applications that use the higher-level `hcldec` package to decode nested configuration structures into `cty` values, the same specification can be used to automatically drive the recursive variable-detection walk described above. The helper function `ForEachVariablesHCLDec` allows an entire recursive configuration structure to be analyzed in a single call given a `hcldec.Spec` that describes the nested block structure. This means a `hcldec`-based application can support dynamic blocks with only a little additional effort: ```go func decodeBody(body hcl.Body, spec hcldec.Spec) (cty.Value, hcl.Diagnostics) { // Determine which variables are needed to expand dynamic blocks neededForDynamic := dynblock.ForEachVariablesHCLDec(body, spec) // Build a suitable EvalContext and expand dynamic blocks dynCtx := buildEvalContext(neededForDynamic) dynBody := dynblock.Expand(body, dynCtx) // Determine which variables are needed to fully decode the expanded body // This will analyze expressions that came both from static blocks in the // original body and from blocks that were dynamically added by Expand. neededForDecode := hcldec.Variables(dynBody, spec) // Build a suitable EvalContext and then fully decode the body as per the // hcldec specification. decCtx := buildEvalContext(neededForDecode) return hcldec.Decode(dynBody, spec, decCtx) } func buildEvalContext(needed []hcl.Traversal) *hcl.EvalContext { // (to be implemented by your application) } ``` # Performance This extension is going quite harshly against the grain of the HCL API, and so it uses lots of wrapping objects and temporary data structures to get its work done. HCL in general is not suitable for use in high-performance situations or situations sensitive to memory pressure, but that is _especially_ true for this extension. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_body.go���������������������0000664�0000000�0000000�00000021330�13771713062�0027323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import ( "fmt" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) // expandBody wraps another hcl.Body and expands any "dynamic" blocks found // inside whenever Content or PartialContent is called. type expandBody struct { original hcl.Body forEachCtx *hcl.EvalContext iteration *iteration // non-nil if we're nested inside another "dynamic" block // These are used with PartialContent to produce a "remaining items" // body to return. They are nil on all bodies fresh out of the transformer. // // Note that this is re-implemented here rather than delegating to the // existing support required by the underlying body because we need to // retain access to the entire original body on subsequent decode operations // so we can retain any "dynamic" blocks for types we didn't take consume // on the first pass. hiddenAttrs map[string]struct{} hiddenBlocks map[string]hcl.BlockHeaderSchema } func (b *expandBody) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { extSchema := b.extendSchema(schema) rawContent, diags := b.original.Content(extSchema) blocks, blockDiags := b.expandBlocks(schema, rawContent.Blocks, false) diags = append(diags, blockDiags...) attrs := b.prepareAttributes(rawContent.Attributes) content := &hcl.BodyContent{ Attributes: attrs, Blocks: blocks, MissingItemRange: b.original.MissingItemRange(), } return content, diags } func (b *expandBody) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) { extSchema := b.extendSchema(schema) rawContent, _, diags := b.original.PartialContent(extSchema) // We discard the "remain" argument above because we're going to construct // our own remain that also takes into account remaining "dynamic" blocks. blocks, blockDiags := b.expandBlocks(schema, rawContent.Blocks, true) diags = append(diags, blockDiags...) attrs := b.prepareAttributes(rawContent.Attributes) content := &hcl.BodyContent{ Attributes: attrs, Blocks: blocks, MissingItemRange: b.original.MissingItemRange(), } remain := &expandBody{ original: b.original, forEachCtx: b.forEachCtx, iteration: b.iteration, hiddenAttrs: make(map[string]struct{}), hiddenBlocks: make(map[string]hcl.BlockHeaderSchema), } for name := range b.hiddenAttrs { remain.hiddenAttrs[name] = struct{}{} } for typeName, blockS := range b.hiddenBlocks { remain.hiddenBlocks[typeName] = blockS } for _, attrS := range schema.Attributes { remain.hiddenAttrs[attrS.Name] = struct{}{} } for _, blockS := range schema.Blocks { remain.hiddenBlocks[blockS.Type] = blockS } return content, remain, diags } func (b *expandBody) extendSchema(schema *hcl.BodySchema) *hcl.BodySchema { // We augment the requested schema to also include our special "dynamic" // block type, since then we'll get instances of it interleaved with // all of the literal child blocks we must also include. extSchema := &hcl.BodySchema{ Attributes: schema.Attributes, Blocks: make([]hcl.BlockHeaderSchema, len(schema.Blocks), len(schema.Blocks)+len(b.hiddenBlocks)+1), } copy(extSchema.Blocks, schema.Blocks) extSchema.Blocks = append(extSchema.Blocks, dynamicBlockHeaderSchema) // If we have any hiddenBlocks then we also need to register those here // so that a call to "Content" on the underlying body won't fail. // (We'll filter these out again once we process the result of either // Content or PartialContent.) for _, blockS := range b.hiddenBlocks { extSchema.Blocks = append(extSchema.Blocks, blockS) } // If we have any hiddenAttrs then we also need to register these, for // the same reason as we deal with hiddenBlocks above. if len(b.hiddenAttrs) != 0 { newAttrs := make([]hcl.AttributeSchema, len(schema.Attributes), len(schema.Attributes)+len(b.hiddenAttrs)) copy(newAttrs, extSchema.Attributes) for name := range b.hiddenAttrs { newAttrs = append(newAttrs, hcl.AttributeSchema{ Name: name, Required: false, }) } extSchema.Attributes = newAttrs } return extSchema } func (b *expandBody) prepareAttributes(rawAttrs hcl.Attributes) hcl.Attributes { if len(b.hiddenAttrs) == 0 && b.iteration == nil { // Easy path: just pass through the attrs from the original body verbatim return rawAttrs } // Otherwise we have some work to do: we must filter out any attributes // that are hidden (since a previous PartialContent call already saw these) // and wrap the expressions of the inner attributes so that they will // have access to our iteration variables. attrs := make(hcl.Attributes, len(rawAttrs)) for name, rawAttr := range rawAttrs { if _, hidden := b.hiddenAttrs[name]; hidden { continue } if b.iteration != nil { attr := *rawAttr // shallow copy so we can mutate it attr.Expr = exprWrap{ Expression: attr.Expr, i: b.iteration, } attrs[name] = &attr } else { // If we have no active iteration then no wrapping is required. attrs[name] = rawAttr } } return attrs } func (b *expandBody) expandBlocks(schema *hcl.BodySchema, rawBlocks hcl.Blocks, partial bool) (hcl.Blocks, hcl.Diagnostics) { var blocks hcl.Blocks var diags hcl.Diagnostics for _, rawBlock := range rawBlocks { switch rawBlock.Type { case "dynamic": realBlockType := rawBlock.Labels[0] if _, hidden := b.hiddenBlocks[realBlockType]; hidden { continue } var blockS *hcl.BlockHeaderSchema for _, candidate := range schema.Blocks { if candidate.Type == realBlockType { blockS = &candidate break } } if blockS == nil { // Not a block type that the caller requested. if !partial { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsupported block type", Detail: fmt.Sprintf("Blocks of type %q are not expected here.", realBlockType), Subject: &rawBlock.LabelRanges[0], }) } continue } spec, specDiags := b.decodeSpec(blockS, rawBlock) diags = append(diags, specDiags...) if specDiags.HasErrors() { continue } if spec.forEachVal.IsKnown() { for it := spec.forEachVal.ElementIterator(); it.Next(); { key, value := it.Element() i := b.iteration.MakeChild(spec.iteratorName, key, value) block, blockDiags := spec.newBlock(i, b.forEachCtx) diags = append(diags, blockDiags...) if block != nil { // Attach our new iteration context so that attributes // and other nested blocks can refer to our iterator. block.Body = b.expandChild(block.Body, i) blocks = append(blocks, block) } } } else { // If our top-level iteration value isn't known then we're forced // to compromise since HCL doesn't have any concept of an // "unknown block". In this case then, we'll produce a single // dynamic block with the iterator values set to DynamicVal, // which at least makes the potential for a block visible // in our result, even though it's not represented in a fully-accurate // way. i := b.iteration.MakeChild(spec.iteratorName, cty.DynamicVal, cty.DynamicVal) block, blockDiags := spec.newBlock(i, b.forEachCtx) diags = append(diags, blockDiags...) if block != nil { block.Body = b.expandChild(block.Body, i) // We additionally force all of the leaf attribute values // in the result to be unknown so the calling application // can, if necessary, use that as a heuristic to detect // when a single nested block might be standing in for // multiple blocks yet to be expanded. This retains the // structure of the generated body but forces all of its // leaf attribute values to be unknown. block.Body = unknownBody{block.Body} blocks = append(blocks, block) } } default: if _, hidden := b.hiddenBlocks[rawBlock.Type]; !hidden { // A static block doesn't create a new iteration context, but // it does need to inherit _our own_ iteration context in // case it contains expressions that refer to our inherited // iterators, or nested "dynamic" blocks. expandedBlock := *rawBlock // shallow copy expandedBlock.Body = b.expandChild(rawBlock.Body, b.iteration) blocks = append(blocks, &expandedBlock) } } } return blocks, diags } func (b *expandBody) expandChild(child hcl.Body, i *iteration) hcl.Body { chiCtx := i.EvalContext(b.forEachCtx) ret := Expand(child, chiCtx) ret.(*expandBody).iteration = i return ret } func (b *expandBody) JustAttributes() (hcl.Attributes, hcl.Diagnostics) { // blocks aren't allowed in JustAttributes mode and this body can // only produce blocks, so we'll just pass straight through to our // underlying body here. return b.original.JustAttributes() } func (b *expandBody) MissingItemRange() hcl.Range { return b.original.MissingItemRange() } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_spec.go���������������������0000664�0000000�0000000�00000014710�13771713062�0027324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import ( "fmt" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) type expandSpec struct { blockType string blockTypeRange hcl.Range defRange hcl.Range forEachVal cty.Value iteratorName string labelExprs []hcl.Expression contentBody hcl.Body inherited map[string]*iteration } func (b *expandBody) decodeSpec(blockS *hcl.BlockHeaderSchema, rawSpec *hcl.Block) (*expandSpec, hcl.Diagnostics) { var diags hcl.Diagnostics var schema *hcl.BodySchema if len(blockS.LabelNames) != 0 { schema = dynamicBlockBodySchemaLabels } else { schema = dynamicBlockBodySchemaNoLabels } specContent, specDiags := rawSpec.Body.Content(schema) diags = append(diags, specDiags...) if specDiags.HasErrors() { return nil, diags } //// for_each attribute eachAttr := specContent.Attributes["for_each"] eachVal, eachDiags := eachAttr.Expr.Value(b.forEachCtx) diags = append(diags, eachDiags...) if !eachVal.CanIterateElements() && eachVal.Type() != cty.DynamicPseudoType { // We skip this error for DynamicPseudoType because that means we either // have a null (which is checked immediately below) or an unknown // (which is handled in the expandBody Content methods). diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid dynamic for_each value", Detail: fmt.Sprintf("Cannot use a %s value in for_each. An iterable collection is required.", eachVal.Type().FriendlyName()), Subject: eachAttr.Expr.Range().Ptr(), Expression: eachAttr.Expr, EvalContext: b.forEachCtx, }) return nil, diags } if eachVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid dynamic for_each value", Detail: "Cannot use a null value in for_each.", Subject: eachAttr.Expr.Range().Ptr(), Expression: eachAttr.Expr, EvalContext: b.forEachCtx, }) return nil, diags } //// iterator attribute iteratorName := blockS.Type if iteratorAttr := specContent.Attributes["iterator"]; iteratorAttr != nil { itTraversal, itDiags := hcl.AbsTraversalForExpr(iteratorAttr.Expr) diags = append(diags, itDiags...) if itDiags.HasErrors() { return nil, diags } if len(itTraversal) != 1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid dynamic iterator name", Detail: "Dynamic iterator must be a single variable name.", Subject: itTraversal.SourceRange().Ptr(), }) return nil, diags } iteratorName = itTraversal.RootName() } var labelExprs []hcl.Expression if labelsAttr := specContent.Attributes["labels"]; labelsAttr != nil { var labelDiags hcl.Diagnostics labelExprs, labelDiags = hcl.ExprList(labelsAttr.Expr) diags = append(diags, labelDiags...) if labelDiags.HasErrors() { return nil, diags } if len(labelExprs) > len(blockS.LabelNames) { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Extraneous dynamic block label", Detail: fmt.Sprintf("Blocks of type %q require %d label(s).", blockS.Type, len(blockS.LabelNames)), Subject: labelExprs[len(blockS.LabelNames)].Range().Ptr(), }) return nil, diags } else if len(labelExprs) < len(blockS.LabelNames) { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Insufficient dynamic block labels", Detail: fmt.Sprintf("Blocks of type %q require %d label(s).", blockS.Type, len(blockS.LabelNames)), Subject: labelsAttr.Expr.Range().Ptr(), }) return nil, diags } } // Since our schema requests only blocks of type "content", we can assume // that all entries in specContent.Blocks are content blocks. if len(specContent.Blocks) == 0 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing dynamic content block", Detail: "A dynamic block must have a nested block of type \"content\" to describe the body of each generated block.", Subject: &specContent.MissingItemRange, }) return nil, diags } if len(specContent.Blocks) > 1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Extraneous dynamic content block", Detail: "Only one nested content block is allowed for each dynamic block.", Subject: &specContent.Blocks[1].DefRange, }) return nil, diags } return &expandSpec{ blockType: blockS.Type, blockTypeRange: rawSpec.LabelRanges[0], defRange: rawSpec.DefRange, forEachVal: eachVal, iteratorName: iteratorName, labelExprs: labelExprs, contentBody: specContent.Blocks[0].Body, }, diags } func (s *expandSpec) newBlock(i *iteration, ctx *hcl.EvalContext) (*hcl.Block, hcl.Diagnostics) { var diags hcl.Diagnostics var labels []string var labelRanges []hcl.Range lCtx := i.EvalContext(ctx) for _, labelExpr := range s.labelExprs { labelVal, labelDiags := labelExpr.Value(lCtx) diags = append(diags, labelDiags...) if labelDiags.HasErrors() { return nil, diags } var convErr error labelVal, convErr = convert.Convert(labelVal, cty.String) if convErr != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid dynamic block label", Detail: fmt.Sprintf("Cannot use this value as a dynamic block label: %s.", convErr), Subject: labelExpr.Range().Ptr(), Expression: labelExpr, EvalContext: lCtx, }) return nil, diags } if labelVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid dynamic block label", Detail: "Cannot use a null value as a dynamic block label.", Subject: labelExpr.Range().Ptr(), Expression: labelExpr, EvalContext: lCtx, }) return nil, diags } if !labelVal.IsKnown() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid dynamic block label", Detail: "This value is not yet known. Dynamic block labels must be immediately-known values.", Subject: labelExpr.Range().Ptr(), Expression: labelExpr, EvalContext: lCtx, }) return nil, diags } labels = append(labels, labelVal.AsString()) labelRanges = append(labelRanges, labelExpr.Range()) } block := &hcl.Block{ Type: s.blockType, TypeRange: s.blockTypeRange, Labels: labels, LabelRanges: labelRanges, DefRange: s.defRange, Body: s.contentBody, } return block, diags } ��������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expr_wrap.go�����������������������0000664�0000000�0000000�00000002106�13771713062�0027036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) type exprWrap struct { hcl.Expression i *iteration } func (e exprWrap) Variables() []hcl.Traversal { raw := e.Expression.Variables() ret := make([]hcl.Traversal, 0, len(raw)) // Filter out traversals that refer to our iterator name or any // iterator we've inherited; we're going to provide those in // our Value wrapper, so the caller doesn't need to know about them. for _, traversal := range raw { rootName := traversal.RootName() if rootName == e.i.IteratorName { continue } if _, inherited := e.i.Inherited[rootName]; inherited { continue } ret = append(ret, traversal) } return ret } func (e exprWrap) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { extCtx := e.i.EvalContext(ctx) return e.Expression.Value(extCtx) } // UnwrapExpression returns the expression being wrapped by this instance. // This allows the original expression to be recovered by hcl.UnwrapExpression. func (e exprWrap) UnwrapExpression() hcl.Expression { return e.Expression } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/iteration.go�����������������������0000664�0000000�0000000�00000002552�13771713062�0027032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) type iteration struct { IteratorName string Key cty.Value Value cty.Value Inherited map[string]*iteration } func (s *expandSpec) MakeIteration(key, value cty.Value) *iteration { return &iteration{ IteratorName: s.iteratorName, Key: key, Value: value, Inherited: s.inherited, } } func (i *iteration) Object() cty.Value { return cty.ObjectVal(map[string]cty.Value{ "key": i.Key, "value": i.Value, }) } func (i *iteration) EvalContext(base *hcl.EvalContext) *hcl.EvalContext { new := base.NewChild() if i != nil { new.Variables = map[string]cty.Value{} for name, otherIt := range i.Inherited { new.Variables[name] = otherIt.Object() } new.Variables[i.IteratorName] = i.Object() } return new } func (i *iteration) MakeChild(iteratorName string, key, value cty.Value) *iteration { if i == nil { // Create entirely new root iteration, then return &iteration{ IteratorName: iteratorName, Key: key, Value: value, } } inherited := map[string]*iteration{} for name, otherIt := range i.Inherited { inherited[name] = otherIt } inherited[i.IteratorName] = i return &iteration{ IteratorName: iteratorName, Key: key, Value: value, Inherited: inherited, } } ������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/public.go��������������������������0000664�0000000�0000000�00000003073�13771713062�0026311�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package dynblock provides an extension to HCL that allows dynamic // declaration of nested blocks in certain contexts via a special block type // named "dynamic". package dynblock import ( "github.com/hashicorp/hcl/v2" ) // Expand "dynamic" blocks in the given body, returning a new body that // has those blocks expanded. // // The given EvalContext is used when evaluating "for_each" and "labels" // attributes within dynamic blocks, allowing those expressions access to // variables and functions beyond the iterator variable created by the // iteration. // // Expand returns no diagnostics because no blocks are actually expanded // until a call to Content or PartialContent on the returned body, which // will then expand only the blocks selected by the schema. // // "dynamic" blocks are also expanded automatically within nested blocks // in the given body, including within other dynamic blocks, thus allowing // multi-dimensional iteration. However, it is not possible to // dynamically-generate the "dynamic" blocks themselves except through nesting. // // parent { // dynamic "child" { // for_each = child_objs // content { // dynamic "grandchild" { // for_each = child.value.children // labels = [grandchild.key] // content { // parent_key = child.key // value = grandchild.value // } // } // } // } // } func Expand(body hcl.Body, ctx *hcl.EvalContext) hcl.Body { return &expandBody{ original: body, forEachCtx: ctx, } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/schema.go��������������������������0000664�0000000�0000000�00000001452�13771713062�0026272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import "github.com/hashicorp/hcl/v2" var dynamicBlockHeaderSchema = hcl.BlockHeaderSchema{ Type: "dynamic", LabelNames: []string{"type"}, } var dynamicBlockBodySchemaLabels = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { Name: "for_each", Required: true, }, { Name: "iterator", Required: false, }, { Name: "labels", Required: true, }, }, Blocks: []hcl.BlockHeaderSchema{ { Type: "content", LabelNames: nil, }, }, } var dynamicBlockBodySchemaNoLabels = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { Name: "for_each", Required: true, }, { Name: "iterator", Required: false, }, }, Blocks: []hcl.BlockHeaderSchema{ { Type: "content", LabelNames: nil, }, }, } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/unknown_body.go��������������������0000664�0000000�0000000�00000005427�13771713062�0027554�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) // unknownBody is a funny body that just reports everything inside it as // unknown. It uses a given other body as a sort of template for what attributes // and blocks are inside -- including source location information -- but // subsitutes unknown values of unknown type for all attributes. // // This rather odd process is used to handle expansion of dynamic blocks whose // for_each expression is unknown. Since a block cannot itself be unknown, // we instead arrange for everything _inside_ the block to be unknown instead, // to give the best possible approximation. type unknownBody struct { template hcl.Body } var _ hcl.Body = unknownBody{} func (b unknownBody) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { content, diags := b.template.Content(schema) content = b.fixupContent(content) // We're intentionally preserving the diagnostics reported from the // inner body so that we can still report where the template body doesn't // match the requested schema. return content, diags } func (b unknownBody) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) { content, remain, diags := b.template.PartialContent(schema) content = b.fixupContent(content) remain = unknownBody{remain} // remaining content must also be wrapped // We're intentionally preserving the diagnostics reported from the // inner body so that we can still report where the template body doesn't // match the requested schema. return content, remain, diags } func (b unknownBody) JustAttributes() (hcl.Attributes, hcl.Diagnostics) { attrs, diags := b.template.JustAttributes() attrs = b.fixupAttrs(attrs) // We're intentionally preserving the diagnostics reported from the // inner body so that we can still report where the template body doesn't // match the requested schema. return attrs, diags } func (b unknownBody) MissingItemRange() hcl.Range { return b.template.MissingItemRange() } func (b unknownBody) fixupContent(got *hcl.BodyContent) *hcl.BodyContent { ret := &hcl.BodyContent{} ret.Attributes = b.fixupAttrs(got.Attributes) if len(got.Blocks) > 0 { ret.Blocks = make(hcl.Blocks, 0, len(got.Blocks)) for _, gotBlock := range got.Blocks { new := *gotBlock // shallow copy new.Body = unknownBody{gotBlock.Body} // nested content must also be marked unknown ret.Blocks = append(ret.Blocks, &new) } } return ret } func (b unknownBody) fixupAttrs(got hcl.Attributes) hcl.Attributes { if len(got) == 0 { return nil } ret := make(hcl.Attributes, len(got)) for name, gotAttr := range got { new := *gotAttr // shallow copy new.Expr = hcl.StaticExpr(cty.DynamicVal, gotAttr.Expr.Range()) ret[name] = &new } return ret } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables.go�����������������������0000664�0000000�0000000�00000015157�13771713062�0027011�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) // WalkVariables begins the recursive process of walking all expressions and // nested blocks in the given body and its child bodies while taking into // account any "dynamic" blocks. // // This function requires that the caller walk through the nested block // structure in the given body level-by-level so that an appropriate schema // can be provided at each level to inform further processing. This workflow // is thus easiest to use for calling applications that have some higher-level // schema representation available with which to drive this multi-step // process. If your application uses the hcldec package, you may be able to // use VariablesHCLDec instead for a more automatic approach. func WalkVariables(body hcl.Body) WalkVariablesNode { return WalkVariablesNode{ body: body, includeContent: true, } } // WalkExpandVariables is like Variables but it includes only the variables // required for successful block expansion, ignoring any variables referenced // inside block contents. The result is the minimal set of all variables // required for a call to Expand, excluding variables that would only be // needed to subsequently call Content or PartialContent on the expanded // body. func WalkExpandVariables(body hcl.Body) WalkVariablesNode { return WalkVariablesNode{ body: body, } } type WalkVariablesNode struct { body hcl.Body it *iteration includeContent bool } type WalkVariablesChild struct { BlockTypeName string Node WalkVariablesNode } // Body returns the HCL Body associated with the child node, in case the caller // wants to do some sort of inspection of it in order to decide what schema // to pass to Visit. // // Most implementations should just fetch a fixed schema based on the // BlockTypeName field and not access this. Deciding on a schema dynamically // based on the body is a strange thing to do and generally necessary only if // your caller is already doing other bizarre things with HCL bodies. func (c WalkVariablesChild) Body() hcl.Body { return c.Node.body } // Visit returns the variable traversals required for any "dynamic" blocks // directly in the body associated with this node, and also returns any child // nodes that must be visited in order to continue the walk. // // Each child node has its associated block type name given in its BlockTypeName // field, which the calling application should use to determine the appropriate // schema for the content of each child node and pass it to the child node's // own Visit method to continue the walk recursively. func (n WalkVariablesNode) Visit(schema *hcl.BodySchema) (vars []hcl.Traversal, children []WalkVariablesChild) { extSchema := n.extendSchema(schema) container, _, _ := n.body.PartialContent(extSchema) if container == nil { return vars, children } children = make([]WalkVariablesChild, 0, len(container.Blocks)) if n.includeContent { for _, attr := range container.Attributes { for _, traversal := range attr.Expr.Variables() { var ours, inherited bool if n.it != nil { ours = traversal.RootName() == n.it.IteratorName _, inherited = n.it.Inherited[traversal.RootName()] } if !(ours || inherited) { vars = append(vars, traversal) } } } } for _, block := range container.Blocks { switch block.Type { case "dynamic": blockTypeName := block.Labels[0] inner, _, _ := block.Body.PartialContent(variableDetectionInnerSchema) if inner == nil { continue } iteratorName := blockTypeName if attr, exists := inner.Attributes["iterator"]; exists { iterTraversal, _ := hcl.AbsTraversalForExpr(attr.Expr) if len(iterTraversal) == 0 { // Ignore this invalid dynamic block, since it'll produce // an error if someone tries to extract content from it // later anyway. continue } iteratorName = iterTraversal.RootName() } blockIt := n.it.MakeChild(iteratorName, cty.DynamicVal, cty.DynamicVal) if attr, exists := inner.Attributes["for_each"]; exists { // Filter out iterator names inherited from parent blocks for _, traversal := range attr.Expr.Variables() { if _, inherited := blockIt.Inherited[traversal.RootName()]; !inherited { vars = append(vars, traversal) } } } if attr, exists := inner.Attributes["labels"]; exists { // Filter out both our own iterator name _and_ those inherited // from parent blocks, since we provide _both_ of these to the // label expressions. for _, traversal := range attr.Expr.Variables() { ours := traversal.RootName() == iteratorName _, inherited := blockIt.Inherited[traversal.RootName()] if !(ours || inherited) { vars = append(vars, traversal) } } } for _, contentBlock := range inner.Blocks { // We only request "content" blocks in our schema, so we know // any blocks we find here will be content blocks. We require // exactly one content block for actual expansion, but we'll // be more liberal here so that callers can still collect // variables from erroneous "dynamic" blocks. children = append(children, WalkVariablesChild{ BlockTypeName: blockTypeName, Node: WalkVariablesNode{ body: contentBlock.Body, it: blockIt, includeContent: n.includeContent, }, }) } default: children = append(children, WalkVariablesChild{ BlockTypeName: block.Type, Node: WalkVariablesNode{ body: block.Body, it: n.it, includeContent: n.includeContent, }, }) } } return vars, children } func (n WalkVariablesNode) extendSchema(schema *hcl.BodySchema) *hcl.BodySchema { // We augment the requested schema to also include our special "dynamic" // block type, since then we'll get instances of it interleaved with // all of the literal child blocks we must also include. extSchema := &hcl.BodySchema{ Attributes: schema.Attributes, Blocks: make([]hcl.BlockHeaderSchema, len(schema.Blocks), len(schema.Blocks)+1), } copy(extSchema.Blocks, schema.Blocks) extSchema.Blocks = append(extSchema.Blocks, dynamicBlockHeaderSchema) return extSchema } // This is a more relaxed schema than what's in schema.go, since we // want to maximize the amount of variables we can find even if there // are erroneous blocks. var variableDetectionInnerSchema = &hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { Name: "for_each", Required: false, }, { Name: "labels", Required: false, }, { Name: "iterator", Required: false, }, }, Blocks: []hcl.BlockHeaderSchema{ { Type: "content", }, }, } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables_hcldec.go����������������0000664�0000000�0000000�00000003053�13771713062�0030303�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package dynblock import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hcldec" ) // VariablesHCLDec is a wrapper around WalkVariables that uses the given hcldec // specification to automatically drive the recursive walk through nested // blocks in the given body. // // This is a drop-in replacement for hcldec.Variables which is able to treat // blocks of type "dynamic" in the same special way that dynblock.Expand would, // exposing both the variables referenced in the "for_each" and "labels" // arguments and variables used in the nested "content" block. func VariablesHCLDec(body hcl.Body, spec hcldec.Spec) []hcl.Traversal { rootNode := WalkVariables(body) return walkVariablesWithHCLDec(rootNode, spec) } // ExpandVariablesHCLDec is like VariablesHCLDec but it includes only the // minimal set of variables required to call Expand, ignoring variables that // are referenced only inside normal block contents. See WalkExpandVariables // for more information. func ExpandVariablesHCLDec(body hcl.Body, spec hcldec.Spec) []hcl.Traversal { rootNode := WalkExpandVariables(body) return walkVariablesWithHCLDec(rootNode, spec) } func walkVariablesWithHCLDec(node WalkVariablesNode, spec hcldec.Spec) []hcl.Traversal { vars, children := node.Visit(hcldec.ImpliedSchema(spec)) if len(children) > 0 { childSpecs := hcldec.ChildBlockTypes(spec) for _, child := range children { if childSpec, exists := childSpecs[child.BlockTypeName]; exists { vars = append(vars, walkVariablesWithHCLDec(child.Node, childSpec)...) } } } return vars } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/tryfunc/������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024366�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/tryfunc/README.md���������������������������0000664�0000000�0000000�00000002650�13771713062�0025650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# "Try" and "can" functions This Go package contains two `cty` functions intended for use in an `hcl.EvalContext` when evaluating HCL native syntax expressions. The first function `try` attempts to evaluate each of its argument expressions in order until one produces a result without any errors. ```hcl try(non_existent_variable, 2) # returns 2 ``` If none of the expressions succeed, the function call fails with all of the errors it encountered. The second function `can` is similar except that it ignores the result of the given expression altogether and simply returns `true` if the expression produced a successful result or `false` if it produced errors. Both of these are primarily intended for working with deep data structures which might not have a dependable shape. For example, we can use `try` to attempt to fetch a value from deep inside a data structure but produce a default value if any step of the traversal fails: ```hcl result = try(foo.deep[0].lots.of["traversals"], null) ``` The final result to `try` should generally be some sort of constant value that will always evaluate successfully. ## Using these functions Languages built on HCL can make `try` and `can` available to user code by exporting them in the `hcl.EvalContext` used for expression evaluation: ```go ctx := &hcl.EvalContext{ Functions: map[string]function.Function{ "try": tryfunc.TryFunc, "can": tryfunc.CanFunc, }, } ``` ����������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/tryfunc/tryfunc.go��������������������������0000664�0000000�0000000�00000012247�13771713062�0026415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package tryfunc contains some optional functions that can be exposed in // HCL-based languages to allow authors to test whether a particular expression // can succeed and take dynamic action based on that result. // // These functions are implemented in terms of the customdecode extension from // the sibling directory "customdecode", and so they are only useful when // used within an HCL EvalContext. Other systems using cty functions are // unlikely to support the HCL-specific "customdecode" extension. package tryfunc import ( "errors" "fmt" "strings" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" ) // TryFunc is a variadic function that tries to evaluate all of is arguments // in sequence until one succeeds, in which case it returns that result, or // returns an error if none of them succeed. var TryFunc function.Function // CanFunc tries to evaluate the expression given in its first argument. var CanFunc function.Function func init() { TryFunc = function.New(&function.Spec{ VarParam: &function.Parameter{ Name: "expressions", Type: customdecode.ExpressionClosureType, }, Type: func(args []cty.Value) (cty.Type, error) { v, err := try(args) if err != nil { return cty.NilType, err } return v.Type(), nil }, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return try(args) }, }) CanFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "expression", Type: customdecode.ExpressionClosureType, }, }, Type: function.StaticReturnType(cty.Bool), Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { return can(args[0]) }, }) } func try(args []cty.Value) (cty.Value, error) { if len(args) == 0 { return cty.NilVal, errors.New("at least one argument is required") } // We'll collect up all of the diagnostics we encounter along the way // and report them all if none of the expressions succeed, so that the // user might get some hints on how to make at least one succeed. var diags hcl.Diagnostics for _, arg := range args { closure := customdecode.ExpressionClosureFromVal(arg) if dependsOnUnknowns(closure.Expression, closure.EvalContext) { // We can't safely decide if this expression will succeed yet, // and so our entire result must be unknown until we have // more information. return cty.DynamicVal, nil } v, moreDiags := closure.Value() diags = append(diags, moreDiags...) if moreDiags.HasErrors() { continue // try the next one, if there is one to try } return v, nil // ignore any accumulated diagnostics if one succeeds } // If we fall out here then none of the expressions succeeded, and so // we must have at least one diagnostic and we'll return all of them // so that the user can see the errors related to whichever one they // were expecting to have succeeded in this case. // // Because our function must return a single error value rather than // diagnostics, we'll construct a suitable error message string // that will make sense in the context of the function call failure // diagnostic HCL will eventually wrap this in. var buf strings.Builder buf.WriteString("no expression succeeded:\n") for _, diag := range diags { if diag.Subject != nil { buf.WriteString(fmt.Sprintf("- %s (at %s)\n %s\n", diag.Summary, diag.Subject, diag.Detail)) } else { buf.WriteString(fmt.Sprintf("- %s\n %s\n", diag.Summary, diag.Detail)) } } buf.WriteString("\nAt least one expression must produce a successful result") return cty.NilVal, errors.New(buf.String()) } func can(arg cty.Value) (cty.Value, error) { closure := customdecode.ExpressionClosureFromVal(arg) if dependsOnUnknowns(closure.Expression, closure.EvalContext) { // Can't decide yet, then. return cty.UnknownVal(cty.Bool), nil } _, diags := closure.Value() if diags.HasErrors() { return cty.False, nil } return cty.True, nil } // dependsOnUnknowns returns true if any of the variables that the given // expression might access are unknown values or contain unknown values. // // This is a conservative result that prefers to return true if there's any // chance that the expression might derive from an unknown value during its // evaluation; it is likely to produce false-positives for more complex // expressions involving deep data structures. func dependsOnUnknowns(expr hcl.Expression, ctx *hcl.EvalContext) bool { for _, traversal := range expr.Variables() { val, diags := traversal.TraverseAbs(ctx) if diags.HasErrors() { // If the traversal returned a definitive error then it must // not traverse through any unknowns. continue } if !val.IsWhollyKnown() { // The value will be unknown if either it refers directly to // an unknown value or if the traversal moves through an unknown // collection. We're using IsWhollyKnown, so this also catches // situations where the traversal refers to a compound data // structure that contains any unknown values. That's important, // because during evaluation the expression might evaluate more // deeply into this structure and encounter the unknowns. return true } } return false } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/�����������������������������������0000775�0000000�0000000�00000000000�13771713062�0024554�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/README.md��������������������������0000664�0000000�0000000�00000013261�13771713062�0026036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL Type Expressions Extension This HCL extension defines a convention for describing HCL types using function call and variable reference syntax, allowing configuration formats to include type information provided by users. The type syntax is processed statically from a hcl.Expression, so it cannot use any of the usual language operators. This is similar to type expressions in statically-typed programming languages. ```hcl variable "example" { type = list(string) } ``` The extension is built using the `hcl.ExprAsKeyword` and `hcl.ExprCall` functions, and so it relies on the underlying syntax to define how "keyword" and "call" are interpreted. The above shows how they are interpreted in the HCL native syntax, while the following shows the same information expressed in JSON: ```json { "variable": { "example": { "type": "list(string)" } } } ``` Notice that since we have additional contextual information that we intend to allow only calls and keywords the JSON syntax is able to parse the given string directly as an expression, rather than as a template as would be the case for normal expression evaluation. For more information, see [the godoc reference](http://godoc.org/github.com/hashicorp/hcl/v2/ext/typeexpr). ## Type Expression Syntax When expressed in the native syntax, the following expressions are permitted in a type expression: * `string` - string * `bool` - boolean * `number` - number * `any` - `cty.DynamicPseudoType` (in function `TypeConstraint` only) * `list(<type_expr>)` - list of the type given as an argument * `set(<type_expr>)` - set of the type given as an argument * `map(<type_expr>)` - map of the type given as an argument * `tuple([<type_exprs...>])` - tuple with the element types given in the single list argument * `object({<attr_name>=<type_expr>, ...}` - object with the attributes and corresponding types given in the single map argument For example: * `list(string)` * `object({name=string,age=number})` * `map(object({name=string,age=number}))` Note that the object constructor syntax is not fully-general for all possible object types because it requires the attribute names to be valid identifiers. In practice it is expected that any time an object type is being fixed for type checking it will be one that has identifiers as its attributes; object types with weird attributes generally show up only from arbitrary object constructors in configuration files, which are usually treated either as maps or as the dynamic pseudo-type. ## Type Constraints as Values Along with defining a convention for writing down types using HCL expression constructs, this package also includes a mechanism for representing types as values that can be used as data within an HCL-based language. `typeexpr.TypeConstraintType` is a [`cty` capsule type](https://github.com/zclconf/go-cty/blob/master/docs/types.md#capsule-types) that encapsulates `cty.Type` values. You can construct such a value directly using the `TypeConstraintVal` function: ```go tyVal := typeexpr.TypeConstraintVal(cty.String) // We can unpack the type from a value using TypeConstraintFromVal ty := typeExpr.TypeConstraintFromVal(tyVal) ``` However, the primary purpose of `typeexpr.TypeConstraintType` is to be specified as the type constraint for an argument, in which case it serves as a signal for HCL to treat the argument expression as a type constraint expression as defined above, rather than as a normal value expression. "An argument" in the above in practice means the following two locations: * As the type constraint for a parameter of a cty function that will be used in an `hcl.EvalContext`. In that case, function calls in the HCL native expression syntax will require the argument to be valid type constraint expression syntax and the function implementation will receive a `TypeConstraintType` value as the argument value for that parameter. * As the type constraint for a `hcldec.AttrSpec` or `hcldec.BlockAttrsSpec` when decoding an HCL body using `hcldec`. In that case, the attributes with that type constraint will be required to be valid type constraint expression syntax and the result will be a `TypeConstraintType` value. Note that the special handling of these arguments means that an argument marked in this way must use the type constraint syntax directly. It is not valid to pass in a value of `TypeConstraintType` that has been obtained dynamically via some other expression result. `TypeConstraintType` is provided with the intent of using it internally within application code when incorporating type constraint expression syntax into an HCL-based language, not to be used for dynamic "programming with types". A calling application could support programming with types by defining its _own_ capsule type, but that is not the purpose of `TypeConstraintType`. ## The "convert" `cty` Function Building on the `TypeConstraintType` described in the previous section, this package also provides `typeexpr.ConvertFunc` which is a cty function that can be placed into a `cty.EvalContext` (conventionally named "convert") in order to provide a general type conversion function in an HCL-based language: ```hcl foo = convert("true", bool) ``` The second parameter uses the mechanism described in the previous section to require its argument to be a type constraint expression rather than a value expression. In doing so, it allows converting with any type constraint that can be expressed in this package's type constraint syntax. In the above example, the `foo` argument would receive a boolean true, or `cty.True` in `cty` terms. The target type constraint must always be provided statically using inline type constraint syntax. There is no way to _dynamically_ select a type constraint using this function. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/doc.go�����������������������������0000664�0000000�0000000�00000000620�13771713062�0025646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package typeexpr extends HCL with a convention for describing HCL types // within configuration files. // // The type syntax is processed statically from a hcl.Expression, so it cannot // use any of the usual language operators. This is similar to type expressions // in statically-typed programming languages. // // variable "example" { // type = list(string) // } package typeexpr ����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/get_type.go������������������������0000664�0000000�0000000�00000014651�13771713062�0026732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package typeexpr import ( "fmt" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) const invalidTypeSummary = "Invalid type specification" // getType is the internal implementation of both Type and TypeConstraint, // using the passed flag to distinguish. When constraint is false, the "any" // keyword will produce an error. func getType(expr hcl.Expression, constraint bool) (cty.Type, hcl.Diagnostics) { // First we'll try for one of our keywords kw := hcl.ExprAsKeyword(expr) switch kw { case "bool": return cty.Bool, nil case "string": return cty.String, nil case "number": return cty.Number, nil case "any": if constraint { return cty.DynamicPseudoType, nil } return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: fmt.Sprintf("The keyword %q cannot be used in this type specification: an exact type is required.", kw), Subject: expr.Range().Ptr(), }} case "list", "map", "set": return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: fmt.Sprintf("The %s type constructor requires one argument specifying the element type.", kw), Subject: expr.Range().Ptr(), }} case "object": return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "The object type constructor requires one argument specifying the attribute types and values as a map.", Subject: expr.Range().Ptr(), }} case "tuple": return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "The tuple type constructor requires one argument specifying the element types as a list.", Subject: expr.Range().Ptr(), }} case "": // okay! we'll fall through and try processing as a call, then. default: return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: fmt.Sprintf("The keyword %q is not a valid type specification.", kw), Subject: expr.Range().Ptr(), }} } // If we get down here then our expression isn't just a keyword, so we'll // try to process it as a call instead. call, diags := hcl.ExprCall(expr) if diags.HasErrors() { return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "A type specification is either a primitive type keyword (bool, number, string) or a complex type constructor call, like list(string).", Subject: expr.Range().Ptr(), }} } switch call.Name { case "bool", "string", "number", "any": return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: fmt.Sprintf("Primitive type keyword %q does not expect arguments.", call.Name), Subject: &call.ArgsRange, }} } if len(call.Arguments) != 1 { contextRange := call.ArgsRange subjectRange := call.ArgsRange if len(call.Arguments) > 1 { // If we have too many arguments (as opposed to too _few_) then // we'll highlight the extraneous arguments as the diagnostic // subject. subjectRange = hcl.RangeBetween(call.Arguments[1].Range(), call.Arguments[len(call.Arguments)-1].Range()) } switch call.Name { case "list", "set", "map": return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: fmt.Sprintf("The %s type constructor requires one argument specifying the element type.", call.Name), Subject: &subjectRange, Context: &contextRange, }} case "object": return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "The object type constructor requires one argument specifying the attribute types and values as a map.", Subject: &subjectRange, Context: &contextRange, }} case "tuple": return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "The tuple type constructor requires one argument specifying the element types as a list.", Subject: &subjectRange, Context: &contextRange, }} } } switch call.Name { case "list": ety, diags := getType(call.Arguments[0], constraint) return cty.List(ety), diags case "set": ety, diags := getType(call.Arguments[0], constraint) return cty.Set(ety), diags case "map": ety, diags := getType(call.Arguments[0], constraint) return cty.Map(ety), diags case "object": attrDefs, diags := hcl.ExprMap(call.Arguments[0]) if diags.HasErrors() { return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "Object type constructor requires a map whose keys are attribute names and whose values are the corresponding attribute types.", Subject: call.Arguments[0].Range().Ptr(), Context: expr.Range().Ptr(), }} } atys := make(map[string]cty.Type) for _, attrDef := range attrDefs { attrName := hcl.ExprAsKeyword(attrDef.Key) if attrName == "" { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "Object constructor map keys must be attribute names.", Subject: attrDef.Key.Range().Ptr(), Context: expr.Range().Ptr(), }) continue } aty, attrDiags := getType(attrDef.Value, constraint) diags = append(diags, attrDiags...) atys[attrName] = aty } return cty.Object(atys), diags case "tuple": elemDefs, diags := hcl.ExprList(call.Arguments[0]) if diags.HasErrors() { return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: "Tuple type constructor requires a list of element types.", Subject: call.Arguments[0].Range().Ptr(), Context: expr.Range().Ptr(), }} } etys := make([]cty.Type, len(elemDefs)) for i, defExpr := range elemDefs { ety, elemDiags := getType(defExpr, constraint) diags = append(diags, elemDiags...) etys[i] = ety } return cty.Tuple(etys), diags default: // Can't access call.Arguments in this path because we've not validated // that it contains exactly one expression here. return cty.DynamicPseudoType, hcl.Diagnostics{{ Severity: hcl.DiagError, Summary: invalidTypeSummary, Detail: fmt.Sprintf("Keyword %q is not a valid type constructor.", call.Name), Subject: expr.Range().Ptr(), }} } } ���������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/public.go��������������������������0000664�0000000�0000000�00000007163�13771713062�0026370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package typeexpr import ( "bytes" "fmt" "sort" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) // Type attempts to process the given expression as a type expression and, if // successful, returns the resulting type. If unsuccessful, error diagnostics // are returned. func Type(expr hcl.Expression) (cty.Type, hcl.Diagnostics) { return getType(expr, false) } // TypeConstraint attempts to parse the given expression as a type constraint // and, if successful, returns the resulting type. If unsuccessful, error // diagnostics are returned. // // A type constraint has the same structure as a type, but it additionally // allows the keyword "any" to represent cty.DynamicPseudoType, which is often // used as a wildcard in type checking and type conversion operations. func TypeConstraint(expr hcl.Expression) (cty.Type, hcl.Diagnostics) { return getType(expr, true) } // TypeString returns a string rendering of the given type as it would be // expected to appear in the HCL native syntax. // // This is primarily intended for showing types to the user in an application // that uses typexpr, where the user can be assumed to be familiar with the // type expression syntax. In applications that do not use typeexpr these // results may be confusing to the user and so type.FriendlyName may be // preferable, even though it's less precise. // // TypeString produces reasonable results only for types like what would be // produced by the Type and TypeConstraint functions. In particular, it cannot // support capsule types. func TypeString(ty cty.Type) string { // Easy cases first switch ty { case cty.String: return "string" case cty.Bool: return "bool" case cty.Number: return "number" case cty.DynamicPseudoType: return "any" } if ty.IsCapsuleType() { panic("TypeString does not support capsule types") } if ty.IsCollectionType() { ety := ty.ElementType() etyString := TypeString(ety) switch { case ty.IsListType(): return fmt.Sprintf("list(%s)", etyString) case ty.IsSetType(): return fmt.Sprintf("set(%s)", etyString) case ty.IsMapType(): return fmt.Sprintf("map(%s)", etyString) default: // Should never happen because the above is exhaustive panic("unsupported collection type") } } if ty.IsObjectType() { var buf bytes.Buffer buf.WriteString("object({") atys := ty.AttributeTypes() names := make([]string, 0, len(atys)) for name := range atys { names = append(names, name) } sort.Strings(names) first := true for _, name := range names { aty := atys[name] if !first { buf.WriteByte(',') } if !hclsyntax.ValidIdentifier(name) { // Should never happen for any type produced by this package, // but we'll do something reasonable here just so we don't // produce garbage if someone gives us a hand-assembled object // type that has weird attribute names. // Using Go-style quoting here isn't perfect, since it doesn't // exactly match HCL syntax, but it's fine for an edge-case. buf.WriteString(fmt.Sprintf("%q", name)) } else { buf.WriteString(name) } buf.WriteByte('=') buf.WriteString(TypeString(aty)) first = false } buf.WriteString("})") return buf.String() } if ty.IsTupleType() { var buf bytes.Buffer buf.WriteString("tuple([") etys := ty.TupleElementTypes() first := true for _, ety := range etys { if !first { buf.WriteByte(',') } buf.WriteString(TypeString(ety)) first = false } buf.WriteString("])") return buf.String() } // Should never happen because we covered all cases above. panic(fmt.Errorf("unsupported type %#v", ty)) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/type_type.go�����������������������0000664�0000000�0000000�00000007106�13771713062�0027131�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package typeexpr import ( "fmt" "reflect" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" ) // TypeConstraintType is a cty capsule type that allows cty type constraints to // be used as values. // // If TypeConstraintType is used in a context supporting the // customdecode.CustomExpressionDecoder extension then it will implement // expression decoding using the TypeConstraint function, thus allowing // type expressions to be used in contexts where value expressions might // normally be expected, such as in arguments to function calls. var TypeConstraintType cty.Type // TypeConstraintVal constructs a cty.Value whose type is // TypeConstraintType. func TypeConstraintVal(ty cty.Type) cty.Value { return cty.CapsuleVal(TypeConstraintType, &ty) } // TypeConstraintFromVal extracts the type from a cty.Value of // TypeConstraintType that was previously constructed using TypeConstraintVal. // // If the given value isn't a known, non-null value of TypeConstraintType // then this function will panic. func TypeConstraintFromVal(v cty.Value) cty.Type { if !v.Type().Equals(TypeConstraintType) { panic("value is not of TypeConstraintType") } ptr := v.EncapsulatedValue().(*cty.Type) return *ptr } // ConvertFunc is a cty function that implements type conversions. // // Its signature is as follows: // convert(value, type_constraint) // // ...where type_constraint is a type constraint expression as defined by // typeexpr.TypeConstraint. // // It relies on HCL's customdecode extension and so it's not suitable for use // in non-HCL contexts or if you are using a HCL syntax implementation that // does not support customdecode for function arguments. However, it _is_ // supported for function calls in the HCL native expression syntax. var ConvertFunc function.Function func init() { TypeConstraintType = cty.CapsuleWithOps("type constraint", reflect.TypeOf(cty.Type{}), &cty.CapsuleOps{ ExtensionData: func(key interface{}) interface{} { switch key { case customdecode.CustomExpressionDecoder: return customdecode.CustomExpressionDecoderFunc( func(expr hcl.Expression, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { ty, diags := TypeConstraint(expr) if diags.HasErrors() { return cty.NilVal, diags } return TypeConstraintVal(ty), nil }, ) default: return nil } }, TypeGoString: func(_ reflect.Type) string { return "typeexpr.TypeConstraintType" }, GoString: func(raw interface{}) string { tyPtr := raw.(*cty.Type) return fmt.Sprintf("typeexpr.TypeConstraintVal(%#v)", *tyPtr) }, RawEquals: func(a, b interface{}) bool { aPtr := a.(*cty.Type) bPtr := b.(*cty.Type) return (*aPtr).Equals(*bPtr) }, }) ConvertFunc = function.New(&function.Spec{ Params: []function.Parameter{ { Name: "value", Type: cty.DynamicPseudoType, AllowNull: true, AllowDynamicType: true, }, { Name: "type", Type: TypeConstraintType, }, }, Type: func(args []cty.Value) (cty.Type, error) { wantTypePtr := args[1].EncapsulatedValue().(*cty.Type) got, err := convert.Convert(args[0], *wantTypePtr) if err != nil { return cty.NilType, function.NewArgError(0, err) } return got.Type(), nil }, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { v, err := convert.Convert(args[0], retType) if err != nil { return cty.NilVal, function.NewArgError(0, err) } return v, nil }, }) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/go.mod������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0023177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/hcl/v2 go 1.12 require ( github.com/agext/levenshtein v1.2.1 github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 github.com/apparentlymart/go-textseg/v12 v12.0.0 github.com/davecgh/go-spew v1.1.1 github.com/go-test/deep v1.0.3 github.com/google/go-cmp v0.3.1 github.com/kr/pretty v0.1.0 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.0.0 github.com/spf13/pflag v1.0.2 github.com/stretchr/testify v1.2.2 // indirect github.com/zclconf/go-cty v1.2.0 golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect golang.org/x/text v0.3.2 // indirect ) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/go.sum������������������������������������������0000664�0000000�0000000�00000011611�13771713062�0023227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/zclconf/go-cty v1.2.0 h1:sPHsy7ADcIZQP3vILvTjrh74ZA175TFP5vqiNK1UmlI= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 h1:p/H982KKEjUnLJkM3tt/LemDnOc1GiZL5FCVlORJ5zo= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= �����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/gohcl/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023170�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/gohcl/decode.go���������������������������������0000664�0000000�0000000�00000021535�13771713062�0024750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package gohcl import ( "fmt" "reflect" "github.com/zclconf/go-cty/cty" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/gocty" ) // DecodeBody extracts the configuration within the given body into the given // value. This value must be a non-nil pointer to either a struct or // a map, where in the former case the configuration will be decoded using // struct tags and in the latter case only attributes are allowed and their // values are decoded into the map. // // The given EvalContext is used to resolve any variables or functions in // expressions encountered while decoding. This may be nil to require only // constant values, for simple applications that do not support variables or // functions. // // The returned diagnostics should be inspected with its HasErrors method to // determine if the populated value is valid and complete. If error diagnostics // are returned then the given value may have been partially-populated but // may still be accessed by a careful caller for static analysis and editor // integration use-cases. func DecodeBody(body hcl.Body, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics { rv := reflect.ValueOf(val) if rv.Kind() != reflect.Ptr { panic(fmt.Sprintf("target value must be a pointer, not %s", rv.Type().String())) } return decodeBodyToValue(body, ctx, rv.Elem()) } func decodeBodyToValue(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { et := val.Type() switch et.Kind() { case reflect.Struct: return decodeBodyToStruct(body, ctx, val) case reflect.Map: return decodeBodyToMap(body, ctx, val) default: panic(fmt.Sprintf("target value must be pointer to struct or map, not %s", et.String())) } } func decodeBodyToStruct(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { schema, partial := ImpliedBodySchema(val.Interface()) var content *hcl.BodyContent var leftovers hcl.Body var diags hcl.Diagnostics if partial { content, leftovers, diags = body.PartialContent(schema) } else { content, diags = body.Content(schema) } if content == nil { return diags } tags := getFieldTags(val.Type()) if tags.Remain != nil { fieldIdx := *tags.Remain field := val.Type().Field(fieldIdx) fieldV := val.Field(fieldIdx) switch { case bodyType.AssignableTo(field.Type): fieldV.Set(reflect.ValueOf(leftovers)) case attrsType.AssignableTo(field.Type): attrs, attrsDiags := leftovers.JustAttributes() if len(attrsDiags) > 0 { diags = append(diags, attrsDiags...) } fieldV.Set(reflect.ValueOf(attrs)) default: diags = append(diags, decodeBodyToValue(leftovers, ctx, fieldV)...) } } for name, fieldIdx := range tags.Attributes { attr := content.Attributes[name] field := val.Type().Field(fieldIdx) fieldV := val.Field(fieldIdx) if attr == nil { if !exprType.AssignableTo(field.Type) { continue } // As a special case, if the target is of type hcl.Expression then // we'll assign an actual expression that evalues to a cty null, // so the caller can deal with it within the cty realm rather // than within the Go realm. synthExpr := hcl.StaticExpr(cty.NullVal(cty.DynamicPseudoType), body.MissingItemRange()) fieldV.Set(reflect.ValueOf(synthExpr)) continue } switch { case attrType.AssignableTo(field.Type): fieldV.Set(reflect.ValueOf(attr)) case exprType.AssignableTo(field.Type): fieldV.Set(reflect.ValueOf(attr.Expr)) default: diags = append(diags, DecodeExpression( attr.Expr, ctx, fieldV.Addr().Interface(), )...) } } blocksByType := content.Blocks.ByType() for typeName, fieldIdx := range tags.Blocks { blocks := blocksByType[typeName] field := val.Type().Field(fieldIdx) ty := field.Type isSlice := false isPtr := false if ty.Kind() == reflect.Slice { isSlice = true ty = ty.Elem() } if ty.Kind() == reflect.Ptr { isPtr = true ty = ty.Elem() } if len(blocks) > 1 && !isSlice { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Duplicate %s block", typeName), Detail: fmt.Sprintf( "Only one %s block is allowed. Another was defined at %s.", typeName, blocks[0].DefRange.String(), ), Subject: &blocks[1].DefRange, }) continue } if len(blocks) == 0 { if isSlice || isPtr { if val.Field(fieldIdx).IsNil() { val.Field(fieldIdx).Set(reflect.Zero(field.Type)) } } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Missing %s block", typeName), Detail: fmt.Sprintf("A %s block is required.", typeName), Subject: body.MissingItemRange().Ptr(), }) } continue } switch { case isSlice: elemType := ty if isPtr { elemType = reflect.PtrTo(ty) } sli := val.Field(fieldIdx) if sli.IsNil() { sli = reflect.MakeSlice(reflect.SliceOf(elemType), len(blocks), len(blocks)) } for i, block := range blocks { if isPtr { if i >= sli.Len() { sli = reflect.Append(sli, reflect.New(ty)) } v := sli.Index(i) if v.IsNil() { v = reflect.New(ty) } diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...) sli.Index(i).Set(v) } else { diags = append(diags, decodeBlockToValue(block, ctx, sli.Index(i))...) } } if sli.Len() > len(blocks) { sli.SetLen(len(blocks)) } val.Field(fieldIdx).Set(sli) default: block := blocks[0] if isPtr { v := val.Field(fieldIdx) if v.IsNil() { v = reflect.New(ty) } diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...) val.Field(fieldIdx).Set(v) } else { diags = append(diags, decodeBlockToValue(block, ctx, val.Field(fieldIdx))...) } } } return diags } func decodeBodyToMap(body hcl.Body, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics { attrs, diags := body.JustAttributes() if attrs == nil { return diags } mv := reflect.MakeMap(v.Type()) for k, attr := range attrs { switch { case attrType.AssignableTo(v.Type().Elem()): mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr)) case exprType.AssignableTo(v.Type().Elem()): mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr.Expr)) default: ev := reflect.New(v.Type().Elem()) diags = append(diags, DecodeExpression(attr.Expr, ctx, ev.Interface())...) mv.SetMapIndex(reflect.ValueOf(k), ev.Elem()) } } v.Set(mv) return diags } func decodeBlockToValue(block *hcl.Block, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics { var diags hcl.Diagnostics ty := v.Type() switch { case blockType.AssignableTo(ty): v.Elem().Set(reflect.ValueOf(block)) case bodyType.AssignableTo(ty): v.Elem().Set(reflect.ValueOf(block.Body)) case attrsType.AssignableTo(ty): attrs, attrsDiags := block.Body.JustAttributes() if len(attrsDiags) > 0 { diags = append(diags, attrsDiags...) } v.Elem().Set(reflect.ValueOf(attrs)) default: diags = append(diags, decodeBodyToValue(block.Body, ctx, v)...) if len(block.Labels) > 0 { blockTags := getFieldTags(ty) for li, lv := range block.Labels { lfieldIdx := blockTags.Labels[li].FieldIndex v.Field(lfieldIdx).Set(reflect.ValueOf(lv)) } } } return diags } // DecodeExpression extracts the value of the given expression into the given // value. This value must be something that gocty is able to decode into, // since the final decoding is delegated to that package. // // The given EvalContext is used to resolve any variables or functions in // expressions encountered while decoding. This may be nil to require only // constant values, for simple applications that do not support variables or // functions. // // The returned diagnostics should be inspected with its HasErrors method to // determine if the populated value is valid and complete. If error diagnostics // are returned then the given value may have been partially-populated but // may still be accessed by a careful caller for static analysis and editor // integration use-cases. func DecodeExpression(expr hcl.Expression, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics { srcVal, diags := expr.Value(ctx) convTy, err := gocty.ImpliedType(val) if err != nil { panic(fmt.Sprintf("unsuitable DecodeExpression target: %s", err)) } srcVal, err = convert.Convert(srcVal, convTy) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsuitable value type", Detail: fmt.Sprintf("Unsuitable value: %s", err.Error()), Subject: expr.StartRange().Ptr(), Context: expr.Range().Ptr(), }) return diags } err = gocty.FromCtyValue(srcVal, val) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsuitable value type", Detail: fmt.Sprintf("Unsuitable value: %s", err.Error()), Subject: expr.StartRange().Ptr(), Context: expr.Range().Ptr(), }) } return diags } �������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/gohcl/doc.go������������������������������������0000664�0000000�0000000�00000005724�13771713062�0024274�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package gohcl allows decoding HCL configurations into Go data structures. // // It provides a convenient and concise way of describing the schema for // configuration and then accessing the resulting data via native Go // types. // // A struct field tag scheme is used, similar to other decoding and // unmarshalling libraries. The tags are formatted as in the following example: // // ThingType string `hcl:"thing_type,attr"` // // Within each tag there are two comma-separated tokens. The first is the // name of the corresponding construct in configuration, while the second // is a keyword giving the kind of construct expected. The following // kind keywords are supported: // // attr (the default) indicates that the value is to be populated from an attribute // block indicates that the value is to populated from a block // label indicates that the value is to populated from a block label // optional is the same as attr, but the field is optional // remain indicates that the value is to be populated from the remaining body after populating other fields // // "attr" fields may either be of type *hcl.Expression, in which case the raw // expression is assigned, or of any type accepted by gocty, in which case // gocty will be used to assign the value to a native Go type. // // "block" fields may be of type *hcl.Block or hcl.Body, in which case the // corresponding raw value is assigned, or may be a struct that recursively // uses the same tags. Block fields may also be slices of any of these types, // in which case multiple blocks of the corresponding type are decoded into // the slice. // // "label" fields are considered only in a struct used as the type of a field // marked as "block", and are used sequentially to capture the labels of // the blocks being decoded. In this case, the name token is used only as // an identifier for the label in diagnostic messages. // // "optional" fields behave like "attr" fields, but they are optional // and will not give parsing errors if they are missing. // // "remain" can be placed on a single field that may be either of type // hcl.Body or hcl.Attributes, in which case any remaining body content is // placed into this field for delayed processing. If no "remain" field is // present then any attributes or blocks not matched by another valid tag // will cause an error diagnostic. // // Only a subset of this tagging/typing vocabulary is supported for the // "Encode" family of functions. See the EncodeIntoBody docs for full details // on the constraints there. // // Broadly-speaking this package deals with two types of error. The first is // errors in the configuration itself, which are returned as diagnostics // written with the configuration author as the target audience. The second // is bugs in the calling program, such as invalid struct tags, which are // surfaced via panics since there can be no useful runtime handling of such // errors and they should certainly not be returned to the user as diagnostics. package gohcl ��������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/gohcl/encode.go���������������������������������0000664�0000000�0000000�00000013332�13771713062�0024756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package gohcl import ( "fmt" "reflect" "sort" "github.com/hashicorp/hcl/v2/hclwrite" "github.com/zclconf/go-cty/cty/gocty" ) // EncodeIntoBody replaces the contents of the given hclwrite Body with // attributes and blocks derived from the given value, which must be a // struct value or a pointer to a struct value with the struct tags defined // in this package. // // This function can work only with fully-decoded data. It will ignore any // fields tagged as "remain", any fields that decode attributes into either // hcl.Attribute or hcl.Expression values, and any fields that decode blocks // into hcl.Attributes values. This function does not have enough information // to complete the decoding of these types. // // Any fields tagged as "label" are ignored by this function. Use EncodeAsBlock // to produce a whole hclwrite.Block including block labels. // // As long as a suitable value is given to encode and the destination body // is non-nil, this function will always complete. It will panic in case of // any errors in the calling program, such as passing an inappropriate type // or a nil body. // // The layout of the resulting HCL source is derived from the ordering of // the struct fields, with blank lines around nested blocks of different types. // Fields representing attributes should usually precede those representing // blocks so that the attributes can group togather in the result. For more // control, use the hclwrite API directly. func EncodeIntoBody(val interface{}, dst *hclwrite.Body) { rv := reflect.ValueOf(val) ty := rv.Type() if ty.Kind() == reflect.Ptr { rv = rv.Elem() ty = rv.Type() } if ty.Kind() != reflect.Struct { panic(fmt.Sprintf("value is %s, not struct", ty.Kind())) } tags := getFieldTags(ty) populateBody(rv, ty, tags, dst) } // EncodeAsBlock creates a new hclwrite.Block populated with the data from // the given value, which must be a struct or pointer to struct with the // struct tags defined in this package. // // If the given struct type has fields tagged with "label" tags then they // will be used in order to annotate the created block with labels. // // This function has the same constraints as EncodeIntoBody and will panic // if they are violated. func EncodeAsBlock(val interface{}, blockType string) *hclwrite.Block { rv := reflect.ValueOf(val) ty := rv.Type() if ty.Kind() == reflect.Ptr { rv = rv.Elem() ty = rv.Type() } if ty.Kind() != reflect.Struct { panic(fmt.Sprintf("value is %s, not struct", ty.Kind())) } tags := getFieldTags(ty) labels := make([]string, len(tags.Labels)) for i, lf := range tags.Labels { lv := rv.Field(lf.FieldIndex) // We just stringify whatever we find. It should always be a string // but if not then we'll still do something reasonable. labels[i] = fmt.Sprintf("%s", lv.Interface()) } block := hclwrite.NewBlock(blockType, labels) populateBody(rv, ty, tags, block.Body()) return block } func populateBody(rv reflect.Value, ty reflect.Type, tags *fieldTags, dst *hclwrite.Body) { nameIdxs := make(map[string]int, len(tags.Attributes)+len(tags.Blocks)) namesOrder := make([]string, 0, len(tags.Attributes)+len(tags.Blocks)) for n, i := range tags.Attributes { nameIdxs[n] = i namesOrder = append(namesOrder, n) } for n, i := range tags.Blocks { nameIdxs[n] = i namesOrder = append(namesOrder, n) } sort.SliceStable(namesOrder, func(i, j int) bool { ni, nj := namesOrder[i], namesOrder[j] return nameIdxs[ni] < nameIdxs[nj] }) dst.Clear() prevWasBlock := false for _, name := range namesOrder { fieldIdx := nameIdxs[name] field := ty.Field(fieldIdx) fieldTy := field.Type fieldVal := rv.Field(fieldIdx) if fieldTy.Kind() == reflect.Ptr { fieldTy = fieldTy.Elem() fieldVal = fieldVal.Elem() } if _, isAttr := tags.Attributes[name]; isAttr { if exprType.AssignableTo(fieldTy) || attrType.AssignableTo(fieldTy) { continue // ignore undecoded fields } if !fieldVal.IsValid() { continue // ignore (field value is nil pointer) } if fieldTy.Kind() == reflect.Ptr && fieldVal.IsNil() { continue // ignore } if prevWasBlock { dst.AppendNewline() prevWasBlock = false } valTy, err := gocty.ImpliedType(fieldVal.Interface()) if err != nil { panic(fmt.Sprintf("cannot encode %T as HCL expression: %s", fieldVal.Interface(), err)) } val, err := gocty.ToCtyValue(fieldVal.Interface(), valTy) if err != nil { // This should never happen, since we should always be able // to decode into the implied type. panic(fmt.Sprintf("failed to encode %T as %#v: %s", fieldVal.Interface(), valTy, err)) } dst.SetAttributeValue(name, val) } else { // must be a block, then elemTy := fieldTy isSeq := false if elemTy.Kind() == reflect.Slice || elemTy.Kind() == reflect.Array { isSeq = true elemTy = elemTy.Elem() } if bodyType.AssignableTo(elemTy) || attrsType.AssignableTo(elemTy) { continue // ignore undecoded fields } prevWasBlock = false if isSeq { l := fieldVal.Len() for i := 0; i < l; i++ { elemVal := fieldVal.Index(i) if !elemVal.IsValid() { continue // ignore (elem value is nil pointer) } if elemTy.Kind() == reflect.Ptr && elemVal.IsNil() { continue // ignore } block := EncodeAsBlock(elemVal.Interface(), name) if !prevWasBlock { dst.AppendNewline() prevWasBlock = true } dst.AppendBlock(block) } } else { if !fieldVal.IsValid() { continue // ignore (field value is nil pointer) } if elemTy.Kind() == reflect.Ptr && fieldVal.IsNil() { continue // ignore } block := EncodeAsBlock(fieldVal.Interface(), name) if !prevWasBlock { dst.AppendNewline() prevWasBlock = true } dst.AppendBlock(block) } } } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/gohcl/schema.go���������������������������������0000664�0000000�0000000�00000007737�13771713062�0024775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package gohcl import ( "fmt" "reflect" "sort" "strings" "github.com/hashicorp/hcl/v2" ) // ImpliedBodySchema produces a hcl.BodySchema derived from the type of the // given value, which must be a struct value or a pointer to one. If an // inappropriate value is passed, this function will panic. // // The second return argument indicates whether the given struct includes // a "remain" field, and thus the returned schema is non-exhaustive. // // This uses the tags on the fields of the struct to discover how each // field's value should be expressed within configuration. If an invalid // mapping is attempted, this function will panic. func ImpliedBodySchema(val interface{}) (schema *hcl.BodySchema, partial bool) { ty := reflect.TypeOf(val) if ty.Kind() == reflect.Ptr { ty = ty.Elem() } if ty.Kind() != reflect.Struct { panic(fmt.Sprintf("given value must be struct, not %T", val)) } var attrSchemas []hcl.AttributeSchema var blockSchemas []hcl.BlockHeaderSchema tags := getFieldTags(ty) attrNames := make([]string, 0, len(tags.Attributes)) for n := range tags.Attributes { attrNames = append(attrNames, n) } sort.Strings(attrNames) for _, n := range attrNames { idx := tags.Attributes[n] optional := tags.Optional[n] field := ty.Field(idx) var required bool switch { case field.Type.AssignableTo(exprType): // If we're decoding to hcl.Expression then absense can be // indicated via a null value, so we don't specify that // the field is required during decoding. required = false case field.Type.Kind() != reflect.Ptr && !optional: required = true default: required = false } attrSchemas = append(attrSchemas, hcl.AttributeSchema{ Name: n, Required: required, }) } blockNames := make([]string, 0, len(tags.Blocks)) for n := range tags.Blocks { blockNames = append(blockNames, n) } sort.Strings(blockNames) for _, n := range blockNames { idx := tags.Blocks[n] field := ty.Field(idx) fty := field.Type if fty.Kind() == reflect.Slice { fty = fty.Elem() } if fty.Kind() == reflect.Ptr { fty = fty.Elem() } if fty.Kind() != reflect.Struct { panic(fmt.Sprintf( "hcl 'block' tag kind cannot be applied to %s field %s: struct required", field.Type.String(), field.Name, )) } ftags := getFieldTags(fty) var labelNames []string if len(ftags.Labels) > 0 { labelNames = make([]string, len(ftags.Labels)) for i, l := range ftags.Labels { labelNames[i] = l.Name } } blockSchemas = append(blockSchemas, hcl.BlockHeaderSchema{ Type: n, LabelNames: labelNames, }) } partial = tags.Remain != nil schema = &hcl.BodySchema{ Attributes: attrSchemas, Blocks: blockSchemas, } return schema, partial } type fieldTags struct { Attributes map[string]int Blocks map[string]int Labels []labelField Remain *int Optional map[string]bool } type labelField struct { FieldIndex int Name string } func getFieldTags(ty reflect.Type) *fieldTags { ret := &fieldTags{ Attributes: map[string]int{}, Blocks: map[string]int{}, Optional: map[string]bool{}, } ct := ty.NumField() for i := 0; i < ct; i++ { field := ty.Field(i) tag := field.Tag.Get("hcl") if tag == "" { continue } comma := strings.Index(tag, ",") var name, kind string if comma != -1 { name = tag[:comma] kind = tag[comma+1:] } else { name = tag kind = "attr" } switch kind { case "attr": ret.Attributes[name] = i case "block": ret.Blocks[name] = i case "label": ret.Labels = append(ret.Labels, labelField{ FieldIndex: i, Name: name, }) case "remain": if ret.Remain != nil { panic("only one 'remain' tag is permitted") } idx := i // copy, because this loop will continue assigning to i ret.Remain = &idx case "optional": ret.Attributes[name] = i ret.Optional[name] = true default: panic(fmt.Sprintf("invalid hcl field tag kind %q on %s %q", kind, field.Type.String(), field.Name)) } } return ret } ���������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/gohcl/types.go����������������������������������0000664�0000000�0000000�00000000574�13771713062�0024671�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package gohcl import ( "reflect" "github.com/hashicorp/hcl/v2" ) var victimExpr hcl.Expression var victimBody hcl.Body var exprType = reflect.TypeOf(&victimExpr).Elem() var bodyType = reflect.TypeOf(&victimBody).Elem() var blockType = reflect.TypeOf((*hcl.Block)(nil)) var attrType = reflect.TypeOf((*hcl.Attribute)(nil)) var attrsType = reflect.TypeOf(hcl.Attributes(nil)) ������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/�����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023316�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/block_labels.go��������������������������0000664�0000000�0000000�00000000537�13771713062�0026266�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcldec import ( "github.com/hashicorp/hcl/v2" ) type blockLabel struct { Value string Range hcl.Range } func labelsForBlock(block *hcl.Block) []blockLabel { ret := make([]blockLabel, len(block.Labels)) for i := range block.Labels { ret[i] = blockLabel{ Value: block.Labels[i], Range: block.LabelRanges[i], } } return ret } �����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/decode.go��������������������������������0000664�0000000�0000000�00000001555�13771713062�0025076�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcldec import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) func decode(body hcl.Body, blockLabels []blockLabel, ctx *hcl.EvalContext, spec Spec, partial bool) (cty.Value, hcl.Body, hcl.Diagnostics) { schema := ImpliedSchema(spec) var content *hcl.BodyContent var diags hcl.Diagnostics var leftovers hcl.Body if partial { content, leftovers, diags = body.PartialContent(schema) } else { content, diags = body.Content(schema) } val, valDiags := spec.decode(content, blockLabels, ctx) diags = append(diags, valDiags...) return val, leftovers, diags } func impliedType(spec Spec) cty.Type { return spec.impliedType() } func sourceRange(body hcl.Body, blockLabels []blockLabel, spec Spec) hcl.Range { schema := ImpliedSchema(spec) content, _, _ := body.PartialContent(schema) return spec.sourceRange(content, blockLabels) } ���������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/doc.go�����������������������������������0000664�0000000�0000000�00000001150�13771713062�0024407�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package hcldec provides a higher-level API for unpacking the content of // HCL bodies, implemented in terms of the low-level "Content" API exposed // by the bodies themselves. // // It allows decoding an entire nested configuration in a single operation // by providing a description of the intended structure. // // For some applications it may be more convenient to use the "gohcl" // package, which has a similar purpose but decodes directly into native // Go data types. hcldec instead targets the cty type system, and thus allows // a cty-driven application to remain within that type system. package hcldec ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/gob.go�����������������������������������0000664�0000000�0000000�00000001251�13771713062�0024413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcldec import ( "encoding/gob" ) func init() { // Every Spec implementation should be registered with gob, so that // specs can be sent over gob channels, such as using // github.com/hashicorp/go-plugin with plugins that need to describe // what shape of configuration they are expecting. gob.Register(ObjectSpec(nil)) gob.Register(TupleSpec(nil)) gob.Register((*AttrSpec)(nil)) gob.Register((*LiteralSpec)(nil)) gob.Register((*ExprSpec)(nil)) gob.Register((*BlockSpec)(nil)) gob.Register((*BlockListSpec)(nil)) gob.Register((*BlockSetSpec)(nil)) gob.Register((*BlockMapSpec)(nil)) gob.Register((*BlockLabelSpec)(nil)) gob.Register((*DefaultSpec)(nil)) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/public.go��������������������������������0000664�0000000�0000000�00000006021�13771713062�0025122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcldec import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) // Decode interprets the given body using the given specification and returns // the resulting value. If the given body is not valid per the spec, error // diagnostics are returned and the returned value is likely to be incomplete. // // The ctx argument may be nil, in which case any references to variables or // functions will produce error diagnostics. func Decode(body hcl.Body, spec Spec, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { val, _, diags := decode(body, nil, ctx, spec, false) return val, diags } // PartialDecode is like Decode except that it permits "leftover" items in // the top-level body, which are returned as a new body to allow for // further processing. // // Any descendent block bodies are _not_ decoded partially and thus must // be fully described by the given specification. func PartialDecode(body hcl.Body, spec Spec, ctx *hcl.EvalContext) (cty.Value, hcl.Body, hcl.Diagnostics) { return decode(body, nil, ctx, spec, true) } // ImpliedType returns the value type that should result from decoding the // given spec. func ImpliedType(spec Spec) cty.Type { return impliedType(spec) } // SourceRange interprets the given body using the given specification and // then returns the source range of the value that would be used to // fulfill the spec. // // This can be used if application-level validation detects value errors, to // obtain a reasonable SourceRange to use for generated diagnostics. It works // best when applied to specific body items (e.g. using AttrSpec, BlockSpec, ...) // as opposed to entire bodies using ObjectSpec, TupleSpec. The result will // be less useful the broader the specification, so e.g. a spec that returns // the entirety of all of the blocks of a given type is likely to be // _particularly_ arbitrary and useless. // // If the given body is not valid per the given spec, the result is best-effort // and may not actually be something ideal. It's expected that an application // will already have used Decode or PartialDecode earlier and thus had an // opportunity to detect and report spec violations. func SourceRange(body hcl.Body, spec Spec) hcl.Range { return sourceRange(body, nil, spec) } // ChildBlockTypes returns a map of all of the child block types declared // by the given spec, with block type names as keys and the associated // nested body specs as values. func ChildBlockTypes(spec Spec) map[string]Spec { ret := map[string]Spec{} // visitSameBodyChildren walks through the spec structure, calling // the given callback for each descendent spec encountered. We are // interested in the specs that reference attributes and blocks. var visit visitFunc visit = func(s Spec) { if bs, ok := s.(blockSpec); ok { for _, blockS := range bs.blockHeaderSchemata() { nested := bs.nestedSpec() if nested != nil { // nil can be returned to dynamically opt out of this interface ret[blockS.Type] = nested } } } s.visitSameBodyChildren(visit) } visit(spec) return ret } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/schema.go��������������������������������0000664�0000000�0000000�00000001630�13771713062�0025105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcldec import ( "github.com/hashicorp/hcl/v2" ) // ImpliedSchema returns the *hcl.BodySchema implied by the given specification. // This is the schema that the Decode function will use internally to // access the content of a given body. func ImpliedSchema(spec Spec) *hcl.BodySchema { var attrs []hcl.AttributeSchema var blocks []hcl.BlockHeaderSchema // visitSameBodyChildren walks through the spec structure, calling // the given callback for each descendent spec encountered. We are // interested in the specs that reference attributes and blocks. var visit visitFunc visit = func(s Spec) { if as, ok := s.(attrSpec); ok { attrs = append(attrs, as.attrSchemata()...) } if bs, ok := s.(blockSpec); ok { blocks = append(blocks, bs.blockHeaderSchemata()...) } s.visitSameBodyChildren(visit) } visit(spec) return &hcl.BodySchema{ Attributes: attrs, Blocks: blocks, } } ��������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/spec.go����������������������������������0000664�0000000�0000000�00000135561�13771713062�0024612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcldec import ( "bytes" "fmt" "sort" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" ) // A Spec is a description of how to decode a hcl.Body to a cty.Value. // // The various other types in this package whose names end in "Spec" are // the spec implementations. The most common top-level spec is ObjectSpec, // which decodes body content into a cty.Value of an object type. type Spec interface { // Perform the decode operation on the given body, in the context of // the given block (which might be null), using the given eval context. // // "block" is provided only by the nested calls performed by the spec // types that work on block bodies. decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) // Return the cty.Type that should be returned when decoding a body with // this spec. impliedType() cty.Type // Call the given callback once for each of the nested specs that would // get decoded with the same body and block as the receiver. This should // not descend into the nested specs used when decoding blocks. visitSameBodyChildren(cb visitFunc) // Determine the source range of the value that would be returned for the // spec in the given content, in the context of the given block // (which might be null). If the corresponding item is missing, return // a place where it might be inserted. sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range } type visitFunc func(spec Spec) // An ObjectSpec is a Spec that produces a cty.Value of an object type whose // attributes correspond to the keys of the spec map. type ObjectSpec map[string]Spec // attrSpec is implemented by specs that require attributes from the body. type attrSpec interface { attrSchemata() []hcl.AttributeSchema } // blockSpec is implemented by specs that require blocks from the body. type blockSpec interface { blockHeaderSchemata() []hcl.BlockHeaderSchema nestedSpec() Spec } // specNeedingVariables is implemented by specs that can use variables // from the EvalContext, to declare which variables they need. type specNeedingVariables interface { variablesNeeded(content *hcl.BodyContent) []hcl.Traversal } func (s ObjectSpec) visitSameBodyChildren(cb visitFunc) { for _, c := range s { cb(c) } } func (s ObjectSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { vals := make(map[string]cty.Value, len(s)) var diags hcl.Diagnostics for k, spec := range s { var kd hcl.Diagnostics vals[k], kd = spec.decode(content, blockLabels, ctx) diags = append(diags, kd...) } return cty.ObjectVal(vals), diags } func (s ObjectSpec) impliedType() cty.Type { if len(s) == 0 { return cty.EmptyObject } attrTypes := make(map[string]cty.Type) for k, childSpec := range s { attrTypes[k] = childSpec.impliedType() } return cty.Object(attrTypes) } func (s ObjectSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // This is not great, but the best we can do. In practice, it's rather // strange to ask for the source range of an entire top-level body, since // that's already readily available to the caller. return content.MissingItemRange } // A TupleSpec is a Spec that produces a cty.Value of a tuple type whose // elements correspond to the elements of the spec slice. type TupleSpec []Spec func (s TupleSpec) visitSameBodyChildren(cb visitFunc) { for _, c := range s { cb(c) } } func (s TupleSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { vals := make([]cty.Value, len(s)) var diags hcl.Diagnostics for i, spec := range s { var ed hcl.Diagnostics vals[i], ed = spec.decode(content, blockLabels, ctx) diags = append(diags, ed...) } return cty.TupleVal(vals), diags } func (s TupleSpec) impliedType() cty.Type { if len(s) == 0 { return cty.EmptyTuple } attrTypes := make([]cty.Type, len(s)) for i, childSpec := range s { attrTypes[i] = childSpec.impliedType() } return cty.Tuple(attrTypes) } func (s TupleSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // This is not great, but the best we can do. In practice, it's rather // strange to ask for the source range of an entire top-level body, since // that's already readily available to the caller. return content.MissingItemRange } // An AttrSpec is a Spec that evaluates a particular attribute expression in // the body and returns its resulting value converted to the requested type, // or produces a diagnostic if the type is incorrect. type AttrSpec struct { Name string Type cty.Type Required bool } func (s *AttrSpec) visitSameBodyChildren(cb visitFunc) { // leaf node } // specNeedingVariables implementation func (s *AttrSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { attr, exists := content.Attributes[s.Name] if !exists { return nil } return attr.Expr.Variables() } // attrSpec implementation func (s *AttrSpec) attrSchemata() []hcl.AttributeSchema { return []hcl.AttributeSchema{ { Name: s.Name, Required: s.Required, }, } } func (s *AttrSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { attr, exists := content.Attributes[s.Name] if !exists { return content.MissingItemRange } return attr.Expr.Range() } func (s *AttrSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { attr, exists := content.Attributes[s.Name] if !exists { // We don't need to check required and emit a diagnostic here, because // that would already have happened when building "content". return cty.NullVal(s.Type), nil } if decodeFn := customdecode.CustomExpressionDecoderForType(s.Type); decodeFn != nil { v, diags := decodeFn(attr.Expr, ctx) if v == cty.NilVal { v = cty.UnknownVal(s.Type) } return v, diags } val, diags := attr.Expr.Value(ctx) convVal, err := convert.Convert(val, s.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect attribute value type", Detail: fmt.Sprintf( "Inappropriate value for attribute %q: %s.", s.Name, err.Error(), ), Subject: attr.Expr.Range().Ptr(), Context: hcl.RangeBetween(attr.NameRange, attr.Expr.Range()).Ptr(), Expression: attr.Expr, EvalContext: ctx, }) // We'll return an unknown value of the _correct_ type so that the // incomplete result can still be used for some analysis use-cases. val = cty.UnknownVal(s.Type) } else { val = convVal } return val, diags } func (s *AttrSpec) impliedType() cty.Type { return s.Type } // A LiteralSpec is a Spec that produces the given literal value, ignoring // the given body. type LiteralSpec struct { Value cty.Value } func (s *LiteralSpec) visitSameBodyChildren(cb visitFunc) { // leaf node } func (s *LiteralSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return s.Value, nil } func (s *LiteralSpec) impliedType() cty.Type { return s.Value.Type() } func (s *LiteralSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // No sensible range to return for a literal, so the caller had better // ensure it doesn't cause any diagnostics. return hcl.Range{ Filename: "<unknown>", } } // An ExprSpec is a Spec that evaluates the given expression, ignoring the // given body. type ExprSpec struct { Expr hcl.Expression } func (s *ExprSpec) visitSameBodyChildren(cb visitFunc) { // leaf node } // specNeedingVariables implementation func (s *ExprSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { return s.Expr.Variables() } func (s *ExprSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return s.Expr.Value(ctx) } func (s *ExprSpec) impliedType() cty.Type { // We can't know the type of our expression until we evaluate it return cty.DynamicPseudoType } func (s *ExprSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { return s.Expr.Range() } // A BlockSpec is a Spec that produces a cty.Value by decoding the contents // of a single nested block of a given type, using a nested spec. // // If the Required flag is not set, the nested block may be omitted, in which // case a null value is produced. If it _is_ set, an error diagnostic is // produced if there are no nested blocks of the given type. type BlockSpec struct { TypeName string Nested Spec Required bool } func (s *BlockSpec) visitSameBodyChildren(cb visitFunc) { // leaf node ("Nested" does not use the same body) } // blockSpec implementation func (s *BlockSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { return []hcl.BlockHeaderSchema{ { Type: s.TypeName, LabelNames: findLabelSpecs(s.Nested), }, } } // blockSpec implementation func (s *BlockSpec) nestedSpec() Spec { return s.Nested } // specNeedingVariables implementation func (s *BlockSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } childBlock = candidate break } if childBlock == nil { return nil } return Variables(childBlock.Body, s.Nested) } func (s *BlockSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } if childBlock != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Duplicate %s block", s.TypeName), Detail: fmt.Sprintf( "Only one block of type %q is allowed. Previous definition was at %s.", s.TypeName, childBlock.DefRange.String(), ), Subject: &candidate.DefRange, }) break } childBlock = candidate } if childBlock == nil { if s.Required { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Missing %s block", s.TypeName), Detail: fmt.Sprintf( "A block of type %q is required here.", s.TypeName, ), Subject: &content.MissingItemRange, }) } return cty.NullVal(s.Nested.impliedType()), diags } if s.Nested == nil { panic("BlockSpec with no Nested Spec") } val, _, childDiags := decode(childBlock.Body, labelsForBlock(childBlock), ctx, s.Nested, false) diags = append(diags, childDiags...) return val, diags } func (s *BlockSpec) impliedType() cty.Type { return s.Nested.impliedType() } func (s *BlockSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } childBlock = candidate break } if childBlock == nil { return content.MissingItemRange } return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) } // A BlockListSpec is a Spec that produces a cty list of the results of // decoding all of the nested blocks of a given type, using a nested spec. type BlockListSpec struct { TypeName string Nested Spec MinItems int MaxItems int } func (s *BlockListSpec) visitSameBodyChildren(cb visitFunc) { // leaf node ("Nested" does not use the same body) } // blockSpec implementation func (s *BlockListSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { return []hcl.BlockHeaderSchema{ { Type: s.TypeName, LabelNames: findLabelSpecs(s.Nested), }, } } // blockSpec implementation func (s *BlockListSpec) nestedSpec() Spec { return s.Nested } // specNeedingVariables implementation func (s *BlockListSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { var ret []hcl.Traversal for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } ret = append(ret, Variables(childBlock.Body, s.Nested)...) } return ret } func (s *BlockListSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics if s.Nested == nil { panic("BlockListSpec with no Nested Spec") } var elems []cty.Value var sourceRanges []hcl.Range for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } val, _, childDiags := decode(childBlock.Body, labelsForBlock(childBlock), ctx, s.Nested, false) diags = append(diags, childDiags...) elems = append(elems, val) sourceRanges = append(sourceRanges, sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested)) } if len(elems) < s.MinItems { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Insufficient %s blocks", s.TypeName), Detail: fmt.Sprintf("At least %d %q blocks are required.", s.MinItems, s.TypeName), Subject: &content.MissingItemRange, }) } else if s.MaxItems > 0 && len(elems) > s.MaxItems { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Too many %s blocks", s.TypeName), Detail: fmt.Sprintf("No more than %d %q blocks are allowed", s.MaxItems, s.TypeName), Subject: &sourceRanges[s.MaxItems], }) } var ret cty.Value if len(elems) == 0 { ret = cty.ListValEmpty(s.Nested.impliedType()) } else { // Since our target is a list, all of the decoded elements must have the // same type or cty.ListVal will panic below. Different types can arise // if there is an attribute spec of type cty.DynamicPseudoType in the // nested spec; all given values must be convertable to a single type // in order for the result to be considered valid. etys := make([]cty.Type, len(elems)) for i, v := range elems { etys[i] = v.Type() } ety, convs := convert.UnifyUnsafe(etys) if ety == cty.NilType { // FIXME: This is a pretty terrible error message. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unconsistent argument types in %s blocks", s.TypeName), Detail: "Corresponding attributes in all blocks of this type must be the same.", Subject: &sourceRanges[0], }) return cty.DynamicVal, diags } for i, v := range elems { if convs[i] != nil { newV, err := convs[i](v) if err != nil { // FIXME: This is a pretty terrible error message. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unconsistent argument types in %s blocks", s.TypeName), Detail: fmt.Sprintf("Block with index %d has inconsistent argument types: %s.", i, err), Subject: &sourceRanges[i], }) // Bail early here so we won't panic below in cty.ListVal return cty.DynamicVal, diags } elems[i] = newV } } ret = cty.ListVal(elems) } return ret, diags } func (s *BlockListSpec) impliedType() cty.Type { return cty.List(s.Nested.impliedType()) } func (s *BlockListSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We return the source range of the _first_ block of the given type, // since they are not guaranteed to form a contiguous range. var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } childBlock = candidate break } if childBlock == nil { return content.MissingItemRange } return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) } // A BlockTupleSpec is a Spec that produces a cty tuple of the results of // decoding all of the nested blocks of a given type, using a nested spec. // // This is similar to BlockListSpec, but it permits the nested blocks to have // different result types in situations where cty.DynamicPseudoType attributes // are present. type BlockTupleSpec struct { TypeName string Nested Spec MinItems int MaxItems int } func (s *BlockTupleSpec) visitSameBodyChildren(cb visitFunc) { // leaf node ("Nested" does not use the same body) } // blockSpec implementation func (s *BlockTupleSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { return []hcl.BlockHeaderSchema{ { Type: s.TypeName, LabelNames: findLabelSpecs(s.Nested), }, } } // blockSpec implementation func (s *BlockTupleSpec) nestedSpec() Spec { return s.Nested } // specNeedingVariables implementation func (s *BlockTupleSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { var ret []hcl.Traversal for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } ret = append(ret, Variables(childBlock.Body, s.Nested)...) } return ret } func (s *BlockTupleSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics if s.Nested == nil { panic("BlockListSpec with no Nested Spec") } var elems []cty.Value var sourceRanges []hcl.Range for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } val, _, childDiags := decode(childBlock.Body, labelsForBlock(childBlock), ctx, s.Nested, false) diags = append(diags, childDiags...) elems = append(elems, val) sourceRanges = append(sourceRanges, sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested)) } if len(elems) < s.MinItems { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Insufficient %s blocks", s.TypeName), Detail: fmt.Sprintf("At least %d %q blocks are required.", s.MinItems, s.TypeName), Subject: &content.MissingItemRange, }) } else if s.MaxItems > 0 && len(elems) > s.MaxItems { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Too many %s blocks", s.TypeName), Detail: fmt.Sprintf("No more than %d %q blocks are allowed", s.MaxItems, s.TypeName), Subject: &sourceRanges[s.MaxItems], }) } var ret cty.Value if len(elems) == 0 { ret = cty.EmptyTupleVal } else { ret = cty.TupleVal(elems) } return ret, diags } func (s *BlockTupleSpec) impliedType() cty.Type { // We can't predict our type, because we don't know how many blocks // there will be until we decode. return cty.DynamicPseudoType } func (s *BlockTupleSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We return the source range of the _first_ block of the given type, // since they are not guaranteed to form a contiguous range. var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } childBlock = candidate break } if childBlock == nil { return content.MissingItemRange } return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) } // A BlockSetSpec is a Spec that produces a cty set of the results of // decoding all of the nested blocks of a given type, using a nested spec. type BlockSetSpec struct { TypeName string Nested Spec MinItems int MaxItems int } func (s *BlockSetSpec) visitSameBodyChildren(cb visitFunc) { // leaf node ("Nested" does not use the same body) } // blockSpec implementation func (s *BlockSetSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { return []hcl.BlockHeaderSchema{ { Type: s.TypeName, LabelNames: findLabelSpecs(s.Nested), }, } } // blockSpec implementation func (s *BlockSetSpec) nestedSpec() Spec { return s.Nested } // specNeedingVariables implementation func (s *BlockSetSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { var ret []hcl.Traversal for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } ret = append(ret, Variables(childBlock.Body, s.Nested)...) } return ret } func (s *BlockSetSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics if s.Nested == nil { panic("BlockSetSpec with no Nested Spec") } var elems []cty.Value var sourceRanges []hcl.Range for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } val, _, childDiags := decode(childBlock.Body, labelsForBlock(childBlock), ctx, s.Nested, false) diags = append(diags, childDiags...) elems = append(elems, val) sourceRanges = append(sourceRanges, sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested)) } if len(elems) < s.MinItems { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Insufficient %s blocks", s.TypeName), Detail: fmt.Sprintf("At least %d %q blocks are required.", s.MinItems, s.TypeName), Subject: &content.MissingItemRange, }) } else if s.MaxItems > 0 && len(elems) > s.MaxItems { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Too many %s blocks", s.TypeName), Detail: fmt.Sprintf("No more than %d %q blocks are allowed", s.MaxItems, s.TypeName), Subject: &sourceRanges[s.MaxItems], }) } var ret cty.Value if len(elems) == 0 { ret = cty.SetValEmpty(s.Nested.impliedType()) } else { // Since our target is a set, all of the decoded elements must have the // same type or cty.SetVal will panic below. Different types can arise // if there is an attribute spec of type cty.DynamicPseudoType in the // nested spec; all given values must be convertable to a single type // in order for the result to be considered valid. etys := make([]cty.Type, len(elems)) for i, v := range elems { etys[i] = v.Type() } ety, convs := convert.UnifyUnsafe(etys) if ety == cty.NilType { // FIXME: This is a pretty terrible error message. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unconsistent argument types in %s blocks", s.TypeName), Detail: "Corresponding attributes in all blocks of this type must be the same.", Subject: &sourceRanges[0], }) return cty.DynamicVal, diags } for i, v := range elems { if convs[i] != nil { newV, err := convs[i](v) if err != nil { // FIXME: This is a pretty terrible error message. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unconsistent argument types in %s blocks", s.TypeName), Detail: fmt.Sprintf("Block with index %d has inconsistent argument types: %s.", i, err), Subject: &sourceRanges[i], }) // Bail early here so we won't panic below in cty.ListVal return cty.DynamicVal, diags } elems[i] = newV } } ret = cty.SetVal(elems) } return ret, diags } func (s *BlockSetSpec) impliedType() cty.Type { return cty.Set(s.Nested.impliedType()) } func (s *BlockSetSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We return the source range of the _first_ block of the given type, // since they are not guaranteed to form a contiguous range. var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } childBlock = candidate break } if childBlock == nil { return content.MissingItemRange } return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) } // A BlockMapSpec is a Spec that produces a cty map of the results of // decoding all of the nested blocks of a given type, using a nested spec. // // One level of map structure is created for each of the given label names. // There must be at least one given label name. type BlockMapSpec struct { TypeName string LabelNames []string Nested Spec } func (s *BlockMapSpec) visitSameBodyChildren(cb visitFunc) { // leaf node ("Nested" does not use the same body) } // blockSpec implementation func (s *BlockMapSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { return []hcl.BlockHeaderSchema{ { Type: s.TypeName, LabelNames: append(s.LabelNames, findLabelSpecs(s.Nested)...), }, } } // blockSpec implementation func (s *BlockMapSpec) nestedSpec() Spec { return s.Nested } // specNeedingVariables implementation func (s *BlockMapSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { var ret []hcl.Traversal for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } ret = append(ret, Variables(childBlock.Body, s.Nested)...) } return ret } func (s *BlockMapSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics if s.Nested == nil { panic("BlockMapSpec with no Nested Spec") } if ImpliedType(s).HasDynamicTypes() { panic("cty.DynamicPseudoType attributes may not be used inside a BlockMapSpec") } elems := map[string]interface{}{} for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } childLabels := labelsForBlock(childBlock) val, _, childDiags := decode(childBlock.Body, childLabels[len(s.LabelNames):], ctx, s.Nested, false) targetMap := elems for _, key := range childBlock.Labels[:len(s.LabelNames)-1] { if _, exists := targetMap[key]; !exists { targetMap[key] = make(map[string]interface{}) } targetMap = targetMap[key].(map[string]interface{}) } diags = append(diags, childDiags...) key := childBlock.Labels[len(s.LabelNames)-1] if _, exists := targetMap[key]; exists { labelsBuf := bytes.Buffer{} for _, label := range childBlock.Labels { fmt.Fprintf(&labelsBuf, " %q", label) } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Duplicate %s block", s.TypeName), Detail: fmt.Sprintf( "A block for %s%s was already defined. The %s labels must be unique.", s.TypeName, labelsBuf.String(), s.TypeName, ), Subject: &childBlock.DefRange, }) continue } targetMap[key] = val } if len(elems) == 0 { return cty.MapValEmpty(s.Nested.impliedType()), diags } var ctyMap func(map[string]interface{}, int) cty.Value ctyMap = func(raw map[string]interface{}, depth int) cty.Value { vals := make(map[string]cty.Value, len(raw)) if depth == 1 { for k, v := range raw { vals[k] = v.(cty.Value) } } else { for k, v := range raw { vals[k] = ctyMap(v.(map[string]interface{}), depth-1) } } return cty.MapVal(vals) } return ctyMap(elems, len(s.LabelNames)), diags } func (s *BlockMapSpec) impliedType() cty.Type { ret := s.Nested.impliedType() for _ = range s.LabelNames { ret = cty.Map(ret) } return ret } func (s *BlockMapSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We return the source range of the _first_ block of the given type, // since they are not guaranteed to form a contiguous range. var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } childBlock = candidate break } if childBlock == nil { return content.MissingItemRange } return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) } // A BlockObjectSpec is a Spec that produces a cty object of the results of // decoding all of the nested blocks of a given type, using a nested spec. // // One level of object structure is created for each of the given label names. // There must be at least one given label name. // // This is similar to BlockMapSpec, but it permits the nested blocks to have // different result types in situations where cty.DynamicPseudoType attributes // are present. type BlockObjectSpec struct { TypeName string LabelNames []string Nested Spec } func (s *BlockObjectSpec) visitSameBodyChildren(cb visitFunc) { // leaf node ("Nested" does not use the same body) } // blockSpec implementation func (s *BlockObjectSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { return []hcl.BlockHeaderSchema{ { Type: s.TypeName, LabelNames: append(s.LabelNames, findLabelSpecs(s.Nested)...), }, } } // blockSpec implementation func (s *BlockObjectSpec) nestedSpec() Spec { return s.Nested } // specNeedingVariables implementation func (s *BlockObjectSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { var ret []hcl.Traversal for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } ret = append(ret, Variables(childBlock.Body, s.Nested)...) } return ret } func (s *BlockObjectSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics if s.Nested == nil { panic("BlockObjectSpec with no Nested Spec") } elems := map[string]interface{}{} for _, childBlock := range content.Blocks { if childBlock.Type != s.TypeName { continue } childLabels := labelsForBlock(childBlock) val, _, childDiags := decode(childBlock.Body, childLabels[len(s.LabelNames):], ctx, s.Nested, false) targetMap := elems for _, key := range childBlock.Labels[:len(s.LabelNames)-1] { if _, exists := targetMap[key]; !exists { targetMap[key] = make(map[string]interface{}) } targetMap = targetMap[key].(map[string]interface{}) } diags = append(diags, childDiags...) key := childBlock.Labels[len(s.LabelNames)-1] if _, exists := targetMap[key]; exists { labelsBuf := bytes.Buffer{} for _, label := range childBlock.Labels { fmt.Fprintf(&labelsBuf, " %q", label) } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Duplicate %s block", s.TypeName), Detail: fmt.Sprintf( "A block for %s%s was already defined. The %s labels must be unique.", s.TypeName, labelsBuf.String(), s.TypeName, ), Subject: &childBlock.DefRange, }) continue } targetMap[key] = val } if len(elems) == 0 { return cty.EmptyObjectVal, diags } var ctyObj func(map[string]interface{}, int) cty.Value ctyObj = func(raw map[string]interface{}, depth int) cty.Value { vals := make(map[string]cty.Value, len(raw)) if depth == 1 { for k, v := range raw { vals[k] = v.(cty.Value) } } else { for k, v := range raw { vals[k] = ctyObj(v.(map[string]interface{}), depth-1) } } return cty.ObjectVal(vals) } return ctyObj(elems, len(s.LabelNames)), diags } func (s *BlockObjectSpec) impliedType() cty.Type { // We can't predict our type, since we don't know how many blocks are // present and what labels they have until we decode. return cty.DynamicPseudoType } func (s *BlockObjectSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We return the source range of the _first_ block of the given type, // since they are not guaranteed to form a contiguous range. var childBlock *hcl.Block for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } childBlock = candidate break } if childBlock == nil { return content.MissingItemRange } return sourceRange(childBlock.Body, labelsForBlock(childBlock), s.Nested) } // A BlockAttrsSpec is a Spec that interprets a single block as if it were // a map of some element type. That is, each attribute within the block // becomes a key in the resulting map and the attribute's value becomes the // element value, after conversion to the given element type. The resulting // value is a cty.Map of the given element type. // // This spec imposes a validation constraint that there be exactly one block // of the given type name and that this block may contain only attributes. The // block does not accept any labels. // // This is an alternative to an AttrSpec of a map type for situations where // block syntax is desired. Note that block syntax does not permit dynamic // keys, construction of the result via a "for" expression, etc. In most cases // an AttrSpec is preferred if the desired result is a map whose keys are // chosen by the user rather than by schema. type BlockAttrsSpec struct { TypeName string ElementType cty.Type Required bool } func (s *BlockAttrsSpec) visitSameBodyChildren(cb visitFunc) { // leaf node } // blockSpec implementation func (s *BlockAttrsSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { return []hcl.BlockHeaderSchema{ { Type: s.TypeName, LabelNames: nil, }, } } // blockSpec implementation func (s *BlockAttrsSpec) nestedSpec() Spec { // This is an odd case: we aren't actually going to apply a nested spec // in this case, since we're going to interpret the body directly as // attributes, but we need to return something non-nil so that the // decoder will recognize this as a block spec. We won't actually be // using this for anything at decode time. return noopSpec{} } // specNeedingVariables implementation func (s *BlockAttrsSpec) variablesNeeded(content *hcl.BodyContent) []hcl.Traversal { block, _ := s.findBlock(content) if block == nil { return nil } var vars []hcl.Traversal attrs, diags := block.Body.JustAttributes() if diags.HasErrors() { return nil } for _, attr := range attrs { vars = append(vars, attr.Expr.Variables()...) } // We'll return the variables references in source order so that any // error messages that result are also in source order. sort.Slice(vars, func(i, j int) bool { return vars[i].SourceRange().Start.Byte < vars[j].SourceRange().Start.Byte }) return vars } func (s *BlockAttrsSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics block, other := s.findBlock(content) if block == nil { if s.Required { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Missing %s block", s.TypeName), Detail: fmt.Sprintf( "A block of type %q is required here.", s.TypeName, ), Subject: &content.MissingItemRange, }) } return cty.NullVal(cty.Map(s.ElementType)), diags } if other != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Duplicate %s block", s.TypeName), Detail: fmt.Sprintf( "Only one block of type %q is allowed. Previous definition was at %s.", s.TypeName, block.DefRange.String(), ), Subject: &other.DefRange, }) } attrs, attrDiags := block.Body.JustAttributes() diags = append(diags, attrDiags...) if len(attrs) == 0 { return cty.MapValEmpty(s.ElementType), diags } vals := make(map[string]cty.Value, len(attrs)) for name, attr := range attrs { if decodeFn := customdecode.CustomExpressionDecoderForType(s.ElementType); decodeFn != nil { attrVal, attrDiags := decodeFn(attr.Expr, ctx) diags = append(diags, attrDiags...) if attrVal == cty.NilVal { attrVal = cty.UnknownVal(s.ElementType) } vals[name] = attrVal continue } attrVal, attrDiags := attr.Expr.Value(ctx) diags = append(diags, attrDiags...) attrVal, err := convert.Convert(attrVal, s.ElementType) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid attribute value", Detail: fmt.Sprintf("Invalid value for attribute of %q block: %s.", s.TypeName, err), Subject: attr.Expr.Range().Ptr(), Context: hcl.RangeBetween(attr.NameRange, attr.Expr.Range()).Ptr(), Expression: attr.Expr, EvalContext: ctx, }) attrVal = cty.UnknownVal(s.ElementType) } vals[name] = attrVal } return cty.MapVal(vals), diags } func (s *BlockAttrsSpec) impliedType() cty.Type { return cty.Map(s.ElementType) } func (s *BlockAttrsSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { block, _ := s.findBlock(content) if block == nil { return content.MissingItemRange } return block.DefRange } func (s *BlockAttrsSpec) findBlock(content *hcl.BodyContent) (block *hcl.Block, other *hcl.Block) { for _, candidate := range content.Blocks { if candidate.Type != s.TypeName { continue } if block != nil { return block, candidate } block = candidate } return block, nil } // A BlockLabelSpec is a Spec that returns a cty.String representing the // label of the block its given body belongs to, if indeed its given body // belongs to a block. It is a programming error to use this in a non-block // context, so this spec will panic in that case. // // This spec only works in the nested spec within a BlockSpec, BlockListSpec, // BlockSetSpec or BlockMapSpec. // // The full set of label specs used against a particular block must have a // consecutive set of indices starting at zero. The maximum index found // defines how many labels the corresponding blocks must have in cty source. type BlockLabelSpec struct { Index int Name string } func (s *BlockLabelSpec) visitSameBodyChildren(cb visitFunc) { // leaf node } func (s *BlockLabelSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { if s.Index >= len(blockLabels) { panic("BlockListSpec used in non-block context") } return cty.StringVal(blockLabels[s.Index].Value), nil } func (s *BlockLabelSpec) impliedType() cty.Type { return cty.String // labels are always strings } func (s *BlockLabelSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { if s.Index >= len(blockLabels) { panic("BlockListSpec used in non-block context") } return blockLabels[s.Index].Range } func findLabelSpecs(spec Spec) []string { maxIdx := -1 var names map[int]string var visit visitFunc visit = func(s Spec) { if ls, ok := s.(*BlockLabelSpec); ok { if maxIdx < ls.Index { maxIdx = ls.Index } if names == nil { names = make(map[int]string) } names[ls.Index] = ls.Name } s.visitSameBodyChildren(visit) } visit(spec) if maxIdx < 0 { return nil // no labels at all } ret := make([]string, maxIdx+1) for i := range ret { name := names[i] if name == "" { // Should never happen if the spec is conformant, since we require // consecutive indices starting at zero. name = fmt.Sprintf("missing%02d", i) } ret[i] = name } return ret } // DefaultSpec is a spec that wraps two specs, evaluating the primary first // and then evaluating the default if the primary returns a null value. // // The two specifications must have the same implied result type for correct // operation. If not, the result is undefined. // // Any requirements imposed by the "Default" spec apply even if "Primary" does // not return null. For example, if the "Default" spec is for a required // attribute then that attribute is always required, regardless of the result // of the "Primary" spec. // // The "Default" spec must not describe a nested block, since otherwise the // result of ChildBlockTypes would not be decidable without evaluation. If // the default spec _does_ describe a nested block then the result is // undefined. type DefaultSpec struct { Primary Spec Default Spec } func (s *DefaultSpec) visitSameBodyChildren(cb visitFunc) { cb(s.Primary) cb(s.Default) } func (s *DefaultSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { val, diags := s.Primary.decode(content, blockLabels, ctx) if val.IsNull() { var moreDiags hcl.Diagnostics val, moreDiags = s.Default.decode(content, blockLabels, ctx) diags = append(diags, moreDiags...) } return val, diags } func (s *DefaultSpec) impliedType() cty.Type { return s.Primary.impliedType() } // attrSpec implementation func (s *DefaultSpec) attrSchemata() []hcl.AttributeSchema { // We must pass through the union of both of our nested specs so that // we'll have both values available in the result. var ret []hcl.AttributeSchema if as, ok := s.Primary.(attrSpec); ok { ret = append(ret, as.attrSchemata()...) } if as, ok := s.Default.(attrSpec); ok { ret = append(ret, as.attrSchemata()...) } return ret } // blockSpec implementation func (s *DefaultSpec) blockHeaderSchemata() []hcl.BlockHeaderSchema { // Only the primary spec may describe a block, since otherwise // our nestedSpec method below can't know which to return. if bs, ok := s.Primary.(blockSpec); ok { return bs.blockHeaderSchemata() } return nil } // blockSpec implementation func (s *DefaultSpec) nestedSpec() Spec { if bs, ok := s.Primary.(blockSpec); ok { return bs.nestedSpec() } return nil } func (s *DefaultSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We can't tell from here which of the two specs will ultimately be used // in our result, so we'll just assume the first. This is usually the right // choice because the default is often a literal spec that doesn't have a // reasonable source range to return anyway. return s.Primary.sourceRange(content, blockLabels) } // TransformExprSpec is a spec that wraps another and then evaluates a given // hcl.Expression on the result. // // The implied type of this spec is determined by evaluating the expression // with an unknown value of the nested spec's implied type, which may cause // the result to be imprecise. This spec should not be used in situations where // precise result type information is needed. type TransformExprSpec struct { Wrapped Spec Expr hcl.Expression TransformCtx *hcl.EvalContext VarName string } func (s *TransformExprSpec) visitSameBodyChildren(cb visitFunc) { cb(s.Wrapped) } func (s *TransformExprSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { wrappedVal, diags := s.Wrapped.decode(content, blockLabels, ctx) if diags.HasErrors() { // We won't try to run our function in this case, because it'll probably // generate confusing additional errors that will distract from the // root cause. return cty.UnknownVal(s.impliedType()), diags } chiCtx := s.TransformCtx.NewChild() chiCtx.Variables = map[string]cty.Value{ s.VarName: wrappedVal, } resultVal, resultDiags := s.Expr.Value(chiCtx) diags = append(diags, resultDiags...) return resultVal, diags } func (s *TransformExprSpec) impliedType() cty.Type { wrappedTy := s.Wrapped.impliedType() chiCtx := s.TransformCtx.NewChild() chiCtx.Variables = map[string]cty.Value{ s.VarName: cty.UnknownVal(wrappedTy), } resultVal, _ := s.Expr.Value(chiCtx) return resultVal.Type() } func (s *TransformExprSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We'll just pass through our wrapped range here, even though that's // not super-accurate, because there's nothing better to return. return s.Wrapped.sourceRange(content, blockLabels) } // TransformFuncSpec is a spec that wraps another and then evaluates a given // cty function with the result. The given function must expect exactly one // argument, where the result of the wrapped spec will be passed. // // The implied type of this spec is determined by type-checking the function // with an unknown value of the nested spec's implied type, which may cause // the result to be imprecise. This spec should not be used in situations where // precise result type information is needed. // // If the given function produces an error when run, this spec will produce // a non-user-actionable diagnostic message. It's the caller's responsibility // to ensure that the given function cannot fail for any non-error result // of the wrapped spec. type TransformFuncSpec struct { Wrapped Spec Func function.Function } func (s *TransformFuncSpec) visitSameBodyChildren(cb visitFunc) { cb(s.Wrapped) } func (s *TransformFuncSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { wrappedVal, diags := s.Wrapped.decode(content, blockLabels, ctx) if diags.HasErrors() { // We won't try to run our function in this case, because it'll probably // generate confusing additional errors that will distract from the // root cause. return cty.UnknownVal(s.impliedType()), diags } resultVal, err := s.Func.Call([]cty.Value{wrappedVal}) if err != nil { // This is not a good example of a diagnostic because it is reporting // a programming error in the calling application, rather than something // an end-user could act on. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Transform function failed", Detail: fmt.Sprintf("Decoder transform returned an error: %s", err), Subject: s.sourceRange(content, blockLabels).Ptr(), }) return cty.UnknownVal(s.impliedType()), diags } return resultVal, diags } func (s *TransformFuncSpec) impliedType() cty.Type { wrappedTy := s.Wrapped.impliedType() resultTy, err := s.Func.ReturnType([]cty.Type{wrappedTy}) if err != nil { // Should never happen with a correctly-configured spec return cty.DynamicPseudoType } return resultTy } func (s *TransformFuncSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // We'll just pass through our wrapped range here, even though that's // not super-accurate, because there's nothing better to return. return s.Wrapped.sourceRange(content, blockLabels) } // ValidateFuncSpec is a spec that allows for extended // developer-defined validation. The validation function receives the // result of the wrapped spec. // // The Subject field of the returned Diagnostic is optional. If not // specified, it is automatically populated with the range covered by // the wrapped spec. // type ValidateSpec struct { Wrapped Spec Func func(value cty.Value) hcl.Diagnostics } func (s *ValidateSpec) visitSameBodyChildren(cb visitFunc) { cb(s.Wrapped) } func (s *ValidateSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { wrappedVal, diags := s.Wrapped.decode(content, blockLabels, ctx) if diags.HasErrors() { // We won't try to run our function in this case, because it'll probably // generate confusing additional errors that will distract from the // root cause. return cty.UnknownVal(s.impliedType()), diags } validateDiags := s.Func(wrappedVal) // Auto-populate the Subject fields if they weren't set. for i := range validateDiags { if validateDiags[i].Subject == nil { validateDiags[i].Subject = s.sourceRange(content, blockLabels).Ptr() } } diags = append(diags, validateDiags...) return wrappedVal, diags } func (s *ValidateSpec) impliedType() cty.Type { return s.Wrapped.impliedType() } func (s *ValidateSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { return s.Wrapped.sourceRange(content, blockLabels) } // noopSpec is a placeholder spec that does nothing, used in situations where // a non-nil placeholder spec is required. It is not exported because there is // no reason to use it directly; it is always an implementation detail only. type noopSpec struct { } func (s noopSpec) decode(content *hcl.BodyContent, blockLabels []blockLabel, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return cty.NullVal(cty.DynamicPseudoType), nil } func (s noopSpec) impliedType() cty.Type { return cty.DynamicPseudoType } func (s noopSpec) visitSameBodyChildren(cb visitFunc) { // nothing to do } func (s noopSpec) sourceRange(content *hcl.BodyContent, blockLabels []blockLabel) hcl.Range { // No useful range for a noopSpec, and nobody should be calling this anyway. return hcl.Range{ Filename: "noopSpec", } } �����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hcldec/variables.go�����������������������������0000664�0000000�0000000�00000002132�13771713062�0025613�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcldec import ( "github.com/hashicorp/hcl/v2" ) // Variables processes the given body with the given spec and returns a // list of the variable traversals that would be required to decode // the same pairing of body and spec. // // This can be used to conditionally populate the variables in the EvalContext // passed to Decode, for applications where a static scope is insufficient. // // If the given body is not compliant with the given schema, the result may // be incomplete, but that's assumed to be okay because the eventual call // to Decode will produce error diagnostics anyway. func Variables(body hcl.Body, spec Spec) []hcl.Traversal { var vars []hcl.Traversal schema := ImpliedSchema(spec) content, _, _ := body.PartialContent(schema) if vs, ok := spec.(specNeedingVariables); ok { vars = append(vars, vs.variablesNeeded(content)...) } var visitFn visitFunc visitFn = func(s Spec) { if vs, ok := s.(specNeedingVariables); ok { vars = append(vars, vs.variablesNeeded(content)...) } s.visitSameBodyChildren(visitFn) } spec.visitSameBodyChildren(visitFn) return vars } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclparse/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023675�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclparse/parser.go������������������������������0000664�0000000�0000000�00000011250�13771713062�0025517�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package hclparse has the main API entry point for parsing both HCL native // syntax and HCL JSON. // // The main HCL package also includes SimpleParse and SimpleParseFile which // can be a simpler interface for the common case where an application just // needs to parse a single file. The gohcl package simplifies that further // in its SimpleDecode function, which combines hcl.SimpleParse with decoding // into Go struct values // // Package hclparse, then, is useful for applications that require more fine // control over parsing or which need to load many separate files and keep // track of them for possible error reporting or other analysis. package hclparse import ( "fmt" "io/ioutil" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/hcl/v2/json" ) // NOTE: This is the public interface for parsing. The actual parsers are // in other packages alongside this one, with this package just wrapping them // to provide a unified interface for the caller across all supported formats. // Parser is the main interface for parsing configuration files. As well as // parsing files, a parser also retains a registry of all of the files it // has parsed so that multiple attempts to parse the same file will return // the same object and so the collected files can be used when printing // diagnostics. // // Any diagnostics for parsing a file are only returned once on the first // call to parse that file. Callers are expected to collect up diagnostics // and present them together, so returning diagnostics for the same file // multiple times would create a confusing result. type Parser struct { files map[string]*hcl.File } // NewParser creates a new parser, ready to parse configuration files. func NewParser() *Parser { return &Parser{ files: map[string]*hcl.File{}, } } // ParseHCL parses the given buffer (which is assumed to have been loaded from // the given filename) as a native-syntax configuration file and returns the // hcl.File object representing it. func (p *Parser) ParseHCL(src []byte, filename string) (*hcl.File, hcl.Diagnostics) { if existing := p.files[filename]; existing != nil { return existing, nil } file, diags := hclsyntax.ParseConfig(src, filename, hcl.Pos{Byte: 0, Line: 1, Column: 1}) p.files[filename] = file return file, diags } // ParseHCLFile reads the given filename and parses it as a native-syntax HCL // configuration file. An error diagnostic is returned if the given file // cannot be read. func (p *Parser) ParseHCLFile(filename string) (*hcl.File, hcl.Diagnostics) { if existing := p.files[filename]; existing != nil { return existing, nil } src, err := ioutil.ReadFile(filename) if err != nil { return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Failed to read file", Detail: fmt.Sprintf("The configuration file %q could not be read.", filename), }, } } return p.ParseHCL(src, filename) } // ParseJSON parses the given JSON buffer (which is assumed to have been loaded // from the given filename) and returns the hcl.File object representing it. func (p *Parser) ParseJSON(src []byte, filename string) (*hcl.File, hcl.Diagnostics) { if existing := p.files[filename]; existing != nil { return existing, nil } file, diags := json.Parse(src, filename) p.files[filename] = file return file, diags } // ParseJSONFile reads the given filename and parses it as JSON, similarly to // ParseJSON. An error diagnostic is returned if the given file cannot be read. func (p *Parser) ParseJSONFile(filename string) (*hcl.File, hcl.Diagnostics) { if existing := p.files[filename]; existing != nil { return existing, nil } file, diags := json.ParseFile(filename) p.files[filename] = file return file, diags } // AddFile allows a caller to record in a parser a file that was parsed some // other way, thus allowing it to be included in the registry of sources. func (p *Parser) AddFile(filename string, file *hcl.File) { p.files[filename] = file } // Sources returns a map from filenames to the raw source code that was // read from them. This is intended to be used, for example, to print // diagnostics with contextual information. // // The arrays underlying the returned slices should not be modified. func (p *Parser) Sources() map[string][]byte { ret := make(map[string][]byte) for fn, f := range p.files { ret[fn] = f.Bytes } return ret } // Files returns a map from filenames to the File objects produced from them. // This is intended to be used, for example, to print diagnostics with // contextual information. // // The returned map and all of the objects it refers to directly or indirectly // must not be modified. func (p *Parser) Files() map[string]*hcl.File { return p.files } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024111�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/diagnostics.go������������������������0000664�0000000�0000000�00000001447�13771713062�0026755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" ) // setDiagEvalContext is an internal helper that will impose a particular // EvalContext on a set of diagnostics in-place, for any diagnostic that // does not already have an EvalContext set. // // We generally expect diagnostics to be immutable, but this is safe to use // on any Diagnostics where none of the contained Diagnostic objects have yet // been seen by a caller. Its purpose is to apply additional context to a // set of diagnostics produced by a "deeper" component as the stack unwinds // during expression evaluation. func setDiagEvalContext(diags hcl.Diagnostics, expr hcl.Expression, ctx *hcl.EvalContext) { for _, diag := range diags { if diag.Expression == nil { diag.Expression = expr diag.EvalContext = ctx } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/didyoumean.go�������������������������0000664�0000000�0000000�00000001455�13771713062�0026603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/agext/levenshtein" ) // nameSuggestion tries to find a name from the given slice of suggested names // that is close to the given name and returns it if found. If no suggestion // is close enough, returns the empty string. // // The suggestions are tried in order, so earlier suggestions take precedence // if the given string is similar to two or more suggestions. // // This function is intended to be used with a relatively-small number of // suggestions. It's not optimized for hundreds or thousands of them. func nameSuggestion(given string, suggestions []string) string { for _, suggestion := range suggestions { dist := levenshtein.Distance(given, suggestion, nil) if dist < 3 { // threshold determined experimentally return suggestion } } return "" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/doc.go��������������������������������0000664�0000000�0000000�00000000503�13771713062�0025203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package hclsyntax contains the parser, AST, etc for HCL's native language, // as opposed to the JSON variant. // // In normal use applications should rarely depend on this package directly, // instead preferring the higher-level interface of the main hcl package and // its companion package hclparse. package hclsyntax ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go�������������������������0000664�0000000�0000000�00000121533�13771713062�0026644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "fmt" "sync" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/ext/customdecode" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" ) // Expression is the abstract type for nodes that behave as HCL expressions. type Expression interface { Node // The hcl.Expression methods are duplicated here, rather than simply // embedded, because both Node and hcl.Expression have a Range method // and so they conflict. Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) Variables() []hcl.Traversal StartRange() hcl.Range } // Assert that Expression implements hcl.Expression var assertExprImplExpr hcl.Expression = Expression(nil) // LiteralValueExpr is an expression that just always returns a given value. type LiteralValueExpr struct { Val cty.Value SrcRange hcl.Range } func (e *LiteralValueExpr) walkChildNodes(w internalWalkFunc) { // Literal values have no child nodes } func (e *LiteralValueExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return e.Val, nil } func (e *LiteralValueExpr) Range() hcl.Range { return e.SrcRange } func (e *LiteralValueExpr) StartRange() hcl.Range { return e.SrcRange } // Implementation for hcl.AbsTraversalForExpr. func (e *LiteralValueExpr) AsTraversal() hcl.Traversal { // This one's a little weird: the contract for AsTraversal is to interpret // an expression as if it were traversal syntax, and traversal syntax // doesn't have the special keywords "null", "true", and "false" so these // are expected to be treated like variables in that case. // Since our parser already turned them into LiteralValueExpr by the time // we get here, we need to undo this and infer the name that would've // originally led to our value. // We don't do anything for any other values, since they don't overlap // with traversal roots. if e.Val.IsNull() { // In practice the parser only generates null values of the dynamic // pseudo-type for literals, so we can safely assume that any null // was orignally the keyword "null". return hcl.Traversal{ hcl.TraverseRoot{ Name: "null", SrcRange: e.SrcRange, }, } } switch e.Val { case cty.True: return hcl.Traversal{ hcl.TraverseRoot{ Name: "true", SrcRange: e.SrcRange, }, } case cty.False: return hcl.Traversal{ hcl.TraverseRoot{ Name: "false", SrcRange: e.SrcRange, }, } default: // No traversal is possible for any other value. return nil } } // ScopeTraversalExpr is an Expression that retrieves a value from the scope // using a traversal. type ScopeTraversalExpr struct { Traversal hcl.Traversal SrcRange hcl.Range } func (e *ScopeTraversalExpr) walkChildNodes(w internalWalkFunc) { // Scope traversals have no child nodes } func (e *ScopeTraversalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { val, diags := e.Traversal.TraverseAbs(ctx) setDiagEvalContext(diags, e, ctx) return val, diags } func (e *ScopeTraversalExpr) Range() hcl.Range { return e.SrcRange } func (e *ScopeTraversalExpr) StartRange() hcl.Range { return e.SrcRange } // Implementation for hcl.AbsTraversalForExpr. func (e *ScopeTraversalExpr) AsTraversal() hcl.Traversal { return e.Traversal } // RelativeTraversalExpr is an Expression that retrieves a value from another // value using a _relative_ traversal. type RelativeTraversalExpr struct { Source Expression Traversal hcl.Traversal SrcRange hcl.Range } func (e *RelativeTraversalExpr) walkChildNodes(w internalWalkFunc) { w(e.Source) } func (e *RelativeTraversalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { src, diags := e.Source.Value(ctx) ret, travDiags := e.Traversal.TraverseRel(src) setDiagEvalContext(travDiags, e, ctx) diags = append(diags, travDiags...) return ret, diags } func (e *RelativeTraversalExpr) Range() hcl.Range { return e.SrcRange } func (e *RelativeTraversalExpr) StartRange() hcl.Range { return e.SrcRange } // Implementation for hcl.AbsTraversalForExpr. func (e *RelativeTraversalExpr) AsTraversal() hcl.Traversal { // We can produce a traversal only if our source can. st, diags := hcl.AbsTraversalForExpr(e.Source) if diags.HasErrors() { return nil } ret := make(hcl.Traversal, len(st)+len(e.Traversal)) copy(ret, st) copy(ret[len(st):], e.Traversal) return ret } // FunctionCallExpr is an Expression that calls a function from the EvalContext // and returns its result. type FunctionCallExpr struct { Name string Args []Expression // If true, the final argument should be a tuple, list or set which will // expand to be one argument per element. ExpandFinal bool NameRange hcl.Range OpenParenRange hcl.Range CloseParenRange hcl.Range } func (e *FunctionCallExpr) walkChildNodes(w internalWalkFunc) { for _, arg := range e.Args { w(arg) } } func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics var f function.Function exists := false hasNonNilMap := false thisCtx := ctx for thisCtx != nil { if thisCtx.Functions == nil { thisCtx = thisCtx.Parent() continue } hasNonNilMap = true f, exists = thisCtx.Functions[e.Name] if exists { break } thisCtx = thisCtx.Parent() } if !exists { if !hasNonNilMap { return cty.DynamicVal, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Function calls not allowed", Detail: "Functions may not be called here.", Subject: e.Range().Ptr(), Expression: e, EvalContext: ctx, }, } } avail := make([]string, 0, len(ctx.Functions)) for name := range ctx.Functions { avail = append(avail, name) } suggestion := nameSuggestion(e.Name, avail) if suggestion != "" { suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) } return cty.DynamicVal, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Call to unknown function", Detail: fmt.Sprintf("There is no function named %q.%s", e.Name, suggestion), Subject: &e.NameRange, Context: e.Range().Ptr(), Expression: e, EvalContext: ctx, }, } } params := f.Params() varParam := f.VarParam() args := e.Args if e.ExpandFinal { if len(args) < 1 { // should never happen if the parser is behaving panic("ExpandFinal set on function call with no arguments") } expandExpr := args[len(args)-1] expandVal, expandDiags := expandExpr.Value(ctx) diags = append(diags, expandDiags...) if expandDiags.HasErrors() { return cty.DynamicVal, diags } switch { case expandVal.Type().Equals(cty.DynamicPseudoType): if expandVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid expanding argument value", Detail: "The expanding argument (indicated by ...) must not be null.", Subject: expandExpr.Range().Ptr(), Context: e.Range().Ptr(), Expression: expandExpr, EvalContext: ctx, }) return cty.DynamicVal, diags } return cty.DynamicVal, diags case expandVal.Type().IsTupleType() || expandVal.Type().IsListType() || expandVal.Type().IsSetType(): if expandVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid expanding argument value", Detail: "The expanding argument (indicated by ...) must not be null.", Subject: expandExpr.Range().Ptr(), Context: e.Range().Ptr(), Expression: expandExpr, EvalContext: ctx, }) return cty.DynamicVal, diags } if !expandVal.IsKnown() { return cty.DynamicVal, diags } newArgs := make([]Expression, 0, (len(args)-1)+expandVal.LengthInt()) newArgs = append(newArgs, args[:len(args)-1]...) it := expandVal.ElementIterator() for it.Next() { _, val := it.Element() newArgs = append(newArgs, &LiteralValueExpr{ Val: val, SrcRange: expandExpr.Range(), }) } args = newArgs default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid expanding argument value", Detail: "The expanding argument (indicated by ...) must be of a tuple, list, or set type.", Subject: expandExpr.Range().Ptr(), Context: e.Range().Ptr(), Expression: expandExpr, EvalContext: ctx, }) return cty.DynamicVal, diags } } if len(args) < len(params) { missing := params[len(args)] qual := "" if varParam != nil { qual = " at least" } return cty.DynamicVal, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Not enough function arguments", Detail: fmt.Sprintf( "Function %q expects%s %d argument(s). Missing value for %q.", e.Name, qual, len(params), missing.Name, ), Subject: &e.CloseParenRange, Context: e.Range().Ptr(), Expression: e, EvalContext: ctx, }, } } if varParam == nil && len(args) > len(params) { return cty.DynamicVal, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Too many function arguments", Detail: fmt.Sprintf( "Function %q expects only %d argument(s).", e.Name, len(params), ), Subject: args[len(params)].StartRange().Ptr(), Context: e.Range().Ptr(), Expression: e, EvalContext: ctx, }, } } argVals := make([]cty.Value, len(args)) for i, argExpr := range args { var param *function.Parameter if i < len(params) { param = &params[i] } else { param = varParam } var val cty.Value if decodeFn := customdecode.CustomExpressionDecoderForType(param.Type); decodeFn != nil { var argDiags hcl.Diagnostics val, argDiags = decodeFn(argExpr, ctx) diags = append(diags, argDiags...) if val == cty.NilVal { val = cty.UnknownVal(param.Type) } } else { var argDiags hcl.Diagnostics val, argDiags = argExpr.Value(ctx) if len(argDiags) > 0 { diags = append(diags, argDiags...) } // Try to convert our value to the parameter type var err error val, err = convert.Convert(val, param.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid function argument", Detail: fmt.Sprintf( "Invalid value for %q parameter: %s.", param.Name, err, ), Subject: argExpr.StartRange().Ptr(), Context: e.Range().Ptr(), Expression: argExpr, EvalContext: ctx, }) } } argVals[i] = val } if diags.HasErrors() { // Don't try to execute the function if we already have errors with // the arguments, because the result will probably be a confusing // error message. return cty.DynamicVal, diags } resultVal, err := f.Call(argVals) if err != nil { switch terr := err.(type) { case function.ArgError: i := terr.Index var param *function.Parameter if i < len(params) { param = &params[i] } else { param = varParam } // this can happen if an argument is (incorrectly) null. if i > len(e.Args)-1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid function argument", Detail: fmt.Sprintf( "Invalid value for %q parameter: %s.", param.Name, err, ), Subject: args[len(params)].StartRange().Ptr(), Context: e.Range().Ptr(), Expression: e, EvalContext: ctx, }) } else { argExpr := e.Args[i] // TODO: we should also unpick a PathError here and show the // path to the deep value where the error was detected. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid function argument", Detail: fmt.Sprintf( "Invalid value for %q parameter: %s.", param.Name, err, ), Subject: argExpr.StartRange().Ptr(), Context: e.Range().Ptr(), Expression: argExpr, EvalContext: ctx, }) } default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Error in function call", Detail: fmt.Sprintf( "Call to function %q failed: %s.", e.Name, err, ), Subject: e.StartRange().Ptr(), Context: e.Range().Ptr(), Expression: e, EvalContext: ctx, }) } return cty.DynamicVal, diags } return resultVal, diags } func (e *FunctionCallExpr) Range() hcl.Range { return hcl.RangeBetween(e.NameRange, e.CloseParenRange) } func (e *FunctionCallExpr) StartRange() hcl.Range { return hcl.RangeBetween(e.NameRange, e.OpenParenRange) } // Implementation for hcl.ExprCall. func (e *FunctionCallExpr) ExprCall() *hcl.StaticCall { ret := &hcl.StaticCall{ Name: e.Name, NameRange: e.NameRange, Arguments: make([]hcl.Expression, len(e.Args)), ArgsRange: hcl.RangeBetween(e.OpenParenRange, e.CloseParenRange), } // Need to convert our own Expression objects into hcl.Expression. for i, arg := range e.Args { ret.Arguments[i] = arg } return ret } type ConditionalExpr struct { Condition Expression TrueResult Expression FalseResult Expression SrcRange hcl.Range } func (e *ConditionalExpr) walkChildNodes(w internalWalkFunc) { w(e.Condition) w(e.TrueResult) w(e.FalseResult) } func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { trueResult, trueDiags := e.TrueResult.Value(ctx) falseResult, falseDiags := e.FalseResult.Value(ctx) var diags hcl.Diagnostics resultType := cty.DynamicPseudoType convs := make([]convert.Conversion, 2) switch { // If either case is a dynamic null value (which would result from a // literal null in the config), we know that it can convert to the expected // type of the opposite case, and we don't need to speculatively reduce the // final result type to DynamicPseudoType. // If we know that either Type is a DynamicPseudoType, we can be certain // that the other value can convert since it's a pass-through, and we don't // need to unify the types. If the final evaluation results in the dynamic // value being returned, there's no conversion we can do, so we return the // value directly. case trueResult.RawEquals(cty.NullVal(cty.DynamicPseudoType)): resultType = falseResult.Type() convs[0] = convert.GetConversionUnsafe(cty.DynamicPseudoType, resultType) case falseResult.RawEquals(cty.NullVal(cty.DynamicPseudoType)): resultType = trueResult.Type() convs[1] = convert.GetConversionUnsafe(cty.DynamicPseudoType, resultType) case trueResult.Type() == cty.DynamicPseudoType, falseResult.Type() == cty.DynamicPseudoType: // the final resultType type is still unknown // we don't need to get the conversion, because both are a noop. default: // Try to find a type that both results can be converted to. resultType, convs = convert.UnifyUnsafe([]cty.Type{trueResult.Type(), falseResult.Type()}) } if resultType == cty.NilType { return cty.DynamicVal, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Inconsistent conditional result types", Detail: fmt.Sprintf( // FIXME: Need a helper function for showing natural-language type diffs, // since this will generate some useless messages in some cases, like // "These expressions are object and object respectively" if the // object types don't exactly match. "The true and false result expressions must have consistent types. The given expressions are %s and %s, respectively.", trueResult.Type().FriendlyName(), falseResult.Type().FriendlyName(), ), Subject: hcl.RangeBetween(e.TrueResult.Range(), e.FalseResult.Range()).Ptr(), Context: &e.SrcRange, Expression: e, EvalContext: ctx, }, } } condResult, condDiags := e.Condition.Value(ctx) diags = append(diags, condDiags...) if condResult.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Null condition", Detail: "The condition value is null. Conditions must either be true or false.", Subject: e.Condition.Range().Ptr(), Context: &e.SrcRange, Expression: e.Condition, EvalContext: ctx, }) return cty.UnknownVal(resultType), diags } if !condResult.IsKnown() { return cty.UnknownVal(resultType), diags } condResult, err := convert.Convert(condResult, cty.Bool) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect condition type", Detail: fmt.Sprintf("The condition expression must be of type bool."), Subject: e.Condition.Range().Ptr(), Context: &e.SrcRange, Expression: e.Condition, EvalContext: ctx, }) return cty.UnknownVal(resultType), diags } if condResult.True() { diags = append(diags, trueDiags...) if convs[0] != nil { var err error trueResult, err = convs[0](trueResult) if err != nil { // Unsafe conversion failed with the concrete result value diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Inconsistent conditional result types", Detail: fmt.Sprintf( "The true result value has the wrong type: %s.", err.Error(), ), Subject: e.TrueResult.Range().Ptr(), Context: &e.SrcRange, Expression: e.TrueResult, EvalContext: ctx, }) trueResult = cty.UnknownVal(resultType) } } return trueResult, diags } else { diags = append(diags, falseDiags...) if convs[1] != nil { var err error falseResult, err = convs[1](falseResult) if err != nil { // Unsafe conversion failed with the concrete result value diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Inconsistent conditional result types", Detail: fmt.Sprintf( "The false result value has the wrong type: %s.", err.Error(), ), Subject: e.FalseResult.Range().Ptr(), Context: &e.SrcRange, Expression: e.FalseResult, EvalContext: ctx, }) falseResult = cty.UnknownVal(resultType) } } return falseResult, diags } } func (e *ConditionalExpr) Range() hcl.Range { return e.SrcRange } func (e *ConditionalExpr) StartRange() hcl.Range { return e.Condition.StartRange() } type IndexExpr struct { Collection Expression Key Expression SrcRange hcl.Range OpenRange hcl.Range BracketRange hcl.Range } func (e *IndexExpr) walkChildNodes(w internalWalkFunc) { w(e.Collection) w(e.Key) } func (e *IndexExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics coll, collDiags := e.Collection.Value(ctx) key, keyDiags := e.Key.Value(ctx) diags = append(diags, collDiags...) diags = append(diags, keyDiags...) val, indexDiags := hcl.Index(coll, key, &e.BracketRange) setDiagEvalContext(indexDiags, e, ctx) diags = append(diags, indexDiags...) return val, diags } func (e *IndexExpr) Range() hcl.Range { return e.SrcRange } func (e *IndexExpr) StartRange() hcl.Range { return e.OpenRange } type TupleConsExpr struct { Exprs []Expression SrcRange hcl.Range OpenRange hcl.Range } func (e *TupleConsExpr) walkChildNodes(w internalWalkFunc) { for _, expr := range e.Exprs { w(expr) } } func (e *TupleConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var vals []cty.Value var diags hcl.Diagnostics vals = make([]cty.Value, len(e.Exprs)) for i, expr := range e.Exprs { val, valDiags := expr.Value(ctx) vals[i] = val diags = append(diags, valDiags...) } return cty.TupleVal(vals), diags } func (e *TupleConsExpr) Range() hcl.Range { return e.SrcRange } func (e *TupleConsExpr) StartRange() hcl.Range { return e.OpenRange } // Implementation for hcl.ExprList func (e *TupleConsExpr) ExprList() []hcl.Expression { ret := make([]hcl.Expression, len(e.Exprs)) for i, expr := range e.Exprs { ret[i] = expr } return ret } type ObjectConsExpr struct { Items []ObjectConsItem SrcRange hcl.Range OpenRange hcl.Range } type ObjectConsItem struct { KeyExpr Expression ValueExpr Expression } func (e *ObjectConsExpr) walkChildNodes(w internalWalkFunc) { for _, item := range e.Items { w(item.KeyExpr) w(item.ValueExpr) } } func (e *ObjectConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var vals map[string]cty.Value var diags hcl.Diagnostics // This will get set to true if we fail to produce any of our keys, // either because they are actually unknown or if the evaluation produces // errors. In all of these case we must return DynamicPseudoType because // we're unable to know the full set of keys our object has, and thus // we can't produce a complete value of the intended type. // // We still evaluate all of the item keys and values to make sure that we // get as complete as possible a set of diagnostics. known := true vals = make(map[string]cty.Value, len(e.Items)) for _, item := range e.Items { key, keyDiags := item.KeyExpr.Value(ctx) diags = append(diags, keyDiags...) val, valDiags := item.ValueExpr.Value(ctx) diags = append(diags, valDiags...) if keyDiags.HasErrors() { known = false continue } if key.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Null value as key", Detail: "Can't use a null value as a key.", Subject: item.ValueExpr.Range().Ptr(), Expression: item.KeyExpr, EvalContext: ctx, }) known = false continue } var err error key, err = convert.Convert(key, cty.String) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect key type", Detail: fmt.Sprintf("Can't use this value as a key: %s.", err.Error()), Subject: item.KeyExpr.Range().Ptr(), Expression: item.KeyExpr, EvalContext: ctx, }) known = false continue } if !key.IsKnown() { known = false continue } keyStr := key.AsString() vals[keyStr] = val } if !known { return cty.DynamicVal, diags } return cty.ObjectVal(vals), diags } func (e *ObjectConsExpr) Range() hcl.Range { return e.SrcRange } func (e *ObjectConsExpr) StartRange() hcl.Range { return e.OpenRange } // Implementation for hcl.ExprMap func (e *ObjectConsExpr) ExprMap() []hcl.KeyValuePair { ret := make([]hcl.KeyValuePair, len(e.Items)) for i, item := range e.Items { ret[i] = hcl.KeyValuePair{ Key: item.KeyExpr, Value: item.ValueExpr, } } return ret } // ObjectConsKeyExpr is a special wrapper used only for ObjectConsExpr keys, // which deals with the special case that a naked identifier in that position // must be interpreted as a literal string rather than evaluated directly. type ObjectConsKeyExpr struct { Wrapped Expression ForceNonLiteral bool } func (e *ObjectConsKeyExpr) literalName() string { // This is our logic for deciding whether to behave like a literal string. // We lean on our AbsTraversalForExpr implementation here, which already // deals with some awkward cases like the expression being the result // of the keywords "null", "true" and "false" which we'd want to interpret // as keys here too. return hcl.ExprAsKeyword(e.Wrapped) } func (e *ObjectConsKeyExpr) walkChildNodes(w internalWalkFunc) { // We only treat our wrapped expression as a real expression if we're // not going to interpret it as a literal. if e.literalName() == "" { w(e.Wrapped) } } func (e *ObjectConsKeyExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { // Because we accept a naked identifier as a literal key rather than a // reference, it's confusing to accept a traversal containing periods // here since we can't tell if the user intends to create a key with // periods or actually reference something. To avoid confusing downstream // errors we'll just prohibit a naked multi-step traversal here and // require the user to state their intent more clearly. // (This is handled at evaluation time rather than parse time because // an application using static analysis _can_ accept a naked multi-step // traversal here, if desired.) if !e.ForceNonLiteral { if travExpr, isTraversal := e.Wrapped.(*ScopeTraversalExpr); isTraversal && len(travExpr.Traversal) > 1 { var diags hcl.Diagnostics diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Ambiguous attribute key", Detail: "If this expression is intended to be a reference, wrap it in parentheses. If it's instead intended as a literal name containing periods, wrap it in quotes to create a string literal.", Subject: e.Range().Ptr(), }) return cty.DynamicVal, diags } if ln := e.literalName(); ln != "" { return cty.StringVal(ln), nil } } return e.Wrapped.Value(ctx) } func (e *ObjectConsKeyExpr) Range() hcl.Range { return e.Wrapped.Range() } func (e *ObjectConsKeyExpr) StartRange() hcl.Range { return e.Wrapped.StartRange() } // Implementation for hcl.AbsTraversalForExpr. func (e *ObjectConsKeyExpr) AsTraversal() hcl.Traversal { // If we're forcing a non-literal then we can never be interpreted // as a traversal. if e.ForceNonLiteral { return nil } // We can produce a traversal only if our wrappee can. st, diags := hcl.AbsTraversalForExpr(e.Wrapped) if diags.HasErrors() { return nil } return st } func (e *ObjectConsKeyExpr) UnwrapExpression() Expression { return e.Wrapped } // ForExpr represents iteration constructs: // // tuple = [for i, v in list: upper(v) if i > 2] // object = {for k, v in map: k => upper(v)} // object_of_tuples = {for v in list: v.key: v...} type ForExpr struct { KeyVar string // empty if ignoring the key ValVar string CollExpr Expression KeyExpr Expression // nil when producing a tuple ValExpr Expression CondExpr Expression // null if no "if" clause is present Group bool // set if the ellipsis is used on the value in an object for SrcRange hcl.Range OpenRange hcl.Range CloseRange hcl.Range } func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics collVal, collDiags := e.CollExpr.Value(ctx) diags = append(diags, collDiags...) if collVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Iteration over null value", Detail: "A null value cannot be used as the collection in a 'for' expression.", Subject: e.CollExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CollExpr, EvalContext: ctx, }) return cty.DynamicVal, diags } if collVal.Type() == cty.DynamicPseudoType { return cty.DynamicVal, diags } if !collVal.CanIterateElements() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Iteration over non-iterable value", Detail: fmt.Sprintf( "A value of type %s cannot be used as the collection in a 'for' expression.", collVal.Type().FriendlyName(), ), Subject: e.CollExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CollExpr, EvalContext: ctx, }) return cty.DynamicVal, diags } if !collVal.IsKnown() { return cty.DynamicVal, diags } // Before we start we'll do an early check to see if any CondExpr we've // been given is of the wrong type. This isn't 100% reliable (it may // be DynamicVal until real values are given) but it should catch some // straightforward cases and prevent a barrage of repeated errors. if e.CondExpr != nil { childCtx := ctx.NewChild() childCtx.Variables = map[string]cty.Value{} if e.KeyVar != "" { childCtx.Variables[e.KeyVar] = cty.DynamicVal } childCtx.Variables[e.ValVar] = cty.DynamicVal result, condDiags := e.CondExpr.Value(childCtx) diags = append(diags, condDiags...) if result.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Condition is null", Detail: "The value of the 'if' clause must not be null.", Subject: e.CondExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CondExpr, EvalContext: ctx, }) return cty.DynamicVal, diags } _, err := convert.Convert(result, cty.Bool) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' condition", Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), Subject: e.CondExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CondExpr, EvalContext: ctx, }) return cty.DynamicVal, diags } if condDiags.HasErrors() { return cty.DynamicVal, diags } } if e.KeyExpr != nil { // Producing an object var vals map[string]cty.Value var groupVals map[string][]cty.Value if e.Group { groupVals = map[string][]cty.Value{} } else { vals = map[string]cty.Value{} } it := collVal.ElementIterator() known := true for it.Next() { k, v := it.Element() childCtx := ctx.NewChild() childCtx.Variables = map[string]cty.Value{} if e.KeyVar != "" { childCtx.Variables[e.KeyVar] = k } childCtx.Variables[e.ValVar] = v if e.CondExpr != nil { includeRaw, condDiags := e.CondExpr.Value(childCtx) diags = append(diags, condDiags...) if includeRaw.IsNull() { if known { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' condition", Detail: "The value of the 'if' clause must not be null.", Subject: e.CondExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CondExpr, EvalContext: childCtx, }) } known = false continue } include, err := convert.Convert(includeRaw, cty.Bool) if err != nil { if known { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' condition", Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), Subject: e.CondExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CondExpr, EvalContext: childCtx, }) } known = false continue } if !include.IsKnown() { known = false continue } if include.False() { // Skip this element continue } } keyRaw, keyDiags := e.KeyExpr.Value(childCtx) diags = append(diags, keyDiags...) if keyRaw.IsNull() { if known { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid object key", Detail: "Key expression in 'for' expression must not produce a null value.", Subject: e.KeyExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.KeyExpr, EvalContext: childCtx, }) } known = false continue } if !keyRaw.IsKnown() { known = false continue } key, err := convert.Convert(keyRaw, cty.String) if err != nil { if known { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid object key", Detail: fmt.Sprintf("The key expression produced an invalid result: %s.", err.Error()), Subject: e.KeyExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.KeyExpr, EvalContext: childCtx, }) } known = false continue } val, valDiags := e.ValExpr.Value(childCtx) diags = append(diags, valDiags...) if e.Group { k := key.AsString() groupVals[k] = append(groupVals[k], val) } else { k := key.AsString() if _, exists := vals[k]; exists { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Duplicate object key", Detail: fmt.Sprintf( "Two different items produced the key %q in this 'for' expression. If duplicates are expected, use the ellipsis (...) after the value expression to enable grouping by key.", k, ), Subject: e.KeyExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.KeyExpr, EvalContext: childCtx, }) } else { vals[key.AsString()] = val } } } if !known { return cty.DynamicVal, diags } if e.Group { vals = map[string]cty.Value{} for k, gvs := range groupVals { vals[k] = cty.TupleVal(gvs) } } return cty.ObjectVal(vals), diags } else { // Producing a tuple vals := []cty.Value{} it := collVal.ElementIterator() known := true for it.Next() { k, v := it.Element() childCtx := ctx.NewChild() childCtx.Variables = map[string]cty.Value{} if e.KeyVar != "" { childCtx.Variables[e.KeyVar] = k } childCtx.Variables[e.ValVar] = v if e.CondExpr != nil { includeRaw, condDiags := e.CondExpr.Value(childCtx) diags = append(diags, condDiags...) if includeRaw.IsNull() { if known { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' condition", Detail: "The value of the 'if' clause must not be null.", Subject: e.CondExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CondExpr, EvalContext: childCtx, }) } known = false continue } if !includeRaw.IsKnown() { // We will eventually return DynamicVal, but we'll continue // iterating in case there are other diagnostics to gather // for later elements. known = false continue } include, err := convert.Convert(includeRaw, cty.Bool) if err != nil { if known { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' condition", Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), Subject: e.CondExpr.Range().Ptr(), Context: &e.SrcRange, Expression: e.CondExpr, EvalContext: childCtx, }) } known = false continue } if include.False() { // Skip this element continue } } val, valDiags := e.ValExpr.Value(childCtx) diags = append(diags, valDiags...) vals = append(vals, val) } if !known { return cty.DynamicVal, diags } return cty.TupleVal(vals), diags } } func (e *ForExpr) walkChildNodes(w internalWalkFunc) { w(e.CollExpr) scopeNames := map[string]struct{}{} if e.KeyVar != "" { scopeNames[e.KeyVar] = struct{}{} } if e.ValVar != "" { scopeNames[e.ValVar] = struct{}{} } if e.KeyExpr != nil { w(ChildScope{ LocalNames: scopeNames, Expr: e.KeyExpr, }) } w(ChildScope{ LocalNames: scopeNames, Expr: e.ValExpr, }) if e.CondExpr != nil { w(ChildScope{ LocalNames: scopeNames, Expr: e.CondExpr, }) } } func (e *ForExpr) Range() hcl.Range { return e.SrcRange } func (e *ForExpr) StartRange() hcl.Range { return e.OpenRange } type SplatExpr struct { Source Expression Each Expression Item *AnonSymbolExpr SrcRange hcl.Range MarkerRange hcl.Range } func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { sourceVal, diags := e.Source.Value(ctx) if diags.HasErrors() { // We'll evaluate our "Each" expression here just to see if it // produces any more diagnostics we can report. Since we're not // assigning a value to our AnonSymbolExpr here it will return // DynamicVal, which should short-circuit any use of it. _, itemDiags := e.Item.Value(ctx) diags = append(diags, itemDiags...) return cty.DynamicVal, diags } sourceTy := sourceVal.Type() if sourceTy == cty.DynamicPseudoType { // If we don't even know the _type_ of our source value yet then // we'll need to defer all processing, since we can't decide our // result type either. return cty.DynamicVal, diags } // A "special power" of splat expressions is that they can be applied // both to tuples/lists and to other values, and in the latter case // the value will be treated as an implicit single-item tuple, or as // an empty tuple if the value is null. autoUpgrade := !(sourceTy.IsTupleType() || sourceTy.IsListType() || sourceTy.IsSetType()) if sourceVal.IsNull() { if autoUpgrade { return cty.EmptyTupleVal, diags } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Splat of null value", Detail: "Splat expressions (with the * symbol) cannot be applied to null sequences.", Subject: e.Source.Range().Ptr(), Context: hcl.RangeBetween(e.Source.Range(), e.MarkerRange).Ptr(), Expression: e.Source, EvalContext: ctx, }) return cty.DynamicVal, diags } if autoUpgrade { sourceVal = cty.TupleVal([]cty.Value{sourceVal}) sourceTy = sourceVal.Type() } // We'll compute our result type lazily if we need it. In the normal case // it's inferred automatically from the value we construct. resultTy := func() (cty.Type, hcl.Diagnostics) { chiCtx := ctx.NewChild() var diags hcl.Diagnostics switch { case sourceTy.IsListType() || sourceTy.IsSetType(): ety := sourceTy.ElementType() e.Item.setValue(chiCtx, cty.UnknownVal(ety)) val, itemDiags := e.Each.Value(chiCtx) diags = append(diags, itemDiags...) e.Item.clearValue(chiCtx) // clean up our temporary value return cty.List(val.Type()), diags case sourceTy.IsTupleType(): etys := sourceTy.TupleElementTypes() resultTys := make([]cty.Type, 0, len(etys)) for _, ety := range etys { e.Item.setValue(chiCtx, cty.UnknownVal(ety)) val, itemDiags := e.Each.Value(chiCtx) diags = append(diags, itemDiags...) e.Item.clearValue(chiCtx) // clean up our temporary value resultTys = append(resultTys, val.Type()) } return cty.Tuple(resultTys), diags default: // Should never happen because of our promotion to list above. return cty.DynamicPseudoType, diags } } if !sourceVal.IsKnown() { // We can't produce a known result in this case, but we'll still // indicate what the result type would be, allowing any downstream type // checking to proceed. ty, tyDiags := resultTy() diags = append(diags, tyDiags...) return cty.UnknownVal(ty), diags } vals := make([]cty.Value, 0, sourceVal.LengthInt()) it := sourceVal.ElementIterator() if ctx == nil { // we need a context to use our AnonSymbolExpr, so we'll just // make an empty one here to use as a placeholder. ctx = ctx.NewChild() } isKnown := true for it.Next() { _, sourceItem := it.Element() e.Item.setValue(ctx, sourceItem) newItem, itemDiags := e.Each.Value(ctx) diags = append(diags, itemDiags...) if itemDiags.HasErrors() { isKnown = false } vals = append(vals, newItem) } e.Item.clearValue(ctx) // clean up our temporary value if !isKnown { // We'll ingore the resultTy diagnostics in this case since they // will just be the same errors we saw while iterating above. ty, _ := resultTy() return cty.UnknownVal(ty), diags } switch { case sourceTy.IsListType() || sourceTy.IsSetType(): if len(vals) == 0 { ty, tyDiags := resultTy() diags = append(diags, tyDiags...) return cty.ListValEmpty(ty.ElementType()), diags } return cty.ListVal(vals), diags default: return cty.TupleVal(vals), diags } } func (e *SplatExpr) walkChildNodes(w internalWalkFunc) { w(e.Source) w(e.Each) } func (e *SplatExpr) Range() hcl.Range { return e.SrcRange } func (e *SplatExpr) StartRange() hcl.Range { return e.MarkerRange } // AnonSymbolExpr is used as a placeholder for a value in an expression that // can be applied dynamically to any value at runtime. // // This is a rather odd, synthetic expression. It is used as part of the // representation of splat expressions as a placeholder for the current item // being visited in the splat evaluation. // // AnonSymbolExpr cannot be evaluated in isolation. If its Value is called // directly then cty.DynamicVal will be returned. Instead, it is evaluated // in terms of another node (i.e. a splat expression) which temporarily // assigns it a value. type AnonSymbolExpr struct { SrcRange hcl.Range // values and its associated lock are used to isolate concurrent // evaluations of a symbol from one another. It is the calling application's // responsibility to ensure that the same splat expression is not evalauted // concurrently within the _same_ EvalContext, but it is fine and safe to // do cuncurrent evaluations with distinct EvalContexts. values map[*hcl.EvalContext]cty.Value valuesLock sync.RWMutex } func (e *AnonSymbolExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { if ctx == nil { return cty.DynamicVal, nil } e.valuesLock.RLock() defer e.valuesLock.RUnlock() val, exists := e.values[ctx] if !exists { return cty.DynamicVal, nil } return val, nil } // setValue sets a temporary local value for the expression when evaluated // in the given context, which must be non-nil. func (e *AnonSymbolExpr) setValue(ctx *hcl.EvalContext, val cty.Value) { e.valuesLock.Lock() defer e.valuesLock.Unlock() if e.values == nil { e.values = make(map[*hcl.EvalContext]cty.Value) } if ctx == nil { panic("can't setValue for a nil EvalContext") } e.values[ctx] = val } func (e *AnonSymbolExpr) clearValue(ctx *hcl.EvalContext) { e.valuesLock.Lock() defer e.valuesLock.Unlock() if e.values == nil { return } if ctx == nil { panic("can't clearValue for a nil EvalContext") } delete(e.values, ctx) } func (e *AnonSymbolExpr) walkChildNodes(w internalWalkFunc) { // AnonSymbolExpr is a leaf node in the tree } func (e *AnonSymbolExpr) Range() hcl.Range { return e.SrcRange } func (e *AnonSymbolExpr) StartRange() hcl.Range { return e.SrcRange } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_ops.go���������������������0000664�0000000�0000000�00000013722�13771713062�0027525�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "fmt" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/function/stdlib" ) type Operation struct { Impl function.Function Type cty.Type } var ( OpLogicalOr = &Operation{ Impl: stdlib.OrFunc, Type: cty.Bool, } OpLogicalAnd = &Operation{ Impl: stdlib.AndFunc, Type: cty.Bool, } OpLogicalNot = &Operation{ Impl: stdlib.NotFunc, Type: cty.Bool, } OpEqual = &Operation{ Impl: stdlib.EqualFunc, Type: cty.Bool, } OpNotEqual = &Operation{ Impl: stdlib.NotEqualFunc, Type: cty.Bool, } OpGreaterThan = &Operation{ Impl: stdlib.GreaterThanFunc, Type: cty.Bool, } OpGreaterThanOrEqual = &Operation{ Impl: stdlib.GreaterThanOrEqualToFunc, Type: cty.Bool, } OpLessThan = &Operation{ Impl: stdlib.LessThanFunc, Type: cty.Bool, } OpLessThanOrEqual = &Operation{ Impl: stdlib.LessThanOrEqualToFunc, Type: cty.Bool, } OpAdd = &Operation{ Impl: stdlib.AddFunc, Type: cty.Number, } OpSubtract = &Operation{ Impl: stdlib.SubtractFunc, Type: cty.Number, } OpMultiply = &Operation{ Impl: stdlib.MultiplyFunc, Type: cty.Number, } OpDivide = &Operation{ Impl: stdlib.DivideFunc, Type: cty.Number, } OpModulo = &Operation{ Impl: stdlib.ModuloFunc, Type: cty.Number, } OpNegate = &Operation{ Impl: stdlib.NegateFunc, Type: cty.Number, } ) var binaryOps []map[TokenType]*Operation func init() { // This operation table maps from the operator's token type // to the AST operation type. All expressions produced from // binary operators are BinaryOp nodes. // // Binary operator groups are listed in order of precedence, with // the *lowest* precedence first. Operators within the same group // have left-to-right associativity. binaryOps = []map[TokenType]*Operation{ { TokenOr: OpLogicalOr, }, { TokenAnd: OpLogicalAnd, }, { TokenEqualOp: OpEqual, TokenNotEqual: OpNotEqual, }, { TokenGreaterThan: OpGreaterThan, TokenGreaterThanEq: OpGreaterThanOrEqual, TokenLessThan: OpLessThan, TokenLessThanEq: OpLessThanOrEqual, }, { TokenPlus: OpAdd, TokenMinus: OpSubtract, }, { TokenStar: OpMultiply, TokenSlash: OpDivide, TokenPercent: OpModulo, }, } } type BinaryOpExpr struct { LHS Expression Op *Operation RHS Expression SrcRange hcl.Range } func (e *BinaryOpExpr) walkChildNodes(w internalWalkFunc) { w(e.LHS) w(e.RHS) } func (e *BinaryOpExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { impl := e.Op.Impl // assumed to be a function taking exactly two arguments params := impl.Params() lhsParam := params[0] rhsParam := params[1] var diags hcl.Diagnostics givenLHSVal, lhsDiags := e.LHS.Value(ctx) givenRHSVal, rhsDiags := e.RHS.Value(ctx) diags = append(diags, lhsDiags...) diags = append(diags, rhsDiags...) lhsVal, err := convert.Convert(givenLHSVal, lhsParam.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid operand", Detail: fmt.Sprintf("Unsuitable value for left operand: %s.", err), Subject: e.LHS.Range().Ptr(), Context: &e.SrcRange, Expression: e.LHS, EvalContext: ctx, }) } rhsVal, err := convert.Convert(givenRHSVal, rhsParam.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid operand", Detail: fmt.Sprintf("Unsuitable value for right operand: %s.", err), Subject: e.RHS.Range().Ptr(), Context: &e.SrcRange, Expression: e.RHS, EvalContext: ctx, }) } if diags.HasErrors() { // Don't actually try the call if we have errors already, since the // this will probably just produce a confusing duplicative diagnostic. return cty.UnknownVal(e.Op.Type), diags } args := []cty.Value{lhsVal, rhsVal} result, err := impl.Call(args) if err != nil { diags = append(diags, &hcl.Diagnostic{ // FIXME: This diagnostic is useless. Severity: hcl.DiagError, Summary: "Operation failed", Detail: fmt.Sprintf("Error during operation: %s.", err), Subject: &e.SrcRange, Expression: e, EvalContext: ctx, }) return cty.UnknownVal(e.Op.Type), diags } return result, diags } func (e *BinaryOpExpr) Range() hcl.Range { return e.SrcRange } func (e *BinaryOpExpr) StartRange() hcl.Range { return e.LHS.StartRange() } type UnaryOpExpr struct { Op *Operation Val Expression SrcRange hcl.Range SymbolRange hcl.Range } func (e *UnaryOpExpr) walkChildNodes(w internalWalkFunc) { w(e.Val) } func (e *UnaryOpExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { impl := e.Op.Impl // assumed to be a function taking exactly one argument params := impl.Params() param := params[0] givenVal, diags := e.Val.Value(ctx) val, err := convert.Convert(givenVal, param.Type) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid operand", Detail: fmt.Sprintf("Unsuitable value for unary operand: %s.", err), Subject: e.Val.Range().Ptr(), Context: &e.SrcRange, Expression: e.Val, EvalContext: ctx, }) } if diags.HasErrors() { // Don't actually try the call if we have errors already, since the // this will probably just produce a confusing duplicative diagnostic. return cty.UnknownVal(e.Op.Type), diags } args := []cty.Value{val} result, err := impl.Call(args) if err != nil { diags = append(diags, &hcl.Diagnostic{ // FIXME: This diagnostic is useless. Severity: hcl.DiagError, Summary: "Operation failed", Detail: fmt.Sprintf("Error during operation: %s.", err), Subject: &e.SrcRange, Expression: e, EvalContext: ctx, }) return cty.UnknownVal(e.Op.Type), diags } return result, diags } func (e *UnaryOpExpr) Range() hcl.Range { return e.SrcRange } func (e *UnaryOpExpr) StartRange() hcl.Range { return e.SymbolRange } ����������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go����������������0000664�0000000�0000000�00000013217�13771713062�0030536�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "bytes" "fmt" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) type TemplateExpr struct { Parts []Expression SrcRange hcl.Range } func (e *TemplateExpr) walkChildNodes(w internalWalkFunc) { for _, part := range e.Parts { w(part) } } func (e *TemplateExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { buf := &bytes.Buffer{} var diags hcl.Diagnostics isKnown := true for _, part := range e.Parts { partVal, partDiags := part.Value(ctx) diags = append(diags, partDiags...) if partVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid template interpolation value", Detail: fmt.Sprintf( "The expression result is null. Cannot include a null value in a string template.", ), Subject: part.Range().Ptr(), Context: &e.SrcRange, Expression: part, EvalContext: ctx, }) continue } if !partVal.IsKnown() { // If any part is unknown then the result as a whole must be // unknown too. We'll keep on processing the rest of the parts // anyway, because we want to still emit any diagnostics resulting // from evaluating those. isKnown = false continue } strVal, err := convert.Convert(partVal, cty.String) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid template interpolation value", Detail: fmt.Sprintf( "Cannot include the given value in a string template: %s.", err.Error(), ), Subject: part.Range().Ptr(), Context: &e.SrcRange, Expression: part, EvalContext: ctx, }) continue } buf.WriteString(strVal.AsString()) } if !isKnown { return cty.UnknownVal(cty.String), diags } return cty.StringVal(buf.String()), diags } func (e *TemplateExpr) Range() hcl.Range { return e.SrcRange } func (e *TemplateExpr) StartRange() hcl.Range { return e.Parts[0].StartRange() } // IsStringLiteral returns true if and only if the template consists only of // single string literal, as would be created for a simple quoted string like // "foo". // // If this function returns true, then calling Value on the same expression // with a nil EvalContext will return the literal value. // // Note that "${"foo"}", "${1}", etc aren't considered literal values for the // purposes of this method, because the intent of this method is to identify // situations where the user seems to be explicitly intending literal string // interpretation, not situations that result in literals as a technicality // of the template expression unwrapping behavior. func (e *TemplateExpr) IsStringLiteral() bool { if len(e.Parts) != 1 { return false } _, ok := e.Parts[0].(*LiteralValueExpr) return ok } // TemplateJoinExpr is used to convert tuples of strings produced by template // constructs (i.e. for loops) into flat strings, by converting the values // tos strings and joining them. This AST node is not used directly; it's // produced as part of the AST of a "for" loop in a template. type TemplateJoinExpr struct { Tuple Expression } func (e *TemplateJoinExpr) walkChildNodes(w internalWalkFunc) { w(e.Tuple) } func (e *TemplateJoinExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { tuple, diags := e.Tuple.Value(ctx) if tuple.IsNull() { // This indicates a bug in the code that constructed the AST. panic("TemplateJoinExpr got null tuple") } if tuple.Type() == cty.DynamicPseudoType { return cty.UnknownVal(cty.String), diags } if !tuple.Type().IsTupleType() { // This indicates a bug in the code that constructed the AST. panic("TemplateJoinExpr got non-tuple tuple") } if !tuple.IsKnown() { return cty.UnknownVal(cty.String), diags } buf := &bytes.Buffer{} it := tuple.ElementIterator() for it.Next() { _, val := it.Element() if val.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid template interpolation value", Detail: fmt.Sprintf( "An iteration result is null. Cannot include a null value in a string template.", ), Subject: e.Range().Ptr(), Expression: e, EvalContext: ctx, }) continue } if val.Type() == cty.DynamicPseudoType { return cty.UnknownVal(cty.String), diags } strVal, err := convert.Convert(val, cty.String) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid template interpolation value", Detail: fmt.Sprintf( "Cannot include one of the interpolation results into the string template: %s.", err.Error(), ), Subject: e.Range().Ptr(), Expression: e, EvalContext: ctx, }) continue } if !val.IsKnown() { return cty.UnknownVal(cty.String), diags } buf.WriteString(strVal.AsString()) } return cty.StringVal(buf.String()), diags } func (e *TemplateJoinExpr) Range() hcl.Range { return e.Tuple.Range() } func (e *TemplateJoinExpr) StartRange() hcl.Range { return e.Tuple.StartRange() } // TemplateWrapExpr is used instead of a TemplateExpr when a template // consists _only_ of a single interpolation sequence. In that case, the // template's result is the single interpolation's result, verbatim with // no type conversions. type TemplateWrapExpr struct { Wrapped Expression SrcRange hcl.Range } func (e *TemplateWrapExpr) walkChildNodes(w internalWalkFunc) { w(e.Wrapped) } func (e *TemplateWrapExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return e.Wrapped.Value(ctx) } func (e *TemplateWrapExpr) Range() hcl.Range { return e.SrcRange } func (e *TemplateWrapExpr) StartRange() hcl.Range { return e.SrcRange } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go��������������������0000664�0000000�0000000�00000002772�13771713062�0027702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax // Generated by expression_vars_get.go. DO NOT EDIT. // Run 'go generate' on this package to update the set of functions here. import ( "github.com/hashicorp/hcl/v2" ) func (e *AnonSymbolExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *BinaryOpExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *ConditionalExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *ForExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *FunctionCallExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *IndexExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *LiteralValueExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *ObjectConsExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *ObjectConsKeyExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *RelativeTraversalExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *ScopeTraversalExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *SplatExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *TemplateExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *TemplateJoinExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *TemplateWrapExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *TupleConsExpr) Variables() []hcl.Traversal { return Variables(e) } func (e *UnaryOpExpr) Variables() []hcl.Traversal { return Variables(e) } ������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/file.go�������������������������������0000664�0000000�0000000�00000000537�13771713062�0025364�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" ) // File is the top-level object resulting from parsing a configuration file. type File struct { Body *Body Bytes []byte } func (f *File) AsHCLFile() *hcl.File { return &hcl.File{ Body: f.Body, Bytes: f.Bytes, // TODO: The Nav object, once we have an implementation of it } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go���������������������������0000664�0000000�0000000�00000000717�13771713062�0026237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax //go:generate go run expression_vars_gen.go //go:generate ruby unicode2ragel.rb --url=http://www.unicode.org/Public/9.0.0/ucd/DerivedCoreProperties.txt -m UnicodeDerived -p ID_Start,ID_Continue -o unicode_derived.rl //go:generate ragel -Z scan_tokens.rl //go:generate gofmt -w scan_tokens.go //go:generate ragel -Z scan_string_lit.rl //go:generate gofmt -w scan_string_lit.go //go:generate stringer -type TokenType -output token_type_string.go �������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/keywords.go���������������������������0000664�0000000�0000000�00000001011�13771713062�0026300�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "bytes" ) type Keyword []byte var forKeyword = Keyword([]byte{'f', 'o', 'r'}) var inKeyword = Keyword([]byte{'i', 'n'}) var ifKeyword = Keyword([]byte{'i', 'f'}) var elseKeyword = Keyword([]byte{'e', 'l', 's', 'e'}) var endifKeyword = Keyword([]byte{'e', 'n', 'd', 'i', 'f'}) var endforKeyword = Keyword([]byte{'e', 'n', 'd', 'f', 'o', 'r'}) func (kw Keyword) TokenMatches(token Token) bool { if token.Type != TokenIdent { return false } return bytes.Equal([]byte(kw), token.Bytes) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/navigation.go�������������������������0000664�0000000�0000000�00000002040�13771713062�0026573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "bytes" "fmt" "github.com/hashicorp/hcl/v2" ) type navigation struct { root *Body } // Implementation of hcled.ContextString func (n navigation) ContextString(offset int) string { // We will walk our top-level blocks until we find one that contains // the given offset, and then construct a representation of the header // of the block. var block *Block for _, candidate := range n.root.Blocks { if candidate.Range().ContainsOffset(offset) { block = candidate break } } if block == nil { return "" } if len(block.Labels) == 0 { // Easy case! return block.Type } buf := &bytes.Buffer{} buf.WriteString(block.Type) for _, label := range block.Labels { fmt.Fprintf(buf, " %q", label) } return buf.String() } func (n navigation) ContextDefRange(offset int) hcl.Range { var block *Block for _, candidate := range n.root.Blocks { if candidate.Range().ContainsOffset(offset) { block = candidate break } } if block == nil { return hcl.Range{} } return block.DefRange() } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/node.go�������������������������������0000664�0000000�0000000�00000001160�13771713062�0025363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" ) // Node is the abstract type that every AST node implements. // // This is a closed interface, so it cannot be implemented from outside of // this package. type Node interface { // This is the mechanism by which the public-facing walk functions // are implemented. Implementations should call the given function // for each child node and then replace that node with its return value. // The return value might just be the same node, for non-transforming // walks. walkChildNodes(w internalWalkFunc) Range() hcl.Range } type internalWalkFunc func(Node) ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go�����������������������������0000664�0000000�0000000�00000163544�13771713062�0025751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "bytes" "fmt" "strconv" "unicode/utf8" "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) type parser struct { *peeker // set to true if any recovery is attempted. The parser can use this // to attempt to reduce error noise by suppressing "bad token" errors // in recovery mode, assuming that the recovery heuristics have failed // in this case and left the peeker in a wrong place. recovery bool } func (p *parser) ParseBody(end TokenType) (*Body, hcl.Diagnostics) { attrs := Attributes{} blocks := Blocks{} var diags hcl.Diagnostics startRange := p.PrevRange() var endRange hcl.Range Token: for { next := p.Peek() if next.Type == end { endRange = p.NextRange() p.Read() break Token } switch next.Type { case TokenNewline: p.Read() continue case TokenIdent: item, itemDiags := p.ParseBodyItem() diags = append(diags, itemDiags...) switch titem := item.(type) { case *Block: blocks = append(blocks, titem) case *Attribute: if existing, exists := attrs[titem.Name]; exists { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Attribute redefined", Detail: fmt.Sprintf( "The argument %q was already set at %s. Each argument may be set only once.", titem.Name, existing.NameRange.String(), ), Subject: &titem.NameRange, }) } else { attrs[titem.Name] = titem } default: // This should never happen for valid input, but may if a // syntax error was detected in ParseBodyItem that prevented // it from even producing a partially-broken item. In that // case, it would've left at least one error in the diagnostics // slice we already dealt with above. // // We'll assume ParseBodyItem attempted recovery to leave // us in a reasonable position to try parsing the next item. continue } default: bad := p.Read() if !p.recovery { if bad.Type == TokenOQuote { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid argument name", Detail: "Argument names must not be quoted.", Subject: &bad.Range, }) } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Argument or block definition required", Detail: "An argument or block definition is required here.", Subject: &bad.Range, }) } } endRange = p.PrevRange() // arbitrary, but somewhere inside the body means better diagnostics p.recover(end) // attempt to recover to the token after the end of this body break Token } } return &Body{ Attributes: attrs, Blocks: blocks, SrcRange: hcl.RangeBetween(startRange, endRange), EndRange: hcl.Range{ Filename: endRange.Filename, Start: endRange.End, End: endRange.End, }, }, diags } func (p *parser) ParseBodyItem() (Node, hcl.Diagnostics) { ident := p.Read() if ident.Type != TokenIdent { p.recoverAfterBodyItem() return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Argument or block definition required", Detail: "An argument or block definition is required here.", Subject: &ident.Range, }, } } next := p.Peek() switch next.Type { case TokenEqual: return p.finishParsingBodyAttribute(ident, false) case TokenOQuote, TokenOBrace, TokenIdent: return p.finishParsingBodyBlock(ident) default: p.recoverAfterBodyItem() return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Argument or block definition required", Detail: "An argument or block definition is required here. To set an argument, use the equals sign \"=\" to introduce the argument value.", Subject: &ident.Range, }, } } return nil, nil } // parseSingleAttrBody is a weird variant of ParseBody that deals with the // body of a nested block containing only one attribute value all on a single // line, like foo { bar = baz } . It expects to find a single attribute item // immediately followed by the end token type with no intervening newlines. func (p *parser) parseSingleAttrBody(end TokenType) (*Body, hcl.Diagnostics) { ident := p.Read() if ident.Type != TokenIdent { p.recoverAfterBodyItem() return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Argument or block definition required", Detail: "An argument or block definition is required here.", Subject: &ident.Range, }, } } var attr *Attribute var diags hcl.Diagnostics next := p.Peek() switch next.Type { case TokenEqual: node, attrDiags := p.finishParsingBodyAttribute(ident, true) diags = append(diags, attrDiags...) attr = node.(*Attribute) case TokenOQuote, TokenOBrace, TokenIdent: p.recoverAfterBodyItem() return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Argument definition required", Detail: fmt.Sprintf("A single-line block definition can contain only a single argument. If you meant to define argument %q, use an equals sign to assign it a value. To define a nested block, place it on a line of its own within its parent block.", ident.Bytes), Subject: hcl.RangeBetween(ident.Range, next.Range).Ptr(), }, } default: p.recoverAfterBodyItem() return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Argument or block definition required", Detail: "An argument or block definition is required here. To set an argument, use the equals sign \"=\" to introduce the argument value.", Subject: &ident.Range, }, } } return &Body{ Attributes: Attributes{ string(ident.Bytes): attr, }, SrcRange: attr.SrcRange, EndRange: hcl.Range{ Filename: attr.SrcRange.Filename, Start: attr.SrcRange.End, End: attr.SrcRange.End, }, }, diags } func (p *parser) finishParsingBodyAttribute(ident Token, singleLine bool) (Node, hcl.Diagnostics) { eqTok := p.Read() // eat equals token if eqTok.Type != TokenEqual { // should never happen if caller behaves panic("finishParsingBodyAttribute called with next not equals") } var endRange hcl.Range expr, diags := p.ParseExpression() if p.recovery && diags.HasErrors() { // recovery within expressions tends to be tricky, so we've probably // landed somewhere weird. We'll try to reset to the start of a body // item so parsing can continue. endRange = p.PrevRange() p.recoverAfterBodyItem() } else { endRange = p.PrevRange() if !singleLine { end := p.Peek() if end.Type != TokenNewline && end.Type != TokenEOF { if !p.recovery { summary := "Missing newline after argument" detail := "An argument definition must end with a newline." if end.Type == TokenComma { summary = "Unexpected comma after argument" detail = "Argument definitions must be separated by newlines, not commas. " + detail } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: summary, Detail: detail, Subject: &end.Range, Context: hcl.RangeBetween(ident.Range, end.Range).Ptr(), }) } endRange = p.PrevRange() p.recoverAfterBodyItem() } else { endRange = p.PrevRange() p.Read() // eat newline } } } return &Attribute{ Name: string(ident.Bytes), Expr: expr, SrcRange: hcl.RangeBetween(ident.Range, endRange), NameRange: ident.Range, EqualsRange: eqTok.Range, }, diags } func (p *parser) finishParsingBodyBlock(ident Token) (Node, hcl.Diagnostics) { var blockType = string(ident.Bytes) var diags hcl.Diagnostics var labels []string var labelRanges []hcl.Range var oBrace Token Token: for { tok := p.Peek() switch tok.Type { case TokenOBrace: oBrace = p.Read() break Token case TokenOQuote: label, labelRange, labelDiags := p.parseQuotedStringLiteral() diags = append(diags, labelDiags...) labels = append(labels, label) labelRanges = append(labelRanges, labelRange) // parseQuoteStringLiteral recovers up to the closing quote // if it encounters problems, so we can continue looking for // more labels and eventually the block body even. case TokenIdent: tok = p.Read() // eat token label, labelRange := string(tok.Bytes), tok.Range labels = append(labels, label) labelRanges = append(labelRanges, labelRange) default: switch tok.Type { case TokenEqual: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid block definition", Detail: "The equals sign \"=\" indicates an argument definition, and must not be used when defining a block.", Subject: &tok.Range, Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), }) case TokenNewline: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid block definition", Detail: "A block definition must have block content delimited by \"{\" and \"}\", starting on the same line as the block header.", Subject: &tok.Range, Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), }) default: if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid block definition", Detail: "Either a quoted string block label or an opening brace (\"{\") is expected here.", Subject: &tok.Range, Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), }) } } p.recoverAfterBodyItem() return &Block{ Type: blockType, Labels: labels, Body: &Body{ SrcRange: ident.Range, EndRange: ident.Range, }, TypeRange: ident.Range, LabelRanges: labelRanges, OpenBraceRange: ident.Range, // placeholder CloseBraceRange: ident.Range, // placeholder }, diags } } // Once we fall out here, the peeker is pointed just after our opening // brace, so we can begin our nested body parsing. var body *Body var bodyDiags hcl.Diagnostics switch p.Peek().Type { case TokenNewline, TokenEOF, TokenCBrace: body, bodyDiags = p.ParseBody(TokenCBrace) default: // Special one-line, single-attribute block parsing mode. body, bodyDiags = p.parseSingleAttrBody(TokenCBrace) switch p.Peek().Type { case TokenCBrace: p.Read() // the happy path - just consume the closing brace case TokenComma: // User seems to be trying to use the object-constructor // comma-separated style, which isn't permitted for blocks. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid single-argument block definition", Detail: "Single-line block syntax can include only one argument definition. To define multiple arguments, use the multi-line block syntax with one argument definition per line.", Subject: p.Peek().Range.Ptr(), }) p.recover(TokenCBrace) case TokenNewline: // We don't allow weird mixtures of single and multi-line syntax. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid single-argument block definition", Detail: "An argument definition on the same line as its containing block creates a single-line block definition, which must also be closed on the same line. Place the block's closing brace immediately after the argument definition.", Subject: p.Peek().Range.Ptr(), }) p.recover(TokenCBrace) default: // Some other weird thing is going on. Since we can't guess a likely // user intent for this one, we'll skip it if we're already in // recovery mode. if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid single-argument block definition", Detail: "A single-line block definition must end with a closing brace immediately after its single argument definition.", Subject: p.Peek().Range.Ptr(), }) } p.recover(TokenCBrace) } } diags = append(diags, bodyDiags...) cBraceRange := p.PrevRange() eol := p.Peek() if eol.Type == TokenNewline || eol.Type == TokenEOF { p.Read() // eat newline } else { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing newline after block definition", Detail: "A block definition must end with a newline.", Subject: &eol.Range, Context: hcl.RangeBetween(ident.Range, eol.Range).Ptr(), }) } p.recoverAfterBodyItem() } // We must never produce a nil body, since the caller may attempt to // do analysis of a partial result when there's an error, so we'll // insert a placeholder if we otherwise failed to produce a valid // body due to one of the syntax error paths above. if body == nil && diags.HasErrors() { body = &Body{ SrcRange: hcl.RangeBetween(oBrace.Range, cBraceRange), EndRange: cBraceRange, } } return &Block{ Type: blockType, Labels: labels, Body: body, TypeRange: ident.Range, LabelRanges: labelRanges, OpenBraceRange: oBrace.Range, CloseBraceRange: cBraceRange, }, diags } func (p *parser) ParseExpression() (Expression, hcl.Diagnostics) { return p.parseTernaryConditional() } func (p *parser) parseTernaryConditional() (Expression, hcl.Diagnostics) { // The ternary conditional operator (.. ? .. : ..) behaves somewhat // like a binary operator except that the "symbol" is itself // an expression enclosed in two punctuation characters. // The middle expression is parsed as if the ? and : symbols // were parentheses. The "rhs" (the "false expression") is then // treated right-associatively so it behaves similarly to the // middle in terms of precedence. startRange := p.NextRange() var condExpr, trueExpr, falseExpr Expression var diags hcl.Diagnostics condExpr, condDiags := p.parseBinaryOps(binaryOps) diags = append(diags, condDiags...) if p.recovery && condDiags.HasErrors() { return condExpr, diags } questionMark := p.Peek() if questionMark.Type != TokenQuestion { return condExpr, diags } p.Read() // eat question mark trueExpr, trueDiags := p.ParseExpression() diags = append(diags, trueDiags...) if p.recovery && trueDiags.HasErrors() { return condExpr, diags } colon := p.Peek() if colon.Type != TokenColon { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing false expression in conditional", Detail: "The conditional operator (...?...:...) requires a false expression, delimited by a colon.", Subject: &colon.Range, Context: hcl.RangeBetween(startRange, colon.Range).Ptr(), }) return condExpr, diags } p.Read() // eat colon falseExpr, falseDiags := p.ParseExpression() diags = append(diags, falseDiags...) if p.recovery && falseDiags.HasErrors() { return condExpr, diags } return &ConditionalExpr{ Condition: condExpr, TrueResult: trueExpr, FalseResult: falseExpr, SrcRange: hcl.RangeBetween(startRange, falseExpr.Range()), }, diags } // parseBinaryOps calls itself recursively to work through all of the // operator precedence groups, and then eventually calls parseExpressionTerm // for each operand. func (p *parser) parseBinaryOps(ops []map[TokenType]*Operation) (Expression, hcl.Diagnostics) { if len(ops) == 0 { // We've run out of operators, so now we'll just try to parse a term. return p.parseExpressionWithTraversals() } thisLevel := ops[0] remaining := ops[1:] var lhs, rhs Expression var operation *Operation var diags hcl.Diagnostics // Parse a term that might be the first operand of a binary // operation or it might just be a standalone term. // We won't know until we've parsed it and can look ahead // to see if there's an operator token for this level. lhs, lhsDiags := p.parseBinaryOps(remaining) diags = append(diags, lhsDiags...) if p.recovery && lhsDiags.HasErrors() { return lhs, diags } // We'll keep eating up operators until we run out, so that operators // with the same precedence will combine in a left-associative manner: // a+b+c => (a+b)+c, not a+(b+c) // // Should we later want to have right-associative operators, a way // to achieve that would be to call back up to ParseExpression here // instead of iteratively parsing only the remaining operators. for { next := p.Peek() var newOp *Operation var ok bool if newOp, ok = thisLevel[next.Type]; !ok { break } // Are we extending an expression started on the previous iteration? if operation != nil { lhs = &BinaryOpExpr{ LHS: lhs, Op: operation, RHS: rhs, SrcRange: hcl.RangeBetween(lhs.Range(), rhs.Range()), } } operation = newOp p.Read() // eat operator token var rhsDiags hcl.Diagnostics rhs, rhsDiags = p.parseBinaryOps(remaining) diags = append(diags, rhsDiags...) if p.recovery && rhsDiags.HasErrors() { return lhs, diags } } if operation == nil { return lhs, diags } return &BinaryOpExpr{ LHS: lhs, Op: operation, RHS: rhs, SrcRange: hcl.RangeBetween(lhs.Range(), rhs.Range()), }, diags } func (p *parser) parseExpressionWithTraversals() (Expression, hcl.Diagnostics) { term, diags := p.parseExpressionTerm() ret, moreDiags := p.parseExpressionTraversals(term) diags = append(diags, moreDiags...) return ret, diags } func (p *parser) parseExpressionTraversals(from Expression) (Expression, hcl.Diagnostics) { var diags hcl.Diagnostics ret := from Traversal: for { next := p.Peek() switch next.Type { case TokenDot: // Attribute access or splat dot := p.Read() attrTok := p.Peek() switch attrTok.Type { case TokenIdent: attrTok = p.Read() // eat token name := string(attrTok.Bytes) rng := hcl.RangeBetween(dot.Range, attrTok.Range) step := hcl.TraverseAttr{ Name: name, SrcRange: rng, } ret = makeRelativeTraversal(ret, step, rng) case TokenNumberLit: // This is a weird form we inherited from HIL, allowing numbers // to be used as attributes as a weird way of writing [n]. // This was never actually a first-class thing in HIL, but // HIL tolerated sequences like .0. in its variable names and // calling applications like Terraform exploited that to // introduce indexing syntax where none existed. numTok := p.Read() // eat token attrTok = numTok // This syntax is ambiguous if multiple indices are used in // succession, like foo.0.1.baz: that actually parses as // a fractional number 0.1. Since we're only supporting this // syntax for compatibility with legacy Terraform // configurations, and Terraform does not tend to have lists // of lists, we'll choose to reject that here with a helpful // error message, rather than failing later because the index // isn't a whole number. if dotIdx := bytes.IndexByte(numTok.Bytes, '.'); dotIdx >= 0 { first := numTok.Bytes[:dotIdx] second := numTok.Bytes[dotIdx+1:] diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid legacy index syntax", Detail: fmt.Sprintf("When using the legacy index syntax, chaining two indexes together is not permitted. Use the proper index syntax instead, like [%s][%s].", first, second), Subject: &attrTok.Range, }) rng := hcl.RangeBetween(dot.Range, numTok.Range) step := hcl.TraverseIndex{ Key: cty.DynamicVal, SrcRange: rng, } ret = makeRelativeTraversal(ret, step, rng) break } numVal, numDiags := p.numberLitValue(numTok) diags = append(diags, numDiags...) rng := hcl.RangeBetween(dot.Range, numTok.Range) step := hcl.TraverseIndex{ Key: numVal, SrcRange: rng, } ret = makeRelativeTraversal(ret, step, rng) case TokenStar: // "Attribute-only" splat expression. // (This is a kinda weird construct inherited from HIL, which // behaves a bit like a [*] splat except that it is only able // to do attribute traversals into each of its elements, // whereas foo[*] can support _any_ traversal. marker := p.Read() // eat star trav := make(hcl.Traversal, 0, 1) var firstRange, lastRange hcl.Range firstRange = p.NextRange() lastRange = marker.Range for p.Peek().Type == TokenDot { dot := p.Read() if p.Peek().Type == TokenNumberLit { // Continuing the "weird stuff inherited from HIL" // theme, we also allow numbers as attribute names // inside splats and interpret them as indexing // into a list, for expressions like: // foo.bar.*.baz.0.foo numTok := p.Read() // Weird special case if the user writes something // like foo.bar.*.baz.0.0.foo, where 0.0 parses // as a number. if dotIdx := bytes.IndexByte(numTok.Bytes, '.'); dotIdx >= 0 { first := numTok.Bytes[:dotIdx] second := numTok.Bytes[dotIdx+1:] diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid legacy index syntax", Detail: fmt.Sprintf("When using the legacy index syntax, chaining two indexes together is not permitted. Use the proper index syntax with a full splat expression [*] instead, like [%s][%s].", first, second), Subject: &attrTok.Range, }) trav = append(trav, hcl.TraverseIndex{ Key: cty.DynamicVal, SrcRange: hcl.RangeBetween(dot.Range, numTok.Range), }) lastRange = numTok.Range continue } numVal, numDiags := p.numberLitValue(numTok) diags = append(diags, numDiags...) trav = append(trav, hcl.TraverseIndex{ Key: numVal, SrcRange: hcl.RangeBetween(dot.Range, numTok.Range), }) lastRange = numTok.Range continue } if p.Peek().Type != TokenIdent { if !p.recovery { if p.Peek().Type == TokenStar { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Nested splat expression not allowed", Detail: "A splat expression (*) cannot be used inside another attribute-only splat expression.", Subject: p.Peek().Range.Ptr(), }) } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid attribute name", Detail: "An attribute name is required after a dot.", Subject: &attrTok.Range, }) } } p.setRecovery() continue Traversal } attrTok := p.Read() trav = append(trav, hcl.TraverseAttr{ Name: string(attrTok.Bytes), SrcRange: hcl.RangeBetween(dot.Range, attrTok.Range), }) lastRange = attrTok.Range } itemExpr := &AnonSymbolExpr{ SrcRange: hcl.RangeBetween(dot.Range, marker.Range), } var travExpr Expression if len(trav) == 0 { travExpr = itemExpr } else { travExpr = &RelativeTraversalExpr{ Source: itemExpr, Traversal: trav, SrcRange: hcl.RangeBetween(firstRange, lastRange), } } ret = &SplatExpr{ Source: ret, Each: travExpr, Item: itemExpr, SrcRange: hcl.RangeBetween(from.Range(), lastRange), MarkerRange: hcl.RangeBetween(dot.Range, marker.Range), } default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid attribute name", Detail: "An attribute name is required after a dot.", Subject: &attrTok.Range, }) // This leaves the peeker in a bad place, so following items // will probably be misparsed until we hit something that // allows us to re-sync. // // We will probably need to do something better here eventually // in order to support autocomplete triggered by typing a // period. p.setRecovery() } case TokenOBrack: // Indexing of a collection. // This may or may not be a hcl.Traverser, depending on whether // the key value is something constant. open := p.Read() switch p.Peek().Type { case TokenStar: // This is a full splat expression, like foo[*], which consumes // the rest of the traversal steps after it using a recursive // call to this function. p.Read() // consume star close := p.Read() if close.Type != TokenCBrack && !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing close bracket on splat index", Detail: "The star for a full splat operator must be immediately followed by a closing bracket (\"]\").", Subject: &close.Range, }) close = p.recover(TokenCBrack) } // Splat expressions use a special "anonymous symbol" as a // placeholder in an expression to be evaluated once for each // item in the source expression. itemExpr := &AnonSymbolExpr{ SrcRange: hcl.RangeBetween(open.Range, close.Range), } // Now we'll recursively call this same function to eat any // remaining traversal steps against the anonymous symbol. travExpr, nestedDiags := p.parseExpressionTraversals(itemExpr) diags = append(diags, nestedDiags...) ret = &SplatExpr{ Source: ret, Each: travExpr, Item: itemExpr, SrcRange: hcl.RangeBetween(from.Range(), travExpr.Range()), MarkerRange: hcl.RangeBetween(open.Range, close.Range), } default: var close Token p.PushIncludeNewlines(false) // arbitrary newlines allowed in brackets keyExpr, keyDiags := p.ParseExpression() diags = append(diags, keyDiags...) if p.recovery && keyDiags.HasErrors() { close = p.recover(TokenCBrack) } else { close = p.Read() if close.Type != TokenCBrack && !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing close bracket on index", Detail: "The index operator must end with a closing bracket (\"]\").", Subject: &close.Range, }) close = p.recover(TokenCBrack) } } p.PopIncludeNewlines() if lit, isLit := keyExpr.(*LiteralValueExpr); isLit { litKey, _ := lit.Value(nil) rng := hcl.RangeBetween(open.Range, close.Range) step := hcl.TraverseIndex{ Key: litKey, SrcRange: rng, } ret = makeRelativeTraversal(ret, step, rng) } else if tmpl, isTmpl := keyExpr.(*TemplateExpr); isTmpl && tmpl.IsStringLiteral() { litKey, _ := tmpl.Value(nil) rng := hcl.RangeBetween(open.Range, close.Range) step := hcl.TraverseIndex{ Key: litKey, SrcRange: rng, } ret = makeRelativeTraversal(ret, step, rng) } else { rng := hcl.RangeBetween(open.Range, close.Range) ret = &IndexExpr{ Collection: ret, Key: keyExpr, SrcRange: hcl.RangeBetween(from.Range(), rng), OpenRange: open.Range, BracketRange: rng, } } } default: break Traversal } } return ret, diags } // makeRelativeTraversal takes an expression and a traverser and returns // a traversal expression that combines the two. If the given expression // is already a traversal, it is extended in place (mutating it) and // returned. If it isn't, a new RelativeTraversalExpr is created and returned. func makeRelativeTraversal(expr Expression, next hcl.Traverser, rng hcl.Range) Expression { switch texpr := expr.(type) { case *ScopeTraversalExpr: texpr.Traversal = append(texpr.Traversal, next) texpr.SrcRange = hcl.RangeBetween(texpr.SrcRange, rng) return texpr case *RelativeTraversalExpr: texpr.Traversal = append(texpr.Traversal, next) texpr.SrcRange = hcl.RangeBetween(texpr.SrcRange, rng) return texpr default: return &RelativeTraversalExpr{ Source: expr, Traversal: hcl.Traversal{next}, SrcRange: hcl.RangeBetween(expr.Range(), rng), } } } func (p *parser) parseExpressionTerm() (Expression, hcl.Diagnostics) { start := p.Peek() switch start.Type { case TokenOParen: p.Read() // eat open paren p.PushIncludeNewlines(false) expr, diags := p.ParseExpression() if diags.HasErrors() { // attempt to place the peeker after our closing paren // before we return, so that the next parser has some // chance of finding a valid expression. p.recover(TokenCParen) p.PopIncludeNewlines() return expr, diags } close := p.Peek() if close.Type != TokenCParen { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unbalanced parentheses", Detail: "Expected a closing parenthesis to terminate the expression.", Subject: &close.Range, Context: hcl.RangeBetween(start.Range, close.Range).Ptr(), }) p.setRecovery() } p.Read() // eat closing paren p.PopIncludeNewlines() return expr, diags case TokenNumberLit: tok := p.Read() // eat number token numVal, diags := p.numberLitValue(tok) return &LiteralValueExpr{ Val: numVal, SrcRange: tok.Range, }, diags case TokenIdent: tok := p.Read() // eat identifier token if p.Peek().Type == TokenOParen { return p.finishParsingFunctionCall(tok) } name := string(tok.Bytes) switch name { case "true": return &LiteralValueExpr{ Val: cty.True, SrcRange: tok.Range, }, nil case "false": return &LiteralValueExpr{ Val: cty.False, SrcRange: tok.Range, }, nil case "null": return &LiteralValueExpr{ Val: cty.NullVal(cty.DynamicPseudoType), SrcRange: tok.Range, }, nil default: return &ScopeTraversalExpr{ Traversal: hcl.Traversal{ hcl.TraverseRoot{ Name: name, SrcRange: tok.Range, }, }, SrcRange: tok.Range, }, nil } case TokenOQuote, TokenOHeredoc: open := p.Read() // eat opening marker closer := p.oppositeBracket(open.Type) exprs, passthru, _, diags := p.parseTemplateInner(closer, tokenOpensFlushHeredoc(open)) closeRange := p.PrevRange() if passthru { if len(exprs) != 1 { panic("passthru set with len(exprs) != 1") } return &TemplateWrapExpr{ Wrapped: exprs[0], SrcRange: hcl.RangeBetween(open.Range, closeRange), }, diags } return &TemplateExpr{ Parts: exprs, SrcRange: hcl.RangeBetween(open.Range, closeRange), }, diags case TokenMinus: tok := p.Read() // eat minus token // Important to use parseExpressionWithTraversals rather than parseExpression // here, otherwise we can capture a following binary expression into // our negation. // e.g. -46+5 should parse as (-46)+5, not -(46+5) operand, diags := p.parseExpressionWithTraversals() return &UnaryOpExpr{ Op: OpNegate, Val: operand, SrcRange: hcl.RangeBetween(tok.Range, operand.Range()), SymbolRange: tok.Range, }, diags case TokenBang: tok := p.Read() // eat bang token // Important to use parseExpressionWithTraversals rather than parseExpression // here, otherwise we can capture a following binary expression into // our negation. operand, diags := p.parseExpressionWithTraversals() return &UnaryOpExpr{ Op: OpLogicalNot, Val: operand, SrcRange: hcl.RangeBetween(tok.Range, operand.Range()), SymbolRange: tok.Range, }, diags case TokenOBrack: return p.parseTupleCons() case TokenOBrace: return p.parseObjectCons() default: var diags hcl.Diagnostics if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid expression", Detail: "Expected the start of an expression, but found an invalid expression token.", Subject: &start.Range, }) } p.setRecovery() // Return a placeholder so that the AST is still structurally sound // even in the presence of parse errors. return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: start.Range, }, diags } } func (p *parser) numberLitValue(tok Token) (cty.Value, hcl.Diagnostics) { // The cty.ParseNumberVal is always the same behavior as converting a // string to a number, ensuring we always interpret decimal numbers in // the same way. numVal, err := cty.ParseNumberVal(string(tok.Bytes)) if err != nil { ret := cty.UnknownVal(cty.Number) return ret, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid number literal", // FIXME: not a very good error message, but convert only // gives us "a number is required", so not much help either. Detail: "Failed to recognize the value of this number literal.", Subject: &tok.Range, }, } } return numVal, nil } // finishParsingFunctionCall parses a function call assuming that the function // name was already read, and so the peeker should be pointing at the opening // parenthesis after the name. func (p *parser) finishParsingFunctionCall(name Token) (Expression, hcl.Diagnostics) { openTok := p.Read() if openTok.Type != TokenOParen { // should never happen if callers behave panic("finishParsingFunctionCall called with non-parenthesis as next token") } var args []Expression var diags hcl.Diagnostics var expandFinal bool var closeTok Token // Arbitrary newlines are allowed inside the function call parentheses. p.PushIncludeNewlines(false) Token: for { tok := p.Peek() if tok.Type == TokenCParen { closeTok = p.Read() // eat closing paren break Token } arg, argDiags := p.ParseExpression() args = append(args, arg) diags = append(diags, argDiags...) if p.recovery && argDiags.HasErrors() { // if there was a parse error in the argument then we've // probably been left in a weird place in the token stream, // so we'll bail out with a partial argument list. p.recover(TokenCParen) break Token } sep := p.Read() if sep.Type == TokenCParen { closeTok = sep break Token } if sep.Type == TokenEllipsis { expandFinal = true if p.Peek().Type != TokenCParen { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing closing parenthesis", Detail: "An expanded function argument (with ...) must be immediately followed by closing parentheses.", Subject: &sep.Range, Context: hcl.RangeBetween(name.Range, sep.Range).Ptr(), }) } closeTok = p.recover(TokenCParen) } else { closeTok = p.Read() // eat closing paren } break Token } if sep.Type != TokenComma { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing argument separator", Detail: "A comma is required to separate each function argument from the next.", Subject: &sep.Range, Context: hcl.RangeBetween(name.Range, sep.Range).Ptr(), }) closeTok = p.recover(TokenCParen) break Token } if p.Peek().Type == TokenCParen { // A trailing comma after the last argument gets us in here. closeTok = p.Read() // eat closing paren break Token } } p.PopIncludeNewlines() return &FunctionCallExpr{ Name: string(name.Bytes), Args: args, ExpandFinal: expandFinal, NameRange: name.Range, OpenParenRange: openTok.Range, CloseParenRange: closeTok.Range, }, diags } func (p *parser) parseTupleCons() (Expression, hcl.Diagnostics) { open := p.Read() if open.Type != TokenOBrack { // Should never happen if callers are behaving panic("parseTupleCons called without peeker pointing to open bracket") } p.PushIncludeNewlines(false) defer p.PopIncludeNewlines() if forKeyword.TokenMatches(p.Peek()) { return p.finishParsingForExpr(open) } var close Token var diags hcl.Diagnostics var exprs []Expression for { next := p.Peek() if next.Type == TokenCBrack { close = p.Read() // eat closer break } expr, exprDiags := p.ParseExpression() exprs = append(exprs, expr) diags = append(diags, exprDiags...) if p.recovery && exprDiags.HasErrors() { // If expression parsing failed then we are probably in a strange // place in the token stream, so we'll bail out and try to reset // to after our closing bracket to allow parsing to continue. close = p.recover(TokenCBrack) break } next = p.Peek() if next.Type == TokenCBrack { close = p.Read() // eat closer break } if next.Type != TokenComma { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing item separator", Detail: "Expected a comma to mark the beginning of the next item.", Subject: &next.Range, Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), }) } close = p.recover(TokenCBrack) break } p.Read() // eat comma } return &TupleConsExpr{ Exprs: exprs, SrcRange: hcl.RangeBetween(open.Range, close.Range), OpenRange: open.Range, }, diags } func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) { open := p.Read() if open.Type != TokenOBrace { // Should never happen if callers are behaving panic("parseObjectCons called without peeker pointing to open brace") } // We must temporarily stop looking at newlines here while we check for // a "for" keyword, since for expressions are _not_ newline-sensitive, // even though object constructors are. p.PushIncludeNewlines(false) isFor := forKeyword.TokenMatches(p.Peek()) p.PopIncludeNewlines() if isFor { return p.finishParsingForExpr(open) } p.PushIncludeNewlines(true) defer p.PopIncludeNewlines() var close Token var diags hcl.Diagnostics var items []ObjectConsItem for { next := p.Peek() if next.Type == TokenNewline { p.Read() // eat newline continue } if next.Type == TokenCBrace { close = p.Read() // eat closer break } // Wrapping parens are not explicitly represented in the AST, but // we want to use them here to disambiguate intepreting a mapping // key as a full expression rather than just a name, and so // we'll remember this was present and use it to force the // behavior of our final ObjectConsKeyExpr. forceNonLiteral := (p.Peek().Type == TokenOParen) var key Expression var keyDiags hcl.Diagnostics key, keyDiags = p.ParseExpression() diags = append(diags, keyDiags...) if p.recovery && keyDiags.HasErrors() { // If expression parsing failed then we are probably in a strange // place in the token stream, so we'll bail out and try to reset // to after our closing brace to allow parsing to continue. close = p.recover(TokenCBrace) break } // We wrap up the key expression in a special wrapper that deals // with our special case that naked identifiers as object keys // are interpreted as literal strings. key = &ObjectConsKeyExpr{ Wrapped: key, ForceNonLiteral: forceNonLiteral, } next = p.Peek() if next.Type != TokenEqual && next.Type != TokenColon { if !p.recovery { switch next.Type { case TokenNewline, TokenComma: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing attribute value", Detail: "Expected an attribute value, introduced by an equals sign (\"=\").", Subject: &next.Range, Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), }) case TokenIdent: // Although this might just be a plain old missing equals // sign before a reference, one way to get here is to try // to write an attribute name containing a period followed // by a digit, which was valid in HCL1, like this: // foo1.2_bar = "baz" // We can't know exactly what the user intended here, but // we'll augment our message with an extra hint in this case // in case it is helpful. diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing key/value separator", Detail: "Expected an equals sign (\"=\") to mark the beginning of the attribute value. If you intended to given an attribute name containing periods or spaces, write the name in quotes to create a string literal.", Subject: &next.Range, Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), }) default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing key/value separator", Detail: "Expected an equals sign (\"=\") to mark the beginning of the attribute value.", Subject: &next.Range, Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), }) } } close = p.recover(TokenCBrace) break } p.Read() // eat equals sign or colon value, valueDiags := p.ParseExpression() diags = append(diags, valueDiags...) if p.recovery && valueDiags.HasErrors() { // If expression parsing failed then we are probably in a strange // place in the token stream, so we'll bail out and try to reset // to after our closing brace to allow parsing to continue. close = p.recover(TokenCBrace) break } items = append(items, ObjectConsItem{ KeyExpr: key, ValueExpr: value, }) next = p.Peek() if next.Type == TokenCBrace { close = p.Read() // eat closer break } if next.Type != TokenComma && next.Type != TokenNewline { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing attribute separator", Detail: "Expected a newline or comma to mark the beginning of the next attribute.", Subject: &next.Range, Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), }) } close = p.recover(TokenCBrace) break } p.Read() // eat comma or newline } return &ObjectConsExpr{ Items: items, SrcRange: hcl.RangeBetween(open.Range, close.Range), OpenRange: open.Range, }, diags } func (p *parser) finishParsingForExpr(open Token) (Expression, hcl.Diagnostics) { p.PushIncludeNewlines(false) defer p.PopIncludeNewlines() introducer := p.Read() if !forKeyword.TokenMatches(introducer) { // Should never happen if callers are behaving panic("finishParsingForExpr called without peeker pointing to 'for' identifier") } var makeObj bool var closeType TokenType switch open.Type { case TokenOBrace: makeObj = true closeType = TokenCBrace case TokenOBrack: makeObj = false // making a tuple closeType = TokenCBrack default: // Should never happen if callers are behaving panic("finishParsingForExpr called with invalid open token") } var diags hcl.Diagnostics var keyName, valName string if p.Peek().Type != TokenIdent { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "For expression requires variable name after 'for'.", Subject: p.Peek().Range.Ptr(), Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), }) } close := p.recover(closeType) return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }, diags } valName = string(p.Read().Bytes) if p.Peek().Type == TokenComma { // What we just read was actually the key, then. keyName = valName p.Read() // eat comma if p.Peek().Type != TokenIdent { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "For expression requires value variable name after comma.", Subject: p.Peek().Range.Ptr(), Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), }) } close := p.recover(closeType) return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }, diags } valName = string(p.Read().Bytes) } if !inKeyword.TokenMatches(p.Peek()) { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "For expression requires the 'in' keyword after its name declarations.", Subject: p.Peek().Range.Ptr(), Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), }) } close := p.recover(closeType) return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }, diags } p.Read() // eat 'in' keyword collExpr, collDiags := p.ParseExpression() diags = append(diags, collDiags...) if p.recovery && collDiags.HasErrors() { close := p.recover(closeType) return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }, diags } if p.Peek().Type != TokenColon { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "For expression requires a colon after the collection expression.", Subject: p.Peek().Range.Ptr(), Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), }) } close := p.recover(closeType) return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }, diags } p.Read() // eat colon var keyExpr, valExpr Expression var keyDiags, valDiags hcl.Diagnostics valExpr, valDiags = p.ParseExpression() if p.Peek().Type == TokenFatArrow { // What we just parsed was actually keyExpr p.Read() // eat the fat arrow keyExpr, keyDiags = valExpr, valDiags valExpr, valDiags = p.ParseExpression() } diags = append(diags, keyDiags...) diags = append(diags, valDiags...) if p.recovery && (keyDiags.HasErrors() || valDiags.HasErrors()) { close := p.recover(closeType) return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }, diags } group := false var ellipsis Token if p.Peek().Type == TokenEllipsis { ellipsis = p.Read() group = true } var condExpr Expression var condDiags hcl.Diagnostics if ifKeyword.TokenMatches(p.Peek()) { p.Read() // eat "if" condExpr, condDiags = p.ParseExpression() diags = append(diags, condDiags...) if p.recovery && condDiags.HasErrors() { close := p.recover(p.oppositeBracket(open.Type)) return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }, diags } } var close Token if p.Peek().Type == closeType { close = p.Read() } else { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "Extra characters after the end of the 'for' expression.", Subject: p.Peek().Range.Ptr(), Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), }) } close = p.recover(closeType) } if !makeObj { if keyExpr != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "Key expression is not valid when building a tuple.", Subject: keyExpr.Range().Ptr(), Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), }) } if group { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "Grouping ellipsis (...) cannot be used when building a tuple.", Subject: &ellipsis.Range, Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), }) } } else { if keyExpr == nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' expression", Detail: "Key expression is required when building an object.", Subject: valExpr.Range().Ptr(), Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), }) } } return &ForExpr{ KeyVar: keyName, ValVar: valName, CollExpr: collExpr, KeyExpr: keyExpr, ValExpr: valExpr, CondExpr: condExpr, Group: group, SrcRange: hcl.RangeBetween(open.Range, close.Range), OpenRange: open.Range, CloseRange: close.Range, }, diags } // parseQuotedStringLiteral is a helper for parsing quoted strings that // aren't allowed to contain any interpolations, such as block labels. func (p *parser) parseQuotedStringLiteral() (string, hcl.Range, hcl.Diagnostics) { oQuote := p.Read() if oQuote.Type != TokenOQuote { return "", oQuote.Range, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid string literal", Detail: "A quoted string is required here.", Subject: &oQuote.Range, }, } } var diags hcl.Diagnostics ret := &bytes.Buffer{} var cQuote Token Token: for { tok := p.Read() switch tok.Type { case TokenCQuote: cQuote = tok break Token case TokenQuotedLit: s, sDiags := ParseStringLiteralToken(tok) diags = append(diags, sDiags...) ret.WriteString(s) case TokenTemplateControl, TokenTemplateInterp: which := "$" if tok.Type == TokenTemplateControl { which = "%" } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid string literal", Detail: fmt.Sprintf( "Template sequences are not allowed in this string. To include a literal %q, double it (as \"%s%s\") to escape it.", which, which, which, ), Subject: &tok.Range, Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), }) // Now that we're returning an error callers won't attempt to use // the result for any real operations, but they might try to use // the partial AST for other analyses, so we'll leave a marker // to indicate that there was something invalid in the string to // help avoid misinterpretation of the partial result ret.WriteString(which) ret.WriteString("{ ... }") p.recover(TokenTemplateSeqEnd) // we'll try to keep parsing after the sequence ends case TokenEOF: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unterminated string literal", Detail: "Unable to find the closing quote mark before the end of the file.", Subject: &tok.Range, Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), }) break Token default: // Should never happen, as long as the scanner is behaving itself diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid string literal", Detail: "This item is not valid in a string literal.", Subject: &tok.Range, Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), }) p.recover(TokenCQuote) break Token } } return ret.String(), hcl.RangeBetween(oQuote.Range, cQuote.Range), diags } // ParseStringLiteralToken processes the given token, which must be either a // TokenQuotedLit or a TokenStringLit, returning the string resulting from // resolving any escape sequences. // // If any error diagnostics are returned, the returned string may be incomplete // or otherwise invalid. func ParseStringLiteralToken(tok Token) (string, hcl.Diagnostics) { var quoted bool switch tok.Type { case TokenQuotedLit: quoted = true case TokenStringLit: quoted = false default: panic("ParseStringLiteralToken can only be used with TokenStringLit and TokenQuotedLit tokens") } var diags hcl.Diagnostics ret := make([]byte, 0, len(tok.Bytes)) slices := scanStringLit(tok.Bytes, quoted) // We will mutate rng constantly as we walk through our token slices below. // Any diagnostics must take a copy of this rng rather than simply pointing // to it, e.g. by using rng.Ptr() rather than &rng. rng := tok.Range rng.End = rng.Start Slices: for _, slice := range slices { if len(slice) == 0 { continue } // Advance the start of our range to where the previous token ended rng.Start = rng.End // Advance the end of our range to after our token. b := slice for len(b) > 0 { adv, ch, _ := textseg.ScanGraphemeClusters(b, true) rng.End.Byte += adv switch ch[0] { case '\r', '\n': rng.End.Line++ rng.End.Column = 1 default: rng.End.Column++ } b = b[adv:] } TokenType: switch slice[0] { case '\\': if !quoted { // If we're not in quoted mode then just treat this token as // normal. (Slices can still start with backslash even if we're // not specifically looking for backslash sequences.) break TokenType } if len(slice) < 2 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid escape sequence", Detail: "Backslash must be followed by an escape sequence selector character.", Subject: rng.Ptr(), }) break TokenType } switch slice[1] { case 'n': ret = append(ret, '\n') continue Slices case 'r': ret = append(ret, '\r') continue Slices case 't': ret = append(ret, '\t') continue Slices case '"': ret = append(ret, '"') continue Slices case '\\': ret = append(ret, '\\') continue Slices case 'u', 'U': if slice[1] == 'u' && len(slice) != 6 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid escape sequence", Detail: "The \\u escape sequence must be followed by four hexadecimal digits.", Subject: rng.Ptr(), }) break TokenType } else if slice[1] == 'U' && len(slice) != 10 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid escape sequence", Detail: "The \\U escape sequence must be followed by eight hexadecimal digits.", Subject: rng.Ptr(), }) break TokenType } numHex := string(slice[2:]) num, err := strconv.ParseUint(numHex, 16, 32) if err != nil { // Should never happen because the scanner won't match // a sequence of digits that isn't valid. panic(err) } r := rune(num) l := utf8.RuneLen(r) if l == -1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid escape sequence", Detail: fmt.Sprintf("Cannot encode character U+%04x in UTF-8.", num), Subject: rng.Ptr(), }) break TokenType } for i := 0; i < l; i++ { ret = append(ret, 0) } rb := ret[len(ret)-l:] utf8.EncodeRune(rb, r) continue Slices default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid escape sequence", Detail: fmt.Sprintf("The symbol %q is not a valid escape sequence selector.", slice[1:]), Subject: rng.Ptr(), }) ret = append(ret, slice[1:]...) continue Slices } case '$', '%': if len(slice) != 3 { // Not long enough to be our escape sequence, so it's literal. break TokenType } if slice[1] == slice[0] && slice[2] == '{' { ret = append(ret, slice[0]) ret = append(ret, '{') continue Slices } break TokenType } // If we fall out here or break out of here from the switch above // then this slice is just a literal. ret = append(ret, slice...) } return string(ret), diags } // setRecovery turns on recovery mode without actually doing any recovery. // This can be used when a parser knowingly leaves the peeker in a useless // place and wants to suppress errors that might result from that decision. func (p *parser) setRecovery() { p.recovery = true } // recover seeks forward in the token stream until it finds TokenType "end", // then returns with the peeker pointed at the following token. // // If the given token type is a bracketer, this function will additionally // count nested instances of the brackets to try to leave the peeker at // the end of the _current_ instance of that bracketer, skipping over any // nested instances. This is a best-effort operation and may have // unpredictable results on input with bad bracketer nesting. func (p *parser) recover(end TokenType) Token { start := p.oppositeBracket(end) p.recovery = true nest := 0 for { tok := p.Read() ty := tok.Type if end == TokenTemplateSeqEnd && ty == TokenTemplateControl { // normalize so that our matching behavior can work, since // TokenTemplateControl/TokenTemplateInterp are asymmetrical // with TokenTemplateSeqEnd and thus we need to count both // openers if that's the closer we're looking for. ty = TokenTemplateInterp } switch ty { case start: nest++ case end: if nest < 1 { return tok } nest-- case TokenEOF: return tok } } } // recoverOver seeks forward in the token stream until it finds a block // starting with TokenType "start", then finds the corresponding end token, // leaving the peeker pointed at the token after that end token. // // The given token type _must_ be a bracketer. For example, if the given // start token is TokenOBrace then the parser will be left at the _end_ of // the next brace-delimited block encountered, or at EOF if no such block // is found or it is unclosed. func (p *parser) recoverOver(start TokenType) { end := p.oppositeBracket(start) // find the opening bracket first Token: for { tok := p.Read() switch tok.Type { case start, TokenEOF: break Token } } // Now use our existing recover function to locate the _end_ of the // container we've found. p.recover(end) } func (p *parser) recoverAfterBodyItem() { p.recovery = true var open []TokenType Token: for { tok := p.Read() switch tok.Type { case TokenNewline: if len(open) == 0 { break Token } case TokenEOF: break Token case TokenOBrace, TokenOBrack, TokenOParen, TokenOQuote, TokenOHeredoc, TokenTemplateInterp, TokenTemplateControl: open = append(open, tok.Type) case TokenCBrace, TokenCBrack, TokenCParen, TokenCQuote, TokenCHeredoc: opener := p.oppositeBracket(tok.Type) for len(open) > 0 && open[len(open)-1] != opener { open = open[:len(open)-1] } if len(open) > 0 { open = open[:len(open)-1] } case TokenTemplateSeqEnd: for len(open) > 0 && open[len(open)-1] != TokenTemplateInterp && open[len(open)-1] != TokenTemplateControl { open = open[:len(open)-1] } if len(open) > 0 { open = open[:len(open)-1] } } } } // oppositeBracket finds the bracket that opposes the given bracketer, or // NilToken if the given token isn't a bracketer. // // "Bracketer", for the sake of this function, is one end of a matching // open/close set of tokens that establish a bracketing context. func (p *parser) oppositeBracket(ty TokenType) TokenType { switch ty { case TokenOBrace: return TokenCBrace case TokenOBrack: return TokenCBrack case TokenOParen: return TokenCParen case TokenOQuote: return TokenCQuote case TokenOHeredoc: return TokenCHeredoc case TokenCBrace: return TokenOBrace case TokenCBrack: return TokenOBrack case TokenCParen: return TokenOParen case TokenCQuote: return TokenOQuote case TokenCHeredoc: return TokenOHeredoc case TokenTemplateControl: return TokenTemplateSeqEnd case TokenTemplateInterp: return TokenTemplateSeqEnd case TokenTemplateSeqEnd: // This is ambigous, but we return Interp here because that's // what's assumed by the "recover" method. return TokenTemplateInterp default: return TokenNil } } func errPlaceholderExpr(rng hcl.Range) Expression { return &LiteralValueExpr{ Val: cty.DynamicVal, SrcRange: rng, } } ������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go��������������������0000664�0000000�0000000�00000051443�13771713062�0027636�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "fmt" "strings" "unicode" "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) func (p *parser) ParseTemplate() (Expression, hcl.Diagnostics) { return p.parseTemplate(TokenEOF, false) } func (p *parser) parseTemplate(end TokenType, flushHeredoc bool) (Expression, hcl.Diagnostics) { exprs, passthru, rng, diags := p.parseTemplateInner(end, flushHeredoc) if passthru { if len(exprs) != 1 { panic("passthru set with len(exprs) != 1") } return &TemplateWrapExpr{ Wrapped: exprs[0], SrcRange: rng, }, diags } return &TemplateExpr{ Parts: exprs, SrcRange: rng, }, diags } func (p *parser) parseTemplateInner(end TokenType, flushHeredoc bool) ([]Expression, bool, hcl.Range, hcl.Diagnostics) { parts, diags := p.parseTemplateParts(end) if flushHeredoc { flushHeredocTemplateParts(parts) // Trim off leading spaces on lines per the flush heredoc spec } tp := templateParser{ Tokens: parts.Tokens, SrcRange: parts.SrcRange, } exprs, exprsDiags := tp.parseRoot() diags = append(diags, exprsDiags...) passthru := false if len(parts.Tokens) == 2 { // one real token and one synthetic "end" token if _, isInterp := parts.Tokens[0].(*templateInterpToken); isInterp { passthru = true } } return exprs, passthru, parts.SrcRange, diags } type templateParser struct { Tokens []templateToken SrcRange hcl.Range pos int } func (p *templateParser) parseRoot() ([]Expression, hcl.Diagnostics) { var exprs []Expression var diags hcl.Diagnostics for { next := p.Peek() if _, isEnd := next.(*templateEndToken); isEnd { break } expr, exprDiags := p.parseExpr() diags = append(diags, exprDiags...) exprs = append(exprs, expr) } return exprs, diags } func (p *templateParser) parseExpr() (Expression, hcl.Diagnostics) { next := p.Peek() switch tok := next.(type) { case *templateLiteralToken: p.Read() // eat literal return &LiteralValueExpr{ Val: cty.StringVal(tok.Val), SrcRange: tok.SrcRange, }, nil case *templateInterpToken: p.Read() // eat interp return tok.Expr, nil case *templateIfToken: return p.parseIf() case *templateForToken: return p.parseFor() case *templateEndToken: p.Read() // eat erroneous token return errPlaceholderExpr(tok.SrcRange), hcl.Diagnostics{ { // This is a particularly unhelpful diagnostic, so callers // should attempt to pre-empt it and produce a more helpful // diagnostic that is context-aware. Severity: hcl.DiagError, Summary: "Unexpected end of template", Detail: "The control directives within this template are unbalanced.", Subject: &tok.SrcRange, }, } case *templateEndCtrlToken: p.Read() // eat erroneous token return errPlaceholderExpr(tok.SrcRange), hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: fmt.Sprintf("Unexpected %s directive", tok.Name()), Detail: "The control directives within this template are unbalanced.", Subject: &tok.SrcRange, }, } default: // should never happen, because above should be exhaustive panic(fmt.Sprintf("unhandled template token type %T", next)) } } func (p *templateParser) parseIf() (Expression, hcl.Diagnostics) { open := p.Read() openIf, isIf := open.(*templateIfToken) if !isIf { // should never happen if caller is behaving panic("parseIf called with peeker not pointing at if token") } var ifExprs, elseExprs []Expression var diags hcl.Diagnostics var endifRange hcl.Range currentExprs := &ifExprs Token: for { next := p.Peek() if end, isEnd := next.(*templateEndToken); isEnd { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unexpected end of template", Detail: fmt.Sprintf( "The if directive at %s is missing its corresponding endif directive.", openIf.SrcRange, ), Subject: &end.SrcRange, }) return errPlaceholderExpr(end.SrcRange), diags } if end, isCtrlEnd := next.(*templateEndCtrlToken); isCtrlEnd { p.Read() // eat end directive switch end.Type { case templateElse: if currentExprs == &ifExprs { currentExprs = &elseExprs continue Token } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unexpected else directive", Detail: fmt.Sprintf( "Already in the else clause for the if started at %s.", openIf.SrcRange, ), Subject: &end.SrcRange, }) case templateEndIf: endifRange = end.SrcRange break Token default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unexpected %s directive", end.Name()), Detail: fmt.Sprintf( "Expecting an endif directive for the if started at %s.", openIf.SrcRange, ), Subject: &end.SrcRange, }) } return errPlaceholderExpr(end.SrcRange), diags } expr, exprDiags := p.parseExpr() diags = append(diags, exprDiags...) *currentExprs = append(*currentExprs, expr) } if len(ifExprs) == 0 { ifExprs = append(ifExprs, &LiteralValueExpr{ Val: cty.StringVal(""), SrcRange: hcl.Range{ Filename: openIf.SrcRange.Filename, Start: openIf.SrcRange.End, End: openIf.SrcRange.End, }, }) } if len(elseExprs) == 0 { elseExprs = append(elseExprs, &LiteralValueExpr{ Val: cty.StringVal(""), SrcRange: hcl.Range{ Filename: endifRange.Filename, Start: endifRange.Start, End: endifRange.Start, }, }) } trueExpr := &TemplateExpr{ Parts: ifExprs, SrcRange: hcl.RangeBetween(ifExprs[0].Range(), ifExprs[len(ifExprs)-1].Range()), } falseExpr := &TemplateExpr{ Parts: elseExprs, SrcRange: hcl.RangeBetween(elseExprs[0].Range(), elseExprs[len(elseExprs)-1].Range()), } return &ConditionalExpr{ Condition: openIf.CondExpr, TrueResult: trueExpr, FalseResult: falseExpr, SrcRange: hcl.RangeBetween(openIf.SrcRange, endifRange), }, diags } func (p *templateParser) parseFor() (Expression, hcl.Diagnostics) { open := p.Read() openFor, isFor := open.(*templateForToken) if !isFor { // should never happen if caller is behaving panic("parseFor called with peeker not pointing at for token") } var contentExprs []Expression var diags hcl.Diagnostics var endforRange hcl.Range Token: for { next := p.Peek() if end, isEnd := next.(*templateEndToken); isEnd { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unexpected end of template", Detail: fmt.Sprintf( "The for directive at %s is missing its corresponding endfor directive.", openFor.SrcRange, ), Subject: &end.SrcRange, }) return errPlaceholderExpr(end.SrcRange), diags } if end, isCtrlEnd := next.(*templateEndCtrlToken); isCtrlEnd { p.Read() // eat end directive switch end.Type { case templateElse: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unexpected else directive", Detail: "An else clause is not expected for a for directive.", Subject: &end.SrcRange, }) case templateEndFor: endforRange = end.SrcRange break Token default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unexpected %s directive", end.Name()), Detail: fmt.Sprintf( "Expecting an endfor directive corresponding to the for directive at %s.", openFor.SrcRange, ), Subject: &end.SrcRange, }) } return errPlaceholderExpr(end.SrcRange), diags } expr, exprDiags := p.parseExpr() diags = append(diags, exprDiags...) contentExprs = append(contentExprs, expr) } if len(contentExprs) == 0 { contentExprs = append(contentExprs, &LiteralValueExpr{ Val: cty.StringVal(""), SrcRange: hcl.Range{ Filename: openFor.SrcRange.Filename, Start: openFor.SrcRange.End, End: openFor.SrcRange.End, }, }) } contentExpr := &TemplateExpr{ Parts: contentExprs, SrcRange: hcl.RangeBetween(contentExprs[0].Range(), contentExprs[len(contentExprs)-1].Range()), } forExpr := &ForExpr{ KeyVar: openFor.KeyVar, ValVar: openFor.ValVar, CollExpr: openFor.CollExpr, ValExpr: contentExpr, SrcRange: hcl.RangeBetween(openFor.SrcRange, endforRange), OpenRange: openFor.SrcRange, CloseRange: endforRange, } return &TemplateJoinExpr{ Tuple: forExpr, }, diags } func (p *templateParser) Peek() templateToken { return p.Tokens[p.pos] } func (p *templateParser) Read() templateToken { ret := p.Peek() if _, end := ret.(*templateEndToken); !end { p.pos++ } return ret } // parseTemplateParts produces a flat sequence of "template tokens", which are // either literal values (with any "trimming" already applied), interpolation // sequences, or control flow markers. // // A further pass is required on the result to turn it into an AST. func (p *parser) parseTemplateParts(end TokenType) (*templateParts, hcl.Diagnostics) { var parts []templateToken var diags hcl.Diagnostics startRange := p.NextRange() ltrimNext := false nextCanTrimPrev := false var endRange hcl.Range Token: for { next := p.Read() if next.Type == end { // all done! endRange = next.Range break } ltrim := ltrimNext ltrimNext = false canTrimPrev := nextCanTrimPrev nextCanTrimPrev = false switch next.Type { case TokenStringLit, TokenQuotedLit: str, strDiags := ParseStringLiteralToken(next) diags = append(diags, strDiags...) if ltrim { str = strings.TrimLeftFunc(str, unicode.IsSpace) } parts = append(parts, &templateLiteralToken{ Val: str, SrcRange: next.Range, }) nextCanTrimPrev = true case TokenTemplateInterp: // if the opener is ${~ then we want to eat any trailing whitespace // in the preceding literal token, assuming it is indeed a literal // token. if canTrimPrev && len(next.Bytes) == 3 && next.Bytes[2] == '~' && len(parts) > 0 { prevExpr := parts[len(parts)-1] if lexpr, ok := prevExpr.(*templateLiteralToken); ok { lexpr.Val = strings.TrimRightFunc(lexpr.Val, unicode.IsSpace) } } p.PushIncludeNewlines(false) expr, exprDiags := p.ParseExpression() diags = append(diags, exprDiags...) close := p.Peek() if close.Type != TokenTemplateSeqEnd { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Extra characters after interpolation expression", Detail: "Expected a closing brace to end the interpolation expression, but found extra characters.", Subject: &close.Range, Context: hcl.RangeBetween(startRange, close.Range).Ptr(), }) } p.recover(TokenTemplateSeqEnd) } else { p.Read() // eat closing brace // If the closer is ~} then we want to eat any leading // whitespace on the next token, if it turns out to be a // literal token. if len(close.Bytes) == 2 && close.Bytes[0] == '~' { ltrimNext = true } } p.PopIncludeNewlines() parts = append(parts, &templateInterpToken{ Expr: expr, SrcRange: hcl.RangeBetween(next.Range, close.Range), }) case TokenTemplateControl: // if the opener is %{~ then we want to eat any trailing whitespace // in the preceding literal token, assuming it is indeed a literal // token. if canTrimPrev && len(next.Bytes) == 3 && next.Bytes[2] == '~' && len(parts) > 0 { prevExpr := parts[len(parts)-1] if lexpr, ok := prevExpr.(*templateLiteralToken); ok { lexpr.Val = strings.TrimRightFunc(lexpr.Val, unicode.IsSpace) } } p.PushIncludeNewlines(false) kw := p.Peek() if kw.Type != TokenIdent { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid template directive", Detail: "A template directive keyword (\"if\", \"for\", etc) is expected at the beginning of a %{ sequence.", Subject: &kw.Range, Context: hcl.RangeBetween(next.Range, kw.Range).Ptr(), }) } p.recover(TokenTemplateSeqEnd) p.PopIncludeNewlines() continue Token } p.Read() // eat keyword token switch { case ifKeyword.TokenMatches(kw): condExpr, exprDiags := p.ParseExpression() diags = append(diags, exprDiags...) parts = append(parts, &templateIfToken{ CondExpr: condExpr, SrcRange: hcl.RangeBetween(next.Range, p.NextRange()), }) case elseKeyword.TokenMatches(kw): parts = append(parts, &templateEndCtrlToken{ Type: templateElse, SrcRange: hcl.RangeBetween(next.Range, p.NextRange()), }) case endifKeyword.TokenMatches(kw): parts = append(parts, &templateEndCtrlToken{ Type: templateEndIf, SrcRange: hcl.RangeBetween(next.Range, p.NextRange()), }) case forKeyword.TokenMatches(kw): var keyName, valName string if p.Peek().Type != TokenIdent { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' directive", Detail: "For directive requires variable name after 'for'.", Subject: p.Peek().Range.Ptr(), }) } p.recover(TokenTemplateSeqEnd) p.PopIncludeNewlines() continue Token } valName = string(p.Read().Bytes) if p.Peek().Type == TokenComma { // What we just read was actually the key, then. keyName = valName p.Read() // eat comma if p.Peek().Type != TokenIdent { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' directive", Detail: "For directive requires value variable name after comma.", Subject: p.Peek().Range.Ptr(), }) } p.recover(TokenTemplateSeqEnd) p.PopIncludeNewlines() continue Token } valName = string(p.Read().Bytes) } if !inKeyword.TokenMatches(p.Peek()) { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid 'for' directive", Detail: "For directive requires 'in' keyword after names.", Subject: p.Peek().Range.Ptr(), }) } p.recover(TokenTemplateSeqEnd) p.PopIncludeNewlines() continue Token } p.Read() // eat 'in' keyword collExpr, collDiags := p.ParseExpression() diags = append(diags, collDiags...) parts = append(parts, &templateForToken{ KeyVar: keyName, ValVar: valName, CollExpr: collExpr, SrcRange: hcl.RangeBetween(next.Range, p.NextRange()), }) case endforKeyword.TokenMatches(kw): parts = append(parts, &templateEndCtrlToken{ Type: templateEndFor, SrcRange: hcl.RangeBetween(next.Range, p.NextRange()), }) default: if !p.recovery { suggestions := []string{"if", "for", "else", "endif", "endfor"} given := string(kw.Bytes) suggestion := nameSuggestion(given, suggestions) if suggestion != "" { suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid template control keyword", Detail: fmt.Sprintf("%q is not a valid template control keyword.%s", given, suggestion), Subject: &kw.Range, Context: hcl.RangeBetween(next.Range, kw.Range).Ptr(), }) } p.recover(TokenTemplateSeqEnd) p.PopIncludeNewlines() continue Token } close := p.Peek() if close.Type != TokenTemplateSeqEnd { if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Extra characters in %s marker", kw.Bytes), Detail: "Expected a closing brace to end the sequence, but found extra characters.", Subject: &close.Range, Context: hcl.RangeBetween(startRange, close.Range).Ptr(), }) } p.recover(TokenTemplateSeqEnd) } else { p.Read() // eat closing brace // If the closer is ~} then we want to eat any leading // whitespace on the next token, if it turns out to be a // literal token. if len(close.Bytes) == 2 && close.Bytes[0] == '~' { ltrimNext = true } } p.PopIncludeNewlines() default: if !p.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unterminated template string", Detail: "No closing marker was found for the string.", Subject: &next.Range, Context: hcl.RangeBetween(startRange, next.Range).Ptr(), }) } final := p.recover(end) endRange = final.Range break Token } } if len(parts) == 0 { // If a sequence has no content, we'll treat it as if it had an // empty string in it because that's what the user probably means // if they write "" in configuration. parts = append(parts, &templateLiteralToken{ Val: "", SrcRange: hcl.Range{ // Range is the zero-character span immediately after the // opening quote. Filename: startRange.Filename, Start: startRange.End, End: startRange.End, }, }) } // Always end with an end token, so the parser can produce diagnostics // about unclosed items with proper position information. parts = append(parts, &templateEndToken{ SrcRange: endRange, }) ret := &templateParts{ Tokens: parts, SrcRange: hcl.RangeBetween(startRange, endRange), } return ret, diags } // flushHeredocTemplateParts modifies in-place the line-leading literal strings // to apply the flush heredoc processing rule: find the line with the smallest // number of whitespace characters as prefix and then trim that number of // characters from all of the lines. // // This rule is applied to static tokens rather than to the rendered result, // so interpolating a string with leading whitespace cannot affect the chosen // prefix length. func flushHeredocTemplateParts(parts *templateParts) { if len(parts.Tokens) == 0 { // Nothing to do return } const maxInt = int((^uint(0)) >> 1) minSpaces := maxInt newline := true var adjust []*templateLiteralToken for _, ttok := range parts.Tokens { if newline { newline = false var spaces int if lit, ok := ttok.(*templateLiteralToken); ok { orig := lit.Val trimmed := strings.TrimLeftFunc(orig, unicode.IsSpace) // If a token is entirely spaces and ends with a newline // then it's a "blank line" and thus not considered for // space-prefix-counting purposes. if len(trimmed) == 0 && strings.HasSuffix(orig, "\n") { spaces = maxInt } else { spaceBytes := len(lit.Val) - len(trimmed) spaces, _ = textseg.TokenCount([]byte(orig[:spaceBytes]), textseg.ScanGraphemeClusters) adjust = append(adjust, lit) } } else if _, ok := ttok.(*templateEndToken); ok { break // don't process the end token since it never has spaces before it } if spaces < minSpaces { minSpaces = spaces } } if lit, ok := ttok.(*templateLiteralToken); ok { if strings.HasSuffix(lit.Val, "\n") { newline = true // The following token, if any, begins a new line } } } for _, lit := range adjust { // Since we want to count space _characters_ rather than space _bytes_, // we can't just do a straightforward slice operation here and instead // need to hunt for the split point with a scanner. valBytes := []byte(lit.Val) spaceByteCount := 0 for i := 0; i < minSpaces; i++ { adv, _, _ := textseg.ScanGraphemeClusters(valBytes, true) spaceByteCount += adv valBytes = valBytes[adv:] } lit.Val = lit.Val[spaceByteCount:] lit.SrcRange.Start.Column += minSpaces lit.SrcRange.Start.Byte += spaceByteCount } } type templateParts struct { Tokens []templateToken SrcRange hcl.Range } // templateToken is a higher-level token that represents a single atom within // the template language. Our template parsing first raises the raw token // stream to a sequence of templateToken, and then transforms the result into // an expression tree. type templateToken interface { templateToken() templateToken } type templateLiteralToken struct { Val string SrcRange hcl.Range isTemplateToken } type templateInterpToken struct { Expr Expression SrcRange hcl.Range isTemplateToken } type templateIfToken struct { CondExpr Expression SrcRange hcl.Range isTemplateToken } type templateForToken struct { KeyVar string // empty if ignoring key ValVar string CollExpr Expression SrcRange hcl.Range isTemplateToken } type templateEndCtrlType int const ( templateEndIf templateEndCtrlType = iota templateElse templateEndFor ) type templateEndCtrlToken struct { Type templateEndCtrlType SrcRange hcl.Range isTemplateToken } func (t *templateEndCtrlToken) Name() string { switch t.Type { case templateEndIf: return "endif" case templateElse: return "else" case templateEndFor: return "endfor" default: // should never happen panic("invalid templateEndCtrlType") } } type templateEndToken struct { SrcRange hcl.Range isTemplateToken } type isTemplateToken [0]int func (t isTemplateToken) templateToken() templateToken { return t } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_traversal.go�������������������0000664�0000000�0000000�00000010542�13771713062�0030021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) // ParseTraversalAbs parses an absolute traversal that is assumed to consume // all of the remaining tokens in the peeker. The usual parser recovery // behavior is not supported here because traversals are not expected to // be parsed as part of a larger program. func (p *parser) ParseTraversalAbs() (hcl.Traversal, hcl.Diagnostics) { var ret hcl.Traversal var diags hcl.Diagnostics // Absolute traversal must always begin with a variable name varTok := p.Read() if varTok.Type != TokenIdent { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Variable name required", Detail: "Must begin with a variable name.", Subject: &varTok.Range, }) return ret, diags } varName := string(varTok.Bytes) ret = append(ret, hcl.TraverseRoot{ Name: varName, SrcRange: varTok.Range, }) for { next := p.Peek() if next.Type == TokenEOF { return ret, diags } switch next.Type { case TokenDot: // Attribute access dot := p.Read() // eat dot nameTok := p.Read() if nameTok.Type != TokenIdent { if nameTok.Type == TokenStar { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Attribute name required", Detail: "Splat expressions (.*) may not be used here.", Subject: &nameTok.Range, Context: hcl.RangeBetween(varTok.Range, nameTok.Range).Ptr(), }) } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Attribute name required", Detail: "Dot must be followed by attribute name.", Subject: &nameTok.Range, Context: hcl.RangeBetween(varTok.Range, nameTok.Range).Ptr(), }) } return ret, diags } attrName := string(nameTok.Bytes) ret = append(ret, hcl.TraverseAttr{ Name: attrName, SrcRange: hcl.RangeBetween(dot.Range, nameTok.Range), }) case TokenOBrack: // Index open := p.Read() // eat open bracket next := p.Peek() switch next.Type { case TokenNumberLit: tok := p.Read() // eat number numVal, numDiags := p.numberLitValue(tok) diags = append(diags, numDiags...) close := p.Read() if close.Type != TokenCBrack { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unclosed index brackets", Detail: "Index key must be followed by a closing bracket.", Subject: &close.Range, Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), }) } ret = append(ret, hcl.TraverseIndex{ Key: numVal, SrcRange: hcl.RangeBetween(open.Range, close.Range), }) if diags.HasErrors() { return ret, diags } case TokenOQuote: str, _, strDiags := p.parseQuotedStringLiteral() diags = append(diags, strDiags...) close := p.Read() if close.Type != TokenCBrack { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unclosed index brackets", Detail: "Index key must be followed by a closing bracket.", Subject: &close.Range, Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), }) } ret = append(ret, hcl.TraverseIndex{ Key: cty.StringVal(str), SrcRange: hcl.RangeBetween(open.Range, close.Range), }) if diags.HasErrors() { return ret, diags } default: if next.Type == TokenStar { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Attribute name required", Detail: "Splat expressions ([*]) may not be used here.", Subject: &next.Range, Context: hcl.RangeBetween(varTok.Range, next.Range).Ptr(), }) } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Index value required", Detail: "Index brackets must contain either a literal number or a literal string.", Subject: &next.Range, Context: hcl.RangeBetween(varTok.Range, next.Range).Ptr(), }) } return ret, diags } default: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid character", Detail: "Expected an attribute access or an index operator.", Subject: &next.Range, Context: hcl.RangeBetween(varTok.Range, next.Range).Ptr(), }) return ret, diags } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/peeker.go�����������������������������0000664�0000000�0000000�00000013631�13771713062�0025717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "bytes" "fmt" "path/filepath" "runtime" "strings" "github.com/hashicorp/hcl/v2" ) // This is set to true at init() time in tests, to enable more useful output // if a stack discipline error is detected. It should not be enabled in // normal mode since there is a performance penalty from accessing the // runtime stack to produce the traces, but could be temporarily set to // true for debugging if desired. var tracePeekerNewlinesStack = false type peeker struct { Tokens Tokens NextIndex int IncludeComments bool IncludeNewlinesStack []bool // used only when tracePeekerNewlinesStack is set newlineStackChanges []peekerNewlineStackChange } // for use in debugging the stack usage only type peekerNewlineStackChange struct { Pushing bool // if false, then popping Frame runtime.Frame Include bool } func newPeeker(tokens Tokens, includeComments bool) *peeker { return &peeker{ Tokens: tokens, IncludeComments: includeComments, IncludeNewlinesStack: []bool{true}, } } func (p *peeker) Peek() Token { ret, _ := p.nextToken() return ret } func (p *peeker) Read() Token { ret, nextIdx := p.nextToken() p.NextIndex = nextIdx return ret } func (p *peeker) NextRange() hcl.Range { return p.Peek().Range } func (p *peeker) PrevRange() hcl.Range { if p.NextIndex == 0 { return p.NextRange() } return p.Tokens[p.NextIndex-1].Range } func (p *peeker) nextToken() (Token, int) { for i := p.NextIndex; i < len(p.Tokens); i++ { tok := p.Tokens[i] switch tok.Type { case TokenComment: if !p.IncludeComments { // Single-line comment tokens, starting with # or //, absorb // the trailing newline that terminates them as part of their // bytes. When we're filtering out comments, we must as a // special case transform these to newline tokens in order // to properly parse newline-terminated block items. if p.includingNewlines() { if len(tok.Bytes) > 0 && tok.Bytes[len(tok.Bytes)-1] == '\n' { fakeNewline := Token{ Type: TokenNewline, Bytes: tok.Bytes[len(tok.Bytes)-1 : len(tok.Bytes)], // We use the whole token range as the newline // range, even though that's a little... weird, // because otherwise we'd need to go count // characters again in order to figure out the // column of the newline, and that complexity // isn't justified when ranges of newlines are // so rarely printed anyway. Range: tok.Range, } return fakeNewline, i + 1 } } continue } case TokenNewline: if !p.includingNewlines() { continue } } return tok, i + 1 } // if we fall out here then we'll return the EOF token, and leave // our index pointed off the end of the array so we'll keep // returning EOF in future too. return p.Tokens[len(p.Tokens)-1], len(p.Tokens) } func (p *peeker) includingNewlines() bool { return p.IncludeNewlinesStack[len(p.IncludeNewlinesStack)-1] } func (p *peeker) PushIncludeNewlines(include bool) { if tracePeekerNewlinesStack { // Record who called us so that we can more easily track down any // mismanagement of the stack in the parser. callers := []uintptr{0} runtime.Callers(2, callers) frames := runtime.CallersFrames(callers) frame, _ := frames.Next() p.newlineStackChanges = append(p.newlineStackChanges, peekerNewlineStackChange{ true, frame, include, }) } p.IncludeNewlinesStack = append(p.IncludeNewlinesStack, include) } func (p *peeker) PopIncludeNewlines() bool { stack := p.IncludeNewlinesStack remain, ret := stack[:len(stack)-1], stack[len(stack)-1] p.IncludeNewlinesStack = remain if tracePeekerNewlinesStack { // Record who called us so that we can more easily track down any // mismanagement of the stack in the parser. callers := []uintptr{0} runtime.Callers(2, callers) frames := runtime.CallersFrames(callers) frame, _ := frames.Next() p.newlineStackChanges = append(p.newlineStackChanges, peekerNewlineStackChange{ false, frame, ret, }) } return ret } // AssertEmptyNewlinesStack checks if the IncludeNewlinesStack is empty, doing // panicking if it is not. This can be used to catch stack mismanagement that // might otherwise just cause confusing downstream errors. // // This function is a no-op if the stack is empty when called. // // If newlines stack tracing is enabled by setting the global variable // tracePeekerNewlinesStack at init time, a full log of all of the push/pop // calls will be produced to help identify which caller in the parser is // misbehaving. func (p *peeker) AssertEmptyIncludeNewlinesStack() { if len(p.IncludeNewlinesStack) != 1 { // Should never happen; indicates mismanagement of the stack inside // the parser. if p.newlineStackChanges != nil { // only if traceNewlinesStack is enabled above panic(fmt.Errorf( "non-empty IncludeNewlinesStack after parse with %d calls unaccounted for:\n%s", len(p.IncludeNewlinesStack)-1, formatPeekerNewlineStackChanges(p.newlineStackChanges), )) } else { panic(fmt.Errorf("non-empty IncludeNewlinesStack after parse: %#v", p.IncludeNewlinesStack)) } } } func formatPeekerNewlineStackChanges(changes []peekerNewlineStackChange) string { indent := 0 var buf bytes.Buffer for _, change := range changes { funcName := change.Frame.Function if idx := strings.LastIndexByte(funcName, '.'); idx != -1 { funcName = funcName[idx+1:] } filename := change.Frame.File if idx := strings.LastIndexByte(filename, filepath.Separator); idx != -1 { filename = filename[idx+1:] } switch change.Pushing { case true: buf.WriteString(strings.Repeat(" ", indent)) fmt.Fprintf(&buf, "PUSH %#v (%s at %s:%d)\n", change.Include, funcName, filename, change.Frame.Line) indent++ case false: indent-- buf.WriteString(strings.Repeat(" ", indent)) fmt.Fprintf(&buf, "POP %#v (%s at %s:%d)\n", change.Include, funcName, filename, change.Frame.Line) } } return buf.String() } �������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/public.go�����������������������������0000664�0000000�0000000�00000015230�13771713062�0025717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" ) // ParseConfig parses the given buffer as a whole HCL config file, returning // a *hcl.File representing its contents. If HasErrors called on the returned // diagnostics returns true, the returned body is likely to be incomplete // and should therefore be used with care. // // The body in the returned file has dynamic type *hclsyntax.Body, so callers // may freely type-assert this to get access to the full hclsyntax API in // situations where detailed access is required. However, most common use-cases // should be served using the hcl.Body interface to ensure compatibility with // other configurationg syntaxes, such as JSON. func ParseConfig(src []byte, filename string, start hcl.Pos) (*hcl.File, hcl.Diagnostics) { tokens, diags := LexConfig(src, filename, start) peeker := newPeeker(tokens, false) parser := &parser{peeker: peeker} body, parseDiags := parser.ParseBody(TokenEOF) diags = append(diags, parseDiags...) // Panic if the parser uses incorrect stack discipline with the peeker's // newlines stack, since otherwise it will produce confusing downstream // errors. peeker.AssertEmptyIncludeNewlinesStack() return &hcl.File{ Body: body, Bytes: src, Nav: navigation{ root: body, }, }, diags } // ParseExpression parses the given buffer as a standalone HCL expression, // returning it as an instance of Expression. func ParseExpression(src []byte, filename string, start hcl.Pos) (Expression, hcl.Diagnostics) { tokens, diags := LexExpression(src, filename, start) peeker := newPeeker(tokens, false) parser := &parser{peeker: peeker} // Bare expressions are always parsed in "ignore newlines" mode, as if // they were wrapped in parentheses. parser.PushIncludeNewlines(false) expr, parseDiags := parser.ParseExpression() diags = append(diags, parseDiags...) next := parser.Peek() if next.Type != TokenEOF && !parser.recovery { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Extra characters after expression", Detail: "An expression was successfully parsed, but extra characters were found after it.", Subject: &next.Range, }) } parser.PopIncludeNewlines() // Panic if the parser uses incorrect stack discipline with the peeker's // newlines stack, since otherwise it will produce confusing downstream // errors. peeker.AssertEmptyIncludeNewlinesStack() return expr, diags } // ParseTemplate parses the given buffer as a standalone HCL template, // returning it as an instance of Expression. func ParseTemplate(src []byte, filename string, start hcl.Pos) (Expression, hcl.Diagnostics) { tokens, diags := LexTemplate(src, filename, start) peeker := newPeeker(tokens, false) parser := &parser{peeker: peeker} expr, parseDiags := parser.ParseTemplate() diags = append(diags, parseDiags...) // Panic if the parser uses incorrect stack discipline with the peeker's // newlines stack, since otherwise it will produce confusing downstream // errors. peeker.AssertEmptyIncludeNewlinesStack() return expr, diags } // ParseTraversalAbs parses the given buffer as a standalone absolute traversal. // // Parsing as a traversal is more limited than parsing as an expession since // it allows only attribute and indexing operations on variables. Traverals // are useful as a syntax for referring to objects without necessarily // evaluating them. func ParseTraversalAbs(src []byte, filename string, start hcl.Pos) (hcl.Traversal, hcl.Diagnostics) { tokens, diags := LexExpression(src, filename, start) peeker := newPeeker(tokens, false) parser := &parser{peeker: peeker} // Bare traverals are always parsed in "ignore newlines" mode, as if // they were wrapped in parentheses. parser.PushIncludeNewlines(false) expr, parseDiags := parser.ParseTraversalAbs() diags = append(diags, parseDiags...) parser.PopIncludeNewlines() // Panic if the parser uses incorrect stack discipline with the peeker's // newlines stack, since otherwise it will produce confusing downstream // errors. peeker.AssertEmptyIncludeNewlinesStack() return expr, diags } // LexConfig performs lexical analysis on the given buffer, treating it as a // whole HCL config file, and returns the resulting tokens. // // Only minimal validation is done during lexical analysis, so the returned // diagnostics may include errors about lexical issues such as bad character // encodings or unrecognized characters, but full parsing is required to // detect _all_ syntax errors. func LexConfig(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { tokens := scanTokens(src, filename, start, scanNormal) diags := checkInvalidTokens(tokens) return tokens, diags } // LexExpression performs lexical analysis on the given buffer, treating it as // a standalone HCL expression, and returns the resulting tokens. // // Only minimal validation is done during lexical analysis, so the returned // diagnostics may include errors about lexical issues such as bad character // encodings or unrecognized characters, but full parsing is required to // detect _all_ syntax errors. func LexExpression(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { // This is actually just the same thing as LexConfig, since configs // and expressions lex in the same way. tokens := scanTokens(src, filename, start, scanNormal) diags := checkInvalidTokens(tokens) return tokens, diags } // LexTemplate performs lexical analysis on the given buffer, treating it as a // standalone HCL template, and returns the resulting tokens. // // Only minimal validation is done during lexical analysis, so the returned // diagnostics may include errors about lexical issues such as bad character // encodings or unrecognized characters, but full parsing is required to // detect _all_ syntax errors. func LexTemplate(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { tokens := scanTokens(src, filename, start, scanTemplate) diags := checkInvalidTokens(tokens) return tokens, diags } // ValidIdentifier tests if the given string could be a valid identifier in // a native syntax expression. // // This is useful when accepting names from the user that will be used as // variable or attribute names in the scope, to ensure that any name chosen // will be traversable using the variable or attribute traversal syntax. func ValidIdentifier(s string) bool { // This is a kinda-expensive way to do something pretty simple, but it // is easiest to do with our existing scanner-related infrastructure here // and nobody should be validating identifiers in a tight loop. tokens := scanTokens([]byte(s), "", hcl.Pos{}, scanIdentOnly) return len(tokens) == 2 && tokens[0].Type == TokenIdent && tokens[1].Type == TokenEOF } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go��������������������0000664�0000000�0000000�00000014240�13771713062�0027623�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//line scan_string_lit.rl:1 package hclsyntax // This file is generated from scan_string_lit.rl. DO NOT EDIT. //line scan_string_lit.go:9 var _hclstrtok_actions []byte = []byte{ 0, 1, 0, 1, 1, 2, 1, 0, } var _hclstrtok_key_offsets []byte = []byte{ 0, 0, 2, 4, 6, 10, 14, 18, 22, 27, 31, 36, 41, 46, 51, 57, 62, 74, 85, 96, 107, 118, 129, 140, 151, } var _hclstrtok_trans_keys []byte = []byte{ 128, 191, 128, 191, 128, 191, 10, 13, 36, 37, 10, 13, 36, 37, 10, 13, 36, 37, 10, 13, 36, 37, 10, 13, 36, 37, 123, 10, 13, 36, 37, 10, 13, 36, 37, 92, 10, 13, 36, 37, 92, 10, 13, 36, 37, 92, 10, 13, 36, 37, 92, 10, 13, 36, 37, 92, 123, 10, 13, 36, 37, 92, 85, 117, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, 10, 13, 36, 37, 92, 48, 57, 65, 70, 97, 102, } var _hclstrtok_single_lengths []byte = []byte{ 0, 0, 0, 0, 4, 4, 4, 4, 5, 4, 5, 5, 5, 5, 6, 5, 2, 5, 5, 5, 5, 5, 5, 5, 5, } var _hclstrtok_range_lengths []byte = []byte{ 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 3, 3, 3, 3, 3, 3, 3, 3, } var _hclstrtok_index_offsets []byte = []byte{ 0, 0, 2, 4, 6, 11, 16, 21, 26, 32, 37, 43, 49, 55, 61, 68, 74, 82, 91, 100, 109, 118, 127, 136, 145, } var _hclstrtok_indicies []byte = []byte{ 0, 1, 2, 1, 3, 1, 5, 6, 7, 8, 4, 10, 11, 12, 13, 9, 14, 11, 12, 13, 9, 10, 11, 15, 13, 9, 10, 11, 12, 13, 14, 9, 10, 11, 12, 15, 9, 17, 18, 19, 20, 21, 16, 23, 24, 25, 26, 27, 22, 0, 24, 25, 26, 27, 22, 23, 24, 28, 26, 27, 22, 23, 24, 25, 26, 27, 0, 22, 23, 24, 25, 28, 27, 22, 29, 30, 22, 2, 3, 31, 22, 0, 23, 24, 25, 26, 27, 32, 32, 32, 22, 23, 24, 25, 26, 27, 33, 33, 33, 22, 23, 24, 25, 26, 27, 34, 34, 34, 22, 23, 24, 25, 26, 27, 30, 30, 30, 22, 23, 24, 25, 26, 27, 35, 35, 35, 22, 23, 24, 25, 26, 27, 36, 36, 36, 22, 23, 24, 25, 26, 27, 37, 37, 37, 22, 23, 24, 25, 26, 27, 0, 0, 0, 22, } var _hclstrtok_trans_targs []byte = []byte{ 11, 0, 1, 2, 4, 5, 6, 7, 9, 4, 5, 6, 7, 9, 5, 8, 10, 11, 12, 13, 15, 16, 10, 11, 12, 13, 15, 16, 14, 17, 21, 3, 18, 19, 20, 22, 23, 24, } var _hclstrtok_trans_actions []byte = []byte{ 0, 0, 0, 0, 0, 1, 1, 1, 1, 3, 5, 5, 5, 5, 0, 0, 0, 1, 1, 1, 1, 1, 3, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } var _hclstrtok_eof_actions []byte = []byte{ 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, } const hclstrtok_start int = 4 const hclstrtok_first_final int = 4 const hclstrtok_error int = 0 const hclstrtok_en_quoted int = 10 const hclstrtok_en_unquoted int = 4 //line scan_string_lit.rl:10 func scanStringLit(data []byte, quoted bool) [][]byte { var ret [][]byte //line scan_string_lit.rl:61 // Ragel state p := 0 // "Pointer" into data pe := len(data) // End-of-data "pointer" ts := 0 te := 0 eof := pe var cs int // current state switch { case quoted: cs = hclstrtok_en_quoted default: cs = hclstrtok_en_unquoted } // Make Go compiler happy _ = ts _ = eof /*token := func () { ret = append(ret, data[ts:te]) }*/ //line scan_string_lit.go:154 { } //line scan_string_lit.go:158 { var _klen int var _trans int var _acts int var _nacts uint var _keys int if p == pe { goto _test_eof } if cs == 0 { goto _out } _resume: _keys = int(_hclstrtok_key_offsets[cs]) _trans = int(_hclstrtok_index_offsets[cs]) _klen = int(_hclstrtok_single_lengths[cs]) if _klen > 0 { _lower := int(_keys) var _mid int _upper := int(_keys + _klen - 1) for { if _upper < _lower { break } _mid = _lower + ((_upper - _lower) >> 1) switch { case data[p] < _hclstrtok_trans_keys[_mid]: _upper = _mid - 1 case data[p] > _hclstrtok_trans_keys[_mid]: _lower = _mid + 1 default: _trans += int(_mid - int(_keys)) goto _match } } _keys += _klen _trans += _klen } _klen = int(_hclstrtok_range_lengths[cs]) if _klen > 0 { _lower := int(_keys) var _mid int _upper := int(_keys + (_klen << 1) - 2) for { if _upper < _lower { break } _mid = _lower + (((_upper - _lower) >> 1) & ^1) switch { case data[p] < _hclstrtok_trans_keys[_mid]: _upper = _mid - 2 case data[p] > _hclstrtok_trans_keys[_mid+1]: _lower = _mid + 2 default: _trans += int((_mid - int(_keys)) >> 1) goto _match } } _trans += _klen } _match: _trans = int(_hclstrtok_indicies[_trans]) cs = int(_hclstrtok_trans_targs[_trans]) if _hclstrtok_trans_actions[_trans] == 0 { goto _again } _acts = int(_hclstrtok_trans_actions[_trans]) _nacts = uint(_hclstrtok_actions[_acts]) _acts++ for ; _nacts > 0; _nacts-- { _acts++ switch _hclstrtok_actions[_acts-1] { case 0: //line scan_string_lit.rl:40 // If te is behind p then we've skipped over some literal // characters which we must now return. if te < p { ret = append(ret, data[te:p]) } ts = p case 1: //line scan_string_lit.rl:48 te = p ret = append(ret, data[ts:te]) //line scan_string_lit.go:253 } } _again: if cs == 0 { goto _out } p++ if p != pe { goto _resume } _test_eof: { } if p == eof { __acts := _hclstrtok_eof_actions[cs] __nacts := uint(_hclstrtok_actions[__acts]) __acts++ for ; __nacts > 0; __nacts-- { __acts++ switch _hclstrtok_actions[__acts-1] { case 1: //line scan_string_lit.rl:48 te = p ret = append(ret, data[ts:te]) //line scan_string_lit.go:278 } } } _out: { } } //line scan_string_lit.rl:89 if te < p { // Collect any leftover literal characters at the end of the input ret = append(ret, data[te:p]) } // If we fall out here without being in a final state then we've // encountered something that the scanner can't match, which should // be impossible (the scanner matches all bytes _somehow_) but we'll // tolerate it and let the caller deal with it. if cs < hclstrtok_first_final { ret = append(ret, data[p:len(data)]) } return ret } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl��������������������0000664�0000000�0000000�00000005626�13771713062�0027643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ package hclsyntax // This file is generated from scan_string_lit.rl. DO NOT EDIT. %%{ # (except you are actually in scan_string_lit.rl here, so edit away!) machine hclstrtok; write data; }%% func scanStringLit(data []byte, quoted bool) [][]byte { var ret [][]byte %%{ include UnicodeDerived "unicode_derived.rl"; UTF8Cont = 0x80 .. 0xBF; AnyUTF8 = ( 0x00..0x7F | 0xC0..0xDF . UTF8Cont | 0xE0..0xEF . UTF8Cont . UTF8Cont | 0xF0..0xF7 . UTF8Cont . UTF8Cont . UTF8Cont ); BadUTF8 = any - AnyUTF8; Hex = ('0'..'9' | 'a'..'f' | 'A'..'F'); # Our goal with this patterns is to capture user intent as best as # possible, even if the input is invalid. The caller will then verify # whether each token is valid and generate suitable error messages # if not. UnicodeEscapeShort = "\\u" . Hex{0,4}; UnicodeEscapeLong = "\\U" . Hex{0,8}; UnicodeEscape = (UnicodeEscapeShort | UnicodeEscapeLong); SimpleEscape = "\\" . (AnyUTF8 - ('U'|'u'))?; TemplateEscape = ("$" . ("$" . ("{"?))?) | ("%" . ("%" . ("{"?))?); Newline = ("\r\n" | "\r" | "\n"); action Begin { // If te is behind p then we've skipped over some literal // characters which we must now return. if te < p { ret = append(ret, data[te:p]) } ts = p; } action End { te = p; ret = append(ret, data[ts:te]); } QuotedToken = (UnicodeEscape | SimpleEscape | TemplateEscape | Newline) >Begin %End; UnquotedToken = (TemplateEscape | Newline) >Begin %End; QuotedLiteral = (any - ("\\" | "$" | "%" | "\r" | "\n")); UnquotedLiteral = (any - ("$" | "%" | "\r" | "\n")); quoted := (QuotedToken | QuotedLiteral)**; unquoted := (UnquotedToken | UnquotedLiteral)**; }%% // Ragel state p := 0 // "Pointer" into data pe := len(data) // End-of-data "pointer" ts := 0 te := 0 eof := pe var cs int // current state switch { case quoted: cs = hclstrtok_en_quoted default: cs = hclstrtok_en_unquoted } // Make Go compiler happy _ = ts _ = eof /*token := func () { ret = append(ret, data[ts:te]) }*/ %%{ write init nocs; write exec; }%% if te < p { // Collect any leftover literal characters at the end of the input ret = append(ret, data[te:p]) } // If we fall out here without being in a final state then we've // encountered something that the scanner can't match, which should // be impossible (the scanner matches all bytes _somehow_) but we'll // tolerate it and let the caller deal with it. if cs < hclstrtok_first_final { ret = append(ret, data[p:len(data)]) } return ret } ����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go������������������������0000664�0000000�0000000�00000531223�13771713062�0026755�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������//line scan_tokens.rl:1 package hclsyntax import ( "bytes" "github.com/hashicorp/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. //line scan_tokens.go:15 var _hcltok_actions []byte = []byte{ 0, 1, 0, 1, 1, 1, 3, 1, 4, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 1, 13, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 23, 1, 24, 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1, 32, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 40, 1, 41, 1, 42, 1, 43, 1, 44, 1, 47, 1, 48, 1, 49, 1, 50, 1, 51, 1, 52, 1, 53, 1, 56, 1, 57, 1, 58, 1, 59, 1, 60, 1, 61, 1, 62, 1, 63, 1, 64, 1, 65, 1, 66, 1, 67, 1, 68, 1, 69, 1, 70, 1, 71, 1, 72, 1, 73, 1, 74, 1, 75, 1, 76, 1, 77, 1, 78, 1, 79, 1, 80, 1, 81, 1, 82, 1, 83, 1, 84, 1, 85, 2, 0, 14, 2, 0, 25, 2, 0, 29, 2, 0, 37, 2, 0, 41, 2, 1, 2, 2, 4, 5, 2, 4, 6, 2, 4, 21, 2, 4, 22, 2, 4, 33, 2, 4, 34, 2, 4, 45, 2, 4, 46, 2, 4, 54, 2, 4, 55, } var _hcltok_key_offsets []int16 = []int16{ 0, 0, 1, 2, 4, 9, 13, 15, 57, 98, 144, 145, 149, 155, 155, 157, 159, 168, 174, 181, 182, 185, 186, 190, 195, 204, 208, 212, 220, 222, 224, 226, 229, 261, 263, 265, 269, 273, 276, 287, 300, 319, 332, 348, 360, 376, 391, 412, 422, 434, 445, 459, 474, 484, 496, 505, 517, 519, 523, 544, 553, 563, 569, 575, 576, 625, 627, 631, 633, 639, 646, 654, 661, 664, 670, 674, 678, 680, 684, 688, 692, 698, 706, 714, 720, 722, 726, 728, 734, 738, 742, 746, 750, 755, 762, 768, 770, 772, 776, 778, 784, 788, 792, 802, 807, 821, 836, 838, 846, 848, 853, 867, 872, 874, 878, 879, 883, 889, 895, 905, 915, 926, 934, 937, 940, 944, 948, 950, 953, 953, 956, 958, 988, 990, 992, 996, 1001, 1005, 1010, 1012, 1014, 1016, 1025, 1029, 1033, 1039, 1041, 1049, 1057, 1069, 1072, 1078, 1082, 1084, 1088, 1108, 1110, 1112, 1123, 1129, 1131, 1133, 1135, 1139, 1145, 1151, 1153, 1158, 1162, 1164, 1172, 1190, 1230, 1240, 1244, 1246, 1248, 1249, 1253, 1257, 1261, 1265, 1269, 1274, 1278, 1282, 1286, 1288, 1290, 1294, 1304, 1308, 1310, 1314, 1318, 1322, 1335, 1337, 1339, 1343, 1345, 1349, 1351, 1353, 1383, 1387, 1391, 1395, 1398, 1405, 1410, 1421, 1425, 1441, 1455, 1459, 1464, 1468, 1472, 1478, 1480, 1486, 1488, 1492, 1494, 1500, 1505, 1510, 1520, 1522, 1524, 1528, 1532, 1534, 1547, 1549, 1553, 1557, 1565, 1567, 1571, 1573, 1574, 1577, 1582, 1584, 1586, 1590, 1592, 1596, 1602, 1622, 1628, 1634, 1636, 1637, 1647, 1648, 1656, 1663, 1665, 1668, 1670, 1672, 1674, 1679, 1683, 1687, 1692, 1702, 1712, 1716, 1720, 1734, 1760, 1770, 1772, 1774, 1777, 1779, 1782, 1784, 1788, 1790, 1791, 1795, 1797, 1800, 1807, 1815, 1817, 1819, 1823, 1825, 1831, 1842, 1845, 1847, 1851, 1856, 1886, 1891, 1893, 1896, 1901, 1915, 1922, 1936, 1941, 1954, 1958, 1971, 1976, 1994, 1995, 2004, 2008, 2020, 2025, 2032, 2039, 2046, 2048, 2052, 2074, 2079, 2080, 2084, 2086, 2136, 2139, 2150, 2154, 2156, 2162, 2168, 2170, 2175, 2177, 2181, 2183, 2184, 2186, 2188, 2194, 2196, 2198, 2202, 2208, 2221, 2223, 2229, 2233, 2241, 2252, 2260, 2263, 2293, 2299, 2302, 2307, 2309, 2313, 2317, 2321, 2323, 2330, 2332, 2341, 2348, 2356, 2358, 2378, 2390, 2394, 2396, 2414, 2453, 2455, 2459, 2461, 2468, 2472, 2500, 2502, 2504, 2506, 2508, 2511, 2513, 2517, 2521, 2523, 2526, 2528, 2530, 2533, 2535, 2537, 2538, 2540, 2542, 2546, 2550, 2553, 2566, 2568, 2574, 2578, 2580, 2584, 2588, 2602, 2605, 2614, 2616, 2620, 2626, 2626, 2628, 2630, 2639, 2645, 2652, 2653, 2656, 2657, 2661, 2666, 2675, 2679, 2683, 2691, 2693, 2695, 2697, 2700, 2732, 2734, 2736, 2740, 2744, 2747, 2758, 2771, 2790, 2803, 2819, 2831, 2847, 2862, 2883, 2893, 2905, 2916, 2930, 2945, 2955, 2967, 2976, 2988, 2990, 2994, 3015, 3024, 3034, 3040, 3046, 3047, 3096, 3098, 3102, 3104, 3110, 3117, 3125, 3132, 3135, 3141, 3145, 3149, 3151, 3155, 3159, 3163, 3169, 3177, 3185, 3191, 3193, 3197, 3199, 3205, 3209, 3213, 3217, 3221, 3226, 3233, 3239, 3241, 3243, 3247, 3249, 3255, 3259, 3263, 3273, 3278, 3292, 3307, 3309, 3317, 3319, 3324, 3338, 3343, 3345, 3349, 3350, 3354, 3360, 3366, 3376, 3386, 3397, 3405, 3408, 3411, 3415, 3419, 3421, 3424, 3424, 3427, 3429, 3459, 3461, 3463, 3467, 3472, 3476, 3481, 3483, 3485, 3487, 3496, 3500, 3504, 3510, 3512, 3520, 3528, 3540, 3543, 3549, 3553, 3555, 3559, 3579, 3581, 3583, 3594, 3600, 3602, 3604, 3606, 3610, 3616, 3622, 3624, 3629, 3633, 3635, 3643, 3661, 3701, 3711, 3715, 3717, 3719, 3720, 3724, 3728, 3732, 3736, 3740, 3745, 3749, 3753, 3757, 3759, 3761, 3765, 3775, 3779, 3781, 3785, 3789, 3793, 3806, 3808, 3810, 3814, 3816, 3820, 3822, 3824, 3854, 3858, 3862, 3866, 3869, 3876, 3881, 3892, 3896, 3912, 3926, 3930, 3935, 3939, 3943, 3949, 3951, 3957, 3959, 3963, 3965, 3971, 3976, 3981, 3991, 3993, 3995, 3999, 4003, 4005, 4018, 4020, 4024, 4028, 4036, 4038, 4042, 4044, 4045, 4048, 4053, 4055, 4057, 4061, 4063, 4067, 4073, 4093, 4099, 4105, 4107, 4108, 4118, 4119, 4127, 4134, 4136, 4139, 4141, 4143, 4145, 4150, 4154, 4158, 4163, 4173, 4183, 4187, 4191, 4205, 4231, 4241, 4243, 4245, 4248, 4250, 4253, 4255, 4259, 4261, 4262, 4266, 4268, 4270, 4277, 4281, 4288, 4295, 4304, 4320, 4332, 4350, 4361, 4373, 4381, 4399, 4407, 4437, 4440, 4450, 4460, 4472, 4483, 4492, 4505, 4517, 4521, 4527, 4554, 4563, 4566, 4571, 4577, 4582, 4603, 4607, 4613, 4613, 4620, 4629, 4637, 4640, 4644, 4650, 4656, 4659, 4663, 4670, 4676, 4685, 4694, 4698, 4702, 4706, 4710, 4717, 4721, 4725, 4735, 4741, 4745, 4751, 4755, 4758, 4764, 4770, 4782, 4786, 4790, 4800, 4804, 4815, 4817, 4819, 4823, 4835, 4840, 4864, 4868, 4874, 4896, 4905, 4909, 4912, 4913, 4921, 4929, 4935, 4945, 4952, 4970, 4973, 4976, 4984, 4990, 4994, 4998, 5002, 5008, 5016, 5021, 5027, 5031, 5039, 5046, 5050, 5057, 5063, 5071, 5079, 5085, 5091, 5102, 5106, 5118, 5127, 5144, 5161, 5164, 5168, 5170, 5176, 5178, 5182, 5197, 5201, 5205, 5209, 5213, 5217, 5219, 5225, 5230, 5234, 5240, 5247, 5250, 5268, 5270, 5315, 5321, 5327, 5331, 5335, 5341, 5345, 5351, 5357, 5364, 5366, 5372, 5378, 5382, 5386, 5394, 5407, 5413, 5420, 5428, 5434, 5443, 5449, 5453, 5458, 5462, 5470, 5474, 5478, 5508, 5514, 5520, 5526, 5532, 5539, 5545, 5552, 5557, 5567, 5571, 5578, 5584, 5588, 5595, 5599, 5605, 5608, 5612, 5616, 5620, 5624, 5629, 5634, 5638, 5649, 5653, 5657, 5663, 5671, 5675, 5692, 5696, 5702, 5712, 5718, 5724, 5727, 5732, 5741, 5745, 5749, 5755, 5759, 5765, 5773, 5791, 5792, 5802, 5803, 5812, 5820, 5822, 5825, 5827, 5829, 5831, 5836, 5849, 5853, 5868, 5897, 5908, 5910, 5914, 5918, 5923, 5927, 5929, 5936, 5940, 5948, 5952, 5964, 5966, 5968, 5970, 5972, 5974, 5975, 5977, 5979, 5981, 5983, 5985, 5986, 5988, 5990, 5992, 5994, 5996, 6000, 6006, 6006, 6008, 6010, 6019, 6025, 6032, 6033, 6036, 6037, 6041, 6046, 6055, 6059, 6063, 6071, 6073, 6075, 6077, 6080, 6112, 6114, 6116, 6120, 6124, 6127, 6138, 6151, 6170, 6183, 6199, 6211, 6227, 6242, 6263, 6273, 6285, 6296, 6310, 6325, 6335, 6347, 6356, 6368, 6370, 6374, 6395, 6404, 6414, 6420, 6426, 6427, 6476, 6478, 6482, 6484, 6490, 6497, 6505, 6512, 6515, 6521, 6525, 6529, 6531, 6535, 6539, 6543, 6549, 6557, 6565, 6571, 6573, 6577, 6579, 6585, 6589, 6593, 6597, 6601, 6606, 6613, 6619, 6621, 6623, 6627, 6629, 6635, 6639, 6643, 6653, 6658, 6672, 6687, 6689, 6697, 6699, 6704, 6718, 6723, 6725, 6729, 6730, 6734, 6740, 6746, 6756, 6766, 6777, 6785, 6788, 6791, 6795, 6799, 6801, 6804, 6804, 6807, 6809, 6839, 6841, 6843, 6847, 6852, 6856, 6861, 6863, 6865, 6867, 6876, 6880, 6884, 6890, 6892, 6900, 6908, 6920, 6923, 6929, 6933, 6935, 6939, 6959, 6961, 6963, 6974, 6980, 6982, 6984, 6986, 6990, 6996, 7002, 7004, 7009, 7013, 7015, 7023, 7041, 7081, 7091, 7095, 7097, 7099, 7100, 7104, 7108, 7112, 7116, 7120, 7125, 7129, 7133, 7137, 7139, 7141, 7145, 7155, 7159, 7161, 7165, 7169, 7173, 7186, 7188, 7190, 7194, 7196, 7200, 7202, 7204, 7234, 7238, 7242, 7246, 7249, 7256, 7261, 7272, 7276, 7292, 7306, 7310, 7315, 7319, 7323, 7329, 7331, 7337, 7339, 7343, 7345, 7351, 7356, 7361, 7371, 7373, 7375, 7379, 7383, 7385, 7398, 7400, 7404, 7408, 7416, 7418, 7422, 7424, 7425, 7428, 7433, 7435, 7437, 7441, 7443, 7447, 7453, 7473, 7479, 7485, 7487, 7488, 7498, 7499, 7507, 7514, 7516, 7519, 7521, 7523, 7525, 7530, 7534, 7538, 7543, 7553, 7563, 7567, 7571, 7585, 7611, 7621, 7623, 7625, 7628, 7630, 7633, 7635, 7639, 7641, 7642, 7646, 7648, 7650, 7657, 7661, 7668, 7675, 7684, 7700, 7712, 7730, 7741, 7753, 7761, 7779, 7787, 7817, 7820, 7830, 7840, 7852, 7863, 7872, 7885, 7897, 7901, 7907, 7934, 7943, 7946, 7951, 7957, 7962, 7983, 7987, 7993, 7993, 8000, 8009, 8017, 8020, 8024, 8030, 8036, 8039, 8043, 8050, 8056, 8065, 8074, 8078, 8082, 8086, 8090, 8097, 8101, 8105, 8115, 8121, 8125, 8131, 8135, 8138, 8144, 8150, 8162, 8166, 8170, 8180, 8184, 8195, 8197, 8199, 8203, 8215, 8220, 8244, 8248, 8254, 8276, 8285, 8289, 8292, 8293, 8301, 8309, 8315, 8325, 8332, 8350, 8353, 8356, 8364, 8370, 8374, 8378, 8382, 8388, 8396, 8401, 8407, 8411, 8419, 8426, 8430, 8437, 8443, 8451, 8459, 8465, 8471, 8482, 8486, 8498, 8507, 8524, 8541, 8544, 8548, 8550, 8556, 8558, 8562, 8577, 8581, 8585, 8589, 8593, 8597, 8599, 8605, 8610, 8614, 8620, 8627, 8630, 8648, 8650, 8695, 8701, 8707, 8711, 8715, 8721, 8725, 8731, 8737, 8744, 8746, 8752, 8758, 8762, 8766, 8774, 8787, 8793, 8800, 8808, 8814, 8823, 8829, 8833, 8838, 8842, 8850, 8854, 8858, 8888, 8894, 8900, 8906, 8912, 8919, 8925, 8932, 8937, 8947, 8951, 8958, 8964, 8968, 8975, 8979, 8985, 8988, 8992, 8996, 9000, 9004, 9009, 9014, 9018, 9029, 9033, 9037, 9043, 9051, 9055, 9072, 9076, 9082, 9092, 9098, 9104, 9107, 9112, 9121, 9125, 9129, 9135, 9139, 9145, 9153, 9171, 9172, 9182, 9183, 9192, 9200, 9202, 9205, 9207, 9209, 9211, 9216, 9229, 9233, 9248, 9277, 9288, 9290, 9294, 9298, 9303, 9307, 9309, 9316, 9320, 9328, 9332, 9407, 9409, 9410, 9411, 9412, 9413, 9414, 9416, 9421, 9423, 9425, 9426, 9470, 9471, 9472, 9474, 9479, 9483, 9483, 9485, 9487, 9498, 9508, 9516, 9517, 9519, 9520, 9524, 9528, 9538, 9542, 9549, 9560, 9567, 9571, 9577, 9588, 9620, 9669, 9684, 9699, 9704, 9706, 9711, 9743, 9751, 9753, 9775, 9797, 9799, 9815, 9831, 9833, 9835, 9835, 9836, 9837, 9838, 9840, 9841, 9853, 9855, 9857, 9859, 9873, 9887, 9889, 9892, 9895, 9897, 9898, 9899, 9901, 9903, 9905, 9919, 9933, 9935, 9938, 9941, 9943, 9944, 9945, 9947, 9949, 9951, 10000, 10044, 10046, 10051, 10055, 10055, 10057, 10059, 10070, 10080, 10088, 10089, 10091, 10092, 10096, 10100, 10110, 10114, 10121, 10132, 10139, 10143, 10149, 10160, 10192, 10241, 10256, 10271, 10276, 10278, 10283, 10315, 10323, 10325, 10347, 10369, } var _hcltok_trans_keys []byte = []byte{ 46, 42, 42, 47, 46, 69, 101, 48, 57, 43, 45, 48, 57, 48, 57, 45, 95, 194, 195, 198, 199, 203, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 233, 234, 237, 239, 240, 65, 90, 97, 122, 196, 202, 208, 218, 229, 236, 95, 194, 195, 198, 199, 203, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 233, 234, 237, 239, 240, 65, 90, 97, 122, 196, 202, 208, 218, 229, 236, 10, 13, 45, 95, 194, 195, 198, 199, 203, 204, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 233, 234, 237, 239, 240, 243, 48, 57, 65, 90, 97, 122, 196, 218, 229, 236, 10, 170, 181, 183, 186, 128, 150, 152, 182, 184, 255, 192, 255, 128, 255, 173, 130, 133, 146, 159, 165, 171, 175, 255, 181, 190, 184, 185, 192, 255, 140, 134, 138, 142, 161, 163, 255, 182, 130, 136, 137, 176, 151, 152, 154, 160, 190, 136, 144, 192, 255, 135, 129, 130, 132, 133, 144, 170, 176, 178, 144, 154, 160, 191, 128, 169, 174, 255, 148, 169, 157, 158, 189, 190, 192, 255, 144, 255, 139, 140, 178, 255, 186, 128, 181, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 128, 173, 128, 155, 160, 180, 182, 189, 148, 161, 163, 255, 176, 164, 165, 132, 169, 177, 141, 142, 145, 146, 179, 181, 186, 187, 158, 133, 134, 137, 138, 143, 150, 152, 155, 164, 165, 178, 255, 188, 129, 131, 133, 138, 143, 144, 147, 168, 170, 176, 178, 179, 181, 182, 184, 185, 190, 255, 157, 131, 134, 137, 138, 142, 144, 146, 152, 159, 165, 182, 255, 129, 131, 133, 141, 143, 145, 147, 168, 170, 176, 178, 179, 181, 185, 188, 255, 134, 138, 142, 143, 145, 159, 164, 165, 176, 184, 186, 255, 129, 131, 133, 140, 143, 144, 147, 168, 170, 176, 178, 179, 181, 185, 188, 191, 177, 128, 132, 135, 136, 139, 141, 150, 151, 156, 157, 159, 163, 166, 175, 156, 130, 131, 133, 138, 142, 144, 146, 149, 153, 154, 158, 159, 163, 164, 168, 170, 174, 185, 190, 191, 144, 151, 128, 130, 134, 136, 138, 141, 166, 175, 128, 131, 133, 140, 142, 144, 146, 168, 170, 185, 189, 255, 133, 137, 151, 142, 148, 155, 159, 164, 165, 176, 255, 128, 131, 133, 140, 142, 144, 146, 168, 170, 179, 181, 185, 188, 191, 158, 128, 132, 134, 136, 138, 141, 149, 150, 160, 163, 166, 175, 177, 178, 129, 131, 133, 140, 142, 144, 146, 186, 189, 255, 133, 137, 143, 147, 152, 158, 164, 165, 176, 185, 192, 255, 189, 130, 131, 133, 150, 154, 177, 179, 187, 138, 150, 128, 134, 143, 148, 152, 159, 166, 175, 178, 179, 129, 186, 128, 142, 144, 153, 132, 138, 141, 165, 167, 129, 130, 135, 136, 148, 151, 153, 159, 161, 163, 170, 171, 173, 185, 187, 189, 134, 128, 132, 136, 141, 144, 153, 156, 159, 128, 181, 183, 185, 152, 153, 160, 169, 190, 191, 128, 135, 137, 172, 177, 191, 128, 132, 134, 151, 153, 188, 134, 128, 129, 130, 131, 137, 138, 139, 140, 141, 142, 143, 144, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 173, 175, 176, 177, 178, 179, 181, 182, 183, 188, 189, 190, 191, 132, 152, 172, 184, 185, 187, 128, 191, 128, 137, 144, 255, 158, 159, 134, 187, 136, 140, 142, 143, 137, 151, 153, 142, 143, 158, 159, 137, 177, 142, 143, 182, 183, 191, 255, 128, 130, 133, 136, 150, 152, 255, 145, 150, 151, 155, 156, 160, 168, 178, 255, 128, 143, 160, 255, 182, 183, 190, 255, 129, 255, 173, 174, 192, 255, 129, 154, 160, 255, 171, 173, 185, 255, 128, 140, 142, 148, 160, 180, 128, 147, 160, 172, 174, 176, 178, 179, 148, 150, 152, 155, 158, 159, 170, 255, 139, 141, 144, 153, 160, 255, 184, 255, 128, 170, 176, 255, 182, 255, 128, 158, 160, 171, 176, 187, 134, 173, 176, 180, 128, 171, 176, 255, 138, 143, 155, 255, 128, 155, 160, 255, 159, 189, 190, 192, 255, 167, 128, 137, 144, 153, 176, 189, 140, 143, 154, 170, 180, 255, 180, 255, 128, 183, 128, 137, 141, 189, 128, 136, 144, 146, 148, 182, 184, 185, 128, 181, 187, 191, 150, 151, 158, 159, 152, 154, 156, 158, 134, 135, 142, 143, 190, 255, 190, 128, 180, 182, 188, 130, 132, 134, 140, 144, 147, 150, 155, 160, 172, 178, 180, 182, 188, 128, 129, 130, 131, 132, 133, 134, 176, 177, 178, 179, 180, 181, 182, 183, 191, 255, 129, 147, 149, 176, 178, 190, 192, 255, 144, 156, 161, 144, 156, 165, 176, 130, 135, 149, 164, 166, 168, 138, 147, 152, 157, 170, 185, 188, 191, 142, 133, 137, 160, 255, 137, 255, 128, 174, 176, 255, 159, 165, 170, 180, 255, 167, 173, 128, 165, 176, 255, 168, 174, 176, 190, 192, 255, 128, 150, 160, 166, 168, 174, 176, 182, 184, 190, 128, 134, 136, 142, 144, 150, 152, 158, 160, 191, 128, 129, 130, 131, 132, 133, 134, 135, 144, 145, 255, 133, 135, 161, 175, 177, 181, 184, 188, 160, 151, 152, 187, 192, 255, 133, 173, 177, 255, 143, 159, 187, 255, 176, 191, 182, 183, 184, 191, 192, 255, 150, 255, 128, 146, 147, 148, 152, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 129, 255, 141, 255, 144, 189, 141, 143, 172, 255, 191, 128, 175, 180, 189, 151, 159, 162, 255, 175, 137, 138, 184, 255, 183, 255, 168, 255, 128, 179, 188, 134, 143, 154, 159, 184, 186, 190, 255, 128, 173, 176, 255, 148, 159, 189, 255, 129, 142, 154, 159, 191, 255, 128, 182, 128, 141, 144, 153, 160, 182, 186, 255, 128, 130, 155, 157, 160, 175, 178, 182, 129, 134, 137, 142, 145, 150, 160, 166, 168, 174, 176, 255, 155, 166, 175, 128, 170, 172, 173, 176, 185, 158, 159, 160, 255, 164, 175, 135, 138, 188, 255, 164, 169, 171, 172, 173, 174, 175, 180, 181, 182, 183, 184, 185, 187, 188, 189, 190, 191, 165, 186, 174, 175, 154, 255, 190, 128, 134, 147, 151, 157, 168, 170, 182, 184, 188, 128, 129, 131, 132, 134, 255, 147, 255, 190, 255, 144, 145, 136, 175, 188, 255, 128, 143, 160, 175, 179, 180, 141, 143, 176, 180, 182, 255, 189, 255, 191, 144, 153, 161, 186, 129, 154, 166, 255, 191, 255, 130, 135, 138, 143, 146, 151, 154, 156, 144, 145, 146, 147, 148, 150, 151, 152, 155, 157, 158, 160, 170, 171, 172, 175, 161, 169, 128, 129, 130, 131, 133, 135, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 156, 157, 160, 161, 162, 163, 164, 166, 168, 169, 170, 171, 172, 173, 174, 176, 177, 153, 155, 178, 179, 128, 139, 141, 166, 168, 186, 188, 189, 191, 255, 142, 143, 158, 255, 187, 255, 128, 180, 189, 128, 156, 160, 255, 145, 159, 161, 255, 128, 159, 176, 255, 139, 143, 187, 255, 128, 157, 160, 255, 144, 132, 135, 150, 255, 158, 159, 170, 175, 148, 151, 188, 255, 128, 167, 176, 255, 164, 255, 183, 255, 128, 149, 160, 167, 136, 188, 128, 133, 138, 181, 183, 184, 191, 255, 150, 159, 183, 255, 128, 158, 160, 178, 180, 181, 128, 149, 160, 185, 128, 183, 190, 191, 191, 128, 131, 133, 134, 140, 147, 149, 151, 153, 179, 184, 186, 160, 188, 128, 156, 128, 135, 137, 166, 128, 181, 128, 149, 160, 178, 128, 145, 128, 178, 129, 130, 131, 132, 133, 135, 136, 138, 139, 140, 141, 144, 145, 146, 147, 150, 151, 152, 153, 154, 155, 156, 162, 163, 171, 176, 177, 178, 128, 134, 135, 165, 176, 190, 144, 168, 176, 185, 128, 180, 182, 191, 182, 144, 179, 155, 133, 137, 141, 143, 157, 255, 190, 128, 145, 147, 183, 136, 128, 134, 138, 141, 143, 157, 159, 168, 176, 255, 171, 175, 186, 255, 128, 131, 133, 140, 143, 144, 147, 168, 170, 176, 178, 179, 181, 185, 188, 191, 144, 151, 128, 132, 135, 136, 139, 141, 157, 163, 166, 172, 176, 180, 128, 138, 144, 153, 134, 136, 143, 154, 255, 128, 181, 184, 255, 129, 151, 158, 255, 129, 131, 133, 143, 154, 255, 128, 137, 128, 153, 157, 171, 176, 185, 160, 255, 170, 190, 192, 255, 128, 184, 128, 136, 138, 182, 184, 191, 128, 144, 153, 178, 255, 168, 144, 145, 183, 255, 128, 142, 145, 149, 129, 141, 144, 146, 147, 148, 175, 255, 132, 255, 128, 144, 129, 143, 144, 153, 145, 152, 135, 255, 160, 168, 169, 171, 172, 173, 174, 188, 189, 190, 191, 161, 167, 185, 255, 128, 158, 160, 169, 144, 173, 176, 180, 128, 131, 144, 153, 163, 183, 189, 255, 144, 255, 133, 143, 191, 255, 143, 159, 160, 128, 129, 255, 159, 160, 171, 172, 255, 173, 255, 179, 255, 128, 176, 177, 178, 128, 129, 171, 175, 189, 255, 128, 136, 144, 153, 157, 158, 133, 134, 137, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158, 159, 168, 169, 170, 150, 153, 165, 169, 173, 178, 187, 255, 131, 132, 140, 169, 174, 255, 130, 132, 149, 157, 173, 186, 188, 160, 161, 163, 164, 167, 168, 132, 134, 149, 157, 186, 139, 140, 191, 255, 134, 128, 132, 138, 144, 146, 255, 166, 167, 129, 155, 187, 149, 181, 143, 175, 137, 169, 131, 140, 141, 192, 255, 128, 182, 187, 255, 173, 180, 182, 255, 132, 155, 159, 161, 175, 128, 160, 163, 164, 165, 184, 185, 186, 161, 162, 128, 134, 136, 152, 155, 161, 163, 164, 166, 170, 133, 143, 151, 255, 139, 143, 154, 255, 164, 167, 185, 187, 128, 131, 133, 159, 161, 162, 169, 178, 180, 183, 130, 135, 137, 139, 148, 151, 153, 155, 157, 159, 164, 190, 141, 143, 145, 146, 161, 162, 167, 170, 172, 178, 180, 183, 185, 188, 128, 137, 139, 155, 161, 163, 165, 169, 171, 187, 155, 156, 151, 255, 156, 157, 160, 181, 255, 186, 187, 255, 162, 255, 160, 168, 161, 167, 158, 255, 160, 132, 135, 133, 134, 176, 255, 170, 181, 186, 191, 176, 180, 182, 183, 186, 189, 134, 140, 136, 138, 142, 161, 163, 255, 130, 137, 136, 255, 144, 170, 176, 178, 160, 191, 128, 138, 174, 175, 177, 255, 148, 150, 164, 167, 173, 176, 185, 189, 190, 192, 255, 144, 146, 175, 141, 255, 166, 176, 178, 255, 186, 138, 170, 180, 181, 160, 161, 162, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 184, 186, 187, 188, 189, 190, 183, 185, 154, 164, 168, 128, 149, 128, 152, 189, 132, 185, 144, 152, 161, 177, 255, 169, 177, 129, 132, 141, 142, 145, 146, 179, 181, 186, 188, 190, 255, 142, 156, 157, 159, 161, 176, 177, 133, 138, 143, 144, 147, 168, 170, 176, 178, 179, 181, 182, 184, 185, 158, 153, 156, 178, 180, 189, 133, 141, 143, 145, 147, 168, 170, 176, 178, 179, 181, 185, 144, 185, 160, 161, 189, 133, 140, 143, 144, 147, 168, 170, 176, 178, 179, 181, 185, 177, 156, 157, 159, 161, 131, 156, 133, 138, 142, 144, 146, 149, 153, 154, 158, 159, 163, 164, 168, 170, 174, 185, 144, 189, 133, 140, 142, 144, 146, 168, 170, 185, 152, 154, 160, 161, 128, 189, 133, 140, 142, 144, 146, 168, 170, 179, 181, 185, 158, 160, 161, 177, 178, 189, 133, 140, 142, 144, 146, 186, 142, 148, 150, 159, 161, 186, 191, 189, 133, 150, 154, 177, 179, 187, 128, 134, 129, 176, 178, 179, 132, 138, 141, 165, 167, 189, 129, 130, 135, 136, 148, 151, 153, 159, 161, 163, 170, 171, 173, 176, 178, 179, 134, 128, 132, 156, 159, 128, 128, 135, 137, 172, 136, 140, 128, 129, 130, 131, 137, 138, 139, 140, 141, 142, 143, 144, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 184, 188, 189, 190, 191, 132, 152, 185, 187, 191, 128, 170, 161, 144, 149, 154, 157, 165, 166, 174, 176, 181, 255, 130, 141, 143, 159, 155, 255, 128, 140, 142, 145, 160, 177, 128, 145, 160, 172, 174, 176, 151, 156, 170, 128, 168, 176, 255, 138, 255, 128, 150, 160, 255, 149, 255, 167, 133, 179, 133, 139, 131, 160, 174, 175, 186, 255, 166, 255, 128, 163, 141, 143, 154, 189, 169, 172, 174, 177, 181, 182, 129, 130, 132, 133, 134, 176, 177, 178, 179, 180, 181, 182, 183, 177, 191, 165, 170, 175, 177, 180, 255, 168, 174, 176, 255, 128, 134, 136, 142, 144, 150, 152, 158, 128, 129, 130, 131, 132, 133, 134, 135, 144, 145, 255, 133, 135, 161, 169, 177, 181, 184, 188, 160, 151, 154, 128, 146, 147, 148, 152, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 129, 255, 141, 143, 160, 169, 172, 255, 191, 128, 174, 130, 134, 139, 163, 255, 130, 179, 187, 189, 178, 183, 138, 165, 176, 255, 135, 159, 189, 255, 132, 178, 143, 160, 164, 166, 175, 186, 190, 128, 168, 186, 128, 130, 132, 139, 160, 182, 190, 255, 176, 178, 180, 183, 184, 190, 255, 128, 130, 155, 157, 160, 170, 178, 180, 128, 162, 164, 169, 171, 172, 173, 174, 175, 180, 181, 182, 183, 185, 186, 187, 188, 189, 190, 191, 165, 179, 157, 190, 128, 134, 147, 151, 159, 168, 170, 182, 184, 188, 176, 180, 182, 255, 161, 186, 144, 145, 146, 147, 148, 150, 151, 152, 155, 157, 158, 160, 170, 171, 172, 175, 161, 169, 128, 129, 130, 131, 133, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 156, 157, 160, 161, 162, 163, 164, 166, 168, 169, 170, 171, 172, 173, 174, 176, 177, 153, 155, 178, 179, 145, 255, 139, 143, 182, 255, 158, 175, 128, 144, 147, 149, 151, 153, 179, 128, 135, 137, 164, 128, 130, 131, 132, 133, 134, 135, 136, 138, 139, 140, 141, 144, 145, 146, 147, 150, 151, 152, 153, 154, 156, 162, 163, 171, 176, 177, 178, 131, 183, 131, 175, 144, 168, 131, 166, 182, 144, 178, 131, 178, 154, 156, 129, 132, 128, 145, 147, 171, 159, 255, 144, 157, 161, 135, 138, 128, 175, 135, 132, 133, 128, 174, 152, 155, 132, 128, 170, 128, 153, 160, 190, 192, 255, 128, 136, 138, 174, 128, 178, 255, 160, 168, 169, 171, 172, 173, 174, 188, 189, 190, 191, 161, 167, 144, 173, 128, 131, 163, 183, 189, 255, 133, 143, 145, 255, 147, 159, 128, 176, 177, 178, 128, 136, 144, 153, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158, 159, 150, 153, 131, 140, 255, 160, 163, 164, 165, 184, 185, 186, 161, 162, 133, 255, 170, 181, 183, 186, 128, 150, 152, 182, 184, 255, 192, 255, 128, 255, 173, 130, 133, 146, 159, 165, 171, 175, 255, 181, 190, 184, 185, 192, 255, 140, 134, 138, 142, 161, 163, 255, 182, 130, 136, 137, 176, 151, 152, 154, 160, 190, 136, 144, 192, 255, 135, 129, 130, 132, 133, 144, 170, 176, 178, 144, 154, 160, 191, 128, 169, 174, 255, 148, 169, 157, 158, 189, 190, 192, 255, 144, 255, 139, 140, 178, 255, 186, 128, 181, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 128, 173, 128, 155, 160, 180, 182, 189, 148, 161, 163, 255, 176, 164, 165, 132, 169, 177, 141, 142, 145, 146, 179, 181, 186, 187, 158, 133, 134, 137, 138, 143, 150, 152, 155, 164, 165, 178, 255, 188, 129, 131, 133, 138, 143, 144, 147, 168, 170, 176, 178, 179, 181, 182, 184, 185, 190, 255, 157, 131, 134, 137, 138, 142, 144, 146, 152, 159, 165, 182, 255, 129, 131, 133, 141, 143, 145, 147, 168, 170, 176, 178, 179, 181, 185, 188, 255, 134, 138, 142, 143, 145, 159, 164, 165, 176, 184, 186, 255, 129, 131, 133, 140, 143, 144, 147, 168, 170, 176, 178, 179, 181, 185, 188, 191, 177, 128, 132, 135, 136, 139, 141, 150, 151, 156, 157, 159, 163, 166, 175, 156, 130, 131, 133, 138, 142, 144, 146, 149, 153, 154, 158, 159, 163, 164, 168, 170, 174, 185, 190, 191, 144, 151, 128, 130, 134, 136, 138, 141, 166, 175, 128, 131, 133, 140, 142, 144, 146, 168, 170, 185, 189, 255, 133, 137, 151, 142, 148, 155, 159, 164, 165, 176, 255, 128, 131, 133, 140, 142, 144, 146, 168, 170, 179, 181, 185, 188, 191, 158, 128, 132, 134, 136, 138, 141, 149, 150, 160, 163, 166, 175, 177, 178, 129, 131, 133, 140, 142, 144, 146, 186, 189, 255, 133, 137, 143, 147, 152, 158, 164, 165, 176, 185, 192, 255, 189, 130, 131, 133, 150, 154, 177, 179, 187, 138, 150, 128, 134, 143, 148, 152, 159, 166, 175, 178, 179, 129, 186, 128, 142, 144, 153, 132, 138, 141, 165, 167, 129, 130, 135, 136, 148, 151, 153, 159, 161, 163, 170, 171, 173, 185, 187, 189, 134, 128, 132, 136, 141, 144, 153, 156, 159, 128, 181, 183, 185, 152, 153, 160, 169, 190, 191, 128, 135, 137, 172, 177, 191, 128, 132, 134, 151, 153, 188, 134, 128, 129, 130, 131, 137, 138, 139, 140, 141, 142, 143, 144, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 173, 175, 176, 177, 178, 179, 181, 182, 183, 188, 189, 190, 191, 132, 152, 172, 184, 185, 187, 128, 191, 128, 137, 144, 255, 158, 159, 134, 187, 136, 140, 142, 143, 137, 151, 153, 142, 143, 158, 159, 137, 177, 142, 143, 182, 183, 191, 255, 128, 130, 133, 136, 150, 152, 255, 145, 150, 151, 155, 156, 160, 168, 178, 255, 128, 143, 160, 255, 182, 183, 190, 255, 129, 255, 173, 174, 192, 255, 129, 154, 160, 255, 171, 173, 185, 255, 128, 140, 142, 148, 160, 180, 128, 147, 160, 172, 174, 176, 178, 179, 148, 150, 152, 155, 158, 159, 170, 255, 139, 141, 144, 153, 160, 255, 184, 255, 128, 170, 176, 255, 182, 255, 128, 158, 160, 171, 176, 187, 134, 173, 176, 180, 128, 171, 176, 255, 138, 143, 155, 255, 128, 155, 160, 255, 159, 189, 190, 192, 255, 167, 128, 137, 144, 153, 176, 189, 140, 143, 154, 170, 180, 255, 180, 255, 128, 183, 128, 137, 141, 189, 128, 136, 144, 146, 148, 182, 184, 185, 128, 181, 187, 191, 150, 151, 158, 159, 152, 154, 156, 158, 134, 135, 142, 143, 190, 255, 190, 128, 180, 182, 188, 130, 132, 134, 140, 144, 147, 150, 155, 160, 172, 178, 180, 182, 188, 128, 129, 130, 131, 132, 133, 134, 176, 177, 178, 179, 180, 181, 182, 183, 191, 255, 129, 147, 149, 176, 178, 190, 192, 255, 144, 156, 161, 144, 156, 165, 176, 130, 135, 149, 164, 166, 168, 138, 147, 152, 157, 170, 185, 188, 191, 142, 133, 137, 160, 255, 137, 255, 128, 174, 176, 255, 159, 165, 170, 180, 255, 167, 173, 128, 165, 176, 255, 168, 174, 176, 190, 192, 255, 128, 150, 160, 166, 168, 174, 176, 182, 184, 190, 128, 134, 136, 142, 144, 150, 152, 158, 160, 191, 128, 129, 130, 131, 132, 133, 134, 135, 144, 145, 255, 133, 135, 161, 175, 177, 181, 184, 188, 160, 151, 152, 187, 192, 255, 133, 173, 177, 255, 143, 159, 187, 255, 176, 191, 182, 183, 184, 191, 192, 255, 150, 255, 128, 146, 147, 148, 152, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 129, 255, 141, 255, 144, 189, 141, 143, 172, 255, 191, 128, 175, 180, 189, 151, 159, 162, 255, 175, 137, 138, 184, 255, 183, 255, 168, 255, 128, 179, 188, 134, 143, 154, 159, 184, 186, 190, 255, 128, 173, 176, 255, 148, 159, 189, 255, 129, 142, 154, 159, 191, 255, 128, 182, 128, 141, 144, 153, 160, 182, 186, 255, 128, 130, 155, 157, 160, 175, 178, 182, 129, 134, 137, 142, 145, 150, 160, 166, 168, 174, 176, 255, 155, 166, 175, 128, 170, 172, 173, 176, 185, 158, 159, 160, 255, 164, 175, 135, 138, 188, 255, 164, 169, 171, 172, 173, 174, 175, 180, 181, 182, 183, 184, 185, 187, 188, 189, 190, 191, 165, 186, 174, 175, 154, 255, 190, 128, 134, 147, 151, 157, 168, 170, 182, 184, 188, 128, 129, 131, 132, 134, 255, 147, 255, 190, 255, 144, 145, 136, 175, 188, 255, 128, 143, 160, 175, 179, 180, 141, 143, 176, 180, 182, 255, 189, 255, 191, 144, 153, 161, 186, 129, 154, 166, 255, 191, 255, 130, 135, 138, 143, 146, 151, 154, 156, 144, 145, 146, 147, 148, 150, 151, 152, 155, 157, 158, 160, 170, 171, 172, 175, 161, 169, 128, 129, 130, 131, 133, 135, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 156, 157, 160, 161, 162, 163, 164, 166, 168, 169, 170, 171, 172, 173, 174, 176, 177, 153, 155, 178, 179, 128, 139, 141, 166, 168, 186, 188, 189, 191, 255, 142, 143, 158, 255, 187, 255, 128, 180, 189, 128, 156, 160, 255, 145, 159, 161, 255, 128, 159, 176, 255, 139, 143, 187, 255, 128, 157, 160, 255, 144, 132, 135, 150, 255, 158, 159, 170, 175, 148, 151, 188, 255, 128, 167, 176, 255, 164, 255, 183, 255, 128, 149, 160, 167, 136, 188, 128, 133, 138, 181, 183, 184, 191, 255, 150, 159, 183, 255, 128, 158, 160, 178, 180, 181, 128, 149, 160, 185, 128, 183, 190, 191, 191, 128, 131, 133, 134, 140, 147, 149, 151, 153, 179, 184, 186, 160, 188, 128, 156, 128, 135, 137, 166, 128, 181, 128, 149, 160, 178, 128, 145, 128, 178, 129, 130, 131, 132, 133, 135, 136, 138, 139, 140, 141, 144, 145, 146, 147, 150, 151, 152, 153, 154, 155, 156, 162, 163, 171, 176, 177, 178, 128, 134, 135, 165, 176, 190, 144, 168, 176, 185, 128, 180, 182, 191, 182, 144, 179, 155, 133, 137, 141, 143, 157, 255, 190, 128, 145, 147, 183, 136, 128, 134, 138, 141, 143, 157, 159, 168, 176, 255, 171, 175, 186, 255, 128, 131, 133, 140, 143, 144, 147, 168, 170, 176, 178, 179, 181, 185, 188, 191, 144, 151, 128, 132, 135, 136, 139, 141, 157, 163, 166, 172, 176, 180, 128, 138, 144, 153, 134, 136, 143, 154, 255, 128, 181, 184, 255, 129, 151, 158, 255, 129, 131, 133, 143, 154, 255, 128, 137, 128, 153, 157, 171, 176, 185, 160, 255, 170, 190, 192, 255, 128, 184, 128, 136, 138, 182, 184, 191, 128, 144, 153, 178, 255, 168, 144, 145, 183, 255, 128, 142, 145, 149, 129, 141, 144, 146, 147, 148, 175, 255, 132, 255, 128, 144, 129, 143, 144, 153, 145, 152, 135, 255, 160, 168, 169, 171, 172, 173, 174, 188, 189, 190, 191, 161, 167, 185, 255, 128, 158, 160, 169, 144, 173, 176, 180, 128, 131, 144, 153, 163, 183, 189, 255, 144, 255, 133, 143, 191, 255, 143, 159, 160, 128, 129, 255, 159, 160, 171, 172, 255, 173, 255, 179, 255, 128, 176, 177, 178, 128, 129, 171, 175, 189, 255, 128, 136, 144, 153, 157, 158, 133, 134, 137, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158, 159, 168, 169, 170, 150, 153, 165, 169, 173, 178, 187, 255, 131, 132, 140, 169, 174, 255, 130, 132, 149, 157, 173, 186, 188, 160, 161, 163, 164, 167, 168, 132, 134, 149, 157, 186, 139, 140, 191, 255, 134, 128, 132, 138, 144, 146, 255, 166, 167, 129, 155, 187, 149, 181, 143, 175, 137, 169, 131, 140, 141, 192, 255, 128, 182, 187, 255, 173, 180, 182, 255, 132, 155, 159, 161, 175, 128, 160, 163, 164, 165, 184, 185, 186, 161, 162, 128, 134, 136, 152, 155, 161, 163, 164, 166, 170, 133, 143, 151, 255, 139, 143, 154, 255, 164, 167, 185, 187, 128, 131, 133, 159, 161, 162, 169, 178, 180, 183, 130, 135, 137, 139, 148, 151, 153, 155, 157, 159, 164, 190, 141, 143, 145, 146, 161, 162, 167, 170, 172, 178, 180, 183, 185, 188, 128, 137, 139, 155, 161, 163, 165, 169, 171, 187, 155, 156, 151, 255, 156, 157, 160, 181, 255, 186, 187, 255, 162, 255, 160, 168, 161, 167, 158, 255, 160, 132, 135, 133, 134, 176, 255, 128, 191, 154, 164, 168, 128, 149, 150, 191, 128, 152, 153, 191, 181, 128, 159, 160, 189, 190, 191, 189, 128, 131, 132, 185, 186, 191, 144, 128, 151, 152, 161, 162, 176, 177, 255, 169, 177, 129, 132, 141, 142, 145, 146, 179, 181, 186, 188, 190, 191, 192, 255, 142, 158, 128, 155, 156, 161, 162, 175, 176, 177, 178, 191, 169, 177, 180, 183, 128, 132, 133, 138, 139, 142, 143, 144, 145, 146, 147, 185, 186, 191, 157, 128, 152, 153, 158, 159, 177, 178, 180, 181, 191, 142, 146, 169, 177, 180, 189, 128, 132, 133, 185, 186, 191, 144, 185, 128, 159, 160, 161, 162, 191, 169, 177, 180, 189, 128, 132, 133, 140, 141, 142, 143, 144, 145, 146, 147, 185, 186, 191, 158, 177, 128, 155, 156, 161, 162, 191, 131, 145, 155, 157, 128, 132, 133, 138, 139, 141, 142, 149, 150, 152, 153, 159, 160, 162, 163, 164, 165, 167, 168, 170, 171, 173, 174, 185, 186, 191, 144, 128, 191, 141, 145, 169, 189, 128, 132, 133, 185, 186, 191, 128, 151, 152, 154, 155, 159, 160, 161, 162, 191, 128, 141, 145, 169, 180, 189, 129, 132, 133, 185, 186, 191, 158, 128, 159, 160, 161, 162, 176, 177, 178, 179, 191, 141, 145, 189, 128, 132, 133, 186, 187, 191, 142, 128, 147, 148, 150, 151, 158, 159, 161, 162, 185, 186, 191, 178, 188, 128, 132, 133, 150, 151, 153, 154, 189, 190, 191, 128, 134, 135, 191, 128, 177, 129, 179, 180, 191, 128, 131, 137, 141, 152, 160, 164, 166, 172, 177, 189, 129, 132, 133, 134, 135, 138, 139, 147, 148, 167, 168, 169, 170, 179, 180, 191, 133, 128, 134, 135, 155, 156, 159, 160, 191, 128, 129, 191, 136, 128, 172, 173, 191, 128, 135, 136, 140, 141, 191, 191, 128, 170, 171, 190, 161, 128, 143, 144, 149, 150, 153, 154, 157, 158, 164, 165, 166, 167, 173, 174, 176, 177, 180, 181, 255, 130, 141, 143, 159, 134, 187, 136, 140, 142, 143, 137, 151, 153, 142, 143, 158, 159, 137, 177, 191, 142, 143, 182, 183, 192, 255, 129, 151, 128, 133, 134, 135, 136, 255, 145, 150, 151, 155, 191, 192, 255, 128, 143, 144, 159, 160, 255, 182, 183, 190, 191, 192, 255, 128, 129, 255, 173, 174, 192, 255, 128, 129, 154, 155, 159, 160, 255, 171, 173, 185, 191, 192, 255, 141, 128, 145, 146, 159, 160, 177, 178, 191, 173, 128, 145, 146, 159, 160, 176, 177, 191, 128, 179, 180, 191, 151, 156, 128, 191, 128, 159, 160, 255, 184, 191, 192, 255, 169, 128, 170, 171, 175, 176, 255, 182, 191, 192, 255, 128, 158, 159, 191, 128, 143, 144, 173, 174, 175, 176, 180, 181, 191, 128, 171, 172, 175, 176, 255, 138, 191, 192, 255, 128, 150, 151, 159, 160, 255, 149, 191, 192, 255, 167, 128, 191, 128, 132, 133, 179, 180, 191, 128, 132, 133, 139, 140, 191, 128, 130, 131, 160, 161, 173, 174, 175, 176, 185, 186, 255, 166, 191, 192, 255, 128, 163, 164, 191, 128, 140, 141, 143, 144, 153, 154, 189, 190, 191, 128, 136, 137, 191, 173, 128, 168, 169, 177, 178, 180, 181, 182, 183, 191, 0, 127, 192, 255, 150, 151, 158, 159, 152, 154, 156, 158, 134, 135, 142, 143, 190, 191, 192, 255, 181, 189, 191, 128, 190, 133, 181, 128, 129, 130, 140, 141, 143, 144, 147, 148, 149, 150, 155, 156, 159, 160, 172, 173, 177, 178, 188, 189, 191, 177, 191, 128, 190, 128, 143, 144, 156, 157, 191, 130, 135, 148, 164, 166, 168, 128, 137, 138, 149, 150, 151, 152, 157, 158, 169, 170, 185, 186, 187, 188, 191, 142, 128, 132, 133, 137, 138, 159, 160, 255, 137, 191, 192, 255, 175, 128, 255, 159, 165, 170, 175, 177, 180, 191, 192, 255, 166, 173, 128, 167, 168, 175, 176, 255, 168, 174, 176, 191, 192, 255, 167, 175, 183, 191, 128, 150, 151, 159, 160, 190, 135, 143, 151, 128, 158, 159, 191, 128, 132, 133, 135, 136, 160, 161, 169, 170, 176, 177, 181, 182, 183, 184, 188, 189, 191, 160, 151, 154, 187, 192, 255, 128, 132, 133, 173, 174, 176, 177, 255, 143, 159, 187, 191, 192, 255, 128, 175, 176, 191, 150, 191, 192, 255, 141, 191, 192, 255, 128, 143, 144, 189, 190, 191, 141, 143, 160, 169, 172, 191, 192, 255, 191, 128, 174, 175, 190, 128, 157, 158, 159, 160, 255, 176, 191, 192, 255, 128, 150, 151, 159, 160, 161, 162, 255, 175, 137, 138, 184, 191, 192, 255, 128, 182, 183, 255, 130, 134, 139, 163, 191, 192, 255, 128, 129, 130, 179, 180, 191, 187, 189, 128, 177, 178, 183, 184, 191, 128, 137, 138, 165, 166, 175, 176, 255, 135, 159, 189, 191, 192, 255, 128, 131, 132, 178, 179, 191, 143, 165, 191, 128, 159, 160, 175, 176, 185, 186, 190, 128, 168, 169, 191, 131, 186, 128, 139, 140, 159, 160, 182, 183, 189, 190, 255, 176, 178, 180, 183, 184, 190, 191, 192, 255, 129, 128, 130, 131, 154, 155, 157, 158, 159, 160, 170, 171, 177, 178, 180, 181, 191, 128, 167, 175, 129, 134, 135, 136, 137, 142, 143, 144, 145, 150, 151, 159, 160, 255, 155, 166, 175, 128, 162, 163, 191, 164, 175, 135, 138, 188, 191, 192, 255, 174, 175, 154, 191, 192, 255, 157, 169, 183, 189, 191, 128, 134, 135, 146, 147, 151, 152, 158, 159, 190, 130, 133, 128, 255, 178, 191, 192, 255, 128, 146, 147, 255, 190, 191, 192, 255, 128, 143, 144, 255, 144, 145, 136, 175, 188, 191, 192, 255, 181, 128, 175, 176, 255, 189, 191, 192, 255, 128, 160, 161, 186, 187, 191, 128, 129, 154, 155, 165, 166, 255, 191, 192, 255, 128, 129, 130, 135, 136, 137, 138, 143, 144, 145, 146, 151, 152, 153, 154, 156, 157, 191, 128, 191, 128, 129, 130, 131, 133, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 156, 157, 160, 161, 162, 163, 164, 166, 168, 169, 170, 171, 172, 173, 174, 176, 177, 132, 151, 153, 155, 158, 175, 178, 179, 180, 191, 140, 167, 187, 190, 128, 255, 142, 143, 158, 191, 192, 255, 187, 191, 192, 255, 128, 180, 181, 191, 128, 156, 157, 159, 160, 255, 145, 191, 192, 255, 128, 159, 160, 175, 176, 255, 139, 143, 182, 191, 192, 255, 144, 132, 135, 150, 191, 192, 255, 158, 175, 148, 151, 188, 191, 192, 255, 128, 167, 168, 175, 176, 255, 164, 191, 192, 255, 183, 191, 192, 255, 128, 149, 150, 159, 160, 167, 168, 191, 136, 182, 188, 128, 133, 134, 137, 138, 184, 185, 190, 191, 255, 150, 159, 183, 191, 192, 255, 179, 128, 159, 160, 181, 182, 191, 128, 149, 150, 159, 160, 185, 186, 191, 128, 183, 184, 189, 190, 191, 128, 148, 152, 129, 143, 144, 179, 180, 191, 128, 159, 160, 188, 189, 191, 128, 156, 157, 191, 136, 128, 164, 165, 191, 128, 181, 182, 191, 128, 149, 150, 159, 160, 178, 179, 191, 128, 145, 146, 191, 128, 178, 179, 191, 128, 130, 131, 132, 133, 134, 135, 136, 138, 139, 140, 141, 144, 145, 146, 147, 150, 151, 152, 153, 154, 156, 162, 163, 171, 176, 177, 178, 129, 191, 128, 130, 131, 183, 184, 191, 128, 130, 131, 175, 176, 191, 128, 143, 144, 168, 169, 191, 128, 130, 131, 166, 167, 191, 182, 128, 143, 144, 178, 179, 191, 128, 130, 131, 178, 179, 191, 128, 154, 156, 129, 132, 133, 191, 146, 128, 171, 172, 191, 135, 137, 142, 158, 128, 168, 169, 175, 176, 255, 159, 191, 192, 255, 144, 128, 156, 157, 161, 162, 191, 128, 134, 135, 138, 139, 191, 128, 175, 176, 191, 134, 128, 131, 132, 135, 136, 191, 128, 174, 175, 191, 128, 151, 152, 155, 156, 191, 132, 128, 191, 128, 170, 171, 191, 128, 153, 154, 191, 160, 190, 192, 255, 128, 184, 185, 191, 137, 128, 174, 175, 191, 128, 129, 177, 178, 255, 144, 191, 192, 255, 128, 142, 143, 144, 145, 146, 149, 129, 148, 150, 191, 175, 191, 192, 255, 132, 191, 192, 255, 128, 144, 129, 143, 145, 191, 144, 153, 128, 143, 145, 152, 154, 191, 135, 191, 192, 255, 160, 168, 169, 171, 172, 173, 174, 188, 189, 190, 191, 128, 159, 161, 167, 170, 187, 185, 191, 192, 255, 128, 143, 144, 173, 174, 191, 128, 131, 132, 162, 163, 183, 184, 188, 189, 255, 133, 143, 145, 191, 192, 255, 128, 146, 147, 159, 160, 191, 160, 128, 191, 128, 129, 191, 192, 255, 159, 160, 171, 128, 170, 172, 191, 192, 255, 173, 191, 192, 255, 179, 191, 192, 255, 128, 176, 177, 178, 129, 191, 128, 129, 130, 191, 171, 175, 189, 191, 192, 255, 128, 136, 137, 143, 144, 153, 154, 191, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158, 159, 128, 143, 150, 153, 160, 191, 149, 157, 173, 186, 188, 160, 161, 163, 164, 167, 168, 132, 134, 149, 157, 186, 191, 139, 140, 192, 255, 133, 145, 128, 134, 135, 137, 138, 255, 166, 167, 129, 155, 187, 149, 181, 143, 175, 137, 169, 131, 140, 191, 192, 255, 160, 163, 164, 165, 184, 185, 186, 128, 159, 161, 162, 166, 191, 133, 191, 192, 255, 132, 160, 163, 167, 179, 184, 186, 128, 164, 165, 168, 169, 187, 188, 191, 130, 135, 137, 139, 144, 147, 151, 153, 155, 157, 159, 163, 171, 179, 184, 189, 191, 128, 140, 141, 148, 149, 160, 161, 164, 165, 166, 167, 190, 138, 164, 170, 128, 155, 156, 160, 161, 187, 188, 191, 128, 191, 155, 156, 128, 191, 151, 191, 192, 255, 156, 157, 160, 128, 191, 181, 191, 192, 255, 158, 159, 186, 128, 185, 187, 191, 192, 255, 162, 191, 192, 255, 160, 168, 128, 159, 161, 167, 169, 191, 158, 191, 192, 255, 10, 13, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 128, 191, 128, 191, 128, 191, 128, 191, 128, 191, 10, 128, 191, 128, 191, 128, 191, 36, 123, 37, 123, 10, 128, 191, 128, 191, 128, 191, 36, 123, 37, 123, 170, 181, 183, 186, 128, 150, 152, 182, 184, 255, 192, 255, 128, 255, 173, 130, 133, 146, 159, 165, 171, 175, 255, 181, 190, 184, 185, 192, 255, 140, 134, 138, 142, 161, 163, 255, 182, 130, 136, 137, 176, 151, 152, 154, 160, 190, 136, 144, 192, 255, 135, 129, 130, 132, 133, 144, 170, 176, 178, 144, 154, 160, 191, 128, 169, 174, 255, 148, 169, 157, 158, 189, 190, 192, 255, 144, 255, 139, 140, 178, 255, 186, 128, 181, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 128, 173, 128, 155, 160, 180, 182, 189, 148, 161, 163, 255, 176, 164, 165, 132, 169, 177, 141, 142, 145, 146, 179, 181, 186, 187, 158, 133, 134, 137, 138, 143, 150, 152, 155, 164, 165, 178, 255, 188, 129, 131, 133, 138, 143, 144, 147, 168, 170, 176, 178, 179, 181, 182, 184, 185, 190, 255, 157, 131, 134, 137, 138, 142, 144, 146, 152, 159, 165, 182, 255, 129, 131, 133, 141, 143, 145, 147, 168, 170, 176, 178, 179, 181, 185, 188, 255, 134, 138, 142, 143, 145, 159, 164, 165, 176, 184, 186, 255, 129, 131, 133, 140, 143, 144, 147, 168, 170, 176, 178, 179, 181, 185, 188, 191, 177, 128, 132, 135, 136, 139, 141, 150, 151, 156, 157, 159, 163, 166, 175, 156, 130, 131, 133, 138, 142, 144, 146, 149, 153, 154, 158, 159, 163, 164, 168, 170, 174, 185, 190, 191, 144, 151, 128, 130, 134, 136, 138, 141, 166, 175, 128, 131, 133, 140, 142, 144, 146, 168, 170, 185, 189, 255, 133, 137, 151, 142, 148, 155, 159, 164, 165, 176, 255, 128, 131, 133, 140, 142, 144, 146, 168, 170, 179, 181, 185, 188, 191, 158, 128, 132, 134, 136, 138, 141, 149, 150, 160, 163, 166, 175, 177, 178, 129, 131, 133, 140, 142, 144, 146, 186, 189, 255, 133, 137, 143, 147, 152, 158, 164, 165, 176, 185, 192, 255, 189, 130, 131, 133, 150, 154, 177, 179, 187, 138, 150, 128, 134, 143, 148, 152, 159, 166, 175, 178, 179, 129, 186, 128, 142, 144, 153, 132, 138, 141, 165, 167, 129, 130, 135, 136, 148, 151, 153, 159, 161, 163, 170, 171, 173, 185, 187, 189, 134, 128, 132, 136, 141, 144, 153, 156, 159, 128, 181, 183, 185, 152, 153, 160, 169, 190, 191, 128, 135, 137, 172, 177, 191, 128, 132, 134, 151, 153, 188, 134, 128, 129, 130, 131, 137, 138, 139, 140, 141, 142, 143, 144, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 173, 175, 176, 177, 178, 179, 181, 182, 183, 188, 189, 190, 191, 132, 152, 172, 184, 185, 187, 128, 191, 128, 137, 144, 255, 158, 159, 134, 187, 136, 140, 142, 143, 137, 151, 153, 142, 143, 158, 159, 137, 177, 142, 143, 182, 183, 191, 255, 128, 130, 133, 136, 150, 152, 255, 145, 150, 151, 155, 156, 160, 168, 178, 255, 128, 143, 160, 255, 182, 183, 190, 255, 129, 255, 173, 174, 192, 255, 129, 154, 160, 255, 171, 173, 185, 255, 128, 140, 142, 148, 160, 180, 128, 147, 160, 172, 174, 176, 178, 179, 148, 150, 152, 155, 158, 159, 170, 255, 139, 141, 144, 153, 160, 255, 184, 255, 128, 170, 176, 255, 182, 255, 128, 158, 160, 171, 176, 187, 134, 173, 176, 180, 128, 171, 176, 255, 138, 143, 155, 255, 128, 155, 160, 255, 159, 189, 190, 192, 255, 167, 128, 137, 144, 153, 176, 189, 140, 143, 154, 170, 180, 255, 180, 255, 128, 183, 128, 137, 141, 189, 128, 136, 144, 146, 148, 182, 184, 185, 128, 181, 187, 191, 150, 151, 158, 159, 152, 154, 156, 158, 134, 135, 142, 143, 190, 255, 190, 128, 180, 182, 188, 130, 132, 134, 140, 144, 147, 150, 155, 160, 172, 178, 180, 182, 188, 128, 129, 130, 131, 132, 133, 134, 176, 177, 178, 179, 180, 181, 182, 183, 191, 255, 129, 147, 149, 176, 178, 190, 192, 255, 144, 156, 161, 144, 156, 165, 176, 130, 135, 149, 164, 166, 168, 138, 147, 152, 157, 170, 185, 188, 191, 142, 133, 137, 160, 255, 137, 255, 128, 174, 176, 255, 159, 165, 170, 180, 255, 167, 173, 128, 165, 176, 255, 168, 174, 176, 190, 192, 255, 128, 150, 160, 166, 168, 174, 176, 182, 184, 190, 128, 134, 136, 142, 144, 150, 152, 158, 160, 191, 128, 129, 130, 131, 132, 133, 134, 135, 144, 145, 255, 133, 135, 161, 175, 177, 181, 184, 188, 160, 151, 152, 187, 192, 255, 133, 173, 177, 255, 143, 159, 187, 255, 176, 191, 182, 183, 184, 191, 192, 255, 150, 255, 128, 146, 147, 148, 152, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 129, 255, 141, 255, 144, 189, 141, 143, 172, 255, 191, 128, 175, 180, 189, 151, 159, 162, 255, 175, 137, 138, 184, 255, 183, 255, 168, 255, 128, 179, 188, 134, 143, 154, 159, 184, 186, 190, 255, 128, 173, 176, 255, 148, 159, 189, 255, 129, 142, 154, 159, 191, 255, 128, 182, 128, 141, 144, 153, 160, 182, 186, 255, 128, 130, 155, 157, 160, 175, 178, 182, 129, 134, 137, 142, 145, 150, 160, 166, 168, 174, 176, 255, 155, 166, 175, 128, 170, 172, 173, 176, 185, 158, 159, 160, 255, 164, 175, 135, 138, 188, 255, 164, 169, 171, 172, 173, 174, 175, 180, 181, 182, 183, 184, 185, 187, 188, 189, 190, 191, 165, 186, 174, 175, 154, 255, 190, 128, 134, 147, 151, 157, 168, 170, 182, 184, 188, 128, 129, 131, 132, 134, 255, 147, 255, 190, 255, 144, 145, 136, 175, 188, 255, 128, 143, 160, 175, 179, 180, 141, 143, 176, 180, 182, 255, 189, 255, 191, 144, 153, 161, 186, 129, 154, 166, 255, 191, 255, 130, 135, 138, 143, 146, 151, 154, 156, 144, 145, 146, 147, 148, 150, 151, 152, 155, 157, 158, 160, 170, 171, 172, 175, 161, 169, 128, 129, 130, 131, 133, 135, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 156, 157, 160, 161, 162, 163, 164, 166, 168, 169, 170, 171, 172, 173, 174, 176, 177, 153, 155, 178, 179, 128, 139, 141, 166, 168, 186, 188, 189, 191, 255, 142, 143, 158, 255, 187, 255, 128, 180, 189, 128, 156, 160, 255, 145, 159, 161, 255, 128, 159, 176, 255, 139, 143, 187, 255, 128, 157, 160, 255, 144, 132, 135, 150, 255, 158, 159, 170, 175, 148, 151, 188, 255, 128, 167, 176, 255, 164, 255, 183, 255, 128, 149, 160, 167, 136, 188, 128, 133, 138, 181, 183, 184, 191, 255, 150, 159, 183, 255, 128, 158, 160, 178, 180, 181, 128, 149, 160, 185, 128, 183, 190, 191, 191, 128, 131, 133, 134, 140, 147, 149, 151, 153, 179, 184, 186, 160, 188, 128, 156, 128, 135, 137, 166, 128, 181, 128, 149, 160, 178, 128, 145, 128, 178, 129, 130, 131, 132, 133, 135, 136, 138, 139, 140, 141, 144, 145, 146, 147, 150, 151, 152, 153, 154, 155, 156, 162, 163, 171, 176, 177, 178, 128, 134, 135, 165, 176, 190, 144, 168, 176, 185, 128, 180, 182, 191, 182, 144, 179, 155, 133, 137, 141, 143, 157, 255, 190, 128, 145, 147, 183, 136, 128, 134, 138, 141, 143, 157, 159, 168, 176, 255, 171, 175, 186, 255, 128, 131, 133, 140, 143, 144, 147, 168, 170, 176, 178, 179, 181, 185, 188, 191, 144, 151, 128, 132, 135, 136, 139, 141, 157, 163, 166, 172, 176, 180, 128, 138, 144, 153, 134, 136, 143, 154, 255, 128, 181, 184, 255, 129, 151, 158, 255, 129, 131, 133, 143, 154, 255, 128, 137, 128, 153, 157, 171, 176, 185, 160, 255, 170, 190, 192, 255, 128, 184, 128, 136, 138, 182, 184, 191, 128, 144, 153, 178, 255, 168, 144, 145, 183, 255, 128, 142, 145, 149, 129, 141, 144, 146, 147, 148, 175, 255, 132, 255, 128, 144, 129, 143, 144, 153, 145, 152, 135, 255, 160, 168, 169, 171, 172, 173, 174, 188, 189, 190, 191, 161, 167, 185, 255, 128, 158, 160, 169, 144, 173, 176, 180, 128, 131, 144, 153, 163, 183, 189, 255, 144, 255, 133, 143, 191, 255, 143, 159, 160, 128, 129, 255, 159, 160, 171, 172, 255, 173, 255, 179, 255, 128, 176, 177, 178, 128, 129, 171, 175, 189, 255, 128, 136, 144, 153, 157, 158, 133, 134, 137, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158, 159, 168, 169, 170, 150, 153, 165, 169, 173, 178, 187, 255, 131, 132, 140, 169, 174, 255, 130, 132, 149, 157, 173, 186, 188, 160, 161, 163, 164, 167, 168, 132, 134, 149, 157, 186, 139, 140, 191, 255, 134, 128, 132, 138, 144, 146, 255, 166, 167, 129, 155, 187, 149, 181, 143, 175, 137, 169, 131, 140, 141, 192, 255, 128, 182, 187, 255, 173, 180, 182, 255, 132, 155, 159, 161, 175, 128, 160, 163, 164, 165, 184, 185, 186, 161, 162, 128, 134, 136, 152, 155, 161, 163, 164, 166, 170, 133, 143, 151, 255, 139, 143, 154, 255, 164, 167, 185, 187, 128, 131, 133, 159, 161, 162, 169, 178, 180, 183, 130, 135, 137, 139, 148, 151, 153, 155, 157, 159, 164, 190, 141, 143, 145, 146, 161, 162, 167, 170, 172, 178, 180, 183, 185, 188, 128, 137, 139, 155, 161, 163, 165, 169, 171, 187, 155, 156, 151, 255, 156, 157, 160, 181, 255, 186, 187, 255, 162, 255, 160, 168, 161, 167, 158, 255, 160, 132, 135, 133, 134, 176, 255, 128, 191, 154, 164, 168, 128, 149, 150, 191, 128, 152, 153, 191, 181, 128, 159, 160, 189, 190, 191, 189, 128, 131, 132, 185, 186, 191, 144, 128, 151, 152, 161, 162, 176, 177, 255, 169, 177, 129, 132, 141, 142, 145, 146, 179, 181, 186, 188, 190, 191, 192, 255, 142, 158, 128, 155, 156, 161, 162, 175, 176, 177, 178, 191, 169, 177, 180, 183, 128, 132, 133, 138, 139, 142, 143, 144, 145, 146, 147, 185, 186, 191, 157, 128, 152, 153, 158, 159, 177, 178, 180, 181, 191, 142, 146, 169, 177, 180, 189, 128, 132, 133, 185, 186, 191, 144, 185, 128, 159, 160, 161, 162, 191, 169, 177, 180, 189, 128, 132, 133, 140, 141, 142, 143, 144, 145, 146, 147, 185, 186, 191, 158, 177, 128, 155, 156, 161, 162, 191, 131, 145, 155, 157, 128, 132, 133, 138, 139, 141, 142, 149, 150, 152, 153, 159, 160, 162, 163, 164, 165, 167, 168, 170, 171, 173, 174, 185, 186, 191, 144, 128, 191, 141, 145, 169, 189, 128, 132, 133, 185, 186, 191, 128, 151, 152, 154, 155, 159, 160, 161, 162, 191, 128, 141, 145, 169, 180, 189, 129, 132, 133, 185, 186, 191, 158, 128, 159, 160, 161, 162, 176, 177, 178, 179, 191, 141, 145, 189, 128, 132, 133, 186, 187, 191, 142, 128, 147, 148, 150, 151, 158, 159, 161, 162, 185, 186, 191, 178, 188, 128, 132, 133, 150, 151, 153, 154, 189, 190, 191, 128, 134, 135, 191, 128, 177, 129, 179, 180, 191, 128, 131, 137, 141, 152, 160, 164, 166, 172, 177, 189, 129, 132, 133, 134, 135, 138, 139, 147, 148, 167, 168, 169, 170, 179, 180, 191, 133, 128, 134, 135, 155, 156, 159, 160, 191, 128, 129, 191, 136, 128, 172, 173, 191, 128, 135, 136, 140, 141, 191, 191, 128, 170, 171, 190, 161, 128, 143, 144, 149, 150, 153, 154, 157, 158, 164, 165, 166, 167, 173, 174, 176, 177, 180, 181, 255, 130, 141, 143, 159, 134, 187, 136, 140, 142, 143, 137, 151, 153, 142, 143, 158, 159, 137, 177, 191, 142, 143, 182, 183, 192, 255, 129, 151, 128, 133, 134, 135, 136, 255, 145, 150, 151, 155, 191, 192, 255, 128, 143, 144, 159, 160, 255, 182, 183, 190, 191, 192, 255, 128, 129, 255, 173, 174, 192, 255, 128, 129, 154, 155, 159, 160, 255, 171, 173, 185, 191, 192, 255, 141, 128, 145, 146, 159, 160, 177, 178, 191, 173, 128, 145, 146, 159, 160, 176, 177, 191, 128, 179, 180, 191, 151, 156, 128, 191, 128, 159, 160, 255, 184, 191, 192, 255, 169, 128, 170, 171, 175, 176, 255, 182, 191, 192, 255, 128, 158, 159, 191, 128, 143, 144, 173, 174, 175, 176, 180, 181, 191, 128, 171, 172, 175, 176, 255, 138, 191, 192, 255, 128, 150, 151, 159, 160, 255, 149, 191, 192, 255, 167, 128, 191, 128, 132, 133, 179, 180, 191, 128, 132, 133, 139, 140, 191, 128, 130, 131, 160, 161, 173, 174, 175, 176, 185, 186, 255, 166, 191, 192, 255, 128, 163, 164, 191, 128, 140, 141, 143, 144, 153, 154, 189, 190, 191, 128, 136, 137, 191, 173, 128, 168, 169, 177, 178, 180, 181, 182, 183, 191, 0, 127, 192, 255, 150, 151, 158, 159, 152, 154, 156, 158, 134, 135, 142, 143, 190, 191, 192, 255, 181, 189, 191, 128, 190, 133, 181, 128, 129, 130, 140, 141, 143, 144, 147, 148, 149, 150, 155, 156, 159, 160, 172, 173, 177, 178, 188, 189, 191, 177, 191, 128, 190, 128, 143, 144, 156, 157, 191, 130, 135, 148, 164, 166, 168, 128, 137, 138, 149, 150, 151, 152, 157, 158, 169, 170, 185, 186, 187, 188, 191, 142, 128, 132, 133, 137, 138, 159, 160, 255, 137, 191, 192, 255, 175, 128, 255, 159, 165, 170, 175, 177, 180, 191, 192, 255, 166, 173, 128, 167, 168, 175, 176, 255, 168, 174, 176, 191, 192, 255, 167, 175, 183, 191, 128, 150, 151, 159, 160, 190, 135, 143, 151, 128, 158, 159, 191, 128, 132, 133, 135, 136, 160, 161, 169, 170, 176, 177, 181, 182, 183, 184, 188, 189, 191, 160, 151, 154, 187, 192, 255, 128, 132, 133, 173, 174, 176, 177, 255, 143, 159, 187, 191, 192, 255, 128, 175, 176, 191, 150, 191, 192, 255, 141, 191, 192, 255, 128, 143, 144, 189, 190, 191, 141, 143, 160, 169, 172, 191, 192, 255, 191, 128, 174, 175, 190, 128, 157, 158, 159, 160, 255, 176, 191, 192, 255, 128, 150, 151, 159, 160, 161, 162, 255, 175, 137, 138, 184, 191, 192, 255, 128, 182, 183, 255, 130, 134, 139, 163, 191, 192, 255, 128, 129, 130, 179, 180, 191, 187, 189, 128, 177, 178, 183, 184, 191, 128, 137, 138, 165, 166, 175, 176, 255, 135, 159, 189, 191, 192, 255, 128, 131, 132, 178, 179, 191, 143, 165, 191, 128, 159, 160, 175, 176, 185, 186, 190, 128, 168, 169, 191, 131, 186, 128, 139, 140, 159, 160, 182, 183, 189, 190, 255, 176, 178, 180, 183, 184, 190, 191, 192, 255, 129, 128, 130, 131, 154, 155, 157, 158, 159, 160, 170, 171, 177, 178, 180, 181, 191, 128, 167, 175, 129, 134, 135, 136, 137, 142, 143, 144, 145, 150, 151, 159, 160, 255, 155, 166, 175, 128, 162, 163, 191, 164, 175, 135, 138, 188, 191, 192, 255, 174, 175, 154, 191, 192, 255, 157, 169, 183, 189, 191, 128, 134, 135, 146, 147, 151, 152, 158, 159, 190, 130, 133, 128, 255, 178, 191, 192, 255, 128, 146, 147, 255, 190, 191, 192, 255, 128, 143, 144, 255, 144, 145, 136, 175, 188, 191, 192, 255, 181, 128, 175, 176, 255, 189, 191, 192, 255, 128, 160, 161, 186, 187, 191, 128, 129, 154, 155, 165, 166, 255, 191, 192, 255, 128, 129, 130, 135, 136, 137, 138, 143, 144, 145, 146, 151, 152, 153, 154, 156, 157, 191, 128, 191, 128, 129, 130, 131, 133, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 156, 157, 160, 161, 162, 163, 164, 166, 168, 169, 170, 171, 172, 173, 174, 176, 177, 132, 151, 153, 155, 158, 175, 178, 179, 180, 191, 140, 167, 187, 190, 128, 255, 142, 143, 158, 191, 192, 255, 187, 191, 192, 255, 128, 180, 181, 191, 128, 156, 157, 159, 160, 255, 145, 191, 192, 255, 128, 159, 160, 175, 176, 255, 139, 143, 182, 191, 192, 255, 144, 132, 135, 150, 191, 192, 255, 158, 175, 148, 151, 188, 191, 192, 255, 128, 167, 168, 175, 176, 255, 164, 191, 192, 255, 183, 191, 192, 255, 128, 149, 150, 159, 160, 167, 168, 191, 136, 182, 188, 128, 133, 134, 137, 138, 184, 185, 190, 191, 255, 150, 159, 183, 191, 192, 255, 179, 128, 159, 160, 181, 182, 191, 128, 149, 150, 159, 160, 185, 186, 191, 128, 183, 184, 189, 190, 191, 128, 148, 152, 129, 143, 144, 179, 180, 191, 128, 159, 160, 188, 189, 191, 128, 156, 157, 191, 136, 128, 164, 165, 191, 128, 181, 182, 191, 128, 149, 150, 159, 160, 178, 179, 191, 128, 145, 146, 191, 128, 178, 179, 191, 128, 130, 131, 132, 133, 134, 135, 136, 138, 139, 140, 141, 144, 145, 146, 147, 150, 151, 152, 153, 154, 156, 162, 163, 171, 176, 177, 178, 129, 191, 128, 130, 131, 183, 184, 191, 128, 130, 131, 175, 176, 191, 128, 143, 144, 168, 169, 191, 128, 130, 131, 166, 167, 191, 182, 128, 143, 144, 178, 179, 191, 128, 130, 131, 178, 179, 191, 128, 154, 156, 129, 132, 133, 191, 146, 128, 171, 172, 191, 135, 137, 142, 158, 128, 168, 169, 175, 176, 255, 159, 191, 192, 255, 144, 128, 156, 157, 161, 162, 191, 128, 134, 135, 138, 139, 191, 128, 175, 176, 191, 134, 128, 131, 132, 135, 136, 191, 128, 174, 175, 191, 128, 151, 152, 155, 156, 191, 132, 128, 191, 128, 170, 171, 191, 128, 153, 154, 191, 160, 190, 192, 255, 128, 184, 185, 191, 137, 128, 174, 175, 191, 128, 129, 177, 178, 255, 144, 191, 192, 255, 128, 142, 143, 144, 145, 146, 149, 129, 148, 150, 191, 175, 191, 192, 255, 132, 191, 192, 255, 128, 144, 129, 143, 145, 191, 144, 153, 128, 143, 145, 152, 154, 191, 135, 191, 192, 255, 160, 168, 169, 171, 172, 173, 174, 188, 189, 190, 191, 128, 159, 161, 167, 170, 187, 185, 191, 192, 255, 128, 143, 144, 173, 174, 191, 128, 131, 132, 162, 163, 183, 184, 188, 189, 255, 133, 143, 145, 191, 192, 255, 128, 146, 147, 159, 160, 191, 160, 128, 191, 128, 129, 191, 192, 255, 159, 160, 171, 128, 170, 172, 191, 192, 255, 173, 191, 192, 255, 179, 191, 192, 255, 128, 176, 177, 178, 129, 191, 128, 129, 130, 191, 171, 175, 189, 191, 192, 255, 128, 136, 137, 143, 144, 153, 154, 191, 144, 145, 146, 147, 148, 149, 154, 155, 156, 157, 158, 159, 128, 143, 150, 153, 160, 191, 149, 157, 173, 186, 188, 160, 161, 163, 164, 167, 168, 132, 134, 149, 157, 186, 191, 139, 140, 192, 255, 133, 145, 128, 134, 135, 137, 138, 255, 166, 167, 129, 155, 187, 149, 181, 143, 175, 137, 169, 131, 140, 191, 192, 255, 160, 163, 164, 165, 184, 185, 186, 128, 159, 161, 162, 166, 191, 133, 191, 192, 255, 132, 160, 163, 167, 179, 184, 186, 128, 164, 165, 168, 169, 187, 188, 191, 130, 135, 137, 139, 144, 147, 151, 153, 155, 157, 159, 163, 171, 179, 184, 189, 191, 128, 140, 141, 148, 149, 160, 161, 164, 165, 166, 167, 190, 138, 164, 170, 128, 155, 156, 160, 161, 187, 188, 191, 128, 191, 155, 156, 128, 191, 151, 191, 192, 255, 156, 157, 160, 128, 191, 181, 191, 192, 255, 158, 159, 186, 128, 185, 187, 191, 192, 255, 162, 191, 192, 255, 160, 168, 128, 159, 161, 167, 169, 191, 158, 191, 192, 255, 9, 10, 13, 32, 33, 34, 35, 38, 46, 47, 60, 61, 62, 64, 92, 95, 123, 124, 125, 126, 127, 194, 195, 198, 199, 203, 204, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 233, 234, 237, 238, 239, 240, 0, 36, 37, 45, 48, 57, 58, 63, 65, 90, 91, 96, 97, 122, 192, 193, 196, 218, 229, 236, 241, 247, 9, 32, 10, 61, 10, 38, 46, 42, 47, 46, 69, 101, 48, 57, 60, 61, 61, 62, 61, 45, 95, 194, 195, 198, 199, 203, 204, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 233, 234, 237, 239, 240, 243, 48, 57, 65, 90, 97, 122, 196, 218, 229, 236, 124, 125, 128, 191, 170, 181, 186, 128, 191, 151, 183, 128, 255, 192, 255, 0, 127, 173, 130, 133, 146, 159, 165, 171, 175, 191, 192, 255, 181, 190, 128, 175, 176, 183, 184, 185, 186, 191, 134, 139, 141, 162, 128, 135, 136, 255, 182, 130, 137, 176, 151, 152, 154, 160, 136, 191, 192, 255, 128, 143, 144, 170, 171, 175, 176, 178, 179, 191, 128, 159, 160, 191, 176, 128, 138, 139, 173, 174, 255, 148, 150, 164, 167, 173, 176, 185, 189, 190, 192, 255, 144, 128, 145, 146, 175, 176, 191, 128, 140, 141, 255, 166, 176, 178, 191, 192, 255, 186, 128, 137, 138, 170, 171, 179, 180, 181, 182, 191, 160, 161, 162, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 128, 191, 128, 129, 130, 131, 137, 138, 139, 140, 141, 142, 143, 144, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, 188, 189, 190, 191, 132, 187, 129, 130, 132, 133, 134, 176, 177, 178, 179, 180, 181, 182, 183, 128, 191, 128, 129, 130, 131, 132, 133, 134, 135, 144, 136, 143, 145, 191, 192, 255, 182, 183, 184, 128, 191, 128, 191, 191, 128, 190, 192, 255, 128, 146, 147, 148, 152, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 129, 191, 192, 255, 158, 159, 128, 157, 160, 191, 192, 255, 128, 191, 164, 169, 171, 172, 173, 174, 175, 180, 181, 182, 183, 184, 185, 187, 188, 189, 190, 191, 128, 163, 165, 186, 144, 145, 146, 147, 148, 150, 151, 152, 155, 157, 158, 160, 170, 171, 172, 175, 128, 159, 161, 169, 173, 191, 128, 191, 10, 13, 34, 36, 37, 92, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 34, 92, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 36, 123, 123, 126, 126, 37, 123, 126, 10, 13, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 128, 191, 128, 191, 128, 191, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 10, 13, 123, 10, 13, 126, 10, 13, 126, 126, 128, 191, 128, 191, 128, 191, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 36, 37, 128, 191, 192, 223, 224, 239, 240, 247, 248, 255, 10, 13, 10, 13, 123, 10, 13, 126, 10, 13, 126, 126, 128, 191, 128, 191, 128, 191, 95, 194, 195, 198, 199, 203, 204, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 233, 234, 237, 238, 239, 240, 65, 90, 97, 122, 128, 191, 192, 193, 196, 218, 229, 236, 241, 247, 248, 255, 45, 95, 194, 195, 198, 199, 203, 204, 205, 206, 207, 210, 212, 213, 214, 215, 216, 217, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 233, 234, 237, 239, 240, 243, 48, 57, 65, 90, 97, 122, 196, 218, 229, 236, 128, 191, 170, 181, 186, 128, 191, 151, 183, 128, 255, 192, 255, 0, 127, 173, 130, 133, 146, 159, 165, 171, 175, 191, 192, 255, 181, 190, 128, 175, 176, 183, 184, 185, 186, 191, 134, 139, 141, 162, 128, 135, 136, 255, 182, 130, 137, 176, 151, 152, 154, 160, 136, 191, 192, 255, 128, 143, 144, 170, 171, 175, 176, 178, 179, 191, 128, 159, 160, 191, 176, 128, 138, 139, 173, 174, 255, 148, 150, 164, 167, 173, 176, 185, 189, 190, 192, 255, 144, 128, 145, 146, 175, 176, 191, 128, 140, 141, 255, 166, 176, 178, 191, 192, 255, 186, 128, 137, 138, 170, 171, 179, 180, 181, 182, 191, 160, 161, 162, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 128, 191, 128, 129, 130, 131, 137, 138, 139, 140, 141, 142, 143, 144, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 182, 183, 184, 188, 189, 190, 191, 132, 187, 129, 130, 132, 133, 134, 176, 177, 178, 179, 180, 181, 182, 183, 128, 191, 128, 129, 130, 131, 132, 133, 134, 135, 144, 136, 143, 145, 191, 192, 255, 182, 183, 184, 128, 191, 128, 191, 191, 128, 190, 192, 255, 128, 146, 147, 148, 152, 153, 154, 155, 156, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 129, 191, 192, 255, 158, 159, 128, 157, 160, 191, 192, 255, 128, 191, 164, 169, 171, 172, 173, 174, 175, 180, 181, 182, 183, 184, 185, 187, 188, 189, 190, 191, 128, 163, 165, 186, 144, 145, 146, 147, 148, 150, 151, 152, 155, 157, 158, 160, 170, 171, 172, 175, 128, 159, 161, 169, 173, 191, 128, 191, } var _hcltok_single_lengths []byte = []byte{ 0, 1, 1, 2, 3, 2, 0, 32, 31, 36, 1, 4, 0, 0, 0, 0, 1, 2, 1, 1, 1, 1, 0, 1, 1, 0, 0, 2, 0, 0, 0, 1, 32, 0, 0, 0, 0, 1, 3, 1, 1, 1, 0, 2, 0, 1, 1, 2, 0, 3, 0, 1, 0, 2, 1, 2, 0, 0, 5, 1, 4, 0, 0, 1, 43, 0, 0, 0, 2, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 15, 0, 0, 0, 1, 6, 1, 0, 0, 1, 0, 2, 0, 0, 0, 9, 0, 1, 1, 0, 0, 0, 3, 0, 1, 0, 28, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 18, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 16, 36, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4, 0, 0, 2, 2, 0, 11, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0, 0, 4, 0, 0, 0, 18, 0, 0, 0, 1, 4, 1, 4, 1, 0, 3, 2, 2, 2, 1, 0, 0, 1, 8, 0, 0, 0, 4, 12, 0, 2, 0, 3, 0, 1, 0, 2, 0, 1, 2, 0, 3, 1, 2, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 28, 3, 0, 1, 1, 2, 1, 0, 1, 1, 2, 1, 1, 2, 1, 1, 0, 2, 1, 1, 1, 1, 0, 0, 6, 1, 1, 0, 0, 46, 1, 1, 0, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 13, 2, 0, 0, 0, 9, 0, 1, 28, 0, 1, 3, 0, 2, 0, 0, 0, 1, 0, 1, 1, 2, 0, 18, 2, 0, 0, 16, 35, 0, 0, 0, 1, 0, 28, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 11, 0, 0, 0, 0, 4, 0, 12, 1, 7, 0, 4, 0, 0, 0, 0, 1, 2, 1, 1, 1, 1, 0, 1, 1, 0, 0, 2, 0, 0, 0, 1, 32, 0, 0, 0, 0, 1, 3, 1, 1, 1, 0, 2, 0, 1, 1, 2, 0, 3, 0, 1, 0, 2, 1, 2, 0, 0, 5, 1, 4, 0, 0, 1, 43, 0, 0, 0, 2, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 15, 0, 0, 0, 1, 6, 1, 0, 0, 1, 0, 2, 0, 0, 0, 9, 0, 1, 1, 0, 0, 0, 3, 0, 1, 0, 28, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 18, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 16, 36, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4, 0, 0, 2, 2, 0, 11, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0, 0, 4, 0, 0, 0, 18, 0, 0, 0, 1, 4, 1, 4, 1, 0, 3, 2, 2, 2, 1, 0, 0, 1, 8, 0, 0, 0, 4, 12, 0, 2, 0, 3, 0, 1, 0, 2, 0, 1, 2, 0, 0, 3, 0, 1, 1, 1, 2, 2, 4, 1, 6, 2, 4, 2, 4, 1, 4, 0, 6, 1, 3, 1, 2, 0, 2, 11, 1, 1, 1, 0, 1, 1, 0, 2, 0, 3, 3, 2, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 3, 2, 2, 0, 6, 1, 0, 1, 1, 0, 2, 0, 4, 3, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 2, 0, 0, 0, 3, 0, 2, 1, 1, 3, 1, 0, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 35, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 28, 0, 0, 0, 0, 1, 0, 3, 1, 4, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 7, 0, 0, 2, 2, 0, 11, 0, 0, 0, 0, 0, 1, 1, 3, 0, 0, 4, 0, 0, 0, 12, 1, 4, 1, 5, 2, 0, 3, 2, 2, 2, 1, 7, 0, 7, 17, 3, 0, 2, 0, 3, 0, 0, 1, 0, 2, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 1, 0, 0, 0, 2, 2, 4, 0, 0, 0, 0, 1, 2, 1, 1, 1, 1, 0, 1, 1, 0, 0, 2, 0, 0, 0, 1, 32, 0, 0, 0, 0, 1, 3, 1, 1, 1, 0, 2, 0, 1, 1, 2, 0, 3, 0, 1, 0, 2, 1, 2, 0, 0, 5, 1, 4, 0, 0, 1, 43, 0, 0, 0, 2, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 15, 0, 0, 0, 1, 6, 1, 0, 0, 1, 0, 2, 0, 0, 0, 9, 0, 1, 1, 0, 0, 0, 3, 0, 1, 0, 28, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 18, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 16, 36, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 1, 1, 1, 1, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4, 0, 0, 2, 2, 0, 11, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0, 0, 4, 0, 0, 0, 18, 0, 0, 0, 1, 4, 1, 4, 1, 0, 3, 2, 2, 2, 1, 0, 0, 1, 8, 0, 0, 0, 4, 12, 0, 2, 0, 3, 0, 1, 0, 2, 0, 1, 2, 0, 0, 3, 0, 1, 1, 1, 2, 2, 4, 1, 6, 2, 4, 2, 4, 1, 4, 0, 6, 1, 3, 1, 2, 0, 2, 11, 1, 1, 1, 0, 1, 1, 0, 2, 0, 3, 3, 2, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 3, 2, 2, 0, 6, 1, 0, 1, 1, 0, 2, 0, 4, 3, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 2, 0, 0, 0, 3, 0, 2, 1, 1, 3, 1, 0, 0, 0, 0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 35, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 3, 0, 0, 1, 0, 0, 0, 0, 28, 0, 0, 0, 0, 1, 0, 3, 1, 4, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 7, 0, 0, 2, 2, 0, 11, 0, 0, 0, 0, 0, 1, 1, 3, 0, 0, 4, 0, 0, 0, 12, 1, 4, 1, 5, 2, 0, 3, 2, 2, 2, 1, 7, 0, 7, 17, 3, 0, 2, 0, 3, 0, 0, 1, 0, 2, 0, 53, 2, 1, 1, 1, 1, 1, 2, 3, 2, 2, 1, 34, 1, 1, 0, 3, 2, 0, 0, 0, 1, 2, 4, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 30, 47, 13, 9, 3, 0, 1, 28, 2, 0, 18, 16, 0, 6, 4, 2, 2, 0, 1, 1, 1, 2, 1, 2, 0, 0, 0, 4, 2, 2, 3, 3, 2, 1, 1, 0, 0, 0, 4, 2, 2, 3, 3, 2, 1, 1, 0, 0, 0, 33, 34, 0, 3, 2, 0, 0, 0, 1, 2, 4, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 30, 47, 13, 9, 3, 0, 1, 28, 2, 0, 18, 16, 0, } var _hcltok_range_lengths []byte = []byte{ 0, 0, 0, 0, 1, 1, 1, 5, 5, 5, 0, 0, 3, 0, 1, 1, 4, 2, 3, 0, 1, 0, 2, 2, 4, 2, 2, 3, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 4, 6, 9, 6, 8, 5, 8, 7, 10, 4, 6, 4, 7, 7, 5, 5, 4, 5, 1, 2, 8, 4, 3, 3, 3, 0, 3, 1, 2, 1, 2, 2, 3, 3, 1, 3, 2, 2, 1, 2, 2, 2, 3, 4, 4, 3, 1, 2, 1, 3, 2, 2, 2, 2, 2, 3, 3, 1, 1, 2, 1, 3, 2, 2, 3, 2, 7, 0, 1, 4, 1, 2, 4, 2, 1, 2, 0, 2, 2, 3, 5, 5, 1, 4, 1, 1, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 4, 2, 2, 3, 1, 4, 4, 6, 1, 3, 1, 1, 2, 1, 1, 1, 5, 3, 1, 1, 1, 2, 3, 3, 1, 2, 2, 1, 4, 1, 2, 5, 2, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 4, 2, 1, 2, 2, 2, 6, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 3, 2, 5, 2, 8, 6, 2, 2, 2, 2, 3, 1, 3, 1, 2, 1, 3, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 1, 2, 1, 0, 1, 1, 1, 1, 0, 1, 2, 3, 1, 3, 3, 1, 0, 3, 0, 2, 3, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 5, 2, 2, 5, 7, 5, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 3, 3, 1, 1, 2, 1, 3, 5, 1, 1, 2, 2, 1, 1, 1, 1, 2, 6, 3, 7, 2, 6, 1, 6, 2, 8, 0, 4, 2, 5, 2, 3, 3, 3, 1, 2, 8, 2, 0, 2, 1, 2, 1, 5, 2, 1, 3, 3, 0, 2, 1, 2, 1, 0, 1, 1, 3, 1, 1, 2, 3, 0, 0, 3, 2, 4, 1, 4, 1, 1, 3, 1, 1, 1, 1, 2, 2, 1, 3, 1, 4, 3, 3, 1, 1, 5, 2, 1, 1, 2, 1, 2, 1, 3, 2, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 1, 1, 3, 2, 1, 0, 2, 1, 1, 1, 1, 0, 3, 0, 1, 1, 4, 2, 3, 0, 1, 0, 2, 2, 4, 2, 2, 3, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 4, 6, 9, 6, 8, 5, 8, 7, 10, 4, 6, 4, 7, 7, 5, 5, 4, 5, 1, 2, 8, 4, 3, 3, 3, 0, 3, 1, 2, 1, 2, 2, 3, 3, 1, 3, 2, 2, 1, 2, 2, 2, 3, 4, 4, 3, 1, 2, 1, 3, 2, 2, 2, 2, 2, 3, 3, 1, 1, 2, 1, 3, 2, 2, 3, 2, 7, 0, 1, 4, 1, 2, 4, 2, 1, 2, 0, 2, 2, 3, 5, 5, 1, 4, 1, 1, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 4, 2, 2, 3, 1, 4, 4, 6, 1, 3, 1, 1, 2, 1, 1, 1, 5, 3, 1, 1, 1, 2, 3, 3, 1, 2, 2, 1, 4, 1, 2, 5, 2, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 4, 2, 1, 2, 2, 2, 6, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 3, 2, 5, 2, 8, 6, 2, 2, 2, 2, 3, 1, 3, 1, 2, 1, 3, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 1, 2, 1, 0, 1, 1, 1, 1, 0, 1, 2, 3, 1, 3, 3, 1, 0, 3, 0, 2, 3, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 5, 2, 2, 5, 7, 5, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 7, 5, 7, 5, 3, 3, 7, 3, 13, 1, 3, 5, 3, 5, 3, 6, 5, 2, 2, 8, 4, 1, 2, 3, 2, 10, 2, 2, 0, 2, 3, 3, 1, 2, 3, 3, 1, 2, 3, 3, 4, 4, 2, 1, 2, 2, 3, 2, 2, 5, 3, 2, 3, 2, 1, 3, 3, 6, 2, 2, 5, 2, 5, 1, 1, 2, 4, 1, 11, 1, 3, 8, 4, 2, 1, 0, 4, 3, 3, 3, 2, 9, 1, 1, 4, 3, 2, 2, 2, 3, 4, 2, 3, 2, 4, 3, 2, 2, 3, 3, 4, 3, 3, 4, 2, 5, 4, 8, 7, 1, 2, 1, 3, 1, 2, 5, 1, 2, 2, 2, 2, 1, 3, 2, 2, 3, 3, 1, 9, 1, 5, 1, 3, 2, 2, 3, 2, 3, 3, 3, 1, 3, 3, 2, 2, 4, 5, 3, 3, 4, 3, 3, 3, 2, 2, 2, 4, 2, 2, 1, 3, 3, 3, 3, 3, 3, 2, 2, 3, 2, 3, 3, 2, 3, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 5, 3, 3, 1, 2, 3, 2, 2, 1, 2, 3, 4, 3, 0, 3, 0, 2, 3, 1, 0, 0, 0, 0, 2, 3, 2, 4, 6, 4, 1, 1, 2, 1, 2, 1, 3, 2, 3, 2, 5, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 3, 0, 1, 1, 4, 2, 3, 0, 1, 0, 2, 2, 4, 2, 2, 3, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 4, 6, 9, 6, 8, 5, 8, 7, 10, 4, 6, 4, 7, 7, 5, 5, 4, 5, 1, 2, 8, 4, 3, 3, 3, 0, 3, 1, 2, 1, 2, 2, 3, 3, 1, 3, 2, 2, 1, 2, 2, 2, 3, 4, 4, 3, 1, 2, 1, 3, 2, 2, 2, 2, 2, 3, 3, 1, 1, 2, 1, 3, 2, 2, 3, 2, 7, 0, 1, 4, 1, 2, 4, 2, 1, 2, 0, 2, 2, 3, 5, 5, 1, 4, 1, 1, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 4, 2, 2, 3, 1, 4, 4, 6, 1, 3, 1, 1, 2, 1, 1, 1, 5, 3, 1, 1, 1, 2, 3, 3, 1, 2, 2, 1, 4, 1, 2, 5, 2, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 4, 2, 1, 2, 2, 2, 6, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 3, 2, 5, 2, 8, 6, 2, 2, 2, 2, 3, 1, 3, 1, 2, 1, 3, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 2, 4, 1, 2, 1, 0, 1, 1, 1, 1, 0, 1, 2, 3, 1, 3, 3, 1, 0, 3, 0, 2, 3, 1, 0, 0, 0, 0, 2, 2, 2, 2, 1, 5, 2, 2, 5, 7, 5, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 2, 3, 3, 4, 7, 5, 7, 5, 3, 3, 7, 3, 13, 1, 3, 5, 3, 5, 3, 6, 5, 2, 2, 8, 4, 1, 2, 3, 2, 10, 2, 2, 0, 2, 3, 3, 1, 2, 3, 3, 1, 2, 3, 3, 4, 4, 2, 1, 2, 2, 3, 2, 2, 5, 3, 2, 3, 2, 1, 3, 3, 6, 2, 2, 5, 2, 5, 1, 1, 2, 4, 1, 11, 1, 3, 8, 4, 2, 1, 0, 4, 3, 3, 3, 2, 9, 1, 1, 4, 3, 2, 2, 2, 3, 4, 2, 3, 2, 4, 3, 2, 2, 3, 3, 4, 3, 3, 4, 2, 5, 4, 8, 7, 1, 2, 1, 3, 1, 2, 5, 1, 2, 2, 2, 2, 1, 3, 2, 2, 3, 3, 1, 9, 1, 5, 1, 3, 2, 2, 3, 2, 3, 3, 3, 1, 3, 3, 2, 2, 4, 5, 3, 3, 4, 3, 3, 3, 2, 2, 2, 4, 2, 2, 1, 3, 3, 3, 3, 3, 3, 2, 2, 3, 2, 3, 3, 2, 3, 2, 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 2, 3, 5, 3, 3, 1, 2, 3, 2, 2, 1, 2, 3, 4, 3, 0, 3, 0, 2, 3, 1, 0, 0, 0, 0, 2, 3, 2, 4, 6, 4, 1, 1, 2, 1, 2, 1, 3, 2, 3, 2, 11, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 5, 0, 0, 1, 1, 1, 0, 1, 1, 5, 4, 2, 0, 1, 0, 2, 2, 5, 2, 3, 5, 3, 2, 3, 5, 1, 1, 1, 3, 1, 1, 2, 2, 3, 1, 2, 3, 1, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 1, 1, 5, 6, 0, 0, 0, 0, 0, 0, 1, 1, 1, 5, 6, 0, 0, 0, 0, 0, 0, 1, 1, 1, 8, 5, 1, 1, 1, 0, 1, 1, 5, 4, 2, 0, 1, 0, 2, 2, 5, 2, 3, 5, 3, 2, 3, 5, 1, 1, 1, 3, 1, 1, 2, 2, 3, 1, 2, 3, 1, } var _hcltok_index_offsets []int16 = []int16{ 0, 0, 2, 4, 7, 12, 16, 18, 56, 93, 135, 137, 142, 146, 147, 149, 151, 157, 162, 167, 169, 172, 174, 177, 181, 187, 190, 193, 199, 201, 203, 205, 208, 241, 243, 245, 248, 251, 254, 262, 270, 281, 289, 298, 306, 315, 324, 336, 343, 350, 358, 366, 375, 381, 389, 395, 403, 405, 408, 422, 428, 436, 440, 444, 446, 493, 495, 498, 500, 505, 511, 517, 522, 525, 529, 532, 535, 537, 540, 543, 546, 550, 555, 560, 564, 566, 569, 571, 575, 578, 581, 584, 587, 591, 596, 600, 602, 604, 607, 609, 613, 616, 619, 627, 631, 639, 655, 657, 662, 664, 668, 679, 683, 685, 688, 690, 693, 698, 702, 708, 714, 725, 730, 733, 736, 739, 742, 744, 748, 749, 752, 754, 784, 786, 788, 791, 795, 798, 802, 804, 806, 808, 814, 817, 820, 824, 826, 831, 836, 843, 846, 850, 854, 856, 859, 879, 881, 883, 890, 894, 896, 898, 900, 903, 907, 911, 913, 917, 920, 922, 927, 945, 984, 990, 993, 995, 997, 999, 1002, 1005, 1008, 1011, 1014, 1018, 1021, 1024, 1027, 1029, 1031, 1034, 1041, 1044, 1046, 1049, 1052, 1055, 1063, 1065, 1067, 1070, 1072, 1075, 1077, 1079, 1109, 1112, 1115, 1118, 1121, 1126, 1130, 1137, 1140, 1149, 1158, 1161, 1165, 1168, 1171, 1175, 1177, 1181, 1183, 1186, 1188, 1192, 1196, 1200, 1208, 1210, 1212, 1216, 1220, 1222, 1235, 1237, 1240, 1243, 1248, 1250, 1253, 1255, 1257, 1260, 1265, 1267, 1269, 1274, 1276, 1279, 1283, 1303, 1307, 1311, 1313, 1315, 1323, 1325, 1332, 1337, 1339, 1343, 1346, 1349, 1352, 1356, 1359, 1362, 1366, 1376, 1382, 1385, 1388, 1398, 1418, 1424, 1427, 1429, 1433, 1435, 1438, 1440, 1444, 1446, 1448, 1452, 1454, 1458, 1463, 1469, 1471, 1473, 1476, 1478, 1482, 1489, 1492, 1494, 1497, 1501, 1531, 1536, 1538, 1541, 1545, 1554, 1559, 1567, 1571, 1579, 1583, 1591, 1595, 1606, 1608, 1614, 1617, 1625, 1629, 1634, 1639, 1644, 1646, 1649, 1664, 1668, 1670, 1673, 1675, 1724, 1727, 1734, 1737, 1739, 1743, 1747, 1750, 1754, 1756, 1759, 1761, 1763, 1765, 1767, 1771, 1773, 1775, 1778, 1782, 1796, 1799, 1803, 1806, 1811, 1822, 1827, 1830, 1860, 1864, 1867, 1872, 1874, 1878, 1881, 1884, 1886, 1891, 1893, 1899, 1904, 1910, 1912, 1932, 1940, 1943, 1945, 1963, 2001, 2003, 2006, 2008, 2013, 2016, 2045, 2047, 2049, 2051, 2053, 2056, 2058, 2062, 2065, 2067, 2070, 2072, 2074, 2077, 2079, 2081, 2083, 2085, 2087, 2090, 2093, 2096, 2109, 2111, 2115, 2118, 2120, 2125, 2128, 2142, 2145, 2154, 2156, 2161, 2165, 2166, 2168, 2170, 2176, 2181, 2186, 2188, 2191, 2193, 2196, 2200, 2206, 2209, 2212, 2218, 2220, 2222, 2224, 2227, 2260, 2262, 2264, 2267, 2270, 2273, 2281, 2289, 2300, 2308, 2317, 2325, 2334, 2343, 2355, 2362, 2369, 2377, 2385, 2394, 2400, 2408, 2414, 2422, 2424, 2427, 2441, 2447, 2455, 2459, 2463, 2465, 2512, 2514, 2517, 2519, 2524, 2530, 2536, 2541, 2544, 2548, 2551, 2554, 2556, 2559, 2562, 2565, 2569, 2574, 2579, 2583, 2585, 2588, 2590, 2594, 2597, 2600, 2603, 2606, 2610, 2615, 2619, 2621, 2623, 2626, 2628, 2632, 2635, 2638, 2646, 2650, 2658, 2674, 2676, 2681, 2683, 2687, 2698, 2702, 2704, 2707, 2709, 2712, 2717, 2721, 2727, 2733, 2744, 2749, 2752, 2755, 2758, 2761, 2763, 2767, 2768, 2771, 2773, 2803, 2805, 2807, 2810, 2814, 2817, 2821, 2823, 2825, 2827, 2833, 2836, 2839, 2843, 2845, 2850, 2855, 2862, 2865, 2869, 2873, 2875, 2878, 2898, 2900, 2902, 2909, 2913, 2915, 2917, 2919, 2922, 2926, 2930, 2932, 2936, 2939, 2941, 2946, 2964, 3003, 3009, 3012, 3014, 3016, 3018, 3021, 3024, 3027, 3030, 3033, 3037, 3040, 3043, 3046, 3048, 3050, 3053, 3060, 3063, 3065, 3068, 3071, 3074, 3082, 3084, 3086, 3089, 3091, 3094, 3096, 3098, 3128, 3131, 3134, 3137, 3140, 3145, 3149, 3156, 3159, 3168, 3177, 3180, 3184, 3187, 3190, 3194, 3196, 3200, 3202, 3205, 3207, 3211, 3215, 3219, 3227, 3229, 3231, 3235, 3239, 3241, 3254, 3256, 3259, 3262, 3267, 3269, 3272, 3274, 3276, 3279, 3284, 3286, 3288, 3293, 3295, 3298, 3302, 3322, 3326, 3330, 3332, 3334, 3342, 3344, 3351, 3356, 3358, 3362, 3365, 3368, 3371, 3375, 3378, 3381, 3385, 3395, 3401, 3404, 3407, 3417, 3437, 3443, 3446, 3448, 3452, 3454, 3457, 3459, 3463, 3465, 3467, 3471, 3473, 3475, 3481, 3484, 3489, 3494, 3500, 3510, 3518, 3530, 3537, 3547, 3553, 3565, 3571, 3589, 3592, 3600, 3606, 3616, 3623, 3630, 3638, 3646, 3649, 3654, 3674, 3680, 3683, 3687, 3691, 3695, 3707, 3710, 3715, 3716, 3722, 3729, 3735, 3738, 3741, 3745, 3749, 3752, 3755, 3760, 3764, 3770, 3776, 3779, 3783, 3786, 3789, 3794, 3797, 3800, 3806, 3810, 3813, 3817, 3820, 3823, 3827, 3831, 3838, 3841, 3844, 3850, 3853, 3860, 3862, 3864, 3867, 3876, 3881, 3895, 3899, 3903, 3918, 3924, 3927, 3930, 3932, 3937, 3943, 3947, 3955, 3961, 3971, 3974, 3977, 3982, 3986, 3989, 3992, 3995, 3999, 4004, 4008, 4012, 4015, 4020, 4025, 4028, 4034, 4038, 4044, 4049, 4053, 4057, 4065, 4068, 4076, 4082, 4092, 4103, 4106, 4109, 4111, 4115, 4117, 4120, 4131, 4135, 4138, 4141, 4144, 4147, 4149, 4153, 4157, 4160, 4164, 4169, 4172, 4182, 4184, 4225, 4231, 4235, 4238, 4241, 4245, 4248, 4252, 4256, 4261, 4263, 4267, 4271, 4274, 4277, 4282, 4291, 4295, 4300, 4305, 4309, 4316, 4320, 4323, 4327, 4330, 4335, 4338, 4341, 4371, 4375, 4379, 4383, 4387, 4392, 4396, 4402, 4406, 4414, 4417, 4422, 4426, 4429, 4434, 4437, 4441, 4444, 4447, 4450, 4453, 4456, 4460, 4464, 4467, 4477, 4480, 4483, 4488, 4494, 4497, 4512, 4515, 4519, 4525, 4529, 4533, 4536, 4540, 4547, 4550, 4553, 4559, 4562, 4566, 4571, 4587, 4589, 4597, 4599, 4607, 4613, 4615, 4619, 4622, 4625, 4628, 4632, 4643, 4646, 4658, 4682, 4690, 4692, 4696, 4699, 4704, 4707, 4709, 4714, 4717, 4723, 4726, 4734, 4736, 4738, 4740, 4742, 4744, 4746, 4748, 4750, 4752, 4755, 4758, 4760, 4762, 4764, 4766, 4769, 4772, 4777, 4781, 4782, 4784, 4786, 4792, 4797, 4802, 4804, 4807, 4809, 4812, 4816, 4822, 4825, 4828, 4834, 4836, 4838, 4840, 4843, 4876, 4878, 4880, 4883, 4886, 4889, 4897, 4905, 4916, 4924, 4933, 4941, 4950, 4959, 4971, 4978, 4985, 4993, 5001, 5010, 5016, 5024, 5030, 5038, 5040, 5043, 5057, 5063, 5071, 5075, 5079, 5081, 5128, 5130, 5133, 5135, 5140, 5146, 5152, 5157, 5160, 5164, 5167, 5170, 5172, 5175, 5178, 5181, 5185, 5190, 5195, 5199, 5201, 5204, 5206, 5210, 5213, 5216, 5219, 5222, 5226, 5231, 5235, 5237, 5239, 5242, 5244, 5248, 5251, 5254, 5262, 5266, 5274, 5290, 5292, 5297, 5299, 5303, 5314, 5318, 5320, 5323, 5325, 5328, 5333, 5337, 5343, 5349, 5360, 5365, 5368, 5371, 5374, 5377, 5379, 5383, 5384, 5387, 5389, 5419, 5421, 5423, 5426, 5430, 5433, 5437, 5439, 5441, 5443, 5449, 5452, 5455, 5459, 5461, 5466, 5471, 5478, 5481, 5485, 5489, 5491, 5494, 5514, 5516, 5518, 5525, 5529, 5531, 5533, 5535, 5538, 5542, 5546, 5548, 5552, 5555, 5557, 5562, 5580, 5619, 5625, 5628, 5630, 5632, 5634, 5637, 5640, 5643, 5646, 5649, 5653, 5656, 5659, 5662, 5664, 5666, 5669, 5676, 5679, 5681, 5684, 5687, 5690, 5698, 5700, 5702, 5705, 5707, 5710, 5712, 5714, 5744, 5747, 5750, 5753, 5756, 5761, 5765, 5772, 5775, 5784, 5793, 5796, 5800, 5803, 5806, 5810, 5812, 5816, 5818, 5821, 5823, 5827, 5831, 5835, 5843, 5845, 5847, 5851, 5855, 5857, 5870, 5872, 5875, 5878, 5883, 5885, 5888, 5890, 5892, 5895, 5900, 5902, 5904, 5909, 5911, 5914, 5918, 5938, 5942, 5946, 5948, 5950, 5958, 5960, 5967, 5972, 5974, 5978, 5981, 5984, 5987, 5991, 5994, 5997, 6001, 6011, 6017, 6020, 6023, 6033, 6053, 6059, 6062, 6064, 6068, 6070, 6073, 6075, 6079, 6081, 6083, 6087, 6089, 6091, 6097, 6100, 6105, 6110, 6116, 6126, 6134, 6146, 6153, 6163, 6169, 6181, 6187, 6205, 6208, 6216, 6222, 6232, 6239, 6246, 6254, 6262, 6265, 6270, 6290, 6296, 6299, 6303, 6307, 6311, 6323, 6326, 6331, 6332, 6338, 6345, 6351, 6354, 6357, 6361, 6365, 6368, 6371, 6376, 6380, 6386, 6392, 6395, 6399, 6402, 6405, 6410, 6413, 6416, 6422, 6426, 6429, 6433, 6436, 6439, 6443, 6447, 6454, 6457, 6460, 6466, 6469, 6476, 6478, 6480, 6483, 6492, 6497, 6511, 6515, 6519, 6534, 6540, 6543, 6546, 6548, 6553, 6559, 6563, 6571, 6577, 6587, 6590, 6593, 6598, 6602, 6605, 6608, 6611, 6615, 6620, 6624, 6628, 6631, 6636, 6641, 6644, 6650, 6654, 6660, 6665, 6669, 6673, 6681, 6684, 6692, 6698, 6708, 6719, 6722, 6725, 6727, 6731, 6733, 6736, 6747, 6751, 6754, 6757, 6760, 6763, 6765, 6769, 6773, 6776, 6780, 6785, 6788, 6798, 6800, 6841, 6847, 6851, 6854, 6857, 6861, 6864, 6868, 6872, 6877, 6879, 6883, 6887, 6890, 6893, 6898, 6907, 6911, 6916, 6921, 6925, 6932, 6936, 6939, 6943, 6946, 6951, 6954, 6957, 6987, 6991, 6995, 6999, 7003, 7008, 7012, 7018, 7022, 7030, 7033, 7038, 7042, 7045, 7050, 7053, 7057, 7060, 7063, 7066, 7069, 7072, 7076, 7080, 7083, 7093, 7096, 7099, 7104, 7110, 7113, 7128, 7131, 7135, 7141, 7145, 7149, 7152, 7156, 7163, 7166, 7169, 7175, 7178, 7182, 7187, 7203, 7205, 7213, 7215, 7223, 7229, 7231, 7235, 7238, 7241, 7244, 7248, 7259, 7262, 7274, 7298, 7306, 7308, 7312, 7315, 7320, 7323, 7325, 7330, 7333, 7339, 7342, 7407, 7410, 7412, 7414, 7416, 7418, 7420, 7423, 7428, 7431, 7434, 7436, 7476, 7478, 7480, 7482, 7487, 7491, 7492, 7494, 7496, 7503, 7510, 7517, 7519, 7521, 7523, 7526, 7529, 7535, 7538, 7543, 7550, 7555, 7558, 7562, 7569, 7601, 7650, 7665, 7678, 7683, 7685, 7689, 7720, 7726, 7728, 7749, 7769, 7771, 7783, 7794, 7797, 7800, 7801, 7803, 7805, 7807, 7810, 7812, 7820, 7822, 7824, 7826, 7836, 7845, 7848, 7852, 7856, 7859, 7861, 7863, 7865, 7867, 7869, 7879, 7888, 7891, 7895, 7899, 7902, 7904, 7906, 7908, 7910, 7912, 7954, 7994, 7996, 8001, 8005, 8006, 8008, 8010, 8017, 8024, 8031, 8033, 8035, 8037, 8040, 8043, 8049, 8052, 8057, 8064, 8069, 8072, 8076, 8083, 8115, 8164, 8179, 8192, 8197, 8199, 8203, 8234, 8240, 8242, 8263, 8283, } var _hcltok_indicies []int16 = []int16{ 1, 0, 3, 2, 3, 4, 2, 6, 8, 8, 7, 5, 9, 9, 7, 5, 7, 5, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 11, 11, 14, 14, 38, 0, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 11, 11, 14, 14, 38, 0, 44, 45, 11, 11, 46, 13, 15, 16, 17, 16, 47, 48, 20, 49, 22, 23, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 37, 39, 63, 41, 64, 65, 66, 11, 11, 11, 14, 38, 0, 44, 0, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 0, 11, 11, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 11, 11, 11, 11, 11, 0, 0, 11, 0, 0, 11, 0, 11, 0, 0, 11, 0, 0, 0, 11, 11, 11, 11, 11, 11, 0, 11, 11, 0, 11, 11, 0, 0, 0, 0, 0, 0, 11, 11, 0, 0, 11, 0, 11, 11, 11, 0, 67, 68, 69, 70, 14, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 0, 11, 0, 11, 0, 11, 11, 0, 11, 11, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 0, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 11, 11, 0, 11, 0, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 16, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 14, 15, 133, 134, 135, 136, 137, 14, 16, 14, 0, 11, 0, 11, 11, 0, 0, 11, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 0, 0, 0, 11, 0, 0, 0, 11, 11, 11, 0, 0, 0, 11, 11, 0, 0, 0, 11, 11, 11, 0, 0, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 0, 0, 0, 0, 0, 11, 11, 11, 11, 0, 0, 11, 11, 11, 0, 0, 11, 11, 11, 11, 0, 11, 11, 0, 11, 11, 0, 0, 0, 11, 11, 11, 0, 0, 0, 0, 11, 11, 11, 11, 11, 0, 0, 0, 0, 11, 0, 11, 11, 0, 11, 11, 0, 11, 0, 11, 11, 11, 0, 11, 11, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 138, 139, 140, 141, 142, 143, 144, 145, 146, 14, 147, 148, 149, 150, 151, 0, 11, 0, 0, 0, 0, 0, 11, 11, 0, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 0, 11, 11, 11, 0, 0, 11, 0, 0, 11, 11, 11, 11, 11, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 0, 152, 109, 153, 154, 155, 14, 156, 157, 16, 14, 0, 11, 11, 11, 11, 0, 0, 0, 11, 0, 0, 11, 11, 11, 0, 0, 0, 11, 11, 0, 119, 0, 16, 14, 14, 158, 0, 14, 0, 11, 16, 159, 160, 16, 161, 162, 16, 57, 163, 164, 165, 166, 167, 16, 168, 169, 170, 16, 171, 172, 173, 15, 174, 175, 176, 15, 177, 16, 14, 0, 0, 11, 11, 0, 0, 0, 11, 11, 11, 11, 0, 11, 11, 0, 0, 0, 0, 11, 11, 0, 0, 11, 11, 0, 0, 0, 0, 0, 0, 11, 11, 11, 0, 0, 0, 11, 0, 0, 0, 11, 11, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 0, 0, 0, 11, 11, 11, 11, 0, 178, 179, 0, 14, 0, 11, 0, 0, 11, 16, 180, 181, 182, 183, 57, 184, 185, 55, 186, 187, 188, 189, 190, 191, 192, 193, 194, 14, 0, 0, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 0, 0, 11, 0, 11, 0, 0, 11, 11, 11, 11, 0, 11, 11, 11, 0, 0, 11, 11, 11, 11, 0, 11, 11, 0, 0, 11, 11, 11, 11, 11, 0, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 201, 206, 207, 208, 209, 38, 0, 210, 211, 16, 212, 213, 214, 215, 216, 217, 218, 219, 220, 16, 14, 221, 222, 223, 224, 16, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 16, 144, 14, 240, 0, 11, 11, 11, 11, 11, 0, 0, 0, 11, 0, 11, 11, 0, 11, 0, 11, 11, 0, 0, 0, 11, 11, 11, 0, 0, 0, 11, 11, 11, 0, 0, 0, 0, 11, 0, 0, 11, 0, 0, 11, 11, 11, 0, 0, 11, 0, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 0, 0, 0, 11, 11, 0, 11, 11, 0, 11, 11, 0, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 0, 11, 0, 11, 11, 0, 11, 0, 11, 11, 0, 11, 0, 11, 0, 241, 212, 242, 243, 244, 245, 246, 247, 248, 249, 250, 98, 251, 16, 252, 253, 254, 16, 255, 129, 256, 257, 258, 259, 260, 261, 262, 263, 16, 0, 0, 0, 11, 11, 11, 0, 11, 11, 0, 11, 11, 0, 0, 0, 0, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 0, 0, 0, 0, 11, 11, 11, 0, 0, 0, 11, 0, 0, 0, 11, 11, 0, 11, 11, 11, 0, 11, 0, 0, 0, 11, 11, 0, 11, 11, 11, 0, 11, 11, 11, 0, 0, 0, 0, 11, 16, 181, 264, 265, 14, 16, 14, 0, 0, 11, 0, 11, 16, 264, 14, 0, 16, 266, 14, 0, 0, 11, 16, 267, 268, 269, 172, 270, 271, 16, 272, 273, 274, 14, 0, 0, 11, 11, 11, 0, 11, 11, 0, 11, 11, 11, 11, 0, 0, 11, 0, 0, 11, 11, 0, 11, 0, 16, 14, 0, 275, 16, 276, 0, 14, 0, 11, 0, 11, 277, 16, 278, 279, 0, 11, 0, 0, 0, 11, 11, 11, 11, 0, 280, 281, 282, 16, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 14, 0, 11, 11, 11, 0, 0, 0, 0, 11, 11, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 11, 0, 11, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 0, 0, 11, 0, 0, 0, 11, 0, 0, 11, 0, 0, 11, 0, 0, 11, 0, 0, 0, 11, 11, 11, 0, 0, 0, 11, 11, 11, 11, 0, 297, 16, 298, 16, 299, 300, 301, 302, 14, 0, 11, 11, 11, 11, 11, 0, 0, 0, 11, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 0, 303, 16, 14, 0, 11, 304, 16, 100, 14, 0, 11, 305, 0, 14, 0, 11, 16, 306, 14, 0, 0, 11, 307, 0, 16, 308, 14, 0, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 0, 0, 11, 0, 11, 11, 11, 0, 11, 0, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 0, 11, 0, 0, 0, 11, 11, 11, 11, 0, 309, 310, 69, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 331, 332, 333, 334, 335, 336, 330, 0, 11, 11, 11, 11, 0, 11, 0, 11, 11, 0, 11, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 0, 11, 11, 11, 11, 11, 0, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 0, 11, 11, 11, 11, 0, 11, 0, 11, 11, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 0, 11, 11, 0, 11, 0, 337, 338, 339, 101, 102, 103, 104, 105, 340, 107, 108, 109, 110, 111, 112, 341, 342, 167, 343, 258, 117, 344, 119, 229, 269, 122, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 131, 355, 16, 14, 15, 16, 134, 135, 136, 137, 14, 14, 0, 11, 11, 0, 11, 11, 11, 11, 11, 11, 0, 0, 0, 11, 0, 11, 11, 11, 11, 0, 11, 11, 11, 0, 11, 11, 0, 11, 11, 11, 0, 0, 11, 11, 11, 0, 0, 11, 11, 0, 11, 0, 11, 0, 11, 11, 11, 0, 0, 11, 11, 0, 11, 11, 0, 11, 11, 11, 0, 356, 140, 142, 143, 144, 145, 146, 14, 357, 148, 358, 150, 359, 0, 11, 11, 0, 0, 0, 0, 11, 0, 0, 11, 11, 11, 11, 11, 0, 360, 109, 361, 154, 155, 14, 156, 157, 16, 14, 0, 11, 11, 11, 11, 0, 0, 0, 11, 16, 159, 160, 16, 362, 363, 219, 308, 163, 164, 165, 364, 167, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 175, 176, 15, 375, 16, 14, 0, 0, 0, 0, 11, 11, 11, 0, 0, 0, 0, 0, 11, 11, 0, 11, 11, 11, 0, 11, 11, 0, 0, 0, 11, 11, 0, 11, 11, 11, 11, 0, 11, 0, 11, 11, 11, 11, 11, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 0, 11, 0, 16, 180, 181, 376, 183, 57, 184, 185, 55, 186, 187, 377, 14, 190, 378, 192, 193, 194, 14, 0, 11, 11, 11, 11, 11, 11, 11, 0, 11, 11, 0, 11, 0, 379, 380, 197, 198, 199, 381, 201, 202, 382, 383, 384, 201, 206, 207, 208, 209, 38, 0, 210, 211, 16, 212, 213, 215, 385, 217, 386, 219, 220, 16, 14, 387, 222, 223, 224, 16, 225, 226, 227, 228, 229, 230, 231, 232, 388, 234, 235, 389, 237, 238, 239, 16, 144, 14, 240, 0, 0, 11, 0, 0, 11, 0, 11, 11, 11, 11, 11, 0, 11, 11, 0, 390, 391, 392, 393, 394, 395, 396, 397, 247, 398, 319, 399, 213, 400, 401, 402, 403, 404, 401, 405, 406, 407, 258, 408, 260, 409, 410, 271, 0, 11, 0, 11, 0, 11, 0, 11, 0, 11, 11, 0, 11, 0, 11, 11, 11, 0, 11, 11, 0, 0, 11, 11, 11, 0, 11, 0, 11, 0, 11, 11, 0, 11, 0, 11, 0, 11, 0, 11, 0, 11, 0, 0, 0, 11, 11, 11, 0, 11, 11, 0, 16, 267, 229, 411, 401, 412, 271, 16, 413, 414, 274, 14, 0, 11, 0, 11, 11, 11, 0, 0, 0, 11, 11, 0, 277, 16, 278, 415, 0, 11, 11, 0, 16, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 416, 14, 0, 0, 0, 11, 16, 417, 16, 265, 300, 301, 302, 14, 0, 0, 11, 419, 419, 419, 419, 418, 419, 419, 419, 418, 419, 418, 419, 419, 418, 418, 418, 418, 418, 418, 419, 418, 418, 418, 418, 419, 419, 419, 419, 419, 418, 418, 419, 418, 418, 419, 418, 419, 418, 418, 419, 418, 418, 418, 419, 419, 419, 419, 419, 419, 418, 419, 419, 418, 419, 419, 418, 418, 418, 418, 418, 418, 419, 419, 418, 418, 419, 418, 419, 419, 419, 418, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 418, 419, 418, 419, 418, 419, 419, 418, 419, 419, 418, 418, 418, 419, 418, 418, 418, 418, 418, 418, 418, 419, 418, 418, 418, 418, 418, 418, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 418, 418, 418, 418, 418, 418, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 418, 418, 418, 418, 418, 418, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 418, 418, 418, 418, 418, 418, 418, 418, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 418, 418, 418, 418, 418, 418, 418, 418, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 418, 419, 418, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 418, 419, 419, 419, 418, 419, 418, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 425, 489, 490, 491, 492, 493, 494, 425, 470, 425, 418, 419, 418, 419, 419, 418, 418, 419, 418, 418, 418, 418, 419, 418, 418, 418, 418, 418, 419, 418, 418, 418, 418, 418, 419, 419, 419, 419, 419, 418, 418, 418, 419, 418, 418, 418, 419, 419, 419, 418, 418, 418, 419, 419, 418, 418, 418, 419, 419, 419, 418, 418, 418, 419, 419, 419, 419, 418, 419, 419, 419, 419, 418, 418, 418, 418, 418, 419, 419, 419, 419, 418, 418, 419, 419, 419, 418, 418, 419, 419, 419, 419, 418, 419, 419, 418, 419, 419, 418, 418, 418, 419, 419, 419, 418, 418, 418, 418, 419, 419, 419, 419, 419, 418, 418, 418, 418, 419, 418, 419, 419, 418, 419, 419, 418, 419, 418, 419, 419, 419, 418, 419, 419, 418, 418, 418, 419, 418, 418, 418, 418, 418, 418, 418, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 418, 495, 496, 497, 498, 499, 500, 501, 502, 503, 425, 504, 505, 506, 507, 508, 418, 419, 418, 418, 418, 418, 418, 419, 419, 418, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 418, 418, 419, 419, 419, 418, 418, 419, 418, 418, 419, 419, 419, 419, 419, 418, 418, 418, 418, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 418, 509, 464, 510, 511, 512, 425, 513, 514, 470, 425, 418, 419, 419, 419, 419, 418, 418, 418, 419, 418, 418, 419, 419, 419, 418, 418, 418, 419, 419, 418, 475, 418, 470, 425, 425, 515, 418, 425, 418, 419, 470, 516, 517, 470, 518, 519, 470, 520, 521, 522, 523, 524, 525, 470, 526, 527, 528, 470, 529, 530, 531, 489, 532, 533, 534, 489, 535, 470, 425, 418, 418, 419, 419, 418, 418, 418, 419, 419, 419, 419, 418, 419, 419, 418, 418, 418, 418, 419, 419, 418, 418, 419, 419, 418, 418, 418, 418, 418, 418, 419, 419, 419, 418, 418, 418, 419, 418, 418, 418, 419, 419, 418, 419, 419, 419, 419, 418, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 418, 418, 418, 419, 419, 419, 419, 418, 536, 537, 418, 425, 418, 419, 418, 418, 419, 470, 538, 539, 540, 541, 520, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 425, 418, 418, 419, 418, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 418, 419, 418, 418, 419, 418, 419, 418, 418, 419, 419, 419, 419, 418, 419, 419, 419, 418, 418, 419, 419, 419, 419, 418, 419, 419, 418, 418, 419, 419, 419, 419, 419, 418, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 560, 566, 567, 568, 569, 565, 418, 570, 571, 470, 572, 573, 574, 575, 576, 577, 578, 579, 580, 470, 425, 581, 582, 583, 584, 470, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 470, 501, 425, 600, 418, 419, 419, 419, 419, 419, 418, 418, 418, 419, 418, 419, 419, 418, 419, 418, 419, 419, 418, 418, 418, 419, 419, 419, 418, 418, 418, 419, 419, 419, 418, 418, 418, 418, 419, 418, 418, 419, 418, 418, 419, 419, 419, 418, 418, 419, 418, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 418, 418, 418, 419, 419, 418, 419, 419, 418, 419, 419, 418, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 418, 419, 418, 419, 418, 419, 419, 418, 419, 418, 419, 419, 418, 419, 418, 419, 418, 601, 572, 602, 603, 604, 605, 606, 607, 608, 609, 610, 453, 611, 470, 612, 613, 614, 470, 615, 485, 616, 617, 618, 619, 620, 621, 622, 623, 470, 418, 418, 418, 419, 419, 419, 418, 419, 419, 418, 419, 419, 418, 418, 418, 418, 418, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 418, 418, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 418, 418, 418, 418, 419, 419, 419, 418, 418, 418, 419, 418, 418, 418, 419, 419, 418, 419, 419, 419, 418, 419, 418, 418, 418, 419, 419, 418, 419, 419, 419, 418, 419, 419, 419, 418, 418, 418, 418, 419, 470, 539, 624, 625, 425, 470, 425, 418, 418, 419, 418, 419, 470, 624, 425, 418, 470, 626, 425, 418, 418, 419, 470, 627, 628, 629, 530, 630, 631, 470, 632, 633, 634, 425, 418, 418, 419, 419, 419, 418, 419, 419, 418, 419, 419, 419, 419, 418, 418, 419, 418, 418, 419, 419, 418, 419, 418, 470, 425, 418, 635, 470, 636, 418, 425, 418, 419, 418, 419, 637, 470, 638, 639, 418, 419, 418, 418, 418, 419, 419, 419, 419, 418, 640, 641, 642, 470, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 425, 418, 419, 419, 419, 418, 418, 418, 418, 419, 419, 418, 418, 419, 418, 418, 418, 418, 418, 418, 418, 419, 418, 419, 418, 418, 418, 418, 418, 418, 419, 419, 419, 419, 419, 418, 418, 419, 418, 418, 418, 419, 418, 418, 419, 418, 418, 419, 418, 418, 419, 418, 418, 418, 419, 419, 419, 418, 418, 418, 419, 419, 419, 419, 418, 657, 470, 658, 470, 659, 660, 661, 662, 425, 418, 419, 419, 419, 419, 419, 418, 418, 418, 419, 418, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 418, 419, 419, 419, 419, 419, 418, 663, 470, 425, 418, 419, 664, 470, 455, 425, 418, 419, 665, 418, 425, 418, 419, 470, 666, 425, 418, 418, 419, 667, 418, 470, 668, 425, 418, 418, 419, 670, 669, 419, 419, 419, 419, 670, 669, 419, 670, 669, 670, 670, 419, 670, 669, 419, 670, 419, 670, 669, 419, 670, 419, 670, 419, 669, 670, 670, 670, 670, 670, 670, 670, 670, 669, 419, 419, 670, 670, 419, 670, 419, 670, 669, 670, 670, 670, 670, 670, 419, 670, 419, 670, 419, 670, 669, 670, 670, 419, 670, 419, 670, 669, 670, 670, 670, 670, 670, 419, 670, 419, 670, 669, 419, 419, 670, 419, 670, 669, 670, 670, 670, 419, 670, 419, 670, 419, 670, 419, 670, 669, 670, 419, 670, 419, 670, 669, 419, 670, 670, 670, 670, 419, 670, 419, 670, 419, 670, 419, 670, 419, 670, 419, 670, 669, 419, 670, 669, 670, 670, 670, 419, 670, 419, 670, 669, 670, 419, 670, 419, 670, 669, 419, 670, 670, 670, 670, 419, 670, 419, 670, 669, 419, 670, 419, 670, 419, 670, 669, 670, 670, 419, 670, 419, 670, 669, 419, 670, 419, 670, 419, 670, 419, 669, 670, 670, 670, 419, 670, 419, 670, 669, 419, 670, 669, 670, 670, 419, 670, 669, 670, 670, 670, 419, 670, 670, 670, 670, 670, 670, 419, 419, 670, 419, 670, 419, 670, 419, 670, 669, 670, 419, 670, 419, 670, 669, 419, 670, 669, 670, 419, 670, 669, 670, 419, 670, 669, 419, 419, 670, 669, 419, 670, 419, 670, 419, 670, 419, 670, 419, 670, 419, 669, 670, 670, 419, 670, 670, 670, 670, 419, 419, 670, 670, 670, 670, 670, 419, 670, 670, 670, 670, 670, 669, 419, 670, 670, 419, 670, 419, 669, 670, 670, 419, 670, 669, 419, 419, 670, 419, 669, 670, 670, 669, 419, 670, 419, 669, 670, 669, 419, 670, 419, 670, 419, 669, 670, 670, 669, 419, 670, 419, 670, 419, 670, 669, 670, 419, 670, 419, 670, 669, 419, 670, 669, 419, 419, 670, 669, 670, 419, 669, 670, 669, 419, 670, 419, 670, 419, 669, 670, 669, 419, 419, 670, 669, 670, 419, 670, 419, 670, 669, 419, 670, 419, 669, 670, 669, 419, 419, 670, 419, 669, 670, 669, 419, 419, 670, 669, 670, 419, 670, 669, 670, 419, 670, 669, 670, 419, 670, 419, 670, 419, 669, 670, 669, 419, 419, 670, 669, 670, 419, 670, 419, 670, 669, 419, 670, 669, 670, 670, 419, 670, 419, 670, 669, 669, 419, 669, 419, 670, 670, 419, 670, 670, 670, 670, 670, 670, 670, 669, 419, 670, 670, 670, 419, 669, 670, 670, 670, 419, 670, 419, 670, 419, 670, 419, 670, 419, 670, 669, 419, 419, 670, 669, 670, 419, 670, 669, 419, 419, 670, 419, 419, 419, 670, 419, 670, 419, 670, 419, 670, 419, 669, 419, 670, 419, 670, 419, 669, 670, 669, 419, 670, 419, 669, 670, 419, 670, 670, 670, 669, 419, 670, 419, 419, 670, 419, 669, 670, 670, 669, 419, 670, 670, 670, 670, 419, 670, 419, 669, 670, 670, 670, 419, 670, 669, 670, 419, 670, 419, 670, 419, 670, 419, 670, 669, 670, 670, 419, 670, 669, 419, 670, 419, 670, 419, 669, 670, 670, 669, 419, 670, 419, 669, 670, 669, 419, 670, 669, 419, 670, 419, 670, 669, 670, 670, 670, 669, 419, 419, 419, 670, 669, 419, 670, 419, 669, 670, 669, 419, 670, 419, 670, 419, 669, 670, 670, 670, 669, 419, 670, 419, 669, 670, 670, 670, 670, 669, 419, 670, 419, 670, 669, 419, 419, 670, 419, 670, 669, 670, 419, 670, 419, 669, 670, 670, 669, 419, 670, 419, 670, 669, 419, 670, 670, 670, 419, 670, 419, 669, 419, 670, 669, 670, 419, 419, 670, 419, 670, 419, 669, 670, 670, 670, 670, 669, 419, 670, 419, 670, 419, 670, 419, 670, 419, 670, 669, 670, 670, 670, 419, 670, 419, 670, 419, 670, 419, 669, 670, 670, 419, 419, 670, 669, 670, 419, 670, 670, 669, 419, 670, 419, 670, 669, 419, 419, 670, 670, 670, 670, 419, 670, 419, 670, 419, 669, 670, 670, 419, 669, 670, 669, 419, 670, 419, 669, 670, 669, 419, 670, 419, 669, 670, 419, 670, 670, 669, 419, 670, 670, 419, 669, 670, 669, 419, 670, 419, 670, 669, 670, 419, 670, 419, 669, 670, 669, 419, 670, 419, 670, 419, 670, 419, 670, 419, 670, 669, 671, 669, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 674, 683, 684, 685, 686, 687, 674, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 674, 703, 671, 683, 671, 704, 671, 669, 670, 670, 670, 670, 419, 669, 670, 670, 669, 419, 670, 669, 419, 419, 670, 669, 419, 670, 419, 669, 670, 669, 419, 419, 670, 419, 669, 670, 670, 669, 419, 670, 670, 670, 669, 419, 670, 419, 670, 670, 669, 419, 419, 670, 419, 669, 670, 669, 419, 670, 669, 419, 419, 670, 419, 670, 669, 419, 670, 419, 419, 670, 419, 670, 419, 669, 670, 670, 669, 419, 670, 670, 419, 670, 669, 419, 670, 419, 670, 669, 419, 670, 419, 669, 419, 670, 670, 670, 419, 670, 669, 670, 419, 670, 669, 419, 670, 669, 670, 419, 670, 669, 419, 670, 669, 419, 670, 419, 670, 669, 419, 670, 669, 419, 670, 669, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 676, 717, 718, 719, 720, 721, 718, 722, 723, 724, 725, 726, 727, 728, 729, 730, 671, 669, 670, 419, 670, 669, 670, 419, 670, 669, 670, 419, 670, 669, 670, 419, 670, 669, 419, 670, 419, 670, 669, 670, 419, 670, 669, 670, 419, 419, 419, 670, 669, 670, 419, 670, 669, 670, 670, 670, 670, 419, 670, 419, 669, 670, 669, 419, 419, 670, 419, 670, 669, 670, 419, 670, 669, 419, 670, 669, 670, 670, 419, 670, 669, 419, 670, 669, 670, 419, 670, 669, 419, 670, 669, 419, 670, 669, 419, 670, 669, 670, 669, 419, 419, 670, 669, 670, 419, 670, 669, 419, 670, 419, 669, 670, 669, 419, 674, 731, 671, 674, 732, 674, 733, 683, 671, 669, 670, 669, 419, 670, 669, 419, 674, 732, 683, 671, 669, 674, 734, 671, 683, 671, 669, 670, 669, 419, 674, 735, 692, 736, 718, 737, 730, 674, 738, 739, 740, 671, 683, 671, 669, 670, 669, 419, 670, 419, 670, 669, 419, 670, 419, 670, 419, 669, 670, 670, 669, 419, 670, 419, 670, 669, 419, 670, 669, 674, 683, 425, 669, 741, 674, 742, 683, 671, 669, 425, 670, 669, 419, 670, 669, 419, 743, 674, 744, 745, 671, 669, 419, 670, 669, 670, 670, 669, 419, 419, 670, 419, 670, 669, 674, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 671, 683, 671, 669, 670, 419, 670, 670, 670, 670, 670, 670, 670, 419, 670, 419, 670, 670, 670, 670, 670, 670, 669, 419, 670, 670, 419, 670, 419, 669, 670, 419, 670, 670, 670, 419, 670, 670, 419, 670, 670, 419, 670, 670, 419, 670, 670, 669, 419, 674, 757, 674, 733, 758, 759, 760, 671, 683, 671, 669, 670, 669, 419, 670, 670, 670, 419, 670, 670, 670, 419, 670, 419, 670, 669, 419, 419, 419, 419, 670, 670, 419, 419, 419, 419, 419, 670, 670, 670, 670, 670, 670, 670, 419, 670, 419, 670, 419, 669, 670, 670, 670, 419, 670, 419, 670, 669, 683, 425, 761, 674, 683, 425, 670, 669, 419, 762, 674, 763, 683, 425, 670, 669, 419, 670, 419, 764, 683, 671, 669, 425, 670, 669, 419, 674, 765, 671, 683, 671, 669, 670, 669, 419, 766, 766, 766, 768, 769, 770, 766, 767, 767, 771, 768, 771, 769, 771, 767, 772, 773, 772, 775, 774, 776, 774, 777, 774, 779, 778, 781, 782, 780, 781, 783, 780, 785, 784, 786, 784, 787, 784, 789, 788, 791, 792, 790, 791, 793, 790, 795, 795, 795, 795, 794, 795, 795, 795, 794, 795, 794, 795, 795, 794, 794, 794, 794, 794, 794, 795, 794, 794, 794, 794, 795, 795, 795, 795, 795, 794, 794, 795, 794, 794, 795, 794, 795, 794, 794, 795, 794, 794, 794, 795, 795, 795, 795, 795, 795, 794, 795, 795, 794, 795, 795, 794, 794, 794, 794, 794, 794, 795, 795, 794, 794, 795, 794, 795, 795, 795, 794, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 794, 795, 794, 795, 794, 795, 795, 794, 795, 795, 794, 794, 794, 795, 794, 794, 794, 794, 794, 794, 794, 795, 794, 794, 794, 794, 794, 794, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 794, 794, 794, 794, 794, 794, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 794, 794, 794, 794, 794, 794, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 794, 794, 794, 794, 794, 794, 794, 794, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 794, 794, 794, 794, 794, 794, 794, 794, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 794, 795, 794, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 794, 795, 795, 795, 794, 795, 794, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 801, 865, 866, 867, 868, 869, 870, 801, 846, 801, 794, 795, 794, 795, 795, 794, 794, 795, 794, 794, 794, 794, 795, 794, 794, 794, 794, 794, 795, 794, 794, 794, 794, 794, 795, 795, 795, 795, 795, 794, 794, 794, 795, 794, 794, 794, 795, 795, 795, 794, 794, 794, 795, 795, 794, 794, 794, 795, 795, 795, 794, 794, 794, 795, 795, 795, 795, 794, 795, 795, 795, 795, 794, 794, 794, 794, 794, 795, 795, 795, 795, 794, 794, 795, 795, 795, 794, 794, 795, 795, 795, 795, 794, 795, 795, 794, 795, 795, 794, 794, 794, 795, 795, 795, 794, 794, 794, 794, 795, 795, 795, 795, 795, 794, 794, 794, 794, 795, 794, 795, 795, 794, 795, 795, 794, 795, 794, 795, 795, 795, 794, 795, 795, 794, 794, 794, 795, 794, 794, 794, 794, 794, 794, 794, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 794, 871, 872, 873, 874, 875, 876, 877, 878, 879, 801, 880, 881, 882, 883, 884, 794, 795, 794, 794, 794, 794, 794, 795, 795, 794, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 794, 794, 795, 795, 795, 794, 794, 795, 794, 794, 795, 795, 795, 795, 795, 794, 794, 794, 794, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 794, 885, 840, 886, 887, 888, 801, 889, 890, 846, 801, 794, 795, 795, 795, 795, 794, 794, 794, 795, 794, 794, 795, 795, 795, 794, 794, 794, 795, 795, 794, 851, 794, 846, 801, 801, 891, 794, 801, 794, 795, 846, 892, 893, 846, 894, 895, 846, 896, 897, 898, 899, 900, 901, 846, 902, 903, 904, 846, 905, 906, 907, 865, 908, 909, 910, 865, 911, 846, 801, 794, 794, 795, 795, 794, 794, 794, 795, 795, 795, 795, 794, 795, 795, 794, 794, 794, 794, 795, 795, 794, 794, 795, 795, 794, 794, 794, 794, 794, 794, 795, 795, 795, 794, 794, 794, 795, 794, 794, 794, 795, 795, 794, 795, 795, 795, 795, 794, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 794, 794, 794, 795, 795, 795, 795, 794, 912, 913, 794, 801, 794, 795, 794, 794, 795, 846, 914, 915, 916, 917, 896, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 801, 794, 794, 795, 794, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 794, 795, 794, 794, 795, 794, 795, 794, 794, 795, 795, 795, 795, 794, 795, 795, 795, 794, 794, 795, 795, 795, 795, 794, 795, 795, 794, 794, 795, 795, 795, 795, 795, 794, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 936, 942, 943, 944, 945, 941, 794, 946, 947, 846, 948, 949, 950, 951, 952, 953, 954, 955, 956, 846, 801, 957, 958, 959, 960, 846, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 846, 877, 801, 976, 794, 795, 795, 795, 795, 795, 794, 794, 794, 795, 794, 795, 795, 794, 795, 794, 795, 795, 794, 794, 794, 795, 795, 795, 794, 794, 794, 795, 795, 795, 794, 794, 794, 794, 795, 794, 794, 795, 794, 794, 795, 795, 795, 794, 794, 795, 794, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 794, 794, 794, 795, 795, 794, 795, 795, 794, 795, 795, 794, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 794, 795, 794, 795, 794, 795, 795, 794, 795, 794, 795, 795, 794, 795, 794, 795, 794, 977, 948, 978, 979, 980, 981, 982, 983, 984, 985, 986, 829, 987, 846, 988, 989, 990, 846, 991, 861, 992, 993, 994, 995, 996, 997, 998, 999, 846, 794, 794, 794, 795, 795, 795, 794, 795, 795, 794, 795, 795, 794, 794, 794, 794, 794, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 794, 794, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 794, 794, 794, 794, 795, 795, 795, 794, 794, 794, 795, 794, 794, 794, 795, 795, 794, 795, 795, 795, 794, 795, 794, 794, 794, 795, 795, 794, 795, 795, 795, 794, 795, 795, 795, 794, 794, 794, 794, 795, 846, 915, 1000, 1001, 801, 846, 801, 794, 794, 795, 794, 795, 846, 1000, 801, 794, 846, 1002, 801, 794, 794, 795, 846, 1003, 1004, 1005, 906, 1006, 1007, 846, 1008, 1009, 1010, 801, 794, 794, 795, 795, 795, 794, 795, 795, 794, 795, 795, 795, 795, 794, 794, 795, 794, 794, 795, 795, 794, 795, 794, 846, 801, 794, 1011, 846, 1012, 794, 801, 794, 795, 794, 795, 1013, 846, 1014, 1015, 794, 795, 794, 794, 794, 795, 795, 795, 795, 794, 1016, 1017, 1018, 846, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 801, 794, 795, 795, 795, 794, 794, 794, 794, 795, 795, 794, 794, 795, 794, 794, 794, 794, 794, 794, 794, 795, 794, 795, 794, 794, 794, 794, 794, 794, 795, 795, 795, 795, 795, 794, 794, 795, 794, 794, 794, 795, 794, 794, 795, 794, 794, 795, 794, 794, 795, 794, 794, 794, 795, 795, 795, 794, 794, 794, 795, 795, 795, 795, 794, 1033, 846, 1034, 846, 1035, 1036, 1037, 1038, 801, 794, 795, 795, 795, 795, 795, 794, 794, 794, 795, 794, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 794, 795, 795, 795, 795, 795, 794, 1039, 846, 801, 794, 795, 1040, 846, 831, 801, 794, 795, 1041, 794, 801, 794, 795, 846, 1042, 801, 794, 794, 795, 1043, 794, 846, 1044, 801, 794, 794, 795, 1046, 1045, 795, 795, 795, 795, 1046, 1045, 795, 1046, 1045, 1046, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1045, 795, 795, 1046, 1046, 795, 1046, 795, 1046, 1045, 1046, 1046, 1046, 1046, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 1046, 1046, 795, 1046, 795, 1046, 1045, 1046, 1046, 1046, 1046, 1046, 795, 1046, 795, 1046, 1045, 795, 795, 1046, 795, 1046, 1045, 1046, 1046, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 1046, 1046, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 1045, 1046, 1046, 1046, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 1046, 1046, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 795, 1046, 1045, 1046, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 1045, 1046, 1046, 795, 1046, 1045, 1046, 1046, 1046, 795, 1046, 1046, 1046, 1046, 1046, 1046, 795, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 1045, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 795, 1046, 1045, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 795, 1046, 1046, 1046, 1046, 795, 795, 1046, 1046, 1046, 1046, 1046, 795, 1046, 1046, 1046, 1046, 1046, 1045, 795, 1046, 1046, 795, 1046, 795, 1045, 1046, 1046, 795, 1046, 1045, 795, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 1045, 795, 795, 1046, 1045, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1046, 795, 1045, 1046, 1045, 795, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 795, 1045, 1046, 1045, 795, 795, 1046, 795, 1045, 1046, 1045, 795, 795, 1046, 1045, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 795, 1045, 1046, 1045, 795, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 1045, 795, 1046, 1045, 1046, 1046, 795, 1046, 795, 1046, 1045, 1045, 795, 1045, 795, 1046, 1046, 795, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1045, 795, 1046, 1046, 1046, 795, 1045, 1046, 1046, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 795, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 795, 1046, 795, 795, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1045, 795, 1046, 795, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1045, 1046, 795, 1046, 1046, 1046, 1045, 795, 1046, 795, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 1046, 1046, 1046, 795, 1046, 795, 1045, 1046, 1046, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 1046, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 795, 1045, 1046, 1045, 795, 1046, 1045, 795, 1046, 795, 1046, 1045, 1046, 1046, 1046, 1045, 795, 795, 795, 1046, 1045, 795, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1046, 1045, 795, 1046, 795, 1045, 1046, 1046, 1046, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 1046, 1046, 1046, 795, 1046, 795, 1045, 795, 1046, 1045, 1046, 795, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1046, 1046, 1045, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 1046, 1046, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 795, 795, 1046, 1045, 1046, 795, 1046, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 795, 1046, 1046, 1046, 1046, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1045, 1046, 795, 1046, 1046, 1045, 795, 1046, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 795, 1045, 1046, 1045, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 795, 1046, 1045, 1047, 1045, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1050, 1059, 1060, 1061, 1062, 1063, 1050, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1050, 1079, 1047, 1059, 1047, 1080, 1047, 1045, 1046, 1046, 1046, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 1045, 795, 795, 1046, 1045, 795, 1046, 795, 1045, 1046, 1045, 795, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 1046, 1046, 1045, 795, 1046, 795, 1046, 1046, 1045, 795, 795, 1046, 795, 1045, 1046, 1045, 795, 1046, 1045, 795, 795, 1046, 795, 1046, 1045, 795, 1046, 795, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 1046, 795, 1045, 795, 1046, 1046, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 1046, 1045, 795, 1046, 1045, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1052, 1093, 1094, 1095, 1096, 1097, 1094, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1047, 1045, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 1046, 795, 795, 795, 1046, 1045, 1046, 795, 1046, 1045, 1046, 1046, 1046, 1046, 795, 1046, 795, 1045, 1046, 1045, 795, 795, 1046, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 1046, 1045, 1046, 1046, 795, 1046, 1045, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 1046, 1045, 795, 1046, 1045, 795, 1046, 1045, 1046, 1045, 795, 795, 1046, 1045, 1046, 795, 1046, 1045, 795, 1046, 795, 1045, 1046, 1045, 795, 1050, 1107, 1047, 1050, 1108, 1050, 1109, 1059, 1047, 1045, 1046, 1045, 795, 1046, 1045, 795, 1050, 1108, 1059, 1047, 1045, 1050, 1110, 1047, 1059, 1047, 1045, 1046, 1045, 795, 1050, 1111, 1068, 1112, 1094, 1113, 1106, 1050, 1114, 1115, 1116, 1047, 1059, 1047, 1045, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1045, 795, 1046, 795, 1046, 1045, 795, 1046, 1045, 1050, 1059, 801, 1045, 1117, 1050, 1118, 1059, 1047, 1045, 801, 1046, 1045, 795, 1046, 1045, 795, 1119, 1050, 1120, 1121, 1047, 1045, 795, 1046, 1045, 1046, 1046, 1045, 795, 795, 1046, 795, 1046, 1045, 1050, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1047, 1059, 1047, 1045, 1046, 795, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 795, 1046, 795, 1046, 1046, 1046, 1046, 1046, 1046, 1045, 795, 1046, 1046, 795, 1046, 795, 1045, 1046, 795, 1046, 1046, 1046, 795, 1046, 1046, 795, 1046, 1046, 795, 1046, 1046, 795, 1046, 1046, 1045, 795, 1050, 1133, 1050, 1109, 1134, 1135, 1136, 1047, 1059, 1047, 1045, 1046, 1045, 795, 1046, 1046, 1046, 795, 1046, 1046, 1046, 795, 1046, 795, 1046, 1045, 795, 795, 795, 795, 1046, 1046, 795, 795, 795, 795, 795, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 795, 1046, 795, 1046, 795, 1045, 1046, 1046, 1046, 795, 1046, 795, 1046, 1045, 1059, 801, 1137, 1050, 1059, 801, 1046, 1045, 795, 1138, 1050, 1139, 1059, 801, 1046, 1045, 795, 1046, 795, 1140, 1059, 1047, 1045, 801, 1046, 1045, 795, 1050, 1141, 1047, 1059, 1047, 1045, 1046, 1045, 795, 1142, 1143, 1144, 1142, 1145, 1146, 1147, 1149, 1150, 1151, 1152, 1153, 1154, 670, 670, 419, 1155, 1156, 1157, 1158, 670, 1161, 1162, 1164, 1165, 1166, 1160, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1188, 1189, 1190, 1191, 1192, 1193, 670, 1148, 7, 1148, 419, 1148, 419, 1160, 1163, 1187, 1194, 1159, 1142, 1142, 1195, 1143, 1196, 1198, 1197, 4, 1147, 1200, 1197, 1201, 1197, 2, 1147, 1197, 6, 8, 8, 7, 1202, 1203, 1204, 1197, 1205, 1206, 1197, 1207, 1197, 419, 419, 1209, 1210, 489, 470, 1211, 470, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 544, 1223, 520, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234, 1235, 419, 419, 419, 425, 565, 1208, 1236, 1197, 1237, 1197, 670, 1238, 419, 419, 419, 670, 1238, 670, 670, 419, 1238, 419, 1238, 419, 1238, 419, 670, 670, 670, 670, 670, 1238, 419, 670, 670, 670, 419, 670, 419, 1238, 419, 670, 670, 670, 670, 419, 1238, 670, 419, 670, 419, 670, 419, 670, 670, 419, 670, 1238, 419, 670, 419, 670, 419, 670, 1238, 670, 419, 1238, 670, 419, 670, 419, 1238, 670, 670, 670, 670, 670, 1238, 419, 419, 670, 419, 670, 1238, 670, 419, 1238, 670, 670, 1238, 419, 419, 670, 419, 670, 419, 670, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 715, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1260, 1262, 1263, 1264, 1265, 1266, 671, 1238, 1267, 1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 725, 1286, 1287, 1288, 692, 1289, 1290, 1291, 1292, 1293, 1294, 671, 1295, 1296, 1297, 1298, 1299, 1300, 1301, 1302, 674, 1303, 671, 674, 1304, 1305, 1306, 1307, 683, 1238, 1308, 1309, 1310, 1311, 703, 1312, 1313, 683, 1314, 1315, 1316, 1317, 1318, 671, 1238, 1319, 1278, 1320, 1321, 1322, 683, 1323, 1324, 674, 671, 683, 425, 1238, 1288, 671, 674, 683, 425, 683, 425, 1325, 683, 1238, 425, 674, 1326, 1327, 674, 1328, 1329, 681, 1330, 1331, 1332, 1333, 1334, 1284, 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, 1345, 1346, 1303, 1347, 674, 683, 425, 1238, 1348, 1349, 683, 671, 1238, 425, 671, 1238, 674, 1350, 731, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, 671, 1359, 1360, 1361, 1362, 1363, 1364, 671, 683, 1238, 1366, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1372, 1378, 1379, 1380, 1381, 1365, 1377, 1365, 1238, 1365, 1238, 1382, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1387, 767, 1391, 1391, 1391, 1392, 1391, 1391, 768, 769, 770, 1391, 767, 1382, 1382, 1393, 1396, 1397, 1395, 1398, 1399, 1398, 1400, 1391, 1402, 1401, 1396, 1403, 1395, 1405, 1404, 1394, 1394, 1394, 768, 769, 770, 1394, 767, 767, 1406, 773, 1406, 1407, 1406, 775, 1408, 1409, 1410, 1411, 1412, 1413, 1414, 1411, 776, 775, 1408, 1415, 1415, 777, 779, 1416, 1415, 776, 1418, 1419, 1417, 1418, 1419, 1420, 1417, 775, 1408, 1421, 1415, 775, 1408, 1415, 1423, 1422, 1425, 1424, 776, 1426, 777, 1426, 779, 1426, 785, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1430, 786, 785, 1427, 1434, 1434, 787, 789, 1435, 1434, 786, 1437, 1438, 1436, 1437, 1438, 1439, 1436, 785, 1427, 1440, 1434, 785, 1427, 1434, 1442, 1441, 1444, 1443, 786, 1445, 787, 1445, 789, 1445, 795, 1448, 1449, 1451, 1452, 1453, 1447, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, 1475, 1476, 1477, 1478, 1479, 1480, 795, 795, 1446, 1447, 1450, 1474, 1481, 1446, 1046, 795, 795, 1483, 1484, 865, 846, 1485, 846, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 920, 1497, 896, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 795, 795, 795, 801, 941, 1482, 1046, 1510, 795, 795, 795, 1046, 1510, 1046, 1046, 795, 1510, 795, 1510, 795, 1510, 795, 1046, 1046, 1046, 1046, 1046, 1510, 795, 1046, 1046, 1046, 795, 1046, 795, 1510, 795, 1046, 1046, 1046, 1046, 795, 1510, 1046, 795, 1046, 795, 1046, 795, 1046, 1046, 795, 1046, 1510, 795, 1046, 795, 1046, 795, 1046, 1510, 1046, 795, 1510, 1046, 795, 1046, 795, 1510, 1046, 1046, 1046, 1046, 1046, 1510, 795, 795, 1046, 795, 1046, 1510, 1046, 795, 1510, 1046, 1046, 1510, 795, 795, 1046, 795, 1046, 795, 1046, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1091, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, 1533, 1532, 1534, 1535, 1536, 1537, 1538, 1047, 1510, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1101, 1558, 1559, 1560, 1068, 1561, 1562, 1563, 1564, 1565, 1566, 1047, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1050, 1575, 1047, 1050, 1576, 1577, 1578, 1579, 1059, 1510, 1580, 1581, 1582, 1583, 1079, 1584, 1585, 1059, 1586, 1587, 1588, 1589, 1590, 1047, 1510, 1591, 1550, 1592, 1593, 1594, 1059, 1595, 1596, 1050, 1047, 1059, 801, 1510, 1560, 1047, 1050, 1059, 801, 1059, 801, 1597, 1059, 1510, 801, 1050, 1598, 1599, 1050, 1600, 1601, 1057, 1602, 1603, 1604, 1605, 1606, 1556, 1607, 1608, 1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1575, 1619, 1050, 1059, 801, 1510, 1620, 1621, 1059, 1047, 1510, 801, 1047, 1510, 1050, 1622, 1107, 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, 1047, 1631, 1632, 1633, 1634, 1635, 1636, 1047, 1059, 1510, 1638, 1639, 1640, 1641, 1642, 1643, 1644, 1645, 1646, 1647, 1648, 1644, 1650, 1651, 1652, 1653, 1637, 1649, 1637, 1510, 1637, 1510, } var _hcltok_trans_targs []int16 = []int16{ 1459, 1459, 2, 3, 1459, 1459, 4, 1467, 5, 6, 8, 9, 286, 12, 13, 14, 15, 16, 287, 288, 19, 289, 21, 22, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 328, 348, 353, 127, 128, 129, 356, 151, 371, 375, 1459, 10, 11, 17, 18, 20, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 64, 105, 120, 131, 154, 170, 283, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125, 126, 130, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 171, 203, 227, 230, 231, 233, 242, 243, 246, 250, 268, 275, 277, 279, 281, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 229, 232, 234, 235, 236, 237, 238, 239, 240, 241, 244, 245, 247, 248, 249, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 269, 270, 271, 272, 273, 274, 276, 278, 280, 282, 284, 285, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 349, 350, 351, 352, 354, 355, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 372, 373, 374, 376, 382, 404, 409, 411, 413, 377, 378, 379, 380, 381, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 405, 406, 407, 408, 410, 412, 414, 1459, 1471, 1459, 437, 438, 439, 440, 417, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 419, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 418, 504, 505, 506, 507, 508, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 525, 526, 527, 528, 529, 530, 534, 536, 537, 538, 539, 434, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 556, 557, 559, 560, 561, 562, 563, 564, 432, 565, 566, 567, 568, 569, 570, 571, 572, 573, 575, 607, 631, 634, 635, 637, 646, 647, 650, 654, 672, 532, 679, 681, 683, 685, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 632, 633, 636, 638, 639, 640, 641, 642, 643, 644, 645, 648, 649, 651, 652, 653, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 673, 674, 675, 676, 677, 678, 680, 682, 684, 686, 688, 689, 1459, 1459, 690, 827, 828, 759, 829, 830, 831, 832, 833, 834, 788, 835, 724, 836, 837, 838, 839, 840, 841, 842, 843, 744, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 769, 854, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 702, 866, 867, 868, 869, 870, 871, 872, 873, 874, 740, 875, 876, 877, 878, 879, 810, 881, 882, 885, 887, 888, 889, 890, 891, 892, 895, 896, 898, 899, 900, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 914, 915, 916, 917, 920, 922, 923, 925, 927, 1509, 1510, 929, 930, 931, 1509, 1509, 932, 1523, 1523, 1524, 935, 1523, 936, 1525, 1526, 1529, 1530, 1534, 1534, 1535, 941, 1534, 942, 1536, 1537, 1540, 1541, 1545, 1546, 1545, 968, 969, 970, 971, 948, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 950, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 949, 1035, 1036, 1037, 1038, 1039, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1056, 1057, 1058, 1059, 1060, 1061, 1065, 1067, 1068, 1069, 1070, 965, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1087, 1088, 1090, 1091, 1092, 1093, 1094, 1095, 963, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1106, 1138, 1162, 1165, 1166, 1168, 1177, 1178, 1181, 1185, 1203, 1063, 1210, 1212, 1214, 1216, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, 1152, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161, 1163, 1164, 1167, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1179, 1180, 1182, 1183, 1184, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1204, 1205, 1206, 1207, 1208, 1209, 1211, 1213, 1215, 1217, 1219, 1220, 1545, 1545, 1221, 1358, 1359, 1290, 1360, 1361, 1362, 1363, 1364, 1365, 1319, 1366, 1255, 1367, 1368, 1369, 1370, 1371, 1372, 1373, 1374, 1275, 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, 1383, 1384, 1300, 1385, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1233, 1397, 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, 1271, 1406, 1407, 1408, 1409, 1410, 1341, 1412, 1413, 1416, 1418, 1419, 1420, 1421, 1422, 1423, 1426, 1427, 1429, 1430, 1431, 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1445, 1446, 1447, 1448, 1451, 1453, 1454, 1456, 1458, 1460, 1459, 1461, 1462, 1459, 1463, 1459, 1464, 1465, 1466, 1468, 1469, 1470, 1459, 1472, 1459, 1473, 1459, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1459, 1459, 1459, 1459, 1459, 1459, 1, 1459, 7, 1459, 1459, 1459, 1459, 1459, 415, 416, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 433, 435, 436, 468, 509, 524, 531, 533, 535, 555, 558, 574, 687, 1459, 1459, 1459, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 741, 742, 743, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 760, 761, 762, 763, 764, 765, 766, 767, 768, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 855, 880, 883, 884, 886, 893, 894, 897, 901, 913, 918, 919, 921, 924, 926, 1511, 1509, 1512, 1517, 1519, 1509, 1520, 1521, 1522, 1509, 928, 1509, 1509, 1513, 1514, 1516, 1509, 1515, 1509, 1509, 1509, 1518, 1509, 1509, 1509, 933, 934, 938, 939, 1523, 1531, 1532, 1533, 1523, 937, 1523, 1523, 934, 1527, 1528, 1523, 1523, 1523, 1523, 1523, 940, 944, 945, 1534, 1542, 1543, 1544, 1534, 943, 1534, 1534, 940, 1538, 1539, 1534, 1534, 1534, 1534, 1534, 1545, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578, 1579, 1580, 1581, 1545, 946, 947, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 964, 966, 967, 999, 1040, 1055, 1062, 1064, 1066, 1086, 1089, 1105, 1218, 1545, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1234, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270, 1272, 1273, 1274, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1291, 1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1318, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, 1340, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1386, 1411, 1414, 1415, 1417, 1424, 1425, 1428, 1432, 1444, 1449, 1450, 1452, 1455, 1457, } var _hcltok_trans_actions []byte = []byte{ 145, 107, 0, 0, 91, 141, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 193, 149, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 147, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 169, 0, 0, 0, 35, 33, 0, 55, 41, 175, 0, 53, 0, 175, 175, 0, 0, 75, 61, 181, 0, 73, 0, 181, 181, 0, 0, 85, 187, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, 119, 0, 111, 0, 7, 7, 7, 0, 0, 113, 0, 115, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 196, 196, 196, 196, 196, 196, 7, 7, 196, 7, 127, 139, 135, 97, 133, 103, 0, 129, 0, 101, 95, 109, 99, 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 117, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 172, 17, 0, 7, 7, 23, 0, 25, 27, 0, 0, 0, 151, 0, 15, 19, 9, 0, 21, 11, 29, 0, 0, 0, 0, 43, 0, 178, 178, 49, 0, 157, 154, 1, 175, 175, 45, 37, 47, 39, 51, 0, 0, 0, 63, 0, 184, 184, 69, 0, 163, 160, 1, 181, 181, 65, 57, 67, 59, 71, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 7, 190, 190, 190, 190, 190, 190, 7, 7, 190, 7, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } var _hcltok_to_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } var _hcltok_from_state_actions []byte = []byte{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } var _hcltok_eof_trans []int16 = []int16{ 0, 1, 1, 1, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 419, 419, 421, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 670, 767, 772, 772, 772, 773, 773, 775, 775, 775, 779, 0, 0, 785, 785, 785, 789, 0, 0, 795, 795, 797, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, 0, 1196, 1197, 1198, 1200, 1198, 1198, 1198, 1203, 1198, 1198, 1198, 1209, 1198, 1198, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 1239, 0, 1392, 1394, 1395, 1399, 1399, 1392, 1402, 1395, 1405, 1395, 1407, 1407, 1407, 0, 1416, 1418, 1418, 1416, 1416, 1423, 1425, 1427, 1427, 1427, 0, 1435, 1437, 1437, 1435, 1435, 1442, 1444, 1446, 1446, 1446, 0, 1483, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, 1511, } const hcltok_start int = 1459 const hcltok_first_final int = 1459 const hcltok_error int = 0 const hcltok_en_stringTemplate int = 1509 const hcltok_en_heredocTemplate int = 1523 const hcltok_en_bareTemplate int = 1534 const hcltok_en_identOnly int = 1545 const hcltok_en_main int = 1459 //line scan_tokens.rl:16 func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []Token { stripData := stripUTF8BOM(data) start.Byte += len(data) - len(stripData) data = stripData f := &tokenAccum{ Filename: filename, Bytes: data, Pos: start, StartByte: start.Byte, } //line scan_tokens.rl:305 // Ragel state p := 0 // "Pointer" into data pe := len(data) // End-of-data "pointer" ts := 0 te := 0 act := 0 eof := pe var stack []int var top int var cs int // current state switch mode { case scanNormal: cs = hcltok_en_main case scanTemplate: cs = hcltok_en_bareTemplate case scanIdentOnly: cs = hcltok_en_identOnly default: panic("invalid scanMode") } braces := 0 var retBraces []int // stack of brace levels that cause us to use fret var heredocs []heredocInProgress // stack of heredocs we're currently processing //line scan_tokens.rl:340 // Make Go compiler happy _ = ts _ = te _ = act _ = eof token := func(ty TokenType) { f.emitToken(ty, ts, te) } selfToken := func() { b := data[ts:te] if len(b) != 1 { // should never happen panic("selfToken only works for single-character tokens") } f.emitToken(TokenType(b[0]), ts, te) } //line scan_tokens.go:4289 { top = 0 ts = 0 te = 0 act = 0 } //line scan_tokens.go:4297 { var _klen int var _trans int var _acts int var _nacts uint var _keys int if p == pe { goto _test_eof } if cs == 0 { goto _out } _resume: _acts = int(_hcltok_from_state_actions[cs]) _nacts = uint(_hcltok_actions[_acts]) _acts++ for ; _nacts > 0; _nacts-- { _acts++ switch _hcltok_actions[_acts-1] { case 3: //line NONE:1 ts = p //line scan_tokens.go:4320 } } _keys = int(_hcltok_key_offsets[cs]) _trans = int(_hcltok_index_offsets[cs]) _klen = int(_hcltok_single_lengths[cs]) if _klen > 0 { _lower := int(_keys) var _mid int _upper := int(_keys + _klen - 1) for { if _upper < _lower { break } _mid = _lower + ((_upper - _lower) >> 1) switch { case data[p] < _hcltok_trans_keys[_mid]: _upper = _mid - 1 case data[p] > _hcltok_trans_keys[_mid]: _lower = _mid + 1 default: _trans += int(_mid - int(_keys)) goto _match } } _keys += _klen _trans += _klen } _klen = int(_hcltok_range_lengths[cs]) if _klen > 0 { _lower := int(_keys) var _mid int _upper := int(_keys + (_klen << 1) - 2) for { if _upper < _lower { break } _mid = _lower + (((_upper - _lower) >> 1) & ^1) switch { case data[p] < _hcltok_trans_keys[_mid]: _upper = _mid - 2 case data[p] > _hcltok_trans_keys[_mid+1]: _lower = _mid + 2 default: _trans += int((_mid - int(_keys)) >> 1) goto _match } } _trans += _klen } _match: _trans = int(_hcltok_indicies[_trans]) _eof_trans: cs = int(_hcltok_trans_targs[_trans]) if _hcltok_trans_actions[_trans] == 0 { goto _again } _acts = int(_hcltok_trans_actions[_trans]) _nacts = uint(_hcltok_actions[_acts]) _acts++ for ; _nacts > 0; _nacts-- { _acts++ switch _hcltok_actions[_acts-1] { case 0: //line scan_tokens.rl:224 p-- case 4: //line NONE:1 te = p + 1 case 5: //line scan_tokens.rl:248 act = 4 case 6: //line scan_tokens.rl:250 act = 6 case 7: //line scan_tokens.rl:160 te = p + 1 { token(TokenTemplateInterp) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 8: //line scan_tokens.rl:170 te = p + 1 { token(TokenTemplateControl) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 9: //line scan_tokens.rl:84 te = p + 1 { token(TokenCQuote) top-- cs = stack[top] { stack = stack[:len(stack)-1] } goto _again } case 10: //line scan_tokens.rl:248 te = p + 1 { token(TokenQuotedLit) } case 11: //line scan_tokens.rl:251 te = p + 1 { token(TokenBadUTF8) } case 12: //line scan_tokens.rl:160 te = p p-- { token(TokenTemplateInterp) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 13: //line scan_tokens.rl:170 te = p p-- { token(TokenTemplateControl) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 14: //line scan_tokens.rl:248 te = p p-- { token(TokenQuotedLit) } case 15: //line scan_tokens.rl:249 te = p p-- { token(TokenQuotedNewline) } case 16: //line scan_tokens.rl:250 te = p p-- { token(TokenInvalid) } case 17: //line scan_tokens.rl:251 te = p p-- { token(TokenBadUTF8) } case 18: //line scan_tokens.rl:248 p = (te) - 1 { token(TokenQuotedLit) } case 19: //line scan_tokens.rl:251 p = (te) - 1 { token(TokenBadUTF8) } case 20: //line NONE:1 switch act { case 4: { p = (te) - 1 token(TokenQuotedLit) } case 6: { p = (te) - 1 token(TokenInvalid) } } case 21: //line scan_tokens.rl:148 act = 11 case 22: //line scan_tokens.rl:259 act = 12 case 23: //line scan_tokens.rl:160 te = p + 1 { token(TokenTemplateInterp) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 24: //line scan_tokens.rl:170 te = p + 1 { token(TokenTemplateControl) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 25: //line scan_tokens.rl:111 te = p + 1 { // This action is called specificially when a heredoc literal // ends with a newline character. // This might actually be our end marker. topdoc := &heredocs[len(heredocs)-1] if topdoc.StartOfLine { maybeMarker := bytes.TrimSpace(data[ts:te]) if bytes.Equal(maybeMarker, topdoc.Marker) { // We actually emit two tokens here: the end-of-heredoc // marker first, and then separately the newline that // follows it. This then avoids issues with the closing // marker consuming a newline that would normally be used // to mark the end of an attribute definition. // We might have either a \n sequence or an \r\n sequence // here, so we must handle both. nls := te - 1 nle := te te-- if data[te-1] == '\r' { // back up one more byte nls-- te-- } token(TokenCHeredoc) ts = nls te = nle token(TokenNewline) heredocs = heredocs[:len(heredocs)-1] top-- cs = stack[top] { stack = stack[:len(stack)-1] } goto _again } } topdoc.StartOfLine = true token(TokenStringLit) } case 26: //line scan_tokens.rl:259 te = p + 1 { token(TokenBadUTF8) } case 27: //line scan_tokens.rl:160 te = p p-- { token(TokenTemplateInterp) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 28: //line scan_tokens.rl:170 te = p p-- { token(TokenTemplateControl) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 29: //line scan_tokens.rl:148 te = p p-- { // This action is called when a heredoc literal _doesn't_ end // with a newline character, e.g. because we're about to enter // an interpolation sequence. heredocs[len(heredocs)-1].StartOfLine = false token(TokenStringLit) } case 30: //line scan_tokens.rl:259 te = p p-- { token(TokenBadUTF8) } case 31: //line scan_tokens.rl:148 p = (te) - 1 { // This action is called when a heredoc literal _doesn't_ end // with a newline character, e.g. because we're about to enter // an interpolation sequence. heredocs[len(heredocs)-1].StartOfLine = false token(TokenStringLit) } case 32: //line NONE:1 switch act { case 0: { cs = 0 goto _again } case 11: { p = (te) - 1 // This action is called when a heredoc literal _doesn't_ end // with a newline character, e.g. because we're about to enter // an interpolation sequence. heredocs[len(heredocs)-1].StartOfLine = false token(TokenStringLit) } case 12: { p = (te) - 1 token(TokenBadUTF8) } } case 33: //line scan_tokens.rl:156 act = 15 case 34: //line scan_tokens.rl:266 act = 16 case 35: //line scan_tokens.rl:160 te = p + 1 { token(TokenTemplateInterp) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 36: //line scan_tokens.rl:170 te = p + 1 { token(TokenTemplateControl) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 37: //line scan_tokens.rl:156 te = p + 1 { token(TokenStringLit) } case 38: //line scan_tokens.rl:266 te = p + 1 { token(TokenBadUTF8) } case 39: //line scan_tokens.rl:160 te = p p-- { token(TokenTemplateInterp) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 40: //line scan_tokens.rl:170 te = p p-- { token(TokenTemplateControl) braces++ retBraces = append(retBraces, braces) if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false } { stack = append(stack, 0) stack[top] = cs top++ cs = 1459 goto _again } } case 41: //line scan_tokens.rl:156 te = p p-- { token(TokenStringLit) } case 42: //line scan_tokens.rl:266 te = p p-- { token(TokenBadUTF8) } case 43: //line scan_tokens.rl:156 p = (te) - 1 { token(TokenStringLit) } case 44: //line NONE:1 switch act { case 0: { cs = 0 goto _again } case 15: { p = (te) - 1 token(TokenStringLit) } case 16: { p = (te) - 1 token(TokenBadUTF8) } } case 45: //line scan_tokens.rl:270 act = 17 case 46: //line scan_tokens.rl:271 act = 18 case 47: //line scan_tokens.rl:271 te = p + 1 { token(TokenBadUTF8) } case 48: //line scan_tokens.rl:272 te = p + 1 { token(TokenInvalid) } case 49: //line scan_tokens.rl:270 te = p p-- { token(TokenIdent) } case 50: //line scan_tokens.rl:271 te = p p-- { token(TokenBadUTF8) } case 51: //line scan_tokens.rl:270 p = (te) - 1 { token(TokenIdent) } case 52: //line scan_tokens.rl:271 p = (te) - 1 { token(TokenBadUTF8) } case 53: //line NONE:1 switch act { case 17: { p = (te) - 1 token(TokenIdent) } case 18: { p = (te) - 1 token(TokenBadUTF8) } } case 54: //line scan_tokens.rl:278 act = 22 case 55: //line scan_tokens.rl:301 act = 39 case 56: //line scan_tokens.rl:280 te = p + 1 { token(TokenComment) } case 57: //line scan_tokens.rl:281 te = p + 1 { token(TokenNewline) } case 58: //line scan_tokens.rl:283 te = p + 1 { token(TokenEqualOp) } case 59: //line scan_tokens.rl:284 te = p + 1 { token(TokenNotEqual) } case 60: //line scan_tokens.rl:285 te = p + 1 { token(TokenGreaterThanEq) } case 61: //line scan_tokens.rl:286 te = p + 1 { token(TokenLessThanEq) } case 62: //line scan_tokens.rl:287 te = p + 1 { token(TokenAnd) } case 63: //line scan_tokens.rl:288 te = p + 1 { token(TokenOr) } case 64: //line scan_tokens.rl:289 te = p + 1 { token(TokenEllipsis) } case 65: //line scan_tokens.rl:290 te = p + 1 { token(TokenFatArrow) } case 66: //line scan_tokens.rl:291 te = p + 1 { selfToken() } case 67: //line scan_tokens.rl:180 te = p + 1 { token(TokenOBrace) braces++ } case 68: //line scan_tokens.rl:185 te = p + 1 { if len(retBraces) > 0 && retBraces[len(retBraces)-1] == braces { token(TokenTemplateSeqEnd) braces-- retBraces = retBraces[0 : len(retBraces)-1] top-- cs = stack[top] { stack = stack[:len(stack)-1] } goto _again } else { token(TokenCBrace) braces-- } } case 69: //line scan_tokens.rl:197 te = p + 1 { // Only consume from the retBraces stack and return if we are at // a suitable brace nesting level, otherwise things will get // confused. (Not entering this branch indicates a syntax error, // which we will catch in the parser.) if len(retBraces) > 0 && retBraces[len(retBraces)-1] == braces { token(TokenTemplateSeqEnd) braces-- retBraces = retBraces[0 : len(retBraces)-1] top-- cs = stack[top] { stack = stack[:len(stack)-1] } goto _again } else { // We intentionally generate a TokenTemplateSeqEnd here, // even though the user apparently wanted a brace, because // we want to allow the parser to catch the incorrect use // of a ~} to balance a generic opening brace, rather than // a template sequence. token(TokenTemplateSeqEnd) braces-- } } case 70: //line scan_tokens.rl:79 te = p + 1 { token(TokenOQuote) { stack = append(stack, 0) stack[top] = cs top++ cs = 1509 goto _again } } case 71: //line scan_tokens.rl:89 te = p + 1 { token(TokenOHeredoc) // the token is currently the whole heredoc introducer, like // <<EOT or <<-EOT, followed by a newline. We want to extract // just the "EOT" portion that we'll use as the closing marker. marker := data[ts+2 : te-1] if marker[0] == '-' { marker = marker[1:] } if marker[len(marker)-1] == '\r' { marker = marker[:len(marker)-1] } heredocs = append(heredocs, heredocInProgress{ Marker: marker, StartOfLine: true, }) { stack = append(stack, 0) stack[top] = cs top++ cs = 1523 goto _again } } case 72: //line scan_tokens.rl:301 te = p + 1 { token(TokenBadUTF8) } case 73: //line scan_tokens.rl:302 te = p + 1 { token(TokenInvalid) } case 74: //line scan_tokens.rl:276 te = p p-- case 75: //line scan_tokens.rl:277 te = p p-- { token(TokenNumberLit) } case 76: //line scan_tokens.rl:278 te = p p-- { token(TokenIdent) } case 77: //line scan_tokens.rl:280 te = p p-- { token(TokenComment) } case 78: //line scan_tokens.rl:291 te = p p-- { selfToken() } case 79: //line scan_tokens.rl:301 te = p p-- { token(TokenBadUTF8) } case 80: //line scan_tokens.rl:302 te = p p-- { token(TokenInvalid) } case 81: //line scan_tokens.rl:277 p = (te) - 1 { token(TokenNumberLit) } case 82: //line scan_tokens.rl:278 p = (te) - 1 { token(TokenIdent) } case 83: //line scan_tokens.rl:291 p = (te) - 1 { selfToken() } case 84: //line scan_tokens.rl:301 p = (te) - 1 { token(TokenBadUTF8) } case 85: //line NONE:1 switch act { case 22: { p = (te) - 1 token(TokenIdent) } case 39: { p = (te) - 1 token(TokenBadUTF8) } } //line scan_tokens.go:5055 } } _again: _acts = int(_hcltok_to_state_actions[cs]) _nacts = uint(_hcltok_actions[_acts]) _acts++ for ; _nacts > 0; _nacts-- { _acts++ switch _hcltok_actions[_acts-1] { case 1: //line NONE:1 ts = 0 case 2: //line NONE:1 act = 0 //line scan_tokens.go:5073 } } if cs == 0 { goto _out } p++ if p != pe { goto _resume } _test_eof: { } if p == eof { if _hcltok_eof_trans[cs] > 0 { _trans = int(_hcltok_eof_trans[cs] - 1) goto _eof_trans } } _out: { } } //line scan_tokens.rl:363 // If we fall out here without being in a final state then we've // encountered something that the scanner can't match, which we'll // deal with as an invalid. if cs < hcltok_first_final { if mode == scanTemplate && len(stack) == 0 { // If we're scanning a bare template then any straggling // top-level stuff is actually literal string, rather than // invalid. This handles the case where the template ends // with a single "$" or "%", which trips us up because we // want to see another character to decide if it's a sequence // or an escape. f.emitToken(TokenStringLit, ts, len(data)) } else { f.emitToken(TokenInvalid, ts, len(data)) } } // We always emit a synthetic EOF token at the end, since it gives the // parser position information for an "unexpected EOF" diagnostic. f.emitToken(TokenEOF, len(data), len(data)) return f.Tokens } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl������������������������0000664�0000000�0000000�00000032550�13771713062�0026764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ package hclsyntax import ( "bytes" "github.com/hashicorp/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. %%{ # (except when you are actually in scan_tokens.rl here, so edit away!) machine hcltok; write data; }%% func scanTokens(data []byte, filename string, start hcl.Pos, mode scanMode) []Token { stripData := stripUTF8BOM(data) start.Byte += len(data) - len(stripData) data = stripData f := &tokenAccum{ Filename: filename, Bytes: data, Pos: start, StartByte: start.Byte, } %%{ include UnicodeDerived "unicode_derived.rl"; UTF8Cont = 0x80 .. 0xBF; AnyUTF8 = ( 0x00..0x7F | 0xC0..0xDF . UTF8Cont | 0xE0..0xEF . UTF8Cont . UTF8Cont | 0xF0..0xF7 . UTF8Cont . UTF8Cont . UTF8Cont ); BrokenUTF8 = any - AnyUTF8; NumberLitContinue = (digit|'.'|('e'|'E') ('+'|'-')? digit); NumberLit = digit ("" | (NumberLitContinue - '.') | (NumberLitContinue* (NumberLitContinue - '.'))); Ident = (ID_Start | '_') (ID_Continue | '-')*; # Symbols that just represent themselves are handled as a single rule. SelfToken = "[" | "]" | "(" | ")" | "." | "," | "*" | "/" | "%" | "+" | "-" | "=" | "<" | ">" | "!" | "?" | ":" | "\n" | "&" | "|" | "~" | "^" | ";" | "`" | "'"; EqualOp = "=="; NotEqual = "!="; GreaterThanEqual = ">="; LessThanEqual = "<="; LogicalAnd = "&&"; LogicalOr = "||"; Ellipsis = "..."; FatArrow = "=>"; Newline = '\r' ? '\n'; EndOfLine = Newline; BeginStringTmpl = '"'; BeginHeredocTmpl = '<<' ('-')? Ident Newline; Comment = ( # The :>> operator in these is a "finish-guarded concatenation", # which terminates the sequence on its left when it completes # the sequence on its right. # In the single-line comment cases this is allowing us to make # the trailing EndOfLine optional while still having the overall # pattern terminate. In the multi-line case it ensures that # the first comment in the file ends at the first */, rather than # gobbling up all of the "any*" until the _final_ */ in the file. ("#" (any - EndOfLine)* :>> EndOfLine?) | ("//" (any - EndOfLine)* :>> EndOfLine?) | ("/*" any* :>> "*/") ); # Note: hclwrite assumes that only ASCII spaces appear between tokens, # and uses this assumption to recreate the spaces between tokens by # looking at byte offset differences. This means it will produce # incorrect results in the presence of tabs, but that's acceptable # because the canonical style (which hclwrite itself can impose # automatically is to never use tabs). Spaces = (' ' | 0x09)+; action beginStringTemplate { token(TokenOQuote); fcall stringTemplate; } action endStringTemplate { token(TokenCQuote); fret; } action beginHeredocTemplate { token(TokenOHeredoc); // the token is currently the whole heredoc introducer, like // <<EOT or <<-EOT, followed by a newline. We want to extract // just the "EOT" portion that we'll use as the closing marker. marker := data[ts+2:te-1] if marker[0] == '-' { marker = marker[1:] } if marker[len(marker)-1] == '\r' { marker = marker[:len(marker)-1] } heredocs = append(heredocs, heredocInProgress{ Marker: marker, StartOfLine: true, }) fcall heredocTemplate; } action heredocLiteralEOL { // This action is called specificially when a heredoc literal // ends with a newline character. // This might actually be our end marker. topdoc := &heredocs[len(heredocs)-1] if topdoc.StartOfLine { maybeMarker := bytes.TrimSpace(data[ts:te]) if bytes.Equal(maybeMarker, topdoc.Marker) { // We actually emit two tokens here: the end-of-heredoc // marker first, and then separately the newline that // follows it. This then avoids issues with the closing // marker consuming a newline that would normally be used // to mark the end of an attribute definition. // We might have either a \n sequence or an \r\n sequence // here, so we must handle both. nls := te-1 nle := te te-- if data[te-1] == '\r' { // back up one more byte nls-- te-- } token(TokenCHeredoc); ts = nls te = nle token(TokenNewline); heredocs = heredocs[:len(heredocs)-1] fret; } } topdoc.StartOfLine = true; token(TokenStringLit); } action heredocLiteralMidline { // This action is called when a heredoc literal _doesn't_ end // with a newline character, e.g. because we're about to enter // an interpolation sequence. heredocs[len(heredocs)-1].StartOfLine = false; token(TokenStringLit); } action bareTemplateLiteral { token(TokenStringLit); } action beginTemplateInterp { token(TokenTemplateInterp); braces++; retBraces = append(retBraces, braces); if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false; } fcall main; } action beginTemplateControl { token(TokenTemplateControl); braces++; retBraces = append(retBraces, braces); if len(heredocs) > 0 { heredocs[len(heredocs)-1].StartOfLine = false; } fcall main; } action openBrace { token(TokenOBrace); braces++; } action closeBrace { if len(retBraces) > 0 && retBraces[len(retBraces)-1] == braces { token(TokenTemplateSeqEnd); braces--; retBraces = retBraces[0:len(retBraces)-1] fret; } else { token(TokenCBrace); braces--; } } action closeTemplateSeqEatWhitespace { // Only consume from the retBraces stack and return if we are at // a suitable brace nesting level, otherwise things will get // confused. (Not entering this branch indicates a syntax error, // which we will catch in the parser.) if len(retBraces) > 0 && retBraces[len(retBraces)-1] == braces { token(TokenTemplateSeqEnd); braces--; retBraces = retBraces[0:len(retBraces)-1] fret; } else { // We intentionally generate a TokenTemplateSeqEnd here, // even though the user apparently wanted a brace, because // we want to allow the parser to catch the incorrect use // of a ~} to balance a generic opening brace, rather than // a template sequence. token(TokenTemplateSeqEnd); braces--; } } TemplateInterp = "${" ("~")?; TemplateControl = "%{" ("~")?; EndStringTmpl = '"'; NewlineChars = ("\r"|"\n"); NewlineCharsSeq = NewlineChars+; StringLiteralChars = (AnyUTF8 - NewlineChars); TemplateIgnoredNonBrace = (^'{' %{ fhold; }); TemplateNotInterp = '$' (TemplateIgnoredNonBrace | TemplateInterp); TemplateNotControl = '%' (TemplateIgnoredNonBrace | TemplateControl); QuotedStringLiteralWithEsc = ('\\' StringLiteralChars) | (StringLiteralChars - ("$" | '%' | '"' | "\\")); TemplateStringLiteral = ( (TemplateNotInterp) | (TemplateNotControl) | (QuotedStringLiteralWithEsc)+ ); HeredocStringLiteral = ( (TemplateNotInterp) | (TemplateNotControl) | (StringLiteralChars - ("$" | '%'))* ); BareStringLiteral = ( (TemplateNotInterp) | (TemplateNotControl) | (StringLiteralChars - ("$" | '%'))* ) Newline?; stringTemplate := |* TemplateInterp => beginTemplateInterp; TemplateControl => beginTemplateControl; EndStringTmpl => endStringTemplate; TemplateStringLiteral => { token(TokenQuotedLit); }; NewlineCharsSeq => { token(TokenQuotedNewline); }; AnyUTF8 => { token(TokenInvalid); }; BrokenUTF8 => { token(TokenBadUTF8); }; *|; heredocTemplate := |* TemplateInterp => beginTemplateInterp; TemplateControl => beginTemplateControl; HeredocStringLiteral EndOfLine => heredocLiteralEOL; HeredocStringLiteral => heredocLiteralMidline; BrokenUTF8 => { token(TokenBadUTF8); }; *|; bareTemplate := |* TemplateInterp => beginTemplateInterp; TemplateControl => beginTemplateControl; BareStringLiteral => bareTemplateLiteral; BrokenUTF8 => { token(TokenBadUTF8); }; *|; identOnly := |* Ident => { token(TokenIdent) }; BrokenUTF8 => { token(TokenBadUTF8) }; AnyUTF8 => { token(TokenInvalid) }; *|; main := |* Spaces => {}; NumberLit => { token(TokenNumberLit) }; Ident => { token(TokenIdent) }; Comment => { token(TokenComment) }; Newline => { token(TokenNewline) }; EqualOp => { token(TokenEqualOp); }; NotEqual => { token(TokenNotEqual); }; GreaterThanEqual => { token(TokenGreaterThanEq); }; LessThanEqual => { token(TokenLessThanEq); }; LogicalAnd => { token(TokenAnd); }; LogicalOr => { token(TokenOr); }; Ellipsis => { token(TokenEllipsis); }; FatArrow => { token(TokenFatArrow); }; SelfToken => { selfToken() }; "{" => openBrace; "}" => closeBrace; "~}" => closeTemplateSeqEatWhitespace; BeginStringTmpl => beginStringTemplate; BeginHeredocTmpl => beginHeredocTemplate; BrokenUTF8 => { token(TokenBadUTF8) }; AnyUTF8 => { token(TokenInvalid) }; *|; }%% // Ragel state p := 0 // "Pointer" into data pe := len(data) // End-of-data "pointer" ts := 0 te := 0 act := 0 eof := pe var stack []int var top int var cs int // current state switch mode { case scanNormal: cs = hcltok_en_main case scanTemplate: cs = hcltok_en_bareTemplate case scanIdentOnly: cs = hcltok_en_identOnly default: panic("invalid scanMode") } braces := 0 var retBraces []int // stack of brace levels that cause us to use fret var heredocs []heredocInProgress // stack of heredocs we're currently processing %%{ prepush { stack = append(stack, 0); } postpop { stack = stack[:len(stack)-1]; } }%% // Make Go compiler happy _ = ts _ = te _ = act _ = eof token := func (ty TokenType) { f.emitToken(ty, ts, te) } selfToken := func () { b := data[ts:te] if len(b) != 1 { // should never happen panic("selfToken only works for single-character tokens") } f.emitToken(TokenType(b[0]), ts, te) } %%{ write init nocs; write exec; }%% // If we fall out here without being in a final state then we've // encountered something that the scanner can't match, which we'll // deal with as an invalid. if cs < hcltok_first_final { if mode == scanTemplate && len(stack) == 0 { // If we're scanning a bare template then any straggling // top-level stuff is actually literal string, rather than // invalid. This handles the case where the template ends // with a single "$" or "%", which trips us up because we // want to see another character to decide if it's a sequence // or an escape. f.emitToken(TokenStringLit, ts, len(data)) } else { f.emitToken(TokenInvalid, ts, len(data)) } } // We always emit a synthetic EOF token at the end, since it gives the // parser position information for an "unexpected EOF" diagnostic. f.emitToken(TokenEOF, len(data), len(data)) return f.Tokens } ��������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md�������������������������������0000664�0000000�0000000�00000107172�13771713062�0025375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL Native Syntax Specification This is the specification of the syntax and semantics of the native syntax for HCL. HCL is a system for defining configuration languages for applications. The HCL information model is designed to support multiple concrete syntaxes for configuration, but this native syntax is considered the primary format and is optimized for human authoring and maintenance, as opposed to machine generation of configuration. The language consists of three integrated sub-languages: - The _structural_ language defines the overall hierarchical configuration structure, and is a serialization of HCL bodies, blocks and attributes. - The _expression_ language is used to express attribute values, either as literals or as derivations of other values. - The _template_ language is used to compose values together into strings, as one of several types of expression in the expression language. In normal use these three sub-languages are used together within configuration files to describe an overall configuration, with the structural language being used at the top level. The expression and template languages can also be used in isolation, to implement features such as REPLs, debuggers, and integration into more limited HCL syntaxes such as the JSON profile. ## Syntax Notation Within this specification a semi-formal notation is used to illustrate the details of syntax. This notation is intended for human consumption rather than machine consumption, with the following conventions: - A naked name starting with an uppercase letter is a global production, common to all of the syntax specifications in this document. - A naked name starting with a lowercase letter is a local production, meaningful only within the specification where it is defined. - Double and single quotes (`"` and `'`) are used to mark literal character sequences, which may be either punctuation markers or keywords. - The default operator for combining items, which has no punctuation, is concatenation. - The symbol `|` indicates that any one of its left and right operands may be present. - The `*` symbol indicates zero or more repetitions of the item to its left. - The `?` symbol indicates zero or one of the item to its left. - Parentheses (`(` and `)`) are used to group items together to apply the `|`, `*` and `?` operators to them collectively. The grammar notation does not fully describe the language. The prose may augment or conflict with the illustrated grammar. In case of conflict, prose has priority. ## Source Code Representation Source code is unicode text expressed in the UTF-8 encoding. The language itself does not perform unicode normalization, so syntax features such as identifiers are sequences of unicode code points and so e.g. a precombined accented character is distinct from a letter associated with a combining accent. (String literals have some special handling with regard to Unicode normalization which will be covered later in the relevant section.) UTF-8 encoded Unicode byte order marks are not permitted. Invalid or non-normalized UTF-8 encoding is always a parse error. ## Lexical Elements ### Comments and Whitespace Comments and Whitespace are recognized as lexical elements but are ignored except as described below. Whitespace is defined as a sequence of zero or more space characters (U+0020). Newline sequences (either U+000A or U+000D followed by U+000A) are _not_ considered whitespace but are ignored as such in certain contexts. Horizontal tab characters (U+0009) are also treated as whitespace, but are counted only as one "column" for the purpose of reporting source positions. Comments serve as program documentation and come in two forms: - _Line comments_ start with either the `//` or `#` sequences and end with the next newline sequence. A line comment is considered equivalent to a newline sequence. - _Inline comments_ start with the `/*` sequence and end with the `*/` sequence, and may have any characters within except the ending sequence. An inline comments is considered equivalent to a whitespace sequence. Comments and whitespace cannot begin within within other comments, or within template literals except inside an interpolation sequence or template directive. ### Identifiers Identifiers name entities such as blocks, attributes and expression variables. Identifiers are interpreted as per [UAX #31][uax31] Section 2. Specifically, their syntax is defined in terms of the `ID_Start` and `ID_Continue` character properties as follows: ```ebnf Identifier = ID_Start (ID_Continue | '-')*; ``` The Unicode specification provides the normative requirements for identifier parsing. Non-normatively, the spirit of this specification is that `ID_Start` consists of Unicode letter and certain unambiguous punctuation tokens, while `ID_Continue` augments that set with Unicode digits, combining marks, etc. The dash character `-` is additionally allowed in identifiers, even though that is not part of the unicode `ID_Continue` definition. This is to allow attribute names and block type names to contain dashes, although underscores as word separators are considered the idiomatic usage. [uax31]: http://unicode.org/reports/tr31/ "Unicode Identifier and Pattern Syntax" ### Keywords There are no globally-reserved words, but in some contexts certain identifiers are reserved to function as keywords. These are discussed further in the relevant documentation sections that follow. In such situations, the identifier's role as a keyword supersedes any other valid interpretation that may be possible. Outside of these specific situations, the keywords have no special meaning and are interpreted as regular identifiers. ### Operators and Delimiters The following character sequences represent operators, delimiters, and other special tokens: ``` + && == < : { [ ( ${ - || != > ? } ] ) %{ * ! <= = . / >= => , % ... ``` ### Numeric Literals A numeric literal is a decimal representation of a real number. It has an integer part, a fractional part, and an exponent part. ```ebnf NumericLit = decimal+ ("." decimal+)? (expmark decimal+)?; decimal = '0' .. '9'; expmark = ('e' | 'E') ("+" | "-")?; ``` ## Structural Elements The structural language consists of syntax representing the following constructs: - _Attributes_, which assign a value to a specified name. - _Blocks_, which create a child body annotated by a type and optional labels. - _Body Content_, which consists of a collection of attributes and blocks. These constructs correspond to the similarly-named concepts in the language-agnostic HCL information model. ```ebnf ConfigFile = Body; Body = (Attribute | Block | OneLineBlock)*; Attribute = Identifier "=" Expression Newline; Block = Identifier (StringLit|Identifier)* "{" Newline Body "}" Newline; OneLineBlock = Identifier (StringLit|Identifier)* "{" (Identifier "=" Expression)? "}" Newline; ``` ### Configuration Files A _configuration file_ is a sequence of characters whose top-level is interpreted as a Body. ### Bodies A _body_ is a collection of associated attributes and blocks. The meaning of this association is defined by the calling application. ### Attribute Definitions An _attribute definition_ assigns a value to a particular attribute name within a body. Each distinct attribute name may be defined no more than once within a single body. The attribute value is given as an expression, which is retained literally for later evaluation by the calling application. ### Blocks A _block_ creates a child body that is annotated with a block _type_ and zero or more block _labels_. Blocks create a structural hierarchy which can be interpreted by the calling application. Block labels can either be quoted literal strings or naked identifiers. ## Expressions The expression sub-language is used within attribute definitions to specify values. ```ebnf Expression = ( ExprTerm | Operation | Conditional ); ``` ### Types The value types used within the expression language are those defined by the syntax-agnostic HCL information model. An expression may return any valid type, but only a subset of the available types have first-class syntax. A calling application may make other types available via _variables_ and _functions_. ### Expression Terms Expression _terms_ are the operands for unary and binary expressions, as well as acting as expressions in their own right. ```ebnf ExprTerm = ( LiteralValue | CollectionValue | TemplateExpr | VariableExpr | FunctionCall | ForExpr | ExprTerm Index | ExprTerm GetAttr | ExprTerm Splat | "(" Expression ")" ); ``` The productions for these different term types are given in their corresponding sections. Between the `(` and `)` characters denoting a sub-expression, newline characters are ignored as whitespace. ### Literal Values A _literal value_ immediately represents a particular value of a primitive type. ```ebnf LiteralValue = ( NumericLit | "true" | "false" | "null" ); ``` - Numeric literals represent values of type _number_. - The `true` and `false` keywords represent values of type _bool_. - The `null` keyword represents a null value of the dynamic pseudo-type. String literals are not directly available in the expression sub-language, but are available via the template sub-language, which can in turn be incorporated via _template expressions_. ### Collection Values A _collection value_ combines zero or more other expressions to produce a collection value. ```ebnf CollectionValue = tuple | object; tuple = "[" ( (Expression ("," Expression)* ","?)? ) "]"; object = "{" ( (objectelem ("," objectelem)* ","?)? ) "}"; objectelem = (Identifier | Expression) ("=" | ":") Expression; ``` Only tuple and object values can be directly constructed via native syntax. Tuple and object values can in turn be converted to list, set and map values with other operations, which behaves as defined by the syntax-agnostic HCL information model. When specifying an object element, an identifier is interpreted as a literal attribute name as opposed to a variable reference. To populate an item key from a variable, use parentheses to disambiguate: - `{foo = "baz"}` is interpreted as an attribute literally named `foo`. - `{(foo) = "baz"}` is interpreted as an attribute whose name is taken from the variable named `foo`. Between the open and closing delimiters of these sequences, newline sequences are ignored as whitespace. There is a syntax ambiguity between _for expressions_ and collection values whose first element is a reference to a variable named `for`. The _for expression_ interpretation has priority, so to produce a tuple whose first element is the value of a variable named `for`, or an object with a key named `for`, use parentheses to disambiguate: - `[for, foo, baz]` is a syntax error. - `[(for), foo, baz]` is a tuple whose first element is the value of variable `for`. - `{for: 1, baz: 2}` is a syntax error. - `{(for): 1, baz: 2}` is an object with an attribute literally named `for`. - `{baz: 2, for: 1}` is equivalent to the previous example, and resolves the ambiguity by reordering. ### Template Expressions A _template expression_ embeds a program written in the template sub-language as an expression. Template expressions come in two forms: - A _quoted_ template expression is delimited by quote characters (`"`) and defines a template as a single-line expression with escape characters. - A _heredoc_ template expression is introduced by a `<<` sequence and defines a template via a multi-line sequence terminated by a user-chosen delimiter. In both cases the template interpolation and directive syntax is available for use within the delimiters, and any text outside of these special sequences is interpreted as a literal string. In _quoted_ template expressions any literal string sequences within the template behave in a special way: literal newline sequences are not permitted and instead _escape sequences_ can be included, starting with the backslash `\`: ``` \n Unicode newline control character \r Unicode carriage return control character \t Unicode tab control character \" Literal quote mark, used to prevent interpretation as end of string \\ Literal backslash, used to prevent interpretation as escape sequence \uNNNN Unicode character from Basic Multilingual Plane (NNNN is four hexadecimal digits) \UNNNNNNNN Unicode character from supplementary planes (NNNNNNNN is eight hexadecimal digits) ``` The _heredoc_ template expression type is introduced by either `<<` or `<<-`, followed by an identifier. The template expression ends when the given identifier subsequently appears again on a line of its own. If a heredoc template is introduced with the `<<-` symbol, any literal string at the start of each line is analyzed to find the minimum number of leading spaces, and then that number of prefix spaces is removed from all line-leading literal strings. The final closing marker may also have an arbitrary number of spaces preceding it on its line. ```ebnf TemplateExpr = quotedTemplate | heredocTemplate; quotedTemplate = (as defined in prose above); heredocTemplate = ( ("<<" | "<<-") Identifier Newline (content as defined in prose above) Identifier Newline ); ``` A quoted template expression containing only a single literal string serves as a syntax for defining literal string _expressions_. In certain contexts the template syntax is restricted in this manner: ```ebnf StringLit = '"' (quoted literals as defined in prose above) '"'; ``` The `StringLit` production permits the escape sequences discussed for quoted template expressions as above, but does _not_ permit template interpolation or directive sequences. ### Variables and Variable Expressions A _variable_ is a value that has been assigned a symbolic name. Variables are made available for use in expressions by the calling application, by populating the _global scope_ used for expression evaluation. Variables can also be created by expressions themselves, which always creates a _child scope_ that incorporates the variables from its parent scope but (re-)defines zero or more names with new values. The value of a variable is accessed using a _variable expression_, which is a standalone `Identifier` whose name corresponds to a defined variable: ```ebnf VariableExpr = Identifier; ``` Variables in a particular scope are immutable, but child scopes may _hide_ a variable from an ancestor scope by defining a new variable of the same name. When looking up variables, the most locally-defined variable of the given name is used, and ancestor-scoped variables of the same name cannot be accessed. No direct syntax is provided for declaring or assigning variables, but other expression constructs implicitly create child scopes and define variables as part of their evaluation. ### Functions and Function Calls A _function_ is an operation that has been assigned a symbolic name. Functions are made available for use in expressions by the calling application, by populating the _function table_ used for expression evaluation. The namespace of functions is distinct from the namespace of variables. A function and a variable may share the same name with no implication that they are in any way related. A function can be executed via a _function call_ expression: ```ebnf FunctionCall = Identifier "(" arguments ")"; Arguments = ( () || (Expression ("," Expression)* ("," | "...")?) ); ``` The definition of functions and the semantics of calling them are defined by the language-agnostic HCL information model. The given arguments are mapped onto the function's _parameters_ and the result of a function call expression is the return value of the named function when given those arguments. If the final argument expression is followed by the ellipsis symbol (`...`), the final argument expression must evaluate to either a list or tuple value. The elements of the value are each mapped to a single parameter of the named function, beginning at the first parameter remaining after all other argument expressions have been mapped. Within the parentheses that delimit the function arguments, newline sequences are ignored as whitespace. ### For Expressions A _for expression_ is a construct for constructing a collection by projecting the items from another collection. ```ebnf ForExpr = forTupleExpr | forObjectExpr; forTupleExpr = "[" forIntro Expression forCond? "]"; forObjectExpr = "{" forIntro Expression "=>" Expression "..."? forCond? "}"; forIntro = "for" Identifier ("," Identifier)? "in" Expression ":"; forCond = "if" Expression; ``` The punctuation used to delimit a for expression decide whether it will produce a tuple value (`[` and `]`) or an object value (`{` and `}`). The "introduction" is equivalent in both cases: the keyword `for` followed by either one or two identifiers separated by a comma which define the temporary variable names used for iteration, followed by the keyword `in` and then an expression that must evaluate to a value that can be iterated. The introduction is then terminated by the colon (`:`) symbol. If only one identifier is provided, it is the name of a variable that will be temporarily assigned the value of each element during iteration. If both are provided, the first is the key and the second is the value. Tuple, object, list, map, and set types are iterable. The type of collection used defines how the key and value variables are populated: - For tuple and list types, the _key_ is the zero-based index into the sequence for each element, and the _value_ is the element value. The elements are visited in index order. - For object and map types, the _key_ is the string attribute name or element key, and the _value_ is the attribute or element value. The elements are visited in the order defined by a lexicographic sort of the attribute names or keys. - For set types, the _key_ and _value_ are both the element value. The elements are visited in an undefined but consistent order. The expression after the colon and (in the case of object `for`) the expression after the `=>` are both evaluated once for each element of the source collection, in a local scope that defines the key and value variable names specified. The results of evaluating these expressions for each input element are used to populate an element in the new collection. In the case of tuple `for`, the single expression becomes an element, appending values to the tuple in visit order. In the case of object `for`, the pair of expressions is used as an attribute name and value respectively, creating an element in the resulting object. In the case of object `for`, it is an error if two input elements produce the same result from the attribute name expression, since duplicate attributes are not possible. If the ellipsis symbol (`...`) appears immediately after the value expression, this activates the grouping mode in which each value in the resulting object is a _tuple_ of all of the values that were produced against each distinct key. - `[for v in ["a", "b"]: v]` returns `["a", "b"]`. - `[for i, v in ["a", "b"]: i]` returns `[0, 1]`. - `{for i, v in ["a", "b"]: v => i}` returns `{a = 0, b = 1}`. - `{for i, v in ["a", "a", "b"]: k => v}` produces an error, because attribute `a` is defined twice. - `{for i, v in ["a", "a", "b"]: v => i...}` returns `{a = [0, 1], b = [2]}`. If the `if` keyword is used after the element expression(s), it applies an additional predicate that can be used to conditionally filter elements from the source collection from consideration. The expression following `if` is evaluated once for each source element, in the same scope used for the element expression(s). It must evaluate to a boolean value; if `true`, the element will be evaluated as normal, while if `false` the element will be skipped. - `[for i, v in ["a", "b", "c"]: v if i < 2]` returns `["a", "b"]`. If the collection value, element expression(s) or condition expression return unknown values that are otherwise type-valid, the result is a value of the dynamic pseudo-type. ### Index Operator The _index_ operator returns the value of a single element of a collection value. It is a postfix operator and can be applied to any value that has a tuple, object, map, or list type. ```ebnf Index = "[" Expression "]"; ``` The expression delimited by the brackets is the _key_ by which an element will be looked up. If the index operator is applied to a value of tuple or list type, the key expression must be an non-negative integer number representing the zero-based element index to access. If applied to a value of object or map type, the key expression must be a string representing the attribute name or element key. If the given key value is not of the appropriate type, a conversion is attempted using the conversion rules from the HCL syntax-agnostic information model. An error is produced if the given key expression does not correspond to an element in the collection, either because it is of an unconvertable type, because it is outside the range of elements for a tuple or list, or because the given attribute or key does not exist. If either the collection or the key are an unknown value of an otherwise-suitable type, the return value is an unknown value whose type matches what type would be returned given known values, or a value of the dynamic pseudo-type if type information alone cannot determine a suitable return type. Within the brackets that delimit the index key, newline sequences are ignored as whitespace. The HCL native syntax also includes a _legacy_ index operator that exists only for compatibility with the precursor language HIL: ```ebnf LegacyIndex = '.' digit+ ``` This legacy index operator must be supported by parser for compatibility but should not be used in new configurations. This allows an attribute-access-like syntax for indexing, must still be interpreted as an index operation rather than attribute access. The legacy syntax does not support chaining of index operations, like `foo.0.0.bar`, because the interpretation of `0.0` as a number literal token takes priority and thus renders the resulting sequence invalid. ### Attribute Access Operator The _attribute access_ operator returns the value of a single attribute in an object value. It is a postfix operator and can be applied to any value that has an object type. ```ebnf GetAttr = "." Identifier; ``` The given identifier is interpreted as the name of the attribute to access. An error is produced if the object to which the operator is applied does not have an attribute with the given name. If the object is an unknown value of a type that has the attribute named, the result is an unknown value of the attribute's type. ### Splat Operators The _splat operators_ allow convenient access to attributes or elements of elements in a tuple, list, or set value. There are two kinds of "splat" operator: - The _attribute-only_ splat operator supports only attribute lookups into the elements from a list, but supports an arbitrary number of them. - The _full_ splat operator additionally supports indexing into the elements from a list, and allows any combination of attribute access and index operations. ```ebnf Splat = attrSplat | fullSplat; attrSplat = "." "*" GetAttr*; fullSplat = "[" "*" "]" (GetAttr | Index)*; ``` The splat operators can be thought of as shorthands for common operations that could otherwise be performed using _for expressions_: - `tuple.*.foo.bar[0]` is approximately equivalent to `[for v in tuple: v.foo.bar][0]`. - `tuple[*].foo.bar[0]` is approximately equivalent to `[for v in tuple: v.foo.bar[0]]` Note the difference in how the trailing index operator is interpreted in each case. This different interpretation is the key difference between the _attribute-only_ and _full_ splat operators. Splat operators have one additional behavior compared to the equivalent _for expressions_ shown above: if a splat operator is applied to a value that is _not_ of tuple, list, or set type, the value is coerced automatically into a single-value list of the value type: - `any_object.*.id` is equivalent to `[any_object.id]`, assuming that `any_object` is a single object. - `any_number.*` is equivalent to `[any_number]`, assuming that `any_number` is a single number. If applied to a null value that is not tuple, list, or set, the result is always an empty tuple, which allows conveniently converting a possibly-null scalar value into a tuple of zero or one elements. It is illegal to apply a splat operator to a null value of tuple, list, or set type. ### Operations Operations apply a particular operator to either one or two expression terms. ```ebnf Operation = unaryOp | binaryOp; unaryOp = ("-" | "!") ExprTerm; binaryOp = ExprTerm binaryOperator ExprTerm; binaryOperator = compareOperator | arithmeticOperator | logicOperator; compareOperator = "==" | "!=" | "<" | ">" | "<=" | ">="; arithmeticOperator = "+" | "-" | "*" | "/" | "%"; logicOperator = "&&" | "||" | "!"; ``` The unary operators have the highest precedence. The binary operators are grouped into the following precedence levels: ``` Level Operators 6 * / % 5 + - 4 > >= < <= 3 == != 2 && 1 || ``` Higher values of "level" bind tighter. Operators within the same precedence level have left-to-right associativity. For example, `x / y * z` is equivalent to `(x / y) * z`. ### Comparison Operators Comparison operators always produce boolean values, as a result of testing the relationship between two values. The two equality operators apply to values of any type: ``` a == b equal a != b not equal ``` Two values are equal if the are of identical types and their values are equal as defined in the HCL syntax-agnostic information model. The equality operators are commutative and opposite, such that `(a == b) == !(a != b)` and `(a == b) == (b == a)` for all values `a` and `b`. The four numeric comparison operators apply only to numbers: ``` a < b less than a <= b less than or equal to a > b greater than a >= b greater than or equal to ``` If either operand of a comparison operator is a correctly-typed unknown value or a value of the dynamic pseudo-type, the result is an unknown boolean. ### Arithmetic Operators Arithmetic operators apply only to number values and always produce number values as results. ``` a + b sum (addition) a - b difference (subtraction) a * b product (multiplication) a / b quotient (division) a % b remainder (modulo) -a negation ``` Arithmetic operations are considered to be performed in an arbitrary-precision number space. If either operand of an arithmetic operator is an unknown number or a value of the dynamic pseudo-type, the result is an unknown number. ### Logic Operators Logic operators apply only to boolean values and always produce boolean values as results. ``` a && b logical AND a || b logical OR !a logical NOT ``` If either operand of a logic operator is an unknown bool value or a value of the dynamic pseudo-type, the result is an unknown bool value. ### Conditional Operator The conditional operator allows selecting from one of two expressions based on the outcome of a boolean expression. ```ebnf Conditional = Expression "?" Expression ":" Expression; ``` The first expression is the _predicate_, which is evaluated and must produce a boolean result. If the predicate value is `true`, the result of the second expression is the result of the conditional. If the predicate value is `false`, the result of the third expression is the result of the conditional. The second and third expressions must be of the same type or must be able to unify into a common type using the type unification rules defined in the HCL syntax-agnostic information model. This unified type is the result type of the conditional, with both expressions converted as necessary to the unified type. If the predicate is an unknown boolean value or a value of the dynamic pseudo-type then the result is an unknown value of the unified type of the other two expressions. If either the second or third expressions produce errors when evaluated, these errors are passed through only if the erroneous expression is selected. This allows for expressions such as `length(some_list) > 0 ? some_list[0] : default` (given some suitable `length` function) without producing an error when the predicate is `false`. ## Templates The template sub-language is used within template expressions to concisely combine strings and other values to produce other strings. It can also be used in isolation as a standalone template language. ```ebnf Template = ( TemplateLiteral | TemplateInterpolation | TemplateDirective )* TemplateDirective = TemplateIf | TemplateFor; ``` A template behaves like an expression that always returns a string value. The different elements of the template are evaluated and combined into a single string to return. If any of the elements produce an unknown string or a value of the dynamic pseudo-type, the result is an unknown string. An important use-case for standalone templates is to enable the use of expressions in alternative HCL syntaxes where a native expression grammar is not available. For example, the HCL JSON profile treats the values of JSON strings as standalone templates when attributes are evaluated in expression mode. ### Template Literals A template literal is a literal sequence of characters to include in the resulting string. When the template sub-language is used standalone, a template literal can contain any unicode character, with the exception of the sequences that introduce interpolations and directives, and for the sequences that escape those introductions. The interpolation and directive introductions are escaped by doubling their leading characters. The `${` sequence is escaped as `$${` and the `%{` sequence is escaped as `%%{`. When the template sub-language is embedded in the expression language via _template expressions_, additional constraints and transforms are applied to template literals as described in the definition of template expressions. The value of a template literal can be modified by _strip markers_ in any interpolations or directives that are adjacent to it. A strip marker is a tilde (`~`) placed immediately after the opening `{` or before the closing `}` of a template sequence: - `hello ${~ "world" }` produces `"helloworld"`. - `%{ if true ~} hello %{~ endif }` produces `"hello"`. When a strip marker is present, any spaces adjacent to it in the corresponding string literal (if any) are removed before producing the final value. Space characters are interpreted as per Unicode's definition. Stripping is done at syntax level rather than value level. Values returned by interpolations or directives are not subject to stripping: - `${"hello" ~}${" world"}` produces `"hello world"`, and not `"helloworld"`, because the space is not in a template literal directly adjacent to the strip marker. ### Template Interpolations An _interpolation sequence_ evaluates an expression (written in the expression sub-language), converts the result to a string value, and replaces itself with the resulting string. ```ebnf TemplateInterpolation = ("${" | "${~") Expression ("}" | "~}"; ``` If the expression result cannot be converted to a string, an error is produced. ### Template If Directive The template `if` directive is the template equivalent of the _conditional expression_, allowing selection of one of two sub-templates based on the value of a predicate expression. ```ebnf TemplateIf = ( ("%{" | "%{~") "if" Expression ("}" | "~}") Template ( ("%{" | "%{~") "else" ("}" | "~}") Template )? ("%{" | "%{~") "endif" ("}" | "~}") ); ``` The evaluation of the `if` directive is equivalent to the conditional expression, with the following exceptions: - The two sub-templates always produce strings, and thus the result value is also always a string. - The `else` clause may be omitted, in which case the conditional's third expression result is implied to be the empty string. ### Template For Directive The template `for` directive is the template equivalent of the _for expression_, producing zero or more copies of its sub-template based on the elements of a collection. ```ebnf TemplateFor = ( ("%{" | "%{~") "for" Identifier ("," Identifier) "in" Expression ("}" | "~}") Template ("%{" | "%{~") "endfor" ("}" | "~}") ); ``` The evaluation of the `for` directive is equivalent to the _for expression_ when producing a tuple, with the following exceptions: - The sub-template always produces a string. - There is no equivalent of the "if" clause on the for expression. - The elements of the resulting tuple are all converted to strings and concatenated to produce a flat string result. ### Template Interpolation Unwrapping As a special case, a template that consists only of a single interpolation, with no surrounding literals, directives or other interpolations, is "unwrapped". In this case, the result of the interpolation expression is returned verbatim, without conversion to string. This special case exists primarily to enable the native template language to be used inside strings in alternative HCL syntaxes that lack a first-class template or expression syntax. Unwrapping allows arbitrary expressions to be used to populate attributes when strings in such languages are interpreted as templates. - `${true}` produces the boolean value `true` - `${"${true}"}` produces the boolean value `true`, because both the inner and outer interpolations are subject to unwrapping. - `hello ${true}` produces the string `"hello true"` - `${""}${true}` produces the string `"true"` because there are two interpolation sequences, even though one produces an empty result. - `%{ for v in [true] }${v}%{ endif }` produces the string `true` because the presence of the `for` directive circumvents the unwrapping even though the final result is a single value. In some contexts this unwrapping behavior may be circumvented by the calling application, by converting the final template result to string. This is necessary, for example, if a standalone template is being used to produce the direct contents of a file, since the result in that case must always be a string. ## Static Analysis The HCL static analysis operations are implemented for some expression types in the native syntax, as described in the following sections. A goal for static analysis of the native syntax is for the interpretation to be as consistent as possible with the dynamic evaluation interpretation of the given expression, though some deviations are intentionally made in order to maximize the potential for analysis. ### Static List The tuple construction syntax can be interpreted as a static list. All of the expression elements given are returned as the static list elements, with no further interpretation. ### Static Map The object construction syntax can be interpreted as a static map. All of the key/value pairs given are returned as the static pairs, with no further interpretation. The usual requirement that an attribute name be interpretable as a string does not apply to this static analysis, allowing callers to provide map-like constructs with different key types by building on the map syntax. ### Static Call The function call syntax can be interpreted as a static call. The called function name is returned verbatim and the given argument expressions are returned as the static arguments, with no further interpretation. ### Static Traversal A variable expression and any attached attribute access operations and constant index operations can be interpreted as a static traversal. The keywords `true`, `false` and `null` can also be interpreted as static traversals, behaving as if they were references to variables of those names, to allow callers to redefine the meaning of those keywords in certain contexts. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure.go��������������������������0000664�0000000�0000000�00000023640�13771713062�0026505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "fmt" "strings" "github.com/hashicorp/hcl/v2" ) // AsHCLBlock returns the block data expressed as a *hcl.Block. func (b *Block) AsHCLBlock() *hcl.Block { if b == nil { return nil } lastHeaderRange := b.TypeRange if len(b.LabelRanges) > 0 { lastHeaderRange = b.LabelRanges[len(b.LabelRanges)-1] } return &hcl.Block{ Type: b.Type, Labels: b.Labels, Body: b.Body, DefRange: hcl.RangeBetween(b.TypeRange, lastHeaderRange), TypeRange: b.TypeRange, LabelRanges: b.LabelRanges, } } // Body is the implementation of hcl.Body for the HCL native syntax. type Body struct { Attributes Attributes Blocks Blocks // These are used with PartialContent to produce a "remaining items" // body to return. They are nil on all bodies fresh out of the parser. hiddenAttrs map[string]struct{} hiddenBlocks map[string]struct{} SrcRange hcl.Range EndRange hcl.Range // Final token of the body, for reporting missing items } // Assert that *Body implements hcl.Body var assertBodyImplBody hcl.Body = &Body{} func (b *Body) walkChildNodes(w internalWalkFunc) { w(b.Attributes) w(b.Blocks) } func (b *Body) Range() hcl.Range { return b.SrcRange } func (b *Body) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { content, remainHCL, diags := b.PartialContent(schema) // No we'll see if anything actually remains, to produce errors about // extraneous items. remain := remainHCL.(*Body) for name, attr := range b.Attributes { if _, hidden := remain.hiddenAttrs[name]; !hidden { var suggestions []string for _, attrS := range schema.Attributes { if _, defined := content.Attributes[attrS.Name]; defined { continue } suggestions = append(suggestions, attrS.Name) } suggestion := nameSuggestion(name, suggestions) if suggestion != "" { suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) } else { // Is there a block of the same name? for _, blockS := range schema.Blocks { if blockS.Type == name { suggestion = fmt.Sprintf(" Did you mean to define a block of type %q?", name) break } } } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsupported argument", Detail: fmt.Sprintf("An argument named %q is not expected here.%s", name, suggestion), Subject: &attr.NameRange, }) } } for _, block := range b.Blocks { blockTy := block.Type if _, hidden := remain.hiddenBlocks[blockTy]; !hidden { var suggestions []string for _, blockS := range schema.Blocks { suggestions = append(suggestions, blockS.Type) } suggestion := nameSuggestion(blockTy, suggestions) if suggestion != "" { suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) } else { // Is there an attribute of the same name? for _, attrS := range schema.Attributes { if attrS.Name == blockTy { suggestion = fmt.Sprintf(" Did you mean to define argument %q? If so, use the equals sign to assign it a value.", blockTy) break } } } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsupported block type", Detail: fmt.Sprintf("Blocks of type %q are not expected here.%s", blockTy, suggestion), Subject: &block.TypeRange, }) } } return content, diags } func (b *Body) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) { attrs := make(hcl.Attributes) var blocks hcl.Blocks var diags hcl.Diagnostics hiddenAttrs := make(map[string]struct{}) hiddenBlocks := make(map[string]struct{}) if b.hiddenAttrs != nil { for k, v := range b.hiddenAttrs { hiddenAttrs[k] = v } } if b.hiddenBlocks != nil { for k, v := range b.hiddenBlocks { hiddenBlocks[k] = v } } for _, attrS := range schema.Attributes { name := attrS.Name attr, exists := b.Attributes[name] _, hidden := hiddenAttrs[name] if hidden || !exists { if attrS.Required { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing required argument", Detail: fmt.Sprintf("The argument %q is required, but no definition was found.", attrS.Name), Subject: b.MissingItemRange().Ptr(), }) } continue } hiddenAttrs[name] = struct{}{} attrs[name] = attr.AsHCLAttribute() } blocksWanted := make(map[string]hcl.BlockHeaderSchema) for _, blockS := range schema.Blocks { blocksWanted[blockS.Type] = blockS } for _, block := range b.Blocks { if _, hidden := hiddenBlocks[block.Type]; hidden { continue } blockS, wanted := blocksWanted[block.Type] if !wanted { continue } if len(block.Labels) > len(blockS.LabelNames) { name := block.Type if len(blockS.LabelNames) == 0 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Extraneous label for %s", name), Detail: fmt.Sprintf( "No labels are expected for %s blocks.", name, ), Subject: block.LabelRanges[0].Ptr(), Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), }) } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Extraneous label for %s", name), Detail: fmt.Sprintf( "Only %d labels (%s) are expected for %s blocks.", len(blockS.LabelNames), strings.Join(blockS.LabelNames, ", "), name, ), Subject: block.LabelRanges[len(blockS.LabelNames)].Ptr(), Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), }) } continue } if len(block.Labels) < len(blockS.LabelNames) { name := block.Type diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Missing %s for %s", blockS.LabelNames[len(block.Labels)], name), Detail: fmt.Sprintf( "All %s blocks must have %d labels (%s).", name, len(blockS.LabelNames), strings.Join(blockS.LabelNames, ", "), ), Subject: &block.OpenBraceRange, Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), }) continue } blocks = append(blocks, block.AsHCLBlock()) } // We hide blocks only after we've processed all of them, since otherwise // we can't process more than one of the same type. for _, blockS := range schema.Blocks { hiddenBlocks[blockS.Type] = struct{}{} } remain := &Body{ Attributes: b.Attributes, Blocks: b.Blocks, hiddenAttrs: hiddenAttrs, hiddenBlocks: hiddenBlocks, SrcRange: b.SrcRange, EndRange: b.EndRange, } return &hcl.BodyContent{ Attributes: attrs, Blocks: blocks, MissingItemRange: b.MissingItemRange(), }, remain, diags } func (b *Body) JustAttributes() (hcl.Attributes, hcl.Diagnostics) { attrs := make(hcl.Attributes) var diags hcl.Diagnostics if len(b.Blocks) > 0 { example := b.Blocks[0] diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: fmt.Sprintf("Unexpected %q block", example.Type), Detail: "Blocks are not allowed here.", Subject: &example.TypeRange, }) // we will continue processing anyway, and return the attributes // we are able to find so that certain analyses can still be done // in the face of errors. } if b.Attributes == nil { return attrs, diags } for name, attr := range b.Attributes { if _, hidden := b.hiddenAttrs[name]; hidden { continue } attrs[name] = attr.AsHCLAttribute() } return attrs, diags } func (b *Body) MissingItemRange() hcl.Range { return hcl.Range{ Filename: b.SrcRange.Filename, Start: b.SrcRange.Start, End: b.SrcRange.Start, } } // Attributes is the collection of attribute definitions within a body. type Attributes map[string]*Attribute func (a Attributes) walkChildNodes(w internalWalkFunc) { for _, attr := range a { w(attr) } } // Range returns the range of some arbitrary point within the set of // attributes, or an invalid range if there are no attributes. // // This is provided only to complete the Node interface, but has no practical // use. func (a Attributes) Range() hcl.Range { // An attributes doesn't really have a useful range to report, since // it's just a grouping construct. So we'll arbitrarily take the // range of one of the attributes, or produce an invalid range if we have // none. In practice, there's little reason to ask for the range of // an Attributes. for _, attr := range a { return attr.Range() } return hcl.Range{ Filename: "<unknown>", } } // Attribute represents a single attribute definition within a body. type Attribute struct { Name string Expr Expression SrcRange hcl.Range NameRange hcl.Range EqualsRange hcl.Range } func (a *Attribute) walkChildNodes(w internalWalkFunc) { w(a.Expr) } func (a *Attribute) Range() hcl.Range { return a.SrcRange } // AsHCLAttribute returns the block data expressed as a *hcl.Attribute. func (a *Attribute) AsHCLAttribute() *hcl.Attribute { if a == nil { return nil } return &hcl.Attribute{ Name: a.Name, Expr: a.Expr, Range: a.SrcRange, NameRange: a.NameRange, } } // Blocks is the list of nested blocks within a body. type Blocks []*Block func (bs Blocks) walkChildNodes(w internalWalkFunc) { for _, block := range bs { w(block) } } // Range returns the range of some arbitrary point within the list of // blocks, or an invalid range if there are no blocks. // // This is provided only to complete the Node interface, but has no practical // use. func (bs Blocks) Range() hcl.Range { if len(bs) > 0 { return bs[0].Range() } return hcl.Range{ Filename: "<unknown>", } } // Block represents a nested block structure type Block struct { Type string Labels []string Body *Body TypeRange hcl.Range LabelRanges []hcl.Range OpenBraceRange hcl.Range CloseBraceRange hcl.Range } func (b *Block) walkChildNodes(w internalWalkFunc) { w(b.Body) } func (b *Block) Range() hcl.Range { return hcl.RangeBetween(b.TypeRange, b.CloseBraceRange) } func (b *Block) DefRange() hcl.Range { return hcl.RangeBetween(b.TypeRange, b.OpenBraceRange) } ������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure_at_pos.go�������������������0000664�0000000�0000000�00000006753�13771713062�0030060�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" ) // ----------------------------------------------------------------------------- // The methods in this file are all optional extension methods that serve to // implement the methods of the same name on *hcl.File when its root body // is provided by this package. // ----------------------------------------------------------------------------- // BlocksAtPos implements the method of the same name for an *hcl.File that // is backed by a *Body. func (b *Body) BlocksAtPos(pos hcl.Pos) []*hcl.Block { list, _ := b.blocksAtPos(pos, true) return list } // InnermostBlockAtPos implements the method of the same name for an *hcl.File // that is backed by a *Body. func (b *Body) InnermostBlockAtPos(pos hcl.Pos) *hcl.Block { _, innermost := b.blocksAtPos(pos, false) return innermost.AsHCLBlock() } // OutermostBlockAtPos implements the method of the same name for an *hcl.File // that is backed by a *Body. func (b *Body) OutermostBlockAtPos(pos hcl.Pos) *hcl.Block { return b.outermostBlockAtPos(pos).AsHCLBlock() } // blocksAtPos is the internal engine of both BlocksAtPos and // InnermostBlockAtPos, which both need to do the same logic but return a // differently-shaped result. // // list is nil if makeList is false, avoiding an allocation. Innermost is // always set, and if the returned list is non-nil it will always match the // final element from that list. func (b *Body) blocksAtPos(pos hcl.Pos, makeList bool) (list []*hcl.Block, innermost *Block) { current := b Blocks: for current != nil { for _, block := range current.Blocks { wholeRange := hcl.RangeBetween(block.TypeRange, block.CloseBraceRange) if wholeRange.ContainsPos(pos) { innermost = block if makeList { list = append(list, innermost.AsHCLBlock()) } current = block.Body continue Blocks } } // If we fall out here then none of the current body's nested blocks // contain the position we are looking for, and so we're done. break } return } // outermostBlockAtPos is the internal version of OutermostBlockAtPos that // returns a hclsyntax.Block rather than an hcl.Block, allowing for further // analysis if necessary. func (b *Body) outermostBlockAtPos(pos hcl.Pos) *Block { // This is similar to blocksAtPos, but simpler because we know it only // ever needs to search the first level of nested blocks. for _, block := range b.Blocks { wholeRange := hcl.RangeBetween(block.TypeRange, block.CloseBraceRange) if wholeRange.ContainsPos(pos) { return block } } return nil } // AttributeAtPos implements the method of the same name for an *hcl.File // that is backed by a *Body. func (b *Body) AttributeAtPos(pos hcl.Pos) *hcl.Attribute { return b.attributeAtPos(pos).AsHCLAttribute() } // attributeAtPos is the internal version of AttributeAtPos that returns a // hclsyntax.Block rather than an hcl.Block, allowing for further analysis if // necessary. func (b *Body) attributeAtPos(pos hcl.Pos) *Attribute { searchBody := b _, block := b.blocksAtPos(pos, false) if block != nil { searchBody = block.Body } for _, attr := range searchBody.Attributes { if attr.SrcRange.ContainsPos(pos) { return attr } } return nil } // OutermostExprAtPos implements the method of the same name for an *hcl.File // that is backed by a *Body. func (b *Body) OutermostExprAtPos(pos hcl.Pos) hcl.Expression { attr := b.attributeAtPos(pos) if attr == nil { return nil } if !attr.Expr.Range().ContainsPos(pos) { return nil } return attr.Expr } ���������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go������������������������������0000664�0000000�0000000�00000021721�13771713062�0025563�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "bytes" "fmt" "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" ) // Token represents a sequence of bytes from some HCL code that has been // tagged with a type and its range within the source file. type Token struct { Type TokenType Bytes []byte Range hcl.Range } // Tokens is a slice of Token. type Tokens []Token // TokenType is an enumeration used for the Type field on Token. type TokenType rune const ( // Single-character tokens are represented by their own character, for // convenience in producing these within the scanner. However, the values // are otherwise arbitrary and just intended to be mnemonic for humans // who might see them in debug output. TokenOBrace TokenType = '{' TokenCBrace TokenType = '}' TokenOBrack TokenType = '[' TokenCBrack TokenType = ']' TokenOParen TokenType = '(' TokenCParen TokenType = ')' TokenOQuote TokenType = '«' TokenCQuote TokenType = '»' TokenOHeredoc TokenType = 'H' TokenCHeredoc TokenType = 'h' TokenStar TokenType = '*' TokenSlash TokenType = '/' TokenPlus TokenType = '+' TokenMinus TokenType = '-' TokenPercent TokenType = '%' TokenEqual TokenType = '=' TokenEqualOp TokenType = '≔' TokenNotEqual TokenType = '≠' TokenLessThan TokenType = '<' TokenLessThanEq TokenType = '≤' TokenGreaterThan TokenType = '>' TokenGreaterThanEq TokenType = '≥' TokenAnd TokenType = '∧' TokenOr TokenType = '∨' TokenBang TokenType = '!' TokenDot TokenType = '.' TokenComma TokenType = ',' TokenEllipsis TokenType = '…' TokenFatArrow TokenType = '⇒' TokenQuestion TokenType = '?' TokenColon TokenType = ':' TokenTemplateInterp TokenType = '∫' TokenTemplateControl TokenType = 'λ' TokenTemplateSeqEnd TokenType = '∎' TokenQuotedLit TokenType = 'Q' // might contain backslash escapes TokenStringLit TokenType = 'S' // cannot contain backslash escapes TokenNumberLit TokenType = 'N' TokenIdent TokenType = 'I' TokenComment TokenType = 'C' TokenNewline TokenType = '\n' TokenEOF TokenType = '␄' // The rest are not used in the language but recognized by the scanner so // we can generate good diagnostics in the parser when users try to write // things that might work in other languages they are familiar with, or // simply make incorrect assumptions about the HCL language. TokenBitwiseAnd TokenType = '&' TokenBitwiseOr TokenType = '|' TokenBitwiseNot TokenType = '~' TokenBitwiseXor TokenType = '^' TokenStarStar TokenType = '➚' TokenApostrophe TokenType = '\'' TokenBacktick TokenType = '`' TokenSemicolon TokenType = ';' TokenTabs TokenType = '␉' TokenInvalid TokenType = '�' TokenBadUTF8 TokenType = '💩' TokenQuotedNewline TokenType = '␤' // TokenNil is a placeholder for when a token is required but none is // available, e.g. when reporting errors. The scanner will never produce // this as part of a token stream. TokenNil TokenType = '\x00' ) func (t TokenType) GoString() string { return fmt.Sprintf("hclsyntax.%s", t.String()) } type scanMode int const ( scanNormal scanMode = iota scanTemplate scanIdentOnly ) type tokenAccum struct { Filename string Bytes []byte Pos hcl.Pos Tokens []Token StartByte int } func (f *tokenAccum) emitToken(ty TokenType, startOfs, endOfs int) { // Walk through our buffer to figure out how much we need to adjust // the start pos to get our end pos. start := f.Pos start.Column += startOfs + f.StartByte - f.Pos.Byte // Safe because only ASCII spaces can be in the offset start.Byte = startOfs + f.StartByte end := start end.Byte = endOfs + f.StartByte b := f.Bytes[startOfs:endOfs] for len(b) > 0 { advance, seq, _ := textseg.ScanGraphemeClusters(b, true) if (len(seq) == 1 && seq[0] == '\n') || (len(seq) == 2 && seq[0] == '\r' && seq[1] == '\n') { end.Line++ end.Column = 1 } else { end.Column++ } b = b[advance:] } f.Pos = end f.Tokens = append(f.Tokens, Token{ Type: ty, Bytes: f.Bytes[startOfs:endOfs], Range: hcl.Range{ Filename: f.Filename, Start: start, End: end, }, }) } type heredocInProgress struct { Marker []byte StartOfLine bool } func tokenOpensFlushHeredoc(tok Token) bool { if tok.Type != TokenOHeredoc { return false } return bytes.HasPrefix(tok.Bytes, []byte{'<', '<', '-'}) } // checkInvalidTokens does a simple pass across the given tokens and generates // diagnostics for tokens that should _never_ appear in HCL source. This // is intended to avoid the need for the parser to have special support // for them all over. // // Returns a diagnostics with no errors if everything seems acceptable. // Otherwise, returns zero or more error diagnostics, though tries to limit // repetition of the same information. func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { var diags hcl.Diagnostics toldBitwise := 0 toldExponent := 0 toldBacktick := 0 toldApostrophe := 0 toldSemicolon := 0 toldTabs := 0 toldBadUTF8 := 0 for _, tok := range tokens { // copy token so it's safe to point to it tok := tok switch tok.Type { case TokenBitwiseAnd, TokenBitwiseOr, TokenBitwiseXor, TokenBitwiseNot: if toldBitwise < 4 { var suggestion string switch tok.Type { case TokenBitwiseAnd: suggestion = " Did you mean boolean AND (\"&&\")?" case TokenBitwiseOr: suggestion = " Did you mean boolean OR (\"&&\")?" case TokenBitwiseNot: suggestion = " Did you mean boolean NOT (\"!\")?" } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsupported operator", Detail: fmt.Sprintf("Bitwise operators are not supported.%s", suggestion), Subject: &tok.Range, }) toldBitwise++ } case TokenStarStar: if toldExponent < 1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unsupported operator", Detail: "\"**\" is not a supported operator. Exponentiation is not supported as an operator.", Subject: &tok.Range, }) toldExponent++ } case TokenBacktick: // Only report for alternating (even) backticks, so we won't report both start and ends of the same // backtick-quoted string. if (toldBacktick % 2) == 0 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid character", Detail: "The \"`\" character is not valid. To create a multi-line string, use the \"heredoc\" syntax, like \"<<EOT\".", Subject: &tok.Range, }) } if toldBacktick <= 2 { toldBacktick++ } case TokenApostrophe: if (toldApostrophe % 2) == 0 { newDiag := &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid character", Detail: "Single quotes are not valid. Use double quotes (\") to enclose strings.", Subject: &tok.Range, } diags = append(diags, newDiag) } if toldApostrophe <= 2 { toldApostrophe++ } case TokenSemicolon: if toldSemicolon < 1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid character", Detail: "The \";\" character is not valid. Use newlines to separate arguments and blocks, and commas to separate items in collection values.", Subject: &tok.Range, }) toldSemicolon++ } case TokenTabs: if toldTabs < 1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid character", Detail: "Tab characters may not be used. The recommended indentation style is two spaces per indent.", Subject: &tok.Range, }) toldTabs++ } case TokenBadUTF8: if toldBadUTF8 < 1 { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid character encoding", Detail: "All input files must be UTF-8 encoded. Ensure that UTF-8 encoding is selected in your editor.", Subject: &tok.Range, }) toldBadUTF8++ } case TokenQuotedNewline: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid multi-line string", Detail: "Quoted strings may not be split over multiple lines. To produce a multi-line string, either use the \\n escape to represent a newline character or use the \"heredoc\" multi-line template syntax.", Subject: &tok.Range, }) case TokenInvalid: diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid character", Detail: "This character is not used within the language.", Subject: &tok.Range, }) } } return diags } var utf8BOM = []byte{0xef, 0xbb, 0xbf} // stripUTF8BOM checks whether the given buffer begins with a UTF-8 byte order // mark (0xEF 0xBB 0xBF) and, if so, returns a truncated slice with the same // backing array but with the BOM skipped. // // If there is no BOM present, the given slice is returned verbatim. func stripUTF8BOM(src []byte) []byte { if bytes.HasPrefix(src, utf8BOM) { return src[3:] } return src } �����������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token_type_string.go������������������0000664�0000000�0000000�00000010523�13771713062�0030210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "stringer -type TokenType -output token_type_string.go"; DO NOT EDIT. package hclsyntax import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} _ = x[TokenOBrace-123] _ = x[TokenCBrace-125] _ = x[TokenOBrack-91] _ = x[TokenCBrack-93] _ = x[TokenOParen-40] _ = x[TokenCParen-41] _ = x[TokenOQuote-171] _ = x[TokenCQuote-187] _ = x[TokenOHeredoc-72] _ = x[TokenCHeredoc-104] _ = x[TokenStar-42] _ = x[TokenSlash-47] _ = x[TokenPlus-43] _ = x[TokenMinus-45] _ = x[TokenPercent-37] _ = x[TokenEqual-61] _ = x[TokenEqualOp-8788] _ = x[TokenNotEqual-8800] _ = x[TokenLessThan-60] _ = x[TokenLessThanEq-8804] _ = x[TokenGreaterThan-62] _ = x[TokenGreaterThanEq-8805] _ = x[TokenAnd-8743] _ = x[TokenOr-8744] _ = x[TokenBang-33] _ = x[TokenDot-46] _ = x[TokenComma-44] _ = x[TokenEllipsis-8230] _ = x[TokenFatArrow-8658] _ = x[TokenQuestion-63] _ = x[TokenColon-58] _ = x[TokenTemplateInterp-8747] _ = x[TokenTemplateControl-955] _ = x[TokenTemplateSeqEnd-8718] _ = x[TokenQuotedLit-81] _ = x[TokenStringLit-83] _ = x[TokenNumberLit-78] _ = x[TokenIdent-73] _ = x[TokenComment-67] _ = x[TokenNewline-10] _ = x[TokenEOF-9220] _ = x[TokenBitwiseAnd-38] _ = x[TokenBitwiseOr-124] _ = x[TokenBitwiseNot-126] _ = x[TokenBitwiseXor-94] _ = x[TokenStarStar-10138] _ = x[TokenApostrophe-39] _ = x[TokenBacktick-96] _ = x[TokenSemicolon-59] _ = x[TokenTabs-9225] _ = x[TokenInvalid-65533] _ = x[TokenBadUTF8-128169] _ = x[TokenQuotedNewline-9252] _ = x[TokenNil-0] } const _TokenType_name = "TokenNilTokenNewlineTokenBangTokenPercentTokenBitwiseAndTokenApostropheTokenOParenTokenCParenTokenStarTokenPlusTokenCommaTokenMinusTokenDotTokenSlashTokenColonTokenSemicolonTokenLessThanTokenEqualTokenGreaterThanTokenQuestionTokenCommentTokenOHeredocTokenIdentTokenNumberLitTokenQuotedLitTokenStringLitTokenOBrackTokenCBrackTokenBitwiseXorTokenBacktickTokenCHeredocTokenOBraceTokenBitwiseOrTokenCBraceTokenBitwiseNotTokenOQuoteTokenCQuoteTokenTemplateControlTokenEllipsisTokenFatArrowTokenTemplateSeqEndTokenAndTokenOrTokenTemplateInterpTokenEqualOpTokenNotEqualTokenLessThanEqTokenGreaterThanEqTokenEOFTokenTabsTokenQuotedNewlineTokenStarStarTokenInvalidTokenBadUTF8" var _TokenType_map = map[TokenType]string{ 0: _TokenType_name[0:8], 10: _TokenType_name[8:20], 33: _TokenType_name[20:29], 37: _TokenType_name[29:41], 38: _TokenType_name[41:56], 39: _TokenType_name[56:71], 40: _TokenType_name[71:82], 41: _TokenType_name[82:93], 42: _TokenType_name[93:102], 43: _TokenType_name[102:111], 44: _TokenType_name[111:121], 45: _TokenType_name[121:131], 46: _TokenType_name[131:139], 47: _TokenType_name[139:149], 58: _TokenType_name[149:159], 59: _TokenType_name[159:173], 60: _TokenType_name[173:186], 61: _TokenType_name[186:196], 62: _TokenType_name[196:212], 63: _TokenType_name[212:225], 67: _TokenType_name[225:237], 72: _TokenType_name[237:250], 73: _TokenType_name[250:260], 78: _TokenType_name[260:274], 81: _TokenType_name[274:288], 83: _TokenType_name[288:302], 91: _TokenType_name[302:313], 93: _TokenType_name[313:324], 94: _TokenType_name[324:339], 96: _TokenType_name[339:352], 104: _TokenType_name[352:365], 123: _TokenType_name[365:376], 124: _TokenType_name[376:390], 125: _TokenType_name[390:401], 126: _TokenType_name[401:416], 171: _TokenType_name[416:427], 187: _TokenType_name[427:438], 955: _TokenType_name[438:458], 8230: _TokenType_name[458:471], 8658: _TokenType_name[471:484], 8718: _TokenType_name[484:503], 8743: _TokenType_name[503:511], 8744: _TokenType_name[511:518], 8747: _TokenType_name[518:537], 8788: _TokenType_name[537:549], 8800: _TokenType_name[549:562], 8804: _TokenType_name[562:577], 8805: _TokenType_name[577:595], 9220: _TokenType_name[595:603], 9225: _TokenType_name[603:612], 9252: _TokenType_name[612:630], 10138: _TokenType_name[630:643], 65533: _TokenType_name[643:655], 128169: _TokenType_name[655:667], } func (i TokenType) String() string { if str, ok := _TokenType_map[i]; ok { return str } return "TokenType(" + strconv.FormatInt(int64(i), 10) + ")" } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/unicode2ragel.rb����������������������0000664�0000000�0000000�00000017501�13771713062�0027165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/env ruby # # This scripted has been updated to accept more command-line arguments: # # -u, --url URL to process # -m, --machine Machine name # -p, --properties Properties to add to the machine # -o, --output Write output to file # # Updated by: Marty Schoch <marty.schoch@gmail.com> # # This script uses the unicode spec to generate a Ragel state machine # that recognizes unicode alphanumeric characters. It generates 5 # character classes: uupper, ulower, ualpha, udigit, and ualnum. # Currently supported encodings are UTF-8 [default] and UCS-4. # # Usage: unicode2ragel.rb [options] # -e, --encoding [ucs4 | utf8] Data encoding # -h, --help Show this message # # This script was originally written as part of the Ferret search # engine library. # # Author: Rakan El-Khalil <rakan@well.com> require 'optparse' require 'open-uri' ENCODINGS = [ :utf8, :ucs4 ] ALPHTYPES = { :utf8 => "byte", :ucs4 => "rune" } DEFAULT_CHART_URL = "http://www.unicode.org/Public/5.1.0/ucd/DerivedCoreProperties.txt" DEFAULT_MACHINE_NAME= "WChar" ### # Display vars & default option TOTAL_WIDTH = 80 RANGE_WIDTH = 23 @encoding = :utf8 @chart_url = DEFAULT_CHART_URL machine_name = DEFAULT_MACHINE_NAME properties = [] @output = $stdout ### # Option parsing cli_opts = OptionParser.new do |opts| opts.on("-e", "--encoding [ucs4 | utf8]", "Data encoding") do |o| @encoding = o.downcase.to_sym end opts.on("-h", "--help", "Show this message") do puts opts exit end opts.on("-u", "--url URL", "URL to process") do |o| @chart_url = o end opts.on("-m", "--machine MACHINE_NAME", "Machine name") do |o| machine_name = o end opts.on("-p", "--properties x,y,z", Array, "Properties to add to machine") do |o| properties = o end opts.on("-o", "--output FILE", "output file") do |o| @output = File.new(o, "w+") end end cli_opts.parse(ARGV) unless ENCODINGS.member? @encoding puts "Invalid encoding: #{@encoding}" puts cli_opts exit end ## # Downloads the document at url and yields every alpha line's hex # range and description. def each_alpha( url, property ) open( url ) do |file| file.each_line do |line| next if line =~ /^#/; next if line !~ /; #{property} #/; range, description = line.split(/;/) range.strip! description.gsub!(/.*#/, '').strip! if range =~ /\.\./ start, stop = range.split '..' else start = stop = range end yield start.hex .. stop.hex, description end end end ### # Formats to hex at minimum width def to_hex( n ) r = "%0X" % n r = "0#{r}" unless (r.length % 2).zero? r end ### # UCS4 is just a straight hex conversion of the unicode codepoint. def to_ucs4( range ) rangestr = "0x" + to_hex(range.begin) rangestr << "..0x" + to_hex(range.end) if range.begin != range.end [ rangestr ] end ## # 0x00 - 0x7f -> 0zzzzzzz[7] # 0x80 - 0x7ff -> 110yyyyy[5] 10zzzzzz[6] # 0x800 - 0xffff -> 1110xxxx[4] 10yyyyyy[6] 10zzzzzz[6] # 0x010000 - 0x10ffff -> 11110www[3] 10xxxxxx[6] 10yyyyyy[6] 10zzzzzz[6] UTF8_BOUNDARIES = [0x7f, 0x7ff, 0xffff, 0x10ffff] def to_utf8_enc( n ) r = 0 if n <= 0x7f r = n elsif n <= 0x7ff y = 0xc0 | (n >> 6) z = 0x80 | (n & 0x3f) r = y << 8 | z elsif n <= 0xffff x = 0xe0 | (n >> 12) y = 0x80 | (n >> 6) & 0x3f z = 0x80 | n & 0x3f r = x << 16 | y << 8 | z elsif n <= 0x10ffff w = 0xf0 | (n >> 18) x = 0x80 | (n >> 12) & 0x3f y = 0x80 | (n >> 6) & 0x3f z = 0x80 | n & 0x3f r = w << 24 | x << 16 | y << 8 | z end to_hex(r) end def from_utf8_enc( n ) n = n.hex r = 0 if n <= 0x7f r = n elsif n <= 0xdfff y = (n >> 8) & 0x1f z = n & 0x3f r = y << 6 | z elsif n <= 0xefffff x = (n >> 16) & 0x0f y = (n >> 8) & 0x3f z = n & 0x3f r = x << 10 | y << 6 | z elsif n <= 0xf7ffffff w = (n >> 24) & 0x07 x = (n >> 16) & 0x3f y = (n >> 8) & 0x3f z = n & 0x3f r = w << 18 | x << 12 | y << 6 | z end r end ### # Given a range, splits it up into ranges that can be continuously # encoded into utf8. Eg: 0x00 .. 0xff => [0x00..0x7f, 0x80..0xff] # This is not strictly needed since the current [5.1] unicode standard # doesn't have ranges that straddle utf8 boundaries. This is included # for completeness as there is no telling if that will ever change. def utf8_ranges( range ) ranges = [] UTF8_BOUNDARIES.each do |max| if range.begin <= max if range.end <= max ranges << range return ranges end ranges << (range.begin .. max) range = (max + 1) .. range.end end end ranges end def build_range( start, stop ) size = start.size/2 left = size - 1 return [""] if size < 1 a = start[0..1] b = stop[0..1] ### # Shared prefix if a == b return build_range(start[2..-1], stop[2..-1]).map do |elt| "0x#{a} " + elt end end ### # Unshared prefix, end of run return ["0x#{a}..0x#{b} "] if left.zero? ### # Unshared prefix, not end of run # Range can be 0x123456..0x56789A # Which is equivalent to: # 0x123456 .. 0x12FFFF # 0x130000 .. 0x55FFFF # 0x560000 .. 0x56789A ret = [] ret << build_range(start, a + "FF" * left) ### # Only generate middle range if need be. if a.hex+1 != b.hex max = to_hex(b.hex - 1) max = "FF" if b == "FF" ret << "0x#{to_hex(a.hex+1)}..0x#{max} " + "0x00..0xFF " * left end ### # Don't generate last range if it is covered by first range ret << build_range(b + "00" * left, stop) unless b == "FF" ret.flatten! end def to_utf8( range ) utf8_ranges( range ).map do |r| begin_enc = to_utf8_enc(r.begin) end_enc = to_utf8_enc(r.end) build_range begin_enc, end_enc end.flatten! end ## # Perform a 3-way comparison of the number of codepoints advertised by # the unicode spec for the given range, the originally parsed range, # and the resulting utf8 encoded range. def count_codepoints( code ) code.split(' ').inject(1) do |acc, elt| if elt =~ /0x(.+)\.\.0x(.+)/ if @encoding == :utf8 acc * (from_utf8_enc($2) - from_utf8_enc($1) + 1) else acc * ($2.hex - $1.hex + 1) end else acc end end end def is_valid?( range, desc, codes ) spec_count = 1 spec_count = $1.to_i if desc =~ /\[(\d+)\]/ range_count = range.end - range.begin + 1 sum = codes.inject(0) { |acc, elt| acc + count_codepoints(elt) } sum == spec_count and sum == range_count end ## # Generate the state maching to stdout def generate_machine( name, property ) pipe = " " @output.puts " #{name} = " each_alpha( @chart_url, property ) do |range, desc| codes = (@encoding == :ucs4) ? to_ucs4(range) : to_utf8(range) #raise "Invalid encoding of range #{range}: #{codes.inspect}" unless # is_valid? range, desc, codes range_width = codes.map { |a| a.size }.max range_width = RANGE_WIDTH if range_width < RANGE_WIDTH desc_width = TOTAL_WIDTH - RANGE_WIDTH - 11 desc_width -= (range_width - RANGE_WIDTH) if range_width > RANGE_WIDTH if desc.size > desc_width desc = desc[0..desc_width - 4] + "..." end codes.each_with_index do |r, idx| desc = "" unless idx.zero? code = "%-#{range_width}s" % r @output.puts " #{pipe} #{code} ##{desc}" pipe = "|" end end @output.puts " ;" @output.puts "" end @output.puts <<EOF # The following Ragel file was autogenerated with #{$0} # from: #{@chart_url} # # It defines #{properties}. # # To use this, make sure that your alphtype is set to #{ALPHTYPES[@encoding]}, # and that your input is in #{@encoding}. %%{ machine #{machine_name}; EOF properties.each { |x| generate_machine( x, x ) } @output.puts <<EOF }%% EOF �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/unicode_derived.rl��������������������0000664�0000000�0000000�00000443304�13771713062�0027610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# The following Ragel file was autogenerated with unicode2ragel.rb # from: http://www.unicode.org/Public/9.0.0/ucd/DerivedCoreProperties.txt # # It defines ["ID_Start", "ID_Continue"]. # # To use this, make sure that your alphtype is set to byte, # and that your input is in utf8. %%{ machine UnicodeDerived; ID_Start = 0x41..0x5A #L& [26] LATIN CAPITAL LETTER A..LATIN CAPI... | 0x61..0x7A #L& [26] LATIN SMALL LETTER A..LATIN SMALL ... | 0xC2 0xAA #Lo FEMININE ORDINAL INDICATOR | 0xC2 0xB5 #L& MICRO SIGN | 0xC2 0xBA #Lo MASCULINE ORDINAL INDICATOR | 0xC3 0x80..0x96 #L& [23] LATIN CAPITAL LETTER A WITH GRAVE.... | 0xC3 0x98..0xB6 #L& [31] LATIN CAPITAL LETTER O WITH STROKE... | 0xC3 0xB8..0xFF #L& [195] LATIN SMALL LETTER O WITH STROKE..... | 0xC4..0xC5 0x00..0xFF # | 0xC6 0x00..0xBA # | 0xC6 0xBB #Lo LATIN LETTER TWO WITH STROKE | 0xC6 0xBC..0xBF #L& [4] LATIN CAPITAL LETTER TONE FIVE..LA... | 0xC7 0x80..0x83 #Lo [4] LATIN LETTER DENTAL CLICK..LATIN L... | 0xC7 0x84..0xFF #L& [208] LATIN CAPITAL LETTER DZ WITH CARON... | 0xC8..0xC9 0x00..0xFF # | 0xCA 0x00..0x93 # | 0xCA 0x94 #Lo LATIN LETTER GLOTTAL STOP | 0xCA 0x95..0xAF #L& [27] LATIN LETTER PHARYNGEAL VOICED FRI... | 0xCA 0xB0..0xFF #Lm [18] MODIFIER LETTER SMALL H..MODIFIER ... | 0xCB 0x00..0x81 # | 0xCB 0x86..0x91 #Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT.... | 0xCB 0xA0..0xA4 #Lm [5] MODIFIER LETTER SMALL GAMMA..MODIF... | 0xCB 0xAC #Lm MODIFIER LETTER VOICING | 0xCB 0xAE #Lm MODIFIER LETTER DOUBLE APOSTROPHE | 0xCD 0xB0..0xB3 #L& [4] GREEK CAPITAL LETTER HETA..GREEK S... | 0xCD 0xB4 #Lm GREEK NUMERAL SIGN | 0xCD 0xB6..0xB7 #L& [2] GREEK CAPITAL LETTER PAMPHYLIAN DI... | 0xCD 0xBA #Lm GREEK YPOGEGRAMMENI | 0xCD 0xBB..0xBD #L& [3] GREEK SMALL REVERSED LUNATE SIGMA ... | 0xCD 0xBF #L& GREEK CAPITAL LETTER YOT | 0xCE 0x86 #L& GREEK CAPITAL LETTER ALPHA WITH TONOS | 0xCE 0x88..0x8A #L& [3] GREEK CAPITAL LETTER EPSILON WITH ... | 0xCE 0x8C #L& GREEK CAPITAL LETTER OMICRON WITH ... | 0xCE 0x8E..0xA1 #L& [20] GREEK CAPITAL LETTER UPSILON WITH ... | 0xCE 0xA3..0xFF #L& [83] GREEK CAPITAL LETTER SIGMA..GREEK ... | 0xCF 0x00..0xB5 # | 0xCF 0xB7..0xFF #L& [139] GREEK CAPITAL LETTER SHO..CYRILLIC... | 0xD0..0xD1 0x00..0xFF # | 0xD2 0x00..0x81 # | 0xD2 0x8A..0xFF #L& [166] CYRILLIC CAPITAL LETTER SHORT I WI... | 0xD3..0xD3 0x00..0xFF # | 0xD4 0x00..0xAF # | 0xD4 0xB1..0xFF #L& [38] ARMENIAN CAPITAL LETTER AYB..ARMEN... | 0xD5 0x00..0x96 # | 0xD5 0x99 #Lm ARMENIAN MODIFIER LETTER LEFT HALF... | 0xD5 0xA1..0xFF #L& [39] ARMENIAN SMALL LETTER AYB..ARMENIA... | 0xD6 0x00..0x87 # | 0xD7 0x90..0xAA #Lo [27] HEBREW LETTER ALEF..HEBREW LETTER TAV | 0xD7 0xB0..0xB2 #Lo [3] HEBREW LIGATURE YIDDISH DOUBLE VAV... | 0xD8 0xA0..0xBF #Lo [32] ARABIC LETTER KASHMIRI YEH..ARABIC... | 0xD9 0x80 #Lm ARABIC TATWEEL | 0xD9 0x81..0x8A #Lo [10] ARABIC LETTER FEH..ARABIC LETTER YEH | 0xD9 0xAE..0xAF #Lo [2] ARABIC LETTER DOTLESS BEH..ARABIC ... | 0xD9 0xB1..0xFF #Lo [99] ARABIC LETTER ALEF WASLA..ARABIC L... | 0xDA..0xDA 0x00..0xFF # | 0xDB 0x00..0x93 # | 0xDB 0x95 #Lo ARABIC LETTER AE | 0xDB 0xA5..0xA6 #Lm [2] ARABIC SMALL WAW..ARABIC SMALL YEH | 0xDB 0xAE..0xAF #Lo [2] ARABIC LETTER DAL WITH INVERTED V.... | 0xDB 0xBA..0xBC #Lo [3] ARABIC LETTER SHEEN WITH DOT BELOW... | 0xDB 0xBF #Lo ARABIC LETTER HEH WITH INVERTED V | 0xDC 0x90 #Lo SYRIAC LETTER ALAPH | 0xDC 0x92..0xAF #Lo [30] SYRIAC LETTER BETH..SYRIAC LETTER ... | 0xDD 0x8D..0xFF #Lo [89] SYRIAC LETTER SOGDIAN ZHAIN..THAAN... | 0xDE 0x00..0xA5 # | 0xDE 0xB1 #Lo THAANA LETTER NAA | 0xDF 0x8A..0xAA #Lo [33] NKO LETTER A..NKO LETTER JONA RA | 0xDF 0xB4..0xB5 #Lm [2] NKO HIGH TONE APOSTROPHE..NKO LOW ... | 0xDF 0xBA #Lm NKO LAJANYALAN | 0xE0 0xA0 0x80..0x95 #Lo [22] SAMARITAN LETTER ALAF..SAMARITAN L... | 0xE0 0xA0 0x9A #Lm SAMARITAN MODIFIER LETTER EPENTHET... | 0xE0 0xA0 0xA4 #Lm SAMARITAN MODIFIER LETTER SHORT A | 0xE0 0xA0 0xA8 #Lm SAMARITAN MODIFIER LETTER I | 0xE0 0xA1 0x80..0x98 #Lo [25] MANDAIC LETTER HALQA..MANDAIC LETT... | 0xE0 0xA2 0xA0..0xB4 #Lo [21] ARABIC LETTER BEH WITH SMALL V BEL... | 0xE0 0xA2 0xB6..0xBD #Lo [8] ARABIC LETTER BEH WITH SMALL MEEM ... | 0xE0 0xA4 0x84..0xB9 #Lo [54] DEVANAGARI LETTER SHORT A..DEVANAG... | 0xE0 0xA4 0xBD #Lo DEVANAGARI SIGN AVAGRAHA | 0xE0 0xA5 0x90 #Lo DEVANAGARI OM | 0xE0 0xA5 0x98..0xA1 #Lo [10] DEVANAGARI LETTER QA..DEVANAGARI L... | 0xE0 0xA5 0xB1 #Lm DEVANAGARI SIGN HIGH SPACING DOT | 0xE0 0xA5 0xB2..0xFF #Lo [15] DEVANAGARI LETTER CANDRA A..BENGAL... | 0xE0 0xA6 0x00..0x80 # | 0xE0 0xA6 0x85..0x8C #Lo [8] BENGALI LETTER A..BENGALI LETTER V... | 0xE0 0xA6 0x8F..0x90 #Lo [2] BENGALI LETTER E..BENGALI LETTER AI | 0xE0 0xA6 0x93..0xA8 #Lo [22] BENGALI LETTER O..BENGALI LETTER NA | 0xE0 0xA6 0xAA..0xB0 #Lo [7] BENGALI LETTER PA..BENGALI LETTER RA | 0xE0 0xA6 0xB2 #Lo BENGALI LETTER LA | 0xE0 0xA6 0xB6..0xB9 #Lo [4] BENGALI LETTER SHA..BENGALI LETTER HA | 0xE0 0xA6 0xBD #Lo BENGALI SIGN AVAGRAHA | 0xE0 0xA7 0x8E #Lo BENGALI LETTER KHANDA TA | 0xE0 0xA7 0x9C..0x9D #Lo [2] BENGALI LETTER RRA..BENGALI LETTER... | 0xE0 0xA7 0x9F..0xA1 #Lo [3] BENGALI LETTER YYA..BENGALI LETTER... | 0xE0 0xA7 0xB0..0xB1 #Lo [2] BENGALI LETTER RA WITH MIDDLE DIAG... | 0xE0 0xA8 0x85..0x8A #Lo [6] GURMUKHI LETTER A..GURMUKHI LETTER UU | 0xE0 0xA8 0x8F..0x90 #Lo [2] GURMUKHI LETTER EE..GURMUKHI LETTE... | 0xE0 0xA8 0x93..0xA8 #Lo [22] GURMUKHI LETTER OO..GURMUKHI LETTE... | 0xE0 0xA8 0xAA..0xB0 #Lo [7] GURMUKHI LETTER PA..GURMUKHI LETTE... | 0xE0 0xA8 0xB2..0xB3 #Lo [2] GURMUKHI LETTER LA..GURMUKHI LETTE... | 0xE0 0xA8 0xB5..0xB6 #Lo [2] GURMUKHI LETTER VA..GURMUKHI LETTE... | 0xE0 0xA8 0xB8..0xB9 #Lo [2] GURMUKHI LETTER SA..GURMUKHI LETTE... | 0xE0 0xA9 0x99..0x9C #Lo [4] GURMUKHI LETTER KHHA..GURMUKHI LET... | 0xE0 0xA9 0x9E #Lo GURMUKHI LETTER FA | 0xE0 0xA9 0xB2..0xB4 #Lo [3] GURMUKHI IRI..GURMUKHI EK ONKAR | 0xE0 0xAA 0x85..0x8D #Lo [9] GUJARATI LETTER A..GUJARATI VOWEL ... | 0xE0 0xAA 0x8F..0x91 #Lo [3] GUJARATI LETTER E..GUJARATI VOWEL ... | 0xE0 0xAA 0x93..0xA8 #Lo [22] GUJARATI LETTER O..GUJARATI LETTER NA | 0xE0 0xAA 0xAA..0xB0 #Lo [7] GUJARATI LETTER PA..GUJARATI LETTE... | 0xE0 0xAA 0xB2..0xB3 #Lo [2] GUJARATI LETTER LA..GUJARATI LETTE... | 0xE0 0xAA 0xB5..0xB9 #Lo [5] GUJARATI LETTER VA..GUJARATI LETTE... | 0xE0 0xAA 0xBD #Lo GUJARATI SIGN AVAGRAHA | 0xE0 0xAB 0x90 #Lo GUJARATI OM | 0xE0 0xAB 0xA0..0xA1 #Lo [2] GUJARATI LETTER VOCALIC RR..GUJARA... | 0xE0 0xAB 0xB9 #Lo GUJARATI LETTER ZHA | 0xE0 0xAC 0x85..0x8C #Lo [8] ORIYA LETTER A..ORIYA LETTER VOCAL... | 0xE0 0xAC 0x8F..0x90 #Lo [2] ORIYA LETTER E..ORIYA LETTER AI | 0xE0 0xAC 0x93..0xA8 #Lo [22] ORIYA LETTER O..ORIYA LETTER NA | 0xE0 0xAC 0xAA..0xB0 #Lo [7] ORIYA LETTER PA..ORIYA LETTER RA | 0xE0 0xAC 0xB2..0xB3 #Lo [2] ORIYA LETTER LA..ORIYA LETTER LLA | 0xE0 0xAC 0xB5..0xB9 #Lo [5] ORIYA LETTER VA..ORIYA LETTER HA | 0xE0 0xAC 0xBD #Lo ORIYA SIGN AVAGRAHA | 0xE0 0xAD 0x9C..0x9D #Lo [2] ORIYA LETTER RRA..ORIYA LETTER RHA | 0xE0 0xAD 0x9F..0xA1 #Lo [3] ORIYA LETTER YYA..ORIYA LETTER VOC... | 0xE0 0xAD 0xB1 #Lo ORIYA LETTER WA | 0xE0 0xAE 0x83 #Lo TAMIL SIGN VISARGA | 0xE0 0xAE 0x85..0x8A #Lo [6] TAMIL LETTER A..TAMIL LETTER UU | 0xE0 0xAE 0x8E..0x90 #Lo [3] TAMIL LETTER E..TAMIL LETTER AI | 0xE0 0xAE 0x92..0x95 #Lo [4] TAMIL LETTER O..TAMIL LETTER KA | 0xE0 0xAE 0x99..0x9A #Lo [2] TAMIL LETTER NGA..TAMIL LETTER CA | 0xE0 0xAE 0x9C #Lo TAMIL LETTER JA | 0xE0 0xAE 0x9E..0x9F #Lo [2] TAMIL LETTER NYA..TAMIL LETTER TTA | 0xE0 0xAE 0xA3..0xA4 #Lo [2] TAMIL LETTER NNA..TAMIL LETTER TA | 0xE0 0xAE 0xA8..0xAA #Lo [3] TAMIL LETTER NA..TAMIL LETTER PA | 0xE0 0xAE 0xAE..0xB9 #Lo [12] TAMIL LETTER MA..TAMIL LETTER HA | 0xE0 0xAF 0x90 #Lo TAMIL OM | 0xE0 0xB0 0x85..0x8C #Lo [8] TELUGU LETTER A..TELUGU LETTER VOC... | 0xE0 0xB0 0x8E..0x90 #Lo [3] TELUGU LETTER E..TELUGU LETTER AI | 0xE0 0xB0 0x92..0xA8 #Lo [23] TELUGU LETTER O..TELUGU LETTER NA | 0xE0 0xB0 0xAA..0xB9 #Lo [16] TELUGU LETTER PA..TELUGU LETTER HA | 0xE0 0xB0 0xBD #Lo TELUGU SIGN AVAGRAHA | 0xE0 0xB1 0x98..0x9A #Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA | 0xE0 0xB1 0xA0..0xA1 #Lo [2] TELUGU LETTER VOCALIC RR..TELUGU L... | 0xE0 0xB2 0x80 #Lo KANNADA SIGN SPACING CANDRABINDU | 0xE0 0xB2 0x85..0x8C #Lo [8] KANNADA LETTER A..KANNADA LETTER V... | 0xE0 0xB2 0x8E..0x90 #Lo [3] KANNADA LETTER E..KANNADA LETTER AI | 0xE0 0xB2 0x92..0xA8 #Lo [23] KANNADA LETTER O..KANNADA LETTER NA | 0xE0 0xB2 0xAA..0xB3 #Lo [10] KANNADA LETTER PA..KANNADA LETTER LLA | 0xE0 0xB2 0xB5..0xB9 #Lo [5] KANNADA LETTER VA..KANNADA LETTER HA | 0xE0 0xB2 0xBD #Lo KANNADA SIGN AVAGRAHA | 0xE0 0xB3 0x9E #Lo KANNADA LETTER FA | 0xE0 0xB3 0xA0..0xA1 #Lo [2] KANNADA LETTER VOCALIC RR..KANNADA... | 0xE0 0xB3 0xB1..0xB2 #Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA ... | 0xE0 0xB4 0x85..0x8C #Lo [8] MALAYALAM LETTER A..MALAYALAM LETT... | 0xE0 0xB4 0x8E..0x90 #Lo [3] MALAYALAM LETTER E..MALAYALAM LETT... | 0xE0 0xB4 0x92..0xBA #Lo [41] MALAYALAM LETTER O..MALAYALAM LETT... | 0xE0 0xB4 0xBD #Lo MALAYALAM SIGN AVAGRAHA | 0xE0 0xB5 0x8E #Lo MALAYALAM LETTER DOT REPH | 0xE0 0xB5 0x94..0x96 #Lo [3] MALAYALAM LETTER CHILLU M..MALAYAL... | 0xE0 0xB5 0x9F..0xA1 #Lo [3] MALAYALAM LETTER ARCHAIC II..MALAY... | 0xE0 0xB5 0xBA..0xBF #Lo [6] MALAYALAM LETTER CHILLU NN..MALAYA... | 0xE0 0xB6 0x85..0x96 #Lo [18] SINHALA LETTER AYANNA..SINHALA LET... | 0xE0 0xB6 0x9A..0xB1 #Lo [24] SINHALA LETTER ALPAPRAANA KAYANNA.... | 0xE0 0xB6 0xB3..0xBB #Lo [9] SINHALA LETTER SANYAKA DAYANNA..SI... | 0xE0 0xB6 0xBD #Lo SINHALA LETTER DANTAJA LAYANNA | 0xE0 0xB7 0x80..0x86 #Lo [7] SINHALA LETTER VAYANNA..SINHALA LE... | 0xE0 0xB8 0x81..0xB0 #Lo [48] THAI CHARACTER KO KAI..THAI CHARAC... | 0xE0 0xB8 0xB2..0xB3 #Lo [2] THAI CHARACTER SARA AA..THAI CHARA... | 0xE0 0xB9 0x80..0x85 #Lo [6] THAI CHARACTER SARA E..THAI CHARAC... | 0xE0 0xB9 0x86 #Lm THAI CHARACTER MAIYAMOK | 0xE0 0xBA 0x81..0x82 #Lo [2] LAO LETTER KO..LAO LETTER KHO SUNG | 0xE0 0xBA 0x84 #Lo LAO LETTER KHO TAM | 0xE0 0xBA 0x87..0x88 #Lo [2] LAO LETTER NGO..LAO LETTER CO | 0xE0 0xBA 0x8A #Lo LAO LETTER SO TAM | 0xE0 0xBA 0x8D #Lo LAO LETTER NYO | 0xE0 0xBA 0x94..0x97 #Lo [4] LAO LETTER DO..LAO LETTER THO TAM | 0xE0 0xBA 0x99..0x9F #Lo [7] LAO LETTER NO..LAO LETTER FO SUNG | 0xE0 0xBA 0xA1..0xA3 #Lo [3] LAO LETTER MO..LAO LETTER LO LING | 0xE0 0xBA 0xA5 #Lo LAO LETTER LO LOOT | 0xE0 0xBA 0xA7 #Lo LAO LETTER WO | 0xE0 0xBA 0xAA..0xAB #Lo [2] LAO LETTER SO SUNG..LAO LETTER HO ... | 0xE0 0xBA 0xAD..0xB0 #Lo [4] LAO LETTER O..LAO VOWEL SIGN A | 0xE0 0xBA 0xB2..0xB3 #Lo [2] LAO VOWEL SIGN AA..LAO VOWEL SIGN AM | 0xE0 0xBA 0xBD #Lo LAO SEMIVOWEL SIGN NYO | 0xE0 0xBB 0x80..0x84 #Lo [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI | 0xE0 0xBB 0x86 #Lm LAO KO LA | 0xE0 0xBB 0x9C..0x9F #Lo [4] LAO HO NO..LAO LETTER KHMU NYO | 0xE0 0xBC 0x80 #Lo TIBETAN SYLLABLE OM | 0xE0 0xBD 0x80..0x87 #Lo [8] TIBETAN LETTER KA..TIBETAN LETTER JA | 0xE0 0xBD 0x89..0xAC #Lo [36] TIBETAN LETTER NYA..TIBETAN LETTER... | 0xE0 0xBE 0x88..0x8C #Lo [5] TIBETAN SIGN LCE TSA CAN..TIBETAN ... | 0xE1 0x80 0x80..0xAA #Lo [43] MYANMAR LETTER KA..MYANMAR LETTER AU | 0xE1 0x80 0xBF #Lo MYANMAR LETTER GREAT SA | 0xE1 0x81 0x90..0x95 #Lo [6] MYANMAR LETTER SHA..MYANMAR LETTER... | 0xE1 0x81 0x9A..0x9D #Lo [4] MYANMAR LETTER MON NGA..MYANMAR LE... | 0xE1 0x81 0xA1 #Lo MYANMAR LETTER SGAW KAREN SHA | 0xE1 0x81 0xA5..0xA6 #Lo [2] MYANMAR LETTER WESTERN PWO KAREN T... | 0xE1 0x81 0xAE..0xB0 #Lo [3] MYANMAR LETTER EASTERN PWO KAREN N... | 0xE1 0x81 0xB5..0xFF #Lo [13] MYANMAR LETTER SHAN KA..MYANMAR LE... | 0xE1 0x82 0x00..0x81 # | 0xE1 0x82 0x8E #Lo MYANMAR LETTER RUMAI PALAUNG FA | 0xE1 0x82 0xA0..0xFF #L& [38] GEORGIAN CAPITAL LETTER AN..GEORGI... | 0xE1 0x83 0x00..0x85 # | 0xE1 0x83 0x87 #L& GEORGIAN CAPITAL LETTER YN | 0xE1 0x83 0x8D #L& GEORGIAN CAPITAL LETTER AEN | 0xE1 0x83 0x90..0xBA #Lo [43] GEORGIAN LETTER AN..GEORGIAN LETTE... | 0xE1 0x83 0xBC #Lm MODIFIER LETTER GEORGIAN NAR | 0xE1 0x83 0xBD..0xFF #Lo [332] GEORGIAN LETTER AEN..ETHIOPIC ... | 0xE1 0x84..0x88 0x00..0xFF # | 0xE1 0x89 0x00..0x88 # | 0xE1 0x89 0x8A..0x8D #Lo [4] ETHIOPIC SYLLABLE QWI..ETHIOPIC SY... | 0xE1 0x89 0x90..0x96 #Lo [7] ETHIOPIC SYLLABLE QHA..ETHIOPIC SY... | 0xE1 0x89 0x98 #Lo ETHIOPIC SYLLABLE QHWA | 0xE1 0x89 0x9A..0x9D #Lo [4] ETHIOPIC SYLLABLE QHWI..ETHIOPIC S... | 0xE1 0x89 0xA0..0xFF #Lo [41] ETHIOPIC SYLLABLE BA..ETHIOPIC SYL... | 0xE1 0x8A 0x00..0x88 # | 0xE1 0x8A 0x8A..0x8D #Lo [4] ETHIOPIC SYLLABLE XWI..ETHIOPIC SY... | 0xE1 0x8A 0x90..0xB0 #Lo [33] ETHIOPIC SYLLABLE NA..ETHIOPIC SYL... | 0xE1 0x8A 0xB2..0xB5 #Lo [4] ETHIOPIC SYLLABLE KWI..ETHIOPIC SY... | 0xE1 0x8A 0xB8..0xBE #Lo [7] ETHIOPIC SYLLABLE KXA..ETHIOPIC SY... | 0xE1 0x8B 0x80 #Lo ETHIOPIC SYLLABLE KXWA | 0xE1 0x8B 0x82..0x85 #Lo [4] ETHIOPIC SYLLABLE KXWI..ETHIOPIC S... | 0xE1 0x8B 0x88..0x96 #Lo [15] ETHIOPIC SYLLABLE WA..ETHIOPIC SYL... | 0xE1 0x8B 0x98..0xFF #Lo [57] ETHIOPIC SYLLABLE ZA..ETHIOPIC SYL... | 0xE1 0x8C 0x00..0x90 # | 0xE1 0x8C 0x92..0x95 #Lo [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SY... | 0xE1 0x8C 0x98..0xFF #Lo [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SY... | 0xE1 0x8D 0x00..0x9A # | 0xE1 0x8E 0x80..0x8F #Lo [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..E... | 0xE1 0x8E 0xA0..0xFF #L& [86] CHEROKEE LETTER A..CHEROKEE LETTER MV | 0xE1 0x8F 0x00..0xB5 # | 0xE1 0x8F 0xB8..0xBD #L& [6] CHEROKEE SMALL LETTER YE..CHEROKEE... | 0xE1 0x90 0x81..0xFF #Lo [620] CANADIAN SYLLABICS E..CANADIAN... | 0xE1 0x91..0x98 0x00..0xFF # | 0xE1 0x99 0x00..0xAC # | 0xE1 0x99 0xAF..0xBF #Lo [17] CANADIAN SYLLABICS QAI..CANADIAN S... | 0xE1 0x9A 0x81..0x9A #Lo [26] OGHAM LETTER BEITH..OGHAM LETTER P... | 0xE1 0x9A 0xA0..0xFF #Lo [75] RUNIC LETTER FEHU FEOH FE F..RUNIC... | 0xE1 0x9B 0x00..0xAA # | 0xE1 0x9B 0xAE..0xB0 #Nl [3] RUNIC ARLAUG SYMBOL..RUNIC BELGTHO... | 0xE1 0x9B 0xB1..0xB8 #Lo [8] RUNIC LETTER K..RUNIC LETTER FRANK... | 0xE1 0x9C 0x80..0x8C #Lo [13] TAGALOG LETTER A..TAGALOG LETTER YA | 0xE1 0x9C 0x8E..0x91 #Lo [4] TAGALOG LETTER LA..TAGALOG LETTER HA | 0xE1 0x9C 0xA0..0xB1 #Lo [18] HANUNOO LETTER A..HANUNOO LETTER HA | 0xE1 0x9D 0x80..0x91 #Lo [18] BUHID LETTER A..BUHID LETTER HA | 0xE1 0x9D 0xA0..0xAC #Lo [13] TAGBANWA LETTER A..TAGBANWA LETTER YA | 0xE1 0x9D 0xAE..0xB0 #Lo [3] TAGBANWA LETTER LA..TAGBANWA LETTE... | 0xE1 0x9E 0x80..0xB3 #Lo [52] KHMER LETTER KA..KHMER INDEPENDENT... | 0xE1 0x9F 0x97 #Lm KHMER SIGN LEK TOO | 0xE1 0x9F 0x9C #Lo KHMER SIGN AVAKRAHASANYA | 0xE1 0xA0 0xA0..0xFF #Lo [35] MONGOLIAN LETTER A..MONGOLIAN LETT... | 0xE1 0xA1 0x00..0x82 # | 0xE1 0xA1 0x83 #Lm MONGOLIAN LETTER TODO LONG VOWEL SIGN | 0xE1 0xA1 0x84..0xB7 #Lo [52] MONGOLIAN LETTER TODO E..MONGOLIAN... | 0xE1 0xA2 0x80..0x84 #Lo [5] MONGOLIAN LETTER ALI GALI ANUSVARA... | 0xE1 0xA2 0x85..0x86 #Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..... | 0xE1 0xA2 0x87..0xA8 #Lo [34] MONGOLIAN LETTER ALI GALI A..MONGO... | 0xE1 0xA2 0xAA #Lo MONGOLIAN LETTER MANCHU ALI GALI LHA | 0xE1 0xA2 0xB0..0xFF #Lo [70] CANADIAN SYLLABICS OY..CANADIAN SY... | 0xE1 0xA3 0x00..0xB5 # | 0xE1 0xA4 0x80..0x9E #Lo [31] LIMBU VOWEL-CARRIER LETTER..LIMBU ... | 0xE1 0xA5 0x90..0xAD #Lo [30] TAI LE LETTER KA..TAI LE LETTER AI | 0xE1 0xA5 0xB0..0xB4 #Lo [5] TAI LE LETTER TONE-2..TAI LE LETTE... | 0xE1 0xA6 0x80..0xAB #Lo [44] NEW TAI LUE LETTER HIGH QA..NEW TA... | 0xE1 0xA6 0xB0..0xFF #Lo [26] NEW TAI LUE VOWEL SIGN VOWEL SHORT... | 0xE1 0xA7 0x00..0x89 # | 0xE1 0xA8 0x80..0x96 #Lo [23] BUGINESE LETTER KA..BUGINESE LETTE... | 0xE1 0xA8 0xA0..0xFF #Lo [53] TAI THAM LETTER HIGH KA..TAI THAM ... | 0xE1 0xA9 0x00..0x94 # | 0xE1 0xAA 0xA7 #Lm TAI THAM SIGN MAI YAMOK | 0xE1 0xAC 0x85..0xB3 #Lo [47] BALINESE LETTER AKARA..BALINESE LE... | 0xE1 0xAD 0x85..0x8B #Lo [7] BALINESE LETTER KAF SASAK..BALINES... | 0xE1 0xAE 0x83..0xA0 #Lo [30] SUNDANESE LETTER A..SUNDANESE LETT... | 0xE1 0xAE 0xAE..0xAF #Lo [2] SUNDANESE LETTER KHA..SUNDANESE LE... | 0xE1 0xAE 0xBA..0xFF #Lo [44] SUNDANESE AVAGRAHA..BATAK LETTER U | 0xE1 0xAF 0x00..0xA5 # | 0xE1 0xB0 0x80..0xA3 #Lo [36] LEPCHA LETTER KA..LEPCHA LETTER A | 0xE1 0xB1 0x8D..0x8F #Lo [3] LEPCHA LETTER TTA..LEPCHA LETTER DDA | 0xE1 0xB1 0x9A..0xB7 #Lo [30] OL CHIKI LETTER LA..OL CHIKI LETTE... | 0xE1 0xB1 0xB8..0xBD #Lm [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD | 0xE1 0xB2 0x80..0x88 #L& [9] CYRILLIC SMALL LETTER ROUNDED VE..... | 0xE1 0xB3 0xA9..0xAC #Lo [4] VEDIC SIGN ANUSVARA ANTARGOMUKHA..... | 0xE1 0xB3 0xAE..0xB1 #Lo [4] VEDIC SIGN HEXIFORM LONG ANUSVARA.... | 0xE1 0xB3 0xB5..0xB6 #Lo [2] VEDIC SIGN JIHVAMULIYA..VEDIC SIGN... | 0xE1 0xB4 0x80..0xAB #L& [44] LATIN LETTER SMALL CAPITAL A..CYRI... | 0xE1 0xB4 0xAC..0xFF #Lm [63] MODIFIER LETTER CAPITAL A..GREEK S... | 0xE1 0xB5 0x00..0xAA # | 0xE1 0xB5 0xAB..0xB7 #L& [13] LATIN SMALL LETTER UE..LATIN SMALL... | 0xE1 0xB5 0xB8 #Lm MODIFIER LETTER CYRILLIC EN | 0xE1 0xB5 0xB9..0xFF #L& [34] LATIN SMALL LETTER INSULAR G..LATI... | 0xE1 0xB6 0x00..0x9A # | 0xE1 0xB6 0x9B..0xBF #Lm [37] MODIFIER LETTER SMALL TURNED ALPHA... | 0xE1 0xB8 0x80..0xFF #L& [278] LATIN CAPITAL LETTER A WITH RI... | 0xE1 0xB9..0xBB 0x00..0xFF # | 0xE1 0xBC 0x00..0x95 # | 0xE1 0xBC 0x98..0x9D #L& [6] GREEK CAPITAL LETTER EPSILON WITH ... | 0xE1 0xBC 0xA0..0xFF #L& [38] GREEK SMALL LETTER ETA WITH PSILI.... | 0xE1 0xBD 0x00..0x85 # | 0xE1 0xBD 0x88..0x8D #L& [6] GREEK CAPITAL LETTER OMICRON WITH ... | 0xE1 0xBD 0x90..0x97 #L& [8] GREEK SMALL LETTER UPSILON WITH PS... | 0xE1 0xBD 0x99 #L& GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBD 0x9B #L& GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBD 0x9D #L& GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBD 0x9F..0xBD #L& [31] GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBE 0x80..0xB4 #L& [53] GREEK SMALL LETTER ALPHA WITH PSIL... | 0xE1 0xBE 0xB6..0xBC #L& [7] GREEK SMALL LETTER ALPHA WITH PERI... | 0xE1 0xBE 0xBE #L& GREEK PROSGEGRAMMENI | 0xE1 0xBF 0x82..0x84 #L& [3] GREEK SMALL LETTER ETA WITH VARIA ... | 0xE1 0xBF 0x86..0x8C #L& [7] GREEK SMALL LETTER ETA WITH PERISP... | 0xE1 0xBF 0x90..0x93 #L& [4] GREEK SMALL LETTER IOTA WITH VRACH... | 0xE1 0xBF 0x96..0x9B #L& [6] GREEK SMALL LETTER IOTA WITH PERIS... | 0xE1 0xBF 0xA0..0xAC #L& [13] GREEK SMALL LETTER UPSILON WITH VR... | 0xE1 0xBF 0xB2..0xB4 #L& [3] GREEK SMALL LETTER OMEGA WITH VARI... | 0xE1 0xBF 0xB6..0xBC #L& [7] GREEK SMALL LETTER OMEGA WITH PERI... | 0xE2 0x81 0xB1 #Lm SUPERSCRIPT LATIN SMALL LETTER I | 0xE2 0x81 0xBF #Lm SUPERSCRIPT LATIN SMALL LETTER N | 0xE2 0x82 0x90..0x9C #Lm [13] LATIN SUBSCRIPT SMALL LETTER A..LA... | 0xE2 0x84 0x82 #L& DOUBLE-STRUCK CAPITAL C | 0xE2 0x84 0x87 #L& EULER CONSTANT | 0xE2 0x84 0x8A..0x93 #L& [10] SCRIPT SMALL G..SCRIPT SMALL L | 0xE2 0x84 0x95 #L& DOUBLE-STRUCK CAPITAL N | 0xE2 0x84 0x98 #Sm SCRIPT CAPITAL P | 0xE2 0x84 0x99..0x9D #L& [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-ST... | 0xE2 0x84 0xA4 #L& DOUBLE-STRUCK CAPITAL Z | 0xE2 0x84 0xA6 #L& OHM SIGN | 0xE2 0x84 0xA8 #L& BLACK-LETTER CAPITAL Z | 0xE2 0x84 0xAA..0xAD #L& [4] KELVIN SIGN..BLACK-LETTER CAPITAL C | 0xE2 0x84 0xAE #So ESTIMATED SYMBOL | 0xE2 0x84 0xAF..0xB4 #L& [6] SCRIPT SMALL E..SCRIPT SMALL O | 0xE2 0x84 0xB5..0xB8 #Lo [4] ALEF SYMBOL..DALET SYMBOL | 0xE2 0x84 0xB9 #L& INFORMATION SOURCE | 0xE2 0x84 0xBC..0xBF #L& [4] DOUBLE-STRUCK SMALL PI..DOUBLE-STR... | 0xE2 0x85 0x85..0x89 #L& [5] DOUBLE-STRUCK ITALIC CAPITAL D..DO... | 0xE2 0x85 0x8E #L& TURNED SMALL F | 0xE2 0x85 0xA0..0xFF #Nl [35] ROMAN NUMERAL ONE..ROMAN NUMERAL T... | 0xE2 0x86 0x00..0x82 # | 0xE2 0x86 0x83..0x84 #L& [2] ROMAN NUMERAL REVERSED ONE HUNDRED... | 0xE2 0x86 0x85..0x88 #Nl [4] ROMAN NUMERAL SIX LATE FORM..ROMAN... | 0xE2 0xB0 0x80..0xAE #L& [47] GLAGOLITIC CAPITAL LETTER AZU..GLA... | 0xE2 0xB0 0xB0..0xFF #L& [47] GLAGOLITIC SMALL LETTER AZU..GLAGO... | 0xE2 0xB1 0x00..0x9E # | 0xE2 0xB1 0xA0..0xBB #L& [28] LATIN CAPITAL LETTER L WITH DOUBLE... | 0xE2 0xB1 0xBC..0xBD #Lm [2] LATIN SUBSCRIPT SMALL LETTER J..MO... | 0xE2 0xB1 0xBE..0xFF #L& [103] LATIN CAPITAL LETTER S WITH SW... | 0xE2 0xB2..0xB2 0x00..0xFF # | 0xE2 0xB3 0x00..0xA4 # | 0xE2 0xB3 0xAB..0xAE #L& [4] COPTIC CAPITAL LETTER CRYPTOGRAMMI... | 0xE2 0xB3 0xB2..0xB3 #L& [2] COPTIC CAPITAL LETTER BOHAIRIC KHE... | 0xE2 0xB4 0x80..0xA5 #L& [38] GEORGIAN SMALL LETTER AN..GEORGIAN... | 0xE2 0xB4 0xA7 #L& GEORGIAN SMALL LETTER YN | 0xE2 0xB4 0xAD #L& GEORGIAN SMALL LETTER AEN | 0xE2 0xB4 0xB0..0xFF #Lo [56] TIFINAGH LETTER YA..TIFINAGH LETTE... | 0xE2 0xB5 0x00..0xA7 # | 0xE2 0xB5 0xAF #Lm TIFINAGH MODIFIER LETTER LABIALIZA... | 0xE2 0xB6 0x80..0x96 #Lo [23] ETHIOPIC SYLLABLE LOA..ETHIOPIC SY... | 0xE2 0xB6 0xA0..0xA6 #Lo [7] ETHIOPIC SYLLABLE SSA..ETHIOPIC SY... | 0xE2 0xB6 0xA8..0xAE #Lo [7] ETHIOPIC SYLLABLE CCA..ETHIOPIC SY... | 0xE2 0xB6 0xB0..0xB6 #Lo [7] ETHIOPIC SYLLABLE ZZA..ETHIOPIC SY... | 0xE2 0xB6 0xB8..0xBE #Lo [7] ETHIOPIC SYLLABLE CCHA..ETHIOPIC S... | 0xE2 0xB7 0x80..0x86 #Lo [7] ETHIOPIC SYLLABLE QYA..ETHIOPIC SY... | 0xE2 0xB7 0x88..0x8E #Lo [7] ETHIOPIC SYLLABLE KYA..ETHIOPIC SY... | 0xE2 0xB7 0x90..0x96 #Lo [7] ETHIOPIC SYLLABLE XYA..ETHIOPIC SY... | 0xE2 0xB7 0x98..0x9E #Lo [7] ETHIOPIC SYLLABLE GYA..ETHIOPIC SY... | 0xE3 0x80 0x85 #Lm IDEOGRAPHIC ITERATION MARK | 0xE3 0x80 0x86 #Lo IDEOGRAPHIC CLOSING MARK | 0xE3 0x80 0x87 #Nl IDEOGRAPHIC NUMBER ZERO | 0xE3 0x80 0xA1..0xA9 #Nl [9] HANGZHOU NUMERAL ONE..HANGZHOU NUM... | 0xE3 0x80 0xB1..0xB5 #Lm [5] VERTICAL KANA REPEAT MARK..VERTICA... | 0xE3 0x80 0xB8..0xBA #Nl [3] HANGZHOU NUMERAL TEN..HANGZHOU NUM... | 0xE3 0x80 0xBB #Lm VERTICAL IDEOGRAPHIC ITERATION MARK | 0xE3 0x80 0xBC #Lo MASU MARK | 0xE3 0x81 0x81..0xFF #Lo [86] HIRAGANA LETTER SMALL A..HIRAGANA ... | 0xE3 0x82 0x00..0x96 # | 0xE3 0x82 0x9B..0x9C #Sk [2] KATAKANA-HIRAGANA VOICED SOUND MAR... | 0xE3 0x82 0x9D..0x9E #Lm [2] HIRAGANA ITERATION MARK..HIRAGANA ... | 0xE3 0x82 0x9F #Lo HIRAGANA DIGRAPH YORI | 0xE3 0x82 0xA1..0xFF #Lo [90] KATAKANA LETTER SMALL A..KATAKANA ... | 0xE3 0x83 0x00..0xBA # | 0xE3 0x83 0xBC..0xBE #Lm [3] KATAKANA-HIRAGANA PROLONGED SOUND ... | 0xE3 0x83 0xBF #Lo KATAKANA DIGRAPH KOTO | 0xE3 0x84 0x85..0xAD #Lo [41] BOPOMOFO LETTER B..BOPOMOFO LETTER IH | 0xE3 0x84 0xB1..0xFF #Lo [94] HANGUL LETTER KIYEOK..HANGUL L... | 0xE3 0x85..0x85 0x00..0xFF # | 0xE3 0x86 0x00..0x8E # | 0xE3 0x86 0xA0..0xBA #Lo [27] BOPOMOFO LETTER BU..BOPOMOFO LETTE... | 0xE3 0x87 0xB0..0xBF #Lo [16] KATAKANA LETTER SMALL KU..KATAKANA... | 0xE3 0x90 0x80..0xFF #Lo [6582] CJK UNIFIED IDEOGRAPH-3400..C... | 0xE3 0x91..0xFF 0x00..0xFF # | 0xE4 0x00 0x00..0xFF # | 0xE4 0x01..0xB5 0x00..0xFF # | 0xE4 0xB6 0x00..0xB5 # | 0xE4 0xB8 0x80..0xFF #Lo [20950] CJK UNIFIED IDEOGRAPH-... | 0xE4 0xB9..0xFF 0x00..0xFF # | 0xE5..0xE8 0x00..0xFF 0x00..0xFF # | 0xE9 0x00 0x00..0xFF # | 0xE9 0x01..0xBE 0x00..0xFF # | 0xE9 0xBF 0x00..0x95 # | 0xEA 0x80 0x80..0x94 #Lo [21] YI SYLLABLE IT..YI SYLLABLE E | 0xEA 0x80 0x95 #Lm YI SYLLABLE WU | 0xEA 0x80 0x96..0xFF #Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR | 0xEA 0x81..0x91 0x00..0xFF # | 0xEA 0x92 0x00..0x8C # | 0xEA 0x93 0x90..0xB7 #Lo [40] LISU LETTER BA..LISU LETTER OE | 0xEA 0x93 0xB8..0xBD #Lm [6] LISU LETTER TONE MYA TI..LISU LETT... | 0xEA 0x94 0x80..0xFF #Lo [268] VAI SYLLABLE EE..VAI SYLLABLE NG | 0xEA 0x95..0x97 0x00..0xFF # | 0xEA 0x98 0x00..0x8B # | 0xEA 0x98 0x8C #Lm VAI SYLLABLE LENGTHENER | 0xEA 0x98 0x90..0x9F #Lo [16] VAI SYLLABLE NDOLE FA..VAI SYMBOL ... | 0xEA 0x98 0xAA..0xAB #Lo [2] VAI SYLLABLE NDOLE MA..VAI SYLLABL... | 0xEA 0x99 0x80..0xAD #L& [46] CYRILLIC CAPITAL LETTER ZEMLYA..CY... | 0xEA 0x99 0xAE #Lo CYRILLIC LETTER MULTIOCULAR O | 0xEA 0x99 0xBF #Lm CYRILLIC PAYEROK | 0xEA 0x9A 0x80..0x9B #L& [28] CYRILLIC CAPITAL LETTER DWE..CYRIL... | 0xEA 0x9A 0x9C..0x9D #Lm [2] MODIFIER LETTER CYRILLIC HARD SIGN... | 0xEA 0x9A 0xA0..0xFF #Lo [70] BAMUM LETTER A..BAMUM LETTER KI | 0xEA 0x9B 0x00..0xA5 # | 0xEA 0x9B 0xA6..0xAF #Nl [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM | 0xEA 0x9C 0x97..0x9F #Lm [9] MODIFIER LETTER DOT VERTICAL BAR..... | 0xEA 0x9C 0xA2..0xFF #L& [78] LATIN CAPITAL LETTER EGYPTOLOGICAL... | 0xEA 0x9D 0x00..0xAF # | 0xEA 0x9D 0xB0 #Lm MODIFIER LETTER US | 0xEA 0x9D 0xB1..0xFF #L& [23] LATIN SMALL LETTER DUM..LATIN SMAL... | 0xEA 0x9E 0x00..0x87 # | 0xEA 0x9E 0x88 #Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT | 0xEA 0x9E 0x8B..0x8E #L& [4] LATIN CAPITAL LETTER SALTILLO..LAT... | 0xEA 0x9E 0x8F #Lo LATIN LETTER SINOLOGICAL DOT | 0xEA 0x9E 0x90..0xAE #L& [31] LATIN CAPITAL LETTER N WITH DESCEN... | 0xEA 0x9E 0xB0..0xB7 #L& [8] LATIN CAPITAL LETTER TURNED K..LAT... | 0xEA 0x9F 0xB7 #Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I | 0xEA 0x9F 0xB8..0xB9 #Lm [2] MODIFIER LETTER CAPITAL H WITH STR... | 0xEA 0x9F 0xBA #L& LATIN LETTER SMALL CAPITAL TURNED M | 0xEA 0x9F 0xBB..0xFF #Lo [7] LATIN EPIGRAPHIC LETTER REVERSED F... | 0xEA 0xA0 0x00..0x81 # | 0xEA 0xA0 0x83..0x85 #Lo [3] SYLOTI NAGRI LETTER U..SYLOTI NAGR... | 0xEA 0xA0 0x87..0x8A #Lo [4] SYLOTI NAGRI LETTER KO..SYLOTI NAG... | 0xEA 0xA0 0x8C..0xA2 #Lo [23] SYLOTI NAGRI LETTER CO..SYLOTI NAG... | 0xEA 0xA1 0x80..0xB3 #Lo [52] PHAGS-PA LETTER KA..PHAGS-PA LETTE... | 0xEA 0xA2 0x82..0xB3 #Lo [50] SAURASHTRA LETTER A..SAURASHTRA LE... | 0xEA 0xA3 0xB2..0xB7 #Lo [6] DEVANAGARI SIGN SPACING CANDRABIND... | 0xEA 0xA3 0xBB #Lo DEVANAGARI HEADSTROKE | 0xEA 0xA3 0xBD #Lo DEVANAGARI JAIN OM | 0xEA 0xA4 0x8A..0xA5 #Lo [28] KAYAH LI LETTER KA..KAYAH LI LETTE... | 0xEA 0xA4 0xB0..0xFF #Lo [23] REJANG LETTER KA..REJANG LETTER A | 0xEA 0xA5 0x00..0x86 # | 0xEA 0xA5 0xA0..0xBC #Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANG... | 0xEA 0xA6 0x84..0xB2 #Lo [47] JAVANESE LETTER A..JAVANESE LETTER HA | 0xEA 0xA7 0x8F #Lm JAVANESE PANGRANGKEP | 0xEA 0xA7 0xA0..0xA4 #Lo [5] MYANMAR LETTER SHAN GHA..MYANMAR L... | 0xEA 0xA7 0xA6 #Lm MYANMAR MODIFIER LETTER SHAN REDUP... | 0xEA 0xA7 0xA7..0xAF #Lo [9] MYANMAR LETTER TAI LAING NYA..MYAN... | 0xEA 0xA7 0xBA..0xBE #Lo [5] MYANMAR LETTER TAI LAING LLA..MYAN... | 0xEA 0xA8 0x80..0xA8 #Lo [41] CHAM LETTER A..CHAM LETTER HA | 0xEA 0xA9 0x80..0x82 #Lo [3] CHAM LETTER FINAL K..CHAM LETTER F... | 0xEA 0xA9 0x84..0x8B #Lo [8] CHAM LETTER FINAL CH..CHAM LETTER ... | 0xEA 0xA9 0xA0..0xAF #Lo [16] MYANMAR LETTER KHAMTI GA..MYANMAR ... | 0xEA 0xA9 0xB0 #Lm MYANMAR MODIFIER LETTER KHAMTI RED... | 0xEA 0xA9 0xB1..0xB6 #Lo [6] MYANMAR LETTER KHAMTI XA..MYANMAR ... | 0xEA 0xA9 0xBA #Lo MYANMAR LETTER AITON RA | 0xEA 0xA9 0xBE..0xFF #Lo [50] MYANMAR LETTER SHWE PALAUNG CHA..T... | 0xEA 0xAA 0x00..0xAF # | 0xEA 0xAA 0xB1 #Lo TAI VIET VOWEL AA | 0xEA 0xAA 0xB5..0xB6 #Lo [2] TAI VIET VOWEL E..TAI VIET VOWEL O | 0xEA 0xAA 0xB9..0xBD #Lo [5] TAI VIET VOWEL UEA..TAI VIET VOWEL AN | 0xEA 0xAB 0x80 #Lo TAI VIET TONE MAI NUENG | 0xEA 0xAB 0x82 #Lo TAI VIET TONE MAI SONG | 0xEA 0xAB 0x9B..0x9C #Lo [2] TAI VIET SYMBOL KON..TAI VIET SYMB... | 0xEA 0xAB 0x9D #Lm TAI VIET SYMBOL SAM | 0xEA 0xAB 0xA0..0xAA #Lo [11] MEETEI MAYEK LETTER E..MEETEI MAYE... | 0xEA 0xAB 0xB2 #Lo MEETEI MAYEK ANJI | 0xEA 0xAB 0xB3..0xB4 #Lm [2] MEETEI MAYEK SYLLABLE REPETITION M... | 0xEA 0xAC 0x81..0x86 #Lo [6] ETHIOPIC SYLLABLE TTHU..ETHIOPIC S... | 0xEA 0xAC 0x89..0x8E #Lo [6] ETHIOPIC SYLLABLE DDHU..ETHIOPIC S... | 0xEA 0xAC 0x91..0x96 #Lo [6] ETHIOPIC SYLLABLE DZU..ETHIOPIC SY... | 0xEA 0xAC 0xA0..0xA6 #Lo [7] ETHIOPIC SYLLABLE CCHHA..ETHIOPIC ... | 0xEA 0xAC 0xA8..0xAE #Lo [7] ETHIOPIC SYLLABLE BBA..ETHIOPIC SY... | 0xEA 0xAC 0xB0..0xFF #L& [43] LATIN SMALL LETTER BARRED ALPHA..L... | 0xEA 0xAD 0x00..0x9A # | 0xEA 0xAD 0x9C..0x9F #Lm [4] MODIFIER LETTER SMALL HENG..MODIFI... | 0xEA 0xAD 0xA0..0xA5 #L& [6] LATIN SMALL LETTER SAKHA YAT..GREE... | 0xEA 0xAD 0xB0..0xFF #L& [80] CHEROKEE SMALL LETTER A..CHEROKEE ... | 0xEA 0xAE 0x00..0xBF # | 0xEA 0xAF 0x80..0xA2 #Lo [35] MEETEI MAYEK LETTER KOK..MEETEI MA... | 0xEA 0xB0 0x80..0xFF #Lo [11172] HANGUL SYLLABLE GA..HA... | 0xEA 0xB1..0xFF 0x00..0xFF # | 0xEB..0xEC 0x00..0xFF 0x00..0xFF # | 0xED 0x00 0x00..0xFF # | 0xED 0x01..0x9D 0x00..0xFF # | 0xED 0x9E 0x00..0xA3 # | 0xED 0x9E 0xB0..0xFF #Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUN... | 0xED 0x9F 0x00..0x86 # | 0xED 0x9F 0x8B..0xBB #Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANG... | 0xEF 0xA4 0x80..0xFF #Lo [366] CJK COMPATIBILITY IDEOGRAPH-F9... | 0xEF 0xA5..0xA8 0x00..0xFF # | 0xEF 0xA9 0x00..0xAD # | 0xEF 0xA9 0xB0..0xFF #Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA... | 0xEF 0xAA..0xAA 0x00..0xFF # | 0xEF 0xAB 0x00..0x99 # | 0xEF 0xAC 0x80..0x86 #L& [7] LATIN SMALL LIGATURE FF..LATIN SMA... | 0xEF 0xAC 0x93..0x97 #L& [5] ARMENIAN SMALL LIGATURE MEN NOW..A... | 0xEF 0xAC 0x9D #Lo HEBREW LETTER YOD WITH HIRIQ | 0xEF 0xAC 0x9F..0xA8 #Lo [10] HEBREW LIGATURE YIDDISH YOD YOD PA... | 0xEF 0xAC 0xAA..0xB6 #Lo [13] HEBREW LETTER SHIN WITH SHIN DOT..... | 0xEF 0xAC 0xB8..0xBC #Lo [5] HEBREW LETTER TET WITH DAGESH..HEB... | 0xEF 0xAC 0xBE #Lo HEBREW LETTER MEM WITH DAGESH | 0xEF 0xAD 0x80..0x81 #Lo [2] HEBREW LETTER NUN WITH DAGESH..HEB... | 0xEF 0xAD 0x83..0x84 #Lo [2] HEBREW LETTER FINAL PE WITH DAGESH... | 0xEF 0xAD 0x86..0xFF #Lo [108] HEBREW LETTER TSADI WITH DAGESH..A... | 0xEF 0xAE 0x00..0xB1 # | 0xEF 0xAF 0x93..0xFF #Lo [363] ARABIC LETTER NG ISOLATED FORM... | 0xEF 0xB0..0xB3 0x00..0xFF # | 0xEF 0xB4 0x00..0xBD # | 0xEF 0xB5 0x90..0xFF #Lo [64] ARABIC LIGATURE TEH WITH JEEM WITH... | 0xEF 0xB6 0x00..0x8F # | 0xEF 0xB6 0x92..0xFF #Lo [54] ARABIC LIGATURE MEEM WITH JEEM WIT... | 0xEF 0xB7 0x00..0x87 # | 0xEF 0xB7 0xB0..0xBB #Lo [12] ARABIC LIGATURE SALLA USED AS KORA... | 0xEF 0xB9 0xB0..0xB4 #Lo [5] ARABIC FATHATAN ISOLATED FORM..ARA... | 0xEF 0xB9 0xB6..0xFF #Lo [135] ARABIC FATHA ISOLATED FORM..AR... | 0xEF 0xBA..0xBA 0x00..0xFF # | 0xEF 0xBB 0x00..0xBC # | 0xEF 0xBC 0xA1..0xBA #L& [26] FULLWIDTH LATIN CAPITAL LETTER A..... | 0xEF 0xBD 0x81..0x9A #L& [26] FULLWIDTH LATIN SMALL LETTER A..FU... | 0xEF 0xBD 0xA6..0xAF #Lo [10] HALFWIDTH KATAKANA LETTER WO..HALF... | 0xEF 0xBD 0xB0 #Lm HALFWIDTH KATAKANA-HIRAGANA PROLON... | 0xEF 0xBD 0xB1..0xFF #Lo [45] HALFWIDTH KATAKANA LETTER A..HALFW... | 0xEF 0xBE 0x00..0x9D # | 0xEF 0xBE 0x9E..0x9F #Lm [2] HALFWIDTH KATAKANA VOICED SOUND MA... | 0xEF 0xBE 0xA0..0xBE #Lo [31] HALFWIDTH HANGUL FILLER..HALFWIDTH... | 0xEF 0xBF 0x82..0x87 #Lo [6] HALFWIDTH HANGUL LETTER A..HALFWID... | 0xEF 0xBF 0x8A..0x8F #Lo [6] HALFWIDTH HANGUL LETTER YEO..HALFW... | 0xEF 0xBF 0x92..0x97 #Lo [6] HALFWIDTH HANGUL LETTER YO..HALFWI... | 0xEF 0xBF 0x9A..0x9C #Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWI... | 0xF0 0x90 0x80 0x80..0x8B #Lo [12] LINEAR B SYLLABLE B008 A..LINEA... | 0xF0 0x90 0x80 0x8D..0xA6 #Lo [26] LINEAR B SYLLABLE B036 JO..LINE... | 0xF0 0x90 0x80 0xA8..0xBA #Lo [19] LINEAR B SYLLABLE B060 RA..LINE... | 0xF0 0x90 0x80 0xBC..0xBD #Lo [2] LINEAR B SYLLABLE B017 ZA..LINE... | 0xF0 0x90 0x80 0xBF..0xFF #Lo [15] LINEAR B SYLLABLE B020 ZO..LINE... | 0xF0 0x90 0x81 0x00..0x8D # | 0xF0 0x90 0x81 0x90..0x9D #Lo [14] LINEAR B SYMBOL B018..LINEAR B ... | 0xF0 0x90 0x82 0x80..0xFF #Lo [123] LINEAR B IDEOGRAM B100 MAN..LIN... | 0xF0 0x90 0x83 0x00..0xBA # | 0xF0 0x90 0x85 0x80..0xB4 #Nl [53] GREEK ACROPHONIC ATTIC ONE QUAR... | 0xF0 0x90 0x8A 0x80..0x9C #Lo [29] LYCIAN LETTER A..LYCIAN LETTER X | 0xF0 0x90 0x8A 0xA0..0xFF #Lo [49] CARIAN LETTER A..CARIAN LETTER ... | 0xF0 0x90 0x8B 0x00..0x90 # | 0xF0 0x90 0x8C 0x80..0x9F #Lo [32] OLD ITALIC LETTER A..OLD ITALIC... | 0xF0 0x90 0x8C 0xB0..0xFF #Lo [17] GOTHIC LETTER AHSA..GOTHIC LETT... | 0xF0 0x90 0x8D 0x00..0x80 # | 0xF0 0x90 0x8D 0x81 #Nl GOTHIC LETTER NINETY | 0xF0 0x90 0x8D 0x82..0x89 #Lo [8] GOTHIC LETTER RAIDA..GOTHIC LET... | 0xF0 0x90 0x8D 0x8A #Nl GOTHIC LETTER NINE HUNDRED | 0xF0 0x90 0x8D 0x90..0xB5 #Lo [38] OLD PERMIC LETTER AN..OLD PERMI... | 0xF0 0x90 0x8E 0x80..0x9D #Lo [30] UGARITIC LETTER ALPA..UGARITIC ... | 0xF0 0x90 0x8E 0xA0..0xFF #Lo [36] OLD PERSIAN SIGN A..OLD PERSIAN... | 0xF0 0x90 0x8F 0x00..0x83 # | 0xF0 0x90 0x8F 0x88..0x8F #Lo [8] OLD PERSIAN SIGN AURAMAZDAA..OL... | 0xF0 0x90 0x8F 0x91..0x95 #Nl [5] OLD PERSIAN NUMBER ONE..OLD PER... | 0xF0 0x90 0x90 0x80..0xFF #L& [80] DESERET CAPITAL LETTER LONG I..... | 0xF0 0x90 0x91 0x00..0x8F # | 0xF0 0x90 0x91 0x90..0xFF #Lo [78] SHAVIAN LETTER PEEP..OSMANYA LE... | 0xF0 0x90 0x92 0x00..0x9D # | 0xF0 0x90 0x92 0xB0..0xFF #L& [36] OSAGE CAPITAL LETTER A..OSAGE C... | 0xF0 0x90 0x93 0x00..0x93 # | 0xF0 0x90 0x93 0x98..0xBB #L& [36] OSAGE SMALL LETTER A..OSAGE SMA... | 0xF0 0x90 0x94 0x80..0xA7 #Lo [40] ELBASAN LETTER A..ELBASAN LETTE... | 0xF0 0x90 0x94 0xB0..0xFF #Lo [52] CAUCASIAN ALBANIAN LETTER ALT..... | 0xF0 0x90 0x95 0x00..0xA3 # | 0xF0 0x90 0x98 0x80..0xFF #Lo [311] LINEAR A SIGN AB001..LINE... | 0xF0 0x90 0x99..0x9B 0x00..0xFF # | 0xF0 0x90 0x9C 0x00..0xB6 # | 0xF0 0x90 0x9D 0x80..0x95 #Lo [22] LINEAR A SIGN A701 A..LINEAR A ... | 0xF0 0x90 0x9D 0xA0..0xA7 #Lo [8] LINEAR A SIGN A800..LINEAR A SI... | 0xF0 0x90 0xA0 0x80..0x85 #Lo [6] CYPRIOT SYLLABLE A..CYPRIOT SYL... | 0xF0 0x90 0xA0 0x88 #Lo CYPRIOT SYLLABLE JO | 0xF0 0x90 0xA0 0x8A..0xB5 #Lo [44] CYPRIOT SYLLABLE KA..CYPRIOT SY... | 0xF0 0x90 0xA0 0xB7..0xB8 #Lo [2] CYPRIOT SYLLABLE XA..CYPRIOT SY... | 0xF0 0x90 0xA0 0xBC #Lo CYPRIOT SYLLABLE ZA | 0xF0 0x90 0xA0 0xBF..0xFF #Lo [23] CYPRIOT SYLLABLE ZO..IMPERIAL A... | 0xF0 0x90 0xA1 0x00..0x95 # | 0xF0 0x90 0xA1 0xA0..0xB6 #Lo [23] PALMYRENE LETTER ALEPH..PALMYRE... | 0xF0 0x90 0xA2 0x80..0x9E #Lo [31] NABATAEAN LETTER FINAL ALEPH..N... | 0xF0 0x90 0xA3 0xA0..0xB2 #Lo [19] HATRAN LETTER ALEPH..HATRAN LET... | 0xF0 0x90 0xA3 0xB4..0xB5 #Lo [2] HATRAN LETTER SHIN..HATRAN LETT... | 0xF0 0x90 0xA4 0x80..0x95 #Lo [22] PHOENICIAN LETTER ALF..PHOENICI... | 0xF0 0x90 0xA4 0xA0..0xB9 #Lo [26] LYDIAN LETTER A..LYDIAN LETTER C | 0xF0 0x90 0xA6 0x80..0xB7 #Lo [56] MEROITIC HIEROGLYPHIC LETTER A.... | 0xF0 0x90 0xA6 0xBE..0xBF #Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..... | 0xF0 0x90 0xA8 0x80 #Lo KHAROSHTHI LETTER A | 0xF0 0x90 0xA8 0x90..0x93 #Lo [4] KHAROSHTHI LETTER KA..KHAROSHTH... | 0xF0 0x90 0xA8 0x95..0x97 #Lo [3] KHAROSHTHI LETTER CA..KHAROSHTH... | 0xF0 0x90 0xA8 0x99..0xB3 #Lo [27] KHAROSHTHI LETTER NYA..KHAROSHT... | 0xF0 0x90 0xA9 0xA0..0xBC #Lo [29] OLD SOUTH ARABIAN LETTER HE..OL... | 0xF0 0x90 0xAA 0x80..0x9C #Lo [29] OLD NORTH ARABIAN LETTER HEH..O... | 0xF0 0x90 0xAB 0x80..0x87 #Lo [8] MANICHAEAN LETTER ALEPH..MANICH... | 0xF0 0x90 0xAB 0x89..0xA4 #Lo [28] MANICHAEAN LETTER ZAYIN..MANICH... | 0xF0 0x90 0xAC 0x80..0xB5 #Lo [54] AVESTAN LETTER A..AVESTAN LETTE... | 0xF0 0x90 0xAD 0x80..0x95 #Lo [22] INSCRIPTIONAL PARTHIAN LETTER A... | 0xF0 0x90 0xAD 0xA0..0xB2 #Lo [19] INSCRIPTIONAL PAHLAVI LETTER AL... | 0xF0 0x90 0xAE 0x80..0x91 #Lo [18] PSALTER PAHLAVI LETTER ALEPH..P... | 0xF0 0x90 0xB0 0x80..0xFF #Lo [73] OLD TURKIC LETTER ORKHON A..OLD... | 0xF0 0x90 0xB1 0x00..0x88 # | 0xF0 0x90 0xB2 0x80..0xB2 #L& [51] OLD HUNGARIAN CAPITAL LETTER A.... | 0xF0 0x90 0xB3 0x80..0xB2 #L& [51] OLD HUNGARIAN SMALL LETTER A..O... | 0xF0 0x91 0x80 0x83..0xB7 #Lo [53] BRAHMI SIGN JIHVAMULIYA..BRAHMI... | 0xF0 0x91 0x82 0x83..0xAF #Lo [45] KAITHI LETTER A..KAITHI LETTER HA | 0xF0 0x91 0x83 0x90..0xA8 #Lo [25] SORA SOMPENG LETTER SAH..SORA S... | 0xF0 0x91 0x84 0x83..0xA6 #Lo [36] CHAKMA LETTER AA..CHAKMA LETTER... | 0xF0 0x91 0x85 0x90..0xB2 #Lo [35] MAHAJANI LETTER A..MAHAJANI LET... | 0xF0 0x91 0x85 0xB6 #Lo MAHAJANI LIGATURE SHRI | 0xF0 0x91 0x86 0x83..0xB2 #Lo [48] SHARADA LETTER A..SHARADA LETTE... | 0xF0 0x91 0x87 0x81..0x84 #Lo [4] SHARADA SIGN AVAGRAHA..SHARADA OM | 0xF0 0x91 0x87 0x9A #Lo SHARADA EKAM | 0xF0 0x91 0x87 0x9C #Lo SHARADA HEADSTROKE | 0xF0 0x91 0x88 0x80..0x91 #Lo [18] KHOJKI LETTER A..KHOJKI LETTER JJA | 0xF0 0x91 0x88 0x93..0xAB #Lo [25] KHOJKI LETTER NYA..KHOJKI LETTE... | 0xF0 0x91 0x8A 0x80..0x86 #Lo [7] MULTANI LETTER A..MULTANI LETTE... | 0xF0 0x91 0x8A 0x88 #Lo MULTANI LETTER GHA | 0xF0 0x91 0x8A 0x8A..0x8D #Lo [4] MULTANI LETTER CA..MULTANI LETT... | 0xF0 0x91 0x8A 0x8F..0x9D #Lo [15] MULTANI LETTER NYA..MULTANI LET... | 0xF0 0x91 0x8A 0x9F..0xA8 #Lo [10] MULTANI LETTER BHA..MULTANI LET... | 0xF0 0x91 0x8A 0xB0..0xFF #Lo [47] KHUDAWADI LETTER A..KHUDAWADI L... | 0xF0 0x91 0x8B 0x00..0x9E # | 0xF0 0x91 0x8C 0x85..0x8C #Lo [8] GRANTHA LETTER A..GRANTHA LETTE... | 0xF0 0x91 0x8C 0x8F..0x90 #Lo [2] GRANTHA LETTER EE..GRANTHA LETT... | 0xF0 0x91 0x8C 0x93..0xA8 #Lo [22] GRANTHA LETTER OO..GRANTHA LETT... | 0xF0 0x91 0x8C 0xAA..0xB0 #Lo [7] GRANTHA LETTER PA..GRANTHA LETT... | 0xF0 0x91 0x8C 0xB2..0xB3 #Lo [2] GRANTHA LETTER LA..GRANTHA LETT... | 0xF0 0x91 0x8C 0xB5..0xB9 #Lo [5] GRANTHA LETTER VA..GRANTHA LETT... | 0xF0 0x91 0x8C 0xBD #Lo GRANTHA SIGN AVAGRAHA | 0xF0 0x91 0x8D 0x90 #Lo GRANTHA OM | 0xF0 0x91 0x8D 0x9D..0xA1 #Lo [5] GRANTHA SIGN PLUTA..GRANTHA LET... | 0xF0 0x91 0x90 0x80..0xB4 #Lo [53] NEWA LETTER A..NEWA LETTER HA | 0xF0 0x91 0x91 0x87..0x8A #Lo [4] NEWA SIGN AVAGRAHA..NEWA SIDDHI | 0xF0 0x91 0x92 0x80..0xAF #Lo [48] TIRHUTA ANJI..TIRHUTA LETTER HA | 0xF0 0x91 0x93 0x84..0x85 #Lo [2] TIRHUTA SIGN AVAGRAHA..TIRHUTA ... | 0xF0 0x91 0x93 0x87 #Lo TIRHUTA OM | 0xF0 0x91 0x96 0x80..0xAE #Lo [47] SIDDHAM LETTER A..SIDDHAM LETTE... | 0xF0 0x91 0x97 0x98..0x9B #Lo [4] SIDDHAM LETTER THREE-CIRCLE ALT... | 0xF0 0x91 0x98 0x80..0xAF #Lo [48] MODI LETTER A..MODI LETTER LLA | 0xF0 0x91 0x99 0x84 #Lo MODI SIGN HUVA | 0xF0 0x91 0x9A 0x80..0xAA #Lo [43] TAKRI LETTER A..TAKRI LETTER RRA | 0xF0 0x91 0x9C 0x80..0x99 #Lo [26] AHOM LETTER KA..AHOM LETTER JHA | 0xF0 0x91 0xA2 0xA0..0xFF #L& [64] WARANG CITI CAPITAL LETTER NGAA... | 0xF0 0x91 0xA3 0x00..0x9F # | 0xF0 0x91 0xA3 0xBF #Lo WARANG CITI OM | 0xF0 0x91 0xAB 0x80..0xB8 #Lo [57] PAU CIN HAU LETTER PA..PAU CIN ... | 0xF0 0x91 0xB0 0x80..0x88 #Lo [9] BHAIKSUKI LETTER A..BHAIKSUKI L... | 0xF0 0x91 0xB0 0x8A..0xAE #Lo [37] BHAIKSUKI LETTER E..BHAIKSUKI L... | 0xF0 0x91 0xB1 0x80 #Lo BHAIKSUKI SIGN AVAGRAHA | 0xF0 0x91 0xB1 0xB2..0xFF #Lo [30] MARCHEN LETTER KA..MARCHEN LETT... | 0xF0 0x91 0xB2 0x00..0x8F # | 0xF0 0x92 0x80 0x80..0xFF #Lo [922] CUNEIFORM SIGN A..CUNEIFO... | 0xF0 0x92 0x81..0x8D 0x00..0xFF # | 0xF0 0x92 0x8E 0x00..0x99 # | 0xF0 0x92 0x90 0x80..0xFF #Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH.... | 0xF0 0x92 0x91 0x00..0xAE # | 0xF0 0x92 0x92 0x80..0xFF #Lo [196] CUNEIFORM SIGN AB TIMES N... | 0xF0 0x92 0x93..0x94 0x00..0xFF # | 0xF0 0x92 0x95 0x00..0x83 # | 0xF0 0x93 0x80 0x80..0xFF #Lo [1071] EGYPTIAN HIEROGLYPH A001... | 0xF0 0x93 0x81..0x8F 0x00..0xFF # | 0xF0 0x93 0x90 0x00..0xAE # | 0xF0 0x94 0x90 0x80..0xFF #Lo [583] ANATOLIAN HIEROGLYPH A001... | 0xF0 0x94 0x91..0x98 0x00..0xFF # | 0xF0 0x94 0x99 0x00..0x86 # | 0xF0 0x96 0xA0 0x80..0xFF #Lo [569] BAMUM LETTER PHASE-A NGKU... | 0xF0 0x96 0xA1..0xA7 0x00..0xFF # | 0xF0 0x96 0xA8 0x00..0xB8 # | 0xF0 0x96 0xA9 0x80..0x9E #Lo [31] MRO LETTER TA..MRO LETTER TEK | 0xF0 0x96 0xAB 0x90..0xAD #Lo [30] BASSA VAH LETTER ENNI..BASSA VA... | 0xF0 0x96 0xAC 0x80..0xAF #Lo [48] PAHAWH HMONG VOWEL KEEB..PAHAWH... | 0xF0 0x96 0xAD 0x80..0x83 #Lm [4] PAHAWH HMONG SIGN VOS SEEV..PAH... | 0xF0 0x96 0xAD 0xA3..0xB7 #Lo [21] PAHAWH HMONG SIGN VOS LUB..PAHA... | 0xF0 0x96 0xAD 0xBD..0xFF #Lo [19] PAHAWH HMONG CLAN SIGN TSHEEJ..... | 0xF0 0x96 0xAE 0x00..0x8F # | 0xF0 0x96 0xBC 0x80..0xFF #Lo [69] MIAO LETTER PA..MIAO LETTER HHA | 0xF0 0x96 0xBD 0x00..0x84 # | 0xF0 0x96 0xBD 0x90 #Lo MIAO LETTER NASALIZATION | 0xF0 0x96 0xBE 0x93..0x9F #Lm [13] MIAO LETTER TONE-2..MIAO LETTER... | 0xF0 0x96 0xBF 0xA0 #Lm TANGUT ITERATION MARK | 0xF0 0x97 0x80 0x80..0xFF #Lo [6125] TANGUT IDEOGRAPH-17000..... | 0xF0 0x97 0x81..0xFF 0x00..0xFF # | 0xF0 0x98 0x00 0x00..0xFF # | 0xF0 0x98 0x01..0x9E 0x00..0xFF # | 0xF0 0x98 0x9F 0x00..0xAC # | 0xF0 0x98 0xA0 0x80..0xFF #Lo [755] TANGUT COMPONENT-001..TAN... | 0xF0 0x98 0xA1..0xAA 0x00..0xFF # | 0xF0 0x98 0xAB 0x00..0xB2 # | 0xF0 0x9B 0x80 0x80..0x81 #Lo [2] KATAKANA LETTER ARCHAIC E..HIRA... | 0xF0 0x9B 0xB0 0x80..0xFF #Lo [107] DUPLOYAN LETTER H..DUPLOYAN LET... | 0xF0 0x9B 0xB1 0x00..0xAA # | 0xF0 0x9B 0xB1 0xB0..0xBC #Lo [13] DUPLOYAN AFFIX LEFT HORIZONTAL ... | 0xF0 0x9B 0xB2 0x80..0x88 #Lo [9] DUPLOYAN AFFIX HIGH ACUTE..DUPL... | 0xF0 0x9B 0xB2 0x90..0x99 #Lo [10] DUPLOYAN AFFIX LOW ACUTE..DUPLO... | 0xF0 0x9D 0x90 0x80..0xFF #L& [85] MATHEMATICAL BOLD CAPITAL A..MA... | 0xF0 0x9D 0x91 0x00..0x94 # | 0xF0 0x9D 0x91 0x96..0xFF #L& [71] MATHEMATICAL ITALIC SMALL I..MA... | 0xF0 0x9D 0x92 0x00..0x9C # | 0xF0 0x9D 0x92 0x9E..0x9F #L& [2] MATHEMATICAL SCRIPT CAPITAL C..... | 0xF0 0x9D 0x92 0xA2 #L& MATHEMATICAL SCRIPT CAPITAL G | 0xF0 0x9D 0x92 0xA5..0xA6 #L& [2] MATHEMATICAL SCRIPT CAPITAL J..... | 0xF0 0x9D 0x92 0xA9..0xAC #L& [4] MATHEMATICAL SCRIPT CAPITAL N..... | 0xF0 0x9D 0x92 0xAE..0xB9 #L& [12] MATHEMATICAL SCRIPT CAPITAL S..... | 0xF0 0x9D 0x92 0xBB #L& MATHEMATICAL SCRIPT SMALL F | 0xF0 0x9D 0x92 0xBD..0xFF #L& [7] MATHEMATICAL SCRIPT SMALL H..MA... | 0xF0 0x9D 0x93 0x00..0x83 # | 0xF0 0x9D 0x93 0x85..0xFF #L& [65] MATHEMATICAL SCRIPT SMALL P..MA... | 0xF0 0x9D 0x94 0x00..0x85 # | 0xF0 0x9D 0x94 0x87..0x8A #L& [4] MATHEMATICAL FRAKTUR CAPITAL D.... | 0xF0 0x9D 0x94 0x8D..0x94 #L& [8] MATHEMATICAL FRAKTUR CAPITAL J.... | 0xF0 0x9D 0x94 0x96..0x9C #L& [7] MATHEMATICAL FRAKTUR CAPITAL S.... | 0xF0 0x9D 0x94 0x9E..0xB9 #L& [28] MATHEMATICAL FRAKTUR SMALL A..M... | 0xF0 0x9D 0x94 0xBB..0xBE #L& [4] MATHEMATICAL DOUBLE-STRUCK CAPI... | 0xF0 0x9D 0x95 0x80..0x84 #L& [5] MATHEMATICAL DOUBLE-STRUCK CAPI... | 0xF0 0x9D 0x95 0x86 #L& MATHEMATICAL DOUBLE-STRUCK CAPITAL O | 0xF0 0x9D 0x95 0x8A..0x90 #L& [7] MATHEMATICAL DOUBLE-STRUCK CAPI... | 0xF0 0x9D 0x95 0x92..0xFF #L& [340] MATHEMATICAL DOUBLE-STRUC... | 0xF0 0x9D 0x96..0x99 0x00..0xFF # | 0xF0 0x9D 0x9A 0x00..0xA5 # | 0xF0 0x9D 0x9A 0xA8..0xFF #L& [25] MATHEMATICAL BOLD CAPITAL ALPHA... | 0xF0 0x9D 0x9B 0x00..0x80 # | 0xF0 0x9D 0x9B 0x82..0x9A #L& [25] MATHEMATICAL BOLD SMALL ALPHA..... | 0xF0 0x9D 0x9B 0x9C..0xBA #L& [31] MATHEMATICAL BOLD EPSILON SYMBO... | 0xF0 0x9D 0x9B 0xBC..0xFF #L& [25] MATHEMATICAL ITALIC SMALL ALPHA... | 0xF0 0x9D 0x9C 0x00..0x94 # | 0xF0 0x9D 0x9C 0x96..0xB4 #L& [31] MATHEMATICAL ITALIC EPSILON SYM... | 0xF0 0x9D 0x9C 0xB6..0xFF #L& [25] MATHEMATICAL BOLD ITALIC SMALL ... | 0xF0 0x9D 0x9D 0x00..0x8E # | 0xF0 0x9D 0x9D 0x90..0xAE #L& [31] MATHEMATICAL BOLD ITALIC EPSILO... | 0xF0 0x9D 0x9D 0xB0..0xFF #L& [25] MATHEMATICAL SANS-SERIF BOLD SM... | 0xF0 0x9D 0x9E 0x00..0x88 # | 0xF0 0x9D 0x9E 0x8A..0xA8 #L& [31] MATHEMATICAL SANS-SERIF BOLD EP... | 0xF0 0x9D 0x9E 0xAA..0xFF #L& [25] MATHEMATICAL SANS-SERIF BOLD IT... | 0xF0 0x9D 0x9F 0x00..0x82 # | 0xF0 0x9D 0x9F 0x84..0x8B #L& [8] MATHEMATICAL SANS-SERIF BOLD IT... | 0xF0 0x9E 0xA0 0x80..0xFF #Lo [197] MENDE KIKAKUI SYLLABLE M0... | 0xF0 0x9E 0xA1..0xA2 0x00..0xFF # | 0xF0 0x9E 0xA3 0x00..0x84 # | 0xF0 0x9E 0xA4 0x80..0xFF #L& [68] ADLAM CAPITAL LETTER ALIF..ADLA... | 0xF0 0x9E 0xA5 0x00..0x83 # | 0xF0 0x9E 0xB8 0x80..0x83 #Lo [4] ARABIC MATHEMATICAL ALEF..ARABI... | 0xF0 0x9E 0xB8 0x85..0x9F #Lo [27] ARABIC MATHEMATICAL WAW..ARABIC... | 0xF0 0x9E 0xB8 0xA1..0xA2 #Lo [2] ARABIC MATHEMATICAL INITIAL BEH... | 0xF0 0x9E 0xB8 0xA4 #Lo ARABIC MATHEMATICAL INITIAL HEH | 0xF0 0x9E 0xB8 0xA7 #Lo ARABIC MATHEMATICAL INITIAL HAH | 0xF0 0x9E 0xB8 0xA9..0xB2 #Lo [10] ARABIC MATHEMATICAL INITIAL YEH... | 0xF0 0x9E 0xB8 0xB4..0xB7 #Lo [4] ARABIC MATHEMATICAL INITIAL SHE... | 0xF0 0x9E 0xB8 0xB9 #Lo ARABIC MATHEMATICAL INITIAL DAD | 0xF0 0x9E 0xB8 0xBB #Lo ARABIC MATHEMATICAL INITIAL GHAIN | 0xF0 0x9E 0xB9 0x82 #Lo ARABIC MATHEMATICAL TAILED JEEM | 0xF0 0x9E 0xB9 0x87 #Lo ARABIC MATHEMATICAL TAILED HAH | 0xF0 0x9E 0xB9 0x89 #Lo ARABIC MATHEMATICAL TAILED YEH | 0xF0 0x9E 0xB9 0x8B #Lo ARABIC MATHEMATICAL TAILED LAM | 0xF0 0x9E 0xB9 0x8D..0x8F #Lo [3] ARABIC MATHEMATICAL TAILED NOON... | 0xF0 0x9E 0xB9 0x91..0x92 #Lo [2] ARABIC MATHEMATICAL TAILED SAD.... | 0xF0 0x9E 0xB9 0x94 #Lo ARABIC MATHEMATICAL TAILED SHEEN | 0xF0 0x9E 0xB9 0x97 #Lo ARABIC MATHEMATICAL TAILED KHAH | 0xF0 0x9E 0xB9 0x99 #Lo ARABIC MATHEMATICAL TAILED DAD | 0xF0 0x9E 0xB9 0x9B #Lo ARABIC MATHEMATICAL TAILED GHAIN | 0xF0 0x9E 0xB9 0x9D #Lo ARABIC MATHEMATICAL TAILED DOTLESS... | 0xF0 0x9E 0xB9 0x9F #Lo ARABIC MATHEMATICAL TAILED DOTLESS... | 0xF0 0x9E 0xB9 0xA1..0xA2 #Lo [2] ARABIC MATHEMATICAL STRETCHED B... | 0xF0 0x9E 0xB9 0xA4 #Lo ARABIC MATHEMATICAL STRETCHED HEH | 0xF0 0x9E 0xB9 0xA7..0xAA #Lo [4] ARABIC MATHEMATICAL STRETCHED H... | 0xF0 0x9E 0xB9 0xAC..0xB2 #Lo [7] ARABIC MATHEMATICAL STRETCHED M... | 0xF0 0x9E 0xB9 0xB4..0xB7 #Lo [4] ARABIC MATHEMATICAL STRETCHED S... | 0xF0 0x9E 0xB9 0xB9..0xBC #Lo [4] ARABIC MATHEMATICAL STRETCHED D... | 0xF0 0x9E 0xB9 0xBE #Lo ARABIC MATHEMATICAL STRETCHED DOTL... | 0xF0 0x9E 0xBA 0x80..0x89 #Lo [10] ARABIC MATHEMATICAL LOOPED ALEF... | 0xF0 0x9E 0xBA 0x8B..0x9B #Lo [17] ARABIC MATHEMATICAL LOOPED LAM.... | 0xF0 0x9E 0xBA 0xA1..0xA3 #Lo [3] ARABIC MATHEMATICAL DOUBLE-STRU... | 0xF0 0x9E 0xBA 0xA5..0xA9 #Lo [5] ARABIC MATHEMATICAL DOUBLE-STRU... | 0xF0 0x9E 0xBA 0xAB..0xBB #Lo [17] ARABIC MATHEMATICAL DOUBLE-STRU... | 0xF0 0xA0 0x80 0x80..0xFF #Lo [42711] CJK UNIFIED IDEOG... | 0xF0 0xA0 0x81..0xFF 0x00..0xFF # | 0xF0 0xA1..0xA9 0x00..0xFF 0x00..0xFF # | 0xF0 0xAA 0x00 0x00..0xFF # | 0xF0 0xAA 0x01..0x9A 0x00..0xFF # | 0xF0 0xAA 0x9B 0x00..0x96 # | 0xF0 0xAA 0x9C 0x80..0xFF #Lo [4149] CJK UNIFIED IDEOGRAPH-2A... | 0xF0 0xAA 0x9D..0xFF 0x00..0xFF # | 0xF0 0xAB 0x00 0x00..0xFF # | 0xF0 0xAB 0x01..0x9B 0x00..0xFF # | 0xF0 0xAB 0x9C 0x00..0xB4 # | 0xF0 0xAB 0x9D 0x80..0xFF #Lo [222] CJK UNIFIED IDEOGRAPH-2B7... | 0xF0 0xAB 0x9E..0x9F 0x00..0xFF # | 0xF0 0xAB 0xA0 0x00..0x9D # | 0xF0 0xAB 0xA0 0xA0..0xFF #Lo [5762] CJK UNIFIED IDEOGRAPH-2B... | 0xF0 0xAB 0xA1..0xFF 0x00..0xFF # | 0xF0 0xAC 0x00 0x00..0xFF # | 0xF0 0xAC 0x01..0xB9 0x00..0xFF # | 0xF0 0xAC 0xBA 0x00..0xA1 # | 0xF0 0xAF 0xA0 0x80..0xFF #Lo [542] CJK COMPATIBILITY IDEOGRA... | 0xF0 0xAF 0xA1..0xA7 0x00..0xFF # | 0xF0 0xAF 0xA8 0x00..0x9D # ; ID_Continue = 0x30..0x39 #Nd [10] DIGIT ZERO..DIGIT NINE | 0x41..0x5A #L& [26] LATIN CAPITAL LETTER A..LATIN CAPI... | 0x5F #Pc LOW LINE | 0x61..0x7A #L& [26] LATIN SMALL LETTER A..LATIN SMALL ... | 0xC2 0xAA #Lo FEMININE ORDINAL INDICATOR | 0xC2 0xB5 #L& MICRO SIGN | 0xC2 0xB7 #Po MIDDLE DOT | 0xC2 0xBA #Lo MASCULINE ORDINAL INDICATOR | 0xC3 0x80..0x96 #L& [23] LATIN CAPITAL LETTER A WITH GRAVE.... | 0xC3 0x98..0xB6 #L& [31] LATIN CAPITAL LETTER O WITH STROKE... | 0xC3 0xB8..0xFF #L& [195] LATIN SMALL LETTER O WITH STROKE..... | 0xC4..0xC5 0x00..0xFF # | 0xC6 0x00..0xBA # | 0xC6 0xBB #Lo LATIN LETTER TWO WITH STROKE | 0xC6 0xBC..0xBF #L& [4] LATIN CAPITAL LETTER TONE FIVE..LA... | 0xC7 0x80..0x83 #Lo [4] LATIN LETTER DENTAL CLICK..LATIN L... | 0xC7 0x84..0xFF #L& [208] LATIN CAPITAL LETTER DZ WITH CARON... | 0xC8..0xC9 0x00..0xFF # | 0xCA 0x00..0x93 # | 0xCA 0x94 #Lo LATIN LETTER GLOTTAL STOP | 0xCA 0x95..0xAF #L& [27] LATIN LETTER PHARYNGEAL VOICED FRI... | 0xCA 0xB0..0xFF #Lm [18] MODIFIER LETTER SMALL H..MODIFIER ... | 0xCB 0x00..0x81 # | 0xCB 0x86..0x91 #Lm [12] MODIFIER LETTER CIRCUMFLEX ACCENT.... | 0xCB 0xA0..0xA4 #Lm [5] MODIFIER LETTER SMALL GAMMA..MODIF... | 0xCB 0xAC #Lm MODIFIER LETTER VOICING | 0xCB 0xAE #Lm MODIFIER LETTER DOUBLE APOSTROPHE | 0xCC 0x80..0xFF #Mn [112] COMBINING GRAVE ACCENT..COMBINING ... | 0xCD 0x00..0xAF # | 0xCD 0xB0..0xB3 #L& [4] GREEK CAPITAL LETTER HETA..GREEK S... | 0xCD 0xB4 #Lm GREEK NUMERAL SIGN | 0xCD 0xB6..0xB7 #L& [2] GREEK CAPITAL LETTER PAMPHYLIAN DI... | 0xCD 0xBA #Lm GREEK YPOGEGRAMMENI | 0xCD 0xBB..0xBD #L& [3] GREEK SMALL REVERSED LUNATE SIGMA ... | 0xCD 0xBF #L& GREEK CAPITAL LETTER YOT | 0xCE 0x86 #L& GREEK CAPITAL LETTER ALPHA WITH TONOS | 0xCE 0x87 #Po GREEK ANO TELEIA | 0xCE 0x88..0x8A #L& [3] GREEK CAPITAL LETTER EPSILON WITH ... | 0xCE 0x8C #L& GREEK CAPITAL LETTER OMICRON WITH ... | 0xCE 0x8E..0xA1 #L& [20] GREEK CAPITAL LETTER UPSILON WITH ... | 0xCE 0xA3..0xFF #L& [83] GREEK CAPITAL LETTER SIGMA..GREEK ... | 0xCF 0x00..0xB5 # | 0xCF 0xB7..0xFF #L& [139] GREEK CAPITAL LETTER SHO..CYRILLIC... | 0xD0..0xD1 0x00..0xFF # | 0xD2 0x00..0x81 # | 0xD2 0x83..0x87 #Mn [5] COMBINING CYRILLIC TITLO..COMBININ... | 0xD2 0x8A..0xFF #L& [166] CYRILLIC CAPITAL LETTER SHORT I WI... | 0xD3..0xD3 0x00..0xFF # | 0xD4 0x00..0xAF # | 0xD4 0xB1..0xFF #L& [38] ARMENIAN CAPITAL LETTER AYB..ARMEN... | 0xD5 0x00..0x96 # | 0xD5 0x99 #Lm ARMENIAN MODIFIER LETTER LEFT HALF... | 0xD5 0xA1..0xFF #L& [39] ARMENIAN SMALL LETTER AYB..ARMENIA... | 0xD6 0x00..0x87 # | 0xD6 0x91..0xBD #Mn [45] HEBREW ACCENT ETNAHTA..HEBREW POIN... | 0xD6 0xBF #Mn HEBREW POINT RAFE | 0xD7 0x81..0x82 #Mn [2] HEBREW POINT SHIN DOT..HEBREW POIN... | 0xD7 0x84..0x85 #Mn [2] HEBREW MARK UPPER DOT..HEBREW MARK... | 0xD7 0x87 #Mn HEBREW POINT QAMATS QATAN | 0xD7 0x90..0xAA #Lo [27] HEBREW LETTER ALEF..HEBREW LETTER TAV | 0xD7 0xB0..0xB2 #Lo [3] HEBREW LIGATURE YIDDISH DOUBLE VAV... | 0xD8 0x90..0x9A #Mn [11] ARABIC SIGN SALLALLAHOU ALAYHE WAS... | 0xD8 0xA0..0xBF #Lo [32] ARABIC LETTER KASHMIRI YEH..ARABIC... | 0xD9 0x80 #Lm ARABIC TATWEEL | 0xD9 0x81..0x8A #Lo [10] ARABIC LETTER FEH..ARABIC LETTER YEH | 0xD9 0x8B..0x9F #Mn [21] ARABIC FATHATAN..ARABIC WAVY HAMZA... | 0xD9 0xA0..0xA9 #Nd [10] ARABIC-INDIC DIGIT ZERO..ARABIC-IN... | 0xD9 0xAE..0xAF #Lo [2] ARABIC LETTER DOTLESS BEH..ARABIC ... | 0xD9 0xB0 #Mn ARABIC LETTER SUPERSCRIPT ALEF | 0xD9 0xB1..0xFF #Lo [99] ARABIC LETTER ALEF WASLA..ARABIC L... | 0xDA..0xDA 0x00..0xFF # | 0xDB 0x00..0x93 # | 0xDB 0x95 #Lo ARABIC LETTER AE | 0xDB 0x96..0x9C #Mn [7] ARABIC SMALL HIGH LIGATURE SAD WIT... | 0xDB 0x9F..0xA4 #Mn [6] ARABIC SMALL HIGH ROUNDED ZERO..AR... | 0xDB 0xA5..0xA6 #Lm [2] ARABIC SMALL WAW..ARABIC SMALL YEH | 0xDB 0xA7..0xA8 #Mn [2] ARABIC SMALL HIGH YEH..ARABIC SMAL... | 0xDB 0xAA..0xAD #Mn [4] ARABIC EMPTY CENTRE LOW STOP..ARAB... | 0xDB 0xAE..0xAF #Lo [2] ARABIC LETTER DAL WITH INVERTED V.... | 0xDB 0xB0..0xB9 #Nd [10] EXTENDED ARABIC-INDIC DIGIT ZERO..... | 0xDB 0xBA..0xBC #Lo [3] ARABIC LETTER SHEEN WITH DOT BELOW... | 0xDB 0xBF #Lo ARABIC LETTER HEH WITH INVERTED V | 0xDC 0x90 #Lo SYRIAC LETTER ALAPH | 0xDC 0x91 #Mn SYRIAC LETTER SUPERSCRIPT ALAPH | 0xDC 0x92..0xAF #Lo [30] SYRIAC LETTER BETH..SYRIAC LETTER ... | 0xDC 0xB0..0xFF #Mn [27] SYRIAC PTHAHA ABOVE..SYRIAC BARREKH | 0xDD 0x00..0x8A # | 0xDD 0x8D..0xFF #Lo [89] SYRIAC LETTER SOGDIAN ZHAIN..THAAN... | 0xDE 0x00..0xA5 # | 0xDE 0xA6..0xB0 #Mn [11] THAANA ABAFILI..THAANA SUKUN | 0xDE 0xB1 #Lo THAANA LETTER NAA | 0xDF 0x80..0x89 #Nd [10] NKO DIGIT ZERO..NKO DIGIT NINE | 0xDF 0x8A..0xAA #Lo [33] NKO LETTER A..NKO LETTER JONA RA | 0xDF 0xAB..0xB3 #Mn [9] NKO COMBINING SHORT HIGH TONE..NKO... | 0xDF 0xB4..0xB5 #Lm [2] NKO HIGH TONE APOSTROPHE..NKO LOW ... | 0xDF 0xBA #Lm NKO LAJANYALAN | 0xE0 0xA0 0x80..0x95 #Lo [22] SAMARITAN LETTER ALAF..SAMARITAN L... | 0xE0 0xA0 0x96..0x99 #Mn [4] SAMARITAN MARK IN..SAMARITAN MARK ... | 0xE0 0xA0 0x9A #Lm SAMARITAN MODIFIER LETTER EPENTHET... | 0xE0 0xA0 0x9B..0xA3 #Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAM... | 0xE0 0xA0 0xA4 #Lm SAMARITAN MODIFIER LETTER SHORT A | 0xE0 0xA0 0xA5..0xA7 #Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMA... | 0xE0 0xA0 0xA8 #Lm SAMARITAN MODIFIER LETTER I | 0xE0 0xA0 0xA9..0xAD #Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMAR... | 0xE0 0xA1 0x80..0x98 #Lo [25] MANDAIC LETTER HALQA..MANDAIC LETT... | 0xE0 0xA1 0x99..0x9B #Mn [3] MANDAIC AFFRICATION MARK..MANDAIC ... | 0xE0 0xA2 0xA0..0xB4 #Lo [21] ARABIC LETTER BEH WITH SMALL V BEL... | 0xE0 0xA2 0xB6..0xBD #Lo [8] ARABIC LETTER BEH WITH SMALL MEEM ... | 0xE0 0xA3 0x94..0xA1 #Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARA... | 0xE0 0xA3 0xA3..0xFF #Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAG... | 0xE0 0xA4 0x00..0x82 # | 0xE0 0xA4 0x83 #Mc DEVANAGARI SIGN VISARGA | 0xE0 0xA4 0x84..0xB9 #Lo [54] DEVANAGARI LETTER SHORT A..DEVANAG... | 0xE0 0xA4 0xBA #Mn DEVANAGARI VOWEL SIGN OE | 0xE0 0xA4 0xBB #Mc DEVANAGARI VOWEL SIGN OOE | 0xE0 0xA4 0xBC #Mn DEVANAGARI SIGN NUKTA | 0xE0 0xA4 0xBD #Lo DEVANAGARI SIGN AVAGRAHA | 0xE0 0xA4 0xBE..0xFF #Mc [3] DEVANAGARI VOWEL SIGN AA..DEVANAGA... | 0xE0 0xA5 0x00..0x80 # | 0xE0 0xA5 0x81..0x88 #Mn [8] DEVANAGARI VOWEL SIGN U..DEVANAGAR... | 0xE0 0xA5 0x89..0x8C #Mc [4] DEVANAGARI VOWEL SIGN CANDRA O..DE... | 0xE0 0xA5 0x8D #Mn DEVANAGARI SIGN VIRAMA | 0xE0 0xA5 0x8E..0x8F #Mc [2] DEVANAGARI VOWEL SIGN PRISHTHAMATR... | 0xE0 0xA5 0x90 #Lo DEVANAGARI OM | 0xE0 0xA5 0x91..0x97 #Mn [7] DEVANAGARI STRESS SIGN UDATTA..DEV... | 0xE0 0xA5 0x98..0xA1 #Lo [10] DEVANAGARI LETTER QA..DEVANAGARI L... | 0xE0 0xA5 0xA2..0xA3 #Mn [2] DEVANAGARI VOWEL SIGN VOCALIC L..D... | 0xE0 0xA5 0xA6..0xAF #Nd [10] DEVANAGARI DIGIT ZERO..DEVANAGARI ... | 0xE0 0xA5 0xB1 #Lm DEVANAGARI SIGN HIGH SPACING DOT | 0xE0 0xA5 0xB2..0xFF #Lo [15] DEVANAGARI LETTER CANDRA A..BENGAL... | 0xE0 0xA6 0x00..0x80 # | 0xE0 0xA6 0x81 #Mn BENGALI SIGN CANDRABINDU | 0xE0 0xA6 0x82..0x83 #Mc [2] BENGALI SIGN ANUSVARA..BENGALI SIG... | 0xE0 0xA6 0x85..0x8C #Lo [8] BENGALI LETTER A..BENGALI LETTER V... | 0xE0 0xA6 0x8F..0x90 #Lo [2] BENGALI LETTER E..BENGALI LETTER AI | 0xE0 0xA6 0x93..0xA8 #Lo [22] BENGALI LETTER O..BENGALI LETTER NA | 0xE0 0xA6 0xAA..0xB0 #Lo [7] BENGALI LETTER PA..BENGALI LETTER RA | 0xE0 0xA6 0xB2 #Lo BENGALI LETTER LA | 0xE0 0xA6 0xB6..0xB9 #Lo [4] BENGALI LETTER SHA..BENGALI LETTER HA | 0xE0 0xA6 0xBC #Mn BENGALI SIGN NUKTA | 0xE0 0xA6 0xBD #Lo BENGALI SIGN AVAGRAHA | 0xE0 0xA6 0xBE..0xFF #Mc [3] BENGALI VOWEL SIGN AA..BENGALI VOW... | 0xE0 0xA7 0x00..0x80 # | 0xE0 0xA7 0x81..0x84 #Mn [4] BENGALI VOWEL SIGN U..BENGALI VOWE... | 0xE0 0xA7 0x87..0x88 #Mc [2] BENGALI VOWEL SIGN E..BENGALI VOWE... | 0xE0 0xA7 0x8B..0x8C #Mc [2] BENGALI VOWEL SIGN O..BENGALI VOWE... | 0xE0 0xA7 0x8D #Mn BENGALI SIGN VIRAMA | 0xE0 0xA7 0x8E #Lo BENGALI LETTER KHANDA TA | 0xE0 0xA7 0x97 #Mc BENGALI AU LENGTH MARK | 0xE0 0xA7 0x9C..0x9D #Lo [2] BENGALI LETTER RRA..BENGALI LETTER... | 0xE0 0xA7 0x9F..0xA1 #Lo [3] BENGALI LETTER YYA..BENGALI LETTER... | 0xE0 0xA7 0xA2..0xA3 #Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENG... | 0xE0 0xA7 0xA6..0xAF #Nd [10] BENGALI DIGIT ZERO..BENGALI DIGIT ... | 0xE0 0xA7 0xB0..0xB1 #Lo [2] BENGALI LETTER RA WITH MIDDLE DIAG... | 0xE0 0xA8 0x81..0x82 #Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI... | 0xE0 0xA8 0x83 #Mc GURMUKHI SIGN VISARGA | 0xE0 0xA8 0x85..0x8A #Lo [6] GURMUKHI LETTER A..GURMUKHI LETTER UU | 0xE0 0xA8 0x8F..0x90 #Lo [2] GURMUKHI LETTER EE..GURMUKHI LETTE... | 0xE0 0xA8 0x93..0xA8 #Lo [22] GURMUKHI LETTER OO..GURMUKHI LETTE... | 0xE0 0xA8 0xAA..0xB0 #Lo [7] GURMUKHI LETTER PA..GURMUKHI LETTE... | 0xE0 0xA8 0xB2..0xB3 #Lo [2] GURMUKHI LETTER LA..GURMUKHI LETTE... | 0xE0 0xA8 0xB5..0xB6 #Lo [2] GURMUKHI LETTER VA..GURMUKHI LETTE... | 0xE0 0xA8 0xB8..0xB9 #Lo [2] GURMUKHI LETTER SA..GURMUKHI LETTE... | 0xE0 0xA8 0xBC #Mn GURMUKHI SIGN NUKTA | 0xE0 0xA8 0xBE..0xFF #Mc [3] GURMUKHI VOWEL SIGN AA..GURMUKHI V... | 0xE0 0xA9 0x00..0x80 # | 0xE0 0xA9 0x81..0x82 #Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VO... | 0xE0 0xA9 0x87..0x88 #Mn [2] GURMUKHI VOWEL SIGN EE..GURMUKHI V... | 0xE0 0xA9 0x8B..0x8D #Mn [3] GURMUKHI VOWEL SIGN OO..GURMUKHI S... | 0xE0 0xA9 0x91 #Mn GURMUKHI SIGN UDAAT | 0xE0 0xA9 0x99..0x9C #Lo [4] GURMUKHI LETTER KHHA..GURMUKHI LET... | 0xE0 0xA9 0x9E #Lo GURMUKHI LETTER FA | 0xE0 0xA9 0xA6..0xAF #Nd [10] GURMUKHI DIGIT ZERO..GURMUKHI DIGI... | 0xE0 0xA9 0xB0..0xB1 #Mn [2] GURMUKHI TIPPI..GURMUKHI ADDAK | 0xE0 0xA9 0xB2..0xB4 #Lo [3] GURMUKHI IRI..GURMUKHI EK ONKAR | 0xE0 0xA9 0xB5 #Mn GURMUKHI SIGN YAKASH | 0xE0 0xAA 0x81..0x82 #Mn [2] GUJARATI SIGN CANDRABINDU..GUJARAT... | 0xE0 0xAA 0x83 #Mc GUJARATI SIGN VISARGA | 0xE0 0xAA 0x85..0x8D #Lo [9] GUJARATI LETTER A..GUJARATI VOWEL ... | 0xE0 0xAA 0x8F..0x91 #Lo [3] GUJARATI LETTER E..GUJARATI VOWEL ... | 0xE0 0xAA 0x93..0xA8 #Lo [22] GUJARATI LETTER O..GUJARATI LETTER NA | 0xE0 0xAA 0xAA..0xB0 #Lo [7] GUJARATI LETTER PA..GUJARATI LETTE... | 0xE0 0xAA 0xB2..0xB3 #Lo [2] GUJARATI LETTER LA..GUJARATI LETTE... | 0xE0 0xAA 0xB5..0xB9 #Lo [5] GUJARATI LETTER VA..GUJARATI LETTE... | 0xE0 0xAA 0xBC #Mn GUJARATI SIGN NUKTA | 0xE0 0xAA 0xBD #Lo GUJARATI SIGN AVAGRAHA | 0xE0 0xAA 0xBE..0xFF #Mc [3] GUJARATI VOWEL SIGN AA..GUJARATI V... | 0xE0 0xAB 0x00..0x80 # | 0xE0 0xAB 0x81..0x85 #Mn [5] GUJARATI VOWEL SIGN U..GUJARATI VO... | 0xE0 0xAB 0x87..0x88 #Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VO... | 0xE0 0xAB 0x89 #Mc GUJARATI VOWEL SIGN CANDRA O | 0xE0 0xAB 0x8B..0x8C #Mc [2] GUJARATI VOWEL SIGN O..GUJARATI VO... | 0xE0 0xAB 0x8D #Mn GUJARATI SIGN VIRAMA | 0xE0 0xAB 0x90 #Lo GUJARATI OM | 0xE0 0xAB 0xA0..0xA1 #Lo [2] GUJARATI LETTER VOCALIC RR..GUJARA... | 0xE0 0xAB 0xA2..0xA3 #Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJ... | 0xE0 0xAB 0xA6..0xAF #Nd [10] GUJARATI DIGIT ZERO..GUJARATI DIGI... | 0xE0 0xAB 0xB9 #Lo GUJARATI LETTER ZHA | 0xE0 0xAC 0x81 #Mn ORIYA SIGN CANDRABINDU | 0xE0 0xAC 0x82..0x83 #Mc [2] ORIYA SIGN ANUSVARA..ORIYA SIGN VI... | 0xE0 0xAC 0x85..0x8C #Lo [8] ORIYA LETTER A..ORIYA LETTER VOCAL... | 0xE0 0xAC 0x8F..0x90 #Lo [2] ORIYA LETTER E..ORIYA LETTER AI | 0xE0 0xAC 0x93..0xA8 #Lo [22] ORIYA LETTER O..ORIYA LETTER NA | 0xE0 0xAC 0xAA..0xB0 #Lo [7] ORIYA LETTER PA..ORIYA LETTER RA | 0xE0 0xAC 0xB2..0xB3 #Lo [2] ORIYA LETTER LA..ORIYA LETTER LLA | 0xE0 0xAC 0xB5..0xB9 #Lo [5] ORIYA LETTER VA..ORIYA LETTER HA | 0xE0 0xAC 0xBC #Mn ORIYA SIGN NUKTA | 0xE0 0xAC 0xBD #Lo ORIYA SIGN AVAGRAHA | 0xE0 0xAC 0xBE #Mc ORIYA VOWEL SIGN AA | 0xE0 0xAC 0xBF #Mn ORIYA VOWEL SIGN I | 0xE0 0xAD 0x80 #Mc ORIYA VOWEL SIGN II | 0xE0 0xAD 0x81..0x84 #Mn [4] ORIYA VOWEL SIGN U..ORIYA VOWEL SI... | 0xE0 0xAD 0x87..0x88 #Mc [2] ORIYA VOWEL SIGN E..ORIYA VOWEL SI... | 0xE0 0xAD 0x8B..0x8C #Mc [2] ORIYA VOWEL SIGN O..ORIYA VOWEL SI... | 0xE0 0xAD 0x8D #Mn ORIYA SIGN VIRAMA | 0xE0 0xAD 0x96 #Mn ORIYA AI LENGTH MARK | 0xE0 0xAD 0x97 #Mc ORIYA AU LENGTH MARK | 0xE0 0xAD 0x9C..0x9D #Lo [2] ORIYA LETTER RRA..ORIYA LETTER RHA | 0xE0 0xAD 0x9F..0xA1 #Lo [3] ORIYA LETTER YYA..ORIYA LETTER VOC... | 0xE0 0xAD 0xA2..0xA3 #Mn [2] ORIYA VOWEL SIGN VOCALIC L..ORIYA ... | 0xE0 0xAD 0xA6..0xAF #Nd [10] ORIYA DIGIT ZERO..ORIYA DIGIT NINE | 0xE0 0xAD 0xB1 #Lo ORIYA LETTER WA | 0xE0 0xAE 0x82 #Mn TAMIL SIGN ANUSVARA | 0xE0 0xAE 0x83 #Lo TAMIL SIGN VISARGA | 0xE0 0xAE 0x85..0x8A #Lo [6] TAMIL LETTER A..TAMIL LETTER UU | 0xE0 0xAE 0x8E..0x90 #Lo [3] TAMIL LETTER E..TAMIL LETTER AI | 0xE0 0xAE 0x92..0x95 #Lo [4] TAMIL LETTER O..TAMIL LETTER KA | 0xE0 0xAE 0x99..0x9A #Lo [2] TAMIL LETTER NGA..TAMIL LETTER CA | 0xE0 0xAE 0x9C #Lo TAMIL LETTER JA | 0xE0 0xAE 0x9E..0x9F #Lo [2] TAMIL LETTER NYA..TAMIL LETTER TTA | 0xE0 0xAE 0xA3..0xA4 #Lo [2] TAMIL LETTER NNA..TAMIL LETTER TA | 0xE0 0xAE 0xA8..0xAA #Lo [3] TAMIL LETTER NA..TAMIL LETTER PA | 0xE0 0xAE 0xAE..0xB9 #Lo [12] TAMIL LETTER MA..TAMIL LETTER HA | 0xE0 0xAE 0xBE..0xBF #Mc [2] TAMIL VOWEL SIGN AA..TAMIL VOWEL S... | 0xE0 0xAF 0x80 #Mn TAMIL VOWEL SIGN II | 0xE0 0xAF 0x81..0x82 #Mc [2] TAMIL VOWEL SIGN U..TAMIL VOWEL SI... | 0xE0 0xAF 0x86..0x88 #Mc [3] TAMIL VOWEL SIGN E..TAMIL VOWEL SI... | 0xE0 0xAF 0x8A..0x8C #Mc [3] TAMIL VOWEL SIGN O..TAMIL VOWEL SI... | 0xE0 0xAF 0x8D #Mn TAMIL SIGN VIRAMA | 0xE0 0xAF 0x90 #Lo TAMIL OM | 0xE0 0xAF 0x97 #Mc TAMIL AU LENGTH MARK | 0xE0 0xAF 0xA6..0xAF #Nd [10] TAMIL DIGIT ZERO..TAMIL DIGIT NINE | 0xE0 0xB0 0x80 #Mn TELUGU SIGN COMBINING CANDRABINDU ... | 0xE0 0xB0 0x81..0x83 #Mc [3] TELUGU SIGN CANDRABINDU..TELUGU SI... | 0xE0 0xB0 0x85..0x8C #Lo [8] TELUGU LETTER A..TELUGU LETTER VOC... | 0xE0 0xB0 0x8E..0x90 #Lo [3] TELUGU LETTER E..TELUGU LETTER AI | 0xE0 0xB0 0x92..0xA8 #Lo [23] TELUGU LETTER O..TELUGU LETTER NA | 0xE0 0xB0 0xAA..0xB9 #Lo [16] TELUGU LETTER PA..TELUGU LETTER HA | 0xE0 0xB0 0xBD #Lo TELUGU SIGN AVAGRAHA | 0xE0 0xB0 0xBE..0xFF #Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL... | 0xE0 0xB1 0x00..0x80 # | 0xE0 0xB1 0x81..0x84 #Mc [4] TELUGU VOWEL SIGN U..TELUGU VOWEL ... | 0xE0 0xB1 0x86..0x88 #Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL ... | 0xE0 0xB1 0x8A..0x8D #Mn [4] TELUGU VOWEL SIGN O..TELUGU SIGN V... | 0xE0 0xB1 0x95..0x96 #Mn [2] TELUGU LENGTH MARK..TELUGU AI LENG... | 0xE0 0xB1 0x98..0x9A #Lo [3] TELUGU LETTER TSA..TELUGU LETTER RRRA | 0xE0 0xB1 0xA0..0xA1 #Lo [2] TELUGU LETTER VOCALIC RR..TELUGU L... | 0xE0 0xB1 0xA2..0xA3 #Mn [2] TELUGU VOWEL SIGN VOCALIC L..TELUG... | 0xE0 0xB1 0xA6..0xAF #Nd [10] TELUGU DIGIT ZERO..TELUGU DIGIT NINE | 0xE0 0xB2 0x80 #Lo KANNADA SIGN SPACING CANDRABINDU | 0xE0 0xB2 0x81 #Mn KANNADA SIGN CANDRABINDU | 0xE0 0xB2 0x82..0x83 #Mc [2] KANNADA SIGN ANUSVARA..KANNADA SIG... | 0xE0 0xB2 0x85..0x8C #Lo [8] KANNADA LETTER A..KANNADA LETTER V... | 0xE0 0xB2 0x8E..0x90 #Lo [3] KANNADA LETTER E..KANNADA LETTER AI | 0xE0 0xB2 0x92..0xA8 #Lo [23] KANNADA LETTER O..KANNADA LETTER NA | 0xE0 0xB2 0xAA..0xB3 #Lo [10] KANNADA LETTER PA..KANNADA LETTER LLA | 0xE0 0xB2 0xB5..0xB9 #Lo [5] KANNADA LETTER VA..KANNADA LETTER HA | 0xE0 0xB2 0xBC #Mn KANNADA SIGN NUKTA | 0xE0 0xB2 0xBD #Lo KANNADA SIGN AVAGRAHA | 0xE0 0xB2 0xBE #Mc KANNADA VOWEL SIGN AA | 0xE0 0xB2 0xBF #Mn KANNADA VOWEL SIGN I | 0xE0 0xB3 0x80..0x84 #Mc [5] KANNADA VOWEL SIGN II..KANNADA VOW... | 0xE0 0xB3 0x86 #Mn KANNADA VOWEL SIGN E | 0xE0 0xB3 0x87..0x88 #Mc [2] KANNADA VOWEL SIGN EE..KANNADA VOW... | 0xE0 0xB3 0x8A..0x8B #Mc [2] KANNADA VOWEL SIGN O..KANNADA VOWE... | 0xE0 0xB3 0x8C..0x8D #Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIG... | 0xE0 0xB3 0x95..0x96 #Mc [2] KANNADA LENGTH MARK..KANNADA AI LE... | 0xE0 0xB3 0x9E #Lo KANNADA LETTER FA | 0xE0 0xB3 0xA0..0xA1 #Lo [2] KANNADA LETTER VOCALIC RR..KANNADA... | 0xE0 0xB3 0xA2..0xA3 #Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANN... | 0xE0 0xB3 0xA6..0xAF #Nd [10] KANNADA DIGIT ZERO..KANNADA DIGIT ... | 0xE0 0xB3 0xB1..0xB2 #Lo [2] KANNADA SIGN JIHVAMULIYA..KANNADA ... | 0xE0 0xB4 0x81 #Mn MALAYALAM SIGN CANDRABINDU | 0xE0 0xB4 0x82..0x83 #Mc [2] MALAYALAM SIGN ANUSVARA..MALAYALAM... | 0xE0 0xB4 0x85..0x8C #Lo [8] MALAYALAM LETTER A..MALAYALAM LETT... | 0xE0 0xB4 0x8E..0x90 #Lo [3] MALAYALAM LETTER E..MALAYALAM LETT... | 0xE0 0xB4 0x92..0xBA #Lo [41] MALAYALAM LETTER O..MALAYALAM LETT... | 0xE0 0xB4 0xBD #Lo MALAYALAM SIGN AVAGRAHA | 0xE0 0xB4 0xBE..0xFF #Mc [3] MALAYALAM VOWEL SIGN AA..MALAYALAM... | 0xE0 0xB5 0x00..0x80 # | 0xE0 0xB5 0x81..0x84 #Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM ... | 0xE0 0xB5 0x86..0x88 #Mc [3] MALAYALAM VOWEL SIGN E..MALAYALAM ... | 0xE0 0xB5 0x8A..0x8C #Mc [3] MALAYALAM VOWEL SIGN O..MALAYALAM ... | 0xE0 0xB5 0x8D #Mn MALAYALAM SIGN VIRAMA | 0xE0 0xB5 0x8E #Lo MALAYALAM LETTER DOT REPH | 0xE0 0xB5 0x94..0x96 #Lo [3] MALAYALAM LETTER CHILLU M..MALAYAL... | 0xE0 0xB5 0x97 #Mc MALAYALAM AU LENGTH MARK | 0xE0 0xB5 0x9F..0xA1 #Lo [3] MALAYALAM LETTER ARCHAIC II..MALAY... | 0xE0 0xB5 0xA2..0xA3 #Mn [2] MALAYALAM VOWEL SIGN VOCALIC L..MA... | 0xE0 0xB5 0xA6..0xAF #Nd [10] MALAYALAM DIGIT ZERO..MALAYALAM DI... | 0xE0 0xB5 0xBA..0xBF #Lo [6] MALAYALAM LETTER CHILLU NN..MALAYA... | 0xE0 0xB6 0x82..0x83 #Mc [2] SINHALA SIGN ANUSVARAYA..SINHALA S... | 0xE0 0xB6 0x85..0x96 #Lo [18] SINHALA LETTER AYANNA..SINHALA LET... | 0xE0 0xB6 0x9A..0xB1 #Lo [24] SINHALA LETTER ALPAPRAANA KAYANNA.... | 0xE0 0xB6 0xB3..0xBB #Lo [9] SINHALA LETTER SANYAKA DAYANNA..SI... | 0xE0 0xB6 0xBD #Lo SINHALA LETTER DANTAJA LAYANNA | 0xE0 0xB7 0x80..0x86 #Lo [7] SINHALA LETTER VAYANNA..SINHALA LE... | 0xE0 0xB7 0x8A #Mn SINHALA SIGN AL-LAKUNA | 0xE0 0xB7 0x8F..0x91 #Mc [3] SINHALA VOWEL SIGN AELA-PILLA..SIN... | 0xE0 0xB7 0x92..0x94 #Mn [3] SINHALA VOWEL SIGN KETTI IS-PILLA.... | 0xE0 0xB7 0x96 #Mn SINHALA VOWEL SIGN DIGA PAA-PILLA | 0xE0 0xB7 0x98..0x9F #Mc [8] SINHALA VOWEL SIGN GAETTA-PILLA..S... | 0xE0 0xB7 0xA6..0xAF #Nd [10] SINHALA LITH DIGIT ZERO..SINHALA L... | 0xE0 0xB7 0xB2..0xB3 #Mc [2] SINHALA VOWEL SIGN DIGA GAETTA-PIL... | 0xE0 0xB8 0x81..0xB0 #Lo [48] THAI CHARACTER KO KAI..THAI CHARAC... | 0xE0 0xB8 0xB1 #Mn THAI CHARACTER MAI HAN-AKAT | 0xE0 0xB8 0xB2..0xB3 #Lo [2] THAI CHARACTER SARA AA..THAI CHARA... | 0xE0 0xB8 0xB4..0xBA #Mn [7] THAI CHARACTER SARA I..THAI CHARAC... | 0xE0 0xB9 0x80..0x85 #Lo [6] THAI CHARACTER SARA E..THAI CHARAC... | 0xE0 0xB9 0x86 #Lm THAI CHARACTER MAIYAMOK | 0xE0 0xB9 0x87..0x8E #Mn [8] THAI CHARACTER MAITAIKHU..THAI CHA... | 0xE0 0xB9 0x90..0x99 #Nd [10] THAI DIGIT ZERO..THAI DIGIT NINE | 0xE0 0xBA 0x81..0x82 #Lo [2] LAO LETTER KO..LAO LETTER KHO SUNG | 0xE0 0xBA 0x84 #Lo LAO LETTER KHO TAM | 0xE0 0xBA 0x87..0x88 #Lo [2] LAO LETTER NGO..LAO LETTER CO | 0xE0 0xBA 0x8A #Lo LAO LETTER SO TAM | 0xE0 0xBA 0x8D #Lo LAO LETTER NYO | 0xE0 0xBA 0x94..0x97 #Lo [4] LAO LETTER DO..LAO LETTER THO TAM | 0xE0 0xBA 0x99..0x9F #Lo [7] LAO LETTER NO..LAO LETTER FO SUNG | 0xE0 0xBA 0xA1..0xA3 #Lo [3] LAO LETTER MO..LAO LETTER LO LING | 0xE0 0xBA 0xA5 #Lo LAO LETTER LO LOOT | 0xE0 0xBA 0xA7 #Lo LAO LETTER WO | 0xE0 0xBA 0xAA..0xAB #Lo [2] LAO LETTER SO SUNG..LAO LETTER HO ... | 0xE0 0xBA 0xAD..0xB0 #Lo [4] LAO LETTER O..LAO VOWEL SIGN A | 0xE0 0xBA 0xB1 #Mn LAO VOWEL SIGN MAI KAN | 0xE0 0xBA 0xB2..0xB3 #Lo [2] LAO VOWEL SIGN AA..LAO VOWEL SIGN AM | 0xE0 0xBA 0xB4..0xB9 #Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU | 0xE0 0xBA 0xBB..0xBC #Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVO... | 0xE0 0xBA 0xBD #Lo LAO SEMIVOWEL SIGN NYO | 0xE0 0xBB 0x80..0x84 #Lo [5] LAO VOWEL SIGN E..LAO VOWEL SIGN AI | 0xE0 0xBB 0x86 #Lm LAO KO LA | 0xE0 0xBB 0x88..0x8D #Mn [6] LAO TONE MAI EK..LAO NIGGAHITA | 0xE0 0xBB 0x90..0x99 #Nd [10] LAO DIGIT ZERO..LAO DIGIT NINE | 0xE0 0xBB 0x9C..0x9F #Lo [4] LAO HO NO..LAO LETTER KHMU NYO | 0xE0 0xBC 0x80 #Lo TIBETAN SYLLABLE OM | 0xE0 0xBC 0x98..0x99 #Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD P... | 0xE0 0xBC 0xA0..0xA9 #Nd [10] TIBETAN DIGIT ZERO..TIBETAN DIGIT ... | 0xE0 0xBC 0xB5 #Mn TIBETAN MARK NGAS BZUNG NYI ZLA | 0xE0 0xBC 0xB7 #Mn TIBETAN MARK NGAS BZUNG SGOR RTAGS | 0xE0 0xBC 0xB9 #Mn TIBETAN MARK TSA -PHRU | 0xE0 0xBC 0xBE..0xBF #Mc [2] TIBETAN SIGN YAR TSHES..TIBETAN SI... | 0xE0 0xBD 0x80..0x87 #Lo [8] TIBETAN LETTER KA..TIBETAN LETTER JA | 0xE0 0xBD 0x89..0xAC #Lo [36] TIBETAN LETTER NYA..TIBETAN LETTER... | 0xE0 0xBD 0xB1..0xBE #Mn [14] TIBETAN VOWEL SIGN AA..TIBETAN SIG... | 0xE0 0xBD 0xBF #Mc TIBETAN SIGN RNAM BCAD | 0xE0 0xBE 0x80..0x84 #Mn [5] TIBETAN VOWEL SIGN REVERSED I..TIB... | 0xE0 0xBE 0x86..0x87 #Mn [2] TIBETAN SIGN LCI RTAGS..TIBETAN SI... | 0xE0 0xBE 0x88..0x8C #Lo [5] TIBETAN SIGN LCE TSA CAN..TIBETAN ... | 0xE0 0xBE 0x8D..0x97 #Mn [11] TIBETAN SUBJOINED SIGN LCE TSA CAN... | 0xE0 0xBE 0x99..0xBC #Mn [36] TIBETAN SUBJOINED LETTER NYA..TIBE... | 0xE0 0xBF 0x86 #Mn TIBETAN SYMBOL PADMA GDAN | 0xE1 0x80 0x80..0xAA #Lo [43] MYANMAR LETTER KA..MYANMAR LETTER AU | 0xE1 0x80 0xAB..0xAC #Mc [2] MYANMAR VOWEL SIGN TALL AA..MYANMA... | 0xE1 0x80 0xAD..0xB0 #Mn [4] MYANMAR VOWEL SIGN I..MYANMAR VOWE... | 0xE1 0x80 0xB1 #Mc MYANMAR VOWEL SIGN E | 0xE1 0x80 0xB2..0xB7 #Mn [6] MYANMAR VOWEL SIGN AI..MYANMAR SIG... | 0xE1 0x80 0xB8 #Mc MYANMAR SIGN VISARGA | 0xE1 0x80 0xB9..0xBA #Mn [2] MYANMAR SIGN VIRAMA..MYANMAR SIGN ... | 0xE1 0x80 0xBB..0xBC #Mc [2] MYANMAR CONSONANT SIGN MEDIAL YA..... | 0xE1 0x80 0xBD..0xBE #Mn [2] MYANMAR CONSONANT SIGN MEDIAL WA..... | 0xE1 0x80 0xBF #Lo MYANMAR LETTER GREAT SA | 0xE1 0x81 0x80..0x89 #Nd [10] MYANMAR DIGIT ZERO..MYANMAR DIGIT ... | 0xE1 0x81 0x90..0x95 #Lo [6] MYANMAR LETTER SHA..MYANMAR LETTER... | 0xE1 0x81 0x96..0x97 #Mc [2] MYANMAR VOWEL SIGN VOCALIC R..MYAN... | 0xE1 0x81 0x98..0x99 #Mn [2] MYANMAR VOWEL SIGN VOCALIC L..MYAN... | 0xE1 0x81 0x9A..0x9D #Lo [4] MYANMAR LETTER MON NGA..MYANMAR LE... | 0xE1 0x81 0x9E..0xA0 #Mn [3] MYANMAR CONSONANT SIGN MON MEDIAL ... | 0xE1 0x81 0xA1 #Lo MYANMAR LETTER SGAW KAREN SHA | 0xE1 0x81 0xA2..0xA4 #Mc [3] MYANMAR VOWEL SIGN SGAW KAREN EU..... | 0xE1 0x81 0xA5..0xA6 #Lo [2] MYANMAR LETTER WESTERN PWO KAREN T... | 0xE1 0x81 0xA7..0xAD #Mc [7] MYANMAR VOWEL SIGN WESTERN PWO KAR... | 0xE1 0x81 0xAE..0xB0 #Lo [3] MYANMAR LETTER EASTERN PWO KAREN N... | 0xE1 0x81 0xB1..0xB4 #Mn [4] MYANMAR VOWEL SIGN GEBA KAREN I..M... | 0xE1 0x81 0xB5..0xFF #Lo [13] MYANMAR LETTER SHAN KA..MYANMAR LE... | 0xE1 0x82 0x00..0x81 # | 0xE1 0x82 0x82 #Mn MYANMAR CONSONANT SIGN SHAN MEDIAL WA | 0xE1 0x82 0x83..0x84 #Mc [2] MYANMAR VOWEL SIGN SHAN AA..MYANMA... | 0xE1 0x82 0x85..0x86 #Mn [2] MYANMAR VOWEL SIGN SHAN E ABOVE..M... | 0xE1 0x82 0x87..0x8C #Mc [6] MYANMAR SIGN SHAN TONE-2..MYANMAR ... | 0xE1 0x82 0x8D #Mn MYANMAR SIGN SHAN COUNCIL EMPHATIC... | 0xE1 0x82 0x8E #Lo MYANMAR LETTER RUMAI PALAUNG FA | 0xE1 0x82 0x8F #Mc MYANMAR SIGN RUMAI PALAUNG TONE-5 | 0xE1 0x82 0x90..0x99 #Nd [10] MYANMAR SHAN DIGIT ZERO..MYANMAR S... | 0xE1 0x82 0x9A..0x9C #Mc [3] MYANMAR SIGN KHAMTI TONE-1..MYANMA... | 0xE1 0x82 0x9D #Mn MYANMAR VOWEL SIGN AITON AI | 0xE1 0x82 0xA0..0xFF #L& [38] GEORGIAN CAPITAL LETTER AN..GEORGI... | 0xE1 0x83 0x00..0x85 # | 0xE1 0x83 0x87 #L& GEORGIAN CAPITAL LETTER YN | 0xE1 0x83 0x8D #L& GEORGIAN CAPITAL LETTER AEN | 0xE1 0x83 0x90..0xBA #Lo [43] GEORGIAN LETTER AN..GEORGIAN LETTE... | 0xE1 0x83 0xBC #Lm MODIFIER LETTER GEORGIAN NAR | 0xE1 0x83 0xBD..0xFF #Lo [332] GEORGIAN LETTER AEN..ETHIOPIC ... | 0xE1 0x84..0x88 0x00..0xFF # | 0xE1 0x89 0x00..0x88 # | 0xE1 0x89 0x8A..0x8D #Lo [4] ETHIOPIC SYLLABLE QWI..ETHIOPIC SY... | 0xE1 0x89 0x90..0x96 #Lo [7] ETHIOPIC SYLLABLE QHA..ETHIOPIC SY... | 0xE1 0x89 0x98 #Lo ETHIOPIC SYLLABLE QHWA | 0xE1 0x89 0x9A..0x9D #Lo [4] ETHIOPIC SYLLABLE QHWI..ETHIOPIC S... | 0xE1 0x89 0xA0..0xFF #Lo [41] ETHIOPIC SYLLABLE BA..ETHIOPIC SYL... | 0xE1 0x8A 0x00..0x88 # | 0xE1 0x8A 0x8A..0x8D #Lo [4] ETHIOPIC SYLLABLE XWI..ETHIOPIC SY... | 0xE1 0x8A 0x90..0xB0 #Lo [33] ETHIOPIC SYLLABLE NA..ETHIOPIC SYL... | 0xE1 0x8A 0xB2..0xB5 #Lo [4] ETHIOPIC SYLLABLE KWI..ETHIOPIC SY... | 0xE1 0x8A 0xB8..0xBE #Lo [7] ETHIOPIC SYLLABLE KXA..ETHIOPIC SY... | 0xE1 0x8B 0x80 #Lo ETHIOPIC SYLLABLE KXWA | 0xE1 0x8B 0x82..0x85 #Lo [4] ETHIOPIC SYLLABLE KXWI..ETHIOPIC S... | 0xE1 0x8B 0x88..0x96 #Lo [15] ETHIOPIC SYLLABLE WA..ETHIOPIC SYL... | 0xE1 0x8B 0x98..0xFF #Lo [57] ETHIOPIC SYLLABLE ZA..ETHIOPIC SYL... | 0xE1 0x8C 0x00..0x90 # | 0xE1 0x8C 0x92..0x95 #Lo [4] ETHIOPIC SYLLABLE GWI..ETHIOPIC SY... | 0xE1 0x8C 0x98..0xFF #Lo [67] ETHIOPIC SYLLABLE GGA..ETHIOPIC SY... | 0xE1 0x8D 0x00..0x9A # | 0xE1 0x8D 0x9D..0x9F #Mn [3] ETHIOPIC COMBINING GEMINATION AND ... | 0xE1 0x8D 0xA9..0xB1 #No [9] ETHIOPIC DIGIT ONE..ETHIOPIC DIGIT... | 0xE1 0x8E 0x80..0x8F #Lo [16] ETHIOPIC SYLLABLE SEBATBEIT MWA..E... | 0xE1 0x8E 0xA0..0xFF #L& [86] CHEROKEE LETTER A..CHEROKEE LETTER MV | 0xE1 0x8F 0x00..0xB5 # | 0xE1 0x8F 0xB8..0xBD #L& [6] CHEROKEE SMALL LETTER YE..CHEROKEE... | 0xE1 0x90 0x81..0xFF #Lo [620] CANADIAN SYLLABICS E..CANADIAN... | 0xE1 0x91..0x98 0x00..0xFF # | 0xE1 0x99 0x00..0xAC # | 0xE1 0x99 0xAF..0xBF #Lo [17] CANADIAN SYLLABICS QAI..CANADIAN S... | 0xE1 0x9A 0x81..0x9A #Lo [26] OGHAM LETTER BEITH..OGHAM LETTER P... | 0xE1 0x9A 0xA0..0xFF #Lo [75] RUNIC LETTER FEHU FEOH FE F..RUNIC... | 0xE1 0x9B 0x00..0xAA # | 0xE1 0x9B 0xAE..0xB0 #Nl [3] RUNIC ARLAUG SYMBOL..RUNIC BELGTHO... | 0xE1 0x9B 0xB1..0xB8 #Lo [8] RUNIC LETTER K..RUNIC LETTER FRANK... | 0xE1 0x9C 0x80..0x8C #Lo [13] TAGALOG LETTER A..TAGALOG LETTER YA | 0xE1 0x9C 0x8E..0x91 #Lo [4] TAGALOG LETTER LA..TAGALOG LETTER HA | 0xE1 0x9C 0x92..0x94 #Mn [3] TAGALOG VOWEL SIGN I..TAGALOG SIGN... | 0xE1 0x9C 0xA0..0xB1 #Lo [18] HANUNOO LETTER A..HANUNOO LETTER HA | 0xE1 0x9C 0xB2..0xB4 #Mn [3] HANUNOO VOWEL SIGN I..HANUNOO SIGN... | 0xE1 0x9D 0x80..0x91 #Lo [18] BUHID LETTER A..BUHID LETTER HA | 0xE1 0x9D 0x92..0x93 #Mn [2] BUHID VOWEL SIGN I..BUHID VOWEL SI... | 0xE1 0x9D 0xA0..0xAC #Lo [13] TAGBANWA LETTER A..TAGBANWA LETTER YA | 0xE1 0x9D 0xAE..0xB0 #Lo [3] TAGBANWA LETTER LA..TAGBANWA LETTE... | 0xE1 0x9D 0xB2..0xB3 #Mn [2] TAGBANWA VOWEL SIGN I..TAGBANWA VO... | 0xE1 0x9E 0x80..0xB3 #Lo [52] KHMER LETTER KA..KHMER INDEPENDENT... | 0xE1 0x9E 0xB4..0xB5 #Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOW... | 0xE1 0x9E 0xB6 #Mc KHMER VOWEL SIGN AA | 0xE1 0x9E 0xB7..0xBD #Mn [7] KHMER VOWEL SIGN I..KHMER VOWEL SI... | 0xE1 0x9E 0xBE..0xFF #Mc [8] KHMER VOWEL SIGN OE..KHMER VOWEL S... | 0xE1 0x9F 0x00..0x85 # | 0xE1 0x9F 0x86 #Mn KHMER SIGN NIKAHIT | 0xE1 0x9F 0x87..0x88 #Mc [2] KHMER SIGN REAHMUK..KHMER SIGN YUU... | 0xE1 0x9F 0x89..0x93 #Mn [11] KHMER SIGN MUUSIKATOAN..KHMER SIGN... | 0xE1 0x9F 0x97 #Lm KHMER SIGN LEK TOO | 0xE1 0x9F 0x9C #Lo KHMER SIGN AVAKRAHASANYA | 0xE1 0x9F 0x9D #Mn KHMER SIGN ATTHACAN | 0xE1 0x9F 0xA0..0xA9 #Nd [10] KHMER DIGIT ZERO..KHMER DIGIT NINE | 0xE1 0xA0 0x8B..0x8D #Mn [3] MONGOLIAN FREE VARIATION SELECTOR ... | 0xE1 0xA0 0x90..0x99 #Nd [10] MONGOLIAN DIGIT ZERO..MONGOLIAN DI... | 0xE1 0xA0 0xA0..0xFF #Lo [35] MONGOLIAN LETTER A..MONGOLIAN LETT... | 0xE1 0xA1 0x00..0x82 # | 0xE1 0xA1 0x83 #Lm MONGOLIAN LETTER TODO LONG VOWEL SIGN | 0xE1 0xA1 0x84..0xB7 #Lo [52] MONGOLIAN LETTER TODO E..MONGOLIAN... | 0xE1 0xA2 0x80..0x84 #Lo [5] MONGOLIAN LETTER ALI GALI ANUSVARA... | 0xE1 0xA2 0x85..0x86 #Mn [2] MONGOLIAN LETTER ALI GALI BALUDA..... | 0xE1 0xA2 0x87..0xA8 #Lo [34] MONGOLIAN LETTER ALI GALI A..MONGO... | 0xE1 0xA2 0xA9 #Mn MONGOLIAN LETTER ALI GALI DAGALGA | 0xE1 0xA2 0xAA #Lo MONGOLIAN LETTER MANCHU ALI GALI LHA | 0xE1 0xA2 0xB0..0xFF #Lo [70] CANADIAN SYLLABICS OY..CANADIAN SY... | 0xE1 0xA3 0x00..0xB5 # | 0xE1 0xA4 0x80..0x9E #Lo [31] LIMBU VOWEL-CARRIER LETTER..LIMBU ... | 0xE1 0xA4 0xA0..0xA2 #Mn [3] LIMBU VOWEL SIGN A..LIMBU VOWEL SI... | 0xE1 0xA4 0xA3..0xA6 #Mc [4] LIMBU VOWEL SIGN EE..LIMBU VOWEL S... | 0xE1 0xA4 0xA7..0xA8 #Mn [2] LIMBU VOWEL SIGN E..LIMBU VOWEL SI... | 0xE1 0xA4 0xA9..0xAB #Mc [3] LIMBU SUBJOINED LETTER YA..LIMBU S... | 0xE1 0xA4 0xB0..0xB1 #Mc [2] LIMBU SMALL LETTER KA..LIMBU SMALL... | 0xE1 0xA4 0xB2 #Mn LIMBU SMALL LETTER ANUSVARA | 0xE1 0xA4 0xB3..0xB8 #Mc [6] LIMBU SMALL LETTER TA..LIMBU SMALL... | 0xE1 0xA4 0xB9..0xBB #Mn [3] LIMBU SIGN MUKPHRENG..LIMBU SIGN SA-I | 0xE1 0xA5 0x86..0x8F #Nd [10] LIMBU DIGIT ZERO..LIMBU DIGIT NINE | 0xE1 0xA5 0x90..0xAD #Lo [30] TAI LE LETTER KA..TAI LE LETTER AI | 0xE1 0xA5 0xB0..0xB4 #Lo [5] TAI LE LETTER TONE-2..TAI LE LETTE... | 0xE1 0xA6 0x80..0xAB #Lo [44] NEW TAI LUE LETTER HIGH QA..NEW TA... | 0xE1 0xA6 0xB0..0xFF #Lo [26] NEW TAI LUE VOWEL SIGN VOWEL SHORT... | 0xE1 0xA7 0x00..0x89 # | 0xE1 0xA7 0x90..0x99 #Nd [10] NEW TAI LUE DIGIT ZERO..NEW TAI LU... | 0xE1 0xA7 0x9A #No NEW TAI LUE THAM DIGIT ONE | 0xE1 0xA8 0x80..0x96 #Lo [23] BUGINESE LETTER KA..BUGINESE LETTE... | 0xE1 0xA8 0x97..0x98 #Mn [2] BUGINESE VOWEL SIGN I..BUGINESE VO... | 0xE1 0xA8 0x99..0x9A #Mc [2] BUGINESE VOWEL SIGN E..BUGINESE VO... | 0xE1 0xA8 0x9B #Mn BUGINESE VOWEL SIGN AE | 0xE1 0xA8 0xA0..0xFF #Lo [53] TAI THAM LETTER HIGH KA..TAI THAM ... | 0xE1 0xA9 0x00..0x94 # | 0xE1 0xA9 0x95 #Mc TAI THAM CONSONANT SIGN MEDIAL RA | 0xE1 0xA9 0x96 #Mn TAI THAM CONSONANT SIGN MEDIAL LA | 0xE1 0xA9 0x97 #Mc TAI THAM CONSONANT SIGN LA TANG LAI | 0xE1 0xA9 0x98..0x9E #Mn [7] TAI THAM SIGN MAI KANG LAI..TAI TH... | 0xE1 0xA9 0xA0 #Mn TAI THAM SIGN SAKOT | 0xE1 0xA9 0xA1 #Mc TAI THAM VOWEL SIGN A | 0xE1 0xA9 0xA2 #Mn TAI THAM VOWEL SIGN MAI SAT | 0xE1 0xA9 0xA3..0xA4 #Mc [2] TAI THAM VOWEL SIGN AA..TAI THAM V... | 0xE1 0xA9 0xA5..0xAC #Mn [8] TAI THAM VOWEL SIGN I..TAI THAM VO... | 0xE1 0xA9 0xAD..0xB2 #Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM V... | 0xE1 0xA9 0xB3..0xBC #Mn [10] TAI THAM VOWEL SIGN OA ABOVE..TAI ... | 0xE1 0xA9 0xBF #Mn TAI THAM COMBINING CRYPTOGRAMMIC DOT | 0xE1 0xAA 0x80..0x89 #Nd [10] TAI THAM HORA DIGIT ZERO..TAI THAM... | 0xE1 0xAA 0x90..0x99 #Nd [10] TAI THAM THAM DIGIT ZERO..TAI THAM... | 0xE1 0xAA 0xA7 #Lm TAI THAM SIGN MAI YAMOK | 0xE1 0xAA 0xB0..0xBD #Mn [14] COMBINING DOUBLED CIRCUMFLEX ACCEN... | 0xE1 0xAC 0x80..0x83 #Mn [4] BALINESE SIGN ULU RICEM..BALINESE ... | 0xE1 0xAC 0x84 #Mc BALINESE SIGN BISAH | 0xE1 0xAC 0x85..0xB3 #Lo [47] BALINESE LETTER AKARA..BALINESE LE... | 0xE1 0xAC 0xB4 #Mn BALINESE SIGN REREKAN | 0xE1 0xAC 0xB5 #Mc BALINESE VOWEL SIGN TEDUNG | 0xE1 0xAC 0xB6..0xBA #Mn [5] BALINESE VOWEL SIGN ULU..BALINESE ... | 0xE1 0xAC 0xBB #Mc BALINESE VOWEL SIGN RA REPA TEDUNG | 0xE1 0xAC 0xBC #Mn BALINESE VOWEL SIGN LA LENGA | 0xE1 0xAC 0xBD..0xFF #Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUN... | 0xE1 0xAD 0x00..0x81 # | 0xE1 0xAD 0x82 #Mn BALINESE VOWEL SIGN PEPET | 0xE1 0xAD 0x83..0x84 #Mc [2] BALINESE VOWEL SIGN PEPET TEDUNG..... | 0xE1 0xAD 0x85..0x8B #Lo [7] BALINESE LETTER KAF SASAK..BALINES... | 0xE1 0xAD 0x90..0x99 #Nd [10] BALINESE DIGIT ZERO..BALINESE DIGI... | 0xE1 0xAD 0xAB..0xB3 #Mn [9] BALINESE MUSICAL SYMBOL COMBINING ... | 0xE1 0xAE 0x80..0x81 #Mn [2] SUNDANESE SIGN PANYECEK..SUNDANESE... | 0xE1 0xAE 0x82 #Mc SUNDANESE SIGN PANGWISAD | 0xE1 0xAE 0x83..0xA0 #Lo [30] SUNDANESE LETTER A..SUNDANESE LETT... | 0xE1 0xAE 0xA1 #Mc SUNDANESE CONSONANT SIGN PAMINGKAL | 0xE1 0xAE 0xA2..0xA5 #Mn [4] SUNDANESE CONSONANT SIGN PANYAKRA.... | 0xE1 0xAE 0xA6..0xA7 #Mc [2] SUNDANESE VOWEL SIGN PANAELAENG..S... | 0xE1 0xAE 0xA8..0xA9 #Mn [2] SUNDANESE VOWEL SIGN PAMEPET..SUND... | 0xE1 0xAE 0xAA #Mc SUNDANESE SIGN PAMAAEH | 0xE1 0xAE 0xAB..0xAD #Mn [3] SUNDANESE SIGN VIRAMA..SUNDANESE C... | 0xE1 0xAE 0xAE..0xAF #Lo [2] SUNDANESE LETTER KHA..SUNDANESE LE... | 0xE1 0xAE 0xB0..0xB9 #Nd [10] SUNDANESE DIGIT ZERO..SUNDANESE DI... | 0xE1 0xAE 0xBA..0xFF #Lo [44] SUNDANESE AVAGRAHA..BATAK LETTER U | 0xE1 0xAF 0x00..0xA5 # | 0xE1 0xAF 0xA6 #Mn BATAK SIGN TOMPI | 0xE1 0xAF 0xA7 #Mc BATAK VOWEL SIGN E | 0xE1 0xAF 0xA8..0xA9 #Mn [2] BATAK VOWEL SIGN PAKPAK E..BATAK V... | 0xE1 0xAF 0xAA..0xAC #Mc [3] BATAK VOWEL SIGN I..BATAK VOWEL SI... | 0xE1 0xAF 0xAD #Mn BATAK VOWEL SIGN KARO O | 0xE1 0xAF 0xAE #Mc BATAK VOWEL SIGN U | 0xE1 0xAF 0xAF..0xB1 #Mn [3] BATAK VOWEL SIGN U FOR SIMALUNGUN ... | 0xE1 0xAF 0xB2..0xB3 #Mc [2] BATAK PANGOLAT..BATAK PANONGONAN | 0xE1 0xB0 0x80..0xA3 #Lo [36] LEPCHA LETTER KA..LEPCHA LETTER A | 0xE1 0xB0 0xA4..0xAB #Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA... | 0xE1 0xB0 0xAC..0xB3 #Mn [8] LEPCHA VOWEL SIGN E..LEPCHA CONSON... | 0xE1 0xB0 0xB4..0xB5 #Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEP... | 0xE1 0xB0 0xB6..0xB7 #Mn [2] LEPCHA SIGN RAN..LEPCHA SIGN NUKTA | 0xE1 0xB1 0x80..0x89 #Nd [10] LEPCHA DIGIT ZERO..LEPCHA DIGIT NINE | 0xE1 0xB1 0x8D..0x8F #Lo [3] LEPCHA LETTER TTA..LEPCHA LETTER DDA | 0xE1 0xB1 0x90..0x99 #Nd [10] OL CHIKI DIGIT ZERO..OL CHIKI DIGI... | 0xE1 0xB1 0x9A..0xB7 #Lo [30] OL CHIKI LETTER LA..OL CHIKI LETTE... | 0xE1 0xB1 0xB8..0xBD #Lm [6] OL CHIKI MU TTUDDAG..OL CHIKI AHAD | 0xE1 0xB2 0x80..0x88 #L& [9] CYRILLIC SMALL LETTER ROUNDED VE..... | 0xE1 0xB3 0x90..0x92 #Mn [3] VEDIC TONE KARSHANA..VEDIC TONE PR... | 0xE1 0xB3 0x94..0xA0 #Mn [13] VEDIC SIGN YAJURVEDIC MIDLINE SVAR... | 0xE1 0xB3 0xA1 #Mc VEDIC TONE ATHARVAVEDIC INDEPENDEN... | 0xE1 0xB3 0xA2..0xA8 #Mn [7] VEDIC SIGN VISARGA SVARITA..VEDIC ... | 0xE1 0xB3 0xA9..0xAC #Lo [4] VEDIC SIGN ANUSVARA ANTARGOMUKHA..... | 0xE1 0xB3 0xAD #Mn VEDIC SIGN TIRYAK | 0xE1 0xB3 0xAE..0xB1 #Lo [4] VEDIC SIGN HEXIFORM LONG ANUSVARA.... | 0xE1 0xB3 0xB2..0xB3 #Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIG... | 0xE1 0xB3 0xB4 #Mn VEDIC TONE CANDRA ABOVE | 0xE1 0xB3 0xB5..0xB6 #Lo [2] VEDIC SIGN JIHVAMULIYA..VEDIC SIGN... | 0xE1 0xB3 0xB8..0xB9 #Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE ... | 0xE1 0xB4 0x80..0xAB #L& [44] LATIN LETTER SMALL CAPITAL A..CYRI... | 0xE1 0xB4 0xAC..0xFF #Lm [63] MODIFIER LETTER CAPITAL A..GREEK S... | 0xE1 0xB5 0x00..0xAA # | 0xE1 0xB5 0xAB..0xB7 #L& [13] LATIN SMALL LETTER UE..LATIN SMALL... | 0xE1 0xB5 0xB8 #Lm MODIFIER LETTER CYRILLIC EN | 0xE1 0xB5 0xB9..0xFF #L& [34] LATIN SMALL LETTER INSULAR G..LATI... | 0xE1 0xB6 0x00..0x9A # | 0xE1 0xB6 0x9B..0xBF #Lm [37] MODIFIER LETTER SMALL TURNED ALPHA... | 0xE1 0xB7 0x80..0xB5 #Mn [54] COMBINING DOTTED GRAVE ACCENT..COM... | 0xE1 0xB7 0xBB..0xBF #Mn [5] COMBINING DELETION MARK..COMBINING... | 0xE1 0xB8 0x80..0xFF #L& [278] LATIN CAPITAL LETTER A WITH RI... | 0xE1 0xB9..0xBB 0x00..0xFF # | 0xE1 0xBC 0x00..0x95 # | 0xE1 0xBC 0x98..0x9D #L& [6] GREEK CAPITAL LETTER EPSILON WITH ... | 0xE1 0xBC 0xA0..0xFF #L& [38] GREEK SMALL LETTER ETA WITH PSILI.... | 0xE1 0xBD 0x00..0x85 # | 0xE1 0xBD 0x88..0x8D #L& [6] GREEK CAPITAL LETTER OMICRON WITH ... | 0xE1 0xBD 0x90..0x97 #L& [8] GREEK SMALL LETTER UPSILON WITH PS... | 0xE1 0xBD 0x99 #L& GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBD 0x9B #L& GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBD 0x9D #L& GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBD 0x9F..0xBD #L& [31] GREEK CAPITAL LETTER UPSILON WITH ... | 0xE1 0xBE 0x80..0xB4 #L& [53] GREEK SMALL LETTER ALPHA WITH PSIL... | 0xE1 0xBE 0xB6..0xBC #L& [7] GREEK SMALL LETTER ALPHA WITH PERI... | 0xE1 0xBE 0xBE #L& GREEK PROSGEGRAMMENI | 0xE1 0xBF 0x82..0x84 #L& [3] GREEK SMALL LETTER ETA WITH VARIA ... | 0xE1 0xBF 0x86..0x8C #L& [7] GREEK SMALL LETTER ETA WITH PERISP... | 0xE1 0xBF 0x90..0x93 #L& [4] GREEK SMALL LETTER IOTA WITH VRACH... | 0xE1 0xBF 0x96..0x9B #L& [6] GREEK SMALL LETTER IOTA WITH PERIS... | 0xE1 0xBF 0xA0..0xAC #L& [13] GREEK SMALL LETTER UPSILON WITH VR... | 0xE1 0xBF 0xB2..0xB4 #L& [3] GREEK SMALL LETTER OMEGA WITH VARI... | 0xE1 0xBF 0xB6..0xBC #L& [7] GREEK SMALL LETTER OMEGA WITH PERI... | 0xE2 0x80 0xBF..0xFF #Pc [2] UNDERTIE..CHARACTER TIE | 0xE2 0x81 0x00..0x80 # | 0xE2 0x81 0x94 #Pc INVERTED UNDERTIE | 0xE2 0x81 0xB1 #Lm SUPERSCRIPT LATIN SMALL LETTER I | 0xE2 0x81 0xBF #Lm SUPERSCRIPT LATIN SMALL LETTER N | 0xE2 0x82 0x90..0x9C #Lm [13] LATIN SUBSCRIPT SMALL LETTER A..LA... | 0xE2 0x83 0x90..0x9C #Mn [13] COMBINING LEFT HARPOON ABOVE..COMB... | 0xE2 0x83 0xA1 #Mn COMBINING LEFT RIGHT ARROW ABOVE | 0xE2 0x83 0xA5..0xB0 #Mn [12] COMBINING REVERSE SOLIDUS OVERLAY.... | 0xE2 0x84 0x82 #L& DOUBLE-STRUCK CAPITAL C | 0xE2 0x84 0x87 #L& EULER CONSTANT | 0xE2 0x84 0x8A..0x93 #L& [10] SCRIPT SMALL G..SCRIPT SMALL L | 0xE2 0x84 0x95 #L& DOUBLE-STRUCK CAPITAL N | 0xE2 0x84 0x98 #Sm SCRIPT CAPITAL P | 0xE2 0x84 0x99..0x9D #L& [5] DOUBLE-STRUCK CAPITAL P..DOUBLE-ST... | 0xE2 0x84 0xA4 #L& DOUBLE-STRUCK CAPITAL Z | 0xE2 0x84 0xA6 #L& OHM SIGN | 0xE2 0x84 0xA8 #L& BLACK-LETTER CAPITAL Z | 0xE2 0x84 0xAA..0xAD #L& [4] KELVIN SIGN..BLACK-LETTER CAPITAL C | 0xE2 0x84 0xAE #So ESTIMATED SYMBOL | 0xE2 0x84 0xAF..0xB4 #L& [6] SCRIPT SMALL E..SCRIPT SMALL O | 0xE2 0x84 0xB5..0xB8 #Lo [4] ALEF SYMBOL..DALET SYMBOL | 0xE2 0x84 0xB9 #L& INFORMATION SOURCE | 0xE2 0x84 0xBC..0xBF #L& [4] DOUBLE-STRUCK SMALL PI..DOUBLE-STR... | 0xE2 0x85 0x85..0x89 #L& [5] DOUBLE-STRUCK ITALIC CAPITAL D..DO... | 0xE2 0x85 0x8E #L& TURNED SMALL F | 0xE2 0x85 0xA0..0xFF #Nl [35] ROMAN NUMERAL ONE..ROMAN NUMERAL T... | 0xE2 0x86 0x00..0x82 # | 0xE2 0x86 0x83..0x84 #L& [2] ROMAN NUMERAL REVERSED ONE HUNDRED... | 0xE2 0x86 0x85..0x88 #Nl [4] ROMAN NUMERAL SIX LATE FORM..ROMAN... | 0xE2 0xB0 0x80..0xAE #L& [47] GLAGOLITIC CAPITAL LETTER AZU..GLA... | 0xE2 0xB0 0xB0..0xFF #L& [47] GLAGOLITIC SMALL LETTER AZU..GLAGO... | 0xE2 0xB1 0x00..0x9E # | 0xE2 0xB1 0xA0..0xBB #L& [28] LATIN CAPITAL LETTER L WITH DOUBLE... | 0xE2 0xB1 0xBC..0xBD #Lm [2] LATIN SUBSCRIPT SMALL LETTER J..MO... | 0xE2 0xB1 0xBE..0xFF #L& [103] LATIN CAPITAL LETTER S WITH SW... | 0xE2 0xB2..0xB2 0x00..0xFF # | 0xE2 0xB3 0x00..0xA4 # | 0xE2 0xB3 0xAB..0xAE #L& [4] COPTIC CAPITAL LETTER CRYPTOGRAMMI... | 0xE2 0xB3 0xAF..0xB1 #Mn [3] COPTIC COMBINING NI ABOVE..COPTIC ... | 0xE2 0xB3 0xB2..0xB3 #L& [2] COPTIC CAPITAL LETTER BOHAIRIC KHE... | 0xE2 0xB4 0x80..0xA5 #L& [38] GEORGIAN SMALL LETTER AN..GEORGIAN... | 0xE2 0xB4 0xA7 #L& GEORGIAN SMALL LETTER YN | 0xE2 0xB4 0xAD #L& GEORGIAN SMALL LETTER AEN | 0xE2 0xB4 0xB0..0xFF #Lo [56] TIFINAGH LETTER YA..TIFINAGH LETTE... | 0xE2 0xB5 0x00..0xA7 # | 0xE2 0xB5 0xAF #Lm TIFINAGH MODIFIER LETTER LABIALIZA... | 0xE2 0xB5 0xBF #Mn TIFINAGH CONSONANT JOINER | 0xE2 0xB6 0x80..0x96 #Lo [23] ETHIOPIC SYLLABLE LOA..ETHIOPIC SY... | 0xE2 0xB6 0xA0..0xA6 #Lo [7] ETHIOPIC SYLLABLE SSA..ETHIOPIC SY... | 0xE2 0xB6 0xA8..0xAE #Lo [7] ETHIOPIC SYLLABLE CCA..ETHIOPIC SY... | 0xE2 0xB6 0xB0..0xB6 #Lo [7] ETHIOPIC SYLLABLE ZZA..ETHIOPIC SY... | 0xE2 0xB6 0xB8..0xBE #Lo [7] ETHIOPIC SYLLABLE CCHA..ETHIOPIC S... | 0xE2 0xB7 0x80..0x86 #Lo [7] ETHIOPIC SYLLABLE QYA..ETHIOPIC SY... | 0xE2 0xB7 0x88..0x8E #Lo [7] ETHIOPIC SYLLABLE KYA..ETHIOPIC SY... | 0xE2 0xB7 0x90..0x96 #Lo [7] ETHIOPIC SYLLABLE XYA..ETHIOPIC SY... | 0xE2 0xB7 0x98..0x9E #Lo [7] ETHIOPIC SYLLABLE GYA..ETHIOPIC SY... | 0xE2 0xB7 0xA0..0xBF #Mn [32] COMBINING CYRILLIC LETTER BE..COMB... | 0xE3 0x80 0x85 #Lm IDEOGRAPHIC ITERATION MARK | 0xE3 0x80 0x86 #Lo IDEOGRAPHIC CLOSING MARK | 0xE3 0x80 0x87 #Nl IDEOGRAPHIC NUMBER ZERO | 0xE3 0x80 0xA1..0xA9 #Nl [9] HANGZHOU NUMERAL ONE..HANGZHOU NUM... | 0xE3 0x80 0xAA..0xAD #Mn [4] IDEOGRAPHIC LEVEL TONE MARK..IDEOG... | 0xE3 0x80 0xAE..0xAF #Mc [2] HANGUL SINGLE DOT TONE MARK..HANGU... | 0xE3 0x80 0xB1..0xB5 #Lm [5] VERTICAL KANA REPEAT MARK..VERTICA... | 0xE3 0x80 0xB8..0xBA #Nl [3] HANGZHOU NUMERAL TEN..HANGZHOU NUM... | 0xE3 0x80 0xBB #Lm VERTICAL IDEOGRAPHIC ITERATION MARK | 0xE3 0x80 0xBC #Lo MASU MARK | 0xE3 0x81 0x81..0xFF #Lo [86] HIRAGANA LETTER SMALL A..HIRAGANA ... | 0xE3 0x82 0x00..0x96 # | 0xE3 0x82 0x99..0x9A #Mn [2] COMBINING KATAKANA-HIRAGANA VOICED... | 0xE3 0x82 0x9B..0x9C #Sk [2] KATAKANA-HIRAGANA VOICED SOUND MAR... | 0xE3 0x82 0x9D..0x9E #Lm [2] HIRAGANA ITERATION MARK..HIRAGANA ... | 0xE3 0x82 0x9F #Lo HIRAGANA DIGRAPH YORI | 0xE3 0x82 0xA1..0xFF #Lo [90] KATAKANA LETTER SMALL A..KATAKANA ... | 0xE3 0x83 0x00..0xBA # | 0xE3 0x83 0xBC..0xBE #Lm [3] KATAKANA-HIRAGANA PROLONGED SOUND ... | 0xE3 0x83 0xBF #Lo KATAKANA DIGRAPH KOTO | 0xE3 0x84 0x85..0xAD #Lo [41] BOPOMOFO LETTER B..BOPOMOFO LETTER IH | 0xE3 0x84 0xB1..0xFF #Lo [94] HANGUL LETTER KIYEOK..HANGUL L... | 0xE3 0x85..0x85 0x00..0xFF # | 0xE3 0x86 0x00..0x8E # | 0xE3 0x86 0xA0..0xBA #Lo [27] BOPOMOFO LETTER BU..BOPOMOFO LETTE... | 0xE3 0x87 0xB0..0xBF #Lo [16] KATAKANA LETTER SMALL KU..KATAKANA... | 0xE3 0x90 0x80..0xFF #Lo [6582] CJK UNIFIED IDEOGRAPH-3400..C... | 0xE3 0x91..0xFF 0x00..0xFF # | 0xE4 0x00 0x00..0xFF # | 0xE4 0x01..0xB5 0x00..0xFF # | 0xE4 0xB6 0x00..0xB5 # | 0xE4 0xB8 0x80..0xFF #Lo [20950] CJK UNIFIED IDEOGRAPH-... | 0xE4 0xB9..0xFF 0x00..0xFF # | 0xE5..0xE8 0x00..0xFF 0x00..0xFF # | 0xE9 0x00 0x00..0xFF # | 0xE9 0x01..0xBE 0x00..0xFF # | 0xE9 0xBF 0x00..0x95 # | 0xEA 0x80 0x80..0x94 #Lo [21] YI SYLLABLE IT..YI SYLLABLE E | 0xEA 0x80 0x95 #Lm YI SYLLABLE WU | 0xEA 0x80 0x96..0xFF #Lo [1143] YI SYLLABLE BIT..YI SYLLABLE YYR | 0xEA 0x81..0x91 0x00..0xFF # | 0xEA 0x92 0x00..0x8C # | 0xEA 0x93 0x90..0xB7 #Lo [40] LISU LETTER BA..LISU LETTER OE | 0xEA 0x93 0xB8..0xBD #Lm [6] LISU LETTER TONE MYA TI..LISU LETT... | 0xEA 0x94 0x80..0xFF #Lo [268] VAI SYLLABLE EE..VAI SYLLABLE NG | 0xEA 0x95..0x97 0x00..0xFF # | 0xEA 0x98 0x00..0x8B # | 0xEA 0x98 0x8C #Lm VAI SYLLABLE LENGTHENER | 0xEA 0x98 0x90..0x9F #Lo [16] VAI SYLLABLE NDOLE FA..VAI SYMBOL ... | 0xEA 0x98 0xA0..0xA9 #Nd [10] VAI DIGIT ZERO..VAI DIGIT NINE | 0xEA 0x98 0xAA..0xAB #Lo [2] VAI SYLLABLE NDOLE MA..VAI SYLLABL... | 0xEA 0x99 0x80..0xAD #L& [46] CYRILLIC CAPITAL LETTER ZEMLYA..CY... | 0xEA 0x99 0xAE #Lo CYRILLIC LETTER MULTIOCULAR O | 0xEA 0x99 0xAF #Mn COMBINING CYRILLIC VZMET | 0xEA 0x99 0xB4..0xBD #Mn [10] COMBINING CYRILLIC LETTER UKRAINIA... | 0xEA 0x99 0xBF #Lm CYRILLIC PAYEROK | 0xEA 0x9A 0x80..0x9B #L& [28] CYRILLIC CAPITAL LETTER DWE..CYRIL... | 0xEA 0x9A 0x9C..0x9D #Lm [2] MODIFIER LETTER CYRILLIC HARD SIGN... | 0xEA 0x9A 0x9E..0x9F #Mn [2] COMBINING CYRILLIC LETTER EF..COMB... | 0xEA 0x9A 0xA0..0xFF #Lo [70] BAMUM LETTER A..BAMUM LETTER KI | 0xEA 0x9B 0x00..0xA5 # | 0xEA 0x9B 0xA6..0xAF #Nl [10] BAMUM LETTER MO..BAMUM LETTER KOGHOM | 0xEA 0x9B 0xB0..0xB1 #Mn [2] BAMUM COMBINING MARK KOQNDON..BAMU... | 0xEA 0x9C 0x97..0x9F #Lm [9] MODIFIER LETTER DOT VERTICAL BAR..... | 0xEA 0x9C 0xA2..0xFF #L& [78] LATIN CAPITAL LETTER EGYPTOLOGICAL... | 0xEA 0x9D 0x00..0xAF # | 0xEA 0x9D 0xB0 #Lm MODIFIER LETTER US | 0xEA 0x9D 0xB1..0xFF #L& [23] LATIN SMALL LETTER DUM..LATIN SMAL... | 0xEA 0x9E 0x00..0x87 # | 0xEA 0x9E 0x88 #Lm MODIFIER LETTER LOW CIRCUMFLEX ACCENT | 0xEA 0x9E 0x8B..0x8E #L& [4] LATIN CAPITAL LETTER SALTILLO..LAT... | 0xEA 0x9E 0x8F #Lo LATIN LETTER SINOLOGICAL DOT | 0xEA 0x9E 0x90..0xAE #L& [31] LATIN CAPITAL LETTER N WITH DESCEN... | 0xEA 0x9E 0xB0..0xB7 #L& [8] LATIN CAPITAL LETTER TURNED K..LAT... | 0xEA 0x9F 0xB7 #Lo LATIN EPIGRAPHIC LETTER SIDEWAYS I | 0xEA 0x9F 0xB8..0xB9 #Lm [2] MODIFIER LETTER CAPITAL H WITH STR... | 0xEA 0x9F 0xBA #L& LATIN LETTER SMALL CAPITAL TURNED M | 0xEA 0x9F 0xBB..0xFF #Lo [7] LATIN EPIGRAPHIC LETTER REVERSED F... | 0xEA 0xA0 0x00..0x81 # | 0xEA 0xA0 0x82 #Mn SYLOTI NAGRI SIGN DVISVARA | 0xEA 0xA0 0x83..0x85 #Lo [3] SYLOTI NAGRI LETTER U..SYLOTI NAGR... | 0xEA 0xA0 0x86 #Mn SYLOTI NAGRI SIGN HASANTA | 0xEA 0xA0 0x87..0x8A #Lo [4] SYLOTI NAGRI LETTER KO..SYLOTI NAG... | 0xEA 0xA0 0x8B #Mn SYLOTI NAGRI SIGN ANUSVARA | 0xEA 0xA0 0x8C..0xA2 #Lo [23] SYLOTI NAGRI LETTER CO..SYLOTI NAG... | 0xEA 0xA0 0xA3..0xA4 #Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI ... | 0xEA 0xA0 0xA5..0xA6 #Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI ... | 0xEA 0xA0 0xA7 #Mc SYLOTI NAGRI VOWEL SIGN OO | 0xEA 0xA1 0x80..0xB3 #Lo [52] PHAGS-PA LETTER KA..PHAGS-PA LETTE... | 0xEA 0xA2 0x80..0x81 #Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHT... | 0xEA 0xA2 0x82..0xB3 #Lo [50] SAURASHTRA LETTER A..SAURASHTRA LE... | 0xEA 0xA2 0xB4..0xFF #Mc [16] SAURASHTRA CONSONANT SIGN HAARU..S... | 0xEA 0xA3 0x00..0x83 # | 0xEA 0xA3 0x84..0x85 #Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA... | 0xEA 0xA3 0x90..0x99 #Nd [10] SAURASHTRA DIGIT ZERO..SAURASHTRA ... | 0xEA 0xA3 0xA0..0xB1 #Mn [18] COMBINING DEVANAGARI DIGIT ZERO..C... | 0xEA 0xA3 0xB2..0xB7 #Lo [6] DEVANAGARI SIGN SPACING CANDRABIND... | 0xEA 0xA3 0xBB #Lo DEVANAGARI HEADSTROKE | 0xEA 0xA3 0xBD #Lo DEVANAGARI JAIN OM | 0xEA 0xA4 0x80..0x89 #Nd [10] KAYAH LI DIGIT ZERO..KAYAH LI DIGI... | 0xEA 0xA4 0x8A..0xA5 #Lo [28] KAYAH LI LETTER KA..KAYAH LI LETTE... | 0xEA 0xA4 0xA6..0xAD #Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE C... | 0xEA 0xA4 0xB0..0xFF #Lo [23] REJANG LETTER KA..REJANG LETTER A | 0xEA 0xA5 0x00..0x86 # | 0xEA 0xA5 0x87..0x91 #Mn [11] REJANG VOWEL SIGN I..REJANG CONSON... | 0xEA 0xA5 0x92..0x93 #Mc [2] REJANG CONSONANT SIGN H..REJANG VI... | 0xEA 0xA5 0xA0..0xBC #Lo [29] HANGUL CHOSEONG TIKEUT-MIEUM..HANG... | 0xEA 0xA6 0x80..0x82 #Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE ... | 0xEA 0xA6 0x83 #Mc JAVANESE SIGN WIGNYAN | 0xEA 0xA6 0x84..0xB2 #Lo [47] JAVANESE LETTER A..JAVANESE LETTER HA | 0xEA 0xA6 0xB3 #Mn JAVANESE SIGN CECAK TELU | 0xEA 0xA6 0xB4..0xB5 #Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANE... | 0xEA 0xA6 0xB6..0xB9 #Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE... | 0xEA 0xA6 0xBA..0xBB #Mc [2] JAVANESE VOWEL SIGN TALING..JAVANE... | 0xEA 0xA6 0xBC #Mn JAVANESE VOWEL SIGN PEPET | 0xEA 0xA6 0xBD..0xFF #Mc [4] JAVANESE CONSONANT SIGN KERET..JAV... | 0xEA 0xA7 0x00..0x80 # | 0xEA 0xA7 0x8F #Lm JAVANESE PANGRANGKEP | 0xEA 0xA7 0x90..0x99 #Nd [10] JAVANESE DIGIT ZERO..JAVANESE DIGI... | 0xEA 0xA7 0xA0..0xA4 #Lo [5] MYANMAR LETTER SHAN GHA..MYANMAR L... | 0xEA 0xA7 0xA5 #Mn MYANMAR SIGN SHAN SAW | 0xEA 0xA7 0xA6 #Lm MYANMAR MODIFIER LETTER SHAN REDUP... | 0xEA 0xA7 0xA7..0xAF #Lo [9] MYANMAR LETTER TAI LAING NYA..MYAN... | 0xEA 0xA7 0xB0..0xB9 #Nd [10] MYANMAR TAI LAING DIGIT ZERO..MYAN... | 0xEA 0xA7 0xBA..0xBE #Lo [5] MYANMAR LETTER TAI LAING LLA..MYAN... | 0xEA 0xA8 0x80..0xA8 #Lo [41] CHAM LETTER A..CHAM LETTER HA | 0xEA 0xA8 0xA9..0xAE #Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIG... | 0xEA 0xA8 0xAF..0xB0 #Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI | 0xEA 0xA8 0xB1..0xB2 #Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIG... | 0xEA 0xA8 0xB3..0xB4 #Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSO... | 0xEA 0xA8 0xB5..0xB6 #Mn [2] CHAM CONSONANT SIGN LA..CHAM CONSO... | 0xEA 0xA9 0x80..0x82 #Lo [3] CHAM LETTER FINAL K..CHAM LETTER F... | 0xEA 0xA9 0x83 #Mn CHAM CONSONANT SIGN FINAL NG | 0xEA 0xA9 0x84..0x8B #Lo [8] CHAM LETTER FINAL CH..CHAM LETTER ... | 0xEA 0xA9 0x8C #Mn CHAM CONSONANT SIGN FINAL M | 0xEA 0xA9 0x8D #Mc CHAM CONSONANT SIGN FINAL H | 0xEA 0xA9 0x90..0x99 #Nd [10] CHAM DIGIT ZERO..CHAM DIGIT NINE | 0xEA 0xA9 0xA0..0xAF #Lo [16] MYANMAR LETTER KHAMTI GA..MYANMAR ... | 0xEA 0xA9 0xB0 #Lm MYANMAR MODIFIER LETTER KHAMTI RED... | 0xEA 0xA9 0xB1..0xB6 #Lo [6] MYANMAR LETTER KHAMTI XA..MYANMAR ... | 0xEA 0xA9 0xBA #Lo MYANMAR LETTER AITON RA | 0xEA 0xA9 0xBB #Mc MYANMAR SIGN PAO KAREN TONE | 0xEA 0xA9 0xBC #Mn MYANMAR SIGN TAI LAING TONE-2 | 0xEA 0xA9 0xBD #Mc MYANMAR SIGN TAI LAING TONE-5 | 0xEA 0xA9 0xBE..0xFF #Lo [50] MYANMAR LETTER SHWE PALAUNG CHA..T... | 0xEA 0xAA 0x00..0xAF # | 0xEA 0xAA 0xB0 #Mn TAI VIET MAI KANG | 0xEA 0xAA 0xB1 #Lo TAI VIET VOWEL AA | 0xEA 0xAA 0xB2..0xB4 #Mn [3] TAI VIET VOWEL I..TAI VIET VOWEL U | 0xEA 0xAA 0xB5..0xB6 #Lo [2] TAI VIET VOWEL E..TAI VIET VOWEL O | 0xEA 0xAA 0xB7..0xB8 #Mn [2] TAI VIET MAI KHIT..TAI VIET VOWEL IA | 0xEA 0xAA 0xB9..0xBD #Lo [5] TAI VIET VOWEL UEA..TAI VIET VOWEL AN | 0xEA 0xAA 0xBE..0xBF #Mn [2] TAI VIET VOWEL AM..TAI VIET TONE M... | 0xEA 0xAB 0x80 #Lo TAI VIET TONE MAI NUENG | 0xEA 0xAB 0x81 #Mn TAI VIET TONE MAI THO | 0xEA 0xAB 0x82 #Lo TAI VIET TONE MAI SONG | 0xEA 0xAB 0x9B..0x9C #Lo [2] TAI VIET SYMBOL KON..TAI VIET SYMB... | 0xEA 0xAB 0x9D #Lm TAI VIET SYMBOL SAM | 0xEA 0xAB 0xA0..0xAA #Lo [11] MEETEI MAYEK LETTER E..MEETEI MAYE... | 0xEA 0xAB 0xAB #Mc MEETEI MAYEK VOWEL SIGN II | 0xEA 0xAB 0xAC..0xAD #Mn [2] MEETEI MAYEK VOWEL SIGN UU..MEETEI... | 0xEA 0xAB 0xAE..0xAF #Mc [2] MEETEI MAYEK VOWEL SIGN AU..MEETEI... | 0xEA 0xAB 0xB2 #Lo MEETEI MAYEK ANJI | 0xEA 0xAB 0xB3..0xB4 #Lm [2] MEETEI MAYEK SYLLABLE REPETITION M... | 0xEA 0xAB 0xB5 #Mc MEETEI MAYEK VOWEL SIGN VISARGA | 0xEA 0xAB 0xB6 #Mn MEETEI MAYEK VIRAMA | 0xEA 0xAC 0x81..0x86 #Lo [6] ETHIOPIC SYLLABLE TTHU..ETHIOPIC S... | 0xEA 0xAC 0x89..0x8E #Lo [6] ETHIOPIC SYLLABLE DDHU..ETHIOPIC S... | 0xEA 0xAC 0x91..0x96 #Lo [6] ETHIOPIC SYLLABLE DZU..ETHIOPIC SY... | 0xEA 0xAC 0xA0..0xA6 #Lo [7] ETHIOPIC SYLLABLE CCHHA..ETHIOPIC ... | 0xEA 0xAC 0xA8..0xAE #Lo [7] ETHIOPIC SYLLABLE BBA..ETHIOPIC SY... | 0xEA 0xAC 0xB0..0xFF #L& [43] LATIN SMALL LETTER BARRED ALPHA..L... | 0xEA 0xAD 0x00..0x9A # | 0xEA 0xAD 0x9C..0x9F #Lm [4] MODIFIER LETTER SMALL HENG..MODIFI... | 0xEA 0xAD 0xA0..0xA5 #L& [6] LATIN SMALL LETTER SAKHA YAT..GREE... | 0xEA 0xAD 0xB0..0xFF #L& [80] CHEROKEE SMALL LETTER A..CHEROKEE ... | 0xEA 0xAE 0x00..0xBF # | 0xEA 0xAF 0x80..0xA2 #Lo [35] MEETEI MAYEK LETTER KOK..MEETEI MA... | 0xEA 0xAF 0xA3..0xA4 #Mc [2] MEETEI MAYEK VOWEL SIGN ONAP..MEET... | 0xEA 0xAF 0xA5 #Mn MEETEI MAYEK VOWEL SIGN ANAP | 0xEA 0xAF 0xA6..0xA7 #Mc [2] MEETEI MAYEK VOWEL SIGN YENAP..MEE... | 0xEA 0xAF 0xA8 #Mn MEETEI MAYEK VOWEL SIGN UNAP | 0xEA 0xAF 0xA9..0xAA #Mc [2] MEETEI MAYEK VOWEL SIGN CHEINAP..M... | 0xEA 0xAF 0xAC #Mc MEETEI MAYEK LUM IYEK | 0xEA 0xAF 0xAD #Mn MEETEI MAYEK APUN IYEK | 0xEA 0xAF 0xB0..0xB9 #Nd [10] MEETEI MAYEK DIGIT ZERO..MEETEI MA... | 0xEA 0xB0 0x80..0xFF #Lo [11172] HANGUL SYLLABLE GA..HA... | 0xEA 0xB1..0xFF 0x00..0xFF # | 0xEB..0xEC 0x00..0xFF 0x00..0xFF # | 0xED 0x00 0x00..0xFF # | 0xED 0x01..0x9D 0x00..0xFF # | 0xED 0x9E 0x00..0xA3 # | 0xED 0x9E 0xB0..0xFF #Lo [23] HANGUL JUNGSEONG O-YEO..HANGUL JUN... | 0xED 0x9F 0x00..0x86 # | 0xED 0x9F 0x8B..0xBB #Lo [49] HANGUL JONGSEONG NIEUN-RIEUL..HANG... | 0xEF 0xA4 0x80..0xFF #Lo [366] CJK COMPATIBILITY IDEOGRAPH-F9... | 0xEF 0xA5..0xA8 0x00..0xFF # | 0xEF 0xA9 0x00..0xAD # | 0xEF 0xA9 0xB0..0xFF #Lo [106] CJK COMPATIBILITY IDEOGRAPH-FA... | 0xEF 0xAA..0xAA 0x00..0xFF # | 0xEF 0xAB 0x00..0x99 # | 0xEF 0xAC 0x80..0x86 #L& [7] LATIN SMALL LIGATURE FF..LATIN SMA... | 0xEF 0xAC 0x93..0x97 #L& [5] ARMENIAN SMALL LIGATURE MEN NOW..A... | 0xEF 0xAC 0x9D #Lo HEBREW LETTER YOD WITH HIRIQ | 0xEF 0xAC 0x9E #Mn HEBREW POINT JUDEO-SPANISH VARIKA | 0xEF 0xAC 0x9F..0xA8 #Lo [10] HEBREW LIGATURE YIDDISH YOD YOD PA... | 0xEF 0xAC 0xAA..0xB6 #Lo [13] HEBREW LETTER SHIN WITH SHIN DOT..... | 0xEF 0xAC 0xB8..0xBC #Lo [5] HEBREW LETTER TET WITH DAGESH..HEB... | 0xEF 0xAC 0xBE #Lo HEBREW LETTER MEM WITH DAGESH | 0xEF 0xAD 0x80..0x81 #Lo [2] HEBREW LETTER NUN WITH DAGESH..HEB... | 0xEF 0xAD 0x83..0x84 #Lo [2] HEBREW LETTER FINAL PE WITH DAGESH... | 0xEF 0xAD 0x86..0xFF #Lo [108] HEBREW LETTER TSADI WITH DAGESH..A... | 0xEF 0xAE 0x00..0xB1 # | 0xEF 0xAF 0x93..0xFF #Lo [363] ARABIC LETTER NG ISOLATED FORM... | 0xEF 0xB0..0xB3 0x00..0xFF # | 0xEF 0xB4 0x00..0xBD # | 0xEF 0xB5 0x90..0xFF #Lo [64] ARABIC LIGATURE TEH WITH JEEM WITH... | 0xEF 0xB6 0x00..0x8F # | 0xEF 0xB6 0x92..0xFF #Lo [54] ARABIC LIGATURE MEEM WITH JEEM WIT... | 0xEF 0xB7 0x00..0x87 # | 0xEF 0xB7 0xB0..0xBB #Lo [12] ARABIC LIGATURE SALLA USED AS KORA... | 0xEF 0xB8 0x80..0x8F #Mn [16] VARIATION SELECTOR-1..VARIATION SE... | 0xEF 0xB8 0xA0..0xAF #Mn [16] COMBINING LIGATURE LEFT HALF..COMB... | 0xEF 0xB8 0xB3..0xB4 #Pc [2] PRESENTATION FORM FOR VERTICAL LOW... | 0xEF 0xB9 0x8D..0x8F #Pc [3] DASHED LOW LINE..WAVY LOW LINE | 0xEF 0xB9 0xB0..0xB4 #Lo [5] ARABIC FATHATAN ISOLATED FORM..ARA... | 0xEF 0xB9 0xB6..0xFF #Lo [135] ARABIC FATHA ISOLATED FORM..AR... | 0xEF 0xBA..0xBA 0x00..0xFF # | 0xEF 0xBB 0x00..0xBC # | 0xEF 0xBC 0x90..0x99 #Nd [10] FULLWIDTH DIGIT ZERO..FULLWIDTH DI... | 0xEF 0xBC 0xA1..0xBA #L& [26] FULLWIDTH LATIN CAPITAL LETTER A..... | 0xEF 0xBC 0xBF #Pc FULLWIDTH LOW LINE | 0xEF 0xBD 0x81..0x9A #L& [26] FULLWIDTH LATIN SMALL LETTER A..FU... | 0xEF 0xBD 0xA6..0xAF #Lo [10] HALFWIDTH KATAKANA LETTER WO..HALF... | 0xEF 0xBD 0xB0 #Lm HALFWIDTH KATAKANA-HIRAGANA PROLON... | 0xEF 0xBD 0xB1..0xFF #Lo [45] HALFWIDTH KATAKANA LETTER A..HALFW... | 0xEF 0xBE 0x00..0x9D # | 0xEF 0xBE 0x9E..0x9F #Lm [2] HALFWIDTH KATAKANA VOICED SOUND MA... | 0xEF 0xBE 0xA0..0xBE #Lo [31] HALFWIDTH HANGUL FILLER..HALFWIDTH... | 0xEF 0xBF 0x82..0x87 #Lo [6] HALFWIDTH HANGUL LETTER A..HALFWID... | 0xEF 0xBF 0x8A..0x8F #Lo [6] HALFWIDTH HANGUL LETTER YEO..HALFW... | 0xEF 0xBF 0x92..0x97 #Lo [6] HALFWIDTH HANGUL LETTER YO..HALFWI... | 0xEF 0xBF 0x9A..0x9C #Lo [3] HALFWIDTH HANGUL LETTER EU..HALFWI... | 0xF0 0x90 0x80 0x80..0x8B #Lo [12] LINEAR B SYLLABLE B008 A..LINEA... | 0xF0 0x90 0x80 0x8D..0xA6 #Lo [26] LINEAR B SYLLABLE B036 JO..LINE... | 0xF0 0x90 0x80 0xA8..0xBA #Lo [19] LINEAR B SYLLABLE B060 RA..LINE... | 0xF0 0x90 0x80 0xBC..0xBD #Lo [2] LINEAR B SYLLABLE B017 ZA..LINE... | 0xF0 0x90 0x80 0xBF..0xFF #Lo [15] LINEAR B SYLLABLE B020 ZO..LINE... | 0xF0 0x90 0x81 0x00..0x8D # | 0xF0 0x90 0x81 0x90..0x9D #Lo [14] LINEAR B SYMBOL B018..LINEAR B ... | 0xF0 0x90 0x82 0x80..0xFF #Lo [123] LINEAR B IDEOGRAM B100 MAN..LIN... | 0xF0 0x90 0x83 0x00..0xBA # | 0xF0 0x90 0x85 0x80..0xB4 #Nl [53] GREEK ACROPHONIC ATTIC ONE QUAR... | 0xF0 0x90 0x87 0xBD #Mn PHAISTOS DISC SIGN COMBINING OBLIQ... | 0xF0 0x90 0x8A 0x80..0x9C #Lo [29] LYCIAN LETTER A..LYCIAN LETTER X | 0xF0 0x90 0x8A 0xA0..0xFF #Lo [49] CARIAN LETTER A..CARIAN LETTER ... | 0xF0 0x90 0x8B 0x00..0x90 # | 0xF0 0x90 0x8B 0xA0 #Mn COPTIC EPACT THOUSANDS MARK | 0xF0 0x90 0x8C 0x80..0x9F #Lo [32] OLD ITALIC LETTER A..OLD ITALIC... | 0xF0 0x90 0x8C 0xB0..0xFF #Lo [17] GOTHIC LETTER AHSA..GOTHIC LETT... | 0xF0 0x90 0x8D 0x00..0x80 # | 0xF0 0x90 0x8D 0x81 #Nl GOTHIC LETTER NINETY | 0xF0 0x90 0x8D 0x82..0x89 #Lo [8] GOTHIC LETTER RAIDA..GOTHIC LET... | 0xF0 0x90 0x8D 0x8A #Nl GOTHIC LETTER NINE HUNDRED | 0xF0 0x90 0x8D 0x90..0xB5 #Lo [38] OLD PERMIC LETTER AN..OLD PERMI... | 0xF0 0x90 0x8D 0xB6..0xBA #Mn [5] COMBINING OLD PERMIC LETTER AN.... | 0xF0 0x90 0x8E 0x80..0x9D #Lo [30] UGARITIC LETTER ALPA..UGARITIC ... | 0xF0 0x90 0x8E 0xA0..0xFF #Lo [36] OLD PERSIAN SIGN A..OLD PERSIAN... | 0xF0 0x90 0x8F 0x00..0x83 # | 0xF0 0x90 0x8F 0x88..0x8F #Lo [8] OLD PERSIAN SIGN AURAMAZDAA..OL... | 0xF0 0x90 0x8F 0x91..0x95 #Nl [5] OLD PERSIAN NUMBER ONE..OLD PER... | 0xF0 0x90 0x90 0x80..0xFF #L& [80] DESERET CAPITAL LETTER LONG I..... | 0xF0 0x90 0x91 0x00..0x8F # | 0xF0 0x90 0x91 0x90..0xFF #Lo [78] SHAVIAN LETTER PEEP..OSMANYA LE... | 0xF0 0x90 0x92 0x00..0x9D # | 0xF0 0x90 0x92 0xA0..0xA9 #Nd [10] OSMANYA DIGIT ZERO..OSMANYA DIG... | 0xF0 0x90 0x92 0xB0..0xFF #L& [36] OSAGE CAPITAL LETTER A..OSAGE C... | 0xF0 0x90 0x93 0x00..0x93 # | 0xF0 0x90 0x93 0x98..0xBB #L& [36] OSAGE SMALL LETTER A..OSAGE SMA... | 0xF0 0x90 0x94 0x80..0xA7 #Lo [40] ELBASAN LETTER A..ELBASAN LETTE... | 0xF0 0x90 0x94 0xB0..0xFF #Lo [52] CAUCASIAN ALBANIAN LETTER ALT..... | 0xF0 0x90 0x95 0x00..0xA3 # | 0xF0 0x90 0x98 0x80..0xFF #Lo [311] LINEAR A SIGN AB001..LINE... | 0xF0 0x90 0x99..0x9B 0x00..0xFF # | 0xF0 0x90 0x9C 0x00..0xB6 # | 0xF0 0x90 0x9D 0x80..0x95 #Lo [22] LINEAR A SIGN A701 A..LINEAR A ... | 0xF0 0x90 0x9D 0xA0..0xA7 #Lo [8] LINEAR A SIGN A800..LINEAR A SI... | 0xF0 0x90 0xA0 0x80..0x85 #Lo [6] CYPRIOT SYLLABLE A..CYPRIOT SYL... | 0xF0 0x90 0xA0 0x88 #Lo CYPRIOT SYLLABLE JO | 0xF0 0x90 0xA0 0x8A..0xB5 #Lo [44] CYPRIOT SYLLABLE KA..CYPRIOT SY... | 0xF0 0x90 0xA0 0xB7..0xB8 #Lo [2] CYPRIOT SYLLABLE XA..CYPRIOT SY... | 0xF0 0x90 0xA0 0xBC #Lo CYPRIOT SYLLABLE ZA | 0xF0 0x90 0xA0 0xBF..0xFF #Lo [23] CYPRIOT SYLLABLE ZO..IMPERIAL A... | 0xF0 0x90 0xA1 0x00..0x95 # | 0xF0 0x90 0xA1 0xA0..0xB6 #Lo [23] PALMYRENE LETTER ALEPH..PALMYRE... | 0xF0 0x90 0xA2 0x80..0x9E #Lo [31] NABATAEAN LETTER FINAL ALEPH..N... | 0xF0 0x90 0xA3 0xA0..0xB2 #Lo [19] HATRAN LETTER ALEPH..HATRAN LET... | 0xF0 0x90 0xA3 0xB4..0xB5 #Lo [2] HATRAN LETTER SHIN..HATRAN LETT... | 0xF0 0x90 0xA4 0x80..0x95 #Lo [22] PHOENICIAN LETTER ALF..PHOENICI... | 0xF0 0x90 0xA4 0xA0..0xB9 #Lo [26] LYDIAN LETTER A..LYDIAN LETTER C | 0xF0 0x90 0xA6 0x80..0xB7 #Lo [56] MEROITIC HIEROGLYPHIC LETTER A.... | 0xF0 0x90 0xA6 0xBE..0xBF #Lo [2] MEROITIC CURSIVE LOGOGRAM RMT..... | 0xF0 0x90 0xA8 0x80 #Lo KHAROSHTHI LETTER A | 0xF0 0x90 0xA8 0x81..0x83 #Mn [3] KHAROSHTHI VOWEL SIGN I..KHAROS... | 0xF0 0x90 0xA8 0x85..0x86 #Mn [2] KHAROSHTHI VOWEL SIGN E..KHAROS... | 0xF0 0x90 0xA8 0x8C..0x8F #Mn [4] KHAROSHTHI VOWEL LENGTH MARK..K... | 0xF0 0x90 0xA8 0x90..0x93 #Lo [4] KHAROSHTHI LETTER KA..KHAROSHTH... | 0xF0 0x90 0xA8 0x95..0x97 #Lo [3] KHAROSHTHI LETTER CA..KHAROSHTH... | 0xF0 0x90 0xA8 0x99..0xB3 #Lo [27] KHAROSHTHI LETTER NYA..KHAROSHT... | 0xF0 0x90 0xA8 0xB8..0xBA #Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAR... | 0xF0 0x90 0xA8 0xBF #Mn KHAROSHTHI VIRAMA | 0xF0 0x90 0xA9 0xA0..0xBC #Lo [29] OLD SOUTH ARABIAN LETTER HE..OL... | 0xF0 0x90 0xAA 0x80..0x9C #Lo [29] OLD NORTH ARABIAN LETTER HEH..O... | 0xF0 0x90 0xAB 0x80..0x87 #Lo [8] MANICHAEAN LETTER ALEPH..MANICH... | 0xF0 0x90 0xAB 0x89..0xA4 #Lo [28] MANICHAEAN LETTER ZAYIN..MANICH... | 0xF0 0x90 0xAB 0xA5..0xA6 #Mn [2] MANICHAEAN ABBREVIATION MARK AB... | 0xF0 0x90 0xAC 0x80..0xB5 #Lo [54] AVESTAN LETTER A..AVESTAN LETTE... | 0xF0 0x90 0xAD 0x80..0x95 #Lo [22] INSCRIPTIONAL PARTHIAN LETTER A... | 0xF0 0x90 0xAD 0xA0..0xB2 #Lo [19] INSCRIPTIONAL PAHLAVI LETTER AL... | 0xF0 0x90 0xAE 0x80..0x91 #Lo [18] PSALTER PAHLAVI LETTER ALEPH..P... | 0xF0 0x90 0xB0 0x80..0xFF #Lo [73] OLD TURKIC LETTER ORKHON A..OLD... | 0xF0 0x90 0xB1 0x00..0x88 # | 0xF0 0x90 0xB2 0x80..0xB2 #L& [51] OLD HUNGARIAN CAPITAL LETTER A.... | 0xF0 0x90 0xB3 0x80..0xB2 #L& [51] OLD HUNGARIAN SMALL LETTER A..O... | 0xF0 0x91 0x80 0x80 #Mc BRAHMI SIGN CANDRABINDU | 0xF0 0x91 0x80 0x81 #Mn BRAHMI SIGN ANUSVARA | 0xF0 0x91 0x80 0x82 #Mc BRAHMI SIGN VISARGA | 0xF0 0x91 0x80 0x83..0xB7 #Lo [53] BRAHMI SIGN JIHVAMULIYA..BRAHMI... | 0xF0 0x91 0x80 0xB8..0xFF #Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VI... | 0xF0 0x91 0x81 0x00..0x86 # | 0xF0 0x91 0x81 0xA6..0xAF #Nd [10] BRAHMI DIGIT ZERO..BRAHMI DIGIT... | 0xF0 0x91 0x81 0xBF..0xFF #Mn [3] BRAHMI NUMBER JOINER..KAITHI SI... | 0xF0 0x91 0x82 0x00..0x81 # | 0xF0 0x91 0x82 0x82 #Mc KAITHI SIGN VISARGA | 0xF0 0x91 0x82 0x83..0xAF #Lo [45] KAITHI LETTER A..KAITHI LETTER HA | 0xF0 0x91 0x82 0xB0..0xB2 #Mc [3] KAITHI VOWEL SIGN AA..KAITHI VO... | 0xF0 0x91 0x82 0xB3..0xB6 #Mn [4] KAITHI VOWEL SIGN U..KAITHI VOW... | 0xF0 0x91 0x82 0xB7..0xB8 #Mc [2] KAITHI VOWEL SIGN O..KAITHI VOW... | 0xF0 0x91 0x82 0xB9..0xBA #Mn [2] KAITHI SIGN VIRAMA..KAITHI SIGN... | 0xF0 0x91 0x83 0x90..0xA8 #Lo [25] SORA SOMPENG LETTER SAH..SORA S... | 0xF0 0x91 0x83 0xB0..0xB9 #Nd [10] SORA SOMPENG DIGIT ZERO..SORA S... | 0xF0 0x91 0x84 0x80..0x82 #Mn [3] CHAKMA SIGN CANDRABINDU..CHAKMA... | 0xF0 0x91 0x84 0x83..0xA6 #Lo [36] CHAKMA LETTER AA..CHAKMA LETTER... | 0xF0 0x91 0x84 0xA7..0xAB #Mn [5] CHAKMA VOWEL SIGN A..CHAKMA VOW... | 0xF0 0x91 0x84 0xAC #Mc CHAKMA VOWEL SIGN E | 0xF0 0x91 0x84 0xAD..0xB4 #Mn [8] CHAKMA VOWEL SIGN AI..CHAKMA MA... | 0xF0 0x91 0x84 0xB6..0xBF #Nd [10] CHAKMA DIGIT ZERO..CHAKMA DIGIT... | 0xF0 0x91 0x85 0x90..0xB2 #Lo [35] MAHAJANI LETTER A..MAHAJANI LET... | 0xF0 0x91 0x85 0xB3 #Mn MAHAJANI SIGN NUKTA | 0xF0 0x91 0x85 0xB6 #Lo MAHAJANI LIGATURE SHRI | 0xF0 0x91 0x86 0x80..0x81 #Mn [2] SHARADA SIGN CANDRABINDU..SHARA... | 0xF0 0x91 0x86 0x82 #Mc SHARADA SIGN VISARGA | 0xF0 0x91 0x86 0x83..0xB2 #Lo [48] SHARADA LETTER A..SHARADA LETTE... | 0xF0 0x91 0x86 0xB3..0xB5 #Mc [3] SHARADA VOWEL SIGN AA..SHARADA ... | 0xF0 0x91 0x86 0xB6..0xBE #Mn [9] SHARADA VOWEL SIGN U..SHARADA V... | 0xF0 0x91 0x86 0xBF..0xFF #Mc [2] SHARADA VOWEL SIGN AU..SHARADA ... | 0xF0 0x91 0x87 0x00..0x80 # | 0xF0 0x91 0x87 0x81..0x84 #Lo [4] SHARADA SIGN AVAGRAHA..SHARADA OM | 0xF0 0x91 0x87 0x8A..0x8C #Mn [3] SHARADA SIGN NUKTA..SHARADA EXT... | 0xF0 0x91 0x87 0x90..0x99 #Nd [10] SHARADA DIGIT ZERO..SHARADA DIG... | 0xF0 0x91 0x87 0x9A #Lo SHARADA EKAM | 0xF0 0x91 0x87 0x9C #Lo SHARADA HEADSTROKE | 0xF0 0x91 0x88 0x80..0x91 #Lo [18] KHOJKI LETTER A..KHOJKI LETTER JJA | 0xF0 0x91 0x88 0x93..0xAB #Lo [25] KHOJKI LETTER NYA..KHOJKI LETTE... | 0xF0 0x91 0x88 0xAC..0xAE #Mc [3] KHOJKI VOWEL SIGN AA..KHOJKI VO... | 0xF0 0x91 0x88 0xAF..0xB1 #Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOW... | 0xF0 0x91 0x88 0xB2..0xB3 #Mc [2] KHOJKI VOWEL SIGN O..KHOJKI VOW... | 0xF0 0x91 0x88 0xB4 #Mn KHOJKI SIGN ANUSVARA | 0xF0 0x91 0x88 0xB5 #Mc KHOJKI SIGN VIRAMA | 0xF0 0x91 0x88 0xB6..0xB7 #Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN ... | 0xF0 0x91 0x88 0xBE #Mn KHOJKI SIGN SUKUN | 0xF0 0x91 0x8A 0x80..0x86 #Lo [7] MULTANI LETTER A..MULTANI LETTE... | 0xF0 0x91 0x8A 0x88 #Lo MULTANI LETTER GHA | 0xF0 0x91 0x8A 0x8A..0x8D #Lo [4] MULTANI LETTER CA..MULTANI LETT... | 0xF0 0x91 0x8A 0x8F..0x9D #Lo [15] MULTANI LETTER NYA..MULTANI LET... | 0xF0 0x91 0x8A 0x9F..0xA8 #Lo [10] MULTANI LETTER BHA..MULTANI LET... | 0xF0 0x91 0x8A 0xB0..0xFF #Lo [47] KHUDAWADI LETTER A..KHUDAWADI L... | 0xF0 0x91 0x8B 0x00..0x9E # | 0xF0 0x91 0x8B 0x9F #Mn KHUDAWADI SIGN ANUSVARA | 0xF0 0x91 0x8B 0xA0..0xA2 #Mc [3] KHUDAWADI VOWEL SIGN AA..KHUDAW... | 0xF0 0x91 0x8B 0xA3..0xAA #Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWA... | 0xF0 0x91 0x8B 0xB0..0xB9 #Nd [10] KHUDAWADI DIGIT ZERO..KHUDAWADI... | 0xF0 0x91 0x8C 0x80..0x81 #Mn [2] GRANTHA SIGN COMBINING ANUSVARA... | 0xF0 0x91 0x8C 0x82..0x83 #Mc [2] GRANTHA SIGN ANUSVARA..GRANTHA ... | 0xF0 0x91 0x8C 0x85..0x8C #Lo [8] GRANTHA LETTER A..GRANTHA LETTE... | 0xF0 0x91 0x8C 0x8F..0x90 #Lo [2] GRANTHA LETTER EE..GRANTHA LETT... | 0xF0 0x91 0x8C 0x93..0xA8 #Lo [22] GRANTHA LETTER OO..GRANTHA LETT... | 0xF0 0x91 0x8C 0xAA..0xB0 #Lo [7] GRANTHA LETTER PA..GRANTHA LETT... | 0xF0 0x91 0x8C 0xB2..0xB3 #Lo [2] GRANTHA LETTER LA..GRANTHA LETT... | 0xF0 0x91 0x8C 0xB5..0xB9 #Lo [5] GRANTHA LETTER VA..GRANTHA LETT... | 0xF0 0x91 0x8C 0xBC #Mn GRANTHA SIGN NUKTA | 0xF0 0x91 0x8C 0xBD #Lo GRANTHA SIGN AVAGRAHA | 0xF0 0x91 0x8C 0xBE..0xBF #Mc [2] GRANTHA VOWEL SIGN AA..GRANTHA ... | 0xF0 0x91 0x8D 0x80 #Mn GRANTHA VOWEL SIGN II | 0xF0 0x91 0x8D 0x81..0x84 #Mc [4] GRANTHA VOWEL SIGN U..GRANTHA V... | 0xF0 0x91 0x8D 0x87..0x88 #Mc [2] GRANTHA VOWEL SIGN EE..GRANTHA ... | 0xF0 0x91 0x8D 0x8B..0x8D #Mc [3] GRANTHA VOWEL SIGN OO..GRANTHA ... | 0xF0 0x91 0x8D 0x90 #Lo GRANTHA OM | 0xF0 0x91 0x8D 0x97 #Mc GRANTHA AU LENGTH MARK | 0xF0 0x91 0x8D 0x9D..0xA1 #Lo [5] GRANTHA SIGN PLUTA..GRANTHA LET... | 0xF0 0x91 0x8D 0xA2..0xA3 #Mc [2] GRANTHA VOWEL SIGN VOCALIC L..G... | 0xF0 0x91 0x8D 0xA6..0xAC #Mn [7] COMBINING GRANTHA DIGIT ZERO..C... | 0xF0 0x91 0x8D 0xB0..0xB4 #Mn [5] COMBINING GRANTHA LETTER A..COM... | 0xF0 0x91 0x90 0x80..0xB4 #Lo [53] NEWA LETTER A..NEWA LETTER HA | 0xF0 0x91 0x90 0xB5..0xB7 #Mc [3] NEWA VOWEL SIGN AA..NEWA VOWEL ... | 0xF0 0x91 0x90 0xB8..0xBF #Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL S... | 0xF0 0x91 0x91 0x80..0x81 #Mc [2] NEWA VOWEL SIGN O..NEWA VOWEL S... | 0xF0 0x91 0x91 0x82..0x84 #Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANU... | 0xF0 0x91 0x91 0x85 #Mc NEWA SIGN VISARGA | 0xF0 0x91 0x91 0x86 #Mn NEWA SIGN NUKTA | 0xF0 0x91 0x91 0x87..0x8A #Lo [4] NEWA SIGN AVAGRAHA..NEWA SIDDHI | 0xF0 0x91 0x91 0x90..0x99 #Nd [10] NEWA DIGIT ZERO..NEWA DIGIT NINE | 0xF0 0x91 0x92 0x80..0xAF #Lo [48] TIRHUTA ANJI..TIRHUTA LETTER HA | 0xF0 0x91 0x92 0xB0..0xB2 #Mc [3] TIRHUTA VOWEL SIGN AA..TIRHUTA ... | 0xF0 0x91 0x92 0xB3..0xB8 #Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA V... | 0xF0 0x91 0x92 0xB9 #Mc TIRHUTA VOWEL SIGN E | 0xF0 0x91 0x92 0xBA #Mn TIRHUTA VOWEL SIGN SHORT E | 0xF0 0x91 0x92 0xBB..0xBE #Mc [4] TIRHUTA VOWEL SIGN AI..TIRHUTA ... | 0xF0 0x91 0x92 0xBF..0xFF #Mn [2] TIRHUTA SIGN CANDRABINDU..TIRHU... | 0xF0 0x91 0x93 0x00..0x80 # | 0xF0 0x91 0x93 0x81 #Mc TIRHUTA SIGN VISARGA | 0xF0 0x91 0x93 0x82..0x83 #Mn [2] TIRHUTA SIGN VIRAMA..TIRHUTA SI... | 0xF0 0x91 0x93 0x84..0x85 #Lo [2] TIRHUTA SIGN AVAGRAHA..TIRHUTA ... | 0xF0 0x91 0x93 0x87 #Lo TIRHUTA OM | 0xF0 0x91 0x93 0x90..0x99 #Nd [10] TIRHUTA DIGIT ZERO..TIRHUTA DIG... | 0xF0 0x91 0x96 0x80..0xAE #Lo [47] SIDDHAM LETTER A..SIDDHAM LETTE... | 0xF0 0x91 0x96 0xAF..0xB1 #Mc [3] SIDDHAM VOWEL SIGN AA..SIDDHAM ... | 0xF0 0x91 0x96 0xB2..0xB5 #Mn [4] SIDDHAM VOWEL SIGN U..SIDDHAM V... | 0xF0 0x91 0x96 0xB8..0xBB #Mc [4] SIDDHAM VOWEL SIGN E..SIDDHAM V... | 0xF0 0x91 0x96 0xBC..0xBD #Mn [2] SIDDHAM SIGN CANDRABINDU..SIDDH... | 0xF0 0x91 0x96 0xBE #Mc SIDDHAM SIGN VISARGA | 0xF0 0x91 0x96 0xBF..0xFF #Mn [2] SIDDHAM SIGN VIRAMA..SIDDHAM SI... | 0xF0 0x91 0x97 0x00..0x80 # | 0xF0 0x91 0x97 0x98..0x9B #Lo [4] SIDDHAM LETTER THREE-CIRCLE ALT... | 0xF0 0x91 0x97 0x9C..0x9D #Mn [2] SIDDHAM VOWEL SIGN ALTERNATE U.... | 0xF0 0x91 0x98 0x80..0xAF #Lo [48] MODI LETTER A..MODI LETTER LLA | 0xF0 0x91 0x98 0xB0..0xB2 #Mc [3] MODI VOWEL SIGN AA..MODI VOWEL ... | 0xF0 0x91 0x98 0xB3..0xBA #Mn [8] MODI VOWEL SIGN U..MODI VOWEL S... | 0xF0 0x91 0x98 0xBB..0xBC #Mc [2] MODI VOWEL SIGN O..MODI VOWEL S... | 0xF0 0x91 0x98 0xBD #Mn MODI SIGN ANUSVARA | 0xF0 0x91 0x98 0xBE #Mc MODI SIGN VISARGA | 0xF0 0x91 0x98 0xBF..0xFF #Mn [2] MODI SIGN VIRAMA..MODI SIGN ARD... | 0xF0 0x91 0x99 0x00..0x80 # | 0xF0 0x91 0x99 0x84 #Lo MODI SIGN HUVA | 0xF0 0x91 0x99 0x90..0x99 #Nd [10] MODI DIGIT ZERO..MODI DIGIT NINE | 0xF0 0x91 0x9A 0x80..0xAA #Lo [43] TAKRI LETTER A..TAKRI LETTER RRA | 0xF0 0x91 0x9A 0xAB #Mn TAKRI SIGN ANUSVARA | 0xF0 0x91 0x9A 0xAC #Mc TAKRI SIGN VISARGA | 0xF0 0x91 0x9A 0xAD #Mn TAKRI VOWEL SIGN AA | 0xF0 0x91 0x9A 0xAE..0xAF #Mc [2] TAKRI VOWEL SIGN I..TAKRI VOWEL... | 0xF0 0x91 0x9A 0xB0..0xB5 #Mn [6] TAKRI VOWEL SIGN U..TAKRI VOWEL... | 0xF0 0x91 0x9A 0xB6 #Mc TAKRI SIGN VIRAMA | 0xF0 0x91 0x9A 0xB7 #Mn TAKRI SIGN NUKTA | 0xF0 0x91 0x9B 0x80..0x89 #Nd [10] TAKRI DIGIT ZERO..TAKRI DIGIT NINE | 0xF0 0x91 0x9C 0x80..0x99 #Lo [26] AHOM LETTER KA..AHOM LETTER JHA | 0xF0 0x91 0x9C 0x9D..0x9F #Mn [3] AHOM CONSONANT SIGN MEDIAL LA..... | 0xF0 0x91 0x9C 0xA0..0xA1 #Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL S... | 0xF0 0x91 0x9C 0xA2..0xA5 #Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL S... | 0xF0 0x91 0x9C 0xA6 #Mc AHOM VOWEL SIGN E | 0xF0 0x91 0x9C 0xA7..0xAB #Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN K... | 0xF0 0x91 0x9C 0xB0..0xB9 #Nd [10] AHOM DIGIT ZERO..AHOM DIGIT NINE | 0xF0 0x91 0xA2 0xA0..0xFF #L& [64] WARANG CITI CAPITAL LETTER NGAA... | 0xF0 0x91 0xA3 0x00..0x9F # | 0xF0 0x91 0xA3 0xA0..0xA9 #Nd [10] WARANG CITI DIGIT ZERO..WARANG ... | 0xF0 0x91 0xA3 0xBF #Lo WARANG CITI OM | 0xF0 0x91 0xAB 0x80..0xB8 #Lo [57] PAU CIN HAU LETTER PA..PAU CIN ... | 0xF0 0x91 0xB0 0x80..0x88 #Lo [9] BHAIKSUKI LETTER A..BHAIKSUKI L... | 0xF0 0x91 0xB0 0x8A..0xAE #Lo [37] BHAIKSUKI LETTER E..BHAIKSUKI L... | 0xF0 0x91 0xB0 0xAF #Mc BHAIKSUKI VOWEL SIGN AA | 0xF0 0x91 0xB0 0xB0..0xB6 #Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSU... | 0xF0 0x91 0xB0 0xB8..0xBD #Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSU... | 0xF0 0x91 0xB0 0xBE #Mc BHAIKSUKI SIGN VISARGA | 0xF0 0x91 0xB0 0xBF #Mn BHAIKSUKI SIGN VIRAMA | 0xF0 0x91 0xB1 0x80 #Lo BHAIKSUKI SIGN AVAGRAHA | 0xF0 0x91 0xB1 0x90..0x99 #Nd [10] BHAIKSUKI DIGIT ZERO..BHAIKSUKI... | 0xF0 0x91 0xB1 0xB2..0xFF #Lo [30] MARCHEN LETTER KA..MARCHEN LETT... | 0xF0 0x91 0xB2 0x00..0x8F # | 0xF0 0x91 0xB2 0x92..0xA7 #Mn [22] MARCHEN SUBJOINED LETTER KA..MA... | 0xF0 0x91 0xB2 0xA9 #Mc MARCHEN SUBJOINED LETTER YA | 0xF0 0x91 0xB2 0xAA..0xB0 #Mn [7] MARCHEN SUBJOINED LETTER RA..MA... | 0xF0 0x91 0xB2 0xB1 #Mc MARCHEN VOWEL SIGN I | 0xF0 0x91 0xB2 0xB2..0xB3 #Mn [2] MARCHEN VOWEL SIGN U..MARCHEN V... | 0xF0 0x91 0xB2 0xB4 #Mc MARCHEN VOWEL SIGN O | 0xF0 0x91 0xB2 0xB5..0xB6 #Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN ... | 0xF0 0x92 0x80 0x80..0xFF #Lo [922] CUNEIFORM SIGN A..CUNEIFO... | 0xF0 0x92 0x81..0x8D 0x00..0xFF # | 0xF0 0x92 0x8E 0x00..0x99 # | 0xF0 0x92 0x90 0x80..0xFF #Nl [111] CUNEIFORM NUMERIC SIGN TWO ASH.... | 0xF0 0x92 0x91 0x00..0xAE # | 0xF0 0x92 0x92 0x80..0xFF #Lo [196] CUNEIFORM SIGN AB TIMES N... | 0xF0 0x92 0x93..0x94 0x00..0xFF # | 0xF0 0x92 0x95 0x00..0x83 # | 0xF0 0x93 0x80 0x80..0xFF #Lo [1071] EGYPTIAN HIEROGLYPH A001... | 0xF0 0x93 0x81..0x8F 0x00..0xFF # | 0xF0 0x93 0x90 0x00..0xAE # | 0xF0 0x94 0x90 0x80..0xFF #Lo [583] ANATOLIAN HIEROGLYPH A001... | 0xF0 0x94 0x91..0x98 0x00..0xFF # | 0xF0 0x94 0x99 0x00..0x86 # | 0xF0 0x96 0xA0 0x80..0xFF #Lo [569] BAMUM LETTER PHASE-A NGKU... | 0xF0 0x96 0xA1..0xA7 0x00..0xFF # | 0xF0 0x96 0xA8 0x00..0xB8 # | 0xF0 0x96 0xA9 0x80..0x9E #Lo [31] MRO LETTER TA..MRO LETTER TEK | 0xF0 0x96 0xA9 0xA0..0xA9 #Nd [10] MRO DIGIT ZERO..MRO DIGIT NINE | 0xF0 0x96 0xAB 0x90..0xAD #Lo [30] BASSA VAH LETTER ENNI..BASSA VA... | 0xF0 0x96 0xAB 0xB0..0xB4 #Mn [5] BASSA VAH COMBINING HIGH TONE..... | 0xF0 0x96 0xAC 0x80..0xAF #Lo [48] PAHAWH HMONG VOWEL KEEB..PAHAWH... | 0xF0 0x96 0xAC 0xB0..0xB6 #Mn [7] PAHAWH HMONG MARK CIM TUB..PAHA... | 0xF0 0x96 0xAD 0x80..0x83 #Lm [4] PAHAWH HMONG SIGN VOS SEEV..PAH... | 0xF0 0x96 0xAD 0x90..0x99 #Nd [10] PAHAWH HMONG DIGIT ZERO..PAHAWH... | 0xF0 0x96 0xAD 0xA3..0xB7 #Lo [21] PAHAWH HMONG SIGN VOS LUB..PAHA... | 0xF0 0x96 0xAD 0xBD..0xFF #Lo [19] PAHAWH HMONG CLAN SIGN TSHEEJ..... | 0xF0 0x96 0xAE 0x00..0x8F # | 0xF0 0x96 0xBC 0x80..0xFF #Lo [69] MIAO LETTER PA..MIAO LETTER HHA | 0xF0 0x96 0xBD 0x00..0x84 # | 0xF0 0x96 0xBD 0x90 #Lo MIAO LETTER NASALIZATION | 0xF0 0x96 0xBD 0x91..0xBE #Mc [46] MIAO SIGN ASPIRATION..MIAO VOWE... | 0xF0 0x96 0xBE 0x8F..0x92 #Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW | 0xF0 0x96 0xBE 0x93..0x9F #Lm [13] MIAO LETTER TONE-2..MIAO LETTER... | 0xF0 0x96 0xBF 0xA0 #Lm TANGUT ITERATION MARK | 0xF0 0x97 0x80 0x80..0xFF #Lo [6125] TANGUT IDEOGRAPH-17000..... | 0xF0 0x97 0x81..0xFF 0x00..0xFF # | 0xF0 0x98 0x00 0x00..0xFF # | 0xF0 0x98 0x01..0x9E 0x00..0xFF # | 0xF0 0x98 0x9F 0x00..0xAC # | 0xF0 0x98 0xA0 0x80..0xFF #Lo [755] TANGUT COMPONENT-001..TAN... | 0xF0 0x98 0xA1..0xAA 0x00..0xFF # | 0xF0 0x98 0xAB 0x00..0xB2 # | 0xF0 0x9B 0x80 0x80..0x81 #Lo [2] KATAKANA LETTER ARCHAIC E..HIRA... | 0xF0 0x9B 0xB0 0x80..0xFF #Lo [107] DUPLOYAN LETTER H..DUPLOYAN LET... | 0xF0 0x9B 0xB1 0x00..0xAA # | 0xF0 0x9B 0xB1 0xB0..0xBC #Lo [13] DUPLOYAN AFFIX LEFT HORIZONTAL ... | 0xF0 0x9B 0xB2 0x80..0x88 #Lo [9] DUPLOYAN AFFIX HIGH ACUTE..DUPL... | 0xF0 0x9B 0xB2 0x90..0x99 #Lo [10] DUPLOYAN AFFIX LOW ACUTE..DUPLO... | 0xF0 0x9B 0xB2 0x9D..0x9E #Mn [2] DUPLOYAN THICK LETTER SELECTOR.... | 0xF0 0x9D 0x85 0xA5..0xA6 #Mc [2] MUSICAL SYMBOL COMBINING STEM..... | 0xF0 0x9D 0x85 0xA7..0xA9 #Mn [3] MUSICAL SYMBOL COMBINING TREMOL... | 0xF0 0x9D 0x85 0xAD..0xB2 #Mc [6] MUSICAL SYMBOL COMBINING AUGMEN... | 0xF0 0x9D 0x85 0xBB..0xFF #Mn [8] MUSICAL SYMBOL COMBINING ACCENT... | 0xF0 0x9D 0x86 0x00..0x82 # | 0xF0 0x9D 0x86 0x85..0x8B #Mn [7] MUSICAL SYMBOL COMBINING DOIT..... | 0xF0 0x9D 0x86 0xAA..0xAD #Mn [4] MUSICAL SYMBOL COMBINING DOWN B... | 0xF0 0x9D 0x89 0x82..0x84 #Mn [3] COMBINING GREEK MUSICAL TRISEME... | 0xF0 0x9D 0x90 0x80..0xFF #L& [85] MATHEMATICAL BOLD CAPITAL A..MA... | 0xF0 0x9D 0x91 0x00..0x94 # | 0xF0 0x9D 0x91 0x96..0xFF #L& [71] MATHEMATICAL ITALIC SMALL I..MA... | 0xF0 0x9D 0x92 0x00..0x9C # | 0xF0 0x9D 0x92 0x9E..0x9F #L& [2] MATHEMATICAL SCRIPT CAPITAL C..... | 0xF0 0x9D 0x92 0xA2 #L& MATHEMATICAL SCRIPT CAPITAL G | 0xF0 0x9D 0x92 0xA5..0xA6 #L& [2] MATHEMATICAL SCRIPT CAPITAL J..... | 0xF0 0x9D 0x92 0xA9..0xAC #L& [4] MATHEMATICAL SCRIPT CAPITAL N..... | 0xF0 0x9D 0x92 0xAE..0xB9 #L& [12] MATHEMATICAL SCRIPT CAPITAL S..... | 0xF0 0x9D 0x92 0xBB #L& MATHEMATICAL SCRIPT SMALL F | 0xF0 0x9D 0x92 0xBD..0xFF #L& [7] MATHEMATICAL SCRIPT SMALL H..MA... | 0xF0 0x9D 0x93 0x00..0x83 # | 0xF0 0x9D 0x93 0x85..0xFF #L& [65] MATHEMATICAL SCRIPT SMALL P..MA... | 0xF0 0x9D 0x94 0x00..0x85 # | 0xF0 0x9D 0x94 0x87..0x8A #L& [4] MATHEMATICAL FRAKTUR CAPITAL D.... | 0xF0 0x9D 0x94 0x8D..0x94 #L& [8] MATHEMATICAL FRAKTUR CAPITAL J.... | 0xF0 0x9D 0x94 0x96..0x9C #L& [7] MATHEMATICAL FRAKTUR CAPITAL S.... | 0xF0 0x9D 0x94 0x9E..0xB9 #L& [28] MATHEMATICAL FRAKTUR SMALL A..M... | 0xF0 0x9D 0x94 0xBB..0xBE #L& [4] MATHEMATICAL DOUBLE-STRUCK CAPI... | 0xF0 0x9D 0x95 0x80..0x84 #L& [5] MATHEMATICAL DOUBLE-STRUCK CAPI... | 0xF0 0x9D 0x95 0x86 #L& MATHEMATICAL DOUBLE-STRUCK CAPITAL O | 0xF0 0x9D 0x95 0x8A..0x90 #L& [7] MATHEMATICAL DOUBLE-STRUCK CAPI... | 0xF0 0x9D 0x95 0x92..0xFF #L& [340] MATHEMATICAL DOUBLE-STRUC... | 0xF0 0x9D 0x96..0x99 0x00..0xFF # | 0xF0 0x9D 0x9A 0x00..0xA5 # | 0xF0 0x9D 0x9A 0xA8..0xFF #L& [25] MATHEMATICAL BOLD CAPITAL ALPHA... | 0xF0 0x9D 0x9B 0x00..0x80 # | 0xF0 0x9D 0x9B 0x82..0x9A #L& [25] MATHEMATICAL BOLD SMALL ALPHA..... | 0xF0 0x9D 0x9B 0x9C..0xBA #L& [31] MATHEMATICAL BOLD EPSILON SYMBO... | 0xF0 0x9D 0x9B 0xBC..0xFF #L& [25] MATHEMATICAL ITALIC SMALL ALPHA... | 0xF0 0x9D 0x9C 0x00..0x94 # | 0xF0 0x9D 0x9C 0x96..0xB4 #L& [31] MATHEMATICAL ITALIC EPSILON SYM... | 0xF0 0x9D 0x9C 0xB6..0xFF #L& [25] MATHEMATICAL BOLD ITALIC SMALL ... | 0xF0 0x9D 0x9D 0x00..0x8E # | 0xF0 0x9D 0x9D 0x90..0xAE #L& [31] MATHEMATICAL BOLD ITALIC EPSILO... | 0xF0 0x9D 0x9D 0xB0..0xFF #L& [25] MATHEMATICAL SANS-SERIF BOLD SM... | 0xF0 0x9D 0x9E 0x00..0x88 # | 0xF0 0x9D 0x9E 0x8A..0xA8 #L& [31] MATHEMATICAL SANS-SERIF BOLD EP... | 0xF0 0x9D 0x9E 0xAA..0xFF #L& [25] MATHEMATICAL SANS-SERIF BOLD IT... | 0xF0 0x9D 0x9F 0x00..0x82 # | 0xF0 0x9D 0x9F 0x84..0x8B #L& [8] MATHEMATICAL SANS-SERIF BOLD IT... | 0xF0 0x9D 0x9F 0x8E..0xBF #Nd [50] MATHEMATICAL BOLD DIGIT ZERO..M... | 0xF0 0x9D 0xA8 0x80..0xB6 #Mn [55] SIGNWRITING HEAD RIM..SIGNWRITI... | 0xF0 0x9D 0xA8 0xBB..0xFF #Mn [50] SIGNWRITING MOUTH CLOSED NEUTRA... | 0xF0 0x9D 0xA9 0x00..0xAC # | 0xF0 0x9D 0xA9 0xB5 #Mn SIGNWRITING UPPER BODY TILTING FRO... | 0xF0 0x9D 0xAA 0x84 #Mn SIGNWRITING LOCATION HEAD NECK | 0xF0 0x9D 0xAA 0x9B..0x9F #Mn [5] SIGNWRITING FILL MODIFIER-2..SI... | 0xF0 0x9D 0xAA 0xA1..0xAF #Mn [15] SIGNWRITING ROTATION MODIFIER-2... | 0xF0 0x9E 0x80 0x80..0x86 #Mn [7] COMBINING GLAGOLITIC LETTER AZU... | 0xF0 0x9E 0x80 0x88..0x98 #Mn [17] COMBINING GLAGOLITIC LETTER ZEM... | 0xF0 0x9E 0x80 0x9B..0xA1 #Mn [7] COMBINING GLAGOLITIC LETTER SHT... | 0xF0 0x9E 0x80 0xA3..0xA4 #Mn [2] COMBINING GLAGOLITIC LETTER YU.... | 0xF0 0x9E 0x80 0xA6..0xAA #Mn [5] COMBINING GLAGOLITIC LETTER YO.... | 0xF0 0x9E 0xA0 0x80..0xFF #Lo [197] MENDE KIKAKUI SYLLABLE M0... | 0xF0 0x9E 0xA1..0xA2 0x00..0xFF # | 0xF0 0x9E 0xA3 0x00..0x84 # | 0xF0 0x9E 0xA3 0x90..0x96 #Mn [7] MENDE KIKAKUI COMBINING NUMBER ... | 0xF0 0x9E 0xA4 0x80..0xFF #L& [68] ADLAM CAPITAL LETTER ALIF..ADLA... | 0xF0 0x9E 0xA5 0x00..0x83 # | 0xF0 0x9E 0xA5 0x84..0x8A #Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA | 0xF0 0x9E 0xA5 0x90..0x99 #Nd [10] ADLAM DIGIT ZERO..ADLAM DIGIT NINE | 0xF0 0x9E 0xB8 0x80..0x83 #Lo [4] ARABIC MATHEMATICAL ALEF..ARABI... | 0xF0 0x9E 0xB8 0x85..0x9F #Lo [27] ARABIC MATHEMATICAL WAW..ARABIC... | 0xF0 0x9E 0xB8 0xA1..0xA2 #Lo [2] ARABIC MATHEMATICAL INITIAL BEH... | 0xF0 0x9E 0xB8 0xA4 #Lo ARABIC MATHEMATICAL INITIAL HEH | 0xF0 0x9E 0xB8 0xA7 #Lo ARABIC MATHEMATICAL INITIAL HAH | 0xF0 0x9E 0xB8 0xA9..0xB2 #Lo [10] ARABIC MATHEMATICAL INITIAL YEH... | 0xF0 0x9E 0xB8 0xB4..0xB7 #Lo [4] ARABIC MATHEMATICAL INITIAL SHE... | 0xF0 0x9E 0xB8 0xB9 #Lo ARABIC MATHEMATICAL INITIAL DAD | 0xF0 0x9E 0xB8 0xBB #Lo ARABIC MATHEMATICAL INITIAL GHAIN | 0xF0 0x9E 0xB9 0x82 #Lo ARABIC MATHEMATICAL TAILED JEEM | 0xF0 0x9E 0xB9 0x87 #Lo ARABIC MATHEMATICAL TAILED HAH | 0xF0 0x9E 0xB9 0x89 #Lo ARABIC MATHEMATICAL TAILED YEH | 0xF0 0x9E 0xB9 0x8B #Lo ARABIC MATHEMATICAL TAILED LAM | 0xF0 0x9E 0xB9 0x8D..0x8F #Lo [3] ARABIC MATHEMATICAL TAILED NOON... | 0xF0 0x9E 0xB9 0x91..0x92 #Lo [2] ARABIC MATHEMATICAL TAILED SAD.... | 0xF0 0x9E 0xB9 0x94 #Lo ARABIC MATHEMATICAL TAILED SHEEN | 0xF0 0x9E 0xB9 0x97 #Lo ARABIC MATHEMATICAL TAILED KHAH | 0xF0 0x9E 0xB9 0x99 #Lo ARABIC MATHEMATICAL TAILED DAD | 0xF0 0x9E 0xB9 0x9B #Lo ARABIC MATHEMATICAL TAILED GHAIN | 0xF0 0x9E 0xB9 0x9D #Lo ARABIC MATHEMATICAL TAILED DOTLESS... | 0xF0 0x9E 0xB9 0x9F #Lo ARABIC MATHEMATICAL TAILED DOTLESS... | 0xF0 0x9E 0xB9 0xA1..0xA2 #Lo [2] ARABIC MATHEMATICAL STRETCHED B... | 0xF0 0x9E 0xB9 0xA4 #Lo ARABIC MATHEMATICAL STRETCHED HEH | 0xF0 0x9E 0xB9 0xA7..0xAA #Lo [4] ARABIC MATHEMATICAL STRETCHED H... | 0xF0 0x9E 0xB9 0xAC..0xB2 #Lo [7] ARABIC MATHEMATICAL STRETCHED M... | 0xF0 0x9E 0xB9 0xB4..0xB7 #Lo [4] ARABIC MATHEMATICAL STRETCHED S... | 0xF0 0x9E 0xB9 0xB9..0xBC #Lo [4] ARABIC MATHEMATICAL STRETCHED D... | 0xF0 0x9E 0xB9 0xBE #Lo ARABIC MATHEMATICAL STRETCHED DOTL... | 0xF0 0x9E 0xBA 0x80..0x89 #Lo [10] ARABIC MATHEMATICAL LOOPED ALEF... | 0xF0 0x9E 0xBA 0x8B..0x9B #Lo [17] ARABIC MATHEMATICAL LOOPED LAM.... | 0xF0 0x9E 0xBA 0xA1..0xA3 #Lo [3] ARABIC MATHEMATICAL DOUBLE-STRU... | 0xF0 0x9E 0xBA 0xA5..0xA9 #Lo [5] ARABIC MATHEMATICAL DOUBLE-STRU... | 0xF0 0x9E 0xBA 0xAB..0xBB #Lo [17] ARABIC MATHEMATICAL DOUBLE-STRU... | 0xF0 0xA0 0x80 0x80..0xFF #Lo [42711] CJK UNIFIED IDEOG... | 0xF0 0xA0 0x81..0xFF 0x00..0xFF # | 0xF0 0xA1..0xA9 0x00..0xFF 0x00..0xFF # | 0xF0 0xAA 0x00 0x00..0xFF # | 0xF0 0xAA 0x01..0x9A 0x00..0xFF # | 0xF0 0xAA 0x9B 0x00..0x96 # | 0xF0 0xAA 0x9C 0x80..0xFF #Lo [4149] CJK UNIFIED IDEOGRAPH-2A... | 0xF0 0xAA 0x9D..0xFF 0x00..0xFF # | 0xF0 0xAB 0x00 0x00..0xFF # | 0xF0 0xAB 0x01..0x9B 0x00..0xFF # | 0xF0 0xAB 0x9C 0x00..0xB4 # | 0xF0 0xAB 0x9D 0x80..0xFF #Lo [222] CJK UNIFIED IDEOGRAPH-2B7... | 0xF0 0xAB 0x9E..0x9F 0x00..0xFF # | 0xF0 0xAB 0xA0 0x00..0x9D # | 0xF0 0xAB 0xA0 0xA0..0xFF #Lo [5762] CJK UNIFIED IDEOGRAPH-2B... | 0xF0 0xAB 0xA1..0xFF 0x00..0xFF # | 0xF0 0xAC 0x00 0x00..0xFF # | 0xF0 0xAC 0x01..0xB9 0x00..0xFF # | 0xF0 0xAC 0xBA 0x00..0xA1 # | 0xF0 0xAF 0xA0 0x80..0xFF #Lo [542] CJK COMPATIBILITY IDEOGRA... | 0xF0 0xAF 0xA1..0xA7 0x00..0xFF # | 0xF0 0xAF 0xA8 0x00..0x9D # | 0xF3 0xA0 0x84 0x80..0xFF #Mn [240] VARIATION SELECTOR-17..VA... | 0xF3 0xA0 0x85..0x86 0x00..0xFF # | 0xF3 0xA0 0x87 0x00..0xAF # ; }%% ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/variables.go��������������������������0000664�0000000�0000000�00000004571�13771713062�0026417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" ) // Variables returns all of the variables referenced within a given experssion. // // This is the implementation of the "Variables" method on every native // expression. func Variables(expr Expression) []hcl.Traversal { var vars []hcl.Traversal walker := &variablesWalker{ Callback: func(t hcl.Traversal) { vars = append(vars, t) }, } Walk(expr, walker) return vars } // variablesWalker is a Walker implementation that calls its callback for any // root scope traversal found while walking. type variablesWalker struct { Callback func(hcl.Traversal) localScopes []map[string]struct{} } func (w *variablesWalker) Enter(n Node) hcl.Diagnostics { switch tn := n.(type) { case *ScopeTraversalExpr: t := tn.Traversal // Check if the given root name appears in any of the active // local scopes. We don't want to return local variables here, since // the goal of walking variables is to tell the calling application // which names it needs to populate in the _root_ scope. name := t.RootName() for _, names := range w.localScopes { if _, localized := names[name]; localized { return nil } } w.Callback(t) case ChildScope: w.localScopes = append(w.localScopes, tn.LocalNames) } return nil } func (w *variablesWalker) Exit(n Node) hcl.Diagnostics { switch n.(type) { case ChildScope: // pop the latest local scope, assuming that the walker will // behave symmetrically as promised. w.localScopes = w.localScopes[:len(w.localScopes)-1] } return nil } // ChildScope is a synthetic AST node that is visited during a walk to // indicate that its descendent will be evaluated in a child scope, which // may mask certain variables from the parent scope as locals. // // ChildScope nodes don't really exist in the AST, but are rather synthesized // on the fly during walk. Therefore it doesn't do any good to transform them; // instead, transform either parent node that created a scope or the expression // that the child scope struct wraps. type ChildScope struct { LocalNames map[string]struct{} Expr Expression } func (e ChildScope) walkChildNodes(w internalWalkFunc) { w(e.Expr) } // Range returns the range of the expression that the ChildScope is // encapsulating. It isn't really very useful to call Range on a ChildScope. func (e ChildScope) Range() hcl.Range { return e.Expr.Range() } ���������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclsyntax/walk.go�������������������������������0000664�0000000�0000000�00000002323�13771713062�0025376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclsyntax import ( "github.com/hashicorp/hcl/v2" ) // VisitFunc is the callback signature for VisitAll. type VisitFunc func(node Node) hcl.Diagnostics // VisitAll is a basic way to traverse the AST beginning with a particular // node. The given function will be called once for each AST node in // depth-first order, but no context is provided about the shape of the tree. // // The VisitFunc may return diagnostics, in which case they will be accumulated // and returned as a single set. func VisitAll(node Node, f VisitFunc) hcl.Diagnostics { diags := f(node) node.walkChildNodes(func(node Node) { diags = append(diags, VisitAll(node, f)...) }) return diags } // Walker is an interface used with Walk. type Walker interface { Enter(node Node) hcl.Diagnostics Exit(node Node) hcl.Diagnostics } // Walk is a more complex way to traverse the AST starting with a particular // node, which provides information about the tree structure via separate // Enter and Exit functions. func Walk(node Node, w Walker) hcl.Diagnostics { diags := w.Enter(node) node.walkChildNodes(func(node Node) { diags = append(diags, Walk(node, w)...) }) moreDiags := w.Exit(node) diags = append(diags, moreDiags...) return diags } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/���������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023715�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast.go���������������������������������0000664�0000000�0000000�00000004177�13771713062�0025044�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "bytes" "io" ) type File struct { inTree srcBytes []byte body *node } // NewEmptyFile constructs a new file with no content, ready to be mutated // by other calls that append to its body. func NewEmptyFile() *File { f := &File{ inTree: newInTree(), } body := newBody() f.body = f.children.Append(body) return f } // Body returns the root body of the file, which contains the top-level // attributes and blocks. func (f *File) Body() *Body { return f.body.content.(*Body) } // WriteTo writes the tokens underlying the receiving file to the given writer. // // The tokens first have a simple formatting pass applied that adjusts only // the spaces between them. func (f *File) WriteTo(wr io.Writer) (int64, error) { tokens := f.inTree.children.BuildTokens(nil) format(tokens) return tokens.WriteTo(wr) } // Bytes returns a buffer containing the source code resulting from the // tokens underlying the receiving file. If any updates have been made via // the AST API, these will be reflected in the result. func (f *File) Bytes() []byte { buf := &bytes.Buffer{} f.WriteTo(buf) return buf.Bytes() } type comments struct { leafNode parent *node tokens Tokens } func newComments(tokens Tokens) *comments { return &comments{ tokens: tokens, } } func (c *comments) BuildTokens(to Tokens) Tokens { return c.tokens.BuildTokens(to) } type identifier struct { leafNode parent *node token *Token } func newIdentifier(token *Token) *identifier { return &identifier{ token: token, } } func (i *identifier) BuildTokens(to Tokens) Tokens { return append(to, i.token) } func (i *identifier) hasName(name string) bool { return name == string(i.token.Bytes) } type number struct { leafNode parent *node token *Token } func newNumber(token *Token) *number { return &number{ token: token, } } func (n *number) BuildTokens(to Tokens) Tokens { return append(to, n.token) } type quoted struct { leafNode parent *node tokens Tokens } func newQuoted(tokens Tokens) *quoted { return &quoted{ tokens: tokens, } } func (q *quoted) BuildTokens(to Tokens) Tokens { return q.tokens.BuildTokens(to) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_attribute.go�����������������������0000664�0000000�0000000�00000001651�13771713062�0027121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "github.com/hashicorp/hcl/v2/hclsyntax" ) type Attribute struct { inTree leadComments *node name *node expr *node lineComments *node } func newAttribute() *Attribute { return &Attribute{ inTree: newInTree(), } } func (a *Attribute) init(name string, expr *Expression) { expr.assertUnattached() nameTok := newIdentToken(name) nameObj := newIdentifier(nameTok) a.leadComments = a.children.Append(newComments(nil)) a.name = a.children.Append(nameObj) a.children.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenEqual, Bytes: []byte{'='}, }, }) a.expr = a.children.Append(expr) a.expr.list = a.children a.lineComments = a.children.Append(newComments(nil)) a.children.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenNewline, Bytes: []byte{'\n'}, }, }) } func (a *Attribute) Expr() *Expression { return a.expr.content.(*Expression) } ���������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_block.go���������������������������0000664�0000000�0000000�00000006044�13771713062�0026211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) type Block struct { inTree leadComments *node typeName *node labels nodeSet open *node body *node close *node } func newBlock() *Block { return &Block{ inTree: newInTree(), labels: newNodeSet(), } } // NewBlock constructs a new, empty block with the given type name and labels. func NewBlock(typeName string, labels []string) *Block { block := newBlock() block.init(typeName, labels) return block } func (b *Block) init(typeName string, labels []string) { nameTok := newIdentToken(typeName) nameObj := newIdentifier(nameTok) b.leadComments = b.children.Append(newComments(nil)) b.typeName = b.children.Append(nameObj) for _, label := range labels { labelToks := TokensForValue(cty.StringVal(label)) labelObj := newQuoted(labelToks) labelNode := b.children.Append(labelObj) b.labels.Add(labelNode) } b.open = b.children.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenOBrace, Bytes: []byte{'{'}, }, { Type: hclsyntax.TokenNewline, Bytes: []byte{'\n'}, }, }) body := newBody() // initially totally empty; caller can append to it subsequently b.body = b.children.Append(body) b.close = b.children.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenCBrace, Bytes: []byte{'}'}, }, { Type: hclsyntax.TokenNewline, Bytes: []byte{'\n'}, }, }) } // Body returns the body that represents the content of the receiving block. // // Appending to or otherwise modifying this body will make changes to the // tokens that are generated between the blocks open and close braces. func (b *Block) Body() *Body { return b.body.content.(*Body) } // Type returns the type name of the block. func (b *Block) Type() string { typeNameObj := b.typeName.content.(*identifier) return string(typeNameObj.token.Bytes) } // Labels returns the labels of the block. func (b *Block) Labels() []string { labelNames := make([]string, 0, len(b.labels)) list := b.labels.List() for _, label := range list { switch labelObj := label.content.(type) { case *identifier: if labelObj.token.Type == hclsyntax.TokenIdent { labelString := string(labelObj.token.Bytes) labelNames = append(labelNames, labelString) } case *quoted: tokens := labelObj.tokens if len(tokens) == 3 && tokens[0].Type == hclsyntax.TokenOQuote && tokens[1].Type == hclsyntax.TokenQuotedLit && tokens[2].Type == hclsyntax.TokenCQuote { // Note that TokenQuotedLit may contain escape sequences. labelString, diags := hclsyntax.ParseStringLiteralToken(tokens[1].asHCLSyntax()) // If parsing the string literal returns error diagnostics // then we can just assume the label doesn't match, because it's invalid in some way. if !diags.HasErrors() { labelNames = append(labelNames, labelString) } } default: // If neither of the previous cases are true (should be impossible) // then we can just ignore it, because it's invalid too. } } return labelNames } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_body.go����������������������������0000664�0000000�0000000�00000014373�13771713062�0026060�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "reflect" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) type Body struct { inTree items nodeSet } func newBody() *Body { return &Body{ inTree: newInTree(), items: newNodeSet(), } } func (b *Body) appendItem(c nodeContent) *node { nn := b.children.Append(c) b.items.Add(nn) return nn } func (b *Body) appendItemNode(nn *node) *node { nn.assertUnattached() b.children.AppendNode(nn) b.items.Add(nn) return nn } // Clear removes all of the items from the body, making it empty. func (b *Body) Clear() { b.children.Clear() } func (b *Body) AppendUnstructuredTokens(ts Tokens) { b.inTree.children.Append(ts) } // Attributes returns a new map of all of the attributes in the body, with // the attribute names as the keys. func (b *Body) Attributes() map[string]*Attribute { ret := make(map[string]*Attribute) for n := range b.items { if attr, isAttr := n.content.(*Attribute); isAttr { nameObj := attr.name.content.(*identifier) name := string(nameObj.token.Bytes) ret[name] = attr } } return ret } // Blocks returns a new slice of all the blocks in the body. func (b *Body) Blocks() []*Block { ret := make([]*Block, 0, len(b.items)) for _, n := range b.items.List() { if block, isBlock := n.content.(*Block); isBlock { ret = append(ret, block) } } return ret } // GetAttribute returns the attribute from the body that has the given name, // or returns nil if there is currently no matching attribute. func (b *Body) GetAttribute(name string) *Attribute { for n := range b.items { if attr, isAttr := n.content.(*Attribute); isAttr { nameObj := attr.name.content.(*identifier) if nameObj.hasName(name) { // We've found it! return attr } } } return nil } // getAttributeNode is like GetAttribute but it returns the node containing // the selected attribute (if one is found) rather than the attribute itself. func (b *Body) getAttributeNode(name string) *node { for n := range b.items { if attr, isAttr := n.content.(*Attribute); isAttr { nameObj := attr.name.content.(*identifier) if nameObj.hasName(name) { // We've found it! return n } } } return nil } // FirstMatchingBlock returns a first matching block from the body that has the // given name and labels or returns nil if there is currently no matching // block. func (b *Body) FirstMatchingBlock(typeName string, labels []string) *Block { for _, block := range b.Blocks() { if typeName == block.Type() { labelNames := block.Labels() if len(labels) == 0 && len(labelNames) == 0 { return block } if reflect.DeepEqual(labels, labelNames) { return block } } } return nil } // RemoveBlock removes the given block from the body, if it's in that body. // If it isn't present, this is a no-op. // // Returns true if it removed something, or false otherwise. func (b *Body) RemoveBlock(block *Block) bool { for n := range b.items { if n.content == block { n.Detach() b.items.Remove(n) return true } } return false } // SetAttributeRaw either replaces the expression of an existing attribute // of the given name or adds a new attribute definition to the end of the block, // using the given tokens verbatim as the expression. // // The same caveats apply to this function as for NewExpressionRaw on which // it is based. If possible, prefer to use SetAttributeValue or // SetAttributeTraversal. func (b *Body) SetAttributeRaw(name string, tokens Tokens) *Attribute { attr := b.GetAttribute(name) expr := NewExpressionRaw(tokens) if attr != nil { attr.expr = attr.expr.ReplaceWith(expr) } else { attr := newAttribute() attr.init(name, expr) b.appendItem(attr) } return attr } // SetAttributeValue either replaces the expression of an existing attribute // of the given name or adds a new attribute definition to the end of the block. // // The value is given as a cty.Value, and must therefore be a literal. To set // a variable reference or other traversal, use SetAttributeTraversal. // // The return value is the attribute that was either modified in-place or // created. func (b *Body) SetAttributeValue(name string, val cty.Value) *Attribute { attr := b.GetAttribute(name) expr := NewExpressionLiteral(val) if attr != nil { attr.expr = attr.expr.ReplaceWith(expr) } else { attr := newAttribute() attr.init(name, expr) b.appendItem(attr) } return attr } // SetAttributeTraversal either replaces the expression of an existing attribute // of the given name or adds a new attribute definition to the end of the body. // // The new expression is given as a hcl.Traversal, which must be an absolute // traversal. To set a literal value, use SetAttributeValue. // // The return value is the attribute that was either modified in-place or // created. func (b *Body) SetAttributeTraversal(name string, traversal hcl.Traversal) *Attribute { attr := b.GetAttribute(name) expr := NewExpressionAbsTraversal(traversal) if attr != nil { attr.expr = attr.expr.ReplaceWith(expr) } else { attr := newAttribute() attr.init(name, expr) b.appendItem(attr) } return attr } // RemoveAttribute removes the attribute with the given name from the body. // // The return value is the attribute that was removed, or nil if there was // no such attribute (in which case the call was a no-op). func (b *Body) RemoveAttribute(name string) *Attribute { node := b.getAttributeNode(name) if node == nil { return nil } node.Detach() b.items.Remove(node) return node.content.(*Attribute) } // AppendBlock appends an existing block (which must not be already attached // to a body) to the end of the receiving body. func (b *Body) AppendBlock(block *Block) *Block { b.appendItem(block) return block } // AppendNewBlock appends a new nested block to the end of the receiving body // with the given type name and labels. func (b *Body) AppendNewBlock(typeName string, labels []string) *Block { block := newBlock() block.init(typeName, labels) b.appendItem(block) return block } // AppendNewline appends a newline token to th end of the receiving body, // which generally serves as a separator between different sets of body // contents. func (b *Body) AppendNewline() { b.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenNewline, Bytes: []byte{'\n'}, }, }) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/ast_expression.go����������������������0000664�0000000�0000000�00000014344�13771713062�0027320�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "fmt" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) type Expression struct { inTree absTraversals nodeSet } func newExpression() *Expression { return &Expression{ inTree: newInTree(), absTraversals: newNodeSet(), } } // NewExpressionRaw constructs an expression containing the given raw tokens. // // There is no automatic validation that the given tokens produce a valid // expression. Callers of thus function must take care to produce invalid // expression tokens. Where possible, use the higher-level functions // NewExpressionLiteral or NewExpressionAbsTraversal instead. // // Because NewExpressionRaw does not interpret the given tokens in any way, // an expression created by NewExpressionRaw will produce an empty result // for calls to its method Variables, even if the given token sequence // contains a subslice that would normally be interpreted as a traversal under // parsing. func NewExpressionRaw(tokens Tokens) *Expression { expr := newExpression() // We copy the tokens here in order to make sure that later mutations // by the caller don't inadvertently cause our expression to become // invalid. copyTokens := make(Tokens, len(tokens)) copy(copyTokens, tokens) expr.children.AppendUnstructuredTokens(copyTokens) return expr } // NewExpressionLiteral constructs an an expression that represents the given // literal value. // // Since an unknown value cannot be represented in source code, this function // will panic if the given value is unknown or contains a nested unknown value. // Use val.IsWhollyKnown before calling to be sure. // // HCL native syntax does not directly represent lists, maps, and sets, and // instead relies on the automatic conversions to those collection types from // either list or tuple constructor syntax. Therefore converting collection // values to source code and re-reading them will lose type information, and // the reader must provide a suitable type at decode time to recover the // original value. func NewExpressionLiteral(val cty.Value) *Expression { toks := TokensForValue(val) expr := newExpression() expr.children.AppendUnstructuredTokens(toks) return expr } // NewExpressionAbsTraversal constructs an expression that represents the // given traversal, which must be absolute or this function will panic. func NewExpressionAbsTraversal(traversal hcl.Traversal) *Expression { if traversal.IsRelative() { panic("can't construct expression from relative traversal") } physT := newTraversal() rootName := traversal.RootName() steps := traversal[1:] { tn := newTraverseName() tn.name = tn.children.Append(newIdentifier(&Token{ Type: hclsyntax.TokenIdent, Bytes: []byte(rootName), })) physT.steps.Add(physT.children.Append(tn)) } for _, step := range steps { switch ts := step.(type) { case hcl.TraverseAttr: tn := newTraverseName() tn.children.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenDot, Bytes: []byte{'.'}, }, }) tn.name = tn.children.Append(newIdentifier(&Token{ Type: hclsyntax.TokenIdent, Bytes: []byte(ts.Name), })) physT.steps.Add(physT.children.Append(tn)) case hcl.TraverseIndex: ti := newTraverseIndex() ti.children.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenOBrack, Bytes: []byte{'['}, }, }) indexExpr := NewExpressionLiteral(ts.Key) ti.key = ti.children.Append(indexExpr) ti.children.AppendUnstructuredTokens(Tokens{ { Type: hclsyntax.TokenCBrack, Bytes: []byte{']'}, }, }) physT.steps.Add(physT.children.Append(ti)) } } expr := newExpression() expr.absTraversals.Add(expr.children.Append(physT)) return expr } // Variables returns the absolute traversals that exist within the receiving // expression. func (e *Expression) Variables() []*Traversal { nodes := e.absTraversals.List() ret := make([]*Traversal, len(nodes)) for i, node := range nodes { ret[i] = node.content.(*Traversal) } return ret } // RenameVariablePrefix examines each of the absolute traversals in the // receiving expression to see if they have the given sequence of names as // a prefix prefix. If so, they are updated in place to have the given // replacement names instead of that prefix. // // This can be used to implement symbol renaming. The calling application can // visit all relevant expressions in its input and apply the same renaming // to implement a global symbol rename. // // The search and replacement traversals must be the same length, or this // method will panic. Only attribute access operations can be matched and // replaced. Index steps never match the prefix. func (e *Expression) RenameVariablePrefix(search, replacement []string) { if len(search) != len(replacement) { panic(fmt.Sprintf("search and replacement length mismatch (%d and %d)", len(search), len(replacement))) } Traversals: for node := range e.absTraversals { traversal := node.content.(*Traversal) if len(traversal.steps) < len(search) { // If it's shorter then it can't have our prefix continue } stepNodes := traversal.steps.List() for i, name := range search { step, isName := stepNodes[i].content.(*TraverseName) if !isName { continue Traversals // only name nodes can match } foundNameBytes := step.name.content.(*identifier).token.Bytes if len(foundNameBytes) != len(name) { continue Traversals } if string(foundNameBytes) != name { continue Traversals } } // If we get here then the prefix matched, so now we'll swap in // the replacement strings. for i, name := range replacement { step := stepNodes[i].content.(*TraverseName) token := step.name.content.(*identifier).token token.Bytes = []byte(name) } } } // Traversal represents a sequence of variable, attribute, and/or index // operations. type Traversal struct { inTree steps nodeSet } func newTraversal() *Traversal { return &Traversal{ inTree: newInTree(), steps: newNodeSet(), } } type TraverseName struct { inTree name *node } func newTraverseName() *TraverseName { return &TraverseName{ inTree: newInTree(), } } type TraverseIndex struct { inTree key *node } func newTraverseIndex() *TraverseIndex { return &TraverseIndex{ inTree: newInTree(), } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/doc.go���������������������������������0000664�0000000�0000000�00000001045�13771713062�0025011�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package hclwrite deals with the problem of generating HCL configuration // and of making specific surgical changes to existing HCL configurations. // // It operates at a different level of abstraction than the main HCL parser // and AST, since details such as the placement of comments and newlines // are preserved when unchanged. // // The hclwrite API follows a similar principle to XML/HTML DOM, allowing nodes // to be read out, created and inserted, etc. Nodes represent syntax constructs // rather than semantic concepts. package hclwrite �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/format.go������������������������������0000664�0000000�0000000�00000034673�13771713062�0025551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "github.com/hashicorp/hcl/v2/hclsyntax" ) var inKeyword = hclsyntax.Keyword([]byte{'i', 'n'}) // placeholder token used when we don't have a token but we don't want // to pass a real "nil" and complicate things with nil pointer checks var nilToken = &Token{ Type: hclsyntax.TokenNil, Bytes: []byte{}, SpacesBefore: 0, } // format rewrites tokens within the given sequence, in-place, to adjust the // whitespace around their content to achieve canonical formatting. func format(tokens Tokens) { // Formatting is a multi-pass process. More details on the passes below, // but this is the overview: // - adjust the leading space on each line to create appropriate // indentation // - adjust spaces between tokens in a single cell using a set of rules // - adjust the leading space in the "assign" and "comment" cells on each // line to vertically align with neighboring lines. // All of these steps operate in-place on the given tokens, so a caller // may collect a flat sequence of all of the tokens underlying an AST // and pass it here and we will then indirectly modify the AST itself. // Formatting must change only whitespace. Specifically, that means // changing the SpacesBefore attribute on a token while leaving the // other token attributes unchanged. lines := linesForFormat(tokens) formatIndent(lines) formatSpaces(lines) formatCells(lines) } func formatIndent(lines []formatLine) { // Our methodology for indents is to take the input one line at a time // and count the bracketing delimiters on each line. If a line has a net // increase in open brackets, we increase the indent level by one and // remember how many new openers we had. If the line has a net _decrease_, // we'll compare it to the most recent number of openers and decrease the // dedent level by one each time we pass an indent level remembered // earlier. // The "indent stack" used here allows for us to recognize degenerate // input where brackets are not symmetrical within lines and avoid // pushing things too far left or right, creating confusion. // We'll start our indent stack at a reasonable capacity to minimize the // chance of us needing to grow it; 10 here means 10 levels of indent, // which should be more than enough for reasonable HCL uses. indents := make([]int, 0, 10) for i := range lines { line := &lines[i] if len(line.lead) == 0 { continue } if line.lead[0].Type == hclsyntax.TokenNewline { // Never place spaces before a newline line.lead[0].SpacesBefore = 0 continue } netBrackets := 0 for _, token := range line.lead { netBrackets += tokenBracketChange(token) if token.Type == hclsyntax.TokenOHeredoc { break } } for _, token := range line.assign { netBrackets += tokenBracketChange(token) } switch { case netBrackets > 0: line.lead[0].SpacesBefore = 2 * len(indents) indents = append(indents, netBrackets) case netBrackets < 0: closed := -netBrackets for closed > 0 && len(indents) > 0 { switch { case closed > indents[len(indents)-1]: closed -= indents[len(indents)-1] indents = indents[:len(indents)-1] case closed < indents[len(indents)-1]: indents[len(indents)-1] -= closed closed = 0 default: indents = indents[:len(indents)-1] closed = 0 } } line.lead[0].SpacesBefore = 2 * len(indents) default: line.lead[0].SpacesBefore = 2 * len(indents) } } } func formatSpaces(lines []formatLine) { for _, line := range lines { for i, token := range line.lead { var before, after *Token if i > 0 { before = line.lead[i-1] } else { before = nilToken } if i < (len(line.lead) - 1) { after = line.lead[i+1] } else { after = nilToken } if spaceAfterToken(token, before, after) { after.SpacesBefore = 1 } else { after.SpacesBefore = 0 } } for i, token := range line.assign { if i == 0 { // first token in "assign" always has one space before to // separate the equals sign from what it's assigning. token.SpacesBefore = 1 } var before, after *Token if i > 0 { before = line.assign[i-1] } else { before = nilToken } if i < (len(line.assign) - 1) { after = line.assign[i+1] } else { after = nilToken } if spaceAfterToken(token, before, after) { after.SpacesBefore = 1 } else { after.SpacesBefore = 0 } } } } func formatCells(lines []formatLine) { chainStart := -1 maxColumns := 0 // We'll deal with the "assign" cell first, since moving that will // also impact the "comment" cell. closeAssignChain := func(i int) { for _, chainLine := range lines[chainStart:i] { columns := chainLine.lead.Columns() spaces := (maxColumns - columns) + 1 chainLine.assign[0].SpacesBefore = spaces } chainStart = -1 maxColumns = 0 } for i, line := range lines { if line.assign == nil { if chainStart != -1 { closeAssignChain(i) } } else { if chainStart == -1 { chainStart = i } columns := line.lead.Columns() if columns > maxColumns { maxColumns = columns } } } if chainStart != -1 { closeAssignChain(len(lines)) } // Now we'll deal with the comments closeCommentChain := func(i int) { for _, chainLine := range lines[chainStart:i] { columns := chainLine.lead.Columns() + chainLine.assign.Columns() spaces := (maxColumns - columns) + 1 chainLine.comment[0].SpacesBefore = spaces } chainStart = -1 maxColumns = 0 } for i, line := range lines { if line.comment == nil { if chainStart != -1 { closeCommentChain(i) } } else { if chainStart == -1 { chainStart = i } columns := line.lead.Columns() + line.assign.Columns() if columns > maxColumns { maxColumns = columns } } } if chainStart != -1 { closeCommentChain(len(lines)) } } // spaceAfterToken decides whether a particular subject token should have a // space after it when surrounded by the given before and after tokens. // "before" can be TokenNil, if the subject token is at the start of a sequence. func spaceAfterToken(subject, before, after *Token) bool { switch { case after.Type == hclsyntax.TokenNewline || after.Type == hclsyntax.TokenNil: // Never add spaces before a newline return false case subject.Type == hclsyntax.TokenIdent && after.Type == hclsyntax.TokenOParen: // Don't split a function name from open paren in a call return false case subject.Type == hclsyntax.TokenDot || after.Type == hclsyntax.TokenDot: // Don't use spaces around attribute access dots return false case after.Type == hclsyntax.TokenComma || after.Type == hclsyntax.TokenEllipsis: // No space right before a comma or ... in an argument list return false case subject.Type == hclsyntax.TokenComma: // Always a space after a comma return true case subject.Type == hclsyntax.TokenQuotedLit || subject.Type == hclsyntax.TokenStringLit || subject.Type == hclsyntax.TokenOQuote || subject.Type == hclsyntax.TokenOHeredoc || after.Type == hclsyntax.TokenQuotedLit || after.Type == hclsyntax.TokenStringLit || after.Type == hclsyntax.TokenCQuote || after.Type == hclsyntax.TokenCHeredoc: // No extra spaces within templates return false case inKeyword.TokenMatches(subject.asHCLSyntax()) && before.Type == hclsyntax.TokenIdent: // This is a special case for inside for expressions where a user // might want to use a literal tuple constructor: // [for x in [foo]: x] // ... in that case, we would normally produce in[foo] thinking that // in is a reference, but we'll recognize it as a keyword here instead // to make the result less confusing. return true case after.Type == hclsyntax.TokenOBrack && (subject.Type == hclsyntax.TokenIdent || subject.Type == hclsyntax.TokenNumberLit || tokenBracketChange(subject) < 0): return false case subject.Type == hclsyntax.TokenMinus: // Since a minus can either be subtraction or negation, and the latter // should _not_ have a space after it, we need to use some heuristics // to decide which case this is. // We guess that we have a negation if the token before doesn't look // like it could be the end of an expression. switch before.Type { case hclsyntax.TokenNil: // Minus at the start of input must be a negation return false case hclsyntax.TokenOParen, hclsyntax.TokenOBrace, hclsyntax.TokenOBrack, hclsyntax.TokenEqual, hclsyntax.TokenColon, hclsyntax.TokenComma, hclsyntax.TokenQuestion: // Minus immediately after an opening bracket or separator must be a negation. return false case hclsyntax.TokenPlus, hclsyntax.TokenStar, hclsyntax.TokenSlash, hclsyntax.TokenPercent, hclsyntax.TokenMinus: // Minus immediately after another arithmetic operator must be negation. return false case hclsyntax.TokenEqualOp, hclsyntax.TokenNotEqual, hclsyntax.TokenGreaterThan, hclsyntax.TokenGreaterThanEq, hclsyntax.TokenLessThan, hclsyntax.TokenLessThanEq: // Minus immediately after another comparison operator must be negation. return false case hclsyntax.TokenAnd, hclsyntax.TokenOr, hclsyntax.TokenBang: // Minus immediately after logical operator doesn't make sense but probably intended as negation. return false default: return true } case subject.Type == hclsyntax.TokenOBrace || after.Type == hclsyntax.TokenCBrace: // Unlike other bracket types, braces have spaces on both sides of them, // both in single-line nested blocks foo { bar = baz } and in object // constructor expressions foo = { bar = baz }. if subject.Type == hclsyntax.TokenOBrace && after.Type == hclsyntax.TokenCBrace { // An open brace followed by a close brace is an exception, however. // e.g. foo {} rather than foo { } return false } return true // In the unlikely event that an interpolation expression is just // a single object constructor, we'll put a space between the ${ and // the following { to make this more obvious, and then the same // thing for the two braces at the end. case (subject.Type == hclsyntax.TokenTemplateInterp || subject.Type == hclsyntax.TokenTemplateControl) && after.Type == hclsyntax.TokenOBrace: return true case subject.Type == hclsyntax.TokenCBrace && after.Type == hclsyntax.TokenTemplateSeqEnd: return true // Don't add spaces between interpolated items case subject.Type == hclsyntax.TokenTemplateSeqEnd && (after.Type == hclsyntax.TokenTemplateInterp || after.Type == hclsyntax.TokenTemplateControl): return false case tokenBracketChange(subject) > 0: // No spaces after open brackets return false case tokenBracketChange(after) < 0: // No spaces before close brackets return false default: // Most tokens are space-separated return true } } func linesForFormat(tokens Tokens) []formatLine { if len(tokens) == 0 { return make([]formatLine, 0) } // first we'll count our lines, so we can allocate the array for them in // a single block. (We want to minimize memory pressure in this codepath, // so it can be run somewhat-frequently by editor integrations.) lineCount := 1 // if there are zero newlines then there is one line for _, tok := range tokens { if tokenIsNewline(tok) { lineCount++ } } // To start, we'll just put everything in the "lead" cell on each line, // and then do another pass over the lines afterwards to adjust. lines := make([]formatLine, lineCount) li := 0 lineStart := 0 for i, tok := range tokens { if tok.Type == hclsyntax.TokenEOF { // The EOF token doesn't belong to any line, and terminates the // token sequence. lines[li].lead = tokens[lineStart:i] break } if tokenIsNewline(tok) { lines[li].lead = tokens[lineStart : i+1] lineStart = i + 1 li++ } } // If a set of tokens doesn't end in TokenEOF (e.g. because it's a // fragment of tokens from the middle of a file) then we might fall // out here with a line still pending. if lineStart < len(tokens) { lines[li].lead = tokens[lineStart:] if lines[li].lead[len(lines[li].lead)-1].Type == hclsyntax.TokenEOF { lines[li].lead = lines[li].lead[:len(lines[li].lead)-1] } } // Now we'll pick off any trailing comments and attribute assignments // to shuffle off into the "comment" and "assign" cells. for i := range lines { line := &lines[i] if len(line.lead) == 0 { // if the line is empty then there's nothing for us to do // (this should happen only for the final line, because all other // lines would have a newline token of some kind) continue } if len(line.lead) > 1 && line.lead[len(line.lead)-1].Type == hclsyntax.TokenComment { line.comment = line.lead[len(line.lead)-1:] line.lead = line.lead[:len(line.lead)-1] } for i, tok := range line.lead { if i > 0 && tok.Type == hclsyntax.TokenEqual { // We only move the tokens into "assign" if the RHS seems to // be a whole expression, which we determine by counting // brackets. If there's a net positive number of brackets // then that suggests we're introducing a multi-line expression. netBrackets := 0 for _, token := range line.lead[i:] { netBrackets += tokenBracketChange(token) } if netBrackets == 0 { line.assign = line.lead[i:] line.lead = line.lead[:i] } break } } } return lines } func tokenIsNewline(tok *Token) bool { if tok.Type == hclsyntax.TokenNewline { return true } else if tok.Type == hclsyntax.TokenComment { // Single line tokens (# and //) consume their terminating newline, // so we need to treat them as newline tokens as well. if len(tok.Bytes) > 0 && tok.Bytes[len(tok.Bytes)-1] == '\n' { return true } } return false } func tokenBracketChange(tok *Token) int { switch tok.Type { case hclsyntax.TokenOBrace, hclsyntax.TokenOBrack, hclsyntax.TokenOParen, hclsyntax.TokenTemplateControl, hclsyntax.TokenTemplateInterp: return 1 case hclsyntax.TokenCBrace, hclsyntax.TokenCBrack, hclsyntax.TokenCParen, hclsyntax.TokenTemplateSeqEnd: return -1 default: return 0 } } // formatLine represents a single line of source code for formatting purposes, // splitting its tokens into up to three "cells": // // lead: always present, representing everything up to one of the others // assign: if line contains an attribute assignment, represents the tokens // starting at (and including) the equals symbol // comment: if line contains any non-comment tokens and ends with a // single-line comment token, represents the comment. // // When formatting, the leading spaces of the first tokens in each of these // cells is adjusted to align vertically their occurences on consecutive // rows. type formatLine struct { lead Tokens assign Tokens comment Tokens } ���������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go����������������������������0000664�0000000�0000000�00000013740�13771713062�0026043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "fmt" "unicode" "unicode/utf8" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) // TokensForValue returns a sequence of tokens that represents the given // constant value. // // This function only supports types that are used by HCL. In particular, it // does not support capsule types and will panic if given one. // // It is not possible to express an unknown value in source code, so this // function will panic if the given value is unknown or contains any unknown // values. A caller can call the value's IsWhollyKnown method to verify that // no unknown values are present before calling TokensForValue. func TokensForValue(val cty.Value) Tokens { toks := appendTokensForValue(val, nil) format(toks) // fiddle with the SpacesBefore field to get canonical spacing return toks } // TokensForTraversal returns a sequence of tokens that represents the given // traversal. // // If the traversal is absolute then the result is a self-contained, valid // reference expression. If the traversal is relative then the returned tokens // could be appended to some other expression tokens to traverse into the // represented expression. func TokensForTraversal(traversal hcl.Traversal) Tokens { toks := appendTokensForTraversal(traversal, nil) format(toks) // fiddle with the SpacesBefore field to get canonical spacing return toks } func appendTokensForValue(val cty.Value, toks Tokens) Tokens { switch { case !val.IsKnown(): panic("cannot produce tokens for unknown value") case val.IsNull(): toks = append(toks, &Token{ Type: hclsyntax.TokenIdent, Bytes: []byte(`null`), }) case val.Type() == cty.Bool: var src []byte if val.True() { src = []byte(`true`) } else { src = []byte(`false`) } toks = append(toks, &Token{ Type: hclsyntax.TokenIdent, Bytes: src, }) case val.Type() == cty.Number: bf := val.AsBigFloat() srcStr := bf.Text('f', -1) toks = append(toks, &Token{ Type: hclsyntax.TokenNumberLit, Bytes: []byte(srcStr), }) case val.Type() == cty.String: // TODO: If it's a multi-line string ending in a newline, format // it as a HEREDOC instead. src := escapeQuotedStringLit(val.AsString()) toks = append(toks, &Token{ Type: hclsyntax.TokenOQuote, Bytes: []byte{'"'}, }) if len(src) > 0 { toks = append(toks, &Token{ Type: hclsyntax.TokenQuotedLit, Bytes: src, }) } toks = append(toks, &Token{ Type: hclsyntax.TokenCQuote, Bytes: []byte{'"'}, }) case val.Type().IsListType() || val.Type().IsSetType() || val.Type().IsTupleType(): toks = append(toks, &Token{ Type: hclsyntax.TokenOBrack, Bytes: []byte{'['}, }) i := 0 for it := val.ElementIterator(); it.Next(); { if i > 0 { toks = append(toks, &Token{ Type: hclsyntax.TokenComma, Bytes: []byte{','}, }) } _, eVal := it.Element() toks = appendTokensForValue(eVal, toks) i++ } toks = append(toks, &Token{ Type: hclsyntax.TokenCBrack, Bytes: []byte{']'}, }) case val.Type().IsMapType() || val.Type().IsObjectType(): toks = append(toks, &Token{ Type: hclsyntax.TokenOBrace, Bytes: []byte{'{'}, }) if val.LengthInt() > 0 { toks = append(toks, &Token{ Type: hclsyntax.TokenNewline, Bytes: []byte{'\n'}, }) } i := 0 for it := val.ElementIterator(); it.Next(); { eKey, eVal := it.Element() if hclsyntax.ValidIdentifier(eKey.AsString()) { toks = append(toks, &Token{ Type: hclsyntax.TokenIdent, Bytes: []byte(eKey.AsString()), }) } else { toks = appendTokensForValue(eKey, toks) } toks = append(toks, &Token{ Type: hclsyntax.TokenEqual, Bytes: []byte{'='}, }) toks = appendTokensForValue(eVal, toks) toks = append(toks, &Token{ Type: hclsyntax.TokenNewline, Bytes: []byte{'\n'}, }) i++ } toks = append(toks, &Token{ Type: hclsyntax.TokenCBrace, Bytes: []byte{'}'}, }) default: panic(fmt.Sprintf("cannot produce tokens for %#v", val)) } return toks } func appendTokensForTraversal(traversal hcl.Traversal, toks Tokens) Tokens { for _, step := range traversal { toks = appendTokensForTraversalStep(step, toks) } return toks } func appendTokensForTraversalStep(step hcl.Traverser, toks Tokens) Tokens { switch ts := step.(type) { case hcl.TraverseRoot: toks = append(toks, &Token{ Type: hclsyntax.TokenIdent, Bytes: []byte(ts.Name), }) case hcl.TraverseAttr: toks = append( toks, &Token{ Type: hclsyntax.TokenDot, Bytes: []byte{'.'}, }, &Token{ Type: hclsyntax.TokenIdent, Bytes: []byte(ts.Name), }, ) case hcl.TraverseIndex: toks = append(toks, &Token{ Type: hclsyntax.TokenOBrack, Bytes: []byte{'['}, }) toks = appendTokensForValue(ts.Key, toks) toks = append(toks, &Token{ Type: hclsyntax.TokenCBrack, Bytes: []byte{']'}, }) default: panic(fmt.Sprintf("unsupported traversal step type %T", step)) } return toks } func escapeQuotedStringLit(s string) []byte { if len(s) == 0 { return nil } buf := make([]byte, 0, len(s)) for i, r := range s { switch r { case '\n': buf = append(buf, '\\', 'n') case '\r': buf = append(buf, '\\', 'r') case '\t': buf = append(buf, '\\', 't') case '"': buf = append(buf, '\\', '"') case '\\': buf = append(buf, '\\', '\\') case '$', '%': buf = appendRune(buf, r) remain := s[i+1:] if len(remain) > 0 && remain[0] == '{' { // Double up our template introducer symbol to escape it. buf = appendRune(buf, r) } default: if !unicode.IsPrint(r) { var fmted string if r < 65536 { fmted = fmt.Sprintf("\\u%04x", r) } else { fmted = fmt.Sprintf("\\U%08x", r) } buf = append(buf, fmted...) } else { buf = appendRune(buf, r) } } } return buf } func appendRune(b []byte, r rune) []byte { l := utf8.RuneLen(r) for i := 0; i < l; i++ { b = append(b, 0) // make room at the end of our buffer } ch := b[len(b)-l:] utf8.EncodeRune(ch, r) return b } ��������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/native_node_sorter.go������������������0000664�0000000�0000000�00000000672�13771713062�0030142�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "github.com/hashicorp/hcl/v2/hclsyntax" ) type nativeNodeSorter struct { Nodes []hclsyntax.Node } func (s nativeNodeSorter) Len() int { return len(s.Nodes) } func (s nativeNodeSorter) Less(i, j int) bool { rangeI := s.Nodes[i].Range() rangeJ := s.Nodes[j].Range() return rangeI.Start.Byte < rangeJ.Start.Byte } func (s nativeNodeSorter) Swap(i, j int) { s.Nodes[i], s.Nodes[j] = s.Nodes[j], s.Nodes[i] } ����������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/node.go��������������������������������0000664�0000000�0000000�00000012405�13771713062�0025173�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "fmt" "github.com/google/go-cmp/cmp" ) // node represents a node in the AST. type node struct { content nodeContent list *nodes before, after *node } func newNode(c nodeContent) *node { return &node{ content: c, } } func (n *node) Equal(other *node) bool { return cmp.Equal(n.content, other.content) } func (n *node) BuildTokens(to Tokens) Tokens { return n.content.BuildTokens(to) } // Detach removes the receiver from the list it currently belongs to. If the // node is not currently in a list, this is a no-op. func (n *node) Detach() { if n.list == nil { return } if n.before != nil { n.before.after = n.after } if n.after != nil { n.after.before = n.before } if n.list.first == n { n.list.first = n.after } if n.list.last == n { n.list.last = n.before } n.list = nil n.before = nil n.after = nil } // ReplaceWith removes the receiver from the list it currently belongs to and // inserts a new node with the given content in its place. If the node is not // currently in a list, this function will panic. // // The return value is the newly-constructed node, containing the given content. // After this function returns, the reciever is no longer attached to a list. func (n *node) ReplaceWith(c nodeContent) *node { if n.list == nil { panic("can't replace node that is not in a list") } before := n.before after := n.after list := n.list n.before, n.after, n.list = nil, nil, nil nn := newNode(c) nn.before = before nn.after = after nn.list = list if before != nil { before.after = nn } if after != nil { after.before = nn } return nn } func (n *node) assertUnattached() { if n.list != nil { panic(fmt.Sprintf("attempt to attach already-attached node %#v", n)) } } // nodeContent is the interface type implemented by all AST content types. type nodeContent interface { walkChildNodes(w internalWalkFunc) BuildTokens(to Tokens) Tokens } // nodes is a list of nodes. type nodes struct { first, last *node } func (ns *nodes) BuildTokens(to Tokens) Tokens { for n := ns.first; n != nil; n = n.after { to = n.BuildTokens(to) } return to } func (ns *nodes) Clear() { ns.first = nil ns.last = nil } func (ns *nodes) Append(c nodeContent) *node { n := &node{ content: c, } ns.AppendNode(n) n.list = ns return n } func (ns *nodes) AppendNode(n *node) { if ns.last != nil { n.before = ns.last ns.last.after = n } n.list = ns ns.last = n if ns.first == nil { ns.first = n } } func (ns *nodes) AppendUnstructuredTokens(tokens Tokens) *node { if len(tokens) == 0 { return nil } n := newNode(tokens) ns.AppendNode(n) n.list = ns return n } // FindNodeWithContent searches the nodes for a node whose content equals // the given content. If it finds one then it returns it. Otherwise it returns // nil. func (ns *nodes) FindNodeWithContent(content nodeContent) *node { for n := ns.first; n != nil; n = n.after { if n.content == content { return n } } return nil } // nodeSet is an unordered set of nodes. It is used to describe a set of nodes // that all belong to the same list that have some role or characteristic // in common. type nodeSet map[*node]struct{} func newNodeSet() nodeSet { return make(nodeSet) } func (ns nodeSet) Has(n *node) bool { if ns == nil { return false } _, exists := ns[n] return exists } func (ns nodeSet) Add(n *node) { ns[n] = struct{}{} } func (ns nodeSet) Remove(n *node) { delete(ns, n) } func (ns nodeSet) List() []*node { if len(ns) == 0 { return nil } ret := make([]*node, 0, len(ns)) // Determine which list we are working with. We assume here that all of // the nodes belong to the same list, since that is part of the contract // for nodeSet. var list *nodes for n := range ns { list = n.list break } // We recover the order by iterating over the whole list. This is not // the most efficient way to do it, but our node lists should always be // small so not worth making things more complex. for n := list.first; n != nil; n = n.after { if ns.Has(n) { ret = append(ret, n) } } return ret } // FindNodeWithContent searches the nodes for a node whose content equals // the given content. If it finds one then it returns it. Otherwise it returns // nil. func (ns nodeSet) FindNodeWithContent(content nodeContent) *node { for n := range ns { if n.content == content { return n } } return nil } type internalWalkFunc func(*node) // inTree can be embedded into a content struct that has child nodes to get // a standard implementation of the NodeContent interface and a record of // a potential parent node. type inTree struct { parent *node children *nodes } func newInTree() inTree { return inTree{ children: &nodes{}, } } func (it *inTree) assertUnattached() { if it.parent != nil { panic(fmt.Sprintf("node is already attached to %T", it.parent.content)) } } func (it *inTree) walkChildNodes(w internalWalkFunc) { for n := it.children.first; n != nil; n = n.after { w(n) } } func (it *inTree) BuildTokens(to Tokens) Tokens { for n := it.children.first; n != nil; n = n.after { to = n.BuildTokens(to) } return to } // leafNode can be embedded into a content struct to give it a do-nothing // implementation of walkChildNodes type leafNode struct { } func (n *leafNode) walkChildNodes(w internalWalkFunc) { } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/parser.go������������������������������0000664�0000000�0000000�00000051433�13771713062�0025546�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "fmt" "sort" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) // Our "parser" here is actually not doing any parsing of its own. Instead, // it leans on the native parser in hclsyntax, and then uses the source ranges // from the AST to partition the raw token sequence to match the raw tokens // up to AST nodes. // // This strategy feels somewhat counter-intuitive, since most of the work the // parser does is thrown away here, but this strategy is chosen because the // normal parsing work done by hclsyntax is considered to be the "main case", // while modifying and re-printing source is more of an edge case, used only // in ancillary tools, and so it's good to keep all the main parsing logic // with the main case but keep all of the extra complexity of token wrangling // out of the main parser, which is already rather complex just serving the // use-cases it already serves. // // If the parsing step produces any errors, the returned File is nil because // we can't reliably extract tokens from the partial AST produced by an // erroneous parse. func parse(src []byte, filename string, start hcl.Pos) (*File, hcl.Diagnostics) { file, diags := hclsyntax.ParseConfig(src, filename, start) if diags.HasErrors() { return nil, diags } // To do our work here, we use the "native" tokens (those from hclsyntax) // to match against source ranges in the AST, but ultimately produce // slices from our sequence of "writer" tokens, which contain only // *relative* position information that is more appropriate for // transformation/writing use-cases. nativeTokens, diags := hclsyntax.LexConfig(src, filename, start) if diags.HasErrors() { // should never happen, since we would've caught these diags in // the first call above. return nil, diags } writerTokens := writerTokens(nativeTokens) from := inputTokens{ nativeTokens: nativeTokens, writerTokens: writerTokens, } before, root, after := parseBody(file.Body.(*hclsyntax.Body), from) ret := &File{ inTree: newInTree(), srcBytes: src, body: root, } nodes := ret.inTree.children nodes.Append(before.Tokens()) nodes.AppendNode(root) nodes.Append(after.Tokens()) return ret, diags } type inputTokens struct { nativeTokens hclsyntax.Tokens writerTokens Tokens } func (it inputTokens) Partition(rng hcl.Range) (before, within, after inputTokens) { start, end := partitionTokens(it.nativeTokens, rng) before = it.Slice(0, start) within = it.Slice(start, end) after = it.Slice(end, len(it.nativeTokens)) return } func (it inputTokens) PartitionType(ty hclsyntax.TokenType) (before, within, after inputTokens) { for i, t := range it.writerTokens { if t.Type == ty { return it.Slice(0, i), it.Slice(i, i+1), it.Slice(i+1, len(it.nativeTokens)) } } panic(fmt.Sprintf("didn't find any token of type %s", ty)) } func (it inputTokens) PartitionTypeOk(ty hclsyntax.TokenType) (before, within, after inputTokens, ok bool) { for i, t := range it.writerTokens { if t.Type == ty { return it.Slice(0, i), it.Slice(i, i+1), it.Slice(i+1, len(it.nativeTokens)), true } } return inputTokens{}, inputTokens{}, inputTokens{}, false } func (it inputTokens) PartitionTypeSingle(ty hclsyntax.TokenType) (before inputTokens, found *Token, after inputTokens) { before, within, after := it.PartitionType(ty) if within.Len() != 1 { panic("PartitionType found more than one token") } return before, within.Tokens()[0], after } // PartitionIncludeComments is like Partition except the returned "within" // range includes any lead and line comments associated with the range. func (it inputTokens) PartitionIncludingComments(rng hcl.Range) (before, within, after inputTokens) { start, end := partitionTokens(it.nativeTokens, rng) start = partitionLeadCommentTokens(it.nativeTokens[:start]) _, afterNewline := partitionLineEndTokens(it.nativeTokens[end:]) end += afterNewline before = it.Slice(0, start) within = it.Slice(start, end) after = it.Slice(end, len(it.nativeTokens)) return } // PartitionBlockItem is similar to PartitionIncludeComments but it returns // the comments as separate token sequences so that they can be captured into // AST attributes. It makes assumptions that apply only to block items, so // should not be used for other constructs. func (it inputTokens) PartitionBlockItem(rng hcl.Range) (before, leadComments, within, lineComments, newline, after inputTokens) { before, within, after = it.Partition(rng) before, leadComments = before.PartitionLeadComments() lineComments, newline, after = after.PartitionLineEndTokens() return } func (it inputTokens) PartitionLeadComments() (before, within inputTokens) { start := partitionLeadCommentTokens(it.nativeTokens) before = it.Slice(0, start) within = it.Slice(start, len(it.nativeTokens)) return } func (it inputTokens) PartitionLineEndTokens() (comments, newline, after inputTokens) { afterComments, afterNewline := partitionLineEndTokens(it.nativeTokens) comments = it.Slice(0, afterComments) newline = it.Slice(afterComments, afterNewline) after = it.Slice(afterNewline, len(it.nativeTokens)) return } func (it inputTokens) Slice(start, end int) inputTokens { // When we slice, we create a new slice with no additional capacity because // we expect that these slices will be mutated in order to insert // new code into the AST, and we want to ensure that a new underlying // array gets allocated in that case, rather than writing into some // following slice and corrupting it. return inputTokens{ nativeTokens: it.nativeTokens[start:end:end], writerTokens: it.writerTokens[start:end:end], } } func (it inputTokens) Len() int { return len(it.nativeTokens) } func (it inputTokens) Tokens() Tokens { return it.writerTokens } func (it inputTokens) Types() []hclsyntax.TokenType { ret := make([]hclsyntax.TokenType, len(it.nativeTokens)) for i, tok := range it.nativeTokens { ret[i] = tok.Type } return ret } // parseBody locates the given body within the given input tokens and returns // the resulting *Body object as well as the tokens that appeared before and // after it. func parseBody(nativeBody *hclsyntax.Body, from inputTokens) (inputTokens, *node, inputTokens) { before, within, after := from.PartitionIncludingComments(nativeBody.SrcRange) // The main AST doesn't retain the original source ordering of the // body items, so we need to reconstruct that ordering by inspecting // their source ranges. nativeItems := make([]hclsyntax.Node, 0, len(nativeBody.Attributes)+len(nativeBody.Blocks)) for _, nativeAttr := range nativeBody.Attributes { nativeItems = append(nativeItems, nativeAttr) } for _, nativeBlock := range nativeBody.Blocks { nativeItems = append(nativeItems, nativeBlock) } sort.Sort(nativeNodeSorter{nativeItems}) body := &Body{ inTree: newInTree(), items: newNodeSet(), } remain := within for _, nativeItem := range nativeItems { beforeItem, item, afterItem := parseBodyItem(nativeItem, remain) if beforeItem.Len() > 0 { body.AppendUnstructuredTokens(beforeItem.Tokens()) } body.appendItemNode(item) remain = afterItem } if remain.Len() > 0 { body.AppendUnstructuredTokens(remain.Tokens()) } return before, newNode(body), after } func parseBodyItem(nativeItem hclsyntax.Node, from inputTokens) (inputTokens, *node, inputTokens) { before, leadComments, within, lineComments, newline, after := from.PartitionBlockItem(nativeItem.Range()) var item *node switch tItem := nativeItem.(type) { case *hclsyntax.Attribute: item = parseAttribute(tItem, within, leadComments, lineComments, newline) case *hclsyntax.Block: item = parseBlock(tItem, within, leadComments, lineComments, newline) default: // should never happen if caller is behaving panic("unsupported native item type") } return before, item, after } func parseAttribute(nativeAttr *hclsyntax.Attribute, from, leadComments, lineComments, newline inputTokens) *node { attr := &Attribute{ inTree: newInTree(), } children := attr.inTree.children { cn := newNode(newComments(leadComments.Tokens())) attr.leadComments = cn children.AppendNode(cn) } before, nameTokens, from := from.Partition(nativeAttr.NameRange) { children.AppendUnstructuredTokens(before.Tokens()) if nameTokens.Len() != 1 { // Should never happen with valid input panic("attribute name is not exactly one token") } token := nameTokens.Tokens()[0] in := newNode(newIdentifier(token)) attr.name = in children.AppendNode(in) } before, equalsTokens, from := from.Partition(nativeAttr.EqualsRange) children.AppendUnstructuredTokens(before.Tokens()) children.AppendUnstructuredTokens(equalsTokens.Tokens()) before, exprTokens, from := from.Partition(nativeAttr.Expr.Range()) { children.AppendUnstructuredTokens(before.Tokens()) exprNode := parseExpression(nativeAttr.Expr, exprTokens) attr.expr = exprNode children.AppendNode(exprNode) } { cn := newNode(newComments(lineComments.Tokens())) attr.lineComments = cn children.AppendNode(cn) } children.AppendUnstructuredTokens(newline.Tokens()) // Collect any stragglers, though there shouldn't be any children.AppendUnstructuredTokens(from.Tokens()) return newNode(attr) } func parseBlock(nativeBlock *hclsyntax.Block, from, leadComments, lineComments, newline inputTokens) *node { block := &Block{ inTree: newInTree(), labels: newNodeSet(), } children := block.inTree.children { cn := newNode(newComments(leadComments.Tokens())) block.leadComments = cn children.AppendNode(cn) } before, typeTokens, from := from.Partition(nativeBlock.TypeRange) { children.AppendUnstructuredTokens(before.Tokens()) if typeTokens.Len() != 1 { // Should never happen with valid input panic("block type name is not exactly one token") } token := typeTokens.Tokens()[0] in := newNode(newIdentifier(token)) block.typeName = in children.AppendNode(in) } for _, rng := range nativeBlock.LabelRanges { var labelTokens inputTokens before, labelTokens, from = from.Partition(rng) children.AppendUnstructuredTokens(before.Tokens()) tokens := labelTokens.Tokens() var ln *node if len(tokens) == 1 && tokens[0].Type == hclsyntax.TokenIdent { ln = newNode(newIdentifier(tokens[0])) } else { ln = newNode(newQuoted(tokens)) } block.labels.Add(ln) children.AppendNode(ln) } before, oBrace, from := from.Partition(nativeBlock.OpenBraceRange) children.AppendUnstructuredTokens(before.Tokens()) children.AppendUnstructuredTokens(oBrace.Tokens()) // We go a bit out of order here: we go hunting for the closing brace // so that we have a delimited body, but then we'll deal with the body // before we actually append the closing brace and any straggling tokens // that appear after it. bodyTokens, cBrace, from := from.Partition(nativeBlock.CloseBraceRange) before, body, after := parseBody(nativeBlock.Body, bodyTokens) children.AppendUnstructuredTokens(before.Tokens()) block.body = body children.AppendNode(body) children.AppendUnstructuredTokens(after.Tokens()) children.AppendUnstructuredTokens(cBrace.Tokens()) // stragglers children.AppendUnstructuredTokens(from.Tokens()) if lineComments.Len() > 0 { // blocks don't actually have line comments, so we'll just treat // them as extra stragglers children.AppendUnstructuredTokens(lineComments.Tokens()) } children.AppendUnstructuredTokens(newline.Tokens()) return newNode(block) } func parseExpression(nativeExpr hclsyntax.Expression, from inputTokens) *node { expr := newExpression() children := expr.inTree.children nativeVars := nativeExpr.Variables() for _, nativeTraversal := range nativeVars { before, traversal, after := parseTraversal(nativeTraversal, from) children.AppendUnstructuredTokens(before.Tokens()) children.AppendNode(traversal) expr.absTraversals.Add(traversal) from = after } // Attach any stragglers that don't belong to a traversal to the expression // itself. In an expression with no traversals at all, this is just the // entirety of "from". children.AppendUnstructuredTokens(from.Tokens()) return newNode(expr) } func parseTraversal(nativeTraversal hcl.Traversal, from inputTokens) (before inputTokens, n *node, after inputTokens) { traversal := newTraversal() children := traversal.inTree.children before, from, after = from.Partition(nativeTraversal.SourceRange()) stepAfter := from for _, nativeStep := range nativeTraversal { before, step, after := parseTraversalStep(nativeStep, stepAfter) children.AppendUnstructuredTokens(before.Tokens()) children.AppendNode(step) traversal.steps.Add(step) stepAfter = after } return before, newNode(traversal), after } func parseTraversalStep(nativeStep hcl.Traverser, from inputTokens) (before inputTokens, n *node, after inputTokens) { var children *nodes switch tNativeStep := nativeStep.(type) { case hcl.TraverseRoot, hcl.TraverseAttr: step := newTraverseName() children = step.inTree.children before, from, after = from.Partition(nativeStep.SourceRange()) inBefore, token, inAfter := from.PartitionTypeSingle(hclsyntax.TokenIdent) name := newIdentifier(token) children.AppendUnstructuredTokens(inBefore.Tokens()) step.name = children.Append(name) children.AppendUnstructuredTokens(inAfter.Tokens()) return before, newNode(step), after case hcl.TraverseIndex: step := newTraverseIndex() children = step.inTree.children before, from, after = from.Partition(nativeStep.SourceRange()) if inBefore, dot, from, ok := from.PartitionTypeOk(hclsyntax.TokenDot); ok { children.AppendUnstructuredTokens(inBefore.Tokens()) children.AppendUnstructuredTokens(dot.Tokens()) valBefore, valToken, valAfter := from.PartitionTypeSingle(hclsyntax.TokenNumberLit) children.AppendUnstructuredTokens(valBefore.Tokens()) key := newNumber(valToken) step.key = children.Append(key) children.AppendUnstructuredTokens(valAfter.Tokens()) return before, newNode(step), after } var inBefore, oBrack, keyTokens, cBrack inputTokens inBefore, oBrack, from = from.PartitionType(hclsyntax.TokenOBrack) children.AppendUnstructuredTokens(inBefore.Tokens()) children.AppendUnstructuredTokens(oBrack.Tokens()) keyTokens, cBrack, from = from.PartitionType(hclsyntax.TokenCBrack) keyVal := tNativeStep.Key switch keyVal.Type() { case cty.String: key := newQuoted(keyTokens.Tokens()) step.key = children.Append(key) case cty.Number: valBefore, valToken, valAfter := keyTokens.PartitionTypeSingle(hclsyntax.TokenNumberLit) children.AppendUnstructuredTokens(valBefore.Tokens()) key := newNumber(valToken) step.key = children.Append(key) children.AppendUnstructuredTokens(valAfter.Tokens()) } children.AppendUnstructuredTokens(cBrack.Tokens()) children.AppendUnstructuredTokens(from.Tokens()) return before, newNode(step), after default: panic(fmt.Sprintf("unsupported traversal step type %T", nativeStep)) } } // writerTokens takes a sequence of tokens as produced by the main hclsyntax // package and transforms it into an equivalent sequence of tokens using // this package's own token model. // // The resulting list contains the same number of tokens and uses the same // indices as the input, allowing the two sets of tokens to be correlated // by index. func writerTokens(nativeTokens hclsyntax.Tokens) Tokens { // Ultimately we want a slice of token _pointers_, but since we can // predict how much memory we're going to devote to tokens we'll allocate // it all as a single flat buffer and thus give the GC less work to do. tokBuf := make([]Token, len(nativeTokens)) var lastByteOffset int for i, mainToken := range nativeTokens { // Create a copy of the bytes so that we can mutate without // corrupting the original token stream. bytes := make([]byte, len(mainToken.Bytes)) copy(bytes, mainToken.Bytes) tokBuf[i] = Token{ Type: mainToken.Type, Bytes: bytes, // We assume here that spaces are always ASCII spaces, since // that's what the scanner also assumes, and thus the number // of bytes skipped is also the number of space characters. SpacesBefore: mainToken.Range.Start.Byte - lastByteOffset, } lastByteOffset = mainToken.Range.End.Byte } // Now make a slice of pointers into the previous slice. ret := make(Tokens, len(tokBuf)) for i := range ret { ret[i] = &tokBuf[i] } return ret } // partitionTokens takes a sequence of tokens and a hcl.Range and returns // two indices within the token sequence that correspond with the range // boundaries, such that the slice operator could be used to produce // three token sequences for before, within, and after respectively: // // start, end := partitionTokens(toks, rng) // before := toks[:start] // within := toks[start:end] // after := toks[end:] // // This works best when the range is aligned with token boundaries (e.g. // because it was produced in terms of the scanner's result) but if that isn't // true then it will make a best effort that may produce strange results at // the boundaries. // // Native hclsyntax tokens are used here, because they contain the necessary // absolute position information. However, since writerTokens produces a // correlatable sequence of writer tokens, the resulting indices can be // used also to index into its result, allowing the partitioning of writer // tokens to be driven by the partitioning of native tokens. // // The tokens are assumed to be in source order and non-overlapping, which // will be true if the token sequence from the scanner is used directly. func partitionTokens(toks hclsyntax.Tokens, rng hcl.Range) (start, end int) { // We use a linear search here because we assume that in most cases our // target range is close to the beginning of the sequence, and the sequences // are generally small for most reasonable files anyway. for i := 0; ; i++ { if i >= len(toks) { // No tokens for the given range at all! return len(toks), len(toks) } if toks[i].Range.Start.Byte >= rng.Start.Byte { start = i break } } for i := start; ; i++ { if i >= len(toks) { // The range "hangs off" the end of the token sequence return start, len(toks) } if toks[i].Range.Start.Byte >= rng.End.Byte { end = i // end marker is exclusive break } } return start, end } // partitionLeadCommentTokens takes a sequence of tokens that is assumed // to immediately precede a construct that can have lead comment tokens, // and returns the index into that sequence where the lead comments begin. // // Lead comments are defined as whole lines containing only comment tokens // with no blank lines between. If no such lines are found, the returned // index will be len(toks). func partitionLeadCommentTokens(toks hclsyntax.Tokens) int { // single-line comments (which is what we're interested in here) // consume their trailing newline, so we can just walk backwards // until we stop seeing comment tokens. for i := len(toks) - 1; i >= 0; i-- { if toks[i].Type != hclsyntax.TokenComment { return i + 1 } } return 0 } // partitionLineEndTokens takes a sequence of tokens that is assumed // to immediately follow a construct that can have a line comment, and // returns first the index where any line comments end and then second // the index immediately after the trailing newline. // // Line comments are defined as comments that appear immediately after // a construct on the same line where its significant tokens ended. // // Since single-line comment tokens (# and //) include the newline that // terminates them, in the presence of these the two returned indices // will be the same since the comment itself serves as the line end. func partitionLineEndTokens(toks hclsyntax.Tokens) (afterComment, afterNewline int) { for i := 0; i < len(toks); i++ { tok := toks[i] if tok.Type != hclsyntax.TokenComment { switch tok.Type { case hclsyntax.TokenNewline: return i, i + 1 case hclsyntax.TokenEOF: // Although this is valid, we mustn't include the EOF // itself as our "newline" or else strange things will // happen when we try to append new items. return i, i default: // If we have well-formed input here then nothing else should be // possible. This path should never happen, because we only try // to extract tokens from the sequence if the parser succeeded, // and it should catch this problem itself. panic("malformed line trailers: expected only comments and newlines") } } if len(tok.Bytes) > 0 && tok.Bytes[len(tok.Bytes)-1] == '\n' { // Newline at the end of a single-line comment serves both as // the end of comments *and* the end of the line. return i + 1, i + 1 } } return len(toks), len(toks) } // lexConfig uses the hclsyntax scanner to get a token stream and then // rewrites it into this package's token model. // // Any errors produced during scanning are ignored, so the results of this // function should be used with care. func lexConfig(src []byte) Tokens { mainTokens, _ := hclsyntax.LexConfig(src, "", hcl.Pos{Byte: 0, Line: 1, Column: 1}) return writerTokens(mainTokens) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/public.go������������������������������0000664�0000000�0000000�00000002352�13771713062�0025524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "bytes" "github.com/hashicorp/hcl/v2" ) // NewFile creates a new file object that is empty and ready to have constructs // added t it. func NewFile() *File { body := &Body{ inTree: newInTree(), items: newNodeSet(), } file := &File{ inTree: newInTree(), } file.body = file.inTree.children.Append(body) return file } // ParseConfig interprets the given source bytes into a *hclwrite.File. The // resulting AST can be used to perform surgical edits on the source code // before turning it back into bytes again. func ParseConfig(src []byte, filename string, start hcl.Pos) (*File, hcl.Diagnostics) { return parse(src, filename, start) } // Format takes source code and performs simple whitespace changes to transform // it to a canonical layout style. // // Format skips constructing an AST and works directly with tokens, so it // is less expensive than formatting via the AST for situations where no other // changes will be made. It also ignores syntax errors and can thus be applied // to partial source code, although the result in that case may not be // desirable. func Format(src []byte) []byte { tokens := lexConfig(src) format(tokens) buf := &bytes.Buffer{} tokens.WriteTo(buf) return buf.Bytes() } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/hclwrite/tokens.go������������������������������0000664�0000000�0000000�00000006471�13771713062�0025557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclwrite import ( "bytes" "io" "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" ) // Token is a single sequence of bytes annotated with a type. It is similar // in purpose to hclsyntax.Token, but discards the source position information // since that is not useful in code generation. type Token struct { Type hclsyntax.TokenType Bytes []byte // We record the number of spaces before each token so that we can // reproduce the exact layout of the original file when we're making // surgical changes in-place. When _new_ code is created it will always // be in the canonical style, but we preserve layout of existing code. SpacesBefore int } // asHCLSyntax returns the receiver expressed as an incomplete hclsyntax.Token. // A complete token is not possible since we don't have source location // information here, and so this method is unexported so we can be sure it will // only be used for internal purposes where we know the range isn't important. // // This is primarily intended to allow us to re-use certain functionality from // hclsyntax rather than re-implementing it against our own token type here. func (t *Token) asHCLSyntax() hclsyntax.Token { return hclsyntax.Token{ Type: t.Type, Bytes: t.Bytes, Range: hcl.Range{ Filename: "<invalid>", }, } } // Tokens is a flat list of tokens. type Tokens []*Token func (ts Tokens) Bytes() []byte { buf := &bytes.Buffer{} ts.WriteTo(buf) return buf.Bytes() } func (ts Tokens) testValue() string { return string(ts.Bytes()) } // Columns returns the number of columns (grapheme clusters) the token sequence // occupies. The result is not meaningful if there are newline or single-line // comment tokens in the sequence. func (ts Tokens) Columns() int { ret := 0 for _, token := range ts { ret += token.SpacesBefore // spaces are always worth one column each ct, _ := textseg.TokenCount(token.Bytes, textseg.ScanGraphemeClusters) ret += ct } return ret } // WriteTo takes an io.Writer and writes the bytes for each token to it, // along with the spacing that separates each token. In other words, this // allows serializing the tokens to a file or other such byte stream. func (ts Tokens) WriteTo(wr io.Writer) (int64, error) { // We know we're going to be writing a lot of small chunks of repeated // space characters, so we'll prepare a buffer of these that we can // easily pass to wr.Write without any further allocation. spaces := make([]byte, 40) for i := range spaces { spaces[i] = ' ' } var n int64 var err error for _, token := range ts { if err != nil { return n, err } for spacesBefore := token.SpacesBefore; spacesBefore > 0; spacesBefore -= len(spaces) { thisChunk := spacesBefore if thisChunk > len(spaces) { thisChunk = len(spaces) } var thisN int thisN, err = wr.Write(spaces[:thisChunk]) n += int64(thisN) if err != nil { return n, err } } var thisN int thisN, err = wr.Write(token.Bytes) n += int64(thisN) } return n, err } func (ts Tokens) walkChildNodes(w internalWalkFunc) { // Unstructured tokens have no child nodes } func (ts Tokens) BuildTokens(to Tokens) Tokens { return append(to, ts...) } func newIdentToken(name string) *Token { return &Token{ Type: hclsyntax.TokenIdent, Bytes: []byte(name), } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/�������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023045�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/ast.go�������������������������������������0000664�0000000�0000000�00000004113�13771713062�0024162�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "math/big" "github.com/hashicorp/hcl/v2" ) type node interface { Range() hcl.Range StartRange() hcl.Range } type objectVal struct { Attrs []*objectAttr SrcRange hcl.Range // range of the entire object, brace-to-brace OpenRange hcl.Range // range of the opening brace CloseRange hcl.Range // range of the closing brace } func (n *objectVal) Range() hcl.Range { return n.SrcRange } func (n *objectVal) StartRange() hcl.Range { return n.OpenRange } type objectAttr struct { Name string Value node NameRange hcl.Range // range of the name string } func (n *objectAttr) Range() hcl.Range { return n.NameRange } func (n *objectAttr) StartRange() hcl.Range { return n.NameRange } type arrayVal struct { Values []node SrcRange hcl.Range // range of the entire object, bracket-to-bracket OpenRange hcl.Range // range of the opening bracket } func (n *arrayVal) Range() hcl.Range { return n.SrcRange } func (n *arrayVal) StartRange() hcl.Range { return n.OpenRange } type booleanVal struct { Value bool SrcRange hcl.Range } func (n *booleanVal) Range() hcl.Range { return n.SrcRange } func (n *booleanVal) StartRange() hcl.Range { return n.SrcRange } type numberVal struct { Value *big.Float SrcRange hcl.Range } func (n *numberVal) Range() hcl.Range { return n.SrcRange } func (n *numberVal) StartRange() hcl.Range { return n.SrcRange } type stringVal struct { Value string SrcRange hcl.Range } func (n *stringVal) Range() hcl.Range { return n.SrcRange } func (n *stringVal) StartRange() hcl.Range { return n.SrcRange } type nullVal struct { SrcRange hcl.Range } func (n *nullVal) Range() hcl.Range { return n.SrcRange } func (n *nullVal) StartRange() hcl.Range { return n.SrcRange } // invalidVal is used as a placeholder where a value is needed for a valid // parse tree but the input was invalid enough to prevent one from being // created. type invalidVal struct { SrcRange hcl.Range } func (n invalidVal) Range() hcl.Range { return n.SrcRange } func (n invalidVal) StartRange() hcl.Range { return n.SrcRange } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/didyoumean.go������������������������������0000664�0000000�0000000�00000002145�13771713062�0025534�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "github.com/agext/levenshtein" ) var keywords = []string{"false", "true", "null"} // keywordSuggestion tries to find a valid JSON keyword that is close to the // given string and returns it if found. If no keyword is close enough, returns // the empty string. func keywordSuggestion(given string) string { return nameSuggestion(given, keywords) } // nameSuggestion tries to find a name from the given slice of suggested names // that is close to the given name and returns it if found. If no suggestion // is close enough, returns the empty string. // // The suggestions are tried in order, so earlier suggestions take precedence // if the given string is similar to two or more suggestions. // // This function is intended to be used with a relatively-small number of // suggestions. It's not optimized for hundreds or thousands of them. func nameSuggestion(given string, suggestions []string) string { for _, suggestion := range suggestions { dist := levenshtein.Distance(given, suggestion, nil) if dist < 3 { // threshold determined experimentally return suggestion } } return "" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/doc.go�������������������������������������0000664�0000000�0000000�00000001113�13771713062�0024135�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package json is the JSON parser for HCL. It parses JSON files and returns // implementations of the core HCL structural interfaces in terms of the // JSON data inside. // // This is not a generic JSON parser. Instead, it deals with the mapping from // the JSON information model to the HCL information model, using a number // of hard-coded structural conventions. // // In most cases applications will not import this package directly, but will // instead access its functionality indirectly through functions in the main // "hcl" package and in the "hclparse" package. package json �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/navigation.go������������������������������0000664�0000000�0000000�00000002551�13771713062�0025536�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "fmt" "strings" ) type navigation struct { root node } // Implementation of hcled.ContextString func (n navigation) ContextString(offset int) string { steps := navigationStepsRev(n.root, offset) if steps == nil { return "" } // We built our slice backwards, so we'll reverse it in-place now. half := len(steps) / 2 // integer division for i := 0; i < half; i++ { steps[i], steps[len(steps)-1-i] = steps[len(steps)-1-i], steps[i] } ret := strings.Join(steps, "") if len(ret) > 0 && ret[0] == '.' { ret = ret[1:] } return ret } func navigationStepsRev(v node, offset int) []string { switch tv := v.(type) { case *objectVal: // Do any of our properties have an object that contains the target // offset? for _, attr := range tv.Attrs { k := attr.Name av := attr.Value switch av.(type) { case *objectVal, *arrayVal: // okay default: continue } if av.Range().ContainsOffset(offset) { return append(navigationStepsRev(av, offset), "."+k) } } case *arrayVal: // Do any of our elements contain the target offset? for i, elem := range tv.Values { switch elem.(type) { case *objectVal, *arrayVal: // okay default: continue } if elem.Range().ContainsOffset(offset) { return append(navigationStepsRev(elem, offset), fmt.Sprintf("[%d]", i)) } } } return nil } �������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/parser.go����������������������������������0000664�0000000�0000000�00000030331�13771713062�0024670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "encoding/json" "fmt" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) func parseFileContent(buf []byte, filename string) (node, hcl.Diagnostics) { tokens := scan(buf, pos{ Filename: filename, Pos: hcl.Pos{ Byte: 0, Line: 1, Column: 1, }, }) p := newPeeker(tokens) node, diags := parseValue(p) if len(diags) == 0 && p.Peek().Type != tokenEOF { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Extraneous data after value", Detail: "Extra characters appear after the JSON value.", Subject: p.Peek().Range.Ptr(), }) } return node, diags } func parseValue(p *peeker) (node, hcl.Diagnostics) { tok := p.Peek() wrapInvalid := func(n node, diags hcl.Diagnostics) (node, hcl.Diagnostics) { if n != nil { return n, diags } return invalidVal{tok.Range}, diags } switch tok.Type { case tokenBraceO: return wrapInvalid(parseObject(p)) case tokenBrackO: return wrapInvalid(parseArray(p)) case tokenNumber: return wrapInvalid(parseNumber(p)) case tokenString: return wrapInvalid(parseString(p)) case tokenKeyword: return wrapInvalid(parseKeyword(p)) case tokenBraceC: return wrapInvalid(nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Missing JSON value", Detail: "A JSON value must start with a brace, a bracket, a number, a string, or a keyword.", Subject: &tok.Range, }, }) case tokenBrackC: return wrapInvalid(nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Missing array element value", Detail: "A JSON value must start with a brace, a bracket, a number, a string, or a keyword.", Subject: &tok.Range, }, }) case tokenEOF: return wrapInvalid(nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Missing value", Detail: "The JSON data ends prematurely.", Subject: &tok.Range, }, }) default: return wrapInvalid(nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid start of value", Detail: "A JSON value must start with a brace, a bracket, a number, a string, or a keyword.", Subject: &tok.Range, }, }) } } func tokenCanStartValue(tok token) bool { switch tok.Type { case tokenBraceO, tokenBrackO, tokenNumber, tokenString, tokenKeyword: return true default: return false } } func parseObject(p *peeker) (node, hcl.Diagnostics) { var diags hcl.Diagnostics open := p.Read() attrs := []*objectAttr{} // recover is used to shift the peeker to what seems to be the end of // our object, so that when we encounter an error we leave the peeker // at a reasonable point in the token stream to continue parsing. recover := func(tok token) { open := 1 for { switch tok.Type { case tokenBraceO: open++ case tokenBraceC: open-- if open <= 1 { return } case tokenEOF: // Ran out of source before we were able to recover, // so we'll bail here and let the caller deal with it. return } tok = p.Read() } } Token: for { if p.Peek().Type == tokenBraceC { break Token } keyNode, keyDiags := parseValue(p) diags = diags.Extend(keyDiags) if keyNode == nil { return nil, diags } keyStrNode, ok := keyNode.(*stringVal) if !ok { return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid object property name", Detail: "A JSON object property name must be a string", Subject: keyNode.StartRange().Ptr(), }) } key := keyStrNode.Value colon := p.Read() if colon.Type != tokenColon { recover(colon) if colon.Type == tokenBraceC || colon.Type == tokenComma { // Catch common mistake of using braces instead of brackets // for an object. return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing object value", Detail: "A JSON object attribute must have a value, introduced by a colon.", Subject: &colon.Range, }) } if colon.Type == tokenEquals { // Possible confusion with native HCL syntax. return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing property value colon", Detail: "JSON uses a colon as its name/value delimiter, not an equals sign.", Subject: &colon.Range, }) } return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing property value colon", Detail: "A colon must appear between an object property's name and its value.", Subject: &colon.Range, }) } valNode, valDiags := parseValue(p) diags = diags.Extend(valDiags) if valNode == nil { return nil, diags } attrs = append(attrs, &objectAttr{ Name: key, Value: valNode, NameRange: keyStrNode.SrcRange, }) switch p.Peek().Type { case tokenComma: comma := p.Read() if p.Peek().Type == tokenBraceC { // Special error message for this common mistake return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Trailing comma in object", Detail: "JSON does not permit a trailing comma after the final property in an object.", Subject: &comma.Range, }) } continue Token case tokenEOF: return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unclosed object", Detail: "No closing brace was found for this JSON object.", Subject: &open.Range, }) case tokenBrackC: // Consume the bracket anyway, so that we don't return with the peeker // at a strange place. p.Read() return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Mismatched braces", Detail: "A JSON object must be closed with a brace, not a bracket.", Subject: p.Peek().Range.Ptr(), }) case tokenBraceC: break Token default: recover(p.Read()) return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing attribute seperator comma", Detail: "A comma must appear between each property definition in an object.", Subject: p.Peek().Range.Ptr(), }) } } close := p.Read() return &objectVal{ Attrs: attrs, SrcRange: hcl.RangeBetween(open.Range, close.Range), OpenRange: open.Range, CloseRange: close.Range, }, diags } func parseArray(p *peeker) (node, hcl.Diagnostics) { var diags hcl.Diagnostics open := p.Read() vals := []node{} // recover is used to shift the peeker to what seems to be the end of // our array, so that when we encounter an error we leave the peeker // at a reasonable point in the token stream to continue parsing. recover := func(tok token) { open := 1 for { switch tok.Type { case tokenBrackO: open++ case tokenBrackC: open-- if open <= 1 { return } case tokenEOF: // Ran out of source before we were able to recover, // so we'll bail here and let the caller deal with it. return } tok = p.Read() } } Token: for { if p.Peek().Type == tokenBrackC { break Token } valNode, valDiags := parseValue(p) diags = diags.Extend(valDiags) if valNode == nil { return nil, diags } vals = append(vals, valNode) switch p.Peek().Type { case tokenComma: comma := p.Read() if p.Peek().Type == tokenBrackC { // Special error message for this common mistake return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Trailing comma in array", Detail: "JSON does not permit a trailing comma after the final value in an array.", Subject: &comma.Range, }) } continue Token case tokenColon: recover(p.Read()) return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid array value", Detail: "A colon is not used to introduce values in a JSON array.", Subject: p.Peek().Range.Ptr(), }) case tokenEOF: recover(p.Read()) return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Unclosed object", Detail: "No closing bracket was found for this JSON array.", Subject: &open.Range, }) case tokenBraceC: recover(p.Read()) return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Mismatched brackets", Detail: "A JSON array must be closed with a bracket, not a brace.", Subject: p.Peek().Range.Ptr(), }) case tokenBrackC: break Token default: recover(p.Read()) return nil, diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing attribute seperator comma", Detail: "A comma must appear between each value in an array.", Subject: p.Peek().Range.Ptr(), }) } } close := p.Read() return &arrayVal{ Values: vals, SrcRange: hcl.RangeBetween(open.Range, close.Range), OpenRange: open.Range, }, diags } func parseNumber(p *peeker) (node, hcl.Diagnostics) { tok := p.Read() // Use encoding/json to validate the number syntax. // TODO: Do this more directly to produce better diagnostics. var num json.Number err := json.Unmarshal(tok.Bytes, &num) if err != nil { return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid JSON number", Detail: fmt.Sprintf("There is a syntax error in the given JSON number."), Subject: &tok.Range, }, } } // We want to guarantee that we parse numbers the same way as cty (and thus // native syntax HCL) would here, so we'll use the cty parser even though // in most other cases we don't actually introduce cty concepts until // decoding time. We'll unwrap the parsed float immediately afterwards, so // the cty value is just a temporary helper. nv, err := cty.ParseNumberVal(string(num)) if err != nil { // Should never happen if above passed, since JSON numbers are a subset // of what cty can parse... return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid JSON number", Detail: fmt.Sprintf("There is a syntax error in the given JSON number."), Subject: &tok.Range, }, } } return &numberVal{ Value: nv.AsBigFloat(), SrcRange: tok.Range, }, nil } func parseString(p *peeker) (node, hcl.Diagnostics) { tok := p.Read() var str string err := json.Unmarshal(tok.Bytes, &str) if err != nil { var errRange hcl.Range if serr, ok := err.(*json.SyntaxError); ok { errOfs := serr.Offset errPos := tok.Range.Start errPos.Byte += int(errOfs) // TODO: Use the byte offset to properly count unicode // characters for the column, and mark the whole of the // character that was wrong as part of our range. errPos.Column += int(errOfs) errEndPos := errPos errEndPos.Byte++ errEndPos.Column++ errRange = hcl.Range{ Filename: tok.Range.Filename, Start: errPos, End: errEndPos, } } else { errRange = tok.Range } var contextRange *hcl.Range if errRange != tok.Range { contextRange = &tok.Range } // FIXME: Eventually we should parse strings directly here so // we can produce a more useful error message in the face fo things // such as invalid escapes, etc. return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid JSON string", Detail: fmt.Sprintf("There is a syntax error in the given JSON string."), Subject: &errRange, Context: contextRange, }, } } return &stringVal{ Value: str, SrcRange: tok.Range, }, nil } func parseKeyword(p *peeker) (node, hcl.Diagnostics) { tok := p.Read() s := string(tok.Bytes) switch s { case "true": return &booleanVal{ Value: true, SrcRange: tok.Range, }, nil case "false": return &booleanVal{ Value: false, SrcRange: tok.Range, }, nil case "null": return &nullVal{ SrcRange: tok.Range, }, nil case "undefined", "NaN", "Infinity": return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid JSON keyword", Detail: fmt.Sprintf("The JavaScript identifier %q cannot be used in JSON.", s), Subject: &tok.Range, }, } default: var dym string if suggest := keywordSuggestion(s); suggest != "" { dym = fmt.Sprintf(" Did you mean %q?", suggest) } return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Invalid JSON keyword", Detail: fmt.Sprintf("%q is not a valid JSON keyword.%s", s, dym), Subject: &tok.Range, }, } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/peeker.go����������������������������������0000664�0000000�0000000�00000000512�13771713062�0024645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json type peeker struct { tokens []token pos int } func newPeeker(tokens []token) *peeker { return &peeker{ tokens: tokens, pos: 0, } } func (p *peeker) Peek() token { return p.tokens[p.pos] } func (p *peeker) Read() token { ret := p.tokens[p.pos] if ret.Type != tokenEOF { p.pos++ } return ret } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/public.go����������������������������������0000664�0000000�0000000�00000005020�13771713062�0024647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "fmt" "io/ioutil" "os" "github.com/hashicorp/hcl/v2" ) // Parse attempts to parse the given buffer as JSON and, if successful, returns // a hcl.File for the HCL configuration represented by it. // // This is not a generic JSON parser. Instead, it deals only with the profile // of JSON used to express HCL configuration. // // The returned file is valid only if the returned diagnostics returns false // from its HasErrors method. If HasErrors returns true, the file represents // the subset of data that was able to be parsed, which may be none. func Parse(src []byte, filename string) (*hcl.File, hcl.Diagnostics) { rootNode, diags := parseFileContent(src, filename) switch rootNode.(type) { case *objectVal, *arrayVal: // okay default: diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Root value must be object", Detail: "The root value in a JSON-based configuration must be either a JSON object or a JSON array of objects.", Subject: rootNode.StartRange().Ptr(), }) // Since we've already produced an error message for this being // invalid, we'll return an empty placeholder here so that trying to // extract content from our root body won't produce a redundant // error saying the same thing again in more general terms. fakePos := hcl.Pos{ Byte: 0, Line: 1, Column: 1, } fakeRange := hcl.Range{ Filename: filename, Start: fakePos, End: fakePos, } rootNode = &objectVal{ Attrs: []*objectAttr{}, SrcRange: fakeRange, OpenRange: fakeRange, } } file := &hcl.File{ Body: &body{ val: rootNode, }, Bytes: src, Nav: navigation{rootNode}, } return file, diags } // ParseFile is a convenience wrapper around Parse that first attempts to load // data from the given filename, passing the result to Parse if successful. // // If the file cannot be read, an error diagnostic with nil context is returned. func ParseFile(filename string) (*hcl.File, hcl.Diagnostics) { f, err := os.Open(filename) if err != nil { return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Failed to open file", Detail: fmt.Sprintf("The file %q could not be opened.", filename), }, } } defer f.Close() src, err := ioutil.ReadAll(f) if err != nil { return nil, hcl.Diagnostics{ { Severity: hcl.DiagError, Summary: "Failed to read file", Detail: fmt.Sprintf("The file %q was opened, but an error occured while reading it.", filename), }, } } return Parse(src, filename) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/scanner.go���������������������������������0000664�0000000�0000000�00000016621�13771713062�0025033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "fmt" "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" ) //go:generate stringer -type tokenType scanner.go type tokenType rune const ( tokenBraceO tokenType = '{' tokenBraceC tokenType = '}' tokenBrackO tokenType = '[' tokenBrackC tokenType = ']' tokenComma tokenType = ',' tokenColon tokenType = ':' tokenKeyword tokenType = 'K' tokenString tokenType = 'S' tokenNumber tokenType = 'N' tokenEOF tokenType = '␄' tokenInvalid tokenType = 0 tokenEquals tokenType = '=' // used only for reminding the user of JSON syntax ) type token struct { Type tokenType Bytes []byte Range hcl.Range } // scan returns the primary tokens for the given JSON buffer in sequence. // // The responsibility of this pass is to just mark the slices of the buffer // as being of various types. It is lax in how it interprets the multi-byte // token types keyword, string and number, preferring to capture erroneous // extra bytes that we presume the user intended to be part of the token // so that we can generate more helpful diagnostics in the parser. func scan(buf []byte, start pos) []token { var tokens []token p := start for { if len(buf) == 0 { tokens = append(tokens, token{ Type: tokenEOF, Bytes: nil, Range: posRange(p, p), }) return tokens } buf, p = skipWhitespace(buf, p) if len(buf) == 0 { tokens = append(tokens, token{ Type: tokenEOF, Bytes: nil, Range: posRange(p, p), }) return tokens } start = p first := buf[0] switch { case first == '{' || first == '}' || first == '[' || first == ']' || first == ',' || first == ':' || first == '=': p.Pos.Column++ p.Pos.Byte++ tokens = append(tokens, token{ Type: tokenType(first), Bytes: buf[0:1], Range: posRange(start, p), }) buf = buf[1:] case first == '"': var tokBuf []byte tokBuf, buf, p = scanString(buf, p) tokens = append(tokens, token{ Type: tokenString, Bytes: tokBuf, Range: posRange(start, p), }) case byteCanStartNumber(first): var tokBuf []byte tokBuf, buf, p = scanNumber(buf, p) tokens = append(tokens, token{ Type: tokenNumber, Bytes: tokBuf, Range: posRange(start, p), }) case byteCanStartKeyword(first): var tokBuf []byte tokBuf, buf, p = scanKeyword(buf, p) tokens = append(tokens, token{ Type: tokenKeyword, Bytes: tokBuf, Range: posRange(start, p), }) default: tokens = append(tokens, token{ Type: tokenInvalid, Bytes: buf[:1], Range: start.Range(1, 1), }) // If we've encountered an invalid then we might as well stop // scanning since the parser won't proceed beyond this point. // We insert a synthetic EOF marker here to match the expectations // of consumers of this data structure. p.Pos.Column++ p.Pos.Byte++ tokens = append(tokens, token{ Type: tokenEOF, Bytes: nil, Range: posRange(p, p), }) return tokens } } } func byteCanStartNumber(b byte) bool { switch b { // We are slightly more tolerant than JSON requires here since we // expect the parser will make a stricter interpretation of the // number bytes, but we specifically don't allow 'e' or 'E' here // since we want the scanner to treat that as the start of an // invalid keyword instead, to produce more intelligible error messages. case '-', '+', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': return true default: return false } } func scanNumber(buf []byte, start pos) ([]byte, []byte, pos) { // The scanner doesn't check that the sequence of digit-ish bytes is // in a valid order. The parser must do this when decoding a number // token. var i int p := start Byte: for i = 0; i < len(buf); i++ { switch buf[i] { case '-', '+', '.', 'e', 'E', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': p.Pos.Byte++ p.Pos.Column++ default: break Byte } } return buf[:i], buf[i:], p } func byteCanStartKeyword(b byte) bool { switch { // We allow any sequence of alphabetical characters here, even though // JSON is more constrained, so that we can collect what we presume // the user intended to be a single keyword and then check its validity // in the parser, where we can generate better diagnostics. // So e.g. we want to be able to say: // unrecognized keyword "True". Did you mean "true"? case isAlphabetical(b): return true default: return false } } func scanKeyword(buf []byte, start pos) ([]byte, []byte, pos) { var i int p := start Byte: for i = 0; i < len(buf); i++ { b := buf[i] switch { case isAlphabetical(b) || b == '_': p.Pos.Byte++ p.Pos.Column++ default: break Byte } } return buf[:i], buf[i:], p } func scanString(buf []byte, start pos) ([]byte, []byte, pos) { // The scanner doesn't validate correct use of escapes, etc. It pays // attention to escapes only for the purpose of identifying the closing // quote character. It's the parser's responsibility to do proper // validation. // // The scanner also doesn't specifically detect unterminated string // literals, though they can be identified in the parser by checking if // the final byte in a string token is the double-quote character. // Skip the opening quote symbol i := 1 p := start p.Pos.Byte++ p.Pos.Column++ escaping := false Byte: for i < len(buf) { b := buf[i] switch { case b == '\\': escaping = !escaping p.Pos.Byte++ p.Pos.Column++ i++ case b == '"': p.Pos.Byte++ p.Pos.Column++ i++ if !escaping { break Byte } escaping = false case b < 32: break Byte default: // Advance by one grapheme cluster, so that we consider each // grapheme to be a "column". // Ignoring error because this scanner cannot produce errors. advance, _, _ := textseg.ScanGraphemeClusters(buf[i:], true) p.Pos.Byte += advance p.Pos.Column++ i += advance escaping = false } } return buf[:i], buf[i:], p } func skipWhitespace(buf []byte, start pos) ([]byte, pos) { var i int p := start Byte: for i = 0; i < len(buf); i++ { switch buf[i] { case ' ': p.Pos.Byte++ p.Pos.Column++ case '\n': p.Pos.Byte++ p.Pos.Column = 1 p.Pos.Line++ case '\r': // For the purpose of line/column counting we consider a // carriage return to take up no space, assuming that it will // be paired up with a newline (on Windows, for example) that // will account for both of them. p.Pos.Byte++ case '\t': // We arbitrarily count a tab as if it were two spaces, because // we need to choose _some_ number here. This means any system // that renders code on-screen with markers must itself treat // tabs as a pair of spaces for rendering purposes, or instead // use the byte offset and back into its own column position. p.Pos.Byte++ p.Pos.Column += 2 default: break Byte } } return buf[i:], p } type pos struct { Filename string Pos hcl.Pos } func (p *pos) Range(byteLen, charLen int) hcl.Range { start := p.Pos end := p.Pos end.Byte += byteLen end.Column += charLen return hcl.Range{ Filename: p.Filename, Start: start, End: end, } } func posRange(start, end pos) hcl.Range { return hcl.Range{ Filename: start.Filename, Start: start.Pos, End: end.Pos, } } func (t token) GoString() string { return fmt.Sprintf("json.token{json.%s, []byte(%q), %#v}", t.Type, t.Bytes, t.Range) } func isAlphabetical(b byte) bool { return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') } ���������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/spec.md������������������������������������0000664�0000000�0000000�00000032551�13771713062�0024327�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL JSON Syntax Specification This is the specification for the JSON serialization for hcl. HCL is a system for defining configuration languages for applications. The HCL information model is designed to support multiple concrete syntaxes for configuration, and this JSON-based format complements [the native syntax](../hclsyntax/spec.md) by being easy to machine-generate, whereas the native syntax is oriented towards human authoring and maintenance This syntax is defined in terms of JSON as defined in [RFC7159](https://tools.ietf.org/html/rfc7159). As such it inherits the JSON grammar as-is, and merely defines a specific methodology for interpreting JSON constructs into HCL structural elements and expressions. This mapping is defined such that valid JSON-serialized HCL input can be _produced_ using standard JSON implementations in various programming languages. _Parsing_ such JSON has some additional constraints not beyond what is normally supported by JSON parsers, so a specialized parser may be required that is able to: - Preserve the relative ordering of properties defined in an object. - Preserve multiple definitions of the same property name. - Preserve numeric values to the precision required by the number type in [the HCL syntax-agnostic information model](../spec.md). - Retain source location information for parsed tokens/constructs in order to produce good error messages. ## Structural Elements [The HCL syntax-agnostic information model](../spec.md) defines a _body_ as an abstract container for attribute definitions and child blocks. A body is represented in JSON as either a single JSON object or a JSON array of objects. Body processing is in terms of JSON object properties, visited in the order they appear in the input. Where a body is represented by a single JSON object, the properties of that object are visited in order. Where a body is represented by a JSON array, each of its elements are visited in order and each element has its properties visited in order. If any element of the array is not a JSON object then the input is erroneous. When a body is being processed in the _dynamic attributes_ mode, the allowance of a JSON array in the previous paragraph does not apply and instead a single JSON object is always required. As defined in the language-agnostic model, body processing is in terms of a schema which provides context for interpreting the body's content. For JSON bodies, the schema is crucial to allow differentiation of attribute definitions and block definitions, both of which are represented via object properties. The special property name `"//"`, when used in an object representing a HCL body, is parsed and ignored. A property with this name can be used to include human-readable comments. (This special property name is _not_ processed in this way for any _other_ HCL constructs that are represented as JSON objects.) ### Attributes Where the given schema describes an attribute with a given name, the object property with the matching name — if present — serves as the attribute's definition. When a body is being processed in the _dynamic attributes_ mode, each object property serves as an attribute definition for the attribute whose name matches the property name. The value of an attribute definition property is interpreted as an _expression_, as described in a later section. Given a schema that calls for an attribute named "foo", a JSON object like the following provides a definition for that attribute: ```json { "foo": "bar baz" } ``` ### Blocks Where the given schema describes a block with a given type name, each object property with the matching name serves as a definition of zero or more blocks of that type. Processing of child blocks is in terms of nested JSON objects and arrays. If the schema defines one or more _labels_ for the block type, a nested JSON object or JSON array of objects is required for each labelling level. These are flattened to a single ordered sequence of object properties using the same algorithm as for body content as defined above. Each object property serves as a label value at the corresponding level. After any labelling levels, the next nested value is either a JSON object representing a single block body, or a JSON array of JSON objects that each represent a single block body. Use of an array accommodates the definition of multiple blocks that have identical type and labels. Given a schema that calls for a block type named "foo" with no labels, the following JSON objects are all valid definitions of zero or more blocks of this type: ```json { "foo": { "child_attr": "baz" } } ``` ```json { "foo": [ { "child_attr": "baz" }, { "child_attr": "boz" } ] } ``` ```json { "foo": [] } ``` The first of these defines a single child block of type "foo". The second defines _two_ such blocks. The final example shows a degenerate definition of zero blocks, though generators should prefer to omit the property entirely in this scenario. Given a schema that calls for a block type named "foo" with _two_ labels, the extra label levels must be represented as objects or arrays of objects as in the following examples: ```json { "foo": { "bar": { "baz": { "child_attr": "baz" }, "boz": { "child_attr": "baz" } }, "boz": { "baz": { "child_attr": "baz" } } } } ``` ```json { "foo": { "bar": { "baz": { "child_attr": "baz" }, "boz": { "child_attr": "baz" } }, "boz": { "baz": [ { "child_attr": "baz" }, { "child_attr": "boz" } ] } } } ``` ```json { "foo": [ { "bar": { "baz": { "child_attr": "baz" }, "boz": { "child_attr": "baz" } } }, { "bar": { "baz": [ { "child_attr": "baz" }, { "child_attr": "boz" } ] } } ] } ``` ```json { "foo": { "bar": { "baz": { "child_attr": "baz" }, "boz": { "child_attr": "baz" } }, "bar": { "baz": [ { "child_attr": "baz" }, { "child_attr": "boz" } ] } } } ``` Arrays can be introduced at either the label definition or block body definition levels to define multiple definitions of the same block type or labels while preserving order. A JSON HCL parser _must_ support duplicate definitions of the same property name within a single object, preserving all of them and the relative ordering between them. The array-based forms are also required so that JSON HCL configurations can be produced with JSON producing libraries that are not able to preserve property definition order and multiple definitions of the same property. ## Expressions JSON lacks a native expression syntax, so the HCL JSON syntax instead defines a mapping for each of the JSON value types, including a special mapping for strings that allows optional use of arbitrary expressions. ### Objects When interpreted as an expression, a JSON object represents a value of a HCL object type. Each property of the JSON object represents an attribute of the HCL object type. The property name string given in the JSON input is interpreted as a string expression as described below, and its result is converted to string as defined by the syntax-agnostic information model. If such a conversion is not possible, an error is produced and evaluation fails. An instance of the constructed object type is then created, whose values are interpreted by again recursively applying the mapping rules defined in this section to each of the property values. If any evaluated property name strings produce null values, an error is produced and evaluation fails. If any produce _unknown_ values, the _entire object's_ result is an unknown value of the dynamic pseudo-type, signalling that the type of the object cannot be determined. It is an error to define the same property name multiple times within a single JSON object interpreted as an expression. In full expression mode, this constraint applies to the name expression results after conversion to string, rather than the raw string that may contain interpolation expressions. ### Arrays When interpreted as an expression, a JSON array represents a value of a HCL tuple type. Each element of the JSON array represents an element of the HCL tuple type. The tuple type is constructed by enumerating the JSON array elements, creating for each an element whose type is the result of recursively applying the expression mapping rules. Correspondence is preserved between the array element indices and the tuple element indices. An instance of the constructed tuple type is then created, whose values are interpreted by again recursively applying the mapping rules defined in this section. ### Numbers When interpreted as an expression, a JSON number represents a HCL number value. HCL numbers are arbitrary-precision decimal values, so a JSON HCL parser must be able to translate exactly the value given to a number of corresponding precision, within the constraints set by the HCL syntax-agnostic information model. In practice, off-the-shelf JSON serializers often do not support customizing the processing of numbers, and instead force processing as 32-bit or 64-bit floating point values. A _producer_ of JSON HCL that uses such a serializer can provide numeric values as JSON strings where they have precision too great for representation in the serializer's chosen numeric type in situations where the result will be converted to number (using the standard conversion rules) by a calling application. Alternatively, for expressions that are evaluated in full expression mode an embedded template interpolation can be used to faithfully represent a number, such as `"${1e150}"`, which will then be evaluated by the underlying HCL native syntax expression evaluator. ### Boolean Values The JSON boolean values `true` and `false`, when interpreted as expressions, represent the corresponding HCL boolean values. ### The Null Value The JSON value `null`, when interpreted as an expression, represents a HCL null value of the dynamic pseudo-type. ### Strings When interpreted as an expression, a JSON string may be interpreted in one of two ways depending on the evaluation mode. If evaluating in literal-only mode (as defined by the syntax-agnostic information model) the literal string is intepreted directly as a HCL string value, by directly using the exact sequence of unicode characters represented. Template interpolations and directives MUST NOT be processed in this mode, allowing any characters that appear as introduction sequences to pass through literally: ```json "Hello world! Template sequences like ${ are not intepreted here." ``` When evaluating in full expression mode (again, as defined by the syntax- agnostic information model) the literal string is instead interpreted as a _standalone template_ in the HCL Native Syntax. The expression evaluation result is then the direct result of evaluating that template with the current variable scope and function table. ```json "Hello, ${name}! Template sequences are interpreted in full expression mode." ``` In particular the _Template Interpolation Unwrapping_ requirement from the HCL native syntax specification must be implemented, allowing the use of single-interpolation templates to represent expressions that would not otherwise be representable in JSON, such as the following example where the result must be a number, rather than a string representation of a number: ```json "${ a + b }" ``` ## Static Analysis The HCL static analysis operations are implemented for JSON values that represent expressions, as described in the following sections. Due to the limited expressive power of the JSON syntax alone, use of these static analyses functions rather than normal expression evaluation is used as additional context for how a JSON value is to be interpreted, which means that static analyses can result in a different interpretation of a given expression than normal evaluation. ### Static List An expression interpreted as a static list must be a JSON array. Each of the values in the array is interpreted as an expression and returned. ### Static Map An expression interpreted as a static map must be a JSON object. Each of the key/value pairs in the object is presented as a pair of expressions. Since object property names are always strings, evaluating the key expression with a non-`nil` evaluation context will evaluate any template sequences given in the property name. ### Static Call An expression interpreted as a static call must be a string. The content of the string is interpreted as a native syntax expression (not a _template_, unlike normal evaluation) and then the static call analysis is delegated to that expression. If the original expression is not a string or its contents cannot be parsed as a native syntax expression then static call analysis is not supported. ### Static Traversal An expression interpreted as a static traversal must be a string. The content of the string is interpreted as a native syntax expression (not a _template_, unlike normal evaluation) and then static traversal analysis is delegated to that expression. If the original expression is not a string or its contents cannot be parsed as a native syntax expression then static call analysis is not supported. �������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/structure.go�������������������������������0000664�0000000�0000000�00000044775�13771713062�0025455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package json import ( "fmt" "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) // body is the implementation of "Body" used for files processed with the JSON // parser. type body struct { val node // If non-nil, the keys of this map cause the corresponding attributes to // be treated as non-existing. This is used when Body.PartialContent is // called, to produce the "remaining content" Body. hiddenAttrs map[string]struct{} } // expression is the implementation of "Expression" used for files processed // with the JSON parser. type expression struct { src node } func (b *body) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { content, newBody, diags := b.PartialContent(schema) hiddenAttrs := newBody.(*body).hiddenAttrs var nameSuggestions []string for _, attrS := range schema.Attributes { if _, ok := hiddenAttrs[attrS.Name]; !ok { // Only suggest an attribute name if we didn't use it already. nameSuggestions = append(nameSuggestions, attrS.Name) } } for _, blockS := range schema.Blocks { // Blocks can appear multiple times, so we'll suggest their type // names regardless of whether they've already been used. nameSuggestions = append(nameSuggestions, blockS.Type) } jsonAttrs, attrDiags := b.collectDeepAttrs(b.val, nil) diags = append(diags, attrDiags...) for _, attr := range jsonAttrs { k := attr.Name if k == "//" { // Ignore "//" keys in objects representing bodies, to allow // their use as comments. continue } if _, ok := hiddenAttrs[k]; !ok { suggestion := nameSuggestion(k, nameSuggestions) if suggestion != "" { suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) } diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Extraneous JSON object property", Detail: fmt.Sprintf("No argument or block type is named %q.%s", k, suggestion), Subject: &attr.NameRange, Context: attr.Range().Ptr(), }) } } return content, diags } func (b *body) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) { var diags hcl.Diagnostics jsonAttrs, attrDiags := b.collectDeepAttrs(b.val, nil) diags = append(diags, attrDiags...) usedNames := map[string]struct{}{} if b.hiddenAttrs != nil { for k := range b.hiddenAttrs { usedNames[k] = struct{}{} } } content := &hcl.BodyContent{ Attributes: map[string]*hcl.Attribute{}, Blocks: nil, MissingItemRange: b.MissingItemRange(), } // Create some more convenient data structures for our work below. attrSchemas := map[string]hcl.AttributeSchema{} blockSchemas := map[string]hcl.BlockHeaderSchema{} for _, attrS := range schema.Attributes { attrSchemas[attrS.Name] = attrS } for _, blockS := range schema.Blocks { blockSchemas[blockS.Type] = blockS } for _, jsonAttr := range jsonAttrs { attrName := jsonAttr.Name if _, used := b.hiddenAttrs[attrName]; used { continue } if attrS, defined := attrSchemas[attrName]; defined { if existing, exists := content.Attributes[attrName]; exists { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Duplicate argument", Detail: fmt.Sprintf("The argument %q was already set at %s.", attrName, existing.Range), Subject: &jsonAttr.NameRange, Context: jsonAttr.Range().Ptr(), }) continue } content.Attributes[attrS.Name] = &hcl.Attribute{ Name: attrS.Name, Expr: &expression{src: jsonAttr.Value}, Range: hcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()), NameRange: jsonAttr.NameRange, } usedNames[attrName] = struct{}{} } else if blockS, defined := blockSchemas[attrName]; defined { bv := jsonAttr.Value blockDiags := b.unpackBlock(bv, blockS.Type, &jsonAttr.NameRange, blockS.LabelNames, nil, nil, &content.Blocks) diags = append(diags, blockDiags...) usedNames[attrName] = struct{}{} } // We ignore anything that isn't defined because that's the // PartialContent contract. The Content method will catch leftovers. } // Make sure we got all the required attributes. for _, attrS := range schema.Attributes { if !attrS.Required { continue } if _, defined := content.Attributes[attrS.Name]; !defined { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing required argument", Detail: fmt.Sprintf("The argument %q is required, but no definition was found.", attrS.Name), Subject: b.MissingItemRange().Ptr(), }) } } unusedBody := &body{ val: b.val, hiddenAttrs: usedNames, } return content, unusedBody, diags } // JustAttributes for JSON bodies interprets all properties of the wrapped // JSON object as attributes and returns them. func (b *body) JustAttributes() (hcl.Attributes, hcl.Diagnostics) { var diags hcl.Diagnostics attrs := make(map[string]*hcl.Attribute) obj, ok := b.val.(*objectVal) if !ok { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect JSON value type", Detail: "A JSON object is required here, setting the arguments for this block.", Subject: b.val.StartRange().Ptr(), }) return attrs, diags } for _, jsonAttr := range obj.Attrs { name := jsonAttr.Name if name == "//" { // Ignore "//" keys in objects representing bodies, to allow // their use as comments. continue } if _, hidden := b.hiddenAttrs[name]; hidden { continue } if existing, exists := attrs[name]; exists { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Duplicate attribute definition", Detail: fmt.Sprintf("The argument %q was already set at %s.", name, existing.Range), Subject: &jsonAttr.NameRange, }) continue } attrs[name] = &hcl.Attribute{ Name: name, Expr: &expression{src: jsonAttr.Value}, Range: hcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()), NameRange: jsonAttr.NameRange, } } // No diagnostics possible here, since the parser already took care of // finding duplicates and every JSON value can be a valid attribute value. return attrs, diags } func (b *body) MissingItemRange() hcl.Range { switch tv := b.val.(type) { case *objectVal: return tv.CloseRange case *arrayVal: return tv.OpenRange default: // Should not happen in correct operation, but might show up if the // input is invalid and we are producing partial results. return tv.StartRange() } } func (b *body) unpackBlock(v node, typeName string, typeRange *hcl.Range, labelsLeft []string, labelsUsed []string, labelRanges []hcl.Range, blocks *hcl.Blocks) (diags hcl.Diagnostics) { if len(labelsLeft) > 0 { labelName := labelsLeft[0] jsonAttrs, attrDiags := b.collectDeepAttrs(v, &labelName) diags = append(diags, attrDiags...) if len(jsonAttrs) == 0 { diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Missing block label", Detail: fmt.Sprintf("At least one object property is required, whose name represents the %s block's %s.", typeName, labelName), Subject: v.StartRange().Ptr(), }) return } labelsUsed := append(labelsUsed, "") labelRanges := append(labelRanges, hcl.Range{}) for _, p := range jsonAttrs { pk := p.Name labelsUsed[len(labelsUsed)-1] = pk labelRanges[len(labelRanges)-1] = p.NameRange diags = append(diags, b.unpackBlock(p.Value, typeName, typeRange, labelsLeft[1:], labelsUsed, labelRanges, blocks)...) } return } // By the time we get here, we've peeled off all the labels and we're ready // to deal with the block's actual content. // need to copy the label slices because their underlying arrays will // continue to be mutated after we return. labels := make([]string, len(labelsUsed)) copy(labels, labelsUsed) labelR := make([]hcl.Range, len(labelRanges)) copy(labelR, labelRanges) switch tv := v.(type) { case *nullVal: // There is no block content, e.g the value is null. return case *objectVal: // Single instance of the block *blocks = append(*blocks, &hcl.Block{ Type: typeName, Labels: labels, Body: &body{ val: tv, }, DefRange: tv.OpenRange, TypeRange: *typeRange, LabelRanges: labelR, }) case *arrayVal: // Multiple instances of the block for _, av := range tv.Values { *blocks = append(*blocks, &hcl.Block{ Type: typeName, Labels: labels, Body: &body{ val: av, // might be mistyped; we'll find out when content is requested for this body }, DefRange: tv.OpenRange, TypeRange: *typeRange, LabelRanges: labelR, }) } default: diags = diags.Append(&hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect JSON value type", Detail: fmt.Sprintf("Either a JSON object or a JSON array is required, representing the contents of one or more %q blocks.", typeName), Subject: v.StartRange().Ptr(), }) } return } // collectDeepAttrs takes either a single object or an array of objects and // flattens it into a list of object attributes, collecting attributes from // all of the objects in a given array. // // Ordering is preserved, so a list of objects that each have one property // will result in those properties being returned in the same order as the // objects appeared in the array. // // This is appropriate for use only for objects representing bodies or labels // within a block. // // The labelName argument, if non-null, is used to tailor returned error // messages to refer to block labels rather than attributes and child blocks. // It has no other effect. func (b *body) collectDeepAttrs(v node, labelName *string) ([]*objectAttr, hcl.Diagnostics) { var diags hcl.Diagnostics var attrs []*objectAttr switch tv := v.(type) { case *nullVal: // If a value is null, then we don't return any attributes or return an error. case *objectVal: attrs = append(attrs, tv.Attrs...) case *arrayVal: for _, ev := range tv.Values { switch tev := ev.(type) { case *objectVal: attrs = append(attrs, tev.Attrs...) default: if labelName != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect JSON value type", Detail: fmt.Sprintf("A JSON object is required here, to specify %s labels for this block.", *labelName), Subject: ev.StartRange().Ptr(), }) } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect JSON value type", Detail: "A JSON object is required here, to define arguments and child blocks.", Subject: ev.StartRange().Ptr(), }) } } } default: if labelName != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect JSON value type", Detail: fmt.Sprintf("Either a JSON object or JSON array of objects is required here, to specify %s labels for this block.", *labelName), Subject: v.StartRange().Ptr(), }) } else { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Incorrect JSON value type", Detail: "Either a JSON object or JSON array of objects is required here, to define arguments and child blocks.", Subject: v.StartRange().Ptr(), }) } } return attrs, diags } func (e *expression) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { switch v := e.src.(type) { case *stringVal: if ctx != nil { // Parse string contents as a HCL native language expression. // We only do this if we have a context, so passing a nil context // is how the caller specifies that interpolations are not allowed // and that the string should just be returned verbatim. templateSrc := v.Value expr, diags := hclsyntax.ParseTemplate( []byte(templateSrc), v.SrcRange.Filename, // This won't produce _exactly_ the right result, since // the hclsyntax parser can't "see" any escapes we removed // while parsing JSON, but it's better than nothing. hcl.Pos{ Line: v.SrcRange.Start.Line, // skip over the opening quote mark Byte: v.SrcRange.Start.Byte + 1, Column: v.SrcRange.Start.Column + 1, }, ) if diags.HasErrors() { return cty.DynamicVal, diags } val, evalDiags := expr.Value(ctx) diags = append(diags, evalDiags...) return val, diags } return cty.StringVal(v.Value), nil case *numberVal: return cty.NumberVal(v.Value), nil case *booleanVal: return cty.BoolVal(v.Value), nil case *arrayVal: var diags hcl.Diagnostics vals := []cty.Value{} for _, jsonVal := range v.Values { val, valDiags := (&expression{src: jsonVal}).Value(ctx) vals = append(vals, val) diags = append(diags, valDiags...) } return cty.TupleVal(vals), diags case *objectVal: var diags hcl.Diagnostics attrs := map[string]cty.Value{} attrRanges := map[string]hcl.Range{} known := true for _, jsonAttr := range v.Attrs { // In this one context we allow keys to contain interpolation // expressions too, assuming we're evaluating in interpolation // mode. This achieves parity with the native syntax where // object expressions can have dynamic keys, while block contents // may not. name, nameDiags := (&expression{src: &stringVal{ Value: jsonAttr.Name, SrcRange: jsonAttr.NameRange, }}).Value(ctx) valExpr := &expression{src: jsonAttr.Value} val, valDiags := valExpr.Value(ctx) diags = append(diags, nameDiags...) diags = append(diags, valDiags...) var err error name, err = convert.Convert(name, cty.String) if err != nil { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid object key expression", Detail: fmt.Sprintf("Cannot use this expression as an object key: %s.", err), Subject: &jsonAttr.NameRange, Expression: valExpr, EvalContext: ctx, }) continue } if name.IsNull() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Invalid object key expression", Detail: "Cannot use null value as an object key.", Subject: &jsonAttr.NameRange, Expression: valExpr, EvalContext: ctx, }) continue } if !name.IsKnown() { // This is a bit of a weird case, since our usual rules require // us to tolerate unknowns and just represent the result as // best we can but if we don't know the key then we can't // know the type of our object at all, and thus we must turn // the whole thing into cty.DynamicVal. This is consistent with // how this situation is handled in the native syntax. // We'll keep iterating so we can collect other errors in // subsequent attributes. known = false continue } nameStr := name.AsString() if _, defined := attrs[nameStr]; defined { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, Summary: "Duplicate object attribute", Detail: fmt.Sprintf("An attribute named %q was already defined at %s.", nameStr, attrRanges[nameStr]), Subject: &jsonAttr.NameRange, Expression: e, EvalContext: ctx, }) continue } attrs[nameStr] = val attrRanges[nameStr] = jsonAttr.NameRange } if !known { // We encountered an unknown key somewhere along the way, so // we can't know what our type will eventually be. return cty.DynamicVal, diags } return cty.ObjectVal(attrs), diags case *nullVal: return cty.NullVal(cty.DynamicPseudoType), nil default: // Default to DynamicVal so that ASTs containing invalid nodes can // still be partially-evaluated. return cty.DynamicVal, nil } } func (e *expression) Variables() []hcl.Traversal { var vars []hcl.Traversal switch v := e.src.(type) { case *stringVal: templateSrc := v.Value expr, diags := hclsyntax.ParseTemplate( []byte(templateSrc), v.SrcRange.Filename, // This won't produce _exactly_ the right result, since // the hclsyntax parser can't "see" any escapes we removed // while parsing JSON, but it's better than nothing. hcl.Pos{ Line: v.SrcRange.Start.Line, // skip over the opening quote mark Byte: v.SrcRange.Start.Byte + 1, Column: v.SrcRange.Start.Column + 1, }, ) if diags.HasErrors() { return vars } return expr.Variables() case *arrayVal: for _, jsonVal := range v.Values { vars = append(vars, (&expression{src: jsonVal}).Variables()...) } case *objectVal: for _, jsonAttr := range v.Attrs { keyExpr := &stringVal{ // we're going to treat key as an expression in this context Value: jsonAttr.Name, SrcRange: jsonAttr.NameRange, } vars = append(vars, (&expression{src: keyExpr}).Variables()...) vars = append(vars, (&expression{src: jsonAttr.Value}).Variables()...) } } return vars } func (e *expression) Range() hcl.Range { return e.src.Range() } func (e *expression) StartRange() hcl.Range { return e.src.StartRange() } // Implementation for hcl.AbsTraversalForExpr. func (e *expression) AsTraversal() hcl.Traversal { // In JSON-based syntax a traversal is given as a string containing // traversal syntax as defined by hclsyntax.ParseTraversalAbs. switch v := e.src.(type) { case *stringVal: traversal, diags := hclsyntax.ParseTraversalAbs([]byte(v.Value), v.SrcRange.Filename, v.SrcRange.Start) if diags.HasErrors() { return nil } return traversal default: return nil } } // Implementation for hcl.ExprCall. func (e *expression) ExprCall() *hcl.StaticCall { // In JSON-based syntax a static call is given as a string containing // an expression in the native syntax that also supports ExprCall. switch v := e.src.(type) { case *stringVal: expr, diags := hclsyntax.ParseExpression([]byte(v.Value), v.SrcRange.Filename, v.SrcRange.Start) if diags.HasErrors() { return nil } call, diags := hcl.ExprCall(expr) if diags.HasErrors() { return nil } return call default: return nil } } // Implementation for hcl.ExprList. func (e *expression) ExprList() []hcl.Expression { switch v := e.src.(type) { case *arrayVal: ret := make([]hcl.Expression, len(v.Values)) for i, node := range v.Values { ret[i] = &expression{src: node} } return ret default: return nil } } // Implementation for hcl.ExprMap. func (e *expression) ExprMap() []hcl.KeyValuePair { switch v := e.src.(type) { case *objectVal: ret := make([]hcl.KeyValuePair, len(v.Attrs)) for i, jsonAttr := range v.Attrs { ret[i] = hcl.KeyValuePair{ Key: &expression{src: &stringVal{ Value: jsonAttr.Name, SrcRange: jsonAttr.NameRange, }}, Value: &expression{src: jsonAttr.Value}, } } return ret default: return nil } } ���packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/json/tokentype_string.go������������������������0000664�0000000�0000000�00000001510�13771713062�0027001�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "stringer -type tokenType scanner.go"; DO NOT EDIT. package json import "strconv" const _tokenType_name = "tokenInvalidtokenCommatokenColontokenEqualstokenKeywordtokenNumbertokenStringtokenBrackOtokenBrackCtokenBraceOtokenBraceCtokenEOF" var _tokenType_map = map[tokenType]string{ 0: _tokenType_name[0:12], 44: _tokenType_name[12:22], 58: _tokenType_name[22:32], 61: _tokenType_name[32:43], 75: _tokenType_name[43:55], 78: _tokenType_name[55:66], 83: _tokenType_name[66:77], 91: _tokenType_name[77:88], 93: _tokenType_name[88:99], 123: _tokenType_name[99:110], 125: _tokenType_name[110:121], 9220: _tokenType_name[121:129], } func (i tokenType) String() string { if str, ok := _tokenType_map[i]; ok { return str } return "tokenType(" + strconv.FormatInt(int64(i), 10) + ")" } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/merged.go���������������������������������������0000664�0000000�0000000�00000014454�13771713062�0023676�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "fmt" ) // MergeFiles combines the given files to produce a single body that contains // configuration from all of the given files. // // The ordering of the given files decides the order in which contained // elements will be returned. If any top-level attributes are defined with // the same name across multiple files, a diagnostic will be produced from // the Content and PartialContent methods describing this error in a // user-friendly way. func MergeFiles(files []*File) Body { var bodies []Body for _, file := range files { bodies = append(bodies, file.Body) } return MergeBodies(bodies) } // MergeBodies is like MergeFiles except it deals directly with bodies, rather // than with entire files. func MergeBodies(bodies []Body) Body { if len(bodies) == 0 { // Swap out for our singleton empty body, to reduce the number of // empty slices we have hanging around. return emptyBody } // If any of the given bodies are already merged bodies, we'll unpack // to flatten to a single mergedBodies, since that's conceptually simpler. // This also, as a side-effect, eliminates any empty bodies, since // empties are merged bodies with no inner bodies. var newLen int var flatten bool for _, body := range bodies { if children, merged := body.(mergedBodies); merged { newLen += len(children) flatten = true } else { newLen++ } } if !flatten { // not just newLen == len, because we might have mergedBodies with single bodies inside return mergedBodies(bodies) } if newLen == 0 { // Don't allocate a new empty when we already have one return emptyBody } new := make([]Body, 0, newLen) for _, body := range bodies { if children, merged := body.(mergedBodies); merged { new = append(new, children...) } else { new = append(new, body) } } return mergedBodies(new) } var emptyBody = mergedBodies([]Body{}) // EmptyBody returns a body with no content. This body can be used as a // placeholder when a body is required but no body content is available. func EmptyBody() Body { return emptyBody } type mergedBodies []Body // Content returns the content produced by applying the given schema to all // of the merged bodies and merging the result. // // Although required attributes _are_ supported, they should be used sparingly // with merged bodies since in this case there is no contextual information // with which to return good diagnostics. Applications working with merged // bodies may wish to mark all attributes as optional and then check for // required attributes afterwards, to produce better diagnostics. func (mb mergedBodies) Content(schema *BodySchema) (*BodyContent, Diagnostics) { // the returned body will always be empty in this case, because mergedContent // will only ever call Content on the child bodies. content, _, diags := mb.mergedContent(schema, false) return content, diags } func (mb mergedBodies) PartialContent(schema *BodySchema) (*BodyContent, Body, Diagnostics) { return mb.mergedContent(schema, true) } func (mb mergedBodies) JustAttributes() (Attributes, Diagnostics) { attrs := make(map[string]*Attribute) var diags Diagnostics for _, body := range mb { thisAttrs, thisDiags := body.JustAttributes() if len(thisDiags) != 0 { diags = append(diags, thisDiags...) } if thisAttrs != nil { for name, attr := range thisAttrs { if existing := attrs[name]; existing != nil { diags = diags.Append(&Diagnostic{ Severity: DiagError, Summary: "Duplicate argument", Detail: fmt.Sprintf( "Argument %q was already set at %s", name, existing.NameRange.String(), ), Subject: &attr.NameRange, }) continue } attrs[name] = attr } } } return attrs, diags } func (mb mergedBodies) MissingItemRange() Range { if len(mb) == 0 { // Nothing useful to return here, so we'll return some garbage. return Range{ Filename: "<empty>", } } // arbitrarily use the first body's missing item range return mb[0].MissingItemRange() } func (mb mergedBodies) mergedContent(schema *BodySchema, partial bool) (*BodyContent, Body, Diagnostics) { // We need to produce a new schema with none of the attributes marked as // required, since _any one_ of our bodies can contribute an attribute value. // We'll separately check that all required attributes are present at // the end. mergedSchema := &BodySchema{ Blocks: schema.Blocks, } for _, attrS := range schema.Attributes { mergedAttrS := attrS mergedAttrS.Required = false mergedSchema.Attributes = append(mergedSchema.Attributes, mergedAttrS) } var mergedLeftovers []Body content := &BodyContent{ Attributes: map[string]*Attribute{}, } var diags Diagnostics for _, body := range mb { var thisContent *BodyContent var thisLeftovers Body var thisDiags Diagnostics if partial { thisContent, thisLeftovers, thisDiags = body.PartialContent(mergedSchema) } else { thisContent, thisDiags = body.Content(mergedSchema) } if thisLeftovers != nil { mergedLeftovers = append(mergedLeftovers, thisLeftovers) } if len(thisDiags) != 0 { diags = append(diags, thisDiags...) } if thisContent.Attributes != nil { for name, attr := range thisContent.Attributes { if existing := content.Attributes[name]; existing != nil { diags = diags.Append(&Diagnostic{ Severity: DiagError, Summary: "Duplicate argument", Detail: fmt.Sprintf( "Argument %q was already set at %s", name, existing.NameRange.String(), ), Subject: &attr.NameRange, }) continue } content.Attributes[name] = attr } } if len(thisContent.Blocks) != 0 { content.Blocks = append(content.Blocks, thisContent.Blocks...) } } // Finally, we check for required attributes. for _, attrS := range schema.Attributes { if !attrS.Required { continue } if content.Attributes[attrS.Name] == nil { // We don't have any context here to produce a good diagnostic, // which is why we warn in the Content docstring to minimize the // use of required attributes on merged bodies. diags = diags.Append(&Diagnostic{ Severity: DiagError, Summary: "Missing required argument", Detail: fmt.Sprintf( "The argument %q is required, but was not set.", attrS.Name, ), }) } } leftoverBody := MergeBodies(mergedLeftovers) return content, leftoverBody, diags } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/ops.go������������������������������������������0000664�0000000�0000000�00000020301�13771713062�0023220�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "fmt" "math/big" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) // Index is a helper function that performs the same operation as the index // operator in the HCL expression language. That is, the result is the // same as it would be for collection[key] in a configuration expression. // // This is exported so that applications can perform indexing in a manner // consistent with how the language does it, including handling of null and // unknown values, etc. // // Diagnostics are produced if the given combination of values is not valid. // Therefore a pointer to a source range must be provided to use in diagnostics, // though nil can be provided if the calling application is going to // ignore the subject of the returned diagnostics anyway. func Index(collection, key cty.Value, srcRange *Range) (cty.Value, Diagnostics) { if collection.IsNull() { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Attempt to index null value", Detail: "This value is null, so it does not have any indices.", Subject: srcRange, }, } } if key.IsNull() { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Invalid index", Detail: "Can't use a null value as an indexing key.", Subject: srcRange, }, } } ty := collection.Type() kty := key.Type() if kty == cty.DynamicPseudoType || ty == cty.DynamicPseudoType { return cty.DynamicVal, nil } switch { case ty.IsListType() || ty.IsTupleType() || ty.IsMapType(): var wantType cty.Type switch { case ty.IsListType() || ty.IsTupleType(): wantType = cty.Number case ty.IsMapType(): wantType = cty.String default: // should never happen panic("don't know what key type we want") } key, keyErr := convert.Convert(key, wantType) if keyErr != nil { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Invalid index", Detail: fmt.Sprintf( "The given key does not identify an element in this collection value: %s.", keyErr.Error(), ), Subject: srcRange, }, } } has := collection.HasIndex(key) if !has.IsKnown() { if ty.IsTupleType() { return cty.DynamicVal, nil } else { return cty.UnknownVal(ty.ElementType()), nil } } if has.False() { // We have a more specialized error message for the situation of // using a fractional number to index into a sequence, because // that will tend to happen if the user is trying to use division // to calculate an index and not realizing that HCL does float // division rather than integer division. if (ty.IsListType() || ty.IsTupleType()) && key.Type().Equals(cty.Number) { if key.IsKnown() && !key.IsNull() { bf := key.AsBigFloat() if _, acc := bf.Int(nil); acc != big.Exact { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Invalid index", Detail: fmt.Sprintf("The given key does not identify an element in this collection value: indexing a sequence requires a whole number, but the given index (%g) has a fractional part.", bf), Subject: srcRange, }, } } } } return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Invalid index", Detail: "The given key does not identify an element in this collection value.", Subject: srcRange, }, } } return collection.Index(key), nil case ty.IsObjectType(): key, keyErr := convert.Convert(key, cty.String) if keyErr != nil { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Invalid index", Detail: fmt.Sprintf( "The given key does not identify an element in this collection value: %s.", keyErr.Error(), ), Subject: srcRange, }, } } if !collection.IsKnown() { return cty.DynamicVal, nil } if !key.IsKnown() { return cty.DynamicVal, nil } attrName := key.AsString() if !ty.HasAttribute(attrName) { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Invalid index", Detail: "The given key does not identify an element in this collection value.", Subject: srcRange, }, } } return collection.GetAttr(attrName), nil default: return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Invalid index", Detail: "This value does not have any indices.", Subject: srcRange, }, } } } // GetAttr is a helper function that performs the same operation as the // attribute access in the HCL expression language. That is, the result is the // same as it would be for obj.attr in a configuration expression. // // This is exported so that applications can access attributes in a manner // consistent with how the language does it, including handling of null and // unknown values, etc. // // Diagnostics are produced if the given combination of values is not valid. // Therefore a pointer to a source range must be provided to use in diagnostics, // though nil can be provided if the calling application is going to // ignore the subject of the returned diagnostics anyway. func GetAttr(obj cty.Value, attrName string, srcRange *Range) (cty.Value, Diagnostics) { if obj.IsNull() { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Attempt to get attribute from null value", Detail: "This value is null, so it does not have any attributes.", Subject: srcRange, }, } } ty := obj.Type() switch { case ty.IsObjectType(): if !ty.HasAttribute(attrName) { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Unsupported attribute", Detail: fmt.Sprintf("This object does not have an attribute named %q.", attrName), Subject: srcRange, }, } } if !obj.IsKnown() { return cty.UnknownVal(ty.AttributeType(attrName)), nil } return obj.GetAttr(attrName), nil case ty.IsMapType(): if !obj.IsKnown() { return cty.UnknownVal(ty.ElementType()), nil } idx := cty.StringVal(attrName) if obj.HasIndex(idx).False() { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Missing map element", Detail: fmt.Sprintf("This map does not have an element with the key %q.", attrName), Subject: srcRange, }, } } return obj.Index(idx), nil case ty == cty.DynamicPseudoType: return cty.DynamicVal, nil default: return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Unsupported attribute", Detail: "This value does not have any attributes.", Subject: srcRange, }, } } } // ApplyPath is a helper function that applies a cty.Path to a value using the // indexing and attribute access operations from HCL. // // This is similar to calling the path's own Apply method, but ApplyPath uses // the more relaxed typing rules that apply to these operations in HCL, rather // than cty's relatively-strict rules. ApplyPath is implemented in terms of // Index and GetAttr, and so it has the same behavior for individual steps // but will stop and return any errors returned by intermediate steps. // // Diagnostics are produced if the given path cannot be applied to the given // value. Therefore a pointer to a source range must be provided to use in // diagnostics, though nil can be provided if the calling application is going // to ignore the subject of the returned diagnostics anyway. func ApplyPath(val cty.Value, path cty.Path, srcRange *Range) (cty.Value, Diagnostics) { var diags Diagnostics for _, step := range path { var stepDiags Diagnostics switch ts := step.(type) { case cty.IndexStep: val, stepDiags = Index(val, ts.Key, srcRange) case cty.GetAttrStep: val, stepDiags = GetAttr(val, ts.Name, srcRange) default: // Should never happen because the above are all of the step types. diags = diags.Append(&Diagnostic{ Severity: DiagError, Summary: "Invalid path step", Detail: fmt.Sprintf("Go type %T is not a valid path step. This is a bug in this program.", step), Subject: srcRange, }) return cty.DynamicVal, diags } diags = append(diags, stepDiags...) if stepDiags.HasErrors() { return cty.DynamicVal, diags } } return val, diags } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/pos.go������������������������������������������0000664�0000000�0000000�00000017610�13771713062�0023231�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import "fmt" // Pos represents a single position in a source file, by addressing the // start byte of a unicode character encoded in UTF-8. // // Pos is generally used only in the context of a Range, which then defines // which source file the position is within. type Pos struct { // Line is the source code line where this position points. Lines are // counted starting at 1 and incremented for each newline character // encountered. Line int // Column is the source code column where this position points, in // unicode characters, with counting starting at 1. // // Column counts characters as they appear visually, so for example a // latin letter with a combining diacritic mark counts as one character. // This is intended for rendering visual markers against source code in // contexts where these diacritics would be rendered in a single character // cell. Technically speaking, Column is counting grapheme clusters as // used in unicode normalization. Column int // Byte is the byte offset into the file where the indicated character // begins. This is a zero-based offset to the first byte of the first // UTF-8 codepoint sequence in the character, and thus gives a position // that can be resolved _without_ awareness of Unicode characters. Byte int } // InitialPos is a suitable position to use to mark the start of a file. var InitialPos = Pos{Byte: 0, Line: 1, Column: 1} // Range represents a span of characters between two positions in a source // file. // // This struct is usually used by value in types that represent AST nodes, // but by pointer in types that refer to the positions of other objects, // such as in diagnostics. type Range struct { // Filename is the name of the file into which this range's positions // point. Filename string // Start and End represent the bounds of this range. Start is inclusive // and End is exclusive. Start, End Pos } // RangeBetween returns a new range that spans from the beginning of the // start range to the end of the end range. // // The result is meaningless if the two ranges do not belong to the same // source file or if the end range appears before the start range. func RangeBetween(start, end Range) Range { return Range{ Filename: start.Filename, Start: start.Start, End: end.End, } } // RangeOver returns a new range that covers both of the given ranges and // possibly additional content between them if the two ranges do not overlap. // // If either range is empty then it is ignored. The result is empty if both // given ranges are empty. // // The result is meaningless if the two ranges to not belong to the same // source file. func RangeOver(a, b Range) Range { if a.Empty() { return b } if b.Empty() { return a } var start, end Pos if a.Start.Byte < b.Start.Byte { start = a.Start } else { start = b.Start } if a.End.Byte > b.End.Byte { end = a.End } else { end = b.End } return Range{ Filename: a.Filename, Start: start, End: end, } } // ContainsPos returns true if and only if the given position is contained within // the receiving range. // // In the unlikely case that the line/column information disagree with the byte // offset information in the given position or receiving range, the byte // offsets are given priority. func (r Range) ContainsPos(pos Pos) bool { return r.ContainsOffset(pos.Byte) } // ContainsOffset returns true if and only if the given byte offset is within // the receiving Range. func (r Range) ContainsOffset(offset int) bool { return offset >= r.Start.Byte && offset < r.End.Byte } // Ptr returns a pointer to a copy of the receiver. This is a convenience when // ranges in places where pointers are required, such as in Diagnostic, but // the range in question is returned from a method. Go would otherwise not // allow one to take the address of a function call. func (r Range) Ptr() *Range { return &r } // String returns a compact string representation of the receiver. // Callers should generally prefer to present a range more visually, // e.g. via markers directly on the relevant portion of source code. func (r Range) String() string { if r.Start.Line == r.End.Line { return fmt.Sprintf( "%s:%d,%d-%d", r.Filename, r.Start.Line, r.Start.Column, r.End.Column, ) } else { return fmt.Sprintf( "%s:%d,%d-%d,%d", r.Filename, r.Start.Line, r.Start.Column, r.End.Line, r.End.Column, ) } } func (r Range) Empty() bool { return r.Start.Byte == r.End.Byte } // CanSliceBytes returns true if SliceBytes could return an accurate // sub-slice of the given slice. // // This effectively tests whether the start and end offsets of the range // are within the bounds of the slice, and thus whether SliceBytes can be // trusted to produce an accurate start and end position within that slice. func (r Range) CanSliceBytes(b []byte) bool { switch { case r.Start.Byte < 0 || r.Start.Byte > len(b): return false case r.End.Byte < 0 || r.End.Byte > len(b): return false case r.End.Byte < r.Start.Byte: return false default: return true } } // SliceBytes returns a sub-slice of the given slice that is covered by the // receiving range, assuming that the given slice is the source code of the // file indicated by r.Filename. // // If the receiver refers to any byte offsets that are outside of the slice // then the result is constrained to the overlapping portion only, to avoid // a panic. Use CanSliceBytes to determine if the result is guaranteed to // be an accurate span of the requested range. func (r Range) SliceBytes(b []byte) []byte { start := r.Start.Byte end := r.End.Byte if start < 0 { start = 0 } else if start > len(b) { start = len(b) } if end < 0 { end = 0 } else if end > len(b) { end = len(b) } if end < start { end = start } return b[start:end] } // Overlaps returns true if the receiver and the other given range share any // characters in common. func (r Range) Overlaps(other Range) bool { switch { case r.Filename != other.Filename: // If the ranges are in different files then they can't possibly overlap return false case r.Empty() || other.Empty(): // Empty ranges can never overlap return false case r.ContainsOffset(other.Start.Byte) || r.ContainsOffset(other.End.Byte): return true case other.ContainsOffset(r.Start.Byte) || other.ContainsOffset(r.End.Byte): return true default: return false } } // Overlap finds a range that is either identical to or a sub-range of both // the receiver and the other given range. It returns an empty range // within the receiver if there is no overlap between the two ranges. // // A non-empty result is either identical to or a subset of the receiver. func (r Range) Overlap(other Range) Range { if !r.Overlaps(other) { // Start == End indicates an empty range return Range{ Filename: r.Filename, Start: r.Start, End: r.Start, } } var start, end Pos if r.Start.Byte > other.Start.Byte { start = r.Start } else { start = other.Start } if r.End.Byte < other.End.Byte { end = r.End } else { end = other.End } return Range{ Filename: r.Filename, Start: start, End: end, } } // PartitionAround finds the portion of the given range that overlaps with // the reciever and returns three ranges: the portion of the reciever that // precedes the overlap, the overlap itself, and then the portion of the // reciever that comes after the overlap. // // If the two ranges do not overlap then all three returned ranges are empty. // // If the given range aligns with or extends beyond either extent of the // reciever then the corresponding outer range will be empty. func (r Range) PartitionAround(other Range) (before, overlap, after Range) { overlap = r.Overlap(other) if overlap.Empty() { return overlap, overlap, overlap } before = Range{ Filename: r.Filename, Start: r.Start, End: overlap.Start, } after = Range{ Filename: r.Filename, Start: overlap.End, End: r.End, } return before, overlap, after } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/pos_scanner.go����������������������������������0000664�0000000�0000000�00000011224�13771713062�0024735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "bufio" "bytes" "github.com/apparentlymart/go-textseg/v12/textseg" ) // RangeScanner is a helper that will scan over a buffer using a bufio.SplitFunc // and visit a source range for each token matched. // // For example, this can be used with bufio.ScanLines to find the source range // for each line in the file, skipping over the actual newline characters, which // may be useful when printing source code snippets as part of diagnostic // messages. // // The line and column information in the returned ranges is produced by // counting newline characters and grapheme clusters respectively, which // mimics the behavior we expect from a parser when producing ranges. type RangeScanner struct { filename string b []byte cb bufio.SplitFunc pos Pos // position of next byte to process in b cur Range // latest range tok []byte // slice of b that is covered by cur err error // error from last scan, if any } // NewRangeScanner creates a new RangeScanner for the given buffer, producing // ranges for the given filename. // // Since ranges have grapheme-cluster granularity rather than byte granularity, // the scanner will produce incorrect results if the given SplitFunc creates // tokens between grapheme cluster boundaries. In particular, it is incorrect // to use RangeScanner with bufio.ScanRunes because it will produce tokens // around individual UTF-8 sequences, which will split any multi-sequence // grapheme clusters. func NewRangeScanner(b []byte, filename string, cb bufio.SplitFunc) *RangeScanner { return NewRangeScannerFragment(b, filename, InitialPos, cb) } // NewRangeScannerFragment is like NewRangeScanner but the ranges it produces // will be offset by the given starting position, which is appropriate for // sub-slices of a file, whereas NewRangeScanner assumes it is scanning an // entire file. func NewRangeScannerFragment(b []byte, filename string, start Pos, cb bufio.SplitFunc) *RangeScanner { return &RangeScanner{ filename: filename, b: b, cb: cb, pos: start, } } func (sc *RangeScanner) Scan() bool { if sc.pos.Byte >= len(sc.b) || sc.err != nil { // All done return false } // Since we're operating on an in-memory buffer, we always pass the whole // remainder of the buffer to our SplitFunc and set isEOF to let it know // that it has the whole thing. advance, token, err := sc.cb(sc.b[sc.pos.Byte:], true) // Since we are setting isEOF to true this should never happen, but // if it does we will just abort and assume the SplitFunc is misbehaving. if advance == 0 && token == nil && err == nil { return false } if err != nil { sc.err = err sc.cur = Range{ Filename: sc.filename, Start: sc.pos, End: sc.pos, } sc.tok = nil return false } sc.tok = token start := sc.pos end := sc.pos new := sc.pos // adv is similar to token but it also includes any subsequent characters // we're being asked to skip over by the SplitFunc. // adv is a slice covering any additional bytes we are skipping over, based // on what the SplitFunc told us to do with advance. adv := sc.b[sc.pos.Byte : sc.pos.Byte+advance] // We now need to scan over our token to count the grapheme clusters // so we can correctly advance Column, and count the newlines so we // can correctly advance Line. advR := bytes.NewReader(adv) gsc := bufio.NewScanner(advR) advanced := 0 gsc.Split(textseg.ScanGraphemeClusters) for gsc.Scan() { gr := gsc.Bytes() new.Byte += len(gr) new.Column++ // We rely here on the fact that \r\n is considered a grapheme cluster // and so we don't need to worry about miscounting additional lines // on files with Windows-style line endings. if len(gr) != 0 && (gr[0] == '\r' || gr[0] == '\n') { new.Column = 1 new.Line++ } if advanced < len(token) { // If we've not yet found the end of our token then we'll // also push our "end" marker along. // (if advance > len(token) then we'll stop moving "end" early // so that the caller only sees the range covered by token.) end = new } advanced += len(gr) } sc.cur = Range{ Filename: sc.filename, Start: start, End: end, } sc.pos = new return true } // Range returns a range that covers the latest token obtained after a call // to Scan returns true. func (sc *RangeScanner) Range() Range { return sc.cur } // Bytes returns the slice of the input buffer that is covered by the range // that would be returned by Range. func (sc *RangeScanner) Bytes() []byte { return sc.tok } // Err can be called after Scan returns false to determine if the latest read // resulted in an error, and obtain that error if so. func (sc *RangeScanner) Err() error { return sc.err } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/schema.go���������������������������������������0000664�0000000�0000000�00000001032�13771713062�0023657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl // BlockHeaderSchema represents the shape of a block header, and is // used for matching blocks within bodies. type BlockHeaderSchema struct { Type string LabelNames []string } // AttributeSchema represents the requirements for an attribute, and is used // for matching attributes within bodies. type AttributeSchema struct { Name string Required bool } // BodySchema represents the desired shallow structure of a body. type BodySchema struct { Attributes []AttributeSchema Blocks []BlockHeaderSchema } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/spec.md�����������������������������������������0000664�0000000�0000000�00000077511�13771713062�0023363�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# HCL Syntax-Agnostic Information Model This is the specification for the general information model (abstract types and semantics) for hcl. HCL is a system for defining configuration languages for applications. The HCL information model is designed to support multiple concrete syntaxes for configuration, each with a mapping to the model defined in this specification. The two primary syntaxes intended for use in conjunction with this model are [the HCL native syntax](./hclsyntax/spec.md) and [the JSON syntax](./json/spec.md). In principle other syntaxes are possible as long as either their language model is sufficiently rich to express the concepts described in this specification or the language targets a well-defined subset of the specification. ## Structural Elements The primary structural element is the _body_, which is a container representing a set of zero or more _attributes_ and a set of zero or more _blocks_. A _configuration file_ is the top-level object, and will usually be produced by reading a file from disk and parsing it as a particular syntax. A configuration file has its own _body_, representing the top-level attributes and blocks. An _attribute_ is a name and value pair associated with a body. Attribute names are unique within a given body. Attribute values are provided as _expressions_, which are discussed in detail in a later section. A _block_ is a nested structure that has a _type name_, zero or more string _labels_ (e.g. identifiers), and a nested body. Together the structural elements create a hierarchical data structure, with attributes intended to represent the direct properties of a particular object in the calling application, and blocks intended to represent child objects of a particular object. ## Body Content To support the expression of the HCL concepts in languages whose information model is a subset of HCL's, such as JSON, a _body_ is an opaque container whose content can only be accessed by providing information on the expected structure of the content. The specification for each syntax must describe how its physical constructs are mapped on to body content given a schema. For syntaxes that have first-class syntax distinguishing attributes and bodies this can be relatively straightforward, while more detailed mapping rules may be required in syntaxes where the representation of attributes vs. blocks is ambiguous. ### Schema-driven Processing Schema-driven processing is the primary way to access body content. A _body schema_ is a description of what is expected within a particular body, which can then be used to extract the _body content_, which then provides access to the specific attributes and blocks requested. A _body schema_ consists of a list of _attribute schemata_ and _block header schemata_: - An _attribute schema_ provides the name of an attribute and whether its presence is required. - A _block header schema_ provides a block type name and the semantic names assigned to each of the labels of that block type, if any. Within a schema, it is an error to request the same attribute name twice or to request a block type whose name is also an attribute name. While this can in principle be supported in some syntaxes, in other syntaxes the attribute and block namespaces are combined and so an attribute cannot coexist with a block whose type name is identical to the attribute name. The result of applying a body schema to a body is _body content_, which consists of an _attribute map_ and a _block sequence_: - The _attribute map_ is a map data structure whose keys are attribute names and whose values are _expressions_ that represent the corresponding attribute values. - The _block sequence_ is an ordered sequence of blocks, with each specifying a block _type name_, the sequence of _labels_ specified for the block, and the body object (not body _content_) representing the block's own body. After obtaining _body content_, the calling application may continue processing by evaluating attribute expressions and/or recursively applying further schema-driven processing to the child block bodies. **Note:** The _body schema_ is intentionally minimal, to reduce the set of mapping rules that must be defined for each syntax. Higher-level utility libraries may be provided to assist in the construction of a schema and perform additional processing, such as automatically evaluating attribute expressions and assigning their result values into a data structure, or recursively applying a schema to child blocks. Such utilities are not part of this core specification and will vary depending on the capabilities and idiom of the implementation language. ### _Dynamic Attributes_ Processing The _schema-driven_ processing model is useful when the expected structure of a body is known a priori by the calling application. Some blocks are instead more free-form, such as a user-provided set of arbitrary key/value pairs. The alternative _dynamic attributes_ processing mode allows for this more ad-hoc approach. Processing in this mode behaves as if a schema had been constructed without any _block header schemata_ and with an attribute schema for each distinct key provided within the physical representation of the body. The means by which _distinct keys_ are identified is dependent on the physical syntax; this processing mode assumes that the syntax has a way to enumerate keys provided by the author and identify expressions that correspond with those keys, but does not define the means by which this is done. The result of _dynamic attributes_ processing is an _attribute map_ as defined in the previous section. No _block sequence_ is produced in this processing mode. ### Partial Processing of Body Content Under _schema-driven processing_, by default the given schema is assumed to be exhaustive, such that any attribute or block not matched by schema elements is considered an error. This allows feedback about unsupported attributes and blocks (such as typos) to be provided. An alternative is _partial processing_, where any additional elements within the body are not considered an error. Under partial processing, the result is both body content as described above _and_ a new body that represents any body elements that remain after the schema has been processed. Specifically: - Any attribute whose name is specified in the schema is returned in body content and elided from the new body. - Any block whose type is specified in the schema is returned in body content and elided from the new body. - Any attribute or block _not_ meeting the above conditions is placed into the new body, unmodified. The new body can then be recursively processed using any of the body processing models. This facility allows different subsets of body content to be processed by different parts of the calling application. Processing a body in two steps — first partial processing of a source body, then exhaustive processing of the returned body — is equivalent to single-step processing with a schema that is the union of the schemata used across the two steps. ## Expressions Attribute values are represented by _expressions_. Depending on the concrete syntax in use, an expression may just be a literal value or it may describe a computation in terms of literal values, variables, and functions. Each syntax defines its own representation of expressions. For syntaxes based in languages that do not have any non-literal expression syntax, it is recommended to embed the template language from [the native syntax](./hclsyntax/spec.md) e.g. as a post-processing step on string literals. ### Expression Evaluation In order to obtain a concrete value, each expression must be _evaluated_. Evaluation is performed in terms of an evaluation context, which consists of the following: - An _evaluation mode_, which is defined below. - A _variable scope_, which provides a set of named variables for use in expressions. - A _function table_, which provides a set of named functions for use in expressions. The _evaluation mode_ allows for two different interpretations of an expression: - In _literal-only mode_, variables and functions are not available and it is assumed that the calling application's intent is to treat the attribute value as a literal. - In _full expression mode_, variables and functions are defined and it is assumed that the calling application wishes to provide a full expression language for definition of the attribute value. The actual behavior of these two modes depends on the syntax in use. For languages with first-class expression syntax, these two modes may be considered equivalent, with _literal-only mode_ simply not defining any variables or functions. For languages that embed arbitrary expressions via string templates, _literal-only mode_ may disable such processing, allowing literal strings to pass through without interpretation as templates. Since literal-only mode does not support variables and functions, it is an error for the calling application to enable this mode and yet provide a variable scope and/or function table. ## Values and Value Types The result of expression evaluation is a _value_. Each value has a _type_, which is dynamically determined during evaluation. The _variable scope_ in the evaluation context is a map from variable name to value, using the same definition of value. The type system for HCL values is intended to be of a level abstraction suitable for configuration of various applications. A well-defined, implementation-language-agnostic type system is defined to allow for consistent processing of configuration across many implementation languages. Concrete implementations may provide additional functionality to lower HCL values and types to corresponding native language types, which may then impose additional constraints on the values outside of the scope of this specification. Two values are _equal_ if and only if they have identical types and their values are equal according to the rules of their shared type. ### Primitive Types The primitive types are _string_, _bool_, and _number_. A _string_ is a sequence of unicode characters. Two strings are equal if NFC normalization ([UAX#15](http://unicode.org/reports/tr15/) of each string produces two identical sequences of characters. NFC normalization ensures that, for example, a precomposed combination of a latin letter and a diacritic compares equal with the letter followed by a combining diacritic. The _bool_ type has only two non-null values: _true_ and _false_. Two bool values are equal if and only if they are either both true or both false. A _number_ is an arbitrary-precision floating point value. An implementation _must_ make the full-precision values available to the calling application for interpretation into any suitable number representation. An implementation may in practice implement numbers with limited precision so long as the following constraints are met: - Integers are represented with at least 256 bits. - Non-integer numbers are represented as floating point values with a mantissa of at least 256 bits and a signed binary exponent of at least 16 bits. - An error is produced if an integer value given in source cannot be represented precisely. - An error is produced if a non-integer value cannot be represented due to overflow. - A non-integer number is rounded to the nearest possible value when a value is of too high a precision to be represented. The _number_ type also requires representation of both positive and negative infinity. A "not a number" (NaN) value is _not_ provided nor used. Two number values are equal if they are numerically equal to the precision associated with the number. Positive infinity and negative infinity are equal to themselves but not to each other. Positive infinity is greater than any other number value, and negative infinity is less than any other number value. Some syntaxes may be unable to represent numeric literals of arbitrary precision. This must be defined in the syntax specification as part of its description of mapping numeric literals to HCL values. ### Structural Types _Structural types_ are types that are constructed by combining other types. Each distinct combination of other types is itself a distinct type. There are two structural type _kinds_: - _Object types_ are constructed of a set of named attributes, each of which has a type. Attribute names are always strings. (_Object_ attributes are a distinct idea from _body_ attributes, though calling applications may choose to blur the distinction by use of common naming schemes.) - _Tuple types_ are constructed of a sequence of elements, each of which has a type. Values of structural types are compared for equality in terms of their attributes or elements. A structural type value is equal to another if and only if all of the corresponding attributes or elements are equal. Two structural types are identical if they are of the same kind and have attributes or elements with identical types. ### Collection Types _Collection types_ are types that combine together an arbitrary number of values of some other single type. There are three collection type _kinds_: - _List types_ represent ordered sequences of values of their element type. - _Map types_ represent values of their element type accessed via string keys. - _Set types_ represent unordered sets of distinct values of their element type. For each of these kinds and each distinct element type there is a distinct collection type. For example, "list of string" is a distinct type from "set of string", and "list of number" is a distinct type from "list of string". Values of collection types are compared for equality in terms of their elements. A collection type value is equal to another if and only if both have the same number of elements and their corresponding elements are equal. Two collection types are identical if they are of the same kind and have the same element type. ### Null values Each type has a null value. The null value of a type represents the absence of a value, but with type information retained to allow for type checking. Null values are used primarily to represent the conditional absence of a body attribute. In a syntax with a conditional operator, one of the result values of that conditional may be null to indicate that the attribute should be considered not present in that case. Calling applications _should_ consider an attribute with a null value as equivalent to the value not being present at all. A null value of a particular type is equal to itself. ### Unknown Values and the Dynamic Pseudo-type An _unknown value_ is a placeholder for a value that is not yet known. Operations on unknown values themselves return unknown values that have a type appropriate to the operation. For example, adding together two unknown numbers yields an unknown number, while comparing two unknown values of any type for equality yields an unknown bool. Each type has a distinct unknown value. For example, an unknown _number_ is a distinct value from an unknown _string_. _The dynamic pseudo-type_ is a placeholder for a type that is not yet known. The only values of this type are its null value and its unknown value. It is referred to as a _pseudo-type_ because it should not be considered a type in its own right, but rather as a placeholder for a type yet to be established. The unknown value of the dynamic pseudo-type is referred to as _the dynamic value_. Operations on values of the dynamic pseudo-type behave as if it is a value of the expected type, optimistically assuming that once the value and type are known they will be valid for the operation. For example, adding together a number and the dynamic value produces an unknown number. Unknown values and the dynamic pseudo-type can be used as a mechanism for partial type checking and semantic checking: by evaluating an expression with all variables set to an unknown value, the expression can be evaluated to produce an unknown value of a given type, or produce an error if any operation is provably invalid with only type information. Unknown values and the dynamic pseudo-type must never be returned from operations unless at least one operand is unknown or dynamic. Calling applications are guaranteed that unless the global scope includes unknown values, or the function table includes functions that return unknown values, no expression will evaluate to an unknown value. The calling application is thus in total control over the use and meaning of unknown values. The dynamic pseudo-type is identical only to itself. ### Capsule Types A _capsule type_ is a custom type defined by the calling application. A value of a capsule type is considered opaque to HCL, but may be accepted by functions provided by the calling application. A particular capsule type is identical only to itself. The equality of two values of the same capsule type is defined by the calling application. No other operations are supported for values of capsule types. Support for capsule types in a HCL implementation is optional. Capsule types are intended to allow calling applications to pass through values that are not part of the standard type system. For example, an application that deals with raw binary data may define a capsule type representing a byte array, and provide functions that produce or operate on byte arrays. ### Type Specifications In certain situations it is necessary to define expectations about the expected type of a value. Whereas two _types_ have a commutative _identity_ relationship, a type has a non-commutative _matches_ relationship with a _type specification_. A type specification is, in practice, just a different interpretation of a type such that: - Any type _matches_ any type that it is identical to. - Any type _matches_ the dynamic pseudo-type. For example, given a type specification "list of dynamic pseudo-type", the concrete types "list of string" and "list of map" match, but the type "set of string" does not. ## Functions and Function Calls The evaluation context used to evaluate an expression includes a function table, which represents an application-defined set of named functions available for use in expressions. Each syntax defines whether function calls are supported and how they are physically represented in source code, but the semantics of function calls are defined here to ensure consistent results across syntaxes and to allow applications to provide functions that are interoperable with all syntaxes. A _function_ is defined from the following elements: - Zero or more _positional parameters_, each with a name used for documentation, a type specification for expected argument values, and a flag for whether each of null values, unknown values, and values of the dynamic pseudo-type are accepted. - Zero or one _variadic parameters_, with the same structure as the _positional_ parameters, which if present collects any additional arguments provided at the function call site. - A _result type definition_, which specifies the value type returned for each valid sequence of argument values. - A _result value definition_, which specifies the value returned for each valid sequence of argument values. A _function call_, regardless of source syntax, consists of a sequence of argument values. The argument values are each mapped to a corresponding parameter as follows: - For each of the function's positional parameters in sequence, take the next argument. If there are no more arguments, the call is erroneous. - If the function has a variadic parameter, take all remaining arguments that where not yet assigned to a positional parameter and collect them into a sequence of variadic arguments that each correspond to the variadic parameter. - If the function has _no_ variadic parameter, it is an error if any arguments remain after taking one argument for each positional parameter. After mapping each argument to a parameter, semantic checking proceeds for each argument: - If the argument value corresponding to a parameter does not match the parameter's type specification, the call is erroneous. - If the argument value corresponding to a parameter is null and the parameter is not specified as accepting nulls, the call is erroneous. - If the argument value corresponding to a parameter is the dynamic value and the parameter is not specified as accepting values of the dynamic pseudo-type, the call is valid but its _result type_ is forced to be the dynamic pseudo type. - If neither of the above conditions holds for any argument, the call is valid and the function's value type definition is used to determine the call's _result type_. A function _may_ vary its result type depending on the argument _values_ as well as the argument _types_; for example, a function that decodes a JSON value will return a different result type depending on the data structure described by the given JSON source code. If semantic checking succeeds without error, the call is _executed_: - For each argument, if its value is unknown and its corresponding parameter is not specified as accepting unknowns, the _result value_ is forced to be an unknown value of the result type. - If the previous condition does not apply, the function's result value definition is used to determine the call's _result value_. The result of a function call expression is either an error, if one of the erroneous conditions above applies, or the _result value_. ## Type Conversions and Unification Values given in configuration may not always match the expectations of the operations applied to them or to the calling application. In such situations, automatic type conversion is attempted as a convenience to the user. Along with conversions to a _specified_ type, it is sometimes necessary to ensure that a selection of values are all of the _same_ type, without any constraint on which type that is. This is the process of _type unification_, which attempts to find the most general type that all of the given types can be converted to. Both type conversions and unification are defined in the syntax-agnostic model to ensure consistency of behavior between syntaxes. Type conversions are broadly characterized into two categories: _safe_ and _unsafe_. A conversion is "safe" if any distinct value of the source type has a corresponding distinct value in the target type. A conversion is "unsafe" if either the target type values are _not_ distinct (information may be lost in conversion) or if some values of the source type do not have any corresponding value in the target type. An unsafe conversion may result in an error. A given type can always be converted to itself, which is a no-op. ### Conversion of Null Values All null values are safely convertable to a null value of any other type, regardless of other type-specific rules specified in the sections below. ### Conversion to and from the Dynamic Pseudo-type Conversion _from_ the dynamic pseudo-type _to_ any other type always succeeds, producing an unknown value of the target type. Conversion of any value _to_ the dynamic pseudo-type is a no-op. The result is the input value, verbatim. This is the only situation where the conversion result value is not of the given target type. ### Primitive Type Conversions Bidirectional conversions are available between the string and number types, and between the string and boolean types. The bool value true corresponds to the string containing the characters "true", while the bool value false corresponds to the string containing the characters "false". Conversion from bool to string is safe, while the converse is unsafe. The strings "1" and "0" are alternative string representations of true and false respectively. It is an error to convert a string other than the four in this paragraph to type bool. A number value is converted to string by translating its integer portion into a sequence of decimal digits (`0` through `9`), and then if it has a non-zero fractional part, a period `.` followed by a sequence of decimal digits representing its fractional part. No exponent portion is included. The number is converted at its full precision. Conversion from number to string is safe. A string is converted to a number value by reversing the above mapping. No exponent portion is allowed. Conversion from string to number is unsafe. It is an error to convert a string that does not comply with the expected syntax to type number. No direct conversion is available between the bool and number types. ### Collection and Structural Type Conversions Conversion from set types to list types is _safe_, as long as their element types are safely convertable. If the element types are _unsafely_ convertable, then the collection conversion is also unsafe. Each set element becomes a corresponding list element, in an undefined order. Although no particular ordering is required, implementations _should_ produce list elements in a consistent order for a given input set, as a convenience to calling applications. Conversion from list types to set types is _unsafe_, as long as their element types are convertable. Each distinct list item becomes a distinct set item. If two list items are equal, one of the two is lost in the conversion. Conversion from tuple types to list types permitted if all of the tuple element types are convertable to the target list element type. The safety of the conversion depends on the safety of each of the element conversions. Each element in turn is converted to the list element type, producing a list of identical length. Conversion from tuple types to set types is permitted, behaving as if the tuple type was first converted to a list of the same element type and then that list converted to the target set type. Conversion from object types to map types is permitted if all of the object attribute types are convertable to the target map element type. The safety of the conversion depends on the safety of each of the attribute conversions. Each attribute in turn is converted to the map element type, and map element keys are set to the name of each corresponding object attribute. Conversion from list and set types to tuple types is permitted, following the opposite steps as the converse conversions. Such conversions are _unsafe_. It is an error to convert a list or set to a tuple type whose number of elements does not match the list or set length. Conversion from map types to object types is permitted if each map key corresponds to an attribute in the target object type. It is an error to convert from a map value whose set of keys does not exactly match the target type's attributes. The conversion takes the opposite steps of the converse conversion. Conversion from one object type to another is permitted as long as the common attribute names have convertable types. Any attribute present in the target type but not in the source type is populated with a null value of the appropriate type. Conversion from one tuple type to another is permitted as long as the tuples have the same length and the elements have convertable types. ### Type Unification Type unification is an operation that takes a list of types and attempts to find a single type to which they can all be converted. Since some type pairs have bidirectional conversions, preference is given to _safe_ conversions. In technical terms, all possible types are arranged into a lattice, from which a most general supertype is selected where possible. The type resulting from type unification may be one of the input types, or it may be an entirely new type produced by combination of two or more input types. The following rules do not guarantee a valid result. In addition to these rules, unification fails if any of the given types are not convertable (per the above rules) to the selected result type. The following unification rules apply transitively. That is, if a rule is defined from A to B, and one from B to C, then A can unify to C. Number and bool types both unify with string by preferring string. Two collection types of the same kind unify according to the unification of their element types. List and set types unify by preferring the list type. Map and object types unify by preferring the object type. List, set and tuple types unify by preferring the tuple type. The dynamic pseudo-type unifies with any other type by selecting that other type. The dynamic pseudo-type is the result type only if _all_ input types are the dynamic pseudo-type. Two object types unify by constructing a new type whose attributes are the union of those of the two input types. Any common attributes themselves have their types unified. Two tuple types of the same length unify constructing a new type of the same length whose elements are the unification of the corresponding elements in the two input types. ## Static Analysis In most applications, full expression evaluation is sufficient for understanding the provided configuration. However, some specialized applications require more direct access to the physical structures in the expressions, which can for example allow the construction of new language constructs in terms of the existing syntax elements. Since static analysis analyses the physical structure of configuration, the details will vary depending on syntax. Each syntax must decide which of its physical structures corresponds to the following analyses, producing error diagnostics if they are applied to inappropriate expressions. The following are the required static analysis functions: - **Static List**: Require list/tuple construction syntax to be used and return a list of expressions for each of the elements given. - **Static Map**: Require map/object construction syntax to be used and return a list of key/value pairs -- both expressions -- for each of the elements given. The usual constraint that a map key must be a string must not apply to this analysis, thus allowing applications to interpret arbitrary keys as they see fit. - **Static Call**: Require function call syntax to be used and return an object describing the called function name and a list of expressions representing each of the call arguments. - **Static Traversal**: Require a reference to a symbol in the variable scope and return a description of the path from the root scope to the accessed attribute or index. The intent of a calling application using these features is to require a more rigid interpretation of the configuration than in expression evaluation. Syntax implementations should make use of the extra contextual information provided in order to make an intuitive mapping onto the constructs of the underlying syntax, possibly interpreting the expression slightly differently than it would be interpreted in normal evaluation. Each syntax must define which of its expression elements each of the analyses above applies to, and how those analyses behave given those expression elements. ## Implementation Considerations Implementations of this specification are free to adopt any strategy that produces behavior consistent with the specification. This non-normative section describes some possible implementation strategies that are consistent with the goals of this specification. ### Language-agnosticism The language-agnosticism of this specification assumes that certain behaviors are implemented separately for each syntax: - Matching of a body schema with the physical elements of a body in the source language, to determine correspondence between physical constructs and schema elements. - Implementing the _dynamic attributes_ body processing mode by either interpreting all physical constructs as attributes or producing an error if non-attribute constructs are present. - Providing an evaluation function for all possible expressions that produces a value given an evaluation context. - Providing the static analysis functionality described above in a manner that makes sense within the convention of the syntax. The suggested implementation strategy is to use an implementation language's closest concept to an _abstract type_, _virtual type_ or _interface type_ to represent both Body and Expression. Each language-specific implementation can then provide an implementation of each of these types wrapping AST nodes or other physical constructs from the language parser. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/static_expr.go����������������������������������0000664�0000000�0000000�00000001673�13771713062�0024757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "github.com/zclconf/go-cty/cty" ) type staticExpr struct { val cty.Value rng Range } // StaticExpr returns an Expression that always evaluates to the given value. // // This is useful to substitute default values for expressions that are // not explicitly given in configuration and thus would otherwise have no // Expression to return. // // Since expressions are expected to have a source range, the caller must // provide one. Ideally this should be a real source range, but it can // be a synthetic one (with an empty-string filename) if no suitable range // is available. func StaticExpr(val cty.Value, rng Range) Expression { return staticExpr{val, rng} } func (e staticExpr) Value(ctx *EvalContext) (cty.Value, Diagnostics) { return e.val, nil } func (e staticExpr) Variables() []Traversal { return nil } func (e staticExpr) Range() Range { return e.rng } func (e staticExpr) StartRange() Range { return e.rng } ���������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/structure.go������������������������������������0000664�0000000�0000000�00000012371�13771713062�0024467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "github.com/zclconf/go-cty/cty" ) // File is the top-level node that results from parsing a HCL file. type File struct { Body Body Bytes []byte // Nav is used to integrate with the "hcled" editor integration package, // and with diagnostic information formatters. It is not for direct use // by a calling application. Nav interface{} } // Block represents a nested block within a Body. type Block struct { Type string Labels []string Body Body DefRange Range // Range that can be considered the "definition" for seeking in an editor TypeRange Range // Range for the block type declaration specifically. LabelRanges []Range // Ranges for the label values specifically. } // Blocks is a sequence of Block. type Blocks []*Block // Attributes is a set of attributes keyed by their names. type Attributes map[string]*Attribute // Body is a container for attributes and blocks. It serves as the primary // unit of hierarchical structure within configuration. // // The content of a body cannot be meaningfully interpreted without a schema, // so Body represents the raw body content and has methods that allow the // content to be extracted in terms of a given schema. type Body interface { // Content verifies that the entire body content conforms to the given // schema and then returns it, and/or returns diagnostics. The returned // body content is valid if non-nil, regardless of whether Diagnostics // are provided, but diagnostics should still be eventually shown to // the user. Content(schema *BodySchema) (*BodyContent, Diagnostics) // PartialContent is like Content except that it permits the configuration // to contain additional blocks or attributes not specified in the // schema. If any are present, the returned Body is non-nil and contains // the remaining items from the body that were not selected by the schema. PartialContent(schema *BodySchema) (*BodyContent, Body, Diagnostics) // JustAttributes attempts to interpret all of the contents of the body // as attributes, allowing for the contents to be accessed without a priori // knowledge of the structure. // // The behavior of this method depends on the body's source language. // Some languages, like JSON, can't distinguish between attributes and // blocks without schema hints, but for languages that _can_ error // diagnostics will be generated if any blocks are present in the body. // // Diagnostics may be produced for other reasons too, such as duplicate // declarations of the same attribute. JustAttributes() (Attributes, Diagnostics) // MissingItemRange returns a range that represents where a missing item // might hypothetically be inserted. This is used when producing // diagnostics about missing required attributes or blocks. Not all bodies // will have an obvious single insertion point, so the result here may // be rather arbitrary. MissingItemRange() Range } // BodyContent is the result of applying a BodySchema to a Body. type BodyContent struct { Attributes Attributes Blocks Blocks MissingItemRange Range } // Attribute represents an attribute from within a body. type Attribute struct { Name string Expr Expression Range Range NameRange Range } // Expression is a literal value or an expression provided in the // configuration, which can be evaluated within a scope to produce a value. type Expression interface { // Value returns the value resulting from evaluating the expression // in the given evaluation context. // // The context may be nil, in which case the expression may contain // only constants and diagnostics will be produced for any non-constant // sub-expressions. (The exact definition of this depends on the source // language.) // // The context may instead be set but have either its Variables or // Functions maps set to nil, in which case only use of these features // will return diagnostics. // // Different diagnostics are provided depending on whether the given // context maps are nil or empty. In the former case, the message // tells the user that variables/functions are not permitted at all, // while in the latter case usage will produce a "not found" error for // the specific symbol in question. Value(ctx *EvalContext) (cty.Value, Diagnostics) // Variables returns a list of variables referenced in the receiving // expression. These are expressed as absolute Traversals, so may include // additional information about how the variable is used, such as // attribute lookups, which the calling application can potentially use // to only selectively populate the scope. Variables() []Traversal Range() Range StartRange() Range } // OfType filters the receiving block sequence by block type name, // returning a new block sequence including only the blocks of the // requested type. func (els Blocks) OfType(typeName string) Blocks { ret := make(Blocks, 0) for _, el := range els { if el.Type == typeName { ret = append(ret, el) } } return ret } // ByType transforms the receiving block sequence into a map from type // name to block sequences of only that type. func (els Blocks) ByType() map[string]Blocks { ret := make(map[string]Blocks) for _, el := range els { ty := el.Type if ret[ty] == nil { ret[ty] = make(Blocks, 0, 1) } ret[ty] = append(ret[ty], el) } return ret } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/structure_at_pos.go�����������������������������0000664�0000000�0000000�00000010352�13771713062�0026031�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl // ----------------------------------------------------------------------------- // The methods in this file all have the general pattern of making a best-effort // to find one or more constructs that contain a given source position. // // These all operate by delegating to an optional method of the same name and // signature on the file's root body, allowing each syntax to potentially // provide its own implementations of these. For syntaxes that don't implement // them, the result is always nil. // ----------------------------------------------------------------------------- // BlocksAtPos attempts to find all of the blocks that contain the given // position, ordered so that the outermost block is first and the innermost // block is last. This is a best-effort method that may not be able to produce // a complete result for all positions or for all HCL syntaxes. // // If the returned slice is non-empty, the first element is guaranteed to // represent the same block as would be the result of OutermostBlockAtPos and // the last element the result of InnermostBlockAtPos. However, the // implementation may return two different objects describing the same block, // so comparison by pointer identity is not possible. // // The result is nil if no blocks at all contain the given position. func (f *File) BlocksAtPos(pos Pos) []*Block { // The root body of the file must implement this interface in order // to support BlocksAtPos. type Interface interface { BlocksAtPos(pos Pos) []*Block } impl, ok := f.Body.(Interface) if !ok { return nil } return impl.BlocksAtPos(pos) } // OutermostBlockAtPos attempts to find a top-level block in the receiving file // that contains the given position. This is a best-effort method that may not // be able to produce a result for all positions or for all HCL syntaxes. // // The result is nil if no single block could be selected for any reason. func (f *File) OutermostBlockAtPos(pos Pos) *Block { // The root body of the file must implement this interface in order // to support OutermostBlockAtPos. type Interface interface { OutermostBlockAtPos(pos Pos) *Block } impl, ok := f.Body.(Interface) if !ok { return nil } return impl.OutermostBlockAtPos(pos) } // InnermostBlockAtPos attempts to find the most deeply-nested block in the // receiving file that contains the given position. This is a best-effort // method that may not be able to produce a result for all positions or for // all HCL syntaxes. // // The result is nil if no single block could be selected for any reason. func (f *File) InnermostBlockAtPos(pos Pos) *Block { // The root body of the file must implement this interface in order // to support InnermostBlockAtPos. type Interface interface { InnermostBlockAtPos(pos Pos) *Block } impl, ok := f.Body.(Interface) if !ok { return nil } return impl.InnermostBlockAtPos(pos) } // OutermostExprAtPos attempts to find an expression in the receiving file // that contains the given position. This is a best-effort method that may not // be able to produce a result for all positions or for all HCL syntaxes. // // Since expressions are often nested inside one another, this method returns // the outermost "root" expression that is not contained by any other. // // The result is nil if no single expression could be selected for any reason. func (f *File) OutermostExprAtPos(pos Pos) Expression { // The root body of the file must implement this interface in order // to support OutermostExprAtPos. type Interface interface { OutermostExprAtPos(pos Pos) Expression } impl, ok := f.Body.(Interface) if !ok { return nil } return impl.OutermostExprAtPos(pos) } // AttributeAtPos attempts to find an attribute definition in the receiving // file that contains the given position. This is a best-effort method that may // not be able to produce a result for all positions or for all HCL syntaxes. // // The result is nil if no single attribute could be selected for any reason. func (f *File) AttributeAtPos(pos Pos) *Attribute { // The root body of the file must implement this interface in order // to support OutermostExprAtPos. type Interface interface { AttributeAtPos(pos Pos) *Attribute } impl, ok := f.Body.(Interface) if !ok { return nil } return impl.AttributeAtPos(pos) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/traversal.go������������������������������������0000664�0000000�0000000�00000017675�13771713062�0024446�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl import ( "fmt" "github.com/zclconf/go-cty/cty" ) // A Traversal is a description of traversing through a value through a // series of operations such as attribute lookup, index lookup, etc. // // It is used to look up values in scopes, for example. // // The traversal operations are implementations of interface Traverser. // This is a closed set of implementations, so the interface cannot be // implemented from outside this package. // // A traversal can be absolute (its first value is a symbol name) or relative // (starts from an existing value). type Traversal []Traverser // TraversalJoin appends a relative traversal to an absolute traversal to // produce a new absolute traversal. func TraversalJoin(abs Traversal, rel Traversal) Traversal { if abs.IsRelative() { panic("first argument to TraversalJoin must be absolute") } if !rel.IsRelative() { panic("second argument to TraversalJoin must be relative") } ret := make(Traversal, len(abs)+len(rel)) copy(ret, abs) copy(ret[len(abs):], rel) return ret } // TraverseRel applies the receiving traversal to the given value, returning // the resulting value. This is supported only for relative traversals, // and will panic if applied to an absolute traversal. func (t Traversal) TraverseRel(val cty.Value) (cty.Value, Diagnostics) { if !t.IsRelative() { panic("can't use TraverseRel on an absolute traversal") } current := val var diags Diagnostics for _, tr := range t { var newDiags Diagnostics current, newDiags = tr.TraversalStep(current) diags = append(diags, newDiags...) if newDiags.HasErrors() { return cty.DynamicVal, diags } } return current, diags } // TraverseAbs applies the receiving traversal to the given eval context, // returning the resulting value. This is supported only for absolute // traversals, and will panic if applied to a relative traversal. func (t Traversal) TraverseAbs(ctx *EvalContext) (cty.Value, Diagnostics) { if t.IsRelative() { panic("can't use TraverseAbs on a relative traversal") } split := t.SimpleSplit() root := split.Abs[0].(TraverseRoot) name := root.Name thisCtx := ctx hasNonNil := false for thisCtx != nil { if thisCtx.Variables == nil { thisCtx = thisCtx.parent continue } hasNonNil = true val, exists := thisCtx.Variables[name] if exists { return split.Rel.TraverseRel(val) } thisCtx = thisCtx.parent } if !hasNonNil { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Variables not allowed", Detail: "Variables may not be used here.", Subject: &root.SrcRange, }, } } suggestions := make([]string, 0, len(ctx.Variables)) thisCtx = ctx for thisCtx != nil { for k := range thisCtx.Variables { suggestions = append(suggestions, k) } thisCtx = thisCtx.parent } suggestion := nameSuggestion(name, suggestions) if suggestion != "" { suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) } return cty.DynamicVal, Diagnostics{ { Severity: DiagError, Summary: "Unknown variable", Detail: fmt.Sprintf("There is no variable named %q.%s", name, suggestion), Subject: &root.SrcRange, }, } } // IsRelative returns true if the receiver is a relative traversal, or false // otherwise. func (t Traversal) IsRelative() bool { if len(t) == 0 { return true } if _, firstIsRoot := t[0].(TraverseRoot); firstIsRoot { return false } return true } // SimpleSplit returns a TraversalSplit where the name lookup is the absolute // part and the remainder is the relative part. Supported only for // absolute traversals, and will panic if applied to a relative traversal. // // This can be used by applications that have a relatively-simple variable // namespace where only the top-level is directly populated in the scope, with // everything else handled by relative lookups from those initial values. func (t Traversal) SimpleSplit() TraversalSplit { if t.IsRelative() { panic("can't use SimpleSplit on a relative traversal") } return TraversalSplit{ Abs: t[0:1], Rel: t[1:], } } // RootName returns the root name for a absolute traversal. Will panic if // called on a relative traversal. func (t Traversal) RootName() string { if t.IsRelative() { panic("can't use RootName on a relative traversal") } return t[0].(TraverseRoot).Name } // SourceRange returns the source range for the traversal. func (t Traversal) SourceRange() Range { if len(t) == 0 { // Nothing useful to return here, but we'll return something // that's correctly-typed at least. return Range{} } return RangeBetween(t[0].SourceRange(), t[len(t)-1].SourceRange()) } // TraversalSplit represents a pair of traversals, the first of which is // an absolute traversal and the second of which is relative to the first. // // This is used by calling applications that only populate prefixes of the // traversals in the scope, with Abs representing the part coming from the // scope and Rel representing the remaining steps once that part is // retrieved. type TraversalSplit struct { Abs Traversal Rel Traversal } // TraverseAbs traverses from a scope to the value resulting from the // absolute traversal. func (t TraversalSplit) TraverseAbs(ctx *EvalContext) (cty.Value, Diagnostics) { return t.Abs.TraverseAbs(ctx) } // TraverseRel traverses from a given value, assumed to be the result of // TraverseAbs on some scope, to a final result for the entire split traversal. func (t TraversalSplit) TraverseRel(val cty.Value) (cty.Value, Diagnostics) { return t.Rel.TraverseRel(val) } // Traverse is a convenience function to apply TraverseAbs followed by // TraverseRel. func (t TraversalSplit) Traverse(ctx *EvalContext) (cty.Value, Diagnostics) { v1, diags := t.TraverseAbs(ctx) if diags.HasErrors() { return cty.DynamicVal, diags } v2, newDiags := t.TraverseRel(v1) diags = append(diags, newDiags...) return v2, diags } // Join concatenates together the Abs and Rel parts to produce a single // absolute traversal. func (t TraversalSplit) Join() Traversal { return TraversalJoin(t.Abs, t.Rel) } // RootName returns the root name for the absolute part of the split. func (t TraversalSplit) RootName() string { return t.Abs.RootName() } // A Traverser is a step within a Traversal. type Traverser interface { TraversalStep(cty.Value) (cty.Value, Diagnostics) SourceRange() Range isTraverserSigil() isTraverser } // Embed this in a struct to declare it as a Traverser type isTraverser struct { } func (tr isTraverser) isTraverserSigil() isTraverser { return isTraverser{} } // TraverseRoot looks up a root name in a scope. It is used as the first step // of an absolute Traversal, and cannot itself be traversed directly. type TraverseRoot struct { isTraverser Name string SrcRange Range } // TraversalStep on a TraverseName immediately panics, because absolute // traversals cannot be directly traversed. func (tn TraverseRoot) TraversalStep(cty.Value) (cty.Value, Diagnostics) { panic("Cannot traverse an absolute traversal") } func (tn TraverseRoot) SourceRange() Range { return tn.SrcRange } // TraverseAttr looks up an attribute in its initial value. type TraverseAttr struct { isTraverser Name string SrcRange Range } func (tn TraverseAttr) TraversalStep(val cty.Value) (cty.Value, Diagnostics) { return GetAttr(val, tn.Name, &tn.SrcRange) } func (tn TraverseAttr) SourceRange() Range { return tn.SrcRange } // TraverseIndex applies the index operation to its initial value. type TraverseIndex struct { isTraverser Key cty.Value SrcRange Range } func (tn TraverseIndex) TraversalStep(val cty.Value) (cty.Value, Diagnostics) { return Index(val, tn.Key, &tn.SrcRange) } func (tn TraverseIndex) SourceRange() Range { return tn.SrcRange } // TraverseSplat applies the splat operation to its initial value. type TraverseSplat struct { isTraverser Each Traversal SrcRange Range } func (tn TraverseSplat) TraversalStep(val cty.Value) (cty.Value, Diagnostics) { panic("TraverseSplat not yet implemented") } func (tn TraverseSplat) SourceRange() Range { return tn.SrcRange } �������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/hcl/v2/traversal_for_expr.go���������������������������0000664�0000000�0000000�00000011220�13771713062�0026326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hcl // AbsTraversalForExpr attempts to interpret the given expression as // an absolute traversal, or returns error diagnostic(s) if that is // not possible for the given expression. // // A particular Expression implementation can support this function by // offering a method called AsTraversal that takes no arguments and // returns either a valid absolute traversal or nil to indicate that // no traversal is possible. Alternatively, an implementation can support // UnwrapExpression to delegate handling of this function to a wrapped // Expression object. // // In most cases the calling application is interested in the value // that results from an expression, but in rarer cases the application // needs to see the the name of the variable and subsequent // attributes/indexes itself, for example to allow users to give references // to the variables themselves rather than to their values. An implementer // of this function should at least support attribute and index steps. func AbsTraversalForExpr(expr Expression) (Traversal, Diagnostics) { type asTraversal interface { AsTraversal() Traversal } physExpr := UnwrapExpressionUntil(expr, func(expr Expression) bool { _, supported := expr.(asTraversal) return supported }) if asT, supported := physExpr.(asTraversal); supported { if traversal := asT.AsTraversal(); traversal != nil { return traversal, nil } } return nil, Diagnostics{ &Diagnostic{ Severity: DiagError, Summary: "Invalid expression", Detail: "A single static variable reference is required: only attribute access and indexing with constant keys. No calculations, function calls, template expressions, etc are allowed here.", Subject: expr.Range().Ptr(), }, } } // RelTraversalForExpr is similar to AbsTraversalForExpr but it returns // a relative traversal instead. Due to the nature of HCL expressions, the // first element of the returned traversal is always a TraverseAttr, and // then it will be followed by zero or more other expressions. // // Any expression accepted by AbsTraversalForExpr is also accepted by // RelTraversalForExpr. func RelTraversalForExpr(expr Expression) (Traversal, Diagnostics) { traversal, diags := AbsTraversalForExpr(expr) if len(traversal) > 0 { ret := make(Traversal, len(traversal)) copy(ret, traversal) root := traversal[0].(TraverseRoot) ret[0] = TraverseAttr{ Name: root.Name, SrcRange: root.SrcRange, } return ret, diags } return traversal, diags } // ExprAsKeyword attempts to interpret the given expression as a static keyword, // returning the keyword string if possible, and the empty string if not. // // A static keyword, for the sake of this function, is a single identifier. // For example, the following attribute has an expression that would produce // the keyword "foo": // // example = foo // // This function is a variant of AbsTraversalForExpr, which uses the same // interface on the given expression. This helper constrains the result // further by requiring only a single root identifier. // // This function is intended to be used with the following idiom, to recognize // situations where one of a fixed set of keywords is required and arbitrary // expressions are not allowed: // // switch hcl.ExprAsKeyword(expr) { // case "allow": // // (take suitable action for keyword "allow") // case "deny": // // (take suitable action for keyword "deny") // default: // diags = append(diags, &hcl.Diagnostic{ // // ... "invalid keyword" diagnostic message ... // }) // } // // The above approach will generate the same message for both the use of an // unrecognized keyword and for not using a keyword at all, which is usually // reasonable if the message specifies that the given value must be a keyword // from that fixed list. // // Note that in the native syntax the keywords "true", "false", and "null" are // recognized as literal values during parsing and so these reserved words // cannot not be accepted as keywords by this function. // // Since interpreting an expression as a keyword bypasses usual expression // evaluation, it should be used sparingly for situations where e.g. one of // a fixed set of keywords is used in a structural way in a special attribute // to affect the further processing of a block. func ExprAsKeyword(expr Expression) string { type asTraversal interface { AsTraversal() Traversal } physExpr := UnwrapExpressionUntil(expr, func(expr Expression) bool { _, supported := expr.(asTraversal) return supported }) if asT, supported := physExpr.(asTraversal); supported { if traversal := asT.AsTraversal(); len(traversal) == 1 { return traversal.RootName() } } return "" } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/�������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022132�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022703�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/LICENSE��������������������������������������0000664�0000000�0000000�00000037062�13771713062�0023720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/auth.go��������������������������������������0000664�0000000�0000000�00000000355�13771713062�0024176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // Auth is used to perform credential backend related operations. type Auth struct { c *Client } // Auth is used to return the client for credential-backend API calls. func (c *Client) Auth() *Auth { return &Auth{c: c} } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/auth_token.go��������������������������������0000664�0000000�0000000�00000016571�13771713062�0025405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import "context" // TokenAuth is used to perform token backend operations on Vault type TokenAuth struct { c *Client } // Token is used to return the client for token-backend API calls func (a *Auth) Token() *TokenAuth { return &TokenAuth{c: a.c} } func (c *TokenAuth) Create(opts *TokenCreateRequest) (*Secret, error) { r := c.c.NewRequest("POST", "/v1/auth/token/create") if err := r.SetJSONBody(opts); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *TokenAuth) CreateOrphan(opts *TokenCreateRequest) (*Secret, error) { r := c.c.NewRequest("POST", "/v1/auth/token/create-orphan") if err := r.SetJSONBody(opts); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *TokenAuth) CreateWithRole(opts *TokenCreateRequest, roleName string) (*Secret, error) { r := c.c.NewRequest("POST", "/v1/auth/token/create/"+roleName) if err := r.SetJSONBody(opts); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *TokenAuth) Lookup(token string) (*Secret, error) { r := c.c.NewRequest("POST", "/v1/auth/token/lookup") if err := r.SetJSONBody(map[string]interface{}{ "token": token, }); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *TokenAuth) LookupAccessor(accessor string) (*Secret, error) { r := c.c.NewRequest("POST", "/v1/auth/token/lookup-accessor") if err := r.SetJSONBody(map[string]interface{}{ "accessor": accessor, }); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *TokenAuth) LookupSelf() (*Secret, error) { r := c.c.NewRequest("GET", "/v1/auth/token/lookup-self") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *TokenAuth) Renew(token string, increment int) (*Secret, error) { r := c.c.NewRequest("PUT", "/v1/auth/token/renew") if err := r.SetJSONBody(map[string]interface{}{ "token": token, "increment": increment, }); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *TokenAuth) RenewSelf(increment int) (*Secret, error) { r := c.c.NewRequest("PUT", "/v1/auth/token/renew-self") body := map[string]interface{}{"increment": increment} if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } // RenewTokenAsSelf behaves like renew-self, but authenticates using a provided // token instead of the token attached to the client. func (c *TokenAuth) RenewTokenAsSelf(token string, increment int) (*Secret, error) { r := c.c.NewRequest("PUT", "/v1/auth/token/renew-self") r.ClientToken = token body := map[string]interface{}{"increment": increment} if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } // RevokeAccessor revokes a token associated with the given accessor // along with all the child tokens. func (c *TokenAuth) RevokeAccessor(accessor string) error { r := c.c.NewRequest("POST", "/v1/auth/token/revoke-accessor") if err := r.SetJSONBody(map[string]interface{}{ "accessor": accessor, }); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } // RevokeOrphan revokes a token without revoking the tree underneath it (so // child tokens are orphaned rather than revoked) func (c *TokenAuth) RevokeOrphan(token string) error { r := c.c.NewRequest("PUT", "/v1/auth/token/revoke-orphan") if err := r.SetJSONBody(map[string]interface{}{ "token": token, }); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } // RevokeSelf revokes the token making the call. The `token` parameter is kept // for backwards compatibility but is ignored; only the client's set token has // an effect. func (c *TokenAuth) RevokeSelf(token string) error { r := c.c.NewRequest("PUT", "/v1/auth/token/revoke-self") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } // RevokeTree is the "normal" revoke operation that revokes the given token and // the entire tree underneath -- all of its child tokens, their child tokens, // etc. func (c *TokenAuth) RevokeTree(token string) error { r := c.c.NewRequest("PUT", "/v1/auth/token/revoke") if err := r.SetJSONBody(map[string]interface{}{ "token": token, }); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } // TokenCreateRequest is the options structure for creating a token. type TokenCreateRequest struct { ID string `json:"id,omitempty"` Policies []string `json:"policies,omitempty"` Metadata map[string]string `json:"meta,omitempty"` Lease string `json:"lease,omitempty"` TTL string `json:"ttl,omitempty"` ExplicitMaxTTL string `json:"explicit_max_ttl,omitempty"` Period string `json:"period,omitempty"` NoParent bool `json:"no_parent,omitempty"` NoDefaultPolicy bool `json:"no_default_policy,omitempty"` DisplayName string `json:"display_name"` NumUses int `json:"num_uses"` Renewable *bool `json:"renewable,omitempty"` Type string `json:"type"` EntityAlias string `json:"entity_alias"` } ���������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/client.go������������������������������������0000664�0000000�0000000�00000056645�13771713062�0024530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "crypto/tls" "fmt" "net" "net/http" "net/url" "os" "path" "strconv" "strings" "sync" "time" "unicode" "github.com/hashicorp/errwrap" cleanhttp "github.com/hashicorp/go-cleanhttp" retryablehttp "github.com/hashicorp/go-retryablehttp" rootcerts "github.com/hashicorp/go-rootcerts" "github.com/hashicorp/vault/sdk/helper/consts" "github.com/hashicorp/vault/sdk/helper/parseutil" "golang.org/x/net/http2" "golang.org/x/time/rate" ) const EnvVaultAddress = "VAULT_ADDR" const EnvVaultAgentAddr = "VAULT_AGENT_ADDR" const EnvVaultCACert = "VAULT_CACERT" const EnvVaultCAPath = "VAULT_CAPATH" const EnvVaultClientCert = "VAULT_CLIENT_CERT" const EnvVaultClientKey = "VAULT_CLIENT_KEY" const EnvVaultClientTimeout = "VAULT_CLIENT_TIMEOUT" const EnvVaultSkipVerify = "VAULT_SKIP_VERIFY" const EnvVaultNamespace = "VAULT_NAMESPACE" const EnvVaultTLSServerName = "VAULT_TLS_SERVER_NAME" const EnvVaultWrapTTL = "VAULT_WRAP_TTL" const EnvVaultMaxRetries = "VAULT_MAX_RETRIES" const EnvVaultToken = "VAULT_TOKEN" const EnvVaultMFA = "VAULT_MFA" const EnvRateLimit = "VAULT_RATE_LIMIT" // Deprecated values const EnvVaultAgentAddress = "VAULT_AGENT_ADDR" const EnvVaultInsecure = "VAULT_SKIP_VERIFY" // WrappingLookupFunc is a function that, given an HTTP verb and a path, // returns an optional string duration to be used for response wrapping (e.g. // "15s", or simply "15"). The path will not begin with "/v1/" or "v1/" or "/", // however, end-of-path forward slashes are not trimmed, so must match your // called path precisely. type WrappingLookupFunc func(operation, path string) string // Config is used to configure the creation of the client. type Config struct { modifyLock sync.RWMutex // Address is the address of the Vault server. This should be a complete // URL such as "http://vault.example.com". If you need a custom SSL // cert or want to enable insecure mode, you need to specify a custom // HttpClient. Address string // AgentAddress is the address of the local Vault agent. This should be a // complete URL such as "http://vault.example.com". AgentAddress string // HttpClient is the HTTP client to use. Vault sets sane defaults for the // http.Client and its associated http.Transport created in DefaultConfig. // If you must modify Vault's defaults, it is suggested that you start with // that client and modify as needed rather than start with an empty client // (or http.DefaultClient). HttpClient *http.Client // MaxRetries controls the maximum number of times to retry when a 5xx // error occurs. Set to 0 to disable retrying. Defaults to 2 (for a total // of three tries). MaxRetries int // Timeout is for setting custom timeout parameter in the HttpClient Timeout time.Duration // If there is an error when creating the configuration, this will be the // error Error error // The Backoff function to use; a default is used if not provided Backoff retryablehttp.Backoff // Limiter is the rate limiter used by the client. // If this pointer is nil, then there will be no limit set. // In contrast, if this pointer is set, even to an empty struct, // then that limiter will be used. Note that an empty Limiter // is equivalent blocking all events. Limiter *rate.Limiter // OutputCurlString causes the actual request to return an error of type // *OutputStringError. Type asserting the error message will allow // fetching a cURL-compatible string for the operation. // // Note: It is not thread-safe to set this and make concurrent requests // with the same client. Cloning a client will not clone this value. OutputCurlString bool } // TLSConfig contains the parameters needed to configure TLS on the HTTP client // used to communicate with Vault. type TLSConfig struct { // CACert is the path to a PEM-encoded CA cert file to use to verify the // Vault server SSL certificate. CACert string // CAPath is the path to a directory of PEM-encoded CA cert files to verify // the Vault server SSL certificate. CAPath string // ClientCert is the path to the certificate for Vault communication ClientCert string // ClientKey is the path to the private key for Vault communication ClientKey string // TLSServerName, if set, is used to set the SNI host when connecting via // TLS. TLSServerName string // Insecure enables or disables SSL verification Insecure bool } // DefaultConfig returns a default configuration for the client. It is // safe to modify the return value of this function. // // The default Address is https://127.0.0.1:8200, but this can be overridden by // setting the `VAULT_ADDR` environment variable. // // If an error is encountered, this will return nil. func DefaultConfig() *Config { config := &Config{ Address: "https://127.0.0.1:8200", HttpClient: cleanhttp.DefaultPooledClient(), } config.HttpClient.Timeout = time.Second * 60 transport := config.HttpClient.Transport.(*http.Transport) transport.TLSHandshakeTimeout = 10 * time.Second transport.TLSClientConfig = &tls.Config{ MinVersion: tls.VersionTLS12, } if err := http2.ConfigureTransport(transport); err != nil { config.Error = err return config } if err := config.ReadEnvironment(); err != nil { config.Error = err return config } // Ensure redirects are not automatically followed // Note that this is sane for the API client as it has its own // redirect handling logic (and thus also for command/meta), // but in e.g. http_test actual redirect handling is necessary config.HttpClient.CheckRedirect = func(req *http.Request, via []*http.Request) error { // Returning this value causes the Go net library to not close the // response body and to nil out the error. Otherwise retry clients may // try three times on every redirect because it sees an error from this // function (to prevent redirects) passing through to it. return http.ErrUseLastResponse } config.Backoff = retryablehttp.LinearJitterBackoff config.MaxRetries = 2 return config } // ConfigureTLS takes a set of TLS configurations and applies those to the the // HTTP client. func (c *Config) ConfigureTLS(t *TLSConfig) error { if c.HttpClient == nil { c.HttpClient = DefaultConfig().HttpClient } clientTLSConfig := c.HttpClient.Transport.(*http.Transport).TLSClientConfig var clientCert tls.Certificate foundClientCert := false switch { case t.ClientCert != "" && t.ClientKey != "": var err error clientCert, err = tls.LoadX509KeyPair(t.ClientCert, t.ClientKey) if err != nil { return err } foundClientCert = true case t.ClientCert != "" || t.ClientKey != "": return fmt.Errorf("both client cert and client key must be provided") } if t.CACert != "" || t.CAPath != "" { rootConfig := &rootcerts.Config{ CAFile: t.CACert, CAPath: t.CAPath, } if err := rootcerts.ConfigureTLS(clientTLSConfig, rootConfig); err != nil { return err } } if t.Insecure { clientTLSConfig.InsecureSkipVerify = true } if foundClientCert { // We use this function to ignore the server's preferential list of // CAs, otherwise any CA used for the cert auth backend must be in the // server's CA pool clientTLSConfig.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) { return &clientCert, nil } } if t.TLSServerName != "" { clientTLSConfig.ServerName = t.TLSServerName } return nil } // ReadEnvironment reads configuration information from the environment. If // there is an error, no configuration value is updated. func (c *Config) ReadEnvironment() error { var envAddress string var envAgentAddress string var envCACert string var envCAPath string var envClientCert string var envClientKey string var envClientTimeout time.Duration var envInsecure bool var envTLSServerName string var envMaxRetries *uint64 var limit *rate.Limiter // Parse the environment variables if v := os.Getenv(EnvVaultAddress); v != "" { envAddress = v } if v := os.Getenv(EnvVaultAgentAddr); v != "" { envAgentAddress = v } else if v := os.Getenv(EnvVaultAgentAddress); v != "" { envAgentAddress = v } if v := os.Getenv(EnvVaultMaxRetries); v != "" { maxRetries, err := strconv.ParseUint(v, 10, 32) if err != nil { return err } envMaxRetries = &maxRetries } if v := os.Getenv(EnvVaultCACert); v != "" { envCACert = v } if v := os.Getenv(EnvVaultCAPath); v != "" { envCAPath = v } if v := os.Getenv(EnvVaultClientCert); v != "" { envClientCert = v } if v := os.Getenv(EnvVaultClientKey); v != "" { envClientKey = v } if v := os.Getenv(EnvRateLimit); v != "" { rateLimit, burstLimit, err := parseRateLimit(v) if err != nil { return err } limit = rate.NewLimiter(rate.Limit(rateLimit), burstLimit) } if t := os.Getenv(EnvVaultClientTimeout); t != "" { clientTimeout, err := parseutil.ParseDurationSecond(t) if err != nil { return fmt.Errorf("could not parse %q", EnvVaultClientTimeout) } envClientTimeout = clientTimeout } if v := os.Getenv(EnvVaultSkipVerify); v != "" { var err error envInsecure, err = strconv.ParseBool(v) if err != nil { return fmt.Errorf("could not parse VAULT_SKIP_VERIFY") } } else if v := os.Getenv(EnvVaultInsecure); v != "" { var err error envInsecure, err = strconv.ParseBool(v) if err != nil { return fmt.Errorf("could not parse VAULT_INSECURE") } } if v := os.Getenv(EnvVaultTLSServerName); v != "" { envTLSServerName = v } // Configure the HTTP clients TLS configuration. t := &TLSConfig{ CACert: envCACert, CAPath: envCAPath, ClientCert: envClientCert, ClientKey: envClientKey, TLSServerName: envTLSServerName, Insecure: envInsecure, } c.modifyLock.Lock() defer c.modifyLock.Unlock() c.Limiter = limit if err := c.ConfigureTLS(t); err != nil { return err } if envAddress != "" { c.Address = envAddress } if envAgentAddress != "" { c.AgentAddress = envAgentAddress } if envMaxRetries != nil { c.MaxRetries = int(*envMaxRetries) } if envClientTimeout != 0 { c.Timeout = envClientTimeout } return nil } func parseRateLimit(val string) (rate float64, burst int, err error) { _, err = fmt.Sscanf(val, "%f:%d", &rate, &burst) if err != nil { rate, err = strconv.ParseFloat(val, 64) if err != nil { err = fmt.Errorf("%v was provided but incorrectly formatted", EnvRateLimit) } burst = int(rate) } return rate, burst, err } // Client is the client to the Vault API. Create a client with NewClient. type Client struct { modifyLock sync.RWMutex addr *url.URL config *Config token string headers http.Header wrappingLookupFunc WrappingLookupFunc mfaCreds []string policyOverride bool } // NewClient returns a new client for the given configuration. // // If the configuration is nil, Vault will use configuration from // DefaultConfig(), which is the recommended starting configuration. // // If the environment variable `VAULT_TOKEN` is present, the token will be // automatically added to the client. Otherwise, you must manually call // `SetToken()`. func NewClient(c *Config) (*Client, error) { def := DefaultConfig() if def == nil { return nil, fmt.Errorf("could not create/read default configuration") } if def.Error != nil { return nil, errwrap.Wrapf("error encountered setting up default configuration: {{err}}", def.Error) } if c == nil { c = def } c.modifyLock.Lock() defer c.modifyLock.Unlock() if c.HttpClient == nil { c.HttpClient = def.HttpClient } if c.HttpClient.Transport == nil { c.HttpClient.Transport = def.HttpClient.Transport } address := c.Address if c.AgentAddress != "" { address = c.AgentAddress } u, err := url.Parse(address) if err != nil { return nil, err } if strings.HasPrefix(address, "unix://") { socket := strings.TrimPrefix(address, "unix://") transport := c.HttpClient.Transport.(*http.Transport) transport.DialContext = func(context.Context, string, string) (net.Conn, error) { return net.Dial("unix", socket) } // Since the address points to a unix domain socket, the scheme in the // *URL would be set to `unix`. The *URL in the client is expected to // be pointing to the protocol used in the application layer and not to // the transport layer. Hence, setting the fields accordingly. u.Scheme = "http" u.Host = socket u.Path = "" } client := &Client{ addr: u, config: c, } if token := os.Getenv(EnvVaultToken); token != "" { client.token = token } if namespace := os.Getenv(EnvVaultNamespace); namespace != "" { client.setNamespace(namespace) } return client, nil } // Sets the address of Vault in the client. The format of address should be // "<Scheme>://<Host>:<Port>". Setting this on a client will override the // value of VAULT_ADDR environment variable. func (c *Client) SetAddress(addr string) error { c.modifyLock.Lock() defer c.modifyLock.Unlock() parsedAddr, err := url.Parse(addr) if err != nil { return errwrap.Wrapf("failed to set address: {{err}}", err) } c.addr = parsedAddr return nil } // Address returns the Vault URL the client is configured to connect to func (c *Client) Address() string { c.modifyLock.RLock() defer c.modifyLock.RUnlock() return c.addr.String() } // SetLimiter will set the rate limiter for this client. // This method is thread-safe. // rateLimit and burst are specified according to https://godoc.org/golang.org/x/time/rate#NewLimiter func (c *Client) SetLimiter(rateLimit float64, burst int) { c.modifyLock.RLock() c.config.modifyLock.Lock() defer c.config.modifyLock.Unlock() c.modifyLock.RUnlock() c.config.Limiter = rate.NewLimiter(rate.Limit(rateLimit), burst) } // SetMaxRetries sets the number of retries that will be used in the case of certain errors func (c *Client) SetMaxRetries(retries int) { c.modifyLock.RLock() c.config.modifyLock.Lock() defer c.config.modifyLock.Unlock() c.modifyLock.RUnlock() c.config.MaxRetries = retries } // SetClientTimeout sets the client request timeout func (c *Client) SetClientTimeout(timeout time.Duration) { c.modifyLock.RLock() c.config.modifyLock.Lock() defer c.config.modifyLock.Unlock() c.modifyLock.RUnlock() c.config.Timeout = timeout } func (c *Client) OutputCurlString() bool { c.modifyLock.RLock() c.config.modifyLock.RLock() defer c.config.modifyLock.RUnlock() c.modifyLock.RUnlock() return c.config.OutputCurlString } func (c *Client) SetOutputCurlString(curl bool) { c.modifyLock.RLock() c.config.modifyLock.Lock() defer c.config.modifyLock.Unlock() c.modifyLock.RUnlock() c.config.OutputCurlString = curl } // CurrentWrappingLookupFunc sets a lookup function that returns desired wrap TTLs // for a given operation and path func (c *Client) CurrentWrappingLookupFunc() WrappingLookupFunc { c.modifyLock.RLock() defer c.modifyLock.RUnlock() return c.wrappingLookupFunc } // SetWrappingLookupFunc sets a lookup function that returns desired wrap TTLs // for a given operation and path func (c *Client) SetWrappingLookupFunc(lookupFunc WrappingLookupFunc) { c.modifyLock.Lock() defer c.modifyLock.Unlock() c.wrappingLookupFunc = lookupFunc } // SetMFACreds sets the MFA credentials supplied either via the environment // variable or via the command line. func (c *Client) SetMFACreds(creds []string) { c.modifyLock.Lock() defer c.modifyLock.Unlock() c.mfaCreds = creds } // SetNamespace sets the namespace supplied either via the environment // variable or via the command line. func (c *Client) SetNamespace(namespace string) { c.modifyLock.Lock() defer c.modifyLock.Unlock() c.setNamespace(namespace) } func (c *Client) setNamespace(namespace string) { if c.headers == nil { c.headers = make(http.Header) } c.headers.Set(consts.NamespaceHeaderName, namespace) } // Token returns the access token being used by this client. It will // return the empty string if there is no token set. func (c *Client) Token() string { c.modifyLock.RLock() defer c.modifyLock.RUnlock() return c.token } // SetToken sets the token directly. This won't perform any auth // verification, it simply sets the token properly for future requests. func (c *Client) SetToken(v string) { c.modifyLock.Lock() defer c.modifyLock.Unlock() c.token = v } // ClearToken deletes the token if it is set or does nothing otherwise. func (c *Client) ClearToken() { c.modifyLock.Lock() defer c.modifyLock.Unlock() c.token = "" } // Headers gets the current set of headers used for requests. This returns a // copy; to modify it make modifications locally and use SetHeaders. func (c *Client) Headers() http.Header { c.modifyLock.RLock() defer c.modifyLock.RUnlock() if c.headers == nil { return nil } ret := make(http.Header) for k, v := range c.headers { for _, val := range v { ret[k] = append(ret[k], val) } } return ret } // SetHeaders sets the headers to be used for future requests. func (c *Client) SetHeaders(headers http.Header) { c.modifyLock.Lock() defer c.modifyLock.Unlock() c.headers = headers } // SetBackoff sets the backoff function to be used for future requests. func (c *Client) SetBackoff(backoff retryablehttp.Backoff) { c.modifyLock.RLock() c.config.modifyLock.Lock() defer c.config.modifyLock.Unlock() c.modifyLock.RUnlock() c.config.Backoff = backoff } // Clone creates a new client with the same configuration. Note that the same // underlying http.Client is used; modifying the client from more than one // goroutine at once may not be safe, so modify the client as needed and then // clone. // // Also, only the client's config is currently copied; this means items not in // the api.Config struct, such as policy override and wrapping function // behavior, must currently then be set as desired on the new client. func (c *Client) Clone() (*Client, error) { c.modifyLock.RLock() c.config.modifyLock.RLock() config := c.config c.modifyLock.RUnlock() newConfig := &Config{ Address: config.Address, HttpClient: config.HttpClient, MaxRetries: config.MaxRetries, Timeout: config.Timeout, Backoff: config.Backoff, Limiter: config.Limiter, } config.modifyLock.RUnlock() return NewClient(newConfig) } // SetPolicyOverride sets whether requests should be sent with the policy // override flag to request overriding soft-mandatory Sentinel policies (both // RGPs and EGPs) func (c *Client) SetPolicyOverride(override bool) { c.modifyLock.Lock() defer c.modifyLock.Unlock() c.policyOverride = override } // NewRequest creates a new raw request object to query the Vault server // configured for this client. This is an advanced method and generally // doesn't need to be called externally. func (c *Client) NewRequest(method, requestPath string) *Request { c.modifyLock.RLock() addr := c.addr token := c.token mfaCreds := c.mfaCreds wrappingLookupFunc := c.wrappingLookupFunc headers := c.headers policyOverride := c.policyOverride c.modifyLock.RUnlock() // if SRV records exist (see https://tools.ietf.org/html/draft-andrews-http-srv-02), lookup the SRV // record and take the highest match; this is not designed for high-availability, just discovery var host string = addr.Host if addr.Port() == "" { // Internet Draft specifies that the SRV record is ignored if a port is given _, addrs, err := net.LookupSRV("http", "tcp", addr.Hostname()) if err == nil && len(addrs) > 0 { host = fmt.Sprintf("%s:%d", addrs[0].Target, addrs[0].Port) } } req := &Request{ Method: method, URL: &url.URL{ User: addr.User, Scheme: addr.Scheme, Host: host, Path: path.Join(addr.Path, requestPath), }, ClientToken: token, Params: make(map[string][]string), } var lookupPath string switch { case strings.HasPrefix(requestPath, "/v1/"): lookupPath = strings.TrimPrefix(requestPath, "/v1/") case strings.HasPrefix(requestPath, "v1/"): lookupPath = strings.TrimPrefix(requestPath, "v1/") default: lookupPath = requestPath } req.MFAHeaderVals = mfaCreds if wrappingLookupFunc != nil { req.WrapTTL = wrappingLookupFunc(method, lookupPath) } else { req.WrapTTL = DefaultWrappingLookupFunc(method, lookupPath) } if headers != nil { req.Headers = headers } req.PolicyOverride = policyOverride return req } // RawRequest performs the raw request given. This request may be against // a Vault server not configured with this client. This is an advanced operation // that generally won't need to be called externally. func (c *Client) RawRequest(r *Request) (*Response, error) { return c.RawRequestWithContext(context.Background(), r) } // RawRequestWithContext performs the raw request given. This request may be against // a Vault server not configured with this client. This is an advanced operation // that generally won't need to be called externally. func (c *Client) RawRequestWithContext(ctx context.Context, r *Request) (*Response, error) { c.modifyLock.RLock() token := c.token c.config.modifyLock.RLock() limiter := c.config.Limiter maxRetries := c.config.MaxRetries backoff := c.config.Backoff httpClient := c.config.HttpClient timeout := c.config.Timeout outputCurlString := c.config.OutputCurlString c.config.modifyLock.RUnlock() c.modifyLock.RUnlock() if limiter != nil { limiter.Wait(ctx) } // Sanity check the token before potentially erroring from the API idx := strings.IndexFunc(token, func(c rune) bool { return !unicode.IsPrint(c) }) if idx != -1 { return nil, fmt.Errorf("configured Vault token contains non-printable characters and cannot be used") } redirectCount := 0 START: req, err := r.toRetryableHTTP() if err != nil { return nil, err } if req == nil { return nil, fmt.Errorf("nil request created") } if outputCurlString { LastOutputStringError = &OutputStringError{Request: req} return nil, LastOutputStringError } if timeout != 0 { ctx, _ = context.WithTimeout(ctx, timeout) } req.Request = req.Request.WithContext(ctx) if backoff == nil { backoff = retryablehttp.LinearJitterBackoff } client := &retryablehttp.Client{ HTTPClient: httpClient, RetryWaitMin: 1000 * time.Millisecond, RetryWaitMax: 1500 * time.Millisecond, RetryMax: maxRetries, CheckRetry: retryablehttp.DefaultRetryPolicy, Backoff: backoff, ErrorHandler: retryablehttp.PassthroughErrorHandler, } var result *Response resp, err := client.Do(req) if resp != nil { result = &Response{Response: resp} } if err != nil { if strings.Contains(err.Error(), "tls: oversized") { err = errwrap.Wrapf( "{{err}}\n\n"+ "This error usually means that the server is running with TLS disabled\n"+ "but the client is configured to use TLS. Please either enable TLS\n"+ "on the server or run the client with -address set to an address\n"+ "that uses the http protocol:\n\n"+ " vault <command> -address http://<address>\n\n"+ "You can also set the VAULT_ADDR environment variable:\n\n\n"+ " VAULT_ADDR=http://<address> vault <command>\n\n"+ "where <address> is replaced by the actual address to the server.", err) } return result, err } // Check for a redirect, only allowing for a single redirect if (resp.StatusCode == 301 || resp.StatusCode == 302 || resp.StatusCode == 307) && redirectCount == 0 { // Parse the updated location respLoc, err := resp.Location() if err != nil { return result, err } // Ensure a protocol downgrade doesn't happen if req.URL.Scheme == "https" && respLoc.Scheme != "https" { return result, fmt.Errorf("redirect would cause protocol downgrade") } // Update the request r.URL = respLoc // Reset the request body if any if err := r.ResetJSONBody(); err != nil { return result, err } // Retry the request redirectCount++ goto START } if err := result.Error(); err != nil { return result, err } return result, nil } �������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/go.mod���������������������������������������0000664�0000000�0000000�00000001101�13771713062�0024002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������module github.com/hashicorp/vault/api go 1.12 replace github.com/hashicorp/vault/sdk => ../sdk require ( github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-multierror v1.0.0 github.com/hashicorp/go-retryablehttp v0.5.4 github.com/hashicorp/go-rootcerts v1.0.1 github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/vault/sdk v0.1.13 github.com/mitchellh/mapstructure v1.1.2 golang.org/x/net v0.0.0-20190620200207-3b0461eec859 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 gopkg.in/square/go-jose.v2 v2.3.1 ) ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/go.sum���������������������������������������0000664�0000000�0000000�00000026430�13771713062�0024043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-retryablehttp v0.5.4 h1:1BZvpawXoJCWX6pNtow9+rpEj+3itIlutiqnntI6jOE= github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.1 h1:DMo4fmknnz0E0evoNYnV48RjWndOsmd6OW+09R3cEP8= github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/help.go��������������������������������������0000664�0000000�0000000�00000001227�13771713062�0024164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "fmt" ) // Help reads the help information for the given path. func (c *Client) Help(path string) (*Help, error) { r := c.NewRequest("GET", fmt.Sprintf("/v1/%s", path)) r.Params.Add("help", "1") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result Help err = resp.DecodeJSON(&result) return &result, err } type Help struct { Help string `json:"help"` SeeAlso []string `json:"see_also"` OpenAPI map[string]interface{} `json:"openapi"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/logical.go�����������������������������������0000664�0000000�0000000�00000014602�13771713062�0024647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "context" "fmt" "io" "net/url" "os" "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/jsonutil" ) const ( wrappedResponseLocation = "cubbyhole/response" ) var ( // The default TTL that will be used with `sys/wrapping/wrap`, can be // changed DefaultWrappingTTL = "5m" // The default function used if no other function is set, which honors the // env var and wraps `sys/wrapping/wrap` DefaultWrappingLookupFunc = func(operation, path string) string { if os.Getenv(EnvVaultWrapTTL) != "" { return os.Getenv(EnvVaultWrapTTL) } if (operation == "PUT" || operation == "POST") && path == "sys/wrapping/wrap" { return DefaultWrappingTTL } return "" } ) // Logical is used to perform logical backend operations on Vault. type Logical struct { c *Client } // Logical is used to return the client for logical-backend API calls. func (c *Client) Logical() *Logical { return &Logical{c: c} } func (c *Logical) Read(path string) (*Secret, error) { return c.ReadWithData(path, nil) } func (c *Logical) ReadWithData(path string, data map[string][]string) (*Secret, error) { r := c.c.NewRequest("GET", "/v1/"+path) var values url.Values for k, v := range data { if values == nil { values = make(url.Values) } for _, val := range v { values.Add(k, val) } } if values != nil { r.Params = values } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if resp != nil { defer resp.Body.Close() } if resp != nil && resp.StatusCode == 404 { secret, parseErr := ParseSecret(resp.Body) switch parseErr { case nil: case io.EOF: return nil, nil default: return nil, err } if secret != nil && (len(secret.Warnings) > 0 || len(secret.Data) > 0) { return secret, nil } return nil, nil } if err != nil { return nil, err } return ParseSecret(resp.Body) } func (c *Logical) List(path string) (*Secret, error) { r := c.c.NewRequest("LIST", "/v1/"+path) // Set this for broader compatibility, but we use LIST above to be able to // handle the wrapping lookup function r.Method = "GET" r.Params.Set("list", "true") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if resp != nil { defer resp.Body.Close() } if resp != nil && resp.StatusCode == 404 { secret, parseErr := ParseSecret(resp.Body) switch parseErr { case nil: case io.EOF: return nil, nil default: return nil, err } if secret != nil && (len(secret.Warnings) > 0 || len(secret.Data) > 0) { return secret, nil } return nil, nil } if err != nil { return nil, err } return ParseSecret(resp.Body) } func (c *Logical) Write(path string, data map[string]interface{}) (*Secret, error) { r := c.c.NewRequest("PUT", "/v1/"+path) if err := r.SetJSONBody(data); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if resp != nil { defer resp.Body.Close() } if resp != nil && resp.StatusCode == 404 { secret, parseErr := ParseSecret(resp.Body) switch parseErr { case nil: case io.EOF: return nil, nil default: return nil, err } if secret != nil && (len(secret.Warnings) > 0 || len(secret.Data) > 0) { return secret, err } } if err != nil { return nil, err } return ParseSecret(resp.Body) } func (c *Logical) Delete(path string) (*Secret, error) { return c.DeleteWithData(path, nil) } func (c *Logical) DeleteWithData(path string, data map[string][]string) (*Secret, error) { r := c.c.NewRequest("DELETE", "/v1/"+path) var values url.Values for k, v := range data { if values == nil { values = make(url.Values) } for _, val := range v { values.Add(k, val) } } if values != nil { r.Params = values } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if resp != nil { defer resp.Body.Close() } if resp != nil && resp.StatusCode == 404 { secret, parseErr := ParseSecret(resp.Body) switch parseErr { case nil: case io.EOF: return nil, nil default: return nil, err } if secret != nil && (len(secret.Warnings) > 0 || len(secret.Data) > 0) { return secret, err } } if err != nil { return nil, err } return ParseSecret(resp.Body) } func (c *Logical) Unwrap(wrappingToken string) (*Secret, error) { var data map[string]interface{} if wrappingToken != "" { if c.c.Token() == "" { c.c.SetToken(wrappingToken) } else if wrappingToken != c.c.Token() { data = map[string]interface{}{ "token": wrappingToken, } } } r := c.c.NewRequest("PUT", "/v1/sys/wrapping/unwrap") if err := r.SetJSONBody(data); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if resp != nil { defer resp.Body.Close() } if resp == nil || resp.StatusCode != 404 { if err != nil { return nil, err } if resp == nil { return nil, nil } return ParseSecret(resp.Body) } // In the 404 case this may actually be a wrapped 404 error secret, parseErr := ParseSecret(resp.Body) switch parseErr { case nil: case io.EOF: return nil, nil default: return nil, err } if secret != nil && (len(secret.Warnings) > 0 || len(secret.Data) > 0) { return secret, nil } // Otherwise this might be an old-style wrapping token so attempt the old // method if wrappingToken != "" { origToken := c.c.Token() defer c.c.SetToken(origToken) c.c.SetToken(wrappingToken) } secret, err = c.Read(wrappedResponseLocation) if err != nil { return nil, errwrap.Wrapf(fmt.Sprintf("error reading %q: {{err}}", wrappedResponseLocation), err) } if secret == nil { return nil, fmt.Errorf("no value found at %q", wrappedResponseLocation) } if secret.Data == nil { return nil, fmt.Errorf("\"data\" not found in wrapping response") } if _, ok := secret.Data["response"]; !ok { return nil, fmt.Errorf("\"response\" not found in wrapping response \"data\" map") } wrappedSecret := new(Secret) buf := bytes.NewBufferString(secret.Data["response"].(string)) if err := jsonutil.DecodeJSONFromReader(buf, wrappedSecret); err != nil { return nil, errwrap.Wrapf("error unmarshalling wrapped secret: {{err}}", err) } return wrappedSecret, nil } ������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/output_string.go�����������������������������0000664�0000000�0000000�00000003010�13771713062�0026152�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "fmt" "strings" retryablehttp "github.com/hashicorp/go-retryablehttp" ) const ( ErrOutputStringRequest = "output a string, please" ) var ( LastOutputStringError *OutputStringError ) type OutputStringError struct { *retryablehttp.Request parsingError error parsedCurlString string } func (d *OutputStringError) Error() string { if d.parsedCurlString == "" { d.parseRequest() if d.parsingError != nil { return d.parsingError.Error() } } return ErrOutputStringRequest } func (d *OutputStringError) parseRequest() { body, err := d.Request.BodyBytes() if err != nil { d.parsingError = err return } // Build cURL string d.parsedCurlString = "curl " if d.Request.Method != "GET" { d.parsedCurlString = fmt.Sprintf("%s-X %s ", d.parsedCurlString, d.Request.Method) } for k, v := range d.Request.Header { for _, h := range v { if strings.ToLower(k) == "x-vault-token" { h = `$(vault print token)` } d.parsedCurlString = fmt.Sprintf("%s-H \"%s: %s\" ", d.parsedCurlString, k, h) } } if len(body) > 0 { // We need to escape single quotes since that's what we're using to // quote the body escapedBody := strings.Replace(string(body), "'", "'\"'\"'", -1) d.parsedCurlString = fmt.Sprintf("%s-d '%s' ", d.parsedCurlString, escapedBody) } d.parsedCurlString = fmt.Sprintf("%s%s", d.parsedCurlString, d.Request.URL.String()) } func (d *OutputStringError) CurlString() string { if d.parsedCurlString == "" { d.parseRequest() } return d.parsedCurlString } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/plugin_helpers.go����������������������������0000664�0000000�0000000�00000012425�13771713062�0026256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "crypto/tls" "crypto/x509" "encoding/base64" "errors" "flag" "net/url" "os" squarejwt "gopkg.in/square/go-jose.v2/jwt" "github.com/hashicorp/errwrap" ) var ( // PluginMetadataModeEnv is an ENV name used to disable TLS communication // to bootstrap mounting plugins. PluginMetadataModeEnv = "VAULT_PLUGIN_METADATA_MODE" // PluginUnwrapTokenEnv is the ENV name used to pass unwrap tokens to the // plugin. PluginUnwrapTokenEnv = "VAULT_UNWRAP_TOKEN" ) // PluginAPIClientMeta is a helper that plugins can use to configure TLS connections // back to Vault. type PluginAPIClientMeta struct { // These are set by the command line flags. flagCACert string flagCAPath string flagClientCert string flagClientKey string flagInsecure bool } // FlagSet returns the flag set for configuring the TLS connection func (f *PluginAPIClientMeta) FlagSet() *flag.FlagSet { fs := flag.NewFlagSet("vault plugin settings", flag.ContinueOnError) fs.StringVar(&f.flagCACert, "ca-cert", "", "") fs.StringVar(&f.flagCAPath, "ca-path", "", "") fs.StringVar(&f.flagClientCert, "client-cert", "", "") fs.StringVar(&f.flagClientKey, "client-key", "", "") fs.BoolVar(&f.flagInsecure, "tls-skip-verify", false, "") return fs } // GetTLSConfig will return a TLSConfig based off the values from the flags func (f *PluginAPIClientMeta) GetTLSConfig() *TLSConfig { // If we need custom TLS configuration, then set it if f.flagCACert != "" || f.flagCAPath != "" || f.flagClientCert != "" || f.flagClientKey != "" || f.flagInsecure { t := &TLSConfig{ CACert: f.flagCACert, CAPath: f.flagCAPath, ClientCert: f.flagClientCert, ClientKey: f.flagClientKey, TLSServerName: "", Insecure: f.flagInsecure, } return t } return nil } // VaultPluginTLSProvider is run inside a plugin and retrieves the response // wrapped TLS certificate from vault. It returns a configured TLS Config. func VaultPluginTLSProvider(apiTLSConfig *TLSConfig) func() (*tls.Config, error) { if os.Getenv(PluginMetadataModeEnv) == "true" { return nil } return func() (*tls.Config, error) { unwrapToken := os.Getenv(PluginUnwrapTokenEnv) parsedJWT, err := squarejwt.ParseSigned(unwrapToken) if err != nil { return nil, errwrap.Wrapf("error parsing wrapping token: {{err}}", err) } var allClaims = make(map[string]interface{}) if err = parsedJWT.UnsafeClaimsWithoutVerification(&allClaims); err != nil { return nil, errwrap.Wrapf("error parsing claims from wrapping token: {{err}}", err) } addrClaimRaw, ok := allClaims["addr"] if !ok { return nil, errors.New("could not validate addr claim") } vaultAddr, ok := addrClaimRaw.(string) if !ok { return nil, errors.New("could not parse addr claim") } if vaultAddr == "" { return nil, errors.New(`no vault api_addr found`) } // Sanity check the value if _, err := url.Parse(vaultAddr); err != nil { return nil, errwrap.Wrapf("error parsing the vault api_addr: {{err}}", err) } // Unwrap the token clientConf := DefaultConfig() clientConf.Address = vaultAddr if apiTLSConfig != nil { err := clientConf.ConfigureTLS(apiTLSConfig) if err != nil { return nil, errwrap.Wrapf("error configuring api client {{err}}", err) } } client, err := NewClient(clientConf) if err != nil { return nil, errwrap.Wrapf("error during api client creation: {{err}}", err) } secret, err := client.Logical().Unwrap(unwrapToken) if err != nil { return nil, errwrap.Wrapf("error during token unwrap request: {{err}}", err) } if secret == nil { return nil, errors.New("error during token unwrap request: secret is nil") } // Retrieve and parse the server's certificate serverCertBytesRaw, ok := secret.Data["ServerCert"].(string) if !ok { return nil, errors.New("error unmarshalling certificate") } serverCertBytes, err := base64.StdEncoding.DecodeString(serverCertBytesRaw) if err != nil { return nil, errwrap.Wrapf("error parsing certificate: {{err}}", err) } serverCert, err := x509.ParseCertificate(serverCertBytes) if err != nil { return nil, errwrap.Wrapf("error parsing certificate: {{err}}", err) } // Retrieve and parse the server's private key serverKeyB64, ok := secret.Data["ServerKey"].(string) if !ok { return nil, errors.New("error unmarshalling certificate") } serverKeyRaw, err := base64.StdEncoding.DecodeString(serverKeyB64) if err != nil { return nil, errwrap.Wrapf("error parsing certificate: {{err}}", err) } serverKey, err := x509.ParseECPrivateKey(serverKeyRaw) if err != nil { return nil, errwrap.Wrapf("error parsing certificate: {{err}}", err) } // Add CA cert to the cert pool caCertPool := x509.NewCertPool() caCertPool.AddCert(serverCert) // Build a certificate object out of the server's cert and private key. cert := tls.Certificate{ Certificate: [][]byte{serverCertBytes}, PrivateKey: serverKey, Leaf: serverCert, } // Setup TLS config tlsConfig := &tls.Config{ ClientCAs: caCertPool, RootCAs: caCertPool, ClientAuth: tls.RequireAndVerifyClientCert, // TLS 1.2 minimum MinVersion: tls.VersionTLS12, Certificates: []tls.Certificate{cert}, ServerName: serverCert.Subject.CommonName, } tlsConfig.BuildNameToCertificate() return tlsConfig, nil } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/renewer.go�����������������������������������0000664�0000000�0000000�00000023035�13771713062�0024704�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "errors" "math/rand" "sync" "time" ) var ( ErrRenewerMissingInput = errors.New("missing input to renewer") ErrRenewerMissingSecret = errors.New("missing secret to renew") ErrRenewerNotRenewable = errors.New("secret is not renewable") ErrRenewerNoSecretData = errors.New("returned empty secret data") // DefaultRenewerRenewBuffer is the default size of the buffer for renew // messages on the channel. DefaultRenewerRenewBuffer = 5 ) // Renewer is a process for renewing a secret. // // renewer, err := client.NewRenewer(&RenewerInput{ // Secret: mySecret, // }) // go renewer.Renew() // defer renewer.Stop() // // for { // select { // case err := <-renewer.DoneCh(): // if err != nil { // log.Fatal(err) // } // // // Renewal is now over // case renewal := <-renewer.RenewCh(): // log.Printf("Successfully renewed: %#v", renewal) // } // } // // // The `DoneCh` will return if renewal fails or if the remaining lease duration // after a renewal is less than or equal to the grace (in number of seconds). In // both cases, the caller should attempt a re-read of the secret. Clients should // check the return value of the channel to see if renewal was successful. type Renewer struct { l sync.Mutex client *Client secret *Secret grace time.Duration random *rand.Rand increment int doneCh chan error renewCh chan *RenewOutput stopped bool stopCh chan struct{} } // RenewerInput is used as input to the renew function. type RenewerInput struct { // Secret is the secret to renew Secret *Secret // DEPRECATED: this does not do anything. Grace time.Duration // Rand is the randomizer to use for underlying randomization. If not // provided, one will be generated and seeded automatically. If provided, it // is assumed to have already been seeded. Rand *rand.Rand // RenewBuffer is the size of the buffered channel where renew messages are // dispatched. RenewBuffer int // The new TTL, in seconds, that should be set on the lease. The TTL set // here may or may not be honored by the vault server, based on Vault // configuration or any associated max TTL values. Increment int } // RenewOutput is the metadata returned to the client (if it's listening) to // renew messages. type RenewOutput struct { // RenewedAt is the timestamp when the renewal took place (UTC). RenewedAt time.Time // Secret is the underlying renewal data. It's the same struct as all data // that is returned from Vault, but since this is renewal data, it will not // usually include the secret itself. Secret *Secret } // NewRenewer creates a new renewer from the given input. func (c *Client) NewRenewer(i *RenewerInput) (*Renewer, error) { if i == nil { return nil, ErrRenewerMissingInput } secret := i.Secret if secret == nil { return nil, ErrRenewerMissingSecret } random := i.Rand if random == nil { random = rand.New(rand.NewSource(int64(time.Now().Nanosecond()))) } renewBuffer := i.RenewBuffer if renewBuffer == 0 { renewBuffer = DefaultRenewerRenewBuffer } return &Renewer{ client: c, secret: secret, increment: i.Increment, random: random, doneCh: make(chan error, 1), renewCh: make(chan *RenewOutput, renewBuffer), stopped: false, stopCh: make(chan struct{}), }, nil } // DoneCh returns the channel where the renewer will publish when renewal stops. // If there is an error, this will be an error. func (r *Renewer) DoneCh() <-chan error { return r.doneCh } // RenewCh is a channel that receives a message when a successful renewal takes // place and includes metadata about the renewal. func (r *Renewer) RenewCh() <-chan *RenewOutput { return r.renewCh } // Stop stops the renewer. func (r *Renewer) Stop() { r.l.Lock() if !r.stopped { close(r.stopCh) r.stopped = true } r.l.Unlock() } // Renew starts a background process for renewing this secret. When the secret // has auth data, this attempts to renew the auth (token). When the secret has // a lease, this attempts to renew the lease. func (r *Renewer) Renew() { var result error if r.secret.Auth != nil { result = r.renewAuth() } else { result = r.renewLease() } r.doneCh <- result } // renewAuth is a helper for renewing authentication. func (r *Renewer) renewAuth() error { if !r.secret.Auth.Renewable || r.secret.Auth.ClientToken == "" { return ErrRenewerNotRenewable } priorDuration := time.Duration(r.secret.Auth.LeaseDuration) * time.Second r.calculateGrace(priorDuration) client, token := r.client, r.secret.Auth.ClientToken for { // Check if we are stopped. select { case <-r.stopCh: return nil default: } // Renew the auth. renewal, err := client.Auth().Token().RenewTokenAsSelf(token, r.increment) if err != nil { return err } // Push a message that a renewal took place. select { case r.renewCh <- &RenewOutput{time.Now().UTC(), renewal}: default: } // Somehow, sometimes, this happens. if renewal == nil || renewal.Auth == nil { return ErrRenewerNoSecretData } // Do nothing if we are not renewable if !renewal.Auth.Renewable { return ErrRenewerNotRenewable } // Grab the lease duration leaseDuration := time.Duration(renewal.Auth.LeaseDuration) * time.Second // We keep evaluating a new grace period so long as the lease is // extending. Once it stops extending, we've hit the max and need to // rely on the grace duration. if leaseDuration > priorDuration { r.calculateGrace(leaseDuration) } priorDuration = leaseDuration // The sleep duration is set to 2/3 of the current lease duration plus // 1/3 of the current grace period, which adds jitter. sleepDuration := time.Duration(float64(leaseDuration.Nanoseconds())*2/3 + float64(r.grace.Nanoseconds())/3) // If we are within grace, return now; or, if the amount of time we // would sleep would land us in the grace period. This helps with short // tokens; for example, you don't want a current lease duration of 4 // seconds, a grace period of 3 seconds, and end up sleeping for more // than three of those seconds and having a very small budget of time // to renew. if leaseDuration <= r.grace || leaseDuration-sleepDuration <= r.grace { return nil } select { case <-r.stopCh: return nil case <-time.After(sleepDuration): continue } } } // renewLease is a helper for renewing a lease. func (r *Renewer) renewLease() error { if !r.secret.Renewable || r.secret.LeaseID == "" { return ErrRenewerNotRenewable } priorDuration := time.Duration(r.secret.LeaseDuration) * time.Second r.calculateGrace(priorDuration) client, leaseID := r.client, r.secret.LeaseID for { // Check if we are stopped. select { case <-r.stopCh: return nil default: } // Renew the lease. renewal, err := client.Sys().Renew(leaseID, r.increment) if err != nil { return err } // Push a message that a renewal took place. select { case r.renewCh <- &RenewOutput{time.Now().UTC(), renewal}: default: } // Somehow, sometimes, this happens. if renewal == nil { return ErrRenewerNoSecretData } // Do nothing if we are not renewable if !renewal.Renewable { return ErrRenewerNotRenewable } // Grab the lease duration leaseDuration := time.Duration(renewal.LeaseDuration) * time.Second // We keep evaluating a new grace period so long as the lease is // extending. Once it stops extending, we've hit the max and need to // rely on the grace duration. if leaseDuration > priorDuration { r.calculateGrace(leaseDuration) } priorDuration = leaseDuration // The sleep duration is set to 2/3 of the current lease duration plus // 1/3 of the current grace period, which adds jitter. sleepDuration := time.Duration(float64(leaseDuration.Nanoseconds())*2/3 + float64(r.grace.Nanoseconds())/3) // If we are within grace, return now; or, if the amount of time we // would sleep would land us in the grace period. This helps with short // tokens; for example, you don't want a current lease duration of 4 // seconds, a grace period of 3 seconds, and end up sleeping for more // than three of those seconds and having a very small budget of time // to renew. if leaseDuration <= r.grace || leaseDuration-sleepDuration <= r.grace { return nil } select { case <-r.stopCh: return nil case <-time.After(sleepDuration): continue } } } // sleepDuration calculates the time to sleep given the base lease duration. The // base is the resulting lease duration. It will be reduced to 1/3 and // multiplied by a random float between 0.0 and 1.0. This extra randomness // prevents multiple clients from all trying to renew simultaneously. func (r *Renewer) sleepDuration(base time.Duration) time.Duration { sleep := float64(base) // Renew at 1/3 the remaining lease. This will give us an opportunity to retry // at least one more time should the first renewal fail. sleep = sleep / 3.0 // Use a randomness so many clients do not hit Vault simultaneously. sleep = sleep * (r.random.Float64() + 1) / 2.0 return time.Duration(sleep) } // calculateGrace calculates the grace period based on a reasonable set of // assumptions given the total lease time; it also adds some jitter to not have // clients be in sync. func (r *Renewer) calculateGrace(leaseDuration time.Duration) { if leaseDuration == 0 { r.grace = 0 return } leaseNanos := float64(leaseDuration.Nanoseconds()) jitterMax := 0.1 * leaseNanos // For a given lease duration, we want to allow 80-90% of that to elapse, // so the remaining amount is the grace period r.grace = time.Duration(jitterMax) + time.Duration(uint64(r.random.Int63())%uint64(jitterMax)) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/request.go�����������������������������������0000664�0000000�0000000�00000006000�13771713062�0024716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "encoding/json" "io" "io/ioutil" "net/http" "net/url" "github.com/hashicorp/vault/sdk/helper/consts" retryablehttp "github.com/hashicorp/go-retryablehttp" ) // Request is a raw request configuration structure used to initiate // API requests to the Vault server. type Request struct { Method string URL *url.URL Params url.Values Headers http.Header ClientToken string MFAHeaderVals []string WrapTTL string Obj interface{} // When possible, use BodyBytes as it is more efficient due to how the // retry logic works BodyBytes []byte // Fallback Body io.Reader BodySize int64 // Whether to request overriding soft-mandatory Sentinel policies (RGPs and // EGPs). If set, the override flag will take effect for all policies // evaluated during the request. PolicyOverride bool } // SetJSONBody is used to set a request body that is a JSON-encoded value. func (r *Request) SetJSONBody(val interface{}) error { buf, err := json.Marshal(val) if err != nil { return err } r.Obj = val r.BodyBytes = buf return nil } // ResetJSONBody is used to reset the body for a redirect func (r *Request) ResetJSONBody() error { if r.BodyBytes == nil { return nil } return r.SetJSONBody(r.Obj) } // DEPRECATED: ToHTTP turns this request into a valid *http.Request for use // with the net/http package. func (r *Request) ToHTTP() (*http.Request, error) { req, err := r.toRetryableHTTP() if err != nil { return nil, err } switch { case r.BodyBytes == nil && r.Body == nil: // No body case r.BodyBytes != nil: req.Request.Body = ioutil.NopCloser(bytes.NewReader(r.BodyBytes)) default: if c, ok := r.Body.(io.ReadCloser); ok { req.Request.Body = c } else { req.Request.Body = ioutil.NopCloser(r.Body) } } return req.Request, nil } func (r *Request) toRetryableHTTP() (*retryablehttp.Request, error) { // Encode the query parameters r.URL.RawQuery = r.Params.Encode() // Create the HTTP request, defaulting to retryable var req *retryablehttp.Request var err error var body interface{} switch { case r.BodyBytes == nil && r.Body == nil: // No body case r.BodyBytes != nil: // Use bytes, it's more efficient body = r.BodyBytes default: body = r.Body } req, err = retryablehttp.NewRequest(r.Method, r.URL.RequestURI(), body) if err != nil { return nil, err } req.URL.User = r.URL.User req.URL.Scheme = r.URL.Scheme req.URL.Host = r.URL.Host req.Host = r.URL.Host if r.Headers != nil { for header, vals := range r.Headers { for _, val := range vals { req.Header.Add(header, val) } } } if len(r.ClientToken) != 0 { req.Header.Set(consts.AuthHeaderName, r.ClientToken) } if len(r.WrapTTL) != 0 { req.Header.Set("X-Vault-Wrap-TTL", r.WrapTTL) } if len(r.MFAHeaderVals) != 0 { for _, mfaHeaderVal := range r.MFAHeaderVals { req.Header.Add("X-Vault-MFA", mfaHeaderVal) } } if r.PolicyOverride { req.Header.Set("X-Vault-Policy-Override", "true") } return req, nil } packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/response.go����������������������������������0000664�0000000�0000000�00000006441�13771713062�0025075�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "fmt" "io" "io/ioutil" "net/http" "github.com/hashicorp/vault/sdk/helper/jsonutil" ) // Response is a raw response that wraps an HTTP response. type Response struct { *http.Response } // DecodeJSON will decode the response body to a JSON structure. This // will consume the response body, but will not close it. Close must // still be called. func (r *Response) DecodeJSON(out interface{}) error { return jsonutil.DecodeJSONFromReader(r.Body, out) } // Error returns an error response if there is one. If there is an error, // this will fully consume the response body, but will not close it. The // body must still be closed manually. func (r *Response) Error() error { // 200 to 399 are okay status codes. 429 is the code for health status of // standby nodes. if (r.StatusCode >= 200 && r.StatusCode < 400) || r.StatusCode == 429 { return nil } // We have an error. Let's copy the body into our own buffer first, // so that if we can't decode JSON, we can at least copy it raw. bodyBuf := &bytes.Buffer{} if _, err := io.Copy(bodyBuf, r.Body); err != nil { return err } r.Body.Close() r.Body = ioutil.NopCloser(bodyBuf) // Build up the error object respErr := &ResponseError{ HTTPMethod: r.Request.Method, URL: r.Request.URL.String(), StatusCode: r.StatusCode, } // Decode the error response if we can. Note that we wrap the bodyBuf // in a bytes.Reader here so that the JSON decoder doesn't move the // read pointer for the original buffer. var resp ErrorResponse if err := jsonutil.DecodeJSON(bodyBuf.Bytes(), &resp); err != nil { // Store the fact that we couldn't decode the errors respErr.RawError = true respErr.Errors = []string{bodyBuf.String()} } else { // Store the decoded errors respErr.Errors = resp.Errors } return respErr } // ErrorResponse is the raw structure of errors when they're returned by the // HTTP API. type ErrorResponse struct { Errors []string } // ResponseError is the error returned when Vault responds with an error or // non-success HTTP status code. If a request to Vault fails because of a // network error a different error message will be returned. ResponseError gives // access to the underlying errors and status code. type ResponseError struct { // HTTPMethod is the HTTP method for the request (PUT, GET, etc). HTTPMethod string // URL is the URL of the request. URL string // StatusCode is the HTTP status code. StatusCode int // RawError marks that the underlying error messages returned by Vault were // not parsable. The Errors slice will contain the raw response body as the // first and only error string if this value is set to true. RawError bool // Errors are the underlying errors returned by Vault. Errors []string } // Error returns a human-readable error string for the response error. func (r *ResponseError) Error() string { errString := "Errors" if r.RawError { errString = "Raw Message" } var errBody bytes.Buffer errBody.WriteString(fmt.Sprintf( "Error making API request.\n\n"+ "URL: %s %s\n"+ "Code: %d. %s:\n\n", r.HTTPMethod, r.URL, r.StatusCode, errString)) if r.RawError && len(r.Errors) == 1 { errBody.WriteString(r.Errors[0]) } else { for _, err := range r.Errors { errBody.WriteString(fmt.Sprintf("* %s", err)) } } return errBody.String() } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/secret.go������������������������������������0000664�0000000�0000000�00000020171�13771713062�0024520�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "bytes" "fmt" "io" "time" "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/jsonutil" "github.com/hashicorp/vault/sdk/helper/parseutil" ) // Secret is the structure returned for every secret within Vault. type Secret struct { // The request ID that generated this response RequestID string `json:"request_id"` LeaseID string `json:"lease_id"` LeaseDuration int `json:"lease_duration"` Renewable bool `json:"renewable"` // Data is the actual contents of the secret. The format of the data // is arbitrary and up to the secret backend. Data map[string]interface{} `json:"data"` // Warnings contains any warnings related to the operation. These // are not issues that caused the command to fail, but that the // client should be aware of. Warnings []string `json:"warnings"` // Auth, if non-nil, means that there was authentication information // attached to this response. Auth *SecretAuth `json:"auth,omitempty"` // WrapInfo, if non-nil, means that the initial response was wrapped in the // cubbyhole of the given token (which has a TTL of the given number of // seconds) WrapInfo *SecretWrapInfo `json:"wrap_info,omitempty"` } // TokenID returns the standardized token ID (token) for the given secret. func (s *Secret) TokenID() (string, error) { if s == nil { return "", nil } if s.Auth != nil && len(s.Auth.ClientToken) > 0 { return s.Auth.ClientToken, nil } if s.Data == nil || s.Data["id"] == nil { return "", nil } id, ok := s.Data["id"].(string) if !ok { return "", fmt.Errorf("token found but in the wrong format") } return id, nil } // TokenAccessor returns the standardized token accessor for the given secret. // If the secret is nil or does not contain an accessor, this returns the empty // string. func (s *Secret) TokenAccessor() (string, error) { if s == nil { return "", nil } if s.Auth != nil && len(s.Auth.Accessor) > 0 { return s.Auth.Accessor, nil } if s.Data == nil || s.Data["accessor"] == nil { return "", nil } accessor, ok := s.Data["accessor"].(string) if !ok { return "", fmt.Errorf("token found but in the wrong format") } return accessor, nil } // TokenRemainingUses returns the standardized remaining uses for the given // secret. If the secret is nil or does not contain the "num_uses", this // returns -1. On error, this will return -1 and a non-nil error. func (s *Secret) TokenRemainingUses() (int, error) { if s == nil || s.Data == nil || s.Data["num_uses"] == nil { return -1, nil } uses, err := parseutil.ParseInt(s.Data["num_uses"]) if err != nil { return 0, err } return int(uses), nil } // TokenPolicies returns the standardized list of policies for the given secret. // If the secret is nil or does not contain any policies, this returns nil. It // also populates the secret's Auth info with identity/token policy info. func (s *Secret) TokenPolicies() ([]string, error) { if s == nil { return nil, nil } if s.Auth != nil && len(s.Auth.Policies) > 0 { return s.Auth.Policies, nil } if s.Data == nil || s.Data["policies"] == nil { return nil, nil } var tokenPolicies []string // Token policies { _, ok := s.Data["policies"] if !ok { goto TOKEN_DONE } sList, ok := s.Data["policies"].([]string) if ok { tokenPolicies = sList goto TOKEN_DONE } list, ok := s.Data["policies"].([]interface{}) if !ok { return nil, fmt.Errorf("unable to convert token policies to expected format") } for _, v := range list { p, ok := v.(string) if !ok { return nil, fmt.Errorf("unable to convert policy %v to string", v) } tokenPolicies = append(tokenPolicies, p) } } TOKEN_DONE: var identityPolicies []string // Identity policies { _, ok := s.Data["identity_policies"] if !ok { goto DONE } sList, ok := s.Data["identity_policies"].([]string) if ok { identityPolicies = sList goto DONE } list, ok := s.Data["identity_policies"].([]interface{}) if !ok { return nil, fmt.Errorf("unable to convert identity policies to expected format") } for _, v := range list { p, ok := v.(string) if !ok { return nil, fmt.Errorf("unable to convert policy %v to string", v) } identityPolicies = append(identityPolicies, p) } } DONE: if s.Auth == nil { s.Auth = &SecretAuth{} } policies := append(tokenPolicies, identityPolicies...) s.Auth.TokenPolicies = tokenPolicies s.Auth.IdentityPolicies = identityPolicies s.Auth.Policies = policies return policies, nil } // TokenMetadata returns the map of metadata associated with this token, if any // exists. If the secret is nil or does not contain the "metadata" key, this // returns nil. func (s *Secret) TokenMetadata() (map[string]string, error) { if s == nil { return nil, nil } if s.Auth != nil && len(s.Auth.Metadata) > 0 { return s.Auth.Metadata, nil } if s.Data == nil || (s.Data["metadata"] == nil && s.Data["meta"] == nil) { return nil, nil } data, ok := s.Data["metadata"].(map[string]interface{}) if !ok { data, ok = s.Data["meta"].(map[string]interface{}) if !ok { return nil, fmt.Errorf("unable to convert metadata field to expected format") } } metadata := make(map[string]string, len(data)) for k, v := range data { typed, ok := v.(string) if !ok { return nil, fmt.Errorf("unable to convert metadata value %v to string", v) } metadata[k] = typed } return metadata, nil } // TokenIsRenewable returns the standardized token renewability for the given // secret. If the secret is nil or does not contain the "renewable" key, this // returns false. func (s *Secret) TokenIsRenewable() (bool, error) { if s == nil { return false, nil } if s.Auth != nil && s.Auth.Renewable { return s.Auth.Renewable, nil } if s.Data == nil || s.Data["renewable"] == nil { return false, nil } renewable, err := parseutil.ParseBool(s.Data["renewable"]) if err != nil { return false, errwrap.Wrapf("could not convert renewable value to a boolean: {{err}}", err) } return renewable, nil } // TokenTTL returns the standardized remaining token TTL for the given secret. // If the secret is nil or does not contain a TTL, this returns 0. func (s *Secret) TokenTTL() (time.Duration, error) { if s == nil { return 0, nil } if s.Auth != nil && s.Auth.LeaseDuration > 0 { return time.Duration(s.Auth.LeaseDuration) * time.Second, nil } if s.Data == nil || s.Data["ttl"] == nil { return 0, nil } ttl, err := parseutil.ParseDurationSecond(s.Data["ttl"]) if err != nil { return 0, err } return ttl, nil } // SecretWrapInfo contains wrapping information if we have it. If what is // contained is an authentication token, the accessor for the token will be // available in WrappedAccessor. type SecretWrapInfo struct { Token string `json:"token"` Accessor string `json:"accessor"` TTL int `json:"ttl"` CreationTime time.Time `json:"creation_time"` CreationPath string `json:"creation_path"` WrappedAccessor string `json:"wrapped_accessor"` } // SecretAuth is the structure containing auth information if we have it. type SecretAuth struct { ClientToken string `json:"client_token"` Accessor string `json:"accessor"` Policies []string `json:"policies"` TokenPolicies []string `json:"token_policies"` IdentityPolicies []string `json:"identity_policies"` Metadata map[string]string `json:"metadata"` Orphan bool `json:"orphan"` EntityID string `json:"entity_id"` LeaseDuration int `json:"lease_duration"` Renewable bool `json:"renewable"` } // ParseSecret is used to parse a secret value from JSON from an io.Reader. func ParseSecret(r io.Reader) (*Secret, error) { // First read the data into a buffer. Not super efficient but we want to // know if we actually have a body or not. var buf bytes.Buffer _, err := buf.ReadFrom(r) if err != nil { return nil, err } if buf.Len() == 0 { return nil, nil } // First decode the JSON into a map[string]interface{} var secret Secret if err := jsonutil.DecodeJSONFromReader(&buf, &secret); err != nil { return nil, err } return &secret, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/ssh.go���������������������������������������0000664�0000000�0000000�00000003141�13771713062�0024026�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "fmt" ) // SSH is used to return a client to invoke operations on SSH backend. type SSH struct { c *Client MountPoint string } // SSH returns the client for logical-backend API calls. func (c *Client) SSH() *SSH { return c.SSHWithMountPoint(SSHHelperDefaultMountPoint) } // SSHWithMountPoint returns the client with specific SSH mount point. func (c *Client) SSHWithMountPoint(mountPoint string) *SSH { return &SSH{ c: c, MountPoint: mountPoint, } } // Credential invokes the SSH backend API to create a credential to establish an SSH session. func (c *SSH) Credential(role string, data map[string]interface{}) (*Secret, error) { r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/%s/creds/%s", c.MountPoint, role)) if err := r.SetJSONBody(data); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } // SignKey signs the given public key and returns a signed public key to pass // along with the SSH request. func (c *SSH) SignKey(role string, data map[string]interface{}) (*Secret, error) { r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/%s/sign/%s", c.MountPoint, role)) if err := r.SetJSONBody(data); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/ssh_agent.go���������������������������������0000664�0000000�0000000�00000016114�13771713062�0025210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "crypto/tls" "crypto/x509" "fmt" "io/ioutil" "os" "github.com/hashicorp/errwrap" cleanhttp "github.com/hashicorp/go-cleanhttp" multierror "github.com/hashicorp/go-multierror" rootcerts "github.com/hashicorp/go-rootcerts" "github.com/hashicorp/hcl" "github.com/hashicorp/hcl/hcl/ast" "github.com/hashicorp/vault/sdk/helper/hclutil" "github.com/mitchellh/mapstructure" ) const ( // SSHHelperDefaultMountPoint is the default path at which SSH backend will be // mounted in the Vault server. SSHHelperDefaultMountPoint = "ssh" // VerifyEchoRequest is the echo request message sent as OTP by the helper. VerifyEchoRequest = "verify-echo-request" // VerifyEchoResponse is the echo response message sent as a response to OTP // matching echo request. VerifyEchoResponse = "verify-echo-response" ) // SSHHelper is a structure representing a vault-ssh-helper which can talk to vault server // in order to verify the OTP entered by the user. It contains the path at which // SSH backend is mounted at the server. type SSHHelper struct { c *Client MountPoint string } // SSHVerifyResponse is a structure representing the fields in Vault server's // response. type SSHVerifyResponse struct { // Usually empty. If the request OTP is echo request message, this will // be set to the corresponding echo response message. Message string `json:"message" mapstructure:"message"` // Username associated with the OTP Username string `json:"username" mapstructure:"username"` // IP associated with the OTP IP string `json:"ip" mapstructure:"ip"` // Name of the role against which the OTP was issued RoleName string `json:"role_name" mapstructure:"role_name"` } // SSHHelperConfig is a structure which represents the entries from the vault-ssh-helper's configuration file. type SSHHelperConfig struct { VaultAddr string `hcl:"vault_addr"` SSHMountPoint string `hcl:"ssh_mount_point"` CACert string `hcl:"ca_cert"` CAPath string `hcl:"ca_path"` AllowedCidrList string `hcl:"allowed_cidr_list"` AllowedRoles string `hcl:"allowed_roles"` TLSSkipVerify bool `hcl:"tls_skip_verify"` TLSServerName string `hcl:"tls_server_name"` } // SetTLSParameters sets the TLS parameters for this SSH agent. func (c *SSHHelperConfig) SetTLSParameters(clientConfig *Config, certPool *x509.CertPool) { tlsConfig := &tls.Config{ InsecureSkipVerify: c.TLSSkipVerify, MinVersion: tls.VersionTLS12, RootCAs: certPool, ServerName: c.TLSServerName, } transport := cleanhttp.DefaultTransport() transport.TLSClientConfig = tlsConfig clientConfig.HttpClient.Transport = transport } // Returns true if any of the following conditions are true: // * CA cert is configured // * CA path is configured // * configured to skip certificate verification // * TLS server name is configured // func (c *SSHHelperConfig) shouldSetTLSParameters() bool { return c.CACert != "" || c.CAPath != "" || c.TLSServerName != "" || c.TLSSkipVerify } // NewClient returns a new client for the configuration. This client will be used by the // vault-ssh-helper to communicate with Vault server and verify the OTP entered by user. // If the configuration supplies Vault SSL certificates, then the client will // have TLS configured in its transport. func (c *SSHHelperConfig) NewClient() (*Client, error) { // Creating a default client configuration for communicating with vault server. clientConfig := DefaultConfig() // Pointing the client to the actual address of vault server. clientConfig.Address = c.VaultAddr // Check if certificates are provided via config file. if c.shouldSetTLSParameters() { rootConfig := &rootcerts.Config{ CAFile: c.CACert, CAPath: c.CAPath, } certPool, err := rootcerts.LoadCACerts(rootConfig) if err != nil { return nil, err } // Enable TLS on the HTTP client information c.SetTLSParameters(clientConfig, certPool) } // Creating the client object for the given configuration client, err := NewClient(clientConfig) if err != nil { return nil, err } return client, nil } // LoadSSHHelperConfig loads ssh-helper's configuration from the file and populates the corresponding // in-memory structure. // // Vault address is a required parameter. // Mount point defaults to "ssh". func LoadSSHHelperConfig(path string) (*SSHHelperConfig, error) { contents, err := ioutil.ReadFile(path) if err != nil && !os.IsNotExist(err) { return nil, multierror.Prefix(err, "ssh_helper:") } return ParseSSHHelperConfig(string(contents)) } // ParseSSHHelperConfig parses the given contents as a string for the SSHHelper // configuration. func ParseSSHHelperConfig(contents string) (*SSHHelperConfig, error) { root, err := hcl.Parse(string(contents)) if err != nil { return nil, errwrap.Wrapf("error parsing config: {{err}}", err) } list, ok := root.Node.(*ast.ObjectList) if !ok { return nil, fmt.Errorf("error parsing config: file doesn't contain a root object") } valid := []string{ "vault_addr", "ssh_mount_point", "ca_cert", "ca_path", "allowed_cidr_list", "allowed_roles", "tls_skip_verify", "tls_server_name", } if err := hclutil.CheckHCLKeys(list, valid); err != nil { return nil, multierror.Prefix(err, "ssh_helper:") } var c SSHHelperConfig c.SSHMountPoint = SSHHelperDefaultMountPoint if err := hcl.DecodeObject(&c, list); err != nil { return nil, multierror.Prefix(err, "ssh_helper:") } if c.VaultAddr == "" { return nil, fmt.Errorf(`missing config "vault_addr"`) } return &c, nil } // SSHHelper creates an SSHHelper object which can talk to Vault server with SSH backend // mounted at default path ("ssh"). func (c *Client) SSHHelper() *SSHHelper { return c.SSHHelperWithMountPoint(SSHHelperDefaultMountPoint) } // SSHHelperWithMountPoint creates an SSHHelper object which can talk to Vault server with SSH backend // mounted at a specific mount point. func (c *Client) SSHHelperWithMountPoint(mountPoint string) *SSHHelper { return &SSHHelper{ c: c, MountPoint: mountPoint, } } // Verify verifies if the key provided by user is present in Vault server. The response // will contain the IP address and username associated with the OTP. In case the // OTP matches the echo request message, instead of searching an entry for the OTP, // an echo response message is returned. This feature is used by ssh-helper to verify if // its configured correctly. func (c *SSHHelper) Verify(otp string) (*SSHVerifyResponse, error) { data := map[string]interface{}{ "otp": otp, } verifyPath := fmt.Sprintf("/v1/%s/verify", c.MountPoint) r := c.c.NewRequest("PUT", verifyPath) if err := r.SetJSONBody(data); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret.Data == nil { return nil, nil } var verifyResp SSHVerifyResponse err = mapstructure.Decode(secret.Data, &verifyResp) if err != nil { return nil, err } return &verifyResp, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys.go���������������������������������������0000664�0000000�0000000�00000000335�13771713062�0024051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api // Sys is used to perform system-related operations on Vault. type Sys struct { c *Client } // Sys is used to return the client for sys-related API calls. func (c *Client) Sys() *Sys { return &Sys{c: c} } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_audit.go���������������������������������0000664�0000000�0000000�00000006701�13771713062�0025242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "fmt" "github.com/mitchellh/mapstructure" ) func (c *Sys) AuditHash(path string, input string) (string, error) { body := map[string]interface{}{ "input": input, } r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/sys/audit-hash/%s", path)) if err := r.SetJSONBody(body); err != nil { return "", err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return "", err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return "", err } if secret == nil || secret.Data == nil { return "", errors.New("data from server response is empty") } hash, ok := secret.Data["hash"] if !ok { return "", errors.New("hash not found in response data") } hashStr, ok := hash.(string) if !ok { return "", errors.New("could not parse hash in response data") } return hashStr, nil } func (c *Sys) ListAudit() (map[string]*Audit, error) { r := c.c.NewRequest("GET", "/v1/sys/audit") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } mounts := map[string]*Audit{} err = mapstructure.Decode(secret.Data, &mounts) if err != nil { return nil, err } return mounts, nil } // DEPRECATED: Use EnableAuditWithOptions instead func (c *Sys) EnableAudit( path string, auditType string, desc string, opts map[string]string) error { return c.EnableAuditWithOptions(path, &EnableAuditOptions{ Type: auditType, Description: desc, Options: opts, }) } func (c *Sys) EnableAuditWithOptions(path string, options *EnableAuditOptions) error { r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/sys/audit/%s", path)) if err := r.SetJSONBody(options); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } func (c *Sys) DisableAudit(path string) error { r := c.c.NewRequest("DELETE", fmt.Sprintf("/v1/sys/audit/%s", path)) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } // Structures for the requests/resposne are all down here. They aren't // individually documented because the map almost directly to the raw HTTP API // documentation. Please refer to that documentation for more details. type EnableAuditOptions struct { Type string `json:"type" mapstructure:"type"` Description string `json:"description" mapstructure:"description"` Options map[string]string `json:"options" mapstructure:"options"` Local bool `json:"local" mapstructure:"local"` } type Audit struct { Type string `json:"type" mapstructure:"type"` Description string `json:"description" mapstructure:"description"` Options map[string]string `json:"options" mapstructure:"options"` Local bool `json:"local" mapstructure:"local"` Path string `json:"path" mapstructure:"path"` } ���������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_auth.go����������������������������������0000664�0000000�0000000�00000003526�13771713062�0025077�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "fmt" "github.com/mitchellh/mapstructure" ) func (c *Sys) ListAuth() (map[string]*AuthMount, error) { r := c.c.NewRequest("GET", "/v1/sys/auth") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } mounts := map[string]*AuthMount{} err = mapstructure.Decode(secret.Data, &mounts) if err != nil { return nil, err } return mounts, nil } // DEPRECATED: Use EnableAuthWithOptions instead func (c *Sys) EnableAuth(path, authType, desc string) error { return c.EnableAuthWithOptions(path, &EnableAuthOptions{ Type: authType, Description: desc, }) } func (c *Sys) EnableAuthWithOptions(path string, options *EnableAuthOptions) error { r := c.c.NewRequest("POST", fmt.Sprintf("/v1/sys/auth/%s", path)) if err := r.SetJSONBody(options); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } func (c *Sys) DisableAuth(path string) error { r := c.c.NewRequest("DELETE", fmt.Sprintf("/v1/sys/auth/%s", path)) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } // Rather than duplicate, we can use modern Go's type aliasing type EnableAuthOptions = MountInput type AuthConfigInput = MountConfigInput type AuthMount = MountOutput type AuthConfigOutput = MountConfigOutput ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_capabilities.go��������������������������0000664�0000000�0000000�00000002331�13771713062�0026560�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "fmt" "github.com/mitchellh/mapstructure" ) func (c *Sys) CapabilitiesSelf(path string) ([]string, error) { return c.Capabilities(c.c.Token(), path) } func (c *Sys) Capabilities(token, path string) ([]string, error) { body := map[string]string{ "token": token, "path": path, } reqPath := "/v1/sys/capabilities" if token == c.c.Token() { reqPath = fmt.Sprintf("%s-self", reqPath) } r := c.c.NewRequest("POST", reqPath) if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var res []string err = mapstructure.Decode(secret.Data[path], &res) if err != nil { return nil, err } if len(res) == 0 { _, ok := secret.Data["capabilities"] if ok { err = mapstructure.Decode(secret.Data["capabilities"], &res) if err != nil { return nil, err } } } return res, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_config_cors.go���������������������������0000664�0000000�0000000�00000004506�13771713062�0026430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "github.com/mitchellh/mapstructure" ) func (c *Sys) CORSStatus() (*CORSResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/config/cors") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result CORSResponse err = mapstructure.Decode(secret.Data, &result) if err != nil { return nil, err } return &result, err } func (c *Sys) ConfigureCORS(req *CORSRequest) (*CORSResponse, error) { r := c.c.NewRequest("PUT", "/v1/sys/config/cors") if err := r.SetJSONBody(req); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result CORSResponse err = mapstructure.Decode(secret.Data, &result) if err != nil { return nil, err } return &result, err } func (c *Sys) DisableCORS() (*CORSResponse, error) { r := c.c.NewRequest("DELETE", "/v1/sys/config/cors") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result CORSResponse err = mapstructure.Decode(secret.Data, &result) if err != nil { return nil, err } return &result, err } type CORSRequest struct { AllowedOrigins string `json:"allowed_origins" mapstructure:"allowed_origins"` Enabled bool `json:"enabled" mapstructure:"enabled"` } type CORSResponse struct { AllowedOrigins string `json:"allowed_origins" mapstructure:"allowed_origins"` Enabled bool `json:"enabled" mapstructure:"enabled"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_generate_root.go�������������������������0000664�0000000�0000000�00000007263�13771713062�0026775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import "context" func (c *Sys) GenerateRootStatus() (*GenerateRootStatusResponse, error) { return c.generateRootStatusCommon("/v1/sys/generate-root/attempt") } func (c *Sys) GenerateDROperationTokenStatus() (*GenerateRootStatusResponse, error) { return c.generateRootStatusCommon("/v1/sys/replication/dr/secondary/generate-operation-token/attempt") } func (c *Sys) generateRootStatusCommon(path string) (*GenerateRootStatusResponse, error) { r := c.c.NewRequest("GET", path) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result GenerateRootStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) GenerateRootInit(otp, pgpKey string) (*GenerateRootStatusResponse, error) { return c.generateRootInitCommon("/v1/sys/generate-root/attempt", otp, pgpKey) } func (c *Sys) GenerateDROperationTokenInit(otp, pgpKey string) (*GenerateRootStatusResponse, error) { return c.generateRootInitCommon("/v1/sys/replication/dr/secondary/generate-operation-token/attempt", otp, pgpKey) } func (c *Sys) generateRootInitCommon(path, otp, pgpKey string) (*GenerateRootStatusResponse, error) { body := map[string]interface{}{ "otp": otp, "pgp_key": pgpKey, } r := c.c.NewRequest("PUT", path) if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result GenerateRootStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) GenerateRootCancel() error { return c.generateRootCancelCommon("/v1/sys/generate-root/attempt") } func (c *Sys) GenerateDROperationTokenCancel() error { return c.generateRootCancelCommon("/v1/sys/replication/dr/secondary/generate-operation-token/attempt") } func (c *Sys) generateRootCancelCommon(path string) error { r := c.c.NewRequest("DELETE", path) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) GenerateRootUpdate(shard, nonce string) (*GenerateRootStatusResponse, error) { return c.generateRootUpdateCommon("/v1/sys/generate-root/update", shard, nonce) } func (c *Sys) GenerateDROperationTokenUpdate(shard, nonce string) (*GenerateRootStatusResponse, error) { return c.generateRootUpdateCommon("/v1/sys/replication/dr/secondary/generate-operation-token/update", shard, nonce) } func (c *Sys) generateRootUpdateCommon(path, shard, nonce string) (*GenerateRootStatusResponse, error) { body := map[string]interface{}{ "key": shard, "nonce": nonce, } r := c.c.NewRequest("PUT", path) if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result GenerateRootStatusResponse err = resp.DecodeJSON(&result) return &result, err } type GenerateRootStatusResponse struct { Nonce string `json:"nonce"` Started bool `json:"started"` Progress int `json:"progress"` Required int `json:"required"` Complete bool `json:"complete"` EncodedToken string `json:"encoded_token"` EncodedRootToken string `json:"encoded_root_token"` PGPFingerprint string `json:"pgp_fingerprint"` OTP string `json:"otp"` OTPLength int `json:"otp_length"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_health.go��������������������������������0000664�0000000�0000000�00000002756�13771713062�0025407�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import "context" func (c *Sys) Health() (*HealthResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/health") // If the code is 400 or above it will automatically turn into an error, // but the sys/health API defaults to returning 5xx when not sealed or // inited, so we force this code to be something else so we parse correctly r.Params.Add("uninitcode", "299") r.Params.Add("sealedcode", "299") r.Params.Add("standbycode", "299") r.Params.Add("drsecondarycode", "299") r.Params.Add("performancestandbycode", "299") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result HealthResponse err = resp.DecodeJSON(&result) return &result, err } type HealthResponse struct { Initialized bool `json:"initialized"` Sealed bool `json:"sealed"` Standby bool `json:"standby"` PerformanceStandby bool `json:"performance_standby"` ReplicationPerformanceMode string `json:"replication_performance_mode"` ReplicationDRMode string `json:"replication_dr_mode"` ServerTimeUTC int64 `json:"server_time_utc"` Version string `json:"version"` ClusterName string `json:"cluster_name,omitempty"` ClusterID string `json:"cluster_id,omitempty"` LastWAL uint64 `json:"last_wal,omitempty"` } ������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_init.go����������������������������������0000664�0000000�0000000�00000003140�13771713062�0025071�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import "context" func (c *Sys) InitStatus() (bool, error) { r := c.c.NewRequest("GET", "/v1/sys/init") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return false, err } defer resp.Body.Close() var result InitStatusResponse err = resp.DecodeJSON(&result) return result.Initialized, err } func (c *Sys) Init(opts *InitRequest) (*InitResponse, error) { r := c.c.NewRequest("PUT", "/v1/sys/init") if err := r.SetJSONBody(opts); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result InitResponse err = resp.DecodeJSON(&result) return &result, err } type InitRequest struct { SecretShares int `json:"secret_shares"` SecretThreshold int `json:"secret_threshold"` StoredShares int `json:"stored_shares"` PGPKeys []string `json:"pgp_keys"` RecoveryShares int `json:"recovery_shares"` RecoveryThreshold int `json:"recovery_threshold"` RecoveryPGPKeys []string `json:"recovery_pgp_keys"` RootTokenPGPKey string `json:"root_token_pgp_key"` } type InitStatusResponse struct { Initialized bool } type InitResponse struct { Keys []string `json:"keys"` KeysB64 []string `json:"keys_base64"` RecoveryKeys []string `json:"recovery_keys"` RecoveryKeysB64 []string `json:"recovery_keys_base64"` RootToken string `json:"root_token"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_leader.go��������������������������������0000664�0000000�0000000�00000001523�13771713062�0025365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import "context" func (c *Sys) Leader() (*LeaderResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/leader") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result LeaderResponse err = resp.DecodeJSON(&result) return &result, err } type LeaderResponse struct { HAEnabled bool `json:"ha_enabled"` IsSelf bool `json:"is_self"` LeaderAddress string `json:"leader_address"` LeaderClusterAddress string `json:"leader_cluster_address"` PerfStandby bool `json:"performance_standby"` PerfStandbyLastRemoteWAL uint64 `json:"performance_standby_last_remote_wal"` LastWAL uint64 `json:"last_wal"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_leases.go��������������������������������0000664�0000000�0000000�00000004253�13771713062�0025410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" ) func (c *Sys) Renew(id string, increment int) (*Secret, error) { r := c.c.NewRequest("PUT", "/v1/sys/leases/renew") body := map[string]interface{}{ "increment": increment, "lease_id": id, } if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() return ParseSecret(resp.Body) } func (c *Sys) Revoke(id string) error { r := c.c.NewRequest("PUT", "/v1/sys/leases/revoke/"+id) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RevokePrefix(id string) error { r := c.c.NewRequest("PUT", "/v1/sys/leases/revoke-prefix/"+id) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RevokeForce(id string) error { r := c.c.NewRequest("PUT", "/v1/sys/leases/revoke-force/"+id) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RevokeWithOptions(opts *RevokeOptions) error { if opts == nil { return errors.New("nil options provided") } // Construct path path := "/v1/sys/leases/revoke/" switch { case opts.Force: path = "/v1/sys/leases/revoke-force/" case opts.Prefix: path = "/v1/sys/leases/revoke-prefix/" } path += opts.LeaseID r := c.c.NewRequest("PUT", path) if !opts.Force { body := map[string]interface{}{ "sync": opts.Sync, } if err := r.SetJSONBody(body); err != nil { return err } } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } type RevokeOptions struct { LeaseID string Force bool Prefix bool Sync bool } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_mounts.go��������������������������������0000664�0000000�0000000�00000014466�13771713062�0025470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "fmt" "github.com/mitchellh/mapstructure" ) func (c *Sys) ListMounts() (map[string]*MountOutput, error) { r := c.c.NewRequest("GET", "/v1/sys/mounts") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } mounts := map[string]*MountOutput{} err = mapstructure.Decode(secret.Data, &mounts) if err != nil { return nil, err } return mounts, nil } func (c *Sys) Mount(path string, mountInfo *MountInput) error { r := c.c.NewRequest("POST", fmt.Sprintf("/v1/sys/mounts/%s", path)) if err := r.SetJSONBody(mountInfo); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } func (c *Sys) Unmount(path string) error { r := c.c.NewRequest("DELETE", fmt.Sprintf("/v1/sys/mounts/%s", path)) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) Remount(from, to string) error { body := map[string]interface{}{ "from": from, "to": to, } r := c.c.NewRequest("POST", "/v1/sys/remount") if err := r.SetJSONBody(body); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) TuneMount(path string, config MountConfigInput) error { r := c.c.NewRequest("POST", fmt.Sprintf("/v1/sys/mounts/%s/tune", path)) if err := r.SetJSONBody(config); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) MountConfig(path string) (*MountConfigOutput, error) { r := c.c.NewRequest("GET", fmt.Sprintf("/v1/sys/mounts/%s/tune", path)) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result MountConfigOutput err = mapstructure.Decode(secret.Data, &result) if err != nil { return nil, err } return &result, err } type MountInput struct { Type string `json:"type"` Description string `json:"description"` Config MountConfigInput `json:"config"` Local bool `json:"local"` SealWrap bool `json:"seal_wrap" mapstructure:"seal_wrap"` Options map[string]string `json:"options"` // Deprecated: Newer server responses should be returning this information in the // Type field (json: "type") instead. PluginName string `json:"plugin_name,omitempty"` } type MountConfigInput struct { Options map[string]string `json:"options" mapstructure:"options"` DefaultLeaseTTL string `json:"default_lease_ttl" mapstructure:"default_lease_ttl"` Description *string `json:"description,omitempty" mapstructure:"description"` MaxLeaseTTL string `json:"max_lease_ttl" mapstructure:"max_lease_ttl"` ForceNoCache bool `json:"force_no_cache" mapstructure:"force_no_cache"` AuditNonHMACRequestKeys []string `json:"audit_non_hmac_request_keys,omitempty" mapstructure:"audit_non_hmac_request_keys"` AuditNonHMACResponseKeys []string `json:"audit_non_hmac_response_keys,omitempty" mapstructure:"audit_non_hmac_response_keys"` ListingVisibility string `json:"listing_visibility,omitempty" mapstructure:"listing_visibility"` PassthroughRequestHeaders []string `json:"passthrough_request_headers,omitempty" mapstructure:"passthrough_request_headers"` AllowedResponseHeaders []string `json:"allowed_response_headers,omitempty" mapstructure:"allowed_response_headers"` TokenType string `json:"token_type,omitempty" mapstructure:"token_type"` // Deprecated: This field will always be blank for newer server responses. PluginName string `json:"plugin_name,omitempty" mapstructure:"plugin_name"` } type MountOutput struct { UUID string `json:"uuid"` Type string `json:"type"` Description string `json:"description"` Accessor string `json:"accessor"` Config MountConfigOutput `json:"config"` Options map[string]string `json:"options"` Local bool `json:"local"` SealWrap bool `json:"seal_wrap" mapstructure:"seal_wrap"` } type MountConfigOutput struct { DefaultLeaseTTL int `json:"default_lease_ttl" mapstructure:"default_lease_ttl"` MaxLeaseTTL int `json:"max_lease_ttl" mapstructure:"max_lease_ttl"` ForceNoCache bool `json:"force_no_cache" mapstructure:"force_no_cache"` AuditNonHMACRequestKeys []string `json:"audit_non_hmac_request_keys,omitempty" mapstructure:"audit_non_hmac_request_keys"` AuditNonHMACResponseKeys []string `json:"audit_non_hmac_response_keys,omitempty" mapstructure:"audit_non_hmac_response_keys"` ListingVisibility string `json:"listing_visibility,omitempty" mapstructure:"listing_visibility"` PassthroughRequestHeaders []string `json:"passthrough_request_headers,omitempty" mapstructure:"passthrough_request_headers"` AllowedResponseHeaders []string `json:"allowed_response_headers,omitempty" mapstructure:"allowed_response_headers"` TokenType string `json:"token_type,omitempty" mapstructure:"token_type"` // Deprecated: This field will always be blank for newer server responses. PluginName string `json:"plugin_name,omitempty" mapstructure:"plugin_name"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_plugins.go�������������������������������0000664�0000000�0000000�00000014260�13771713062�0025614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "fmt" "net/http" "github.com/hashicorp/vault/sdk/helper/consts" "github.com/mitchellh/mapstructure" ) // ListPluginsInput is used as input to the ListPlugins function. type ListPluginsInput struct { // Type of the plugin. Required. Type consts.PluginType `json:"type"` } // ListPluginsResponse is the response from the ListPlugins call. type ListPluginsResponse struct { // PluginsByType is the list of plugins by type. PluginsByType map[consts.PluginType][]string `json:"types"` // Names is the list of names of the plugins. // // Deprecated: Newer server responses should be returning PluginsByType (json: // "types") instead. Names []string `json:"names"` } // ListPlugins lists all plugins in the catalog and returns their names as a // list of strings. func (c *Sys) ListPlugins(i *ListPluginsInput) (*ListPluginsResponse, error) { path := "" method := "" if i.Type == consts.PluginTypeUnknown { path = "/v1/sys/plugins/catalog" method = "GET" } else { path = fmt.Sprintf("/v1/sys/plugins/catalog/%s", i.Type) method = "LIST" } req := c.c.NewRequest(method, path) if method == "LIST" { // Set this for broader compatibility, but we use LIST above to be able // to handle the wrapping lookup function req.Method = "GET" req.Params.Set("list", "true") } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, req) if err != nil && resp == nil { return nil, err } if resp == nil { return nil, nil } defer resp.Body.Close() // We received an Unsupported Operation response from Vault, indicating // Vault of an older version that doesn't support the GET method yet; // switch it to a LIST. if resp.StatusCode == 405 { req.Params.Set("list", "true") resp, err := c.c.RawRequestWithContext(ctx, req) if err != nil { return nil, err } defer resp.Body.Close() var result struct { Data struct { Keys []string `json:"keys"` } `json:"data"` } if err := resp.DecodeJSON(&result); err != nil { return nil, err } return &ListPluginsResponse{Names: result.Data.Keys}, nil } secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } result := &ListPluginsResponse{ PluginsByType: make(map[consts.PluginType][]string), } if i.Type == consts.PluginTypeUnknown { for pluginTypeStr, pluginsRaw := range secret.Data { pluginType, err := consts.ParsePluginType(pluginTypeStr) if err != nil { return nil, err } pluginsIfc, ok := pluginsRaw.([]interface{}) if !ok { return nil, fmt.Errorf("unable to parse plugins for %q type", pluginTypeStr) } plugins := make([]string, len(pluginsIfc)) for i, nameIfc := range pluginsIfc { name, ok := nameIfc.(string) if !ok { } plugins[i] = name } result.PluginsByType[pluginType] = plugins } } else { var respKeys []string if err := mapstructure.Decode(secret.Data["keys"], &respKeys); err != nil { return nil, err } result.PluginsByType[i.Type] = respKeys } return result, nil } // GetPluginInput is used as input to the GetPlugin function. type GetPluginInput struct { Name string `json:"-"` // Type of the plugin. Required. Type consts.PluginType `json:"type"` } // GetPluginResponse is the response from the GetPlugin call. type GetPluginResponse struct { Args []string `json:"args"` Builtin bool `json:"builtin"` Command string `json:"command"` Name string `json:"name"` SHA256 string `json:"sha256"` } // GetPlugin retrieves information about the plugin. func (c *Sys) GetPlugin(i *GetPluginInput) (*GetPluginResponse, error) { path := catalogPathByType(i.Type, i.Name) req := c.c.NewRequest(http.MethodGet, path) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, req) if err != nil { return nil, err } defer resp.Body.Close() var result struct { Data *GetPluginResponse } err = resp.DecodeJSON(&result) if err != nil { return nil, err } return result.Data, err } // RegisterPluginInput is used as input to the RegisterPlugin function. type RegisterPluginInput struct { // Name is the name of the plugin. Required. Name string `json:"-"` // Type of the plugin. Required. Type consts.PluginType `json:"type"` // Args is the list of args to spawn the process with. Args []string `json:"args,omitempty"` // Command is the command to run. Command string `json:"command,omitempty"` // SHA256 is the shasum of the plugin. SHA256 string `json:"sha256,omitempty"` } // RegisterPlugin registers the plugin with the given information. func (c *Sys) RegisterPlugin(i *RegisterPluginInput) error { path := catalogPathByType(i.Type, i.Name) req := c.c.NewRequest(http.MethodPut, path) if err := req.SetJSONBody(i); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, req) if err == nil { defer resp.Body.Close() } return err } // DeregisterPluginInput is used as input to the DeregisterPlugin function. type DeregisterPluginInput struct { // Name is the name of the plugin. Required. Name string `json:"-"` // Type of the plugin. Required. Type consts.PluginType `json:"type"` } // DeregisterPlugin removes the plugin with the given name from the plugin // catalog. func (c *Sys) DeregisterPlugin(i *DeregisterPluginInput) error { path := catalogPathByType(i.Type, i.Name) req := c.c.NewRequest(http.MethodDelete, path) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, req) if err == nil { defer resp.Body.Close() } return err } // catalogPathByType is a helper to construct the proper API path by plugin type func catalogPathByType(pluginType consts.PluginType, name string) string { path := fmt.Sprintf("/v1/sys/plugins/catalog/%s/%s", pluginType, name) // Backwards compat, if type is not provided then use old path if pluginType == consts.PluginTypeUnknown { path = fmt.Sprintf("/v1/sys/plugins/catalog/%s", name) } return path } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_policy.go��������������������������������0000664�0000000�0000000�00000004672�13771713062�0025440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "fmt" "github.com/mitchellh/mapstructure" ) func (c *Sys) ListPolicies() ([]string, error) { r := c.c.NewRequest("LIST", "/v1/sys/policies/acl") // Set this for broader compatibility, but we use LIST above to be able to // handle the wrapping lookup function r.Method = "GET" r.Params.Set("list", "true") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result []string err = mapstructure.Decode(secret.Data["keys"], &result) if err != nil { return nil, err } return result, err } func (c *Sys) GetPolicy(name string) (string, error) { r := c.c.NewRequest("GET", fmt.Sprintf("/v1/sys/policies/acl/%s", name)) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if resp != nil { defer resp.Body.Close() if resp.StatusCode == 404 { return "", nil } } if err != nil { return "", err } secret, err := ParseSecret(resp.Body) if err != nil { return "", err } if secret == nil || secret.Data == nil { return "", errors.New("data from server response is empty") } if policyRaw, ok := secret.Data["policy"]; ok { return policyRaw.(string), nil } return "", fmt.Errorf("no policy found in response") } func (c *Sys) PutPolicy(name, rules string) error { body := map[string]string{ "policy": rules, } r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/sys/policies/acl/%s", name)) if err := r.SetJSONBody(body); err != nil { return err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } func (c *Sys) DeletePolicy(name string) error { r := c.c.NewRequest("DELETE", fmt.Sprintf("/v1/sys/policies/acl/%s", name)) ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } type getPoliciesResp struct { Rules string `json:"rules"` } type listPoliciesResp struct { Policies []string `json:"policies"` } ����������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_raft.go����������������������������������0000664�0000000�0000000�00000006203�13771713062�0025065�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "io" "net/http" "github.com/hashicorp/vault/sdk/helper/consts" ) // RaftJoinResponse represents the response of the raft join API type RaftJoinResponse struct { Joined bool `json:"joined"` } // RaftJoinRequest represents the parameters consumed by the raft join API type RaftJoinRequest struct { LeaderAPIAddr string `json:"leader_api_addr"` LeaderCACert string `json:"leader_ca_cert":` LeaderClientCert string `json:"leader_client_cert"` LeaderClientKey string `json:"leader_client_key"` Retry bool `json:"retry"` } // RaftJoin adds the node from which this call is invoked from to the raft // cluster represented by the leader address in the parameter. func (c *Sys) RaftJoin(opts *RaftJoinRequest) (*RaftJoinResponse, error) { r := c.c.NewRequest("POST", "/v1/sys/storage/raft/join") if err := r.SetJSONBody(opts); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RaftJoinResponse err = resp.DecodeJSON(&result) return &result, err } // RaftSnapshot invokes the API that takes the snapshot of the raft cluster and // writes it to the supplied io.Writer. func (c *Sys) RaftSnapshot(snapWriter io.Writer) error { r := c.c.NewRequest("GET", "/v1/sys/storage/raft/snapshot") r.URL.RawQuery = r.Params.Encode() req, err := http.NewRequest(http.MethodGet, r.URL.RequestURI(), nil) if err != nil { return err } req.URL.User = r.URL.User req.URL.Scheme = r.URL.Scheme req.URL.Host = r.URL.Host req.Host = r.URL.Host if r.Headers != nil { for header, vals := range r.Headers { for _, val := range vals { req.Header.Add(header, val) } } } if len(r.ClientToken) != 0 { req.Header.Set(consts.AuthHeaderName, r.ClientToken) } if len(r.WrapTTL) != 0 { req.Header.Set("X-Vault-Wrap-TTL", r.WrapTTL) } if len(r.MFAHeaderVals) != 0 { for _, mfaHeaderVal := range r.MFAHeaderVals { req.Header.Add("X-Vault-MFA", mfaHeaderVal) } } if r.PolicyOverride { req.Header.Set("X-Vault-Policy-Override", "true") } // Avoiding the use of RawRequestWithContext which reads the response body // to determine if the body contains error message. var result *Response resp, err := c.c.config.HttpClient.Do(req) if resp == nil { return nil } result = &Response{Response: resp} if err := result.Error(); err != nil { return err } _, err = io.Copy(snapWriter, resp.Body) if err != nil { return err } return nil } // RaftSnapshotRestore reads the snapshot from the io.Reader and installs that // snapshot, returning the cluster to the state defined by it. func (c *Sys) RaftSnapshotRestore(snapReader io.Reader, force bool) error { path := "/v1/sys/storage/raft/snapshot" if force { path = "/v1/sys/storage/raft/snapshot-force" } r := c.c.NewRequest("POST", path) r.Body = snapReader ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return err } defer resp.Body.Close() return nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_rekey.go���������������������������������0000664�0000000�0000000�00000023561�13771713062�0025256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "errors" "github.com/mitchellh/mapstructure" ) func (c *Sys) RekeyStatus() (*RekeyStatusResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/rekey/init") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyRecoveryKeyStatus() (*RekeyStatusResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/rekey-recovery-key/init") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyVerificationStatus() (*RekeyVerificationStatusResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/rekey/verify") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyVerificationStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyRecoveryKeyVerificationStatus() (*RekeyVerificationStatusResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/rekey-recovery-key/verify") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyVerificationStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyInit(config *RekeyInitRequest) (*RekeyStatusResponse, error) { r := c.c.NewRequest("PUT", "/v1/sys/rekey/init") if err := r.SetJSONBody(config); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyRecoveryKeyInit(config *RekeyInitRequest) (*RekeyStatusResponse, error) { r := c.c.NewRequest("PUT", "/v1/sys/rekey-recovery-key/init") if err := r.SetJSONBody(config); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyStatusResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyCancel() error { r := c.c.NewRequest("DELETE", "/v1/sys/rekey/init") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RekeyRecoveryKeyCancel() error { r := c.c.NewRequest("DELETE", "/v1/sys/rekey-recovery-key/init") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RekeyVerificationCancel() error { r := c.c.NewRequest("DELETE", "/v1/sys/rekey/verify") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RekeyRecoveryKeyVerificationCancel() error { r := c.c.NewRequest("DELETE", "/v1/sys/rekey-recovery-key/verify") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RekeyUpdate(shard, nonce string) (*RekeyUpdateResponse, error) { body := map[string]interface{}{ "key": shard, "nonce": nonce, } r := c.c.NewRequest("PUT", "/v1/sys/rekey/update") if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyUpdateResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyRecoveryKeyUpdate(shard, nonce string) (*RekeyUpdateResponse, error) { body := map[string]interface{}{ "key": shard, "nonce": nonce, } r := c.c.NewRequest("PUT", "/v1/sys/rekey-recovery-key/update") if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyUpdateResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyRetrieveBackup() (*RekeyRetrieveResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/rekey/backup") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result RekeyRetrieveResponse err = mapstructure.Decode(secret.Data, &result) if err != nil { return nil, err } return &result, err } func (c *Sys) RekeyRetrieveRecoveryBackup() (*RekeyRetrieveResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/rekey/recovery-key-backup") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result RekeyRetrieveResponse err = mapstructure.Decode(secret.Data, &result) if err != nil { return nil, err } return &result, err } func (c *Sys) RekeyDeleteBackup() error { r := c.c.NewRequest("DELETE", "/v1/sys/rekey/backup") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RekeyDeleteRecoveryBackup() error { r := c.c.NewRequest("DELETE", "/v1/sys/rekey/recovery-key-backup") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) RekeyVerificationUpdate(shard, nonce string) (*RekeyVerificationUpdateResponse, error) { body := map[string]interface{}{ "key": shard, "nonce": nonce, } r := c.c.NewRequest("PUT", "/v1/sys/rekey/verify") if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyVerificationUpdateResponse err = resp.DecodeJSON(&result) return &result, err } func (c *Sys) RekeyRecoveryKeyVerificationUpdate(shard, nonce string) (*RekeyVerificationUpdateResponse, error) { body := map[string]interface{}{ "key": shard, "nonce": nonce, } r := c.c.NewRequest("PUT", "/v1/sys/rekey-recovery-key/verify") if err := r.SetJSONBody(body); err != nil { return nil, err } ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result RekeyVerificationUpdateResponse err = resp.DecodeJSON(&result) return &result, err } type RekeyInitRequest struct { SecretShares int `json:"secret_shares"` SecretThreshold int `json:"secret_threshold"` StoredShares int `json:"stored_shares"` PGPKeys []string `json:"pgp_keys"` Backup bool RequireVerification bool `json:"require_verification"` } type RekeyStatusResponse struct { Nonce string `json:"nonce"` Started bool `json:"started"` T int `json:"t"` N int `json:"n"` Progress int `json:"progress"` Required int `json:"required"` PGPFingerprints []string `json:"pgp_fingerprints"` Backup bool `json:"backup"` VerificationRequired bool `json:"verification_required"` VerificationNonce string `json:"verification_nonce"` } type RekeyUpdateResponse struct { Nonce string `json:"nonce"` Complete bool `json:"complete"` Keys []string `json:"keys"` KeysB64 []string `json:"keys_base64"` PGPFingerprints []string `json:"pgp_fingerprints"` Backup bool `json:"backup"` VerificationRequired bool `json:"verification_required"` VerificationNonce string `json:"verification_nonce,omitempty"` } type RekeyRetrieveResponse struct { Nonce string `json:"nonce" mapstructure:"nonce"` Keys map[string][]string `json:"keys" mapstructure:"keys"` KeysB64 map[string][]string `json:"keys_base64" mapstructure:"keys_base64"` } type RekeyVerificationStatusResponse struct { Nonce string `json:"nonce"` Started bool `json:"started"` T int `json:"t"` N int `json:"n"` Progress int `json:"progress"` } type RekeyVerificationUpdateResponse struct { Nonce string `json:"nonce"` Complete bool `json:"complete"` } �����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_rotate.go��������������������������������0000664�0000000�0000000�00000003220�13771713062�0025423�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import ( "context" "encoding/json" "errors" "time" ) func (c *Sys) Rotate() error { r := c.c.NewRequest("POST", "/v1/sys/rotate") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) KeyStatus() (*KeyStatus, error) { r := c.c.NewRequest("GET", "/v1/sys/key-status") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() secret, err := ParseSecret(resp.Body) if err != nil { return nil, err } if secret == nil || secret.Data == nil { return nil, errors.New("data from server response is empty") } var result KeyStatus termRaw, ok := secret.Data["term"] if !ok { return nil, errors.New("term not found in response") } term, ok := termRaw.(json.Number) if !ok { return nil, errors.New("could not convert term to a number") } term64, err := term.Int64() if err != nil { return nil, err } result.Term = int(term64) installTimeRaw, ok := secret.Data["install_time"] if !ok { return nil, errors.New("install_time not found in response") } installTimeStr, ok := installTimeRaw.(string) if !ok { return nil, errors.New("could not convert install_time to a string") } installTime, err := time.Parse(time.RFC3339Nano, installTimeStr) if err != nil { return nil, err } result.InstallTime = installTime return &result, err } type KeyStatus struct { Term int `json:"term"` InstallTime time.Time `json:"install_time"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_seal.go����������������������������������0000664�0000000�0000000�00000004204�13771713062�0025054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import "context" func (c *Sys) SealStatus() (*SealStatusResponse, error) { r := c.c.NewRequest("GET", "/v1/sys/seal-status") return sealStatusRequest(c, r) } func (c *Sys) Seal() error { r := c.c.NewRequest("PUT", "/v1/sys/seal") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err == nil { defer resp.Body.Close() } return err } func (c *Sys) ResetUnsealProcess() (*SealStatusResponse, error) { body := map[string]interface{}{"reset": true} r := c.c.NewRequest("PUT", "/v1/sys/unseal") if err := r.SetJSONBody(body); err != nil { return nil, err } return sealStatusRequest(c, r) } func (c *Sys) Unseal(shard string) (*SealStatusResponse, error) { body := map[string]interface{}{"key": shard} r := c.c.NewRequest("PUT", "/v1/sys/unseal") if err := r.SetJSONBody(body); err != nil { return nil, err } return sealStatusRequest(c, r) } func (c *Sys) UnsealWithOptions(opts *UnsealOpts) (*SealStatusResponse, error) { r := c.c.NewRequest("PUT", "/v1/sys/unseal") if err := r.SetJSONBody(opts); err != nil { return nil, err } return sealStatusRequest(c, r) } func sealStatusRequest(c *Sys, r *Request) (*SealStatusResponse, error) { ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if err != nil { return nil, err } defer resp.Body.Close() var result SealStatusResponse err = resp.DecodeJSON(&result) return &result, err } type SealStatusResponse struct { Type string `json:"type"` Initialized bool `json:"initialized"` Sealed bool `json:"sealed"` T int `json:"t"` N int `json:"n"` Progress int `json:"progress"` Nonce string `json:"nonce"` Version string `json:"version"` Migration bool `json:"migration"` ClusterName string `json:"cluster_name,omitempty"` ClusterID string `json:"cluster_id,omitempty"` RecoverySeal bool `json:"recovery_seal"` } type UnsealOpts struct { Key string `json:"key"` Reset bool `json:"reset"` Migrate bool `json:"migrate"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/api/sys_stepdown.go������������������������������0000664�0000000�0000000�00000000476�13771713062�0026002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package api import "context" func (c *Sys) StepDown() error { r := c.c.NewRequest("PUT", "/v1/sys/step-down") ctx, cancelFunc := context.WithCancel(context.Background()) defer cancelFunc() resp, err := c.c.RawRequestWithContext(ctx, r) if resp != nil && resp.Body != nil { resp.Body.Close() } return err } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/���������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022713�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/LICENSE��������������������������������������0000664�0000000�0000000�00000037062�13771713062�0023730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License, version 2.0 1. Definitions 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or b. any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: a. for any code that a Contributor has removed from Covered Software; or b. for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or c. under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. 6. Disclaimer of Warranty Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. 7. Limitation of Liability Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. 8. Litigation Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024172�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/compressutil/�������������������������0000775�0000000�0000000�00000000000�13771713062�0026723�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/compressutil/compress.go��������������0000664�0000000�0000000�00000013775�13771713062�0031122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package compressutil import ( "bytes" "compress/gzip" "compress/lzw" "fmt" "io" "github.com/golang/snappy" "github.com/hashicorp/errwrap" "github.com/pierrec/lz4" ) const ( // A byte value used as a canary prefix for the compressed information // which is used to distinguish if a JSON input is compressed or not. // The value of this constant should not be a first character of any // valid JSON string. CompressionTypeGzip = "gzip" CompressionCanaryGzip byte = 'G' CompressionTypeLZW = "lzw" CompressionCanaryLZW byte = 'L' CompressionTypeSnappy = "snappy" CompressionCanarySnappy byte = 'S' CompressionTypeLZ4 = "lz4" CompressionCanaryLZ4 byte = '4' ) // SnappyReadCloser embeds the snappy reader which implements the io.Reader // interface. The decompress procedure in this utility expects an // io.ReadCloser. This type implements the io.Closer interface to retain the // generic way of decompression. type CompressUtilReadCloser struct { io.Reader } // Close is a noop method implemented only to satisfy the io.Closer interface func (c *CompressUtilReadCloser) Close() error { return nil } // CompressionConfig is used to select a compression type to be performed by // Compress and Decompress utilities. // Supported types are: // * CompressionTypeLZW // * CompressionTypeGzip // * CompressionTypeSnappy // * CompressionTypeLZ4 // // When using CompressionTypeGzip, the compression levels can also be chosen: // * gzip.DefaultCompression // * gzip.BestSpeed // * gzip.BestCompression type CompressionConfig struct { // Type of the compression algorithm to be used Type string // When using Gzip format, the compression level to employ GzipCompressionLevel int } // Compress places the canary byte in a buffer and uses the same buffer to fill // in the compressed information of the given input. The configuration supports // two type of compression: LZW and Gzip. When using Gzip compression format, // if GzipCompressionLevel is not specified, the 'gzip.DefaultCompression' will // be assumed. func Compress(data []byte, config *CompressionConfig) ([]byte, error) { var buf bytes.Buffer var writer io.WriteCloser var err error if config == nil { return nil, fmt.Errorf("config is nil") } // Write the canary into the buffer and create writer to compress the // input data based on the configured type switch config.Type { case CompressionTypeLZW: buf.Write([]byte{CompressionCanaryLZW}) writer = lzw.NewWriter(&buf, lzw.LSB, 8) case CompressionTypeGzip: buf.Write([]byte{CompressionCanaryGzip}) switch { case config.GzipCompressionLevel == gzip.BestCompression, config.GzipCompressionLevel == gzip.BestSpeed, config.GzipCompressionLevel == gzip.DefaultCompression: // These are valid compression levels default: // If compression level is set to NoCompression or to // any invalid value, fallback to Defaultcompression config.GzipCompressionLevel = gzip.DefaultCompression } writer, err = gzip.NewWriterLevel(&buf, config.GzipCompressionLevel) case CompressionTypeSnappy: buf.Write([]byte{CompressionCanarySnappy}) writer = snappy.NewBufferedWriter(&buf) case CompressionTypeLZ4: buf.Write([]byte{CompressionCanaryLZ4}) writer = lz4.NewWriter(&buf) default: return nil, fmt.Errorf("unsupported compression type") } if err != nil { return nil, errwrap.Wrapf("failed to create a compression writer: {{err}}", err) } if writer == nil { return nil, fmt.Errorf("failed to create a compression writer") } // Compress the input and place it in the same buffer containing the // canary byte. if _, err = writer.Write(data); err != nil { return nil, errwrap.Wrapf("failed to compress input data: err: {{err}}", err) } // Close the io.WriteCloser if err = writer.Close(); err != nil { return nil, err } // Return the compressed bytes with canary byte at the start return buf.Bytes(), nil } // Decompress checks if the first byte in the input matches the canary byte. // If the first byte is a canary byte, then the input past the canary byte // will be decompressed using the method specified in the given configuration. // If the first byte isn't a canary byte, then the utility returns a boolean // value indicating that the input was not compressed. func Decompress(data []byte) ([]byte, bool, error) { var err error var reader io.ReadCloser if data == nil || len(data) == 0 { return nil, false, fmt.Errorf("'data' being decompressed is empty") } canary := data[0] cData := data[1:] switch canary { // If the first byte matches the canary byte, remove the canary // byte and try to decompress the data that is after the canary. case CompressionCanaryGzip: if len(data) < 2 { return nil, false, fmt.Errorf("invalid 'data' after the canary") } reader, err = gzip.NewReader(bytes.NewReader(cData)) case CompressionCanaryLZW: if len(data) < 2 { return nil, false, fmt.Errorf("invalid 'data' after the canary") } reader = lzw.NewReader(bytes.NewReader(cData), lzw.LSB, 8) case CompressionCanarySnappy: if len(data) < 2 { return nil, false, fmt.Errorf("invalid 'data' after the canary") } reader = &CompressUtilReadCloser{ Reader: snappy.NewReader(bytes.NewReader(cData)), } case CompressionCanaryLZ4: if len(data) < 2 { return nil, false, fmt.Errorf("invalid 'data' after the canary") } reader = &CompressUtilReadCloser{ Reader: lz4.NewReader(bytes.NewReader(cData)), } default: // If the first byte doesn't match the canary byte, it means // that the content was not compressed at all. Indicate the // caller that the input was not compressed. return nil, true, nil } if err != nil { return nil, false, errwrap.Wrapf("failed to create a compression reader: {{err}}", err) } if reader == nil { return nil, false, fmt.Errorf("failed to create a compression reader") } // Close the io.ReadCloser defer reader.Close() // Read all the compressed data into a buffer var buf bytes.Buffer if _, err = io.Copy(&buf, reader); err != nil { return nil, false, err } return buf.Bytes(), false, nil } ���packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/consts/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025503�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/consts/agent.go�����������������������0000664�0000000�0000000�00000000237�13771713062�0027132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package consts // AgentPathCacheClear is the path that the agent will use as its cache-clear // endpoint. const AgentPathCacheClear = "/agent/v1/cache-clear" �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/consts/consts.go����������������������0000664�0000000�0000000�00000001465�13771713062�0027351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package consts const ( // ExpirationRestoreWorkerCount specifies the number of workers to use while // restoring leases into the expiration manager ExpirationRestoreWorkerCount = 64 // NamespaceHeaderName is the header set to specify which namespace the // request is indented for. NamespaceHeaderName = "X-Vault-Namespace" // AuthHeaderName is the name of the header containing the token. AuthHeaderName = "X-Vault-Token" // PerformanceReplicationALPN is the negotiated protocol used for // performance replication. PerformanceReplicationALPN = "replication_v1" // DRReplicationALPN is the negotiated protocol used for // dr replication. DRReplicationALPN = "replication_dr_v1" PerfStandbyALPN = "perf_standby_v1" RequestForwardingALPN = "req_fw_sb-act_v1" RaftStorageALPN = "raft_storage_v1" ) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/consts/error.go�����������������������0000664�0000000�0000000�00000001432�13771713062�0027163�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package consts import "errors" var ( // ErrSealed is returned if an operation is performed on a sealed barrier. // No operation is expected to succeed before unsealing ErrSealed = errors.New("Vault is sealed") // ErrStandby is returned if an operation is performed on a standby Vault. // No operation is expected to succeed until active. ErrStandby = errors.New("Vault is in standby mode") // ErrPathContainsParentReferences is returned when a path contains parent // references. ErrPathContainsParentReferences = errors.New("path cannot contain parent references") // ErrInvalidWrappingToken is returned when checking for the validity of // a wrapping token that turns out to be invalid. ErrInvalidWrappingToken = errors.New("wrapping token is not valid or does not exist") ) ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/consts/plugin_types.go����������������0000664�0000000�0000000�00000002642�13771713062�0030560�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package consts import "fmt" var PluginTypes = []PluginType{ PluginTypeUnknown, PluginTypeCredential, PluginTypeDatabase, PluginTypeSecrets, } type PluginType uint32 // This is a list of PluginTypes used by Vault. // If we need to add any in the future, it would // be best to add them to the _end_ of the list below // because they resolve to incrementing numbers, // which may be saved in state somewhere. Thus if // the name for one of those numbers changed because // a value were added to the middle, that could cause // the wrong plugin types to be read from storage // for a given underlying number. Example of the problem // here: https://play.golang.org/p/YAaPw5ww3er const ( PluginTypeUnknown PluginType = iota PluginTypeCredential PluginTypeDatabase PluginTypeSecrets ) func (p PluginType) String() string { switch p { case PluginTypeUnknown: return "unknown" case PluginTypeCredential: return "auth" case PluginTypeDatabase: return "database" case PluginTypeSecrets: return "secret" default: return "unsupported" } } func ParsePluginType(pluginType string) (PluginType, error) { switch pluginType { case "unknown": return PluginTypeUnknown, nil case "auth": return PluginTypeCredential, nil case "database": return PluginTypeDatabase, nil case "secret": return PluginTypeSecrets, nil default: return PluginTypeUnknown, fmt.Errorf("%q is not a supported plugin type", pluginType) } } ����������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/consts/replication.go�����������������0000664�0000000�0000000�00000010774�13771713062�0030354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package consts import "time" const ( //N.B. This needs to be excluded from replication despite the name; it's //merely saying that this is cluster information for the replicated //cluster. CoreReplicatedClusterPrefix = "core/cluster/replicated/" CoreReplicatedClusterPrefixDR = "core/cluster/replicated-dr/" CoreReplicatedClusterInfoPath = CoreReplicatedClusterPrefix + "info" CoreReplicatedClusterSecondariesPrefix = CoreReplicatedClusterPrefix + "secondaries/" CoreReplicatedClusterInfoPathDR = CoreReplicatedClusterPrefixDR + "info" CoreReplicatedClusterSecondariesPrefixDR = CoreReplicatedClusterPrefixDR + "secondaries/" // This is an identifier for the current secondary in the replicated paths // manager. It should contain a character that is not allowed in secondary // ids to ensure it doesn't collide. CurrentReplicatedSecondaryIdentifier = ".current" ) type ReplicationState uint32 var ReplicationStaleReadTimeout = 2 * time.Second const ( _ ReplicationState = iota OldReplicationPrimary OldReplicationSecondary OldReplicationBootstrapping // Don't add anything here. Adding anything to this Old block would cause // the rest of the values to change below. This was done originally to // ensure no overlap between old and new values. ReplicationUnknown ReplicationState = 0 ReplicationPerformancePrimary ReplicationState = 1 << iota // Note -- iota is 5 here! ReplicationPerformanceSecondary OldSplitReplicationBootstrapping ReplicationDRPrimary ReplicationDRSecondary ReplicationPerformanceBootstrapping ReplicationDRBootstrapping ReplicationPerformanceDisabled ReplicationDRDisabled ReplicationPerformanceStandby ) // We verify no change to the above values are made func init() { if OldReplicationBootstrapping != 3 { panic("Replication Constants have changed") } if ReplicationPerformancePrimary != 1<<5 { panic("Replication Constants have changed") } } func (r ReplicationState) string() string { switch r { case ReplicationPerformanceSecondary: return "secondary" case ReplicationPerformancePrimary: return "primary" case ReplicationPerformanceBootstrapping: return "bootstrapping" case ReplicationPerformanceDisabled: return "disabled" case ReplicationDRPrimary: return "primary" case ReplicationDRSecondary: return "secondary" case ReplicationDRBootstrapping: return "bootstrapping" case ReplicationDRDisabled: return "disabled" } return "unknown" } func (r ReplicationState) StateStrings() []string { var ret []string if r.HasState(ReplicationPerformanceSecondary) { ret = append(ret, "perf-secondary") } if r.HasState(ReplicationPerformancePrimary) { ret = append(ret, "perf-primary") } if r.HasState(ReplicationPerformanceBootstrapping) { ret = append(ret, "perf-bootstrapping") } if r.HasState(ReplicationPerformanceDisabled) { ret = append(ret, "perf-disabled") } if r.HasState(ReplicationDRPrimary) { ret = append(ret, "dr-primary") } if r.HasState(ReplicationDRSecondary) { ret = append(ret, "dr-secondary") } if r.HasState(ReplicationDRBootstrapping) { ret = append(ret, "dr-bootstrapping") } if r.HasState(ReplicationDRDisabled) { ret = append(ret, "dr-disabled") } if r.HasState(ReplicationPerformanceStandby) { ret = append(ret, "perfstandby") } return ret } func (r ReplicationState) GetDRString() string { switch { case r.HasState(ReplicationDRBootstrapping): return ReplicationDRBootstrapping.string() case r.HasState(ReplicationDRPrimary): return ReplicationDRPrimary.string() case r.HasState(ReplicationDRSecondary): return ReplicationDRSecondary.string() case r.HasState(ReplicationDRDisabled): return ReplicationDRDisabled.string() default: return "unknown" } } func (r ReplicationState) GetPerformanceString() string { switch { case r.HasState(ReplicationPerformanceBootstrapping): return ReplicationPerformanceBootstrapping.string() case r.HasState(ReplicationPerformancePrimary): return ReplicationPerformancePrimary.string() case r.HasState(ReplicationPerformanceSecondary): return ReplicationPerformanceSecondary.string() case r.HasState(ReplicationPerformanceDisabled): return ReplicationPerformanceDisabled.string() default: return "unknown" } } func (r ReplicationState) HasState(flag ReplicationState) bool { return r&flag != 0 } func (r *ReplicationState) AddState(flag ReplicationState) { *r |= flag } func (r *ReplicationState) ClearState(flag ReplicationState) { *r &= ^flag } func (r *ReplicationState) ToggleState(flag ReplicationState) { *r ^= flag } ����packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/hclutil/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025636�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/hclutil/hcl.go������������������������0000664�0000000�0000000�00000001514�13771713062�0026734�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package hclutil import ( "fmt" multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/hcl/hcl/ast" ) // CheckHCLKeys checks whether the keys in the AST list contains any of the valid keys provided. func CheckHCLKeys(node ast.Node, valid []string) error { var list *ast.ObjectList switch n := node.(type) { case *ast.ObjectList: list = n case *ast.ObjectType: list = n.List default: return fmt.Errorf("cannot check HCL keys of type %T", n) } validMap := make(map[string]struct{}, len(valid)) for _, v := range valid { validMap[v] = struct{}{} } var result error for _, item := range list.Items { key := item.Keys[0].Token.Value().(string) if _, ok := validMap[key]; !ok { result = multierror.Append(result, fmt.Errorf("invalid key %q on line %d", key, item.Assign.Line)) } } return result } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/jsonutil/�����������������������������0000775�0000000�0000000�00000000000�13771713062�0026041�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/jsonutil/json.go����������������������0000664�0000000�0000000�00000005735�13771713062�0027353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package jsonutil import ( "bytes" "compress/gzip" "encoding/json" "fmt" "io" "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/sdk/helper/compressutil" ) // Encodes/Marshals the given object into JSON func EncodeJSON(in interface{}) ([]byte, error) { if in == nil { return nil, fmt.Errorf("input for encoding is nil") } var buf bytes.Buffer enc := json.NewEncoder(&buf) if err := enc.Encode(in); err != nil { return nil, err } return buf.Bytes(), nil } // EncodeJSONAndCompress encodes the given input into JSON and compresses the // encoded value (using Gzip format BestCompression level, by default). A // canary byte is placed at the beginning of the returned bytes for the logic // in decompression method to identify compressed input. func EncodeJSONAndCompress(in interface{}, config *compressutil.CompressionConfig) ([]byte, error) { if in == nil { return nil, fmt.Errorf("input for encoding is nil") } // First JSON encode the given input encodedBytes, err := EncodeJSON(in) if err != nil { return nil, err } if config == nil { config = &compressutil.CompressionConfig{ Type: compressutil.CompressionTypeGzip, GzipCompressionLevel: gzip.BestCompression, } } return compressutil.Compress(encodedBytes, config) } // DecodeJSON tries to decompress the given data. The call to decompress, fails // if the content was not compressed in the first place, which is identified by // a canary byte before the compressed data. If the data is not compressed, it // is JSON decoded directly. Otherwise the decompressed data will be JSON // decoded. func DecodeJSON(data []byte, out interface{}) error { if data == nil || len(data) == 0 { return fmt.Errorf("'data' being decoded is nil") } if out == nil { return fmt.Errorf("output parameter 'out' is nil") } // Decompress the data if it was compressed in the first place decompressedBytes, uncompressed, err := compressutil.Decompress(data) if err != nil { return errwrap.Wrapf("failed to decompress JSON: {{err}}", err) } if !uncompressed && (decompressedBytes == nil || len(decompressedBytes) == 0) { return fmt.Errorf("decompressed data being decoded is invalid") } // If the input supplied failed to contain the compression canary, it // will be notified by the compression utility. Decode the decompressed // input. if !uncompressed { data = decompressedBytes } return DecodeJSONFromReader(bytes.NewReader(data), out) } // Decodes/Unmarshals the given io.Reader pointing to a JSON, into a desired object func DecodeJSONFromReader(r io.Reader, out interface{}) error { if r == nil { return fmt.Errorf("'io.Reader' being decoded is nil") } if out == nil { return fmt.Errorf("output parameter 'out' is nil") } dec := json.NewDecoder(r) // While decoding JSON values, interpret the integer values as `json.Number`s instead of `float64`. dec.UseNumber() // Since 'out' is an interface representing a pointer, pass it to the decoder without an '&' return dec.Decode(out) } �����������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/parseutil/����������������������������0000775�0000000�0000000�00000000000�13771713062�0026202�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/parseutil/parseutil.go����������������0000664�0000000�0000000�00000007511�13771713062�0030545�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package parseutil import ( "encoding/json" "errors" "fmt" "strconv" "strings" "time" "github.com/hashicorp/errwrap" sockaddr "github.com/hashicorp/go-sockaddr" "github.com/hashicorp/vault/sdk/helper/strutil" "github.com/mitchellh/mapstructure" ) func ParseDurationSecond(in interface{}) (time.Duration, error) { var dur time.Duration jsonIn, ok := in.(json.Number) if ok { in = jsonIn.String() } switch inp := in.(type) { case nil: // return default of zero case string: if inp == "" { return dur, nil } var err error // Look for a suffix otherwise its a plain second value if strings.HasSuffix(inp, "s") || strings.HasSuffix(inp, "m") || strings.HasSuffix(inp, "h") || strings.HasSuffix(inp, "ms") { dur, err = time.ParseDuration(inp) if err != nil { return dur, err } } else { // Plain integer secs, err := strconv.ParseInt(inp, 10, 64) if err != nil { return dur, err } dur = time.Duration(secs) * time.Second } case int: dur = time.Duration(inp) * time.Second case int32: dur = time.Duration(inp) * time.Second case int64: dur = time.Duration(inp) * time.Second case uint: dur = time.Duration(inp) * time.Second case uint32: dur = time.Duration(inp) * time.Second case uint64: dur = time.Duration(inp) * time.Second case float32: dur = time.Duration(inp) * time.Second case float64: dur = time.Duration(inp) * time.Second case time.Duration: dur = inp default: return 0, errors.New("could not parse duration from input") } return dur, nil } func ParseInt(in interface{}) (int64, error) { var ret int64 jsonIn, ok := in.(json.Number) if ok { in = jsonIn.String() } switch in.(type) { case string: inp := in.(string) if inp == "" { return 0, nil } var err error left, err := strconv.ParseInt(inp, 10, 64) if err != nil { return ret, err } ret = left case int: ret = int64(in.(int)) case int32: ret = int64(in.(int32)) case int64: ret = in.(int64) case uint: ret = int64(in.(uint)) case uint32: ret = int64(in.(uint32)) case uint64: ret = int64(in.(uint64)) default: return 0, errors.New("could not parse value from input") } return ret, nil } func ParseBool(in interface{}) (bool, error) { var result bool if err := mapstructure.WeakDecode(in, &result); err != nil { return false, err } return result, nil } func ParseCommaStringSlice(in interface{}) ([]string, error) { rawString, ok := in.(string) if ok && rawString == "" { return []string{}, nil } var result []string config := &mapstructure.DecoderConfig{ Result: &result, WeaklyTypedInput: true, DecodeHook: mapstructure.StringToSliceHookFunc(","), } decoder, err := mapstructure.NewDecoder(config) if err != nil { return nil, err } if err := decoder.Decode(in); err != nil { return nil, err } return strutil.TrimStrings(result), nil } func ParseAddrs(addrs interface{}) ([]*sockaddr.SockAddrMarshaler, error) { out := make([]*sockaddr.SockAddrMarshaler, 0) stringAddrs := make([]string, 0) switch addrs.(type) { case string: stringAddrs = strutil.ParseArbitraryStringSlice(addrs.(string), ",") if len(stringAddrs) == 0 { return nil, fmt.Errorf("unable to parse addresses from %v", addrs) } case []string: stringAddrs = addrs.([]string) case []interface{}: for _, v := range addrs.([]interface{}) { stringAddr, ok := v.(string) if !ok { return nil, fmt.Errorf("error parsing %v as string", v) } stringAddrs = append(stringAddrs, stringAddr) } default: return nil, fmt.Errorf("unknown address input type %T", addrs) } for _, addr := range stringAddrs { sa, err := sockaddr.NewSockAddr(addr) if err != nil { return nil, errwrap.Wrapf(fmt.Sprintf("error parsing address %q: {{err}}", addr), err) } out = append(out, &sockaddr.SockAddrMarshaler{ SockAddr: sa, }) } return out, nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/strutil/������������������������������0000775�0000000�0000000�00000000000�13771713062�0025700�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/hashicorp/vault/sdk/helper/strutil/strutil.go��������������������0000664�0000000�0000000�00000025441�13771713062�0027743�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package strutil import ( "encoding/base64" "encoding/json" "fmt" "sort" "strings" "github.com/hashicorp/errwrap" glob "github.com/ryanuber/go-glob" ) // StrListContainsGlob looks for a string in a list of strings and allows // globs. func StrListContainsGlob(haystack []string, needle string) bool { for _, item := range haystack { if glob.Glob(item, needle) { return true } } return false } // StrListContains looks for a string in a list of strings. func StrListContains(haystack []string, needle string) bool { for _, item := range haystack { if item == needle { return true } } return false } // StrListSubset checks if a given list is a subset // of another set func StrListSubset(super, sub []string) bool { for _, item := range sub { if !StrListContains(super, item) { return false } } return true } // ParseDedupAndSortStrings parses a comma separated list of strings // into a slice of strings. The return slice will be sorted and will // not contain duplicate or empty items. func ParseDedupAndSortStrings(input string, sep string) []string { input = strings.TrimSpace(input) parsed := []string{} if input == "" { // Don't return nil return parsed } return RemoveDuplicates(strings.Split(input, sep), false) } // ParseDedupLowercaseAndSortStrings parses a comma separated list of // strings into a slice of strings. The return slice will be sorted and // will not contain duplicate or empty items. The values will be converted // to lower case. func ParseDedupLowercaseAndSortStrings(input string, sep string) []string { input = strings.TrimSpace(input) parsed := []string{} if input == "" { // Don't return nil return parsed } return RemoveDuplicates(strings.Split(input, sep), true) } // ParseKeyValues parses a comma separated list of `<key>=<value>` tuples // into a map[string]string. func ParseKeyValues(input string, out map[string]string, sep string) error { if out == nil { return fmt.Errorf("'out is nil") } keyValues := ParseDedupLowercaseAndSortStrings(input, sep) if len(keyValues) == 0 { return nil } for _, keyValue := range keyValues { shards := strings.Split(keyValue, "=") if len(shards) != 2 { return fmt.Errorf("invalid <key,value> format") } key := strings.TrimSpace(shards[0]) value := strings.TrimSpace(shards[1]) if key == "" || value == "" { return fmt.Errorf("invalid <key,value> pair: key: %q value: %q", key, value) } out[key] = value } return nil } // ParseArbitraryKeyValues parses arbitrary <key,value> tuples. The input // can be one of the following: // * JSON string // * Base64 encoded JSON string // * Comma separated list of `<key>=<value>` pairs // * Base64 encoded string containing comma separated list of // `<key>=<value>` pairs // // Input will be parsed into the output parameter, which should // be a non-nil map[string]string. func ParseArbitraryKeyValues(input string, out map[string]string, sep string) error { input = strings.TrimSpace(input) if input == "" { return nil } if out == nil { return fmt.Errorf("'out' is nil") } // Try to base64 decode the input. If successful, consider the decoded // value as input. inputBytes, err := base64.StdEncoding.DecodeString(input) if err == nil { input = string(inputBytes) } // Try to JSON unmarshal the input. If successful, consider that the // metadata was supplied as JSON input. err = json.Unmarshal([]byte(input), &out) if err != nil { // If JSON unmarshalling fails, consider that the input was // supplied as a comma separated string of 'key=value' pairs. if err = ParseKeyValues(input, out, sep); err != nil { return errwrap.Wrapf("failed to parse the input: {{err}}", err) } } // Validate the parsed input for key, value := range out { if key != "" && value == "" { return fmt.Errorf("invalid value for key %q", key) } } return nil } // ParseStringSlice parses a `sep`-separated list of strings into a // []string with surrounding whitespace removed. // // The output will always be a valid slice but may be of length zero. func ParseStringSlice(input string, sep string) []string { input = strings.TrimSpace(input) if input == "" { return []string{} } splitStr := strings.Split(input, sep) ret := make([]string, len(splitStr)) for i, val := range splitStr { ret[i] = strings.TrimSpace(val) } return ret } // ParseArbitraryStringSlice parses arbitrary string slice. The input // can be one of the following: // * JSON string // * Base64 encoded JSON string // * `sep` separated list of values // * Base64-encoded string containing a `sep` separated list of values // // Note that the separator is ignored if the input is found to already be in a // structured format (e.g., JSON) // // The output will always be a valid slice but may be of length zero. func ParseArbitraryStringSlice(input string, sep string) []string { input = strings.TrimSpace(input) if input == "" { return []string{} } // Try to base64 decode the input. If successful, consider the decoded // value as input. inputBytes, err := base64.StdEncoding.DecodeString(input) if err == nil { input = string(inputBytes) } ret := []string{} // Try to JSON unmarshal the input. If successful, consider that the // metadata was supplied as JSON input. err = json.Unmarshal([]byte(input), &ret) if err != nil { // If JSON unmarshalling fails, consider that the input was // supplied as a separated string of values. return ParseStringSlice(input, sep) } if ret == nil { return []string{} } return ret } // TrimStrings takes a slice of strings and returns a slice of strings // with trimmed spaces func TrimStrings(items []string) []string { ret := make([]string, len(items)) for i, item := range items { ret[i] = strings.TrimSpace(item) } return ret } // RemoveDuplicates removes duplicate and empty elements from a slice of // strings. This also may convert the items in the slice to lower case and // returns a sorted slice. func RemoveDuplicates(items []string, lowercase bool) []string { itemsMap := map[string]bool{} for _, item := range items { item = strings.TrimSpace(item) if lowercase { item = strings.ToLower(item) } if item == "" { continue } itemsMap[item] = true } items = make([]string, 0, len(itemsMap)) for item := range itemsMap { items = append(items, item) } sort.Strings(items) return items } // RemoveDuplicatesStable removes duplicate and empty elements from a slice of // strings, preserving order (and case) of the original slice. // In all cases, strings are compared after trimming whitespace // If caseInsensitive, strings will be compared after ToLower() func RemoveDuplicatesStable(items []string, caseInsensitive bool) []string { itemsMap := make(map[string]bool, len(items)) deduplicated := make([]string, 0, len(items)) for _, item := range items { key := strings.TrimSpace(item) if caseInsensitive { key = strings.ToLower(key) } if key == "" || itemsMap[key] { continue } itemsMap[key] = true deduplicated = append(deduplicated, item) } return deduplicated } // RemoveEmpty removes empty elements from a slice of // strings func RemoveEmpty(items []string) []string { if len(items) == 0 { return items } itemsSlice := make([]string, 0, len(items)) for _, item := range items { if item == "" { continue } itemsSlice = append(itemsSlice, item) } return itemsSlice } // EquivalentSlices checks whether the given string sets are equivalent, as in, // they contain the same values. func EquivalentSlices(a, b []string) bool { if a == nil && b == nil { return true } if a == nil || b == nil { return false } // First we'll build maps to ensure unique values mapA := map[string]bool{} mapB := map[string]bool{} for _, keyA := range a { mapA[keyA] = true } for _, keyB := range b { mapB[keyB] = true } // Now we'll build our checking slices var sortedA, sortedB []string for keyA := range mapA { sortedA = append(sortedA, keyA) } for keyB := range mapB { sortedB = append(sortedB, keyB) } sort.Strings(sortedA) sort.Strings(sortedB) // Finally, compare if len(sortedA) != len(sortedB) { return false } for i := range sortedA { if sortedA[i] != sortedB[i] { return false } } return true } // EqualStringMaps tests whether two map[string]string objects are equal. // Equal means both maps have the same sets of keys and values. This function // is 6-10x faster than a call to reflect.DeepEqual(). func EqualStringMaps(a, b map[string]string) bool { if len(a) != len(b) { return false } for k := range a { v, ok := b[k] if !ok || a[k] != v { return false } } return true } // StrListDelete removes the first occurrence of the given item from the slice // of strings if the item exists. func StrListDelete(s []string, d string) []string { if s == nil { return s } for index, element := range s { if element == d { return append(s[:index], s[index+1:]...) } } return s } // GlobbedStringsMatch compares item to val with support for a leading and/or // trailing wildcard '*' in item. func GlobbedStringsMatch(item, val string) bool { if len(item) < 2 { return val == item } hasPrefix := strings.HasPrefix(item, "*") hasSuffix := strings.HasSuffix(item, "*") if hasPrefix && hasSuffix { return strings.Contains(val, item[1:len(item)-1]) } else if hasPrefix { return strings.HasSuffix(val, item[1:]) } else if hasSuffix { return strings.HasPrefix(val, item[:len(item)-1]) } return val == item } // AppendIfMissing adds a string to a slice if the given string is not present func AppendIfMissing(slice []string, i string) []string { if StrListContains(slice, i) { return slice } return append(slice, i) } // MergeSlices adds an arbitrary number of slices together, uniquely func MergeSlices(args ...[]string) []string { all := map[string]struct{}{} for _, slice := range args { for _, v := range slice { all[v] = struct{}{} } } result := make([]string, 0, len(all)) for k := range all { result = append(result, k) } sort.Strings(result) return result } // Difference returns the set difference (A - B) of the two given slices. The // result will also remove any duplicated values in set A regardless of whether // that matches any values in set B. func Difference(a, b []string, lowercase bool) []string { if len(a) == 0 { return a } if len(b) == 0 { if !lowercase { return a } newA := make([]string, len(a)) for i, v := range a { newA[i] = strings.ToLower(v) } return newA } a = RemoveDuplicates(a, lowercase) b = RemoveDuplicates(b, lowercase) itemsMap := map[string]bool{} for _, aVal := range a { itemsMap[aVal] = true } // Perform difference calculation for _, bVal := range b { if _, ok := itemsMap[bVal]; ok { itemsMap[bVal] = false } } items := []string{} for item, exists := range itemsMap { if exists { items = append(items, item) } } sort.Strings(items) return items } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/�����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021212�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/��������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024020�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/LICENSE�������������������������������0000664�0000000�0000000�00000026135�13771713062�0025034�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/���������������������������������0000775�0000000�0000000�00000000000�13771713062�0024750�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Config.go������������������������0000664�0000000�0000000�00000002245�13771713062�0026507�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core import "time" type Config struct { Scheme string Endpoint string Timeout time.Duration } // NewConfig returns a pointer of Config // // scheme only accepts http or https // // endpoint is the host to access, the connection could not be created if it's error func NewConfig() *Config { return &Config{SchemeHttps, "www.jdcloud-api.com", 10 * time.Second} } func (c *Config) SetScheme(scheme string) { c.Scheme = scheme } func (c *Config) SetEndpoint(endpoint string) { c.Endpoint = endpoint } func (c *Config) SetTimeout(timeout time.Duration) { c.Timeout = timeout }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Const.go�������������������������0000664�0000000�0000000�00000001641�13771713062�0026367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core const ( SchemeHttp = "http" SchemeHttps = "https" MethodGet = "GET" MethodPut = "PUT" MethodPost = "POST" MethodDelete = "DELETE" MethodPatch = "PATCH" MethodHead = "HEAD" HeaderJcloudPrefix = "x-jcloud" HeaderJdcloudPrefix = "x-jdcloud" HeaderJdcloudRequestId = "x-jdcloud-request-id" ) �����������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Credential.go��������������������0000664�0000000�0000000�00000001563�13771713062�0027356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core // Credential is used to sign the request, // AccessKey and SecretKey could be found in JDCloud console type Credential struct { AccessKey string SecretKey string } func NewCredentials(accessKey, secretKey string) *Credential { return &Credential{accessKey, secretKey} } ���������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Doc.go���������������������������0000664�0000000�0000000�00000000263�13771713062�0026005�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// This core package providers API and clients base struct for services, // and also some infrastructure function, such as signer, send http(s) // request and so on. package core ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ErrorResponse.go�����������������0000664�0000000�0000000�00000001335�13771713062�0030111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core type ErrorResponse struct { Code int `json:"code"` Status string `json:"status"` Message string `json:"message"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudClient.go�����������������0000664�0000000�0000000�00000006605�13771713062�0030031�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core import ( "net/http" "strings" "time" "fmt" "encoding/json" "encoding/base64" ) // JDCloudClient is the base struct of service clients type JDCloudClient struct { Credential Credential Config Config ServiceName string Revision string Logger Logger } type SignFunc func(*http.Request) error // Send send the request and return the response to the client. // Parameter request accepts concrete request object which follow RequestInterface. func (c JDCloudClient) Send(request RequestInterface, serviceName string) ([]byte, error) { method := request.GetMethod() builder := GetParameterBuilder(method, c.Logger) jsonReq, _ := json.Marshal(request) encodedUrl, err := builder.BuildURL(request.GetURL(), jsonReq) if err != nil { return nil, err } reqUrl := fmt.Sprintf("%s://%s/%s%s", c.Config.Scheme, c.Config.Endpoint, request.GetVersion(), encodedUrl) body, err := builder.BuildBody(jsonReq) if err != nil { return nil, err } sign := func(r *http.Request) error { regionId := request.GetRegionId() // some request has no region parameter, so give a value to it, // then API gateway can calculate sign successfully. if regionId == "" { regionId = "jdcloud-api" } signer := NewSigner(c.Credential, c.Logger) _, err := signer.Sign(r, strings.NewReader(body), serviceName, regionId, time.Now()) return err } return c.doSend(method, reqUrl, body, request.GetHeaders(), c.Config.Timeout, sign) } func (c JDCloudClient) doSend(method, url, data string, header map[string]string, timeout time.Duration, sign SignFunc) ([]byte, error) { client := &http.Client{Timeout: timeout} req, err := http.NewRequest(method, url, strings.NewReader(data)) if err != nil { c.Logger.Log(LogFatal, err.Error()) return nil, err } c.setHeader(req, header) err = sign(req) if err != nil { return nil, err } resp, err := client.Do(req) if err != nil { c.Logger.Log(LogError, err.Error()) return nil, err } processor := GetResponseProcessor(req.Method) result, err := processor.Process(resp) if err != nil { c.Logger.Log(LogError, err.Error()) return nil, err } return result, nil } func (c JDCloudClient) setHeader(req *http.Request, header map[string]string) { req.Header.Set("Content-Type", "application/json") req.Header.Set("User-Agent", fmt.Sprintf("JdcloudSdkGo/%s %s/%s", Version, c.ServiceName, c.Revision)) base64Headers := []string{HeaderJdcloudPrefix + "-pin", HeaderJdcloudPrefix + "-erp", HeaderJdcloudPrefix + "-security-token", HeaderJcloudPrefix + "-pin", HeaderJcloudPrefix + "-erp", HeaderJcloudPrefix + "-security-token"} for k, v := range header { if includes(base64Headers, strings.ToLower(k)) { v = base64.StdEncoding.EncodeToString([]byte(v)) } req.Header.Set(k, v) } for k, v := range req.Header { c.Logger.Log(LogInfo, k, v) } } ���������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/JdcloudRequest.go����������������0000664�0000000�0000000�00000002700�13771713062�0030233�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core type RequestInterface interface { GetURL() string GetMethod() string GetVersion() string GetHeaders() map[string]string GetRegionId() string } // JDCloudRequest is the base struct of service requests type JDCloudRequest struct { URL string // resource url, i.e. /regions/${regionId}/elasticIps/${elasticIpId} Method string Header map[string]string Version string } func (r JDCloudRequest) GetURL() string { return r.URL } func (r JDCloudRequest) GetMethod() string { return r.Method } func (r JDCloudRequest) GetVersion() string { return r.Version } func (r JDCloudRequest) GetHeaders() map[string]string { return r.Header } // AddHeader only adds pin or erp, they will be encoded to base64 code func (r *JDCloudRequest) AddHeader(key, value string) { if r.Header == nil { r.Header = make(map[string]string) } r.Header[key] = value } ����������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Logger.go������������������������0000664�0000000�0000000�00000001752�13771713062�0026523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core import "fmt" const ( LogFatal = iota LogError LogWarn LogInfo ) type Logger interface { Log(level int, message... interface{}) } type DefaultLogger struct { Level int } func NewDefaultLogger(level int) *DefaultLogger { return &DefaultLogger{level} } func (logger DefaultLogger) Log (level int, message... interface{}) { if level <= logger.Level { fmt.Println(message...) } } ����������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ParameterBuilder.go��������������0000664�0000000�0000000�00000012414�13771713062�0030530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core import ( "encoding/json" "fmt" "regexp" "strings" "errors" "reflect" urllib "net/url" ) var baseRequestFields []string func init() { req := JDCloudRequest{} reqType := reflect.TypeOf(req) for i := 0; i < reqType.NumField(); i++ { baseRequestFields = append(baseRequestFields, reqType.Field(i).Name) } } type ParameterBuilder interface { BuildURL(url string, paramJson []byte) (string, error) BuildBody(paramJson []byte) (string, error) } func GetParameterBuilder(method string, logger Logger) ParameterBuilder { if method == MethodGet || method == MethodDelete || method == MethodHead { return &WithoutBodyBuilder{logger} } else { return &WithBodyBuilder{logger} } } // WithBodyBuilder supports PUT/POST/PATCH methods. // It has path and body (json) parameters, but no query parameters. type WithBodyBuilder struct { Logger Logger } func (b WithBodyBuilder) BuildURL(url string, paramJson []byte) (string, error) { paramMap := make(map[string]interface{}) err := json.Unmarshal(paramJson, &paramMap) if err != nil { b.Logger.Log(LogError, err.Error()) return "", err } replacedUrl, err := replaceUrlWithPathParam(url, paramMap) if err != nil { b.Logger.Log(LogError, err.Error()) return "", err } encodedUrl, err := encodeUrl(replacedUrl, nil) if err != nil { return "", err } b.Logger.Log(LogInfo, "URL=" + encodedUrl) return encodedUrl, nil } func (b WithBodyBuilder) BuildBody(paramJson []byte) (string, error) { paramMap := make(map[string]interface{}) err := json.Unmarshal(paramJson, &paramMap) if err != nil { b.Logger.Log(LogError, err.Error()) return "", err } // remove base request fields for k := range paramMap { if includes(baseRequestFields, k) { delete(paramMap, k) } } body, _ := json.Marshal(paramMap) b.Logger.Log(LogInfo, "Body=", string(body)) return string(body), nil } // WithoutBodyBuilder supports GET/DELETE methods. // It only builds path and query parameters. type WithoutBodyBuilder struct { Logger Logger } func (b WithoutBodyBuilder) BuildURL(url string, paramJson []byte) (string, error) { paramMap := make(map[string]interface{}) err := json.Unmarshal(paramJson, &paramMap) if err != nil { b.Logger.Log(LogError, err.Error()) return "", err } resultUrl, err := replaceUrlWithPathParam(url, paramMap) if err != nil { b.Logger.Log(LogError, err.Error()) return "", err } queryParams := buildQueryParams(paramMap, url) encodedUrl, err := encodeUrl(resultUrl, queryParams) if err != nil { return "", err } b.Logger.Log(LogInfo, string(paramJson)) b.Logger.Log(LogInfo, "URL=" + encodedUrl) return encodedUrl, nil } func (b WithoutBodyBuilder) BuildBody(paramJson []byte) (string, error) { return "", nil } func replaceUrlWithPathParam(url string, paramMap map[string]interface{}) (string, error) { r, _ := regexp.Compile("{[a-zA-Z0-9-_]+}") matches := r.FindAllString(url, -1) for _, match := range matches { field := strings.TrimLeft(match, "{") field = strings.TrimRight(field, "}") value, ok := paramMap[field] if !ok { return "", errors.New("Can not find path parameter: " + field) } valueStr := fmt.Sprintf("%v", value) url = strings.Replace(url, match, valueStr, -1) } return url, nil } func buildQueryParams(paramMap map[string]interface{}, url string) urllib.Values { values := urllib.Values{} accessMap(paramMap, url, "", values) return values } func accessMap(paramMap map[string]interface{}, url, prefix string, values urllib.Values) { for k, v := range paramMap { // exclude fields of JDCloudRequest class and path parameters if shouldIgnoreField(url, k) { continue } switch e := v.(type) { case []interface{}: for i, n := range e { switch f := n.(type) { case map[string]interface{}: subPrefix := fmt.Sprintf("%s.%d.", k, i+1) accessMap(f, url, subPrefix, values) case nil: default: values.Set(fmt.Sprintf("%s%s.%d", prefix, k, i+1), fmt.Sprintf("%s", n)) } } case nil: default: values.Set(fmt.Sprintf("%s%s", prefix, k), fmt.Sprintf("%v", v)) } } } func shouldIgnoreField(url, field string) bool { flag := "{" + field + "}" if strings.Contains(url, flag) { return true } if includes(baseRequestFields, field) { return true } return false } func encodeUrl(requestUrl string, values urllib.Values) (string, error) { urlObj, err := urllib.Parse(requestUrl) if err != nil { return "", err } urlObj.RawPath = EscapePath(urlObj.Path, false) uri := urlObj.EscapedPath() if values != nil { queryParam := values.Encode() // RFC 3986, ' ' should be encoded to 20%, '+' to 2B% queryParam = strings.Replace(queryParam, "+", "%20", -1) if queryParam != "" { uri += "?" + queryParam } } return uri, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/ResponseProcessor.go�������������0000664�0000000�0000000�00000001573�13771713062�0031003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package core import ( "net/http" "io/ioutil" "errors" "fmt" ) type ResponseProcessor interface { Process(response *http.Response) ([]byte, error) } func GetResponseProcessor(method string) ResponseProcessor { if method == MethodHead { return &WithoutBodyResponseProcessor{} } else { return &WithBodyResponseProcessor{} } } type WithBodyResponseProcessor struct { } func (p WithBodyResponseProcessor) Process(response *http.Response) ([]byte, error) { defer response.Body.Close() return ioutil.ReadAll(response.Body) } type WithoutBodyResponseProcessor struct { } func (p WithoutBodyResponseProcessor) Process(response *http.Response) ([]byte, error) { requestId := response.Header.Get(HeaderJdcloudRequestId) if requestId != "" { return []byte(fmt.Sprintf(`{"requestId":"%s"}`, requestId)), nil } return nil, errors.New("can not get requestId in HEAD response") }�������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Signer.go������������������������0000664�0000000�0000000�00000022114�13771713062�0026526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // This signer is modified from AWS V4 signer algorithm. package core import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "fmt" "io" "net/http" "net/url" "sort" "strings" "time" "bytes" "github.com/gofrs/uuid" ) const ( authHeaderPrefix = "JDCLOUD2-HMAC-SHA256" timeFormat = "20060102T150405Z" shortTimeFormat = "20060102" // emptyStringSHA256 is a SHA256 of an empty string emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` ) var ignoredHeaders = []string {"Authorization", "User-Agent", "X-Jdcloud-Request-Id"} var noEscape [256]bool func init() { for i := 0; i < len(noEscape); i++ { // expects every character except these to be escaped noEscape[i] = (i >= 'A' && i <= 'Z') || (i >= 'a' && i <= 'z') || (i >= '0' && i <= '9') || i == '-' || i == '.' || i == '_' || i == '~' } } type Signer struct { Credentials Credential Logger Logger } func NewSigner(credsProvider Credential, logger Logger) *Signer { return &Signer{ Credentials: credsProvider, Logger: logger, } } type signingCtx struct { ServiceName string Region string Request *http.Request Body io.ReadSeeker Query url.Values Time time.Time ExpireTime time.Duration SignedHeaderVals http.Header credValues Credential formattedTime string formattedShortTime string bodyDigest string signedHeaders string canonicalHeaders string canonicalString string credentialString string stringToSign string signature string authorization string } // Sign signs the request by using AWS V4 signer algorithm, and adds Authorization header func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, signTime time.Time) (http.Header, error) { return v4.signWithBody(r, body, service, region, 0, signTime) } func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { ctx := &signingCtx{ Request: r, Body: body, Query: r.URL.Query(), Time: signTime, ExpireTime: exp, ServiceName: service, Region: region, } for key := range ctx.Query { sort.Strings(ctx.Query[key]) } if ctx.isRequestSigned() { ctx.Time = time.Now() } ctx.credValues = v4.Credentials ctx.build() v4.logSigningInfo(ctx) return ctx.SignedHeaderVals, nil } const logSignInfoMsg = `DEBUG: Request Signature: ---[ CANONICAL STRING ]----------------------------- %s ---[ STRING TO SIGN ]-------------------------------- %s%s -----------------------------------------------------` func (v4 *Signer) logSigningInfo(ctx *signingCtx) { signedURLMsg := "" msg := fmt.Sprintf(logSignInfoMsg, ctx.canonicalString, ctx.stringToSign, signedURLMsg) v4.Logger.Log(LogInfo, msg) } func (ctx *signingCtx) build() { ctx.buildTime() // no depends ctx.buildNonce() // no depends ctx.buildCredentialString() // no depends ctx.buildBodyDigest() unsignedHeaders := ctx.Request.Header ctx.buildCanonicalHeaders(unsignedHeaders) ctx.buildCanonicalString() // depends on canon headers / signed headers ctx.buildStringToSign() // depends on canon string ctx.buildSignature() // depends on string to sign parts := []string{ authHeaderPrefix + " Credential=" + ctx.credValues.AccessKey + "/" + ctx.credentialString, "SignedHeaders=" + ctx.signedHeaders, "Signature=" + ctx.signature, } ctx.Request.Header.Set("Authorization", strings.Join(parts, ", ")) } func (ctx *signingCtx) buildTime() { ctx.formattedTime = ctx.Time.UTC().Format(timeFormat) ctx.formattedShortTime = ctx.Time.UTC().Format(shortTimeFormat) ctx.Request.Header.Set("x-jdcloud-date", ctx.formattedTime) } func (ctx *signingCtx) buildNonce() { nonce, _ := uuid.NewV4() ctx.Request.Header.Set("x-jdcloud-nonce", nonce.String()) } func (ctx *signingCtx) buildCredentialString() { ctx.credentialString = strings.Join([]string{ ctx.formattedShortTime, ctx.Region, ctx.ServiceName, "jdcloud2_request", }, "/") } func (ctx *signingCtx) buildCanonicalHeaders(header http.Header) { var headers []string headers = append(headers, "host") for k, v := range header { canonicalKey := http.CanonicalHeaderKey(k) if shouldIgnore(canonicalKey, ignoredHeaders) { continue // ignored header } if ctx.SignedHeaderVals == nil { ctx.SignedHeaderVals = make(http.Header) } lowerCaseKey := strings.ToLower(k) if _, ok := ctx.SignedHeaderVals[lowerCaseKey]; ok { // include additional values ctx.SignedHeaderVals[lowerCaseKey] = append(ctx.SignedHeaderVals[lowerCaseKey], v...) continue } headers = append(headers, lowerCaseKey) ctx.SignedHeaderVals[lowerCaseKey] = v } sort.Strings(headers) ctx.signedHeaders = strings.Join(headers, ";") headerValues := make([]string, len(headers)) for i, k := range headers { if k == "host" { if ctx.Request.Host != "" { headerValues[i] = "host:" + ctx.Request.Host } else { headerValues[i] = "host:" + ctx.Request.URL.Host } } else { headerValues[i] = k + ":" + strings.Join(ctx.SignedHeaderVals[k], ",") } } stripExcessSpaces(headerValues) ctx.canonicalHeaders = strings.Join(headerValues, "\n") } func (ctx *signingCtx) buildCanonicalString() { uri := getURIPath(ctx.Request.URL) ctx.canonicalString = strings.Join([]string{ ctx.Request.Method, uri, ctx.Request.URL.RawQuery, ctx.canonicalHeaders + "\n", ctx.signedHeaders, ctx.bodyDigest, }, "\n") } func (ctx *signingCtx) buildStringToSign() { ctx.stringToSign = strings.Join([]string{ authHeaderPrefix, ctx.formattedTime, ctx.credentialString, hex.EncodeToString(makeSha256([]byte(ctx.canonicalString))), }, "\n") } func (ctx *signingCtx) buildSignature() { secret := ctx.credValues.SecretKey date := makeHmac([]byte("JDCLOUD2"+secret), []byte(ctx.formattedShortTime)) region := makeHmac(date, []byte(ctx.Region)) service := makeHmac(region, []byte(ctx.ServiceName)) credentials := makeHmac(service, []byte("jdcloud2_request")) signature := makeHmac(credentials, []byte(ctx.stringToSign)) ctx.signature = hex.EncodeToString(signature) } func (ctx *signingCtx) buildBodyDigest() { var hash string if ctx.Body == nil { hash = emptyStringSHA256 } else { hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) } ctx.bodyDigest = hash } // isRequestSigned returns if the request is currently signed or presigned func (ctx *signingCtx) isRequestSigned() bool { if ctx.Request.Header.Get("Authorization") != "" { return true } return false } func makeHmac(key []byte, data []byte) []byte { hash := hmac.New(sha256.New, key) hash.Write(data) return hash.Sum(nil) } func makeSha256(data []byte) []byte { hash := sha256.New() hash.Write(data) return hash.Sum(nil) } func makeSha256Reader(reader io.ReadSeeker) []byte { hash := sha256.New() start, _ := reader.Seek(0, 1) defer reader.Seek(start, 0) io.Copy(hash, reader) return hash.Sum(nil) } const doubleSpace = " " // stripExcessSpaces will rewrite the passed in slice's string values to not // contain multiple side-by-side spaces. func stripExcessSpaces(vals []string) { var j, k, l, m, spaces int for i, str := range vals { // Trim trailing spaces for j = len(str) - 1; j >= 0 && str[j] == ' '; j-- { } // Trim leading spaces for k = 0; k < j && str[k] == ' '; k++ { } str = str[k : j+1] // Strip multiple spaces. j = strings.Index(str, doubleSpace) if j < 0 { vals[i] = str continue } buf := []byte(str) for k, m, l = j, j, len(buf); k < l; k++ { if buf[k] == ' ' { if spaces == 0 { // First space. buf[m] = buf[k] m++ } spaces++ } else { // End of multiple spaces. spaces = 0 buf[m] = buf[k] m++ } } vals[i] = string(buf[:m]) } } func getURIPath(u *url.URL) string { var uri string if len(u.Opaque) > 0 { uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") } else { uri = u.EscapedPath() } if len(uri) == 0 { uri = "/" } return uri } func shouldIgnore(header string, ignoreHeaders []string) bool { for _, v := range ignoreHeaders { if v == header { return true } } return false } // EscapePath escapes part of a URL path func EscapePath(path string, encodeSep bool) string { var buf bytes.Buffer for i := 0; i < len(path); i++ { c := path[i] if noEscape[c] || (c == '/' && !encodeSep) { buf.WriteByte(c) } else { fmt.Fprintf(&buf, "%%%02X", c) } } return buf.String() } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Utils.go�������������������������0000664�0000000�0000000�00000000226�13771713062�0026377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package core func includes(fields []string, field string) bool { for _, v := range fields { if v == field { return true } } return false }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/core/Version.go�����������������������0000664�0000000�0000000�00000001170�13771713062�0026723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018-2025 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package core const Version = "1.1.3" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/�����������������������������0000775�0000000�0000000�00000000000�13771713062�0025643�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/����������������������0000775�0000000�0000000�00000000000�13771713062�0027074�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/���������������0000775�0000000�0000000�00000000000�13771713062�0030357�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/Charge.go������0000664�0000000�0000000�00000003507�13771713062�0032104�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Charge struct { /* 支付模式,取值为:prepaid_by_duration,postpaid_by_usage或postpaid_by_duration,prepaid_by_duration表示预付费,postpaid_by_usage表示按用量后付费,postpaid_by_duration表示按配置后付费,默认为postpaid_by_duration (Optional) */ ChargeMode string `json:"chargeMode"` /* 费用支付状态,取值为:normal、overdue、arrear,normal表示正常,overdue表示已到期,arrear表示欠费 (Optional) */ ChargeStatus string `json:"chargeStatus"` /* 计费开始时间,遵循ISO8601标准,使用UTC时间,格式为:YYYY-MM-DDTHH:mm:ssZ (Optional) */ ChargeStartTime string `json:"chargeStartTime"` /* 过期时间,预付费资源的到期时间,遵循ISO8601标准,使用UTC时间,格式为:YYYY-MM-DDTHH:mm:ssZ,后付费资源此字段内容为空 (Optional) */ ChargeExpiredTime string `json:"chargeExpiredTime"` /* 预期释放时间,资源的预期释放时间,预付费/后付费资源均有此值,遵循ISO8601标准,使用UTC时间,格式为:YYYY-MM-DDTHH:mm:ssZ (Optional) */ ChargeRetireTime string `json:"chargeRetireTime"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models/ChargeSpec.go��0000664�0000000�0000000�00000002640�13771713062�0032714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ChargeSpec struct { /* 计费模式,取值为:prepaid_by_duration,postpaid_by_usage或postpaid_by_duration,prepaid_by_duration表示预付费,postpaid_by_usage表示按用量后付费,postpaid_by_duration表示按配置后付费,默认为postpaid_by_duration (Optional) */ ChargeMode *string `json:"chargeMode"` /* 预付费计费单位,当chargeMode为prepaid_by_duration时有效,取值为:month、year,默认为month (Optional) */ ChargeUnit *string `json:"chargeUnit"` /* 预付费计费时长,当chargeMode取值为prepaid_by_duration时有效。当chargeUnit为month时取值为:1~9,当chargeUnit为year时取值为:1、2、3 (Optional) */ ChargeDuration *int `json:"chargeDuration"` } ������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/����������������������0000775�0000000�0000000�00000000000�13771713062�0027133�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/���������������0000775�0000000�0000000�00000000000�13771713062�0030416�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Filter.go������0000664�0000000�0000000�00000001651�13771713062�0032175�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Filter struct { /* 过滤条件的名称 */ Name string `json:"name"` /* 过滤条件的操作符,默认eq (Optional) */ Operator *string `json:"operator"` /* 过滤条件的值 */ Values []string `json:"values"` } ���������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Quota.go�������0000664�0000000�0000000�00000001605�13771713062�0032040�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Quota struct { /* 配额项的名称 (Optional) */ Name string `json:"name"` /* 配额 (Optional) */ Max int `json:"max"` /* 已使用的数目 (Optional) */ Used int `json:"used"` } ���������������������������������������������������������������������������������������������������������������������������SimpleResponses.go����������������������������������������������������������������������������������0000664�0000000�0000000�00000001427�13771713062�0034025�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models�����������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type SimpleResponses struct { /* Request ID (Optional) */ RequestId string `json:"requestId"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/Sort.go��������0000664�0000000�0000000�00000001543�13771713062�0031677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Sort struct { /* 排序条件的名称 (Optional) */ Name *string `json:"name"` /* 排序条件的方向 (Optional) */ Direction *string `json:"direction"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/common/models/TagFilter.go���0000664�0000000�0000000�00000001456�13771713062�0032634�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type TagFilter struct { /* Tag键 */ Key string `json:"key"` /* Tag值 */ Values []string `json:"values"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/������������������������0000775�0000000�0000000�00000000000�13771713062�0026575�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/�����������������0000775�0000000�0000000�00000000000�13771713062�0030060�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Disk.go����������0000664�0000000�0000000�00000005073�13771713062�0031306�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" type Disk struct { /* 云硬盘ID (Optional) */ DiskId string `json:"diskId"` /* 云硬盘所属AZ (Optional) */ Az string `json:"az"` /* 云硬盘名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ Name string `json:"name"` /* 云硬盘描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description string `json:"description"` /* 云硬盘类型,取值为 ssd,premium-hdd,ssd.gp1,ssd.io1,hdd.std1 (Optional) */ DiskType string `json:"diskType"` /* 云硬盘大小,单位为 GiB (Optional) */ DiskSizeGB int `json:"diskSizeGB"` /* 该云硬盘实际应用的iops值 (Optional) */ Iops int `json:"iops"` /* 该云硬盘实际应用的吞吐量的数值 (Optional) */ Throughput int `json:"throughput"` /* 云硬盘状态,取值为 creating、available、in-use、extending、restoring、deleting、deleted、error_create、error_delete、error_restore、error_extend 之一 (Optional) */ Status string `json:"status"` /* 挂载信息 (Optional) */ Attachments []DiskAttachment `json:"attachments"` /* 创建该云硬盘的快照ID (Optional) */ SnapshotId string `json:"snapshotId"` /* 云盘是否支持多挂载 (Optional) */ MultiAttachable bool `json:"multiAttachable"` /* 云盘是否为加密盘 (Optional) */ Encrypted bool `json:"encrypted"` /* 云盘是否被暂停(IOPS限制为极低) (Optional) */ Enable bool `json:"enable"` /* 创建云硬盘时间 (Optional) */ CreateTime string `json:"createTime"` /* 云硬盘计费配置信息 (Optional) */ Charge charge.Charge `json:"charge"` /* Tag信息 (Optional) */ Tags []Tag `json:"tags"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskAttachment.go0000664�0000000�0000000�00000002355�13771713062�0033317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type DiskAttachment struct { /* 挂载ID (Optional) */ AttachmentId string `json:"attachmentId"` /* 云硬盘ID (Optional) */ DiskId string `json:"diskId"` /* 挂载实例的类型,取值为 vm、nc (Optional) */ InstanceType string `json:"instanceType"` /* 挂载实例的ID (Optional) */ InstanceId string `json:"instanceId"` /* 挂载状态,取值为 "attaching", "attached", "detaching", "detached" (Optional) */ Status string `json:"status"` /* 挂载时间 (Optional) */ AttachTime string `json:"attachTime"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/DiskSpec.go������0000664�0000000�0000000�00000003444�13771713062�0032121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" type DiskSpec struct { /* 云硬盘所属的可用区 */ Az string `json:"az"` /* 云硬盘名称 */ Name string `json:"name"` /* 云硬盘描述 (Optional) */ Description *string `json:"description"` /* 云硬盘类型,取值为ssd、premium-hdd、ssd.gp1、ssd.io1、hdd.std1之一 */ DiskType string `json:"diskType"` /* 云硬盘大小,单位为 GiB,ssd 类型取值范围[20,1000]GB,步长为10G,premium-hdd 类型取值范围[20,3000]GB,步长为10G */ DiskSizeGB int `json:"diskSizeGB"` /* 用于创建云硬盘的快照ID (Optional) */ SnapshotId *string `json:"snapshotId"` /* 计费配置;如不指定,默认计费类型是后付费-按使用时常付费 (Optional) */ Charge *charge.ChargeSpec `json:"charge"` /* 云硬盘是否支持一盘多主机挂载,默认为false(不支持) (Optional) */ MultiAttachable *bool `json:"multiAttachable"` /* 云硬盘是否加密,默认为false(不加密) (Optional) */ Encrypt *bool `json:"encrypt"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DiskSpecification.go��������������������������������������������������������������������������������0000664�0000000�0000000�00000003222�13771713062�0033722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models�������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type DiskSpecification struct { /* 云硬盘类型 (Optional) */ DiskType string `json:"diskType"` /* 支持的最小尺寸,单位为 GiB (Optional) */ MinSizeGB int `json:"minSizeGB"` /* 支持的最大尺寸,单位为 GiB (Optional) */ MaxSizeGB int `json:"maxSizeGB"` /* 步长尺寸,单位为 GiB (Optional) */ StepSizeGB int `json:"stepSizeGB"` /* 描述信息 (Optional) */ Description string `json:"description"` /* 默认的iops数量(基础iops数量) (Optional) */ DefaultIOPS int `json:"defaultIOPS"` /* iops步长增量 (Optional) */ StepIOPS float32 `json:"stepIOPS"` /* 最大iops数量 (Optional) */ MaxIOPS int `json:"maxIOPS"` /* 默认的吞吐量 (Optional) */ DefaultThroughput int `json:"defaultThroughput"` /* 吞吐量步长增量 (Optional) */ StepThroughput float32 `json:"stepThroughput"` /* 最大吞吐量 (Optional) */ MaxThroughput int `json:"maxThroughput"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Quota.go���������0000664�0000000�0000000�00000001502�13771713062�0031476�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Quota struct { /* 配额 (Optional) */ Limit int `json:"limit"` /* 已使用的数目 (Optional) */ Used int `json:"used"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/ShareInfo.go�����0000664�0000000�0000000�00000001554�13771713062�0032272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ShareInfo struct { /* 被共享快照的用户的pin (Optional) */ ShareTo string `json:"shareTo"` /* 共享时间 (Optional) */ ShareTime string `json:"shareTime"` } ����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Snapshot.go������0000664�0000000�0000000�00000003417�13771713062�0032213�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Snapshot struct { /* 云硬盘快照ID (Optional) */ SnapshotId string `json:"snapshotId"` /* 快照来源 可以有self,others两种来源 (Optional) */ SnapshotSource string `json:"snapshotSource"` /* 创建快照的云硬盘ID(snapshotSource为others时不展示) (Optional) */ DiskId string `json:"diskId"` /* 快照大小,单位为GiB (Optional) */ SnapshotSizeGB int `json:"snapshotSizeGB"` /* 快照关联的所有镜像ID(snapshotSource为others时不展示) (Optional) */ Images []string `json:"images"` /* 快照名称 (Optional) */ Name string `json:"name"` /* 快照描述 (Optional) */ Description string `json:"description"` /* 快照状态,取值为 creating、available、in-use、deleting、error_create、error_delete 之一 (Optional) */ Status string `json:"status"` /* 创建时间 (Optional) */ CreateTime string `json:"createTime"` /* 共享信息 (Optional) */ SharInfo []ShareInfo `json:"sharInfo"` /* 快照是否为加密盘的快照 (Optional) */ Encrypted bool `json:"encrypted"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/SnapshotSpec.go��0000664�0000000�0000000�00000001636�13771713062�0033027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type SnapshotSpec struct { /* 快照名称 */ Name string `json:"name"` /* 快照描述 (Optional) */ Description *string `json:"description"` /* 用于创建快照的云盘ID */ DiskId string `json:"diskId"` } ��������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Soldout.go�������0000664�0000000�0000000�00000001725�13771713062�0032045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Soldout struct { /* 云硬盘所属的可用区 */ AzName string `json:"azName"` /* 云硬盘类型,取值为ssd、premium-hdd、ssd.gp1、ssd.io1、hdd.std1之一 */ MediaType string `json:"mediaType"` /* 是否售罄 */ IsSoldOut bool `json:"isSoldOut"` } �������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/Tag.go�����������0000664�0000000�0000000�00000001470�13771713062�0031124�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Tag struct { /* Tag键 (Optional) */ Key string `json:"key"` /* Tag值 (Optional) */ Value string `json:"value"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models/TagFilter.go�����0000664�0000000�0000000�00000001456�13771713062�0032276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type TagFilter struct { /* Tag键 */ Key string `json:"key"` /* Tag值 */ Values []string `json:"values"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/��������������������������0000775�0000000�0000000�00000000000�13771713062�0026265�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/���������������������0000775�0000000�0000000�00000000000�13771713062�0027221�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AssociateElasticIp.go0000664�0000000�0000000�00000007036�13771713062�0033267�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type AssociateElasticIpRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 弹性公网IP的ID */ ElasticIpId string `json:"elasticIpId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param elasticIpId: 弹性公网IP的ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAssociateElasticIpRequest( regionId string, instanceId string, elasticIpId string, ) *AssociateElasticIpRequest { return &AssociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:associateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, ElasticIpId: elasticIpId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param elasticIpId: 弹性公网IP的ID (Required) */ func NewAssociateElasticIpRequestWithAllParams( regionId string, instanceId string, elasticIpId string, ) *AssociateElasticIpRequest { return &AssociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:associateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, ElasticIpId: elasticIpId, } } /* This constructor has better compatible ability when API parameters changed */ func NewAssociateElasticIpRequestWithoutParam() *AssociateElasticIpRequest { return &AssociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:associateElasticIp", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *AssociateElasticIpRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *AssociateElasticIpRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param elasticIpId: 弹性公网IP的ID(Required) */ func (r *AssociateElasticIpRequest) SetElasticIpId(elasticIpId string) { r.ElasticIpId = elasticIpId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AssociateElasticIpRequest) GetRegionId() string { return r.RegionId } type AssociateElasticIpResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AssociateElasticIpResult `json:"result"` } type AssociateElasticIpResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/AttachDisk.go��������0000664�0000000�0000000�00000011314�13771713062�0031567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type AttachDiskRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 云硬盘ID */ DiskId string `json:"diskId"` /* 数据盘的逻辑挂载点[vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi],挂载系统盘时vda必传 (Optional) */ DeviceName *string `json:"deviceName"` /* 自动随主机删除此云硬盘,默认为False。仅按配置计费云硬盘支持修改此参数,包年包月云硬盘默认为False且不可修改。如果是共享型云硬盘,此参数无效。 (Optional) */ AutoDelete *bool `json:"autoDelete"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param diskId: 云硬盘ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAttachDiskRequest( regionId string, instanceId string, diskId string, ) *AttachDiskRequest { return &AttachDiskRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:attachDisk", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, DiskId: diskId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param diskId: 云硬盘ID (Required) * param deviceName: 数据盘的逻辑挂载点[vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi],挂载系统盘时vda必传 (Optional) * param autoDelete: 自动随主机删除此云硬盘,默认为False。仅按配置计费云硬盘支持修改此参数,包年包月云硬盘默认为False且不可修改。如果是共享型云硬盘,此参数无效。 (Optional) */ func NewAttachDiskRequestWithAllParams( regionId string, instanceId string, diskId string, deviceName *string, autoDelete *bool, ) *AttachDiskRequest { return &AttachDiskRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:attachDisk", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, DiskId: diskId, DeviceName: deviceName, AutoDelete: autoDelete, } } /* This constructor has better compatible ability when API parameters changed */ func NewAttachDiskRequestWithoutParam() *AttachDiskRequest { return &AttachDiskRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:attachDisk", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *AttachDiskRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *AttachDiskRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param diskId: 云硬盘ID(Required) */ func (r *AttachDiskRequest) SetDiskId(diskId string) { r.DiskId = diskId } /* param deviceName: 数据盘的逻辑挂载点[vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi],挂载系统盘时vda必传(Optional) */ func (r *AttachDiskRequest) SetDeviceName(deviceName string) { r.DeviceName = &deviceName } /* param autoDelete: 自动随主机删除此云硬盘,默认为False。仅按配置计费云硬盘支持修改此参数,包年包月云硬盘默认为False且不可修改。如果是共享型云硬盘,此参数无效。(Optional) */ func (r *AttachDiskRequest) SetAutoDelete(autoDelete bool) { r.AutoDelete = &autoDelete } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AttachDiskRequest) GetRegionId() string { return r.RegionId } type AttachDiskResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AttachDiskResult `json:"result"` } type AttachDiskResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AttachNetworkInterface.go���������������������������������������������������������������������������0000664�0000000�0000000�00000010132�13771713062�0034065�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type AttachNetworkInterfaceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 弹性网卡ID */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 随主机自动删除,默认为False (Optional) */ AutoDelete *bool `json:"autoDelete"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param networkInterfaceId: 弹性网卡ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAttachNetworkInterfaceRequest( regionId string, instanceId string, networkInterfaceId string, ) *AttachNetworkInterfaceRequest { return &AttachNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:attachNetworkInterface", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param networkInterfaceId: 弹性网卡ID (Required) * param autoDelete: 随主机自动删除,默认为False (Optional) */ func NewAttachNetworkInterfaceRequestWithAllParams( regionId string, instanceId string, networkInterfaceId string, autoDelete *bool, ) *AttachNetworkInterfaceRequest { return &AttachNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:attachNetworkInterface", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, NetworkInterfaceId: networkInterfaceId, AutoDelete: autoDelete, } } /* This constructor has better compatible ability when API parameters changed */ func NewAttachNetworkInterfaceRequestWithoutParam() *AttachNetworkInterfaceRequest { return &AttachNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:attachNetworkInterface", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *AttachNetworkInterfaceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *AttachNetworkInterfaceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param networkInterfaceId: 弹性网卡ID(Required) */ func (r *AttachNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } /* param autoDelete: 随主机自动删除,默认为False(Optional) */ func (r *AttachNetworkInterfaceRequest) SetAutoDelete(autoDelete bool) { r.AutoDelete = &autoDelete } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AttachNetworkInterfaceRequest) GetRegionId() string { return r.RegionId } type AttachNetworkInterfaceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AttachNetworkInterfaceResult `json:"result"` } type AttachNetworkInterfaceResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CopyImages.go��������0000664�0000000�0000000�00000007104�13771713062�0031612�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type CopyImagesRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 源镜像ID */ SourceImageIds []string `json:"sourceImageIds"` /* 目标区域 */ DestinationRegion string `json:"destinationRegion"` } /* * param regionId: 地域ID (Required) * param sourceImageIds: 源镜像ID (Required) * param destinationRegion: 目标区域 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCopyImagesRequest( regionId string, sourceImageIds []string, destinationRegion string, ) *CopyImagesRequest { return &CopyImagesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images:copyImages", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, SourceImageIds: sourceImageIds, DestinationRegion: destinationRegion, } } /* * param regionId: 地域ID (Required) * param sourceImageIds: 源镜像ID (Required) * param destinationRegion: 目标区域 (Required) */ func NewCopyImagesRequestWithAllParams( regionId string, sourceImageIds []string, destinationRegion string, ) *CopyImagesRequest { return &CopyImagesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images:copyImages", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, SourceImageIds: sourceImageIds, DestinationRegion: destinationRegion, } } /* This constructor has better compatible ability when API parameters changed */ func NewCopyImagesRequestWithoutParam() *CopyImagesRequest { return &CopyImagesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images:copyImages", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *CopyImagesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param sourceImageIds: 源镜像ID(Required) */ func (r *CopyImagesRequest) SetSourceImageIds(sourceImageIds []string) { r.SourceImageIds = sourceImageIds } /* param destinationRegion: 目标区域(Required) */ func (r *CopyImagesRequest) SetDestinationRegion(destinationRegion string) { r.DestinationRegion = destinationRegion } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CopyImagesRequest) GetRegionId() string { return r.RegionId } type CopyImagesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CopyImagesResult `json:"result"` } type CopyImagesResult struct { CopyImages []vm.CopyImage `json:"copyImages"` }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateImage.go�������0000664�0000000�0000000�00000012570�13771713062�0031723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type CreateImageRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 镜像名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 */ Name string `json:"name"` /* 镜像描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 */ Description string `json:"description"` /* 数据盘列表,可以在实例已挂载数据盘的基础上,额外增加新的快照、空盘、或排除云主机中的数据盘。 (Optional) */ DataDisks []vm.InstanceDiskAttachmentSpec `json:"dataDisks"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param name: 镜像名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) * param description: 镜像描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateImageRequest( regionId string, instanceId string, name string, description string, ) *CreateImageRequest { return &CreateImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:createImage", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Name: name, Description: description, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param name: 镜像名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) * param description: 镜像描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) * param dataDisks: 数据盘列表,可以在实例已挂载数据盘的基础上,额外增加新的快照、空盘、或排除云主机中的数据盘。 (Optional) */ func NewCreateImageRequestWithAllParams( regionId string, instanceId string, name string, description string, dataDisks []vm.InstanceDiskAttachmentSpec, ) *CreateImageRequest { return &CreateImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:createImage", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Name: name, Description: description, DataDisks: dataDisks, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateImageRequestWithoutParam() *CreateImageRequest { return &CreateImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:createImage", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *CreateImageRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *CreateImageRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param name: 镜像名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Required) */ func (r *CreateImageRequest) SetName(name string) { r.Name = name } /* param description: 镜像描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Required) */ func (r *CreateImageRequest) SetDescription(description string) { r.Description = description } /* param dataDisks: 数据盘列表,可以在实例已挂载数据盘的基础上,额外增加新的快照、空盘、或排除云主机中的数据盘。(Optional) */ func (r *CreateImageRequest) SetDataDisks(dataDisks []vm.InstanceDiskAttachmentSpec) { r.DataDisks = dataDisks } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateImageRequest) GetRegionId() string { return r.RegionId } type CreateImageResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateImageResult `json:"result"` } type CreateImageResult struct { ImageId string `json:"imageId"` }����������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateInstances.go���0000664�0000000�0000000�00000010242�13771713062�0032622�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type CreateInstancesRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 描述云主机配置 */ InstanceSpec *vm.InstanceSpec `json:"instanceSpec"` /* 购买云主机的数量;取值范围:[1,100],默认为1。 (Optional) */ MaxCount *int `json:"maxCount"` /* 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。 (Optional) */ ClientToken *string `json:"clientToken"` } /* * param regionId: 地域ID (Required) * param instanceSpec: 描述云主机配置 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateInstancesRequest( regionId string, instanceSpec *vm.InstanceSpec, ) *CreateInstancesRequest { return &CreateInstancesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceSpec: instanceSpec, } } /* * param regionId: 地域ID (Required) * param instanceSpec: 描述云主机配置 (Required) * param maxCount: 购买云主机的数量;取值范围:[1,100],默认为1。 (Optional) * param clientToken: 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。 (Optional) */ func NewCreateInstancesRequestWithAllParams( regionId string, instanceSpec *vm.InstanceSpec, maxCount *int, clientToken *string, ) *CreateInstancesRequest { return &CreateInstancesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceSpec: instanceSpec, MaxCount: maxCount, ClientToken: clientToken, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateInstancesRequestWithoutParam() *CreateInstancesRequest { return &CreateInstancesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *CreateInstancesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceSpec: 描述云主机配置 (Required) */ func (r *CreateInstancesRequest) SetInstanceSpec(instanceSpec *vm.InstanceSpec) { r.InstanceSpec = instanceSpec } /* param maxCount: 购买云主机的数量;取值范围:[1,100],默认为1。 (Optional) */ func (r *CreateInstancesRequest) SetMaxCount(maxCount int) { r.MaxCount = &maxCount } /* param clientToken: 用于保证请求的幂等性。由客户端生成,长度不能超过64个字符。 (Optional) */ func (r *CreateInstancesRequest) SetClientToken(clientToken string) { r.ClientToken = &clientToken } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateInstancesRequest) GetRegionId() string { return r.RegionId } type CreateInstancesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateInstancesResult `json:"result"` } type CreateInstancesResult struct { InstanceIds []string `json:"instanceIds"` }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/CreateKeypair.go�����0000664�0000000�0000000�00000006751�13771713062�0032311�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type CreateKeypairRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 */ KeyName string `json:"keyName"` } /* * param regionId: 地域ID (Required) * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateKeypairRequest( regionId string, keyName string, ) *CreateKeypairRequest { return &CreateKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, KeyName: keyName, } } /* * param regionId: 地域ID (Required) * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 (Required) */ func NewCreateKeypairRequestWithAllParams( regionId string, keyName string, ) *CreateKeypairRequest { return &CreateKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, KeyName: keyName, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateKeypairRequestWithoutParam() *CreateKeypairRequest { return &CreateKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *CreateKeypairRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 (Required) */ func (r *CreateKeypairRequest) SetKeyName(keyName string) { r.KeyName = keyName } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateKeypairRequest) GetRegionId() string { return r.RegionId } type CreateKeypairResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateKeypairResult `json:"result"` } type CreateKeypairResult struct { KeyName string `json:"keyName"` PrivateKey string `json:"privateKey"` KeyFingerprint string `json:"keyFingerprint"` }�����������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteImage.go�������0000664�0000000�0000000�00000005543�13771713062�0031724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteImageRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID */ ImageId string `json:"imageId"` } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteImageRequest( regionId string, imageId string, ) *DeleteImageRequest { return &DeleteImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) */ func NewDeleteImageRequestWithAllParams( regionId string, imageId string, ) *DeleteImageRequest { return &DeleteImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteImageRequestWithoutParam() *DeleteImageRequest { return &DeleteImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DeleteImageRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageId: 镜像ID(Required) */ func (r *DeleteImageRequest) SetImageId(imageId string) { r.ImageId = imageId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteImageRequest) GetRegionId() string { return r.RegionId } type DeleteImageResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteImageResult `json:"result"` } type DeleteImageResult struct { }�������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteInstance.go����0000664�0000000�0000000�00000005736�13771713062�0032452�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteInstanceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteInstanceRequest( regionId string, instanceId string, ) *DeleteInstanceRequest { return &DeleteInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) */ func NewDeleteInstanceRequestWithAllParams( regionId string, instanceId string, ) *DeleteInstanceRequest { return &DeleteInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteInstanceRequestWithoutParam() *DeleteInstanceRequest { return &DeleteInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DeleteInstanceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *DeleteInstanceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteInstanceRequest) GetRegionId() string { return r.RegionId } type DeleteInstanceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteInstanceResult `json:"result"` } type DeleteInstanceResult struct { }����������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DeleteKeypair.go�����0000664�0000000�0000000�00000005631�13771713062�0032304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteKeypairRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 密钥名称 */ KeyName string `json:"keyName"` } /* * param regionId: 地域ID (Required) * param keyName: 密钥名称 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteKeypairRequest( regionId string, keyName string, ) *DeleteKeypairRequest { return &DeleteKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs/{keyName}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, KeyName: keyName, } } /* * param regionId: 地域ID (Required) * param keyName: 密钥名称 (Required) */ func NewDeleteKeypairRequestWithAllParams( regionId string, keyName string, ) *DeleteKeypairRequest { return &DeleteKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs/{keyName}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, KeyName: keyName, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteKeypairRequestWithoutParam() *DeleteKeypairRequest { return &DeleteKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs/{keyName}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DeleteKeypairRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param keyName: 密钥名称(Required) */ func (r *DeleteKeypairRequest) SetKeyName(keyName string) { r.KeyName = keyName } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteKeypairRequest) GetRegionId() string { return r.RegionId } type DeleteKeypairResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteKeypairResult `json:"result"` } type DeleteKeypairResult struct { }�������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImage.go�����0000664�0000000�0000000�00000005736�13771713062�0032246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type DescribeImageRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID */ ImageId string `json:"imageId"` } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeImageRequest( regionId string, imageId string, ) *DescribeImageRequest { return &DescribeImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) */ func NewDescribeImageRequestWithAllParams( regionId string, imageId string, ) *DescribeImageRequest { return &DescribeImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeImageRequestWithoutParam() *DescribeImageRequest { return &DescribeImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeImageRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageId: 镜像ID(Required) */ func (r *DescribeImageRequest) SetImageId(imageId string) { r.ImageId = imageId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeImageRequest) GetRegionId() string { return r.RegionId } type DescribeImageResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeImageResult `json:"result"` } type DescribeImageResult struct { Image vm.Image `json:"image"` }����������������������������������DescribeImageConstraints.go�������������������������������������������������������������������������0000664�0000000�0000000�00000006322�13771713062�0034407�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type DescribeImageConstraintsRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID */ ImageId string `json:"imageId"` } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeImageConstraintsRequest( regionId string, imageId string, ) *DescribeImageConstraintsRequest { return &DescribeImageConstraintsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}/constraints", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) */ func NewDescribeImageConstraintsRequestWithAllParams( regionId string, imageId string, ) *DescribeImageConstraintsRequest { return &DescribeImageConstraintsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}/constraints", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeImageConstraintsRequestWithoutParam() *DescribeImageConstraintsRequest { return &DescribeImageConstraintsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}/constraints", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeImageConstraintsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageId: 镜像ID(Required) */ func (r *DescribeImageConstraintsRequest) SetImageId(imageId string) { r.ImageId = imageId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeImageConstraintsRequest) GetRegionId() string { return r.RegionId } type DescribeImageConstraintsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeImageConstraintsResult `json:"result"` } type DescribeImageConstraintsResult struct { ImageConstraints vm.ImageConstraint `json:"imageConstraints"` }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeImageConstraintsBatch.go��������������������������������������������������������������������0000664�0000000�0000000�00000006242�13771713062�0035352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type DescribeImageConstraintsBatchRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID列表 (Optional) */ Ids []string `json:"ids"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeImageConstraintsBatchRequest( regionId string, ) *DescribeImageConstraintsBatchRequest { return &DescribeImageConstraintsBatchRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/imageConstraints", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param ids: 镜像ID列表 (Optional) */ func NewDescribeImageConstraintsBatchRequestWithAllParams( regionId string, ids []string, ) *DescribeImageConstraintsBatchRequest { return &DescribeImageConstraintsBatchRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/imageConstraints", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, Ids: ids, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeImageConstraintsBatchRequestWithoutParam() *DescribeImageConstraintsBatchRequest { return &DescribeImageConstraintsBatchRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/imageConstraints", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeImageConstraintsBatchRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param ids: 镜像ID列表(Optional) */ func (r *DescribeImageConstraintsBatchRequest) SetIds(ids []string) { r.Ids = ids } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeImageConstraintsBatchRequest) GetRegionId() string { return r.RegionId } type DescribeImageConstraintsBatchResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeImageConstraintsBatchResult `json:"result"` } type DescribeImageConstraintsBatchResult struct { ImageConstraints []vm.ImageConstraint `json:"imageConstraints"` }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeImageMembers.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000006042�13771713062�0033471�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DescribeImageMembersRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID */ ImageId string `json:"imageId"` } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeImageMembersRequest( regionId string, imageId string, ) *DescribeImageMembersRequest { return &DescribeImageMembersRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}/members", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) */ func NewDescribeImageMembersRequestWithAllParams( regionId string, imageId string, ) *DescribeImageMembersRequest { return &DescribeImageMembersRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}/members", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeImageMembersRequestWithoutParam() *DescribeImageMembersRequest { return &DescribeImageMembersRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}/members", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeImageMembersRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageId: 镜像ID(Required) */ func (r *DescribeImageMembersRequest) SetImageId(imageId string) { r.ImageId = imageId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeImageMembersRequest) GetRegionId() string { return r.RegionId } type DescribeImageMembersResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeImageMembersResult `json:"result"` } type DescribeImageMembersResult struct { Pins []string `json:"pins"` }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeImages.go����0000664�0000000�0000000�00000013574�13771713062�0032430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type DescribeImagesRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像来源,如果没有指定ids参数,此参数必传;取值范围:public、shared、thirdparty、private (Optional) */ ImageSource *string `json:"imageSource"` /* 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu (Optional) */ Platform *string `json:"platform"` /* 镜像ID列表,如果指定了此参数,其它参数可为空 (Optional) */ Ids []string `json:"ids"` /* 镜像支持的系统盘类型,[localDisk,cloudDisk] (Optional) */ RootDeviceType *string `json:"rootDeviceType"` /* <a href="http://docs.jdcloud.com/virtual-machines/api/image_status">参考镜像状态</a> (Optional) */ Status *string `json:"status"` /* 页码;默认为1 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ PageSize *int `json:"pageSize"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeImagesRequest( regionId string, ) *DescribeImagesRequest { return &DescribeImagesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param imageSource: 镜像来源,如果没有指定ids参数,此参数必传;取值范围:public、shared、thirdparty、private (Optional) * param platform: 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu (Optional) * param ids: 镜像ID列表,如果指定了此参数,其它参数可为空 (Optional) * param rootDeviceType: 镜像支持的系统盘类型,[localDisk,cloudDisk] (Optional) * param status: <a href="http://docs.jdcloud.com/virtual-machines/api/image_status">参考镜像状态</a> (Optional) * param pageNumber: 页码;默认为1 (Optional) * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) */ func NewDescribeImagesRequestWithAllParams( regionId string, imageSource *string, platform *string, ids []string, rootDeviceType *string, status *string, pageNumber *int, pageSize *int, ) *DescribeImagesRequest { return &DescribeImagesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ImageSource: imageSource, Platform: platform, Ids: ids, RootDeviceType: rootDeviceType, Status: status, PageNumber: pageNumber, PageSize: pageSize, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeImagesRequestWithoutParam() *DescribeImagesRequest { return &DescribeImagesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeImagesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageSource: 镜像来源,如果没有指定ids参数,此参数必传;取值范围:public、shared、thirdparty、private(Optional) */ func (r *DescribeImagesRequest) SetImageSource(imageSource string) { r.ImageSource = &imageSource } /* param platform: 操作系统平台,取值范围:Windows Server、CentOS、Ubuntu(Optional) */ func (r *DescribeImagesRequest) SetPlatform(platform string) { r.Platform = &platform } /* param ids: 镜像ID列表,如果指定了此参数,其它参数可为空(Optional) */ func (r *DescribeImagesRequest) SetIds(ids []string) { r.Ids = ids } /* param rootDeviceType: 镜像支持的系统盘类型,[localDisk,cloudDisk](Optional) */ func (r *DescribeImagesRequest) SetRootDeviceType(rootDeviceType string) { r.RootDeviceType = &rootDeviceType } /* param status: <a href="http://docs.jdcloud.com/virtual-machines/api/image_status">参考镜像状态</a>(Optional) */ func (r *DescribeImagesRequest) SetStatus(status string) { r.Status = &status } /* param pageNumber: 页码;默认为1(Optional) */ func (r *DescribeImagesRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ func (r *DescribeImagesRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeImagesRequest) GetRegionId() string { return r.RegionId } type DescribeImagesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeImagesResult `json:"result"` } type DescribeImagesResult struct { Images []vm.Image `json:"images"` TotalCount int `json:"totalCount"` }������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstance.go��0000664�0000000�0000000�00000006142�13771713062�0032760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type DescribeInstanceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeInstanceRequest( regionId string, instanceId string, ) *DescribeInstanceRequest { return &DescribeInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) */ func NewDescribeInstanceRequestWithAllParams( regionId string, instanceId string, ) *DescribeInstanceRequest { return &DescribeInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeInstanceRequestWithoutParam() *DescribeInstanceRequest { return &DescribeInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeInstanceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *DescribeInstanceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeInstanceRequest) GetRegionId() string { return r.RegionId } type DescribeInstanceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeInstanceResult `json:"result"` } type DescribeInstanceResult struct { Instance vm.Instance `json:"instance"` }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeInstancePrivateIpAddress.go�����������������������������������������������������������������0000664�0000000�0000000�00000013416�13771713062�0036035�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeInstancePrivateIpAddressRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 页码;默认为1 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ PageSize *int `json:"pageSize"` /* instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeInstancePrivateIpAddressRequest( regionId string, ) *DescribeInstancePrivateIpAddressRequest { return &DescribeInstancePrivateIpAddressRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instancePrivateIpAddress", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param pageNumber: 页码;默认为1 (Optional) * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) * param filters: instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 (Optional) */ func NewDescribeInstancePrivateIpAddressRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeInstancePrivateIpAddressRequest { return &DescribeInstancePrivateIpAddressRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instancePrivateIpAddress", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeInstancePrivateIpAddressRequestWithoutParam() *DescribeInstancePrivateIpAddressRequest { return &DescribeInstancePrivateIpAddressRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instancePrivateIpAddress", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeInstancePrivateIpAddressRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码;默认为1(Optional) */ func (r *DescribeInstancePrivateIpAddressRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ func (r *DescribeInstancePrivateIpAddressRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 (Optional) */ func (r *DescribeInstancePrivateIpAddressRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeInstancePrivateIpAddressRequest) GetRegionId() string { return r.RegionId } type DescribeInstancePrivateIpAddressResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeInstancePrivateIpAddressResult `json:"result"` } type DescribeInstancePrivateIpAddressResult struct { InstancePrivateIpAddress []vm.InstancePrivateIpAddress `json:"instancePrivateIpAddress"` TotalCount int `json:"totalCount"` }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeInstanceStatus.go���������������������������������������������������������������������������0000664�0000000�0000000�00000013042�13771713062�0034102�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeInstanceStatusRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 页码;默认为1 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ PageSize *int `json:"pageSize"` /* instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeInstanceStatusRequest( regionId string, ) *DescribeInstanceStatusRequest { return &DescribeInstanceStatusRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instanceStatus", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param pageNumber: 页码;默认为1 (Optional) * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) * param filters: instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 (Optional) */ func NewDescribeInstanceStatusRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeInstanceStatusRequest { return &DescribeInstanceStatusRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instanceStatus", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeInstanceStatusRequestWithoutParam() *DescribeInstanceStatusRequest { return &DescribeInstanceStatusRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instanceStatus", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeInstanceStatusRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码;默认为1(Optional) */ func (r *DescribeInstanceStatusRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ func (r *DescribeInstanceStatusRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 (Optional) */ func (r *DescribeInstanceStatusRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeInstanceStatusRequest) GetRegionId() string { return r.RegionId } type DescribeInstanceStatusResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeInstanceStatusResult `json:"result"` } type DescribeInstanceStatusResult struct { InstanceStatuses []vm.InstanceStatus `json:"instanceStatuses"` TotalCount int `json:"totalCount"` }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeInstanceTypes.go����������������������������������������������������������������������������0000664�0000000�0000000�00000007033�13771713062�0033726�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeInstanceTypesRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* instanceTypes - 实例规格,精确匹配,支持多个 az - 可用区,精确匹配,支持多个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeInstanceTypesRequest( regionId string, ) *DescribeInstanceTypesRequest { return &DescribeInstanceTypesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instanceTypes", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param filters: instanceTypes - 实例规格,精确匹配,支持多个 az - 可用区,精确匹配,支持多个 (Optional) */ func NewDescribeInstanceTypesRequestWithAllParams( regionId string, filters []common.Filter, ) *DescribeInstanceTypesRequest { return &DescribeInstanceTypesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instanceTypes", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeInstanceTypesRequestWithoutParam() *DescribeInstanceTypesRequest { return &DescribeInstanceTypesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instanceTypes", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeInstanceTypesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param filters: instanceTypes - 实例规格,精确匹配,支持多个 az - 可用区,精确匹配,支持多个 (Optional) */ func (r *DescribeInstanceTypesRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeInstanceTypesRequest) GetRegionId() string { return r.RegionId } type DescribeInstanceTypesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeInstanceTypesResult `json:"result"` } type DescribeInstanceTypesResult struct { InstanceTypes []vm.InstanceType `json:"instanceTypes"` SpecificInstanceTypes []vm.InstanceType `json:"specificInstanceTypes"` TotalCount int `json:"totalCount"` }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeInstanceVncUrl.go���������������������������������������������������������������������������0000664�0000000�0000000�00000006203�13771713062�0034031�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DescribeInstanceVncUrlRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeInstanceVncUrlRequest( regionId string, instanceId string, ) *DescribeInstanceVncUrlRequest { return &DescribeInstanceVncUrlRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}/vnc", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) */ func NewDescribeInstanceVncUrlRequestWithAllParams( regionId string, instanceId string, ) *DescribeInstanceVncUrlRequest { return &DescribeInstanceVncUrlRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}/vnc", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeInstanceVncUrlRequestWithoutParam() *DescribeInstanceVncUrlRequest { return &DescribeInstanceVncUrlRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}/vnc", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeInstanceVncUrlRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *DescribeInstanceVncUrlRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeInstanceVncUrlRequest) GetRegionId() string { return r.RegionId } type DescribeInstanceVncUrlResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeInstanceVncUrlResult `json:"result"` } type DescribeInstanceVncUrlResult struct { VncUrl string `json:"vncUrl"` }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeInstances.go�0000664�0000000�0000000�00000013431�13771713062�0033142�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeInstancesRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 页码;默认为1 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ PageSize *int `json:"pageSize"` /* instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 az - 可用区,精确匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 agId - 使用可用组id,支持单个 faultDomain - 错误域,支持多个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeInstancesRequest( regionId string, ) *DescribeInstancesRequest { return &DescribeInstancesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param pageNumber: 页码;默认为1 (Optional) * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) * param filters: instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 az - 可用区,精确匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 agId - 使用可用组id,支持单个 faultDomain - 错误域,支持多个 (Optional) */ func NewDescribeInstancesRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeInstancesRequest { return &DescribeInstancesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeInstancesRequestWithoutParam() *DescribeInstancesRequest { return &DescribeInstancesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeInstancesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码;默认为1(Optional) */ func (r *DescribeInstancesRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ func (r *DescribeInstancesRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: instanceId - 云主机ID,精确匹配,支持多个 privateIpAddress - 主网卡内网主IP地址,模糊匹配,支持多个 az - 可用区,精确匹配,支持多个 vpcId - 私有网络ID,精确匹配,支持多个 status - 云主机状态,精确匹配,支持多个,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> name - 云主机名称,模糊匹配,支持单个 imageId - 镜像ID,精确匹配,支持多个 networkInterfaceId - 弹性网卡ID,精确匹配,支持多个 subnetId - 子网ID,精确匹配,支持多个 agId - 使用可用组id,支持单个 faultDomain - 错误域,支持多个 (Optional) */ func (r *DescribeInstancesRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeInstancesRequest) GetRegionId() string { return r.RegionId } type DescribeInstancesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeInstancesResult `json:"result"` } type DescribeInstancesResult struct { Instances []vm.Instance `json:"instances"` TotalCount int `json:"totalCount"` }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeKeypairs.go��0000664�0000000�0000000�00000007706�13771713062�0033012�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeKeypairsRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 页码;默认为1 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小;默认为20;取值范围[10, 100] (Optional) */ PageSize *int `json:"pageSize"` /* keyNames - 密钥对名称,精确匹配,支持多个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeKeypairsRequest( regionId string, ) *DescribeKeypairsRequest { return &DescribeKeypairsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param pageNumber: 页码;默认为1 (Optional) * param pageSize: 分页大小;默认为20;取值范围[10, 100] (Optional) * param filters: keyNames - 密钥对名称,精确匹配,支持多个 (Optional) */ func NewDescribeKeypairsRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeKeypairsRequest { return &DescribeKeypairsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeKeypairsRequestWithoutParam() *DescribeKeypairsRequest { return &DescribeKeypairsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeKeypairsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码;默认为1(Optional) */ func (r *DescribeKeypairsRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小;默认为20;取值范围[10, 100](Optional) */ func (r *DescribeKeypairsRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: keyNames - 密钥对名称,精确匹配,支持多个 (Optional) */ func (r *DescribeKeypairsRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeKeypairsRequest) GetRegionId() string { return r.RegionId } type DescribeKeypairsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeKeypairsResult `json:"result"` } type DescribeKeypairsResult struct { Keypairs []vm.Keypair `json:"keypairs"` TotalCount int `json:"totalCount"` }����������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DescribeQuotas.go����0000664�0000000�0000000�00000007357�13771713062�0032501�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeQuotasRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* resourceTypes - 资源类型,支持多个[instance,keypair,image,instanceTemplate,imageShare] (Optional) */ Filters []common.Filter `json:"filters"` /* 私有镜像Id,查询镜像共享(imageShare)配额时,此参数必传 (Optional) */ ImageId *string `json:"imageId"` } /* * param regionId: 地域ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeQuotasRequest( regionId string, ) *DescribeQuotasRequest { return &DescribeQuotasRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/quotas", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: 地域ID (Required) * param filters: resourceTypes - 资源类型,支持多个[instance,keypair,image,instanceTemplate,imageShare] (Optional) * param imageId: 私有镜像Id,查询镜像共享(imageShare)配额时,此参数必传 (Optional) */ func NewDescribeQuotasRequestWithAllParams( regionId string, filters []common.Filter, imageId *string, ) *DescribeQuotasRequest { return &DescribeQuotasRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/quotas", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, Filters: filters, ImageId: imageId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeQuotasRequestWithoutParam() *DescribeQuotasRequest { return &DescribeQuotasRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/quotas", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DescribeQuotasRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param filters: resourceTypes - 资源类型,支持多个[instance,keypair,image,instanceTemplate,imageShare] (Optional) */ func (r *DescribeQuotasRequest) SetFilters(filters []common.Filter) { r.Filters = filters } /* param imageId: 私有镜像Id,查询镜像共享(imageShare)配额时,此参数必传(Optional) */ func (r *DescribeQuotasRequest) SetImageId(imageId string) { r.ImageId = &imageId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeQuotasRequest) GetRegionId() string { return r.RegionId } type DescribeQuotasResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeQuotasResult `json:"result"` } type DescribeQuotasResult struct { Quotas []vm.Quota `json:"quotas"` }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/DetachDisk.go��������0000664�0000000�0000000�00000007444�13771713062�0031564�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DetachDiskRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 云硬盘ID */ DiskId string `json:"diskId"` /* 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。 (Optional) */ Force *bool `json:"force"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param diskId: 云硬盘ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDetachDiskRequest( regionId string, instanceId string, diskId string, ) *DetachDiskRequest { return &DetachDiskRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:detachDisk", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, DiskId: diskId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param diskId: 云硬盘ID (Required) * param force: 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。 (Optional) */ func NewDetachDiskRequestWithAllParams( regionId string, instanceId string, diskId string, force *bool, ) *DetachDiskRequest { return &DetachDiskRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:detachDisk", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, DiskId: diskId, Force: force, } } /* This constructor has better compatible ability when API parameters changed */ func NewDetachDiskRequestWithoutParam() *DetachDiskRequest { return &DetachDiskRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:detachDisk", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DetachDiskRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *DetachDiskRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param diskId: 云硬盘ID(Required) */ func (r *DetachDiskRequest) SetDiskId(diskId string) { r.DiskId = diskId } /* param force: 强制缷载,默认False。如果此参数传值为True,代表数据盘的IO会被强制断掉。(Optional) */ func (r *DetachDiskRequest) SetForce(force bool) { r.Force = &force } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DetachDiskRequest) GetRegionId() string { return r.RegionId } type DetachDiskResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DetachDiskResult `json:"result"` } type DetachDiskResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DetachNetworkInterface.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007303�13771713062�0034057�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DetachNetworkInterfaceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 弹性网卡ID */ NetworkInterfaceId string `json:"networkInterfaceId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param networkInterfaceId: 弹性网卡ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDetachNetworkInterfaceRequest( regionId string, instanceId string, networkInterfaceId string, ) *DetachNetworkInterfaceRequest { return &DetachNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:detachNetworkInterface", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param networkInterfaceId: 弹性网卡ID (Required) */ func NewDetachNetworkInterfaceRequestWithAllParams( regionId string, instanceId string, networkInterfaceId string, ) *DetachNetworkInterfaceRequest { return &DetachNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:detachNetworkInterface", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, NetworkInterfaceId: networkInterfaceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDetachNetworkInterfaceRequestWithoutParam() *DetachNetworkInterfaceRequest { return &DetachNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:detachNetworkInterface", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DetachNetworkInterfaceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *DetachNetworkInterfaceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param networkInterfaceId: 弹性网卡ID(Required) */ func (r *DetachNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DetachNetworkInterfaceRequest) GetRegionId() string { return r.RegionId } type DetachNetworkInterfaceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DetachNetworkInterfaceResult `json:"result"` } type DetachNetworkInterfaceResult struct { }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DisassociateElasticIp.go����������������������������������������������������������������������������0000664�0000000�0000000�00000007132�13771713062�0033705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DisassociateElasticIpRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 弹性公网IP的ID */ ElasticIpId string `json:"elasticIpId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param elasticIpId: 弹性公网IP的ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDisassociateElasticIpRequest( regionId string, instanceId string, elasticIpId string, ) *DisassociateElasticIpRequest { return &DisassociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:disassociateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, ElasticIpId: elasticIpId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param elasticIpId: 弹性公网IP的ID (Required) */ func NewDisassociateElasticIpRequestWithAllParams( regionId string, instanceId string, elasticIpId string, ) *DisassociateElasticIpRequest { return &DisassociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:disassociateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, ElasticIpId: elasticIpId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDisassociateElasticIpRequestWithoutParam() *DisassociateElasticIpRequest { return &DisassociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:disassociateElasticIp", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *DisassociateElasticIpRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *DisassociateElasticIpRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param elasticIpId: 弹性公网IP的ID(Required) */ func (r *DisassociateElasticIpRequest) SetElasticIpId(elasticIpId string) { r.ElasticIpId = elasticIpId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DisassociateElasticIpRequest) GetRegionId() string { return r.RegionId } type DisassociateElasticIpResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DisassociateElasticIpResult `json:"result"` } type DisassociateElasticIpResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ImportKeypair.go�����0000664�0000000�0000000�00000007622�13771713062�0032356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ImportKeypairRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 */ KeyName string `json:"keyName"` /* 密钥对的公钥部分 */ PublicKey string `json:"publicKey"` } /* * param regionId: 地域ID (Required) * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 (Required) * param publicKey: 密钥对的公钥部分 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewImportKeypairRequest( regionId string, keyName string, publicKey string, ) *ImportKeypairRequest { return &ImportKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs:import", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, KeyName: keyName, PublicKey: publicKey, } } /* * param regionId: 地域ID (Required) * param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 (Required) * param publicKey: 密钥对的公钥部分 (Required) */ func NewImportKeypairRequestWithAllParams( regionId string, keyName string, publicKey string, ) *ImportKeypairRequest { return &ImportKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs:import", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, KeyName: keyName, PublicKey: publicKey, } } /* This constructor has better compatible ability when API parameters changed */ func NewImportKeypairRequestWithoutParam() *ImportKeypairRequest { return &ImportKeypairRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/keypairs:import", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ImportKeypairRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param keyName: 密钥对名称,需要全局唯一。只允许数字、大小写字母、下划线“_”及中划线“-”,不超过32个字符。 (Required) */ func (r *ImportKeypairRequest) SetKeyName(keyName string) { r.KeyName = keyName } /* param publicKey: 密钥对的公钥部分(Required) */ func (r *ImportKeypairRequest) SetPublicKey(publicKey string) { r.PublicKey = publicKey } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ImportKeypairRequest) GetRegionId() string { return r.RegionId } type ImportKeypairResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ImportKeypairResult `json:"result"` } type ImportKeypairResult struct { KeyName string `json:"keyName"` KeyFingerprint string `json:"keyFingerprint"` }��������������������������������������������������������������������������������������������������������������ModifyImageAttribute.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000010363�13771713062�0033552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyImageAttributeRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID */ ImageId string `json:"imageId"` /* 名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ Name *string `json:"name"` /* 描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ Description *string `json:"description"` } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyImageAttributeRequest( regionId string, imageId string, ) *ModifyImageAttributeRequest { return &ModifyImageAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:modifyImageAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * param name: 名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) * param description: 描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ func NewModifyImageAttributeRequestWithAllParams( regionId string, imageId string, name *string, description *string, ) *ModifyImageAttributeRequest { return &ModifyImageAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:modifyImageAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, Name: name, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyImageAttributeRequestWithoutParam() *ModifyImageAttributeRequest { return &ModifyImageAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:modifyImageAttribute", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ModifyImageAttributeRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageId: 镜像ID(Required) */ func (r *ModifyImageAttributeRequest) SetImageId(imageId string) { r.ImageId = imageId } /* param name: 名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Optional) */ func (r *ModifyImageAttributeRequest) SetName(name string) { r.Name = &name } /* param description: 描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Optional) */ func (r *ModifyImageAttributeRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyImageAttributeRequest) GetRegionId() string { return r.RegionId } type ModifyImageAttributeResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyImageAttributeResult `json:"result"` } type ModifyImageAttributeResult struct { }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyInstanceAttribute.go��������������������������������������������������������������������������0000664�0000000�0000000�00000010575�13771713062�0034301�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyInstanceAttributeRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ Name *string `json:"name"` /* 描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ Description *string `json:"description"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyInstanceAttributeRequest( regionId string, instanceId string, ) *ModifyInstanceAttributeRequest { return &ModifyInstanceAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param name: 名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) * param description: 描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ func NewModifyInstanceAttributeRequestWithAllParams( regionId string, instanceId string, name *string, description *string, ) *ModifyInstanceAttributeRequest { return &ModifyInstanceAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Name: name, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyInstanceAttributeRequestWithoutParam() *ModifyInstanceAttributeRequest { return &ModifyInstanceAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceAttribute", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ModifyInstanceAttributeRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *ModifyInstanceAttributeRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param name: 名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Optional) */ func (r *ModifyInstanceAttributeRequest) SetName(name string) { r.Name = &name } /* param description: 描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Optional) */ func (r *ModifyInstanceAttributeRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyInstanceAttributeRequest) GetRegionId() string { return r.RegionId } type ModifyInstanceAttributeResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyInstanceAttributeResult `json:"result"` } type ModifyInstanceAttributeResult struct { }�����������������������������������������������������������������������������������������������������������������������������������ModifyInstanceDiskAttribute.go����������������������������������������������������������������������0000664�0000000�0000000�00000007311�13771713062�0035106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type ModifyInstanceDiskAttributeRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 云硬盘列表 (Optional) */ DataDisks []vm.InstanceDiskAttribute `json:"dataDisks"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyInstanceDiskAttributeRequest( regionId string, instanceId string, ) *ModifyInstanceDiskAttributeRequest { return &ModifyInstanceDiskAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceDiskAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param dataDisks: 云硬盘列表 (Optional) */ func NewModifyInstanceDiskAttributeRequestWithAllParams( regionId string, instanceId string, dataDisks []vm.InstanceDiskAttribute, ) *ModifyInstanceDiskAttributeRequest { return &ModifyInstanceDiskAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceDiskAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, DataDisks: dataDisks, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyInstanceDiskAttributeRequestWithoutParam() *ModifyInstanceDiskAttributeRequest { return &ModifyInstanceDiskAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceDiskAttribute", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ModifyInstanceDiskAttributeRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *ModifyInstanceDiskAttributeRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param dataDisks: 云硬盘列表(Optional) */ func (r *ModifyInstanceDiskAttributeRequest) SetDataDisks(dataDisks []vm.InstanceDiskAttribute) { r.DataDisks = dataDisks } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyInstanceDiskAttributeRequest) GetRegionId() string { return r.RegionId } type ModifyInstanceDiskAttributeResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyInstanceDiskAttributeResult `json:"result"` } type ModifyInstanceDiskAttributeResult struct { }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyInstanceNetworkAttribute.go�������������������������������������������������������������������0000664�0000000�0000000�00000007414�13771713062�0035651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models" ) type ModifyInstanceNetworkAttributeRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 弹性网卡列表 (Optional) */ Networks []vm.InstanceNetworkAttribute `json:"networks"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyInstanceNetworkAttributeRequest( regionId string, instanceId string, ) *ModifyInstanceNetworkAttributeRequest { return &ModifyInstanceNetworkAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceNetworkAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param networks: 弹性网卡列表 (Optional) */ func NewModifyInstanceNetworkAttributeRequestWithAllParams( regionId string, instanceId string, networks []vm.InstanceNetworkAttribute, ) *ModifyInstanceNetworkAttributeRequest { return &ModifyInstanceNetworkAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceNetworkAttribute", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Networks: networks, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyInstanceNetworkAttributeRequestWithoutParam() *ModifyInstanceNetworkAttributeRequest { return &ModifyInstanceNetworkAttributeRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstanceNetworkAttribute", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ModifyInstanceNetworkAttributeRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *ModifyInstanceNetworkAttributeRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param networks: 弹性网卡列表(Optional) */ func (r *ModifyInstanceNetworkAttributeRequest) SetNetworks(networks []vm.InstanceNetworkAttribute) { r.Networks = networks } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyInstanceNetworkAttributeRequest) GetRegionId() string { return r.RegionId } type ModifyInstanceNetworkAttributeResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyInstanceNetworkAttributeResult `json:"result"` } type ModifyInstanceNetworkAttributeResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyInstancePassword.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007675�13771713062�0034147�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis�����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyInstancePasswordRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 */ Password string `json:"password"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param password: 密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyInstancePasswordRequest( regionId string, instanceId string, password string, ) *ModifyInstancePasswordRequest { return &ModifyInstancePasswordRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstancePassword", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Password: password, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param password: 密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) */ func NewModifyInstancePasswordRequestWithAllParams( regionId string, instanceId string, password string, ) *ModifyInstancePasswordRequest { return &ModifyInstancePasswordRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstancePassword", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Password: password, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyInstancePasswordRequestWithoutParam() *ModifyInstancePasswordRequest { return &ModifyInstancePasswordRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:modifyInstancePassword", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ModifyInstancePasswordRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *ModifyInstancePasswordRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param password: 密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Required) */ func (r *ModifyInstancePasswordRequest) SetPassword(password string) { r.Password = password } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyInstancePasswordRequest) GetRegionId() string { return r.RegionId } type ModifyInstancePasswordResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyInstancePasswordResult `json:"result"` } type ModifyInstancePasswordResult struct { }�������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebootInstance.go����0000664�0000000�0000000�00000006005�13771713062�0032470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type RebootInstanceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewRebootInstanceRequest( regionId string, instanceId string, ) *RebootInstanceRequest { return &RebootInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) */ func NewRebootInstanceRequestWithAllParams( regionId string, instanceId string, ) *RebootInstanceRequest { return &RebootInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewRebootInstanceRequestWithoutParam() *RebootInstanceRequest { return &RebootInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:rebootInstance", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *RebootInstanceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *RebootInstanceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r RebootInstanceRequest) GetRegionId() string { return r.RegionId } type RebootInstanceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result RebootInstanceResult `json:"result"` } type RebootInstanceResult struct { }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/RebuildInstance.go���0000664�0000000�0000000�00000012000�13771713062�0032614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type RebuildInstanceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 云主机密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 */ Password string `json:"password"` /* 镜像ID。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。 (Optional) */ ImageId *string `json:"imageId"` /* 密钥对名称;当前只支持一个。仅Linux系统支持指定。 (Optional) */ KeyNames []string `json:"keyNames"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param password: 云主机密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewRebuildInstanceRequest( regionId string, instanceId string, password string, ) *RebuildInstanceRequest { return &RebuildInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:rebuildInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Password: password, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param password: 云主机密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Required) * param imageId: 镜像ID。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。 (Optional) * param keyNames: 密钥对名称;当前只支持一个。仅Linux系统支持指定。 (Optional) */ func NewRebuildInstanceRequestWithAllParams( regionId string, instanceId string, password string, imageId *string, keyNames []string, ) *RebuildInstanceRequest { return &RebuildInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:rebuildInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, Password: password, ImageId: imageId, KeyNames: keyNames, } } /* This constructor has better compatible ability when API parameters changed */ func NewRebuildInstanceRequestWithoutParam() *RebuildInstanceRequest { return &RebuildInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:rebuildInstance", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *RebuildInstanceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *RebuildInstanceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param password: 云主机密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。(Required) */ func (r *RebuildInstanceRequest) SetPassword(password string) { r.Password = password } /* param imageId: 镜像ID。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。(Optional) */ func (r *RebuildInstanceRequest) SetImageId(imageId string) { r.ImageId = &imageId } /* param keyNames: 密钥对名称;当前只支持一个。仅Linux系统支持指定。(Optional) */ func (r *RebuildInstanceRequest) SetKeyNames(keyNames []string) { r.KeyNames = keyNames } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r RebuildInstanceRequest) GetRegionId() string { return r.RegionId } type RebuildInstanceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result RebuildInstanceResult `json:"result"` } type RebuildInstanceResult struct { }packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ResizeInstance.go����0000664�0000000�0000000�00000010141�13771713062�0032473�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ResizeInstanceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` /* 实例规格,可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。 */ InstanceType string `json:"instanceType"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param instanceType: 实例规格,可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewResizeInstanceRequest( regionId string, instanceId string, instanceType string, ) *ResizeInstanceRequest { return &ResizeInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:resizeInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, InstanceType: instanceType, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * param instanceType: 实例规格,可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。 (Required) */ func NewResizeInstanceRequestWithAllParams( regionId string, instanceId string, instanceType string, ) *ResizeInstanceRequest { return &ResizeInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:resizeInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, InstanceType: instanceType, } } /* This constructor has better compatible ability when API parameters changed */ func NewResizeInstanceRequestWithoutParam() *ResizeInstanceRequest { return &ResizeInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:resizeInstance", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ResizeInstanceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *ResizeInstanceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } /* param instanceType: 实例规格,可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。(Required) */ func (r *ResizeInstanceRequest) SetInstanceType(instanceType string) { r.InstanceType = instanceType } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ResizeInstanceRequest) GetRegionId() string { return r.RegionId } type ResizeInstanceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ResizeInstanceResult `json:"result"` } type ResizeInstanceResult struct { }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/ShareImage.go��������0000664�0000000�0000000�00000006176�13771713062�0031567�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ShareImageRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID */ ImageId string `json:"imageId"` /* 需要共享的帐户 (Optional) */ Pins []string `json:"pins"` } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewShareImageRequest( regionId string, imageId string, ) *ShareImageRequest { return &ShareImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:share", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * param pins: 需要共享的帐户 (Optional) */ func NewShareImageRequestWithAllParams( regionId string, imageId string, pins []string, ) *ShareImageRequest { return &ShareImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:share", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, Pins: pins, } } /* This constructor has better compatible ability when API parameters changed */ func NewShareImageRequestWithoutParam() *ShareImageRequest { return &ShareImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:share", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *ShareImageRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageId: 镜像ID(Required) */ func (r *ShareImageRequest) SetImageId(imageId string) { r.ImageId = imageId } /* param pins: 需要共享的帐户(Optional) */ func (r *ShareImageRequest) SetPins(pins []string) { r.Pins = pins } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ShareImageRequest) GetRegionId() string { return r.RegionId } type ShareImageResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ShareImageResult `json:"result"` } type ShareImageResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StartInstance.go�����0000664�0000000�0000000�00000005762�13771713062�0032344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type StartInstanceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewStartInstanceRequest( regionId string, instanceId string, ) *StartInstanceRequest { return &StartInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:startInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) */ func NewStartInstanceRequestWithAllParams( regionId string, instanceId string, ) *StartInstanceRequest { return &StartInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:startInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewStartInstanceRequestWithoutParam() *StartInstanceRequest { return &StartInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:startInstance", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *StartInstanceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *StartInstanceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r StartInstanceRequest) GetRegionId() string { return r.RegionId } type StartInstanceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result StartInstanceResult `json:"result"` } type StartInstanceResult struct { }��������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/StopInstance.go������0000664�0000000�0000000�00000005737�13771713062�0032176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type StopInstanceRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 云主机ID */ InstanceId string `json:"instanceId"` } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewStopInstanceRequest( regionId string, instanceId string, ) *StopInstanceRequest { return &StopInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:stopInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* * param regionId: 地域ID (Required) * param instanceId: 云主机ID (Required) */ func NewStopInstanceRequestWithAllParams( regionId string, instanceId string, ) *StopInstanceRequest { return &StopInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:stopInstance", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, InstanceId: instanceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewStopInstanceRequestWithoutParam() *StopInstanceRequest { return &StopInstanceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/instances/{instanceId}:stopInstance", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *StopInstanceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param instanceId: 云主机ID(Required) */ func (r *StopInstanceRequest) SetInstanceId(instanceId string) { r.InstanceId = instanceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r StopInstanceRequest) GetRegionId() string { return r.RegionId } type StopInstanceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result StopInstanceResult `json:"result"` } type StopInstanceResult struct { }���������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis/UnShareImage.go������0000664�0000000�0000000�00000006246�13771713062�0032070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type UnShareImageRequest struct { core.JDCloudRequest /* 地域ID */ RegionId string `json:"regionId"` /* 镜像ID */ ImageId string `json:"imageId"` /* 需要取消的帐户 (Optional) */ Pins []string `json:"pins"` } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewUnShareImageRequest( regionId string, imageId string, ) *UnShareImageRequest { return &UnShareImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:unshare", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, } } /* * param regionId: 地域ID (Required) * param imageId: 镜像ID (Required) * param pins: 需要取消的帐户 (Optional) */ func NewUnShareImageRequestWithAllParams( regionId string, imageId string, pins []string, ) *UnShareImageRequest { return &UnShareImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:unshare", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, ImageId: imageId, Pins: pins, } } /* This constructor has better compatible ability when API parameters changed */ func NewUnShareImageRequestWithoutParam() *UnShareImageRequest { return &UnShareImageRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/images/{imageId}:unshare", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: 地域ID(Required) */ func (r *UnShareImageRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param imageId: 镜像ID(Required) */ func (r *UnShareImageRequest) SetImageId(imageId string) { r.ImageId = imageId } /* param pins: 需要取消的帐户(Optional) */ func (r *UnShareImageRequest) SetPins(pins []string) { r.Pins = pins } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r UnShareImageRequest) GetRegionId() string { return r.RegionId } type UnShareImageResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result UnShareImageResult `json:"result"` } type UnShareImageResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client/�������������������0000775�0000000�0000000�00000000000�13771713062�0027543�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client/VmClient.go��������0000664�0000000�0000000�00000102655�13771713062�0031624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package client import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vm "github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis" "encoding/json" "errors" ) type VmClient struct { core.JDCloudClient } func NewVmClient(credential *core.Credential) *VmClient { if credential == nil { return nil } config := core.NewConfig() config.SetEndpoint("vm.jdcloud-api.com") return &VmClient{ core.JDCloudClient{ Credential: *credential, Config: *config, ServiceName: "vm", Revision: "1.0.8", Logger: core.NewDefaultLogger(core.LogInfo), }} } func (c *VmClient) SetConfig(config *core.Config) { c.Config = *config } func (c *VmClient) SetLogger(logger core.Logger) { c.Logger = logger } /* 查询镜像共享帐户列表,只允许操作您的个人私有镜像。 */ func (c *VmClient) DescribeImageMembers(request *vm.DescribeImageMembersRequest) (*vm.DescribeImageMembersResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeImageMembersResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 为云主机创建私有镜像。云主机状态必须为<b>stopped</b>。<br> 云主机没有正在进行中的任务才可制作镜像。<br> 制作镜像以备份系统盘为基础,在此之上可选择全部或部分挂载数据盘制作整机镜像(如不做任何更改将默认制作整机镜像),制作镜像过程会为所挂载云硬盘创建快照并与镜像关联。<br> 调用接口后,需要等待镜像状态变为<b>ready</b>后,才能正常使用镜像。 */ func (c *VmClient) CreateImage(request *vm.CreateImageRequest) (*vm.CreateImageResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.CreateImageResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建一台或多台指定配置的云主机,创建模式分为三种:1.普通方式、2.使用高可用组、3.使用启动模板。三种方式创建云主机时参数的必传与非必传是不同的,具体请参考<a href="http://docs.jdcloud.com/virtual-machines/api/create_vm_sample">参数详细说明</a><br> - 创建云主机需要通过实名认证 - 实例规格 - 可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。 - 不能使用已下线、或已售馨的规格ID - 镜像 - Windows Server 2012 R2标准版 64位 中文版 SQL Server 2014 标准版 SP2内存需大于1GB; - Windows Server所有镜像CPU不可选超过64核CPU。 - 可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。 - 选择的镜像必须支持选择的实例规格。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimageconstraints">DescribeImageConstraints</a>接口获得指定镜像的实例规格限制信息。<br> - 网络配置 - 指定主网卡配置信息 - 必须指定subnetId - 可以指定elasticIp规格来约束创建的弹性IP,带宽取值范围[1-100]Mbps,步进1Mbps - 可以指定主网卡的内网主IP(primaryIpAddress),此时maxCount只能为1 - 安全组securityGroup需与子网Subnet在同一个私有网络VPC内 - 一台云主机创建时必须指定一个安全组,至多指定5个安全组,如果没有指定安全组,默认使用默认安全组 - 主网卡deviceIndex设置为1 - 存储 - 系统盘 - 磁盘分类,系统盘支持local或cloud - 磁盘大小 - local:不能指定大小,默认为40GB - cloud:取值范围: 40-500GB,并且不能小于镜像的最小系统盘大小,如果没有指定,默认以镜像中的系统盘大小为准 - 自动删除 - 如果是local,默认自动删除,不能修改此属性 - 如果是cloud类型的按配置计费的云硬盘,可以指定为True - 数据盘 - 磁盘分类,数据盘仅支持cloud - 云硬盘类型可以选择ssd、premium-hdd - 磁盘大小 - premium-hdd:范围[20,3000]GB,步长为10G - ssd:范围[20,1000]GB,步长为10G - 自动删除 - 默认自动删除,如果是包年包月的数据盘或共享型数据盘,此参数不生效 - 可以指定SnapshotId创建云硬盘 - 可以从快照创建磁盘 - local类型系统的云主机可以挂载8块云硬盘 - cloud类型系统的云主机可以挂载7块云硬盘 - 计费 - 弹性IP的计费模式,如果选择按用量类型可以单独设置,其它计费模式都以主机为准 - 云硬盘的计费模式以主机为准 - 其他 - 创建完成后,主机状态为running - 仅Linux系统云主机可以指定密钥 - maxCount为最大努力,不保证一定能达到maxCount - 虚机的az会覆盖磁盘的az属性 - 密码 - <a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a> */ func (c *VmClient) CreateInstances(request *vm.CreateInstancesRequest) (*vm.CreateInstancesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.CreateInstancesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 为云主机主网卡下的主内网IP绑定弹性公网IP。<br> 一台云主机只能绑定一个弹性公网IP(主网卡),若主网卡已存在弹性公网IP,会返回错误。<br> */ func (c *VmClient) AssociateElasticIp(request *vm.AssociateElasticIpRequest) (*vm.AssociateElasticIpResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.AssociateElasticIpResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 共享镜像,只允许操作您的个人私有镜像,单个镜像最多可共享给20个京东云帐户。<br> 整机镜像目前不支持共享。 */ func (c *VmClient) ShareImage(request *vm.ShareImageRequest) (*vm.ShareImageResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ShareImageResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 云主机解绑弹性公网IP,解绑的是主网卡、内网主IP对应的弹性公网IP。 */ func (c *VmClient) DisassociateElasticIp(request *vm.DisassociateElasticIpRequest) (*vm.DisassociateElasticIpResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DisassociateElasticIpResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 停止单个云主机,只能停止<b>running</b>状态的云主机,云主机没有正在进行中的任务才可停止 */ func (c *VmClient) StopInstance(request *vm.StopInstanceRequest) (*vm.StopInstanceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.StopInstanceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 启动单个云主机,只能启动<b>stopped</b>状态的云主机,云主机没有正在进行中的任务才可启动。<br> 只能启动正常计费状态的云主机。 */ func (c *VmClient) StartInstance(request *vm.StartInstanceRequest) (*vm.StartInstanceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.StartInstanceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询镜像信息列表。<br> 通过此接口可以查询到京东云官方镜像、第三方镜像、私有镜像、或其他用户共享给您的镜像。<br> 此接口支持分页查询,默认每页20条。 */ func (c *VmClient) DescribeImages(request *vm.DescribeImagesRequest) (*vm.DescribeImagesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeImagesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询镜像的实例规格限制。<br> 通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。 */ func (c *VmClient) DescribeImageConstraints(request *vm.DescribeImageConstraintsRequest) (*vm.DescribeImageConstraintsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeImageConstraintsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 获取云主机vnc,用于连接管理云主机。<br> vnc地址的有效期为1个小时,调用接口获取vnc地址后如果1个小时内没有使用,vnc地址自动失效,再次使用需要重新获取。 */ func (c *VmClient) DescribeInstanceVncUrl(request *vm.DescribeInstanceVncUrlRequest) (*vm.DescribeInstanceVncUrlResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeInstanceVncUrlResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 云主机使用指定镜像重置云主机系统<br> 云主机的状态必须为<b>stopped</b>状态。<br> 若当前云主机的系统盘类型为local类型,那么更换的镜像必须为localDisk类型的镜像;同理若当前云主机的系统盘为cloud类型,那么更换的镜像必须为cloudDisk类型的镜像。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。<br> 若不指定镜像ID,默认使用当前主机的原镜像重置系统。<br> 指定的镜像必须能够支持当前主机的实例规格(instanceType),否则会返回错误。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimageconstraints">DescribeImageConstraints</a>接口获得指定镜像支持的系统盘类型信息。 */ func (c *VmClient) RebuildInstance(request *vm.RebuildInstanceRequest) (*vm.RebuildInstanceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.RebuildInstanceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 取消共享镜像,只允许操作您的个人私有镜像。 */ func (c *VmClient) UnShareImage(request *vm.UnShareImageRequest) (*vm.UnShareImageResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.UnShareImageResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改云主机部分信息,包括名称、描述。 */ func (c *VmClient) ModifyInstanceAttribute(request *vm.ModifyInstanceAttributeRequest) (*vm.ModifyInstanceAttributeResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ModifyInstanceAttributeResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 云主机变更实例规格<br> 云主机的状态必须为<b>stopped</b>状态。<br> 16年创建的云硬盘做系统盘的主机,一代与二代实例规格不允许相互调整。<br> 本地盘(local类型)做系统盘的主机,一代与二代实例规格不允许相互调整。<br> 使用高可用组(Ag)创建的主机,一代与二代实例规格不允许相互调整。<br> 云硬盘(cloud类型)做系统盘的主机,一代与二代实例规格允许相互调整。<br> 如果当前主机中的弹性网卡数量,大于新实例规格允许的弹性网卡数量,会返回错误。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域及可用区下的实例规格信息。<br> 当前主机所使用的镜像,需要支持要变更的目标实例规格,否则返回错误。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimageconstraints">DescribeImageConstraints</a>接口获得指定镜像的实例规格限制信息。<br> 云主机欠费或到期时,无法更改实例规格。 */ func (c *VmClient) ResizeInstance(request *vm.ResizeInstanceRequest) (*vm.ResizeInstanceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ResizeInstanceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 批量查询镜像的实例规格限制。<br> 通过此接口可以查看镜像不支持的实例规格。只有官方镜像、第三方镜像有实例规格的限制,个人的私有镜像没有此限制。 */ func (c *VmClient) DescribeImageConstraintsBatch(request *vm.DescribeImageConstraintsBatchRequest) (*vm.DescribeImageConstraintsBatchResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeImageConstraintsBatchResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 为一台云主机挂载一块数据盘(云硬盘),云主机和云硬盘没有正在进行中的的任务时才可挂载。<br> 云主机状态必须是<b>running</b>或<b>stopped</b>状态。<br> 本地盘(local类型)做系统盘的云主机可挂载8块数据盘,云硬盘(cloud类型)做系统盘的云主机可挂载7块数据盘。 */ func (c *VmClient) AttachDisk(request *vm.AttachDiskRequest) (*vm.AttachDiskResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.AttachDiskResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改云主机密码,主机没有正在进行中的任务时才可操作。<br> 修改密码后,需要重启云主机后生效。 */ func (c *VmClient) ModifyInstancePassword(request *vm.ModifyInstancePasswordRequest) (*vm.ModifyInstancePasswordResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ModifyInstancePasswordResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除一个私有镜像,只允许操作您的个人私有镜像。<br> 若镜像已共享给其他用户,需先取消共享才可删除。 */ func (c *VmClient) DeleteImage(request *vm.DeleteImageRequest) (*vm.DeleteImageResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DeleteImageResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询实例规格信息列表 */ func (c *VmClient) DescribeInstanceTypes(request *vm.DescribeInstanceTypesRequest) (*vm.DescribeInstanceTypesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeInstanceTypesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 云主机挂载一块弹性网卡。<br> 云主机状态必须为<b>running</b>或<b>stopped</b>状态,并且没有正在进行中的任务才可操作。<br> 弹性网卡上如果绑定了公网IP,那么公网IP所在az需要与云主机的az保持一致,或者公网IP属于全可用区,才可挂载。<br> 云主机挂载弹性网卡的数量,不能超过实例规格的限制。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定规格可挂载弹性网卡的数量上限。<br> 弹性网卡与云主机必须在相同vpc下。 */ func (c *VmClient) AttachNetworkInterface(request *vm.AttachNetworkInterfaceRequest) (*vm.AttachNetworkInterfaceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.AttachNetworkInterfaceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除ssh密钥对。 */ func (c *VmClient) DeleteKeypair(request *vm.DeleteKeypairRequest) (*vm.DeleteKeypairResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DeleteKeypairResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询镜像详情。 */ func (c *VmClient) DescribeImage(request *vm.DescribeImageRequest) (*vm.DescribeImageResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeImageResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 云主机缷载一块弹性网卡。<br> 云主机状态必须为<b>running</b>或<b>stopped</b>状态,并且没有正在进行中的任务才可操作。<br> 不能缷载主网卡。 */ func (c *VmClient) DetachNetworkInterface(request *vm.DetachNetworkInterfaceRequest) (*vm.DetachNetworkInterfaceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DetachNetworkInterfaceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 导入由其他工具生成的密钥对的公钥部分。<br> 若传入已存在的密钥名称,会返回错误。 */ func (c *VmClient) ImportKeypair(request *vm.ImportKeypairRequest) (*vm.ImportKeypairResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ImportKeypairResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 镜像跨区复制,将私有镜像复制到其它地域下,只允许操作您的个人私有镜像。<br> 只支持rootDeviceType为cloudDisk的云硬盘系统盘镜像操作。 */ func (c *VmClient) CopyImages(request *vm.CopyImagesRequest) (*vm.CopyImagesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.CopyImagesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询一台云主机的详细信息 */ func (c *VmClient) DescribeInstance(request *vm.DescribeInstanceRequest) (*vm.DescribeInstanceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeInstanceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改虚机弹性网卡属性,包括是否随云主机一起删除。<br> 不能修改主网卡。 */ func (c *VmClient) ModifyInstanceNetworkAttribute(request *vm.ModifyInstanceNetworkAttributeRequest) (*vm.ModifyInstanceNetworkAttributeResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ModifyInstanceNetworkAttributeResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询配额,支持:云主机、镜像、密钥、模板、镜像共享 */ func (c *VmClient) DescribeQuotas(request *vm.DescribeQuotasRequest) (*vm.DescribeQuotasResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeQuotasResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改镜像信息,包括名称、描述;只允许操作您的个人私有镜像。 */ func (c *VmClient) ModifyImageAttribute(request *vm.ModifyImageAttributeRequest) (*vm.ModifyImageAttributeResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ModifyImageAttributeResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 重启单个云主机,只能重启<b>running</b>状态的云主机,云主机没有正在进行中的任务才可重启。 */ func (c *VmClient) RebootInstance(request *vm.RebootInstanceRequest) (*vm.RebootInstanceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.RebootInstanceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改云主机挂载的数据盘属性,包括是否随主机删除。 */ func (c *VmClient) ModifyInstanceDiskAttribute(request *vm.ModifyInstanceDiskAttributeRequest) (*vm.ModifyInstanceDiskAttributeResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.ModifyInstanceDiskAttributeResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 批量查询云主机内网IP地址,查询的是主网卡内网主IP地址。 */ func (c *VmClient) DescribeInstancePrivateIpAddress(request *vm.DescribeInstancePrivateIpAddressRequest) (*vm.DescribeInstancePrivateIpAddressResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeInstancePrivateIpAddressResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 批量查询云主机状态 */ func (c *VmClient) DescribeInstanceStatus(request *vm.DescribeInstanceStatusRequest) (*vm.DescribeInstanceStatusResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeInstanceStatusResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 批量查询密钥对。<br> 此接口支持分页查询,默认每页20条。 */ func (c *VmClient) DescribeKeypairs(request *vm.DescribeKeypairsRequest) (*vm.DescribeKeypairsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeKeypairsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 云主机缷载数据盘,云主机和云硬盘没有正在进行中的任务时才可缷载。<br> */ func (c *VmClient) DetachDisk(request *vm.DetachDiskRequest) (*vm.DetachDiskResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DetachDiskResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除按配置计费、或包年包月已到期的单个云主机。不能删除没有计费信息的云主机。<br> 云主机状态必须为运行<b>running</b>、停止<b>stopped</b>、错误<b>error</b>,同时云主机没有正在进行中的任务才可删除。<br> 包年包月未到期的云主机不能删除。<br> 如果主机中挂载的数据盘为按配置计费的云硬盘,并且不是共享型云硬盘,并且AutoDelete属性为true,那么数据盘会随主机一起删除。 [MFA enabled] */ func (c *VmClient) DeleteInstance(request *vm.DeleteInstanceRequest) (*vm.DeleteInstanceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DeleteInstanceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 批量查询云主机的详细信息<br> 此接口支持分页查询,默认每页20条。 */ func (c *VmClient) DescribeInstances(request *vm.DescribeInstancesRequest) (*vm.DescribeInstancesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.DescribeInstancesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建ssh密钥对。公钥部分存储在京东云,并返回未加密的 PEM 编码的 PKCS#8 格式私钥,您只有一次机会保存您的私钥。请妥善保管。<br> 若传入已存在的密钥名称,会返回错误。 */ func (c *VmClient) CreateKeypair(request *vm.CreateKeypairRequest) (*vm.CreateKeypairResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vm.CreateKeypairResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } �����������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/�������������������0000775�0000000�0000000�00000000000�13771713062�0027550�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Ag.go��������������0000664�0000000�0000000�00000001507�13771713062�0030431�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Ag struct { /* 高可用组名称 (Optional) */ Name string `json:"name"` /* 高可用组id (Optional) */ Id string `json:"id"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/CopyImage.go�������0000664�0000000�0000000�00000001605�13771713062�0031756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type CopyImage struct { /* 复制后的目标镜像ID (Optional) */ DestinationImageId string `json:"destinationImageId"` /* 源镜像ID (Optional) */ SourceImageId string `json:"sourceImageId"` } ���������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Gpu.go�������������0000664�0000000�0000000�00000001501�13771713062�0030627�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Gpu struct { /* GPU型号 (Optional) */ Model string `json:"model"` /* GPU数量 (Optional) */ Number int `json:"number"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Image.go�����������0000664�0000000�0000000�00000005134�13771713062�0031124�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Image struct { /* 镜像ID (Optional) */ ImageId string `json:"imageId"` /* 镜像名称 (Optional) */ Name string `json:"name"` /* 镜像的操作系统发行版。取值:Ubuntu,CentOS,Windows Server (Optional) */ Platform string `json:"platform"` /* 镜像的操作系统版本。 (Optional) */ OsVersion string `json:"osVersion"` /* 镜像架构。取值:i386,x86_64 (Optional) */ Architecture string `json:"architecture"` /* 镜像系统盘大小 (Optional) */ SystemDiskSizeGB int `json:"systemDiskSizeGB"` /* 镜像来源。取值:jcloud:官方镜像;marketplace:镜像市场镜像;self:用户自己的镜像;shared:其他用户分享的镜像 (Optional) */ ImageSource string `json:"imageSource"` /* 镜像的操作系统类型。取值:windows,linux (Optional) */ OsType string `json:"osType"` /* <a href="http://docs.jdcloud.com/virtual-machines/api/image_status">参考镜像状态</a> (Optional) */ Status string `json:"status"` /* 创建时间 (Optional) */ CreateTime string `json:"createTime"` /* 镜像文件实际大小 (Optional) */ SizeMB int `json:"sizeMB"` /* 镜像描述 (Optional) */ Desc string `json:"desc"` /* 镜像系统盘配置 (Optional) */ SystemDisk InstanceDiskAttachment `json:"systemDisk"` /* 镜像数据盘映射信息 (Optional) */ DataDisks []InstanceDiskAttachment `json:"dataDisks"` /* 创建云盘系统盘所使用的云硬盘快照ID。系统盘类型为本地盘的镜像,此参数为空。 (Optional) */ SnapshotId string `json:"snapshotId"` /* 镜像支持的系统盘类型。取值:localDisk:本地盘系统盘;cloudDisk:云盘系统盘。 (Optional) */ RootDeviceType string `json:"rootDeviceType"` /* 镜像复制和转换时的进度,仅显示数值,单位为百分比 (Optional) */ Progress string `json:"progress"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/ImageConstraint.go�0000664�0000000�0000000�00000001660�13771713062�0033171�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ImageConstraint struct { /* 镜像ID (Optional) */ ImageId string `json:"imageId"` /* 使用镜像创建实例的规格限制 (Optional) */ ImageInstanceTypeConstraint ImageInstanceTypeConstraint `json:"imageInstanceTypeConstraint"` } ��������������������������������������������������������������������������������ImageInstanceTypeConstraint.go����������������������������������������������������������������������0000664�0000000�0000000�00000001741�13771713062�0035441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ImageInstanceTypeConstraint struct { /* 限制类型。取值:excludes:不支持的实例类型;includes:支持的实例类型。 (Optional) */ ConstraintsType string `json:"constraintsType"` /* 实例规格列表 (Optional) */ InstanceTypes []string `json:"instanceTypes"` } �������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Instance.go��������0000664�0000000�0000000�00000005625�13771713062�0031653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" import disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models" type Instance struct { /* 云主机ID (Optional) */ InstanceId string `json:"instanceId"` /* 云主机名称 (Optional) */ InstanceName string `json:"instanceName"` /* 实例规格 (Optional) */ InstanceType string `json:"instanceType"` /* 主网卡所属VPC的ID (Optional) */ VpcId string `json:"vpcId"` /* 主网卡所属子网的ID (Optional) */ SubnetId string `json:"subnetId"` /* 主网卡主IP地址 (Optional) */ PrivateIpAddress string `json:"privateIpAddress"` /* 主网卡主IP绑定弹性IP的ID (Optional) */ ElasticIpId string `json:"elasticIpId"` /* 主网卡主IP绑定弹性IP的地址 (Optional) */ ElasticIpAddress string `json:"elasticIpAddress"` /* 云主机状态,<a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> (Optional) */ Status string `json:"status"` /* 云主机描述 (Optional) */ Description string `json:"description"` /* 镜像ID (Optional) */ ImageId string `json:"imageId"` /* 系统盘配置 (Optional) */ SystemDisk InstanceDiskAttachment `json:"systemDisk"` /* 数据盘配置 (Optional) */ DataDisks []InstanceDiskAttachment `json:"dataDisks"` /* 主网卡配置 (Optional) */ PrimaryNetworkInterface InstanceNetworkInterfaceAttachment `json:"primaryNetworkInterface"` /* 辅助网卡配置 (Optional) */ SecondaryNetworkInterfaces []InstanceNetworkInterfaceAttachment `json:"secondaryNetworkInterfaces"` /* 创建时间 (Optional) */ LaunchTime string `json:"launchTime"` /* 云主机所在可用区 (Optional) */ Az string `json:"az"` /* 密钥对名称 (Optional) */ KeyNames []string `json:"keyNames"` /* 计费信息 (Optional) */ Charge charge.Charge `json:"charge"` /* 高可用组,如果创建云主机使用了高可用组,此处可展示高可用组名称 (Optional) */ Ag Ag `json:"ag"` /* 高可用组中的错误域 (Optional) */ FaultDomain string `json:"faultDomain"` /* Tag信息 (Optional) */ Tags []disk.Tag `json:"tags"` } �����������������������������������������������������������������������������������������������������������InstanceDiskAttachment.go���������������������������������������������������������������������������0000664�0000000�0000000�00000003707�13771713062�0034417�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models" type InstanceDiskAttachment struct { /* 磁盘分类,取值为本地盘(local)或者数据盘(cloud)。 系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 数据盘仅支持云硬盘(cloud)。 (Optional) */ DiskCategory string `json:"diskCategory"` /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 (Optional) */ AutoDelete bool `json:"autoDelete"` /* 本地磁盘配置 (Optional) */ LocalDisk LocalDisk `json:"localDisk"` /* 云硬盘配置 (Optional) */ CloudDisk disk.Disk `json:"cloudDisk"` /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi (Optional) */ DeviceName string `json:"deviceName"` /* 数据盘挂载状态,取值范围:attaching,detaching,attached,detached,error_attach,error_detach (Optional) */ Status string `json:"status"` } ���������������������������������������������������������InstanceDiskAttachmentSpec.go�����������������������������������������������������������������������0000664�0000000�0000000�00000004404�13771713062�0035225�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models" type InstanceDiskAttachmentSpec struct { /* 磁盘分类,取值为本地盘(local)或者云硬盘(cloud)。 系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 数据盘仅支持云硬盘(cloud)。 (Optional) */ DiskCategory *string `json:"diskCategory"` /* 是否随云主机一起删除,即删除主机时是否自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 (Optional) */ AutoDelete *bool `json:"autoDelete"` /* 数据盘配置 (Optional) */ CloudDiskSpec *disk.DiskSpec `json:"cloudDiskSpec"` /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi (Optional) */ DeviceName *string `json:"deviceName"` /* 排除设备,使用此参数noDevice配合deviceName一起使用。 创建整机镜像:如deviceName:vdb、noDevice:true,则表示云主机中的数据盘vdb不参与创建镜像。 创建模板:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb不参与创建主机。 创建主机:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb,或者模板(使用模板创建主机)中的数据盘vdb不参与创建主机。 (Optional) */ NoDevice *bool `json:"noDevice"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceDiskAttribute.go����������������������������������������������������������������������������0000664�0000000�0000000�00000002176�13771713062�0034271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceDiskAttribute struct { /* 云硬盘ID (Optional) */ DiskId *string `json:"diskId"` /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为false,本地盘(local)不能更改此值。 如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 (Optional) */ AutoDelete *bool `json:"autoDelete"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceNetworkAttribute.go�������������������������������������������������������������������������0000664�0000000�0000000�00000001635�13771713062�0035027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceNetworkAttribute struct { /* 弹性网卡ID (Optional) */ NetworkInterfaceId *string `json:"networkInterfaceId"` /* 随主机自动删除,默认为False (Optional) */ AutoDelete *bool `json:"autoDelete"` } ���������������������������������������������������������������������������������������������������InstanceNetworkInterface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002747�13771713062�0034771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" type InstanceNetworkInterface struct { /* 弹性网卡ID (Optional) */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 以太网地址 (Optional) */ MacAddress string `json:"macAddress"` /* 虚拟网络ID (Optional) */ VpcId string `json:"vpcId"` /* 子网ID (Optional) */ SubnetId string `json:"subnetId"` /* (Optional) */ SecurityGroups []SecurityGroupSimple `json:"securityGroups"` /* 源和目标IP地址校验,取值为0或者1 (Optional) */ SanityCheck int `json:"sanityCheck"` /* 网卡主IP (Optional) */ PrimaryIp vpc.NetworkInterfacePrivateIp `json:"primaryIp"` /* 网卡辅IP (Optional) */ SecondaryIps []vpc.NetworkInterfacePrivateIp `json:"secondaryIps"` } �������������������������InstanceNetworkInterfaceAttachment.go���������������������������������������������������������������0000664�0000000�0000000�00000002046�13771713062�0036772�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceNetworkInterfaceAttachment struct { /* 设备Index (Optional) */ DeviceIndex int `json:"deviceIndex"` /* 指明删除实例时是否删除网卡,默认true;当前只能是true (Optional) */ AutoDelete bool `json:"autoDelete"` /* 网卡接口规范 (Optional) */ NetworkInterface InstanceNetworkInterface `json:"networkInterface"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceNetworkInterfaceAttachmentSpec.go�����������������������������������������������������������0000664�0000000�0000000�00000002006�13771713062�0037601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" type InstanceNetworkInterfaceAttachmentSpec struct { /* 网卡设备Index,主网卡只能是1 (Optional) */ DeviceIndex *int `json:"deviceIndex"` /* 网卡接口规范 (Optional) */ NetworkInterface *vpc.NetworkInterfaceSpec `json:"networkInterface"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstancePrivateIpAddress.go�������������������������������������������������������������������������0000664�0000000�0000000�00000001612�13771713062�0034716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstancePrivateIpAddress struct { /* 云主机ID (Optional) */ InstanceId string `json:"instanceId"` /* 主网卡内网主IP地址 (Optional) */ PrivateIpAddress string `json:"privateIpAddress"` } ����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceSpec.go����0000664�0000000�0000000�00000007002�13771713062�0032455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" type InstanceSpec struct { /* 高可用组Id。指定了此参数后,只能通过高可用组关联的实例模板创建虚机,并且实例模板中的参数不可覆盖替换。实例模板以外的参数还可以指定。 (Optional) */ AgId *string `json:"agId"` /* 实例模板id,如果没有使用高可用组,那么对于实例模板中没有的信息,需要使用创建虚机的参数进行补充,或者选择覆盖启动模板中的参数。 (Optional) */ InstanceTemplateId *string `json:"instanceTemplateId"` /* 云主机所属的可用区。 (Optional) */ Az *string `json:"az"` /* 实例规格。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。 (Optional) */ InstanceType *string `json:"instanceType"` /* 镜像ID。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。 (Optional) */ ImageId *string `json:"imageId"` /* 云主机名称,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 */ Name string `json:"name"` /* 密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ Password *string `json:"password"` /* 密钥对名称,当前只支持传入一个。 (Optional) */ KeyNames []string `json:"keyNames"` /* 主网卡主IP关联的弹性IP规格 (Optional) */ ElasticIp *vpc.ElasticIpSpec `json:"elasticIp"` /* 主网卡配置信息 (Optional) */ PrimaryNetworkInterface *InstanceNetworkInterfaceAttachmentSpec `json:"primaryNetworkInterface"` /* 系统盘配置信息 (Optional) */ SystemDisk *InstanceDiskAttachmentSpec `json:"systemDisk"` /* 数据盘配置信息,本地盘(local类型)做系统盘的云主机可挂载8块数据盘,云硬盘(cloud类型)做系统盘的云主机可挂载7块数据盘。 (Optional) */ DataDisks []InstanceDiskAttachmentSpec `json:"dataDisks"` /* 计费配置 云主机不支持按用量方式计费,默认为按配置计费。 打包创建数据盘的情况下,数据盘的计费方式只能与云主机保持一致。 打包创建弹性公网IP的情况下,若公网IP的计费方式没有指定为按用量计费,那么公网IP计费方式只能与云主机保持一致。 (Optional) */ Charge *charge.ChargeSpec `json:"charge"` /* 主机描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ Description *string `json:"description"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceStatus.go��0000664�0000000�0000000�00000001654�13771713062�0033055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceStatus struct { /* 云主机ID (Optional) */ InstanceId string `json:"instanceId"` /* <a href="http://docs.jdcloud.com/virtual-machines/api/vm_status">参考云主机状态</a> (Optional) */ Status string `json:"status"` } ������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceTemplate.go0000664�0000000�0000000�00000002301�13771713062�0033333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplate struct { /* 启动模板ID (Optional) */ Id string `json:"id"` /* 启动模板名称 (Optional) */ Name string `json:"name"` /* 启动模板描述 (Optional) */ Description string `json:"description"` /* 启动模板的数据 (Optional) */ InstanceTemplateData InstanceTemplateData `json:"instanceTemplateData"` /* 关联的高可用组(ag)信息 (Optional) */ Ags []Ag `json:"ags"` /* 创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateData.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000003450�13771713062�0034054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateData struct { /* 实例规格 (Optional) */ InstanceType string `json:"instanceType"` /* 主网卡所属VPC的ID (Optional) */ VpcId string `json:"vpcId"` /* 镜像ID (Optional) */ ImageId string `json:"imageId"` /* 启动模板中是否包含自定义密码,true:包含密码,false:不包含密码 (Optional) */ IncludePassword bool `json:"includePassword"` /* 系统盘信息 (Optional) */ SystemDisk InstanceTemplateDiskAttachment `json:"systemDisk"` /* 数据盘信息,本地盘(local类型)做系统盘的云主机可挂载8块数据盘,云硬盘(cloud类型)做系统盘的云主机可挂载7块数据盘。 (Optional) */ DataDisks []InstanceTemplateDiskAttachment `json:"dataDisks"` /* 主网卡信息 (Optional) */ PrimaryNetworkInterface InstanceTemplateNetworkInterfaceAttachmentSpec `json:"primaryNetworkInterface"` /* 主网卡主IP关联的弹性IP规格 (Optional) */ ElasticIp InstanceTemplateElasticIp `json:"elasticIp"` /* 密钥对名称;当前只支持一个 (Optional) */ KeyNames []string `json:"keyNames"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateDisk.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000002153�13771713062�0034074�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateDisk struct { /* 云硬盘类型,取值为 ssd 或 premium-hdd (Optional) */ DiskType string `json:"diskType"` /* 云硬盘大小,单位为 GiB;ssd 类型取值范围[20,1000]GB,步长为10G,premium-hdd 类型取值范围[20,3000]GB,步长为10G (Optional) */ DiskSizeGB int `json:"diskSizeGB"` /* 用于创建云硬盘的快照ID (Optional) */ SnapshotId string `json:"snapshotId"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateDiskAttachment.go�������������������������������������������������������������������0000664�0000000�0000000�00000004374�13771713062�0036114�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateDiskAttachment struct { /* 磁盘分类,取值为本地盘(local)或者数据盘(cloud)。 系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 数据盘仅支持云硬盘(cloud)。 (Optional) */ DiskCategory string `json:"diskCategory"` /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 (Optional) */ AutoDelete bool `json:"autoDelete"` /* 数据盘配置 (Optional) */ InstanceTemplateDisk InstanceTemplateDisk `json:"instanceTemplateDisk"` /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi。系统盘不需要使用,数据盘时才能够使用。 (Optional) */ DeviceName string `json:"deviceName"` /* 排除设备,使用此参数noDevice配合deviceName一起使用。 创建整机镜像:如deviceName:vdb、noDevice:true,则表示云主机中的数据盘vdb不参与创建镜像。 创建模板:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb不参与创建主机。 创建主机:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb,或者模板(使用模板创建主机)中的数据盘vdb不参与创建主机。 (Optional) */ NoDevice bool `json:"noDevice"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateDiskAttachmentSpec.go���������������������������������������������������������������0000664�0000000�0000000�00000003634�13771713062�0036725�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateDiskAttachmentSpec struct { /* 磁盘分类,取值为本地盘(local)或者数据盘(cloud)。 系统盘支持本地盘(local)或者云硬盘(cloud)。系统盘选择local类型,必须使用localDisk类型的镜像;同理系统盘选择cloud类型,必须使用cloudDisk类型的镜像。 数据盘仅支持云硬盘(cloud)。 (Optional) */ DiskCategory string `json:"diskCategory"` /* 随云主机一起删除,删除主机时自动删除此磁盘,默认为true,本地盘(local)不能更改此值。 如果云主机中的数据盘(cloud)是包年包月计费方式,此参数不生效。 如果云主机中的数据盘(cloud)是共享型数据盘,此参数不生效。 (Optional) */ AutoDelete bool `json:"autoDelete"` /* 数据盘规格 (Optional) */ CloudDiskSpec InstanceTemplateDiskSpec `json:"cloudDiskSpec"` /* 数据盘逻辑挂载点,取值范围:vda,vdb,vdc,vdd,vde,vdf,vdg,vdh,vdi (Optional) */ DeviceName string `json:"deviceName"` /* 排除设备,使用此参数noDevice配合deviceName一起使用。 创建模板:如deviceName:vdb、noDevice:true,则表示镜像中的数据盘vdb不参与创建主机。 (Optional) */ NoDevice bool `json:"noDevice"` } ����������������������������������������������������������������������������������������������������InstanceTemplateDiskSpec.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002157�13771713062�0034713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateDiskSpec struct { /* 云硬盘类型,取值为 ssd 或 premium-hdd (Optional) */ DiskType string `json:"diskType"` /* 云硬盘大小,单位为 GiB;ssd 类型取值范围[20,1000]GB,步长为10G,premium-hdd 类型取值范围[20,3000]GB,步长为10G (Optional) */ DiskSizeGB int `json:"diskSizeGB"` /* 用于创建云硬盘的快照ID (Optional) */ SnapshotId string `json:"snapshotId"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateElasticIp.go������������������������������������������������������������������������0000664�0000000�0000000�00000002025�13771713062�0035055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateElasticIp struct { /* 弹性公网IP的限速(单位:MB) */ BandwidthMbps int `json:"bandwidthMbps"` /* IP服务商,取值为BGP,nonBGP (Optional) */ Provider string `json:"provider"` /* 计费类型,支持按带宽计费(bandwith),按流量计费(flow) */ ChargeMode string `json:"chargeMode"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateElasticIpSpec.go��������������������������������������������������������������������0000664�0000000�0000000�00000002031�13771713062�0035665�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateElasticIpSpec struct { /* 弹性公网IP的限速(单位:MB) */ BandwidthMbps int `json:"bandwidthMbps"` /* IP服务商,取值为BGP,nonBGP (Optional) */ Provider string `json:"provider"` /* 计费类型,支持按带宽计费(bandwith),按流量计费(flow) */ ChargeMode string `json:"chargeMode"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateNetworkInterfaceAttachmentSpec.go���������������������������������������������������0000664�0000000�0000000�00000002205�13771713062�0041276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateNetworkInterfaceAttachmentSpec struct { /* 设备Index;主网卡的index必须为1;当前仅支持主网卡 (Optional) */ DeviceIndex int `json:"deviceIndex"` /* 指明删除实例时是否删除网卡,默认true;当前只能是true (Optional) */ AutoDelete bool `json:"autoDelete"` /* 网卡接口规范;此字段当前必填 */ NetworkInterface InstanceTemplateNetworkInterfaceSpec `json:"networkInterface"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������InstanceTemplateNetworkInterfaceSpec.go�������������������������������������������������������������0000664�0000000�0000000�00000001747�13771713062�0037277�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateNetworkInterfaceSpec struct { /* 子网ID */ SubnetId string `json:"subnetId"` /* 安全组ID列表 (Optional) */ SecurityGroups []string `json:"securityGroups"` /* PortSecurity,取值为0或者1,默认为1 (Optional) */ SanityCheck int `json:"sanityCheck"` } �������������������������InstanceTemplateSpec.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000003601�13771713062�0034073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTemplateSpec struct { /* 实例规格,可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。 */ InstanceType string `json:"instanceType"` /* 镜像ID,可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。 */ ImageId string `json:"imageId"` /* 密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */ Password string `json:"password"` /* 密钥对名称;当前只支持一个 (Optional) */ KeyNames []string `json:"keyNames"` /* 主网卡主IP关联的弹性IP规格 (Optional) */ ElasticIp InstanceTemplateElasticIpSpec `json:"elasticIp"` /* 主网卡配置信息 */ PrimaryNetworkInterface InstanceTemplateNetworkInterfaceAttachmentSpec `json:"primaryNetworkInterface"` /* 系统盘配置信息 */ SystemDisk InstanceTemplateDiskAttachmentSpec `json:"systemDisk"` /* 数据盘配置信息 (Optional) */ DataDisks []InstanceTemplateDiskAttachmentSpec `json:"dataDisks"` } �������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/InstanceType.go����0000664�0000000�0000000�00000002620�13771713062�0032505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceType struct { /* 实例规格类型 (Optional) */ Family string `json:"family"` /* 实例规格,比如g.b1.2xlarge (Optional) */ InstanceType string `json:"instanceType"` /* cpu个数 (Optional) */ Cpu int `json:"cpu"` /* 内存大小 (Optional) */ MemoryMB int `json:"memoryMB"` /* 支持弹性网卡的数量 (Optional) */ NicLimit int `json:"nicLimit"` /* 描述 (Optional) */ Desc string `json:"desc"` /* 规格状态 (Optional) */ State []InstanceTypeState `json:"state"` /* Gpu配置 (Optional) */ Gpu Gpu `json:"gpu"` /* 本地缓存盘配置,目前只有Gpu规格上才有 (Optional) */ LocalDisks []LocalDisk `json:"localDisks"` } ����������������������������������������������������������������������������������������������������������������InstanceTypeState.go��������������������������������������������������������������������������������0000664�0000000�0000000�00000001576�13771713062�0033440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type InstanceTypeState struct { /* 可用区 (Optional) */ Az string `json:"az"` /* 可售卖情况,true:可售卖、false:已售罄不可用 (Optional) */ InStock bool `json:"inStock"` } ����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Keypair.go���������0000664�0000000�0000000�00000002010�13771713062�0031474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Keypair struct { /* 密钥对名称 (Optional) */ KeyName string `json:"keyName"` /* 密钥对的指纹,根据 RFC4716 定义的公钥指纹格式,采用 MD5 信息摘要算法。 (Optional) */ KeyFingerprint string `json:"keyFingerprint"` /* 创建时间 (Optional) */ CreateTime string `json:"createTime"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/LocalDisk.go�������0000664�0000000�0000000�00000001574�13771713062�0031753�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type LocalDisk struct { /* 磁盘类型,取值范围{premium-hdd, ssd} (Optional) */ DiskType string `json:"diskType"` /* 磁盘大小 (Optional) */ DiskSizeGB int `json:"diskSizeGB"` } ������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Quota.go�����������0000664�0000000�0000000�00000001702�13771713062�0031170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Quota struct { /* 资源类型[instance,keypair,image,instanceTemplate] (Optional) */ ResourceType string `json:"resourceType"` /* 配额上限 (Optional) */ Limit int `json:"limit"` /* 已用配额 (Optional) */ Used int `json:"used"` } ��������������������������������������������������������������SecurityGroupSimple.go������������������������������������������������������������������������������0000664�0000000�0000000�00000001546�13771713062�0034024�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models���������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type SecurityGroupSimple struct { /* 安全组ID (Optional) */ GroupId string `json:"groupId"` /* 安全组名称 (Optional) */ GroupName string `json:"groupName"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/Tag.go�������������0000664�0000000�0000000�00000001470�13771713062�0030614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Tag struct { /* Tag键 (Optional) */ Key string `json:"key"` /* Tag值 (Optional) */ Value string `json:"value"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models/TagFilter.go�������0000664�0000000�0000000�00000001502�13771713062�0031756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type TagFilter struct { /* Tag键 (Optional) */ Key string `json:"key"` /* Tag值 (Optional) */ Values []string `json:"values"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/�������������������������0000775�0000000�0000000�00000000000�13771713062�0026433�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/��������������������0000775�0000000�0000000�00000000000�13771713062�0027367�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AddNetworkAclRules.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000007570�13771713062�0033345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type AddNetworkAclRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` /* networkAcl规则列表 */ NetworkAclRuleSpecs []vpc.AddNetworkAclRuleSpec `json:"networkAclRuleSpecs"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param networkAclRuleSpecs: networkAcl规则列表 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAddNetworkAclRulesRequest( regionId string, networkAclId string, networkAclRuleSpecs []vpc.AddNetworkAclRuleSpec, ) *AddNetworkAclRulesRequest { return &AddNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:addNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, NetworkAclRuleSpecs: networkAclRuleSpecs, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param networkAclRuleSpecs: networkAcl规则列表 (Required) */ func NewAddNetworkAclRulesRequestWithAllParams( regionId string, networkAclId string, networkAclRuleSpecs []vpc.AddNetworkAclRuleSpec, ) *AddNetworkAclRulesRequest { return &AddNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:addNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, NetworkAclRuleSpecs: networkAclRuleSpecs, } } /* This constructor has better compatible ability when API parameters changed */ func NewAddNetworkAclRulesRequestWithoutParam() *AddNetworkAclRulesRequest { return &AddNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:addNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *AddNetworkAclRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *AddNetworkAclRulesRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } /* param networkAclRuleSpecs: networkAcl规则列表(Required) */ func (r *AddNetworkAclRulesRequest) SetNetworkAclRuleSpecs(networkAclRuleSpecs []vpc.AddNetworkAclRuleSpec) { r.NetworkAclRuleSpecs = networkAclRuleSpecs } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AddNetworkAclRulesRequest) GetRegionId() string { return r.RegionId } type AddNetworkAclRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AddNetworkAclRulesResult `json:"result"` } type AddNetworkAclRulesResult struct { }����������������������������������������������������������������������������������������������������������������������������������������AddNetworkSecurityGroupRules.go���������������������������������������������������������������������0000664�0000000�0000000�00000010704�13771713062�0035463�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type AddNetworkSecurityGroupRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* NetworkSecurityGroup ID */ NetworkSecurityGroupId string `json:"networkSecurityGroupId"` /* 安全组规则信息 */ NetworkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules `json:"networkSecurityGroupRuleSpecs"` } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * param networkSecurityGroupRuleSpecs: 安全组规则信息 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAddNetworkSecurityGroupRulesRequest( regionId string, networkSecurityGroupId string, networkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules, ) *AddNetworkSecurityGroupRulesRequest { return &AddNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:addNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, NetworkSecurityGroupRuleSpecs: networkSecurityGroupRuleSpecs, } } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * param networkSecurityGroupRuleSpecs: 安全组规则信息 (Required) */ func NewAddNetworkSecurityGroupRulesRequestWithAllParams( regionId string, networkSecurityGroupId string, networkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules, ) *AddNetworkSecurityGroupRulesRequest { return &AddNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:addNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, NetworkSecurityGroupRuleSpecs: networkSecurityGroupRuleSpecs, } } /* This constructor has better compatible ability when API parameters changed */ func NewAddNetworkSecurityGroupRulesRequestWithoutParam() *AddNetworkSecurityGroupRulesRequest { return &AddNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:addNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *AddNetworkSecurityGroupRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ func (r *AddNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { r.NetworkSecurityGroupId = networkSecurityGroupId } /* param networkSecurityGroupRuleSpecs: 安全组规则信息(Required) */ func (r *AddNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupRuleSpecs(networkSecurityGroupRuleSpecs []vpc.AddSecurityGroupRules) { r.NetworkSecurityGroupRuleSpecs = networkSecurityGroupRuleSpecs } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AddNetworkSecurityGroupRulesRequest) GetRegionId() string { return r.RegionId } type AddNetworkSecurityGroupRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AddNetworkSecurityGroupRulesResult `json:"result"` } type AddNetworkSecurityGroupRulesResult struct { }������������������������������������������������������������AddRouteTableRules.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000007540�13771713062�0033337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type AddRouteTableRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` /* 安全组规则信息 */ RouteTableRuleSpecs []vpc.AddRouteTableRules `json:"routeTableRuleSpecs"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param routeTableRuleSpecs: 安全组规则信息 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAddRouteTableRulesRequest( regionId string, routeTableId string, routeTableRuleSpecs []vpc.AddRouteTableRules, ) *AddRouteTableRulesRequest { return &AddRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:addRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, RouteTableRuleSpecs: routeTableRuleSpecs, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param routeTableRuleSpecs: 安全组规则信息 (Required) */ func NewAddRouteTableRulesRequestWithAllParams( regionId string, routeTableId string, routeTableRuleSpecs []vpc.AddRouteTableRules, ) *AddRouteTableRulesRequest { return &AddRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:addRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, RouteTableRuleSpecs: routeTableRuleSpecs, } } /* This constructor has better compatible ability when API parameters changed */ func NewAddRouteTableRulesRequestWithoutParam() *AddRouteTableRulesRequest { return &AddRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:addRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *AddRouteTableRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *AddRouteTableRulesRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } /* param routeTableRuleSpecs: 安全组规则信息(Required) */ func (r *AddRouteTableRulesRequest) SetRouteTableRuleSpecs(routeTableRuleSpecs []vpc.AddRouteTableRules) { r.RouteTableRuleSpecs = routeTableRuleSpecs } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AddRouteTableRulesRequest) GetRegionId() string { return r.RegionId } type AddRouteTableRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AddRouteTableRulesResult `json:"result"` } type AddRouteTableRulesResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������AssignSecondaryIps.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000011465�13771713062�0033416�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type AssignSecondaryIpsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkInterface ID */ NetworkInterfaceId string `json:"networkInterfaceId"` /* secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true (Optional) */ Force *bool `json:"force"` /* 指定分配的secondaryIp地址 (Optional) */ SecondaryIps []string `json:"secondaryIps"` /* 指定自动分配的secondaryIp个数 (Optional) */ SecondaryIpCount *int `json:"secondaryIpCount"` } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAssignSecondaryIpsRequest( regionId string, networkInterfaceId string, ) *AssignSecondaryIpsRequest { return &AssignSecondaryIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:assignSecondaryIps", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * param force: secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true (Optional) * param secondaryIps: 指定分配的secondaryIp地址 (Optional) * param secondaryIpCount: 指定自动分配的secondaryIp个数 (Optional) */ func NewAssignSecondaryIpsRequestWithAllParams( regionId string, networkInterfaceId string, force *bool, secondaryIps []string, secondaryIpCount *int, ) *AssignSecondaryIpsRequest { return &AssignSecondaryIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:assignSecondaryIps", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, Force: force, SecondaryIps: secondaryIps, SecondaryIpCount: secondaryIpCount, } } /* This constructor has better compatible ability when API parameters changed */ func NewAssignSecondaryIpsRequestWithoutParam() *AssignSecondaryIpsRequest { return &AssignSecondaryIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:assignSecondaryIps", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *AssignSecondaryIpsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkInterfaceId: networkInterface ID(Required) */ func (r *AssignSecondaryIpsRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } /* param force: secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true(Optional) */ func (r *AssignSecondaryIpsRequest) SetForce(force bool) { r.Force = &force } /* param secondaryIps: 指定分配的secondaryIp地址(Optional) */ func (r *AssignSecondaryIpsRequest) SetSecondaryIps(secondaryIps []string) { r.SecondaryIps = secondaryIps } /* param secondaryIpCount: 指定自动分配的secondaryIp个数(Optional) */ func (r *AssignSecondaryIpsRequest) SetSecondaryIpCount(secondaryIpCount int) { r.SecondaryIpCount = &secondaryIpCount } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AssignSecondaryIpsRequest) GetRegionId() string { return r.RegionId } type AssignSecondaryIpsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AssignSecondaryIpsResult `json:"result"` } type AssignSecondaryIpsResult struct { }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AssociateElasticIp.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000011013�13771713062�0033344�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type AssociateElasticIpRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkInterface ID */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 绑定的弹性Ip Id (Optional) */ ElasticIpId *string `json:"elasticIpId"` /* 绑定弹性Ip到指定的privateIp (Optional) */ PrivateIpAddress *string `json:"privateIpAddress"` /* 绑定的弹性Ip地址 (Optional) */ ElasticIpAddress *string `json:"elasticIpAddress"` } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAssociateElasticIpRequest( regionId string, networkInterfaceId string, ) *AssociateElasticIpRequest { return &AssociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:associateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * param elasticIpId: 绑定的弹性Ip Id (Optional) * param privateIpAddress: 绑定弹性Ip到指定的privateIp (Optional) * param elasticIpAddress: 绑定的弹性Ip地址 (Optional) */ func NewAssociateElasticIpRequestWithAllParams( regionId string, networkInterfaceId string, elasticIpId *string, privateIpAddress *string, elasticIpAddress *string, ) *AssociateElasticIpRequest { return &AssociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:associateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, ElasticIpId: elasticIpId, PrivateIpAddress: privateIpAddress, ElasticIpAddress: elasticIpAddress, } } /* This constructor has better compatible ability when API parameters changed */ func NewAssociateElasticIpRequestWithoutParam() *AssociateElasticIpRequest { return &AssociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:associateElasticIp", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *AssociateElasticIpRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkInterfaceId: networkInterface ID(Required) */ func (r *AssociateElasticIpRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } /* param elasticIpId: 绑定的弹性Ip Id(Optional) */ func (r *AssociateElasticIpRequest) SetElasticIpId(elasticIpId string) { r.ElasticIpId = &elasticIpId } /* param privateIpAddress: 绑定弹性Ip到指定的privateIp(Optional) */ func (r *AssociateElasticIpRequest) SetPrivateIpAddress(privateIpAddress string) { r.PrivateIpAddress = &privateIpAddress } /* param elasticIpAddress: 绑定的弹性Ip地址(Optional) */ func (r *AssociateElasticIpRequest) SetElasticIpAddress(elasticIpAddress string) { r.ElasticIpAddress = &elasticIpAddress } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AssociateElasticIpRequest) GetRegionId() string { return r.RegionId } type AssociateElasticIpResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AssociateElasticIpResult `json:"result"` } type AssociateElasticIpResult struct { }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AssociateNetworkAcl.go������������������������������������������������������������������������������0000664�0000000�0000000�00000007566�13771713062�0033562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type AssociateNetworkAclRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` /* networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 */ SubnetIds []string `json:"subnetIds"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param subnetIds: networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAssociateNetworkAclRequest( regionId string, networkAclId string, subnetIds []string, ) *AssociateNetworkAclRequest { return &AssociateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:associateNetworkAcl", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, SubnetIds: subnetIds, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param subnetIds: networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑 (Required) */ func NewAssociateNetworkAclRequestWithAllParams( regionId string, networkAclId string, subnetIds []string, ) *AssociateNetworkAclRequest { return &AssociateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:associateNetworkAcl", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, SubnetIds: subnetIds, } } /* This constructor has better compatible ability when API parameters changed */ func NewAssociateNetworkAclRequestWithoutParam() *AssociateNetworkAclRequest { return &AssociateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:associateNetworkAcl", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *AssociateNetworkAclRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *AssociateNetworkAclRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } /* param subnetIds: networkAcl要绑定的子网ID列表, subnet已被其他networkAcl绑定时,自动解绑(Required) */ func (r *AssociateNetworkAclRequest) SetSubnetIds(subnetIds []string) { r.SubnetIds = subnetIds } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AssociateNetworkAclRequest) GetRegionId() string { return r.RegionId } type AssociateNetworkAclResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AssociateNetworkAclResult `json:"result"` } type AssociateNetworkAclResult struct { }������������������������������������������������������������������������������������������������������������������������������������������AssociateRouteTable.go������������������������������������������������������������������������������0000664�0000000�0000000�00000007562�13771713062�0033553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type AssociateRouteTableRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` /* 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 */ SubnetIds []string `json:"subnetIds"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param subnetIds: 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewAssociateRouteTableRequest( regionId string, routeTableId string, subnetIds []string, ) *AssociateRouteTableRequest { return &AssociateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:associateRouteTable", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, SubnetIds: subnetIds, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param subnetIds: 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 (Required) */ func NewAssociateRouteTableRequestWithAllParams( regionId string, routeTableId string, subnetIds []string, ) *AssociateRouteTableRequest { return &AssociateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:associateRouteTable", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, SubnetIds: subnetIds, } } /* This constructor has better compatible ability when API parameters changed */ func NewAssociateRouteTableRequestWithoutParam() *AssociateRouteTableRequest { return &AssociateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:associateRouteTable", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *AssociateRouteTableRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *AssociateRouteTableRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } /* param subnetIds: 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。(Required) */ func (r *AssociateRouteTableRequest) SetSubnetIds(subnetIds []string) { r.SubnetIds = subnetIds } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r AssociateRouteTableRequest) GetRegionId() string { return r.RegionId } type AssociateRouteTableResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result AssociateRouteTableResult `json:"result"` } type AssociateRouteTableResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateElasticIps.go�0000664�0000000�0000000�00000010467�13771713062�0033112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type CreateElasticIpsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 购买弹性ip数量;取值范围:[1,100] */ MaxCount int `json:"maxCount"` /* 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional) */ ElasticIpAddress *string `json:"elasticIpAddress"` /* 弹性ip规格 */ ElasticIpSpec *vpc.ElasticIpSpec `json:"elasticIpSpec"` } /* * param regionId: Region ID (Required) * param maxCount: 购买弹性ip数量;取值范围:[1,100] (Required) * param elasticIpSpec: 弹性ip规格 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateElasticIpsRequest( regionId string, maxCount int, elasticIpSpec *vpc.ElasticIpSpec, ) *CreateElasticIpsRequest { return &CreateElasticIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, MaxCount: maxCount, ElasticIpSpec: elasticIpSpec, } } /* * param regionId: Region ID (Required) * param maxCount: 购买弹性ip数量;取值范围:[1,100] (Required) * param elasticIpAddress: 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional) * param elasticIpSpec: 弹性ip规格 (Required) */ func NewCreateElasticIpsRequestWithAllParams( regionId string, maxCount int, elasticIpAddress *string, elasticIpSpec *vpc.ElasticIpSpec, ) *CreateElasticIpsRequest { return &CreateElasticIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, MaxCount: maxCount, ElasticIpAddress: elasticIpAddress, ElasticIpSpec: elasticIpSpec, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateElasticIpsRequestWithoutParam() *CreateElasticIpsRequest { return &CreateElasticIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateElasticIpsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param maxCount: 购买弹性ip数量;取值范围:[1,100](Required) */ func (r *CreateElasticIpsRequest) SetMaxCount(maxCount int) { r.MaxCount = maxCount } /* param elasticIpAddress: 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空(Optional) */ func (r *CreateElasticIpsRequest) SetElasticIpAddress(elasticIpAddress string) { r.ElasticIpAddress = &elasticIpAddress } /* param elasticIpSpec: 弹性ip规格(Required) */ func (r *CreateElasticIpsRequest) SetElasticIpSpec(elasticIpSpec *vpc.ElasticIpSpec) { r.ElasticIpSpec = elasticIpSpec } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateElasticIpsRequest) GetRegionId() string { return r.RegionId } type CreateElasticIpsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateElasticIpsResult `json:"result"` } type CreateElasticIpsResult struct { ElasticIpIds []string `json:"elasticIpIds"` RequestId string `json:"requestId"` }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateNetworkAcl.go�0000664�0000000�0000000�00000007670�13771713062�0033125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type CreateNetworkAclRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 私有网络id */ VpcId string `json:"vpcId"` /* networkAcl名称 */ NetworkAclName string `json:"networkAclName"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcId: 私有网络id (Required) * param networkAclName: networkAcl名称 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateNetworkAclRequest( regionId string, vpcId string, networkAclName string, ) *CreateNetworkAclRequest { return &CreateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, NetworkAclName: networkAclName, } } /* * param regionId: Region ID (Required) * param vpcId: 私有网络id (Required) * param networkAclName: networkAcl名称 (Required) * param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ func NewCreateNetworkAclRequestWithAllParams( regionId string, vpcId string, networkAclName string, description *string, ) *CreateNetworkAclRequest { return &CreateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, NetworkAclName: networkAclName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateNetworkAclRequestWithoutParam() *CreateNetworkAclRequest { return &CreateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateNetworkAclRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcId: 私有网络id(Required) */ func (r *CreateNetworkAclRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } /* param networkAclName: networkAcl名称(Required) */ func (r *CreateNetworkAclRequest) SetNetworkAclName(networkAclName string) { r.NetworkAclName = networkAclName } /* param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ func (r *CreateNetworkAclRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateNetworkAclRequest) GetRegionId() string { return r.RegionId } type CreateNetworkAclResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateNetworkAclResult `json:"result"` } type CreateNetworkAclResult struct { NetworkAclId string `json:"networkAclId"` }������������������������������������������������������������������������CreateNetworkInterface.go���������������������������������������������������������������������������0000664�0000000�0000000�00000016223�13771713062�0034241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type CreateNetworkInterfaceRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 子网ID */ SubnetId string `json:"subnetId"` /* 可用区,用户的默认可用区 (Optional) */ Az *string `json:"az"` /* 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ NetworkInterfaceName *string `json:"networkInterfaceName"` /* 网卡主IP,如果不指定,会自动从子网中分配 (Optional) */ PrimaryIpAddress *string `json:"primaryIpAddress"` /* SecondaryIp列表 (Optional) */ SecondaryIpAddresses []string `json:"secondaryIpAddresses"` /* 自动分配的SecondaryIp数量 (Optional) */ SecondaryIpCount *int `json:"secondaryIpCount"` /* 要绑定的安全组ID列表,最多指定5个安全组 (Optional) */ SecurityGroups []string `json:"securityGroups"` /* 源和目标IP地址校验,取值为0或者1,默认为1 (Optional) */ SanityCheck *int `json:"sanityCheck"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param subnetId: 子网ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateNetworkInterfaceRequest( regionId string, subnetId string, ) *CreateNetworkInterfaceRequest { return &CreateNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, } } /* * param regionId: Region ID (Required) * param subnetId: 子网ID (Required) * param az: 可用区,用户的默认可用区 (Optional) * param networkInterfaceName: 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) * param primaryIpAddress: 网卡主IP,如果不指定,会自动从子网中分配 (Optional) * param secondaryIpAddresses: SecondaryIp列表 (Optional) * param secondaryIpCount: 自动分配的SecondaryIp数量 (Optional) * param securityGroups: 要绑定的安全组ID列表,最多指定5个安全组 (Optional) * param sanityCheck: 源和目标IP地址校验,取值为0或者1,默认为1 (Optional) * param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ func NewCreateNetworkInterfaceRequestWithAllParams( regionId string, subnetId string, az *string, networkInterfaceName *string, primaryIpAddress *string, secondaryIpAddresses []string, secondaryIpCount *int, securityGroups []string, sanityCheck *int, description *string, ) *CreateNetworkInterfaceRequest { return &CreateNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, Az: az, NetworkInterfaceName: networkInterfaceName, PrimaryIpAddress: primaryIpAddress, SecondaryIpAddresses: secondaryIpAddresses, SecondaryIpCount: secondaryIpCount, SecurityGroups: securityGroups, SanityCheck: sanityCheck, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateNetworkInterfaceRequestWithoutParam() *CreateNetworkInterfaceRequest { return &CreateNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateNetworkInterfaceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param subnetId: 子网ID(Required) */ func (r *CreateNetworkInterfaceRequest) SetSubnetId(subnetId string) { r.SubnetId = subnetId } /* param az: 可用区,用户的默认可用区(Optional) */ func (r *CreateNetworkInterfaceRequest) SetAz(az string) { r.Az = &az } /* param networkInterfaceName: 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Optional) */ func (r *CreateNetworkInterfaceRequest) SetNetworkInterfaceName(networkInterfaceName string) { r.NetworkInterfaceName = &networkInterfaceName } /* param primaryIpAddress: 网卡主IP,如果不指定,会自动从子网中分配(Optional) */ func (r *CreateNetworkInterfaceRequest) SetPrimaryIpAddress(primaryIpAddress string) { r.PrimaryIpAddress = &primaryIpAddress } /* param secondaryIpAddresses: SecondaryIp列表(Optional) */ func (r *CreateNetworkInterfaceRequest) SetSecondaryIpAddresses(secondaryIpAddresses []string) { r.SecondaryIpAddresses = secondaryIpAddresses } /* param secondaryIpCount: 自动分配的SecondaryIp数量(Optional) */ func (r *CreateNetworkInterfaceRequest) SetSecondaryIpCount(secondaryIpCount int) { r.SecondaryIpCount = &secondaryIpCount } /* param securityGroups: 要绑定的安全组ID列表,最多指定5个安全组(Optional) */ func (r *CreateNetworkInterfaceRequest) SetSecurityGroups(securityGroups []string) { r.SecurityGroups = securityGroups } /* param sanityCheck: 源和目标IP地址校验,取值为0或者1,默认为1(Optional) */ func (r *CreateNetworkInterfaceRequest) SetSanityCheck(sanityCheck int) { r.SanityCheck = &sanityCheck } /* param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ func (r *CreateNetworkInterfaceRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateNetworkInterfaceRequest) GetRegionId() string { return r.RegionId } type CreateNetworkInterfaceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateNetworkInterfaceResult `json:"result"` } type CreateNetworkInterfaceResult struct { NetworkInterfaceId string `json:"networkInterfaceId"` }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CreateNetworkSecurityGroup.go�����������������������������������������������������������������������0000664�0000000�0000000�00000011534�13771713062�0035165�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type CreateNetworkSecurityGroupRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 私有网络ID */ VpcId string `json:"vpcId"` /* 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ NetworkSecurityGroupName string `json:"networkSecurityGroupName"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcId: 私有网络ID (Required) * param networkSecurityGroupName: 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateNetworkSecurityGroupRequest( regionId string, vpcId string, networkSecurityGroupName string, ) *CreateNetworkSecurityGroupRequest { return &CreateNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, NetworkSecurityGroupName: networkSecurityGroupName, } } /* * param regionId: Region ID (Required) * param vpcId: 私有网络ID (Required) * param networkSecurityGroupName: 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ func NewCreateNetworkSecurityGroupRequestWithAllParams( regionId string, vpcId string, networkSecurityGroupName string, description *string, ) *CreateNetworkSecurityGroupRequest { return &CreateNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, NetworkSecurityGroupName: networkSecurityGroupName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateNetworkSecurityGroupRequestWithoutParam() *CreateNetworkSecurityGroupRequest { return &CreateNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateNetworkSecurityGroupRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcId: 私有网络ID(Required) */ func (r *CreateNetworkSecurityGroupRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } /* param networkSecurityGroupName: 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ func (r *CreateNetworkSecurityGroupRequest) SetNetworkSecurityGroupName(networkSecurityGroupName string) { r.NetworkSecurityGroupName = networkSecurityGroupName } /* param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ func (r *CreateNetworkSecurityGroupRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateNetworkSecurityGroupRequest) GetRegionId() string { return r.RegionId } type CreateNetworkSecurityGroupResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateNetworkSecurityGroupResult `json:"result"` } type CreateNetworkSecurityGroupResult struct { NetworkSecurityGroupId string `json:"networkSecurityGroupId"` }��������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateRouteTable.go�0000664�0000000�0000000�00000011050�13771713062�0033105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type CreateRouteTableRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 路由表所属的私有网络ID */ VpcId string `json:"vpcId"` /* 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ RouteTableName string `json:"routeTableName"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcId: 路由表所属的私有网络ID (Required) * param routeTableName: 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateRouteTableRequest( regionId string, vpcId string, routeTableName string, ) *CreateRouteTableRequest { return &CreateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, RouteTableName: routeTableName, } } /* * param regionId: Region ID (Required) * param vpcId: 路由表所属的私有网络ID (Required) * param routeTableName: 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ func NewCreateRouteTableRequestWithAllParams( regionId string, vpcId string, routeTableName string, description *string, ) *CreateRouteTableRequest { return &CreateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, RouteTableName: routeTableName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateRouteTableRequestWithoutParam() *CreateRouteTableRequest { return &CreateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateRouteTableRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcId: 路由表所属的私有网络ID(Required) */ func (r *CreateRouteTableRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } /* param routeTableName: 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ func (r *CreateRouteTableRequest) SetRouteTableName(routeTableName string) { r.RouteTableName = routeTableName } /* param description: 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ func (r *CreateRouteTableRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateRouteTableRequest) GetRegionId() string { return r.RegionId } type CreateRouteTableResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateRouteTableResult `json:"result"` } type CreateRouteTableResult struct { RouteTableId string `json:"routeTableId"` }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateSubnet.go�����0000664�0000000�0000000�00000014223�13771713062�0032304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type CreateSubnetRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 子网所属vpc的Id */ VpcId string `json:"vpcId"` /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ SubnetName string `json:"subnetName"` /* 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 */ AddressPrefix string `json:"addressPrefix"` /* 子网关联的路由表Id, 默认为vpc的默认路由表 (Optional) */ RouteTableId *string `json:"routeTableId"` /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcId: 子网所属vpc的Id (Required) * param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * param addressPrefix: 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateSubnetRequest( regionId string, vpcId string, subnetName string, addressPrefix string, ) *CreateSubnetRequest { return &CreateSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, SubnetName: subnetName, AddressPrefix: addressPrefix, } } /* * param regionId: Region ID (Required) * param vpcId: 子网所属vpc的Id (Required) * param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * param addressPrefix: 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 (Required) * param routeTableId: 子网关联的路由表Id, 默认为vpc的默认路由表 (Optional) * param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ func NewCreateSubnetRequestWithAllParams( regionId string, vpcId string, subnetName string, addressPrefix string, routeTableId *string, description *string, ) *CreateSubnetRequest { return &CreateSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, SubnetName: subnetName, AddressPrefix: addressPrefix, RouteTableId: routeTableId, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateSubnetRequestWithoutParam() *CreateSubnetRequest { return &CreateSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateSubnetRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcId: 子网所属vpc的Id(Required) */ func (r *CreateSubnetRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } /* param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ func (r *CreateSubnetRequest) SetSubnetName(subnetName string) { r.SubnetName = subnetName } /* param addressPrefix: 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网(Required) */ func (r *CreateSubnetRequest) SetAddressPrefix(addressPrefix string) { r.AddressPrefix = addressPrefix } /* param routeTableId: 子网关联的路由表Id, 默认为vpc的默认路由表(Optional) */ func (r *CreateSubnetRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = &routeTableId } /* param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ func (r *CreateSubnetRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateSubnetRequest) GetRegionId() string { return r.RegionId } type CreateSubnetResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateSubnetResult `json:"result"` } type CreateSubnetResult struct { SubnetId string `json:"subnetId"` }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpc.go��������0000664�0000000�0000000�00000011254�13771713062�0031575�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type CreateVpcRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ VpcName string `json:"vpcName"` /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ AddressPrefix *string `json:"addressPrefix"` /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateVpcRequest( regionId string, vpcName string, ) *CreateVpcRequest { return &CreateVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcName: vpcName, } } /* * param regionId: Region ID (Required) * param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Required) * param addressPrefix: 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) * param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ func NewCreateVpcRequestWithAllParams( regionId string, vpcName string, addressPrefix *string, description *string, ) *CreateVpcRequest { return &CreateVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcName: vpcName, AddressPrefix: addressPrefix, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateVpcRequestWithoutParam() *CreateVpcRequest { return &CreateVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateVpcRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Required) */ func (r *CreateVpcRequest) SetVpcName(vpcName string) { r.VpcName = vpcName } /* param addressPrefix: 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间(Optional) */ func (r *CreateVpcRequest) SetAddressPrefix(addressPrefix string) { r.AddressPrefix = &addressPrefix } /* param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ func (r *CreateVpcRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateVpcRequest) GetRegionId() string { return r.RegionId } type CreateVpcResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateVpcResult `json:"result"` } type CreateVpcResult struct { VpcId string `json:"vpcId"` }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/CreateVpcPeering.go�0000664�0000000�0000000�00000012042�13771713062�0033103�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type CreateVpcPeeringRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 */ VpcPeeringName string `json:"vpcPeeringName"` /* VpcPeering本端Vpc的Id */ VpcId string `json:"vpcId"` /* VpcPeering对端Vpc的Id */ RemoteVpcId string `json:"remoteVpcId"` /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Required) * param vpcId: VpcPeering本端Vpc的Id (Required) * param remoteVpcId: VpcPeering对端Vpc的Id (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewCreateVpcPeeringRequest( regionId string, vpcPeeringName string, vpcId string, remoteVpcId string, ) *CreateVpcPeeringRequest { return &CreateVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringName: vpcPeeringName, VpcId: vpcId, RemoteVpcId: remoteVpcId, } } /* * param regionId: Region ID (Required) * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Required) * param vpcId: VpcPeering本端Vpc的Id (Required) * param remoteVpcId: VpcPeering对端Vpc的Id (Required) * param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ func NewCreateVpcPeeringRequestWithAllParams( regionId string, vpcPeeringName string, vpcId string, remoteVpcId string, description *string, ) *CreateVpcPeeringRequest { return &CreateVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringName: vpcPeeringName, VpcId: vpcId, RemoteVpcId: remoteVpcId, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewCreateVpcPeeringRequestWithoutParam() *CreateVpcPeeringRequest { return &CreateVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *CreateVpcPeeringRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Required) */ func (r *CreateVpcPeeringRequest) SetVpcPeeringName(vpcPeeringName string) { r.VpcPeeringName = vpcPeeringName } /* param vpcId: VpcPeering本端Vpc的Id(Required) */ func (r *CreateVpcPeeringRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } /* param remoteVpcId: VpcPeering对端Vpc的Id(Required) */ func (r *CreateVpcPeeringRequest) SetRemoteVpcId(remoteVpcId string) { r.RemoteVpcId = remoteVpcId } /* param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ func (r *CreateVpcPeeringRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r CreateVpcPeeringRequest) GetRegionId() string { return r.RegionId } type CreateVpcPeeringResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result CreateVpcPeeringResult `json:"result"` } type CreateVpcPeeringResult struct { VpcPeering vpc.VpcPeering `json:"vpcPeering"` }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteElasticIp.go��0000664�0000000�0000000�00000006013�13771713062�0032716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteElasticIpRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* ElasticIp ID */ ElasticIpId string `json:"elasticIpId"` } /* * param regionId: Region ID (Required) * param elasticIpId: ElasticIp ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteElasticIpRequest( regionId string, elasticIpId string, ) *DeleteElasticIpRequest { return &DeleteElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, ElasticIpId: elasticIpId, } } /* * param regionId: Region ID (Required) * param elasticIpId: ElasticIp ID (Required) */ func NewDeleteElasticIpRequestWithAllParams( regionId string, elasticIpId string, ) *DeleteElasticIpRequest { return &DeleteElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, ElasticIpId: elasticIpId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteElasticIpRequestWithoutParam() *DeleteElasticIpRequest { return &DeleteElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteElasticIpRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param elasticIpId: ElasticIp ID(Required) */ func (r *DeleteElasticIpRequest) SetElasticIpId(elasticIpId string) { r.ElasticIpId = elasticIpId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteElasticIpRequest) GetRegionId() string { return r.RegionId } type DeleteElasticIpResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteElasticIpResult `json:"result"` } type DeleteElasticIpResult struct { }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteNetworkAcl.go�0000664�0000000�0000000�00000006074�13771713062�0033121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteNetworkAclRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteNetworkAclRequest( regionId string, networkAclId string, ) *DeleteNetworkAclRequest { return &DeleteNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) */ func NewDeleteNetworkAclRequestWithAllParams( regionId string, networkAclId string, ) *DeleteNetworkAclRequest { return &DeleteNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteNetworkAclRequestWithoutParam() *DeleteNetworkAclRequest { return &DeleteNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteNetworkAclRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *DeleteNetworkAclRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteNetworkAclRequest) GetRegionId() string { return r.RegionId } type DeleteNetworkAclResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteNetworkAclResult `json:"result"` } type DeleteNetworkAclResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DeleteNetworkInterface.go���������������������������������������������������������������������������0000664�0000000�0000000�00000006452�13771713062�0034243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteNetworkInterfaceRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkInterface ID */ NetworkInterfaceId string `json:"networkInterfaceId"` } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteNetworkInterfaceRequest( regionId string, networkInterfaceId string, ) *DeleteNetworkInterfaceRequest { return &DeleteNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) */ func NewDeleteNetworkInterfaceRequestWithAllParams( regionId string, networkInterfaceId string, ) *DeleteNetworkInterfaceRequest { return &DeleteNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteNetworkInterfaceRequestWithoutParam() *DeleteNetworkInterfaceRequest { return &DeleteNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteNetworkInterfaceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkInterfaceId: networkInterface ID(Required) */ func (r *DeleteNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteNetworkInterfaceRequest) GetRegionId() string { return r.RegionId } type DeleteNetworkInterfaceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteNetworkInterfaceResult `json:"result"` } type DeleteNetworkInterfaceResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DeleteNetworkSecurityGroup.go�����������������������������������������������������������������������0000664�0000000�0000000�00000006716�13771713062�0035172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteNetworkSecurityGroupRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* NetworkSecurityGroup ID */ NetworkSecurityGroupId string `json:"networkSecurityGroupId"` } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteNetworkSecurityGroupRequest( regionId string, networkSecurityGroupId string, ) *DeleteNetworkSecurityGroupRequest { return &DeleteNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, } } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) */ func NewDeleteNetworkSecurityGroupRequestWithAllParams( regionId string, networkSecurityGroupId string, ) *DeleteNetworkSecurityGroupRequest { return &DeleteNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteNetworkSecurityGroupRequestWithoutParam() *DeleteNetworkSecurityGroupRequest { return &DeleteNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteNetworkSecurityGroupRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ func (r *DeleteNetworkSecurityGroupRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { r.NetworkSecurityGroupId = networkSecurityGroupId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteNetworkSecurityGroupRequest) GetRegionId() string { return r.RegionId } type DeleteNetworkSecurityGroupResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteNetworkSecurityGroupResult `json:"result"` } type DeleteNetworkSecurityGroupResult struct { }��������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteRouteTable.go�0000664�0000000�0000000�00000006064�13771713062�0033115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteRouteTableRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteRouteTableRequest( regionId string, routeTableId string, ) *DeleteRouteTableRequest { return &DeleteRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) */ func NewDeleteRouteTableRequestWithAllParams( regionId string, routeTableId string, ) *DeleteRouteTableRequest { return &DeleteRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteRouteTableRequestWithoutParam() *DeleteRouteTableRequest { return &DeleteRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteRouteTableRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *DeleteRouteTableRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteRouteTableRequest) GetRegionId() string { return r.RegionId } type DeleteRouteTableResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteRouteTableResult `json:"result"` } type DeleteRouteTableResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteSubnet.go�����0000664�0000000�0000000�00000005620�13771713062�0032304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteSubnetRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* Subnet ID */ SubnetId string `json:"subnetId"` } /* * param regionId: Region ID (Required) * param subnetId: Subnet ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteSubnetRequest( regionId string, subnetId string, ) *DeleteSubnetRequest { return &DeleteSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, } } /* * param regionId: Region ID (Required) * param subnetId: Subnet ID (Required) */ func NewDeleteSubnetRequestWithAllParams( regionId string, subnetId string, ) *DeleteSubnetRequest { return &DeleteSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteSubnetRequestWithoutParam() *DeleteSubnetRequest { return &DeleteSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteSubnetRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param subnetId: Subnet ID(Required) */ func (r *DeleteSubnetRequest) SetSubnetId(subnetId string) { r.SubnetId = subnetId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteSubnetRequest) GetRegionId() string { return r.RegionId } type DeleteSubnetResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteSubnetResult `json:"result"` } type DeleteSubnetResult struct { }����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpc.go��������0000664�0000000�0000000�00000005425�13771713062�0031577�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteVpcRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* Vpc ID */ VpcId string `json:"vpcId"` } /* * param regionId: Region ID (Required) * param vpcId: Vpc ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteVpcRequest( regionId string, vpcId string, ) *DeleteVpcRequest { return &DeleteVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, } } /* * param regionId: Region ID (Required) * param vpcId: Vpc ID (Required) */ func NewDeleteVpcRequestWithAllParams( regionId string, vpcId string, ) *DeleteVpcRequest { return &DeleteVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteVpcRequestWithoutParam() *DeleteVpcRequest { return &DeleteVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteVpcRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcId: Vpc ID(Required) */ func (r *DeleteVpcRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteVpcRequest) GetRegionId() string { return r.RegionId } type DeleteVpcResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteVpcResult `json:"result"` } type DeleteVpcResult struct { }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DeleteVpcPeering.go�0000664�0000000�0000000�00000006074�13771713062�0033112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DeleteVpcPeeringRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* vpcPeeringId ID */ VpcPeeringId string `json:"vpcPeeringId"` } /* * param regionId: Region ID (Required) * param vpcPeeringId: vpcPeeringId ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDeleteVpcPeeringRequest( regionId string, vpcPeeringId string, ) *DeleteVpcPeeringRequest { return &DeleteVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringId: vpcPeeringId, } } /* * param regionId: Region ID (Required) * param vpcPeeringId: vpcPeeringId ID (Required) */ func NewDeleteVpcPeeringRequestWithAllParams( regionId string, vpcPeeringId string, ) *DeleteVpcPeeringRequest { return &DeleteVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "DELETE", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringId: vpcPeeringId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDeleteVpcPeeringRequestWithoutParam() *DeleteVpcPeeringRequest { return &DeleteVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "DELETE", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DeleteVpcPeeringRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcPeeringId: vpcPeeringId ID(Required) */ func (r *DeleteVpcPeeringRequest) SetVpcPeeringId(vpcPeeringId string) { r.VpcPeeringId = vpcPeeringId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DeleteVpcPeeringRequest) GetRegionId() string { return r.RegionId } type DeleteVpcPeeringResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DeleteVpcPeeringResult `json:"result"` } type DeleteVpcPeeringResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeElasticIp.go0000664�0000000�0000000�00000006225�13771713062�0033241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeElasticIpRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* ElasticIp ID */ ElasticIpId string `json:"elasticIpId"` } /* * param regionId: Region ID (Required) * param elasticIpId: ElasticIp ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeElasticIpRequest( regionId string, elasticIpId string, ) *DescribeElasticIpRequest { return &DescribeElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ElasticIpId: elasticIpId, } } /* * param regionId: Region ID (Required) * param elasticIpId: ElasticIp ID (Required) */ func NewDescribeElasticIpRequestWithAllParams( regionId string, elasticIpId string, ) *DescribeElasticIpRequest { return &DescribeElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, ElasticIpId: elasticIpId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeElasticIpRequestWithoutParam() *DescribeElasticIpRequest { return &DescribeElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeElasticIpRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param elasticIpId: ElasticIp ID(Required) */ func (r *DescribeElasticIpRequest) SetElasticIpId(elasticIpId string) { r.ElasticIpId = elasticIpId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeElasticIpRequest) GetRegionId() string { return r.RegionId } type DescribeElasticIpResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeElasticIpResult `json:"result"` } type DescribeElasticIpResult struct { ElasticIp vpc.ElasticIp `json:"elasticIp"` }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeElasticIps.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000011353�13771713062�0033343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeElasticIpsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* elasticIpIds - elasticip id数组条件,支持多个 elasticIpAddress - eip的IP地址,支持单个 chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeElasticIpsRequest( regionId string, ) *DescribeElasticIpsRequest { return &DescribeElasticIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: elasticIpIds - elasticip id数组条件,支持多个 elasticIpAddress - eip的IP地址,支持单个 chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个 (Optional) */ func NewDescribeElasticIpsRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeElasticIpsRequest { return &DescribeElasticIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeElasticIpsRequestWithoutParam() *DescribeElasticIpsRequest { return &DescribeElasticIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeElasticIpsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeElasticIpsRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeElasticIpsRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: elasticIpIds - elasticip id数组条件,支持多个 elasticIpAddress - eip的IP地址,支持单个 chargeStatus - eip的费用支付状态,normal(正常状态) or overdue(预付费已到期) or arrear(欠费状态),支持单个 (Optional) */ func (r *DescribeElasticIpsRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeElasticIpsRequest) GetRegionId() string { return r.RegionId } type DescribeElasticIpsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeElasticIpsResult `json:"result"` } type DescribeElasticIpsResult struct { ElasticIps []vpc.ElasticIp `json:"elasticIps"` TotalCount int `json:"totalCount"` }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeNetworkAcl.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000006311�13771713062�0033352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeNetworkAclRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeNetworkAclRequest( regionId string, networkAclId string, ) *DescribeNetworkAclRequest { return &DescribeNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) */ func NewDescribeNetworkAclRequestWithAllParams( regionId string, networkAclId string, ) *DescribeNetworkAclRequest { return &DescribeNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeNetworkAclRequestWithoutParam() *DescribeNetworkAclRequest { return &DescribeNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeNetworkAclRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *DescribeNetworkAclRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeNetworkAclRequest) GetRegionId() string { return r.RegionId } type DescribeNetworkAclResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeNetworkAclResult `json:"result"` } type DescribeNetworkAclResult struct { NetworkAcl vpc.NetworkAcl `json:"networkAcl"` }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeNetworkAcls.go������������������������������������������������������������������������������0000664�0000000�0000000�00000011034�13771713062�0033533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeNetworkAclsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* networkAclIds - 弹性网卡ID列表,支持多个 networkAclNames - 弹性网卡名称列表,支持多个 vpcId - 弹性网卡所属vpc Id,支持单个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeNetworkAclsRequest( regionId string, ) *DescribeNetworkAclsRequest { return &DescribeNetworkAclsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: networkAclIds - 弹性网卡ID列表,支持多个 networkAclNames - 弹性网卡名称列表,支持多个 vpcId - 弹性网卡所属vpc Id,支持单个 (Optional) */ func NewDescribeNetworkAclsRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeNetworkAclsRequest { return &DescribeNetworkAclsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeNetworkAclsRequestWithoutParam() *DescribeNetworkAclsRequest { return &DescribeNetworkAclsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeNetworkAclsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeNetworkAclsRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeNetworkAclsRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: networkAclIds - 弹性网卡ID列表,支持多个 networkAclNames - 弹性网卡名称列表,支持多个 vpcId - 弹性网卡所属vpc Id,支持单个 (Optional) */ func (r *DescribeNetworkAclsRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeNetworkAclsRequest) GetRegionId() string { return r.RegionId } type DescribeNetworkAclsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeNetworkAclsResult `json:"result"` } type DescribeNetworkAclsResult struct { NetworkAcls []vpc.NetworkAcl `json:"networkAcls"` TotalCount int `json:"totalCount"` }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeNetworkInterface.go�������������������������������������������������������������������������0000664�0000000�0000000�00000006711�13771713062�0034557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeNetworkInterfaceRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkInterface ID */ NetworkInterfaceId string `json:"networkInterfaceId"` } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeNetworkInterfaceRequest( regionId string, networkInterfaceId string, ) *DescribeNetworkInterfaceRequest { return &DescribeNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) */ func NewDescribeNetworkInterfaceRequestWithAllParams( regionId string, networkInterfaceId string, ) *DescribeNetworkInterfaceRequest { return &DescribeNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeNetworkInterfaceRequestWithoutParam() *DescribeNetworkInterfaceRequest { return &DescribeNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeNetworkInterfaceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkInterfaceId: networkInterface ID(Required) */ func (r *DescribeNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeNetworkInterfaceRequest) GetRegionId() string { return r.RegionId } type DescribeNetworkInterfaceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeNetworkInterfaceResult `json:"result"` } type DescribeNetworkInterfaceResult struct { NetworkInterface vpc.NetworkInterface `json:"networkInterface"` }�������������������������������������������������������DescribeNetworkInterfaces.go������������������������������������������������������������������������0000664�0000000�0000000�00000012252�13771713062�0034737�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeNetworkInterfacesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* networkInterfaceIds - 弹性网卡ID列表,支持多个 networkInterfaceNames - 弹性网卡名称列表,支持多个 vpcId - 弹性网卡所属vpc Id,支持单个 subnetId - 弹性网卡所属子网Id,支持单个 role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡),支持单个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeNetworkInterfacesRequest( regionId string, ) *DescribeNetworkInterfacesRequest { return &DescribeNetworkInterfacesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: networkInterfaceIds - 弹性网卡ID列表,支持多个 networkInterfaceNames - 弹性网卡名称列表,支持多个 vpcId - 弹性网卡所属vpc Id,支持单个 subnetId - 弹性网卡所属子网Id,支持单个 role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡),支持单个 (Optional) */ func NewDescribeNetworkInterfacesRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeNetworkInterfacesRequest { return &DescribeNetworkInterfacesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeNetworkInterfacesRequestWithoutParam() *DescribeNetworkInterfacesRequest { return &DescribeNetworkInterfacesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeNetworkInterfacesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeNetworkInterfacesRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeNetworkInterfacesRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: networkInterfaceIds - 弹性网卡ID列表,支持多个 networkInterfaceNames - 弹性网卡名称列表,支持多个 vpcId - 弹性网卡所属vpc Id,支持单个 subnetId - 弹性网卡所属子网Id,支持单个 role - 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡),支持单个 (Optional) */ func (r *DescribeNetworkInterfacesRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeNetworkInterfacesRequest) GetRegionId() string { return r.RegionId } type DescribeNetworkInterfacesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeNetworkInterfacesResult `json:"result"` } type DescribeNetworkInterfacesResult struct { NetworkInterfaces []vpc.NetworkInterface `json:"networkInterfaces"` TotalCount int `json:"totalCount"` }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeNetworkSecurityGroup.go���������������������������������������������������������������������0000664�0000000�0000000�00000007171�13771713062�0035504�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeNetworkSecurityGroupRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* NetworkSecurityGroup ID */ NetworkSecurityGroupId string `json:"networkSecurityGroupId"` } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeNetworkSecurityGroupRequest( regionId string, networkSecurityGroupId string, ) *DescribeNetworkSecurityGroupRequest { return &DescribeNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, } } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) */ func NewDescribeNetworkSecurityGroupRequestWithAllParams( regionId string, networkSecurityGroupId string, ) *DescribeNetworkSecurityGroupRequest { return &DescribeNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeNetworkSecurityGroupRequestWithoutParam() *DescribeNetworkSecurityGroupRequest { return &DescribeNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeNetworkSecurityGroupRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ func (r *DescribeNetworkSecurityGroupRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { r.NetworkSecurityGroupId = networkSecurityGroupId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeNetworkSecurityGroupRequest) GetRegionId() string { return r.RegionId } type DescribeNetworkSecurityGroupResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeNetworkSecurityGroupResult `json:"result"` } type DescribeNetworkSecurityGroupResult struct { NetworkSecurityGroup vpc.NetworkSecurityGroup `json:"networkSecurityGroup"` }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeNetworkSecurityGroups.go��������������������������������������������������������������������0000664�0000000�0000000�00000011455�13771713062�0035667�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeNetworkSecurityGroupsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* networkSecurityGroupIds - 安全组ID列表,支持多个 networkSecurityGroupNames - 安全组名称列表,支持多个 vpcId - 安全组所属vpc Id,支持单个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeNetworkSecurityGroupsRequest( regionId string, ) *DescribeNetworkSecurityGroupsRequest { return &DescribeNetworkSecurityGroupsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: networkSecurityGroupIds - 安全组ID列表,支持多个 networkSecurityGroupNames - 安全组名称列表,支持多个 vpcId - 安全组所属vpc Id,支持单个 (Optional) */ func NewDescribeNetworkSecurityGroupsRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeNetworkSecurityGroupsRequest { return &DescribeNetworkSecurityGroupsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeNetworkSecurityGroupsRequestWithoutParam() *DescribeNetworkSecurityGroupsRequest { return &DescribeNetworkSecurityGroupsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeNetworkSecurityGroupsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeNetworkSecurityGroupsRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeNetworkSecurityGroupsRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: networkSecurityGroupIds - 安全组ID列表,支持多个 networkSecurityGroupNames - 安全组名称列表,支持多个 vpcId - 安全组所属vpc Id,支持单个 (Optional) */ func (r *DescribeNetworkSecurityGroupsRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeNetworkSecurityGroupsRequest) GetRegionId() string { return r.RegionId } type DescribeNetworkSecurityGroupsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeNetworkSecurityGroupsResult `json:"result"` } type DescribeNetworkSecurityGroupsResult struct { NetworkSecurityGroups []vpc.NetworkSecurityGroup `json:"networkSecurityGroups"` TotalCount int `json:"totalCount"` }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeQuota.go����0000664�0000000�0000000�00000010035�13771713062�0032447�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DescribeQuotaRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) */ Type string `json:"type"` /* type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId (Optional) */ ParentResourceId *string `json:"parentResourceId"` } /* * param regionId: Region ID (Required) * param type_: 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeQuotaRequest( regionId string, type_ string, ) *DescribeQuotaRequest { return &DescribeQuotaRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/quotas/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, Type: type_, } } /* * param regionId: Region ID (Required) * param type_: 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) (Required) * param parentResourceId: type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId (Optional) */ func NewDescribeQuotaRequestWithAllParams( regionId string, type_ string, parentResourceId *string, ) *DescribeQuotaRequest { return &DescribeQuotaRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/quotas/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, Type: type_, ParentResourceId: parentResourceId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeQuotaRequestWithoutParam() *DescribeQuotaRequest { return &DescribeQuotaRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/quotas/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeQuotaRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param type_: 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡)(Required) */ func (r *DescribeQuotaRequest) SetType(type_ string) { r.Type = type_ } /* param parentResourceId: type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId(Optional) */ func (r *DescribeQuotaRequest) SetParentResourceId(parentResourceId string) { r.ParentResourceId = &parentResourceId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeQuotaRequest) GetRegionId() string { return r.RegionId } type DescribeQuotaResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeQuotaResult `json:"result"` } type DescribeQuotaResult struct { Quota interface{} `json:"quota"` }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeRouteTable.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000006301�13771713062�0033346�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeRouteTableRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeRouteTableRequest( regionId string, routeTableId string, ) *DescribeRouteTableRequest { return &DescribeRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) */ func NewDescribeRouteTableRequestWithAllParams( regionId string, routeTableId string, ) *DescribeRouteTableRequest { return &DescribeRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeRouteTableRequestWithoutParam() *DescribeRouteTableRequest { return &DescribeRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeRouteTableRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *DescribeRouteTableRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeRouteTableRequest) GetRegionId() string { return r.RegionId } type DescribeRouteTableResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeRouteTableResult `json:"result"` } type DescribeRouteTableResult struct { RouteTable vpc.RouteTable `json:"routeTable"` }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeRouteTables.go������������������������������������������������������������������������������0000664�0000000�0000000�00000011001�13771713062�0033522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeRouteTablesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* routeTableIds - 路由表ID列表,支持多个 routeTableNames - 路由表名称列表,支持多个 vpcId - 路由表所属vpc Id,支持单个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeRouteTablesRequest( regionId string, ) *DescribeRouteTablesRequest { return &DescribeRouteTablesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: routeTableIds - 路由表ID列表,支持多个 routeTableNames - 路由表名称列表,支持多个 vpcId - 路由表所属vpc Id,支持单个 (Optional) */ func NewDescribeRouteTablesRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeRouteTablesRequest { return &DescribeRouteTablesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeRouteTablesRequestWithoutParam() *DescribeRouteTablesRequest { return &DescribeRouteTablesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeRouteTablesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeRouteTablesRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeRouteTablesRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: routeTableIds - 路由表ID列表,支持多个 routeTableNames - 路由表名称列表,支持多个 vpcId - 路由表所属vpc Id,支持单个 (Optional) */ func (r *DescribeRouteTablesRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeRouteTablesRequest) GetRegionId() string { return r.RegionId } type DescribeRouteTablesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeRouteTablesResult `json:"result"` } type DescribeRouteTablesResult struct { RouteTables []vpc.RouteTable `json:"routeTables"` TotalCount int `json:"totalCount"` }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnet.go���0000664�0000000�0000000�00000006021�13771713062�0032616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeSubnetRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* Subnet ID */ SubnetId string `json:"subnetId"` } /* * param regionId: Region ID (Required) * param subnetId: Subnet ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeSubnetRequest( regionId string, subnetId string, ) *DescribeSubnetRequest { return &DescribeSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, } } /* * param regionId: Region ID (Required) * param subnetId: Subnet ID (Required) */ func NewDescribeSubnetRequestWithAllParams( regionId string, subnetId string, ) *DescribeSubnetRequest { return &DescribeSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeSubnetRequestWithoutParam() *DescribeSubnetRequest { return &DescribeSubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeSubnetRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param subnetId: Subnet ID(Required) */ func (r *DescribeSubnetRequest) SetSubnetId(subnetId string) { r.SubnetId = subnetId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeSubnetRequest) GetRegionId() string { return r.RegionId } type DescribeSubnetResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeSubnetResult `json:"result"` } type DescribeSubnetResult struct { Subnet vpc.Subnet `json:"subnet"` }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeSubnets.go��0000664�0000000�0000000�00000011221�13771713062�0032777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeSubnetsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* subnetIds - subnet ID列表,支持多个 subnetNames - subnet名称列表,支持多个 routeTableId - 子网关联路由表Id,支持单个 aclId - 子网关联acl Id,支持单个 vpcId - 子网所属VPC Id,支持单个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeSubnetsRequest( regionId string, ) *DescribeSubnetsRequest { return &DescribeSubnetsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: subnetIds - subnet ID列表,支持多个 subnetNames - subnet名称列表,支持多个 routeTableId - 子网关联路由表Id,支持单个 aclId - 子网关联acl Id,支持单个 vpcId - 子网所属VPC Id,支持单个 (Optional) */ func NewDescribeSubnetsRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeSubnetsRequest { return &DescribeSubnetsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeSubnetsRequestWithoutParam() *DescribeSubnetsRequest { return &DescribeSubnetsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeSubnetsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeSubnetsRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeSubnetsRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: subnetIds - subnet ID列表,支持多个 subnetNames - subnet名称列表,支持多个 routeTableId - 子网关联路由表Id,支持单个 aclId - 子网关联acl Id,支持单个 vpcId - 子网所属VPC Id,支持单个 (Optional) */ func (r *DescribeSubnetsRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeSubnetsRequest) GetRegionId() string { return r.RegionId } type DescribeSubnetsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeSubnetsResult `json:"result"` } type DescribeSubnetsResult struct { Subnets []vpc.Subnet `json:"subnets"` TotalCount int `json:"totalCount"` }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpc.go������0000664�0000000�0000000�00000005615�13771713062�0032116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeVpcRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* Vpc ID */ VpcId string `json:"vpcId"` } /* * param regionId: Region ID (Required) * param vpcId: Vpc ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeVpcRequest( regionId string, vpcId string, ) *DescribeVpcRequest { return &DescribeVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, } } /* * param regionId: Region ID (Required) * param vpcId: Vpc ID (Required) */ func NewDescribeVpcRequestWithAllParams( regionId string, vpcId string, ) *DescribeVpcRequest { return &DescribeVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeVpcRequestWithoutParam() *DescribeVpcRequest { return &DescribeVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeVpcRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcId: Vpc ID(Required) */ func (r *DescribeVpcRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeVpcRequest) GetRegionId() string { return r.RegionId } type DescribeVpcResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeVpcResult `json:"result"` } type DescribeVpcResult struct { Vpc vpc.Vpc `json:"vpc"` }�������������������������������������������������������������������������������������������������������������������DescribeVpcPeering.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000006311�13771713062�0033343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type DescribeVpcPeeringRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* vpcPeeringId ID */ VpcPeeringId string `json:"vpcPeeringId"` } /* * param regionId: Region ID (Required) * param vpcPeeringId: vpcPeeringId ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeVpcPeeringRequest( regionId string, vpcPeeringId string, ) *DescribeVpcPeeringRequest { return &DescribeVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringId: vpcPeeringId, } } /* * param regionId: Region ID (Required) * param vpcPeeringId: vpcPeeringId ID (Required) */ func NewDescribeVpcPeeringRequestWithAllParams( regionId string, vpcPeeringId string, ) *DescribeVpcPeeringRequest { return &DescribeVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringId: vpcPeeringId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeVpcPeeringRequestWithoutParam() *DescribeVpcPeeringRequest { return &DescribeVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeVpcPeeringRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcPeeringId: vpcPeeringId ID(Required) */ func (r *DescribeVpcPeeringRequest) SetVpcPeeringId(vpcPeeringId string) { r.VpcPeeringId = vpcPeeringId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeVpcPeeringRequest) GetRegionId() string { return r.RegionId } type DescribeVpcPeeringResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeVpcPeeringResult `json:"result"` } type DescribeVpcPeeringResult struct { VpcPeering vpc.VpcPeering `json:"vpcPeering"` }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DescribeVpcPeerings.go������������������������������������������������������������������������������0000664�0000000�0000000�00000011227�13771713062�0033530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeVpcPeeringsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* vpcPeeringIds - vpcPeering ID,支持多个 vpcPeeringNames - vpcPeering名称列表,支持多个 vpcId - vpcPeering本端Vpc Id,支持单个 remoteVpcId - vpcPeering对端Vpc Id,支持单个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeVpcPeeringsRequest( regionId string, ) *DescribeVpcPeeringsRequest { return &DescribeVpcPeeringsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: vpcPeeringIds - vpcPeering ID,支持多个 vpcPeeringNames - vpcPeering名称列表,支持多个 vpcId - vpcPeering本端Vpc Id,支持单个 remoteVpcId - vpcPeering对端Vpc Id,支持单个 (Optional) */ func NewDescribeVpcPeeringsRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeVpcPeeringsRequest { return &DescribeVpcPeeringsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeVpcPeeringsRequestWithoutParam() *DescribeVpcPeeringsRequest { return &DescribeVpcPeeringsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeVpcPeeringsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeVpcPeeringsRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeVpcPeeringsRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: vpcPeeringIds - vpcPeering ID,支持多个 vpcPeeringNames - vpcPeering名称列表,支持多个 vpcId - vpcPeering本端Vpc Id,支持单个 remoteVpcId - vpcPeering对端Vpc Id,支持单个 (Optional) */ func (r *DescribeVpcPeeringsRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeVpcPeeringsRequest) GetRegionId() string { return r.RegionId } type DescribeVpcPeeringsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeVpcPeeringsResult `json:"result"` } type DescribeVpcPeeringsResult struct { VpcPeerings []vpc.VpcPeering `json:"vpcPeerings"` TotalCount int `json:"totalCount"` }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/DescribeVpcs.go�����0000664�0000000�0000000�00000010201�13771713062�0032264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" common "github.com/jdcloud-api/jdcloud-sdk-go/services/common/models" ) type DescribeVpcsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) */ PageNumber *int `json:"pageNumber"` /* 分页大小,默认为20,取值范围:[10,100] (Optional) */ PageSize *int `json:"pageSize"` /* vpcIds - vpc ID列表,支持多个 vpcNames - vpc名称列表,支持多个 (Optional) */ Filters []common.Filter `json:"filters"` } /* * param regionId: Region ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDescribeVpcsRequest( regionId string, ) *DescribeVpcsRequest { return &DescribeVpcsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, } } /* * param regionId: Region ID (Required) * param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页 (Optional) * param pageSize: 分页大小,默认为20,取值范围:[10,100] (Optional) * param filters: vpcIds - vpc ID列表,支持多个 vpcNames - vpc名称列表,支持多个 (Optional) */ func NewDescribeVpcsRequestWithAllParams( regionId string, pageNumber *int, pageSize *int, filters []common.Filter, ) *DescribeVpcsRequest { return &DescribeVpcsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/", Method: "GET", Header: nil, Version: "v1", }, RegionId: regionId, PageNumber: pageNumber, PageSize: pageSize, Filters: filters, } } /* This constructor has better compatible ability when API parameters changed */ func NewDescribeVpcsRequestWithoutParam() *DescribeVpcsRequest { return &DescribeVpcsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/", Method: "GET", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DescribeVpcsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param pageNumber: 页码, 默认为1, 取值范围:[1,∞), 页码超过总页数时, 显示最后一页(Optional) */ func (r *DescribeVpcsRequest) SetPageNumber(pageNumber int) { r.PageNumber = &pageNumber } /* param pageSize: 分页大小,默认为20,取值范围:[10,100](Optional) */ func (r *DescribeVpcsRequest) SetPageSize(pageSize int) { r.PageSize = &pageSize } /* param filters: vpcIds - vpc ID列表,支持多个 vpcNames - vpc名称列表,支持多个 (Optional) */ func (r *DescribeVpcsRequest) SetFilters(filters []common.Filter) { r.Filters = filters } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DescribeVpcsRequest) GetRegionId() string { return r.RegionId } type DescribeVpcsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DescribeVpcsResult `json:"result"` } type DescribeVpcsResult struct { Vpcs []vpc.Vpc `json:"vpcs"` TotalCount int `json:"totalCount"` }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DisassociateElasticIp.go����������������������������������������������������������������������������0000664�0000000�0000000�00000010234�13771713062�0034050�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DisassociateElasticIpRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkInterface ID */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 指定解绑的弹性Ip Id (Optional) */ ElasticIpId *string `json:"elasticIpId"` /* 指定解绑的弹性Ip地址 (Optional) */ ElasticIpAddress *string `json:"elasticIpAddress"` } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDisassociateElasticIpRequest( regionId string, networkInterfaceId string, ) *DisassociateElasticIpRequest { return &DisassociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:disassociateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * param elasticIpId: 指定解绑的弹性Ip Id (Optional) * param elasticIpAddress: 指定解绑的弹性Ip地址 (Optional) */ func NewDisassociateElasticIpRequestWithAllParams( regionId string, networkInterfaceId string, elasticIpId *string, elasticIpAddress *string, ) *DisassociateElasticIpRequest { return &DisassociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:disassociateElasticIp", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, ElasticIpId: elasticIpId, ElasticIpAddress: elasticIpAddress, } } /* This constructor has better compatible ability when API parameters changed */ func NewDisassociateElasticIpRequestWithoutParam() *DisassociateElasticIpRequest { return &DisassociateElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:disassociateElasticIp", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DisassociateElasticIpRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkInterfaceId: networkInterface ID(Required) */ func (r *DisassociateElasticIpRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } /* param elasticIpId: 指定解绑的弹性Ip Id(Optional) */ func (r *DisassociateElasticIpRequest) SetElasticIpId(elasticIpId string) { r.ElasticIpId = &elasticIpId } /* param elasticIpAddress: 指定解绑的弹性Ip地址(Optional) */ func (r *DisassociateElasticIpRequest) SetElasticIpAddress(elasticIpAddress string) { r.ElasticIpAddress = &elasticIpAddress } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DisassociateElasticIpRequest) GetRegionId() string { return r.RegionId } type DisassociateElasticIpResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DisassociateElasticIpResult `json:"result"` } type DisassociateElasticIpResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DisassociateNetworkAcl.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007253�13771713062�0034253�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DisassociateNetworkAclRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` /* networkAcl要解绑的子网ID */ SubnetId string `json:"subnetId"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param subnetId: networkAcl要解绑的子网ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDisassociateNetworkAclRequest( regionId string, networkAclId string, subnetId string, ) *DisassociateNetworkAclRequest { return &DisassociateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:disassociateNetworkAcl", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, SubnetId: subnetId, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param subnetId: networkAcl要解绑的子网ID (Required) */ func NewDisassociateNetworkAclRequestWithAllParams( regionId string, networkAclId string, subnetId string, ) *DisassociateNetworkAclRequest { return &DisassociateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:disassociateNetworkAcl", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, SubnetId: subnetId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDisassociateNetworkAclRequestWithoutParam() *DisassociateNetworkAclRequest { return &DisassociateNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:disassociateNetworkAcl", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DisassociateNetworkAclRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *DisassociateNetworkAclRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } /* param subnetId: networkAcl要解绑的子网ID(Required) */ func (r *DisassociateNetworkAclRequest) SetSubnetId(subnetId string) { r.SubnetId = subnetId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DisassociateNetworkAclRequest) GetRegionId() string { return r.RegionId } type DisassociateNetworkAclResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DisassociateNetworkAclResult `json:"result"` } type DisassociateNetworkAclResult struct { }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DisassociateRouteTable.go���������������������������������������������������������������������������0000664�0000000�0000000�00000007473�13771713062�0034254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type DisassociateRouteTableRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` /* 路由表要解绑的子网ID,解绑后子网绑定默认路由表 */ SubnetId string `json:"subnetId"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param subnetId: 路由表要解绑的子网ID,解绑后子网绑定默认路由表 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewDisassociateRouteTableRequest( regionId string, routeTableId string, subnetId string, ) *DisassociateRouteTableRequest { return &DisassociateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:disassociateRouteTable", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, SubnetId: subnetId, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param subnetId: 路由表要解绑的子网ID,解绑后子网绑定默认路由表 (Required) */ func NewDisassociateRouteTableRequestWithAllParams( regionId string, routeTableId string, subnetId string, ) *DisassociateRouteTableRequest { return &DisassociateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:disassociateRouteTable", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, SubnetId: subnetId, } } /* This constructor has better compatible ability when API parameters changed */ func NewDisassociateRouteTableRequestWithoutParam() *DisassociateRouteTableRequest { return &DisassociateRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:disassociateRouteTable", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *DisassociateRouteTableRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *DisassociateRouteTableRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } /* param subnetId: 路由表要解绑的子网ID,解绑后子网绑定默认路由表(Required) */ func (r *DisassociateRouteTableRequest) SetSubnetId(subnetId string) { r.SubnetId = subnetId } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r DisassociateRouteTableRequest) GetRegionId() string { return r.RegionId } type DisassociateRouteTableResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result DisassociateRouteTableResult `json:"result"` } type DisassociateRouteTableResult struct { }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyElasticIp.go��0000664�0000000�0000000�00000007244�13771713062�0032752�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyElasticIpRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* ElasticIp ID */ ElasticIpId string `json:"elasticIpId"` /* 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] */ BandwidthMbps int `json:"bandwidthMbps"` } /* * param regionId: Region ID (Required) * param elasticIpId: ElasticIp ID (Required) * param bandwidthMbps: 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyElasticIpRequest( regionId string, elasticIpId string, bandwidthMbps int, ) *ModifyElasticIpRequest { return &ModifyElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, ElasticIpId: elasticIpId, BandwidthMbps: bandwidthMbps, } } /* * param regionId: Region ID (Required) * param elasticIpId: ElasticIp ID (Required) * param bandwidthMbps: 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] (Required) */ func NewModifyElasticIpRequestWithAllParams( regionId string, elasticIpId string, bandwidthMbps int, ) *ModifyElasticIpRequest { return &ModifyElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, ElasticIpId: elasticIpId, BandwidthMbps: bandwidthMbps, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyElasticIpRequestWithoutParam() *ModifyElasticIpRequest { return &ModifyElasticIpRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/elasticIps/{elasticIpId}", Method: "PATCH", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyElasticIpRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param elasticIpId: ElasticIp ID(Required) */ func (r *ModifyElasticIpRequest) SetElasticIpId(elasticIpId string) { r.ElasticIpId = elasticIpId } /* param bandwidthMbps: 弹性公网IP的限速(单位:Mbps),取值范围为[1-200](Required) */ func (r *ModifyElasticIpRequest) SetBandwidthMbps(bandwidthMbps int) { r.BandwidthMbps = bandwidthMbps } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyElasticIpRequest) GetRegionId() string { return r.RegionId } type ModifyElasticIpResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyElasticIpResult `json:"result"` } type ModifyElasticIpResult struct { }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyNetworkAcl.go�0000664�0000000�0000000�00000010502�13771713062�0033135�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyNetworkAclRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` /* networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ NetworkAclName *string `json:"networkAclName"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyNetworkAclRequest( regionId string, networkAclId string, ) *ModifyNetworkAclRequest { return &ModifyNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param networkAclName: networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) * param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ func NewModifyNetworkAclRequestWithAllParams( regionId string, networkAclId string, networkAclName *string, description *string, ) *ModifyNetworkAclRequest { return &ModifyNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, NetworkAclName: networkAclName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyNetworkAclRequestWithoutParam() *ModifyNetworkAclRequest { return &ModifyNetworkAclRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}", Method: "PATCH", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyNetworkAclRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *ModifyNetworkAclRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } /* param networkAclName: networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符(Optional) */ func (r *ModifyNetworkAclRequest) SetNetworkAclName(networkAclName string) { r.NetworkAclName = &networkAclName } /* param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ func (r *ModifyNetworkAclRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyNetworkAclRequest) GetRegionId() string { return r.RegionId } type ModifyNetworkAclResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyNetworkAclResult `json:"result"` } type ModifyNetworkAclResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkAclRules.go����������������������������������������������������������������������������0000664�0000000�0000000�00000010032�13771713062�0034067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type ModifyNetworkAclRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` /* networkAcl规则列表 */ ModifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec `json:"modifyNetworkAclRuleSpecs"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param modifyNetworkAclRuleSpecs: networkAcl规则列表 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyNetworkAclRulesRequest( regionId string, networkAclId string, modifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec, ) *ModifyNetworkAclRulesRequest { return &ModifyNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:modifyNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, ModifyNetworkAclRuleSpecs: modifyNetworkAclRuleSpecs, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param modifyNetworkAclRuleSpecs: networkAcl规则列表 (Required) */ func NewModifyNetworkAclRulesRequestWithAllParams( regionId string, networkAclId string, modifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec, ) *ModifyNetworkAclRulesRequest { return &ModifyNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:modifyNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, ModifyNetworkAclRuleSpecs: modifyNetworkAclRuleSpecs, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyNetworkAclRulesRequestWithoutParam() *ModifyNetworkAclRulesRequest { return &ModifyNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:modifyNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyNetworkAclRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *ModifyNetworkAclRulesRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } /* param modifyNetworkAclRuleSpecs: networkAcl规则列表(Required) */ func (r *ModifyNetworkAclRulesRequest) SetModifyNetworkAclRuleSpecs(modifyNetworkAclRuleSpecs []vpc.ModifyNetworkAclRuleSpec) { r.ModifyNetworkAclRuleSpecs = modifyNetworkAclRuleSpecs } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyNetworkAclRulesRequest) GetRegionId() string { return r.RegionId } type ModifyNetworkAclRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyNetworkAclRulesResult `json:"result"` } type ModifyNetworkAclRulesResult struct { }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkInterface.go���������������������������������������������������������������������������0000664�0000000�0000000�00000012431�13771713062�0034262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyNetworkInterfaceRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkInterface ID */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ NetworkInterfaceName *string `json:"networkInterfaceName"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` /* 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 (Optional) */ SecurityGroups []string `json:"securityGroups"` } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyNetworkInterfaceRequest( regionId string, networkInterfaceId string, ) *ModifyNetworkInterfaceRequest { return &ModifyNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * param networkInterfaceName: 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) * param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) * param securityGroups: 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 (Optional) */ func NewModifyNetworkInterfaceRequestWithAllParams( regionId string, networkInterfaceId string, networkInterfaceName *string, description *string, securityGroups []string, ) *ModifyNetworkInterfaceRequest { return &ModifyNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, NetworkInterfaceName: networkInterfaceName, Description: description, SecurityGroups: securityGroups, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyNetworkInterfaceRequestWithoutParam() *ModifyNetworkInterfaceRequest { return &ModifyNetworkInterfaceRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}", Method: "PATCH", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyNetworkInterfaceRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkInterfaceId: networkInterface ID(Required) */ func (r *ModifyNetworkInterfaceRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } /* param networkInterfaceName: 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符(Optional) */ func (r *ModifyNetworkInterfaceRequest) SetNetworkInterfaceName(networkInterfaceName string) { r.NetworkInterfaceName = &networkInterfaceName } /* param description: 描述,允许输入UTF-8编码下的全部字符,不超过256字符(Optional) */ func (r *ModifyNetworkInterfaceRequest) SetDescription(description string) { r.Description = &description } /* param securityGroups: 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组(Optional) */ func (r *ModifyNetworkInterfaceRequest) SetSecurityGroups(securityGroups []string) { r.SecurityGroups = securityGroups } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyNetworkInterfaceRequest) GetRegionId() string { return r.RegionId } type ModifyNetworkInterfaceResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyNetworkInterfaceResult `json:"result"` } type ModifyNetworkInterfaceResult struct { }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkSecurityGroup.go�����������������������������������������������������������������������0000664�0000000�0000000�00000011371�13771713062�0035210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyNetworkSecurityGroupRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* NetworkSecurityGroup ID */ NetworkSecurityGroupId string `json:"networkSecurityGroupId"` /* 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ NetworkSecurityGroupName *string `json:"networkSecurityGroupName"` /* 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyNetworkSecurityGroupRequest( regionId string, networkSecurityGroupId string, ) *ModifyNetworkSecurityGroupRequest { return &ModifyNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, } } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * param networkSecurityGroupName: 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) * param description: 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ func NewModifyNetworkSecurityGroupRequestWithAllParams( regionId string, networkSecurityGroupId string, networkSecurityGroupName *string, description *string, ) *ModifyNetworkSecurityGroupRequest { return &ModifyNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, NetworkSecurityGroupName: networkSecurityGroupName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyNetworkSecurityGroupRequestWithoutParam() *ModifyNetworkSecurityGroupRequest { return &ModifyNetworkSecurityGroupRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}", Method: "PATCH", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyNetworkSecurityGroupRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ func (r *ModifyNetworkSecurityGroupRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { r.NetworkSecurityGroupId = networkSecurityGroupId } /* param networkSecurityGroupName: 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ func (r *ModifyNetworkSecurityGroupRequest) SetNetworkSecurityGroupName(networkSecurityGroupName string) { r.NetworkSecurityGroupName = &networkSecurityGroupName } /* param description: 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符(Optional) */ func (r *ModifyNetworkSecurityGroupRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyNetworkSecurityGroupRequest) GetRegionId() string { return r.RegionId } type ModifyNetworkSecurityGroupResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyNetworkSecurityGroupResult `json:"result"` } type ModifyNetworkSecurityGroupResult struct { }�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkSecurityGroupRules.go������������������������������������������������������������������0000664�0000000�0000000�00000010775�13771713062�0036232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type ModifyNetworkSecurityGroupRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* NetworkSecurityGroup ID */ NetworkSecurityGroupId string `json:"networkSecurityGroupId"` /* 安全组规则信息 */ ModifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules `json:"modifySecurityGroupRuleSpecs"` } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * param modifySecurityGroupRuleSpecs: 安全组规则信息 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyNetworkSecurityGroupRulesRequest( regionId string, networkSecurityGroupId string, modifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules, ) *ModifyNetworkSecurityGroupRulesRequest { return &ModifyNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:modifyNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, ModifySecurityGroupRuleSpecs: modifySecurityGroupRuleSpecs, } } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * param modifySecurityGroupRuleSpecs: 安全组规则信息 (Required) */ func NewModifyNetworkSecurityGroupRulesRequestWithAllParams( regionId string, networkSecurityGroupId string, modifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules, ) *ModifyNetworkSecurityGroupRulesRequest { return &ModifyNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:modifyNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, ModifySecurityGroupRuleSpecs: modifySecurityGroupRuleSpecs, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyNetworkSecurityGroupRulesRequestWithoutParam() *ModifyNetworkSecurityGroupRulesRequest { return &ModifyNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:modifyNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyNetworkSecurityGroupRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ func (r *ModifyNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { r.NetworkSecurityGroupId = networkSecurityGroupId } /* param modifySecurityGroupRuleSpecs: 安全组规则信息(Required) */ func (r *ModifyNetworkSecurityGroupRulesRequest) SetModifySecurityGroupRuleSpecs(modifySecurityGroupRuleSpecs []vpc.ModifySecurityGroupRules) { r.ModifySecurityGroupRuleSpecs = modifySecurityGroupRuleSpecs } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyNetworkSecurityGroupRulesRequest) GetRegionId() string { return r.RegionId } type ModifyNetworkSecurityGroupRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyNetworkSecurityGroupRulesResult `json:"result"` } type ModifyNetworkSecurityGroupRulesResult struct { }���packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyRouteTable.go�0000664�0000000�0000000�00000010335�13771713062�0033136�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyRouteTableRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` /* 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ RouteTableName *string `json:"routeTableName"` /* 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyRouteTableRequest( regionId string, routeTableId string, ) *ModifyRouteTableRequest { return &ModifyRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param routeTableName: 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) * param description: 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ func NewModifyRouteTableRequestWithAllParams( regionId string, routeTableId string, routeTableName *string, description *string, ) *ModifyRouteTableRequest { return &ModifyRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, RouteTableName: routeTableName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyRouteTableRequestWithoutParam() *ModifyRouteTableRequest { return &ModifyRouteTableRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}", Method: "PATCH", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyRouteTableRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *ModifyRouteTableRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } /* param routeTableName: 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ func (r *ModifyRouteTableRequest) SetRouteTableName(routeTableName string) { r.RouteTableName = &routeTableName } /* param description: 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符(Optional) */ func (r *ModifyRouteTableRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyRouteTableRequest) GetRegionId() string { return r.RegionId } type ModifyRouteTableResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyRouteTableResult `json:"result"` } type ModifyRouteTableResult struct { }���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyRouteTableRules.go����������������������������������������������������������������������������0000664�0000000�0000000�00000010002�13771713062�0034061�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models" ) type ModifyRouteTableRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` /* 路由表规则信息 */ ModifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules `json:"modifyRouteTableRuleSpecs"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param modifyRouteTableRuleSpecs: 路由表规则信息 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyRouteTableRulesRequest( regionId string, routeTableId string, modifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules, ) *ModifyRouteTableRulesRequest { return &ModifyRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:modifyRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, ModifyRouteTableRuleSpecs: modifyRouteTableRuleSpecs, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param modifyRouteTableRuleSpecs: 路由表规则信息 (Required) */ func NewModifyRouteTableRulesRequestWithAllParams( regionId string, routeTableId string, modifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules, ) *ModifyRouteTableRulesRequest { return &ModifyRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:modifyRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, ModifyRouteTableRuleSpecs: modifyRouteTableRuleSpecs, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyRouteTableRulesRequestWithoutParam() *ModifyRouteTableRulesRequest { return &ModifyRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:modifyRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyRouteTableRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *ModifyRouteTableRulesRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } /* param modifyRouteTableRuleSpecs: 路由表规则信息(Required) */ func (r *ModifyRouteTableRulesRequest) SetModifyRouteTableRuleSpecs(modifyRouteTableRuleSpecs []vpc.ModifyRouteTableRules) { r.ModifyRouteTableRuleSpecs = modifyRouteTableRuleSpecs } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyRouteTableRulesRequest) GetRegionId() string { return r.RegionId } type ModifyRouteTableRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyRouteTableRulesResult `json:"result"` } type ModifyRouteTableRulesResult struct { }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifySubnet.go�����0000664�0000000�0000000�00000010222�13771713062�0032323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifySubnetRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* Subnet ID */ SubnetId string `json:"subnetId"` /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ SubnetName *string `json:"subnetName"` /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param subnetId: Subnet ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifySubnetRequest( regionId string, subnetId string, ) *ModifySubnetRequest { return &ModifySubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, } } /* * param regionId: Region ID (Required) * param subnetId: Subnet ID (Required) * param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) * param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ func NewModifySubnetRequestWithAllParams( regionId string, subnetId string, subnetName *string, description *string, ) *ModifySubnetRequest { return &ModifySubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, SubnetId: subnetId, SubnetName: subnetName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifySubnetRequestWithoutParam() *ModifySubnetRequest { return &ModifySubnetRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/subnets/{subnetId}", Method: "PATCH", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifySubnetRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param subnetId: Subnet ID(Required) */ func (r *ModifySubnetRequest) SetSubnetId(subnetId string) { r.SubnetId = subnetId } /* param subnetName: 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Optional) */ func (r *ModifySubnetRequest) SetSubnetName(subnetName string) { r.SubnetName = &subnetName } /* param description: 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ func (r *ModifySubnetRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifySubnetRequest) GetRegionId() string { return r.RegionId } type ModifySubnetResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifySubnetResult `json:"result"` } type ModifySubnetResult struct { }������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpc.go��������0000664�0000000�0000000�00000007747�13771713062�0031635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyVpcRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* Vpc ID */ VpcId string `json:"vpcId"` /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ VpcName *string `json:"vpcName"` /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcId: Vpc ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyVpcRequest( regionId string, vpcId string, ) *ModifyVpcRequest { return &ModifyVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, } } /* * param regionId: Region ID (Required) * param vpcId: Vpc ID (Required) * param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) * param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ func NewModifyVpcRequestWithAllParams( regionId string, vpcId string, vpcName *string, description *string, ) *ModifyVpcRequest { return &ModifyVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "PATCH", Header: nil, Version: "v1", }, RegionId: regionId, VpcId: vpcId, VpcName: vpcName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyVpcRequestWithoutParam() *ModifyVpcRequest { return &ModifyVpcRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcs/{vpcId}", Method: "PATCH", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyVpcRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcId: Vpc ID(Required) */ func (r *ModifyVpcRequest) SetVpcId(vpcId string) { r.VpcId = vpcId } /* param vpcName: 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。(Optional) */ func (r *ModifyVpcRequest) SetVpcName(vpcName string) { r.VpcName = &vpcName } /* param description: vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。(Optional) */ func (r *ModifyVpcRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyVpcRequest) GetRegionId() string { return r.RegionId } type ModifyVpcResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyVpcResult `json:"result"` } type ModifyVpcResult struct { }�������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis/ModifyVpcPeering.go�0000664�0000000�0000000�00000010543�13771713062�0033133�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type ModifyVpcPeeringRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* vpcPeeringId ID */ VpcPeeringId string `json:"vpcPeeringId"` /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ VpcPeeringName *string `json:"vpcPeeringName"` /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ Description *string `json:"description"` } /* * param regionId: Region ID (Required) * param vpcPeeringId: vpcPeeringId ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewModifyVpcPeeringRequest( regionId string, vpcPeeringId string, ) *ModifyVpcPeeringRequest { return &ModifyVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "PUT", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringId: vpcPeeringId, } } /* * param regionId: Region ID (Required) * param vpcPeeringId: vpcPeeringId ID (Required) * param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) * param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ func NewModifyVpcPeeringRequestWithAllParams( regionId string, vpcPeeringId string, vpcPeeringName *string, description *string, ) *ModifyVpcPeeringRequest { return &ModifyVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "PUT", Header: nil, Version: "v1", }, RegionId: regionId, VpcPeeringId: vpcPeeringId, VpcPeeringName: vpcPeeringName, Description: description, } } /* This constructor has better compatible ability when API parameters changed */ func NewModifyVpcPeeringRequestWithoutParam() *ModifyVpcPeeringRequest { return &ModifyVpcPeeringRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/vpcPeerings/{vpcPeeringId}", Method: "PUT", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *ModifyVpcPeeringRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param vpcPeeringId: vpcPeeringId ID(Required) */ func (r *ModifyVpcPeeringRequest) SetVpcPeeringId(vpcPeeringId string) { r.VpcPeeringId = vpcPeeringId } /* param vpcPeeringName: VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ func (r *ModifyVpcPeeringRequest) SetVpcPeeringName(vpcPeeringName string) { r.VpcPeeringName = &vpcPeeringName } /* param description: VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符(Optional) */ func (r *ModifyVpcPeeringRequest) SetDescription(description string) { r.Description = &description } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r ModifyVpcPeeringRequest) GetRegionId() string { return r.RegionId } type ModifyVpcPeeringResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result ModifyVpcPeeringResult `json:"result"` } type ModifyVpcPeeringResult struct { }�������������������������������������������������������������������������������������������������������������������������������������������������������������RemoveNetworkAclRules.go����������������������������������������������������������������������������0000664�0000000�0000000�00000007170�13771713062�0034106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type RemoveNetworkAclRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkAclId ID */ NetworkAclId string `json:"networkAclId"` /* networkAcl规则ID列表 */ RuleIds []string `json:"ruleIds"` } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param ruleIds: networkAcl规则ID列表 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewRemoveNetworkAclRulesRequest( regionId string, networkAclId string, ruleIds []string, ) *RemoveNetworkAclRulesRequest { return &RemoveNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:removeNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, RuleIds: ruleIds, } } /* * param regionId: Region ID (Required) * param networkAclId: networkAclId ID (Required) * param ruleIds: networkAcl规则ID列表 (Required) */ func NewRemoveNetworkAclRulesRequestWithAllParams( regionId string, networkAclId string, ruleIds []string, ) *RemoveNetworkAclRulesRequest { return &RemoveNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:removeNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkAclId: networkAclId, RuleIds: ruleIds, } } /* This constructor has better compatible ability when API parameters changed */ func NewRemoveNetworkAclRulesRequestWithoutParam() *RemoveNetworkAclRulesRequest { return &RemoveNetworkAclRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkAcls/{networkAclId}:removeNetworkAclRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *RemoveNetworkAclRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkAclId: networkAclId ID(Required) */ func (r *RemoveNetworkAclRulesRequest) SetNetworkAclId(networkAclId string) { r.NetworkAclId = networkAclId } /* param ruleIds: networkAcl规则ID列表(Required) */ func (r *RemoveNetworkAclRulesRequest) SetRuleIds(ruleIds []string) { r.RuleIds = ruleIds } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r RemoveNetworkAclRulesRequest) GetRegionId() string { return r.RegionId } type RemoveNetworkAclRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result RemoveNetworkAclRulesResult `json:"result"` } type RemoveNetworkAclRulesResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������RemoveNetworkSecurityGroupRules.go������������������������������������������������������������������0000664�0000000�0000000�00000010056�13771713062�0036230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type RemoveNetworkSecurityGroupRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* NetworkSecurityGroup ID */ NetworkSecurityGroupId string `json:"networkSecurityGroupId"` /* 安全组规则Id列表 */ RuleIds []string `json:"ruleIds"` } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * param ruleIds: 安全组规则Id列表 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewRemoveNetworkSecurityGroupRulesRequest( regionId string, networkSecurityGroupId string, ruleIds []string, ) *RemoveNetworkSecurityGroupRulesRequest { return &RemoveNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:removeNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, RuleIds: ruleIds, } } /* * param regionId: Region ID (Required) * param networkSecurityGroupId: NetworkSecurityGroup ID (Required) * param ruleIds: 安全组规则Id列表 (Required) */ func NewRemoveNetworkSecurityGroupRulesRequestWithAllParams( regionId string, networkSecurityGroupId string, ruleIds []string, ) *RemoveNetworkSecurityGroupRulesRequest { return &RemoveNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:removeNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkSecurityGroupId: networkSecurityGroupId, RuleIds: ruleIds, } } /* This constructor has better compatible ability when API parameters changed */ func NewRemoveNetworkSecurityGroupRulesRequestWithoutParam() *RemoveNetworkSecurityGroupRulesRequest { return &RemoveNetworkSecurityGroupRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkSecurityGroups/{networkSecurityGroupId}:removeNetworkSecurityGroupRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *RemoveNetworkSecurityGroupRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkSecurityGroupId: NetworkSecurityGroup ID(Required) */ func (r *RemoveNetworkSecurityGroupRulesRequest) SetNetworkSecurityGroupId(networkSecurityGroupId string) { r.NetworkSecurityGroupId = networkSecurityGroupId } /* param ruleIds: 安全组规则Id列表(Required) */ func (r *RemoveNetworkSecurityGroupRulesRequest) SetRuleIds(ruleIds []string) { r.RuleIds = ruleIds } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r RemoveNetworkSecurityGroupRulesRequest) GetRegionId() string { return r.RegionId } type RemoveNetworkSecurityGroupRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result RemoveNetworkSecurityGroupRulesResult `json:"result"` } type RemoveNetworkSecurityGroupRulesResult struct { }����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������RemoveRouteTableRules.go����������������������������������������������������������������������������0000664�0000000�0000000�00000007154�13771713062�0034105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type RemoveRouteTableRulesRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* RouteTable ID */ RouteTableId string `json:"routeTableId"` /* 路由表规则Id列表 */ RuleIds []string `json:"ruleIds"` } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param ruleIds: 路由表规则Id列表 (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewRemoveRouteTableRulesRequest( regionId string, routeTableId string, ruleIds []string, ) *RemoveRouteTableRulesRequest { return &RemoveRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:removeRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, RuleIds: ruleIds, } } /* * param regionId: Region ID (Required) * param routeTableId: RouteTable ID (Required) * param ruleIds: 路由表规则Id列表 (Required) */ func NewRemoveRouteTableRulesRequestWithAllParams( regionId string, routeTableId string, ruleIds []string, ) *RemoveRouteTableRulesRequest { return &RemoveRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:removeRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, RouteTableId: routeTableId, RuleIds: ruleIds, } } /* This constructor has better compatible ability when API parameters changed */ func NewRemoveRouteTableRulesRequestWithoutParam() *RemoveRouteTableRulesRequest { return &RemoveRouteTableRulesRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/routeTables/{routeTableId}:removeRouteTableRules", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *RemoveRouteTableRulesRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param routeTableId: RouteTable ID(Required) */ func (r *RemoveRouteTableRulesRequest) SetRouteTableId(routeTableId string) { r.RouteTableId = routeTableId } /* param ruleIds: 路由表规则Id列表(Required) */ func (r *RemoveRouteTableRulesRequest) SetRuleIds(ruleIds []string) { r.RuleIds = ruleIds } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r RemoveRouteTableRulesRequest) GetRegionId() string { return r.RegionId } type RemoveRouteTableRulesResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result RemoveRouteTableRulesResult `json:"result"` } type RemoveRouteTableRulesResult struct { }��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnassignSecondaryIps.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000007345�13771713062�0033763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis����������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package apis import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" ) type UnassignSecondaryIpsRequest struct { core.JDCloudRequest /* Region ID */ RegionId string `json:"regionId"` /* networkInterface ID */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 指定删除的secondaryIp地址 (Optional) */ SecondaryIps []string `json:"secondaryIps"` } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * * @Deprecated, not compatible when mandatory parameters changed */ func NewUnassignSecondaryIpsRequest( regionId string, networkInterfaceId string, ) *UnassignSecondaryIpsRequest { return &UnassignSecondaryIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:unassignSecondaryIps", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, } } /* * param regionId: Region ID (Required) * param networkInterfaceId: networkInterface ID (Required) * param secondaryIps: 指定删除的secondaryIp地址 (Optional) */ func NewUnassignSecondaryIpsRequestWithAllParams( regionId string, networkInterfaceId string, secondaryIps []string, ) *UnassignSecondaryIpsRequest { return &UnassignSecondaryIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:unassignSecondaryIps", Method: "POST", Header: nil, Version: "v1", }, RegionId: regionId, NetworkInterfaceId: networkInterfaceId, SecondaryIps: secondaryIps, } } /* This constructor has better compatible ability when API parameters changed */ func NewUnassignSecondaryIpsRequestWithoutParam() *UnassignSecondaryIpsRequest { return &UnassignSecondaryIpsRequest{ JDCloudRequest: core.JDCloudRequest{ URL: "/regions/{regionId}/networkInterfaces/{networkInterfaceId}:unassignSecondaryIps", Method: "POST", Header: nil, Version: "v1", }, } } /* param regionId: Region ID(Required) */ func (r *UnassignSecondaryIpsRequest) SetRegionId(regionId string) { r.RegionId = regionId } /* param networkInterfaceId: networkInterface ID(Required) */ func (r *UnassignSecondaryIpsRequest) SetNetworkInterfaceId(networkInterfaceId string) { r.NetworkInterfaceId = networkInterfaceId } /* param secondaryIps: 指定删除的secondaryIp地址(Optional) */ func (r *UnassignSecondaryIpsRequest) SetSecondaryIps(secondaryIps []string) { r.SecondaryIps = secondaryIps } // GetRegionId returns path parameter 'regionId' if exist, // otherwise return empty string func (r UnassignSecondaryIpsRequest) GetRegionId() string { return r.RegionId } type UnassignSecondaryIpsResponse struct { RequestID string `json:"requestId"` Error core.ErrorResponse `json:"error"` Result UnassignSecondaryIpsResult `json:"result"` } type UnassignSecondaryIpsResult struct { }�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client/������������������0000775�0000000�0000000�00000000000�13771713062�0027711�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client/VpcClient.go������0000664�0000000�0000000�00000105662�13771713062�0032141�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package client import ( "github.com/jdcloud-api/jdcloud-sdk-go/core" vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis" "encoding/json" "errors" ) type VpcClient struct { core.JDCloudClient } func NewVpcClient(credential *core.Credential) *VpcClient { if credential == nil { return nil } config := core.NewConfig() config.SetEndpoint("vpc.jdcloud-api.com") return &VpcClient{ core.JDCloudClient{ Credential: *credential, Config: *config, ServiceName: "vpc", Revision: "0.5.1", Logger: core.NewDefaultLogger(core.LogInfo), }} } func (c *VpcClient) SetConfig(config *core.Config) { c.Config = *config } func (c *VpcClient) SetLogger(logger core.Logger) { c.Logger = logger } /* 删除弹性Ip */ func (c *VpcClient) DeleteElasticIp(request *vpc.DeleteElasticIpRequest) (*vpc.DeleteElasticIpResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteElasticIpResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改VpcPeering接口 */ func (c *VpcClient) ModifyVpcPeering(request *vpc.ModifyVpcPeeringRequest) (*vpc.ModifyVpcPeeringResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyVpcPeeringResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改弹性IP */ func (c *VpcClient) ModifyElasticIp(request *vpc.ModifyElasticIpRequest) (*vpc.ModifyElasticIpResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyElasticIpResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改networkAcl接口 */ func (c *VpcClient) ModifyNetworkAclRules(request *vpc.ModifyNetworkAclRulesRequest) (*vpc.ModifyNetworkAclRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyNetworkAclRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除networkAcl接口 */ func (c *VpcClient) DeleteNetworkAcl(request *vpc.DeleteNetworkAclRequest) (*vpc.DeleteNetworkAclResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteNetworkAclResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除子网 */ func (c *VpcClient) DeleteSubnet(request *vpc.DeleteSubnetRequest) (*vpc.DeleteSubnetResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteSubnetResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询子网列表 */ func (c *VpcClient) DescribeSubnets(request *vpc.DescribeSubnetsRequest) (*vpc.DescribeSubnetsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeSubnetsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询弹性网卡列表 */ func (c *VpcClient) DescribeNetworkInterfaces(request *vpc.DescribeNetworkInterfacesRequest) (*vpc.DescribeNetworkInterfacesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeNetworkInterfacesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 移除安全组规则 */ func (c *VpcClient) RemoveNetworkSecurityGroupRules(request *vpc.RemoveNetworkSecurityGroupRulesRequest) (*vpc.RemoveNetworkSecurityGroupRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.RemoveNetworkSecurityGroupRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改安全组属性 */ func (c *VpcClient) ModifyNetworkSecurityGroup(request *vpc.ModifyNetworkSecurityGroupRequest) (*vpc.ModifyNetworkSecurityGroupResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyNetworkSecurityGroupResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 添加安全组规则 */ func (c *VpcClient) AddNetworkSecurityGroupRules(request *vpc.AddNetworkSecurityGroupRulesRequest) (*vpc.AddNetworkSecurityGroupRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.AddNetworkSecurityGroupRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建networkAcl接口 */ func (c *VpcClient) CreateNetworkAcl(request *vpc.CreateNetworkAclRequest) (*vpc.CreateNetworkAclResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateNetworkAclResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询配额信息 */ func (c *VpcClient) DescribeQuota(request *vpc.DescribeQuotaRequest) (*vpc.DescribeQuotaResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeQuotaResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建路由表 */ func (c *VpcClient) CreateRouteTable(request *vpc.CreateRouteTableRequest) (*vpc.CreateRouteTableResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateRouteTableResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除安全组 */ func (c *VpcClient) DeleteNetworkSecurityGroup(request *vpc.DeleteNetworkSecurityGroupRequest) (*vpc.DeleteNetworkSecurityGroupResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteNetworkSecurityGroupResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询路由表信息详情 */ func (c *VpcClient) DescribeRouteTable(request *vpc.DescribeRouteTableRequest) (*vpc.DescribeRouteTableResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeRouteTableResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除私有网络 */ func (c *VpcClient) DeleteVpc(request *vpc.DeleteVpcRequest) (*vpc.DeleteVpcResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteVpcResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询VpcPeering资源列表 */ func (c *VpcClient) DescribeVpcPeerings(request *vpc.DescribeVpcPeeringsRequest) (*vpc.DescribeVpcPeeringsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeVpcPeeringsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询Acl列表 */ func (c *VpcClient) DescribeNetworkAcls(request *vpc.DescribeNetworkAclsRequest) (*vpc.DescribeNetworkAclsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeNetworkAclsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询子网信息详情 */ func (c *VpcClient) DescribeSubnet(request *vpc.DescribeSubnetRequest) (*vpc.DescribeSubnetResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeSubnetResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询安全组信息详情 */ func (c *VpcClient) DescribeNetworkSecurityGroup(request *vpc.DescribeNetworkSecurityGroupRequest) (*vpc.DescribeNetworkSecurityGroupResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeNetworkSecurityGroupResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询安全组列表 */ func (c *VpcClient) DescribeNetworkSecurityGroups(request *vpc.DescribeNetworkSecurityGroupsRequest) (*vpc.DescribeNetworkSecurityGroupsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeNetworkSecurityGroupsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询Vpc信息详情 */ func (c *VpcClient) DescribeVpc(request *vpc.DescribeVpcRequest) (*vpc.DescribeVpcResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeVpcResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 给子网解绑NetworkAcl接口 */ func (c *VpcClient) DisassociateNetworkAcl(request *vpc.DisassociateNetworkAclRequest) (*vpc.DisassociateNetworkAclResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DisassociateNetworkAclResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 移除networkAcl规则 */ func (c *VpcClient) RemoveNetworkAclRules(request *vpc.RemoveNetworkAclRulesRequest) (*vpc.RemoveNetworkAclRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.RemoveNetworkAclRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 路由表绑定子网接口 */ func (c *VpcClient) AssociateRouteTable(request *vpc.AssociateRouteTableRequest) (*vpc.AssociateRouteTableResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.AssociateRouteTableResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询私有网络列表 */ func (c *VpcClient) DescribeVpcs(request *vpc.DescribeVpcsRequest) (*vpc.DescribeVpcsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeVpcsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建安全组 */ func (c *VpcClient) CreateNetworkSecurityGroup(request *vpc.CreateNetworkSecurityGroupRequest) (*vpc.CreateNetworkSecurityGroupResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateNetworkSecurityGroupResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建子网 */ func (c *VpcClient) CreateSubnet(request *vpc.CreateSubnetRequest) (*vpc.CreateSubnetResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateSubnetResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除路由表 */ func (c *VpcClient) DeleteRouteTable(request *vpc.DeleteRouteTableRequest) (*vpc.DeleteRouteTableResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteRouteTableResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询VpcPeering资源详情 */ func (c *VpcClient) DescribeVpcPeering(request *vpc.DescribeVpcPeeringRequest) (*vpc.DescribeVpcPeeringResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeVpcPeeringResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 移除路由表规则 */ func (c *VpcClient) RemoveRouteTableRules(request *vpc.RemoveRouteTableRulesRequest) (*vpc.RemoveRouteTableRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.RemoveRouteTableRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建VpcPeering接口 */ func (c *VpcClient) CreateVpcPeering(request *vpc.CreateVpcPeeringRequest) (*vpc.CreateVpcPeeringResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateVpcPeeringResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 给网卡分配secondaryIp接口 */ func (c *VpcClient) AssignSecondaryIps(request *vpc.AssignSecondaryIpsRequest) (*vpc.AssignSecondaryIpsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.AssignSecondaryIpsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询路由表列表 */ func (c *VpcClient) DescribeRouteTables(request *vpc.DescribeRouteTablesRequest) (*vpc.DescribeRouteTablesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeRouteTablesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改弹性网卡接口 */ func (c *VpcClient) ModifyNetworkInterface(request *vpc.ModifyNetworkInterfaceRequest) (*vpc.ModifyNetworkInterfaceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyNetworkInterfaceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询弹性ip列表 */ func (c *VpcClient) DescribeElasticIps(request *vpc.DescribeElasticIpsRequest) (*vpc.DescribeElasticIpsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeElasticIpsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改安全组规则 */ func (c *VpcClient) ModifyNetworkSecurityGroupRules(request *vpc.ModifyNetworkSecurityGroupRulesRequest) (*vpc.ModifyNetworkSecurityGroupRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyNetworkSecurityGroupRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改networkAcl接口 */ func (c *VpcClient) ModifyNetworkAcl(request *vpc.ModifyNetworkAclRequest) (*vpc.ModifyNetworkAclResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyNetworkAclResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询弹性网卡信息详情 */ func (c *VpcClient) DescribeNetworkInterface(request *vpc.DescribeNetworkInterfaceRequest) (*vpc.DescribeNetworkInterfaceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeNetworkInterfaceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 给网卡解绑弹性Ip接口 */ func (c *VpcClient) DisassociateElasticIp(request *vpc.DisassociateElasticIpRequest) (*vpc.DisassociateElasticIpResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DisassociateElasticIpResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除VpcPeering接口 */ func (c *VpcClient) DeleteVpcPeering(request *vpc.DeleteVpcPeeringRequest) (*vpc.DeleteVpcPeeringResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteVpcPeeringResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建网卡接口,只能创建辅助网卡 */ func (c *VpcClient) CreateNetworkInterface(request *vpc.CreateNetworkInterfaceRequest) (*vpc.CreateNetworkInterfaceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateNetworkInterfaceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建私有网络 */ func (c *VpcClient) CreateVpc(request *vpc.CreateVpcRequest) (*vpc.CreateVpcResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateVpcResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改路由表规则 */ func (c *VpcClient) ModifyRouteTableRules(request *vpc.ModifyRouteTableRulesRequest) (*vpc.ModifyRouteTableRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyRouteTableRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 添加路由表规则 */ func (c *VpcClient) AddRouteTableRules(request *vpc.AddRouteTableRulesRequest) (*vpc.AddRouteTableRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.AddRouteTableRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* ElasticIp资源信息详情 */ func (c *VpcClient) DescribeElasticIp(request *vpc.DescribeElasticIpRequest) (*vpc.DescribeElasticIpResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeElasticIpResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 给网卡删除secondaryIp接口 */ func (c *VpcClient) UnassignSecondaryIps(request *vpc.UnassignSecondaryIpsRequest) (*vpc.UnassignSecondaryIpsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.UnassignSecondaryIpsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改路由表属性 */ func (c *VpcClient) ModifyRouteTable(request *vpc.ModifyRouteTableRequest) (*vpc.ModifyRouteTableResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyRouteTableResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 给网卡绑定弹性Ip接口 */ func (c *VpcClient) AssociateElasticIp(request *vpc.AssociateElasticIpRequest) (*vpc.AssociateElasticIpResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.AssociateElasticIpResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 给路由表解绑子网接口 */ func (c *VpcClient) DisassociateRouteTable(request *vpc.DisassociateRouteTableRequest) (*vpc.DisassociateRouteTableResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DisassociateRouteTableResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改私有网络接口 */ func (c *VpcClient) ModifyVpc(request *vpc.ModifyVpcRequest) (*vpc.ModifyVpcResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifyVpcResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 给子网绑定networkAcl接口 */ func (c *VpcClient) AssociateNetworkAcl(request *vpc.AssociateNetworkAclRequest) (*vpc.AssociateNetworkAclResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.AssociateNetworkAclResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 修改子网接口 */ func (c *VpcClient) ModifySubnet(request *vpc.ModifySubnetRequest) (*vpc.ModifySubnetResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.ModifySubnetResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 创建一个或者多个弹性Ip */ func (c *VpcClient) CreateElasticIps(request *vpc.CreateElasticIpsRequest) (*vpc.CreateElasticIpsResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.CreateElasticIpsResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 删除弹性网卡接口 */ func (c *VpcClient) DeleteNetworkInterface(request *vpc.DeleteNetworkInterfaceRequest) (*vpc.DeleteNetworkInterfaceResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DeleteNetworkInterfaceResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 查询networkAcl资源详情 */ func (c *VpcClient) DescribeNetworkAcl(request *vpc.DescribeNetworkAclRequest) (*vpc.DescribeNetworkAclResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.DescribeNetworkAclResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } /* 添加networkAcl规则接口 */ func (c *VpcClient) AddNetworkAclRules(request *vpc.AddNetworkAclRulesRequest) (*vpc.AddNetworkAclRulesResponse, error) { if request == nil { return nil, errors.New("Request object is nil. ") } resp, err := c.Send(request, c.ServiceName) if err != nil { return nil, err } jdResp := &vpc.AddNetworkAclRulesResponse{} err = json.Unmarshal(resp, jdResp) if err != nil { c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp)) return nil, err } return jdResp, err } ������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/������������������0000775�0000000�0000000�00000000000�13771713062�0027716�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������AddNetworkAclRuleSpec.go����������������������������������������������������������������������������0000664�0000000�0000000�00000003713�13771713062�0034317�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AddNetworkAclRuleSpec struct { /* 规则限定协议。取值范围:All,TCP,UDP,ICMP */ Protocol string `json:"protocol"` /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ FromPort *int `json:"fromPort"` /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ ToPort *int `json:"toPort"` /* networkAcl规则方向。ingress:入规则; egress:出规则 */ Direction string `json:"direction"` /* 匹配地址前缀 */ AddressPrefix string `json:"addressPrefix"` /* 访问控制策略:allow:允许,deny:拒绝 */ RuleAction string `json:"ruleAction"` /* 规则匹配优先级,取值范围为[1,32768],优先级数字越小优先级越高 */ Priority int `json:"priority"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } �����������������������������������������������������AddNetworkAclRulesSpec.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001505�13771713062�0034477�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AddNetworkAclRulesSpec struct { /* networkAcl规则列表 */ NetworkAclRuleSpecs []AddNetworkAclRuleSpec `json:"networkAclRuleSpecs"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AddNetworkSecurityGroupRulesSpec.go�����������������������������������������������������������������0000664�0000000�0000000�00000001542�13771713062�0036625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AddNetworkSecurityGroupRulesSpec struct { /* 安全组规则信息 */ NetworkSecurityGroupRuleSpecs []AddSecurityGroupRules `json:"networkSecurityGroupRuleSpecs"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������AddRouteTableRules.go�������������������������������������������������������������������������������0000664�0000000�0000000�00000002765�13771713062�0033672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AddRouteTableRules struct { /* 下一跳类型, 取值范围:instance:云主机, internet:公网, vpc_peering:vpc对等连接, bgw:边界网关 */ NextHopType string `json:"nextHopType"` /* 下一跳id */ NextHopId string `json:"nextHopId"` /* 匹配地址前缀, internet类型路由跟其他类型的路由,addressPrefix不允许重复 */ AddressPrefix string `json:"addressPrefix"` /* 规则匹配优先级,取值范围[1,255],默认为100。当路由规则子网掩码不同时,路由最长匹配优先;当路由规则子网掩码相同时, 按照优先级匹配转发, 优先级数字越小优先级越高,路由规则子网掩码相同、优先级相同、下一跳不同时,形成等价路由,不同下一跳负载均担。 (Optional) */ Priority *int `json:"priority"` } �����������AddRouteTableRulesSpec.go���������������������������������������������������������������������������0000664�0000000�0000000�00000001501�13771713062�0034470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AddRouteTableRulesSpec struct { /* 安全组规则信息 */ RouteTableRuleSpecs []AddRouteTableRules `json:"routeTableRuleSpecs"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AddSecurityGroupRules.go����������������������������������������������������������������������������0000664�0000000�0000000�00000003257�13771713062�0034445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AddSecurityGroupRules struct { /* 规则限定协议。300:All; 6:TCP; 17:UDP; 1:ICMP */ Protocol int `json:"protocol"` /* 安全组规则方向。0:入规则; 1:出规则 */ Direction int `json:"direction"` /* 匹配地址前缀 */ AddressPrefix string `json:"addressPrefix"` /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ FromPort *int `json:"fromPort"` /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ ToPort *int `json:"toPort"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AssignSecondaryIpsSpec.go���������������������������������������������������������������������������0000664�0000000�0000000�00000002165�13771713062�0034555�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AssignSecondaryIpsSpec struct { /* secondary ip被其他接口占用时,是否抢占。false:非抢占重分配,true:抢占重分配,默认抢占重分配。默认值:true (Optional) */ Force bool `json:"force"` /* 指定分配的secondaryIp地址 (Optional) */ SecondaryIps []string `json:"secondaryIps"` /* 指定自动分配的secondaryIp个数 (Optional) */ SecondaryIpCount int `json:"secondaryIpCount"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AssociateElasticIpSpec.go���������������������������������������������������������������������������0000664�0000000�0000000�00000002000�13771713062�0034502�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AssociateElasticIpSpec struct { /* 绑定的弹性Ip Id (Optional) */ ElasticIpId string `json:"elasticIpId"` /* 绑定弹性Ip到指定的privateIp (Optional) */ PrivateIpAddress string `json:"privateIpAddress"` /* 绑定的弹性Ip地址 (Optional) */ ElasticIpAddress string `json:"elasticIpAddress"` } AssociateRouteTableSpec.go��������������������������������������������������������������������������0000664�0000000�0000000�00000001550�13771713062�0034704�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type AssociateRouteTableSpec struct { /* 路由表要绑定的子网ID列表, subnet已被其他路由表绑定时,自动解绑。 */ SubnetIds []string `json:"subnetIds"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������CreateElasticIpSpec.go������������������������������������������������������������������������������0000664�0000000�0000000�00000002040�13771713062�0033776�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type CreateElasticIpSpec struct { /* 购买弹性ip数量;取值范围:[1,100] */ MaxCount int `json:"maxCount"` /* 指定弹性ip地址进行创建,当申请创建多个弹性ip时,必须为空 (Optional) */ ElasticIpAddress string `json:"elasticIpAddress"` /* 弹性ip规格 */ ElasticIpSpec ElasticIpSpec `json:"elasticIpSpec"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������CreateVpcPeeringSpec.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000002320�13771713062�0034164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type CreateVpcPeeringSpec struct { /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 */ VpcPeeringName string `json:"vpcPeeringName"` /* VpcPeering本端Vpc的Id */ VpcId string `json:"vpcId"` /* VpcPeering对端Vpc的Id */ RemoteVpcId string `json:"remoteVpcId"` /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ Description string `json:"description"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������DisassociateElasticIpSpec.go������������������������������������������������������������������������0000664�0000000�0000000�00000001637�13771713062�0035221�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type DisassociateElasticIpSpec struct { /* 指定解绑的弹性Ip Id (Optional) */ ElasticIpId string `json:"elasticIpId"` /* 指定解绑的弹性Ip地址 (Optional) */ ElasticIpAddress string `json:"elasticIpAddress"` } �������������������������������������������������������������������������������������������������DisassociateRouteTableSpec.go�����������������������������������������������������������������������0000664�0000000�0000000�00000001520�13771713062�0035401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type DisassociateRouteTableSpec struct { /* 路由表要解绑的子网ID,解绑后子网绑定默认路由表 */ SubnetId string `json:"subnetId"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIp.go������0000664�0000000�0000000�00000003366�13771713062�0032132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" type ElasticIp struct { /* 弹性IP的Id (Optional) */ ElasticIpId string `json:"elasticIpId"` /* 弹性IP地址 (Optional) */ ElasticIpAddress string `json:"elasticIpAddress"` /* 弹性ip的限速(单位:Mbps) (Optional) */ BandwidthMbps int `json:"bandwidthMbps"` /* IP服务商,取值为bgp或no_bgp (Optional) */ Provider string `json:"provider"` /* 私有IP的IPV4地址 (Optional) */ PrivateIpAddress string `json:"privateIpAddress"` /* 配置弹性网卡Id (Optional) */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 实例Id (Optional) */ InstanceId string `json:"instanceId"` /* 实例类型 (Optional) */ InstanceType string `json:"instanceType"` /* 计费配置 (Optional) */ Charge charge.Charge `json:"charge"` /* 弹性ip创建时间 (Optional) */ CreatedTime string `json:"createdTime"` /* 弹性ip可用区属性,如果为空,表示全可用区 (Optional) */ Az string `json:"az"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ElasticIpSpec.go��0000664�0000000�0000000�00000002245�13771713062�0032740�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models" type ElasticIpSpec struct { /* 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] */ BandwidthMbps int `json:"bandwidthMbps"` /* IP服务商,取值为bgp或no_bgp,cn-north-1:bgp;cn-south-1:[bgp,no_bgp];cn-east-1:[bgp,no_bgp];cn-east-2:bgp */ Provider string `json:"provider"` /* 计费配置 (Optional) */ ChargeSpec *charge.ChargeSpec `json:"chargeSpec"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyElasticIpSpec.go������������������������������������������������������������������������������0000664�0000000�0000000�00000001517�13771713062�0034032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyElasticIpSpec struct { /* 弹性公网IP的限速(单位:Mbps),取值范围为[1-200] */ BandwidthMbps int `json:"bandwidthMbps"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkAclRuleSpec.go�������������������������������������������������������������������������0000664�0000000�0000000�00000003706�13771713062�0035060�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyNetworkAclRuleSpec struct { /* networkAcl规则ID */ RuleId string `json:"ruleId"` /* 规则限定协议。取值范围:All,TCP,UDP,ICMP (Optional) */ Protocol *string `json:"protocol"` /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ FromPort *int `json:"fromPort"` /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ ToPort *int `json:"toPort"` /* 匹配地址前缀 (Optional) */ AddressPrefix *string `json:"addressPrefix"` /* 访问控制策略:allow:允许,deny:拒绝 (Optional) */ RuleAction *string `json:"ruleAction"` /* 规则匹配优先级,取值范围为[1,32768],优先级数字越小优先级越高 (Optional) */ Priority *int `json:"priority"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } ����������������������������������������������������������ModifyNetworkAclRuleSpecs.go������������������������������������������������������������������������0000664�0000000�0000000�00000001527�13771713062�0035242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyNetworkAclRuleSpecs struct { /* networkAcl规则列表 */ ModifyNetworkAclRuleSpecs []ModifyNetworkAclRuleSpec `json:"modifyNetworkAclRuleSpecs"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkAclRulesSpec.go������������������������������������������������������������������������0000664�0000000�0000000�00000001527�13771713062�0035242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyNetworkAclRulesSpec struct { /* networkAcl规则列表 */ ModifyNetworkAclRuleSpecs []ModifyNetworkAclRuleSpec `json:"modifyNetworkAclRuleSpecs"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkAclSpec.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000002067�13771713062�0034227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyNetworkAclSpec struct { /* networkAcl名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ NetworkAclName string `json:"networkAclName"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkInterfaceSpec.go�����������������������������������������������������������������������0000664�0000000�0000000�00000002377�13771713062�0035434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyNetworkInterfaceSpec struct { /* 弹性网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符 (Optional) */ NetworkInterfaceName string `json:"networkInterfaceName"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` /* 以覆盖原有安全组的方式更新的安全组。如果更新安全组ID列表,最多5个安全组 (Optional) */ SecurityGroups []string `json:"securityGroups"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyNetworkSecurityGroupSpec.go�������������������������������������������������������������������0000664�0000000�0000000�00000002066�13771713062�0036353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyNetworkSecurityGroupSpec struct { /* 安全组的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ NetworkSecurityGroupName string `json:"networkSecurityGroupName"` /* 安全组的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ Description string `json:"description"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyQuotaSpec.go0000664�0000000�0000000�00000002173�13771713062�0033324�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyQuotaSpec struct { /* 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) */ Type string `json:"type"` /* type为vpc、elastic_ip、network_interface不设置, type为subnet、security_group、vpcpeering设置为vpcId (Optional) */ ParentResourceId string `json:"parentResourceId"` /* 配额大小 */ MaxLimit int `json:"maxLimit"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyRouteTableRules.go����������������������������������������������������������������������������0000664�0000000�0000000�00000003120�13771713062�0034413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyRouteTableRules struct { /* 路由表规则的ID */ RuleId string `json:"ruleId"` /* 规则匹配优先级,取值范围[1,255]。当路由规则子网掩码不同时,路由最长匹配优先;当路由规则子网掩码相同时, 按照优先级匹配转发, 优先级数字越小优先级越高,路由规则子网掩码相同、优先级相同、下一跳不同时,形成等价路由,不同下一跳负载均担。 (Optional) */ Priority *int `json:"priority"` /* 下一跳类型, 取值范围:instance:云主机, internet:公网, vpc_peering:vpc对等连接, bgw:边界网关 (Optional) */ NextHopType *string `json:"nextHopType"` /* 下一跳id (Optional) */ NextHopId *string `json:"nextHopId"` /* 路由表规则前缀, internet类型路由跟其他类型的路由,addressPrefix不允许重复 (Optional) */ AddressPrefix *string `json:"addressPrefix"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyRouteTableRulesSpec.go������������������������������������������������������������������������0000664�0000000�0000000�00000001523�13771713062�0035233�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyRouteTableRulesSpec struct { /* 路由表规则信息 */ ModifyRouteTableRuleSpecs []ModifyRouteTableRules `json:"modifyRouteTableRuleSpecs"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyRouteTableSpec.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000002030�13771713062�0034212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyRouteTableSpec struct { /* 路由表的名字。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ RouteTableName string `json:"routeTableName"` /* 路由表的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ Description string `json:"description"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifySecurityGroupRuleSpec.go����������������������������������������������������������������������0000664�0000000�0000000�00000001536�13771713062�0035632�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifySecurityGroupRuleSpec struct { /* 安全组规则信息 */ ModifySecurityGroupRuleSpecs []ModifySecurityGroupRules `json:"modifySecurityGroupRuleSpecs"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifySecurityGroupRules.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002567�13771713062�0035207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifySecurityGroupRules struct { /* 安全组规则的ID。 */ RuleId string `json:"ruleId"` /* 规则限定协议。300:All; 6:TCP; 17:UDP; 1:ICMP (Optional) */ Protocol *int `json:"protocol"` /* 安全组规则的起始端口。取值范围:1-65535 (Optional) */ FromPort *int `json:"fromPort"` /* 安全组规则的终端口。取值范围:1-65535 (Optional) */ ToPort *int `json:"toPort"` /* 安全组规则前缀,取值范围:正确的CIDR (Optional) */ AddressPrefix *string `json:"addressPrefix"` /* 安全组规则的描述,取值范围:0-256个UTF-8编码下的全部字符 (Optional) */ Description *string `json:"description"` } �����������������������������������������������������������������������������������������������������������������������������������������ModifySubnetSpec.go���������������������������������������������������������������������������������0000664�0000000�0000000�00000002073�13771713062�0033413�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifySubnetSpec struct { /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ SubnetName string `json:"subnetName"` /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description string `json:"description"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ModifyVpcPeeringSpec.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000002104�13771713062�0034210�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyVpcPeeringSpec struct { /* VpcPeering的名字,不为空。名称取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ VpcPeeringName string `json:"vpcPeeringName"` /* VpcPeering 描述,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ Description string `json:"description"` } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/ModifyVpcSpec.go��0000664�0000000�0000000�00000002057�13771713062�0032764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type ModifyVpcSpec struct { /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ VpcName string `json:"vpcName"` /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description string `json:"description"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAcl.go�����0000664�0000000�0000000�00000002546�13771713062�0032325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkAcl struct { /* networkAcl ID (Optional) */ NetworkAclId string `json:"networkAclId"` /* networkAcl名称 (Optional) */ NetworkAclName string `json:"networkAclName"` /* 私有网络 ID (Optional) */ VpcId string `json:"vpcId"` /* networkAcl规则列表 (Optional) */ NetworkAclRules []NetworkAclRule `json:"networkAclRules"` /* networkAcl绑定的子网列表 (Optional) */ SubnetIds []string `json:"subnetIds"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` /* networkAcl创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclRule.go�0000664�0000000�0000000�00000004233�13771713062�0033150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkAclRule struct { /* networkAcl规则ID (Optional) */ RuleId string `json:"ruleId"` /* 规则限定协议。取值范围:All,TCP,UDP,ICMP (Optional) */ Protocol string `json:"protocol"` /* 规则限定起始传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为1,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ FromPort int `json:"fromPort"` /* 规则限定终止传输层端口, 取值范围:1-65535, 若protocol为传输层协议,默认值为65535,若protocol不是传输层协议,设置无效,恒为0。如果规则只限定一个端口号,fromPort和toPort填写同一个值 (Optional) */ ToPort int `json:"toPort"` /* networkAcl规则方向。ingress:入规则; egress:出规则 (Optional) */ Direction string `json:"direction"` /* 匹配地址前缀 (Optional) */ AddressPrefix string `json:"addressPrefix"` /* 访问控制策略:allow:允许,deny:拒绝 (Optional) */ RuleAction string `json:"ruleAction"` /* 规则匹配优先级,取值范围为[1,32768],优先级数字越小优先级越高 (Optional) */ Priority int `json:"priority"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` /* networkAclRule创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/NetworkAclSpec.go�0000664�0000000�0000000�00000001737�13771713062�0033141�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkAclSpec struct { /* 私有网络id */ VpcId string `json:"vpcId"` /* networkAcl名称 */ NetworkAclName string `json:"networkAclName"` /* 描述,允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` } ���������������������������������NetworkInterface.go���������������������������������������������������������������������������������0000664�0000000�0000000�00000004570�13771713062�0033446�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkInterface struct { /* 弹性网卡名称 (Optional) */ NetworkInterfaceName string `json:"networkInterfaceName"` /* 弹性网卡ID (Optional) */ NetworkInterfaceId string `json:"networkInterfaceId"` /* 可用区名称 (Optional) */ Az string `json:"az"` /* 网卡角色,取值范围:Primary(主网卡)、Secondary(辅助网卡) (Optional) */ Role string `json:"role"` /* 以太网地址 (Optional) */ MacAddress string `json:"macAddress"` /* 虚拟网络ID (Optional) */ VpcId string `json:"vpcId"` /* 子网ID (Optional) */ SubnetId string `json:"subnetId"` /* 安全组ID列表 (Optional) */ NetworkSecurityGroupIds []string `json:"networkSecurityGroupIds"` /* 源和目标IP地址校验,取值为0或者1 (Optional) */ SanityCheck int `json:"sanityCheck"` /* 网卡主IP (Optional) */ PrimaryIp NetworkInterfacePrivateIp `json:"primaryIp"` /* 网卡附属IP列表 (Optional) */ SecondaryIps []NetworkInterfacePrivateIp `json:"secondaryIps"` /* 关联实例类型,取值范围:vm (Optional) */ InstanceType string `json:"instanceType"` /* 关联实例ID (Optional) */ InstanceId string `json:"instanceId"` /* 实例所属的账号 (Optional) */ InstanceOwnerId string `json:"instanceOwnerId"` /* 网卡在实例上的设备索引号,取值范围:[0,8],0:辅助网卡未绑定设备,1:主网卡,2-8:辅助网卡已绑定设备 (Optional) */ DeviceIndex int `json:"deviceIndex"` /* 网卡描述信息 (Optional) */ Description string `json:"description"` /* 弹性网卡创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } ����������������������������������������������������������������������������������������������������������������������������������������NetworkInterfacePrivateIp.go������������������������������������������������������������������������0000664�0000000�0000000�00000001756�13771713062�0035275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkInterfacePrivateIp struct { /* 私有IP的IPV4地址 (Optional) */ PrivateIpAddress string `json:"privateIpAddress"` /* 弹性IP实例ID (Optional) */ ElasticIpId string `json:"elasticIpId"` /* 弹性IP实例地址 (Optional) */ ElasticIpAddress string `json:"elasticIpAddress"` } ������������������NetworkInterfaceSpec.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000003465�13771713062�0034263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkInterfaceSpec struct { /* 子网ID */ SubnetId string `json:"subnetId"` /* 可用区,用户的默认可用区 (Optional) */ Az *string `json:"az"` /* 网卡名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ NetworkInterfaceName *string `json:"networkInterfaceName"` /* 网卡主IP,如果不指定,会自动从子网中分配 (Optional) */ PrimaryIpAddress *string `json:"primaryIpAddress"` /* SecondaryIp列表 (Optional) */ SecondaryIpAddresses []string `json:"secondaryIpAddresses"` /* 自动分配的SecondaryIp数量 (Optional) */ SecondaryIpCount *int `json:"secondaryIpCount"` /* 要绑定的安全组ID列表,最多指定5个安全组 (Optional) */ SecurityGroups []string `json:"securityGroups"` /* 源和目标IP地址校验,取值为0或者1,默认为1 (Optional) */ SanityCheck *int `json:"sanityCheck"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description *string `json:"description"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������NetworkSecurityGroup.go�����������������������������������������������������������������������������0000664�0000000�0000000�00000002424�13771713062�0034366�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkSecurityGroup struct { /* 安全组ID (Optional) */ NetworkSecurityGroupId string `json:"networkSecurityGroupId"` /* 安全组名称 (Optional) */ NetworkSecurityGroupName string `json:"networkSecurityGroupName"` /* 安全组描述信息 (Optional) */ Description string `json:"description"` /* 安全组所在vpc的Id (Optional) */ VpcId string `json:"vpcId"` /* 安全组规则信息 (Optional) */ SecurityGroupRules []SecurityGroupRule `json:"securityGroupRules"` /* 安全组创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������NetworkSecurityGroupSpec.go�������������������������������������������������������������������������0000664�0000000�0000000�00000002210�13771713062�0035172�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type NetworkSecurityGroupSpec struct { /* 私有网络ID */ VpcId string `json:"vpcId"` /* 安全组名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ NetworkSecurityGroupName string `json:"networkSecurityGroupName"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Quota.go����������0000664�0000000�0000000�00000002272�13771713062�0031341�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Quota struct { /* 资源类型,取值范围:vpc、elastic_ip、subnet、security_group、vpcpeering、network_interface(配额只统计辅助网卡) (Optional) */ Type string `json:"type"` /* vpc、elastic_ip、network_interface为空, subnet、security_group、vpcpeering为vpcId (Optional) */ ParentResourceId string `json:"parentResourceId"` /* 配额大小 (Optional) */ MaxLimit int `json:"maxLimit"` /* 已存在的资源数量 (Optional) */ Count int `json:"count"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTable.go�����0000664�0000000�0000000�00000003215�13771713062�0032314�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type RouteTable struct { /* 路由表ID (Optional) */ RouteTableId string `json:"routeTableId"` /* 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ RouteTableName string `json:"routeTableName"` /* 路由表类型,default:默认路由表,custom:自定义路由表 (Optional) */ RouteTableType string `json:"routeTableType"` /* 路由表描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description string `json:"description"` /* 私有网络ID (Optional) */ VpcId string `json:"vpcId"` /* 路由表规则信息 (Optional) */ RouteTableRules []RouteTableRule `json:"routeTableRules"` /* 路由表绑定的子网列表 (Optional) */ SubnetIds []string `json:"subnetIds"` /* 路由表创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableRule.go�0000664�0000000�0000000�00000003146�13771713062�0033147�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type RouteTableRule struct { /* 路由表规则ID (Optional) */ RuleId string `json:"ruleId"` /* 规则匹配优先级,取值范围[1,255],默认为100。当路由规则子网掩码不同时,路由最长匹配优先;当路由规则子网掩码相同时, 按照优先级匹配转发, 优先级数字越小优先级越高,路由规则子网掩码相同、优先级相同、下一跳不同时,形成等价路由,不同下一跳负载均担。 (Optional) */ Priority int `json:"priority"` /* 下一跳类型, 取值范围:local:本地, instance:云主机, internet:公网, vpc_peering:vpc对等连接, bgw:边界网关 (Optional) */ NextHopType string `json:"nextHopType"` /* 下一跳id (Optional) */ NextHopId string `json:"nextHopId"` /* 匹配地址前缀, internet类型路由跟其他类型的路由,addressPrefix不允许重复 (Optional) */ AddressPrefix string `json:"addressPrefix"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/RouteTableSpec.go�0000664�0000000�0000000�00000002174�13771713062�0033132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type RouteTableSpec struct { /* 路由表所属的私有网络ID */ VpcId string `json:"vpcId"` /* 路由表名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ RouteTableName string `json:"routeTableName"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SecurityGroupRule.go��������������������������������������������������������������������������������0000664�0000000�0000000�00000003271�13771713062�0033645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type SecurityGroupRule struct { /* 安全组规则ID (Optional) */ RuleId string `json:"ruleId"` /* 安全组规则方向。0:入规则; 1:出规则 (Optional) */ Direction int `json:"direction"` /* 规则限定协议。300:All; 6:TCP; 17:UDP; 1:ICMP (Optional) */ Protocol int `json:"protocol"` /* 匹配地址前缀 (Optional) */ AddressPrefix string `json:"addressPrefix"` /* 匹配地址协议版本。4:IPv4 (Optional) */ IpVersion int `json:"ipVersion"` /* 规则限定起始传输层端口, 默认1 ,若protocal不是传输层协议,恒为0 (Optional) */ FromPort int `json:"fromPort"` /* 规则限定终止传输层端口, 默认1 ,若protocal不是传输层协议,恒为0 (Optional) */ ToPort int `json:"toPort"` /* 安全组规则创建时间 (Optional) */ CreatedTime string `json:"createdTime"` /* 描述,​ 允许输入UTF-8编码下的全部字符,不超过256字符 (Optional) */ Description string `json:"description"` } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Segment.go��������0000664�0000000�0000000�00000003212�13771713062�0031645�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Segment struct { /* 网段的Id (Optional) */ SegmentId string `json:"segmentId"` /* 网段名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 (Optional) */ SegmentName string `json:"segmentName"` /* 网段描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description string `json:"description"` /* 网络地址段 (Optional) */ AddressPrefix string `json:"addressPrefix"` /* 网段可用ip数量 (Optional) */ AvailableIpCount int `json:"availableIpCount"` /* IP服务商,取值为bgp或no_bgp,cn-north-1:bgp;cn-south-1:[bgp,no_bgp];cn-east-1:[bgp,no_bgp];cn-east-2:bgp (Optional) */ Provider string `json:"provider"` /* 网段的起始地址 (Optional) */ StartIp string `json:"startIp"` /* 网段的结束地址 (Optional) */ EndIp string `json:"endIp"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Subnet.go���������0000664�0000000�0000000�00000003707�13771713062�0031514�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Subnet struct { /* Subnet的Id (Optional) */ SubnetId string `json:"subnetId"` /* 子网名称 (Optional) */ SubnetName string `json:"subnetName"` /* 子网所属VPC的Id (Optional) */ VpcId string `json:"vpcId"` /* 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果VPC含有Cidr,则必须为VPC所在Cidr的子网 (Optional) */ AddressPrefix string `json:"addressPrefix"` /* 子网可用ip数量 (Optional) */ AvailableIpCount int `json:"availableIpCount"` /* 子网描述信息 (Optional) */ Description string `json:"description"` /* 子网关联的路由表Id (Optional) */ RouteTableId string `json:"routeTableId"` /* 子网关联的acl Id (Optional) */ AclId string `json:"aclId"` /* 子网的起始地址,子网第1个地位为路由器网关保留,第2个地址为dhcp服务保留 (Optional) */ StartIp string `json:"startIp"` /* 子网的结束地址,子网第1个地位为路由器网关保留,第2个地址为dhcp服务保留 (Optional) */ EndIp string `json:"endIp"` /* 子网创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } ���������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/SubnetSpec.go�����0000664�0000000�0000000�00000003020�13771713062�0032313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type SubnetSpec struct { /* 子网所属vpc的Id */ VpcId string `json:"vpcId"` /* 子网名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ SubnetName string `json:"subnetName"` /* 子网网段,vpc内子网网段不能重叠,cidr的取值范围:10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间,如果vpc含有cidr,则必须为vpc所在cidr的子网 */ AddressPrefix string `json:"addressPrefix"` /* 子网关联的路由表Id, 默认为vpc的默认路由表 (Optional) */ RouteTableId string `json:"routeTableId"` /* 子网描述信息,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description string `json:"description"` } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������UnassignSecondaryIpsSpec.go�������������������������������������������������������������������������0000664�0000000�0000000�00000001476�13771713062�0035124�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type UnassignSecondaryIpsSpec struct { /* 指定删除的secondaryIp地址 (Optional) */ SecondaryIps []string `json:"secondaryIps"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/Vpc.go������������0000664�0000000�0000000�00000003111�13771713062�0030771�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type Vpc struct { /* Vpc的Id (Optional) */ VpcId string `json:"vpcId"` /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ AddressPrefix string `json:"addressPrefix"` /* VPC 描述,取值范围:1~120个字符 (Optional) */ Description string `json:"description"` /* 私有网络名称,取值范围:1-60个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ VpcName string `json:"vpcName"` /* 同一vpc下的acl id 列表 (Optional) */ AclIds []string `json:"aclIds"` /* (Optional) */ RouteTableIds []string `json:"routeTableIds"` /* 私有网络包含的子网列表 (Optional) */ Subnets []Subnet `json:"subnets"` /* vpc创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcPeering.go�����0000664�0000000�0000000�00000003110�13771713062�0032302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type VpcPeering struct { /* VpcPeering的Id (Optional) */ VpcPeeringId string `json:"vpcPeeringId"` /* VpcPeering名称,同账号下不允许重名,取值范围:1-32个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ VpcPeeringName string `json:"vpcPeeringName"` /* 状态,取值为Connected,Disconnected,Initiated (Optional) */ VpcPeeringState string `json:"vpcPeeringState"` /* VpcPeering 描述,可为空值,取值范围:0-256个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ Description string `json:"description"` /* 发起VpcPeering的Vpc信息 (Optional) */ VpcInfo VpcPeeringVpcInfo `json:"vpcInfo"` /* 对端的Vpc信息 (Optional) */ RemoteVpcInfo VpcPeeringVpcInfo `json:"remoteVpcInfo"` /* VpcPeering创建时间 (Optional) */ CreatedTime string `json:"createdTime"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������VpcPeeringVpcInfo.go��������������������������������������������������������������������������������0000664�0000000�0000000�00000002250�13771713062�0033514�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models��������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type VpcPeeringVpcInfo struct { /* 子网所属VPC的Id (Optional) */ VpcId string `json:"vpcId"` /* 私有网络名称,取值范围:1-60个中文、英文大小写的字母、数字和下划线分隔符 (Optional) */ VpcName string `json:"vpcName"` /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ AddressPrefix []string `json:"addressPrefix"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models/VpcSpec.go��������0000664�0000000�0000000�00000002405�13771713062�0031611�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2018 JDCLOUD.COM // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // NOTE: This class is auto generated by the jdcloud code generator program. package models type VpcSpec struct { /* 私有网络名称,只允许输入中文、数字、大小写字母、英文下划线“_”及中划线“-”,不允许为空且不超过32字符。 */ VpcName string `json:"vpcName"` /* 如果为空,则不限制网段,如果不为空,10.0.0.0/8、172.16.0.0/12和192.168.0.0/16及它们包含的子网,且子网掩码长度为16-28之间 (Optional) */ AddressPrefix string `json:"addressPrefix"` /* vpc描述,允许输入UTF-8编码下的全部字符,不超过256字符。 (Optional) */ Description string `json:"description"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jehiah/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020247�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jehiah/go-strftime/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022507�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jehiah/go-strftime/.gitignore������������������������������������0000664�0000000�0000000�00000000374�13771713062�0024503�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jehiah/go-strftime/LICENSE���������������������������������������0000664�0000000�0000000�00000002043�13771713062�0023513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright (c) 2012 Jehiah Czebotar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jehiah/go-strftime/README.md�������������������������������������0000664�0000000�0000000�00000000534�13771713062�0023770�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������go-strftime =========== go implementation of strftime ## Example ``` package main import ( "fmt" "time" strftime "github.com/jehiah/go-strftime" ) func main() { t := time.Unix(1340244776, 0) utc, _ := time.LoadLocation("UTC") t = t.In(utc) fmt.Println(strftime.Format("%Y-%m-%d %H:%M:%S", t)) // Output: // 2012-06-21 02:12:56 } ``` ��������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/jehiah/go-strftime/strftime.go�����������������������������������0000664�0000000�0000000�00000004151�13771713062�0024674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// go implementation of strftime package strftime import ( "strings" "time" ) // taken from time/format.go var conversion = map[rune]string{ /*stdLongMonth */ 'B': "January", /*stdMonth */ 'b': "Jan", // stdNumMonth */ 'm': "1", /*stdZeroMonth */ 'm': "01", /*stdLongWeekDay */ 'A': "Monday", /*stdWeekDay */ 'a': "Mon", // stdDay */ 'd': "2", // stdUnderDay */ 'd': "_2", /*stdZeroDay */ 'd': "02", /*stdHour */ 'H': "15", // stdHour12 */ 'I': "3", /*stdZeroHour12 */ 'I': "03", // stdMinute */ 'M': "4", /*stdZeroMinute */ 'M': "04", // stdSecond */ 'S': "5", /*stdZeroSecond */ 'S': "05", /*stdLongYear */ 'Y': "2006", /*stdYear */ 'y': "06", /*stdPM */ 'p': "PM", // stdpm */ 'p': "pm", /*stdTZ */ 'Z': "MST", // stdISO8601TZ */ 'z': "Z0700", // prints Z for UTC // stdISO8601ColonTZ */ 'z': "Z07:00", // prints Z for UTC /*stdNumTZ */ 'z': "-0700", // always numeric // stdNumShortTZ */ 'b': "-07", // always numeric // stdNumColonTZ */ 'b': "-07:00", // always numeric /* nonStdMilli */ 'L': ".000", } // This is an alternative to time.Format because no one knows // what date 040305 is supposed to create when used as a 'layout' string // this takes standard strftime format options. For a complete list // of format options see http://strftime.org/ func Format(format string, t time.Time) string { retval := make([]byte, 0, len(format)) for i, ni := 0, 0; i < len(format); i = ni + 2 { ni = strings.IndexByte(format[i:], '%') if ni < 0 { ni = len(format) } else { ni += i } retval = append(retval, []byte(format[i:ni])...) if ni+1 < len(format) { c := format[ni+1] if c == '%' { retval = append(retval, '%') } else { if layoutCmd, ok := conversion[rune(c)]; ok { retval = append(retval, []byte(t.Format(layoutCmd))...) } else { retval = append(retval, '%', c) } } } else { if ni < len(format) { retval = append(retval, '%') } } } return string(retval) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020327�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022251�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/.gitignore��������������������������������������0000664�0000000�0000000�00000000231�13771713062�0024235�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������*.dll *.exe .DS_Store bin/ pkg/ .vagrant/ *.backup *.log *.bak *~ *# .*.swp .idea/ *.test *.iml Notes.md coverage.txt cmd/triton/triton cmd/triton/docs/ �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/.travis.yml�������������������������������������0000664�0000000�0000000�00000000331�13771713062�0024357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������dist: trusty sudo: false language: go go: - "1.10" install: - go get github.com/golang/dep/cmd/dep script: - make tools default branches: only: - master matrix: fast_finish: true allow_failures: - go: tip�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/CHANGELOG.md������������������������������������0000664�0000000�0000000�00000010057�13771713062�0024065�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������## Unreleased ## 1.3.1 (April 27 2018) - client: Fixing an issue where private Triton installations were marked as invalid DC [#152] ## 1.3.0 (April 17 2018) - identity/roles: Add support for SetRoleTags [#112] - Add support for Triton Service Groups endpoint [#148] ## 1.2.0 (March 20 2018) - compute/instance: Instance Deletion status now included in the GET instance response [#138] ## 1.1.1 (March 13 2018) - client: Adding the rbac user support to the SSHAgentSigner [BUG!] ## 1.1.0 (March 13 2018) - client: Add support for Manta RBAC http signatures ## 1.0.0 (February 28 2018) - client: Add support for querystring in client/ExecuteRequestRaw [#121] - client: Introduce SetHeader for overriding API request header [#125] - compute/instances: Add support for passing a list of tags to filter List instances [#116] - compute/instances: Add support for getting a count of current instances from the CloudAPI [#119] - compute/instances: Add ability to support name-prefix [#129] - compute/instances: Add support for Instance Deletion Protection [#131] - identity/user: Add support for ChangeUserPassword [#111] - expose GetTritonEnv as a root level func [#126] ## 0.9.0 (January 23 2018) **Please Note:** This is a precursor release to marking triton-go as 1.0.0. We are going to wait and fix any bugs that occur from this large set of changes that has happened since 0.5.2 - Add support for managing volumes in Triton [#100] - identity/policies: Add support for managing policies in Triton [#86] - addition of triton-go errors package to expose unwrapping of internal errors - Migration from hashicorp/errwrap to pkg/errors - Using path.Join() for URL structures rather than fmt.Sprintf() ## 0.5.2 (December 28 2017) - Standardise the API SSH Signers input casing and naming ## 0.5.1 (December 28 2017) - Include leading '/' when working with SSH Agent signers ## 0.5.0 (December 28 2017) - Add support for RBAC in triton-go [#82] This is a breaking change. No longer do we pass individual parameters to the SSH Signer funcs, but we now pass an input Struct. This will guard from from additional parameter changes in the future. We also now add support for using `SDC_*` and `TRITON_*` env vars when working with the Default agent signer ## 0.4.2 (December 22 2017) - Fixing a panic when the user loses network connectivity when making a GET request to instance [#81] ## 0.4.1 (December 15 2017) - Clean up the handling of directory sanitization. Use abs paths everywhere [#79] ## 0.4.0 (December 15 2017) - Fix an issue where Manta HEAD requests do not return an error resp body [#77] - Add support for recursively creating child directories [#78] ## 0.3.0 (December 14 2017) - Introduce CloudAPI's ListRulesMachines under networking - Enable HTTP KeepAlives by default in the client. 15s idle timeout, 2x connections per host, total of 10x connections per client. - Expose an optional Headers attribute to clients to allow them to customize HTTP headers when making Object requests. - Fix a bug in Directory ListIndex [#69](https://github.com/joyent/issues/69) - Inputs to Object inputs have been relaxed to `io.Reader` (formerly a `io.ReadSeeker`) [#73](https://github.com/joyent/issues/73). - Add support for ForceDelete of all children of a directory [#71](https://github.com/joyent/issues/71) - storage: Introduce `Objects.GetInfo` and `Objects.IsDir` using HEAD requests [#74](https://github.com/joyent/triton-go/issues/74) ## 0.2.1 (November 8 2017) - Fixing a bug where CreateUser and UpdateUser didn't return the UserID ## 0.2.0 (November 7 2017) - Introduce CloudAPI's Ping under compute - Introduce CloudAPI's RebootMachine under compute instances - Introduce CloudAPI's ListUsers, GetUser, CreateUser, UpdateUser and DeleteUser under identity package - Introduce CloudAPI's ListMachineSnapshots, GetMachineSnapshot, CreateSnapshot, DeleteMachineSnapshot and StartMachineFromSnapshot under compute package - tools: Introduce unit testing and scripts for linting, etc. - bug: Fix the `compute.ListMachineRules` endpoint ## 0.1.0 (November 2 2017) - Initial release of a versioned SDK ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/GNUmakefile�������������������������������������0000664�0000000�0000000�00000002244�13771713062�0024325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������TEST?=$$(go list ./... |grep -Ev 'vendor|examples|testutils') GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) default: check test tools:: ## Download and install all dev/code tools @echo "==> Installing dev tools" go get -u github.com/golang/dep/cmd/dep go get -u github.com/alecthomas/gometalinter gometalinter --install build:: @govvv build install:: @govvv install test:: ## Run unit tests @echo "==> Running unit test with coverage" @./scripts/go-test-with-coverage.sh testacc:: ## Run acceptance tests @echo "==> Running acceptance tests" TRITON_TEST=1 go test $(TEST) -v $(TESTARGS) -run -timeout 120m check:: gometalinter \ --deadline 10m \ --vendor \ --sort="path" \ --aggregate \ --enable-gc \ --disable-all \ --enable goimports \ --enable misspell \ --enable vet \ --enable deadcode \ --enable varcheck \ --enable ineffassign \ --enable gofmt \ ./... .PHONY: help help:: ## Display this help message @echo "GNU make(1) targets:" @grep -E '^[a-zA-Z_.-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/Gopkg.lock��������������������������������������0000664�0000000�0000000�00000012165�13771713062�0024177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. [[projects]] branch = "master" name = "github.com/abdullin/seq" packages = ["."] revision = "d5467c17e7afe8d8f08f556c6c811a50c3feb28d" [[projects]] name = "github.com/cpuguy83/go-md2man" packages = ["md2man"] revision = "20f5889cbdc3c73dbd2862796665e7c465ade7d1" version = "v1.0.8" [[projects]] branch = "master" name = "github.com/dustin/go-humanize" packages = ["."] revision = "bb3d318650d48840a39aa21a027c6630e198e626" [[projects]] name = "github.com/fsnotify/fsnotify" packages = ["."] revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" version = "v1.4.7" [[projects]] branch = "master" name = "github.com/hashicorp/hcl" packages = [ ".", "hcl/ast", "hcl/parser", "hcl/printer", "hcl/scanner", "hcl/strconv", "hcl/token", "json/parser", "json/scanner", "json/token" ] revision = "23c074d0eceb2b8a5bfdbb271ab780cde70f05a8" [[projects]] name = "github.com/imdario/mergo" packages = ["."] revision = "163f41321a19dd09362d4c63cc2489db2015f1f4" version = "0.3.2" [[projects]] name = "github.com/inconshreveable/mousetrap" packages = ["."] revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" version = "v1.0" [[projects]] name = "github.com/jackc/pgx" packages = [ ".", "chunkreader", "internal/sanitize", "pgio", "pgproto3", "pgtype" ] revision = "da3231b0b66e2e74cdb779f1d46c5e958ba8be27" version = "v3.1.0" [[projects]] name = "github.com/magiconair/properties" packages = ["."] revision = "d419a98cdbed11a922bf76f257b7c4be79b50e73" version = "v1.7.4" [[projects]] branch = "master" name = "github.com/mattn/go-isatty" packages = ["."] revision = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c" [[projects]] name = "github.com/mattn/go-runewidth" packages = ["."] revision = "9e777a8366cce605130a531d2cd6363d07ad7317" version = "v0.0.2" [[projects]] branch = "master" name = "github.com/mitchellh/mapstructure" packages = ["."] revision = "a4e142e9c047c904fa2f1e144d9a84e6133024bc" [[projects]] branch = "master" name = "github.com/olekukonko/tablewriter" packages = ["."] revision = "b8a9be070da40449e501c3c4730a889e42d87a9e" [[projects]] name = "github.com/pelletier/go-toml" packages = ["."] revision = "acdc4509485b587f5e675510c4f2c63e90ff68a8" version = "v1.1.0" [[projects]] branch = "master" name = "github.com/pkg/errors" packages = ["."] revision = "e881fd58d78e04cf6d0de1217f8707c8cc2249bc" [[projects]] name = "github.com/rs/zerolog" packages = [ ".", "internal/json", "log" ] revision = "b53826c57a6a1d8833443ebeacf1cfb62b229c64" version = "v1.4.0" [[projects]] name = "github.com/russross/blackfriday" packages = ["."] revision = "4048872b16cc0fc2c5fd9eacf0ed2c2fedaa0c8c" version = "v1.5" [[projects]] branch = "master" name = "github.com/sean-/conswriter" packages = ["."] revision = "f5ae3917a627f1aab86eedaac41b153e4097e4e8" [[projects]] branch = "master" name = "github.com/sean-/pager" packages = ["."] revision = "666be9bf53b5257ca07b4a16227df91e104c0519" [[projects]] branch = "master" name = "github.com/sean-/seed" packages = ["."] revision = "e2103e2c35297fb7e17febb81e49b312087a2372" [[projects]] name = "github.com/spf13/afero" packages = [ ".", "mem" ] revision = "bb8f1927f2a9d3ab41c9340aa034f6b803f4359c" version = "v1.0.2" [[projects]] name = "github.com/spf13/cast" packages = ["."] revision = "acbeb36b902d72a7a4c18e8f3241075e7ab763e4" version = "v1.1.0" [[projects]] branch = "master" name = "github.com/spf13/cobra" packages = [ ".", "doc" ] revision = "be77323fc05148ef091e83b3866c0d47c8e74a8b" [[projects]] branch = "master" name = "github.com/spf13/jwalterweatherman" packages = ["."] revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" [[projects]] name = "github.com/spf13/pflag" packages = ["."] revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" version = "v1.0.0" [[projects]] branch = "master" name = "github.com/spf13/viper" packages = ["."] revision = "aafc9e6bc7b7bb53ddaa75a5ef49a17d6e654be5" [[projects]] branch = "master" name = "golang.org/x/crypto" packages = [ "curve25519", "ed25519", "ed25519/internal/edwards25519", "ssh", "ssh/agent" ] revision = "0fcca4842a8d74bfddc2c96a073bd2a4d2a7a2e8" [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix"] revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd" [[projects]] branch = "master" name = "golang.org/x/text" packages = [ "internal/gen", "internal/triegen", "internal/ucd", "transform", "unicode/cldr", "unicode/norm" ] revision = "4e4a3210bb54bb31f6ab2cdca2edcc0b50c420c1" [[projects]] branch = "v2" name = "gopkg.in/yaml.v2" packages = ["."] revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4" [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "ce907ec6468492ed7ad937a82043195756a7fd37dc2f62a26cf77dbb1368ac55" solver-name = "gps-cdcl" solver-version = 1 �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/Gopkg.toml��������������������������������������0000664�0000000�0000000�00000002675�13771713062�0024227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ # Gopkg.toml example # # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md # for detailed Gopkg.toml documentation. # # required = ["github.com/user/thing/cmd/thing"] # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] # # [[constraint]] # name = "github.com/user/project" # version = "1.0.0" # # [[constraint]] # name = "github.com/user/project2" # branch = "dev" # source = "github.com/myfork/project2" # # [[override]] # name = "github.com/x/y" # version = "2.4.0" [[constraint]] branch = "master" name = "github.com/abdullin/seq" [[constraint]] branch = "master" name = "github.com/sean-/seed" [[constraint]] branch = "master" name = "golang.org/x/crypto" [[constraint]] branch = "master" name = "github.com/pkg/errors" [[constraint]] branch = "master" name = "github.com/olekukonko/tablewriter" [[constraint]] name = "github.com/rs/zerolog" version = "1.4.0" [[constraint]] name = "github.com/spf13/cobra" branch = "master" [[constraint]] branch = "master" name = "github.com/spf13/viper" [[constraint]] branch = "master" name = "github.com/mattn/go-isatty" [[constraint]] branch = "master" name = "github.com/sean-/conswriter" [[constraint]] branch = "master" name = "github.com/sean-/pager" [[constraint]] name = "github.com/imdario/mergo" version = "0.3.2" [[constraint]] name = "github.com/dustin/go-humanize" branch = "master" �������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/LICENSE�����������������������������������������0000664�0000000�0000000�00000040526�13771713062�0023265�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/README.md���������������������������������������0000664�0000000�0000000�00000020460�13771713062�0023532�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# triton-go `triton-go` is an idiomatic library exposing a client SDK for Go applications using Joyent's Triton Compute and Storage (Manta) APIs. [![Build Status](https://travis-ci.org/joyent/triton-go.svg?branch=master)](https://travis-ci.org/joyent/triton-go) [![Go Report Card](https://goreportcard.com/badge/github.com/joyent/triton-go)](https://goreportcard.com/report/github.com/joyent/triton-go) The Triton Go SDK is used in the following open source projects. - [Consul](https://www.consul.io/docs/agent/cloud-auto-join.html#joyent-triton) - [Packer](http://github.com/hashicorp/packer) - [Vault](http://github.com/hashicorp/vault) - [Terraform](http://github.com/hashicorp/terraform) - [Terraform Triton Provider](https://github.com/terraform-providers/terraform-provider-triton) - [Docker Machine](https://github.com/joyent/docker-machine-driver-triton) - [Triton Kubernetes](https://github.com/joyent/triton-kubernetes) - [HashiCorp go-discover](https://github.com/hashicorp/go-discover) ## Usage Triton uses [HTTP Signature][4] to sign the Date header in each HTTP request made to the Triton API. Currently, requests can be signed using either a private key file loaded from disk (using an [`authentication.PrivateKeySigner`][5]), or using a key stored with the local SSH Agent (using an [`SSHAgentSigner`][6]. To construct a Signer, use the `New*` range of methods in the `authentication` package. In the case of `authentication.NewSSHAgentSigner`, the parameters are the fingerprint of the key with which to sign, and the account name (normally stored in the `TRITON_ACCOUNT` environment variable). There is also support for passing in a username, this will allow you to use an account other than the main Triton account. For example: ```go input := authentication.SSHAgentSignerInput{ KeyID: "a4:c6:f3:75:80:27:e0:03:a9:98:79:ef:c5:0a:06:11", AccountName: "AccountName", Username: "Username", } sshKeySigner, err := authentication.NewSSHAgentSigner(input) if err != nil { log.Fatalf("NewSSHAgentSigner: %s", err) } ``` An appropriate key fingerprint can be generated using `ssh-keygen`. ``` ssh-keygen -Emd5 -lf ~/.ssh/id_rsa.pub | cut -d " " -f 2 | sed 's/MD5://' ``` Each top level package, `account`, `compute`, `identity`, `network`, all have their own separate client. In order to initialize a package client, simply pass the global `triton.ClientConfig` struct into the client's constructor function. ```go config := &triton.ClientConfig{ TritonURL: os.Getenv("TRITON_URL"), MantaURL: os.Getenv("MANTA_URL"), AccountName: accountName, Username: os.Getenv("TRITON_USER"), Signers: []authentication.Signer{sshKeySigner}, } c, err := compute.NewClient(config) if err != nil { log.Fatalf("compute.NewClient: %s", err) } ``` Constructing `compute.Client` returns an interface which exposes `compute` API resources. The same goes for all other packages. Reference their unique documentation for more information. The same `triton.ClientConfig` will initialize the Manta `storage` client as well... ```go c, err := storage.NewClient(config) if err != nil { log.Fatalf("storage.NewClient: %s", err) } ``` ## Error Handling If an error is returned by the HTTP API, the `error` returned from the function will contain an instance of `errors.APIError` in the chain. Error wrapping is performed using the [pkg/errors][7] library. ## Acceptance Tests Acceptance Tests run directly against the Triton API, so you will need either a local installation of Triton or an account with Joyent's Public Cloud offering in order to run them. The tests create real resources (and thus cost real money)! In order to run acceptance tests, the following environment variables must be set: - `TRITON_TEST` - must be set to any value in order to indicate desire to create resources - `TRITON_URL` - the base endpoint for the Triton API - `TRITON_ACCOUNT` - the account name for the Triton API - `TRITON_KEY_ID` - the fingerprint of the SSH key identifying the key Additionally, you may set `TRITON_KEY_MATERIAL` to the contents of an unencrypted private key. If this is set, the PrivateKeySigner (see above) will be used - if not the SSHAgentSigner will be used. You can also set `TRITON_USER` to run the tests against an account other than the main Triton account ### Example Run The verbose output has been removed for brevity here. ``` $ HTTP_PROXY=http://localhost:8888 \ TRITON_TEST=1 \ TRITON_URL=https://us-sw-1.api.joyent.com \ TRITON_ACCOUNT=AccountName \ TRITON_KEY_ID=a4:c6:f3:75:80:27:e0:03:a9:98:79:ef:c5:0a:06:11 \ go test -v -run "TestAccKey" === RUN TestAccKey_Create --- PASS: TestAccKey_Create (12.46s) === RUN TestAccKey_Get --- PASS: TestAccKey_Get (4.30s) === RUN TestAccKey_Delete --- PASS: TestAccKey_Delete (15.08s) PASS ok github.com/joyent/triton-go 31.861s ``` ## Example API There's an `examples/` directory available with sample code setup for many of the APIs within this library. Most of these can be run using `go run` and referencing your SSH key file use by your active `triton` CLI profile. ```sh $ eval "$(triton env us-sw-1)" $ TRITON_KEY_FILE=~/.ssh/triton-id_rsa go run examples/compute/instances.go ``` The following is a complete example of how to initialize the `compute` package client and list all instances under an account. More detailed usage of this library follows. ```go package main import ( "context" "fmt" "io/ioutil" "log" "os" "time" triton "github.com/joyent/triton-go" "github.com/joyent/triton-go/authentication" "github.com/joyent/triton-go/compute" ) func main() { keyID := os.Getenv("TRITON_KEY_ID") accountName := os.Getenv("TRITON_ACCOUNT") keyMaterial := os.Getenv("TRITON_KEY_MATERIAL") userName := os.Getenv("TRITON_USER") var signer authentication.Signer var err error if keyMaterial == "" { input := authentication.SSHAgentSignerInput{ KeyID: keyID, AccountName: accountName, Username: userName, } signer, err = authentication.NewSSHAgentSigner(input) if err != nil { log.Fatalf("Error Creating SSH Agent Signer: {{err}}", err) } } else { var keyBytes []byte if _, err = os.Stat(keyMaterial); err == nil { keyBytes, err = ioutil.ReadFile(keyMaterial) if err != nil { log.Fatalf("Error reading key material from %s: %s", keyMaterial, err) } block, _ := pem.Decode(keyBytes) if block == nil { log.Fatalf( "Failed to read key material '%s': no key found", keyMaterial) } if block.Headers["Proc-Type"] == "4,ENCRYPTED" { log.Fatalf( "Failed to read key '%s': password protected keys are\n"+ "not currently supported. Please decrypt the key prior to use.", keyMaterial) } } else { keyBytes = []byte(keyMaterial) } input := authentication.PrivateKeySignerInput{ KeyID: keyID, PrivateKeyMaterial: keyBytes, AccountName: accountName, Username: userName, } signer, err = authentication.NewPrivateKeySigner(input) if err != nil { log.Fatalf("Error Creating SSH Private Key Signer: {{err}}", err) } } config := &triton.ClientConfig{ TritonURL: os.Getenv("TRITON_URL"), AccountName: accountName, Username: userName, Signers: []authentication.Signer{signer}, } c, err := compute.NewClient(config) if err != nil { log.Fatalf("compute.NewClient: %s", err) } listInput := &compute.ListInstancesInput{} instances, err := c.Instances().List(context.Background(), listInput) if err != nil { log.Fatalf("compute.Instances.List: %v", err) } numInstances := 0 for _, instance := range instances { numInstances++ fmt.Println(fmt.Sprintf("-- Instance: %v", instance.Name)) } } ``` [4]: https://github.com/joyent/node-http-signature/blob/master/http_signing.md [5]: https://godoc.org/github.com/joyent/triton-go/authentication [6]: https://godoc.org/github.com/joyent/triton-go/authentication [7]: https://github.com/pkg/errors ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/���������������������������������0000775�0000000�0000000�00000000000�13771713062�0025270�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/agent_key_identifier.go����������0000664�0000000�0000000�00000001043�13771713062�0031765�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package authentication import "path" type KeyID struct { UserName string AccountName string Fingerprint string IsManta bool } func (input *KeyID) generate() string { var keyID string if input.UserName != "" { if input.IsManta { keyID = path.Join("/", input.AccountName, input.UserName, "keys", input.Fingerprint) } else { keyID = path.Join("/", input.AccountName, "users", input.UserName, "keys", input.Fingerprint) } } else { keyID = path.Join("/", input.AccountName, "keys", input.Fingerprint) } return keyID } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/dummy.go�������������������������0000664�0000000�0000000�00000011225�13771713062�0026753�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication // DON'T USE THIS OUTSIDE TESTING ~ This key was only created to use for // internal unit testing. It should never be used for acceptance testing either. // // This is just a randomly generated key pair. var Dummy = struct { Fingerprint string PrivateKey []byte PublicKey []byte Signer Signer }{ "9f:d6:65:fc:d6:60:dc:d0:4e:db:2d:75:f7:92:8c:31", []byte(`-----BEGIN RSA PRIVATE KEY----- MIIJKAIBAAKCAgEAui9lNjCJahHeFSFC6HXi/CNX588C/L2gJUx65bnNphVC98hW 1wzoRvPXHx5aWnb7lEbpNhP6B0UoCBDTaPgt9hHfD/oNQ+6HT1QpDIGfZmXI91/t cjGVSBbxN7WaYt/HsPrGjbalwvQPChN53sMVmFkMTEDR5G3zOBOAGrOimlCT80wI 2S5Xg0spd8jjKM5I1swDR0xtuDWnHTR1Ohin+pEQIE6glLTfYq7oQx6nmMXXBNmk +SaPD1FAyjkF/81im2EHXBygNEwraVrDcAxK2mKlU2XMJiogQKNYWlm3UkbNB6WP Le12+Ka02rmIVsSqIpc/ZCBraAlCaSWlYCkU+vJ2hH/+ypy5bXNlbaTiWZK+vuI7 PC87T50yLNeXVuNZAynzDpBCvsjiiHrB/ZFRfVfF6PviV8CV+m7GTzfAwJhVeSbl rR6nts16K0HTD48v57DU0b0t5VOvC7cWPShs+afdSL3Z8ReL5EWMgU1wfvtycRKe hiDVGj3Ms2cf83RIANr387G+1LcTQYP7JJuB7Svy5j+R6+HjI0cgu4EMUPdWfCNG GyrlxwJNtPmUSfasH1xUKpqr7dC+0sN4/gfJw75WTAYrATkPzexoYNaMsGDfhuoh kYa3Tn2q1g3kqhsX/R0Fd5d8d5qc137qcRCxiZYz9f3bVkXQbhYmO9da3KsCAwEA AQKCAgAeEAURqOinPddUJhi9nDtYZwSMo3piAORY4W5+pW+1P32esLSE6MqgmkLD /YytSsT4fjKtzq/yeJIsKztXmasiLmSMGd4Gd/9VKcuu/0cTq5+1gcG/TI5EI6Az VJlnGacOxo9E1pcRUYMUJ2zoMSvNe6NmtJivf6lkBpIKvbKlpBkfkclj9/2db4d0 lfVH43cTZ8Gnw4l70v320z+Sb+S/qqil7swy9rmTH5bVL5/0JQ3A9LuUl0tGN+J0 RJzZXvprCFG958leaGYiDsu7zeBQPtlfC/LYvriSd02O2SmmmVQFxg/GZK9vGsvc /VQsXnjyOOW9bxaop8YXYELBsiB21ipTHzOwoqHT8wFnjgU9Y/7iZIv7YbZKQsCS DrwdlZ/Yw90wiif+ldYryIVinWfytt6ERv4Dgezc98+1XPi1Z/WB74/lIaDXFl3M 3ypjtvLYbKew2IkIjeAwjvZJg/QpC/50RrrPtVDgeAI1Ni01ikixUhMYsHJ1kRih 0tqLvLqSPoHmr6luFlaoKdc2eBqb+8U6K/TrXhKtT7BeUFiSbvnVfdbrH9r+AY/2 zYtG6llzkE5DH8ZR3Qp+dx7QEDtvYhGftWhx9uasd79AN7CuGYnL54YFLKGRrWKN ylysqfUyOQYiitdWdNCw9PP2vGRx5JAsMMSy+ft18jjTJvNQ0QKCAQEA28M11EE6 MpnHxfyP00Dl1+3wl2lRyNXZnZ4hgkk1f83EJGpoB2amiMTF8P1qJb7US1fXtf7l gkJMMk6t6iccexV1/NBh/7tDZHH/v4HPirFTXQFizflaghD8dEADy9DY4BpQYFRe 8zGsv4/4U0txCXkUIfKcENt/FtXv2T9blJT6cDV0yTx9IAyd4Kor7Ly2FIYroSME uqnOQt5PwB+2qkE+9hdg4xBhFs9sW5dvyBvQvlBfX/xOmMw2ygH6vsaJlNfZ5VPa EP/wFP/qHyhDlCfbHdL6qF2//wUoM2QM9RgBdZNhcKU7zWuf7Ev199tmlLC5O14J PkQxUGftMfmWxQKCAQEA2OLKD8dwOzpwGJiPQdBmGpwCamfcCY4nDwqEaCu4vY1R OJR+rpYdC2hgl5PTXWH7qzJVdT/ZAz2xUQOgB1hD3Ltk7DQ+EZIA8+vJdaicQOme vfpMPNDxCEX9ee0AXAmAC3aET82B4cMFnjXjl1WXLLTowF/Jp/hMorm6tl2m15A2 oTyWlB/i/W/cxHl2HFWK7o8uCNoKpKJjheNYn+emEcH1bkwrk8sxQ78cBNmqe/gk MLgu8qfXQ0LLKIL7wqmIUHeUpkepOod8uXcTmmN2X9saCIwFKx4Jal5hh5v5cy0G MkyZcUIhhnmzr7lXbepauE5V2Sj5Qp040AfRVjZcrwKCAQANe8OwuzPL6P2F20Ij zwaLIhEx6QdYkC5i6lHaAY3jwoc3SMQLODQdjh0q9RFvMW8rFD+q7fG89T5hk8w9 4ppvvthXY52vqBixcAEmCdvnAYxA15XtV1BDTLGAnHDfL3gu/85QqryMpU6ZDkdJ LQbJcwFWN+F1c1Iv335w0N9YlW9sNQtuUWTH8544K5i4VLfDOJwyrchbf5GlLqir /AYkGg634KVUKSwbzywxzm/QUkyTcLD5Xayg2V6/NDHjRKEqXbgDxwpJIrrjPvRp ZvoGfA+Im+o/LElcZz+ZL5lP7GIiiaFf3PN3XhQY1mxIAdEgbFthFhrxFBQGf+ng uBSVAoIBAHl12K8pg8LHoUtE9MVoziWMxRWOAH4ha+JSg4BLK/SLlbbYAnIHg1CG LcH1eWNMokJnt9An54KXJBw4qYAzgB23nHdjcncoivwPSg1oVclMjCfcaqGMac+2 UpPblF32vAyvXL3MWzZxn03Q5Bo2Rqk0zzwc6LP2rARdeyDyJaOHEfEOG03s5ZQE 91/YnbqUdW/QI3m1kkxM3Ot4PIOgmTJMqwQQCD+GhZppBmn49C7k8m+OVkxyjm0O lPOlFxUXGE3oCgltDGrIwaKj+wh1Ny/LZjLvJ13UPnWhUYE+al6EEnpMx4nT/S5w LZ71bu8RVajtxcoN1jnmDpECL8vWOeUCggEBAIEuKoY7pVHfs5gr5dXfQeVZEtqy LnSdsd37/aqQZRlUpVmBrPNl1JBLiEVhk2SL3XJIDU4Er7f0idhtYLY3eE7wqZ4d 38Iaj5tv3zBc/wb1bImPgOgXCH7QrrbW7uTiYMLScuUbMR4uSpfubLaV8Zc9WHT8 kTJ2pKKtA1GPJ4V7HCIxuTjD2iyOK1CRkaqSC+5VUuq5gHf92CEstv9AIvvy5cWg gnfBQoS89m3aO035henSfRFKVJkHaEoasj8hB3pwl9FGZUJp1c2JxiKzONqZhyGa 6tcIAM3od0QtAfDJ89tWJ5D31W8KNNysobFSQxZ62WgLUUtXrkN1LGodxGQ= -----END RSA PRIVATE KEY-----`), []byte(`ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC6L2U2MIlqEd4VIULodeL8I1fnzwL8vaAlTHrluc2mFUL3yFbXDOhG89cfHlpadvuURuk2E/oHRSgIENNo+C32Ed8P+g1D7odPVCkMgZ9mZcj3X+1yMZVIFvE3tZpi38ew+saNtqXC9A8KE3newxWYWQxMQNHkbfM4E4Aas6KaUJPzTAjZLleDSyl3yOMozkjWzANHTG24NacdNHU6GKf6kRAgTqCUtN9iruhDHqeYxdcE2aT5Jo8PUUDKOQX/zWKbYQdcHKA0TCtpWsNwDEraYqVTZcwmKiBAo1haWbdSRs0HpY8t7Xb4prTauYhWxKoilz9kIGtoCUJpJaVgKRT68naEf/7KnLltc2VtpOJZkr6+4js8LztPnTIs15dW41kDKfMOkEK+yOKIesH9kVF9V8Xo++JXwJX6bsZPN8DAmFV5JuWtHqe2zXorQdMPjy/nsNTRvS3lU68LtxY9KGz5p91IvdnxF4vkRYyBTXB++3JxEp6GINUaPcyzZx/zdEgA2vfzsb7UtxNBg/skm4HtK/LmP5Hr4eMjRyC7gQxQ91Z8I0YbKuXHAk20+ZRJ9qwfXFQqmqvt0L7Sw3j+B8nDvlZMBisBOQ/N7Ghg1oywYN+G6iGRhrdOfarWDeSqGxf9HQV3l3x3mpzXfupxELGJljP1/dtWRdBuFiY711rcqw== test-dummy-20171002140848`), nil, } func init() { testSigner, _ := NewTestSigner() Dummy.Signer = testSigner } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/ecdsa_signature.go���������������0000664�0000000�0000000�00000003000�13771713062�0030750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication import ( "encoding/asn1" "encoding/base64" "fmt" "math/big" "github.com/pkg/errors" "golang.org/x/crypto/ssh" ) type ecdsaSignature struct { hashAlgorithm string R *big.Int S *big.Int } func (s *ecdsaSignature) SignatureType() string { return fmt.Sprintf("ecdsa-%s", s.hashAlgorithm) } func (s *ecdsaSignature) String() string { toEncode := struct { R *big.Int S *big.Int }{ R: s.R, S: s.S, } signatureBytes, err := asn1.Marshal(toEncode) if err != nil { panic(fmt.Sprintf("Error marshaling signature: %s", err)) } return base64.StdEncoding.EncodeToString(signatureBytes) } func newECDSASignature(signatureBlob []byte) (*ecdsaSignature, error) { var ecSig struct { R *big.Int S *big.Int } if err := ssh.Unmarshal(signatureBlob, &ecSig); err != nil { return nil, errors.Wrap(err, "unable to unmarshall signature") } rValue := ecSig.R.Bytes() var hashAlgorithm string switch len(rValue) { case 31, 32: hashAlgorithm = "sha256" case 65, 66: hashAlgorithm = "sha512" default: return nil, fmt.Errorf("Unsupported key length: %d", len(rValue)) } return &ecdsaSignature{ hashAlgorithm: hashAlgorithm, R: ecSig.R, S: ecSig.S, }, nil } packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/private_key_signer.go������������0000664�0000000�0000000�00000006673�13771713062�0031524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication import ( "crypto" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/base64" "encoding/pem" "fmt" "strings" "github.com/pkg/errors" "golang.org/x/crypto/ssh" ) type PrivateKeySigner struct { formattedKeyFingerprint string keyFingerprint string algorithm string accountName string userName string hashFunc crypto.Hash privateKey *rsa.PrivateKey } type PrivateKeySignerInput struct { KeyID string PrivateKeyMaterial []byte AccountName string Username string } func NewPrivateKeySigner(input PrivateKeySignerInput) (*PrivateKeySigner, error) { keyFingerprintMD5 := strings.Replace(input.KeyID, ":", "", -1) block, _ := pem.Decode(input.PrivateKeyMaterial) if block == nil { return nil, errors.New("Error PEM-decoding private key material: nil block received") } rsakey, err := x509.ParsePKCS1PrivateKey(block.Bytes) if err != nil { return nil, errors.Wrap(err, "unable to parse private key") } sshPublicKey, err := ssh.NewPublicKey(rsakey.Public()) if err != nil { return nil, errors.Wrap(err, "unable to parse SSH key from private key") } matchKeyFingerprint := formatPublicKeyFingerprint(sshPublicKey, false) displayKeyFingerprint := formatPublicKeyFingerprint(sshPublicKey, true) if matchKeyFingerprint != keyFingerprintMD5 { return nil, errors.New("Private key file does not match public key fingerprint") } signer := &PrivateKeySigner{ formattedKeyFingerprint: displayKeyFingerprint, keyFingerprint: input.KeyID, accountName: input.AccountName, hashFunc: crypto.SHA1, privateKey: rsakey, } if input.Username != "" { signer.userName = input.Username } _, algorithm, err := signer.SignRaw("HelloWorld") if err != nil { return nil, fmt.Errorf("Cannot sign using ssh agent: %s", err) } signer.algorithm = algorithm return signer, nil } func (s *PrivateKeySigner) Sign(dateHeader string, isManta bool) (string, error) { const headerName = "date" hash := s.hashFunc.New() hash.Write([]byte(fmt.Sprintf("%s: %s", headerName, dateHeader))) digest := hash.Sum(nil) signed, err := rsa.SignPKCS1v15(rand.Reader, s.privateKey, s.hashFunc, digest) if err != nil { return "", errors.Wrap(err, "unable to sign date header") } signedBase64 := base64.StdEncoding.EncodeToString(signed) key := &KeyID{ UserName: s.userName, AccountName: s.accountName, Fingerprint: s.formattedKeyFingerprint, IsManta: isManta, } return fmt.Sprintf(authorizationHeaderFormat, key.generate(), "rsa-sha1", headerName, signedBase64), nil } func (s *PrivateKeySigner) SignRaw(toSign string) (string, string, error) { hash := s.hashFunc.New() hash.Write([]byte(toSign)) digest := hash.Sum(nil) signed, err := rsa.SignPKCS1v15(rand.Reader, s.privateKey, s.hashFunc, digest) if err != nil { return "", "", errors.Wrap(err, "unable to sign date header") } signedBase64 := base64.StdEncoding.EncodeToString(signed) return signedBase64, "rsa-sha1", nil } func (s *PrivateKeySigner) KeyFingerprint() string { return s.formattedKeyFingerprint } func (s *PrivateKeySigner) DefaultAlgorithm() string { return s.algorithm } ���������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/rsa_signature.go�����������������0000664�0000000�0000000�00000001336�13771713062�0030470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication import ( "encoding/base64" ) type rsaSignature struct { hashAlgorithm string signature []byte } func (s *rsaSignature) SignatureType() string { return s.hashAlgorithm } func (s *rsaSignature) String() string { return base64.StdEncoding.EncodeToString(s.signature) } func newRSASignature(signatureBlob []byte) (*rsaSignature, error) { return &rsaSignature{ hashAlgorithm: "rsa-sha1", signature: signatureBlob, }, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/signature.go���������������������0000664�0000000�0000000�00000001332�13771713062�0027617�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication import ( "fmt" "regexp" ) type httpAuthSignature interface { SignatureType() string String() string } func keyFormatToKeyType(keyFormat string) (string, error) { if keyFormat == "ssh-rsa" { return "rsa", nil } if keyFormat == "ssh-ed25519" { return "ed25519", nil } if regexp.MustCompile("^ecdsa-sha2-*").Match([]byte(keyFormat)) { return "ecdsa", nil } return "", fmt.Errorf("Unknown key format: %s", keyFormat) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/signer.go������������������������0000664�0000000�0000000�00000001077�13771713062�0027113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication const authorizationHeaderFormat = `Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"` type Signer interface { DefaultAlgorithm() string KeyFingerprint() string Sign(dateHeader string, isManta bool) (string, error) SignRaw(toSign string) (string, string, error) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/ssh_agent_signer.go��������������0000664�0000000�0000000�00000011731�13771713062�0031144�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication import ( "crypto/md5" "crypto/sha256" "encoding/base64" "fmt" "net" "os" "strings" pkgerrors "github.com/pkg/errors" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/agent" ) var ( ErrUnsetEnvVar = pkgerrors.New("environment variable SSH_AUTH_SOCK not set") ) type SSHAgentSigner struct { formattedKeyFingerprint string keyFingerprint string algorithm string accountName string userName string keyIdentifier string agent agent.Agent key ssh.PublicKey } type SSHAgentSignerInput struct { KeyID string AccountName string Username string } func NewSSHAgentSigner(input SSHAgentSignerInput) (*SSHAgentSigner, error) { sshAgentAddress, agentOk := os.LookupEnv("SSH_AUTH_SOCK") if !agentOk { return nil, ErrUnsetEnvVar } conn, err := net.Dial("unix", sshAgentAddress) if err != nil { return nil, pkgerrors.Wrap(err, "unable to dial SSH agent") } ag := agent.NewClient(conn) signer := &SSHAgentSigner{ keyFingerprint: input.KeyID, accountName: input.AccountName, agent: ag, } if input.Username != "" { signer.userName = input.Username } matchingKey, err := signer.MatchKey() if err != nil { return nil, err } signer.key = matchingKey signer.formattedKeyFingerprint = formatPublicKeyFingerprint(signer.key, true) _, algorithm, err := signer.SignRaw("HelloWorld") if err != nil { return nil, fmt.Errorf("Cannot sign using ssh agent: %s", err) } signer.algorithm = algorithm return signer, nil } func (s *SSHAgentSigner) MatchKey() (ssh.PublicKey, error) { keys, err := s.agent.List() if err != nil { return nil, pkgerrors.Wrap(err, "unable to list keys in SSH Agent") } keyFingerprintStripped := strings.TrimPrefix(s.keyFingerprint, "MD5:") keyFingerprintStripped = strings.TrimPrefix(keyFingerprintStripped, "SHA256:") keyFingerprintStripped = strings.Replace(keyFingerprintStripped, ":", "", -1) var matchingKey ssh.PublicKey for _, key := range keys { keyMD5 := md5.New() keyMD5.Write(key.Marshal()) finalizedMD5 := fmt.Sprintf("%x", keyMD5.Sum(nil)) keySHA256 := sha256.New() keySHA256.Write(key.Marshal()) finalizedSHA256 := base64.RawStdEncoding.EncodeToString(keySHA256.Sum(nil)) if keyFingerprintStripped == finalizedMD5 || keyFingerprintStripped == finalizedSHA256 { matchingKey = key } } if matchingKey == nil { return nil, fmt.Errorf("No key in the SSH Agent matches fingerprint: %s", s.keyFingerprint) } return matchingKey, nil } func (s *SSHAgentSigner) Sign(dateHeader string, isManta bool) (string, error) { const headerName = "date" signature, err := s.agent.Sign(s.key, []byte(fmt.Sprintf("%s: %s", headerName, dateHeader))) if err != nil { return "", pkgerrors.Wrap(err, "unable to sign date header") } keyFormat, err := keyFormatToKeyType(signature.Format) if err != nil { return "", pkgerrors.Wrap(err, "unable to format signature") } key := &KeyID{ UserName: s.userName, AccountName: s.accountName, Fingerprint: s.formattedKeyFingerprint, IsManta: isManta, } var authSignature httpAuthSignature switch keyFormat { case "rsa": authSignature, err = newRSASignature(signature.Blob) if err != nil { return "", pkgerrors.Wrap(err, "unable to read RSA signature") } case "ecdsa": authSignature, err = newECDSASignature(signature.Blob) if err != nil { return "", pkgerrors.Wrap(err, "unable to read ECDSA signature") } default: return "", fmt.Errorf("Unsupported algorithm from SSH agent: %s", signature.Format) } return fmt.Sprintf(authorizationHeaderFormat, key.generate(), authSignature.SignatureType(), headerName, authSignature.String()), nil } func (s *SSHAgentSigner) SignRaw(toSign string) (string, string, error) { signature, err := s.agent.Sign(s.key, []byte(toSign)) if err != nil { return "", "", pkgerrors.Wrap(err, "unable to sign string") } keyFormat, err := keyFormatToKeyType(signature.Format) if err != nil { return "", "", pkgerrors.Wrap(err, "unable to format key") } var authSignature httpAuthSignature switch keyFormat { case "rsa": authSignature, err = newRSASignature(signature.Blob) if err != nil { return "", "", pkgerrors.Wrap(err, "unable to read RSA signature") } case "ecdsa": authSignature, err = newECDSASignature(signature.Blob) if err != nil { return "", "", pkgerrors.Wrap(err, "unable to read ECDSA signature") } default: return "", "", fmt.Errorf("Unsupported algorithm from SSH agent: %s", signature.Format) } return authSignature.String(), authSignature.SignatureType(), nil } func (s *SSHAgentSigner) KeyFingerprint() string { return s.formattedKeyFingerprint } func (s *SSHAgentSigner) DefaultAlgorithm() string { return s.algorithm } ���������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/test_signer.go�������������������0000664�0000000�0000000�00000001635�13771713062�0030152�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication // TestSigner represents an authentication key signer which we can use for // testing purposes only. This will largely be a stub to send through client // unit tests. type TestSigner struct{} // NewTestSigner constructs a new instance of test signer func NewTestSigner() (Signer, error) { return &TestSigner{}, nil } func (s *TestSigner) DefaultAlgorithm() string { return "" } func (s *TestSigner) KeyFingerprint() string { return "" } func (s *TestSigner) Sign(dateHeader string, isManta bool) (string, error) { return "", nil } func (s *TestSigner) SignRaw(toSign string) (string, string, error) { return "", "", nil } ���������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/authentication/util.go��������������������������0000664�0000000�0000000�00000002052�13771713062�0026573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package authentication import ( "crypto/md5" "fmt" "strings" "golang.org/x/crypto/ssh" ) // formatPublicKeyFingerprint produces the MD5 fingerprint of the given SSH // public key. If display is true, the fingerprint is formatted with colons // between each byte, as per the output of OpenSSL. func formatPublicKeyFingerprint(key ssh.PublicKey, display bool) string { publicKeyFingerprint := md5.New() publicKeyFingerprint.Write(key.Marshal()) publicKeyFingerprintString := fmt.Sprintf("%x", publicKeyFingerprint.Sum(nil)) if !display { return publicKeyFingerprintString } formatted := "" for i := 0; i < len(publicKeyFingerprintString); i = i + 2 { formatted = fmt.Sprintf("%s%s:", formatted, publicKeyFingerprintString[i:i+2]) } return strings.TrimSuffix(formatted, ":") } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/client/�����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023527�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/client/client.go��������������������������������0000664�0000000�0000000�00000040205�13771713062�0025335�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package client import ( "bytes" "context" "crypto/tls" "encoding/json" "fmt" "io" "net" "net/http" "net/url" "regexp" "strings" "time" triton "github.com/joyent/triton-go" "github.com/joyent/triton-go/authentication" "github.com/joyent/triton-go/errors" pkgerrors "github.com/pkg/errors" ) var ( ErrDefaultAuth = pkgerrors.New("default SSH agent authentication requires SDC_KEY_ID / TRITON_KEY_ID and SSH_AUTH_SOCK") ErrAccountName = pkgerrors.New("missing account name") ErrMissingURL = pkgerrors.New("missing API URL") InvalidTritonURL = "invalid format of Triton URL" InvalidMantaURL = "invalid format of Manta URL" InvalidServicesURL = "invalid format of Triton Service Groups URL" InvalidDCInURL = "invalid data center in URL" knownDCFormats = []string{ `https?://(.*).api.joyent.com`, `https?://(.*).api.joyentcloud.com`, `https?://(.*).api.samsungcloud.io`, } jpcFormatURL = "https://tsg.%s.svc.joyent.zone" spcFormatURL = "https://tsg.%s.svc.samsungcloud.zone" ) // Client represents a connection to the Triton Compute or Object Storage APIs. type Client struct { HTTPClient *http.Client RequestHeader *http.Header Authorizers []authentication.Signer TritonURL url.URL MantaURL url.URL ServicesURL url.URL AccountName string Username string } func isPrivateInstall(url string) bool { for _, pattern := range knownDCFormats { re := regexp.MustCompile(pattern) matches := re.FindStringSubmatch(url) if len(matches) > 1 { return false } } return true } // parseDC parses out the data center commonly found in Triton URLs. Returns an // error if the Triton URL does not include a known data center name, in which // case a URL override (TRITON_TSG_URL) must be provided. func parseDC(url string) (string, bool, error) { isSamsung := false if strings.Contains(url, "samsung") { isSamsung = true } for _, pattern := range knownDCFormats { re := regexp.MustCompile(pattern) matches := re.FindStringSubmatch(url) if len(matches) > 1 { return matches[1], isSamsung, nil } } return "", isSamsung, fmt.Errorf("failed to parse datacenter from '%s'", url) } // New is used to construct a Client in order to make API // requests to the Triton API. // // At least one signer must be provided - example signers include // authentication.PrivateKeySigner and authentication.SSHAgentSigner. func New(tritonURL string, mantaURL string, accountName string, signers ...authentication.Signer) (*Client, error) { if accountName == "" { return nil, ErrAccountName } if tritonURL == "" && mantaURL == "" { return nil, ErrMissingURL } cloudURL, err := url.Parse(tritonURL) if err != nil { return nil, pkgerrors.Wrapf(err, InvalidTritonURL) } storageURL, err := url.Parse(mantaURL) if err != nil { return nil, pkgerrors.Wrapf(err, InvalidMantaURL) } // Generate the Services URL (TSG) based on the current datacenter used in // the Triton URL (if TritonURL is available). If TRITON_TSG_URL environment // variable is available than override using that value instead. tsgURL := triton.GetEnv("TSG_URL") if tsgURL == "" && tritonURL != "" && !isPrivateInstall(tritonURL) { currentDC, isSamsung, err := parseDC(tritonURL) if err != nil { return nil, pkgerrors.Wrapf(err, InvalidDCInURL) } tsgURL = fmt.Sprintf(jpcFormatURL, currentDC) if isSamsung { tsgURL = fmt.Sprintf(spcFormatURL, currentDC) } } servicesURL, err := url.Parse(tsgURL) if err != nil { return nil, pkgerrors.Wrapf(err, InvalidServicesURL) } authorizers := make([]authentication.Signer, 0) for _, key := range signers { if key != nil { authorizers = append(authorizers, key) } } newClient := &Client{ HTTPClient: &http.Client{ Transport: httpTransport(false), CheckRedirect: doNotFollowRedirects, }, Authorizers: authorizers, TritonURL: *cloudURL, MantaURL: *storageURL, ServicesURL: *servicesURL, AccountName: accountName, } // Default to constructing an SSHAgentSigner if there are no other signers // passed into NewClient and there's an TRITON_KEY_ID and SSH_AUTH_SOCK // available in the user's environ(7). if len(newClient.Authorizers) == 0 { if err := newClient.DefaultAuth(); err != nil { return nil, err } } return newClient, nil } // initDefaultAuth provides a default key signer for a client. This should only // be used internally if the client has no other key signer for authenticating // with Triton. We first look for both `SDC_KEY_ID` and `SSH_AUTH_SOCK` in the // user's environ(7). If so we default to the SSH agent key signer. func (c *Client) DefaultAuth() error { tritonKeyId := triton.GetEnv("KEY_ID") if tritonKeyId != "" { input := authentication.SSHAgentSignerInput{ KeyID: tritonKeyId, AccountName: c.AccountName, Username: c.Username, } defaultSigner, err := authentication.NewSSHAgentSigner(input) if err != nil { return pkgerrors.Wrapf(err, "unable to initialize NewSSHAgentSigner") } c.Authorizers = append(c.Authorizers, defaultSigner) } return ErrDefaultAuth } // InsecureSkipTLSVerify turns off TLS verification for the client connection. This // allows connection to an endpoint with a certificate which was signed by a non- // trusted CA, such as self-signed certificates. This can be useful when connecting // to temporary Triton installations such as Triton Cloud-On-A-Laptop. func (c *Client) InsecureSkipTLSVerify() { if c.HTTPClient == nil { return } c.HTTPClient.Transport = httpTransport(true) } // httpTransport is responsible for setting up our HTTP client's transport // settings func httpTransport(insecureSkipTLSVerify bool) *http.Transport { return &http.Transport{ Proxy: http.ProxyFromEnvironment, Dial: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).Dial, TLSHandshakeTimeout: 10 * time.Second, MaxIdleConns: 10, IdleConnTimeout: 15 * time.Second, TLSClientConfig: &tls.Config{ InsecureSkipVerify: insecureSkipTLSVerify, }, } } func doNotFollowRedirects(*http.Request, []*http.Request) error { return http.ErrUseLastResponse } // DecodeError decodes a backend Triton error into a more usable Go error type func (c *Client) DecodeError(resp *http.Response, requestMethod string) error { err := &errors.APIError{ StatusCode: resp.StatusCode, } if requestMethod != http.MethodHead && resp.Body != nil { errorDecoder := json.NewDecoder(resp.Body) if err := errorDecoder.Decode(err); err != nil { return pkgerrors.Wrapf(err, "unable to decode error response") } } if err.Message == "" { err.Message = fmt.Sprintf("HTTP response returned status code %d", err.StatusCode) } return err } // overrideHeader overrides the header of the passed in HTTP request func (c *Client) overrideHeader(req *http.Request) { if c.RequestHeader != nil { for k := range *c.RequestHeader { req.Header.Set(k, c.RequestHeader.Get(k)) } } } // resetHeader will reset the struct field that stores custom header // information func (c *Client) resetHeader() { c.RequestHeader = nil } // ----------------------------------------------------------------------------- type RequestInput struct { Method string Path string Query *url.Values Headers *http.Header Body interface{} } func (c *Client) ExecuteRequestURIParams(ctx context.Context, inputs RequestInput) (io.ReadCloser, error) { defer c.resetHeader() method := inputs.Method path := inputs.Path body := inputs.Body query := inputs.Query var requestBody io.Reader if body != nil { marshaled, err := json.MarshalIndent(body, "", " ") if err != nil { return nil, err } requestBody = bytes.NewReader(marshaled) } endpoint := c.TritonURL endpoint.Path = path if query != nil { endpoint.RawQuery = query.Encode() } req, err := http.NewRequest(method, endpoint.String(), requestBody) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to construct HTTP request") } dateHeader := time.Now().UTC().Format(time.RFC1123) req.Header.Set("date", dateHeader) // NewClient ensures there's always an authorizer (unless this is called // outside that constructor). authHeader, err := c.Authorizers[0].Sign(dateHeader, false) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to sign HTTP request") } req.Header.Set("Authorization", authHeader) req.Header.Set("Accept", "application/json") req.Header.Set("Accept-Version", triton.CloudAPIMajorVersion) req.Header.Set("User-Agent", triton.UserAgent()) if body != nil { req.Header.Set("Content-Type", "application/json") } c.overrideHeader(req) resp, err := c.HTTPClient.Do(req.WithContext(ctx)) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to execute HTTP request") } // We will only return a response from the API it is in the HTTP StatusCode // 2xx range // StatusMultipleChoices is StatusCode 300 if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { return resp.Body, nil } return nil, c.DecodeError(resp, req.Method) } func (c *Client) ExecuteRequest(ctx context.Context, inputs RequestInput) (io.ReadCloser, error) { return c.ExecuteRequestURIParams(ctx, inputs) } func (c *Client) ExecuteRequestRaw(ctx context.Context, inputs RequestInput) (*http.Response, error) { defer c.resetHeader() method := inputs.Method path := inputs.Path body := inputs.Body query := inputs.Query var requestBody io.Reader if body != nil { marshaled, err := json.MarshalIndent(body, "", " ") if err != nil { return nil, err } requestBody = bytes.NewReader(marshaled) } endpoint := c.TritonURL endpoint.Path = path if query != nil { endpoint.RawQuery = query.Encode() } req, err := http.NewRequest(method, endpoint.String(), requestBody) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to construct HTTP request") } dateHeader := time.Now().UTC().Format(time.RFC1123) req.Header.Set("date", dateHeader) // NewClient ensures there's always an authorizer (unless this is called // outside that constructor). authHeader, err := c.Authorizers[0].Sign(dateHeader, false) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to sign HTTP request") } req.Header.Set("Authorization", authHeader) req.Header.Set("Accept", "application/json") req.Header.Set("Accept-Version", triton.CloudAPIMajorVersion) req.Header.Set("User-Agent", triton.UserAgent()) if body != nil { req.Header.Set("Content-Type", "application/json") } c.overrideHeader(req) resp, err := c.HTTPClient.Do(req.WithContext(ctx)) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to execute HTTP request") } // We will only return a response from the API it is in the HTTP StatusCode // 2xx range // StatusMultipleChoices is StatusCode 300 if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { return resp, nil } return nil, c.DecodeError(resp, req.Method) } func (c *Client) ExecuteRequestStorage(ctx context.Context, inputs RequestInput) (io.ReadCloser, http.Header, error) { defer c.resetHeader() method := inputs.Method path := inputs.Path query := inputs.Query headers := inputs.Headers body := inputs.Body endpoint := c.MantaURL endpoint.Path = path var requestBody io.Reader if body != nil { marshaled, err := json.MarshalIndent(body, "", " ") if err != nil { return nil, nil, err } requestBody = bytes.NewReader(marshaled) } req, err := http.NewRequest(method, endpoint.String(), requestBody) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "unable to construct HTTP request") } if body != nil && (headers == nil || headers.Get("Content-Type") == "") { req.Header.Set("Content-Type", "application/json") } if headers != nil { for key, values := range *headers { for _, value := range values { req.Header.Set(key, value) } } } dateHeader := time.Now().UTC().Format(time.RFC1123) req.Header.Set("date", dateHeader) authHeader, err := c.Authorizers[0].Sign(dateHeader, true) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "unable to sign HTTP request") } req.Header.Set("Authorization", authHeader) req.Header.Set("Accept", "*/*") req.Header.Set("User-Agent", triton.UserAgent()) if query != nil { req.URL.RawQuery = query.Encode() } c.overrideHeader(req) resp, err := c.HTTPClient.Do(req.WithContext(ctx)) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "unable to execute HTTP request") } // We will only return a response from the API it is in the HTTP StatusCode // 2xx range // StatusMultipleChoices is StatusCode 300 if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { return resp.Body, resp.Header, nil } return nil, nil, c.DecodeError(resp, req.Method) } type RequestNoEncodeInput struct { Method string Path string Query *url.Values Headers *http.Header Body io.Reader } func (c *Client) ExecuteRequestNoEncode(ctx context.Context, inputs RequestNoEncodeInput) (io.ReadCloser, http.Header, error) { defer c.resetHeader() method := inputs.Method path := inputs.Path query := inputs.Query headers := inputs.Headers body := inputs.Body endpoint := c.MantaURL endpoint.Path = path req, err := http.NewRequest(method, endpoint.String(), body) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "unable to construct HTTP request") } if headers != nil { for key, values := range *headers { for _, value := range values { req.Header.Set(key, value) } } } dateHeader := time.Now().UTC().Format(time.RFC1123) req.Header.Set("date", dateHeader) authHeader, err := c.Authorizers[0].Sign(dateHeader, true) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "unable to sign HTTP request") } req.Header.Set("Authorization", authHeader) req.Header.Set("Accept", "*/*") req.Header.Set("Accept-Version", triton.CloudAPIMajorVersion) req.Header.Set("User-Agent", triton.UserAgent()) if query != nil { req.URL.RawQuery = query.Encode() } c.overrideHeader(req) resp, err := c.HTTPClient.Do(req.WithContext(ctx)) if err != nil { return nil, nil, pkgerrors.Wrapf(err, "unable to execute HTTP request") } // We will only return a response from the API it is in the HTTP StatusCode // 2xx range // StatusMultipleChoices is StatusCode 300 if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { return resp.Body, resp.Header, nil } return nil, nil, c.DecodeError(resp, req.Method) } func (c *Client) ExecuteRequestTSG(ctx context.Context, inputs RequestInput) (io.ReadCloser, error) { defer c.resetHeader() method := inputs.Method path := inputs.Path body := inputs.Body query := inputs.Query var requestBody io.Reader if body != nil { marshaled, err := json.MarshalIndent(body, "", " ") if err != nil { return nil, err } requestBody = bytes.NewReader(marshaled) } endpoint := c.ServicesURL endpoint.Path = path if query != nil { endpoint.RawQuery = query.Encode() } req, err := http.NewRequest(method, endpoint.String(), requestBody) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to construct HTTP request") } dateHeader := time.Now().UTC().Format(time.RFC1123) req.Header.Set("date", dateHeader) // NewClient ensures there's always an authorizer (unless this is called // outside that constructor). authHeader, err := c.Authorizers[0].Sign(dateHeader, false) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to sign HTTP request") } req.Header.Set("Authorization", authHeader) req.Header.Set("Accept", "application/json") req.Header.Set("Accept-Version", triton.CloudAPIMajorVersion) req.Header.Set("User-Agent", triton.UserAgent()) if body != nil { req.Header.Set("Content-Type", "application/json") } c.overrideHeader(req) resp, err := c.HTTPClient.Do(req.WithContext(ctx)) if err != nil { return nil, pkgerrors.Wrapf(err, "unable to execute HTTP request") } if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { return resp.Body, nil } return nil, fmt.Errorf("could not process backend TSG request") } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023725�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/client.go�������������������������������0000664�0000000�0000000�00000005231�13771713062�0025533�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "net/http" triton "github.com/joyent/triton-go" "github.com/joyent/triton-go/client" ) type ComputeClient struct { Client *client.Client } func newComputeClient(client *client.Client) *ComputeClient { return &ComputeClient{ Client: client, } } // NewClient returns a new client for working with Compute endpoints and // resources within CloudAPI func NewClient(config *triton.ClientConfig) (*ComputeClient, error) { // TODO: Utilize config interface within the function itself client, err := client.New( config.TritonURL, config.MantaURL, config.AccountName, config.Signers..., ) if err != nil { return nil, err } return newComputeClient(client), nil } // SetHeaders allows a consumer of the current client to set custom headers for // the next backend HTTP request sent to CloudAPI func (c *ComputeClient) SetHeader(header *http.Header) { c.Client.RequestHeader = header } // Datacenters returns a Compute client used for accessing functions pertaining // to DataCenter functionality in the Triton API. func (c *ComputeClient) Datacenters() *DataCentersClient { return &DataCentersClient{c.Client} } // Images returns a Compute client used for accessing functions pertaining to // Images functionality in the Triton API. func (c *ComputeClient) Images() *ImagesClient { return &ImagesClient{c.Client} } // Machine returns a Compute client used for accessing functions pertaining to // machine functionality in the Triton API. func (c *ComputeClient) Instances() *InstancesClient { return &InstancesClient{c.Client} } // Packages returns a Compute client used for accessing functions pertaining to // Packages functionality in the Triton API. func (c *ComputeClient) Packages() *PackagesClient { return &PackagesClient{c.Client} } // Services returns a Compute client used for accessing functions pertaining to // Services functionality in the Triton API. func (c *ComputeClient) Services() *ServicesClient { return &ServicesClient{c.Client} } // Snapshots returns a Compute client used for accessing functions pertaining to // Snapshots functionality in the Triton API. func (c *ComputeClient) Snapshots() *SnapshotsClient { return &SnapshotsClient{c.Client} } // Snapshots returns a Compute client used for accessing functions pertaining to // Snapshots functionality in the Triton API. func (c *ComputeClient) Volumes() *VolumesClient { return &VolumesClient{c.Client} } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/datacenters.go��������������������������0000664�0000000�0000000�00000004264�13771713062�0026557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "encoding/json" "fmt" "net/http" "path" "sort" "github.com/joyent/triton-go/client" "github.com/joyent/triton-go/errors" pkgerrors "github.com/pkg/errors" ) type DataCentersClient struct { client *client.Client } type DataCenter struct { Name string `json:"name"` URL string `json:"url"` } type ListDataCentersInput struct{} func (c *DataCentersClient) List(ctx context.Context, _ *ListDataCentersInput) ([]*DataCenter, error) { fullPath := path.Join("/", c.client.AccountName, "datacenters") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, pkgerrors.Wrap(err, "unable to list data centers") } var intermediate map[string]string decoder := json.NewDecoder(respReader) if err = decoder.Decode(&intermediate); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode list data centers response") } keys := make([]string, len(intermediate)) i := 0 for k := range intermediate { keys[i] = k i++ } sort.Strings(keys) result := make([]*DataCenter, len(intermediate)) i = 0 for _, key := range keys { result[i] = &DataCenter{ Name: key, URL: intermediate[key], } i++ } return result, nil } type GetDataCenterInput struct { Name string } func (c *DataCentersClient) Get(ctx context.Context, input *GetDataCenterInput) (*DataCenter, error) { dcs, err := c.List(ctx, &ListDataCentersInput{}) if err != nil { return nil, pkgerrors.Wrap(err, "unable to get data center") } for _, dc := range dcs { if dc.Name == input.Name { return &DataCenter{ Name: input.Name, URL: dc.URL, }, nil } } return nil, &errors.APIError{ StatusCode: http.StatusNotFound, Code: "ResourceNotFound", Message: fmt.Sprintf("data center %q not found", input.Name), } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/images.go�������������������������������0000664�0000000�0000000�00000016202�13771713062�0025522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "encoding/json" "net/http" "net/url" "path" "time" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type ImagesClient struct { client *client.Client } type ImageFile struct { Compression string `json:"compression"` SHA1 string `json:"sha1"` Size int64 `json:"size"` } type Image struct { ID string `json:"id"` Name string `json:"name"` OS string `json:"os"` Description string `json:"description"` Version string `json:"version"` Type string `json:"type"` Requirements map[string]interface{} `json:"requirements"` Homepage string `json:"homepage"` Files []*ImageFile `json:"files"` PublishedAt time.Time `json:"published_at"` Owner string `json:"owner"` Public bool `json:"public"` State string `json:"state"` Tags map[string]string `json:"tags"` EULA string `json:"eula"` ACL []string `json:"acl"` } type ListImagesInput struct { Name string OS string Version string Public bool State string Owner string Type string } func (c *ImagesClient) List(ctx context.Context, input *ListImagesInput) ([]*Image, error) { fullPath := path.Join("/", c.client.AccountName, "images") query := &url.Values{} if input.Name != "" { query.Set("name", input.Name) } if input.OS != "" { query.Set("os", input.OS) } if input.Version != "" { query.Set("version", input.Version) } if input.Public { query.Set("public", "true") } if input.State != "" { query.Set("state", input.State) } if input.Owner != "" { query.Set("owner", input.Owner) } if input.Type != "" { query.Set("type", input.Type) } reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, Query: query, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list images") } var result []*Image decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list images response") } return result, nil } type GetImageInput struct { ImageID string } func (c *ImagesClient) Get(ctx context.Context, input *GetImageInput) (*Image, error) { fullPath := path.Join("/", c.client.AccountName, "images", input.ImageID) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to get image") } var result *Image decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get image response") } return result, nil } type DeleteImageInput struct { ImageID string } func (c *ImagesClient) Delete(ctx context.Context, input *DeleteImageInput) error { fullPath := path.Join("/", c.client.AccountName, "images", input.ImageID) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return errors.Wrap(err, "unable to delete image") } return nil } type ExportImageInput struct { ImageID string MantaPath string } type MantaLocation struct { MantaURL string `json:"manta_url"` ImagePath string `json:"image_path"` ManifestPath string `json:"manifest_path"` } func (c *ImagesClient) Export(ctx context.Context, input *ExportImageInput) (*MantaLocation, error) { fullPath := path.Join("/", c.client.AccountName, "images", input.ImageID) query := &url.Values{} query.Set("action", "export") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: query, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to export image") } var result *MantaLocation decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode export image response") } return result, nil } type CreateImageFromMachineInput struct { MachineID string `json:"machine"` Name string `json:"name"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` HomePage string `json:"homepage,omitempty"` EULA string `json:"eula,omitempty"` ACL []string `json:"acl,omitempty"` Tags map[string]string `json:"tags,omitempty"` } func (c *ImagesClient) CreateFromMachine(ctx context.Context, input *CreateImageFromMachineInput) (*Image, error) { fullPath := path.Join("/", c.client.AccountName, "images") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to create machine from image") } var result *Image decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode create machine from image response") } return result, nil } type UpdateImageInput struct { ImageID string `json:"-"` Name string `json:"name,omitempty"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` HomePage string `json:"homepage,omitempty"` EULA string `json:"eula,omitempty"` ACL []string `json:"acl,omitempty"` Tags map[string]string `json:"tags,omitempty"` } func (c *ImagesClient) Update(ctx context.Context, input *UpdateImageInput) (*Image, error) { fullPath := path.Join("/", c.client.AccountName, "images", input.ImageID) query := &url.Values{} query.Set("action", "update") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: query, Body: input, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to update image") } var result *Image decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode update image response") } return result, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/instances.go����������������������������0000664�0000000�0000000�00000075247�13771713062�0026262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "crypto/sha1" "encoding/hex" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/url" "path" "strconv" "strings" "time" "github.com/joyent/triton-go/client" "github.com/joyent/triton-go/errors" pkgerrors "github.com/pkg/errors" ) type InstancesClient struct { client *client.Client } const ( CNSTagDisable = "triton.cns.disable" CNSTagReversePTR = "triton.cns.reverse_ptr" CNSTagServices = "triton.cns.services" ) // InstanceCNS is a container for the CNS-specific attributes. In the API these // values are embedded within a Instance's Tags attribute, however they are // exposed to the caller as their native types. type InstanceCNS struct { Disable bool ReversePTR string Services []string } type InstanceVolume struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Mode string `json:"mode,omitempty"` Mountpoint string `json:"mountpoint,omitempty"` } type Instance struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Brand string `json:"brand"` State string `json:"state"` Image string `json:"image"` Memory int `json:"memory"` Disk int `json:"disk"` Metadata map[string]string `json:"metadata"` Tags map[string]interface{} `json:"tags"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Docker bool `json:"docker"` IPs []string `json:"ips"` Networks []string `json:"networks"` PrimaryIP string `json:"primaryIp"` FirewallEnabled bool `json:"firewall_enabled"` ComputeNode string `json:"compute_node"` Package string `json:"package"` DomainNames []string `json:"dns_names"` DeletionProtection bool `json:"deletion_protection"` CNS InstanceCNS } // _Instance is a private facade over Instance that handles the necessary API // overrides from VMAPI's machine endpoint(s). type _Instance struct { Instance Tags map[string]interface{} `json:"tags"` } type NIC struct { IP string `json:"ip"` MAC string `json:"mac"` Primary bool `json:"primary"` Netmask string `json:"netmask"` Gateway string `json:"gateway"` State string `json:"state"` Network string `json:"network"` } type GetInstanceInput struct { ID string } func (gmi *GetInstanceInput) Validate() error { if gmi.ID == "" { return fmt.Errorf("machine ID can not be empty") } return nil } func (c *InstancesClient) Count(ctx context.Context, input *ListInstancesInput) (int, error) { fullPath := path.Join("/", c.client.AccountName, "machines") reqInputs := client.RequestInput{ Method: http.MethodHead, Path: fullPath, Query: buildQueryFilter(input), } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return -1, pkgerrors.Wrap(err, "unable to get machines count") } if response == nil { return -1, pkgerrors.New("request to get machines count has empty response") } defer response.Body.Close() var result int if count := response.Header.Get("X-Resource-Count"); count != "" { value, err := strconv.Atoi(count) if err != nil { return -1, pkgerrors.Wrap(err, "unable to decode machines count response") } result = value } return result, nil } func (c *InstancesClient) Get(ctx context.Context, input *GetInstanceInput) (*Instance, error) { if err := input.Validate(); err != nil { return nil, pkgerrors.Wrap(err, "unable to get machine") } fullPath := path.Join("/", c.client.AccountName, "machines", input.ID) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if response == nil { return nil, pkgerrors.Wrap(err, "unable to get machine") } if response.Body != nil { defer response.Body.Close() } if response.StatusCode == http.StatusNotFound || response.StatusCode == http.StatusGone { return nil, &errors.APIError{ StatusCode: response.StatusCode, Code: "ResourceNotFound", } } if err != nil { return nil, pkgerrors.Wrap(err, "unable to get machine") } var result *_Instance decoder := json.NewDecoder(response.Body) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode get machine response") } native, err := result.toNative() if err != nil { return nil, pkgerrors.Wrap(err, "unable to decode get machine response") } return native, nil } type ListInstancesInput struct { Brand string Alias string Name string Image string State string Memory uint16 Limit uint16 Offset uint16 Tags map[string]interface{} // query by arbitrary tags prefixed with "tag." Tombstone bool Docker bool Credentials bool } func buildQueryFilter(input *ListInstancesInput) *url.Values { query := &url.Values{} if input.Brand != "" { query.Set("brand", input.Brand) } if input.Name != "" { query.Set("name", input.Name) } if input.Image != "" { query.Set("image", input.Image) } if input.State != "" { query.Set("state", input.State) } if input.Memory >= 1 { query.Set("memory", fmt.Sprintf("%d", input.Memory)) } if input.Limit >= 1 && input.Limit <= 1000 { query.Set("limit", fmt.Sprintf("%d", input.Limit)) } if input.Offset >= 0 { query.Set("offset", fmt.Sprintf("%d", input.Offset)) } if input.Tombstone { query.Set("tombstone", "true") } if input.Docker { query.Set("docker", "true") } if input.Credentials { query.Set("credentials", "true") } if input.Tags != nil { for k, v := range input.Tags { query.Set(fmt.Sprintf("tag.%s", k), v.(string)) } } return query } func (c *InstancesClient) List(ctx context.Context, input *ListInstancesInput) ([]*Instance, error) { fullPath := path.Join("/", c.client.AccountName, "machines") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, Query: buildQueryFilter(input), } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, pkgerrors.Wrap(err, "unable to list machines") } var results []*_Instance decoder := json.NewDecoder(respReader) if err = decoder.Decode(&results); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode list machines response") } machines := make([]*Instance, 0, len(results)) for _, machineAPI := range results { native, err := machineAPI.toNative() if err != nil { return nil, pkgerrors.Wrap(err, "unable to decode list machines response") } machines = append(machines, native) } return machines, nil } type CreateInstanceInput struct { Name string NamePrefix string Package string Image string Networks []string Affinity []string LocalityStrict bool LocalityNear []string LocalityFar []string Metadata map[string]string Tags map[string]string // FirewallEnabled bool // CNS InstanceCNS Volumes []InstanceVolume } func buildInstanceName(namePrefix string) string { h := sha1.New() io.WriteString(h, namePrefix+time.Now().UTC().String()) return fmt.Sprintf("%s%s", namePrefix, hex.EncodeToString(h.Sum(nil))[:8]) } func (input *CreateInstanceInput) toAPI() (map[string]interface{}, error) { const numExtraParams = 8 result := make(map[string]interface{}, numExtraParams+len(input.Metadata)+len(input.Tags)) result["firewall_enabled"] = input.FirewallEnabled if input.Name != "" { result["name"] = input.Name } else if input.NamePrefix != "" { result["name"] = buildInstanceName(input.NamePrefix) } if input.Package != "" { result["package"] = input.Package } if input.Image != "" { result["image"] = input.Image } if len(input.Networks) > 0 { result["networks"] = input.Networks } if len(input.Volumes) > 0 { result["volumes"] = input.Volumes } // validate that affinity and locality are not included together hasAffinity := len(input.Affinity) > 0 hasLocality := len(input.LocalityNear) > 0 || len(input.LocalityFar) > 0 if hasAffinity && hasLocality { return nil, fmt.Errorf("Cannot include both Affinity and Locality") } // affinity takes precedence over locality regardless if len(input.Affinity) > 0 { result["affinity"] = input.Affinity } else { locality := struct { Strict bool `json:"strict"` Near []string `json:"near,omitempty"` Far []string `json:"far,omitempty"` }{ Strict: input.LocalityStrict, Near: input.LocalityNear, Far: input.LocalityFar, } result["locality"] = locality } for key, value := range input.Tags { result[fmt.Sprintf("tag.%s", key)] = value } // NOTE(justinwr): CNSTagServices needs to be a tag if available. No other // CNS tags will be handled at this time. input.CNS.toTags(result) if val, found := result[CNSTagServices]; found { result["tag."+CNSTagServices] = val delete(result, CNSTagServices) } for key, value := range input.Metadata { result[fmt.Sprintf("metadata.%s", key)] = value } return result, nil } func (c *InstancesClient) Create(ctx context.Context, input *CreateInstanceInput) (*Instance, error) { fullPath := path.Join("/", c.client.AccountName, "machines") body, err := input.toAPI() if err != nil { return nil, pkgerrors.Wrap(err, "unable to prepare for machine creation") } reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: body, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, pkgerrors.Wrap(err, "unable to create machine") } var result *Instance decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode create machine response") } return result, nil } type DeleteInstanceInput struct { ID string } func (c *InstancesClient) Delete(ctx context.Context, input *DeleteInstanceInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if response == nil { return pkgerrors.Wrap(err, "unable to delete machine") } if response.Body != nil { defer response.Body.Close() } if response.StatusCode == http.StatusNotFound || response.StatusCode == http.StatusGone { return nil } if err != nil { return pkgerrors.Wrap(err, "unable to decode delete machine response") } return nil } type DeleteTagsInput struct { ID string } func (c *InstancesClient) DeleteTags(ctx context.Context, input *DeleteTagsInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "tags") reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return pkgerrors.Wrap(err, "unable to delete tags from machine") } if response == nil { return fmt.Errorf("DeleteTags request has empty response") } if response.Body != nil { defer response.Body.Close() } if response.StatusCode == http.StatusNotFound { return nil } return nil } type DeleteTagInput struct { ID string Key string } func (c *InstancesClient) DeleteTag(ctx context.Context, input *DeleteTagInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "tags", input.Key) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return pkgerrors.Wrap(err, "unable to delete tag from machine") } if response == nil { return fmt.Errorf("DeleteTag request has empty response") } if response.Body != nil { defer response.Body.Close() } if response.StatusCode == http.StatusNotFound { return nil } return nil } type RenameInstanceInput struct { ID string Name string } func (c *InstancesClient) Rename(ctx context.Context, input *RenameInstanceInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID) params := &url.Values{} params.Set("action", "rename") params.Set("name", input.Name) reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to rename machine") } return nil } type ReplaceTagsInput struct { ID string Tags map[string]string CNS InstanceCNS } // toAPI is used to join Tags and CNS tags into the same JSON object before // sending an API request to the API gateway. func (input ReplaceTagsInput) toAPI() map[string]interface{} { result := map[string]interface{}{} for key, value := range input.Tags { result[key] = value } input.CNS.toTags(result) return result } func (c *InstancesClient) ReplaceTags(ctx context.Context, input *ReplaceTagsInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "tags") reqInputs := client.RequestInput{ Method: http.MethodPut, Path: fullPath, Body: input.toAPI(), } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to replace machine tags") } return nil } type AddTagsInput struct { ID string Tags map[string]string } func (c *InstancesClient) AddTags(ctx context.Context, input *AddTagsInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "tags") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input.Tags, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to add tags to machine") } return nil } type GetTagInput struct { ID string Key string } func (c *InstancesClient) GetTag(ctx context.Context, input *GetTagInput) (string, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "tags", input.Key) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if err != nil { return "", pkgerrors.Wrap(err, "unable to get tag") } if respReader != nil { defer respReader.Close() } var result string decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return "", pkgerrors.Wrap(err, "unable to decode get tag response") } return result, nil } type ListTagsInput struct { ID string } func (c *InstancesClient) ListTags(ctx context.Context, input *ListTagsInput) (map[string]interface{}, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "tags") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, pkgerrors.Wrap(err, "unable to list machine tags") } var result map[string]interface{} decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable decode list machine tags response") } _, tags := TagsExtractMeta(result) return tags, nil } type GetMetadataInput struct { ID string Key string } // GetMetadata returns a single metadata entry associated with an instance. func (c *InstancesClient) GetMetadata(ctx context.Context, input *GetMetadataInput) (string, error) { if input.Key == "" { return "", fmt.Errorf("Missing metadata Key from input: %s", input.Key) } fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "metadata", input.Key) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return "", pkgerrors.Wrap(err, "unable to get machine metadata") } if response != nil { defer response.Body.Close() } if response.StatusCode == http.StatusNotFound || response.StatusCode == http.StatusGone { return "", &errors.APIError{ StatusCode: response.StatusCode, Code: "ResourceNotFound", } } body, err := ioutil.ReadAll(response.Body) if err != nil { return "", pkgerrors.Wrap(err, "unable to decode get machine metadata response") } return fmt.Sprintf("%s", body), nil } type ListMetadataInput struct { ID string Credentials bool } func (c *InstancesClient) ListMetadata(ctx context.Context, input *ListMetadataInput) (map[string]string, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "metadata") query := &url.Values{} if input.Credentials { query.Set("credentials", "true") } reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, Query: query, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, pkgerrors.Wrap(err, "unable to list machine metadata") } var result map[string]string decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode list machine metadata response") } return result, nil } type UpdateMetadataInput struct { ID string Metadata map[string]string } func (c *InstancesClient) UpdateMetadata(ctx context.Context, input *UpdateMetadataInput) (map[string]string, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "metadata") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input.Metadata, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, pkgerrors.Wrap(err, "unable to update machine metadata") } var result map[string]string decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode update machine metadata response") } return result, nil } type DeleteMetadataInput struct { ID string Key string } // DeleteMetadata deletes a single metadata key from an instance func (c *InstancesClient) DeleteMetadata(ctx context.Context, input *DeleteMetadataInput) error { if input.Key == "" { return fmt.Errorf("Missing metadata Key from input: %s", input.Key) } fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "metadata", input.Key) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if err != nil { return pkgerrors.Wrap(err, "unable to delete machine metadata") } if respReader != nil { defer respReader.Close() } return nil } type DeleteAllMetadataInput struct { ID string } // DeleteAllMetadata deletes all metadata keys from this instance func (c *InstancesClient) DeleteAllMetadata(ctx context.Context, input *DeleteAllMetadataInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID, "metadata") reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if err != nil { return pkgerrors.Wrap(err, "unable to delete all machine metadata") } if respReader != nil { defer respReader.Close() } return nil } type ResizeInstanceInput struct { ID string Package string } func (c *InstancesClient) Resize(ctx context.Context, input *ResizeInstanceInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID) params := &url.Values{} params.Set("action", "resize") params.Set("package", input.Package) reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to resize machine") } return nil } type EnableFirewallInput struct { ID string } func (c *InstancesClient) EnableFirewall(ctx context.Context, input *EnableFirewallInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID) params := &url.Values{} params.Set("action", "enable_firewall") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to enable machine firewall") } return nil } type DisableFirewallInput struct { ID string } func (c *InstancesClient) DisableFirewall(ctx context.Context, input *DisableFirewallInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.ID) params := &url.Values{} params.Set("action", "disable_firewall") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to disable machine firewall") } return nil } type ListNICsInput struct { InstanceID string } func (c *InstancesClient) ListNICs(ctx context.Context, input *ListNICsInput) ([]*NIC, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID, "nics") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, pkgerrors.Wrap(err, "unable to list machine NICs") } var result []*NIC decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode list machine NICs response") } return result, nil } type GetNICInput struct { InstanceID string MAC string } func (c *InstancesClient) GetNIC(ctx context.Context, input *GetNICInput) (*NIC, error) { mac := strings.Replace(input.MAC, ":", "", -1) fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID, "nics", mac) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return nil, pkgerrors.Wrap(err, "unable to get machine NIC") } if response != nil { defer response.Body.Close() } switch response.StatusCode { case http.StatusNotFound: return nil, &errors.APIError{ StatusCode: response.StatusCode, Code: "ResourceNotFound", } } var result *NIC decoder := json.NewDecoder(response.Body) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode get machine NIC response") } return result, nil } type AddNICInput struct { InstanceID string `json:"-"` Network string `json:"network"` } // AddNIC asynchronously adds a NIC to a given instance. If a NIC for a given // network already exists, a ResourceFound error will be returned. The status // of the addition of a NIC can be polled by calling GetNIC()'s and testing NIC // until its state is set to "running". Only one NIC per network may exist. // Warning: this operation causes the instance to restart. func (c *InstancesClient) AddNIC(ctx context.Context, input *AddNICInput) (*NIC, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID, "nics") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return nil, pkgerrors.Wrap(err, "unable to add NIC to machine") } if response != nil { defer response.Body.Close() } switch response.StatusCode { case http.StatusFound: return nil, &errors.APIError{ StatusCode: response.StatusCode, Code: "ResourceFound", Message: response.Header.Get("Location"), } } var result *NIC decoder := json.NewDecoder(response.Body) if err = decoder.Decode(&result); err != nil { return nil, pkgerrors.Wrap(err, "unable to decode add NIC to machine response") } return result, nil } type RemoveNICInput struct { InstanceID string MAC string } // RemoveNIC removes a given NIC from a machine asynchronously. The status of // the removal can be polled via GetNIC(). When GetNIC() returns a 404, the NIC // has been removed from the instance. Warning: this operation causes the // machine to restart. func (c *InstancesClient) RemoveNIC(ctx context.Context, input *RemoveNICInput) error { mac := strings.Replace(input.MAC, ":", "", -1) fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID, "nics", mac) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } response, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return pkgerrors.Wrap(err, "unable to remove NIC from machine") } if response == nil { return pkgerrors.Wrap(err, "unable to remove NIC from machine") } if response.Body != nil { defer response.Body.Close() } switch response.StatusCode { case http.StatusNotFound: return &errors.APIError{ StatusCode: response.StatusCode, Code: "ResourceNotFound", } } return nil } type StopInstanceInput struct { InstanceID string } func (c *InstancesClient) Stop(ctx context.Context, input *StopInstanceInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID) params := &url.Values{} params.Set("action", "stop") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to stop machine") } return nil } type StartInstanceInput struct { InstanceID string } func (c *InstancesClient) Start(ctx context.Context, input *StartInstanceInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID) params := &url.Values{} params.Set("action", "start") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to start machine") } return nil } type RebootInstanceInput struct { InstanceID string } func (c *InstancesClient) Reboot(ctx context.Context, input *RebootInstanceInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID) params := &url.Values{} params.Set("action", "reboot") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to reboot machine") } return nil } type EnableDeletionProtectionInput struct { InstanceID string } func (c *InstancesClient) EnableDeletionProtection(ctx context.Context, input *EnableDeletionProtectionInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID) params := &url.Values{} params.Set("action", "enable_deletion_protection") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to enable deletion protection") } return nil } type DisableDeletionProtectionInput struct { InstanceID string } func (c *InstancesClient) DisableDeletionProtection(ctx context.Context, input *DisableDeletionProtectionInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.InstanceID) params := &url.Values{} params.Set("action", "disable_deletion_protection") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Query: params, } respReader, err := c.client.ExecuteRequestURIParams(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return pkgerrors.Wrap(err, "unable to disable deletion protection") } return nil } var reservedInstanceCNSTags = map[string]struct{}{ CNSTagDisable: {}, CNSTagReversePTR: {}, CNSTagServices: {}, } // TagsExtractMeta extracts all of the misc parameters from Tags and returns a // clean CNS and Tags struct. func TagsExtractMeta(tags map[string]interface{}) (InstanceCNS, map[string]interface{}) { nativeCNS := InstanceCNS{} nativeTags := make(map[string]interface{}, len(tags)) for k, raw := range tags { if _, found := reservedInstanceCNSTags[k]; found { switch k { case CNSTagDisable: b := raw.(bool) nativeCNS.Disable = b case CNSTagReversePTR: s := raw.(string) nativeCNS.ReversePTR = s case CNSTagServices: nativeCNS.Services = strings.Split(raw.(string), ",") default: // TODO(seanc@): should assert, logic fail } } else { nativeTags[k] = raw } } return nativeCNS, nativeTags } // toNative() exports a given _Instance (API representation) to its native object // format. func (api *_Instance) toNative() (*Instance, error) { m := Instance(api.Instance) m.CNS, m.Tags = TagsExtractMeta(api.Tags) return &m, nil } // toTags() injects its state information into a Tags map suitable for use to // submit an API call to the vmapi machine endpoint func (cns *InstanceCNS) toTags(m map[string]interface{}) { if cns.Disable { // NOTE(justinwr): The JSON encoder and API require the CNSTagDisable // attribute to be an actual boolean, not a bool string. m[CNSTagDisable] = cns.Disable } if cns.ReversePTR != "" { m[CNSTagReversePTR] = cns.ReversePTR } if len(cns.Services) > 0 { m[CNSTagServices] = strings.Join(cns.Services, ",") } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/packages.go�����������������������������0000664�0000000�0000000�00000006103�13771713062�0026032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "encoding/json" "fmt" "net/http" "net/url" "path" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type PackagesClient struct { client *client.Client } type Package struct { ID string `json:"id"` Name string `json:"name"` Memory int64 `json:"memory"` Disk int64 `json:"disk"` Swap int64 `json:"swap"` LWPs int64 `json:"lwps"` VCPUs int64 `json:"vcpus"` Version string `json:"version"` Group string `json:"group"` Description string `json:"description"` Default bool `json:"default"` } type ListPackagesInput struct { Name string `json:"name"` Memory int64 `json:"memory"` Disk int64 `json:"disk"` Swap int64 `json:"swap"` LWPs int64 `json:"lwps"` VCPUs int64 `json:"vcpus"` Version string `json:"version"` Group string `json:"group"` } func (c *PackagesClient) List(ctx context.Context, input *ListPackagesInput) ([]*Package, error) { fullPath := path.Join("/", c.client.AccountName, "packages") query := &url.Values{} if input.Name != "" { query.Set("name", input.Name) } if input.Memory != 0 { query.Set("memory", fmt.Sprintf("%d", input.Memory)) } if input.Disk != 0 { query.Set("disk", fmt.Sprintf("%d", input.Disk)) } if input.Swap != 0 { query.Set("swap", fmt.Sprintf("%d", input.Swap)) } if input.LWPs != 0 { query.Set("lwps", fmt.Sprintf("%d", input.LWPs)) } if input.VCPUs != 0 { query.Set("vcpus", fmt.Sprintf("%d", input.VCPUs)) } if input.Version != "" { query.Set("version", input.Version) } if input.Group != "" { query.Set("group", input.Group) } reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, Query: query, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list packages") } var result []*Package decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list packages response") } return result, nil } type GetPackageInput struct { ID string } func (c *PackagesClient) Get(ctx context.Context, input *GetPackageInput) (*Package, error) { fullPath := path.Join("/", c.client.AccountName, "packages", input.ID) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to get package") } var result *Package decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get package response") } return result, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/ping.go���������������������������������0000664�0000000�0000000�00000002621�13771713062�0025212�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "encoding/json" "net/http" "github.com/joyent/triton-go/client" pkgerrors "github.com/pkg/errors" ) const pingEndpoint = "/--ping" type CloudAPI struct { Versions []string `json:"versions"` } type PingOutput struct { Ping string `json:"ping"` CloudAPI CloudAPI `json:"cloudapi"` } // Ping sends a request to the '/--ping' endpoint and returns a `pong` as well // as a list of API version numbers your instance of CloudAPI is presenting. func (c *ComputeClient) Ping(ctx context.Context) (*PingOutput, error) { reqInputs := client.RequestInput{ Method: http.MethodGet, Path: pingEndpoint, } response, err := c.Client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return nil, pkgerrors.Wrap(err, "unable to ping") } if response == nil { return nil, pkgerrors.Wrap(err, "unable to ping") } if response.Body != nil { defer response.Body.Close() } var result *PingOutput decoder := json.NewDecoder(response.Body) if err = decoder.Decode(&result); err != nil { if err != nil { return nil, pkgerrors.Wrap(err, "unable to decode ping response") } } return result, nil } ���������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/services.go�����������������������������0000664�0000000�0000000�00000002765�13771713062�0026111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "encoding/json" "net/http" "path" "sort" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type ServicesClient struct { client *client.Client } type Service struct { Name string Endpoint string } type ListServicesInput struct{} func (c *ServicesClient) List(ctx context.Context, _ *ListServicesInput) ([]*Service, error) { fullPath := path.Join("/", c.client.AccountName, "services") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list services") } var intermediate map[string]string decoder := json.NewDecoder(respReader) if err = decoder.Decode(&intermediate); err != nil { return nil, errors.Wrap(err, "unable to decode list services response") } keys := make([]string, len(intermediate)) i := 0 for k := range intermediate { keys[i] = k i++ } sort.Strings(keys) result := make([]*Service, len(intermediate)) i = 0 for _, key := range keys { result[i] = &Service{ Name: key, Endpoint: intermediate[key], } i++ } return result, nil } �����������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/snapshots.go����������������������������0000664�0000000�0000000�00000007723�13771713062�0026307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "encoding/json" "net/http" "path" "time" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type SnapshotsClient struct { client *client.Client } type Snapshot struct { Name string State string Created time.Time Updated time.Time } type ListSnapshotsInput struct { MachineID string } func (c *SnapshotsClient) List(ctx context.Context, input *ListSnapshotsInput) ([]*Snapshot, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.MachineID, "snapshots") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list snapshots") } var result []*Snapshot decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list snapshots response") } return result, nil } type GetSnapshotInput struct { MachineID string Name string } func (c *SnapshotsClient) Get(ctx context.Context, input *GetSnapshotInput) (*Snapshot, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.MachineID, "snapshots", input.Name) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to get snapshot") } var result *Snapshot decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get snapshot response") } return result, nil } type DeleteSnapshotInput struct { MachineID string Name string } func (c *SnapshotsClient) Delete(ctx context.Context, input *DeleteSnapshotInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.MachineID, "snapshots", input.Name) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return errors.Wrap(err, "unable to delete snapshot") } return nil } type StartMachineFromSnapshotInput struct { MachineID string Name string } func (c *SnapshotsClient) StartMachine(ctx context.Context, input *StartMachineFromSnapshotInput) error { fullPath := path.Join("/", c.client.AccountName, "machines", input.MachineID, "snapshots", input.Name) reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return errors.Wrap(err, "unable to start machine") } return nil } type CreateSnapshotInput struct { MachineID string Name string } func (c *SnapshotsClient) Create(ctx context.Context, input *CreateSnapshotInput) (*Snapshot, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.MachineID, "snapshots") data := make(map[string]interface{}) data["name"] = input.Name reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: data, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to create snapshot") } var result *Snapshot decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode create snapshot response") } return result, nil } ���������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/compute/volumes.go������������������������������0000664�0000000�0000000�00000011471�13771713062�0025752�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package compute import ( "context" "encoding/json" "net/http" "net/url" "path" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type VolumesClient struct { client *client.Client } type Volume struct { ID string `json:"id"` Name string `json:"name"` Owner string `json:"owner_uuid"` Type string `json:"type"` FileSystemPath string `json:"filesystem_path"` Size int64 `json:"size"` State string `json:"state"` Networks []string `json:"networks"` Refs []string `json:"refs"` } type ListVolumesInput struct { Name string Size string State string Type string } func (c *VolumesClient) List(ctx context.Context, input *ListVolumesInput) ([]*Volume, error) { fullPath := path.Join("/", c.client.AccountName, "volumes") query := &url.Values{} if input.Name != "" { query.Set("name", input.Name) } if input.Size != "" { query.Set("size", input.Size) } if input.State != "" { query.Set("state", input.State) } if input.Type != "" { query.Set("type", input.Type) } reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, Query: query, } resp, err := c.client.ExecuteRequest(ctx, reqInputs) if resp != nil { defer resp.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list volumes") } var result []*Volume decoder := json.NewDecoder(resp) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list volumes response") } return result, nil } type CreateVolumeInput struct { Name string Size int64 Networks []string Type string } func (input *CreateVolumeInput) toAPI() map[string]interface{} { result := make(map[string]interface{}, 0) if input.Name != "" { result["name"] = input.Name } if input.Size != 0 { result["size"] = input.Size } if input.Type != "" { result["type"] = input.Type } if len(input.Networks) > 0 { result["networks"] = input.Networks } return result } func (c *VolumesClient) Create(ctx context.Context, input *CreateVolumeInput) (*Volume, error) { fullPath := path.Join("/", c.client.AccountName, "volumes") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input.toAPI(), } resp, err := c.client.ExecuteRequest(ctx, reqInputs) if err != nil { return nil, errors.Wrap(err, "unable to create volume") } if resp != nil { defer resp.Close() } var result *Volume decoder := json.NewDecoder(resp) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode create volume response") } return result, nil } type DeleteVolumeInput struct { ID string } func (c *VolumesClient) Delete(ctx context.Context, input *DeleteVolumeInput) error { fullPath := path.Join("/", c.client.AccountName, "volumes", input.ID) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } resp, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return errors.Wrap(err, "unable to delete volume") } if resp == nil { return errors.Wrap(err, "unable to delete volume") } if resp.Body != nil { defer resp.Body.Close() } if resp.StatusCode == http.StatusNotFound || resp.StatusCode == http.StatusGone { return nil } return nil } type GetVolumeInput struct { ID string } func (c *VolumesClient) Get(ctx context.Context, input *GetVolumeInput) (*Volume, error) { fullPath := path.Join("/", c.client.AccountName, "volumes", input.ID) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } resp, err := c.client.ExecuteRequestRaw(ctx, reqInputs) if err != nil { return nil, errors.Wrap(err, "unable to get volume") } if resp == nil { return nil, errors.Wrap(err, "unable to get volume") } if resp.Body != nil { defer resp.Body.Close() } var result *Volume decoder := json.NewDecoder(resp.Body) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get volume volume") } return result, nil } type UpdateVolumeInput struct { ID string `json:"-"` Name string `json:"name"` } func (c *VolumesClient) Update(ctx context.Context, input *UpdateVolumeInput) error { fullPath := path.Join("/", c.client.AccountName, "volumes", input.ID) reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } resp, err := c.client.ExecuteRequest(ctx, reqInputs) if err != nil { return errors.Wrap(err, "unable to update volume") } if resp != nil { defer resp.Close() } return nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/errors/�����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023565�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/errors/errors.go��������������������������������0000664�0000000�0000000�00000016053�13771713062�0025435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package errors import ( "fmt" "net/http" "strings" "github.com/pkg/errors" ) // APIError represents an error code and message along with // the status code of the HTTP request which resulted in the error // message. Error codes used by the Triton API are listed at // https://apidocs.joyent.com/cloudapi/#cloudapi-http-responses // Error codes used by the Manta API are listed at // https://apidocs.joyent.com/manta/api.html#errors type APIError struct { StatusCode int Code string `json:"code"` Message string `json:"message"` } // Error implements interface Error on the APIError type. func (e APIError) Error() string { return strings.Trim(fmt.Sprintf("%+q", e.Code), `"`) + ": " + strings.Trim(fmt.Sprintf("%+q", e.Message), `"`) } // ClientError represents an error code and message returned // when connecting to the triton-go client type ClientError struct { StatusCode int Code string `json:"code"` Message string `json:"message"` } // Error implements interface Error on the ClientError type. func (e ClientError) Error() string { return strings.Trim(fmt.Sprintf("%+q", e.Code), `"`) + ": " + strings.Trim(fmt.Sprintf("%+q", e.Message), `"`) } func IsAuthSchemeError(err error) bool { return IsSpecificError(err, "AuthScheme") } func IsAuthorizationError(err error) bool { return IsSpecificError(err, "Authorization") } func IsBadRequestError(err error) bool { return IsSpecificError(err, "BadRequest") } func IsChecksumError(err error) bool { return IsSpecificError(err, "Checksum") } func IsConcurrentRequestError(err error) bool { return IsSpecificError(err, "ConcurrentRequest") } func IsContentLengthError(err error) bool { return IsSpecificError(err, "ContentLength") } func IsContentMD5MismatchError(err error) bool { return IsSpecificError(err, "ContentMD5Mismatch") } func IsEntityExistsError(err error) bool { return IsSpecificError(err, "EntityExists") } func IsInvalidArgumentError(err error) bool { return IsSpecificError(err, "InvalidArgument") } func IsInvalidAuthTokenError(err error) bool { return IsSpecificError(err, "InvalidAuthToken") } func IsInvalidCredentialsError(err error) bool { return IsSpecificError(err, "InvalidCredentials") } func IsInvalidDurabilityLevelError(err error) bool { return IsSpecificError(err, "InvalidDurabilityLevel") } func IsInvalidKeyIdError(err error) bool { return IsSpecificError(err, "InvalidKeyId") } func IsInvalidJobError(err error) bool { return IsSpecificError(err, "InvalidJob") } func IsInvalidLinkError(err error) bool { return IsSpecificError(err, "InvalidLink") } func IsInvalidLimitError(err error) bool { return IsSpecificError(err, "InvalidLimit") } func IsInvalidSignatureError(err error) bool { return IsSpecificError(err, "InvalidSignature") } func IsInvalidUpdateError(err error) bool { return IsSpecificError(err, "InvalidUpdate") } func IsDirectoryDoesNotExistError(err error) bool { return IsSpecificError(err, "DirectoryDoesNotExist") } func IsDirectoryExistsError(err error) bool { return IsSpecificError(err, "DirectoryExists") } func IsDirectoryNotEmptyError(err error) bool { return IsSpecificError(err, "DirectoryNotEmpty") } func IsDirectoryOperationError(err error) bool { return IsSpecificError(err, "DirectoryOperation") } func IsInternalError(err error) bool { return IsSpecificError(err, "Internal") } func IsJobNotFoundError(err error) bool { return IsSpecificError(err, "JobNotFound") } func IsJobStateError(err error) bool { return IsSpecificError(err, "JobState") } func IsKeyDoesNotExistError(err error) bool { return IsSpecificError(err, "KeyDoesNotExist") } func IsNotAcceptableError(err error) bool { return IsSpecificError(err, "NotAcceptable") } func IsNotEnoughSpaceError(err error) bool { return IsSpecificError(err, "NotEnoughSpace") } func IsLinkNotFoundError(err error) bool { return IsSpecificError(err, "LinkNotFound") } func IsLinkNotObjectError(err error) bool { return IsSpecificError(err, "LinkNotObject") } func IsLinkRequiredError(err error) bool { return IsSpecificError(err, "LinkRequired") } func IsParentNotDirectoryError(err error) bool { return IsSpecificError(err, "ParentNotDirectory") } func IsPreconditionFailedError(err error) bool { return IsSpecificError(err, "PreconditionFailed") } func IsPreSignedRequestError(err error) bool { return IsSpecificError(err, "PreSignedRequest") } func IsRequestEntityTooLargeError(err error) bool { return IsSpecificError(err, "RequestEntityTooLarge") } func IsResourceNotFoundError(err error) bool { return IsSpecificError(err, "ResourceNotFound") } func IsRootDirectoryError(err error) bool { return IsSpecificError(err, "RootDirectory") } func IsServiceUnavailableError(err error) bool { return IsSpecificError(err, "ServiceUnavailable") } func IsSSLRequiredError(err error) bool { return IsSpecificError(err, "SSLRequired") } func IsUploadTimeoutError(err error) bool { return IsSpecificError(err, "UploadTimeout") } func IsUserDoesNotExistError(err error) bool { return IsSpecificError(err, "UserDoesNotExist") } func IsBadRequest(err error) bool { return IsSpecificError(err, "BadRequest") } func IsInUseError(err error) bool { return IsSpecificError(err, "InUseError") } func IsInvalidArgument(err error) bool { return IsSpecificError(err, "InvalidArgument") } func IsInvalidCredentials(err error) bool { return IsSpecificError(err, "InvalidCredentials") } func IsInvalidHeader(err error) bool { return IsSpecificError(err, "InvalidHeader") } func IsInvalidVersion(err error) bool { return IsSpecificError(err, "InvalidVersion") } func IsMissingParameter(err error) bool { return IsSpecificError(err, "MissingParameter") } func IsNotAuthorized(err error) bool { return IsSpecificError(err, "NotAuthorized") } func IsRequestThrottled(err error) bool { return IsSpecificError(err, "RequestThrottled") } func IsRequestTooLarge(err error) bool { return IsSpecificError(err, "RequestTooLarge") } func IsRequestMoved(err error) bool { return IsSpecificError(err, "RequestMoved") } func IsResourceFound(err error) bool { return IsSpecificError(err, "ResourceFound") } func IsResourceNotFound(err error) bool { return IsSpecificError(err, "ResourceNotFound") } func IsUnknownError(err error) bool { return IsSpecificError(err, "UnknownError") } func IsEmptyResponse(err error) bool { return IsSpecificError(err, "EmptyResponse") } func IsStatusNotFoundCode(err error) bool { return IsSpecificStatusCode(err, http.StatusNotFound) } func IsSpecificError(myError error, errorCode string) bool { switch err := errors.Cause(myError).(type) { case *APIError: if err.Code == errorCode { return true } } return false } func IsSpecificStatusCode(myError error, statusCode int) bool { switch err := errors.Cause(myError).(type) { case *APIError: if err.StatusCode == statusCode { return true } } return false } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/network/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023742�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/network/client.go�������������������������������0000664�0000000�0000000�00000003135�13771713062�0025551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package network import ( "net/http" triton "github.com/joyent/triton-go" "github.com/joyent/triton-go/client" ) type NetworkClient struct { Client *client.Client } func newNetworkClient(client *client.Client) *NetworkClient { return &NetworkClient{ Client: client, } } // NewClient returns a new client for working with Network endpoints and // resources within CloudAPI func NewClient(config *triton.ClientConfig) (*NetworkClient, error) { // TODO: Utilize config interface within the function itself client, err := client.New( config.TritonURL, config.MantaURL, config.AccountName, config.Signers..., ) if err != nil { return nil, err } return newNetworkClient(client), nil } // SetHeaders allows a consumer of the current client to set custom headers for // the next backend HTTP request sent to CloudAPI func (c *NetworkClient) SetHeader(header *http.Header) { c.Client.RequestHeader = header } // Fabrics returns a FabricsClient used for accessing functions pertaining to // Fabric functionality in the Triton API. func (c *NetworkClient) Fabrics() *FabricsClient { return &FabricsClient{c.Client} } // Firewall returns a FirewallClient client used for accessing functions // pertaining to firewall functionality in the Triton API. func (c *NetworkClient) Firewall() *FirewallClient { return &FirewallClient{c.Client} } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/network/fabrics.go������������������������������0000664�0000000�0000000�00000017224�13771713062�0025710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package network import ( "context" "encoding/json" "net/http" "path" "strconv" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type FabricsClient struct { client *client.Client } type FabricVLAN struct { Name string `json:"name"` ID int `json:"vlan_id"` Description string `json:"description"` } type ListVLANsInput struct{} func (c *FabricsClient) ListVLANs(ctx context.Context, _ *ListVLANsInput) ([]*FabricVLAN, error) { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list VLANs") } var result []*FabricVLAN decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list VLANs response") } return result, nil } type CreateVLANInput struct { Name string `json:"name"` ID int `json:"vlan_id"` Description string `json:"description,omitempty"` } func (c *FabricsClient) CreateVLAN(ctx context.Context, input *CreateVLANInput) (*FabricVLAN, error) { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to create VLAN") } var result *FabricVLAN decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode create VLAN response") } return result, nil } type UpdateVLANInput struct { ID int `json:"-"` Name string `json:"name"` Description string `json:"description"` } func (c *FabricsClient) UpdateVLAN(ctx context.Context, input *UpdateVLANInput) (*FabricVLAN, error) { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans", strconv.Itoa(input.ID)) reqInputs := client.RequestInput{ Method: http.MethodPut, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to update VLAN") } var result *FabricVLAN decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode update VLAN response") } return result, nil } type GetVLANInput struct { ID int `json:"-"` } func (c *FabricsClient) GetVLAN(ctx context.Context, input *GetVLANInput) (*FabricVLAN, error) { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans", strconv.Itoa(input.ID)) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to get VLAN") } var result *FabricVLAN decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get VLAN response") } return result, nil } type DeleteVLANInput struct { ID int `json:"-"` } func (c *FabricsClient) DeleteVLAN(ctx context.Context, input *DeleteVLANInput) error { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans", strconv.Itoa(input.ID)) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return errors.Wrap(err, "unable to delete VLAN") } return nil } type ListFabricsInput struct { FabricVLANID int `json:"-"` } func (c *FabricsClient) List(ctx context.Context, input *ListFabricsInput) ([]*Network, error) { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans", strconv.Itoa(input.FabricVLANID), "networks") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list fabrics") } var result []*Network decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list fabrics response") } return result, nil } type CreateFabricInput struct { FabricVLANID int `json:"-"` Name string `json:"name"` Description string `json:"description,omitempty"` Subnet string `json:"subnet"` ProvisionStartIP string `json:"provision_start_ip"` ProvisionEndIP string `json:"provision_end_ip"` Gateway string `json:"gateway,omitempty"` Resolvers []string `json:"resolvers,omitempty"` Routes map[string]string `json:"routes,omitempty"` InternetNAT bool `json:"internet_nat"` } func (c *FabricsClient) Create(ctx context.Context, input *CreateFabricInput) (*Network, error) { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans", strconv.Itoa(input.FabricVLANID), "networks") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to create fabric") } var result *Network decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode create fabric response") } return result, nil } type GetFabricInput struct { FabricVLANID int `json:"-"` NetworkID string `json:"-"` } func (c *FabricsClient) Get(ctx context.Context, input *GetFabricInput) (*Network, error) { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans", strconv.Itoa(input.FabricVLANID), "networks", input.NetworkID) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to get fabric") } var result *Network decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get fabric response") } return result, nil } type DeleteFabricInput struct { FabricVLANID int `json:"-"` NetworkID string `json:"-"` } func (c *FabricsClient) Delete(ctx context.Context, input *DeleteFabricInput) error { fullPath := path.Join("/", c.client.AccountName, "fabrics", "default", "vlans", strconv.Itoa(input.FabricVLANID), "networks", input.NetworkID) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return errors.Wrap(err, "unable to delete fabric") } return nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/network/firewall.go�����������������������������0000664�0000000�0000000�00000021117�13771713062�0026100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package network import ( "context" "encoding/json" "net/http" "path" "time" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type FirewallClient struct { client *client.Client } // FirewallRule represents a firewall rule type FirewallRule struct { // ID is a unique identifier for this rule ID string `json:"id"` // Enabled indicates if the rule is enabled Enabled bool `json:"enabled"` // Rule is the firewall rule text Rule string `json:"rule"` // Global indicates if the rule is global. Optional. Global bool `json:"global"` // Description is a human-readable description for the rule. Optional Description string `json:"description"` } type ListRulesInput struct{} func (c *FirewallClient) ListRules(ctx context.Context, _ *ListRulesInput) ([]*FirewallRule, error) { fullPath := path.Join("/", c.client.AccountName, "fwrules") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list firewall rules") } var result []*FirewallRule decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list firewall rules response") } return result, nil } type GetRuleInput struct { ID string } func (c *FirewallClient) GetRule(ctx context.Context, input *GetRuleInput) (*FirewallRule, error) { fullPath := path.Join("/", c.client.AccountName, "fwrules", input.ID) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to get firewall rule") } var result *FirewallRule decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get firewall rule response") } return result, nil } type CreateRuleInput struct { Enabled bool `json:"enabled"` Rule string `json:"rule"` Description string `json:"description,omitempty"` } func (c *FirewallClient) CreateRule(ctx context.Context, input *CreateRuleInput) (*FirewallRule, error) { fullPath := path.Join("/", c.client.AccountName, "fwrules") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to create firewall rule") } var result *FirewallRule decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode create firewall rule response") } return result, nil } type UpdateRuleInput struct { ID string `json:"-"` Enabled bool `json:"enabled"` Rule string `json:"rule"` Description string `json:"description,omitempty"` } func (c *FirewallClient) UpdateRule(ctx context.Context, input *UpdateRuleInput) (*FirewallRule, error) { fullPath := path.Join("/", c.client.AccountName, "fwrules", input.ID) reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to update firewall rule") } var result *FirewallRule decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode update firewall rule response") } return result, nil } type EnableRuleInput struct { ID string `json:"-"` } func (c *FirewallClient) EnableRule(ctx context.Context, input *EnableRuleInput) (*FirewallRule, error) { fullPath := path.Join("/", c.client.AccountName, "fwrules", input.ID, "enable") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to enable firewall rule") } var result *FirewallRule decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode enable firewall rule response") } return result, nil } type DisableRuleInput struct { ID string `json:"-"` } func (c *FirewallClient) DisableRule(ctx context.Context, input *DisableRuleInput) (*FirewallRule, error) { fullPath := path.Join("/", c.client.AccountName, "fwrules", input.ID, "disable") reqInputs := client.RequestInput{ Method: http.MethodPost, Path: fullPath, Body: input, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to disable firewall rule") } var result *FirewallRule decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode disable firewall rule response") } return result, nil } type DeleteRuleInput struct { ID string } func (c *FirewallClient) DeleteRule(ctx context.Context, input *DeleteRuleInput) error { fullPath := path.Join("/", c.client.AccountName, "fwrules", input.ID) reqInputs := client.RequestInput{ Method: http.MethodDelete, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return errors.Wrap(err, "unable to delete firewall rule") } return nil } type ListMachineRulesInput struct { MachineID string } func (c *FirewallClient) ListMachineRules(ctx context.Context, input *ListMachineRulesInput) ([]*FirewallRule, error) { fullPath := path.Join("/", c.client.AccountName, "machines", input.MachineID, "fwrules") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list machine firewall rules") } var result []*FirewallRule decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list machine firewall rules response") } return result, nil } type ListRuleMachinesInput struct { ID string } type Machine struct { ID string `json:"id"` Name string `json:"name"` Type string `json:"type"` Brand string `json:"brand"` State string `json:"state"` Image string `json:"image"` Memory int `json:"memory"` Disk int `json:"disk"` Metadata map[string]string `json:"metadata"` Tags map[string]interface{} `json:"tags"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` Docker bool `json:"docker"` IPs []string `json:"ips"` Networks []string `json:"networks"` PrimaryIP string `json:"primaryIp"` FirewallEnabled bool `json:"firewall_enabled"` ComputeNode string `json:"compute_node"` Package string `json:"package"` } func (c *FirewallClient) ListRuleMachines(ctx context.Context, input *ListRuleMachinesInput) ([]*Machine, error) { fullPath := path.Join("/", c.client.AccountName, "fwrules", input.ID, "machines") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list firewall rule machines") } var result []*Machine decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list firewall rule machines response") } return result, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/network/network.go������������������������������0000664�0000000�0000000�00000004641�13771713062�0025767�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package network import ( "context" "encoding/json" "net/http" "path" "github.com/joyent/triton-go/client" "github.com/pkg/errors" ) type Network struct { Id string `json:"id"` Name string `json:"name"` Public bool `json:"public"` Fabric bool `json:"fabric"` Description string `json:"description"` Subnet string `json:"subnet"` ProvisioningStartIP string `json:"provision_start_ip"` ProvisioningEndIP string `json:"provision_end_ip"` Gateway string `json:"gateway"` Resolvers []string `json:"resolvers"` Routes map[string]string `json:"routes"` InternetNAT bool `json:"internet_nat"` } type ListInput struct{} func (c *NetworkClient) List(ctx context.Context, _ *ListInput) ([]*Network, error) { fullPath := path.Join("/", c.Client.AccountName, "networks") reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.Client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to list networks") } var result []*Network decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode list networks response") } return result, nil } type GetInput struct { ID string } func (c *NetworkClient) Get(ctx context.Context, input *GetInput) (*Network, error) { fullPath := path.Join("/", c.Client.AccountName, "networks", input.ID) reqInputs := client.RequestInput{ Method: http.MethodGet, Path: fullPath, } respReader, err := c.Client.ExecuteRequest(ctx, reqInputs) if respReader != nil { defer respReader.Close() } if err != nil { return nil, errors.Wrap(err, "unable to get network") } var result *Network decoder := json.NewDecoder(respReader) if err = decoder.Decode(&result); err != nil { return nil, errors.Wrap(err, "unable to decode get network response") } return result, nil } �����������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/triton.go���������������������������������������0000664�0000000�0000000�00000002533�13771713062�0024122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package triton import ( "os" "github.com/joyent/triton-go/authentication" ) // Universal package used for defining configuration used across all client // constructors. // ClientConfig is a placeholder/input struct around the behavior of configuring // a client constructor through the implementation's runtime environment // (SDC/MANTA env vars). type ClientConfig struct { TritonURL string MantaURL string AccountName string Username string Signers []authentication.Signer } var envPrefixes = []string{"TRITON", "SDC"} // GetEnv looks up environment variables using the preferred "TRITON" prefix, // but falls back to the retired "SDC" prefix. For example, looking up "USER" // will search for "TRITON_USER" followed by "SDC_USER". If the environment // variable is not set, an empty string is returned. GetEnv() is used to aid in // the transition and deprecation of the "SDC_*" environment variables. func GetEnv(name string) string { for _, prefix := range envPrefixes { if val, found := os.LookupEnv(prefix + "_" + name); found { return val } } return "" } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/joyent/triton-go/version.go��������������������������������������0000664�0000000�0000000�00000002446�13771713062�0024273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// // Copyright (c) 2018, Joyent, Inc. All rights reserved. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. // package triton import ( "fmt" "runtime" ) // Version represents main version number of the current release // of the Triton-go SDK. const Version = "1.4.0" // Prerelease adds a pre-release marker to the version. // // If this is "" (empty string) then it means that it is a final release. // Otherwise, this is a pre-release such as "dev" (in development), "beta", // "rc1", etc. var Prerelease = "dev" // UserAgent returns a Triton-go characteristic string that allows the // network protocol peers to identify the version, release and runtime // of the Triton-go client from which the requests originate. func UserAgent() string { if Prerelease != "" { return fmt.Sprintf("triton-go/%s-%s (%s-%s; %s)", Version, Prerelease, runtime.GOARCH, runtime.GOOS, runtime.Version()) } return fmt.Sprintf("triton-go/%s (%s-%s; %s)", Version, runtime.GOARCH, runtime.GOOS, runtime.Version()) } // CloudAPIMajorVersion specifies the CloudAPI version compatibility // for current release of the Triton-go SDK. const CloudAPIMajorVersion = "8" ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/����������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020264�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/�����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022220�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/LICENSE.txt������������������������������������0000664�0000000�0000000�00000031647�13771713062�0024056�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.  ____________________________ The Universal Permissive License (UPL), Version 1.0 Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both (a) the Software, and (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if one is included with the Software (each a "Larger Work" to which the Software is contributed by such licensors), without restriction, including without limitation the rights to copy, create derivative works of, display, perform, and distribute the Software and make, use, sell, offer for sale, import, export, have made, and have sold the Software and the Larger Work(s), and to sublicense the foregoing rights on either these or other terms. This license is subject to the following condition: The above copyright notice and either this complete permission notice or at a minimum a reference to the UPL must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The Apache Software License, Version 2.0 Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. �����������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023510�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/�����������������������������������0000775�0000000�0000000�00000000000�13771713062�0024451�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/certificate_retriever.go�����������0000664�0000000�0000000�00000015325�13771713062�0031357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth import ( "bytes" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "github.com/oracle/oci-go-sdk/common" "sync" ) // x509CertificateRetriever provides an X509 certificate with the RSA private key type x509CertificateRetriever interface { Refresh() error CertificatePemRaw() []byte Certificate() *x509.Certificate PrivateKeyPemRaw() []byte PrivateKey() *rsa.PrivateKey } // urlBasedX509CertificateRetriever retrieves PEM-encoded X509 certificates from the given URLs. type urlBasedX509CertificateRetriever struct { certURL string privateKeyURL string passphrase string certificatePemRaw []byte certificate *x509.Certificate privateKeyPemRaw []byte privateKey *rsa.PrivateKey mux sync.Mutex dispatcher common.HTTPRequestDispatcher } func newURLBasedX509CertificateRetriever(dispatcher common.HTTPRequestDispatcher, certURL, privateKeyURL, passphrase string) x509CertificateRetriever { return &urlBasedX509CertificateRetriever{ certURL: certURL, privateKeyURL: privateKeyURL, passphrase: passphrase, mux: sync.Mutex{}, dispatcher: dispatcher, } } // Refresh() is failure atomic, i.e., CertificatePemRaw(), Certificate(), PrivateKeyPemRaw(), and PrivateKey() would // return their previous values if Refresh() fails. func (r *urlBasedX509CertificateRetriever) Refresh() error { common.Debugln("Refreshing certificate") r.mux.Lock() defer r.mux.Unlock() var err error var certificatePemRaw []byte var certificate *x509.Certificate if certificatePemRaw, certificate, err = r.renewCertificate(r.certURL); err != nil { return fmt.Errorf("failed to renew certificate: %s", err.Error()) } var privateKeyPemRaw []byte var privateKey *rsa.PrivateKey if r.privateKeyURL != "" { if privateKeyPemRaw, privateKey, err = r.renewPrivateKey(r.privateKeyURL, r.passphrase); err != nil { return fmt.Errorf("failed to renew private key: %s", err.Error()) } } r.certificatePemRaw = certificatePemRaw r.certificate = certificate r.privateKeyPemRaw = privateKeyPemRaw r.privateKey = privateKey return nil } func (r *urlBasedX509CertificateRetriever) renewCertificate(url string) (certificatePemRaw []byte, certificate *x509.Certificate, err error) { var body bytes.Buffer if body, _, err = httpGet(r.dispatcher, url); err != nil { return nil, nil, fmt.Errorf("failed to get certificate from %s: %s", url, err.Error()) } certificatePemRaw = body.Bytes() var block *pem.Block block, _ = pem.Decode(certificatePemRaw) if block == nil { return nil, nil, fmt.Errorf("failed to parse the new certificate, not valid pem data") } if certificate, err = x509.ParseCertificate(block.Bytes); err != nil { return nil, nil, fmt.Errorf("failed to parse the new certificate: %s", err.Error()) } return certificatePemRaw, certificate, nil } func (r *urlBasedX509CertificateRetriever) renewPrivateKey(url, passphrase string) (privateKeyPemRaw []byte, privateKey *rsa.PrivateKey, err error) { var body bytes.Buffer if body, _, err = httpGet(r.dispatcher, url); err != nil { return nil, nil, fmt.Errorf("failed to get private key from %s: %s", url, err.Error()) } privateKeyPemRaw = body.Bytes() if privateKey, err = common.PrivateKeyFromBytes(privateKeyPemRaw, &passphrase); err != nil { return nil, nil, fmt.Errorf("failed to parse the new private key: %s", err.Error()) } return privateKeyPemRaw, privateKey, nil } func (r *urlBasedX509CertificateRetriever) CertificatePemRaw() []byte { r.mux.Lock() defer r.mux.Unlock() if r.certificatePemRaw == nil { return nil } c := make([]byte, len(r.certificatePemRaw)) copy(c, r.certificatePemRaw) return c } func (r *urlBasedX509CertificateRetriever) Certificate() *x509.Certificate { r.mux.Lock() defer r.mux.Unlock() if r.certificate == nil { return nil } c := *r.certificate return &c } func (r *urlBasedX509CertificateRetriever) PrivateKeyPemRaw() []byte { r.mux.Lock() defer r.mux.Unlock() if r.privateKeyPemRaw == nil { return nil } c := make([]byte, len(r.privateKeyPemRaw)) copy(c, r.privateKeyPemRaw) return c } func (r *urlBasedX509CertificateRetriever) PrivateKey() *rsa.PrivateKey { r.mux.Lock() defer r.mux.Unlock() //Nil Private keys are supported as part of a certificate if r.privateKey == nil { return nil } c := *r.privateKey return &c } //staticCertificateRetriever serves certificates from static data type staticCertificateRetriever struct { Passphrase []byte CertificatePem []byte PrivateKeyPem []byte certificate *x509.Certificate privateKey *rsa.PrivateKey mux sync.Mutex } //Refresh proccess the inputs into appropiate keys and certificates func (r *staticCertificateRetriever) Refresh() error { r.mux.Lock() defer r.mux.Unlock() certifcate, err := r.readCertificate() if err != nil { r.certificate = nil return err } r.certificate = certifcate key, err := r.readPrivateKey() if err != nil { r.privateKey = nil return err } r.privateKey = key return nil } func (r *staticCertificateRetriever) Certificate() *x509.Certificate { r.mux.Lock() defer r.mux.Unlock() return r.certificate } func (r *staticCertificateRetriever) PrivateKey() *rsa.PrivateKey { r.mux.Lock() defer r.mux.Unlock() return r.privateKey } func (r *staticCertificateRetriever) CertificatePemRaw() []byte { r.mux.Lock() defer r.mux.Unlock() if r.CertificatePem == nil { return nil } c := make([]byte, len(r.CertificatePem)) copy(c, r.CertificatePem) return c } func (r *staticCertificateRetriever) PrivateKeyPemRaw() []byte { r.mux.Lock() defer r.mux.Unlock() if r.PrivateKeyPem == nil { return nil } c := make([]byte, len(r.PrivateKeyPem)) copy(c, r.PrivateKeyPem) return c } func (r *staticCertificateRetriever) readCertificate() (certificate *x509.Certificate, err error) { block, _ := pem.Decode(r.CertificatePem) if block == nil { return nil, fmt.Errorf("failed to parse the new certificate, not valid pem data") } if certificate, err = x509.ParseCertificate(block.Bytes); err != nil { return nil, fmt.Errorf("failed to parse the new certificate: %s", err.Error()) } return certificate, nil } func (r *staticCertificateRetriever) readPrivateKey() (*rsa.PrivateKey, error) { if r.PrivateKeyPem == nil { return nil, nil } var pass *string if r.Passphrase == nil { pass = nil } else { ss := string(r.Passphrase) pass = &ss } return common.PrivateKeyFromBytes(r.PrivateKeyPem, pass) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/configuration.go�������������������0000664�0000000�0000000�00000011235�13771713062�0027651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth import ( "crypto/rsa" "fmt" "github.com/oracle/oci-go-sdk/common" ) type instancePrincipalConfigurationProvider struct { keyProvider instancePrincipalKeyProvider region *common.Region } //InstancePrincipalConfigurationProvider returns a configuration for instance principals func InstancePrincipalConfigurationProvider() (common.ConfigurationProvider, error) { return newInstancePrincipalConfigurationProvider("", nil) } //InstancePrincipalConfigurationProviderForRegion returns a configuration for instance principals with a given region func InstancePrincipalConfigurationProviderForRegion(region common.Region) (common.ConfigurationProvider, error) { return newInstancePrincipalConfigurationProvider(region, nil) } //InstancePrincipalConfigurationProviderWithCustomClient returns a configuration for instance principals using a modifier function to modify the HTTPRequestDispatcher func InstancePrincipalConfigurationProviderWithCustomClient(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (common.ConfigurationProvider, error) { return newInstancePrincipalConfigurationProvider("", modifier) } //InstancePrincipalConfigurationForRegionWithCustomClient returns a configuration for instance principals with a given region using a modifier function to modify the HTTPRequestDispatcher func InstancePrincipalConfigurationForRegionWithCustomClient(region common.Region, modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (common.ConfigurationProvider, error) { return newInstancePrincipalConfigurationProvider(region, modifier) } func newInstancePrincipalConfigurationProvider(region common.Region, modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (common.ConfigurationProvider, error) { var err error var keyProvider *instancePrincipalKeyProvider if keyProvider, err = newInstancePrincipalKeyProvider(modifier); err != nil { return nil, fmt.Errorf("failed to create a new key provider for instance principal: %s", err.Error()) } if len(region) > 0 { return instancePrincipalConfigurationProvider{keyProvider: *keyProvider, region: &region}, nil } return instancePrincipalConfigurationProvider{keyProvider: *keyProvider, region: nil}, nil } //InstancePrincipalConfigurationWithCerts returns a configuration for instance principals with a given region and hardcoded certificates in lieu of metadata service certs func InstancePrincipalConfigurationWithCerts(region common.Region, leafCertificate, leafPassphrase, leafPrivateKey []byte, intermediateCertificates [][]byte) (common.ConfigurationProvider, error) { leafCertificateRetriever := staticCertificateRetriever{Passphrase: leafPassphrase, CertificatePem: leafCertificate, PrivateKeyPem: leafPrivateKey} //The .Refresh() call actually reads the certificates from the inputs err := leafCertificateRetriever.Refresh() if err != nil { return nil, err } certificate := leafCertificateRetriever.Certificate() tenancyID := extractTenancyIDFromCertificate(certificate) fedClient, err := newX509FederationClientWithCerts(region, tenancyID, leafCertificate, leafPassphrase, leafPrivateKey, intermediateCertificates, *newDispatcherModifier(nil)) if err != nil { return nil, err } provider := instancePrincipalConfigurationProvider{ keyProvider: instancePrincipalKeyProvider{ Region: region, FederationClient: fedClient, TenancyID: tenancyID, }, region: &region, } return provider, nil } func (p instancePrincipalConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error) { return p.keyProvider.PrivateRSAKey() } func (p instancePrincipalConfigurationProvider) KeyID() (string, error) { return p.keyProvider.KeyID() } func (p instancePrincipalConfigurationProvider) TenancyOCID() (string, error) { return p.keyProvider.TenancyOCID() } func (p instancePrincipalConfigurationProvider) UserOCID() (string, error) { return "", nil } func (p instancePrincipalConfigurationProvider) KeyFingerprint() (string, error) { return "", nil } func (p instancePrincipalConfigurationProvider) Region() (string, error) { if p.region == nil { region := p.keyProvider.RegionForFederationClient() common.Debugf("Region in instance principal configuration provider is nil. Returning federation clients region: %s", region) return string(region), nil } return string(*p.region), nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/dispatcher_modifier.go�������������0000664�0000000�0000000�00000002742�13771713062�0031011�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package auth import "github.com/oracle/oci-go-sdk/common" //dispatcherModifier gives ability to modify a HTTPRequestDispatcher before use. type dispatcherModifier struct { modifiers []func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error) } //newDispatcherModifier creates a new dispatcherModifier with optional initial modifier (may be nil). func newDispatcherModifier(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) *dispatcherModifier { dispatcherModifier := &dispatcherModifier{ modifiers: make([]func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error), 0), } if modifier != nil { dispatcherModifier.QueueModifier(modifier) } return dispatcherModifier } //QueueModifier queues up a new modifier func (c *dispatcherModifier) QueueModifier(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) { c.modifiers = append(c.modifiers, modifier) } //Modify the provided HTTPRequestDispatcher with this modifier, and return the result, or error if something goes wrong func (c *dispatcherModifier) Modify(dispatcher common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error) { if len(c.modifiers) > 0 { for _, modifier := range c.modifiers { var err error if dispatcher, err = modifier(dispatcher); err != nil { common.Debugf("An error occurred when attempting to modify the dispatcher. Error was: %s", err.Error()) return nil, err } } } return dispatcher, nil } ������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/federation_client.go���������������0000664�0000000�0000000�00000044562�13771713062�0030471�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Package auth provides supporting functions and structs for authentication package auth import ( "context" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "fmt" "github.com/oracle/oci-go-sdk/common" "io/ioutil" "net/http" "os" "strings" "sync" "time" ) // federationClient is a client to retrieve the security token for an instance principal necessary to sign a request. // It also provides the private key whose corresponding public key is used to retrieve the security token. type federationClient interface { ClaimHolder PrivateKey() (*rsa.PrivateKey, error) SecurityToken() (string, error) } // ClaimHolder is implemented by any token interface that provides access to the security claims embedded in the token. type ClaimHolder interface { GetClaim(key string) (interface{}, error) } type genericFederationClient struct { SessionKeySupplier sessionKeySupplier RefreshSecurityToken func() (securityToken, error) securityToken securityToken mux sync.Mutex } var _ federationClient = &genericFederationClient{} func (c *genericFederationClient) PrivateKey() (*rsa.PrivateKey, error) { c.mux.Lock() defer c.mux.Unlock() if err := c.renewKeyAndSecurityTokenIfNotValid(); err != nil { return nil, err } return c.SessionKeySupplier.PrivateKey(), nil } func (c *genericFederationClient) SecurityToken() (token string, err error) { c.mux.Lock() defer c.mux.Unlock() if err = c.renewKeyAndSecurityTokenIfNotValid(); err != nil { return "", err } return c.securityToken.String(), nil } func (c *genericFederationClient) renewKeyAndSecurityTokenIfNotValid() (err error) { if c.securityToken == nil || !c.securityToken.Valid() { if err = c.renewKeyAndSecurityToken(); err != nil { return fmt.Errorf("failed to renew security token: %s", err.Error()) } } return nil } func (c *genericFederationClient) renewKeyAndSecurityToken() (err error) { common.Logf("Renewing keys for file based security token at: %v\n", time.Now().Format("15:04:05.000")) if err = c.SessionKeySupplier.Refresh(); err != nil { return fmt.Errorf("failed to refresh session key: %s", err.Error()) } common.Logf("Renewing security token at: %v\n", time.Now().Format("15:04:05.000")) if c.securityToken, err = c.RefreshSecurityToken(); err != nil { return fmt.Errorf("failed to refresh security token key: %s", err.Error()) } common.Logf("Security token renewed at: %v\n", time.Now().Format("15:04:05.000")) return nil } func (c *genericFederationClient) GetClaim(key string) (interface{}, error) { c.mux.Lock() defer c.mux.Unlock() if err := c.renewKeyAndSecurityTokenIfNotValid(); err != nil { return nil, err } return c.securityToken.GetClaim(key) } func newFileBasedFederationClient(securityTokenPath string, supplier sessionKeySupplier) (*genericFederationClient, error) { return &genericFederationClient{ SessionKeySupplier: supplier, RefreshSecurityToken: func() (token securityToken, err error) { var content []byte if content, err = ioutil.ReadFile(securityTokenPath); err != nil { return nil, fmt.Errorf("failed to read security token from :%s. Due to: %s", securityTokenPath, err.Error()) } var newToken securityToken if newToken, err = newInstancePrincipalToken(string(content)); err != nil { return nil, fmt.Errorf("failed to read security token from :%s. Due to: %s", securityTokenPath, err.Error()) } return newToken, nil }, }, nil } func newStaticFederationClient(sessionToken string, supplier sessionKeySupplier) (*genericFederationClient, error) { var newToken securityToken var err error if newToken, err = newInstancePrincipalToken(string(sessionToken)); err != nil { return nil, fmt.Errorf("failed to read security token. Due to: %s", err.Error()) } return &genericFederationClient{ SessionKeySupplier: supplier, RefreshSecurityToken: func() (token securityToken, err error) { return newToken, nil }, }, nil } // x509FederationClient retrieves a security token from Auth service. type x509FederationClient struct { tenancyID string sessionKeySupplier sessionKeySupplier leafCertificateRetriever x509CertificateRetriever intermediateCertificateRetrievers []x509CertificateRetriever securityToken securityToken authClient *common.BaseClient mux sync.Mutex } func newX509FederationClient(region common.Region, tenancyID string, leafCertificateRetriever x509CertificateRetriever, intermediateCertificateRetrievers []x509CertificateRetriever, modifier dispatcherModifier) (federationClient, error) { client := &x509FederationClient{ tenancyID: tenancyID, leafCertificateRetriever: leafCertificateRetriever, intermediateCertificateRetrievers: intermediateCertificateRetrievers, } client.sessionKeySupplier = newSessionKeySupplier() authClient := newAuthClient(region, client) var err error if authClient.HTTPClient, err = modifier.Modify(authClient.HTTPClient); err != nil { err = fmt.Errorf("failed to modify client: %s", err.Error()) return nil, err } client.authClient = authClient return client, nil } func newX509FederationClientWithCerts(region common.Region, tenancyID string, leafCertificate, leafPassphrase, leafPrivateKey []byte, intermediateCertificates [][]byte, modifier dispatcherModifier) (federationClient, error) { intermediateRetrievers := make([]x509CertificateRetriever, len(intermediateCertificates)) for i, c := range intermediateCertificates { intermediateRetrievers[i] = &staticCertificateRetriever{Passphrase: []byte(""), CertificatePem: c, PrivateKeyPem: nil} } client := &x509FederationClient{ tenancyID: tenancyID, leafCertificateRetriever: &staticCertificateRetriever{Passphrase: leafPassphrase, CertificatePem: leafCertificate, PrivateKeyPem: leafPrivateKey}, intermediateCertificateRetrievers: intermediateRetrievers, } client.sessionKeySupplier = newSessionKeySupplier() authClient := newAuthClient(region, client) var err error if authClient.HTTPClient, err = modifier.Modify(authClient.HTTPClient); err != nil { err = fmt.Errorf("failed to modify client: %s", err.Error()) return nil, err } client.authClient = authClient return client, nil } var ( genericHeaders = []string{"date", "(request-target)"} // "host" is not needed for the federation endpoint. Don't ask me why. bodyHeaders = []string{"content-length", "content-type", "x-content-sha256"} ) func newAuthClient(region common.Region, provider common.KeyProvider) *common.BaseClient { signer := common.RequestSigner(provider, genericHeaders, bodyHeaders) client := common.DefaultBaseClientWithSigner(signer) if regionURL, ok := os.LookupEnv("OCI_SDK_AUTH_CLIENT_REGION_URL"); ok { client.Host = regionURL } else { client.Host = region.Endpoint("auth") } client.BasePath = "v1/x509" return &client } // For authClient to sign requests to X509 Federation Endpoint func (c *x509FederationClient) KeyID() (string, error) { tenancy := c.tenancyID fingerprint := fingerprint(c.leafCertificateRetriever.Certificate()) return fmt.Sprintf("%s/fed-x509/%s", tenancy, fingerprint), nil } // For authClient to sign requests to X509 Federation Endpoint func (c *x509FederationClient) PrivateRSAKey() (*rsa.PrivateKey, error) { key := c.leafCertificateRetriever.PrivateKey() if key == nil { return nil, fmt.Errorf("can not read private key from leaf certificate. Likely an error in the metadata service") } return key, nil } func (c *x509FederationClient) PrivateKey() (*rsa.PrivateKey, error) { c.mux.Lock() defer c.mux.Unlock() if err := c.renewSecurityTokenIfNotValid(); err != nil { return nil, err } return c.sessionKeySupplier.PrivateKey(), nil } func (c *x509FederationClient) SecurityToken() (token string, err error) { c.mux.Lock() defer c.mux.Unlock() if err = c.renewSecurityTokenIfNotValid(); err != nil { return "", err } return c.securityToken.String(), nil } func (c *x509FederationClient) renewSecurityTokenIfNotValid() (err error) { if c.securityToken == nil || !c.securityToken.Valid() { if err = c.renewSecurityToken(); err != nil { return fmt.Errorf("failed to renew security token: %s", err.Error()) } } return nil } func (c *x509FederationClient) renewSecurityToken() (err error) { if err = c.sessionKeySupplier.Refresh(); err != nil { return fmt.Errorf("failed to refresh session key: %s", err.Error()) } if err = c.leafCertificateRetriever.Refresh(); err != nil { return fmt.Errorf("failed to refresh leaf certificate: %s", err.Error()) } updatedTenancyID := extractTenancyIDFromCertificate(c.leafCertificateRetriever.Certificate()) if c.tenancyID != updatedTenancyID { err = fmt.Errorf("unexpected update of tenancy OCID in the leaf certificate. Previous tenancy: %s, Updated: %s", c.tenancyID, updatedTenancyID) return } for _, retriever := range c.intermediateCertificateRetrievers { if err = retriever.Refresh(); err != nil { return fmt.Errorf("failed to refresh intermediate certificate: %s", err.Error()) } } common.Logf("Renewing security token at: %v\n", time.Now().Format("15:04:05.000")) if c.securityToken, err = c.getSecurityToken(); err != nil { return fmt.Errorf("failed to get security token: %s", err.Error()) } common.Logf("Security token renewed at: %v\n", time.Now().Format("15:04:05.000")) return nil } func (c *x509FederationClient) getSecurityToken() (securityToken, error) { request := c.makeX509FederationRequest() var err error var httpRequest http.Request if httpRequest, err = common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "", request); err != nil { return nil, fmt.Errorf("failed to make http request: %s", err.Error()) } var httpResponse *http.Response defer common.CloseBodyIfValid(httpResponse) for retry := 0; retry < 5; retry++ { if httpResponse, err = c.authClient.Call(context.Background(), &httpRequest); err == nil { break } time.Sleep(250 * time.Microsecond) } if err != nil { return nil, fmt.Errorf("failed to call: %s", err.Error()) } response := x509FederationResponse{} if err = common.UnmarshalResponse(httpResponse, &response); err != nil { return nil, fmt.Errorf("failed to unmarshal the response: %s", err.Error()) } return newInstancePrincipalToken(response.Token.Token) } func (c *x509FederationClient) GetClaim(key string) (interface{}, error) { c.mux.Lock() defer c.mux.Unlock() if err := c.renewSecurityTokenIfNotValid(); err != nil { return nil, err } return c.securityToken.GetClaim(key) } type x509FederationRequest struct { X509FederationDetails `contributesTo:"body"` } // X509FederationDetails x509 federation details type X509FederationDetails struct { Certificate string `mandatory:"true" json:"certificate,omitempty"` PublicKey string `mandatory:"true" json:"publicKey,omitempty"` IntermediateCertificates []string `mandatory:"false" json:"intermediateCertificates,omitempty"` } type x509FederationResponse struct { Token `presentIn:"body"` } // Token token type Token struct { Token string `mandatory:"true" json:"token,omitempty"` } func (c *x509FederationClient) makeX509FederationRequest() *x509FederationRequest { certificate := c.sanitizeCertificateString(string(c.leafCertificateRetriever.CertificatePemRaw())) publicKey := c.sanitizeCertificateString(string(c.sessionKeySupplier.PublicKeyPemRaw())) var intermediateCertificates []string for _, retriever := range c.intermediateCertificateRetrievers { intermediateCertificates = append(intermediateCertificates, c.sanitizeCertificateString(string(retriever.CertificatePemRaw()))) } details := X509FederationDetails{ Certificate: certificate, PublicKey: publicKey, IntermediateCertificates: intermediateCertificates, } return &x509FederationRequest{details} } func (c *x509FederationClient) sanitizeCertificateString(certString string) string { certString = strings.Replace(certString, "-----BEGIN CERTIFICATE-----", "", -1) certString = strings.Replace(certString, "-----END CERTIFICATE-----", "", -1) certString = strings.Replace(certString, "-----BEGIN PUBLIC KEY-----", "", -1) certString = strings.Replace(certString, "-----END PUBLIC KEY-----", "", -1) certString = strings.Replace(certString, "\n", "", -1) return certString } // sessionKeySupplier provides an RSA keypair which can be re-generated by calling Refresh(). type sessionKeySupplier interface { Refresh() error PrivateKey() *rsa.PrivateKey PublicKeyPemRaw() []byte } //genericKeySupplier implements sessionKeySupplier and provides an arbitrary refresh mechanism type genericKeySupplier struct { RefreshFn func() (*rsa.PrivateKey, []byte, error) privateKey *rsa.PrivateKey publicKeyPemRaw []byte } func (s genericKeySupplier) PrivateKey() *rsa.PrivateKey { if s.privateKey == nil { return nil } c := *s.privateKey return &c } func (s genericKeySupplier) PublicKeyPemRaw() []byte { if s.publicKeyPemRaw == nil { return nil } c := make([]byte, len(s.publicKeyPemRaw)) copy(c, s.publicKeyPemRaw) return c } func (s *genericKeySupplier) Refresh() (err error) { privateKey, publicPem, err := s.RefreshFn() if err != nil { return err } s.privateKey = privateKey s.publicKeyPemRaw = publicPem return nil } // create a sessionKeySupplier that reads keys from file every time it refreshes func newFileBasedKeySessionSupplier(privateKeyPemPath string, passphrasePath *string) (*genericKeySupplier, error) { return &genericKeySupplier{ RefreshFn: func() (*rsa.PrivateKey, []byte, error) { var err error var passContent []byte if passphrasePath != nil { if passContent, err = ioutil.ReadFile(*passphrasePath); err != nil { return nil, nil, fmt.Errorf("can not read passphrase from file: %s, due to %s", *passphrasePath, err.Error()) } } var keyPemContent []byte if keyPemContent, err = ioutil.ReadFile(privateKeyPemPath); err != nil { return nil, nil, fmt.Errorf("can not read private privateKey pem from file: %s, due to %s", privateKeyPemPath, err.Error()) } var privateKey *rsa.PrivateKey if privateKey, err = common.PrivateKeyFromBytesWithPassword(keyPemContent, passContent); err != nil { return nil, nil, fmt.Errorf("can not create private privateKey from contents of: %s, due to: %s", privateKeyPemPath, err.Error()) } var publicKeyAsnBytes []byte if publicKeyAsnBytes, err = x509.MarshalPKIXPublicKey(privateKey.Public()); err != nil { return nil, nil, fmt.Errorf("failed to marshal the public part of the new keypair: %s", err.Error()) } publicKeyPemRaw := pem.EncodeToMemory(&pem.Block{ Type: "PUBLIC KEY", Bytes: publicKeyAsnBytes, }) return privateKey, publicKeyPemRaw, nil }, }, nil } func newStaticKeySessionSupplier(privateKeyPemContent, passphrase []byte) (*genericKeySupplier, error) { var err error var privateKey *rsa.PrivateKey if privateKey, err = common.PrivateKeyFromBytesWithPassword(privateKeyPemContent, passphrase); err != nil { return nil, fmt.Errorf("can not create private privateKey, due to: %s", err.Error()) } var publicKeyAsnBytes []byte if publicKeyAsnBytes, err = x509.MarshalPKIXPublicKey(privateKey.Public()); err != nil { return nil, fmt.Errorf("failed to marshal the public part of the new keypair: %s", err.Error()) } publicKeyPemRaw := pem.EncodeToMemory(&pem.Block{ Type: "PUBLIC KEY", Bytes: publicKeyAsnBytes, }) return &genericKeySupplier{ RefreshFn: func() (key *rsa.PrivateKey, bytes []byte, err error) { return privateKey, publicKeyPemRaw, nil }, }, nil } // inMemorySessionKeySupplier implements sessionKeySupplier to vend an RSA keypair. // Refresh() generates a new RSA keypair with a random source, and keeps it in memory. // // inMemorySessionKeySupplier is not thread-safe. type inMemorySessionKeySupplier struct { keySize int privateKey *rsa.PrivateKey publicKeyPemRaw []byte } // newSessionKeySupplier creates and returns a sessionKeySupplier instance which generates key pairs of size 2048. func newSessionKeySupplier() sessionKeySupplier { return &inMemorySessionKeySupplier{keySize: 2048} } // Refresh() is failure atomic, i.e., PrivateKey() and PublicKeyPemRaw() would return their previous values // if Refresh() fails. func (s *inMemorySessionKeySupplier) Refresh() (err error) { common.Debugln("Refreshing session key") var privateKey *rsa.PrivateKey privateKey, err = rsa.GenerateKey(rand.Reader, s.keySize) if err != nil { return fmt.Errorf("failed to generate a new keypair: %s", err) } var publicKeyAsnBytes []byte if publicKeyAsnBytes, err = x509.MarshalPKIXPublicKey(privateKey.Public()); err != nil { return fmt.Errorf("failed to marshal the public part of the new keypair: %s", err.Error()) } publicKeyPemRaw := pem.EncodeToMemory(&pem.Block{ Type: "PUBLIC KEY", Bytes: publicKeyAsnBytes, }) s.privateKey = privateKey s.publicKeyPemRaw = publicKeyPemRaw return nil } func (s *inMemorySessionKeySupplier) PrivateKey() *rsa.PrivateKey { if s.privateKey == nil { return nil } c := *s.privateKey return &c } func (s *inMemorySessionKeySupplier) PublicKeyPemRaw() []byte { if s.publicKeyPemRaw == nil { return nil } c := make([]byte, len(s.publicKeyPemRaw)) copy(c, s.publicKeyPemRaw) return c } type securityToken interface { fmt.Stringer Valid() bool ClaimHolder } type instancePrincipalToken struct { tokenString string jwtToken *jwtToken } func newInstancePrincipalToken(tokenString string) (newToken securityToken, err error) { var jwtToken *jwtToken if jwtToken, err = parseJwt(tokenString); err != nil { return nil, fmt.Errorf("failed to parse the token string \"%s\": %s", tokenString, err.Error()) } return &instancePrincipalToken{tokenString, jwtToken}, nil } func (t *instancePrincipalToken) String() string { return t.tokenString } func (t *instancePrincipalToken) Valid() bool { return !t.jwtToken.expired() } var ( // ErrNoSuchClaim is returned when a token does not hold the claim sought ErrNoSuchClaim = errors.New("no such claim") ) func (t *instancePrincipalToken) GetClaim(key string) (interface{}, error) { if value, ok := t.jwtToken.payload[key]; ok { return value, nil } return nil, ErrNoSuchClaim } ����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/instance_principal_key_provider.go�0000664�0000000�0000000�00000012706�13771713062�0033435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth import ( "bytes" "crypto/rsa" "fmt" "github.com/oracle/oci-go-sdk/common" "net/http" "strings" ) const ( metadataBaseURL = `http://169.254.169.254/opc/v2` metadataFallbackURL = `http://169.254.169.254/opc/v1` regionPath = `/instance/region` leafCertificatePath = `/identity/cert.pem` leafCertificateKeyPath = `/identity/key.pem` intermediateCertificatePath = `/identity/intermediate.pem` leafCertificateKeyPassphrase = `` // No passphrase for the private key for Compute instances intermediateCertificateKeyURL = `` intermediateCertificateKeyPassphrase = `` // No passphrase for the private key for Compute instances ) var ( regionURL, leafCertificateURL, leafCertificateKeyURL, intermediateCertificateURL string ) // instancePrincipalKeyProvider implements KeyProvider to provide a key ID and its corresponding private key // for an instance principal by getting a security token via x509FederationClient. // // The region name of the endpoint for x509FederationClient is obtained from the metadata service on the compute // instance. type instancePrincipalKeyProvider struct { Region common.Region FederationClient federationClient TenancyID string } // newInstancePrincipalKeyProvider creates and returns an instancePrincipalKeyProvider instance based on // x509FederationClient. // // NOTE: There is a race condition between PrivateRSAKey() and KeyID(). These two pieces are tightly coupled; KeyID // includes a security token obtained from Auth service by giving a public key which is paired with PrivateRSAKey. // The x509FederationClient caches the security token in memory until it is expired. Thus, even if a client obtains a // KeyID that is not expired at the moment, the PrivateRSAKey that the client acquires at a next moment could be // invalid because the KeyID could be already expired. func newInstancePrincipalKeyProvider(modifier func(common.HTTPRequestDispatcher) (common.HTTPRequestDispatcher, error)) (provider *instancePrincipalKeyProvider, err error) { updateX509CertRetrieverURLParas(metadataBaseURL) clientModifier := newDispatcherModifier(modifier) client, err := clientModifier.Modify(&http.Client{}) if err != nil { err = fmt.Errorf("failed to modify client: %s", err.Error()) return nil, err } var region common.Region if region, err = getRegionForFederationClient(client, regionURL); err != nil { err = fmt.Errorf("failed to get the region name from %s: %s", regionURL, err.Error()) common.Logf("%v\n", err) return nil, err } leafCertificateRetriever := newURLBasedX509CertificateRetriever(client, leafCertificateURL, leafCertificateKeyURL, leafCertificateKeyPassphrase) intermediateCertificateRetrievers := []x509CertificateRetriever{ newURLBasedX509CertificateRetriever( client, intermediateCertificateURL, intermediateCertificateKeyURL, intermediateCertificateKeyPassphrase), } if err = leafCertificateRetriever.Refresh(); err != nil { err = fmt.Errorf("failed to refresh the leaf certificate: %s", err.Error()) return nil, err } tenancyID := extractTenancyIDFromCertificate(leafCertificateRetriever.Certificate()) federationClient, err := newX509FederationClient(region, tenancyID, leafCertificateRetriever, intermediateCertificateRetrievers, *clientModifier) if err != nil { err = fmt.Errorf("failed to create federation client: %s", err.Error()) return nil, err } provider = &instancePrincipalKeyProvider{FederationClient: federationClient, TenancyID: tenancyID, Region: region} return } func getRegionForFederationClient(dispatcher common.HTTPRequestDispatcher, url string) (r common.Region, err error) { var body bytes.Buffer var statusCode int if body, statusCode, err = httpGet(dispatcher, url); err != nil { if statusCode == 404 && strings.Compare(url, metadataBaseURL+regionPath) == 0 { common.Logf("Falling back to http://169.254.169.254/opc/v1 to try again...\n") updateX509CertRetrieverURLParas(metadataFallbackURL) return getRegionForFederationClient(dispatcher, regionURL) } return } return common.StringToRegion(body.String()), nil } func updateX509CertRetrieverURLParas(baseURL string) { regionURL = baseURL + regionPath leafCertificateURL = baseURL + leafCertificatePath leafCertificateKeyURL = baseURL + leafCertificateKeyPath intermediateCertificateURL = baseURL + intermediateCertificatePath } func (p *instancePrincipalKeyProvider) RegionForFederationClient() common.Region { return p.Region } func (p *instancePrincipalKeyProvider) PrivateRSAKey() (privateKey *rsa.PrivateKey, err error) { if privateKey, err = p.FederationClient.PrivateKey(); err != nil { err = fmt.Errorf("failed to get private key: %s", err.Error()) return nil, err } return privateKey, nil } func (p *instancePrincipalKeyProvider) KeyID() (string, error) { var securityToken string var err error if securityToken, err = p.FederationClient.SecurityToken(); err != nil { return "", fmt.Errorf("failed to get security token: %s", err.Error()) } return fmt.Sprintf("ST$%s", securityToken), nil } func (p *instancePrincipalKeyProvider) TenancyOCID() (string, error) { return p.TenancyID, nil } ����������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/jwt.go�����������������������������0000664�0000000�0000000�00000004114�13771713062�0025604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth import ( "bytes" "encoding/base64" "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/common" "strings" "time" ) type jwtToken struct { raw string header map[string]interface{} payload map[string]interface{} } const bufferTimeBeforeTokenExpiration = 5 * time.Minute func (t *jwtToken) expired() bool { exp := int64(t.payload["exp"].(float64)) expTime := time.Unix(exp, 0) expired := exp <= time.Now().Unix()+int64(bufferTimeBeforeTokenExpiration.Seconds()) if expired { common.Debugf("Token expires at: %v, currently expired due to bufferTime: %v", expTime.Format("15:04:05.000"), expired) } return expired } func parseJwt(tokenString string) (*jwtToken, error) { parts := strings.Split(tokenString, ".") if len(parts) != 3 { return nil, fmt.Errorf("the given token string contains an invalid number of parts") } token := &jwtToken{raw: tokenString} var err error // Parse Header part var headerBytes []byte if headerBytes, err = decodePart(parts[0]); err != nil { return nil, fmt.Errorf("failed to decode the header bytes: %s", err.Error()) } if err = json.Unmarshal(headerBytes, &token.header); err != nil { return nil, err } // Parse Payload part var payloadBytes []byte if payloadBytes, err = decodePart(parts[1]); err != nil { return nil, fmt.Errorf("failed to decode the payload bytes: %s", err.Error()) } decoder := json.NewDecoder(bytes.NewBuffer(payloadBytes)) if err = decoder.Decode(&token.payload); err != nil { return nil, fmt.Errorf("failed to decode the payload json: %s", err.Error()) } return token, nil } func decodePart(partString string) ([]byte, error) { if l := len(partString) % 4; 0 < l { partString += strings.Repeat("=", 4-l) } return base64.URLEncoding.DecodeString(partString) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/resouce_principal_key_provider.go��0000664�0000000�0000000�00000015374�13771713062�0033302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package auth import ( "crypto/rsa" "errors" "fmt" "github.com/oracle/oci-go-sdk/common" "os" "path" ) const ( //ResourcePrincipalVersion2_2 supported version for resource principals ResourcePrincipalVersion2_2 = "2.2" //ResourcePrincipalVersionEnvVar environment var name for version ResourcePrincipalVersionEnvVar = "OCI_RESOURCE_PRINCIPAL_VERSION" //ResourcePrincipalRPSTEnvVar environment var name holding the token or a path to the token ResourcePrincipalRPSTEnvVar = "OCI_RESOURCE_PRINCIPAL_RPST" //ResourcePrincipalPrivatePEMEnvVar environment var holding a rsa private key in pem format or a path to one ResourcePrincipalPrivatePEMEnvVar = "OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM" //ResourcePrincipalPrivatePEMPassphraseEnvVar environment var holding the passphrase to a key or a path to one ResourcePrincipalPrivatePEMPassphraseEnvVar = "OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM_PASSPHRASE" //ResourcePrincipalRegionEnvVar environment variable holding a region ResourcePrincipalRegionEnvVar = "OCI_RESOURCE_PRINCIPAL_REGION" // TenancyOCIDClaimKey is the key used to look up the resource tenancy in an RPST TenancyOCIDClaimKey = "res_tenant" // CompartmentOCIDClaimKey is the key used to look up the resource compartment in an RPST CompartmentOCIDClaimKey = "res_compartment" ) // ConfigurationProviderWithClaimAccess mixes in a method to access the claims held on the underlying security token type ConfigurationProviderWithClaimAccess interface { common.ConfigurationProvider ClaimHolder } // ResourcePrincipalConfigurationProvider returns a resource principal configuration provider using well known // environment variables to look up token information. The environment variables can either paths or contain the material value // of the keys. However in the case of the keys and tokens paths and values can not be mixed func ResourcePrincipalConfigurationProvider() (ConfigurationProviderWithClaimAccess, error) { var version string var ok bool if version, ok = os.LookupEnv(ResourcePrincipalVersionEnvVar); !ok { return nil, fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalVersionEnvVar) } switch version { case ResourcePrincipalVersion2_2: rpst := requireEnv(ResourcePrincipalRPSTEnvVar) if rpst == nil { return nil, fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalRPSTEnvVar) } private := requireEnv(ResourcePrincipalPrivatePEMEnvVar) if private == nil { return nil, fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalPrivatePEMEnvVar) } passphrase := requireEnv(ResourcePrincipalPrivatePEMPassphraseEnvVar) region := requireEnv(ResourcePrincipalRegionEnvVar) if region == nil { return nil, fmt.Errorf("can not create resource principal, environment variable: %s, not present", ResourcePrincipalRegionEnvVar) } return newResourcePrincipalKeyProvider22( *rpst, *private, passphrase, *region) default: return nil, fmt.Errorf("can not create resource principal, environment variable: %s, must be valid", ResourcePrincipalVersionEnvVar) } } func requireEnv(key string) *string { if val, ok := os.LookupEnv(key); ok { return &val } return nil } // resourcePrincipalKeyProvider22 is key provider that reads from specified the specified environment variables // the environment variables can host the material keys/passphrases or they can be paths to files that need to be read type resourcePrincipalKeyProvider struct { FederationClient federationClient KeyProviderRegion common.Region } func newResourcePrincipalKeyProvider22(sessionTokenLocation, privatePemLocation string, passphraseLocation *string, region string) (*resourcePrincipalKeyProvider, error) { //Check both the the passphrase and the key are paths if passphraseLocation != nil && (!isPath(privatePemLocation) && isPath(*passphraseLocation) || isPath(privatePemLocation) && !isPath(*passphraseLocation)) { return nil, fmt.Errorf("cant not create resource principal: both key and passphrase need to be path or none needs to be path") } var supplier sessionKeySupplier var err error //File based case if isPath(privatePemLocation) { supplier, err = newFileBasedKeySessionSupplier(privatePemLocation, passphraseLocation) if err != nil { return nil, fmt.Errorf("can not create resource principal, due to: %s ", err.Error()) } } else { //else the content is in the env vars var passphrase []byte if passphraseLocation != nil { passphrase = []byte(*passphraseLocation) } supplier, err = newStaticKeySessionSupplier([]byte(privatePemLocation), passphrase) if err != nil { return nil, fmt.Errorf("can not create resource principal, due to: %s ", err.Error()) } } var fd federationClient if isPath(sessionTokenLocation) { fd, _ = newFileBasedFederationClient(sessionTokenLocation, supplier) } else { fd, err = newStaticFederationClient(sessionTokenLocation, supplier) if err != nil { return nil, fmt.Errorf("can not create resource principal, due to: %s ", err.Error()) } } rs := resourcePrincipalKeyProvider{ FederationClient: fd, KeyProviderRegion: common.StringToRegion(region), } return &rs, nil } func (p *resourcePrincipalKeyProvider) PrivateRSAKey() (privateKey *rsa.PrivateKey, err error) { if privateKey, err = p.FederationClient.PrivateKey(); err != nil { err = fmt.Errorf("failed to get private key: %s", err.Error()) return nil, err } return privateKey, nil } func (p *resourcePrincipalKeyProvider) KeyID() (string, error) { var securityToken string var err error if securityToken, err = p.FederationClient.SecurityToken(); err != nil { return "", fmt.Errorf("failed to get security token: %s", err.Error()) } return fmt.Sprintf("ST$%s", securityToken), nil } func (p *resourcePrincipalKeyProvider) Region() (string, error) { return string(p.KeyProviderRegion), nil } var ( // ErrNonStringClaim is returned if the token has a claim for a key, but it's not a string value ErrNonStringClaim = errors.New("claim does not have a string value") ) func (p *resourcePrincipalKeyProvider) TenancyOCID() (string, error) { if claim, err := p.GetClaim(TenancyOCIDClaimKey); err != nil { return "", err } else if tenancy, ok := claim.(string); ok { return tenancy, nil } else { return "", ErrNonStringClaim } } func (p *resourcePrincipalKeyProvider) GetClaim(claim string) (interface{}, error) { return p.FederationClient.GetClaim(claim) } func (p *resourcePrincipalKeyProvider) KeyFingerprint() (string, error) { return "", nil } func (p *resourcePrincipalKeyProvider) UserOCID() (string, error) { return "", nil } // By contract for the the content of a resource principal to be considered path, it needs to be // an absolute path. func isPath(str string) bool { return path.IsAbs(str) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/auth/utils.go���������������������������0000664�0000000�0000000�00000003754�13771713062�0026151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package auth import ( "bytes" "crypto/sha1" "crypto/x509" "fmt" "github.com/oracle/oci-go-sdk/common" "net/http" "net/http/httputil" "strings" ) // httpGet makes a simple HTTP GET request to the given URL, expecting only "200 OK" status code. // This is basically for the Instance Metadata Service. func httpGet(dispatcher common.HTTPRequestDispatcher, url string) (body bytes.Buffer, statusCode int, err error) { var response *http.Response request, err := http.NewRequest(http.MethodGet, url, nil) request.Header.Add("Authorization", "Bearer Oracle") if response, err = dispatcher.Do(request); err != nil { return } statusCode = response.StatusCode common.IfDebug(func() { if dump, e := httputil.DumpResponse(response, true); e == nil { common.Logf("Dump Response %v", string(dump)) } else { common.Debugln(e) } }) defer response.Body.Close() if _, err = body.ReadFrom(response.Body); err != nil { return } if statusCode != http.StatusOK { err = fmt.Errorf("HTTP Get failed: URL: %s, Status: %s, Message: %s", url, response.Status, body.String()) return } return } func extractTenancyIDFromCertificate(cert *x509.Certificate) string { for _, nameAttr := range cert.Subject.Names { value := nameAttr.Value.(string) if strings.HasPrefix(value, "opc-tenant:") { return value[len("opc-tenant:"):] } } return "" } func fingerprint(certificate *x509.Certificate) string { fingerprint := sha1.Sum(certificate.Raw) return colonSeparatedString(fingerprint) } func colonSeparatedString(fingerprint [sha1.Size]byte) string { spaceSeparated := fmt.Sprintf("% x", fingerprint) return strings.Replace(spaceSeparated, " ", ":", -1) } ��������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/client.go�������������������������������0000664�0000000�0000000�00000031177�13771713062�0025326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Package common provides supporting functions and structs used by service packages package common import ( "context" "fmt" "math/rand" "net/http" "net/http/httputil" "net/url" "os" "os/user" "path" "runtime" "strings" "sync/atomic" "time" ) const ( // DefaultHostURLTemplate The default url template for service hosts DefaultHostURLTemplate = "%s.%s.oraclecloud.com" // requestHeaderAccept The key for passing a header to indicate Accept requestHeaderAccept = "Accept" // requestHeaderAuthorization The key for passing a header to indicate Authorization requestHeaderAuthorization = "Authorization" // requestHeaderContentLength The key for passing a header to indicate Content Length requestHeaderContentLength = "Content-Length" // requestHeaderContentType The key for passing a header to indicate Content Type requestHeaderContentType = "Content-Type" // requestHeaderDate The key for passing a header to indicate Date requestHeaderDate = "Date" // requestHeaderIfMatch The key for passing a header to indicate If Match requestHeaderIfMatch = "if-match" // requestHeaderOpcClientInfo The key for passing a header to indicate OPC Client Info requestHeaderOpcClientInfo = "opc-client-info" // requestHeaderOpcRetryToken The key for passing a header to indicate OPC Retry Token requestHeaderOpcRetryToken = "opc-retry-token" // requestHeaderOpcRequestID The key for unique Oracle-assigned identifier for the request. requestHeaderOpcRequestID = "opc-request-id" // requestHeaderOpcClientRequestID The key for unique Oracle-assigned identifier for the request. requestHeaderOpcClientRequestID = "opc-client-request-id" // requestHeaderUserAgent The key for passing a header to indicate User Agent requestHeaderUserAgent = "User-Agent" // requestHeaderXContentSHA256 The key for passing a header to indicate SHA256 hash requestHeaderXContentSHA256 = "X-Content-SHA256" // requestHeaderOpcOboToken The key for passing a header to use obo token requestHeaderOpcOboToken = "opc-obo-token" // private constants defaultScheme = "https" defaultSDKMarker = "Oracle-GoSDK" defaultUserAgentTemplate = "%s/%s (%s/%s; go/%s)" //SDK/SDKVersion (OS/OSVersion; Lang/LangVersion) defaultTimeout = 60 * time.Second defaultConfigFileName = "config" defaultConfigDirName = ".oci" secondaryConfigDirName = ".oraclebmc" maxBodyLenForDebug = 1024 * 1000 ) // RequestInterceptor function used to customize the request before calling the underlying service type RequestInterceptor func(*http.Request) error // HTTPRequestDispatcher wraps the execution of a http request, it is generally implemented by // http.Client.Do, but can be customized for testing type HTTPRequestDispatcher interface { Do(req *http.Request) (*http.Response, error) } // BaseClient struct implements all basic operations to call oci web services. type BaseClient struct { //HTTPClient performs the http network operations HTTPClient HTTPRequestDispatcher //Signer performs auth operation Signer HTTPRequestSigner //A request interceptor can be used to customize the request before signing and dispatching Interceptor RequestInterceptor //The host of the service Host string //The user agent UserAgent string //Base path for all operations of this client BasePath string } func defaultUserAgent() string { userAgent := fmt.Sprintf(defaultUserAgentTemplate, defaultSDKMarker, Version(), runtime.GOOS, runtime.GOARCH, runtime.Version()) return userAgent } var clientCounter int64 func getNextSeed() int64 { newCounterValue := atomic.AddInt64(&clientCounter, 1) return newCounterValue + time.Now().UnixNano() } func newBaseClient(signer HTTPRequestSigner, dispatcher HTTPRequestDispatcher) BaseClient { rand.Seed(getNextSeed()) return BaseClient{ UserAgent: defaultUserAgent(), Interceptor: nil, Signer: signer, HTTPClient: dispatcher, } } func defaultHTTPDispatcher() http.Client { httpClient := http.Client{ Timeout: defaultTimeout, } return httpClient } func defaultBaseClient(provider KeyProvider) BaseClient { dispatcher := defaultHTTPDispatcher() signer := DefaultRequestSigner(provider) return newBaseClient(signer, &dispatcher) } //DefaultBaseClientWithSigner creates a default base client with a given signer func DefaultBaseClientWithSigner(signer HTTPRequestSigner) BaseClient { dispatcher := defaultHTTPDispatcher() return newBaseClient(signer, &dispatcher) } // NewClientWithConfig Create a new client with a configuration provider, the configuration provider // will be used for the default signer as well as reading the region // This function does not check for valid regions to implement forward compatibility func NewClientWithConfig(configProvider ConfigurationProvider) (client BaseClient, err error) { var ok bool if ok, err = IsConfigurationProviderValid(configProvider); !ok { err = fmt.Errorf("can not create client, bad configuration: %s", err.Error()) return } client = defaultBaseClient(configProvider) return } // NewClientWithOboToken Create a new client that will use oboToken for auth func NewClientWithOboToken(configProvider ConfigurationProvider, oboToken string) (client BaseClient, err error) { client, err = NewClientWithConfig(configProvider) if err != nil { return } // Interceptor to add obo token header client.Interceptor = func(request *http.Request) error { request.Header.Add(requestHeaderOpcOboToken, oboToken) return nil } // Obo token will also be signed defaultHeaders := append(DefaultGenericHeaders(), requestHeaderOpcOboToken) client.Signer = RequestSigner(configProvider, defaultHeaders, DefaultBodyHeaders()) return } func getHomeFolder() string { current, e := user.Current() if e != nil { //Give up and try to return something sensible home := os.Getenv("HOME") if home == "" { home = os.Getenv("USERPROFILE") } return home } return current.HomeDir } // DefaultConfigProvider returns the default config provider. The default config provider // will look for configurations in 3 places: file in $HOME/.oci/config, HOME/.obmcs/config and // variables names starting with the string TF_VAR. If the same configuration is found in multiple // places the provider will prefer the first one. func DefaultConfigProvider() ConfigurationProvider { homeFolder := getHomeFolder() defaultConfigFile := path.Join(homeFolder, defaultConfigDirName, defaultConfigFileName) secondaryConfigFile := path.Join(homeFolder, secondaryConfigDirName, defaultConfigFileName) defaultFileProvider, _ := ConfigurationProviderFromFile(defaultConfigFile, "") secondaryFileProvider, _ := ConfigurationProviderFromFile(secondaryConfigFile, "") environmentProvider := environmentConfigurationProvider{EnvironmentVariablePrefix: "TF_VAR"} provider, _ := ComposingConfigurationProvider([]ConfigurationProvider{defaultFileProvider, secondaryFileProvider, environmentProvider}) Debugf("Configuration provided by: %s", provider) return provider } // CustomProfileConfigProvider returns the config provider of given profile. The custom profile config provider // will look for configurations in 2 places: file in $HOME/.oci/config, and variables names starting with the // string TF_VAR. If the same configuration is found in multiple places the provider will prefer the first one. func CustomProfileConfigProvider(customConfigPath string, profile string) ConfigurationProvider { homeFolder := getHomeFolder() if customConfigPath == "" { customConfigPath = path.Join(homeFolder, defaultConfigDirName, defaultConfigFileName) } customFileProvider, _ := ConfigurationProviderFromFileWithProfile(customConfigPath, profile, "") defaultFileProvider, _ := ConfigurationProviderFromFileWithProfile(customConfigPath, "DEFAULT", "") environmentProvider := environmentConfigurationProvider{EnvironmentVariablePrefix: "TF_VAR"} provider, _ := ComposingConfigurationProvider([]ConfigurationProvider{customFileProvider, defaultFileProvider, environmentProvider}) Debugf("Configuration provided by: %s", provider) return provider } func (client *BaseClient) prepareRequest(request *http.Request) (err error) { if client.UserAgent == "" { return fmt.Errorf("user agent can not be blank") } if request.Header == nil { request.Header = http.Header{} } request.Header.Set(requestHeaderUserAgent, client.UserAgent) request.Header.Set(requestHeaderDate, time.Now().UTC().Format(http.TimeFormat)) if !strings.Contains(client.Host, "http") && !strings.Contains(client.Host, "https") { client.Host = fmt.Sprintf("%s://%s", defaultScheme, client.Host) } clientURL, err := url.Parse(client.Host) if err != nil { return fmt.Errorf("host is invalid. %s", err.Error()) } request.URL.Host = clientURL.Host request.URL.Scheme = clientURL.Scheme currentPath := request.URL.Path if !strings.Contains(currentPath, fmt.Sprintf("/%s", client.BasePath)) { request.URL.Path = path.Clean(fmt.Sprintf("/%s/%s", client.BasePath, currentPath)) } return } func (client BaseClient) intercept(request *http.Request) (err error) { if client.Interceptor != nil { err = client.Interceptor(request) } return } func checkForSuccessfulResponse(res *http.Response) error { familyStatusCode := res.StatusCode / 100 if familyStatusCode == 4 || familyStatusCode == 5 { return newServiceFailureFromResponse(res) } return nil } // OCIRequest is any request made to an OCI service. type OCIRequest interface { // HTTPRequest assembles an HTTP request. HTTPRequest(method, path string) (http.Request, error) } // RequestMetadata is metadata about an OCIRequest. This structure represents the behavior exhibited by the SDK when // issuing (or reissuing) a request. type RequestMetadata struct { // RetryPolicy is the policy for reissuing the request. If no retry policy is set on the request, // then the request will be issued exactly once. RetryPolicy *RetryPolicy } // OCIResponse is the response from issuing a request to an OCI service. type OCIResponse interface { // HTTPResponse returns the raw HTTP response. HTTPResponse() *http.Response } // OCIOperation is the generalization of a request-response cycle undergone by an OCI service. type OCIOperation func(context.Context, OCIRequest) (OCIResponse, error) //ClientCallDetails a set of settings used by the a single Call operation of the http Client type ClientCallDetails struct { Signer HTTPRequestSigner } // Call executes the http request with the given context func (client BaseClient) Call(ctx context.Context, request *http.Request) (response *http.Response, err error) { return client.CallWithDetails(ctx, request, ClientCallDetails{Signer: client.Signer}) } // CallWithDetails executes the http request, the given context using details specified in the paremeters, this function // provides a way to override some settings present in the client func (client BaseClient) CallWithDetails(ctx context.Context, request *http.Request, details ClientCallDetails) (response *http.Response, err error) { Debugln("Atempting to call downstream service") request = request.WithContext(ctx) err = client.prepareRequest(request) if err != nil { return } //Intercept err = client.intercept(request) if err != nil { return } //Sign the request err = details.Signer.Sign(request) if err != nil { return } IfDebug(func() { dumpBody := true if request.ContentLength > maxBodyLenForDebug { Debugf("not dumping body too big\n") dumpBody = false } dumpBody = dumpBody && defaultLogger.LogLevel() == verboseLogging if dump, e := httputil.DumpRequestOut(request, dumpBody); e == nil { Debugf("Dump Request %s", string(dump)) } else { Debugf("%v\n", e) } }) //Execute the http request response, err = client.HTTPClient.Do(request) IfDebug(func() { if err != nil { Debugf("%v\n", err) return } dumpBody := true if response.ContentLength > maxBodyLenForDebug { Debugf("not dumping body too big\n") dumpBody = false } dumpBody = dumpBody && defaultLogger.LogLevel() == verboseLogging if dump, e := httputil.DumpResponse(response, dumpBody); e == nil { Debugf("Dump Response %s", string(dump)) } else { Debugf("%v\n", e) } }) if err != nil { return } err = checkForSuccessfulResponse(response) return } //CloseBodyIfValid closes the body of an http response if the response and the body are valid func CloseBodyIfValid(httpResponse *http.Response) { if httpResponse != nil && httpResponse.Body != nil { httpResponse.Body.Close() } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/common.go�������������������������������0000664�0000000�0000000�00000013350�13771713062�0025331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "fmt" "regexp" "strings" ) //Region type for regions type Region string const ( //RegionSEA region SEA RegionSEA Region = "sea" //RegionCAToronto1 region for toronto RegionCAToronto1 Region = "ca-toronto-1" //RegionCAMontreal1 region for Montreal RegionCAMontreal1 Region = "ca-montreal-1" //RegionPHX region PHX RegionPHX Region = "us-phoenix-1" //RegionIAD region IAD RegionIAD Region = "us-ashburn-1" //RegionFRA region FRA RegionFRA Region = "eu-frankfurt-1" //RegionLHR region LHR RegionLHR Region = "uk-london-1" //RegionAPTokyo1 region for tokyo RegionAPTokyo1 Region = "ap-tokyo-1" //RegionAPOsaka1 region for Osaka RegionAPOsaka1 Region = "ap-osaka-1" //RegionAPSeoul1 region for seoul RegionAPSeoul1 Region = "ap-seoul-1" //RegionAPMumbai1 region for mumbai RegionAPMumbai1 Region = "ap-mumbai-1" //RegionAPMelbourne1 region for Melbourne RegionAPMelbourne1 Region = "ap-melbourne-1" //RegionAPSydney1 region for Sydney RegionAPSydney1 Region = "ap-sydney-1" //RegionMEJeddah1 region for Jeddah RegionMEJeddah1 Region = "me-jeddah-1" //RegionEUZurich1 region for Zurich RegionEUZurich1 Region = "eu-zurich-1" //RegionEUAmsterdam1 region for Amsterdam RegionEUAmsterdam1 Region = "eu-amsterdam-1" //RegionSASaopaulo1 region for Sao Paulo RegionSASaopaulo1 Region = "sa-saopaulo-1" //RegionUSLangley1 region for langley RegionUSLangley1 Region = "us-langley-1" //RegionUSLuke1 region for luke RegionUSLuke1 Region = "us-luke-1" //RegionUSGovAshburn1 region for langley RegionUSGovAshburn1 Region = "us-gov-ashburn-1" //RegionUSGovChicago1 region for luke RegionUSGovChicago1 Region = "us-gov-chicago-1" //RegionUSGovPhoenix1 region for luke RegionUSGovPhoenix1 Region = "us-gov-phoenix-1" //RegionUKGovLondon1 gov region London RegionUKGovLondon1 Region = "uk-gov-london-1" ) var realm = map[string]string{ "oc1": "oraclecloud.com", "oc2": "oraclegovcloud.com", "oc3": "oraclegovcloud.com", "oc4": "oraclegovcloud.uk", } var regionRealm = map[Region]string{ RegionPHX: "oc1", RegionIAD: "oc1", RegionFRA: "oc1", RegionLHR: "oc1", RegionCAToronto1: "oc1", RegionCAMontreal1: "oc1", RegionAPTokyo1: "oc1", RegionAPOsaka1: "oc1", RegionAPSeoul1: "oc1", RegionAPSydney1: "oc1", RegionAPMumbai1: "oc1", RegionAPMelbourne1: "oc1", RegionMEJeddah1: "oc1", RegionEUZurich1: "oc1", RegionEUAmsterdam1: "oc1", RegionSASaopaulo1: "oc1", RegionUSLangley1: "oc2", RegionUSLuke1: "oc2", RegionUSGovAshburn1: "oc3", RegionUSGovChicago1: "oc3", RegionUSGovPhoenix1: "oc3", RegionUKGovLondon1: "oc4", } // Endpoint returns a endpoint for a service func (region Region) Endpoint(service string) string { return fmt.Sprintf("%s.%s.%s", service, region, region.secondLevelDomain()) } // EndpointForTemplate returns a endpoint for a service based on template func (region Region) EndpointForTemplate(service string, serviceEndpointTemplate string) string { if serviceEndpointTemplate == "" { return region.Endpoint(service) } // replace service prefix endpoint := strings.Replace(serviceEndpointTemplate, "{serviceEndpointPrefix}", service, 1) // replace region endpoint = strings.Replace(endpoint, "{region}", string(region), 1) // replace second level domain endpoint = strings.Replace(endpoint, "{secondLevelDomain}", region.secondLevelDomain(), 1) return endpoint } func (region Region) secondLevelDomain() string { if realmID, ok := regionRealm[region]; ok { if secondLevelDomain, ok := realm[realmID]; ok { return secondLevelDomain } } Debugf("cannot find realm for region : %s, return default realm value.", region) return realm["oc1"] } //StringToRegion convert a string to Region type func StringToRegion(stringRegion string) (r Region) { switch strings.ToLower(stringRegion) { case "sea": r = RegionSEA case "yyz", "ca-toronto-1": r = RegionCAToronto1 case "yul", "ca-montreal-1": r = RegionCAMontreal1 case "phx", "us-phoenix-1": r = RegionPHX case "iad", "us-ashburn-1": r = RegionIAD case "fra", "eu-frankfurt-1": r = RegionFRA case "lhr", "uk-london-1": r = RegionLHR case "nrt", "ap-tokyo-1": r = RegionAPTokyo1 case "kix", "ap-osaka-1": r = RegionAPOsaka1 case "icn", "ap-seoul-1": r = RegionAPSeoul1 case "bom", "ap-mumbai-1": r = RegionAPMumbai1 case "mel", "ap-melbourne-1": r = RegionAPMelbourne1 case "syd", "ap-sydney-1": r = RegionAPSydney1 case "jed", "me-jeddah-1": r = RegionMEJeddah1 case "zrh", "eu-zurich-1": r = RegionEUZurich1 case "ams", "eu-amsterdam-1": r = RegionEUAmsterdam1 case "gru", "sa-saopaulo-1": r = RegionSASaopaulo1 case "us-langley-1": r = RegionUSLangley1 case "us-luke-1": r = RegionUSLuke1 case "us-gov-ashburn-1": r = RegionUSGovAshburn1 case "us-gov-chicago-1": r = RegionUSGovChicago1 case "us-gov-phoenix-1": r = RegionUSGovPhoenix1 case "ltn", "uk-gov-london-1": r = RegionUKGovLondon1 default: r = Region(stringRegion) Debugf("region named: %s, is not recognized", stringRegion) } return } // canStringBeRegion test if the string can be a region, if it can, returns the string as is, otherwise it // returns an error var blankRegex = regexp.MustCompile("\\s") func canStringBeRegion(stringRegion string) (region string, err error) { if blankRegex.MatchString(stringRegion) || stringRegion == "" { return "", fmt.Errorf("region can not be empty or have spaces") } return stringRegion, nil } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/configuration.go������������������������0000664�0000000�0000000�00000037621�13771713062�0026717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "crypto/rsa" "errors" "fmt" "io/ioutil" "os" "path" "regexp" "strings" ) // ConfigurationProvider wraps information about the account owner type ConfigurationProvider interface { KeyProvider TenancyOCID() (string, error) UserOCID() (string, error) KeyFingerprint() (string, error) Region() (string, error) } // IsConfigurationProviderValid Tests all parts of the configuration provider do not return an error func IsConfigurationProviderValid(conf ConfigurationProvider) (ok bool, err error) { baseFn := []func() (string, error){conf.TenancyOCID, conf.UserOCID, conf.KeyFingerprint, conf.Region, conf.KeyID} for _, fn := range baseFn { _, err = fn() ok = err == nil if err != nil { return } } _, err = conf.PrivateRSAKey() ok = err == nil if err != nil { return } return true, nil } // rawConfigurationProvider allows a user to simply construct a configuration provider from raw values. type rawConfigurationProvider struct { tenancy string user string region string fingerprint string privateKey string privateKeyPassphrase *string } // NewRawConfigurationProvider will create a ConfigurationProvider with the arguments of the function func NewRawConfigurationProvider(tenancy, user, region, fingerprint, privateKey string, privateKeyPassphrase *string) ConfigurationProvider { return rawConfigurationProvider{tenancy, user, region, fingerprint, privateKey, privateKeyPassphrase} } func (p rawConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, err error) { return PrivateKeyFromBytes([]byte(p.privateKey), p.privateKeyPassphrase) } func (p rawConfigurationProvider) KeyID() (keyID string, err error) { tenancy, err := p.TenancyOCID() if err != nil { return } user, err := p.UserOCID() if err != nil { return } fingerprint, err := p.KeyFingerprint() if err != nil { return } return fmt.Sprintf("%s/%s/%s", tenancy, user, fingerprint), nil } func (p rawConfigurationProvider) TenancyOCID() (string, error) { if p.tenancy == "" { return "", fmt.Errorf("tenancy OCID can not be empty") } return p.tenancy, nil } func (p rawConfigurationProvider) UserOCID() (string, error) { if p.user == "" { return "", fmt.Errorf("user OCID can not be empty") } return p.user, nil } func (p rawConfigurationProvider) KeyFingerprint() (string, error) { if p.fingerprint == "" { return "", fmt.Errorf("fingerprint can not be empty") } return p.fingerprint, nil } func (p rawConfigurationProvider) Region() (string, error) { return canStringBeRegion(p.region) } // environmentConfigurationProvider reads configuration from environment variables type environmentConfigurationProvider struct { PrivateKeyPassword string EnvironmentVariablePrefix string } // ConfigurationProviderEnvironmentVariables creates a ConfigurationProvider from a uniform set of environment variables starting with a prefix // The env variables should look like: [prefix]_private_key_path, [prefix]_tenancy_ocid, [prefix]_user_ocid, [prefix]_fingerprint // [prefix]_region func ConfigurationProviderEnvironmentVariables(environmentVariablePrefix, privateKeyPassword string) ConfigurationProvider { return environmentConfigurationProvider{EnvironmentVariablePrefix: environmentVariablePrefix, PrivateKeyPassword: privateKeyPassword} } func (p environmentConfigurationProvider) String() string { return fmt.Sprintf("Configuration provided by environment variables prefixed with: %s", p.EnvironmentVariablePrefix) } func (p environmentConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, err error) { environmentVariable := fmt.Sprintf("%s_%s", p.EnvironmentVariablePrefix, "private_key_path") var ok bool var value string if value, ok = os.LookupEnv(environmentVariable); !ok { return nil, fmt.Errorf("can not read PrivateKey from env variable: %s", environmentVariable) } expandedPath := expandPath(value) pemFileContent, err := ioutil.ReadFile(expandedPath) if err != nil { Debugln("Can not read PrivateKey location from environment variable: " + environmentVariable) return } key, err = PrivateKeyFromBytes(pemFileContent, &p.PrivateKeyPassword) return } func (p environmentConfigurationProvider) KeyID() (keyID string, err error) { ocid, err := p.TenancyOCID() if err != nil { return } userocid, err := p.UserOCID() if err != nil { return } fingerprint, err := p.KeyFingerprint() if err != nil { return } return fmt.Sprintf("%s/%s/%s", ocid, userocid, fingerprint), nil } func (p environmentConfigurationProvider) TenancyOCID() (value string, err error) { environmentVariable := fmt.Sprintf("%s_%s", p.EnvironmentVariablePrefix, "tenancy_ocid") var ok bool if value, ok = os.LookupEnv(environmentVariable); !ok { err = fmt.Errorf("can not read Tenancy from environment variable %s", environmentVariable) } return } func (p environmentConfigurationProvider) UserOCID() (value string, err error) { environmentVariable := fmt.Sprintf("%s_%s", p.EnvironmentVariablePrefix, "user_ocid") var ok bool if value, ok = os.LookupEnv(environmentVariable); !ok { err = fmt.Errorf("can not read user id from environment variable %s", environmentVariable) } return } func (p environmentConfigurationProvider) KeyFingerprint() (value string, err error) { environmentVariable := fmt.Sprintf("%s_%s", p.EnvironmentVariablePrefix, "fingerprint") var ok bool if value, ok = os.LookupEnv(environmentVariable); !ok { err = fmt.Errorf("can not read fingerprint from environment variable %s", environmentVariable) } return } func (p environmentConfigurationProvider) Region() (value string, err error) { environmentVariable := fmt.Sprintf("%s_%s", p.EnvironmentVariablePrefix, "region") var ok bool if value, ok = os.LookupEnv(environmentVariable); !ok { err = fmt.Errorf("can not read region from environment variable %s", environmentVariable) return value, err } return canStringBeRegion(value) } // fileConfigurationProvider. reads configuration information from a file type fileConfigurationProvider struct { //The path to the configuration file ConfigPath string //The password for the private key PrivateKeyPassword string //The profile for the configuration Profile string //ConfigFileInfo FileInfo *configFileInfo } // ConfigurationProviderFromFile creates a configuration provider from a configuration file // by reading the "DEFAULT" profile func ConfigurationProviderFromFile(configFilePath, privateKeyPassword string) (ConfigurationProvider, error) { if configFilePath == "" { return nil, fmt.Errorf("config file path can not be empty") } return fileConfigurationProvider{ ConfigPath: configFilePath, PrivateKeyPassword: privateKeyPassword, Profile: "DEFAULT"}, nil } // ConfigurationProviderFromFileWithProfile creates a configuration provider from a configuration file // and the given profile func ConfigurationProviderFromFileWithProfile(configFilePath, profile, privateKeyPassword string) (ConfigurationProvider, error) { if configFilePath == "" { return nil, fmt.Errorf("config file path can not be empty") } return fileConfigurationProvider{ ConfigPath: configFilePath, PrivateKeyPassword: privateKeyPassword, Profile: profile}, nil } type configFileInfo struct { UserOcid, Fingerprint, KeyFilePath, TenancyOcid, Region, Passphrase string PresentConfiguration byte } const ( hasTenancy = 1 << iota hasUser hasFingerprint hasRegion hasKeyFile hasPassphrase none ) var profileRegex = regexp.MustCompile(`^\[(.*)\]`) func parseConfigFile(data []byte, profile string) (info *configFileInfo, err error) { if len(data) == 0 { return nil, fmt.Errorf("configuration file content is empty") } content := string(data) splitContent := strings.Split(content, "\n") //Look for profile for i, line := range splitContent { if match := profileRegex.FindStringSubmatch(line); match != nil && len(match) > 1 && match[1] == profile { start := i + 1 return parseConfigAtLine(start, splitContent) } } return nil, fmt.Errorf("configuration file did not contain profile: %s", profile) } func parseConfigAtLine(start int, content []string) (info *configFileInfo, err error) { var configurationPresent byte info = &configFileInfo{} for i := start; i < len(content); i++ { line := content[i] if profileRegex.MatchString(line) { break } if !strings.Contains(line, "=") { continue } splits := strings.Split(line, "=") switch key, value := strings.TrimSpace(splits[0]), strings.TrimSpace(splits[1]); strings.ToLower(key) { case "passphrase", "pass_phrase": configurationPresent = configurationPresent | hasPassphrase info.Passphrase = value case "user": configurationPresent = configurationPresent | hasUser info.UserOcid = value case "fingerprint": configurationPresent = configurationPresent | hasFingerprint info.Fingerprint = value case "key_file": configurationPresent = configurationPresent | hasKeyFile info.KeyFilePath = value case "tenancy": configurationPresent = configurationPresent | hasTenancy info.TenancyOcid = value case "region": configurationPresent = configurationPresent | hasRegion info.Region = value } } info.PresentConfiguration = configurationPresent return } // cleans and expands the path if it contains a tilde , returns the expanded path or the input path as is if not expansion // was performed func expandPath(filepath string) (expandedPath string) { cleanedPath := path.Clean(filepath) expandedPath = cleanedPath if strings.HasPrefix(cleanedPath, "~") { rest := cleanedPath[2:] expandedPath = path.Join(getHomeFolder(), rest) } return } func openConfigFile(configFilePath string) (data []byte, err error) { expandedPath := expandPath(configFilePath) data, err = ioutil.ReadFile(expandedPath) if err != nil { err = fmt.Errorf("can not read config file: %s due to: %s", configFilePath, err.Error()) } return } func (p fileConfigurationProvider) String() string { return fmt.Sprintf("Configuration provided by file: %s", p.ConfigPath) } func (p fileConfigurationProvider) readAndParseConfigFile() (info *configFileInfo, err error) { if p.FileInfo != nil { return p.FileInfo, nil } if p.ConfigPath == "" { return nil, fmt.Errorf("configuration path can not be empty") } data, err := openConfigFile(p.ConfigPath) if err != nil { err = fmt.Errorf("error while parsing config file: %s. Due to: %s", p.ConfigPath, err.Error()) return } p.FileInfo, err = parseConfigFile(data, p.Profile) return p.FileInfo, err } func presentOrError(value string, expectedConf, presentConf byte, confMissing string) (string, error) { if presentConf&expectedConf == expectedConf { return value, nil } return "", errors.New(confMissing + " configuration is missing from file") } func (p fileConfigurationProvider) TenancyOCID() (value string, err error) { info, err := p.readAndParseConfigFile() if err != nil { err = fmt.Errorf("can not read tenancy configuration due to: %s", err.Error()) return } value, err = presentOrError(info.TenancyOcid, hasTenancy, info.PresentConfiguration, "tenancy") return } func (p fileConfigurationProvider) UserOCID() (value string, err error) { info, err := p.readAndParseConfigFile() if err != nil { err = fmt.Errorf("can not read tenancy configuration due to: %s", err.Error()) return } value, err = presentOrError(info.UserOcid, hasUser, info.PresentConfiguration, "user") return } func (p fileConfigurationProvider) KeyFingerprint() (value string, err error) { info, err := p.readAndParseConfigFile() if err != nil { err = fmt.Errorf("can not read tenancy configuration due to: %s", err.Error()) return } value, err = presentOrError(info.Fingerprint, hasFingerprint, info.PresentConfiguration, "fingerprint") return } func (p fileConfigurationProvider) KeyID() (keyID string, err error) { info, err := p.readAndParseConfigFile() if err != nil { err = fmt.Errorf("can not read tenancy configuration due to: %s", err.Error()) return } return fmt.Sprintf("%s/%s/%s", info.TenancyOcid, info.UserOcid, info.Fingerprint), nil } func (p fileConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, err error) { info, err := p.readAndParseConfigFile() if err != nil { err = fmt.Errorf("can not read tenancy configuration due to: %s", err.Error()) return } filePath, err := presentOrError(info.KeyFilePath, hasKeyFile, info.PresentConfiguration, "key file path") if err != nil { return } expandedPath := expandPath(filePath) pemFileContent, err := ioutil.ReadFile(expandedPath) if err != nil { err = fmt.Errorf("can not read PrivateKey from configuration file due to: %s", err.Error()) return } password := p.PrivateKeyPassword if password == "" && ((info.PresentConfiguration & hasPassphrase) == hasPassphrase) { password = info.Passphrase } key, err = PrivateKeyFromBytes(pemFileContent, &password) return } func (p fileConfigurationProvider) Region() (value string, err error) { info, err := p.readAndParseConfigFile() if err != nil { err = fmt.Errorf("can not read region configuration due to: %s", err.Error()) return } value, err = presentOrError(info.Region, hasRegion, info.PresentConfiguration, "region") if err != nil { return } return canStringBeRegion(value) } // A configuration provider that look for information in multiple configuration providers type composingConfigurationProvider struct { Providers []ConfigurationProvider } // ComposingConfigurationProvider creates a composing configuration provider with the given slice of configuration providers // A composing provider will return the configuration of the first provider that has the required property // if no provider has the property it will return an error. func ComposingConfigurationProvider(providers []ConfigurationProvider) (ConfigurationProvider, error) { if len(providers) == 0 { return nil, fmt.Errorf("providers can not be an empty slice") } for i, p := range providers { if p == nil { return nil, fmt.Errorf("provider in position: %d is nil. ComposingConfiurationProvider does not support nil values", i) } } return composingConfigurationProvider{Providers: providers}, nil } func (c composingConfigurationProvider) TenancyOCID() (string, error) { for _, p := range c.Providers { val, err := p.TenancyOCID() if err == nil { return val, nil } } return "", fmt.Errorf("did not find a proper configuration for tenancy") } func (c composingConfigurationProvider) UserOCID() (string, error) { for _, p := range c.Providers { val, err := p.UserOCID() if err == nil { return val, nil } } return "", fmt.Errorf("did not find a proper configuration for user") } func (c composingConfigurationProvider) KeyFingerprint() (string, error) { for _, p := range c.Providers { val, err := p.KeyFingerprint() if err == nil { return val, nil } } return "", fmt.Errorf("did not find a proper configuration for keyFingerprint") } func (c composingConfigurationProvider) Region() (string, error) { for _, p := range c.Providers { val, err := p.Region() if err == nil { return val, nil } } return "", fmt.Errorf("did not find a proper configuration for region") } func (c composingConfigurationProvider) KeyID() (string, error) { for _, p := range c.Providers { val, err := p.KeyID() if err == nil { return val, nil } } return "", fmt.Errorf("did not find a proper configuration for key id") } func (c composingConfigurationProvider) PrivateRSAKey() (*rsa.PrivateKey, error) { for _, p := range c.Providers { val, err := p.PrivateRSAKey() if err == nil { return val, nil } } return nil, fmt.Errorf("did not find a proper configuration for private key") } ���������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/errors.go�������������������������������0000664�0000000�0000000�00000006223�13771713062�0025356�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "encoding/json" "fmt" "io/ioutil" "net/http" ) // ServiceError models all potential errors generated the service call type ServiceError interface { // The http status code of the error GetHTTPStatusCode() int // The human-readable error string as sent by the service GetMessage() string // A short error code that defines the error, meant for programmatic parsing. // See https://docs.cloud.oracle.com/Content/API/References/apierrors.htm GetCode() string // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. GetOpcRequestID() string } type servicefailure struct { StatusCode int Code string `json:"code,omitempty"` Message string `json:"message,omitempty"` OpcRequestID string `json:"opc-request-id"` } func newServiceFailureFromResponse(response *http.Response) error { var err error se := servicefailure{ StatusCode: response.StatusCode, Code: "BadErrorResponse", OpcRequestID: response.Header.Get("opc-request-id")} //If there is an error consume the body, entirely body, err := ioutil.ReadAll(response.Body) if err != nil { se.Message = fmt.Sprintf("The body of the response was not readable, due to :%s", err.Error()) return se } err = json.Unmarshal(body, &se) if err != nil { Debugf("Error response could not be parsed due to: %s", err.Error()) se.Message = fmt.Sprintf("Failed to parse json from response body due to: %s. With response body %s.", err.Error(), string(body[:])) return se } return se } func (se servicefailure) Error() string { return fmt.Sprintf("Service error:%s. %s. http status code: %d. Opc request id: %s", se.Code, se.Message, se.StatusCode, se.OpcRequestID) } func (se servicefailure) GetHTTPStatusCode() int { return se.StatusCode } func (se servicefailure) GetMessage() string { return se.Message } func (se servicefailure) GetCode() string { return se.Code } func (se servicefailure) GetOpcRequestID() string { return se.OpcRequestID } // IsServiceError returns false if the error is not service side, otherwise true // additionally it returns an interface representing the ServiceError func IsServiceError(err error) (failure ServiceError, ok bool) { failure, ok = err.(servicefailure) return } type deadlineExceededByBackoffError struct{} func (deadlineExceededByBackoffError) Error() string { return "now() + computed backoff duration exceeds request deadline" } // DeadlineExceededByBackoff is the error returned by Call() when GetNextDuration() returns a time.Duration that would // force the user to wait past the request deadline before re-issuing a request. This enables us to exit early, since // we cannot succeed based on the configured retry policy. var DeadlineExceededByBackoff error = deadlineExceededByBackoffError{} �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/helpers.go������������������������������0000664�0000000�0000000�00000014514�13771713062�0025506�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "reflect" "strconv" "strings" "time" ) // String returns a pointer to the provided string func String(value string) *string { return &value } // Int returns a pointer to the provided int func Int(value int) *int { return &value } // Int64 returns a pointer to the provided int64 func Int64(value int64) *int64 { return &value } // Uint returns a pointer to the provided uint func Uint(value uint) *uint { return &value } //Float32 returns a pointer to the provided float32 func Float32(value float32) *float32 { return &value } //Float64 returns a pointer to the provided float64 func Float64(value float64) *float64 { return &value } //Bool returns a pointer to the provided bool func Bool(value bool) *bool { return &value } //PointerString prints the values of pointers in a struct //Producing a human friendly string for an struct with pointers. //useful when debugging the values of a struct func PointerString(datastruct interface{}) (representation string) { val := reflect.ValueOf(datastruct) typ := reflect.TypeOf(datastruct) all := make([]string, 2) all = append(all, "{") for i := 0; i < typ.NumField(); i++ { sf := typ.Field(i) //unexported if sf.PkgPath != "" && !sf.Anonymous { continue } sv := val.Field(i) stringValue := "" if isNil(sv) { stringValue = fmt.Sprintf("%s=<nil>", sf.Name) } else { if sv.Type().Kind() == reflect.Ptr { sv = sv.Elem() } stringValue = fmt.Sprintf("%s=%v", sf.Name, sv) } all = append(all, stringValue) } all = append(all, "}") representation = strings.TrimSpace(strings.Join(all, " ")) return } // SDKTime a struct that parses/renders to/from json using RFC339 date-time information type SDKTime struct { time.Time } // SDKDate a struct that parses/renders to/from json using only date information type SDKDate struct { //Date date information Date time.Time } func sdkTimeFromTime(t time.Time) SDKTime { return SDKTime{t} } func sdkDateFromTime(t time.Time) SDKDate { return SDKDate{Date: t} } func formatTime(t SDKTime) string { return t.Format(sdkTimeFormat) } func formatDate(t SDKDate) string { return t.Date.Format(sdkDateFormat) } func now() *SDKTime { t := SDKTime{time.Now()} return &t } var timeType = reflect.TypeOf(SDKTime{}) var timeTypePtr = reflect.TypeOf(&SDKTime{}) var sdkDateType = reflect.TypeOf(SDKDate{}) var sdkDateTypePtr = reflect.TypeOf(&SDKDate{}) //Formats for sdk supported time representations const sdkTimeFormat = time.RFC3339Nano const rfc1123OptionalLeadingDigitsInDay = "Mon, _2 Jan 2006 15:04:05 MST" const sdkDateFormat = "2006-01-02" func tryParsingTimeWithValidFormatsForHeaders(data []byte, headerName string) (t time.Time, err error) { header := strings.ToLower(headerName) switch header { case "lastmodified", "date": t, err = tryParsing(data, time.RFC3339Nano, time.RFC3339, time.RFC1123, rfc1123OptionalLeadingDigitsInDay, time.RFC850, time.ANSIC) return default: //By default we parse with RFC3339 t, err = time.Parse(sdkTimeFormat, string(data)) return } } func tryParsing(data []byte, layouts ...string) (tm time.Time, err error) { datestring := string(data) for _, l := range layouts { tm, err = time.Parse(l, datestring) if err == nil { return } } err = fmt.Errorf("Could not parse time: %s with formats: %s", datestring, layouts[:]) return } // String returns string representation of SDKDate func (t *SDKDate) String() string { return t.Date.Format(sdkDateFormat) } // NewSDKDateFromString parses the dateString into SDKDate func NewSDKDateFromString(dateString string) (*SDKDate, error) { parsedTime, err := time.Parse(sdkDateFormat, dateString) if err != nil { return nil, err } return &SDKDate{Date: parsedTime}, nil } // UnmarshalJSON unmarshals from json func (t *SDKTime) UnmarshalJSON(data []byte) (e error) { s := string(data) if s == "null" { t.Time = time.Time{} } else { //Try parsing with RFC3339 t.Time, e = time.Parse(`"`+sdkTimeFormat+`"`, string(data)) } return } // MarshalJSON marshals to JSON func (t *SDKTime) MarshalJSON() (buff []byte, e error) { s := t.Format(sdkTimeFormat) buff = []byte(`"` + s + `"`) return } // UnmarshalJSON unmarshals from json func (t *SDKDate) UnmarshalJSON(data []byte) (e error) { if string(data) == `"null"` { t.Date = time.Time{} return } t.Date, e = tryParsing(data, strconv.Quote(sdkDateFormat), ) return } // MarshalJSON marshals to JSON func (t *SDKDate) MarshalJSON() (buff []byte, e error) { s := t.Date.Format(sdkDateFormat) buff = []byte(strconv.Quote(s)) return } // PrivateKeyFromBytes is a helper function that will produce a RSA private // key from bytes. This function is deprecated in favour of PrivateKeyFromBytesWithPassword // Deprecated func PrivateKeyFromBytes(pemData []byte, password *string) (key *rsa.PrivateKey, e error) { if password == nil { return PrivateKeyFromBytesWithPassword(pemData, nil) } return PrivateKeyFromBytesWithPassword(pemData, []byte(*password)) } // PrivateKeyFromBytesWithPassword is a helper function that will produce a RSA private // key from bytes and a password. func PrivateKeyFromBytesWithPassword(pemData, password []byte) (key *rsa.PrivateKey, e error) { if pemBlock, _ := pem.Decode(pemData); pemBlock != nil { decrypted := pemBlock.Bytes if x509.IsEncryptedPEMBlock(pemBlock) { if password == nil { e = fmt.Errorf("private key password is required for encrypted private keys") return } if decrypted, e = x509.DecryptPEMBlock(pemBlock, password); e != nil { return } } key, e = x509.ParsePKCS1PrivateKey(decrypted) } else { e = fmt.Errorf("PEM data was not found in buffer") return } return } func generateRandUUID() (string, error) { b := make([]byte, 16) _, err := rand.Read(b) if err != nil { return "", err } uuid := fmt.Sprintf("%x%x%x%x%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) return uuid, nil } func makeACopy(original []string) []string { tmp := make([]string, len(original)) copy(tmp, original) return tmp } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/http.go���������������������������������0000664�0000000�0000000�00000075062�13771713062�0025030�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "net/url" "reflect" "regexp" "strconv" "strings" "time" ) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Request Marshaling //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////// func isNil(v reflect.Value) bool { return v.Kind() == reflect.Ptr && v.IsNil() } // Returns the string representation of a reflect.Value // Only transforms primitive values func toStringValue(v reflect.Value, field reflect.StructField) (string, error) { if v.Kind() == reflect.Ptr { if v.IsNil() { return "", fmt.Errorf("can not marshal a nil pointer") } v = v.Elem() } if v.Type() == timeType { t := v.Interface().(SDKTime) return formatTime(t), nil } if v.Type() == sdkDateType { t := v.Interface().(SDKDate) return formatDate(t), nil } switch v.Kind() { case reflect.Bool: return strconv.FormatBool(v.Bool()), nil case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: return strconv.FormatInt(v.Int(), 10), nil case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return strconv.FormatUint(v.Uint(), 10), nil case reflect.String: return v.String(), nil case reflect.Float32: return strconv.FormatFloat(v.Float(), 'f', -1, 32), nil case reflect.Float64: return strconv.FormatFloat(v.Float(), 'f', -1, 64), nil default: return "", fmt.Errorf("marshaling structure to a http.Request does not support field named: %s of type: %v", field.Name, v.Type().String()) } } func addBinaryBody(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { readCloser, ok := value.Interface().(io.ReadCloser) isMandatory, err := strconv.ParseBool(field.Tag.Get("mandatory")) if err != nil { return fmt.Errorf("mandatory tag is not valid for field %s", field.Name) } if isMandatory && !ok { e = fmt.Errorf("body of the request is mandatory and needs to be an io.ReadCloser interface. Can not marshal body of binary request") return } request.Body = readCloser //Set the default content type to application/octet-stream if not set if request.Header.Get(requestHeaderContentType) == "" { request.Header.Set(requestHeaderContentType, "application/octet-stream") } return nil } // getTaggedNilFieldNameOrError, evaluates if a field with json and non mandatory tags is nil // returns the json tag name, or an error if the tags are incorrectly present func getTaggedNilFieldNameOrError(field reflect.StructField, fieldValue reflect.Value) (bool, string, error) { currentTag := field.Tag jsonTag := currentTag.Get("json") if jsonTag == "" { return false, "", fmt.Errorf("json tag is not valid for field %s", field.Name) } partsJSONTag := strings.Split(jsonTag, ",") nameJSONField := partsJSONTag[0] if _, ok := currentTag.Lookup("mandatory"); !ok { //No mandatory field set, no-op return false, nameJSONField, nil } isMandatory, err := strconv.ParseBool(currentTag.Get("mandatory")) if err != nil { return false, "", fmt.Errorf("mandatory tag is not valid for field %s", field.Name) } // If the field is marked as mandatory, no-op if isMandatory { return false, nameJSONField, nil } Debugf("Adjusting tag: mandatory is false and json tag is valid on field: %s", field.Name) // If the field can not be nil, then no-op if !isNillableType(&fieldValue) { Debugf("WARNING json field is tagged with mandatory flags, but the type can not be nil, field name: %s", field.Name) return false, nameJSONField, nil } // If field value is nil, tag it as omitEmpty return fieldValue.IsNil(), nameJSONField, nil } // isNillableType returns true if the filed can be nil func isNillableType(value *reflect.Value) bool { k := value.Kind() switch k { case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Interface, reflect.Slice: return true } return false } // omitNilFieldsInJSON, removes json keys whose struct value is nil, and the field is tagged with the json and // mandatory:false tags func omitNilFieldsInJSON(data interface{}, value reflect.Value) (interface{}, error) { switch value.Kind() { case reflect.Struct: jsonMap := data.(map[string]interface{}) fieldType := value.Type() for i := 0; i < fieldType.NumField(); i++ { currentField := fieldType.Field(i) //unexported skip if currentField.PkgPath != "" { continue } //Does not have json tag, no-op if _, ok := currentField.Tag.Lookup("json"); !ok { continue } currentFieldValue := value.Field(i) ok, jsonFieldName, err := getTaggedNilFieldNameOrError(currentField, currentFieldValue) if err != nil { return nil, fmt.Errorf("can not omit nil fields for field: %s, due to: %s", currentField.Name, err.Error()) } //Delete the struct field from the json representation if ok { delete(jsonMap, jsonFieldName) continue } // Check to make sure the field is part of the json representation of the value if _, contains := jsonMap[jsonFieldName]; !contains { Debugf("Field %s is not present in json, omitting", jsonFieldName) continue } if currentFieldValue.Type() == timeType || currentFieldValue.Type() == timeTypePtr || currentField.Type == sdkDateType || currentField.Type == sdkDateTypePtr { continue } // does it need to be adjusted? var adjustedValue interface{} adjustedValue, err = omitNilFieldsInJSON(jsonMap[jsonFieldName], currentFieldValue) if err != nil { return nil, fmt.Errorf("can not omit nil fields for field: %s, due to: %s", currentField.Name, err.Error()) } jsonMap[jsonFieldName] = adjustedValue } return jsonMap, nil case reflect.Slice, reflect.Array: // Special case: a []byte may have been marshalled as a string if data != nil && reflect.TypeOf(data).Kind() == reflect.String && value.Type().Elem().Kind() == reflect.Uint8 { return data, nil } jsonList, ok := data.([]interface{}) if !ok { return nil, fmt.Errorf("can not omit nil fields, data was expected to be a not-nil list") } newList := make([]interface{}, len(jsonList)) var err error for i, val := range jsonList { newList[i], err = omitNilFieldsInJSON(val, value.Index(i)) if err != nil { return nil, err } } return newList, nil case reflect.Map: jsonMap, ok := data.(map[string]interface{}) if !ok { return nil, fmt.Errorf("can not omit nil fields, data was expected to be a not-nil map") } newMap := make(map[string]interface{}, len(jsonMap)) var err error for key, val := range jsonMap { newMap[key], err = omitNilFieldsInJSON(val, value.MapIndex(reflect.ValueOf(key))) if err != nil { return nil, err } } return newMap, nil case reflect.Ptr, reflect.Interface: valPtr := value.Elem() return omitNilFieldsInJSON(data, valPtr) default: //Otherwise no-op return data, nil } } // removeNilFieldsInJSONWithTaggedStruct remove struct fields tagged with json and mandatory false // that are nil func removeNilFieldsInJSONWithTaggedStruct(rawJSON []byte, value reflect.Value) ([]byte, error) { var rawInterface interface{} decoder := json.NewDecoder(bytes.NewBuffer(rawJSON)) decoder.UseNumber() var err error if err = decoder.Decode(&rawInterface); err != nil { return nil, err } fixedMap, err := omitNilFieldsInJSON(rawInterface, value) if err != nil { return nil, err } return json.Marshal(fixedMap) } func addToBody(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { Debugln("Marshaling to body from field:", field.Name) if request.Body != nil { Logf("The body of the request is already set. Structure: %s will overwrite it\n", field.Name) } tag := field.Tag encoding := tag.Get("encoding") if encoding == "binary" { return addBinaryBody(request, value, field) } rawJSON, e := json.Marshal(value.Interface()) if e != nil { return } marshaled, e := removeNilFieldsInJSONWithTaggedStruct(rawJSON, value) if e != nil { return } if defaultLogger.LogLevel() == verboseLogging { Debugf("Marshaled body is: %s\n", string(marshaled)) } bodyBytes := bytes.NewReader(marshaled) request.ContentLength = int64(bodyBytes.Len()) request.Header.Set(requestHeaderContentLength, strconv.FormatInt(request.ContentLength, 10)) request.Header.Set(requestHeaderContentType, "application/json") request.Body = ioutil.NopCloser(bodyBytes) request.GetBody = func() (io.ReadCloser, error) { return ioutil.NopCloser(bodyBytes), nil } return } func addToQuery(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { Debugln("Marshaling to query from field: ", field.Name) if request.URL == nil { request.URL = &url.URL{} } query := request.URL.Query() var queryParameterValue, queryParameterName string if queryParameterName = field.Tag.Get("name"); queryParameterName == "" { return fmt.Errorf("marshaling request to a query requires the 'name' tag for field: %s ", field.Name) } mandatory, _ := strconv.ParseBool(strings.ToLower(field.Tag.Get("mandatory"))) //If mandatory and nil. Error out if mandatory && isNil(value) { return fmt.Errorf("marshaling request to a header requires not nil pointer for field: %s", field.Name) } //if not mandatory and nil. Omit if !mandatory && isNil(value) { Debugf("Query parameter value is not mandatory and is nil pointer in field: %s. Skipping query", field.Name) return } encoding := strings.ToLower(field.Tag.Get("collectionFormat")) var collectionFormatStringValues []string switch encoding { case "csv", "multi": if value.Kind() != reflect.Slice && value.Kind() != reflect.Array { e = fmt.Errorf("query parameter is tagged as csv or multi yet its type is neither an Array nor a Slice: %s", field.Name) break } numOfElements := value.Len() collectionFormatStringValues = make([]string, numOfElements) for i := 0; i < numOfElements; i++ { collectionFormatStringValues[i], e = toStringValue(value.Index(i), field) if e != nil { break } } queryParameterValue = strings.Join(collectionFormatStringValues, ",") case "": queryParameterValue, e = toStringValue(value, field) default: e = fmt.Errorf("encoding of type %s is not supported for query param: %s", encoding, field.Name) } if e != nil { return } //check for tag "omitEmpty", this is done to accomodate unset fields that do not //support an empty string: enums in query params if omitEmpty, present := field.Tag.Lookup("omitEmpty"); present { omitEmptyBool, _ := strconv.ParseBool(strings.ToLower(omitEmpty)) if queryParameterValue != "" || !omitEmptyBool { addToQueryForEncoding(&query, encoding, queryParameterName, queryParameterValue, collectionFormatStringValues) } else { Debugf("Omitting %s, is empty and omitEmpty tag is set", field.Name) } } else { addToQueryForEncoding(&query, encoding, queryParameterName, queryParameterValue, collectionFormatStringValues) } request.URL.RawQuery = query.Encode() return } func addToQueryForEncoding(query *url.Values, encoding string, queryParameterName string, queryParameterValue string, collectionFormatStringValues []string) { if encoding == "multi" { for _, stringValue := range collectionFormatStringValues { query.Add(queryParameterName, stringValue) } } else { query.Set(queryParameterName, queryParameterValue) } } // Adds to the path of the url in the order they appear in the structure func addToPath(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { var additionalURLPathPart string if additionalURLPathPart, e = toStringValue(value, field); e != nil { return fmt.Errorf("can not marshal to path in request for field %s. Due to %s", field.Name, e.Error()) } // path should not be empty for any operations if len(additionalURLPathPart) == 0 { return fmt.Errorf("value cannot be empty for field %s in path", field.Name) } if request.URL == nil { request.URL = &url.URL{} request.URL.Path = "" } var currentURLPath = request.URL.Path var templatedPathRegex, _ = regexp.Compile(".*{.+}.*") if !templatedPathRegex.MatchString(currentURLPath) { Debugln("Marshaling request to path by appending field:", field.Name) allPath := []string{currentURLPath, additionalURLPathPart} request.URL.Path = strings.Join(allPath, "/") } else { var fieldName string if fieldName = field.Tag.Get("name"); fieldName == "" { e = fmt.Errorf("marshaling request to path name and template requires a 'name' tag for field: %s", field.Name) return } urlTemplate := currentURLPath Debugln("Marshaling to path from field: ", field.Name, " in template: ", urlTemplate) request.URL.Path = strings.Replace(urlTemplate, "{"+fieldName+"}", additionalURLPathPart, -1) } return } func setWellKnownHeaders(request *http.Request, headerName, headerValue string) (e error) { switch strings.ToLower(headerName) { case "content-length": var len int len, e = strconv.Atoi(headerValue) if e != nil { return } request.ContentLength = int64(len) } return nil } func addToHeader(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { Debugln("Marshaling to header from field: ", field.Name) if request.Header == nil { request.Header = http.Header{} } var headerName, headerValue string if headerName = field.Tag.Get("name"); headerName == "" { return fmt.Errorf("marshaling request to a header requires the 'name' tag for field: %s", field.Name) } mandatory, _ := strconv.ParseBool(strings.ToLower(field.Tag.Get("mandatory"))) //If mandatory and nil. Error out if mandatory && isNil(value) { return fmt.Errorf("marshaling request to a header requires not nil pointer for field: %s", field.Name) } // generate opc-request-id if header value is nil and header name matches value = generateOpcRequestID(headerName, value) //if not mandatory and nil. Omit if !mandatory && isNil(value) { Debugf("Header value is not mandatory and is nil pointer in field: %s. Skipping header", field.Name) return } //Otherwise get value and set header if headerValue, e = toStringValue(value, field); e != nil { return } if e = setWellKnownHeaders(request, headerName, headerValue); e != nil { return } request.Header.Add(headerName, headerValue) return } // Header collection is a map of string to string that gets rendered as individual headers with a given prefix func addToHeaderCollection(request *http.Request, value reflect.Value, field reflect.StructField) (e error) { Debugln("Marshaling to header-collection from field:", field.Name) if request.Header == nil { request.Header = http.Header{} } var headerPrefix string if headerPrefix = field.Tag.Get("prefix"); headerPrefix == "" { return fmt.Errorf("marshaling request to a header requires the 'prefix' tag for field: %s", field.Name) } mandatory, _ := strconv.ParseBool(strings.ToLower(field.Tag.Get("mandatory"))) //If mandatory and nil. Error out if mandatory && isNil(value) { return fmt.Errorf("marshaling request to a header requires not nil pointer for field: %s", field.Name) } //if not mandatory and nil. Omit if !mandatory && isNil(value) { Debugf("Header value is not mandatory and is nil pointer in field: %s. Skipping header", field.Name) return } //cast to map headerValues, ok := value.Interface().(map[string]string) if !ok { e = fmt.Errorf("header fields need to be of type map[string]string") return } for k, v := range headerValues { headerName := fmt.Sprintf("%s%s", headerPrefix, k) request.Header.Set(headerName, v) } return } // Makes sure the incoming structure is able to be marshalled // to a request func checkForValidRequestStruct(s interface{}) (*reflect.Value, error) { val := reflect.ValueOf(s) for val.Kind() == reflect.Ptr { if val.IsNil() { return nil, fmt.Errorf("can not marshal to request a pointer to structure") } val = val.Elem() } if s == nil { return nil, fmt.Errorf("can not marshal to request a nil structure") } if val.Kind() != reflect.Struct { return nil, fmt.Errorf("can not marshal to request, expects struct input. Got %v", val.Kind()) } return &val, nil } // Populates the parts of a request by reading tags in the passed structure // nested structs are followed recursively depth-first. func structToRequestPart(request *http.Request, val reflect.Value) (err error) { typ := val.Type() for i := 0; i < typ.NumField(); i++ { if err != nil { return } sf := typ.Field(i) //unexported if sf.PkgPath != "" && !sf.Anonymous { continue } sv := val.Field(i) tag := sf.Tag.Get("contributesTo") switch tag { case "header": err = addToHeader(request, sv, sf) case "header-collection": err = addToHeaderCollection(request, sv, sf) case "path": err = addToPath(request, sv, sf) case "query": err = addToQuery(request, sv, sf) case "body": err = addToBody(request, sv, sf) case "": Debugln(sf.Name, " does not contain contributes tag. Skipping.") default: err = fmt.Errorf("can not marshal field: %s. It needs to contain valid contributesTo tag", sf.Name) } } //If headers are and the content type was not set, we default to application/json if request.Header != nil && request.Header.Get(requestHeaderContentType) == "" { request.Header.Set(requestHeaderContentType, "application/json") } return } // HTTPRequestMarshaller marshals a structure to an http request using tag values in the struct // The marshaller tag should like the following // type A struct { // ANumber string `contributesTo="query" name="number"` // TheBody `contributesTo="body"` // } // where the contributesTo tag can be: header, path, query, body // and the 'name' tag is the name of the value used in the http request(not applicable for path) // If path is specified as part of the tag, the values are appened to the url path // in the order they appear in the structure // The current implementation only supports primitive types, except for the body tag, which needs a struct type. // The body of a request will be marshaled using the tags of the structure func HTTPRequestMarshaller(requestStruct interface{}, httpRequest *http.Request) (err error) { var val *reflect.Value if val, err = checkForValidRequestStruct(requestStruct); err != nil { return } Debugln("Marshaling to Request: ", val.Type().Name()) err = structToRequestPart(httpRequest, *val) return } // MakeDefaultHTTPRequest creates the basic http request with the necessary headers set func MakeDefaultHTTPRequest(method, path string) (httpRequest http.Request) { httpRequest = http.Request{ Proto: "HTTP/1.1", ProtoMajor: 1, ProtoMinor: 1, Header: make(http.Header), URL: &url.URL{}, } httpRequest.Header.Set(requestHeaderContentLength, "0") httpRequest.Header.Set(requestHeaderDate, time.Now().UTC().Format(http.TimeFormat)) httpRequest.Header.Set(requestHeaderOpcClientInfo, strings.Join([]string{defaultSDKMarker, Version()}, "/")) httpRequest.Header.Set(requestHeaderAccept, "*/*") httpRequest.Method = method httpRequest.URL.Path = path return } // MakeDefaultHTTPRequestWithTaggedStruct creates an http request from an struct with tagged fields, see HTTPRequestMarshaller // for more information func MakeDefaultHTTPRequestWithTaggedStruct(method, path string, requestStruct interface{}) (httpRequest http.Request, err error) { httpRequest = MakeDefaultHTTPRequest(method, path) err = HTTPRequestMarshaller(requestStruct, &httpRequest) return } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Request UnMarshaling //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Makes sure the incoming structure is able to be unmarshaled // to a request func checkForValidResponseStruct(s interface{}) (*reflect.Value, error) { val := reflect.ValueOf(s) for val.Kind() == reflect.Ptr { if val.IsNil() { return nil, fmt.Errorf("can not unmarshal to response a pointer to nil structure") } val = val.Elem() } if s == nil { return nil, fmt.Errorf("can not unmarshal to response a nil structure") } if val.Kind() != reflect.Struct { return nil, fmt.Errorf("can not unmarshal to response, expects struct input. Got %v", val.Kind()) } return &val, nil } func intSizeFromKind(kind reflect.Kind) int { switch kind { case reflect.Int8, reflect.Uint8: return 8 case reflect.Int16, reflect.Uint16: return 16 case reflect.Int32, reflect.Uint32: return 32 case reflect.Int64, reflect.Uint64: return 64 case reflect.Int, reflect.Uint: return strconv.IntSize default: Debugf("The type is not valid: %v. Returing int size for arch\n", kind.String()) return strconv.IntSize } } func analyzeValue(stringValue string, kind reflect.Kind, field reflect.StructField) (val reflect.Value, valPointer reflect.Value, err error) { switch kind { case timeType.Kind(): var t time.Time t, err = tryParsingTimeWithValidFormatsForHeaders([]byte(stringValue), field.Name) if err != nil { return } sdkTime := sdkTimeFromTime(t) val = reflect.ValueOf(sdkTime) valPointer = reflect.ValueOf(&sdkTime) return case sdkDateType.Kind(): var t time.Time t, err = tryParsingTimeWithValidFormatsForHeaders([]byte(stringValue), field.Name) if err != nil { return } sdkDate := sdkDateFromTime(t) val = reflect.ValueOf(sdkDate) valPointer = reflect.ValueOf(&sdkDate) return case reflect.Bool: var bVal bool if bVal, err = strconv.ParseBool(stringValue); err != nil { return } val = reflect.ValueOf(bVal) valPointer = reflect.ValueOf(&bVal) return case reflect.Int: size := intSizeFromKind(kind) var iVal int64 if iVal, err = strconv.ParseInt(stringValue, 10, size); err != nil { return } var iiVal int iiVal = int(iVal) val = reflect.ValueOf(iiVal) valPointer = reflect.ValueOf(&iiVal) return case reflect.Int64: size := intSizeFromKind(kind) var iVal int64 if iVal, err = strconv.ParseInt(stringValue, 10, size); err != nil { return } val = reflect.ValueOf(iVal) valPointer = reflect.ValueOf(&iVal) return case reflect.Uint: size := intSizeFromKind(kind) var iVal uint64 if iVal, err = strconv.ParseUint(stringValue, 10, size); err != nil { return } var uiVal uint uiVal = uint(iVal) val = reflect.ValueOf(uiVal) valPointer = reflect.ValueOf(&uiVal) return case reflect.String: val = reflect.ValueOf(stringValue) valPointer = reflect.ValueOf(&stringValue) case reflect.Float32: var fVal float64 if fVal, err = strconv.ParseFloat(stringValue, 32); err != nil { return } var ffVal float32 ffVal = float32(fVal) val = reflect.ValueOf(ffVal) valPointer = reflect.ValueOf(&ffVal) return case reflect.Float64: var fVal float64 if fVal, err = strconv.ParseFloat(stringValue, 64); err != nil { return } val = reflect.ValueOf(fVal) valPointer = reflect.ValueOf(&fVal) return default: err = fmt.Errorf("value for kind: %s not supported", kind) } return } // Sets the field of a struct, with the appropiate value of the string // Only sets basic types func fromStringValue(newValue string, val *reflect.Value, field reflect.StructField) (err error) { if !val.CanSet() { err = fmt.Errorf("can not set field name: %s of type: %v", field.Name, val.Type().String()) return } kind := val.Kind() isPointer := false if val.Kind() == reflect.Ptr { isPointer = true kind = field.Type.Elem().Kind() } value, valPtr, err := analyzeValue(newValue, kind, field) if err != nil { return } if !isPointer { val.Set(value) } else { val.Set(valPtr) } return } // PolymorphicJSONUnmarshaler is the interface to unmarshal polymorphic json payloads type PolymorphicJSONUnmarshaler interface { UnmarshalPolymorphicJSON(data []byte) (interface{}, error) } func valueFromPolymorphicJSON(content []byte, unmarshaler PolymorphicJSONUnmarshaler) (val interface{}, err error) { err = json.Unmarshal(content, unmarshaler) if err != nil { return } val, err = unmarshaler.UnmarshalPolymorphicJSON(content) return } func valueFromJSONBody(response *http.Response, value *reflect.Value, unmarshaler PolymorphicJSONUnmarshaler) (val interface{}, err error) { //Consumes the body, consider implementing it //without body consumption var content []byte content, err = ioutil.ReadAll(response.Body) if err != nil { return } if unmarshaler != nil { val, err = valueFromPolymorphicJSON(content, unmarshaler) return } val = reflect.New(value.Type()).Interface() err = json.Unmarshal(content, &val) return } func addFromBody(response *http.Response, value *reflect.Value, field reflect.StructField, unmarshaler PolymorphicJSONUnmarshaler) (err error) { Debugln("Unmarshaling from body to field: ", field.Name) if response.Body == nil { Debugln("Unmarshaling body skipped due to nil body content for field: ", field.Name) return nil } tag := field.Tag encoding := tag.Get("encoding") var iVal interface{} switch encoding { case "binary": value.Set(reflect.ValueOf(response.Body)) return case "plain-text": //Expects UTF-8 byteArr, e := ioutil.ReadAll(response.Body) if e != nil { return e } str := string(byteArr) value.Set(reflect.ValueOf(&str)) return default: //If the encoding is not set. we'll decode with json iVal, err = valueFromJSONBody(response, value, unmarshaler) if err != nil { return } newVal := reflect.ValueOf(iVal) if newVal.Kind() == reflect.Ptr { newVal = newVal.Elem() } value.Set(newVal) return } } func addFromHeader(response *http.Response, value *reflect.Value, field reflect.StructField) (err error) { Debugln("Unmarshaling from header to field: ", field.Name) var headerName string if headerName = field.Tag.Get("name"); headerName == "" { return fmt.Errorf("unmarshaling response to a header requires the 'name' tag for field: %s", field.Name) } headerValue := response.Header.Get(headerName) if headerValue == "" { Debugf("Unmarshalling did not find header with name:%s", headerName) return nil } if err = fromStringValue(headerValue, value, field); err != nil { return fmt.Errorf("unmarshaling response to a header failed for field %s, due to %s", field.Name, err.Error()) } return } func addFromHeaderCollection(response *http.Response, value *reflect.Value, field reflect.StructField) error { Debugln("Unmarshaling from header-collection to field:", field.Name) var headerPrefix string if headerPrefix = field.Tag.Get("prefix"); headerPrefix == "" { return fmt.Errorf("Unmarshaling response to a header-collection requires the 'prefix' tag for field: %s", field.Name) } mapCollection := make(map[string]string) for name, value := range response.Header { nameLowerCase := strings.ToLower(name) if strings.HasPrefix(nameLowerCase, headerPrefix) { headerNoPrefix := strings.TrimPrefix(nameLowerCase, headerPrefix) mapCollection[headerNoPrefix] = value[0] } } Debugln("Marshalled header collection is:", mapCollection) value.Set(reflect.ValueOf(mapCollection)) return nil } // Populates a struct from parts of a request by reading tags of the struct func responseToStruct(response *http.Response, val *reflect.Value, unmarshaler PolymorphicJSONUnmarshaler) (err error) { typ := val.Type() for i := 0; i < typ.NumField(); i++ { if err != nil { return } sf := typ.Field(i) //unexported if sf.PkgPath != "" { continue } sv := val.Field(i) tag := sf.Tag.Get("presentIn") switch tag { case "header": err = addFromHeader(response, &sv, sf) case "header-collection": err = addFromHeaderCollection(response, &sv, sf) case "body": err = addFromBody(response, &sv, sf, unmarshaler) case "": Debugln(sf.Name, " does not contain presentIn tag. Skipping") default: err = fmt.Errorf("can not unmarshal field: %s. It needs to contain valid presentIn tag", sf.Name) } } return } // UnmarshalResponse hydrates the fields of a struct with the values of a http response, guided // by the field tags. The directive tag is "presentIn" and it can be either // - "header": Will look for the header tagged as "name" in the headers of the struct and set it value to that // - "body": It will try to marshal the body from a json string to a struct tagged with 'presentIn: "body"'. // Further this method will consume the body it should be safe to close it after this function // Notice the current implementation only supports native types:int, strings, floats, bool as the field types func UnmarshalResponse(httpResponse *http.Response, responseStruct interface{}) (err error) { var val *reflect.Value if val, err = checkForValidResponseStruct(responseStruct); err != nil { return } if err = responseToStruct(httpResponse, val, nil); err != nil { return } return nil } // UnmarshalResponseWithPolymorphicBody similar to UnmarshalResponse but assumes the body of the response // contains polymorphic json. This function will use the unmarshaler argument to unmarshal json content func UnmarshalResponseWithPolymorphicBody(httpResponse *http.Response, responseStruct interface{}, unmarshaler PolymorphicJSONUnmarshaler) (err error) { var val *reflect.Value if val, err = checkForValidResponseStruct(responseStruct); err != nil { return } if err = responseToStruct(httpResponse, val, unmarshaler); err != nil { return } return nil } // generate request id if user not provided and for each retry operation re-gen a new request id func generateOpcRequestID(headerName string, value reflect.Value) (newValue reflect.Value) { newValue = value isNilValue := isNil(newValue) isOpcRequestIDHeader := headerName == requestHeaderOpcRequestID || headerName == requestHeaderOpcClientRequestID if isNilValue && isOpcRequestIDHeader { requestID, err := generateRandUUID() if err != nil { // this will not fail the request, just skip add opc-request-id Debugf("unable to generate opc-request-id. %s", err.Error()) } else { newValue = reflect.ValueOf(String(requestID)) Debugf("add request id for header: %s, with value: %s", headerName, requestID) } } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/http_signer.go��������������������������0000664�0000000�0000000�00000021162�13771713062�0026367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "bytes" "crypto" "crypto/rand" "crypto/rsa" "crypto/sha256" "encoding/base64" "fmt" "io" "io/ioutil" "net/http" "strings" ) // HTTPRequestSigner the interface to sign a request type HTTPRequestSigner interface { Sign(r *http.Request) error } // KeyProvider interface that wraps information about the key's account owner type KeyProvider interface { PrivateRSAKey() (*rsa.PrivateKey, error) KeyID() (string, error) } const signerVersion = "1" // SignerBodyHashPredicate a function that allows to disable/enable body hashing // of requests and headers associated with body content type SignerBodyHashPredicate func(r *http.Request) bool // ociRequestSigner implements the http-signatures-draft spec // as described in https://tools.ietf.org/html/draft-cavage-http-signatures-08 type ociRequestSigner struct { KeyProvider KeyProvider GenericHeaders []string BodyHeaders []string ShouldHashBody SignerBodyHashPredicate } var ( defaultGenericHeaders = []string{"date", "(request-target)", "host"} defaultBodyHeaders = []string{"content-length", "content-type", "x-content-sha256"} defaultBodyHashPredicate = func(r *http.Request) bool { return r.Method == http.MethodPost || r.Method == http.MethodPut || r.Method == http.MethodPatch } ) // DefaultGenericHeaders list of default generic headers that is used in signing func DefaultGenericHeaders() []string { return makeACopy(defaultGenericHeaders) } // DefaultBodyHeaders list of default body headers that is used in signing func DefaultBodyHeaders() []string { return makeACopy(defaultBodyHeaders) } // DefaultRequestSigner creates a signer with default parameters. func DefaultRequestSigner(provider KeyProvider) HTTPRequestSigner { return RequestSigner(provider, defaultGenericHeaders, defaultBodyHeaders) } // RequestSignerExcludeBody creates a signer without hash the body. func RequestSignerExcludeBody(provider KeyProvider) HTTPRequestSigner { bodyHashPredicate := func(r *http.Request) bool { // week request signer will not hash the body return false } return RequestSignerWithBodyHashingPredicate(provider, defaultGenericHeaders, defaultBodyHeaders, bodyHashPredicate) } // NewSignerFromOCIRequestSigner creates a copy of the request signer and attaches the new SignerBodyHashPredicate // returns an error if the passed signer is not of type ociRequestSigner func NewSignerFromOCIRequestSigner(oldSigner HTTPRequestSigner, predicate SignerBodyHashPredicate) (HTTPRequestSigner, error) { if oldS, ok := oldSigner.(ociRequestSigner); ok { s := ociRequestSigner{ KeyProvider: oldS.KeyProvider, GenericHeaders: oldS.GenericHeaders, BodyHeaders: oldS.BodyHeaders, ShouldHashBody: predicate, } return s, nil } return nil, fmt.Errorf("can not create a signer, input signer needs to be of type ociRequestSigner") } // RequestSigner creates a signer that utilizes the specified headers for signing // and the default predicate for using the body of the request as part of the signature func RequestSigner(provider KeyProvider, genericHeaders, bodyHeaders []string) HTTPRequestSigner { return ociRequestSigner{ KeyProvider: provider, GenericHeaders: genericHeaders, BodyHeaders: bodyHeaders, ShouldHashBody: defaultBodyHashPredicate} } // RequestSignerWithBodyHashingPredicate creates a signer that utilizes the specified headers for signing, as well as a predicate for using // the body of the request and bodyHeaders parameter as part of the signature func RequestSignerWithBodyHashingPredicate(provider KeyProvider, genericHeaders, bodyHeaders []string, shouldHashBody SignerBodyHashPredicate) HTTPRequestSigner { return ociRequestSigner{ KeyProvider: provider, GenericHeaders: genericHeaders, BodyHeaders: bodyHeaders, ShouldHashBody: shouldHashBody} } func (signer ociRequestSigner) getSigningHeaders(r *http.Request) []string { var result []string result = append(result, signer.GenericHeaders...) if signer.ShouldHashBody(r) { result = append(result, signer.BodyHeaders...) } return result } func (signer ociRequestSigner) getSigningString(request *http.Request) string { signingHeaders := signer.getSigningHeaders(request) signingParts := make([]string, len(signingHeaders)) for i, part := range signingHeaders { var value string part = strings.ToLower(part) switch part { case "(request-target)": value = getRequestTarget(request) case "host": value = request.URL.Host if len(value) == 0 { value = request.Host } default: value = request.Header.Get(part) } signingParts[i] = fmt.Sprintf("%s: %s", part, value) } signingString := strings.Join(signingParts, "\n") return signingString } func getRequestTarget(request *http.Request) string { lowercaseMethod := strings.ToLower(request.Method) return fmt.Sprintf("%s %s", lowercaseMethod, request.URL.RequestURI()) } func calculateHashOfBody(request *http.Request) (err error) { var hash string hash, err = GetBodyHash(request) if err != nil { return } request.Header.Set(requestHeaderXContentSHA256, hash) return } // drainBody reads all of b to memory and then returns two equivalent // ReadClosers yielding the same bytes. // // It returns an error if the initial slurp of all bytes fails. It does not attempt // to make the returned ReadClosers have identical error-matching behavior. func drainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err error) { if b == http.NoBody { // No copying needed. Preserve the magic sentinel meaning of NoBody. return http.NoBody, http.NoBody, nil } var buf bytes.Buffer if _, err = buf.ReadFrom(b); err != nil { return nil, b, err } if err = b.Close(); err != nil { return nil, b, err } return ioutil.NopCloser(&buf), ioutil.NopCloser(bytes.NewReader(buf.Bytes())), nil } func hashAndEncode(data []byte) string { hashedContent := sha256.Sum256(data) hash := base64.StdEncoding.EncodeToString(hashedContent[:]) return hash } // GetBodyHash creates a base64 string from the hash of body the request func GetBodyHash(request *http.Request) (hashString string, err error) { if request.Body == nil { request.ContentLength = 0 request.Header.Set(requestHeaderContentLength, fmt.Sprintf("%v", request.ContentLength)) return hashAndEncode([]byte("")), nil } var data []byte bReader := request.Body bReader, request.Body, err = drainBody(request.Body) if err != nil { return "", fmt.Errorf("can not read body of request while calculating body hash: %s", err.Error()) } data, err = ioutil.ReadAll(bReader) if err != nil { return "", fmt.Errorf("can not read body of request while calculating body hash: %s", err.Error()) } // Since the request can be coming from a binary body. Make an attempt to set the body length request.ContentLength = int64(len(data)) request.Header.Set(requestHeaderContentLength, fmt.Sprintf("%v", request.ContentLength)) hashString = hashAndEncode(data) return } func (signer ociRequestSigner) computeSignature(request *http.Request) (signature string, err error) { signingString := signer.getSigningString(request) hasher := sha256.New() hasher.Write([]byte(signingString)) hashed := hasher.Sum(nil) privateKey, err := signer.KeyProvider.PrivateRSAKey() if err != nil { return } var unencodedSig []byte unencodedSig, e := rsa.SignPKCS1v15(rand.Reader, privateKey, crypto.SHA256, hashed) if e != nil { err = fmt.Errorf("can not compute signature while signing the request %s: ", e.Error()) return } signature = base64.StdEncoding.EncodeToString(unencodedSig) return } // Sign signs the http request, by inspecting the necessary headers. Once signed // the request will have the proper 'Authorization' header set, otherwise // and error is returned func (signer ociRequestSigner) Sign(request *http.Request) (err error) { if signer.ShouldHashBody(request) { err = calculateHashOfBody(request) if err != nil { return } } var signature string if signature, err = signer.computeSignature(request); err != nil { return } signingHeaders := strings.Join(signer.getSigningHeaders(request), " ") var keyID string if keyID, err = signer.KeyProvider.KeyID(); err != nil { return } authValue := fmt.Sprintf("Signature version=\"%s\",headers=\"%s\",keyId=\"%s\",algorithm=\"rsa-sha256\",signature=\"%s\"", signerVersion, signingHeaders, keyID, signature) request.Header.Set(requestHeaderAuthorization, authValue) return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/log.go����������������������������������0000664�0000000�0000000�00000011206�13771713062�0024620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. package common import ( "fmt" "io/ioutil" "log" "os" "strings" "sync" ) //sdkLogger an interface for logging in the SDK type sdkLogger interface { //LogLevel returns the log level of sdkLogger LogLevel() int //Log logs v with the provided format if the current log level is loglevel Log(logLevel int, format string, v ...interface{}) error } //noLogging no logging messages const noLogging = 0 //infoLogging minimal logging messages const infoLogging = 1 //debugLogging some logging messages const debugLogging = 2 //verboseLogging all logging messages const verboseLogging = 3 //defaultSDKLogger the default implementation of the sdkLogger type defaultSDKLogger struct { currentLoggingLevel int verboseLogger *log.Logger debugLogger *log.Logger infoLogger *log.Logger nullLogger *log.Logger } //defaultLogger is the defaultLogger in the SDK var defaultLogger sdkLogger var loggerLock sync.Mutex //initializes the SDK defaultLogger as a defaultLogger func init() { l, _ := newSDKLogger() setSDKLogger(l) } //setSDKLogger sets the logger used by the sdk func setSDKLogger(logger sdkLogger) { loggerLock.Lock() defaultLogger = logger loggerLock.Unlock() } // newSDKLogger creates a defaultSDKLogger // Debug logging is turned on/off by the presence of the environment variable "OCI_GO_SDK_DEBUG" // The value of the "OCI_GO_SDK_DEBUG" environment variable controls the logging level. // "null" outputs no log messages // "i" or "info" outputs minimal log messages // "d" or "debug" outputs some logs messages // "v" or "verbose" outputs all logs messages, including body of requests func newSDKLogger() (defaultSDKLogger, error) { logger := defaultSDKLogger{} logger.currentLoggingLevel = noLogging logger.verboseLogger = log.New(os.Stderr, "VERBOSE ", log.Ldate|log.Lmicroseconds|log.Lshortfile) logger.debugLogger = log.New(os.Stderr, "DEBUG ", log.Ldate|log.Lmicroseconds|log.Lshortfile) logger.infoLogger = log.New(os.Stderr, "INFO ", log.Ldate|log.Lmicroseconds|log.Lshortfile) logger.nullLogger = log.New(ioutil.Discard, "", log.Ldate|log.Lmicroseconds|log.Lshortfile) configured, isLogEnabled := os.LookupEnv("OCI_GO_SDK_DEBUG") // If env variable not present turn logging of if !isLogEnabled { logger.currentLoggingLevel = noLogging } else { switch strings.ToLower(configured) { case "null": logger.currentLoggingLevel = noLogging break case "i", "info": logger.currentLoggingLevel = infoLogging break case "d", "debug": logger.currentLoggingLevel = debugLogging break //1 here for backwards compatibility case "v", "verbose", "1": logger.currentLoggingLevel = verboseLogging break default: logger.currentLoggingLevel = infoLogging } logger.infoLogger.Println("logger level set to: ", logger.currentLoggingLevel) } return logger, nil } func (l defaultSDKLogger) getLoggerForLevel(logLevel int) *log.Logger { if logLevel > l.currentLoggingLevel { return l.nullLogger } switch logLevel { case noLogging: return l.nullLogger case infoLogging: return l.infoLogger case debugLogging: return l.debugLogger case verboseLogging: return l.verboseLogger default: return l.nullLogger } } //LogLevel returns the current debug level func (l defaultSDKLogger) LogLevel() int { return l.currentLoggingLevel } func (l defaultSDKLogger) Log(logLevel int, format string, v ...interface{}) error { logger := l.getLoggerForLevel(logLevel) logger.Output(4, fmt.Sprintf(format, v...)) return nil } //Logln logs v appending a new line at the end //Deprecated func Logln(v ...interface{}) { defaultLogger.Log(infoLogging, "%v\n", v...) } // Logf logs v with the provided format func Logf(format string, v ...interface{}) { defaultLogger.Log(infoLogging, format, v...) } // Debugf logs v with the provided format if debug mode is set func Debugf(format string, v ...interface{}) { defaultLogger.Log(debugLogging, format, v...) } // Debug logs v if debug mode is set func Debug(v ...interface{}) { m := fmt.Sprint(v...) defaultLogger.Log(debugLogging, "%s", m) } // Debugln logs v appending a new line if debug mode is set func Debugln(v ...interface{}) { m := fmt.Sprint(v...) defaultLogger.Log(debugLogging, "%s\n", m) } // IfDebug executes closure if debug is enabled func IfDebug(fn func()) { if defaultLogger.LogLevel() >= debugLogging { fn() } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/retry.go��������������������������������0000664�0000000�0000000�00000013634�13771713062�0025213�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package common import ( "context" "fmt" "math/rand" "runtime" "time" ) const ( // UnlimitedNumAttemptsValue is the value for indicating unlimited attempts for reaching success UnlimitedNumAttemptsValue = uint(0) // number of characters contained in the generated retry token generatedRetryTokenLength = 32 ) // OCIRetryableRequest represents a request that can be reissued according to the specified policy. type OCIRetryableRequest interface { // Any retryable request must implement the OCIRequest interface OCIRequest // Each operation specifies default retry behavior. By passing no arguments to this method, the default retry // behavior, as determined on a per-operation-basis, will be honored. Variadic retry policy option arguments // passed to this method will override the default behavior. RetryPolicy() *RetryPolicy } // OCIOperationResponse represents the output of an OCIOperation, with additional context of error message // and operation attempt number. type OCIOperationResponse struct { // Response from OCI Operation Response OCIResponse // Error from OCI Operation Error error // Operation Attempt Number (one-based) AttemptNumber uint } // NewOCIOperationResponse assembles an OCI Operation Response object. func NewOCIOperationResponse(response OCIResponse, err error, attempt uint) OCIOperationResponse { return OCIOperationResponse{ Response: response, Error: err, AttemptNumber: attempt, } } // RetryPolicy is the class that holds all relevant information for retrying operations. type RetryPolicy struct { // MaximumNumberAttempts is the maximum number of times to retry a request. Zero indicates an unlimited // number of attempts. MaximumNumberAttempts uint // ShouldRetryOperation inspects the http response, error, and operation attempt number, and // - returns true if we should retry the operation // - returns false otherwise ShouldRetryOperation func(OCIOperationResponse) bool // GetNextDuration computes the duration to pause between operation retries. NextDuration func(OCIOperationResponse) time.Duration } // NoRetryPolicy is a helper method that assembles and returns a return policy that indicates an operation should // never be retried (the operation is performed exactly once). func NoRetryPolicy() RetryPolicy { dontRetryOperation := func(OCIOperationResponse) bool { return false } zeroNextDuration := func(OCIOperationResponse) time.Duration { return 0 * time.Second } return NewRetryPolicy(uint(1), dontRetryOperation, zeroNextDuration) } // NewRetryPolicy is a helper method for assembling a Retry Policy object. func NewRetryPolicy(attempts uint, retryOperation func(OCIOperationResponse) bool, nextDuration func(OCIOperationResponse) time.Duration) RetryPolicy { return RetryPolicy{ MaximumNumberAttempts: attempts, ShouldRetryOperation: retryOperation, NextDuration: nextDuration, } } // shouldContinueIssuingRequests returns true if we should continue retrying a request, based on the current attempt // number and the maximum number of attempts specified, or false otherwise. func shouldContinueIssuingRequests(current, maximum uint) bool { return maximum == UnlimitedNumAttemptsValue || current <= maximum } // RetryToken generates a retry token that must be included on any request passed to the Retry method. func RetryToken() string { alphanumericChars := []rune("abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ") retryToken := make([]rune, generatedRetryTokenLength) for i := range retryToken { retryToken[i] = alphanumericChars[rand.Intn(len(alphanumericChars))] } return string(retryToken) } // Retry is a package-level operation that executes the retryable request using the specified operation and retry policy. func Retry(ctx context.Context, request OCIRetryableRequest, operation OCIOperation, policy RetryPolicy) (OCIResponse, error) { type retrierResult struct { response OCIResponse err error } var response OCIResponse var err error retrierChannel := make(chan retrierResult) go func() { // Deal with panics more graciously defer func() { if r := recover(); r != nil { stackBuffer := make([]byte, 1024) bytesWritten := runtime.Stack(stackBuffer, false) stack := string(stackBuffer[:bytesWritten]) retrierChannel <- retrierResult{nil, fmt.Errorf("panicked while retrying operation. Panic was: %s\nStack: %s", r, stack)} } }() // use a one-based counter because it's easier to think about operation retry in terms of attempt numbering for currentOperationAttempt := uint(1); shouldContinueIssuingRequests(currentOperationAttempt, policy.MaximumNumberAttempts); currentOperationAttempt++ { Debugln(fmt.Sprintf("operation attempt #%v", currentOperationAttempt)) response, err = operation(ctx, request) operationResponse := NewOCIOperationResponse(response, err, currentOperationAttempt) if !policy.ShouldRetryOperation(operationResponse) { // we should NOT retry operation based on response and/or error => return retrierChannel <- retrierResult{response, err} return } duration := policy.NextDuration(operationResponse) //The following condition is kept for backwards compatibility reasons if deadline, ok := ctx.Deadline(); ok && time.Now().Add(duration).After(deadline) { // we want to retry the operation, but the policy is telling us to wait for a duration that exceeds // the specified overall deadline for the operation => instead of waiting for however long that // time period is and then aborting, abort now and save the cycles retrierChannel <- retrierResult{response, DeadlineExceededByBackoff} return } Debugln(fmt.Sprintf("waiting %v before retrying operation", duration)) // sleep before retrying the operation <-time.After(duration) } retrierChannel <- retrierResult{response, err} }() select { case <-ctx.Done(): return response, ctx.Err() case result := <-retrierChannel: return result.response, result.err } } ����������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/common/version.go������������������������������0000664�0000000�0000000�00000001627�13771713062�0025532�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated by go generate; DO NOT EDIT package common import ( "bytes" "fmt" "sync" ) const ( major = "18" minor = "0" patch = "0" tag = "" ) var once sync.Once var version string // Version returns semantic version of the sdk func Version() string { once.Do(func() { ver := fmt.Sprintf("%s.%s.%s", major, minor, patch) verBuilder := bytes.NewBufferString(ver) if tag != "" && tag != "-" { _, err := verBuilder.WriteString(tag) if err != nil { verBuilder = bytes.NewBufferString(ver) } } version = verBuilder.String() }) return version } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023150�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������add_image_shape_compatibility_entry_details.go������������������������������������������������������0000664�0000000�0000000�00000002263�13771713062�0034354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AddImageShapeCompatibilityEntryDetails Image shape compatibility details. type AddImageShapeCompatibilityEntryDetails struct { OcpuConstraints *ImageOcpuConstraints `mandatory:"false" json:"ocpuConstraints"` } func (m AddImageShapeCompatibilityEntryDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������add_image_shape_compatibility_entry_request_response.go���������������������������������������������0000664�0000000�0000000�00000005423�13771713062�0036336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // AddImageShapeCompatibilityEntryRequest wrapper for the AddImageShapeCompatibilityEntry operation type AddImageShapeCompatibilityEntryRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // Shape name. ShapeName *string `mandatory:"true" contributesTo:"path" name:"shapeName"` // Image shape compatibility details AddImageShapeCompatibilityEntryDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request AddImageShapeCompatibilityEntryRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request AddImageShapeCompatibilityEntryRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request AddImageShapeCompatibilityEntryRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // AddImageShapeCompatibilityEntryResponse wrapper for the AddImageShapeCompatibilityEntry operation type AddImageShapeCompatibilityEntryResponse struct { // The underlying http response RawResponse *http.Response // The ImageShapeCompatibilityEntry instance ImageShapeCompatibilityEntry `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response AddImageShapeCompatibilityEntryResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response AddImageShapeCompatibilityEntryResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������add_network_security_group_security_rules_details.go������������������������������������������������0000664�0000000�0000000�00000002404�13771713062�0035732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AddNetworkSecurityGroupSecurityRulesDetails The representation of AddNetworkSecurityGroupSecurityRulesDetails type AddNetworkSecurityGroupSecurityRulesDetails struct { // The NSG security rules to add. SecurityRules []AddSecurityRuleDetails `mandatory:"false" json:"securityRules"` } func (m AddNetworkSecurityGroupSecurityRulesDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������add_network_security_group_security_rules_request_response.go���������������������������������������0000664�0000000�0000000�00000005550�13771713062�0037720�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // AddNetworkSecurityGroupSecurityRulesRequest wrapper for the AddNetworkSecurityGroupSecurityRules operation type AddNetworkSecurityGroupSecurityRulesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // Request with one or more security rules to be associated with the network security group. AddNetworkSecurityGroupSecurityRulesDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request AddNetworkSecurityGroupSecurityRulesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request AddNetworkSecurityGroupSecurityRulesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request AddNetworkSecurityGroupSecurityRulesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // AddNetworkSecurityGroupSecurityRulesResponse wrapper for the AddNetworkSecurityGroupSecurityRules operation type AddNetworkSecurityGroupSecurityRulesResponse struct { // The underlying http response RawResponse *http.Response // The AddedNetworkSecurityGroupSecurityRules instance AddedNetworkSecurityGroupSecurityRules `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response AddNetworkSecurityGroupSecurityRulesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response AddNetworkSecurityGroupSecurityRulesResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/add_security_rule_details.go��������������0000664�0000000�0000000�00000024020�13771713062�0030710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AddSecurityRuleDetails A rule for allowing inbound (INGRESS) or outbound (EGRESS) IP packets. type AddSecurityRuleDetails struct { // Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, or `INGRESS` for rules to allow inbound IP packets. Direction AddSecurityRuleDetailsDirectionEnum `mandatory:"true" json:"direction"` // The transport protocol. Specify either `all` or an IPv4 protocol number as // defined in // Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). // Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). Protocol *string `mandatory:"true" json:"protocol"` // An optional description of your choice for the rule. Avoid entering confidential information. Description *string `mandatory:"false" json:"description"` // Conceptually, this is the range of IP addresses that a packet originating from the instance // can go to. // Allowed values: // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security rule for traffic destined for a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. // * The OCID of a NetworkSecurityGroup in the same // VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control // traffic between VNICs in the same NSG. Destination *string `mandatory:"false" json:"destination"` // Type of destination for the rule. Required if `direction` = `EGRESS`. // Allowed values: // * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a // Service (the rule is for traffic destined for a // particular `Service` through a service gateway). // * `NETWORK_SECURITY_GROUP`: If the rule's `destination` is the OCID of a // NetworkSecurityGroup. DestinationType AddSecurityRuleDetailsDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` // Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code // as defined in: // - ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) // - ICMPv6 Parameters (https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) // If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and // codes are allowed. If you do provide this object, the type is required and the code is optional. // To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 ("Destination // Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). If you need to specify // multiple codes for a single type, create a separate security list rule for each. IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"` // A stateless rule allows traffic in one direction. Remember to add a corresponding // stateless rule in the other direction if you need to support bidirectional traffic. For // example, if egress traffic allows TCP destination port 80, there should be an ingress // rule to allow TCP source port 80. Defaults to false, which means the rule is stateful // and a corresponding rule is not necessary for bidirectional traffic. IsStateless *bool `mandatory:"false" json:"isStateless"` // Conceptually, this is the range of IP addresses that a packet coming into the instance // can come from. // Allowed values: // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security rule for traffic coming from a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. // * The OCID of a NetworkSecurityGroup in the same // VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control // traffic between VNICs in the same NSG. Source *string `mandatory:"false" json:"source"` // Type of source for the rule. Required if `direction` = `INGRESS`. // * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a // Service (the rule is for traffic coming from a // particular `Service` through a service gateway). // * `NETWORK_SECURITY_GROUP`: If the rule's `source` is the OCID of a // NetworkSecurityGroup. SourceType AddSecurityRuleDetailsSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` // Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. // If you specify TCP as the protocol but omit this object, then all destination ports are allowed. TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"` // Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. // If you specify UDP as the protocol but omit this object, then all destination ports are allowed. UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"` } func (m AddSecurityRuleDetails) String() string { return common.PointerString(m) } // AddSecurityRuleDetailsDestinationTypeEnum Enum with underlying type: string type AddSecurityRuleDetailsDestinationTypeEnum string // Set of constants representing the allowable values for AddSecurityRuleDetailsDestinationTypeEnum const ( AddSecurityRuleDetailsDestinationTypeCidrBlock AddSecurityRuleDetailsDestinationTypeEnum = "CIDR_BLOCK" AddSecurityRuleDetailsDestinationTypeServiceCidrBlock AddSecurityRuleDetailsDestinationTypeEnum = "SERVICE_CIDR_BLOCK" AddSecurityRuleDetailsDestinationTypeNetworkSecurityGroup AddSecurityRuleDetailsDestinationTypeEnum = "NETWORK_SECURITY_GROUP" ) var mappingAddSecurityRuleDetailsDestinationType = map[string]AddSecurityRuleDetailsDestinationTypeEnum{ "CIDR_BLOCK": AddSecurityRuleDetailsDestinationTypeCidrBlock, "SERVICE_CIDR_BLOCK": AddSecurityRuleDetailsDestinationTypeServiceCidrBlock, "NETWORK_SECURITY_GROUP": AddSecurityRuleDetailsDestinationTypeNetworkSecurityGroup, } // GetAddSecurityRuleDetailsDestinationTypeEnumValues Enumerates the set of values for AddSecurityRuleDetailsDestinationTypeEnum func GetAddSecurityRuleDetailsDestinationTypeEnumValues() []AddSecurityRuleDetailsDestinationTypeEnum { values := make([]AddSecurityRuleDetailsDestinationTypeEnum, 0) for _, v := range mappingAddSecurityRuleDetailsDestinationType { values = append(values, v) } return values } // AddSecurityRuleDetailsDirectionEnum Enum with underlying type: string type AddSecurityRuleDetailsDirectionEnum string // Set of constants representing the allowable values for AddSecurityRuleDetailsDirectionEnum const ( AddSecurityRuleDetailsDirectionEgress AddSecurityRuleDetailsDirectionEnum = "EGRESS" AddSecurityRuleDetailsDirectionIngress AddSecurityRuleDetailsDirectionEnum = "INGRESS" ) var mappingAddSecurityRuleDetailsDirection = map[string]AddSecurityRuleDetailsDirectionEnum{ "EGRESS": AddSecurityRuleDetailsDirectionEgress, "INGRESS": AddSecurityRuleDetailsDirectionIngress, } // GetAddSecurityRuleDetailsDirectionEnumValues Enumerates the set of values for AddSecurityRuleDetailsDirectionEnum func GetAddSecurityRuleDetailsDirectionEnumValues() []AddSecurityRuleDetailsDirectionEnum { values := make([]AddSecurityRuleDetailsDirectionEnum, 0) for _, v := range mappingAddSecurityRuleDetailsDirection { values = append(values, v) } return values } // AddSecurityRuleDetailsSourceTypeEnum Enum with underlying type: string type AddSecurityRuleDetailsSourceTypeEnum string // Set of constants representing the allowable values for AddSecurityRuleDetailsSourceTypeEnum const ( AddSecurityRuleDetailsSourceTypeCidrBlock AddSecurityRuleDetailsSourceTypeEnum = "CIDR_BLOCK" AddSecurityRuleDetailsSourceTypeServiceCidrBlock AddSecurityRuleDetailsSourceTypeEnum = "SERVICE_CIDR_BLOCK" AddSecurityRuleDetailsSourceTypeNetworkSecurityGroup AddSecurityRuleDetailsSourceTypeEnum = "NETWORK_SECURITY_GROUP" ) var mappingAddSecurityRuleDetailsSourceType = map[string]AddSecurityRuleDetailsSourceTypeEnum{ "CIDR_BLOCK": AddSecurityRuleDetailsSourceTypeCidrBlock, "SERVICE_CIDR_BLOCK": AddSecurityRuleDetailsSourceTypeServiceCidrBlock, "NETWORK_SECURITY_GROUP": AddSecurityRuleDetailsSourceTypeNetworkSecurityGroup, } // GetAddSecurityRuleDetailsSourceTypeEnumValues Enumerates the set of values for AddSecurityRuleDetailsSourceTypeEnum func GetAddSecurityRuleDetailsSourceTypeEnumValues() []AddSecurityRuleDetailsSourceTypeEnum { values := make([]AddSecurityRuleDetailsSourceTypeEnum, 0) for _, v := range mappingAddSecurityRuleDetailsSourceType { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������added_network_security_group_security_rules.go������������������������������������������������������0000664�0000000�0000000�00000002357�13771713062�0034545�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AddedNetworkSecurityGroupSecurityRules The representation of AddedNetworkSecurityGroupSecurityRules type AddedNetworkSecurityGroupSecurityRules struct { // The NSG security rules that were added. SecurityRules []SecurityRule `mandatory:"false" json:"securityRules"` } func (m AddedNetworkSecurityGroupSecurityRules) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing.go��������������������0000664�0000000�0000000�00000003511�13771713062�0027502�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AppCatalogListing Listing details. type AppCatalogListing struct { // Listing's contact URL. ContactUrl *string `mandatory:"false" json:"contactUrl"` // Description of the listing. Description *string `mandatory:"false" json:"description"` // The OCID of the listing. ListingId *string `mandatory:"false" json:"listingId"` // Name of the listing. DisplayName *string `mandatory:"false" json:"displayName"` // Date and time the listing was published, in RFC3339 format. // Example: `2018-03-20T12:32:53.532Z` TimePublished *common.SDKTime `mandatory:"false" json:"timePublished"` // Publisher's logo URL. PublisherLogoUrl *string `mandatory:"false" json:"publisherLogoUrl"` // Name of the publisher who published this listing. PublisherName *string `mandatory:"false" json:"publisherName"` // Summary of the listing. Summary *string `mandatory:"false" json:"summary"` } func (m AppCatalogListing) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_resource_version.go���0000664�0000000�0000000�00000011572�13771713062�0033164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AppCatalogListingResourceVersion Listing Resource Version type AppCatalogListingResourceVersion struct { // The OCID of the listing this resource version belongs to. ListingId *string `mandatory:"false" json:"listingId"` // Date and time the listing resource version was published, in RFC3339 format. // Example: `2018-03-20T12:32:53.532Z` TimePublished *common.SDKTime `mandatory:"false" json:"timePublished"` // OCID of the listing resource. ListingResourceId *string `mandatory:"false" json:"listingResourceId"` // Resource Version. ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` // List of regions that this listing resource version is available. // For information about Regions, see // Regions (https://docs.cloud.oracle.comGeneral/Concepts/regions.htm). // Example: `["us-ashburn-1", "us-phoenix-1"]` AvailableRegions []string `mandatory:"false" json:"availableRegions"` // Array of shapes compatible with this resource. // You may enumerate all available shapes by calling listShapes. // Example: `["VM.Standard1.1", "VM.Standard1.2"]` CompatibleShapes []string `mandatory:"false" json:"compatibleShapes"` // List of accessible ports for instances launched with this listing resource version. AccessiblePorts []int `mandatory:"false" json:"accessiblePorts"` // Allowed actions for the listing resource. AllowedActions []AppCatalogListingResourceVersionAllowedActionsEnum `mandatory:"false" json:"allowedActions,omitempty"` } func (m AppCatalogListingResourceVersion) String() string { return common.PointerString(m) } // AppCatalogListingResourceVersionAllowedActionsEnum Enum with underlying type: string type AppCatalogListingResourceVersionAllowedActionsEnum string // Set of constants representing the allowable values for AppCatalogListingResourceVersionAllowedActionsEnum const ( AppCatalogListingResourceVersionAllowedActionsSnapshot AppCatalogListingResourceVersionAllowedActionsEnum = "SNAPSHOT" AppCatalogListingResourceVersionAllowedActionsBootVolumeDetach AppCatalogListingResourceVersionAllowedActionsEnum = "BOOT_VOLUME_DETACH" AppCatalogListingResourceVersionAllowedActionsPreserveBootVolume AppCatalogListingResourceVersionAllowedActionsEnum = "PRESERVE_BOOT_VOLUME" AppCatalogListingResourceVersionAllowedActionsSerialConsoleAccess AppCatalogListingResourceVersionAllowedActionsEnum = "SERIAL_CONSOLE_ACCESS" AppCatalogListingResourceVersionAllowedActionsBootRecovery AppCatalogListingResourceVersionAllowedActionsEnum = "BOOT_RECOVERY" AppCatalogListingResourceVersionAllowedActionsBackupBootVolume AppCatalogListingResourceVersionAllowedActionsEnum = "BACKUP_BOOT_VOLUME" AppCatalogListingResourceVersionAllowedActionsCaptureConsoleHistory AppCatalogListingResourceVersionAllowedActionsEnum = "CAPTURE_CONSOLE_HISTORY" ) var mappingAppCatalogListingResourceVersionAllowedActions = map[string]AppCatalogListingResourceVersionAllowedActionsEnum{ "SNAPSHOT": AppCatalogListingResourceVersionAllowedActionsSnapshot, "BOOT_VOLUME_DETACH": AppCatalogListingResourceVersionAllowedActionsBootVolumeDetach, "PRESERVE_BOOT_VOLUME": AppCatalogListingResourceVersionAllowedActionsPreserveBootVolume, "SERIAL_CONSOLE_ACCESS": AppCatalogListingResourceVersionAllowedActionsSerialConsoleAccess, "BOOT_RECOVERY": AppCatalogListingResourceVersionAllowedActionsBootRecovery, "BACKUP_BOOT_VOLUME": AppCatalogListingResourceVersionAllowedActionsBackupBootVolume, "CAPTURE_CONSOLE_HISTORY": AppCatalogListingResourceVersionAllowedActionsCaptureConsoleHistory, } // GetAppCatalogListingResourceVersionAllowedActionsEnumValues Enumerates the set of values for AppCatalogListingResourceVersionAllowedActionsEnum func GetAppCatalogListingResourceVersionAllowedActionsEnumValues() []AppCatalogListingResourceVersionAllowedActionsEnum { values := make([]AppCatalogListingResourceVersionAllowedActionsEnum, 0) for _, v := range mappingAppCatalogListingResourceVersionAllowedActions { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������app_catalog_listing_resource_version_agreements.go��������������������������������������������������0000664�0000000�0000000�00000003613�13771713062�0035314�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AppCatalogListingResourceVersionAgreements Agreements for a listing resource version. type AppCatalogListingResourceVersionAgreements struct { // The OCID of the listing associated with these agreements. ListingId *string `mandatory:"false" json:"listingId"` // Listing resource version associated with these agreements. ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` // Oracle TOU link OracleTermsOfUseLink *string `mandatory:"false" json:"oracleTermsOfUseLink"` // EULA link EulaLink *string `mandatory:"false" json:"eulaLink"` // Date and time the agreements were retrieved, in RFC3339 format. // Example: `2018-03-20T12:32:53.532Z` TimeRetrieved *common.SDKTime `mandatory:"false" json:"timeRetrieved"` // A generated signature for this agreement retrieval operation which should be used in the create subscription call. Signature *string `mandatory:"false" json:"signature"` } func (m AppCatalogListingResourceVersionAgreements) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������app_catalog_listing_resource_version_summary.go�����������������������������������������������������0000664�0000000�0000000�00000003157�13771713062�0034662�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AppCatalogListingResourceVersionSummary Listing Resource Version summary type AppCatalogListingResourceVersionSummary struct { // The OCID of the listing this resource version belongs to. ListingId *string `mandatory:"false" json:"listingId"` // Date and time the listing resource version was published, in RFC3339 format. // Example: `2018-03-20T12:32:53.532Z` TimePublished *common.SDKTime `mandatory:"false" json:"timePublished"` // OCID of the listing resource. ListingResourceId *string `mandatory:"false" json:"listingResourceId"` // Resource Version. ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` } func (m AppCatalogListingResourceVersionSummary) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_listing_summary.go������������0000664�0000000�0000000�00000002720�13771713062�0031260�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AppCatalogListingSummary A summary of a listing. type AppCatalogListingSummary struct { // the region free ocid of the listing resource. ListingId *string `mandatory:"false" json:"listingId"` // The display name of the listing. DisplayName *string `mandatory:"false" json:"displayName"` // The short summary for the listing. Summary *string `mandatory:"false" json:"summary"` // The name of the publisher who published this listing. PublisherName *string `mandatory:"false" json:"publisherName"` } func (m AppCatalogListingSummary) String() string { return common.PointerString(m) } ������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription.go���������������0000664�0000000�0000000�00000003710�13771713062�0030556�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AppCatalogSubscription a subscription for a listing resource version. type AppCatalogSubscription struct { // Name of the publisher who published this listing. PublisherName *string `mandatory:"false" json:"publisherName"` // The ocid of the listing resource. ListingId *string `mandatory:"false" json:"listingId"` // Listing resource version. ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` // Listing resource id. ListingResourceId *string `mandatory:"false" json:"listingResourceId"` // The display name of the listing. DisplayName *string `mandatory:"false" json:"displayName"` // The short summary to the listing. Summary *string `mandatory:"false" json:"summary"` // The compartmentID of the subscription. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Date and time at which the subscription was created, in RFC3339 format. // Example: `2018-03-20T12:32:53.532Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m AppCatalogSubscription) String() string { return common.PointerString(m) } ��������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/app_catalog_subscription_summary.go�������0000664�0000000�0000000�00000003745�13771713062�0032343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AppCatalogSubscriptionSummary a subscription summary for a listing resource version. type AppCatalogSubscriptionSummary struct { // Name of the publisher who published this listing. PublisherName *string `mandatory:"false" json:"publisherName"` // The ocid of the listing resource. ListingId *string `mandatory:"false" json:"listingId"` // Listing resource version. ListingResourceVersion *string `mandatory:"false" json:"listingResourceVersion"` // Listing resource id. ListingResourceId *string `mandatory:"false" json:"listingResourceId"` // The display name of the listing. DisplayName *string `mandatory:"false" json:"displayName"` // The short summary to the listing. Summary *string `mandatory:"false" json:"summary"` // The compartmentID of the subscription. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Date and time at which the subscription was created, in RFC3339 format. // Example: `2018-03-20T12:32:53.532Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m AppCatalogSubscriptionSummary) String() string { return common.PointerString(m) } ���������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_details.go�������������0000664�0000000�0000000�00000002655�13771713062�0031072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AttachBootVolumeDetails The representation of AttachBootVolumeDetails type AttachBootVolumeDetails struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" json:"bootVolumeId"` // The OCID of the instance. InstanceId *string `mandatory:"true" json:"instanceId"` // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` } func (m AttachBootVolumeDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_boot_volume_request_response.go����0000664�0000000�0000000�00000005624�13771713062�0033052�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // AttachBootVolumeRequest wrapper for the AttachBootVolume operation type AttachBootVolumeRequest struct { // Attach boot volume request AttachBootVolumeDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request AttachBootVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request AttachBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request AttachBootVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // AttachBootVolumeResponse wrapper for the AttachBootVolume operation type AttachBootVolumeResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeAttachment instance BootVolumeAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response AttachBootVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response AttachBootVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_emulated_volume_details.go���������0000664�0000000�0000000�00000006126�13771713062�0031724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // AttachEmulatedVolumeDetails The representation of AttachEmulatedVolumeDetails type AttachEmulatedVolumeDetails struct { // The OCID of the instance. InstanceId *string `mandatory:"true" json:"instanceId"` // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` // The device name. Device *string `mandatory:"false" json:"device"` // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether the attachment should be created in shareable mode. If an attachment // is created in shareable mode, then other instances can attach the same volume, provided // that they also create their attachments in shareable mode. Only certain volume types can // be attached in shareable mode. Defaults to false if not specified. IsShareable *bool `mandatory:"false" json:"isShareable"` } //GetDevice returns Device func (m AttachEmulatedVolumeDetails) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m AttachEmulatedVolumeDetails) GetDisplayName() *string { return m.DisplayName } //GetInstanceId returns InstanceId func (m AttachEmulatedVolumeDetails) GetInstanceId() *string { return m.InstanceId } //GetIsReadOnly returns IsReadOnly func (m AttachEmulatedVolumeDetails) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m AttachEmulatedVolumeDetails) GetIsShareable() *bool { return m.IsShareable } //GetVolumeId returns VolumeId func (m AttachEmulatedVolumeDetails) GetVolumeId() *string { return m.VolumeId } func (m AttachEmulatedVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m AttachEmulatedVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeAttachEmulatedVolumeDetails AttachEmulatedVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeAttachEmulatedVolumeDetails }{ "emulated", (MarshalTypeAttachEmulatedVolumeDetails)(m), } return json.Marshal(&s) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_i_scsi_volume_details.go�����������0000664�0000000�0000000�00000006256�13771713062�0031401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // AttachIScsiVolumeDetails The representation of AttachIScsiVolumeDetails type AttachIScsiVolumeDetails struct { // The OCID of the instance. InstanceId *string `mandatory:"true" json:"instanceId"` // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` // The device name. Device *string `mandatory:"false" json:"device"` // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether the attachment should be created in shareable mode. If an attachment // is created in shareable mode, then other instances can attach the same volume, provided // that they also create their attachments in shareable mode. Only certain volume types can // be attached in shareable mode. Defaults to false if not specified. IsShareable *bool `mandatory:"false" json:"isShareable"` // Whether to use CHAP authentication for the volume attachment. Defaults to false. UseChap *bool `mandatory:"false" json:"useChap"` } //GetDevice returns Device func (m AttachIScsiVolumeDetails) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m AttachIScsiVolumeDetails) GetDisplayName() *string { return m.DisplayName } //GetInstanceId returns InstanceId func (m AttachIScsiVolumeDetails) GetInstanceId() *string { return m.InstanceId } //GetIsReadOnly returns IsReadOnly func (m AttachIScsiVolumeDetails) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m AttachIScsiVolumeDetails) GetIsShareable() *bool { return m.IsShareable } //GetVolumeId returns VolumeId func (m AttachIScsiVolumeDetails) GetVolumeId() *string { return m.VolumeId } func (m AttachIScsiVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m AttachIScsiVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeAttachIScsiVolumeDetails AttachIScsiVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeAttachIScsiVolumeDetails }{ "iscsi", (MarshalTypeAttachIScsiVolumeDetails)(m), } return json.Marshal(&s) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_details.go�����������0000664�0000000�0000000�00000003541�13771713062�0031301�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AttachLoadBalancerDetails Represents a load balancer that is to be attached to an instance pool. type AttachLoadBalancerDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer to attach to the instance pool. LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` // The name of the backend set on the load balancer to add instances to. BackendSetName *string `mandatory:"true" json:"backendSetName"` // The port value to use when creating the backend set. Port *int `mandatory:"true" json:"port"` // Indicates which VNIC on each instance in the pool should be used to associate with the load balancer. Possible values are "PrimaryVnic" or the displayName of one of the secondary VNICs on the instance configuration that is associated with the instance pool. VnicSelection *string `mandatory:"true" json:"vnicSelection"` } func (m AttachLoadBalancerDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_load_balancer_request_response.go��0000664�0000000�0000000�00000006747�13771713062�0033275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // AttachLoadBalancerRequest wrapper for the AttachLoadBalancer operation type AttachLoadBalancerRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // Load balancer being attached AttachLoadBalancerDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request AttachLoadBalancerRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request AttachLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request AttachLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // AttachLoadBalancerResponse wrapper for the AttachLoadBalancer operation type AttachLoadBalancerResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response AttachLoadBalancerResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response AttachLoadBalancerResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_paravirtualized_volume_details.go��0000664�0000000�0000000�00000006641�13771713062�0033334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // AttachParavirtualizedVolumeDetails The representation of AttachParavirtualizedVolumeDetails type AttachParavirtualizedVolumeDetails struct { // The OCID of the instance. InstanceId *string `mandatory:"true" json:"instanceId"` // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` // The device name. Device *string `mandatory:"false" json:"device"` // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether the attachment should be created in shareable mode. If an attachment // is created in shareable mode, then other instances can attach the same volume, provided // that they also create their attachments in shareable mode. Only certain volume types can // be attached in shareable mode. Defaults to false if not specified. IsShareable *bool `mandatory:"false" json:"isShareable"` // Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` } //GetDevice returns Device func (m AttachParavirtualizedVolumeDetails) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m AttachParavirtualizedVolumeDetails) GetDisplayName() *string { return m.DisplayName } //GetInstanceId returns InstanceId func (m AttachParavirtualizedVolumeDetails) GetInstanceId() *string { return m.InstanceId } //GetIsReadOnly returns IsReadOnly func (m AttachParavirtualizedVolumeDetails) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m AttachParavirtualizedVolumeDetails) GetIsShareable() *bool { return m.IsShareable } //GetVolumeId returns VolumeId func (m AttachParavirtualizedVolumeDetails) GetVolumeId() *string { return m.VolumeId } func (m AttachParavirtualizedVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m AttachParavirtualizedVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeAttachParavirtualizedVolumeDetails AttachParavirtualizedVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeAttachParavirtualizedVolumeDetails }{ "paravirtualized", (MarshalTypeAttachParavirtualizedVolumeDetails)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������attach_service_determined_volume_details.go���������������������������������������������������������0000664�0000000�0000000�00000006347�13771713062�0033712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // AttachServiceDeterminedVolumeDetails The representation of AttachServiceDeterminedVolumeDetails type AttachServiceDeterminedVolumeDetails struct { // The OCID of the instance. InstanceId *string `mandatory:"true" json:"instanceId"` // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` // The device name. Device *string `mandatory:"false" json:"device"` // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether the attachment should be created in shareable mode. If an attachment // is created in shareable mode, then other instances can attach the same volume, provided // that they also create their attachments in shareable mode. Only certain volume types can // be attached in shareable mode. Defaults to false if not specified. IsShareable *bool `mandatory:"false" json:"isShareable"` } //GetDevice returns Device func (m AttachServiceDeterminedVolumeDetails) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m AttachServiceDeterminedVolumeDetails) GetDisplayName() *string { return m.DisplayName } //GetInstanceId returns InstanceId func (m AttachServiceDeterminedVolumeDetails) GetInstanceId() *string { return m.InstanceId } //GetIsReadOnly returns IsReadOnly func (m AttachServiceDeterminedVolumeDetails) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m AttachServiceDeterminedVolumeDetails) GetIsShareable() *bool { return m.IsShareable } //GetVolumeId returns VolumeId func (m AttachServiceDeterminedVolumeDetails) GetVolumeId() *string { return m.VolumeId } func (m AttachServiceDeterminedVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m AttachServiceDeterminedVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeAttachServiceDeterminedVolumeDetails AttachServiceDeterminedVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeAttachServiceDeterminedVolumeDetails }{ "service_determined", (MarshalTypeAttachServiceDeterminedVolumeDetails)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_service_id_request_response.go�����0000664�0000000�0000000�00000005640�13771713062�0032632�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // AttachServiceIdRequest wrapper for the AttachServiceId operation type AttachServiceIdRequest struct { // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` // ServiceId of Service to be attached to a service gateway. AttachServiceDetails ServiceIdRequestDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request AttachServiceIdRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request AttachServiceIdRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request AttachServiceIdRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // AttachServiceIdResponse wrapper for the AttachServiceId operation type AttachServiceIdResponse struct { // The underlying http response RawResponse *http.Response // The ServiceGateway instance ServiceGateway `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response AttachServiceIdResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response AttachServiceIdResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_details.go��������������������0000664�0000000�0000000�00000003625�13771713062�0027475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // AttachVnicDetails The representation of AttachVnicDetails type AttachVnicDetails struct { // Details for creating a new VNIC. CreateVnicDetails *CreateVnicDetails `mandatory:"true" json:"createVnicDetails"` // The OCID of the instance. InstanceId *string `mandatory:"true" json:"instanceId"` // A user-friendly name for the attachment. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Which physical network interface card (NIC) the VNIC will use. Defaults to 0. // Certain bare metal instance shapes have two active physical NICs (0 and 1). If // you add a secondary VNIC to one of these instances, you can specify which NIC // the VNIC will use. For more information, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). NicIndex *int `mandatory:"false" json:"nicIndex"` } func (m AttachVnicDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_vnic_request_response.go�����������0000664�0000000�0000000�00000005472�13771713062�0031460�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // AttachVnicRequest wrapper for the AttachVnic operation type AttachVnicRequest struct { // Attach VNIC details. AttachVnicDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request AttachVnicRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request AttachVnicRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request AttachVnicRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // AttachVnicResponse wrapper for the AttachVnic operation type AttachVnicResponse struct { // The underlying http response RawResponse *http.Response // The VnicAttachment instance VnicAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response AttachVnicResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response AttachVnicResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_details.go������������������0000664�0000000�0000000�00000010172�13771713062�0030040�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // AttachVolumeDetails The representation of AttachVolumeDetails type AttachVolumeDetails interface { // The OCID of the instance. GetInstanceId() *string // The OCID of the volume. GetVolumeId() *string // The device name. GetDevice() *string // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. GetDisplayName() *string // Whether the attachment was created in read-only mode. GetIsReadOnly() *bool // Whether the attachment should be created in shareable mode. If an attachment // is created in shareable mode, then other instances can attach the same volume, provided // that they also create their attachments in shareable mode. Only certain volume types can // be attached in shareable mode. Defaults to false if not specified. GetIsShareable() *bool } type attachvolumedetails struct { JsonData []byte InstanceId *string `mandatory:"true" json:"instanceId"` VolumeId *string `mandatory:"true" json:"volumeId"` Device *string `mandatory:"false" json:"device"` DisplayName *string `mandatory:"false" json:"displayName"` IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` IsShareable *bool `mandatory:"false" json:"isShareable"` Type string `json:"type"` } // UnmarshalJSON unmarshals json func (m *attachvolumedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerattachvolumedetails attachvolumedetails s := struct { Model Unmarshalerattachvolumedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.InstanceId = s.Model.InstanceId m.VolumeId = s.Model.VolumeId m.Device = s.Model.Device m.DisplayName = s.Model.DisplayName m.IsReadOnly = s.Model.IsReadOnly m.IsShareable = s.Model.IsShareable m.Type = s.Model.Type return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *attachvolumedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Type { case "service_determined": mm := AttachServiceDeterminedVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err case "emulated": mm := AttachEmulatedVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err case "iscsi": mm := AttachIScsiVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err case "paravirtualized": mm := AttachParavirtualizedVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } //GetInstanceId returns InstanceId func (m attachvolumedetails) GetInstanceId() *string { return m.InstanceId } //GetVolumeId returns VolumeId func (m attachvolumedetails) GetVolumeId() *string { return m.VolumeId } //GetDevice returns Device func (m attachvolumedetails) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m attachvolumedetails) GetDisplayName() *string { return m.DisplayName } //GetIsReadOnly returns IsReadOnly func (m attachvolumedetails) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m attachvolumedetails) GetIsShareable() *bool { return m.IsShareable } func (m attachvolumedetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/attach_volume_request_response.go���������0000664�0000000�0000000�00000005527�13771713062�0032031�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // AttachVolumeRequest wrapper for the AttachVolume operation type AttachVolumeRequest struct { // Attach volume request AttachVolumeDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request AttachVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request AttachVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request AttachVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // AttachVolumeResponse wrapper for the AttachVolume operation type AttachVolumeResponse struct { // The underlying http response RawResponse *http.Response // The VolumeAttachment instance VolumeAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response AttachVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response AttachVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/bgp_session_info.go�����������������������0000664�0000000�0000000�00000007013�13771713062�0027026�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // BgpSessionInfo Information for establishing a BGP session for the IPSec tunnel. type BgpSessionInfo struct { // The IP address for the Oracle end of the inside tunnel interface. // If the tunnel's `routing` attribute is set to `BGP` // (see IPSecConnectionTunnel), this IP address // is required and used for the tunnel's BGP session. // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP // address so you can troubleshoot or monitor the tunnel. // The value must be a /30 or /31. // Example: `10.0.0.4/31` OracleInterfaceIp *string `mandatory:"false" json:"oracleInterfaceIp"` // The IP address for the CPE end of the inside tunnel interface. // If the tunnel's `routing` attribute is set to `BGP` // (see IPSecConnectionTunnel), this IP address // is required and used for the tunnel's BGP session. // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP // address so you can troubleshoot or monitor the tunnel. // The value must be a /30 or /31. // Example: `10.0.0.5/31` CustomerInterfaceIp *string `mandatory:"false" json:"customerInterfaceIp"` // The Oracle BGP ASN. OracleBgpAsn *string `mandatory:"false" json:"oracleBgpAsn"` // If the tunnel's `routing` attribute is set to `BGP` // (see IPSecConnectionTunnel), this ASN // is required and used for the tunnel's BGP session. This is the ASN of the network on the // CPE end of the BGP session. Can be a 2-byte or 4-byte ASN. Uses "asplain" format. // If the tunnel uses static routing, the `customerBgpAsn` must be null. // Example: `12345` (2-byte) or `1587232876` (4-byte) CustomerBgpAsn *string `mandatory:"false" json:"customerBgpAsn"` // The state of the BGP session. BgpState BgpSessionInfoBgpStateEnum `mandatory:"false" json:"bgpState,omitempty"` } func (m BgpSessionInfo) String() string { return common.PointerString(m) } // BgpSessionInfoBgpStateEnum Enum with underlying type: string type BgpSessionInfoBgpStateEnum string // Set of constants representing the allowable values for BgpSessionInfoBgpStateEnum const ( BgpSessionInfoBgpStateUp BgpSessionInfoBgpStateEnum = "UP" BgpSessionInfoBgpStateDown BgpSessionInfoBgpStateEnum = "DOWN" ) var mappingBgpSessionInfoBgpState = map[string]BgpSessionInfoBgpStateEnum{ "UP": BgpSessionInfoBgpStateUp, "DOWN": BgpSessionInfoBgpStateDown, } // GetBgpSessionInfoBgpStateEnumValues Enumerates the set of values for BgpSessionInfoBgpStateEnum func GetBgpSessionInfoBgpStateEnumValues() []BgpSessionInfoBgpStateEnum { values := make([]BgpSessionInfoBgpStateEnum, 0) for _, v := range mappingBgpSessionInfoBgpState { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/boot_volume.go����������������������������0000664�0000000�0000000�00000020762�13771713062�0026040�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // BootVolume A detachable boot volume device that contains the image used to boot a Compute instance. For more information, see // Overview of Boot Volumes (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumes.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type BootVolume struct { // The availability domain of the boot volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the boot volume. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The boot volume's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The current state of a boot volume. LifecycleState BootVolumeLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The size of the volume in MBs. The value must be a multiple of 1024. // This field is deprecated. Please use sizeInGBs. SizeInMBs *int64 `mandatory:"true" json:"sizeInMBs"` // The date and time the boot volume was created. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // System tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The image OCID used to create the boot volume. ImageId *string `mandatory:"false" json:"imageId"` // Specifies whether the boot volume's data has finished copying from the source boot volume or boot volume backup. IsHydrated *bool `mandatory:"false" json:"isHydrated"` // The number of volume performance units (VPUs) that will be applied to this boot volume per GB, // representing the Block Volume service's elastic performance options. // See Block Volume Elastic Performance (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumeelasticperformance.htm) for more information. // Allowed values: // * `10`: Represents Balanced option. // * `20`: Represents Higher Performance option. VpusPerGB *int64 `mandatory:"false" json:"vpusPerGB"` // The size of the boot volume in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The boot volume source, either an existing boot volume in the same availability domain or a boot volume backup. // If null, this means that the boot volume was created from an image. SourceDetails BootVolumeSourceDetails `mandatory:"false" json:"sourceDetails"` // The OCID of the source volume group. VolumeGroupId *string `mandatory:"false" json:"volumeGroupId"` // The OCID of the Key Management master encryption key assigned to the boot volume. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m BootVolume) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *BootVolume) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` SystemTags map[string]map[string]interface{} `json:"systemTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` ImageId *string `json:"imageId"` IsHydrated *bool `json:"isHydrated"` VpusPerGB *int64 `json:"vpusPerGB"` SizeInGBs *int64 `json:"sizeInGBs"` SourceDetails bootvolumesourcedetails `json:"sourceDetails"` VolumeGroupId *string `json:"volumeGroupId"` KmsKeyId *string `json:"kmsKeyId"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` Id *string `json:"id"` LifecycleState BootVolumeLifecycleStateEnum `json:"lifecycleState"` SizeInMBs *int64 `json:"sizeInMBs"` TimeCreated *common.SDKTime `json:"timeCreated"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.SystemTags = model.SystemTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.ImageId = model.ImageId m.IsHydrated = model.IsHydrated m.VpusPerGB = model.VpusPerGB m.SizeInGBs = model.SizeInGBs nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(BootVolumeSourceDetails) } else { m.SourceDetails = nil } m.VolumeGroupId = model.VolumeGroupId m.KmsKeyId = model.KmsKeyId m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.Id = model.Id m.LifecycleState = model.LifecycleState m.SizeInMBs = model.SizeInMBs m.TimeCreated = model.TimeCreated return } // BootVolumeLifecycleStateEnum Enum with underlying type: string type BootVolumeLifecycleStateEnum string // Set of constants representing the allowable values for BootVolumeLifecycleStateEnum const ( BootVolumeLifecycleStateProvisioning BootVolumeLifecycleStateEnum = "PROVISIONING" BootVolumeLifecycleStateRestoring BootVolumeLifecycleStateEnum = "RESTORING" BootVolumeLifecycleStateAvailable BootVolumeLifecycleStateEnum = "AVAILABLE" BootVolumeLifecycleStateTerminating BootVolumeLifecycleStateEnum = "TERMINATING" BootVolumeLifecycleStateTerminated BootVolumeLifecycleStateEnum = "TERMINATED" BootVolumeLifecycleStateFaulty BootVolumeLifecycleStateEnum = "FAULTY" ) var mappingBootVolumeLifecycleState = map[string]BootVolumeLifecycleStateEnum{ "PROVISIONING": BootVolumeLifecycleStateProvisioning, "RESTORING": BootVolumeLifecycleStateRestoring, "AVAILABLE": BootVolumeLifecycleStateAvailable, "TERMINATING": BootVolumeLifecycleStateTerminating, "TERMINATED": BootVolumeLifecycleStateTerminated, "FAULTY": BootVolumeLifecycleStateFaulty, } // GetBootVolumeLifecycleStateEnumValues Enumerates the set of values for BootVolumeLifecycleStateEnum func GetBootVolumeLifecycleStateEnumValues() []BootVolumeLifecycleStateEnum { values := make([]BootVolumeLifecycleStateEnum, 0) for _, v := range mappingBootVolumeLifecycleState { values = append(values, v) } return values } ��������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_attachment.go�����������������0000664�0000000�0000000�00000007457�13771713062�0030256�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // BootVolumeAttachment Represents an attachment between a boot volume and an instance. // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type BootVolumeAttachment struct { // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" json:"bootVolumeId"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the boot volume attachment. Id *string `mandatory:"true" json:"id"` // The OCID of the instance the boot volume is attached to. InstanceId *string `mandatory:"true" json:"instanceId"` // The current state of the boot volume attachment. LifecycleState BootVolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the boot volume was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My boot volume` DisplayName *string `mandatory:"false" json:"displayName"` // Whether in-transit encryption for the boot volume's paravirtualized attachment is enabled or not. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` } func (m BootVolumeAttachment) String() string { return common.PointerString(m) } // BootVolumeAttachmentLifecycleStateEnum Enum with underlying type: string type BootVolumeAttachmentLifecycleStateEnum string // Set of constants representing the allowable values for BootVolumeAttachmentLifecycleStateEnum const ( BootVolumeAttachmentLifecycleStateAttaching BootVolumeAttachmentLifecycleStateEnum = "ATTACHING" BootVolumeAttachmentLifecycleStateAttached BootVolumeAttachmentLifecycleStateEnum = "ATTACHED" BootVolumeAttachmentLifecycleStateDetaching BootVolumeAttachmentLifecycleStateEnum = "DETACHING" BootVolumeAttachmentLifecycleStateDetached BootVolumeAttachmentLifecycleStateEnum = "DETACHED" ) var mappingBootVolumeAttachmentLifecycleState = map[string]BootVolumeAttachmentLifecycleStateEnum{ "ATTACHING": BootVolumeAttachmentLifecycleStateAttaching, "ATTACHED": BootVolumeAttachmentLifecycleStateAttached, "DETACHING": BootVolumeAttachmentLifecycleStateDetaching, "DETACHED": BootVolumeAttachmentLifecycleStateDetached, } // GetBootVolumeAttachmentLifecycleStateEnumValues Enumerates the set of values for BootVolumeAttachmentLifecycleStateEnum func GetBootVolumeAttachmentLifecycleStateEnumValues() []BootVolumeAttachmentLifecycleStateEnum { values := make([]BootVolumeAttachmentLifecycleStateEnum, 0) for _, v := range mappingBootVolumeAttachmentLifecycleState { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_backup.go���������������������0000664�0000000�0000000�00000021302�13771713062�0027354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // BootVolumeBackup A point-in-time copy of a boot volume that can then be used to create // a new boot volume or recover a boot volume. For more information, see Overview // of Boot Volume Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumebackups.htm) // To use any of the API operations, you must be authorized in an IAM policy. // If you're not authorized, talk to an administrator. If you're an administrator // who needs to write policies to give users access, see Getting Started with // Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type BootVolumeBackup struct { // The OCID of the compartment that contains the boot volume backup. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name for the boot volume backup. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the boot volume backup. Id *string `mandatory:"true" json:"id"` // The current state of a boot volume backup. LifecycleState BootVolumeBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the boot volume backup was created. This is the time the actual point-in-time image // of the volume data was taken. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the boot volume. BootVolumeId *string `mandatory:"false" json:"bootVolumeId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // System tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` // The date and time the volume backup will expire and be automatically deleted. // Format defined by RFC3339. This parameter will always be present for backups that // were created automatically by a scheduled-backup policy. For manually created backups, // it will be absent, signifying that there is no expiration time and the backup will // last forever until manually deleted. ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The image OCID used to create the boot volume the backup is taken from. ImageId *string `mandatory:"false" json:"imageId"` // The OCID of the Key Management master encryption assigned to the boot volume backup. // For more information about the Key Management service and encryption keys, see // Overview of Key Management (https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm) and // Using Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/usingkeys.htm). KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` // The size of the boot volume, in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The OCID of the source boot volume backup. SourceBootVolumeBackupId *string `mandatory:"false" json:"sourceBootVolumeBackupId"` // Specifies whether the backup was created manually, or via scheduled backup policy. SourceType BootVolumeBackupSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` // The date and time the request to create the boot volume backup was received. Format defined by RFC3339. TimeRequestReceived *common.SDKTime `mandatory:"false" json:"timeRequestReceived"` // The type of a volume backup. Type BootVolumeBackupTypeEnum `mandatory:"false" json:"type,omitempty"` // The size used by the backup, in GBs. It is typically smaller than sizeInGBs, depending on the space // consumed on the boot volume and whether the backup is full or incremental. UniqueSizeInGBs *int64 `mandatory:"false" json:"uniqueSizeInGBs"` } func (m BootVolumeBackup) String() string { return common.PointerString(m) } // BootVolumeBackupLifecycleStateEnum Enum with underlying type: string type BootVolumeBackupLifecycleStateEnum string // Set of constants representing the allowable values for BootVolumeBackupLifecycleStateEnum const ( BootVolumeBackupLifecycleStateCreating BootVolumeBackupLifecycleStateEnum = "CREATING" BootVolumeBackupLifecycleStateAvailable BootVolumeBackupLifecycleStateEnum = "AVAILABLE" BootVolumeBackupLifecycleStateTerminating BootVolumeBackupLifecycleStateEnum = "TERMINATING" BootVolumeBackupLifecycleStateTerminated BootVolumeBackupLifecycleStateEnum = "TERMINATED" BootVolumeBackupLifecycleStateFaulty BootVolumeBackupLifecycleStateEnum = "FAULTY" BootVolumeBackupLifecycleStateRequestReceived BootVolumeBackupLifecycleStateEnum = "REQUEST_RECEIVED" ) var mappingBootVolumeBackupLifecycleState = map[string]BootVolumeBackupLifecycleStateEnum{ "CREATING": BootVolumeBackupLifecycleStateCreating, "AVAILABLE": BootVolumeBackupLifecycleStateAvailable, "TERMINATING": BootVolumeBackupLifecycleStateTerminating, "TERMINATED": BootVolumeBackupLifecycleStateTerminated, "FAULTY": BootVolumeBackupLifecycleStateFaulty, "REQUEST_RECEIVED": BootVolumeBackupLifecycleStateRequestReceived, } // GetBootVolumeBackupLifecycleStateEnumValues Enumerates the set of values for BootVolumeBackupLifecycleStateEnum func GetBootVolumeBackupLifecycleStateEnumValues() []BootVolumeBackupLifecycleStateEnum { values := make([]BootVolumeBackupLifecycleStateEnum, 0) for _, v := range mappingBootVolumeBackupLifecycleState { values = append(values, v) } return values } // BootVolumeBackupSourceTypeEnum Enum with underlying type: string type BootVolumeBackupSourceTypeEnum string // Set of constants representing the allowable values for BootVolumeBackupSourceTypeEnum const ( BootVolumeBackupSourceTypeManual BootVolumeBackupSourceTypeEnum = "MANUAL" BootVolumeBackupSourceTypeScheduled BootVolumeBackupSourceTypeEnum = "SCHEDULED" ) var mappingBootVolumeBackupSourceType = map[string]BootVolumeBackupSourceTypeEnum{ "MANUAL": BootVolumeBackupSourceTypeManual, "SCHEDULED": BootVolumeBackupSourceTypeScheduled, } // GetBootVolumeBackupSourceTypeEnumValues Enumerates the set of values for BootVolumeBackupSourceTypeEnum func GetBootVolumeBackupSourceTypeEnumValues() []BootVolumeBackupSourceTypeEnum { values := make([]BootVolumeBackupSourceTypeEnum, 0) for _, v := range mappingBootVolumeBackupSourceType { values = append(values, v) } return values } // BootVolumeBackupTypeEnum Enum with underlying type: string type BootVolumeBackupTypeEnum string // Set of constants representing the allowable values for BootVolumeBackupTypeEnum const ( BootVolumeBackupTypeFull BootVolumeBackupTypeEnum = "FULL" BootVolumeBackupTypeIncremental BootVolumeBackupTypeEnum = "INCREMENTAL" ) var mappingBootVolumeBackupType = map[string]BootVolumeBackupTypeEnum{ "FULL": BootVolumeBackupTypeFull, "INCREMENTAL": BootVolumeBackupTypeIncremental, } // GetBootVolumeBackupTypeEnumValues Enumerates the set of values for BootVolumeBackupTypeEnum func GetBootVolumeBackupTypeEnumValues() []BootVolumeBackupTypeEnum { values := make([]BootVolumeBackupTypeEnum, 0) for _, v := range mappingBootVolumeBackupType { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_kms_key.go��������������������0000664�0000000�0000000�00000002417�13771713062�0027557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // BootVolumeKmsKey The Key Management master encryption key associated with this volume. type BootVolumeKmsKey struct { // The OCID of the Key Management key assigned to this volume. If the volume is not using Key Management, then the `kmsKeyId` will be a null string. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m BootVolumeKmsKey) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/boot_volume_source_details.go�������������0000664�0000000�0000000�00000004051�13771713062�0031116�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // BootVolumeSourceDetails The representation of BootVolumeSourceDetails type BootVolumeSourceDetails interface { } type bootvolumesourcedetails struct { JsonData []byte Type string `json:"type"` } // UnmarshalJSON unmarshals json func (m *bootvolumesourcedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerbootvolumesourcedetails bootvolumesourcedetails s := struct { Model Unmarshalerbootvolumesourcedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.Type = s.Model.Type return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *bootvolumesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Type { case "bootVolumeBackup": mm := BootVolumeSourceFromBootVolumeBackupDetails{} err = json.Unmarshal(data, &mm) return mm, err case "bootVolume": mm := BootVolumeSourceFromBootVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m bootvolumesourcedetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������boot_volume_source_from_boot_volume_backup_details.go�����������������������������������������������0000664�0000000�0000000�00000003261�13771713062�0036023�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // BootVolumeSourceFromBootVolumeBackupDetails Specifies the boot volume backup. type BootVolumeSourceFromBootVolumeBackupDetails struct { // The OCID of the boot volume backup. Id *string `mandatory:"true" json:"id"` } func (m BootVolumeSourceFromBootVolumeBackupDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m BootVolumeSourceFromBootVolumeBackupDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeBootVolumeSourceFromBootVolumeBackupDetails BootVolumeSourceFromBootVolumeBackupDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeBootVolumeSourceFromBootVolumeBackupDetails }{ "bootVolumeBackup", (MarshalTypeBootVolumeSourceFromBootVolumeBackupDetails)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������boot_volume_source_from_boot_volume_details.go������������������������������������������������������0000664�0000000�0000000�00000003164�13771713062�0034500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // BootVolumeSourceFromBootVolumeDetails Specifies the source boot volume. type BootVolumeSourceFromBootVolumeDetails struct { // The OCID of the boot volume. Id *string `mandatory:"true" json:"id"` } func (m BootVolumeSourceFromBootVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m BootVolumeSourceFromBootVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeBootVolumeSourceFromBootVolumeDetails BootVolumeSourceFromBootVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeBootVolumeSourceFromBootVolumeDetails }{ "bootVolume", (MarshalTypeBootVolumeSourceFromBootVolumeDetails)(m), } return json.Marshal(&s) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������bulk_add_virtual_circuit_public_prefixes_details.go�������������������������������������������������0000664�0000000�0000000�00000002470�13771713062�0035430�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // BulkAddVirtualCircuitPublicPrefixesDetails The representation of BulkAddVirtualCircuitPublicPrefixesDetails type BulkAddVirtualCircuitPublicPrefixesDetails struct { // The public IP prefixes (CIDRs) to add to the public virtual circuit. PublicPrefixes []CreateVirtualCircuitPublicPrefixDetails `mandatory:"true" json:"publicPrefixes"` } func (m BulkAddVirtualCircuitPublicPrefixesDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������bulk_add_virtual_circuit_public_prefixes_request_response.go����������������������������������������0000664�0000000�0000000�00000004634�13771713062�0037415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // BulkAddVirtualCircuitPublicPrefixesRequest wrapper for the BulkAddVirtualCircuitPublicPrefixes operation type BulkAddVirtualCircuitPublicPrefixesRequest struct { // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` // Request with publix prefixes to be added to the virtual circuit BulkAddVirtualCircuitPublicPrefixesDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request BulkAddVirtualCircuitPublicPrefixesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request BulkAddVirtualCircuitPublicPrefixesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request BulkAddVirtualCircuitPublicPrefixesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // BulkAddVirtualCircuitPublicPrefixesResponse wrapper for the BulkAddVirtualCircuitPublicPrefixes operation type BulkAddVirtualCircuitPublicPrefixesResponse struct { // The underlying http response RawResponse *http.Response } func (response BulkAddVirtualCircuitPublicPrefixesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response BulkAddVirtualCircuitPublicPrefixesResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������bulk_delete_virtual_circuit_public_prefixes_details.go����������������������������������������������0000664�0000000�0000000�00000002511�13771713062�0036136�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // BulkDeleteVirtualCircuitPublicPrefixesDetails The representation of BulkDeleteVirtualCircuitPublicPrefixesDetails type BulkDeleteVirtualCircuitPublicPrefixesDetails struct { // The public IP prefixes (CIDRs) to remove from the public virtual circuit. PublicPrefixes []DeleteVirtualCircuitPublicPrefixDetails `mandatory:"true" json:"publicPrefixes"` } func (m BulkDeleteVirtualCircuitPublicPrefixesDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������bulk_delete_virtual_circuit_public_prefixes_request_response.go�������������������������������������0000664�0000000�0000000�00000004704�13771713062�0040125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // BulkDeleteVirtualCircuitPublicPrefixesRequest wrapper for the BulkDeleteVirtualCircuitPublicPrefixes operation type BulkDeleteVirtualCircuitPublicPrefixesRequest struct { // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` // Request with publix prefixes to be deleted from the virtual circuit BulkDeleteVirtualCircuitPublicPrefixesDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request BulkDeleteVirtualCircuitPublicPrefixesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request BulkDeleteVirtualCircuitPublicPrefixesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request BulkDeleteVirtualCircuitPublicPrefixesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // BulkDeleteVirtualCircuitPublicPrefixesResponse wrapper for the BulkDeleteVirtualCircuitPublicPrefixes operation type BulkDeleteVirtualCircuitPublicPrefixesResponse struct { // The underlying http response RawResponse *http.Response } func (response BulkDeleteVirtualCircuitPublicPrefixesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response BulkDeleteVirtualCircuitPublicPrefixesResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/capture_console_history_details.go��������0000664�0000000�0000000�00000004070�13771713062�0032153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CaptureConsoleHistoryDetails The representation of CaptureConsoleHistoryDetails type CaptureConsoleHistoryDetails struct { // The OCID of the instance to get the console history from. InstanceId *string `mandatory:"true" json:"instanceId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CaptureConsoleHistoryDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������capture_console_history_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005701�13771713062�0034057�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CaptureConsoleHistoryRequest wrapper for the CaptureConsoleHistory operation type CaptureConsoleHistoryRequest struct { // Console history details CaptureConsoleHistoryDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CaptureConsoleHistoryRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CaptureConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CaptureConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CaptureConsoleHistoryResponse wrapper for the CaptureConsoleHistory operation type CaptureConsoleHistoryResponse struct { // The underlying http response RawResponse *http.Response // The ConsoleHistory instance ConsoleHistory `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CaptureConsoleHistoryResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CaptureConsoleHistoryResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������change_boot_volume_backup_compartment_details.go����������������������������������������������������0000664�0000000�0000000�00000002534�13771713062�0034726�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeBootVolumeBackupCompartmentDetails Contains the details for the compartment to move the boot volume backup to. type ChangeBootVolumeBackupCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the boot volume backup to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeBootVolumeBackupCompartmentDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������change_boot_volume_backup_compartment_request_response.go�������������������������������������������0000664�0000000�0000000�00000005270�13771713062�0036707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeBootVolumeBackupCompartmentRequest wrapper for the ChangeBootVolumeBackupCompartment operation type ChangeBootVolumeBackupCompartmentRequest struct { // The OCID of the boot volume backup. BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` // Request to change the compartment of given boot volume backup. ChangeBootVolumeBackupCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeBootVolumeBackupCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeBootVolumeBackupCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeBootVolumeBackupCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeBootVolumeBackupCompartmentResponse wrapper for the ChangeBootVolumeBackupCompartment operation type ChangeBootVolumeBackupCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeBootVolumeBackupCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeBootVolumeBackupCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_boot_volume_compartment_details.go�0000664�0000000�0000000�00000002474�13771713062�0033463�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeBootVolumeCompartmentDetails Contains the details for the compartment to move the boot volume to. type ChangeBootVolumeCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the boot volume to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeBootVolumeCompartmentDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_boot_volume_compartment_request_response.go��������������������������������������������������0000664�0000000�0000000�00000005126�13771713062�0035362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeBootVolumeCompartmentRequest wrapper for the ChangeBootVolumeCompartment operation type ChangeBootVolumeCompartmentRequest struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` // Request to change the compartment of given boot volume. ChangeBootVolumeCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeBootVolumeCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeBootVolumeCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeBootVolumeCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeBootVolumeCompartmentResponse wrapper for the ChangeBootVolumeCompartment operation type ChangeBootVolumeCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeBootVolumeCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeBootVolumeCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_cluster_network_compartment_details.go�������������������������������������������������������0000664�0000000�0000000�00000002513�13771713062�0034276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeClusterNetworkCompartmentDetails The configuration details for the move operation. type ChangeClusterNetworkCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment // into which the resource should be moved. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeClusterNetworkCompartmentDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_cluster_network_compartment_request_response.go����������������������������������������������0000664�0000000�0000000�00000007135�13771713062�0036264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeClusterNetworkCompartmentRequest wrapper for the ChangeClusterNetworkCompartment operation type ChangeClusterNetworkCompartmentRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. ClusterNetworkId *string `mandatory:"true" contributesTo:"path" name:"clusterNetworkId"` // Request to change the compartment of given cluster network. ChangeClusterNetworkCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeClusterNetworkCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeClusterNetworkCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeClusterNetworkCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeClusterNetworkCompartmentResponse wrapper for the ChangeClusterNetworkCompartment operation type ChangeClusterNetworkCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeClusterNetworkCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeClusterNetworkCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_cpe_compartment_details.go���������0000664�0000000�0000000�00000002427�13771713062�0031676�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeCpeCompartmentDetails The configuration details for the move operation. type ChangeCpeCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // CPE object to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeCpeCompartmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_cpe_compartment_request_response.go0000664�0000000�0000000�00000005723�13771713062�0033661�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeCpeCompartmentRequest wrapper for the ChangeCpeCompartment operation type ChangeCpeCompartmentRequest struct { // The OCID of the CPE. CpeId *string `mandatory:"true" contributesTo:"path" name:"cpeId"` // Request to change the compartment of a CPE. ChangeCpeCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeCpeCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeCpeCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeCpeCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeCpeCompartmentResponse wrapper for the ChangeCpeCompartment operation type ChangeCpeCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeCpeCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeCpeCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������change_cross_connect_compartment_details.go���������������������������������������������������������0000664�0000000�0000000�00000002465�13771713062�0033714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeCrossConnectCompartmentDetails The configuration details for the move operation. type ChangeCrossConnectCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // cross-connect to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeCrossConnectCompartmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_cross_connect_compartment_request_response.go������������������������������������������������0000664�0000000�0000000�00000006145�13771713062�0035674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeCrossConnectCompartmentRequest wrapper for the ChangeCrossConnectCompartment operation type ChangeCrossConnectCompartmentRequest struct { // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` // Request to change the compartment of a Cross Connect. ChangeCrossConnectCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeCrossConnectCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeCrossConnectCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeCrossConnectCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeCrossConnectCompartmentResponse wrapper for the ChangeCrossConnectCompartment operation type ChangeCrossConnectCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeCrossConnectCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeCrossConnectCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_cross_connect_group_compartment_details.go���������������������������������������������������0000664�0000000�0000000�00000002512�13771713062�0035121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeCrossConnectGroupCompartmentDetails The configuration details for the move operation. type ChangeCrossConnectGroupCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // cross-connect group to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeCrossConnectGroupCompartmentDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_cross_connect_group_compartment_request_response.go������������������������������������������0000664�0000000�0000000�00000006267�13771713062�0037115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeCrossConnectGroupCompartmentRequest wrapper for the ChangeCrossConnectGroupCompartment operation type ChangeCrossConnectGroupCompartmentRequest struct { // The OCID of the cross-connect group. CrossConnectGroupId *string `mandatory:"true" contributesTo:"path" name:"crossConnectGroupId"` // Request to change the compartment of a Cross Connect Group. ChangeCrossConnectGroupCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeCrossConnectGroupCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeCrossConnectGroupCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeCrossConnectGroupCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeCrossConnectGroupCompartmentResponse wrapper for the ChangeCrossConnectGroupCompartment operation type ChangeCrossConnectGroupCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeCrossConnectGroupCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeCrossConnectGroupCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_dedicated_vm_host_compartment_details.go�����������������������������������������������������0000664�0000000�0000000�00000002546�13771713062�0034517�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeDedicatedVmHostCompartmentDetails Specifies the compartment to move the dedicated virtual machine host to. type ChangeDedicatedVmHostCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment // to move the dedicated virtual machine host to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeDedicatedVmHostCompartmentDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������change_dedicated_vm_host_compartment_request_response.go��������������������������������������������0000664�0000000�0000000�00000007505�13771713062�0036500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeDedicatedVmHostCompartmentRequest wrapper for the ChangeDedicatedVmHostCompartment operation type ChangeDedicatedVmHostCompartmentRequest struct { // The OCID of the dedicated VM host. DedicatedVmHostId *string `mandatory:"true" contributesTo:"path" name:"dedicatedVmHostId"` // The request to move the dedicated virtual machine host to a different compartment. ChangeDedicatedVmHostCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeDedicatedVmHostCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeDedicatedVmHostCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeDedicatedVmHostCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeDedicatedVmHostCompartmentResponse wrapper for the ChangeDedicatedVmHostCompartment operation type ChangeDedicatedVmHostCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response ChangeDedicatedVmHostCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeDedicatedVmHostCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_dhcp_options_compartment_details.go0000664�0000000�0000000�00000002470�13771713062�0033616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeDhcpOptionsCompartmentDetails The configuration details for the move operation. type ChangeDhcpOptionsCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // set of DHCP options to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeDhcpOptionsCompartmentDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_dhcp_options_compartment_request_response.go�������������������������������������������������0000664�0000000�0000000�00000006126�13771713062�0035522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeDhcpOptionsCompartmentRequest wrapper for the ChangeDhcpOptionsCompartment operation type ChangeDhcpOptionsCompartmentRequest struct { // The OCID for the set of DHCP options. DhcpId *string `mandatory:"true" contributesTo:"path" name:"dhcpId"` // Request to change the compartment of a set of DHCP Options. ChangeDhcpOptionsCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeDhcpOptionsCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeDhcpOptionsCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeDhcpOptionsCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeDhcpOptionsCompartmentResponse wrapper for the ChangeDhcpOptionsCompartment operation type ChangeDhcpOptionsCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeDhcpOptionsCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeDhcpOptionsCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_drg_compartment_details.go���������0000664�0000000�0000000�00000002420�13771713062�0031674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeDrgCompartmentDetails The configuration details for the move operation. type ChangeDrgCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // DRG to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeDrgCompartmentDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_drg_compartment_request_response.go0000664�0000000�0000000�00000006342�13771713062�0033664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeDrgCompartmentRequest wrapper for the ChangeDrgCompartment operation type ChangeDrgCompartmentRequest struct { // The OCID of the DRG. DrgId *string `mandatory:"true" contributesTo:"path" name:"drgId"` // Request to change the compartment of a DRG. ChangeDrgCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeDrgCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeDrgCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeDrgCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeDrgCompartmentResponse wrapper for the ChangeDrgCompartment operation type ChangeDrgCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response ChangeDrgCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeDrgCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_i_p_sec_connection_compartment_request_response.go�������������������������������������������0000664�0000000�0000000�00000006177�13771713062�0036657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeIPSecConnectionCompartmentRequest wrapper for the ChangeIPSecConnectionCompartment operation type ChangeIPSecConnectionCompartmentRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // Request to change the compartment of a Ipsec Connection. ChangeIpSecConnectionCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeIPSecConnectionCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeIPSecConnectionCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeIPSecConnectionCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeIPSecConnectionCompartmentResponse wrapper for the ChangeIPSecConnectionCompartment operation type ChangeIPSecConnectionCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeIPSecConnectionCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeIPSecConnectionCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_image_compartment_details.go�������0000664�0000000�0000000�00000002431�13771713062�0032204�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeImageCompartmentDetails The configuration details for the move operation. type ChangeImageCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the image to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeImageCompartmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_image_compartment_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000006715�13771713062�0034117�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeImageCompartmentRequest wrapper for the ChangeImageCompartment operation type ChangeImageCompartmentRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // Request to change the compartment of a given image. ChangeImageCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeImageCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeImageCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeImageCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeImageCompartmentResponse wrapper for the ChangeImageCompartment operation type ChangeImageCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeImageCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeImageCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_instance_compartment_details.go����0000664�0000000�0000000�00000002445�13771713062�0032733�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeInstanceCompartmentDetails The configuration details for the move operation. type ChangeInstanceCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the instance to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeInstanceCompartmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_instance_compartment_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000007276�13771713062�0034644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeInstanceCompartmentRequest wrapper for the ChangeInstanceCompartment operation type ChangeInstanceCompartmentRequest struct { // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` // Request to change the compartment of a given instance. ChangeInstanceCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeInstanceCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeInstanceCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeInstanceCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeInstanceCompartmentResponse wrapper for the ChangeInstanceCompartment operation type ChangeInstanceCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response ChangeInstanceCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeInstanceCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_instance_configuration_compartment_details.go������������������������������������������������0000664�0000000�0000000�00000002536�13771713062�0035604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeInstanceConfigurationCompartmentDetails The configuration details for the move operation. type ChangeInstanceConfigurationCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to // move the instance configuration to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeInstanceConfigurationCompartmentDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������change_instance_configuration_compartment_request_response.go���������������������������������������0000664�0000000�0000000�00000007177�13771713062�0037573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeInstanceConfigurationCompartmentRequest wrapper for the ChangeInstanceConfigurationCompartment operation type ChangeInstanceConfigurationCompartmentRequest struct { // The OCID of the instance configuration. InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` // Request to change the compartment of given instance configuration. ChangeInstanceConfigurationCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeInstanceConfigurationCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeInstanceConfigurationCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeInstanceConfigurationCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeInstanceConfigurationCompartmentResponse wrapper for the ChangeInstanceConfigurationCompartment operation type ChangeInstanceConfigurationCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeInstanceConfigurationCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeInstanceConfigurationCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_instance_pool_compartment_details.go���������������������������������������������������������0000664�0000000�0000000�00000002472�13771713062�0033705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeInstancePoolCompartmentDetails The configuration details for the move operation. type ChangeInstancePoolCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to // move the instance pool to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeInstancePoolCompartmentDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_instance_pool_compartment_request_response.go������������������������������������������������0000664�0000000�0000000�00000007070�13771713062�0035665�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeInstancePoolCompartmentRequest wrapper for the ChangeInstancePoolCompartment operation type ChangeInstancePoolCompartmentRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // Request to change the compartment of given instance pool. ChangeInstancePoolCompartmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeInstancePoolCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeInstancePoolCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeInstancePoolCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeInstancePoolCompartmentResponse wrapper for the ChangeInstancePoolCompartment operation type ChangeInstancePoolCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeInstancePoolCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeInstancePoolCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_internet_gateway_compartment_details.go������������������������������������������������������0000664�0000000�0000000�00000002501�13771713062�0034412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeInternetGatewayCompartmentDetails The configuration details for the move operation. type ChangeInternetGatewayCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // internet gateway to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeInternetGatewayCompartmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_internet_gateway_compartment_request_response.go���������������������������������������������0000664�0000000�0000000�00000006174�13771713062�0036405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeInternetGatewayCompartmentRequest wrapper for the ChangeInternetGatewayCompartment operation type ChangeInternetGatewayCompartmentRequest struct { // The OCID of the internet gateway. IgId *string `mandatory:"true" contributesTo:"path" name:"igId"` // Request to change the compartment of an internet gateway. ChangeInternetGatewayCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeInternetGatewayCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeInternetGatewayCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeInternetGatewayCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeInternetGatewayCompartmentResponse wrapper for the ChangeInternetGatewayCompartment operation type ChangeInternetGatewayCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeInternetGatewayCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeInternetGatewayCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_ip_sec_connection_compartment_details.go�����������������������������������������������������0000664�0000000�0000000�00000002501�13771713062�0034522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeIpSecConnectionCompartmentDetails The configuration details for the move operation. type ChangeIpSecConnectionCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // IPSec connection to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeIpSecConnectionCompartmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_local_peering_gateway_compartment_details.go�������������������������������������������������0000664�0000000�0000000�00000002522�13771713062�0035370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeLocalPeeringGatewayCompartmentDetails The configuration details for the move operation. type ChangeLocalPeeringGatewayCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // local peering gateway to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeLocalPeeringGatewayCompartmentDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_local_peering_gateway_compartment_request_response.go����������������������������������������0000664�0000000�0000000�00000006335�13771713062�0037357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeLocalPeeringGatewayCompartmentRequest wrapper for the ChangeLocalPeeringGatewayCompartment operation type ChangeLocalPeeringGatewayCompartmentRequest struct { // The OCID of the local peering gateway. LocalPeeringGatewayId *string `mandatory:"true" contributesTo:"path" name:"localPeeringGatewayId"` // Request to change the compartment of a given local peering gateway. ChangeLocalPeeringGatewayCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeLocalPeeringGatewayCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeLocalPeeringGatewayCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeLocalPeeringGatewayCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeLocalPeeringGatewayCompartmentResponse wrapper for the ChangeLocalPeeringGatewayCompartment operation type ChangeLocalPeeringGatewayCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeLocalPeeringGatewayCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeLocalPeeringGatewayCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_nat_gateway_compartment_details.go�0000664�0000000�0000000�00000002451�13771713062�0033427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeNatGatewayCompartmentDetails The configuration details for the move operation. type ChangeNatGatewayCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the NAT gateway to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeNatGatewayCompartmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_nat_gateway_compartment_request_response.go��������������������������������������������������0000664�0000000�0000000�00000006217�13771713062�0035335�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeNatGatewayCompartmentRequest wrapper for the ChangeNatGatewayCompartment operation type ChangeNatGatewayCompartmentRequest struct { // The NAT gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). NatGatewayId *string `mandatory:"true" contributesTo:"path" name:"natGatewayId"` // Request to change the compartment of a given NAT Gateway. ChangeNatGatewayCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeNatGatewayCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeNatGatewayCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeNatGatewayCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeNatGatewayCompartmentResponse wrapper for the ChangeNatGatewayCompartment operation type ChangeNatGatewayCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeNatGatewayCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeNatGatewayCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_network_security_group_compartment_details.go������������������������������������������������0000664�0000000�0000000�00000002547�13771713062�0035707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeNetworkSecurityGroupCompartmentDetails The representation of ChangeNetworkSecurityGroupCompartmentDetails type ChangeNetworkSecurityGroupCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the network // security group to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeNetworkSecurityGroupCompartmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������change_network_security_group_compartment_request_response.go���������������������������������������0000664�0000000�0000000�00000006460�13771713062�0037666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeNetworkSecurityGroupCompartmentRequest wrapper for the ChangeNetworkSecurityGroupCompartment operation type ChangeNetworkSecurityGroupCompartmentRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // Request to change the compartment of a network security group. ChangeNetworkSecurityGroupCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeNetworkSecurityGroupCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeNetworkSecurityGroupCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeNetworkSecurityGroupCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeNetworkSecurityGroupCompartmentResponse wrapper for the ChangeNetworkSecurityGroupCompartment operation type ChangeNetworkSecurityGroupCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeNetworkSecurityGroupCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeNetworkSecurityGroupCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_public_ip_compartment_details.go���0000664�0000000�0000000�00000002445�13771713062�0033075�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangePublicIpCompartmentDetails The configuration details for the move operation. type ChangePublicIpCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // public IP to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangePublicIpCompartmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_public_ip_compartment_request_response.go����������������������������������������������������0000664�0000000�0000000�00000006045�13771713062�0034777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangePublicIpCompartmentRequest wrapper for the ChangePublicIpCompartment operation type ChangePublicIpCompartmentRequest struct { // The OCID of the public IP. PublicIpId *string `mandatory:"true" contributesTo:"path" name:"publicIpId"` // Request to change the compartment of a Public IP. ChangePublicIpCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangePublicIpCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangePublicIpCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangePublicIpCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangePublicIpCompartmentResponse wrapper for the ChangePublicIpCompartment operation type ChangePublicIpCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangePublicIpCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangePublicIpCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_remote_peering_connection_compartment_details.go���������������������������������������������0000664�0000000�0000000�00000002542�13771713062�0036271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeRemotePeeringConnectionCompartmentDetails The configuration details for the move operation. type ChangeRemotePeeringConnectionCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // remote peering connection to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeRemotePeeringConnectionCompartmentDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������change_remote_peering_connection_compartment_request_response.go������������������������������������0000664�0000000�0000000�00000006435�13771713062�0040257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeRemotePeeringConnectionCompartmentRequest wrapper for the ChangeRemotePeeringConnectionCompartment operation type ChangeRemotePeeringConnectionCompartmentRequest struct { // The OCID of the remote peering connection (RPC). RemotePeeringConnectionId *string `mandatory:"true" contributesTo:"path" name:"remotePeeringConnectionId"` // Request to change the compartment of a Remote Peering Connection. ChangeRemotePeeringConnectionCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeRemotePeeringConnectionCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeRemotePeeringConnectionCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeRemotePeeringConnectionCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeRemotePeeringConnectionCompartmentResponse wrapper for the ChangeRemotePeeringConnectionCompartment operation type ChangeRemotePeeringConnectionCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeRemotePeeringConnectionCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeRemotePeeringConnectionCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_route_table_compartment_details.go�0000664�0000000�0000000�00000002455�13771713062�0033435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeRouteTableCompartmentDetails The configuration details for the move operation. type ChangeRouteTableCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // route table to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeRouteTableCompartmentDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_route_table_compartment_request_response.go��������������������������������������������������0000664�0000000�0000000�00000006073�13771713062�0035337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeRouteTableCompartmentRequest wrapper for the ChangeRouteTableCompartment operation type ChangeRouteTableCompartmentRequest struct { // The OCID of the route table. RtId *string `mandatory:"true" contributesTo:"path" name:"rtId"` // Request to change the compartment of a given route table. ChangeRouteTableCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeRouteTableCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeRouteTableCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeRouteTableCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeRouteTableCompartmentResponse wrapper for the ChangeRouteTableCompartment operation type ChangeRouteTableCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeRouteTableCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeRouteTableCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_security_list_compartment_details.go���������������������������������������������������������0000664�0000000�0000000�00000002465�13771713062�0033754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeSecurityListCompartmentDetails The configuration details for the move operation. type ChangeSecurityListCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // security list to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeSecurityListCompartmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_security_list_compartment_request_response.go������������������������������������������������0000664�0000000�0000000�00000006153�13771713062�0035733�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeSecurityListCompartmentRequest wrapper for the ChangeSecurityListCompartment operation type ChangeSecurityListCompartmentRequest struct { // The OCID of the security list. SecurityListId *string `mandatory:"true" contributesTo:"path" name:"securityListId"` // Request to change the compartment of a given security list. ChangeSecurityListCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeSecurityListCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeSecurityListCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeSecurityListCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeSecurityListCompartmentResponse wrapper for the ChangeSecurityListCompartment operation type ChangeSecurityListCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeSecurityListCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeSecurityListCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_service_gateway_compartment_details.go�������������������������������������������������������0000664�0000000�0000000�00000002475�13771713062�0034234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeServiceGatewayCompartmentDetails The configuration details for the move operation. type ChangeServiceGatewayCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // service gateway to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeServiceGatewayCompartmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_service_gateway_compartment_request_response.go����������������������������������������������0000664�0000000�0000000�00000006317�13771713062�0036214�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeServiceGatewayCompartmentRequest wrapper for the ChangeServiceGatewayCompartment operation type ChangeServiceGatewayCompartmentRequest struct { // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` // Request to change the compartment of a given Service Gateway. ChangeServiceGatewayCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeServiceGatewayCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeServiceGatewayCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeServiceGatewayCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeServiceGatewayCompartmentResponse wrapper for the ChangeServiceGatewayCompartment operation type ChangeServiceGatewayCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeServiceGatewayCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeServiceGatewayCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_subnet_compartment_details.go������0000664�0000000�0000000�00000002434�13771713062�0032425�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeSubnetCompartmentDetails The configuration details for the move operation. type ChangeSubnetCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // subnet to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeSubnetCompartmentDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_subnet_compartment_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000006430�13771713062�0034327�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeSubnetCompartmentRequest wrapper for the ChangeSubnetCompartment operation type ChangeSubnetCompartmentRequest struct { // The OCID of the subnet. SubnetId *string `mandatory:"true" contributesTo:"path" name:"subnetId"` // Request to change the compartment of a given subnet. ChangeSubnetCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeSubnetCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeSubnetCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeSubnetCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeSubnetCompartmentResponse wrapper for the ChangeSubnetCompartment operation type ChangeSubnetCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response ChangeSubnetCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeSubnetCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_vcn_compartment_details.go���������0000664�0000000�0000000�00000002420�13771713062�0031706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeVcnCompartmentDetails The configuration details for the move operation. type ChangeVcnCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // VCN to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeVcnCompartmentDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_vcn_compartment_request_response.go0000664�0000000�0000000�00000006461�13771713062�0033700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeVcnCompartmentRequest wrapper for the ChangeVcnCompartment operation type ChangeVcnCompartmentRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"path" name:"vcnId"` // Request to change the compartment of a given VCN. ChangeVcnCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeVcnCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeVcnCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeVcnCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeVcnCompartmentResponse wrapper for the ChangeVcnCompartment operation type ChangeVcnCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response ChangeVcnCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeVcnCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_virtual_circuit_compartment_details.go�������������������������������������������������������0000664�0000000�0000000�00000002475�13771713062�0034263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeVirtualCircuitCompartmentDetails The configuration details for the move operation. type ChangeVirtualCircuitCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the // virtual circuit to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeVirtualCircuitCompartmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_virtual_circuit_compartment_request_response.go����������������������������������������������0000664�0000000�0000000�00000006205�13771713062�0036237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeVirtualCircuitCompartmentRequest wrapper for the ChangeVirtualCircuitCompartment operation type ChangeVirtualCircuitCompartmentRequest struct { // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` // Request to change the compartment of a virtual circuit. ChangeVirtualCircuitCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeVirtualCircuitCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeVirtualCircuitCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeVirtualCircuitCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeVirtualCircuitCompartmentResponse wrapper for the ChangeVirtualCircuitCompartment operation type ChangeVirtualCircuitCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeVirtualCircuitCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeVirtualCircuitCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_volume_backup_compartment_details.go���������������������������������������������������������0000664�0000000�0000000�00000002506�13771713062�0033702�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeVolumeBackupCompartmentDetails Contains the details for the compartment to move the volume backup to. type ChangeVolumeBackupCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the volume backup to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeVolumeBackupCompartmentDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_volume_backup_compartment_request_response.go������������������������������������������������0000664�0000000�0000000�00000005166�13771713062�0035670�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeVolumeBackupCompartmentRequest wrapper for the ChangeVolumeBackupCompartment operation type ChangeVolumeBackupCompartmentRequest struct { // The OCID of the volume backup. VolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeBackupId"` // Request to change the compartment of given volume backup. ChangeVolumeBackupCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeVolumeBackupCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeVolumeBackupCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeVolumeBackupCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeVolumeBackupCompartmentResponse wrapper for the ChangeVolumeBackupCompartment operation type ChangeVolumeBackupCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeVolumeBackupCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeVolumeBackupCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_volume_compartment_details.go������0000664�0000000�0000000�00000002446�13771713062�0032437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeVolumeCompartmentDetails Contains the details for the compartment to move the volume to. type ChangeVolumeCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the volume to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeVolumeCompartmentDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_volume_compartment_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005024�13771713062�0034334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeVolumeCompartmentRequest wrapper for the ChangeVolumeCompartment operation type ChangeVolumeCompartmentRequest struct { // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` // Request to change the compartment of given volume. ChangeVolumeCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeVolumeCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeVolumeCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeVolumeCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeVolumeCompartmentResponse wrapper for the ChangeVolumeCompartment operation type ChangeVolumeCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeVolumeCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeVolumeCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_volume_group_backup_compartment_details.go���������������������������������������������������0000664�0000000�0000000�00000002541�13771713062�0035115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeVolumeGroupBackupCompartmentDetails Contains the details for the compartment to move the volume group backup to. type ChangeVolumeGroupBackupCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the volume group backup to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeVolumeGroupBackupCompartmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������change_volume_group_backup_compartment_request_response.go������������������������������������������0000664�0000000�0000000�00000005360�13771713062�0037100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeVolumeGroupBackupCompartmentRequest wrapper for the ChangeVolumeGroupBackupCompartment operation type ChangeVolumeGroupBackupCompartmentRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. VolumeGroupBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupBackupId"` // Request to change the compartment of given volume group backup. ChangeVolumeGroupBackupCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeVolumeGroupBackupCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeVolumeGroupBackupCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeVolumeGroupBackupCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeVolumeGroupBackupCompartmentResponse wrapper for the ChangeVolumeGroupBackupCompartment operation type ChangeVolumeGroupBackupCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeVolumeGroupBackupCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeVolumeGroupBackupCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/change_volume_group_compartment_details.go0000664�0000000�0000000�00000002501�13771713062�0033643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ChangeVolumeGroupCompartmentDetails Contains the details for the compartment to move the volume group to. type ChangeVolumeGroupCompartmentDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the volume group to. CompartmentId *string `mandatory:"true" json:"compartmentId"` } func (m ChangeVolumeGroupCompartmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������change_volume_group_compartment_request_response.go�������������������������������������������������0000664�0000000�0000000�00000005216�13771713062�0035553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ChangeVolumeGroupCompartmentRequest wrapper for the ChangeVolumeGroupCompartment operation type ChangeVolumeGroupCompartmentRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group. VolumeGroupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupId"` // Request to change the compartment of given volume group. ChangeVolumeGroupCompartmentDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ChangeVolumeGroupCompartmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ChangeVolumeGroupCompartmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ChangeVolumeGroupCompartmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ChangeVolumeGroupCompartmentResponse wrapper for the ChangeVolumeGroupCompartment operation type ChangeVolumeGroupCompartmentResponse struct { // The underlying http response RawResponse *http.Response // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ChangeVolumeGroupCompartmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ChangeVolumeGroupCompartmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cluster_network.go������������������������0000664�0000000�0000000�00000012155�13771713062�0026735�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ClusterNetwork A cluster network is a group of high performance computing (HPC) bare metal instances that are connected // with an ultra low latency network. For more information about cluster networks, see // Managing Cluster Networks (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/managingclusternetworks.htm). type ClusterNetwork struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. Id *string `mandatory:"true" json:"id"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the cluster netowrk. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The current state of the cluster network. LifecycleState ClusterNetworkLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the resource was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The date and time the resource was updated, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The instance pools in the cluster network. // Each cluster network can have one instance pool. InstancePools []InstancePool `mandatory:"false" json:"instancePools"` // The placement configuration for the instance pools in the cluster network. PlacementConfiguration *ClusterNetworkPlacementConfigurationDetails `mandatory:"false" json:"placementConfiguration"` } func (m ClusterNetwork) String() string { return common.PointerString(m) } // ClusterNetworkLifecycleStateEnum Enum with underlying type: string type ClusterNetworkLifecycleStateEnum string // Set of constants representing the allowable values for ClusterNetworkLifecycleStateEnum const ( ClusterNetworkLifecycleStateProvisioning ClusterNetworkLifecycleStateEnum = "PROVISIONING" ClusterNetworkLifecycleStateScaling ClusterNetworkLifecycleStateEnum = "SCALING" ClusterNetworkLifecycleStateStarting ClusterNetworkLifecycleStateEnum = "STARTING" ClusterNetworkLifecycleStateStopping ClusterNetworkLifecycleStateEnum = "STOPPING" ClusterNetworkLifecycleStateTerminating ClusterNetworkLifecycleStateEnum = "TERMINATING" ClusterNetworkLifecycleStateStopped ClusterNetworkLifecycleStateEnum = "STOPPED" ClusterNetworkLifecycleStateTerminated ClusterNetworkLifecycleStateEnum = "TERMINATED" ClusterNetworkLifecycleStateRunning ClusterNetworkLifecycleStateEnum = "RUNNING" ) var mappingClusterNetworkLifecycleState = map[string]ClusterNetworkLifecycleStateEnum{ "PROVISIONING": ClusterNetworkLifecycleStateProvisioning, "SCALING": ClusterNetworkLifecycleStateScaling, "STARTING": ClusterNetworkLifecycleStateStarting, "STOPPING": ClusterNetworkLifecycleStateStopping, "TERMINATING": ClusterNetworkLifecycleStateTerminating, "STOPPED": ClusterNetworkLifecycleStateStopped, "TERMINATED": ClusterNetworkLifecycleStateTerminated, "RUNNING": ClusterNetworkLifecycleStateRunning, } // GetClusterNetworkLifecycleStateEnumValues Enumerates the set of values for ClusterNetworkLifecycleStateEnum func GetClusterNetworkLifecycleStateEnumValues() []ClusterNetworkLifecycleStateEnum { values := make([]ClusterNetworkLifecycleStateEnum, 0) for _, v := range mappingClusterNetworkLifecycleState { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cluster_network_placement_configuration_details.go��������������������������������������������������0000664�0000000�0000000�00000003266�13771713062�0035345�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ClusterNetworkPlacementConfigurationDetails The location for where the instance pools in a cluster network will place instances. type ClusterNetworkPlacementConfigurationDetails struct { // The availability domain to place instances. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the primary subnet to place // instances. PrimarySubnetId *string `mandatory:"true" json:"primarySubnetId"` // The set of secondary VNIC data for instances in the pool. SecondaryVnicSubnets []InstancePoolPlacementSecondaryVnicSubnet `mandatory:"false" json:"secondaryVnicSubnets"` } func (m ClusterNetworkPlacementConfigurationDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cluster_network_summary.go����������������0000664�0000000�0000000�00000011633�13771713062�0030512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ClusterNetworkSummary Summary information for a cluster network. type ClusterNetworkSummary struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. Id *string `mandatory:"true" json:"id"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the // cluster netowrk. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The current state of the cluster network. LifecycleState ClusterNetworkSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the resource was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The date and time the resource was updated, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the cluster network. Does not have to be unique, and it's changeable. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The instance pools in the cluster network. InstancePools []InstancePoolSummary `mandatory:"false" json:"instancePools"` } func (m ClusterNetworkSummary) String() string { return common.PointerString(m) } // ClusterNetworkSummaryLifecycleStateEnum Enum with underlying type: string type ClusterNetworkSummaryLifecycleStateEnum string // Set of constants representing the allowable values for ClusterNetworkSummaryLifecycleStateEnum const ( ClusterNetworkSummaryLifecycleStateProvisioning ClusterNetworkSummaryLifecycleStateEnum = "PROVISIONING" ClusterNetworkSummaryLifecycleStateScaling ClusterNetworkSummaryLifecycleStateEnum = "SCALING" ClusterNetworkSummaryLifecycleStateStarting ClusterNetworkSummaryLifecycleStateEnum = "STARTING" ClusterNetworkSummaryLifecycleStateStopping ClusterNetworkSummaryLifecycleStateEnum = "STOPPING" ClusterNetworkSummaryLifecycleStateTerminating ClusterNetworkSummaryLifecycleStateEnum = "TERMINATING" ClusterNetworkSummaryLifecycleStateStopped ClusterNetworkSummaryLifecycleStateEnum = "STOPPED" ClusterNetworkSummaryLifecycleStateTerminated ClusterNetworkSummaryLifecycleStateEnum = "TERMINATED" ClusterNetworkSummaryLifecycleStateRunning ClusterNetworkSummaryLifecycleStateEnum = "RUNNING" ) var mappingClusterNetworkSummaryLifecycleState = map[string]ClusterNetworkSummaryLifecycleStateEnum{ "PROVISIONING": ClusterNetworkSummaryLifecycleStateProvisioning, "SCALING": ClusterNetworkSummaryLifecycleStateScaling, "STARTING": ClusterNetworkSummaryLifecycleStateStarting, "STOPPING": ClusterNetworkSummaryLifecycleStateStopping, "TERMINATING": ClusterNetworkSummaryLifecycleStateTerminating, "STOPPED": ClusterNetworkSummaryLifecycleStateStopped, "TERMINATED": ClusterNetworkSummaryLifecycleStateTerminated, "RUNNING": ClusterNetworkSummaryLifecycleStateRunning, } // GetClusterNetworkSummaryLifecycleStateEnumValues Enumerates the set of values for ClusterNetworkSummaryLifecycleStateEnum func GetClusterNetworkSummaryLifecycleStateEnumValues() []ClusterNetworkSummaryLifecycleStateEnum { values := make([]ClusterNetworkSummaryLifecycleStateEnum, 0) for _, v := range mappingClusterNetworkSummaryLifecycleState { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/compute_instance_details.go���������������0000664�0000000�0000000�00000003356�13771713062�0030553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ComputeInstanceDetails Compute Instance Configuration instance details. type ComputeInstanceDetails struct { BlockVolumes []InstanceConfigurationBlockVolumeDetails `mandatory:"false" json:"blockVolumes"` LaunchDetails *InstanceConfigurationLaunchInstanceDetails `mandatory:"false" json:"launchDetails"` SecondaryVnics []InstanceConfigurationAttachVnicDetails `mandatory:"false" json:"secondaryVnics"` } func (m ComputeInstanceDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m ComputeInstanceDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeComputeInstanceDetails ComputeInstanceDetails s := struct { DiscriminatorParam string `json:"instanceType"` MarshalTypeComputeInstanceDetails }{ "compute", (MarshalTypeComputeInstanceDetails)(m), } return json.Marshal(&s) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/connect_local_peering_gateways_details.go�0000664�0000000�0000000�00000002314�13771713062�0033424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ConnectLocalPeeringGatewaysDetails Information about the other local peering gateway (LPG). type ConnectLocalPeeringGatewaysDetails struct { // The OCID of the LPG you want to peer with. PeerId *string `mandatory:"true" json:"peerId"` } func (m ConnectLocalPeeringGatewaysDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������connect_local_peering_gateways_request_response.go��������������������������������������������������0000664�0000000�0000000�00000005032�13771713062�0035326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ConnectLocalPeeringGatewaysRequest wrapper for the ConnectLocalPeeringGateways operation type ConnectLocalPeeringGatewaysRequest struct { // The OCID of the local peering gateway. LocalPeeringGatewayId *string `mandatory:"true" contributesTo:"path" name:"localPeeringGatewayId"` // Details regarding the local peering gateway to connect. ConnectLocalPeeringGatewaysDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ConnectLocalPeeringGatewaysRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ConnectLocalPeeringGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ConnectLocalPeeringGatewaysRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ConnectLocalPeeringGatewaysResponse wrapper for the ConnectLocalPeeringGateways operation type ConnectLocalPeeringGatewaysResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ConnectLocalPeeringGatewaysResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ConnectLocalPeeringGatewaysResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������connect_remote_peering_connections_details.go�������������������������������������������������������0000664�0000000�0000000�00000002602�13771713062�0034244�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ConnectRemotePeeringConnectionsDetails Information about the other remote peering connection (RPC). type ConnectRemotePeeringConnectionsDetails struct { // The OCID of the RPC you want to peer with. PeerId *string `mandatory:"true" json:"peerId"` // The name of the region that contains the RPC you want to peer with. // Example: `us-ashburn-1` PeerRegionName *string `mandatory:"true" json:"peerRegionName"` } func (m ConnectRemotePeeringConnectionsDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������connect_remote_peering_connections_request_response.go����������������������������������������������0000664�0000000�0000000�00000005165�13771713062�0036234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ConnectRemotePeeringConnectionsRequest wrapper for the ConnectRemotePeeringConnections operation type ConnectRemotePeeringConnectionsRequest struct { // The OCID of the remote peering connection (RPC). RemotePeeringConnectionId *string `mandatory:"true" contributesTo:"path" name:"remotePeeringConnectionId"` // Details to connect peering connection with peering connection from remote region ConnectRemotePeeringConnectionsDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ConnectRemotePeeringConnectionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ConnectRemotePeeringConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ConnectRemotePeeringConnectionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ConnectRemotePeeringConnectionsResponse wrapper for the ConnectRemotePeeringConnections operation type ConnectRemotePeeringConnectionsResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ConnectRemotePeeringConnectionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ConnectRemotePeeringConnectionsResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/console_history.go������������������������0000664�0000000�0000000�00000010465�13771713062�0026730�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ConsoleHistory An instance's serial console data. It includes configuration messages that occur when the // instance boots, such as kernel and BIOS messages, and is useful for checking the status of // the instance or diagnosing problems. The console data is minimally formatted ASCII text. // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type ConsoleHistory struct { // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the console history metadata object. Id *string `mandatory:"true" json:"id"` // The OCID of the instance this console history was fetched from. InstanceId *string `mandatory:"true" json:"instanceId"` // The current state of the console history. LifecycleState ConsoleHistoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the history was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My console history metadata` DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m ConsoleHistory) String() string { return common.PointerString(m) } // ConsoleHistoryLifecycleStateEnum Enum with underlying type: string type ConsoleHistoryLifecycleStateEnum string // Set of constants representing the allowable values for ConsoleHistoryLifecycleStateEnum const ( ConsoleHistoryLifecycleStateRequested ConsoleHistoryLifecycleStateEnum = "REQUESTED" ConsoleHistoryLifecycleStateGettingHistory ConsoleHistoryLifecycleStateEnum = "GETTING-HISTORY" ConsoleHistoryLifecycleStateSucceeded ConsoleHistoryLifecycleStateEnum = "SUCCEEDED" ConsoleHistoryLifecycleStateFailed ConsoleHistoryLifecycleStateEnum = "FAILED" ) var mappingConsoleHistoryLifecycleState = map[string]ConsoleHistoryLifecycleStateEnum{ "REQUESTED": ConsoleHistoryLifecycleStateRequested, "GETTING-HISTORY": ConsoleHistoryLifecycleStateGettingHistory, "SUCCEEDED": ConsoleHistoryLifecycleStateSucceeded, "FAILED": ConsoleHistoryLifecycleStateFailed, } // GetConsoleHistoryLifecycleStateEnumValues Enumerates the set of values for ConsoleHistoryLifecycleStateEnum func GetConsoleHistoryLifecycleStateEnumValues() []ConsoleHistoryLifecycleStateEnum { values := make([]ConsoleHistoryLifecycleStateEnum, 0) for _, v := range mappingConsoleHistoryLifecycleState { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/copy_boot_volume_backup_details.go��������0000664�0000000�0000000�00000004073�13771713062�0032121�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CopyBootVolumeBackupDetails The representation of CopyBootVolumeBackupDetails type CopyBootVolumeBackupDetails struct { // The name of the destination region. // Example: `us-ashburn-1` DestinationRegion *string `mandatory:"true" json:"destinationRegion"` // A user-friendly name for the boot volume backup. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The OCID of the Key Management key in the destination region which will be the master encryption key // for the copied boot volume backup. If you do not specify this attribute the boot volume backup // will be encrypted with the Oracle-provided encryption key when it is copied to the destination region. // // For more information about the Key Management service and encryption keys, see // Overview of Key Management (https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm) and // Using Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/usingkeys.htm). KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m CopyBootVolumeBackupDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������copy_boot_volume_backup_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000006133�13771713062�0034022�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CopyBootVolumeBackupRequest wrapper for the CopyBootVolumeBackup operation type CopyBootVolumeBackupRequest struct { // The OCID of the boot volume backup. BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` // Request to create a cross-region copy of given boot volume backup. CopyBootVolumeBackupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CopyBootVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CopyBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CopyBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CopyBootVolumeBackupResponse wrapper for the CopyBootVolumeBackup operation type CopyBootVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeBackup instance BootVolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CopyBootVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CopyBootVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_details.go�������������0000664�0000000�0000000�00000004040�13771713062�0031070�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CopyVolumeBackupDetails The representation of CopyVolumeBackupDetails type CopyVolumeBackupDetails struct { // The name of the destination region. // Example: `us-ashburn-1` DestinationRegion *string `mandatory:"true" json:"destinationRegion"` // A user-friendly name for the volume backup. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The OCID of the Key Management key in the destination region which will be the master encryption key // for the copied volume backup. // If you do not specify this attribute the volume backup will be encrypted with the Oracle-provided encryption // key when it is copied to the destination region. // // For more information about the Key Management service and encryption keys, see // Overview of Key Management (https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm) and // Using Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/usingkeys.htm). KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m CopyVolumeBackupDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/copy_volume_backup_request_response.go����0000664�0000000�0000000�00000006012�13771713062�0033052�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CopyVolumeBackupRequest wrapper for the CopyVolumeBackup operation type CopyVolumeBackupRequest struct { // The OCID of the volume backup. VolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeBackupId"` // Request to create a cross-region copy of given backup. CopyVolumeBackupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CopyVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CopyVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CopyVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CopyVolumeBackupResponse wrapper for the CopyVolumeBackup operation type CopyVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackup instance VolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CopyVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CopyVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/core_blockstorage_client.go���������������0000664�0000000�0000000�00000314526�13771713062�0030537�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "context" "fmt" "github.com/oracle/oci-go-sdk/common" "net/http" ) //BlockstorageClient a client for Blockstorage type BlockstorageClient struct { common.BaseClient config *common.ConfigurationProvider } // NewBlockstorageClientWithConfigurationProvider Creates a new default Blockstorage client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewBlockstorageClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client BlockstorageClient, err error) { baseClient, err := common.NewClientWithConfig(configProvider) if err != nil { return } return newBlockstorageClientFromBaseClient(baseClient, configProvider) } // NewBlockstorageClientWithOboToken Creates a new default Blockstorage client with the given configuration provider. // The obotoken will be added to default headers and signed; the configuration provider will be used for the signer // as well as reading the region func NewBlockstorageClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client BlockstorageClient, err error) { baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) if err != nil { return } return newBlockstorageClientFromBaseClient(baseClient, configProvider) } func newBlockstorageClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client BlockstorageClient, err error) { client = BlockstorageClient{BaseClient: baseClient} client.BasePath = "20160918" err = client.setConfigurationProvider(configProvider) return } // SetRegion overrides the region of this client. func (client *BlockstorageClient) SetRegion(region string) { client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid func (client *BlockstorageClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { return err } // Error has been checked already region, _ := configProvider.Region() client.SetRegion(region) client.config = &configProvider return nil } // ConfigurationProvider the ConfigurationProvider used in this client, or null if none set func (client *BlockstorageClient) ConfigurationProvider() *common.ConfigurationProvider { return client.config } // ChangeBootVolumeBackupCompartment Moves a boot volume backup into a different compartment within the same tenancy. // For information about moving resources between compartments, // see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client BlockstorageClient) ChangeBootVolumeBackupCompartment(ctx context.Context, request ChangeBootVolumeBackupCompartmentRequest) (response ChangeBootVolumeBackupCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.changeBootVolumeBackupCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeBootVolumeBackupCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeBootVolumeBackupCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeBootVolumeBackupCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeBootVolumeBackupCompartmentResponse") } return } // changeBootVolumeBackupCompartment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) changeBootVolumeBackupCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumeBackups/{bootVolumeBackupId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeBootVolumeBackupCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeBootVolumeCompartment Moves a boot volume into a different compartment within the same tenancy. // For information about moving resources between compartments, // see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client BlockstorageClient) ChangeBootVolumeCompartment(ctx context.Context, request ChangeBootVolumeCompartmentRequest) (response ChangeBootVolumeCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.changeBootVolumeCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeBootVolumeCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeBootVolumeCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeBootVolumeCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeBootVolumeCompartmentResponse") } return } // changeBootVolumeCompartment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) changeBootVolumeCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumes/{bootVolumeId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeBootVolumeCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeVolumeBackupCompartment Moves a volume backup into a different compartment within the same tenancy. // For information about moving resources between compartments, // see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client BlockstorageClient) ChangeVolumeBackupCompartment(ctx context.Context, request ChangeVolumeBackupCompartmentRequest) (response ChangeVolumeBackupCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.changeVolumeBackupCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeVolumeBackupCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeVolumeBackupCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeVolumeBackupCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeVolumeBackupCompartmentResponse") } return } // changeVolumeBackupCompartment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) changeVolumeBackupCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackups/{volumeBackupId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeVolumeBackupCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeVolumeCompartment Moves a volume into a different compartment within the same tenancy. // For information about moving resources between compartments, // see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client BlockstorageClient) ChangeVolumeCompartment(ctx context.Context, request ChangeVolumeCompartmentRequest) (response ChangeVolumeCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.changeVolumeCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeVolumeCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeVolumeCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeVolumeCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeVolumeCompartmentResponse") } return } // changeVolumeCompartment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) changeVolumeCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumes/{volumeId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeVolumeCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeVolumeGroupBackupCompartment Moves a volume group backup into a different compartment within the same tenancy. // For information about moving resources between compartments, // see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client BlockstorageClient) ChangeVolumeGroupBackupCompartment(ctx context.Context, request ChangeVolumeGroupBackupCompartmentRequest) (response ChangeVolumeGroupBackupCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.changeVolumeGroupBackupCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeVolumeGroupBackupCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeVolumeGroupBackupCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeVolumeGroupBackupCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeVolumeGroupBackupCompartmentResponse") } return } // changeVolumeGroupBackupCompartment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) changeVolumeGroupBackupCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeGroupBackups/{volumeGroupBackupId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeVolumeGroupBackupCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeVolumeGroupCompartment Moves a volume group into a different compartment within the same tenancy. // For information about moving resources between compartments, // see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client BlockstorageClient) ChangeVolumeGroupCompartment(ctx context.Context, request ChangeVolumeGroupCompartmentRequest) (response ChangeVolumeGroupCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.changeVolumeGroupCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeVolumeGroupCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeVolumeGroupCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeVolumeGroupCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeVolumeGroupCompartmentResponse") } return } // changeVolumeGroupCompartment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) changeVolumeGroupCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeGroups/{volumeGroupId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeVolumeGroupCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CopyBootVolumeBackup Creates a boot volume backup copy in specified region. For general information about volume backups, // see Overview of Boot Volume Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumebackups.htm) func (client BlockstorageClient) CopyBootVolumeBackup(ctx context.Context, request CopyBootVolumeBackupRequest) (response CopyBootVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.copyBootVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CopyBootVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CopyBootVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(CopyBootVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CopyBootVolumeBackupResponse") } return } // copyBootVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) copyBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumeBackups/{bootVolumeBackupId}/actions/copy") if err != nil { return nil, err } var response CopyBootVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CopyVolumeBackup Creates a volume backup copy in specified region. For general information about volume backups, // see Overview of Block Volume Service Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumebackups.htm) func (client BlockstorageClient) CopyVolumeBackup(ctx context.Context, request CopyVolumeBackupRequest) (response CopyVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.copyVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CopyVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CopyVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(CopyVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CopyVolumeBackupResponse") } return } // copyVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) copyVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackups/{volumeBackupId}/actions/copy") if err != nil { return nil, err } var response CopyVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateBootVolume Creates a new boot volume in the specified compartment from an existing boot volume or a boot volume backup. // For general information about boot volumes, see Boot Volumes (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumes.htm). // You may optionally specify a *display name* for the volume, which is simply a friendly name or // description. It does not have to be unique, and you can change it. Avoid entering confidential information. func (client BlockstorageClient) CreateBootVolume(ctx context.Context, request CreateBootVolumeRequest) (response CreateBootVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createBootVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateBootVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateBootVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateBootVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateBootVolumeResponse") } return } // createBootVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumes") if err != nil { return nil, err } var response CreateBootVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateBootVolumeBackup Creates a new boot volume backup of the specified boot volume. For general information about boot volume backups, // see Overview of Boot Volume Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/bootvolumebackups.htm) // When the request is received, the backup object is in a REQUEST_RECEIVED state. // When the data is imaged, it goes into a CREATING state. // After the backup is fully uploaded to the cloud, it goes into an AVAILABLE state. func (client BlockstorageClient) CreateBootVolumeBackup(ctx context.Context, request CreateBootVolumeBackupRequest) (response CreateBootVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createBootVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateBootVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateBootVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateBootVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateBootVolumeBackupResponse") } return } // createBootVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumeBackups") if err != nil { return nil, err } var response CreateBootVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVolume Creates a new volume in the specified compartment. Volumes can be created in sizes ranging from // 50 GB (51200 MB) to 32 TB (33554432 MB), in 1 GB (1024 MB) increments. By default, volumes are 1 TB (1048576 MB). // For general information about block volumes, see // Overview of Block Volume Service (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). // A volume and instance can be in separate compartments but must be in the same availability domain. // For information about access control and compartments, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about // availability domains, see Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). // To get a list of availability domains, use the `ListAvailabilityDomains` operation // in the Identity and Access Management Service API. // You may optionally specify a *display name* for the volume, which is simply a friendly name or // description. It does not have to be unique, and you can change it. Avoid entering confidential information. func (client BlockstorageClient) CreateVolume(ctx context.Context, request CreateVolumeRequest) (response CreateVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeResponse") } return } // createVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumes") if err != nil { return nil, err } var response CreateVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVolumeBackup Creates a new backup of the specified volume. For general information about volume backups, // see Overview of Block Volume Service Backups (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumebackups.htm) // When the request is received, the backup object is in a REQUEST_RECEIVED state. // When the data is imaged, it goes into a CREATING state. // After the backup is fully uploaded to the cloud, it goes into an AVAILABLE state. func (client BlockstorageClient) CreateVolumeBackup(ctx context.Context, request CreateVolumeBackupRequest) (response CreateVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeBackupResponse") } return } // createVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackups") if err != nil { return nil, err } var response CreateVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVolumeBackupPolicy Creates a new user defined backup policy. // For more information about Oracle defined backup policies and user defined backup policies, // see Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm). func (client BlockstorageClient) CreateVolumeBackupPolicy(ctx context.Context, request CreateVolumeBackupPolicyRequest) (response CreateVolumeBackupPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createVolumeBackupPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVolumeBackupPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVolumeBackupPolicyResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVolumeBackupPolicyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeBackupPolicyResponse") } return } // createVolumeBackupPolicy implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createVolumeBackupPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackupPolicies") if err != nil { return nil, err } var response CreateVolumeBackupPolicyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVolumeBackupPolicyAssignment Assigns a volume backup policy to the specified volume. Note that a given volume can // only have one backup policy assigned to it. If this operation is used for a volume that already // has a different backup policy assigned, the prior backup policy will be silently unassigned. func (client BlockstorageClient) CreateVolumeBackupPolicyAssignment(ctx context.Context, request CreateVolumeBackupPolicyAssignmentRequest) (response CreateVolumeBackupPolicyAssignmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.createVolumeBackupPolicyAssignment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVolumeBackupPolicyAssignmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVolumeBackupPolicyAssignmentResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVolumeBackupPolicyAssignmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeBackupPolicyAssignmentResponse") } return } // createVolumeBackupPolicyAssignment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createVolumeBackupPolicyAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeBackupPolicyAssignments") if err != nil { return nil, err } var response CreateVolumeBackupPolicyAssignmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVolumeGroup Creates a new volume group in the specified compartment. // A volume group is a collection of volumes and may be created from a list of volumes, cloning an existing // volume group, or by restoring a volume group backup. A volume group can contain up to 64 volumes. // You may optionally specify a *display name* for the volume group, which is simply a friendly name or // description. It does not have to be unique, and you can change it. Avoid entering confidential information. // For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) CreateVolumeGroup(ctx context.Context, request CreateVolumeGroupRequest) (response CreateVolumeGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createVolumeGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVolumeGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVolumeGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVolumeGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeGroupResponse") } return } // createVolumeGroup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeGroups") if err != nil { return nil, err } var response CreateVolumeGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVolumeGroupBackup Creates a new backup volume group of the specified volume group. // For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) CreateVolumeGroupBackup(ctx context.Context, request CreateVolumeGroupBackupRequest) (response CreateVolumeGroupBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createVolumeGroupBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVolumeGroupBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVolumeGroupBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVolumeGroupBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVolumeGroupBackupResponse") } return } // createVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) createVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeGroupBackups") if err != nil { return nil, err } var response CreateVolumeGroupBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteBootVolume Deletes the specified boot volume. The volume cannot have an active connection to an instance. // To disconnect the boot volume from a connected instance, see // Disconnecting From a Boot Volume (https://docs.cloud.oracle.com/Content/Block/Tasks/deletingbootvolume.htm). // **Warning:** All data on the boot volume will be permanently lost when the boot volume is deleted. func (client BlockstorageClient) DeleteBootVolume(ctx context.Context, request DeleteBootVolumeRequest) (response DeleteBootVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteBootVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteBootVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteBootVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteBootVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteBootVolumeResponse") } return } // deleteBootVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumes/{bootVolumeId}") if err != nil { return nil, err } var response DeleteBootVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteBootVolumeBackup Deletes a boot volume backup. func (client BlockstorageClient) DeleteBootVolumeBackup(ctx context.Context, request DeleteBootVolumeBackupRequest) (response DeleteBootVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteBootVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteBootVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteBootVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteBootVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteBootVolumeBackupResponse") } return } // deleteBootVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumeBackups/{bootVolumeBackupId}") if err != nil { return nil, err } var response DeleteBootVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteBootVolumeKmsKey Removes the specified boot volume's assigned Key Management encryption key. func (client BlockstorageClient) DeleteBootVolumeKmsKey(ctx context.Context, request DeleteBootVolumeKmsKeyRequest) (response DeleteBootVolumeKmsKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteBootVolumeKmsKey, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteBootVolumeKmsKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteBootVolumeKmsKeyResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteBootVolumeKmsKeyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteBootVolumeKmsKeyResponse") } return } // deleteBootVolumeKmsKey implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteBootVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumes/{bootVolumeId}/kmsKey") if err != nil { return nil, err } var response DeleteBootVolumeKmsKeyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVolume Deletes the specified volume. The volume cannot have an active connection to an instance. // To disconnect the volume from a connected instance, see // Disconnecting From a Volume (https://docs.cloud.oracle.com/Content/Block/Tasks/disconnectingfromavolume.htm). // **Warning:** All data on the volume will be permanently lost when the volume is deleted. func (client BlockstorageClient) DeleteVolume(ctx context.Context, request DeleteVolumeRequest) (response DeleteVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeResponse") } return } // deleteVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumes/{volumeId}") if err != nil { return nil, err } var response DeleteVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVolumeBackup Deletes a volume backup. func (client BlockstorageClient) DeleteVolumeBackup(ctx context.Context, request DeleteVolumeBackupRequest) (response DeleteVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeBackupResponse") } return } // deleteVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeBackups/{volumeBackupId}") if err != nil { return nil, err } var response DeleteVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVolumeBackupPolicy Deletes a user defined backup policy. // For more information about user defined backup policies, // see Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#UserDefinedBackupPolicies). // Avoid entering confidential information. func (client BlockstorageClient) DeleteVolumeBackupPolicy(ctx context.Context, request DeleteVolumeBackupPolicyRequest) (response DeleteVolumeBackupPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVolumeBackupPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVolumeBackupPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVolumeBackupPolicyResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVolumeBackupPolicyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeBackupPolicyResponse") } return } // deleteVolumeBackupPolicy implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteVolumeBackupPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeBackupPolicies/{policyId}") if err != nil { return nil, err } var response DeleteVolumeBackupPolicyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVolumeBackupPolicyAssignment Deletes a volume backup policy assignment. func (client BlockstorageClient) DeleteVolumeBackupPolicyAssignment(ctx context.Context, request DeleteVolumeBackupPolicyAssignmentRequest) (response DeleteVolumeBackupPolicyAssignmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVolumeBackupPolicyAssignment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVolumeBackupPolicyAssignmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVolumeBackupPolicyAssignmentResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVolumeBackupPolicyAssignmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeBackupPolicyAssignmentResponse") } return } // deleteVolumeBackupPolicyAssignment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteVolumeBackupPolicyAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeBackupPolicyAssignments/{policyAssignmentId}") if err != nil { return nil, err } var response DeleteVolumeBackupPolicyAssignmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVolumeGroup Deletes the specified volume group. Individual volumes are not deleted, only the volume group is deleted. // For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) DeleteVolumeGroup(ctx context.Context, request DeleteVolumeGroupRequest) (response DeleteVolumeGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVolumeGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVolumeGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVolumeGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVolumeGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeGroupResponse") } return } // deleteVolumeGroup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeGroups/{volumeGroupId}") if err != nil { return nil, err } var response DeleteVolumeGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVolumeGroupBackup Deletes a volume group backup. This operation deletes all the backups in the volume group. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) DeleteVolumeGroupBackup(ctx context.Context, request DeleteVolumeGroupBackupRequest) (response DeleteVolumeGroupBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVolumeGroupBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVolumeGroupBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVolumeGroupBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVolumeGroupBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeGroupBackupResponse") } return } // deleteVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeGroupBackups/{volumeGroupBackupId}") if err != nil { return nil, err } var response DeleteVolumeGroupBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVolumeKmsKey Removes the specified volume's assigned Key Management encryption key. func (client BlockstorageClient) DeleteVolumeKmsKey(ctx context.Context, request DeleteVolumeKmsKeyRequest) (response DeleteVolumeKmsKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVolumeKmsKey, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVolumeKmsKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVolumeKmsKeyResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVolumeKmsKeyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVolumeKmsKeyResponse") } return } // deleteVolumeKmsKey implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) deleteVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumes/{volumeId}/kmsKey") if err != nil { return nil, err } var response DeleteVolumeKmsKeyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetBootVolume Gets information for the specified boot volume. func (client BlockstorageClient) GetBootVolume(ctx context.Context, request GetBootVolumeRequest) (response GetBootVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getBootVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetBootVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetBootVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(GetBootVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeResponse") } return } // getBootVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumes/{bootVolumeId}") if err != nil { return nil, err } var response GetBootVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetBootVolumeBackup Gets information for the specified boot volume backup. func (client BlockstorageClient) GetBootVolumeBackup(ctx context.Context, request GetBootVolumeBackupRequest) (response GetBootVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getBootVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetBootVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetBootVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(GetBootVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeBackupResponse") } return } // getBootVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeBackups/{bootVolumeBackupId}") if err != nil { return nil, err } var response GetBootVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetBootVolumeKmsKey Gets the Key Management encryption key assigned to the specified boot volume. func (client BlockstorageClient) GetBootVolumeKmsKey(ctx context.Context, request GetBootVolumeKmsKeyRequest) (response GetBootVolumeKmsKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getBootVolumeKmsKey, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetBootVolumeKmsKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetBootVolumeKmsKeyResponse{} } } return } if convertedResponse, ok := ociResponse.(GetBootVolumeKmsKeyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeKmsKeyResponse") } return } // getBootVolumeKmsKey implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getBootVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumes/{bootVolumeId}/kmsKey") if err != nil { return nil, err } var response GetBootVolumeKmsKeyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolume Gets information for the specified volume. func (client BlockstorageClient) GetVolume(ctx context.Context, request GetVolumeRequest) (response GetVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeResponse") } return } // getVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumes/{volumeId}") if err != nil { return nil, err } var response GetVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeBackup Gets information for the specified volume backup. func (client BlockstorageClient) GetVolumeBackup(ctx context.Context, request GetVolumeBackupRequest) (response GetVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupResponse") } return } // getVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackups/{volumeBackupId}") if err != nil { return nil, err } var response GetVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeBackupPolicy Gets information for the specified volume backup policy. func (client BlockstorageClient) GetVolumeBackupPolicy(ctx context.Context, request GetVolumeBackupPolicyRequest) (response GetVolumeBackupPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeBackupPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeBackupPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeBackupPolicyResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeBackupPolicyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupPolicyResponse") } return } // getVolumeBackupPolicy implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolumeBackupPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicies/{policyId}") if err != nil { return nil, err } var response GetVolumeBackupPolicyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeBackupPolicyAssetAssignment Gets the volume backup policy assignment for the specified volume. The // `assetId` query parameter is required, and the returned list will contain at most // one item, since volume can only have one volume backup policy assigned at a time. func (client BlockstorageClient) GetVolumeBackupPolicyAssetAssignment(ctx context.Context, request GetVolumeBackupPolicyAssetAssignmentRequest) (response GetVolumeBackupPolicyAssetAssignmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeBackupPolicyAssetAssignment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeBackupPolicyAssetAssignmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeBackupPolicyAssetAssignmentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeBackupPolicyAssetAssignmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupPolicyAssetAssignmentResponse") } return } // getVolumeBackupPolicyAssetAssignment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolumeBackupPolicyAssetAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicyAssignments") if err != nil { return nil, err } var response GetVolumeBackupPolicyAssetAssignmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeBackupPolicyAssignment Gets information for the specified volume backup policy assignment. func (client BlockstorageClient) GetVolumeBackupPolicyAssignment(ctx context.Context, request GetVolumeBackupPolicyAssignmentRequest) (response GetVolumeBackupPolicyAssignmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeBackupPolicyAssignment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeBackupPolicyAssignmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeBackupPolicyAssignmentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeBackupPolicyAssignmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeBackupPolicyAssignmentResponse") } return } // getVolumeBackupPolicyAssignment implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolumeBackupPolicyAssignment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicyAssignments/{policyAssignmentId}") if err != nil { return nil, err } var response GetVolumeBackupPolicyAssignmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeGroup Gets information for the specified volume group. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) GetVolumeGroup(ctx context.Context, request GetVolumeGroupRequest) (response GetVolumeGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeGroupResponse") } return } // getVolumeGroup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroups/{volumeGroupId}") if err != nil { return nil, err } var response GetVolumeGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeGroupBackup Gets information for the specified volume group backup. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) GetVolumeGroupBackup(ctx context.Context, request GetVolumeGroupBackupRequest) (response GetVolumeGroupBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeGroupBackup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeGroupBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeGroupBackupResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeGroupBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeGroupBackupResponse") } return } // getVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroupBackups/{volumeGroupBackupId}") if err != nil { return nil, err } var response GetVolumeGroupBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeKmsKey Gets the Key Management encryption key assigned to the specified volume. func (client BlockstorageClient) GetVolumeKmsKey(ctx context.Context, request GetVolumeKmsKeyRequest) (response GetVolumeKmsKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeKmsKey, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeKmsKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeKmsKeyResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeKmsKeyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeKmsKeyResponse") } return } // getVolumeKmsKey implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) getVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumes/{volumeId}/kmsKey") if err != nil { return nil, err } var response GetVolumeKmsKeyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListBootVolumeBackups Lists the boot volume backups in the specified compartment. You can filter the results by boot volume. func (client BlockstorageClient) ListBootVolumeBackups(ctx context.Context, request ListBootVolumeBackupsRequest) (response ListBootVolumeBackupsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listBootVolumeBackups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListBootVolumeBackupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListBootVolumeBackupsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListBootVolumeBackupsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListBootVolumeBackupsResponse") } return } // listBootVolumeBackups implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) listBootVolumeBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeBackups") if err != nil { return nil, err } var response ListBootVolumeBackupsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListBootVolumes Lists the boot volumes in the specified compartment and availability domain. func (client BlockstorageClient) ListBootVolumes(ctx context.Context, request ListBootVolumesRequest) (response ListBootVolumesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listBootVolumes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListBootVolumesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListBootVolumesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListBootVolumesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListBootVolumesResponse") } return } // listBootVolumes implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) listBootVolumes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumes") if err != nil { return nil, err } var response ListBootVolumesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVolumeBackupPolicies Lists all the volume backup policies available in the specified compartment. // For more information about Oracle defined backup policies and user defined backup policies, // see Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm). func (client BlockstorageClient) ListVolumeBackupPolicies(ctx context.Context, request ListVolumeBackupPoliciesRequest) (response ListVolumeBackupPoliciesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVolumeBackupPolicies, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVolumeBackupPoliciesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVolumeBackupPoliciesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVolumeBackupPoliciesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVolumeBackupPoliciesResponse") } return } // listVolumeBackupPolicies implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) listVolumeBackupPolicies(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackupPolicies") if err != nil { return nil, err } var response ListVolumeBackupPoliciesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVolumeBackups Lists the volume backups in the specified compartment. You can filter the results by volume. func (client BlockstorageClient) ListVolumeBackups(ctx context.Context, request ListVolumeBackupsRequest) (response ListVolumeBackupsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVolumeBackups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVolumeBackupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVolumeBackupsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVolumeBackupsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVolumeBackupsResponse") } return } // listVolumeBackups implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) listVolumeBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeBackups") if err != nil { return nil, err } var response ListVolumeBackupsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVolumeGroupBackups Lists the volume group backups in the specified compartment. You can filter the results by volume group. // For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) ListVolumeGroupBackups(ctx context.Context, request ListVolumeGroupBackupsRequest) (response ListVolumeGroupBackupsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVolumeGroupBackups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVolumeGroupBackupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVolumeGroupBackupsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVolumeGroupBackupsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVolumeGroupBackupsResponse") } return } // listVolumeGroupBackups implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) listVolumeGroupBackups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroupBackups") if err != nil { return nil, err } var response ListVolumeGroupBackupsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVolumeGroups Lists the volume groups in the specified compartment and availability domain. // For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) ListVolumeGroups(ctx context.Context, request ListVolumeGroupsRequest) (response ListVolumeGroupsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVolumeGroups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVolumeGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVolumeGroupsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVolumeGroupsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVolumeGroupsResponse") } return } // listVolumeGroups implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) listVolumeGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeGroups") if err != nil { return nil, err } var response ListVolumeGroupsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVolumes Lists the volumes in the specified compartment and availability domain. func (client BlockstorageClient) ListVolumes(ctx context.Context, request ListVolumesRequest) (response ListVolumesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVolumes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVolumesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVolumesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVolumesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVolumesResponse") } return } // listVolumes implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) listVolumes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumes") if err != nil { return nil, err } var response ListVolumesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateBootVolume Updates the specified boot volume's display name, defined tags, and free-form tags. func (client BlockstorageClient) UpdateBootVolume(ctx context.Context, request UpdateBootVolumeRequest) (response UpdateBootVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateBootVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateBootVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateBootVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateBootVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateBootVolumeResponse") } return } // updateBootVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/bootVolumes/{bootVolumeId}") if err != nil { return nil, err } var response UpdateBootVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateBootVolumeBackup Updates the display name for the specified boot volume backup. // Avoid entering confidential information. func (client BlockstorageClient) UpdateBootVolumeBackup(ctx context.Context, request UpdateBootVolumeBackupRequest) (response UpdateBootVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateBootVolumeBackup, policy) if err != nil { if ociResponse != nil { response = UpdateBootVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} } return } if convertedResponse, ok := ociResponse.(UpdateBootVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateBootVolumeBackupResponse") } return } // updateBootVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateBootVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/bootVolumeBackups/{bootVolumeBackupId}") if err != nil { return nil, err } var response UpdateBootVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateBootVolumeKmsKey Updates the specified volume with a new Key Management master encryption key. func (client BlockstorageClient) UpdateBootVolumeKmsKey(ctx context.Context, request UpdateBootVolumeKmsKeyRequest) (response UpdateBootVolumeKmsKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateBootVolumeKmsKey, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateBootVolumeKmsKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateBootVolumeKmsKeyResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateBootVolumeKmsKeyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateBootVolumeKmsKeyResponse") } return } // updateBootVolumeKmsKey implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateBootVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/bootVolumes/{bootVolumeId}/kmsKey") if err != nil { return nil, err } var response UpdateBootVolumeKmsKeyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVolume Updates the specified volume's display name. // Avoid entering confidential information. func (client BlockstorageClient) UpdateVolume(ctx context.Context, request UpdateVolumeRequest) (response UpdateVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeResponse") } return } // updateVolume implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumes/{volumeId}") if err != nil { return nil, err } var response UpdateVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVolumeBackup Updates the display name for the specified volume backup. // Avoid entering confidential information. func (client BlockstorageClient) UpdateVolumeBackup(ctx context.Context, request UpdateVolumeBackupRequest) (response UpdateVolumeBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVolumeBackup, policy) if err != nil { if ociResponse != nil { response = UpdateVolumeBackupResponse{RawResponse: ociResponse.HTTPResponse()} } return } if convertedResponse, ok := ociResponse.(UpdateVolumeBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeBackupResponse") } return } // updateVolumeBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateVolumeBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumeBackups/{volumeBackupId}") if err != nil { return nil, err } var response UpdateVolumeBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVolumeBackupPolicy Updates a user defined backup policy. // For more information about user defined backup policies, // see Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#UserDefinedBackupPolicies). // Avoid entering confidential information. func (client BlockstorageClient) UpdateVolumeBackupPolicy(ctx context.Context, request UpdateVolumeBackupPolicyRequest) (response UpdateVolumeBackupPolicyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateVolumeBackupPolicy, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateVolumeBackupPolicyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateVolumeBackupPolicyResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateVolumeBackupPolicyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeBackupPolicyResponse") } return } // updateVolumeBackupPolicy implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateVolumeBackupPolicy(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumeBackupPolicies/{policyId}") if err != nil { return nil, err } var response UpdateVolumeBackupPolicyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVolumeGroup Updates the set of volumes in a volume group along with the display name. Use this operation // to add or remove volumes in a volume group. Specify the full list of volume IDs to include in the // volume group. If the volume ID is not specified in the call, it will be removed from the volume group. // Avoid entering confidential information. // For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) UpdateVolumeGroup(ctx context.Context, request UpdateVolumeGroupRequest) (response UpdateVolumeGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVolumeGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateVolumeGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateVolumeGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateVolumeGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeGroupResponse") } return } // updateVolumeGroup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateVolumeGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumeGroups/{volumeGroupId}") if err != nil { return nil, err } var response UpdateVolumeGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVolumeGroupBackup Updates the display name for the specified volume group backup. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). func (client BlockstorageClient) UpdateVolumeGroupBackup(ctx context.Context, request UpdateVolumeGroupBackupRequest) (response UpdateVolumeGroupBackupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVolumeGroupBackup, policy) if err != nil { if ociResponse != nil { response = UpdateVolumeGroupBackupResponse{RawResponse: ociResponse.HTTPResponse()} } return } if convertedResponse, ok := ociResponse.(UpdateVolumeGroupBackupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeGroupBackupResponse") } return } // updateVolumeGroupBackup implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateVolumeGroupBackup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumeGroupBackups/{volumeGroupBackupId}") if err != nil { return nil, err } var response UpdateVolumeGroupBackupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVolumeKmsKey Updates the specified volume with a new Key Management master encryption key. func (client BlockstorageClient) UpdateVolumeKmsKey(ctx context.Context, request UpdateVolumeKmsKeyRequest) (response UpdateVolumeKmsKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVolumeKmsKey, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateVolumeKmsKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateVolumeKmsKeyResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateVolumeKmsKeyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVolumeKmsKeyResponse") } return } // updateVolumeKmsKey implements the OCIOperation interface (enables retrying operations) func (client BlockstorageClient) updateVolumeKmsKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/volumes/{volumeId}/kmsKey") if err != nil { return nil, err } var response UpdateVolumeKmsKeyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/core_compute_client.go��������������������0000664�0000000�0000000�00000356447�13771713062�0027544�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "context" "fmt" "github.com/oracle/oci-go-sdk/common" "net/http" ) //ComputeClient a client for Compute type ComputeClient struct { common.BaseClient config *common.ConfigurationProvider } // NewComputeClientWithConfigurationProvider Creates a new default Compute client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewComputeClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ComputeClient, err error) { baseClient, err := common.NewClientWithConfig(configProvider) if err != nil { return } return newComputeClientFromBaseClient(baseClient, configProvider) } // NewComputeClientWithOboToken Creates a new default Compute client with the given configuration provider. // The obotoken will be added to default headers and signed; the configuration provider will be used for the signer // as well as reading the region func NewComputeClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ComputeClient, err error) { baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) if err != nil { return } return newComputeClientFromBaseClient(baseClient, configProvider) } func newComputeClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ComputeClient, err error) { client = ComputeClient{BaseClient: baseClient} client.BasePath = "20160918" err = client.setConfigurationProvider(configProvider) return } // SetRegion overrides the region of this client. func (client *ComputeClient) SetRegion(region string) { client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid func (client *ComputeClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { return err } // Error has been checked already region, _ := configProvider.Region() client.SetRegion(region) client.config = &configProvider return nil } // ConfigurationProvider the ConfigurationProvider used in this client, or null if none set func (client *ComputeClient) ConfigurationProvider() *common.ConfigurationProvider { return client.config } // AddImageShapeCompatibilityEntry Adds a shape to the compatible shapes list for the image. func (client ComputeClient) AddImageShapeCompatibilityEntry(ctx context.Context, request AddImageShapeCompatibilityEntryRequest) (response AddImageShapeCompatibilityEntryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.addImageShapeCompatibilityEntry, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = AddImageShapeCompatibilityEntryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = AddImageShapeCompatibilityEntryResponse{} } } return } if convertedResponse, ok := ociResponse.(AddImageShapeCompatibilityEntryResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into AddImageShapeCompatibilityEntryResponse") } return } // addImageShapeCompatibilityEntry implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) addImageShapeCompatibilityEntry(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/images/{imageId}/shapes/{shapeName}") if err != nil { return nil, err } var response AddImageShapeCompatibilityEntryResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // AttachBootVolume Attaches the specified boot volume to the specified instance. func (client ComputeClient) AttachBootVolume(ctx context.Context, request AttachBootVolumeRequest) (response AttachBootVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.attachBootVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = AttachBootVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = AttachBootVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(AttachBootVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into AttachBootVolumeResponse") } return } // attachBootVolume implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) attachBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/bootVolumeAttachments") if err != nil { return nil, err } var response AttachBootVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // AttachVnic Creates a secondary VNIC and attaches it to the specified instance. // For more information about secondary VNICs, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). func (client ComputeClient) AttachVnic(ctx context.Context, request AttachVnicRequest) (response AttachVnicResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.attachVnic, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = AttachVnicResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = AttachVnicResponse{} } } return } if convertedResponse, ok := ociResponse.(AttachVnicResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into AttachVnicResponse") } return } // attachVnic implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) attachVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/vnicAttachments") if err != nil { return nil, err } var response AttachVnicResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // AttachVolume Attaches the specified storage volume to the specified instance. func (client ComputeClient) AttachVolume(ctx context.Context, request AttachVolumeRequest) (response AttachVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.attachVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = AttachVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = AttachVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(AttachVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into AttachVolumeResponse") } return } // attachVolume implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) attachVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/volumeAttachments") if err != nil { return nil, err } var response AttachVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &volumeattachment{}) return response, err } // CaptureConsoleHistory Captures the most recent serial console data (up to a megabyte) for the // specified instance. // The `CaptureConsoleHistory` operation works with the other console history operations // as described below. // 1. Use `CaptureConsoleHistory` to request the capture of up to a megabyte of the // most recent console history. This call returns a `ConsoleHistory` // object. The object will have a state of REQUESTED. // 2. Wait for the capture operation to succeed by polling `GetConsoleHistory` with // the identifier of the console history metadata. The state of the // `ConsoleHistory` object will go from REQUESTED to GETTING-HISTORY and // then SUCCEEDED (or FAILED). // 3. Use `GetConsoleHistoryContent` to get the actual console history data (not the // metadata). // 4. Optionally, use `DeleteConsoleHistory` to delete the console history metadata // and the console history data. func (client ComputeClient) CaptureConsoleHistory(ctx context.Context, request CaptureConsoleHistoryRequest) (response CaptureConsoleHistoryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.captureConsoleHistory, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CaptureConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CaptureConsoleHistoryResponse{} } } return } if convertedResponse, ok := ociResponse.(CaptureConsoleHistoryResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CaptureConsoleHistoryResponse") } return } // captureConsoleHistory implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) captureConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConsoleHistories") if err != nil { return nil, err } var response CaptureConsoleHistoryResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeDedicatedVmHostCompartment Moves a dedicated virtual machine host from one compartment to another. func (client ComputeClient) ChangeDedicatedVmHostCompartment(ctx context.Context, request ChangeDedicatedVmHostCompartmentRequest) (response ChangeDedicatedVmHostCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeDedicatedVmHostCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeDedicatedVmHostCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeDedicatedVmHostCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeDedicatedVmHostCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeDedicatedVmHostCompartmentResponse") } return } // changeDedicatedVmHostCompartment implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) changeDedicatedVmHostCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/dedicatedVmHosts/{dedicatedVmHostId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeDedicatedVmHostCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeImageCompartment Moves an image into a different compartment within the same tenancy. For information about moving // resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client ComputeClient) ChangeImageCompartment(ctx context.Context, request ChangeImageCompartmentRequest) (response ChangeImageCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeImageCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeImageCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeImageCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeImageCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeImageCompartmentResponse") } return } // changeImageCompartment implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) changeImageCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/images/{imageId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeImageCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeInstanceCompartment Moves an instance into a different compartment within the same tenancy. For information about // moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // When you move an instance to a different compartment, associated resources such as boot volumes and VNICs // are not moved. func (client ComputeClient) ChangeInstanceCompartment(ctx context.Context, request ChangeInstanceCompartmentRequest) (response ChangeInstanceCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeInstanceCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeInstanceCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeInstanceCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeInstanceCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeInstanceCompartmentResponse") } return } // changeInstanceCompartment implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) changeInstanceCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instances/{instanceId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeInstanceCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateAppCatalogSubscription Create a subscription for listing resource version for a compartment. It will take some time to propagate to all regions. func (client ComputeClient) CreateAppCatalogSubscription(ctx context.Context, request CreateAppCatalogSubscriptionRequest) (response CreateAppCatalogSubscriptionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createAppCatalogSubscription, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateAppCatalogSubscriptionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateAppCatalogSubscriptionResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateAppCatalogSubscriptionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateAppCatalogSubscriptionResponse") } return } // createAppCatalogSubscription implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) createAppCatalogSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/appCatalogSubscriptions") if err != nil { return nil, err } var response CreateAppCatalogSubscriptionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateDedicatedVmHost Creates a new dedicated virtual machine host in the specified compartment and the specified availability domain. // Dedicated virtual machine hosts enable you to run your Compute virtual machine (VM) instances on dedicated servers // that are a single tenant and not shared with other customers. // For more information, see Dedicated Virtual Machine Hosts (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/dedicatedvmhosts.htm). func (client ComputeClient) CreateDedicatedVmHost(ctx context.Context, request CreateDedicatedVmHostRequest) (response CreateDedicatedVmHostResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createDedicatedVmHost, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateDedicatedVmHostResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateDedicatedVmHostResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateDedicatedVmHostResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateDedicatedVmHostResponse") } return } // createDedicatedVmHost implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) createDedicatedVmHost(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/dedicatedVmHosts") if err != nil { return nil, err } var response CreateDedicatedVmHostResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateImage Creates a boot disk image for the specified instance or imports an exported image from the Oracle Cloud Infrastructure Object Storage service. // When creating a new image, you must provide the OCID of the instance you want to use as the basis for the image, and // the OCID of the compartment containing that instance. For more information about images, // see Managing Custom Images (https://docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm). // When importing an exported image from Object Storage, you specify the source information // in ImageSourceDetails. // When importing an image based on the namespace, bucket name, and object name, // use ImageSourceViaObjectStorageTupleDetails. // When importing an image based on the Object Storage URL, use // ImageSourceViaObjectStorageUriDetails. // See Object Storage URLs (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and Using Pre-Authenticated Requests (https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) // for constructing URLs for image import/export. // For more information about importing exported images, see // Image Import/Export (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm). // You may optionally specify a *display name* for the image, which is simply a friendly name or description. // It does not have to be unique, and you can change it. See UpdateImage. // Avoid entering confidential information. func (client ComputeClient) CreateImage(ctx context.Context, request CreateImageRequest) (response CreateImageResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createImage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateImageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateImageResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateImageResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateImageResponse") } return } // createImage implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) createImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/images") if err != nil { return nil, err } var response CreateImageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateInstanceConsoleConnection Creates a new console connection to the specified instance. // After the console connection has been created and is available, // you connect to the console using SSH. // For more information about console access, see Accessing the Console (https://docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm). func (client ComputeClient) CreateInstanceConsoleConnection(ctx context.Context, request CreateInstanceConsoleConnectionRequest) (response CreateInstanceConsoleConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createInstanceConsoleConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateInstanceConsoleConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateInstanceConsoleConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateInstanceConsoleConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateInstanceConsoleConnectionResponse") } return } // createInstanceConsoleConnection implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) createInstanceConsoleConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConsoleConnections") if err != nil { return nil, err } var response CreateInstanceConsoleConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteAppCatalogSubscription Delete a subscription for a listing resource version for a compartment. func (client ComputeClient) DeleteAppCatalogSubscription(ctx context.Context, request DeleteAppCatalogSubscriptionRequest) (response DeleteAppCatalogSubscriptionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteAppCatalogSubscription, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteAppCatalogSubscriptionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteAppCatalogSubscriptionResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteAppCatalogSubscriptionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteAppCatalogSubscriptionResponse") } return } // deleteAppCatalogSubscription implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) deleteAppCatalogSubscription(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/appCatalogSubscriptions") if err != nil { return nil, err } var response DeleteAppCatalogSubscriptionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteConsoleHistory Deletes the specified console history metadata and the console history data. func (client ComputeClient) DeleteConsoleHistory(ctx context.Context, request DeleteConsoleHistoryRequest) (response DeleteConsoleHistoryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteConsoleHistory, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteConsoleHistoryResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteConsoleHistoryResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteConsoleHistoryResponse") } return } // deleteConsoleHistory implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) deleteConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instanceConsoleHistories/{instanceConsoleHistoryId}") if err != nil { return nil, err } var response DeleteConsoleHistoryResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteDedicatedVmHost Deletes the specified dedicated virtual machine host. // If any VM instances are assigned to the dedicated virtual machine host, // the delete operation will fail and the service will return a 409 response code. func (client ComputeClient) DeleteDedicatedVmHost(ctx context.Context, request DeleteDedicatedVmHostRequest) (response DeleteDedicatedVmHostResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteDedicatedVmHost, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteDedicatedVmHostResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteDedicatedVmHostResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteDedicatedVmHostResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteDedicatedVmHostResponse") } return } // deleteDedicatedVmHost implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) deleteDedicatedVmHost(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dedicatedVmHosts/{dedicatedVmHostId}") if err != nil { return nil, err } var response DeleteDedicatedVmHostResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteImage Deletes an image. func (client ComputeClient) DeleteImage(ctx context.Context, request DeleteImageRequest) (response DeleteImageResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteImage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteImageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteImageResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteImageResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteImageResponse") } return } // deleteImage implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) deleteImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/images/{imageId}") if err != nil { return nil, err } var response DeleteImageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteInstanceConsoleConnection Deletes the specified instance console connection. func (client ComputeClient) DeleteInstanceConsoleConnection(ctx context.Context, request DeleteInstanceConsoleConnectionRequest) (response DeleteInstanceConsoleConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteInstanceConsoleConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteInstanceConsoleConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteInstanceConsoleConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteInstanceConsoleConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteInstanceConsoleConnectionResponse") } return } // deleteInstanceConsoleConnection implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) deleteInstanceConsoleConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instanceConsoleConnections/{instanceConsoleConnectionId}") if err != nil { return nil, err } var response DeleteInstanceConsoleConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DetachBootVolume Detaches a boot volume from an instance. You must specify the OCID of the boot volume attachment. // This is an asynchronous operation. The attachment's `lifecycleState` will change to DETACHING temporarily // until the attachment is completely removed. func (client ComputeClient) DetachBootVolume(ctx context.Context, request DetachBootVolumeRequest) (response DetachBootVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.detachBootVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DetachBootVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DetachBootVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(DetachBootVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DetachBootVolumeResponse") } return } // detachBootVolume implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) detachBootVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/bootVolumeAttachments/{bootVolumeAttachmentId}") if err != nil { return nil, err } var response DetachBootVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DetachVnic Detaches and deletes the specified secondary VNIC. // This operation cannot be used on the instance's primary VNIC. // When you terminate an instance, all attached VNICs (primary // and secondary) are automatically detached and deleted. // **Important:** If the VNIC has a // PrivateIp that is the // target of a route rule (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip), // deleting the VNIC causes that route rule to blackhole and the traffic // will be dropped. func (client ComputeClient) DetachVnic(ctx context.Context, request DetachVnicRequest) (response DetachVnicResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.detachVnic, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DetachVnicResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DetachVnicResponse{} } } return } if convertedResponse, ok := ociResponse.(DetachVnicResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DetachVnicResponse") } return } // detachVnic implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) detachVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/vnicAttachments/{vnicAttachmentId}") if err != nil { return nil, err } var response DetachVnicResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DetachVolume Detaches a storage volume from an instance. You must specify the OCID of the volume attachment. // This is an asynchronous operation. The attachment's `lifecycleState` will change to DETACHING temporarily // until the attachment is completely removed. func (client ComputeClient) DetachVolume(ctx context.Context, request DetachVolumeRequest) (response DetachVolumeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.detachVolume, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DetachVolumeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DetachVolumeResponse{} } } return } if convertedResponse, ok := ociResponse.(DetachVolumeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DetachVolumeResponse") } return } // detachVolume implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) detachVolume(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/volumeAttachments/{volumeAttachmentId}") if err != nil { return nil, err } var response DetachVolumeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ExportImage Exports the specified image to the Oracle Cloud Infrastructure Object Storage service. You can use the Object Storage URL, // or the namespace, bucket name, and object name when specifying the location to export to. // For more information about exporting images, see Image Import/Export (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm). // To perform an image export, you need write access to the Object Storage bucket for the image, // see Let Users Write Objects to Object Storage Buckets (https://docs.cloud.oracle.com/Content/Identity/Concepts/commonpolicies.htm#Let4). // See Object Storage URLs (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) and Using Pre-Authenticated Requests (https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) // for constructing URLs for image import/export. func (client ComputeClient) ExportImage(ctx context.Context, request ExportImageRequest) (response ExportImageResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.exportImage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ExportImageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ExportImageResponse{} } } return } if convertedResponse, ok := ociResponse.(ExportImageResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ExportImageResponse") } return } // exportImage implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) exportImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/images/{imageId}/actions/export") if err != nil { return nil, err } var response ExportImageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetAppCatalogListing Gets the specified listing. func (client ComputeClient) GetAppCatalogListing(ctx context.Context, request GetAppCatalogListingRequest) (response GetAppCatalogListingResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getAppCatalogListing, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetAppCatalogListingResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetAppCatalogListingResponse{} } } return } if convertedResponse, ok := ociResponse.(GetAppCatalogListingResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetAppCatalogListingResponse") } return } // getAppCatalogListing implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getAppCatalogListing(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}") if err != nil { return nil, err } var response GetAppCatalogListingResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetAppCatalogListingAgreements Retrieves the agreements for a particular resource version of a listing. func (client ComputeClient) GetAppCatalogListingAgreements(ctx context.Context, request GetAppCatalogListingAgreementsRequest) (response GetAppCatalogListingAgreementsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getAppCatalogListingAgreements, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetAppCatalogListingAgreementsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetAppCatalogListingAgreementsResponse{} } } return } if convertedResponse, ok := ociResponse.(GetAppCatalogListingAgreementsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetAppCatalogListingAgreementsResponse") } return } // getAppCatalogListingAgreements implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getAppCatalogListingAgreements(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}/resourceVersions/{resourceVersion}/agreements") if err != nil { return nil, err } var response GetAppCatalogListingAgreementsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetAppCatalogListingResourceVersion Gets the specified listing resource version. func (client ComputeClient) GetAppCatalogListingResourceVersion(ctx context.Context, request GetAppCatalogListingResourceVersionRequest) (response GetAppCatalogListingResourceVersionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getAppCatalogListingResourceVersion, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetAppCatalogListingResourceVersionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetAppCatalogListingResourceVersionResponse{} } } return } if convertedResponse, ok := ociResponse.(GetAppCatalogListingResourceVersionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetAppCatalogListingResourceVersionResponse") } return } // getAppCatalogListingResourceVersion implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getAppCatalogListingResourceVersion(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}/resourceVersions/{resourceVersion}") if err != nil { return nil, err } var response GetAppCatalogListingResourceVersionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetBootVolumeAttachment Gets information about the specified boot volume attachment. func (client ComputeClient) GetBootVolumeAttachment(ctx context.Context, request GetBootVolumeAttachmentRequest) (response GetBootVolumeAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getBootVolumeAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetBootVolumeAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetBootVolumeAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetBootVolumeAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetBootVolumeAttachmentResponse") } return } // getBootVolumeAttachment implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getBootVolumeAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeAttachments/{bootVolumeAttachmentId}") if err != nil { return nil, err } var response GetBootVolumeAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetConsoleHistory Shows the metadata for the specified console history. // See CaptureConsoleHistory // for details about using the console history operations. func (client ComputeClient) GetConsoleHistory(ctx context.Context, request GetConsoleHistoryRequest) (response GetConsoleHistoryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getConsoleHistory, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetConsoleHistoryResponse{} } } return } if convertedResponse, ok := ociResponse.(GetConsoleHistoryResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetConsoleHistoryResponse") } return } // getConsoleHistory implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleHistories/{instanceConsoleHistoryId}") if err != nil { return nil, err } var response GetConsoleHistoryResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetConsoleHistoryContent Gets the actual console history data (not the metadata). // See CaptureConsoleHistory // for details about using the console history operations. func (client ComputeClient) GetConsoleHistoryContent(ctx context.Context, request GetConsoleHistoryContentRequest) (response GetConsoleHistoryContentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getConsoleHistoryContent, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetConsoleHistoryContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetConsoleHistoryContentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetConsoleHistoryContentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetConsoleHistoryContentResponse") } return } // getConsoleHistoryContent implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getConsoleHistoryContent(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleHistories/{instanceConsoleHistoryId}/data") if err != nil { return nil, err } var response GetConsoleHistoryContentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetDedicatedVmHost Gets information about the specified dedicated virtual machine host. func (client ComputeClient) GetDedicatedVmHost(ctx context.Context, request GetDedicatedVmHostRequest) (response GetDedicatedVmHostResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getDedicatedVmHost, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetDedicatedVmHostResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetDedicatedVmHostResponse{} } } return } if convertedResponse, ok := ociResponse.(GetDedicatedVmHostResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetDedicatedVmHostResponse") } return } // getDedicatedVmHost implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getDedicatedVmHost(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/dedicatedVmHosts/{dedicatedVmHostId}") if err != nil { return nil, err } var response GetDedicatedVmHostResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetImage Gets the specified image. func (client ComputeClient) GetImage(ctx context.Context, request GetImageRequest) (response GetImageResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getImage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetImageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetImageResponse{} } } return } if convertedResponse, ok := ociResponse.(GetImageResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetImageResponse") } return } // getImage implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/images/{imageId}") if err != nil { return nil, err } var response GetImageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetImageShapeCompatibilityEntry Retrieves an image shape compatibility entry. func (client ComputeClient) GetImageShapeCompatibilityEntry(ctx context.Context, request GetImageShapeCompatibilityEntryRequest) (response GetImageShapeCompatibilityEntryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getImageShapeCompatibilityEntry, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetImageShapeCompatibilityEntryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetImageShapeCompatibilityEntryResponse{} } } return } if convertedResponse, ok := ociResponse.(GetImageShapeCompatibilityEntryResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetImageShapeCompatibilityEntryResponse") } return } // getImageShapeCompatibilityEntry implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getImageShapeCompatibilityEntry(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/images/{imageId}/shapes/{shapeName}") if err != nil { return nil, err } var response GetImageShapeCompatibilityEntryResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetInstance Gets information about the specified instance. func (client ComputeClient) GetInstance(ctx context.Context, request GetInstanceRequest) (response GetInstanceResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getInstance, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetInstanceResponse{} } } return } if convertedResponse, ok := ociResponse.(GetInstanceResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetInstanceResponse") } return } // getInstance implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances/{instanceId}") if err != nil { return nil, err } var response GetInstanceResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetInstanceConsoleConnection Gets the specified instance console connection's information. func (client ComputeClient) GetInstanceConsoleConnection(ctx context.Context, request GetInstanceConsoleConnectionRequest) (response GetInstanceConsoleConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getInstanceConsoleConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetInstanceConsoleConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetInstanceConsoleConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(GetInstanceConsoleConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetInstanceConsoleConnectionResponse") } return } // getInstanceConsoleConnection implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getInstanceConsoleConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleConnections/{instanceConsoleConnectionId}") if err != nil { return nil, err } var response GetInstanceConsoleConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVnicAttachment Gets the information for the specified VNIC attachment. func (client ComputeClient) GetVnicAttachment(ctx context.Context, request GetVnicAttachmentRequest) (response GetVnicAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVnicAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVnicAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVnicAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVnicAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVnicAttachmentResponse") } return } // getVnicAttachment implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getVnicAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/vnicAttachments/{vnicAttachmentId}") if err != nil { return nil, err } var response GetVnicAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVolumeAttachment Gets information about the specified volume attachment. func (client ComputeClient) GetVolumeAttachment(ctx context.Context, request GetVolumeAttachmentRequest) (response GetVolumeAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVolumeAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVolumeAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVolumeAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVolumeAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVolumeAttachmentResponse") } return } // getVolumeAttachment implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getVolumeAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeAttachments/{volumeAttachmentId}") if err != nil { return nil, err } var response GetVolumeAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &volumeattachment{}) return response, err } // GetWindowsInstanceInitialCredentials Gets the generated credentials for the instance. Only works for instances that require a password to log in, such as Windows. // For certain operating systems, users will be forced to change the initial credentials. func (client ComputeClient) GetWindowsInstanceInitialCredentials(ctx context.Context, request GetWindowsInstanceInitialCredentialsRequest) (response GetWindowsInstanceInitialCredentialsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getWindowsInstanceInitialCredentials, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetWindowsInstanceInitialCredentialsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetWindowsInstanceInitialCredentialsResponse{} } } return } if convertedResponse, ok := ociResponse.(GetWindowsInstanceInitialCredentialsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetWindowsInstanceInitialCredentialsResponse") } return } // getWindowsInstanceInitialCredentials implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) getWindowsInstanceInitialCredentials(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances/{instanceId}/initialCredentials") if err != nil { return nil, err } var response GetWindowsInstanceInitialCredentialsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // InstanceAction Performs one of the following power actions on the specified instance: // - **START** - Powers on the instance. // - **STOP** - Powers off the instance. // - **RESET** - Powers off the instance and then powers it back on. // - **SOFTSTOP** - Gracefully shuts down the instance by sending a shutdown command to the operating system. // If the applications that run on the instance take a long time to shut down, they could be improperly stopped, resulting // in data corruption. To avoid this, shut down the instance using the commands available in the OS before you softstop the // instance. // - **SOFTRESET** - Gracefully reboots the instance by sending a shutdown command to the operating system, and // then powers the instance back on. // For more information, see Stopping and Starting an Instance (https://docs.cloud.oracle.com/Content/Compute/Tasks/restartinginstance.htm). func (client ComputeClient) InstanceAction(ctx context.Context, request InstanceActionRequest) (response InstanceActionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.instanceAction, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = InstanceActionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = InstanceActionResponse{} } } return } if convertedResponse, ok := ociResponse.(InstanceActionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into InstanceActionResponse") } return } // instanceAction implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) instanceAction(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instances/{instanceId}") if err != nil { return nil, err } var response InstanceActionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // LaunchInstance Creates a new instance in the specified compartment and the specified availability domain. // For general information about instances, see // Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). // For information about access control and compartments, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about availability domains, see // Regions and Availability Domains (https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm). // To get a list of availability domains, use the `ListAvailabilityDomains` operation // in the Identity and Access Management Service API. // All Oracle Cloud Infrastructure resources, including instances, get an Oracle-assigned, // unique ID called an Oracle Cloud Identifier (OCID). // When you create a resource, you can find its OCID in the response. You can // also retrieve a resource's OCID by using a List API operation // on that resource type, or by viewing the resource in the Console. // To launch an instance using an image or a boot volume use the `sourceDetails` parameter in LaunchInstanceDetails. // When you launch an instance, it is automatically attached to a virtual // network interface card (VNIC), called the *primary VNIC*. The VNIC // has a private IP address from the subnet's CIDR. You can either assign a // private IP address of your choice or let Oracle automatically assign one. // You can choose whether the instance has a public IP address. To retrieve the // addresses, use the ListVnicAttachments // operation to get the VNIC ID for the instance, and then call // GetVnic with the VNIC ID. // You can later add secondary VNICs to an instance. For more information, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). func (client ComputeClient) LaunchInstance(ctx context.Context, request LaunchInstanceRequest) (response LaunchInstanceResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.launchInstance, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = LaunchInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = LaunchInstanceResponse{} } } return } if convertedResponse, ok := ociResponse.(LaunchInstanceResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into LaunchInstanceResponse") } return } // launchInstance implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) launchInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instances") if err != nil { return nil, err } var response LaunchInstanceResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListAppCatalogListingResourceVersions Gets all resource versions for a particular listing. func (client ComputeClient) ListAppCatalogListingResourceVersions(ctx context.Context, request ListAppCatalogListingResourceVersionsRequest) (response ListAppCatalogListingResourceVersionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listAppCatalogListingResourceVersions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListAppCatalogListingResourceVersionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListAppCatalogListingResourceVersionsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListAppCatalogListingResourceVersionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListAppCatalogListingResourceVersionsResponse") } return } // listAppCatalogListingResourceVersions implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listAppCatalogListingResourceVersions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings/{listingId}/resourceVersions") if err != nil { return nil, err } var response ListAppCatalogListingResourceVersionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListAppCatalogListings Lists the published listings. func (client ComputeClient) ListAppCatalogListings(ctx context.Context, request ListAppCatalogListingsRequest) (response ListAppCatalogListingsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listAppCatalogListings, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListAppCatalogListingsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListAppCatalogListingsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListAppCatalogListingsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListAppCatalogListingsResponse") } return } // listAppCatalogListings implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listAppCatalogListings(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogListings") if err != nil { return nil, err } var response ListAppCatalogListingsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListAppCatalogSubscriptions Lists subscriptions for a compartment. func (client ComputeClient) ListAppCatalogSubscriptions(ctx context.Context, request ListAppCatalogSubscriptionsRequest) (response ListAppCatalogSubscriptionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listAppCatalogSubscriptions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListAppCatalogSubscriptionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListAppCatalogSubscriptionsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListAppCatalogSubscriptionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListAppCatalogSubscriptionsResponse") } return } // listAppCatalogSubscriptions implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listAppCatalogSubscriptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/appCatalogSubscriptions") if err != nil { return nil, err } var response ListAppCatalogSubscriptionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListBootVolumeAttachments Lists the boot volume attachments in the specified compartment. You can filter the // list by specifying an instance OCID, boot volume OCID, or both. func (client ComputeClient) ListBootVolumeAttachments(ctx context.Context, request ListBootVolumeAttachmentsRequest) (response ListBootVolumeAttachmentsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listBootVolumeAttachments, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListBootVolumeAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListBootVolumeAttachmentsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListBootVolumeAttachmentsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListBootVolumeAttachmentsResponse") } return } // listBootVolumeAttachments implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listBootVolumeAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/bootVolumeAttachments") if err != nil { return nil, err } var response ListBootVolumeAttachmentsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListConsoleHistories Lists the console history metadata for the specified compartment or instance. func (client ComputeClient) ListConsoleHistories(ctx context.Context, request ListConsoleHistoriesRequest) (response ListConsoleHistoriesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listConsoleHistories, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListConsoleHistoriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListConsoleHistoriesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListConsoleHistoriesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListConsoleHistoriesResponse") } return } // listConsoleHistories implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listConsoleHistories(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleHistories") if err != nil { return nil, err } var response ListConsoleHistoriesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListDedicatedVmHostInstanceShapes Lists the shapes that can be used to launch a virtual machine instance on a dedicated virtual machine host within the specified compartment. // You can filter the list by compatibility with a specific dedicated virtual machine host shape. func (client ComputeClient) ListDedicatedVmHostInstanceShapes(ctx context.Context, request ListDedicatedVmHostInstanceShapesRequest) (response ListDedicatedVmHostInstanceShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listDedicatedVmHostInstanceShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListDedicatedVmHostInstanceShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListDedicatedVmHostInstanceShapesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListDedicatedVmHostInstanceShapesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListDedicatedVmHostInstanceShapesResponse") } return } // listDedicatedVmHostInstanceShapes implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listDedicatedVmHostInstanceShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/dedicatedVmHostInstanceShapes") if err != nil { return nil, err } var response ListDedicatedVmHostInstanceShapesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListDedicatedVmHostInstances Returns the list of instances on the dedicated virtual machine hosts that match the specified criteria. func (client ComputeClient) ListDedicatedVmHostInstances(ctx context.Context, request ListDedicatedVmHostInstancesRequest) (response ListDedicatedVmHostInstancesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listDedicatedVmHostInstances, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListDedicatedVmHostInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListDedicatedVmHostInstancesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListDedicatedVmHostInstancesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListDedicatedVmHostInstancesResponse") } return } // listDedicatedVmHostInstances implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listDedicatedVmHostInstances(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/dedicatedVmHosts/{dedicatedVmHostId}/instances") if err != nil { return nil, err } var response ListDedicatedVmHostInstancesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListDedicatedVmHostShapes Lists the shapes that can be used to launch a dedicated virtual machine host within the specified compartment. func (client ComputeClient) ListDedicatedVmHostShapes(ctx context.Context, request ListDedicatedVmHostShapesRequest) (response ListDedicatedVmHostShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listDedicatedVmHostShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListDedicatedVmHostShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListDedicatedVmHostShapesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListDedicatedVmHostShapesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListDedicatedVmHostShapesResponse") } return } // listDedicatedVmHostShapes implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listDedicatedVmHostShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/dedicatedVmHostShapes") if err != nil { return nil, err } var response ListDedicatedVmHostShapesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListDedicatedVmHosts Returns the list of dedicated virtual machine hosts that match the specified criteria in the specified compartment. // You can limit the list by specifying a dedicated virtual machine host display name. The list will include all the identically-named // dedicated virtual machine hosts in the compartment. func (client ComputeClient) ListDedicatedVmHosts(ctx context.Context, request ListDedicatedVmHostsRequest) (response ListDedicatedVmHostsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listDedicatedVmHosts, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListDedicatedVmHostsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListDedicatedVmHostsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListDedicatedVmHostsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListDedicatedVmHostsResponse") } return } // listDedicatedVmHosts implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listDedicatedVmHosts(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/dedicatedVmHosts") if err != nil { return nil, err } var response ListDedicatedVmHostsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListImageShapeCompatibilityEntries Lists the shape compatibilities for the image. func (client ComputeClient) ListImageShapeCompatibilityEntries(ctx context.Context, request ListImageShapeCompatibilityEntriesRequest) (response ListImageShapeCompatibilityEntriesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listImageShapeCompatibilityEntries, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListImageShapeCompatibilityEntriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListImageShapeCompatibilityEntriesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListImageShapeCompatibilityEntriesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListImageShapeCompatibilityEntriesResponse") } return } // listImageShapeCompatibilityEntries implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listImageShapeCompatibilityEntries(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/images/{imageId}/shapes") if err != nil { return nil, err } var response ListImageShapeCompatibilityEntriesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListImages Lists the available images in the specified compartment, including both // Oracle-provided images (https://docs.cloud.oracle.com/Content/Compute/References/images.htm) and // custom images (https://docs.cloud.oracle.com/Content/Compute/Tasks/managingcustomimages.htm) that have // been created. The list of images returned is ordered to first show all // Oracle-provided images, then all custom images. // The order of images returned may change when new images are released. func (client ComputeClient) ListImages(ctx context.Context, request ListImagesRequest) (response ListImagesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listImages, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListImagesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListImagesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListImagesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListImagesResponse") } return } // listImages implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listImages(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/images") if err != nil { return nil, err } var response ListImagesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListInstanceConsoleConnections Lists the console connections for the specified compartment or instance. // For more information about console access, see Accessing the Console (https://docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm). func (client ComputeClient) ListInstanceConsoleConnections(ctx context.Context, request ListInstanceConsoleConnectionsRequest) (response ListInstanceConsoleConnectionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listInstanceConsoleConnections, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListInstanceConsoleConnectionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListInstanceConsoleConnectionsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListInstanceConsoleConnectionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListInstanceConsoleConnectionsResponse") } return } // listInstanceConsoleConnections implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listInstanceConsoleConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConsoleConnections") if err != nil { return nil, err } var response ListInstanceConsoleConnectionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListInstanceDevices Gets a list of all the devices for given instance. You can optionally filter results by device availability. func (client ComputeClient) ListInstanceDevices(ctx context.Context, request ListInstanceDevicesRequest) (response ListInstanceDevicesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listInstanceDevices, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListInstanceDevicesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListInstanceDevicesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListInstanceDevicesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListInstanceDevicesResponse") } return } // listInstanceDevices implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listInstanceDevices(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances/{instanceId}/devices") if err != nil { return nil, err } var response ListInstanceDevicesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListInstances Lists the instances in the specified compartment and the specified availability domain. // You can filter the results by specifying an instance name (the list will include all the identically-named // instances in the compartment). func (client ComputeClient) ListInstances(ctx context.Context, request ListInstancesRequest) (response ListInstancesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listInstances, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListInstancesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListInstancesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListInstancesResponse") } return } // listInstances implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listInstances(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instances") if err != nil { return nil, err } var response ListInstancesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListShapes Lists the shapes that can be used to launch an instance within the specified compartment. You can // filter the list by compatibility with a specific image. func (client ComputeClient) ListShapes(ctx context.Context, request ListShapesRequest) (response ListShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListShapesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListShapesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListShapesResponse") } return } // listShapes implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/shapes") if err != nil { return nil, err } var response ListShapesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVnicAttachments Lists the VNIC attachments in the specified compartment. A VNIC attachment // resides in the same compartment as the attached instance. The list can be // filtered by instance, VNIC, or availability domain. func (client ComputeClient) ListVnicAttachments(ctx context.Context, request ListVnicAttachmentsRequest) (response ListVnicAttachmentsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVnicAttachments, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVnicAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVnicAttachmentsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVnicAttachmentsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVnicAttachmentsResponse") } return } // listVnicAttachments implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listVnicAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/vnicAttachments") if err != nil { return nil, err } var response ListVnicAttachmentsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } //listvolumeattachment allows to unmarshal list of polymorphic VolumeAttachment type listvolumeattachment []volumeattachment //UnmarshalPolymorphicJSON unmarshals polymorphic json list of items func (m *listvolumeattachment) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { res := make([]VolumeAttachment, len(*m)) for i, v := range *m { nn, err := v.UnmarshalPolymorphicJSON(v.JsonData) if err != nil { return nil, err } res[i] = nn.(VolumeAttachment) } return res, nil } // ListVolumeAttachments Lists the volume attachments in the specified compartment. You can filter the // list by specifying an instance OCID, volume OCID, or both. // Currently, the only supported volume attachment type are IScsiVolumeAttachment and // ParavirtualizedVolumeAttachment. func (client ComputeClient) ListVolumeAttachments(ctx context.Context, request ListVolumeAttachmentsRequest) (response ListVolumeAttachmentsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVolumeAttachments, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVolumeAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVolumeAttachmentsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVolumeAttachmentsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVolumeAttachmentsResponse") } return } // listVolumeAttachments implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) listVolumeAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/volumeAttachments") if err != nil { return nil, err } var response ListVolumeAttachmentsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &listvolumeattachment{}) return response, err } // RemoveImageShapeCompatibilityEntry Removes a shape from the compatible shapes list for the image. func (client ComputeClient) RemoveImageShapeCompatibilityEntry(ctx context.Context, request RemoveImageShapeCompatibilityEntryRequest) (response RemoveImageShapeCompatibilityEntryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.removeImageShapeCompatibilityEntry, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = RemoveImageShapeCompatibilityEntryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = RemoveImageShapeCompatibilityEntryResponse{} } } return } if convertedResponse, ok := ociResponse.(RemoveImageShapeCompatibilityEntryResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into RemoveImageShapeCompatibilityEntryResponse") } return } // removeImageShapeCompatibilityEntry implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) removeImageShapeCompatibilityEntry(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/images/{imageId}/shapes/{shapeName}") if err != nil { return nil, err } var response RemoveImageShapeCompatibilityEntryResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // TerminateInstance Terminates the specified instance. Any attached VNICs and volumes are automatically detached // when the instance terminates. // To preserve the boot volume associated with the instance, specify `true` for `PreserveBootVolumeQueryParam`. // To delete the boot volume when the instance is deleted, specify `false` or do not specify a value for `PreserveBootVolumeQueryParam`. // This is an asynchronous operation. The instance's `lifecycleState` will change to TERMINATING temporarily // until the instance is completely removed. func (client ComputeClient) TerminateInstance(ctx context.Context, request TerminateInstanceRequest) (response TerminateInstanceResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.terminateInstance, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = TerminateInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = TerminateInstanceResponse{} } } return } if convertedResponse, ok := ociResponse.(TerminateInstanceResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into TerminateInstanceResponse") } return } // terminateInstance implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) terminateInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instances/{instanceId}") if err != nil { return nil, err } var response TerminateInstanceResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateConsoleHistory Updates the specified console history metadata. func (client ComputeClient) UpdateConsoleHistory(ctx context.Context, request UpdateConsoleHistoryRequest) (response UpdateConsoleHistoryResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateConsoleHistory, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateConsoleHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateConsoleHistoryResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateConsoleHistoryResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateConsoleHistoryResponse") } return } // updateConsoleHistory implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) updateConsoleHistory(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/instanceConsoleHistories/{instanceConsoleHistoryId}") if err != nil { return nil, err } var response UpdateConsoleHistoryResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateDedicatedVmHost Updates the displayName, freeformTags, and definedTags attributes for the specified dedicated virtual machine host. // If an attribute value is not included, it will not be updated. func (client ComputeClient) UpdateDedicatedVmHost(ctx context.Context, request UpdateDedicatedVmHostRequest) (response UpdateDedicatedVmHostResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateDedicatedVmHost, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateDedicatedVmHostResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateDedicatedVmHostResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateDedicatedVmHostResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateDedicatedVmHostResponse") } return } // updateDedicatedVmHost implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) updateDedicatedVmHost(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/dedicatedVmHosts/{dedicatedVmHostId}") if err != nil { return nil, err } var response UpdateDedicatedVmHostResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateImage Updates the display name of the image. Avoid entering confidential information. func (client ComputeClient) UpdateImage(ctx context.Context, request UpdateImageRequest) (response UpdateImageResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateImage, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateImageResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateImageResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateImageResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateImageResponse") } return } // updateImage implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) updateImage(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/images/{imageId}") if err != nil { return nil, err } var response UpdateImageResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateInstance Updates certain fields on the specified instance. Fields that are not provided in the // request will not be updated. Avoid entering confidential information. // Changes to metadata fields will be reflected in the instance metadata service (this may take // up to a minute). // The OCID of the instance remains the same. func (client ComputeClient) UpdateInstance(ctx context.Context, request UpdateInstanceRequest) (response UpdateInstanceResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateInstance, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateInstanceResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateInstanceResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateInstanceResponse") } return } // updateInstance implements the OCIOperation interface (enables retrying operations) func (client ComputeClient) updateInstance(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/instances/{instanceId}") if err != nil { return nil, err } var response UpdateInstanceResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/core_computemanagement_client.go����������0000664�0000000�0000000�00000162616�13771713062�0031572�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "context" "fmt" "github.com/oracle/oci-go-sdk/common" "net/http" ) //ComputeManagementClient a client for ComputeManagement type ComputeManagementClient struct { common.BaseClient config *common.ConfigurationProvider } // NewComputeManagementClientWithConfigurationProvider Creates a new default ComputeManagement client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewComputeManagementClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ComputeManagementClient, err error) { baseClient, err := common.NewClientWithConfig(configProvider) if err != nil { return } return newComputeManagementClientFromBaseClient(baseClient, configProvider) } // NewComputeManagementClientWithOboToken Creates a new default ComputeManagement client with the given configuration provider. // The obotoken will be added to default headers and signed; the configuration provider will be used for the signer // as well as reading the region func NewComputeManagementClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ComputeManagementClient, err error) { baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) if err != nil { return } return newComputeManagementClientFromBaseClient(baseClient, configProvider) } func newComputeManagementClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ComputeManagementClient, err error) { client = ComputeManagementClient{BaseClient: baseClient} client.BasePath = "20160918" err = client.setConfigurationProvider(configProvider) return } // SetRegion overrides the region of this client. func (client *ComputeManagementClient) SetRegion(region string) { client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid func (client *ComputeManagementClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { return err } // Error has been checked already region, _ := configProvider.Region() client.SetRegion(region) client.config = &configProvider return nil } // ConfigurationProvider the ConfigurationProvider used in this client, or null if none set func (client *ComputeManagementClient) ConfigurationProvider() *common.ConfigurationProvider { return client.config } // AttachLoadBalancer Attach a load balancer to the instance pool. func (client ComputeManagementClient) AttachLoadBalancer(ctx context.Context, request AttachLoadBalancerRequest) (response AttachLoadBalancerResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.attachLoadBalancer, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = AttachLoadBalancerResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = AttachLoadBalancerResponse{} } } return } if convertedResponse, ok := ociResponse.(AttachLoadBalancerResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into AttachLoadBalancerResponse") } return } // attachLoadBalancer implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) attachLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/attachLoadBalancer") if err != nil { return nil, err } var response AttachLoadBalancerResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeClusterNetworkCompartment Moves a cluster network into a different compartment within the same tenancy. For // information about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // When you move a cluster network to a different compartment, associated resources such as the instances // in the cluster network, boot volumes, and VNICs are not moved. func (client ComputeManagementClient) ChangeClusterNetworkCompartment(ctx context.Context, request ChangeClusterNetworkCompartmentRequest) (response ChangeClusterNetworkCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeClusterNetworkCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeClusterNetworkCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeClusterNetworkCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeClusterNetworkCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeClusterNetworkCompartmentResponse") } return } // changeClusterNetworkCompartment implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) changeClusterNetworkCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/clusterNetworks/{clusterNetworkId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeClusterNetworkCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeInstanceConfigurationCompartment Moves an instance configuration into a different compartment within the same tenancy. // For information about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // When you move an instance configuration to a different compartment, associated resources such as // instance pools are not moved. // **Important:** Most of the properties for an existing instance configuration, including the compartment, // cannot be modified after you create the instance configuration. Although you can move an instance configuration // to a different compartment, you will not be able to use the instance configuration to manage instance pools // in the new compartment. If you want to update an instance configuration to point to a different compartment, // you should instead create a new instance configuration in the target compartment using // CreateInstanceConfiguration (https://docs.cloud.oracle.com/iaas/api/#/en/iaas/20160918/InstanceConfiguration/CreateInstanceConfiguration). func (client ComputeManagementClient) ChangeInstanceConfigurationCompartment(ctx context.Context, request ChangeInstanceConfigurationCompartmentRequest) (response ChangeInstanceConfigurationCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeInstanceConfigurationCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeInstanceConfigurationCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeInstanceConfigurationCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeInstanceConfigurationCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeInstanceConfigurationCompartmentResponse") } return } // changeInstanceConfigurationCompartment implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) changeInstanceConfigurationCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConfigurations/{instanceConfigurationId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeInstanceConfigurationCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeInstancePoolCompartment Moves an instance pool into a different compartment within the same tenancy. For // information about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // When you move an instance pool to a different compartment, associated resources such as the instances in // the pool, boot volumes, VNICs, and autoscaling configurations are not moved. func (client ComputeManagementClient) ChangeInstancePoolCompartment(ctx context.Context, request ChangeInstancePoolCompartmentRequest) (response ChangeInstancePoolCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeInstancePoolCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeInstancePoolCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeInstancePoolCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeInstancePoolCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeInstancePoolCompartmentResponse") } return } // changeInstancePoolCompartment implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) changeInstancePoolCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeInstancePoolCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateClusterNetwork Creates a cluster network. For more information about cluster networks, see // Managing Cluster Networks (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/managingclusternetworks.htm). func (client ComputeManagementClient) CreateClusterNetwork(ctx context.Context, request CreateClusterNetworkRequest) (response CreateClusterNetworkResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createClusterNetwork, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateClusterNetworkResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateClusterNetworkResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateClusterNetworkResponse") } return } // createClusterNetwork implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) createClusterNetwork(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/clusterNetworks") if err != nil { return nil, err } var response CreateClusterNetworkResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateInstanceConfiguration Creates an instance configuration. An instance configuration is a template that defines the // settings to use when creating Compute instances. func (client ComputeManagementClient) CreateInstanceConfiguration(ctx context.Context, request CreateInstanceConfigurationRequest) (response CreateInstanceConfigurationResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createInstanceConfiguration, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateInstanceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateInstanceConfigurationResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateInstanceConfigurationResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateInstanceConfigurationResponse") } return } // createInstanceConfiguration implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) createInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConfigurations") if err != nil { return nil, err } var response CreateInstanceConfigurationResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateInstancePool Create an instance pool. func (client ComputeManagementClient) CreateInstancePool(ctx context.Context, request CreateInstancePoolRequest) (response CreateInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateInstancePoolResponse") } return } // createInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) createInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools") if err != nil { return nil, err } var response CreateInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteInstanceConfiguration Deletes an instance configuration. func (client ComputeManagementClient) DeleteInstanceConfiguration(ctx context.Context, request DeleteInstanceConfigurationRequest) (response DeleteInstanceConfigurationResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteInstanceConfiguration, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteInstanceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteInstanceConfigurationResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteInstanceConfigurationResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteInstanceConfigurationResponse") } return } // deleteInstanceConfiguration implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) deleteInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instanceConfigurations/{instanceConfigurationId}") if err != nil { return nil, err } var response DeleteInstanceConfigurationResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DetachLoadBalancer Detach a load balancer from the instance pool. func (client ComputeManagementClient) DetachLoadBalancer(ctx context.Context, request DetachLoadBalancerRequest) (response DetachLoadBalancerResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.detachLoadBalancer, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DetachLoadBalancerResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DetachLoadBalancerResponse{} } } return } if convertedResponse, ok := ociResponse.(DetachLoadBalancerResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DetachLoadBalancerResponse") } return } // detachLoadBalancer implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) detachLoadBalancer(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/detachLoadBalancer") if err != nil { return nil, err } var response DetachLoadBalancerResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetClusterNetwork Gets information about the specified cluster network. func (client ComputeManagementClient) GetClusterNetwork(ctx context.Context, request GetClusterNetworkRequest) (response GetClusterNetworkResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getClusterNetwork, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetClusterNetworkResponse{} } } return } if convertedResponse, ok := ociResponse.(GetClusterNetworkResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetClusterNetworkResponse") } return } // getClusterNetwork implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) getClusterNetwork(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusterNetworks/{clusterNetworkId}") if err != nil { return nil, err } var response GetClusterNetworkResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetInstanceConfiguration Gets the specified instance configuration func (client ComputeManagementClient) GetInstanceConfiguration(ctx context.Context, request GetInstanceConfigurationRequest) (response GetInstanceConfigurationResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getInstanceConfiguration, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetInstanceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetInstanceConfigurationResponse{} } } return } if convertedResponse, ok := ociResponse.(GetInstanceConfigurationResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetInstanceConfigurationResponse") } return } // getInstanceConfiguration implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) getInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConfigurations/{instanceConfigurationId}") if err != nil { return nil, err } var response GetInstanceConfigurationResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetInstancePool Gets the specified instance pool func (client ComputeManagementClient) GetInstancePool(ctx context.Context, request GetInstancePoolRequest) (response GetInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(GetInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetInstancePoolResponse") } return } // getInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) getInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instancePools/{instancePoolId}") if err != nil { return nil, err } var response GetInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetInstancePoolLoadBalancerAttachment Gets information about a load balancer that is attached to the specified instance pool. func (client ComputeManagementClient) GetInstancePoolLoadBalancerAttachment(ctx context.Context, request GetInstancePoolLoadBalancerAttachmentRequest) (response GetInstancePoolLoadBalancerAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getInstancePoolLoadBalancerAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetInstancePoolLoadBalancerAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetInstancePoolLoadBalancerAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetInstancePoolLoadBalancerAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetInstancePoolLoadBalancerAttachmentResponse") } return } // getInstancePoolLoadBalancerAttachment implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) getInstancePoolLoadBalancerAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instancePools/{instancePoolId}/loadBalancerAttachments/{instancePoolLoadBalancerAttachmentId}") if err != nil { return nil, err } var response GetInstancePoolLoadBalancerAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // LaunchInstanceConfiguration Launches an instance from an instance configuration. // If the instance configuration does not include all of the parameters that are // required to launch an instance, such as the availability domain and subnet ID, you must // provide these parameters when you launch an instance from the instance configuration. // For more information, see the InstanceConfiguration // resource. func (client ComputeManagementClient) LaunchInstanceConfiguration(ctx context.Context, request LaunchInstanceConfigurationRequest) (response LaunchInstanceConfigurationResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.launchInstanceConfiguration, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = LaunchInstanceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = LaunchInstanceConfigurationResponse{} } } return } if convertedResponse, ok := ociResponse.(LaunchInstanceConfigurationResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into LaunchInstanceConfigurationResponse") } return } // launchInstanceConfiguration implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) launchInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instanceConfigurations/{instanceConfigurationId}/actions/launch") if err != nil { return nil, err } var response LaunchInstanceConfigurationResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListClusterNetworkInstances Lists the instances in the specified cluster network. func (client ComputeManagementClient) ListClusterNetworkInstances(ctx context.Context, request ListClusterNetworkInstancesRequest) (response ListClusterNetworkInstancesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listClusterNetworkInstances, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListClusterNetworkInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListClusterNetworkInstancesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListClusterNetworkInstancesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListClusterNetworkInstancesResponse") } return } // listClusterNetworkInstances implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) listClusterNetworkInstances(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusterNetworks/{clusterNetworkId}/instances") if err != nil { return nil, err } var response ListClusterNetworkInstancesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListClusterNetworks Lists the cluster networks in the specified compartment. func (client ComputeManagementClient) ListClusterNetworks(ctx context.Context, request ListClusterNetworksRequest) (response ListClusterNetworksResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listClusterNetworks, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListClusterNetworksResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListClusterNetworksResponse{} } } return } if convertedResponse, ok := ociResponse.(ListClusterNetworksResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListClusterNetworksResponse") } return } // listClusterNetworks implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) listClusterNetworks(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusterNetworks") if err != nil { return nil, err } var response ListClusterNetworksResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListInstanceConfigurations Lists the instance configurations in the specified compartment. func (client ComputeManagementClient) ListInstanceConfigurations(ctx context.Context, request ListInstanceConfigurationsRequest) (response ListInstanceConfigurationsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listInstanceConfigurations, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListInstanceConfigurationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListInstanceConfigurationsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListInstanceConfigurationsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListInstanceConfigurationsResponse") } return } // listInstanceConfigurations implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) listInstanceConfigurations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instanceConfigurations") if err != nil { return nil, err } var response ListInstanceConfigurationsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListInstancePoolInstances List the instances in the specified instance pool. func (client ComputeManagementClient) ListInstancePoolInstances(ctx context.Context, request ListInstancePoolInstancesRequest) (response ListInstancePoolInstancesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listInstancePoolInstances, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListInstancePoolInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListInstancePoolInstancesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListInstancePoolInstancesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListInstancePoolInstancesResponse") } return } // listInstancePoolInstances implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) listInstancePoolInstances(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instancePools/{instancePoolId}/instances") if err != nil { return nil, err } var response ListInstancePoolInstancesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListInstancePools Lists the instance pools in the specified compartment. func (client ComputeManagementClient) ListInstancePools(ctx context.Context, request ListInstancePoolsRequest) (response ListInstancePoolsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listInstancePools, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListInstancePoolsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListInstancePoolsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListInstancePoolsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListInstancePoolsResponse") } return } // listInstancePools implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) listInstancePools(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/instancePools") if err != nil { return nil, err } var response ListInstancePoolsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ResetInstancePool Performs the reset (power off and power on) action on the specified instance pool, // which performs the action on all the instances in the pool. func (client ComputeManagementClient) ResetInstancePool(ctx context.Context, request ResetInstancePoolRequest) (response ResetInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.resetInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ResetInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ResetInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(ResetInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ResetInstancePoolResponse") } return } // resetInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) resetInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/reset") if err != nil { return nil, err } var response ResetInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // SoftresetInstancePool Performs the softreset (ACPI shutdown and power on) action on the specified instance pool, // which performs the action on all the instances in the pool. func (client ComputeManagementClient) SoftresetInstancePool(ctx context.Context, request SoftresetInstancePoolRequest) (response SoftresetInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.softresetInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = SoftresetInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = SoftresetInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(SoftresetInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into SoftresetInstancePoolResponse") } return } // softresetInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) softresetInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/softreset") if err != nil { return nil, err } var response SoftresetInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // StartInstancePool Performs the start (power on) action on the specified instance pool, // which performs the action on all the instances in the pool. func (client ComputeManagementClient) StartInstancePool(ctx context.Context, request StartInstancePoolRequest) (response StartInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.startInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = StartInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = StartInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(StartInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into StartInstancePoolResponse") } return } // startInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) startInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/start") if err != nil { return nil, err } var response StartInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // StopInstancePool Performs the stop (power off) action on the specified instance pool, // which performs the action on all the instances in the pool. func (client ComputeManagementClient) StopInstancePool(ctx context.Context, request StopInstancePoolRequest) (response StopInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.stopInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = StopInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = StopInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(StopInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into StopInstancePoolResponse") } return } // stopInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) stopInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/instancePools/{instancePoolId}/actions/stop") if err != nil { return nil, err } var response StopInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // TerminateClusterNetwork Terminates the specified cluster network. // When you delete a cluster network, all of its resources are permanently deleted, // including associated instances and instance pools. func (client ComputeManagementClient) TerminateClusterNetwork(ctx context.Context, request TerminateClusterNetworkRequest) (response TerminateClusterNetworkResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.terminateClusterNetwork, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = TerminateClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = TerminateClusterNetworkResponse{} } } return } if convertedResponse, ok := ociResponse.(TerminateClusterNetworkResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into TerminateClusterNetworkResponse") } return } // terminateClusterNetwork implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) terminateClusterNetwork(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/clusterNetworks/{clusterNetworkId}") if err != nil { return nil, err } var response TerminateClusterNetworkResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // TerminateInstancePool Terminate the specified instance pool. func (client ComputeManagementClient) TerminateInstancePool(ctx context.Context, request TerminateInstancePoolRequest) (response TerminateInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.terminateInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = TerminateInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = TerminateInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(TerminateInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into TerminateInstancePoolResponse") } return } // terminateInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) terminateInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/instancePools/{instancePoolId}") if err != nil { return nil, err } var response TerminateInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateClusterNetwork Updates the specified cluster network. The OCID of the cluster network remains the same. func (client ComputeManagementClient) UpdateClusterNetwork(ctx context.Context, request UpdateClusterNetworkRequest) (response UpdateClusterNetworkResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateClusterNetwork, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateClusterNetworkResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateClusterNetworkResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateClusterNetworkResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateClusterNetworkResponse") } return } // updateClusterNetwork implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) updateClusterNetwork(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/clusterNetworks/{clusterNetworkId}") if err != nil { return nil, err } var response UpdateClusterNetworkResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateInstanceConfiguration Updates the free-form tags, defined tags, and display name of an instance configuration. func (client ComputeManagementClient) UpdateInstanceConfiguration(ctx context.Context, request UpdateInstanceConfigurationRequest) (response UpdateInstanceConfigurationResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateInstanceConfiguration, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateInstanceConfigurationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateInstanceConfigurationResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateInstanceConfigurationResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateInstanceConfigurationResponse") } return } // updateInstanceConfiguration implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) updateInstanceConfiguration(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/instanceConfigurations/{instanceConfigurationId}") if err != nil { return nil, err } var response UpdateInstanceConfigurationResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateInstancePool Update the specified instance pool. // The OCID of the instance pool remains the same. func (client ComputeManagementClient) UpdateInstancePool(ctx context.Context, request UpdateInstancePoolRequest) (response UpdateInstancePoolResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateInstancePool, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateInstancePoolResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateInstancePoolResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateInstancePoolResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateInstancePoolResponse") } return } // updateInstancePool implements the OCIOperation interface (enables retrying operations) func (client ComputeManagementClient) updateInstancePool(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/instancePools/{instancePoolId}") if err != nil { return nil, err } var response UpdateInstancePoolResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } ������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/core_virtualnetwork_client.go�������������0000664�0000000�0000000�00001247311�13771713062�0031156�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "context" "fmt" "github.com/oracle/oci-go-sdk/common" "net/http" ) //VirtualNetworkClient a client for VirtualNetwork type VirtualNetworkClient struct { common.BaseClient config *common.ConfigurationProvider } // NewVirtualNetworkClientWithConfigurationProvider Creates a new default VirtualNetwork client with the given configuration provider. // the configuration provider will be used for the default signer as well as reading the region func NewVirtualNetworkClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client VirtualNetworkClient, err error) { baseClient, err := common.NewClientWithConfig(configProvider) if err != nil { return } return newVirtualNetworkClientFromBaseClient(baseClient, configProvider) } // NewVirtualNetworkClientWithOboToken Creates a new default VirtualNetwork client with the given configuration provider. // The obotoken will be added to default headers and signed; the configuration provider will be used for the signer // as well as reading the region func NewVirtualNetworkClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client VirtualNetworkClient, err error) { baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) if err != nil { return } return newVirtualNetworkClientFromBaseClient(baseClient, configProvider) } func newVirtualNetworkClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client VirtualNetworkClient, err error) { client = VirtualNetworkClient{BaseClient: baseClient} client.BasePath = "20160918" err = client.setConfigurationProvider(configProvider) return } // SetRegion overrides the region of this client. func (client *VirtualNetworkClient) SetRegion(region string) { client.Host = common.StringToRegion(region).EndpointForTemplate("iaas", "https://iaas.{region}.{secondLevelDomain}") } // SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid func (client *VirtualNetworkClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { return err } // Error has been checked already region, _ := configProvider.Region() client.SetRegion(region) client.config = &configProvider return nil } // ConfigurationProvider the ConfigurationProvider used in this client, or null if none set func (client *VirtualNetworkClient) ConfigurationProvider() *common.ConfigurationProvider { return client.config } // AddNetworkSecurityGroupSecurityRules Adds one or more security rules to the specified network security group. func (client VirtualNetworkClient) AddNetworkSecurityGroupSecurityRules(ctx context.Context, request AddNetworkSecurityGroupSecurityRulesRequest) (response AddNetworkSecurityGroupSecurityRulesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.addNetworkSecurityGroupSecurityRules, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = AddNetworkSecurityGroupSecurityRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = AddNetworkSecurityGroupSecurityRulesResponse{} } } return } if convertedResponse, ok := ociResponse.(AddNetworkSecurityGroupSecurityRulesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into AddNetworkSecurityGroupSecurityRulesResponse") } return } // addNetworkSecurityGroupSecurityRules implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) addNetworkSecurityGroupSecurityRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkSecurityGroups/{networkSecurityGroupId}/actions/addSecurityRules") if err != nil { return nil, err } var response AddNetworkSecurityGroupSecurityRulesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // AttachServiceId Adds the specified Service to the list of enabled // `Service` objects for the specified gateway. You must also set up a route rule with the // `cidrBlock` of the `Service` as the rule's destination and the service gateway as the rule's // target. See RouteTable. // **Note:** The `AttachServiceId` operation is an easy way to add an individual `Service` to // the service gateway. Compare it with // UpdateServiceGateway, which replaces // the entire existing list of enabled `Service` objects with the list that you provide in the // `Update` call. func (client VirtualNetworkClient) AttachServiceId(ctx context.Context, request AttachServiceIdRequest) (response AttachServiceIdResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.attachServiceId, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = AttachServiceIdResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = AttachServiceIdResponse{} } } return } if convertedResponse, ok := ociResponse.(AttachServiceIdResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into AttachServiceIdResponse") } return } // attachServiceId implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) attachServiceId(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/serviceGateways/{serviceGatewayId}/actions/attachService") if err != nil { return nil, err } var response AttachServiceIdResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // BulkAddVirtualCircuitPublicPrefixes Adds one or more customer public IP prefixes to the specified public virtual circuit. // Use this operation (and not UpdateVirtualCircuit) // to add prefixes to the virtual circuit. Oracle must verify the customer's ownership // of each prefix before traffic for that prefix will flow across the virtual circuit. func (client VirtualNetworkClient) BulkAddVirtualCircuitPublicPrefixes(ctx context.Context, request BulkAddVirtualCircuitPublicPrefixesRequest) (response BulkAddVirtualCircuitPublicPrefixesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.bulkAddVirtualCircuitPublicPrefixes, policy) if err != nil { if ociResponse != nil { response = BulkAddVirtualCircuitPublicPrefixesResponse{RawResponse: ociResponse.HTTPResponse()} } return } if convertedResponse, ok := ociResponse.(BulkAddVirtualCircuitPublicPrefixesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into BulkAddVirtualCircuitPublicPrefixesResponse") } return } // bulkAddVirtualCircuitPublicPrefixes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) bulkAddVirtualCircuitPublicPrefixes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/virtualCircuits/{virtualCircuitId}/actions/bulkAddPublicPrefixes") if err != nil { return nil, err } var response BulkAddVirtualCircuitPublicPrefixesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // BulkDeleteVirtualCircuitPublicPrefixes Removes one or more customer public IP prefixes from the specified public virtual circuit. // Use this operation (and not UpdateVirtualCircuit) // to remove prefixes from the virtual circuit. When the virtual circuit's state switches // back to PROVISIONED, Oracle stops advertising the specified prefixes across the connection. func (client VirtualNetworkClient) BulkDeleteVirtualCircuitPublicPrefixes(ctx context.Context, request BulkDeleteVirtualCircuitPublicPrefixesRequest) (response BulkDeleteVirtualCircuitPublicPrefixesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.bulkDeleteVirtualCircuitPublicPrefixes, policy) if err != nil { if ociResponse != nil { response = BulkDeleteVirtualCircuitPublicPrefixesResponse{RawResponse: ociResponse.HTTPResponse()} } return } if convertedResponse, ok := ociResponse.(BulkDeleteVirtualCircuitPublicPrefixesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into BulkDeleteVirtualCircuitPublicPrefixesResponse") } return } // bulkDeleteVirtualCircuitPublicPrefixes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) bulkDeleteVirtualCircuitPublicPrefixes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/virtualCircuits/{virtualCircuitId}/actions/bulkDeletePublicPrefixes") if err != nil { return nil, err } var response BulkDeleteVirtualCircuitPublicPrefixesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeCpeCompartment Moves a CPE object into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeCpeCompartment(ctx context.Context, request ChangeCpeCompartmentRequest) (response ChangeCpeCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeCpeCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeCpeCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeCpeCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeCpeCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeCpeCompartmentResponse") } return } // changeCpeCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeCpeCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/cpes/{cpeId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeCpeCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeCrossConnectCompartment Moves a cross-connect into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeCrossConnectCompartment(ctx context.Context, request ChangeCrossConnectCompartmentRequest) (response ChangeCrossConnectCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeCrossConnectCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeCrossConnectCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeCrossConnectCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeCrossConnectCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeCrossConnectCompartmentResponse") } return } // changeCrossConnectCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeCrossConnectCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/crossConnects/{crossConnectId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeCrossConnectCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeCrossConnectGroupCompartment Moves a cross-connect group into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeCrossConnectGroupCompartment(ctx context.Context, request ChangeCrossConnectGroupCompartmentRequest) (response ChangeCrossConnectGroupCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeCrossConnectGroupCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeCrossConnectGroupCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeCrossConnectGroupCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeCrossConnectGroupCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeCrossConnectGroupCompartmentResponse") } return } // changeCrossConnectGroupCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeCrossConnectGroupCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/crossConnectGroups/{crossConnectGroupId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeCrossConnectGroupCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeDhcpOptionsCompartment Moves a set of DHCP options into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeDhcpOptionsCompartment(ctx context.Context, request ChangeDhcpOptionsCompartmentRequest) (response ChangeDhcpOptionsCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeDhcpOptionsCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeDhcpOptionsCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeDhcpOptionsCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeDhcpOptionsCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeDhcpOptionsCompartmentResponse") } return } // changeDhcpOptionsCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeDhcpOptionsCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/dhcps/{dhcpId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeDhcpOptionsCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeDrgCompartment Moves a DRG into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeDrgCompartment(ctx context.Context, request ChangeDrgCompartmentRequest) (response ChangeDrgCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeDrgCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeDrgCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeDrgCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeDrgCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeDrgCompartmentResponse") } return } // changeDrgCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeDrgCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/drgs/{drgId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeDrgCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeIPSecConnectionCompartment Moves an IPSec connection into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeIPSecConnectionCompartment(ctx context.Context, request ChangeIPSecConnectionCompartmentRequest) (response ChangeIPSecConnectionCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeIPSecConnectionCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeIPSecConnectionCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeIPSecConnectionCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeIPSecConnectionCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeIPSecConnectionCompartmentResponse") } return } // changeIPSecConnectionCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeIPSecConnectionCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/ipsecConnections/{ipscId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeIPSecConnectionCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeInternetGatewayCompartment Moves an internet gateway into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeInternetGatewayCompartment(ctx context.Context, request ChangeInternetGatewayCompartmentRequest) (response ChangeInternetGatewayCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeInternetGatewayCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeInternetGatewayCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeInternetGatewayCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeInternetGatewayCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeInternetGatewayCompartmentResponse") } return } // changeInternetGatewayCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeInternetGatewayCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/internetGateways/{igId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeInternetGatewayCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeLocalPeeringGatewayCompartment Moves a local peering gateway into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeLocalPeeringGatewayCompartment(ctx context.Context, request ChangeLocalPeeringGatewayCompartmentRequest) (response ChangeLocalPeeringGatewayCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeLocalPeeringGatewayCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeLocalPeeringGatewayCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeLocalPeeringGatewayCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeLocalPeeringGatewayCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeLocalPeeringGatewayCompartmentResponse") } return } // changeLocalPeeringGatewayCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeLocalPeeringGatewayCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/localPeeringGateways/{localPeeringGatewayId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeLocalPeeringGatewayCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeNatGatewayCompartment Moves a NAT gateway into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeNatGatewayCompartment(ctx context.Context, request ChangeNatGatewayCompartmentRequest) (response ChangeNatGatewayCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeNatGatewayCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeNatGatewayCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeNatGatewayCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeNatGatewayCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeNatGatewayCompartmentResponse") } return } // changeNatGatewayCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeNatGatewayCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/natGateways/{natGatewayId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeNatGatewayCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeNetworkSecurityGroupCompartment Moves a network security group into a different compartment within the same tenancy. For // information about moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeNetworkSecurityGroupCompartment(ctx context.Context, request ChangeNetworkSecurityGroupCompartmentRequest) (response ChangeNetworkSecurityGroupCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeNetworkSecurityGroupCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeNetworkSecurityGroupCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeNetworkSecurityGroupCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeNetworkSecurityGroupCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeNetworkSecurityGroupCompartmentResponse") } return } // changeNetworkSecurityGroupCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeNetworkSecurityGroupCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkSecurityGroups/{networkSecurityGroupId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeNetworkSecurityGroupCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangePublicIpCompartment Moves a public IP into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // This operation applies only to reserved public IPs. Ephemeral public IPs always belong to the // same compartment as their VNIC and move accordingly. func (client VirtualNetworkClient) ChangePublicIpCompartment(ctx context.Context, request ChangePublicIpCompartmentRequest) (response ChangePublicIpCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changePublicIpCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangePublicIpCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangePublicIpCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangePublicIpCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangePublicIpCompartmentResponse") } return } // changePublicIpCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changePublicIpCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/publicIps/{publicIpId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangePublicIpCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeRemotePeeringConnectionCompartment Moves a remote peering connection (RPC) into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeRemotePeeringConnectionCompartment(ctx context.Context, request ChangeRemotePeeringConnectionCompartmentRequest) (response ChangeRemotePeeringConnectionCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeRemotePeeringConnectionCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeRemotePeeringConnectionCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeRemotePeeringConnectionCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeRemotePeeringConnectionCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeRemotePeeringConnectionCompartmentResponse") } return } // changeRemotePeeringConnectionCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeRemotePeeringConnectionCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/remotePeeringConnections/{remotePeeringConnectionId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeRemotePeeringConnectionCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeRouteTableCompartment Moves a route table into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeRouteTableCompartment(ctx context.Context, request ChangeRouteTableCompartmentRequest) (response ChangeRouteTableCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeRouteTableCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeRouteTableCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeRouteTableCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeRouteTableCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeRouteTableCompartmentResponse") } return } // changeRouteTableCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeRouteTableCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/routeTables/{rtId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeRouteTableCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeSecurityListCompartment Moves a security list into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeSecurityListCompartment(ctx context.Context, request ChangeSecurityListCompartmentRequest) (response ChangeSecurityListCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeSecurityListCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeSecurityListCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeSecurityListCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeSecurityListCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeSecurityListCompartmentResponse") } return } // changeSecurityListCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeSecurityListCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/securityLists/{securityListId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeSecurityListCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeServiceGatewayCompartment Moves a service gateway into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeServiceGatewayCompartment(ctx context.Context, request ChangeServiceGatewayCompartmentRequest) (response ChangeServiceGatewayCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeServiceGatewayCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeServiceGatewayCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeServiceGatewayCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeServiceGatewayCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeServiceGatewayCompartmentResponse") } return } // changeServiceGatewayCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeServiceGatewayCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/serviceGateways/{serviceGatewayId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeServiceGatewayCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeSubnetCompartment Moves a subnet into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeSubnetCompartment(ctx context.Context, request ChangeSubnetCompartmentRequest) (response ChangeSubnetCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeSubnetCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeSubnetCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeSubnetCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeSubnetCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeSubnetCompartmentResponse") } return } // changeSubnetCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeSubnetCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/subnets/{subnetId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeSubnetCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeVcnCompartment Moves a VCN into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeVcnCompartment(ctx context.Context, request ChangeVcnCompartmentRequest) (response ChangeVcnCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeVcnCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeVcnCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeVcnCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeVcnCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeVcnCompartmentResponse") } return } // changeVcnCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeVcnCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/vcns/{vcnId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeVcnCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ChangeVirtualCircuitCompartment Moves a virtual circuit into a different compartment within the same tenancy. For information // about moving resources between compartments, see // Moving Resources to a Different Compartment (https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). func (client VirtualNetworkClient) ChangeVirtualCircuitCompartment(ctx context.Context, request ChangeVirtualCircuitCompartmentRequest) (response ChangeVirtualCircuitCompartmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.changeVirtualCircuitCompartment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ChangeVirtualCircuitCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ChangeVirtualCircuitCompartmentResponse{} } } return } if convertedResponse, ok := ociResponse.(ChangeVirtualCircuitCompartmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ChangeVirtualCircuitCompartmentResponse") } return } // changeVirtualCircuitCompartment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) changeVirtualCircuitCompartment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/virtualCircuits/{virtualCircuitId}/actions/changeCompartment") if err != nil { return nil, err } var response ChangeVirtualCircuitCompartmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ConnectLocalPeeringGateways Connects this local peering gateway (LPG) to another one in the same region. // This operation must be called by the VCN administrator who is designated as // the *requestor* in the peering relationship. The *acceptor* must implement // an Identity and Access Management (IAM) policy that gives the requestor permission // to connect to LPGs in the acceptor's compartment. Without that permission, this // operation will fail. For more information, see // VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). func (client VirtualNetworkClient) ConnectLocalPeeringGateways(ctx context.Context, request ConnectLocalPeeringGatewaysRequest) (response ConnectLocalPeeringGatewaysResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.connectLocalPeeringGateways, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ConnectLocalPeeringGatewaysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ConnectLocalPeeringGatewaysResponse{} } } return } if convertedResponse, ok := ociResponse.(ConnectLocalPeeringGatewaysResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ConnectLocalPeeringGatewaysResponse") } return } // connectLocalPeeringGateways implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) connectLocalPeeringGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/localPeeringGateways/{localPeeringGatewayId}/actions/connect") if err != nil { return nil, err } var response ConnectLocalPeeringGatewaysResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ConnectRemotePeeringConnections Connects this RPC to another one in a different region. // This operation must be called by the VCN administrator who is designated as // the *requestor* in the peering relationship. The *acceptor* must implement // an Identity and Access Management (IAM) policy that gives the requestor permission // to connect to RPCs in the acceptor's compartment. Without that permission, this // operation will fail. For more information, see // VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). func (client VirtualNetworkClient) ConnectRemotePeeringConnections(ctx context.Context, request ConnectRemotePeeringConnectionsRequest) (response ConnectRemotePeeringConnectionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.connectRemotePeeringConnections, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ConnectRemotePeeringConnectionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ConnectRemotePeeringConnectionsResponse{} } } return } if convertedResponse, ok := ociResponse.(ConnectRemotePeeringConnectionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ConnectRemotePeeringConnectionsResponse") } return } // connectRemotePeeringConnections implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) connectRemotePeeringConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/remotePeeringConnections/{remotePeeringConnectionId}/actions/connect") if err != nil { return nil, err } var response ConnectRemotePeeringConnectionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateCpe Creates a new virtual customer-premises equipment (CPE) object in the specified compartment. For // more information, see IPSec VPNs (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPsec.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want // the CPE to reside. Notice that the CPE doesn't have to be in the same compartment as the IPSec // connection or other Networking Service components. If you're not sure which compartment to // use, put the CPE in the same compartment as the DRG. For more information about // compartments and access control, see Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You must provide the public IP address of your on-premises router. See // Configuring Your On-Premises Router for an IPSec VPN (https://docs.cloud.oracle.com/Content/Network/Tasks/configuringCPE.htm). // You may optionally specify a *display name* for the CPE, otherwise a default is provided. It does not have to // be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateCpe(ctx context.Context, request CreateCpeRequest) (response CreateCpeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createCpe, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateCpeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateCpeResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateCpeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateCpeResponse") } return } // createCpe implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/cpes") if err != nil { return nil, err } var response CreateCpeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateCrossConnect Creates a new cross-connect. Oracle recommends you create each cross-connect in a // CrossConnectGroup so you can use link aggregation // with the connection. // After creating the `CrossConnect` object, you need to go the FastConnect location // and request to have the physical cable installed. For more information, see // FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // For the purposes of access control, you must provide the OCID of the // compartment where you want the cross-connect to reside. If you're // not sure which compartment to use, put the cross-connect in the // same compartment with your VCN. For more information about // compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the cross-connect. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateCrossConnect(ctx context.Context, request CreateCrossConnectRequest) (response CreateCrossConnectResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createCrossConnect, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateCrossConnectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateCrossConnectResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateCrossConnectResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateCrossConnectResponse") } return } // createCrossConnect implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/crossConnects") if err != nil { return nil, err } var response CreateCrossConnectResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateCrossConnectGroup Creates a new cross-connect group to use with Oracle Cloud Infrastructure // FastConnect. For more information, see // FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // For the purposes of access control, you must provide the OCID of the // compartment where you want the cross-connect group to reside. If you're // not sure which compartment to use, put the cross-connect group in the // same compartment with your VCN. For more information about // compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the cross-connect group. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateCrossConnectGroup(ctx context.Context, request CreateCrossConnectGroupRequest) (response CreateCrossConnectGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createCrossConnectGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateCrossConnectGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateCrossConnectGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateCrossConnectGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateCrossConnectGroupResponse") } return } // createCrossConnectGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/crossConnectGroups") if err != nil { return nil, err } var response CreateCrossConnectGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateDhcpOptions Creates a new set of DHCP options for the specified VCN. For more information, see // DhcpOptions. // For the purposes of access control, you must provide the OCID of the compartment where you want the set of // DHCP options to reside. Notice that the set of options doesn't have to be in the same compartment as the VCN, // subnets, or other Networking Service components. If you're not sure which compartment to use, put the set // of DHCP options in the same compartment as the VCN. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the set of DHCP options, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateDhcpOptions(ctx context.Context, request CreateDhcpOptionsRequest) (response CreateDhcpOptionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createDhcpOptions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateDhcpOptionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateDhcpOptionsResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateDhcpOptionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateDhcpOptionsResponse") } return } // createDhcpOptions implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/dhcps") if err != nil { return nil, err } var response CreateDhcpOptionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateDrg Creates a new dynamic routing gateway (DRG) in the specified compartment. For more information, // see Dynamic Routing Gateways (DRGs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDRGs.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want // the DRG to reside. Notice that the DRG doesn't have to be in the same compartment as the VCN, // the DRG attachment, or other Networking Service components. If you're not sure which compartment // to use, put the DRG in the same compartment as the VCN. For more information about compartments // and access control, see Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the DRG, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateDrg(ctx context.Context, request CreateDrgRequest) (response CreateDrgResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createDrg, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateDrgResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateDrgResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateDrgResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateDrgResponse") } return } // createDrg implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/drgs") if err != nil { return nil, err } var response CreateDrgResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateDrgAttachment Attaches the specified DRG to the specified VCN. A VCN can be attached to only one DRG at a time, // and vice versa. The response includes a `DrgAttachment` object with its own OCID. For more // information about DRGs, see // Dynamic Routing Gateways (DRGs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDRGs.htm). // You may optionally specify a *display name* for the attachment, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. // For the purposes of access control, the DRG attachment is automatically placed into the same compartment // as the VCN. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). func (client VirtualNetworkClient) CreateDrgAttachment(ctx context.Context, request CreateDrgAttachmentRequest) (response CreateDrgAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createDrgAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateDrgAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateDrgAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateDrgAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateDrgAttachmentResponse") } return } // createDrgAttachment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/drgAttachments") if err != nil { return nil, err } var response CreateDrgAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateIPSecConnection Creates a new IPSec connection between the specified DRG and CPE. For more information, see // IPSec VPNs (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPsec.htm). // If you configure at least one tunnel to use static routing, then in the request you must provide // at least one valid static route (you're allowed a maximum of 10). For example: 10.0.0.0/16. // If you configure both tunnels to use BGP dynamic routing, you can provide an empty list for // the static routes. For more information, see the important note in // IPSecConnection. // For the purposes of access control, you must provide the OCID of the compartment where you want the // IPSec connection to reside. Notice that the IPSec connection doesn't have to be in the same compartment // as the DRG, CPE, or other Networking Service components. If you're not sure which compartment to // use, put the IPSec connection in the same compartment as the DRG. For more information about // compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the IPSec connection, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. // After creating the IPSec connection, you need to configure your on-premises router // with tunnel-specific information. For tunnel status and the required configuration information, see: // * IPSecConnectionTunnel // * IPSecConnectionTunnelSharedSecret // For each tunnel, you need the IP address of Oracle's VPN headend and the shared secret // (that is, the pre-shared key). For more information, see // Configuring Your On-Premises Router for an IPSec VPN (https://docs.cloud.oracle.com/Content/Network/Tasks/configuringCPE.htm). func (client VirtualNetworkClient) CreateIPSecConnection(ctx context.Context, request CreateIPSecConnectionRequest) (response CreateIPSecConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createIPSecConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateIPSecConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateIPSecConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateIPSecConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateIPSecConnectionResponse") } return } // createIPSecConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/ipsecConnections") if err != nil { return nil, err } var response CreateIPSecConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateInternetGateway Creates a new internet gateway for the specified VCN. For more information, see // Access to the Internet (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIGs.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want the Internet // Gateway to reside. Notice that the internet gateway doesn't have to be in the same compartment as the VCN or // other Networking Service components. If you're not sure which compartment to use, put the Internet // Gateway in the same compartment with the VCN. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the internet gateway, otherwise a default is provided. It // does not have to be unique, and you can change it. Avoid entering confidential information. // For traffic to flow between a subnet and an internet gateway, you must create a route rule accordingly in // the subnet's route table (for example, 0.0.0.0/0 > internet gateway). See // UpdateRouteTable. // You must specify whether the internet gateway is enabled when you create it. If it's disabled, that means no // traffic will flow to/from the internet even if there's a route rule that enables that traffic. You can later // use UpdateInternetGateway to easily disable/enable // the gateway without changing the route rule. func (client VirtualNetworkClient) CreateInternetGateway(ctx context.Context, request CreateInternetGatewayRequest) (response CreateInternetGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createInternetGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateInternetGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateInternetGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateInternetGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateInternetGatewayResponse") } return } // createInternetGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/internetGateways") if err != nil { return nil, err } var response CreateInternetGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateIpv6 Creates an IPv6 for the specified VNIC. func (client VirtualNetworkClient) CreateIpv6(ctx context.Context, request CreateIpv6Request) (response CreateIpv6Response, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createIpv6, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateIpv6Response{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateIpv6Response{} } } return } if convertedResponse, ok := ociResponse.(CreateIpv6Response); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateIpv6Response") } return } // createIpv6 implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createIpv6(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/ipv6") if err != nil { return nil, err } var response CreateIpv6Response var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateLocalPeeringGateway Creates a new local peering gateway (LPG) for the specified VCN. func (client VirtualNetworkClient) CreateLocalPeeringGateway(ctx context.Context, request CreateLocalPeeringGatewayRequest) (response CreateLocalPeeringGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createLocalPeeringGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateLocalPeeringGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateLocalPeeringGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateLocalPeeringGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateLocalPeeringGatewayResponse") } return } // createLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/localPeeringGateways") if err != nil { return nil, err } var response CreateLocalPeeringGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateNatGateway Creates a new NAT gateway for the specified VCN. You must also set up a route rule with the // NAT gateway as the rule's target. See RouteTable. func (client VirtualNetworkClient) CreateNatGateway(ctx context.Context, request CreateNatGatewayRequest) (response CreateNatGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createNatGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateNatGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateNatGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateNatGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateNatGatewayResponse") } return } // createNatGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/natGateways") if err != nil { return nil, err } var response CreateNatGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateNetworkSecurityGroup Creates a new network security group for the specified VCN. func (client VirtualNetworkClient) CreateNetworkSecurityGroup(ctx context.Context, request CreateNetworkSecurityGroupRequest) (response CreateNetworkSecurityGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createNetworkSecurityGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateNetworkSecurityGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateNetworkSecurityGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateNetworkSecurityGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateNetworkSecurityGroupResponse") } return } // createNetworkSecurityGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createNetworkSecurityGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkSecurityGroups") if err != nil { return nil, err } var response CreateNetworkSecurityGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreatePrivateIp Creates a secondary private IP for the specified VNIC. // For more information about secondary private IPs, see // IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). func (client VirtualNetworkClient) CreatePrivateIp(ctx context.Context, request CreatePrivateIpRequest) (response CreatePrivateIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createPrivateIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreatePrivateIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreatePrivateIpResponse{} } } return } if convertedResponse, ok := ociResponse.(CreatePrivateIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreatePrivateIpResponse") } return } // createPrivateIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createPrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/privateIps") if err != nil { return nil, err } var response CreatePrivateIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreatePublicIp Creates a public IP. Use the `lifetime` property to specify whether it's an ephemeral or // reserved public IP. For information about limits on how many you can create, see // Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). // * **For an ephemeral public IP assigned to a private IP:** You must also specify a `privateIpId` // with the OCID of the primary private IP you want to assign the public IP to. The public IP is // created in the same availability domain as the private IP. An ephemeral public IP must always be // assigned to a private IP, and only to the *primary* private IP on a VNIC, not a secondary // private IP. Exception: If you create a NatGateway, Oracle // automatically assigns the NAT gateway a regional ephemeral public IP that you cannot remove. // * **For a reserved public IP:** You may also optionally assign the public IP to a private // IP by specifying `privateIpId`. Or you can later assign the public IP with // UpdatePublicIp. // **Note:** When assigning a public IP to a private IP, the private IP must not already have // a public IP with `lifecycleState` = ASSIGNING or ASSIGNED. If it does, an error is returned. // Also, for reserved public IPs, the optional assignment part of this operation is // asynchronous. Poll the public IP's `lifecycleState` to determine if the assignment // succeeded. func (client VirtualNetworkClient) CreatePublicIp(ctx context.Context, request CreatePublicIpRequest) (response CreatePublicIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createPublicIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreatePublicIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreatePublicIpResponse{} } } return } if convertedResponse, ok := ociResponse.(CreatePublicIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreatePublicIpResponse") } return } // createPublicIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createPublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/publicIps") if err != nil { return nil, err } var response CreatePublicIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateRemotePeeringConnection Creates a new remote peering connection (RPC) for the specified DRG. func (client VirtualNetworkClient) CreateRemotePeeringConnection(ctx context.Context, request CreateRemotePeeringConnectionRequest) (response CreateRemotePeeringConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createRemotePeeringConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateRemotePeeringConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateRemotePeeringConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateRemotePeeringConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateRemotePeeringConnectionResponse") } return } // createRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/remotePeeringConnections") if err != nil { return nil, err } var response CreateRemotePeeringConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateRouteTable Creates a new route table for the specified VCN. In the request you must also include at least one route // rule for the new route table. For information on the number of rules you can have in a route table, see // Service Limits (https://docs.cloud.oracle.com/Content/General/Concepts/servicelimits.htm). For general information about route // tables in your VCN and the types of targets you can use in route rules, // see Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want the route // table to reside. Notice that the route table doesn't have to be in the same compartment as the VCN, subnets, // or other Networking Service components. If you're not sure which compartment to use, put the route // table in the same compartment as the VCN. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the route table, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateRouteTable(ctx context.Context, request CreateRouteTableRequest) (response CreateRouteTableResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createRouteTable, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateRouteTableResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateRouteTableResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateRouteTableResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateRouteTableResponse") } return } // createRouteTable implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/routeTables") if err != nil { return nil, err } var response CreateRouteTableResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateSecurityList Creates a new security list for the specified VCN. For more information // about security lists, see Security Lists (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). // For information on the number of rules you can have in a security list, see // Service Limits (https://docs.cloud.oracle.com/Content/General/Concepts/servicelimits.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want the security // list to reside. Notice that the security list doesn't have to be in the same compartment as the VCN, subnets, // or other Networking Service components. If you're not sure which compartment to use, put the security // list in the same compartment as the VCN. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the security list, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateSecurityList(ctx context.Context, request CreateSecurityListRequest) (response CreateSecurityListResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createSecurityList, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateSecurityListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateSecurityListResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateSecurityListResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateSecurityListResponse") } return } // createSecurityList implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/securityLists") if err != nil { return nil, err } var response CreateSecurityListResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateServiceGateway Creates a new service gateway in the specified compartment. // For the purposes of access control, you must provide the OCID of the compartment where you want // the service gateway to reside. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the service gateway, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. func (client VirtualNetworkClient) CreateServiceGateway(ctx context.Context, request CreateServiceGatewayRequest) (response CreateServiceGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createServiceGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateServiceGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateServiceGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateServiceGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateServiceGatewayResponse") } return } // createServiceGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/serviceGateways") if err != nil { return nil, err } var response CreateServiceGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateSubnet Creates a new subnet in the specified VCN. You can't change the size of the subnet after creation, // so it's important to think about the size of subnets you need before creating them. // For more information, see VCNs and Subnets (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVCNs.htm). // For information on the number of subnets you can have in a VCN, see // Service Limits (https://docs.cloud.oracle.com/Content/General/Concepts/servicelimits.htm). // For the purposes of access control, you must provide the OCID of the compartment where you want the subnet // to reside. Notice that the subnet doesn't have to be in the same compartment as the VCN, route tables, or // other Networking Service components. If you're not sure which compartment to use, put the subnet in // the same compartment as the VCN. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, // see Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally associate a route table with the subnet. If you don't, the subnet will use the // VCN's default route table. For more information about route tables, see // Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). // You may optionally associate a security list with the subnet. If you don't, the subnet will use the // VCN's default security list. For more information about security lists, see // Security Lists (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). // You may optionally associate a set of DHCP options with the subnet. If you don't, the subnet will use the // VCN's default set. For more information about DHCP options, see // DHCP Options (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDHCP.htm). // You may optionally specify a *display name* for the subnet, otherwise a default is provided. // It does not have to be unique, and you can change it. Avoid entering confidential information. // You can also add a DNS label for the subnet, which is required if you want the Internet and // VCN Resolver to resolve hostnames for instances in the subnet. For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). func (client VirtualNetworkClient) CreateSubnet(ctx context.Context, request CreateSubnetRequest) (response CreateSubnetResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createSubnet, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateSubnetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateSubnetResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateSubnetResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateSubnetResponse") } return } // createSubnet implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/subnets") if err != nil { return nil, err } var response CreateSubnetResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVcn Creates a new virtual cloud network (VCN). For more information, see // VCNs and Subnets (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVCNs.htm). // For the VCN you must specify a single, contiguous IPv4 CIDR block. Oracle recommends using one of the // private IP address ranges specified in RFC 1918 (https://tools.ietf.org/html/rfc1918) (10.0.0.0/8, // 172.16/12, and 192.168/16). Example: 172.16.0.0/16. The CIDR block can range from /16 to /30, and it // must not overlap with your on-premises network. You can't change the size of the VCN after creation. // For the purposes of access control, you must provide the OCID of the compartment where you want the VCN to // reside. Consult an Oracle Cloud Infrastructure administrator in your organization if you're not sure which // compartment to use. Notice that the VCN doesn't have to be in the same compartment as the subnets or other // Networking Service components. For more information about compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the VCN, otherwise a default is provided. It does not have to // be unique, and you can change it. Avoid entering confidential information. // You can also add a DNS label for the VCN, which is required if you want the instances to use the // Interent and VCN Resolver option for DNS in the VCN. For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // The VCN automatically comes with a default route table, default security list, and default set of DHCP options. // The OCID for each is returned in the response. You can't delete these default objects, but you can change their // contents (that is, change the route rules, security list rules, and so on). // The VCN and subnets you create are not accessible until you attach an internet gateway or set up an IPSec VPN // or FastConnect. For more information, see // Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). func (client VirtualNetworkClient) CreateVcn(ctx context.Context, request CreateVcnRequest) (response CreateVcnResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createVcn, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVcnResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVcnResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVcnResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVcnResponse") } return } // createVcn implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/vcns") if err != nil { return nil, err } var response CreateVcnResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // CreateVirtualCircuit Creates a new virtual circuit to use with Oracle Cloud // Infrastructure FastConnect. For more information, see // FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // For the purposes of access control, you must provide the OCID of the // compartment where you want the virtual circuit to reside. If you're // not sure which compartment to use, put the virtual circuit in the // same compartment with the DRG it's using. For more information about // compartments and access control, see // Overview of the IAM Service (https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm). // For information about OCIDs, see // Resource Identifiers (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). // You may optionally specify a *display name* for the virtual circuit. // It does not have to be unique, and you can change it. Avoid entering confidential information. // **Important:** When creating a virtual circuit, you specify a DRG for // the traffic to flow through. Make sure you attach the DRG to your // VCN and confirm the VCN's routing sends traffic to the DRG. Otherwise // traffic will not flow. For more information, see // Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). func (client VirtualNetworkClient) CreateVirtualCircuit(ctx context.Context, request CreateVirtualCircuitRequest) (response CreateVirtualCircuitResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.createVirtualCircuit, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = CreateVirtualCircuitResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = CreateVirtualCircuitResponse{} } } return } if convertedResponse, ok := ociResponse.(CreateVirtualCircuitResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into CreateVirtualCircuitResponse") } return } // createVirtualCircuit implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) createVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/virtualCircuits") if err != nil { return nil, err } var response CreateVirtualCircuitResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteCpe Deletes the specified CPE object. The CPE must not be connected to a DRG. This is an asynchronous // operation. The CPE's `lifecycleState` will change to TERMINATING temporarily until the CPE is completely // removed. func (client VirtualNetworkClient) DeleteCpe(ctx context.Context, request DeleteCpeRequest) (response DeleteCpeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteCpe, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteCpeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteCpeResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteCpeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteCpeResponse") } return } // deleteCpe implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/cpes/{cpeId}") if err != nil { return nil, err } var response DeleteCpeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteCrossConnect Deletes the specified cross-connect. It must not be mapped to a // VirtualCircuit. func (client VirtualNetworkClient) DeleteCrossConnect(ctx context.Context, request DeleteCrossConnectRequest) (response DeleteCrossConnectResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteCrossConnect, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteCrossConnectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteCrossConnectResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteCrossConnectResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteCrossConnectResponse") } return } // deleteCrossConnect implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/crossConnects/{crossConnectId}") if err != nil { return nil, err } var response DeleteCrossConnectResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteCrossConnectGroup Deletes the specified cross-connect group. It must not contain any // cross-connects, and it cannot be mapped to a // VirtualCircuit. func (client VirtualNetworkClient) DeleteCrossConnectGroup(ctx context.Context, request DeleteCrossConnectGroupRequest) (response DeleteCrossConnectGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteCrossConnectGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteCrossConnectGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteCrossConnectGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteCrossConnectGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteCrossConnectGroupResponse") } return } // deleteCrossConnectGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/crossConnectGroups/{crossConnectGroupId}") if err != nil { return nil, err } var response DeleteCrossConnectGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteDhcpOptions Deletes the specified set of DHCP options, but only if it's not associated with a subnet. You can't delete a // VCN's default set of DHCP options. // This is an asynchronous operation. The state of the set of options will switch to TERMINATING temporarily // until the set is completely removed. func (client VirtualNetworkClient) DeleteDhcpOptions(ctx context.Context, request DeleteDhcpOptionsRequest) (response DeleteDhcpOptionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteDhcpOptions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteDhcpOptionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteDhcpOptionsResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteDhcpOptionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteDhcpOptionsResponse") } return } // deleteDhcpOptions implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dhcps/{dhcpId}") if err != nil { return nil, err } var response DeleteDhcpOptionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteDrg Deletes the specified DRG. The DRG must not be attached to a VCN or be connected to your on-premise // network. Also, there must not be a route table that lists the DRG as a target. This is an asynchronous // operation. The DRG's `lifecycleState` will change to TERMINATING temporarily until the DRG is completely // removed. func (client VirtualNetworkClient) DeleteDrg(ctx context.Context, request DeleteDrgRequest) (response DeleteDrgResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteDrg, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteDrgResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteDrgResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteDrgResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteDrgResponse") } return } // deleteDrg implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/drgs/{drgId}") if err != nil { return nil, err } var response DeleteDrgResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteDrgAttachment Detaches a DRG from a VCN by deleting the corresponding `DrgAttachment`. This is an asynchronous // operation. The attachment's `lifecycleState` will change to DETACHING temporarily until the attachment // is completely removed. func (client VirtualNetworkClient) DeleteDrgAttachment(ctx context.Context, request DeleteDrgAttachmentRequest) (response DeleteDrgAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteDrgAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteDrgAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteDrgAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteDrgAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteDrgAttachmentResponse") } return } // deleteDrgAttachment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/drgAttachments/{drgAttachmentId}") if err != nil { return nil, err } var response DeleteDrgAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteIPSecConnection Deletes the specified IPSec connection. If your goal is to disable the IPSec VPN between your VCN and // on-premises network, it's easiest to simply detach the DRG but keep all the IPSec VPN components intact. // If you were to delete all the components and then later need to create an IPSec VPN again, you would // need to configure your on-premises router again with the new information returned from // CreateIPSecConnection. // This is an asynchronous operation. The connection's `lifecycleState` will change to TERMINATING temporarily // until the connection is completely removed. func (client VirtualNetworkClient) DeleteIPSecConnection(ctx context.Context, request DeleteIPSecConnectionRequest) (response DeleteIPSecConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteIPSecConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteIPSecConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteIPSecConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteIPSecConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteIPSecConnectionResponse") } return } // deleteIPSecConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/ipsecConnections/{ipscId}") if err != nil { return nil, err } var response DeleteIPSecConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteInternetGateway Deletes the specified internet gateway. The internet gateway does not have to be disabled, but // there must not be a route table that lists it as a target. // This is an asynchronous operation. The gateway's `lifecycleState` will change to TERMINATING temporarily // until the gateway is completely removed. func (client VirtualNetworkClient) DeleteInternetGateway(ctx context.Context, request DeleteInternetGatewayRequest) (response DeleteInternetGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteInternetGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteInternetGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteInternetGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteInternetGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteInternetGatewayResponse") } return } // deleteInternetGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/internetGateways/{igId}") if err != nil { return nil, err } var response DeleteInternetGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteIpv6 Unassigns and deletes the specified IPv6. You must specify the object's OCID. // The IPv6 address is returned to the subnet's pool of available addresses. func (client VirtualNetworkClient) DeleteIpv6(ctx context.Context, request DeleteIpv6Request) (response DeleteIpv6Response, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteIpv6, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteIpv6Response{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteIpv6Response{} } } return } if convertedResponse, ok := ociResponse.(DeleteIpv6Response); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteIpv6Response") } return } // deleteIpv6 implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteIpv6(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/ipv6/{ipv6Id}") if err != nil { return nil, err } var response DeleteIpv6Response var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteLocalPeeringGateway Deletes the specified local peering gateway (LPG). // This is an asynchronous operation; the local peering gateway's `lifecycleState` changes to TERMINATING temporarily // until the local peering gateway is completely removed. func (client VirtualNetworkClient) DeleteLocalPeeringGateway(ctx context.Context, request DeleteLocalPeeringGatewayRequest) (response DeleteLocalPeeringGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteLocalPeeringGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteLocalPeeringGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteLocalPeeringGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteLocalPeeringGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteLocalPeeringGatewayResponse") } return } // deleteLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/localPeeringGateways/{localPeeringGatewayId}") if err != nil { return nil, err } var response DeleteLocalPeeringGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteNatGateway Deletes the specified NAT gateway. The NAT gateway does not have to be disabled, but there // must not be a route rule that lists the NAT gateway as a target. // This is an asynchronous operation. The NAT gateway's `lifecycleState` will change to // TERMINATING temporarily until the NAT gateway is completely removed. func (client VirtualNetworkClient) DeleteNatGateway(ctx context.Context, request DeleteNatGatewayRequest) (response DeleteNatGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteNatGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteNatGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteNatGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteNatGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteNatGatewayResponse") } return } // deleteNatGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/natGateways/{natGatewayId}") if err != nil { return nil, err } var response DeleteNatGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteNetworkSecurityGroup Deletes the specified network security group. The group must not contain any VNICs. // To get a list of the VNICs in a network security group, use // ListNetworkSecurityGroupVnics. // Each returned NetworkSecurityGroupVnic object // contains both the OCID of the VNIC and the OCID of the VNIC's parent resource (for example, // the Compute instance that the VNIC is attached to). func (client VirtualNetworkClient) DeleteNetworkSecurityGroup(ctx context.Context, request DeleteNetworkSecurityGroupRequest) (response DeleteNetworkSecurityGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteNetworkSecurityGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteNetworkSecurityGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteNetworkSecurityGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteNetworkSecurityGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteNetworkSecurityGroupResponse") } return } // deleteNetworkSecurityGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteNetworkSecurityGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/networkSecurityGroups/{networkSecurityGroupId}") if err != nil { return nil, err } var response DeleteNetworkSecurityGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeletePrivateIp Unassigns and deletes the specified private IP. You must // specify the object's OCID. The private IP address is returned to // the subnet's pool of available addresses. // This operation cannot be used with primary private IPs, which are // automatically unassigned and deleted when the VNIC is terminated. // **Important:** If a secondary private IP is the // target of a route rule (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip), // unassigning it from the VNIC causes that route rule to blackhole and the traffic // will be dropped. func (client VirtualNetworkClient) DeletePrivateIp(ctx context.Context, request DeletePrivateIpRequest) (response DeletePrivateIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deletePrivateIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeletePrivateIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeletePrivateIpResponse{} } } return } if convertedResponse, ok := ociResponse.(DeletePrivateIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeletePrivateIpResponse") } return } // deletePrivateIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deletePrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/privateIps/{privateIpId}") if err != nil { return nil, err } var response DeletePrivateIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeletePublicIp Unassigns and deletes the specified public IP (either ephemeral or reserved). // You must specify the object's OCID. The public IP address is returned to the // Oracle Cloud Infrastructure public IP pool. // **Note:** You cannot update, unassign, or delete the public IP that Oracle automatically // assigned to an entity for you (such as a load balancer or NAT gateway). The public IP is // automatically deleted if the assigned entity is terminated. // For an assigned reserved public IP, the initial unassignment portion of this operation // is asynchronous. Poll the public IP's `lifecycleState` to determine // if the operation succeeded. // If you want to simply unassign a reserved public IP and return it to your pool // of reserved public IPs, instead use // UpdatePublicIp. func (client VirtualNetworkClient) DeletePublicIp(ctx context.Context, request DeletePublicIpRequest) (response DeletePublicIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deletePublicIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeletePublicIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeletePublicIpResponse{} } } return } if convertedResponse, ok := ociResponse.(DeletePublicIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeletePublicIpResponse") } return } // deletePublicIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deletePublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/publicIps/{publicIpId}") if err != nil { return nil, err } var response DeletePublicIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteRemotePeeringConnection Deletes the remote peering connection (RPC). // This is an asynchronous operation; the RPC's `lifecycleState` changes to TERMINATING temporarily // until the RPC is completely removed. func (client VirtualNetworkClient) DeleteRemotePeeringConnection(ctx context.Context, request DeleteRemotePeeringConnectionRequest) (response DeleteRemotePeeringConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteRemotePeeringConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteRemotePeeringConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteRemotePeeringConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteRemotePeeringConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteRemotePeeringConnectionResponse") } return } // deleteRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/remotePeeringConnections/{remotePeeringConnectionId}") if err != nil { return nil, err } var response DeleteRemotePeeringConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteRouteTable Deletes the specified route table, but only if it's not associated with a subnet. You can't delete a // VCN's default route table. // This is an asynchronous operation. The route table's `lifecycleState` will change to TERMINATING temporarily // until the route table is completely removed. func (client VirtualNetworkClient) DeleteRouteTable(ctx context.Context, request DeleteRouteTableRequest) (response DeleteRouteTableResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteRouteTable, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteRouteTableResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteRouteTableResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteRouteTableResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteRouteTableResponse") } return } // deleteRouteTable implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/routeTables/{rtId}") if err != nil { return nil, err } var response DeleteRouteTableResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteSecurityList Deletes the specified security list, but only if it's not associated with a subnet. You can't delete // a VCN's default security list. // This is an asynchronous operation. The security list's `lifecycleState` will change to TERMINATING temporarily // until the security list is completely removed. func (client VirtualNetworkClient) DeleteSecurityList(ctx context.Context, request DeleteSecurityListRequest) (response DeleteSecurityListResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteSecurityList, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteSecurityListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteSecurityListResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteSecurityListResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteSecurityListResponse") } return } // deleteSecurityList implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/securityLists/{securityListId}") if err != nil { return nil, err } var response DeleteSecurityListResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteServiceGateway Deletes the specified service gateway. There must not be a route table that lists the service // gateway as a target. func (client VirtualNetworkClient) DeleteServiceGateway(ctx context.Context, request DeleteServiceGatewayRequest) (response DeleteServiceGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteServiceGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteServiceGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteServiceGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteServiceGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteServiceGatewayResponse") } return } // deleteServiceGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/serviceGateways/{serviceGatewayId}") if err != nil { return nil, err } var response DeleteServiceGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteSubnet Deletes the specified subnet, but only if there are no instances in the subnet. This is an asynchronous // operation. The subnet's `lifecycleState` will change to TERMINATING temporarily. If there are any // instances in the subnet, the state will instead change back to AVAILABLE. func (client VirtualNetworkClient) DeleteSubnet(ctx context.Context, request DeleteSubnetRequest) (response DeleteSubnetResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteSubnet, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteSubnetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteSubnetResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteSubnetResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteSubnetResponse") } return } // deleteSubnet implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/subnets/{subnetId}") if err != nil { return nil, err } var response DeleteSubnetResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVcn Deletes the specified VCN. The VCN must be empty and have no attached gateways. This is an asynchronous // operation. The VCN's `lifecycleState` will change to TERMINATING temporarily until the VCN is completely // removed. func (client VirtualNetworkClient) DeleteVcn(ctx context.Context, request DeleteVcnRequest) (response DeleteVcnResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVcn, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVcnResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVcnResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVcnResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVcnResponse") } return } // deleteVcn implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/vcns/{vcnId}") if err != nil { return nil, err } var response DeleteVcnResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DeleteVirtualCircuit Deletes the specified virtual circuit. // **Important:** If you're using FastConnect via a provider, // make sure to also terminate the connection with // the provider, or else the provider may continue to bill you. func (client VirtualNetworkClient) DeleteVirtualCircuit(ctx context.Context, request DeleteVirtualCircuitRequest) (response DeleteVirtualCircuitResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.deleteVirtualCircuit, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DeleteVirtualCircuitResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DeleteVirtualCircuitResponse{} } } return } if convertedResponse, ok := ociResponse.(DeleteVirtualCircuitResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DeleteVirtualCircuitResponse") } return } // deleteVirtualCircuit implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) deleteVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodDelete, "/virtualCircuits/{virtualCircuitId}") if err != nil { return nil, err } var response DeleteVirtualCircuitResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // DetachServiceId Removes the specified Service from the list of enabled // `Service` objects for the specified gateway. You do not need to remove any route // rules that specify this `Service` object's `cidrBlock` as the destination CIDR. However, consider // removing the rules if your intent is to permanently disable use of the `Service` through this // service gateway. // **Note:** The `DetachServiceId` operation is an easy way to remove an individual `Service` from // the service gateway. Compare it with // UpdateServiceGateway, which replaces // the entire existing list of enabled `Service` objects with the list that you provide in the // `Update` call. `UpdateServiceGateway` also lets you block all traffic through the service // gateway without having to remove each of the individual `Service` objects. func (client VirtualNetworkClient) DetachServiceId(ctx context.Context, request DetachServiceIdRequest) (response DetachServiceIdResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.detachServiceId, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = DetachServiceIdResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = DetachServiceIdResponse{} } } return } if convertedResponse, ok := ociResponse.(DetachServiceIdResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into DetachServiceIdResponse") } return } // detachServiceId implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) detachServiceId(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/serviceGateways/{serviceGatewayId}/actions/detachService") if err != nil { return nil, err } var response DetachServiceIdResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetCpe Gets the specified CPE's information. func (client VirtualNetworkClient) GetCpe(ctx context.Context, request GetCpeRequest) (response GetCpeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getCpe, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetCpeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetCpeResponse{} } } return } if convertedResponse, ok := ociResponse.(GetCpeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetCpeResponse") } return } // getCpe implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/cpes/{cpeId}") if err != nil { return nil, err } var response GetCpeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetCpeDeviceConfigContent Renders a set of CPE configuration content that can help a network engineer configure the actual // CPE device (for example, a hardware router) represented by the specified Cpe // object. // The rendered content is specific to the type of CPE device (for example, Cisco ASA). Therefore the // Cpe must have the CPE's device type specified by the `cpeDeviceShapeId` // attribute. The content optionally includes answers that the customer provides (see // UpdateTunnelCpeDeviceConfig), // merged with a template of other information specific to the CPE device type. // The operation returns configuration information for *all* of the // IPSecConnection objects that use the specified CPE. // Here are similar operations: // * GetIpsecCpeDeviceConfigContent // returns CPE configuration content for all tunnels in a single IPSec connection. // * GetTunnelCpeDeviceConfigContent // returns CPE configuration content for a specific tunnel within an IPSec connection. func (client VirtualNetworkClient) GetCpeDeviceConfigContent(ctx context.Context, request GetCpeDeviceConfigContentRequest) (response GetCpeDeviceConfigContentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getCpeDeviceConfigContent, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetCpeDeviceConfigContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetCpeDeviceConfigContentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetCpeDeviceConfigContentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetCpeDeviceConfigContentResponse") } return } // getCpeDeviceConfigContent implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getCpeDeviceConfigContent(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/cpes/{cpeId}/cpeConfigContent") if err != nil { return nil, err } var response GetCpeDeviceConfigContentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetCpeDeviceShape Gets the detailed information about the specified CPE device type. This might include a set of questions // that are specific to the particular CPE device type. The customer must supply answers to those questions // (see UpdateTunnelCpeDeviceConfig). // The service merges the answers with a template of other information for the CPE device type. The following // operations return the merged content: // * GetCpeDeviceConfigContent // * GetIpsecCpeDeviceConfigContent // * GetTunnelCpeDeviceConfigContent func (client VirtualNetworkClient) GetCpeDeviceShape(ctx context.Context, request GetCpeDeviceShapeRequest) (response GetCpeDeviceShapeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getCpeDeviceShape, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetCpeDeviceShapeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetCpeDeviceShapeResponse{} } } return } if convertedResponse, ok := ociResponse.(GetCpeDeviceShapeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetCpeDeviceShapeResponse") } return } // getCpeDeviceShape implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getCpeDeviceShape(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/cpeDeviceShapes/{cpeDeviceShapeId}") if err != nil { return nil, err } var response GetCpeDeviceShapeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetCrossConnect Gets the specified cross-connect's information. func (client VirtualNetworkClient) GetCrossConnect(ctx context.Context, request GetCrossConnectRequest) (response GetCrossConnectResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getCrossConnect, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetCrossConnectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetCrossConnectResponse{} } } return } if convertedResponse, ok := ociResponse.(GetCrossConnectResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectResponse") } return } // getCrossConnect implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects/{crossConnectId}") if err != nil { return nil, err } var response GetCrossConnectResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetCrossConnectGroup Gets the specified cross-connect group's information. func (client VirtualNetworkClient) GetCrossConnectGroup(ctx context.Context, request GetCrossConnectGroupRequest) (response GetCrossConnectGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getCrossConnectGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetCrossConnectGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetCrossConnectGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(GetCrossConnectGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectGroupResponse") } return } // getCrossConnectGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectGroups/{crossConnectGroupId}") if err != nil { return nil, err } var response GetCrossConnectGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetCrossConnectLetterOfAuthority Gets the Letter of Authority for the specified cross-connect. func (client VirtualNetworkClient) GetCrossConnectLetterOfAuthority(ctx context.Context, request GetCrossConnectLetterOfAuthorityRequest) (response GetCrossConnectLetterOfAuthorityResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getCrossConnectLetterOfAuthority, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetCrossConnectLetterOfAuthorityResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetCrossConnectLetterOfAuthorityResponse{} } } return } if convertedResponse, ok := ociResponse.(GetCrossConnectLetterOfAuthorityResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectLetterOfAuthorityResponse") } return } // getCrossConnectLetterOfAuthority implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getCrossConnectLetterOfAuthority(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects/{crossConnectId}/letterOfAuthority") if err != nil { return nil, err } var response GetCrossConnectLetterOfAuthorityResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetCrossConnectStatus Gets the status of the specified cross-connect. func (client VirtualNetworkClient) GetCrossConnectStatus(ctx context.Context, request GetCrossConnectStatusRequest) (response GetCrossConnectStatusResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getCrossConnectStatus, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetCrossConnectStatusResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetCrossConnectStatusResponse{} } } return } if convertedResponse, ok := ociResponse.(GetCrossConnectStatusResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetCrossConnectStatusResponse") } return } // getCrossConnectStatus implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getCrossConnectStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects/{crossConnectId}/status") if err != nil { return nil, err } var response GetCrossConnectStatusResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetDhcpOptions Gets the specified set of DHCP options. func (client VirtualNetworkClient) GetDhcpOptions(ctx context.Context, request GetDhcpOptionsRequest) (response GetDhcpOptionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getDhcpOptions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetDhcpOptionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetDhcpOptionsResponse{} } } return } if convertedResponse, ok := ociResponse.(GetDhcpOptionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetDhcpOptionsResponse") } return } // getDhcpOptions implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/dhcps/{dhcpId}") if err != nil { return nil, err } var response GetDhcpOptionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetDrg Gets the specified DRG's information. func (client VirtualNetworkClient) GetDrg(ctx context.Context, request GetDrgRequest) (response GetDrgResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getDrg, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetDrgResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetDrgResponse{} } } return } if convertedResponse, ok := ociResponse.(GetDrgResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetDrgResponse") } return } // getDrg implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgs/{drgId}") if err != nil { return nil, err } var response GetDrgResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetDrgAttachment Gets the information for the specified `DrgAttachment`. func (client VirtualNetworkClient) GetDrgAttachment(ctx context.Context, request GetDrgAttachmentRequest) (response GetDrgAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getDrgAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetDrgAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetDrgAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetDrgAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetDrgAttachmentResponse") } return } // getDrgAttachment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgAttachments/{drgAttachmentId}") if err != nil { return nil, err } var response GetDrgAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetDrgRedundancyStatus Gets the redundancy status for the specified DRG. For more information, see // Redundancy Remedies (https://docs.cloud.oracle.com/Content/Network/Troubleshoot/drgredundancy.htm). func (client VirtualNetworkClient) GetDrgRedundancyStatus(ctx context.Context, request GetDrgRedundancyStatusRequest) (response GetDrgRedundancyStatusResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getDrgRedundancyStatus, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetDrgRedundancyStatusResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetDrgRedundancyStatusResponse{} } } return } if convertedResponse, ok := ociResponse.(GetDrgRedundancyStatusResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetDrgRedundancyStatusResponse") } return } // getDrgRedundancyStatus implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getDrgRedundancyStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgs/{drgId}/redundancyStatus") if err != nil { return nil, err } var response GetDrgRedundancyStatusResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetFastConnectProviderService Gets the specified provider service. // For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). func (client VirtualNetworkClient) GetFastConnectProviderService(ctx context.Context, request GetFastConnectProviderServiceRequest) (response GetFastConnectProviderServiceResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getFastConnectProviderService, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetFastConnectProviderServiceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetFastConnectProviderServiceResponse{} } } return } if convertedResponse, ok := ociResponse.(GetFastConnectProviderServiceResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetFastConnectProviderServiceResponse") } return } // getFastConnectProviderService implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getFastConnectProviderService(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}") if err != nil { return nil, err } var response GetFastConnectProviderServiceResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetFastConnectProviderServiceKey Gets the specified provider service key's information. Use this operation to validate a // provider service key. An invalid key returns a 404 error. func (client VirtualNetworkClient) GetFastConnectProviderServiceKey(ctx context.Context, request GetFastConnectProviderServiceKeyRequest) (response GetFastConnectProviderServiceKeyResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getFastConnectProviderServiceKey, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetFastConnectProviderServiceKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetFastConnectProviderServiceKeyResponse{} } } return } if convertedResponse, ok := ociResponse.(GetFastConnectProviderServiceKeyResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetFastConnectProviderServiceKeyResponse") } return } // getFastConnectProviderServiceKey implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getFastConnectProviderServiceKey(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}/providerServiceKeys/{providerServiceKeyName}") if err != nil { return nil, err } var response GetFastConnectProviderServiceKeyResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetIPSecConnection Gets the specified IPSec connection's basic information, including the static routes for the // on-premises router. If you want the status of the connection (whether it's up or down), use // GetIPSecConnectionTunnel. func (client VirtualNetworkClient) GetIPSecConnection(ctx context.Context, request GetIPSecConnectionRequest) (response GetIPSecConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getIPSecConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetIPSecConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetIPSecConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(GetIPSecConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionResponse") } return } // getIPSecConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}") if err != nil { return nil, err } var response GetIPSecConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetIPSecConnectionDeviceConfig Deprecated. To get tunnel information, instead use: // * GetIPSecConnectionTunnel // * GetIPSecConnectionTunnelSharedSecret func (client VirtualNetworkClient) GetIPSecConnectionDeviceConfig(ctx context.Context, request GetIPSecConnectionDeviceConfigRequest) (response GetIPSecConnectionDeviceConfigResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionDeviceConfig, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetIPSecConnectionDeviceConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetIPSecConnectionDeviceConfigResponse{} } } return } if convertedResponse, ok := ociResponse.(GetIPSecConnectionDeviceConfigResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionDeviceConfigResponse") } return } // getIPSecConnectionDeviceConfig implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getIPSecConnectionDeviceConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/deviceConfig") if err != nil { return nil, err } var response GetIPSecConnectionDeviceConfigResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetIPSecConnectionDeviceStatus Deprecated. To get the tunnel status, instead use // GetIPSecConnectionTunnel. func (client VirtualNetworkClient) GetIPSecConnectionDeviceStatus(ctx context.Context, request GetIPSecConnectionDeviceStatusRequest) (response GetIPSecConnectionDeviceStatusResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionDeviceStatus, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetIPSecConnectionDeviceStatusResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetIPSecConnectionDeviceStatusResponse{} } } return } if convertedResponse, ok := ociResponse.(GetIPSecConnectionDeviceStatusResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionDeviceStatusResponse") } return } // getIPSecConnectionDeviceStatus implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getIPSecConnectionDeviceStatus(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/deviceStatus") if err != nil { return nil, err } var response GetIPSecConnectionDeviceStatusResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetIPSecConnectionTunnel Gets the specified tunnel's information. The resulting object does not include the tunnel's // shared secret (pre-shared key). To retrieve that, use // GetIPSecConnectionTunnelSharedSecret. func (client VirtualNetworkClient) GetIPSecConnectionTunnel(ctx context.Context, request GetIPSecConnectionTunnelRequest) (response GetIPSecConnectionTunnelResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionTunnel, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetIPSecConnectionTunnelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetIPSecConnectionTunnelResponse{} } } return } if convertedResponse, ok := ociResponse.(GetIPSecConnectionTunnelResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionTunnelResponse") } return } // getIPSecConnectionTunnel implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getIPSecConnectionTunnel(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}") if err != nil { return nil, err } var response GetIPSecConnectionTunnelResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetIPSecConnectionTunnelSharedSecret Gets the specified tunnel's shared secret (pre-shared key). To get other information // about the tunnel, use GetIPSecConnectionTunnel. func (client VirtualNetworkClient) GetIPSecConnectionTunnelSharedSecret(ctx context.Context, request GetIPSecConnectionTunnelSharedSecretRequest) (response GetIPSecConnectionTunnelSharedSecretResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getIPSecConnectionTunnelSharedSecret, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetIPSecConnectionTunnelSharedSecretResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetIPSecConnectionTunnelSharedSecretResponse{} } } return } if convertedResponse, ok := ociResponse.(GetIPSecConnectionTunnelSharedSecretResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetIPSecConnectionTunnelSharedSecretResponse") } return } // getIPSecConnectionTunnelSharedSecret implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getIPSecConnectionTunnelSharedSecret(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}/sharedSecret") if err != nil { return nil, err } var response GetIPSecConnectionTunnelSharedSecretResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetInternetGateway Gets the specified internet gateway's information. func (client VirtualNetworkClient) GetInternetGateway(ctx context.Context, request GetInternetGatewayRequest) (response GetInternetGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getInternetGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetInternetGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetInternetGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(GetInternetGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetInternetGatewayResponse") } return } // getInternetGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/internetGateways/{igId}") if err != nil { return nil, err } var response GetInternetGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetIpsecCpeDeviceConfigContent Renders a set of CPE configuration content for the specified IPSec connection (for all the // tunnels in the connection). The content helps a network engineer configure the actual CPE // device (for example, a hardware router) that the specified IPSec connection terminates on. // The rendered content is specific to the type of CPE device (for example, Cisco ASA). Therefore the // Cpe used by the specified IPSecConnection // must have the CPE's device type specified by the `cpeDeviceShapeId` attribute. The content // optionally includes answers that the customer provides (see // UpdateTunnelCpeDeviceConfig), // merged with a template of other information specific to the CPE device type. // The operation returns configuration information for all tunnels in the single specified // IPSecConnection object. Here are other similar // operations: // * GetTunnelCpeDeviceConfigContent // returns CPE configuration content for a specific tunnel within an IPSec connection. // * GetCpeDeviceConfigContent // returns CPE configuration content for *all* IPSec connections that use a specific CPE. func (client VirtualNetworkClient) GetIpsecCpeDeviceConfigContent(ctx context.Context, request GetIpsecCpeDeviceConfigContentRequest) (response GetIpsecCpeDeviceConfigContentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getIpsecCpeDeviceConfigContent, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetIpsecCpeDeviceConfigContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetIpsecCpeDeviceConfigContentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetIpsecCpeDeviceConfigContentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetIpsecCpeDeviceConfigContentResponse") } return } // getIpsecCpeDeviceConfigContent implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getIpsecCpeDeviceConfigContent(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/cpeConfigContent") if err != nil { return nil, err } var response GetIpsecCpeDeviceConfigContentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetIpv6 Gets the specified IPv6. You must specify the object's OCID. // Alternatively, you can get the object by using // ListIpv6s // with the IPv6 address (for example, 2001:0db8:0123:1111:98fe:dcba:9876:4321) and subnet OCID. func (client VirtualNetworkClient) GetIpv6(ctx context.Context, request GetIpv6Request) (response GetIpv6Response, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getIpv6, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetIpv6Response{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetIpv6Response{} } } return } if convertedResponse, ok := ociResponse.(GetIpv6Response); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetIpv6Response") } return } // getIpv6 implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getIpv6(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipv6/{ipv6Id}") if err != nil { return nil, err } var response GetIpv6Response var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetLocalPeeringGateway Gets the specified local peering gateway's information. func (client VirtualNetworkClient) GetLocalPeeringGateway(ctx context.Context, request GetLocalPeeringGatewayRequest) (response GetLocalPeeringGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getLocalPeeringGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetLocalPeeringGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetLocalPeeringGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(GetLocalPeeringGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetLocalPeeringGatewayResponse") } return } // getLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/localPeeringGateways/{localPeeringGatewayId}") if err != nil { return nil, err } var response GetLocalPeeringGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetNatGateway Gets the specified NAT gateway's information. func (client VirtualNetworkClient) GetNatGateway(ctx context.Context, request GetNatGatewayRequest) (response GetNatGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getNatGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetNatGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetNatGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(GetNatGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetNatGatewayResponse") } return } // getNatGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/natGateways/{natGatewayId}") if err != nil { return nil, err } var response GetNatGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetNetworkSecurityGroup Gets the specified network security group's information. // To list the VNICs in an NSG, see // ListNetworkSecurityGroupVnics. // To list the security rules in an NSG, see // ListNetworkSecurityGroupSecurityRules. func (client VirtualNetworkClient) GetNetworkSecurityGroup(ctx context.Context, request GetNetworkSecurityGroupRequest) (response GetNetworkSecurityGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getNetworkSecurityGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetNetworkSecurityGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetNetworkSecurityGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(GetNetworkSecurityGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetNetworkSecurityGroupResponse") } return } // getNetworkSecurityGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getNetworkSecurityGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkSecurityGroups/{networkSecurityGroupId}") if err != nil { return nil, err } var response GetNetworkSecurityGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetPrivateIp Gets the specified private IP. You must specify the object's OCID. // Alternatively, you can get the object by using // ListPrivateIps // with the private IP address (for example, 10.0.3.3) and subnet OCID. func (client VirtualNetworkClient) GetPrivateIp(ctx context.Context, request GetPrivateIpRequest) (response GetPrivateIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getPrivateIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetPrivateIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetPrivateIpResponse{} } } return } if convertedResponse, ok := ociResponse.(GetPrivateIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetPrivateIpResponse") } return } // getPrivateIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getPrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/privateIps/{privateIpId}") if err != nil { return nil, err } var response GetPrivateIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetPublicIp Gets the specified public IP. You must specify the object's OCID. // Alternatively, you can get the object by using GetPublicIpByIpAddress // with the public IP address (for example, 129.146.2.1). // Or you can use GetPublicIpByPrivateIpId // with the OCID of the private IP that the public IP is assigned to. // **Note:** If you're fetching a reserved public IP that is in the process of being // moved to a different private IP, the service returns the public IP object with // `lifecycleState` = ASSIGNING and `assignedEntityId` = OCID of the target private IP. func (client VirtualNetworkClient) GetPublicIp(ctx context.Context, request GetPublicIpRequest) (response GetPublicIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getPublicIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetPublicIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetPublicIpResponse{} } } return } if convertedResponse, ok := ociResponse.(GetPublicIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetPublicIpResponse") } return } // getPublicIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getPublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/publicIps/{publicIpId}") if err != nil { return nil, err } var response GetPublicIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetPublicIpByIpAddress Gets the public IP based on the public IP address (for example, 129.146.2.1). // **Note:** If you're fetching a reserved public IP that is in the process of being // moved to a different private IP, the service returns the public IP object with // `lifecycleState` = ASSIGNING and `assignedEntityId` = OCID of the target private IP. func (client VirtualNetworkClient) GetPublicIpByIpAddress(ctx context.Context, request GetPublicIpByIpAddressRequest) (response GetPublicIpByIpAddressResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getPublicIpByIpAddress, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetPublicIpByIpAddressResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetPublicIpByIpAddressResponse{} } } return } if convertedResponse, ok := ociResponse.(GetPublicIpByIpAddressResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetPublicIpByIpAddressResponse") } return } // getPublicIpByIpAddress implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getPublicIpByIpAddress(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/publicIps/actions/getByIpAddress") if err != nil { return nil, err } var response GetPublicIpByIpAddressResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetPublicIpByPrivateIpId Gets the public IP assigned to the specified private IP. You must specify the OCID // of the private IP. If no public IP is assigned, a 404 is returned. // **Note:** If you're fetching a reserved public IP that is in the process of being // moved to a different private IP, and you provide the OCID of the original private // IP, this operation returns a 404. If you instead provide the OCID of the target // private IP, or if you instead call // GetPublicIp or // GetPublicIpByIpAddress, the // service returns the public IP object with `lifecycleState` = ASSIGNING and // `assignedEntityId` = OCID of the target private IP. func (client VirtualNetworkClient) GetPublicIpByPrivateIpId(ctx context.Context, request GetPublicIpByPrivateIpIdRequest) (response GetPublicIpByPrivateIpIdResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getPublicIpByPrivateIpId, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetPublicIpByPrivateIpIdResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetPublicIpByPrivateIpIdResponse{} } } return } if convertedResponse, ok := ociResponse.(GetPublicIpByPrivateIpIdResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetPublicIpByPrivateIpIdResponse") } return } // getPublicIpByPrivateIpId implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getPublicIpByPrivateIpId(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/publicIps/actions/getByPrivateIpId") if err != nil { return nil, err } var response GetPublicIpByPrivateIpIdResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetRemotePeeringConnection Get the specified remote peering connection's information. func (client VirtualNetworkClient) GetRemotePeeringConnection(ctx context.Context, request GetRemotePeeringConnectionRequest) (response GetRemotePeeringConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getRemotePeeringConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetRemotePeeringConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetRemotePeeringConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(GetRemotePeeringConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetRemotePeeringConnectionResponse") } return } // getRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/remotePeeringConnections/{remotePeeringConnectionId}") if err != nil { return nil, err } var response GetRemotePeeringConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetRouteTable Gets the specified route table's information. func (client VirtualNetworkClient) GetRouteTable(ctx context.Context, request GetRouteTableRequest) (response GetRouteTableResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getRouteTable, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetRouteTableResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetRouteTableResponse{} } } return } if convertedResponse, ok := ociResponse.(GetRouteTableResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetRouteTableResponse") } return } // getRouteTable implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/routeTables/{rtId}") if err != nil { return nil, err } var response GetRouteTableResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetSecurityList Gets the specified security list's information. func (client VirtualNetworkClient) GetSecurityList(ctx context.Context, request GetSecurityListRequest) (response GetSecurityListResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getSecurityList, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetSecurityListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetSecurityListResponse{} } } return } if convertedResponse, ok := ociResponse.(GetSecurityListResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetSecurityListResponse") } return } // getSecurityList implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/securityLists/{securityListId}") if err != nil { return nil, err } var response GetSecurityListResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetService Gets the specified Service object. func (client VirtualNetworkClient) GetService(ctx context.Context, request GetServiceRequest) (response GetServiceResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getService, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetServiceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetServiceResponse{} } } return } if convertedResponse, ok := ociResponse.(GetServiceResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetServiceResponse") } return } // getService implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getService(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/services/{serviceId}") if err != nil { return nil, err } var response GetServiceResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetServiceGateway Gets the specified service gateway's information. func (client VirtualNetworkClient) GetServiceGateway(ctx context.Context, request GetServiceGatewayRequest) (response GetServiceGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getServiceGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetServiceGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetServiceGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(GetServiceGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetServiceGatewayResponse") } return } // getServiceGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceGateways/{serviceGatewayId}") if err != nil { return nil, err } var response GetServiceGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetSubnet Gets the specified subnet's information. func (client VirtualNetworkClient) GetSubnet(ctx context.Context, request GetSubnetRequest) (response GetSubnetResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getSubnet, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetSubnetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetSubnetResponse{} } } return } if convertedResponse, ok := ociResponse.(GetSubnetResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetSubnetResponse") } return } // getSubnet implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/subnets/{subnetId}") if err != nil { return nil, err } var response GetSubnetResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetTunnelCpeDeviceConfig Gets the set of CPE configuration answers for the tunnel, which the customer provided in // UpdateTunnelCpeDeviceConfig. // To get the full set of content for the tunnel (any answers merged with the template of other // information specific to the CPE device type), use // GetTunnelCpeDeviceConfigContent. func (client VirtualNetworkClient) GetTunnelCpeDeviceConfig(ctx context.Context, request GetTunnelCpeDeviceConfigRequest) (response GetTunnelCpeDeviceConfigResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getTunnelCpeDeviceConfig, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetTunnelCpeDeviceConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetTunnelCpeDeviceConfigResponse{} } } return } if convertedResponse, ok := ociResponse.(GetTunnelCpeDeviceConfigResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetTunnelCpeDeviceConfigResponse") } return } // getTunnelCpeDeviceConfig implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getTunnelCpeDeviceConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}/tunnelDeviceConfig") if err != nil { return nil, err } var response GetTunnelCpeDeviceConfigResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetTunnelCpeDeviceConfigContent Renders a set of CPE configuration content for the specified IPSec tunnel. The content helps a // network engineer configure the actual CPE device (for example, a hardware router) that the specified // IPSec tunnel terminates on. // The rendered content is specific to the type of CPE device (for example, Cisco ASA). Therefore the // Cpe used by the specified IPSecConnection // must have the CPE's device type specified by the `cpeDeviceShapeId` attribute. The content // optionally includes answers that the customer provides (see // UpdateTunnelCpeDeviceConfig), // merged with a template of other information specific to the CPE device type. // The operation returns configuration information for only the specified IPSec tunnel. // Here are other similar operations: // * GetIpsecCpeDeviceConfigContent // returns CPE configuration content for all tunnels in a single IPSec connection. // * GetCpeDeviceConfigContent // returns CPE configuration content for *all* IPSec connections that use a specific CPE. func (client VirtualNetworkClient) GetTunnelCpeDeviceConfigContent(ctx context.Context, request GetTunnelCpeDeviceConfigContentRequest) (response GetTunnelCpeDeviceConfigContentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getTunnelCpeDeviceConfigContent, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetTunnelCpeDeviceConfigContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetTunnelCpeDeviceConfigContentResponse{} } } return } if convertedResponse, ok := ociResponse.(GetTunnelCpeDeviceConfigContentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetTunnelCpeDeviceConfigContentResponse") } return } // getTunnelCpeDeviceConfigContent implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getTunnelCpeDeviceConfigContent(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}/tunnelDeviceConfig/content") if err != nil { return nil, err } var response GetTunnelCpeDeviceConfigContentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVcn Gets the specified VCN's information. func (client VirtualNetworkClient) GetVcn(ctx context.Context, request GetVcnRequest) (response GetVcnResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVcn, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVcnResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVcnResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVcnResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVcnResponse") } return } // getVcn implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/vcns/{vcnId}") if err != nil { return nil, err } var response GetVcnResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVirtualCircuit Gets the specified virtual circuit's information. func (client VirtualNetworkClient) GetVirtualCircuit(ctx context.Context, request GetVirtualCircuitRequest) (response GetVirtualCircuitResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVirtualCircuit, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVirtualCircuitResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVirtualCircuitResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVirtualCircuitResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVirtualCircuitResponse") } return } // getVirtualCircuit implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuits/{virtualCircuitId}") if err != nil { return nil, err } var response GetVirtualCircuitResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // GetVnic Gets the information for the specified virtual network interface card (VNIC). // You can get the VNIC OCID from the // ListVnicAttachments // operation. func (client VirtualNetworkClient) GetVnic(ctx context.Context, request GetVnicRequest) (response GetVnicResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.getVnic, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = GetVnicResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = GetVnicResponse{} } } return } if convertedResponse, ok := ociResponse.(GetVnicResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into GetVnicResponse") } return } // getVnic implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) getVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/vnics/{vnicId}") if err != nil { return nil, err } var response GetVnicResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListAllowedPeerRegionsForRemotePeering Lists the regions that support remote VCN peering (which is peering across regions). // For more information, see VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). func (client VirtualNetworkClient) ListAllowedPeerRegionsForRemotePeering(ctx context.Context, request ListAllowedPeerRegionsForRemotePeeringRequest) (response ListAllowedPeerRegionsForRemotePeeringResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listAllowedPeerRegionsForRemotePeering, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListAllowedPeerRegionsForRemotePeeringResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListAllowedPeerRegionsForRemotePeeringResponse{} } } return } if convertedResponse, ok := ociResponse.(ListAllowedPeerRegionsForRemotePeeringResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListAllowedPeerRegionsForRemotePeeringResponse") } return } // listAllowedPeerRegionsForRemotePeering implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listAllowedPeerRegionsForRemotePeering(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/allowedPeerRegionsForRemotePeering") if err != nil { return nil, err } var response ListAllowedPeerRegionsForRemotePeeringResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListCpeDeviceShapes Lists the CPE device types that the Networking service provides CPE configuration // content for (example: Cisco ASA). The content helps a network engineer configure // the actual CPE device represented by a Cpe object. // If you want to generate CPE configuration content for one of the returned CPE device types, // ensure that the Cpe object's `cpeDeviceShapeId` attribute is set // to the CPE device type's OCID (returned by this operation). // For information about generating CPE configuration content, see these operations: // * GetCpeDeviceConfigContent // * GetIpsecCpeDeviceConfigContent // * GetTunnelCpeDeviceConfigContent func (client VirtualNetworkClient) ListCpeDeviceShapes(ctx context.Context, request ListCpeDeviceShapesRequest) (response ListCpeDeviceShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listCpeDeviceShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListCpeDeviceShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListCpeDeviceShapesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListCpeDeviceShapesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListCpeDeviceShapesResponse") } return } // listCpeDeviceShapes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listCpeDeviceShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/cpeDeviceShapes") if err != nil { return nil, err } var response ListCpeDeviceShapesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListCpes Lists the customer-premises equipment objects (CPEs) in the specified compartment. func (client VirtualNetworkClient) ListCpes(ctx context.Context, request ListCpesRequest) (response ListCpesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listCpes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListCpesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListCpesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListCpesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListCpesResponse") } return } // listCpes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listCpes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/cpes") if err != nil { return nil, err } var response ListCpesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListCrossConnectGroups Lists the cross-connect groups in the specified compartment. func (client VirtualNetworkClient) ListCrossConnectGroups(ctx context.Context, request ListCrossConnectGroupsRequest) (response ListCrossConnectGroupsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listCrossConnectGroups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListCrossConnectGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListCrossConnectGroupsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListCrossConnectGroupsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListCrossConnectGroupsResponse") } return } // listCrossConnectGroups implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listCrossConnectGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectGroups") if err != nil { return nil, err } var response ListCrossConnectGroupsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListCrossConnectLocations Lists the available FastConnect locations for cross-connect installation. You need // this information so you can specify your desired location when you create a cross-connect. func (client VirtualNetworkClient) ListCrossConnectLocations(ctx context.Context, request ListCrossConnectLocationsRequest) (response ListCrossConnectLocationsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listCrossConnectLocations, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListCrossConnectLocationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListCrossConnectLocationsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListCrossConnectLocationsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListCrossConnectLocationsResponse") } return } // listCrossConnectLocations implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listCrossConnectLocations(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectLocations") if err != nil { return nil, err } var response ListCrossConnectLocationsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListCrossConnects Lists the cross-connects in the specified compartment. You can filter the list // by specifying the OCID of a cross-connect group. func (client VirtualNetworkClient) ListCrossConnects(ctx context.Context, request ListCrossConnectsRequest) (response ListCrossConnectsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listCrossConnects, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListCrossConnectsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListCrossConnectsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListCrossConnectsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListCrossConnectsResponse") } return } // listCrossConnects implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listCrossConnects(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnects") if err != nil { return nil, err } var response ListCrossConnectsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListCrossconnectPortSpeedShapes Lists the available port speeds for cross-connects. You need this information // so you can specify your desired port speed (that is, shape) when you create a // cross-connect. func (client VirtualNetworkClient) ListCrossconnectPortSpeedShapes(ctx context.Context, request ListCrossconnectPortSpeedShapesRequest) (response ListCrossconnectPortSpeedShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listCrossconnectPortSpeedShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListCrossconnectPortSpeedShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListCrossconnectPortSpeedShapesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListCrossconnectPortSpeedShapesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListCrossconnectPortSpeedShapesResponse") } return } // listCrossconnectPortSpeedShapes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listCrossconnectPortSpeedShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/crossConnectPortSpeedShapes") if err != nil { return nil, err } var response ListCrossconnectPortSpeedShapesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListDhcpOptions Lists the sets of DHCP options in the specified VCN and specified compartment. // The response includes the default set of options that automatically comes with each VCN, // plus any other sets you've created. func (client VirtualNetworkClient) ListDhcpOptions(ctx context.Context, request ListDhcpOptionsRequest) (response ListDhcpOptionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listDhcpOptions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListDhcpOptionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListDhcpOptionsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListDhcpOptionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListDhcpOptionsResponse") } return } // listDhcpOptions implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/dhcps") if err != nil { return nil, err } var response ListDhcpOptionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListDrgAttachments Lists the `DrgAttachment` objects for the specified compartment. You can filter the // results by VCN or DRG. func (client VirtualNetworkClient) ListDrgAttachments(ctx context.Context, request ListDrgAttachmentsRequest) (response ListDrgAttachmentsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listDrgAttachments, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListDrgAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListDrgAttachmentsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListDrgAttachmentsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListDrgAttachmentsResponse") } return } // listDrgAttachments implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listDrgAttachments(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgAttachments") if err != nil { return nil, err } var response ListDrgAttachmentsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListDrgs Lists the DRGs in the specified compartment. func (client VirtualNetworkClient) ListDrgs(ctx context.Context, request ListDrgsRequest) (response ListDrgsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listDrgs, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListDrgsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListDrgsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListDrgsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListDrgsResponse") } return } // listDrgs implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listDrgs(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/drgs") if err != nil { return nil, err } var response ListDrgsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListFastConnectProviderServices Lists the service offerings from supported providers. You need this // information so you can specify your desired provider and service // offering when you create a virtual circuit. // For the compartment ID, provide the OCID of your tenancy (the root compartment). // For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). func (client VirtualNetworkClient) ListFastConnectProviderServices(ctx context.Context, request ListFastConnectProviderServicesRequest) (response ListFastConnectProviderServicesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listFastConnectProviderServices, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListFastConnectProviderServicesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListFastConnectProviderServicesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListFastConnectProviderServicesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListFastConnectProviderServicesResponse") } return } // listFastConnectProviderServices implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listFastConnectProviderServices(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices") if err != nil { return nil, err } var response ListFastConnectProviderServicesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListFastConnectProviderVirtualCircuitBandwidthShapes Gets the list of available virtual circuit bandwidth levels for a provider. // You need this information so you can specify your desired bandwidth level (shape) when you create a virtual circuit. // For more information about virtual circuits, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). func (client VirtualNetworkClient) ListFastConnectProviderVirtualCircuitBandwidthShapes(ctx context.Context, request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) (response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listFastConnectProviderVirtualCircuitBandwidthShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListFastConnectProviderVirtualCircuitBandwidthShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListFastConnectProviderVirtualCircuitBandwidthShapesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListFastConnectProviderVirtualCircuitBandwidthShapesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListFastConnectProviderVirtualCircuitBandwidthShapesResponse") } return } // listFastConnectProviderVirtualCircuitBandwidthShapes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listFastConnectProviderVirtualCircuitBandwidthShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/fastConnectProviderServices/{providerServiceId}/virtualCircuitBandwidthShapes") if err != nil { return nil, err } var response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListIPSecConnectionTunnels Lists the tunnel information for the specified IPSec connection. func (client VirtualNetworkClient) ListIPSecConnectionTunnels(ctx context.Context, request ListIPSecConnectionTunnelsRequest) (response ListIPSecConnectionTunnelsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listIPSecConnectionTunnels, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListIPSecConnectionTunnelsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListIPSecConnectionTunnelsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListIPSecConnectionTunnelsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListIPSecConnectionTunnelsResponse") } return } // listIPSecConnectionTunnels implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listIPSecConnectionTunnels(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections/{ipscId}/tunnels") if err != nil { return nil, err } var response ListIPSecConnectionTunnelsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListIPSecConnections Lists the IPSec connections for the specified compartment. You can filter the // results by DRG or CPE. func (client VirtualNetworkClient) ListIPSecConnections(ctx context.Context, request ListIPSecConnectionsRequest) (response ListIPSecConnectionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listIPSecConnections, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListIPSecConnectionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListIPSecConnectionsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListIPSecConnectionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListIPSecConnectionsResponse") } return } // listIPSecConnections implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listIPSecConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipsecConnections") if err != nil { return nil, err } var response ListIPSecConnectionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListInternetGateways Lists the internet gateways in the specified VCN and the specified compartment. func (client VirtualNetworkClient) ListInternetGateways(ctx context.Context, request ListInternetGatewaysRequest) (response ListInternetGatewaysResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listInternetGateways, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListInternetGatewaysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListInternetGatewaysResponse{} } } return } if convertedResponse, ok := ociResponse.(ListInternetGatewaysResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListInternetGatewaysResponse") } return } // listInternetGateways implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listInternetGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/internetGateways") if err != nil { return nil, err } var response ListInternetGatewaysResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListIpv6s Lists the Ipv6 objects based // on one of these filters: // * Subnet OCID. // * VNIC OCID. // * Both IPv6 address and subnet OCID: This lets you get an `Ipv6` object based on its private // IPv6 address (for example, 2001:0db8:0123:1111:abcd:ef01:2345:6789) and not its OCID. For comparison, // GetIpv6 requires the OCID. func (client VirtualNetworkClient) ListIpv6s(ctx context.Context, request ListIpv6sRequest) (response ListIpv6sResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listIpv6s, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListIpv6sResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListIpv6sResponse{} } } return } if convertedResponse, ok := ociResponse.(ListIpv6sResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListIpv6sResponse") } return } // listIpv6s implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listIpv6s(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/ipv6") if err != nil { return nil, err } var response ListIpv6sResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListLocalPeeringGateways Lists the local peering gateways (LPGs) for the specified VCN and compartment // (the LPG's compartment). func (client VirtualNetworkClient) ListLocalPeeringGateways(ctx context.Context, request ListLocalPeeringGatewaysRequest) (response ListLocalPeeringGatewaysResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listLocalPeeringGateways, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListLocalPeeringGatewaysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListLocalPeeringGatewaysResponse{} } } return } if convertedResponse, ok := ociResponse.(ListLocalPeeringGatewaysResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListLocalPeeringGatewaysResponse") } return } // listLocalPeeringGateways implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listLocalPeeringGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/localPeeringGateways") if err != nil { return nil, err } var response ListLocalPeeringGatewaysResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListNatGateways Lists the NAT gateways in the specified compartment. You may optionally specify a VCN OCID // to filter the results by VCN. func (client VirtualNetworkClient) ListNatGateways(ctx context.Context, request ListNatGatewaysRequest) (response ListNatGatewaysResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listNatGateways, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListNatGatewaysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListNatGatewaysResponse{} } } return } if convertedResponse, ok := ociResponse.(ListNatGatewaysResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListNatGatewaysResponse") } return } // listNatGateways implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listNatGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/natGateways") if err != nil { return nil, err } var response ListNatGatewaysResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListNetworkSecurityGroupSecurityRules Lists the security rules in the specified network security group. func (client VirtualNetworkClient) ListNetworkSecurityGroupSecurityRules(ctx context.Context, request ListNetworkSecurityGroupSecurityRulesRequest) (response ListNetworkSecurityGroupSecurityRulesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listNetworkSecurityGroupSecurityRules, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListNetworkSecurityGroupSecurityRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListNetworkSecurityGroupSecurityRulesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListNetworkSecurityGroupSecurityRulesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListNetworkSecurityGroupSecurityRulesResponse") } return } // listNetworkSecurityGroupSecurityRules implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listNetworkSecurityGroupSecurityRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkSecurityGroups/{networkSecurityGroupId}/securityRules") if err != nil { return nil, err } var response ListNetworkSecurityGroupSecurityRulesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListNetworkSecurityGroupVnics Lists the VNICs in the specified network security group. func (client VirtualNetworkClient) ListNetworkSecurityGroupVnics(ctx context.Context, request ListNetworkSecurityGroupVnicsRequest) (response ListNetworkSecurityGroupVnicsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listNetworkSecurityGroupVnics, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListNetworkSecurityGroupVnicsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListNetworkSecurityGroupVnicsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListNetworkSecurityGroupVnicsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListNetworkSecurityGroupVnicsResponse") } return } // listNetworkSecurityGroupVnics implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listNetworkSecurityGroupVnics(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkSecurityGroups/{networkSecurityGroupId}/vnics") if err != nil { return nil, err } var response ListNetworkSecurityGroupVnicsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListNetworkSecurityGroups Lists the network security groups in the specified compartment. func (client VirtualNetworkClient) ListNetworkSecurityGroups(ctx context.Context, request ListNetworkSecurityGroupsRequest) (response ListNetworkSecurityGroupsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listNetworkSecurityGroups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListNetworkSecurityGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListNetworkSecurityGroupsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListNetworkSecurityGroupsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListNetworkSecurityGroupsResponse") } return } // listNetworkSecurityGroups implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listNetworkSecurityGroups(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkSecurityGroups") if err != nil { return nil, err } var response ListNetworkSecurityGroupsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListPrivateIps Lists the PrivateIp objects based // on one of these filters: // - Subnet OCID. // - VNIC OCID. // - Both private IP address and subnet OCID: This lets // you get a `privateIP` object based on its private IP // address (for example, 10.0.3.3) and not its OCID. For comparison, // GetPrivateIp // requires the OCID. // If you're listing all the private IPs associated with a given subnet // or VNIC, the response includes both primary and secondary private IPs. func (client VirtualNetworkClient) ListPrivateIps(ctx context.Context, request ListPrivateIpsRequest) (response ListPrivateIpsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listPrivateIps, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListPrivateIpsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListPrivateIpsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListPrivateIpsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListPrivateIpsResponse") } return } // listPrivateIps implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listPrivateIps(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/privateIps") if err != nil { return nil, err } var response ListPrivateIpsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListPublicIps Lists the PublicIp objects // in the specified compartment. You can filter the list by using query parameters. // To list your reserved public IPs: // * Set `scope` = `REGION` (required) // * Leave the `availabilityDomain` parameter empty // * Set `lifetime` = `RESERVED` // To list the ephemeral public IPs assigned to a regional entity such as a NAT gateway: // * Set `scope` = `REGION` (required) // * Leave the `availabilityDomain` parameter empty // * Set `lifetime` = `EPHEMERAL` // To list the ephemeral public IPs assigned to private IPs: // * Set `scope` = `AVAILABILITY_DOMAIN` (required) // * Set the `availabilityDomain` parameter to the desired availability domain (required) // * Set `lifetime` = `EPHEMERAL` // **Note:** An ephemeral public IP assigned to a private IP // is always in the same availability domain and compartment as the private IP. func (client VirtualNetworkClient) ListPublicIps(ctx context.Context, request ListPublicIpsRequest) (response ListPublicIpsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listPublicIps, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListPublicIpsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListPublicIpsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListPublicIpsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListPublicIpsResponse") } return } // listPublicIps implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listPublicIps(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/publicIps") if err != nil { return nil, err } var response ListPublicIpsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListRemotePeeringConnections Lists the remote peering connections (RPCs) for the specified DRG and compartment // (the RPC's compartment). func (client VirtualNetworkClient) ListRemotePeeringConnections(ctx context.Context, request ListRemotePeeringConnectionsRequest) (response ListRemotePeeringConnectionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listRemotePeeringConnections, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListRemotePeeringConnectionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListRemotePeeringConnectionsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListRemotePeeringConnectionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListRemotePeeringConnectionsResponse") } return } // listRemotePeeringConnections implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listRemotePeeringConnections(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/remotePeeringConnections") if err != nil { return nil, err } var response ListRemotePeeringConnectionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListRouteTables Lists the route tables in the specified VCN and specified compartment. The response // includes the default route table that automatically comes with each VCN, plus any route tables // you've created. func (client VirtualNetworkClient) ListRouteTables(ctx context.Context, request ListRouteTablesRequest) (response ListRouteTablesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listRouteTables, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListRouteTablesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListRouteTablesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListRouteTablesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListRouteTablesResponse") } return } // listRouteTables implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listRouteTables(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/routeTables") if err != nil { return nil, err } var response ListRouteTablesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListSecurityLists Lists the security lists in the specified VCN and compartment. func (client VirtualNetworkClient) ListSecurityLists(ctx context.Context, request ListSecurityListsRequest) (response ListSecurityListsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listSecurityLists, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListSecurityListsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListSecurityListsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListSecurityListsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListSecurityListsResponse") } return } // listSecurityLists implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listSecurityLists(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/securityLists") if err != nil { return nil, err } var response ListSecurityListsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListServiceGateways Lists the service gateways in the specified compartment. You may optionally specify a VCN OCID // to filter the results by VCN. func (client VirtualNetworkClient) ListServiceGateways(ctx context.Context, request ListServiceGatewaysRequest) (response ListServiceGatewaysResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listServiceGateways, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListServiceGatewaysResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListServiceGatewaysResponse{} } } return } if convertedResponse, ok := ociResponse.(ListServiceGatewaysResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListServiceGatewaysResponse") } return } // listServiceGateways implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listServiceGateways(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/serviceGateways") if err != nil { return nil, err } var response ListServiceGatewaysResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListServices Lists the available Service objects that you can enable for a // service gateway in this region. func (client VirtualNetworkClient) ListServices(ctx context.Context, request ListServicesRequest) (response ListServicesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listServices, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListServicesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListServicesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListServicesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListServicesResponse") } return } // listServices implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listServices(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/services") if err != nil { return nil, err } var response ListServicesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListSubnets Lists the subnets in the specified VCN and the specified compartment. func (client VirtualNetworkClient) ListSubnets(ctx context.Context, request ListSubnetsRequest) (response ListSubnetsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listSubnets, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListSubnetsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListSubnetsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListSubnetsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListSubnetsResponse") } return } // listSubnets implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listSubnets(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/subnets") if err != nil { return nil, err } var response ListSubnetsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVcns Lists the virtual cloud networks (VCNs) in the specified compartment. func (client VirtualNetworkClient) ListVcns(ctx context.Context, request ListVcnsRequest) (response ListVcnsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVcns, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVcnsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVcnsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVcnsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVcnsResponse") } return } // listVcns implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listVcns(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/vcns") if err != nil { return nil, err } var response ListVcnsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVirtualCircuitBandwidthShapes The deprecated operation lists available bandwidth levels for virtual circuits. For the compartment ID, provide the OCID of your tenancy (the root compartment). func (client VirtualNetworkClient) ListVirtualCircuitBandwidthShapes(ctx context.Context, request ListVirtualCircuitBandwidthShapesRequest) (response ListVirtualCircuitBandwidthShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVirtualCircuitBandwidthShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVirtualCircuitBandwidthShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVirtualCircuitBandwidthShapesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVirtualCircuitBandwidthShapesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVirtualCircuitBandwidthShapesResponse") } return } // listVirtualCircuitBandwidthShapes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listVirtualCircuitBandwidthShapes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuitBandwidthShapes") if err != nil { return nil, err } var response ListVirtualCircuitBandwidthShapesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVirtualCircuitPublicPrefixes Lists the public IP prefixes and their details for the specified // public virtual circuit. func (client VirtualNetworkClient) ListVirtualCircuitPublicPrefixes(ctx context.Context, request ListVirtualCircuitPublicPrefixesRequest) (response ListVirtualCircuitPublicPrefixesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVirtualCircuitPublicPrefixes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVirtualCircuitPublicPrefixesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVirtualCircuitPublicPrefixesResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVirtualCircuitPublicPrefixesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVirtualCircuitPublicPrefixesResponse") } return } // listVirtualCircuitPublicPrefixes implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listVirtualCircuitPublicPrefixes(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuits/{virtualCircuitId}/publicPrefixes") if err != nil { return nil, err } var response ListVirtualCircuitPublicPrefixesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // ListVirtualCircuits Lists the virtual circuits in the specified compartment. func (client VirtualNetworkClient) ListVirtualCircuits(ctx context.Context, request ListVirtualCircuitsRequest) (response ListVirtualCircuitsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.listVirtualCircuits, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = ListVirtualCircuitsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = ListVirtualCircuitsResponse{} } } return } if convertedResponse, ok := ociResponse.(ListVirtualCircuitsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into ListVirtualCircuitsResponse") } return } // listVirtualCircuits implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) listVirtualCircuits(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodGet, "/virtualCircuits") if err != nil { return nil, err } var response ListVirtualCircuitsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // RemoveNetworkSecurityGroupSecurityRules Removes one or more security rules from the specified network security group. func (client VirtualNetworkClient) RemoveNetworkSecurityGroupSecurityRules(ctx context.Context, request RemoveNetworkSecurityGroupSecurityRulesRequest) (response RemoveNetworkSecurityGroupSecurityRulesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.removeNetworkSecurityGroupSecurityRules, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = RemoveNetworkSecurityGroupSecurityRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = RemoveNetworkSecurityGroupSecurityRulesResponse{} } } return } if convertedResponse, ok := ociResponse.(RemoveNetworkSecurityGroupSecurityRulesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into RemoveNetworkSecurityGroupSecurityRulesResponse") } return } // removeNetworkSecurityGroupSecurityRules implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) removeNetworkSecurityGroupSecurityRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkSecurityGroups/{networkSecurityGroupId}/actions/removeSecurityRules") if err != nil { return nil, err } var response RemoveNetworkSecurityGroupSecurityRulesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateCpe Updates the specified CPE's display name or tags. // Avoid entering confidential information. func (client VirtualNetworkClient) UpdateCpe(ctx context.Context, request UpdateCpeRequest) (response UpdateCpeResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateCpe, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateCpeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateCpeResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateCpeResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateCpeResponse") } return } // updateCpe implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateCpe(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/cpes/{cpeId}") if err != nil { return nil, err } var response UpdateCpeResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateCrossConnect Updates the specified cross-connect. func (client VirtualNetworkClient) UpdateCrossConnect(ctx context.Context, request UpdateCrossConnectRequest) (response UpdateCrossConnectResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateCrossConnect, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateCrossConnectResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateCrossConnectResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateCrossConnectResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateCrossConnectResponse") } return } // updateCrossConnect implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateCrossConnect(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/crossConnects/{crossConnectId}") if err != nil { return nil, err } var response UpdateCrossConnectResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateCrossConnectGroup Updates the specified cross-connect group's display name. // Avoid entering confidential information. func (client VirtualNetworkClient) UpdateCrossConnectGroup(ctx context.Context, request UpdateCrossConnectGroupRequest) (response UpdateCrossConnectGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateCrossConnectGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateCrossConnectGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateCrossConnectGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateCrossConnectGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateCrossConnectGroupResponse") } return } // updateCrossConnectGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateCrossConnectGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/crossConnectGroups/{crossConnectGroupId}") if err != nil { return nil, err } var response UpdateCrossConnectGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateDhcpOptions Updates the specified set of DHCP options. You can update the display name or the options // themselves. Avoid entering confidential information. // Note that the `options` object you provide replaces the entire existing set of options. func (client VirtualNetworkClient) UpdateDhcpOptions(ctx context.Context, request UpdateDhcpOptionsRequest) (response UpdateDhcpOptionsResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateDhcpOptions, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateDhcpOptionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateDhcpOptionsResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateDhcpOptionsResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateDhcpOptionsResponse") } return } // updateDhcpOptions implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateDhcpOptions(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/dhcps/{dhcpId}") if err != nil { return nil, err } var response UpdateDhcpOptionsResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateDrg Updates the specified DRG's display name or tags. Avoid entering confidential information. func (client VirtualNetworkClient) UpdateDrg(ctx context.Context, request UpdateDrgRequest) (response UpdateDrgResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateDrg, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateDrgResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateDrgResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateDrgResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateDrgResponse") } return } // updateDrg implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateDrg(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/drgs/{drgId}") if err != nil { return nil, err } var response UpdateDrgResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateDrgAttachment Updates the display name for the specified `DrgAttachment`. // Avoid entering confidential information. func (client VirtualNetworkClient) UpdateDrgAttachment(ctx context.Context, request UpdateDrgAttachmentRequest) (response UpdateDrgAttachmentResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateDrgAttachment, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateDrgAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateDrgAttachmentResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateDrgAttachmentResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateDrgAttachmentResponse") } return } // updateDrgAttachment implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateDrgAttachment(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/drgAttachments/{drgAttachmentId}") if err != nil { return nil, err } var response UpdateDrgAttachmentResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateIPSecConnection Updates the specified IPSec connection. // To update an individual IPSec tunnel's attributes, use // UpdateIPSecConnectionTunnel. func (client VirtualNetworkClient) UpdateIPSecConnection(ctx context.Context, request UpdateIPSecConnectionRequest) (response UpdateIPSecConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateIPSecConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateIPSecConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateIPSecConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateIPSecConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateIPSecConnectionResponse") } return } // updateIPSecConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateIPSecConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipsecConnections/{ipscId}") if err != nil { return nil, err } var response UpdateIPSecConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateIPSecConnectionTunnel Updates the specified tunnel. This operation lets you change tunnel attributes such as the // routing type (BGP dynamic routing or static routing). Here are some important notes: // * If you change the tunnel's routing type or BGP session configuration, the tunnel will go // down while it's reprovisioned. // * If you want to switch the tunnel's `routing` from `STATIC` to `BGP`, make sure the tunnel's // BGP session configuration attributes have been set (BgpSessionInfo). // * If you want to switch the tunnel's `routing` from `BGP` to `STATIC`, make sure the // IPSecConnection already has at least one valid CIDR // static route. func (client VirtualNetworkClient) UpdateIPSecConnectionTunnel(ctx context.Context, request UpdateIPSecConnectionTunnelRequest) (response UpdateIPSecConnectionTunnelResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateIPSecConnectionTunnel, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateIPSecConnectionTunnelResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateIPSecConnectionTunnelResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateIPSecConnectionTunnelResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateIPSecConnectionTunnelResponse") } return } // updateIPSecConnectionTunnel implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateIPSecConnectionTunnel(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}") if err != nil { return nil, err } var response UpdateIPSecConnectionTunnelResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateIPSecConnectionTunnelSharedSecret Updates the shared secret (pre-shared key) for the specified tunnel. // **Important:** If you change the shared secret, the tunnel will go down while it's reprovisioned. func (client VirtualNetworkClient) UpdateIPSecConnectionTunnelSharedSecret(ctx context.Context, request UpdateIPSecConnectionTunnelSharedSecretRequest) (response UpdateIPSecConnectionTunnelSharedSecretResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateIPSecConnectionTunnelSharedSecret, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateIPSecConnectionTunnelSharedSecretResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateIPSecConnectionTunnelSharedSecretResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateIPSecConnectionTunnelSharedSecretResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateIPSecConnectionTunnelSharedSecretResponse") } return } // updateIPSecConnectionTunnelSharedSecret implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateIPSecConnectionTunnelSharedSecret(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}/sharedSecret") if err != nil { return nil, err } var response UpdateIPSecConnectionTunnelSharedSecretResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateInternetGateway Updates the specified internet gateway. You can disable/enable it, or change its display name // or tags. Avoid entering confidential information. // If the gateway is disabled, that means no traffic will flow to/from the internet even if there's // a route rule that enables that traffic. func (client VirtualNetworkClient) UpdateInternetGateway(ctx context.Context, request UpdateInternetGatewayRequest) (response UpdateInternetGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateInternetGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateInternetGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateInternetGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateInternetGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateInternetGatewayResponse") } return } // updateInternetGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateInternetGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/internetGateways/{igId}") if err != nil { return nil, err } var response UpdateInternetGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateIpv6 Updates the specified IPv6. You must specify the object's OCID. // Use this operation if you want to: // * Move an IPv6 to a different VNIC in the same subnet. // * Enable/disable internet access for an IPv6. // * Change the display name for an IPv6. // * Update resource tags for an IPv6. func (client VirtualNetworkClient) UpdateIpv6(ctx context.Context, request UpdateIpv6Request) (response UpdateIpv6Response, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateIpv6, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateIpv6Response{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateIpv6Response{} } } return } if convertedResponse, ok := ociResponse.(UpdateIpv6Response); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateIpv6Response") } return } // updateIpv6 implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateIpv6(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipv6/{ipv6Id}") if err != nil { return nil, err } var response UpdateIpv6Response var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateLocalPeeringGateway Updates the specified local peering gateway (LPG). func (client VirtualNetworkClient) UpdateLocalPeeringGateway(ctx context.Context, request UpdateLocalPeeringGatewayRequest) (response UpdateLocalPeeringGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateLocalPeeringGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateLocalPeeringGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateLocalPeeringGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateLocalPeeringGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateLocalPeeringGatewayResponse") } return } // updateLocalPeeringGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateLocalPeeringGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/localPeeringGateways/{localPeeringGatewayId}") if err != nil { return nil, err } var response UpdateLocalPeeringGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateNatGateway Updates the specified NAT gateway. func (client VirtualNetworkClient) UpdateNatGateway(ctx context.Context, request UpdateNatGatewayRequest) (response UpdateNatGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateNatGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateNatGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateNatGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateNatGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateNatGatewayResponse") } return } // updateNatGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateNatGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/natGateways/{natGatewayId}") if err != nil { return nil, err } var response UpdateNatGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateNetworkSecurityGroup Updates the specified network security group. // To add or remove an existing VNIC from the group, use // UpdateVnic. // To add a VNIC to the group *when you create the VNIC*, specify the NSG's OCID during creation. // For example, see the `nsgIds` attribute in CreateVnicDetails. // To add or remove security rules from the group, use // AddNetworkSecurityGroupSecurityRules // or // RemoveNetworkSecurityGroupSecurityRules. // To edit the contents of existing security rules in the group, use // UpdateNetworkSecurityGroupSecurityRules. func (client VirtualNetworkClient) UpdateNetworkSecurityGroup(ctx context.Context, request UpdateNetworkSecurityGroupRequest) (response UpdateNetworkSecurityGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateNetworkSecurityGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateNetworkSecurityGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateNetworkSecurityGroupResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateNetworkSecurityGroupResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateNetworkSecurityGroupResponse") } return } // updateNetworkSecurityGroup implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateNetworkSecurityGroup(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/networkSecurityGroups/{networkSecurityGroupId}") if err != nil { return nil, err } var response UpdateNetworkSecurityGroupResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateNetworkSecurityGroupSecurityRules Updates one or more security rules in the specified network security group. func (client VirtualNetworkClient) UpdateNetworkSecurityGroupSecurityRules(ctx context.Context, request UpdateNetworkSecurityGroupSecurityRulesRequest) (response UpdateNetworkSecurityGroupSecurityRulesResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateNetworkSecurityGroupSecurityRules, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateNetworkSecurityGroupSecurityRulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateNetworkSecurityGroupSecurityRulesResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateNetworkSecurityGroupSecurityRulesResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateNetworkSecurityGroupSecurityRulesResponse") } return } // updateNetworkSecurityGroupSecurityRules implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateNetworkSecurityGroupSecurityRules(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPost, "/networkSecurityGroups/{networkSecurityGroupId}/actions/updateSecurityRules") if err != nil { return nil, err } var response UpdateNetworkSecurityGroupSecurityRulesResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdatePrivateIp Updates the specified private IP. You must specify the object's OCID. // Use this operation if you want to: // - Move a secondary private IP to a different VNIC in the same subnet. // - Change the display name for a secondary private IP. // - Change the hostname for a secondary private IP. // This operation cannot be used with primary private IPs. // To update the hostname for the primary IP on a VNIC, use // UpdateVnic. func (client VirtualNetworkClient) UpdatePrivateIp(ctx context.Context, request UpdatePrivateIpRequest) (response UpdatePrivateIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updatePrivateIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdatePrivateIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdatePrivateIpResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdatePrivateIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdatePrivateIpResponse") } return } // updatePrivateIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updatePrivateIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/privateIps/{privateIpId}") if err != nil { return nil, err } var response UpdatePrivateIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdatePublicIp Updates the specified public IP. You must specify the object's OCID. Use this operation if you want to: // * Assign a reserved public IP in your pool to a private IP. // * Move a reserved public IP to a different private IP. // * Unassign a reserved public IP from a private IP (which returns it to your pool // of reserved public IPs). // * Change the display name or tags for a public IP. // Assigning, moving, and unassigning a reserved public IP are asynchronous // operations. Poll the public IP's `lifecycleState` to determine if the operation // succeeded. // **Note:** When moving a reserved public IP, the target private IP // must not already have a public IP with `lifecycleState` = ASSIGNING or ASSIGNED. If it // does, an error is returned. Also, the initial unassignment from the original // private IP always succeeds, but the assignment to the target private IP is asynchronous and // could fail silently (for example, if the target private IP is deleted or has a different public IP // assigned to it in the interim). If that occurs, the public IP remains unassigned and its // `lifecycleState` switches to AVAILABLE (it is not reassigned to its original private IP). // You must poll the public IP's `lifecycleState` to determine if the move succeeded. // Regarding ephemeral public IPs: // * If you want to assign an ephemeral public IP to a primary private IP, use // CreatePublicIp. // * You can't move an ephemeral public IP to a different private IP. // * If you want to unassign an ephemeral public IP from its private IP, use // DeletePublicIp, which // unassigns and deletes the ephemeral public IP. // **Note:** If a public IP is assigned to a secondary private // IP (see PrivateIp), and you move that secondary // private IP to another VNIC, the public IP moves with it. // **Note:** There's a limit to the number of PublicIp // a VNIC or instance can have. If you try to move a reserved public IP // to a VNIC or instance that has already reached its public IP limit, an error is // returned. For information about the public IP limits, see // Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). func (client VirtualNetworkClient) UpdatePublicIp(ctx context.Context, request UpdatePublicIpRequest) (response UpdatePublicIpResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updatePublicIp, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdatePublicIpResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdatePublicIpResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdatePublicIpResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdatePublicIpResponse") } return } // updatePublicIp implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updatePublicIp(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/publicIps/{publicIpId}") if err != nil { return nil, err } var response UpdatePublicIpResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateRemotePeeringConnection Updates the specified remote peering connection (RPC). func (client VirtualNetworkClient) UpdateRemotePeeringConnection(ctx context.Context, request UpdateRemotePeeringConnectionRequest) (response UpdateRemotePeeringConnectionResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateRemotePeeringConnection, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateRemotePeeringConnectionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateRemotePeeringConnectionResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateRemotePeeringConnectionResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateRemotePeeringConnectionResponse") } return } // updateRemotePeeringConnection implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateRemotePeeringConnection(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/remotePeeringConnections/{remotePeeringConnectionId}") if err != nil { return nil, err } var response UpdateRemotePeeringConnectionResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateRouteTable Updates the specified route table's display name or route rules. // Avoid entering confidential information. // Note that the `routeRules` object you provide replaces the entire existing set of rules. func (client VirtualNetworkClient) UpdateRouteTable(ctx context.Context, request UpdateRouteTableRequest) (response UpdateRouteTableResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateRouteTable, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateRouteTableResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateRouteTableResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateRouteTableResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateRouteTableResponse") } return } // updateRouteTable implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateRouteTable(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/routeTables/{rtId}") if err != nil { return nil, err } var response UpdateRouteTableResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateSecurityList Updates the specified security list's display name or rules. // Avoid entering confidential information. // Note that the `egressSecurityRules` or `ingressSecurityRules` objects you provide replace the entire // existing objects. func (client VirtualNetworkClient) UpdateSecurityList(ctx context.Context, request UpdateSecurityListRequest) (response UpdateSecurityListResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateSecurityList, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateSecurityListResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateSecurityListResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateSecurityListResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateSecurityListResponse") } return } // updateSecurityList implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateSecurityList(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/securityLists/{securityListId}") if err != nil { return nil, err } var response UpdateSecurityListResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateServiceGateway Updates the specified service gateway. The information you provide overwrites the existing // attributes of the gateway. func (client VirtualNetworkClient) UpdateServiceGateway(ctx context.Context, request UpdateServiceGatewayRequest) (response UpdateServiceGatewayResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateServiceGateway, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateServiceGatewayResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateServiceGatewayResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateServiceGatewayResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateServiceGatewayResponse") } return } // updateServiceGateway implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateServiceGateway(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/serviceGateways/{serviceGatewayId}") if err != nil { return nil, err } var response UpdateServiceGatewayResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateSubnet Updates the specified subnet. func (client VirtualNetworkClient) UpdateSubnet(ctx context.Context, request UpdateSubnetRequest) (response UpdateSubnetResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateSubnet, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateSubnetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateSubnetResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateSubnetResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateSubnetResponse") } return } // updateSubnet implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateSubnet(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/subnets/{subnetId}") if err != nil { return nil, err } var response UpdateSubnetResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateTunnelCpeDeviceConfig Creates or updates the set of CPE configuration answers for the specified tunnel. // The answers correlate to the questions that are specific to the CPE device type (see the // `parameters` attribute of CpeDeviceShapeDetail). func (client VirtualNetworkClient) UpdateTunnelCpeDeviceConfig(ctx context.Context, request UpdateTunnelCpeDeviceConfigRequest) (response UpdateTunnelCpeDeviceConfigResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { request.OpcRetryToken = common.String(common.RetryToken()) } ociResponse, err = common.Retry(ctx, request, client.updateTunnelCpeDeviceConfig, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateTunnelCpeDeviceConfigResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateTunnelCpeDeviceConfigResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateTunnelCpeDeviceConfigResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateTunnelCpeDeviceConfigResponse") } return } // updateTunnelCpeDeviceConfig implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateTunnelCpeDeviceConfig(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/ipsecConnections/{ipscId}/tunnels/{tunnelId}/tunnelDeviceConfig") if err != nil { return nil, err } var response UpdateTunnelCpeDeviceConfigResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVcn Updates the specified VCN. func (client VirtualNetworkClient) UpdateVcn(ctx context.Context, request UpdateVcnRequest) (response UpdateVcnResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVcn, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateVcnResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateVcnResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateVcnResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVcnResponse") } return } // updateVcn implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateVcn(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/vcns/{vcnId}") if err != nil { return nil, err } var response UpdateVcnResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVirtualCircuit Updates the specified virtual circuit. This can be called by // either the customer who owns the virtual circuit, or the // provider (when provisioning or de-provisioning the virtual // circuit from their end). The documentation for // UpdateVirtualCircuitDetails // indicates who can update each property of the virtual circuit. // **Important:** If the virtual circuit is working and in the // PROVISIONED state, updating any of the network-related properties // (such as the DRG being used, the BGP ASN, and so on) will cause the virtual // circuit's state to switch to PROVISIONING and the related BGP // session to go down. After Oracle re-provisions the virtual circuit, // its state will return to PROVISIONED. Make sure you confirm that // the associated BGP session is back up. For more information // about the various states and how to test connectivity, see // FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // To change the list of public IP prefixes for a public virtual circuit, // use BulkAddVirtualCircuitPublicPrefixes // and // BulkDeleteVirtualCircuitPublicPrefixes. // Updating the list of prefixes does NOT cause the BGP session to go down. However, // Oracle must verify the customer's ownership of each added prefix before // traffic for that prefix will flow across the virtual circuit. func (client VirtualNetworkClient) UpdateVirtualCircuit(ctx context.Context, request UpdateVirtualCircuitRequest) (response UpdateVirtualCircuitResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVirtualCircuit, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateVirtualCircuitResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateVirtualCircuitResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateVirtualCircuitResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVirtualCircuitResponse") } return } // updateVirtualCircuit implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateVirtualCircuit(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/virtualCircuits/{virtualCircuitId}") if err != nil { return nil, err } var response UpdateVirtualCircuitResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } // UpdateVnic Updates the specified VNIC. func (client VirtualNetworkClient) UpdateVnic(ctx context.Context, request UpdateVnicRequest) (response UpdateVnicResponse, err error) { var ociResponse common.OCIResponse policy := common.NoRetryPolicy() if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } ociResponse, err = common.Retry(ctx, request, client.updateVnic, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") response = UpdateVnicResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { response = UpdateVnicResponse{} } } return } if convertedResponse, ok := ociResponse.(UpdateVnicResponse); ok { response = convertedResponse } else { err = fmt.Errorf("failed to convert OCIResponse into UpdateVnicResponse") } return } // updateVnic implements the OCIOperation interface (enables retrying operations) func (client VirtualNetworkClient) updateVnic(ctx context.Context, request common.OCIRequest) (common.OCIResponse, error) { httpRequest, err := request.HTTPRequest(http.MethodPut, "/vnics/{vnicId}") if err != nil { return nil, err } var response UpdateVnicResponse var httpResponse *http.Response httpResponse, err = client.Call(ctx, &httpRequest) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { return response, err } err = common.UnmarshalResponse(httpResponse, &response) return response, err } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cpe.go������������������������������������0000664�0000000�0000000�00000007617�13771713062�0024261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Cpe An object you create when setting up an IPSec VPN between your on-premises network // and VCN. The `Cpe` is a virtual representation of your customer-premises equipment, // which is the actual router on-premises at your site at your end of the IPSec VPN connection. // For more information, // see Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Cpe struct { // The OCID of the compartment containing the CPE. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The CPE's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The public IP address of the on-premises router. IpAddress *string `mandatory:"true" json:"ipAddress"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the CPE's device type. // The Networking service maintains a general list of CPE device types (for example, // Cisco ASA). For each type, Oracle provides CPE configuration content that can help // a network engineer configure the CPE. The OCID uniquely identifies the type of // device. To get the OCIDs for the device types on the list, see // ListCpeDeviceShapes. // For information about how to generate CPE configuration content for a // CPE device type, see: // * GetCpeDeviceConfigContent // * GetIpsecCpeDeviceConfigContent // * GetTunnelCpeDeviceConfigContent // * GetTunnelCpeDeviceConfig CpeDeviceShapeId *string `mandatory:"false" json:"cpeDeviceShapeId"` // The date and time the CPE was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m Cpe) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cpe_device_config_answer.go���������������0000664�0000000�0000000�00000002672�13771713062�0030500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CpeDeviceConfigAnswer An individual answer to a CPE device question. // The answers correlate to the questions that are specific to the CPE device type (see the // `parameters` attribute of CpeDeviceShapeDetail). type CpeDeviceConfigAnswer struct { // A string that identifies the question to be answered. See the `key` attribute in // CpeDeviceConfigQuestion. Key *string `mandatory:"false" json:"key"` // The answer to the question. Value *string `mandatory:"false" json:"value"` } func (m CpeDeviceConfigAnswer) String() string { return common.PointerString(m) } ����������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cpe_device_config_question.go�������������0000664�0000000�0000000�00000003105�13771713062�0031040�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CpeDeviceConfigQuestion An individual question that the customer can answer about the CPE device. // The customer provides answers to these questions in // UpdateTunnelCpeDeviceConfig. type CpeDeviceConfigQuestion struct { // A string that identifies the question. Key *string `mandatory:"false" json:"key"` // A descriptive label for the question (for example, to display in a form in a graphical interface). DisplayName *string `mandatory:"false" json:"displayName"` // A description or explanation of the question, to help the customer answer accurately. Explanation *string `mandatory:"false" json:"explanation"` } func (m CpeDeviceConfigQuestion) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cpe_device_info.go������������������������0000664�0000000�0000000�00000002423�13771713062�0026601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CpeDeviceInfo Basic information about a particular CPE device type. type CpeDeviceInfo struct { // The vendor that makes the CPE device. Vendor *string `mandatory:"false" json:"vendor"` // The platform or software version of the CPE device. PlatformSoftwareVersion *string `mandatory:"false" json:"platformSoftwareVersion"` } func (m CpeDeviceInfo) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cpe_device_shape_detail.go����������������0000664�0000000�0000000�00000004373�13771713062�0030276�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CpeDeviceShapeDetail The detailed information about a particular CPE device type. Compare with // CpeDeviceShapeSummary. type CpeDeviceShapeDetail struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the CPE device shape. // This value uniquely identifies the type of CPE device. CpeDeviceShapeId *string `mandatory:"false" json:"cpeDeviceShapeId"` // Basic information about this particular CPE device type. CpeDeviceInfo *CpeDeviceInfo `mandatory:"false" json:"cpeDeviceInfo"` // For certain CPE devices types, the customer can provide answers to // questions that are specific to the device type. This attribute contains // a list of those questions. The Networking service merges the answers with // other information and renders a set of CPE configuration content. To // provide the answers, use // UpdateTunnelCpeDeviceConfig. Parameters []CpeDeviceConfigQuestion `mandatory:"false" json:"parameters"` // A template of CPE device configuration information that will be merged with the customer's // answers to the questions to render the final CPE device configuration content. Also see: // * GetCpeDeviceConfigContent // * GetIpsecCpeDeviceConfigContent // * GetTunnelCpeDeviceConfigContent Template *string `mandatory:"false" json:"template"` } func (m CpeDeviceShapeDetail) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cpe_device_shape_summary.go���������������0000664�0000000�0000000�00000002710�13771713062�0030522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CpeDeviceShapeSummary A summary of information about a particular CPE device type. Compare with // CpeDeviceShapeDetail. type CpeDeviceShapeSummary struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the CPE device shape. // This value uniquely identifies the type of CPE device. Id *string `mandatory:"false" json:"id"` // Basic information about this particular CPE device type. CpeDeviceInfo *CpeDeviceInfo `mandatory:"false" json:"cpeDeviceInfo"` } func (m CpeDeviceShapeSummary) String() string { return common.PointerString(m) } ��������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_app_catalog_subscription_details.go0000664�0000000�0000000�00000003627�13771713062�0033615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateAppCatalogSubscriptionDetails details for creating a subscription for a listing resource version. type CreateAppCatalogSubscriptionDetails struct { // The compartmentID for the subscription. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the listing. ListingId *string `mandatory:"true" json:"listingId"` // Listing resource version. ListingResourceVersion *string `mandatory:"true" json:"listingResourceVersion"` // Oracle TOU link OracleTermsOfUseLink *string `mandatory:"true" json:"oracleTermsOfUseLink"` // Date and time the agreements were retrieved, in RFC3339 format. // Example: `2018-03-20T12:32:53.532Z` TimeRetrieved *common.SDKTime `mandatory:"true" json:"timeRetrieved"` // A generated signature for this listing resource version retrieved the agreements API. Signature *string `mandatory:"true" json:"signature"` // EULA link EulaLink *string `mandatory:"false" json:"eulaLink"` } func (m CreateAppCatalogSubscriptionDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������create_app_catalog_subscription_request_response.go�������������������������������������������������0000664�0000000�0000000�00000006150�13771713062�0035511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateAppCatalogSubscriptionRequest wrapper for the CreateAppCatalogSubscription operation type CreateAppCatalogSubscriptionRequest struct { // Request for the creation of a subscription for listing resource version for a compartment. CreateAppCatalogSubscriptionDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateAppCatalogSubscriptionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateAppCatalogSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateAppCatalogSubscriptionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateAppCatalogSubscriptionResponse wrapper for the CreateAppCatalogSubscription operation type CreateAppCatalogSubscriptionResponse struct { // The underlying http response RawResponse *http.Response // The AppCatalogSubscription instance AppCatalogSubscription `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateAppCatalogSubscriptionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateAppCatalogSubscriptionResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_backup_details.go������0000664�0000000�0000000�00000006376�13771713062�0032422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateBootVolumeBackupDetails The representation of CreateBootVolumeBackupDetails type CreateBootVolumeBackupDetails struct { // The OCID of the boot volume that needs to be backed up. BootVolumeId *string `mandatory:"true" json:"bootVolumeId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the boot volume backup. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The type of backup to create. If omitted, defaults to incremental. Type CreateBootVolumeBackupDetailsTypeEnum `mandatory:"false" json:"type,omitempty"` } func (m CreateBootVolumeBackupDetails) String() string { return common.PointerString(m) } // CreateBootVolumeBackupDetailsTypeEnum Enum with underlying type: string type CreateBootVolumeBackupDetailsTypeEnum string // Set of constants representing the allowable values for CreateBootVolumeBackupDetailsTypeEnum const ( CreateBootVolumeBackupDetailsTypeFull CreateBootVolumeBackupDetailsTypeEnum = "FULL" CreateBootVolumeBackupDetailsTypeIncremental CreateBootVolumeBackupDetailsTypeEnum = "INCREMENTAL" ) var mappingCreateBootVolumeBackupDetailsType = map[string]CreateBootVolumeBackupDetailsTypeEnum{ "FULL": CreateBootVolumeBackupDetailsTypeFull, "INCREMENTAL": CreateBootVolumeBackupDetailsTypeIncremental, } // GetCreateBootVolumeBackupDetailsTypeEnumValues Enumerates the set of values for CreateBootVolumeBackupDetailsTypeEnum func GetCreateBootVolumeBackupDetailsTypeEnumValues() []CreateBootVolumeBackupDetailsTypeEnum { values := make([]CreateBootVolumeBackupDetailsTypeEnum, 0) for _, v := range mappingCreateBootVolumeBackupDetailsType { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_boot_volume_backup_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005756�13771713062�0034325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateBootVolumeBackupRequest wrapper for the CreateBootVolumeBackup operation type CreateBootVolumeBackupRequest struct { // Request to create a new backup of given boot volume. CreateBootVolumeBackupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateBootVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateBootVolumeBackupResponse wrapper for the CreateBootVolumeBackup operation type CreateBootVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeBackup instance BootVolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateBootVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateBootVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_details.go�������������0000664�0000000�0000000�00000011712�13771713062�0031063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateBootVolumeDetails The representation of CreateBootVolumeDetails type CreateBootVolumeDetails struct { // The availability domain of the boot volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the boot volume. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Specifies the boot volume source details for a new boot volume. The volume source is either another boot volume in the same availability domain or a boot volume backup. // This is a mandatory field for a boot volume. SourceDetails BootVolumeSourceDetails `mandatory:"true" json:"sourceDetails"` // If provided, specifies the ID of the boot volume backup policy to assign to the newly // created boot volume. If omitted, no policy will be assigned. BackupPolicyId *string `mandatory:"false" json:"backupPolicyId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the Key Management key to assign as the master encryption key // for the boot volume. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` // The size of the volume in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The number of volume performance units (VPUs) that will be applied to this volume per GB, // representing the Block Volume service's elastic performance options. // See Block Volume Elastic Performance (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumeelasticperformance.htm) for more information. // Allowed values: // * `10`: Represents Balanced option. // * `20`: Represents Higher Performance option. VpusPerGB *int64 `mandatory:"false" json:"vpusPerGB"` } func (m CreateBootVolumeDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *CreateBootVolumeDetails) UnmarshalJSON(data []byte) (e error) { model := struct { BackupPolicyId *string `json:"backupPolicyId"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` KmsKeyId *string `json:"kmsKeyId"` SizeInGBs *int64 `json:"sizeInGBs"` VpusPerGB *int64 `json:"vpusPerGB"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` SourceDetails bootvolumesourcedetails `json:"sourceDetails"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.BackupPolicyId = model.BackupPolicyId m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.KmsKeyId = model.KmsKeyId m.SizeInGBs = model.SizeInGBs m.VpusPerGB = model.VpusPerGB m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(BootVolumeSourceDetails) } else { m.SourceDetails = nil } return } ������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_boot_volume_request_response.go����0000664�0000000�0000000�00000005612�13771713062�0033046�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateBootVolumeRequest wrapper for the CreateBootVolume operation type CreateBootVolumeRequest struct { // Request to create a new boot volume. CreateBootVolumeDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateBootVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateBootVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateBootVolumeResponse wrapper for the CreateBootVolume operation type CreateBootVolumeResponse struct { // The underlying http response RawResponse *http.Response // The BootVolume instance BootVolume `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateBootVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateBootVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_cluster_network_details.go���������0000664�0000000�0000000�00000005071�13771713062�0031764�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateClusterNetworkDetails The data to create a cluster network. type CreateClusterNetworkDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment // containing the cluster network. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The data to create the instance pools in the cluster network. // Each cluster network can have one instance pool. InstancePools []CreateClusterNetworkInstancePoolDetails `mandatory:"true" json:"instancePools"` // The placement configuration for the instance pools in the cluster network. PlacementConfiguration *ClusterNetworkPlacementConfigurationDetails `mandatory:"true" json:"placementConfiguration"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the cluster network. Does not have to be unique, and it's // changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateClusterNetworkDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_cluster_network_instance_pool_details.go�����������������������������������������������������0000664�0000000�0000000�00000004665�13771713062�0034632�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateClusterNetworkInstancePoolDetails The data to create an instance pool in a cluster network. type CreateClusterNetworkInstancePoolDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance configuration // associated with the instance pool. InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` // The number of instances that should be in the instance pool. // If the required number of instances is not available or if some instances fail to launch, // the cluster network is not created. Size *int `mandatory:"true" json:"size"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateClusterNetworkInstancePoolDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_cluster_network_request_response.go0000664�0000000�0000000�00000006315�13771713062�0033747�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateClusterNetworkRequest wrapper for the CreateClusterNetwork operation type CreateClusterNetworkRequest struct { // Cluster network creation details CreateClusterNetworkDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateClusterNetworkRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateClusterNetworkRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateClusterNetworkRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateClusterNetworkResponse wrapper for the CreateClusterNetwork operation type CreateClusterNetworkResponse struct { // The underlying http response RawResponse *http.Response // The ClusterNetwork instance ClusterNetwork `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateClusterNetworkResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateClusterNetworkResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_details.go���������������������0000664�0000000�0000000�00000005437�13771713062�0027307�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateCpeDetails The representation of CreateCpeDetails type CreateCpeDetails struct { // The OCID of the compartment to contain the CPE. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The public IP address of the on-premises router. // Example: `143.19.23.16` IpAddress *string `mandatory:"true" json:"ipAddress"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the CPE device type. You can provide // a value if you want to later generate CPE device configuration content for IPSec connections // that use this CPE. You can also call UpdateCpe later to // provide a value. For a list of possible values, see // ListCpeDeviceShapes. // For more information about generating CPE device configuration content, see: // * GetCpeDeviceConfigContent // * GetIpsecCpeDeviceConfigContent // * GetTunnelCpeDeviceConfigContent // * GetTunnelCpeDeviceConfig CpeDeviceShapeId *string `mandatory:"false" json:"cpeDeviceShapeId"` } func (m CreateCpeDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_cpe_request_response.go������������0000664�0000000�0000000�00000005437�13771713062�0031270�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateCpeRequest wrapper for the CreateCpe operation type CreateCpeRequest struct { // Details for creating a CPE. CreateCpeDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateCpeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateCpeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateCpeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateCpeResponse wrapper for the CreateCpe operation type CreateCpeResponse struct { // The underlying http response RawResponse *http.Response // The Cpe instance Cpe `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateCpeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateCpeResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_details.go�����������0000664�0000000�0000000�00000007132�13771713062�0031374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateCrossConnectDetails The representation of CreateCrossConnectDetails type CreateCrossConnectDetails struct { // The OCID of the compartment to contain the cross-connect. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The name of the FastConnect location where this cross-connect will be installed. // To get a list of the available locations, see // ListCrossConnectLocations. // Example: `CyrusOne, Chandler, AZ` LocationName *string `mandatory:"true" json:"locationName"` // The port speed for this cross-connect. To get a list of the available port speeds, see // ListCrossconnectPortSpeedShapes. // Example: `10 Gbps` PortSpeedShapeName *string `mandatory:"true" json:"portSpeedShapeName"` // The OCID of the cross-connect group to put this cross-connect in. CrossConnectGroupId *string `mandatory:"false" json:"crossConnectGroupId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // If you already have an existing cross-connect or cross-connect group at this FastConnect // location, and you want this new cross-connect to be on a different router (for the // purposes of redundancy), provide the OCID of that existing cross-connect or // cross-connect group. FarCrossConnectOrCrossConnectGroupId *string `mandatory:"false" json:"farCrossConnectOrCrossConnectGroupId"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // If you already have an existing cross-connect or cross-connect group at this FastConnect // location, and you want this new cross-connect to be on the same router, provide the // OCID of that existing cross-connect or cross-connect group. NearCrossConnectOrCrossConnectGroupId *string `mandatory:"false" json:"nearCrossConnectOrCrossConnectGroupId"` // A reference name or identifier for the physical fiber connection that this cross-connect // uses. CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` } func (m CreateCrossConnectDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_group_details.go�����0000664�0000000�0000000�00000004412�13771713062�0032606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateCrossConnectGroupDetails The representation of CreateCrossConnectGroupDetails type CreateCrossConnectGroupDetails struct { // The OCID of the compartment to contain the cross-connect group. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // A reference name or identifier for the physical fiber connection that this cross-connect // group uses. CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateCrossConnectGroupDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_cross_connect_group_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005755�13771713062�0034523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateCrossConnectGroupRequest wrapper for the CreateCrossConnectGroup operation type CreateCrossConnectGroupRequest struct { // Details to create a CrossConnectGroup CreateCrossConnectGroupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateCrossConnectGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateCrossConnectGroupResponse wrapper for the CreateCrossConnectGroup operation type CreateCrossConnectGroupResponse struct { // The underlying http response RawResponse *http.Response // The CrossConnectGroup instance CrossConnectGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateCrossConnectGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateCrossConnectGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_cross_connect_request_response.go��0000664�0000000�0000000�00000005642�13771713062�0033361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateCrossConnectRequest wrapper for the CreateCrossConnect operation type CreateCrossConnectRequest struct { // Details to create a CrossConnect CreateCrossConnectDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateCrossConnectRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateCrossConnectRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateCrossConnectResponse wrapper for the CreateCrossConnect operation type CreateCrossConnectResponse struct { // The underlying http response RawResponse *http.Response // The CrossConnect instance CrossConnect `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateCrossConnectResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateCrossConnectResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_dedicated_vm_host_details.go�������0000664�0000000�0000000�00000006327�13771713062�0032204�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateDedicatedVmHostDetails The details for creating a new dedicated virtual machine host. type CreateDedicatedVmHostDetails struct { // The availability domain of the dedicated virtual machine host. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The dedicated virtual machine host shape. The shape determines the number of CPUs and // other resources available for VM instances launched on the dedicated virtual machine host. DedicatedVmHostShape *string `mandatory:"true" json:"dedicatedVmHostShape"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My dedicated VM host` DisplayName *string `mandatory:"false" json:"displayName"` // The fault domain for the dedicated virtual machine host's assigned instances. // For more information, see Fault Domains (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm#fault). // If you do not specify the fault domain, the system selects one for you. To change the fault domain for a dedicated virtual machine host, // delete it and create a new dedicated virtual machine host in the preferred fault domain. // To get a list of fault domains, use the `ListFaultDomains` operation in // the Identity and Access Management Service API (https://docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/). // Example: `FAULT-DOMAIN-1` FaultDomain *string `mandatory:"false" json:"faultDomain"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateDedicatedVmHostDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_dedicated_vm_host_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000006351�13771713062�0034103�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateDedicatedVmHostRequest wrapper for the CreateDedicatedVmHost operation type CreateDedicatedVmHostRequest struct { // The details for creating a new dedicated virtual machine host. CreateDedicatedVmHostDetails `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateDedicatedVmHostRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateDedicatedVmHostRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateDedicatedVmHostRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateDedicatedVmHostResponse wrapper for the CreateDedicatedVmHost operation type CreateDedicatedVmHostResponse struct { // The underlying http response RawResponse *http.Response // The DedicatedVmHost instance DedicatedVmHost `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateDedicatedVmHostResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateDedicatedVmHostResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_details.go��������������������0000664�0000000�0000000�00000006427�13771713062�0027456�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateDhcpDetails The representation of CreateDhcpDetails type CreateDhcpDetails struct { // The OCID of the compartment to contain the set of DHCP options. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A set of DHCP options. Options []DhcpOption `mandatory:"true" json:"options"` // The OCID of the VCN the set of DHCP options belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateDhcpDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *CreateDhcpDetails) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` CompartmentId *string `json:"compartmentId"` Options []dhcpoption `json:"options"` VcnId *string `json:"vcnId"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.CompartmentId = model.CompartmentId m.Options = make([]DhcpOption, len(model.Options)) for i, n := range model.Options { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) if e != nil { return e } if nn != nil { m.Options[i] = nn.(DhcpOption) } else { m.Options[i] = nil } } m.VcnId = model.VcnId return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_dhcp_options_request_response.go���0000664�0000000�0000000�00000005643�13771713062�0033211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateDhcpOptionsRequest wrapper for the CreateDhcpOptions operation type CreateDhcpOptionsRequest struct { // Request object for creating a new set of DHCP options. CreateDhcpDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateDhcpOptionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateDhcpOptionsResponse wrapper for the CreateDhcpOptions operation type CreateDhcpOptionsResponse struct { // The underlying http response RawResponse *http.Response // The DhcpOptions instance DhcpOptions `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateDhcpOptionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateDhcpOptionsResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_details.go����������0000664�0000000�0000000�00000004132�13771713062�0031513�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateDrgAttachmentDetails The representation of CreateDrgAttachmentDetails type CreateDrgAttachmentDetails struct { // The OCID of the DRG. DrgId *string `mandatory:"true" json:"drgId"` // The OCID of the VCN. VcnId *string `mandatory:"true" json:"vcnId"` // A user-friendly name. Does not have to be unique. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The OCID of the route table the DRG attachment will use. // If you don't specify a route table here, the DRG attachment is created without an associated route // table. The Networking service does NOT automatically associate the attached VCN's default route table // with the DRG attachment. // For information about why you would associate a route table with a DRG attachment, see: // * Transit Routing: Access to Multiple VCNs in Same Region (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm) // * Transit Routing: Private Access to Oracle Services (https://docs.cloud.oracle.com/Content/Network/Tasks/transitroutingoracleservices.htm) RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m CreateDrgAttachmentDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_drg_attachment_request_response.go�0000664�0000000�0000000�00000005667�13771713062�0033512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateDrgAttachmentRequest wrapper for the CreateDrgAttachment operation type CreateDrgAttachmentRequest struct { // Details for creating a `DrgAttachment`. CreateDrgAttachmentDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateDrgAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateDrgAttachmentResponse wrapper for the CreateDrgAttachment operation type CreateDrgAttachmentResponse struct { // The underlying http response RawResponse *http.Response // The DrgAttachment instance DrgAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateDrgAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateDrgAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_drg_details.go���������������������0000664�0000000�0000000�00000004000�13771713062�0027275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateDrgDetails The representation of CreateDrgDetails type CreateDrgDetails struct { // The OCID of the compartment to contain the DRG. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateDrgDetails) String() string { return common.PointerString(m) } packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_drg_request_response.go������������0000664�0000000�0000000�00000005437�13771713062�0031275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateDrgRequest wrapper for the CreateDrg operation type CreateDrgRequest struct { // Details for creating a DRG. CreateDrgDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateDrgRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateDrgRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateDrgRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateDrgResponse wrapper for the CreateDrg operation type CreateDrgResponse struct { // The underlying http response RawResponse *http.Response // The Drg instance Drg `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateDrgResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateDrgResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_i_p_sec_connection_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005726�13771713062�0034263�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateIPSecConnectionRequest wrapper for the CreateIPSecConnection operation type CreateIPSecConnectionRequest struct { // Details for creating an `IPSecConnection`. CreateIpSecConnectionDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateIPSecConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateIPSecConnectionResponse wrapper for the CreateIPSecConnection operation type CreateIPSecConnectionResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnection instance IpSecConnection `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateIPSecConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateIPSecConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_image_details.go�������������������0000664�0000000�0000000�00000013104�13771713062�0027610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateImageDetails Either instanceId or imageSourceDetails must be provided in addition to other required parameters. type CreateImageDetails struct { // The OCID of the compartment you want the image to be created in. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the image. It does not have to be unique, and it's changeable. // Avoid entering confidential information. // You cannot use an Oracle-provided image name as a custom image name. // Example: `My Oracle Linux image` DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Details for creating an image through import ImageSourceDetails ImageSourceDetails `mandatory:"false" json:"imageSourceDetails"` // The OCID of the instance you want to use as the basis for the image. InstanceId *string `mandatory:"false" json:"instanceId"` // Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: // * `NATIVE` - VM instances launch with paravirtualized boot and VFIO devices. The default value for Oracle-provided images. // * `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. // * `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter. LaunchMode CreateImageDetailsLaunchModeEnum `mandatory:"false" json:"launchMode,omitempty"` } func (m CreateImageDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *CreateImageDetails) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` ImageSourceDetails imagesourcedetails `json:"imageSourceDetails"` InstanceId *string `json:"instanceId"` LaunchMode CreateImageDetailsLaunchModeEnum `json:"launchMode"` CompartmentId *string `json:"compartmentId"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags nn, e = model.ImageSourceDetails.UnmarshalPolymorphicJSON(model.ImageSourceDetails.JsonData) if e != nil { return } if nn != nil { m.ImageSourceDetails = nn.(ImageSourceDetails) } else { m.ImageSourceDetails = nil } m.InstanceId = model.InstanceId m.LaunchMode = model.LaunchMode m.CompartmentId = model.CompartmentId return } // CreateImageDetailsLaunchModeEnum Enum with underlying type: string type CreateImageDetailsLaunchModeEnum string // Set of constants representing the allowable values for CreateImageDetailsLaunchModeEnum const ( CreateImageDetailsLaunchModeNative CreateImageDetailsLaunchModeEnum = "NATIVE" CreateImageDetailsLaunchModeEmulated CreateImageDetailsLaunchModeEnum = "EMULATED" CreateImageDetailsLaunchModeParavirtualized CreateImageDetailsLaunchModeEnum = "PARAVIRTUALIZED" CreateImageDetailsLaunchModeCustom CreateImageDetailsLaunchModeEnum = "CUSTOM" ) var mappingCreateImageDetailsLaunchMode = map[string]CreateImageDetailsLaunchModeEnum{ "NATIVE": CreateImageDetailsLaunchModeNative, "EMULATED": CreateImageDetailsLaunchModeEmulated, "PARAVIRTUALIZED": CreateImageDetailsLaunchModeParavirtualized, "CUSTOM": CreateImageDetailsLaunchModeCustom, } // GetCreateImageDetailsLaunchModeEnumValues Enumerates the set of values for CreateImageDetailsLaunchModeEnum func GetCreateImageDetailsLaunchModeEnumValues() []CreateImageDetailsLaunchModeEnum { values := make([]CreateImageDetailsLaunchModeEnum, 0) for _, v := range mappingCreateImageDetailsLaunchMode { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_image_request_response.go����������0000664�0000000�0000000�00000006105�13771713062�0031574�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateImageRequest wrapper for the CreateImage operation type CreateImageRequest struct { // Image creation details CreateImageDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateImageRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateImageRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateImageRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateImageResponse wrapper for the CreateImage operation type CreateImageResponse struct { // The underlying http response RawResponse *http.Response // The Image instance Image `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response CreateImageResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateImageResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_base.go�����0000664�0000000�0000000�00000012334�13771713062�0032552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateInstanceConfigurationBase Creation details for an instance configuration. type CreateInstanceConfigurationBase interface { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment // containing the instance configuration. GetCompartmentId() *string // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` GetDefinedTags() map[string]map[string]interface{} // A user-friendly name for the instance configuration. Does not have to be unique, // and it's changeable. Avoid entering confidential information. GetDisplayName() *string // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` GetFreeformTags() map[string]string } type createinstanceconfigurationbase struct { JsonData []byte CompartmentId *string `mandatory:"true" json:"compartmentId"` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` DisplayName *string `mandatory:"false" json:"displayName"` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` Source string `json:"source"` } // UnmarshalJSON unmarshals json func (m *createinstanceconfigurationbase) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalercreateinstanceconfigurationbase createinstanceconfigurationbase s := struct { Model Unmarshalercreateinstanceconfigurationbase }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.CompartmentId = s.Model.CompartmentId m.DefinedTags = s.Model.DefinedTags m.DisplayName = s.Model.DisplayName m.FreeformTags = s.Model.FreeformTags m.Source = s.Model.Source return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *createinstanceconfigurationbase) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Source { case "NONE": mm := CreateInstanceConfigurationDetails{} err = json.Unmarshal(data, &mm) return mm, err case "INSTANCE": mm := CreateInstanceConfigurationFromInstanceDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } //GetCompartmentId returns CompartmentId func (m createinstanceconfigurationbase) GetCompartmentId() *string { return m.CompartmentId } //GetDefinedTags returns DefinedTags func (m createinstanceconfigurationbase) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } //GetDisplayName returns DisplayName func (m createinstanceconfigurationbase) GetDisplayName() *string { return m.DisplayName } //GetFreeformTags returns FreeformTags func (m createinstanceconfigurationbase) GetFreeformTags() map[string]string { return m.FreeformTags } func (m createinstanceconfigurationbase) String() string { return common.PointerString(m) } // CreateInstanceConfigurationBaseSourceEnum Enum with underlying type: string type CreateInstanceConfigurationBaseSourceEnum string // Set of constants representing the allowable values for CreateInstanceConfigurationBaseSourceEnum const ( CreateInstanceConfigurationBaseSourceNone CreateInstanceConfigurationBaseSourceEnum = "NONE" CreateInstanceConfigurationBaseSourceInstance CreateInstanceConfigurationBaseSourceEnum = "INSTANCE" ) var mappingCreateInstanceConfigurationBaseSource = map[string]CreateInstanceConfigurationBaseSourceEnum{ "NONE": CreateInstanceConfigurationBaseSourceNone, "INSTANCE": CreateInstanceConfigurationBaseSourceInstance, } // GetCreateInstanceConfigurationBaseSourceEnumValues Enumerates the set of values for CreateInstanceConfigurationBaseSourceEnum func GetCreateInstanceConfigurationBaseSourceEnumValues() []CreateInstanceConfigurationBaseSourceEnum { values := make([]CreateInstanceConfigurationBaseSourceEnum, 0) for _, v := range mappingCreateInstanceConfigurationBaseSource { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_instance_configuration_details.go��0000664�0000000�0000000�00000010506�13771713062�0033264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateInstanceConfigurationDetails Details for creating an instance configuration by providing a list of configuration settings. type CreateInstanceConfigurationDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment // containing the instance configuration. CompartmentId *string `mandatory:"true" json:"compartmentId"` InstanceDetails InstanceConfigurationInstanceDetails `mandatory:"true" json:"instanceDetails"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the instance configuration. Does not have to be unique, // and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } //GetCompartmentId returns CompartmentId func (m CreateInstanceConfigurationDetails) GetCompartmentId() *string { return m.CompartmentId } //GetDefinedTags returns DefinedTags func (m CreateInstanceConfigurationDetails) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } //GetDisplayName returns DisplayName func (m CreateInstanceConfigurationDetails) GetDisplayName() *string { return m.DisplayName } //GetFreeformTags returns FreeformTags func (m CreateInstanceConfigurationDetails) GetFreeformTags() map[string]string { return m.FreeformTags } func (m CreateInstanceConfigurationDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m CreateInstanceConfigurationDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeCreateInstanceConfigurationDetails CreateInstanceConfigurationDetails s := struct { DiscriminatorParam string `json:"source"` MarshalTypeCreateInstanceConfigurationDetails }{ "NONE", (MarshalTypeCreateInstanceConfigurationDetails)(m), } return json.Marshal(&s) } // UnmarshalJSON unmarshals from json func (m *CreateInstanceConfigurationDetails) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` CompartmentId *string `json:"compartmentId"` InstanceDetails instanceconfigurationinstancedetails `json:"instanceDetails"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.CompartmentId = model.CompartmentId nn, e = model.InstanceDetails.UnmarshalPolymorphicJSON(model.InstanceDetails.JsonData) if e != nil { return } if nn != nil { m.InstanceDetails = nn.(InstanceConfigurationInstanceDetails) } else { m.InstanceDetails = nil } return } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_instance_configuration_from_instance_details.go����������������������������������������������0000664�0000000�0000000�00000007130�13771713062�0036113�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateInstanceConfigurationFromInstanceDetails Details for creating an instance configuration using an existing instance as a template. type CreateInstanceConfigurationFromInstanceDetails struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment // containing the instance configuration. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance to use to create the // instance configuration. InstanceId *string `mandatory:"true" json:"instanceId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the instance configuration. Does not have to be unique, // and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } //GetCompartmentId returns CompartmentId func (m CreateInstanceConfigurationFromInstanceDetails) GetCompartmentId() *string { return m.CompartmentId } //GetDefinedTags returns DefinedTags func (m CreateInstanceConfigurationFromInstanceDetails) GetDefinedTags() map[string]map[string]interface{} { return m.DefinedTags } //GetDisplayName returns DisplayName func (m CreateInstanceConfigurationFromInstanceDetails) GetDisplayName() *string { return m.DisplayName } //GetFreeformTags returns FreeformTags func (m CreateInstanceConfigurationFromInstanceDetails) GetFreeformTags() map[string]string { return m.FreeformTags } func (m CreateInstanceConfigurationFromInstanceDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m CreateInstanceConfigurationFromInstanceDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeCreateInstanceConfigurationFromInstanceDetails CreateInstanceConfigurationFromInstanceDetails s := struct { DiscriminatorParam string `json:"source"` MarshalTypeCreateInstanceConfigurationFromInstanceDetails }{ "INSTANCE", (MarshalTypeCreateInstanceConfigurationFromInstanceDetails)(m), } return json.Marshal(&s) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_instance_configuration_request_response.go���������������������������������������������������0000664�0000000�0000000�00000006100�13771713062�0035161�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateInstanceConfigurationRequest wrapper for the CreateInstanceConfiguration operation type CreateInstanceConfigurationRequest struct { // Instance configuration creation details CreateInstanceConfiguration CreateInstanceConfigurationBase `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateInstanceConfigurationRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateInstanceConfigurationResponse wrapper for the CreateInstanceConfiguration operation type CreateInstanceConfigurationResponse struct { // The underlying http response RawResponse *http.Response // The InstanceConfiguration instance InstanceConfiguration `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateInstanceConfigurationResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateInstanceConfigurationResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_instance_console_connection_details.go�������������������������������������������������������0000664�0000000�0000000�00000004175�13771713062�0034224�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateInstanceConsoleConnectionDetails The details for creating a instance console connection. // The instance console connection is created in the same compartment as the instance. type CreateInstanceConsoleConnectionDetails struct { // The OCID of the instance to create the console connection to. InstanceId *string `mandatory:"true" json:"instanceId"` // The SSH public key used to authenticate the console connection. PublicKey *string `mandatory:"true" json:"publicKey"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateInstanceConsoleConnectionDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_instance_console_connection_request_response.go����������������������������������������������0000664�0000000�0000000�00000006160�13771713062�0036201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateInstanceConsoleConnectionRequest wrapper for the CreateInstanceConsoleConnection operation type CreateInstanceConsoleConnectionRequest struct { // Request object for creating an InstanceConsoleConnection CreateInstanceConsoleConnectionDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateInstanceConsoleConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateInstanceConsoleConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateInstanceConsoleConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateInstanceConsoleConnectionResponse wrapper for the CreateInstanceConsoleConnection operation type CreateInstanceConsoleConnectionResponse struct { // The underlying http response RawResponse *http.Response // The InstanceConsoleConnection instance InstanceConsoleConnection `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateInstanceConsoleConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateInstanceConsoleConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_details.go�����������0000664�0000000�0000000�00000006047�13771713062�0031373�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateInstancePoolDetails The data to create an instance pool. type CreateInstancePoolDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the instance pool. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance configuration associated // with the instance pool. InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` // The placement configurations for the instance pool. Provide one placement configuration for // each availability domain. // To use the instance pool with a regional subnet, provide a placement configuration for // each availability domain, and include the regional subnet in each placement // configuration. PlacementConfigurations []CreateInstancePoolPlacementConfigurationDetails `mandatory:"true" json:"placementConfigurations"` // The number of instances that should be in the instance pool. Size *int `mandatory:"true" json:"size"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the instance pool. Does not have to be unique, and it's // changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The load balancers to attach to the instance pool. LoadBalancers []AttachLoadBalancerDetails `mandatory:"false" json:"loadBalancers"` } func (m CreateInstancePoolDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_instance_pool_placement_configuration_details.go���������������������������������������������0000664�0000000�0000000�00000004467�13771713062�0036277�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateInstancePoolPlacementConfigurationDetails The location for where an instance pool will place instances. type CreateInstancePoolPlacementConfigurationDetails struct { // The availability domain to place instances. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the primary subnet to place instances. PrimarySubnetId *string `mandatory:"true" json:"primarySubnetId"` // The fault domains to place instances. // If you don't provide any values, the system makes a best effort to distribute // instances across all fault domains based on capacity. // To distribute the instances evenly across selected fault domains, provide a // set of fault domains. For example, you might want instances to be evenly // distributed if your applications require high availability. // To get a list of fault domains, use the // ListFaultDomains operation // in the Identity and Access Management Service API. // Example: `[FAULT-DOMAIN-1, FAULT-DOMAIN-2, FAULT-DOMAIN-3]` FaultDomains []string `mandatory:"false" json:"faultDomains"` // The set of secondary VNIC data for instances in the pool. SecondaryVnicSubnets []InstancePoolPlacementSecondaryVnicSubnet `mandatory:"false" json:"secondaryVnicSubnets"` } func (m CreateInstancePoolPlacementConfigurationDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_instance_pool_request_response.go��0000664�0000000�0000000�00000005640�13771713062�0033352�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateInstancePoolRequest wrapper for the CreateInstancePool operation type CreateInstancePoolRequest struct { // Instance pool creation details CreateInstancePoolDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateInstancePoolResponse wrapper for the CreateInstancePool operation type CreateInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_internet_gateway_details.go��������0000664�0000000�0000000�00000004422�13771713062�0032102�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateInternetGatewayDetails The representation of CreateInternetGatewayDetails type CreateInternetGatewayDetails struct { // The OCID of the compartment to contain the internet gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Whether the gateway is enabled upon creation. IsEnabled *bool `mandatory:"true" json:"isEnabled"` // The OCID of the VCN the internet gateway is attached to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateInternetGatewayDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_internet_gateway_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005730�13771713062�0034007�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateInternetGatewayRequest wrapper for the CreateInternetGateway operation type CreateInternetGatewayRequest struct { // Details for creating a new internet gateway. CreateInternetGatewayDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateInternetGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateInternetGatewayResponse wrapper for the CreateInternetGateway operation type CreateInternetGatewayResponse struct { // The underlying http response RawResponse *http.Response // The InternetGateway instance InternetGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateInternetGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateInternetGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_details.go�������0000664�0000000�0000000�00000013110�13771713062�0032204�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateIpSecConnectionDetails The representation of CreateIpSecConnectionDetails type CreateIpSecConnectionDetails struct { // The OCID of the compartment to contain the IPSec connection. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the Cpe object. CpeId *string `mandatory:"true" json:"cpeId"` // The OCID of the DRG. DrgId *string `mandatory:"true" json:"drgId"` // Static routes to the CPE. A static route's CIDR must not be a // multicast address or class E address. // Used for routing a given IPSec tunnel's traffic only if the tunnel // is using static routing. If you configure at least one tunnel to use static routing, then // you must provide at least one valid static route. If you configure both // tunnels to use BGP dynamic routing, you can provide an empty list for the static routes. // For more information, see the important note in IPSecConnection. // The CIDR can be either IPv4 or IPv6. Note that IPv6 addressing is currently supported only // in certain regions. See IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `10.0.1.0/24` // Example: `2001:db8::/32` StaticRoutes []string `mandatory:"true" json:"staticRoutes"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Your identifier for your CPE device. Can be either an IP address or a hostname (specifically, the // fully qualified domain name (FQDN)). The type of identifier you provide here must correspond // to the value for `cpeLocalIdentifierType`. // If you don't provide a value, the `ipAddress` attribute for the Cpe // object specified by `cpeId` is used as the `cpeLocalIdentifier`. // For information about why you'd provide this value, see // If Your CPE Is Behind a NAT Device (https://docs.cloud.oracle.com/Content/Network/Tasks/overviewIPsec.htm#nat). // Example IP address: `10.0.3.3` // Example hostname: `cpe.example.com` CpeLocalIdentifier *string `mandatory:"false" json:"cpeLocalIdentifier"` // The type of identifier for your CPE device. The value you provide here must correspond to the value // for `cpeLocalIdentifier`. CpeLocalIdentifierType CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum `mandatory:"false" json:"cpeLocalIdentifierType,omitempty"` // Information for creating the individual tunnels in the IPSec connection. You can provide a // maximum of 2 `tunnelConfiguration` objects in the array (one for each of the // two tunnels). TunnelConfiguration []CreateIpSecConnectionTunnelDetails `mandatory:"false" json:"tunnelConfiguration"` } func (m CreateIpSecConnectionDetails) String() string { return common.PointerString(m) } // CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum Enum with underlying type: string type CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum string // Set of constants representing the allowable values for CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum const ( CreateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "IP_ADDRESS" CreateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "HOSTNAME" ) var mappingCreateIpSecConnectionDetailsCpeLocalIdentifierType = map[string]CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum{ "IP_ADDRESS": CreateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress, "HOSTNAME": CreateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname, } // GetCreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues Enumerates the set of values for CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum func GetCreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues() []CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum { values := make([]CreateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum, 0) for _, v := range mappingCreateIpSecConnectionDetailsCpeLocalIdentifierType { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_ip_sec_connection_tunnel_details.go0000664�0000000�0000000�00000011325�13771713062�0033577�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateIpSecConnectionTunnelDetails The representation of CreateIpSecConnectionTunnelDetails type CreateIpSecConnectionTunnelDetails struct { // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The type of routing to use for this tunnel (either BGP dynamic routing or static routing). Routing CreateIpSecConnectionTunnelDetailsRoutingEnum `mandatory:"false" json:"routing,omitempty"` // Internet Key Exchange protocol version. IkeVersion CreateIpSecConnectionTunnelDetailsIkeVersionEnum `mandatory:"false" json:"ikeVersion,omitempty"` // The shared secret (pre-shared key) to use for the IPSec tunnel. Only numbers, letters, and // spaces are allowed. If you don't provide a value, // Oracle generates a value for you. You can specify your own shared secret later if // you like with UpdateIPSecConnectionTunnelSharedSecret. // Example: `EXAMPLEToUis6j1cp8GdVQxcmdfMO0yXMLilZTbYCMDGu4V8o` SharedSecret *string `mandatory:"false" json:"sharedSecret"` // Information for establishing a BGP session for the IPSec tunnel. Required if the tunnel uses // BGP dynamic routing. // If the tunnel instead uses static routing, you may optionally provide // this object and set an IP address for one or both ends of the IPSec tunnel for the purposes // of troubleshooting or monitoring the tunnel. BgpSessionConfig *CreateIpSecTunnelBgpSessionDetails `mandatory:"false" json:"bgpSessionConfig"` } func (m CreateIpSecConnectionTunnelDetails) String() string { return common.PointerString(m) } // CreateIpSecConnectionTunnelDetailsRoutingEnum Enum with underlying type: string type CreateIpSecConnectionTunnelDetailsRoutingEnum string // Set of constants representing the allowable values for CreateIpSecConnectionTunnelDetailsRoutingEnum const ( CreateIpSecConnectionTunnelDetailsRoutingBgp CreateIpSecConnectionTunnelDetailsRoutingEnum = "BGP" CreateIpSecConnectionTunnelDetailsRoutingStatic CreateIpSecConnectionTunnelDetailsRoutingEnum = "STATIC" ) var mappingCreateIpSecConnectionTunnelDetailsRouting = map[string]CreateIpSecConnectionTunnelDetailsRoutingEnum{ "BGP": CreateIpSecConnectionTunnelDetailsRoutingBgp, "STATIC": CreateIpSecConnectionTunnelDetailsRoutingStatic, } // GetCreateIpSecConnectionTunnelDetailsRoutingEnumValues Enumerates the set of values for CreateIpSecConnectionTunnelDetailsRoutingEnum func GetCreateIpSecConnectionTunnelDetailsRoutingEnumValues() []CreateIpSecConnectionTunnelDetailsRoutingEnum { values := make([]CreateIpSecConnectionTunnelDetailsRoutingEnum, 0) for _, v := range mappingCreateIpSecConnectionTunnelDetailsRouting { values = append(values, v) } return values } // CreateIpSecConnectionTunnelDetailsIkeVersionEnum Enum with underlying type: string type CreateIpSecConnectionTunnelDetailsIkeVersionEnum string // Set of constants representing the allowable values for CreateIpSecConnectionTunnelDetailsIkeVersionEnum const ( CreateIpSecConnectionTunnelDetailsIkeVersionV1 CreateIpSecConnectionTunnelDetailsIkeVersionEnum = "V1" CreateIpSecConnectionTunnelDetailsIkeVersionV2 CreateIpSecConnectionTunnelDetailsIkeVersionEnum = "V2" ) var mappingCreateIpSecConnectionTunnelDetailsIkeVersion = map[string]CreateIpSecConnectionTunnelDetailsIkeVersionEnum{ "V1": CreateIpSecConnectionTunnelDetailsIkeVersionV1, "V2": CreateIpSecConnectionTunnelDetailsIkeVersionV2, } // GetCreateIpSecConnectionTunnelDetailsIkeVersionEnumValues Enumerates the set of values for CreateIpSecConnectionTunnelDetailsIkeVersionEnum func GetCreateIpSecConnectionTunnelDetailsIkeVersionEnumValues() []CreateIpSecConnectionTunnelDetailsIkeVersionEnum { values := make([]CreateIpSecConnectionTunnelDetailsIkeVersionEnum, 0) for _, v := range mappingCreateIpSecConnectionTunnelDetailsIkeVersion { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_ip_sec_tunnel_bgp_session_details.go���������������������������������������������������������0000664�0000000�0000000�00000005130�13771713062�0033671�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateIpSecTunnelBgpSessionDetails The representation of CreateIpSecTunnelBgpSessionDetails type CreateIpSecTunnelBgpSessionDetails struct { // The IP address for the Oracle end of the inside tunnel interface. // If the tunnel's `routing` attribute is set to `BGP` // (see IPSecConnectionTunnel), this IP address // is required and used for the tunnel's BGP session. // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP // address to troubleshoot or monitor the tunnel. // The value must be a /30 or /31. // Example: `10.0.0.4/31` OracleInterfaceIp *string `mandatory:"false" json:"oracleInterfaceIp"` // The IP address for the CPE end of the inside tunnel interface. // If the tunnel's `routing` attribute is set to `BGP` // (see IPSecConnectionTunnel), this IP address // is required and used for the tunnel's BGP session. // If `routing` is instead set to `STATIC`, this IP address is optional. You can set this IP // address to troubleshoot or monitor the tunnel. // The value must be a /30 or /31. // Example: `10.0.0.5/31` CustomerInterfaceIp *string `mandatory:"false" json:"customerInterfaceIp"` // If the tunnel's `routing` attribute is set to `BGP` // (see IPSecConnectionTunnel), this ASN // is required and used for the tunnel's BGP session. This is the ASN of the network on the // CPE end of the BGP session. Can be a 2-byte or 4-byte ASN. Uses "asplain" format. // If the tunnel's `routing` attribute is set to `STATIC`, the `customerBgpAsn` must be null. // Example: `12345` (2-byte) or `1587232876` (4-byte) CustomerBgpAsn *string `mandatory:"false" json:"customerBgpAsn"` } func (m CreateIpSecTunnelBgpSessionDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_ipv6_details.go��������������������0000664�0000000�0000000�00000005704�13771713062�0027421�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateIpv6Details The representation of CreateIpv6Details type CreateIpv6Details struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC to assign the IPv6 to. The // IPv6 will be in the VNIC's subnet. VnicId *string `mandatory:"true" json:"vnicId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // An IPv6 address of your choice. Must be an available IP address within // the subnet's CIDR. If you don't specify a value, Oracle automatically // assigns an IPv6 address from the subnet. The subnet is the one that // contains the VNIC you specify in `vnicId`. // Example: `2001:0db8:0123:1111:abcd:ef01:2345:6789` IpAddress *string `mandatory:"false" json:"ipAddress"` // Whether the IPv6 can be used for internet communication. Allowed by default for an IPv6 in // a public subnet. Never allowed for an IPv6 in a private subnet. If the value is `true`, the // IPv6 uses its public IP address for internet communication. // If `isInternetAccessAllowed` is set to `false`, the resulting `publicIpAddress` attribute // for the Ipv6 is null. // Example: `true` IsInternetAccessAllowed *bool `mandatory:"false" json:"isInternetAccessAllowed"` } func (m CreateIpv6Details) String() string { return common.PointerString(m) } ������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_ipv6_request_response.go�����������0000664�0000000�0000000�00000005426�13771713062�0031403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateIpv6Request wrapper for the CreateIpv6 operation type CreateIpv6Request struct { // Create IPv6 details. CreateIpv6Details `contributesTo:"body"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateIpv6Request) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateIpv6Request) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateIpv6Request) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateIpv6Response wrapper for the CreateIpv6 operation type CreateIpv6Response struct { // The underlying http response RawResponse *http.Response // The Ipv6 instance Ipv6 `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateIpv6Response) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateIpv6Response) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_local_peering_gateway_details.go���0000664�0000000�0000000�00000005330�13771713062�0033054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateLocalPeeringGatewayDetails The representation of CreateLocalPeeringGatewayDetails type CreateLocalPeeringGatewayDetails struct { // The OCID of the compartment containing the local peering gateway (LPG). CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the VCN the LPG belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the route table the LPG will use. // If you don't specify a route table here, the LPG is created without an associated route // table. The Networking service does NOT automatically associate the attached VCN's default route table // with the LPG. // For information about why you would associate a route table with an LPG, see // Transit Routing: Access to Multiple VCNs in Same Region (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m CreateLocalPeeringGatewayDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_local_peering_gateway_request_response.go����������������������������������������������������0000664�0000000�0000000�00000006025�13771713062�0034760�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateLocalPeeringGatewayRequest wrapper for the CreateLocalPeeringGateway operation type CreateLocalPeeringGatewayRequest struct { // Details for creating a new local peering gateway. CreateLocalPeeringGatewayDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateLocalPeeringGatewayResponse wrapper for the CreateLocalPeeringGateway operation type CreateLocalPeeringGatewayResponse struct { // The underlying http response RawResponse *http.Response // The LocalPeeringGateway instance LocalPeeringGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateLocalPeeringGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_details.go�������������0000664�0000000�0000000�00000004676�13771713062�0031047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateNatGatewayDetails The representation of CreateNatGatewayDetails type CreateNatGatewayDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the // NAT gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN the gateway belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Whether the NAT gateway blocks traffic through it. The default is `false`. // Example: `true` BlockTraffic *bool `mandatory:"false" json:"blockTraffic"` } func (m CreateNatGatewayDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_nat_gateway_request_response.go����0000664�0000000�0000000�00000005611�13771713062�0033016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateNatGatewayRequest wrapper for the CreateNatGateway operation type CreateNatGatewayRequest struct { // Details for creating a NAT gateway. CreateNatGatewayDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateNatGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateNatGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateNatGatewayResponse wrapper for the CreateNatGateway operation type CreateNatGatewayResponse struct { // The underlying http response RawResponse *http.Response // The NatGateway instance NatGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateNatGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateNatGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_network_security_group_details.go��0000664�0000000�0000000�00000004560�13771713062�0033370�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateNetworkSecurityGroupDetails The representation of CreateNetworkSecurityGroupDetails type CreateNetworkSecurityGroupDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the // network security group. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN to create the network // security group in. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the network security group. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateNetworkSecurityGroupDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������create_network_security_group_request_response.go���������������������������������������������������0000664�0000000�0000000�00000006040�13771713062�0035265�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateNetworkSecurityGroupRequest wrapper for the CreateNetworkSecurityGroup operation type CreateNetworkSecurityGroupRequest struct { // Details for creating a network security group. CreateNetworkSecurityGroupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateNetworkSecurityGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateNetworkSecurityGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateNetworkSecurityGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateNetworkSecurityGroupResponse wrapper for the CreateNetworkSecurityGroup operation type CreateNetworkSecurityGroupResponse struct { // The underlying http response RawResponse *http.Response // The NetworkSecurityGroup instance NetworkSecurityGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateNetworkSecurityGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateNetworkSecurityGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_details.go��������������0000664�0000000�0000000�00000005732�13771713062�0030700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreatePrivateIpDetails The representation of CreatePrivateIpDetails type CreatePrivateIpDetails struct { // The OCID of the VNIC to assign the private IP to. The VNIC and private IP // must be in the same subnet. VnicId *string `mandatory:"true" json:"vnicId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The hostname for the private IP. Used for DNS. The value // is the hostname portion of the private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be unique across all VNICs in the subnet and comply with // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // A private IP address of your choice. Must be an available IP address within // the subnet's CIDR. If you don't specify a value, Oracle automatically // assigns a private IP address from the subnet. // Example: `10.0.3.3` IpAddress *string `mandatory:"false" json:"ipAddress"` } func (m CreatePrivateIpDetails) String() string { return common.PointerString(m) } ��������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_private_ip_request_response.go�����0000664�0000000�0000000�00000005562�13771713062�0032662�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreatePrivateIpRequest wrapper for the CreatePrivateIp operation type CreatePrivateIpRequest struct { // Create private IP details. CreatePrivateIpDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreatePrivateIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreatePrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreatePrivateIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreatePrivateIpResponse wrapper for the CreatePrivateIp operation type CreatePrivateIpResponse struct { // The underlying http response RawResponse *http.Response // The PrivateIp instance PrivateIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreatePrivateIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreatePrivateIpResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_details.go���������������0000664�0000000�0000000�00000007457�13771713062�0030512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreatePublicIpDetails The representation of CreatePublicIpDetails type CreatePublicIpDetails struct { // The OCID of the compartment to contain the public IP. For ephemeral public IPs, // you must set this to the private IP's compartment OCID. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Defines when the public IP is deleted and released back to the Oracle Cloud // Infrastructure public IP pool. For more information, see // Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). Lifetime CreatePublicIpDetailsLifetimeEnum `mandatory:"true" json:"lifetime"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the private IP to assign the public IP to. // Required for an ephemeral public IP because it must always be assigned to a private IP // (specifically a *primary* private IP). // Optional for a reserved public IP. If you don't provide it, the public IP is created but not // assigned to a private IP. You can later assign the public IP with // UpdatePublicIp. PrivateIpId *string `mandatory:"false" json:"privateIpId"` } func (m CreatePublicIpDetails) String() string { return common.PointerString(m) } // CreatePublicIpDetailsLifetimeEnum Enum with underlying type: string type CreatePublicIpDetailsLifetimeEnum string // Set of constants representing the allowable values for CreatePublicIpDetailsLifetimeEnum const ( CreatePublicIpDetailsLifetimeEphemeral CreatePublicIpDetailsLifetimeEnum = "EPHEMERAL" CreatePublicIpDetailsLifetimeReserved CreatePublicIpDetailsLifetimeEnum = "RESERVED" ) var mappingCreatePublicIpDetailsLifetime = map[string]CreatePublicIpDetailsLifetimeEnum{ "EPHEMERAL": CreatePublicIpDetailsLifetimeEphemeral, "RESERVED": CreatePublicIpDetailsLifetimeReserved, } // GetCreatePublicIpDetailsLifetimeEnumValues Enumerates the set of values for CreatePublicIpDetailsLifetimeEnum func GetCreatePublicIpDetailsLifetimeEnumValues() []CreatePublicIpDetailsLifetimeEnum { values := make([]CreatePublicIpDetailsLifetimeEnum, 0) for _, v := range mappingCreatePublicIpDetailsLifetime { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_public_ip_request_response.go������0000664�0000000�0000000�00000005543�13771713062�0032465�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreatePublicIpRequest wrapper for the CreatePublicIp operation type CreatePublicIpRequest struct { // Create public IP details. CreatePublicIpDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreatePublicIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreatePublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreatePublicIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreatePublicIpResponse wrapper for the CreatePublicIp operation type CreatePublicIpResponse struct { // The underlying http response RawResponse *http.Response // The PublicIp instance PublicIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreatePublicIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreatePublicIpResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������create_remote_peering_connection_details.go���������������������������������������������������������0000664�0000000�0000000�00000004260�13771713062�0033675�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateRemotePeeringConnectionDetails The representation of CreateRemotePeeringConnectionDetails type CreateRemotePeeringConnectionDetails struct { // The OCID of the compartment to contain the RPC. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the DRG the RPC belongs to. DrgId *string `mandatory:"true" json:"drgId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateRemotePeeringConnectionDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_remote_peering_connection_request_response.go������������������������������������������������0000664�0000000�0000000�00000006121�13771713062�0035654�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateRemotePeeringConnectionRequest wrapper for the CreateRemotePeeringConnection operation type CreateRemotePeeringConnectionRequest struct { // Request to create peering connection to remote region CreateRemotePeeringConnectionDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateRemotePeeringConnectionResponse wrapper for the CreateRemotePeeringConnection operation type CreateRemotePeeringConnectionResponse struct { // The underlying http response RawResponse *http.Response // The RemotePeeringConnection instance RemotePeeringConnection `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateRemotePeeringConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_details.go�������������0000664�0000000�0000000�00000004427�13771713062�0031043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateRouteTableDetails The representation of CreateRouteTableDetails type CreateRouteTableDetails struct { // The OCID of the compartment to contain the route table. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The collection of rules used for routing destination IPs to network devices. RouteRules []RouteRule `mandatory:"true" json:"routeRules"` // The OCID of the VCN the route table belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateRouteTableDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_route_table_request_response.go����0000664�0000000�0000000�00000005615�13771713062�0033024�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateRouteTableRequest wrapper for the CreateRouteTable operation type CreateRouteTableRequest struct { // Details for creating a new route table. CreateRouteTableDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateRouteTableRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateRouteTableRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateRouteTableResponse wrapper for the CreateRouteTable operation type CreateRouteTableResponse struct { // The underlying http response RawResponse *http.Response // The RouteTable instance RouteTable `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateRouteTableResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateRouteTableResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_details.go�����������0000664�0000000�0000000�00000004636�13771713062�0031442�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateSecurityListDetails The representation of CreateSecurityListDetails type CreateSecurityListDetails struct { // The OCID of the compartment to contain the security list. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Rules for allowing egress IP packets. EgressSecurityRules []EgressSecurityRule `mandatory:"true" json:"egressSecurityRules"` // Rules for allowing ingress IP packets. IngressSecurityRules []IngressSecurityRule `mandatory:"true" json:"ingressSecurityRules"` // The OCID of the VCN the security list belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateSecurityListDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_security_list_request_response.go��0000664�0000000�0000000�00000005660�13771713062�0033421�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateSecurityListRequest wrapper for the CreateSecurityList operation type CreateSecurityListRequest struct { // Details regarding the security list to create. CreateSecurityListDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateSecurityListRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateSecurityListRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateSecurityListResponse wrapper for the CreateSecurityList operation type CreateSecurityListResponse struct { // The underlying http response RawResponse *http.Response // The SecurityList instance SecurityList `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateSecurityListResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateSecurityListResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_details.go���������0000664�0000000�0000000�00000006646�13771713062�0031724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateServiceGatewayDetails The representation of CreateServiceGatewayDetails type CreateServiceGatewayDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the service gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` // List of the OCIDs of the Service objects to // enable for the service gateway. This list can be empty if you don't want to enable any // `Service` objects when you create the gateway. You can enable a `Service` // object later by using either AttachServiceId // or UpdateServiceGateway. // For each enabled `Service`, make sure there's a route rule with the `Service` object's `cidrBlock` // as the rule's destination and the service gateway as the rule's target. See // RouteTable. Services []ServiceIdRequestDetails `mandatory:"true" json:"services"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the route table the service gateway will use. // If you don't specify a route table here, the service gateway is created without an associated route // table. The Networking service does NOT automatically associate the attached VCN's default route table // with the service gateway. // For information about why you would associate a route table with a service gateway, see // Transit Routing: Private Access to Oracle Services (https://docs.cloud.oracle.com/Content/Network/Tasks/transitroutingoracleservices.htm). RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m CreateServiceGatewayDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_service_gateway_request_response.go0000664�0000000�0000000�00000005535�13771713062�0033701�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateServiceGatewayRequest wrapper for the CreateServiceGateway operation type CreateServiceGatewayRequest struct { // Details for creating a service gateway. CreateServiceGatewayDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateServiceGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateServiceGatewayResponse wrapper for the CreateServiceGateway operation type CreateServiceGatewayResponse struct { // The underlying http response RawResponse *http.Response // The ServiceGateway instance ServiceGateway `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateServiceGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateServiceGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_details.go������������������0000664�0000000�0000000�00000013432�13771713062�0030032�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateSubnetDetails The representation of CreateSubnetDetails type CreateSubnetDetails struct { // The CIDR IP address range of the subnet. // Example: `172.16.1.0/24` CidrBlock *string `mandatory:"true" json:"cidrBlock"` // The OCID of the compartment to contain the subnet. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the VCN to contain the subnet. VcnId *string `mandatory:"true" json:"vcnId"` // Controls whether the subnet is regional or specific to an availability domain. Oracle // recommends creating regional subnets because they're more flexible and make it easier to // implement failover across availability domains. Originally, AD-specific subnets were the // only kind available to use. // To create a regional subnet, omit this attribute. Then any resources later created in this // subnet (such as a Compute instance) can be created in any availability domain in the region. // To instead create an AD-specific subnet, set this attribute to the availability domain you // want this subnet to be in. Then any resources later created in this subnet can only be // created in that availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The OCID of the set of DHCP options the subnet will use. If you don't // provide a value, the subnet uses the VCN's default set of DHCP options. DhcpOptionsId *string `mandatory:"false" json:"dhcpOptionsId"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // A DNS label for the subnet, used in conjunction with the VNIC's hostname and // VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be an alphanumeric string that begins with a letter and is unique within the VCN. // The value cannot be changed. // This value must be set if you want to use the Internet and VCN Resolver to resolve the // hostnames of instances in the subnet. It can only be set if the VCN itself // was created with a DNS label. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `subnet123` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Use this to enable IPv6 addressing for this subnet. The VCN must be enabled for IPv6. // You can't change this subnet characteristic later. All subnets are /64 in size. The subnet // portion of the IPv6 address is the fourth hextet from the left (1111 in the following example). // For important details about IPv6 addressing in a VCN, see IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `2001:0db8:0123:1111::/64` Ipv6CidrBlock *string `mandatory:"false" json:"ipv6CidrBlock"` // Whether VNICs within this subnet can have public IP addresses. // Defaults to false, which means VNICs created in this subnet will // automatically be assigned public IP addresses unless specified // otherwise during instance launch or VNIC creation (with the // `assignPublicIp` flag in CreateVnicDetails). // If `prohibitPublicIpOnVnic` is set to true, VNICs created in this // subnet cannot have public IP addresses (that is, it's a private // subnet). // For IPv6, if `prohibitPublicIpOnVnic` is set to `true`, internet access is not allowed for any // IPv6s assigned to VNICs in the subnet. // Example: `true` ProhibitPublicIpOnVnic *bool `mandatory:"false" json:"prohibitPublicIpOnVnic"` // The OCID of the route table the subnet will use. If you don't provide a value, // the subnet uses the VCN's default route table. RouteTableId *string `mandatory:"false" json:"routeTableId"` // The OCIDs of the security list or lists the subnet will use. If you don't // provide a value, the subnet uses the VCN's default security list. // Remember that security lists are associated *with the subnet*, but the // rules are applied to the individual VNICs in the subnet. SecurityListIds []string `mandatory:"false" json:"securityListIds"` } func (m CreateSubnetDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_subnet_request_response.go���������0000664�0000000�0000000�00000005514�13771713062�0032015�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateSubnetRequest wrapper for the CreateSubnet operation type CreateSubnetRequest struct { // Details for creating a subnet. CreateSubnetDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateSubnetRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateSubnetRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateSubnetResponse wrapper for the CreateSubnet operation type CreateSubnetResponse struct { // The underlying http response RawResponse *http.Response // The Subnet instance Subnet `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateSubnetResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateSubnetResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_details.go���������������������0000664�0000000�0000000�00000011277�13771713062�0027325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVcnDetails The representation of CreateVcnDetails type CreateVcnDetails struct { // The CIDR IP address block of the VCN. // Example: `172.16.0.0/16` CidrBlock *string `mandatory:"true" json:"cidrBlock"` // The OCID of the compartment to contain the VCN. CompartmentId *string `mandatory:"true" json:"compartmentId"` // If you enable IPv6 for the VCN (see `isIpv6Enabled`), you may optionally provide an IPv6 // /48 CIDR block from the supported ranges (see IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // The addresses in this block will be considered private and cannot be accessed // from the internet. The documentation refers to this as a *custom CIDR* for the VCN. // If you don't provide a custom CIDR for the VCN, Oracle assigns the VCN's IPv6 /48 CIDR block. // Regardless of whether you or Oracle assigns the `ipv6CidrBlock`, // Oracle *also* assigns the VCN an IPv6 CIDR block for the VCN's public IP address space // (see the `ipv6PublicCidrBlock` of the Vcn object). If you do // not assign a custom CIDR, Oracle uses the *same* Oracle-assigned CIDR for both the private // IP address space (`ipv6CidrBlock` in the `Vcn` object) and the public IP addreses space // (`ipv6PublicCidrBlock` in the `Vcn` object). This means that a given VNIC might use the same // IPv6 IP address for both private and public (internet) communication. You control whether // an IPv6 address can be used for internet communication by using the `isInternetAccessAllowed` // attribute in the Ipv6 object. // For important details about IPv6 addressing in a VCN, see IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `2001:0db8:0123::/48` Ipv6CidrBlock *string `mandatory:"false" json:"ipv6CidrBlock"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // A DNS label for the VCN, used in conjunction with the VNIC's hostname and // subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Not required to be unique, but it's a best practice to set unique DNS labels // for VCNs in your tenancy. Must be an alphanumeric string that begins with a letter. // The value cannot be changed. // You must set this value if you want instances to be able to use hostnames to // resolve other instances in the VCN. Otherwise the Internet and VCN Resolver // will not work. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `vcn1` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Whether IPv6 is enabled for the VCN. Default is `false`. You cannot change this later. // For important details about IPv6 addressing in a VCN, see IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `true` IsIpv6Enabled *bool `mandatory:"false" json:"isIpv6Enabled"` } func (m CreateVcnDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_vcn_request_response.go������������0000664�0000000�0000000�00000005443�13771713062�0031304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVcnRequest wrapper for the CreateVcn operation type CreateVcnRequest struct { // Details for creating a new VCN. CreateVcnDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVcnRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVcnRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVcnRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVcnResponse wrapper for the CreateVcn operation type CreateVcnResponse struct { // The underlying http response RawResponse *http.Response // The Vcn instance Vcn `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVcnResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVcnResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_details.go���������0000664�0000000�0000000�00000013142�13771713062�0031740�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVirtualCircuitDetails The representation of CreateVirtualCircuitDetails type CreateVirtualCircuitDetails struct { // The OCID of the compartment to contain the virtual circuit. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The type of IP addresses used in this virtual circuit. PRIVATE // means RFC 1918 (https://tools.ietf.org/html/rfc1918) addresses // (10.0.0.0/8, 172.16/12, and 192.168/16). Type CreateVirtualCircuitDetailsTypeEnum `mandatory:"true" json:"type"` // The provisioned data rate of the connection. To get a list of the // available bandwidth levels (that is, shapes), see // ListFastConnectProviderVirtualCircuitBandwidthShapes. // Example: `10 Gbps` BandwidthShapeName *string `mandatory:"false" json:"bandwidthShapeName"` // Create a `CrossConnectMapping` for each cross-connect or cross-connect // group this virtual circuit will run on. CrossConnectMappings []CrossConnectMapping `mandatory:"false" json:"crossConnectMappings"` // Deprecated. Instead use `customerAsn`. // If you specify values for both, the request will be rejected. CustomerBgpAsn *int `mandatory:"false" json:"customerBgpAsn"` // Your BGP ASN (either public or private). Provide this value only if // there's a BGP session that goes from your edge router to Oracle. // Otherwise, leave this empty or null. // Can be a 2-byte or 4-byte ASN. Uses "asplain" format. // Example: `12345` (2-byte) or `1587232876` (4-byte) CustomerAsn *int64 `mandatory:"false" json:"customerAsn"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // For private virtual circuits only. The OCID of the Drg // that this virtual circuit uses. GatewayId *string `mandatory:"false" json:"gatewayId"` // Deprecated. Instead use `providerServiceId`. // To get a list of the provider names, see // ListFastConnectProviderServices. ProviderName *string `mandatory:"false" json:"providerName"` // The OCID of the service offered by the provider (if you're connecting // via a provider). To get a list of the available service offerings, see // ListFastConnectProviderServices. ProviderServiceId *string `mandatory:"false" json:"providerServiceId"` // The service key name offered by the provider (if the customer is connecting via a provider). ProviderServiceKeyName *string `mandatory:"false" json:"providerServiceKeyName"` // Deprecated. Instead use `providerServiceId`. // To get a list of the provider names, see // ListFastConnectProviderServices. ProviderServiceName *string `mandatory:"false" json:"providerServiceName"` // For a public virtual circuit. The public IP prefixes (CIDRs) the customer wants to // advertise across the connection. PublicPrefixes []CreateVirtualCircuitPublicPrefixDetails `mandatory:"false" json:"publicPrefixes"` // The Oracle Cloud Infrastructure region where this virtual // circuit is located. // Example: `phx` Region *string `mandatory:"false" json:"region"` } func (m CreateVirtualCircuitDetails) String() string { return common.PointerString(m) } // CreateVirtualCircuitDetailsTypeEnum Enum with underlying type: string type CreateVirtualCircuitDetailsTypeEnum string // Set of constants representing the allowable values for CreateVirtualCircuitDetailsTypeEnum const ( CreateVirtualCircuitDetailsTypePublic CreateVirtualCircuitDetailsTypeEnum = "PUBLIC" CreateVirtualCircuitDetailsTypePrivate CreateVirtualCircuitDetailsTypeEnum = "PRIVATE" ) var mappingCreateVirtualCircuitDetailsType = map[string]CreateVirtualCircuitDetailsTypeEnum{ "PUBLIC": CreateVirtualCircuitDetailsTypePublic, "PRIVATE": CreateVirtualCircuitDetailsTypePrivate, } // GetCreateVirtualCircuitDetailsTypeEnumValues Enumerates the set of values for CreateVirtualCircuitDetailsTypeEnum func GetCreateVirtualCircuitDetailsTypeEnumValues() []CreateVirtualCircuitDetailsTypeEnum { values := make([]CreateVirtualCircuitDetailsTypeEnum, 0) for _, v := range mappingCreateVirtualCircuitDetailsType { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_virtual_circuit_public_prefix_details.go�����������������������������������������������������0000664�0000000�0000000�00000002451�13771713062�0034575�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVirtualCircuitPublicPrefixDetails The representation of CreateVirtualCircuitPublicPrefixDetails type CreateVirtualCircuitPublicPrefixDetails struct { // An individual public IP prefix (CIDR) to add to the public virtual circuit. // All prefix sizes are allowed. CidrBlock *string `mandatory:"true" json:"cidrBlock"` } func (m CreateVirtualCircuitPublicPrefixDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_virtual_circuit_request_response.go0000664�0000000�0000000�00000005701�13771713062�0033723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVirtualCircuitRequest wrapper for the CreateVirtualCircuit operation type CreateVirtualCircuitRequest struct { // Details to create a VirtualCircuit. CreateVirtualCircuitDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVirtualCircuitRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVirtualCircuitResponse wrapper for the CreateVirtualCircuit operation type CreateVirtualCircuitResponse struct { // The underlying http response RawResponse *http.Response // The VirtualCircuit instance VirtualCircuit `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVirtualCircuitResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVirtualCircuitResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_vnic_details.go��������������������0000664�0000000�0000000�00000013210�13771713062�0027463�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVnicDetails Contains properties for a VNIC. You use this object when creating the // primary VNIC during instance launch or when creating a secondary VNIC. // For more information about VNICs, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). type CreateVnicDetails struct { // The OCID of the subnet to create the VNIC in. When launching an instance, // use this `subnetId` instead of the deprecated `subnetId` in // LaunchInstanceDetails. // At least one of them is required; if you provide both, the values must match. SubnetId *string `mandatory:"true" json:"subnetId"` // Whether the VNIC should be assigned a public IP address. Defaults to whether // the subnet is public or private. If not set and the VNIC is being created // in a private subnet (that is, where `prohibitPublicIpOnVnic` = true in the // Subnet), then no public IP address is assigned. // If not set and the subnet is public (`prohibitPublicIpOnVnic` = false), then // a public IP address is assigned. If set to true and // `prohibitPublicIpOnVnic` = true, an error is returned. // **Note:** This public IP address is associated with the primary private IP // on the VNIC. For more information, see // IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). // **Note:** There's a limit to the number of PublicIp // a VNIC or instance can have. If you try to create a secondary VNIC // with an assigned public IP for an instance that has already // reached its public IP limit, an error is returned. For information // about the public IP limits, see // Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). // Example: `false` AssignPublicIp *bool `mandatory:"false" json:"assignPublicIp"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the VNIC. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname // portion of the primary private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be unique across all VNICs in the subnet and comply with // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // The value appears in the Vnic object and also the // PrivateIp object returned by // ListPrivateIps and // GetPrivateIp. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // When launching an instance, use this `hostnameLabel` instead // of the deprecated `hostnameLabel` in // LaunchInstanceDetails. // If you provide both, the values must match. // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // A list of the OCIDs of the network security groups (NSGs) to add the VNIC to. For more // information about NSGs, see // NetworkSecurityGroup. NsgIds []string `mandatory:"false" json:"nsgIds"` // A private IP address of your choice to assign to the VNIC. Must be an // available IP address within the subnet's CIDR. If you don't specify a // value, Oracle automatically assigns a private IP address from the subnet. // This is the VNIC's *primary* private IP address. The value appears in // the Vnic object and also the // PrivateIp object returned by // ListPrivateIps and // GetPrivateIp. // Example: `10.0.3.3` PrivateIp *string `mandatory:"false" json:"privateIp"` // Whether the source/destination check is disabled on the VNIC. // Defaults to `false`, which means the check is performed. For information // about why you would skip the source/destination check, see // Using a Private IP as a Route Target (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip). // Example: `true` SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` } func (m CreateVnicDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_details.go�����������0000664�0000000�0000000�00000006224�13771713062�0031367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVolumeBackupDetails The representation of CreateVolumeBackupDetails type CreateVolumeBackupDetails struct { // The OCID of the volume that needs to be backed up. VolumeId *string `mandatory:"true" json:"volumeId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the volume backup. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The type of backup to create. If omitted, defaults to INCREMENTAL. Type CreateVolumeBackupDetailsTypeEnum `mandatory:"false" json:"type,omitempty"` } func (m CreateVolumeBackupDetails) String() string { return common.PointerString(m) } // CreateVolumeBackupDetailsTypeEnum Enum with underlying type: string type CreateVolumeBackupDetailsTypeEnum string // Set of constants representing the allowable values for CreateVolumeBackupDetailsTypeEnum const ( CreateVolumeBackupDetailsTypeFull CreateVolumeBackupDetailsTypeEnum = "FULL" CreateVolumeBackupDetailsTypeIncremental CreateVolumeBackupDetailsTypeEnum = "INCREMENTAL" ) var mappingCreateVolumeBackupDetailsType = map[string]CreateVolumeBackupDetailsTypeEnum{ "FULL": CreateVolumeBackupDetailsTypeFull, "INCREMENTAL": CreateVolumeBackupDetailsTypeIncremental, } // GetCreateVolumeBackupDetailsTypeEnumValues Enumerates the set of values for CreateVolumeBackupDetailsTypeEnum func GetCreateVolumeBackupDetailsTypeEnumValues() []CreateVolumeBackupDetailsTypeEnum { values := make([]CreateVolumeBackupDetailsTypeEnum, 0) for _, v := range mappingCreateVolumeBackupDetailsType { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_volume_backup_policy_assignment_details.go���������������������������������������������������0000664�0000000�0000000�00000002547�13771713062�0035123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVolumeBackupPolicyAssignmentDetails The representation of CreateVolumeBackupPolicyAssignmentDetails type CreateVolumeBackupPolicyAssignmentDetails struct { // The OCID of the volume to assign the policy to. AssetId *string `mandatory:"true" json:"assetId"` // The OCID of the volume backup policy to assign to the volume. PolicyId *string `mandatory:"true" json:"policyId"` } func (m CreateVolumeBackupPolicyAssignmentDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������create_volume_backup_policy_assignment_request_response.go������������������������������������������0000664�0000000�0000000�00000005253�13771713062�0037101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVolumeBackupPolicyAssignmentRequest wrapper for the CreateVolumeBackupPolicyAssignment operation type CreateVolumeBackupPolicyAssignmentRequest struct { // Request to assign a specified policy to a particular volume. CreateVolumeBackupPolicyAssignmentDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVolumeBackupPolicyAssignmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVolumeBackupPolicyAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVolumeBackupPolicyAssignmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVolumeBackupPolicyAssignmentResponse wrapper for the CreateVolumeBackupPolicyAssignment operation type CreateVolumeBackupPolicyAssignmentResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackupPolicyAssignment instance VolumeBackupPolicyAssignment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVolumeBackupPolicyAssignmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVolumeBackupPolicyAssignmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_policy_details.go����0000664�0000000�0000000�00000005724�13771713062�0032752�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVolumeBackupPolicyDetails Specifies the properties for creating user defined backup policy. // For more information about user defined backup policies, // see User Defined Policies (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#UserDefinedBackupPolicies) in // Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm). type CreateVolumeBackupPolicyDetails struct { // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name for the volume backup policy. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The paired destination region (pre-defined by oracle) for scheduled cross region backup calls. Example: `us-ashburn-1` DestinationRegion *string `mandatory:"false" json:"destinationRegion"` // The collection of schedules for the volume backup policy. See // see Schedules (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#schedules) in // Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm) for more information. Schedules []VolumeBackupSchedule `mandatory:"false" json:"schedules"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateVolumeBackupPolicyDetails) String() string { return common.PointerString(m) } ��������������������������������������������create_volume_backup_policy_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000005766�13771713062�0034662�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVolumeBackupPolicyRequest wrapper for the CreateVolumeBackupPolicy operation type CreateVolumeBackupPolicyRequest struct { // Request to create a new scheduled backup policy. CreateVolumeBackupPolicyDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVolumeBackupPolicyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVolumeBackupPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVolumeBackupPolicyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVolumeBackupPolicyResponse wrapper for the CreateVolumeBackupPolicy operation type CreateVolumeBackupPolicyResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackupPolicy instance VolumeBackupPolicy `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVolumeBackupPolicyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVolumeBackupPolicyResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_backup_request_response.go��0000664�0000000�0000000�00000005661�13771713062�0033354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVolumeBackupRequest wrapper for the CreateVolumeBackup operation type CreateVolumeBackupRequest struct { // Request to create a new backup of given volume. CreateVolumeBackupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVolumeBackupResponse wrapper for the CreateVolumeBackup operation type CreateVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackup instance VolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_details.go������������������0000664�0000000�0000000�00000013375�13771713062�0030047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateVolumeDetails The representation of CreateVolumeDetails type CreateVolumeDetails struct { // The availability domain of the volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the volume. CompartmentId *string `mandatory:"true" json:"compartmentId"` // If provided, specifies the ID of the volume backup policy to assign to the newly // created volume. If omitted, no policy will be assigned. BackupPolicyId *string `mandatory:"false" json:"backupPolicyId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the Key Management key to assign as the master encryption key // for the volume. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` // The number of volume performance units (VPUs) that will be applied to this volume per GB, // representing the Block Volume service's elastic performance options. // See Block Volume Elastic Performance (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumeelasticperformance.htm) for more information. // Allowed values: // * `0`: Represents Lower Cost option. // * `10`: Represents Balanced option. // * `20`: Represents Higher Performance option. VpusPerGB *int64 `mandatory:"false" json:"vpusPerGB"` // The size of the volume in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The size of the volume in MBs. The value must be a multiple of 1024. // This field is deprecated. Use sizeInGBs instead. SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` // Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same availability domain or a Block volume backup. // This is an optional field. If not specified or set to null, the new Block volume will be empty. // When specified, the new Block volume will contain data from the source volume or backup. SourceDetails VolumeSourceDetails `mandatory:"false" json:"sourceDetails"` // The OCID of the volume backup from which the data should be restored on the newly created volume. // This field is deprecated. Use the sourceDetails field instead to specify the // backup for the volume. VolumeBackupId *string `mandatory:"false" json:"volumeBackupId"` } func (m CreateVolumeDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *CreateVolumeDetails) UnmarshalJSON(data []byte) (e error) { model := struct { BackupPolicyId *string `json:"backupPolicyId"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` KmsKeyId *string `json:"kmsKeyId"` VpusPerGB *int64 `json:"vpusPerGB"` SizeInGBs *int64 `json:"sizeInGBs"` SizeInMBs *int64 `json:"sizeInMBs"` SourceDetails volumesourcedetails `json:"sourceDetails"` VolumeBackupId *string `json:"volumeBackupId"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.BackupPolicyId = model.BackupPolicyId m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.KmsKeyId = model.KmsKeyId m.VpusPerGB = model.VpusPerGB m.SizeInGBs = model.SizeInGBs m.SizeInMBs = model.SizeInMBs nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(VolumeSourceDetails) } else { m.SourceDetails = nil } m.VolumeBackupId = model.VolumeBackupId m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId return } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_backup_details.go�����0000664�0000000�0000000�00000007023�13771713062�0032601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CreateVolumeGroupBackupDetails The representation of CreateVolumeGroupBackupDetails type CreateVolumeGroupBackupDetails struct { // The OCID of the volume group that needs to be backed up. VolumeGroupId *string `mandatory:"true" json:"volumeGroupId"` // The OCID of the compartment that will contain the volume group backup. This parameter is optional, by default backup will be created in the same compartment and source volume group. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the volume group backup. Does not have // to be unique and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The type of backup to create. If omitted, defaults to incremental. Type CreateVolumeGroupBackupDetailsTypeEnum `mandatory:"false" json:"type,omitempty"` } func (m CreateVolumeGroupBackupDetails) String() string { return common.PointerString(m) } // CreateVolumeGroupBackupDetailsTypeEnum Enum with underlying type: string type CreateVolumeGroupBackupDetailsTypeEnum string // Set of constants representing the allowable values for CreateVolumeGroupBackupDetailsTypeEnum const ( CreateVolumeGroupBackupDetailsTypeFull CreateVolumeGroupBackupDetailsTypeEnum = "FULL" CreateVolumeGroupBackupDetailsTypeIncremental CreateVolumeGroupBackupDetailsTypeEnum = "INCREMENTAL" ) var mappingCreateVolumeGroupBackupDetailsType = map[string]CreateVolumeGroupBackupDetailsTypeEnum{ "FULL": CreateVolumeGroupBackupDetailsTypeFull, "INCREMENTAL": CreateVolumeGroupBackupDetailsTypeIncremental, } // GetCreateVolumeGroupBackupDetailsTypeEnumValues Enumerates the set of values for CreateVolumeGroupBackupDetailsTypeEnum func GetCreateVolumeGroupBackupDetailsTypeEnumValues() []CreateVolumeGroupBackupDetailsTypeEnum { values := make([]CreateVolumeGroupBackupDetailsTypeEnum, 0) for _, v := range mappingCreateVolumeGroupBackupDetailsType { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������create_volume_group_backup_request_response.go������������������������������������������������������0000664�0000000�0000000�00000006003�13771713062�0034500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVolumeGroupBackupRequest wrapper for the CreateVolumeGroupBackup operation type CreateVolumeGroupBackupRequest struct { // Request to create a new backup group of given volume group. CreateVolumeGroupBackupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVolumeGroupBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVolumeGroupBackupResponse wrapper for the CreateVolumeGroupBackup operation type CreateVolumeGroupBackupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeGroupBackup instance VolumeGroupBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVolumeGroupBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVolumeGroupBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_details.go������������0000664�0000000�0000000�00000007110�13771713062�0031251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // CreateVolumeGroupDetails The representation of CreateVolumeGroupDetails type CreateVolumeGroupDetails struct { // The availability domain of the volume group. AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the volume group. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Specifies the volume group source details for a new volume group. The volume source is either another a list of // volume ids in the same availability domain, another volume group or a volume group backup. SourceDetails VolumeGroupSourceDetails `mandatory:"true" json:"sourceDetails"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the volume group. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m CreateVolumeGroupDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *CreateVolumeGroupDetails) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` SourceDetails volumegroupsourcedetails `json:"sourceDetails"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(VolumeGroupSourceDetails) } else { m.SourceDetails = nil } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_group_request_response.go���0000664�0000000�0000000�00000005631�13771713062�0033240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVolumeGroupRequest wrapper for the CreateVolumeGroup operation type CreateVolumeGroupRequest struct { // Request to create a new volume group. CreateVolumeGroupDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVolumeGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVolumeGroupResponse wrapper for the CreateVolumeGroup operation type CreateVolumeGroupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeGroup instance VolumeGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVolumeGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVolumeGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/create_volume_request_response.go���������0000664�0000000�0000000�00000005515�13771713062�0032025�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // CreateVolumeRequest wrapper for the CreateVolume operation type CreateVolumeRequest struct { // Request to create a new volume. CreateVolumeDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request CreateVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request CreateVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request CreateVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // CreateVolumeResponse wrapper for the CreateVolume operation type CreateVolumeResponse struct { // The underlying http response RawResponse *http.Response // The Volume instance Volume `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response CreateVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response CreateVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cross_connect.go��������������������������0000664�0000000�0000000�00000013545�13771713062�0026351�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CrossConnect For use with Oracle Cloud Infrastructure FastConnect. A cross-connect represents a // physical connection between an existing network and Oracle. Customers who are colocated // with Oracle in a FastConnect location create and use cross-connects. For more // information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // Oracle recommends you create each cross-connect in a // CrossConnectGroup so you can use link aggregation // with the connection. // **Note:** If you're a provider who is setting up a physical connection to Oracle so customers // can use FastConnect over the connection, be aware that your connection is modeled the // same way as a colocated customer's (with `CrossConnect` and `CrossConnectGroup` objects, and so on). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type CrossConnect struct { // The OCID of the compartment containing the cross-connect group. CompartmentId *string `mandatory:"false" json:"compartmentId"` // The OCID of the cross-connect group this cross-connect belongs to (if any). CrossConnectGroupId *string `mandatory:"false" json:"crossConnectGroupId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The cross-connect's Oracle ID (OCID). Id *string `mandatory:"false" json:"id"` // The cross-connect's current state. LifecycleState CrossConnectLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The name of the FastConnect location where this cross-connect is installed. LocationName *string `mandatory:"false" json:"locationName"` // A string identifying the meet-me room port for this cross-connect. PortName *string `mandatory:"false" json:"portName"` // The port speed for this cross-connect. // Example: `10 Gbps` PortSpeedShapeName *string `mandatory:"false" json:"portSpeedShapeName"` // A reference name or identifier for the physical fiber connection that this cross-connect // uses. CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` // The date and time the cross-connect was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m CrossConnect) String() string { return common.PointerString(m) } // CrossConnectLifecycleStateEnum Enum with underlying type: string type CrossConnectLifecycleStateEnum string // Set of constants representing the allowable values for CrossConnectLifecycleStateEnum const ( CrossConnectLifecycleStatePendingCustomer CrossConnectLifecycleStateEnum = "PENDING_CUSTOMER" CrossConnectLifecycleStateProvisioning CrossConnectLifecycleStateEnum = "PROVISIONING" CrossConnectLifecycleStateProvisioned CrossConnectLifecycleStateEnum = "PROVISIONED" CrossConnectLifecycleStateInactive CrossConnectLifecycleStateEnum = "INACTIVE" CrossConnectLifecycleStateTerminating CrossConnectLifecycleStateEnum = "TERMINATING" CrossConnectLifecycleStateTerminated CrossConnectLifecycleStateEnum = "TERMINATED" ) var mappingCrossConnectLifecycleState = map[string]CrossConnectLifecycleStateEnum{ "PENDING_CUSTOMER": CrossConnectLifecycleStatePendingCustomer, "PROVISIONING": CrossConnectLifecycleStateProvisioning, "PROVISIONED": CrossConnectLifecycleStateProvisioned, "INACTIVE": CrossConnectLifecycleStateInactive, "TERMINATING": CrossConnectLifecycleStateTerminating, "TERMINATED": CrossConnectLifecycleStateTerminated, } // GetCrossConnectLifecycleStateEnumValues Enumerates the set of values for CrossConnectLifecycleStateEnum func GetCrossConnectLifecycleStateEnumValues() []CrossConnectLifecycleStateEnum { values := make([]CrossConnectLifecycleStateEnum, 0) for _, v := range mappingCrossConnectLifecycleState { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_group.go��������������������0000664�0000000�0000000�00000012276�13771713062�0027565�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CrossConnectGroup For use with Oracle Cloud Infrastructure FastConnect. A cross-connect group // is a link aggregation group (LAG), which can contain one or more // CrossConnect. Customers who are colocated with // Oracle in a FastConnect location create and use cross-connect groups. For more // information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // **Note:** If you're a provider who is setting up a physical connection to Oracle so customers // can use FastConnect over the connection, be aware that your connection is modeled the // same way as a colocated customer's (with `CrossConnect` and `CrossConnectGroup` objects, and so on). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type CrossConnectGroup struct { // The OCID of the compartment containing the cross-connect group. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The display name of a user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The cross-connect group's Oracle ID (OCID). Id *string `mandatory:"false" json:"id"` // The cross-connect group's current state. LifecycleState CrossConnectGroupLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // A reference name or identifier for the physical fiber connection that this cross-connect // group uses. CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` // The date and time the cross-connect group was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m CrossConnectGroup) String() string { return common.PointerString(m) } // CrossConnectGroupLifecycleStateEnum Enum with underlying type: string type CrossConnectGroupLifecycleStateEnum string // Set of constants representing the allowable values for CrossConnectGroupLifecycleStateEnum const ( CrossConnectGroupLifecycleStateProvisioning CrossConnectGroupLifecycleStateEnum = "PROVISIONING" CrossConnectGroupLifecycleStateProvisioned CrossConnectGroupLifecycleStateEnum = "PROVISIONED" CrossConnectGroupLifecycleStateInactive CrossConnectGroupLifecycleStateEnum = "INACTIVE" CrossConnectGroupLifecycleStateTerminating CrossConnectGroupLifecycleStateEnum = "TERMINATING" CrossConnectGroupLifecycleStateTerminated CrossConnectGroupLifecycleStateEnum = "TERMINATED" ) var mappingCrossConnectGroupLifecycleState = map[string]CrossConnectGroupLifecycleStateEnum{ "PROVISIONING": CrossConnectGroupLifecycleStateProvisioning, "PROVISIONED": CrossConnectGroupLifecycleStateProvisioned, "INACTIVE": CrossConnectGroupLifecycleStateInactive, "TERMINATING": CrossConnectGroupLifecycleStateTerminating, "TERMINATED": CrossConnectGroupLifecycleStateTerminated, } // GetCrossConnectGroupLifecycleStateEnumValues Enumerates the set of values for CrossConnectGroupLifecycleStateEnum func GetCrossConnectGroupLifecycleStateEnumValues() []CrossConnectGroupLifecycleStateEnum { values := make([]CrossConnectGroupLifecycleStateEnum, 0) for _, v := range mappingCrossConnectGroupLifecycleState { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_location.go�����������������0000664�0000000�0000000�00000002375�13771713062�0030240�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CrossConnectLocation An individual FastConnect location. type CrossConnectLocation struct { // A description of the location. Description *string `mandatory:"true" json:"description"` // The name of the location. // Example: `CyrusOne, Chandler, AZ` Name *string `mandatory:"true" json:"name"` } func (m CrossConnectLocation) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_mapping.go������������������0000664�0000000�0000000�00000014124�13771713062�0030056�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CrossConnectMapping For use with Oracle Cloud Infrastructure FastConnect. Each // VirtualCircuit runs on one or // more cross-connects or cross-connect groups. A `CrossConnectMapping` // contains the properties for an individual cross-connect or cross-connect group // associated with a given virtual circuit. // The mapping includes information about the cross-connect or // cross-connect group, the VLAN, and the BGP peering session. // If you're a customer who is colocated with Oracle, that means you own both // the virtual circuit and the physical connection it runs on (cross-connect or // cross-connect group), so you specify all the information in the mapping. There's // one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 // addresses. // If you're a provider, then you own the physical connection that the customer's // virtual circuit runs on, so you contribute information about the cross-connect // or cross-connect group and VLAN. // Who specifies the BGP peering information in the case of customer connection via // provider? If the BGP session goes from Oracle to the provider's edge router, then // the provider also specifies the BGP peering information. If the BGP session instead // goes from Oracle to the customer's edge router, then the customer specifies the BGP // peering information. There's one exception: for a public virtual circuit, Oracle // specifies the BGP IPv4 addresses. // Every `CrossConnectMapping` must have BGP IPv4 peering addresses. BGP IPv6 peering // addresses are optional. If BGP IPv6 addresses are provided, the customer can // exchange IPv6 routes with Oracle. type CrossConnectMapping struct { // The key for BGP MD5 authentication. Only applicable if your system // requires MD5 authentication. If empty or not set (null), that // means you don't use BGP MD5 authentication. BgpMd5AuthKey *string `mandatory:"false" json:"bgpMd5AuthKey"` // The OCID of the cross-connect or cross-connect group for this mapping. // Specified by the owner of the cross-connect or cross-connect group (the // customer if the customer is colocated with Oracle, or the provider if the // customer is connecting via provider). CrossConnectOrCrossConnectGroupId *string `mandatory:"false" json:"crossConnectOrCrossConnectGroupId"` // The BGP IPv4 address for the router on the other end of the BGP session from // Oracle. Specified by the owner of that router. If the session goes from Oracle // to a customer, this is the BGP IPv4 address of the customer's edge router. If the // session goes from Oracle to a provider, this is the BGP IPv4 address of the // provider's edge router. Must use a /30 or /31 subnet mask. // There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses. // Example: `10.0.0.18/31` CustomerBgpPeeringIp *string `mandatory:"false" json:"customerBgpPeeringIp"` // The IPv4 address for Oracle's end of the BGP session. Must use a /30 or /31 // subnet mask. If the session goes from Oracle to a customer's edge router, // the customer specifies this information. If the session goes from Oracle to // a provider's edge router, the provider specifies this. // There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv4 addresses. // Example: `10.0.0.19/31` OracleBgpPeeringIp *string `mandatory:"false" json:"oracleBgpPeeringIp"` // The BGP IPv6 address for the router on the other end of the BGP session from // Oracle. Specified by the owner of that router. If the session goes from Oracle // to a customer, this is the BGP IPv6 address of the customer's edge router. If the // session goes from Oracle to a provider, this is the BGP IPv6 address of the // provider's edge router. Only subnet masks from /64 up to /127 are allowed. // There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv6 addresses. // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `2001:db8::1/64` CustomerBgpPeeringIpv6 *string `mandatory:"false" json:"customerBgpPeeringIpv6"` // The IPv6 address for Oracle's end of the BGP session. Only subnet masks from /64 up to /127 are allowed. // If the session goes from Oracle to a customer's edge router, // the customer specifies this information. If the session goes from Oracle to // a provider's edge router, the provider specifies this. // There's one exception: for a public virtual circuit, Oracle specifies the BGP IPv6 addresses. // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `2001:db8::2/64` OracleBgpPeeringIpv6 *string `mandatory:"false" json:"oracleBgpPeeringIpv6"` // The number of the specific VLAN (on the cross-connect or cross-connect group) // that is assigned to this virtual circuit. Specified by the owner of the cross-connect // or cross-connect group (the customer if the customer is colocated with Oracle, or // the provider if the customer is connecting via provider). // Example: `200` Vlan *int `mandatory:"false" json:"vlan"` } func (m CrossConnectMapping) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_port_speed_shape.go���������0000664�0000000�0000000�00000002447�13771713062�0031754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CrossConnectPortSpeedShape An individual port speed level for cross-connects. type CrossConnectPortSpeedShape struct { // The name of the port speed shape. // Example: `10 Gbps` Name *string `mandatory:"true" json:"name"` // The port speed in Gbps. // Example: `10` PortSpeedInGbps *int `mandatory:"true" json:"portSpeedInGbps"` } func (m CrossConnectPortSpeedShape) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/cross_connect_status.go�������������������0000664�0000000�0000000�00000010527�13771713062�0027751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // CrossConnectStatus The status of the cross-connect. type CrossConnectStatus struct { // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" json:"crossConnectId"` // Whether Oracle's side of the interface is up or down. InterfaceState CrossConnectStatusInterfaceStateEnum `mandatory:"false" json:"interfaceState,omitempty"` // The light level of the cross-connect (in dBm). // Example: `14.0` LightLevelIndBm *float32 `mandatory:"false" json:"lightLevelIndBm"` // Status indicator corresponding to the light level. // * **NO_LIGHT:** No measurable light // * **LOW_WARN:** There's measurable light but it's too low // * **HIGH_WARN:** Light level is too high // * **BAD:** There's measurable light but the signal-to-noise ratio is bad // * **GOOD:** Good light level LightLevelIndicator CrossConnectStatusLightLevelIndicatorEnum `mandatory:"false" json:"lightLevelIndicator,omitempty"` } func (m CrossConnectStatus) String() string { return common.PointerString(m) } // CrossConnectStatusInterfaceStateEnum Enum with underlying type: string type CrossConnectStatusInterfaceStateEnum string // Set of constants representing the allowable values for CrossConnectStatusInterfaceStateEnum const ( CrossConnectStatusInterfaceStateUp CrossConnectStatusInterfaceStateEnum = "UP" CrossConnectStatusInterfaceStateDown CrossConnectStatusInterfaceStateEnum = "DOWN" ) var mappingCrossConnectStatusInterfaceState = map[string]CrossConnectStatusInterfaceStateEnum{ "UP": CrossConnectStatusInterfaceStateUp, "DOWN": CrossConnectStatusInterfaceStateDown, } // GetCrossConnectStatusInterfaceStateEnumValues Enumerates the set of values for CrossConnectStatusInterfaceStateEnum func GetCrossConnectStatusInterfaceStateEnumValues() []CrossConnectStatusInterfaceStateEnum { values := make([]CrossConnectStatusInterfaceStateEnum, 0) for _, v := range mappingCrossConnectStatusInterfaceState { values = append(values, v) } return values } // CrossConnectStatusLightLevelIndicatorEnum Enum with underlying type: string type CrossConnectStatusLightLevelIndicatorEnum string // Set of constants representing the allowable values for CrossConnectStatusLightLevelIndicatorEnum const ( CrossConnectStatusLightLevelIndicatorNoLight CrossConnectStatusLightLevelIndicatorEnum = "NO_LIGHT" CrossConnectStatusLightLevelIndicatorLowWarn CrossConnectStatusLightLevelIndicatorEnum = "LOW_WARN" CrossConnectStatusLightLevelIndicatorHighWarn CrossConnectStatusLightLevelIndicatorEnum = "HIGH_WARN" CrossConnectStatusLightLevelIndicatorBad CrossConnectStatusLightLevelIndicatorEnum = "BAD" CrossConnectStatusLightLevelIndicatorGood CrossConnectStatusLightLevelIndicatorEnum = "GOOD" ) var mappingCrossConnectStatusLightLevelIndicator = map[string]CrossConnectStatusLightLevelIndicatorEnum{ "NO_LIGHT": CrossConnectStatusLightLevelIndicatorNoLight, "LOW_WARN": CrossConnectStatusLightLevelIndicatorLowWarn, "HIGH_WARN": CrossConnectStatusLightLevelIndicatorHighWarn, "BAD": CrossConnectStatusLightLevelIndicatorBad, "GOOD": CrossConnectStatusLightLevelIndicatorGood, } // GetCrossConnectStatusLightLevelIndicatorEnumValues Enumerates the set of values for CrossConnectStatusLightLevelIndicatorEnum func GetCrossConnectStatusLightLevelIndicatorEnumValues() []CrossConnectStatusLightLevelIndicatorEnum { values := make([]CrossConnectStatusLightLevelIndicatorEnum, 0) for _, v := range mappingCrossConnectStatusLightLevelIndicator { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dedicated_vm_host.go����������������������0000664�0000000�0000000�00000012540�13771713062�0027146�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DedicatedVmHost A dedicated virtual machine host that enables you to host multiple VM instances // on a dedicated host that is not shared with other tenancies. type DedicatedVmHost struct { // The availability domain the dedicated virtual machine host is running in. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the dedicated virtual machine host. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The dedicated virtual machine host shape. The shape determines the number of CPUs and // other resources available for VMs. DedicatedVmHostShape *string `mandatory:"true" json:"dedicatedVmHostShape"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My Dedicated Vm Host` DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the dedicated VM host. Id *string `mandatory:"true" json:"id"` // The current state of the dedicated VM host. LifecycleState DedicatedVmHostLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the dedicated VM host was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The total OCPUs of the dedicated VM host. TotalOcpus *float32 `mandatory:"true" json:"totalOcpus"` // The available OCPUs of the dedicated VM host. RemainingOcpus *float32 `mandatory:"true" json:"remainingOcpus"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The fault domain for the dedicated virtual machine host's assigned instances. // For more information, see Fault Domains (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm#fault). // If you do not specify the fault domain, the system selects one for you. To change the fault domain for a dedicated virtual machine host, // delete it, and then create a new dedicated virtual machine host in the preferred fault domain. // To get a list of fault domains, use the `ListFaultDomains` operation in the Identity and Access Management Service API (https://docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/). // Example: `FAULT-DOMAIN-1` FaultDomain *string `mandatory:"false" json:"faultDomain"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m DedicatedVmHost) String() string { return common.PointerString(m) } // DedicatedVmHostLifecycleStateEnum Enum with underlying type: string type DedicatedVmHostLifecycleStateEnum string // Set of constants representing the allowable values for DedicatedVmHostLifecycleStateEnum const ( DedicatedVmHostLifecycleStateCreating DedicatedVmHostLifecycleStateEnum = "CREATING" DedicatedVmHostLifecycleStateActive DedicatedVmHostLifecycleStateEnum = "ACTIVE" DedicatedVmHostLifecycleStateUpdating DedicatedVmHostLifecycleStateEnum = "UPDATING" DedicatedVmHostLifecycleStateDeleting DedicatedVmHostLifecycleStateEnum = "DELETING" DedicatedVmHostLifecycleStateDeleted DedicatedVmHostLifecycleStateEnum = "DELETED" DedicatedVmHostLifecycleStateFailed DedicatedVmHostLifecycleStateEnum = "FAILED" ) var mappingDedicatedVmHostLifecycleState = map[string]DedicatedVmHostLifecycleStateEnum{ "CREATING": DedicatedVmHostLifecycleStateCreating, "ACTIVE": DedicatedVmHostLifecycleStateActive, "UPDATING": DedicatedVmHostLifecycleStateUpdating, "DELETING": DedicatedVmHostLifecycleStateDeleting, "DELETED": DedicatedVmHostLifecycleStateDeleted, "FAILED": DedicatedVmHostLifecycleStateFailed, } // GetDedicatedVmHostLifecycleStateEnumValues Enumerates the set of values for DedicatedVmHostLifecycleStateEnum func GetDedicatedVmHostLifecycleStateEnumValues() []DedicatedVmHostLifecycleStateEnum { values := make([]DedicatedVmHostLifecycleStateEnum, 0) for _, v := range mappingDedicatedVmHostLifecycleState { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������dedicated_vm_host_instance_shape_summary.go���������������������������������������������������������0000664�0000000�0000000�00000002630�13771713062�0033707�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DedicatedVmHostInstanceShapeSummary The shape used to launch instances associated with the dedicated VM host. type DedicatedVmHostInstanceShapeSummary struct { // The name of the virtual machine instance shapes that can be launched on a dedicated VM host. InstanceShapeName *string `mandatory:"true" json:"instanceShapeName"` // The shape's availability domain. AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` } func (m DedicatedVmHostInstanceShapeSummary) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dedicated_vm_host_instance_summary.go�����0000664�0000000�0000000�00000003460�13771713062�0032610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DedicatedVmHostInstanceSummary Condensed instance data when listing instances on a dedicated VM host. type DedicatedVmHostInstanceSummary struct { // The availability domain the virtual machine instance is running in. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the virtual machine instance. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the virtual machine instance. InstanceId *string `mandatory:"true" json:"instanceId"` // The shape of the VM instance. Shape *string `mandatory:"true" json:"shape"` // The date and time the virtual machine instance was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` } func (m DedicatedVmHostInstanceSummary) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dedicated_vm_host_shape_summary.go��������0000664�0000000�0000000�00000002627�13771713062�0032110�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DedicatedVmHostShapeSummary The shape used to launch the dedicated virtual machine (VM) host. type DedicatedVmHostShapeSummary struct { // The name of the dedicated vm host shape. You can enumerate all available shapes by calling // dedicatedVmHostShapes. DedicatedVmHostShape *string `mandatory:"true" json:"dedicatedVmHostShape"` // The shape's availability domain. AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` } func (m DedicatedVmHostShapeSummary) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dedicated_vm_host_summary.go��������������0000664�0000000�0000000�00000011265�13771713062�0030726�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DedicatedVmHostSummary A dedicated virtual machine (VM) host that enables you to host multiple instances on a dedicated host instance that is not shared with other tenancies. type DedicatedVmHostSummary struct { // The availability domain the dedicated VM host is running in. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the dedicated VM host. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The shape of the dedicated VM host. The shape determines the number of CPUs and // other resources available for VMs. DedicatedVmHostShape *string `mandatory:"true" json:"dedicatedVmHostShape"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My DVH` DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the dedicated VM host. Id *string `mandatory:"true" json:"id"` // The current state of the dedicated VM host. LifecycleState DedicatedVmHostSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the dedicated VM host was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The current available OCPUs of the dedicated VM host. RemainingOcpus *float32 `mandatory:"true" json:"remainingOcpus"` // The current total OCPUs of the dedicated VM host. TotalOcpus *float32 `mandatory:"true" json:"totalOcpus"` // The fault domain for the dedicated VM host's assigned instances. For more information, see Fault Domains. // If you do not specify the fault domain, the system selects one for you. To change the fault domain for a dedicated VM host, // delete it and create a new dedicated VM host in the preferred fault domain. // To get a list of fault domains, use the ListFaultDomains operation in the Identity and Access Management Service API. // Example: `FAULT-DOMAIN-1` FaultDomain *string `mandatory:"false" json:"faultDomain"` } func (m DedicatedVmHostSummary) String() string { return common.PointerString(m) } // DedicatedVmHostSummaryLifecycleStateEnum Enum with underlying type: string type DedicatedVmHostSummaryLifecycleStateEnum string // Set of constants representing the allowable values for DedicatedVmHostSummaryLifecycleStateEnum const ( DedicatedVmHostSummaryLifecycleStateCreating DedicatedVmHostSummaryLifecycleStateEnum = "CREATING" DedicatedVmHostSummaryLifecycleStateActive DedicatedVmHostSummaryLifecycleStateEnum = "ACTIVE" DedicatedVmHostSummaryLifecycleStateUpdating DedicatedVmHostSummaryLifecycleStateEnum = "UPDATING" DedicatedVmHostSummaryLifecycleStateDeleting DedicatedVmHostSummaryLifecycleStateEnum = "DELETING" DedicatedVmHostSummaryLifecycleStateDeleted DedicatedVmHostSummaryLifecycleStateEnum = "DELETED" DedicatedVmHostSummaryLifecycleStateFailed DedicatedVmHostSummaryLifecycleStateEnum = "FAILED" ) var mappingDedicatedVmHostSummaryLifecycleState = map[string]DedicatedVmHostSummaryLifecycleStateEnum{ "CREATING": DedicatedVmHostSummaryLifecycleStateCreating, "ACTIVE": DedicatedVmHostSummaryLifecycleStateActive, "UPDATING": DedicatedVmHostSummaryLifecycleStateUpdating, "DELETING": DedicatedVmHostSummaryLifecycleStateDeleting, "DELETED": DedicatedVmHostSummaryLifecycleStateDeleted, "FAILED": DedicatedVmHostSummaryLifecycleStateFailed, } // GetDedicatedVmHostSummaryLifecycleStateEnumValues Enumerates the set of values for DedicatedVmHostSummaryLifecycleStateEnum func GetDedicatedVmHostSummaryLifecycleStateEnumValues() []DedicatedVmHostSummaryLifecycleStateEnum { values := make([]DedicatedVmHostSummaryLifecycleStateEnum, 0) for _, v := range mappingDedicatedVmHostSummaryLifecycleState { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_app_catalog_subscription_request_response.go�������������������������������������������������0000664�0000000�0000000�00000005300�13771713062�0035504�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteAppCatalogSubscriptionRequest wrapper for the DeleteAppCatalogSubscription operation type DeleteAppCatalogSubscriptionRequest struct { // The OCID of the listing. ListingId *string `mandatory:"true" contributesTo:"query" name:"listingId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // Listing Resource Version. ResourceVersion *string `mandatory:"true" contributesTo:"query" name:"resourceVersion"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteAppCatalogSubscriptionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteAppCatalogSubscriptionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteAppCatalogSubscriptionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteAppCatalogSubscriptionResponse wrapper for the DeleteAppCatalogSubscription operation type DeleteAppCatalogSubscriptionResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteAppCatalogSubscriptionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteAppCatalogSubscriptionResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_boot_volume_backup_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005350�13771713062�0034312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteBootVolumeBackupRequest wrapper for the DeleteBootVolumeBackup operation type DeleteBootVolumeBackupRequest struct { // The OCID of the boot volume backup. BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteBootVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteBootVolumeBackupResponse wrapper for the DeleteBootVolumeBackup operation type DeleteBootVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteBootVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteBootVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_boot_volume_kms_key_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005325�13771713062�0034511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteBootVolumeKmsKeyRequest wrapper for the DeleteBootVolumeKmsKey operation type DeleteBootVolumeKmsKeyRequest struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteBootVolumeKmsKeyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteBootVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteBootVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteBootVolumeKmsKeyResponse wrapper for the DeleteBootVolumeKmsKey operation type DeleteBootVolumeKmsKeyResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteBootVolumeKmsKeyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteBootVolumeKmsKeyResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_boot_volume_request_response.go����0000664�0000000�0000000�00000005223�13771713062�0033043�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteBootVolumeRequest wrapper for the DeleteBootVolume operation type DeleteBootVolumeRequest struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteBootVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteBootVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteBootVolumeResponse wrapper for the DeleteBootVolume operation type DeleteBootVolumeResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteBootVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteBootVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_console_history_request_response.go0000664�0000000�0000000�00000005333�13771713062�0033736�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteConsoleHistoryRequest wrapper for the DeleteConsoleHistory operation type DeleteConsoleHistoryRequest struct { // The OCID of the console history. InstanceConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleHistoryId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteConsoleHistoryRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteConsoleHistoryResponse wrapper for the DeleteConsoleHistory operation type DeleteConsoleHistoryResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteConsoleHistoryResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteConsoleHistoryResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_cpe_request_response.go������������0000664�0000000�0000000�00000005060�13771713062�0031257�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteCpeRequest wrapper for the DeleteCpe operation type DeleteCpeRequest struct { // The OCID of the CPE. CpeId *string `mandatory:"true" contributesTo:"path" name:"cpeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteCpeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteCpeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteCpeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteCpeResponse wrapper for the DeleteCpe operation type DeleteCpeResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteCpeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteCpeResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_cross_connect_group_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005366�13771713062�0034520�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteCrossConnectGroupRequest wrapper for the DeleteCrossConnectGroup operation type DeleteCrossConnectGroupRequest struct { // The OCID of the cross-connect group. CrossConnectGroupId *string `mandatory:"true" contributesTo:"path" name:"crossConnectGroupId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteCrossConnectGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteCrossConnectGroupResponse wrapper for the DeleteCrossConnectGroup operation type DeleteCrossConnectGroupResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteCrossConnectGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteCrossConnectGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_cross_connect_request_response.go��0000664�0000000�0000000�00000005257�13771713062�0033362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteCrossConnectRequest wrapper for the DeleteCrossConnect operation type DeleteCrossConnectRequest struct { // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteCrossConnectRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteCrossConnectRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteCrossConnectResponse wrapper for the DeleteCrossConnect operation type DeleteCrossConnectResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteCrossConnectResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteCrossConnectResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_dedicated_vm_host_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000005123�13771713062�0034076�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteDedicatedVmHostRequest wrapper for the DeleteDedicatedVmHost operation type DeleteDedicatedVmHostRequest struct { // The OCID of the dedicated VM host. DedicatedVmHostId *string `mandatory:"true" contributesTo:"path" name:"dedicatedVmHostId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteDedicatedVmHostRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteDedicatedVmHostRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteDedicatedVmHostRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteDedicatedVmHostResponse wrapper for the DeleteDedicatedVmHost operation type DeleteDedicatedVmHostResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response DeleteDedicatedVmHostResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteDedicatedVmHostResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_dhcp_options_request_response.go���0000664�0000000�0000000�00000005233�13771713062�0033203�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteDhcpOptionsRequest wrapper for the DeleteDhcpOptions operation type DeleteDhcpOptionsRequest struct { // The OCID for the set of DHCP options. DhcpId *string `mandatory:"true" contributesTo:"path" name:"dhcpId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteDhcpOptionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteDhcpOptionsResponse wrapper for the DeleteDhcpOptions operation type DeleteDhcpOptionsResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteDhcpOptionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteDhcpOptionsResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_attachment_request_response.go�0000664�0000000�0000000�00000005275�13771713062�0033504�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteDrgAttachmentRequest wrapper for the DeleteDrgAttachment operation type DeleteDrgAttachmentRequest struct { // The OCID of the DRG attachment. DrgAttachmentId *string `mandatory:"true" contributesTo:"path" name:"drgAttachmentId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteDrgAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteDrgAttachmentResponse wrapper for the DeleteDrgAttachment operation type DeleteDrgAttachmentResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteDrgAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteDrgAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_drg_request_response.go������������0000664�0000000�0000000�00000005060�13771713062�0031264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteDrgRequest wrapper for the DeleteDrg operation type DeleteDrgRequest struct { // The OCID of the DRG. DrgId *string `mandatory:"true" contributesTo:"path" name:"drgId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteDrgRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteDrgRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteDrgRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteDrgResponse wrapper for the DeleteDrg operation type DeleteDrgResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteDrgResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteDrgResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_i_p_sec_connection_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005303�13771713062�0034251�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteIPSecConnectionRequest wrapper for the DeleteIPSecConnection operation type DeleteIPSecConnectionRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteIPSecConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteIPSecConnectionResponse wrapper for the DeleteIPSecConnection operation type DeleteIPSecConnectionResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteIPSecConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteIPSecConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_image_request_response.go����������0000664�0000000�0000000�00000005232�13771713062�0031573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteImageRequest wrapper for the DeleteImage operation type DeleteImageRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteImageRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteImageRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteImageRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteImageResponse wrapper for the DeleteImage operation type DeleteImageResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteImageResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteImageResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_instance_configuration_request_response.go���������������������������������������������������0000664�0000000�0000000�00000005455�13771713062�0035174�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteInstanceConfigurationRequest wrapper for the DeleteInstanceConfiguration operation type DeleteInstanceConfigurationRequest struct { // The OCID of the instance configuration. InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteInstanceConfigurationRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteInstanceConfigurationResponse wrapper for the DeleteInstanceConfiguration operation type DeleteInstanceConfigurationResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteInstanceConfigurationResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteInstanceConfigurationResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_instance_console_connection_request_response.go����������������������������������������������0000664�0000000�0000000�00000005546�13771713062�0036207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteInstanceConsoleConnectionRequest wrapper for the DeleteInstanceConsoleConnection operation type DeleteInstanceConsoleConnectionRequest struct { // The OCID of the instance console connection. InstanceConsoleConnectionId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleConnectionId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteInstanceConsoleConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteInstanceConsoleConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteInstanceConsoleConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteInstanceConsoleConnectionResponse wrapper for the DeleteInstanceConsoleConnection operation type DeleteInstanceConsoleConnectionResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteInstanceConsoleConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteInstanceConsoleConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������delete_internet_gateway_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005277�13771713062�0034014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteInternetGatewayRequest wrapper for the DeleteInternetGateway operation type DeleteInternetGatewayRequest struct { // The OCID of the internet gateway. IgId *string `mandatory:"true" contributesTo:"path" name:"igId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteInternetGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteInternetGatewayResponse wrapper for the DeleteInternetGateway operation type DeleteInternetGatewayResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteInternetGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteInternetGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_ipv6_request_response.go�����������0000664�0000000�0000000�00000005167�13771713062�0031404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteIpv6Request wrapper for the DeleteIpv6 operation type DeleteIpv6Request struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the IPv6. Ipv6Id *string `mandatory:"true" contributesTo:"path" name:"ipv6Id"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteIpv6Request) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteIpv6Request) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteIpv6Request) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteIpv6Response wrapper for the DeleteIpv6 operation type DeleteIpv6Response struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteIpv6Response) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteIpv6Response) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_local_peering_gateway_request_response.go����������������������������������������������������0000664�0000000�0000000�00000005422�13771713062�0034757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteLocalPeeringGatewayRequest wrapper for the DeleteLocalPeeringGateway operation type DeleteLocalPeeringGatewayRequest struct { // The OCID of the local peering gateway. LocalPeeringGatewayId *string `mandatory:"true" contributesTo:"path" name:"localPeeringGatewayId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteLocalPeeringGatewayResponse wrapper for the DeleteLocalPeeringGateway operation type DeleteLocalPeeringGatewayResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteLocalPeeringGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_nat_gateway_request_response.go����0000664�0000000�0000000�00000005327�13771713062�0033021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteNatGatewayRequest wrapper for the DeleteNatGateway operation type DeleteNatGatewayRequest struct { // The NAT gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). NatGatewayId *string `mandatory:"true" contributesTo:"path" name:"natGatewayId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteNatGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteNatGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteNatGatewayResponse wrapper for the DeleteNatGateway operation type DeleteNatGatewayResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteNatGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteNatGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_network_security_group_request_response.go���������������������������������������������������0000664�0000000�0000000�00000005551�13771713062�0035272�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteNetworkSecurityGroupRequest wrapper for the DeleteNetworkSecurityGroup operation type DeleteNetworkSecurityGroupRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteNetworkSecurityGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteNetworkSecurityGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteNetworkSecurityGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteNetworkSecurityGroupResponse wrapper for the DeleteNetworkSecurityGroup operation type DeleteNetworkSecurityGroupResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteNetworkSecurityGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteNetworkSecurityGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_private_ip_request_response.go�����0000664�0000000�0000000�00000005205�13771713062�0032653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeletePrivateIpRequest wrapper for the DeletePrivateIp operation type DeletePrivateIpRequest struct { // The OCID of the private IP. PrivateIpId *string `mandatory:"true" contributesTo:"path" name:"privateIpId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeletePrivateIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeletePrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeletePrivateIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeletePrivateIpResponse wrapper for the DeletePrivateIp operation type DeletePrivateIpResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeletePrivateIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeletePrivateIpResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_public_ip_request_response.go������0000664�0000000�0000000�00000005167�13771713062�0032466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeletePublicIpRequest wrapper for the DeletePublicIp operation type DeletePublicIpRequest struct { // The OCID of the public IP. PublicIpId *string `mandatory:"true" contributesTo:"path" name:"publicIpId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeletePublicIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeletePublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeletePublicIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeletePublicIpResponse wrapper for the DeletePublicIp operation type DeletePublicIpResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeletePublicIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeletePublicIpResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_remote_peering_connection_request_response.go������������������������������������������������0000664�0000000�0000000�00000005520�13771713062�0035655�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteRemotePeeringConnectionRequest wrapper for the DeleteRemotePeeringConnection operation type DeleteRemotePeeringConnectionRequest struct { // The OCID of the remote peering connection (RPC). RemotePeeringConnectionId *string `mandatory:"true" contributesTo:"path" name:"remotePeeringConnectionId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteRemotePeeringConnectionResponse wrapper for the DeleteRemotePeeringConnection operation type DeleteRemotePeeringConnectionResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteRemotePeeringConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_route_table_request_response.go����0000664�0000000�0000000�00000005203�13771713062�0033014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteRouteTableRequest wrapper for the DeleteRouteTable operation type DeleteRouteTableRequest struct { // The OCID of the route table. RtId *string `mandatory:"true" contributesTo:"path" name:"rtId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteRouteTableRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteRouteTableRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteRouteTableResponse wrapper for the DeleteRouteTable operation type DeleteRouteTableResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteRouteTableResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteRouteTableResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_security_list_request_response.go��0000664�0000000�0000000�00000005257�13771713062�0033422�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteSecurityListRequest wrapper for the DeleteSecurityList operation type DeleteSecurityListRequest struct { // The OCID of the security list. SecurityListId *string `mandatory:"true" contributesTo:"path" name:"securityListId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteSecurityListRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteSecurityListRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteSecurityListResponse wrapper for the DeleteSecurityList operation type DeleteSecurityListResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteSecurityListResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteSecurityListResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_service_gateway_request_response.go0000664�0000000�0000000�00000005417�13771713062�0033677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteServiceGatewayRequest wrapper for the DeleteServiceGateway operation type DeleteServiceGatewayRequest struct { // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteServiceGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteServiceGatewayResponse wrapper for the DeleteServiceGateway operation type DeleteServiceGatewayResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteServiceGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteServiceGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_subnet_request_response.go���������0000664�0000000�0000000�00000005132�13771713062�0032010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteSubnetRequest wrapper for the DeleteSubnet operation type DeleteSubnetRequest struct { // The OCID of the subnet. SubnetId *string `mandatory:"true" contributesTo:"path" name:"subnetId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteSubnetRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteSubnetRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteSubnetResponse wrapper for the DeleteSubnet operation type DeleteSubnetResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteSubnetResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteSubnetResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_vcn_request_response.go������������0000664�0000000�0000000�00000005171�13771713062�0031301�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVcnRequest wrapper for the DeleteVcn operation type DeleteVcnRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"path" name:"vcnId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVcnRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVcnRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVcnRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVcnResponse wrapper for the DeleteVcn operation type DeleteVcnResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVcnResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVcnResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_virtual_circuit_public_prefix_details.go�����������������������������������������������������0000664�0000000�0000000�00000002414�13771713062�0034573�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DeleteVirtualCircuitPublicPrefixDetails The representation of DeleteVirtualCircuitPublicPrefixDetails type DeleteVirtualCircuitPublicPrefixDetails struct { // An individual public IP prefix (CIDR) to remove from the public virtual circuit. CidrBlock *string `mandatory:"true" json:"cidrBlock"` } func (m DeleteVirtualCircuitPublicPrefixDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_virtual_circuit_request_response.go0000664�0000000�0000000�00000005313�13771713062�0033721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVirtualCircuitRequest wrapper for the DeleteVirtualCircuit operation type DeleteVirtualCircuitRequest struct { // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVirtualCircuitRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVirtualCircuitResponse wrapper for the DeleteVirtualCircuit operation type DeleteVirtualCircuitResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVirtualCircuitResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVirtualCircuitResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_volume_backup_policy_assignment_request_response.go������������������������������������������0000664�0000000�0000000�00000005571�13771713062�0037103�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVolumeBackupPolicyAssignmentRequest wrapper for the DeleteVolumeBackupPolicyAssignment operation type DeleteVolumeBackupPolicyAssignmentRequest struct { // The OCID of the volume backup policy assignment. PolicyAssignmentId *string `mandatory:"true" contributesTo:"path" name:"policyAssignmentId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVolumeBackupPolicyAssignmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVolumeBackupPolicyAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVolumeBackupPolicyAssignmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVolumeBackupPolicyAssignmentResponse wrapper for the DeleteVolumeBackupPolicyAssignment operation type DeleteVolumeBackupPolicyAssignmentResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVolumeBackupPolicyAssignmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVolumeBackupPolicyAssignmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������delete_volume_backup_policy_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000005334�13771713062�0034650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVolumeBackupPolicyRequest wrapper for the DeleteVolumeBackupPolicy operation type DeleteVolumeBackupPolicyRequest struct { // The OCID of the volume backup policy. PolicyId *string `mandatory:"true" contributesTo:"path" name:"policyId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVolumeBackupPolicyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVolumeBackupPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVolumeBackupPolicyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVolumeBackupPolicyResponse wrapper for the DeleteVolumeBackupPolicy operation type DeleteVolumeBackupPolicyResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVolumeBackupPolicyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVolumeBackupPolicyResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_backup_request_response.go��0000664�0000000�0000000�00000005257�13771713062�0033354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVolumeBackupRequest wrapper for the DeleteVolumeBackup operation type DeleteVolumeBackupRequest struct { // The OCID of the volume backup. VolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeBackupId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVolumeBackupResponse wrapper for the DeleteVolumeBackup operation type DeleteVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������delete_volume_group_backup_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005436�13771713062�0034510�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVolumeGroupBackupRequest wrapper for the DeleteVolumeGroupBackup operation type DeleteVolumeGroupBackupRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. VolumeGroupBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupBackupId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVolumeGroupBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVolumeGroupBackupResponse wrapper for the DeleteVolumeGroupBackup operation type DeleteVolumeGroupBackupResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVolumeGroupBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVolumeGroupBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_group_request_response.go���0000664�0000000�0000000�00000005311�13771713062�0033232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVolumeGroupRequest wrapper for the DeleteVolumeGroup operation type DeleteVolumeGroupRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group. VolumeGroupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVolumeGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVolumeGroupResponse wrapper for the DeleteVolumeGroup operation type DeleteVolumeGroupResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVolumeGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVolumeGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_kms_key_request_response.go�0000664�0000000�0000000�00000005234�13771713062�0033544�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVolumeKmsKeyRequest wrapper for the DeleteVolumeKmsKey operation type DeleteVolumeKmsKeyRequest struct { // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVolumeKmsKeyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVolumeKmsKeyResponse wrapper for the DeleteVolumeKmsKey operation type DeleteVolumeKmsKeyResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVolumeKmsKeyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVolumeKmsKeyResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/delete_volume_request_response.go���������0000664�0000000�0000000�00000005132�13771713062�0032017�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DeleteVolumeRequest wrapper for the DeleteVolume operation type DeleteVolumeRequest struct { // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DeleteVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DeleteVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DeleteVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DeleteVolumeResponse wrapper for the DeleteVolume operation type DeleteVolumeResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DeleteVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DeleteVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/detach_boot_volume_request_response.go����0000664�0000000�0000000�00000005262�13771713062�0033034�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DetachBootVolumeRequest wrapper for the DetachBootVolume operation type DetachBootVolumeRequest struct { // The OCID of the boot volume attachment. BootVolumeAttachmentId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeAttachmentId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DetachBootVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DetachBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DetachBootVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DetachBootVolumeResponse wrapper for the DetachBootVolume operation type DetachBootVolumeResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DetachBootVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DetachBootVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_details.go�����������0000664�0000000�0000000�00000002577�13771713062�0031275�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DetachLoadBalancerDetails Represents a load balancer that is to be detached from an instance pool. type DetachLoadBalancerDetails struct { // The OCID of the load balancer to detach from the instance pool. LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` // The name of the backend set on the load balancer to detach from the instance pool. BackendSetName *string `mandatory:"true" json:"backendSetName"` } func (m DetachLoadBalancerDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/detach_load_balancer_request_response.go��0000664�0000000�0000000�00000006747�13771713062�0033261�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DetachLoadBalancerRequest wrapper for the DetachLoadBalancer operation type DetachLoadBalancerRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // Load balancer being detached DetachLoadBalancerDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DetachLoadBalancerRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DetachLoadBalancerRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DetachLoadBalancerRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DetachLoadBalancerResponse wrapper for the DetachLoadBalancer operation type DetachLoadBalancerResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DetachLoadBalancerResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DetachLoadBalancerResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/detach_service_id_request_response.go�����0000664�0000000�0000000�00000005642�13771713062�0032620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DetachServiceIdRequest wrapper for the DetachServiceId operation type DetachServiceIdRequest struct { // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` // ServiceId of Service to be detached from a service gateway. DetachServiceDetails ServiceIdRequestDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DetachServiceIdRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DetachServiceIdRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DetachServiceIdRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DetachServiceIdResponse wrapper for the DetachServiceId operation type DetachServiceIdResponse struct { // The underlying http response RawResponse *http.Response // The ServiceGateway instance ServiceGateway `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DetachServiceIdResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DetachServiceIdResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/detach_vnic_request_response.go�����������0000664�0000000�0000000�00000005135�13771713062�0031440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DetachVnicRequest wrapper for the DetachVnic operation type DetachVnicRequest struct { // The OCID of the VNIC attachment. VnicAttachmentId *string `mandatory:"true" contributesTo:"path" name:"vnicAttachmentId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DetachVnicRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DetachVnicRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DetachVnicRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DetachVnicResponse wrapper for the DetachVnic operation type DetachVnicResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DetachVnicResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DetachVnicResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/detach_volume_request_response.go���������0000664�0000000�0000000�00000005171�13771713062�0032010�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // DetachVolumeRequest wrapper for the DetachVolume operation type DetachVolumeRequest struct { // The OCID of the volume attachment. VolumeAttachmentId *string `mandatory:"true" contributesTo:"path" name:"volumeAttachmentId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request DetachVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request DetachVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request DetachVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // DetachVolumeResponse wrapper for the DetachVolume operation type DetachVolumeResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response DetachVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response DetachVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/device.go���������������������������������0000664�0000000�0000000�00000002367�13771713062�0024746�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Device Device Path corresponding to the block devices attached to instances having a name and isAvailable flag. type Device struct { // The device name. Name *string `mandatory:"true" json:"name"` // The flag denoting whether device is available. IsAvailable *bool `mandatory:"true" json:"isAvailable"` } func (m Device) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dhcp_dns_option.go������������������������0000664�0000000�0000000�00000007405�13771713062�0026657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // DhcpDnsOption DHCP option for specifying how DNS (hostname resolution) is handled in the subnets in the VCN. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). type DhcpDnsOption struct { // If you set `serverType` to `CustomDnsServer`, specify the // IP address of at least one DNS server of your choice (three maximum). CustomDnsServers []string `mandatory:"false" json:"customDnsServers"` // * **VcnLocal:** Reserved for future use. // * **VcnLocalPlusInternet:** Also referred to as "Internet and VCN Resolver". // Instances can resolve internet hostnames (no internet gateway is required), // and can resolve hostnames of instances in the VCN. This is the default // value in the default set of DHCP options in the VCN. For the Internet and // VCN Resolver to work across the VCN, there must also be a DNS label set for // the VCN, a DNS label set for each subnet, and a hostname for each instance. // The Internet and VCN Resolver also enables reverse DNS lookup, which lets // you determine the hostname corresponding to the private IP address. For more // information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // * **CustomDnsServer:** Instances use a DNS server of your choice (three // maximum). ServerType DhcpDnsOptionServerTypeEnum `mandatory:"true" json:"serverType"` } func (m DhcpDnsOption) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m DhcpDnsOption) MarshalJSON() (buff []byte, e error) { type MarshalTypeDhcpDnsOption DhcpDnsOption s := struct { DiscriminatorParam string `json:"type"` MarshalTypeDhcpDnsOption }{ "DomainNameServer", (MarshalTypeDhcpDnsOption)(m), } return json.Marshal(&s) } // DhcpDnsOptionServerTypeEnum Enum with underlying type: string type DhcpDnsOptionServerTypeEnum string // Set of constants representing the allowable values for DhcpDnsOptionServerTypeEnum const ( DhcpDnsOptionServerTypeVcnlocal DhcpDnsOptionServerTypeEnum = "VcnLocal" DhcpDnsOptionServerTypeVcnlocalplusinternet DhcpDnsOptionServerTypeEnum = "VcnLocalPlusInternet" DhcpDnsOptionServerTypeCustomdnsserver DhcpDnsOptionServerTypeEnum = "CustomDnsServer" ) var mappingDhcpDnsOptionServerType = map[string]DhcpDnsOptionServerTypeEnum{ "VcnLocal": DhcpDnsOptionServerTypeVcnlocal, "VcnLocalPlusInternet": DhcpDnsOptionServerTypeVcnlocalplusinternet, "CustomDnsServer": DhcpDnsOptionServerTypeCustomdnsserver, } // GetDhcpDnsOptionServerTypeEnumValues Enumerates the set of values for DhcpDnsOptionServerTypeEnum func GetDhcpDnsOptionServerTypeEnumValues() []DhcpDnsOptionServerTypeEnum { values := make([]DhcpDnsOptionServerTypeEnum, 0) for _, v := range mappingDhcpDnsOptionServerType { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dhcp_option.go����������������������������0000664�0000000�0000000�00000004336�13771713062�0026013�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // DhcpOption A single DHCP option according to RFC 1533 (https://tools.ietf.org/html/rfc1533). // The two options available to use are DhcpDnsOption // and DhcpSearchDomainOption. For more // information, see DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm) // and DHCP Options (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDHCP.htm). type DhcpOption interface { } type dhcpoption struct { JsonData []byte Type string `json:"type"` } // UnmarshalJSON unmarshals json func (m *dhcpoption) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerdhcpoption dhcpoption s := struct { Model Unmarshalerdhcpoption }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.Type = s.Model.Type return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *dhcpoption) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Type { case "DomainNameServer": mm := DhcpDnsOption{} err = json.Unmarshal(data, &mm) return mm, err case "SearchDomain": mm := DhcpSearchDomainOption{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m dhcpoption) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dhcp_options.go���������������������������0000664�0000000�0000000�00000014217�13771713062�0026175�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // DhcpOptions A set of DHCP options. Used by the VCN to automatically provide configuration // information to the instances when they boot up. There are two options you can set: // - DhcpDnsOption: Lets you specify how DNS (hostname resolution) is // handled in the subnets in your VCN. // - DhcpSearchDomainOption: Lets you specify // a search domain name to use for DNS queries. // For more information, see DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm) // and DHCP Options (https://docs.cloud.oracle.com/Content/Network/Tasks/managingDHCP.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type DhcpOptions struct { // The OCID of the compartment containing the set of DHCP options. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Oracle ID (OCID) for the set of DHCP options. Id *string `mandatory:"true" json:"id"` // The current state of the set of DHCP options. LifecycleState DhcpOptionsLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The collection of individual DHCP options. Options []DhcpOption `mandatory:"true" json:"options"` // Date and time the set of DHCP options was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the VCN the set of DHCP options belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m DhcpOptions) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *DhcpOptions) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` CompartmentId *string `json:"compartmentId"` Id *string `json:"id"` LifecycleState DhcpOptionsLifecycleStateEnum `json:"lifecycleState"` Options []dhcpoption `json:"options"` TimeCreated *common.SDKTime `json:"timeCreated"` VcnId *string `json:"vcnId"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.CompartmentId = model.CompartmentId m.Id = model.Id m.LifecycleState = model.LifecycleState m.Options = make([]DhcpOption, len(model.Options)) for i, n := range model.Options { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) if e != nil { return e } if nn != nil { m.Options[i] = nn.(DhcpOption) } else { m.Options[i] = nil } } m.TimeCreated = model.TimeCreated m.VcnId = model.VcnId return } // DhcpOptionsLifecycleStateEnum Enum with underlying type: string type DhcpOptionsLifecycleStateEnum string // Set of constants representing the allowable values for DhcpOptionsLifecycleStateEnum const ( DhcpOptionsLifecycleStateProvisioning DhcpOptionsLifecycleStateEnum = "PROVISIONING" DhcpOptionsLifecycleStateAvailable DhcpOptionsLifecycleStateEnum = "AVAILABLE" DhcpOptionsLifecycleStateTerminating DhcpOptionsLifecycleStateEnum = "TERMINATING" DhcpOptionsLifecycleStateTerminated DhcpOptionsLifecycleStateEnum = "TERMINATED" ) var mappingDhcpOptionsLifecycleState = map[string]DhcpOptionsLifecycleStateEnum{ "PROVISIONING": DhcpOptionsLifecycleStateProvisioning, "AVAILABLE": DhcpOptionsLifecycleStateAvailable, "TERMINATING": DhcpOptionsLifecycleStateTerminating, "TERMINATED": DhcpOptionsLifecycleStateTerminated, } // GetDhcpOptionsLifecycleStateEnumValues Enumerates the set of values for DhcpOptionsLifecycleStateEnum func GetDhcpOptionsLifecycleStateEnumValues() []DhcpOptionsLifecycleStateEnum { values := make([]DhcpOptionsLifecycleStateEnum, 0) for _, v := range mappingDhcpOptionsLifecycleState { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/dhcp_search_domain_option.go��������������0000664�0000000�0000000�00000004611�13771713062�0030663�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // DhcpSearchDomainOption DHCP option for specifying a search domain name for DNS queries. For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). type DhcpSearchDomainOption struct { // A single search domain name according to RFC 952 (https://tools.ietf.org/html/rfc952) // and RFC 1123 (https://tools.ietf.org/html/rfc1123). During a DNS query, // the OS will append this search domain name to the value being queried. // If you set DhcpDnsOption to `VcnLocalPlusInternet`, // and you assign a DNS label to the VCN during creation, the search domain name in the // VCN's default set of DHCP options is automatically set to the VCN domain // (for example, `vcn1.oraclevcn.com`). // If you don't want to use a search domain name, omit this option from the // set of DHCP options. Do not include this option with an empty list // of search domain names, or with an empty string as the value for any search // domain name. SearchDomainNames []string `mandatory:"true" json:"searchDomainNames"` } func (m DhcpSearchDomainOption) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m DhcpSearchDomainOption) MarshalJSON() (buff []byte, e error) { type MarshalTypeDhcpSearchDomainOption DhcpSearchDomainOption s := struct { DiscriminatorParam string `json:"type"` MarshalTypeDhcpSearchDomainOption }{ "SearchDomain", (MarshalTypeDhcpSearchDomainOption)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/drg.go������������������������������������0000664�0000000�0000000�00000010226�13771713062�0024254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Drg A dynamic routing gateway (DRG), which is a virtual router that provides a path for private // network traffic between your VCN and your existing network. You use it with other Networking // Service components to create an IPSec VPN or a connection that uses // Oracle Cloud Infrastructure FastConnect. For more information, see // Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Drg struct { // The OCID of the compartment containing the DRG. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The DRG's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The DRG's current state. LifecycleState DrgLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The date and time the DRG was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m Drg) String() string { return common.PointerString(m) } // DrgLifecycleStateEnum Enum with underlying type: string type DrgLifecycleStateEnum string // Set of constants representing the allowable values for DrgLifecycleStateEnum const ( DrgLifecycleStateProvisioning DrgLifecycleStateEnum = "PROVISIONING" DrgLifecycleStateAvailable DrgLifecycleStateEnum = "AVAILABLE" DrgLifecycleStateTerminating DrgLifecycleStateEnum = "TERMINATING" DrgLifecycleStateTerminated DrgLifecycleStateEnum = "TERMINATED" ) var mappingDrgLifecycleState = map[string]DrgLifecycleStateEnum{ "PROVISIONING": DrgLifecycleStateProvisioning, "AVAILABLE": DrgLifecycleStateAvailable, "TERMINATING": DrgLifecycleStateTerminating, "TERMINATED": DrgLifecycleStateTerminated, } // GetDrgLifecycleStateEnumValues Enumerates the set of values for DrgLifecycleStateEnum func GetDrgLifecycleStateEnumValues() []DrgLifecycleStateEnum { values := make([]DrgLifecycleStateEnum, 0) for _, v := range mappingDrgLifecycleState { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/drg_attachment.go�������������������������0000664�0000000�0000000�00000007435�13771713062�0026474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DrgAttachment A link between a DRG and VCN. For more information, see // Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type DrgAttachment struct { // The OCID of the compartment containing the DRG attachment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the DRG. DrgId *string `mandatory:"true" json:"drgId"` // The DRG attachment's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The DRG attachment's current state. LifecycleState DrgAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID of the VCN. VcnId *string `mandatory:"true" json:"vcnId"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The OCID of the route table the DRG attachment is using. // For information about why you would associate a route table with a DRG attachment, see: // * Transit Routing: Access to Multiple VCNs in Same Region (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm) // * Transit Routing: Private Access to Oracle Services (https://docs.cloud.oracle.com/Content/Network/Tasks/transitroutingoracleservices.htm) RouteTableId *string `mandatory:"false" json:"routeTableId"` // The date and time the DRG attachment was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m DrgAttachment) String() string { return common.PointerString(m) } // DrgAttachmentLifecycleStateEnum Enum with underlying type: string type DrgAttachmentLifecycleStateEnum string // Set of constants representing the allowable values for DrgAttachmentLifecycleStateEnum const ( DrgAttachmentLifecycleStateAttaching DrgAttachmentLifecycleStateEnum = "ATTACHING" DrgAttachmentLifecycleStateAttached DrgAttachmentLifecycleStateEnum = "ATTACHED" DrgAttachmentLifecycleStateDetaching DrgAttachmentLifecycleStateEnum = "DETACHING" DrgAttachmentLifecycleStateDetached DrgAttachmentLifecycleStateEnum = "DETACHED" ) var mappingDrgAttachmentLifecycleState = map[string]DrgAttachmentLifecycleStateEnum{ "ATTACHING": DrgAttachmentLifecycleStateAttaching, "ATTACHED": DrgAttachmentLifecycleStateAttached, "DETACHING": DrgAttachmentLifecycleStateDetaching, "DETACHED": DrgAttachmentLifecycleStateDetached, } // GetDrgAttachmentLifecycleStateEnumValues Enumerates the set of values for DrgAttachmentLifecycleStateEnum func GetDrgAttachmentLifecycleStateEnumValues() []DrgAttachmentLifecycleStateEnum { values := make([]DrgAttachmentLifecycleStateEnum, 0) for _, v := range mappingDrgAttachmentLifecycleState { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/drg_redundancy_status.go������������������0000664�0000000�0000000�00000007240�13771713062�0030075�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // DrgRedundancyStatus The redundancy status of the DRG. For more information, see // Redundancy Remedies (https://docs.cloud.oracle.com/Content/Network/Troubleshoot/drgredundancy.htm). type DrgRedundancyStatus struct { // The OCID of the DRG. Id *string `mandatory:"false" json:"id"` // The redundancy status of the DRG. Status DrgRedundancyStatusStatusEnum `mandatory:"false" json:"status,omitempty"` } func (m DrgRedundancyStatus) String() string { return common.PointerString(m) } // DrgRedundancyStatusStatusEnum Enum with underlying type: string type DrgRedundancyStatusStatusEnum string // Set of constants representing the allowable values for DrgRedundancyStatusStatusEnum const ( DrgRedundancyStatusStatusNotAvailable DrgRedundancyStatusStatusEnum = "NOT_AVAILABLE" DrgRedundancyStatusStatusRedundant DrgRedundancyStatusStatusEnum = "REDUNDANT" DrgRedundancyStatusStatusNotRedundantSingleIpsec DrgRedundancyStatusStatusEnum = "NOT_REDUNDANT_SINGLE_IPSEC" DrgRedundancyStatusStatusNotRedundantSingleVirtualcircuit DrgRedundancyStatusStatusEnum = "NOT_REDUNDANT_SINGLE_VIRTUALCIRCUIT" DrgRedundancyStatusStatusNotRedundantMultipleIpsecs DrgRedundancyStatusStatusEnum = "NOT_REDUNDANT_MULTIPLE_IPSECS" DrgRedundancyStatusStatusNotRedundantMultipleVirtualcircuits DrgRedundancyStatusStatusEnum = "NOT_REDUNDANT_MULTIPLE_VIRTUALCIRCUITS" DrgRedundancyStatusStatusNotRedundantMixConnections DrgRedundancyStatusStatusEnum = "NOT_REDUNDANT_MIX_CONNECTIONS" DrgRedundancyStatusStatusNotRedundantNoConnection DrgRedundancyStatusStatusEnum = "NOT_REDUNDANT_NO_CONNECTION" ) var mappingDrgRedundancyStatusStatus = map[string]DrgRedundancyStatusStatusEnum{ "NOT_AVAILABLE": DrgRedundancyStatusStatusNotAvailable, "REDUNDANT": DrgRedundancyStatusStatusRedundant, "NOT_REDUNDANT_SINGLE_IPSEC": DrgRedundancyStatusStatusNotRedundantSingleIpsec, "NOT_REDUNDANT_SINGLE_VIRTUALCIRCUIT": DrgRedundancyStatusStatusNotRedundantSingleVirtualcircuit, "NOT_REDUNDANT_MULTIPLE_IPSECS": DrgRedundancyStatusStatusNotRedundantMultipleIpsecs, "NOT_REDUNDANT_MULTIPLE_VIRTUALCIRCUITS": DrgRedundancyStatusStatusNotRedundantMultipleVirtualcircuits, "NOT_REDUNDANT_MIX_CONNECTIONS": DrgRedundancyStatusStatusNotRedundantMixConnections, "NOT_REDUNDANT_NO_CONNECTION": DrgRedundancyStatusStatusNotRedundantNoConnection, } // GetDrgRedundancyStatusStatusEnumValues Enumerates the set of values for DrgRedundancyStatusStatusEnum func GetDrgRedundancyStatusStatusEnumValues() []DrgRedundancyStatusStatusEnum { values := make([]DrgRedundancyStatusStatusEnum, 0) for _, v := range mappingDrgRedundancyStatusStatus { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/egress_security_rule.go�������������������0000664�0000000�0000000�00000013020�13771713062�0027741�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // EgressSecurityRule A rule for allowing outbound IP packets. type EgressSecurityRule struct { // Conceptually, this is the range of IP addresses that a packet originating from the instance // can go to. // Allowed values: // * IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security list rule for traffic destined for a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. Destination *string `mandatory:"true" json:"destination"` // The transport protocol. Specify either `all` or an IPv4 protocol number as // defined in // Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). // Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). Protocol *string `mandatory:"true" json:"protocol"` // Type of destination for the rule. The default is `CIDR_BLOCK`. // Allowed values: // * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a // Service (the rule is for traffic destined for a // particular `Service` through a service gateway). DestinationType EgressSecurityRuleDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` // Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code // as defined in: // * ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) // * ICMPv6 Parameters (https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) // If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and // codes are allowed. If you do provide this object, the type is required and the code is optional. // To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 ("Destination // Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). If you need to specify // multiple codes for a single type, create a separate security list rule for each. IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"` // A stateless rule allows traffic in one direction. Remember to add a corresponding // stateless rule in the other direction if you need to support bidirectional traffic. For // example, if egress traffic allows TCP destination port 80, there should be an ingress // rule to allow TCP source port 80. Defaults to false, which means the rule is stateful // and a corresponding rule is not necessary for bidirectional traffic. IsStateless *bool `mandatory:"false" json:"isStateless"` // Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. // If you specify TCP as the protocol but omit this object, then all destination ports are allowed. TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"` // Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. // If you specify UDP as the protocol but omit this object, then all destination ports are allowed. UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"` // An optional description of your choice for the rule. Description *string `mandatory:"false" json:"description"` } func (m EgressSecurityRule) String() string { return common.PointerString(m) } // EgressSecurityRuleDestinationTypeEnum Enum with underlying type: string type EgressSecurityRuleDestinationTypeEnum string // Set of constants representing the allowable values for EgressSecurityRuleDestinationTypeEnum const ( EgressSecurityRuleDestinationTypeCidrBlock EgressSecurityRuleDestinationTypeEnum = "CIDR_BLOCK" EgressSecurityRuleDestinationTypeServiceCidrBlock EgressSecurityRuleDestinationTypeEnum = "SERVICE_CIDR_BLOCK" ) var mappingEgressSecurityRuleDestinationType = map[string]EgressSecurityRuleDestinationTypeEnum{ "CIDR_BLOCK": EgressSecurityRuleDestinationTypeCidrBlock, "SERVICE_CIDR_BLOCK": EgressSecurityRuleDestinationTypeServiceCidrBlock, } // GetEgressSecurityRuleDestinationTypeEnumValues Enumerates the set of values for EgressSecurityRuleDestinationTypeEnum func GetEgressSecurityRuleDestinationTypeEnumValues() []EgressSecurityRuleDestinationTypeEnum { values := make([]EgressSecurityRuleDestinationTypeEnum, 0) for _, v := range mappingEgressSecurityRuleDestinationType { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/emulated_volume_attachment.go�������������0000664�0000000�0000000�00000011411�13771713062�0031074�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // EmulatedVolumeAttachment An Emulated volume attachment. type EmulatedVolumeAttachment struct { // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the volume attachment. Id *string `mandatory:"true" json:"id"` // The OCID of the instance the volume is attached to. InstanceId *string `mandatory:"true" json:"instanceId"` // The date and time the volume was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` // The device name. Device *string `mandatory:"false" json:"device"` // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My volume attachment` DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether the attachment should be created in shareable mode. If an attachment is created in shareable mode, then other instances can attach the same volume, provided that they also create their attachments in shareable mode. Only certain volume types can be attached in shareable mode. Defaults to false if not specified. IsShareable *bool `mandatory:"false" json:"isShareable"` // Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` // The current state of the volume attachment. LifecycleState VolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } //GetAvailabilityDomain returns AvailabilityDomain func (m EmulatedVolumeAttachment) GetAvailabilityDomain() *string { return m.AvailabilityDomain } //GetCompartmentId returns CompartmentId func (m EmulatedVolumeAttachment) GetCompartmentId() *string { return m.CompartmentId } //GetDevice returns Device func (m EmulatedVolumeAttachment) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m EmulatedVolumeAttachment) GetDisplayName() *string { return m.DisplayName } //GetId returns Id func (m EmulatedVolumeAttachment) GetId() *string { return m.Id } //GetInstanceId returns InstanceId func (m EmulatedVolumeAttachment) GetInstanceId() *string { return m.InstanceId } //GetIsReadOnly returns IsReadOnly func (m EmulatedVolumeAttachment) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m EmulatedVolumeAttachment) GetIsShareable() *bool { return m.IsShareable } //GetLifecycleState returns LifecycleState func (m EmulatedVolumeAttachment) GetLifecycleState() VolumeAttachmentLifecycleStateEnum { return m.LifecycleState } //GetTimeCreated returns TimeCreated func (m EmulatedVolumeAttachment) GetTimeCreated() *common.SDKTime { return m.TimeCreated } //GetVolumeId returns VolumeId func (m EmulatedVolumeAttachment) GetVolumeId() *string { return m.VolumeId } //GetIsPvEncryptionInTransitEnabled returns IsPvEncryptionInTransitEnabled func (m EmulatedVolumeAttachment) GetIsPvEncryptionInTransitEnabled() *bool { return m.IsPvEncryptionInTransitEnabled } func (m EmulatedVolumeAttachment) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m EmulatedVolumeAttachment) MarshalJSON() (buff []byte, e error) { type MarshalTypeEmulatedVolumeAttachment EmulatedVolumeAttachment s := struct { DiscriminatorParam string `json:"attachmentType"` MarshalTypeEmulatedVolumeAttachment }{ "emulated", (MarshalTypeEmulatedVolumeAttachment)(m), } return json.Marshal(&s) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/export_image_details.go�������������������0000664�0000000�0000000�00000004551�13771713062�0027674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ExportImageDetails The destination details for the image export. // Set `destinationType` to `objectStorageTuple` // and use ExportImageViaObjectStorageTupleDetails // when specifying the namespace, bucket name, and object name. // Set `destinationType` to `objectStorageUri` and // use ExportImageViaObjectStorageUriDetails // when specifying the Object Storage URL. type ExportImageDetails interface { } type exportimagedetails struct { JsonData []byte DestinationType string `json:"destinationType"` } // UnmarshalJSON unmarshals json func (m *exportimagedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerexportimagedetails exportimagedetails s := struct { Model Unmarshalerexportimagedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.DestinationType = s.Model.DestinationType return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *exportimagedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.DestinationType { case "objectStorageUri": mm := ExportImageViaObjectStorageUriDetails{} err = json.Unmarshal(data, &mm) return mm, err case "objectStorageTuple": mm := ExportImageViaObjectStorageTupleDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m exportimagedetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/export_image_request_response.go����������0000664�0000000�0000000�00000007204�13771713062�0031653�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ExportImageRequest wrapper for the ExportImage operation type ExportImageRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // Details for the image export. ExportImageDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ExportImageRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ExportImageRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ExportImageRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ExportImageResponse wrapper for the ExportImage operation type ExportImageResponse struct { // The underlying http response RawResponse *http.Response // The Image instance Image `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response ExportImageResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ExportImageResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������export_image_via_object_storage_tuple_details.go����������������������������������������������������0000664�0000000�0000000�00000003706�13771713062�0034740�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ExportImageViaObjectStorageTupleDetails The representation of ExportImageViaObjectStorageTupleDetails type ExportImageViaObjectStorageTupleDetails struct { // The Object Storage bucket to export the image to. BucketName *string `mandatory:"true" json:"bucketName"` // The Object Storage namespace to export the image to. NamespaceName *string `mandatory:"true" json:"namespaceName"` // The Object Storage object name for the exported image. ObjectName *string `mandatory:"true" json:"objectName"` } func (m ExportImageViaObjectStorageTupleDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m ExportImageViaObjectStorageTupleDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeExportImageViaObjectStorageTupleDetails ExportImageViaObjectStorageTupleDetails s := struct { DiscriminatorParam string `json:"destinationType"` MarshalTypeExportImageViaObjectStorageTupleDetails }{ "objectStorageTuple", (MarshalTypeExportImageViaObjectStorageTupleDetails)(m), } return json.Marshal(&s) } ����������������������������������������������������������export_image_via_object_storage_uri_details.go������������������������������������������������������0000664�0000000�0000000�00000003741�13771713062�0034405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ExportImageViaObjectStorageUriDetails The representation of ExportImageViaObjectStorageUriDetails type ExportImageViaObjectStorageUriDetails struct { // The Object Storage URL to export the image to. See Object Storage URLs (https://docs.cloud.oracle.com/Content/Compute/Tasks/imageimportexport.htm#URLs) // and Using Pre-Authenticated Requests (https://docs.cloud.oracle.com/Content/Object/Tasks/usingpreauthenticatedrequests.htm) for constructing URLs for image import/export. DestinationUri *string `mandatory:"true" json:"destinationUri"` } func (m ExportImageViaObjectStorageUriDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m ExportImageViaObjectStorageUriDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeExportImageViaObjectStorageUriDetails ExportImageViaObjectStorageUriDetails s := struct { DiscriminatorParam string `json:"destinationType"` MarshalTypeExportImageViaObjectStorageUriDetails }{ "objectStorageUri", (MarshalTypeExportImageViaObjectStorageUriDetails)(m), } return json.Marshal(&s) } �������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service.go����������0000664�0000000�0000000�00000033143�13771713062�0031603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // FastConnectProviderService A service offering from a supported provider. For more information, // see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). type FastConnectProviderService struct { // The OCID of the service offered by the provider. Id *string `mandatory:"true" json:"id"` // Who is responsible for managing the private peering BGP information. PrivatePeeringBgpManagement FastConnectProviderServicePrivatePeeringBgpManagementEnum `mandatory:"true" json:"privatePeeringBgpManagement"` // The name of the provider. ProviderName *string `mandatory:"true" json:"providerName"` // The name of the service offered by the provider. ProviderServiceName *string `mandatory:"true" json:"providerServiceName"` // Who is responsible for managing the public peering BGP information. PublicPeeringBgpManagement FastConnectProviderServicePublicPeeringBgpManagementEnum `mandatory:"true" json:"publicPeeringBgpManagement"` // Who is responsible for managing the ASN information for the network at the other end // of the connection from Oracle. CustomerAsnManagement FastConnectProviderServiceCustomerAsnManagementEnum `mandatory:"true" json:"customerAsnManagement"` // Who is responsible for managing the provider service key. ProviderServiceKeyManagement FastConnectProviderServiceProviderServiceKeyManagementEnum `mandatory:"true" json:"providerServiceKeyManagement"` // Who is responsible for managing the virtual circuit bandwidth. BandwithShapeManagement FastConnectProviderServiceBandwithShapeManagementEnum `mandatory:"true" json:"bandwithShapeManagement"` // Total number of cross-connect or cross-connect groups required for the virtual circuit. RequiredTotalCrossConnects *int `mandatory:"true" json:"requiredTotalCrossConnects"` // Provider service type. Type FastConnectProviderServiceTypeEnum `mandatory:"true" json:"type"` // The location of the provider's website or portal. This portal is where you can get information // about the provider service, create a virtual circuit connection from the provider to Oracle // Cloud Infrastructure, and retrieve your provider service key for that virtual circuit connection. // Example: `https://example.com` Description *string `mandatory:"false" json:"description"` // An array of virtual circuit types supported by this service. SupportedVirtualCircuitTypes []FastConnectProviderServiceSupportedVirtualCircuitTypesEnum `mandatory:"false" json:"supportedVirtualCircuitTypes,omitempty"` } func (m FastConnectProviderService) String() string { return common.PointerString(m) } // FastConnectProviderServicePrivatePeeringBgpManagementEnum Enum with underlying type: string type FastConnectProviderServicePrivatePeeringBgpManagementEnum string // Set of constants representing the allowable values for FastConnectProviderServicePrivatePeeringBgpManagementEnum const ( FastConnectProviderServicePrivatePeeringBgpManagementCustomerManaged FastConnectProviderServicePrivatePeeringBgpManagementEnum = "CUSTOMER_MANAGED" FastConnectProviderServicePrivatePeeringBgpManagementProviderManaged FastConnectProviderServicePrivatePeeringBgpManagementEnum = "PROVIDER_MANAGED" FastConnectProviderServicePrivatePeeringBgpManagementOracleManaged FastConnectProviderServicePrivatePeeringBgpManagementEnum = "ORACLE_MANAGED" ) var mappingFastConnectProviderServicePrivatePeeringBgpManagement = map[string]FastConnectProviderServicePrivatePeeringBgpManagementEnum{ "CUSTOMER_MANAGED": FastConnectProviderServicePrivatePeeringBgpManagementCustomerManaged, "PROVIDER_MANAGED": FastConnectProviderServicePrivatePeeringBgpManagementProviderManaged, "ORACLE_MANAGED": FastConnectProviderServicePrivatePeeringBgpManagementOracleManaged, } // GetFastConnectProviderServicePrivatePeeringBgpManagementEnumValues Enumerates the set of values for FastConnectProviderServicePrivatePeeringBgpManagementEnum func GetFastConnectProviderServicePrivatePeeringBgpManagementEnumValues() []FastConnectProviderServicePrivatePeeringBgpManagementEnum { values := make([]FastConnectProviderServicePrivatePeeringBgpManagementEnum, 0) for _, v := range mappingFastConnectProviderServicePrivatePeeringBgpManagement { values = append(values, v) } return values } // FastConnectProviderServicePublicPeeringBgpManagementEnum Enum with underlying type: string type FastConnectProviderServicePublicPeeringBgpManagementEnum string // Set of constants representing the allowable values for FastConnectProviderServicePublicPeeringBgpManagementEnum const ( FastConnectProviderServicePublicPeeringBgpManagementCustomerManaged FastConnectProviderServicePublicPeeringBgpManagementEnum = "CUSTOMER_MANAGED" FastConnectProviderServicePublicPeeringBgpManagementProviderManaged FastConnectProviderServicePublicPeeringBgpManagementEnum = "PROVIDER_MANAGED" FastConnectProviderServicePublicPeeringBgpManagementOracleManaged FastConnectProviderServicePublicPeeringBgpManagementEnum = "ORACLE_MANAGED" ) var mappingFastConnectProviderServicePublicPeeringBgpManagement = map[string]FastConnectProviderServicePublicPeeringBgpManagementEnum{ "CUSTOMER_MANAGED": FastConnectProviderServicePublicPeeringBgpManagementCustomerManaged, "PROVIDER_MANAGED": FastConnectProviderServicePublicPeeringBgpManagementProviderManaged, "ORACLE_MANAGED": FastConnectProviderServicePublicPeeringBgpManagementOracleManaged, } // GetFastConnectProviderServicePublicPeeringBgpManagementEnumValues Enumerates the set of values for FastConnectProviderServicePublicPeeringBgpManagementEnum func GetFastConnectProviderServicePublicPeeringBgpManagementEnumValues() []FastConnectProviderServicePublicPeeringBgpManagementEnum { values := make([]FastConnectProviderServicePublicPeeringBgpManagementEnum, 0) for _, v := range mappingFastConnectProviderServicePublicPeeringBgpManagement { values = append(values, v) } return values } // FastConnectProviderServiceSupportedVirtualCircuitTypesEnum Enum with underlying type: string type FastConnectProviderServiceSupportedVirtualCircuitTypesEnum string // Set of constants representing the allowable values for FastConnectProviderServiceSupportedVirtualCircuitTypesEnum const ( FastConnectProviderServiceSupportedVirtualCircuitTypesPublic FastConnectProviderServiceSupportedVirtualCircuitTypesEnum = "PUBLIC" FastConnectProviderServiceSupportedVirtualCircuitTypesPrivate FastConnectProviderServiceSupportedVirtualCircuitTypesEnum = "PRIVATE" ) var mappingFastConnectProviderServiceSupportedVirtualCircuitTypes = map[string]FastConnectProviderServiceSupportedVirtualCircuitTypesEnum{ "PUBLIC": FastConnectProviderServiceSupportedVirtualCircuitTypesPublic, "PRIVATE": FastConnectProviderServiceSupportedVirtualCircuitTypesPrivate, } // GetFastConnectProviderServiceSupportedVirtualCircuitTypesEnumValues Enumerates the set of values for FastConnectProviderServiceSupportedVirtualCircuitTypesEnum func GetFastConnectProviderServiceSupportedVirtualCircuitTypesEnumValues() []FastConnectProviderServiceSupportedVirtualCircuitTypesEnum { values := make([]FastConnectProviderServiceSupportedVirtualCircuitTypesEnum, 0) for _, v := range mappingFastConnectProviderServiceSupportedVirtualCircuitTypes { values = append(values, v) } return values } // FastConnectProviderServiceCustomerAsnManagementEnum Enum with underlying type: string type FastConnectProviderServiceCustomerAsnManagementEnum string // Set of constants representing the allowable values for FastConnectProviderServiceCustomerAsnManagementEnum const ( FastConnectProviderServiceCustomerAsnManagementCustomerManaged FastConnectProviderServiceCustomerAsnManagementEnum = "CUSTOMER_MANAGED" FastConnectProviderServiceCustomerAsnManagementProviderManaged FastConnectProviderServiceCustomerAsnManagementEnum = "PROVIDER_MANAGED" FastConnectProviderServiceCustomerAsnManagementOracleManaged FastConnectProviderServiceCustomerAsnManagementEnum = "ORACLE_MANAGED" ) var mappingFastConnectProviderServiceCustomerAsnManagement = map[string]FastConnectProviderServiceCustomerAsnManagementEnum{ "CUSTOMER_MANAGED": FastConnectProviderServiceCustomerAsnManagementCustomerManaged, "PROVIDER_MANAGED": FastConnectProviderServiceCustomerAsnManagementProviderManaged, "ORACLE_MANAGED": FastConnectProviderServiceCustomerAsnManagementOracleManaged, } // GetFastConnectProviderServiceCustomerAsnManagementEnumValues Enumerates the set of values for FastConnectProviderServiceCustomerAsnManagementEnum func GetFastConnectProviderServiceCustomerAsnManagementEnumValues() []FastConnectProviderServiceCustomerAsnManagementEnum { values := make([]FastConnectProviderServiceCustomerAsnManagementEnum, 0) for _, v := range mappingFastConnectProviderServiceCustomerAsnManagement { values = append(values, v) } return values } // FastConnectProviderServiceProviderServiceKeyManagementEnum Enum with underlying type: string type FastConnectProviderServiceProviderServiceKeyManagementEnum string // Set of constants representing the allowable values for FastConnectProviderServiceProviderServiceKeyManagementEnum const ( FastConnectProviderServiceProviderServiceKeyManagementCustomerManaged FastConnectProviderServiceProviderServiceKeyManagementEnum = "CUSTOMER_MANAGED" FastConnectProviderServiceProviderServiceKeyManagementProviderManaged FastConnectProviderServiceProviderServiceKeyManagementEnum = "PROVIDER_MANAGED" FastConnectProviderServiceProviderServiceKeyManagementOracleManaged FastConnectProviderServiceProviderServiceKeyManagementEnum = "ORACLE_MANAGED" ) var mappingFastConnectProviderServiceProviderServiceKeyManagement = map[string]FastConnectProviderServiceProviderServiceKeyManagementEnum{ "CUSTOMER_MANAGED": FastConnectProviderServiceProviderServiceKeyManagementCustomerManaged, "PROVIDER_MANAGED": FastConnectProviderServiceProviderServiceKeyManagementProviderManaged, "ORACLE_MANAGED": FastConnectProviderServiceProviderServiceKeyManagementOracleManaged, } // GetFastConnectProviderServiceProviderServiceKeyManagementEnumValues Enumerates the set of values for FastConnectProviderServiceProviderServiceKeyManagementEnum func GetFastConnectProviderServiceProviderServiceKeyManagementEnumValues() []FastConnectProviderServiceProviderServiceKeyManagementEnum { values := make([]FastConnectProviderServiceProviderServiceKeyManagementEnum, 0) for _, v := range mappingFastConnectProviderServiceProviderServiceKeyManagement { values = append(values, v) } return values } // FastConnectProviderServiceBandwithShapeManagementEnum Enum with underlying type: string type FastConnectProviderServiceBandwithShapeManagementEnum string // Set of constants representing the allowable values for FastConnectProviderServiceBandwithShapeManagementEnum const ( FastConnectProviderServiceBandwithShapeManagementCustomerManaged FastConnectProviderServiceBandwithShapeManagementEnum = "CUSTOMER_MANAGED" FastConnectProviderServiceBandwithShapeManagementProviderManaged FastConnectProviderServiceBandwithShapeManagementEnum = "PROVIDER_MANAGED" FastConnectProviderServiceBandwithShapeManagementOracleManaged FastConnectProviderServiceBandwithShapeManagementEnum = "ORACLE_MANAGED" ) var mappingFastConnectProviderServiceBandwithShapeManagement = map[string]FastConnectProviderServiceBandwithShapeManagementEnum{ "CUSTOMER_MANAGED": FastConnectProviderServiceBandwithShapeManagementCustomerManaged, "PROVIDER_MANAGED": FastConnectProviderServiceBandwithShapeManagementProviderManaged, "ORACLE_MANAGED": FastConnectProviderServiceBandwithShapeManagementOracleManaged, } // GetFastConnectProviderServiceBandwithShapeManagementEnumValues Enumerates the set of values for FastConnectProviderServiceBandwithShapeManagementEnum func GetFastConnectProviderServiceBandwithShapeManagementEnumValues() []FastConnectProviderServiceBandwithShapeManagementEnum { values := make([]FastConnectProviderServiceBandwithShapeManagementEnum, 0) for _, v := range mappingFastConnectProviderServiceBandwithShapeManagement { values = append(values, v) } return values } // FastConnectProviderServiceTypeEnum Enum with underlying type: string type FastConnectProviderServiceTypeEnum string // Set of constants representing the allowable values for FastConnectProviderServiceTypeEnum const ( FastConnectProviderServiceTypeLayer2 FastConnectProviderServiceTypeEnum = "LAYER2" FastConnectProviderServiceTypeLayer3 FastConnectProviderServiceTypeEnum = "LAYER3" ) var mappingFastConnectProviderServiceType = map[string]FastConnectProviderServiceTypeEnum{ "LAYER2": FastConnectProviderServiceTypeLayer2, "LAYER3": FastConnectProviderServiceTypeLayer3, } // GetFastConnectProviderServiceTypeEnumValues Enumerates the set of values for FastConnectProviderServiceTypeEnum func GetFastConnectProviderServiceTypeEnumValues() []FastConnectProviderServiceTypeEnum { values := make([]FastConnectProviderServiceTypeEnum, 0) for _, v := range mappingFastConnectProviderServiceType { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/fast_connect_provider_service_key.go������0000664�0000000�0000000�00000003511�13771713062�0032447�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // FastConnectProviderServiceKey A provider service key and its details. A provider service key is an identifier for a provider's // virtual circuit. type FastConnectProviderServiceKey struct { // The service key that the provider gives you when you set up a virtual circuit connection // from the provider to Oracle Cloud Infrastructure. Use this value as the `providerServiceKeyName` // query parameter for // GetFastConnectProviderServiceKey. Name *string `mandatory:"true" json:"name"` // The provisioned data rate of the connection. To get a list of the // available bandwidth levels (that is, shapes), see // ListFastConnectProviderVirtualCircuitBandwidthShapes. // Example: `10 Gbps` BandwidthShapeName *string `mandatory:"false" json:"bandwidthShapeName"` // The provider's peering location. PeeringLocation *string `mandatory:"false" json:"peeringLocation"` } func (m FastConnectProviderServiceKey) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_app_catalog_listing_agreements_request_response.go����������������������������������������������0000664�0000000�0000000�00000005370�13771713062�0036167�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetAppCatalogListingAgreementsRequest wrapper for the GetAppCatalogListingAgreements operation type GetAppCatalogListingAgreementsRequest struct { // The OCID of the listing. ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` // Listing Resource Version. ResourceVersion *string `mandatory:"true" contributesTo:"path" name:"resourceVersion"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetAppCatalogListingAgreementsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetAppCatalogListingAgreementsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetAppCatalogListingAgreementsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetAppCatalogListingAgreementsResponse wrapper for the GetAppCatalogListingAgreements operation type GetAppCatalogListingAgreementsResponse struct { // The underlying http response RawResponse *http.Response // The AppCatalogListingResourceVersionAgreements instance AppCatalogListingResourceVersionAgreements `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetAppCatalogListingAgreementsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetAppCatalogListingAgreementsResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_app_catalog_listing_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000004741�13771713062�0033756�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetAppCatalogListingRequest wrapper for the GetAppCatalogListing operation type GetAppCatalogListingRequest struct { // The OCID of the listing. ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetAppCatalogListingRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetAppCatalogListingRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetAppCatalogListingRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetAppCatalogListingResponse wrapper for the GetAppCatalogListing operation type GetAppCatalogListingResponse struct { // The underlying http response RawResponse *http.Response // The AppCatalogListing instance AppCatalogListing `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetAppCatalogListingResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetAppCatalogListingResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������get_app_catalog_listing_resource_version_request_response.go����������������������������������������0000664�0000000�0000000�00000005433�13771713062�0037431�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetAppCatalogListingResourceVersionRequest wrapper for the GetAppCatalogListingResourceVersion operation type GetAppCatalogListingResourceVersionRequest struct { // The OCID of the listing. ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` // Listing Resource Version. ResourceVersion *string `mandatory:"true" contributesTo:"path" name:"resourceVersion"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetAppCatalogListingResourceVersionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetAppCatalogListingResourceVersionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetAppCatalogListingResourceVersionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetAppCatalogListingResourceVersionResponse wrapper for the GetAppCatalogListingResourceVersion operation type GetAppCatalogListingResourceVersionResponse struct { // The underlying http response RawResponse *http.Response // The AppCatalogListingResourceVersion instance AppCatalogListingResourceVersion `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetAppCatalogListingResourceVersionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetAppCatalogListingResourceVersionResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_boot_volume_attachment_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005061�13771713062�0034511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetBootVolumeAttachmentRequest wrapper for the GetBootVolumeAttachment operation type GetBootVolumeAttachmentRequest struct { // The OCID of the boot volume attachment. BootVolumeAttachmentId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeAttachmentId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetBootVolumeAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetBootVolumeAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetBootVolumeAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetBootVolumeAttachmentResponse wrapper for the GetBootVolumeAttachment operation type GetBootVolumeAttachmentResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeAttachment instance BootVolumeAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetBootVolumeAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetBootVolumeAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_backup_request_response.go0000664�0000000�0000000�00000004761�13771713062�0033713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetBootVolumeBackupRequest wrapper for the GetBootVolumeBackup operation type GetBootVolumeBackupRequest struct { // The OCID of the boot volume backup. BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetBootVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetBootVolumeBackupResponse wrapper for the GetBootVolumeBackup operation type GetBootVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeBackup instance BootVolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetBootVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetBootVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������get_boot_volume_kms_key_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005544�13771713062�0034031�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetBootVolumeKmsKeyRequest wrapper for the GetBootVolumeKmsKey operation type GetBootVolumeKmsKeyRequest struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetBootVolumeKmsKeyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetBootVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetBootVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetBootVolumeKmsKeyResponse wrapper for the GetBootVolumeKmsKey operation type GetBootVolumeKmsKeyResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeKmsKey instance BootVolumeKmsKey `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetBootVolumeKmsKeyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetBootVolumeKmsKeyResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_boot_volume_request_response.go�������0000664�0000000�0000000�00000004620�13771713062�0032360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetBootVolumeRequest wrapper for the GetBootVolume operation type GetBootVolumeRequest struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetBootVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetBootVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetBootVolumeResponse wrapper for the GetBootVolume operation type GetBootVolumeResponse struct { // The underlying http response RawResponse *http.Response // The BootVolume instance BootVolume `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetBootVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetBootVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_cluster_network_request_response.go���0000664�0000000�0000000�00000005036�13771713062�0033262�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetClusterNetworkRequest wrapper for the GetClusterNetwork operation type GetClusterNetworkRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. ClusterNetworkId *string `mandatory:"true" contributesTo:"path" name:"clusterNetworkId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetClusterNetworkRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetClusterNetworkRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetClusterNetworkRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetClusterNetworkResponse wrapper for the GetClusterNetwork operation type GetClusterNetworkResponse struct { // The underlying http response RawResponse *http.Response // The ClusterNetwork instance ClusterNetwork `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetClusterNetworkResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetClusterNetworkResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_console_history_content_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000005464�13771713062�0034733�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetConsoleHistoryContentRequest wrapper for the GetConsoleHistoryContent operation type GetConsoleHistoryContentRequest struct { // The OCID of the console history. InstanceConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleHistoryId"` // Offset of the snapshot data to retrieve. Offset *int `mandatory:"false" contributesTo:"query" name:"offset"` // Length of the snapshot data to retrieve. Length *int `mandatory:"false" contributesTo:"query" name:"length"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetConsoleHistoryContentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetConsoleHistoryContentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetConsoleHistoryContentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetConsoleHistoryContentResponse wrapper for the GetConsoleHistoryContent operation type GetConsoleHistoryContentResponse struct { // The underlying http response RawResponse *http.Response // The string instance Value *string `presentIn:"body" encoding:"plain-text"` // The number of bytes remaining in the snapshot. OpcBytesRemaining *int `presentIn:"header" name:"opc-bytes-remaining"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetConsoleHistoryContentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetConsoleHistoryContentResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_console_history_request_response.go���0000664�0000000�0000000�00000004740�13771713062�0033254�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetConsoleHistoryRequest wrapper for the GetConsoleHistory operation type GetConsoleHistoryRequest struct { // The OCID of the console history. InstanceConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleHistoryId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetConsoleHistoryRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetConsoleHistoryResponse wrapper for the GetConsoleHistory operation type GetConsoleHistoryResponse struct { // The underlying http response RawResponse *http.Response // The ConsoleHistory instance ConsoleHistory `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetConsoleHistoryResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetConsoleHistoryResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������get_cpe_device_config_content_request_response.go���������������������������������������������������0000664�0000000�0000000�00000004654�13771713062�0035123�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "io" "net/http" ) // GetCpeDeviceConfigContentRequest wrapper for the GetCpeDeviceConfigContent operation type GetCpeDeviceConfigContentRequest struct { // The OCID of the CPE. CpeId *string `mandatory:"true" contributesTo:"path" name:"cpeId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetCpeDeviceConfigContentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetCpeDeviceConfigContentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetCpeDeviceConfigContentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetCpeDeviceConfigContentResponse wrapper for the GetCpeDeviceConfigContent operation type GetCpeDeviceConfigContentResponse struct { // The underlying http response RawResponse *http.Response // The io.ReadCloser instance Content io.ReadCloser `presentIn:"body" encoding:"binary"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetCpeDeviceConfigContentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetCpeDeviceConfigContentResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_cpe_device_shape_request_response.go��0000664�0000000�0000000�00000004656�13771713062�0033305�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetCpeDeviceShapeRequest wrapper for the GetCpeDeviceShape operation type GetCpeDeviceShapeRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the CPE device shape. CpeDeviceShapeId *string `mandatory:"true" contributesTo:"path" name:"cpeDeviceShapeId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetCpeDeviceShapeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetCpeDeviceShapeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetCpeDeviceShapeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetCpeDeviceShapeResponse wrapper for the GetCpeDeviceShape operation type GetCpeDeviceShapeResponse struct { // The underlying http response RawResponse *http.Response // The CpeDeviceShapeDetail instance CpeDeviceShapeDetail `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetCpeDeviceShapeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetCpeDeviceShapeResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_cpe_request_response.go���������������0000664�0000000�0000000�00000004437�13771713062�0030603�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetCpeRequest wrapper for the GetCpe operation type GetCpeRequest struct { // The OCID of the CPE. CpeId *string `mandatory:"true" contributesTo:"path" name:"cpeId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetCpeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetCpeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetCpeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetCpeResponse wrapper for the GetCpe operation type GetCpeResponse struct { // The underlying http response RawResponse *http.Response // The Cpe instance Cpe `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetCpeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetCpeResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_cross_connect_group_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005001�13771713062�0034017�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetCrossConnectGroupRequest wrapper for the GetCrossConnectGroup operation type GetCrossConnectGroupRequest struct { // The OCID of the cross-connect group. CrossConnectGroupId *string `mandatory:"true" contributesTo:"path" name:"crossConnectGroupId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetCrossConnectGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetCrossConnectGroupResponse wrapper for the GetCrossConnectGroup operation type GetCrossConnectGroupResponse struct { // The underlying http response RawResponse *http.Response // The CrossConnectGroup instance CrossConnectGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetCrossConnectGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetCrossConnectGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_cross_connect_letter_of_authority_request_response.go�������������������������������������������0000664�0000000�0000000�00000005015�13771713062�0036763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetCrossConnectLetterOfAuthorityRequest wrapper for the GetCrossConnectLetterOfAuthority operation type GetCrossConnectLetterOfAuthorityRequest struct { // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetCrossConnectLetterOfAuthorityRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetCrossConnectLetterOfAuthorityRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetCrossConnectLetterOfAuthorityRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetCrossConnectLetterOfAuthorityResponse wrapper for the GetCrossConnectLetterOfAuthority operation type GetCrossConnectLetterOfAuthorityResponse struct { // The underlying http response RawResponse *http.Response // The LetterOfAuthority instance LetterOfAuthority `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetCrossConnectLetterOfAuthorityResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetCrossConnectLetterOfAuthorityResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_cross_connect_request_response.go�����0000664�0000000�0000000�00000004660�13771713062�0032674�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetCrossConnectRequest wrapper for the GetCrossConnect operation type GetCrossConnectRequest struct { // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetCrossConnectRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetCrossConnectRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetCrossConnectResponse wrapper for the GetCrossConnect operation type GetCrossConnectResponse struct { // The underlying http response RawResponse *http.Response // The CrossConnect instance CrossConnect `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetCrossConnectResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetCrossConnectResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������get_cross_connect_status_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000004626�13771713062�0034222�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetCrossConnectStatusRequest wrapper for the GetCrossConnectStatus operation type GetCrossConnectStatusRequest struct { // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetCrossConnectStatusRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetCrossConnectStatusRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetCrossConnectStatusRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetCrossConnectStatusResponse wrapper for the GetCrossConnectStatus operation type GetCrossConnectStatusResponse struct { // The underlying http response RawResponse *http.Response // The CrossConnectStatus instance CrossConnectStatus `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetCrossConnectStatusResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetCrossConnectStatusResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_dedicated_vm_host_request_response.go�0000664�0000000�0000000�00000004721�13771713062�0033475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetDedicatedVmHostRequest wrapper for the GetDedicatedVmHost operation type GetDedicatedVmHostRequest struct { // The OCID of the dedicated VM host. DedicatedVmHostId *string `mandatory:"true" contributesTo:"path" name:"dedicatedVmHostId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetDedicatedVmHostRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetDedicatedVmHostRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetDedicatedVmHostRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetDedicatedVmHostResponse wrapper for the GetDedicatedVmHost operation type GetDedicatedVmHostResponse struct { // The underlying http response RawResponse *http.Response // The DedicatedVmHost instance DedicatedVmHost `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetDedicatedVmHostResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetDedicatedVmHostResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_dhcp_options_request_response.go������0000664�0000000�0000000�00000004632�13771713062�0032522�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetDhcpOptionsRequest wrapper for the GetDhcpOptions operation type GetDhcpOptionsRequest struct { // The OCID for the set of DHCP options. DhcpId *string `mandatory:"true" contributesTo:"path" name:"dhcpId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetDhcpOptionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetDhcpOptionsResponse wrapper for the GetDhcpOptions operation type GetDhcpOptionsResponse struct { // The underlying http response RawResponse *http.Response // The DhcpOptions instance DhcpOptions `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetDhcpOptionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetDhcpOptionsResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_drg_attachment_request_response.go����0000664�0000000�0000000�00000004700�13771713062�0033011�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetDrgAttachmentRequest wrapper for the GetDrgAttachment operation type GetDrgAttachmentRequest struct { // The OCID of the DRG attachment. DrgAttachmentId *string `mandatory:"true" contributesTo:"path" name:"drgAttachmentId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetDrgAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetDrgAttachmentResponse wrapper for the GetDrgAttachment operation type GetDrgAttachmentResponse struct { // The underlying http response RawResponse *http.Response // The DrgAttachment instance DrgAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetDrgAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetDrgAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������get_drg_redundancy_status_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000004567�13771713062�0034354�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetDrgRedundancyStatusRequest wrapper for the GetDrgRedundancyStatus operation type GetDrgRedundancyStatusRequest struct { // The OCID of the DRG. DrgId *string `mandatory:"true" contributesTo:"path" name:"drgId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetDrgRedundancyStatusRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetDrgRedundancyStatusRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetDrgRedundancyStatusRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetDrgRedundancyStatusResponse wrapper for the GetDrgRedundancyStatus operation type GetDrgRedundancyStatusResponse struct { // The underlying http response RawResponse *http.Response // The DrgRedundancyStatus instance DrgRedundancyStatus `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetDrgRedundancyStatusResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetDrgRedundancyStatusResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_drg_request_response.go���������������0000664�0000000�0000000�00000004437�13771713062�0030610�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetDrgRequest wrapper for the GetDrg operation type GetDrgRequest struct { // The OCID of the DRG. DrgId *string `mandatory:"true" contributesTo:"path" name:"drgId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetDrgRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetDrgRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetDrgRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetDrgResponse wrapper for the GetDrg operation type GetDrgResponse struct { // The underlying http response RawResponse *http.Response // The Drg instance Drg `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetDrgResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetDrgResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_fast_connect_provider_service_key_request_response.go�������������������������������������������0000664�0000000�0000000�00000005773�13771713062�0036731�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetFastConnectProviderServiceKeyRequest wrapper for the GetFastConnectProviderServiceKey operation type GetFastConnectProviderServiceKeyRequest struct { // The OCID of the provider service. ProviderServiceId *string `mandatory:"true" contributesTo:"path" name:"providerServiceId"` // The provider service key that the provider gives you when you set up a virtual circuit connection // from the provider to Oracle Cloud Infrastructure. You can set up that connection and get your // provider service key at the provider's website or portal. For the portal location, see the `description` // attribute of the FastConnectProviderService. ProviderServiceKeyName *string `mandatory:"true" contributesTo:"path" name:"providerServiceKeyName"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetFastConnectProviderServiceKeyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetFastConnectProviderServiceKeyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetFastConnectProviderServiceKeyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetFastConnectProviderServiceKeyResponse wrapper for the GetFastConnectProviderServiceKey operation type GetFastConnectProviderServiceKeyResponse struct { // The underlying http response RawResponse *http.Response // The FastConnectProviderServiceKey instance FastConnectProviderServiceKey `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetFastConnectProviderServiceKeyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetFastConnectProviderServiceKeyResponse) HTTPResponse() *http.Response { return response.RawResponse } �����get_fast_connect_provider_service_request_response.go�����������������������������������������������0000664�0000000�0000000�00000005007�13771713062�0036047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetFastConnectProviderServiceRequest wrapper for the GetFastConnectProviderService operation type GetFastConnectProviderServiceRequest struct { // The OCID of the provider service. ProviderServiceId *string `mandatory:"true" contributesTo:"path" name:"providerServiceId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetFastConnectProviderServiceRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetFastConnectProviderServiceRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetFastConnectProviderServiceRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetFastConnectProviderServiceResponse wrapper for the GetFastConnectProviderService operation type GetFastConnectProviderServiceResponse struct { // The underlying http response RawResponse *http.Response // The FastConnectProviderService instance FastConnectProviderService `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetFastConnectProviderServiceResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetFastConnectProviderServiceResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_i_p_sec_connection_device_config_request_response.go��������������������������������������������0000664�0000000�0000000�00000005146�13771713062�0036437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetIPSecConnectionDeviceConfigRequest wrapper for the GetIPSecConnectionDeviceConfig operation type GetIPSecConnectionDeviceConfigRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionDeviceConfigRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetIPSecConnectionDeviceConfigRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetIPSecConnectionDeviceConfigRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetIPSecConnectionDeviceConfigResponse wrapper for the GetIPSecConnectionDeviceConfig operation type GetIPSecConnectionDeviceConfigResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnectionDeviceConfig instance IpSecConnectionDeviceConfig `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetIPSecConnectionDeviceConfigResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetIPSecConnectionDeviceConfigResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_i_p_sec_connection_device_status_request_response.go��������������������������������������������0000664�0000000�0000000�00000005146�13771713062�0036515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetIPSecConnectionDeviceStatusRequest wrapper for the GetIPSecConnectionDeviceStatus operation type GetIPSecConnectionDeviceStatusRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionDeviceStatusRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetIPSecConnectionDeviceStatusRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetIPSecConnectionDeviceStatusRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetIPSecConnectionDeviceStatusResponse wrapper for the GetIPSecConnectionDeviceStatus operation type GetIPSecConnectionDeviceStatusResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnectionDeviceStatus instance IpSecConnectionDeviceStatus `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetIPSecConnectionDeviceStatusResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetIPSecConnectionDeviceStatusResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_i_p_sec_connection_request_response.go0000664�0000000�0000000�00000004712�13771713062�0033650�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetIPSecConnectionRequest wrapper for the GetIPSecConnection operation type GetIPSecConnectionRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetIPSecConnectionResponse wrapper for the GetIPSecConnection operation type GetIPSecConnectionResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnection instance IpSecConnection `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetIPSecConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetIPSecConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������get_i_p_sec_connection_tunnel_request_response.go���������������������������������������������������0000664�0000000�0000000�00000005310�13771713062�0035151�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetIPSecConnectionTunnelRequest wrapper for the GetIPSecConnectionTunnel operation type GetIPSecConnectionTunnelRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionTunnelRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetIPSecConnectionTunnelRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetIPSecConnectionTunnelRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetIPSecConnectionTunnelResponse wrapper for the GetIPSecConnectionTunnel operation type GetIPSecConnectionTunnelResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnectionTunnel instance IpSecConnectionTunnel `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetIPSecConnectionTunnelResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetIPSecConnectionTunnelResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_i_p_sec_connection_tunnel_shared_secret_request_response.go�������������������������������������0000664�0000000�0000000�00000005544�13771713062�0040055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetIPSecConnectionTunnelSharedSecretRequest wrapper for the GetIPSecConnectionTunnelSharedSecret operation type GetIPSecConnectionTunnelSharedSecretRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetIPSecConnectionTunnelSharedSecretRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetIPSecConnectionTunnelSharedSecretRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetIPSecConnectionTunnelSharedSecretRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetIPSecConnectionTunnelSharedSecretResponse wrapper for the GetIPSecConnectionTunnelSharedSecret operation type GetIPSecConnectionTunnelSharedSecretResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnectionTunnelSharedSecret instance IpSecConnectionTunnelSharedSecret `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetIPSecConnectionTunnelSharedSecretResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetIPSecConnectionTunnelSharedSecretResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_image_request_response.go�������������0000664�0000000�0000000�00000004615�13771713062�0031114�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetImageRequest wrapper for the GetImage operation type GetImageRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetImageRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetImageRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetImageRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetImageResponse wrapper for the GetImage operation type GetImageResponse struct { // The underlying http response RawResponse *http.Response // The Image instance Image `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetImageResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetImageResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������get_image_shape_compatibility_entry_request_response.go���������������������������������������������0000664�0000000�0000000�00000005235�13771713062�0036366�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetImageShapeCompatibilityEntryRequest wrapper for the GetImageShapeCompatibilityEntry operation type GetImageShapeCompatibilityEntryRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // Shape name. ShapeName *string `mandatory:"true" contributesTo:"path" name:"shapeName"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetImageShapeCompatibilityEntryRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetImageShapeCompatibilityEntryRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetImageShapeCompatibilityEntryRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetImageShapeCompatibilityEntryResponse wrapper for the GetImageShapeCompatibilityEntry operation type GetImageShapeCompatibilityEntryResponse struct { // The underlying http response RawResponse *http.Response // The ImageShapeCompatibilityEntry instance ImageShapeCompatibilityEntry `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetImageShapeCompatibilityEntryResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetImageShapeCompatibilityEntryResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_instance_configuration_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005100�13771713062�0034474�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetInstanceConfigurationRequest wrapper for the GetInstanceConfiguration operation type GetInstanceConfigurationRequest struct { // The OCID of the instance configuration. InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetInstanceConfigurationRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetInstanceConfigurationResponse wrapper for the GetInstanceConfiguration operation type GetInstanceConfigurationResponse struct { // The underlying http response RawResponse *http.Response // The InstanceConfiguration instance InstanceConfiguration `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetInstanceConfigurationResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetInstanceConfigurationResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_instance_console_connection_request_response.go�������������������������������������������������0000664�0000000�0000000�00000005031�13771713062�0035511�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetInstanceConsoleConnectionRequest wrapper for the GetInstanceConsoleConnection operation type GetInstanceConsoleConnectionRequest struct { // The OCID of the instance console connection. InstanceConsoleConnectionId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleConnectionId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetInstanceConsoleConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetInstanceConsoleConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetInstanceConsoleConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetInstanceConsoleConnectionResponse wrapper for the GetInstanceConsoleConnection operation type GetInstanceConsoleConnectionResponse struct { // The underlying http response RawResponse *http.Response // The InstanceConsoleConnection instance InstanceConsoleConnection `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetInstanceConsoleConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetInstanceConsoleConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_instance_pool_load_balancer_attachment_request_response.go��������������������������������������0000664�0000000�0000000�00000005540�13771713062�0037644�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetInstancePoolLoadBalancerAttachmentRequest wrapper for the GetInstancePoolLoadBalancerAttachment operation type GetInstancePoolLoadBalancerAttachmentRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // The OCID of the load balancer attachment. InstancePoolLoadBalancerAttachmentId *string `mandatory:"true" contributesTo:"path" name:"instancePoolLoadBalancerAttachmentId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetInstancePoolLoadBalancerAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetInstancePoolLoadBalancerAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetInstancePoolLoadBalancerAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetInstancePoolLoadBalancerAttachmentResponse wrapper for the GetInstancePoolLoadBalancerAttachment operation type GetInstancePoolLoadBalancerAttachmentResponse struct { // The underlying http response RawResponse *http.Response // The InstancePoolLoadBalancerAttachment instance InstancePoolLoadBalancerAttachment `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetInstancePoolLoadBalancerAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetInstancePoolLoadBalancerAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_instance_pool_request_response.go�����0000664�0000000�0000000�00000004771�13771713062�0032672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetInstancePoolRequest wrapper for the GetInstancePool operation type GetInstancePoolRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetInstancePoolResponse wrapper for the GetInstancePool operation type GetInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } �������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_instance_request_response.go����������0000664�0000000�0000000�00000004557�13771713062�0031643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetInstanceRequest wrapper for the GetInstance operation type GetInstanceRequest struct { // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetInstanceRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetInstanceRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetInstanceResponse wrapper for the GetInstance operation type GetInstanceResponse struct { // The underlying http response RawResponse *http.Response // The Instance instance Instance `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetInstanceResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetInstanceResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_internet_gateway_request_response.go��0000664�0000000�0000000�00000004706�13771713062�0033404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetInternetGatewayRequest wrapper for the GetInternetGateway operation type GetInternetGatewayRequest struct { // The OCID of the internet gateway. IgId *string `mandatory:"true" contributesTo:"path" name:"igId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetInternetGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetInternetGatewayResponse wrapper for the GetInternetGateway operation type GetInternetGatewayResponse struct { // The underlying http response RawResponse *http.Response // The InternetGateway instance InternetGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetInternetGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetInternetGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������get_ipsec_cpe_device_config_content_request_response.go���������������������������������������������0000664�0000000�0000000�00000004762�13771713062�0036306�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "io" "net/http" ) // GetIpsecCpeDeviceConfigContentRequest wrapper for the GetIpsecCpeDeviceConfigContent operation type GetIpsecCpeDeviceConfigContentRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetIpsecCpeDeviceConfigContentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetIpsecCpeDeviceConfigContentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetIpsecCpeDeviceConfigContentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetIpsecCpeDeviceConfigContentResponse wrapper for the GetIpsecCpeDeviceConfigContent operation type GetIpsecCpeDeviceConfigContentResponse struct { // The underlying http response RawResponse *http.Response // The io.ReadCloser instance Content io.ReadCloser `presentIn:"body" encoding:"binary"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetIpsecCpeDeviceConfigContentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetIpsecCpeDeviceConfigContentResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_ipv6_request_response.go��������������0000664�0000000�0000000�00000004550�13771713062�0030714�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetIpv6Request wrapper for the GetIpv6 operation type GetIpv6Request struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the IPv6. Ipv6Id *string `mandatory:"true" contributesTo:"path" name:"ipv6Id"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetIpv6Request) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetIpv6Request) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetIpv6Request) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetIpv6Response wrapper for the GetIpv6 operation type GetIpv6Response struct { // The underlying http response RawResponse *http.Response // The Ipv6 instance Ipv6 `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetIpv6Response) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetIpv6Response) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������get_local_peering_gateway_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005041�13771713062�0034271�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetLocalPeeringGatewayRequest wrapper for the GetLocalPeeringGateway operation type GetLocalPeeringGatewayRequest struct { // The OCID of the local peering gateway. LocalPeeringGatewayId *string `mandatory:"true" contributesTo:"path" name:"localPeeringGatewayId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetLocalPeeringGatewayResponse wrapper for the GetLocalPeeringGateway operation type GetLocalPeeringGatewayResponse struct { // The underlying http response RawResponse *http.Response // The LocalPeeringGateway instance LocalPeeringGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetLocalPeeringGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_nat_gateway_request_response.go�������0000664�0000000�0000000�00000004724�13771713062�0032336�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetNatGatewayRequest wrapper for the GetNatGateway operation type GetNatGatewayRequest struct { // The NAT gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). NatGatewayId *string `mandatory:"true" contributesTo:"path" name:"natGatewayId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetNatGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetNatGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetNatGatewayResponse wrapper for the GetNatGateway operation type GetNatGatewayResponse struct { // The underlying http response RawResponse *http.Response // The NatGateway instance NatGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetNatGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetNatGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������get_network_security_group_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005172�13771713062�0034606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetNetworkSecurityGroupRequest wrapper for the GetNetworkSecurityGroup operation type GetNetworkSecurityGroupRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetNetworkSecurityGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetNetworkSecurityGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetNetworkSecurityGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetNetworkSecurityGroupResponse wrapper for the GetNetworkSecurityGroup operation type GetNetworkSecurityGroupResponse struct { // The underlying http response RawResponse *http.Response // The NetworkSecurityGroup instance NetworkSecurityGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetNetworkSecurityGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetNetworkSecurityGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_private_ip_request_response.go��������0000664�0000000�0000000�00000004600�13771713062�0032166�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetPrivateIpRequest wrapper for the GetPrivateIp operation type GetPrivateIpRequest struct { // The OCID of the private IP. PrivateIpId *string `mandatory:"true" contributesTo:"path" name:"privateIpId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetPrivateIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetPrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetPrivateIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetPrivateIpResponse wrapper for the GetPrivateIp operation type GetPrivateIpResponse struct { // The underlying http response RawResponse *http.Response // The PrivateIp instance PrivateIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetPrivateIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetPrivateIpResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_ip_address_details.go����0000664�0000000�0000000�00000002254�13771713062�0032703�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // GetPublicIpByIpAddressDetails IP address of the public IP. type GetPublicIpByIpAddressDetails struct { // The public IP address. // Example: 129.146.2.1 IpAddress *string `mandatory:"true" json:"ipAddress"` } func (m GetPublicIpByIpAddressDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_public_ip_by_ip_address_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000004745�13771713062�0034614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetPublicIpByIpAddressRequest wrapper for the GetPublicIpByIpAddress operation type GetPublicIpByIpAddressRequest struct { // IP address details for fetching the public IP. GetPublicIpByIpAddressDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetPublicIpByIpAddressRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetPublicIpByIpAddressRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetPublicIpByIpAddressRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetPublicIpByIpAddressResponse wrapper for the GetPublicIpByIpAddress operation type GetPublicIpByIpAddressResponse struct { // The underlying http response RawResponse *http.Response // The PublicIp instance PublicIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetPublicIpByIpAddressResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetPublicIpByIpAddressResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_by_private_ip_id_details.go�0000664�0000000�0000000�00000002276�13771713062�0033410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // GetPublicIpByPrivateIpIdDetails Details of the private IP that the public IP is assigned to. type GetPublicIpByPrivateIpIdDetails struct { // OCID of the private IP. PrivateIpId *string `mandatory:"true" json:"privateIpId"` } func (m GetPublicIpByPrivateIpIdDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_public_ip_by_private_ip_id_request_response.go��������������������������������������������������0000664�0000000�0000000�00000004775�13771713062�0035320�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetPublicIpByPrivateIpIdRequest wrapper for the GetPublicIpByPrivateIpId operation type GetPublicIpByPrivateIpIdRequest struct { // Private IP details for fetching the public IP. GetPublicIpByPrivateIpIdDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetPublicIpByPrivateIpIdRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetPublicIpByPrivateIpIdRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetPublicIpByPrivateIpIdRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetPublicIpByPrivateIpIdResponse wrapper for the GetPublicIpByPrivateIpId operation type GetPublicIpByPrivateIpIdResponse struct { // The underlying http response RawResponse *http.Response // The PublicIp instance PublicIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetPublicIpByPrivateIpIdResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetPublicIpByPrivateIpIdResponse) HTTPResponse() *http.Response { return response.RawResponse } ���packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_public_ip_request_response.go���������0000664�0000000�0000000�00000004560�13771713062�0031777�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetPublicIpRequest wrapper for the GetPublicIp operation type GetPublicIpRequest struct { // The OCID of the public IP. PublicIpId *string `mandatory:"true" contributesTo:"path" name:"publicIpId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetPublicIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetPublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetPublicIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetPublicIpResponse wrapper for the GetPublicIp operation type GetPublicIpResponse struct { // The underlying http response RawResponse *http.Response // The PublicIp instance PublicIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetPublicIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetPublicIpResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������get_remote_peering_connection_request_response.go���������������������������������������������������0000664�0000000�0000000�00000005147�13771713062�0035177�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetRemotePeeringConnectionRequest wrapper for the GetRemotePeeringConnection operation type GetRemotePeeringConnectionRequest struct { // The OCID of the remote peering connection (RPC). RemotePeeringConnectionId *string `mandatory:"true" contributesTo:"path" name:"remotePeeringConnectionId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetRemotePeeringConnectionResponse wrapper for the GetRemotePeeringConnection operation type GetRemotePeeringConnectionResponse struct { // The underlying http response RawResponse *http.Response // The RemotePeeringConnection instance RemotePeeringConnection `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetRemotePeeringConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_route_table_request_response.go�������0000664�0000000�0000000�00000004600�13771713062�0032331�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetRouteTableRequest wrapper for the GetRouteTable operation type GetRouteTableRequest struct { // The OCID of the route table. RtId *string `mandatory:"true" contributesTo:"path" name:"rtId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetRouteTableRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetRouteTableRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetRouteTableResponse wrapper for the GetRouteTable operation type GetRouteTableResponse struct { // The underlying http response RawResponse *http.Response // The RouteTable instance RouteTable `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetRouteTableResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetRouteTableResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_security_list_request_response.go�����0000664�0000000�0000000�00000004660�13771713062�0032734�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetSecurityListRequest wrapper for the GetSecurityList operation type GetSecurityListRequest struct { // The OCID of the security list. SecurityListId *string `mandatory:"true" contributesTo:"path" name:"securityListId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetSecurityListRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetSecurityListRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetSecurityListResponse wrapper for the GetSecurityList operation type GetSecurityListResponse struct { // The underlying http response RawResponse *http.Response // The SecurityList instance SecurityList `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetSecurityListResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetSecurityListResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_service_gateway_request_response.go���0000664�0000000�0000000�00000005024�13771713062�0033206�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetServiceGatewayRequest wrapper for the GetServiceGateway operation type GetServiceGatewayRequest struct { // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetServiceGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetServiceGatewayResponse wrapper for the GetServiceGateway operation type GetServiceGatewayResponse struct { // The underlying http response RawResponse *http.Response // The ServiceGateway instance ServiceGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetServiceGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetServiceGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_service_request_response.go�����������0000664�0000000�0000000�00000004643�13771713062�0031473�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetServiceRequest wrapper for the GetService operation type GetServiceRequest struct { // The service's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ServiceId *string `mandatory:"true" contributesTo:"path" name:"serviceId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetServiceRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetServiceRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetServiceRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetServiceResponse wrapper for the GetService operation type GetServiceResponse struct { // The underlying http response RawResponse *http.Response // The Service instance Service `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetServiceResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetServiceResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_subnet_request_response.go������������0000664�0000000�0000000�00000004517�13771713062�0031333�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetSubnetRequest wrapper for the GetSubnet operation type GetSubnetRequest struct { // The OCID of the subnet. SubnetId *string `mandatory:"true" contributesTo:"path" name:"subnetId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetSubnetRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetSubnetRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetSubnetResponse wrapper for the GetSubnet operation type GetSubnetResponse struct { // The underlying http response RawResponse *http.Response // The Subnet instance Subnet `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetSubnetResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetSubnetResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_tunnel_cpe_device_config_content_request_response.go��������������������������������������������0000664�0000000�0000000�00000005255�13771713062�0036506�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "io" "net/http" ) // GetTunnelCpeDeviceConfigContentRequest wrapper for the GetTunnelCpeDeviceConfigContent operation type GetTunnelCpeDeviceConfigContentRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetTunnelCpeDeviceConfigContentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetTunnelCpeDeviceConfigContentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetTunnelCpeDeviceConfigContentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetTunnelCpeDeviceConfigContentResponse wrapper for the GetTunnelCpeDeviceConfigContent operation type GetTunnelCpeDeviceConfigContentResponse struct { // The underlying http response RawResponse *http.Response // The io.ReadCloser instance Content io.ReadCloser `presentIn:"body" encoding:"binary"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetTunnelCpeDeviceConfigContentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetTunnelCpeDeviceConfigContentResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_tunnel_cpe_device_config_request_response.go����������������������������������������������������0000664�0000000�0000000�00000005270�13771713062�0034751�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetTunnelCpeDeviceConfigRequest wrapper for the GetTunnelCpeDeviceConfig operation type GetTunnelCpeDeviceConfigRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetTunnelCpeDeviceConfigRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetTunnelCpeDeviceConfigRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetTunnelCpeDeviceConfigRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetTunnelCpeDeviceConfigResponse wrapper for the GetTunnelCpeDeviceConfig operation type GetTunnelCpeDeviceConfigResponse struct { // The underlying http response RawResponse *http.Response // The TunnelCpeDeviceConfig instance TunnelCpeDeviceConfig `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetTunnelCpeDeviceConfigResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetTunnelCpeDeviceConfigResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_vcn_request_response.go���������������0000664�0000000�0000000�00000004550�13771713062�0030616�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVcnRequest wrapper for the GetVcn operation type GetVcnRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"path" name:"vcnId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVcnRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVcnRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVcnRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVcnResponse wrapper for the GetVcn operation type GetVcnResponse struct { // The underlying http response RawResponse *http.Response // The Vcn instance Vcn `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVcnResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVcnResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_virtual_circuit_request_response.go���0000664�0000000�0000000�00000004720�13771713062�0033237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVirtualCircuitRequest wrapper for the GetVirtualCircuit operation type GetVirtualCircuitRequest struct { // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVirtualCircuitRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVirtualCircuitResponse wrapper for the GetVirtualCircuit operation type GetVirtualCircuitResponse struct { // The underlying http response RawResponse *http.Response // The VirtualCircuit instance VirtualCircuit `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVirtualCircuitResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVirtualCircuitResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_attachment_request_response.go���0000664�0000000�0000000�00000004720�13771713062�0033176�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVnicAttachmentRequest wrapper for the GetVnicAttachment operation type GetVnicAttachmentRequest struct { // The OCID of the VNIC attachment. VnicAttachmentId *string `mandatory:"true" contributesTo:"path" name:"vnicAttachmentId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVnicAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVnicAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVnicAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVnicAttachmentResponse wrapper for the GetVnicAttachment operation type GetVnicAttachmentResponse struct { // The underlying http response RawResponse *http.Response // The VnicAttachment instance VnicAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVnicAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVnicAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_vnic_request_response.go��������������0000664�0000000�0000000�00000004457�13771713062�0030775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVnicRequest wrapper for the GetVnic operation type GetVnicRequest struct { // The OCID of the VNIC. VnicId *string `mandatory:"true" contributesTo:"path" name:"vnicId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVnicRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVnicRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVnicRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVnicResponse wrapper for the GetVnic operation type GetVnicResponse struct { // The underlying http response RawResponse *http.Response // The Vnic instance Vnic `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVnicResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVnicResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_volume_attachment_request_response.go�0000664�0000000�0000000�00000004760�13771713062�0033552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeAttachmentRequest wrapper for the GetVolumeAttachment operation type GetVolumeAttachmentRequest struct { // The OCID of the volume attachment. VolumeAttachmentId *string `mandatory:"true" contributesTo:"path" name:"volumeAttachmentId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeAttachmentResponse wrapper for the GetVolumeAttachment operation type GetVolumeAttachmentResponse struct { // The underlying http response RawResponse *http.Response // The VolumeAttachment instance VolumeAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������get_volume_backup_policy_asset_assignment_request_response.go���������������������������������������0000664�0000000�0000000�00000007106�13771713062�0037613�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeBackupPolicyAssetAssignmentRequest wrapper for the GetVolumeBackupPolicyAssetAssignment operation type GetVolumeBackupPolicyAssetAssignmentRequest struct { // The OCID of an asset (e.g. a volume). AssetId *string `mandatory:"true" contributesTo:"query" name:"assetId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeBackupPolicyAssetAssignmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeBackupPolicyAssetAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeBackupPolicyAssetAssignmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeBackupPolicyAssetAssignmentResponse wrapper for the GetVolumeBackupPolicyAssetAssignment operation type GetVolumeBackupPolicyAssetAssignmentResponse struct { // The underlying http response RawResponse *http.Response // A list of []VolumeBackupPolicyAssignment instances Items []VolumeBackupPolicyAssignment `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeBackupPolicyAssetAssignmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeBackupPolicyAssetAssignmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_volume_backup_policy_assignment_request_response.go���������������������������������������������0000664�0000000�0000000�00000005232�13771713062�0036412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeBackupPolicyAssignmentRequest wrapper for the GetVolumeBackupPolicyAssignment operation type GetVolumeBackupPolicyAssignmentRequest struct { // The OCID of the volume backup policy assignment. PolicyAssignmentId *string `mandatory:"true" contributesTo:"path" name:"policyAssignmentId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeBackupPolicyAssignmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeBackupPolicyAssignmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeBackupPolicyAssignmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeBackupPolicyAssignmentResponse wrapper for the GetVolumeBackupPolicyAssignment operation type GetVolumeBackupPolicyAssignmentResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackupPolicyAssignment instance VolumeBackupPolicyAssignment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeBackupPolicyAssignmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeBackupPolicyAssignmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_volume_backup_policy_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000004771�13771713062�0034171�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeBackupPolicyRequest wrapper for the GetVolumeBackupPolicy operation type GetVolumeBackupPolicyRequest struct { // The OCID of the volume backup policy. PolicyId *string `mandatory:"true" contributesTo:"path" name:"policyId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeBackupPolicyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeBackupPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeBackupPolicyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeBackupPolicyResponse wrapper for the GetVolumeBackupPolicy operation type GetVolumeBackupPolicyResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackupPolicy instance VolumeBackupPolicy `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeBackupPolicyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeBackupPolicyResponse) HTTPResponse() *http.Response { return response.RawResponse } �������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_volume_backup_request_response.go�����0000664�0000000�0000000�00000004660�13771713062�0032666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeBackupRequest wrapper for the GetVolumeBackup operation type GetVolumeBackupRequest struct { // The OCID of the volume backup. VolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeBackupId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeBackupResponse wrapper for the GetVolumeBackup operation type GetVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackup instance VolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������get_volume_group_backup_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005051�13771713062�0034016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeGroupBackupRequest wrapper for the GetVolumeGroupBackup operation type GetVolumeGroupBackupRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. VolumeGroupBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupBackupId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeGroupBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeGroupBackupResponse wrapper for the GetVolumeGroupBackup operation type GetVolumeGroupBackupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeGroupBackup instance VolumeGroupBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeGroupBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeGroupBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_volume_group_request_response.go������0000664�0000000�0000000�00000004710�13771713062�0032551�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeGroupRequest wrapper for the GetVolumeGroup operation type GetVolumeGroupRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group. VolumeGroupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeGroupResponse wrapper for the GetVolumeGroup operation type GetVolumeGroupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeGroup instance VolumeGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_volume_kms_key_request_response.go����0000664�0000000�0000000�00000005443�13771713062�0033063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeKmsKeyRequest wrapper for the GetVolumeKmsKey operation type GetVolumeKmsKeyRequest struct { // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeKmsKeyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeKmsKeyResponse wrapper for the GetVolumeKmsKey operation type GetVolumeKmsKeyResponse struct { // The underlying http response RawResponse *http.Response // The VolumeKmsKey instance VolumeKmsKey `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeKmsKeyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeKmsKeyResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/get_volume_request_response.go������������0000664�0000000�0000000�00000004517�13771713062�0031342�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetVolumeRequest wrapper for the GetVolume operation type GetVolumeRequest struct { // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetVolumeResponse wrapper for the GetVolume operation type GetVolumeResponse struct { // The underlying http response RawResponse *http.Response // The Volume instance Volume `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������get_windows_instance_initial_credentials_request_response.go����������������������������������������0000664�0000000�0000000�00000005060�13771713062�0037412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // GetWindowsInstanceInitialCredentialsRequest wrapper for the GetWindowsInstanceInitialCredentials operation type GetWindowsInstanceInitialCredentialsRequest struct { // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request GetWindowsInstanceInitialCredentialsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request GetWindowsInstanceInitialCredentialsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request GetWindowsInstanceInitialCredentialsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // GetWindowsInstanceInitialCredentialsResponse wrapper for the GetWindowsInstanceInitialCredentials operation type GetWindowsInstanceInitialCredentialsResponse struct { // The underlying http response RawResponse *http.Response // The InstanceCredentials instance InstanceCredentials `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response GetWindowsInstanceInitialCredentialsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response GetWindowsInstanceInitialCredentialsResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/i_scsi_volume_attachment.go���������������0000664�0000000�0000000�00000013132�13771713062�0030547�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // IScsiVolumeAttachment An ISCSI volume attachment. type IScsiVolumeAttachment struct { // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the volume attachment. Id *string `mandatory:"true" json:"id"` // The OCID of the instance the volume is attached to. InstanceId *string `mandatory:"true" json:"instanceId"` // The date and time the volume was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` // The volume's iSCSI IP address. // Example: `169.254.0.2` Ipv4 *string `mandatory:"true" json:"ipv4"` // The target volume's iSCSI Qualified Name in the format defined by RFC 3720. // Example: `iqn.2015-12.us.oracle.com:456b0391-17b8-4122-bbf1-f85fc0bb97d9` Iqn *string `mandatory:"true" json:"iqn"` // The volume's iSCSI port. // Example: `3260` Port *int `mandatory:"true" json:"port"` // The device name. Device *string `mandatory:"false" json:"device"` // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My volume attachment` DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether the attachment should be created in shareable mode. If an attachment is created in shareable mode, then other instances can attach the same volume, provided that they also create their attachments in shareable mode. Only certain volume types can be attached in shareable mode. Defaults to false if not specified. IsShareable *bool `mandatory:"false" json:"isShareable"` // Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` // The Challenge-Handshake-Authentication-Protocol (CHAP) secret valid for the associated CHAP user name. // (Also called the "CHAP password".) // Example: `d6866c0d-298b-48ba-95af-309b4faux45e` ChapSecret *string `mandatory:"false" json:"chapSecret"` // The volume's system-generated Challenge-Handshake-Authentication-Protocol (CHAP) user name. // Example: `ocid1.volume.oc1.phx.abyhqljrgvttnlx73nmrwfaux7kcvzfs3s66izvxf2h4lgvyndsdsnoiwr5q` ChapUsername *string `mandatory:"false" json:"chapUsername"` // The current state of the volume attachment. LifecycleState VolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } //GetAvailabilityDomain returns AvailabilityDomain func (m IScsiVolumeAttachment) GetAvailabilityDomain() *string { return m.AvailabilityDomain } //GetCompartmentId returns CompartmentId func (m IScsiVolumeAttachment) GetCompartmentId() *string { return m.CompartmentId } //GetDevice returns Device func (m IScsiVolumeAttachment) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m IScsiVolumeAttachment) GetDisplayName() *string { return m.DisplayName } //GetId returns Id func (m IScsiVolumeAttachment) GetId() *string { return m.Id } //GetInstanceId returns InstanceId func (m IScsiVolumeAttachment) GetInstanceId() *string { return m.InstanceId } //GetIsReadOnly returns IsReadOnly func (m IScsiVolumeAttachment) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m IScsiVolumeAttachment) GetIsShareable() *bool { return m.IsShareable } //GetLifecycleState returns LifecycleState func (m IScsiVolumeAttachment) GetLifecycleState() VolumeAttachmentLifecycleStateEnum { return m.LifecycleState } //GetTimeCreated returns TimeCreated func (m IScsiVolumeAttachment) GetTimeCreated() *common.SDKTime { return m.TimeCreated } //GetVolumeId returns VolumeId func (m IScsiVolumeAttachment) GetVolumeId() *string { return m.VolumeId } //GetIsPvEncryptionInTransitEnabled returns IsPvEncryptionInTransitEnabled func (m IScsiVolumeAttachment) GetIsPvEncryptionInTransitEnabled() *bool { return m.IsPvEncryptionInTransitEnabled } func (m IScsiVolumeAttachment) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m IScsiVolumeAttachment) MarshalJSON() (buff []byte, e error) { type MarshalTypeIScsiVolumeAttachment IScsiVolumeAttachment s := struct { DiscriminatorParam string `json:"attachmentType"` MarshalTypeIScsiVolumeAttachment }{ "iscsi", (MarshalTypeIScsiVolumeAttachment)(m), } return json.Marshal(&s) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/icmp_options.go���������������������������0000664�0000000�0000000�00000003402�13771713062�0026201�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // IcmpOptions Optional object to specify a particular ICMP type and code. If you specify ICMP as the protocol // but do not provide this object, then all ICMP types and codes are allowed. If you do provide // this object, the type is required and the code is optional. // See ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) // for allowed values. To enable MTU negotiation for ingress internet traffic, make sure to allow // type 3 ("Destination Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). // If you need to specify multiple codes for a single type, create a separate security list rule for each. type IcmpOptions struct { // The ICMP type. Type *int `mandatory:"true" json:"type"` // The ICMP code (optional). Code *int `mandatory:"false" json:"code"` } func (m IcmpOptions) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/image.go����������������������������������0000664�0000000�0000000�00000015720�13771713062�0024566�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Image A boot disk image for launching an instance. For more information, see // Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Image struct { // The OCID of the compartment containing the instance you want to use as the basis for the image. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Whether instances launched with this image can be used to create new images. // For example, you cannot create an image of an Oracle Database instance. // Example: `true` CreateImageAllowed *bool `mandatory:"true" json:"createImageAllowed"` // The OCID of the image. Id *string `mandatory:"true" json:"id"` LifecycleState ImageLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The image's operating system. // Example: `Oracle Linux` OperatingSystem *string `mandatory:"true" json:"operatingSystem"` // The image's operating system version. // Example: `7.2` OperatingSystemVersion *string `mandatory:"true" json:"operatingSystemVersion"` // The date and time the image was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the image originally used to launch the instance. BaseImageId *string `mandatory:"false" json:"baseImageId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the image. It does not have to be unique, and it's changeable. // Avoid entering confidential information. // You cannot use an Oracle-provided image name as a custom image name. // Example: `My custom Oracle Linux image` DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: // * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images. // * `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. // * `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter. LaunchMode ImageLaunchModeEnum `mandatory:"false" json:"launchMode,omitempty"` LaunchOptions *LaunchOptions `mandatory:"false" json:"launchOptions"` AgentFeatures *InstanceAgentFeatures `mandatory:"false" json:"agentFeatures"` // The boot volume size for an instance launched from this image, (1 MB = 1048576 bytes). // Note this is not the same as the size of the image when it was exported or the actual size of the image. // Example: `47694` SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` } func (m Image) String() string { return common.PointerString(m) } // ImageLaunchModeEnum Enum with underlying type: string type ImageLaunchModeEnum string // Set of constants representing the allowable values for ImageLaunchModeEnum const ( ImageLaunchModeNative ImageLaunchModeEnum = "NATIVE" ImageLaunchModeEmulated ImageLaunchModeEnum = "EMULATED" ImageLaunchModeParavirtualized ImageLaunchModeEnum = "PARAVIRTUALIZED" ImageLaunchModeCustom ImageLaunchModeEnum = "CUSTOM" ) var mappingImageLaunchMode = map[string]ImageLaunchModeEnum{ "NATIVE": ImageLaunchModeNative, "EMULATED": ImageLaunchModeEmulated, "PARAVIRTUALIZED": ImageLaunchModeParavirtualized, "CUSTOM": ImageLaunchModeCustom, } // GetImageLaunchModeEnumValues Enumerates the set of values for ImageLaunchModeEnum func GetImageLaunchModeEnumValues() []ImageLaunchModeEnum { values := make([]ImageLaunchModeEnum, 0) for _, v := range mappingImageLaunchMode { values = append(values, v) } return values } // ImageLifecycleStateEnum Enum with underlying type: string type ImageLifecycleStateEnum string // Set of constants representing the allowable values for ImageLifecycleStateEnum const ( ImageLifecycleStateProvisioning ImageLifecycleStateEnum = "PROVISIONING" ImageLifecycleStateImporting ImageLifecycleStateEnum = "IMPORTING" ImageLifecycleStateAvailable ImageLifecycleStateEnum = "AVAILABLE" ImageLifecycleStateExporting ImageLifecycleStateEnum = "EXPORTING" ImageLifecycleStateDisabled ImageLifecycleStateEnum = "DISABLED" ImageLifecycleStateDeleted ImageLifecycleStateEnum = "DELETED" ) var mappingImageLifecycleState = map[string]ImageLifecycleStateEnum{ "PROVISIONING": ImageLifecycleStateProvisioning, "IMPORTING": ImageLifecycleStateImporting, "AVAILABLE": ImageLifecycleStateAvailable, "EXPORTING": ImageLifecycleStateExporting, "DISABLED": ImageLifecycleStateDisabled, "DELETED": ImageLifecycleStateDeleted, } // GetImageLifecycleStateEnumValues Enumerates the set of values for ImageLifecycleStateEnum func GetImageLifecycleStateEnumValues() []ImageLifecycleStateEnum { values := make([]ImageLifecycleStateEnum, 0) for _, v := range mappingImageLifecycleState { values = append(values, v) } return values } ������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/image_ocpu_constraints.go�����������������0000664�0000000�0000000�00000002411�13771713062�0030234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ImageOcpuConstraints OCPU options for an image and shape. type ImageOcpuConstraints struct { // The minimum number of OCPUs supported for this image and shape. Min *int `mandatory:"false" json:"min"` // The maximum number of OCPUs supported for this image and shape. Max *int `mandatory:"false" json:"max"` } func (m ImageOcpuConstraints) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/image_shape_compatibility_entry.go��������0000664�0000000�0000000�00000002447�13771713062�0032122�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ImageShapeCompatibilityEntry An image and shape that are compatible. type ImageShapeCompatibilityEntry struct { // The image OCID. ImageId *string `mandatory:"true" json:"imageId"` // The shape name. Shape *string `mandatory:"true" json:"shape"` OcpuConstraints *ImageOcpuConstraints `mandatory:"false" json:"ocpuConstraints"` } func (m ImageShapeCompatibilityEntry) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/image_shape_compatibility_summary.go������0000664�0000000�0000000�00000002501�13771713062�0032445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ImageShapeCompatibilitySummary Summary information for an image shape compatibility entry. type ImageShapeCompatibilitySummary struct { // The image OCID. ImageId *string `mandatory:"true" json:"imageId"` // The shape name. Shape *string `mandatory:"true" json:"shape"` OcpuConstraints *ImageOcpuConstraints `mandatory:"false" json:"ocpuConstraints"` } func (m ImageShapeCompatibilitySummary) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/image_source_details.go�������������������0000664�0000000�0000000�00000010405�13771713062�0027646�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ImageSourceDetails The representation of ImageSourceDetails type ImageSourceDetails interface { GetOperatingSystem() *string GetOperatingSystemVersion() *string // The format of the image to be imported. Only monolithic // images are supported. This attribute is not used for exported Oracle images with the OCI image format. GetSourceImageType() ImageSourceDetailsSourceImageTypeEnum } type imagesourcedetails struct { JsonData []byte OperatingSystem *string `mandatory:"false" json:"operatingSystem"` OperatingSystemVersion *string `mandatory:"false" json:"operatingSystemVersion"` SourceImageType ImageSourceDetailsSourceImageTypeEnum `mandatory:"false" json:"sourceImageType,omitempty"` SourceType string `json:"sourceType"` } // UnmarshalJSON unmarshals json func (m *imagesourcedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerimagesourcedetails imagesourcedetails s := struct { Model Unmarshalerimagesourcedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.OperatingSystem = s.Model.OperatingSystem m.OperatingSystemVersion = s.Model.OperatingSystemVersion m.SourceImageType = s.Model.SourceImageType m.SourceType = s.Model.SourceType return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *imagesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.SourceType { case "objectStorageTuple": mm := ImageSourceViaObjectStorageTupleDetails{} err = json.Unmarshal(data, &mm) return mm, err case "objectStorageUri": mm := ImageSourceViaObjectStorageUriDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } //GetOperatingSystem returns OperatingSystem func (m imagesourcedetails) GetOperatingSystem() *string { return m.OperatingSystem } //GetOperatingSystemVersion returns OperatingSystemVersion func (m imagesourcedetails) GetOperatingSystemVersion() *string { return m.OperatingSystemVersion } //GetSourceImageType returns SourceImageType func (m imagesourcedetails) GetSourceImageType() ImageSourceDetailsSourceImageTypeEnum { return m.SourceImageType } func (m imagesourcedetails) String() string { return common.PointerString(m) } // ImageSourceDetailsSourceImageTypeEnum Enum with underlying type: string type ImageSourceDetailsSourceImageTypeEnum string // Set of constants representing the allowable values for ImageSourceDetailsSourceImageTypeEnum const ( ImageSourceDetailsSourceImageTypeQcow2 ImageSourceDetailsSourceImageTypeEnum = "QCOW2" ImageSourceDetailsSourceImageTypeVmdk ImageSourceDetailsSourceImageTypeEnum = "VMDK" ) var mappingImageSourceDetailsSourceImageType = map[string]ImageSourceDetailsSourceImageTypeEnum{ "QCOW2": ImageSourceDetailsSourceImageTypeQcow2, "VMDK": ImageSourceDetailsSourceImageTypeVmdk, } // GetImageSourceDetailsSourceImageTypeEnumValues Enumerates the set of values for ImageSourceDetailsSourceImageTypeEnum func GetImageSourceDetailsSourceImageTypeEnumValues() []ImageSourceDetailsSourceImageTypeEnum { values := make([]ImageSourceDetailsSourceImageTypeEnum, 0) for _, v := range mappingImageSourceDetailsSourceImageType { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������image_source_via_object_storage_tuple_details.go����������������������������������������������������0000664�0000000�0000000�00000005524�13771713062�0034717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ImageSourceViaObjectStorageTupleDetails The representation of ImageSourceViaObjectStorageTupleDetails type ImageSourceViaObjectStorageTupleDetails struct { // The Object Storage bucket for the image. BucketName *string `mandatory:"true" json:"bucketName"` // The Object Storage namespace for the image. NamespaceName *string `mandatory:"true" json:"namespaceName"` // The Object Storage name for the image. ObjectName *string `mandatory:"true" json:"objectName"` OperatingSystem *string `mandatory:"false" json:"operatingSystem"` OperatingSystemVersion *string `mandatory:"false" json:"operatingSystemVersion"` // The format of the image to be imported. Only monolithic // images are supported. This attribute is not used for exported Oracle images with the OCI image format. SourceImageType ImageSourceDetailsSourceImageTypeEnum `mandatory:"false" json:"sourceImageType,omitempty"` } //GetOperatingSystem returns OperatingSystem func (m ImageSourceViaObjectStorageTupleDetails) GetOperatingSystem() *string { return m.OperatingSystem } //GetOperatingSystemVersion returns OperatingSystemVersion func (m ImageSourceViaObjectStorageTupleDetails) GetOperatingSystemVersion() *string { return m.OperatingSystemVersion } //GetSourceImageType returns SourceImageType func (m ImageSourceViaObjectStorageTupleDetails) GetSourceImageType() ImageSourceDetailsSourceImageTypeEnum { return m.SourceImageType } func (m ImageSourceViaObjectStorageTupleDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m ImageSourceViaObjectStorageTupleDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeImageSourceViaObjectStorageTupleDetails ImageSourceViaObjectStorageTupleDetails s := struct { DiscriminatorParam string `json:"sourceType"` MarshalTypeImageSourceViaObjectStorageTupleDetails }{ "objectStorageTuple", (MarshalTypeImageSourceViaObjectStorageTupleDetails)(m), } return json.Marshal(&s) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������image_source_via_object_storage_uri_details.go������������������������������������������������������0000664�0000000�0000000�00000005140�13771713062�0034357�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ImageSourceViaObjectStorageUriDetails The representation of ImageSourceViaObjectStorageUriDetails type ImageSourceViaObjectStorageUriDetails struct { // The Object Storage URL for the image. SourceUri *string `mandatory:"true" json:"sourceUri"` OperatingSystem *string `mandatory:"false" json:"operatingSystem"` OperatingSystemVersion *string `mandatory:"false" json:"operatingSystemVersion"` // The format of the image to be imported. Only monolithic // images are supported. This attribute is not used for exported Oracle images with the OCI image format. SourceImageType ImageSourceDetailsSourceImageTypeEnum `mandatory:"false" json:"sourceImageType,omitempty"` } //GetOperatingSystem returns OperatingSystem func (m ImageSourceViaObjectStorageUriDetails) GetOperatingSystem() *string { return m.OperatingSystem } //GetOperatingSystemVersion returns OperatingSystemVersion func (m ImageSourceViaObjectStorageUriDetails) GetOperatingSystemVersion() *string { return m.OperatingSystemVersion } //GetSourceImageType returns SourceImageType func (m ImageSourceViaObjectStorageUriDetails) GetSourceImageType() ImageSourceDetailsSourceImageTypeEnum { return m.SourceImageType } func (m ImageSourceViaObjectStorageUriDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m ImageSourceViaObjectStorageUriDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeImageSourceViaObjectStorageUriDetails ImageSourceViaObjectStorageUriDetails s := struct { DiscriminatorParam string `json:"sourceType"` MarshalTypeImageSourceViaObjectStorageUriDetails }{ "objectStorageUri", (MarshalTypeImageSourceViaObjectStorageUriDetails)(m), } return json.Marshal(&s) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/ingress_security_rule.go������������������0000664�0000000�0000000�00000012621�13771713062�0030131�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // IngressSecurityRule A rule for allowing inbound IP packets. type IngressSecurityRule struct { // The transport protocol. Specify either `all` or an IPv4 protocol number as // defined in // Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). // Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). Protocol *string `mandatory:"true" json:"protocol"` // Conceptually, this is the range of IP addresses that a packet coming into the instance // can come from. // Allowed values: // * IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56`. // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security list rule for traffic coming from a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. Source *string `mandatory:"true" json:"source"` // Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code // as defined in: // * ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) // * ICMPv6 Parameters (https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) // If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and // codes are allowed. If you do provide this object, the type is required and the code is optional. // To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 ("Destination // Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). If you need to specify // multiple codes for a single type, create a separate security list rule for each. IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"` // A stateless rule allows traffic in one direction. Remember to add a corresponding // stateless rule in the other direction if you need to support bidirectional traffic. For // example, if ingress traffic allows TCP destination port 80, there should be an egress // rule to allow TCP source port 80. Defaults to false, which means the rule is stateful // and a corresponding rule is not necessary for bidirectional traffic. IsStateless *bool `mandatory:"false" json:"isStateless"` // Type of source for the rule. The default is `CIDR_BLOCK`. // * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a // Service (the rule is for traffic coming from a // particular `Service` through a service gateway). SourceType IngressSecurityRuleSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` // Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. // If you specify TCP as the protocol but omit this object, then all destination ports are allowed. TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"` // Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. // If you specify UDP as the protocol but omit this object, then all destination ports are allowed. UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"` // An optional description of your choice for the rule. Description *string `mandatory:"false" json:"description"` } func (m IngressSecurityRule) String() string { return common.PointerString(m) } // IngressSecurityRuleSourceTypeEnum Enum with underlying type: string type IngressSecurityRuleSourceTypeEnum string // Set of constants representing the allowable values for IngressSecurityRuleSourceTypeEnum const ( IngressSecurityRuleSourceTypeCidrBlock IngressSecurityRuleSourceTypeEnum = "CIDR_BLOCK" IngressSecurityRuleSourceTypeServiceCidrBlock IngressSecurityRuleSourceTypeEnum = "SERVICE_CIDR_BLOCK" ) var mappingIngressSecurityRuleSourceType = map[string]IngressSecurityRuleSourceTypeEnum{ "CIDR_BLOCK": IngressSecurityRuleSourceTypeCidrBlock, "SERVICE_CIDR_BLOCK": IngressSecurityRuleSourceTypeServiceCidrBlock, } // GetIngressSecurityRuleSourceTypeEnumValues Enumerates the set of values for IngressSecurityRuleSourceTypeEnum func GetIngressSecurityRuleSourceTypeEnumValues() []IngressSecurityRuleSourceTypeEnum { values := make([]IngressSecurityRuleSourceTypeEnum, 0) for _, v := range mappingIngressSecurityRuleSourceType { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance.go�������������������������������0000664�0000000�0000000�00000033704�13771713062�0025312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // Instance A compute host. The image used to launch the instance determines its operating system and other // software. The shape specified during the launch process determines the number of CPUs and memory // allocated to the instance. For more information, see // Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Instance struct { // The availability domain the instance is running in. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the instance. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the instance. Id *string `mandatory:"true" json:"id"` // The current state of the instance. LifecycleState InstanceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The region that contains the availability domain the instance is running in. // For the us-phoenix-1 and us-ashburn-1 regions, `phx` and `iad` are returned, respectively. // For all other regions, the full region name is returned. // Examples: `phx`, `eu-frankfurt-1` Region *string `mandatory:"true" json:"region"` // The shape of the instance. The shape determines the number of CPUs and the amount of memory // allocated to the instance. You can enumerate all available shapes by calling // ListShapes. Shape *string `mandatory:"true" json:"shape"` // The date and time the instance was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of dedicated VM host. DedicatedVmHostId *string `mandatory:"false" json:"dedicatedVmHostId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My bare metal instance` DisplayName *string `mandatory:"false" json:"displayName"` // Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the 'metadata' object. // They are distinguished from 'metadata' fields in that these can be nested JSON objects (whereas 'metadata' fields are string/string maps only). ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` // The name of the fault domain the instance is running in. // A fault domain is a grouping of hardware and infrastructure within an availability domain. // Each availability domain contains three fault domains. Fault domains let you distribute your // instances so that they are not on the same physical hardware within a single availability domain. // A hardware failure or Compute hardware maintenance that affects one fault domain does not affect // instances in other fault domains. // If you do not specify the fault domain, the system selects one for you. To change the fault // domain for an instance, terminate it and launch a new instance in the preferred fault domain. // Example: `FAULT-DOMAIN-1` FaultDomain *string `mandatory:"false" json:"faultDomain"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Deprecated. Use `sourceDetails` instead. ImageId *string `mandatory:"false" json:"imageId"` // When a bare metal or virtual machine // instance boots, the iPXE firmware that runs on the instance is // configured to run an iPXE script to continue the boot process. // If you want more control over the boot process, you can provide // your own custom iPXE script that will run when the instance boots; // however, you should be aware that the same iPXE script will run // every time an instance boots; not only after the initial // LaunchInstance call. // The default iPXE script connects to the instance's local boot // volume over iSCSI and performs a network boot. If you use a custom iPXE // script and want to network-boot from the instance's local boot volume // over iSCSI the same way as the default iPXE script, you should use the // following iSCSI IP address: 169.254.0.2, and boot volume IQN: // iqn.2015-02.oracle.boot. // For more information about the Bring Your Own Image feature of // Oracle Cloud Infrastructure, see // Bring Your Own Image (https://docs.cloud.oracle.com/Content/Compute/References/bringyourownimage.htm). // For more information about iPXE, see http://ipxe.org. IpxeScript *string `mandatory:"false" json:"ipxeScript"` // Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: // * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images. // * `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. // * `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter. LaunchMode InstanceLaunchModeEnum `mandatory:"false" json:"launchMode,omitempty"` LaunchOptions *LaunchOptions `mandatory:"false" json:"launchOptions"` // Custom metadata that you provide. Metadata map[string]string `mandatory:"false" json:"metadata"` ShapeConfig *InstanceShapeConfig `mandatory:"false" json:"shapeConfig"` // Details for creating an instance SourceDetails InstanceSourceDetails `mandatory:"false" json:"sourceDetails"` // System tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` AgentConfig *InstanceAgentConfig `mandatory:"false" json:"agentConfig"` // The date and time the instance is expected to be stopped / started, in the format defined by RFC3339. // After that time if instance hasn't been rebooted, Oracle will reboot the instance within 24 hours of the due time. // Regardless of how the instance was stopped, the flag will be reset to empty as soon as instance reaches Stopped state. // Example: `2018-05-25T21:10:29.600Z` TimeMaintenanceRebootDue *common.SDKTime `mandatory:"false" json:"timeMaintenanceRebootDue"` } func (m Instance) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *Instance) UnmarshalJSON(data []byte) (e error) { model := struct { DedicatedVmHostId *string `json:"dedicatedVmHostId"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` FaultDomain *string `json:"faultDomain"` FreeformTags map[string]string `json:"freeformTags"` ImageId *string `json:"imageId"` IpxeScript *string `json:"ipxeScript"` LaunchMode InstanceLaunchModeEnum `json:"launchMode"` LaunchOptions *LaunchOptions `json:"launchOptions"` Metadata map[string]string `json:"metadata"` ShapeConfig *InstanceShapeConfig `json:"shapeConfig"` SourceDetails instancesourcedetails `json:"sourceDetails"` SystemTags map[string]map[string]interface{} `json:"systemTags"` AgentConfig *InstanceAgentConfig `json:"agentConfig"` TimeMaintenanceRebootDue *common.SDKTime `json:"timeMaintenanceRebootDue"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` Id *string `json:"id"` LifecycleState InstanceLifecycleStateEnum `json:"lifecycleState"` Region *string `json:"region"` Shape *string `json:"shape"` TimeCreated *common.SDKTime `json:"timeCreated"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DedicatedVmHostId = model.DedicatedVmHostId m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.ExtendedMetadata = model.ExtendedMetadata m.FaultDomain = model.FaultDomain m.FreeformTags = model.FreeformTags m.ImageId = model.ImageId m.IpxeScript = model.IpxeScript m.LaunchMode = model.LaunchMode m.LaunchOptions = model.LaunchOptions m.Metadata = model.Metadata m.ShapeConfig = model.ShapeConfig nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(InstanceSourceDetails) } else { m.SourceDetails = nil } m.SystemTags = model.SystemTags m.AgentConfig = model.AgentConfig m.TimeMaintenanceRebootDue = model.TimeMaintenanceRebootDue m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.Id = model.Id m.LifecycleState = model.LifecycleState m.Region = model.Region m.Shape = model.Shape m.TimeCreated = model.TimeCreated return } // InstanceLaunchModeEnum Enum with underlying type: string type InstanceLaunchModeEnum string // Set of constants representing the allowable values for InstanceLaunchModeEnum const ( InstanceLaunchModeNative InstanceLaunchModeEnum = "NATIVE" InstanceLaunchModeEmulated InstanceLaunchModeEnum = "EMULATED" InstanceLaunchModeParavirtualized InstanceLaunchModeEnum = "PARAVIRTUALIZED" InstanceLaunchModeCustom InstanceLaunchModeEnum = "CUSTOM" ) var mappingInstanceLaunchMode = map[string]InstanceLaunchModeEnum{ "NATIVE": InstanceLaunchModeNative, "EMULATED": InstanceLaunchModeEmulated, "PARAVIRTUALIZED": InstanceLaunchModeParavirtualized, "CUSTOM": InstanceLaunchModeCustom, } // GetInstanceLaunchModeEnumValues Enumerates the set of values for InstanceLaunchModeEnum func GetInstanceLaunchModeEnumValues() []InstanceLaunchModeEnum { values := make([]InstanceLaunchModeEnum, 0) for _, v := range mappingInstanceLaunchMode { values = append(values, v) } return values } // InstanceLifecycleStateEnum Enum with underlying type: string type InstanceLifecycleStateEnum string // Set of constants representing the allowable values for InstanceLifecycleStateEnum const ( InstanceLifecycleStateMoving InstanceLifecycleStateEnum = "MOVING" InstanceLifecycleStateProvisioning InstanceLifecycleStateEnum = "PROVISIONING" InstanceLifecycleStateRunning InstanceLifecycleStateEnum = "RUNNING" InstanceLifecycleStateStarting InstanceLifecycleStateEnum = "STARTING" InstanceLifecycleStateStopping InstanceLifecycleStateEnum = "STOPPING" InstanceLifecycleStateStopped InstanceLifecycleStateEnum = "STOPPED" InstanceLifecycleStateCreatingImage InstanceLifecycleStateEnum = "CREATING_IMAGE" InstanceLifecycleStateTerminating InstanceLifecycleStateEnum = "TERMINATING" InstanceLifecycleStateTerminated InstanceLifecycleStateEnum = "TERMINATED" ) var mappingInstanceLifecycleState = map[string]InstanceLifecycleStateEnum{ "MOVING": InstanceLifecycleStateMoving, "PROVISIONING": InstanceLifecycleStateProvisioning, "RUNNING": InstanceLifecycleStateRunning, "STARTING": InstanceLifecycleStateStarting, "STOPPING": InstanceLifecycleStateStopping, "STOPPED": InstanceLifecycleStateStopped, "CREATING_IMAGE": InstanceLifecycleStateCreatingImage, "TERMINATING": InstanceLifecycleStateTerminating, "TERMINATED": InstanceLifecycleStateTerminated, } // GetInstanceLifecycleStateEnumValues Enumerates the set of values for InstanceLifecycleStateEnum func GetInstanceLifecycleStateEnumValues() []InstanceLifecycleStateEnum { values := make([]InstanceLifecycleStateEnum, 0) for _, v := range mappingInstanceLifecycleState { values = append(values, v) } return values } ������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_action_request_response.go�������0000664�0000000�0000000�00000011004�13771713062�0032322�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // InstanceActionRequest wrapper for the InstanceAction operation type InstanceActionRequest struct { // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` // The action to perform on the instance. Action InstanceActionActionEnum `mandatory:"true" contributesTo:"query" name:"action" omitEmpty:"true"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request InstanceActionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request InstanceActionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request InstanceActionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // InstanceActionResponse wrapper for the InstanceAction operation type InstanceActionResponse struct { // The underlying http response RawResponse *http.Response // The Instance instance Instance `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response InstanceActionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response InstanceActionResponse) HTTPResponse() *http.Response { return response.RawResponse } // InstanceActionActionEnum Enum with underlying type: string type InstanceActionActionEnum string // Set of constants representing the allowable values for InstanceActionActionEnum const ( InstanceActionActionStop InstanceActionActionEnum = "STOP" InstanceActionActionStart InstanceActionActionEnum = "START" InstanceActionActionSoftreset InstanceActionActionEnum = "SOFTRESET" InstanceActionActionReset InstanceActionActionEnum = "RESET" InstanceActionActionSoftstop InstanceActionActionEnum = "SOFTSTOP" ) var mappingInstanceActionAction = map[string]InstanceActionActionEnum{ "STOP": InstanceActionActionStop, "START": InstanceActionActionStart, "SOFTRESET": InstanceActionActionSoftreset, "RESET": InstanceActionActionReset, "SOFTSTOP": InstanceActionActionSoftstop, } // GetInstanceActionActionEnumValues Enumerates the set of values for InstanceActionActionEnum func GetInstanceActionActionEnumValues() []InstanceActionActionEnum { values := make([]InstanceActionActionEnum, 0) for _, v := range mappingInstanceActionAction { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_config.go������������������0000664�0000000�0000000�00000002617�13771713062�0030014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceAgentConfig Instance agent configuration on the instance type InstanceAgentConfig struct { // Whether the agent running on the instance can gather performance metrics and monitor the instance. IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"` // Whether the agent running on the instance can run all the available management plugins. IsManagementDisabled *bool `mandatory:"false" json:"isManagementDisabled"` } func (m InstanceAgentConfig) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_agent_features.go����������������0000664�0000000�0000000�00000002632�13771713062�0030362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceAgentFeatures Instance agent features supported on the image type InstanceAgentFeatures struct { // Whether the agent running on the instance can gather performance metrics and monitor the instance. IsMonitoringSupported *bool `mandatory:"false" json:"isMonitoringSupported"` // Whether the agent running on the instance can run all the available management plugins IsManagementSupported *bool `mandatory:"false" json:"isManagementSupported"` } func (m InstanceAgentFeatures) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration.go�����������������0000664�0000000�0000000�00000010644�13771713062�0030237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfiguration An instance configuration is a template that defines the settings to use when creating Compute instances. // For more information about instance configurations, see // Managing Compute Instances (https://docs.cloud.oracle.com/Content/Compute/Concepts/instancemanagement.htm). type InstanceConfiguration struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment // containing the instance configuration. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance configuration. Id *string `mandatory:"true" json:"id"` // The date and time the instance configuration was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the instance configuration. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` InstanceDetails InstanceConfigurationInstanceDetails `mandatory:"false" json:"instanceDetails"` // Parameters that were not specified when the instance configuration was created, but that // are required to launch an instance from the instance configuration. See the // LaunchInstanceConfiguration operation. DeferredFields []string `mandatory:"false" json:"deferredFields"` } func (m InstanceConfiguration) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *InstanceConfiguration) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` InstanceDetails instanceconfigurationinstancedetails `json:"instanceDetails"` DeferredFields []string `json:"deferredFields"` CompartmentId *string `json:"compartmentId"` Id *string `json:"id"` TimeCreated *common.SDKTime `json:"timeCreated"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags nn, e = model.InstanceDetails.UnmarshalPolymorphicJSON(model.InstanceDetails.JsonData) if e != nil { return } if nn != nil { m.InstanceDetails = nn.(InstanceConfigurationInstanceDetails) } else { m.InstanceDetails = nil } m.DeferredFields = make([]string, len(model.DeferredFields)) for i, n := range model.DeferredFields { m.DeferredFields[i] = n } m.CompartmentId = model.CompartmentId m.Id = model.Id m.TimeCreated = model.TimeCreated return } ��������������������������������������������������������������������������������������������instance_configuration_attach_vnic_details.go�������������������������������������������������������0000664�0000000�0000000�00000003572�13771713062�0034232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationAttachVnicDetails The representation of InstanceConfigurationAttachVnicDetails type InstanceConfigurationAttachVnicDetails struct { // Details for creating a new VNIC. CreateVnicDetails *InstanceConfigurationCreateVnicDetails `mandatory:"false" json:"createVnicDetails"` // A user-friendly name for the attachment. Does not have to be unique, and it cannot be changed. DisplayName *string `mandatory:"false" json:"displayName"` // Which physical network interface card (NIC) the VNIC will use. Defaults to 0. // Certain bare metal instance shapes have two active physical NICs (0 and 1). If // you add a secondary VNIC to one of these instances, you can specify which NIC // the VNIC will use. For more information, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). NicIndex *int `mandatory:"false" json:"nicIndex"` } func (m InstanceConfigurationAttachVnicDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������instance_configuration_attach_volume_details.go�����������������������������������������������������0000664�0000000�0000000�00000005635�13771713062�0034604�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationAttachVolumeDetails Volume attachmentDetails. Please see AttachVolumeDetails type InstanceConfigurationAttachVolumeDetails interface { // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. GetDisplayName() *string // Whether the attachment should be created in read-only mode. GetIsReadOnly() *bool } type instanceconfigurationattachvolumedetails struct { JsonData []byte DisplayName *string `mandatory:"false" json:"displayName"` IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` Type string `json:"type"` } // UnmarshalJSON unmarshals json func (m *instanceconfigurationattachvolumedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerinstanceconfigurationattachvolumedetails instanceconfigurationattachvolumedetails s := struct { Model Unmarshalerinstanceconfigurationattachvolumedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.DisplayName = s.Model.DisplayName m.IsReadOnly = s.Model.IsReadOnly m.Type = s.Model.Type return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *instanceconfigurationattachvolumedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Type { case "iscsi": mm := InstanceConfigurationIscsiAttachVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err case "paravirtualized": mm := InstanceConfigurationParavirtualizedAttachVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } //GetDisplayName returns DisplayName func (m instanceconfigurationattachvolumedetails) GetDisplayName() *string { return m.DisplayName } //GetIsReadOnly returns IsReadOnly func (m instanceconfigurationattachvolumedetails) GetIsReadOnly() *bool { return m.IsReadOnly } func (m instanceconfigurationattachvolumedetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������instance_configuration_block_volume_details.go������������������������������������������������������0000664�0000000�0000000�00000004333�13771713062�0034424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationBlockVolumeDetails Create new block volumes or attach to an existing volume. Specify either createDetails or volumeId. type InstanceConfigurationBlockVolumeDetails struct { AttachDetails InstanceConfigurationAttachVolumeDetails `mandatory:"false" json:"attachDetails"` CreateDetails *InstanceConfigurationCreateVolumeDetails `mandatory:"false" json:"createDetails"` // The OCID of the volume. VolumeId *string `mandatory:"false" json:"volumeId"` } func (m InstanceConfigurationBlockVolumeDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *InstanceConfigurationBlockVolumeDetails) UnmarshalJSON(data []byte) (e error) { model := struct { AttachDetails instanceconfigurationattachvolumedetails `json:"attachDetails"` CreateDetails *InstanceConfigurationCreateVolumeDetails `json:"createDetails"` VolumeId *string `json:"volumeId"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} nn, e = model.AttachDetails.UnmarshalPolymorphicJSON(model.AttachDetails.JsonData) if e != nil { return } if nn != nil { m.AttachDetails = nn.(InstanceConfigurationAttachVolumeDetails) } else { m.AttachDetails = nil } m.CreateDetails = model.CreateDetails m.VolumeId = model.VolumeId return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_create_vnic_details.go�������������������������������������������������������0000664�0000000�0000000�00000006505�13771713062�0034230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationCreateVnicDetails Contains the properties of the VNIC for an instance configuration. See CreateVnicDetails // and Instance Configurations (https://docs.cloud.oracle.com/Content/Compute/Concepts/instancemanagement.htm#config) for more information. type InstanceConfigurationCreateVnicDetails struct { // Whether the VNIC should be assigned a public IP address. See the `assignPublicIp` attribute of CreateVnicDetails // for more information. AssignPublicIp *bool `mandatory:"false" json:"assignPublicIp"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the VNIC. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The hostname for the VNIC's primary private IP. // See the `hostnameLabel` attribute of CreateVnicDetails for more information. HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // A list of the OCIDs of the network security groups (NSGs) to add the VNIC to. For more // information about NSGs, see // NetworkSecurityGroup. NsgIds []string `mandatory:"false" json:"nsgIds"` // A private IP address of your choice to assign to the VNIC. // See the `privateIp` attribute of CreateVnicDetails for more information. PrivateIp *string `mandatory:"false" json:"privateIp"` // Whether the source/destination check is disabled on the VNIC. // See the `skipSourceDestCheck` attribute of CreateVnicDetails for more information. SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` // The OCID of the subnet to create the VNIC in. // See the `subnetId` attribute of CreateVnicDetails for more information. SubnetId *string `mandatory:"false" json:"subnetId"` } func (m InstanceConfigurationCreateVnicDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_create_volume_details.go�����������������������������������������������������0000664�0000000�0000000�00000012446�13771713062�0034601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationCreateVolumeDetails Creates a new block volume. Please see CreateVolumeDetails type InstanceConfigurationCreateVolumeDetails struct { // The availability domain of the volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // If provided, specifies the ID of the volume backup policy to assign to the newly // created volume. If omitted, no policy will be assigned. BackupPolicyId *string `mandatory:"false" json:"backupPolicyId"` // The OCID of the compartment that contains the volume. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the Key Management key to assign as the master encryption key // for the volume. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` // The number of volume performance units (VPUs) that will be applied to this volume per GB, // representing the Block Volume service's elastic performance options. // See Block Volume Elastic Performance (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumeelasticperformance.htm) for more information. // Allowed values: // * `0`: Represents Lower Cost option. // * `10`: Represents Balanced option. // * `20`: Represents Higher Performance option. VpusPerGB *int64 `mandatory:"false" json:"vpusPerGB"` // The size of the volume in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // Specifies the volume source details for a new Block volume. The volume source is either another Block volume in the same availability domain or a Block volume backup. // This is an optional field. If not specified or set to null, the new Block volume will be empty. // When specified, the new Block volume will contain data from the source volume or backup. SourceDetails InstanceConfigurationVolumeSourceDetails `mandatory:"false" json:"sourceDetails"` } func (m InstanceConfigurationCreateVolumeDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *InstanceConfigurationCreateVolumeDetails) UnmarshalJSON(data []byte) (e error) { model := struct { AvailabilityDomain *string `json:"availabilityDomain"` BackupPolicyId *string `json:"backupPolicyId"` CompartmentId *string `json:"compartmentId"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` KmsKeyId *string `json:"kmsKeyId"` VpusPerGB *int64 `json:"vpusPerGB"` SizeInGBs *int64 `json:"sizeInGBs"` SourceDetails instanceconfigurationvolumesourcedetails `json:"sourceDetails"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.AvailabilityDomain = model.AvailabilityDomain m.BackupPolicyId = model.BackupPolicyId m.CompartmentId = model.CompartmentId m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.KmsKeyId = model.KmsKeyId m.VpusPerGB = model.VpusPerGB m.SizeInGBs = model.SizeInGBs nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(InstanceConfigurationVolumeSourceDetails) } else { m.SourceDetails = nil } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_instance_details.go0000664�0000000�0000000�00000004076�13771713062�0033632�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationInstanceDetails The representation of InstanceConfigurationInstanceDetails type InstanceConfigurationInstanceDetails interface { } type instanceconfigurationinstancedetails struct { JsonData []byte InstanceType string `json:"instanceType"` } // UnmarshalJSON unmarshals json func (m *instanceconfigurationinstancedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerinstanceconfigurationinstancedetails instanceconfigurationinstancedetails s := struct { Model Unmarshalerinstanceconfigurationinstancedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.InstanceType = s.Model.InstanceType return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *instanceconfigurationinstancedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.InstanceType { case "compute": mm := ComputeInstanceDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m instanceconfigurationinstancedetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_instance_source_details.go���������������������������������������������������0000664�0000000�0000000�00000004421�13771713062�0035125�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationInstanceSourceDetails The representation of InstanceConfigurationInstanceSourceDetails type InstanceConfigurationInstanceSourceDetails interface { } type instanceconfigurationinstancesourcedetails struct { JsonData []byte SourceType string `json:"sourceType"` } // UnmarshalJSON unmarshals json func (m *instanceconfigurationinstancesourcedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerinstanceconfigurationinstancesourcedetails instanceconfigurationinstancesourcedetails s := struct { Model Unmarshalerinstanceconfigurationinstancesourcedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.SourceType = s.Model.SourceType return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *instanceconfigurationinstancesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.SourceType { case "image": mm := InstanceConfigurationInstanceSourceViaImageDetails{} err = json.Unmarshal(data, &mm) return mm, err case "bootVolume": mm := InstanceConfigurationInstanceSourceViaBootVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m instanceconfigurationinstancesourcedetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_instance_source_via_boot_volume_details.go�����������������������������������0000664�0000000�0000000�00000003545�13771713062�0040404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationInstanceSourceViaBootVolumeDetails The representation of InstanceConfigurationInstanceSourceViaBootVolumeDetails type InstanceConfigurationInstanceSourceViaBootVolumeDetails struct { // The OCID of the boot volume used to boot the instance. BootVolumeId *string `mandatory:"false" json:"bootVolumeId"` } func (m InstanceConfigurationInstanceSourceViaBootVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceConfigurationInstanceSourceViaBootVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceConfigurationInstanceSourceViaBootVolumeDetails InstanceConfigurationInstanceSourceViaBootVolumeDetails s := struct { DiscriminatorParam string `json:"sourceType"` MarshalTypeInstanceConfigurationInstanceSourceViaBootVolumeDetails }{ "bootVolume", (MarshalTypeInstanceConfigurationInstanceSourceViaBootVolumeDetails)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_instance_source_via_image_details.go�����������������������������������������0000664�0000000�0000000�00000003734�13771713062�0037134�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationInstanceSourceViaImageDetails The representation of InstanceConfigurationInstanceSourceViaImageDetails type InstanceConfigurationInstanceSourceViaImageDetails struct { // The size of the boot volume in GBs. The minimum value is 50 GB and the maximum value is 16384 GB (16TB). BootVolumeSizeInGBs *int64 `mandatory:"false" json:"bootVolumeSizeInGBs"` // The OCID of the image used to boot the instance. ImageId *string `mandatory:"false" json:"imageId"` } func (m InstanceConfigurationInstanceSourceViaImageDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceConfigurationInstanceSourceViaImageDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceConfigurationInstanceSourceViaImageDetails InstanceConfigurationInstanceSourceViaImageDetails s := struct { DiscriminatorParam string `json:"sourceType"` MarshalTypeInstanceConfigurationInstanceSourceViaImageDetails }{ "image", (MarshalTypeInstanceConfigurationInstanceSourceViaImageDetails)(m), } return json.Marshal(&s) } ������������������������������������instance_configuration_iscsi_attach_volume_details.go�����������������������������������������������0000664�0000000�0000000�00000004527�13771713062�0035775�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationIscsiAttachVolumeDetails The representation of InstanceConfigurationIscsiAttachVolumeDetails type InstanceConfigurationIscsiAttachVolumeDetails struct { // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment should be created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether to use CHAP authentication for the volume attachment. Defaults to false. UseChap *bool `mandatory:"false" json:"useChap"` } //GetDisplayName returns DisplayName func (m InstanceConfigurationIscsiAttachVolumeDetails) GetDisplayName() *string { return m.DisplayName } //GetIsReadOnly returns IsReadOnly func (m InstanceConfigurationIscsiAttachVolumeDetails) GetIsReadOnly() *bool { return m.IsReadOnly } func (m InstanceConfigurationIscsiAttachVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceConfigurationIscsiAttachVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceConfigurationIscsiAttachVolumeDetails InstanceConfigurationIscsiAttachVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeInstanceConfigurationIscsiAttachVolumeDetails }{ "iscsi", (MarshalTypeInstanceConfigurationIscsiAttachVolumeDetails)(m), } return json.Marshal(&s) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_launch_instance_agent_config_details.go��������������������������������������0000664�0000000�0000000�00000003112�13771713062�0037576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationLaunchInstanceAgentConfigDetails Instance agent configuration options to choose for launching the instance type InstanceConfigurationLaunchInstanceAgentConfigDetails struct { // Whether the agent running on the instance can gather performance metrics and monitor the instance. // Default value is false. IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"` // Whether the agent running on the instance can run all the available management plugins. // Default value is false. IsManagementDisabled *bool `mandatory:"false" json:"isManagementDisabled"` } func (m InstanceConfigurationLaunchInstanceAgentConfigDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_launch_instance_details.go���������������������������������������������������0000664�0000000�0000000�00000043055�13771713062�0035105�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationLaunchInstanceDetails See Instance launch details - LaunchInstanceDetails type InstanceConfigurationLaunchInstanceDetails struct { // The availability domain of the instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Details for the primary VNIC, which is automatically created and attached when // the instance is launched. CreateVnicDetails *InstanceConfigurationCreateVnicDetails `mandatory:"false" json:"createVnicDetails"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My bare metal instance` DisplayName *string `mandatory:"false" json:"displayName"` // Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the 'metadata' object. // They are distinguished from 'metadata' fields in that these can be nested JSON objects (whereas 'metadata' fields are string/string maps only). ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // This is an advanced option. // When a bare metal or virtual machine // instance boots, the iPXE firmware that runs on the instance is // configured to run an iPXE script to continue the boot process. // If you want more control over the boot process, you can provide // your own custom iPXE script that will run when the instance boots; // however, you should be aware that the same iPXE script will run // every time an instance boots; not only after the initial // LaunchInstance call. // The default iPXE script connects to the instance's local boot // volume over iSCSI and performs a network boot. If you use a custom iPXE // script and want to network-boot from the instance's local boot volume // over iSCSI the same way as the default iPXE script, you should use the // following iSCSI IP address: 169.254.0.2, and boot volume IQN: // iqn.2015-02.oracle.boot. // For more information about the Bring Your Own Image feature of // Oracle Cloud Infrastructure, see // Bring Your Own Image (https://docs.cloud.oracle.com/Content/Compute/References/bringyourownimage.htm). // For more information about iPXE, see http://ipxe.org. IpxeScript *string `mandatory:"false" json:"ipxeScript"` // Custom metadata key/value pairs that you provide, such as the SSH public key // required to connect to the instance. // A metadata service runs on every launched instance. The service is an HTTP // endpoint listening on 169.254.169.254. You can use the service to: // * Provide information to Cloud-Init (https://cloudinit.readthedocs.org/en/latest/) // to be used for various system initialization tasks. // * Get information about the instance, including the custom metadata that you // provide when you launch the instance. // **Providing Cloud-Init Metadata** // You can use the following metadata key names to provide information to // Cloud-Init: // **"ssh_authorized_keys"** - Provide one or more public SSH keys to be // included in the `~/.ssh/authorized_keys` file for the default user on the // instance. Use a newline character to separate multiple keys. The SSH // keys must be in the format necessary for the `authorized_keys` file, as shown // in the example below. // **"user_data"** - Provide your own base64-encoded data to be used by // Cloud-Init to run custom scripts or provide custom Cloud-Init configuration. For // information about how to take advantage of user data, see the // Cloud-Init Documentation (http://cloudinit.readthedocs.org/en/latest/topics/format.html). // **Note:** Cloud-Init does not pull this data from the `http://169.254.169.254/opc/v1/instance/metadata/` // path. When the instance launches and either of these keys are provided, the key values are formatted as // OpenStack metadata and copied to the following locations, which are recognized by Cloud-Init: // `http://169.254.169.254/openstack/latest/meta_data.json` - This JSON blob // contains, among other things, the SSH keys that you provided for // **"ssh_authorized_keys"**. // `http://169.254.169.254/openstack/latest/user_data` - Contains the // base64-decoded data that you provided for **"user_data"**. // **Metadata Example** // "metadata" : { // "quake_bot_level" : "Severe", // "ssh_authorized_keys" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCZ06fccNTQfq+xubFlJ5ZR3kt+uzspdH9tXL+lAejSM1NXM+CFZev7MIxfEjas06y80ZBZ7DUTQO0GxJPeD8NCOb1VorF8M4xuLwrmzRtkoZzU16umt4y1W0Q4ifdp3IiiU0U8/WxczSXcUVZOLqkz5dc6oMHdMVpkimietWzGZ4LBBsH/LjEVY7E0V+a0sNchlVDIZcm7ErReBLcdTGDq0uLBiuChyl6RUkX1PNhusquTGwK7zc8OBXkRuubn5UKXhI3Ul9Nyk4XESkVWIGNKmw8mSpoJSjR8P9ZjRmcZVo8S+x4KVPMZKQEor== ryan.smith@company.com // ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAzJSAtwEPoB3Jmr58IXrDGzLuDYkWAYg8AsLYlo6JZvKpjY1xednIcfEVQJm4T2DhVmdWhRrwQ8DmayVZvBkLt+zs2LdoAJEVimKwXcJFD/7wtH8Lnk17HiglbbbNXsemjDY0hea4JUE5CfvkIdZBITuMrfqSmA4n3VNoorXYdvtTMoGG8fxMub46RPtuxtqi9bG9Zqenordkg5FJt2mVNfQRqf83CWojcOkklUWq4CjyxaeLf5i9gv1fRoBo4QhiA8I6NCSppO8GnoV/6Ox6TNoh9BiifqGKC9VGYuC89RvUajRBTZSK2TK4DPfaT+2R+slPsFrwiT/oPEhhEK1S5Q== rsa-key-20160227", // "user_data" : "SWYgeW91IGNhbiBzZWUgdGhpcywgdGhlbiBpdCB3b3JrZWQgbWF5YmUuCg==" // } // **Getting Metadata on the Instance** // To get information about your instance, connect to the instance using SSH and issue any of the // following GET requests: // curl http://169.254.169.254/opc/v1/instance/ // curl http://169.254.169.254/opc/v1/instance/metadata/ // curl http://169.254.169.254/opc/v1/instance/metadata/<any-key-name> // You'll get back a response that includes all the instance information; only the metadata information; or // the metadata information for the specified key name, respectively. Metadata map[string]string `mandatory:"false" json:"metadata"` // The shape of an instance. The shape determines the number of CPUs, amount of memory, // and other resources allocated to the instance. // You can enumerate all available shapes by calling ListShapes. Shape *string `mandatory:"false" json:"shape"` ShapeConfig *InstanceConfigurationLaunchInstanceShapeConfigDetails `mandatory:"false" json:"shapeConfig"` // Details for creating an instance. // Use this parameter to specify whether a boot volume or an image should be used to launch a new instance. SourceDetails InstanceConfigurationInstanceSourceDetails `mandatory:"false" json:"sourceDetails"` // A fault domain is a grouping of hardware and infrastructure within an availability domain. // Each availability domain contains three fault domains. Fault domains let you distribute your // instances so that they are not on the same physical hardware within a single availability domain. // A hardware failure or Compute hardware maintenance that affects one fault domain does not affect // instances in other fault domains. // If you do not specify the fault domain, the system selects one for you. To change the fault // domain for an instance, terminate it and launch a new instance in the preferred fault domain. // To get a list of fault domains, use the // ListFaultDomains operation in the // Identity and Access Management Service API. // Example: `FAULT-DOMAIN-1` FaultDomain *string `mandatory:"false" json:"faultDomain"` // The OCID of dedicated VM host. DedicatedVmHostId *string `mandatory:"false" json:"dedicatedVmHostId"` // Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: // * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for Oracle-provided images. // * `EMULATED` - VM instances launch with emulated devices, such as the E1000 network driver and emulated SCSI disk controller. // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. // * `CUSTOM` - VM instances launch with custom configuration settings specified in the `LaunchOptions` parameter. LaunchMode InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum `mandatory:"false" json:"launchMode,omitempty"` LaunchOptions *InstanceConfigurationLaunchOptions `mandatory:"false" json:"launchOptions"` AgentConfig *InstanceConfigurationLaunchInstanceAgentConfigDetails `mandatory:"false" json:"agentConfig"` // Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` // The preferred maintenance action for an instance. The default is LIVE_MIGRATE, if live migration is supported. // * `LIVE_MIGRATE` - Run maintenance using a live migration. // * `REBOOT` - Run maintenance using a reboot. PreferredMaintenanceAction InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum `mandatory:"false" json:"preferredMaintenanceAction,omitempty"` } func (m InstanceConfigurationLaunchInstanceDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *InstanceConfigurationLaunchInstanceDetails) UnmarshalJSON(data []byte) (e error) { model := struct { AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` CreateVnicDetails *InstanceConfigurationCreateVnicDetails `json:"createVnicDetails"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` FreeformTags map[string]string `json:"freeformTags"` IpxeScript *string `json:"ipxeScript"` Metadata map[string]string `json:"metadata"` Shape *string `json:"shape"` ShapeConfig *InstanceConfigurationLaunchInstanceShapeConfigDetails `json:"shapeConfig"` SourceDetails instanceconfigurationinstancesourcedetails `json:"sourceDetails"` FaultDomain *string `json:"faultDomain"` DedicatedVmHostId *string `json:"dedicatedVmHostId"` LaunchMode InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum `json:"launchMode"` LaunchOptions *InstanceConfigurationLaunchOptions `json:"launchOptions"` AgentConfig *InstanceConfigurationLaunchInstanceAgentConfigDetails `json:"agentConfig"` IsPvEncryptionInTransitEnabled *bool `json:"isPvEncryptionInTransitEnabled"` PreferredMaintenanceAction InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum `json:"preferredMaintenanceAction"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.CreateVnicDetails = model.CreateVnicDetails m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.ExtendedMetadata = model.ExtendedMetadata m.FreeformTags = model.FreeformTags m.IpxeScript = model.IpxeScript m.Metadata = model.Metadata m.Shape = model.Shape m.ShapeConfig = model.ShapeConfig nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(InstanceConfigurationInstanceSourceDetails) } else { m.SourceDetails = nil } m.FaultDomain = model.FaultDomain m.DedicatedVmHostId = model.DedicatedVmHostId m.LaunchMode = model.LaunchMode m.LaunchOptions = model.LaunchOptions m.AgentConfig = model.AgentConfig m.IsPvEncryptionInTransitEnabled = model.IsPvEncryptionInTransitEnabled m.PreferredMaintenanceAction = model.PreferredMaintenanceAction return } // InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum Enum with underlying type: string type InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum string // Set of constants representing the allowable values for InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum const ( InstanceConfigurationLaunchInstanceDetailsLaunchModeNative InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum = "NATIVE" InstanceConfigurationLaunchInstanceDetailsLaunchModeEmulated InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum = "EMULATED" InstanceConfigurationLaunchInstanceDetailsLaunchModeParavirtualized InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum = "PARAVIRTUALIZED" InstanceConfigurationLaunchInstanceDetailsLaunchModeCustom InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum = "CUSTOM" ) var mappingInstanceConfigurationLaunchInstanceDetailsLaunchMode = map[string]InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum{ "NATIVE": InstanceConfigurationLaunchInstanceDetailsLaunchModeNative, "EMULATED": InstanceConfigurationLaunchInstanceDetailsLaunchModeEmulated, "PARAVIRTUALIZED": InstanceConfigurationLaunchInstanceDetailsLaunchModeParavirtualized, "CUSTOM": InstanceConfigurationLaunchInstanceDetailsLaunchModeCustom, } // GetInstanceConfigurationLaunchInstanceDetailsLaunchModeEnumValues Enumerates the set of values for InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum func GetInstanceConfigurationLaunchInstanceDetailsLaunchModeEnumValues() []InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum { values := make([]InstanceConfigurationLaunchInstanceDetailsLaunchModeEnum, 0) for _, v := range mappingInstanceConfigurationLaunchInstanceDetailsLaunchMode { values = append(values, v) } return values } // InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum Enum with underlying type: string type InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum string // Set of constants representing the allowable values for InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum const ( InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionLiveMigrate InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum = "LIVE_MIGRATE" InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionReboot InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum = "REBOOT" ) var mappingInstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceAction = map[string]InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum{ "LIVE_MIGRATE": InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionLiveMigrate, "REBOOT": InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionReboot, } // GetInstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnumValues Enumerates the set of values for InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum func GetInstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnumValues() []InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum { values := make([]InstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceActionEnum, 0) for _, v := range mappingInstanceConfigurationLaunchInstanceDetailsPreferredMaintenanceAction { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_launch_instance_shape_config_details.go��������������������������������������0000664�0000000�0000000�00000003243�13771713062�0037605�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationLaunchInstanceShapeConfigDetails The shape configuration requested for the instance. If provided, the instance will be created // with the resources specified. In the case where some properties are missing or // the entire parameter is not provided, the instance will be created with the default // configuration values for the provided `shape`. // Each shape only supports certain configurable values. If the values provided are invalid for the // provided `shape`, an error will be returned. type InstanceConfigurationLaunchInstanceShapeConfigDetails struct { // The total number of OCPUs available to the instance. Ocpus *float32 `mandatory:"false" json:"ocpus"` } func (m InstanceConfigurationLaunchInstanceShapeConfigDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_launch_options.go��0000664�0000000�0000000�00000024107�13771713062�0033343�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationLaunchOptions Options for tuning compatibility and performance of VM shapes. type InstanceConfigurationLaunchOptions struct { // Emulation type for volume. // * `ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block // Storage volumes on Oracle provided images. // * `SCSI` - Emulated SCSI disk. // * `IDE` - Emulated IDE disk. // * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data // volumes on Oracle provided images. // * `PARAVIRTUALIZED` - Paravirtualized disk. BootVolumeType InstanceConfigurationLaunchOptionsBootVolumeTypeEnum `mandatory:"false" json:"bootVolumeType,omitempty"` // Firmware used to boot VM. Select the option that matches your operating system. // * `BIOS` - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating // systems that boot using MBR style bootloaders. // * `UEFI_64` - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the // default for Oracle provided images. Firmware InstanceConfigurationLaunchOptionsFirmwareEnum `mandatory:"false" json:"firmware,omitempty"` // Emulation type for the physical network interface card (NIC). // * `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver. // * `VFIO` - Direct attached Virtual Function network controller. This is the networking type // when you launch an instance using hardware-assisted (SR-IOV) networking. // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. NetworkType InstanceConfigurationLaunchOptionsNetworkTypeEnum `mandatory:"false" json:"networkType,omitempty"` // Emulation type for volume. // * `ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block // Storage volumes on Oracle provided images. // * `SCSI` - Emulated SCSI disk. // * `IDE` - Emulated IDE disk. // * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data // volumes on Oracle provided images. // * `PARAVIRTUALIZED` - Paravirtualized disk. RemoteDataVolumeType InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum `mandatory:"false" json:"remoteDataVolumeType,omitempty"` // Whether to enable in-transit encryption for the boot volume's paravirtualized attachment. The default value is false. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` // Whether to enable consistent volume naming feature. Defaults to false. IsConsistentVolumeNamingEnabled *bool `mandatory:"false" json:"isConsistentVolumeNamingEnabled"` } func (m InstanceConfigurationLaunchOptions) String() string { return common.PointerString(m) } // InstanceConfigurationLaunchOptionsBootVolumeTypeEnum Enum with underlying type: string type InstanceConfigurationLaunchOptionsBootVolumeTypeEnum string // Set of constants representing the allowable values for InstanceConfigurationLaunchOptionsBootVolumeTypeEnum const ( InstanceConfigurationLaunchOptionsBootVolumeTypeIscsi InstanceConfigurationLaunchOptionsBootVolumeTypeEnum = "ISCSI" InstanceConfigurationLaunchOptionsBootVolumeTypeScsi InstanceConfigurationLaunchOptionsBootVolumeTypeEnum = "SCSI" InstanceConfigurationLaunchOptionsBootVolumeTypeIde InstanceConfigurationLaunchOptionsBootVolumeTypeEnum = "IDE" InstanceConfigurationLaunchOptionsBootVolumeTypeVfio InstanceConfigurationLaunchOptionsBootVolumeTypeEnum = "VFIO" InstanceConfigurationLaunchOptionsBootVolumeTypeParavirtualized InstanceConfigurationLaunchOptionsBootVolumeTypeEnum = "PARAVIRTUALIZED" ) var mappingInstanceConfigurationLaunchOptionsBootVolumeType = map[string]InstanceConfigurationLaunchOptionsBootVolumeTypeEnum{ "ISCSI": InstanceConfigurationLaunchOptionsBootVolumeTypeIscsi, "SCSI": InstanceConfigurationLaunchOptionsBootVolumeTypeScsi, "IDE": InstanceConfigurationLaunchOptionsBootVolumeTypeIde, "VFIO": InstanceConfigurationLaunchOptionsBootVolumeTypeVfio, "PARAVIRTUALIZED": InstanceConfigurationLaunchOptionsBootVolumeTypeParavirtualized, } // GetInstanceConfigurationLaunchOptionsBootVolumeTypeEnumValues Enumerates the set of values for InstanceConfigurationLaunchOptionsBootVolumeTypeEnum func GetInstanceConfigurationLaunchOptionsBootVolumeTypeEnumValues() []InstanceConfigurationLaunchOptionsBootVolumeTypeEnum { values := make([]InstanceConfigurationLaunchOptionsBootVolumeTypeEnum, 0) for _, v := range mappingInstanceConfigurationLaunchOptionsBootVolumeType { values = append(values, v) } return values } // InstanceConfigurationLaunchOptionsFirmwareEnum Enum with underlying type: string type InstanceConfigurationLaunchOptionsFirmwareEnum string // Set of constants representing the allowable values for InstanceConfigurationLaunchOptionsFirmwareEnum const ( InstanceConfigurationLaunchOptionsFirmwareBios InstanceConfigurationLaunchOptionsFirmwareEnum = "BIOS" InstanceConfigurationLaunchOptionsFirmwareUefi64 InstanceConfigurationLaunchOptionsFirmwareEnum = "UEFI_64" ) var mappingInstanceConfigurationLaunchOptionsFirmware = map[string]InstanceConfigurationLaunchOptionsFirmwareEnum{ "BIOS": InstanceConfigurationLaunchOptionsFirmwareBios, "UEFI_64": InstanceConfigurationLaunchOptionsFirmwareUefi64, } // GetInstanceConfigurationLaunchOptionsFirmwareEnumValues Enumerates the set of values for InstanceConfigurationLaunchOptionsFirmwareEnum func GetInstanceConfigurationLaunchOptionsFirmwareEnumValues() []InstanceConfigurationLaunchOptionsFirmwareEnum { values := make([]InstanceConfigurationLaunchOptionsFirmwareEnum, 0) for _, v := range mappingInstanceConfigurationLaunchOptionsFirmware { values = append(values, v) } return values } // InstanceConfigurationLaunchOptionsNetworkTypeEnum Enum with underlying type: string type InstanceConfigurationLaunchOptionsNetworkTypeEnum string // Set of constants representing the allowable values for InstanceConfigurationLaunchOptionsNetworkTypeEnum const ( InstanceConfigurationLaunchOptionsNetworkTypeE1000 InstanceConfigurationLaunchOptionsNetworkTypeEnum = "E1000" InstanceConfigurationLaunchOptionsNetworkTypeVfio InstanceConfigurationLaunchOptionsNetworkTypeEnum = "VFIO" InstanceConfigurationLaunchOptionsNetworkTypeParavirtualized InstanceConfigurationLaunchOptionsNetworkTypeEnum = "PARAVIRTUALIZED" ) var mappingInstanceConfigurationLaunchOptionsNetworkType = map[string]InstanceConfigurationLaunchOptionsNetworkTypeEnum{ "E1000": InstanceConfigurationLaunchOptionsNetworkTypeE1000, "VFIO": InstanceConfigurationLaunchOptionsNetworkTypeVfio, "PARAVIRTUALIZED": InstanceConfigurationLaunchOptionsNetworkTypeParavirtualized, } // GetInstanceConfigurationLaunchOptionsNetworkTypeEnumValues Enumerates the set of values for InstanceConfigurationLaunchOptionsNetworkTypeEnum func GetInstanceConfigurationLaunchOptionsNetworkTypeEnumValues() []InstanceConfigurationLaunchOptionsNetworkTypeEnum { values := make([]InstanceConfigurationLaunchOptionsNetworkTypeEnum, 0) for _, v := range mappingInstanceConfigurationLaunchOptionsNetworkType { values = append(values, v) } return values } // InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum Enum with underlying type: string type InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum string // Set of constants representing the allowable values for InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum const ( InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeIscsi InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum = "ISCSI" InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeScsi InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum = "SCSI" InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeIde InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum = "IDE" InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeVfio InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum = "VFIO" InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeParavirtualized InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum = "PARAVIRTUALIZED" ) var mappingInstanceConfigurationLaunchOptionsRemoteDataVolumeType = map[string]InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum{ "ISCSI": InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeIscsi, "SCSI": InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeScsi, "IDE": InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeIde, "VFIO": InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeVfio, "PARAVIRTUALIZED": InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeParavirtualized, } // GetInstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnumValues Enumerates the set of values for InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum func GetInstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnumValues() []InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum { values := make([]InstanceConfigurationLaunchOptionsRemoteDataVolumeTypeEnum, 0) for _, v := range mappingInstanceConfigurationLaunchOptionsRemoteDataVolumeType { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_paravirtualized_attach_volume_details.go�������������������������������������0000664�0000000�0000000�00000004507�13771713062�0040067�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationParavirtualizedAttachVolumeDetails The representation of InstanceConfigurationParavirtualizedAttachVolumeDetails type InstanceConfigurationParavirtualizedAttachVolumeDetails struct { // A user-friendly name. Does not have to be unique, and it cannot be changed. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment should be created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` } //GetDisplayName returns DisplayName func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) GetDisplayName() *string { return m.DisplayName } //GetIsReadOnly returns IsReadOnly func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) GetIsReadOnly() *bool { return m.IsReadOnly } func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceConfigurationParavirtualizedAttachVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceConfigurationParavirtualizedAttachVolumeDetails InstanceConfigurationParavirtualizedAttachVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeInstanceConfigurationParavirtualizedAttachVolumeDetails }{ "paravirtualized", (MarshalTypeInstanceConfigurationParavirtualizedAttachVolumeDetails)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_configuration_summary.go���������0000664�0000000�0000000�00000004452�13771713062�0032014�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationSummary Summary information for an instance configuration. type InstanceConfigurationSummary struct { // The OCID of the compartment containing the instance configuration. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the instance configuration. Id *string `mandatory:"true" json:"id"` // The date and time the instance configuration was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // A user-friendly name for the instance configuration. DisplayName *string `mandatory:"false" json:"displayName"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m InstanceConfigurationSummary) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_volume_source_details.go�����������������������������������������������������0000664�0000000�0000000�00000004345�13771713062�0034635�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationVolumeSourceDetails The representation of InstanceConfigurationVolumeSourceDetails type InstanceConfigurationVolumeSourceDetails interface { } type instanceconfigurationvolumesourcedetails struct { JsonData []byte Type string `json:"type"` } // UnmarshalJSON unmarshals json func (m *instanceconfigurationvolumesourcedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerinstanceconfigurationvolumesourcedetails instanceconfigurationvolumesourcedetails s := struct { Model Unmarshalerinstanceconfigurationvolumesourcedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.Type = s.Model.Type return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *instanceconfigurationvolumesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Type { case "volumeBackup": mm := InstanceConfigurationVolumeSourceFromVolumeBackupDetails{} err = json.Unmarshal(data, &mm) return mm, err case "volume": mm := InstanceConfigurationVolumeSourceFromVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m instanceconfigurationvolumesourcedetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_volume_source_from_volume_backup_details.go����������������������������������0000664�0000000�0000000�00000003414�13771713062�0040570�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationVolumeSourceFromVolumeBackupDetails Specifies the volume backup. type InstanceConfigurationVolumeSourceFromVolumeBackupDetails struct { // The OCID of the volume backup. Id *string `mandatory:"false" json:"id"` } func (m InstanceConfigurationVolumeSourceFromVolumeBackupDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceConfigurationVolumeSourceFromVolumeBackupDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceConfigurationVolumeSourceFromVolumeBackupDetails InstanceConfigurationVolumeSourceFromVolumeBackupDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeInstanceConfigurationVolumeSourceFromVolumeBackupDetails }{ "volumeBackup", (MarshalTypeInstanceConfigurationVolumeSourceFromVolumeBackupDetails)(m), } return json.Marshal(&s) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_configuration_volume_source_from_volume_details.go�����������������������������������������0000664�0000000�0000000�00000003317�13771713062�0037245�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceConfigurationVolumeSourceFromVolumeDetails Specifies the source volume. type InstanceConfigurationVolumeSourceFromVolumeDetails struct { // The OCID of the volume. Id *string `mandatory:"false" json:"id"` } func (m InstanceConfigurationVolumeSourceFromVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceConfigurationVolumeSourceFromVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceConfigurationVolumeSourceFromVolumeDetails InstanceConfigurationVolumeSourceFromVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeInstanceConfigurationVolumeSourceFromVolumeDetails }{ "volume", (MarshalTypeInstanceConfigurationVolumeSourceFromVolumeDetails)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_console_connection.go������������0000664�0000000�0000000�00000011000�13771713062�0031234�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceConsoleConnection The `InstanceConsoleConnection` API provides you with console access to Compute instances, // enabling you to troubleshoot malfunctioning instances remotely. // For more information about console access, see // Accessing the Console (https://docs.cloud.oracle.com/Content/Compute/References/serialconsole.htm). type InstanceConsoleConnection struct { // The OCID of the compartment to contain the console connection. CompartmentId *string `mandatory:"false" json:"compartmentId"` // The SSH connection string for the console connection. ConnectionString *string `mandatory:"false" json:"connectionString"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The SSH public key fingerprint for the console connection. Fingerprint *string `mandatory:"false" json:"fingerprint"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the console connection. Id *string `mandatory:"false" json:"id"` // The OCID of the instance the console connection connects to. InstanceId *string `mandatory:"false" json:"instanceId"` // The current state of the console connection. LifecycleState InstanceConsoleConnectionLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The SSH connection string for the SSH tunnel used to // connect to the console connection over VNC. VncConnectionString *string `mandatory:"false" json:"vncConnectionString"` } func (m InstanceConsoleConnection) String() string { return common.PointerString(m) } // InstanceConsoleConnectionLifecycleStateEnum Enum with underlying type: string type InstanceConsoleConnectionLifecycleStateEnum string // Set of constants representing the allowable values for InstanceConsoleConnectionLifecycleStateEnum const ( InstanceConsoleConnectionLifecycleStateActive InstanceConsoleConnectionLifecycleStateEnum = "ACTIVE" InstanceConsoleConnectionLifecycleStateCreating InstanceConsoleConnectionLifecycleStateEnum = "CREATING" InstanceConsoleConnectionLifecycleStateDeleted InstanceConsoleConnectionLifecycleStateEnum = "DELETED" InstanceConsoleConnectionLifecycleStateDeleting InstanceConsoleConnectionLifecycleStateEnum = "DELETING" InstanceConsoleConnectionLifecycleStateFailed InstanceConsoleConnectionLifecycleStateEnum = "FAILED" ) var mappingInstanceConsoleConnectionLifecycleState = map[string]InstanceConsoleConnectionLifecycleStateEnum{ "ACTIVE": InstanceConsoleConnectionLifecycleStateActive, "CREATING": InstanceConsoleConnectionLifecycleStateCreating, "DELETED": InstanceConsoleConnectionLifecycleStateDeleted, "DELETING": InstanceConsoleConnectionLifecycleStateDeleting, "FAILED": InstanceConsoleConnectionLifecycleStateFailed, } // GetInstanceConsoleConnectionLifecycleStateEnumValues Enumerates the set of values for InstanceConsoleConnectionLifecycleStateEnum func GetInstanceConsoleConnectionLifecycleStateEnumValues() []InstanceConsoleConnectionLifecycleStateEnum { values := make([]InstanceConsoleConnectionLifecycleStateEnum, 0) for _, v := range mappingInstanceConsoleConnectionLifecycleState { values = append(values, v) } return values } packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_credentials.go�������������������0000664�0000000�0000000�00000002321�13771713062�0027656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceCredentials The credentials for a particular instance. type InstanceCredentials struct { // The password for the username. Password *string `mandatory:"true" json:"password"` // The username. Username *string `mandatory:"true" json:"username"` } func (m InstanceCredentials) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_pool.go��������������������������0000664�0000000�0000000�00000012163�13771713062�0026337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstancePool An instance pool is a group of instances within the same region that are created based off of the same // instance configuration. For more information about instance pools and instance configurations, see // Managing Compute Instances (https://docs.cloud.oracle.com/Content/Compute/Concepts/instancemanagement.htm). type InstancePool struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. Id *string `mandatory:"true" json:"id"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the instance // pool. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance configuration associated // with the instance pool. InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` // The current state of the instance pool. LifecycleState InstancePoolLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The placement configurations for the instance pool. PlacementConfigurations []InstancePoolPlacementConfiguration `mandatory:"true" json:"placementConfigurations"` // The number of instances that should be in the instance pool. Size *int `mandatory:"true" json:"size"` // The date and time the instance pool was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The user-friendly name. Does not have to be unique. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The load balancers attached to the instance pool. LoadBalancers []InstancePoolLoadBalancerAttachment `mandatory:"false" json:"loadBalancers"` } func (m InstancePool) String() string { return common.PointerString(m) } // InstancePoolLifecycleStateEnum Enum with underlying type: string type InstancePoolLifecycleStateEnum string // Set of constants representing the allowable values for InstancePoolLifecycleStateEnum const ( InstancePoolLifecycleStateProvisioning InstancePoolLifecycleStateEnum = "PROVISIONING" InstancePoolLifecycleStateScaling InstancePoolLifecycleStateEnum = "SCALING" InstancePoolLifecycleStateStarting InstancePoolLifecycleStateEnum = "STARTING" InstancePoolLifecycleStateStopping InstancePoolLifecycleStateEnum = "STOPPING" InstancePoolLifecycleStateTerminating InstancePoolLifecycleStateEnum = "TERMINATING" InstancePoolLifecycleStateStopped InstancePoolLifecycleStateEnum = "STOPPED" InstancePoolLifecycleStateTerminated InstancePoolLifecycleStateEnum = "TERMINATED" InstancePoolLifecycleStateRunning InstancePoolLifecycleStateEnum = "RUNNING" ) var mappingInstancePoolLifecycleState = map[string]InstancePoolLifecycleStateEnum{ "PROVISIONING": InstancePoolLifecycleStateProvisioning, "SCALING": InstancePoolLifecycleStateScaling, "STARTING": InstancePoolLifecycleStateStarting, "STOPPING": InstancePoolLifecycleStateStopping, "TERMINATING": InstancePoolLifecycleStateTerminating, "STOPPED": InstancePoolLifecycleStateStopped, "TERMINATED": InstancePoolLifecycleStateTerminated, "RUNNING": InstancePoolLifecycleStateRunning, } // GetInstancePoolLifecycleStateEnumValues Enumerates the set of values for InstancePoolLifecycleStateEnum func GetInstancePoolLifecycleStateEnumValues() []InstancePoolLifecycleStateEnum { values := make([]InstancePoolLifecycleStateEnum, 0) for _, v := range mappingInstancePoolLifecycleState { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_pool_instance_load_balancer_backend.go�����������������������������������������������������0000664�0000000�0000000�00000007033�13771713062�0034441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstancePoolInstanceLoadBalancerBackend Represents the load balancer Backend that is configured for an instance pool instance. type InstancePoolInstanceLoadBalancerBackend struct { // The OCID of the load balancer attached to the instance pool. LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` // The name of the backend set on the load balancer. BackendSetName *string `mandatory:"true" json:"backendSetName"` // The name of the backend in the backend set. BackendName *string `mandatory:"true" json:"backendName"` // The health of the backend as observed by the load balancer. BackendHealthStatus InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum `mandatory:"true" json:"backendHealthStatus"` } func (m InstancePoolInstanceLoadBalancerBackend) String() string { return common.PointerString(m) } // InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum Enum with underlying type: string type InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum string // Set of constants representing the allowable values for InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum const ( InstancePoolInstanceLoadBalancerBackendBackendHealthStatusOk InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "OK" InstancePoolInstanceLoadBalancerBackendBackendHealthStatusWarning InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "WARNING" InstancePoolInstanceLoadBalancerBackendBackendHealthStatusCritical InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "CRITICAL" InstancePoolInstanceLoadBalancerBackendBackendHealthStatusUnknown InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum = "UNKNOWN" ) var mappingInstancePoolInstanceLoadBalancerBackendBackendHealthStatus = map[string]InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum{ "OK": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusOk, "WARNING": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusWarning, "CRITICAL": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusCritical, "UNKNOWN": InstancePoolInstanceLoadBalancerBackendBackendHealthStatusUnknown, } // GetInstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnumValues Enumerates the set of values for InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum func GetInstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnumValues() []InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum { values := make([]InstancePoolInstanceLoadBalancerBackendBackendHealthStatusEnum, 0) for _, v := range mappingInstancePoolInstanceLoadBalancerBackendBackendHealthStatus { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_load_balancer_attachment.go�0000664�0000000�0000000�00000010033�13771713062�0033367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstancePoolLoadBalancerAttachment Represents a load balancer that is attached to an instance pool. type InstancePoolLoadBalancerAttachment struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer attachment. Id *string `mandatory:"true" json:"id"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool of the load balancer attachment. InstancePoolId *string `mandatory:"true" json:"instancePoolId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the load balancer attached to the instance pool. LoadBalancerId *string `mandatory:"true" json:"loadBalancerId"` // The name of the backend set on the load balancer. BackendSetName *string `mandatory:"true" json:"backendSetName"` // The port value used for the backends. Port *int `mandatory:"true" json:"port"` // Indicates which VNIC on each instance in the instance pool should be used to associate with the load balancer. Possible values are "PrimaryVnic" or the displayName of one of the secondary VNICs on the instance configuration that is associated with the instance pool. VnicSelection *string `mandatory:"true" json:"vnicSelection"` // The status of the interaction between the instance pool and the load balancer. LifecycleState InstancePoolLoadBalancerAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } func (m InstancePoolLoadBalancerAttachment) String() string { return common.PointerString(m) } // InstancePoolLoadBalancerAttachmentLifecycleStateEnum Enum with underlying type: string type InstancePoolLoadBalancerAttachmentLifecycleStateEnum string // Set of constants representing the allowable values for InstancePoolLoadBalancerAttachmentLifecycleStateEnum const ( InstancePoolLoadBalancerAttachmentLifecycleStateAttaching InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "ATTACHING" InstancePoolLoadBalancerAttachmentLifecycleStateAttached InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "ATTACHED" InstancePoolLoadBalancerAttachmentLifecycleStateDetaching InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "DETACHING" InstancePoolLoadBalancerAttachmentLifecycleStateDetached InstancePoolLoadBalancerAttachmentLifecycleStateEnum = "DETACHED" ) var mappingInstancePoolLoadBalancerAttachmentLifecycleState = map[string]InstancePoolLoadBalancerAttachmentLifecycleStateEnum{ "ATTACHING": InstancePoolLoadBalancerAttachmentLifecycleStateAttaching, "ATTACHED": InstancePoolLoadBalancerAttachmentLifecycleStateAttached, "DETACHING": InstancePoolLoadBalancerAttachmentLifecycleStateDetaching, "DETACHED": InstancePoolLoadBalancerAttachmentLifecycleStateDetached, } // GetInstancePoolLoadBalancerAttachmentLifecycleStateEnumValues Enumerates the set of values for InstancePoolLoadBalancerAttachmentLifecycleStateEnum func GetInstancePoolLoadBalancerAttachmentLifecycleStateEnumValues() []InstancePoolLoadBalancerAttachmentLifecycleStateEnum { values := make([]InstancePoolLoadBalancerAttachmentLifecycleStateEnum, 0) for _, v := range mappingInstancePoolLoadBalancerAttachmentLifecycleState { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_placement_configuration.go��0000664�0000000�0000000�00000004420�13771713062�0033313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstancePoolPlacementConfiguration The location for where an instance pool will place instances. type InstancePoolPlacementConfiguration struct { // The availability domain to place instances. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the primary subnet to place instances. PrimarySubnetId *string `mandatory:"true" json:"primarySubnetId"` // The fault domains to place instances. // If you don't provide any values, the system makes a best effort to distribute // instances across all fault domains based on capacity. // To distribute the instances evenly across selected fault domains, provide a // set of fault domains. For example, you might want instances to be evenly // distributed if your applications require high availability. // To get a list of fault domains, use the // ListFaultDomains operation // in the Identity and Access Management Service API. // Example: `[FAULT-DOMAIN-1, FAULT-DOMAIN-2, FAULT-DOMAIN-3]` FaultDomains []string `mandatory:"false" json:"faultDomains"` // The set of secondary VNIC data for instances in the pool. SecondaryVnicSubnets []InstancePoolPlacementSecondaryVnicSubnet `mandatory:"false" json:"secondaryVnicSubnets"` } func (m InstancePoolPlacementConfiguration) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������instance_pool_placement_secondary_vnic_subnet.go����������������������������������������������������0000664�0000000�0000000�00000002767�13771713062�0034767�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstancePoolPlacementSecondaryVnicSubnet The secondary VNIC object for the placement configuration for an instance pool. type InstancePoolPlacementSecondaryVnicSubnet struct { // The subnet OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) for the secondary VNIC. SubnetId *string `mandatory:"true" json:"subnetId"` // The display name of the VNIC. This is also use to match against the instance configuration defined // secondary VNIC. DisplayName *string `mandatory:"false" json:"displayName"` } func (m InstancePoolPlacementSecondaryVnicSubnet) String() string { return common.PointerString(m) } ���������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_pool_summary.go������������������0000664�0000000�0000000�00000011324�13771713062�0030112�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstancePoolSummary Summary information for an instance pool. type InstancePoolSummary struct { // The OCID of the instance pool. Id *string `mandatory:"true" json:"id"` // The OCID of the compartment containing the instance pool. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the instance configuration associated with the instance pool. InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` // The current state of the instance pool. LifecycleState InstancePoolSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The availability domains for the instance pool. AvailabilityDomains []string `mandatory:"true" json:"availabilityDomains"` // The number of instances that should be in the instance pool. Size *int `mandatory:"true" json:"size"` // The date and time the instance pool was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The user-friendly name. Does not have to be unique. DisplayName *string `mandatory:"false" json:"displayName"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m InstancePoolSummary) String() string { return common.PointerString(m) } // InstancePoolSummaryLifecycleStateEnum Enum with underlying type: string type InstancePoolSummaryLifecycleStateEnum string // Set of constants representing the allowable values for InstancePoolSummaryLifecycleStateEnum const ( InstancePoolSummaryLifecycleStateProvisioning InstancePoolSummaryLifecycleStateEnum = "PROVISIONING" InstancePoolSummaryLifecycleStateScaling InstancePoolSummaryLifecycleStateEnum = "SCALING" InstancePoolSummaryLifecycleStateStarting InstancePoolSummaryLifecycleStateEnum = "STARTING" InstancePoolSummaryLifecycleStateStopping InstancePoolSummaryLifecycleStateEnum = "STOPPING" InstancePoolSummaryLifecycleStateTerminating InstancePoolSummaryLifecycleStateEnum = "TERMINATING" InstancePoolSummaryLifecycleStateStopped InstancePoolSummaryLifecycleStateEnum = "STOPPED" InstancePoolSummaryLifecycleStateTerminated InstancePoolSummaryLifecycleStateEnum = "TERMINATED" InstancePoolSummaryLifecycleStateRunning InstancePoolSummaryLifecycleStateEnum = "RUNNING" ) var mappingInstancePoolSummaryLifecycleState = map[string]InstancePoolSummaryLifecycleStateEnum{ "PROVISIONING": InstancePoolSummaryLifecycleStateProvisioning, "SCALING": InstancePoolSummaryLifecycleStateScaling, "STARTING": InstancePoolSummaryLifecycleStateStarting, "STOPPING": InstancePoolSummaryLifecycleStateStopping, "TERMINATING": InstancePoolSummaryLifecycleStateTerminating, "STOPPED": InstancePoolSummaryLifecycleStateStopped, "TERMINATED": InstancePoolSummaryLifecycleStateTerminated, "RUNNING": InstancePoolSummaryLifecycleStateRunning, } // GetInstancePoolSummaryLifecycleStateEnumValues Enumerates the set of values for InstancePoolSummaryLifecycleStateEnum func GetInstancePoolSummaryLifecycleStateEnumValues() []InstancePoolSummaryLifecycleStateEnum { values := make([]InstancePoolSummaryLifecycleStateEnum, 0) for _, v := range mappingInstancePoolSummaryLifecycleState { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_shape_config.go������������������0000664�0000000�0000000�00000005115�13771713062�0030012�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceShapeConfig The shape configuration for an instance. The shape configuration determines // the resources allocated to an instance. type InstanceShapeConfig struct { // The total number of OCPUs available to the instance. Ocpus *float32 `mandatory:"false" json:"ocpus"` // The total amount of memory, in gigabytes, available to the instance. MemoryInGBs *float32 `mandatory:"false" json:"memoryInGBs"` // A short description of the processors available to the instance. ProcessorDescription *string `mandatory:"false" json:"processorDescription"` // The networking bandwidth, in gigabits per second, available to the instance. NetworkingBandwidthInGbps *float32 `mandatory:"false" json:"networkingBandwidthInGbps"` // The maximum number of VNIC attachments for the instance. MaxVnicAttachments *int `mandatory:"false" json:"maxVnicAttachments"` // The number of GPUs available to this instance. Gpus *int `mandatory:"false" json:"gpus"` // A short description of the GPUs available to this instance. // This field is `null` if `gpus` is `0`. GpuDescription *string `mandatory:"false" json:"gpuDescription"` // The number of local disks available to the instance. LocalDisks *int `mandatory:"false" json:"localDisks"` // The size of the local disks, aggregated, in gigabytes. // This field is `null` if `localDisks` is equal to `0`. LocalDisksTotalSizeInGBs *float32 `mandatory:"false" json:"localDisksTotalSizeInGBs"` // A short description of the local disks available to this instance. // This field is `null` if `localDisks` is equal to `0`. LocalDiskDescription *string `mandatory:"false" json:"localDiskDescription"` } func (m InstanceShapeConfig) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_source_details.go����������������0000664�0000000�0000000�00000004025�13771713062�0030371�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceSourceDetails The representation of InstanceSourceDetails type InstanceSourceDetails interface { } type instancesourcedetails struct { JsonData []byte SourceType string `json:"sourceType"` } // UnmarshalJSON unmarshals json func (m *instancesourcedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalerinstancesourcedetails instancesourcedetails s := struct { Model Unmarshalerinstancesourcedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.SourceType = s.Model.SourceType return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *instancesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.SourceType { case "image": mm := InstanceSourceViaImageDetails{} err = json.Unmarshal(data, &mm) return mm, err case "bootVolume": mm := InstanceSourceViaBootVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m instancesourcedetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_boot_volume_details.go0000664�0000000�0000000�00000003247�13771713062�0033647�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceSourceViaBootVolumeDetails The representation of InstanceSourceViaBootVolumeDetails type InstanceSourceViaBootVolumeDetails struct { // The OCID of the boot volume used to boot the instance. BootVolumeId *string `mandatory:"true" json:"bootVolumeId"` } func (m InstanceSourceViaBootVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceSourceViaBootVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceSourceViaBootVolumeDetails InstanceSourceViaBootVolumeDetails s := struct { DiscriminatorParam string `json:"sourceType"` MarshalTypeInstanceSourceViaBootVolumeDetails }{ "bootVolume", (MarshalTypeInstanceSourceViaBootVolumeDetails)(m), } return json.Marshal(&s) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_source_via_image_details.go������0000664�0000000�0000000�00000003660�13771713062�0032376�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // InstanceSourceViaImageDetails The representation of InstanceSourceViaImageDetails type InstanceSourceViaImageDetails struct { // The OCID of the image used to boot the instance. ImageId *string `mandatory:"true" json:"imageId"` // The size of the boot volume in GBs. Minimum value is 50 GB and maximum value is 16384 GB (16TB). BootVolumeSizeInGBs *int64 `mandatory:"false" json:"bootVolumeSizeInGBs"` // The OCID of the Key Management key to assign as the master encryption key for the boot volume. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m InstanceSourceViaImageDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m InstanceSourceViaImageDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeInstanceSourceViaImageDetails InstanceSourceViaImageDetails s := struct { DiscriminatorParam string `json:"sourceType"` MarshalTypeInstanceSourceViaImageDetails }{ "image", (MarshalTypeInstanceSourceViaImageDetails)(m), } return json.Marshal(&s) } ��������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/instance_summary.go�����������������������0000664�0000000�0000000�00000005206�13771713062�0027063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InstanceSummary Condensed instance data when listing instances in an instance pool. type InstanceSummary struct { // The OCID of the instance. Id *string `mandatory:"true" json:"id"` // The availability domain the instance is running in. AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the instance. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the instance confgiuration used to create the instance. InstanceConfigurationId *string `mandatory:"true" json:"instanceConfigurationId"` // The region that contains the availability domain the instance is running in. Region *string `mandatory:"true" json:"region"` // The current state of the instance pool instance. State *string `mandatory:"true" json:"state"` // The date and time the instance pool instance was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The user-friendly name. Does not have to be unique. DisplayName *string `mandatory:"false" json:"displayName"` // The name of the Fault Domain the instance is running in. FaultDomain *string `mandatory:"false" json:"faultDomain"` // The shape of an instance. The shape determines the number of CPUs, amount of memory, // and other resources allocated to the instance. // You can enumerate all available shapes by calling ListShapes. Shape *string `mandatory:"false" json:"shape"` // The load balancer backends that are configured for the instance pool instance. LoadBalancerBackends []InstancePoolInstanceLoadBalancerBackend `mandatory:"false" json:"loadBalancerBackends"` } func (m InstanceSummary) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/internet_gateway.go�����������������������0000664�0000000�0000000�00000011203�13771713062�0027045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // InternetGateway Represents a router that connects the edge of a VCN with the Internet. For an example scenario // that uses an internet gateway, see // Typical Networking Service Scenarios (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm#scenarios). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type InternetGateway struct { // The OCID of the compartment containing the internet gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The internet gateway's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The internet gateway's current state. LifecycleState InternetGatewayLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID of the VCN the internet gateway belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Whether the gateway is enabled. When the gateway is disabled, traffic is not // routed to/from the Internet, regardless of route rules. IsEnabled *bool `mandatory:"false" json:"isEnabled"` // The date and time the internet gateway was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m InternetGateway) String() string { return common.PointerString(m) } // InternetGatewayLifecycleStateEnum Enum with underlying type: string type InternetGatewayLifecycleStateEnum string // Set of constants representing the allowable values for InternetGatewayLifecycleStateEnum const ( InternetGatewayLifecycleStateProvisioning InternetGatewayLifecycleStateEnum = "PROVISIONING" InternetGatewayLifecycleStateAvailable InternetGatewayLifecycleStateEnum = "AVAILABLE" InternetGatewayLifecycleStateTerminating InternetGatewayLifecycleStateEnum = "TERMINATING" InternetGatewayLifecycleStateTerminated InternetGatewayLifecycleStateEnum = "TERMINATED" ) var mappingInternetGatewayLifecycleState = map[string]InternetGatewayLifecycleStateEnum{ "PROVISIONING": InternetGatewayLifecycleStateProvisioning, "AVAILABLE": InternetGatewayLifecycleStateAvailable, "TERMINATING": InternetGatewayLifecycleStateTerminating, "TERMINATED": InternetGatewayLifecycleStateTerminated, } // GetInternetGatewayLifecycleStateEnumValues Enumerates the set of values for InternetGatewayLifecycleStateEnum func GetInternetGatewayLifecycleStateEnumValues() []InternetGatewayLifecycleStateEnum { values := make([]InternetGatewayLifecycleStateEnum, 0) for _, v := range mappingInternetGatewayLifecycleState { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection.go����������������������0000664�0000000�0000000�00000020333�13771713062�0027161�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // IpSecConnection A connection between a DRG and CPE. This connection consists of multiple IPSec // tunnels. Creating this connection is one of the steps required when setting up // an IPSec VPN. // **Important:** Each tunnel in an IPSec connection can use either static routing or BGP dynamic // routing (see the IPSecConnectionTunnel object's // `routing` attribute). Originally only static routing was supported and // every IPSec connection was required to have at least one static route configured. // To maintain backward compatibility in the API when support for BPG dynamic routing was introduced, // the API accepts an empty list of static routes if you configure both of the IPSec tunnels to use // BGP dynamic routing. If you switch a tunnel's routing from `BGP` to `STATIC`, you must first // ensure that the IPSec connection is configured with at least one valid CIDR block static route. // Oracle uses the IPSec connection's static routes when routing a tunnel's traffic *only* // if that tunnel's `routing` attribute = `STATIC`. Otherwise the static routes are ignored. // For more information about the workflow for setting up an IPSec connection, see // IPSec VPN (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPsec.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type IpSecConnection struct { // The OCID of the compartment containing the IPSec connection. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the Cpe object. CpeId *string `mandatory:"true" json:"cpeId"` // The OCID of the DRG. DrgId *string `mandatory:"true" json:"drgId"` // The IPSec connection's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The IPSec connection's current state. LifecycleState IpSecConnectionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // Static routes to the CPE. The CIDR must not be a // multicast address or class E address. // Used for routing a given IPSec tunnel's traffic only if the tunnel // is using static routing. If you configure at least one tunnel to use static routing, then // you must provide at least one valid static route. If you configure both // tunnels to use BGP dynamic routing, you can provide an empty list for the static routes. // The CIDR can be either IPv4 or IPv6. Note that IPv6 addressing is currently supported only // in certain regions. See IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `10.0.1.0/24` // Example: `2001:db8::/32` StaticRoutes []string `mandatory:"true" json:"staticRoutes"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Your identifier for your CPE device. Can be either an IP address or a hostname (specifically, // the fully qualified domain name (FQDN)). The type of identifier here must correspond // to the value for `cpeLocalIdentifierType`. // If you don't provide a value when creating the IPSec connection, the `ipAddress` attribute // for the Cpe object specified by `cpeId` is used as the `cpeLocalIdentifier`. // For information about why you'd provide this value, see // If Your CPE Is Behind a NAT Device (https://docs.cloud.oracle.com/Content/Network/Tasks/overviewIPsec.htm#nat). // Example IP address: `10.0.3.3` // Example hostname: `cpe.example.com` CpeLocalIdentifier *string `mandatory:"false" json:"cpeLocalIdentifier"` // The type of identifier for your CPE device. The value here must correspond to the value // for `cpeLocalIdentifier`. CpeLocalIdentifierType IpSecConnectionCpeLocalIdentifierTypeEnum `mandatory:"false" json:"cpeLocalIdentifierType,omitempty"` // The date and time the IPSec connection was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m IpSecConnection) String() string { return common.PointerString(m) } // IpSecConnectionLifecycleStateEnum Enum with underlying type: string type IpSecConnectionLifecycleStateEnum string // Set of constants representing the allowable values for IpSecConnectionLifecycleStateEnum const ( IpSecConnectionLifecycleStateProvisioning IpSecConnectionLifecycleStateEnum = "PROVISIONING" IpSecConnectionLifecycleStateAvailable IpSecConnectionLifecycleStateEnum = "AVAILABLE" IpSecConnectionLifecycleStateTerminating IpSecConnectionLifecycleStateEnum = "TERMINATING" IpSecConnectionLifecycleStateTerminated IpSecConnectionLifecycleStateEnum = "TERMINATED" ) var mappingIpSecConnectionLifecycleState = map[string]IpSecConnectionLifecycleStateEnum{ "PROVISIONING": IpSecConnectionLifecycleStateProvisioning, "AVAILABLE": IpSecConnectionLifecycleStateAvailable, "TERMINATING": IpSecConnectionLifecycleStateTerminating, "TERMINATED": IpSecConnectionLifecycleStateTerminated, } // GetIpSecConnectionLifecycleStateEnumValues Enumerates the set of values for IpSecConnectionLifecycleStateEnum func GetIpSecConnectionLifecycleStateEnumValues() []IpSecConnectionLifecycleStateEnum { values := make([]IpSecConnectionLifecycleStateEnum, 0) for _, v := range mappingIpSecConnectionLifecycleState { values = append(values, v) } return values } // IpSecConnectionCpeLocalIdentifierTypeEnum Enum with underlying type: string type IpSecConnectionCpeLocalIdentifierTypeEnum string // Set of constants representing the allowable values for IpSecConnectionCpeLocalIdentifierTypeEnum const ( IpSecConnectionCpeLocalIdentifierTypeIpAddress IpSecConnectionCpeLocalIdentifierTypeEnum = "IP_ADDRESS" IpSecConnectionCpeLocalIdentifierTypeHostname IpSecConnectionCpeLocalIdentifierTypeEnum = "HOSTNAME" ) var mappingIpSecConnectionCpeLocalIdentifierType = map[string]IpSecConnectionCpeLocalIdentifierTypeEnum{ "IP_ADDRESS": IpSecConnectionCpeLocalIdentifierTypeIpAddress, "HOSTNAME": IpSecConnectionCpeLocalIdentifierTypeHostname, } // GetIpSecConnectionCpeLocalIdentifierTypeEnumValues Enumerates the set of values for IpSecConnectionCpeLocalIdentifierTypeEnum func GetIpSecConnectionCpeLocalIdentifierTypeEnumValues() []IpSecConnectionCpeLocalIdentifierTypeEnum { values := make([]IpSecConnectionCpeLocalIdentifierTypeEnum, 0) for _, v := range mappingIpSecConnectionCpeLocalIdentifierType { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_config.go��������0000664�0000000�0000000�00000003103�13771713062�0032021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // IpSecConnectionDeviceConfig Deprecated. For tunnel information, instead see: // * IPSecConnectionTunnel // * IPSecConnectionTunnelSharedSecret type IpSecConnectionDeviceConfig struct { // The OCID of the compartment containing the IPSec connection. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The IPSec connection's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The date and time the IPSec connection was created. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // Two TunnelConfig objects. Tunnels []TunnelConfig `mandatory:"false" json:"tunnels"` } func (m IpSecConnectionDeviceConfig) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_device_status.go��������0000664�0000000�0000000�00000003140�13771713062�0032100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // IpSecConnectionDeviceStatus Deprecated. For tunnel information, instead see // IPSecConnectionTunnel. type IpSecConnectionDeviceStatus struct { // The OCID of the compartment containing the IPSec connection. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The IPSec connection's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The date and time the IPSec connection was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // Two TunnelStatus objects. Tunnels []TunnelStatus `mandatory:"false" json:"tunnels"` } func (m IpSecConnectionDeviceStatus) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel.go���������������0000664�0000000�0000000�00000016554�13771713062�0030560�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // IpSecConnectionTunnel Information about a single tunnel in an IPSec connection. This object does not include the tunnel's // shared secret (pre-shared key). That is in the // IPSecConnectionTunnelSharedSecret object. type IpSecConnectionTunnel struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the tunnel. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. Id *string `mandatory:"true" json:"id"` // The tunnel's lifecycle state. LifecycleState IpSecConnectionTunnelLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The IP address of Oracle's VPN headend. // Example: `192.0.2.5` VpnIp *string `mandatory:"false" json:"vpnIp"` // The IP address of the CPE's VPN headend. // Example: `192.0.2.157` CpeIp *string `mandatory:"false" json:"cpeIp"` // The status of the tunnel based on IPSec protocol characteristics. Status IpSecConnectionTunnelStatusEnum `mandatory:"false" json:"status,omitempty"` // Internet Key Exchange protocol version. IkeVersion IpSecConnectionTunnelIkeVersionEnum `mandatory:"false" json:"ikeVersion,omitempty"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Information for establishing the tunnel's BGP session. BgpSessionInfo *BgpSessionInfo `mandatory:"false" json:"bgpSessionInfo"` // The type of routing used for this tunnel (either BGP dynamic routing or static routing). Routing IpSecConnectionTunnelRoutingEnum `mandatory:"false" json:"routing,omitempty"` // The date and time the IPSec connection tunnel was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // When the status of the tunnel last changed, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeStatusUpdated *common.SDKTime `mandatory:"false" json:"timeStatusUpdated"` } func (m IpSecConnectionTunnel) String() string { return common.PointerString(m) } // IpSecConnectionTunnelStatusEnum Enum with underlying type: string type IpSecConnectionTunnelStatusEnum string // Set of constants representing the allowable values for IpSecConnectionTunnelStatusEnum const ( IpSecConnectionTunnelStatusUp IpSecConnectionTunnelStatusEnum = "UP" IpSecConnectionTunnelStatusDown IpSecConnectionTunnelStatusEnum = "DOWN" IpSecConnectionTunnelStatusDownForMaintenance IpSecConnectionTunnelStatusEnum = "DOWN_FOR_MAINTENANCE" ) var mappingIpSecConnectionTunnelStatus = map[string]IpSecConnectionTunnelStatusEnum{ "UP": IpSecConnectionTunnelStatusUp, "DOWN": IpSecConnectionTunnelStatusDown, "DOWN_FOR_MAINTENANCE": IpSecConnectionTunnelStatusDownForMaintenance, } // GetIpSecConnectionTunnelStatusEnumValues Enumerates the set of values for IpSecConnectionTunnelStatusEnum func GetIpSecConnectionTunnelStatusEnumValues() []IpSecConnectionTunnelStatusEnum { values := make([]IpSecConnectionTunnelStatusEnum, 0) for _, v := range mappingIpSecConnectionTunnelStatus { values = append(values, v) } return values } // IpSecConnectionTunnelIkeVersionEnum Enum with underlying type: string type IpSecConnectionTunnelIkeVersionEnum string // Set of constants representing the allowable values for IpSecConnectionTunnelIkeVersionEnum const ( IpSecConnectionTunnelIkeVersionV1 IpSecConnectionTunnelIkeVersionEnum = "V1" IpSecConnectionTunnelIkeVersionV2 IpSecConnectionTunnelIkeVersionEnum = "V2" ) var mappingIpSecConnectionTunnelIkeVersion = map[string]IpSecConnectionTunnelIkeVersionEnum{ "V1": IpSecConnectionTunnelIkeVersionV1, "V2": IpSecConnectionTunnelIkeVersionV2, } // GetIpSecConnectionTunnelIkeVersionEnumValues Enumerates the set of values for IpSecConnectionTunnelIkeVersionEnum func GetIpSecConnectionTunnelIkeVersionEnumValues() []IpSecConnectionTunnelIkeVersionEnum { values := make([]IpSecConnectionTunnelIkeVersionEnum, 0) for _, v := range mappingIpSecConnectionTunnelIkeVersion { values = append(values, v) } return values } // IpSecConnectionTunnelLifecycleStateEnum Enum with underlying type: string type IpSecConnectionTunnelLifecycleStateEnum string // Set of constants representing the allowable values for IpSecConnectionTunnelLifecycleStateEnum const ( IpSecConnectionTunnelLifecycleStateProvisioning IpSecConnectionTunnelLifecycleStateEnum = "PROVISIONING" IpSecConnectionTunnelLifecycleStateAvailable IpSecConnectionTunnelLifecycleStateEnum = "AVAILABLE" IpSecConnectionTunnelLifecycleStateTerminating IpSecConnectionTunnelLifecycleStateEnum = "TERMINATING" IpSecConnectionTunnelLifecycleStateTerminated IpSecConnectionTunnelLifecycleStateEnum = "TERMINATED" ) var mappingIpSecConnectionTunnelLifecycleState = map[string]IpSecConnectionTunnelLifecycleStateEnum{ "PROVISIONING": IpSecConnectionTunnelLifecycleStateProvisioning, "AVAILABLE": IpSecConnectionTunnelLifecycleStateAvailable, "TERMINATING": IpSecConnectionTunnelLifecycleStateTerminating, "TERMINATED": IpSecConnectionTunnelLifecycleStateTerminated, } // GetIpSecConnectionTunnelLifecycleStateEnumValues Enumerates the set of values for IpSecConnectionTunnelLifecycleStateEnum func GetIpSecConnectionTunnelLifecycleStateEnumValues() []IpSecConnectionTunnelLifecycleStateEnum { values := make([]IpSecConnectionTunnelLifecycleStateEnum, 0) for _, v := range mappingIpSecConnectionTunnelLifecycleState { values = append(values, v) } return values } // IpSecConnectionTunnelRoutingEnum Enum with underlying type: string type IpSecConnectionTunnelRoutingEnum string // Set of constants representing the allowable values for IpSecConnectionTunnelRoutingEnum const ( IpSecConnectionTunnelRoutingBgp IpSecConnectionTunnelRoutingEnum = "BGP" IpSecConnectionTunnelRoutingStatic IpSecConnectionTunnelRoutingEnum = "STATIC" ) var mappingIpSecConnectionTunnelRouting = map[string]IpSecConnectionTunnelRoutingEnum{ "BGP": IpSecConnectionTunnelRoutingBgp, "STATIC": IpSecConnectionTunnelRoutingStatic, } // GetIpSecConnectionTunnelRoutingEnumValues Enumerates the set of values for IpSecConnectionTunnelRoutingEnum func GetIpSecConnectionTunnelRoutingEnumValues() []IpSecConnectionTunnelRoutingEnum { values := make([]IpSecConnectionTunnelRoutingEnum, 0) for _, v := range mappingIpSecConnectionTunnelRouting { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/ip_sec_connection_tunnel_shared_secret.go�0000664�0000000�0000000�00000002414�13771713062�0033441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // IpSecConnectionTunnelSharedSecret The tunnel's shared secret (pre-shared key). type IpSecConnectionTunnelSharedSecret struct { // The tunnel's shared secret (pre-shared key). // Example: `EXAMPLEToUis6j1cp8GdVQxcmdfMO0yXMLilZTbYCMDGu4V8o` SharedSecret *string `mandatory:"true" json:"sharedSecret"` } func (m IpSecConnectionTunnelSharedSecret) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/ipv6.go�����������������������������������0000664�0000000�0000000�00000013666�13771713062�0024377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Ipv6 An *IPv6* is a conceptual term that refers to an IPv6 address and related properties. // The `IPv6` object is the API representation of an IPv6. // You can create and assign an IPv6 to any VNIC that is in an IPv6-enabled subnet in an // IPv6-enabled VCN. // **Note:** IPv6 addressing is currently supported only in certain regions. For important // details about IPv6 addressing in a VCN, see IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). type Ipv6 struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment containing the IPv6. // This is the same as the VNIC's compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the IPv6. Id *string `mandatory:"true" json:"id"` // The IPv6 address of the `IPv6` object. The address is within the private IPv6 CIDR block // of the VNIC's subnet (see the `ipv6CidrBlock` attribute for the Subnet // object). // Example: `2001:0db8:0123:1111:abcd:ef01:2345:6789` IpAddress *string `mandatory:"true" json:"ipAddress"` // The IPv6's current state. LifecycleState Ipv6LifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the subnet the VNIC is in. SubnetId *string `mandatory:"true" json:"subnetId"` // The date and time the IPv6 was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC the IPv6 is assigned to. // The VNIC and IPv6 must be in the same subnet. VnicId *string `mandatory:"true" json:"vnicId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Whether the IPv6 can be used for internet communication. Allowed by default for an IPv6 in // a public subnet. Never allowed for an IPv6 in a private subnet. If the value is `true`, the // IPv6 uses its public IP address for internet communication. // Example: `true` IsInternetAccessAllowed *bool `mandatory:"false" json:"isInternetAccessAllowed"` // The IPv6 address to be used for internet communication. The address is within the public // IPv6 CIDR block of the VNIC's subnet (see the `ipv6PublicCidrBlock` attribute for the // Subnet object). // If your organization did NOT assign a custom IPv6 CIDR to the VCN for the private address // space, Oracle provides the IPv6 CIDR and uses that same CIDR for the private and public // address space. Therefore the `publicIpAddress` would be the same as the `ipAddress`. // If your organization assigned a custom IPv6 CIDR to the VCN for the private address space, // the right 80 bits of the IPv6 public IP (the subnet and address bits) are the same as for // the `ipAddress`. But the left 48 bits are from the public IPv6 CIDR that Oracle assigned // to the VCN. // This is null if the IPv6 is created with `isInternetAccessAllowed` set to `false`. // Example: `2001:0db8:0123:1111:abcd:ef01:2345:6789` PublicIpAddress *string `mandatory:"false" json:"publicIpAddress"` } func (m Ipv6) String() string { return common.PointerString(m) } // Ipv6LifecycleStateEnum Enum with underlying type: string type Ipv6LifecycleStateEnum string // Set of constants representing the allowable values for Ipv6LifecycleStateEnum const ( Ipv6LifecycleStateProvisioning Ipv6LifecycleStateEnum = "PROVISIONING" Ipv6LifecycleStateAvailable Ipv6LifecycleStateEnum = "AVAILABLE" Ipv6LifecycleStateTerminating Ipv6LifecycleStateEnum = "TERMINATING" Ipv6LifecycleStateTerminated Ipv6LifecycleStateEnum = "TERMINATED" ) var mappingIpv6LifecycleState = map[string]Ipv6LifecycleStateEnum{ "PROVISIONING": Ipv6LifecycleStateProvisioning, "AVAILABLE": Ipv6LifecycleStateAvailable, "TERMINATING": Ipv6LifecycleStateTerminating, "TERMINATED": Ipv6LifecycleStateTerminated, } // GetIpv6LifecycleStateEnumValues Enumerates the set of values for Ipv6LifecycleStateEnum func GetIpv6LifecycleStateEnumValues() []Ipv6LifecycleStateEnum { values := make([]Ipv6LifecycleStateEnum, 0) for _, v := range mappingIpv6LifecycleState { values = append(values, v) } return values } ��������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_agent_config_details.go���0000664�0000000�0000000�00000003013�13771713062�0033042�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // LaunchInstanceAgentConfigDetails Instance agent configuration options to choose for launching the instance type LaunchInstanceAgentConfigDetails struct { // Whether the agent running on the instance can gather performance metrics and monitor the instance. // Default value is false. IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"` // Whether the agent running on the instance can run all the available management plugins. // Default value is false. IsManagementDisabled *bool `mandatory:"false" json:"isManagementDisabled"` } func (m LaunchInstanceAgentConfigDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������launch_instance_configuration_request_response.go���������������������������������������������������0000664�0000000�0000000�00000006711�13771713062�0035200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // LaunchInstanceConfigurationRequest wrapper for the LaunchInstanceConfiguration operation type LaunchInstanceConfigurationRequest struct { // The OCID of the instance configuration. InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` // Instance configuration Instance Details InstanceConfiguration InstanceConfigurationInstanceDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request LaunchInstanceConfigurationRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request LaunchInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request LaunchInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // LaunchInstanceConfigurationResponse wrapper for the LaunchInstanceConfiguration operation type LaunchInstanceConfigurationResponse struct { // The underlying http response RawResponse *http.Response // The Instance instance Instance `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response LaunchInstanceConfigurationResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response LaunchInstanceConfigurationResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_details.go����������������0000664�0000000�0000000�00000031651�13771713062�0030350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // LaunchInstanceDetails Instance launch details. // Use the `sourceDetails` parameter to specify whether a boot volume or an image should be used to launch a new instance. type LaunchInstanceDetails struct { // The availability domain of the instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The shape of an instance. The shape determines the number of CPUs, amount of memory, // and other resources allocated to the instance. // You can enumerate all available shapes by calling ListShapes. Shape *string `mandatory:"true" json:"shape"` // Details for the primary VNIC, which is automatically created and attached when // the instance is launched. CreateVnicDetails *CreateVnicDetails `mandatory:"false" json:"createVnicDetails"` // The OCID of dedicated VM host. DedicatedVmHostId *string `mandatory:"false" json:"dedicatedVmHostId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My bare metal instance` DisplayName *string `mandatory:"false" json:"displayName"` // Additional metadata key/value pairs that you provide. They serve the same purpose and functionality as fields in the 'metadata' object. // They are distinguished from 'metadata' fields in that these can be nested JSON objects (whereas 'metadata' fields are string/string maps only). ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` // A fault domain is a grouping of hardware and infrastructure within an availability domain. // Each availability domain contains three fault domains. Fault domains let you distribute your // instances so that they are not on the same physical hardware within a single availability domain. // A hardware failure or Compute hardware maintenance that affects one fault domain does not affect // instances in other fault domains. // If you do not specify the fault domain, the system selects one for you. To change the fault // domain for an instance, terminate it and launch a new instance in the preferred fault domain. // To get a list of fault domains, use the // ListFaultDomains operation in the // Identity and Access Management Service API. // Example: `FAULT-DOMAIN-1` FaultDomain *string `mandatory:"false" json:"faultDomain"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Deprecated. Instead use `hostnameLabel` in // CreateVnicDetails. // If you provide both, the values must match. HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // Deprecated. Use `sourceDetails` with InstanceSourceViaImageDetails // source type instead. If you specify values for both, the values must match. ImageId *string `mandatory:"false" json:"imageId"` // This is an advanced option. // When a bare metal or virtual machine // instance boots, the iPXE firmware that runs on the instance is // configured to run an iPXE script to continue the boot process. // If you want more control over the boot process, you can provide // your own custom iPXE script that will run when the instance boots; // however, you should be aware that the same iPXE script will run // every time an instance boots; not only after the initial // LaunchInstance call. // The default iPXE script connects to the instance's local boot // volume over iSCSI and performs a network boot. If you use a custom iPXE // script and want to network-boot from the instance's local boot volume // over iSCSI the same way as the default iPXE script, you should use the // following iSCSI IP address: 169.254.0.2, and boot volume IQN: // iqn.2015-02.oracle.boot. // For more information about the Bring Your Own Image feature of // Oracle Cloud Infrastructure, see // Bring Your Own Image (https://docs.cloud.oracle.com/Content/Compute/References/bringyourownimage.htm). // For more information about iPXE, see http://ipxe.org. IpxeScript *string `mandatory:"false" json:"ipxeScript"` LaunchOptions *LaunchOptions `mandatory:"false" json:"launchOptions"` // Custom metadata key/value pairs that you provide, such as the SSH public key // required to connect to the instance. // A metadata service runs on every launched instance. The service is an HTTP // endpoint listening on 169.254.169.254. You can use the service to: // * Provide information to Cloud-Init (https://cloudinit.readthedocs.org/en/latest/) // to be used for various system initialization tasks. // * Get information about the instance, including the custom metadata that you // provide when you launch the instance. // **Providing Cloud-Init Metadata** // You can use the following metadata key names to provide information to // Cloud-Init: // **"ssh_authorized_keys"** - Provide one or more public SSH keys to be // included in the `~/.ssh/authorized_keys` file for the default user on the // instance. Use a newline character to separate multiple keys. The SSH // keys must be in the format necessary for the `authorized_keys` file, as shown // in the example below. // **"user_data"** - Provide your own base64-encoded data to be used by // Cloud-Init to run custom scripts or provide custom Cloud-Init configuration. For // information about how to take advantage of user data, see the // Cloud-Init Documentation (http://cloudinit.readthedocs.org/en/latest/topics/format.html). // **Note:** Cloud-Init does not pull this data from the `http://169.254.169.254/opc/v1/instance/metadata/` // path. When the instance launches and either of these keys are provided, the key values are formatted as // OpenStack metadata and copied to the following locations, which are recognized by Cloud-Init: // `http://169.254.169.254/openstack/latest/meta_data.json` - This JSON blob // contains, among other things, the SSH keys that you provided for // **"ssh_authorized_keys"**. // `http://169.254.169.254/openstack/latest/user_data` - Contains the // base64-decoded data that you provided for **"user_data"**. // **Metadata Example** // "metadata" : { // "quake_bot_level" : "Severe", // "ssh_authorized_keys" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCZ06fccNTQfq+xubFlJ5ZR3kt+uzspdH9tXL+lAejSM1NXM+CFZev7MIxfEjas06y80ZBZ7DUTQO0GxJPeD8NCOb1VorF8M4xuLwrmzRtkoZzU16umt4y1W0Q4ifdp3IiiU0U8/WxczSXcUVZOLqkz5dc6oMHdMVpkimietWzGZ4LBBsH/LjEVY7E0V+a0sNchlVDIZcm7ErReBLcdTGDq0uLBiuChyl6RUkX1PNhusquTGwK7zc8OBXkRuubn5UKXhI3Ul9Nyk4XESkVWIGNKmw8mSpoJSjR8P9ZjRmcZVo8S+x4KVPMZKQEor== ryan.smith@company.com // ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAzJSAtwEPoB3Jmr58IXrDGzLuDYkWAYg8AsLYlo6JZvKpjY1xednIcfEVQJm4T2DhVmdWhRrwQ8DmayVZvBkLt+zs2LdoAJEVimKwXcJFD/7wtH8Lnk17HiglbbbNXsemjDY0hea4JUE5CfvkIdZBITuMrfqSmA4n3VNoorXYdvtTMoGG8fxMub46RPtuxtqi9bG9Zqenordkg5FJt2mVNfQRqf83CWojcOkklUWq4CjyxaeLf5i9gv1fRoBo4QhiA8I6NCSppO8GnoV/6Ox6TNoh9BiifqGKC9VGYuC89RvUajRBTZSK2TK4DPfaT+2R+slPsFrwiT/oPEhhEK1S5Q== rsa-key-20160227", // "user_data" : "SWYgeW91IGNhbiBzZWUgdGhpcywgdGhlbiBpdCB3b3JrZWQgbWF5YmUuCg==" // } // **Getting Metadata on the Instance** // To get information about your instance, connect to the instance using SSH and issue any of the // following GET requests: // curl http://169.254.169.254/opc/v1/instance/ // curl http://169.254.169.254/opc/v1/instance/metadata/ // curl http://169.254.169.254/opc/v1/instance/metadata/<any-key-name> // You'll get back a response that includes all the instance information; only the metadata information; or // the metadata information for the specified key name, respectively. Metadata map[string]string `mandatory:"false" json:"metadata"` AgentConfig *LaunchInstanceAgentConfigDetails `mandatory:"false" json:"agentConfig"` ShapeConfig *LaunchInstanceShapeConfigDetails `mandatory:"false" json:"shapeConfig"` // Details for creating an instance. // Use this parameter to specify whether a boot volume or an image should be used to launch a new instance. SourceDetails InstanceSourceDetails `mandatory:"false" json:"sourceDetails"` // Deprecated. Instead use `subnetId` in // CreateVnicDetails. // At least one of them is required; if you provide both, the values must match. SubnetId *string `mandatory:"false" json:"subnetId"` // Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` } func (m LaunchInstanceDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *LaunchInstanceDetails) UnmarshalJSON(data []byte) (e error) { model := struct { CreateVnicDetails *CreateVnicDetails `json:"createVnicDetails"` DedicatedVmHostId *string `json:"dedicatedVmHostId"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` ExtendedMetadata map[string]interface{} `json:"extendedMetadata"` FaultDomain *string `json:"faultDomain"` FreeformTags map[string]string `json:"freeformTags"` HostnameLabel *string `json:"hostnameLabel"` ImageId *string `json:"imageId"` IpxeScript *string `json:"ipxeScript"` LaunchOptions *LaunchOptions `json:"launchOptions"` Metadata map[string]string `json:"metadata"` AgentConfig *LaunchInstanceAgentConfigDetails `json:"agentConfig"` ShapeConfig *LaunchInstanceShapeConfigDetails `json:"shapeConfig"` SourceDetails instancesourcedetails `json:"sourceDetails"` SubnetId *string `json:"subnetId"` IsPvEncryptionInTransitEnabled *bool `json:"isPvEncryptionInTransitEnabled"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` Shape *string `json:"shape"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.CreateVnicDetails = model.CreateVnicDetails m.DedicatedVmHostId = model.DedicatedVmHostId m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.ExtendedMetadata = model.ExtendedMetadata m.FaultDomain = model.FaultDomain m.FreeformTags = model.FreeformTags m.HostnameLabel = model.HostnameLabel m.ImageId = model.ImageId m.IpxeScript = model.IpxeScript m.LaunchOptions = model.LaunchOptions m.Metadata = model.Metadata m.AgentConfig = model.AgentConfig m.ShapeConfig = model.ShapeConfig nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(InstanceSourceDetails) } else { m.SourceDetails = nil } m.SubnetId = model.SubnetId m.IsPvEncryptionInTransitEnabled = model.IsPvEncryptionInTransitEnabled m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.Shape = model.Shape return } ���������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_request_response.go�������0000664�0000000�0000000�00000006151�13771713062�0032326�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // LaunchInstanceRequest wrapper for the LaunchInstance operation type LaunchInstanceRequest struct { // Instance details LaunchInstanceDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request LaunchInstanceRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request LaunchInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request LaunchInstanceRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // LaunchInstanceResponse wrapper for the LaunchInstance operation type LaunchInstanceResponse struct { // The underlying http response RawResponse *http.Response // The Instance instance Instance `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response LaunchInstanceResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response LaunchInstanceResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/launch_instance_shape_config_details.go���0000664�0000000�0000000�00000003144�13771713062�0033051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // LaunchInstanceShapeConfigDetails The shape configuration requested for the instance. If provided, the instance will be created // with the resources specified. In the case where some properties are missing or // the entire parameter is not provided, the instance will be created with the default // configuration values for the provided `shape`. // Each shape only supports certain configurable values. If the values provided are invalid for the // provided `shape`, an error will be returned. type LaunchInstanceShapeConfigDetails struct { // The total number of OCPUs available to the instance. Ocpus *float32 `mandatory:"false" json:"ocpus"` } func (m LaunchInstanceShapeConfigDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/launch_options.go�������������������������0000664�0000000�0000000�00000020147�13771713062�0026530�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // LaunchOptions Options for tuning compatibility and performance of VM shapes. type LaunchOptions struct { // Emulation type for volume. // * `ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block // Storage volumes on Oracle provided images. // * `SCSI` - Emulated SCSI disk. // * `IDE` - Emulated IDE disk. // * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data // volumes on Oracle provided images. // * `PARAVIRTUALIZED` - Paravirtualized disk. BootVolumeType LaunchOptionsBootVolumeTypeEnum `mandatory:"false" json:"bootVolumeType,omitempty"` // Firmware used to boot VM. Select the option that matches your operating system. // * `BIOS` - Boot VM using BIOS style firmware. This is compatible with both 32 bit and 64 bit operating // systems that boot using MBR style bootloaders. // * `UEFI_64` - Boot VM using UEFI style firmware compatible with 64 bit operating systems. This is the // default for Oracle provided images. Firmware LaunchOptionsFirmwareEnum `mandatory:"false" json:"firmware,omitempty"` // Emulation type for the physical network interface card (NIC). // * `E1000` - Emulated Gigabit ethernet controller. Compatible with Linux e1000 network driver. // * `VFIO` - Direct attached Virtual Function network controller. This is the networking type // when you launch an instance using hardware-assisted (SR-IOV) networking. // * `PARAVIRTUALIZED` - VM instances launch with paravirtualized devices using virtio drivers. NetworkType LaunchOptionsNetworkTypeEnum `mandatory:"false" json:"networkType,omitempty"` // Emulation type for volume. // * `ISCSI` - ISCSI attached block storage device. This is the default for Boot Volumes and Remote Block // Storage volumes on Oracle provided images. // * `SCSI` - Emulated SCSI disk. // * `IDE` - Emulated IDE disk. // * `VFIO` - Direct attached Virtual Function storage. This is the default option for Local data // volumes on Oracle provided images. // * `PARAVIRTUALIZED` - Paravirtualized disk. RemoteDataVolumeType LaunchOptionsRemoteDataVolumeTypeEnum `mandatory:"false" json:"remoteDataVolumeType,omitempty"` // Whether to enable in-transit encryption for the boot volume's paravirtualized attachment. The default value is false. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` // Whether to enable consistent volume naming feature. Defaults to false. IsConsistentVolumeNamingEnabled *bool `mandatory:"false" json:"isConsistentVolumeNamingEnabled"` } func (m LaunchOptions) String() string { return common.PointerString(m) } // LaunchOptionsBootVolumeTypeEnum Enum with underlying type: string type LaunchOptionsBootVolumeTypeEnum string // Set of constants representing the allowable values for LaunchOptionsBootVolumeTypeEnum const ( LaunchOptionsBootVolumeTypeIscsi LaunchOptionsBootVolumeTypeEnum = "ISCSI" LaunchOptionsBootVolumeTypeScsi LaunchOptionsBootVolumeTypeEnum = "SCSI" LaunchOptionsBootVolumeTypeIde LaunchOptionsBootVolumeTypeEnum = "IDE" LaunchOptionsBootVolumeTypeVfio LaunchOptionsBootVolumeTypeEnum = "VFIO" LaunchOptionsBootVolumeTypeParavirtualized LaunchOptionsBootVolumeTypeEnum = "PARAVIRTUALIZED" ) var mappingLaunchOptionsBootVolumeType = map[string]LaunchOptionsBootVolumeTypeEnum{ "ISCSI": LaunchOptionsBootVolumeTypeIscsi, "SCSI": LaunchOptionsBootVolumeTypeScsi, "IDE": LaunchOptionsBootVolumeTypeIde, "VFIO": LaunchOptionsBootVolumeTypeVfio, "PARAVIRTUALIZED": LaunchOptionsBootVolumeTypeParavirtualized, } // GetLaunchOptionsBootVolumeTypeEnumValues Enumerates the set of values for LaunchOptionsBootVolumeTypeEnum func GetLaunchOptionsBootVolumeTypeEnumValues() []LaunchOptionsBootVolumeTypeEnum { values := make([]LaunchOptionsBootVolumeTypeEnum, 0) for _, v := range mappingLaunchOptionsBootVolumeType { values = append(values, v) } return values } // LaunchOptionsFirmwareEnum Enum with underlying type: string type LaunchOptionsFirmwareEnum string // Set of constants representing the allowable values for LaunchOptionsFirmwareEnum const ( LaunchOptionsFirmwareBios LaunchOptionsFirmwareEnum = "BIOS" LaunchOptionsFirmwareUefi64 LaunchOptionsFirmwareEnum = "UEFI_64" ) var mappingLaunchOptionsFirmware = map[string]LaunchOptionsFirmwareEnum{ "BIOS": LaunchOptionsFirmwareBios, "UEFI_64": LaunchOptionsFirmwareUefi64, } // GetLaunchOptionsFirmwareEnumValues Enumerates the set of values for LaunchOptionsFirmwareEnum func GetLaunchOptionsFirmwareEnumValues() []LaunchOptionsFirmwareEnum { values := make([]LaunchOptionsFirmwareEnum, 0) for _, v := range mappingLaunchOptionsFirmware { values = append(values, v) } return values } // LaunchOptionsNetworkTypeEnum Enum with underlying type: string type LaunchOptionsNetworkTypeEnum string // Set of constants representing the allowable values for LaunchOptionsNetworkTypeEnum const ( LaunchOptionsNetworkTypeE1000 LaunchOptionsNetworkTypeEnum = "E1000" LaunchOptionsNetworkTypeVfio LaunchOptionsNetworkTypeEnum = "VFIO" LaunchOptionsNetworkTypeParavirtualized LaunchOptionsNetworkTypeEnum = "PARAVIRTUALIZED" ) var mappingLaunchOptionsNetworkType = map[string]LaunchOptionsNetworkTypeEnum{ "E1000": LaunchOptionsNetworkTypeE1000, "VFIO": LaunchOptionsNetworkTypeVfio, "PARAVIRTUALIZED": LaunchOptionsNetworkTypeParavirtualized, } // GetLaunchOptionsNetworkTypeEnumValues Enumerates the set of values for LaunchOptionsNetworkTypeEnum func GetLaunchOptionsNetworkTypeEnumValues() []LaunchOptionsNetworkTypeEnum { values := make([]LaunchOptionsNetworkTypeEnum, 0) for _, v := range mappingLaunchOptionsNetworkType { values = append(values, v) } return values } // LaunchOptionsRemoteDataVolumeTypeEnum Enum with underlying type: string type LaunchOptionsRemoteDataVolumeTypeEnum string // Set of constants representing the allowable values for LaunchOptionsRemoteDataVolumeTypeEnum const ( LaunchOptionsRemoteDataVolumeTypeIscsi LaunchOptionsRemoteDataVolumeTypeEnum = "ISCSI" LaunchOptionsRemoteDataVolumeTypeScsi LaunchOptionsRemoteDataVolumeTypeEnum = "SCSI" LaunchOptionsRemoteDataVolumeTypeIde LaunchOptionsRemoteDataVolumeTypeEnum = "IDE" LaunchOptionsRemoteDataVolumeTypeVfio LaunchOptionsRemoteDataVolumeTypeEnum = "VFIO" LaunchOptionsRemoteDataVolumeTypeParavirtualized LaunchOptionsRemoteDataVolumeTypeEnum = "PARAVIRTUALIZED" ) var mappingLaunchOptionsRemoteDataVolumeType = map[string]LaunchOptionsRemoteDataVolumeTypeEnum{ "ISCSI": LaunchOptionsRemoteDataVolumeTypeIscsi, "SCSI": LaunchOptionsRemoteDataVolumeTypeScsi, "IDE": LaunchOptionsRemoteDataVolumeTypeIde, "VFIO": LaunchOptionsRemoteDataVolumeTypeVfio, "PARAVIRTUALIZED": LaunchOptionsRemoteDataVolumeTypeParavirtualized, } // GetLaunchOptionsRemoteDataVolumeTypeEnumValues Enumerates the set of values for LaunchOptionsRemoteDataVolumeTypeEnum func GetLaunchOptionsRemoteDataVolumeTypeEnumValues() []LaunchOptionsRemoteDataVolumeTypeEnum { values := make([]LaunchOptionsRemoteDataVolumeTypeEnum, 0) for _, v := range mappingLaunchOptionsRemoteDataVolumeType { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/letter_of_authority.go��������������������0000664�0000000�0000000�00000006056�13771713062�0027601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // LetterOfAuthority The Letter of Authority for the cross-connect. You must submit this letter when // requesting cabling for the cross-connect at the FastConnect location. type LetterOfAuthority struct { // The name of the entity authorized by this Letter of Authority. AuthorizedEntityName *string `mandatory:"false" json:"authorizedEntityName"` // The type of cross-connect fiber, termination, and optical specification. CircuitType LetterOfAuthorityCircuitTypeEnum `mandatory:"false" json:"circuitType,omitempty"` // The OCID of the cross-connect. CrossConnectId *string `mandatory:"false" json:"crossConnectId"` // The address of the FastConnect location. FacilityLocation *string `mandatory:"false" json:"facilityLocation"` // The meet-me room port for this cross-connect. PortName *string `mandatory:"false" json:"portName"` // The date and time when the Letter of Authority expires, in the format defined by RFC3339. TimeExpires *common.SDKTime `mandatory:"false" json:"timeExpires"` // The date and time the Letter of Authority was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeIssued *common.SDKTime `mandatory:"false" json:"timeIssued"` } func (m LetterOfAuthority) String() string { return common.PointerString(m) } // LetterOfAuthorityCircuitTypeEnum Enum with underlying type: string type LetterOfAuthorityCircuitTypeEnum string // Set of constants representing the allowable values for LetterOfAuthorityCircuitTypeEnum const ( LetterOfAuthorityCircuitTypeLc LetterOfAuthorityCircuitTypeEnum = "Single_mode_LC" LetterOfAuthorityCircuitTypeSc LetterOfAuthorityCircuitTypeEnum = "Single_mode_SC" ) var mappingLetterOfAuthorityCircuitType = map[string]LetterOfAuthorityCircuitTypeEnum{ "Single_mode_LC": LetterOfAuthorityCircuitTypeLc, "Single_mode_SC": LetterOfAuthorityCircuitTypeSc, } // GetLetterOfAuthorityCircuitTypeEnumValues Enumerates the set of values for LetterOfAuthorityCircuitTypeEnum func GetLetterOfAuthorityCircuitTypeEnumValues() []LetterOfAuthorityCircuitTypeEnum { values := make([]LetterOfAuthorityCircuitTypeEnum, 0) for _, v := range mappingLetterOfAuthorityCircuitType { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_allowed_peer_regions_for_remote_peering_request_response.go������������������������������������0000664�0000000�0000000�00000004761�13771713062�0040273�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListAllowedPeerRegionsForRemotePeeringRequest wrapper for the ListAllowedPeerRegionsForRemotePeering operation type ListAllowedPeerRegionsForRemotePeeringRequest struct { // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListAllowedPeerRegionsForRemotePeeringRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListAllowedPeerRegionsForRemotePeeringRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListAllowedPeerRegionsForRemotePeeringRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListAllowedPeerRegionsForRemotePeeringResponse wrapper for the ListAllowedPeerRegionsForRemotePeering operation type ListAllowedPeerRegionsForRemotePeeringResponse struct { // The underlying http response RawResponse *http.Response // The []PeerRegionForRemotePeering instance Items []PeerRegionForRemotePeering `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListAllowedPeerRegionsForRemotePeeringResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListAllowedPeerRegionsForRemotePeeringResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������list_app_catalog_listing_resource_versions_request_response.go��������������������������������������0000664�0000000�0000000�00000012207�13771713062�0040005�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListAppCatalogListingResourceVersionsRequest wrapper for the ListAppCatalogListingResourceVersions operation type ListAppCatalogListingResourceVersionsRequest struct { // The OCID of the listing. ListingId *string `mandatory:"true" contributesTo:"path" name:"listingId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListAppCatalogListingResourceVersionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListAppCatalogListingResourceVersionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListAppCatalogListingResourceVersionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListAppCatalogListingResourceVersionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListAppCatalogListingResourceVersionsResponse wrapper for the ListAppCatalogListingResourceVersions operation type ListAppCatalogListingResourceVersionsResponse struct { // The underlying http response RawResponse *http.Response // A list of []AppCatalogListingResourceVersionSummary instances Items []AppCatalogListingResourceVersionSummary `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListAppCatalogListingResourceVersionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListAppCatalogListingResourceVersionsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListAppCatalogListingResourceVersionsSortOrderEnum Enum with underlying type: string type ListAppCatalogListingResourceVersionsSortOrderEnum string // Set of constants representing the allowable values for ListAppCatalogListingResourceVersionsSortOrderEnum const ( ListAppCatalogListingResourceVersionsSortOrderAsc ListAppCatalogListingResourceVersionsSortOrderEnum = "ASC" ListAppCatalogListingResourceVersionsSortOrderDesc ListAppCatalogListingResourceVersionsSortOrderEnum = "DESC" ) var mappingListAppCatalogListingResourceVersionsSortOrder = map[string]ListAppCatalogListingResourceVersionsSortOrderEnum{ "ASC": ListAppCatalogListingResourceVersionsSortOrderAsc, "DESC": ListAppCatalogListingResourceVersionsSortOrderDesc, } // GetListAppCatalogListingResourceVersionsSortOrderEnumValues Enumerates the set of values for ListAppCatalogListingResourceVersionsSortOrderEnum func GetListAppCatalogListingResourceVersionsSortOrderEnumValues() []ListAppCatalogListingResourceVersionsSortOrderEnum { values := make([]ListAppCatalogListingResourceVersionsSortOrderEnum, 0) for _, v := range mappingListAppCatalogListingResourceVersionsSortOrder { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_app_catalog_listings_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000012023�13771713062�0034325�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListAppCatalogListingsRequest wrapper for the ListAppCatalogListings operation type ListAppCatalogListingsRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListAppCatalogListingsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only the publisher that matches the given publisher name exactly. PublisherName *string `mandatory:"false" contributesTo:"query" name:"publisherName"` // A filter to return only publishers that match the given publisher type exactly. Valid types are OCI, ORACLE, TRUSTED, STANDARD. PublisherType *string `mandatory:"false" contributesTo:"query" name:"publisherType"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListAppCatalogListingsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListAppCatalogListingsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListAppCatalogListingsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListAppCatalogListingsResponse wrapper for the ListAppCatalogListings operation type ListAppCatalogListingsResponse struct { // The underlying http response RawResponse *http.Response // A list of []AppCatalogListingSummary instances Items []AppCatalogListingSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListAppCatalogListingsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListAppCatalogListingsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListAppCatalogListingsSortOrderEnum Enum with underlying type: string type ListAppCatalogListingsSortOrderEnum string // Set of constants representing the allowable values for ListAppCatalogListingsSortOrderEnum const ( ListAppCatalogListingsSortOrderAsc ListAppCatalogListingsSortOrderEnum = "ASC" ListAppCatalogListingsSortOrderDesc ListAppCatalogListingsSortOrderEnum = "DESC" ) var mappingListAppCatalogListingsSortOrder = map[string]ListAppCatalogListingsSortOrderEnum{ "ASC": ListAppCatalogListingsSortOrderAsc, "DESC": ListAppCatalogListingsSortOrderDesc, } // GetListAppCatalogListingsSortOrderEnumValues Enumerates the set of values for ListAppCatalogListingsSortOrderEnum func GetListAppCatalogListingsSortOrderEnumValues() []ListAppCatalogListingsSortOrderEnum { values := make([]ListAppCatalogListingsSortOrderEnum, 0) for _, v := range mappingListAppCatalogListingsSortOrder { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_app_catalog_subscriptions_request_response.go��������������������������������������������������0000664�0000000�0000000�00000015253�13771713062�0035410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListAppCatalogSubscriptionsRequest wrapper for the ListAppCatalogSubscriptions operation type ListAppCatalogSubscriptionsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListAppCatalogSubscriptionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListAppCatalogSubscriptionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only the listings that matches the given listing id. ListingId *string `mandatory:"false" contributesTo:"query" name:"listingId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListAppCatalogSubscriptionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListAppCatalogSubscriptionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListAppCatalogSubscriptionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListAppCatalogSubscriptionsResponse wrapper for the ListAppCatalogSubscriptions operation type ListAppCatalogSubscriptionsResponse struct { // The underlying http response RawResponse *http.Response // A list of []AppCatalogSubscriptionSummary instances Items []AppCatalogSubscriptionSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListAppCatalogSubscriptionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListAppCatalogSubscriptionsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListAppCatalogSubscriptionsSortByEnum Enum with underlying type: string type ListAppCatalogSubscriptionsSortByEnum string // Set of constants representing the allowable values for ListAppCatalogSubscriptionsSortByEnum const ( ListAppCatalogSubscriptionsSortByTimecreated ListAppCatalogSubscriptionsSortByEnum = "TIMECREATED" ListAppCatalogSubscriptionsSortByDisplayname ListAppCatalogSubscriptionsSortByEnum = "DISPLAYNAME" ) var mappingListAppCatalogSubscriptionsSortBy = map[string]ListAppCatalogSubscriptionsSortByEnum{ "TIMECREATED": ListAppCatalogSubscriptionsSortByTimecreated, "DISPLAYNAME": ListAppCatalogSubscriptionsSortByDisplayname, } // GetListAppCatalogSubscriptionsSortByEnumValues Enumerates the set of values for ListAppCatalogSubscriptionsSortByEnum func GetListAppCatalogSubscriptionsSortByEnumValues() []ListAppCatalogSubscriptionsSortByEnum { values := make([]ListAppCatalogSubscriptionsSortByEnum, 0) for _, v := range mappingListAppCatalogSubscriptionsSortBy { values = append(values, v) } return values } // ListAppCatalogSubscriptionsSortOrderEnum Enum with underlying type: string type ListAppCatalogSubscriptionsSortOrderEnum string // Set of constants representing the allowable values for ListAppCatalogSubscriptionsSortOrderEnum const ( ListAppCatalogSubscriptionsSortOrderAsc ListAppCatalogSubscriptionsSortOrderEnum = "ASC" ListAppCatalogSubscriptionsSortOrderDesc ListAppCatalogSubscriptionsSortOrderEnum = "DESC" ) var mappingListAppCatalogSubscriptionsSortOrder = map[string]ListAppCatalogSubscriptionsSortOrderEnum{ "ASC": ListAppCatalogSubscriptionsSortOrderAsc, "DESC": ListAppCatalogSubscriptionsSortOrderDesc, } // GetListAppCatalogSubscriptionsSortOrderEnumValues Enumerates the set of values for ListAppCatalogSubscriptionsSortOrderEnum func GetListAppCatalogSubscriptionsSortOrderEnumValues() []ListAppCatalogSubscriptionsSortOrderEnum { values := make([]ListAppCatalogSubscriptionsSortOrderEnum, 0) for _, v := range mappingListAppCatalogSubscriptionsSortOrder { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_boot_volume_attachments_request_response.go����������������������������������������������������0000664�0000000�0000000�00000007624�13771713062�0035077�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListBootVolumeAttachmentsRequest wrapper for the ListBootVolumeAttachments operation type ListBootVolumeAttachmentsRequest struct { // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the instance. InstanceId *string `mandatory:"false" contributesTo:"query" name:"instanceId"` // The OCID of the boot volume. BootVolumeId *string `mandatory:"false" contributesTo:"query" name:"bootVolumeId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListBootVolumeAttachmentsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListBootVolumeAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListBootVolumeAttachmentsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListBootVolumeAttachmentsResponse wrapper for the ListBootVolumeAttachments operation type ListBootVolumeAttachmentsResponse struct { // The underlying http response RawResponse *http.Response // A list of []BootVolumeAttachment instances Items []BootVolumeAttachment `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListBootVolumeAttachmentsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListBootVolumeAttachmentsResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������list_boot_volume_backups_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000015672�13771713062�0034216�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListBootVolumeBackupsRequest wrapper for the ListBootVolumeBackups operation type ListBootVolumeBackupsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the boot volume. BootVolumeId *string `mandatory:"false" contributesTo:"query" name:"bootVolumeId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // A filter to return only resources that originated from the given source boot volume backup. SourceBootVolumeBackupId *string `mandatory:"false" contributesTo:"query" name:"sourceBootVolumeBackupId"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListBootVolumeBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListBootVolumeBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState BootVolumeBackupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListBootVolumeBackupsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListBootVolumeBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListBootVolumeBackupsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListBootVolumeBackupsResponse wrapper for the ListBootVolumeBackups operation type ListBootVolumeBackupsResponse struct { // The underlying http response RawResponse *http.Response // A list of []BootVolumeBackup instances Items []BootVolumeBackup `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListBootVolumeBackupsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListBootVolumeBackupsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListBootVolumeBackupsSortByEnum Enum with underlying type: string type ListBootVolumeBackupsSortByEnum string // Set of constants representing the allowable values for ListBootVolumeBackupsSortByEnum const ( ListBootVolumeBackupsSortByTimecreated ListBootVolumeBackupsSortByEnum = "TIMECREATED" ListBootVolumeBackupsSortByDisplayname ListBootVolumeBackupsSortByEnum = "DISPLAYNAME" ) var mappingListBootVolumeBackupsSortBy = map[string]ListBootVolumeBackupsSortByEnum{ "TIMECREATED": ListBootVolumeBackupsSortByTimecreated, "DISPLAYNAME": ListBootVolumeBackupsSortByDisplayname, } // GetListBootVolumeBackupsSortByEnumValues Enumerates the set of values for ListBootVolumeBackupsSortByEnum func GetListBootVolumeBackupsSortByEnumValues() []ListBootVolumeBackupsSortByEnum { values := make([]ListBootVolumeBackupsSortByEnum, 0) for _, v := range mappingListBootVolumeBackupsSortBy { values = append(values, v) } return values } // ListBootVolumeBackupsSortOrderEnum Enum with underlying type: string type ListBootVolumeBackupsSortOrderEnum string // Set of constants representing the allowable values for ListBootVolumeBackupsSortOrderEnum const ( ListBootVolumeBackupsSortOrderAsc ListBootVolumeBackupsSortOrderEnum = "ASC" ListBootVolumeBackupsSortOrderDesc ListBootVolumeBackupsSortOrderEnum = "DESC" ) var mappingListBootVolumeBackupsSortOrder = map[string]ListBootVolumeBackupsSortOrderEnum{ "ASC": ListBootVolumeBackupsSortOrderAsc, "DESC": ListBootVolumeBackupsSortOrderDesc, } // GetListBootVolumeBackupsSortOrderEnumValues Enumerates the set of values for ListBootVolumeBackupsSortOrderEnum func GetListBootVolumeBackupsSortOrderEnumValues() []ListBootVolumeBackupsSortOrderEnum { values := make([]ListBootVolumeBackupsSortOrderEnum, 0) for _, v := range mappingListBootVolumeBackupsSortOrder { values = append(values, v) } return values } ����������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_boot_volumes_request_response.go�����0000664�0000000�0000000�00000007246�13771713062�0032746�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListBootVolumesRequest wrapper for the ListBootVolumes operation type ListBootVolumesRequest struct { // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" contributesTo:"query" name:"availabilityDomain"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the volume group. VolumeGroupId *string `mandatory:"false" contributesTo:"query" name:"volumeGroupId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListBootVolumesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListBootVolumesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListBootVolumesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListBootVolumesResponse wrapper for the ListBootVolumes operation type ListBootVolumesResponse struct { // The underlying http response RawResponse *http.Response // A list of []BootVolume instances Items []BootVolume `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListBootVolumesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListBootVolumesResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_cluster_network_instances_request_response.go��������������������������������������������������0000664�0000000�0000000�00000015546�13771713062�0035455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListClusterNetworkInstancesRequest wrapper for the ListClusterNetworkInstances operation type ListClusterNetworkInstancesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. ClusterNetworkId *string `mandatory:"true" contributesTo:"path" name:"clusterNetworkId"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListClusterNetworkInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListClusterNetworkInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListClusterNetworkInstancesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListClusterNetworkInstancesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListClusterNetworkInstancesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListClusterNetworkInstancesResponse wrapper for the ListClusterNetworkInstances operation type ListClusterNetworkInstancesResponse struct { // The underlying http response RawResponse *http.Response // A list of []InstanceSummary instances Items []InstanceSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListClusterNetworkInstancesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListClusterNetworkInstancesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListClusterNetworkInstancesSortByEnum Enum with underlying type: string type ListClusterNetworkInstancesSortByEnum string // Set of constants representing the allowable values for ListClusterNetworkInstancesSortByEnum const ( ListClusterNetworkInstancesSortByTimecreated ListClusterNetworkInstancesSortByEnum = "TIMECREATED" ListClusterNetworkInstancesSortByDisplayname ListClusterNetworkInstancesSortByEnum = "DISPLAYNAME" ) var mappingListClusterNetworkInstancesSortBy = map[string]ListClusterNetworkInstancesSortByEnum{ "TIMECREATED": ListClusterNetworkInstancesSortByTimecreated, "DISPLAYNAME": ListClusterNetworkInstancesSortByDisplayname, } // GetListClusterNetworkInstancesSortByEnumValues Enumerates the set of values for ListClusterNetworkInstancesSortByEnum func GetListClusterNetworkInstancesSortByEnumValues() []ListClusterNetworkInstancesSortByEnum { values := make([]ListClusterNetworkInstancesSortByEnum, 0) for _, v := range mappingListClusterNetworkInstancesSortBy { values = append(values, v) } return values } // ListClusterNetworkInstancesSortOrderEnum Enum with underlying type: string type ListClusterNetworkInstancesSortOrderEnum string // Set of constants representing the allowable values for ListClusterNetworkInstancesSortOrderEnum const ( ListClusterNetworkInstancesSortOrderAsc ListClusterNetworkInstancesSortOrderEnum = "ASC" ListClusterNetworkInstancesSortOrderDesc ListClusterNetworkInstancesSortOrderEnum = "DESC" ) var mappingListClusterNetworkInstancesSortOrder = map[string]ListClusterNetworkInstancesSortOrderEnum{ "ASC": ListClusterNetworkInstancesSortOrderAsc, "DESC": ListClusterNetworkInstancesSortOrderDesc, } // GetListClusterNetworkInstancesSortOrderEnumValues Enumerates the set of values for ListClusterNetworkInstancesSortOrderEnum func GetListClusterNetworkInstancesSortOrderEnumValues() []ListClusterNetworkInstancesSortOrderEnum { values := make([]ListClusterNetworkInstancesSortOrderEnum, 0) for _, v := range mappingListClusterNetworkInstancesSortOrder { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_cluster_networks_request_response.go�0000664�0000000�0000000�00000015053�13771713062�0033641�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListClusterNetworksRequest wrapper for the ListClusterNetworks operation type ListClusterNetworksRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListClusterNetworksSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListClusterNetworksSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle // state. The state value is case-insensitive. LifecycleState ClusterNetworkSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListClusterNetworksRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListClusterNetworksRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListClusterNetworksRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListClusterNetworksResponse wrapper for the ListClusterNetworks operation type ListClusterNetworksResponse struct { // The underlying http response RawResponse *http.Response // A list of []ClusterNetworkSummary instances Items []ClusterNetworkSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListClusterNetworksResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListClusterNetworksResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListClusterNetworksSortByEnum Enum with underlying type: string type ListClusterNetworksSortByEnum string // Set of constants representing the allowable values for ListClusterNetworksSortByEnum const ( ListClusterNetworksSortByTimecreated ListClusterNetworksSortByEnum = "TIMECREATED" ListClusterNetworksSortByDisplayname ListClusterNetworksSortByEnum = "DISPLAYNAME" ) var mappingListClusterNetworksSortBy = map[string]ListClusterNetworksSortByEnum{ "TIMECREATED": ListClusterNetworksSortByTimecreated, "DISPLAYNAME": ListClusterNetworksSortByDisplayname, } // GetListClusterNetworksSortByEnumValues Enumerates the set of values for ListClusterNetworksSortByEnum func GetListClusterNetworksSortByEnumValues() []ListClusterNetworksSortByEnum { values := make([]ListClusterNetworksSortByEnum, 0) for _, v := range mappingListClusterNetworksSortBy { values = append(values, v) } return values } // ListClusterNetworksSortOrderEnum Enum with underlying type: string type ListClusterNetworksSortOrderEnum string // Set of constants representing the allowable values for ListClusterNetworksSortOrderEnum const ( ListClusterNetworksSortOrderAsc ListClusterNetworksSortOrderEnum = "ASC" ListClusterNetworksSortOrderDesc ListClusterNetworksSortOrderEnum = "DESC" ) var mappingListClusterNetworksSortOrder = map[string]ListClusterNetworksSortOrderEnum{ "ASC": ListClusterNetworksSortOrderAsc, "DESC": ListClusterNetworksSortOrderDesc, } // GetListClusterNetworksSortOrderEnumValues Enumerates the set of values for ListClusterNetworksSortOrderEnum func GetListClusterNetworksSortOrderEnumValues() []ListClusterNetworksSortOrderEnum { values := make([]ListClusterNetworksSortOrderEnum, 0) for _, v := range mappingListClusterNetworksSortOrder { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_console_histories_request_response.go0000664�0000000�0000000�00000015264�13771713062�0033763�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListConsoleHistoriesRequest wrapper for the ListConsoleHistories operation type ListConsoleHistoriesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the instance. InstanceId *string `mandatory:"false" contributesTo:"query" name:"instanceId"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListConsoleHistoriesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListConsoleHistoriesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState ConsoleHistoryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListConsoleHistoriesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListConsoleHistoriesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListConsoleHistoriesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListConsoleHistoriesResponse wrapper for the ListConsoleHistories operation type ListConsoleHistoriesResponse struct { // The underlying http response RawResponse *http.Response // A list of []ConsoleHistory instances Items []ConsoleHistory `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListConsoleHistoriesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListConsoleHistoriesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListConsoleHistoriesSortByEnum Enum with underlying type: string type ListConsoleHistoriesSortByEnum string // Set of constants representing the allowable values for ListConsoleHistoriesSortByEnum const ( ListConsoleHistoriesSortByTimecreated ListConsoleHistoriesSortByEnum = "TIMECREATED" ListConsoleHistoriesSortByDisplayname ListConsoleHistoriesSortByEnum = "DISPLAYNAME" ) var mappingListConsoleHistoriesSortBy = map[string]ListConsoleHistoriesSortByEnum{ "TIMECREATED": ListConsoleHistoriesSortByTimecreated, "DISPLAYNAME": ListConsoleHistoriesSortByDisplayname, } // GetListConsoleHistoriesSortByEnumValues Enumerates the set of values for ListConsoleHistoriesSortByEnum func GetListConsoleHistoriesSortByEnumValues() []ListConsoleHistoriesSortByEnum { values := make([]ListConsoleHistoriesSortByEnum, 0) for _, v := range mappingListConsoleHistoriesSortBy { values = append(values, v) } return values } // ListConsoleHistoriesSortOrderEnum Enum with underlying type: string type ListConsoleHistoriesSortOrderEnum string // Set of constants representing the allowable values for ListConsoleHistoriesSortOrderEnum const ( ListConsoleHistoriesSortOrderAsc ListConsoleHistoriesSortOrderEnum = "ASC" ListConsoleHistoriesSortOrderDesc ListConsoleHistoriesSortOrderEnum = "DESC" ) var mappingListConsoleHistoriesSortOrder = map[string]ListConsoleHistoriesSortOrderEnum{ "ASC": ListConsoleHistoriesSortOrderAsc, "DESC": ListConsoleHistoriesSortOrderDesc, } // GetListConsoleHistoriesSortOrderEnumValues Enumerates the set of values for ListConsoleHistoriesSortOrderEnum func GetListConsoleHistoriesSortOrderEnumValues() []ListConsoleHistoriesSortOrderEnum { values := make([]ListConsoleHistoriesSortOrderEnum, 0) for _, v := range mappingListConsoleHistoriesSortOrder { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_cpe_device_shapes_request_response.go0000664�0000000�0000000�00000006371�13771713062�0033660�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListCpeDeviceShapesRequest wrapper for the ListCpeDeviceShapes operation type ListCpeDeviceShapesRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListCpeDeviceShapesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListCpeDeviceShapesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListCpeDeviceShapesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListCpeDeviceShapesResponse wrapper for the ListCpeDeviceShapes operation type ListCpeDeviceShapesResponse struct { // The underlying http response RawResponse *http.Response // A list of []CpeDeviceShapeSummary instances Items []CpeDeviceShapeSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListCpeDeviceShapesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListCpeDeviceShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_cpes_request_response.go�������������0000664�0000000�0000000�00000006454�13771713062�0031163�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListCpesRequest wrapper for the ListCpes operation type ListCpesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListCpesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListCpesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListCpesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListCpesResponse wrapper for the ListCpes operation type ListCpesResponse struct { // The underlying http response RawResponse *http.Response // A list of []Cpe instances Items []Cpe `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListCpesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListCpesResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_cross_connect_groups_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000015246�13771713062�0034412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListCrossConnectGroupsRequest wrapper for the ListCrossConnectGroups operation type ListCrossConnectGroupsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListCrossConnectGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListCrossConnectGroupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState CrossConnectGroupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListCrossConnectGroupsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListCrossConnectGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListCrossConnectGroupsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListCrossConnectGroupsResponse wrapper for the ListCrossConnectGroups operation type ListCrossConnectGroupsResponse struct { // The underlying http response RawResponse *http.Response // A list of []CrossConnectGroup instances Items []CrossConnectGroup `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListCrossConnectGroupsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListCrossConnectGroupsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListCrossConnectGroupsSortByEnum Enum with underlying type: string type ListCrossConnectGroupsSortByEnum string // Set of constants representing the allowable values for ListCrossConnectGroupsSortByEnum const ( ListCrossConnectGroupsSortByTimecreated ListCrossConnectGroupsSortByEnum = "TIMECREATED" ListCrossConnectGroupsSortByDisplayname ListCrossConnectGroupsSortByEnum = "DISPLAYNAME" ) var mappingListCrossConnectGroupsSortBy = map[string]ListCrossConnectGroupsSortByEnum{ "TIMECREATED": ListCrossConnectGroupsSortByTimecreated, "DISPLAYNAME": ListCrossConnectGroupsSortByDisplayname, } // GetListCrossConnectGroupsSortByEnumValues Enumerates the set of values for ListCrossConnectGroupsSortByEnum func GetListCrossConnectGroupsSortByEnumValues() []ListCrossConnectGroupsSortByEnum { values := make([]ListCrossConnectGroupsSortByEnum, 0) for _, v := range mappingListCrossConnectGroupsSortBy { values = append(values, v) } return values } // ListCrossConnectGroupsSortOrderEnum Enum with underlying type: string type ListCrossConnectGroupsSortOrderEnum string // Set of constants representing the allowable values for ListCrossConnectGroupsSortOrderEnum const ( ListCrossConnectGroupsSortOrderAsc ListCrossConnectGroupsSortOrderEnum = "ASC" ListCrossConnectGroupsSortOrderDesc ListCrossConnectGroupsSortOrderEnum = "DESC" ) var mappingListCrossConnectGroupsSortOrder = map[string]ListCrossConnectGroupsSortOrderEnum{ "ASC": ListCrossConnectGroupsSortOrderAsc, "DESC": ListCrossConnectGroupsSortOrderDesc, } // GetListCrossConnectGroupsSortOrderEnumValues Enumerates the set of values for ListCrossConnectGroupsSortOrderEnum func GetListCrossConnectGroupsSortOrderEnumValues() []ListCrossConnectGroupsSortOrderEnum { values := make([]ListCrossConnectGroupsSortOrderEnum, 0) for _, v := range mappingListCrossConnectGroupsSortOrder { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_cross_connect_locations_request_response.go����������������������������������������������������0000664�0000000�0000000�00000007011�13771713062�0035055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListCrossConnectLocationsRequest wrapper for the ListCrossConnectLocations operation type ListCrossConnectLocationsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListCrossConnectLocationsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListCrossConnectLocationsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListCrossConnectLocationsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListCrossConnectLocationsResponse wrapper for the ListCrossConnectLocations operation type ListCrossConnectLocationsResponse struct { // The underlying http response RawResponse *http.Response // A list of []CrossConnectLocation instances Items []CrossConnectLocation `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListCrossConnectLocationsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListCrossConnectLocationsResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_cross_connects_request_response.go���0000664�0000000�0000000�00000015070�13771713062�0033250�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListCrossConnectsRequest wrapper for the ListCrossConnects operation type ListCrossConnectsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the cross-connect group. CrossConnectGroupId *string `mandatory:"false" contributesTo:"query" name:"crossConnectGroupId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListCrossConnectsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListCrossConnectsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState CrossConnectLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListCrossConnectsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListCrossConnectsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListCrossConnectsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListCrossConnectsResponse wrapper for the ListCrossConnects operation type ListCrossConnectsResponse struct { // The underlying http response RawResponse *http.Response // A list of []CrossConnect instances Items []CrossConnect `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListCrossConnectsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListCrossConnectsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListCrossConnectsSortByEnum Enum with underlying type: string type ListCrossConnectsSortByEnum string // Set of constants representing the allowable values for ListCrossConnectsSortByEnum const ( ListCrossConnectsSortByTimecreated ListCrossConnectsSortByEnum = "TIMECREATED" ListCrossConnectsSortByDisplayname ListCrossConnectsSortByEnum = "DISPLAYNAME" ) var mappingListCrossConnectsSortBy = map[string]ListCrossConnectsSortByEnum{ "TIMECREATED": ListCrossConnectsSortByTimecreated, "DISPLAYNAME": ListCrossConnectsSortByDisplayname, } // GetListCrossConnectsSortByEnumValues Enumerates the set of values for ListCrossConnectsSortByEnum func GetListCrossConnectsSortByEnumValues() []ListCrossConnectsSortByEnum { values := make([]ListCrossConnectsSortByEnum, 0) for _, v := range mappingListCrossConnectsSortBy { values = append(values, v) } return values } // ListCrossConnectsSortOrderEnum Enum with underlying type: string type ListCrossConnectsSortOrderEnum string // Set of constants representing the allowable values for ListCrossConnectsSortOrderEnum const ( ListCrossConnectsSortOrderAsc ListCrossConnectsSortOrderEnum = "ASC" ListCrossConnectsSortOrderDesc ListCrossConnectsSortOrderEnum = "DESC" ) var mappingListCrossConnectsSortOrder = map[string]ListCrossConnectsSortOrderEnum{ "ASC": ListCrossConnectsSortOrderAsc, "DESC": ListCrossConnectsSortOrderDesc, } // GetListCrossConnectsSortOrderEnumValues Enumerates the set of values for ListCrossConnectsSortOrderEnum func GetListCrossConnectsSortOrderEnumValues() []ListCrossConnectsSortOrderEnum { values := make([]ListCrossConnectsSortOrderEnum, 0) for _, v := range mappingListCrossConnectsSortOrder { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_crossconnect_port_speed_shapes_request_response.go���������������������������������������������0000664�0000000�0000000�00000007127�13771713062�0036442�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListCrossconnectPortSpeedShapesRequest wrapper for the ListCrossconnectPortSpeedShapes operation type ListCrossconnectPortSpeedShapesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListCrossconnectPortSpeedShapesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListCrossconnectPortSpeedShapesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListCrossconnectPortSpeedShapesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListCrossconnectPortSpeedShapesResponse wrapper for the ListCrossconnectPortSpeedShapes operation type ListCrossconnectPortSpeedShapesResponse struct { // The underlying http response RawResponse *http.Response // A list of []CrossConnectPortSpeedShape instances Items []CrossConnectPortSpeedShape `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListCrossconnectPortSpeedShapesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListCrossconnectPortSpeedShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_dedicated_vm_host_instance_shapes_request_response.go������������������������������������������0000664�0000000�0000000�00000007634�13771713062�0037047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListDedicatedVmHostInstanceShapesRequest wrapper for the ListDedicatedVmHostInstanceShapes operation type ListDedicatedVmHostInstanceShapesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // Dedicated VM host shape name DedicatedVmHostShape *string `mandatory:"false" contributesTo:"query" name:"dedicatedVmHostShape"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListDedicatedVmHostInstanceShapesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListDedicatedVmHostInstanceShapesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListDedicatedVmHostInstanceShapesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListDedicatedVmHostInstanceShapesResponse wrapper for the ListDedicatedVmHostInstanceShapes operation type ListDedicatedVmHostInstanceShapesResponse struct { // The underlying http response RawResponse *http.Response // A list of []DedicatedVmHostInstanceShapeSummary instances Items []DedicatedVmHostInstanceShapeSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDedicatedVmHostInstanceShapesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListDedicatedVmHostInstanceShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������list_dedicated_vm_host_instances_request_response.go������������������������������������������������0000664�0000000�0000000�00000015534�13771713062�0035665�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListDedicatedVmHostInstancesRequest wrapper for the ListDedicatedVmHostInstances operation type ListDedicatedVmHostInstancesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the dedicated VM host. DedicatedVmHostId *string `mandatory:"true" contributesTo:"path" name:"dedicatedVmHostId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListDedicatedVmHostInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListDedicatedVmHostInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListDedicatedVmHostInstancesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListDedicatedVmHostInstancesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListDedicatedVmHostInstancesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListDedicatedVmHostInstancesResponse wrapper for the ListDedicatedVmHostInstances operation type ListDedicatedVmHostInstancesResponse struct { // The underlying http response RawResponse *http.Response // A list of []DedicatedVmHostInstanceSummary instances Items []DedicatedVmHostInstanceSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDedicatedVmHostInstancesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListDedicatedVmHostInstancesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListDedicatedVmHostInstancesSortByEnum Enum with underlying type: string type ListDedicatedVmHostInstancesSortByEnum string // Set of constants representing the allowable values for ListDedicatedVmHostInstancesSortByEnum const ( ListDedicatedVmHostInstancesSortByTimecreated ListDedicatedVmHostInstancesSortByEnum = "TIMECREATED" ListDedicatedVmHostInstancesSortByDisplayname ListDedicatedVmHostInstancesSortByEnum = "DISPLAYNAME" ) var mappingListDedicatedVmHostInstancesSortBy = map[string]ListDedicatedVmHostInstancesSortByEnum{ "TIMECREATED": ListDedicatedVmHostInstancesSortByTimecreated, "DISPLAYNAME": ListDedicatedVmHostInstancesSortByDisplayname, } // GetListDedicatedVmHostInstancesSortByEnumValues Enumerates the set of values for ListDedicatedVmHostInstancesSortByEnum func GetListDedicatedVmHostInstancesSortByEnumValues() []ListDedicatedVmHostInstancesSortByEnum { values := make([]ListDedicatedVmHostInstancesSortByEnum, 0) for _, v := range mappingListDedicatedVmHostInstancesSortBy { values = append(values, v) } return values } // ListDedicatedVmHostInstancesSortOrderEnum Enum with underlying type: string type ListDedicatedVmHostInstancesSortOrderEnum string // Set of constants representing the allowable values for ListDedicatedVmHostInstancesSortOrderEnum const ( ListDedicatedVmHostInstancesSortOrderAsc ListDedicatedVmHostInstancesSortOrderEnum = "ASC" ListDedicatedVmHostInstancesSortOrderDesc ListDedicatedVmHostInstancesSortOrderEnum = "DESC" ) var mappingListDedicatedVmHostInstancesSortOrder = map[string]ListDedicatedVmHostInstancesSortOrderEnum{ "ASC": ListDedicatedVmHostInstancesSortOrderAsc, "DESC": ListDedicatedVmHostInstancesSortOrderDesc, } // GetListDedicatedVmHostInstancesSortOrderEnumValues Enumerates the set of values for ListDedicatedVmHostInstancesSortOrderEnum func GetListDedicatedVmHostInstancesSortOrderEnumValues() []ListDedicatedVmHostInstancesSortOrderEnum { values := make([]ListDedicatedVmHostInstancesSortOrderEnum, 0) for _, v := range mappingListDedicatedVmHostInstancesSortOrder { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������list_dedicated_vm_host_shapes_request_response.go���������������������������������������������������0000664�0000000�0000000�00000007464�13771713062�0035164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListDedicatedVmHostShapesRequest wrapper for the ListDedicatedVmHostShapes operation type ListDedicatedVmHostShapesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // The name for the instance's shape. InstanceShapeName *string `mandatory:"false" contributesTo:"query" name:"instanceShapeName"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListDedicatedVmHostShapesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListDedicatedVmHostShapesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListDedicatedVmHostShapesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListDedicatedVmHostShapesResponse wrapper for the ListDedicatedVmHostShapes operation type ListDedicatedVmHostShapesResponse struct { // The underlying http response RawResponse *http.Response // A list of []DedicatedVmHostShapeSummary instances Items []DedicatedVmHostShapeSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDedicatedVmHostShapesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListDedicatedVmHostShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_dedicated_vm_hosts_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000020670�13771713062�0033776�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListDedicatedVmHostsRequest wrapper for the ListDedicatedVmHosts operation type ListDedicatedVmHostsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // A filter to only return resources that match the given lifecycle state. LifecycleState ListDedicatedVmHostsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The name for the instance's shape. InstanceShapeName *string `mandatory:"false" contributesTo:"query" name:"instanceShapeName"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListDedicatedVmHostsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListDedicatedVmHostsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListDedicatedVmHostsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListDedicatedVmHostsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListDedicatedVmHostsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListDedicatedVmHostsResponse wrapper for the ListDedicatedVmHosts operation type ListDedicatedVmHostsResponse struct { // The underlying http response RawResponse *http.Response // A list of []DedicatedVmHostSummary instances Items []DedicatedVmHostSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDedicatedVmHostsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListDedicatedVmHostsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListDedicatedVmHostsLifecycleStateEnum Enum with underlying type: string type ListDedicatedVmHostsLifecycleStateEnum string // Set of constants representing the allowable values for ListDedicatedVmHostsLifecycleStateEnum const ( ListDedicatedVmHostsLifecycleStateCreating ListDedicatedVmHostsLifecycleStateEnum = "CREATING" ListDedicatedVmHostsLifecycleStateActive ListDedicatedVmHostsLifecycleStateEnum = "ACTIVE" ListDedicatedVmHostsLifecycleStateUpdating ListDedicatedVmHostsLifecycleStateEnum = "UPDATING" ListDedicatedVmHostsLifecycleStateDeleting ListDedicatedVmHostsLifecycleStateEnum = "DELETING" ListDedicatedVmHostsLifecycleStateDeleted ListDedicatedVmHostsLifecycleStateEnum = "DELETED" ListDedicatedVmHostsLifecycleStateFailed ListDedicatedVmHostsLifecycleStateEnum = "FAILED" ) var mappingListDedicatedVmHostsLifecycleState = map[string]ListDedicatedVmHostsLifecycleStateEnum{ "CREATING": ListDedicatedVmHostsLifecycleStateCreating, "ACTIVE": ListDedicatedVmHostsLifecycleStateActive, "UPDATING": ListDedicatedVmHostsLifecycleStateUpdating, "DELETING": ListDedicatedVmHostsLifecycleStateDeleting, "DELETED": ListDedicatedVmHostsLifecycleStateDeleted, "FAILED": ListDedicatedVmHostsLifecycleStateFailed, } // GetListDedicatedVmHostsLifecycleStateEnumValues Enumerates the set of values for ListDedicatedVmHostsLifecycleStateEnum func GetListDedicatedVmHostsLifecycleStateEnumValues() []ListDedicatedVmHostsLifecycleStateEnum { values := make([]ListDedicatedVmHostsLifecycleStateEnum, 0) for _, v := range mappingListDedicatedVmHostsLifecycleState { values = append(values, v) } return values } // ListDedicatedVmHostsSortByEnum Enum with underlying type: string type ListDedicatedVmHostsSortByEnum string // Set of constants representing the allowable values for ListDedicatedVmHostsSortByEnum const ( ListDedicatedVmHostsSortByTimecreated ListDedicatedVmHostsSortByEnum = "TIMECREATED" ListDedicatedVmHostsSortByDisplayname ListDedicatedVmHostsSortByEnum = "DISPLAYNAME" ) var mappingListDedicatedVmHostsSortBy = map[string]ListDedicatedVmHostsSortByEnum{ "TIMECREATED": ListDedicatedVmHostsSortByTimecreated, "DISPLAYNAME": ListDedicatedVmHostsSortByDisplayname, } // GetListDedicatedVmHostsSortByEnumValues Enumerates the set of values for ListDedicatedVmHostsSortByEnum func GetListDedicatedVmHostsSortByEnumValues() []ListDedicatedVmHostsSortByEnum { values := make([]ListDedicatedVmHostsSortByEnum, 0) for _, v := range mappingListDedicatedVmHostsSortBy { values = append(values, v) } return values } // ListDedicatedVmHostsSortOrderEnum Enum with underlying type: string type ListDedicatedVmHostsSortOrderEnum string // Set of constants representing the allowable values for ListDedicatedVmHostsSortOrderEnum const ( ListDedicatedVmHostsSortOrderAsc ListDedicatedVmHostsSortOrderEnum = "ASC" ListDedicatedVmHostsSortOrderDesc ListDedicatedVmHostsSortOrderEnum = "DESC" ) var mappingListDedicatedVmHostsSortOrder = map[string]ListDedicatedVmHostsSortOrderEnum{ "ASC": ListDedicatedVmHostsSortOrderAsc, "DESC": ListDedicatedVmHostsSortOrderDesc, } // GetListDedicatedVmHostsSortOrderEnumValues Enumerates the set of values for ListDedicatedVmHostsSortOrderEnum func GetListDedicatedVmHostsSortOrderEnumValues() []ListDedicatedVmHostsSortOrderEnum { values := make([]ListDedicatedVmHostsSortOrderEnum, 0) for _, v := range mappingListDedicatedVmHostsSortOrder { values = append(values, v) } return values } ������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_dhcp_options_request_response.go�����0000664�0000000�0000000�00000014766�13771713062�0032727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListDhcpOptionsRequest wrapper for the ListDhcpOptions operation type ListDhcpOptionsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListDhcpOptionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListDhcpOptionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState DhcpOptionsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListDhcpOptionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListDhcpOptionsResponse wrapper for the ListDhcpOptions operation type ListDhcpOptionsResponse struct { // The underlying http response RawResponse *http.Response // A list of []DhcpOptions instances Items []DhcpOptions `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDhcpOptionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListDhcpOptionsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListDhcpOptionsSortByEnum Enum with underlying type: string type ListDhcpOptionsSortByEnum string // Set of constants representing the allowable values for ListDhcpOptionsSortByEnum const ( ListDhcpOptionsSortByTimecreated ListDhcpOptionsSortByEnum = "TIMECREATED" ListDhcpOptionsSortByDisplayname ListDhcpOptionsSortByEnum = "DISPLAYNAME" ) var mappingListDhcpOptionsSortBy = map[string]ListDhcpOptionsSortByEnum{ "TIMECREATED": ListDhcpOptionsSortByTimecreated, "DISPLAYNAME": ListDhcpOptionsSortByDisplayname, } // GetListDhcpOptionsSortByEnumValues Enumerates the set of values for ListDhcpOptionsSortByEnum func GetListDhcpOptionsSortByEnumValues() []ListDhcpOptionsSortByEnum { values := make([]ListDhcpOptionsSortByEnum, 0) for _, v := range mappingListDhcpOptionsSortBy { values = append(values, v) } return values } // ListDhcpOptionsSortOrderEnum Enum with underlying type: string type ListDhcpOptionsSortOrderEnum string // Set of constants representing the allowable values for ListDhcpOptionsSortOrderEnum const ( ListDhcpOptionsSortOrderAsc ListDhcpOptionsSortOrderEnum = "ASC" ListDhcpOptionsSortOrderDesc ListDhcpOptionsSortOrderEnum = "DESC" ) var mappingListDhcpOptionsSortOrder = map[string]ListDhcpOptionsSortOrderEnum{ "ASC": ListDhcpOptionsSortOrderAsc, "DESC": ListDhcpOptionsSortOrderDesc, } // GetListDhcpOptionsSortOrderEnumValues Enumerates the set of values for ListDhcpOptionsSortOrderEnum func GetListDhcpOptionsSortOrderEnumValues() []ListDhcpOptionsSortOrderEnum { values := make([]ListDhcpOptionsSortOrderEnum, 0) for _, v := range mappingListDhcpOptionsSortOrder { values = append(values, v) } return values } ����������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_drg_attachments_request_response.go��0000664�0000000�0000000�00000007267�13771713062�0033403�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListDrgAttachmentsRequest wrapper for the ListDrgAttachments operation type ListDrgAttachmentsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"false" contributesTo:"query" name:"vcnId"` // The OCID of the DRG. DrgId *string `mandatory:"false" contributesTo:"query" name:"drgId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListDrgAttachmentsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListDrgAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListDrgAttachmentsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListDrgAttachmentsResponse wrapper for the ListDrgAttachments operation type ListDrgAttachmentsResponse struct { // The underlying http response RawResponse *http.Response // A list of []DrgAttachment instances Items []DrgAttachment `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDrgAttachmentsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListDrgAttachmentsResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_drgs_request_response.go�������������0000664�0000000�0000000�00000006454�13771713062�0031170�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListDrgsRequest wrapper for the ListDrgs operation type ListDrgsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListDrgsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListDrgsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListDrgsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListDrgsResponse wrapper for the ListDrgs operation type ListDrgsResponse struct { // The underlying http response RawResponse *http.Response // A list of []Drg instances Items []Drg `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListDrgsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListDrgsResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_fast_connect_provider_services_request_response.go���������������������������������������������0000664�0000000�0000000�00000007127�13771713062�0036433�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListFastConnectProviderServicesRequest wrapper for the ListFastConnectProviderServices operation type ListFastConnectProviderServicesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListFastConnectProviderServicesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListFastConnectProviderServicesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListFastConnectProviderServicesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListFastConnectProviderServicesResponse wrapper for the ListFastConnectProviderServices operation type ListFastConnectProviderServicesResponse struct { // The underlying http response RawResponse *http.Response // A list of []FastConnectProviderService instances Items []FastConnectProviderService `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListFastConnectProviderServicesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListFastConnectProviderServicesResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_fast_connect_provider_virtual_circuit_bandwidth_shapes_request_response.go���������������������0000664�0000000�0000000�00000007405�13771713062�0043406�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListFastConnectProviderVirtualCircuitBandwidthShapesRequest wrapper for the ListFastConnectProviderVirtualCircuitBandwidthShapes operation type ListFastConnectProviderVirtualCircuitBandwidthShapesRequest struct { // The OCID of the provider service. ProviderServiceId *string `mandatory:"true" contributesTo:"path" name:"providerServiceId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListFastConnectProviderVirtualCircuitBandwidthShapesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListFastConnectProviderVirtualCircuitBandwidthShapesResponse wrapper for the ListFastConnectProviderVirtualCircuitBandwidthShapes operation type ListFastConnectProviderVirtualCircuitBandwidthShapesResponse struct { // The underlying http response RawResponse *http.Response // A list of []VirtualCircuitBandwidthShape instances Items []VirtualCircuitBandwidthShape `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListFastConnectProviderVirtualCircuitBandwidthShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_i_p_sec_connection_tunnels_request_response.go�������������������������������������������������0000664�0000000�0000000�00000006703�13771713062�0035537�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListIPSecConnectionTunnelsRequest wrapper for the ListIPSecConnectionTunnels operation type ListIPSecConnectionTunnelsRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListIPSecConnectionTunnelsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListIPSecConnectionTunnelsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListIPSecConnectionTunnelsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListIPSecConnectionTunnelsResponse wrapper for the ListIPSecConnectionTunnels operation type ListIPSecConnectionTunnelsResponse struct { // The underlying http response RawResponse *http.Response // A list of []IpSecConnectionTunnel instances Items []IpSecConnectionTunnel `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListIPSecConnectionTunnelsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListIPSecConnectionTunnelsResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������list_i_p_sec_connections_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000007210�13771713062�0034144�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListIPSecConnectionsRequest wrapper for the ListIPSecConnections operation type ListIPSecConnectionsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the DRG. DrgId *string `mandatory:"false" contributesTo:"query" name:"drgId"` // The OCID of the CPE. CpeId *string `mandatory:"false" contributesTo:"query" name:"cpeId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListIPSecConnectionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListIPSecConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListIPSecConnectionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListIPSecConnectionsResponse wrapper for the ListIPSecConnections operation type ListIPSecConnectionsResponse struct { // The underlying http response RawResponse *http.Response // A list of []IpSecConnection instances Items []IpSecConnection `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListIPSecConnectionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListIPSecConnectionsResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_image_shape_compatibility_entries_request_response.go������������������������������������������0000664�0000000�0000000�00000007142�13771713062�0037071�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListImageShapeCompatibilityEntriesRequest wrapper for the ListImageShapeCompatibilityEntries operation type ListImageShapeCompatibilityEntriesRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListImageShapeCompatibilityEntriesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListImageShapeCompatibilityEntriesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListImageShapeCompatibilityEntriesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListImageShapeCompatibilityEntriesResponse wrapper for the ListImageShapeCompatibilityEntries operation type ListImageShapeCompatibilityEntriesResponse struct { // The underlying http response RawResponse *http.Response // A list of []ImageShapeCompatibilitySummary instances Items []ImageShapeCompatibilitySummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListImageShapeCompatibilityEntriesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListImageShapeCompatibilityEntriesResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_images_request_response.go�����������0000664�0000000�0000000�00000014747�13771713062�0031502�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListImagesRequest wrapper for the ListImages operation type ListImagesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The image's operating system. // Example: `Oracle Linux` OperatingSystem *string `mandatory:"false" contributesTo:"query" name:"operatingSystem"` // The image's operating system version. // Example: `7.2` OperatingSystemVersion *string `mandatory:"false" contributesTo:"query" name:"operatingSystemVersion"` // Shape name. Shape *string `mandatory:"false" contributesTo:"query" name:"shape"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListImagesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListImagesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState ImageLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListImagesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListImagesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListImagesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListImagesResponse wrapper for the ListImages operation type ListImagesResponse struct { // The underlying http response RawResponse *http.Response // A list of []Image instances Items []Image `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListImagesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListImagesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListImagesSortByEnum Enum with underlying type: string type ListImagesSortByEnum string // Set of constants representing the allowable values for ListImagesSortByEnum const ( ListImagesSortByTimecreated ListImagesSortByEnum = "TIMECREATED" ListImagesSortByDisplayname ListImagesSortByEnum = "DISPLAYNAME" ) var mappingListImagesSortBy = map[string]ListImagesSortByEnum{ "TIMECREATED": ListImagesSortByTimecreated, "DISPLAYNAME": ListImagesSortByDisplayname, } // GetListImagesSortByEnumValues Enumerates the set of values for ListImagesSortByEnum func GetListImagesSortByEnumValues() []ListImagesSortByEnum { values := make([]ListImagesSortByEnum, 0) for _, v := range mappingListImagesSortBy { values = append(values, v) } return values } // ListImagesSortOrderEnum Enum with underlying type: string type ListImagesSortOrderEnum string // Set of constants representing the allowable values for ListImagesSortOrderEnum const ( ListImagesSortOrderAsc ListImagesSortOrderEnum = "ASC" ListImagesSortOrderDesc ListImagesSortOrderEnum = "DESC" ) var mappingListImagesSortOrder = map[string]ListImagesSortOrderEnum{ "ASC": ListImagesSortOrderAsc, "DESC": ListImagesSortOrderDesc, } // GetListImagesSortOrderEnumValues Enumerates the set of values for ListImagesSortOrderEnum func GetListImagesSortOrderEnumValues() []ListImagesSortOrderEnum { values := make([]ListImagesSortOrderEnum, 0) for _, v := range mappingListImagesSortOrder { values = append(values, v) } return values } �������������������������list_instance_configurations_request_response.go����������������������������������������������������0000664�0000000�0000000�00000014737�13771713062�0035073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListInstanceConfigurationsRequest wrapper for the ListInstanceConfigurations operation type ListInstanceConfigurationsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInstanceConfigurationsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListInstanceConfigurationsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListInstanceConfigurationsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListInstanceConfigurationsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListInstanceConfigurationsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListInstanceConfigurationsResponse wrapper for the ListInstanceConfigurations operation type ListInstanceConfigurationsResponse struct { // The underlying http response RawResponse *http.Response // A list of []InstanceConfigurationSummary instances Items []InstanceConfigurationSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListInstanceConfigurationsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListInstanceConfigurationsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListInstanceConfigurationsSortByEnum Enum with underlying type: string type ListInstanceConfigurationsSortByEnum string // Set of constants representing the allowable values for ListInstanceConfigurationsSortByEnum const ( ListInstanceConfigurationsSortByTimecreated ListInstanceConfigurationsSortByEnum = "TIMECREATED" ListInstanceConfigurationsSortByDisplayname ListInstanceConfigurationsSortByEnum = "DISPLAYNAME" ) var mappingListInstanceConfigurationsSortBy = map[string]ListInstanceConfigurationsSortByEnum{ "TIMECREATED": ListInstanceConfigurationsSortByTimecreated, "DISPLAYNAME": ListInstanceConfigurationsSortByDisplayname, } // GetListInstanceConfigurationsSortByEnumValues Enumerates the set of values for ListInstanceConfigurationsSortByEnum func GetListInstanceConfigurationsSortByEnumValues() []ListInstanceConfigurationsSortByEnum { values := make([]ListInstanceConfigurationsSortByEnum, 0) for _, v := range mappingListInstanceConfigurationsSortBy { values = append(values, v) } return values } // ListInstanceConfigurationsSortOrderEnum Enum with underlying type: string type ListInstanceConfigurationsSortOrderEnum string // Set of constants representing the allowable values for ListInstanceConfigurationsSortOrderEnum const ( ListInstanceConfigurationsSortOrderAsc ListInstanceConfigurationsSortOrderEnum = "ASC" ListInstanceConfigurationsSortOrderDesc ListInstanceConfigurationsSortOrderEnum = "DESC" ) var mappingListInstanceConfigurationsSortOrder = map[string]ListInstanceConfigurationsSortOrderEnum{ "ASC": ListInstanceConfigurationsSortOrderAsc, "DESC": ListInstanceConfigurationsSortOrderDesc, } // GetListInstanceConfigurationsSortOrderEnumValues Enumerates the set of values for ListInstanceConfigurationsSortOrderEnum func GetListInstanceConfigurationsSortOrderEnumValues() []ListInstanceConfigurationsSortOrderEnum { values := make([]ListInstanceConfigurationsSortOrderEnum, 0) for _, v := range mappingListInstanceConfigurationsSortOrder { values = append(values, v) } return values } ���������������������������������list_instance_console_connections_request_response.go�����������������������������������������������0000664�0000000�0000000�00000007271�13771713062�0036100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListInstanceConsoleConnectionsRequest wrapper for the ListInstanceConsoleConnections operation type ListInstanceConsoleConnectionsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the instance. InstanceId *string `mandatory:"false" contributesTo:"query" name:"instanceId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListInstanceConsoleConnectionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListInstanceConsoleConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListInstanceConsoleConnectionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListInstanceConsoleConnectionsResponse wrapper for the ListInstanceConsoleConnections operation type ListInstanceConsoleConnectionsResponse struct { // The underlying http response RawResponse *http.Response // A list of []InstanceConsoleConnection instances Items []InstanceConsoleConnection `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListInstanceConsoleConnectionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListInstanceConsoleConnectionsResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_instance_devices_request_response.go�0000664�0000000�0000000�00000014450�13771713062�0033532�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListInstanceDevicesRequest wrapper for the ListInstanceDevices operation type ListInstanceDevicesRequest struct { // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` // A filter to return only available devices or only used devices. IsAvailable *bool `mandatory:"false" contributesTo:"query" name:"isAvailable"` // A filter to return only devices that match the given name exactly. Name *string `mandatory:"false" contributesTo:"query" name:"name"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInstanceDevicesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListInstanceDevicesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListInstanceDevicesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListInstanceDevicesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListInstanceDevicesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListInstanceDevicesResponse wrapper for the ListInstanceDevices operation type ListInstanceDevicesResponse struct { // The underlying http response RawResponse *http.Response // A list of []Device instances Items []Device `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListInstanceDevicesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListInstanceDevicesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListInstanceDevicesSortByEnum Enum with underlying type: string type ListInstanceDevicesSortByEnum string // Set of constants representing the allowable values for ListInstanceDevicesSortByEnum const ( ListInstanceDevicesSortByTimecreated ListInstanceDevicesSortByEnum = "TIMECREATED" ListInstanceDevicesSortByDisplayname ListInstanceDevicesSortByEnum = "DISPLAYNAME" ) var mappingListInstanceDevicesSortBy = map[string]ListInstanceDevicesSortByEnum{ "TIMECREATED": ListInstanceDevicesSortByTimecreated, "DISPLAYNAME": ListInstanceDevicesSortByDisplayname, } // GetListInstanceDevicesSortByEnumValues Enumerates the set of values for ListInstanceDevicesSortByEnum func GetListInstanceDevicesSortByEnumValues() []ListInstanceDevicesSortByEnum { values := make([]ListInstanceDevicesSortByEnum, 0) for _, v := range mappingListInstanceDevicesSortBy { values = append(values, v) } return values } // ListInstanceDevicesSortOrderEnum Enum with underlying type: string type ListInstanceDevicesSortOrderEnum string // Set of constants representing the allowable values for ListInstanceDevicesSortOrderEnum const ( ListInstanceDevicesSortOrderAsc ListInstanceDevicesSortOrderEnum = "ASC" ListInstanceDevicesSortOrderDesc ListInstanceDevicesSortOrderEnum = "DESC" ) var mappingListInstanceDevicesSortOrder = map[string]ListInstanceDevicesSortOrderEnum{ "ASC": ListInstanceDevicesSortOrderAsc, "DESC": ListInstanceDevicesSortOrderDesc, } // GetListInstanceDevicesSortOrderEnumValues Enumerates the set of values for ListInstanceDevicesSortOrderEnum func GetListInstanceDevicesSortOrderEnumValues() []ListInstanceDevicesSortOrderEnum { values := make([]ListInstanceDevicesSortOrderEnum, 0) for _, v := range mappingListInstanceDevicesSortOrder { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_instance_pool_instances_request_response.go����������������������������������������������������0000664�0000000�0000000�00000015375�13771713062�0035060�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListInstancePoolInstancesRequest wrapper for the ListInstancePoolInstances operation type ListInstancePoolInstancesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInstancePoolInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListInstancePoolInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListInstancePoolInstancesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListInstancePoolInstancesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListInstancePoolInstancesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListInstancePoolInstancesResponse wrapper for the ListInstancePoolInstances operation type ListInstancePoolInstancesResponse struct { // The underlying http response RawResponse *http.Response // A list of []InstanceSummary instances Items []InstanceSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListInstancePoolInstancesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListInstancePoolInstancesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListInstancePoolInstancesSortByEnum Enum with underlying type: string type ListInstancePoolInstancesSortByEnum string // Set of constants representing the allowable values for ListInstancePoolInstancesSortByEnum const ( ListInstancePoolInstancesSortByTimecreated ListInstancePoolInstancesSortByEnum = "TIMECREATED" ListInstancePoolInstancesSortByDisplayname ListInstancePoolInstancesSortByEnum = "DISPLAYNAME" ) var mappingListInstancePoolInstancesSortBy = map[string]ListInstancePoolInstancesSortByEnum{ "TIMECREATED": ListInstancePoolInstancesSortByTimecreated, "DISPLAYNAME": ListInstancePoolInstancesSortByDisplayname, } // GetListInstancePoolInstancesSortByEnumValues Enumerates the set of values for ListInstancePoolInstancesSortByEnum func GetListInstancePoolInstancesSortByEnumValues() []ListInstancePoolInstancesSortByEnum { values := make([]ListInstancePoolInstancesSortByEnum, 0) for _, v := range mappingListInstancePoolInstancesSortBy { values = append(values, v) } return values } // ListInstancePoolInstancesSortOrderEnum Enum with underlying type: string type ListInstancePoolInstancesSortOrderEnum string // Set of constants representing the allowable values for ListInstancePoolInstancesSortOrderEnum const ( ListInstancePoolInstancesSortOrderAsc ListInstancePoolInstancesSortOrderEnum = "ASC" ListInstancePoolInstancesSortOrderDesc ListInstancePoolInstancesSortOrderEnum = "DESC" ) var mappingListInstancePoolInstancesSortOrder = map[string]ListInstancePoolInstancesSortOrderEnum{ "ASC": ListInstancePoolInstancesSortOrderAsc, "DESC": ListInstancePoolInstancesSortOrderDesc, } // GetListInstancePoolInstancesSortOrderEnumValues Enumerates the set of values for ListInstancePoolInstancesSortOrderEnum func GetListInstancePoolInstancesSortOrderEnumValues() []ListInstancePoolInstancesSortOrderEnum { values := make([]ListInstancePoolInstancesSortOrderEnum, 0) for _, v := range mappingListInstancePoolInstancesSortOrder { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_instance_pools_request_response.go���0000664�0000000�0000000�00000014704�13771713062�0033246�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListInstancePoolsRequest wrapper for the ListInstancePools operation type ListInstancePoolsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInstancePoolsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListInstancePoolsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState InstancePoolSummaryLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListInstancePoolsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListInstancePoolsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListInstancePoolsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListInstancePoolsResponse wrapper for the ListInstancePools operation type ListInstancePoolsResponse struct { // The underlying http response RawResponse *http.Response // A list of []InstancePoolSummary instances Items []InstancePoolSummary `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListInstancePoolsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListInstancePoolsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListInstancePoolsSortByEnum Enum with underlying type: string type ListInstancePoolsSortByEnum string // Set of constants representing the allowable values for ListInstancePoolsSortByEnum const ( ListInstancePoolsSortByTimecreated ListInstancePoolsSortByEnum = "TIMECREATED" ListInstancePoolsSortByDisplayname ListInstancePoolsSortByEnum = "DISPLAYNAME" ) var mappingListInstancePoolsSortBy = map[string]ListInstancePoolsSortByEnum{ "TIMECREATED": ListInstancePoolsSortByTimecreated, "DISPLAYNAME": ListInstancePoolsSortByDisplayname, } // GetListInstancePoolsSortByEnumValues Enumerates the set of values for ListInstancePoolsSortByEnum func GetListInstancePoolsSortByEnumValues() []ListInstancePoolsSortByEnum { values := make([]ListInstancePoolsSortByEnum, 0) for _, v := range mappingListInstancePoolsSortBy { values = append(values, v) } return values } // ListInstancePoolsSortOrderEnum Enum with underlying type: string type ListInstancePoolsSortOrderEnum string // Set of constants representing the allowable values for ListInstancePoolsSortOrderEnum const ( ListInstancePoolsSortOrderAsc ListInstancePoolsSortOrderEnum = "ASC" ListInstancePoolsSortOrderDesc ListInstancePoolsSortOrderEnum = "DESC" ) var mappingListInstancePoolsSortOrder = map[string]ListInstancePoolsSortOrderEnum{ "ASC": ListInstancePoolsSortOrderAsc, "DESC": ListInstancePoolsSortOrderDesc, } // GetListInstancePoolsSortOrderEnumValues Enumerates the set of values for ListInstancePoolsSortOrderEnum func GetListInstancePoolsSortOrderEnumValues() []ListInstancePoolsSortOrderEnum { values := make([]ListInstancePoolsSortOrderEnum, 0) for _, v := range mappingListInstancePoolsSortOrder { values = append(values, v) } return values } ������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_instances_request_response.go��������0000664�0000000�0000000�00000014616�13771713062�0032217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListInstancesRequest wrapper for the ListInstances operation type ListInstancesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState InstanceLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListInstancesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListInstancesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListInstancesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListInstancesResponse wrapper for the ListInstances operation type ListInstancesResponse struct { // The underlying http response RawResponse *http.Response // A list of []Instance instances Items []Instance `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListInstancesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListInstancesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListInstancesSortByEnum Enum with underlying type: string type ListInstancesSortByEnum string // Set of constants representing the allowable values for ListInstancesSortByEnum const ( ListInstancesSortByTimecreated ListInstancesSortByEnum = "TIMECREATED" ListInstancesSortByDisplayname ListInstancesSortByEnum = "DISPLAYNAME" ) var mappingListInstancesSortBy = map[string]ListInstancesSortByEnum{ "TIMECREATED": ListInstancesSortByTimecreated, "DISPLAYNAME": ListInstancesSortByDisplayname, } // GetListInstancesSortByEnumValues Enumerates the set of values for ListInstancesSortByEnum func GetListInstancesSortByEnumValues() []ListInstancesSortByEnum { values := make([]ListInstancesSortByEnum, 0) for _, v := range mappingListInstancesSortBy { values = append(values, v) } return values } // ListInstancesSortOrderEnum Enum with underlying type: string type ListInstancesSortOrderEnum string // Set of constants representing the allowable values for ListInstancesSortOrderEnum const ( ListInstancesSortOrderAsc ListInstancesSortOrderEnum = "ASC" ListInstancesSortOrderDesc ListInstancesSortOrderEnum = "DESC" ) var mappingListInstancesSortOrder = map[string]ListInstancesSortOrderEnum{ "ASC": ListInstancesSortOrderAsc, "DESC": ListInstancesSortOrderDesc, } // GetListInstancesSortOrderEnumValues Enumerates the set of values for ListInstancesSortOrderEnum func GetListInstancesSortOrderEnumValues() []ListInstancesSortOrderEnum { values := make([]ListInstancesSortOrderEnum, 0) for _, v := range mappingListInstancesSortOrder { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_internet_gateways_request_response.go0000664�0000000�0000000�00000015355�13771713062�0033765�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListInternetGatewaysRequest wrapper for the ListInternetGateways operation type ListInternetGatewaysRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListInternetGatewaysSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListInternetGatewaysSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState InternetGatewayLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListInternetGatewaysRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListInternetGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListInternetGatewaysRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListInternetGatewaysResponse wrapper for the ListInternetGateways operation type ListInternetGatewaysResponse struct { // The underlying http response RawResponse *http.Response // A list of []InternetGateway instances Items []InternetGateway `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListInternetGatewaysResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListInternetGatewaysResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListInternetGatewaysSortByEnum Enum with underlying type: string type ListInternetGatewaysSortByEnum string // Set of constants representing the allowable values for ListInternetGatewaysSortByEnum const ( ListInternetGatewaysSortByTimecreated ListInternetGatewaysSortByEnum = "TIMECREATED" ListInternetGatewaysSortByDisplayname ListInternetGatewaysSortByEnum = "DISPLAYNAME" ) var mappingListInternetGatewaysSortBy = map[string]ListInternetGatewaysSortByEnum{ "TIMECREATED": ListInternetGatewaysSortByTimecreated, "DISPLAYNAME": ListInternetGatewaysSortByDisplayname, } // GetListInternetGatewaysSortByEnumValues Enumerates the set of values for ListInternetGatewaysSortByEnum func GetListInternetGatewaysSortByEnumValues() []ListInternetGatewaysSortByEnum { values := make([]ListInternetGatewaysSortByEnum, 0) for _, v := range mappingListInternetGatewaysSortBy { values = append(values, v) } return values } // ListInternetGatewaysSortOrderEnum Enum with underlying type: string type ListInternetGatewaysSortOrderEnum string // Set of constants representing the allowable values for ListInternetGatewaysSortOrderEnum const ( ListInternetGatewaysSortOrderAsc ListInternetGatewaysSortOrderEnum = "ASC" ListInternetGatewaysSortOrderDesc ListInternetGatewaysSortOrderEnum = "DESC" ) var mappingListInternetGatewaysSortOrder = map[string]ListInternetGatewaysSortOrderEnum{ "ASC": ListInternetGatewaysSortOrderAsc, "DESC": ListInternetGatewaysSortOrderDesc, } // GetListInternetGatewaysSortOrderEnumValues Enumerates the set of values for ListInternetGatewaysSortOrderEnum func GetListInternetGatewaysSortOrderEnumValues() []ListInternetGatewaysSortOrderEnum { values := make([]ListInternetGatewaysSortOrderEnum, 0) for _, v := range mappingListInternetGatewaysSortOrder { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_ipv6s_request_response.go������������0000664�0000000�0000000�00000006755�13771713062�0031304�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListIpv6sRequest wrapper for the ListIpv6s operation type ListIpv6sRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // An IP address. This could be either IPv4 or IPv6, depending on the resource. // Example: `10.0.3.3` IpAddress *string `mandatory:"false" contributesTo:"query" name:"ipAddress"` // The OCID of the subnet. SubnetId *string `mandatory:"false" contributesTo:"query" name:"subnetId"` // The OCID of the VNIC. VnicId *string `mandatory:"false" contributesTo:"query" name:"vnicId"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListIpv6sRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListIpv6sRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListIpv6sRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListIpv6sResponse wrapper for the ListIpv6s operation type ListIpv6sResponse struct { // The underlying http response RawResponse *http.Response // A list of []Ipv6 instances Items []Ipv6 `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListIpv6sResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListIpv6sResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������list_local_peering_gateways_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000007244�13771713062�0034657�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListLocalPeeringGatewaysRequest wrapper for the ListLocalPeeringGateways operation type ListLocalPeeringGatewaysRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListLocalPeeringGatewaysRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListLocalPeeringGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListLocalPeeringGatewaysRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListLocalPeeringGatewaysResponse wrapper for the ListLocalPeeringGateways operation type ListLocalPeeringGatewaysResponse struct { // The underlying http response RawResponse *http.Response // A list of []LocalPeeringGateway instances Items []LocalPeeringGateway `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListLocalPeeringGatewaysResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListLocalPeeringGatewaysResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_nat_gateways_request_response.go�����0000664�0000000�0000000�00000014761�13771713062�0032717�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListNatGatewaysRequest wrapper for the ListNatGateways operation type ListNatGatewaysRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"false" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListNatGatewaysSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListNatGatewaysSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState NatGatewayLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListNatGatewaysRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListNatGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListNatGatewaysRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListNatGatewaysResponse wrapper for the ListNatGateways operation type ListNatGatewaysResponse struct { // The underlying http response RawResponse *http.Response // A list of []NatGateway instances Items []NatGateway `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListNatGatewaysResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListNatGatewaysResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListNatGatewaysSortByEnum Enum with underlying type: string type ListNatGatewaysSortByEnum string // Set of constants representing the allowable values for ListNatGatewaysSortByEnum const ( ListNatGatewaysSortByTimecreated ListNatGatewaysSortByEnum = "TIMECREATED" ListNatGatewaysSortByDisplayname ListNatGatewaysSortByEnum = "DISPLAYNAME" ) var mappingListNatGatewaysSortBy = map[string]ListNatGatewaysSortByEnum{ "TIMECREATED": ListNatGatewaysSortByTimecreated, "DISPLAYNAME": ListNatGatewaysSortByDisplayname, } // GetListNatGatewaysSortByEnumValues Enumerates the set of values for ListNatGatewaysSortByEnum func GetListNatGatewaysSortByEnumValues() []ListNatGatewaysSortByEnum { values := make([]ListNatGatewaysSortByEnum, 0) for _, v := range mappingListNatGatewaysSortBy { values = append(values, v) } return values } // ListNatGatewaysSortOrderEnum Enum with underlying type: string type ListNatGatewaysSortOrderEnum string // Set of constants representing the allowable values for ListNatGatewaysSortOrderEnum const ( ListNatGatewaysSortOrderAsc ListNatGatewaysSortOrderEnum = "ASC" ListNatGatewaysSortOrderDesc ListNatGatewaysSortOrderEnum = "DESC" ) var mappingListNatGatewaysSortOrder = map[string]ListNatGatewaysSortOrderEnum{ "ASC": ListNatGatewaysSortOrderAsc, "DESC": ListNatGatewaysSortOrderDesc, } // GetListNatGatewaysSortOrderEnumValues Enumerates the set of values for ListNatGatewaysSortOrderEnum func GetListNatGatewaysSortOrderEnumValues() []ListNatGatewaysSortOrderEnum { values := make([]ListNatGatewaysSortOrderEnum, 0) for _, v := range mappingListNatGatewaysSortOrder { values = append(values, v) } return values } ���������������list_network_security_group_security_rules_request_response.go��������������������������������������0000664�0000000�0000000�00000017353�13771713062�0040147�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListNetworkSecurityGroupSecurityRulesRequest wrapper for the ListNetworkSecurityGroupSecurityRules operation type ListNetworkSecurityGroupSecurityRulesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // Direction of the security rule. Set to `EGRESS` for rules that allow outbound IP packets, // or `INGRESS` for rules that allow inbound IP packets. Direction ListNetworkSecurityGroupSecurityRulesDirectionEnum `mandatory:"false" contributesTo:"query" name:"direction" omitEmpty:"true"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. SortBy ListNetworkSecurityGroupSecurityRulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListNetworkSecurityGroupSecurityRulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListNetworkSecurityGroupSecurityRulesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListNetworkSecurityGroupSecurityRulesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListNetworkSecurityGroupSecurityRulesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListNetworkSecurityGroupSecurityRulesResponse wrapper for the ListNetworkSecurityGroupSecurityRules operation type ListNetworkSecurityGroupSecurityRulesResponse struct { // The underlying http response RawResponse *http.Response // A list of []SecurityRule instances Items []SecurityRule `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListNetworkSecurityGroupSecurityRulesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListNetworkSecurityGroupSecurityRulesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListNetworkSecurityGroupSecurityRulesDirectionEnum Enum with underlying type: string type ListNetworkSecurityGroupSecurityRulesDirectionEnum string // Set of constants representing the allowable values for ListNetworkSecurityGroupSecurityRulesDirectionEnum const ( ListNetworkSecurityGroupSecurityRulesDirectionEgress ListNetworkSecurityGroupSecurityRulesDirectionEnum = "EGRESS" ListNetworkSecurityGroupSecurityRulesDirectionIngress ListNetworkSecurityGroupSecurityRulesDirectionEnum = "INGRESS" ) var mappingListNetworkSecurityGroupSecurityRulesDirection = map[string]ListNetworkSecurityGroupSecurityRulesDirectionEnum{ "EGRESS": ListNetworkSecurityGroupSecurityRulesDirectionEgress, "INGRESS": ListNetworkSecurityGroupSecurityRulesDirectionIngress, } // GetListNetworkSecurityGroupSecurityRulesDirectionEnumValues Enumerates the set of values for ListNetworkSecurityGroupSecurityRulesDirectionEnum func GetListNetworkSecurityGroupSecurityRulesDirectionEnumValues() []ListNetworkSecurityGroupSecurityRulesDirectionEnum { values := make([]ListNetworkSecurityGroupSecurityRulesDirectionEnum, 0) for _, v := range mappingListNetworkSecurityGroupSecurityRulesDirection { values = append(values, v) } return values } // ListNetworkSecurityGroupSecurityRulesSortByEnum Enum with underlying type: string type ListNetworkSecurityGroupSecurityRulesSortByEnum string // Set of constants representing the allowable values for ListNetworkSecurityGroupSecurityRulesSortByEnum const ( ListNetworkSecurityGroupSecurityRulesSortByTimecreated ListNetworkSecurityGroupSecurityRulesSortByEnum = "TIMECREATED" ) var mappingListNetworkSecurityGroupSecurityRulesSortBy = map[string]ListNetworkSecurityGroupSecurityRulesSortByEnum{ "TIMECREATED": ListNetworkSecurityGroupSecurityRulesSortByTimecreated, } // GetListNetworkSecurityGroupSecurityRulesSortByEnumValues Enumerates the set of values for ListNetworkSecurityGroupSecurityRulesSortByEnum func GetListNetworkSecurityGroupSecurityRulesSortByEnumValues() []ListNetworkSecurityGroupSecurityRulesSortByEnum { values := make([]ListNetworkSecurityGroupSecurityRulesSortByEnum, 0) for _, v := range mappingListNetworkSecurityGroupSecurityRulesSortBy { values = append(values, v) } return values } // ListNetworkSecurityGroupSecurityRulesSortOrderEnum Enum with underlying type: string type ListNetworkSecurityGroupSecurityRulesSortOrderEnum string // Set of constants representing the allowable values for ListNetworkSecurityGroupSecurityRulesSortOrderEnum const ( ListNetworkSecurityGroupSecurityRulesSortOrderAsc ListNetworkSecurityGroupSecurityRulesSortOrderEnum = "ASC" ListNetworkSecurityGroupSecurityRulesSortOrderDesc ListNetworkSecurityGroupSecurityRulesSortOrderEnum = "DESC" ) var mappingListNetworkSecurityGroupSecurityRulesSortOrder = map[string]ListNetworkSecurityGroupSecurityRulesSortOrderEnum{ "ASC": ListNetworkSecurityGroupSecurityRulesSortOrderAsc, "DESC": ListNetworkSecurityGroupSecurityRulesSortOrderDesc, } // GetListNetworkSecurityGroupSecurityRulesSortOrderEnumValues Enumerates the set of values for ListNetworkSecurityGroupSecurityRulesSortOrderEnum func GetListNetworkSecurityGroupSecurityRulesSortOrderEnumValues() []ListNetworkSecurityGroupSecurityRulesSortOrderEnum { values := make([]ListNetworkSecurityGroupSecurityRulesSortOrderEnum, 0) for _, v := range mappingListNetworkSecurityGroupSecurityRulesSortOrder { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_network_security_group_vnics_request_response.go�����������������������������������������������0000664�0000000�0000000�00000013673�13771713062�0036211�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListNetworkSecurityGroupVnicsRequest wrapper for the ListNetworkSecurityGroupVnics operation type ListNetworkSecurityGroupVnicsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. SortBy ListNetworkSecurityGroupVnicsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListNetworkSecurityGroupVnicsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListNetworkSecurityGroupVnicsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListNetworkSecurityGroupVnicsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListNetworkSecurityGroupVnicsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListNetworkSecurityGroupVnicsResponse wrapper for the ListNetworkSecurityGroupVnics operation type ListNetworkSecurityGroupVnicsResponse struct { // The underlying http response RawResponse *http.Response // A list of []NetworkSecurityGroupVnic instances Items []NetworkSecurityGroupVnic `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListNetworkSecurityGroupVnicsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListNetworkSecurityGroupVnicsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListNetworkSecurityGroupVnicsSortByEnum Enum with underlying type: string type ListNetworkSecurityGroupVnicsSortByEnum string // Set of constants representing the allowable values for ListNetworkSecurityGroupVnicsSortByEnum const ( ListNetworkSecurityGroupVnicsSortByTimeassociated ListNetworkSecurityGroupVnicsSortByEnum = "TIMEASSOCIATED" ) var mappingListNetworkSecurityGroupVnicsSortBy = map[string]ListNetworkSecurityGroupVnicsSortByEnum{ "TIMEASSOCIATED": ListNetworkSecurityGroupVnicsSortByTimeassociated, } // GetListNetworkSecurityGroupVnicsSortByEnumValues Enumerates the set of values for ListNetworkSecurityGroupVnicsSortByEnum func GetListNetworkSecurityGroupVnicsSortByEnumValues() []ListNetworkSecurityGroupVnicsSortByEnum { values := make([]ListNetworkSecurityGroupVnicsSortByEnum, 0) for _, v := range mappingListNetworkSecurityGroupVnicsSortBy { values = append(values, v) } return values } // ListNetworkSecurityGroupVnicsSortOrderEnum Enum with underlying type: string type ListNetworkSecurityGroupVnicsSortOrderEnum string // Set of constants representing the allowable values for ListNetworkSecurityGroupVnicsSortOrderEnum const ( ListNetworkSecurityGroupVnicsSortOrderAsc ListNetworkSecurityGroupVnicsSortOrderEnum = "ASC" ListNetworkSecurityGroupVnicsSortOrderDesc ListNetworkSecurityGroupVnicsSortOrderEnum = "DESC" ) var mappingListNetworkSecurityGroupVnicsSortOrder = map[string]ListNetworkSecurityGroupVnicsSortOrderEnum{ "ASC": ListNetworkSecurityGroupVnicsSortOrderAsc, "DESC": ListNetworkSecurityGroupVnicsSortOrderDesc, } // GetListNetworkSecurityGroupVnicsSortOrderEnumValues Enumerates the set of values for ListNetworkSecurityGroupVnicsSortOrderEnum func GetListNetworkSecurityGroupVnicsSortOrderEnumValues() []ListNetworkSecurityGroupVnicsSortOrderEnum { values := make([]ListNetworkSecurityGroupVnicsSortOrderEnum, 0) for _, v := range mappingListNetworkSecurityGroupVnicsSortOrder { values = append(values, v) } return values } ���������������������������������������������������������������������list_network_security_groups_request_response.go����������������������������������������������������0000664�0000000�0000000�00000015745�13771713062�0035174�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListNetworkSecurityGroupsRequest wrapper for the ListNetworkSecurityGroups operation type ListNetworkSecurityGroupsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"false" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListNetworkSecurityGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListNetworkSecurityGroupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState NetworkSecurityGroupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListNetworkSecurityGroupsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListNetworkSecurityGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListNetworkSecurityGroupsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListNetworkSecurityGroupsResponse wrapper for the ListNetworkSecurityGroups operation type ListNetworkSecurityGroupsResponse struct { // The underlying http response RawResponse *http.Response // A list of []NetworkSecurityGroup instances Items []NetworkSecurityGroup `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListNetworkSecurityGroupsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListNetworkSecurityGroupsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListNetworkSecurityGroupsSortByEnum Enum with underlying type: string type ListNetworkSecurityGroupsSortByEnum string // Set of constants representing the allowable values for ListNetworkSecurityGroupsSortByEnum const ( ListNetworkSecurityGroupsSortByTimecreated ListNetworkSecurityGroupsSortByEnum = "TIMECREATED" ListNetworkSecurityGroupsSortByDisplayname ListNetworkSecurityGroupsSortByEnum = "DISPLAYNAME" ) var mappingListNetworkSecurityGroupsSortBy = map[string]ListNetworkSecurityGroupsSortByEnum{ "TIMECREATED": ListNetworkSecurityGroupsSortByTimecreated, "DISPLAYNAME": ListNetworkSecurityGroupsSortByDisplayname, } // GetListNetworkSecurityGroupsSortByEnumValues Enumerates the set of values for ListNetworkSecurityGroupsSortByEnum func GetListNetworkSecurityGroupsSortByEnumValues() []ListNetworkSecurityGroupsSortByEnum { values := make([]ListNetworkSecurityGroupsSortByEnum, 0) for _, v := range mappingListNetworkSecurityGroupsSortBy { values = append(values, v) } return values } // ListNetworkSecurityGroupsSortOrderEnum Enum with underlying type: string type ListNetworkSecurityGroupsSortOrderEnum string // Set of constants representing the allowable values for ListNetworkSecurityGroupsSortOrderEnum const ( ListNetworkSecurityGroupsSortOrderAsc ListNetworkSecurityGroupsSortOrderEnum = "ASC" ListNetworkSecurityGroupsSortOrderDesc ListNetworkSecurityGroupsSortOrderEnum = "DESC" ) var mappingListNetworkSecurityGroupsSortOrder = map[string]ListNetworkSecurityGroupsSortOrderEnum{ "ASC": ListNetworkSecurityGroupsSortOrderAsc, "DESC": ListNetworkSecurityGroupsSortOrderDesc, } // GetListNetworkSecurityGroupsSortOrderEnumValues Enumerates the set of values for ListNetworkSecurityGroupsSortOrderEnum func GetListNetworkSecurityGroupsSortOrderEnumValues() []ListNetworkSecurityGroupsSortOrderEnum { values := make([]ListNetworkSecurityGroupsSortOrderEnum, 0) for _, v := range mappingListNetworkSecurityGroupsSortOrder { values = append(values, v) } return values } ���������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_private_ips_request_response.go������0000664�0000000�0000000�00000007076�13771713062�0032557�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListPrivateIpsRequest wrapper for the ListPrivateIps operation type ListPrivateIpsRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // An IP address. This could be either IPv4 or IPv6, depending on the resource. // Example: `10.0.3.3` IpAddress *string `mandatory:"false" contributesTo:"query" name:"ipAddress"` // The OCID of the subnet. SubnetId *string `mandatory:"false" contributesTo:"query" name:"subnetId"` // The OCID of the VNIC. VnicId *string `mandatory:"false" contributesTo:"query" name:"vnicId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListPrivateIpsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListPrivateIpsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListPrivateIpsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListPrivateIpsResponse wrapper for the ListPrivateIps operation type ListPrivateIpsResponse struct { // The underlying http response RawResponse *http.Response // A list of []PrivateIp instances Items []PrivateIp `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListPrivateIpsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListPrivateIpsResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_public_ips_request_response.go�������0000664�0000000�0000000�00000014115�13771713062�0032353�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListPublicIpsRequest wrapper for the ListPublicIps operation type ListPublicIpsRequest struct { // Whether the public IP is regional or specific to a particular availability domain. // * `REGION`: The public IP exists within a region and is assigned to a regional entity // (such as a NatGateway), or can be assigned to a private IP // in any availability domain in the region. Reserved public IPs have `scope` = `REGION`, as do // ephemeral public IPs assigned to a regional entity. // * `AVAILABILITY_DOMAIN`: The public IP exists within the availability domain of the entity // it's assigned to, which is specified by the `availabilityDomain` property of the public IP object. // Ephemeral public IPs that are assigned to private IPs have `scope` = `AVAILABILITY_DOMAIN`. Scope ListPublicIpsScopeEnum `mandatory:"true" contributesTo:"query" name:"scope" omitEmpty:"true"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // A filter to return only public IPs that match given lifetime. Lifetime ListPublicIpsLifetimeEnum `mandatory:"false" contributesTo:"query" name:"lifetime" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListPublicIpsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListPublicIpsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListPublicIpsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListPublicIpsResponse wrapper for the ListPublicIps operation type ListPublicIpsResponse struct { // The underlying http response RawResponse *http.Response // A list of []PublicIp instances Items []PublicIp `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListPublicIpsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListPublicIpsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListPublicIpsScopeEnum Enum with underlying type: string type ListPublicIpsScopeEnum string // Set of constants representing the allowable values for ListPublicIpsScopeEnum const ( ListPublicIpsScopeRegion ListPublicIpsScopeEnum = "REGION" ListPublicIpsScopeAvailabilityDomain ListPublicIpsScopeEnum = "AVAILABILITY_DOMAIN" ) var mappingListPublicIpsScope = map[string]ListPublicIpsScopeEnum{ "REGION": ListPublicIpsScopeRegion, "AVAILABILITY_DOMAIN": ListPublicIpsScopeAvailabilityDomain, } // GetListPublicIpsScopeEnumValues Enumerates the set of values for ListPublicIpsScopeEnum func GetListPublicIpsScopeEnumValues() []ListPublicIpsScopeEnum { values := make([]ListPublicIpsScopeEnum, 0) for _, v := range mappingListPublicIpsScope { values = append(values, v) } return values } // ListPublicIpsLifetimeEnum Enum with underlying type: string type ListPublicIpsLifetimeEnum string // Set of constants representing the allowable values for ListPublicIpsLifetimeEnum const ( ListPublicIpsLifetimeEphemeral ListPublicIpsLifetimeEnum = "EPHEMERAL" ListPublicIpsLifetimeReserved ListPublicIpsLifetimeEnum = "RESERVED" ) var mappingListPublicIpsLifetime = map[string]ListPublicIpsLifetimeEnum{ "EPHEMERAL": ListPublicIpsLifetimeEphemeral, "RESERVED": ListPublicIpsLifetimeReserved, } // GetListPublicIpsLifetimeEnumValues Enumerates the set of values for ListPublicIpsLifetimeEnum func GetListPublicIpsLifetimeEnumValues() []ListPublicIpsLifetimeEnum { values := make([]ListPublicIpsLifetimeEnum, 0) for _, v := range mappingListPublicIpsLifetime { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_remote_peering_connections_request_response.go�������������������������������������������������0000664�0000000�0000000�00000007220�13771713062�0035550�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListRemotePeeringConnectionsRequest wrapper for the ListRemotePeeringConnections operation type ListRemotePeeringConnectionsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the DRG. DrgId *string `mandatory:"false" contributesTo:"query" name:"drgId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListRemotePeeringConnectionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListRemotePeeringConnectionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListRemotePeeringConnectionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListRemotePeeringConnectionsResponse wrapper for the ListRemotePeeringConnections operation type ListRemotePeeringConnectionsResponse struct { // The underlying http response RawResponse *http.Response // A list of []RemotePeeringConnection instances Items []RemotePeeringConnection `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListRemotePeeringConnectionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListRemotePeeringConnectionsResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_route_tables_request_response.go�����0000664�0000000�0000000�00000014763�13771713062�0032723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListRouteTablesRequest wrapper for the ListRouteTables operation type ListRouteTablesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListRouteTablesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListRouteTablesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState RouteTableLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListRouteTablesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListRouteTablesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListRouteTablesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListRouteTablesResponse wrapper for the ListRouteTables operation type ListRouteTablesResponse struct { // The underlying http response RawResponse *http.Response // A list of []RouteTable instances Items []RouteTable `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListRouteTablesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListRouteTablesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListRouteTablesSortByEnum Enum with underlying type: string type ListRouteTablesSortByEnum string // Set of constants representing the allowable values for ListRouteTablesSortByEnum const ( ListRouteTablesSortByTimecreated ListRouteTablesSortByEnum = "TIMECREATED" ListRouteTablesSortByDisplayname ListRouteTablesSortByEnum = "DISPLAYNAME" ) var mappingListRouteTablesSortBy = map[string]ListRouteTablesSortByEnum{ "TIMECREATED": ListRouteTablesSortByTimecreated, "DISPLAYNAME": ListRouteTablesSortByDisplayname, } // GetListRouteTablesSortByEnumValues Enumerates the set of values for ListRouteTablesSortByEnum func GetListRouteTablesSortByEnumValues() []ListRouteTablesSortByEnum { values := make([]ListRouteTablesSortByEnum, 0) for _, v := range mappingListRouteTablesSortBy { values = append(values, v) } return values } // ListRouteTablesSortOrderEnum Enum with underlying type: string type ListRouteTablesSortOrderEnum string // Set of constants representing the allowable values for ListRouteTablesSortOrderEnum const ( ListRouteTablesSortOrderAsc ListRouteTablesSortOrderEnum = "ASC" ListRouteTablesSortOrderDesc ListRouteTablesSortOrderEnum = "DESC" ) var mappingListRouteTablesSortOrder = map[string]ListRouteTablesSortOrderEnum{ "ASC": ListRouteTablesSortOrderAsc, "DESC": ListRouteTablesSortOrderDesc, } // GetListRouteTablesSortOrderEnumValues Enumerates the set of values for ListRouteTablesSortOrderEnum func GetListRouteTablesSortOrderEnumValues() []ListRouteTablesSortOrderEnum { values := make([]ListRouteTablesSortOrderEnum, 0) for _, v := range mappingListRouteTablesSortOrder { values = append(values, v) } return values } �������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_security_lists_request_response.go���0000664�0000000�0000000�00000015127�13771713062�0033313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListSecurityListsRequest wrapper for the ListSecurityLists operation type ListSecurityListsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListSecurityListsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListSecurityListsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState SecurityListLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListSecurityListsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListSecurityListsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListSecurityListsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListSecurityListsResponse wrapper for the ListSecurityLists operation type ListSecurityListsResponse struct { // The underlying http response RawResponse *http.Response // A list of []SecurityList instances Items []SecurityList `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListSecurityListsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListSecurityListsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListSecurityListsSortByEnum Enum with underlying type: string type ListSecurityListsSortByEnum string // Set of constants representing the allowable values for ListSecurityListsSortByEnum const ( ListSecurityListsSortByTimecreated ListSecurityListsSortByEnum = "TIMECREATED" ListSecurityListsSortByDisplayname ListSecurityListsSortByEnum = "DISPLAYNAME" ) var mappingListSecurityListsSortBy = map[string]ListSecurityListsSortByEnum{ "TIMECREATED": ListSecurityListsSortByTimecreated, "DISPLAYNAME": ListSecurityListsSortByDisplayname, } // GetListSecurityListsSortByEnumValues Enumerates the set of values for ListSecurityListsSortByEnum func GetListSecurityListsSortByEnumValues() []ListSecurityListsSortByEnum { values := make([]ListSecurityListsSortByEnum, 0) for _, v := range mappingListSecurityListsSortBy { values = append(values, v) } return values } // ListSecurityListsSortOrderEnum Enum with underlying type: string type ListSecurityListsSortOrderEnum string // Set of constants representing the allowable values for ListSecurityListsSortOrderEnum const ( ListSecurityListsSortOrderAsc ListSecurityListsSortOrderEnum = "ASC" ListSecurityListsSortOrderDesc ListSecurityListsSortOrderEnum = "DESC" ) var mappingListSecurityListsSortOrder = map[string]ListSecurityListsSortOrderEnum{ "ASC": ListSecurityListsSortOrderAsc, "DESC": ListSecurityListsSortOrderDesc, } // GetListSecurityListsSortOrderEnumValues Enumerates the set of values for ListSecurityListsSortOrderEnum func GetListSecurityListsSortOrderEnumValues() []ListSecurityListsSortOrderEnum { values := make([]ListSecurityListsSortOrderEnum, 0) for _, v := range mappingListSecurityListsSortOrder { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_service_gateways_request_response.go�0000664�0000000�0000000�00000015030�13771713062�0033563�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListServiceGatewaysRequest wrapper for the ListServiceGateways operation type ListServiceGatewaysRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"false" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListServiceGatewaysSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListServiceGatewaysSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState ServiceGatewayLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListServiceGatewaysRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListServiceGatewaysRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListServiceGatewaysRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListServiceGatewaysResponse wrapper for the ListServiceGateways operation type ListServiceGatewaysResponse struct { // The underlying http response RawResponse *http.Response // A list of []ServiceGateway instances Items []ServiceGateway `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListServiceGatewaysResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListServiceGatewaysResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListServiceGatewaysSortByEnum Enum with underlying type: string type ListServiceGatewaysSortByEnum string // Set of constants representing the allowable values for ListServiceGatewaysSortByEnum const ( ListServiceGatewaysSortByTimecreated ListServiceGatewaysSortByEnum = "TIMECREATED" ListServiceGatewaysSortByDisplayname ListServiceGatewaysSortByEnum = "DISPLAYNAME" ) var mappingListServiceGatewaysSortBy = map[string]ListServiceGatewaysSortByEnum{ "TIMECREATED": ListServiceGatewaysSortByTimecreated, "DISPLAYNAME": ListServiceGatewaysSortByDisplayname, } // GetListServiceGatewaysSortByEnumValues Enumerates the set of values for ListServiceGatewaysSortByEnum func GetListServiceGatewaysSortByEnumValues() []ListServiceGatewaysSortByEnum { values := make([]ListServiceGatewaysSortByEnum, 0) for _, v := range mappingListServiceGatewaysSortBy { values = append(values, v) } return values } // ListServiceGatewaysSortOrderEnum Enum with underlying type: string type ListServiceGatewaysSortOrderEnum string // Set of constants representing the allowable values for ListServiceGatewaysSortOrderEnum const ( ListServiceGatewaysSortOrderAsc ListServiceGatewaysSortOrderEnum = "ASC" ListServiceGatewaysSortOrderDesc ListServiceGatewaysSortOrderEnum = "DESC" ) var mappingListServiceGatewaysSortOrder = map[string]ListServiceGatewaysSortOrderEnum{ "ASC": ListServiceGatewaysSortOrderAsc, "DESC": ListServiceGatewaysSortOrderDesc, } // GetListServiceGatewaysSortOrderEnumValues Enumerates the set of values for ListServiceGatewaysSortOrderEnum func GetListServiceGatewaysSortOrderEnumValues() []ListServiceGatewaysSortOrderEnum { values := make([]ListServiceGatewaysSortOrderEnum, 0) for _, v := range mappingListServiceGatewaysSortOrder { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_services_request_response.go���������0000664�0000000�0000000�00000006240�13771713062�0032045�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListServicesRequest wrapper for the ListServices operation type ListServicesRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListServicesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListServicesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListServicesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListServicesResponse wrapper for the ListServices operation type ListServicesResponse struct { // The underlying http response RawResponse *http.Response // A list of []Service instances Items []Service `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListServicesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListServicesResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_shapes_request_response.go�����������0000664�0000000�0000000�00000007240�13771713062�0031506�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListShapesRequest wrapper for the ListShapes operation type ListShapesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of an image. ImageId *string `mandatory:"false" contributesTo:"query" name:"imageId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListShapesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListShapesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListShapesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListShapesResponse wrapper for the ListShapes operation type ListShapesResponse struct { // The underlying http response RawResponse *http.Response // A list of []Shape instances Items []Shape `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListShapesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_subnets_request_response.go����������0000664�0000000�0000000�00000014453�13771713062�0031712�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListSubnetsRequest wrapper for the ListSubnets operation type ListSubnetsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"query" name:"vcnId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListSubnetsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListSubnetsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState SubnetLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListSubnetsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListSubnetsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListSubnetsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListSubnetsResponse wrapper for the ListSubnets operation type ListSubnetsResponse struct { // The underlying http response RawResponse *http.Response // A list of []Subnet instances Items []Subnet `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListSubnetsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListSubnetsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListSubnetsSortByEnum Enum with underlying type: string type ListSubnetsSortByEnum string // Set of constants representing the allowable values for ListSubnetsSortByEnum const ( ListSubnetsSortByTimecreated ListSubnetsSortByEnum = "TIMECREATED" ListSubnetsSortByDisplayname ListSubnetsSortByEnum = "DISPLAYNAME" ) var mappingListSubnetsSortBy = map[string]ListSubnetsSortByEnum{ "TIMECREATED": ListSubnetsSortByTimecreated, "DISPLAYNAME": ListSubnetsSortByDisplayname, } // GetListSubnetsSortByEnumValues Enumerates the set of values for ListSubnetsSortByEnum func GetListSubnetsSortByEnumValues() []ListSubnetsSortByEnum { values := make([]ListSubnetsSortByEnum, 0) for _, v := range mappingListSubnetsSortBy { values = append(values, v) } return values } // ListSubnetsSortOrderEnum Enum with underlying type: string type ListSubnetsSortOrderEnum string // Set of constants representing the allowable values for ListSubnetsSortOrderEnum const ( ListSubnetsSortOrderAsc ListSubnetsSortOrderEnum = "ASC" ListSubnetsSortOrderDesc ListSubnetsSortOrderEnum = "DESC" ) var mappingListSubnetsSortOrder = map[string]ListSubnetsSortOrderEnum{ "ASC": ListSubnetsSortOrderAsc, "DESC": ListSubnetsSortOrderDesc, } // GetListSubnetsSortOrderEnumValues Enumerates the set of values for ListSubnetsSortOrderEnum func GetListSubnetsSortOrderEnumValues() []ListSubnetsSortOrderEnum { values := make([]ListSubnetsSortOrderEnum, 0) for _, v := range mappingListSubnetsSortOrder { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_vcns_request_response.go�������������0000664�0000000�0000000�00000013755�13771713062�0031204�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVcnsRequest wrapper for the ListVcns operation type ListVcnsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVcnsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListVcnsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState VcnLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVcnsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVcnsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVcnsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVcnsResponse wrapper for the ListVcns operation type ListVcnsResponse struct { // The underlying http response RawResponse *http.Response // A list of []Vcn instances Items []Vcn `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVcnsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVcnsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListVcnsSortByEnum Enum with underlying type: string type ListVcnsSortByEnum string // Set of constants representing the allowable values for ListVcnsSortByEnum const ( ListVcnsSortByTimecreated ListVcnsSortByEnum = "TIMECREATED" ListVcnsSortByDisplayname ListVcnsSortByEnum = "DISPLAYNAME" ) var mappingListVcnsSortBy = map[string]ListVcnsSortByEnum{ "TIMECREATED": ListVcnsSortByTimecreated, "DISPLAYNAME": ListVcnsSortByDisplayname, } // GetListVcnsSortByEnumValues Enumerates the set of values for ListVcnsSortByEnum func GetListVcnsSortByEnumValues() []ListVcnsSortByEnum { values := make([]ListVcnsSortByEnum, 0) for _, v := range mappingListVcnsSortBy { values = append(values, v) } return values } // ListVcnsSortOrderEnum Enum with underlying type: string type ListVcnsSortOrderEnum string // Set of constants representing the allowable values for ListVcnsSortOrderEnum const ( ListVcnsSortOrderAsc ListVcnsSortOrderEnum = "ASC" ListVcnsSortOrderDesc ListVcnsSortOrderEnum = "DESC" ) var mappingListVcnsSortOrder = map[string]ListVcnsSortOrderEnum{ "ASC": ListVcnsSortOrderAsc, "DESC": ListVcnsSortOrderDesc, } // GetListVcnsSortOrderEnumValues Enumerates the set of values for ListVcnsSortOrderEnum func GetListVcnsSortOrderEnumValues() []ListVcnsSortOrderEnum { values := make([]ListVcnsSortOrderEnum, 0) for _, v := range mappingListVcnsSortOrder { values = append(values, v) } return values } �������������������list_virtual_circuit_bandwidth_shapes_request_response.go�������������������������������������������0000664�0000000�0000000�00000007161�13771713062�0036745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVirtualCircuitBandwidthShapesRequest wrapper for the ListVirtualCircuitBandwidthShapes operation type ListVirtualCircuitBandwidthShapesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVirtualCircuitBandwidthShapesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVirtualCircuitBandwidthShapesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVirtualCircuitBandwidthShapesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVirtualCircuitBandwidthShapesResponse wrapper for the ListVirtualCircuitBandwidthShapes operation type ListVirtualCircuitBandwidthShapesResponse struct { // The underlying http response RawResponse *http.Response // A list of []VirtualCircuitBandwidthShape instances Items []VirtualCircuitBandwidthShape `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVirtualCircuitBandwidthShapesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVirtualCircuitBandwidthShapesResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_virtual_circuit_public_prefixes_request_response.go��������������������������������������������0000664�0000000�0000000�00000005477�13771713062�0036631�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVirtualCircuitPublicPrefixesRequest wrapper for the ListVirtualCircuitPublicPrefixes operation type ListVirtualCircuitPublicPrefixesRequest struct { // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` // A filter to only return resources that match the given verification state. // The state value is case-insensitive. VerificationState VirtualCircuitPublicPrefixVerificationStateEnum `mandatory:"false" contributesTo:"query" name:"verificationState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVirtualCircuitPublicPrefixesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVirtualCircuitPublicPrefixesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVirtualCircuitPublicPrefixesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVirtualCircuitPublicPrefixesResponse wrapper for the ListVirtualCircuitPublicPrefixes operation type ListVirtualCircuitPublicPrefixesResponse struct { // The underlying http response RawResponse *http.Response // The []VirtualCircuitPublicPrefix instance Items []VirtualCircuitPublicPrefix `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVirtualCircuitPublicPrefixesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVirtualCircuitPublicPrefixesResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_virtual_circuits_request_response.go�0000664�0000000�0000000�00000015020�13771713062�0033611�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVirtualCircuitsRequest wrapper for the ListVirtualCircuits operation type ListVirtualCircuitsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVirtualCircuitsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListVirtualCircuitsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to return only resources that match the specified lifecycle state. The value is case insensitive. LifecycleState VirtualCircuitLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVirtualCircuitsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVirtualCircuitsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVirtualCircuitsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVirtualCircuitsResponse wrapper for the ListVirtualCircuits operation type ListVirtualCircuitsResponse struct { // The underlying http response RawResponse *http.Response // A list of []VirtualCircuit instances Items []VirtualCircuit `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVirtualCircuitsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVirtualCircuitsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListVirtualCircuitsSortByEnum Enum with underlying type: string type ListVirtualCircuitsSortByEnum string // Set of constants representing the allowable values for ListVirtualCircuitsSortByEnum const ( ListVirtualCircuitsSortByTimecreated ListVirtualCircuitsSortByEnum = "TIMECREATED" ListVirtualCircuitsSortByDisplayname ListVirtualCircuitsSortByEnum = "DISPLAYNAME" ) var mappingListVirtualCircuitsSortBy = map[string]ListVirtualCircuitsSortByEnum{ "TIMECREATED": ListVirtualCircuitsSortByTimecreated, "DISPLAYNAME": ListVirtualCircuitsSortByDisplayname, } // GetListVirtualCircuitsSortByEnumValues Enumerates the set of values for ListVirtualCircuitsSortByEnum func GetListVirtualCircuitsSortByEnumValues() []ListVirtualCircuitsSortByEnum { values := make([]ListVirtualCircuitsSortByEnum, 0) for _, v := range mappingListVirtualCircuitsSortBy { values = append(values, v) } return values } // ListVirtualCircuitsSortOrderEnum Enum with underlying type: string type ListVirtualCircuitsSortOrderEnum string // Set of constants representing the allowable values for ListVirtualCircuitsSortOrderEnum const ( ListVirtualCircuitsSortOrderAsc ListVirtualCircuitsSortOrderEnum = "ASC" ListVirtualCircuitsSortOrderDesc ListVirtualCircuitsSortOrderEnum = "DESC" ) var mappingListVirtualCircuitsSortOrder = map[string]ListVirtualCircuitsSortOrderEnum{ "ASC": ListVirtualCircuitsSortOrderAsc, "DESC": ListVirtualCircuitsSortOrderDesc, } // GetListVirtualCircuitsSortOrderEnumValues Enumerates the set of values for ListVirtualCircuitsSortOrderEnum func GetListVirtualCircuitsSortOrderEnumValues() []ListVirtualCircuitsSortOrderEnum { values := make([]ListVirtualCircuitsSortOrderEnum, 0) for _, v := range mappingListVirtualCircuitsSortOrder { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_vnic_attachments_request_response.go�0000664�0000000�0000000�00000007464�13771713062�0033565�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVnicAttachmentsRequest wrapper for the ListVnicAttachments operation type ListVnicAttachmentsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // The OCID of the instance. InstanceId *string `mandatory:"false" contributesTo:"query" name:"instanceId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the VNIC. VnicId *string `mandatory:"false" contributesTo:"query" name:"vnicId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVnicAttachmentsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVnicAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVnicAttachmentsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVnicAttachmentsResponse wrapper for the ListVnicAttachments operation type ListVnicAttachmentsResponse struct { // The underlying http response RawResponse *http.Response // A list of []VnicAttachment instances Items []VnicAttachment `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVnicAttachmentsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVnicAttachmentsResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_volume_attachments_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000007524�13771713062�0034053�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVolumeAttachmentsRequest wrapper for the ListVolumeAttachments operation type ListVolumeAttachmentsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the instance. InstanceId *string `mandatory:"false" contributesTo:"query" name:"instanceId"` // The OCID of the volume. VolumeId *string `mandatory:"false" contributesTo:"query" name:"volumeId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVolumeAttachmentsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVolumeAttachmentsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVolumeAttachmentsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVolumeAttachmentsResponse wrapper for the ListVolumeAttachments operation type ListVolumeAttachmentsResponse struct { // The underlying http response RawResponse *http.Response // A list of []VolumeAttachment instances Items []VolumeAttachment `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVolumeAttachmentsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVolumeAttachmentsResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_volume_backup_policies_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000007005�13771713062�0034666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVolumeBackupPoliciesRequest wrapper for the ListVolumeBackupPolicies operation type ListVolumeBackupPoliciesRequest struct { // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // The OCID of the compartment. // If no compartment is specified, the Oracle defined backup policies are listed. CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVolumeBackupPoliciesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVolumeBackupPoliciesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVolumeBackupPoliciesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVolumeBackupPoliciesResponse wrapper for the ListVolumeBackupPolicies operation type ListVolumeBackupPoliciesResponse struct { // The underlying http response RawResponse *http.Response // A list of []VolumeBackupPolicy instances Items []VolumeBackupPolicy `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVolumeBackupPoliciesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVolumeBackupPoliciesResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_volume_backups_request_response.go���0000664�0000000�0000000�00000015330�13771713062�0033241�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVolumeBackupsRequest wrapper for the ListVolumeBackups operation type ListVolumeBackupsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the volume. VolumeId *string `mandatory:"false" contributesTo:"query" name:"volumeId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // A filter to return only resources that originated from the given source volume backup. SourceVolumeBackupId *string `mandatory:"false" contributesTo:"query" name:"sourceVolumeBackupId"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVolumeBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListVolumeBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState VolumeBackupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVolumeBackupsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVolumeBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVolumeBackupsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVolumeBackupsResponse wrapper for the ListVolumeBackups operation type ListVolumeBackupsResponse struct { // The underlying http response RawResponse *http.Response // A list of []VolumeBackup instances Items []VolumeBackup `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVolumeBackupsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVolumeBackupsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListVolumeBackupsSortByEnum Enum with underlying type: string type ListVolumeBackupsSortByEnum string // Set of constants representing the allowable values for ListVolumeBackupsSortByEnum const ( ListVolumeBackupsSortByTimecreated ListVolumeBackupsSortByEnum = "TIMECREATED" ListVolumeBackupsSortByDisplayname ListVolumeBackupsSortByEnum = "DISPLAYNAME" ) var mappingListVolumeBackupsSortBy = map[string]ListVolumeBackupsSortByEnum{ "TIMECREATED": ListVolumeBackupsSortByTimecreated, "DISPLAYNAME": ListVolumeBackupsSortByDisplayname, } // GetListVolumeBackupsSortByEnumValues Enumerates the set of values for ListVolumeBackupsSortByEnum func GetListVolumeBackupsSortByEnumValues() []ListVolumeBackupsSortByEnum { values := make([]ListVolumeBackupsSortByEnum, 0) for _, v := range mappingListVolumeBackupsSortBy { values = append(values, v) } return values } // ListVolumeBackupsSortOrderEnum Enum with underlying type: string type ListVolumeBackupsSortOrderEnum string // Set of constants representing the allowable values for ListVolumeBackupsSortOrderEnum const ( ListVolumeBackupsSortOrderAsc ListVolumeBackupsSortOrderEnum = "ASC" ListVolumeBackupsSortOrderDesc ListVolumeBackupsSortOrderEnum = "DESC" ) var mappingListVolumeBackupsSortOrder = map[string]ListVolumeBackupsSortOrderEnum{ "ASC": ListVolumeBackupsSortOrderAsc, "DESC": ListVolumeBackupsSortOrderDesc, } // GetListVolumeBackupsSortOrderEnumValues Enumerates the set of values for ListVolumeBackupsSortOrderEnum func GetListVolumeBackupsSortOrderEnumValues() []ListVolumeBackupsSortOrderEnum { values := make([]ListVolumeBackupsSortOrderEnum, 0) for _, v := range mappingListVolumeBackupsSortOrder { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������list_volume_group_backups_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000015052�13771713062�0034377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVolumeGroupBackupsRequest wrapper for the ListVolumeGroupBackups operation type ListVolumeGroupBackupsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The OCID of the volume group. VolumeGroupId *string `mandatory:"false" contributesTo:"query" name:"volumeGroupId"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVolumeGroupBackupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListVolumeGroupBackupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVolumeGroupBackupsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVolumeGroupBackupsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVolumeGroupBackupsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVolumeGroupBackupsResponse wrapper for the ListVolumeGroupBackups operation type ListVolumeGroupBackupsResponse struct { // The underlying http response RawResponse *http.Response // A list of []VolumeGroupBackup instances Items []VolumeGroupBackup `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVolumeGroupBackupsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVolumeGroupBackupsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListVolumeGroupBackupsSortByEnum Enum with underlying type: string type ListVolumeGroupBackupsSortByEnum string // Set of constants representing the allowable values for ListVolumeGroupBackupsSortByEnum const ( ListVolumeGroupBackupsSortByTimecreated ListVolumeGroupBackupsSortByEnum = "TIMECREATED" ListVolumeGroupBackupsSortByDisplayname ListVolumeGroupBackupsSortByEnum = "DISPLAYNAME" ) var mappingListVolumeGroupBackupsSortBy = map[string]ListVolumeGroupBackupsSortByEnum{ "TIMECREATED": ListVolumeGroupBackupsSortByTimecreated, "DISPLAYNAME": ListVolumeGroupBackupsSortByDisplayname, } // GetListVolumeGroupBackupsSortByEnumValues Enumerates the set of values for ListVolumeGroupBackupsSortByEnum func GetListVolumeGroupBackupsSortByEnumValues() []ListVolumeGroupBackupsSortByEnum { values := make([]ListVolumeGroupBackupsSortByEnum, 0) for _, v := range mappingListVolumeGroupBackupsSortBy { values = append(values, v) } return values } // ListVolumeGroupBackupsSortOrderEnum Enum with underlying type: string type ListVolumeGroupBackupsSortOrderEnum string // Set of constants representing the allowable values for ListVolumeGroupBackupsSortOrderEnum const ( ListVolumeGroupBackupsSortOrderAsc ListVolumeGroupBackupsSortOrderEnum = "ASC" ListVolumeGroupBackupsSortOrderDesc ListVolumeGroupBackupsSortOrderEnum = "DESC" ) var mappingListVolumeGroupBackupsSortOrder = map[string]ListVolumeGroupBackupsSortOrderEnum{ "ASC": ListVolumeGroupBackupsSortOrderAsc, "DESC": ListVolumeGroupBackupsSortOrderDesc, } // GetListVolumeGroupBackupsSortOrderEnumValues Enumerates the set of values for ListVolumeGroupBackupsSortOrderEnum func GetListVolumeGroupBackupsSortOrderEnumValues() []ListVolumeGroupBackupsSortOrderEnum { values := make([]ListVolumeGroupBackupsSortOrderEnum, 0) for _, v := range mappingListVolumeGroupBackupsSortOrder { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_volume_groups_request_response.go����0000664�0000000�0000000�00000015044�13771713062�0033132�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVolumeGroupsRequest wrapper for the ListVolumeGroups operation type ListVolumeGroupsRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVolumeGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListVolumeGroupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState VolumeGroupLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVolumeGroupsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVolumeGroupsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVolumeGroupsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVolumeGroupsResponse wrapper for the ListVolumeGroups operation type ListVolumeGroupsResponse struct { // The underlying http response RawResponse *http.Response // A list of []VolumeGroup instances Items []VolumeGroup `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVolumeGroupsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVolumeGroupsResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListVolumeGroupsSortByEnum Enum with underlying type: string type ListVolumeGroupsSortByEnum string // Set of constants representing the allowable values for ListVolumeGroupsSortByEnum const ( ListVolumeGroupsSortByTimecreated ListVolumeGroupsSortByEnum = "TIMECREATED" ListVolumeGroupsSortByDisplayname ListVolumeGroupsSortByEnum = "DISPLAYNAME" ) var mappingListVolumeGroupsSortBy = map[string]ListVolumeGroupsSortByEnum{ "TIMECREATED": ListVolumeGroupsSortByTimecreated, "DISPLAYNAME": ListVolumeGroupsSortByDisplayname, } // GetListVolumeGroupsSortByEnumValues Enumerates the set of values for ListVolumeGroupsSortByEnum func GetListVolumeGroupsSortByEnumValues() []ListVolumeGroupsSortByEnum { values := make([]ListVolumeGroupsSortByEnum, 0) for _, v := range mappingListVolumeGroupsSortBy { values = append(values, v) } return values } // ListVolumeGroupsSortOrderEnum Enum with underlying type: string type ListVolumeGroupsSortOrderEnum string // Set of constants representing the allowable values for ListVolumeGroupsSortOrderEnum const ( ListVolumeGroupsSortOrderAsc ListVolumeGroupsSortOrderEnum = "ASC" ListVolumeGroupsSortOrderDesc ListVolumeGroupsSortOrderEnum = "DESC" ) var mappingListVolumeGroupsSortOrder = map[string]ListVolumeGroupsSortOrderEnum{ "ASC": ListVolumeGroupsSortOrderAsc, "DESC": ListVolumeGroupsSortOrderDesc, } // GetListVolumeGroupsSortOrderEnumValues Enumerates the set of values for ListVolumeGroupsSortOrderEnum func GetListVolumeGroupsSortOrderEnumValues() []ListVolumeGroupsSortOrderEnum { values := make([]ListVolumeGroupsSortOrderEnum, 0) for _, v := range mappingListVolumeGroupsSortOrder { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/list_volumes_request_response.go����������0000664�0000000�0000000�00000014643�13771713062�0031722�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListVolumesRequest wrapper for the ListVolumes operation type ListVolumesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment. CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` // The name of the availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" contributesTo:"query" name:"availabilityDomain"` // For list pagination. The maximum number of results per page, or items to return in a paginated // "List" call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). // Example: `50` Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` // For list pagination. The value of the `opc-next-page` response header from the previous "List" // call. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). Page *string `mandatory:"false" contributesTo:"query" name:"page"` // A filter to return only resources that match the given display name exactly. DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` // The field to sort by. You can provide one sort order (`sortOrder`). Default order for // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME // sort order is case sensitive. // **Note:** In general, some "List" operations (for example, `ListInstances`) let you // optionally filter by availability domain if the scope of the resource type is within a // single availability domain. If you call one of these "List" operations without specifying // an availability domain, the resources are grouped by availability domain, then sorted. SortBy ListVolumesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` // The sort order to use, either ascending (`ASC`) or descending (`DESC`). The DISPLAYNAME sort order // is case sensitive. SortOrder ListVolumesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` // The OCID of the volume group. VolumeGroupId *string `mandatory:"false" contributesTo:"query" name:"volumeGroupId"` // A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. LifecycleState VolumeLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ListVolumesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ListVolumesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ListVolumesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ListVolumesResponse wrapper for the ListVolumes operation type ListVolumesResponse struct { // The underlying http response RawResponse *http.Response // A list of []Volume instances Items []Volume `presentIn:"body"` // For list pagination. When this header appears in the response, additional pages // of results remain. For important details about how pagination works, see // List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). OpcNextPage *string `presentIn:"header" name:"opc-next-page"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ListVolumesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ListVolumesResponse) HTTPResponse() *http.Response { return response.RawResponse } // ListVolumesSortByEnum Enum with underlying type: string type ListVolumesSortByEnum string // Set of constants representing the allowable values for ListVolumesSortByEnum const ( ListVolumesSortByTimecreated ListVolumesSortByEnum = "TIMECREATED" ListVolumesSortByDisplayname ListVolumesSortByEnum = "DISPLAYNAME" ) var mappingListVolumesSortBy = map[string]ListVolumesSortByEnum{ "TIMECREATED": ListVolumesSortByTimecreated, "DISPLAYNAME": ListVolumesSortByDisplayname, } // GetListVolumesSortByEnumValues Enumerates the set of values for ListVolumesSortByEnum func GetListVolumesSortByEnumValues() []ListVolumesSortByEnum { values := make([]ListVolumesSortByEnum, 0) for _, v := range mappingListVolumesSortBy { values = append(values, v) } return values } // ListVolumesSortOrderEnum Enum with underlying type: string type ListVolumesSortOrderEnum string // Set of constants representing the allowable values for ListVolumesSortOrderEnum const ( ListVolumesSortOrderAsc ListVolumesSortOrderEnum = "ASC" ListVolumesSortOrderDesc ListVolumesSortOrderEnum = "DESC" ) var mappingListVolumesSortOrder = map[string]ListVolumesSortOrderEnum{ "ASC": ListVolumesSortOrderAsc, "DESC": ListVolumesSortOrderDesc, } // GetListVolumesSortOrderEnumValues Enumerates the set of values for ListVolumesSortOrderEnum func GetListVolumesSortOrderEnumValues() []ListVolumesSortOrderEnum { values := make([]ListVolumesSortOrderEnum, 0) for _, v := range mappingListVolumesSortOrder { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/local_peering_gateway.go������������������0000664�0000000�0000000�00000017421�13771713062�0030030�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // LocalPeeringGateway A local peering gateway (LPG) is an object on a VCN that lets that VCN peer // with another VCN in the same region. *Peering* means that the two VCNs can // communicate using private IP addresses, but without the traffic traversing the // internet or routing through your on-premises network. For more information, // see VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type LocalPeeringGateway struct { // The OCID of the compartment containing the LPG. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The LPG's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // Whether the VCN at the other end of the peering is in a different tenancy. // Example: `false` IsCrossTenancyPeering *bool `mandatory:"true" json:"isCrossTenancyPeering"` // The LPG's current lifecycle state. LifecycleState LocalPeeringGatewayLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // Whether the LPG is peered with another LPG. `NEW` means the LPG has not yet been // peered. `PENDING` means the peering is being established. `REVOKED` means the // LPG at the other end of the peering has been deleted. PeeringStatus LocalPeeringGatewayPeeringStatusEnum `mandatory:"true" json:"peeringStatus"` // The date and time the LPG was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the VCN the LPG belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The smallest aggregate CIDR that contains all the CIDR routes advertised by the VCN // at the other end of the peering from this LPG. See `peerAdvertisedCidrDetails` for // the individual CIDRs. The value is `null` if the LPG is not peered. // Example: `192.168.0.0/16`, or if aggregated with `172.16.0.0/24` then `128.0.0.0/1` PeerAdvertisedCidr *string `mandatory:"false" json:"peerAdvertisedCidr"` // The specific ranges of IP addresses available on or via the VCN at the other // end of the peering from this LPG. The value is `null` if the LPG is not peered. // You can use these as destination CIDRs for route rules to route a subnet's // traffic to this LPG. // Example: [`192.168.0.0/16`, `172.16.0.0/24`] PeerAdvertisedCidrDetails []string `mandatory:"false" json:"peerAdvertisedCidrDetails"` // Additional information regarding the peering status, if applicable. PeeringStatusDetails *string `mandatory:"false" json:"peeringStatusDetails"` // The OCID of the route table the LPG is using. // For information about why you would associate a route table with an LPG, see // Transit Routing: Access to Multiple VCNs in Same Region (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m LocalPeeringGateway) String() string { return common.PointerString(m) } // LocalPeeringGatewayLifecycleStateEnum Enum with underlying type: string type LocalPeeringGatewayLifecycleStateEnum string // Set of constants representing the allowable values for LocalPeeringGatewayLifecycleStateEnum const ( LocalPeeringGatewayLifecycleStateProvisioning LocalPeeringGatewayLifecycleStateEnum = "PROVISIONING" LocalPeeringGatewayLifecycleStateAvailable LocalPeeringGatewayLifecycleStateEnum = "AVAILABLE" LocalPeeringGatewayLifecycleStateTerminating LocalPeeringGatewayLifecycleStateEnum = "TERMINATING" LocalPeeringGatewayLifecycleStateTerminated LocalPeeringGatewayLifecycleStateEnum = "TERMINATED" ) var mappingLocalPeeringGatewayLifecycleState = map[string]LocalPeeringGatewayLifecycleStateEnum{ "PROVISIONING": LocalPeeringGatewayLifecycleStateProvisioning, "AVAILABLE": LocalPeeringGatewayLifecycleStateAvailable, "TERMINATING": LocalPeeringGatewayLifecycleStateTerminating, "TERMINATED": LocalPeeringGatewayLifecycleStateTerminated, } // GetLocalPeeringGatewayLifecycleStateEnumValues Enumerates the set of values for LocalPeeringGatewayLifecycleStateEnum func GetLocalPeeringGatewayLifecycleStateEnumValues() []LocalPeeringGatewayLifecycleStateEnum { values := make([]LocalPeeringGatewayLifecycleStateEnum, 0) for _, v := range mappingLocalPeeringGatewayLifecycleState { values = append(values, v) } return values } // LocalPeeringGatewayPeeringStatusEnum Enum with underlying type: string type LocalPeeringGatewayPeeringStatusEnum string // Set of constants representing the allowable values for LocalPeeringGatewayPeeringStatusEnum const ( LocalPeeringGatewayPeeringStatusInvalid LocalPeeringGatewayPeeringStatusEnum = "INVALID" LocalPeeringGatewayPeeringStatusNew LocalPeeringGatewayPeeringStatusEnum = "NEW" LocalPeeringGatewayPeeringStatusPeered LocalPeeringGatewayPeeringStatusEnum = "PEERED" LocalPeeringGatewayPeeringStatusPending LocalPeeringGatewayPeeringStatusEnum = "PENDING" LocalPeeringGatewayPeeringStatusRevoked LocalPeeringGatewayPeeringStatusEnum = "REVOKED" ) var mappingLocalPeeringGatewayPeeringStatus = map[string]LocalPeeringGatewayPeeringStatusEnum{ "INVALID": LocalPeeringGatewayPeeringStatusInvalid, "NEW": LocalPeeringGatewayPeeringStatusNew, "PEERED": LocalPeeringGatewayPeeringStatusPeered, "PENDING": LocalPeeringGatewayPeeringStatusPending, "REVOKED": LocalPeeringGatewayPeeringStatusRevoked, } // GetLocalPeeringGatewayPeeringStatusEnumValues Enumerates the set of values for LocalPeeringGatewayPeeringStatusEnum func GetLocalPeeringGatewayPeeringStatusEnumValues() []LocalPeeringGatewayPeeringStatusEnum { values := make([]LocalPeeringGatewayPeeringStatusEnum, 0) for _, v := range mappingLocalPeeringGatewayPeeringStatus { values = append(values, v) } return values } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/nat_gateway.go����������������������������0000664�0000000�0000000�00000011504�13771713062�0026003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // NatGateway A NAT (Network Address Translation) gateway, which represents a router that lets instances // without public IPs contact the public internet without exposing the instance to inbound // internet traffic. For more information, see // NAT Gateway (https://docs.cloud.oracle.com/Content/Network/Tasks/NATgateway.htm). // To use any of the API operations, you must be authorized in an // IAM policy. If you are not authorized, talk to an // administrator. If you are an administrator who needs to write // policies to give users access, see Getting Started with // Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type NatGateway struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains // the NAT gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the NAT gateway. Id *string `mandatory:"true" json:"id"` // Whether the NAT gateway blocks traffic through it. The default is `false`. // Example: `true` BlockTraffic *bool `mandatory:"true" json:"blockTraffic"` // The NAT gateway's current state. LifecycleState NatGatewayLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The IP address associated with the NAT gateway. NatIp *string `mandatory:"true" json:"natIp"` // The date and time the NAT gateway was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN the NAT gateway // belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m NatGateway) String() string { return common.PointerString(m) } // NatGatewayLifecycleStateEnum Enum with underlying type: string type NatGatewayLifecycleStateEnum string // Set of constants representing the allowable values for NatGatewayLifecycleStateEnum const ( NatGatewayLifecycleStateProvisioning NatGatewayLifecycleStateEnum = "PROVISIONING" NatGatewayLifecycleStateAvailable NatGatewayLifecycleStateEnum = "AVAILABLE" NatGatewayLifecycleStateTerminating NatGatewayLifecycleStateEnum = "TERMINATING" NatGatewayLifecycleStateTerminated NatGatewayLifecycleStateEnum = "TERMINATED" ) var mappingNatGatewayLifecycleState = map[string]NatGatewayLifecycleStateEnum{ "PROVISIONING": NatGatewayLifecycleStateProvisioning, "AVAILABLE": NatGatewayLifecycleStateAvailable, "TERMINATING": NatGatewayLifecycleStateTerminating, "TERMINATED": NatGatewayLifecycleStateTerminated, } // GetNatGatewayLifecycleStateEnumValues Enumerates the set of values for NatGatewayLifecycleStateEnum func GetNatGatewayLifecycleStateEnumValues() []NatGatewayLifecycleStateEnum { values := make([]NatGatewayLifecycleStateEnum, 0) for _, v := range mappingNatGatewayLifecycleState { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/network_security_group.go�����������������0000664�0000000�0000000�00000014123�13771713062�0030334�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // NetworkSecurityGroup A *network security group* (NSG) provides virtual firewall rules for a specific set of // Vnic in a VCN. Compare NSGs with SecurityList, // which provide virtual firewall rules to all the VNICs in a *subnet*. // A network security group consists of two items: // * The set of Vnic that all have the same security rule needs (for // example, a group of Compute instances all running the same application) // * A set of NSG SecurityRule that apply to the VNICs in the group // After creating an NSG, you can add VNICs and security rules to it. For example, when you create // an instance, you can specify one or more NSGs to add the instance to (see // CreateVnicDetails). Or you can add an existing // instance to an NSG with UpdateVnic. // To add security rules to an NSG, see // AddNetworkSecurityGroupSecurityRules. // To list the VNICs in an NSG, see // ListNetworkSecurityGroupVnics. // To list the security rules in an NSG, see // ListNetworkSecurityGroupSecurityRules. // For more information about network security groups, see // Network Security Groups (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/networksecuritygroups.htm). // **Important:** Oracle Cloud Infrastructure Compute service images automatically include firewall rules (for example, // Linux iptables, Windows firewall). If there are issues with some type of access to an instance, // make sure all of the following are set correctly: // * Any security rules in any NSGs the instance's VNIC belongs to // * Any SecurityList associated with the instance's subnet // * The instance's OS firewall rules // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type NetworkSecurityGroup struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment the network security group is in. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. Id *string `mandatory:"true" json:"id"` // The network security group's current state. LifecycleState NetworkSecurityGroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the network security group was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group's VCN. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m NetworkSecurityGroup) String() string { return common.PointerString(m) } // NetworkSecurityGroupLifecycleStateEnum Enum with underlying type: string type NetworkSecurityGroupLifecycleStateEnum string // Set of constants representing the allowable values for NetworkSecurityGroupLifecycleStateEnum const ( NetworkSecurityGroupLifecycleStateProvisioning NetworkSecurityGroupLifecycleStateEnum = "PROVISIONING" NetworkSecurityGroupLifecycleStateAvailable NetworkSecurityGroupLifecycleStateEnum = "AVAILABLE" NetworkSecurityGroupLifecycleStateTerminating NetworkSecurityGroupLifecycleStateEnum = "TERMINATING" NetworkSecurityGroupLifecycleStateTerminated NetworkSecurityGroupLifecycleStateEnum = "TERMINATED" ) var mappingNetworkSecurityGroupLifecycleState = map[string]NetworkSecurityGroupLifecycleStateEnum{ "PROVISIONING": NetworkSecurityGroupLifecycleStateProvisioning, "AVAILABLE": NetworkSecurityGroupLifecycleStateAvailable, "TERMINATING": NetworkSecurityGroupLifecycleStateTerminating, "TERMINATED": NetworkSecurityGroupLifecycleStateTerminated, } // GetNetworkSecurityGroupLifecycleStateEnumValues Enumerates the set of values for NetworkSecurityGroupLifecycleStateEnum func GetNetworkSecurityGroupLifecycleStateEnumValues() []NetworkSecurityGroupLifecycleStateEnum { values := make([]NetworkSecurityGroupLifecycleStateEnum, 0) for _, v := range mappingNetworkSecurityGroupLifecycleState { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/network_security_group_vnic.go������������0000664�0000000�0000000�00000003271�13771713062�0031355�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // NetworkSecurityGroupVnic Information about a VNIC that belongs to a network security group. type NetworkSecurityGroupVnic struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC. VnicId *string `mandatory:"true" json:"vnicId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the parent resource that the VNIC // is attached to (for example, a Compute instance). ResourceId *string `mandatory:"false" json:"resourceId"` // The date and time the VNIC was added to the network security group, in the format // defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeAssociated *common.SDKTime `mandatory:"false" json:"timeAssociated"` } func (m NetworkSecurityGroupVnic) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/paravirtualized_volume_attachment.go������0000664�0000000�0000000�00000011642�13771713062�0032510�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // ParavirtualizedVolumeAttachment A paravirtualized volume attachment. type ParavirtualizedVolumeAttachment struct { // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the volume attachment. Id *string `mandatory:"true" json:"id"` // The OCID of the instance the volume is attached to. InstanceId *string `mandatory:"true" json:"instanceId"` // The date and time the volume was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the volume. VolumeId *string `mandatory:"true" json:"volumeId"` // The device name. Device *string `mandatory:"false" json:"device"` // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My volume attachment` DisplayName *string `mandatory:"false" json:"displayName"` // Whether the attachment was created in read-only mode. IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` // Whether the attachment should be created in shareable mode. If an attachment is created in shareable mode, then other instances can attach the same volume, provided that they also create their attachments in shareable mode. Only certain volume types can be attached in shareable mode. Defaults to false if not specified. IsShareable *bool `mandatory:"false" json:"isShareable"` // Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` // The current state of the volume attachment. LifecycleState VolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` } //GetAvailabilityDomain returns AvailabilityDomain func (m ParavirtualizedVolumeAttachment) GetAvailabilityDomain() *string { return m.AvailabilityDomain } //GetCompartmentId returns CompartmentId func (m ParavirtualizedVolumeAttachment) GetCompartmentId() *string { return m.CompartmentId } //GetDevice returns Device func (m ParavirtualizedVolumeAttachment) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m ParavirtualizedVolumeAttachment) GetDisplayName() *string { return m.DisplayName } //GetId returns Id func (m ParavirtualizedVolumeAttachment) GetId() *string { return m.Id } //GetInstanceId returns InstanceId func (m ParavirtualizedVolumeAttachment) GetInstanceId() *string { return m.InstanceId } //GetIsReadOnly returns IsReadOnly func (m ParavirtualizedVolumeAttachment) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m ParavirtualizedVolumeAttachment) GetIsShareable() *bool { return m.IsShareable } //GetLifecycleState returns LifecycleState func (m ParavirtualizedVolumeAttachment) GetLifecycleState() VolumeAttachmentLifecycleStateEnum { return m.LifecycleState } //GetTimeCreated returns TimeCreated func (m ParavirtualizedVolumeAttachment) GetTimeCreated() *common.SDKTime { return m.TimeCreated } //GetVolumeId returns VolumeId func (m ParavirtualizedVolumeAttachment) GetVolumeId() *string { return m.VolumeId } //GetIsPvEncryptionInTransitEnabled returns IsPvEncryptionInTransitEnabled func (m ParavirtualizedVolumeAttachment) GetIsPvEncryptionInTransitEnabled() *bool { return m.IsPvEncryptionInTransitEnabled } func (m ParavirtualizedVolumeAttachment) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m ParavirtualizedVolumeAttachment) MarshalJSON() (buff []byte, e error) { type MarshalTypeParavirtualizedVolumeAttachment ParavirtualizedVolumeAttachment s := struct { DiscriminatorParam string `json:"attachmentType"` MarshalTypeParavirtualizedVolumeAttachment }{ "paravirtualized", (MarshalTypeParavirtualizedVolumeAttachment)(m), } return json.Marshal(&s) } ����������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/peer_region_for_remote_peering.go���������0000664�0000000�0000000�00000002440�13771713062�0031727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // PeerRegionForRemotePeering Details about a region that supports remote VCN peering. For more information, see VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). type PeerRegionForRemotePeering struct { // The region's name. // Example: `us-phoenix-1` Name *string `mandatory:"true" json:"name"` } func (m PeerRegionForRemotePeering) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/port_range.go�����������������������������0000664�0000000�0000000�00000002506�13771713062�0025642�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // PortRange The representation of PortRange type PortRange struct { // The maximum port number. Must not be lower than the minimum port number. To specify // a single port number, set both the min and max to the same value. Max *int `mandatory:"true" json:"max"` // The minimum port number. Must not be greater than the maximum port number. Min *int `mandatory:"true" json:"min"` } func (m PortRange) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/private_ip.go�����������������������������0000664�0000000�0000000�00000012672�13771713062�0025651�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // PrivateIp A *private IP* is a conceptual term that refers to an IPv4 private IP address and related properties. // The `privateIp` object is the API representation of a private IP. // **Note:** For information about IPv6 addresses, see Ipv6. // Each instance has a *primary private IP* that is automatically created and // assigned to the primary VNIC during instance launch. If you add a secondary // VNIC to the instance, it also automatically gets a primary private IP. You // can't remove a primary private IP from its VNIC. The primary private IP is // automatically deleted when the VNIC is terminated. // You can add *secondary private IPs* to a VNIC after it's created. For more // information, see the `privateIp` operations and also // IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). // **Note:** Only // ListPrivateIps and // GetPrivateIp work with // *primary* private IPs. To create and update primary private IPs, you instead // work with instance and VNIC operations. For example, a primary private IP's // properties come from the values you specify in // CreateVnicDetails when calling either // LaunchInstance or // AttachVnic. To update the hostname // for a primary private IP, you use UpdateVnic. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type PrivateIp struct { // The private IP's availability domain. This attribute will be null if this is a *secondary* // private IP assigned to a VNIC that is in a *regional* subnet. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // The OCID of the compartment containing the private IP. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The hostname for the private IP. Used for DNS. The value is the hostname // portion of the private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be unique across all VNICs in the subnet and comply with // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // The private IP's Oracle ID (OCID). Id *string `mandatory:"false" json:"id"` // The private IP address of the `privateIp` object. The address is within the CIDR // of the VNIC's subnet. // Example: `10.0.3.3` IpAddress *string `mandatory:"false" json:"ipAddress"` // Whether this private IP is the primary one on the VNIC. Primary private IPs // are unassigned and deleted automatically when the VNIC is terminated. // Example: `true` IsPrimary *bool `mandatory:"false" json:"isPrimary"` // The OCID of the subnet the VNIC is in. SubnetId *string `mandatory:"false" json:"subnetId"` // The date and time the private IP was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // The OCID of the VNIC the private IP is assigned to. The VNIC and private IP // must be in the same subnet. VnicId *string `mandatory:"false" json:"vnicId"` } func (m PrivateIp) String() string { return common.PointerString(m) } ����������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/public_ip.go������������������������������0000664�0000000�0000000�00000023750�13771713062�0025454�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // PublicIp A *public IP* is a conceptual term that refers to a public IP address and related properties. // The `publicIp` object is the API representation of a public IP. // There are two types of public IPs: // 1. Ephemeral // 2. Reserved // For more information and comparison of the two types, // see Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type PublicIp struct { // The OCID of the entity the public IP is assigned to, or in the process of // being assigned to. AssignedEntityId *string `mandatory:"false" json:"assignedEntityId"` // The type of entity the public IP is assigned to, or in the process of being // assigned to. AssignedEntityType PublicIpAssignedEntityTypeEnum `mandatory:"false" json:"assignedEntityType,omitempty"` // The public IP's availability domain. This property is set only for ephemeral public IPs // that are assigned to a private IP (that is, when the `scope` of the public IP is set to // AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // The OCID of the compartment containing the public IP. For an ephemeral public IP, this is // the compartment of its assigned entity (which can be a private IP or a regional entity such // as a NAT gateway). For a reserved public IP that is currently assigned, // its compartment can be different from the assigned private IP's. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The public IP's Oracle ID (OCID). Id *string `mandatory:"false" json:"id"` // The public IP address of the `publicIp` object. // Example: `129.146.2.1` IpAddress *string `mandatory:"false" json:"ipAddress"` // The public IP's current state. LifecycleState PublicIpLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // Defines when the public IP is deleted and released back to Oracle's public IP pool. // * `EPHEMERAL`: The lifetime is tied to the lifetime of its assigned entity. An ephemeral // public IP must always be assigned to an entity. If the assigned entity is a private IP, // the ephemeral public IP is automatically deleted when the private IP is deleted, when // the VNIC is terminated, or when the instance is terminated. If the assigned entity is a // NatGateway, the ephemeral public IP is automatically // deleted when the NAT gateway is terminated. // * `RESERVED`: You control the public IP's lifetime. You can delete a reserved public IP // whenever you like. It does not need to be assigned to a private IP at all times. // For more information and comparison of the two types, // see Public IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingpublicIPs.htm). Lifetime PublicIpLifetimeEnum `mandatory:"false" json:"lifetime,omitempty"` // Deprecated. Use `assignedEntityId` instead. // The OCID of the private IP that the public IP is currently assigned to, or in the // process of being assigned to. // **Note:** This is `null` if the public IP is not assigned to a private IP, or is // in the process of being assigned to one. PrivateIpId *string `mandatory:"false" json:"privateIpId"` // Whether the public IP is regional or specific to a particular availability domain. // * `REGION`: The public IP exists within a region and is assigned to a regional entity // (such as a NatGateway), or can be assigned to a private // IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs // assigned to a regional entity have `scope` = `REGION`. // * `AVAILABILITY_DOMAIN`: The public IP exists within the availability domain of the entity // it's assigned to, which is specified by the `availabilityDomain` property of the public IP object. // Ephemeral public IPs that are assigned to private IPs have `scope` = `AVAILABILITY_DOMAIN`. Scope PublicIpScopeEnum `mandatory:"false" json:"scope,omitempty"` // The date and time the public IP was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m PublicIp) String() string { return common.PointerString(m) } // PublicIpAssignedEntityTypeEnum Enum with underlying type: string type PublicIpAssignedEntityTypeEnum string // Set of constants representing the allowable values for PublicIpAssignedEntityTypeEnum const ( PublicIpAssignedEntityTypePrivateIp PublicIpAssignedEntityTypeEnum = "PRIVATE_IP" PublicIpAssignedEntityTypeNatGateway PublicIpAssignedEntityTypeEnum = "NAT_GATEWAY" ) var mappingPublicIpAssignedEntityType = map[string]PublicIpAssignedEntityTypeEnum{ "PRIVATE_IP": PublicIpAssignedEntityTypePrivateIp, "NAT_GATEWAY": PublicIpAssignedEntityTypeNatGateway, } // GetPublicIpAssignedEntityTypeEnumValues Enumerates the set of values for PublicIpAssignedEntityTypeEnum func GetPublicIpAssignedEntityTypeEnumValues() []PublicIpAssignedEntityTypeEnum { values := make([]PublicIpAssignedEntityTypeEnum, 0) for _, v := range mappingPublicIpAssignedEntityType { values = append(values, v) } return values } // PublicIpLifecycleStateEnum Enum with underlying type: string type PublicIpLifecycleStateEnum string // Set of constants representing the allowable values for PublicIpLifecycleStateEnum const ( PublicIpLifecycleStateProvisioning PublicIpLifecycleStateEnum = "PROVISIONING" PublicIpLifecycleStateAvailable PublicIpLifecycleStateEnum = "AVAILABLE" PublicIpLifecycleStateAssigning PublicIpLifecycleStateEnum = "ASSIGNING" PublicIpLifecycleStateAssigned PublicIpLifecycleStateEnum = "ASSIGNED" PublicIpLifecycleStateUnassigning PublicIpLifecycleStateEnum = "UNASSIGNING" PublicIpLifecycleStateUnassigned PublicIpLifecycleStateEnum = "UNASSIGNED" PublicIpLifecycleStateTerminating PublicIpLifecycleStateEnum = "TERMINATING" PublicIpLifecycleStateTerminated PublicIpLifecycleStateEnum = "TERMINATED" ) var mappingPublicIpLifecycleState = map[string]PublicIpLifecycleStateEnum{ "PROVISIONING": PublicIpLifecycleStateProvisioning, "AVAILABLE": PublicIpLifecycleStateAvailable, "ASSIGNING": PublicIpLifecycleStateAssigning, "ASSIGNED": PublicIpLifecycleStateAssigned, "UNASSIGNING": PublicIpLifecycleStateUnassigning, "UNASSIGNED": PublicIpLifecycleStateUnassigned, "TERMINATING": PublicIpLifecycleStateTerminating, "TERMINATED": PublicIpLifecycleStateTerminated, } // GetPublicIpLifecycleStateEnumValues Enumerates the set of values for PublicIpLifecycleStateEnum func GetPublicIpLifecycleStateEnumValues() []PublicIpLifecycleStateEnum { values := make([]PublicIpLifecycleStateEnum, 0) for _, v := range mappingPublicIpLifecycleState { values = append(values, v) } return values } // PublicIpLifetimeEnum Enum with underlying type: string type PublicIpLifetimeEnum string // Set of constants representing the allowable values for PublicIpLifetimeEnum const ( PublicIpLifetimeEphemeral PublicIpLifetimeEnum = "EPHEMERAL" PublicIpLifetimeReserved PublicIpLifetimeEnum = "RESERVED" ) var mappingPublicIpLifetime = map[string]PublicIpLifetimeEnum{ "EPHEMERAL": PublicIpLifetimeEphemeral, "RESERVED": PublicIpLifetimeReserved, } // GetPublicIpLifetimeEnumValues Enumerates the set of values for PublicIpLifetimeEnum func GetPublicIpLifetimeEnumValues() []PublicIpLifetimeEnum { values := make([]PublicIpLifetimeEnum, 0) for _, v := range mappingPublicIpLifetime { values = append(values, v) } return values } // PublicIpScopeEnum Enum with underlying type: string type PublicIpScopeEnum string // Set of constants representing the allowable values for PublicIpScopeEnum const ( PublicIpScopeRegion PublicIpScopeEnum = "REGION" PublicIpScopeAvailabilityDomain PublicIpScopeEnum = "AVAILABILITY_DOMAIN" ) var mappingPublicIpScope = map[string]PublicIpScopeEnum{ "REGION": PublicIpScopeRegion, "AVAILABILITY_DOMAIN": PublicIpScopeAvailabilityDomain, } // GetPublicIpScopeEnumValues Enumerates the set of values for PublicIpScopeEnum func GetPublicIpScopeEnumValues() []PublicIpScopeEnum { values := make([]PublicIpScopeEnum, 0) for _, v := range mappingPublicIpScope { values = append(values, v) } return values } ������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/remote_peering_connection.go��������������0000664�0000000�0000000�00000016254�13771713062�0030732�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // RemotePeeringConnection A remote peering connection (RPC) is an object on a DRG that lets the VCN that is attached // to the DRG peer with a VCN in a different region. *Peering* means that the two VCNs can // communicate using private IP addresses, but without the traffic traversing the internet or // routing through your on-premises network. For more information, see // VCN Peering (https://docs.cloud.oracle.com/Content/Network/Tasks/VCNpeering.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type RemotePeeringConnection struct { // The OCID of the compartment that contains the RPC. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the DRG that this RPC belongs to. DrgId *string `mandatory:"true" json:"drgId"` // The OCID of the RPC. Id *string `mandatory:"true" json:"id"` // Whether the VCN at the other end of the peering is in a different tenancy. // Example: `false` IsCrossTenancyPeering *bool `mandatory:"true" json:"isCrossTenancyPeering"` // The RPC's current lifecycle state. LifecycleState RemotePeeringConnectionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // Whether the RPC is peered with another RPC. `NEW` means the RPC has not yet been // peered. `PENDING` means the peering is being established. `REVOKED` means the // RPC at the other end of the peering has been deleted. PeeringStatus RemotePeeringConnectionPeeringStatusEnum `mandatory:"true" json:"peeringStatus"` // The date and time the RPC was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // If this RPC is peered, this value is the OCID of the other RPC. PeerId *string `mandatory:"false" json:"peerId"` // If this RPC is peered, this value is the region that contains the other RPC. // Example: `us-ashburn-1` PeerRegionName *string `mandatory:"false" json:"peerRegionName"` // If this RPC is peered, this value is the OCID of the other RPC's tenancy. PeerTenancyId *string `mandatory:"false" json:"peerTenancyId"` } func (m RemotePeeringConnection) String() string { return common.PointerString(m) } // RemotePeeringConnectionLifecycleStateEnum Enum with underlying type: string type RemotePeeringConnectionLifecycleStateEnum string // Set of constants representing the allowable values for RemotePeeringConnectionLifecycleStateEnum const ( RemotePeeringConnectionLifecycleStateAvailable RemotePeeringConnectionLifecycleStateEnum = "AVAILABLE" RemotePeeringConnectionLifecycleStateProvisioning RemotePeeringConnectionLifecycleStateEnum = "PROVISIONING" RemotePeeringConnectionLifecycleStateTerminating RemotePeeringConnectionLifecycleStateEnum = "TERMINATING" RemotePeeringConnectionLifecycleStateTerminated RemotePeeringConnectionLifecycleStateEnum = "TERMINATED" ) var mappingRemotePeeringConnectionLifecycleState = map[string]RemotePeeringConnectionLifecycleStateEnum{ "AVAILABLE": RemotePeeringConnectionLifecycleStateAvailable, "PROVISIONING": RemotePeeringConnectionLifecycleStateProvisioning, "TERMINATING": RemotePeeringConnectionLifecycleStateTerminating, "TERMINATED": RemotePeeringConnectionLifecycleStateTerminated, } // GetRemotePeeringConnectionLifecycleStateEnumValues Enumerates the set of values for RemotePeeringConnectionLifecycleStateEnum func GetRemotePeeringConnectionLifecycleStateEnumValues() []RemotePeeringConnectionLifecycleStateEnum { values := make([]RemotePeeringConnectionLifecycleStateEnum, 0) for _, v := range mappingRemotePeeringConnectionLifecycleState { values = append(values, v) } return values } // RemotePeeringConnectionPeeringStatusEnum Enum with underlying type: string type RemotePeeringConnectionPeeringStatusEnum string // Set of constants representing the allowable values for RemotePeeringConnectionPeeringStatusEnum const ( RemotePeeringConnectionPeeringStatusInvalid RemotePeeringConnectionPeeringStatusEnum = "INVALID" RemotePeeringConnectionPeeringStatusNew RemotePeeringConnectionPeeringStatusEnum = "NEW" RemotePeeringConnectionPeeringStatusPending RemotePeeringConnectionPeeringStatusEnum = "PENDING" RemotePeeringConnectionPeeringStatusPeered RemotePeeringConnectionPeeringStatusEnum = "PEERED" RemotePeeringConnectionPeeringStatusRevoked RemotePeeringConnectionPeeringStatusEnum = "REVOKED" ) var mappingRemotePeeringConnectionPeeringStatus = map[string]RemotePeeringConnectionPeeringStatusEnum{ "INVALID": RemotePeeringConnectionPeeringStatusInvalid, "NEW": RemotePeeringConnectionPeeringStatusNew, "PENDING": RemotePeeringConnectionPeeringStatusPending, "PEERED": RemotePeeringConnectionPeeringStatusPeered, "REVOKED": RemotePeeringConnectionPeeringStatusRevoked, } // GetRemotePeeringConnectionPeeringStatusEnumValues Enumerates the set of values for RemotePeeringConnectionPeeringStatusEnum func GetRemotePeeringConnectionPeeringStatusEnumValues() []RemotePeeringConnectionPeeringStatusEnum { values := make([]RemotePeeringConnectionPeeringStatusEnum, 0) for _, v := range mappingRemotePeeringConnectionPeeringStatus { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������remove_image_shape_compatibility_entry_request_response.go������������������������������������������0000664�0000000�0000000�00000005156�13771713062�0037106�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // RemoveImageShapeCompatibilityEntryRequest wrapper for the RemoveImageShapeCompatibilityEntry operation type RemoveImageShapeCompatibilityEntryRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // Shape name. ShapeName *string `mandatory:"true" contributesTo:"path" name:"shapeName"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request RemoveImageShapeCompatibilityEntryRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request RemoveImageShapeCompatibilityEntryRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request RemoveImageShapeCompatibilityEntryRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // RemoveImageShapeCompatibilityEntryResponse wrapper for the RemoveImageShapeCompatibilityEntry operation type RemoveImageShapeCompatibilityEntryResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response RemoveImageShapeCompatibilityEntryResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response RemoveImageShapeCompatibilityEntryResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������remove_network_security_group_security_rules_details.go���������������������������������������������0000664�0000000�0000000�00000002440�13771713062�0036477�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // RemoveNetworkSecurityGroupSecurityRulesDetails The representation of RemoveNetworkSecurityGroupSecurityRulesDetails type RemoveNetworkSecurityGroupSecurityRulesDetails struct { // The Oracle-assigned ID of each SecurityRule to be deleted. SecurityRuleIds []string `mandatory:"false" json:"securityRuleIds"` } func (m RemoveNetworkSecurityGroupSecurityRulesDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������remove_network_security_group_security_rules_request_response.go������������������������������������0000664�0000000�0000000�00000005453�13771713062�0040467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // RemoveNetworkSecurityGroupSecurityRulesRequest wrapper for the RemoveNetworkSecurityGroupSecurityRules operation type RemoveNetworkSecurityGroupSecurityRulesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // Request with one or more security rules associated with the network security group that // will be removed. RemoveNetworkSecurityGroupSecurityRulesDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request RemoveNetworkSecurityGroupSecurityRulesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request RemoveNetworkSecurityGroupSecurityRulesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request RemoveNetworkSecurityGroupSecurityRulesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // RemoveNetworkSecurityGroupSecurityRulesResponse wrapper for the RemoveNetworkSecurityGroupSecurityRules operation type RemoveNetworkSecurityGroupSecurityRulesResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response RemoveNetworkSecurityGroupSecurityRulesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response RemoveNetworkSecurityGroupSecurityRulesResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/reset_instance_pool_request_response.go���0000664�0000000�0000000�00000006610�13771713062�0033227�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ResetInstancePoolRequest wrapper for the ResetInstancePool operation type ResetInstancePoolRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request ResetInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request ResetInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request ResetInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // ResetInstancePoolResponse wrapper for the ResetInstancePool operation type ResetInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response ResetInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response ResetInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/route_rule.go�����������������������������0000664�0000000�0000000�00000010036�13771713062�0025664�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // RouteRule A mapping between a destination IP address range and a virtual device to route matching // packets to (a target). type RouteRule struct { // The OCID for the route rule's target. For information about the type of // targets you can specify, see // Route Tables (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm). NetworkEntityId *string `mandatory:"true" json:"networkEntityId"` // Deprecated. Instead use `destination` and `destinationType`. Requests that include both // `cidrBlock` and `destination` will be rejected. // A destination IP address range in CIDR notation. Matching packets will // be routed to the indicated network entity (the target). // Cannot be an IPv6 CIDR. // Example: `0.0.0.0/0` CidrBlock *string `mandatory:"false" json:"cidrBlock"` // Conceptually, this is the range of IP addresses used for matching when routing // traffic. Required if you provide a `destinationType`. // Allowed values: // * IP address range in CIDR notation. Can be an IPv4 or IPv6 CIDR. For example: `192.168.1.0/24` // or `2001:0db8:0123:45::/56`. If you set this to an IPv6 CIDR, the route rule's target // can only be a DRG or internet gateway. Note that IPv6 addressing is currently supported // only in certain regions. See IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a route rule for traffic destined for a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. Destination *string `mandatory:"false" json:"destination"` // Type of destination for the rule. Required if you provide a `destination`. // * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a // Service (the rule is for traffic destined for a // particular `Service` through a service gateway). DestinationType RouteRuleDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` // An optional description of your choice for the rule. Description *string `mandatory:"false" json:"description"` } func (m RouteRule) String() string { return common.PointerString(m) } // RouteRuleDestinationTypeEnum Enum with underlying type: string type RouteRuleDestinationTypeEnum string // Set of constants representing the allowable values for RouteRuleDestinationTypeEnum const ( RouteRuleDestinationTypeCidrBlock RouteRuleDestinationTypeEnum = "CIDR_BLOCK" RouteRuleDestinationTypeServiceCidrBlock RouteRuleDestinationTypeEnum = "SERVICE_CIDR_BLOCK" ) var mappingRouteRuleDestinationType = map[string]RouteRuleDestinationTypeEnum{ "CIDR_BLOCK": RouteRuleDestinationTypeCidrBlock, "SERVICE_CIDR_BLOCK": RouteRuleDestinationTypeServiceCidrBlock, } // GetRouteRuleDestinationTypeEnumValues Enumerates the set of values for RouteRuleDestinationTypeEnum func GetRouteRuleDestinationTypeEnumValues() []RouteRuleDestinationTypeEnum { values := make([]RouteRuleDestinationTypeEnum, 0) for _, v := range mappingRouteRuleDestinationType { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/route_table.go����������������������������0000664�0000000�0000000�00000010667�13771713062�0026016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // RouteTable A collection of `RouteRule` objects, which are used to route packets // based on destination IP to a particular network entity. For more information, see // Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type RouteTable struct { // The OCID of the compartment containing the route table. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The route table's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The route table's current state. LifecycleState RouteTableLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The collection of rules for routing destination IPs to network devices. RouteRules []RouteRule `mandatory:"true" json:"routeRules"` // The OCID of the VCN the route table list belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The date and time the route table was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m RouteTable) String() string { return common.PointerString(m) } // RouteTableLifecycleStateEnum Enum with underlying type: string type RouteTableLifecycleStateEnum string // Set of constants representing the allowable values for RouteTableLifecycleStateEnum const ( RouteTableLifecycleStateProvisioning RouteTableLifecycleStateEnum = "PROVISIONING" RouteTableLifecycleStateAvailable RouteTableLifecycleStateEnum = "AVAILABLE" RouteTableLifecycleStateTerminating RouteTableLifecycleStateEnum = "TERMINATING" RouteTableLifecycleStateTerminated RouteTableLifecycleStateEnum = "TERMINATED" ) var mappingRouteTableLifecycleState = map[string]RouteTableLifecycleStateEnum{ "PROVISIONING": RouteTableLifecycleStateProvisioning, "AVAILABLE": RouteTableLifecycleStateAvailable, "TERMINATING": RouteTableLifecycleStateTerminating, "TERMINATED": RouteTableLifecycleStateTerminated, } // GetRouteTableLifecycleStateEnumValues Enumerates the set of values for RouteTableLifecycleStateEnum func GetRouteTableLifecycleStateEnumValues() []RouteTableLifecycleStateEnum { values := make([]RouteTableLifecycleStateEnum, 0) for _, v := range mappingRouteTableLifecycleState { values = append(values, v) } return values } �������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/security_list.go��������������������������0000664�0000000�0000000�00000012542�13771713062�0026405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // SecurityList A set of virtual firewall rules for your VCN. Security lists are configured at the subnet // level, but the rules are applied to the ingress and egress traffic for the individual instances // in the subnet. The rules can be stateful or stateless. For more information, see // Security Lists (https://docs.cloud.oracle.com/Content/Network/Concepts/securitylists.htm). // **Note:** Compare security lists to NetworkSecurityGroups, // which let you apply a set of security rules to a *specific set of VNICs* instead of an entire // subnet. Oracle recommends using network security groups instead of security lists, although you // can use either or both together. // **Important:** Oracle Cloud Infrastructure Compute service images automatically include firewall rules (for example, // Linux iptables, Windows firewall). If there are issues with some type of access to an instance, // make sure both the security lists associated with the instance's subnet and the instance's // firewall rules are set correctly. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type SecurityList struct { // The OCID of the compartment containing the security list. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // Rules for allowing egress IP packets. EgressSecurityRules []EgressSecurityRule `mandatory:"true" json:"egressSecurityRules"` // The security list's Oracle Cloud ID (OCID). Id *string `mandatory:"true" json:"id"` // Rules for allowing ingress IP packets. IngressSecurityRules []IngressSecurityRule `mandatory:"true" json:"ingressSecurityRules"` // The security list's current state. LifecycleState SecurityListLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the security list was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The OCID of the VCN the security list belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m SecurityList) String() string { return common.PointerString(m) } // SecurityListLifecycleStateEnum Enum with underlying type: string type SecurityListLifecycleStateEnum string // Set of constants representing the allowable values for SecurityListLifecycleStateEnum const ( SecurityListLifecycleStateProvisioning SecurityListLifecycleStateEnum = "PROVISIONING" SecurityListLifecycleStateAvailable SecurityListLifecycleStateEnum = "AVAILABLE" SecurityListLifecycleStateTerminating SecurityListLifecycleStateEnum = "TERMINATING" SecurityListLifecycleStateTerminated SecurityListLifecycleStateEnum = "TERMINATED" ) var mappingSecurityListLifecycleState = map[string]SecurityListLifecycleStateEnum{ "PROVISIONING": SecurityListLifecycleStateProvisioning, "AVAILABLE": SecurityListLifecycleStateAvailable, "TERMINATING": SecurityListLifecycleStateTerminating, "TERMINATED": SecurityListLifecycleStateTerminated, } // GetSecurityListLifecycleStateEnumValues Enumerates the set of values for SecurityListLifecycleStateEnum func GetSecurityListLifecycleStateEnumValues() []SecurityListLifecycleStateEnum { values := make([]SecurityListLifecycleStateEnum, 0) for _, v := range mappingSecurityListLifecycleState { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/security_rule.go��������������������������0000664�0000000�0000000�00000024211�13771713062�0026375�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // SecurityRule A security rule is one of the items in a NetworkSecurityGroup. // It is a virtual firewall rule for the VNICs in the network security group. A rule can be for // either inbound (`direction`= INGRESS) or outbound (`direction`= EGRESS) IP packets. type SecurityRule struct { // Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, or `INGRESS` for rules to allow inbound IP packets. Direction SecurityRuleDirectionEnum `mandatory:"true" json:"direction"` // The transport protocol. Specify either `all` or an IPv4 protocol number as // defined in // Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). // Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). Protocol *string `mandatory:"true" json:"protocol"` // An optional description of your choice for the rule. Description *string `mandatory:"false" json:"description"` // Conceptually, this is the range of IP addresses that a packet originating from the instance // can go to. // Allowed values: // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security rule for traffic destined for a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. // * The OCID of a NetworkSecurityGroup in the same // VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control // traffic between VNICs in the same NSG. Destination *string `mandatory:"false" json:"destination"` // Type of destination for the rule. Required if `direction` = `EGRESS`. // Allowed values: // * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a // Service (the rule is for traffic destined for a // particular `Service` through a service gateway). // * `NETWORK_SECURITY_GROUP`: If the rule's `destination` is the OCID of a // NetworkSecurityGroup. DestinationType SecurityRuleDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` // Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code // as defined in: // - ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) // - ICMPv6 Parameters (https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) // If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and // codes are allowed. If you do provide this object, the type is required and the code is optional. // To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 ("Destination // Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). If you need to specify // multiple codes for a single type, create a separate security rule for each. IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"` // An Oracle-assigned identifier for the security rule. You specify this ID when you want to // update or delete the rule. // Example: `04ABEC` Id *string `mandatory:"false" json:"id"` // A stateless rule allows traffic in one direction. Remember to add a corresponding // stateless rule in the other direction if you need to support bidirectional traffic. For // example, if egress traffic allows TCP destination port 80, there should be an ingress // rule to allow TCP source port 80. Defaults to false, which means the rule is stateful // and a corresponding rule is not necessary for bidirectional traffic. IsStateless *bool `mandatory:"false" json:"isStateless"` // Whether the rule is valid. The value is `True` when the rule is first created. If // the rule's `source` or `destination` is a network security group, the value changes to // `False` if that network security group is deleted. IsValid *bool `mandatory:"false" json:"isValid"` // Conceptually, this is the range of IP addresses that a packet coming into the instance // can come from. // Allowed values: // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security rule for traffic coming from a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. // * The OCID of a NetworkSecurityGroup in the same // VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control // traffic between VNICs in the same NSG. Source *string `mandatory:"false" json:"source"` // Type of source for the rule. Required if `direction` = `INGRESS`. // * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a // Service (the rule is for traffic coming from a // particular `Service` through a service gateway). // * `NETWORK_SECURITY_GROUP`: If the rule's `source` is the OCID of a // NetworkSecurityGroup. SourceType SecurityRuleSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` // Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. // If you specify TCP as the protocol but omit this object, then all destination ports are allowed. TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"` // The date and time the security rule was created. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. // If you specify UDP as the protocol but omit this object, then all destination ports are allowed. UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"` } func (m SecurityRule) String() string { return common.PointerString(m) } // SecurityRuleDestinationTypeEnum Enum with underlying type: string type SecurityRuleDestinationTypeEnum string // Set of constants representing the allowable values for SecurityRuleDestinationTypeEnum const ( SecurityRuleDestinationTypeCidrBlock SecurityRuleDestinationTypeEnum = "CIDR_BLOCK" SecurityRuleDestinationTypeServiceCidrBlock SecurityRuleDestinationTypeEnum = "SERVICE_CIDR_BLOCK" SecurityRuleDestinationTypeNetworkSecurityGroup SecurityRuleDestinationTypeEnum = "NETWORK_SECURITY_GROUP" ) var mappingSecurityRuleDestinationType = map[string]SecurityRuleDestinationTypeEnum{ "CIDR_BLOCK": SecurityRuleDestinationTypeCidrBlock, "SERVICE_CIDR_BLOCK": SecurityRuleDestinationTypeServiceCidrBlock, "NETWORK_SECURITY_GROUP": SecurityRuleDestinationTypeNetworkSecurityGroup, } // GetSecurityRuleDestinationTypeEnumValues Enumerates the set of values for SecurityRuleDestinationTypeEnum func GetSecurityRuleDestinationTypeEnumValues() []SecurityRuleDestinationTypeEnum { values := make([]SecurityRuleDestinationTypeEnum, 0) for _, v := range mappingSecurityRuleDestinationType { values = append(values, v) } return values } // SecurityRuleDirectionEnum Enum with underlying type: string type SecurityRuleDirectionEnum string // Set of constants representing the allowable values for SecurityRuleDirectionEnum const ( SecurityRuleDirectionEgress SecurityRuleDirectionEnum = "EGRESS" SecurityRuleDirectionIngress SecurityRuleDirectionEnum = "INGRESS" ) var mappingSecurityRuleDirection = map[string]SecurityRuleDirectionEnum{ "EGRESS": SecurityRuleDirectionEgress, "INGRESS": SecurityRuleDirectionIngress, } // GetSecurityRuleDirectionEnumValues Enumerates the set of values for SecurityRuleDirectionEnum func GetSecurityRuleDirectionEnumValues() []SecurityRuleDirectionEnum { values := make([]SecurityRuleDirectionEnum, 0) for _, v := range mappingSecurityRuleDirection { values = append(values, v) } return values } // SecurityRuleSourceTypeEnum Enum with underlying type: string type SecurityRuleSourceTypeEnum string // Set of constants representing the allowable values for SecurityRuleSourceTypeEnum const ( SecurityRuleSourceTypeCidrBlock SecurityRuleSourceTypeEnum = "CIDR_BLOCK" SecurityRuleSourceTypeServiceCidrBlock SecurityRuleSourceTypeEnum = "SERVICE_CIDR_BLOCK" SecurityRuleSourceTypeNetworkSecurityGroup SecurityRuleSourceTypeEnum = "NETWORK_SECURITY_GROUP" ) var mappingSecurityRuleSourceType = map[string]SecurityRuleSourceTypeEnum{ "CIDR_BLOCK": SecurityRuleSourceTypeCidrBlock, "SERVICE_CIDR_BLOCK": SecurityRuleSourceTypeServiceCidrBlock, "NETWORK_SECURITY_GROUP": SecurityRuleSourceTypeNetworkSecurityGroup, } // GetSecurityRuleSourceTypeEnumValues Enumerates the set of values for SecurityRuleSourceTypeEnum func GetSecurityRuleSourceTypeEnumValues() []SecurityRuleSourceTypeEnum { values := make([]SecurityRuleSourceTypeEnum, 0) for _, v := range mappingSecurityRuleSourceType { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/service.go��������������������������������0000664�0000000�0000000�00000005167�13771713062�0025150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Service An object that represents one or multiple Oracle services that you can enable for a // ServiceGateway. In the User Guide topic // Access to Oracle Services: Service Gateway (https://docs.cloud.oracle.com/Content/Network/Tasks/servicegateway.htm), the // term *service CIDR label* is used to refer to the string that represents the regional public // IP address ranges of the Oracle service or services covered by a given `Service` object. That // unique string is the value of the `Service` object's `cidrBlock` attribute. type Service struct { // A string that represents the regional public IP address ranges for the Oracle service or // services covered by this `Service` object. Also known as the `Service` object's *service // CIDR label*. // When you set up a route rule to route traffic to the service gateway, use this value as the // rule's destination. See RouteTable. Also, when you set up // a security list rule to cover traffic with the service gateway, use the `cidrBlock` value // as the rule's destination (for an egress rule) or the source (for an ingress rule). // See SecurityList. // Example: `oci-phx-objectstorage` CidrBlock *string `mandatory:"true" json:"cidrBlock"` // Description of the Oracle service or services covered by this `Service` object. // Example: `OCI PHX Object Storage` Description *string `mandatory:"true" json:"description"` // The `Service` object's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). Id *string `mandatory:"true" json:"id"` // Name of the `Service` object. This name can change and is not guaranteed to be unique. // Example: `OCI PHX Object Storage` Name *string `mandatory:"true" json:"name"` } func (m Service) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/service_gateway.go������������������������0000664�0000000�0000000�00000013543�13771713062�0026666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ServiceGateway Represents a router that lets your VCN privately access specific Oracle services such as Object // Storage without exposing the VCN to the public internet. Traffic leaving the VCN and destined // for a supported Oracle service (see ListServices) is // routed through the service gateway and does not traverse the internet. The instances in the VCN // do not need to have public IP addresses nor be in a public subnet. The VCN does not need an internet gateway // for this traffic. For more information, see // Access to Oracle Services: Service Gateway (https://docs.cloud.oracle.com/Content/Network/Tasks/servicegateway.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type ServiceGateway struct { // Whether the service gateway blocks all traffic through it. The default is `false`. When // this is `true`, traffic is not routed to any services, regardless of route rules. // Example: `true` BlockTraffic *bool `mandatory:"true" json:"blockTraffic"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment that contains the // service gateway. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the service gateway. Id *string `mandatory:"true" json:"id"` // The service gateway's current state. LifecycleState ServiceGatewayLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // List of the Service objects enabled for this service gateway. // The list can be empty. You can enable a particular `Service` by using // AttachServiceId or // UpdateServiceGateway. Services []ServiceIdResponseDetails `mandatory:"true" json:"services"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN the service gateway // belongs to. VcnId *string `mandatory:"true" json:"vcnId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the route table the service gateway is using. // For information about why you would associate a route table with a service gateway, see // Transit Routing: Private Access to Oracle Services (https://docs.cloud.oracle.com/Content/Network/Tasks/transitroutingoracleservices.htm). RouteTableId *string `mandatory:"false" json:"routeTableId"` // The date and time the service gateway was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m ServiceGateway) String() string { return common.PointerString(m) } // ServiceGatewayLifecycleStateEnum Enum with underlying type: string type ServiceGatewayLifecycleStateEnum string // Set of constants representing the allowable values for ServiceGatewayLifecycleStateEnum const ( ServiceGatewayLifecycleStateProvisioning ServiceGatewayLifecycleStateEnum = "PROVISIONING" ServiceGatewayLifecycleStateAvailable ServiceGatewayLifecycleStateEnum = "AVAILABLE" ServiceGatewayLifecycleStateTerminating ServiceGatewayLifecycleStateEnum = "TERMINATING" ServiceGatewayLifecycleStateTerminated ServiceGatewayLifecycleStateEnum = "TERMINATED" ) var mappingServiceGatewayLifecycleState = map[string]ServiceGatewayLifecycleStateEnum{ "PROVISIONING": ServiceGatewayLifecycleStateProvisioning, "AVAILABLE": ServiceGatewayLifecycleStateAvailable, "TERMINATING": ServiceGatewayLifecycleStateTerminating, "TERMINATED": ServiceGatewayLifecycleStateTerminated, } // GetServiceGatewayLifecycleStateEnumValues Enumerates the set of values for ServiceGatewayLifecycleStateEnum func GetServiceGatewayLifecycleStateEnumValues() []ServiceGatewayLifecycleStateEnum { values := make([]ServiceGatewayLifecycleStateEnum, 0) for _, v := range mappingServiceGatewayLifecycleState { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/service_id_request_details.go�������������0000664�0000000�0000000�00000002335�13771713062�0031073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ServiceIdRequestDetails The representation of ServiceIdRequestDetails type ServiceIdRequestDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the Service. ServiceId *string `mandatory:"true" json:"serviceId"` } func (m ServiceIdRequestDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/service_id_response_details.go������������0000664�0000000�0000000�00000002472�13771713062�0031243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ServiceIdResponseDetails The representation of ServiceIdResponseDetails type ServiceIdResponseDetails struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the service. ServiceId *string `mandatory:"true" json:"serviceId"` // The name of the service. ServiceName *string `mandatory:"true" json:"serviceName"` } func (m ServiceIdResponseDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/shape.go����������������������������������0000664�0000000�0000000�00000006345�13771713062�0024607�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Shape A compute instance shape that can be used in LaunchInstance. // For more information, see Overview of the Compute Service (https://docs.cloud.oracle.com/Content/Compute/Concepts/computeoverview.htm). type Shape struct { // The name of the shape. You can enumerate all available shapes by calling // ListShapes. Shape *string `mandatory:"true" json:"shape"` // A short description of the processors available to an instance of this shape. ProcessorDescription *string `mandatory:"false" json:"processorDescription"` // The default number of OCPUs available to an instance of this shape. Ocpus *float32 `mandatory:"false" json:"ocpus"` // The default amount of memory, in gigabytes, available to an instance of this shape. MemoryInGBs *float32 `mandatory:"false" json:"memoryInGBs"` // The networking bandwidth, in gigabits per second, available to an instance of this shape. NetworkingBandwidthInGbps *float32 `mandatory:"false" json:"networkingBandwidthInGbps"` // The maximum number of VNIC attachments available to an instance of this shape. MaxVnicAttachments *int `mandatory:"false" json:"maxVnicAttachments"` // The number of GPUs available to an instance of this shape. Gpus *int `mandatory:"false" json:"gpus"` // A short description of the GPUs available to instances of this shape. // This field is `null` if `gpus` is `0`. GpuDescription *string `mandatory:"false" json:"gpuDescription"` // The number of local disks available to the instance. LocalDisks *int `mandatory:"false" json:"localDisks"` // The size of the local disks, aggregated, in gigabytes. // This field is `null` if `localDisks` is equal to `0`. LocalDisksTotalSizeInGBs *float32 `mandatory:"false" json:"localDisksTotalSizeInGBs"` // A short description of the local disks available to instances of this shape. // This field is `null` if `localDisks` is equal to `0`. LocalDiskDescription *string `mandatory:"false" json:"localDiskDescription"` OcpuOptions *ShapeOcpuOptions `mandatory:"false" json:"ocpuOptions"` MemoryOptions *ShapeMemoryOptions `mandatory:"false" json:"memoryOptions"` NetworkingBandwidthOptions *ShapeNetworkingBandwidthOptions `mandatory:"false" json:"networkingBandwidthOptions"` MaxVnicAttachmentOptions *ShapeMaxVnicAttachmentOptions `mandatory:"false" json:"maxVnicAttachmentOptions"` } func (m Shape) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/shape_max_vnic_attachment_options.go������0000664�0000000�0000000�00000003117�13771713062�0032450�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ShapeMaxVnicAttachmentOptions The possible configurations for the number of VNIC attachments available to an instance of this shape. If this field is null, then all instances of this shape have a fixed maximum number of VNIC attachments equal to `maxVnicAttachments`. type ShapeMaxVnicAttachmentOptions struct { // The lowest maximum value of VNIC attachments. Min *int `mandatory:"false" json:"min"` // The highest maximum value of VNIC attachments. Max *float32 `mandatory:"false" json:"max"` // The default number of VNIC attachments allowed per OCPU. DefaultPerOcpu *float32 `mandatory:"false" json:"defaultPerOcpu"` } func (m ShapeMaxVnicAttachmentOptions) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/shape_memory_options.go�������������������0000664�0000000�0000000�00000003133�13771713062�0027742�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ShapeMemoryOptions The possible configurations for the amount of memory available to an instance of this shape. // If this field is null, then all instances of this shape have a fixed // amount of memory equivalent to `memoryInGBs`. type ShapeMemoryOptions struct { // The minimum amount of memory, in gigabytes. MinInGBs *float32 `mandatory:"false" json:"minInGBs"` // The maximum amount of memory, in gigabytes. MaxInGBs *float32 `mandatory:"false" json:"maxInGBs"` // The default amount of memory, in gigabytes, per OCPU available to an instance // of this shape. DefaultPerOcpuInGBs *float32 `mandatory:"false" json:"defaultPerOcpuInGBs"` } func (m ShapeMemoryOptions) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/shape_networking_bandwidth_options.go�����0000664�0000000�0000000�00000003302�13771713062�0032643�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ShapeNetworkingBandwidthOptions The possible configurations for the amount of networking bandwidth available to an instance of this shape. If this field is null, then all instances of this shape have a fixed amount of bandwidth equivalent to `networkingBandwidthInGbps`. type ShapeNetworkingBandwidthOptions struct { // The minimum amount of networking bandwidth, in gigabits per second. MinInGbps *float32 `mandatory:"false" json:"minInGbps"` // The maximum amount of networking bandwidth, in gigabits per second. MaxInGbps *float32 `mandatory:"false" json:"maxInGbps"` // The default amount of networking bandwidth, in gigabits per second, // per OCPU. DefaultPerOcpuInGbps *float32 `mandatory:"false" json:"defaultPerOcpuInGbps"` } func (m ShapeNetworkingBandwidthOptions) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/shape_ocpu_options.go���������������������0000664�0000000�0000000�00000002543�13771713062�0027404�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // ShapeOcpuOptions The possible configurations for the number of OCPUs available to an instance of this shape. // If this field is null, then all instances of this shape have a fixed // number of OCPUs equal to `ocpus`. type ShapeOcpuOptions struct { // The minimum number of OCPUs. Min *float32 `mandatory:"false" json:"min"` // The maximum number of OCPUs. Max *float32 `mandatory:"false" json:"max"` } func (m ShapeOcpuOptions) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������softreset_instance_pool_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000006664�13771713062�0034055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // SoftresetInstancePoolRequest wrapper for the SoftresetInstancePool operation type SoftresetInstancePoolRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request SoftresetInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request SoftresetInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request SoftresetInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // SoftresetInstancePoolResponse wrapper for the SoftresetInstancePool operation type SoftresetInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response SoftresetInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response SoftresetInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/start_instance_pool_request_response.go���0000664�0000000�0000000�00000006610�13771713062�0033242�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // StartInstancePoolRequest wrapper for the StartInstancePool operation type StartInstancePoolRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request StartInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request StartInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request StartInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // StartInstancePoolResponse wrapper for the StartInstancePool operation type StartInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response StartInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response StartInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/stop_instance_pool_request_response.go����0000664�0000000�0000000�00000006575�13771713062�0033104�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // StopInstancePoolRequest wrapper for the StopInstancePool operation type StopInstancePoolRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request StopInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request StopInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request StopInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // StopInstancePoolResponse wrapper for the StopInstancePool operation type StopInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response StopInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response StopInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/subnet.go���������������������������������0000664�0000000�0000000�00000020112�13771713062�0024773�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Subnet A logical subdivision of a VCN. Each subnet // consists of a contiguous range of IP addresses that do not overlap with // other subnets in the VCN. Example: 172.16.1.0/24. For more information, see // Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm) and // VCNs and Subnets (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVCNs.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Subnet struct { // The subnet's CIDR block. // Example: `172.16.1.0/24` CidrBlock *string `mandatory:"true" json:"cidrBlock"` // The OCID of the compartment containing the subnet. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The subnet's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The subnet's current state. LifecycleState SubnetLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID of the route table that the subnet uses. RouteTableId *string `mandatory:"true" json:"routeTableId"` // The OCID of the VCN the subnet is in. VcnId *string `mandatory:"true" json:"vcnId"` // The IP address of the virtual router. // Example: `10.0.14.1` VirtualRouterIp *string `mandatory:"true" json:"virtualRouterIp"` // The MAC address of the virtual router. // Example: `00:00:17:B6:4D:DD` VirtualRouterMac *string `mandatory:"true" json:"virtualRouterMac"` // The subnet's availability domain. This attribute will be null if this is a regional subnet // instead of an AD-specific subnet. Oracle recommends creating regional subnets. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The OCID of the set of DHCP options that the subnet uses. DhcpOptionsId *string `mandatory:"false" json:"dhcpOptionsId"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // A DNS label for the subnet, used in conjunction with the VNIC's hostname and // VCN's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be an alphanumeric string that begins with a letter and is unique within the VCN. // The value cannot be changed. // The absence of this parameter means the Internet and VCN Resolver // will not resolve hostnames of instances in this subnet. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `subnet123` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // For an IPv6-enabled subnet, this is the IPv6 CIDR block for the subnet's private IP address // space. The subnet size is always /64. Note that IPv6 addressing is currently supported only // in certain regions. See IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `2001:0db8:0123:1111::/64` Ipv6CidrBlock *string `mandatory:"false" json:"ipv6CidrBlock"` // For an IPv6-enabled subnet, this is the IPv6 CIDR block for the subnet's public IP address // space. The subnet size is always /64. The left 48 bits are inherited from the // `ipv6PublicCidrBlock` of the Vcn, // and the remaining 16 bits are from the subnet's `ipv6CidrBlock`. // Example: `2001:0db8:0123:1111::/64` Ipv6PublicCidrBlock *string `mandatory:"false" json:"ipv6PublicCidrBlock"` // For an IPv6-enabled subnet, this is the IPv6 address of the virtual router. // Example: `2001:0db8:0123:1111:89ab:cdef:1234:5678` Ipv6VirtualRouterIp *string `mandatory:"false" json:"ipv6VirtualRouterIp"` // Whether VNICs within this subnet can have public IP addresses. // Defaults to false, which means VNICs created in this subnet will // automatically be assigned public IP addresses unless specified // otherwise during instance launch or VNIC creation (with the // `assignPublicIp` flag in // CreateVnicDetails). // If `prohibitPublicIpOnVnic` is set to true, VNICs created in this // subnet cannot have public IP addresses (that is, it's a private // subnet). // Example: `true` ProhibitPublicIpOnVnic *bool `mandatory:"false" json:"prohibitPublicIpOnVnic"` // The OCIDs of the security list or lists that the subnet uses. Remember // that security lists are associated *with the subnet*, but the // rules are applied to the individual VNICs in the subnet. SecurityListIds []string `mandatory:"false" json:"securityListIds"` // The subnet's domain name, which consists of the subnet's DNS label, // the VCN's DNS label, and the `oraclevcn.com` domain. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `subnet123.vcn1.oraclevcn.com` SubnetDomainName *string `mandatory:"false" json:"subnetDomainName"` // The date and time the subnet was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m Subnet) String() string { return common.PointerString(m) } // SubnetLifecycleStateEnum Enum with underlying type: string type SubnetLifecycleStateEnum string // Set of constants representing the allowable values for SubnetLifecycleStateEnum const ( SubnetLifecycleStateProvisioning SubnetLifecycleStateEnum = "PROVISIONING" SubnetLifecycleStateAvailable SubnetLifecycleStateEnum = "AVAILABLE" SubnetLifecycleStateTerminating SubnetLifecycleStateEnum = "TERMINATING" SubnetLifecycleStateTerminated SubnetLifecycleStateEnum = "TERMINATED" ) var mappingSubnetLifecycleState = map[string]SubnetLifecycleStateEnum{ "PROVISIONING": SubnetLifecycleStateProvisioning, "AVAILABLE": SubnetLifecycleStateAvailable, "TERMINATING": SubnetLifecycleStateTerminating, "TERMINATED": SubnetLifecycleStateTerminated, } // GetSubnetLifecycleStateEnumValues Enumerates the set of values for SubnetLifecycleStateEnum func GetSubnetLifecycleStateEnumValues() []SubnetLifecycleStateEnum { values := make([]SubnetLifecycleStateEnum, 0) for _, v := range mappingSubnetLifecycleState { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/tcp_options.go����������������������������0000664�0000000�0000000�00000003120�13771713062�0026034�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // TcpOptions Optional object to specify ports for a TCP rule. If you specify TCP as the // protocol but omit this object, then all ports are allowed. type TcpOptions struct { // An inclusive range of allowed destination ports. Use the same number for the min and max // to indicate a single port. Defaults to all ports if not specified. DestinationPortRange *PortRange `mandatory:"false" json:"destinationPortRange"` // An inclusive range of allowed source ports. Use the same number for the min and max to // indicate a single port. Defaults to all ports if not specified. SourcePortRange *PortRange `mandatory:"false" json:"sourcePortRange"` } func (m TcpOptions) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������terminate_cluster_network_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000006111�13771713062�0034407�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // TerminateClusterNetworkRequest wrapper for the TerminateClusterNetwork operation type TerminateClusterNetworkRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. ClusterNetworkId *string `mandatory:"true" contributesTo:"path" name:"clusterNetworkId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request TerminateClusterNetworkRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request TerminateClusterNetworkRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request TerminateClusterNetworkRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // TerminateClusterNetworkResponse wrapper for the TerminateClusterNetwork operation type TerminateClusterNetworkResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response TerminateClusterNetworkResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response TerminateClusterNetworkResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������terminate_instance_pool_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005431�13771713062�0034016�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // TerminateInstancePoolRequest wrapper for the TerminateInstancePool operation type TerminateInstancePoolRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request TerminateInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request TerminateInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request TerminateInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // TerminateInstancePoolResponse wrapper for the TerminateInstancePool operation type TerminateInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response TerminateInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response TerminateInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/terminate_instance_request_response.go����0000664�0000000�0000000�00000005560�13771713062�0033047�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // TerminateInstanceRequest wrapper for the TerminateInstance operation type TerminateInstanceRequest struct { // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Specifies whether to delete or preserve the boot volume when terminating an instance. // The default value is false. PreserveBootVolume *bool `mandatory:"false" contributesTo:"query" name:"preserveBootVolume"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request TerminateInstanceRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request TerminateInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request TerminateInstanceRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // TerminateInstanceResponse wrapper for the TerminateInstance operation type TerminateInstanceResponse struct { // The underlying http response RawResponse *http.Response // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response TerminateInstanceResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response TerminateInstanceResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/tunnel_config.go��������������������������0000664�0000000�0000000�00000003131�13771713062�0026327�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // TunnelConfig Deprecated. For tunnel information, instead see: // * IPSecConnectionTunnel // * IPSecConnectionTunnelSharedSecret type TunnelConfig struct { // The IP address of Oracle's VPN headend. // Example: `129.146.17.50` IpAddress *string `mandatory:"true" json:"ipAddress"` // The shared secret of the IPSec tunnel. // Example: `EXAMPLEToUis6j1cp8GdVQxcmdfMO0yXMLilZTbYCMDGu4V8o` SharedSecret *string `mandatory:"true" json:"sharedSecret"` // The date and time the IPSec connection was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` } func (m TunnelConfig) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/tunnel_cpe_device_config.go���������������0000664�0000000�0000000�00000003060�13771713062�0030476�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // TunnelCpeDeviceConfig The set of CPE configuration answers for the tunnel, which the customer provides in // UpdateTunnelCpeDeviceConfig. // The answers correlate to the questions that are specific to the CPE device type (see the // `parameters` attribute of CpeDeviceShapeDetail). // See these related operations: // * GetTunnelCpeDeviceConfig // * GetTunnelCpeDeviceConfigContent // * GetIpsecCpeDeviceConfigContent // * GetCpeDeviceConfigContent type TunnelCpeDeviceConfig struct { TunnelCpeDeviceConfigParameter []CpeDeviceConfigAnswer `mandatory:"false" json:"tunnelCpeDeviceConfigParameter"` } func (m TunnelCpeDeviceConfig) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/tunnel_status.go��������������������������0000664�0000000�0000000�00000005431�13771713062�0026412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // TunnelStatus Deprecated. For tunnel information, instead see IPSecConnectionTunnel. type TunnelStatus struct { // The IP address of Oracle's VPN headend. // Example: `129.146.17.50` IpAddress *string `mandatory:"true" json:"ipAddress"` // The tunnel's current state. LifecycleState TunnelStatusLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The date and time the IPSec connection was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // When the state of the tunnel last changed, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeStateModified *common.SDKTime `mandatory:"false" json:"timeStateModified"` } func (m TunnelStatus) String() string { return common.PointerString(m) } // TunnelStatusLifecycleStateEnum Enum with underlying type: string type TunnelStatusLifecycleStateEnum string // Set of constants representing the allowable values for TunnelStatusLifecycleStateEnum const ( TunnelStatusLifecycleStateUp TunnelStatusLifecycleStateEnum = "UP" TunnelStatusLifecycleStateDown TunnelStatusLifecycleStateEnum = "DOWN" TunnelStatusLifecycleStateDownForMaintenance TunnelStatusLifecycleStateEnum = "DOWN_FOR_MAINTENANCE" ) var mappingTunnelStatusLifecycleState = map[string]TunnelStatusLifecycleStateEnum{ "UP": TunnelStatusLifecycleStateUp, "DOWN": TunnelStatusLifecycleStateDown, "DOWN_FOR_MAINTENANCE": TunnelStatusLifecycleStateDownForMaintenance, } // GetTunnelStatusLifecycleStateEnumValues Enumerates the set of values for TunnelStatusLifecycleStateEnum func GetTunnelStatusLifecycleStateEnumValues() []TunnelStatusLifecycleStateEnum { values := make([]TunnelStatusLifecycleStateEnum, 0) for _, v := range mappingTunnelStatusLifecycleState { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/udp_options.go����������������������������0000664�0000000�0000000�00000003120�13771713062�0026036�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UdpOptions Optional object to specify ports for a UDP rule. If you specify UDP as the // protocol but omit this object, then all ports are allowed. type UdpOptions struct { // An inclusive range of allowed destination ports. Use the same number for the min and max // to indicate a single port. Defaults to all ports if not specified. DestinationPortRange *PortRange `mandatory:"false" json:"destinationPortRange"` // An inclusive range of allowed source ports. Use the same number for the min and max to // indicate a single port. Defaults to all ports if not specified. SourcePortRange *PortRange `mandatory:"false" json:"sourcePortRange"` } func (m UdpOptions) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_backup_details.go������0000664�0000000�0000000�00000003670�13771713062�0032433�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateBootVolumeBackupDetails The representation of UpdateBootVolumeBackupDetails type UpdateBootVolumeBackupDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A friendly user-specified name for the boot volume backup. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateBootVolumeBackupDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������update_boot_volume_backup_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005436�13771713062�0034337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateBootVolumeBackupRequest wrapper for the UpdateBootVolumeBackup operation type UpdateBootVolumeBackupRequest struct { // The OCID of the boot volume backup. BootVolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeBackupId"` // Update boot volume backup fields UpdateBootVolumeBackupDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateBootVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateBootVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateBootVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateBootVolumeBackupResponse wrapper for the UpdateBootVolumeBackup operation type UpdateBootVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeBackup instance BootVolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` } func (response UpdateBootVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateBootVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_details.go�������������0000664�0000000�0000000�00000005042�13771713062�0031101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateBootVolumeDetails The representation of UpdateBootVolumeDetails type UpdateBootVolumeDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The size to resize the volume to in GBs. Has to be larger than the current size. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The number of volume performance units (VPUs) that will be applied to this volume per GB, // representing the Block Volume service's elastic performance options. // See Block Volume Elastic Performance (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumeelasticperformance.htm) for more information. // Allowed values: // * `10`: Represents Balanced option. // * `20`: Represents Higher Performance option. VpusPerGB *int64 `mandatory:"false" json:"vpusPerGB"` } func (m UpdateBootVolumeDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_kms_key_details.go�����0000664�0000000�0000000�00000002773�13771713062�0032633�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateBootVolumeKmsKeyDetails The representation of UpdateBootVolumeKmsKeyDetails type UpdateBootVolumeKmsKeyDetails struct { // The OCID of the new Key Management key to assign to protect the specified volume. // This key has to be a valid Key Management key, and policies must exist to allow the user and the Block Volume service to access this key. // If you specify the same OCID as the previous key's OCID, the Block Volume service will use it to regenerate a volume encryption key. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m UpdateBootVolumeKmsKeyDetails) String() string { return common.PointerString(m) } �����update_boot_volume_kms_key_request_response.go������������������������������������������������������0000664�0000000�0000000�00000006030�13771713062�0034523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateBootVolumeKmsKeyRequest wrapper for the UpdateBootVolumeKmsKey operation type UpdateBootVolumeKmsKeyRequest struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` // Updates the Key Management master encryption key assigned to the specified boot volume. UpdateBootVolumeKmsKeyDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateBootVolumeKmsKeyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateBootVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateBootVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateBootVolumeKmsKeyResponse wrapper for the UpdateBootVolumeKmsKey operation type UpdateBootVolumeKmsKeyResponse struct { // The underlying http response RawResponse *http.Response // The BootVolumeKmsKey instance BootVolumeKmsKey `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateBootVolumeKmsKeyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateBootVolumeKmsKeyResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_boot_volume_request_response.go����0000664�0000000�0000000�00000005617�13771713062�0033072�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateBootVolumeRequest wrapper for the UpdateBootVolume operation type UpdateBootVolumeRequest struct { // The OCID of the boot volume. BootVolumeId *string `mandatory:"true" contributesTo:"path" name:"bootVolumeId"` // Update boot volume's display name. UpdateBootVolumeDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateBootVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateBootVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateBootVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateBootVolumeResponse wrapper for the UpdateBootVolume operation type UpdateBootVolumeResponse struct { // The underlying http response RawResponse *http.Response // The BootVolume instance BootVolume `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateBootVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateBootVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_cluster_network_details.go���������0000664�0000000�0000000�00000003660�13771713062�0032005�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateClusterNetworkDetails The data to update a cluster network. type UpdateClusterNetworkDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateClusterNetworkDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_cluster_network_request_response.go0000664�0000000�0000000�00000007010�13771713062�0033757�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateClusterNetworkRequest wrapper for the UpdateClusterNetwork operation type UpdateClusterNetworkRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster network. ClusterNetworkId *string `mandatory:"true" contributesTo:"path" name:"clusterNetworkId"` // Update cluster network UpdateClusterNetworkDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateClusterNetworkRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateClusterNetworkRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateClusterNetworkRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateClusterNetworkResponse wrapper for the UpdateClusterNetwork operation type UpdateClusterNetworkResponse struct { // The underlying http response RawResponse *http.Response // The ClusterNetwork instance ClusterNetwork `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateClusterNetworkResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateClusterNetworkResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_details.go���������0000664�0000000�0000000�00000003674�13771713062�0032003�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateConsoleHistoryDetails The representation of UpdateConsoleHistoryDetails type UpdateConsoleHistoryDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateConsoleHistoryDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_console_history_request_response.go0000664�0000000�0000000�00000005727�13771713062�0033765�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateConsoleHistoryRequest wrapper for the UpdateConsoleHistory operation type UpdateConsoleHistoryRequest struct { // The OCID of the console history. InstanceConsoleHistoryId *string `mandatory:"true" contributesTo:"path" name:"instanceConsoleHistoryId"` // Update instance fields UpdateConsoleHistoryDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateConsoleHistoryRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateConsoleHistoryRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateConsoleHistoryRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateConsoleHistoryResponse wrapper for the UpdateConsoleHistory operation type UpdateConsoleHistoryResponse struct { // The underlying http response RawResponse *http.Response // The ConsoleHistory instance ConsoleHistory `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateConsoleHistoryResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateConsoleHistoryResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_details.go���������������������0000664�0000000�0000000�00000004746�13771713062�0027330�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateCpeDetails The representation of UpdateCpeDetails type UpdateCpeDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the CPE device type. You can provide // a value if you want to generate CPE device configuration content for IPSec connections // that use this CPE. For a list of possible values, see // ListCpeDeviceShapes. // For more information about generating CPE device configuration content, see: // * GetCpeDeviceConfigContent // * GetIpsecCpeDeviceConfigContent // * GetTunnelCpeDeviceConfigContent // * GetTunnelCpeDeviceConfig CpeDeviceShapeId *string `mandatory:"false" json:"cpeDeviceShapeId"` } func (m UpdateCpeDetails) String() string { return common.PointerString(m) } ��������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_cpe_request_response.go������������0000664�0000000�0000000�00000005427�13771713062�0031306�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateCpeRequest wrapper for the UpdateCpe operation type UpdateCpeRequest struct { // The OCID of the CPE. CpeId *string `mandatory:"true" contributesTo:"path" name:"cpeId"` // Details object for updating a CPE. UpdateCpeDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateCpeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateCpeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateCpeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateCpeResponse wrapper for the UpdateCpe operation type UpdateCpeResponse struct { // The underlying http response RawResponse *http.Response // The Cpe instance Cpe `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateCpeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateCpeResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_details.go�����������0000664�0000000�0000000�00000004665�13771713062�0031423�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateCrossConnectDetails Update a CrossConnect type UpdateCrossConnectDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Set to true to activate the cross-connect. You activate it after the physical cabling // is complete, and you've confirmed the cross-connect's light levels are good and your side // of the interface is up. Activation indicates to Oracle that the physical connection is ready. // Example: `true` IsActive *bool `mandatory:"false" json:"isActive"` // A reference name or identifier for the physical fiber connection that this cross-connect // uses. CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` } func (m UpdateCrossConnectDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_group_details.go�����0000664�0000000�0000000�00000004206�13771713062�0032626�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateCrossConnectGroupDetails The representation of UpdateCrossConnectGroupDetails type UpdateCrossConnectGroupDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // A reference name or identifier for the physical fiber connection that this cross-connect // group uses. CustomerReferenceName *string `mandatory:"false" json:"customerReferenceName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateCrossConnectGroupDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_cross_connect_group_request_response.go������������������������������������������������������0000664�0000000�0000000�00000006004�13771713062�0034526�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateCrossConnectGroupRequest wrapper for the UpdateCrossConnectGroup operation type UpdateCrossConnectGroupRequest struct { // The OCID of the cross-connect group. CrossConnectGroupId *string `mandatory:"true" contributesTo:"path" name:"crossConnectGroupId"` // Update CrossConnectGroup fields UpdateCrossConnectGroupDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateCrossConnectGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateCrossConnectGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateCrossConnectGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateCrossConnectGroupResponse wrapper for the UpdateCrossConnectGroup operation type UpdateCrossConnectGroupResponse struct { // The underlying http response RawResponse *http.Response // The CrossConnectGroup instance CrossConnectGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateCrossConnectGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateCrossConnectGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_cross_connect_request_response.go��0000664�0000000�0000000�00000005652�13771713062�0033401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateCrossConnectRequest wrapper for the UpdateCrossConnect operation type UpdateCrossConnectRequest struct { // The OCID of the cross-connect. CrossConnectId *string `mandatory:"true" contributesTo:"path" name:"crossConnectId"` // Update CrossConnect fields. UpdateCrossConnectDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateCrossConnectRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateCrossConnectRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateCrossConnectRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateCrossConnectResponse wrapper for the UpdateCrossConnect operation type UpdateCrossConnectResponse struct { // The underlying http response RawResponse *http.Response // The CrossConnect instance CrossConnect `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateCrossConnectResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateCrossConnectResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_dedicated_vm_host_details.go�������0000664�0000000�0000000�00000003762�13771713062�0032223�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateDedicatedVmHostDetails Details for updating the dedicated virtual machine host details. type UpdateDedicatedVmHostDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My dedicated VM host` DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateDedicatedVmHostDetails) String() string { return common.PointerString(m) } ��������������update_dedicated_vm_host_request_response.go��������������������������������������������������������0000664�0000000�0000000�00000006706�13771713062�0034126�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateDedicatedVmHostRequest wrapper for the UpdateDedicatedVmHost operation type UpdateDedicatedVmHostRequest struct { // The OCID of the dedicated VM host. DedicatedVmHostId *string `mandatory:"true" contributesTo:"path" name:"dedicatedVmHostId"` // Update dedicated VM host details UpdateDedicatedVmHostDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateDedicatedVmHostRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateDedicatedVmHostRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateDedicatedVmHostRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateDedicatedVmHostResponse wrapper for the UpdateDedicatedVmHost operation type UpdateDedicatedVmHostResponse struct { // The underlying http response RawResponse *http.Response // The DedicatedVmHost instance DedicatedVmHost `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateDedicatedVmHostResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateDedicatedVmHostResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_details.go��������������������0000664�0000000�0000000�00000005503�13771713062�0027467�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // UpdateDhcpDetails The representation of UpdateDhcpDetails type UpdateDhcpDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` Options []DhcpOption `mandatory:"false" json:"options"` } func (m UpdateDhcpDetails) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *UpdateDhcpDetails) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` DisplayName *string `json:"displayName"` FreeformTags map[string]string `json:"freeformTags"` Options []dhcpoption `json:"options"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.DisplayName = model.DisplayName m.FreeformTags = model.FreeformTags m.Options = make([]DhcpOption, len(model.Options)) for i, n := range model.Options { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) if e != nil { return e } if nn != nil { m.Options[i] = nn.(DhcpOption) } else { m.Options[i] = nil } } return } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_dhcp_options_request_response.go���0000664�0000000�0000000�00000005643�13771713062�0033230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateDhcpOptionsRequest wrapper for the UpdateDhcpOptions operation type UpdateDhcpOptionsRequest struct { // The OCID for the set of DHCP options. DhcpId *string `mandatory:"true" contributesTo:"path" name:"dhcpId"` // Request object for updating a set of DHCP options. UpdateDhcpDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateDhcpOptionsRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateDhcpOptionsRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateDhcpOptionsRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateDhcpOptionsResponse wrapper for the UpdateDhcpOptions operation type UpdateDhcpOptionsResponse struct { // The underlying http response RawResponse *http.Response // The DhcpOptions instance DhcpOptions `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateDhcpOptionsResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateDhcpOptionsResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_details.go����������0000664�0000000�0000000�00000003363�13771713062�0031537�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateDrgAttachmentDetails The representation of UpdateDrgAttachmentDetails type UpdateDrgAttachmentDetails struct { // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The OCID of the route table the DRG attachment will use. // For information about why you would associate a route table with a DRG attachment, see: // * Transit Routing: Access to Multiple VCNs in Same Region (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm) // * Transit Routing: Private Access to Oracle Services (https://docs.cloud.oracle.com/Content/Network/Tasks/transitroutingoracleservices.htm) RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m UpdateDrgAttachmentDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_drg_attachment_request_response.go�0000664�0000000�0000000�00000005716�13771713062�0033524�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateDrgAttachmentRequest wrapper for the UpdateDrgAttachment operation type UpdateDrgAttachmentRequest struct { // The OCID of the DRG attachment. DrgAttachmentId *string `mandatory:"true" contributesTo:"path" name:"drgAttachmentId"` // Details object for updating a `DrgAttachment`. UpdateDrgAttachmentDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateDrgAttachmentRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateDrgAttachmentRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateDrgAttachmentRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateDrgAttachmentResponse wrapper for the UpdateDrgAttachment operation type UpdateDrgAttachmentResponse struct { // The underlying http response RawResponse *http.Response // The DrgAttachment instance DrgAttachment `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateDrgAttachmentResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateDrgAttachmentResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_drg_details.go���������������������0000664�0000000�0000000�00000003620�13771713062�0027323�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateDrgDetails The representation of UpdateDrgDetails type UpdateDrgDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateDrgDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_drg_request_response.go������������0000664�0000000�0000000�00000005427�13771713062�0031313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateDrgRequest wrapper for the UpdateDrg operation type UpdateDrgRequest struct { // The OCID of the DRG. DrgId *string `mandatory:"true" contributesTo:"path" name:"drgId"` // Details object for updating a DRG. UpdateDrgDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateDrgRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateDrgRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateDrgRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateDrgResponse wrapper for the UpdateDrg operation type UpdateDrgResponse struct { // The underlying http response RawResponse *http.Response // The Drg instance Drg `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateDrgResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateDrgResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_i_p_sec_connection_request_response.go�������������������������������������������������������0000664�0000000�0000000�00000005733�13771713062�0034300�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateIPSecConnectionRequest wrapper for the UpdateIPSecConnection operation type UpdateIPSecConnectionRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // Details object for updating a IPSec connection. UpdateIpSecConnectionDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateIPSecConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateIPSecConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateIPSecConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateIPSecConnectionResponse wrapper for the UpdateIPSecConnection operation type UpdateIPSecConnectionResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnection instance IpSecConnection `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateIPSecConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateIPSecConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������update_i_p_sec_connection_tunnel_request_response.go������������������������������������������������0000664�0000000�0000000�00000006337�13771713062�0035666�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateIPSecConnectionTunnelRequest wrapper for the UpdateIPSecConnectionTunnel operation type UpdateIPSecConnectionTunnelRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` // Details object for updating a IPSecConnection tunnel's details. UpdateIpSecConnectionTunnelDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateIPSecConnectionTunnelRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateIPSecConnectionTunnelRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateIPSecConnectionTunnelRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateIPSecConnectionTunnelResponse wrapper for the UpdateIPSecConnectionTunnel operation type UpdateIPSecConnectionTunnelResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnectionTunnel instance IpSecConnectionTunnel `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateIPSecConnectionTunnelResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateIPSecConnectionTunnelResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_i_p_sec_connection_tunnel_shared_secret_request_response.go����������������������������������0000664�0000000�0000000�00000006635�13771713062�0040562�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateIPSecConnectionTunnelSharedSecretRequest wrapper for the UpdateIPSecConnectionTunnelSharedSecret operation type UpdateIPSecConnectionTunnelSharedSecretRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` // Details object for updating a IPSec connection tunnel's sharedSecret. UpdateIpSecConnectionTunnelSharedSecretDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateIPSecConnectionTunnelSharedSecretRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateIPSecConnectionTunnelSharedSecretRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateIPSecConnectionTunnelSharedSecretRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateIPSecConnectionTunnelSharedSecretResponse wrapper for the UpdateIPSecConnectionTunnelSharedSecret operation type UpdateIPSecConnectionTunnelSharedSecretResponse struct { // The underlying http response RawResponse *http.Response // The IpSecConnectionTunnelSharedSecret instance IpSecConnectionTunnelSharedSecret `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateIPSecConnectionTunnelSharedSecretResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateIPSecConnectionTunnelSharedSecretResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_image_details.go�������������������0000664�0000000�0000000�00000004275�13771713062�0027640�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateImageDetails The representation of UpdateImageDetails type UpdateImageDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My custom Oracle Linux image` DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Operating system // Example: `Oracle Linux` OperatingSystem *string `mandatory:"false" json:"operatingSystem"` // Operating system version // Example: `7.4` OperatingSystemVersion *string `mandatory:"false" json:"operatingSystemVersion"` } func (m UpdateImageDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_image_request_response.go����������0000664�0000000�0000000�00000006646�13771713062�0031625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateImageRequest wrapper for the UpdateImage operation type UpdateImageRequest struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image. ImageId *string `mandatory:"true" contributesTo:"path" name:"imageId"` // Updates the image display name field. Avoid entering confidential information. UpdateImageDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateImageRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateImageRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateImageRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateImageResponse wrapper for the UpdateImage operation type UpdateImageResponse struct { // The underlying http response RawResponse *http.Response // The Image instance Image `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateImageResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateImageResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_instance_agent_config_details.go���0000664�0000000�0000000�00000002721�13771713062�0033057�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateInstanceAgentConfigDetails Instance agent configuration options to choose for updating the instance type UpdateInstanceAgentConfigDetails struct { // Whether the agent running on the instance can gather performance metrics and monitor the instance. IsMonitoringDisabled *bool `mandatory:"false" json:"isMonitoringDisabled"` // Whether the agent running on the instance can run all the available management plugins IsManagementDisabled *bool `mandatory:"false" json:"isManagementDisabled"` } func (m UpdateInstanceAgentConfigDetails) String() string { return common.PointerString(m) } �����������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_instance_configuration_details.go��0000664�0000000�0000000�00000004001�13771713062�0033274�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateInstanceConfigurationDetails The representation of UpdateInstanceConfigurationDetails type UpdateInstanceConfigurationDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My instance configuration` DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateInstanceConfigurationDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_instance_configuration_request_response.go���������������������������������������������������0000664�0000000�0000000�00000007160�13771713062�0035207�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateInstanceConfigurationRequest wrapper for the UpdateInstanceConfiguration operation type UpdateInstanceConfigurationRequest struct { // The OCID of the instance configuration. InstanceConfigurationId *string `mandatory:"true" contributesTo:"path" name:"instanceConfigurationId"` // Updates the freeFormTags, definedTags, and display name of an instance configuration. UpdateInstanceConfigurationDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateInstanceConfigurationRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateInstanceConfigurationRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateInstanceConfigurationRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateInstanceConfigurationResponse wrapper for the UpdateInstanceConfiguration operation type UpdateInstanceConfigurationResponse struct { // The underlying http response RawResponse *http.Response // The InstanceConfiguration instance InstanceConfiguration `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateInstanceConfigurationResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateInstanceConfigurationResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_instance_details.go����������������0000664�0000000�0000000�00000010502�13771713062�0030350�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateInstanceDetails The representation of UpdateInstanceDetails type UpdateInstanceDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. // Example: `My bare metal instance` DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Instance agent configuration options to choose for updating the instance AgentConfig *UpdateInstanceAgentConfigDetails `mandatory:"false" json:"agentConfig"` // Custom metadata key/value string pairs that you provide. Any set of key/value pairs // provided here will completely replace the current set of key/value pairs in the 'metadata' // field on the instance. // Both the 'user_data' and 'ssh_authorized_keys' fields cannot be changed after an instance // has launched. Any request which updates, removes, or adds either of these fields will be // rejected. You must provide the same values for 'user_data' and 'ssh_authorized_keys' that // already exist on the instance. Metadata map[string]string `mandatory:"false" json:"metadata"` // Additional metadata key/value pairs that you provide. They serve the same purpose and // functionality as fields in the 'metadata' object. // They are distinguished from 'metadata' fields in that these can be nested JSON objects // (whereas 'metadata' fields are string/string maps only). // Both the 'user_data' and 'ssh_authorized_keys' fields cannot be changed after an instance // has launched. Any request which updates, removes, or adds either of these fields will be // rejected. You must provide the same values for 'user_data' and 'ssh_authorized_keys' that // already exist on the instance. ExtendedMetadata map[string]interface{} `mandatory:"false" json:"extendedMetadata"` // The shape of the instance. The shape determines the number of CPUs and the amount of memory // allocated to the instance. For more information about how to change shapes, and a list of // shapes that are supported, see // Changing the Shape of an Instance (https://docs.cloud.oracle.com/iaas/Content/Compute/Tasks/resizinginstances.htm). // For details about the CPUs, memory, and other properties of each shape, see // Compute Shapes (https://docs.cloud.oracle.com/iaas/Content/Compute/References/computeshapes.htm). // The new shape must be compatible with the image that was used to launch the instance. You // can enumerate all available shapes and determine image compatibility by calling // ListShapes. // If the instance is running when you change the shape, the instance is rebooted. // Example: `VM.Standard2.1` Shape *string `mandatory:"false" json:"shape"` ShapeConfig *UpdateInstanceShapeConfigDetails `mandatory:"false" json:"shapeConfig"` } func (m UpdateInstanceDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_details.go�����������0000664�0000000�0000000�00000005327�13771713062�0031412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateInstancePoolDetails The data to update an instance pool. type UpdateInstancePoolDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the instance pool. Does not have to be unique, and it's // changeable. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance configuration associated with the // instance pool. InstanceConfigurationId *string `mandatory:"false" json:"instanceConfigurationId"` // The placement configurations for the instance pool. Provide one placement configuration for // each availability domain. // To use the instance pool with a regional subnet, provide a placement configuration for // each availability domain, and include the regional subnet in each placement // configuration. PlacementConfigurations []UpdateInstancePoolPlacementConfigurationDetails `mandatory:"false" json:"placementConfigurations"` // The number of instances that should be in the instance pool. Size *int `mandatory:"false" json:"size"` } func (m UpdateInstancePoolDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_instance_pool_placement_configuration_details.go���������������������������������������������0000664�0000000�0000000�00000004373�13771713062�0036312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateInstancePoolPlacementConfigurationDetails The location for where an instance pool will place instances. type UpdateInstancePoolPlacementConfigurationDetails struct { // The availability domain to place instances. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the primary subnet to place instances. PrimarySubnetId *string `mandatory:"true" json:"primarySubnetId"` // The fault domains to place instances. // If you don't provide any values, the system makes a best effort to distribute // instances across all fault domains based on capacity. // To distribute the instances evenly across selected fault domains, provide a // set of fault domains. For example, you might want instances to be evenly // distributed if your applications require high availability. // To get a list of fault domains, use the // ListFaultDomains operation // in the Identity and Access Management Service API. // Example: `[FAULT-DOMAIN-1, FAULT-DOMAIN-2, FAULT-DOMAIN-3]` FaultDomains []string `mandatory:"false" json:"faultDomains"` // The set of subnet OCIDs for secondary VNICs for instances in the pool. SecondaryVnicSubnets []InstancePoolPlacementSecondaryVnicSubnet `mandatory:"false" json:"secondaryVnicSubnets"` } func (m UpdateInstancePoolPlacementConfigurationDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_instance_pool_request_response.go��0000664�0000000�0000000�00000006755�13771713062�0033401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateInstancePoolRequest wrapper for the UpdateInstancePool operation type UpdateInstancePoolRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the instance pool. InstancePoolId *string `mandatory:"true" contributesTo:"path" name:"instancePoolId"` // Update instance pool configuration UpdateInstancePoolDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateInstancePoolRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateInstancePoolRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateInstancePoolRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateInstancePoolResponse wrapper for the UpdateInstancePool operation type UpdateInstancePoolResponse struct { // The underlying http response RawResponse *http.Response // The InstancePool instance InstancePool `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateInstancePoolResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateInstancePoolResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_instance_request_response.go�������0000664�0000000�0000000�00000007142�13771713062�0032337�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateInstanceRequest wrapper for the UpdateInstance operation type UpdateInstanceRequest struct { // The OCID of the instance. InstanceId *string `mandatory:"true" contributesTo:"path" name:"instanceId"` // Update instance fields UpdateInstanceDetails `contributesTo:"body"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateInstanceRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateInstanceRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateInstanceRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateInstanceResponse wrapper for the UpdateInstance operation type UpdateInstanceResponse struct { // The underlying http response RawResponse *http.Response // The Instance instance Instance `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` // The OCID of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) // with this ID to track the status of the request. OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` } func (response UpdateInstanceResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateInstanceResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_instance_shape_config_details.go���0000664�0000000�0000000�00000003310�13771713062�0033054�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateInstanceShapeConfigDetails The shape configuration requested for the instance. If provided, the instance will be updated // with the resources specified. In the case where some properties are missing, // the missing values will be set to the default for the provided `shape`. // Each shape only supports certain configurable values. If the `shape` is provided // and the configuration values are invalid for that new `shape`, an error will be returned. // If no `shape` is provided and the configuration values are invalid for the instance's // existing shape, an error will be returned. type UpdateInstanceShapeConfigDetails struct { // The total number of OCPUs available to the instance. Ocpus *float32 `mandatory:"false" json:"ocpus"` } func (m UpdateInstanceShapeConfigDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_internet_gateway_details.go��������0000664�0000000�0000000�00000004033�13771713062�0032117�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateInternetGatewayDetails The representation of UpdateInternetGatewayDetails type UpdateInternetGatewayDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Whether the gateway is enabled. IsEnabled *bool `mandatory:"false" json:"isEnabled"` } func (m UpdateInternetGatewayDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_internet_gateway_request_response.go���������������������������������������������������������0000664�0000000�0000000�00000005722�13771713062�0034027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateInternetGatewayRequest wrapper for the UpdateInternetGateway operation type UpdateInternetGatewayRequest struct { // The OCID of the internet gateway. IgId *string `mandatory:"true" contributesTo:"path" name:"igId"` // Details for updating the internet gateway. UpdateInternetGatewayDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateInternetGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateInternetGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateInternetGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateInternetGatewayResponse wrapper for the UpdateInternetGateway operation type UpdateInternetGatewayResponse struct { // The underlying http response RawResponse *http.Response // The InternetGateway instance InternetGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateInternetGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateInternetGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_details.go�������0000664�0000000�0000000�00000011073�13771713062�0032231�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateIpSecConnectionDetails The representation of UpdateIpSecConnectionDetails type UpdateIpSecConnectionDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Your identifier for your CPE device. Can be either an IP address or a hostname (specifically, the // fully qualified domain name (FQDN)). The type of identifier you provide here must correspond // to the value for `cpeLocalIdentifierType`. // For information about why you'd provide this value, see // If Your CPE Is Behind a NAT Device (https://docs.cloud.oracle.com/Content/Network/Tasks/overviewIPsec.htm#nat). // Example IP address: `10.0.3.3` // Example hostname: `cpe.example.com` CpeLocalIdentifier *string `mandatory:"false" json:"cpeLocalIdentifier"` // The type of identifier for your CPE device. The value you provide here must correspond to the value // for `cpeLocalIdentifier`. CpeLocalIdentifierType UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum `mandatory:"false" json:"cpeLocalIdentifierType,omitempty"` // Static routes to the CPE. If you provide this attribute, it replaces the entire current set of // static routes. A static route's CIDR must not be a multicast address or class E address. // The CIDR can be either IPv4 or IPv6. Note that IPv6 addressing is currently supported only // in certain regions. See IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `10.0.1.0/24` // Example: `2001:db8::/32` StaticRoutes []string `mandatory:"false" json:"staticRoutes"` } func (m UpdateIpSecConnectionDetails) String() string { return common.PointerString(m) } // UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum Enum with underlying type: string type UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum string // Set of constants representing the allowable values for UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum const ( UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "IP_ADDRESS" UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum = "HOSTNAME" ) var mappingUpdateIpSecConnectionDetailsCpeLocalIdentifierType = map[string]UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum{ "IP_ADDRESS": UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeIpAddress, "HOSTNAME": UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeHostname, } // GetUpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues Enumerates the set of values for UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum func GetUpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnumValues() []UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum { values := make([]UpdateIpSecConnectionDetailsCpeLocalIdentifierTypeEnum, 0) for _, v := range mappingUpdateIpSecConnectionDetailsCpeLocalIdentifierType { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_ip_sec_connection_tunnel_details.go0000664�0000000�0000000�00000010037�13771713062�0033615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateIpSecConnectionTunnelDetails The representation of UpdateIpSecConnectionTunnelDetails type UpdateIpSecConnectionTunnelDetails struct { // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The type of routing to use for this tunnel (either BGP dynamic routing or static routing). Routing UpdateIpSecConnectionTunnelDetailsRoutingEnum `mandatory:"false" json:"routing,omitempty"` // Internet Key Exchange protocol version. IkeVersion UpdateIpSecConnectionTunnelDetailsIkeVersionEnum `mandatory:"false" json:"ikeVersion,omitempty"` // Information for establishing a BGP session for the IPSec tunnel. BgpSessionConfig *UpdateIpSecTunnelBgpSessionDetails `mandatory:"false" json:"bgpSessionConfig"` } func (m UpdateIpSecConnectionTunnelDetails) String() string { return common.PointerString(m) } // UpdateIpSecConnectionTunnelDetailsRoutingEnum Enum with underlying type: string type UpdateIpSecConnectionTunnelDetailsRoutingEnum string // Set of constants representing the allowable values for UpdateIpSecConnectionTunnelDetailsRoutingEnum const ( UpdateIpSecConnectionTunnelDetailsRoutingBgp UpdateIpSecConnectionTunnelDetailsRoutingEnum = "BGP" UpdateIpSecConnectionTunnelDetailsRoutingStatic UpdateIpSecConnectionTunnelDetailsRoutingEnum = "STATIC" ) var mappingUpdateIpSecConnectionTunnelDetailsRouting = map[string]UpdateIpSecConnectionTunnelDetailsRoutingEnum{ "BGP": UpdateIpSecConnectionTunnelDetailsRoutingBgp, "STATIC": UpdateIpSecConnectionTunnelDetailsRoutingStatic, } // GetUpdateIpSecConnectionTunnelDetailsRoutingEnumValues Enumerates the set of values for UpdateIpSecConnectionTunnelDetailsRoutingEnum func GetUpdateIpSecConnectionTunnelDetailsRoutingEnumValues() []UpdateIpSecConnectionTunnelDetailsRoutingEnum { values := make([]UpdateIpSecConnectionTunnelDetailsRoutingEnum, 0) for _, v := range mappingUpdateIpSecConnectionTunnelDetailsRouting { values = append(values, v) } return values } // UpdateIpSecConnectionTunnelDetailsIkeVersionEnum Enum with underlying type: string type UpdateIpSecConnectionTunnelDetailsIkeVersionEnum string // Set of constants representing the allowable values for UpdateIpSecConnectionTunnelDetailsIkeVersionEnum const ( UpdateIpSecConnectionTunnelDetailsIkeVersionV1 UpdateIpSecConnectionTunnelDetailsIkeVersionEnum = "V1" UpdateIpSecConnectionTunnelDetailsIkeVersionV2 UpdateIpSecConnectionTunnelDetailsIkeVersionEnum = "V2" ) var mappingUpdateIpSecConnectionTunnelDetailsIkeVersion = map[string]UpdateIpSecConnectionTunnelDetailsIkeVersionEnum{ "V1": UpdateIpSecConnectionTunnelDetailsIkeVersionV1, "V2": UpdateIpSecConnectionTunnelDetailsIkeVersionV2, } // GetUpdateIpSecConnectionTunnelDetailsIkeVersionEnumValues Enumerates the set of values for UpdateIpSecConnectionTunnelDetailsIkeVersionEnum func GetUpdateIpSecConnectionTunnelDetailsIkeVersionEnumValues() []UpdateIpSecConnectionTunnelDetailsIkeVersionEnum { values := make([]UpdateIpSecConnectionTunnelDetailsIkeVersionEnum, 0) for _, v := range mappingUpdateIpSecConnectionTunnelDetailsIkeVersion { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_ip_sec_connection_tunnel_shared_secret_details.go��������������������������������������������0000664�0000000�0000000�00000002614�13771713062�0036433�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateIpSecConnectionTunnelSharedSecretDetails The representation of UpdateIpSecConnectionTunnelSharedSecretDetails type UpdateIpSecConnectionTunnelSharedSecretDetails struct { // The shared secret (pre-shared key) to use for the tunnel. Only numbers, letters, and spaces // are allowed. // Example: `EXAMPLEToUis6j1cp8GdVQxcmdfMO0yXMLilZTbYCMDGu4V8o` SharedSecret *string `mandatory:"false" json:"sharedSecret"` } func (m UpdateIpSecConnectionTunnelSharedSecretDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������update_ip_sec_tunnel_bgp_session_details.go���������������������������������������������������������0000664�0000000�0000000�00000005427�13771713062�0033721�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateIpSecTunnelBgpSessionDetails The representation of UpdateIpSecTunnelBgpSessionDetails type UpdateIpSecTunnelBgpSessionDetails struct { // The IP address for the Oracle end of the inside tunnel interface. // If the tunnel's `routing` attribute is set to `BGP` // (see UpdateIPSecConnectionTunnelDetails), this IP address // is used for the tunnel's BGP session. // If `routing` is instead set to `STATIC`, you can set this IP address to troubleshoot or // monitor the tunnel. // The value must be a /30 or /31. // If you are switching the tunnel from using BGP dynamic routing to static routing and want // to remove the value for `oracleInterfaceIp`, you can set the value to an empty string. // Example: `10.0.0.4/31` OracleInterfaceIp *string `mandatory:"false" json:"oracleInterfaceIp"` // The IP address for the CPE end of the inside tunnel interface. // If the tunnel's `routing` attribute is set to `BGP` // (see UpdateIPSecConnectionTunnelDetails), this IP address // is used for the tunnel's BGP session. // If `routing` is instead set to `STATIC`, you can set this IP address to troubleshoot or // monitor the tunnel. // The value must be a /30 or /31. // If you are switching the tunnel from using BGP dynamic routing to static routing and want // to remove the value for `customerInterfaceIp`, you can set the value to an empty string. // Example: `10.0.0.5/31` CustomerInterfaceIp *string `mandatory:"false" json:"customerInterfaceIp"` // The BGP ASN of the network on the CPE end of the BGP session. Can be a 2-byte or 4-byte ASN. // Uses "asplain" format. // If you are switching the tunnel from using BGP dynamic routing to static routing, the // `customerBgpAsn` must be null. // Example: `12345` (2-byte) or `1587232876` (4-byte) CustomerBgpAsn *string `mandatory:"false" json:"customerBgpAsn"` } func (m UpdateIpSecTunnelBgpSessionDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_ipv6_details.go��������������������0000664�0000000�0000000�00000005124�13771713062�0027434�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateIpv6Details The representation of UpdateIpv6Details type UpdateIpv6Details struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Whether the IPv6 can be used for internet communication. Allowed by default for an IPv6 in // a public subnet. Never allowed for an IPv6 in a private subnet. If the value is `true`, the // IPv6 uses its public IP address for internet communication. // If you switch this from `true` to `false`, the `publicIpAddress` attribute for the IPv6 // becomes null. // Example: `false` IsInternetAccessAllowed *bool `mandatory:"false" json:"isInternetAccessAllowed"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VNIC to reassign the IPv6 to. // The VNIC must be in the same subnet as the current VNIC. VnicId *string `mandatory:"false" json:"vnicId"` } func (m UpdateIpv6Details) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_ipv6_request_response.go�����������0000664�0000000�0000000�00000005532�13771713062�0031420�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateIpv6Request wrapper for the UpdateIpv6 operation type UpdateIpv6Request struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the IPv6. Ipv6Id *string `mandatory:"true" contributesTo:"path" name:"ipv6Id"` // IPv6 details to be updated. UpdateIpv6Details `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateIpv6Request) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateIpv6Request) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateIpv6Request) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateIpv6Response wrapper for the UpdateIpv6 operation type UpdateIpv6Response struct { // The underlying http response RawResponse *http.Response // The Ipv6 instance Ipv6 `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateIpv6Response) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateIpv6Response) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_local_peering_gateway_details.go���0000664�0000000�0000000�00000004430�13771713062�0033073�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateLocalPeeringGatewayDetails The representation of UpdateLocalPeeringGatewayDetails type UpdateLocalPeeringGatewayDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the route table the LPG will use. // For information about why you would associate a route table with an LPG, see // Transit Routing: Access to Multiple VCNs in Same Region (https://docs.cloud.oracle.com/Content/Network/Tasks/transitrouting.htm). RouteTableId *string `mandatory:"false" json:"routeTableId"` } func (m UpdateLocalPeeringGatewayDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_local_peering_gateway_request_response.go����������������������������������������������������0000664�0000000�0000000�00000006073�13771713062�0035002�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateLocalPeeringGatewayRequest wrapper for the UpdateLocalPeeringGateway operation type UpdateLocalPeeringGatewayRequest struct { // The OCID of the local peering gateway. LocalPeeringGatewayId *string `mandatory:"true" contributesTo:"path" name:"localPeeringGatewayId"` // Details object for updating a local peering gateway. UpdateLocalPeeringGatewayDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateLocalPeeringGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateLocalPeeringGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateLocalPeeringGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateLocalPeeringGatewayResponse wrapper for the UpdateLocalPeeringGateway operation type UpdateLocalPeeringGatewayResponse struct { // The underlying http response RawResponse *http.Response // The LocalPeeringGateway instance LocalPeeringGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateLocalPeeringGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateLocalPeeringGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_details.go�������������0000664�0000000�0000000�00000004114�13771713062�0031051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateNatGatewayDetails The representation of UpdateNatGatewayDetails type UpdateNatGatewayDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Whether the NAT gateway blocks traffic through it. The default is `false`. // Example: `true` BlockTraffic *bool `mandatory:"false" json:"blockTraffic"` } func (m UpdateNatGatewayDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_nat_gateway_request_response.go����0000664�0000000�0000000�00000005733�13771713062�0033042�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateNatGatewayRequest wrapper for the UpdateNatGateway operation type UpdateNatGatewayRequest struct { // The NAT gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). NatGatewayId *string `mandatory:"true" contributesTo:"path" name:"natGatewayId"` // Details object for updating a NAT gateway. UpdateNatGatewayDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateNatGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateNatGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateNatGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateNatGatewayResponse wrapper for the UpdateNatGateway operation type UpdateNatGatewayResponse struct { // The underlying http response RawResponse *http.Response // The NatGateway instance NatGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateNatGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateNatGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_network_security_group_details.go��0000664�0000000�0000000�00000003724�13771713062�0033410�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateNetworkSecurityGroupDetails The representation of UpdateNetworkSecurityGroupDetails type UpdateNetworkSecurityGroupDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateNetworkSecurityGroupDetails) String() string { return common.PointerString(m) } ��������������������������������������������update_network_security_group_request_response.go���������������������������������������������������0000664�0000000�0000000�00000006226�13771713062�0035312�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateNetworkSecurityGroupRequest wrapper for the UpdateNetworkSecurityGroup operation type UpdateNetworkSecurityGroupRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // Details object for updating a network security group. UpdateNetworkSecurityGroupDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateNetworkSecurityGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateNetworkSecurityGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateNetworkSecurityGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateNetworkSecurityGroupResponse wrapper for the UpdateNetworkSecurityGroup operation type UpdateNetworkSecurityGroupResponse struct { // The underlying http response RawResponse *http.Response // The NetworkSecurityGroup instance NetworkSecurityGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateNetworkSecurityGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateNetworkSecurityGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_network_security_group_security_rules_details.go���������������������������������������������0000664�0000000�0000000�00000002426�13771713062�0036470�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateNetworkSecurityGroupSecurityRulesDetails The representation of UpdateNetworkSecurityGroupSecurityRulesDetails type UpdateNetworkSecurityGroupSecurityRulesDetails struct { // The NSG security rules to update. SecurityRules []UpdateSecurityRuleDetails `mandatory:"false" json:"securityRules"` } func (m UpdateNetworkSecurityGroupSecurityRulesDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_network_security_group_security_rules_request_response.go������������������������������������0000664�0000000�0000000�00000005643�13771713062�0040455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateNetworkSecurityGroupSecurityRulesRequest wrapper for the UpdateNetworkSecurityGroupSecurityRules operation type UpdateNetworkSecurityGroupSecurityRulesRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group. NetworkSecurityGroupId *string `mandatory:"true" contributesTo:"path" name:"networkSecurityGroupId"` // Request with one or more security rules associated with the network security group that // will be updated. UpdateNetworkSecurityGroupSecurityRulesDetails `contributesTo:"body"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateNetworkSecurityGroupSecurityRulesRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateNetworkSecurityGroupSecurityRulesRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateNetworkSecurityGroupSecurityRulesRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateNetworkSecurityGroupSecurityRulesResponse wrapper for the UpdateNetworkSecurityGroupSecurityRules operation type UpdateNetworkSecurityGroupSecurityRulesResponse struct { // The underlying http response RawResponse *http.Response // The UpdatedNetworkSecurityGroupSecurityRules instance UpdatedNetworkSecurityGroupSecurityRules `presentIn:"body"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateNetworkSecurityGroupSecurityRulesResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateNetworkSecurityGroupSecurityRulesResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_details.go��������������0000664�0000000�0000000�00000005305�13771713062�0030713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdatePrivateIpDetails The representation of UpdatePrivateIpDetails type UpdatePrivateIpDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The hostname for the private IP. Used for DNS. The value // is the hostname portion of the private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be unique across all VNICs in the subnet and comply with // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // The OCID of the VNIC to reassign the private IP to. The VNIC must // be in the same subnet as the current VNIC. VnicId *string `mandatory:"false" json:"vnicId"` } func (m UpdatePrivateIpDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_private_ip_request_response.go�����0000664�0000000�0000000�00000005557�13771713062�0032705�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdatePrivateIpRequest wrapper for the UpdatePrivateIp operation type UpdatePrivateIpRequest struct { // The OCID of the private IP. PrivateIpId *string `mandatory:"true" contributesTo:"path" name:"privateIpId"` // Private IP details. UpdatePrivateIpDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdatePrivateIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdatePrivateIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdatePrivateIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdatePrivateIpResponse wrapper for the UpdatePrivateIp operation type UpdatePrivateIpResponse struct { // The underlying http response RawResponse *http.Response // The PrivateIp instance PrivateIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdatePrivateIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdatePrivateIpResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_details.go���������������0000664�0000000�0000000�00000004463�13771713062�0030523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdatePublicIpDetails The representation of UpdatePublicIpDetails type UpdatePublicIpDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. Avoid // entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the private IP to assign the public IP to. // * If the public IP is already assigned to a different private IP, it will be unassigned // and then reassigned to the specified private IP. // * If you set this field to an empty string, the public IP will be unassigned from the // private IP it is currently assigned to. PrivateIpId *string `mandatory:"false" json:"privateIpId"` } func (m UpdatePublicIpDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_public_ip_request_response.go������0000664�0000000�0000000�00000005535�13771713062�0032505�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdatePublicIpRequest wrapper for the UpdatePublicIp operation type UpdatePublicIpRequest struct { // The OCID of the public IP. PublicIpId *string `mandatory:"true" contributesTo:"path" name:"publicIpId"` // Public IP details. UpdatePublicIpDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdatePublicIpRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdatePublicIpRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdatePublicIpRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdatePublicIpResponse wrapper for the UpdatePublicIp operation type UpdatePublicIpResponse struct { // The underlying http response RawResponse *http.Response // The PublicIp instance PublicIp `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdatePublicIpResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdatePublicIpResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������update_remote_peering_connection_details.go���������������������������������������������������������0000664�0000000�0000000�00000003740�13771713062�0033716�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateRemotePeeringConnectionDetails The representation of UpdateRemotePeeringConnectionDetails type UpdateRemotePeeringConnectionDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateRemotePeeringConnectionDetails) String() string { return common.PointerString(m) } ��������������������������������update_remote_peering_connection_request_response.go������������������������������������������������0000664�0000000�0000000�00000006216�13771713062�0035700�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateRemotePeeringConnectionRequest wrapper for the UpdateRemotePeeringConnection operation type UpdateRemotePeeringConnectionRequest struct { // The OCID of the remote peering connection (RPC). RemotePeeringConnectionId *string `mandatory:"true" contributesTo:"path" name:"remotePeeringConnectionId"` // Request to the update the peering connection to remote region UpdateRemotePeeringConnectionDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateRemotePeeringConnectionRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateRemotePeeringConnectionRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateRemotePeeringConnectionRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateRemotePeeringConnectionResponse wrapper for the UpdateRemotePeeringConnection operation type UpdateRemotePeeringConnectionResponse struct { // The underlying http response RawResponse *http.Response // The RemotePeeringConnection instance RemotePeeringConnection `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateRemotePeeringConnectionResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateRemotePeeringConnectionResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_details.go�������������0000664�0000000�0000000�00000004074�13771713062�0031060�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateRouteTableDetails The representation of UpdateRouteTableDetails type UpdateRouteTableDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The collection of rules used for routing destination IPs to network devices. RouteRules []RouteRule `mandatory:"false" json:"routeRules"` } func (m UpdateRouteTableDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_route_table_request_response.go����0000664�0000000�0000000�00000005607�13771713062�0033044�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateRouteTableRequest wrapper for the UpdateRouteTable operation type UpdateRouteTableRequest struct { // The OCID of the route table. RtId *string `mandatory:"true" contributesTo:"path" name:"rtId"` // Details object for updating a route table. UpdateRouteTableDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateRouteTableRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateRouteTableRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateRouteTableRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateRouteTableResponse wrapper for the UpdateRouteTable operation type UpdateRouteTableResponse struct { // The underlying http response RawResponse *http.Response // The RouteTable instance RouteTable `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateRouteTableResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateRouteTableResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_details.go�����������0000664�0000000�0000000�00000004300�13771713062�0031445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateSecurityListDetails The representation of UpdateSecurityListDetails type UpdateSecurityListDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Rules for allowing egress IP packets. EgressSecurityRules []EgressSecurityRule `mandatory:"false" json:"egressSecurityRules"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // Rules for allowing ingress IP packets. IngressSecurityRules []IngressSecurityRule `mandatory:"false" json:"ingressSecurityRules"` } func (m UpdateSecurityListDetails) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_security_list_request_response.go��0000664�0000000�0000000�00000005665�13771713062�0033445�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateSecurityListRequest wrapper for the UpdateSecurityList operation type UpdateSecurityListRequest struct { // The OCID of the security list. SecurityListId *string `mandatory:"true" contributesTo:"path" name:"securityListId"` // Updated details for the security list. UpdateSecurityListDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateSecurityListRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateSecurityListRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateSecurityListRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateSecurityListResponse wrapper for the UpdateSecurityList operation type UpdateSecurityListResponse struct { // The underlying http response RawResponse *http.Response // The SecurityList instance SecurityList `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateSecurityListResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateSecurityListResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_security_rule_details.go�����������0000664�0000000�0000000�00000024614�13771713062�0031453�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateSecurityRuleDetails A rule for allowing inbound (`direction`= INGRESS) or outbound (`direction`= EGRESS) IP packets. type UpdateSecurityRuleDetails struct { // Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, // or `INGRESS` for rules to allow inbound IP packets. Direction UpdateSecurityRuleDetailsDirectionEnum `mandatory:"true" json:"direction"` // The Oracle-assigned ID of the security rule that you want to update. You can't change this value. // Example: `04ABEC` Id *string `mandatory:"true" json:"id"` // The transport protocol. Specify either `all` or an IPv4 protocol number as // defined in // Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). // Options are supported only for ICMP ("1"), TCP ("6"), UDP ("17"), and ICMPv6 ("58"). Protocol *string `mandatory:"true" json:"protocol"` // An optional description of your choice for the rule. Avoid entering confidential information. Description *string `mandatory:"false" json:"description"` // Conceptually, this is the range of IP addresses that a packet originating from the instance // can go to. // Allowed values: // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security rule for traffic destined for a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. // * The OCID of a NetworkSecurityGroup in the same // VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control // traffic between VNICs in the same NSG. Destination *string `mandatory:"false" json:"destination"` // Type of destination for the rule. Required if `direction` = `EGRESS`. // Allowed values: // * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a // Service (the rule is for traffic destined for a // particular `Service` through a service gateway). // * `NETWORK_SECURITY_GROUP`: If the rule's `destination` is the OCID of a // NetworkSecurityGroup. DestinationType UpdateSecurityRuleDetailsDestinationTypeEnum `mandatory:"false" json:"destinationType,omitempty"` // Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code // as defined in: // - ICMP Parameters (http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml) // - ICMPv6 Parameters (https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml) // If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and // codes are allowed. If you do provide this object, the type is required and the code is optional. // To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 ("Destination // Unreachable") code 4 ("Fragmentation Needed and Don't Fragment was Set"). If you need to specify // multiple codes for a single type, create a separate security rule for each. IcmpOptions *IcmpOptions `mandatory:"false" json:"icmpOptions"` // A stateless rule allows traffic in one direction. Remember to add a corresponding // stateless rule in the other direction if you need to support bidirectional traffic. For // example, if egress traffic allows TCP destination port 80, there should be an ingress // rule to allow TCP source port 80. Defaults to false, which means the rule is stateful // and a corresponding rule is not necessary for bidirectional traffic. IsStateless *bool `mandatory:"false" json:"isStateless"` // Conceptually, this is the range of IP addresses that a packet coming into the instance // can come from. // Allowed values: // * An IP address range in CIDR notation. For example: `192.168.1.0/24` or `2001:0db8:0123:45::/56` // Note that IPv6 addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // * The `cidrBlock` value for a Service, if you're // setting up a security rule for traffic coming from a particular `Service` through // a service gateway. For example: `oci-phx-objectstorage`. // * The OCID of a NetworkSecurityGroup in the same // VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control // traffic between VNICs in the same NSG. Source *string `mandatory:"false" json:"source"` // Type of source for the rule. Required if `direction` = `INGRESS`. // * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation. // * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a // Service (the rule is for traffic coming from a // particular `Service` through a service gateway). // * `NETWORK_SECURITY_GROUP`: If the rule's `source` is the OCID of a // NetworkSecurityGroup. SourceType UpdateSecurityRuleDetailsSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` // Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. // If you specify TCP as the protocol but omit this object, then all destination ports are allowed. TcpOptions *TcpOptions `mandatory:"false" json:"tcpOptions"` // Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. // If you specify UDP as the protocol but omit this object, then all destination ports are allowed. UdpOptions *UdpOptions `mandatory:"false" json:"udpOptions"` } func (m UpdateSecurityRuleDetails) String() string { return common.PointerString(m) } // UpdateSecurityRuleDetailsDestinationTypeEnum Enum with underlying type: string type UpdateSecurityRuleDetailsDestinationTypeEnum string // Set of constants representing the allowable values for UpdateSecurityRuleDetailsDestinationTypeEnum const ( UpdateSecurityRuleDetailsDestinationTypeCidrBlock UpdateSecurityRuleDetailsDestinationTypeEnum = "CIDR_BLOCK" UpdateSecurityRuleDetailsDestinationTypeServiceCidrBlock UpdateSecurityRuleDetailsDestinationTypeEnum = "SERVICE_CIDR_BLOCK" UpdateSecurityRuleDetailsDestinationTypeNetworkSecurityGroup UpdateSecurityRuleDetailsDestinationTypeEnum = "NETWORK_SECURITY_GROUP" ) var mappingUpdateSecurityRuleDetailsDestinationType = map[string]UpdateSecurityRuleDetailsDestinationTypeEnum{ "CIDR_BLOCK": UpdateSecurityRuleDetailsDestinationTypeCidrBlock, "SERVICE_CIDR_BLOCK": UpdateSecurityRuleDetailsDestinationTypeServiceCidrBlock, "NETWORK_SECURITY_GROUP": UpdateSecurityRuleDetailsDestinationTypeNetworkSecurityGroup, } // GetUpdateSecurityRuleDetailsDestinationTypeEnumValues Enumerates the set of values for UpdateSecurityRuleDetailsDestinationTypeEnum func GetUpdateSecurityRuleDetailsDestinationTypeEnumValues() []UpdateSecurityRuleDetailsDestinationTypeEnum { values := make([]UpdateSecurityRuleDetailsDestinationTypeEnum, 0) for _, v := range mappingUpdateSecurityRuleDetailsDestinationType { values = append(values, v) } return values } // UpdateSecurityRuleDetailsDirectionEnum Enum with underlying type: string type UpdateSecurityRuleDetailsDirectionEnum string // Set of constants representing the allowable values for UpdateSecurityRuleDetailsDirectionEnum const ( UpdateSecurityRuleDetailsDirectionEgress UpdateSecurityRuleDetailsDirectionEnum = "EGRESS" UpdateSecurityRuleDetailsDirectionIngress UpdateSecurityRuleDetailsDirectionEnum = "INGRESS" ) var mappingUpdateSecurityRuleDetailsDirection = map[string]UpdateSecurityRuleDetailsDirectionEnum{ "EGRESS": UpdateSecurityRuleDetailsDirectionEgress, "INGRESS": UpdateSecurityRuleDetailsDirectionIngress, } // GetUpdateSecurityRuleDetailsDirectionEnumValues Enumerates the set of values for UpdateSecurityRuleDetailsDirectionEnum func GetUpdateSecurityRuleDetailsDirectionEnumValues() []UpdateSecurityRuleDetailsDirectionEnum { values := make([]UpdateSecurityRuleDetailsDirectionEnum, 0) for _, v := range mappingUpdateSecurityRuleDetailsDirection { values = append(values, v) } return values } // UpdateSecurityRuleDetailsSourceTypeEnum Enum with underlying type: string type UpdateSecurityRuleDetailsSourceTypeEnum string // Set of constants representing the allowable values for UpdateSecurityRuleDetailsSourceTypeEnum const ( UpdateSecurityRuleDetailsSourceTypeCidrBlock UpdateSecurityRuleDetailsSourceTypeEnum = "CIDR_BLOCK" UpdateSecurityRuleDetailsSourceTypeServiceCidrBlock UpdateSecurityRuleDetailsSourceTypeEnum = "SERVICE_CIDR_BLOCK" UpdateSecurityRuleDetailsSourceTypeNetworkSecurityGroup UpdateSecurityRuleDetailsSourceTypeEnum = "NETWORK_SECURITY_GROUP" ) var mappingUpdateSecurityRuleDetailsSourceType = map[string]UpdateSecurityRuleDetailsSourceTypeEnum{ "CIDR_BLOCK": UpdateSecurityRuleDetailsSourceTypeCidrBlock, "SERVICE_CIDR_BLOCK": UpdateSecurityRuleDetailsSourceTypeServiceCidrBlock, "NETWORK_SECURITY_GROUP": UpdateSecurityRuleDetailsSourceTypeNetworkSecurityGroup, } // GetUpdateSecurityRuleDetailsSourceTypeEnumValues Enumerates the set of values for UpdateSecurityRuleDetailsSourceTypeEnum func GetUpdateSecurityRuleDetailsSourceTypeEnumValues() []UpdateSecurityRuleDetailsSourceTypeEnum { values := make([]UpdateSecurityRuleDetailsSourceTypeEnum, 0) for _, v := range mappingUpdateSecurityRuleDetailsSourceType { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_details.go���������0000664�0000000�0000000�00000006211�13771713062�0031727�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateServiceGatewayDetails The representation of UpdateServiceGatewayDetails type UpdateServiceGatewayDetails struct { // Whether the service gateway blocks all traffic through it. The default is `false`. When // this is `true`, traffic is not routed to any services, regardless of route rules. // Example: `true` BlockTraffic *bool `mandatory:"false" json:"blockTraffic"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the route table the service gateway will use. // For information about why you would associate a route table with a service gateway, see // Transit Routing: Private Access to Oracle Services (https://docs.cloud.oracle.com/Content/Network/Tasks/transitroutingoracleservices.htm). RouteTableId *string `mandatory:"false" json:"routeTableId"` // List of all the `Service` objects you want enabled on this service gateway. Sending an empty list // means you want to disable all services. Omitting this parameter entirely keeps the // existing list of services intact. // You can also enable or disable a particular `Service` by using // AttachServiceId or // DetachServiceId. // For each enabled `Service`, make sure there's a route rule with the `Service` object's `cidrBlock` // as the rule's destination and the service gateway as the rule's target. See // RouteTable. Services []ServiceIdRequestDetails `mandatory:"false" json:"services"` } func (m UpdateServiceGatewayDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_service_gateway_request_response.go0000664�0000000�0000000�00000006043�13771713062�0033713�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateServiceGatewayRequest wrapper for the UpdateServiceGateway operation type UpdateServiceGatewayRequest struct { // The service gateway's OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ServiceGatewayId *string `mandatory:"true" contributesTo:"path" name:"serviceGatewayId"` // Details object for updating a service gateway. UpdateServiceGatewayDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateServiceGatewayRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateServiceGatewayRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateServiceGatewayRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateServiceGatewayResponse wrapper for the UpdateServiceGateway operation type UpdateServiceGatewayResponse struct { // The underlying http response RawResponse *http.Response // The ServiceGateway instance ServiceGateway `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateServiceGatewayResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateServiceGatewayResponse) HTTPResponse() *http.Response { return response.RawResponse } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_details.go������������������0000664�0000000�0000000�00000004731�13771713062�0030053�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateSubnetDetails The representation of UpdateSubnetDetails type UpdateSubnetDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // The OCID of the set of DHCP options the subnet will use. DhcpOptionsId *string `mandatory:"false" json:"dhcpOptionsId"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the route table the subnet will use. RouteTableId *string `mandatory:"false" json:"routeTableId"` // The OCIDs of the security list or lists the subnet will use. This // replaces the entire current set of security lists. Remember that // security lists are associated *with the subnet*, but the rules are // applied to the individual VNICs in the subnet. SecurityListIds []string `mandatory:"false" json:"securityListIds"` } func (m UpdateSubnetDetails) String() string { return common.PointerString(m) } ���������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_subnet_request_response.go���������0000664�0000000�0000000�00000005515�13771713062�0032035�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateSubnetRequest wrapper for the UpdateSubnet operation type UpdateSubnetRequest struct { // The OCID of the subnet. SubnetId *string `mandatory:"true" contributesTo:"path" name:"subnetId"` // Details object for updating a subnet. UpdateSubnetDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateSubnetRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateSubnetRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateSubnetRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateSubnetResponse wrapper for the UpdateSubnet operation type UpdateSubnetResponse struct { // The underlying http response RawResponse *http.Response // The Subnet instance Subnet `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateSubnetResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateSubnetResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_tunnel_cpe_device_config_details.go0000664�0000000�0000000�00000002403�13771713062�0033545�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateTunnelCpeDeviceConfigDetails The representation of UpdateTunnelCpeDeviceConfigDetails type UpdateTunnelCpeDeviceConfigDetails struct { // The set of configuration answers for a CPE device. TunnelCpeDeviceConfig []CpeDeviceConfigAnswer `mandatory:"false" json:"tunnelCpeDeviceConfig"` } func (m UpdateTunnelCpeDeviceConfigDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������update_tunnel_cpe_device_config_request_response.go�������������������������������������������������0000664�0000000�0000000�00000007315�13771713062�0035456�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateTunnelCpeDeviceConfigRequest wrapper for the UpdateTunnelCpeDeviceConfig operation type UpdateTunnelCpeDeviceConfigRequest struct { // The OCID of the IPSec connection. IpscId *string `mandatory:"true" contributesTo:"path" name:"ipscId"` // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the tunnel. TunnelId *string `mandatory:"true" contributesTo:"path" name:"tunnelId"` // Request to input the tunnel's cpe configuration parameters UpdateTunnelCpeDeviceConfigDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateTunnelCpeDeviceConfigRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateTunnelCpeDeviceConfigRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateTunnelCpeDeviceConfigRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateTunnelCpeDeviceConfigResponse wrapper for the UpdateTunnelCpeDeviceConfig operation type UpdateTunnelCpeDeviceConfigResponse struct { // The underlying http response RawResponse *http.Response // The TunnelCpeDeviceConfig instance TunnelCpeDeviceConfig `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateTunnelCpeDeviceConfigResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateTunnelCpeDeviceConfigResponse) HTTPResponse() *http.Response { return response.RawResponse } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_details.go���������������������0000664�0000000�0000000�00000003620�13771713062�0027335�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVcnDetails The representation of UpdateVcnDetails type UpdateVcnDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateVcnDetails) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_vcn_request_response.go������������0000664�0000000�0000000�00000005540�13771713062�0031321�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVcnRequest wrapper for the UpdateVcn operation type UpdateVcnRequest struct { // The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the VCN. VcnId *string `mandatory:"true" contributesTo:"path" name:"vcnId"` // Details object for updating a VCN. UpdateVcnDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVcnRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVcnRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVcnRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVcnResponse wrapper for the UpdateVcn operation type UpdateVcnResponse struct { // The underlying http response RawResponse *http.Response // The Vcn instance Vcn `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateVcnResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVcnResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_details.go���������0000664�0000000�0000000�00000013067�13771713062�0031765�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVirtualCircuitDetails The representation of UpdateVirtualCircuitDetails type UpdateVirtualCircuitDetails struct { // The provisioned data rate of the connection. To get a list of the // available bandwidth levels (that is, shapes), see // ListFastConnectProviderVirtualCircuitBandwidthShapes. // To be updated only by the customer who owns the virtual circuit. BandwidthShapeName *string `mandatory:"false" json:"bandwidthShapeName"` // An array of mappings, each containing properties for a cross-connect or // cross-connect group associated with this virtual circuit. // The customer and provider can update different properties in the mapping // depending on the situation. See the description of the // CrossConnectMapping. CrossConnectMappings []CrossConnectMapping `mandatory:"false" json:"crossConnectMappings"` // Deprecated. Instead use `customerAsn`. // If you specify values for both, the request will be rejected. CustomerBgpAsn *int `mandatory:"false" json:"customerBgpAsn"` // The BGP ASN of the network at the other end of the BGP // session from Oracle. // If the BGP session is from the customer's edge router to Oracle, the // required value is the customer's ASN, and it can be updated only // by the customer. // If the BGP session is from the provider's edge router to Oracle, the // required value is the provider's ASN, and it can be updated only // by the provider. // Can be a 2-byte or 4-byte ASN. Uses "asplain" format. CustomerAsn *int64 `mandatory:"false" json:"customerAsn"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique. // Avoid entering confidential information. // To be updated only by the customer who owns the virtual circuit. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the Drg // that this private virtual circuit uses. // To be updated only by the customer who owns the virtual circuit. GatewayId *string `mandatory:"false" json:"gatewayId"` // The provider's state in relation to this virtual circuit. Relevant only // if the customer is using FastConnect via a provider. ACTIVE // means the provider has provisioned the virtual circuit from their // end. INACTIVE means the provider has not yet provisioned the virtual // circuit, or has de-provisioned it. // To be updated only by the provider. ProviderState UpdateVirtualCircuitDetailsProviderStateEnum `mandatory:"false" json:"providerState,omitempty"` // The service key name offered by the provider (if the customer is connecting via a provider). ProviderServiceKeyName *string `mandatory:"false" json:"providerServiceKeyName"` // Provider-supplied reference information about this virtual circuit. // Relevant only if the customer is using FastConnect via a provider. // To be updated only by the provider. ReferenceComment *string `mandatory:"false" json:"referenceComment"` } func (m UpdateVirtualCircuitDetails) String() string { return common.PointerString(m) } // UpdateVirtualCircuitDetailsProviderStateEnum Enum with underlying type: string type UpdateVirtualCircuitDetailsProviderStateEnum string // Set of constants representing the allowable values for UpdateVirtualCircuitDetailsProviderStateEnum const ( UpdateVirtualCircuitDetailsProviderStateActive UpdateVirtualCircuitDetailsProviderStateEnum = "ACTIVE" UpdateVirtualCircuitDetailsProviderStateInactive UpdateVirtualCircuitDetailsProviderStateEnum = "INACTIVE" ) var mappingUpdateVirtualCircuitDetailsProviderState = map[string]UpdateVirtualCircuitDetailsProviderStateEnum{ "ACTIVE": UpdateVirtualCircuitDetailsProviderStateActive, "INACTIVE": UpdateVirtualCircuitDetailsProviderStateInactive, } // GetUpdateVirtualCircuitDetailsProviderStateEnumValues Enumerates the set of values for UpdateVirtualCircuitDetailsProviderStateEnum func GetUpdateVirtualCircuitDetailsProviderStateEnumValues() []UpdateVirtualCircuitDetailsProviderStateEnum { values := make([]UpdateVirtualCircuitDetailsProviderStateEnum, 0) for _, v := range mappingUpdateVirtualCircuitDetailsProviderState { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_virtual_circuit_request_response.go0000664�0000000�0000000�00000005716�13771713062�0033750�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVirtualCircuitRequest wrapper for the UpdateVirtualCircuit operation type UpdateVirtualCircuitRequest struct { // The OCID of the virtual circuit. VirtualCircuitId *string `mandatory:"true" contributesTo:"path" name:"virtualCircuitId"` // Update VirtualCircuit fields. UpdateVirtualCircuitDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVirtualCircuitRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVirtualCircuitRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVirtualCircuitRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVirtualCircuitResponse wrapper for the UpdateVirtualCircuit operation type UpdateVirtualCircuitResponse struct { // The underlying http response RawResponse *http.Response // The VirtualCircuit instance VirtualCircuit `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateVirtualCircuitResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVirtualCircuitResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_details.go��������������������0000664�0000000�0000000�00000006522�13771713062�0027512�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVnicDetails The representation of UpdateVnicDetails type UpdateVnicDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname // portion of the primary private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be unique across all VNICs in the subnet and comply with // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // The value appears in the Vnic object and also the // PrivateIp object returned by // ListPrivateIps and // GetPrivateIp. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // A list of the OCIDs of the network security groups (NSGs) to add the VNIC to. Setting this as // an empty array removes the VNIC from all network security groups. // For more information about NSGs, see // NetworkSecurityGroup. NsgIds []string `mandatory:"false" json:"nsgIds"` // Whether the source/destination check is disabled on the VNIC. // Defaults to `false`, which means the check is performed. // For information about why you would skip the source/destination check, see // Using a Private IP as a Route Target (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip). // Example: `true` SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` } func (m UpdateVnicDetails) String() string { return common.PointerString(m) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_vnic_request_response.go�����������0000664�0000000�0000000�00000005451�13771713062�0031473�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVnicRequest wrapper for the UpdateVnic operation type UpdateVnicRequest struct { // The OCID of the VNIC. VnicId *string `mandatory:"true" contributesTo:"path" name:"vnicId"` // Details object for updating a VNIC. UpdateVnicDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVnicRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVnicRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVnicRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVnicResponse wrapper for the UpdateVnic operation type UpdateVnicResponse struct { // The underlying http response RawResponse *http.Response // The Vnic instance Vnic `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateVnicResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVnicResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_details.go�����������0000664�0000000�0000000�00000003631�13771713062�0031405�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVolumeBackupDetails The representation of UpdateVolumeBackupDetails type UpdateVolumeBackupDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the volume backup. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateVolumeBackupDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_policy_details.go����0000664�0000000�0000000�00000005567�13771713062�0032776�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVolumeBackupPolicyDetails Specifies the properties for a updating a user defined backup policy. // For more information about user defined backup policies, // see User Defined Policies (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#UserDefinedBackupPolicies) in // Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm). type UpdateVolumeBackupPolicyDetails struct { // A user-friendly name for the volume backup policy. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // The paired destination region (pre-defined by oracle) for scheduled cross region backup calls. Example: `us-ashburn-1` DestinationRegion *string `mandatory:"false" json:"destinationRegion"` // The collection of schedules for the volume backup policy. See // see Schedules (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm#schedules) in // Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm) for more information. Schedules []VolumeBackupSchedule `mandatory:"false" json:"schedules"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateVolumeBackupPolicyDetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������update_volume_backup_policy_request_response.go�����������������������������������������������������0000664�0000000�0000000�00000006743�13771713062�0034675�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVolumeBackupPolicyRequest wrapper for the UpdateVolumeBackupPolicy operation type UpdateVolumeBackupPolicyRequest struct { // The OCID of the volume backup policy. PolicyId *string `mandatory:"true" contributesTo:"path" name:"policyId"` // Update volume backup policy fields UpdateVolumeBackupPolicyDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A token that uniquely identifies a request so it can be retried in case of a timeout or // server error without risk of executing that same action again. Retry tokens expire after 24 // hours, but can be invalidated before then due to conflicting operations (for example, if a resource // has been deleted and purged from the system, then a retry of the original creation request // may be rejected). OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVolumeBackupPolicyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVolumeBackupPolicyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVolumeBackupPolicyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVolumeBackupPolicyResponse wrapper for the UpdateVolumeBackupPolicy operation type UpdateVolumeBackupPolicyResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackupPolicy instance VolumeBackupPolicy `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateVolumeBackupPolicyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVolumeBackupPolicyResponse) HTTPResponse() *http.Response { return response.RawResponse } �����������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_backup_request_response.go��0000664�0000000�0000000�00000005324�13771713062�0033367�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVolumeBackupRequest wrapper for the UpdateVolumeBackup operation type UpdateVolumeBackupRequest struct { // The OCID of the volume backup. VolumeBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeBackupId"` // Update volume backup fields UpdateVolumeBackupDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVolumeBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVolumeBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVolumeBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVolumeBackupResponse wrapper for the UpdateVolumeBackup operation type UpdateVolumeBackupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeBackup instance VolumeBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` } func (response UpdateVolumeBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVolumeBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_details.go������������������0000664�0000000�0000000�00000005075�13771713062�0030064�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVolumeDetails The representation of UpdateVolumeDetails type UpdateVolumeDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The number of volume performance units (VPUs) that will be applied to this volume per GB, // representing the Block Volume service's elastic performance options. // See Block Volume Elastic Performance (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumeelasticperformance.htm) for more information. // Allowed values: // * `0`: Represents Lower Cost option. // * `10`: Represents Balanced option. // * `20`: Represents Higher Performance option. VpusPerGB *int64 `mandatory:"false" json:"vpusPerGB"` // The size to resize the volume to in GBs. Has to be larger than the current size. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` } func (m UpdateVolumeDetails) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_backup_details.go�����0000664�0000000�0000000�00000003657�13771713062�0032631�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVolumeGroupBackupDetails The representation of UpdateVolumeGroupBackupDetails type UpdateVolumeGroupBackupDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the volume group backup. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m UpdateVolumeGroupBackupDetails) String() string { return common.PointerString(m) } ���������������������������������������������������������������������������������update_volume_group_backup_request_response.go������������������������������������������������������0000664�0000000�0000000�00000005530�13771713062�0034523�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVolumeGroupBackupRequest wrapper for the UpdateVolumeGroupBackup operation type UpdateVolumeGroupBackupRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group backup. VolumeGroupBackupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupBackupId"` // Update volume group backup fields UpdateVolumeGroupBackupDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVolumeGroupBackupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVolumeGroupBackupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVolumeGroupBackupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVolumeGroupBackupResponse wrapper for the UpdateVolumeGroupBackup operation type UpdateVolumeGroupBackupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeGroupBackup instance VolumeGroupBackup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` } func (response UpdateVolumeGroupBackupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVolumeGroupBackupResponse) HTTPResponse() *http.Response { return response.RawResponse } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_details.go������������0000664�0000000�0000000�00000003772�13771713062�0031302�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVolumeGroupDetails The representation of UpdateVolumeGroupDetails type UpdateVolumeGroupDetails struct { // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name for the volume group. Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // OCIDs for the volumes in this volume group. VolumeIds []string `mandatory:"false" json:"volumeIds"` } func (m UpdateVolumeGroupDetails) String() string { return common.PointerString(m) } ������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_group_request_response.go���0000664�0000000�0000000�00000005736�13771713062�0033265�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVolumeGroupRequest wrapper for the UpdateVolumeGroup operation type UpdateVolumeGroupRequest struct { // The Oracle Cloud ID (OCID) that uniquely identifies the volume group. VolumeGroupId *string `mandatory:"true" contributesTo:"path" name:"volumeGroupId"` // Update volume group's set of volumes and/or display name UpdateVolumeGroupDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVolumeGroupRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVolumeGroupRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVolumeGroupRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVolumeGroupResponse wrapper for the UpdateVolumeGroup operation type UpdateVolumeGroupResponse struct { // The underlying http response RawResponse *http.Response // The VolumeGroup instance VolumeGroup `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateVolumeGroupResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVolumeGroupResponse) HTTPResponse() *http.Response { return response.RawResponse } ����������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_details.go����������0000664�0000000�0000000�00000002753�13771713062�0031606�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdateVolumeKmsKeyDetails The representation of UpdateVolumeKmsKeyDetails type UpdateVolumeKmsKeyDetails struct { // The OCID of the new Key Management key to assign to protect the specified volume. // This key has to be a valid Key Management key, and policies must exist to allow the user and the Block Volume service to access this key. // If you specify the same OCID as the previous key's OCID, the Block Volume service will use it to regenerate a volume encryption key. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m UpdateVolumeKmsKeyDetails) String() string { return common.PointerString(m) } ���������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_kms_key_request_response.go�0000664�0000000�0000000�00000005716�13771713062�0033571�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVolumeKmsKeyRequest wrapper for the UpdateVolumeKmsKey operation type UpdateVolumeKmsKeyRequest struct { // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` // Updates the Key Management master encryption key assigned to the specified volume. UpdateVolumeKmsKeyDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVolumeKmsKeyRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVolumeKmsKeyRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVolumeKmsKeyRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVolumeKmsKeyResponse wrapper for the UpdateVolumeKmsKey operation type UpdateVolumeKmsKeyResponse struct { // The underlying http response RawResponse *http.Response // The VolumeKmsKey instance VolumeKmsKey `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateVolumeKmsKeyResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVolumeKmsKeyResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/update_volume_request_response.go���������0000664�0000000�0000000�00000005556�13771713062�0032051�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. package core import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // UpdateVolumeRequest wrapper for the UpdateVolume operation type UpdateVolumeRequest struct { // The OCID of the volume. VolumeId *string `mandatory:"true" contributesTo:"path" name:"volumeId"` // Update volume's display name. Avoid entering confidential information. UpdateVolumeDetails `contributesTo:"body"` // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` // parameter to the value of the etag from a previous GET or POST response for that resource. The resource // will be updated or deleted only if the etag you provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` // Unique Oracle-assigned identifier for the request. // If you need to contact Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // Metadata about the request. This information will not be transmitted to the service, but // represents information that the SDK will consume to drive retry behavior. RequestMetadata common.RequestMetadata } func (request UpdateVolumeRequest) String() string { return common.PointerString(request) } // HTTPRequest implements the OCIRequest interface func (request UpdateVolumeRequest) HTTPRequest(method, path string) (http.Request, error) { return common.MakeDefaultHTTPRequestWithTaggedStruct(method, path, request) } // RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. func (request UpdateVolumeRequest) RetryPolicy() *common.RetryPolicy { return request.RequestMetadata.RetryPolicy } // UpdateVolumeResponse wrapper for the UpdateVolume operation type UpdateVolumeResponse struct { // The underlying http response RawResponse *http.Response // The Volume instance Volume `presentIn:"body"` // For optimistic concurrency control. See `if-match`. Etag *string `presentIn:"header" name:"etag"` // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` } func (response UpdateVolumeResponse) String() string { return common.PointerString(response) } // HTTPResponse implements the OCIResponse interface func (response UpdateVolumeResponse) HTTPResponse() *http.Response { return response.RawResponse } ��������������������������������������������������������������������������������������������������������������������������������������������������updated_network_security_group_security_rules.go����������������������������������������������������0000664�0000000�0000000�00000002371�13771713062�0035126�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // UpdatedNetworkSecurityGroupSecurityRules The representation of UpdatedNetworkSecurityGroupSecurityRules type UpdatedNetworkSecurityGroupSecurityRules struct { // The NSG security rules that were updated. SecurityRules []SecurityRule `mandatory:"false" json:"securityRules"` } func (m UpdatedNetworkSecurityGroupSecurityRules) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/vcn.go������������������������������������0000664�0000000�0000000�00000015012�13771713062�0024264�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Vcn A virtual cloud network (VCN). For more information, see // Overview of the Networking Service (https://docs.cloud.oracle.com/Content/Network/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Vcn struct { // The CIDR IP address block of the VCN. // Example: `172.16.0.0/16` CidrBlock *string `mandatory:"true" json:"cidrBlock"` // The OCID of the compartment containing the VCN. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The VCN's Oracle ID (OCID). Id *string `mandatory:"true" json:"id"` // The VCN's current state. LifecycleState VcnLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID for the VCN's default set of DHCP options. DefaultDhcpOptionsId *string `mandatory:"false" json:"defaultDhcpOptionsId"` // The OCID for the VCN's default route table. DefaultRouteTableId *string `mandatory:"false" json:"defaultRouteTableId"` // The OCID for the VCN's default security list. DefaultSecurityListId *string `mandatory:"false" json:"defaultSecurityListId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // A DNS label for the VCN, used in conjunction with the VNIC's hostname and // subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC // within this subnet (for example, `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be an alphanumeric string that begins with a letter. // The value cannot be changed. // The absence of this parameter means the Internet and VCN Resolver will // not work for this VCN. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `vcn1` DnsLabel *string `mandatory:"false" json:"dnsLabel"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // For an IPv6-enabled VCN, this is the IPv6 CIDR block for the VCN's private IP address space. // The VCN size is always /48. If you don't provide a value when creating the VCN, Oracle // provides one and uses that *same* CIDR for the `ipv6PublicCidrBlock`. If you do provide a // value, Oracle provides a *different* CIDR for the `ipv6PublicCidrBlock`. Note that IPv6 // addressing is currently supported only in certain regions. See // IPv6 Addresses (https://docs.cloud.oracle.com/Content/Network/Concepts/ipv6.htm). // Example: `2001:0db8:0123::/48` Ipv6CidrBlock *string `mandatory:"false" json:"ipv6CidrBlock"` // For an IPv6-enabled VCN, this is the IPv6 CIDR block for the VCN's public IP address space. // The VCN size is always /48. This CIDR is always provided by Oracle. If you don't provide a // custom CIDR for the `ipv6CidrBlock` when creating the VCN, Oracle assigns that value and also // uses it for `ipv6PublicCidrBlock`. Oracle uses addresses from this block for the `publicIpAddress` // attribute of an Ipv6 that has internet access allowed. // Example: `2001:0db8:0123::/48` Ipv6PublicCidrBlock *string `mandatory:"false" json:"ipv6PublicCidrBlock"` // The date and time the VCN was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // The VCN's domain name, which consists of the VCN's DNS label, and the // `oraclevcn.com` domain. // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `vcn1.oraclevcn.com` VcnDomainName *string `mandatory:"false" json:"vcnDomainName"` } func (m Vcn) String() string { return common.PointerString(m) } // VcnLifecycleStateEnum Enum with underlying type: string type VcnLifecycleStateEnum string // Set of constants representing the allowable values for VcnLifecycleStateEnum const ( VcnLifecycleStateProvisioning VcnLifecycleStateEnum = "PROVISIONING" VcnLifecycleStateAvailable VcnLifecycleStateEnum = "AVAILABLE" VcnLifecycleStateTerminating VcnLifecycleStateEnum = "TERMINATING" VcnLifecycleStateTerminated VcnLifecycleStateEnum = "TERMINATED" ) var mappingVcnLifecycleState = map[string]VcnLifecycleStateEnum{ "PROVISIONING": VcnLifecycleStateProvisioning, "AVAILABLE": VcnLifecycleStateAvailable, "TERMINATING": VcnLifecycleStateTerminating, "TERMINATED": VcnLifecycleStateTerminated, } // GetVcnLifecycleStateEnumValues Enumerates the set of values for VcnLifecycleStateEnum func GetVcnLifecycleStateEnumValues() []VcnLifecycleStateEnum { values := make([]VcnLifecycleStateEnum, 0) for _, v := range mappingVcnLifecycleState { values = append(values, v) } return values } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit.go������������������������0000664�0000000�0000000�00000034243�13771713062�0026715�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VirtualCircuit For use with Oracle Cloud Infrastructure FastConnect. // A virtual circuit is an isolated network path that runs over one or more physical // network connections to provide a single, logical connection between the edge router // on the customer's existing network and Oracle Cloud Infrastructure. *Private* // virtual circuits support private peering, and *public* virtual circuits support // public peering. For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). // Each virtual circuit is made up of information shared between a customer, Oracle, // and a provider (if the customer is using FastConnect via a provider). Who fills in // a given property of a virtual circuit depends on whether the BGP session related to // that virtual circuit goes from the customer's edge router to Oracle, or from the provider's // edge router to Oracle. Also, in the case where the customer is using a provider, values // for some of the properties may not be present immediately, but may get filled in as the // provider and Oracle each do their part to provision the virtual circuit. // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type VirtualCircuit struct { // The provisioned data rate of the connection. To get a list of the // available bandwidth levels (that is, shapes), see // ListFastConnectProviderVirtualCircuitBandwidthShapes. // Example: `10 Gbps` BandwidthShapeName *string `mandatory:"false" json:"bandwidthShapeName"` // Deprecated. Instead use the information in // FastConnectProviderService. BgpManagement VirtualCircuitBgpManagementEnum `mandatory:"false" json:"bgpManagement,omitempty"` // The state of the BGP session associated with the virtual circuit. BgpSessionState VirtualCircuitBgpSessionStateEnum `mandatory:"false" json:"bgpSessionState,omitempty"` // The OCID of the compartment containing the virtual circuit. CompartmentId *string `mandatory:"false" json:"compartmentId"` // An array of mappings, each containing properties for a // cross-connect or cross-connect group that is associated with this // virtual circuit. CrossConnectMappings []CrossConnectMapping `mandatory:"false" json:"crossConnectMappings"` // Deprecated. Instead use `customerAsn`. // If you specify values for both, the request will be rejected. CustomerBgpAsn *int `mandatory:"false" json:"customerBgpAsn"` // The BGP ASN of the network at the other end of the BGP // session from Oracle. If the session is between the customer's // edge router and Oracle, the value is the customer's ASN. If the BGP // session is between the provider's edge router and Oracle, the value // is the provider's ASN. // Can be a 2-byte or 4-byte ASN. Uses "asplain" format. CustomerAsn *int64 `mandatory:"false" json:"customerAsn"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the customer's Drg // that this virtual circuit uses. Applicable only to private virtual circuits. GatewayId *string `mandatory:"false" json:"gatewayId"` // The virtual circuit's Oracle ID (OCID). Id *string `mandatory:"false" json:"id"` // The virtual circuit's current state. For information about // the different states, see // FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). LifecycleState VirtualCircuitLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` // The Oracle BGP ASN. OracleBgpAsn *int `mandatory:"false" json:"oracleBgpAsn"` // Deprecated. Instead use `providerServiceId`. ProviderName *string `mandatory:"false" json:"providerName"` // The OCID of the service offered by the provider (if the customer is connecting via a provider). ProviderServiceId *string `mandatory:"false" json:"providerServiceId"` // The service key name offered by the provider (if the customer is connecting via a provider). ProviderServiceKeyName *string `mandatory:"false" json:"providerServiceKeyName"` // Deprecated. Instead use `providerServiceId`. ProviderServiceName *string `mandatory:"false" json:"providerServiceName"` // The provider's state in relation to this virtual circuit (if the // customer is connecting via a provider). ACTIVE means // the provider has provisioned the virtual circuit from their end. // INACTIVE means the provider has not yet provisioned the virtual // circuit, or has de-provisioned it. ProviderState VirtualCircuitProviderStateEnum `mandatory:"false" json:"providerState,omitempty"` // For a public virtual circuit. The public IP prefixes (CIDRs) the customer wants to // advertise across the connection. All prefix sizes are allowed. PublicPrefixes []string `mandatory:"false" json:"publicPrefixes"` // Provider-supplied reference information about this virtual circuit // (if the customer is connecting via a provider). ReferenceComment *string `mandatory:"false" json:"referenceComment"` // The Oracle Cloud Infrastructure region where this virtual // circuit is located. Region *string `mandatory:"false" json:"region"` // Provider service type. ServiceType VirtualCircuitServiceTypeEnum `mandatory:"false" json:"serviceType,omitempty"` // The date and time the virtual circuit was created, // in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` // Whether the virtual circuit supports private or public peering. For more information, // see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). Type VirtualCircuitTypeEnum `mandatory:"false" json:"type,omitempty"` } func (m VirtualCircuit) String() string { return common.PointerString(m) } // VirtualCircuitBgpManagementEnum Enum with underlying type: string type VirtualCircuitBgpManagementEnum string // Set of constants representing the allowable values for VirtualCircuitBgpManagementEnum const ( VirtualCircuitBgpManagementCustomerManaged VirtualCircuitBgpManagementEnum = "CUSTOMER_MANAGED" VirtualCircuitBgpManagementProviderManaged VirtualCircuitBgpManagementEnum = "PROVIDER_MANAGED" VirtualCircuitBgpManagementOracleManaged VirtualCircuitBgpManagementEnum = "ORACLE_MANAGED" ) var mappingVirtualCircuitBgpManagement = map[string]VirtualCircuitBgpManagementEnum{ "CUSTOMER_MANAGED": VirtualCircuitBgpManagementCustomerManaged, "PROVIDER_MANAGED": VirtualCircuitBgpManagementProviderManaged, "ORACLE_MANAGED": VirtualCircuitBgpManagementOracleManaged, } // GetVirtualCircuitBgpManagementEnumValues Enumerates the set of values for VirtualCircuitBgpManagementEnum func GetVirtualCircuitBgpManagementEnumValues() []VirtualCircuitBgpManagementEnum { values := make([]VirtualCircuitBgpManagementEnum, 0) for _, v := range mappingVirtualCircuitBgpManagement { values = append(values, v) } return values } // VirtualCircuitBgpSessionStateEnum Enum with underlying type: string type VirtualCircuitBgpSessionStateEnum string // Set of constants representing the allowable values for VirtualCircuitBgpSessionStateEnum const ( VirtualCircuitBgpSessionStateUp VirtualCircuitBgpSessionStateEnum = "UP" VirtualCircuitBgpSessionStateDown VirtualCircuitBgpSessionStateEnum = "DOWN" ) var mappingVirtualCircuitBgpSessionState = map[string]VirtualCircuitBgpSessionStateEnum{ "UP": VirtualCircuitBgpSessionStateUp, "DOWN": VirtualCircuitBgpSessionStateDown, } // GetVirtualCircuitBgpSessionStateEnumValues Enumerates the set of values for VirtualCircuitBgpSessionStateEnum func GetVirtualCircuitBgpSessionStateEnumValues() []VirtualCircuitBgpSessionStateEnum { values := make([]VirtualCircuitBgpSessionStateEnum, 0) for _, v := range mappingVirtualCircuitBgpSessionState { values = append(values, v) } return values } // VirtualCircuitLifecycleStateEnum Enum with underlying type: string type VirtualCircuitLifecycleStateEnum string // Set of constants representing the allowable values for VirtualCircuitLifecycleStateEnum const ( VirtualCircuitLifecycleStatePendingProvider VirtualCircuitLifecycleStateEnum = "PENDING_PROVIDER" VirtualCircuitLifecycleStateVerifying VirtualCircuitLifecycleStateEnum = "VERIFYING" VirtualCircuitLifecycleStateProvisioning VirtualCircuitLifecycleStateEnum = "PROVISIONING" VirtualCircuitLifecycleStateProvisioned VirtualCircuitLifecycleStateEnum = "PROVISIONED" VirtualCircuitLifecycleStateFailed VirtualCircuitLifecycleStateEnum = "FAILED" VirtualCircuitLifecycleStateInactive VirtualCircuitLifecycleStateEnum = "INACTIVE" VirtualCircuitLifecycleStateTerminating VirtualCircuitLifecycleStateEnum = "TERMINATING" VirtualCircuitLifecycleStateTerminated VirtualCircuitLifecycleStateEnum = "TERMINATED" ) var mappingVirtualCircuitLifecycleState = map[string]VirtualCircuitLifecycleStateEnum{ "PENDING_PROVIDER": VirtualCircuitLifecycleStatePendingProvider, "VERIFYING": VirtualCircuitLifecycleStateVerifying, "PROVISIONING": VirtualCircuitLifecycleStateProvisioning, "PROVISIONED": VirtualCircuitLifecycleStateProvisioned, "FAILED": VirtualCircuitLifecycleStateFailed, "INACTIVE": VirtualCircuitLifecycleStateInactive, "TERMINATING": VirtualCircuitLifecycleStateTerminating, "TERMINATED": VirtualCircuitLifecycleStateTerminated, } // GetVirtualCircuitLifecycleStateEnumValues Enumerates the set of values for VirtualCircuitLifecycleStateEnum func GetVirtualCircuitLifecycleStateEnumValues() []VirtualCircuitLifecycleStateEnum { values := make([]VirtualCircuitLifecycleStateEnum, 0) for _, v := range mappingVirtualCircuitLifecycleState { values = append(values, v) } return values } // VirtualCircuitProviderStateEnum Enum with underlying type: string type VirtualCircuitProviderStateEnum string // Set of constants representing the allowable values for VirtualCircuitProviderStateEnum const ( VirtualCircuitProviderStateActive VirtualCircuitProviderStateEnum = "ACTIVE" VirtualCircuitProviderStateInactive VirtualCircuitProviderStateEnum = "INACTIVE" ) var mappingVirtualCircuitProviderState = map[string]VirtualCircuitProviderStateEnum{ "ACTIVE": VirtualCircuitProviderStateActive, "INACTIVE": VirtualCircuitProviderStateInactive, } // GetVirtualCircuitProviderStateEnumValues Enumerates the set of values for VirtualCircuitProviderStateEnum func GetVirtualCircuitProviderStateEnumValues() []VirtualCircuitProviderStateEnum { values := make([]VirtualCircuitProviderStateEnum, 0) for _, v := range mappingVirtualCircuitProviderState { values = append(values, v) } return values } // VirtualCircuitServiceTypeEnum Enum with underlying type: string type VirtualCircuitServiceTypeEnum string // Set of constants representing the allowable values for VirtualCircuitServiceTypeEnum const ( VirtualCircuitServiceTypeColocated VirtualCircuitServiceTypeEnum = "COLOCATED" VirtualCircuitServiceTypeLayer2 VirtualCircuitServiceTypeEnum = "LAYER2" VirtualCircuitServiceTypeLayer3 VirtualCircuitServiceTypeEnum = "LAYER3" ) var mappingVirtualCircuitServiceType = map[string]VirtualCircuitServiceTypeEnum{ "COLOCATED": VirtualCircuitServiceTypeColocated, "LAYER2": VirtualCircuitServiceTypeLayer2, "LAYER3": VirtualCircuitServiceTypeLayer3, } // GetVirtualCircuitServiceTypeEnumValues Enumerates the set of values for VirtualCircuitServiceTypeEnum func GetVirtualCircuitServiceTypeEnumValues() []VirtualCircuitServiceTypeEnum { values := make([]VirtualCircuitServiceTypeEnum, 0) for _, v := range mappingVirtualCircuitServiceType { values = append(values, v) } return values } // VirtualCircuitTypeEnum Enum with underlying type: string type VirtualCircuitTypeEnum string // Set of constants representing the allowable values for VirtualCircuitTypeEnum const ( VirtualCircuitTypePublic VirtualCircuitTypeEnum = "PUBLIC" VirtualCircuitTypePrivate VirtualCircuitTypeEnum = "PRIVATE" ) var mappingVirtualCircuitType = map[string]VirtualCircuitTypeEnum{ "PUBLIC": VirtualCircuitTypePublic, "PRIVATE": VirtualCircuitTypePrivate, } // GetVirtualCircuitTypeEnumValues Enumerates the set of values for VirtualCircuitTypeEnum func GetVirtualCircuitTypeEnumValues() []VirtualCircuitTypeEnum { values := make([]VirtualCircuitTypeEnum, 0) for _, v := range mappingVirtualCircuitType { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_bandwidth_shape.go��������0000664�0000000�0000000�00000002460�13771713062�0032115�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VirtualCircuitBandwidthShape An individual bandwidth level for virtual circuits. type VirtualCircuitBandwidthShape struct { // The name of the bandwidth shape. // Example: `10 Gbps` Name *string `mandatory:"true" json:"name"` // The bandwidth in Mbps. // Example: `10000` BandwidthInMbps *int `mandatory:"false" json:"bandwidthInMbps"` } func (m VirtualCircuitBandwidthShape) String() string { return common.PointerString(m) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/virtual_circuit_public_prefix.go����������0000664�0000000�0000000�00000006420�13771713062�0031624�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VirtualCircuitPublicPrefix A public IP prefix and its details. With a public virtual circuit, the customer // specifies the customer-owned public IP prefixes to advertise across the connection. // For more information, see FastConnect Overview (https://docs.cloud.oracle.com/Content/Network/Concepts/fastconnect.htm). type VirtualCircuitPublicPrefix struct { // Publix IP prefix (CIDR) that the customer specified. CidrBlock *string `mandatory:"true" json:"cidrBlock"` // Oracle must verify that the customer owns the public IP prefix before traffic // for that prefix can flow across the virtual circuit. Verification can take a // few business days. `IN_PROGRESS` means Oracle is verifying the prefix. `COMPLETED` // means verification succeeded. `FAILED` means verification failed and traffic for // this prefix will not flow across the connection. VerificationState VirtualCircuitPublicPrefixVerificationStateEnum `mandatory:"true" json:"verificationState"` } func (m VirtualCircuitPublicPrefix) String() string { return common.PointerString(m) } // VirtualCircuitPublicPrefixVerificationStateEnum Enum with underlying type: string type VirtualCircuitPublicPrefixVerificationStateEnum string // Set of constants representing the allowable values for VirtualCircuitPublicPrefixVerificationStateEnum const ( VirtualCircuitPublicPrefixVerificationStateInProgress VirtualCircuitPublicPrefixVerificationStateEnum = "IN_PROGRESS" VirtualCircuitPublicPrefixVerificationStateCompleted VirtualCircuitPublicPrefixVerificationStateEnum = "COMPLETED" VirtualCircuitPublicPrefixVerificationStateFailed VirtualCircuitPublicPrefixVerificationStateEnum = "FAILED" ) var mappingVirtualCircuitPublicPrefixVerificationState = map[string]VirtualCircuitPublicPrefixVerificationStateEnum{ "IN_PROGRESS": VirtualCircuitPublicPrefixVerificationStateInProgress, "COMPLETED": VirtualCircuitPublicPrefixVerificationStateCompleted, "FAILED": VirtualCircuitPublicPrefixVerificationStateFailed, } // GetVirtualCircuitPublicPrefixVerificationStateEnumValues Enumerates the set of values for VirtualCircuitPublicPrefixVerificationStateEnum func GetVirtualCircuitPublicPrefixVerificationStateEnumValues() []VirtualCircuitPublicPrefixVerificationStateEnum { values := make([]VirtualCircuitPublicPrefixVerificationStateEnum, 0) for _, v := range mappingVirtualCircuitPublicPrefixVerificationState { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/vnic.go�����������������������������������0000664�0000000�0000000�00000015131�13771713062�0024437�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // Vnic A virtual network interface card. Each VNIC resides in a subnet in a VCN. // An instance attaches to a VNIC to obtain a network connection into the VCN // through that subnet. Each instance has a *primary VNIC* that is automatically // created and attached during launch. You can add *secondary VNICs* to an // instance after it's launched. For more information, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). // Each VNIC has a *primary private IP* that is automatically assigned during launch. // You can add *secondary private IPs* to a VNIC after it's created. For more // information, see CreatePrivateIp and // IP Addresses (https://docs.cloud.oracle.com/Content/Network/Tasks/managingIPaddresses.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Vnic struct { // The VNIC's availability domain. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment containing the VNIC. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the VNIC. Id *string `mandatory:"true" json:"id"` // The current state of the VNIC. LifecycleState VnicLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID of the subnet the VNIC is in. SubnetId *string `mandatory:"true" json:"subnetId"` // The date and time the VNIC was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // A user-friendly name. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname // portion of the primary private IP's fully qualified domain name (FQDN) // (for example, `bminstance-1` in FQDN `bminstance-1.subnet123.vcn1.oraclevcn.com`). // Must be unique across all VNICs in the subnet and comply with // RFC 952 (https://tools.ietf.org/html/rfc952) and // RFC 1123 (https://tools.ietf.org/html/rfc1123). // For more information, see // DNS in Your Virtual Cloud Network (https://docs.cloud.oracle.com/Content/Network/Concepts/dns.htm). // Example: `bminstance-1` HostnameLabel *string `mandatory:"false" json:"hostnameLabel"` // Whether the VNIC is the primary VNIC (the VNIC that is automatically created // and attached during instance launch). IsPrimary *bool `mandatory:"false" json:"isPrimary"` // The MAC address of the VNIC. // Example: `00:00:17:B6:4D:DD` MacAddress *string `mandatory:"false" json:"macAddress"` // A list of the OCIDs of the network security groups that the VNIC belongs to. For more // information about NSGs, see // NetworkSecurityGroup. NsgIds []string `mandatory:"false" json:"nsgIds"` // The private IP address of the primary `privateIp` object on the VNIC. // The address is within the CIDR of the VNIC's subnet. // Example: `10.0.3.3` PrivateIp *string `mandatory:"false" json:"privateIp"` // The public IP address of the VNIC, if one is assigned. PublicIp *string `mandatory:"false" json:"publicIp"` // Whether the source/destination check is disabled on the VNIC. // Defaults to `false`, which means the check is performed. For information // about why you would skip the source/destination check, see // Using a Private IP as a Route Target (https://docs.cloud.oracle.com/Content/Network/Tasks/managingroutetables.htm#privateip). // Example: `true` SkipSourceDestCheck *bool `mandatory:"false" json:"skipSourceDestCheck"` } func (m Vnic) String() string { return common.PointerString(m) } // VnicLifecycleStateEnum Enum with underlying type: string type VnicLifecycleStateEnum string // Set of constants representing the allowable values for VnicLifecycleStateEnum const ( VnicLifecycleStateProvisioning VnicLifecycleStateEnum = "PROVISIONING" VnicLifecycleStateAvailable VnicLifecycleStateEnum = "AVAILABLE" VnicLifecycleStateTerminating VnicLifecycleStateEnum = "TERMINATING" VnicLifecycleStateTerminated VnicLifecycleStateEnum = "TERMINATED" ) var mappingVnicLifecycleState = map[string]VnicLifecycleStateEnum{ "PROVISIONING": VnicLifecycleStateProvisioning, "AVAILABLE": VnicLifecycleStateAvailable, "TERMINATING": VnicLifecycleStateTerminating, "TERMINATED": VnicLifecycleStateTerminated, } // GetVnicLifecycleStateEnumValues Enumerates the set of values for VnicLifecycleStateEnum func GetVnicLifecycleStateEnumValues() []VnicLifecycleStateEnum { values := make([]VnicLifecycleStateEnum, 0) for _, v := range mappingVnicLifecycleState { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/vnic_attachment.go������������������������0000664�0000000�0000000�00000010467�13771713062�0026656�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VnicAttachment Represents an attachment between a VNIC and an instance. For more information, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type VnicAttachment struct { // The availability domain of the instance. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment the VNIC attachment is in, which is the same // compartment the instance is in. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The OCID of the VNIC attachment. Id *string `mandatory:"true" json:"id"` // The OCID of the instance. InstanceId *string `mandatory:"true" json:"instanceId"` // The current state of the VNIC attachment. LifecycleState VnicAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The OCID of the subnet to create the VNIC in. SubnetId *string `mandatory:"true" json:"subnetId"` // The date and time the VNIC attachment was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // A user-friendly name. Does not have to be unique. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` // Which physical network interface card (NIC) the VNIC uses. // Certain bare metal instance shapes have two active physical NICs (0 and 1). If // you add a secondary VNIC to one of these instances, you can specify which NIC // the VNIC will use. For more information, see // Virtual Network Interface Cards (VNICs) (https://docs.cloud.oracle.com/Content/Network/Tasks/managingVNICs.htm). NicIndex *int `mandatory:"false" json:"nicIndex"` // The Oracle-assigned VLAN tag of the attached VNIC. Available after the // attachment process is complete. // Example: `0` VlanTag *int `mandatory:"false" json:"vlanTag"` // The OCID of the VNIC. Available after the attachment process is complete. VnicId *string `mandatory:"false" json:"vnicId"` } func (m VnicAttachment) String() string { return common.PointerString(m) } // VnicAttachmentLifecycleStateEnum Enum with underlying type: string type VnicAttachmentLifecycleStateEnum string // Set of constants representing the allowable values for VnicAttachmentLifecycleStateEnum const ( VnicAttachmentLifecycleStateAttaching VnicAttachmentLifecycleStateEnum = "ATTACHING" VnicAttachmentLifecycleStateAttached VnicAttachmentLifecycleStateEnum = "ATTACHED" VnicAttachmentLifecycleStateDetaching VnicAttachmentLifecycleStateEnum = "DETACHING" VnicAttachmentLifecycleStateDetached VnicAttachmentLifecycleStateEnum = "DETACHED" ) var mappingVnicAttachmentLifecycleState = map[string]VnicAttachmentLifecycleStateEnum{ "ATTACHING": VnicAttachmentLifecycleStateAttaching, "ATTACHED": VnicAttachmentLifecycleStateAttached, "DETACHING": VnicAttachmentLifecycleStateDetaching, "DETACHED": VnicAttachmentLifecycleStateDetached, } // GetVnicAttachmentLifecycleStateEnumValues Enumerates the set of values for VnicAttachmentLifecycleStateEnum func GetVnicAttachmentLifecycleStateEnumValues() []VnicAttachmentLifecycleStateEnum { values := make([]VnicAttachmentLifecycleStateEnum, 0) for _, v := range mappingVnicAttachmentLifecycleState { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume.go���������������������������������0000664�0000000�0000000�00000020117�13771713062�0025007�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // Volume A detachable block volume device that allows you to dynamically expand // the storage capacity of an instance. For more information, see // Overview of Cloud Volume Storage (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type Volume struct { // The availability domain of the volume. // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the volume. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name. Does not have to be unique, and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the volume. Id *string `mandatory:"true" json:"id"` // The current state of a volume. LifecycleState VolumeLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The size of the volume in MBs. This field is deprecated. Use sizeInGBs instead. SizeInMBs *int64 `mandatory:"true" json:"sizeInMBs"` // The date and time the volume was created. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // System tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` // Specifies whether the cloned volume's data has finished copying from the source volume or backup. IsHydrated *bool `mandatory:"false" json:"isHydrated"` // The OCID of the Key Management key which is the master encryption key for the volume. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` // The number of volume performance units (VPUs) that will be applied to this volume per GB, // representing the Block Volume service's elastic performance options. // See Block Volume Elastic Performance (https://docs.cloud.oracle.com/Content/Block/Concepts/blockvolumeelasticperformance.htm) for more information. // Allowed values: // * `0`: Represents Lower Cost option. // * `10`: Represents Balanced option. // * `20`: Represents Higher Performance option. VpusPerGB *int64 `mandatory:"false" json:"vpusPerGB"` // The size of the volume in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The volume source, either an existing volume in the same availability domain or a volume backup. // If null, an empty volume is created. SourceDetails VolumeSourceDetails `mandatory:"false" json:"sourceDetails"` // The OCID of the source volume group. VolumeGroupId *string `mandatory:"false" json:"volumeGroupId"` } func (m Volume) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *Volume) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` FreeformTags map[string]string `json:"freeformTags"` SystemTags map[string]map[string]interface{} `json:"systemTags"` IsHydrated *bool `json:"isHydrated"` KmsKeyId *string `json:"kmsKeyId"` VpusPerGB *int64 `json:"vpusPerGB"` SizeInGBs *int64 `json:"sizeInGBs"` SourceDetails volumesourcedetails `json:"sourceDetails"` VolumeGroupId *string `json:"volumeGroupId"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` DisplayName *string `json:"displayName"` Id *string `json:"id"` LifecycleState VolumeLifecycleStateEnum `json:"lifecycleState"` SizeInMBs *int64 `json:"sizeInMBs"` TimeCreated *common.SDKTime `json:"timeCreated"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.FreeformTags = model.FreeformTags m.SystemTags = model.SystemTags m.IsHydrated = model.IsHydrated m.KmsKeyId = model.KmsKeyId m.VpusPerGB = model.VpusPerGB m.SizeInGBs = model.SizeInGBs nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(VolumeSourceDetails) } else { m.SourceDetails = nil } m.VolumeGroupId = model.VolumeGroupId m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.DisplayName = model.DisplayName m.Id = model.Id m.LifecycleState = model.LifecycleState m.SizeInMBs = model.SizeInMBs m.TimeCreated = model.TimeCreated return } // VolumeLifecycleStateEnum Enum with underlying type: string type VolumeLifecycleStateEnum string // Set of constants representing the allowable values for VolumeLifecycleStateEnum const ( VolumeLifecycleStateProvisioning VolumeLifecycleStateEnum = "PROVISIONING" VolumeLifecycleStateRestoring VolumeLifecycleStateEnum = "RESTORING" VolumeLifecycleStateAvailable VolumeLifecycleStateEnum = "AVAILABLE" VolumeLifecycleStateTerminating VolumeLifecycleStateEnum = "TERMINATING" VolumeLifecycleStateTerminated VolumeLifecycleStateEnum = "TERMINATED" VolumeLifecycleStateFaulty VolumeLifecycleStateEnum = "FAULTY" ) var mappingVolumeLifecycleState = map[string]VolumeLifecycleStateEnum{ "PROVISIONING": VolumeLifecycleStateProvisioning, "RESTORING": VolumeLifecycleStateRestoring, "AVAILABLE": VolumeLifecycleStateAvailable, "TERMINATING": VolumeLifecycleStateTerminating, "TERMINATED": VolumeLifecycleStateTerminated, "FAULTY": VolumeLifecycleStateFaulty, } // GetVolumeLifecycleStateEnumValues Enumerates the set of values for VolumeLifecycleStateEnum func GetVolumeLifecycleStateEnumValues() []VolumeLifecycleStateEnum { values := make([]VolumeLifecycleStateEnum, 0) for _, v := range mappingVolumeLifecycleState { values = append(values, v) } return values } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_attachment.go����������������������0000664�0000000�0000000�00000020504�13771713062�0027217�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeAttachment A base object for all types of attachments between a storage volume and an instance. // For specific details about iSCSI attachments, see // IScsiVolumeAttachment. // For general information about volume attachments, see // Overview of Block Volume Storage (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type VolumeAttachment interface { // The availability domain of an instance. // Example: `Uocm:PHX-AD-1` GetAvailabilityDomain() *string // The OCID of the compartment. GetCompartmentId() *string // The OCID of the volume attachment. GetId() *string // The OCID of the instance the volume is attached to. GetInstanceId() *string // The current state of the volume attachment. GetLifecycleState() VolumeAttachmentLifecycleStateEnum // The date and time the volume was created, in the format defined by RFC3339. // Example: `2016-08-25T21:10:29.600Z` GetTimeCreated() *common.SDKTime // The OCID of the volume. GetVolumeId() *string // The device name. GetDevice() *string // A user-friendly name. Does not have to be unique, and it cannot be changed. // Avoid entering confidential information. // Example: `My volume attachment` GetDisplayName() *string // Whether the attachment was created in read-only mode. GetIsReadOnly() *bool // Whether the attachment should be created in shareable mode. If an attachment is created in shareable mode, then other instances can attach the same volume, provided that they also create their attachments in shareable mode. Only certain volume types can be attached in shareable mode. Defaults to false if not specified. GetIsShareable() *bool // Whether in-transit encryption for the data volume's paravirtualized attachment is enabled or not. GetIsPvEncryptionInTransitEnabled() *bool } type volumeattachment struct { JsonData []byte AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` CompartmentId *string `mandatory:"true" json:"compartmentId"` Id *string `mandatory:"true" json:"id"` InstanceId *string `mandatory:"true" json:"instanceId"` LifecycleState VolumeAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` VolumeId *string `mandatory:"true" json:"volumeId"` Device *string `mandatory:"false" json:"device"` DisplayName *string `mandatory:"false" json:"displayName"` IsReadOnly *bool `mandatory:"false" json:"isReadOnly"` IsShareable *bool `mandatory:"false" json:"isShareable"` IsPvEncryptionInTransitEnabled *bool `mandatory:"false" json:"isPvEncryptionInTransitEnabled"` AttachmentType string `json:"attachmentType"` } // UnmarshalJSON unmarshals json func (m *volumeattachment) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalervolumeattachment volumeattachment s := struct { Model Unmarshalervolumeattachment }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.AvailabilityDomain = s.Model.AvailabilityDomain m.CompartmentId = s.Model.CompartmentId m.Id = s.Model.Id m.InstanceId = s.Model.InstanceId m.LifecycleState = s.Model.LifecycleState m.TimeCreated = s.Model.TimeCreated m.VolumeId = s.Model.VolumeId m.Device = s.Model.Device m.DisplayName = s.Model.DisplayName m.IsReadOnly = s.Model.IsReadOnly m.IsShareable = s.Model.IsShareable m.IsPvEncryptionInTransitEnabled = s.Model.IsPvEncryptionInTransitEnabled m.AttachmentType = s.Model.AttachmentType return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *volumeattachment) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.AttachmentType { case "iscsi": mm := IScsiVolumeAttachment{} err = json.Unmarshal(data, &mm) return mm, err case "emulated": mm := EmulatedVolumeAttachment{} err = json.Unmarshal(data, &mm) return mm, err case "paravirtualized": mm := ParavirtualizedVolumeAttachment{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } //GetAvailabilityDomain returns AvailabilityDomain func (m volumeattachment) GetAvailabilityDomain() *string { return m.AvailabilityDomain } //GetCompartmentId returns CompartmentId func (m volumeattachment) GetCompartmentId() *string { return m.CompartmentId } //GetId returns Id func (m volumeattachment) GetId() *string { return m.Id } //GetInstanceId returns InstanceId func (m volumeattachment) GetInstanceId() *string { return m.InstanceId } //GetLifecycleState returns LifecycleState func (m volumeattachment) GetLifecycleState() VolumeAttachmentLifecycleStateEnum { return m.LifecycleState } //GetTimeCreated returns TimeCreated func (m volumeattachment) GetTimeCreated() *common.SDKTime { return m.TimeCreated } //GetVolumeId returns VolumeId func (m volumeattachment) GetVolumeId() *string { return m.VolumeId } //GetDevice returns Device func (m volumeattachment) GetDevice() *string { return m.Device } //GetDisplayName returns DisplayName func (m volumeattachment) GetDisplayName() *string { return m.DisplayName } //GetIsReadOnly returns IsReadOnly func (m volumeattachment) GetIsReadOnly() *bool { return m.IsReadOnly } //GetIsShareable returns IsShareable func (m volumeattachment) GetIsShareable() *bool { return m.IsShareable } //GetIsPvEncryptionInTransitEnabled returns IsPvEncryptionInTransitEnabled func (m volumeattachment) GetIsPvEncryptionInTransitEnabled() *bool { return m.IsPvEncryptionInTransitEnabled } func (m volumeattachment) String() string { return common.PointerString(m) } // VolumeAttachmentLifecycleStateEnum Enum with underlying type: string type VolumeAttachmentLifecycleStateEnum string // Set of constants representing the allowable values for VolumeAttachmentLifecycleStateEnum const ( VolumeAttachmentLifecycleStateAttaching VolumeAttachmentLifecycleStateEnum = "ATTACHING" VolumeAttachmentLifecycleStateAttached VolumeAttachmentLifecycleStateEnum = "ATTACHED" VolumeAttachmentLifecycleStateDetaching VolumeAttachmentLifecycleStateEnum = "DETACHING" VolumeAttachmentLifecycleStateDetached VolumeAttachmentLifecycleStateEnum = "DETACHED" ) var mappingVolumeAttachmentLifecycleState = map[string]VolumeAttachmentLifecycleStateEnum{ "ATTACHING": VolumeAttachmentLifecycleStateAttaching, "ATTACHED": VolumeAttachmentLifecycleStateAttached, "DETACHING": VolumeAttachmentLifecycleStateDetaching, "DETACHED": VolumeAttachmentLifecycleStateDetached, } // GetVolumeAttachmentLifecycleStateEnumValues Enumerates the set of values for VolumeAttachmentLifecycleStateEnum func GetVolumeAttachmentLifecycleStateEnumValues() []VolumeAttachmentLifecycleStateEnum { values := make([]VolumeAttachmentLifecycleStateEnum, 0) for _, v := range mappingVolumeAttachmentLifecycleState { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_backup.go��������������������������0000664�0000000�0000000�00000021300�13771713062�0026327�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VolumeBackup A point-in-time copy of a volume that can then be used to create a new block volume // or recover a block volume. For more information, see // Overview of Cloud Volume Storage (https://docs.cloud.oracle.com/Content/Block/Concepts/overview.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type VolumeBackup struct { // The OCID of the compartment that contains the volume backup. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name for the volume backup. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the volume backup. Id *string `mandatory:"true" json:"id"` // The current state of a volume backup. LifecycleState VolumeBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the volume backup was created. This is the time the actual point-in-time image // of the volume data was taken. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The type of a volume backup. Type VolumeBackupTypeEnum `mandatory:"true" json:"type"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // System tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` // The date and time the volume backup will expire and be automatically deleted. // Format defined by RFC3339. This parameter will always be present for backups that // were created automatically by a scheduled-backup policy. For manually created backups, // it will be absent, signifying that there is no expiration time and the backup will // last forever until manually deleted. ExpirationTime *common.SDKTime `mandatory:"false" json:"expirationTime"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The OCID of the Key Management key which is the master encryption key for the volume backup. // For more information about the Key Management service and encryption keys, see // Overview of Key Management (https://docs.cloud.oracle.com/Content/KeyManagement/Concepts/keyoverview.htm) and // Using Keys (https://docs.cloud.oracle.com/Content/KeyManagement/Tasks/usingkeys.htm). KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` // The size of the volume, in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The size of the volume in MBs. The value must be a multiple of 1024. // This field is deprecated. Please use sizeInGBs. SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` // Specifies whether the backup was created manually, or via scheduled backup policy. SourceType VolumeBackupSourceTypeEnum `mandatory:"false" json:"sourceType,omitempty"` // The OCID of the source volume backup. SourceVolumeBackupId *string `mandatory:"false" json:"sourceVolumeBackupId"` // The date and time the request to create the volume backup was received. Format defined by RFC3339. TimeRequestReceived *common.SDKTime `mandatory:"false" json:"timeRequestReceived"` // The size used by the backup, in GBs. It is typically smaller than sizeInGBs, depending on the space // consumed on the volume and whether the backup is full or incremental. UniqueSizeInGBs *int64 `mandatory:"false" json:"uniqueSizeInGBs"` // The size used by the backup, in MBs. It is typically smaller than sizeInMBs, depending on the space // consumed on the volume and whether the backup is full or incremental. // This field is deprecated. Please use uniqueSizeInGBs. UniqueSizeInMbs *int64 `mandatory:"false" json:"uniqueSizeInMbs"` // The OCID of the volume. VolumeId *string `mandatory:"false" json:"volumeId"` } func (m VolumeBackup) String() string { return common.PointerString(m) } // VolumeBackupLifecycleStateEnum Enum with underlying type: string type VolumeBackupLifecycleStateEnum string // Set of constants representing the allowable values for VolumeBackupLifecycleStateEnum const ( VolumeBackupLifecycleStateCreating VolumeBackupLifecycleStateEnum = "CREATING" VolumeBackupLifecycleStateAvailable VolumeBackupLifecycleStateEnum = "AVAILABLE" VolumeBackupLifecycleStateTerminating VolumeBackupLifecycleStateEnum = "TERMINATING" VolumeBackupLifecycleStateTerminated VolumeBackupLifecycleStateEnum = "TERMINATED" VolumeBackupLifecycleStateFaulty VolumeBackupLifecycleStateEnum = "FAULTY" VolumeBackupLifecycleStateRequestReceived VolumeBackupLifecycleStateEnum = "REQUEST_RECEIVED" ) var mappingVolumeBackupLifecycleState = map[string]VolumeBackupLifecycleStateEnum{ "CREATING": VolumeBackupLifecycleStateCreating, "AVAILABLE": VolumeBackupLifecycleStateAvailable, "TERMINATING": VolumeBackupLifecycleStateTerminating, "TERMINATED": VolumeBackupLifecycleStateTerminated, "FAULTY": VolumeBackupLifecycleStateFaulty, "REQUEST_RECEIVED": VolumeBackupLifecycleStateRequestReceived, } // GetVolumeBackupLifecycleStateEnumValues Enumerates the set of values for VolumeBackupLifecycleStateEnum func GetVolumeBackupLifecycleStateEnumValues() []VolumeBackupLifecycleStateEnum { values := make([]VolumeBackupLifecycleStateEnum, 0) for _, v := range mappingVolumeBackupLifecycleState { values = append(values, v) } return values } // VolumeBackupSourceTypeEnum Enum with underlying type: string type VolumeBackupSourceTypeEnum string // Set of constants representing the allowable values for VolumeBackupSourceTypeEnum const ( VolumeBackupSourceTypeManual VolumeBackupSourceTypeEnum = "MANUAL" VolumeBackupSourceTypeScheduled VolumeBackupSourceTypeEnum = "SCHEDULED" ) var mappingVolumeBackupSourceType = map[string]VolumeBackupSourceTypeEnum{ "MANUAL": VolumeBackupSourceTypeManual, "SCHEDULED": VolumeBackupSourceTypeScheduled, } // GetVolumeBackupSourceTypeEnumValues Enumerates the set of values for VolumeBackupSourceTypeEnum func GetVolumeBackupSourceTypeEnumValues() []VolumeBackupSourceTypeEnum { values := make([]VolumeBackupSourceTypeEnum, 0) for _, v := range mappingVolumeBackupSourceType { values = append(values, v) } return values } // VolumeBackupTypeEnum Enum with underlying type: string type VolumeBackupTypeEnum string // Set of constants representing the allowable values for VolumeBackupTypeEnum const ( VolumeBackupTypeFull VolumeBackupTypeEnum = "FULL" VolumeBackupTypeIncremental VolumeBackupTypeEnum = "INCREMENTAL" ) var mappingVolumeBackupType = map[string]VolumeBackupTypeEnum{ "FULL": VolumeBackupTypeFull, "INCREMENTAL": VolumeBackupTypeIncremental, } // GetVolumeBackupTypeEnumValues Enumerates the set of values for VolumeBackupTypeEnum func GetVolumeBackupTypeEnumValues() []VolumeBackupTypeEnum { values := make([]VolumeBackupTypeEnum, 0) for _, v := range mappingVolumeBackupType { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy.go�������������������0000664�0000000�0000000�00000005564�13771713062�0027724�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VolumeBackupPolicy A policy for automatically creating volume backups according to a // recurring schedule. Has a set of one or more schedules that control when and // how backups are created. // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type VolumeBackupPolicy struct { // A user-friendly name for the volume backup policy. Does not have to be unique and it's changeable. // Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the volume backup policy. Id *string `mandatory:"true" json:"id"` // The collection of schedules that this policy will apply. Schedules []VolumeBackupSchedule `mandatory:"true" json:"schedules"` // The date and time the volume backup policy was created. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The paired destination region (pre-defined by oracle) for scheduled cross region backup calls. Example `us-ashburn-1` DestinationRegion *string `mandatory:"false" json:"destinationRegion"` // The OCID of the compartment that contains the volume backup. CompartmentId *string `mandatory:"false" json:"compartmentId"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` } func (m VolumeBackupPolicy) String() string { return common.PointerString(m) } ��������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_policy_assignment.go��������0000664�0000000�0000000�00000003463�13771713062�0032150�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VolumeBackupPolicyAssignment Specifies the volume that the volume backup policy is assigned to. // For more information about Oracle defined backup policies and custom backup policies, // see Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm). type VolumeBackupPolicyAssignment struct { // The OCID of the volume the policy has been assigned to. AssetId *string `mandatory:"true" json:"assetId"` // The OCID of the volume backup policy assignment. Id *string `mandatory:"true" json:"id"` // The OCID of the volume backup policy that has been assigned to the volume. PolicyId *string `mandatory:"true" json:"policyId"` // The date and time the volume backup policy was assigned to the volume. The format is defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` } func (m VolumeBackupPolicyAssignment) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_backup_schedule.go�����������������0000664�0000000�0000000�00000026542�13771713062�0030220�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VolumeBackupSchedule Defines the backup frequency and retention period for a volume backup policy. For more information, // see Policy-Based Backups (https://docs.cloud.oracle.com/iaas/Content/Block/Tasks/schedulingvolumebackups.htm). type VolumeBackupSchedule struct { // The type of volume backup to create. BackupType VolumeBackupScheduleBackupTypeEnum `mandatory:"true" json:"backupType"` // The volume backup frequency. Period VolumeBackupSchedulePeriodEnum `mandatory:"true" json:"period"` // How long, in seconds, to keep the volume backups created by this schedule. RetentionSeconds *int `mandatory:"true" json:"retentionSeconds"` // The number of seconds that the volume backup start time should be shifted from the default interval boundaries specified by the period. The volume backup start time is the frequency start time plus the offset. OffsetSeconds *int `mandatory:"false" json:"offsetSeconds"` // Indicates how the offset is defined. If value is `STRUCTURED`, then `hourOfDay`, `dayOfWeek`, `dayOfMonth`, and `month` fields are used and `offsetSeconds` will be ignored in requests and users should ignore its value from the responses. // `hourOfDay` is applicable for periods `ONE_DAY`, `ONE_WEEK`, `ONE_MONTH` and `ONE_YEAR`. // `dayOfWeek` is applicable for period `ONE_WEEK`. // `dayOfMonth` is applicable for periods `ONE_MONTH` and `ONE_YEAR`. // 'month' is applicable for period 'ONE_YEAR'. // They will be ignored in the requests for inapplicable periods. // If value is `NUMERIC_SECONDS`, then `offsetSeconds` will be used for both requests and responses and the structured fields will be ignored in the requests and users should ignore their values from the responses. // For clients using older versions of Apis and not sending `offsetType` in their requests, the behaviour is just like `NUMERIC_SECONDS`. OffsetType VolumeBackupScheduleOffsetTypeEnum `mandatory:"false" json:"offsetType,omitempty"` // The hour of the day to schedule the volume backup. HourOfDay *int `mandatory:"false" json:"hourOfDay"` // The day of the week to schedule the volume backup. DayOfWeek VolumeBackupScheduleDayOfWeekEnum `mandatory:"false" json:"dayOfWeek,omitempty"` // The day of the month to schedule the volume backup. DayOfMonth *int `mandatory:"false" json:"dayOfMonth"` // The month of the year to schedule the volume backup. Month VolumeBackupScheduleMonthEnum `mandatory:"false" json:"month,omitempty"` // Specifies what time zone is the schedule in TimeZone VolumeBackupScheduleTimeZoneEnum `mandatory:"false" json:"timeZone,omitempty"` } func (m VolumeBackupSchedule) String() string { return common.PointerString(m) } // VolumeBackupScheduleBackupTypeEnum Enum with underlying type: string type VolumeBackupScheduleBackupTypeEnum string // Set of constants representing the allowable values for VolumeBackupScheduleBackupTypeEnum const ( VolumeBackupScheduleBackupTypeFull VolumeBackupScheduleBackupTypeEnum = "FULL" VolumeBackupScheduleBackupTypeIncremental VolumeBackupScheduleBackupTypeEnum = "INCREMENTAL" ) var mappingVolumeBackupScheduleBackupType = map[string]VolumeBackupScheduleBackupTypeEnum{ "FULL": VolumeBackupScheduleBackupTypeFull, "INCREMENTAL": VolumeBackupScheduleBackupTypeIncremental, } // GetVolumeBackupScheduleBackupTypeEnumValues Enumerates the set of values for VolumeBackupScheduleBackupTypeEnum func GetVolumeBackupScheduleBackupTypeEnumValues() []VolumeBackupScheduleBackupTypeEnum { values := make([]VolumeBackupScheduleBackupTypeEnum, 0) for _, v := range mappingVolumeBackupScheduleBackupType { values = append(values, v) } return values } // VolumeBackupSchedulePeriodEnum Enum with underlying type: string type VolumeBackupSchedulePeriodEnum string // Set of constants representing the allowable values for VolumeBackupSchedulePeriodEnum const ( VolumeBackupSchedulePeriodHour VolumeBackupSchedulePeriodEnum = "ONE_HOUR" VolumeBackupSchedulePeriodDay VolumeBackupSchedulePeriodEnum = "ONE_DAY" VolumeBackupSchedulePeriodWeek VolumeBackupSchedulePeriodEnum = "ONE_WEEK" VolumeBackupSchedulePeriodMonth VolumeBackupSchedulePeriodEnum = "ONE_MONTH" VolumeBackupSchedulePeriodYear VolumeBackupSchedulePeriodEnum = "ONE_YEAR" ) var mappingVolumeBackupSchedulePeriod = map[string]VolumeBackupSchedulePeriodEnum{ "ONE_HOUR": VolumeBackupSchedulePeriodHour, "ONE_DAY": VolumeBackupSchedulePeriodDay, "ONE_WEEK": VolumeBackupSchedulePeriodWeek, "ONE_MONTH": VolumeBackupSchedulePeriodMonth, "ONE_YEAR": VolumeBackupSchedulePeriodYear, } // GetVolumeBackupSchedulePeriodEnumValues Enumerates the set of values for VolumeBackupSchedulePeriodEnum func GetVolumeBackupSchedulePeriodEnumValues() []VolumeBackupSchedulePeriodEnum { values := make([]VolumeBackupSchedulePeriodEnum, 0) for _, v := range mappingVolumeBackupSchedulePeriod { values = append(values, v) } return values } // VolumeBackupScheduleOffsetTypeEnum Enum with underlying type: string type VolumeBackupScheduleOffsetTypeEnum string // Set of constants representing the allowable values for VolumeBackupScheduleOffsetTypeEnum const ( VolumeBackupScheduleOffsetTypeStructured VolumeBackupScheduleOffsetTypeEnum = "STRUCTURED" VolumeBackupScheduleOffsetTypeNumericSeconds VolumeBackupScheduleOffsetTypeEnum = "NUMERIC_SECONDS" ) var mappingVolumeBackupScheduleOffsetType = map[string]VolumeBackupScheduleOffsetTypeEnum{ "STRUCTURED": VolumeBackupScheduleOffsetTypeStructured, "NUMERIC_SECONDS": VolumeBackupScheduleOffsetTypeNumericSeconds, } // GetVolumeBackupScheduleOffsetTypeEnumValues Enumerates the set of values for VolumeBackupScheduleOffsetTypeEnum func GetVolumeBackupScheduleOffsetTypeEnumValues() []VolumeBackupScheduleOffsetTypeEnum { values := make([]VolumeBackupScheduleOffsetTypeEnum, 0) for _, v := range mappingVolumeBackupScheduleOffsetType { values = append(values, v) } return values } // VolumeBackupScheduleDayOfWeekEnum Enum with underlying type: string type VolumeBackupScheduleDayOfWeekEnum string // Set of constants representing the allowable values for VolumeBackupScheduleDayOfWeekEnum const ( VolumeBackupScheduleDayOfWeekMonday VolumeBackupScheduleDayOfWeekEnum = "MONDAY" VolumeBackupScheduleDayOfWeekTuesday VolumeBackupScheduleDayOfWeekEnum = "TUESDAY" VolumeBackupScheduleDayOfWeekWednesday VolumeBackupScheduleDayOfWeekEnum = "WEDNESDAY" VolumeBackupScheduleDayOfWeekThursday VolumeBackupScheduleDayOfWeekEnum = "THURSDAY" VolumeBackupScheduleDayOfWeekFriday VolumeBackupScheduleDayOfWeekEnum = "FRIDAY" VolumeBackupScheduleDayOfWeekSaturday VolumeBackupScheduleDayOfWeekEnum = "SATURDAY" VolumeBackupScheduleDayOfWeekSunday VolumeBackupScheduleDayOfWeekEnum = "SUNDAY" ) var mappingVolumeBackupScheduleDayOfWeek = map[string]VolumeBackupScheduleDayOfWeekEnum{ "MONDAY": VolumeBackupScheduleDayOfWeekMonday, "TUESDAY": VolumeBackupScheduleDayOfWeekTuesday, "WEDNESDAY": VolumeBackupScheduleDayOfWeekWednesday, "THURSDAY": VolumeBackupScheduleDayOfWeekThursday, "FRIDAY": VolumeBackupScheduleDayOfWeekFriday, "SATURDAY": VolumeBackupScheduleDayOfWeekSaturday, "SUNDAY": VolumeBackupScheduleDayOfWeekSunday, } // GetVolumeBackupScheduleDayOfWeekEnumValues Enumerates the set of values for VolumeBackupScheduleDayOfWeekEnum func GetVolumeBackupScheduleDayOfWeekEnumValues() []VolumeBackupScheduleDayOfWeekEnum { values := make([]VolumeBackupScheduleDayOfWeekEnum, 0) for _, v := range mappingVolumeBackupScheduleDayOfWeek { values = append(values, v) } return values } // VolumeBackupScheduleMonthEnum Enum with underlying type: string type VolumeBackupScheduleMonthEnum string // Set of constants representing the allowable values for VolumeBackupScheduleMonthEnum const ( VolumeBackupScheduleMonthJanuary VolumeBackupScheduleMonthEnum = "JANUARY" VolumeBackupScheduleMonthFebruary VolumeBackupScheduleMonthEnum = "FEBRUARY" VolumeBackupScheduleMonthMarch VolumeBackupScheduleMonthEnum = "MARCH" VolumeBackupScheduleMonthApril VolumeBackupScheduleMonthEnum = "APRIL" VolumeBackupScheduleMonthMay VolumeBackupScheduleMonthEnum = "MAY" VolumeBackupScheduleMonthJune VolumeBackupScheduleMonthEnum = "JUNE" VolumeBackupScheduleMonthJuly VolumeBackupScheduleMonthEnum = "JULY" VolumeBackupScheduleMonthAugust VolumeBackupScheduleMonthEnum = "AUGUST" VolumeBackupScheduleMonthSeptember VolumeBackupScheduleMonthEnum = "SEPTEMBER" VolumeBackupScheduleMonthOctober VolumeBackupScheduleMonthEnum = "OCTOBER" VolumeBackupScheduleMonthNovember VolumeBackupScheduleMonthEnum = "NOVEMBER" VolumeBackupScheduleMonthDecember VolumeBackupScheduleMonthEnum = "DECEMBER" ) var mappingVolumeBackupScheduleMonth = map[string]VolumeBackupScheduleMonthEnum{ "JANUARY": VolumeBackupScheduleMonthJanuary, "FEBRUARY": VolumeBackupScheduleMonthFebruary, "MARCH": VolumeBackupScheduleMonthMarch, "APRIL": VolumeBackupScheduleMonthApril, "MAY": VolumeBackupScheduleMonthMay, "JUNE": VolumeBackupScheduleMonthJune, "JULY": VolumeBackupScheduleMonthJuly, "AUGUST": VolumeBackupScheduleMonthAugust, "SEPTEMBER": VolumeBackupScheduleMonthSeptember, "OCTOBER": VolumeBackupScheduleMonthOctober, "NOVEMBER": VolumeBackupScheduleMonthNovember, "DECEMBER": VolumeBackupScheduleMonthDecember, } // GetVolumeBackupScheduleMonthEnumValues Enumerates the set of values for VolumeBackupScheduleMonthEnum func GetVolumeBackupScheduleMonthEnumValues() []VolumeBackupScheduleMonthEnum { values := make([]VolumeBackupScheduleMonthEnum, 0) for _, v := range mappingVolumeBackupScheduleMonth { values = append(values, v) } return values } // VolumeBackupScheduleTimeZoneEnum Enum with underlying type: string type VolumeBackupScheduleTimeZoneEnum string // Set of constants representing the allowable values for VolumeBackupScheduleTimeZoneEnum const ( VolumeBackupScheduleTimeZoneUtc VolumeBackupScheduleTimeZoneEnum = "UTC" VolumeBackupScheduleTimeZoneRegionalDataCenterTime VolumeBackupScheduleTimeZoneEnum = "REGIONAL_DATA_CENTER_TIME" ) var mappingVolumeBackupScheduleTimeZone = map[string]VolumeBackupScheduleTimeZoneEnum{ "UTC": VolumeBackupScheduleTimeZoneUtc, "REGIONAL_DATA_CENTER_TIME": VolumeBackupScheduleTimeZoneRegionalDataCenterTime, } // GetVolumeBackupScheduleTimeZoneEnumValues Enumerates the set of values for VolumeBackupScheduleTimeZoneEnum func GetVolumeBackupScheduleTimeZoneEnumValues() []VolumeBackupScheduleTimeZoneEnum { values := make([]VolumeBackupScheduleTimeZoneEnum, 0) for _, v := range mappingVolumeBackupScheduleTimeZone { values = append(values, v) } return values } ��������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_group.go���������������������������0000664�0000000�0000000�00000015244�13771713062�0026230�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeGroup Specifies a volume group which is a collection of // volumes. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type VolumeGroup struct { // The availability domain of the volume group. AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` // The OCID of the compartment that contains the volume group. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name for the volume group. Does not have to be unique, and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID for the volume group. Id *string `mandatory:"true" json:"id"` // The current state of a volume group. LifecycleState VolumeGroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The aggregate size of the volume group in MBs. SizeInMBs *int64 `mandatory:"true" json:"sizeInMBs"` // The date and time the volume group was created. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // OCIDs for the volumes in this volume group. VolumeIds []string `mandatory:"true" json:"volumeIds"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The aggregate size of the volume group in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The volume group source. The source is either another a list of // volume IDs in the same availability domain, another volume group, or a volume group backup. SourceDetails VolumeGroupSourceDetails `mandatory:"false" json:"sourceDetails"` // Specifies whether the newly created cloned volume group's data has finished copying from the source volume group or backup. IsHydrated *bool `mandatory:"false" json:"isHydrated"` } func (m VolumeGroup) String() string { return common.PointerString(m) } // UnmarshalJSON unmarshals from json func (m *VolumeGroup) UnmarshalJSON(data []byte) (e error) { model := struct { DefinedTags map[string]map[string]interface{} `json:"definedTags"` FreeformTags map[string]string `json:"freeformTags"` SizeInGBs *int64 `json:"sizeInGBs"` SourceDetails volumegroupsourcedetails `json:"sourceDetails"` IsHydrated *bool `json:"isHydrated"` AvailabilityDomain *string `json:"availabilityDomain"` CompartmentId *string `json:"compartmentId"` DisplayName *string `json:"displayName"` Id *string `json:"id"` LifecycleState VolumeGroupLifecycleStateEnum `json:"lifecycleState"` SizeInMBs *int64 `json:"sizeInMBs"` TimeCreated *common.SDKTime `json:"timeCreated"` VolumeIds []string `json:"volumeIds"` }{} e = json.Unmarshal(data, &model) if e != nil { return } var nn interface{} m.DefinedTags = model.DefinedTags m.FreeformTags = model.FreeformTags m.SizeInGBs = model.SizeInGBs nn, e = model.SourceDetails.UnmarshalPolymorphicJSON(model.SourceDetails.JsonData) if e != nil { return } if nn != nil { m.SourceDetails = nn.(VolumeGroupSourceDetails) } else { m.SourceDetails = nil } m.IsHydrated = model.IsHydrated m.AvailabilityDomain = model.AvailabilityDomain m.CompartmentId = model.CompartmentId m.DisplayName = model.DisplayName m.Id = model.Id m.LifecycleState = model.LifecycleState m.SizeInMBs = model.SizeInMBs m.TimeCreated = model.TimeCreated m.VolumeIds = make([]string, len(model.VolumeIds)) for i, n := range model.VolumeIds { m.VolumeIds[i] = n } return } // VolumeGroupLifecycleStateEnum Enum with underlying type: string type VolumeGroupLifecycleStateEnum string // Set of constants representing the allowable values for VolumeGroupLifecycleStateEnum const ( VolumeGroupLifecycleStateProvisioning VolumeGroupLifecycleStateEnum = "PROVISIONING" VolumeGroupLifecycleStateAvailable VolumeGroupLifecycleStateEnum = "AVAILABLE" VolumeGroupLifecycleStateTerminating VolumeGroupLifecycleStateEnum = "TERMINATING" VolumeGroupLifecycleStateTerminated VolumeGroupLifecycleStateEnum = "TERMINATED" VolumeGroupLifecycleStateFaulty VolumeGroupLifecycleStateEnum = "FAULTY" ) var mappingVolumeGroupLifecycleState = map[string]VolumeGroupLifecycleStateEnum{ "PROVISIONING": VolumeGroupLifecycleStateProvisioning, "AVAILABLE": VolumeGroupLifecycleStateAvailable, "TERMINATING": VolumeGroupLifecycleStateTerminating, "TERMINATED": VolumeGroupLifecycleStateTerminated, "FAULTY": VolumeGroupLifecycleStateFaulty, } // GetVolumeGroupLifecycleStateEnumValues Enumerates the set of values for VolumeGroupLifecycleStateEnum func GetVolumeGroupLifecycleStateEnumValues() []VolumeGroupLifecycleStateEnum { values := make([]VolumeGroupLifecycleStateEnum, 0) for _, v := range mappingVolumeGroupLifecycleState { values = append(values, v) } return values } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_group_backup.go��������������������0000664�0000000�0000000�00000016043�13771713062�0027553�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VolumeGroupBackup A point-in-time copy of a volume group that can then be used to create a new volume group // or restore a volume group. For more information, see Volume Groups (https://docs.cloud.oracle.com/Content/Block/Concepts/volumegroups.htm). // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, // talk to an administrator. If you're an administrator who needs to write policies to give users access, see // Getting Started with Policies (https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm). // **Warning:** Oracle recommends that you avoid using any confidential information when you // supply string values using the API. type VolumeGroupBackup struct { // The OCID of the compartment that contains the volume group backup. CompartmentId *string `mandatory:"true" json:"compartmentId"` // A user-friendly name for the volume group backup. Does not have to be unique and it's changeable. Avoid entering confidential information. DisplayName *string `mandatory:"true" json:"displayName"` // The OCID of the volume group backup. Id *string `mandatory:"true" json:"id"` // The current state of a volume group backup. LifecycleState VolumeGroupBackupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` // The date and time the volume group backup was created. This is the time the actual point-in-time image // of the volume group data was taken. Format defined by RFC3339. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` // The type of backup. Type VolumeGroupBackupTypeEnum `mandatory:"true" json:"type"` // OCIDs for the volume backups in this volume group backup. VolumeBackupIds []string `mandatory:"true" json:"volumeBackupIds"` // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` // Free-form tags for this resource. Each tag is a simple key-value pair with no // predefined name, type, or namespace. For more information, see Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). // Example: `{"Department": "Finance"}` FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` // The aggregate size of the volume group backup, in MBs. SizeInMBs *int64 `mandatory:"false" json:"sizeInMBs"` // The aggregate size of the volume group backup, in GBs. SizeInGBs *int64 `mandatory:"false" json:"sizeInGBs"` // The date and time the request to create the volume group backup was received. Format defined by RFC3339. TimeRequestReceived *common.SDKTime `mandatory:"false" json:"timeRequestReceived"` // The aggregate size used by the volume group backup, in MBs. // It is typically smaller than sizeInMBs, depending on the space // consumed on the volume group and whether the volume backup is full or incremental. UniqueSizeInMbs *int64 `mandatory:"false" json:"uniqueSizeInMbs"` // The aggregate size used by the volume group backup, in GBs. // It is typically smaller than sizeInGBs, depending on the space // consumed on the volume group and whether the volume backup is full or incremental. UniqueSizeInGbs *int64 `mandatory:"false" json:"uniqueSizeInGbs"` // The OCID of the source volume group. VolumeGroupId *string `mandatory:"false" json:"volumeGroupId"` } func (m VolumeGroupBackup) String() string { return common.PointerString(m) } // VolumeGroupBackupLifecycleStateEnum Enum with underlying type: string type VolumeGroupBackupLifecycleStateEnum string // Set of constants representing the allowable values for VolumeGroupBackupLifecycleStateEnum const ( VolumeGroupBackupLifecycleStateCreating VolumeGroupBackupLifecycleStateEnum = "CREATING" VolumeGroupBackupLifecycleStateCommitted VolumeGroupBackupLifecycleStateEnum = "COMMITTED" VolumeGroupBackupLifecycleStateAvailable VolumeGroupBackupLifecycleStateEnum = "AVAILABLE" VolumeGroupBackupLifecycleStateTerminating VolumeGroupBackupLifecycleStateEnum = "TERMINATING" VolumeGroupBackupLifecycleStateTerminated VolumeGroupBackupLifecycleStateEnum = "TERMINATED" VolumeGroupBackupLifecycleStateFaulty VolumeGroupBackupLifecycleStateEnum = "FAULTY" VolumeGroupBackupLifecycleStateRequestReceived VolumeGroupBackupLifecycleStateEnum = "REQUEST_RECEIVED" ) var mappingVolumeGroupBackupLifecycleState = map[string]VolumeGroupBackupLifecycleStateEnum{ "CREATING": VolumeGroupBackupLifecycleStateCreating, "COMMITTED": VolumeGroupBackupLifecycleStateCommitted, "AVAILABLE": VolumeGroupBackupLifecycleStateAvailable, "TERMINATING": VolumeGroupBackupLifecycleStateTerminating, "TERMINATED": VolumeGroupBackupLifecycleStateTerminated, "FAULTY": VolumeGroupBackupLifecycleStateFaulty, "REQUEST_RECEIVED": VolumeGroupBackupLifecycleStateRequestReceived, } // GetVolumeGroupBackupLifecycleStateEnumValues Enumerates the set of values for VolumeGroupBackupLifecycleStateEnum func GetVolumeGroupBackupLifecycleStateEnumValues() []VolumeGroupBackupLifecycleStateEnum { values := make([]VolumeGroupBackupLifecycleStateEnum, 0) for _, v := range mappingVolumeGroupBackupLifecycleState { values = append(values, v) } return values } // VolumeGroupBackupTypeEnum Enum with underlying type: string type VolumeGroupBackupTypeEnum string // Set of constants representing the allowable values for VolumeGroupBackupTypeEnum const ( VolumeGroupBackupTypeFull VolumeGroupBackupTypeEnum = "FULL" VolumeGroupBackupTypeIncremental VolumeGroupBackupTypeEnum = "INCREMENTAL" ) var mappingVolumeGroupBackupType = map[string]VolumeGroupBackupTypeEnum{ "FULL": VolumeGroupBackupTypeFull, "INCREMENTAL": VolumeGroupBackupTypeIncremental, } // GetVolumeGroupBackupTypeEnumValues Enumerates the set of values for VolumeGroupBackupTypeEnum func GetVolumeGroupBackupTypeEnumValues() []VolumeGroupBackupTypeEnum { values := make([]VolumeGroupBackupTypeEnum, 0) for _, v := range mappingVolumeGroupBackupType { values = append(values, v) } return values } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_group_source_details.go������������0000664�0000000�0000000�00000004253�13771713062�0031313�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeGroupSourceDetails Specifies the source for a volume group. type VolumeGroupSourceDetails interface { } type volumegroupsourcedetails struct { JsonData []byte Type string `json:"type"` } // UnmarshalJSON unmarshals json func (m *volumegroupsourcedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalervolumegroupsourcedetails volumegroupsourcedetails s := struct { Model Unmarshalervolumegroupsourcedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.Type = s.Model.Type return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *volumegroupsourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Type { case "volumeGroupId": mm := VolumeGroupSourceFromVolumeGroupDetails{} err = json.Unmarshal(data, &mm) return mm, err case "volumeIds": mm := VolumeGroupSourceFromVolumesDetails{} err = json.Unmarshal(data, &mm) return mm, err case "volumeGroupBackupId": mm := VolumeGroupSourceFromVolumeGroupBackupDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m volumegroupsourcedetails) String() string { return common.PointerString(m) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������volume_group_source_from_volume_group_backup_details.go���������������������������������������������0000664�0000000�0000000�00000003410�13771713062�0036401�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeGroupSourceFromVolumeGroupBackupDetails Specifies the volume group backup to restore from. type VolumeGroupSourceFromVolumeGroupBackupDetails struct { // The OCID of the volume group backup to restore from. VolumeGroupBackupId *string `mandatory:"true" json:"volumeGroupBackupId"` } func (m VolumeGroupSourceFromVolumeGroupBackupDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m VolumeGroupSourceFromVolumeGroupBackupDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeVolumeGroupSourceFromVolumeGroupBackupDetails VolumeGroupSourceFromVolumeGroupBackupDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeVolumeGroupSourceFromVolumeGroupBackupDetails }{ "volumeGroupBackupId", (MarshalTypeVolumeGroupSourceFromVolumeGroupBackupDetails)(m), } return json.Marshal(&s) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������volume_group_source_from_volume_group_details.go����������������������������������������������������0000664�0000000�0000000�00000003264�13771713062�0035063�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeGroupSourceFromVolumeGroupDetails Specifies the volume group to clone from. type VolumeGroupSourceFromVolumeGroupDetails struct { // The OCID of the volume group to clone from. VolumeGroupId *string `mandatory:"true" json:"volumeGroupId"` } func (m VolumeGroupSourceFromVolumeGroupDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m VolumeGroupSourceFromVolumeGroupDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeVolumeGroupSourceFromVolumeGroupDetails VolumeGroupSourceFromVolumeGroupDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeVolumeGroupSourceFromVolumeGroupDetails }{ "volumeGroupId", (MarshalTypeVolumeGroupSourceFromVolumeGroupDetails)(m), } return json.Marshal(&s) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������volume_group_source_from_volumes_details.go���������������������������������������������������������0000664�0000000�0000000�00000003210�13771713062�0034021�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeGroupSourceFromVolumesDetails Specifies the volumes in a volume group. type VolumeGroupSourceFromVolumesDetails struct { // OCIDs for the volumes in this volume group. VolumeIds []string `mandatory:"true" json:"volumeIds"` } func (m VolumeGroupSourceFromVolumesDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m VolumeGroupSourceFromVolumesDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeVolumeGroupSourceFromVolumesDetails VolumeGroupSourceFromVolumesDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeVolumeGroupSourceFromVolumesDetails }{ "volumeIds", (MarshalTypeVolumeGroupSourceFromVolumesDetails)(m), } return json.Marshal(&s) } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_kms_key.go�������������������������0000664�0000000�0000000�00000002403�13771713062�0026527�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "github.com/oracle/oci-go-sdk/common" ) // VolumeKmsKey The Key Management master encryption key associated with this volume. type VolumeKmsKey struct { // The OCID of the Key Management key assigned to this volume. If the volume is not using Key Management, then the `kmsKeyId` will be a null string. KmsKeyId *string `mandatory:"false" json:"kmsKeyId"` } func (m VolumeKmsKey) String() string { return common.PointerString(m) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_source_details.go������������������0000664�0000000�0000000�00000003751�13771713062�0030101�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeSourceDetails The representation of VolumeSourceDetails type VolumeSourceDetails interface { } type volumesourcedetails struct { JsonData []byte Type string `json:"type"` } // UnmarshalJSON unmarshals json func (m *volumesourcedetails) UnmarshalJSON(data []byte) error { m.JsonData = data type Unmarshalervolumesourcedetails volumesourcedetails s := struct { Model Unmarshalervolumesourcedetails }{} err := json.Unmarshal(data, &s.Model) if err != nil { return err } m.Type = s.Model.Type return err } // UnmarshalPolymorphicJSON unmarshals polymorphic json func (m *volumesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { if data == nil || string(data) == "null" { return nil, nil } var err error switch m.Type { case "volume": mm := VolumeSourceFromVolumeDetails{} err = json.Unmarshal(data, &mm) return mm, err case "volumeBackup": mm := VolumeSourceFromVolumeBackupDetails{} err = json.Unmarshal(data, &mm) return mm, err default: return *m, nil } } func (m volumesourcedetails) String() string { return common.PointerString(m) } �����������������������volume_source_from_volume_backup_details.go���������������������������������������������������������0000664�0000000�0000000�00000003143�13771713062�0033754�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core��������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeSourceFromVolumeBackupDetails Specifies the volume backup. type VolumeSourceFromVolumeBackupDetails struct { // The OCID of the volume backup. Id *string `mandatory:"true" json:"id"` } func (m VolumeSourceFromVolumeBackupDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m VolumeSourceFromVolumeBackupDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeVolumeSourceFromVolumeBackupDetails VolumeSourceFromVolumeBackupDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeVolumeSourceFromVolumeBackupDetails }{ "volumeBackup", (MarshalTypeVolumeSourceFromVolumeBackupDetails)(m), } return json.Marshal(&s) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/oracle/oci-go-sdk/core/volume_source_from_volume_details.go������0000664�0000000�0000000�00000003046�13771713062�0032510�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. // Code generated. DO NOT EDIT. // Core Services API // // API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm), // Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and // Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API // to manage resources such as virtual cloud networks (VCNs), compute instances, and // block storage volumes. // package core import ( "encoding/json" "github.com/oracle/oci-go-sdk/common" ) // VolumeSourceFromVolumeDetails Specifies the source volume. type VolumeSourceFromVolumeDetails struct { // The OCID of the volume. Id *string `mandatory:"true" json:"id"` } func (m VolumeSourceFromVolumeDetails) String() string { return common.PointerString(m) } // MarshalJSON marshals to json representation func (m VolumeSourceFromVolumeDetails) MarshalJSON() (buff []byte, e error) { type MarshalTypeVolumeSourceFromVolumeDetails VolumeSourceFromVolumeDetails s := struct { DiscriminatorParam string `json:"type"` MarshalTypeVolumeSourceFromVolumeDetails }{ "volume", (MarshalTypeVolumeSourceFromVolumeDetails)(m), } return json.Marshal(&s) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021520�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025403�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/.gitignore����������������������0000664�0000000�0000000�00000000707�13771713062�0027377�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof /.idea/ .idea/compiler.xml .idea/copyright/ .idea/encodings.xml .idea/misc.xml .idea/modules.xml .idea/profitbricks-sdk-go.iml .idea/vcs.xml .idea/workspace.xml /.idea/libraries/ .DS_Store ���������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/LICENSE�������������������������0000664�0000000�0000000�00000026124�13771713062�0026415�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2015 ProfitBricks GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/README.md�����������������������0000664�0000000�0000000�00000213757�13771713062�0026701�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Go SDK Version: profitbricks-sdk-go **4.0.2** The ProfitBricks Client Library for [Go](https://www.golang.org/) provides you with access to the ProfitBricks REST API. It is designed for developers who are building applications in Go. This guide will walk you through getting setup with the library and performing various actions against the API. ## Table of Contents * [Description](#description) * [Getting Started](#getting-started) * [Installation](#installation) * [Authenticating](#authenticating) * [Error Handling](#error-handling) * [Reference](#reference) * [Data Centers](#data-centers) * [List Data Centers](#list-data-centers) * [Retrieve a Data Center](#retrieve-a-data-center) * [Create a Data Center](#create-a-data-center) * [Update a Data Center](#update-a-data-center) * [Delete a Data Center](#delete-a-data-center) * [Locations](#locations) * [List Locations](#list-locations) * [Get a Location](#get-a-location) * [Servers](#servers) * [List Servers](#list-servers) * [Retrieve a Server](#retrieve-a-server) * [Create a Server](#create-a-server) * [Update a Server](#update-a-server) * [Delete a Server](#delete-a-server) * [List Attached Volumes](#list-attached-volumes) * [Attach a Volume](#attach-a-volume) * [Retrieve an Attached Volume](#retrieve-an-attached-volume) * [Detach a Volume](#detach-a-volume) * [List Attached CD-ROMs](#list-attached-cd-roms) * [Attach a CD-ROM](#attach-a-cd-rom) * [Retrieve an Attached CD-ROM](#retrieve-an-attached-cd-rom) * [Detach a CD-ROM](#detach-a-cd-rom) * [Reboot a Server](#reboot-a-server) * [Start a Server](#start-a-server) * [Stop a Server](#stop-a-server) * [Images](#images) * [List Images](#list-images) * [Get an Image](#get-an-image) * [Update an Image](#update-an-image) * [Delete an Image](#delete-an-image) * [Volumes](#volumes) * [List Volumes](#list-volumes) * [Get a Volume](#get-a-volume) * [Create a Volume](#create-a-volume) * [Update a Volume](#update-a-volume) * [Delete a Volume](#delete-a-volume) * [Create a Volume Snapshot](#create-a-volume-snapshot) * [Restore a Volume Snapshot](#restore-a-volume-snapshot) * [Snapshots](#snapshots) * [List Snapshots](#list-snapshots) * [Get a Snapshot](#get-a-snapshot) * [Update a Snapshot](#update-a-snapshot) * [Delete a Snapshot](#delete-a-snapshot) * [IP Blocks](#ip-blocks) * [List IP Blocks](#list-ip-blocks) * [Get an IP Block](#get-an-ip-block) * [Create an IP Block](#create-an-ip-block) * [Delete an IP Block](#delete-an-ip-block) * [LANs](#lans) * [List LANs](#list-lans) * [Create a LAN](#create-a-lan) * [Get a LAN](#get-a-lan) * [Update a LAN](#update-a-lan) * [Delete a LAN](#delete-a-lan) * [Network Interfaces (NICs)](#network-interfaces-nics) * [List NICs](#list-nics) * [Get a NIC](#get-a-nic) * [Create a NIC](#create-a-nic) * [Update a NIC](#update-a-nic) * [Delete a NIC](#delete-a-nic) * [Firewall Rules](#firewall-rules) * [List Firewall Rules](#list-firewall-rules) * [Get a Firewall Rule](#get-a-firewall-rule) * [Create a Firewall Rule](#create-a-firewall-rule) * [Update a Firewall Rule](#update-a-firewall-rule) * [Delete a Firewall Rule](#delete-a-firewall-rule) * [Load Balancers](#load-balancers) * [List Load Balancers](#list-load-balancers) * [Get a Load Balancer](#get-a-load-balancer) * [Create a Load Balancer](#create-a-load-balancer) * [Update a Load Balancer](#update-a-load-balancer) * [List Load Balanced NICs](#list-load-balanced-nics) * [Get a Load Balanced NIC](#get-a-load-balanced-nic) * [Associate NIC to a Load Balancer](#associate-nic-to-a-load-balancer) * [Remove a NIC Association](#remove-a-nic-association) * [Requests](#requests) * [List Requests](#list-requests) * [Get a Request](#get-a-request) * [Get a Request Status](#get-a-request-status) * [Contract Resources](#contract-resources) * [Users Management](#users-management) * [List Groups](#list-groups) * [Retrieve a Group](#retrieve-a-group) * [Create a Group](#create-a-group) * [Update a Group](#update-a-group) * [Delete a Group](#delete-a-group) * [List Shares](#list-shares) * [Retrieve a Share](#retrieve-a-share) * [Add a Share](#add-a-share) * [Update a Share](#update-a-share) * [Delete a Share](#delete-a-share) * [List Users in a Group](#list-users-in-a-group) * [Add User to Group](#add-user-to-group) * [Remove User from a Group](#remove-user-from-a-group) * [List Users](#list-users) * [Retrieve a User](#retrieve-a-user) * [Create a User](#create-a-user) * [Update a User](#update-a-user) * [Delete a User](#delete-a-user) * [List Resources](#list-resources) * [List All Resources of a Type](#list-all-resources-of-a-type) * [List a specific Resource Type](#list-a-specific-resource-type) * [Example](#example) * [Support](#support) * [Testing](#testing) * [Contributing](#contributing) # Description The Go SDK wraps the latest version of the ProfitBricks REST API. All API operations are performed over SSL and authenticated using your ProfitBricks portal credentials. The API can be accessed within an instance running in ProfitBricks or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response. ## Getting Started Before you begin you will need to have [signed-up](https://www.profitbricks.com/signup) for a ProfitBricks account. The credentials you setup during sign-up will be used to authenticate against the API. ### Installation Install the Go language from: [Go Installation](https://golang.org/doc/install) The `GOPATH` environment variable specifies the location of your Go workspace. It is likely the only environment variable you'll need to set when developing Go code. This is an example of pointing to a workspace configured underneath your home directory: ``` mkdir -p ~/go/bin export GOPATH=~/go export GOBIN=$GOPATH/bin export PATH=$PATH:$GOBIN ``` The following go command will download `profitbricks-sdk-go` to your configured `GOPATH`: ```go go get "github.com/profitbricks/profitbricks-sdk-go" ``` The source code of the package will be located at: $GOBIN\src\profitbricks-sdk-go Create main package file *example.go*: ```go package main import ( "fmt" ) func main() { } ``` Import GO SDK: ```go import( "github.com/profitbricks/profitbricks-sdk-go" ) ``` ### Authenticating Add your credentials for connecting to ProfitBricks: ```go profitbricks.SetAuth("username", "password") ``` **Caution**: You will want to ensure you follow security best practices when using credentials within your code or stored in a file. ### Error Handling The SDK will raise custom exceptions when the Cloud API returns an error. There are four response types: | HTTP Code | Description | |---|---| | 401 | The supplied user credentials are invalid. | | 404 | The requested resource cannot be found. | | 422 | The request body includes invalid JSON. | | 429 | The Cloud API rate limit has been exceeded. | # Concepts The Go SDK wraps the latest version of the ProfitBricks REST API. All API operations are performed over SSL and authenticated using your ProfitBricks portal credentials. The API can be accessed within an instance running in ProfitBricks or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response. # Getting Started Before you begin you will need to have [signed-up](https://www.profitbricks.com/signup) for a ProfitBricks account. The credentials you setup during sign-up will be used to authenticate against the API. Install the Go language from: [Go Installation](https://golang.org/doc/install) The `GOPATH` environment variable specifies the location of your Go workspace. It is likely the only environment variable you'll need to set when developing Go code. This is an example of pointing to a workspace configured underneath your home directory: ``` mkdir -p ~/go/bin export GOPATH=~/go export GOBIN=$GOPATH/bin export PATH=$PATH:$GOBIN ``` # Installation The following go command will download `profitbricks-sdk-go` to your configured `GOPATH`: ```go go get "github.com/profitbricks/profitbricks-sdk-go" ``` The source code of the package will be located at: $GOBIN\src\profitbricks-sdk-go Create main package file *example.go*: ```go package main import ( "fmt" ) func main() { } ``` Import GO SDK: ```go import( "github.com/profitbricks/profitbricks-sdk-go" ) ``` Add your credentials for connecting to ProfitBricks: ```go profitbricks.SetAuth("username", "password") ``` Set depth: ```go profitbricks.SetDepth("5") ``` Depth controls the amount of data returned from the REST server ( range 1-5 ). The larger the number the more information is returned from the server. This is especially useful if you are looking for the information in the nested objects. **Caution**: You will want to ensure you follow security best practices when using credentials within your code or stored in a file. ## Reference This section provides details on all the available operations and the arguments they accept. Brief code snippets demonstrating usage are also included. ##### Depth Many of the *List* or *Get* operations will accept an optional *depth* argument. Setting this to a value between 0 and 5 affects the amount of data that is returned. The detail returned varies somewhat depending on the resource being queried, however it generally follows this pattern. | Depth | Description | |:-:|---| | 0 | Only direct properties are included. Children are not included. | | 1 | Direct properties and children's references are returned. | | 2 | Direct properties and children's properties are returned. | | 3 | Direct properties, children's properties, and descendant's references are returned. | | 4 | Direct properties, children's properties, and descendant's properties are returned. | | 5 | Returns all available properties. | This SDK sets the *Depth=5* by default as that works well in the majority of cases. You may find that setting *Depth* to a lower or higher value could simplify a later operation by reducing or increasing the data available in the response object. ### Data Centers Virtual Data Centers (VDCs) are the foundation of the ProfitBricks platform. VDCs act as logical containers for all other objects you will be creating, e.g., servers. You can provision as many VDCs as you want. VDCs have their own private network and are logically segmented from each other to create isolation. #### List Data Centers This operation will list all currently provisioned VDCs that your account credentials provide access to. There are no request arguments that need to be supplied. Call `ListDatacenters`: ListDatacenters() --- #### Retrieve a Data Center Use this to retrieve details about a specific VDC. The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | dcid | Yes | string | The ID of the data center. | Pass the arguments to `GetDatacenter`: GetDatacenter(dcid string) --- #### Create a Data Center Use this operation to create a new VDC. You can create a "simple" VDC by supplying just the required *Name* and *Location* arguments. This operation also has the capability of provisioning a "complex" VDC by supplying additional arguments for servers, volumes, LANs, and/or load balancers. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenter | **yes** | object | A [Datacenter object](#datacenter-resource-object) describing the VDC being created. | Build the `Datacenter` resource object: var obj = Datacenter{ Properties: DatacenterProperties{ Name: "GO SDK Test", Description: "GO SDK test datacenter", Location: location, }, } Pass the object to `CreateDatacenter`: CreateDatacenter(obj) ##### Datacenter Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | **yes** | string | The name of the VDC. | | Location | **yes** | string | The physical ProfitBricks location where the VDC will be created. | | Description | no | string | A description for the VDC, e.g. staging, production. | | Servers | no | list | A list of one or more [Server objects](#server-resource-object) to be created. | | Volumes | no | list | A list of one or more [Volume objects](#volume-resource-object) to be created. | | Lans | no | list | A list of one or more [LAN objects](#lan-resource-object) to be created. | | Loadbalancers | no | list | A list of one or more [LoadBalancer objects](#load-balancer-resource-object) to be created. | The following table outlines the locations currently supported: | Value| Country | City | |---|---|---| | us/las | United States | Las Vegas | | us/ewr | United States | Newark | | de/fra | Germany | Frankfurt | | de/fkb | Germany | Karlsruhe | **NOTES**: * The value for `Name` cannot contain the following characters: (@, /, , |, ‘’, ‘). * You cannot change the VDC `Location` once it has been provisioned. --- #### Update a Data Center After retrieving a VDC, either by ID or as a create response object, you can change its properties by calling the `update_datacenter` method. Some arguments may not be changed using `update_datacenter`. The following table describes the available request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | dcid | **yes** | string | The ID of the VDC. | | Name | no | string | The new name of the VDC. | | Description | no | string | The new description of the VDC. | Build the `DatacenterProperties` resource object: var obj = DatacenterProperties{Name: "new Name",Description: "new desc"} Pass the arguments to `PatchDatacenter`: PatchDatacenter(dcid string, obj DatacenterProperties) --- #### Delete a Data Center This will remove all objects within the VDC and remove the VDC object itself. **NOTE**: This is a highly destructive operation which should be used with extreme caution! The following table describes the available request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | dcid | **yes** | string | The ID of the VDC that you want to delete. | Pass the argument to `DeleteDatacenter`: DeleteDatacenter(dcid) --- ### Locations Locations are the physical ProfitBricks data centers where you can provision your VDCs. #### List Locations The `ListLocations` operation will return the list of currently available locations. There are no request arguments to supply. ListLocations() --- #### Get a Location Retrieves the attributes of a specific location. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | locationid | **yes** | string | The ID consisting of country/city. | Pass the argument to `GetLocation`: GetLocation("us/las") --- #### Get a Regional Location Retrieves the locations available in a specific region. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | regionid | **yes** | string | The ID consisting of country/city. | Pass the argument to `GetRegionalLocations`: GetRegionalLocations("us") --- ### Servers #### List Servers You can retrieve a list of all the servers provisioned inside a specific VDC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | dcid | **yes** | string | The ID of the VDC. | Pass the arguments to `ListServers`: ListServers(dcid) --- #### Retrieve a Server Returns information about a specific server such as its configuration, provisioning status, etc. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | dcId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | Pass the arguments to `GetServer`: GetServer(dcId, serverId) --- #### Create a Server Creates a server within an existing VDC. You can configure additional properties such as specifying a boot volume and connecting the server to a LAN. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | server | **yes** | object | A [Server object](#server-resource-object) describing the server being created. | Build a [Server](#server-resource-object) object: var server = Server{ Properties: ServerProperties{ Name: "GO SDK Test", Ram: 1024, Cores: 1, AvailabilityZone: "ZONE_1", CpuFamily: "INTEL_XEON", }, } Pass the object and other arguments to `CreateServer`: CreateServer(datacenterId, server) ##### Server Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | **yes** | string | The name of the server. | | Cores | **yes** | int | The total number of cores for the server. | | Ram | **yes** | int | The amount of memory for the server in MB, e.g. 2048. Size must be specified in multiples of 256 MB with a minimum of 256 MB; however, if you set `RamHotPlug` to *true* then you must use a minimum of 1024 MB. | | AvailabilityZone | no | string | The availability zone in which the server should exist. | | CpuFamily | no | string | Sets the CPU type. "AMD_OPTERON" or "INTEL_XEON". Defaults to "AMD_OPTERON". | | BootVolume | no | string | A volume ID that the server will boot from. If not *nil* then `BootCdrom` has to be *nil*. | | BootCdrom | no | string | A CD-ROM image ID used for booting. If not *nil* then `BootVolume` has to be *nil*. | | Cdroms | no | list | A list of existing volume IDs that you want to connect to the server. | | Volumes | no | list | One or more [Volume objects](#volume-resource-object) that you want to create and attach to the server.| | Nics | no | list | One or more [NIC objects](#nic-resource-object) that you wish to create at the time the server is provisioned. | The following table outlines the server availability zones currently supported: | Availability Zone | Comment | |---|---| | AUTO | Automatically Selected Zone | | ZONE_1 | Fire Zone 1 | | ZONE_2 | Fire Zone 2 | --- #### Update a Server Perform updates to the attributes of a server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | Name | no | string | The name of the server. | | Cores | no | int | The number of cores for the server. | | Ram | no | int | The amount of memory in the server. | | AvailabilityZone | no | string | The new availability zone for the server. | | CpuFamily | no | string | Sets the CPU type. "AMD_OPTERON" or "INTEL_XEON". Defaults to "AMD_OPTERON". | | BootVolume | no | string | A volume ID used for booting. If not *nil* then `BootCdrom` has to be *nil*. | | BootCdrom | no | string | A CD-ROM image ID used for booting. If not *nil* then `BootVolume` has to be *nil*. | Build a [ServerProperties](#serverproperties) object: var server = ServerProperties{ Name: "GO SDK Test RENAME", } Pass the arguments to `update_server`: PatchServer(datacenterId, serverId, server) --- #### Delete a Server This will remove a server from a VDC. **NOTE**: This will not automatically remove the storage volume(s) attached to a server. A separate operation is required to delete a storage volume. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server that will be deleted. | Pass the arguments to `delete_server`: DeleteServer(datacenterId, serverId) --- #### List Attached Volumes Retrieves a list of volumes attached to the server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | Pass the arguments to `ListAttachedVolumes`: ListAttachedVolumes(datacenterId, serverId) --- #### Attach a Volume This will attach a pre-existing storage volume to the server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | volumeId | **yes** | string | The ID of a storage volume. | Pass the arguments to `AttachVolume`: AttachVolume(datacenterId, serverId, volumeId) --- #### Retrieve an Attached Volume This will retrieve the properties of an attached volume. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | volumeId | **yes** | string | The ID of the attached volume. | Pass the arguments to `get_attached_volume`: GetAttachedVolume(srv_dc_id, srv_srvid, srv_vol) --- #### Detach a Volume This will detach the volume from the server. Depending on the volume `hot_unplug` settings, this may result in the server being rebooted. If `disc_virtio_hot_unplug` has been set to *true*, then a reboot should not be required. This will **NOT** delete the volume from your VDC. You will need to make a separate request to delete a volume. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | volumeId | **yes** | string | The ID of the attached volume. | Pass the arguments to `detach_volume`: DetachVolume(datacenterId, serverId, volumeId) --- #### List Attached CD-ROMs Retrieves a list of CD-ROMs attached to a server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | Pass the arguments to `ListAttachedCdroms`: ListAttachedCdroms(srv_dc_id, srv_srvid) --- #### Attach a CD-ROM You can attach a CD-ROM to an existing server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | cdromId | **yes** | string | The ID of a CD-ROM. | Pass the arguments to `attach_cdrom`: AttachCdrom(datacenterId, serverId, cdromId) --- #### Retrieve an Attached CD-ROM You can retrieve a specific CD-ROM attached to the server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | cdromId | **yes** | string | The ID of the attached CD-ROM. | Pass the arguments to `GetAttachedCdrom`: GetAttachedCdrom(datacenterId, serverId, cdromId) --- #### Detach a CD-ROM This will detach a CD-ROM from the server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | cdromId | **yes** | string | The ID of the attached CD-ROM. | Pass the arguments to `DetachCdrom`: DetachCdrom(datacenterId, serverId, cdromId) --- #### Reboot a Server This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | Pass the arguments to `RebootServer`: RebootServer(datacenterId, serverId) --- #### Start a Server This will start a server. If a DHCP assigned public IP was deallocated when the server was stopped, then a new IP will be assigned. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | Pass the arguments to `StartServer`: StartServer(datacenterId, serverId) --- #### Stop a Server This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | Pass the arguments to `StopServer`: StopServer(datacenterId, serverId) --- ### Images #### List Images Retrieve a list of images. Just call the `ListImages`: ListImages() --- #### Get an Image Retrieves the attributes of a specific image. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | imgId | **yes** | string | The ID of the image. | Pass the arguments to `GetImage`: GetImage(imgid) --- ### Volumes #### List Volumes Retrieve a list of volumes within the VDC. If you want to retrieve a list of volumes attached to a server please see the [List Attached Volumes](#list-attached-volumes) entry in the Server section for details. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | Pass the arguments to `ListVolumes`: ListVolumes(datacenterId) --- #### Get a Volume Retrieves the attributes of a given volume. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | volumeId | **yes** | string | The ID of the volume. | Pass the arguments to `GetVolume`: GetVolume(datacenterId, volumeId) --- #### Create a Volume Creates a volume within the VDC. This will NOT attach the volume to a server. Please see the [Attach a Volume](#attach-a-volume) entry in the Server section for details on how to attach storage volumes. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenter_id | **yes** | string | The ID of the VDC. | | volume | **yes** | object | A [Volume object](#volume-resource-object) you wish to create. | Build the `Volume` resource object: var request = Volume{ Properties: VolumeProperties{ Size: 2, Name: "GO SDK Test", ImageAlias: "ubuntu:latest", Bus: "VIRTIO", SshKeys: []string{"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoLVLHON4BSK3D8L4H79aFo..."}, Type: "HDD", ImagePassword: "test1234", AvailabilityZone: "ZONE_3", }, } Pass the object and arguments to `CreateVolume`: CreateVolume(dcID, request) ##### Volume Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | no | string | The name of the volume. | | Size | **yes** | int | The size of the volume in GB. | | Bus | no | string | The bus type of the volume (VIRTIO or IDE). Default: VIRTIO. | | Image | **yes** | string | The image or snapshot ID. Can be left empty for a data volume, however you'll need to set the `licence_type`. Default: *null* | | Type | **yes** | string | The volume type, HDD or SSD. Default: HDD| | LicenceType | **yes** | string | The licence type of the volume. Options: LINUX, WINDOWS, WINDOWS2016, UNKNOWN, OTHER. Default: UNKNOWN | | ImagePassword | **yes** | string | A password to set on the volume for the appropriate root or administrative account. This field may only be set in creation requests. When reading, it always returns *null*. The password has to contain 8-50 characters. Only these characters are allowed: [abcdefghjkmnpqrstuvxABCDEFGHJKLMNPQRSTUVX23456789] | | ImageAlias | **yes** | string | An alias to a ProfitBricks public image. Use instead of "image".] | | SshKeys | **yes** | string | SSH keys to allow access to the volume via SSH. | | AvailabilityZone | no | string | The storage availability zone assigned to the volume. Valid values: AUTO, ZONE_1, ZONE_2, or ZONE_3. This only applies to HDD volumes. Leave blank or set to AUTO when provisioning SSD volumes. | The following table outlines the various licence types you can define: | Licence Type | Comment | |---|---| | WINDOWS2016 | Use this for the Microsoft Windows Server 2016 operating system. | | WINDOWS | Use this for the Microsoft Windows Server 2008 and 2012 operating systems. | | LINUX |Use this for Linux distributions such as CentOS, Ubuntu, Debian, etc. | | OTHER | Use this for any volumes that do not match one of the other licence types. | | UNKNOWN | This value may be inherited when you've uploaded an image and haven't set the license type. Use one of the options above instead. | The following table outlines the storage availability zones currently supported: | Availability Zone | Comment | |---|---| | AUTO | Automatically Selected Zone | | ZONE_1 | Fire Zone 1 | | ZONE_2 | Fire Zone 2 | | ZONE_3 | Fire Zone 3 | **Note:** You will need to provide either the `Image` or the `LicenceType` arguments when creating a volume. A `LicenceType` is required, but if `Image` is supplied, it is already set and cannot be changed. Either the `ImagePassword` or `SshKeys` arguments need to be supplied when creating a volume using one of the official ProfitBricks images. Only official ProfitBricks provided images support the `SshKeys` and `ImagePassword` arguments. --- #### Update a Volume You can update various attributes of an existing volume; however, some restrictions are in place: You can increase the size of an existing storage volume. You cannot reduce the size of an existing storage volume. The volume size will be increased without requiring a reboot if the relevant hot plug settings (`disc_virtio_hot_plug`, `disc_virtio_hot_unplug`, etc.) have been set to *true*. The additional capacity is not added automatically added to any partition, therefore you will need to handle that inside the OS afterwards. Once you have increased the volume size you cannot decrease the volume size. Since an existing volume is being modified, none of the request arguments are specifically required as long as the changes being made satisfy the requirements for creating a volume. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | volumeId | **yes** | string | The ID of the volume. | | Name | no | string | The name of the volume. | | Size | no | int | The size of the volume in GB. You may only increase the `size` when updating. | | Bus | no | string | The bus type of the volume (VIRTIO or IDE). Default: VIRTIO. | | LicenceType | no | string | The licence type of the volume. Options: LINUX, WINDOWS, WINDOWS2016, UNKNOWN, OTHER. You may get an error trying to update `LicenceType` depending on the `Image` that was used to create the volume. For example, you cannot update the `LicenceType` for a volume created from a ProfitBricks supplied OS image. | **Note**: Trying to change the `Image`, `Type`, or `AvailabilityZone` in an update request will result in an error. Pass the arguments to `PatchVolume`: var obj := VolumeProperties{ Name: "GO SDK Test - RENAME", Size: 5, } PatchVolume(datacenterId, volumeId, obj) --- #### Delete a Volume Deletes the specified volume. This will result in the volume being removed from your data center. Use this with caution. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | volumeId | **yes** | string | The ID of the volume. | Pass the arguments to `DeleteVolume`: DeleteVolume(datacenterId, volumeId) --- #### Create a Volume Snapshot Creates a snapshot of a volume within the VDC. You can use a snapshot to create a new storage volume or to restore a storage volume. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | volumeId | **yes** | string | The ID of the volume. | | Name | no | string | The name of the snapshot. | | Description | no | string | The description of the snapshot. | Pass the arguments to `CreateSnapshot`: CreateSnapshot(datacenterId, volumeId, Name,Description) --- #### Restore a Volume Snapshot This will restore a snapshot onto a volume. A snapshot is created as just another image that can be used to create new volumes or to restore an existing volume. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | volumeId | **yes** | string | The ID of the volume. | | snapshotId | **yes** | string | The ID of the snapshot. | Pass the arguments to `restore_snapshot`: RestoreSnapshot(datacenterId, volumeId, snapshotId) --- ### Snapshots #### List Snapshots Call the `ListSnapshots`: ListSnapshots() --- #### Get a Snapshot Retrieves the attributes of a specific snapshot. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | snapshotId | **yes** | string | The ID of the snapshot. | Pass the arguments to `GetSnapshot`: GetSnapshot(snapshotId) --- #### Update a Snapshot Perform updates to attributes of a snapshot. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | snapshotId | **yes** | string | The ID of the snapshot. | | Name | no | string | The name of the snapshot. | | Description | no | string | The description of the snapshot. | | LicenceType | no | string | The snapshot's licence type: LINUX, WINDOWS, WINDOWS2016, or OTHER. | | CpuHotPlug | no | bool | This volume is capable of CPU hot plug (no reboot required) | | CpuHotUnplug | no | bool | This volume is capable of CPU hot unplug (no reboot required) | | RamHotPlug | no | bool | This volume is capable of memory hot plug (no reboot required) | | RamHotUnplug | no | bool | This volume is capable of memory hot unplug (no reboot required) | | NicHotPlug | no | bool | This volume is capable of NIC hot plug (no reboot required) | | NicHotUnplug | no | bool | This volume is capable of NIC hot unplug (no reboot required) | | DiscVirtioHotPlug | no | bool | This volume is capable of VirtIO drive hot plug (no reboot required) | | DiscVirtioHotUnplug | no | bool | This volume is capable of VirtIO drive hot unplug (no reboot required) | | DiscScsiHotPlug | no | bool | This volume is capable of SCSI drive hot plug (no reboot required) | | DiscScsiHotUnplug | no | bool | This volume is capable of SCSI drive hot unplug (no reboot required) | Pass the arguments to `UpdateSnapshot`: UpdateSnapshot(snapshotId, SnapshotProperties{Name: newValue}) --- #### Delete a Snapshot Deletes the specified snapshot. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | snapshotId | **yes** | string | The ID of the snapshot. | Pass the arguments to `DeleteSnapshot`: DeleteSnapshot(snapshotId) --- ### IP Blocks The IP block operations assist with managing reserved /static public IP addresses. #### List IP Blocks Retrieve a list of available IP blocks. ListIpBlocks() --- #### Get an IP Block Retrieves the attributes of a specific IP block. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | ipblock_id | **yes** | string | The ID of the IP block. | Pass the arguments to `get_ipblock`: response = client.get_ipblock('UUID') --- #### Create an IP Block Creates an IP block. Creating an IP block is a bit different than some of the other available create operations. IP blocks are not attached to a particular VDC, but rather to a location. Therefore, you must specify a valid `location` along with a `size` argument indicating the number of IP addresses you want to reserve in the IP block. Any resources using an IP address from an IP block must be in the same `location`. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenter_id | **yes** | string | The ID of the VDC. | | ipblock | **yes** | object | An [IPBlock object](#ipblock-resource-object) you wish to create. | To create an IP block, define the `IPBlock` resource object: var ipblock = IpBlock{ Properties: IpBlockProperties{ Name: "GO SDK Test", Size: 2, Location: location, }, } Pass it to `ReserveIpBlock`: ReserveIpBlock(ipblock) ##### IPBlock Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Location | **yes** | string | This must be one of the available locations: us/las, us/ewr, de/fra, de/fkb. | | Size | **yes** | int | The size of the IP block you want. | | Name | no | string | A descriptive name for the IP block | The following table outlines the locations currently supported: | Value| Country | City | |---|---|---| | us/las | United States | Las Vegas | | us/ewr | United States | Newark | | de/fra | Germany | Frankfurt | | de/fkb | Germany | Karlsruhe | --- #### Delete an IP Block Deletes the specified IP Block. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | ipblkid | **yes** | string | The ID of the IP block. | Pass the arguments to `ReleaseIpBlock`: ReleaseIpBlock(ipblkid) --- ### LANs #### List LANs Retrieve a list of LANs within the VDC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterd | **yes** | string | The ID of the VDC. | Pass the arguments to `ListLans`: ListLans(datacenterd) --- #### Create a LAN Creates a LAN within a VDC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | lan | **yes** | object | A [LAN object](#lan-resource-object) describing the LAN to create. | Create the `LAN` resource object: var request = CreateLanRequest{ Properties: CreateLanProperties{ Public: true, Name: "GO SDK Test with failover", }, Entities: &LanEntities{ Nics: lanNics, }, } Pass the object and arguments to `create_lan`: CreateLan(datacenterId, request) ##### LAN Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | no | string | The name of your LAN. | | Public | **Yes** | bool | Boolean indicating if the LAN faces the public Internet or not. | | Nics | no | list | One or more NIC IDs attached to the LAN. | --- #### Get a LAN Retrieves the attributes of a given LAN. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | lanId | **yes** | int | The ID of the LAN. | Pass the arguments to `GetLan`: GetLan(datacenterId, lanId) --- #### Update a LAN Perform updates to attributes of a LAN. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | lanId | **yes** | int | The ID of the LAN. | | Name | no | string | A descriptive name for the LAN. | | Public | no | bool | Boolean indicating if the LAN faces the public Internet or not. | | IpFailover | no | array | A list of IP fail-over dicts. | Pass the arguments to `update_lan`: var obj = LanProperties{ Properties: LanProperties{ Public: true, Name: "GO SDK Test with failover", } PatchLan(datacenterId, lanId, obj) --- #### Delete a LAN Deletes the specified LAN. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | lanId | **yes** | string | The ID of the LAN. | Pass the arguments to `delete_lan`: DeleteLan(lan_dcid, lanid) --- ### Network Interfaces (NICs) #### List NICs Retrieve a list of LANs within the VDC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | Pass the arguments to `ListNics`: ListNics(datacenterId, serverId) --- #### Get a NIC Retrieves the attributes of a given NIC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | nicId | **yes** | string | The ID of the NIC. | Pass the arguments to `GetNic`: GetNic(datacenterId, serverId, nicId) --- #### Create a NIC Adds a NIC to the target server. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string| The ID of the server. | | nic | **yes** | object | A [NIC object](#nic-resource-object) describing the NIC to be created. | Create the `NIC` resource object: var nic = Nic{ Properties: &NicProperties{ Lan: 1, Name: "GO SDK Test", Nat: false, Dhcp: true, FirewallActive: true, Ips: []string{"10.0.0.1"}, }, } Pass the object and arguments to `create_nic`: CreateNic(datacenterId, serverId, nic) ##### NIC Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | no | string | The name of the NIC. | | Ips | no | list | IP addresses assigned to the NIC. | | Dhcp | no | bool | Set to *false* if you wish to disable DHCP on the NIC. Default: *true*. | | Lan | **yes** | int | The LAN ID the NIC will sit on. If the LAN ID does not exist it will be created. | | Nat | no | bool | Indicates the private IP address has outbound access to the public internet. | | FirewallActive | no | bool | Set this to *true* to enable the ProfitBricks firewall, *false* to disable. | | Firewallrules | no | list | A list of [FirewallRule objects](#firewall-rule-resource-object) to be created with the NIC. | --- #### Update a NIC You can update -- in full or partially -- various attributes on the NIC; however, some restrictions are in place: The primary address of a NIC connected to a load balancer can only be changed by changing the IP of the load balancer. You can also add additional reserved, public IPs to the NIC. The user can specify and assign private IPs manually. Valid IP addresses for private networks are 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string| The ID of the server. | | nicId | **yes** | string| The ID of the NIC. | | Name | no | string | The name of the NIC. | | Ips | no | list | IPs assigned to the NIC represented as a list of strings. | | Dhcp | no | bool | Boolean value that indicates if the NIC is using DHCP or not. | | Lan | no | int | The LAN ID the NIC sits on. | | Nat | no | bool | Indicates the private IP address has outbound access to the public internet. | | FirewallActive | no | bool | Set this to *true* to enable the ProfitBricks firewall, *false* to disable. | Pass the arguments to `update_nic`: var obj = NicProperties{Name: "GO SDK Test - RENAME", Lan: 1} PatchNic(nic_dcid, nic_srvid, nicid, obj) --- #### Delete a NIC Deletes the specified NIC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string| The ID of the server. | | nicId | **yes** | string| The ID of the NIC. | Pass the arguments to `DeleteNic`: DeleteNic(nic_dcid, nic_srvid, nicid) --- ### Firewall Rules #### List Firewall Rules Retrieves a list of firewall rules associated with a particular NIC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | nicId | **yes** | string | The ID of the NIC. | Pass the arguments to `ListFirewallRules`: ListFirewallRules(datacenterId, serverId, nicId) --- #### Get a Firewall Rule Retrieves the attributes of a given firewall rule. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | nicId | **yes** | string | The ID of the NIC. | | firewallRuleId | **yes** | string | The ID of the firewall rule. | Pass the arguments to `get_firewall_rule`: GetFirewallRule(datacenterId, serverId, nicId, firewallRuleId) --- #### Create a Firewall Rule This will add a firewall rule to the NIC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | nicId | **yes** | string | The ID of the NIC. | | firewallRule | **yes** | object | A [FirewallRule object](#firewall-rule-resource-object) describing the firewall rule to be created. | Create the `FirewallRule` resource object: var firewallRule FirewallRule{ Properties: FirewallruleProperties{ Name: "SSH", Protocol: "TCP", SourceMac: "01:23:45:67:89:00", PortRangeStart: 22, PortRangeEnd: 22, }, } Pass the object and arguments to `create_firewall_rule`: CreateFirewallRule(datacenterId, serverId, nicId, firewallRule) ##### Firewall Rule Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | no | string | The name of the firewall rule. | | Protocol | **yes** | string | The protocol for the rule: TCP, UDP, ICMP, ANY. | | SourceMac | no | string | Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. A *nil* value allows all source MAC address. | | SourceIp | no | string | Only traffic originating from the respective IPv4 address is allowed. A *nil* value allows all source IPs. | | TargetIp | no | string | In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. A *nil* value allows all target IPs. | | PortRangeStart | no | string | Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave `PortRangeStart` and `PortRangeEnd` value as *nil* to allow all ports. | | PortRangeEnd | no | string | Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave `PortRangeStart` and `PortRangeEnd` value as *nil* to allow all ports. | | IcmpType | no | string | Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen. A *nil* value allows all types. | | IcmpCode | no | string | Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. A *nil* value allows all codes. | --- #### Update a Firewall Rule Perform updates to an existing firewall rule. You will notice that some arguments, such as `protocol` cannot be updated. If the `protocol` needs to be changed, you can [delete](#delete-a-firewall-rule) the firewall rule and then [create](#create-a-firewall-rule) new one to replace it. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | nicId | **yes** | string | The ID of the NIC. | | firewallRuleId | **yes** | string | The ID of the firewall rule. | | Name | no | string | The name of the firewall rule. | | SourceMac | no | string | Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. A *nil* value allows all source MAC address. | | SourceIp | no | string | Only traffic originating from the respective IPv4 address is allowed. A *nil* value allows all source IPs. | | TargetIp | no | string | In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. A *nil* value allows all target IPs. | | PortRangeStart | no | string | Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave `PortRangeStart` and `PortRangeEnd` value as *nil* to allow all ports. | | PortRangeEnd | no | string | Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave `PortRangeStart` and `PortRangeEnd` value as *nil* to allow all ports. | | IcmpType | no | string | Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen. A *nil* value allows all types. | | IcmpCode | no | string | Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. A *nil* value allows all codes. | Pass the arguments to `PatchFirewallRule`: props := FirewallruleProperties{ Name: "SSH - RENAME", } PatchFirewallRule(dcID, srv_srvid, nicid, fwId, props) --- #### Delete a Firewall Rule Removes a firewall rule. | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | serverId | **yes** | string | The ID of the server. | | nicId | **yes** | string | The ID of the NIC. | | firewallRuleId | **yes** | string | The ID of the firewall rule. | Pass the arguments to `DeleteFirewallRule`: DeleteFirewallRule(dcID, srv_srvid, nicid, fwId) --- ### Load Balancers #### List Load Balancers Retrieve a list of load balancers within the data center. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | Pass the arguments to `ListLoadbalancers`: ListLoadbalancers(datacenterId) --- #### Get a Load Balancer Retrieves the attributes of a given load balancer. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancerId | **yes** | string | The ID of the load balancer. | Pass the arguments to `GetLoadbalancer`: GetLoadbalancer(datacenterId, loadbalancerId) --- #### Create a Load Balancer Creates a load balancer within the VDC. Load balancers can be used for public or private IP traffic. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancer | **yes** | object | A [LoadBalancer object](#load-balancer-resource-object) describing the load balancer to be created. | Create the `LoadBalancer` resource object: var loadbalancer = Loadbalancer{ Properties: LoadbalancerProperties{ Name: "GO SDK Test", Ip: "10.0.0.1", Dhcp: true, } } Pass the object and arguments to `CreateLoadbalancer`: CreateLoadbalancer(datacenterId, loadbalancer) ##### Load Balancer Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | **yes** | string | The name of the load balancer. | | Ip | no | string | IPv4 address of the load balancer. All attached NICs will inherit this IP. | | Dhcp | no | bool | Indicates if the load balancer will reserve an IP using DHCP. | | Balancednics | no | list | List of NIC IDs taking part in load-balancing. All balanced NICs inherit the IP of the load balancer. | --- #### Update a Load Balancer Perform updates to attributes of a load balancer. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancerId | **yes** | string | The ID of the load balancer. | | Name | no | string | The name of the load balancer. | | Ip | no | string | The IP of the load balancer. | | Dhcp | no | bool | Indicates if the load balancer will reserve an IP using DHCP. | Pass the arguments to `PatchLoadbalancer`: var obj = LoadbalancerProperties{Name: "GO SDK Test - RENAME"} PatchLoadbalancer(datacenterId, loadbalancerId, obj) --- #### Delete a Load Balancer Deletes the specified load balancer. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancerId | **yes** | string | The ID of the load balancer. | Pass the arguments to `DeleteLoadbalancer`: DeleteLoadbalancer(datacenterId, loadbalancerId) --- #### List Load Balanced NICs This will retrieve a list of NICs associated with the load balancer. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancerId | **yes** | string | The ID of the load balancer. | Pass the arguments to `ListBalancedNics`: ListBalancedNics(datacenterId, loadbalancerId) --- #### Get a Load Balanced NIC Retrieves the attributes of a given load balanced NIC. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancerId | **yes** | string | The ID of the load balancer. | | nicId | **yes** | string | The ID of the NIC. | Pass the arguments to `GetBalancedNic`: GetBalancedNic(datacenterId, loadbalancerId, nicId) --- #### Associate NIC to a Load Balancer This will associate a NIC to a load balancer, enabling the NIC to participate in load-balancing. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancerId | **yes** | string | The ID of the load balancer. | | nicId | **yes** | string | The ID of the NIC. | Pass the arguments to `add_loadbalanced_nics`: AssociateNic(datacenterId, loadbalancerId, nicId) --- #### Remove a NIC Association Removes the association of a NIC with a load balancer. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | datacenterId | **yes** | string | The ID of the VDC. | | loadbalancerId | **yes** | string | The ID of the load balancer. | | nicId | **yes** | string | The ID of the NIC you are removing from the load balancer. | Pass the arguments to `DeleteBalancedNic`: DeleteBalancedNic(datacenterId, loadbalancerId, nicId) --- ### Requests Each call to the ProfitBricks Cloud API is assigned a request ID. These operations can be used to get information about the requests that have been submitted and their current status. #### List Requests ListRequests() --- #### Get a Request Retrieves the attributes of a specific request. This operation shares the same `get_request` method used for getting request status, however the response it determined by the boolean value you pass for *status*. To get details about the request itself, you want to pass a *status* of *False*. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | request_id | **yes** | string | The ID of the request. | | status | **yes** | bool | Set to *False* to have the request details returned. | Pass the arguments to `get_request`: response = client.get_request( request_id='UUID', status=False) --- #### Get a Request Status Retrieves the status of a request. This operation shares the same `get_request` method used for getting the details of a request, however the response it determined by the boolean value you pass for *status*. To get the request status, you want to pass a *status* of *True*. The following table describes the request arguments: | Name | Required | Type | Description | |---|:-:|---|---| | path | **yes** | string | The ID of the request. Retrieved from response header location | Pass the arguments to `get_request`: GetRequestStatus(path) --- ### Contract Resources #### List Contract Resources Returns information about the resource limits for a particular contract and the current resource usage. ``` GetContractResources() ``` --- ### Users Management These operations are designed to allow you to orchestrate users and resources via the Cloud API. Previously this functionality required use of the DCD (Data Center Designer) web application. #### List Groups This retrieves a full list of all groups. ``` ListGroups() ``` #### Retrieve a Group The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | groupId | Yes | string | The ID of the specific group to retrieve. | ``` GetGroup(groupid) ``` #### Create a Group The following table describes the request arguments: | Name | Type | Description | Required | |---|---|---|---| | group | Group |See [Group Object](#group-resource-object) | Yes | Build the `Group` resource object: var group = Group{ Properties: GroupProperties{ Name: "GO SDK Test", CreateDataCenter: &TRUE, CreateSnapshot: &TRUE, ReserveIp: &TRUE, AccessActivityLog: &TRUE, }, } Pass the object to `CreateGroup`: ``` CreateGroup(group Group) ``` ##### Group Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Name | **yes** | string | A name that was given to the group. | | CreateDataCenter | no | bool | The group has permission to create virtual data centers. | | CreateSnapshot | no | bool | The group has permission to create snapshots. | | ReserveIp | no | bool | The group has permission to reserve IP addresses. | | AccessActivityLog | no | bool | The group has permission to access the activity log. | #### Update a Group Use this operation to update a group. The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | groupId | **yes** | string | The ID of the specific group to retrieve. | | group | Group |See [Group Object](#group-resource-object) | Yes | ``` UpdateGroup(groupId, group Group) ``` --- #### Delete a Group This will remove all objects within the data center and remove the data center object itself. Use this operation to delete a single group. Resources that are assigned to the group are NOT deleted, but are no longer accessible to the group members unless the member is a Contract Owner, Admin, or Resource Owner. The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | groupId | **yes** | string | The ID of the specific group to retrieve. | ``` DeleteGroup(groupId) ``` --- #### List Shares Retrieves a full list of all the resources that are shared through this group and lists the permissions granted to the group members for each shared resource. ``` ListShares() ``` #### Retrieve a Share The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | groupid | **yes** | string | The ID of the specific group to retrieve. | | resourceId | **yes** | string | The ID of the specific resource to retrieve. | ``` GetShare(groupid, resourceId) ``` --- #### Add a Share The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | groupid | **yes** | string | The ID of the specific group to add a resource too. | | resourceId | **yes** | string | The ID of the specific resource to add. | | share | **yes** | Share | See [Share Object](#share-resource-object) | Build the `Share` resource object: var share = Share{ Properties: ShareProperties{ SharePrivilege: true, EditPrivilege: true, }, } Pass the object to `AddShare`: ``` AddShare(share Share, groupid, resourceId) ``` ##### Share Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | EditPrivilege | no | bool | The group has permission to edit privileges on this resource. | | SharePrivilege | no | bool | The group has permission to share this resource. | --- #### Update a Share Use this to update the permissions that a group has for a specific resource share. The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | groupid | **yes** | string | The ID of the specific group to add a resource too. | | resourceId | **yes** | string | The ID of the specific resource to add. | | share | **yes** | Share | See [Share Object](#share-resource-object) | ``` UpdateShare(groupid, resourceId, obj) ``` #### Delete a Share This will remove all objects within the data center and remove the data center object itself. Use this operation to delete a single group. Resources that are assigned to the group are NOT deleted, but are no longer accessible to the group members unless the member is a Contract Owner, Admin, or Resource Owner. The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | groupid | **yes** | string | The ID of the specific group containing the resource to delete. | | resourceId | **yes** | string | The ID of the specific resource to delete. | ``` DeleteShare(groupid, resourceId) ``` --- #### List Users in a Group Retrieves a full list of all the users that are members of a particular group. The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | groupid | **yes** | string | The ID of the specific group to retrieve a user list for. | ``` ListGroupUsers(groupid) ``` --- #### Add User to Group The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | groupid | **yes** | string | The ID of the specific group you want to add a user to. | | userid | **yes** | string | The ID of the specific user to add to the group. | ``` AddUserToGroup(groupid, userid) ``` --- #### Remove User from a Group Use this operation to remove a user from a group. The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | groupid | **yes** | string | The ID of the specific group you want to remove a user from. | | userid | **yes** | string | The ID of the specific user to remove from the group. | ``` DeleteUserFromGroup(groupid, userid) ``` --- #### List Users Retrieve a list of all the users that have been created under a contract. ``` ListUsers() ``` --- #### Retrieve a User Retrieve details about a specific user including what groups and resources the user is associated with. The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | userid | **yes** | string | The ID of the specific user to retrieve information about. | ``` GetUser(userid) ``` --- #### Create a User Creates a new user under a particular contract. The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | user | **yes** | User | See [User Object](#user-resource-object) | Build the `User` resource object: var user = User{ Properties: &UserProperties{ Firstname: "John", Lastname: "Doe", Email: email, Password: "abc123-321CBA", Administrator: false, ForceSecAuth: false, SecAuthActive: false, }, } Pass the object to `CreateUser`: ``` CreateUser(user User) ``` ##### User Resource Object | Name | Required | Type | Description | |---|:-:|---|---| | Firstname | **yes** | bool | The first name of the user. | | Lastname | **yes** | bool | The last name of the user. | | Email | **yes** | bool | The e-mail address of the user. | | Password | **yes** | bool | A password for the user. | | Administrator | no | bool | Indicates if the user has administrative rights. | | ForceSecAuth | no | bool | Indicates if secure (two-factor) authentication was enabled for the user. | | SecAuthActive | no | bool | Indicates if secure (two-factor) authentication is enabled for the user. | --- #### Update a User Update details about a specific user including their privileges. The following table describes the request arguments: | Name | Required | Type | Description | |---|---|---|---| | userid | **Yes** | string | The ID of the specific user to update. | ``` user := UserProperties{ Firstname: "go sdk ", Lastname: newName, Email: "test@go.com", Password: "abc123-321CBA", Administrator: false, ForceSecAuth: false, SecAuthActive: false, } UpdateUser(userid, user) ``` --- #### Delete a User Blacklists the user, disabling them. The user is not completely purged, therefore if you anticipate needing to create a user with the same name in the future, we suggest renaming the user before you delete it. The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | userid | **Yes** | string | The ID of the specific user to update. | ``` DeleteUser(userid) ``` --- #### List Resources Retrieves a list of all resources and optionally their group associations. *Note*: This API call can take a significant amount of time to return when there are a large number of provisioned resources. You may wish to consult the next section on how to list resources of a particular type. ``` ListResources() ``` --- #### List All Resources of a Type Lists all shareable resources of a specific type. Optionally include their association with groups, permissions that a group has for the resource, and users that are members of the group. Because you are scoping your request to a specific resource type, this API will likely return faster than querying `/um/resources`. The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | resourcetype | **Yes** | string | The specific type of resources to retrieve information about. | The values available for resourcetype are listed in this table: | Resource Type | Description | |---|---| | datacenter | A virtual data center. | | image | A private image that has been uploaded to ProfitBricks. | | snapshot | A snapshot of a storage volume. | | ipblock | An IP block that has been reserved. | ``` ListResourcesByType(resourcetype) ``` --- #### List a specific Resource Type The following table describes the request arguments: | Name | Type | Description | Required | | --- | --- | --- | --- | | resourcetype | **Yes** | string | The specific type of resources to retrieve information about. | | resourceId | **Yes** | string | The ID of the specific resource to retrieve information about. | The values available for resourcetype are listed in this table: | Resource Type | Description | |---|---| | datacenter | A virtual data center. | | image | A private image that has been uploaded to ProfitBricks. | | snapshot | A snapshot of a storage volume. | | ipblock | An IP block that has been reserved. | ``` GetResourceByType(resourcetype, resourceId) ``` --- ## Example ```go package main import ( "fmt" "time" "github.com/profitbricks/profitbricks-sdk-go" ) func main() { //Sets username and password profitbricks.SetAuth("username", "password") //Sets depth. profitbricks.SetDepth("5") dcrequest := profitbricks.Datacenter{ Properties: profitbricks.DatacenterProperties{ Name: "example.go3", Description: "description", Location: "us/lasdev", }, } datacenter := profitbricks.CreateDatacenter(dcrequest) serverrequest := profitbricks.Server{ Properties: profitbricks.ServerProperties{ Name: "go01", Ram: 1024, Cores: 2, }, } server := profitbricks.CreateServer(datacenter.Id, serverrequest) volumerequest := profitbricks.Volume{ Properties: profitbricks.VolumeProperties{ Size: 1, Name: "Volume Test", LicenceType: "LINUX", Type: "HDD", }, } storage := profitbricks.CreateVolume(datacenter.Id, volumerequest) serverupdaterequest := profitbricks.ServerProperties{ Name: "go01renamed", Cores: 1, Ram: 256, } profitbricks.PatchServer(datacenter.Id, server.Id, serverupdaterequest) //It takes a moment for a volume to be provisioned so we wait. time.Sleep(60 * time.Second) profitbricks.AttachVolume(datacenter.Id, server.Id, storage.Id) volumes := profitbricks.ListVolumes(datacenter.Id) fmt.Println(volumes.Items) servers := profitbricks.ListServers(datacenter.Id) fmt.Println(servers.Items) datacenters := profitbricks.ListDatacenters() fmt.Println(datacenters.Items) profitbricks.DeleteServer(datacenter.Id, server.Id) profitbricks.DeleteDatacenter(datacenter.Id) } ``` # Support You are welcome to contact us with questions or comments at [ProfitBricks DevOps Central](https://devops.profitbricks.com/). Please report any issues via [GitHub's issue tracker](https://github.com/profitbricks/profitbricks-sdk-go/issues). ## Testing You can run all test by using the command `go test -timeout=120m` or run a single test by specifying the name of the test file `go test servers_test.go` ## Contributing 1. Fork it ( https://github.com/profitbricks/profitbricks-sdk-go/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request �����������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/config.go�����������������������0000664�0000000�0000000�00000001214�13771713062�0027175�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks // Endpoint is the base url for REST requests. var Endpoint = "https://api.profitbricks.com/cloudapi/v4" // Username for authentication . var Username string // Password for authentication . var Passwd string // SetEndpoint is used to set the REST Endpoint. Endpoint is declared in config.go func SetEndpoint(newendpoint string) string { if newendpoint != "" { Endpoint = newendpoint } return Endpoint } // SetAuth is used to set Username and Passwd. Username and Passwd are declared in config.go func SetAuth(u, p string) { Username = u Passwd = p } func SetUserAgent(userAgent string) { AgentHeader = userAgent } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/contractresources.go������������0000664�0000000�0000000�00000004575�13771713062�0031515�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "encoding/json" "net/http" "strconv" ) type ContractResources struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Properties ContractResourcesProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type ContractResourcesProperties struct { PBContractNumber string `json:"PB-Contract-Number,omitempty"` Owner string `json:"owner,omitempty"` Status string `json:"status,omitempty"` ResourceLimits *ResourcesLimits `json:"resourceLimits,omitempty"` } type ResourcesLimits struct { CoresPerServer int32 `json:"coresPerServer,omitempty"` CoresPerContract int32 `json:"coresPerContract,omitempty"` CoresProvisioned int32 `json:"coresProvisioned,omitempty"` RamPerServer int32 `json:"ramPerServer,omitempty"` RamPerContract int32 `json:"ramPerContract,omitempty"` RamProvisioned int32 `json:"ramProvisioned,omitempty"` HddLimitPerVolume int64 `json:"hddLimitPerVolume,omitempty"` HddLimitPerContract int64 `json:"hddLimitPerContract,omitempty"` HddVolumeProvisioned int64 `json:"hddVolumeProvisioned,omitempty"` SsdLimitPerVolume int64 `json:"ssdLimitPerVolume,omitempty"` SsdLimitPerContract int64 `json:"ssdLimitPerContract,omitempty"` SsdVolumeProvisioned int64 `json:"ssdVolumeProvisioned,omitempty"` ReservableIps int32 `json:"reservableIps,omitempty"` ReservedIpsOnContract int32 `json:"reservedIpsOnContract,omitempty"` ReservedIpsInUse int32 `json:"reservedIpsInUse,omitempty"` } func GetContractResources() ContractResources { path := contract_resource_path() url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toContractResources(resp) } func toContractResources(resp Resp) ContractResources { var col ContractResources json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �����������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/datacenter.go�������������������0000664�0000000�0000000�00000007247�13771713062�0030056�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" "time" ) type Datacenter struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties DatacenterProperties `json:"properties,omitempty"` Entities DatacenterEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Metadata struct { CreatedDate time.Time `json:"createdDate,omitempty"` CreatedBy string `json:"createdBy,omitempty"` Etag string `json:"etag,omitempty"` LastModifiedDate time.Time `json:"lastModifiedDate,omitempty"` LastModifiedBy string `json:"lastModifiedBy,omitempty"` State string `json:"state,omitempty"` } type DatacenterProperties struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Location string `json:"location,omitempty"` Version int32 `json:"version,omitempty"` } type DatacenterEntities struct { Servers *Servers `json:"servers,omitempty"` Volumes *Volumes `json:"volumes,omitempty"` Loadbalancers *Loadbalancers `json:"loadbalancers,omitempty"` Lans *Lans `json:"lans,omitempty"` } type Datacenters struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Datacenter `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } func ListDatacenters() Datacenters { path := dc_col_path() url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toDataCenters(resp) } func CreateDatacenter(dc Datacenter) Datacenter { obj, _ := json.Marshal(dc) path := dc_col_path() url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toDataCenter(do(req)) } func CompositeCreateDatacenter(datacenter Datacenter) Datacenter { obj, _ := json.Marshal(datacenter) path := dc_col_path() url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toDataCenter(do(req)) } func GetDatacenter(dcid string) Datacenter { path := dc_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toDataCenter(do(req)) } func PatchDatacenter(dcid string, obj DatacenterProperties) Datacenter { jason_patch := []byte(MkJson(obj)) path := dc_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jason_patch)) req.Header.Add("Content-Type", PatchHeader) return toDataCenter(do(req)) } func DeleteDatacenter(dcid string) Resp { path := dc_path(dcid) return is_delete(path) } func toDataCenter(resp Resp) Datacenter { var dc Datacenter json.Unmarshal(resp.Body, &dc) dc.Response = string(resp.Body) dc.Headers = &resp.Headers dc.StatusCode = resp.StatusCode return dc } func toDataCenters(resp Resp) Datacenters { var col Datacenters json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/doc.go��������������������������0000664�0000000�0000000�00000000166�13771713062�0026502�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Package profitbricks is a client library for interacting with Profitbricks RESTful APIs. */ package profitbricks ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/firewallrule.go�����������������0000664�0000000�0000000�00000006601�13771713062�0030432�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" ) type FirewallRule struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties FirewallruleProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type FirewallruleProperties struct { Name string `json:"name,omitempty"` Protocol string `json:"protocol,omitempty"` SourceMac *string `json:"sourceMac,omitempty"` SourceIp *string `json:"sourceIp,omitempty"` TargetIp *string `json:"targetIp,omitempty"` IcmpCode *int `json:"icmpCode,omitempty"` IcmpType *int `json:"icmpType,omitempty"` PortRangeStart *int `json:"portRangeStart,omitempty"` PortRangeEnd *int `json:"portRangeEnd,omitempty"` } type FirewallRules struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []FirewallRule `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } func ListFirewallRules(dcId string, serverid string, nicId string) FirewallRules { path := fwrule_col_path(dcId, serverid, nicId) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toFirewallRules(resp) } func GetFirewallRule(dcid string, srvid string, nicId string, fwId string) FirewallRule { path := fwrule_path(dcid, srvid, nicId, fwId) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toFirewallRule(resp) } func CreateFirewallRule(dcid string, srvid string, nicId string, fw FirewallRule) FirewallRule { path := fwrule_col_path(dcid, srvid, nicId) url := mk_url(path) + `?depth=` + Depth obj, _ := json.Marshal(fw) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toFirewallRule(do(req)) } func PatchFirewallRule(dcid string, srvid string, nicId string, fwId string, obj FirewallruleProperties) FirewallRule { jason_patch := []byte(MkJson(obj)) path := fwrule_path(dcid, srvid, nicId, fwId) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jason_patch)) req.Header.Add("Content-Type", PatchHeader) return toFirewallRule(do(req)) } func DeleteFirewallRule(dcid string, srvid string, nicId string, fwId string) Resp { path := fwrule_path(dcid, srvid, nicId, fwId) return is_delete(path) } func toFirewallRule(resp Resp) FirewallRule { var dc FirewallRule json.Unmarshal(resp.Body, &dc) dc.Response = string(resp.Body) dc.Headers = &resp.Headers dc.StatusCode = resp.StatusCode return dc } func toFirewallRules(resp Resp) FirewallRules { var col FirewallRules json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/image.go������������������������0000664�0000000�0000000�00000006744�13771713062�0027027�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "encoding/json" "net/http" ) type Image struct { Id string `json:"id,omitempty"` Type string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties ImageProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type ImageProperties struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Location string `json:"location,omitempty"` Size int `json:"size,omitempty"` CpuHotPlug bool `json:"cpuHotPlug,omitempty"` CpuHotUnplug bool `json:"cpuHotUnplug,omitempty"` RamHotPlug bool `json:"ramHotPlug,omitempty"` RamHotUnplug bool `json:"ramHotUnplug,omitempty"` NicHotPlug bool `json:"nicHotPlug,omitempty"` NicHotUnplug bool `json:"nicHotUnplug,omitempty"` DiscVirtioHotPlug bool `json:"discVirtioHotPlug,omitempty"` DiscVirtioHotUnplug bool `json:"discVirtioHotUnplug,omitempty"` DiscScsiHotPlug bool `json:"discScsiHotPlug,omitempty"` DiscScsiHotUnplug bool `json:"discScsiHotUnplug,omitempty"` LicenceType string `json:"licenceType,omitempty"` ImageType string `json:"imageType,omitempty"` Public bool `json:"public,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Images struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Image `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Cdroms struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Image `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } // ListImages returns an Collection struct func ListImages() Images { path := image_col_path() url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toImages(resp) } // GetImage returns an Instance struct where id ==imageid func GetImage(imageid string) Image { path := image_path(imageid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toImage(resp) } func toImage(resp Resp) Image { var image Image json.Unmarshal(resp.Body, &image) image.Response = string(resp.Body) image.Headers = &resp.Headers image.StatusCode = resp.StatusCode return image } func toImages(resp Resp) Images { var col Images json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } ����������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/ipblock.go����������������������0000664�0000000�0000000�00000004505�13771713062�0027361�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" ) type IpBlock struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties IpBlockProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type IpBlockProperties struct { Name string `json:"name,omitempty"` Ips []string `json:"ips,omitempty"` Location string `json:"location,omitempty"` Size int `json:"size,omitempty"` } type IpBlocks struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []IpBlock `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } // ListIpBlocks func ListIpBlocks() IpBlocks { path := ipblock_col_path() url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toIpBlocks(do(req)) } func ReserveIpBlock(request IpBlock) IpBlock { obj, _ := json.Marshal(request) path := ipblock_col_path() url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toIpBlock(do(req)) } func GetIpBlock(ipblockid string) IpBlock { path := ipblock_path(ipblockid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toIpBlock(do(req)) } func ReleaseIpBlock(ipblockid string) Resp { path := ipblock_path(ipblockid) return is_delete(path) } func toIpBlock(resp Resp) IpBlock { var obj IpBlock json.Unmarshal(resp.Body, &obj) obj.Response = string(resp.Body) obj.Headers = &resp.Headers obj.StatusCode = resp.StatusCode return obj } func toIpBlocks(resp Resp) IpBlocks { var col IpBlocks json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/lan.go��������������������������0000664�0000000�0000000�00000007637�13771713062�0026521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" ) type CreateLanRequest struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties CreateLanProperties `json:"properties,omitempty"` Entities *LanEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type CreateLanProperties struct { Name string `json:"name,omitempty"` Public bool `json:"public,omitempty"` } type Lan struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties LanProperties `json:"properties,omitempty"` Entities *LanEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type LanProperties struct { Name string `json:"name,omitempty"` Public bool `json:"public,omitempty"` IpFailover []IpFailover `json:"ipFailover"` } type LanEntities struct { Nics *LanNics `json:"nics,omitempty"` } type IpFailover struct { NicUuid string `json:"nicUuid,omitempty"` Ip string `json:"ip,omitempty"` } type LanNics struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Nic `json:"items,omitempty"` } type Lans struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Lan `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } // ListLan returns a Collection for lans in the Datacenter func ListLans(dcid string) Lans { path := lan_col_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toLans(do(req)) } // CreateLan creates a lan in the datacenter // from a jason []byte and returns a Instance struct func CreateLan(dcid string, request CreateLanRequest) Lan { obj, _ := json.Marshal(request) path := lan_col_path(dcid) url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toLan(do(req)) } // GetLan pulls data for the lan where id = lanid returns an Instance struct func GetLan(dcid, lanid string) Lan { path := lan_path(dcid, lanid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toLan(do(req)) } // PatchLan does a partial update to a lan using json from []byte jason // returns a Instance struct func PatchLan(dcid string, lanid string, obj LanProperties) Lan { jason := []byte(MkJson(obj)) path := lan_path(dcid, lanid) url := mk_url(path) req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jason)) req.Header.Add("Content-Type", PatchHeader) return toLan(do(req)) } // DeleteLan deletes a lan where id == lanid func DeleteLan(dcid, lanid string) Resp { path := lan_path(dcid, lanid) return is_delete(path) } func toLan(resp Resp) Lan { var lan Lan json.Unmarshal(resp.Body, &lan) lan.Response = string(resp.Body) lan.Headers = &resp.Headers lan.StatusCode = resp.StatusCode return lan } func toLans(resp Resp) Lans { var col Lans json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/loadbalancer.go�����������������0000664�0000000�0000000�00000010603�13771713062�0030341�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" ) type Loadbalancer struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties LoadbalancerProperties `json:"properties,omitempty"` Entities LoadbalancerEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type LoadbalancerProperties struct { Name string `json:"name,omitempty"` Ip string `json:"ip,omitempty"` Dhcp bool `json:"dhcp,omitempty"` } type LoadbalancerEntities struct { Balancednics *BalancedNics `json:"balancednics,omitempty"` } type BalancedNics struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Nic `json:"items,omitempty"` } type Loadbalancers struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Loadbalancer `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type LoablanacerCreateRequest struct { LoadbalancerProperties `json:"properties"` } // Listloadbalancers returns a Collection struct // for loadbalancers in the Datacenter func ListLoadbalancers(dcid string) Loadbalancers { path := lbal_col_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toLoadbalancers(do(req)) } // Createloadbalancer creates a loadbalancer in the datacenter //from a jason []byte and returns a Instance struct func CreateLoadbalancer(dcid string, request Loadbalancer) Loadbalancer { obj, _ := json.Marshal(request) path := lbal_col_path(dcid) url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toLoadbalancer(do(req)) } // GetLoadbalancer pulls data for the Loadbalancer // where id = lbalid returns a Instance struct func GetLoadbalancer(dcid, lbalid string) Loadbalancer { path := lbal_path(dcid, lbalid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toLoadbalancer(do(req)) } func PatchLoadbalancer(dcid string, lbalid string, obj LoadbalancerProperties) Loadbalancer { jason := []byte(MkJson(obj)) path := lbal_path(dcid, lbalid) url := mk_url(path) req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jason)) req.Header.Add("Content-Type", PatchHeader) return toLoadbalancer(do(req)) } func DeleteLoadbalancer(dcid, lbalid string) Resp { path := lbal_path(dcid, lbalid) return is_delete(path) } func ListBalancedNics(dcid, lbalid string) Nics { path := balnic_col_path(dcid, lbalid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toNics(do(req)) } func AssociateNic(dcid string, lbalid string, nicid string) Nic { sm := map[string]string{"id": nicid} jason := []byte(MkJson(sm)) path := balnic_col_path(dcid, lbalid) url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jason)) req.Header.Add("Content-Type", FullHeader) return toNic(do(req)) } func GetBalancedNic(dcid, lbalid, balnicid string) Nic { path := balnic_path(dcid, lbalid, balnicid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toNic(do(req)) } func DeleteBalancedNic(dcid, lbalid, balnicid string) Resp { path := balnic_path(dcid, lbalid, balnicid) return is_delete(path) } func toLoadbalancer(resp Resp) Loadbalancer { var server Loadbalancer json.Unmarshal(resp.Body, &server) server.Response = string(resp.Body) server.Headers = &resp.Headers server.StatusCode = resp.StatusCode return server } func toLoadbalancers(resp Resp) Loadbalancers { var col Loadbalancers json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �����������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/location.go���������������������0000664�0000000�0000000�00000004455�13771713062�0027552�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "encoding/json" "net/http" ) type Location struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata Metadata `json:"metadata,omitempty"` Properties LocationProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Locations struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Location `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type LocationProperties struct { Name string `json:"name,omitempty"` Features []string `json:"features,omitempty"` ImageAliases []string `json:"imageAliases,omitempty"` } // ListLocations returns location collection data func ListLocations() Locations { url := mk_url(location_col_path()) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toLocations(do(req)) } // GetRegionalLocations returns a list of available locations in a specific region func GetRegionalLocations(regid string) Locations { url := mk_url(location_reg_path(regid)) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toLocations(do(req)) } // GetLocation returns location data func GetLocation(locid string) Location { url := mk_url(location_path(locid)) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toLocation(do(req)) } func toLocation(resp Resp) Location { var obj Location json.Unmarshal(resp.Body, &obj) obj.Response = string(resp.Body) obj.Headers = &resp.Headers obj.StatusCode = resp.StatusCode return obj } func toLocations(resp Resp) Locations { var col Locations json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/nic.go��������������������������0000664�0000000�0000000�00000006555�13771713062�0026516�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" ) type Nic struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties *NicProperties `json:"properties,omitempty"` Entities *NicEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type NicProperties struct { Name string `json:"name,omitempty"` Mac string `json:"mac,omitempty"` Ips []string `json:"ips,omitempty"` Dhcp bool `json:"dhcp"` Lan int `json:"lan,omitempty"` FirewallActive bool `json:"firewallActive,omitempty"` Nat bool `json:"nat,omitempty"` } type NicEntities struct { Firewallrules *FirewallRules `json:"firewallrules,omitempty"` } type Nics struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Nic `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type NicCreateRequest struct { NicProperties `json:"properties"` } // ListNics returns a Nics struct collection func ListNics(dcid, srvid string) Nics { path := nic_col_path(dcid, srvid) + `?depth=` + Depth url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toNics(do(req)) } // CreateNic creates a nic on a server // from a jason []byte and returns a Instance struct func CreateNic(dcid string, srvid string, nic Nic) Nic { obj, _ := json.Marshal(nic) path := nic_col_path(dcid, srvid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toNic(do(req)) } // GetNic pulls data for the nic where id = srvid returns a Instance struct func GetNic(dcid, srvid, nicid string) Nic { path := nic_path(dcid, srvid, nicid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toNic(do(req)) } // PatchNic partial update of nic properties passed in as jason []byte // Returns Instance struct func PatchNic(dcid string, srvid string, nicid string, obj NicProperties) Nic { jason := []byte(MkJson(obj)) path := nic_path(dcid, srvid, nicid) url := mk_url(path) req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jason)) req.Header.Add("Content-Type", PatchHeader) return toNic(do(req)) } // DeleteNic deletes the nic where id=nicid and returns a Resp struct func DeleteNic(dcid, srvid, nicid string) Resp { path := nic_path(dcid, srvid, nicid) return is_delete(path) } func toNic(resp Resp) Nic { var obj Nic json.Unmarshal(resp.Body, &obj) obj.Response = string(resp.Body) obj.Headers = &resp.Headers obj.StatusCode = resp.StatusCode return obj } func toNics(resp Resp) Nics { var col Nics json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } ���������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/paths.go������������������������0000664�0000000�0000000�00000015215�13771713062�0027055�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks // slash returns "/<str>" great for making url paths func slash(str string) string { return "/" + str } // dc_col_path returns the string "/datacenters" func dc_col_path() string { return slash("datacenters") } // dc_path returns the string "/datacenters/<dcid>" func dc_path(dcid string) string { return dc_col_path() + slash(dcid) } // image_col_path returns the string" /images" func image_col_path() string { return slash("images") } // image_path returns the string"/images/<imageid>" func image_path(imageid string) string { return image_col_path() + slash(imageid) } // ipblock_col_path returns the string "/ipblocks" func ipblock_col_path() string { return slash("ipblocks") } // ipblock_path returns the string "/ipblocks/<ipblockid>" func ipblock_path(ipblockid string) string { return ipblock_col_path() + slash(ipblockid) } // location_col_path returns the string "/locations" func location_col_path() string { return slash("locations") } // location_path returns the string "/locations/<locid>" func location_path(locid string) string { return location_col_path() + slash(locid) } // location_path returns the string "/locations/<regid>" func location_reg_path(regid string) string { return location_col_path() + slash(regid) } // snapshot_col_path returns the string "/snapshots" func snapshot_col_path() string { return slash("snapshots") } // lan_col_path returns the string "/datacenters/<dcid>/lans" func lan_col_path(dcid string) string { return dc_path(dcid) + slash("lans") } // lan_path returns the string "/datacenters/<dcid>/lans/<lanid>" func lan_path(dcid, lanid string) string { return lan_col_path(dcid) + slash(lanid) } // lbal_col_path returns the string "/loadbalancers" func lbal_col_path(dcid string) string { return dc_path(dcid) + slash("loadbalancers") } // lbalpath returns the string "/loadbalancers/<lbalid>" func lbal_path(dcid, lbalid string) string { return lbal_col_path(dcid) + slash(lbalid) } // server_col_path returns the string "/datacenters/<dcid>/servers" func server_col_path(dcid string) string { return dc_path(dcid) + slash("servers") } // server_path returns the string "/datacenters/<dcid>/servers/<srvid>" func server_path(dcid, srvid string) string { return server_col_path(dcid) + slash(srvid) } // server_cmd_path returns the string "/datacenters/<dcid>/servers/<srvid>/<cmd>" func server_command_path(dcid, srvid, cmd string) string { return server_path(dcid, srvid) + slash(cmd) } // volume_col_path returns the string "/volumes" func volume_col_path(dcid string) string { return dc_path(dcid) + slash("volumes") } // volume_path returns the string "/volumes/<volid>" func volume_path(dcid, volid string) string { return volume_col_path(dcid) + slash(volid) } // balnic_col_path returns the string "/loadbalancers/<lbalid>/balancednics" func balnic_col_path(dcid, lbalid string) string { return lbal_path(dcid, lbalid) + slash("balancednics") } // balnic_path returns the string "/loadbalancers/<lbalid>/balancednics<balnicid>" func balnic_path(dcid, lbalid, balnicid string) string { return balnic_col_path(dcid, lbalid) + slash(balnicid) } // server_cdrom_col_path returns the string "/datacenters/<dcid>/servers/<srvid>/cdroms" func server_cdrom_col_path(dcid, srvid string) string { return server_path(dcid, srvid) + slash("cdroms") } // server_cdrom_path returns the string "/datacenters/<dcid>/servers/<srvid>/cdroms/<cdid>" func server_cdrom_path(dcid, srvid, cdid string) string { return server_cdrom_col_path(dcid, srvid) + slash(cdid) } // server_volume_col_path returns the string "/datacenters/<dcid>/servers/<srvid>/volumes" func server_volume_col_path(dcid, srvid string) string { return server_path(dcid, srvid) + slash("volumes") } // server_volume_path returns the string "/datacenters/<dcid>/servers/<srvid>/volumes/<volid>" func server_volume_path(dcid, srvid, volid string) string { return server_volume_col_path(dcid, srvid) + slash(volid) } // nic_path returns the string "/datacenters/<dcid>/servers/<srvid>/nics" func nic_col_path(dcid, srvid string) string { return server_path(dcid, srvid) + slash("nics") } // nic_path returns the string "/datacenters/<dcid>/servers/<srvid>/nics/<nicid>" func nic_path(dcid, srvid, nicid string) string { return nic_col_path(dcid, srvid) + slash(nicid) } // fwrule_col_path returns the string "/datacenters/<dcid>/servers/<srvid>/nics/<nicid>/firewallrules" func fwrule_col_path(dcid, srvid, nicid string) string { return nic_path(dcid, srvid, nicid) + slash("firewallrules") } // fwrule_path returns the string // "/datacenters/<dcid>/servers/<srvid>/nics/<nicid>/firewallrules/<fwruleid>" func fwrule_path(dcid, srvid, nicid, fwruleid string) string { return fwrule_col_path(dcid, srvid, nicid) + slash(fwruleid) } // contract_resource_path returns the string "/contracts" func contract_resource_path() string { return slash("contracts") } func um() string { return slash("um") } // um_groups returns the string "/groups" func um_groups() string { return um() + slash("groups") } // um_group_path returns the string "/groups/groupid" func um_group_path(grpid string) string { return um_groups() + slash(grpid) } // um_group_shares returns the string "groups/{groupId}/shares" func um_group_shares(grpid string) string { return um() + slash("groups") + slash(grpid) + slash("shares") } // um_group_share_path returns the string "groups/{groupId}/shares/{resourceId}" func um_group_share_path(grpid string, resourceid string) string { return um() + slash("groups") + slash(grpid) + slash("shares") + slash(resourceid) } // um_group_users returns the string "/groups/groupid/users" func um_group_users(grpid string) string { return um() + slash("groups") + slash(grpid) + slash("users") } // um_group_users_path returns the string "/groups/groupid/users/userid" func um_group_users_path(grpid string, usrid string) string { return um() + slash("groups") + slash(grpid) + slash("users") + slash(usrid) } // um_users returns the string "/users" func um_users() string { return um() + slash("users") } // um_users returns the string "/users/usrid" func um_users_path(usrid string) string { return um() + slash("users") + slash(usrid) } // um_resources returns the string "/resources" func um_resources() string { return um() + slash("resources") } // um_resources_type returns the string "/resources/resourceType" func um_resources_type(restype string) string { return um() + slash("resources") + slash(restype) } // um_resources_type_path returns the string "resources/{resourceType}/{resourceId}" func um_resources_type_path(restype string, resourceid string) string { return um() + slash("resources") + slash(restype) + slash(resourceid) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/req.go��������������������������0000664�0000000�0000000�00000004330�13771713062�0026521�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "io/ioutil" "net/http" "strings" ) //FullHeader is the standard header to include with all http requests except is_patch and is_command const FullHeader = "application/json" var AgentHeader = "profitbricks-sdk-go/3.0.1" //PatchHeader is used with is_patch . const PatchHeader = "application/json" //CommandHeader is used with is_command const CommandHeader = "application/x-www-form-urlencoded" var Depth = "5" var Pretty = true // SetDepth is used to set Depth func SetDepth(newdepth string) string { Depth = newdepth return Depth } // SetDepth is used to set Depth func SetPretty(pretty bool) bool { Pretty = pretty return Pretty } // mk_url either: // returns the path (if it`s a full url) // or // returns Endpoint+ path . func mk_url(path string) string { if strings.HasPrefix(path, "http") { //REMOVE AFTER TESTING //FIXME @jasmin Is this still relevant? path := strings.Replace(path, "https://api.profitbricks.com/cloudapi/v3", Endpoint, 1) // END REMOVE return path } if strings.HasPrefix(path, "<base>") { //REMOVE AFTER TESTING path := strings.Replace(path, "<base>", Endpoint, 1) return path } url := Endpoint + path return url } func do(req *http.Request) Resp { client := &http.Client{} req.SetBasicAuth(Username, Passwd) req.Header.Add("User-Agent", AgentHeader) resp, err := client.Do(req) if err != nil { panic(err) } defer resp.Body.Close() resp_body, _ := ioutil.ReadAll(resp.Body) var R Resp R.Req = resp.Request R.Body = resp_body R.Headers = resp.Header R.StatusCode = resp.StatusCode return R } // is_delete performs an http.NewRequest DELETE and returns a Resp struct func is_delete(path string) Resp { url := mk_url(path) req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Content-Type", FullHeader) req.Header.Add("User-Agent", AgentHeader) return do(req) } // is_command performs an http.NewRequest POST and returns a Resp struct func is_command(path string, jason string) Resp { url := mk_url(path) body := json.RawMessage(jason) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(body)) req.Header.Add("Content-Type", CommandHeader) req.Header.Add("User-Agent", AgentHeader) return do(req) } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/request.go����������������������0000664�0000000�0000000�00000006422�13771713062�0027426�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "encoding/json" "net/http" "time" ) type RequestStatus struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata RequestStatusMetadata `json:"metadata,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type RequestStatusMetadata struct { Status string `json:"status,omitempty"` Message string `json:"message,omitempty"` Etag string `json:"etag,omitempty"` Targets []RequestTarget `json:"targets,omitempty"` } type RequestTarget struct { Target ResourceReference `json:"target,omitempty"` Status string `json:"status,omitempty"` } type Requests struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Request `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Request struct { ID string `json:"id"` Type string `json:"type"` Href string `json:"href"` Metadata struct { CreatedDate time.Time `json:"createdDate"` CreatedBy string `json:"createdBy"` Etag string `json:"etag"` RequestStatus struct { ID string `json:"id"` Type string `json:"type"` Href string `json:"href"` } `json:"requestStatus"` } `json:"metadata"` Properties struct { Method string `json:"method"` Headers interface{} `json:"headers"` Body interface{} `json:"body"` URL string `json:"url"` } `json:"properties"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } func ListRequests() Requests { url := mk_url("/requests") + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toRequests(do(req)) } func GetRequest(req_id string) Request { url := mk_url("/requests/"+req_id) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toRequest(do(req)) } func GetRequestStatus(path string) RequestStatus { url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toRequestStatus(do(req)) } func toRequestStatus(resp Resp) RequestStatus { var server RequestStatus json.Unmarshal(resp.Body, &server) server.Response = string(resp.Body) server.Headers = &resp.Headers server.StatusCode = resp.StatusCode return server } func toRequests(resp Resp) Requests { var server Requests json.Unmarshal(resp.Body, &server) server.Response = string(resp.Body) server.Headers = &resp.Headers server.StatusCode = resp.StatusCode return server } func toRequest(resp Resp) Request { var server Request json.Unmarshal(resp.Body, &server) server.Response = string(resp.Body) server.Headers = &resp.Headers server.StatusCode = resp.StatusCode return server } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/resp.go�������������������������0000664�0000000�0000000�00000001115�13771713062�0026701�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import "net/http" import "fmt" import ( "encoding/json" ) func MkJson(i interface{}) string { jason, err := json.MarshalIndent(&i, "", " ") if err != nil { panic(err) } // fmt.Println(string(jason)) return string(jason) } // Resp is the struct returned by all Rest request functions type Resp struct { Req *http.Request StatusCode int Headers http.Header Body []byte } // PrintHeaders prints the http headers as k,v pairs func (r *Resp) PrintHeaders() { for key, value := range r.Headers { fmt.Println(key, " : ", value[0]) } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/server.go�����������������������0000664�0000000�0000000�00000014531�13771713062�0027244�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" ) type Server struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties ServerProperties `json:"properties,omitempty"` Entities *ServerEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type ServerProperties struct { Name string `json:"name,omitempty"` Cores int `json:"cores,omitempty"` Ram int `json:"ram,omitempty"` AvailabilityZone string `json:"availabilityZone,omitempty"` VmState string `json:"vmState,omitempty"` BootCdrom *ResourceReference `json:"bootCdrom,omitempty"` BootVolume *ResourceReference `json:"bootVolume,omitempty"` CpuFamily string `json:"cpuFamily,omitempty"` } type ServerEntities struct { Cdroms *Cdroms `json:"cdroms,omitempty"` Volumes *Volumes `json:"volumes,omitempty"` Nics *Nics `json:"nics,omitempty"` } type Servers struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Server `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type ResourceReference struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` } type CreateServerRequest struct { ServerProperties `json:"properties"` } // ListServers returns a server struct collection func ListServers(dcid string) Servers { path := server_col_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toServers(resp) } // CreateServer creates a server from a jason []byte and returns a Instance struct func CreateServer(dcid string, server Server) Server { obj, _ := json.Marshal(server) path := server_col_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toServer(do(req)) } // GetServer pulls data for the server where id = srvid returns a Instance struct func GetServer(dcid, srvid string) Server { path := server_path(dcid, srvid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toServer(do(req)) } // PatchServer partial update of server properties passed in as jason []byte // Returns Instance struct func PatchServer(dcid string, srvid string, props ServerProperties) Server { jason, _ := json.Marshal(props) path := server_path(dcid, srvid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(jason)) req.Header.Add("Content-Type", PatchHeader) return toServer(do(req)) } // DeleteServer deletes the server where id=srvid and returns Resp struct func DeleteServer(dcid, srvid string) Resp { path := server_path(dcid, srvid) return is_delete(path) } func ListAttachedCdroms(dcid, srvid string) Images { path := server_cdrom_col_path(dcid, srvid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toImages(do(req)) } func AttachCdrom(dcid string, srvid string, cdid string) Image { jason := []byte(`{"id":"` + cdid + `"}`) path := server_cdrom_col_path(dcid, srvid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jason)) req.Header.Add("Content-Type", FullHeader) return toImage(do(req)) } func GetAttachedCdrom(dcid, srvid, cdid string) Volume { path := server_cdrom_path(dcid, srvid, cdid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toVolume(do(req)) } func DetachCdrom(dcid, srvid, cdid string) Resp { path := server_cdrom_path(dcid, srvid, cdid) return is_delete(path) } func ListAttachedVolumes(dcid, srvid string) Volumes { path := server_volume_col_path(dcid, srvid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toVolumes(resp) } func AttachVolume(dcid string, srvid string, volid string) Volume { jason := []byte(`{"id":"` + volid + `"}`) path := server_volume_col_path(dcid, srvid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jason)) req.Header.Add("Content-Type", FullHeader) return toVolume(do(req)) } func GetAttachedVolume(dcid, srvid, volid string) Volume { path := server_volume_path(dcid, srvid, volid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toVolume(resp) } func DetachVolume(dcid, srvid, volid string) Resp { path := server_volume_path(dcid, srvid, volid) return is_delete(path) } // StartServer starts a server func StartServer(dcid, srvid string) Resp { return server_command(dcid, srvid, "start") } // StopServer stops a server func StopServer(dcid, srvid string) Resp { return server_command(dcid, srvid, "stop") } // RebootServer reboots a server func RebootServer(dcid, srvid string) Resp { return server_command(dcid, srvid, "reboot") } // server_command is a generic function for running server commands func server_command(dcid, srvid, cmd string) Resp { jason := ` {} ` path := server_command_path(dcid, srvid, cmd) return is_command(path, jason) } func toServer(resp Resp) Server { var server Server json.Unmarshal(resp.Body, &server) server.Response = string(resp.Body) server.Headers = &resp.Headers server.StatusCode = resp.StatusCode return server } func toServers(resp Resp) Servers { var col Servers json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/snapshot.go���������������������0000664�0000000�0000000�00000006333�13771713062�0027576�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" ) type Snapshot struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata Metadata `json:"metadata,omitempty"` Properties SnapshotProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type SnapshotProperties struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Location string `json:"location,omitempty"` Size int `json:"size,omitempty"` CpuHotPlug bool `json:"cpuHotPlug,omitempty"` CpuHotUnplug bool `json:"cpuHotUnplug,omitempty"` RamHotPlug bool `json:"ramHotPlug,omitempty"` RamHotUnplug bool `json:"ramHotUnplug,omitempty"` NicHotPlug bool `json:"nicHotPlug,omitempty"` NicHotUnplug bool `json:"nicHotUnplug,omitempty"` DiscVirtioHotPlug bool `json:"discVirtioHotPlug,omitempty"` DiscVirtioHotUnplug bool `json:"discVirtioHotUnplug,omitempty"` DiscScsiHotPlug bool `json:"discScsiHotPlug,omitempty"` DiscScsiHotUnplug bool `json:"discScsiHotUnplug,omitempty"` LicenceType string `json:"licenceType,omitempty"` } type Snapshots struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Snapshot `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } func ListSnapshots() Snapshots { path := snapshot_col_path() url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toSnapshots(do(req)) } func GetSnapshot(snapshotId string) Snapshot { path := snapshot_col_path() + slash(snapshotId) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toSnapshot(do(req)) } func DeleteSnapshot(snapshotId string) Resp { path := snapshot_col_path() + slash(snapshotId) url := mk_url(path) req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Content-Type", FullHeader) return do(req) } func UpdateSnapshot(snapshotId string, request SnapshotProperties) Snapshot { path := snapshot_col_path() + slash(snapshotId) obj, _ := json.Marshal(request) url := mk_url(path) req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", PatchHeader) return toSnapshot(do(req)) } func toSnapshot(resp Resp) Snapshot { var lan Snapshot json.Unmarshal(resp.Body, &lan) lan.Response = string(resp.Body) lan.Headers = &resp.Headers lan.StatusCode = resp.StatusCode return lan } func toSnapshots(resp Resp) Snapshots { var col Snapshots json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/test_helpers.go�����������������0000664�0000000�0000000�00000006117�13771713062�0030440�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "fmt" "os" "strings" "time" ) func mkVolume(dcID string) string { var request = Volume{ Properties: VolumeProperties{ Size: 2, Name: "Volume Test", Type: "HDD", ImagePassword: "test1234", ImageAlias: "ubuntu:latest", }, } resp := CreateVolume(dcID, request) waitTillProvisioned(resp.Headers.Get("Location")) return resp.Id } func mkipid(name string) string { var obj = IpBlock{ Properties: IpBlockProperties{ Name: "GO SDK Test", Size: 1, Location: "us/las", }, } resp := ReserveIpBlock(obj) return resp.Id } func mksnapshotId(name string, dcId string) string { svolumeId := mkVolume(dcId) resp := CreateSnapshot(dcId, svolumeId, name, "description") waitTillProvisioned(resp.Headers.Get("Location")) return resp.Id } func mkdcid(name string) string { request := Datacenter{ Properties: DatacenterProperties{ Name: name, Description: "description", Location: "us/las", }, } dc := CreateDatacenter(request) return dc.Id } func mksrvid(srv_dcid string) string { var req = Server{ Properties: ServerProperties{ Name: "GO SDK test", Ram: 1024, Cores: 2, }, } srv := CreateServer(srv_dcid, req) waitTillProvisioned(srv.Headers.Get("Location")) return srv.Id } func mknic(lbal_dcid, serverid string) string { var request = Nic{ Properties: &NicProperties{ Lan: 1, Name: "GO SDK Test", Nat: false, Dhcp: true, FirewallActive: true, Ips: []string{"10.0.0.1"}, }, } resp := CreateNic(lbal_dcid, serverid, request) waitTillProvisioned(resp.Headers.Get("Location")) return resp.Id } func mknic_custom(lbal_dcid, serverid string, lanid int, ips []string) string { var request = Nic{ Properties: &NicProperties{ Lan: lanid, Name: "GO SDK Test", Nat: false, Dhcp: true, FirewallActive: true, Ips: ips, }, } resp := CreateNic(lbal_dcid, serverid, request) waitTillProvisioned(resp.Headers.Get("Location")) return resp.Id } func waitTillProvisioned(path string) { waitCount := 120 for i := 0; i < waitCount; i++ { request := GetRequestStatus(path) if request.Metadata.Status == "DONE" { break } time.Sleep(1 * time.Second) i++ } } func getImageId(location string, imageName string, imageType string) string { if imageName == "" { return "" } SetAuth(os.Getenv("PROFITBRICKS_USERNAME"), os.Getenv("PROFITBRICKS_PASSWORD")) images := ListImages() if images.StatusCode > 299 { fmt.Printf("Error while fetching the list of images %s", images.Response) } if len(images.Items) > 0 { for _, i := range images.Items { imgName := "" if i.Properties.Name != "" { imgName = i.Properties.Name } if imageType == "SSD" { imageType = "HDD" } if imgName != "" && strings.Contains(strings.ToLower(imgName), strings.ToLower(imageName)) && i.Properties.ImageType == imageType && i.Properties.Location == location && i.Properties.Public == true { return i.Id } } } return "" } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/usermanagment.go����������������0000664�0000000�0000000�00000030071�13771713062�0030601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" "strconv" ) type Groups struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Group `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Group struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Properties GroupProperties `json:"properties,omitempty"` Entities *GroupEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type GroupProperties struct { Name string `json:"name,omitempty"` CreateDataCenter *bool `json:"createDataCenter,omitempty"` CreateSnapshot *bool `json:"createSnapshot,omitempty"` ReserveIp *bool `json:"reserveIp,omitempty"` AccessActivityLog *bool `json:"accessActivityLog,omitempty"` } type GroupEntities struct { Users Users `json:"users,omitempty"` Resources Resources `json:"resources,omitempty"` } type Users struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []User `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type User struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties *UserProperties `json:"properties,omitempty"` Entities *UserEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type UserProperties struct { Firstname string `json:"firstname,omitempty"` Lastname string `json:"lastname,omitempty"` Email string `json:"email,omitempty"` Password string `json:"password,omitempty"` Administrator bool `json:"administrator,omitempty"` ForceSecAuth bool `json:"forceSecAuth,omitempty"` SecAuthActive bool `json:"secAuthActive,omitempty"` } type UserEntities struct { Groups Groups `json:"groups,omitempty"` Owns Owns `json:"owns,omitempty"` } type Resources struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Resource `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Resource struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Entities *ResourceEntities `json:"entities,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type ResourceEntities struct { Groups Groups `json:"groups,omitempty"` } type Owns struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Entity `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Entity struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Shares struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Share `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type Share struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Properties ShareProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type ShareProperties struct { EditPrivilege *bool `json:"editPrivilege,omitempty"` SharePrivilege *bool `json:"sharePrivilege,omitempty"` } //Group fucntions func ListGroups() Groups { path := um_groups() url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toGroups(resp) } func GetGroup(groupid string) Group { path := um_group_path(groupid) url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toGroup(do(req)) } func CreateGroup(grp Group) Group { obj, _ := json.Marshal(grp) path := um_groups() url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toGroup(do(req)) } func UpdateGroup(groupid string, obj Group) Group { jason_patch := []byte(MkJson(obj)) path := um_group_path(groupid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jason_patch)) req.Header.Add("Content-Type", PatchHeader) return toGroup(do(req)) } func DeleteGroup(groupid string) Resp { path := um_group_path(groupid) return is_delete(path) } func toGroup(resp Resp) Group { var grp Group json.Unmarshal(resp.Body, &grp) grp.Response = string(resp.Body) grp.Headers = &resp.Headers grp.StatusCode = resp.StatusCode return grp } func toGroups(resp Resp) Groups { var col Groups json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } //Shares functions func ListShares(grpid string) Shares { path := um_group_shares(grpid) url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toShares(resp) } func GetShare(groupid string, resourceid string) Share { path := um_group_share_path(groupid, resourceid) url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toShare(do(req)) } func AddShare(share Share, groupid string, resourceid string) Share { obj, _ := json.Marshal(share) path := um_group_share_path(groupid, resourceid) url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toShare(do(req)) } func UpdateShare(groupid string, resourceid string, obj Share) Share { jason_patch := []byte(MkJson(obj)) path := um_group_share_path(groupid, resourceid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jason_patch)) req.Header.Add("Content-Type", PatchHeader) return toShare(do(req)) } func DeleteShare(groupid string, resourceid string) Resp { path := um_group_share_path(groupid, resourceid) return is_delete(path) } func toShare(resp Resp) Share { var shr Share json.Unmarshal(resp.Body, &shr) shr.Response = string(resp.Body) shr.Headers = &resp.Headers shr.StatusCode = resp.StatusCode return shr } func toShares(resp Resp) Shares { var col Shares json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } //Users in a group func ListGroupUsers(groupid string) Users { path := um_group_users(groupid) url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toUsers(resp) } func AddUserToGroup(groupid string, userid string) User { var usr User usr.Id = userid obj, _ := json.Marshal(usr) path := um_group_users(groupid) url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toUser(do(req)) } func DeleteUserFromGroup(groupid string, userid string) Resp { path := um_group_users_path(groupid, userid) return is_delete(path) } func toUser(resp Resp) User { var usr User json.Unmarshal(resp.Body, &usr) usr.Response = string(resp.Body) usr.Headers = &resp.Headers usr.StatusCode = resp.StatusCode return usr } func toUsers(resp Resp) Users { var col Users json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } //Users func ListUsers() Users { path := um_users() url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toUsers(resp) } func GetUser(usrid string) User { path := um_users_path(usrid) url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) return toUser(do(req)) } func CreateUser(usr User) User { obj, _ := json.Marshal(usr) path := um_users() url := mk_url(path) req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toUser(do(req)) } func UpdateUser(userid string, obj User) User { jason_patch := []byte(MkJson(obj)) path := um_users_path(userid) url := mk_url(path) req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(jason_patch)) req.Header.Add("Content-Type", PatchHeader) return toUser(do(req)) } func DeleteUser(groupid string) Resp { path := um_users_path(groupid) return is_delete(path) } //Resources func ListResources() Resources { path := um_resources() url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toResources(resp) } func GetResourceByType(resourcetype string, resourceid string) Resource { path := um_resources_type_path(resourcetype, resourceid) url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toResource(resp) } func ListResourcesByType(resourcetype string) Resources { path := um_resources_type(resourcetype) url := mk_url(path) + `?depth=` + Depth + `&pretty=` + strconv.FormatBool(Pretty) req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toResources(resp) } func toResources(resp Resp) Resources { var col Resources json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } func toResource(resp Resp) Resource { var col Resource json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/profitbricks/profitbricks-sdk-go/volume.go�����������������������0000664�0000000�0000000�00000011060�13771713062�0027237�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package profitbricks import ( "bytes" "encoding/json" "net/http" "net/url" ) type Volume struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` Properties VolumeProperties `json:"properties,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type VolumeProperties struct { Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` Size int `json:"size,omitempty"` AvailabilityZone string `json:"availabilityZone,omitempty"` Image string `json:"image,omitempty"` ImageAlias string `json:"imageAlias,omitempty"` ImagePassword string `json:"imagePassword,omitempty"` SshKeys []string `json:"sshKeys,omitempty"` Bus string `json:"bus,omitempty"` LicenceType string `json:"licenceType,omitempty"` CpuHotPlug bool `json:"cpuHotPlug,omitempty"` CpuHotUnplug bool `json:"cpuHotUnplug,omitempty"` RamHotPlug bool `json:"ramHotPlug,omitempty"` RamHotUnplug bool `json:"ramHotUnplug,omitempty"` NicHotPlug bool `json:"nicHotPlug,omitempty"` NicHotUnplug bool `json:"nicHotUnplug,omitempty"` DiscVirtioHotPlug bool `json:"discVirtioHotPlug,omitempty"` DiscVirtioHotUnplug bool `json:"discVirtioHotUnplug,omitempty"` DiscScsiHotPlug bool `json:"discScsiHotPlug,omitempty"` DiscScsiHotUnplug bool `json:"discScsiHotUnplug,omitempty"` DeviceNumber int64 `json:"deviceNumber,omitempty"` } type Volumes struct { Id string `json:"id,omitempty"` Type_ string `json:"type,omitempty"` Href string `json:"href,omitempty"` Items []Volume `json:"items,omitempty"` Response string `json:"Response,omitempty"` Headers *http.Header `json:"headers,omitempty"` StatusCode int `json:"headers,omitempty"` } type CreateVolumeRequest struct { VolumeProperties `json:"properties"` } // ListVolumes returns a Collection struct for volumes in the Datacenter func ListVolumes(dcid string) Volumes { path := volume_col_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toVolumes(resp) } func GetVolume(dcid string, volumeId string) Volume { path := volume_path(dcid, volumeId) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Content-Type", FullHeader) resp := do(req) return toVolume(resp) } func PatchVolume(dcid string, volid string, request VolumeProperties) Volume { obj, _ := json.Marshal(request) path := volume_path(dcid, volid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("PATCH", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", PatchHeader) return toVolume(do(req)) } func CreateVolume(dcid string, request Volume) Volume { obj, _ := json.Marshal(request) path := volume_col_path(dcid) url := mk_url(path) + `?depth=` + Depth req, _ := http.NewRequest("POST", url, bytes.NewBuffer(obj)) req.Header.Add("Content-Type", FullHeader) return toVolume(do(req)) } func DeleteVolume(dcid, volid string) Resp { path := volume_path(dcid, volid) return is_delete(path) } func CreateSnapshot(dcid string, volid string, name string, description string) Snapshot { var path = volume_path(dcid, volid) path = path + "/create-snapshot" req_url := mk_url(path) data := url.Values{} data.Set("name", name) data.Add("description", description) req, _ := http.NewRequest("POST", req_url, bytes.NewBufferString(data.Encode())) req.Header.Add("Content-Type", CommandHeader) return toSnapshot(do(req)) } func RestoreSnapshot(dcid string, volid string, snapshotId string) Resp { var path = volume_path(dcid, volid) path = path + "/restore-snapshot" return is_command(path, "snapshotId="+snapshotId) } func toVolume(resp Resp) Volume { var server Volume json.Unmarshal(resp.Body, &server) server.Response = string(resp.Body) server.Headers = &resp.Headers server.StatusCode = resp.StatusCode return server } func toVolumes(resp Resp) Volumes { var col Volumes json.Unmarshal(resp.Body, &col) col.Response = string(resp.Body) col.Headers = &resp.Headers col.StatusCode = resp.StatusCode return col } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020627�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/����������������������������������������0000775�0000000�0000000�00000000000�13771713062�0023621�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/LICENSE���������������������������������0000664�0000000�0000000�00000025005�13771713062�0024630�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Apache License Version 2.0, January 2004 https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS Copyright 2019 Scaleway. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024372�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/���������������������������0000775�0000000�0000000�00000000000�13771713062�0026176�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/������������������������0000775�0000000�0000000�00000000000�13771713062�0026524�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/image_utils.go����������0000664�0000000�0000000�00000002547�13771713062�0031365�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package instance import ( "time" "github.com/scaleway/scaleway-sdk-go/internal/async" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/scw" ) // WaitForImageRequest is used by WaitForImage method. type WaitForImageRequest struct { ImageID string Zone scw.Zone Timeout *time.Duration RetryInterval *time.Duration } // WaitForImage wait for the image to be in a "terminal state" before returning. func (s *API) WaitForImage(req *WaitForImageRequest) (*Image, error) { timeout := defaultTimeout if req.Timeout != nil { timeout = *req.Timeout } retryInterval := defaultRetryInterval if req.RetryInterval != nil { retryInterval = *req.RetryInterval } terminalStatus := map[ImageState]struct{}{ ImageStateAvailable: {}, ImageStateError: {}, } image, err := async.WaitSync(&async.WaitSyncConfig{ Get: func() (interface{}, bool, error) { res, err := s.GetImage(&GetImageRequest{ ImageID: req.ImageID, Zone: req.Zone, }) if err != nil { return nil, false, err } _, isTerminal := terminalStatus[res.Image.State] return res.Image, isTerminal, err }, Timeout: timeout, IntervalStrategy: async.LinearIntervalStrategy(retryInterval), }) if err != nil { return nil, errors.Wrap(err, "waiting for image failed") } return image.(*Image), nil } ���������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_metadata_sdk.go0000664�0000000�0000000�00000020242�13771713062�0033360�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package instance import ( "bytes" "encoding/json" "io/ioutil" "math/rand" "net" "net/http" "strconv" "time" "github.com/scaleway/scaleway-sdk-go/internal/errors" ) var ( metadataURL = "http://169.254.42.42" metadataRetryBindPort = 200 ) // MetadataAPI metadata API type MetadataAPI struct { } // NewMetadataAPI returns a MetadataAPI object from a Scaleway client. func NewMetadataAPI() *MetadataAPI { return &MetadataAPI{} } // GetMetadata returns the metadata available from the server func (*MetadataAPI) GetMetadata() (m *Metadata, err error) { resp, err := http.Get(metadataURL + "/conf?format=json") if err != nil { return nil, errors.Wrap(err, "error getting metadataURL") } defer resp.Body.Close() metadata := &Metadata{} err = json.NewDecoder(resp.Body).Decode(metadata) if err != nil { return nil, errors.Wrap(err, "error decoding metadata") } return metadata, nil } // Metadata represents the struct return by the metadata API type Metadata struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Hostname string `json:"hostname,omitempty"` Organization string `json:"organization,omitempty"` Project string `json:"project,omitempty"` CommercialType string `json:"commercial_type,omitempty"` PublicIP struct { Dynamic bool `json:"dynamic,omitempty"` ID string `json:"id,omitempty"` Address string `json:"address,omitempty"` } `json:"public_ip,omitempty"` PrivateIP string `json:"private_ip,omitempty"` IPv6 struct { Netmask string `json:"netmask,omitempty"` Gateway string `json:"gateway,omitempty"` Address string `json:"address,omitempty"` } `json:"ipv6,omitempty"` Location struct { PlatformID string `json:"platform_id,omitempty"` HypervisorID string `json:"hypervisor_id,omitempty"` NodeID string `json:"node_id,omitempty"` ClusterID string `json:"cluster_id,omitempty"` ZoneID string `json:"zone_id,omitempty"` } `json:"location,omitempty"` Tags []string `json:"tags,omitempty"` StateDetail string `json:"state_detail,omitempty"` SSHPublicKeys []struct { Description string `json:"description,omitempty"` ModificationDate string `json:"modification_date,omitempty"` IP string `json:"ip,omitempty"` Key string `json:"key,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` ID string `json:"id,omitempty"` CreationDate string `json:"creation_date,omitempty"` } `json:"ssh_public_keys,omitempty"` Timezone string `json:"timezone,omitempty"` Bootscript struct { Kernel string `json:"kernel,omitempty"` Title string `json:"title,omitempty"` Default bool `json:"default,omitempty"` Dtb string `json:"dtb,omitempty"` Public bool `json:"publc,omitempty"` Initrd string `json:"initrd,omitempty"` Bootcmdargs string `json:"bootcmdargs,omitempty"` Architecture string `json:"architecture,omitempty"` Organization string `json:"organization,omitempty"` Project string `json:"project,omitempty"` ID string `json:"id,omitempty"` } `json:"bootscript,omitempty"` Volumes map[string]struct { Name string `json:"name,omitempty"` ModificationDate string `json:"modification_date,omitempty"` ExportURI string `json:"export_uri,omitempty"` VolumeType string `json:"volume_type,omitempty"` CreationDate string `json:"creation_date,omitempty"` State string `json:"state,omitempty"` Organization string `json:"organization,omitempty"` Project string `json:"project,omitempty"` Server struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` } `json:"server,omitempty"` ID string `json:"id,omitempty"` Size int `json:"size,omitempty"` } } // ListUserData returns the metadata available from the server func (*MetadataAPI) ListUserData() (res *UserData, err error) { retries := 0 for retries <= metadataRetryBindPort { port := rand.Intn(1024) localTCPAddr, err := net.ResolveTCPAddr("tcp", ":"+strconv.Itoa(port)) if err != nil { return nil, errors.Wrap(err, "error resolving tcp address") } userdataClient := &http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ LocalAddr: localTCPAddr, DualStack: false, FallbackDelay: time.Second * -1, }).DialContext, }, } resp, err := userdataClient.Get(metadataURL + "/user_data?format=json") if err != nil { retries++ // retry with a different source port continue } defer resp.Body.Close() userdata := &UserData{} err = json.NewDecoder(resp.Body).Decode(userdata) if err != nil { return nil, errors.Wrap(err, "error decoding userdata") } return userdata, nil } return nil, errors.New("too many bind port retries for ListUserData") } // GetUserData returns the value for the given metadata key func (*MetadataAPI) GetUserData(key string) ([]byte, error) { if key == "" { return make([]byte, 0), errors.New("key must not be empty in GetUserData") } retries := 0 for retries <= metadataRetryBindPort { port := rand.Intn(1024) localTCPAddr, err := net.ResolveTCPAddr("tcp", ":"+strconv.Itoa(port)) if err != nil { return make([]byte, 0), errors.Wrap(err, "error resolving tcp address") } userdataClient := &http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ LocalAddr: localTCPAddr, DualStack: false, FallbackDelay: time.Second * -1, }).DialContext, }, } resp, err := userdataClient.Get(metadataURL + "/user_data/" + key) if err != nil { retries++ // retry with a different source port continue } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { return make([]byte, 0), errors.Wrap(err, "error reading userdata body") } return body, nil } return make([]byte, 0), errors.New("too may bind port retries for GetUserData") } // SetUserData sets the userdata key with the given value func (*MetadataAPI) SetUserData(key string, value []byte) error { if key == "" { return errors.New("key must not be empty in SetUserData") } retries := 0 for retries <= metadataRetryBindPort { port := rand.Intn(1024) localTCPAddr, err := net.ResolveTCPAddr("tcp", ":"+strconv.Itoa(port)) if err != nil { return errors.Wrap(err, "error resolving tcp address") } userdataClient := &http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ LocalAddr: localTCPAddr, DualStack: false, FallbackDelay: time.Second * -1, }).DialContext, }, } request, err := http.NewRequest("PATCH", metadataURL+"/user_data/"+key, bytes.NewBuffer(value)) if err != nil { return errors.Wrap(err, "error creating patch userdata request") } request.Header.Set("Content-Type", "text/plain") _, err = userdataClient.Do(request) if err != nil { retries++ // retry with a different source port continue } return nil } return errors.New("too may bind port retries for SetUserData") } // DeleteUserData deletes the userdata key and the associated value func (*MetadataAPI) DeleteUserData(key string) error { if key == "" { return errors.New("key must not be empty in DeleteUserData") } retries := 0 for retries <= metadataRetryBindPort { port := rand.Intn(1024) localTCPAddr, err := net.ResolveTCPAddr("tcp", ":"+strconv.Itoa(port)) if err != nil { return errors.Wrap(err, "error resolving tcp address") } userdataClient := &http.Client{ Transport: &http.Transport{ DialContext: (&net.Dialer{ LocalAddr: localTCPAddr, DualStack: false, FallbackDelay: time.Second * -1, }).DialContext, }, } request, err := http.NewRequest("DELETE", metadataURL+"/user_data/"+key, bytes.NewBuffer([]byte(""))) if err != nil { return errors.Wrap(err, "error creating delete userdata request") } _, err = userdataClient.Do(request) if err != nil { retries++ // retry with a different source port continue } return nil } return errors.New("too may bind port retries for DeleteUserData") } // UserData represents the user data type UserData struct { UserData []string `json:"user_data,omitempty"` } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_sdk.go���������0000664�0000000�0000000�00000363151�13771713062�0031531�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. // Package instance provides methods and message types of the instance v1 API. package instance import ( "bytes" "encoding/json" "fmt" "net" "net/http" "net/url" "strings" "time" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/internal/marshaler" "github.com/scaleway/scaleway-sdk-go/internal/parameter" "github.com/scaleway/scaleway-sdk-go/namegenerator" "github.com/scaleway/scaleway-sdk-go/scw" ) // always import dependencies var ( _ fmt.Stringer _ json.Unmarshaler _ url.URL _ net.IP _ http.Header _ bytes.Reader _ time.Time _ = strings.Join _ scw.ScalewayRequest _ marshaler.Duration _ scw.File _ = parameter.AddToQuery _ = namegenerator.GetRandomName ) // API: instance API type API struct { client *scw.Client } // NewAPI returns a API object from a Scaleway client. func NewAPI(client *scw.Client) *API { return &API{ client: client, } } type Arch string const ( // ArchX86_64 is [insert doc]. ArchX86_64 = Arch("x86_64") // ArchArm is [insert doc]. ArchArm = Arch("arm") ) func (enum Arch) String() string { if enum == "" { // return default value if empty return "x86_64" } return string(enum) } func (enum Arch) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *Arch) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = Arch(Arch(tmp).String()) return nil } type BootType string const ( // BootTypeLocal is [insert doc]. BootTypeLocal = BootType("local") // BootTypeBootscript is [insert doc]. BootTypeBootscript = BootType("bootscript") // BootTypeRescue is [insert doc]. BootTypeRescue = BootType("rescue") ) func (enum BootType) String() string { if enum == "" { // return default value if empty return "local" } return string(enum) } func (enum BootType) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *BootType) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = BootType(BootType(tmp).String()) return nil } type ImageState string const ( // ImageStateAvailable is [insert doc]. ImageStateAvailable = ImageState("available") // ImageStateCreating is [insert doc]. ImageStateCreating = ImageState("creating") // ImageStateError is [insert doc]. ImageStateError = ImageState("error") ) func (enum ImageState) String() string { if enum == "" { // return default value if empty return "available" } return string(enum) } func (enum ImageState) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *ImageState) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = ImageState(ImageState(tmp).String()) return nil } type PlacementGroupPolicyMode string const ( // PlacementGroupPolicyModeOptional is [insert doc]. PlacementGroupPolicyModeOptional = PlacementGroupPolicyMode("optional") // PlacementGroupPolicyModeEnforced is [insert doc]. PlacementGroupPolicyModeEnforced = PlacementGroupPolicyMode("enforced") ) func (enum PlacementGroupPolicyMode) String() string { if enum == "" { // return default value if empty return "optional" } return string(enum) } func (enum PlacementGroupPolicyMode) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *PlacementGroupPolicyMode) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = PlacementGroupPolicyMode(PlacementGroupPolicyMode(tmp).String()) return nil } type PlacementGroupPolicyType string const ( // PlacementGroupPolicyTypeMaxAvailability is [insert doc]. PlacementGroupPolicyTypeMaxAvailability = PlacementGroupPolicyType("max_availability") // PlacementGroupPolicyTypeLowLatency is [insert doc]. PlacementGroupPolicyTypeLowLatency = PlacementGroupPolicyType("low_latency") ) func (enum PlacementGroupPolicyType) String() string { if enum == "" { // return default value if empty return "max_availability" } return string(enum) } func (enum PlacementGroupPolicyType) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *PlacementGroupPolicyType) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = PlacementGroupPolicyType(PlacementGroupPolicyType(tmp).String()) return nil } type SecurityGroupPolicy string const ( // SecurityGroupPolicyAccept is [insert doc]. SecurityGroupPolicyAccept = SecurityGroupPolicy("accept") // SecurityGroupPolicyDrop is [insert doc]. SecurityGroupPolicyDrop = SecurityGroupPolicy("drop") ) func (enum SecurityGroupPolicy) String() string { if enum == "" { // return default value if empty return "accept" } return string(enum) } func (enum SecurityGroupPolicy) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *SecurityGroupPolicy) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = SecurityGroupPolicy(SecurityGroupPolicy(tmp).String()) return nil } type SecurityGroupRuleAction string const ( // SecurityGroupRuleActionAccept is [insert doc]. SecurityGroupRuleActionAccept = SecurityGroupRuleAction("accept") // SecurityGroupRuleActionDrop is [insert doc]. SecurityGroupRuleActionDrop = SecurityGroupRuleAction("drop") ) func (enum SecurityGroupRuleAction) String() string { if enum == "" { // return default value if empty return "accept" } return string(enum) } func (enum SecurityGroupRuleAction) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *SecurityGroupRuleAction) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = SecurityGroupRuleAction(SecurityGroupRuleAction(tmp).String()) return nil } type SecurityGroupRuleDirection string const ( // SecurityGroupRuleDirectionInbound is [insert doc]. SecurityGroupRuleDirectionInbound = SecurityGroupRuleDirection("inbound") // SecurityGroupRuleDirectionOutbound is [insert doc]. SecurityGroupRuleDirectionOutbound = SecurityGroupRuleDirection("outbound") ) func (enum SecurityGroupRuleDirection) String() string { if enum == "" { // return default value if empty return "inbound" } return string(enum) } func (enum SecurityGroupRuleDirection) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *SecurityGroupRuleDirection) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = SecurityGroupRuleDirection(SecurityGroupRuleDirection(tmp).String()) return nil } type SecurityGroupRuleProtocol string const ( // SecurityGroupRuleProtocolTCP is [insert doc]. SecurityGroupRuleProtocolTCP = SecurityGroupRuleProtocol("TCP") // SecurityGroupRuleProtocolUDP is [insert doc]. SecurityGroupRuleProtocolUDP = SecurityGroupRuleProtocol("UDP") // SecurityGroupRuleProtocolICMP is [insert doc]. SecurityGroupRuleProtocolICMP = SecurityGroupRuleProtocol("ICMP") // SecurityGroupRuleProtocolANY is [insert doc]. SecurityGroupRuleProtocolANY = SecurityGroupRuleProtocol("ANY") ) func (enum SecurityGroupRuleProtocol) String() string { if enum == "" { // return default value if empty return "TCP" } return string(enum) } func (enum SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *SecurityGroupRuleProtocol) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = SecurityGroupRuleProtocol(SecurityGroupRuleProtocol(tmp).String()) return nil } type ServerAction string const ( // ServerActionPoweron is [insert doc]. ServerActionPoweron = ServerAction("poweron") // ServerActionBackup is [insert doc]. ServerActionBackup = ServerAction("backup") // ServerActionStopInPlace is [insert doc]. ServerActionStopInPlace = ServerAction("stop_in_place") // ServerActionPoweroff is [insert doc]. ServerActionPoweroff = ServerAction("poweroff") // ServerActionTerminate is [insert doc]. ServerActionTerminate = ServerAction("terminate") // ServerActionReboot is [insert doc]. ServerActionReboot = ServerAction("reboot") ) func (enum ServerAction) String() string { if enum == "" { // return default value if empty return "poweron" } return string(enum) } func (enum ServerAction) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *ServerAction) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = ServerAction(ServerAction(tmp).String()) return nil } type ServerState string const ( // ServerStateRunning is [insert doc]. ServerStateRunning = ServerState("running") // ServerStateStopped is [insert doc]. ServerStateStopped = ServerState("stopped") // ServerStateStoppedInPlace is [insert doc]. ServerStateStoppedInPlace = ServerState("stopped in place") // ServerStateStarting is [insert doc]. ServerStateStarting = ServerState("starting") // ServerStateStopping is [insert doc]. ServerStateStopping = ServerState("stopping") // ServerStateLocked is [insert doc]. ServerStateLocked = ServerState("locked") ) func (enum ServerState) String() string { if enum == "" { // return default value if empty return "running" } return string(enum) } func (enum ServerState) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *ServerState) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = ServerState(ServerState(tmp).String()) return nil } type ServerTypesAvailability string const ( // ServerTypesAvailabilityAvailable is [insert doc]. ServerTypesAvailabilityAvailable = ServerTypesAvailability("available") // ServerTypesAvailabilityScarce is [insert doc]. ServerTypesAvailabilityScarce = ServerTypesAvailability("scarce") // ServerTypesAvailabilityShortage is [insert doc]. ServerTypesAvailabilityShortage = ServerTypesAvailability("shortage") ) func (enum ServerTypesAvailability) String() string { if enum == "" { // return default value if empty return "available" } return string(enum) } func (enum ServerTypesAvailability) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *ServerTypesAvailability) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = ServerTypesAvailability(ServerTypesAvailability(tmp).String()) return nil } type SnapshotState string const ( // SnapshotStateAvailable is [insert doc]. SnapshotStateAvailable = SnapshotState("available") // SnapshotStateSnapshotting is [insert doc]. SnapshotStateSnapshotting = SnapshotState("snapshotting") // SnapshotStateError is [insert doc]. SnapshotStateError = SnapshotState("error") ) func (enum SnapshotState) String() string { if enum == "" { // return default value if empty return "available" } return string(enum) } func (enum SnapshotState) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *SnapshotState) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = SnapshotState(SnapshotState(tmp).String()) return nil } type TaskStatus string const ( // TaskStatusPending is [insert doc]. TaskStatusPending = TaskStatus("pending") // TaskStatusStarted is [insert doc]. TaskStatusStarted = TaskStatus("started") // TaskStatusSuccess is [insert doc]. TaskStatusSuccess = TaskStatus("success") // TaskStatusFailure is [insert doc]. TaskStatusFailure = TaskStatus("failure") // TaskStatusRetry is [insert doc]. TaskStatusRetry = TaskStatus("retry") ) func (enum TaskStatus) String() string { if enum == "" { // return default value if empty return "pending" } return string(enum) } func (enum TaskStatus) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *TaskStatus) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = TaskStatus(TaskStatus(tmp).String()) return nil } type VolumeState string const ( // VolumeStateAvailable is [insert doc]. VolumeStateAvailable = VolumeState("available") // VolumeStateSnapshotting is [insert doc]. VolumeStateSnapshotting = VolumeState("snapshotting") // VolumeStateError is [insert doc]. VolumeStateError = VolumeState("error") ) func (enum VolumeState) String() string { if enum == "" { // return default value if empty return "available" } return string(enum) } func (enum VolumeState) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *VolumeState) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = VolumeState(VolumeState(tmp).String()) return nil } type VolumeVolumeType string const ( // VolumeVolumeTypeLSSD is [insert doc]. VolumeVolumeTypeLSSD = VolumeVolumeType("l_ssd") // VolumeVolumeTypeBSSD is [insert doc]. VolumeVolumeTypeBSSD = VolumeVolumeType("b_ssd") ) func (enum VolumeVolumeType) String() string { if enum == "" { // return default value if empty return "l_ssd" } return string(enum) } func (enum VolumeVolumeType) MarshalJSON() ([]byte, error) { return []byte(fmt.Sprintf(`"%s"`, enum)), nil } func (enum *VolumeVolumeType) UnmarshalJSON(data []byte) error { tmp := "" if err := json.Unmarshal(data, &tmp); err != nil { return err } *enum = VolumeVolumeType(VolumeVolumeType(tmp).String()) return nil } // Bootscript: bootscript type Bootscript struct { // Bootcmdargs: the bootscript arguments Bootcmdargs string `json:"bootcmdargs"` // Default: dispmay if the bootscript is the default bootscript if no other boot option is configured Default bool `json:"default"` // Dtb: provide information regarding a Device Tree Binary (dtb) for use with C1 servers Dtb string `json:"dtb"` // ID: the bootscript ID ID string `json:"id"` // Initrd: the initrd (initial ramdisk) configuration Initrd string `json:"initrd"` // Kernel: the server kernel version Kernel string `json:"kernel"` // Organization: the bootscript organization ID Organization string `json:"organization"` // Project: the bootscript project ID Project string `json:"project"` // Public: provide information if the bootscript is public Public bool `json:"public"` // Title: the bootscript title Title string `json:"title"` // Arch: the bootscript arch // // Default value: x86_64 Arch Arch `json:"arch"` // Zone: the zone in which is the bootscript Zone scw.Zone `json:"zone"` } type CreateIPResponse struct { IP *IP `json:"ip"` Location string `json:"Location"` } type CreateImageResponse struct { Image *Image `json:"image"` Location string `json:"Location"` } type CreatePlacementGroupResponse struct { PlacementGroup *PlacementGroup `json:"placement_group"` } type CreatePrivateNICResponse struct { PrivateNic *PrivateNIC `json:"private_nic"` } type CreateSecurityGroupResponse struct { SecurityGroup *SecurityGroup `json:"security_group"` } type CreateSecurityGroupRuleResponse struct { Rule *SecurityGroupRule `json:"rule"` } type CreateServerResponse struct { Server *Server `json:"server"` } type CreateSnapshotResponse struct { Snapshot *Snapshot `json:"snapshot"` } type CreateVolumeResponse struct { Volume *Volume `json:"volume"` Location string `json:"Location"` } type Dashboard struct { VolumesCount uint32 `json:"volumes_count"` RunningServersCount uint32 `json:"running_servers_count"` ServersByTypes map[string]uint32 `json:"servers_by_types"` ImagesCount uint32 `json:"images_count"` SnapshotsCount uint32 `json:"snapshots_count"` ServersCount uint32 `json:"servers_count"` IPsCount uint32 `json:"ips_count"` SecurityGroupsCount uint32 `json:"security_groups_count"` IPsUnused uint32 `json:"ips_unused"` } type GetBootscriptResponse struct { Bootscript *Bootscript `json:"bootscript"` } type GetDashboardResponse struct { Dashboard *Dashboard `json:"dashboard"` } type GetIPResponse struct { IP *IP `json:"ip"` } type GetImageResponse struct { Image *Image `json:"image"` } type GetPlacementGroupResponse struct { PlacementGroup *PlacementGroup `json:"placement_group"` } type GetPlacementGroupServersResponse struct { Servers []*PlacementGroupServer `json:"servers"` } type GetPrivateNICResponse struct { PrivateNic *PrivateNIC `json:"private_nic"` } type GetSecurityGroupResponse struct { SecurityGroup *SecurityGroup `json:"security_group"` } type GetSecurityGroupRuleResponse struct { Rule *SecurityGroupRule `json:"rule"` } type GetServerResponse struct { Server *Server `json:"server"` } type GetServerTypesAvailabilityResponse struct { Servers map[string]*GetServerTypesAvailabilityResponseAvailability `json:"servers"` } type GetServerTypesAvailabilityResponseAvailability struct { // Availability: // // Default value: available Availability ServerTypesAvailability `json:"availability"` } type GetSnapshotResponse struct { Snapshot *Snapshot `json:"snapshot"` } type GetVolumeResponse struct { Volume *Volume `json:"volume"` } type IP struct { ID string `json:"id"` Address net.IP `json:"address"` Reverse *string `json:"reverse"` Server *ServerSummary `json:"server"` Organization string `json:"organization"` Tags []string `json:"tags"` Project string `json:"project"` Zone scw.Zone `json:"zone"` } type Image struct { ID string `json:"id"` Name string `json:"name"` // Arch: // // Default value: x86_64 Arch Arch `json:"arch"` CreationDate *time.Time `json:"creation_date"` ModificationDate *time.Time `json:"modification_date"` DefaultBootscript *Bootscript `json:"default_bootscript"` ExtraVolumes map[string]*Volume `json:"extra_volumes"` FromServer string `json:"from_server"` Organization string `json:"organization"` Public bool `json:"public"` RootVolume *VolumeSummary `json:"root_volume"` // State: // // Default value: available State ImageState `json:"state"` Project string `json:"project"` Zone scw.Zone `json:"zone"` } type ListBootscriptsResponse struct { Bootscripts []*Bootscript `json:"bootscripts"` TotalCount uint32 `json:"total_count"` } type ListIPsResponse struct { IPs []*IP `json:"ips"` TotalCount uint32 `json:"total_count"` } type ListImagesResponse struct { Images []*Image `json:"images"` TotalCount uint32 `json:"total_count"` } type ListPlacementGroupsResponse struct { PlacementGroups []*PlacementGroup `json:"placement_groups"` TotalCount uint32 `json:"total_count"` } type ListPrivateNICsResponse struct { PrivateNics []*PrivateNIC `json:"private_nics"` } type ListSecurityGroupRulesResponse struct { Rules []*SecurityGroupRule `json:"rules"` TotalCount uint32 `json:"total_count"` } type ListSecurityGroupsResponse struct { SecurityGroups []*SecurityGroup `json:"security_groups"` TotalCount uint32 `json:"total_count"` } type ListServerActionsResponse struct { Actions []ServerAction `json:"actions"` } type ListServerUserDataResponse struct { UserData []string `json:"user_data"` } type ListServersResponse struct { Servers []*Server `json:"servers"` TotalCount uint32 `json:"total_count"` } type ListServersTypesResponse struct { Servers map[string]*ServerType `json:"servers"` TotalCount uint32 `json:"total_count"` } type ListSnapshotsResponse struct { Snapshots []*Snapshot `json:"snapshots"` TotalCount uint32 `json:"total_count"` } type ListVolumesResponse struct { Volumes []*Volume `json:"volumes"` TotalCount uint32 `json:"total_count"` } type ListVolumesTypesResponse struct { Volumes map[string]*VolumeType `json:"volumes"` TotalCount uint32 `json:"total_count"` } type NullableStringValue struct { Null bool `json:"null,omitempty"` Value string `json:"value,omitempty"` } // PlacementGroup: placement group type PlacementGroup struct { // ID: the placement group unique ID ID string `json:"id"` // Name: the placement group name Name string `json:"name"` // Organization: the placement group organization ID Organization string `json:"organization"` // Project: the placement group project ID Project string `json:"project"` // PolicyMode: select the failling mode when the placement cannot be respected, either optional or enforced // // Default value: optional PolicyMode PlacementGroupPolicyMode `json:"policy_mode"` // PolicyType: select the behavior of the placement group, either low_latency (group) or max_availability (spread) // // Default value: max_availability PolicyType PlacementGroupPolicyType `json:"policy_type"` // PolicyRespected: returns true if the policy is respected, false otherwise PolicyRespected bool `json:"policy_respected"` // Zone: the zone in which is the placement group Zone scw.Zone `json:"zone"` } type PlacementGroupServer struct { ID string `json:"id"` Name string `json:"name"` PolicyRespected bool `json:"policy_respected"` } // PrivateNIC: private nic type PrivateNIC struct { // ID: the private NIC unique ID ID string `json:"id,omitempty"` // ServerID: the server the private NIC is attached to ServerID string `json:"server_id,omitempty"` // PrivateNetworkID: the private network where the private NIC is attached PrivateNetworkID string `json:"private_network_id,omitempty"` // MacAddress: the private NIC MAC address MacAddress string `json:"mac_address,omitempty"` } // SecurityGroup: security group type SecurityGroup struct { // ID: the security groups' unique ID ID string `json:"id"` // Name: the security groups name Name string `json:"name"` // Description: the security groups description Description string `json:"description"` // EnableDefaultSecurity: true if SMTP is blocked on IPv4 and IPv6 EnableDefaultSecurity bool `json:"enable_default_security"` // InboundDefaultPolicy: the default inbound policy // // Default value: accept InboundDefaultPolicy SecurityGroupPolicy `json:"inbound_default_policy"` // OutboundDefaultPolicy: the default outbound policy // // Default value: accept OutboundDefaultPolicy SecurityGroupPolicy `json:"outbound_default_policy"` // Organization: the security groups organization ID Organization string `json:"organization"` // Project: the security group project ID Project string `json:"project"` // Deprecated: OrganizationDefault: true if it is your default security group for this organization ID OrganizationDefault bool `json:"organization_default"` // ProjectDefault: true if it is your default security group for this project ID ProjectDefault bool `json:"project_default"` // CreationDate: the security group creation date CreationDate *time.Time `json:"creation_date"` // ModificationDate: the security group modification date ModificationDate *time.Time `json:"modification_date"` // Servers: list of servers attached to this security group Servers []*ServerSummary `json:"servers"` // Stateful: true if the security group is stateful Stateful bool `json:"stateful"` // Zone: the zone in which is the security group Zone scw.Zone `json:"zone"` } type SecurityGroupRule struct { ID string `json:"id"` // Protocol: // // Default value: TCP Protocol SecurityGroupRuleProtocol `json:"protocol"` // Direction: // // Default value: inbound Direction SecurityGroupRuleDirection `json:"direction"` // Action: // // Default value: accept Action SecurityGroupRuleAction `json:"action"` IPRange scw.IPNet `json:"ip_range"` DestPortFrom *uint32 `json:"dest_port_from"` DestPortTo *uint32 `json:"dest_port_to"` Position uint32 `json:"position"` Editable bool `json:"editable"` Zone scw.Zone `json:"zone"` } type SecurityGroupSummary struct { ID string `json:"id"` Name string `json:"name"` } type SecurityGroupTemplate struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` } // Server: server type Server struct { // ID: the server unique ID ID string `json:"id"` // Name: the server name Name string `json:"name"` // Organization: the server organization ID Organization string `json:"organization"` // Project: the server project ID Project string `json:"project"` // AllowedActions: provide as list of allowed actions on the server AllowedActions []ServerAction `json:"allowed_actions"` // Tags: the server associated tags Tags []string `json:"tags"` // CommercialType: the server commercial type (eg. GP1-M) CommercialType string `json:"commercial_type"` // CreationDate: the server creation date CreationDate *time.Time `json:"creation_date"` // DynamicIPRequired: true if a dynamic IP is required DynamicIPRequired bool `json:"dynamic_ip_required"` // EnableIPv6: true if IPv6 is enabled EnableIPv6 bool `json:"enable_ipv6"` // Hostname: the server host name Hostname string `json:"hostname"` // Image: provide information on the server image Image *Image `json:"image"` // Protected: the server protection option is activated Protected bool `json:"protected"` // PrivateIP: the server private IP address PrivateIP *string `json:"private_ip"` // PublicIP: information about the public IP PublicIP *ServerIP `json:"public_ip"` // ModificationDate: the server modification date ModificationDate *time.Time `json:"modification_date"` // State: the server state // // Default value: running State ServerState `json:"state"` // Location: the server location Location *ServerLocation `json:"location"` // IPv6: the server IPv6 address IPv6 *ServerIPv6 `json:"ipv6"` // Bootscript: the server bootscript Bootscript *Bootscript `json:"bootscript"` // BootType: the server boot type // // Default value: local BootType BootType `json:"boot_type"` // Volumes: the server volumes Volumes map[string]*Volume `json:"volumes"` // SecurityGroup: the server security group SecurityGroup *SecurityGroupSummary `json:"security_group"` // Maintenances: the server planned maintenances Maintenances []*ServerMaintenance `json:"maintenances"` // StateDetail: the server state_detail StateDetail string `json:"state_detail"` // Arch: the server arch // // Default value: x86_64 Arch Arch `json:"arch"` // PlacementGroup: the server placement group PlacementGroup *PlacementGroup `json:"placement_group"` // PrivateNics: the server private NICs PrivateNics []*PrivateNIC `json:"private_nics"` // Zone: the zone in which is the server Zone scw.Zone `json:"zone"` } type ServerActionResponse struct { Task *Task `json:"task"` } // ServerIP: server. ip type ServerIP struct { // ID: the unique ID of the IP address ID string `json:"id"` // Address: the server public IPv4 IP-Address Address net.IP `json:"address"` // Dynamic: true if the IP address is dynamic Dynamic bool `json:"dynamic"` } // ServerIPv6: server. ipv6 type ServerIPv6 struct { // Address: the server IPv6 IP-Address Address net.IP `json:"address"` // Gateway: the IPv6 IP-addresses gateway Gateway net.IP `json:"gateway"` // Netmask: the IPv6 IP-addresses CIDR netmask Netmask string `json:"netmask"` } type ServerLocation struct { ClusterID string `json:"cluster_id"` HypervisorID string `json:"hypervisor_id"` NodeID string `json:"node_id"` PlatformID string `json:"platform_id"` ZoneID string `json:"zone_id"` } type ServerMaintenance struct { } type ServerSummary struct { ID string `json:"id"` Name string `json:"name"` } type ServerType struct { MonthlyPrice float32 `json:"monthly_price"` HourlyPrice float32 `json:"hourly_price"` AltNames []string `json:"alt_names"` PerVolumeConstraint *ServerTypeVolumeConstraintsByType `json:"per_volume_constraint"` VolumesConstraint *ServerTypeVolumeConstraintSizes `json:"volumes_constraint"` Ncpus uint32 `json:"ncpus"` Gpu *uint64 `json:"gpu"` RAM uint64 `json:"ram"` // Arch: // // Default value: x86_64 Arch Arch `json:"arch"` Baremetal bool `json:"baremetal"` Network *ServerTypeNetwork `json:"network"` } type ServerTypeNetwork struct { Interfaces []*ServerTypeNetworkInterface `json:"interfaces"` SumInternalBandwidth *uint64 `json:"sum_internal_bandwidth"` SumInternetBandwidth *uint64 `json:"sum_internet_bandwidth"` IPv6Support bool `json:"ipv6_support"` } type ServerTypeNetworkInterface struct { InternalBandwidth *uint64 `json:"internal_bandwidth"` InternetBandwidth *uint64 `json:"internet_bandwidth"` } type ServerTypeVolumeConstraintSizes struct { MinSize scw.Size `json:"min_size"` MaxSize scw.Size `json:"max_size"` } type ServerTypeVolumeConstraintsByType struct { LSSD *ServerTypeVolumeConstraintSizes `json:"l_ssd"` } type SetPlacementGroupResponse struct { PlacementGroup *PlacementGroup `json:"placement_group"` } type SetPlacementGroupServersResponse struct { Servers []*PlacementGroupServer `json:"servers"` } // Snapshot: snapshot type Snapshot struct { // ID: the snapshot ID ID string `json:"id"` // Name: the snapshot name Name string `json:"name"` // Organization: the snapshot organization ID Organization string `json:"organization"` // Project: the snapshot project ID Project string `json:"project"` // VolumeType: the snapshot volume type // // Default value: l_ssd VolumeType VolumeVolumeType `json:"volume_type"` // Size: the snapshot size Size scw.Size `json:"size"` // State: the snapshot state // // Default value: available State SnapshotState `json:"state"` // BaseVolume: the volume on which the snapshot is based on BaseVolume *SnapshotBaseVolume `json:"base_volume"` // CreationDate: the snapshot creation date CreationDate *time.Time `json:"creation_date"` // ModificationDate: the snapshot modification date ModificationDate *time.Time `json:"modification_date"` // Zone: the snapshot zone Zone scw.Zone `json:"zone"` } // SnapshotBaseVolume: snapshot. base volume type SnapshotBaseVolume struct { // ID: the volume ID on which the snapshot is based on ID string `json:"id"` // Name: the volume name on which the snapshot is based on Name string `json:"name"` } // Task: task type Task struct { // ID: the unique ID of the task ID string `json:"id"` // Description: the description of the task Description string `json:"description"` // Progress: the progress of the task in percent Progress int32 `json:"progress"` // StartedAt: the task start date StartedAt *time.Time `json:"started_at"` // TerminatedAt: the task end date TerminatedAt *time.Time `json:"terminated_at"` // Status: the task status // // Default value: pending Status TaskStatus `json:"status"` HrefFrom string `json:"href_from"` HrefResult string `json:"href_result"` // Zone: the zone in which is the task Zone scw.Zone `json:"zone"` } type UpdateIPResponse struct { IP *IP `json:"ip"` } type UpdatePlacementGroupResponse struct { PlacementGroup *PlacementGroup `json:"placement_group"` } type UpdatePlacementGroupServersResponse struct { Servers []*PlacementGroupServer `json:"servers"` } type UpdateServerResponse struct { Server *Server `json:"server"` } type UpdateVolumeResponse struct { Volume *Volume `json:"volume"` } // Volume: volume type Volume struct { // ID: the volume unique ID ID string `json:"id"` // Name: the volume name Name string `json:"name"` // ExportURI: show the volume NBD export URI ExportURI string `json:"export_uri"` // Size: the volume disk size Size scw.Size `json:"size"` // VolumeType: the volume type // // Default value: l_ssd VolumeType VolumeVolumeType `json:"volume_type"` // CreationDate: the volume creation date CreationDate *time.Time `json:"creation_date"` // ModificationDate: the volume modification date ModificationDate *time.Time `json:"modification_date"` // Organization: the volume organization ID Organization string `json:"organization"` // Project: the volume project ID Project string `json:"project"` // Server: the server attached to the volume Server *ServerSummary `json:"server"` // State: the volume state // // Default value: available State VolumeState `json:"state"` // Zone: the zone in which is the volume Zone scw.Zone `json:"zone"` } type VolumeSummary struct { ID string `json:"id"` Name string `json:"name"` Size scw.Size `json:"size"` // VolumeType: // // Default value: l_ssd VolumeType VolumeVolumeType `json:"volume_type"` } // VolumeTemplate: volume template type VolumeTemplate struct { // ID: UUID of the volume ID string `json:"id,omitempty"` // Name: name of the volume Name string `json:"name,omitempty"` // Size: disk size of the volume Size scw.Size `json:"size,omitempty"` // VolumeType: type of the volume // // Default value: l_ssd VolumeType VolumeVolumeType `json:"volume_type,omitempty"` // Deprecated: Organization: organization ID of the volume // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: project ID of the volume // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` } type VolumeType struct { DisplayName string `json:"display_name"` Capabilities *VolumeTypeCapabilities `json:"capabilities"` Constraints *VolumeTypeConstraints `json:"constraints"` } type VolumeTypeCapabilities struct { Snapshot bool `json:"snapshot"` } type VolumeTypeConstraints struct { Min scw.Size `json:"min"` Max scw.Size `json:"max"` } // setImageResponse: set image response type setImageResponse struct { Image *Image `json:"image"` } // setSecurityGroupResponse: set security group response type setSecurityGroupResponse struct { SecurityGroup *SecurityGroup `json:"security_group"` } // setSecurityGroupRuleResponse: set security group rule response type setSecurityGroupRuleResponse struct { Rule *SecurityGroupRule `json:"rule"` } // setServerResponse: set server response type setServerResponse struct { Server *Server `json:"server"` } // setSnapshotResponse: set snapshot response type setSnapshotResponse struct { Snapshot *Snapshot `json:"snapshot"` } // Service API type GetServerTypesAvailabilityRequest struct { Zone scw.Zone `json:"-"` PerPage *uint32 `json:"-"` Page *int32 `json:"-"` } // GetServerTypesAvailability: get availability // // Get availibility for all server types. func (s *API) GetServerTypesAvailability(req *GetServerTypesAvailabilityRequest, opts ...scw.RequestOption) (*GetServerTypesAvailabilityResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/products/servers/availability", Query: query, Headers: http.Header{}, } var resp GetServerTypesAvailabilityResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListServersTypesRequest struct { Zone scw.Zone `json:"-"` PerPage *uint32 `json:"-"` Page *int32 `json:"-"` } // ListServersTypes: list server types // // Get server types technical details. func (s *API) ListServersTypes(req *ListServersTypesRequest, opts ...scw.RequestOption) (*ListServersTypesResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/products/servers", Query: query, Headers: http.Header{}, } var resp ListServersTypesResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListVolumesTypesRequest struct { Zone scw.Zone `json:"-"` PerPage *uint32 `json:"-"` Page *int32 `json:"-"` } // ListVolumesTypes: list volumes types // // Get volumes technical details. func (s *API) ListVolumesTypes(req *ListVolumesTypesRequest, opts ...scw.RequestOption) (*ListVolumesTypesResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/products/volumes", Query: query, Headers: http.Header{}, } var resp ListVolumesTypesResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListServersRequest struct { Zone scw.Zone `json:"-"` // PerPage: a positive integer lower or equal to 100 to select the number of items to return // // Default value: 50 PerPage *uint32 `json:"-"` // Page: a positive integer to choose the page to return Page *int32 `json:"-"` // Organization: list only servers of this organization ID Organization *string `json:"-"` // Project: list only servers of this project ID Project *string `json:"-"` // Name: filter servers by name (for eg. "server1" will return "server100" and "server1" but not "foo") Name *string `json:"-"` // PrivateIP: list servers by private_ip PrivateIP *net.IP `json:"-"` // WithoutIP: list servers that are not attached to a public IP WithoutIP *bool `json:"-"` // CommercialType: list servers of this commercial type CommercialType *string `json:"-"` // State: list servers in this state // // Default value: running State *ServerState `json:"-"` // Tags: list servers with these exact tags Tags []string `json:"-"` // PrivateNetwork: list servers in this Private Network PrivateNetwork *string `json:"-"` } // ListServers: list all servers func (s *API) ListServers(req *ListServersRequest, opts ...scw.RequestOption) (*ListServersResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "project", req.Project) parameter.AddToQuery(query, "name", req.Name) parameter.AddToQuery(query, "private_ip", req.PrivateIP) parameter.AddToQuery(query, "without_ip", req.WithoutIP) parameter.AddToQuery(query, "commercial_type", req.CommercialType) parameter.AddToQuery(query, "state", req.State) if len(req.Tags) != 0 { parameter.AddToQuery(query, "tags", strings.Join(req.Tags, ",")) } parameter.AddToQuery(query, "private_network", req.PrivateNetwork) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers", Query: query, Headers: http.Header{}, } var resp ListServersResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListServersResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListServersResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListServersResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.Servers = append(r.Servers, results.Servers...) r.TotalCount += uint32(len(results.Servers)) return uint32(len(results.Servers)), nil } type CreateServerRequest struct { Zone scw.Zone `json:"-"` // Name: the server name Name string `json:"name,omitempty"` // DynamicIPRequired: define if a dynamic IP is required for the instance DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"` // CommercialType: define the server commercial type (i.e. GP1-S) CommercialType string `json:"commercial_type,omitempty"` // Image: the server image ID or label Image string `json:"image,omitempty"` // Volumes: the volumes attached to the server Volumes map[string]*VolumeTemplate `json:"volumes,omitempty"` // EnableIPv6: true if IPv6 is enabled on the server EnableIPv6 bool `json:"enable_ipv6,omitempty"` // PublicIP: the ID of the reserved IP to attach to the server PublicIP *string `json:"public_ip,omitempty"` // BootType: the boot type to use // // Default value: local BootType *BootType `json:"boot_type,omitempty"` // Bootscript: the bootscript ID to use when `boot_type` is set to `bootscript` Bootscript *string `json:"bootscript,omitempty"` // Deprecated: Organization: the server organization ID // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: the server project ID // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` // Tags: the server tags Tags []string `json:"tags,omitempty"` // SecurityGroup: the security group ID SecurityGroup *string `json:"security_group,omitempty"` // PlacementGroup: placement group ID if server must be part of a placement group PlacementGroup *string `json:"placement_group,omitempty"` } // createServer: create a server func (s *API) createServer(req *CreateServerRequest, opts ...scw.RequestOption) (*CreateServerResponse, error) { var err error defaultProject, exist := s.client.GetDefaultProjectID() if exist && req.Organization == nil && req.Project == nil { req.Project = &defaultProject } defaultOrganization, exist := s.client.GetDefaultOrganizationID() if exist && req.Organization == nil && req.Project == nil { req.Organization = &defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if req.Name == "" { req.Name = namegenerator.GetRandomName("srv") } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreateServerResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteServerRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` } // DeleteServer: delete a server // // Delete a server with the given ID. func (s *API) DeleteServer(req *DeleteServerRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type GetServerRequest struct { Zone scw.Zone `json:"-"` // ServerID: UUID of the server you want to get ServerID string `json:"-"` } // GetServer: get a server // // Get the details of a specified Server. func (s *API) GetServer(req *GetServerRequest, opts ...scw.RequestOption) (*GetServerResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "", Headers: http.Header{}, } var resp GetServerResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type setServerRequest struct { Zone scw.Zone `json:"-"` // ID: the server unique ID ID string `json:"-"` // Name: the server name Name string `json:"name"` // Organization: the server organization ID Organization string `json:"organization"` // Project: the server project ID Project string `json:"project"` // AllowedActions: provide as list of allowed actions on the server AllowedActions []ServerAction `json:"allowed_actions"` // Tags: the server associated tags Tags []string `json:"tags"` // CommercialType: the server commercial type (eg. GP1-M) CommercialType string `json:"commercial_type"` // CreationDate: the server creation date CreationDate *time.Time `json:"creation_date"` // DynamicIPRequired: true if a dynamic IP is required DynamicIPRequired bool `json:"dynamic_ip_required"` // EnableIPv6: true if IPv6 is enabled EnableIPv6 bool `json:"enable_ipv6"` // Hostname: the server host name Hostname string `json:"hostname"` // Image: provide information on the server image Image *Image `json:"image"` // Protected: the server protection option is activated Protected bool `json:"protected"` // PrivateIP: the server private IP address PrivateIP *string `json:"private_ip"` // PublicIP: information about the public IP PublicIP *ServerIP `json:"public_ip"` // ModificationDate: the server modification date ModificationDate *time.Time `json:"modification_date"` // State: the server state // // Default value: running State ServerState `json:"state"` // Location: the server location Location *ServerLocation `json:"location"` // IPv6: the server IPv6 address IPv6 *ServerIPv6 `json:"ipv6"` // Bootscript: the server bootscript Bootscript *Bootscript `json:"bootscript"` // BootType: the server boot type // // Default value: local BootType BootType `json:"boot_type"` // Volumes: the server volumes Volumes map[string]*Volume `json:"volumes"` // SecurityGroup: the server security group SecurityGroup *SecurityGroupSummary `json:"security_group"` // Maintenances: the server planned maintenances Maintenances []*ServerMaintenance `json:"maintenances"` // StateDetail: the server state_detail StateDetail string `json:"state_detail"` // Arch: the server arch // // Default value: x86_64 Arch Arch `json:"arch"` // PlacementGroup: the server placement group PlacementGroup *PlacementGroup `json:"placement_group"` // PrivateNics: the server private NICs PrivateNics []*PrivateNIC `json:"private_nics"` } func (s *API) setServer(req *setServerRequest, opts ...scw.RequestOption) (*setServerResponse, error) { var err error if req.Project == "" { defaultProject, _ := s.client.GetDefaultProjectID() req.Project = defaultProject } if req.Organization == "" { defaultOrganization, _ := s.client.GetDefaultOrganizationID() req.Organization = defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ID) == "" { return nil, errors.New("field ID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PUT", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp setServerResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type UpdateServerRequest struct { Zone scw.Zone `json:"-"` // ServerID: UUID of the server ServerID string `json:"-"` // Name: name of the server Name *string `json:"name,omitempty"` // BootType: // // Default value: local BootType *BootType `json:"boot_type,omitempty"` // Tags: tags of the server Tags *[]string `json:"tags,omitempty"` Volumes *map[string]*VolumeTemplate `json:"volumes,omitempty"` Bootscript *string `json:"bootscript,omitempty"` DynamicIPRequired *bool `json:"dynamic_ip_required,omitempty"` EnableIPv6 *bool `json:"enable_ipv6,omitempty"` Protected *bool `json:"protected,omitempty"` SecurityGroup *SecurityGroupTemplate `json:"security_group,omitempty"` // PlacementGroup: placement group ID if server must be part of a placement group PlacementGroup *NullableStringValue `json:"placement_group,omitempty"` // PrivateNics: the server private NICs PrivateNics []*PrivateNIC `json:"private_nics,omitempty"` } // updateServer: update a server func (s *API) updateServer(req *UpdateServerRequest, opts ...scw.RequestOption) (*UpdateServerResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PATCH", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp UpdateServerResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListServerActionsRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` } // ListServerActions: list server actions // // Liste all actions that can currently be performed on a server. func (s *API) ListServerActions(req *ListServerActionsRequest, opts ...scw.RequestOption) (*ListServerActionsResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/action", Headers: http.Header{}, } var resp ListServerActionsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ServerActionRequest struct { Zone scw.Zone `json:"-"` // ServerID: UUID of the server ServerID string `json:"-"` // Action: the action to perform on the server // // Default value: poweron Action ServerAction `json:"action"` // Name: the name of the backup you want to create // // The name of the backup you want to create. // This field should only be specified when performing a backup action. // Name *string `json:"name,omitempty"` } // ServerAction: perform action // // Perform power related actions on a server. Be wary that when terminating a server, all the attached volumes (local *and* block storage) are deleted. So, if you want to keep your local volumes, you must use the `archive` action instead of `terminate`. And if you want to keep block-storage volumes, **you must** detach it beforehand you issue the `terminate` call. For more information, read the [Volumes](#volumes-7e8a39) documentation. func (s *API) ServerAction(req *ServerActionRequest, opts ...scw.RequestOption) (*ServerActionResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/action", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp ServerActionResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListServerUserDataRequest struct { Zone scw.Zone `json:"-"` // ServerID: UUID of the server ServerID string `json:"-"` } // ListServerUserData: list user data // // List all user data keys registered on a given server. func (s *API) ListServerUserData(req *ListServerUserDataRequest, opts ...scw.RequestOption) (*ListServerUserDataResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/user_data", Headers: http.Header{}, } var resp ListServerUserDataResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteServerUserDataRequest struct { Zone scw.Zone `json:"-"` // ServerID: UUID of the server ServerID string `json:"-"` // Key: key of the user data to delete Key string `json:"-"` } // DeleteServerUserData: delete user data // // Delete the given key from a server user data. func (s *API) DeleteServerUserData(req *DeleteServerUserDataRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return errors.New("field ServerID cannot be empty in request") } if fmt.Sprint(req.Key) == "" { return errors.New("field Key cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/user_data/" + fmt.Sprint(req.Key) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type ListImagesRequest struct { Zone scw.Zone `json:"-"` Organization *string `json:"-"` PerPage *uint32 `json:"-"` Page *int32 `json:"-"` Name *string `json:"-"` Public *bool `json:"-"` Arch *string `json:"-"` Project *string `json:"-"` } // ListImages: list instance images // // List all images available in an account. func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "name", req.Name) parameter.AddToQuery(query, "public", req.Public) parameter.AddToQuery(query, "arch", req.Arch) parameter.AddToQuery(query, "project", req.Project) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/images", Query: query, Headers: http.Header{}, } var resp ListImagesResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListImagesResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListImagesResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.Images = append(r.Images, results.Images...) r.TotalCount += uint32(len(results.Images)) return uint32(len(results.Images)), nil } type GetImageRequest struct { Zone scw.Zone `json:"-"` // ImageID: UUID of the image you want to get ImageID string `json:"-"` } // GetImage: get an instance image // // Get details of an image with the given ID. func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*GetImageResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ImageID) == "" { return nil, errors.New("field ImageID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/images/" + fmt.Sprint(req.ImageID) + "", Headers: http.Header{}, } var resp GetImageResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type CreateImageRequest struct { Zone scw.Zone `json:"-"` // Name: name of the image Name string `json:"name,omitempty"` // RootVolume: UUID of the snapshot RootVolume string `json:"root_volume,omitempty"` // Arch: architecture of the image // // Default value: x86_64 Arch Arch `json:"arch"` // DefaultBootscript: default bootscript of the image DefaultBootscript string `json:"default_bootscript,omitempty"` // ExtraVolumes: additional volumes of the image ExtraVolumes map[string]*VolumeTemplate `json:"extra_volumes,omitempty"` // Deprecated: Organization: organization ID of the image // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: project ID of the image // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` // Public: true to create a public image Public bool `json:"public,omitempty"` } // CreateImage: create an instance image func (s *API) CreateImage(req *CreateImageRequest, opts ...scw.RequestOption) (*CreateImageResponse, error) { var err error defaultProject, exist := s.client.GetDefaultProjectID() if exist && req.Organization == nil && req.Project == nil { req.Project = &defaultProject } defaultOrganization, exist := s.client.GetDefaultOrganizationID() if exist && req.Organization == nil && req.Project == nil { req.Organization = &defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if req.Name == "" { req.Name = namegenerator.GetRandomName("img") } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/images", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreateImageResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type SetImageRequest struct { Zone scw.Zone `json:"-"` ID string `json:"-"` Name string `json:"name"` // Arch: // // Default value: x86_64 Arch Arch `json:"arch"` CreationDate *time.Time `json:"creation_date"` ModificationDate *time.Time `json:"modification_date"` DefaultBootscript *Bootscript `json:"default_bootscript"` ExtraVolumes map[string]*Volume `json:"extra_volumes"` FromServer string `json:"from_server"` Organization string `json:"organization"` Public bool `json:"public"` RootVolume *VolumeSummary `json:"root_volume"` // State: // // Default value: available State ImageState `json:"state"` Project string `json:"project"` } // setImage: update image // // Replace all image properties with an image message. func (s *API) setImage(req *SetImageRequest, opts ...scw.RequestOption) (*setImageResponse, error) { var err error if req.Project == "" { defaultProject, _ := s.client.GetDefaultProjectID() req.Project = defaultProject } if req.Organization == "" { defaultOrganization, _ := s.client.GetDefaultOrganizationID() req.Organization = defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ID) == "" { return nil, errors.New("field ID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PUT", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/images/" + fmt.Sprint(req.ID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp setImageResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteImageRequest struct { Zone scw.Zone `json:"-"` // ImageID: UUID of the image you want to delete ImageID string `json:"-"` } // DeleteImage: delete an instance image // // Delete the image with the given ID. func (s *API) DeleteImage(req *DeleteImageRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ImageID) == "" { return errors.New("field ImageID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/images/" + fmt.Sprint(req.ImageID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type ListSnapshotsRequest struct { Zone scw.Zone `json:"-"` Organization *string `json:"-"` PerPage *uint32 `json:"-"` Page *int32 `json:"-"` Name *string `json:"-"` Project *string `json:"-"` } // ListSnapshots: list snapshots func (s *API) ListSnapshots(req *ListSnapshotsRequest, opts ...scw.RequestOption) (*ListSnapshotsResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "name", req.Name) parameter.AddToQuery(query, "project", req.Project) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/snapshots", Query: query, Headers: http.Header{}, } var resp ListSnapshotsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListSnapshotsResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListSnapshotsResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListSnapshotsResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.Snapshots = append(r.Snapshots, results.Snapshots...) r.TotalCount += uint32(len(results.Snapshots)) return uint32(len(results.Snapshots)), nil } type CreateSnapshotRequest struct { Zone scw.Zone `json:"-"` // Name: name of the snapshot Name string `json:"name,omitempty"` // VolumeID: UUID of the volume VolumeID string `json:"volume_id,omitempty"` // Deprecated: Organization: organization ID of the snapshot // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: project ID of the snapshot // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` } // CreateSnapshot: create a snapshot from a given volume func (s *API) CreateSnapshot(req *CreateSnapshotRequest, opts ...scw.RequestOption) (*CreateSnapshotResponse, error) { var err error defaultProject, exist := s.client.GetDefaultProjectID() if exist && req.Organization == nil && req.Project == nil { req.Project = &defaultProject } defaultOrganization, exist := s.client.GetDefaultOrganizationID() if exist && req.Organization == nil && req.Project == nil { req.Organization = &defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if req.Name == "" { req.Name = namegenerator.GetRandomName("snp") } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/snapshots", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreateSnapshotResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetSnapshotRequest struct { Zone scw.Zone `json:"-"` // SnapshotID: UUID of the snapshot you want to get SnapshotID string `json:"-"` } // GetSnapshot: get a snapshot // // Get details of a snapshot with the given ID. func (s *API) GetSnapshot(req *GetSnapshotRequest, opts ...scw.RequestOption) (*GetSnapshotResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SnapshotID) == "" { return nil, errors.New("field SnapshotID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/snapshots/" + fmt.Sprint(req.SnapshotID) + "", Headers: http.Header{}, } var resp GetSnapshotResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type SetSnapshotRequest struct { Zone scw.Zone `json:"-"` ID string `json:"-"` Name string `json:"name"` Organization string `json:"organization"` // VolumeType: // // Default value: l_ssd VolumeType VolumeVolumeType `json:"volume_type"` Size scw.Size `json:"size"` // State: // // Default value: available State SnapshotState `json:"state"` BaseVolume *SnapshotBaseVolume `json:"base_volume"` CreationDate *time.Time `json:"creation_date"` ModificationDate *time.Time `json:"modification_date"` Project string `json:"project"` } // setSnapshot: update snapshot // // Replace all snapshot properties with a snapshot message. func (s *API) setSnapshot(req *SetSnapshotRequest, opts ...scw.RequestOption) (*setSnapshotResponse, error) { var err error if req.Project == "" { defaultProject, _ := s.client.GetDefaultProjectID() req.Project = defaultProject } if req.Organization == "" { defaultOrganization, _ := s.client.GetDefaultOrganizationID() req.Organization = defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ID) == "" { return nil, errors.New("field ID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PUT", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/snapshots/" + fmt.Sprint(req.ID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp setSnapshotResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteSnapshotRequest struct { Zone scw.Zone `json:"-"` // SnapshotID: UUID of the snapshot you want to delete SnapshotID string `json:"-"` } // DeleteSnapshot: delete a snapshot // // Delete the snapshot with the given ID. func (s *API) DeleteSnapshot(req *DeleteSnapshotRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SnapshotID) == "" { return errors.New("field SnapshotID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/snapshots/" + fmt.Sprint(req.SnapshotID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type ListVolumesRequest struct { Zone scw.Zone `json:"-"` // VolumeType: filter by volume type // // Default value: l_ssd VolumeType *VolumeVolumeType `json:"-"` // PerPage: a positive integer lower or equal to 100 to select the number of items to return // // Default value: 50 PerPage *uint32 `json:"-"` // Page: a positive integer to choose the page to return Page *int32 `json:"-"` // Organization: filter volume by organization ID Organization *string `json:"-"` // Project: filter volume by project ID Project *string `json:"-"` // Name: filter volume by name (for eg. "vol" will return "myvolume" but not "data") Name *string `json:"-"` } // ListVolumes: list volumes func (s *API) ListVolumes(req *ListVolumesRequest, opts ...scw.RequestOption) (*ListVolumesResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "volume_type", req.VolumeType) parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "project", req.Project) parameter.AddToQuery(query, "name", req.Name) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/volumes", Query: query, Headers: http.Header{}, } var resp ListVolumesResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListVolumesResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListVolumesResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListVolumesResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.Volumes = append(r.Volumes, results.Volumes...) r.TotalCount += uint32(len(results.Volumes)) return uint32(len(results.Volumes)), nil } type CreateVolumeRequest struct { Zone scw.Zone `json:"-"` // Name: the volume name Name string `json:"name,omitempty"` // Deprecated: Organization: the volume organization ID // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: the volume project ID // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` // VolumeType: the volume type // // Default value: l_ssd VolumeType VolumeVolumeType `json:"volume_type"` // Size: the volume disk size // Precisely one of BaseSnapshot, BaseVolume, Size must be set. Size *scw.Size `json:"size,omitempty"` // BaseVolume: the ID of the volume on which this volume will be based // Precisely one of BaseSnapshot, BaseVolume, Size must be set. BaseVolume *string `json:"base_volume,omitempty"` // BaseSnapshot: the ID of the snapshot on which this volume will be based // Precisely one of BaseSnapshot, BaseVolume, Size must be set. BaseSnapshot *string `json:"base_snapshot,omitempty"` } // CreateVolume: create a volume func (s *API) CreateVolume(req *CreateVolumeRequest, opts ...scw.RequestOption) (*CreateVolumeResponse, error) { var err error defaultProject, exist := s.client.GetDefaultProjectID() if exist && req.Organization == nil && req.Project == nil { req.Project = &defaultProject } defaultOrganization, exist := s.client.GetDefaultOrganizationID() if exist && req.Organization == nil && req.Project == nil { req.Organization = &defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/volumes", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreateVolumeResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetVolumeRequest struct { Zone scw.Zone `json:"-"` // VolumeID: UUID of the volume you want to get VolumeID string `json:"-"` } // GetVolume: get a volume // // Get details of a volume with the given ID. func (s *API) GetVolume(req *GetVolumeRequest, opts ...scw.RequestOption) (*GetVolumeResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.VolumeID) == "" { return nil, errors.New("field VolumeID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/volumes/" + fmt.Sprint(req.VolumeID) + "", Headers: http.Header{}, } var resp GetVolumeResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type UpdateVolumeRequest struct { Zone scw.Zone `json:"-"` // VolumeID: UUID of the volume VolumeID string `json:"-"` // Name: the volume name Name *string `json:"name,omitempty"` // Size: the volume disk size Size *scw.Size `json:"size,omitempty"` } // UpdateVolume: update a volume // // Replace name and/or size properties of given ID volume with the given value(s). Any volume name can be changed while, for now, only `b_ssd` volume growing is supported. func (s *API) UpdateVolume(req *UpdateVolumeRequest, opts ...scw.RequestOption) (*UpdateVolumeResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.VolumeID) == "" { return nil, errors.New("field VolumeID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PATCH", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/volumes/" + fmt.Sprint(req.VolumeID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp UpdateVolumeResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteVolumeRequest struct { Zone scw.Zone `json:"-"` // VolumeID: UUID of the volume you want to delete VolumeID string `json:"-"` } // DeleteVolume: delete a volume // // Delete the volume with the given ID. func (s *API) DeleteVolume(req *DeleteVolumeRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.VolumeID) == "" { return errors.New("field VolumeID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/volumes/" + fmt.Sprint(req.VolumeID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type ListSecurityGroupsRequest struct { Zone scw.Zone `json:"-"` // Name: name of the security group Name *string `json:"-"` // Organization: the security group organization ID Organization *string `json:"-"` // Project: the security group project ID Project *string `json:"-"` // PerPage: a positive integer lower or equal to 100 to select the number of items to return // // Default value: 50 PerPage *uint32 `json:"-"` // Page: a positive integer to choose the page to return Page *int32 `json:"-"` } // ListSecurityGroups: list security groups // // List all security groups available in an account. func (s *API) ListSecurityGroups(req *ListSecurityGroupsRequest, opts ...scw.RequestOption) (*ListSecurityGroupsResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "name", req.Name) parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "project", req.Project) parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups", Query: query, Headers: http.Header{}, } var resp ListSecurityGroupsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListSecurityGroupsResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListSecurityGroupsResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListSecurityGroupsResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.SecurityGroups = append(r.SecurityGroups, results.SecurityGroups...) r.TotalCount += uint32(len(results.SecurityGroups)) return uint32(len(results.SecurityGroups)), nil } type CreateSecurityGroupRequest struct { Zone scw.Zone `json:"-"` // Name: name of the security group Name string `json:"name,omitempty"` // Description: description of the security group Description string `json:"description,omitempty"` // Deprecated: Organization: organization ID the security group belongs to // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: project ID the security group belong to // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` // Deprecated: OrganizationDefault: whether this security group becomes the default security group for new instances // // Default value: false // Precisely one of OrganizationDefault, ProjectDefault must be set. OrganizationDefault *bool `json:"organization_default,omitempty"` // ProjectDefault: whether this security group becomes the default security group for new instances // // Default value: false // Precisely one of OrganizationDefault, ProjectDefault must be set. ProjectDefault *bool `json:"project_default,omitempty"` // Stateful: whether the security group is stateful or not // // Default value: false Stateful bool `json:"stateful,omitempty"` // InboundDefaultPolicy: default policy for inbound rules // // Default value: accept InboundDefaultPolicy SecurityGroupPolicy `json:"inbound_default_policy"` // OutboundDefaultPolicy: default policy for outbound rules // // Default value: accept OutboundDefaultPolicy SecurityGroupPolicy `json:"outbound_default_policy"` } // CreateSecurityGroup: create a security group func (s *API) CreateSecurityGroup(req *CreateSecurityGroupRequest, opts ...scw.RequestOption) (*CreateSecurityGroupResponse, error) { var err error defaultProject, exist := s.client.GetDefaultProjectID() if exist && req.Organization == nil && req.Project == nil { req.Project = &defaultProject } defaultOrganization, exist := s.client.GetDefaultOrganizationID() if exist && req.Organization == nil && req.Project == nil { req.Organization = &defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if req.Name == "" { req.Name = namegenerator.GetRandomName("sg") } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreateSecurityGroupResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetSecurityGroupRequest struct { Zone scw.Zone `json:"-"` // SecurityGroupID: UUID of the security group you want to get SecurityGroupID string `json:"-"` } // GetSecurityGroup: get a security group // // Get the details of a Security Group with the given ID. func (s *API) GetSecurityGroup(req *GetSecurityGroupRequest, opts ...scw.RequestOption) (*GetSecurityGroupResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return nil, errors.New("field SecurityGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.SecurityGroupID) + "", Headers: http.Header{}, } var resp GetSecurityGroupResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteSecurityGroupRequest struct { Zone scw.Zone `json:"-"` // SecurityGroupID: UUID of the security group you want to delete SecurityGroupID string `json:"-"` } // DeleteSecurityGroup: delete a security group func (s *API) DeleteSecurityGroup(req *DeleteSecurityGroupRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return errors.New("field SecurityGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.SecurityGroupID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type setSecurityGroupRequest struct { Zone scw.Zone `json:"-"` // ID: the ID of the security group (will be ignored) ID string `json:"-"` // Name: the name of the security group Name string `json:"name"` // CreationDate: the creation date of the security group (will be ignored) CreationDate *time.Time `json:"creation_date"` // ModificationDate: the modification date of the security group (will be ignored) ModificationDate *time.Time `json:"modification_date"` // Description: the description of the security group Description string `json:"description"` // EnableDefaultSecurity: true to block SMTP on IPv4 and IPv6 EnableDefaultSecurity bool `json:"enable_default_security"` // InboundDefaultPolicy: the default inbound policy // // Default value: accept InboundDefaultPolicy SecurityGroupPolicy `json:"inbound_default_policy"` // OutboundDefaultPolicy: the default outbound policy // // Default value: accept OutboundDefaultPolicy SecurityGroupPolicy `json:"outbound_default_policy"` // Organization: the security groups organization ID Organization string `json:"organization"` // Project: the security group project ID Project string `json:"project"` // Deprecated: OrganizationDefault: please use project_default instead OrganizationDefault bool `json:"organization_default"` // ProjectDefault: true use this security group for future instances created in this project ProjectDefault bool `json:"project_default"` // Servers: the servers attached to this security group Servers []*ServerSummary `json:"servers"` // Stateful: true to set the security group as stateful Stateful bool `json:"stateful"` } // setSecurityGroup: update a security group // // Replace all security group properties with a security group message. func (s *API) setSecurityGroup(req *setSecurityGroupRequest, opts ...scw.RequestOption) (*setSecurityGroupResponse, error) { var err error if req.Project == "" { defaultProject, _ := s.client.GetDefaultProjectID() req.Project = defaultProject } if req.Organization == "" { defaultOrganization, _ := s.client.GetDefaultOrganizationID() req.Organization = defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ID) == "" { return nil, errors.New("field ID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PUT", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.ID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp setSecurityGroupResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListSecurityGroupRulesRequest struct { Zone scw.Zone `json:"-"` // SecurityGroupID: UUID of the security group SecurityGroupID string `json:"-"` // PerPage: a positive integer lower or equal to 100 to select the number of items to return // // Default value: 50 PerPage *uint32 `json:"-"` // Page: a positive integer to choose the page to return Page *int32 `json:"-"` } // ListSecurityGroupRules: list rules func (s *API) ListSecurityGroupRules(req *ListSecurityGroupRulesRequest, opts ...scw.RequestOption) (*ListSecurityGroupRulesResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return nil, errors.New("field SecurityGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.SecurityGroupID) + "/rules", Query: query, Headers: http.Header{}, } var resp ListSecurityGroupRulesResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListSecurityGroupRulesResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListSecurityGroupRulesResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListSecurityGroupRulesResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.Rules = append(r.Rules, results.Rules...) r.TotalCount += uint32(len(results.Rules)) return uint32(len(results.Rules)), nil } type CreateSecurityGroupRuleRequest struct { Zone scw.Zone `json:"-"` // SecurityGroupID: UUID of the security group SecurityGroupID string `json:"-"` // Protocol: // // Default value: TCP Protocol SecurityGroupRuleProtocol `json:"protocol"` // Direction: // // Default value: inbound Direction SecurityGroupRuleDirection `json:"direction"` // Action: // // Default value: accept Action SecurityGroupRuleAction `json:"action"` IPRange scw.IPNet `json:"ip_range,omitempty"` DestPortFrom *uint32 `json:"dest_port_from,omitempty"` DestPortTo *uint32 `json:"dest_port_to,omitempty"` Position uint32 `json:"position,omitempty"` Editable bool `json:"editable,omitempty"` } // CreateSecurityGroupRule: create rule func (s *API) CreateSecurityGroupRule(req *CreateSecurityGroupRuleRequest, opts ...scw.RequestOption) (*CreateSecurityGroupRuleResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return nil, errors.New("field SecurityGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.SecurityGroupID) + "/rules", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreateSecurityGroupRuleResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteSecurityGroupRuleRequest struct { Zone scw.Zone `json:"-"` SecurityGroupID string `json:"-"` SecurityGroupRuleID string `json:"-"` } // DeleteSecurityGroupRule: delete rule // // Delete a security group rule with the given ID. func (s *API) DeleteSecurityGroupRule(req *DeleteSecurityGroupRuleRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return errors.New("field SecurityGroupID cannot be empty in request") } if fmt.Sprint(req.SecurityGroupRuleID) == "" { return errors.New("field SecurityGroupRuleID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.SecurityGroupID) + "/rules/" + fmt.Sprint(req.SecurityGroupRuleID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type GetSecurityGroupRuleRequest struct { Zone scw.Zone `json:"-"` SecurityGroupID string `json:"-"` SecurityGroupRuleID string `json:"-"` } // GetSecurityGroupRule: get rule // // Get details of a security group rule with the given ID. func (s *API) GetSecurityGroupRule(req *GetSecurityGroupRuleRequest, opts ...scw.RequestOption) (*GetSecurityGroupRuleResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return nil, errors.New("field SecurityGroupID cannot be empty in request") } if fmt.Sprint(req.SecurityGroupRuleID) == "" { return nil, errors.New("field SecurityGroupRuleID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.SecurityGroupID) + "/rules/" + fmt.Sprint(req.SecurityGroupRuleID) + "", Headers: http.Header{}, } var resp GetSecurityGroupRuleResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type setSecurityGroupRuleRequest struct { Zone scw.Zone `json:"-"` SecurityGroupID string `json:"-"` SecurityGroupRuleID string `json:"-"` ID string `json:"id"` // Protocol: // // Default value: TCP Protocol SecurityGroupRuleProtocol `json:"protocol"` // Direction: // // Default value: inbound Direction SecurityGroupRuleDirection `json:"direction"` // Action: // // Default value: accept Action SecurityGroupRuleAction `json:"action"` IPRange scw.IPNet `json:"ip_range"` DestPortFrom *uint32 `json:"dest_port_from"` DestPortTo *uint32 `json:"dest_port_to"` Position uint32 `json:"position"` Editable bool `json:"editable"` } // setSecurityGroupRule: update security group rule func (s *API) setSecurityGroupRule(req *setSecurityGroupRuleRequest, opts ...scw.RequestOption) (*setSecurityGroupRuleResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return nil, errors.New("field SecurityGroupID cannot be empty in request") } if fmt.Sprint(req.SecurityGroupRuleID) == "" { return nil, errors.New("field SecurityGroupRuleID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PUT", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/security_groups/" + fmt.Sprint(req.SecurityGroupID) + "/rules/" + fmt.Sprint(req.SecurityGroupRuleID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp setSecurityGroupRuleResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListPlacementGroupsRequest struct { Zone scw.Zone `json:"-"` // PerPage: a positive integer lower or equal to 100 to select the number of items to return // // Default value: 50 PerPage *uint32 `json:"-"` // Page: a positive integer to choose the page to return Page *int32 `json:"-"` // Organization: list only placement groups of this organization ID Organization *string `json:"-"` // Project: list only placement groups of this project ID Project *string `json:"-"` // Name: filter placement groups by name (for eg. "cluster1" will return "cluster100" and "cluster1" but not "foo") Name *string `json:"-"` } // ListPlacementGroups: list placement groups // // List all placement groups. func (s *API) ListPlacementGroups(req *ListPlacementGroupsRequest, opts ...scw.RequestOption) (*ListPlacementGroupsResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "project", req.Project) parameter.AddToQuery(query, "name", req.Name) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups", Query: query, Headers: http.Header{}, } var resp ListPlacementGroupsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListPlacementGroupsResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListPlacementGroupsResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListPlacementGroupsResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.PlacementGroups = append(r.PlacementGroups, results.PlacementGroups...) r.TotalCount += uint32(len(results.PlacementGroups)) return uint32(len(results.PlacementGroups)), nil } type CreatePlacementGroupRequest struct { Zone scw.Zone `json:"-"` // Name: name of the placement group Name string `json:"name,omitempty"` // Deprecated: Organization: organization ID of the placement group // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: project ID of the placement group // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` // PolicyMode: the operating mode of the placement group // // Default value: optional PolicyMode PlacementGroupPolicyMode `json:"policy_mode"` // PolicyType: the policy type of the placement group // // Default value: max_availability PolicyType PlacementGroupPolicyType `json:"policy_type"` } // CreatePlacementGroup: create a placement group // // Create a new placement group. func (s *API) CreatePlacementGroup(req *CreatePlacementGroupRequest, opts ...scw.RequestOption) (*CreatePlacementGroupResponse, error) { var err error defaultProject, exist := s.client.GetDefaultProjectID() if exist && req.Organization == nil && req.Project == nil { req.Project = &defaultProject } defaultOrganization, exist := s.client.GetDefaultOrganizationID() if exist && req.Organization == nil && req.Project == nil { req.Organization = &defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if req.Name == "" { req.Name = namegenerator.GetRandomName("pg") } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreatePlacementGroupResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetPlacementGroupRequest struct { Zone scw.Zone `json:"-"` // PlacementGroupID: UUID of the placement group you want to get PlacementGroupID string `json:"-"` } // GetPlacementGroup: get a placement group // // Get the given placement group. func (s *API) GetPlacementGroup(req *GetPlacementGroupRequest, opts ...scw.RequestOption) (*GetPlacementGroupResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.PlacementGroupID) == "" { return nil, errors.New("field PlacementGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups/" + fmt.Sprint(req.PlacementGroupID) + "", Headers: http.Header{}, } var resp GetPlacementGroupResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type SetPlacementGroupRequest struct { Zone scw.Zone `json:"-"` PlacementGroupID string `json:"-"` Name string `json:"name"` Organization string `json:"organization"` // PolicyMode: // // Default value: optional PolicyMode PlacementGroupPolicyMode `json:"policy_mode"` // PolicyType: // // Default value: max_availability PolicyType PlacementGroupPolicyType `json:"policy_type"` Project string `json:"project"` } // SetPlacementGroup: set placement group // // Set all parameters of the given placement group. func (s *API) SetPlacementGroup(req *SetPlacementGroupRequest, opts ...scw.RequestOption) (*SetPlacementGroupResponse, error) { var err error if req.Project == "" { defaultProject, _ := s.client.GetDefaultProjectID() req.Project = defaultProject } if req.Organization == "" { defaultOrganization, _ := s.client.GetDefaultOrganizationID() req.Organization = defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.PlacementGroupID) == "" { return nil, errors.New("field PlacementGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PUT", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups/" + fmt.Sprint(req.PlacementGroupID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp SetPlacementGroupResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type UpdatePlacementGroupRequest struct { Zone scw.Zone `json:"-"` // PlacementGroupID: UUID of the placement group PlacementGroupID string `json:"-"` // Name: name of the placement group Name *string `json:"name,omitempty"` // PolicyMode: // // Default value: optional PolicyMode PlacementGroupPolicyMode `json:"policy_mode"` // PolicyType: // // Default value: max_availability PolicyType PlacementGroupPolicyType `json:"policy_type"` } // UpdatePlacementGroup: update a placement group // // Update one or more parameter of the given placement group. func (s *API) UpdatePlacementGroup(req *UpdatePlacementGroupRequest, opts ...scw.RequestOption) (*UpdatePlacementGroupResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.PlacementGroupID) == "" { return nil, errors.New("field PlacementGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PATCH", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups/" + fmt.Sprint(req.PlacementGroupID) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp UpdatePlacementGroupResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeletePlacementGroupRequest struct { Zone scw.Zone `json:"-"` // PlacementGroupID: UUID of the placement group you want to delete PlacementGroupID string `json:"-"` } // DeletePlacementGroup: delete the given placement group // // Delete the given placement group. func (s *API) DeletePlacementGroup(req *DeletePlacementGroupRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.PlacementGroupID) == "" { return errors.New("field PlacementGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups/" + fmt.Sprint(req.PlacementGroupID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type GetPlacementGroupServersRequest struct { Zone scw.Zone `json:"-"` PlacementGroupID string `json:"-"` } // GetPlacementGroupServers: get placement group servers // // Get all servers belonging to the given placement group. func (s *API) GetPlacementGroupServers(req *GetPlacementGroupServersRequest, opts ...scw.RequestOption) (*GetPlacementGroupServersResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.PlacementGroupID) == "" { return nil, errors.New("field PlacementGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups/" + fmt.Sprint(req.PlacementGroupID) + "/servers", Headers: http.Header{}, } var resp GetPlacementGroupServersResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type SetPlacementGroupServersRequest struct { Zone scw.Zone `json:"-"` PlacementGroupID string `json:"-"` Servers []string `json:"servers"` } // SetPlacementGroupServers: set placement group servers // // Set all servers belonging to the given placement group. func (s *API) SetPlacementGroupServers(req *SetPlacementGroupServersRequest, opts ...scw.RequestOption) (*SetPlacementGroupServersResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.PlacementGroupID) == "" { return nil, errors.New("field PlacementGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PUT", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups/" + fmt.Sprint(req.PlacementGroupID) + "/servers", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp SetPlacementGroupServersResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type UpdatePlacementGroupServersRequest struct { Zone scw.Zone `json:"-"` // PlacementGroupID: UUID of the placement group PlacementGroupID string `json:"-"` Servers []string `json:"servers,omitempty"` } // UpdatePlacementGroupServers: update placement group servers // // Update all servers belonging to the given placement group. func (s *API) UpdatePlacementGroupServers(req *UpdatePlacementGroupServersRequest, opts ...scw.RequestOption) (*UpdatePlacementGroupServersResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.PlacementGroupID) == "" { return nil, errors.New("field PlacementGroupID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PATCH", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/placement_groups/" + fmt.Sprint(req.PlacementGroupID) + "/servers", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp UpdatePlacementGroupServersResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListIPsRequest struct { Zone scw.Zone `json:"-"` // Organization: the organization ID the IPs are reserved in Organization *string `json:"-"` // Name: filter on the IP address (Works as a LIKE operation on the IP address) Name *string `json:"-"` // PerPage: a positive integer lower or equal to 100 to select the number of items to return // // Default value: 50 PerPage *uint32 `json:"-"` // Page: a positive integer to choose the page to return Page *int32 `json:"-"` // Project: the project ID the IPs are reserved in Project *string `json:"-"` } // ListIPs: list all flexible IPs func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIPsResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "name", req.Name) parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) parameter.AddToQuery(query, "project", req.Project) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/ips", Query: query, Headers: http.Header{}, } var resp ListIPsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListIPsResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListIPsResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListIPsResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.IPs = append(r.IPs, results.IPs...) r.TotalCount += uint32(len(results.IPs)) return uint32(len(results.IPs)), nil } type CreateIPRequest struct { Zone scw.Zone `json:"-"` // Deprecated: Organization: the organization ID the IP is reserved in // Precisely one of Organization, Project must be set. Organization *string `json:"organization,omitempty"` // Project: the project ID the IP is reserved in // Precisely one of Organization, Project must be set. Project *string `json:"project,omitempty"` // Server: UUID of the server you want to attach the IP to Server *string `json:"server,omitempty"` // Tags: an array of keywords you want to tag this IP with Tags []string `json:"tags,omitempty"` } // CreateIP: reserve a flexible IP func (s *API) CreateIP(req *CreateIPRequest, opts ...scw.RequestOption) (*CreateIPResponse, error) { var err error defaultProject, exist := s.client.GetDefaultProjectID() if exist && req.Organization == nil && req.Project == nil { req.Project = &defaultProject } defaultOrganization, exist := s.client.GetDefaultOrganizationID() if exist && req.Organization == nil && req.Project == nil { req.Organization = &defaultOrganization } if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/ips", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreateIPResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetIPRequest struct { Zone scw.Zone `json:"-"` // IP: the IP ID or address to get IP string `json:"-"` } // GetIP: get a flexible IP // // Get details of an IP with the given ID or address. func (s *API) GetIP(req *GetIPRequest, opts ...scw.RequestOption) (*GetIPResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.IP) == "" { return nil, errors.New("field IP cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/ips/" + fmt.Sprint(req.IP) + "", Headers: http.Header{}, } var resp GetIPResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type UpdateIPRequest struct { Zone scw.Zone `json:"-"` // IP: IP ID or IP address IP string `json:"-"` // Reverse: reverse domain name Reverse *NullableStringValue `json:"reverse,omitempty"` // Tags: an array of keywords you want to tag this IP with Tags *[]string `json:"tags,omitempty"` Server *NullableStringValue `json:"server,omitempty"` } // UpdateIP: update a flexible IP func (s *API) UpdateIP(req *UpdateIPRequest, opts ...scw.RequestOption) (*UpdateIPResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.IP) == "" { return nil, errors.New("field IP cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "PATCH", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/ips/" + fmt.Sprint(req.IP) + "", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp UpdateIPResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeleteIPRequest struct { Zone scw.Zone `json:"-"` // IP: the ID or the address of the IP to delete IP string `json:"-"` } // DeleteIP: delete a flexible IP // // Delete the IP with the given ID. func (s *API) DeleteIP(req *DeleteIPRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.IP) == "" { return errors.New("field IP cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/ips/" + fmt.Sprint(req.IP) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type ListPrivateNICsRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` } // ListPrivateNICs: list all private NICs // // List all private NICs of a given server. func (s *API) ListPrivateNICs(req *ListPrivateNICsRequest, opts ...scw.RequestOption) (*ListPrivateNICsResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/private_nics", Headers: http.Header{}, } var resp ListPrivateNICsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type CreatePrivateNICRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` PrivateNetworkID string `json:"private_network_id,omitempty"` } // CreatePrivateNIC: create a private NIC connecting a server to a private network // // Create a private NIC connecting a server to a private network. func (s *API) CreatePrivateNIC(req *CreatePrivateNICRequest, opts ...scw.RequestOption) (*CreatePrivateNICResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "POST", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/private_nics", Headers: http.Header{}, } err = scwReq.SetBody(req) if err != nil { return nil, err } var resp CreatePrivateNICResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetPrivateNICRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` PrivateNicID string `json:"-"` } // GetPrivateNIC: get a private NIC // // Get private NIC properties. func (s *API) GetPrivateNIC(req *GetPrivateNICRequest, opts ...scw.RequestOption) (*GetPrivateNICResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } if fmt.Sprint(req.PrivateNicID) == "" { return nil, errors.New("field PrivateNicID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/private_nics/" + fmt.Sprint(req.PrivateNicID) + "", Headers: http.Header{}, } var resp GetPrivateNICResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type DeletePrivateNICRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` PrivateNicID string `json:"-"` } // DeletePrivateNIC: delete a private NIC // // Delete a private NIC. func (s *API) DeletePrivateNIC(req *DeletePrivateNICRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return errors.New("field ServerID cannot be empty in request") } if fmt.Sprint(req.PrivateNicID) == "" { return errors.New("field PrivateNicID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "DELETE", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/private_nics/" + fmt.Sprint(req.PrivateNicID) + "", Headers: http.Header{}, } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } type ListBootscriptsRequest struct { Zone scw.Zone `json:"-"` Arch *string `json:"-"` Title *string `json:"-"` Default *bool `json:"-"` Public *bool `json:"-"` PerPage *uint32 `json:"-"` Page *int32 `json:"-"` } // ListBootscripts: list bootscripts func (s *API) ListBootscripts(req *ListBootscriptsRequest, opts ...scw.RequestOption) (*ListBootscriptsResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "arch", req.Arch) parameter.AddToQuery(query, "title", req.Title) parameter.AddToQuery(query, "default", req.Default) parameter.AddToQuery(query, "public", req.Public) parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/bootscripts", Query: query, Headers: http.Header{}, } var resp ListBootscriptsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListBootscriptsResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListBootscriptsResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListBootscriptsResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.Bootscripts = append(r.Bootscripts, results.Bootscripts...) r.TotalCount += uint32(len(results.Bootscripts)) return uint32(len(results.Bootscripts)), nil } type GetBootscriptRequest struct { Zone scw.Zone `json:"-"` BootscriptID string `json:"-"` } // GetBootscript: get bootscripts // // Get details of a bootscript with the given ID. func (s *API) GetBootscript(req *GetBootscriptRequest, opts ...scw.RequestOption) (*GetBootscriptResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.BootscriptID) == "" { return nil, errors.New("field BootscriptID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/bootscripts/" + fmt.Sprint(req.BootscriptID) + "", Headers: http.Header{}, } var resp GetBootscriptResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetDashboardRequest struct { Zone scw.Zone `json:"-"` Organization *string `json:"-"` Project *string `json:"-"` } func (s *API) GetDashboard(req *GetDashboardRequest, opts ...scw.RequestOption) (*GetDashboardResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } query := url.Values{} parameter.AddToQuery(query, "organization", req.Organization) parameter.AddToQuery(query, "project", req.Project) if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/dashboard", Query: query, Headers: http.Header{}, } var resp GetDashboardResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/instance_utils.go�������0000664�0000000�0000000�00000021071�13771713062�0032100�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package instance import ( "encoding/json" "fmt" "sync" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/scw" ) var ( resourceLock sync.Map ) // lockResource locks a resource from a specific resourceID func lockResource(resourceID string) *sync.Mutex { v, _ := resourceLock.LoadOrStore(resourceID, &sync.Mutex{}) mutex := v.(*sync.Mutex) mutex.Lock() return mutex } // lockServer locks a server from its zone and its ID func lockServer(zone scw.Zone, serverID string) *sync.Mutex { return lockResource(fmt.Sprint("server", zone, serverID)) } // AttachIPRequest contains the parameters to attach an IP to a server // // Deprecated: UpdateIPRequest should be used instead type AttachIPRequest struct { Zone scw.Zone `json:"-"` IP string `json:"-"` ServerID string `json:"server_id"` } // AttachIPResponse contains the updated IP after attaching // // Deprecated: UpdateIPResponse should be used instead type AttachIPResponse struct { IP *IP } // AttachIP attaches an IP to a server. // // Deprecated: UpdateIP() should be used instead func (s *API) AttachIP(req *AttachIPRequest, opts ...scw.RequestOption) (*AttachIPResponse, error) { ipResponse, err := s.UpdateIP(&UpdateIPRequest{ Zone: req.Zone, IP: req.IP, Server: &NullableStringValue{Value: req.ServerID}, }) if err != nil { return nil, err } return &AttachIPResponse{IP: ipResponse.IP}, nil } // DetachIPRequest contains the parameters to detach an IP from a server // // Deprecated: UpdateIPRequest should be used instead type DetachIPRequest struct { Zone scw.Zone `json:"-"` IP string `json:"-"` } // DetachIPResponse contains the updated IP after detaching // // Deprecated: UpdateIPResponse should be used instead type DetachIPResponse struct { IP *IP } // DetachIP detaches an IP from a server. // // Deprecated: UpdateIP() should be used instead func (s *API) DetachIP(req *DetachIPRequest, opts ...scw.RequestOption) (*DetachIPResponse, error) { ipResponse, err := s.UpdateIP(&UpdateIPRequest{ Zone: req.Zone, IP: req.IP, Server: &NullableStringValue{Null: true}, }) if err != nil { return nil, err } return &DetachIPResponse{IP: ipResponse.IP}, nil } // AttachVolumeRequest contains the parameters to attach a volume to a server type AttachVolumeRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` VolumeID string `json:"-"` } // AttachVolumeResponse contains the updated server after attaching a volume type AttachVolumeResponse struct { Server *Server `json:"-"` } // volumesToVolumeTemplates converts a map of *Volume to a map of *VolumeTemplate // so it can be used in a UpdateServer request func volumesToVolumeTemplates(volumes map[string]*Volume) map[string]*VolumeTemplate { volumeTemplates := map[string]*VolumeTemplate{} for key, volume := range volumes { volumeTemplates[key] = &VolumeTemplate{ID: volume.ID, Name: volume.Name} } return volumeTemplates } // AttachVolume attaches a volume to a server // // Note: Implementation is thread-safe. func (s *API) AttachVolume(req *AttachVolumeRequest, opts ...scw.RequestOption) (*AttachVolumeResponse, error) { defer lockServer(req.Zone, req.ServerID).Unlock() // get server with volumes getServerResponse, err := s.GetServer(&GetServerRequest{ Zone: req.Zone, ServerID: req.ServerID, }) if err != nil { return nil, err } volumes := getServerResponse.Server.Volumes newVolumes := volumesToVolumeTemplates(volumes) // add volume to volumes list // We loop through all the possible volume keys (0 to len(volumes)) // to find a non existing key and assign it to the requested volume. // A key should always be found. However we return an error if no keys were found. found := false for i := 0; i <= len(volumes); i++ { key := fmt.Sprintf("%d", i) if _, ok := newVolumes[key]; !ok { newVolumes[key] = &VolumeTemplate{ ID: req.VolumeID, // name is ignored on this PATCH Name: req.VolumeID, } found = true break } } if !found { return nil, fmt.Errorf("could not find key to attach volume %s", req.VolumeID) } // update server updateServerResponse, err := s.updateServer(&UpdateServerRequest{ Zone: req.Zone, ServerID: req.ServerID, Volumes: &newVolumes, }) if err != nil { return nil, err } return &AttachVolumeResponse{Server: updateServerResponse.Server}, nil } // DetachVolumeRequest contains the parameters to detach a volume from a server type DetachVolumeRequest struct { Zone scw.Zone `json:"-"` VolumeID string `json:"-"` } // DetachVolumeResponse contains the updated server after detaching a volume type DetachVolumeResponse struct { Server *Server `json:"-"` } // DetachVolume detaches a volume from a server // // Note: Implementation is thread-safe. func (s *API) DetachVolume(req *DetachVolumeRequest, opts ...scw.RequestOption) (*DetachVolumeResponse, error) { // get volume getVolumeResponse, err := s.GetVolume(&GetVolumeRequest{ Zone: req.Zone, VolumeID: req.VolumeID, }) if err != nil { return nil, err } if getVolumeResponse.Volume == nil { return nil, errors.New("expected volume to have value in response") } if getVolumeResponse.Volume.Server == nil { return nil, errors.New("volume should be attached to a server") } serverID := getVolumeResponse.Volume.Server.ID defer lockServer(req.Zone, serverID).Unlock() // get server with volumes getServerResponse, err := s.GetServer(&GetServerRequest{ Zone: req.Zone, ServerID: serverID, }) if err != nil { return nil, err } volumes := getServerResponse.Server.Volumes // remove volume from volumes list for key, volume := range volumes { if volume.ID == req.VolumeID { delete(volumes, key) } } newVolumes := volumesToVolumeTemplates(volumes) // update server updateServerResponse, err := s.updateServer(&UpdateServerRequest{ Zone: req.Zone, ServerID: serverID, Volumes: &newVolumes, }) if err != nil { return nil, err } return &DetachVolumeResponse{Server: updateServerResponse.Server}, nil } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListServersResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListBootscriptsResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListIPsResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListSecurityGroupRulesResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListSecurityGroupsResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListServersTypesResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListSnapshotsResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListVolumesResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListImagesResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListServersTypesResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListServersTypesResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListServersTypesResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } if r.Servers == nil { r.Servers = make(map[string]*ServerType, len(results.Servers)) } for name, serverType := range results.Servers { r.Servers[name] = serverType } r.TotalCount += uint32(len(results.Servers)) return uint32(len(results.Servers)), nil } func (v *NullableStringValue) UnmarshalJSON(b []byte) error { if string(b) == "null" { v.Null = true return nil } var tmp string if err := json.Unmarshal(b, &tmp); err != nil { return err } v.Null = false v.Value = tmp return nil } func (v *NullableStringValue) MarshalJSON() ([]byte, error) { if v.Null { return []byte("null"), nil } return json.Marshal(v.Value) } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/security_group_utils.go�0000664�0000000�0000000�00000015323�13771713062�0033362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package instance import ( "fmt" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/scw" ) // UpdateSecurityGroupRequest contains the parameters to update a security group type UpdateSecurityGroupRequest struct { Zone scw.Zone `json:"-"` SecurityGroupID string `json:"-"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` InboundDefaultPolicy *SecurityGroupPolicy `json:"inbound_default_policy,omitempty"` OutboundDefaultPolicy *SecurityGroupPolicy `json:"outbound_default_policy,omitempty"` Stateful *bool `json:"stateful,omitempty"` OrganizationDefault *bool `json:"organization_default,omitempty"` ProjectDefault *bool `json:"project_default,omitempty"` } type UpdateSecurityGroupResponse struct { SecurityGroup *SecurityGroup } // UpdateSecurityGroup updates a security group. func (s *API) UpdateSecurityGroup(req *UpdateSecurityGroupRequest, opts ...scw.RequestOption) (*UpdateSecurityGroupResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.SecurityGroupID) == "" { return nil, errors.New("field SecurityGroupID cannot be empty in request") } getSGResponse, err := s.GetSecurityGroup(&GetSecurityGroupRequest{ Zone: req.Zone, SecurityGroupID: req.SecurityGroupID, }, opts...) if err != nil { return nil, err } setRequest := &setSecurityGroupRequest{ ID: getSGResponse.SecurityGroup.ID, Name: getSGResponse.SecurityGroup.Name, Description: getSGResponse.SecurityGroup.Description, Organization: getSGResponse.SecurityGroup.Organization, Project: getSGResponse.SecurityGroup.Project, OrganizationDefault: getSGResponse.SecurityGroup.OrganizationDefault, ProjectDefault: getSGResponse.SecurityGroup.ProjectDefault, OutboundDefaultPolicy: getSGResponse.SecurityGroup.OutboundDefaultPolicy, InboundDefaultPolicy: getSGResponse.SecurityGroup.InboundDefaultPolicy, Stateful: getSGResponse.SecurityGroup.Stateful, Zone: req.Zone, EnableDefaultSecurity: getSGResponse.SecurityGroup.EnableDefaultSecurity, CreationDate: getSGResponse.SecurityGroup.CreationDate, ModificationDate: getSGResponse.SecurityGroup.ModificationDate, Servers: getSGResponse.SecurityGroup.Servers, } // Override the values that need to be updated if req.Name != nil { setRequest.Name = *req.Name } if req.Description != nil { setRequest.Description = *req.Description } if req.InboundDefaultPolicy != nil { setRequest.InboundDefaultPolicy = *req.InboundDefaultPolicy } if req.OutboundDefaultPolicy != nil { setRequest.OutboundDefaultPolicy = *req.OutboundDefaultPolicy } if req.Stateful != nil { setRequest.Stateful = *req.Stateful } if req.OrganizationDefault != nil { setRequest.OrganizationDefault = *req.OrganizationDefault } if req.ProjectDefault != nil { setRequest.ProjectDefault = *req.ProjectDefault } setRes, err := s.setSecurityGroup(setRequest, opts...) if err != nil { return nil, err } return &UpdateSecurityGroupResponse{ SecurityGroup: setRes.SecurityGroup, }, nil } // UpdateSecurityGroupRuleRequest contains the parameters to update a security group rule type UpdateSecurityGroupRuleRequest struct { Zone scw.Zone `json:"-"` SecurityGroupID string `json:"-"` SecurityGroupRuleID string `json:"-"` Protocol *SecurityGroupRuleProtocol `json:"protocol"` Direction *SecurityGroupRuleDirection `json:"direction"` Action *SecurityGroupRuleAction `json:"action"` IPRange *scw.IPNet `json:"ip_range"` Position *uint32 `json:"position"` // If set to 0, DestPortFrom will be removed. // See SecurityGroupRule.DestPortFrom for more information DestPortFrom *uint32 `json:"dest_port_from"` // If set to 0, DestPortTo will be removed. // See SecurityGroupRule.DestPortTo for more information DestPortTo *uint32 `json:"dest_port_to"` } type UpdateSecurityGroupRuleResponse struct { Rule *SecurityGroupRule `json:"security_rule"` } // UpdateSecurityGroupRule updates a security group. func (s *API) UpdateSecurityGroupRule(req *UpdateSecurityGroupRuleRequest, opts ...scw.RequestOption) (*UpdateSecurityGroupRuleResponse, error) { var err error if fmt.Sprint(req.Zone) == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } res, err := s.GetSecurityGroupRule(&GetSecurityGroupRuleRequest{ SecurityGroupRuleID: req.SecurityGroupRuleID, SecurityGroupID: req.SecurityGroupID, Zone: req.Zone, }) if err != nil { return nil, err } setRequest := &setSecurityGroupRuleRequest{ Zone: req.Zone, SecurityGroupID: req.SecurityGroupID, SecurityGroupRuleID: req.SecurityGroupRuleID, ID: req.SecurityGroupRuleID, Direction: res.Rule.Direction, Protocol: res.Rule.Protocol, DestPortFrom: res.Rule.DestPortFrom, DestPortTo: res.Rule.DestPortTo, IPRange: res.Rule.IPRange, Action: res.Rule.Action, Position: res.Rule.Position, Editable: res.Rule.Editable, } // Override the values that need to be updated if req.Action != nil { setRequest.Action = *req.Action } if req.IPRange != nil { setRequest.IPRange = *req.IPRange } if req.DestPortTo != nil { if *req.DestPortTo > 0 { setRequest.DestPortTo = req.DestPortTo } else { setRequest.DestPortTo = nil } } if req.DestPortFrom != nil { if *req.DestPortFrom > 0 { setRequest.DestPortFrom = req.DestPortFrom } else { setRequest.DestPortFrom = nil } } if req.DestPortFrom != nil && req.DestPortTo != nil && *req.DestPortFrom == *req.DestPortTo { setRequest.DestPortTo = nil } if req.Protocol != nil { setRequest.Protocol = *req.Protocol } if req.Direction != nil { setRequest.Direction = *req.Direction } if req.Position != nil { setRequest.Position = *req.Position } // When we use ICMP protocol portFrom and portTo should be set to nil if req.Protocol != nil && *req.Protocol == SecurityGroupRuleProtocolICMP { setRequest.DestPortFrom = nil setRequest.DestPortTo = nil } resp, err := s.setSecurityGroupRule(setRequest) if err != nil { return nil, err } return &UpdateSecurityGroupRuleResponse{ Rule: resp.Rule, }, nil } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/server_utils.go���������0000664�0000000�0000000�00000024627�13771713062�0031614�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package instance import ( "bytes" "fmt" "io" "net/http" "time" "github.com/scaleway/scaleway-sdk-go/api/marketplace/v1" "github.com/scaleway/scaleway-sdk-go/internal/async" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/scw" "github.com/scaleway/scaleway-sdk-go/validation" ) const ( defaultTimeout = 5 * time.Minute defaultRetryInterval = 5 * time.Second ) // CreateServer creates a server. func (s *API) CreateServer(req *CreateServerRequest, opts ...scw.RequestOption) (*CreateServerResponse, error) { // If image is not a UUID we try to fetch it from marketplace. if req.Image != "" && !validation.IsUUID(req.Image) { apiMarketplace := marketplace.NewAPI(s.client) imageID, err := apiMarketplace.GetLocalImageIDByLabel(&marketplace.GetLocalImageIDByLabelRequest{ ImageLabel: req.Image, Zone: req.Zone, CommercialType: req.CommercialType, }) if err != nil { return nil, err } req.Image = imageID } return s.createServer(req, opts...) } // UpdateServer updates a server. // // Note: Implementation is thread-safe. func (s *API) UpdateServer(req *UpdateServerRequest, opts ...scw.RequestOption) (*UpdateServerResponse, error) { defer lockServer(req.Zone, req.ServerID).Unlock() return s.updateServer(req, opts...) } // WaitForServerRequest is used by WaitForServer method. type WaitForServerRequest struct { ServerID string Zone scw.Zone Timeout *time.Duration RetryInterval *time.Duration } // WaitForServer wait for the server to be in a "terminal state" before returning. // This function can be used to wait for a server to be started for example. func (s *API) WaitForServer(req *WaitForServerRequest) (*Server, error) { timeout := defaultTimeout if req.Timeout != nil { timeout = *req.Timeout } retryInterval := defaultRetryInterval if req.RetryInterval != nil { retryInterval = *req.RetryInterval } terminalStatus := map[ServerState]struct{}{ ServerStateStopped: {}, ServerStateStoppedInPlace: {}, ServerStateLocked: {}, ServerStateRunning: {}, } server, err := async.WaitSync(&async.WaitSyncConfig{ Get: func() (interface{}, bool, error) { res, err := s.GetServer(&GetServerRequest{ ServerID: req.ServerID, Zone: req.Zone, }) if err != nil { return nil, false, err } _, isTerminal := terminalStatus[res.Server.State] return res.Server, isTerminal, err }, Timeout: timeout, IntervalStrategy: async.LinearIntervalStrategy(retryInterval), }) if err != nil { return nil, errors.Wrap(err, "waiting for server failed") } return server.(*Server), nil } // ServerActionAndWaitRequest is used by ServerActionAndWait method. type ServerActionAndWaitRequest struct { ServerID string Zone scw.Zone Action ServerAction // Timeout: maximum time to wait before (default: 5 minutes) Timeout *time.Duration RetryInterval *time.Duration } // ServerActionAndWait start an action and wait for the server to be in the correct "terminal state" // expected by this action. func (s *API) ServerActionAndWait(req *ServerActionAndWaitRequest) error { timeout := defaultTimeout if req.Timeout != nil { timeout = *req.Timeout } retryInterval := defaultRetryInterval if req.RetryInterval != nil { retryInterval = *req.RetryInterval } _, err := s.ServerAction(&ServerActionRequest{ Zone: req.Zone, ServerID: req.ServerID, Action: req.Action, }) if err != nil { return err } finalServer, err := s.WaitForServer(&WaitForServerRequest{ Zone: req.Zone, ServerID: req.ServerID, Timeout: &timeout, RetryInterval: &retryInterval, }) if err != nil { return err } // check the action was properly executed expectedState := ServerState("unknown") switch req.Action { case ServerActionPoweron, ServerActionReboot: expectedState = ServerStateRunning case ServerActionPoweroff: expectedState = ServerStateStopped case ServerActionStopInPlace: expectedState = ServerStateStoppedInPlace } // backup can be performed from any state if expectedState != ServerState("unknown") && finalServer.State != expectedState { return errors.New("expected state %s but found %s: %s", expectedState, finalServer.State, finalServer.StateDetail) } return nil } // GetServerTypeRequest is used by GetServerType. type GetServerTypeRequest struct { Zone scw.Zone Name string } // GetServerType get server type info by it's name. func (s *API) GetServerType(req *GetServerTypeRequest) (*ServerType, error) { res, err := s.ListServersTypes(&ListServersTypesRequest{ Zone: req.Zone, }, scw.WithAllPages()) if err != nil { return nil, err } if serverType, exist := res.Servers[req.Name]; exist { return serverType, nil } return nil, errors.New("could not find server type %q", req.Name) } // GetServerUserDataRequest is used by GetServerUserData method. type GetServerUserDataRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` // Key defines the user data key to get. Key string `json:"-"` } // GetServerUserData gets the content of a user data on a server for the given key. func (s *API) GetServerUserData(req *GetServerUserDataRequest, opts ...scw.RequestOption) (io.Reader, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } if fmt.Sprint(req.Key) == "" { return nil, errors.New("field Key cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/user_data/" + fmt.Sprint(req.Key), Headers: http.Header{}, } res := &bytes.Buffer{} err = s.client.Do(scwReq, res, opts...) if err != nil { return nil, err } return res, nil } // SetServerUserDataRequest is used by SetServerUserData method. type SetServerUserDataRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` // Key defines the user data key to set. Key string `json:"-"` // Content defines the data to set. Content io.Reader } // SetServerUserData sets the content of a user data on a server for the given key. func (s *API) SetServerUserData(req *SetServerUserDataRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return errors.New("field ServerID cannot be empty in request") } if fmt.Sprint(req.Key) == "" { return errors.New("field Key cannot be empty in request") } if req.Content == nil { return errors.New("field Content cannot be nil in request") } scwReq := &scw.ScalewayRequest{ Method: "PATCH", Path: "/instance/v1/zones/" + fmt.Sprint(req.Zone) + "/servers/" + fmt.Sprint(req.ServerID) + "/user_data/" + fmt.Sprint(req.Key), Headers: http.Header{}, } err = scwReq.SetBody(req.Content) if err != nil { return err } err = s.client.Do(scwReq, nil, opts...) if err != nil { return err } return nil } // GetAllServerUserDataRequest is used by GetAllServerUserData method. type GetAllServerUserDataRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` } // GetAllServerUserDataResponse is used by GetAllServerUserData method. type GetAllServerUserDataResponse struct { UserData map[string]io.Reader `json:"-"` } // GetAllServerUserData gets all user data on a server. func (s *API) GetAllServerUserData(req *GetAllServerUserDataRequest, opts ...scw.RequestOption) (*GetAllServerUserDataResponse, error) { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return nil, errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return nil, errors.New("field ServerID cannot be empty in request") } // get all user data keys allUserDataRes, err := s.ListServerUserData(&ListServerUserDataRequest{ Zone: req.Zone, ServerID: req.ServerID, }) if err != nil { return nil, err } res := &GetAllServerUserDataResponse{ UserData: make(map[string]io.Reader, len(allUserDataRes.UserData)), } // build a map with all user data for _, key := range allUserDataRes.UserData { value, err := s.GetServerUserData(&GetServerUserDataRequest{ Zone: req.Zone, ServerID: req.ServerID, Key: key, }) if err != nil { return nil, err } res.UserData[key] = value } return res, nil } // SetAllServerUserDataRequest is used by SetAllServerUserData method. type SetAllServerUserDataRequest struct { Zone scw.Zone `json:"-"` ServerID string `json:"-"` // UserData defines all user data that will be set to the server. // This map is idempotent, it means that all the current data will be overwritten and // all keys not present in this map will be deleted.. All data will be removed if this map is nil. UserData map[string]io.Reader `json:"-"` } // SetAllServerUserData sets all user data on a server. func (s *API) SetAllServerUserData(req *SetAllServerUserDataRequest, opts ...scw.RequestOption) error { var err error if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } if fmt.Sprint(req.Zone) == "" { return errors.New("field Zone cannot be empty in request") } if fmt.Sprint(req.ServerID) == "" { return errors.New("field ServerID cannot be empty in request") } // get all current user data keys allUserDataRes, err := s.ListServerUserData(&ListServerUserDataRequest{ Zone: req.Zone, ServerID: req.ServerID, }) if err != nil { return err } // delete all current user data for _, key := range allUserDataRes.UserData { _, exist := req.UserData[key] if exist { continue } err := s.DeleteServerUserData(&DeleteServerUserDataRequest{ Zone: req.Zone, ServerID: req.ServerID, Key: key, }) if err != nil { return err } } // set all new user data for key, value := range req.UserData { err := s.SetServerUserData(&SetServerUserDataRequest{ Zone: req.Zone, ServerID: req.ServerID, Key: key, Content: value, }) if err != nil { return err } } return nil } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/snapshot_utils.go�������0000664�0000000�0000000�00000002643�13771713062�0032137�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package instance import ( "time" "github.com/scaleway/scaleway-sdk-go/internal/async" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/scw" ) // WaitForImageRequest is used by WaitForImage method. type WaitForSnapshotRequest struct { SnapshotID string Zone scw.Zone Timeout *time.Duration RetryInterval *time.Duration } // WaitForSnapshot wait for the snapshot to be in a "terminal state" before returning. func (s *API) WaitForSnapshot(req *WaitForSnapshotRequest) (*Snapshot, error) { timeout := defaultTimeout if req.Timeout != nil { timeout = *req.Timeout } retryInterval := defaultRetryInterval if req.RetryInterval != nil { retryInterval = *req.RetryInterval } terminalStatus := map[SnapshotState]struct{}{ SnapshotStateAvailable: {}, SnapshotStateError: {}, } snapshot, err := async.WaitSync(&async.WaitSyncConfig{ Get: func() (interface{}, bool, error) { res, err := s.GetSnapshot(&GetSnapshotRequest{ SnapshotID: req.SnapshotID, Zone: req.Zone, }) if err != nil { return nil, false, err } _, isTerminal := terminalStatus[res.Snapshot.State] return res.Snapshot, isTerminal, err }, Timeout: timeout, IntervalStrategy: async.LinearIntervalStrategy(retryInterval), }) if err != nil { return nil, errors.Wrap(err, "waiting for snapshot failed") } return snapshot.(*Snapshot), nil } ���������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/instance/v1/volume_utils.go���������0000664�0000000�0000000�00000002577�13771713062�0031615�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package instance import ( "time" "github.com/scaleway/scaleway-sdk-go/internal/async" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/scw" ) // WaitForImageRequest is used by WaitForImage method. type WaitForVolumeRequest struct { VolumeID string Zone scw.Zone Timeout *time.Duration RetryInterval *time.Duration } // WaitForSnapshot wait for the snapshot to be in a "terminal state" before returning. func (s *API) WaitForVolume(req *WaitForVolumeRequest) (*Volume, error) { timeout := defaultTimeout if req.Timeout != nil { timeout = *req.Timeout } retryInterval := defaultRetryInterval if req.RetryInterval != nil { retryInterval = *req.RetryInterval } terminalStatus := map[VolumeState]struct{}{ VolumeStateAvailable: {}, VolumeStateError: {}, } volume, err := async.WaitSync(&async.WaitSyncConfig{ Get: func() (interface{}, bool, error) { res, err := s.GetVolume(&GetVolumeRequest{ VolumeID: req.VolumeID, Zone: req.Zone, }) if err != nil { return nil, false, err } _, isTerminal := terminalStatus[res.Volume.State] return res.Volume, isTerminal, err }, Timeout: timeout, IntervalStrategy: async.LinearIntervalStrategy(retryInterval), }) if err != nil { return nil, errors.Wrap(err, "waiting for volume failed") } return volume.(*Volume), nil } ���������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/������������������������0000775�0000000�0000000�00000000000�13771713062�0026662�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/���������������������0000775�0000000�0000000�00000000000�13771713062�0027210�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_sdk.go���0000664�0000000�0000000�00000016604�13771713062�0032677�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. // Package marketplace provides methods and message types of the marketplace v1 API. package marketplace import ( "bytes" "encoding/json" "fmt" "net" "net/http" "net/url" "strings" "time" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/internal/marshaler" "github.com/scaleway/scaleway-sdk-go/internal/parameter" "github.com/scaleway/scaleway-sdk-go/namegenerator" "github.com/scaleway/scaleway-sdk-go/scw" ) // always import dependencies var ( _ fmt.Stringer _ json.Unmarshaler _ url.URL _ net.IP _ http.Header _ bytes.Reader _ time.Time _ = strings.Join _ scw.ScalewayRequest _ marshaler.Duration _ scw.File _ = parameter.AddToQuery _ = namegenerator.GetRandomName ) // API: marketplace API type API struct { client *scw.Client } // NewAPI returns a API object from a Scaleway client. func NewAPI(client *scw.Client) *API { return &API{ client: client, } } type GetImageResponse struct { Image *Image `json:"image"` } type GetServiceInfoResponse struct { API string `json:"api"` Description string `json:"description"` Version string `json:"version"` } type GetVersionResponse struct { Version *Version `json:"version"` } // Image: image type Image struct { // ID: UUID of this image ID string `json:"id"` // Name: name of the image Name string `json:"name"` // Description: text description of this image Description string `json:"description"` // Logo: URL of this image's logo Logo string `json:"logo"` // Categories: list of categories this image belongs to Categories []string `json:"categories"` // CreationDate: creation date of this image CreationDate *time.Time `json:"creation_date"` // ModificationDate: date of the last modification of this image ModificationDate *time.Time `json:"modification_date"` // ValidUntil: expiration date of this image ValidUntil *time.Time `json:"valid_until"` // Label: label of this image Label string `json:"label"` // Versions: list of versions of this image Versions []*Version `json:"versions"` // Organization: organization this image belongs to Organization *Organization `json:"organization"` CurrentPublicVersion string `json:"current_public_version"` } type ListImagesResponse struct { Images []*Image `json:"images"` TotalCount uint32 `json:"total_count"` } type ListVersionsResponse struct { Versions []*Version `json:"versions"` TotalCount uint32 `json:"total_count"` } // LocalImage: local image type LocalImage struct { // ID: UUID of this local image ID string `json:"id"` // CompatibleCommercialTypes: list of all commercial types that are compatible with this local image CompatibleCommercialTypes []string `json:"compatible_commercial_types"` // Arch: supported architecture for this local image Arch string `json:"arch"` // Zone: availability Zone where this local image is available Zone scw.Zone `json:"zone"` } type Organization struct { ID string `json:"id"` Name string `json:"name"` } // Version: version type Version struct { // ID: UUID of this version ID string `json:"id"` // Name: name of this version Name string `json:"name"` // CreationDate: creation date of this image version CreationDate *time.Time `json:"creation_date"` // ModificationDate: date of the last modification of this version ModificationDate *time.Time `json:"modification_date"` // LocalImages: list of local images available in this version LocalImages []*LocalImage `json:"local_images"` } // Service API type GetServiceInfoRequest struct { } func (s *API) GetServiceInfo(req *GetServiceInfoRequest, opts ...scw.RequestOption) (*GetServiceInfoResponse, error) { var err error scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/marketplace/v1", Headers: http.Header{}, } var resp GetServiceInfoResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListImagesRequest struct { // PerPage: a positive integer lower or equal to 100 to select the number of items to display PerPage *uint32 `json:"-"` // Page: a positive integer to choose the page to display Page *int32 `json:"-"` } // ListImages: list marketplace images func (s *API) ListImages(req *ListImagesRequest, opts ...scw.RequestOption) (*ListImagesResponse, error) { var err error defaultPerPage, exist := s.client.GetDefaultPageSize() if (req.PerPage == nil || *req.PerPage == 0) && exist { req.PerPage = &defaultPerPage } query := url.Values{} parameter.AddToQuery(query, "per_page", req.PerPage) parameter.AddToQuery(query, "page", req.Page) scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/marketplace/v1/images", Query: query, Headers: http.Header{}, } var resp ListImagesResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } // UnsafeGetTotalCount should not be used // Internal usage only func (r *ListImagesResponse) UnsafeGetTotalCount() uint32 { return r.TotalCount } // UnsafeAppend should not be used // Internal usage only func (r *ListImagesResponse) UnsafeAppend(res interface{}) (uint32, error) { results, ok := res.(*ListImagesResponse) if !ok { return 0, errors.New("%T type cannot be appended to type %T", res, r) } r.Images = append(r.Images, results.Images...) r.TotalCount += uint32(len(results.Images)) return uint32(len(results.Images)), nil } type GetImageRequest struct { // ImageID: display the image name ImageID string `json:"-"` } // GetImage: get a specific marketplace image func (s *API) GetImage(req *GetImageRequest, opts ...scw.RequestOption) (*GetImageResponse, error) { var err error if fmt.Sprint(req.ImageID) == "" { return nil, errors.New("field ImageID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/marketplace/v1/images/" + fmt.Sprint(req.ImageID) + "", Headers: http.Header{}, } var resp GetImageResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type ListVersionsRequest struct { ImageID string `json:"-"` } func (s *API) ListVersions(req *ListVersionsRequest, opts ...scw.RequestOption) (*ListVersionsResponse, error) { var err error if fmt.Sprint(req.ImageID) == "" { return nil, errors.New("field ImageID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/marketplace/v1/images/" + fmt.Sprint(req.ImageID) + "/versions", Headers: http.Header{}, } var resp ListVersionsResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } type GetVersionRequest struct { ImageID string `json:"-"` VersionID string `json:"-"` } func (s *API) GetVersion(req *GetVersionRequest, opts ...scw.RequestOption) (*GetVersionResponse, error) { var err error if fmt.Sprint(req.ImageID) == "" { return nil, errors.New("field ImageID cannot be empty in request") } if fmt.Sprint(req.VersionID) == "" { return nil, errors.New("field VersionID cannot be empty in request") } scwReq := &scw.ScalewayRequest{ Method: "GET", Path: "/marketplace/v1/images/" + fmt.Sprint(req.ImageID) + "/versions/" + fmt.Sprint(req.VersionID) + "", Headers: http.Header{}, } var resp GetVersionResponse err = s.client.Do(scwReq, &resp, opts...) if err != nil { return nil, err } return &resp, nil } ����������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/api/marketplace/v1/marketplace_utils.go�0000664�0000000�0000000�00000006241�13771713062�0033252�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package marketplace import ( "fmt" "strings" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/scw" ) // getLocalImage returns the correct local version of an image matching // the current zone and the compatible commercial type func (version *Version) getLocalImage(zone scw.Zone, commercialType string) (*LocalImage, error) { for _, localImage := range version.LocalImages { // Check if in correct zone if localImage.Zone != zone { continue } // Check if compatible with wanted commercial type for _, compatibleCommercialType := range localImage.CompatibleCommercialTypes { if compatibleCommercialType == commercialType { return localImage, nil } } } return nil, fmt.Errorf("couldn't find compatible local image for this image version (%s)", version.ID) } // getLatestVersion returns the current/latests version on an image, // or an error in case the image doesn't have a public version. func (image *Image) getLatestVersion() (*Version, error) { for _, version := range image.Versions { if version.ID == image.CurrentPublicVersion { return version, nil } } return nil, errors.New("latest version could not be found for image %s", image.Label) } // GetLocalImageIDByLabelRequest is used by GetLocalImageIDByLabel type GetLocalImageIDByLabelRequest struct { ImageLabel string Zone scw.Zone CommercialType string } // GetLocalImageIDByLabel search for an image with the given label (exact match) in the given region // it returns the latest version of this specific image. func (s *API) GetLocalImageIDByLabel(req *GetLocalImageIDByLabelRequest) (string, error) { if req.Zone == "" { defaultZone, _ := s.client.GetDefaultZone() req.Zone = defaultZone } listImageRequest := &ListImagesRequest{} listImageResponse, err := s.ListImages(listImageRequest, scw.WithAllPages()) if err != nil { return "", err } images := listImageResponse.Images label := strings.Replace(req.ImageLabel, "-", "_", -1) commercialType := strings.ToUpper(req.CommercialType) for _, image := range images { // Match label of the image if label == image.Label { latestVersion, err := image.getLatestVersion() if err != nil { return "", errors.Wrap(err, "couldn't find a matching image for the given label (%s), zone (%s) and commercial type (%s)", req.ImageLabel, req.Zone, req.CommercialType) } localImage, err := latestVersion.getLocalImage(req.Zone, commercialType) if err != nil { return "", errors.Wrap(err, "couldn't find a matching image for the given label (%s), zone (%s) and commercial type (%s)", req.ImageLabel, req.Zone, req.CommercialType) } return localImage.ID, nil } } return "", errors.New("couldn't find a matching image for the given label (%s), zone (%s) and commercial type (%s)", req.ImageLabel, req.Zone, req.CommercialType) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListImagesResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } // UnsafeSetTotalCount should not be used // Internal usage only func (r *ListVersionsResponse) UnsafeSetTotalCount(totalCount int) { r.TotalCount = uint32(totalCount) } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/�������������������������������0000775�0000000�0000000�00000000000�13771713062�0025435�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/async/�������������������������0000775�0000000�0000000�00000000000�13771713062�0026552�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/async/wait.go������������������0000664�0000000�0000000�00000004050�13771713062�0030044�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package async import ( "fmt" "time" ) var ( defaultInterval = time.Second defaultTimeout = time.Minute * 5 ) type IntervalStrategy func() <-chan time.Time // WaitSyncConfig defines the waiting options. type WaitSyncConfig struct { // This method will be called from another goroutine. Get func() (value interface{}, isTerminal bool, err error) IntervalStrategy IntervalStrategy Timeout time.Duration } // LinearIntervalStrategy defines a linear interval duration. func LinearIntervalStrategy(interval time.Duration) IntervalStrategy { return func() <-chan time.Time { return time.After(interval) } } // FibonacciIntervalStrategy defines an interval duration who follow the Fibonacci sequence. func FibonacciIntervalStrategy(base time.Duration, factor float32) IntervalStrategy { var x, y float32 = 0, 1 return func() <-chan time.Time { x, y = y, x+(y*factor) return time.After(time.Duration(x) * base) } } // WaitSync waits and returns when a given stop condition is true or if an error occurs. func WaitSync(config *WaitSyncConfig) (terminalValue interface{}, err error) { // initialize configuration if config.IntervalStrategy == nil { config.IntervalStrategy = LinearIntervalStrategy(defaultInterval) } if config.Timeout == 0 { config.Timeout = defaultTimeout } resultValue := make(chan interface{}) resultErr := make(chan error) timeout := make(chan bool) go func() { for { // get the payload value, stopCondition, err := config.Get() // send the payload if err != nil { resultErr <- err return } if stopCondition { resultValue <- value return } // waiting for an interval before next get() call or a timeout select { case <-timeout: return case <-config.IntervalStrategy(): // sleep } } }() // waiting for a result or a timeout select { case val := <-resultValue: return val, nil case err := <-resultErr: return nil, err case <-time.After(config.Timeout): timeout <- true return nil, fmt.Errorf("timeout after %v", config.Timeout) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/��������������������������0000775�0000000�0000000�00000000000�13771713062�0026376�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/auth.go�������������������0000664�0000000�0000000�00000000627�13771713062�0027673�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package auth import "net/http" // Auth implement methods required for authentication. // Valid authentication are currently a token or no auth. type Auth interface { // Headers returns headers that must be add to the http request Headers() http.Header // AnonymizedHeaders returns an anonymised version of Headers() // This method could be use for logging purpose. AnonymizedHeaders() http.Header } ���������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/no_auth.go����������������0000664�0000000�0000000�00000000460�13771713062�0030362�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package auth import "net/http" type NoAuth struct { } // NewNoAuth return an auth with no authentication method func NewNoAuth() *NoAuth { return &NoAuth{} } func (t *NoAuth) Headers() http.Header { return http.Header{} } func (t *NoAuth) AnonymizedHeaders() http.Header { return http.Header{} } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/auth/token.go������������������0000664�0000000�0000000�00000002216�13771713062�0030046�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package auth import "net/http" // Token is the pair accessKey + secretKey. // This type is public because it's an internal package. type Token struct { AccessKey string SecretKey string } // XAuthTokenHeader is Scaleway standard auth header const XAuthTokenHeader = "X-Auth-Token" // #nosec G101 // NewToken create a token authentication from an // access key and a secret key func NewToken(accessKey, secretKey string) *Token { return &Token{AccessKey: accessKey, SecretKey: secretKey} } // Headers returns headers that must be add to the http request func (t *Token) Headers() http.Header { headers := http.Header{} headers.Set(XAuthTokenHeader, t.SecretKey) return headers } // AnonymizedHeaders returns an anonymized version of Headers() // This method could be use for logging purpose. func (t *Token) AnonymizedHeaders() http.Header { headers := http.Header{} headers.Set(XAuthTokenHeader, HideSecretKey(t.SecretKey)) return headers } func HideSecretKey(k string) string { switch { case len(k) == 0: return "" case len(k) > 8: return k[0:8] + "-xxxx-xxxx-xxxx-xxxxxxxxxxxx" default: return "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/errors/������������������������0000775�0000000�0000000�00000000000�13771713062�0026751�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/errors/error.go����������������0000664�0000000�0000000�00000001526�13771713062�0030435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package errors import "fmt" // Error is a base error that implement scw.SdkError type Error struct { Str string Err error } // Error implement standard xerror.Wrapper interface func (e *Error) Unwrap() error { return e.Err } // Error implement standard error interface func (e *Error) Error() string { str := "scaleway-sdk-go: " + e.Str if e.Err != nil { str += ": " + e.Err.Error() } return str } // IsScwSdkError implement SdkError interface func (e *Error) IsScwSdkError() {} // New creates a new error with that same interface as fmt.Errorf func New(format string, args ...interface{}) *Error { return &Error{ Str: fmt.Sprintf(format, args...), } } // Wrap an error with additional information func Wrap(err error, format string, args ...interface{}) *Error { return &Error{ Err: err, Str: fmt.Sprintf(format, args...), } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/marshaler/���������������������0000775�0000000�0000000�00000000000�13771713062�0027413�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/marshaler/duration.go����������0000664�0000000�0000000�00000010102�13771713062�0031561�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package marshaler import ( "encoding/json" "time" ) // Duration implements a JSON Marshaler to encode a time.Duration in milliseconds. type Duration int64 const milliSec = Duration(time.Millisecond) // NewDuration converts a *time.Duration to a *Duration type. func NewDuration(t *time.Duration) *Duration { if t == nil { return nil } d := Duration(t.Nanoseconds()) return &d } // Standard converts a *Duration to a *time.Duration type. func (d *Duration) Standard() *time.Duration { return (*time.Duration)(d) } // MarshalJSON encodes the Duration in milliseconds. func (d Duration) MarshalJSON() ([]byte, error) { return json.Marshal(int64(d / milliSec)) } // UnmarshalJSON decodes milliseconds to Duration. func (d *Duration) UnmarshalJSON(b []byte) error { var tmp int64 err := json.Unmarshal(b, &tmp) if err != nil { return err } *d = Duration(tmp) * milliSec return nil } // DurationSlice is a slice of *Duration type DurationSlice []*Duration // NewDurationSlice converts a []*time.Duration to a DurationSlice type. func NewDurationSlice(t []*time.Duration) DurationSlice { ds := make([]*Duration, len(t)) for i := range ds { ds[i] = NewDuration(t[i]) } return ds } // Standard converts a DurationSlice to a []*time.Duration type. func (ds *DurationSlice) Standard() []*time.Duration { t := make([]*time.Duration, len(*ds)) for i := range t { t[i] = (*ds)[i].Standard() } return t } // Durationint32Map is a int32 map of *Duration type Durationint32Map map[int32]*Duration // NewDurationint32Map converts a map[int32]*time.Duration to a Durationint32Map type. func NewDurationint32Map(t map[int32]*time.Duration) Durationint32Map { dm := make(Durationint32Map, len(t)) for i := range t { dm[i] = NewDuration(t[i]) } return dm } // Standard converts a Durationint32Map to a map[int32]*time.Duration type. func (dm *Durationint32Map) Standard() map[int32]*time.Duration { t := make(map[int32]*time.Duration, len(*dm)) for key, value := range *dm { t[key] = value.Standard() } return t } // LongDuration implements a JSON Marshaler to encode a time.Duration in days. type LongDuration int64 const day = LongDuration(time.Hour) * 24 // NewLongDuration converts a *time.Duration to a *LongDuration type. func NewLongDuration(t *time.Duration) *LongDuration { if t == nil { return nil } d := LongDuration(t.Nanoseconds()) return &d } // Standard converts a *LongDuration to a *time.Duration type. func (d *LongDuration) Standard() *time.Duration { return (*time.Duration)(d) } // MarshalJSON encodes the LongDuration in days. func (d LongDuration) MarshalJSON() ([]byte, error) { return json.Marshal(int64(d / day)) } // UnmarshalJSON decodes days to LongDuration. func (d *LongDuration) UnmarshalJSON(b []byte) error { var tmp int64 err := json.Unmarshal(b, &tmp) if err != nil { return err } *d = LongDuration(tmp) * day return nil } // LongDurationSlice is a slice of *LongDuration type LongDurationSlice []*LongDuration // NewLongDurationSlice converts a []*time.Duration to a LongDurationSlice type. func NewLongDurationSlice(t []*time.Duration) LongDurationSlice { ds := make([]*LongDuration, len(t)) for i := range ds { ds[i] = NewLongDuration(t[i]) } return ds } // Standard converts a LongDurationSlice to a []*time.Duration type. func (ds *LongDurationSlice) Standard() []*time.Duration { t := make([]*time.Duration, len(*ds)) for i := range t { t[i] = (*ds)[i].Standard() } return t } // LongDurationint32Map is a int32 map of *LongDuration type LongDurationint32Map map[int32]*LongDuration // NewLongDurationint32Map converts a map[int32]*time.LongDuration to a LongDurationint32Map type. func NewLongDurationint32Map(t map[int32]*time.Duration) LongDurationint32Map { dm := make(LongDurationint32Map, len(t)) for i := range t { dm[i] = NewLongDuration(t[i]) } return dm } // Standard converts a LongDurationint32Map to a map[int32]*time.LongDuration type. func (dm *LongDurationint32Map) Standard() map[int32]*time.Duration { t := make(map[int32]*time.Duration, len(*dm)) for key, value := range *dm { t[key] = value.Standard() } return t } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/parameter/���������������������0000775�0000000�0000000�00000000000�13771713062�0027415�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/internal/parameter/query.go�������������0000664�0000000�0000000�00000001414�13771713062�0031111�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package parameter import ( "fmt" "net/url" "reflect" "time" ) // AddToQuery add a key/value pair to an URL query func AddToQuery(query url.Values, key string, value interface{}) { elemValue := reflect.ValueOf(value) if elemValue.Kind() == reflect.Invalid || elemValue.Kind() == reflect.Ptr && elemValue.IsNil() { return } for elemValue.Kind() == reflect.Ptr { elemValue = reflect.ValueOf(value).Elem() } elemType := elemValue.Type() switch { case elemType.Kind() == reflect.Slice: for i := 0; i < elemValue.Len(); i++ { query.Add(key, fmt.Sprint(elemValue.Index(i).Interface())) } case elemType == reflect.TypeOf(time.Time{}): query.Add(key, value.(time.Time).Format(time.RFC3339)) default: query.Add(key, fmt.Sprint(elemValue.Interface())) } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/logger/���������������������������������0000775�0000000�0000000�00000000000�13771713062�0025100�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/logger/default_logger.go����������������0000664�0000000�0000000�00000006356�13771713062�0030424�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package logger import ( "fmt" "io" "io/ioutil" "log" "os" "strconv" ) var DefaultLogger = newLogger(os.Stderr, LogLevelWarning) var logger Logger = DefaultLogger // loggerT is the default logger used by scaleway-sdk-go. type loggerT struct { m [4]*log.Logger v LogLevel } // Init create a new default logger. // Not mutex-protected, should be called before any scaleway-sdk-go functions. func (g *loggerT) Init(w io.Writer, level LogLevel) { g.m = newLogger(w, level).m } // Debugf logs to the DEBUG log. Arguments are handled in the manner of fmt.Printf. func Debugf(format string, args ...interface{}) { logger.Debugf(format, args...) } func (g *loggerT) Debugf(format string, args ...interface{}) { g.m[LogLevelDebug].Printf(format, args...) } // Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf. func Infof(format string, args ...interface{}) { logger.Infof(format, args...) } func (g *loggerT) Infof(format string, args ...interface{}) { g.m[LogLevelInfo].Printf(format, args...) } // Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf. func Warningf(format string, args ...interface{}) { logger.Warningf(format, args...) } func (g *loggerT) Warningf(format string, args ...interface{}) { g.m[LogLevelWarning].Printf(format, args...) } // Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf. func Errorf(format string, args ...interface{}) { logger.Errorf(format, args...) } func (g *loggerT) Errorf(format string, args ...interface{}) { g.m[LogLevelError].Printf(format, args...) } // ShouldLog reports whether verbosity level l is at least the requested verbose level. func ShouldLog(level LogLevel) bool { return logger.ShouldLog(level) } func (g *loggerT) ShouldLog(level LogLevel) bool { return level <= g.v } func isEnabled(envKey string) bool { env, exist := os.LookupEnv(envKey) if !exist { return false } value, err := strconv.ParseBool(env) if err != nil { fmt.Fprintf(os.Stderr, "ERROR: environment variable %s has invalid boolean value\n", envKey) } return value } // newLogger creates a logger to be used as default logger. // All logs are written to w. func newLogger(w io.Writer, level LogLevel) *loggerT { errorW := ioutil.Discard warningW := ioutil.Discard infoW := ioutil.Discard debugW := ioutil.Discard if isEnabled("SCW_DEBUG") { level = LogLevelDebug } switch level { case LogLevelDebug: debugW = w case LogLevelInfo: infoW = w case LogLevelWarning: warningW = w case LogLevelError: errorW = w } // Error logs will be written to errorW, warningW, infoW and debugW. // Warning logs will be written to warningW, infoW and debugW. // Info logs will be written to infoW and debugW. // Debug logs will be written to debugW. var m [4]*log.Logger m[LogLevelError] = log.New(io.MultiWriter(debugW, infoW, warningW, errorW), severityName[LogLevelError]+": ", log.LstdFlags) m[LogLevelWarning] = log.New(io.MultiWriter(debugW, infoW, warningW), severityName[LogLevelWarning]+": ", log.LstdFlags) m[LogLevelInfo] = log.New(io.MultiWriter(debugW, infoW), severityName[LogLevelInfo]+": ", log.LstdFlags) m[LogLevelDebug] = log.New(debugW, severityName[LogLevelDebug]+": ", log.LstdFlags) return &loggerT{m: m, v: level} } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/logger/logger.go������������������������0000664�0000000�0000000�00000003126�13771713062�0026710�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package logger import "os" type LogLevel int const ( // LogLevelDebug indicates Debug severity. LogLevelDebug LogLevel = iota // LogLevelInfo indicates Info severity. LogLevelInfo // LogLevelWarning indicates Warning severity. LogLevelWarning // LogLevelError indicates Error severity. LogLevelError ) // severityName contains the string representation of each severity. var severityName = []string{ LogLevelDebug: "DEBUG", LogLevelInfo: "INFO", LogLevelWarning: "WARNING", LogLevelError: "ERROR", } // Logger does underlying logging work for scaleway-sdk-go. type Logger interface { // Debugf logs to DEBUG log. Arguments are handled in the manner of fmt.Printf. Debugf(format string, args ...interface{}) // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. Infof(format string, args ...interface{}) // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. Warningf(format string, args ...interface{}) // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. Errorf(format string, args ...interface{}) // ShouldLog reports whether verbosity level l is at least the requested verbose level. ShouldLog(level LogLevel) bool } // SetLogger sets logger that is used in by the SDK. // Not mutex-protected, should be called before any scaleway-sdk-go functions. func SetLogger(l Logger) { logger = l } // EnableDebugMode enable LogLevelDebug on the default logger. // If a custom logger was provided with SetLogger this method has no effect. func EnableDebugMode() { DefaultLogger.Init(os.Stderr, LogLevelDebug) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/namegenerator/��������������������������0000775�0000000�0000000�00000000000�13771713062�0026450�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/namegenerator/name_generator.go���������0000664�0000000�0000000�00000143072�13771713062�0031774�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Source: github.com/docker/docker/pkg/namesgenerator package namegenerator import ( "math/rand" "strings" "time" ) var r *rand.Rand func init() { source := rand.NewSource(time.Now().UnixNano()) r = rand.New(source) } var ( left = [...]string{ "admiring", "adoring", "affectionate", "agitated", "amazing", "angry", "awesome", "beautiful", "blissful", "bold", "boring", "brave", "busy", "charming", "clever", "cocky", "cool", "compassionate", "competent", "condescending", "confident", "cranky", "crazy", "dazzling", "determined", "distracted", "dreamy", "eager", "ecstatic", "elastic", "elated", "elegant", "eloquent", "epic", "exciting", "fervent", "festive", "flamboyant", "focused", "friendly", "frosty", "funny", "gallant", "gifted", "goofy", "gracious", "great", "happy", "hardcore", "heuristic", "hopeful", "hungry", "infallible", "inspiring", "interesting", "intelligent", "jolly", "jovial", "keen", "kind", "laughing", "loving", "lucid", "magical", "mystifying", "modest", "musing", "naughty", "nervous", "nice", "nifty", "nostalgic", "objective", "optimistic", "peaceful", "pedantic", "pensive", "practical", "priceless", "quirky", "quizzical", "recursing", "relaxed", "reverent", "romantic", "sad", "serene", "sharp", "silly", "sleepy", "stoic", "strange", "stupefied", "suspicious", "sweet", "tender", "thirsty", "trusting", "unruffled", "upbeat", "vibrant", "vigilant", "vigorous", "wizardly", "wonderful", "xenodochial", "youthful", "zealous", "zen", } // Docker, starting from 0.7.x, generates names from notable scientists and hackers. // Please, for any amazing man that you add to the list, consider adding an equally amazing woman to it, and vice versa. right = [...]string{ // Muhammad ibn Jābir al-Ḥarrānī al-Battānī was a founding father of astronomy. https://en.wikipedia.org/wiki/Mu%E1%B8%A5ammad_ibn_J%C4%81bir_al-%E1%B8%A4arr%C4%81n%C4%AB_al-Batt%C4%81n%C4%AB "albattani", // Frances E. Allen, became the first female IBM Fellow in 1989. In 2006, she became the first female recipient of the ACM's Turing Award. https://en.wikipedia.org/wiki/Frances_E._Allen "allen", // June Almeida - Scottish virologist who took the first pictures of the rubella virus - https://en.wikipedia.org/wiki/June_Almeida "almeida", // Kathleen Antonelli, American computer programmer and one of the six original programmers of the ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli "antonelli", // Maria Gaetana Agnesi - Italian mathematician, philosopher, theologian and humanitarian. She was the first woman to write a mathematics handbook and the first woman appointed as a Mathematics Professor at a University. https://en.wikipedia.org/wiki/Maria_Gaetana_Agnesi "agnesi", // Archimedes was a physicist, engineer and mathematician who invented too many things to list them here. https://en.wikipedia.org/wiki/Archimedes "archimedes", // Maria Ardinghelli - Italian translator, mathematician and physicist - https://en.wikipedia.org/wiki/Maria_Ardinghelli "ardinghelli", // Aryabhata - Ancient Indian mathematician-astronomer during 476-550 CE https://en.wikipedia.org/wiki/Aryabhata "aryabhata", // Wanda Austin - Wanda Austin is the President and CEO of The Aerospace Corporation, a leading architect for the US security space programs. https://en.wikipedia.org/wiki/Wanda_Austin "austin", // Charles Babbage invented the concept of a programmable computer. https://en.wikipedia.org/wiki/Charles_Babbage. "babbage", // Stefan Banach - Polish mathematician, was one of the founders of modern functional analysis. https://en.wikipedia.org/wiki/Stefan_Banach "banach", // Buckaroo Banzai and his mentor Dr. Hikita perfectd the "oscillation overthruster", a device that allows one to pass through solid matter. - https://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension "banzai", // John Bardeen co-invented the transistor - https://en.wikipedia.org/wiki/John_Bardeen "bardeen", // Jean Bartik, born Betty Jean Jennings, was one of the original programmers for the ENIAC computer. https://en.wikipedia.org/wiki/Jean_Bartik "bartik", // Laura Bassi, the world's first female professor https://en.wikipedia.org/wiki/Laura_Bassi "bassi", // Hugh Beaver, British engineer, founder of the Guinness Book of World Records https://en.wikipedia.org/wiki/Hugh_Beaver "beaver", // Alexander Graham Bell - an eminent Scottish-born scientist, inventor, engineer and innovator who is credited with inventing the first practical telephone - https://en.wikipedia.org/wiki/Alexander_Graham_Bell "bell", // Karl Friedrich Benz - a German automobile engineer. Inventor of the first practical motorcar. https://en.wikipedia.org/wiki/Karl_Benz "benz", // Homi J Bhabha - was an Indian nuclear physicist, founding director, and professor of physics at the Tata Institute of Fundamental Research. Colloquially known as "father of Indian nuclear programme"- https://en.wikipedia.org/wiki/Homi_J._Bhabha "bhabha", // Bhaskara II - Ancient Indian mathematician-astronomer whose work on calculus predates Newton and Leibniz by over half a millennium - https://en.wikipedia.org/wiki/Bh%C4%81skara_II#Calculus "bhaskara", // Sue Black - British computer scientist and campaigner. She has been instrumental in saving Bletchley Park, the site of World War II codebreaking - https://en.wikipedia.org/wiki/Sue_Black_(computer_scientist) "black", // Elizabeth Helen Blackburn - Australian-American Nobel laureate; best known for co-discovering telomerase. https://en.wikipedia.org/wiki/Elizabeth_Blackburn "blackburn", // Elizabeth Blackwell - American doctor and first American woman to receive a medical degree - https://en.wikipedia.org/wiki/Elizabeth_Blackwell "blackwell", // Niels Bohr is the father of quantum theory. https://en.wikipedia.org/wiki/Niels_Bohr. "bohr", // Kathleen Booth, she's credited with writing the first assembly language. https://en.wikipedia.org/wiki/Kathleen_Booth "booth", // Anita Borg - Anita Borg was the founding director of the Institute for Women and Technology (IWT). https://en.wikipedia.org/wiki/Anita_Borg "borg", // Satyendra Nath Bose - He provided the foundation for Bose–Einstein statistics and the theory of the Bose–Einstein condensate. - https://en.wikipedia.org/wiki/Satyendra_Nath_Bose "bose", // Katherine Louise Bouman is an imaging scientist and Assistant Professor of Computer Science at the California Institute of Technology. She researches computational methods for imaging, and developed an algorithm that made possible the picture first visualization of a black hole using the Event Horizon Telescope. - https://en.wikipedia.org/wiki/Katie_Bouman "bouman", // Evelyn Boyd Granville - She was one of the first African-American woman to receive a Ph.D. in mathematics; she earned it in 1949 from Yale University. https://en.wikipedia.org/wiki/Evelyn_Boyd_Granville "boyd", // Brahmagupta - Ancient Indian mathematician during 598-670 CE who gave rules to compute with zero - https://en.wikipedia.org/wiki/Brahmagupta#Zero "brahmagupta", // Walter Houser Brattain co-invented the transistor - https://en.wikipedia.org/wiki/Walter_Houser_Brattain "brattain", // Emmett Brown invented time travel. https://en.wikipedia.org/wiki/Emmett_Brown (thanks Brian Goff) "brown", // Linda Brown Buck - American biologist and Nobel laureate best known for her genetic and molecular analyses of the mechanisms of smell. https://en.wikipedia.org/wiki/Linda_B._Buck "buck", // Dame Susan Jocelyn Bell Burnell - Northern Irish astrophysicist who discovered radio pulsars and was the first to analyse them. https://en.wikipedia.org/wiki/Jocelyn_Bell_Burnell "burnell", // Annie Jump Cannon - pioneering female astronomer who classified hundreds of thousands of stars and created the system we use to understand stars today. https://en.wikipedia.org/wiki/Annie_Jump_Cannon "cannon", // Rachel Carson - American marine biologist and conservationist, her book Silent Spring and other writings are credited with advancing the global environmental movement. https://en.wikipedia.org/wiki/Rachel_Carson "carson", // Dame Mary Lucy Cartwright - British mathematician who was one of the first to study what is now known as chaos theory. Also known for Cartwright's theorem which finds applications in signal processing. https://en.wikipedia.org/wiki/Mary_Cartwright "cartwright", // Vinton Gray Cerf - American Internet pioneer, recognised as one of "the fathers of the Internet". With Robert Elliot Kahn, he designed TCP and IP, the primary data communication protocols of the Internet and other computer networks. https://en.wikipedia.org/wiki/Vint_Cerf "cerf", // Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar "chandrasekhar", // Sergey Alexeyevich Chaplygin (Russian: Серге́й Алексе́евич Чаплы́гин; April 5, 1869 – October 8, 1942) was a Russian and Soviet physicist, mathematician, and mechanical engineer. He is known for mathematical formulas such as Chaplygin's equation and for a hypothetical substance in cosmology called Chaplygin gas, named after him. https://en.wikipedia.org/wiki/Sergey_Chaplygin "chaplygin", // Émilie du Châtelet - French natural philosopher, mathematician, physicist, and author during the early 1730s, known for her translation of and commentary on Isaac Newton's book Principia containing basic laws of physics. https://en.wikipedia.org/wiki/%C3%89milie_du_Ch%C3%A2telet "chatelet", // Asima Chatterjee was an Indian organic chemist noted for her research on vinca alkaloids, development of drugs for treatment of epilepsy and malaria - https://en.wikipedia.org/wiki/Asima_Chatterjee "chatterjee", // Pafnuty Chebyshev - Russian mathematician. He is known fo his works on probability, statistics, mechanics, analytical geometry and number theory https://en.wikipedia.org/wiki/Pafnuty_Chebyshev "chebyshev", // Bram Cohen - American computer programmer and author of the BitTorrent peer-to-peer protocol. https://en.wikipedia.org/wiki/Bram_Cohen "cohen", // David Lee Chaum - American computer scientist and cryptographer. Known for his seminal contributions in the field of anonymous communication. https://en.wikipedia.org/wiki/David_Chaum "chaum", // Joan Clarke - Bletchley Park code breaker during the Second World War who pioneered techniques that remained top secret for decades. Also an accomplished numismatist https://en.wikipedia.org/wiki/Joan_Clarke "clarke", // Jane Colden - American botanist widely considered the first female American botanist - https://en.wikipedia.org/wiki/Jane_Colden "colden", // Gerty Theresa Cori - American biochemist who became the third woman—and first American woman—to win a Nobel Prize in science, and the first woman to be awarded the Nobel Prize in Physiology or Medicine. Cori was born in Prague. https://en.wikipedia.org/wiki/Gerty_Cori "cori", // Seymour Roger Cray was an American electrical engineer and supercomputer architect who designed a series of computers that were the fastest in the world for decades. https://en.wikipedia.org/wiki/Seymour_Cray "cray", // This entry reflects a husband and wife team who worked together: // Joan Curran was a Welsh scientist who developed radar and invented chaff, a radar countermeasure. https://en.wikipedia.org/wiki/Joan_Curran // Samuel Curran was an Irish physicist who worked alongside his wife during WWII and invented the proximity fuse. https://en.wikipedia.org/wiki/Samuel_Curran "curran", // Marie Curie discovered radioactivity. https://en.wikipedia.org/wiki/Marie_Curie. "curie", // Charles Darwin established the principles of natural evolution. https://en.wikipedia.org/wiki/Charles_Darwin. "darwin", // Leonardo Da Vinci invented too many things to list here. https://en.wikipedia.org/wiki/Leonardo_da_Vinci. "davinci", // A. K. (Alexander Keewatin) Dewdney, Canadian mathematician, computer scientist, author and filmmaker. Contributor to Scientific American's "Computer Recreations" from 1984 to 1991. Author of Core War (program), The Planiverse, The Armchair Universe, The Magic Machine, The New Turing Omnibus, and more. https://en.wikipedia.org/wiki/Alexander_Dewdney "dewdney", // Satish Dhawan - Indian mathematician and aerospace engineer, known for leading the successful and indigenous development of the Indian space programme. https://en.wikipedia.org/wiki/Satish_Dhawan "dhawan", // Bailey Whitfield Diffie - American cryptographer and one of the pioneers of public-key cryptography. https://en.wikipedia.org/wiki/Whitfield_Diffie "diffie", // Edsger Wybe Dijkstra was a Dutch computer scientist and mathematical scientist. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra. "dijkstra", // Paul Adrien Maurice Dirac - English theoretical physicist who made fundamental contributions to the early development of both quantum mechanics and quantum electrodynamics. https://en.wikipedia.org/wiki/Paul_Dirac "dirac", // Agnes Meyer Driscoll - American cryptanalyst during World Wars I and II who successfully cryptanalysed a number of Japanese ciphers. She was also the co-developer of one of the cipher machines of the US Navy, the CM. https://en.wikipedia.org/wiki/Agnes_Meyer_Driscoll "driscoll", // Donna Dubinsky - played an integral role in the development of personal digital assistants (PDAs) serving as CEO of Palm, Inc. and co-founding Handspring. https://en.wikipedia.org/wiki/Donna_Dubinsky "dubinsky", // Annie Easley - She was a leading member of the team which developed software for the Centaur rocket stage and one of the first African-Americans in her field. https://en.wikipedia.org/wiki/Annie_Easley "easley", // Thomas Alva Edison, prolific inventor https://en.wikipedia.org/wiki/Thomas_Edison "edison", // Albert Einstein invented the general theory of relativity. https://en.wikipedia.org/wiki/Albert_Einstein "einstein", // Alexandra Asanovna Elbakyan (Russian: Алекса́ндра Аса́новна Элбакя́н) is a Kazakhstani graduate student, computer programmer, internet pirate in hiding, and the creator of the site Sci-Hub. Nature has listed her in 2016 in the top ten people that mattered in science, and Ars Technica has compared her to Aaron Swartz. - https://en.wikipedia.org/wiki/Alexandra_Elbakyan "elbakyan", // Taher A. ElGamal - Egyptian cryptographer best known for the ElGamal discrete log cryptosystem and the ElGamal digital signature scheme. https://en.wikipedia.org/wiki/Taher_Elgamal "elgamal", // Gertrude Elion - American biochemist, pharmacologist and the 1988 recipient of the Nobel Prize in Medicine - https://en.wikipedia.org/wiki/Gertrude_Elion "elion", // James Henry Ellis - British engineer and cryptographer employed by the GCHQ. Best known for conceiving for the first time, the idea of public-key cryptography. https://en.wikipedia.org/wiki/James_H._Ellis "ellis", // Douglas Engelbart gave the mother of all demos: https://en.wikipedia.org/wiki/Douglas_Engelbart "engelbart", // Euclid invented geometry. https://en.wikipedia.org/wiki/Euclid "euclid", // Leonhard Euler invented large parts of modern mathematics. https://de.wikipedia.org/wiki/Leonhard_Euler "euler", // Michael Faraday - British scientist who contributed to the study of electromagnetism and electrochemistry. https://en.wikipedia.org/wiki/Michael_Faraday "faraday", // Horst Feistel - German-born American cryptographer who was one of the earliest non-government researchers to study the design and theory of block ciphers. Co-developer of DES and Lucifer. Feistel networks, a symmetric structure used in the construction of block ciphers are named after him. https://en.wikipedia.org/wiki/Horst_Feistel "feistel", // Pierre de Fermat pioneered several aspects of modern mathematics. https://en.wikipedia.org/wiki/Pierre_de_Fermat "fermat", // Enrico Fermi invented the first nuclear reactor. https://en.wikipedia.org/wiki/Enrico_Fermi. "fermi", // Richard Feynman was a key contributor to quantum mechanics and particle physics. https://en.wikipedia.org/wiki/Richard_Feynman "feynman", // Benjamin Franklin is famous for his experiments in electricity and the invention of the lightning rod. "franklin", // Yuri Alekseyevich Gagarin - Soviet pilot and cosmonaut, best known as the first human to journey into outer space. https://en.wikipedia.org/wiki/Yuri_Gagarin "gagarin", // Galileo was a founding father of modern astronomy, and faced politics and obscurantism to establish scientific truth. https://en.wikipedia.org/wiki/Galileo_Galilei "galileo", // Évariste Galois - French mathematician whose work laid the foundations of Galois theory and group theory, two major branches of abstract algebra, and the subfield of Galois connections, all while still in his late teens. https://en.wikipedia.org/wiki/%C3%89variste_Galois "galois", // Kadambini Ganguly - Indian physician, known for being the first South Asian female physician, trained in western medicine, to graduate in South Asia. https://en.wikipedia.org/wiki/Kadambini_Ganguly "ganguly", // William Henry "Bill" Gates III is an American business magnate, philanthropist, investor, computer programmer, and inventor. https://en.wikipedia.org/wiki/Bill_Gates "gates", // Johann Carl Friedrich Gauss - German mathematician who made significant contributions to many fields, including number theory, algebra, statistics, analysis, differential geometry, geodesy, geophysics, mechanics, electrostatics, magnetic fields, astronomy, matrix theory, and optics. https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss "gauss", // Marie-Sophie Germain - French mathematician, physicist and philosopher. Known for her work on elasticity theory, number theory and philosophy. https://en.wikipedia.org/wiki/Sophie_Germain "germain", // Adele Goldberg, was one of the designers and developers of the Smalltalk language. https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist) "goldberg", // Adele Goldstine, born Adele Katz, wrote the complete technical description for the first electronic digital computer, ENIAC. https://en.wikipedia.org/wiki/Adele_Goldstine "goldstine", // Shafi Goldwasser is a computer scientist known for creating theoretical foundations of modern cryptography. Winner of 2012 ACM Turing Award. https://en.wikipedia.org/wiki/Shafi_Goldwasser "goldwasser", // James Golick, all around gangster. "golick", // Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall "goodall", // Stephen Jay Gould was was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould "gould", // Carolyn Widney Greider - American molecular biologist and joint winner of the 2009 Nobel Prize for Physiology or Medicine for the discovery of telomerase. https://en.wikipedia.org/wiki/Carol_W._Greider "greider", // Alexander Grothendieck - German-born French mathematician who became a leading figure in the creation of modern algebraic geometry. https://en.wikipedia.org/wiki/Alexander_Grothendieck "grothendieck", // Lois Haibt - American computer scientist, part of the team at IBM that developed FORTRAN - https://en.wikipedia.org/wiki/Lois_Haibt "haibt", // Margaret Hamilton - Director of the Software Engineering Division of the MIT Instrumentation Laboratory, which developed on-board flight software for the Apollo space program. https://en.wikipedia.org/wiki/Margaret_Hamilton_(scientist) "hamilton", // Caroline Harriet Haslett - English electrical engineer, electricity industry administrator and champion of women's rights. Co-author of British Standard 1363 that specifies AC power plugs and sockets used across the United Kingdom (which is widely considered as one of the safest designs). https://en.wikipedia.org/wiki/Caroline_Haslett "haslett", // Stephen Hawking pioneered the field of cosmology by combining general relativity and quantum mechanics. https://en.wikipedia.org/wiki/Stephen_Hawking "hawking", // Martin Edward Hellman - American cryptologist, best known for his invention of public-key cryptography in co-operation with Whitfield Diffie and Ralph Merkle. https://en.wikipedia.org/wiki/Martin_Hellman "hellman", // Werner Heisenberg was a founding father of quantum mechanics. https://en.wikipedia.org/wiki/Werner_Heisenberg "heisenberg", // Grete Hermann was a German philosopher noted for her philosophical work on the foundations of quantum mechanics. https://en.wikipedia.org/wiki/Grete_Hermann "hermann", // Caroline Lucretia Herschel - German astronomer and discoverer of several comets. https://en.wikipedia.org/wiki/Caroline_Herschel "herschel", // Heinrich Rudolf Hertz - German physicist who first conclusively proved the existence of the electromagnetic waves. https://en.wikipedia.org/wiki/Heinrich_Hertz "hertz", // Jaroslav Heyrovský was the inventor of the polarographic method, father of the electroanalytical method, and recipient of the Nobel Prize in 1959. His main field of work was polarography. https://en.wikipedia.org/wiki/Jaroslav_Heyrovsk%C3%BD "heyrovsky", // Dorothy Hodgkin was a British biochemist, credited with the development of protein crystallography. She was awarded the Nobel Prize in Chemistry in 1964. https://en.wikipedia.org/wiki/Dorothy_Hodgkin "hodgkin", // Douglas R. Hofstadter is an American professor of cognitive science and author of the Pulitzer Prize and American Book Award-winning work Goedel, Escher, Bach: An Eternal Golden Braid in 1979. A mind-bending work which coined Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's Law." https://en.wikipedia.org/wiki/Douglas_Hofstadter "hofstadter", // Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephone switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover "hoover", // Grace Hopper developed the first compiler for a computer programming language and is credited with popularizing the term "debugging" for fixing computer glitches. https://en.wikipedia.org/wiki/Grace_Hopper "hopper", // Frances Hugle, she was an American scientist, engineer, and inventor who contributed to the understanding of semiconductors, integrated circuitry, and the unique electrical principles of microscopic materials. https://en.wikipedia.org/wiki/Frances_Hugle "hugle", // Hypatia - Greek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia "hypatia", // Teruko Ishizaka - Japanese scientist and immunologist who co-discovered the antibody class Immunoglobulin E. https://en.wikipedia.org/wiki/Teruko_Ishizaka "ishizaka", // Mary Jackson, American mathematician and aerospace engineer who earned the highest title within NASA's engineering department - https://en.wikipedia.org/wiki/Mary_Jackson_(engineer) "jackson", // Yeong-Sil Jang was a Korean scientist and astronomer during the Joseon Dynasty; he invented the first metal printing press and water gauge. https://en.wikipedia.org/wiki/Jang_Yeong-sil "jang", // Betty Jennings - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Jean_Bartik "jennings", // Mary Lou Jepsen, was the founder and chief technology officer of One Laptop Per Child (OLPC), and the founder of Pixel Qi. https://en.wikipedia.org/wiki/Mary_Lou_Jepsen "jepsen", // Katherine Coleman Goble Johnson - American physicist and mathematician contributed to the NASA. https://en.wikipedia.org/wiki/Katherine_Johnson "johnson", // Irène Joliot-Curie - French scientist who was awarded the Nobel Prize for Chemistry in 1935. Daughter of Marie and Pierre Curie. https://en.wikipedia.org/wiki/Ir%C3%A8ne_Joliot-Curie "joliot", // Karen Spärck Jones came up with the concept of inverse document frequency, which is used in most search engines today. https://en.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones "jones", // A. P. J. Abdul Kalam - is an Indian scientist aka Missile Man of India for his work on the development of ballistic missile and launch vehicle technology - https://en.wikipedia.org/wiki/A._P._J._Abdul_Kalam "kalam", // Sergey Petrovich Kapitsa (Russian: Серге́й Петро́вич Капи́ца; 14 February 1928 – 14 August 2012) was a Russian physicist and demographer. He was best known as host of the popular and long-running Russian scientific TV show, Evident, but Incredible. His father was the Nobel laureate Soviet-era physicist Pyotr Kapitsa, and his brother was the geographer and Antarctic explorer Andrey Kapitsa. - https://en.wikipedia.org/wiki/Sergey_Kapitsa "kapitsa", // Susan Kare, created the icons and many of the interface elements for the original Apple Macintosh in the 1980s, and was an original employee of NeXT, working as the Creative Director. https://en.wikipedia.org/wiki/Susan_Kare "kare", // Mstislav Keldysh - a Soviet scientist in the field of mathematics and mechanics, academician of the USSR Academy of Sciences (1946), President of the USSR Academy of Sciences (1961–1975), three times Hero of Socialist Labor (1956, 1961, 1971), fellow of the Royal Society of Edinburgh (1968). https://en.wikipedia.org/wiki/Mstislav_Keldysh "keldysh", // Mary Kenneth Keller, Sister Mary Kenneth Keller became the first American woman to earn a PhD in Computer Science in 1965. https://en.wikipedia.org/wiki/Mary_Kenneth_Keller "keller", // Johannes Kepler, German astronomer known for his three laws of planetary motion - https://en.wikipedia.org/wiki/Johannes_Kepler "kepler", // Omar Khayyam - Persian mathematician, astronomer and poet. Known for his work on the classification and solution of cubic equations, for his contribution to the understanding of Euclid's fifth postulate and for computing the length of a year very accurately. https://en.wikipedia.org/wiki/Omar_Khayyam "khayyam", // Har Gobind Khorana - Indian-American biochemist who shared the 1968 Nobel Prize for Physiology - https://en.wikipedia.org/wiki/Har_Gobind_Khorana "khorana", // Jack Kilby invented silicone integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Jack_Kilby "kilby", // Maria Kirch - German astronomer and first woman to discover a comet - https://en.wikipedia.org/wiki/Maria_Margarethe_Kirch "kirch", // Donald Knuth - American computer scientist, author of "The Art of Computer Programming" and creator of the TeX typesetting system. https://en.wikipedia.org/wiki/Donald_Knuth "knuth", // Sophie Kowalevski - Russian mathematician responsible for important original contributions to analysis, differential equations and mechanics - https://en.wikipedia.org/wiki/Sofia_Kovalevskaya "kowalevski", // Marie-Jeanne de Lalande - French astronomer, mathematician and cataloguer of stars - https://en.wikipedia.org/wiki/Marie-Jeanne_de_Lalande "lalande", // Hedy Lamarr - Actress and inventor. The principles of her work are now incorporated into modern Wi-Fi, CDMA and Bluetooth technology. https://en.wikipedia.org/wiki/Hedy_Lamarr "lamarr", // Leslie B. Lamport - American computer scientist. Lamport is best known for his seminal work in distributed systems and was the winner of the 2013 Turing Award. https://en.wikipedia.org/wiki/Leslie_Lamport "lamport", // Mary Leakey - British paleoanthropologist who discovered the first fossilized Proconsul skull - https://en.wikipedia.org/wiki/Mary_Leakey "leakey", // Henrietta Swan Leavitt - she was an American astronomer who discovered the relation between the luminosity and the period of Cepheid variable stars. https://en.wikipedia.org/wiki/Henrietta_Swan_Leavitt "leavitt", // Esther Miriam Zimmer Lederberg - American microbiologist and a pioneer of bacterial genetics. https://en.wikipedia.org/wiki/Esther_Lederberg "lederberg", // Inge Lehmann - Danish seismologist and geophysicist. Known for discovering in 1936 that the Earth has a solid inner core inside a molten outer core. https://en.wikipedia.org/wiki/Inge_Lehmann "lehmann", // Daniel Lewin - Mathematician, Akamai co-founder, soldier, 9/11 victim-- Developed optimization techniques for routing traffic on the internet. Died attempting to stop the 9-11 hijackers. https://en.wikipedia.org/wiki/Daniel_Lewin "lewin", // Ruth Lichterman - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Ruth_Teitelbaum "lichterman", // Barbara Liskov - co-developed the Liskov substitution principle. Liskov was also the winner of the Turing Prize in 2008. - https://en.wikipedia.org/wiki/Barbara_Liskov "liskov", // Ada Lovelace invented the first algorithm. https://en.wikipedia.org/wiki/Ada_Lovelace (thanks James Turnbull) "lovelace", // Auguste and Louis Lumière - the first filmmakers in history - https://en.wikipedia.org/wiki/Auguste_and_Louis_Lumi%C3%A8re "lumiere", // Mahavira - Ancient Indian mathematician during 9th century AD who discovered basic algebraic identities - https://en.wikipedia.org/wiki/Mah%C4%81v%C4%ABra_(mathematician) "mahavira", // Lynn Margulis (b. Lynn Petra Alexander) - an American evolutionary theorist and biologist, science author, educator, and popularizer, and was the primary modern proponent for the significance of symbiosis in evolution. - https://en.wikipedia.org/wiki/Lynn_Margulis "margulis", // Yukihiro Matsumoto - Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language. https://en.wikipedia.org/wiki/Yukihiro_Matsumoto "matsumoto", // James Clerk Maxwell - Scottish physicist, best known for his formulation of electromagnetic theory. https://en.wikipedia.org/wiki/James_Clerk_Maxwell "maxwell", // Maria Mayer - American theoretical physicist and Nobel laureate in Physics for proposing the nuclear shell model of the atomic nucleus - https://en.wikipedia.org/wiki/Maria_Mayer "mayer", // John McCarthy invented LISP: https://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist) "mccarthy", // Barbara McClintock - a distinguished American cytogeneticist, 1983 Nobel Laureate in Physiology or Medicine for discovering transposons. https://en.wikipedia.org/wiki/Barbara_McClintock "mcclintock", // Anne Laura Dorinthea McLaren - British developmental biologist whose work helped lead to human in-vitro fertilisation. https://en.wikipedia.org/wiki/Anne_McLaren "mclaren", // Malcolm McLean invented the modern shipping container: https://en.wikipedia.org/wiki/Malcom_McLean "mclean", // Kay McNulty - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli "mcnulty", // Gregor Johann Mendel - Czech scientist and founder of genetics. https://en.wikipedia.org/wiki/Gregor_Mendel "mendel", // Dmitri Mendeleev - a chemist and inventor. He formulated the Periodic Law, created a farsighted version of the periodic table of elements, and used it to correct the properties of some already discovered elements and also to predict the properties of eight elements yet to be discovered. https://en.wikipedia.org/wiki/Dmitri_Mendeleev "mendeleev", // Lise Meitner - Austrian/Swedish physicist who was involved in the discovery of nuclear fission. The element meitnerium is named after her - https://en.wikipedia.org/wiki/Lise_Meitner "meitner", // Carla Meninsky, was the game designer and programmer for Atari 2600 games Dodge 'Em and Warlords. https://en.wikipedia.org/wiki/Carla_Meninsky "meninsky", // Ralph C. Merkle - American computer scientist, known for devising Merkle's puzzles - one of the very first schemes for public-key cryptography. Also, inventor of Merkle trees and co-inventor of the Merkle-Damgård construction for building collision-resistant cryptographic hash functions and the Merkle-Hellman knapsack cryptosystem. https://en.wikipedia.org/wiki/Ralph_Merkle "merkle", // Johanna Mestorf - German prehistoric archaeologist and first female museum director in Germany - https://en.wikipedia.org/wiki/Johanna_Mestorf "mestorf", // Marvin Minsky - Pioneer in Artificial Intelligence, co-founder of the MIT's AI Lab, won the Turing Award in 1969. https://en.wikipedia.org/wiki/Marvin_Minsky "minsky", // Maryam Mirzakhani - an Iranian mathematician and the first woman to win the Fields Medal. https://en.wikipedia.org/wiki/Maryam_Mirzakhani "mirzakhani", // Gordon Earle Moore - American engineer, Silicon Valley founding father, author of Moore's law. https://en.wikipedia.org/wiki/Gordon_Moore "moore", // Samuel Morse - contributed to the invention of a single-wire telegraph system based on European telegraphs and was a co-developer of the Morse code - https://en.wikipedia.org/wiki/Samuel_Morse "morse", // Ian Murdock - founder of the Debian project - https://en.wikipedia.org/wiki/Ian_Murdock "murdock", // May-Britt Moser - Nobel prize winner neuroscientist who contributed to the discovery of grid cells in the brain. https://en.wikipedia.org/wiki/May-Britt_Moser "moser", // John Napier of Merchiston - Scottish landowner known as an astronomer, mathematician and physicist. Best known for his discovery of logarithms. https://en.wikipedia.org/wiki/John_Napier "napier", // John Forbes Nash, Jr. - American mathematician who made fundamental contributions to game theory, differential geometry, and the study of partial differential equations. https://en.wikipedia.org/wiki/John_Forbes_Nash_Jr. "nash", // John von Neumann - todays computer architectures are based on the von Neumann architecture. https://en.wikipedia.org/wiki/Von_Neumann_architecture "neumann", // Isaac Newton invented classic mechanics and modern optics. https://en.wikipedia.org/wiki/Isaac_Newton "newton", // Xavier Niel - ;) https://en.wikipedia.org/wiki/Xavier_Niel "niel", // Florence Nightingale, more prominently known as a nurse, was also the first female member of the Royal Statistical Society and a pioneer in statistical graphics https://en.wikipedia.org/wiki/Florence_Nightingale#Statistics_and_sanitary_reform "nightingale", // Alfred Nobel - a Swedish chemist, engineer, innovator, and armaments manufacturer (inventor of dynamite) - https://en.wikipedia.org/wiki/Alfred_Nobel "nobel", // Emmy Noether, German mathematician. Noether's Theorem is named after her. https://en.wikipedia.org/wiki/Emmy_Noether "noether", // Poppy Northcutt. Poppy Northcutt was the first woman to work as part of NASA’s Mission Control. http://www.businessinsider.com/poppy-northcutt-helped-apollo-astronauts-2014-12?op=1 "northcutt", // Robert Noyce invented silicone integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Robert_Noyce "noyce", // Panini - Ancient Indian linguist and grammarian from 4th century CE who worked on the world's first formal system - https://en.wikipedia.org/wiki/P%C4%81%E1%B9%87ini#Comparison_with_modern_formal_systems "panini", // Ambroise Pare invented modern surgery. https://en.wikipedia.org/wiki/Ambroise_Par%C3%A9 "pare", // Blaise Pascal, French mathematician, physicist, and inventor - https://en.wikipedia.org/wiki/Blaise_Pascal "pascal", // Louis Pasteur discovered vaccination, fermentation and pasteurization. https://en.wikipedia.org/wiki/Louis_Pasteur. "pasteur", // Cecilia Payne-Gaposchkin was an astronomer and astrophysicist who, in 1925, proposed in her Ph.D. thesis an explanation for the composition of stars in terms of the relative abundances of hydrogen and helium. https://en.wikipedia.org/wiki/Cecilia_Payne-Gaposchkin "payne", // Radia Perlman is a software designer and network engineer and most famous for her invention of the spanning-tree protocol (STP). https://en.wikipedia.org/wiki/Radia_Perlman "perlman", // Rob Pike was a key contributor to Unix, Plan 9, the X graphic system, utf-8, and the Go programming language. https://en.wikipedia.org/wiki/Rob_Pike "pike", // Henri Poincaré made fundamental contributions in several fields of mathematics. https://en.wikipedia.org/wiki/Henri_Poincar%C3%A9 "poincare", // Laura Poitras is a director and producer whose work, made possible by open source crypto tools, advances the causes of truth and freedom of information by reporting disclosures by whistleblowers such as Edward Snowden. https://en.wikipedia.org/wiki/Laura_Poitras "poitras", // Tat’yana Avenirovna Proskuriakova (Russian: Татья́на Авени́ровна Проскуряко́ва) (January 23 [O.S. January 10] 1909 – August 30, 1985) was a Russian-American Mayanist scholar and archaeologist who contributed significantly to the deciphering of Maya hieroglyphs, the writing system of the pre-Columbian Maya civilization of Mesoamerica. https://en.wikipedia.org/wiki/Tatiana_Proskouriakoff "proskuriakova", // Claudius Ptolemy - a Greco-Egyptian writer of Alexandria, known as a mathematician, astronomer, geographer, astrologer, and poet of a single epigram in the Greek Anthology - https://en.wikipedia.org/wiki/Ptolemy "ptolemy", // C. V. Raman - Indian physicist who won the Nobel Prize in 1930 for proposing the Raman effect. - https://en.wikipedia.org/wiki/C._V._Raman "raman", // Srinivasa Ramanujan - Indian mathematician and autodidact who made extraordinary contributions to mathematical analysis, number theory, infinite series, and continued fractions. - https://en.wikipedia.org/wiki/Srinivasa_Ramanujan "ramanujan", // Sally Kristen Ride was an American physicist and astronaut. She was the first American woman in space, and the youngest American astronaut. https://en.wikipedia.org/wiki/Sally_Ride "ride", // Rita Levi-Montalcini - Won Nobel Prize in Physiology or Medicine jointly with colleague Stanley Cohen for the discovery of nerve growth factor (https://en.wikipedia.org/wiki/Rita_Levi-Montalcini) "montalcini", // Dennis Ritchie - co-creator of UNIX and the C programming language. - https://en.wikipedia.org/wiki/Dennis_Ritchie "ritchie", // Ida Rhodes - American pioneer in computer programming, designed the first computer used for Social Security. https://en.wikipedia.org/wiki/Ida_Rhodes "rhodes", // Julia Hall Bowman Robinson - American mathematician renowned for her contributions to the fields of computability theory and computational complexity theory. https://en.wikipedia.org/wiki/Julia_Robinson "robinson", // Wilhelm Conrad Röntgen - German physicist who was awarded the first Nobel Prize in Physics in 1901 for the discovery of X-rays (Röntgen rays). https://en.wikipedia.org/wiki/Wilhelm_R%C3%B6ntgen "roentgen", // Rosalind Franklin - British biophysicist and X-ray crystallographer whose research was critical to the understanding of DNA - https://en.wikipedia.org/wiki/Rosalind_Franklin "rosalind", // Vera Rubin - American astronomer who pioneered work on galaxy rotation rates. https://en.wikipedia.org/wiki/Vera_Rubin "rubin", // Meghnad Saha - Indian astrophysicist best known for his development of the Saha equation, used to describe chemical and physical conditions in stars - https://en.wikipedia.org/wiki/Meghnad_Saha "saha", // Jean E. Sammet developed FORMAC, the first widely used computer language for symbolic manipulation of mathematical formulas. https://en.wikipedia.org/wiki/Jean_E._Sammet "sammet", // Mildred Sanderson - American mathematician best known for Sanderson's theorem concerning modular invariants. https://en.wikipedia.org/wiki/Mildred_Sanderson "sanderson", // Satoshi Nakamoto is the name used by the unknown person or group of people who developed bitcoin, authored the bitcoin white paper, and created and deployed bitcoin's original reference implementation. https://en.wikipedia.org/wiki/Satoshi_Nakamoto "satoshi", // Adi Shamir - Israeli cryptographer whose numerous inventions and contributions to cryptography include the Ferge Fiat Shamir identification scheme, the Rivest Shamir Adleman (RSA) public-key cryptosystem, the Shamir's secret sharing scheme, the breaking of the Merkle-Hellman cryptosystem, the TWINKLE and TWIRL factoring devices and the discovery of differential cryptanalysis (with Eli Biham). https://en.wikipedia.org/wiki/Adi_Shamir "shamir", // Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon) "shannon", // Carol Shaw - Originally an Atari employee, Carol Shaw is said to be the first female video game designer. https://en.wikipedia.org/wiki/Carol_Shaw_(video_game_designer) "shaw", // Dame Stephanie "Steve" Shirley - Founded a software company in 1962 employing women working from home. https://en.wikipedia.org/wiki/Steve_Shirley "shirley", // William Shockley co-invented the transistor - https://en.wikipedia.org/wiki/William_Shockley "shockley", // Lina Solomonovna Stern (or Shtern; Russian: Лина Соломоновна Штерн; 26 August 1878 – 7 March 1968) was a Soviet biochemist, physiologist and humanist whose medical discoveries saved thousands of lives at the fronts of World War II. She is best known for her pioneering work on blood–brain barrier, which she described as hemato-encephalic barrier in 1921. https://en.wikipedia.org/wiki/Lina_Stern "shtern", // Françoise Barré-Sinoussi - French virologist and Nobel Prize Laureate in Physiology or Medicine; her work was fundamental in identifying HIV as the cause of AIDS. https://en.wikipedia.org/wiki/Fran%C3%A7oise_Barr%C3%A9-Sinoussi "sinoussi", // Betty Snyder - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Betty_Holberton "snyder", // Cynthia Solomon - Pioneer in the fields of artificial intelligence, computer science and educational computing. Known for creation of Logo, an educational programming language. https://en.wikipedia.org/wiki/Cynthia_Solomon "solomon", // Frances Spence - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Frances_Spence "spence", // Richard Matthew Stallman - the founder of the Free Software movement, the GNU project, the Free Software Foundation, and the League for Programming Freedom. He also invented the concept of copyleft to protect the ideals of this movement, and enshrined this concept in the widely-used GPL (General Public License) for software. https://en.wikiquote.org/wiki/Richard_Stallman "stallman", // Michael Stonebraker is a database research pioneer and architect of Ingres, Postgres, VoltDB and SciDB. Winner of 2014 ACM Turing Award. https://en.wikipedia.org/wiki/Michael_Stonebraker "stonebraker", // Ivan Edward Sutherland - American computer scientist and Internet pioneer, widely regarded as the father of computer graphics. https://en.wikipedia.org/wiki/Ivan_Sutherland "sutherland", // Janese Swanson (with others) developed the first of the Carmen Sandiego games. She went on to found Girl Tech. https://en.wikipedia.org/wiki/Janese_Swanson "swanson", // Aaron Swartz was influential in creating RSS, Markdown, Creative Commons, Reddit, and much of the internet as we know it today. He was devoted to freedom of information on the web. https://en.wikiquote.org/wiki/Aaron_Swartz "swartz", // Bertha Swirles was a theoretical physicist who made a number of contributions to early quantum theory. https://en.wikipedia.org/wiki/Bertha_Swirles "swirles", // Helen Brooke Taussig - American cardiologist and founder of the field of paediatric cardiology. https://en.wikipedia.org/wiki/Helen_B._Taussig "taussig", // Valentina Tereshkova is a Russian engineer, cosmonaut and politician. She was the first woman to fly to space in 1963. In 2013, at the age of 76, she offered to go on a one-way mission to Mars. https://en.wikipedia.org/wiki/Valentina_Tereshkova "tereshkova", // Nikola Tesla invented the AC electric system and every gadget ever used by a James Bond villain. https://en.wikipedia.org/wiki/Nikola_Tesla "tesla", // Marie Tharp - American geologist and oceanic cartographer who co-created the first scientific map of the Atlantic Ocean floor. Her work led to the acceptance of the theories of plate tectonics and continental drift. https://en.wikipedia.org/wiki/Marie_Tharp "tharp", // Ken Thompson - co-creator of UNIX and the C programming language - https://en.wikipedia.org/wiki/Ken_Thompson "thompson", // Linus Torvalds invented Linux and Git. https://en.wikipedia.org/wiki/Linus_Torvalds "torvalds", // Youyou Tu - Chinese pharmaceutical chemist and educator known for discovering artemisinin and dihydroartemisinin, used to treat malaria, which has saved millions of lives. Joint winner of the 2015 Nobel Prize in Physiology or Medicine. https://en.wikipedia.org/wiki/Tu_Youyou "tu", // Alan Turing was a founding father of computer science. https://en.wikipedia.org/wiki/Alan_Turing. "turing", // Varahamihira - Ancient Indian mathematician who discovered trigonometric formulae during 505-587 CE - https://en.wikipedia.org/wiki/Var%C4%81hamihira#Contributions "varahamihira", // Dorothy Vaughan was a NASA mathematician and computer programmer on the SCOUT launch vehicle program that put America's first satellites into space - https://en.wikipedia.org/wiki/Dorothy_Vaughan "vaughan", // Sir Mokshagundam Visvesvaraya - is a notable Indian engineer. He is a recipient of the Indian Republic's highest honour, the Bharat Ratna, in 1955. On his birthday, 15 September is celebrated as Engineer's Day in India in his memory - https://en.wikipedia.org/wiki/Visvesvaraya "visvesvaraya", // Christiane Nüsslein-Volhard - German biologist, won Nobel Prize in Physiology or Medicine in 1995 for research on the genetic control of embryonic development. https://en.wikipedia.org/wiki/Christiane_N%C3%BCsslein-Volhard "volhard", // Cédric Villani - French mathematician, won Fields Medal, Fermat Prize and Poincaré Price for his work in differential geometry and statistical mechanics. https://en.wikipedia.org/wiki/C%C3%A9dric_Villani "villani", // Marlyn Wescoff - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Marlyn_Meltzer "wescoff", // Sylvia B. Wilbur - British computer scientist who helped develop the ARPANET, was one of the first to exchange email in the UK and a leading researcher in computer-supported collaborative work. https://en.wikipedia.org/wiki/Sylvia_Wilbur "wilbur", // Andrew Wiles - Notable British mathematician who proved the enigmatic Fermat's Last Theorem - https://en.wikipedia.org/wiki/Andrew_Wiles "wiles", // Roberta Williams, did pioneering work in graphical adventure games for personal computers, particularly the King's Quest series. https://en.wikipedia.org/wiki/Roberta_Williams "williams", // Malcolm John Williamson - British mathematician and cryptographer employed by the GCHQ. Developed in 1974 what is now known as Diffie-Hellman key exchange (Diffie and Hellman first published the scheme in 1976). https://en.wikipedia.org/wiki/Malcolm_J._Williamson "williamson", // Sophie Wilson designed the first Acorn Micro-Computer and the instruction set for ARM processors. https://en.wikipedia.org/wiki/Sophie_Wilson "wilson", // Jeannette Wing - co-developed the Liskov substitution principle. - https://en.wikipedia.org/wiki/Jeannette_Wing "wing", // Steve Wozniak invented the Apple I and Apple II. https://en.wikipedia.org/wiki/Steve_Wozniak "wozniak", // The Wright brothers, Orville and Wilbur - credited with inventing and building the world's first successful airplane and making the first controlled, powered and sustained heavier-than-air human flight - https://en.wikipedia.org/wiki/Wright_brothers "wright", // Chien-Shiung Wu - Chinese-American experimental physicist who made significant contributions to nuclear physics. https://en.wikipedia.org/wiki/Chien-Shiung_Wu "wu", // Rosalyn Sussman Yalow - Rosalyn Sussman Yalow was an American medical physicist, and a co-winner of the 1977 Nobel Prize in Physiology or Medicine for development of the radioimmunoassay technique. https://en.wikipedia.org/wiki/Rosalyn_Sussman_Yalow "yalow", // Ada Yonath - an Israeli crystallographer, the first woman from the Middle East to win a Nobel prize in the sciences. https://en.wikipedia.org/wiki/Ada_Yonath "yonath", // Nikolay Yegorovich Zhukovsky (Russian: Никола́й Его́рович Жуко́вский, January 17 1847 – March 17, 1921) was a Russian scientist, mathematician and engineer, and a founding father of modern aero- and hydrodynamics. Whereas contemporary scientists scoffed at the idea of human flight, Zhukovsky was the first to undertake the study of airflow. He is often called the Father of Russian Aviation. https://en.wikipedia.org/wiki/Nikolay_Yegorovich_Zhukovsky "zhukovsky", } ) // GetRandomName generates a random name from the list of adjectives and surnames in this package // formatted as "scw-adjective-surname". For example 'scw-focused-turing'. func GetRandomName(prefixes ...string) string { begin: parts := append(prefixes, left[r.Intn(len(left))], right[r.Intn(len(right))]) name := strings.Join(parts, "-") if strings.Contains(name, "boring-wozniak") /* Steve Wozniak is not boring */ { goto begin } return name } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/������������������������������������0000775�0000000�0000000�00000000000�13771713062�0024415�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/README.md���������������������������0000664�0000000�0000000�00000010610�13771713062�0025672�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# Scaleway config ## TL;DR Recommended config file: ```yaml # Get your credentials on https://console.scaleway.com/project/credentials access_key: SCWXXXXXXXXXXXXXXXXX secret_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx default_organization_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx default_project_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx default_region: fr-par default_zone: fr-par-1 ``` ## Config file path The function [`GetConfigPath`](https://godoc.org/github.com/scaleway/scaleway-sdk-go/scw#GetConfigPath) will try to locate the config file in the following ways: 1. Custom directory: `$SCW_CONFIG_PATH` 2. [XDG base directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html): `$XDG_CONFIG_HOME/scw/config.yaml` 3. Unix home directory: `$HOME/.config/scw/config.yaml` 4. Windows home directory: `%USERPROFILE%/.config/scw/config.yaml` ## V1 config (DEPRECATED) The V1 config (AKA legacy config) `.scwrc` is deprecated. To migrate the V1 config to the new format use the function [`MigrateLegacyConfig`](https://godoc.org/github.com/scaleway/scaleway-sdk-go/scw#MigrateLegacyConfig), this will create a [proper config file](#tl-dr) the new [config file path](#config-file-path). ## Reading config order [ClientOption](https://godoc.org/github.com/scaleway/scaleway-sdk-go/scw#ClientOption) ordering will decide the order in which the config should apply: ```go p, _ := scw.MustLoadConfig().GetActiveProfile() scw.NewClient( scw.WithProfile(p), // active profile applies first scw.WithEnv(), // existing env variables may overwrite active profile scw.WithDefaultRegion(scw.RegionFrPar) // any prior region set will be discarded to usr the new one ) ``` ## Environment variables | Variable | Description | Legacy variables | | :----------------------------- | :----------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------ | | `$SCW_ACCESS_KEY` | Access key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCALEWAY_ACCESS_KEY` (used by terraform) | | `$SCW_SECRET_KEY` | Secret key of a token ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_TOKEN` (used by cli), `$SCALEWAY_TOKEN` (used by terraform), `$SCALEWAY_ACCESS_KEY` (used by terraform) | | `$SCW_DEFAULT_ORGANIZATION_ID` | Your default organization ID ([get yours](https://console.scaleway.com/project/credentials)) | `$SCW_ORGANIZATION` (used by cli),`$SCALEWAY_ORGANIZATION` (used by terraform) | | `$SCW_DEFAULT_PROJECT_ID` | Your default project ID ([get yours](https://console.scaleway.com/project/credentials)) | | | `$SCW_DEFAULT_REGION` | Your default [region](https://developers.scaleway.com/en/quickstart/#region-and-zone) | `$SCW_REGION` (used by cli),`$SCALEWAY_REGION` (used by terraform) | | `$SCW_DEFAULT_ZONE` | Your default [availability zone](https://developers.scaleway.com/en/quickstart/#region-and-zone) | `$SCW_ZONE` (used by cli),`$SCALEWAY_ZONE` (used by terraform) | | `$SCW_API_URL` | Url of the API | - | | `$SCW_INSECURE` | Set this to `true` to enable the insecure mode | `$SCW_TLSVERIFY` (inverse flag used by the cli) | | `$SCW_PROFILE` | Set the config profile to use | - | ������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/client.go���������������������������0000664�0000000�0000000�00000024372�13771713062�0026232�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "crypto/tls" "encoding/json" "io" "math" "net" "net/http" "net/http/httputil" "reflect" "strconv" "sync/atomic" "time" "github.com/scaleway/scaleway-sdk-go/internal/auth" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/logger" ) // Client is the Scaleway client which performs API requests. // // This client should be passed in the `NewApi` functions whenever an API instance is created. // Creating a Client is done with the `NewClient` function. type Client struct { httpClient httpClient auth auth.Auth apiURL string userAgent string defaultOrganizationID *string defaultProjectID *string defaultRegion *Region defaultZone *Zone defaultPageSize *uint32 } func defaultOptions() []ClientOption { return []ClientOption{ WithoutAuth(), WithAPIURL("https://api.scaleway.com"), withDefaultUserAgent(userAgent), } } // NewClient instantiate a new Client object. // // Zero or more ClientOption object can be passed as a parameter. // These options will then be applied to the client. func NewClient(opts ...ClientOption) (*Client, error) { s := newSettings() // apply options s.apply(append(defaultOptions(), opts...)) // validate settings err := s.validate() if err != nil { return nil, err } // dial the API if s.httpClient == nil { s.httpClient = newHTTPClient() } // insecure mode if s.insecure { logger.Debugf("client: using insecure mode") setInsecureMode(s.httpClient) } logger.Debugf("client: using sdk version " + version) return &Client{ auth: s.token, httpClient: s.httpClient, apiURL: s.apiURL, userAgent: s.userAgent, defaultOrganizationID: s.defaultOrganizationID, defaultProjectID: s.defaultProjectID, defaultRegion: s.defaultRegion, defaultZone: s.defaultZone, defaultPageSize: s.defaultPageSize, }, nil } // GetDefaultOrganizationID returns the default organization ID // of the client. This value can be set in the client option // WithDefaultOrganizationID(). Be aware this value can be empty. func (c *Client) GetDefaultOrganizationID() (organizationID string, exists bool) { if c.defaultOrganizationID != nil { return *c.defaultOrganizationID, true } return "", false } // GetDefaultProjectID returns the default project ID // of the client. This value can be set in the client option // WithDefaultProjectID(). Be aware this value can be empty. func (c *Client) GetDefaultProjectID() (projectID string, exists bool) { if c.defaultProjectID != nil { return *c.defaultProjectID, true } return "", false } // GetDefaultRegion returns the default region of the client. // This value can be set in the client option // WithDefaultRegion(). Be aware this value can be empty. func (c *Client) GetDefaultRegion() (region Region, exists bool) { if c.defaultRegion != nil { return *c.defaultRegion, true } return Region(""), false } // GetDefaultZone returns the default zone of the client. // This value can be set in the client option // WithDefaultZone(). Be aware this value can be empty. func (c *Client) GetDefaultZone() (zone Zone, exists bool) { if c.defaultZone != nil { return *c.defaultZone, true } return Zone(""), false } func (c *Client) GetSecretKey() (secretKey string, exists bool) { if token, isToken := c.auth.(*auth.Token); isToken { return token.SecretKey, isToken } return "", false } func (c *Client) GetAccessKey() (accessKey string, exists bool) { if token, isToken := c.auth.(*auth.Token); isToken { return token.AccessKey, isToken } return "", false } // GetDefaultPageSize returns the default page size of the client. // This value can be set in the client option // WithDefaultPageSize(). Be aware this value can be empty. func (c *Client) GetDefaultPageSize() (pageSize uint32, exists bool) { if c.defaultPageSize != nil { return *c.defaultPageSize, true } return 0, false } // Do performs HTTP request(s) based on the ScalewayRequest object. // RequestOptions are applied prior to doing the request. func (c *Client) Do(req *ScalewayRequest, res interface{}, opts ...RequestOption) (err error) { // apply request options req.apply(opts) // validate request options err = req.validate() if err != nil { return err } if req.auth == nil { req.auth = c.auth } if req.allPages { return c.doListAll(req, res) } return c.do(req, res) } // requestNumber auto increments on each do(). // This allows easy distinguishing of concurrently performed requests in log. var requestNumber uint32 // do performs a single HTTP request based on the ScalewayRequest object. func (c *Client) do(req *ScalewayRequest, res interface{}) (sdkErr error) { currentRequestNumber := atomic.AddUint32(&requestNumber, 1) if req == nil { return errors.New("request must be non-nil") } // build url url, sdkErr := req.getURL(c.apiURL) if sdkErr != nil { return sdkErr } logger.Debugf("creating %s request on %s", req.Method, url.String()) // build request httpRequest, err := http.NewRequest(req.Method, url.String(), req.Body) if err != nil { return errors.Wrap(err, "could not create request") } httpRequest.Header = req.getAllHeaders(req.auth, c.userAgent, false) if req.ctx != nil { httpRequest = httpRequest.WithContext(req.ctx) } if logger.ShouldLog(logger.LogLevelDebug) { // Keep original headers (before anonymization) originalHeaders := httpRequest.Header // Get anonymized headers httpRequest.Header = req.getAllHeaders(req.auth, c.userAgent, true) dump, err := httputil.DumpRequestOut(httpRequest, true) if err != nil { logger.Warningf("cannot dump outgoing request: %s", err) } else { var logString string logString += "\n--------------- Scaleway SDK REQUEST %d : ---------------\n" logString += "%s\n" logString += "---------------------------------------------------------" logger.Debugf(logString, currentRequestNumber, dump) } // Restore original headers before sending the request httpRequest.Header = originalHeaders } // execute request httpResponse, err := c.httpClient.Do(httpRequest) if err != nil { return errors.Wrap(err, "error executing request") } defer func() { closeErr := httpResponse.Body.Close() if sdkErr == nil && closeErr != nil { sdkErr = errors.Wrap(closeErr, "could not close http response") } }() if logger.ShouldLog(logger.LogLevelDebug) { dump, err := httputil.DumpResponse(httpResponse, true) if err != nil { logger.Warningf("cannot dump ingoing response: %s", err) } else { var logString string logString += "\n--------------- Scaleway SDK RESPONSE %d : ---------------\n" logString += "%s\n" logString += "----------------------------------------------------------" logger.Debugf(logString, currentRequestNumber, dump) } } sdkErr = hasResponseError(httpResponse) if sdkErr != nil { return sdkErr } if res != nil { contentType := httpResponse.Header.Get("Content-Type") switch contentType { case "application/json": err = json.NewDecoder(httpResponse.Body).Decode(&res) if err != nil { return errors.Wrap(err, "could not parse %s response body", contentType) } default: buffer, isBuffer := res.(io.Writer) if !isBuffer { return errors.Wrap(err, "could not handle %s response body with %T result type", contentType, buffer) } _, err := io.Copy(buffer, httpResponse.Body) if err != nil { return errors.Wrap(err, "could not copy %s response body", contentType) } } // Handle instance API X-Total-Count header xTotalCountStr := httpResponse.Header.Get("X-Total-Count") if legacyLister, isLegacyLister := res.(legacyLister); isLegacyLister && xTotalCountStr != "" { xTotalCount, err := strconv.Atoi(xTotalCountStr) if err != nil { return errors.Wrap(err, "could not parse X-Total-Count header") } legacyLister.UnsafeSetTotalCount(xTotalCount) } } return nil } type lister interface { UnsafeGetTotalCount() uint32 UnsafeAppend(interface{}) (uint32, error) } type legacyLister interface { UnsafeSetTotalCount(totalCount int) } const maxPageCount uint32 = math.MaxUint32 // doListAll collects all pages of a List request and aggregate all results on a single response. func (c *Client) doListAll(req *ScalewayRequest, res interface{}) (err error) { // check for lister interface if response, isLister := res.(lister); isLister { pageCount := maxPageCount for page := uint32(1); page <= pageCount; page++ { // set current page req.Query.Set("page", strconv.FormatUint(uint64(page), 10)) // request the next page nextPage := newVariableFromType(response) err := c.do(req, nextPage) if err != nil { return err } // append results pageSize, err := response.UnsafeAppend(nextPage) if err != nil { return err } if pageSize == 0 { return nil } // set total count on first request if pageCount == maxPageCount { totalCount := nextPage.(lister).UnsafeGetTotalCount() pageCount = (totalCount + pageSize - 1) / pageSize } } return nil } return errors.New("%T does not support pagination", res) } // newVariableFromType returns a variable set to the zero value of the given type func newVariableFromType(t interface{}) interface{} { // reflect.New always create a pointer, that's why we use reflect.Indirect before return reflect.New(reflect.Indirect(reflect.ValueOf(t)).Type()).Interface() } func newHTTPClient() *http.Client { return &http.Client{ Timeout: 30 * time.Second, Transport: &http.Transport{ DialContext: (&net.Dialer{Timeout: 5 * time.Second}).DialContext, TLSHandshakeTimeout: 5 * time.Second, ResponseHeaderTimeout: 30 * time.Second, MaxIdleConnsPerHost: 20, }, } } func setInsecureMode(c httpClient) { standardHTTPClient, ok := c.(*http.Client) if !ok { logger.Warningf("client: cannot use insecure mode with HTTP client of type %T", c) return } transportClient, ok := standardHTTPClient.Transport.(*http.Transport) if !ok { logger.Warningf("client: cannot use insecure mode with Transport client of type %T", standardHTTPClient.Transport) return } if transportClient.TLSClientConfig == nil { transportClient.TLSClientConfig = &tls.Config{} } transportClient.TLSClientConfig.InsecureSkipVerify = true } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/client_option.go��������������������0000664�0000000�0000000�00000016702�13771713062�0027620�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "net/http" "strings" "github.com/scaleway/scaleway-sdk-go/internal/auth" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/validation" ) // ClientOption is a function which applies options to a settings object. type ClientOption func(*settings) // httpClient wraps the net/http Client Do method type httpClient interface { Do(*http.Request) (*http.Response, error) } // WithHTTPClient client option allows passing a custom http.Client which will be used for all requests. func WithHTTPClient(httpClient httpClient) ClientOption { return func(s *settings) { s.httpClient = httpClient } } // WithoutAuth client option sets the client token to an empty token. func WithoutAuth() ClientOption { return func(s *settings) { s.token = auth.NewNoAuth() } } // WithAuth client option sets the client access key and secret key. func WithAuth(accessKey, secretKey string) ClientOption { return func(s *settings) { s.token = auth.NewToken(accessKey, secretKey) } } // WithAPIURL client option overrides the API URL of the Scaleway API to the given URL. func WithAPIURL(apiURL string) ClientOption { return func(s *settings) { s.apiURL = apiURL } } // WithInsecure client option enables insecure transport on the client. func WithInsecure() ClientOption { return func(s *settings) { s.insecure = true } } // WithUserAgent client option append a user agent to the default user agent of the SDK. func WithUserAgent(ua string) ClientOption { return func(s *settings) { if s.userAgent != "" && ua != "" { s.userAgent += " " } s.userAgent += ua } } // withDefaultUserAgent client option overrides the default user agent of the SDK. func withDefaultUserAgent(ua string) ClientOption { return func(s *settings) { s.userAgent = ua } } // WithProfile client option configures a client from the given profile. func WithProfile(p *Profile) ClientOption { return func(s *settings) { accessKey := "" if p.AccessKey != nil { accessKey = *p.AccessKey } if p.SecretKey != nil { s.token = auth.NewToken(accessKey, *p.SecretKey) } if p.APIURL != nil { s.apiURL = *p.APIURL } if p.Insecure != nil { s.insecure = *p.Insecure } if p.DefaultOrganizationID != nil { organizationID := *p.DefaultOrganizationID s.defaultOrganizationID = &organizationID } if p.DefaultProjectID != nil { projectID := *p.DefaultProjectID s.defaultProjectID = &projectID } if p.DefaultRegion != nil { defaultRegion := Region(*p.DefaultRegion) s.defaultRegion = &defaultRegion } if p.DefaultZone != nil { defaultZone := Zone(*p.DefaultZone) s.defaultZone = &defaultZone } } } // WithProfile client option configures a client from the environment variables. func WithEnv() ClientOption { return WithProfile(LoadEnvProfile()) } // WithDefaultOrganizationID client option sets the client default organization ID. // // It will be used as the default value of the organization_id field in all requests made with this client. func WithDefaultOrganizationID(organizationID string) ClientOption { return func(s *settings) { s.defaultOrganizationID = &organizationID } } // WithDefaultProjectID client option sets the client default project ID. // // It will be used as the default value of the projectID field in all requests made with this client. func WithDefaultProjectID(projectID string) ClientOption { return func(s *settings) { s.defaultProjectID = &projectID } } // WithDefaultRegion client option sets the client default region. // // It will be used as the default value of the region field in all requests made with this client. func WithDefaultRegion(region Region) ClientOption { return func(s *settings) { s.defaultRegion = &region } } // WithDefaultZone client option sets the client default zone. // // It will be used as the default value of the zone field in all requests made with this client. func WithDefaultZone(zone Zone) ClientOption { return func(s *settings) { s.defaultZone = &zone } } // WithDefaultPageSize client option overrides the default page size of the SDK. // // It will be used as the default value of the page_size field in all requests made with this client. func WithDefaultPageSize(pageSize uint32) ClientOption { return func(s *settings) { s.defaultPageSize = &pageSize } } // settings hold the values of all client options type settings struct { apiURL string token auth.Auth userAgent string httpClient httpClient insecure bool defaultOrganizationID *string defaultProjectID *string defaultRegion *Region defaultZone *Zone defaultPageSize *uint32 } func newSettings() *settings { return &settings{} } func (s *settings) apply(opts []ClientOption) { for _, opt := range opts { opt(s) } } func (s *settings) validate() error { // Auth. if s.token == nil { // It should not happen, WithoutAuth option is used by default. panic(errors.New("no credential option provided")) } if token, isToken := s.token.(*auth.Token); isToken { if token.AccessKey == "" { return NewInvalidClientOptionError("access key cannot be empty") } if !validation.IsAccessKey(token.AccessKey) { return NewInvalidClientOptionError("invalid access key format '%s', expected SCWXXXXXXXXXXXXXXXXX format", token.AccessKey) } if token.SecretKey == "" { return NewInvalidClientOptionError("secret key cannot be empty") } if !validation.IsSecretKey(token.SecretKey) { return NewInvalidClientOptionError("invalid secret key format '%s', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", token.SecretKey) } } // Default Organization ID. if s.defaultOrganizationID != nil { if *s.defaultOrganizationID == "" { return NewInvalidClientOptionError("default organization ID cannot be empty") } if !validation.IsOrganizationID(*s.defaultOrganizationID) { return NewInvalidClientOptionError("invalid organization ID format '%s', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", *s.defaultOrganizationID) } } // Default Project ID. if s.defaultProjectID != nil { if *s.defaultProjectID == "" { return NewInvalidClientOptionError("default project ID cannot be empty") } if !validation.IsProjectID(*s.defaultProjectID) { return NewInvalidClientOptionError("invalid project ID format '%s', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", *s.defaultProjectID) } } // Default Region. if s.defaultRegion != nil { if *s.defaultRegion == "" { return NewInvalidClientOptionError("default region cannot be empty") } if !validation.IsRegion(string(*s.defaultRegion)) { regions := []string(nil) for _, r := range AllRegions { regions = append(regions, string(r)) } return NewInvalidClientOptionError("invalid default region format '%s', available regions are: %s", *s.defaultRegion, strings.Join(regions, ", ")) } } // Default Zone. if s.defaultZone != nil { if *s.defaultZone == "" { return NewInvalidClientOptionError("default zone cannot be empty") } if !validation.IsZone(string(*s.defaultZone)) { zones := []string(nil) for _, z := range AllZones { zones = append(zones, string(z)) } return NewInvalidClientOptionError("invalid default zone format '%s', available zones are: %s", *s.defaultZone, strings.Join(zones, ", ")) } } // API URL. if !validation.IsURL(s.apiURL) { return NewInvalidClientOptionError("invalid url %s", s.apiURL) } // TODO: check for max s.defaultPageSize return nil } ��������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/config.go���������������������������0000664�0000000�0000000�00000027766�13771713062�0026233�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "bytes" "io/ioutil" "os" "path/filepath" "text/template" "github.com/scaleway/scaleway-sdk-go/internal/auth" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/logger" "gopkg.in/yaml.v2" ) const ( documentationLink = "https://github.com/scaleway/scaleway-sdk-go/blob/master/scw/README.md" defaultConfigPermission = 0600 // Reserved name for the default profile. DefaultProfileName = "default" ) const configFileTemplate = `# Scaleway configuration file # https://github.com/scaleway/scaleway-sdk-go/tree/master/scw#scaleway-config # This configuration file can be used with: # - Scaleway SDK Go (https://github.com/scaleway/scaleway-sdk-go) # - Scaleway CLI (>2.0.0) (https://github.com/scaleway/scaleway-cli) # - Scaleway Terraform Provider (https://www.terraform.io/docs/providers/scaleway/index.html) # You need an access key and a secret key to connect to Scaleway API. # Generate your token at the following address: https://console.scaleway.com/project/credentials # An access key is a secret key identifier. {{ if .AccessKey }}access_key: {{.AccessKey}}{{ else }}# access_key: SCW11111111111111111{{ end }} # The secret key is the value that can be used to authenticate against the API (the value used in X-Auth-Token HTTP-header). # The secret key MUST remain secret and not given to anyone or published online. {{ if .SecretKey }}secret_key: {{ .SecretKey }}{{ else }}# secret_key: 11111111-1111-1111-1111-111111111111{{ end }} # Your organization ID is the identifier of your account inside Scaleway infrastructure. {{ if .DefaultOrganizationID }}default_organization_id: {{ .DefaultOrganizationID }}{{ else }}# default_organization_id: 11111111-1111-1111-1111-111111111111{{ end }} # Your project ID is the identifier of the project your resources are attached to (beta). {{ if .DefaultProjectID }}default_project_id: {{ .DefaultProjectID }}{{ else }}# default_project_id: 11111111-1111-1111-1111-111111111111{{ end }} # A region is represented as a geographical area such as France (Paris) or the Netherlands (Amsterdam). # It can contain multiple availability zones. # Example of region: fr-par, nl-ams {{ if .DefaultRegion }}default_region: {{ .DefaultRegion }}{{ else }}# default_region: fr-par{{ end }} # A region can be split into many availability zones (AZ). # Latency between multiple AZ of the same region are low as they have a common network layer. # Example of zones: fr-par-1, nl-ams-1 {{ if .DefaultZone }}default_zone: {{.DefaultZone}}{{ else }}# default_zone: fr-par-1{{ end }} # APIURL overrides the API URL of the Scaleway API to the given URL. # Change that if you want to direct requests to a different endpoint. {{ if .APIURL }}apiurl: {{ .APIURL }}{{ else }}# api_url: https://api.scaleway.com{{ end }} # Insecure enables insecure transport on the client. # Default to false {{ if .Insecure }}insecure: {{ .Insecure }}{{ else }}# insecure: false{{ end }} # A configuration is a named set of Scaleway properties. # Starting off with a Scaleway SDK or Scaleway CLI, you’ll work with a single configuration named default. # You can set properties of the default profile by running either scw init or scw config set. # This single default configuration is suitable for most use cases. {{ if .ActiveProfile }}active_profile: {{ .ActiveProfile }}{{ else }}# active_profile: myProfile{{ end }} # To improve the Scaleway CLI we rely on diagnostic and usage data. # Sending such data is optional and can be disable at any time by setting send_telemetry variable to false. {{ if .SendTelemetry }}send_telemetry: {{ .SendTelemetry }}{{ else }}# send_telemetry: false{{ end }} # To work with multiple projects or authorization accounts, you can set up multiple configurations with scw config configurations create and switch among them accordingly. # You can use a profile by either: # - Define the profile you want to use as the SCW_PROFILE environment variable # - Use the GetActiveProfile() function in the SDK # - Use the --profile flag with the CLI # You can define a profile using the following syntax: {{ if gt (len .Profiles) 0 }} profiles: {{- range $k,$v := .Profiles }} {{ $k }}: {{ if $v.AccessKey }}access_key: {{ $v.AccessKey }}{{ else }}# access_key: SCW11111111111111111{{ end }} {{ if $v.SecretKey }}secret_key: {{ $v.SecretKey }}{{ else }}# secret_key: 11111111-1111-1111-1111-111111111111{{ end }} {{ if $v.DefaultOrganizationID }}default_organization_id: {{ $v.DefaultOrganizationID }}{{ else }}# default_organization_id: 11111111-1111-1111-1111-111111111111{{ end }} {{ if $v.DefaultProjectID }}default_project_id: {{ $v.DefaultProjectID }}{{ else }}# default_project_id: 11111111-1111-1111-1111-111111111111{{ end }} {{ if $v.DefaultZone }}default_zone: {{ $v.DefaultZone }}{{ else }}# default_zone: fr-par-1{{ end }} {{ if $v.DefaultRegion }}default_region: {{ $v.DefaultRegion }}{{ else }}# default_region: fr-par{{ end }} {{ if $v.APIURL }}api_url: {{ $v.APIURL }}{{ else }}# api_url: https://api.scaleway.com{{ end }} {{ if $v.Insecure }}insecure: {{ $v.Insecure }}{{ else }}# insecure: false{{ end }} {{ end }} {{- else }} # profiles: # myProfile: # access_key: 11111111-1111-1111-1111-111111111111 # secret_key: 11111111-1111-1111-1111-111111111111 # default_organization_id: 11111111-1111-1111-1111-111111111111 # default_project_id: 11111111-1111-1111-1111-111111111111 # default_zone: fr-par-1 # default_region: fr-par # api_url: https://api.scaleway.com # insecure: false {{ end -}} ` type Config struct { Profile `yaml:",inline"` ActiveProfile *string `yaml:"active_profile,omitempty" json:"active_profile,omitempty"` Profiles map[string]*Profile `yaml:"profiles,omitempty" json:"profiles,omitempty"` } type Profile struct { AccessKey *string `yaml:"access_key,omitempty" json:"access_key,omitempty"` SecretKey *string `yaml:"secret_key,omitempty" json:"secret_key,omitempty"` APIURL *string `yaml:"api_url,omitempty" json:"api_url,omitempty"` Insecure *bool `yaml:"insecure,omitempty" json:"insecure,omitempty"` DefaultOrganizationID *string `yaml:"default_organization_id,omitempty" json:"default_organization_id,omitempty"` DefaultProjectID *string `yaml:"default_project_id,omitempty" json:"default_project_id,omitempty"` DefaultRegion *string `yaml:"default_region,omitempty" json:"default_region,omitempty"` DefaultZone *string `yaml:"default_zone,omitempty" json:"default_zone,omitempty"` SendTelemetry *bool `yaml:"send_telemetry,omitempty" json:"send_telemetry,omitempty"` } func (p *Profile) String() string { p2 := *p p2.SecretKey = hideSecretKey(p2.SecretKey) configRaw, _ := yaml.Marshal(p2) return string(configRaw) } // clone deep copy config object func (c *Config) clone() *Config { c2 := &Config{} configRaw, _ := yaml.Marshal(c) _ = yaml.Unmarshal(configRaw, c2) return c2 } func (c *Config) String() string { c2 := c.clone() c2.SecretKey = hideSecretKey(c2.SecretKey) for _, p := range c2.Profiles { p.SecretKey = hideSecretKey(p.SecretKey) } configRaw, _ := yaml.Marshal(c2) return string(configRaw) } func (c *Config) IsEmpty() bool { return c.String() == "{}\n" } func hideSecretKey(key *string) *string { if key == nil { return nil } newKey := auth.HideSecretKey(*key) return &newKey } func unmarshalConfV2(content []byte) (*Config, error) { var config Config err := yaml.Unmarshal(content, &config) if err != nil { return nil, err } return &config, nil } // MustLoadConfig is like LoadConfig but panic instead of returning an error. func MustLoadConfig() *Config { c, err := LoadConfigFromPath(GetConfigPath()) if err != nil { panic(err) } return c } // LoadConfig read the config from the default path. func LoadConfig() (*Config, error) { return LoadConfigFromPath(GetConfigPath()) } // LoadConfigFromPath read the config from the given path. func LoadConfigFromPath(path string) (*Config, error) { _, err := os.Stat(path) if os.IsNotExist(err) { return nil, configFileNotFound(path) } if err != nil { return nil, err } file, err := ioutil.ReadFile(path) if err != nil { return nil, errors.Wrap(err, "cannot read config file") } _, err = unmarshalConfV1(file) if err == nil { // reject V1 config return nil, errors.New("found legacy config in %s: legacy config is not allowed, please switch to the new config file format: %s", path, documentationLink) } confV2, err := unmarshalConfV2(file) if err != nil { return nil, errors.Wrap(err, "content of config file %s is invalid", path) } return confV2, nil } // GetProfile returns the profile corresponding to the given profile name. func (c *Config) GetProfile(profileName string) (*Profile, error) { if profileName == "" { return nil, errors.New("profileName cannot be empty") } if profileName == DefaultProfileName { return &c.Profile, nil } p, exist := c.Profiles[profileName] if !exist { return nil, errors.New("given profile %s does not exist", profileName) } // Merge selected profile on top of default profile return MergeProfiles(&c.Profile, p), nil } // GetActiveProfile returns the active profile of the config based on the following order: // env SCW_PROFILE > config active_profile > config root profile func (c *Config) GetActiveProfile() (*Profile, error) { switch { case os.Getenv(ScwActiveProfileEnv) != "": logger.Debugf("using active profile from env: %s=%s", ScwActiveProfileEnv, os.Getenv(ScwActiveProfileEnv)) return c.GetProfile(os.Getenv(ScwActiveProfileEnv)) case c.ActiveProfile != nil: logger.Debugf("using active profile from config: active_profile=%s", ScwActiveProfileEnv, *c.ActiveProfile) return c.GetProfile(*c.ActiveProfile) default: return &c.Profile, nil } } // SaveTo will save the config to the default config path. This // action will overwrite the previous file when it exists. func (c *Config) Save() error { return c.SaveTo(GetConfigPath()) } // HumanConfig will generate a config file with documented arguments. func (c *Config) HumanConfig() (string, error) { tmpl, err := template.New("configuration").Parse(configFileTemplate) if err != nil { return "", err } var buf bytes.Buffer err = tmpl.Execute(&buf, c) if err != nil { return "", err } return buf.String(), nil } // SaveTo will save the config to the given path. This action will // overwrite the previous file when it exists. func (c *Config) SaveTo(path string) error { path = filepath.Clean(path) // STEP 1: Render the configuration file as a file file, err := c.HumanConfig() if err != nil { return err } // STEP 2: create config path dir in cases it didn't exist before err = os.MkdirAll(filepath.Dir(path), 0700) if err != nil { return err } // STEP 3: write new config file err = ioutil.WriteFile(path, []byte(file), defaultConfigPermission) if err != nil { return err } return nil } // MergeProfiles merges profiles in a new one. The last profile has priority. func MergeProfiles(original *Profile, others ...*Profile) *Profile { np := &Profile{ AccessKey: original.AccessKey, SecretKey: original.SecretKey, APIURL: original.APIURL, Insecure: original.Insecure, DefaultOrganizationID: original.DefaultOrganizationID, DefaultProjectID: original.DefaultProjectID, DefaultRegion: original.DefaultRegion, DefaultZone: original.DefaultZone, } for _, other := range others { if other.AccessKey != nil { np.AccessKey = other.AccessKey } if other.SecretKey != nil { np.SecretKey = other.SecretKey } if other.APIURL != nil { np.APIURL = other.APIURL } if other.Insecure != nil { np.Insecure = other.Insecure } if other.DefaultOrganizationID != nil { np.DefaultOrganizationID = other.DefaultOrganizationID } if other.DefaultProjectID != nil { np.DefaultProjectID = other.DefaultProjectID } if other.DefaultRegion != nil { np.DefaultRegion = other.DefaultRegion } if other.DefaultZone != nil { np.DefaultZone = other.DefaultZone } } return np } ����������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/config_legacy.go��������������������0000664�0000000�0000000�00000004470�13771713062�0027542�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "encoding/json" "io/ioutil" "os" "path/filepath" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/logger" "gopkg.in/yaml.v2" ) // configV1 is a Scaleway CLI configuration file type configV1 struct { // Organization is the identifier of the Scaleway organization Organization string `json:"organization"` // Token is the authentication token for the Scaleway organization Token string `json:"token"` // Version is the actual version of scw CLI Version string `json:"version"` } func unmarshalConfV1(content []byte) (*configV1, error) { var config configV1 err := json.Unmarshal(content, &config) if err != nil { return nil, err } return &config, err } func (v1 *configV1) toV2() *Config { return &Config{ Profile: Profile{ DefaultOrganizationID: &v1.Organization, DefaultProjectID: &v1.Organization, // v1 config is not aware of project, so default project is set to organization ID SecretKey: &v1.Token, // ignore v1 version }, } } // MigrateLegacyConfig will migrate the legacy config to the V2 when none exist yet. // Returns a boolean set to true when the migration happened. // TODO: get accesskey from account? func MigrateLegacyConfig() (bool, error) { // STEP 1: try to load config file V2 v2Path, v2PathOk := getConfigV2FilePath() if !v2PathOk || fileExist(v2Path) { return false, nil } // STEP 2: try to load config file V1 v1Path, v1PathOk := getConfigV1FilePath() if !v1PathOk { return false, nil } file, err := ioutil.ReadFile(v1Path) if err != nil { return false, nil } confV1, err := unmarshalConfV1(file) if err != nil { return false, errors.Wrap(err, "content of config file %s is invalid json", v1Path) } // STEP 3: create dir err = os.MkdirAll(filepath.Dir(v2Path), 0700) if err != nil { return false, errors.Wrap(err, "mkdir did not work on %s", filepath.Dir(v2Path)) } // STEP 4: marshal yaml config newConfig := confV1.toV2() file, err = yaml.Marshal(newConfig) if err != nil { return false, err } // STEP 5: save config err = ioutil.WriteFile(v2Path, file, defaultConfigPermission) if err != nil { return false, errors.Wrap(err, "cannot write file %s", v2Path) } // STEP 6: log success logger.Warningf("migrated existing config to %s", v2Path) return true, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/convert.go��������������������������0000664�0000000�0000000�00000007757�13771713062�0026444�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "net" "time" ) // StringPtr returns a pointer to the string value passed in. func StringPtr(v string) *string { return &v } // StringSlicePtr converts a slice of string values into a slice of // string pointers func StringSlicePtr(src []string) []*string { dst := make([]*string, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // StringsPtr returns a pointer to the []string value passed in. func StringsPtr(v []string) *[]string { return &v } // StringsSlicePtr converts a slice of []string values into a slice of // []string pointers func StringsSlicePtr(src [][]string) []*[]string { dst := make([]*[]string, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // BytesPtr returns a pointer to the []byte value passed in. func BytesPtr(v []byte) *[]byte { return &v } // BytesSlicePtr converts a slice of []byte values into a slice of // []byte pointers func BytesSlicePtr(src [][]byte) []*[]byte { dst := make([]*[]byte, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // BoolPtr returns a pointer to the bool value passed in. func BoolPtr(v bool) *bool { return &v } // BoolSlicePtr converts a slice of bool values into a slice of // bool pointers func BoolSlicePtr(src []bool) []*bool { dst := make([]*bool, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // Int32Ptr returns a pointer to the int32 value passed in. func Int32Ptr(v int32) *int32 { return &v } // Int32SlicePtr converts a slice of int32 values into a slice of // int32 pointers func Int32SlicePtr(src []int32) []*int32 { dst := make([]*int32, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // Int64Ptr returns a pointer to the int64 value passed in. func Int64Ptr(v int64) *int64 { return &v } // Int64SlicePtr converts a slice of int64 values into a slice of // int64 pointers func Int64SlicePtr(src []int64) []*int64 { dst := make([]*int64, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // Uint32Ptr returns a pointer to the uint32 value passed in. func Uint32Ptr(v uint32) *uint32 { return &v } // Uint32SlicePtr converts a slice of uint32 values into a slice of // uint32 pointers func Uint32SlicePtr(src []uint32) []*uint32 { dst := make([]*uint32, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // Uint64Ptr returns a pointer to the uint64 value passed in. func Uint64Ptr(v uint64) *uint64 { return &v } // Uint64SlicePtr converts a slice of uint64 values into a slice of // uint64 pointers func Uint64SlicePtr(src []uint64) []*uint64 { dst := make([]*uint64, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // Float32Ptr returns a pointer to the float32 value passed in. func Float32Ptr(v float32) *float32 { return &v } // Float32SlicePtr converts a slice of float32 values into a slice of // float32 pointers func Float32SlicePtr(src []float32) []*float32 { dst := make([]*float32, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // Float64Ptr returns a pointer to the float64 value passed in. func Float64Ptr(v float64) *float64 { return &v } // Float64SlicePtr converts a slice of float64 values into a slice of // float64 pointers func Float64SlicePtr(src []float64) []*float64 { dst := make([]*float64, len(src)) for i := 0; i < len(src); i++ { dst[i] = &(src[i]) } return dst } // TimeDurationPtr returns a pointer to the Duration value passed in. // Deprecated: the use of time.Duration in request is deprecated and only available in lb API func TimeDurationPtr(v time.Duration) *time.Duration { return &v } // TimePtr returns a pointer to the Time value passed in. func TimePtr(v time.Time) *time.Time { return &v } // SizePtr returns a pointer to the Size value passed in. func SizePtr(v Size) *Size { return &v } // IPPtr returns a pointer to the net.IP value passed in. func IPPtr(v net.IP) *net.IP { return &v } �����������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/custom_types.go���������������������0000664�0000000�0000000�00000020030�13771713062�0027475�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "bytes" "encoding/json" "fmt" "io" "net" "strconv" "strings" "time" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/logger" ) // ServiceInfo contains API metadata // These metadata are only here for debugging. Do not rely on these values type ServiceInfo struct { // Name is the name of the API Name string `json:"name"` // Description is a human readable description for the API Description string `json:"description"` // Version is the version of the API Version string `json:"version"` // DocumentationURL is the a web url where the documentation of the API can be found DocumentationURL *string `json:"documentation_url"` } // File is the structure used to receive / send a file from / to the API type File struct { // Name of the file Name string `json:"name"` // ContentType used in the HTTP header `Content-Type` ContentType string `json:"content_type"` // Content of the file Content io.Reader `json:"content"` } func (f *File) UnmarshalJSON(b []byte) error { type file File var tmpFile struct { file Content []byte `json:"content"` } err := json.Unmarshal(b, &tmpFile) if err != nil { return err } tmpFile.file.Content = bytes.NewReader(tmpFile.Content) *f = File(tmpFile.file) return nil } // Money represents an amount of money with its currency type. type Money struct { // CurrencyCode is the 3-letter currency code defined in ISO 4217. CurrencyCode string `json:"currency_code"` // Units is the whole units of the amount. // For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. Units int64 `json:"units"` // Nanos is the number of nano (10^-9) units of the amount. // The value must be between -999,999,999 and +999,999,999 inclusive. // If `units` is positive, `nanos` must be positive or zero. // If `units` is zero, `nanos` can be positive, zero, or negative. // If `units` is negative, `nanos` must be negative or zero. // For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. Nanos int32 `json:"nanos"` } // NewMoneyFromFloat converts a float with currency to a Money. // // value: The float value. // currencyCode: The 3-letter currency code defined in ISO 4217. // precision: The number of digits after the decimal point used to parse the nanos part of the value. // // Examples: // - (value = 1.3333, precision = 2) => Money{Units = 1, Nanos = 330000000} // - (value = 1.123456789, precision = 9) => Money{Units = 1, Nanos = 123456789} func NewMoneyFromFloat(value float64, currencyCode string, precision int) *Money { if precision > 9 { panic(fmt.Errorf("max precision is 9")) } strValue := strconv.FormatFloat(value, 'f', precision, 64) units, nanos, err := splitFloatString(strValue) if err != nil { panic(err) } return &Money{ CurrencyCode: currencyCode, Units: units, Nanos: nanos, } } // String returns the string representation of Money. func (m Money) String() string { currencySignsByCodes := map[string]string{ "EUR": "€", "USD": "$", } currencySign, currencySignFound := currencySignsByCodes[m.CurrencyCode] if !currencySignFound { logger.Debugf("%s currency code is not supported", m.CurrencyCode) currencySign = m.CurrencyCode } cents := fmt.Sprintf("%09d", m.Nanos) cents = cents[:2] + strings.TrimRight(cents[2:], "0") return fmt.Sprintf("%s %d.%s", currencySign, m.Units, cents) } // ToFloat converts a Money object to a float. func (m Money) ToFloat() float64 { return float64(m.Units) + float64(m.Nanos)/1e9 } // Size represents a size in bytes. type Size uint64 const ( B Size = 1 KB = 1000 * B MB = 1000 * KB GB = 1000 * MB TB = 1000 * GB PB = 1000 * TB ) // String returns the string representation of a Size. func (s Size) String() string { return fmt.Sprintf("%d", s) } // TimeSeries represents a time series that could be used for graph purposes. type TimeSeries struct { // Name of the metric. Name string `json:"name"` // Points contains all the points that composed the series. Points []*TimeSeriesPoint `json:"points"` // Metadata contains some string metadata related to a metric. Metadata map[string]string `json:"metadata"` } // TimeSeriesPoint represents a point of a time series. type TimeSeriesPoint struct { Timestamp time.Time Value float32 } func (tsp TimeSeriesPoint) MarshalJSON() ([]byte, error) { timestamp := tsp.Timestamp.Format(time.RFC3339) value, err := json.Marshal(tsp.Value) if err != nil { return nil, err } return []byte(`["` + timestamp + `",` + string(value) + "]"), nil } func (tsp *TimeSeriesPoint) UnmarshalJSON(b []byte) error { point := [2]interface{}{} err := json.Unmarshal(b, &point) if err != nil { return err } if len(point) != 2 { return fmt.Errorf("invalid point array") } strTimestamp, isStrTimestamp := point[0].(string) if !isStrTimestamp { return fmt.Errorf("%s timestamp is not a string in RFC 3339 format", point[0]) } timestamp, err := time.Parse(time.RFC3339, strTimestamp) if err != nil { return fmt.Errorf("%s timestamp is not in RFC 3339 format", point[0]) } tsp.Timestamp = timestamp // By default, JSON unmarshal a float in float64 but the TimeSeriesPoint is a float32 value. value, isValue := point[1].(float64) if !isValue { return fmt.Errorf("%s is not a valid float32 value", point[1]) } tsp.Value = float32(value) return nil } // IPNet inherits net.IPNet and represents an IP network. type IPNet struct { net.IPNet } func (n IPNet) MarshalJSON() ([]byte, error) { value := n.String() if value == "<nil>" { value = "" } return []byte(`"` + value + `"`), nil } func (n *IPNet) UnmarshalJSON(b []byte) error { var str string err := json.Unmarshal(b, &str) if err != nil { return err } if str == "" { *n = IPNet{} return nil } switch ip := net.ParseIP(str); { case ip.To4() != nil: str += "/32" case ip.To16() != nil: str += "/128" } _, value, err := net.ParseCIDR(str) if err != nil { return err } n.IPNet = *value return nil } // Duration represents a signed, fixed-length span of time represented as a // count of seconds and fractions of seconds at nanosecond resolution. It is // independent of any calendar and concepts like "day" or "month". It is related // to Timestamp in that the difference between two Timestamp values is a Duration // and it can be added or subtracted from a Timestamp. // Range is approximately +-10,000 years. type Duration struct { Seconds int64 Nanos int32 } func (d *Duration) ToTimeDuration() *time.Duration { if d == nil { return nil } timeDuration := time.Duration(d.Nanos) + time.Duration(d.Seconds/1e9) return &timeDuration } func (d Duration) MarshalJSON() ([]byte, error) { nanos := d.Nanos if nanos < 0 { nanos = -nanos } return []byte(`"` + fmt.Sprintf("%d.%09d", d.Seconds, nanos) + `s"`), nil } func (d *Duration) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var str string err := json.Unmarshal(b, &str) if err != nil { return err } if str == "" { *d = Duration{} return nil } seconds, nanos, err := splitFloatString(strings.TrimRight(str, "s")) if err != nil { return err } *d = Duration{ Seconds: seconds, Nanos: nanos, } return nil } // splitFloatString splits a float represented in a string, and returns its units (left-coma part) and nanos (right-coma part). // E.g.: // "3" ==> units = 3 | nanos = 0 // "3.14" ==> units = 3 | nanos = 14*1e7 // "-3.14" ==> units = -3 | nanos = -14*1e7 func splitFloatString(input string) (units int64, nanos int32, err error) { parts := strings.SplitN(input, ".", 2) // parse units as int64 units, err = strconv.ParseInt(parts[0], 10, 64) if err != nil { return 0, 0, errors.Wrap(err, "invalid units") } // handle nanos if len(parts) == 2 { // add leading zeros strNanos := parts[1] + "000000000"[len(parts[1]):] // parse nanos as int32 n, err := strconv.ParseUint(strNanos, 10, 32) if err != nil { return 0, 0, errors.Wrap(err, "invalid nanos") } nanos = int32(n) } if units < 0 { nanos = -nanos } return units, nanos, nil } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/env.go������������������������������0000664�0000000�0000000�00000007723�13771713062�0025545�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "os" "strconv" "github.com/scaleway/scaleway-sdk-go/logger" ) // Environment variables const ( // Up-to-date ScwCacheDirEnv = "SCW_CACHE_DIR" ScwConfigPathEnv = "SCW_CONFIG_PATH" ScwAccessKeyEnv = "SCW_ACCESS_KEY" ScwSecretKeyEnv = "SCW_SECRET_KEY" // #nosec G101 ScwActiveProfileEnv = "SCW_PROFILE" ScwAPIURLEnv = "SCW_API_URL" ScwInsecureEnv = "SCW_INSECURE" ScwDefaultOrganizationIDEnv = "SCW_DEFAULT_ORGANIZATION_ID" ScwDefaultProjectIDEnv = "SCW_DEFAULT_PROJECT_ID" ScwDefaultRegionEnv = "SCW_DEFAULT_REGION" ScwDefaultZoneEnv = "SCW_DEFAULT_ZONE" // All deprecated (cli&terraform) terraformAccessKeyEnv = "SCALEWAY_ACCESS_KEY" // used both as access key and secret key terraformSecretKeyEnv = "SCALEWAY_TOKEN" terraformOrganizationEnv = "SCALEWAY_ORGANIZATION" terraformRegionEnv = "SCALEWAY_REGION" cliTLSVerifyEnv = "SCW_TLSVERIFY" cliOrganizationEnv = "SCW_ORGANIZATION" cliRegionEnv = "SCW_REGION" cliSecretKeyEnv = "SCW_TOKEN" // TBD //cliVerboseEnv = "SCW_VERBOSE_API" //cliDebugEnv = "DEBUG" //cliNoCheckVersionEnv = "SCW_NOCHECKVERSION" //cliTestWithRealAPIEnv = "TEST_WITH_REAL_API" //cliSecureExecEnv = "SCW_SECURE_EXEC" //cliGatewayEnv = "SCW_GATEWAY" //cliSensitiveEnv = "SCW_SENSITIVE" //cliAccountAPIEnv = "SCW_ACCOUNT_API" //cliMetadataAPIEnv = "SCW_METADATA_API" //cliMarketPlaceAPIEnv = "SCW_MARKETPLACE_API" //cliComputePar1APIEnv = "SCW_COMPUTE_PAR1_API" //cliComputeAms1APIEnv = "SCW_COMPUTE_AMS1_API" //cliCommercialTypeEnv = "SCW_COMMERCIAL_TYPE" //cliTargetArchEnv = "SCW_TARGET_ARCH" ) const ( v1RegionFrPar = "par1" v1RegionNlAms = "ams1" ) func LoadEnvProfile() *Profile { p := &Profile{} accessKey, _, envExist := getEnv(ScwAccessKeyEnv, terraformAccessKeyEnv) if envExist { p.AccessKey = &accessKey } secretKey, _, envExist := getEnv(ScwSecretKeyEnv, cliSecretKeyEnv, terraformSecretKeyEnv, terraformAccessKeyEnv) if envExist { p.SecretKey = &secretKey } apiURL, _, envExist := getEnv(ScwAPIURLEnv) if envExist { p.APIURL = &apiURL } insecureValue, envKey, envExist := getEnv(ScwInsecureEnv, cliTLSVerifyEnv) if envExist { insecure, err := strconv.ParseBool(insecureValue) if err != nil { logger.Warningf("env variable %s cannot be parsed: %s is invalid boolean", envKey, insecureValue) } if envKey == cliTLSVerifyEnv { insecure = !insecure // TLSVerify is the inverse of Insecure } p.Insecure = &insecure } organizationID, _, envExist := getEnv(ScwDefaultOrganizationIDEnv, cliOrganizationEnv, terraformOrganizationEnv) if envExist { p.DefaultOrganizationID = &organizationID } projectID, _, envExist := getEnv(ScwDefaultProjectIDEnv) if envExist { p.DefaultProjectID = &projectID } region, _, envExist := getEnv(ScwDefaultRegionEnv, cliRegionEnv, terraformRegionEnv) if envExist { region = v1RegionToV2(region) p.DefaultRegion = &region } zone, _, envExist := getEnv(ScwDefaultZoneEnv) if envExist { p.DefaultZone = &zone } return p } func getEnv(upToDateKey string, deprecatedKeys ...string) (string, string, bool) { value, exist := os.LookupEnv(upToDateKey) if exist { logger.Debugf("reading value from %s", upToDateKey) return value, upToDateKey, true } for _, key := range deprecatedKeys { value, exist := os.LookupEnv(key) if exist { logger.Debugf("reading value from %s", key) logger.Warningf("%s is deprecated, please use %s instead", key, upToDateKey) return value, key, true } } return "", "", false } func v1RegionToV2(region string) string { switch region { case v1RegionFrPar: logger.Warningf("par1 is a deprecated name for region, use fr-par instead") return "fr-par" case v1RegionNlAms: logger.Warningf("ams1 is a deprecated name for region, use nl-ams instead") return "nl-ams" default: return region } } ���������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/errors.go���������������������������0000664�0000000�0000000�00000032122�13771713062�0026260�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "encoding/json" "fmt" "io/ioutil" "net/http" "sort" "strings" "time" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/validation" ) // SdkError is a base interface for all Scaleway SDK errors. type SdkError interface { Error() string IsScwSdkError() } // ResponseError is an error type for the Scaleway API type ResponseError struct { // Message is a human-friendly error message Message string `json:"message"` // Type is a string code that defines the kind of error. This field is only used by instance API Type string `json:"type,omitempty"` // Resource is a string code that defines the resource concerned by the error. This field is only used by instance API Resource string `json:"resource,omitempty"` // Fields contains detail about validation error. This field is only used by instance API Fields map[string][]string `json:"fields,omitempty"` // StatusCode is the HTTP status code received StatusCode int `json:"-"` // Status is the HTTP status received Status string `json:"-"` RawBody json.RawMessage `json:"-"` } func (e *ResponseError) UnmarshalJSON(b []byte) error { type tmpResponseError ResponseError tmp := tmpResponseError(*e) err := json.Unmarshal(b, &tmp) if err != nil { return err } tmp.Message = strings.ToLower(tmp.Message) *e = ResponseError(tmp) return nil } // IsScwSdkError implement SdkError interface func (e *ResponseError) IsScwSdkError() {} func (e *ResponseError) Error() string { s := fmt.Sprintf("scaleway-sdk-go: http error %s", e.Status) if e.Resource != "" { s = fmt.Sprintf("%s: resource %s", s, e.Resource) } if e.Message != "" { s = fmt.Sprintf("%s: %s", s, e.Message) } if len(e.Fields) > 0 { s = fmt.Sprintf("%s: %v", s, e.Fields) } return s } func (e *ResponseError) GetRawBody() json.RawMessage { return e.RawBody } // hasResponseError returns an SdkError when the HTTP status is not OK. func hasResponseError(res *http.Response) error { if res.StatusCode >= 200 && res.StatusCode <= 299 { return nil } newErr := &ResponseError{ StatusCode: res.StatusCode, Status: res.Status, } if res.Body == nil { return newErr } body, err := ioutil.ReadAll(res.Body) if err != nil { return errors.Wrap(err, "cannot read error response body") } newErr.RawBody = body // The error content is not encoded in JSON, only returns HTTP data. if res.Header.Get("Content-Type") != "application/json" { newErr.Message = res.Status return newErr } err = json.Unmarshal(body, newErr) if err != nil { return errors.Wrap(err, "could not parse error response body") } err = unmarshalStandardError(newErr.Type, body) if err != nil { return err } err = unmarshalNonStandardError(newErr.Type, body) if err != nil { return err } return newErr } func unmarshalStandardError(errorType string, body []byte) error { var stdErr SdkError switch errorType { case "invalid_arguments": stdErr = &InvalidArgumentsError{RawBody: body} case "quotas_exceeded": stdErr = &QuotasExceededError{RawBody: body} case "transient_state": stdErr = &TransientStateError{RawBody: body} case "not_found": stdErr = &ResourceNotFoundError{RawBody: body} case "locked": stdErr = &ResourceLockedError{RawBody: body} case "permissions_denied": stdErr = &PermissionsDeniedError{RawBody: body} case "out_of_stock": stdErr = &OutOfStockError{RawBody: body} case "resource_expired": stdErr = &ResourceExpiredError{RawBody: body} default: return nil } err := json.Unmarshal(body, stdErr) if err != nil { return errors.Wrap(err, "could not parse error %s response body", errorType) } return stdErr } func unmarshalNonStandardError(errorType string, body []byte) error { switch errorType { // Only in instance API. case "unknown_resource": unknownResourceError := &UnknownResource{RawBody: body} err := json.Unmarshal(body, unknownResourceError) if err != nil { return errors.Wrap(err, "could not parse error %s response body", errorType) } return unknownResourceError.ToResourceNotFoundError() case "invalid_request_error": invalidRequestError := &InvalidRequestError{RawBody: body} err := json.Unmarshal(body, invalidRequestError) if err != nil { return errors.Wrap(err, "could not parse error %s response body", errorType) } invalidArgumentsError := invalidRequestError.ToInvalidArgumentsError() if invalidArgumentsError != nil { return invalidArgumentsError } quotasExceededError := invalidRequestError.ToQuotasExceededError() if quotasExceededError != nil { return quotasExceededError } // At this point, the invalid_request_error is not an InvalidArgumentsError and // the default marshalling will be used. return nil default: return nil } } type InvalidArgumentsErrorDetail struct { ArgumentName string `json:"argument_name"` Reason string `json:"reason"` HelpMessage string `json:"help_message"` } type InvalidArgumentsError struct { Details []InvalidArgumentsErrorDetail `json:"details"` RawBody json.RawMessage `json:"-"` } // IsScwSdkError implements the SdkError interface func (e *InvalidArgumentsError) IsScwSdkError() {} func (e *InvalidArgumentsError) Error() string { invalidArgs := make([]string, len(e.Details)) for i, d := range e.Details { invalidArgs[i] = d.ArgumentName switch d.Reason { case "unknown": invalidArgs[i] += " is invalid for unexpected reason" case "required": invalidArgs[i] += " is required" case "format": invalidArgs[i] += " is wrongly formatted" case "constraint": invalidArgs[i] += " does not respect constraint" } if d.HelpMessage != "" { invalidArgs[i] += ", " + d.HelpMessage } } return "scaleway-sdk-go: invalid argument(s): " + strings.Join(invalidArgs, "; ") } func (e *InvalidArgumentsError) GetRawBody() json.RawMessage { return e.RawBody } // UnknownResource is only returned by the instance API. // Warning: this is not a standard error. type UnknownResource struct { Message string `json:"message"` RawBody json.RawMessage `json:"-"` } // ToSdkError returns a standard error InvalidArgumentsError or nil Fields is nil. func (e *UnknownResource) ToResourceNotFoundError() SdkError { resourceNotFound := &ResourceNotFoundError{ RawBody: e.RawBody, } messageParts := strings.Split(e.Message, `"`) // Some errors uses ' and not " if len(messageParts) == 1 { messageParts = strings.Split(e.Message, "'") } switch len(messageParts) { case 2: // message like: `"111..." not found` resourceNotFound.ResourceID = messageParts[0] case 3: // message like: `Security Group "111..." not found` resourceNotFound.ResourceID = messageParts[1] // transform `Security group ` to `security_group` resourceNotFound.Resource = strings.ReplaceAll(strings.ToLower(strings.TrimSpace(messageParts[0])), " ", "_") default: return nil } if !validation.IsUUID(resourceNotFound.ResourceID) { return nil } return resourceNotFound } // InvalidRequestError is only returned by the instance API. // Warning: this is not a standard error. type InvalidRequestError struct { Message string `json:"message"` Fields map[string][]string `json:"fields"` Resource string `json:"resource"` RawBody json.RawMessage `json:"-"` } // ToSdkError returns a standard error InvalidArgumentsError or nil Fields is nil. func (e *InvalidRequestError) ToInvalidArgumentsError() SdkError { // If error has no fields, it is not an InvalidArgumentsError. if e.Fields == nil || len(e.Fields) == 0 { return nil } invalidArguments := &InvalidArgumentsError{ RawBody: e.RawBody, } fieldNames := []string(nil) for fieldName := range e.Fields { fieldNames = append(fieldNames, fieldName) } sort.Strings(fieldNames) for _, fieldName := range fieldNames { for _, message := range e.Fields[fieldName] { invalidArguments.Details = append(invalidArguments.Details, InvalidArgumentsErrorDetail{ ArgumentName: fieldName, Reason: "constraint", HelpMessage: message, }) } } return invalidArguments } func (e *InvalidRequestError) ToQuotasExceededError() SdkError { if !strings.Contains(strings.ToLower(e.Message), "quota exceeded for this resource") { return nil } return &QuotasExceededError{ Details: []QuotasExceededErrorDetail{ { Resource: e.Resource, Quota: 0, Current: 0, }, }, RawBody: e.RawBody, } } type QuotasExceededErrorDetail struct { Resource string `json:"resource"` Quota uint32 `json:"quota"` Current uint32 `json:"current"` } type QuotasExceededError struct { Details []QuotasExceededErrorDetail `json:"details"` RawBody json.RawMessage `json:"-"` } // IsScwSdkError implements the SdkError interface func (e *QuotasExceededError) IsScwSdkError() {} func (e *QuotasExceededError) Error() string { invalidArgs := make([]string, len(e.Details)) for i, d := range e.Details { invalidArgs[i] = fmt.Sprintf("%s has reached its quota (%d/%d)", d.Resource, d.Current, d.Current) } return "scaleway-sdk-go: quota exceeded(s): " + strings.Join(invalidArgs, "; ") } func (e *QuotasExceededError) GetRawBody() json.RawMessage { return e.RawBody } type PermissionsDeniedError struct { Details []struct { Resource string `json:"resource"` Action string `json:"action"` } `json:"details"` RawBody json.RawMessage `json:"-"` } // IsScwSdkError implements the SdkError interface func (e *PermissionsDeniedError) IsScwSdkError() {} func (e *PermissionsDeniedError) Error() string { invalidArgs := make([]string, len(e.Details)) for i, d := range e.Details { invalidArgs[i] = fmt.Sprintf("%s %s", d.Action, d.Resource) } return "scaleway-sdk-go: insufficient permissions: " + strings.Join(invalidArgs, "; ") } func (e *PermissionsDeniedError) GetRawBody() json.RawMessage { return e.RawBody } type TransientStateError struct { Resource string `json:"resource"` ResourceID string `json:"resource_id"` CurrentState string `json:"current_state"` RawBody json.RawMessage `json:"-"` } // IsScwSdkError implements the SdkError interface func (e *TransientStateError) IsScwSdkError() {} func (e *TransientStateError) Error() string { return fmt.Sprintf("scaleway-sdk-go: resource %s with ID %s is in a transient state: %s", e.Resource, e.ResourceID, e.CurrentState) } func (e *TransientStateError) GetRawBody() json.RawMessage { return e.RawBody } type ResourceNotFoundError struct { Resource string `json:"resource"` ResourceID string `json:"resource_id"` RawBody json.RawMessage `json:"-"` } // IsScwSdkError implements the SdkError interface func (e *ResourceNotFoundError) IsScwSdkError() {} func (e *ResourceNotFoundError) Error() string { return fmt.Sprintf("scaleway-sdk-go: resource %s with ID %s is not found", e.Resource, e.ResourceID) } func (e *ResourceNotFoundError) GetRawBody() json.RawMessage { return e.RawBody } type ResourceLockedError struct { Resource string `json:"resource"` ResourceID string `json:"resource_id"` RawBody json.RawMessage `json:"-"` } // IsScwSdkError implements the SdkError interface func (e *ResourceLockedError) IsScwSdkError() {} func (e *ResourceLockedError) Error() string { return fmt.Sprintf("scaleway-sdk-go: resource %s with ID %s is locked", e.Resource, e.ResourceID) } func (e *ResourceLockedError) GetRawBody() json.RawMessage { return e.RawBody } type OutOfStockError struct { Resource string `json:"resource"` RawBody json.RawMessage `json:"-"` } // IsScwSdkError implements the SdkError interface func (e *OutOfStockError) IsScwSdkError() {} func (e *OutOfStockError) Error() string { return fmt.Sprintf("scaleway-sdk-go: resource %s is out of stock", e.Resource) } func (e *OutOfStockError) GetRawBody() json.RawMessage { return e.RawBody } // InvalidClientOptionError indicates that at least one of client data has been badly provided for the client creation. type InvalidClientOptionError struct { errorType string } func NewInvalidClientOptionError(format string, a ...interface{}) *InvalidClientOptionError { return &InvalidClientOptionError{errorType: fmt.Sprintf(format, a...)} } // IsScwSdkError implements the SdkError interface func (e InvalidClientOptionError) IsScwSdkError() {} func (e InvalidClientOptionError) Error() string { return fmt.Sprintf("scaleway-sdk-go: %s", e.errorType) } // ConfigFileNotFound indicates that the config file could not be found type ConfigFileNotFoundError struct { path string } func configFileNotFound(path string) *ConfigFileNotFoundError { return &ConfigFileNotFoundError{path: path} } // ConfigFileNotFoundError implements the SdkError interface func (e ConfigFileNotFoundError) IsScwSdkError() {} func (e ConfigFileNotFoundError) Error() string { return fmt.Sprintf("scaleway-sdk-go: cannot read config file %s: no such file or directory", e.path) } // ResourceExpiredError implements the SdkError interface type ResourceExpiredError struct { Resource string `json:"resource"` ResourceID string `json:"resource_id"` ExpiredSince time.Time `json:"expired_since"` RawBody json.RawMessage `json:"-"` } func (r ResourceExpiredError) Error() string { return fmt.Sprintf("scaleway-sdk-go: resource %s with ID %s expired since %s", r.Resource, r.ResourceID, r.ExpiredSince.String()) } func (r ResourceExpiredError) IsScwSdkError() {} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/locality.go�������������������������0000664�0000000�0000000�00000012070�13771713062�0026564�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "encoding/json" "fmt" "strings" "github.com/scaleway/scaleway-sdk-go/internal/errors" "github.com/scaleway/scaleway-sdk-go/logger" "github.com/scaleway/scaleway-sdk-go/validation" ) // localityPartsSeparator is the separator used in Zone and Region const localityPartsSeparator = "-" // Zone is an availability zone type Zone string const ( // ZoneFrPar1 represents the fr-par-1 zone ZoneFrPar1 = Zone("fr-par-1") // ZoneFrPar2 represents the fr-par-2 zone ZoneFrPar2 = Zone("fr-par-2") // ZoneNlAms1 represents the nl-ams-1 zone ZoneNlAms1 = Zone("nl-ams-1") // ZonePlWaw1 represents the pl-waw-1 zone ZonePlWaw1 = Zone("pl-waw-1") ) var ( // AllZones is an array that list all zones AllZones = []Zone{ ZoneFrPar1, ZoneFrPar2, ZoneNlAms1, ZonePlWaw1, } ) // Exists checks whether a zone exists func (zone Zone) Exists() bool { for _, z := range AllZones { if z == zone { return true } } return false } // String returns a Zone as a string func (zone Zone) String() string { return string(zone) } // Region returns the parent Region for the Zone. // Manipulates the string directly to allow unlisted zones formatted as xx-yyy-z. func (zone Zone) Region() (Region, error) { zoneStr := zone.String() if !validation.IsZone(zoneStr) { return "", fmt.Errorf("invalid zone '%v'", zoneStr) } zoneParts := strings.Split(zoneStr, localityPartsSeparator) return Region(strings.Join(zoneParts[:2], localityPartsSeparator)), nil } // Region is a geographical location type Region string const ( // RegionFrPar represents the fr-par region RegionFrPar = Region("fr-par") // RegionNlAms represents the nl-ams region RegionNlAms = Region("nl-ams") // RegionPlWaw represents the pl-waw region RegionPlWaw = Region("pl-waw") ) var ( // AllRegions is an array that list all regions AllRegions = []Region{ RegionFrPar, RegionNlAms, RegionPlWaw, } ) // Exists checks whether a region exists func (region Region) Exists() bool { for _, r := range AllRegions { if r == region { return true } } return false } // GetZones is a function that returns the zones for the specified region func (region Region) GetZones() []Zone { switch region { case RegionFrPar: return []Zone{ZoneFrPar1, ZoneFrPar2} case RegionNlAms: return []Zone{ZoneNlAms1} case RegionPlWaw: return []Zone{ZonePlWaw1} default: return []Zone{} } } // ParseZone parses a string value into a Zone and returns an error if it has a bad format. func ParseZone(zone string) (Zone, error) { switch zone { case "par1": // would be triggered by API market place // logger.Warningf("par1 is a deprecated name for zone, use fr-par-1 instead") return ZoneFrPar1, nil case "ams1": // would be triggered by API market place // logger.Warningf("ams1 is a deprecated name for zone, use nl-ams-1 instead") return ZoneNlAms1, nil default: if !validation.IsZone(zone) { zones := []string(nil) for _, z := range AllZones { zones = append(zones, string(z)) } return "", errors.New("bad zone format, available zones are: %s", strings.Join(zones, ", ")) } newZone := Zone(zone) if !newZone.Exists() { logger.Infof("%s is an unknown zone\n", newZone) } return newZone, nil } } // UnmarshalJSON implements the Unmarshaler interface for a Zone. // this to call ParseZone on the string input and return the correct Zone object. func (zone *Zone) UnmarshalJSON(input []byte) error { // parse input value as string var stringValue string err := json.Unmarshal(input, &stringValue) if err != nil { return err } // parse string as Zone *zone, err = ParseZone(stringValue) if err != nil { return err } return nil } // ParseRegion parses a string value into a Region and returns an error if it has a bad format. func ParseRegion(region string) (Region, error) { switch region { case "par1": // would be triggered by API market place // logger.Warningf("par1 is a deprecated name for region, use fr-par instead") return RegionFrPar, nil case "ams1": // would be triggered by API market place // logger.Warningf("ams1 is a deprecated name for region, use nl-ams instead") return RegionNlAms, nil default: if !validation.IsRegion(region) { regions := []string(nil) for _, r := range AllRegions { regions = append(regions, string(r)) } return "", errors.New("bad region format, available regions are: %s", strings.Join(regions, ", ")) } newRegion := Region(region) if !newRegion.Exists() { logger.Infof("%s is an unknown region\n", newRegion) } return newRegion, nil } } // UnmarshalJSON implements the Unmarshaler interface for a Region. // this to call ParseRegion on the string input and return the correct Region object. func (region *Region) UnmarshalJSON(input []byte) error { // parse input value as string var stringValue string err := json.Unmarshal(input, &stringValue) if err != nil { return err } // parse string as Region *region, err = ParseRegion(stringValue) if err != nil { return err } return nil } // String returns a Region as a string func (region Region) String() string { return string(region) } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/path.go�����������������������������0000664�0000000�0000000�00000005047�13771713062�0025706�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "errors" "os" "path/filepath" ) const ( // XDG wiki: https://wiki.archlinux.org/index.php/XDG_Base_Directory xdgConfigDirEnv = "XDG_CONFIG_HOME" xdgCacheDirEnv = "XDG_CACHE_HOME" unixHomeDirEnv = "HOME" windowsHomeDirEnv = "USERPROFILE" defaultConfigFileName = "config.yaml" ) var ( // ErrNoHomeDir errors when no user directory is found ErrNoHomeDir = errors.New("user home directory not found") ) // GetCacheDirectory returns the default cache directory. // Cache directory is based on the following priority order: // - $SCW_CACHE_DIR // - $XDG_CACHE_HOME/scw // - $HOME/.cache/scw // - $USERPROFILE/.cache/scw func GetCacheDirectory() string { cacheDir := "" switch { case os.Getenv(ScwCacheDirEnv) != "": cacheDir = os.Getenv(ScwCacheDirEnv) case os.Getenv(xdgCacheDirEnv) != "": cacheDir = filepath.Join(os.Getenv(xdgCacheDirEnv), "scw") case os.Getenv(unixHomeDirEnv) != "": cacheDir = filepath.Join(os.Getenv(unixHomeDirEnv), ".cache", "scw") case os.Getenv(windowsHomeDirEnv) != "": cacheDir = filepath.Join(os.Getenv(windowsHomeDirEnv), ".cache", "scw") default: // TODO: fallback on local folder? } // Clean the cache directory path when exiting the function return filepath.Clean(cacheDir) } // GetConfigPath returns the default path. // Default path is based on the following priority order: // - $SCW_CONFIG_PATH // - $XDG_CONFIG_HOME/scw/config.yaml // - $HOME/.config/scw/config.yaml // - $USERPROFILE/.config/scw/config.yaml func GetConfigPath() string { configPath := os.Getenv(ScwConfigPathEnv) if configPath == "" { configPath, _ = getConfigV2FilePath() } return filepath.Clean(configPath) } // getConfigV2FilePath returns the path to the v2 config file func getConfigV2FilePath() (string, bool) { configDir, err := GetScwConfigDir() if err != nil { return "", false } return filepath.Clean(filepath.Join(configDir, defaultConfigFileName)), true } // getConfigV1FilePath returns the path to the v1 config file func getConfigV1FilePath() (string, bool) { path, err := os.UserHomeDir() if err != nil { return "", false } return filepath.Clean(filepath.Join(path, ".scwrc")), true } // GetScwConfigDir returns the path to scw config folder func GetScwConfigDir() (string, error) { if xdgPath := os.Getenv(xdgConfigDirEnv); xdgPath != "" { return filepath.Join(xdgPath, "scw"), nil } homeDir, err := os.UserHomeDir() if err != nil { return "", err } return filepath.Join(homeDir, ".config", "scw"), nil } func fileExist(name string) bool { _, err := os.Stat(name) return err == nil } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/request.go��������������������������0000664�0000000�0000000�00000004362�13771713062�0026441�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "bytes" "context" "encoding/json" "io" "net/http" "net/url" "github.com/scaleway/scaleway-sdk-go/internal/auth" "github.com/scaleway/scaleway-sdk-go/internal/errors" ) // ScalewayRequest contains all the contents related to performing a request on the Scaleway API. type ScalewayRequest struct { Method string Path string Headers http.Header Query url.Values Body io.Reader // request options ctx context.Context auth auth.Auth allPages bool } // getAllHeaders constructs a http.Header object and aggregates all headers into the object. func (req *ScalewayRequest) getAllHeaders(token auth.Auth, userAgent string, anonymized bool) http.Header { var allHeaders http.Header if anonymized { allHeaders = token.AnonymizedHeaders() } else { allHeaders = token.Headers() } allHeaders.Set("User-Agent", userAgent) if req.Body != nil { allHeaders.Set("Content-Type", "application/json") } for key, value := range req.Headers { allHeaders.Del(key) for _, v := range value { allHeaders.Add(key, v) } } return allHeaders } // getURL constructs a URL based on the base url and the client. func (req *ScalewayRequest) getURL(baseURL string) (*url.URL, error) { url, err := url.Parse(baseURL + req.Path) if err != nil { return nil, errors.New("invalid url %s: %s", baseURL+req.Path, err) } url.RawQuery = req.Query.Encode() return url, nil } // SetBody json marshal the given body and write the json content type // to the request. It also catches when body is a file. func (req *ScalewayRequest) SetBody(body interface{}) error { var contentType string var content io.Reader switch b := body.(type) { case *File: contentType = b.ContentType content = b.Content case io.Reader: contentType = "text/plain" content = b default: buf, err := json.Marshal(body) if err != nil { return err } contentType = "application/json" content = bytes.NewReader(buf) } if req.Headers == nil { req.Headers = http.Header{} } req.Headers.Set("Content-Type", contentType) req.Body = content return nil } func (req *ScalewayRequest) apply(opts []RequestOption) { for _, opt := range opts { opt(req) } } func (req *ScalewayRequest) validate() error { // nothing so far return nil } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/request_option.go�������������������0000664�0000000�0000000�00000001530�13771713062�0030023�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "context" "github.com/scaleway/scaleway-sdk-go/internal/auth" ) // RequestOption is a function that applies options to a ScalewayRequest. type RequestOption func(*ScalewayRequest) // WithContext request option sets the context of a ScalewayRequest func WithContext(ctx context.Context) RequestOption { return func(s *ScalewayRequest) { s.ctx = ctx } } // WithAllPages aggregate all pages in the response of a List request. // Will error when pagination is not supported on the request. func WithAllPages() RequestOption { return func(s *ScalewayRequest) { s.allPages = true } } // WithAuthRequest overwrites the client access key and secret key used in the request. func WithAuthRequest(accessKey, secretKey string) RequestOption { return func(s *ScalewayRequest) { s.auth = auth.NewToken(accessKey, secretKey) } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/scw/version.go��������������������������0000664�0000000�0000000�00000000341�13771713062�0026427�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package scw import ( "fmt" "runtime" ) // TODO: versioning process const version = "v1.0.0-beta.7" var userAgent = fmt.Sprintf("scaleway-sdk-go/%s (%s; %s; %s)", version, runtime.Version(), runtime.GOOS, runtime.GOARCH) �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/validation/�����������������������������0000775�0000000�0000000�00000000000�13771713062�0025753�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/scaleway/scaleway-sdk-go/validation/is.go������������������������0000664�0000000�0000000�00000003337�13771713062�0026723�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Package validation provides format validation functions. package validation import ( "net/url" "regexp" ) var ( isUUIDRegexp = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") isRegionRegex = regexp.MustCompile("^[a-z]{2}-[a-z]{3}$") isZoneRegex = regexp.MustCompile("^[a-z]{2}-[a-z]{3}-[1-9]$") isAccessKey = regexp.MustCompile("^SCW[A-Z0-9]{17}$") isEmailRegexp = regexp.MustCompile("^.+@.+$") ) // IsUUID returns true if the given string has a valid UUID format. func IsUUID(s string) bool { return isUUIDRegexp.MatchString(s) } // IsAccessKey returns true if the given string has a valid Scaleway access key format. func IsAccessKey(s string) bool { return isAccessKey.MatchString(s) } // IsSecretKey returns true if the given string has a valid Scaleway secret key format. func IsSecretKey(s string) bool { return IsUUID(s) } // IsOrganizationID returns true if the given string has a valid Scaleway organization ID format. func IsOrganizationID(s string) bool { return IsUUID(s) } // IsProjectID returns true if the given string has a valid Scaleway project ID format. func IsProjectID(s string) bool { return IsUUID(s) } // IsRegion returns true if the given string has a valid region format. func IsRegion(s string) bool { return isRegionRegex.MatchString(s) } // IsZone returns true if the given string has a valid zone format. func IsZone(s string) bool { return isZoneRegex.MatchString(s) } // IsURL returns true if the given string has a valid URL format. func IsURL(s string) bool { _, err := url.Parse(s) return err == nil } // IsEmail returns true if the given string has an email format. func IsEmail(v string) bool { return isEmailRegexp.MatchString(v) } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/����������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021506�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/��������������������������������0000775�0000000�0000000�00000000000�13771713062�0025357�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/LICENSE�������������������������0000664�0000000�0000000�00000026127�13771713062�0026374�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright (c) 2017-2018 Tencent Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/�������������������0000775�0000000�0000000�00000000000�13771713062�0030046�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/������������0000775�0000000�0000000�00000000000�13771713062�0031336�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/client.go���0000664�0000000�0000000�00000017613�13771713062�0033153�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package common import ( "encoding/hex" "encoding/json" "fmt" "log" "net/http" "net/http/httputil" "strconv" "strings" "time" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" ) type Client struct { region string httpClient *http.Client httpProfile *profile.HttpProfile profile *profile.ClientProfile credential *Credential signMethod string unsignedPayload bool debug bool } func (c *Client) Send(request tchttp.Request, response tchttp.Response) (err error) { if request.GetScheme() == "" { request.SetScheme(c.httpProfile.Scheme) } if request.GetRootDomain() == "" { request.SetRootDomain(c.httpProfile.RootDomain) } if request.GetDomain() == "" { domain := c.httpProfile.Endpoint if domain == "" { domain = request.GetServiceDomain(request.GetService()) } request.SetDomain(domain) } if request.GetHttpMethod() == "" { request.SetHttpMethod(c.httpProfile.ReqMethod) } tchttp.CompleteCommonParams(request, c.GetRegion()) if c.signMethod == "HmacSHA1" || c.signMethod == "HmacSHA256" { return c.sendWithSignatureV1(request, response) } else { return c.sendWithSignatureV3(request, response) } } func (c *Client) sendWithSignatureV1(request tchttp.Request, response tchttp.Response) (err error) { // TODO: not an elegant way, it should be done in common params, but finally it need to refactor request.GetParams()["Language"] = c.profile.Language err = tchttp.ConstructParams(request) if err != nil { return err } err = signRequest(request, c.credential, c.signMethod) if err != nil { return err } httpRequest, err := http.NewRequest(request.GetHttpMethod(), request.GetUrl(), request.GetBodyReader()) if err != nil { return err } if request.GetHttpMethod() == "POST" { httpRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded") } if c.debug { outbytes, err := httputil.DumpRequest(httpRequest, true) if err != nil { log.Printf("[ERROR] dump request failed because %s", err) return err } log.Printf("[DEBUG] http request = %s", outbytes) } httpResponse, err := c.httpClient.Do(httpRequest) if err != nil { msg := fmt.Sprintf("Fail to get response because %s", err) return errors.NewTencentCloudSDKError("ClientError.NetworkError", msg, "") } err = tchttp.ParseFromHttpResponse(httpResponse, response) return err } func (c *Client) sendWithSignatureV3(request tchttp.Request, response tchttp.Response) (err error) { headers := map[string]string{ "Host": request.GetDomain(), "X-TC-Action": request.GetAction(), "X-TC-Version": request.GetVersion(), "X-TC-Timestamp": request.GetParams()["Timestamp"], "X-TC-RequestClient": request.GetParams()["RequestClient"], "X-TC-Language": c.profile.Language, } if c.region != "" { headers["X-TC-Region"] = c.region } if c.credential.Token != "" { headers["X-TC-Token"] = c.credential.Token } if request.GetHttpMethod() == "GET" { headers["Content-Type"] = "application/x-www-form-urlencoded" } else { headers["Content-Type"] = "application/json" } // start signature v3 process // build canonical request string httpRequestMethod := request.GetHttpMethod() canonicalURI := "/" canonicalQueryString := "" if httpRequestMethod == "GET" { err = tchttp.ConstructParams(request) if err != nil { return err } params := make(map[string]string) for key, value := range request.GetParams() { params[key] = value } delete(params, "Action") delete(params, "Version") delete(params, "Nonce") delete(params, "Region") delete(params, "RequestClient") delete(params, "Timestamp") canonicalQueryString = tchttp.GetUrlQueriesEncoded(params) } canonicalHeaders := fmt.Sprintf("content-type:%s\nhost:%s\n", headers["Content-Type"], headers["Host"]) signedHeaders := "content-type;host" requestPayload := "" if httpRequestMethod == "POST" { b, err := json.Marshal(request) if err != nil { return err } requestPayload = string(b) } hashedRequestPayload := "" if c.unsignedPayload { hashedRequestPayload = sha256hex("UNSIGNED-PAYLOAD") headers["X-TC-Content-SHA256"] = "UNSIGNED-PAYLOAD" } else { hashedRequestPayload = sha256hex(requestPayload) } canonicalRequest := fmt.Sprintf("%s\n%s\n%s\n%s\n%s\n%s", httpRequestMethod, canonicalURI, canonicalQueryString, canonicalHeaders, signedHeaders, hashedRequestPayload) //log.Println("canonicalRequest:", canonicalRequest) // build string to sign algorithm := "TC3-HMAC-SHA256" requestTimestamp := headers["X-TC-Timestamp"] timestamp, _ := strconv.ParseInt(requestTimestamp, 10, 64) t := time.Unix(timestamp, 0).UTC() // must be the format 2006-01-02, ref to package time for more info date := t.Format("2006-01-02") credentialScope := fmt.Sprintf("%s/%s/tc3_request", date, request.GetService()) hashedCanonicalRequest := sha256hex(canonicalRequest) string2sign := fmt.Sprintf("%s\n%s\n%s\n%s", algorithm, requestTimestamp, credentialScope, hashedCanonicalRequest) //log.Println("string2sign", string2sign) // sign string secretDate := hmacsha256(date, "TC3"+c.credential.SecretKey) secretService := hmacsha256(request.GetService(), secretDate) secretKey := hmacsha256("tc3_request", secretService) signature := hex.EncodeToString([]byte(hmacsha256(string2sign, secretKey))) //log.Println("signature", signature) // build authorization authorization := fmt.Sprintf("%s Credential=%s/%s, SignedHeaders=%s, Signature=%s", algorithm, c.credential.SecretId, credentialScope, signedHeaders, signature) //log.Println("authorization", authorization) headers["Authorization"] = authorization url := request.GetScheme() + "://" + request.GetDomain() + request.GetPath() if canonicalQueryString != "" { url = url + "?" + canonicalQueryString } httpRequest, err := http.NewRequest(httpRequestMethod, url, strings.NewReader(requestPayload)) if err != nil { return err } for k, v := range headers { httpRequest.Header[k] = []string{v} } if c.debug { outbytes, err := httputil.DumpRequest(httpRequest, true) if err != nil { log.Printf("[ERROR] dump request failed because %s", err) return err } log.Printf("[DEBUG] http request = %s", outbytes) } httpResponse, err := c.httpClient.Do(httpRequest) if err != nil { msg := fmt.Sprintf("Fail to get response because %s", err) return errors.NewTencentCloudSDKError("ClientError.NetworkError", msg, "") } err = tchttp.ParseFromHttpResponse(httpResponse, response) return err } func (c *Client) GetRegion() string { return c.region } func (c *Client) Init(region string) *Client { c.httpClient = &http.Client{} c.region = region c.signMethod = "TC3-HMAC-SHA256" c.debug = false log.SetFlags(log.LstdFlags | log.Lshortfile) return c } func (c *Client) WithSecretId(secretId, secretKey string) *Client { c.credential = NewCredential(secretId, secretKey) return c } func (c *Client) WithCredential(cred *Credential) *Client { c.credential = cred return c } func (c *Client) WithProfile(clientProfile *profile.ClientProfile) *Client { c.profile = clientProfile c.signMethod = clientProfile.SignMethod c.unsignedPayload = clientProfile.UnsignedPayload c.httpProfile = clientProfile.HttpProfile c.debug = clientProfile.Debug c.httpClient.Timeout = time.Duration(c.httpProfile.ReqTimeout) * time.Second return c } func (c *Client) WithSignatureMethod(method string) *Client { c.signMethod = method return c } func (c *Client) WithHttpTransport(transport http.RoundTripper) *Client { c.httpClient.Transport = transport return c } func (c *Client) WithDebug(flag bool) *Client { c.debug = flag return c } func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { client = &Client{} client.Init(region).WithSecretId(secretId, secretKey) return } ���������������������������������������������������������������������������������������������������������������������credentials.go��������������������������������������������������������������������������������������0000664�0000000�0000000�00000002342�13771713062�0034104�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common��������������������������������������������������������������������������������package common type Credential struct { SecretId string SecretKey string Token string } func NewCredential(secretId, secretKey string) *Credential { return &Credential{ SecretId: secretId, SecretKey: secretKey, } } func NewTokenCredential(secretId, secretKey, token string) *Credential { return &Credential{ SecretId: secretId, SecretKey: secretKey, Token: token, } } func (c *Credential) GetCredentialParams() map[string]string { p := map[string]string{ "SecretId": c.SecretId, } if c.Token != "" { p["Token"] = c.Token } return p } // Nowhere use them and we haven't well designed these structures and // underlying method, which leads to the situation that it is hard to // refactor it to interfaces. // Hence they are removed and merged into Credential. //type TokenCredential struct { // SecretId string // SecretKey string // Token string //} //func NewTokenCredential(secretId, secretKey, token string) *TokenCredential { // return &TokenCredential{ // SecretId: secretId, // SecretKey: secretKey, // Token: token, // } //} //func (c *TokenCredential) GetCredentialParams() map[string]string { // return map[string]string{ // "SecretId": c.SecretId, // "Token": c.Token, // } //} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors/�����0000775�0000000�0000000�00000000000�13771713062�0032652�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������errors.go�������������������������������������������������������������������������������������������0000664�0000000�0000000�00000001251�13771713062�0034435�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors�������������������������������������������������������������������������package errors import ( "fmt" ) type TencentCloudSDKError struct { Code string Message string RequestId string } func (e *TencentCloudSDKError) Error() string { return fmt.Sprintf("[TencentCloudSDKError] Code=%s, Message=%s, RequestId=%s", e.Code, e.Message, e.RequestId) } func NewTencentCloudSDKError(code, message, requestId string) error { return &TencentCloudSDKError{ Code: code, Message: message, RequestId: requestId, } } func (e *TencentCloudSDKError) GetCode() string { return e.Code } func (e *TencentCloudSDKError) GetMessage() string { return e.Message } func (e *TencentCloudSDKError) GetRequestId() string { return e.RequestId } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/�������0000775�0000000�0000000�00000000000�13771713062�0032315�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������request.go������������������������������������������������������������������������������������������0000664�0000000�0000000�00000014014�13771713062�0034255�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http���������������������������������������������������������������������������package common import ( "io" //"log" "math/rand" "net/url" "reflect" "strconv" "strings" "time" ) const ( POST = "POST" GET = "GET" HTTP = "http" HTTPS = "https" RootDomain = "tencentcloudapi.com" Path = "/" ) type Request interface { GetAction() string GetBodyReader() io.Reader GetScheme() string GetRootDomain() string GetServiceDomain(string) string GetDomain() string GetHttpMethod() string GetParams() map[string]string GetPath() string GetService() string GetUrl() string GetVersion() string SetScheme(string) SetRootDomain(string) SetDomain(string) SetHttpMethod(string) } type BaseRequest struct { httpMethod string scheme string rootDomain string domain string path string params map[string]string formParams map[string]string service string version string action string } func (r *BaseRequest) GetAction() string { return r.action } func (r *BaseRequest) GetHttpMethod() string { return r.httpMethod } func (r *BaseRequest) GetParams() map[string]string { return r.params } func (r *BaseRequest) GetPath() string { return r.path } func (r *BaseRequest) GetDomain() string { return r.domain } func (r *BaseRequest) GetScheme() string { return r.scheme } func (r *BaseRequest) GetRootDomain() string { return r.rootDomain } func (r *BaseRequest) GetServiceDomain(service string) (domain string) { rootDomain := r.rootDomain if rootDomain == "" { rootDomain = RootDomain } domain = service + "." + rootDomain return } func (r *BaseRequest) SetDomain(domain string) { r.domain = domain } func (r *BaseRequest) SetScheme(scheme string) { scheme = strings.ToLower(scheme) switch scheme { case HTTP: r.scheme = HTTP default: r.scheme = HTTPS } } func (r *BaseRequest) SetRootDomain(rootDomain string) { r.rootDomain = rootDomain } func (r *BaseRequest) SetHttpMethod(method string) { switch strings.ToUpper(method) { case POST: { r.httpMethod = POST } case GET: { r.httpMethod = GET } default: { r.httpMethod = GET } } } func (r *BaseRequest) GetService() string { return r.service } func (r *BaseRequest) GetUrl() string { if r.httpMethod == GET { return r.GetScheme() + "://" + r.domain + r.path + "?" + GetUrlQueriesEncoded(r.params) } else if r.httpMethod == POST { return r.GetScheme() + "://" + r.domain + r.path } else { return "" } } func (r *BaseRequest) GetVersion() string { return r.version } func GetUrlQueriesEncoded(params map[string]string) string { values := url.Values{} for key, value := range params { if value != "" { values.Add(key, value) } } return values.Encode() } func (r *BaseRequest) GetBodyReader() io.Reader { if r.httpMethod == POST { s := GetUrlQueriesEncoded(r.params) return strings.NewReader(s) } else { return strings.NewReader("") } } func (r *BaseRequest) Init() *BaseRequest { r.domain = "" r.path = Path r.params = make(map[string]string) r.formParams = make(map[string]string) return r } func (r *BaseRequest) WithApiInfo(service, version, action string) *BaseRequest { r.service = service r.version = version r.action = action return r } // Deprecated, use request.GetServiceDomain instead func GetServiceDomain(service string) (domain string) { domain = service + "." + RootDomain return } func CompleteCommonParams(request Request, region string) { params := request.GetParams() params["Region"] = region if request.GetVersion() != "" { params["Version"] = request.GetVersion() } params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) params["RequestClient"] = "SDK_GO_3.0.222" } func ConstructParams(req Request) (err error) { value := reflect.ValueOf(req).Elem() err = flatStructure(value, req, "") //log.Printf("[DEBUG] params=%s", req.GetParams()) return } func flatStructure(value reflect.Value, request Request, prefix string) (err error) { //log.Printf("[DEBUG] reflect value: %v", value.Type()) valueType := value.Type() for i := 0; i < valueType.NumField(); i++ { tag := valueType.Field(i).Tag nameTag, hasNameTag := tag.Lookup("name") if !hasNameTag { continue } field := value.Field(i) kind := field.Kind() if kind == reflect.Ptr && field.IsNil() { continue } if kind == reflect.Ptr { field = field.Elem() kind = field.Kind() } key := prefix + nameTag if kind == reflect.String { s := field.String() if s != "" { request.GetParams()[key] = s } } else if kind == reflect.Bool { request.GetParams()[key] = strconv.FormatBool(field.Bool()) } else if kind == reflect.Int || kind == reflect.Int64 { request.GetParams()[key] = strconv.FormatInt(field.Int(), 10) } else if kind == reflect.Uint || kind == reflect.Uint64 { request.GetParams()[key] = strconv.FormatUint(field.Uint(), 10) } else if kind == reflect.Float64 { request.GetParams()[key] = strconv.FormatFloat(field.Float(), 'f', -1, 64) } else if kind == reflect.Slice { list := value.Field(i) for j := 0; j < list.Len(); j++ { vj := list.Index(j) key := prefix + nameTag + "." + strconv.Itoa(j) kind = vj.Kind() if kind == reflect.Ptr && vj.IsNil() { continue } if kind == reflect.Ptr { vj = vj.Elem() kind = vj.Kind() } if kind == reflect.String { request.GetParams()[key] = vj.String() } else if kind == reflect.Bool { request.GetParams()[key] = strconv.FormatBool(vj.Bool()) } else if kind == reflect.Int || kind == reflect.Int64 { request.GetParams()[key] = strconv.FormatInt(vj.Int(), 10) } else if kind == reflect.Uint || kind == reflect.Uint64 { request.GetParams()[key] = strconv.FormatUint(vj.Uint(), 10) } else if kind == reflect.Float64 { request.GetParams()[key] = strconv.FormatFloat(vj.Float(), 'f', -1, 64) } else { if err = flatStructure(vj, request, key+"."); err != nil { return } } } } else { if err = flatStructure(reflect.ValueOf(field.Interface()), request, prefix+nameTag+"."); err != nil { return } } } return } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������response.go�����������������������������������������������������������������������������������������0000664�0000000�0000000�00000004473�13771713062�0034433�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http���������������������������������������������������������������������������package common import ( "encoding/json" "fmt" "io/ioutil" //"log" "net/http" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" ) type Response interface { ParseErrorFromHTTPResponse(body []byte) error } type BaseResponse struct { } type ErrorResponse struct { Response struct { Error struct { Code string `json:"Code"` Message string `json:"Message"` } `json:"Error,omitempty"` RequestId string `json:"RequestId"` } `json:"Response"` } type DeprecatedAPIErrorResponse struct { Code int `json:"code"` Message string `json:"message"` CodeDesc string `json:"codeDesc"` } func (r *BaseResponse) ParseErrorFromHTTPResponse(body []byte) (err error) { resp := &ErrorResponse{} err = json.Unmarshal(body, resp) if err != nil { msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") } if resp.Response.Error.Code != "" { return errors.NewTencentCloudSDKError(resp.Response.Error.Code, resp.Response.Error.Message, resp.Response.RequestId) } deprecated := &DeprecatedAPIErrorResponse{} err = json.Unmarshal(body, deprecated) if err != nil { msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") } if deprecated.Code != 0 { return errors.NewTencentCloudSDKError(deprecated.CodeDesc, deprecated.Message, "") } return nil } func ParseFromHttpResponse(hr *http.Response, response Response) (err error) { defer hr.Body.Close() body, err := ioutil.ReadAll(hr.Body) if err != nil { msg := fmt.Sprintf("Fail to read response body because %s", err) return errors.NewTencentCloudSDKError("ClientError.IOError", msg, "") } if hr.StatusCode != 200 { msg := fmt.Sprintf("Request fail with http status code: %s, with body: %s", hr.Status, body) return errors.NewTencentCloudSDKError("ClientError.HttpStatusCodeError", msg, "") } //log.Printf("[DEBUG] Response Body=%s", body) err = response.ParseErrorFromHTTPResponse(body) if err != nil { return } err = json.Unmarshal(body, &response) if err != nil { msg := fmt.Sprintf("Fail to parse json content: %s, because: %s", body, err) return errors.NewTencentCloudSDKError("ClientError.ParseJsonError", msg, "") } return } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile/����0000775�0000000�0000000�00000000000�13771713062�0032776�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������client_profile.go�����������������������������������������������������������������������������������0000664�0000000�0000000�00000001026�13771713062�0036243�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile������������������������������������������������������������������������package profile type ClientProfile struct { HttpProfile *HttpProfile // Valid choices: HmacSHA1, HmacSHA256, TC3-HMAC-SHA256. // Default value is TC3-HMAC-SHA256. SignMethod string UnsignedPayload bool // Valid choices: zh-CN, en-US. // Default value is zh-CN. Language string Debug bool } func NewClientProfile() *ClientProfile { return &ClientProfile{ HttpProfile: NewHttpProfile(), SignMethod: "TC3-HMAC-SHA256", UnsignedPayload: false, Language: "zh-CN", Debug: false, } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������http_profile.go�������������������������������������������������������������������������������������0000664�0000000�0000000�00000000541�13771713062�0035745�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile������������������������������������������������������������������������package profile type HttpProfile struct { ReqMethod string ReqTimeout int Scheme string RootDomain string Endpoint string // Deprecated, use Scheme instead Protocol string } func NewHttpProfile() *HttpProfile { return &HttpProfile{ ReqMethod: "POST", ReqTimeout: 60, Scheme: "HTTPS", RootDomain: "", Endpoint: "", } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/sign.go�����0000664�0000000�0000000�00000004105�13771713062�0032625�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package common import ( "bytes" "crypto/hmac" "crypto/sha1" "crypto/sha256" "encoding/base64" "encoding/hex" "sort" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" ) const ( SHA256 = "HmacSHA256" SHA1 = "HmacSHA1" ) func Sign(s, secretKey, method string) string { hashed := hmac.New(sha1.New, []byte(secretKey)) if method == SHA256 { hashed = hmac.New(sha256.New, []byte(secretKey)) } hashed.Write([]byte(s)) return base64.StdEncoding.EncodeToString(hashed.Sum(nil)) } func sha256hex(s string) string { b := sha256.Sum256([]byte(s)) return hex.EncodeToString(b[:]) } func hmacsha256(s, key string) string { hashed := hmac.New(sha256.New, []byte(key)) hashed.Write([]byte(s)) return string(hashed.Sum(nil)) } func signRequest(request tchttp.Request, credential *Credential, method string) (err error) { if method != SHA256 { method = SHA1 } checkAuthParams(request, credential, method) s := getStringToSign(request) signature := Sign(s, credential.SecretKey, method) request.GetParams()["Signature"] = signature return } func checkAuthParams(request tchttp.Request, credential *Credential, method string) { params := request.GetParams() credentialParams := credential.GetCredentialParams() for key, value := range credentialParams { params[key] = value } params["SignatureMethod"] = method delete(params, "Signature") } func getStringToSign(request tchttp.Request) string { method := request.GetHttpMethod() domain := request.GetDomain() path := request.GetPath() var buf bytes.Buffer buf.WriteString(method) buf.WriteString(domain) buf.WriteString(path) buf.WriteString("?") params := request.GetParams() // sort params keys := make([]string, 0, len(params)) for k, _ := range params { keys = append(keys, k) } sort.Strings(keys) for i := range keys { k := keys[i] // TODO: check if server side allows empty value in url. if params[k] == "" { continue } buf.WriteString(k) buf.WriteString("=") buf.WriteString(params[k]) buf.WriteString("&") } buf.Truncate(buf.Len() - 1) return buf.String() } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/types.go����0000664�0000000�0000000�00000001245�13771713062�0033033�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package common func IntPtr(v int) *int { return &v } func Int64Ptr(v int64) *int64 { return &v } func UintPtr(v uint) *uint { return &v } func Uint64Ptr(v uint64) *uint64 { return &v } func Float64Ptr(v float64) *float64 { return &v } func StringPtr(v string) *string { return &v } func StringValues(ptrs []*string) []string { values := make([]string, len(ptrs)) for i := 0; i < len(ptrs); i++ { if ptrs[i] != nil { values[i] = *ptrs[i] } } return values } func StringPtrs(vals []string) []*string { ptrs := make([]*string, len(vals)) for i := 0; i < len(vals); i++ { ptrs[i] = &vals[i] } return ptrs } func BoolPtr(v bool) *bool { return &v } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/���������������0000775�0000000�0000000�00000000000�13771713062�0030633�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312/�����0000775�0000000�0000000�00000000000�13771713062�0031720�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������client.go�������������������������������������������������������������������������������������������0000664�0000000�0000000�00000241532�13771713062�0033455�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312�������������������������������������������������������������������������// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package v20170312 import ( "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" ) const APIVersion = "2017-03-12" type Client struct { common.Client } // Deprecated func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { cpf := profile.NewClientProfile() client = &Client{} client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) return } func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { client = &Client{} client.Init(region). WithCredential(credential). WithProfile(clientProfile) return } func NewAllocateHostsRequest() (request *AllocateHostsRequest) { request = &AllocateHostsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "AllocateHosts") return } func NewAllocateHostsResponse() (response *AllocateHostsResponse) { response = &AllocateHostsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (AllocateHosts) 用于创建一个或多个指定配置的CDH实例。 // * 当HostChargeType为PREPAID时,必须指定HostChargePrepaid参数。 func (c *Client) AllocateHosts(request *AllocateHostsRequest) (response *AllocateHostsResponse, err error) { if request == nil { request = NewAllocateHostsRequest() } response = NewAllocateHostsResponse() err = c.Send(request, response) return } func NewAssociateInstancesKeyPairsRequest() (request *AssociateInstancesKeyPairsRequest) { request = &AssociateInstancesKeyPairsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "AssociateInstancesKeyPairs") return } func NewAssociateInstancesKeyPairsResponse() (response *AssociateInstancesKeyPairsResponse) { response = &AssociateInstancesKeyPairsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (AssociateInstancesKeyPairs) 用于将密钥绑定到实例上。 // // * 将密钥的公钥写入到实例的`SSH`配置当中,用户就可以通过该密钥的私钥来登录实例。 // * 如果实例原来绑定过密钥,那么原来的密钥将失效。 // * 如果实例原来是通过密码登录,绑定密钥后无法使用密码登录。 // * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 func (c *Client) AssociateInstancesKeyPairs(request *AssociateInstancesKeyPairsRequest) (response *AssociateInstancesKeyPairsResponse, err error) { if request == nil { request = NewAssociateInstancesKeyPairsRequest() } response = NewAssociateInstancesKeyPairsResponse() err = c.Send(request, response) return } func NewAssociateSecurityGroupsRequest() (request *AssociateSecurityGroupsRequest) { request = &AssociateSecurityGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "AssociateSecurityGroups") return } func NewAssociateSecurityGroupsResponse() (response *AssociateSecurityGroupsResponse) { response = &AssociateSecurityGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (AssociateSecurityGroups) 用于绑定安全组到指定实例。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) AssociateSecurityGroups(request *AssociateSecurityGroupsRequest) (response *AssociateSecurityGroupsResponse, err error) { if request == nil { request = NewAssociateSecurityGroupsRequest() } response = NewAssociateSecurityGroupsResponse() err = c.Send(request, response) return } func NewCreateDisasterRecoverGroupRequest() (request *CreateDisasterRecoverGroupRequest) { request = &CreateDisasterRecoverGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "CreateDisasterRecoverGroup") return } func NewCreateDisasterRecoverGroupResponse() (response *CreateDisasterRecoverGroupResponse) { response = &CreateDisasterRecoverGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (CreateDisasterRecoverGroup)用于创建[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。创建好的置放群组,可在[创建实例](https://cloud.tencent.com/document/api/213/15730)时指定。 func (c *Client) CreateDisasterRecoverGroup(request *CreateDisasterRecoverGroupRequest) (response *CreateDisasterRecoverGroupResponse, err error) { if request == nil { request = NewCreateDisasterRecoverGroupRequest() } response = NewCreateDisasterRecoverGroupResponse() err = c.Send(request, response) return } func NewCreateImageRequest() (request *CreateImageRequest) { request = &CreateImageRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "CreateImage") return } func NewCreateImageResponse() (response *CreateImageResponse) { response = &CreateImageResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateImage)用于将实例的系统盘制作为新镜像,创建后的镜像可以用于创建实例。 func (c *Client) CreateImage(request *CreateImageRequest) (response *CreateImageResponse, err error) { if request == nil { request = NewCreateImageRequest() } response = NewCreateImageResponse() err = c.Send(request, response) return } func NewCreateKeyPairRequest() (request *CreateKeyPairRequest) { request = &CreateKeyPairRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "CreateKeyPair") return } func NewCreateKeyPairResponse() (response *CreateKeyPairResponse) { response = &CreateKeyPairResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (CreateKeyPair) 用于创建一个 `OpenSSH RSA` 密钥对,可以用于登录 `Linux` 实例。 // // * 开发者只需指定密钥对名称,即可由系统自动创建密钥对,并返回所生成的密钥对的 `ID` 及其公钥、私钥的内容。 // * 密钥对名称不能和已经存在的密钥对的名称重复。 // * 私钥的内容可以保存到文件中作为 `SSH` 的一种认证方式。 // * 腾讯云不会保存用户的私钥,请妥善保管。 func (c *Client) CreateKeyPair(request *CreateKeyPairRequest) (response *CreateKeyPairResponse, err error) { if request == nil { request = NewCreateKeyPairRequest() } response = NewCreateKeyPairResponse() err = c.Send(request, response) return } func NewDeleteDisasterRecoverGroupsRequest() (request *DeleteDisasterRecoverGroupsRequest) { request = &DeleteDisasterRecoverGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DeleteDisasterRecoverGroups") return } func NewDeleteDisasterRecoverGroupsResponse() (response *DeleteDisasterRecoverGroupsResponse) { response = &DeleteDisasterRecoverGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DeleteDisasterRecoverGroups)用于删除[分散置放群组](https://cloud.tencent.com/document/product/213/15486)。只有空的置放群组才能被删除,非空的群组需要先销毁组内所有云服务器,才能执行删除操作,不然会产生删除置放群组失败的错误。 func (c *Client) DeleteDisasterRecoverGroups(request *DeleteDisasterRecoverGroupsRequest) (response *DeleteDisasterRecoverGroupsResponse, err error) { if request == nil { request = NewDeleteDisasterRecoverGroupsRequest() } response = NewDeleteDisasterRecoverGroupsResponse() err = c.Send(request, response) return } func NewDeleteImagesRequest() (request *DeleteImagesRequest) { request = &DeleteImagesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DeleteImages") return } func NewDeleteImagesResponse() (response *DeleteImagesResponse) { response = &DeleteImagesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteImages)用于删除一个或多个镜像。 // // * 当[镜像状态](https://cloud.tencent.com/document/product/213/15753#Image)为`创建中`和`使用中`时, 不允许删除。镜像状态可以通过[DescribeImages](https://cloud.tencent.com/document/api/213/9418)获取。 // * 每个地域最多只支持创建10个自定义镜像,删除镜像可以释放账户的配额。 // * 当镜像正在被其它账户分享时,不允许删除。 func (c *Client) DeleteImages(request *DeleteImagesRequest) (response *DeleteImagesResponse, err error) { if request == nil { request = NewDeleteImagesRequest() } response = NewDeleteImagesResponse() err = c.Send(request, response) return } func NewDeleteKeyPairsRequest() (request *DeleteKeyPairsRequest) { request = &DeleteKeyPairsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DeleteKeyPairs") return } func NewDeleteKeyPairsResponse() (response *DeleteKeyPairsResponse) { response = &DeleteKeyPairsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DeleteKeyPairs) 用于删除已在腾讯云托管的密钥对。 // // * 可以同时删除多个密钥对。 // * 不能删除已被实例或镜像引用的密钥对,所以需要独立判断是否所有密钥对都被成功删除。 func (c *Client) DeleteKeyPairs(request *DeleteKeyPairsRequest) (response *DeleteKeyPairsResponse, err error) { if request == nil { request = NewDeleteKeyPairsRequest() } response = NewDeleteKeyPairsResponse() err = c.Send(request, response) return } func NewDescribeDisasterRecoverGroupQuotaRequest() (request *DescribeDisasterRecoverGroupQuotaRequest) { request = &DescribeDisasterRecoverGroupQuotaRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeDisasterRecoverGroupQuota") return } func NewDescribeDisasterRecoverGroupQuotaResponse() (response *DescribeDisasterRecoverGroupQuotaResponse) { response = &DescribeDisasterRecoverGroupQuotaResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeDisasterRecoverGroupQuota)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)配额。 func (c *Client) DescribeDisasterRecoverGroupQuota(request *DescribeDisasterRecoverGroupQuotaRequest) (response *DescribeDisasterRecoverGroupQuotaResponse, err error) { if request == nil { request = NewDescribeDisasterRecoverGroupQuotaRequest() } response = NewDescribeDisasterRecoverGroupQuotaResponse() err = c.Send(request, response) return } func NewDescribeDisasterRecoverGroupsRequest() (request *DescribeDisasterRecoverGroupsRequest) { request = &DescribeDisasterRecoverGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeDisasterRecoverGroups") return } func NewDescribeDisasterRecoverGroupsResponse() (response *DescribeDisasterRecoverGroupsResponse) { response = &DescribeDisasterRecoverGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeDisasterRecoverGroups)用于查询[分散置放群组](https://cloud.tencent.com/document/product/213/15486)信息。 func (c *Client) DescribeDisasterRecoverGroups(request *DescribeDisasterRecoverGroupsRequest) (response *DescribeDisasterRecoverGroupsResponse, err error) { if request == nil { request = NewDescribeDisasterRecoverGroupsRequest() } response = NewDescribeDisasterRecoverGroupsResponse() err = c.Send(request, response) return } func NewDescribeHostsRequest() (request *DescribeHostsRequest) { request = &DescribeHostsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeHosts") return } func NewDescribeHostsResponse() (response *DescribeHostsResponse) { response = &DescribeHostsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeHosts) 用于获取一个或多个CDH实例的详细信息。 func (c *Client) DescribeHosts(request *DescribeHostsRequest) (response *DescribeHostsResponse, err error) { if request == nil { request = NewDescribeHostsRequest() } response = NewDescribeHostsResponse() err = c.Send(request, response) return } func NewDescribeImageQuotaRequest() (request *DescribeImageQuotaRequest) { request = &DescribeImageQuotaRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeImageQuota") return } func NewDescribeImageQuotaResponse() (response *DescribeImageQuotaResponse) { response = &DescribeImageQuotaResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeImageQuota)用于查询用户帐号的镜像配额。 func (c *Client) DescribeImageQuota(request *DescribeImageQuotaRequest) (response *DescribeImageQuotaResponse, err error) { if request == nil { request = NewDescribeImageQuotaRequest() } response = NewDescribeImageQuotaResponse() err = c.Send(request, response) return } func NewDescribeImageSharePermissionRequest() (request *DescribeImageSharePermissionRequest) { request = &DescribeImageSharePermissionRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeImageSharePermission") return } func NewDescribeImageSharePermissionResponse() (response *DescribeImageSharePermissionResponse) { response = &DescribeImageSharePermissionResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeImageSharePermission)用于查询镜像分享信息。 func (c *Client) DescribeImageSharePermission(request *DescribeImageSharePermissionRequest) (response *DescribeImageSharePermissionResponse, err error) { if request == nil { request = NewDescribeImageSharePermissionRequest() } response = NewDescribeImageSharePermissionResponse() err = c.Send(request, response) return } func NewDescribeImagesRequest() (request *DescribeImagesRequest) { request = &DescribeImagesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeImages") return } func NewDescribeImagesResponse() (response *DescribeImagesResponse) { response = &DescribeImagesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeImages) 用于查看镜像列表。 // // * 可以通过指定镜像ID来查询指定镜像的详细信息,或通过设定过滤器来查询满足过滤条件的镜像的详细信息。 // * 指定偏移(Offset)和限制(Limit)来选择结果中的一部分,默认返回满足条件的前20个镜像信息。 func (c *Client) DescribeImages(request *DescribeImagesRequest) (response *DescribeImagesResponse, err error) { if request == nil { request = NewDescribeImagesRequest() } response = NewDescribeImagesResponse() err = c.Send(request, response) return } func NewDescribeImportImageOsRequest() (request *DescribeImportImageOsRequest) { request = &DescribeImportImageOsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeImportImageOs") return } func NewDescribeImportImageOsResponse() (response *DescribeImportImageOsResponse) { response = &DescribeImportImageOsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 查看可以导入的镜像操作系统信息。 func (c *Client) DescribeImportImageOs(request *DescribeImportImageOsRequest) (response *DescribeImportImageOsResponse, err error) { if request == nil { request = NewDescribeImportImageOsRequest() } response = NewDescribeImportImageOsResponse() err = c.Send(request, response) return } func NewDescribeInstanceFamilyConfigsRequest() (request *DescribeInstanceFamilyConfigsRequest) { request = &DescribeInstanceFamilyConfigsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceFamilyConfigs") return } func NewDescribeInstanceFamilyConfigsResponse() (response *DescribeInstanceFamilyConfigsResponse) { response = &DescribeInstanceFamilyConfigsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeInstanceFamilyConfigs)查询当前用户和地域所支持的机型族列表信息。 func (c *Client) DescribeInstanceFamilyConfigs(request *DescribeInstanceFamilyConfigsRequest) (response *DescribeInstanceFamilyConfigsResponse, err error) { if request == nil { request = NewDescribeInstanceFamilyConfigsRequest() } response = NewDescribeInstanceFamilyConfigsResponse() err = c.Send(request, response) return } func NewDescribeInstanceInternetBandwidthConfigsRequest() (request *DescribeInstanceInternetBandwidthConfigsRequest) { request = &DescribeInstanceInternetBandwidthConfigsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceInternetBandwidthConfigs") return } func NewDescribeInstanceInternetBandwidthConfigsResponse() (response *DescribeInstanceInternetBandwidthConfigsResponse) { response = &DescribeInstanceInternetBandwidthConfigsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeInstanceInternetBandwidthConfigs) 用于查询实例带宽配置。 // // * 只支持查询`BANDWIDTH_PREPAID`( 预付费按带宽结算 )计费模式的带宽配置。 // * 接口返回实例的所有带宽配置信息(包含历史的带宽配置信息)。 func (c *Client) DescribeInstanceInternetBandwidthConfigs(request *DescribeInstanceInternetBandwidthConfigsRequest) (response *DescribeInstanceInternetBandwidthConfigsResponse, err error) { if request == nil { request = NewDescribeInstanceInternetBandwidthConfigsRequest() } response = NewDescribeInstanceInternetBandwidthConfigsResponse() err = c.Send(request, response) return } func NewDescribeInstanceTypeConfigsRequest() (request *DescribeInstanceTypeConfigsRequest) { request = &DescribeInstanceTypeConfigsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceTypeConfigs") return } func NewDescribeInstanceTypeConfigsResponse() (response *DescribeInstanceTypeConfigsResponse) { response = &DescribeInstanceTypeConfigsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeInstanceTypeConfigs) 用于查询实例机型配置。 // // * 可以根据`zone`、`instance-family`来查询实例机型配置。过滤条件详见过滤器[`Filter`](https://cloud.tencent.com/document/api/213/15753#Filter)。 // * 如果参数为空,返回指定地域的所有实例机型配置。 func (c *Client) DescribeInstanceTypeConfigs(request *DescribeInstanceTypeConfigsRequest) (response *DescribeInstanceTypeConfigsResponse, err error) { if request == nil { request = NewDescribeInstanceTypeConfigsRequest() } response = NewDescribeInstanceTypeConfigsResponse() err = c.Send(request, response) return } func NewDescribeInstanceVncUrlRequest() (request *DescribeInstanceVncUrlRequest) { request = &DescribeInstanceVncUrlRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstanceVncUrl") return } func NewDescribeInstanceVncUrlResponse() (response *DescribeInstanceVncUrlResponse) { response = &DescribeInstanceVncUrlResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 ( DescribeInstanceVncUrl ) 用于查询实例管理终端地址,获取的地址可用于实例的 VNC 登录。 // // * 处于 `STOPPED` 状态的机器无法使用此功能。 // * 管理终端地址的有效期为 15 秒,调用接口成功后如果 15 秒内不使用该链接进行访问,管理终端地址自动失效,您需要重新查询。 // * 管理终端地址一旦被访问,将自动失效,您需要重新查询。 // * 如果连接断开,每分钟内重新连接的次数不能超过 30 次。 // * 获取到 `InstanceVncUrl` 后,您需要在链接 <https://img.qcloud.com/qcloud/app/active_vnc/index.html?> 末尾加上参数 `InstanceVncUrl=xxxx` 。 // // - 参数 `InstanceVncUrl` :调用接口成功后会返回的 `InstanceVncUrl` 的值。 // // 最后组成的 URL 格式如下: // // ``` // https://img.qcloud.com/qcloud/app/active_vnc/index.html?InstanceVncUrl=wss%3A%2F%2Fbjvnc.qcloud.com%3A26789%2Fvnc%3Fs%3DaHpjWnRVMFNhYmxKdDM5MjRHNlVTSVQwajNUSW0wb2tBbmFtREFCTmFrcy8vUUNPMG0wSHZNOUUxRm5PMmUzWmFDcWlOdDJIbUJxSTZDL0RXcHZxYnZZMmRkWWZWcEZia2lyb09XMzdKNmM9 // ``` func (c *Client) DescribeInstanceVncUrl(request *DescribeInstanceVncUrlRequest) (response *DescribeInstanceVncUrlResponse, err error) { if request == nil { request = NewDescribeInstanceVncUrlRequest() } response = NewDescribeInstanceVncUrlResponse() err = c.Send(request, response) return } func NewDescribeInstancesRequest() (request *DescribeInstancesRequest) { request = &DescribeInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstances") return } func NewDescribeInstancesResponse() (response *DescribeInstancesResponse) { response = &DescribeInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeInstances) 用于查询一个或多个实例的详细信息。 // // * 可以根据实例`ID`、实例名称或者实例计费模式等信息来查询实例的详细信息。过滤信息详细请见过滤器`Filter`。 // * 如果参数为空,返回当前用户一定数量(`Limit`所指定的数量,默认为20)的实例。 // * 支持查询实例的最新操作(LatestOperation)以及最新操作状态(LatestOperationState)。 func (c *Client) DescribeInstances(request *DescribeInstancesRequest) (response *DescribeInstancesResponse, err error) { if request == nil { request = NewDescribeInstancesRequest() } response = NewDescribeInstancesResponse() err = c.Send(request, response) return } func NewDescribeInstancesOperationLimitRequest() (request *DescribeInstancesOperationLimitRequest) { request = &DescribeInstancesOperationLimitRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstancesOperationLimit") return } func NewDescribeInstancesOperationLimitResponse() (response *DescribeInstancesOperationLimitResponse) { response = &DescribeInstancesOperationLimitResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeInstancesOperationLimit)用于查询实例操作限制。 // // * 目前支持调整配置操作限制次数查询。 func (c *Client) DescribeInstancesOperationLimit(request *DescribeInstancesOperationLimitRequest) (response *DescribeInstancesOperationLimitResponse, err error) { if request == nil { request = NewDescribeInstancesOperationLimitRequest() } response = NewDescribeInstancesOperationLimitResponse() err = c.Send(request, response) return } func NewDescribeInstancesStatusRequest() (request *DescribeInstancesStatusRequest) { request = &DescribeInstancesStatusRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInstancesStatus") return } func NewDescribeInstancesStatusResponse() (response *DescribeInstancesStatusResponse) { response = &DescribeInstancesStatusResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeInstancesStatus) 用于查询一个或多个实例的状态。 // // * 可以根据实例`ID`来查询实例的状态。 // * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的实例状态。 func (c *Client) DescribeInstancesStatus(request *DescribeInstancesStatusRequest) (response *DescribeInstancesStatusResponse, err error) { if request == nil { request = NewDescribeInstancesStatusRequest() } response = NewDescribeInstancesStatusResponse() err = c.Send(request, response) return } func NewDescribeInternetChargeTypeConfigsRequest() (request *DescribeInternetChargeTypeConfigsRequest) { request = &DescribeInternetChargeTypeConfigsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeInternetChargeTypeConfigs") return } func NewDescribeInternetChargeTypeConfigsResponse() (response *DescribeInternetChargeTypeConfigsResponse) { response = &DescribeInternetChargeTypeConfigsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeInternetChargeTypeConfigs)用于查询网络的计费类型。 func (c *Client) DescribeInternetChargeTypeConfigs(request *DescribeInternetChargeTypeConfigsRequest) (response *DescribeInternetChargeTypeConfigsResponse, err error) { if request == nil { request = NewDescribeInternetChargeTypeConfigsRequest() } response = NewDescribeInternetChargeTypeConfigsResponse() err = c.Send(request, response) return } func NewDescribeKeyPairsRequest() (request *DescribeKeyPairsRequest) { request = &DescribeKeyPairsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeKeyPairs") return } func NewDescribeKeyPairsResponse() (response *DescribeKeyPairsResponse) { response = &DescribeKeyPairsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeKeyPairs) 用于查询密钥对信息。 // // * 密钥对是通过一种算法生成的一对密钥,在生成的密钥对中,一个向外界公开,称为公钥;另一个用户自己保留,称为私钥。密钥对的公钥内容可以通过这个接口查询,但私钥内容系统不保留。 func (c *Client) DescribeKeyPairs(request *DescribeKeyPairsRequest) (response *DescribeKeyPairsResponse, err error) { if request == nil { request = NewDescribeKeyPairsRequest() } response = NewDescribeKeyPairsResponse() err = c.Send(request, response) return } func NewDescribeRegionsRequest() (request *DescribeRegionsRequest) { request = &DescribeRegionsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeRegions") return } func NewDescribeRegionsResponse() (response *DescribeRegionsResponse) { response = &DescribeRegionsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeRegions)用于查询地域信息。 func (c *Client) DescribeRegions(request *DescribeRegionsRequest) (response *DescribeRegionsResponse, err error) { if request == nil { request = NewDescribeRegionsRequest() } response = NewDescribeRegionsResponse() err = c.Send(request, response) return } func NewDescribeReservedInstancesRequest() (request *DescribeReservedInstancesRequest) { request = &DescribeReservedInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeReservedInstances") return } func NewDescribeReservedInstancesResponse() (response *DescribeReservedInstancesResponse) { response = &DescribeReservedInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeReservedInstances)可提供列出用户已购买的预留实例 func (c *Client) DescribeReservedInstances(request *DescribeReservedInstancesRequest) (response *DescribeReservedInstancesResponse, err error) { if request == nil { request = NewDescribeReservedInstancesRequest() } response = NewDescribeReservedInstancesResponse() err = c.Send(request, response) return } func NewDescribeReservedInstancesOfferingsRequest() (request *DescribeReservedInstancesOfferingsRequest) { request = &DescribeReservedInstancesOfferingsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeReservedInstancesOfferings") return } func NewDescribeReservedInstancesOfferingsResponse() (response *DescribeReservedInstancesOfferingsResponse) { response = &DescribeReservedInstancesOfferingsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeReservedInstancesOfferings)供用户列出可购买的预留实例配置 func (c *Client) DescribeReservedInstancesOfferings(request *DescribeReservedInstancesOfferingsRequest) (response *DescribeReservedInstancesOfferingsResponse, err error) { if request == nil { request = NewDescribeReservedInstancesOfferingsRequest() } response = NewDescribeReservedInstancesOfferingsResponse() err = c.Send(request, response) return } func NewDescribeZoneInstanceConfigInfosRequest() (request *DescribeZoneInstanceConfigInfosRequest) { request = &DescribeZoneInstanceConfigInfosRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeZoneInstanceConfigInfos") return } func NewDescribeZoneInstanceConfigInfosResponse() (response *DescribeZoneInstanceConfigInfosResponse) { response = &DescribeZoneInstanceConfigInfosResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeZoneInstanceConfigInfos) 获取可用区的机型信息。 func (c *Client) DescribeZoneInstanceConfigInfos(request *DescribeZoneInstanceConfigInfosRequest) (response *DescribeZoneInstanceConfigInfosResponse, err error) { if request == nil { request = NewDescribeZoneInstanceConfigInfosRequest() } response = NewDescribeZoneInstanceConfigInfosResponse() err = c.Send(request, response) return } func NewDescribeZonesRequest() (request *DescribeZonesRequest) { request = &DescribeZonesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DescribeZones") return } func NewDescribeZonesResponse() (response *DescribeZonesResponse) { response = &DescribeZonesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeZones)用于查询可用区信息。 func (c *Client) DescribeZones(request *DescribeZonesRequest) (response *DescribeZonesResponse, err error) { if request == nil { request = NewDescribeZonesRequest() } response = NewDescribeZonesResponse() err = c.Send(request, response) return } func NewDisassociateInstancesKeyPairsRequest() (request *DisassociateInstancesKeyPairsRequest) { request = &DisassociateInstancesKeyPairsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DisassociateInstancesKeyPairs") return } func NewDisassociateInstancesKeyPairsResponse() (response *DisassociateInstancesKeyPairsResponse) { response = &DisassociateInstancesKeyPairsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DisassociateInstancesKeyPairs) 用于解除实例的密钥绑定关系。 // // * 只支持[`STOPPED`](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)状态的`Linux`操作系统的实例。 // * 解绑密钥后,实例可以通过原来设置的密码登录。 // * 如果原来没有设置密码,解绑后将无法使用 `SSH` 登录。可以调用 [ResetInstancesPassword](https://cloud.tencent.com/document/api/213/15736) 接口来设置登录密码。 // * 支持批量操作。每次请求批量实例的上限为100。如果批量实例存在不允许操作的实例,操作会以特定错误码返回。 func (c *Client) DisassociateInstancesKeyPairs(request *DisassociateInstancesKeyPairsRequest) (response *DisassociateInstancesKeyPairsResponse, err error) { if request == nil { request = NewDisassociateInstancesKeyPairsRequest() } response = NewDisassociateInstancesKeyPairsResponse() err = c.Send(request, response) return } func NewDisassociateSecurityGroupsRequest() (request *DisassociateSecurityGroupsRequest) { request = &DisassociateSecurityGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "DisassociateSecurityGroups") return } func NewDisassociateSecurityGroupsResponse() (response *DisassociateSecurityGroupsResponse) { response = &DisassociateSecurityGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DisassociateSecurityGroups) 用于解绑实例的指定安全组。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) DisassociateSecurityGroups(request *DisassociateSecurityGroupsRequest) (response *DisassociateSecurityGroupsResponse, err error) { if request == nil { request = NewDisassociateSecurityGroupsRequest() } response = NewDisassociateSecurityGroupsResponse() err = c.Send(request, response) return } func NewImportImageRequest() (request *ImportImageRequest) { request = &ImportImageRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ImportImage") return } func NewImportImageResponse() (response *ImportImageResponse) { response = &ImportImageResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ImportImage)用于导入镜像,导入后的镜像可用于创建实例。 func (c *Client) ImportImage(request *ImportImageRequest) (response *ImportImageResponse, err error) { if request == nil { request = NewImportImageRequest() } response = NewImportImageResponse() err = c.Send(request, response) return } func NewImportKeyPairRequest() (request *ImportKeyPairRequest) { request = &ImportKeyPairRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ImportKeyPair") return } func NewImportKeyPairResponse() (response *ImportKeyPairResponse) { response = &ImportKeyPairResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ImportKeyPair) 用于导入密钥对。 // // * 本接口的功能是将密钥对导入到用户账户,并不会自动绑定到实例。如需绑定可以使用[AssociasteInstancesKeyPair](https://cloud.tencent.com/document/api/213/9404)接口。 // * 需指定密钥对名称以及该密钥对的公钥文本。 // * 如果用户只有私钥,可以通过 `SSL` 工具将私钥转换成公钥后再导入。 func (c *Client) ImportKeyPair(request *ImportKeyPairRequest) (response *ImportKeyPairResponse, err error) { if request == nil { request = NewImportKeyPairRequest() } response = NewImportKeyPairResponse() err = c.Send(request, response) return } func NewInquiryPriceModifyInstancesChargeTypeRequest() (request *InquiryPriceModifyInstancesChargeTypeRequest) { request = &InquiryPriceModifyInstancesChargeTypeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceModifyInstancesChargeType") return } func NewInquiryPriceModifyInstancesChargeTypeResponse() (response *InquiryPriceModifyInstancesChargeTypeResponse) { response = &InquiryPriceModifyInstancesChargeTypeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (InquiryPriceModifyInstancesChargeType) 用于切换实例的计费模式询价。 // // * 只支持从 `POSTPAID_BY_HOUR` 计费模式切换为`PREPAID`计费模式。 // * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例、竞价实例不支持该操作。 func (c *Client) InquiryPriceModifyInstancesChargeType(request *InquiryPriceModifyInstancesChargeTypeRequest) (response *InquiryPriceModifyInstancesChargeTypeResponse, err error) { if request == nil { request = NewInquiryPriceModifyInstancesChargeTypeRequest() } response = NewInquiryPriceModifyInstancesChargeTypeResponse() err = c.Send(request, response) return } func NewInquiryPriceRenewInstancesRequest() (request *InquiryPriceRenewInstancesRequest) { request = &InquiryPriceRenewInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceRenewInstances") return } func NewInquiryPriceRenewInstancesResponse() (response *InquiryPriceRenewInstancesResponse) { response = &InquiryPriceRenewInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (InquiryPriceRenewInstances) 用于续费包年包月实例询价。 // // * 只支持查询包年包月实例的续费价格。 func (c *Client) InquiryPriceRenewInstances(request *InquiryPriceRenewInstancesRequest) (response *InquiryPriceRenewInstancesResponse, err error) { if request == nil { request = NewInquiryPriceRenewInstancesRequest() } response = NewInquiryPriceRenewInstancesResponse() err = c.Send(request, response) return } func NewInquiryPriceResetInstanceRequest() (request *InquiryPriceResetInstanceRequest) { request = &InquiryPriceResetInstanceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResetInstance") return } func NewInquiryPriceResetInstanceResponse() (response *InquiryPriceResetInstanceResponse) { response = &InquiryPriceResetInstanceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (InquiryPriceResetInstance) 用于重装实例询价。 // // * 如果指定了`ImageId`参数,则使用指定的镜像进行重装询价;否则按照当前实例使用的镜像进行重装询价。 // * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。 // * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换的重装询价。 func (c *Client) InquiryPriceResetInstance(request *InquiryPriceResetInstanceRequest) (response *InquiryPriceResetInstanceResponse, err error) { if request == nil { request = NewInquiryPriceResetInstanceRequest() } response = NewInquiryPriceResetInstanceResponse() err = c.Send(request, response) return } func NewInquiryPriceResetInstancesInternetMaxBandwidthRequest() (request *InquiryPriceResetInstancesInternetMaxBandwidthRequest) { request = &InquiryPriceResetInstancesInternetMaxBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResetInstancesInternetMaxBandwidth") return } func NewInquiryPriceResetInstancesInternetMaxBandwidthResponse() (response *InquiryPriceResetInstancesInternetMaxBandwidthResponse) { response = &InquiryPriceResetInstancesInternetMaxBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (InquiryPriceResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限询价。 // // * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。 // * 对于`BANDWIDTH_PREPAID`计费方式的带宽,目前不支持调小带宽,且需要输入参数`StartTime`和`EndTime`,指定调整后的带宽的生效时间段。在这种场景下会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 // * 对于 `TRAFFIC_POSTPAID_BY_HOUR`、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。 // * 接口不支持调整`BANDWIDTH_POSTPAID_BY_MONTH`计费方式的带宽。 // * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。 // * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整`TRAFFIC_POSTPAID_BY_HOUR`和`BANDWIDTH_PACKAGE`计费方式的带宽。 func (c *Client) InquiryPriceResetInstancesInternetMaxBandwidth(request *InquiryPriceResetInstancesInternetMaxBandwidthRequest) (response *InquiryPriceResetInstancesInternetMaxBandwidthResponse, err error) { if request == nil { request = NewInquiryPriceResetInstancesInternetMaxBandwidthRequest() } response = NewInquiryPriceResetInstancesInternetMaxBandwidthResponse() err = c.Send(request, response) return } func NewInquiryPriceResetInstancesTypeRequest() (request *InquiryPriceResetInstancesTypeRequest) { request = &InquiryPriceResetInstancesTypeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResetInstancesType") return } func NewInquiryPriceResetInstancesTypeResponse() (response *InquiryPriceResetInstancesTypeResponse) { response = &InquiryPriceResetInstancesTypeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (InquiryPriceResetInstancesType) 用于调整实例的机型询价。 // // * 目前只支持[系统盘类型](https://cloud.tencent.com/document/product/213/15753#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行调整机型询价。 // * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型询价。 // * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 func (c *Client) InquiryPriceResetInstancesType(request *InquiryPriceResetInstancesTypeRequest) (response *InquiryPriceResetInstancesTypeResponse, err error) { if request == nil { request = NewInquiryPriceResetInstancesTypeRequest() } response = NewInquiryPriceResetInstancesTypeResponse() err = c.Send(request, response) return } func NewInquiryPriceResizeInstanceDisksRequest() (request *InquiryPriceResizeInstanceDisksRequest) { request = &InquiryPriceResizeInstanceDisksRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceResizeInstanceDisks") return } func NewInquiryPriceResizeInstanceDisksResponse() (response *InquiryPriceResizeInstanceDisksResponse) { response = &InquiryPriceResizeInstanceDisksResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (InquiryPriceResizeInstanceDisks) 用于扩容实例的数据盘询价。 // // * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性)询价,且[数据盘类型](https://cloud.tencent.com/document/product/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。 // * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口扩容数据盘询价。* 仅支持包年包月实例随机器购买的数据盘。* 目前只支持扩容一块数据盘询价。 func (c *Client) InquiryPriceResizeInstanceDisks(request *InquiryPriceResizeInstanceDisksRequest) (response *InquiryPriceResizeInstanceDisksResponse, err error) { if request == nil { request = NewInquiryPriceResizeInstanceDisksRequest() } response = NewInquiryPriceResizeInstanceDisksResponse() err = c.Send(request, response) return } func NewInquiryPriceRunInstancesRequest() (request *InquiryPriceRunInstancesRequest) { request = &InquiryPriceRunInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "InquiryPriceRunInstances") return } func NewInquiryPriceRunInstancesResponse() (response *InquiryPriceRunInstancesResponse) { response = &InquiryPriceRunInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(InquiryPriceRunInstances)用于创建实例询价。本接口仅允许针对购买限制范围内的实例配置进行询价, 详见:[创建实例](https://cloud.tencent.com/document/api/213/15730)。 func (c *Client) InquiryPriceRunInstances(request *InquiryPriceRunInstancesRequest) (response *InquiryPriceRunInstancesResponse, err error) { if request == nil { request = NewInquiryPriceRunInstancesRequest() } response = NewInquiryPriceRunInstancesResponse() err = c.Send(request, response) return } func NewModifyDisasterRecoverGroupAttributeRequest() (request *ModifyDisasterRecoverGroupAttributeRequest) { request = &ModifyDisasterRecoverGroupAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyDisasterRecoverGroupAttribute") return } func NewModifyDisasterRecoverGroupAttributeResponse() (response *ModifyDisasterRecoverGroupAttributeResponse) { response = &ModifyDisasterRecoverGroupAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ModifyDisasterRecoverGroupAttribute)用于修改[分散置放群组](https://cloud.tencent.com/document/product/213/15486)属性。 func (c *Client) ModifyDisasterRecoverGroupAttribute(request *ModifyDisasterRecoverGroupAttributeRequest) (response *ModifyDisasterRecoverGroupAttributeResponse, err error) { if request == nil { request = NewModifyDisasterRecoverGroupAttributeRequest() } response = NewModifyDisasterRecoverGroupAttributeResponse() err = c.Send(request, response) return } func NewModifyHostsAttributeRequest() (request *ModifyHostsAttributeRequest) { request = &ModifyHostsAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyHostsAttribute") return } func NewModifyHostsAttributeResponse() (response *ModifyHostsAttributeResponse) { response = &ModifyHostsAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyHostsAttribute)用于修改CDH实例的属性,如实例名称和续费标记等。参数HostName和RenewFlag必须设置其中一个,但不能同时设置。 func (c *Client) ModifyHostsAttribute(request *ModifyHostsAttributeRequest) (response *ModifyHostsAttributeResponse, err error) { if request == nil { request = NewModifyHostsAttributeRequest() } response = NewModifyHostsAttributeResponse() err = c.Send(request, response) return } func NewModifyImageAttributeRequest() (request *ModifyImageAttributeRequest) { request = &ModifyImageAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyImageAttribute") return } func NewModifyImageAttributeResponse() (response *ModifyImageAttributeResponse) { response = &ModifyImageAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyImageAttribute)用于修改镜像属性。 // // * 已分享的镜像无法修改属性。 func (c *Client) ModifyImageAttribute(request *ModifyImageAttributeRequest) (response *ModifyImageAttributeResponse, err error) { if request == nil { request = NewModifyImageAttributeRequest() } response = NewModifyImageAttributeResponse() err = c.Send(request, response) return } func NewModifyImageSharePermissionRequest() (request *ModifyImageSharePermissionRequest) { request = &ModifyImageSharePermissionRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyImageSharePermission") return } func NewModifyImageSharePermissionResponse() (response *ModifyImageSharePermissionResponse) { response = &ModifyImageSharePermissionResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyImageSharePermission)用于修改镜像分享信息。 // // * 分享镜像后,被分享账户可以通过该镜像创建实例。 // * 每个自定义镜像最多可共享给50个账户。 // * 分享镜像无法更改名称,描述,仅可用于创建实例。 // * 只支持分享到对方账户相同地域。 func (c *Client) ModifyImageSharePermission(request *ModifyImageSharePermissionRequest) (response *ModifyImageSharePermissionResponse, err error) { if request == nil { request = NewModifyImageSharePermissionRequest() } response = NewModifyImageSharePermissionResponse() err = c.Send(request, response) return } func NewModifyInstancesAttributeRequest() (request *ModifyInstancesAttributeRequest) { request = &ModifyInstancesAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesAttribute") return } func NewModifyInstancesAttributeResponse() (response *ModifyInstancesAttributeResponse) { response = &ModifyInstancesAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ModifyInstancesAttribute) 用于修改实例的属性(目前只支持修改实例的名称和关联的安全组)。 // // * “实例名称”仅为方便用户自己管理之用,腾讯云并不以此名称作为提交工单或是进行实例管理操作的依据。 // * 支持批量操作。每次请求批量实例的上限为100。 // * 修改关联安全组时,子机原来关联的安全组会被解绑。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ModifyInstancesAttribute(request *ModifyInstancesAttributeRequest) (response *ModifyInstancesAttributeResponse, err error) { if request == nil { request = NewModifyInstancesAttributeRequest() } response = NewModifyInstancesAttributeResponse() err = c.Send(request, response) return } func NewModifyInstancesChargeTypeRequest() (request *ModifyInstancesChargeTypeRequest) { request = &ModifyInstancesChargeTypeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesChargeType") return } func NewModifyInstancesChargeTypeResponse() (response *ModifyInstancesChargeTypeResponse) { response = &ModifyInstancesChargeTypeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ModifyInstancesChargeType) 用于切换实例的计费模式。 // // * 只支持从 `POSTPAID_BY_HOUR` 计费模式切换为`PREPAID`计费模式。 // * 关机不收费的实例、`BC1`和`BS1`机型族的实例、设置定时销毁的实例不支持该操作。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ModifyInstancesChargeType(request *ModifyInstancesChargeTypeRequest) (response *ModifyInstancesChargeTypeResponse, err error) { if request == nil { request = NewModifyInstancesChargeTypeRequest() } response = NewModifyInstancesChargeTypeResponse() err = c.Send(request, response) return } func NewModifyInstancesProjectRequest() (request *ModifyInstancesProjectRequest) { request = &ModifyInstancesProjectRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesProject") return } func NewModifyInstancesProjectResponse() (response *ModifyInstancesProjectResponse) { response = &ModifyInstancesProjectResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ModifyInstancesProject) 用于修改实例所属项目。 // // * 项目为一个虚拟概念,用户可以在一个账户下面建立多个项目,每个项目中管理不同的资源;将多个不同实例分属到不同项目中,后续使用 [`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口查询实例,项目ID可用于过滤结果。 // * 绑定负载均衡的实例不支持修改实例所属项目,请先使用[`DeregisterInstancesFromLoadBalancer`](https://cloud.tencent.com/document/api/214/1258)接口解绑负载均衡。 // [^_^]: # ( 修改实例所属项目会自动解关联实例原来关联的安全组,修改完成后可使用[`ModifyInstancesAttribute`](https://cloud.tencent.com/document/api/213/15739)接口关联安全组。) // * 支持批量操作。每次请求批量实例的上限为100。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ModifyInstancesProject(request *ModifyInstancesProjectRequest) (response *ModifyInstancesProjectResponse, err error) { if request == nil { request = NewModifyInstancesProjectRequest() } response = NewModifyInstancesProjectResponse() err = c.Send(request, response) return } func NewModifyInstancesRenewFlagRequest() (request *ModifyInstancesRenewFlagRequest) { request = &ModifyInstancesRenewFlagRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesRenewFlag") return } func NewModifyInstancesRenewFlagResponse() (response *ModifyInstancesRenewFlagResponse) { response = &ModifyInstancesRenewFlagResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ModifyInstancesRenewFlag) 用于修改包年包月实例续费标识。 // // * 实例被标识为自动续费后,每次在实例到期时,会自动续费一个月。 // * 支持批量操作。每次请求批量实例的上限为100。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ModifyInstancesRenewFlag(request *ModifyInstancesRenewFlagRequest) (response *ModifyInstancesRenewFlagResponse, err error) { if request == nil { request = NewModifyInstancesRenewFlagRequest() } response = NewModifyInstancesRenewFlagResponse() err = c.Send(request, response) return } func NewModifyInstancesVpcAttributeRequest() (request *ModifyInstancesVpcAttributeRequest) { request = &ModifyInstancesVpcAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyInstancesVpcAttribute") return } func NewModifyInstancesVpcAttributeResponse() (response *ModifyInstancesVpcAttributeResponse) { response = &ModifyInstancesVpcAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyInstancesVpcAttribute)用于修改实例vpc属性,如私有网络ip。 // * 此操作默认会关闭实例,完成后再启动。 // * 当指定私有网络ID和子网ID(子网必须在实例所在的可用区)与指定实例所在私有网络不一致时,会将实例迁移至指定的私有网络的子网下。执行此操作前请确保指定的实例上没有绑定[弹性网卡](https://cloud.tencent.com/document/product/576)和[负载均衡](https://cloud.tencent.com/document/product/214)。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ModifyInstancesVpcAttribute(request *ModifyInstancesVpcAttributeRequest) (response *ModifyInstancesVpcAttributeResponse, err error) { if request == nil { request = NewModifyInstancesVpcAttributeRequest() } response = NewModifyInstancesVpcAttributeResponse() err = c.Send(request, response) return } func NewModifyKeyPairAttributeRequest() (request *ModifyKeyPairAttributeRequest) { request = &ModifyKeyPairAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ModifyKeyPairAttribute") return } func NewModifyKeyPairAttributeResponse() (response *ModifyKeyPairAttributeResponse) { response = &ModifyKeyPairAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ModifyKeyPairAttribute) 用于修改密钥对属性。 // // * 修改密钥对ID所指定的密钥对的名称和描述信息。 // * 密钥对名称不能和已经存在的密钥对的名称重复。 // * 密钥对ID是密钥对的唯一标识,不可修改。 func (c *Client) ModifyKeyPairAttribute(request *ModifyKeyPairAttributeRequest) (response *ModifyKeyPairAttributeResponse, err error) { if request == nil { request = NewModifyKeyPairAttributeRequest() } response = NewModifyKeyPairAttributeResponse() err = c.Send(request, response) return } func NewPurchaseReservedInstancesOfferingRequest() (request *PurchaseReservedInstancesOfferingRequest) { request = &PurchaseReservedInstancesOfferingRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "PurchaseReservedInstancesOffering") return } func NewPurchaseReservedInstancesOfferingResponse() (response *PurchaseReservedInstancesOfferingResponse) { response = &PurchaseReservedInstancesOfferingResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(PurchaseReservedInstancesOffering)用于用户购买一个或者多个指定配置的预留实例 func (c *Client) PurchaseReservedInstancesOffering(request *PurchaseReservedInstancesOfferingRequest) (response *PurchaseReservedInstancesOfferingResponse, err error) { if request == nil { request = NewPurchaseReservedInstancesOfferingRequest() } response = NewPurchaseReservedInstancesOfferingResponse() err = c.Send(request, response) return } func NewRebootInstancesRequest() (request *RebootInstancesRequest) { request = &RebootInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "RebootInstances") return } func NewRebootInstancesResponse() (response *RebootInstancesResponse) { response = &RebootInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (RebootInstances) 用于重启实例。 // // * 只有状态为`RUNNING`的实例才可以进行此操作。 // * 接口调用成功时,实例会进入`REBOOTING`状态;重启实例成功时,实例会进入`RUNNING`状态。 // * 支持强制重启。强制重启的效果等同于关闭物理计算机的电源开关再重新启动。强制重启可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常重启时使用。 // * 支持批量操作,每次请求批量实例的上限为100。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) RebootInstances(request *RebootInstancesRequest) (response *RebootInstancesResponse, err error) { if request == nil { request = NewRebootInstancesRequest() } response = NewRebootInstancesResponse() err = c.Send(request, response) return } func NewRenewHostsRequest() (request *RenewHostsRequest) { request = &RenewHostsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "RenewHosts") return } func NewRenewHostsResponse() (response *RenewHostsResponse) { response = &RenewHostsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (RenewHosts) 用于续费包年包月CDH实例。 // // * 只支持操作包年包月实例,否则操作会以特定[错误码](#6.-.E9.94.99.E8.AF.AF.E7.A0.81)返回。 // * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 func (c *Client) RenewHosts(request *RenewHostsRequest) (response *RenewHostsResponse, err error) { if request == nil { request = NewRenewHostsRequest() } response = NewRenewHostsResponse() err = c.Send(request, response) return } func NewRenewInstancesRequest() (request *RenewInstancesRequest) { request = &RenewInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "RenewInstances") return } func NewRenewInstancesResponse() (response *RenewInstancesResponse) { response = &RenewInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (RenewInstances) 用于续费包年包月实例。 // // * 只支持操作包年包月实例。 // * 续费时请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) RenewInstances(request *RenewInstancesRequest) (response *RenewInstancesResponse, err error) { if request == nil { request = NewRenewInstancesRequest() } response = NewRenewInstancesResponse() err = c.Send(request, response) return } func NewResetInstanceRequest() (request *ResetInstanceRequest) { request = &ResetInstanceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ResetInstance") return } func NewResetInstanceResponse() (response *ResetInstanceResponse) { response = &ResetInstanceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ResetInstance) 用于重装指定实例上的操作系统。 // // * 如果指定了`ImageId`参数,则使用指定的镜像重装;否则按照当前实例使用的镜像进行重装。 // * 系统盘将会被格式化,并重置;请确保系统盘中无重要文件。 // * `Linux`和`Windows`系统互相切换时,该实例系统盘`ID`将发生变化,系统盘关联快照将无法回滚、恢复数据。 // * 密码不指定将会通过站内信下发随机密码。 // * 目前只支持[系统盘类型](https://cloud.tencent.com/document/api/213/9452#SystemDisk)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口实现`Linux`和`Windows`操作系统切换。 // * 目前不支持境外地域的实例使用该接口实现`Linux`和`Windows`操作系统切换。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ResetInstance(request *ResetInstanceRequest) (response *ResetInstanceResponse, err error) { if request == nil { request = NewResetInstanceRequest() } response = NewResetInstanceResponse() err = c.Send(request, response) return } func NewResetInstancesInternetMaxBandwidthRequest() (request *ResetInstancesInternetMaxBandwidthRequest) { request = &ResetInstancesInternetMaxBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ResetInstancesInternetMaxBandwidth") return } func NewResetInstancesInternetMaxBandwidthResponse() (response *ResetInstancesInternetMaxBandwidthResponse) { response = &ResetInstancesInternetMaxBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ResetInstancesInternetMaxBandwidth) 用于调整实例公网带宽上限。 // // * 不同机型带宽上限范围不一致,具体限制详见[公网带宽上限](https://cloud.tencent.com/document/product/213/12523)。 // * 对于 `BANDWIDTH_PREPAID` 计费方式的带宽,需要输入参数 `StartTime` 和 `EndTime` ,指定调整后的带宽的生效时间段。在这种场景下目前不支持调小带宽,会涉及扣费,请确保账户余额充足。可通过 [`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253) 接口查询账户余额。 // * 对于 `TRAFFIC_POSTPAID_BY_HOUR` 、 `BANDWIDTH_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽,使用该接口调整带宽上限是实时生效的,可以在带宽允许的范围内调大或者调小带宽,不支持输入参数 `StartTime` 和 `EndTime` 。 // * 接口不支持调整 `BANDWIDTH_POSTPAID_BY_MONTH` 计费方式的带宽。 // * 接口不支持批量调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽。 // * 接口不支持批量调整混合计费方式的带宽。例如不支持同时调整 `TRAFFIC_POSTPAID_BY_HOUR` 和 `BANDWIDTH_PACKAGE` 计费方式的带宽。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ResetInstancesInternetMaxBandwidth(request *ResetInstancesInternetMaxBandwidthRequest) (response *ResetInstancesInternetMaxBandwidthResponse, err error) { if request == nil { request = NewResetInstancesInternetMaxBandwidthRequest() } response = NewResetInstancesInternetMaxBandwidthResponse() err = c.Send(request, response) return } func NewResetInstancesPasswordRequest() (request *ResetInstancesPasswordRequest) { request = &ResetInstancesPasswordRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ResetInstancesPassword") return } func NewResetInstancesPasswordResponse() (response *ResetInstancesPasswordResponse) { response = &ResetInstancesPasswordResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ResetInstancesPassword) 用于将实例操作系统的密码重置为用户指定的密码。 // // *如果是修改系统管理云密码:实例的操作系统不同,管理员帐号也会不一样(`Windows`为`Administrator`,`Ubuntu`为`ubuntu`,其它系统为`root`)。 // * 重置处于运行中状态的实例密码,需要设置关机参数`ForceStop`为`TRUE`。如果没有显式指定强制关机参数,则只有处于关机状态的实例才允许执行重置密码操作。 // * 支持批量操作。将多个实例操作系统的密码重置为相同的密码。每次请求批量实例的上限为100。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ResetInstancesPassword(request *ResetInstancesPasswordRequest) (response *ResetInstancesPasswordResponse, err error) { if request == nil { request = NewResetInstancesPasswordRequest() } response = NewResetInstancesPasswordResponse() err = c.Send(request, response) return } func NewResetInstancesTypeRequest() (request *ResetInstancesTypeRequest) { request = &ResetInstancesTypeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ResetInstancesType") return } func NewResetInstancesTypeResponse() (response *ResetInstancesTypeResponse) { response = &ResetInstancesTypeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ResetInstancesType) 用于调整实例的机型。 // * 目前只支持[系统盘类型](/document/api/213/9452#block_device)是`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`类型的实例使用该接口进行机型调整。 // * 目前不支持[CDH](https://cloud.tencent.com/document/product/416)实例使用该接口调整机型。对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 // * 本接口为异步接口,调整实例配置请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表调整实例配置操作成功。 func (c *Client) ResetInstancesType(request *ResetInstancesTypeRequest) (response *ResetInstancesTypeResponse, err error) { if request == nil { request = NewResetInstancesTypeRequest() } response = NewResetInstancesTypeResponse() err = c.Send(request, response) return } func NewResizeInstanceDisksRequest() (request *ResizeInstanceDisksRequest) { request = &ResizeInstanceDisksRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "ResizeInstanceDisks") return } func NewResizeInstanceDisksResponse() (response *ResizeInstanceDisksResponse) { response = &ResizeInstanceDisksResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ResizeInstanceDisks) 用于扩容实例的数据盘。 // // * 目前只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](https://cloud.tencent.com/document/api/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`和[CDH](https://cloud.tencent.com/document/product/416)实例的`LOCAL_BASIC`、`LOCAL_SSD`类型数据盘。 // * 对于包年包月实例,使用该接口会涉及扣费,请确保账户余额充足。可通过[`DescribeAccountBalance`](https://cloud.tencent.com/document/product/555/20253)接口查询账户余额。 // * 目前只支持扩容一块数据盘。 // * 实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表操作成功。 func (c *Client) ResizeInstanceDisks(request *ResizeInstanceDisksRequest) (response *ResizeInstanceDisksResponse, err error) { if request == nil { request = NewResizeInstanceDisksRequest() } response = NewResizeInstanceDisksResponse() err = c.Send(request, response) return } func NewRunInstancesRequest() (request *RunInstancesRequest) { request = &RunInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "RunInstances") return } func NewRunInstancesResponse() (response *RunInstancesResponse) { response = &RunInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (RunInstances) 用于创建一个或多个指定配置的实例。 // // * 实例创建成功后将自动开机启动,[实例状态](https://cloud.tencent.com/document/product/213/15753#InstanceStatus)变为“运行中”。 // * 预付费实例的购买会预先扣除本次实例购买所需金额,按小时后付费实例购买会预先冻结本次实例购买一小时内所需金额,在调用本接口前请确保账户余额充足。 // * 本接口允许购买的实例数量遵循[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664),所创建的实例和官网入口创建的实例共用配额。 // * 本接口为异步接口,当创建实例请求下发成功后会返回一个实例`ID`列表和一个`RequestId`,此时创建实例操作并未立即完成。在此期间实例的状态将会处于“PENDING”,实例创建结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) 接口查询,如果实例状态(InstanceState)由“PENDING”变为“RUNNING”,则代表实例创建成功,“LAUNCH_FAILED”代表实例创建失败。 func (c *Client) RunInstances(request *RunInstancesRequest) (response *RunInstancesResponse, err error) { if request == nil { request = NewRunInstancesRequest() } response = NewRunInstancesResponse() err = c.Send(request, response) return } func NewStartInstancesRequest() (request *StartInstancesRequest) { request = &StartInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "StartInstances") return } func NewStartInstancesResponse() (response *StartInstancesResponse) { response = &StartInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (StartInstances) 用于启动一个或多个实例。 // // * 只有状态为`STOPPED`的实例才可以进行此操作。 // * 接口调用成功时,实例会进入`STARTING`状态;启动实例成功时,实例会进入`RUNNING`状态。 // * 支持批量操作。每次请求批量实例的上限为100。 // * 本接口为异步接口,启动实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表启动实例操作成功。 func (c *Client) StartInstances(request *StartInstancesRequest) (response *StartInstancesResponse, err error) { if request == nil { request = NewStartInstancesRequest() } response = NewStartInstancesResponse() err = c.Send(request, response) return } func NewStopInstancesRequest() (request *StopInstancesRequest) { request = &StopInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "StopInstances") return } func NewStopInstancesResponse() (response *StopInstancesResponse) { response = &StopInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (StopInstances) 用于关闭一个或多个实例。 // // * 只有状态为`RUNNING`的实例才可以进行此操作。 // * 接口调用成功时,实例会进入`STOPPING`状态;关闭实例成功时,实例会进入`STOPPED`状态。 // * 支持强制关闭。强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 // * 支持批量操作。每次请求批量实例的上限为100。 // * 本接口为异步接口,关闭实例请求发送成功后会返回一个RequestId,此时操作并未立即完成。实例操作结果可以通过调用 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728#.E7.A4.BA.E4.BE.8B3-.E6.9F.A5.E8.AF.A2.E5.AE.9E.E4.BE.8B.E7.9A.84.E6.9C.80.E6.96.B0.E6.93.8D.E4.BD.9C.E6.83.85.E5.86.B5) 接口查询,如果实例的最新操作状态(LatestOperationState)为“SUCCESS”,则代表关闭实例操作成功。 func (c *Client) StopInstances(request *StopInstancesRequest) (response *StopInstancesResponse, err error) { if request == nil { request = NewStopInstancesRequest() } response = NewStopInstancesResponse() err = c.Send(request, response) return } func NewSyncImagesRequest() (request *SyncImagesRequest) { request = &SyncImagesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "SyncImages") return } func NewSyncImagesResponse() (response *SyncImagesResponse) { response = &SyncImagesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(SyncImages)用于将自定义镜像同步到其它地区。 // // * 该接口每次调用只支持同步一个镜像。 // * 该接口支持多个同步地域。 // * 单个帐号在每个地域最多支持存在10个自定义镜像。 func (c *Client) SyncImages(request *SyncImagesRequest) (response *SyncImagesResponse, err error) { if request == nil { request = NewSyncImagesRequest() } response = NewSyncImagesResponse() err = c.Send(request, response) return } func NewTerminateInstancesRequest() (request *TerminateInstancesRequest) { request = &TerminateInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("cvm", APIVersion, "TerminateInstances") return } func NewTerminateInstancesResponse() (response *TerminateInstancesResponse) { response = &TerminateInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (TerminateInstances) 用于主动退还实例。 // // * 不再使用的实例,可通过本接口主动退还。 // * 按量计费的实例通过本接口可直接退还;包年包月实例如符合[退还规则](https://cloud.tencent.com/document/product/213/9711),也可通过本接口主动退还。 // * 包年包月实例首次调用本接口,实例将被移至回收站,再次调用本接口,实例将被销毁,且不可恢复。按量计费实例调用本接口将被直接销毁 // * 支持批量操作,每次请求批量实例的上限为100。 func (c *Client) TerminateInstances(request *TerminateInstancesRequest) (response *TerminateInstancesResponse, err error) { if request == nil { request = NewTerminateInstancesRequest() } response = NewTerminateInstancesResponse() err = c.Send(request, response) return } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������models.go�������������������������������������������������������������������������������������������0000664�0000000�0000000�00000543734�13771713062�0033473�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312�������������������������������������������������������������������������// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package v20170312 import ( "encoding/json" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" ) type ActionTimer struct { // 扩展数据 Externals *Externals `json:"Externals,omitempty" name:"Externals"` // 定时器名称,目前仅支持销毁一个值:TerminateInstances。 TimerAction *string `json:"TimerAction,omitempty" name:"TimerAction"` // 执行时间,格式形如:2018-5-29 11:26:40,执行时间必须大于当前时间5分钟。 ActionTime *string `json:"ActionTime,omitempty" name:"ActionTime"` } type AllocateHostsRequest struct { *tchttp.BaseRequest // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 Placement *Placement `json:"Placement,omitempty" name:"Placement"` // 用于保证请求幂等性的字符串。 ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` // 实例计费类型。目前仅支持:PREPAID(预付费,即包年包月模式),默认为:'PREPAID'。 HostChargeType *string `json:"HostChargeType,omitempty" name:"HostChargeType"` // CDH实例机型,默认为:'HS1'。 HostType *string `json:"HostType,omitempty" name:"HostType"` // 购买CDH实例数量,默认为:1。 HostCount *uint64 `json:"HostCount,omitempty" name:"HostCount"` // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例。 TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification" list` } func (r *AllocateHostsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AllocateHostsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AllocateHostsResponse struct { *tchttp.BaseResponse Response *struct { // 新创建云子机的实例id列表。 HostIdSet []*string `json:"HostIdSet,omitempty" name:"HostIdSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AllocateHostsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AllocateHostsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateInstancesKeyPairsRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID,每次请求批量实例的上限为100。<br>可以通过以下方式获取可用的实例ID:<br><li>通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询实例ID。<br><li>通过调用接口 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) ,取返回信息中的`InstanceId`获取实例ID。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 一个或多个待操作的密钥对ID,每次请求批量密钥对的上限为100。密钥对ID形如:`skey-3glfot13`。<br>可以通过以下方式获取可用的密钥ID:<br><li>通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。<br><li>通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的`KeyId`获取密钥对ID。 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds" list` // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再绑定密钥。取值范围:<br><li>TRUE:表示在正常关机失败后进行强制关机。<br><li>FALSE:表示在正常关机失败后不进行强制关机。<br>默认取值:FALSE。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` } func (r *AssociateInstancesKeyPairsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateInstancesKeyPairsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateInstancesKeyPairsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssociateInstancesKeyPairsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateInstancesKeyPairsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateSecurityGroupsRequest struct { *tchttp.BaseRequest // 要绑定的`安全组ID`,类似sg-efil73jd,只支持绑定单个安全组。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 被绑定的`实例ID`,类似ins-lesecurk,支持指定多个实例,每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` } func (r *AssociateSecurityGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateSecurityGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateSecurityGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssociateSecurityGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateSecurityGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ChargePrepaid struct { // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36。 Period *uint64 `json:"Period,omitempty" name:"Period"` // 自动续费标识。取值范围:<br><li>NOTIFY_AND_AUTO_RENEW:通知过期且自动续费<br><li>NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费<br><li>DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费<br><br>默认取值:NOTIFY_AND_AUTO_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` } type CreateDisasterRecoverGroupRequest struct { *tchttp.BaseRequest // 分散置放群组名称,长度1-60个字符,支持中、英文。 Name *string `json:"Name,omitempty" name:"Name"` // 分散置放群组类型,取值范围:<br><li>HOST:物理机<br><li>SW:交换机<br><li>RACK:机架 Type *string `json:"Type,omitempty" name:"Type"` // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。<br>更多详细信息请参阅:如何保证幂等性。 ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` } func (r *CreateDisasterRecoverGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDisasterRecoverGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDisasterRecoverGroupResponse struct { *tchttp.BaseResponse Response *struct { // 分散置放群组ID列表。 DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` // 分散置放群组类型,取值范围:<br><li>HOST:物理机<br><li>SW:交换机<br><li>RACK:机架 Type *string `json:"Type,omitempty" name:"Type"` // 分散置放群组名称,长度1-60个字符,支持中、英文。 Name *string `json:"Name,omitempty" name:"Name"` // 置放群组内可容纳的云服务器数量。 CvmQuotaTotal *int64 `json:"CvmQuotaTotal,omitempty" name:"CvmQuotaTotal"` // 置放群组内已有的云服务器数量。 CurrentNum *int64 `json:"CurrentNum,omitempty" name:"CurrentNum"` // 置放群组创建时间。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateDisasterRecoverGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDisasterRecoverGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateImageRequest struct { *tchttp.BaseRequest // 镜像名称 ImageName *string `json:"ImageName,omitempty" name:"ImageName"` // 需要制作镜像的实例ID。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 镜像描述 ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` // 是否执行强制关机以制作镜像。 // 取值范围:<br><li>TRUE:表示关机之后制作镜像<br><li>FALSE:表示开机状态制作镜像<br><br>默认取值:FALSE。<br><br>开机状态制作镜像,可能导致部分数据未备份,影响数据安全。 ForcePoweroff *string `json:"ForcePoweroff,omitempty" name:"ForcePoweroff"` // 创建Windows镜像时是否启用Sysprep Sysprep *string `json:"Sysprep,omitempty" name:"Sysprep"` // 基于实例创建整机镜像时,指定包含在镜像里的数据盘Id DataDiskIds []*string `json:"DataDiskIds,omitempty" name:"DataDiskIds" list` // 基于快照创建镜像,指定快照ID,必须包含一个系统盘快照。不可与InstanceId同时传入。 SnapshotIds []*string `json:"SnapshotIds,omitempty" name:"SnapshotIds" list` // 检测本次请求的是否成功,但不会对操作的资源产生任何影响 DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` } func (r *CreateImageRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateImageRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateImageResponse struct { *tchttp.BaseResponse Response *struct { // 镜像ID // 注意:此字段可能返回 null,表示取不到有效值。 ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateImageResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateImageResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateKeyPairRequest struct { *tchttp.BaseRequest // 密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 KeyName *string `json:"KeyName,omitempty" name:"KeyName"` // 密钥对创建后所属的项目ID。 // 可以通过以下方式获取项目ID: // <li>通过项目列表查询项目ID。 // <li>通过调用接口DescribeProject,取返回信息中的`projectId `获取项目ID。 ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` } func (r *CreateKeyPairRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateKeyPairRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateKeyPairResponse struct { *tchttp.BaseResponse Response *struct { // 密钥对信息。 KeyPair *KeyPair `json:"KeyPair,omitempty" name:"KeyPair"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateKeyPairResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateKeyPairResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DataDisk struct { // 数据盘大小,单位:GB。最小调整步长为10G,不同数据盘类型取值范围不同,具体限制详见:[存储概述](https://cloud.tencent.com/document/product/213/4952)。默认值为0,表示不购买数据盘。更多限制详见产品文档。 DiskSize *int64 `json:"DiskSize,omitempty" name:"DiskSize"` // 数据盘类型。数据盘类型限制详见[存储概述](https://cloud.tencent.com/document/product/213/4952)。取值范围:<br><li>LOCAL_BASIC:本地硬盘<br><li>LOCAL_SSD:本地SSD硬盘<br><li>CLOUD_BASIC:普通云硬盘<br><li>CLOUD_PREMIUM:高性能云硬盘<br><li>CLOUD_SSD:SSD云硬盘<br><br>默认取值:LOCAL_BASIC。<br><br>该参数对`ResizeInstanceDisk`接口无效。 DiskType *string `json:"DiskType,omitempty" name:"DiskType"` // 数据盘ID。LOCAL_BASIC 和 LOCAL_SSD 类型没有ID,暂时不支持该参数。 DiskId *string `json:"DiskId,omitempty" name:"DiskId"` // 数据盘是否随子机销毁。取值范围: // <li>TRUE:子机销毁时,销毁数据盘,只支持按小时后付费云盘 // <li>FALSE:子机销毁时,保留数据盘<br> // 默认取值:TRUE<br> // 该参数目前仅用于 `RunInstances` 接口。 // 注意:此字段可能返回 null,表示取不到有效值。 DeleteWithInstance *bool `json:"DeleteWithInstance,omitempty" name:"DeleteWithInstance"` // 数据盘快照ID。选择的数据盘快照大小需小于数据盘大小。 // 注意:此字段可能返回 null,表示取不到有效值。 SnapshotId *string `json:"SnapshotId,omitempty" name:"SnapshotId"` // 数据盘是加密。取值范围: // <li>TRUE:加密 // <li>FALSE:不加密<br> // 默认取值:FALSE<br> // 该参数目前仅用于 `RunInstances` 接口。 // 注意:此字段可能返回 null,表示取不到有效值。 Encrypt *bool `json:"Encrypt,omitempty" name:"Encrypt"` // 自定义CMK对应的ID,取值为UUID或者类似kms-abcd1234。用于加密云盘。 // // 该参数目前仅用于 `RunInstances` 接口。 // 注意:此字段可能返回 null,表示取不到有效值。 KmsKeyId *string `json:"KmsKeyId,omitempty" name:"KmsKeyId"` } type DeleteDisasterRecoverGroupsRequest struct { *tchttp.BaseRequest // 分散置放群组ID列表,可通过[DescribeDisasterRecoverGroups](https://cloud.tencent.com/document/api/213/17810)接口获取。每次请求允许操作的分散置放群组数量上限是100。 DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds" list` } func (r *DeleteDisasterRecoverGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDisasterRecoverGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteDisasterRecoverGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteDisasterRecoverGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDisasterRecoverGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteImagesRequest struct { *tchttp.BaseRequest // 准备删除的镜像Id列表 ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds" list` } func (r *DeleteImagesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteImagesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteImagesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteImagesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteImagesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteKeyPairsRequest struct { *tchttp.BaseRequest // 一个或多个待操作的密钥对ID。每次请求批量密钥对的上限为100。<br>可以通过以下方式获取可用的密钥ID:<br><li>通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。<br><li>通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的 `KeyId` 获取密钥对ID。 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds" list` } func (r *DeleteKeyPairsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteKeyPairsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteKeyPairsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteKeyPairsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteKeyPairsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDisasterRecoverGroupQuotaRequest struct { *tchttp.BaseRequest } func (r *DescribeDisasterRecoverGroupQuotaRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDisasterRecoverGroupQuotaRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDisasterRecoverGroupQuotaResponse struct { *tchttp.BaseResponse Response *struct { // 可创建置放群组数量的上限。 GroupQuota *int64 `json:"GroupQuota,omitempty" name:"GroupQuota"` // 当前用户已经创建的置放群组数量。 CurrentNum *int64 `json:"CurrentNum,omitempty" name:"CurrentNum"` // 物理机类型容灾组内实例的配额数。 CvmInHostGroupQuota *int64 `json:"CvmInHostGroupQuota,omitempty" name:"CvmInHostGroupQuota"` // 交换机类型容灾组内实例的配额数。 CvmInSwGroupQuota *int64 `json:"CvmInSwGroupQuota,omitempty" name:"CvmInSwGroupQuota"` // 机架类型容灾组内实例的配额数。 CvmInRackGroupQuota *int64 `json:"CvmInRackGroupQuota,omitempty" name:"CvmInRackGroupQuota"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeDisasterRecoverGroupQuotaResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDisasterRecoverGroupQuotaResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDisasterRecoverGroupsRequest struct { *tchttp.BaseRequest // 分散置放群组ID列表。每次请求允许操作的分散置放群组数量上限是100。 DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds" list` // 分散置放群组名称,支持模糊匹配。 Name *string `json:"Name,omitempty" name:"Name"` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeDisasterRecoverGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDisasterRecoverGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDisasterRecoverGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 分散置放群组信息列表。 DisasterRecoverGroupSet []*DisasterRecoverGroup `json:"DisasterRecoverGroupSet,omitempty" name:"DisasterRecoverGroupSet" list` // 用户置放群组总量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeDisasterRecoverGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDisasterRecoverGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeHostsRequest struct { *tchttp.BaseRequest // <li><strong>zone</strong></li> // <p style="padding-left: 30px;">按照【<strong>可用区</strong>】进行过滤。可用区形如:ap-guangzhou-1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a></p> // <li><strong>project-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>项目ID</strong>】进行过滤,可通过调用[DescribeProject](https://cloud.tencent.com/document/api/378/4400)查询已创建的项目列表或登录[控制台](https://console.cloud.tencent.com/cvm/index)进行查看;也可以调用[AddProject](https://cloud.tencent.com/document/api/378/4398)创建新的项目。项目ID形如:1002189。</p><p style="padding-left: 30px;">类型:Integer</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>host-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>[CDH](https://cloud.tencent.com/document/product/416) ID</strong>】进行过滤。[CDH](https://cloud.tencent.com/document/product/416) ID形如:host-xxxxxxxx。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>host-name</strong></li> // <p style="padding-left: 30px;">按照【<strong>CDH实例名称</strong>】进行过滤。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>host-state</strong></li> // <p style="padding-left: 30px;">按照【<strong>CDH实例状态</strong>】进行过滤。(PENDING:创建中 | LAUNCH_FAILURE:创建失败 | RUNNING:运行中 | EXPIRED:已过期)</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeHostsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeHostsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeHostsResponse struct { *tchttp.BaseResponse Response *struct { // 符合查询条件的cdh实例总数 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // cdh实例详细信息列表 HostSet []*HostItem `json:"HostSet,omitempty" name:"HostSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeHostsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeHostsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImageQuotaRequest struct { *tchttp.BaseRequest } func (r *DescribeImageQuotaRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImageQuotaRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImageQuotaResponse struct { *tchttp.BaseResponse Response *struct { // 账户的镜像配额 ImageNumQuota *int64 `json:"ImageNumQuota,omitempty" name:"ImageNumQuota"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeImageQuotaResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImageQuotaResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImageSharePermissionRequest struct { *tchttp.BaseRequest // 需要共享的镜像Id ImageId *string `json:"ImageId,omitempty" name:"ImageId"` } func (r *DescribeImageSharePermissionRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImageSharePermissionRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImageSharePermissionResponse struct { *tchttp.BaseResponse Response *struct { // 镜像共享信息 SharePermissionSet []*SharePermission `json:"SharePermissionSet,omitempty" name:"SharePermissionSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeImageSharePermissionResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImageSharePermissionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImagesRequest struct { *tchttp.BaseRequest // 镜像ID列表 。镜像ID如:`img-gvbnzy6f`。array型参数的格式可以参考[API简介](https://cloud.tencent.com/document/api/213/15688)。镜像ID可以通过如下方式获取:<br><li>通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。<br><li>通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。 ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds" list` // 过滤条件,每次请求的`Filters`的上限为0,`Filters.Values`的上限为5。参数不可以同时指定`ImageIds`和`Filters`。详细的过滤条件如下: // <li> image-id - String - 是否必填: 否 - (过滤条件)按照镜像ID进行过滤</li> // <li> image-type - String - 是否必填: 否 - (过滤条件)按照镜像类型进行过滤。取值范围: // PRIVATE_IMAGE: 私有镜像 (本账户创建的镜像) // PUBLIC_IMAGE: 公共镜像 (腾讯云官方镜像) // SHARED_IMAGE: 共享镜像(其他账户共享给本账户的镜像) 。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于Offset详见[API简介](/document/api/213/568#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 数量限制,默认为20,最大值为100。关于Limit详见[API简介](/document/api/213/568#.E8.BE.93.E5.85.A5.E5.8F.82.E6.95.B0.E4.B8.8E.E8.BF.94.E5.9B.9E.E5.8F.82.E6.95.B0.E9.87.8A.E4.B9.89)。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` // 实例类型,如 `S1.SMALL1` InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` } func (r *DescribeImagesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImagesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImagesResponse struct { *tchttp.BaseResponse Response *struct { // 一个关于镜像详细信息的结构体,主要包括镜像的主要状态与属性。 ImageSet []*Image `json:"ImageSet,omitempty" name:"ImageSet" list` // 符合要求的镜像数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeImagesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImagesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImportImageOsRequest struct { *tchttp.BaseRequest } func (r *DescribeImportImageOsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImportImageOsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeImportImageOsResponse struct { *tchttp.BaseResponse Response *struct { // 支持的导入镜像的操作系统类型。 ImportImageOsListSupported *ImageOsList `json:"ImportImageOsListSupported,omitempty" name:"ImportImageOsListSupported"` // 支持的导入镜像的操作系统版本。 ImportImageOsVersionSet []*OsVersion `json:"ImportImageOsVersionSet,omitempty" name:"ImportImageOsVersionSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeImportImageOsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeImportImageOsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceFamilyConfigsRequest struct { *tchttp.BaseRequest } func (r *DescribeInstanceFamilyConfigsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceFamilyConfigsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceFamilyConfigsResponse struct { *tchttp.BaseResponse Response *struct { // 实例机型组配置的列表信息 InstanceFamilyConfigSet []*InstanceFamilyConfig `json:"InstanceFamilyConfigSet,omitempty" name:"InstanceFamilyConfigSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInstanceFamilyConfigsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceFamilyConfigsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceInternetBandwidthConfigsRequest struct { *tchttp.BaseRequest // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` } func (r *DescribeInstanceInternetBandwidthConfigsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceInternetBandwidthConfigsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceInternetBandwidthConfigsResponse struct { *tchttp.BaseResponse Response *struct { // 带宽配置信息列表。 InternetBandwidthConfigSet []*InternetBandwidthConfig `json:"InternetBandwidthConfigSet,omitempty" name:"InternetBandwidthConfigSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInstanceInternetBandwidthConfigsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceInternetBandwidthConfigsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceTypeConfigsRequest struct { *tchttp.BaseRequest // <li><strong>zone</strong></li> // <p style="padding-left: 30px;">按照【<strong>可用区</strong>】进行过滤。可用区形如:ap-guangzhou-1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a></p> // <li><strong>instance-family</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例机型系列</strong>】进行过滤。实例机型系列形如:S1、I1、M1等。</p><p style="padding-left: 30px;">类型:Integer</p><p style="padding-left: 30px;">必选:否</p> // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为1。 Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` } func (r *DescribeInstanceTypeConfigsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceTypeConfigsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceTypeConfigsResponse struct { *tchttp.BaseResponse Response *struct { // 实例机型配置列表。 InstanceTypeConfigSet []*InstanceTypeConfig `json:"InstanceTypeConfigSet,omitempty" name:"InstanceTypeConfigSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInstanceTypeConfigsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceTypeConfigsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceVncUrlRequest struct { *tchttp.BaseRequest // 一个操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` } func (r *DescribeInstanceVncUrlRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceVncUrlRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstanceVncUrlResponse struct { *tchttp.BaseResponse Response *struct { // 实例的管理终端地址。 InstanceVncUrl *string `json:"InstanceVncUrl,omitempty" name:"InstanceVncUrl"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInstanceVncUrlResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstanceVncUrlResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstancesOperationLimitRequest struct { *tchttp.BaseRequest // 按照一个或者多个实例ID查询,可通过[DescribeInstances](https://cloud.tencent.com/document/api/213/15728)API返回值中的InstanceId获取。实例ID形如:ins-xxxxxxxx。(此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的ids.N一节)。每次请求的实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 实例操作。 // <li> INSTANCE_DEGRADE:实例降配操作</li> Operation *string `json:"Operation,omitempty" name:"Operation"` } func (r *DescribeInstancesOperationLimitRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstancesOperationLimitRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstancesOperationLimitResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示调整配置操作(降配)限制次数查询。 InstanceOperationLimitSet []*OperationCountLimit `json:"InstanceOperationLimitSet,omitempty" name:"InstanceOperationLimitSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInstancesOperationLimitResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstancesOperationLimitResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstancesRequest struct { *tchttp.BaseRequest // 按照一个或者多个实例ID查询。实例ID形如:`ins-xxxxxxxx`。(此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的`ids.N`一节)。每次请求的实例的上限为100。参数不支持同时指定`InstanceIds`和`Filters`。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // <li><strong>zone</strong></li> // <p style="padding-left: 30px;">按照【<strong>可用区</strong>】进行过滤。可用区形如:ap-guangzhou-1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a></p> // <li><strong>project-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>项目ID</strong>】进行过滤,可通过调用[DescribeProject](https://cloud.tencent.com/document/api/378/4400)查询已创建的项目列表或登录[控制台](https://console.cloud.tencent.com/cvm/index)进行查看;也可以调用[AddProject](https://cloud.tencent.com/document/api/378/4398)创建新的项目。项目ID形如:1002189。</p><p style="padding-left: 30px;">类型:Integer</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>host-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>[CDH](https://cloud.tencent.com/document/product/416) ID</strong>】进行过滤。[CDH](https://cloud.tencent.com/document/product/416) ID形如:host-xxxxxxxx。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>vpc-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>VPC ID</strong>】进行过滤。VPC ID形如:vpc-xxxxxxxx。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>subnet-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>子网ID</strong>】进行过滤。子网ID形如:subnet-xxxxxxxx。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>instance-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例ID</strong>】进行过滤。实例ID形如:ins-xxxxxxxx。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>security-group-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>安全组ID</strong>】进行过滤。安全组ID形如: sg-8jlk3f3r。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>instance-name</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例名称</strong>】进行过滤。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>instance-charge-type</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例计费模式</strong>】进行过滤。(PREPAID:表示预付费,即包年包月 | POSTPAID_BY_HOUR:表示后付费,即按量计费 | CDHPAID:表示[CDH](https://cloud.tencent.com/document/product/416)付费,即只对[CDH](https://cloud.tencent.com/document/product/416)计费,不对[CDH](https://cloud.tencent.com/document/product/416)上的实例计费。)</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>private-ip-address</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例主网卡的内网IP</strong>】进行过滤。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>public-ip-address</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例主网卡的公网IP</strong>】进行过滤,包含实例创建时自动分配的IP和实例创建后手动绑定的弹性IP。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>tag-key</strong></li> // <p style="padding-left: 30px;">按照【<strong>标签键</strong>】进行过滤。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>tag-value</strong></li> // <p style="padding-left: 30px;">按照【<strong>标签值</strong>】进行过滤。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>tag:tag-key</strong></li> // <p style="padding-left: 30px;">按照【<strong>标签键值对</strong>】进行过滤。tag-key使用具体的标签键进行替换。使用请参考示例2。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`InstanceIds`和`Filters`。 Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // 实例详细信息列表。 InstanceSet []*Instance `json:"InstanceSet,omitempty" name:"InstanceSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstancesStatusRequest struct { *tchttp.BaseRequest // 按照一个或者多个实例ID查询。实例ID形如:`ins-11112222`。此参数的具体格式可参考API[简介](https://cloud.tencent.com/document/api/213/15688)的`ids.N`一节)。每次请求的实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeInstancesStatusRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstancesStatusRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInstancesStatusResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例状态数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // [实例状态](https://cloud.tencent.com/document/api/213/15753#InstanceStatus) 列表。 InstanceStatusSet []*InstanceStatus `json:"InstanceStatusSet,omitempty" name:"InstanceStatusSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInstancesStatusResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInstancesStatusResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInternetChargeTypeConfigsRequest struct { *tchttp.BaseRequest } func (r *DescribeInternetChargeTypeConfigsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInternetChargeTypeConfigsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeInternetChargeTypeConfigsResponse struct { *tchttp.BaseResponse Response *struct { // 网络计费类型配置。 InternetChargeTypeConfigSet []*InternetChargeTypeConfig `json:"InternetChargeTypeConfigSet,omitempty" name:"InternetChargeTypeConfigSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeInternetChargeTypeConfigsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeInternetChargeTypeConfigsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeKeyPairsRequest struct { *tchttp.BaseRequest // 密钥对ID,密钥对ID形如:`skey-11112222`(此接口支持同时传入多个ID进行过滤。此参数的具体格式可参考 API [简介](https://cloud.tencent.com/document/api/213/15688)的 `id.N` 一节)。参数不支持同时指定 `KeyIds` 和 `Filters`。密钥对ID可以通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询。 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds" list` // 过滤条件。 // <li> project-id - Integer - 是否必填:否 -(过滤条件)按照项目ID过滤。可以通过[项目列表](https://console.cloud.tencent.com/project)查询项目ID,或者调用接口 [DescribeProject](https://cloud.tencent.com/document/api/378/4400),取返回信息中的projectId获取项目ID。</li> // <li> key-name - String - 是否必填:否 -(过滤条件)按照密钥对名称过滤。</li>参数不支持同时指定 `KeyIds` 和 `Filters`。 Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于 `Offset` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。返回数量,默认为20,最大值为100。关于 `Limit` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于 `Limit` 的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeKeyPairsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeKeyPairsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeKeyPairsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的密钥对数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // 密钥对详细信息列表。 KeyPairSet []*KeyPair `json:"KeyPairSet,omitempty" name:"KeyPairSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeKeyPairsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeKeyPairsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeRegionsRequest struct { *tchttp.BaseRequest } func (r *DescribeRegionsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeRegionsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeRegionsResponse struct { *tchttp.BaseResponse Response *struct { // 地域数量 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 地域列表信息 RegionSet []*RegionInfo `json:"RegionSet,omitempty" name:"RegionSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeRegionsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeRegionsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeReservedInstancesOfferingsRequest struct { *tchttp.BaseRequest // 试运行, 默认为 false。 DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` // 以最大有效期作为过滤参数。 // 计量单位: 秒 // 默认为 94608000。 MaxDuration *int64 `json:"MaxDuration,omitempty" name:"MaxDuration"` // 以最小有效期作为过滤参数。 // 计量单位: 秒 // 默认为 2592000。 MinDuration *int64 `json:"MinDuration,omitempty" name:"MinDuration"` // <li><strong>zone</strong></li> // <p style="padding-left: 30px;">按照预留实例计费可购买的【<strong>可用区</strong>】进行过滤。形如:ap-guangzhou-1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a></p> // <li><strong>duration</strong></li> // <p style="padding-left: 30px;">按照预留实例计费【<strong>有效期</strong>】即预留实例计费购买时长进行过滤。形如:31536000。</p><p style="padding-left: 30px;">类型:Integer</p><p style="padding-left: 30px;">计量单位:秒</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:31536000 (1年) | 94608000(3年)</p> // <li><strong>instance-type</strong></li> // <p style="padding-left: 30px;">按照【<strong>预留实例计费类型</strong>】进行过滤。形如:S3.MEDIUM4。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/11518">预留实例计费类型列表</a></p> // <li><strong>offering-type</strong></li> // <p style="padding-left: 30px;">按照【<strong>付款类型</strong>】进行过滤。形如:All Upfront (预付全部费用)。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:All Upfront (预付全部费用)</p> // <li><strong>product-description</strong></li> // <p style="padding-left: 30px;">按照预留实例计费的【<strong>平台描述</strong>】(即操作系统)进行过滤。形如:linux。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:linux</p> // <li><strong>reserved-instances-offering-id</strong></li> // <p style="padding-left: 30px;">按照【<strong>预留实例计费配置ID</strong>】进行过滤。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` } func (r *DescribeReservedInstancesOfferingsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeReservedInstancesOfferingsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeReservedInstancesOfferingsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的预留实例计费数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // 符合条件的预留实例计费列表。 ReservedInstancesOfferingsSet []*ReservedInstancesOffering `json:"ReservedInstancesOfferingsSet,omitempty" name:"ReservedInstancesOfferingsSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeReservedInstancesOfferingsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeReservedInstancesOfferingsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeReservedInstancesRequest struct { *tchttp.BaseRequest // 试运行。默认为 false。 DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/15688)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` // <li><strong>zone</strong></li> // <p style="padding-left: 30px;">按照预留实例计费可购买的【<strong>可用区</strong>】进行过滤。形如:ap-guangzhou-1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a></p> // <li><strong>duration</strong></li> // <p style="padding-left: 30px;">按照预留实例计费【<strong>有效期</strong>】即预留实例计费购买时长进行过滤。形如:31536000。</p><p style="padding-left: 30px;">类型:Integer</p><p style="padding-left: 30px;">计量单位:秒</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:31536000 (1年) | 94608000(3年)</p> // <li><strong>instance-type</strong></li> // <p style="padding-left: 30px;">按照【<strong>预留实例计费类型</strong>】进行过滤。形如:S3.MEDIUM4。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/11518">预留实例计费类型列表</a></p> // <li><strong>offering-type</strong></li> // <p style="padding-left: 30px;">按照【<strong>付款类型</strong>】进行过滤。形如:All Upfront (预付全部费用)。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:All Upfront (预付全部费用)</p> // <li><strong>product-description</strong></li> // <p style="padding-left: 30px;">按照预留实例计费的【<strong>平台描述</strong>】(即操作系统)进行过滤。形如:linux。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:linux</p> // <li><strong>reserved-instances-id</strong></li> // <p style="padding-left: 30px;">按照已购买【<strong>预留实例计费ID</strong>】进行过滤。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>state</strong></li> // <p style="padding-left: 30px;">按照已购买【<strong>预留实例计费状态</strong>】进行过滤。形如:active。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:active (以创建) | pending (等待被创建) | retired (过期)</p> // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` } func (r *DescribeReservedInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeReservedInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeReservedInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的预留实例计费数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // 符合条件的预留实例计费列表。 ReservedInstancesSet []*ReservedInstances `json:"ReservedInstancesSet,omitempty" name:"ReservedInstancesSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeReservedInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeReservedInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeZoneInstanceConfigInfosRequest struct { *tchttp.BaseRequest // <li><strong>zone</strong></li> // <p style="padding-left: 30px;">按照【<strong>可用区</strong>】进行过滤。可用区形如:ap-guangzhou-1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p><p style="padding-left: 30px;">可选项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a></p> // <li><strong>instance-family</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例机型系列</strong>】进行过滤。实例机型系列形如:S1、I1、M1等。</p><p style="padding-left: 30px;">类型:Integer</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>instance-type</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例机型</strong>】进行过滤。不同实例机型指定了不同的资源规格,具体取值可通过调用接口 [DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/product/213/15749) 来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则默认机型为S1.SMALL1。</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // <li><strong>instance-charge-type</strong></li> // <p style="padding-left: 30px;">按照【<strong>实例计费模式</strong>】进行过滤。(PREPAID:表示预付费,即包年包月 | POSTPAID_BY_HOUR:表示后付费,即按量计费 | CDHPAID:表示[CDH](https://cloud.tencent.com/document/product/416)付费,即只对[CDH](https://cloud.tencent.com/document/product/416)计费,不对[CDH](https://cloud.tencent.com/document/product/416)上的实例计费。)</p><p style="padding-left: 30px;">类型:String</p><p style="padding-left: 30px;">必选:否</p> // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。 Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` } func (r *DescribeZoneInstanceConfigInfosRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeZoneInstanceConfigInfosRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeZoneInstanceConfigInfosResponse struct { *tchttp.BaseResponse Response *struct { // 可用区机型配置列表。 InstanceTypeQuotaSet []*InstanceTypeQuotaItem `json:"InstanceTypeQuotaSet,omitempty" name:"InstanceTypeQuotaSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeZoneInstanceConfigInfosResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeZoneInstanceConfigInfosResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeZonesRequest struct { *tchttp.BaseRequest } func (r *DescribeZonesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeZonesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeZonesResponse struct { *tchttp.BaseResponse Response *struct { // 可用区数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 可用区列表信息。 ZoneSet []*ZoneInfo `json:"ZoneSet,omitempty" name:"ZoneSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeZonesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeZonesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateInstancesKeyPairsRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID,每次请求批量实例的上限为100。<br><br>可以通过以下方式获取可用的实例ID:<br><li>通过登录[控制台](https://console.cloud.tencent.com/cvm/index)查询实例ID。<br><li>通过调用接口 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) ,取返回信息中的 `InstanceId` 获取实例ID。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 密钥对ID列表,每次请求批量密钥对的上限为100。密钥对ID形如:`skey-11112222`。<br><br>可以通过以下方式获取可用的密钥ID:<br><li>通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥ID。<br><li>通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699) ,取返回信息中的 `KeyId` 获取密钥对ID。 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds" list` // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再解绑密钥。取值范围:<br><li>TRUE:表示在正常关机失败后进行强制关机。<br><li>FALSE:表示在正常关机失败后不进行强制关机。<br><br>默认取值:FALSE。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` } func (r *DisassociateInstancesKeyPairsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateInstancesKeyPairsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateInstancesKeyPairsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisassociateInstancesKeyPairsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateInstancesKeyPairsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateSecurityGroupsRequest struct { *tchttp.BaseRequest // 要解绑的`安全组ID`,类似sg-efil73jd,只支持解绑单个安全组。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 被解绑的`实例ID`,类似ins-lesecurk,支持指定多个实例 。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` } func (r *DisassociateSecurityGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateSecurityGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateSecurityGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisassociateSecurityGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateSecurityGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisasterRecoverGroup struct { // 分散置放群组id。 DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` // 分散置放群组名称,长度1-60个字符。 Name *string `json:"Name,omitempty" name:"Name"` // 分散置放群组类型,取值范围:<br><li>HOST:物理机<br><li>SW:交换机<br><li>RACK:机架 Type *string `json:"Type,omitempty" name:"Type"` // 分散置放群组内最大容纳云服务器数量。 CvmQuotaTotal *int64 `json:"CvmQuotaTotal,omitempty" name:"CvmQuotaTotal"` // 分散置放群组内云服务器当前数量。 CurrentNum *int64 `json:"CurrentNum,omitempty" name:"CurrentNum"` // 分散置放群组内,云服务器id列表。 // 注意:此字段可能返回 null,表示取不到有效值。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 分散置放群组创建时间。 // 注意:此字段可能返回 null,表示取不到有效值。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` } type EnhancedService struct { // 开启云安全服务。若不指定该参数,则默认开启云安全服务。 SecurityService *RunSecurityServiceEnabled `json:"SecurityService,omitempty" name:"SecurityService"` // 开启云监控服务。若不指定该参数,则默认开启云监控服务。 MonitorService *RunMonitorServiceEnabled `json:"MonitorService,omitempty" name:"MonitorService"` } type Externals struct { // 释放地址 // 注意:此字段可能返回 null,表示取不到有效值。 ReleaseAddress *bool `json:"ReleaseAddress,omitempty" name:"ReleaseAddress"` // 不支持的网络类型,取值范围:<br><li>BASIC:基础网络<br><li>VPC1.0:私有网络VPC1.0 // 注意:此字段可能返回 null,表示取不到有效值。 UnsupportNetworks []*string `json:"UnsupportNetworks,omitempty" name:"UnsupportNetworks" list` // HDD本地存储属性 // 注意:此字段可能返回 null,表示取不到有效值。 StorageBlockAttr *StorageBlock `json:"StorageBlockAttr,omitempty" name:"StorageBlockAttr"` } type Filter struct { // 需要过滤的字段。 Name *string `json:"Name,omitempty" name:"Name"` // 字段的过滤值。 Values []*string `json:"Values,omitempty" name:"Values" list` } type HostItem struct { // cdh实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 Placement *Placement `json:"Placement,omitempty" name:"Placement"` // cdh实例id HostId *string `json:"HostId,omitempty" name:"HostId"` // cdh实例类型 HostType *string `json:"HostType,omitempty" name:"HostType"` // cdh实例名称 HostName *string `json:"HostName,omitempty" name:"HostName"` // cdh实例付费模式 HostChargeType *string `json:"HostChargeType,omitempty" name:"HostChargeType"` // cdh实例自动续费标记 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` // cdh实例创建时间 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // cdh实例过期时间 ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` // cdh实例上已创建云子机的实例id列表 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // cdh实例状态 HostState *string `json:"HostState,omitempty" name:"HostState"` // cdh实例ip HostIp *string `json:"HostIp,omitempty" name:"HostIp"` // cdh实例资源信息 HostResource *HostResource `json:"HostResource,omitempty" name:"HostResource"` // 专用宿主机所属的围笼ID。该字段仅对金融专区围笼内的专用宿主机有效。 // 注意:此字段可能返回 null,表示取不到有效值。 CageId *string `json:"CageId,omitempty" name:"CageId"` } type HostResource struct { // cdh实例总cpu核数 CpuTotal *uint64 `json:"CpuTotal,omitempty" name:"CpuTotal"` // cdh实例可用cpu核数 CpuAvailable *uint64 `json:"CpuAvailable,omitempty" name:"CpuAvailable"` // cdh实例总内存大小(单位为:GiB) MemTotal *float64 `json:"MemTotal,omitempty" name:"MemTotal"` // cdh实例可用内存大小(单位为:GiB) MemAvailable *float64 `json:"MemAvailable,omitempty" name:"MemAvailable"` // cdh实例总磁盘大小(单位为:GiB) DiskTotal *uint64 `json:"DiskTotal,omitempty" name:"DiskTotal"` // cdh实例可用磁盘大小(单位为:GiB) DiskAvailable *uint64 `json:"DiskAvailable,omitempty" name:"DiskAvailable"` // cdh实例磁盘类型 DiskType *string `json:"DiskType,omitempty" name:"DiskType"` } type Image struct { // 镜像ID ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 镜像操作系统 OsName *string `json:"OsName,omitempty" name:"OsName"` // 镜像类型 ImageType *string `json:"ImageType,omitempty" name:"ImageType"` // 镜像创建时间 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 镜像名称 ImageName *string `json:"ImageName,omitempty" name:"ImageName"` // 镜像描述 ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` // 镜像大小 ImageSize *int64 `json:"ImageSize,omitempty" name:"ImageSize"` // 镜像架构 Architecture *string `json:"Architecture,omitempty" name:"Architecture"` // 镜像状态: // CREATING-创建中 // NORMAL-正常 // CREATEFAILED-创建失败 // USING-使用中 // SYNCING-同步中 // IMPORTING-导入中 // IMPORTFAILED-导入失败 ImageState *string `json:"ImageState,omitempty" name:"ImageState"` // 镜像来源平台 Platform *string `json:"Platform,omitempty" name:"Platform"` // 镜像创建者 ImageCreator *string `json:"ImageCreator,omitempty" name:"ImageCreator"` // 镜像来源 ImageSource *string `json:"ImageSource,omitempty" name:"ImageSource"` // 同步百分比 // 注意:此字段可能返回 null,表示取不到有效值。 SyncPercent *int64 `json:"SyncPercent,omitempty" name:"SyncPercent"` // 镜像是否支持cloud-init // 注意:此字段可能返回 null,表示取不到有效值。 IsSupportCloudinit *bool `json:"IsSupportCloudinit,omitempty" name:"IsSupportCloudinit"` // 镜像关联的快照信息 // 注意:此字段可能返回 null,表示取不到有效值。 SnapshotSet []*Snapshot `json:"SnapshotSet,omitempty" name:"SnapshotSet" list` } type ImageOsList struct { // 支持的windows操作系统。 // 注意:此字段可能返回 null,表示取不到有效值。 Windows []*string `json:"Windows,omitempty" name:"Windows" list` // 支持的linux操作系统 // 注意:此字段可能返回 null,表示取不到有效值。 Linux []*string `json:"Linux,omitempty" name:"Linux" list` } type ImportImageRequest struct { *tchttp.BaseRequest // 导入镜像的操作系统架构,`x86_64` 或 `i386` Architecture *string `json:"Architecture,omitempty" name:"Architecture"` // 导入镜像的操作系统类型,通过`DescribeImportImageOs`获取 OsType *string `json:"OsType,omitempty" name:"OsType"` // 导入镜像的操作系统版本,通过`DescribeImportImageOs`获取 OsVersion *string `json:"OsVersion,omitempty" name:"OsVersion"` // 导入镜像存放的cos地址 ImageUrl *string `json:"ImageUrl,omitempty" name:"ImageUrl"` // 镜像名称 ImageName *string `json:"ImageName,omitempty" name:"ImageName"` // 镜像描述 ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` // 只检查参数,不执行任务 DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` // 是否强制导入,参考[强制导入镜像](https://cloud.tencent.com/document/product/213/12849) Force *bool `json:"Force,omitempty" name:"Force"` } func (r *ImportImageRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ImportImageRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ImportImageResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ImportImageResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ImportImageResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ImportKeyPairRequest struct { *tchttp.BaseRequest // 密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 KeyName *string `json:"KeyName,omitempty" name:"KeyName"` // 密钥对创建后所属的[项目](https://cloud.tencent.com/document/product/378/10861)ID。<br><br>可以通过以下方式获取项目ID:<br><li>通过[项目列表](https://console.cloud.tencent.com/project)查询项目ID。<br><li>通过调用接口 [DescribeProject](https://cloud.tencent.com/document/api/378/4400),取返回信息中的 `projectId ` 获取项目ID。 // // 如果是默认项目,直接填0就可以。 ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` // 密钥对的公钥内容,`OpenSSH RSA` 格式。 PublicKey *string `json:"PublicKey,omitempty" name:"PublicKey"` } func (r *ImportKeyPairRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ImportKeyPairRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ImportKeyPairResponse struct { *tchttp.BaseResponse Response *struct { // 密钥对ID。 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ImportKeyPairResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ImportKeyPairResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceModifyInstancesChargeTypeRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。<br><li>PREPAID:预付费,即包年包月。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` } func (r *InquiryPriceModifyInstancesChargeTypeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceModifyInstancesChargeTypeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceModifyInstancesChargeTypeResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示对应配置实例转换计费模式的价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceModifyInstancesChargeTypeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceModifyInstancesChargeTypeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceRenewInstancesRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` // 试运行,测试使用,不执行具体逻辑。取值范围:<br><li>TRUE:跳过执行逻辑<br><li>FALSE:执行逻辑<br><br>默认取值:FALSE。 DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` // 是否续费弹性数据盘。取值范围:<br><li>TRUE:表示续费包年包月实例同时续费其挂载的弹性数据盘<br><li>FALSE:表示续费包年包月实例同时不再续费其挂载的弹性数据盘<br><br>默认取值:TRUE。 RenewPortableDataDisk *bool `json:"RenewPortableDataDisk,omitempty" name:"RenewPortableDataDisk"` } func (r *InquiryPriceRenewInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceRenewInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceRenewInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示对应配置实例的价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceRenewInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceRenewInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetInstanceRequest struct { *tchttp.BaseRequest // 实例ID。可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 指定有效的[镜像](/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:<br/><li>公共镜像</li><li>自定义镜像</li><li>共享镜像</li><li>服务市场镜像</li><br/>可通过以下方式获取可用的镜像ID:<br/><li>`公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。</li><li>通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。</li> ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 实例系统盘配置信息。系统盘为云盘的实例可以通过该参数指定重装后的系统盘大小来实现对系统盘的扩容操作,若不指定则默认系统盘大小保持不变。系统盘大小只支持扩容不支持缩容;重装只支持修改系统盘的大小,不能修改系统盘的类型。 SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` } func (r *InquiryPriceResetInstanceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetInstanceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetInstanceResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示重装成对应配置实例的价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceResetInstanceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetInstanceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetInstancesInternetMaxBandwidthRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。当调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽时,只支持一个实例。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 公网出带宽配置。不同机型带宽上限范围不一致,具体限制详见带宽限制对账表。暂时只支持`InternetMaxBandwidthOut`参数。 InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` // 带宽生效的起始时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。起始时间不能早于当前时间。如果起始时间是今天则新设置的带宽立即生效。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 StartTime *string `json:"StartTime,omitempty" name:"StartTime"` // 带宽生效的终止时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。新设置的带宽的有效期包含终止时间此日期。终止时间不能晚于包年包月实例的到期时间。实例的到期时间可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`ExpiredTime`获取。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 EndTime *string `json:"EndTime,omitempty" name:"EndTime"` } func (r *InquiryPriceResetInstancesInternetMaxBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetInstancesInternetMaxBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetInstancesInternetMaxBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示带宽调整为对应大小之后的价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceResetInstancesInternetMaxBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetInstancesInternetMaxBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetInstancesTypeRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。本接口每次请求批量实例的上限为1。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 实例机型。不同实例机型指定了不同的资源规格,具体取值可参见附表[实例资源规格](https://cloud.tencent.com/document/product/213/11518)对照表,也可以调用查询[实例资源规格列表](https://cloud.tencent.com/document/product/213/15749)接口获得最新的规格表。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` } func (r *InquiryPriceResetInstancesTypeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetInstancesTypeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetInstancesTypeResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示调整成对应机型实例的价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceResetInstancesTypeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetInstancesTypeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResizeInstanceDisksRequest struct { *tchttp.BaseRequest // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 待扩容的数据盘配置信息。只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](https://cloud.tencent.com/document/product/213/15753#DataDisk)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。数据盘容量单位:GB。最小扩容步长:10G。关于数据盘类型的选择请参考硬盘产品简介。可选数据盘类型受到实例类型`InstanceType`限制。另外允许扩容的最大容量也因数据盘类型的不同而有所差异。 DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks" list` // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:<br><li>TRUE:表示在正常关机失败后进行强制关机<br><li>FALSE:表示在正常关机失败后不进行强制关机<br><br>默认取值:FALSE。<br><br>强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` } func (r *InquiryPriceResizeInstanceDisksRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResizeInstanceDisksRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResizeInstanceDisksResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示磁盘扩容成对应配置的价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceResizeInstanceDisksResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResizeInstanceDisksResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceRunInstancesRequest struct { *tchttp.BaseRequest // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目等属性。 Placement *Placement `json:"Placement,omitempty" name:"Placement"` // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:<br/><li>公共镜像</li><li>自定义镜像</li><li>共享镜像</li><li>服务市场镜像</li><br/>可通过以下方式获取可用的镜像ID:<br/><li>`公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。</li><li>通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。</li> ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。<br><li>PREPAID:预付费,即包年包月<br><li>POSTPAID_BY_HOUR:按小时后付费<br><li>SPOTPAID:竞价付费<br>默认值:POSTPAID_BY_HOUR。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则默认机型为S1.SMALL1。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks" list` // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,那么InstanceCount参数只能为1。 VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` // 购买实例数量。取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` // 实例显示名称。<br><li>不指定实例显示名称则默认显示‘未命名’。</li><li>购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。</li><li>购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。</li><li>最多支持60个字符(包含模式串)。 InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则默认不绑定安全组。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。<br>更多详细信息请参阅:如何保证幂等性。 ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` // 云服务器的主机名。<br><li>点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。<br><li>Windows 实例:名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。<br><li>其他类型(Linux 等)实例:字符长度为[2, 30],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 HostName *string `json:"HostName,omitempty" name:"HostName"` // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification" list` // 实例的市场相关选项,如竞价实例相关参数 InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` } func (r *InquiryPriceRunInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceRunInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceRunInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 该参数表示对应配置实例的价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceRunInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceRunInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type Instance struct { // 实例所在的位置。 Placement *Placement `json:"Placement,omitempty" name:"Placement"` // 实例`ID`。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 实例机型。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 实例的CPU核数,单位:核。 CPU *int64 `json:"CPU,omitempty" name:"CPU"` // 实例内存容量,单位:`GB`。 Memory *int64 `json:"Memory,omitempty" name:"Memory"` // 实例业务状态。取值范围:<br><li>NORMAL:表示正常状态的实例<br><li>EXPIRED:表示过期的实例<br><li>PROTECTIVELY_ISOLATED:表示被安全隔离的实例。 RestrictState *string `json:"RestrictState,omitempty" name:"RestrictState"` // 实例名称。 InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` // 实例计费模式。取值范围:<br><li>`PREPAID`:表示预付费,即包年包月<br><li>`POSTPAID_BY_HOUR`:表示后付费,即按量计费<br><li>`CDHPAID`:`CDH`付费,即只对`CDH`计费,不对`CDH`上的实例计费。<br><li>`SPOTPAID`:表示竞价实例付费。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 实例系统盘信息。 SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` // 实例数据盘信息。只包含随实例购买的数据盘。 DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks" list` // 实例主网卡的内网`IP`列表。 PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` // 实例主网卡的公网`IP`列表。 // 注意:此字段可能返回 null,表示取不到有效值。 PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses" list` // 实例带宽信息。 InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` // 实例所属虚拟私有网络信息。 VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` // 生产实例所使用的镜像`ID`。 ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 自动续费标识。取值范围:<br><li>`NOTIFY_AND_MANUAL_RENEW`:表示通知即将过期,但不自动续费<br><li>`NOTIFY_AND_AUTO_RENEW`:表示通知即将过期,而且自动续费<br><li>`DISABLE_NOTIFY_AND_MANUAL_RENEW`:表示不通知即将过期,也不自动续费。 // <br><li>注意:后付费模式本项为null RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` // 创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 到期时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。注意:后付费模式本项为null ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` // 操作系统名称。 OsName *string `json:"OsName,omitempty" name:"OsName"` // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 实例登录设置。目前只返回实例所关联的密钥。 LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` // 实例状态。取值范围:<br><li>PENDING:表示创建中<br></li><li>LAUNCH_FAILED:表示创建失败<br></li><li>RUNNING:表示运行中<br></li><li>STOPPED:表示关机<br></li><li>STARTING:表示开机中<br></li><li>STOPPING:表示关机中<br></li><li>REBOOTING:表示重启中<br></li><li>SHUTDOWN:表示停止待销毁<br></li><li>TERMINATING:表示销毁中。<br></li> InstanceState *string `json:"InstanceState,omitempty" name:"InstanceState"` // 实例关联的标签列表。 Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` // 实例的关机计费模式。 // 取值范围:<br><li>KEEP_CHARGING:关机继续收费<br><li>STOP_CHARGING:关机停止收费<li>NOT_APPLICABLE:实例处于非关机状态或者不适用关机停止计费的条件<br> StopChargingMode *string `json:"StopChargingMode,omitempty" name:"StopChargingMode"` // 实例全局唯一ID Uuid *string `json:"Uuid,omitempty" name:"Uuid"` // 实例的最新操作。例:StopInstances、ResetInstance。 // 注意:此字段可能返回 null,表示取不到有效值。 LatestOperation *string `json:"LatestOperation,omitempty" name:"LatestOperation"` // 实例的最新操作状态。取值范围:<br><li>SUCCESS:表示操作成功<br><li>OPERATING:表示操作执行中<br><li>FAILED:表示操作失败 // 注意:此字段可能返回 null,表示取不到有效值。 LatestOperationState *string `json:"LatestOperationState,omitempty" name:"LatestOperationState"` // 实例最新操作的唯一请求 ID。 // 注意:此字段可能返回 null,表示取不到有效值。 LatestOperationRequestId *string `json:"LatestOperationRequestId,omitempty" name:"LatestOperationRequestId"` // 分散置放群组ID。 // 注意:此字段可能返回 null,表示取不到有效值。 DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` // 实例的IPv6地址。 // 注意:此字段可能返回 null,表示取不到有效值。 IPv6Addresses []*string `json:"IPv6Addresses,omitempty" name:"IPv6Addresses" list` // CAM角色名。 // 注意:此字段可能返回 null,表示取不到有效值。 CamRoleName *string `json:"CamRoleName,omitempty" name:"CamRoleName"` } type InstanceChargePrepaid struct { // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48, 60。 Period *int64 `json:"Period,omitempty" name:"Period"` // 自动续费标识。取值范围:<br><li>NOTIFY_AND_AUTO_RENEW:通知过期且自动续费<br><li>NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费<br><li>DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费<br><br>默认取值:NOTIFY_AND_MANUAL_RENEW。若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` } type InstanceFamilyConfig struct { // 机型族名称的中文全称。 InstanceFamilyName *string `json:"InstanceFamilyName,omitempty" name:"InstanceFamilyName"` // 机型族名称的英文简称。 InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` } type InstanceMarketOptionsRequest struct { // 竞价相关选项 SpotOptions *SpotMarketOptions `json:"SpotOptions,omitempty" name:"SpotOptions"` // 市场选项类型,当前只支持取值:spot MarketType *string `json:"MarketType,omitempty" name:"MarketType"` } type InstanceStatus struct { // 实例`ID`。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 实例状态。取值范围:<br><li>PENDING:表示创建中<br></li><li>LAUNCH_FAILED:表示创建失败<br></li><li>RUNNING:表示运行中<br></li><li>STOPPED:表示关机<br></li><li>STARTING:表示开机中<br></li><li>STOPPING:表示关机中<br></li><li>REBOOTING:表示重启中<br></li><li>SHUTDOWN:表示停止待销毁<br></li><li>TERMINATING:表示销毁中。<br></li> InstanceState *string `json:"InstanceState,omitempty" name:"InstanceState"` } type InstanceTypeConfig struct { // 可用区。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 实例机型。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 实例机型系列。 InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` // GPU核数,单位:核。 GPU *int64 `json:"GPU,omitempty" name:"GPU"` // CPU核数,单位:核。 CPU *int64 `json:"CPU,omitempty" name:"CPU"` // 内存容量,单位:`GB`。 Memory *int64 `json:"Memory,omitempty" name:"Memory"` // FPGA核数,单位:核。 FPGA *int64 `json:"FPGA,omitempty" name:"FPGA"` } type InstanceTypeQuotaItem struct { // 可用区。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 实例机型。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 实例计费模式。取值范围: <br><li>PREPAID:表示预付费,即包年包月<br><li>POSTPAID_BY_HOUR:表示后付费,即按量计费<br><li>CDHPAID:表示[CDH](https://cloud.tencent.com/document/product/416)付费,即只对CDH计费,不对CDH上的实例计费。<br><li>`SPOTPAID`:表示竞价实例付费。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 网卡类型,例如:25代表25G网卡 NetworkCard *int64 `json:"NetworkCard,omitempty" name:"NetworkCard"` // 扩展属性。 // 注意:此字段可能返回 null,表示取不到有效值。 Externals *Externals `json:"Externals,omitempty" name:"Externals"` // 实例的CPU核数,单位:核。 Cpu *int64 `json:"Cpu,omitempty" name:"Cpu"` // 实例内存容量,单位:`GB`。 Memory *int64 `json:"Memory,omitempty" name:"Memory"` // 实例机型系列。 InstanceFamily *string `json:"InstanceFamily,omitempty" name:"InstanceFamily"` // 机型名称。 TypeName *string `json:"TypeName,omitempty" name:"TypeName"` // 本地磁盘规格列表。当该参数返回为空值时,表示当前情况下无法创建本地盘。 LocalDiskTypeList []*LocalDiskType `json:"LocalDiskTypeList,omitempty" name:"LocalDiskTypeList" list` // 实例是否售卖。取值范围: <br><li>SELL:表示实例可购买<br><li>SOLD_OUT:表示实例已售罄。 Status *string `json:"Status,omitempty" name:"Status"` // 实例的售卖价格。 Price *ItemPrice `json:"Price,omitempty" name:"Price"` // 售罄原因。 // 注意:此字段可能返回 null,表示取不到有效值。 SoldOutReason *string `json:"SoldOutReason,omitempty" name:"SoldOutReason"` // 内网带宽,单位Gbps。 InstanceBandwidth *float64 `json:"InstanceBandwidth,omitempty" name:"InstanceBandwidth"` // 网络收发包能力,单位万PPS。 InstancePps *int64 `json:"InstancePps,omitempty" name:"InstancePps"` // 本地存储块数量。 StorageBlockAmount *int64 `json:"StorageBlockAmount,omitempty" name:"StorageBlockAmount"` // 处理器型号。 CpuType *string `json:"CpuType,omitempty" name:"CpuType"` // 实例的GPU数量。 Gpu *int64 `json:"Gpu,omitempty" name:"Gpu"` // 实例的FPGA数量。 Fpga *int64 `json:"Fpga,omitempty" name:"Fpga"` // 实例备注信息。 Remark *string `json:"Remark,omitempty" name:"Remark"` } type InternetAccessible struct { // 网络计费类型。取值范围:<br><li>BANDWIDTH_PREPAID:预付费按带宽结算<br><li>TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费<br><li>BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费<br><li>BANDWIDTH_PACKAGE:带宽包用户<br>默认取值:非带宽包用户默认与子机付费类型保持一致。 InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` // 公网出带宽上限,单位:Mbps。默认值:0Mbps。不同机型带宽上限范围不一致,具体限制详见[购买网络带宽](https://cloud.tencent.com/document/product/213/12523)。 InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // 是否分配公网IP。取值范围:<br><li>TRUE:表示分配公网IP<br><li>FALSE:表示不分配公网IP<br><br>当公网带宽大于0Mbps时,可自由选择开通与否,默认开通公网IP;当公网带宽为0,则不允许分配公网IP。该参数仅在RunInstances接口中作为入参使用。 PublicIpAssigned *bool `json:"PublicIpAssigned,omitempty" name:"PublicIpAssigned"` // 带宽包ID。可通过[`DescribeBandwidthPackages`](https://cloud.tencent.com/document/api/215/19209)接口返回值中的`BandwidthPackageId`获取。该参数仅在RunInstances接口中作为入参使用。 BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` } type InternetBandwidthConfig struct { // 开始时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 StartTime *string `json:"StartTime,omitempty" name:"StartTime"` // 结束时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 EndTime *string `json:"EndTime,omitempty" name:"EndTime"` // 实例带宽信息。 InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` } type InternetChargeTypeConfig struct { // 网络计费模式。 InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` // 网络计费模式描述信息。 Description *string `json:"Description,omitempty" name:"Description"` } type ItemPrice struct { // 后续合计费用的原价,后付费模式使用,单位:元。<br><li>如返回了其他时间区间项,如UnitPriceSecondStep,则本项代表时间区间在(0, 96)小时;若未返回其他时间区间项,则本项代表全时段,即(0, ∞)小时 // 注意:此字段可能返回 null,表示取不到有效值。 UnitPrice *float64 `json:"UnitPrice,omitempty" name:"UnitPrice"` // 后续计价单元,后付费模式使用,可取值范围: <br><li>HOUR:表示计价单元是按每小时来计算。当前涉及该计价单元的场景有:实例按小时后付费(POSTPAID_BY_HOUR)、带宽按小时后付费(BANDWIDTH_POSTPAID_BY_HOUR):<br><li>GB:表示计价单元是按每GB来计算。当前涉及该计价单元的场景有:流量按小时后付费(TRAFFIC_POSTPAID_BY_HOUR)。 // 注意:此字段可能返回 null,表示取不到有效值。 ChargeUnit *string `json:"ChargeUnit,omitempty" name:"ChargeUnit"` // 预支合计费用的原价,预付费模式使用,单位:元。 // 注意:此字段可能返回 null,表示取不到有效值。 OriginalPrice *float64 `json:"OriginalPrice,omitempty" name:"OriginalPrice"` // 预支合计费用的折扣价,预付费模式使用,单位:元。 // 注意:此字段可能返回 null,表示取不到有效值。 DiscountPrice *float64 `json:"DiscountPrice,omitempty" name:"DiscountPrice"` // 折扣,如20.0代表2折 // 注意:此字段可能返回 null,表示取不到有效值。 Discount *float64 `json:"Discount,omitempty" name:"Discount"` // 后续合计费用的折扣价,后付费模式使用,单位:元<br><li>如返回了其他时间区间项,如UnitPriceDiscountSecondStep,则本项代表时间区间在(0, 96)小时;若未返回其他时间区间项,则本项代表全时段,即(0, ∞)小时 // 注意:此字段可能返回 null,表示取不到有效值。 UnitPriceDiscount *float64 `json:"UnitPriceDiscount,omitempty" name:"UnitPriceDiscount"` // 使用时间区间在(96, 360)小时的后续合计费用的原价,后付费模式使用,单位:元。 // 注意:此字段可能返回 null,表示取不到有效值。 UnitPriceSecondStep *float64 `json:"UnitPriceSecondStep,omitempty" name:"UnitPriceSecondStep"` // 使用时间区间在(96, 360)小时的后续合计费用的折扣价,后付费模式使用,单位:元 // 注意:此字段可能返回 null,表示取不到有效值。 UnitPriceDiscountSecondStep *float64 `json:"UnitPriceDiscountSecondStep,omitempty" name:"UnitPriceDiscountSecondStep"` // 使用时间区间在(360, ∞)小时的后续合计费用的原价,后付费模式使用,单位:元。 // 注意:此字段可能返回 null,表示取不到有效值。 UnitPriceThirdStep *float64 `json:"UnitPriceThirdStep,omitempty" name:"UnitPriceThirdStep"` // 使用时间区间在(360, ∞)小时的后续合计费用的折扣价,后付费模式使用,单位:元 // 注意:此字段可能返回 null,表示取不到有效值。 UnitPriceDiscountThirdStep *float64 `json:"UnitPriceDiscountThirdStep,omitempty" name:"UnitPriceDiscountThirdStep"` } type KeyPair struct { // 密钥对的`ID`,是密钥对的唯一标识。 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` // 密钥对名称。 KeyName *string `json:"KeyName,omitempty" name:"KeyName"` // 密钥对所属的项目`ID`。 ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` // 密钥对描述信息。 Description *string `json:"Description,omitempty" name:"Description"` // 密钥对的纯文本公钥。 PublicKey *string `json:"PublicKey,omitempty" name:"PublicKey"` // 密钥对的纯文本私钥。腾讯云不会保管私钥,请用户自行妥善保存。 PrivateKey *string `json:"PrivateKey,omitempty" name:"PrivateKey"` // 密钥关联的实例`ID`列表。 AssociatedInstanceIds []*string `json:"AssociatedInstanceIds,omitempty" name:"AssociatedInstanceIds" list` // 创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type LocalDiskType struct { // 本地磁盘类型。 Type *string `json:"Type,omitempty" name:"Type"` // 本地磁盘属性。 PartitionType *string `json:"PartitionType,omitempty" name:"PartitionType"` // 本地磁盘最小值。 MinSize *int64 `json:"MinSize,omitempty" name:"MinSize"` // 本地磁盘最大值。 MaxSize *int64 `json:"MaxSize,omitempty" name:"MaxSize"` // 购买时本地盘是否为必选。取值范围:<br><li>REQUIRED:表示必选<br><li>OPTIONAL:表示可选。 Required *string `json:"Required,omitempty" name:"Required"` } type LoginSettings struct { // 实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下:<br><li>Linux实例密码必须8到30位,至少包括两项[a-z],[A-Z]、[0-9] 和 [( ) \` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? / ]中的特殊符号。<br><li>Windows实例密码必须12到30位,至少包括三项[a-z],[A-Z],[0-9] 和 [( ) \` ~ ! @ # $ % ^ & * - + = | { } [ ] : ; ' , . ? /]中的特殊符号。<br><br>若不指定该参数,则由系统随机生成密码,并通过站内信方式通知到用户。 // 注意:此字段可能返回 null,表示取不到有效值。 Password *string `json:"Password,omitempty" name:"Password"` // 密钥ID列表。关联密钥后,就可以通过对应的私钥来访问实例;KeyId可通过接口[DescribeKeyPairs](https://cloud.tencent.com/document/api/213/15699)获取,密钥与密码不能同时指定,同时Windows操作系统不支持指定密钥。当前仅支持购买的时候指定一个密钥。 // 注意:此字段可能返回 null,表示取不到有效值。 KeyIds []*string `json:"KeyIds,omitempty" name:"KeyIds" list` // 保持镜像的原始设置。该参数与Password或KeyIds.N不能同时指定。只有使用自定义镜像、共享镜像或外部导入镜像创建实例时才能指定该参数为TRUE。取值范围:<br><li>TRUE:表示保持镜像的登录设置<br><li>FALSE:表示不保持镜像的登录设置<br><br>默认取值:FALSE。 // 注意:此字段可能返回 null,表示取不到有效值。 KeepImageLogin *string `json:"KeepImageLogin,omitempty" name:"KeepImageLogin"` } type ModifyDisasterRecoverGroupAttributeRequest struct { *tchttp.BaseRequest // 分散置放群组ID,可使用[DescribeDisasterRecoverGroups](https://cloud.tencent.com/document/api/213/17810)接口获取。 DisasterRecoverGroupId *string `json:"DisasterRecoverGroupId,omitempty" name:"DisasterRecoverGroupId"` // 分散置放群组名称,长度1-60个字符,支持中、英文。 Name *string `json:"Name,omitempty" name:"Name"` } func (r *ModifyDisasterRecoverGroupAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyDisasterRecoverGroupAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyDisasterRecoverGroupAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyDisasterRecoverGroupAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyDisasterRecoverGroupAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyHostsAttributeRequest struct { *tchttp.BaseRequest // 一个或多个待操作的CDH实例ID。 HostIds []*string `json:"HostIds,omitempty" name:"HostIds" list` // CDH实例显示名称。可任意命名,但不得超过60个字符。 HostName *string `json:"HostName,omitempty" name:"HostName"` // 自动续费标识。取值范围:<br><li>NOTIFY_AND_AUTO_RENEW:通知过期且自动续费<br><li>NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费<br><li>DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费<br><br>若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` // 项目ID。项目可以使用[AddProject](https://cloud.tencent.com/doc/api/403/4398)接口创建。可通过[`DescribeProject`](https://cloud.tencent.com/document/product/378/4400) API返回值中的`projectId`获取。后续使用[DescribeHosts](https://cloud.tencent.com/document/api/213/16474)接口查询实例时,项目ID可用于过滤结果。 ProjectId *uint64 `json:"ProjectId,omitempty" name:"ProjectId"` } func (r *ModifyHostsAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyHostsAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyHostsAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyHostsAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyHostsAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyImageAttributeRequest struct { *tchttp.BaseRequest // 镜像ID,形如`img-gvbnzy6f`。镜像ID可以通过如下方式获取:<br><li>通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。<br><li>通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。 ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 设置新的镜像名称;必须满足下列限制:<br> <li> 不得超过20个字符。<br> <li> 镜像名称不能与已有镜像重复。 ImageName *string `json:"ImageName,omitempty" name:"ImageName"` // 设置新的镜像描述;必须满足下列限制:<br> <li> 不得超过60个字符。 ImageDescription *string `json:"ImageDescription,omitempty" name:"ImageDescription"` } func (r *ModifyImageAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyImageAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyImageAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyImageAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyImageAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyImageSharePermissionRequest struct { *tchttp.BaseRequest // 镜像ID,形如`img-gvbnzy6f`。镜像Id可以通过如下方式获取:<br><li>通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。<br><li>通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。 <br>镜像ID必须指定为状态为`NORMAL`的镜像。镜像状态请参考[镜像数据表](https://cloud.tencent.com/document/product/213/15753#Image)。 ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 接收分享镜像的账号Id列表,array型参数的格式可以参考[API简介](/document/api/213/568)。帐号ID不同于QQ号,查询用户帐号ID请查看[帐号信息](https://console.cloud.tencent.com/developer)中的帐号ID栏。 AccountIds []*string `json:"AccountIds,omitempty" name:"AccountIds" list` // 操作,包括 `SHARE`,`CANCEL`。其中`SHARE`代表分享操作,`CANCEL`代表取消分享操作。 Permission *string `json:"Permission,omitempty" name:"Permission"` } func (r *ModifyImageSharePermissionRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyImageSharePermissionRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyImageSharePermissionResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyImageSharePermissionResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyImageSharePermissionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesAttributeRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 实例名称。可任意命名,但不得超过60个字符。 InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` // 指定实例的安全组Id列表,子机将重新关联指定列表的安全组,原本关联的安全组会被解绑。 SecurityGroups []*string `json:"SecurityGroups,omitempty" name:"SecurityGroups" list` } func (r *ModifyInstancesAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyInstancesAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesChargeTypeRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。<br><li>PREPAID:预付费,即包年包月。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` } func (r *ModifyInstancesChargeTypeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesChargeTypeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesChargeTypeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyInstancesChargeTypeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesChargeTypeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesProjectRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 项目ID。项目可以使用[AddProject](https://cloud.tencent.com/doc/api/403/4398)接口创建。可通过[`DescribeProject`](https://cloud.tencent.com/document/product/378/4400) API返回值中的`projectId`获取。后续使用[DescribeInstances](https://cloud.tencent.com/document/api/213/15728)接口查询实例时,项目ID可用于过滤结果。 ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` } func (r *ModifyInstancesProjectRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesProjectRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesProjectResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyInstancesProjectResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesProjectResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesRenewFlagRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 自动续费标识。取值范围:<br><li>NOTIFY_AND_AUTO_RENEW:通知过期且自动续费<br><li>NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费<br><li>DISABLE_NOTIFY_AND_MANUAL_RENEW:不通知过期不自动续费<br><br>若该参数指定为NOTIFY_AND_AUTO_RENEW,在账户余额充足的情况下,实例到期后将按月自动续费。 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` } func (r *ModifyInstancesRenewFlagRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesRenewFlagRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesRenewFlagResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyInstancesRenewFlagResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesRenewFlagResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesVpcAttributeRequest struct { *tchttp.BaseRequest // 待操作的实例ID数组。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 私有网络相关信息配置,通过该参数指定私有网络的ID,子网ID,私有网络ip等信息。<br><li>当指定私有网络ID和子网ID(子网必须在实例所在的可用区)与指定实例所在私有网络不一致时,会将实例迁移至指定的私有网络的子网下。<br><li>可通过`PrivateIpAddresses`指定私有网络子网IP,若需指定则所有已指定的实例均需要指定子网IP,此时`InstanceIds`与`PrivateIpAddresses`一一对应。<br><li>不指定`PrivateIpAddresses`时随机分配私有网络子网IP。 VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` // 是否对运行中的实例选择强制关机。默认为TRUE。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` // 是否保留主机名。默认为FALSE。 ReserveHostName *bool `json:"ReserveHostName,omitempty" name:"ReserveHostName"` } func (r *ModifyInstancesVpcAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesVpcAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyInstancesVpcAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyInstancesVpcAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyInstancesVpcAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyKeyPairAttributeRequest struct { *tchttp.BaseRequest // 密钥对ID,密钥对ID形如:`skey-xxxxxxxx`。<br><br>可以通过以下方式获取可用的密钥 ID:<br><li>通过登录[控制台](https://console.cloud.tencent.com/cvm/sshkey)查询密钥 ID。<br><li>通过调用接口 [DescribeKeyPairs](https://cloud.tencent.com/document/api/213/9403) ,取返回信息中的 `KeyId` 获取密钥对 ID。 KeyId *string `json:"KeyId,omitempty" name:"KeyId"` // 修改后的密钥对名称,可由数字,字母和下划线组成,长度不超过25个字符。 KeyName *string `json:"KeyName,omitempty" name:"KeyName"` // 修改后的密钥对描述信息。可任意命名,但不得超过60个字符。 Description *string `json:"Description,omitempty" name:"Description"` } func (r *ModifyKeyPairAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyKeyPairAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyKeyPairAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyKeyPairAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyKeyPairAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type OperationCountLimit struct { // 实例操作。取值范围:<br><li>`INSTANCE_DEGRADE`:降配操作<br><li>`INTERNET_CHARGE_TYPE_CHANGE`:修改网络带宽计费模式 Operation *string `json:"Operation,omitempty" name:"Operation"` // 实例ID。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 当前已使用次数,如果返回值为-1表示该操作无次数限制。 CurrentCount *int64 `json:"CurrentCount,omitempty" name:"CurrentCount"` // 操作次数最高额度,如果返回值为-1表示该操作无次数限制,如果返回值为0表示不支持调整配置。 LimitCount *int64 `json:"LimitCount,omitempty" name:"LimitCount"` } type OsVersion struct { // 操作系统类型 OsName *string `json:"OsName,omitempty" name:"OsName"` // 支持的操作系统版本 OsVersions []*string `json:"OsVersions,omitempty" name:"OsVersions" list` // 支持的操作系统架构 Architecture []*string `json:"Architecture,omitempty" name:"Architecture" list` } type Placement struct { // 实例所属的[可用区](https://cloud.tencent.com/document/product/213/15753#ZoneInfo)ID。该参数也可以通过调用 [DescribeZones](https://cloud.tencent.com/document/product/213/15707) 的返回值中的Zone字段来获取。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 实例所属项目ID。该参数可以通过调用 [DescribeProject](/document/api/378/4400) 的返回值中的 projectId 字段来获取。不填为默认项目。 ProjectId *int64 `json:"ProjectId,omitempty" name:"ProjectId"` // 实例所属的专用宿主机ID列表,仅用于入参。如果您有购买专用宿主机并且指定了该参数,则您购买的实例就会随机的部署在这些专用宿主机上。 HostIds []*string `json:"HostIds,omitempty" name:"HostIds" list` // 指定母机ip生产子机 HostIps []*string `json:"HostIps,omitempty" name:"HostIps" list` // 实例所属的专用宿主机ID,仅用于出参。 HostId *string `json:"HostId,omitempty" name:"HostId"` } type Price struct { // 描述了实例价格。 InstancePrice *ItemPrice `json:"InstancePrice,omitempty" name:"InstancePrice"` // 描述了网络价格。 BandwidthPrice *ItemPrice `json:"BandwidthPrice,omitempty" name:"BandwidthPrice"` } type PurchaseReservedInstancesOfferingRequest struct { *tchttp.BaseRequest // 购买预留实例计费数量 InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` // 预留实例计费配置ID ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` // 试运行 DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。<br>更多详细信息请参阅:如何保证幂等性 ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` } func (r *PurchaseReservedInstancesOfferingRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *PurchaseReservedInstancesOfferingRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type PurchaseReservedInstancesOfferingResponse struct { *tchttp.BaseResponse Response *struct { // 已购买预留实例计费ID ReservedInstanceId *string `json:"ReservedInstanceId,omitempty" name:"ReservedInstanceId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *PurchaseReservedInstancesOfferingResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *PurchaseReservedInstancesOfferingResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RebootInstancesRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 是否在正常重启失败后选择强制重启实例。取值范围:<br><li>TRUE:表示在正常重启失败后进行强制重启<br><li>FALSE:表示在正常重启失败后不进行强制重启<br><br>默认取值:FALSE。 ForceReboot *bool `json:"ForceReboot,omitempty" name:"ForceReboot"` // 关机类型。取值范围:<br><li>SOFT:表示软关机<br><li>HARD:表示硬关机<br><li>SOFT_FIRST:表示优先软关机,失败再执行硬关机<br><br>默认取值:SOFT。 StopType *string `json:"StopType,omitempty" name:"StopType"` } func (r *RebootInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RebootInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RebootInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RebootInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RebootInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RegionInfo struct { // 地域名称,例如,ap-guangzhou Region *string `json:"Region,omitempty" name:"Region"` // 地域描述,例如,华南地区(广州) RegionName *string `json:"RegionName,omitempty" name:"RegionName"` // 地域是否可用状态 RegionState *string `json:"RegionState,omitempty" name:"RegionState"` } type RenewHostsRequest struct { *tchttp.BaseRequest // 一个或多个待操作的CDH实例ID。每次请求的CDH实例的上限为100。 HostIds []*string `json:"HostIds,omitempty" name:"HostIds" list` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 HostChargePrepaid *ChargePrepaid `json:"HostChargePrepaid,omitempty" name:"HostChargePrepaid"` } func (r *RenewHostsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RenewHostsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RenewHostsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RenewHostsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RenewHostsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RenewInstancesRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的续费时长、是否设置自动续费等属性。包年包月实例该参数为必传参数。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` // 是否续费弹性数据盘。取值范围:<br><li>TRUE:表示续费包年包月实例同时续费其挂载的弹性数据盘<br><li>FALSE:表示续费包年包月实例同时不再续费其挂载的弹性数据盘<br><br>默认取值:TRUE。 RenewPortableDataDisk *bool `json:"RenewPortableDataDisk,omitempty" name:"RenewPortableDataDisk"` } func (r *RenewInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RenewInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RenewInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RenewInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RenewInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReservedInstances struct { // 已购买的预留实例计费ID。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。 ReservedInstancesId *string `json:"ReservedInstancesId,omitempty" name:"ReservedInstancesId"` // 预留实例计费的类型。形如:S3.MEDIUM4。 // 返回项:<a href="https://cloud.tencent.com/document/product/213/11518">预留实例计费类型列表</a> InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 预留实例计费可购买的可用区。形如:ap-guangzhou-1。 // 返回项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a> Zone *string `json:"Zone,omitempty" name:"Zone"` // 预留实例计费开始时间。形如:1949-10-01 00:00:00 StartTime *string `json:"StartTime,omitempty" name:"StartTime"` // 预留实例计费到期时间。形如:1949-10-01 00:00:00 EndTime *string `json:"EndTime,omitempty" name:"EndTime"` // 预留实例计费【有效期】即预留实例计费购买时长。形如:31536000。 // 计量单位:秒。 Duration *int64 `json:"Duration,omitempty" name:"Duration"` // 已购买的预留实例计费个数。形如:10。 InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` // 描述预留实例计费的平台描述(即操作系统)。形如:linux。 // 返回项: linux 。 ProductDescription *string `json:"ProductDescription,omitempty" name:"ProductDescription"` // 预留实例计费购买的状态。形如:active // 返回项: active (以创建) | pending (等待被创建) | retired (过期)。 State *string `json:"State,omitempty" name:"State"` // 可购买的预留实例计费类型的结算货币,使用ISO 4217标准货币代码。形如:USD。 // 返回项:USD(美元)。 CurrencyCode *string `json:"CurrencyCode,omitempty" name:"CurrencyCode"` // 预留实例计费的付款类型。形如:All Upfront。 // 返回项: All Upfront (预付全部费用)。 OfferingType *string `json:"OfferingType,omitempty" name:"OfferingType"` } type ReservedInstancesOffering struct { // 预留实例计费可购买的可用区。形如:ap-guangzhou-1。 // 返回项:<a href="https://cloud.tencent.com/document/product/213/6091">可用区列表</a> Zone *string `json:"Zone,omitempty" name:"Zone"` // 可购买的预留实例计费类型的结算货币,使用ISO 4217标准货币代码。 // 返回项:USD(美元)。 CurrencyCode *string `json:"CurrencyCode,omitempty" name:"CurrencyCode"` // 预留实例计费【有效期】即预留实例计费购买时长。形如:31536000。 // 计量单位:秒 Duration *int64 `json:"Duration,omitempty" name:"Duration"` // 预留实例计费的购买价格。形如:4000.0。 // 计量单位:与 currencyCode 一致,目前支持 USD(美元) FixedPrice *float64 `json:"FixedPrice,omitempty" name:"FixedPrice"` // 预留实例计费的实例类型。形如:S3.MEDIUM4。 // 返回项:<a href="https://cloud.tencent.com/product/cvm/instances">预留实例计费类型列表</a> InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 预留实例计费的付款类型。形如:All Upfront。 // 返回项: All Upfront (预付全部费用)。 OfferingType *string `json:"OfferingType,omitempty" name:"OfferingType"` // 可购买的预留实例计费配置ID。形如:650c138f-ae7e-4750-952a-96841d6e9fc1。 ReservedInstancesOfferingId *string `json:"ReservedInstancesOfferingId,omitempty" name:"ReservedInstancesOfferingId"` // 预留实例计费的平台描述(即操作系统)。形如:linux。 // 返回项: linux 。 ProductDescription *string `json:"ProductDescription,omitempty" name:"ProductDescription"` // 扣除预付费之后的使用价格 (按小时计费)。形如:0.0。 // 目前,因为只支持 All Upfront 付款类型,所以默认为 0元/小时。 // 计量单位:元/小时,货币单位与 currencyCode 一致,目前支持 USD(美元) UsagePrice *float64 `json:"UsagePrice,omitempty" name:"UsagePrice"` } type ResetInstanceRequest struct { *tchttp.BaseRequest // 实例ID。可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:<br/><li>公共镜像</li><li>自定义镜像</li><li>共享镜像</li><li>服务市场镜像</li><br/>可通过以下方式获取可用的镜像ID:<br/><li>`公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。</li><li>通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。</li> // <br>默认取值:默认使用当前镜像。 ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 实例系统盘配置信息。系统盘为云盘的实例可以通过该参数指定重装后的系统盘大小来实现对系统盘的扩容操作,若不指定大小且原系统盘大小小于镜像大小,则会自动扩容,产生多余的磁盘费用。系统盘大小只支持扩容不支持缩容;重装只支持修改系统盘的大小,不能修改系统盘的类型。 SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认开启云监控、云安全服务。 EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` // 重装系统时,可以指定修改实例的主机名。<br><li>点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。<br><li>Windows 实例:名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。<br><li>其他类型(Linux 等)实例:字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 HostName *string `json:"HostName,omitempty" name:"HostName"` } func (r *ResetInstanceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstanceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetInstanceResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetInstanceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstanceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetInstancesInternetMaxBandwidthRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的 `InstanceId` 获取。 每次请求批量实例的上限为100。当调整 `BANDWIDTH_PREPAID` 和 `BANDWIDTH_POSTPAID_BY_HOUR` 计费方式的带宽时,只支持一个实例。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 公网出带宽配置。不同机型带宽上限范围不一致,具体限制详见带宽限制对账表。暂时只支持 `InternetMaxBandwidthOut` 参数。 InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` // 带宽生效的起始时间。格式:`YYYY-MM-DD`,例如:`2016-10-30`。起始时间不能早于当前时间。如果起始时间是今天则新设置的带宽立即生效。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 StartTime *string `json:"StartTime,omitempty" name:"StartTime"` // 带宽生效的终止时间。格式: `YYYY-MM-DD` ,例如:`2016-10-30` 。新设置的带宽的有效期包含终止时间此日期。终止时间不能晚于包年包月实例的到期时间。实例的到期时间可通过 [`DescribeInstances`](https://cloud.tencent.com/document/api/213/9388)接口返回值中的`ExpiredTime`获取。该参数只对包年包月带宽有效,其他模式带宽不支持该参数,否则接口会以相应错误码返回。 EndTime *string `json:"EndTime,omitempty" name:"EndTime"` } func (r *ResetInstancesInternetMaxBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstancesInternetMaxBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetInstancesInternetMaxBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetInstancesInternetMaxBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstancesInternetMaxBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetInstancesPasswordRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728) API返回值中的`InstanceId`获取。每次请求允许操作的实例数量上限是100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 实例登录密码。不同操作系统类型密码复杂度限制不一样,具体如下: // Linux实例密码必须8-30位,推荐使用12位以上密码,不能以“/”开头,至少包含以下字符中的三种不同字符,字符种类:<br><li>小写字母:[a-z]<br><li>大写字母:[A-Z]<br><li>数字:0-9<br><li>特殊字符: ()\`~!@#$%^&\*-+=\_|{}[]:;'<>,.?/ // Windows实例密码必须12~30位,不能以“/”开头且不包括用户名,至少包含以下字符中的三种不同字符<br><li>小写字母:[a-z]<br><li>大写字母:[A-Z]<br><li>数字: 0-9<br><li>特殊字符:()\`~!@#$%^&\*-+=\_|{}[]:;' <>,.?/<br><li>如果实例即包含`Linux`实例又包含`Windows`实例,则密码复杂度限制按照`Windows`实例的限制。 Password *string `json:"Password,omitempty" name:"Password"` // 待重置密码的实例操作系统的用户名。不得超过64个字符。 UserName *string `json:"UserName,omitempty" name:"UserName"` // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:<br><li>TRUE:表示在正常关机失败后进行强制关机<br><li>FALSE:表示在正常关机失败后不进行强制关机<br><br>默认取值:FALSE。<br><br>强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` } func (r *ResetInstancesPasswordRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstancesPasswordRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetInstancesPasswordResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetInstancesPasswordResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstancesPasswordResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetInstancesTypeRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。本接口目前仅支持每次操作1个实例。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 实例机型。不同实例机型指定了不同的资源规格,具体取值可通过调用接口[`DescribeInstanceTypeConfigs`](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例类型](https://cloud.tencent.com/document/product/213/11518)描述。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机。取值范围:<br><li>TRUE:表示在正常关机失败后进行强制关机<br><li>FALSE:表示在正常关机失败后不进行强制关机<br><br>默认取值:FALSE。<br><br>强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` } func (r *ResetInstancesTypeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstancesTypeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetInstancesTypeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetInstancesTypeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetInstancesTypeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResizeInstanceDisksRequest struct { *tchttp.BaseRequest // 待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 待扩容的数据盘配置信息。只支持扩容非弹性数据盘([`DescribeDisks`](https://cloud.tencent.com/document/api/362/16315)接口返回值中的`Portable`为`false`表示非弹性),且[数据盘类型](/document/api/213/9452#block_device)为:`CLOUD_BASIC`、`CLOUD_PREMIUM`、`CLOUD_SSD`。数据盘容量单位:GB。最小扩容步长:10G。关于数据盘类型的选择请参考[硬盘产品简介](https://cloud.tencent.com/document/product/362/2353)。可选数据盘类型受到实例类型`InstanceType`限制。另外允许扩容的最大容量也因数据盘类型的不同而有所差异。 DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks" list` // 是否对运行中的实例选择强制关机。建议对运行中的实例先手动关机,然后再重置用户密码。取值范围:<br><li>TRUE:表示在正常关机失败后进行强制关机<br><li>FALSE:表示在正常关机失败后不进行强制关机<br><br>默认取值:FALSE。<br><br>强制关机的效果等同于关闭物理计算机的电源开关。强制关机可能会导致数据丢失或文件系统损坏,请仅在服务器不能正常关机时使用。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` } func (r *ResizeInstanceDisksRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResizeInstanceDisksRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResizeInstanceDisksResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResizeInstanceDisksResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResizeInstanceDisksResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RunInstancesRequest struct { *tchttp.BaseRequest // 实例所在的位置。通过该参数可以指定实例所属可用区,所属项目,所属宿主机(在专用宿主机上创建子机时指定)等属性。 Placement *Placement `json:"Placement,omitempty" name:"Placement"` // 指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-xxx`。镜像类型分为四种:<br/><li>公共镜像</li><li>自定义镜像</li><li>共享镜像</li><li>服务市场镜像</li><br/>可通过以下方式获取可用的镜像ID:<br/><li>`公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。</li><li>通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,传入InstanceType获取当前机型支持的镜像列表,取返回信息中的`ImageId`字段。</li> ImageId *string `json:"ImageId,omitempty" name:"ImageId"` // 实例[计费类型](https://cloud.tencent.com/document/product/213/2180)。<br><li>PREPAID:预付费,即包年包月<br><li>POSTPAID_BY_HOUR:按小时后付费<br><li>CDHPAID:独享子机(基于专用宿主机创建,宿主机部分的资源不收费)<br><li>SPOTPAID:竞价付费<br>默认值:POSTPAID_BY_HOUR。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` // 实例机型。不同实例机型指定了不同的资源规格。 // <br><li>对于付费模式为PREPAID或POSTPAID\_BY\_HOUR的实例创建,具体取值可通过调用接口[DescribeInstanceTypeConfigs](https://cloud.tencent.com/document/api/213/15749)来获得最新的规格表或参见[实例规格](https://cloud.tencent.com/document/product/213/11518)描述。若不指定该参数,则默认机型为S1.SMALL1。<br><li>对于付费模式为CDHPAID的实例创建,该参数以"CDH_"为前缀,根据CPU和内存配置生成,具体形式为:CDH_XCXG,例如对于创建CPU为1核,内存为1G大小的专用宿主机的实例,该参数应该为CDH_1C1G。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 实例系统盘配置信息。若不指定该参数,则按照系统默认值进行分配。 SystemDisk *SystemDisk `json:"SystemDisk,omitempty" name:"SystemDisk"` // 实例数据盘配置信息。若不指定该参数,则默认不购买数据盘。支持购买的时候指定21块数据盘,其中最多包含1块LOCAL_BASIC数据盘或者LOCAL_SSD数据盘,最多包含20块CLOUD_BASIC数据盘、CLOUD_PREMIUM数据盘或者CLOUD_SSD数据盘。 DataDisks []*DataDisk `json:"DataDisks,omitempty" name:"DataDisks" list` // 私有网络相关信息配置。通过该参数可以指定私有网络的ID,子网ID等信息。若不指定该参数,则默认使用基础网络。若在此参数中指定了私有网络IP,表示每个实例的主网卡IP,而且InstanceCount参数必须与私有网络IP的个数一致。 VirtualPrivateCloud *VirtualPrivateCloud `json:"VirtualPrivateCloud,omitempty" name:"VirtualPrivateCloud"` // 公网带宽相关信息设置。若不指定该参数,则默认公网带宽为0Mbps。 InternetAccessible *InternetAccessible `json:"InternetAccessible,omitempty" name:"InternetAccessible"` // 购买实例数量。包年包月实例取值范围:[1,300],按量计费实例取值范围:[1,100]。默认取值:1。指定购买实例的数量不能超过用户所能购买的剩余配额数量,具体配额相关限制详见[CVM实例购买限制](https://cloud.tencent.com/document/product/213/2664)。 InstanceCount *int64 `json:"InstanceCount,omitempty" name:"InstanceCount"` // 实例显示名称。<br><li>不指定实例显示名称则默认显示‘未命名’。</li><li>购买多台实例,如果指定模式串`{R:x}`,表示生成数字`[x, x+n-1]`,其中`n`表示购买实例的数量,例如`server_{R:3}`,购买1台时,实例显示名称为`server_3`;购买2台时,实例显示名称分别为`server_3`,`server_4`。支持指定多个模式串`{R:x}`。</li><li>购买多台实例,如果不指定模式串,则在实例显示名称添加后缀`1、2...n`,其中`n`表示购买实例的数量,例如`server_`,购买2台时,实例显示名称分别为`server_1`,`server_2`。</li><li>最多支持60个字符(包含模式串)。 InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` // 实例登录设置。通过该参数可以设置实例的登录方式密码、密钥或保持镜像的原始登录设置。默认情况下会随机生成密码,并以站内信方式知会到用户。 LoginSettings *LoginSettings `json:"LoginSettings,omitempty" name:"LoginSettings"` // 实例所属安全组。该参数可以通过调用 [DescribeSecurityGroups](https://cloud.tencent.com/document/api/215/15808) 的返回值中的sgId字段来获取。若不指定该参数,则绑定默认安全组。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 增强服务。通过该参数可以指定是否开启云安全、云监控等服务。若不指定该参数,则默认公共镜像开启云监控、云安全服务;自定义镜像与镜像市场镜像默认不开启云监控,云安全服务,而使用镜像里保留的服务。 EnhancedService *EnhancedService `json:"EnhancedService,omitempty" name:"EnhancedService"` // 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 ClientToken *string `json:"ClientToken,omitempty" name:"ClientToken"` // 云服务器的主机名。<br><li>点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。<br><li>Windows 实例:名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。<br><li>其他类型(Linux 等)实例:字符长度为[2, 60],允许支持多个点号,点之间为一段,每段允许字母(不限制大小写)、数字和短横线(-)组成。 HostName *string `json:"HostName,omitempty" name:"HostName"` // 定时任务。通过该参数可以为实例指定定时任务,目前仅支持定时销毁。 ActionTimer *ActionTimer `json:"ActionTimer,omitempty" name:"ActionTimer"` // 置放群组id,仅支持指定一个。 DisasterRecoverGroupIds []*string `json:"DisasterRecoverGroupIds,omitempty" name:"DisasterRecoverGroupIds" list` // 标签描述列表。通过指定该参数可以同时绑定标签到相应的资源实例,当前仅支持绑定标签到云服务器实例。 TagSpecification []*TagSpecification `json:"TagSpecification,omitempty" name:"TagSpecification" list` // 实例的市场相关选项,如竞价实例相关参数,若指定实例的付费模式为竞价付费则该参数必传。 InstanceMarketOptions *InstanceMarketOptionsRequest `json:"InstanceMarketOptions,omitempty" name:"InstanceMarketOptions"` // 提供给实例使用的用户数据,需要以 base64 方式编码,支持的最大数据大小为 16KB。关于获取此参数的详细介绍,请参阅[Windows](https://cloud.tencent.com/document/product/213/17526)和[Linux](https://cloud.tencent.com/document/product/213/17525)启动时运行命令。 UserData *string `json:"UserData,omitempty" name:"UserData"` // 是否只预检此次请求。 // true:发送检查请求,不会创建实例。检查项包括是否填写了必需参数,请求格式,业务限制和云服务器库存。 // 如果检查不通过,则返回对应错误码; // 如果检查通过,则返回RequestId. // false(默认):发送正常请求,通过检查后直接创建实例 DryRun *bool `json:"DryRun,omitempty" name:"DryRun"` } func (r *RunInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RunInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RunInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 当通过本接口来创建实例时会返回该参数,表示一个或多个实例`ID`。返回实例`ID`列表并不代表实例创建成功,可根据 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) 接口查询返回的InstancesSet中对应实例的`ID`的状态来判断创建是否完成;如果实例状态由“准备中”变为“正在运行”,则为创建成功。 InstanceIdSet []*string `json:"InstanceIdSet,omitempty" name:"InstanceIdSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RunInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RunInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RunMonitorServiceEnabled struct { // 是否开启[云监控](/document/product/248)服务。取值范围:<br><li>TRUE:表示开启云监控服务<br><li>FALSE:表示不开启云监控服务<br><br>默认取值:TRUE。 Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` } type RunSecurityServiceEnabled struct { // 是否开启[云安全](/document/product/296)服务。取值范围:<br><li>TRUE:表示开启云安全服务<br><li>FALSE:表示不开启云安全服务<br><br>默认取值:TRUE。 Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` } type SharePermission struct { // 镜像分享时间 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 镜像分享的账户ID AccountId *string `json:"AccountId,omitempty" name:"AccountId"` } type Snapshot struct { // 快照Id。 SnapshotId *string `json:"SnapshotId,omitempty" name:"SnapshotId"` // 创建此快照的云硬盘类型。取值范围: // SYSTEM_DISK:系统盘 // DATA_DISK:数据盘。 DiskUsage *string `json:"DiskUsage,omitempty" name:"DiskUsage"` // 创建此快照的云硬盘大小,单位GB。 DiskSize *int64 `json:"DiskSize,omitempty" name:"DiskSize"` } type SpotMarketOptions struct { // 竞价出价 MaxPrice *string `json:"MaxPrice,omitempty" name:"MaxPrice"` // 竞价请求类型,当前仅支持类型:one-time SpotInstanceType *string `json:"SpotInstanceType,omitempty" name:"SpotInstanceType"` } type StartInstancesRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` } func (r *StartInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *StartInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type StartInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *StartInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *StartInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type StopInstancesRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` // 是否在正常关闭失败后选择强制关闭实例。取值范围:<br><li>TRUE:表示在正常关闭失败后进行强制关闭<br><li>FALSE:表示在正常关闭失败后不进行强制关闭<br><br>默认取值:FALSE。 ForceStop *bool `json:"ForceStop,omitempty" name:"ForceStop"` // 实例的关闭模式。取值范围:<br><li>SOFT_FIRST:表示在正常关闭失败后进行强制关闭<br><li>HARD:直接强制关闭<br><li>SOFT:仅软关机<br>默认取值:SOFT。 StopType *string `json:"StopType,omitempty" name:"StopType"` // 按量计费实例关机收费模式。 // 取值范围:<br><li>KEEP_CHARGING:关机继续收费<br><li>STOP_CHARGING:关机停止收费<br>默认取值:KEEP_CHARGING。 // 该参数只针对部分按量计费云硬盘实例生效,详情参考[按量计费实例关机不收费说明](https://cloud.tencent.com/document/product/213/19918) StoppedMode *string `json:"StoppedMode,omitempty" name:"StoppedMode"` } func (r *StopInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *StopInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type StopInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *StopInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *StopInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type StorageBlock struct { // HDD本地存储类型,值为:LOCAL_PRO. // 注意:此字段可能返回 null,表示取不到有效值。 Type *string `json:"Type,omitempty" name:"Type"` // HDD本地存储的最小容量 // 注意:此字段可能返回 null,表示取不到有效值。 MinSize *int64 `json:"MinSize,omitempty" name:"MinSize"` // HDD本地存储的最大容量 // 注意:此字段可能返回 null,表示取不到有效值。 MaxSize *int64 `json:"MaxSize,omitempty" name:"MaxSize"` } type SyncImagesRequest struct { *tchttp.BaseRequest // 镜像ID列表 ,镜像ID可以通过如下方式获取:<br><li>通过[DescribeImages](https://cloud.tencent.com/document/api/213/15715)接口返回的`ImageId`获取。<br><li>通过[镜像控制台](https://console.cloud.tencent.com/cvm/image)获取。<br>镜像ID必须满足限制:<br><li>镜像ID对应的镜像状态必须为`NORMAL`。<br><li>镜像大小小于50GB。<br>镜像状态请参考[镜像数据表](https://cloud.tencent.com/document/product/213/15753#Image)。 ImageIds []*string `json:"ImageIds,omitempty" name:"ImageIds" list` // 目的同步地域列表;必须满足限制:<br><li>不能为源地域,<br><li>必须是一个合法的Region。<br><li>暂不支持部分地域同步。<br>具体地域参数请参考[Region](https://cloud.tencent.com/document/product/213/6091)。 DestinationRegions []*string `json:"DestinationRegions,omitempty" name:"DestinationRegions" list` } func (r *SyncImagesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *SyncImagesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type SyncImagesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *SyncImagesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *SyncImagesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type SystemDisk struct { // 系统盘类型。系统盘类型限制详见[存储概述](https://cloud.tencent.com/document/product/213/4952)。取值范围:<br><li>LOCAL_BASIC:本地硬盘<br><li>LOCAL_SSD:本地SSD硬盘<br><li>CLOUD_BASIC:普通云硬盘<br><li>CLOUD_SSD:SSD云硬盘<br><li>CLOUD_PREMIUM:高性能云硬盘<br><br>默认取值:CLOUD_BASIC。 DiskType *string `json:"DiskType,omitempty" name:"DiskType"` // 系统盘ID。LOCAL_BASIC 和 LOCAL_SSD 类型没有ID。暂时不支持该参数。 DiskId *string `json:"DiskId,omitempty" name:"DiskId"` // 系统盘大小,单位:GB。默认值为 50 DiskSize *int64 `json:"DiskSize,omitempty" name:"DiskSize"` } type Tag struct { // 标签键 Key *string `json:"Key,omitempty" name:"Key"` // 标签值 Value *string `json:"Value,omitempty" name:"Value"` } type TagSpecification struct { // 标签绑定的资源类型,当前支持类型:"instance"和"host" ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` // 标签对列表 Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } type TerminateInstancesRequest struct { *tchttp.BaseRequest // 一个或多个待操作的实例ID。可通过[`DescribeInstances`](https://cloud.tencent.com/document/api/213/15728)接口返回值中的`InstanceId`获取。每次请求批量实例的上限为100。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` } func (r *TerminateInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *TerminateInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type TerminateInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *TerminateInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *TerminateInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type VirtualPrivateCloud struct { // 私有网络ID,形如`vpc-xxx`。有效的VpcId可通过登录[控制台](https://console.cloud.tencent.com/vpc/vpc?rid=1)查询;也可以调用接口 [DescribeVpcEx](/document/api/215/1372) ,从接口返回中的`unVpcId`字段获取。若在创建子机时VpcId与SubnetId同时传入`DEFAULT`,则强制使用默认vpc网络。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 私有网络子网ID,形如`subnet-xxx`。有效的私有网络子网ID可通过登录[控制台](https://console.cloud.tencent.com/vpc/subnet?rid=1)查询;也可以调用接口 [DescribeSubnets](/document/api/215/15784) ,从接口返回中的`unSubnetId`字段获取。若在创建子机时SubnetId与VpcId同时传入`DEFAULT`,则强制使用默认vpc网络。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 是否用作公网网关。公网网关只有在实例拥有公网IP以及处于私有网络下时才能正常使用。取值范围:<br><li>TRUE:表示用作公网网关<br><li>FALSE:表示不用作公网网关<br><br>默认取值:FALSE。 AsVpcGateway *bool `json:"AsVpcGateway,omitempty" name:"AsVpcGateway"` // 私有网络子网 IP 数组,在创建实例、修改实例vpc属性操作中可使用此参数。当前仅批量创建多台实例时支持传入相同子网的多个 IP。 PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` // 为弹性网卡指定随机生成的 IPv6 地址数量。 Ipv6AddressCount *uint64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` } type ZoneInfo struct { // 可用区名称,例如,ap-guangzhou-3 // 全网可用区名称如下: // <li> ap-chongqing-1 </li> // <li> ap-seoul-1 </li> // <li> ap-chengdu-1 </li> // <li> ap-chengdu-2 </li> // <li> ap-hongkong-1 </li> // <li> ap-hongkong-2 </li> // <li> ap-shenzhen-fsi-1 </li> // <li> ap-shenzhen-fsi-2 </li> // <li> ap-shenzhen-fsi-3 </li> // <li> ap-guangzhou-1(售罄)</li> // <li> ap-guangzhou-2(售罄)</li> // <li> ap-guangzhou-3 </li> // <li> ap-guangzhou-4 </li> // <li> ap-tokyo-1 </li> // <li> ap-singapore-1 </li> // <li> ap-shanghai-fsi-1 </li> // <li> ap-shanghai-fsi-2 </li> // <li> ap-shanghai-fsi-3 </li> // <li> ap-bangkok-1 </li> // <li> ap-shanghai-1(售罄) </li> // <li> ap-shanghai-2 </li> // <li> ap-shanghai-3 </li> // <li> ap-shanghai-4 </li> // <li> ap-mumbai-1 </li> // <li> ap-mumbai-2 </li> // <li> eu-moscow-1 </li> // <li> ap-beijing-1 </li> // <li> ap-beijing-2 </li> // <li> ap-beijing-3 </li> // <li> ap-beijing-4 </li> // <li> na-siliconvalley-1 </li> // <li> na-siliconvalley-2 </li> // <li> eu-frankfurt-1 </li> // <li> na-toronto-1 </li> // <li> na-ashburn-1 </li> // <li> na-ashburn-2 </li> // <li> ap-nanjing-1 </li> // <li> ap-nanjing-2 </li> Zone *string `json:"Zone,omitempty" name:"Zone"` // 可用区描述,例如,广州三区 ZoneName *string `json:"ZoneName,omitempty" name:"ZoneName"` // 可用区ID ZoneId *string `json:"ZoneId,omitempty" name:"ZoneId"` // 可用区状态,包含AVAILABLE和UNAVAILABLE。AVAILABLE代表可用,UNAVAILABLE代表不可用。 ZoneState *string `json:"ZoneState,omitempty" name:"ZoneState"` } ������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/���������������0000775�0000000�0000000�00000000000�13771713062�0030636�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/�����0000775�0000000�0000000�00000000000�13771713062�0031723�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������client.go�������������������������������������������������������������������������������������������0000664�0000000�0000000�00000645675�13771713062�0033500�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312�������������������������������������������������������������������������// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package v20170312 import ( "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile" ) const APIVersion = "2017-03-12" type Client struct { common.Client } // Deprecated func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) { cpf := profile.NewClientProfile() client = &Client{} client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf) return } func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error) { client = &Client{} client.Init(region). WithCredential(credential). WithProfile(clientProfile) return } func NewAcceptAttachCcnInstancesRequest() (request *AcceptAttachCcnInstancesRequest) { request = &AcceptAttachCcnInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AcceptAttachCcnInstances") return } func NewAcceptAttachCcnInstancesResponse() (response *AcceptAttachCcnInstancesResponse) { response = &AcceptAttachCcnInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AcceptAttachCcnInstances)用于跨账号关联实例时,云联网所有者接受并同意关联操作。 func (c *Client) AcceptAttachCcnInstances(request *AcceptAttachCcnInstancesRequest) (response *AcceptAttachCcnInstancesResponse, err error) { if request == nil { request = NewAcceptAttachCcnInstancesRequest() } response = NewAcceptAttachCcnInstancesResponse() err = c.Send(request, response) return } func NewAddBandwidthPackageResourcesRequest() (request *AddBandwidthPackageResourcesRequest) { request = &AddBandwidthPackageResourcesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AddBandwidthPackageResources") return } func NewAddBandwidthPackageResourcesResponse() (response *AddBandwidthPackageResourcesResponse) { response = &AddBandwidthPackageResourcesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 接口用于添加带宽包资源,包括[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)和[负载均衡](https://cloud.tencent.com/document/product/214/517)等 func (c *Client) AddBandwidthPackageResources(request *AddBandwidthPackageResourcesRequest) (response *AddBandwidthPackageResourcesResponse, err error) { if request == nil { request = NewAddBandwidthPackageResourcesRequest() } response = NewAddBandwidthPackageResourcesResponse() err = c.Send(request, response) return } func NewAddIp6RulesRequest() (request *AddIp6RulesRequest) { request = &AddIp6RulesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AddIp6Rules") return } func NewAddIp6RulesResponse() (response *AddIp6RulesResponse) { response = &AddIp6RulesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 1. 该接口用于在转换实例下添加IPV6转换规则。 // 2. 支持在同一个转换实例下批量添加转换规则,一个账户在一个地域最多50个。 // 3. 一个完整的转换规则包括vip6:vport6:protocol:vip:vport,其中vip6:vport6:protocol必须是唯一。 func (c *Client) AddIp6Rules(request *AddIp6RulesRequest) (response *AddIp6RulesResponse, err error) { if request == nil { request = NewAddIp6RulesRequest() } response = NewAddIp6RulesResponse() err = c.Send(request, response) return } func NewAllocateAddressesRequest() (request *AllocateAddressesRequest) { request = &AllocateAddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AllocateAddresses") return } func NewAllocateAddressesResponse() (response *AllocateAddressesResponse) { response = &AllocateAddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (AllocateAddresses) 用于申请一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 // * EIP 是专为动态云计算设计的静态 IP 地址。借助 EIP,您可以快速将 EIP 重新映射到您的另一个实例上,从而屏蔽实例故障。 // * 您的 EIP 与腾讯云账户相关联,而不是与某个实例相关联。在您选择显式释放该地址,或欠费超过24小时之前,它会一直与您的腾讯云账户保持关联。 // * 一个腾讯云账户在每个地域能申请的 EIP 最大配额有所限制,可参见 [EIP 产品简介](https://cloud.tencent.com/document/product/213/5733),上述配额可通过 DescribeAddressQuota 接口获取。 func (c *Client) AllocateAddresses(request *AllocateAddressesRequest) (response *AllocateAddressesResponse, err error) { if request == nil { request = NewAllocateAddressesRequest() } response = NewAllocateAddressesResponse() err = c.Send(request, response) return } func NewAllocateIp6AddressesBandwidthRequest() (request *AllocateIp6AddressesBandwidthRequest) { request = &AllocateIp6AddressesBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AllocateIp6AddressesBandwidth") return } func NewAllocateIp6AddressesBandwidthResponse() (response *AllocateIp6AddressesBandwidthResponse) { response = &AllocateIp6AddressesBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 该接口用于给IPv6地址初次分配公网带宽 func (c *Client) AllocateIp6AddressesBandwidth(request *AllocateIp6AddressesBandwidthRequest) (response *AllocateIp6AddressesBandwidthResponse, err error) { if request == nil { request = NewAllocateIp6AddressesBandwidthRequest() } response = NewAllocateIp6AddressesBandwidthResponse() err = c.Send(request, response) return } func NewAssignIpv6AddressesRequest() (request *AssignIpv6AddressesRequest) { request = &AssignIpv6AddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6Addresses") return } func NewAssignIpv6AddressesResponse() (response *AssignIpv6AddressesResponse) { response = &AssignIpv6AddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssignIpv6Addresses)用于弹性网卡申请`IPv6`地址。<br /> // 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口。 // * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见<a href="/document/product/576/18527">弹性网卡使用限制</a>。 // * 可以指定`IPv6`地址申请,地址类型不能为主`IP`,`IPv6`地址暂时只支持作为辅助`IP`。 // * 地址必须要在弹性网卡所在子网内,而且不能被占用。 // * 在弹性网卡上申请一个到多个辅助`IPv6`地址,接口会在弹性网卡所在子网段内返回指定数量的辅助`IPv6`地址。 func (c *Client) AssignIpv6Addresses(request *AssignIpv6AddressesRequest) (response *AssignIpv6AddressesResponse, err error) { if request == nil { request = NewAssignIpv6AddressesRequest() } response = NewAssignIpv6AddressesResponse() err = c.Send(request, response) return } func NewAssignIpv6CidrBlockRequest() (request *AssignIpv6CidrBlockRequest) { request = &AssignIpv6CidrBlockRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6CidrBlock") return } func NewAssignIpv6CidrBlockResponse() (response *AssignIpv6CidrBlockResponse) { response = &AssignIpv6CidrBlockResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssignIpv6CidrBlock)用于分配IPv6网段。 // * 使用本接口前,您需要已有VPC实例,如果没有可通过接口<a href="https://cloud.tencent.com/document/api/215/15774" title="CreateVpc" target="_blank">CreateVpc</a>创建。 // * 每个VPC只能申请一个IPv6网段 func (c *Client) AssignIpv6CidrBlock(request *AssignIpv6CidrBlockRequest) (response *AssignIpv6CidrBlockResponse, err error) { if request == nil { request = NewAssignIpv6CidrBlockRequest() } response = NewAssignIpv6CidrBlockResponse() err = c.Send(request, response) return } func NewAssignIpv6SubnetCidrBlockRequest() (request *AssignIpv6SubnetCidrBlockRequest) { request = &AssignIpv6SubnetCidrBlockRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssignIpv6SubnetCidrBlock") return } func NewAssignIpv6SubnetCidrBlockResponse() (response *AssignIpv6SubnetCidrBlockResponse) { response = &AssignIpv6SubnetCidrBlockResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssignIpv6SubnetCidrBlock)用于分配IPv6子网段。 // * 给子网分配 `IPv6` 网段,要求子网所属 `VPC` 已获得 `IPv6` 网段。如果尚未分配,请先通过接口 `AssignIpv6CidrBlock` 给子网所属 `VPC` 分配一个 `IPv6` 网段。否则无法分配 `IPv6` 子网段。 // * 每个子网只能分配一个IPv6网段。 func (c *Client) AssignIpv6SubnetCidrBlock(request *AssignIpv6SubnetCidrBlockRequest) (response *AssignIpv6SubnetCidrBlockResponse, err error) { if request == nil { request = NewAssignIpv6SubnetCidrBlockRequest() } response = NewAssignIpv6SubnetCidrBlockResponse() err = c.Send(request, response) return } func NewAssignPrivateIpAddressesRequest() (request *AssignPrivateIpAddressesRequest) { request = &AssignPrivateIpAddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssignPrivateIpAddresses") return } func NewAssignPrivateIpAddressesResponse() (response *AssignPrivateIpAddressesResponse) { response = &AssignPrivateIpAddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssignPrivateIpAddresses)用于弹性网卡申请内网 IP。 // * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见<a href="/document/product/576/18527">弹性网卡使用限制</a>。 // * 可以指定内网IP地址申请,内网IP地址类型不能为主IP,主IP已存在,不能修改,内网IP必须要弹性网卡所在子网内,而且不能被占用。 // * 在弹性网卡上申请一个到多个辅助内网IP,接口会在弹性网卡所在子网网段内返回指定数量的辅助内网IP。 func (c *Client) AssignPrivateIpAddresses(request *AssignPrivateIpAddressesRequest) (response *AssignPrivateIpAddressesResponse, err error) { if request == nil { request = NewAssignPrivateIpAddressesRequest() } response = NewAssignPrivateIpAddressesResponse() err = c.Send(request, response) return } func NewAssociateAddressRequest() (request *AssociateAddressRequest) { request = &AssociateAddressRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssociateAddress") return } func NewAssociateAddressResponse() (response *AssociateAddressResponse) { response = &AssociateAddressResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (AssociateAddress) 用于将[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)绑定到实例或弹性网卡的指定内网 IP 上。 // * 将 EIP 绑定到实例(CVM)上,其本质是将 EIP 绑定到实例上主网卡的主内网 IP 上。 // * 将 EIP 绑定到主网卡的主内网IP上,绑定过程会把其上绑定的普通公网 IP 自动解绑并释放。 // * 将 EIP 绑定到指定网卡的内网 IP上(非主网卡的主内网IP),则必须先解绑该 EIP,才能再绑定新的。 // * 将 EIP 绑定到NAT网关,请使用接口[EipBindNatGateway](https://cloud.tencent.com/document/product/215/4093) // * EIP 如果欠费或被封堵,则不能被绑定。 // * 只有状态为 UNBIND 的 EIP 才能够被绑定。 func (c *Client) AssociateAddress(request *AssociateAddressRequest) (response *AssociateAddressResponse, err error) { if request == nil { request = NewAssociateAddressRequest() } response = NewAssociateAddressResponse() err = c.Send(request, response) return } func NewAssociateDhcpIpWithAddressIpRequest() (request *AssociateDhcpIpWithAddressIpRequest) { request = &AssociateDhcpIpWithAddressIpRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssociateDhcpIpWithAddressIp") return } func NewAssociateDhcpIpWithAddressIpResponse() (response *AssociateDhcpIpWithAddressIpResponse) { response = &AssociateDhcpIpWithAddressIpResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssociateDhcpIpWithAddressIp)用于DhcpIp绑定弹性公网IP(EIP)。<br /> func (c *Client) AssociateDhcpIpWithAddressIp(request *AssociateDhcpIpWithAddressIpRequest) (response *AssociateDhcpIpWithAddressIpResponse, err error) { if request == nil { request = NewAssociateDhcpIpWithAddressIpRequest() } response = NewAssociateDhcpIpWithAddressIpResponse() err = c.Send(request, response) return } func NewAssociateNatGatewayAddressRequest() (request *AssociateNatGatewayAddressRequest) { request = &AssociateNatGatewayAddressRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssociateNatGatewayAddress") return } func NewAssociateNatGatewayAddressResponse() (response *AssociateNatGatewayAddressResponse) { response = &AssociateNatGatewayAddressResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssociateNatGatewayAddress)用于NAT网关绑定弹性IP(EIP)。 func (c *Client) AssociateNatGatewayAddress(request *AssociateNatGatewayAddressRequest) (response *AssociateNatGatewayAddressResponse, err error) { if request == nil { request = NewAssociateNatGatewayAddressRequest() } response = NewAssociateNatGatewayAddressResponse() err = c.Send(request, response) return } func NewAssociateNetworkAclSubnetsRequest() (request *AssociateNetworkAclSubnetsRequest) { request = &AssociateNetworkAclSubnetsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssociateNetworkAclSubnets") return } func NewAssociateNetworkAclSubnetsResponse() (response *AssociateNetworkAclSubnetsResponse) { response = &AssociateNetworkAclSubnetsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssociateNetworkAclSubnets)用于网络ACL关联vpc下的子网。 func (c *Client) AssociateNetworkAclSubnets(request *AssociateNetworkAclSubnetsRequest) (response *AssociateNetworkAclSubnetsResponse, err error) { if request == nil { request = NewAssociateNetworkAclSubnetsRequest() } response = NewAssociateNetworkAclSubnetsResponse() err = c.Send(request, response) return } func NewAssociateNetworkInterfaceSecurityGroupsRequest() (request *AssociateNetworkInterfaceSecurityGroupsRequest) { request = &AssociateNetworkInterfaceSecurityGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AssociateNetworkInterfaceSecurityGroups") return } func NewAssociateNetworkInterfaceSecurityGroupsResponse() (response *AssociateNetworkInterfaceSecurityGroupsResponse) { response = &AssociateNetworkInterfaceSecurityGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AssociateNetworkInterfaceSecurityGroups)用于弹性网卡绑定安全组(SecurityGroup)。 func (c *Client) AssociateNetworkInterfaceSecurityGroups(request *AssociateNetworkInterfaceSecurityGroupsRequest) (response *AssociateNetworkInterfaceSecurityGroupsResponse, err error) { if request == nil { request = NewAssociateNetworkInterfaceSecurityGroupsRequest() } response = NewAssociateNetworkInterfaceSecurityGroupsResponse() err = c.Send(request, response) return } func NewAttachCcnInstancesRequest() (request *AttachCcnInstancesRequest) { request = &AttachCcnInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AttachCcnInstances") return } func NewAttachCcnInstancesResponse() (response *AttachCcnInstancesResponse) { response = &AttachCcnInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AttachCcnInstances)用于将网络实例加载到云联网实例中,网络实例包括VPC和专线网关。<br /> // 每个云联网能够关联的网络实例个数是有限的,详请参考产品文档。如果需要扩充请联系在线客服。 func (c *Client) AttachCcnInstances(request *AttachCcnInstancesRequest) (response *AttachCcnInstancesResponse, err error) { if request == nil { request = NewAttachCcnInstancesRequest() } response = NewAttachCcnInstancesResponse() err = c.Send(request, response) return } func NewAttachClassicLinkVpcRequest() (request *AttachClassicLinkVpcRequest) { request = &AttachClassicLinkVpcRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AttachClassicLinkVpc") return } func NewAttachClassicLinkVpcResponse() (response *AttachClassicLinkVpcResponse) { response = &AttachClassicLinkVpcResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AttachClassicLinkVpc)用于创建私有网络和基础网络设备互通。 // * 私有网络和基础网络设备必须在同一个地域。 // * 私有网络和基础网络的区别详见vpc产品文档-<a href="https://cloud.tencent.com/document/product/215/30720">私有网络与基础网络</a>。 func (c *Client) AttachClassicLinkVpc(request *AttachClassicLinkVpcRequest) (response *AttachClassicLinkVpcResponse, err error) { if request == nil { request = NewAttachClassicLinkVpcRequest() } response = NewAttachClassicLinkVpcResponse() err = c.Send(request, response) return } func NewAttachNetworkInterfaceRequest() (request *AttachNetworkInterfaceRequest) { request = &AttachNetworkInterfaceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "AttachNetworkInterface") return } func NewAttachNetworkInterfaceResponse() (response *AttachNetworkInterfaceResponse) { response = &AttachNetworkInterfaceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(AttachNetworkInterface)用于弹性网卡绑定云主机。 // * 一个云主机可以绑定多个弹性网卡,但只能绑定一个主网卡。更多限制信息详见<a href="https://cloud.tencent.com/document/product/576/18527">弹性网卡使用限制</a>。 // * 一个弹性网卡只能同时绑定一个云主机。 // * 只有运行中或者已关机状态的云主机才能绑定弹性网卡,查看云主机状态详见<a href="https://cloud.tencent.com/document/api/213/9452#InstanceStatus">腾讯云主机信息</a>。 // * 弹性网卡绑定的云主机必须是私有网络的,而且云主机所在可用区必须和弹性网卡子网的可用区相同。 func (c *Client) AttachNetworkInterface(request *AttachNetworkInterfaceRequest) (response *AttachNetworkInterfaceResponse, err error) { if request == nil { request = NewAttachNetworkInterfaceRequest() } response = NewAttachNetworkInterfaceResponse() err = c.Send(request, response) return } func NewCheckAssistantCidrRequest() (request *CheckAssistantCidrRequest) { request = &CheckAssistantCidrRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CheckAssistantCidr") return } func NewCheckAssistantCidrResponse() (response *CheckAssistantCidrResponse) { response = &CheckAssistantCidrResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CheckAssistantCidr)用于检查辅助CIDR是否与存量路由、对等连接(对端VPC的CIDR)等资源存在冲突。如果存在重叠,则返回重叠的资源。(接口灰度中,如需使用请提工单。) // * 检测辅助CIDR是否与当前VPC的主CIDR和辅助CIDR存在重叠。 // * 检测辅助CIDR是否与当前VPC的路由的目的端存在重叠。 // * 检测辅助CIDR是否与当前VPC的对等连接,对端VPC下的主CIDR或辅助CIDR存在重叠。 func (c *Client) CheckAssistantCidr(request *CheckAssistantCidrRequest) (response *CheckAssistantCidrResponse, err error) { if request == nil { request = NewCheckAssistantCidrRequest() } response = NewCheckAssistantCidrResponse() err = c.Send(request, response) return } func NewCheckDefaultSubnetRequest() (request *CheckDefaultSubnetRequest) { request = &CheckDefaultSubnetRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CheckDefaultSubnet") return } func NewCheckDefaultSubnetResponse() (response *CheckDefaultSubnetResponse) { response = &CheckDefaultSubnetResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CheckDefaultSubnet)用于预判是否可建默认子网。 func (c *Client) CheckDefaultSubnet(request *CheckDefaultSubnetRequest) (response *CheckDefaultSubnetResponse, err error) { if request == nil { request = NewCheckDefaultSubnetRequest() } response = NewCheckDefaultSubnetResponse() err = c.Send(request, response) return } func NewCheckNetDetectStateRequest() (request *CheckNetDetectStateRequest) { request = &CheckNetDetectStateRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CheckNetDetectState") return } func NewCheckNetDetectStateResponse() (response *CheckNetDetectStateResponse) { response = &CheckNetDetectStateResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CheckNetDetectState)用于验证网络探测。 func (c *Client) CheckNetDetectState(request *CheckNetDetectStateRequest) (response *CheckNetDetectStateResponse, err error) { if request == nil { request = NewCheckNetDetectStateRequest() } response = NewCheckNetDetectStateResponse() err = c.Send(request, response) return } func NewCreateAddressTemplateRequest() (request *CreateAddressTemplateRequest) { request = &CreateAddressTemplateRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateAddressTemplate") return } func NewCreateAddressTemplateResponse() (response *CreateAddressTemplateResponse) { response = &CreateAddressTemplateResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateAddressTemplate)用于创建IP地址模版 func (c *Client) CreateAddressTemplate(request *CreateAddressTemplateRequest) (response *CreateAddressTemplateResponse, err error) { if request == nil { request = NewCreateAddressTemplateRequest() } response = NewCreateAddressTemplateResponse() err = c.Send(request, response) return } func NewCreateAddressTemplateGroupRequest() (request *CreateAddressTemplateGroupRequest) { request = &CreateAddressTemplateGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateAddressTemplateGroup") return } func NewCreateAddressTemplateGroupResponse() (response *CreateAddressTemplateGroupResponse) { response = &CreateAddressTemplateGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateAddressTemplateGroup)用于创建IP地址模版集合 func (c *Client) CreateAddressTemplateGroup(request *CreateAddressTemplateGroupRequest) (response *CreateAddressTemplateGroupResponse, err error) { if request == nil { request = NewCreateAddressTemplateGroupRequest() } response = NewCreateAddressTemplateGroupResponse() err = c.Send(request, response) return } func NewCreateAndAttachNetworkInterfaceRequest() (request *CreateAndAttachNetworkInterfaceRequest) { request = &CreateAndAttachNetworkInterfaceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateAndAttachNetworkInterface") return } func NewCreateAndAttachNetworkInterfaceResponse() (response *CreateAndAttachNetworkInterfaceResponse) { response = &CreateAndAttachNetworkInterfaceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateAndAttachNetworkInterface)用于创建弹性网卡并绑定云主机。 // * 创建弹性网卡时可以指定内网IP,并且可以指定一个主IP,指定的内网IP必须在弹性网卡所在子网内,而且不能被占用。 // * 创建弹性网卡时可以指定需要申请的内网IP数量,系统会随机生成内网IP地址。 // * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见<a href="/document/product/576/18527">弹性网卡使用限制</a>。 // * 创建弹性网卡同时可以绑定已有安全组。 // * 创建弹性网卡同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateAndAttachNetworkInterface(request *CreateAndAttachNetworkInterfaceRequest) (response *CreateAndAttachNetworkInterfaceResponse, err error) { if request == nil { request = NewCreateAndAttachNetworkInterfaceRequest() } response = NewCreateAndAttachNetworkInterfaceResponse() err = c.Send(request, response) return } func NewCreateAssistantCidrRequest() (request *CreateAssistantCidrRequest) { request = &CreateAssistantCidrRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateAssistantCidr") return } func NewCreateAssistantCidrResponse() (response *CreateAssistantCidrResponse) { response = &CreateAssistantCidrResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateAssistantCidr)用于批量创建辅助CIDR。(接口灰度中,如需使用请提工单。) func (c *Client) CreateAssistantCidr(request *CreateAssistantCidrRequest) (response *CreateAssistantCidrResponse, err error) { if request == nil { request = NewCreateAssistantCidrRequest() } response = NewCreateAssistantCidrResponse() err = c.Send(request, response) return } func NewCreateBandwidthPackageRequest() (request *CreateBandwidthPackageRequest) { request = &CreateBandwidthPackageRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateBandwidthPackage") return } func NewCreateBandwidthPackageResponse() (response *CreateBandwidthPackageResponse) { response = &CreateBandwidthPackageResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 接口支持创建[设备带宽包](https://cloud.tencent.com/document/product/684/15246#.E8.AE.BE.E5.A4.87.E5.B8.A6.E5.AE.BD.E5.8C.85)和[IP带宽包](https://cloud.tencent.com/document/product/684/15246#ip-.E5.B8.A6.E5.AE.BD.E5.8C.85) func (c *Client) CreateBandwidthPackage(request *CreateBandwidthPackageRequest) (response *CreateBandwidthPackageResponse, err error) { if request == nil { request = NewCreateBandwidthPackageRequest() } response = NewCreateBandwidthPackageResponse() err = c.Send(request, response) return } func NewCreateCcnRequest() (request *CreateCcnRequest) { request = &CreateCcnRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateCcn") return } func NewCreateCcnResponse() (response *CreateCcnResponse) { response = &CreateCcnResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateCcn)用于创建云联网(CCN)。<br /> // * 创建云联网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 // 每个账号能创建的云联网实例个数是有限的,详请参考产品文档。如果需要扩充请联系在线客服。 func (c *Client) CreateCcn(request *CreateCcnRequest) (response *CreateCcnResponse, err error) { if request == nil { request = NewCreateCcnRequest() } response = NewCreateCcnResponse() err = c.Send(request, response) return } func NewCreateCustomerGatewayRequest() (request *CreateCustomerGatewayRequest) { request = &CreateCustomerGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateCustomerGateway") return } func NewCreateCustomerGatewayResponse() (response *CreateCustomerGatewayResponse) { response = &CreateCustomerGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateCustomerGateway)用于创建对端网关。 func (c *Client) CreateCustomerGateway(request *CreateCustomerGatewayRequest) (response *CreateCustomerGatewayResponse, err error) { if request == nil { request = NewCreateCustomerGatewayRequest() } response = NewCreateCustomerGatewayResponse() err = c.Send(request, response) return } func NewCreateDefaultSecurityGroupRequest() (request *CreateDefaultSecurityGroupRequest) { request = &CreateDefaultSecurityGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateDefaultSecurityGroup") return } func NewCreateDefaultSecurityGroupResponse() (response *CreateDefaultSecurityGroupResponse) { response = &CreateDefaultSecurityGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateDefaultSecurityGroup)用于创建(如果项目下未存在默认安全组,则创建;已存在则获取。)默认安全组(SecurityGroup)。 // * 每个账户下每个地域的每个项目的<a href="https://cloud.tencent.com/document/product/213/12453">安全组数量限制</a>。 // * 新建的安全组的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用CreateSecurityGroupPolicies将安全组的规则设置为需要的规则。 // * 创建安全组同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateDefaultSecurityGroup(request *CreateDefaultSecurityGroupRequest) (response *CreateDefaultSecurityGroupResponse, err error) { if request == nil { request = NewCreateDefaultSecurityGroupRequest() } response = NewCreateDefaultSecurityGroupResponse() err = c.Send(request, response) return } func NewCreateDefaultVpcRequest() (request *CreateDefaultVpcRequest) { request = &CreateDefaultVpcRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateDefaultVpc") return } func NewCreateDefaultVpcResponse() (response *CreateDefaultVpcResponse) { response = &CreateDefaultVpcResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateDefaultVpc)用于创建默认私有网络(VPC)。 // // 默认VPC适用于快速入门和启动公共实例,您可以像使用任何其他VPC一样使用默认VPC。如果您想创建标准VPC,即指定VPC名称、VPC网段、子网网段、子网可用区,请使用常规创建VPC接口(CreateVpc) // // 正常情况,本接口并不一定生产默认VPC,而是根据用户账号的网络属性(DescribeAccountAttributes)来决定的 // * 支持基础网络、VPC,返回VpcId为0 // * 只支持VPC,返回默认VPC信息 // // 您也可以通过 Force 参数,强制返回默认VPC func (c *Client) CreateDefaultVpc(request *CreateDefaultVpcRequest) (response *CreateDefaultVpcResponse, err error) { if request == nil { request = NewCreateDefaultVpcRequest() } response = NewCreateDefaultVpcResponse() err = c.Send(request, response) return } func NewCreateDhcpIpRequest() (request *CreateDhcpIpRequest) { request = &CreateDhcpIpRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateDhcpIp") return } func NewCreateDhcpIpResponse() (response *CreateDhcpIpResponse) { response = &CreateDhcpIpResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateDhcpIp)用于创建DhcpIp func (c *Client) CreateDhcpIp(request *CreateDhcpIpRequest) (response *CreateDhcpIpResponse, err error) { if request == nil { request = NewCreateDhcpIpRequest() } response = NewCreateDhcpIpResponse() err = c.Send(request, response) return } func NewCreateDirectConnectGatewayRequest() (request *CreateDirectConnectGatewayRequest) { request = &CreateDirectConnectGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateDirectConnectGateway") return } func NewCreateDirectConnectGatewayResponse() (response *CreateDirectConnectGatewayResponse) { response = &CreateDirectConnectGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateDirectConnectGateway)用于创建专线网关。 func (c *Client) CreateDirectConnectGateway(request *CreateDirectConnectGatewayRequest) (response *CreateDirectConnectGatewayResponse, err error) { if request == nil { request = NewCreateDirectConnectGatewayRequest() } response = NewCreateDirectConnectGatewayResponse() err = c.Send(request, response) return } func NewCreateDirectConnectGatewayCcnRoutesRequest() (request *CreateDirectConnectGatewayCcnRoutesRequest) { request = &CreateDirectConnectGatewayCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateDirectConnectGatewayCcnRoutes") return } func NewCreateDirectConnectGatewayCcnRoutesResponse() (response *CreateDirectConnectGatewayCcnRoutesResponse) { response = &CreateDirectConnectGatewayCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateDirectConnectGatewayCcnRoutes)用于创建专线网关的云联网路由(IDC网段) func (c *Client) CreateDirectConnectGatewayCcnRoutes(request *CreateDirectConnectGatewayCcnRoutesRequest) (response *CreateDirectConnectGatewayCcnRoutesResponse, err error) { if request == nil { request = NewCreateDirectConnectGatewayCcnRoutesRequest() } response = NewCreateDirectConnectGatewayCcnRoutesResponse() err = c.Send(request, response) return } func NewCreateFlowLogRequest() (request *CreateFlowLogRequest) { request = &CreateFlowLogRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateFlowLog") return } func NewCreateFlowLogResponse() (response *CreateFlowLogResponse) { response = &CreateFlowLogResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateFlowLog)用于创建流日志 func (c *Client) CreateFlowLog(request *CreateFlowLogRequest) (response *CreateFlowLogResponse, err error) { if request == nil { request = NewCreateFlowLogRequest() } response = NewCreateFlowLogResponse() err = c.Send(request, response) return } func NewCreateHaVipRequest() (request *CreateHaVipRequest) { request = &CreateHaVipRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateHaVip") return } func NewCreateHaVipResponse() (response *CreateHaVipResponse) { response = &CreateHaVipResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateHaVip)用于创建高可用虚拟IP(HAVIP) func (c *Client) CreateHaVip(request *CreateHaVipRequest) (response *CreateHaVipResponse, err error) { if request == nil { request = NewCreateHaVipRequest() } response = NewCreateHaVipResponse() err = c.Send(request, response) return } func NewCreateIp6TranslatorsRequest() (request *CreateIp6TranslatorsRequest) { request = &CreateIp6TranslatorsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateIp6Translators") return } func NewCreateIp6TranslatorsResponse() (response *CreateIp6TranslatorsResponse) { response = &CreateIp6TranslatorsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 1. 该接口用于创建IPV6转换IPV4实例,支持批量 // 2. 同一个账户在一个地域最多允许创建10个转换实例 func (c *Client) CreateIp6Translators(request *CreateIp6TranslatorsRequest) (response *CreateIp6TranslatorsResponse, err error) { if request == nil { request = NewCreateIp6TranslatorsRequest() } response = NewCreateIp6TranslatorsResponse() err = c.Send(request, response) return } func NewCreateNatGatewayRequest() (request *CreateNatGatewayRequest) { request = &CreateNatGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateNatGateway") return } func NewCreateNatGatewayResponse() (response *CreateNatGatewayResponse) { response = &CreateNatGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateNatGateway)用于创建NAT网关。 func (c *Client) CreateNatGateway(request *CreateNatGatewayRequest) (response *CreateNatGatewayResponse, err error) { if request == nil { request = NewCreateNatGatewayRequest() } response = NewCreateNatGatewayResponse() err = c.Send(request, response) return } func NewCreateNatGatewayDestinationIpPortTranslationNatRuleRequest() (request *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) { request = &CreateNatGatewayDestinationIpPortTranslationNatRuleRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateNatGatewayDestinationIpPortTranslationNatRule") return } func NewCreateNatGatewayDestinationIpPortTranslationNatRuleResponse() (response *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse) { response = &CreateNatGatewayDestinationIpPortTranslationNatRuleResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateNatGatewayDestinationIpPortTranslationNatRule)用于创建NAT网关端口转发规则。 func (c *Client) CreateNatGatewayDestinationIpPortTranslationNatRule(request *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { if request == nil { request = NewCreateNatGatewayDestinationIpPortTranslationNatRuleRequest() } response = NewCreateNatGatewayDestinationIpPortTranslationNatRuleResponse() err = c.Send(request, response) return } func NewCreateNetDetectRequest() (request *CreateNetDetectRequest) { request = &CreateNetDetectRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateNetDetect") return } func NewCreateNetDetectResponse() (response *CreateNetDetectResponse) { response = &CreateNetDetectResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateNetDetect)用于创建网络探测。 func (c *Client) CreateNetDetect(request *CreateNetDetectRequest) (response *CreateNetDetectResponse, err error) { if request == nil { request = NewCreateNetDetectRequest() } response = NewCreateNetDetectResponse() err = c.Send(request, response) return } func NewCreateNetworkAclRequest() (request *CreateNetworkAclRequest) { request = &CreateNetworkAclRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateNetworkAcl") return } func NewCreateNetworkAclResponse() (response *CreateNetworkAclResponse) { response = &CreateNetworkAclResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateNetworkAcl)用于创建新的<a href="https://cloud.tencent.com/document/product/215/20088">网络ACL</a>。 // * 新建的网络ACL的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用ModifyNetworkAclEntries将网络ACL的规则设置为需要的规则。 func (c *Client) CreateNetworkAcl(request *CreateNetworkAclRequest) (response *CreateNetworkAclResponse, err error) { if request == nil { request = NewCreateNetworkAclRequest() } response = NewCreateNetworkAclResponse() err = c.Send(request, response) return } func NewCreateNetworkInterfaceRequest() (request *CreateNetworkInterfaceRequest) { request = &CreateNetworkInterfaceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateNetworkInterface") return } func NewCreateNetworkInterfaceResponse() (response *CreateNetworkInterfaceResponse) { response = &CreateNetworkInterfaceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateNetworkInterface)用于创建弹性网卡。 // * 创建弹性网卡时可以指定内网IP,并且可以指定一个主IP,指定的内网IP必须在弹性网卡所在子网内,而且不能被占用。 // * 创建弹性网卡时可以指定需要申请的内网IP数量,系统会随机生成内网IP地址。 // * 一个弹性网卡支持绑定的IP地址是有限制的,更多资源限制信息详见<a href="/document/product/576/18527">弹性网卡使用限制</a>。 // * 创建弹性网卡同时可以绑定已有安全组。 // * 创建弹性网卡同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateNetworkInterface(request *CreateNetworkInterfaceRequest) (response *CreateNetworkInterfaceResponse, err error) { if request == nil { request = NewCreateNetworkInterfaceRequest() } response = NewCreateNetworkInterfaceResponse() err = c.Send(request, response) return } func NewCreateRouteTableRequest() (request *CreateRouteTableRequest) { request = &CreateRouteTableRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateRouteTable") return } func NewCreateRouteTableResponse() (response *CreateRouteTableResponse) { response = &CreateRouteTableResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateRouteTable)用于创建路由表。 // * 创建了VPC后,系统会创建一个默认路由表,所有新建的子网都会关联到默认路由表。默认情况下您可以直接使用默认路由表来管理您的路由策略。当您的路由策略较多时,您可以调用创建路由表接口创建更多路由表管理您的路由策略。 // * 创建路由表同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateRouteTable(request *CreateRouteTableRequest) (response *CreateRouteTableResponse, err error) { if request == nil { request = NewCreateRouteTableRequest() } response = NewCreateRouteTableResponse() err = c.Send(request, response) return } func NewCreateRoutesRequest() (request *CreateRoutesRequest) { request = &CreateRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateRoutes") return } func NewCreateRoutesResponse() (response *CreateRoutesResponse) { response = &CreateRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateRoutes)用于创建路由策略。 // * 向指定路由表批量新增路由策略。 func (c *Client) CreateRoutes(request *CreateRoutesRequest) (response *CreateRoutesResponse, err error) { if request == nil { request = NewCreateRoutesRequest() } response = NewCreateRoutesResponse() err = c.Send(request, response) return } func NewCreateSecurityGroupRequest() (request *CreateSecurityGroupRequest) { request = &CreateSecurityGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateSecurityGroup") return } func NewCreateSecurityGroupResponse() (response *CreateSecurityGroupResponse) { response = &CreateSecurityGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateSecurityGroup)用于创建新的安全组(SecurityGroup)。 // * 每个账户下每个地域的每个项目的<a href="https://cloud.tencent.com/document/product/213/12453">安全组数量限制</a>。 // * 新建的安全组的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用CreateSecurityGroupPolicies将安全组的规则设置为需要的规则。 // * 创建安全组同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateSecurityGroup(request *CreateSecurityGroupRequest) (response *CreateSecurityGroupResponse, err error) { if request == nil { request = NewCreateSecurityGroupRequest() } response = NewCreateSecurityGroupResponse() err = c.Send(request, response) return } func NewCreateSecurityGroupPoliciesRequest() (request *CreateSecurityGroupPoliciesRequest) { request = &CreateSecurityGroupPoliciesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateSecurityGroupPolicies") return } func NewCreateSecurityGroupPoliciesResponse() (response *CreateSecurityGroupPoliciesResponse) { response = &CreateSecurityGroupPoliciesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateSecurityGroupPolicies)用于创建安全组规则(SecurityGroupPolicy)。 // // 在 SecurityGroupPolicySet 参数中: // <ul> // <li>Version 安全组规则版本号,用户每次更新安全规则版本会自动加1,防止您更新的路由规则已过期,不填不考虑冲突。</li> // <li>在创建出站和入站规则(Egress 和 Ingress)时:<ul> // <li>Protocol 字段支持输入TCP, UDP, ICMP, ICMPV6, GRE, ALL。</li> // <li>CidrBlock 字段允许输入符合cidr格式标准的任意字符串。(展开)在基础网络中,如果 CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。</li> // <li>Ipv6CidrBlock 字段允许输入符合IPv6 cidr格式标准的任意字符串。(展开)在基础网络中,如果Ipv6CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。</li> // <li>SecurityGroupId 字段允许输入与待修改的安全组位于相同项目中的安全组 ID,包括这个安全组 ID 本身,代表安全组下所有云服务器的内网 IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个 ID 所关联的云服务器变化而变化,不需要重新修改。</li> // <li>Port 字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当 Protocol 字段是 TCP 或 UDP 时,Port 字段才被接受,即 Protocol 字段不是 TCP 或 UDP 时,Protocol 和 Port 排他关系,不允许同时输入,否则会接口报错。</li> // <li>Action 字段只允许输入 ACCEPT 或 DROP。</li> // <li>CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate 四者是排他关系,不允许同时输入,Protocol + Port 和 ServiceTemplate 二者是排他关系,不允许同时输入。</li> // <li>一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。</li> // </ul></li></ul> func (c *Client) CreateSecurityGroupPolicies(request *CreateSecurityGroupPoliciesRequest) (response *CreateSecurityGroupPoliciesResponse, err error) { if request == nil { request = NewCreateSecurityGroupPoliciesRequest() } response = NewCreateSecurityGroupPoliciesResponse() err = c.Send(request, response) return } func NewCreateSecurityGroupWithPoliciesRequest() (request *CreateSecurityGroupWithPoliciesRequest) { request = &CreateSecurityGroupWithPoliciesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateSecurityGroupWithPolicies") return } func NewCreateSecurityGroupWithPoliciesResponse() (response *CreateSecurityGroupWithPoliciesResponse) { response = &CreateSecurityGroupWithPoliciesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateSecurityGroupWithPolicies)用于创建新的安全组(SecurityGroup),并且可以同时添加安全组规则(SecurityGroupPolicy)。 // * 每个账户下每个地域的每个项目的<a href="https://cloud.tencent.com/document/product/213/12453">安全组数量限制</a>。 // * 新建的安全组的入站和出站规则默认都是全部拒绝,在创建后通常您需要再调用CreateSecurityGroupPolicies将安全组的规则设置为需要的规则。 // // 安全组规则说明: // * Version安全组规则版本号,用户每次更新安全规则版本会自动加1,防止您更新的路由规则已过期,不填不考虑冲突。 // * Protocol字段支持输入TCP, UDP, ICMP, ICMPV6, GRE, ALL。 // * CidrBlock字段允许输入符合cidr格式标准的任意字符串。(展开)在基础网络中,如果CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。 // * Ipv6CidrBlock字段允许输入符合IPv6 cidr格式标准的任意字符串。(展开)在基础网络中,如果Ipv6CidrBlock包含您的账户内的云服务器之外的设备在腾讯云的内网IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。 // * SecurityGroupId字段允许输入与待修改的安全组位于相同项目中的安全组ID,包括这个安全组ID本身,代表安全组下所有云服务器的内网IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。 // * Port字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当Protocol字段是TCP或UDP时,Port字段才被接受,即Protocol字段不是TCP或UDP时,Protocol和Port排他关系,不允许同时输入,否则会接口报错。 // * Action字段只允许输入ACCEPT或DROP。 // * CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate四者是排他关系,不允许同时输入,Protocol + Port和ServiceTemplate二者是排他关系,不允许同时输入。 // * 一次请求中只能创建单个方向的规则, 如果需要指定索引(PolicyIndex)参数, 多条规则的索引必须一致。 func (c *Client) CreateSecurityGroupWithPolicies(request *CreateSecurityGroupWithPoliciesRequest) (response *CreateSecurityGroupWithPoliciesResponse, err error) { if request == nil { request = NewCreateSecurityGroupWithPoliciesRequest() } response = NewCreateSecurityGroupWithPoliciesResponse() err = c.Send(request, response) return } func NewCreateServiceTemplateRequest() (request *CreateServiceTemplateRequest) { request = &CreateServiceTemplateRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateServiceTemplate") return } func NewCreateServiceTemplateResponse() (response *CreateServiceTemplateResponse) { response = &CreateServiceTemplateResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateServiceTemplate)用于创建协议端口模板 func (c *Client) CreateServiceTemplate(request *CreateServiceTemplateRequest) (response *CreateServiceTemplateResponse, err error) { if request == nil { request = NewCreateServiceTemplateRequest() } response = NewCreateServiceTemplateResponse() err = c.Send(request, response) return } func NewCreateServiceTemplateGroupRequest() (request *CreateServiceTemplateGroupRequest) { request = &CreateServiceTemplateGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateServiceTemplateGroup") return } func NewCreateServiceTemplateGroupResponse() (response *CreateServiceTemplateGroupResponse) { response = &CreateServiceTemplateGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateServiceTemplateGroup)用于创建协议端口模板集合 func (c *Client) CreateServiceTemplateGroup(request *CreateServiceTemplateGroupRequest) (response *CreateServiceTemplateGroupResponse, err error) { if request == nil { request = NewCreateServiceTemplateGroupRequest() } response = NewCreateServiceTemplateGroupResponse() err = c.Send(request, response) return } func NewCreateSubnetRequest() (request *CreateSubnetRequest) { request = &CreateSubnetRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateSubnet") return } func NewCreateSubnetResponse() (response *CreateSubnetResponse) { response = &CreateSubnetResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateSubnet)用于创建子网。 // * 创建子网前必须创建好 VPC。 // * 子网创建成功后,子网网段不能修改。子网网段必须在VPC网段内,可以和VPC网段相同(VPC有且只有一个子网时),建议子网网段在VPC网段内,预留网段给其他子网使用。 // * 您可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址)。 // * 同一个VPC内,多个子网的网段不能重叠。 // * 子网创建后会自动关联到默认路由表。 // * 创建子网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateSubnet(request *CreateSubnetRequest) (response *CreateSubnetResponse, err error) { if request == nil { request = NewCreateSubnetRequest() } response = NewCreateSubnetResponse() err = c.Send(request, response) return } func NewCreateSubnetsRequest() (request *CreateSubnetsRequest) { request = &CreateSubnetsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateSubnets") return } func NewCreateSubnetsResponse() (response *CreateSubnetsResponse) { response = &CreateSubnetsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateSubnets)用于批量创建子网。 // * 创建子网前必须创建好 VPC。 // * 子网创建成功后,子网网段不能修改。子网网段必须在VPC网段内,可以和VPC网段相同(VPC有且只有一个子网时),建议子网网段在VPC网段内,预留网段给其他子网使用。 // * 您可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址)。 // * 同一个VPC内,多个子网的网段不能重叠。 // * 子网创建后会自动关联到默认路由表。 // * 创建子网同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateSubnets(request *CreateSubnetsRequest) (response *CreateSubnetsResponse, err error) { if request == nil { request = NewCreateSubnetsRequest() } response = NewCreateSubnetsResponse() err = c.Send(request, response) return } func NewCreateVpcRequest() (request *CreateVpcRequest) { request = &CreateVpcRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateVpc") return } func NewCreateVpcResponse() (response *CreateVpcResponse) { response = &CreateVpcResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateVpc)用于创建私有网络(VPC)。 // * 用户可以创建的最小网段子网掩码为28(有16个IP地址),最大网段子网掩码为16(65,536个IP地址),如果规划VPC网段请参见VPC网段规划说明。 // * 同一个地域能创建的VPC资源个数也是有限制的,详见 <a href="https://cloud.tencent.com/doc/product/215/537" title="VPC使用限制">VPC使用限制</a>,如果需要扩充请联系在线客服。 // * 创建VPC同时可以绑定标签, 应答里的标签列表代表添加成功的标签。 func (c *Client) CreateVpc(request *CreateVpcRequest) (response *CreateVpcResponse, err error) { if request == nil { request = NewCreateVpcRequest() } response = NewCreateVpcResponse() err = c.Send(request, response) return } func NewCreateVpnConnectionRequest() (request *CreateVpnConnectionRequest) { request = &CreateVpnConnectionRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateVpnConnection") return } func NewCreateVpnConnectionResponse() (response *CreateVpnConnectionResponse) { response = &CreateVpnConnectionResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateVpnConnection)用于创建VPN通道。 func (c *Client) CreateVpnConnection(request *CreateVpnConnectionRequest) (response *CreateVpnConnectionResponse, err error) { if request == nil { request = NewCreateVpnConnectionRequest() } response = NewCreateVpnConnectionResponse() err = c.Send(request, response) return } func NewCreateVpnGatewayRequest() (request *CreateVpnGatewayRequest) { request = &CreateVpnGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "CreateVpnGateway") return } func NewCreateVpnGatewayResponse() (response *CreateVpnGatewayResponse) { response = &CreateVpnGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(CreateVpnGateway)用于创建VPN网关。 func (c *Client) CreateVpnGateway(request *CreateVpnGatewayRequest) (response *CreateVpnGatewayResponse, err error) { if request == nil { request = NewCreateVpnGatewayRequest() } response = NewCreateVpnGatewayResponse() err = c.Send(request, response) return } func NewDeleteAddressTemplateRequest() (request *DeleteAddressTemplateRequest) { request = &DeleteAddressTemplateRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteAddressTemplate") return } func NewDeleteAddressTemplateResponse() (response *DeleteAddressTemplateResponse) { response = &DeleteAddressTemplateResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteAddressTemplate)用于删除IP地址模板 func (c *Client) DeleteAddressTemplate(request *DeleteAddressTemplateRequest) (response *DeleteAddressTemplateResponse, err error) { if request == nil { request = NewDeleteAddressTemplateRequest() } response = NewDeleteAddressTemplateResponse() err = c.Send(request, response) return } func NewDeleteAddressTemplateGroupRequest() (request *DeleteAddressTemplateGroupRequest) { request = &DeleteAddressTemplateGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteAddressTemplateGroup") return } func NewDeleteAddressTemplateGroupResponse() (response *DeleteAddressTemplateGroupResponse) { response = &DeleteAddressTemplateGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteAddressTemplateGroup)用于删除IP地址模板集合 func (c *Client) DeleteAddressTemplateGroup(request *DeleteAddressTemplateGroupRequest) (response *DeleteAddressTemplateGroupResponse, err error) { if request == nil { request = NewDeleteAddressTemplateGroupRequest() } response = NewDeleteAddressTemplateGroupResponse() err = c.Send(request, response) return } func NewDeleteAssistantCidrRequest() (request *DeleteAssistantCidrRequest) { request = &DeleteAssistantCidrRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteAssistantCidr") return } func NewDeleteAssistantCidrResponse() (response *DeleteAssistantCidrResponse) { response = &DeleteAssistantCidrResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteAssistantCidr)用于删除辅助CIDR。(接口灰度中,如需使用请提工单。) func (c *Client) DeleteAssistantCidr(request *DeleteAssistantCidrRequest) (response *DeleteAssistantCidrResponse, err error) { if request == nil { request = NewDeleteAssistantCidrRequest() } response = NewDeleteAssistantCidrResponse() err = c.Send(request, response) return } func NewDeleteBandwidthPackageRequest() (request *DeleteBandwidthPackageRequest) { request = &DeleteBandwidthPackageRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteBandwidthPackage") return } func NewDeleteBandwidthPackageResponse() (response *DeleteBandwidthPackageResponse) { response = &DeleteBandwidthPackageResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 接口支持删除共享带宽包,包括[设备带宽包](https://cloud.tencent.com/document/product/684/15246#.E8.AE.BE.E5.A4.87.E5.B8.A6.E5.AE.BD.E5.8C.85)和[IP带宽包](https://cloud.tencent.com/document/product/684/15246#ip-.E5.B8.A6.E5.AE.BD.E5.8C.85) func (c *Client) DeleteBandwidthPackage(request *DeleteBandwidthPackageRequest) (response *DeleteBandwidthPackageResponse, err error) { if request == nil { request = NewDeleteBandwidthPackageRequest() } response = NewDeleteBandwidthPackageResponse() err = c.Send(request, response) return } func NewDeleteCcnRequest() (request *DeleteCcnRequest) { request = &DeleteCcnRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteCcn") return } func NewDeleteCcnResponse() (response *DeleteCcnResponse) { response = &DeleteCcnResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteCcn)用于删除云联网。 // * 删除后,云联网关联的所有实例间路由将被删除,网络将会中断,请务必确认 // * 删除云联网是不可逆的操作,请谨慎处理。 func (c *Client) DeleteCcn(request *DeleteCcnRequest) (response *DeleteCcnResponse, err error) { if request == nil { request = NewDeleteCcnRequest() } response = NewDeleteCcnResponse() err = c.Send(request, response) return } func NewDeleteCustomerGatewayRequest() (request *DeleteCustomerGatewayRequest) { request = &DeleteCustomerGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteCustomerGateway") return } func NewDeleteCustomerGatewayResponse() (response *DeleteCustomerGatewayResponse) { response = &DeleteCustomerGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteCustomerGateway)用于删除对端网关。 func (c *Client) DeleteCustomerGateway(request *DeleteCustomerGatewayRequest) (response *DeleteCustomerGatewayResponse, err error) { if request == nil { request = NewDeleteCustomerGatewayRequest() } response = NewDeleteCustomerGatewayResponse() err = c.Send(request, response) return } func NewDeleteDhcpIpRequest() (request *DeleteDhcpIpRequest) { request = &DeleteDhcpIpRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteDhcpIp") return } func NewDeleteDhcpIpResponse() (response *DeleteDhcpIpResponse) { response = &DeleteDhcpIpResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteDhcpIp)用于删除DhcpIp func (c *Client) DeleteDhcpIp(request *DeleteDhcpIpRequest) (response *DeleteDhcpIpResponse, err error) { if request == nil { request = NewDeleteDhcpIpRequest() } response = NewDeleteDhcpIpResponse() err = c.Send(request, response) return } func NewDeleteDirectConnectGatewayRequest() (request *DeleteDirectConnectGatewayRequest) { request = &DeleteDirectConnectGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteDirectConnectGateway") return } func NewDeleteDirectConnectGatewayResponse() (response *DeleteDirectConnectGatewayResponse) { response = &DeleteDirectConnectGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteDirectConnectGateway)用于删除专线网关。 // <li>如果是 NAT 网关,删除专线网关后,NAT 规则以及 ACL 策略都被清理了。</li> // <li>删除专线网关后,系统会删除路由表中跟该专线网关相关的路由策略。</li> // 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口 func (c *Client) DeleteDirectConnectGateway(request *DeleteDirectConnectGatewayRequest) (response *DeleteDirectConnectGatewayResponse, err error) { if request == nil { request = NewDeleteDirectConnectGatewayRequest() } response = NewDeleteDirectConnectGatewayResponse() err = c.Send(request, response) return } func NewDeleteDirectConnectGatewayCcnRoutesRequest() (request *DeleteDirectConnectGatewayCcnRoutesRequest) { request = &DeleteDirectConnectGatewayCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteDirectConnectGatewayCcnRoutes") return } func NewDeleteDirectConnectGatewayCcnRoutesResponse() (response *DeleteDirectConnectGatewayCcnRoutesResponse) { response = &DeleteDirectConnectGatewayCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteDirectConnectGatewayCcnRoutes)用于删除专线网关的云联网路由(IDC网段) func (c *Client) DeleteDirectConnectGatewayCcnRoutes(request *DeleteDirectConnectGatewayCcnRoutesRequest) (response *DeleteDirectConnectGatewayCcnRoutesResponse, err error) { if request == nil { request = NewDeleteDirectConnectGatewayCcnRoutesRequest() } response = NewDeleteDirectConnectGatewayCcnRoutesResponse() err = c.Send(request, response) return } func NewDeleteFlowLogRequest() (request *DeleteFlowLogRequest) { request = &DeleteFlowLogRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteFlowLog") return } func NewDeleteFlowLogResponse() (response *DeleteFlowLogResponse) { response = &DeleteFlowLogResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteFlowLog)用于删除流日志 func (c *Client) DeleteFlowLog(request *DeleteFlowLogRequest) (response *DeleteFlowLogResponse, err error) { if request == nil { request = NewDeleteFlowLogRequest() } response = NewDeleteFlowLogResponse() err = c.Send(request, response) return } func NewDeleteHaVipRequest() (request *DeleteHaVipRequest) { request = &DeleteHaVipRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteHaVip") return } func NewDeleteHaVipResponse() (response *DeleteHaVipResponse) { response = &DeleteHaVipResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteHaVip)用于删除高可用虚拟IP(HAVIP)<br /> // 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口 func (c *Client) DeleteHaVip(request *DeleteHaVipRequest) (response *DeleteHaVipResponse, err error) { if request == nil { request = NewDeleteHaVipRequest() } response = NewDeleteHaVipResponse() err = c.Send(request, response) return } func NewDeleteIp6TranslatorsRequest() (request *DeleteIp6TranslatorsRequest) { request = &DeleteIp6TranslatorsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteIp6Translators") return } func NewDeleteIp6TranslatorsResponse() (response *DeleteIp6TranslatorsResponse) { response = &DeleteIp6TranslatorsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 1. 该接口用于释放IPV6转换实例,支持批量。 // 2. 如果IPV6转换实例建立有转换规则,会一并删除。 func (c *Client) DeleteIp6Translators(request *DeleteIp6TranslatorsRequest) (response *DeleteIp6TranslatorsResponse, err error) { if request == nil { request = NewDeleteIp6TranslatorsRequest() } response = NewDeleteIp6TranslatorsResponse() err = c.Send(request, response) return } func NewDeleteNatGatewayRequest() (request *DeleteNatGatewayRequest) { request = &DeleteNatGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteNatGateway") return } func NewDeleteNatGatewayResponse() (response *DeleteNatGatewayResponse) { response = &DeleteNatGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteNatGateway)用于删除NAT网关。 // 删除 NAT 网关后,系统会自动删除路由表中包含此 NAT 网关的路由项,同时也会解绑弹性公网IP(EIP)。 func (c *Client) DeleteNatGateway(request *DeleteNatGatewayRequest) (response *DeleteNatGatewayResponse, err error) { if request == nil { request = NewDeleteNatGatewayRequest() } response = NewDeleteNatGatewayResponse() err = c.Send(request, response) return } func NewDeleteNatGatewayDestinationIpPortTranslationNatRuleRequest() (request *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) { request = &DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteNatGatewayDestinationIpPortTranslationNatRule") return } func NewDeleteNatGatewayDestinationIpPortTranslationNatRuleResponse() (response *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse) { response = &DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteNatGatewayDestinationIpPortTranslationNatRule)用于删除NAT网关端口转发规则。 func (c *Client) DeleteNatGatewayDestinationIpPortTranslationNatRule(request *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { if request == nil { request = NewDeleteNatGatewayDestinationIpPortTranslationNatRuleRequest() } response = NewDeleteNatGatewayDestinationIpPortTranslationNatRuleResponse() err = c.Send(request, response) return } func NewDeleteNetDetectRequest() (request *DeleteNetDetectRequest) { request = &DeleteNetDetectRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteNetDetect") return } func NewDeleteNetDetectResponse() (response *DeleteNetDetectResponse) { response = &DeleteNetDetectResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteNetDetect)用于删除网络探测实例。 func (c *Client) DeleteNetDetect(request *DeleteNetDetectRequest) (response *DeleteNetDetectResponse, err error) { if request == nil { request = NewDeleteNetDetectRequest() } response = NewDeleteNetDetectResponse() err = c.Send(request, response) return } func NewDeleteNetworkAclRequest() (request *DeleteNetworkAclRequest) { request = &DeleteNetworkAclRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteNetworkAcl") return } func NewDeleteNetworkAclResponse() (response *DeleteNetworkAclResponse) { response = &DeleteNetworkAclResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteNetworkAcl)用于删除网络ACL。 func (c *Client) DeleteNetworkAcl(request *DeleteNetworkAclRequest) (response *DeleteNetworkAclResponse, err error) { if request == nil { request = NewDeleteNetworkAclRequest() } response = NewDeleteNetworkAclResponse() err = c.Send(request, response) return } func NewDeleteNetworkInterfaceRequest() (request *DeleteNetworkInterfaceRequest) { request = &DeleteNetworkInterfaceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteNetworkInterface") return } func NewDeleteNetworkInterfaceResponse() (response *DeleteNetworkInterfaceResponse) { response = &DeleteNetworkInterfaceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteNetworkInterface)用于删除弹性网卡。 // * 弹性网卡上绑定了云服务器时,不能被删除。 // * 删除指定弹性网卡,弹性网卡必须先和子机解绑才能删除。删除之后弹性网卡上所有内网IP都将被退还。 func (c *Client) DeleteNetworkInterface(request *DeleteNetworkInterfaceRequest) (response *DeleteNetworkInterfaceResponse, err error) { if request == nil { request = NewDeleteNetworkInterfaceRequest() } response = NewDeleteNetworkInterfaceResponse() err = c.Send(request, response) return } func NewDeleteRouteTableRequest() (request *DeleteRouteTableRequest) { request = &DeleteRouteTableRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteRouteTable") return } func NewDeleteRouteTableResponse() (response *DeleteRouteTableResponse) { response = &DeleteRouteTableResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 删除路由表 func (c *Client) DeleteRouteTable(request *DeleteRouteTableRequest) (response *DeleteRouteTableResponse, err error) { if request == nil { request = NewDeleteRouteTableRequest() } response = NewDeleteRouteTableResponse() err = c.Send(request, response) return } func NewDeleteRoutesRequest() (request *DeleteRoutesRequest) { request = &DeleteRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteRoutes") return } func NewDeleteRoutesResponse() (response *DeleteRoutesResponse) { response = &DeleteRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteRoutes)用于对某个路由表批量删除路由策略(Route)。 func (c *Client) DeleteRoutes(request *DeleteRoutesRequest) (response *DeleteRoutesResponse, err error) { if request == nil { request = NewDeleteRoutesRequest() } response = NewDeleteRoutesResponse() err = c.Send(request, response) return } func NewDeleteSecurityGroupRequest() (request *DeleteSecurityGroupRequest) { request = &DeleteSecurityGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteSecurityGroup") return } func NewDeleteSecurityGroupResponse() (response *DeleteSecurityGroupResponse) { response = &DeleteSecurityGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteSecurityGroup)用于删除安全组(SecurityGroup)。 // * 只有当前账号下的安全组允许被删除。 // * 安全组实例ID如果在其他安全组的规则中被引用,则无法直接删除。这种情况下,需要先进行规则修改,再删除安全组。 // * 删除的安全组无法再找回,请谨慎调用。 func (c *Client) DeleteSecurityGroup(request *DeleteSecurityGroupRequest) (response *DeleteSecurityGroupResponse, err error) { if request == nil { request = NewDeleteSecurityGroupRequest() } response = NewDeleteSecurityGroupResponse() err = c.Send(request, response) return } func NewDeleteSecurityGroupPoliciesRequest() (request *DeleteSecurityGroupPoliciesRequest) { request = &DeleteSecurityGroupPoliciesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteSecurityGroupPolicies") return } func NewDeleteSecurityGroupPoliciesResponse() (response *DeleteSecurityGroupPoliciesResponse) { response = &DeleteSecurityGroupPoliciesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteSecurityGroupPolicies)用于用于删除安全组规则(SecurityGroupPolicy)。 // * SecurityGroupPolicySet.Version 用于指定要操作的安全组的版本。传入 Version 版本号若不等于当前安全组的最新版本,将返回失败;若不传 Version 则直接删除指定PolicyIndex的规则。 func (c *Client) DeleteSecurityGroupPolicies(request *DeleteSecurityGroupPoliciesRequest) (response *DeleteSecurityGroupPoliciesResponse, err error) { if request == nil { request = NewDeleteSecurityGroupPoliciesRequest() } response = NewDeleteSecurityGroupPoliciesResponse() err = c.Send(request, response) return } func NewDeleteServiceTemplateRequest() (request *DeleteServiceTemplateRequest) { request = &DeleteServiceTemplateRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteServiceTemplate") return } func NewDeleteServiceTemplateResponse() (response *DeleteServiceTemplateResponse) { response = &DeleteServiceTemplateResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteServiceTemplate)用于删除协议端口模板 func (c *Client) DeleteServiceTemplate(request *DeleteServiceTemplateRequest) (response *DeleteServiceTemplateResponse, err error) { if request == nil { request = NewDeleteServiceTemplateRequest() } response = NewDeleteServiceTemplateResponse() err = c.Send(request, response) return } func NewDeleteServiceTemplateGroupRequest() (request *DeleteServiceTemplateGroupRequest) { request = &DeleteServiceTemplateGroupRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteServiceTemplateGroup") return } func NewDeleteServiceTemplateGroupResponse() (response *DeleteServiceTemplateGroupResponse) { response = &DeleteServiceTemplateGroupResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteServiceTemplateGroup)用于删除协议端口模板集合 func (c *Client) DeleteServiceTemplateGroup(request *DeleteServiceTemplateGroupRequest) (response *DeleteServiceTemplateGroupResponse, err error) { if request == nil { request = NewDeleteServiceTemplateGroupRequest() } response = NewDeleteServiceTemplateGroupResponse() err = c.Send(request, response) return } func NewDeleteSubnetRequest() (request *DeleteSubnetRequest) { request = &DeleteSubnetRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteSubnet") return } func NewDeleteSubnetResponse() (response *DeleteSubnetResponse) { response = &DeleteSubnetResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteSubnet)用于用于删除子网(Subnet)。 // * 删除子网前,请清理该子网下所有资源,包括云服务器、负载均衡、云数据、noSql、弹性网卡等资源。 func (c *Client) DeleteSubnet(request *DeleteSubnetRequest) (response *DeleteSubnetResponse, err error) { if request == nil { request = NewDeleteSubnetRequest() } response = NewDeleteSubnetResponse() err = c.Send(request, response) return } func NewDeleteVpcRequest() (request *DeleteVpcRequest) { request = &DeleteVpcRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpc") return } func NewDeleteVpcResponse() (response *DeleteVpcResponse) { response = &DeleteVpcResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteVpc)用于删除私有网络。 // * 删除前请确保 VPC 内已经没有相关资源,例如云服务器、云数据库、NoSQL、VPN网关、专线网关、负载均衡、对等连接、与之互通的基础网络设备等。 // * 删除私有网络是不可逆的操作,请谨慎处理。 func (c *Client) DeleteVpc(request *DeleteVpcRequest) (response *DeleteVpcResponse, err error) { if request == nil { request = NewDeleteVpcRequest() } response = NewDeleteVpcResponse() err = c.Send(request, response) return } func NewDeleteVpnConnectionRequest() (request *DeleteVpnConnectionRequest) { request = &DeleteVpnConnectionRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpnConnection") return } func NewDeleteVpnConnectionResponse() (response *DeleteVpnConnectionResponse) { response = &DeleteVpnConnectionResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteVpnConnection)用于删除VPN通道。 func (c *Client) DeleteVpnConnection(request *DeleteVpnConnectionRequest) (response *DeleteVpnConnectionResponse, err error) { if request == nil { request = NewDeleteVpnConnectionRequest() } response = NewDeleteVpnConnectionResponse() err = c.Send(request, response) return } func NewDeleteVpnGatewayRequest() (request *DeleteVpnGatewayRequest) { request = &DeleteVpnGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DeleteVpnGateway") return } func NewDeleteVpnGatewayResponse() (response *DeleteVpnGatewayResponse) { response = &DeleteVpnGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DeleteVpnGateway)用于删除VPN网关。目前只支持删除运行中的按量计费的IPSEC网关实例。 func (c *Client) DeleteVpnGateway(request *DeleteVpnGatewayRequest) (response *DeleteVpnGatewayResponse, err error) { if request == nil { request = NewDeleteVpnGatewayRequest() } response = NewDeleteVpnGatewayResponse() err = c.Send(request, response) return } func NewDescribeAccountAttributesRequest() (request *DescribeAccountAttributesRequest) { request = &DescribeAccountAttributesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeAccountAttributes") return } func NewDescribeAccountAttributesResponse() (response *DescribeAccountAttributesResponse) { response = &DescribeAccountAttributesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeAccountAttributes)用于查询用户账号私有属性。 func (c *Client) DescribeAccountAttributes(request *DescribeAccountAttributesRequest) (response *DescribeAccountAttributesResponse, err error) { if request == nil { request = NewDescribeAccountAttributesRequest() } response = NewDescribeAccountAttributesResponse() err = c.Send(request, response) return } func NewDescribeAddressQuotaRequest() (request *DescribeAddressQuotaRequest) { request = &DescribeAddressQuotaRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddressQuota") return } func NewDescribeAddressQuotaResponse() (response *DescribeAddressQuotaResponse) { response = &DescribeAddressQuotaResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeAddressQuota) 用于查询您账户的[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)在当前地域的配额信息。配额详情可参见 [EIP 产品简介](https://cloud.tencent.com/document/product/213/5733)。 func (c *Client) DescribeAddressQuota(request *DescribeAddressQuotaRequest) (response *DescribeAddressQuotaResponse, err error) { if request == nil { request = NewDescribeAddressQuotaRequest() } response = NewDescribeAddressQuotaResponse() err = c.Send(request, response) return } func NewDescribeAddressTemplateGroupsRequest() (request *DescribeAddressTemplateGroupsRequest) { request = &DescribeAddressTemplateGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddressTemplateGroups") return } func NewDescribeAddressTemplateGroupsResponse() (response *DescribeAddressTemplateGroupsResponse) { response = &DescribeAddressTemplateGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeAddressTemplateGroups)用于查询IP地址模板集合 func (c *Client) DescribeAddressTemplateGroups(request *DescribeAddressTemplateGroupsRequest) (response *DescribeAddressTemplateGroupsResponse, err error) { if request == nil { request = NewDescribeAddressTemplateGroupsRequest() } response = NewDescribeAddressTemplateGroupsResponse() err = c.Send(request, response) return } func NewDescribeAddressTemplatesRequest() (request *DescribeAddressTemplatesRequest) { request = &DescribeAddressTemplatesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddressTemplates") return } func NewDescribeAddressTemplatesResponse() (response *DescribeAddressTemplatesResponse) { response = &DescribeAddressTemplatesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeAddressTemplates)用于查询IP地址模板 func (c *Client) DescribeAddressTemplates(request *DescribeAddressTemplatesRequest) (response *DescribeAddressTemplatesResponse, err error) { if request == nil { request = NewDescribeAddressTemplatesRequest() } response = NewDescribeAddressTemplatesResponse() err = c.Send(request, response) return } func NewDescribeAddressesRequest() (request *DescribeAddressesRequest) { request = &DescribeAddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeAddresses") return } func NewDescribeAddressesResponse() (response *DescribeAddressesResponse) { response = &DescribeAddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DescribeAddresses) 用于查询一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)的详细信息。 // * 如果参数为空,返回当前用户一定数量(Limit所指定的数量,默认为20)的 EIP。 func (c *Client) DescribeAddresses(request *DescribeAddressesRequest) (response *DescribeAddressesResponse, err error) { if request == nil { request = NewDescribeAddressesRequest() } response = NewDescribeAddressesResponse() err = c.Send(request, response) return } func NewDescribeAssistantCidrRequest() (request *DescribeAssistantCidrRequest) { request = &DescribeAssistantCidrRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeAssistantCidr") return } func NewDescribeAssistantCidrResponse() (response *DescribeAssistantCidrResponse) { response = &DescribeAssistantCidrResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeAssistantCidr)用于查询辅助CIDR列表。(接口灰度中,如需使用请提工单。) func (c *Client) DescribeAssistantCidr(request *DescribeAssistantCidrRequest) (response *DescribeAssistantCidrResponse, err error) { if request == nil { request = NewDescribeAssistantCidrRequest() } response = NewDescribeAssistantCidrResponse() err = c.Send(request, response) return } func NewDescribeBandwidthPackageQuotaRequest() (request *DescribeBandwidthPackageQuotaRequest) { request = &DescribeBandwidthPackageQuotaRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeBandwidthPackageQuota") return } func NewDescribeBandwidthPackageQuotaResponse() (response *DescribeBandwidthPackageQuotaResponse) { response = &DescribeBandwidthPackageQuotaResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 接口用于查询账户在当前地域的带宽包上限数量以及使用数量 func (c *Client) DescribeBandwidthPackageQuota(request *DescribeBandwidthPackageQuotaRequest) (response *DescribeBandwidthPackageQuotaResponse, err error) { if request == nil { request = NewDescribeBandwidthPackageQuotaRequest() } response = NewDescribeBandwidthPackageQuotaResponse() err = c.Send(request, response) return } func NewDescribeBandwidthPackagesRequest() (request *DescribeBandwidthPackagesRequest) { request = &DescribeBandwidthPackagesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeBandwidthPackages") return } func NewDescribeBandwidthPackagesResponse() (response *DescribeBandwidthPackagesResponse) { response = &DescribeBandwidthPackagesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 接口用于查询带宽包详细信息,包括带宽包唯一标识ID,类型,计费模式,名称,资源信息等 func (c *Client) DescribeBandwidthPackages(request *DescribeBandwidthPackagesRequest) (response *DescribeBandwidthPackagesResponse, err error) { if request == nil { request = NewDescribeBandwidthPackagesRequest() } response = NewDescribeBandwidthPackagesResponse() err = c.Send(request, response) return } func NewDescribeCcnAttachedInstancesRequest() (request *DescribeCcnAttachedInstancesRequest) { request = &DescribeCcnAttachedInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcnAttachedInstances") return } func NewDescribeCcnAttachedInstancesResponse() (response *DescribeCcnAttachedInstancesResponse) { response = &DescribeCcnAttachedInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeCcnAttachedInstances)用于查询云联网实例下已关联的网络实例。 func (c *Client) DescribeCcnAttachedInstances(request *DescribeCcnAttachedInstancesRequest) (response *DescribeCcnAttachedInstancesResponse, err error) { if request == nil { request = NewDescribeCcnAttachedInstancesRequest() } response = NewDescribeCcnAttachedInstancesResponse() err = c.Send(request, response) return } func NewDescribeCcnRegionBandwidthLimitsRequest() (request *DescribeCcnRegionBandwidthLimitsRequest) { request = &DescribeCcnRegionBandwidthLimitsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcnRegionBandwidthLimits") return } func NewDescribeCcnRegionBandwidthLimitsResponse() (response *DescribeCcnRegionBandwidthLimitsResponse) { response = &DescribeCcnRegionBandwidthLimitsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeCcnRegionBandwidthLimits)用于查询云联网各地域出带宽上限,该接口只返回已关联网络实例包含的地域 func (c *Client) DescribeCcnRegionBandwidthLimits(request *DescribeCcnRegionBandwidthLimitsRequest) (response *DescribeCcnRegionBandwidthLimitsResponse, err error) { if request == nil { request = NewDescribeCcnRegionBandwidthLimitsRequest() } response = NewDescribeCcnRegionBandwidthLimitsResponse() err = c.Send(request, response) return } func NewDescribeCcnRoutesRequest() (request *DescribeCcnRoutesRequest) { request = &DescribeCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcnRoutes") return } func NewDescribeCcnRoutesResponse() (response *DescribeCcnRoutesResponse) { response = &DescribeCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeCcnRoutes)用于查询已加入云联网(CCN)的路由 func (c *Client) DescribeCcnRoutes(request *DescribeCcnRoutesRequest) (response *DescribeCcnRoutesResponse, err error) { if request == nil { request = NewDescribeCcnRoutesRequest() } response = NewDescribeCcnRoutesResponse() err = c.Send(request, response) return } func NewDescribeCcnsRequest() (request *DescribeCcnsRequest) { request = &DescribeCcnsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeCcns") return } func NewDescribeCcnsResponse() (response *DescribeCcnsResponse) { response = &DescribeCcnsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeCcns)用于查询云联网(CCN)列表。 func (c *Client) DescribeCcns(request *DescribeCcnsRequest) (response *DescribeCcnsResponse, err error) { if request == nil { request = NewDescribeCcnsRequest() } response = NewDescribeCcnsResponse() err = c.Send(request, response) return } func NewDescribeClassicLinkInstancesRequest() (request *DescribeClassicLinkInstancesRequest) { request = &DescribeClassicLinkInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeClassicLinkInstances") return } func NewDescribeClassicLinkInstancesResponse() (response *DescribeClassicLinkInstancesResponse) { response = &DescribeClassicLinkInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeClassicLinkInstances)用于查询私有网络和基础网络设备互通列表。 func (c *Client) DescribeClassicLinkInstances(request *DescribeClassicLinkInstancesRequest) (response *DescribeClassicLinkInstancesResponse, err error) { if request == nil { request = NewDescribeClassicLinkInstancesRequest() } response = NewDescribeClassicLinkInstancesResponse() err = c.Send(request, response) return } func NewDescribeCustomerGatewayVendorsRequest() (request *DescribeCustomerGatewayVendorsRequest) { request = &DescribeCustomerGatewayVendorsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeCustomerGatewayVendors") return } func NewDescribeCustomerGatewayVendorsResponse() (response *DescribeCustomerGatewayVendorsResponse) { response = &DescribeCustomerGatewayVendorsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeCustomerGatewayVendors)用于查询可支持的对端网关厂商信息。 func (c *Client) DescribeCustomerGatewayVendors(request *DescribeCustomerGatewayVendorsRequest) (response *DescribeCustomerGatewayVendorsResponse, err error) { if request == nil { request = NewDescribeCustomerGatewayVendorsRequest() } response = NewDescribeCustomerGatewayVendorsResponse() err = c.Send(request, response) return } func NewDescribeCustomerGatewaysRequest() (request *DescribeCustomerGatewaysRequest) { request = &DescribeCustomerGatewaysRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeCustomerGateways") return } func NewDescribeCustomerGatewaysResponse() (response *DescribeCustomerGatewaysResponse) { response = &DescribeCustomerGatewaysResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeCustomerGateways)用于查询对端网关列表。 func (c *Client) DescribeCustomerGateways(request *DescribeCustomerGatewaysRequest) (response *DescribeCustomerGatewaysResponse, err error) { if request == nil { request = NewDescribeCustomerGatewaysRequest() } response = NewDescribeCustomerGatewaysResponse() err = c.Send(request, response) return } func NewDescribeDhcpIpsRequest() (request *DescribeDhcpIpsRequest) { request = &DescribeDhcpIpsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeDhcpIps") return } func NewDescribeDhcpIpsResponse() (response *DescribeDhcpIpsResponse) { response = &DescribeDhcpIpsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeDhcpIps)用于查询DhcpIp列表 func (c *Client) DescribeDhcpIps(request *DescribeDhcpIpsRequest) (response *DescribeDhcpIpsResponse, err error) { if request == nil { request = NewDescribeDhcpIpsRequest() } response = NewDescribeDhcpIpsResponse() err = c.Send(request, response) return } func NewDescribeDirectConnectGatewayCcnRoutesRequest() (request *DescribeDirectConnectGatewayCcnRoutesRequest) { request = &DescribeDirectConnectGatewayCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeDirectConnectGatewayCcnRoutes") return } func NewDescribeDirectConnectGatewayCcnRoutesResponse() (response *DescribeDirectConnectGatewayCcnRoutesResponse) { response = &DescribeDirectConnectGatewayCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeDirectConnectGatewayCcnRoutes)用于查询专线网关的云联网路由(IDC网段) func (c *Client) DescribeDirectConnectGatewayCcnRoutes(request *DescribeDirectConnectGatewayCcnRoutesRequest) (response *DescribeDirectConnectGatewayCcnRoutesResponse, err error) { if request == nil { request = NewDescribeDirectConnectGatewayCcnRoutesRequest() } response = NewDescribeDirectConnectGatewayCcnRoutesResponse() err = c.Send(request, response) return } func NewDescribeDirectConnectGatewaysRequest() (request *DescribeDirectConnectGatewaysRequest) { request = &DescribeDirectConnectGatewaysRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeDirectConnectGateways") return } func NewDescribeDirectConnectGatewaysResponse() (response *DescribeDirectConnectGatewaysResponse) { response = &DescribeDirectConnectGatewaysResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeDirectConnectGateways)用于查询专线网关。 func (c *Client) DescribeDirectConnectGateways(request *DescribeDirectConnectGatewaysRequest) (response *DescribeDirectConnectGatewaysResponse, err error) { if request == nil { request = NewDescribeDirectConnectGatewaysRequest() } response = NewDescribeDirectConnectGatewaysResponse() err = c.Send(request, response) return } func NewDescribeFlowLogRequest() (request *DescribeFlowLogRequest) { request = &DescribeFlowLogRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeFlowLog") return } func NewDescribeFlowLogResponse() (response *DescribeFlowLogResponse) { response = &DescribeFlowLogResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeFlowLog)用于查询流日志实例信息 func (c *Client) DescribeFlowLog(request *DescribeFlowLogRequest) (response *DescribeFlowLogResponse, err error) { if request == nil { request = NewDescribeFlowLogRequest() } response = NewDescribeFlowLogResponse() err = c.Send(request, response) return } func NewDescribeFlowLogsRequest() (request *DescribeFlowLogsRequest) { request = &DescribeFlowLogsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeFlowLogs") return } func NewDescribeFlowLogsResponse() (response *DescribeFlowLogsResponse) { response = &DescribeFlowLogsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeFlowLogs)用于查询获取流日志集合 func (c *Client) DescribeFlowLogs(request *DescribeFlowLogsRequest) (response *DescribeFlowLogsResponse, err error) { if request == nil { request = NewDescribeFlowLogsRequest() } response = NewDescribeFlowLogsResponse() err = c.Send(request, response) return } func NewDescribeGatewayFlowMonitorDetailRequest() (request *DescribeGatewayFlowMonitorDetailRequest) { request = &DescribeGatewayFlowMonitorDetailRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeGatewayFlowMonitorDetail") return } func NewDescribeGatewayFlowMonitorDetailResponse() (response *DescribeGatewayFlowMonitorDetailResponse) { response = &DescribeGatewayFlowMonitorDetailResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeGatewayFlowMonitorDetail)用于查询网关流量监控明细。 // * 只支持单个网关实例查询。即入参 `VpnId` `DirectConnectGatewayId` `PeeringConnectionId` `NatId` 最多只支持传一个,且必须传一个。 // * 如果网关有流量,但调用本接口没有返回数据,请在控制台对应网关详情页确认是否开启网关流量监控。 func (c *Client) DescribeGatewayFlowMonitorDetail(request *DescribeGatewayFlowMonitorDetailRequest) (response *DescribeGatewayFlowMonitorDetailResponse, err error) { if request == nil { request = NewDescribeGatewayFlowMonitorDetailRequest() } response = NewDescribeGatewayFlowMonitorDetailResponse() err = c.Send(request, response) return } func NewDescribeGatewayFlowQosRequest() (request *DescribeGatewayFlowQosRequest) { request = &DescribeGatewayFlowQosRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeGatewayFlowQos") return } func NewDescribeGatewayFlowQosResponse() (response *DescribeGatewayFlowQosResponse) { response = &DescribeGatewayFlowQosResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeGatewayFlowQos)用于查询网关来访IP流控带宽。 func (c *Client) DescribeGatewayFlowQos(request *DescribeGatewayFlowQosRequest) (response *DescribeGatewayFlowQosResponse, err error) { if request == nil { request = NewDescribeGatewayFlowQosRequest() } response = NewDescribeGatewayFlowQosResponse() err = c.Send(request, response) return } func NewDescribeHaVipsRequest() (request *DescribeHaVipsRequest) { request = &DescribeHaVipsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeHaVips") return } func NewDescribeHaVipsResponse() (response *DescribeHaVipsResponse) { response = &DescribeHaVipsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeHaVips)用于查询高可用虚拟IP(HAVIP)列表。 func (c *Client) DescribeHaVips(request *DescribeHaVipsRequest) (response *DescribeHaVipsResponse, err error) { if request == nil { request = NewDescribeHaVipsRequest() } response = NewDescribeHaVipsResponse() err = c.Send(request, response) return } func NewDescribeIp6AddressesRequest() (request *DescribeIp6AddressesRequest) { request = &DescribeIp6AddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6Addresses") return } func NewDescribeIp6AddressesResponse() (response *DescribeIp6AddressesResponse) { response = &DescribeIp6AddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 该接口用于查询IPV6地址信息 func (c *Client) DescribeIp6Addresses(request *DescribeIp6AddressesRequest) (response *DescribeIp6AddressesResponse, err error) { if request == nil { request = NewDescribeIp6AddressesRequest() } response = NewDescribeIp6AddressesResponse() err = c.Send(request, response) return } func NewDescribeIp6TranslatorQuotaRequest() (request *DescribeIp6TranslatorQuotaRequest) { request = &DescribeIp6TranslatorQuotaRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6TranslatorQuota") return } func NewDescribeIp6TranslatorQuotaResponse() (response *DescribeIp6TranslatorQuotaResponse) { response = &DescribeIp6TranslatorQuotaResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 查询账户在指定地域IPV6转换实例和规则的配额 func (c *Client) DescribeIp6TranslatorQuota(request *DescribeIp6TranslatorQuotaRequest) (response *DescribeIp6TranslatorQuotaResponse, err error) { if request == nil { request = NewDescribeIp6TranslatorQuotaRequest() } response = NewDescribeIp6TranslatorQuotaResponse() err = c.Send(request, response) return } func NewDescribeIp6TranslatorsRequest() (request *DescribeIp6TranslatorsRequest) { request = &DescribeIp6TranslatorsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeIp6Translators") return } func NewDescribeIp6TranslatorsResponse() (response *DescribeIp6TranslatorsResponse) { response = &DescribeIp6TranslatorsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 1. 该接口用于查询账户下的IPV6转换实例及其绑定的转换规则信息 // 2. 支持过滤查询 func (c *Client) DescribeIp6Translators(request *DescribeIp6TranslatorsRequest) (response *DescribeIp6TranslatorsResponse, err error) { if request == nil { request = NewDescribeIp6TranslatorsRequest() } response = NewDescribeIp6TranslatorsResponse() err = c.Send(request, response) return } func NewDescribeNatGatewayDestinationIpPortTranslationNatRulesRequest() (request *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) { request = &DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeNatGatewayDestinationIpPortTranslationNatRules") return } func NewDescribeNatGatewayDestinationIpPortTranslationNatRulesResponse() (response *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse) { response = &DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeNatGatewayDestinationIpPortTranslationNatRules)用于查询NAT网关端口转发规则对象数组。 func (c *Client) DescribeNatGatewayDestinationIpPortTranslationNatRules(request *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) (response *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse, err error) { if request == nil { request = NewDescribeNatGatewayDestinationIpPortTranslationNatRulesRequest() } response = NewDescribeNatGatewayDestinationIpPortTranslationNatRulesResponse() err = c.Send(request, response) return } func NewDescribeNatGatewaysRequest() (request *DescribeNatGatewaysRequest) { request = &DescribeNatGatewaysRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeNatGateways") return } func NewDescribeNatGatewaysResponse() (response *DescribeNatGatewaysResponse) { response = &DescribeNatGatewaysResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeNatGateways)用于查询 NAT 网关。 func (c *Client) DescribeNatGateways(request *DescribeNatGatewaysRequest) (response *DescribeNatGatewaysResponse, err error) { if request == nil { request = NewDescribeNatGatewaysRequest() } response = NewDescribeNatGatewaysResponse() err = c.Send(request, response) return } func NewDescribeNetDetectStatesRequest() (request *DescribeNetDetectStatesRequest) { request = &DescribeNetDetectStatesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetDetectStates") return } func NewDescribeNetDetectStatesResponse() (response *DescribeNetDetectStatesResponse) { response = &DescribeNetDetectStatesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeNetDetectStates)用于查询网络探测验证结果列表。 func (c *Client) DescribeNetDetectStates(request *DescribeNetDetectStatesRequest) (response *DescribeNetDetectStatesResponse, err error) { if request == nil { request = NewDescribeNetDetectStatesRequest() } response = NewDescribeNetDetectStatesResponse() err = c.Send(request, response) return } func NewDescribeNetDetectsRequest() (request *DescribeNetDetectsRequest) { request = &DescribeNetDetectsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetDetects") return } func NewDescribeNetDetectsResponse() (response *DescribeNetDetectsResponse) { response = &DescribeNetDetectsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeNetDetects)用于查询网络探测列表。 func (c *Client) DescribeNetDetects(request *DescribeNetDetectsRequest) (response *DescribeNetDetectsResponse, err error) { if request == nil { request = NewDescribeNetDetectsRequest() } response = NewDescribeNetDetectsResponse() err = c.Send(request, response) return } func NewDescribeNetworkAclsRequest() (request *DescribeNetworkAclsRequest) { request = &DescribeNetworkAclsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkAcls") return } func NewDescribeNetworkAclsResponse() (response *DescribeNetworkAclsResponse) { response = &DescribeNetworkAclsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeNetworkAcls)用于查询网络ACL列表。 func (c *Client) DescribeNetworkAcls(request *DescribeNetworkAclsRequest) (response *DescribeNetworkAclsResponse, err error) { if request == nil { request = NewDescribeNetworkAclsRequest() } response = NewDescribeNetworkAclsResponse() err = c.Send(request, response) return } func NewDescribeNetworkInterfaceLimitRequest() (request *DescribeNetworkInterfaceLimitRequest) { request = &DescribeNetworkInterfaceLimitRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkInterfaceLimit") return } func NewDescribeNetworkInterfaceLimitResponse() (response *DescribeNetworkInterfaceLimitResponse) { response = &DescribeNetworkInterfaceLimitResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeNetworkInterfaceLimit)根据CVM实例ID或弹性网卡ID查询弹性网卡配额,返回该CVM实例或弹性网卡能绑定的弹性网卡配额,以及弹性网卡可以分配的IP配额 func (c *Client) DescribeNetworkInterfaceLimit(request *DescribeNetworkInterfaceLimitRequest) (response *DescribeNetworkInterfaceLimitResponse, err error) { if request == nil { request = NewDescribeNetworkInterfaceLimitRequest() } response = NewDescribeNetworkInterfaceLimitResponse() err = c.Send(request, response) return } func NewDescribeNetworkInterfacesRequest() (request *DescribeNetworkInterfacesRequest) { request = &DescribeNetworkInterfacesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeNetworkInterfaces") return } func NewDescribeNetworkInterfacesResponse() (response *DescribeNetworkInterfacesResponse) { response = &DescribeNetworkInterfacesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeNetworkInterfaces)用于查询弹性网卡列表。 func (c *Client) DescribeNetworkInterfaces(request *DescribeNetworkInterfacesRequest) (response *DescribeNetworkInterfacesResponse, err error) { if request == nil { request = NewDescribeNetworkInterfacesRequest() } response = NewDescribeNetworkInterfacesResponse() err = c.Send(request, response) return } func NewDescribeRouteConflictsRequest() (request *DescribeRouteConflictsRequest) { request = &DescribeRouteConflictsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeRouteConflicts") return } func NewDescribeRouteConflictsResponse() (response *DescribeRouteConflictsResponse) { response = &DescribeRouteConflictsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeRouteConflicts)用于查询自定义路由策略与云联网路由策略冲突列表 func (c *Client) DescribeRouteConflicts(request *DescribeRouteConflictsRequest) (response *DescribeRouteConflictsResponse, err error) { if request == nil { request = NewDescribeRouteConflictsRequest() } response = NewDescribeRouteConflictsResponse() err = c.Send(request, response) return } func NewDescribeRouteTablesRequest() (request *DescribeRouteTablesRequest) { request = &DescribeRouteTablesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeRouteTables") return } func NewDescribeRouteTablesResponse() (response *DescribeRouteTablesResponse) { response = &DescribeRouteTablesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeRouteTables)用于查询路由表。 func (c *Client) DescribeRouteTables(request *DescribeRouteTablesRequest) (response *DescribeRouteTablesResponse, err error) { if request == nil { request = NewDescribeRouteTablesRequest() } response = NewDescribeRouteTablesResponse() err = c.Send(request, response) return } func NewDescribeSecurityGroupAssociationStatisticsRequest() (request *DescribeSecurityGroupAssociationStatisticsRequest) { request = &DescribeSecurityGroupAssociationStatisticsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupAssociationStatistics") return } func NewDescribeSecurityGroupAssociationStatisticsResponse() (response *DescribeSecurityGroupAssociationStatisticsResponse) { response = &DescribeSecurityGroupAssociationStatisticsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeSecurityGroupAssociationStatistics)用于查询安全组关联的实例统计。 func (c *Client) DescribeSecurityGroupAssociationStatistics(request *DescribeSecurityGroupAssociationStatisticsRequest) (response *DescribeSecurityGroupAssociationStatisticsResponse, err error) { if request == nil { request = NewDescribeSecurityGroupAssociationStatisticsRequest() } response = NewDescribeSecurityGroupAssociationStatisticsResponse() err = c.Send(request, response) return } func NewDescribeSecurityGroupLimitsRequest() (request *DescribeSecurityGroupLimitsRequest) { request = &DescribeSecurityGroupLimitsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupLimits") return } func NewDescribeSecurityGroupLimitsResponse() (response *DescribeSecurityGroupLimitsResponse) { response = &DescribeSecurityGroupLimitsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeSecurityGroupLimits)用于查询用户安全组配额。 func (c *Client) DescribeSecurityGroupLimits(request *DescribeSecurityGroupLimitsRequest) (response *DescribeSecurityGroupLimitsResponse, err error) { if request == nil { request = NewDescribeSecurityGroupLimitsRequest() } response = NewDescribeSecurityGroupLimitsResponse() err = c.Send(request, response) return } func NewDescribeSecurityGroupPoliciesRequest() (request *DescribeSecurityGroupPoliciesRequest) { request = &DescribeSecurityGroupPoliciesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupPolicies") return } func NewDescribeSecurityGroupPoliciesResponse() (response *DescribeSecurityGroupPoliciesResponse) { response = &DescribeSecurityGroupPoliciesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeSecurityGroupPolicies)用于查询安全组规则。 func (c *Client) DescribeSecurityGroupPolicies(request *DescribeSecurityGroupPoliciesRequest) (response *DescribeSecurityGroupPoliciesResponse, err error) { if request == nil { request = NewDescribeSecurityGroupPoliciesRequest() } response = NewDescribeSecurityGroupPoliciesResponse() err = c.Send(request, response) return } func NewDescribeSecurityGroupReferencesRequest() (request *DescribeSecurityGroupReferencesRequest) { request = &DescribeSecurityGroupReferencesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroupReferences") return } func NewDescribeSecurityGroupReferencesResponse() (response *DescribeSecurityGroupReferencesResponse) { response = &DescribeSecurityGroupReferencesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeSecurityGroupReferences)用于查询安全组被引用信息。 func (c *Client) DescribeSecurityGroupReferences(request *DescribeSecurityGroupReferencesRequest) (response *DescribeSecurityGroupReferencesResponse, err error) { if request == nil { request = NewDescribeSecurityGroupReferencesRequest() } response = NewDescribeSecurityGroupReferencesResponse() err = c.Send(request, response) return } func NewDescribeSecurityGroupsRequest() (request *DescribeSecurityGroupsRequest) { request = &DescribeSecurityGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeSecurityGroups") return } func NewDescribeSecurityGroupsResponse() (response *DescribeSecurityGroupsResponse) { response = &DescribeSecurityGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeSecurityGroups)用于查询安全组。 func (c *Client) DescribeSecurityGroups(request *DescribeSecurityGroupsRequest) (response *DescribeSecurityGroupsResponse, err error) { if request == nil { request = NewDescribeSecurityGroupsRequest() } response = NewDescribeSecurityGroupsResponse() err = c.Send(request, response) return } func NewDescribeServiceTemplateGroupsRequest() (request *DescribeServiceTemplateGroupsRequest) { request = &DescribeServiceTemplateGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeServiceTemplateGroups") return } func NewDescribeServiceTemplateGroupsResponse() (response *DescribeServiceTemplateGroupsResponse) { response = &DescribeServiceTemplateGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeServiceTemplateGroups)用于查询协议端口模板集合 func (c *Client) DescribeServiceTemplateGroups(request *DescribeServiceTemplateGroupsRequest) (response *DescribeServiceTemplateGroupsResponse, err error) { if request == nil { request = NewDescribeServiceTemplateGroupsRequest() } response = NewDescribeServiceTemplateGroupsResponse() err = c.Send(request, response) return } func NewDescribeServiceTemplatesRequest() (request *DescribeServiceTemplatesRequest) { request = &DescribeServiceTemplatesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeServiceTemplates") return } func NewDescribeServiceTemplatesResponse() (response *DescribeServiceTemplatesResponse) { response = &DescribeServiceTemplatesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeServiceTemplates)用于查询协议端口模板 func (c *Client) DescribeServiceTemplates(request *DescribeServiceTemplatesRequest) (response *DescribeServiceTemplatesResponse, err error) { if request == nil { request = NewDescribeServiceTemplatesRequest() } response = NewDescribeServiceTemplatesResponse() err = c.Send(request, response) return } func NewDescribeSubnetsRequest() (request *DescribeSubnetsRequest) { request = &DescribeSubnetsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeSubnets") return } func NewDescribeSubnetsResponse() (response *DescribeSubnetsResponse) { response = &DescribeSubnetsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeSubnets)用于查询子网列表。 func (c *Client) DescribeSubnets(request *DescribeSubnetsRequest) (response *DescribeSubnetsResponse, err error) { if request == nil { request = NewDescribeSubnetsRequest() } response = NewDescribeSubnetsResponse() err = c.Send(request, response) return } func NewDescribeTaskResultRequest() (request *DescribeTaskResultRequest) { request = &DescribeTaskResultRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeTaskResult") return } func NewDescribeTaskResultResponse() (response *DescribeTaskResultResponse) { response = &DescribeTaskResultResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 查询EIP异步任务执行结果 func (c *Client) DescribeTaskResult(request *DescribeTaskResultRequest) (response *DescribeTaskResultResponse, err error) { if request == nil { request = NewDescribeTaskResultRequest() } response = NewDescribeTaskResultResponse() err = c.Send(request, response) return } func NewDescribeTemplateLimitsRequest() (request *DescribeTemplateLimitsRequest) { request = &DescribeTemplateLimitsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeTemplateLimits") return } func NewDescribeTemplateLimitsResponse() (response *DescribeTemplateLimitsResponse) { response = &DescribeTemplateLimitsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeTemplateLimits)用于查询参数模板配额列表。 func (c *Client) DescribeTemplateLimits(request *DescribeTemplateLimitsRequest) (response *DescribeTemplateLimitsResponse, err error) { if request == nil { request = NewDescribeTemplateLimitsRequest() } response = NewDescribeTemplateLimitsResponse() err = c.Send(request, response) return } func NewDescribeVpcInstancesRequest() (request *DescribeVpcInstancesRequest) { request = &DescribeVpcInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcInstances") return } func NewDescribeVpcInstancesResponse() (response *DescribeVpcInstancesResponse) { response = &DescribeVpcInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpcInstances)用于查询VPC下的云主机实例列表。 func (c *Client) DescribeVpcInstances(request *DescribeVpcInstancesRequest) (response *DescribeVpcInstancesResponse, err error) { if request == nil { request = NewDescribeVpcInstancesRequest() } response = NewDescribeVpcInstancesResponse() err = c.Send(request, response) return } func NewDescribeVpcIpv6AddressesRequest() (request *DescribeVpcIpv6AddressesRequest) { request = &DescribeVpcIpv6AddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcIpv6Addresses") return } func NewDescribeVpcIpv6AddressesResponse() (response *DescribeVpcIpv6AddressesResponse) { response = &DescribeVpcIpv6AddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpcIpv6Addresses)用于查询 `VPC` `IPv6` 信息。 // 只能查询已使用的`IPv6`信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。 func (c *Client) DescribeVpcIpv6Addresses(request *DescribeVpcIpv6AddressesRequest) (response *DescribeVpcIpv6AddressesResponse, err error) { if request == nil { request = NewDescribeVpcIpv6AddressesRequest() } response = NewDescribeVpcIpv6AddressesResponse() err = c.Send(request, response) return } func NewDescribeVpcLimitsRequest() (request *DescribeVpcLimitsRequest) { request = &DescribeVpcLimitsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcLimits") return } func NewDescribeVpcLimitsResponse() (response *DescribeVpcLimitsResponse) { response = &DescribeVpcLimitsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 获取私有网络配额,部分私有网络的配额有地域属性。 // LimitTypes取值范围: // * appid-max-vpcs (每个开发商每个地域可创建的VPC数) // * vpc-max-subnets(每个VPC可创建的子网数) // * vpc-max-route-tables(每个VPC可创建的路由表数) // * route-table-max-policies(每个路由表可添加的策略数) // * vpc-max-vpn-gateways(每个VPC可创建的VPN网关数) // * appid-max-custom-gateways(每个开发商可创建的对端网关数) // * appid-max-vpn-connections(每个开发商可创建的VPN通道数) // * custom-gateway-max-vpn-connections(每个对端网关可创建的VPN通道数) // * vpn-gateway-max-custom-gateways(每个VPNGW可以创建的通道数) // * vpc-max-network-acls(每个VPC可创建的网络ACL数) // * network-acl-max-inbound-policies(每个网络ACL可添加的入站规则数) // * network-acl-max-outbound-policies(每个网络ACL可添加的出站规则数) // * vpc-max-vpcpeers(每个VPC可创建的对等连接数) // * vpc-max-available-vpcpeers(每个VPC可创建的有效对等连接数) // * vpc-max-basic-network-interconnections(每个VPC可创建的基础网络云主机与VPC互通数) // * direct-connection-max-snats(每个专线网关可创建的SNAT数) // * direct-connection-max-dnats(每个专线网关可创建的DNAT数) // * direct-connection-max-snapts(每个专线网关可创建的SNAPT数) // * direct-connection-max-dnapts(每个专线网关可创建的DNAPT数) // * vpc-max-nat-gateways(每个VPC可创建的NAT网关数) // * nat-gateway-max-eips(每个NAT可以购买的外网IP数量) // * vpc-max-enis(每个VPC可创建弹性网卡数) // * vpc-max-havips(每个VPC可创建HAVIP数) // * eni-max-private-ips(每个ENI可以绑定的内网IP数(ENI未绑定子机)) // * nat-gateway-max-dnapts(每个NAT网关可创建的DNAPT数) // * vpc-max-ipv6s(每个VPC可分配的IPv6地址数) // * eni-max-ipv6s(每个ENI可分配的IPv6地址数) // * vpc-max-assistant_cidrs(每个VPC可分配的辅助CIDR数) func (c *Client) DescribeVpcLimits(request *DescribeVpcLimitsRequest) (response *DescribeVpcLimitsResponse, err error) { if request == nil { request = NewDescribeVpcLimitsRequest() } response = NewDescribeVpcLimitsResponse() err = c.Send(request, response) return } func NewDescribeVpcPrivateIpAddressesRequest() (request *DescribeVpcPrivateIpAddressesRequest) { request = &DescribeVpcPrivateIpAddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcPrivateIpAddresses") return } func NewDescribeVpcPrivateIpAddressesResponse() (response *DescribeVpcPrivateIpAddressesResponse) { response = &DescribeVpcPrivateIpAddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpcPrivateIpAddresses)用于查询VPC内网IP信息。<br /> // 只能查询已使用的IP信息,当查询未使用的IP时,本接口不会报错,但不会出现在返回结果里。 func (c *Client) DescribeVpcPrivateIpAddresses(request *DescribeVpcPrivateIpAddressesRequest) (response *DescribeVpcPrivateIpAddressesResponse, err error) { if request == nil { request = NewDescribeVpcPrivateIpAddressesRequest() } response = NewDescribeVpcPrivateIpAddressesResponse() err = c.Send(request, response) return } func NewDescribeVpcResourceDashboardRequest() (request *DescribeVpcResourceDashboardRequest) { request = &DescribeVpcResourceDashboardRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcResourceDashboard") return } func NewDescribeVpcResourceDashboardResponse() (response *DescribeVpcResourceDashboardResponse) { response = &DescribeVpcResourceDashboardResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpcResourceDashboard)用于查看VPC资源信息。 func (c *Client) DescribeVpcResourceDashboard(request *DescribeVpcResourceDashboardRequest) (response *DescribeVpcResourceDashboardResponse, err error) { if request == nil { request = NewDescribeVpcResourceDashboardRequest() } response = NewDescribeVpcResourceDashboardResponse() err = c.Send(request, response) return } func NewDescribeVpcsRequest() (request *DescribeVpcsRequest) { request = &DescribeVpcsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpcs") return } func NewDescribeVpcsResponse() (response *DescribeVpcsResponse) { response = &DescribeVpcsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpcs)用于查询私有网络列表。 func (c *Client) DescribeVpcs(request *DescribeVpcsRequest) (response *DescribeVpcsResponse, err error) { if request == nil { request = NewDescribeVpcsRequest() } response = NewDescribeVpcsResponse() err = c.Send(request, response) return } func NewDescribeVpnConnectionsRequest() (request *DescribeVpnConnectionsRequest) { request = &DescribeVpnConnectionsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnConnections") return } func NewDescribeVpnConnectionsResponse() (response *DescribeVpnConnectionsResponse) { response = &DescribeVpnConnectionsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpnConnections)查询VPN通道列表。 func (c *Client) DescribeVpnConnections(request *DescribeVpnConnectionsRequest) (response *DescribeVpnConnectionsResponse, err error) { if request == nil { request = NewDescribeVpnConnectionsRequest() } response = NewDescribeVpnConnectionsResponse() err = c.Send(request, response) return } func NewDescribeVpnGatewayCcnRoutesRequest() (request *DescribeVpnGatewayCcnRoutesRequest) { request = &DescribeVpnGatewayCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnGatewayCcnRoutes") return } func NewDescribeVpnGatewayCcnRoutesResponse() (response *DescribeVpnGatewayCcnRoutesResponse) { response = &DescribeVpnGatewayCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpnGatewayCcnRoutes)用于查询VPN网关云联网路由 func (c *Client) DescribeVpnGatewayCcnRoutes(request *DescribeVpnGatewayCcnRoutesRequest) (response *DescribeVpnGatewayCcnRoutesResponse, err error) { if request == nil { request = NewDescribeVpnGatewayCcnRoutesRequest() } response = NewDescribeVpnGatewayCcnRoutesResponse() err = c.Send(request, response) return } func NewDescribeVpnGatewaysRequest() (request *DescribeVpnGatewaysRequest) { request = &DescribeVpnGatewaysRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DescribeVpnGateways") return } func NewDescribeVpnGatewaysResponse() (response *DescribeVpnGatewaysResponse) { response = &DescribeVpnGatewaysResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DescribeVpnGateways)用于查询VPN网关列表。 func (c *Client) DescribeVpnGateways(request *DescribeVpnGatewaysRequest) (response *DescribeVpnGatewaysResponse, err error) { if request == nil { request = NewDescribeVpnGatewaysRequest() } response = NewDescribeVpnGatewaysResponse() err = c.Send(request, response) return } func NewDetachCcnInstancesRequest() (request *DetachCcnInstancesRequest) { request = &DetachCcnInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DetachCcnInstances") return } func NewDetachCcnInstancesResponse() (response *DetachCcnInstancesResponse) { response = &DetachCcnInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DetachCcnInstances)用于从云联网实例中解关联指定的网络实例。<br /> // 解关联网络实例后,相应的路由策略会一并删除。 func (c *Client) DetachCcnInstances(request *DetachCcnInstancesRequest) (response *DetachCcnInstancesResponse, err error) { if request == nil { request = NewDetachCcnInstancesRequest() } response = NewDetachCcnInstancesResponse() err = c.Send(request, response) return } func NewDetachClassicLinkVpcRequest() (request *DetachClassicLinkVpcRequest) { request = &DetachClassicLinkVpcRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DetachClassicLinkVpc") return } func NewDetachClassicLinkVpcResponse() (response *DetachClassicLinkVpcResponse) { response = &DetachClassicLinkVpcResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DetachClassicLinkVpc)用于删除私有网络和基础网络设备互通。 func (c *Client) DetachClassicLinkVpc(request *DetachClassicLinkVpcRequest) (response *DetachClassicLinkVpcResponse, err error) { if request == nil { request = NewDetachClassicLinkVpcRequest() } response = NewDetachClassicLinkVpcResponse() err = c.Send(request, response) return } func NewDetachNetworkInterfaceRequest() (request *DetachNetworkInterfaceRequest) { request = &DetachNetworkInterfaceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DetachNetworkInterface") return } func NewDetachNetworkInterfaceResponse() (response *DetachNetworkInterfaceResponse) { response = &DetachNetworkInterfaceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DetachNetworkInterface)用于弹性网卡解绑云主机。 func (c *Client) DetachNetworkInterface(request *DetachNetworkInterfaceRequest) (response *DetachNetworkInterfaceResponse, err error) { if request == nil { request = NewDetachNetworkInterfaceRequest() } response = NewDetachNetworkInterfaceResponse() err = c.Send(request, response) return } func NewDisableCcnRoutesRequest() (request *DisableCcnRoutesRequest) { request = &DisableCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisableCcnRoutes") return } func NewDisableCcnRoutesResponse() (response *DisableCcnRoutesResponse) { response = &DisableCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DisableCcnRoutes)用于禁用已经启用的云联网(CCN)路由 func (c *Client) DisableCcnRoutes(request *DisableCcnRoutesRequest) (response *DisableCcnRoutesResponse, err error) { if request == nil { request = NewDisableCcnRoutesRequest() } response = NewDisableCcnRoutesResponse() err = c.Send(request, response) return } func NewDisableGatewayFlowMonitorRequest() (request *DisableGatewayFlowMonitorRequest) { request = &DisableGatewayFlowMonitorRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisableGatewayFlowMonitor") return } func NewDisableGatewayFlowMonitorResponse() (response *DisableGatewayFlowMonitorResponse) { response = &DisableGatewayFlowMonitorResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DisableGatewayFlowMonitor)用于关闭网关流量监控。 func (c *Client) DisableGatewayFlowMonitor(request *DisableGatewayFlowMonitorRequest) (response *DisableGatewayFlowMonitorResponse, err error) { if request == nil { request = NewDisableGatewayFlowMonitorRequest() } response = NewDisableGatewayFlowMonitorResponse() err = c.Send(request, response) return } func NewDisableRoutesRequest() (request *DisableRoutesRequest) { request = &DisableRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisableRoutes") return } func NewDisableRoutesResponse() (response *DisableRoutesResponse) { response = &DisableRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DisableRoutes)用于禁用已启用的子网路由 func (c *Client) DisableRoutes(request *DisableRoutesRequest) (response *DisableRoutesResponse, err error) { if request == nil { request = NewDisableRoutesRequest() } response = NewDisableRoutesResponse() err = c.Send(request, response) return } func NewDisassociateAddressRequest() (request *DisassociateAddressRequest) { request = &DisassociateAddressRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisassociateAddress") return } func NewDisassociateAddressResponse() (response *DisassociateAddressResponse) { response = &DisassociateAddressResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (DisassociateAddress) 用于解绑[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 // * 支持CVM实例,弹性网卡上的EIP解绑 // * 不支持NAT上的EIP解绑。NAT上的EIP解绑请参考[EipUnBindNatGateway](https://cloud.tencent.com/document/product/215/4092) // * 只有状态为 BIND 和 BIND_ENI 的 EIP 才能进行解绑定操作。 // * EIP 如果被封堵,则不能进行解绑定操作。 func (c *Client) DisassociateAddress(request *DisassociateAddressRequest) (response *DisassociateAddressResponse, err error) { if request == nil { request = NewDisassociateAddressRequest() } response = NewDisassociateAddressResponse() err = c.Send(request, response) return } func NewDisassociateDhcpIpWithAddressIpRequest() (request *DisassociateDhcpIpWithAddressIpRequest) { request = &DisassociateDhcpIpWithAddressIpRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisassociateDhcpIpWithAddressIp") return } func NewDisassociateDhcpIpWithAddressIpResponse() (response *DisassociateDhcpIpWithAddressIpResponse) { response = &DisassociateDhcpIpWithAddressIpResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DisassociateDhcpIpWithAddressIp)用于将DhcpIp已绑定的弹性公网IP(EIP)解除绑定。<br /> func (c *Client) DisassociateDhcpIpWithAddressIp(request *DisassociateDhcpIpWithAddressIpRequest) (response *DisassociateDhcpIpWithAddressIpResponse, err error) { if request == nil { request = NewDisassociateDhcpIpWithAddressIpRequest() } response = NewDisassociateDhcpIpWithAddressIpResponse() err = c.Send(request, response) return } func NewDisassociateNatGatewayAddressRequest() (request *DisassociateNatGatewayAddressRequest) { request = &DisassociateNatGatewayAddressRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisassociateNatGatewayAddress") return } func NewDisassociateNatGatewayAddressResponse() (response *DisassociateNatGatewayAddressResponse) { response = &DisassociateNatGatewayAddressResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DisassociateNatGatewayAddress)用于NAT网关解绑弹性IP。 func (c *Client) DisassociateNatGatewayAddress(request *DisassociateNatGatewayAddressRequest) (response *DisassociateNatGatewayAddressResponse, err error) { if request == nil { request = NewDisassociateNatGatewayAddressRequest() } response = NewDisassociateNatGatewayAddressResponse() err = c.Send(request, response) return } func NewDisassociateNetworkAclSubnetsRequest() (request *DisassociateNetworkAclSubnetsRequest) { request = &DisassociateNetworkAclSubnetsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisassociateNetworkAclSubnets") return } func NewDisassociateNetworkAclSubnetsResponse() (response *DisassociateNetworkAclSubnetsResponse) { response = &DisassociateNetworkAclSubnetsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DisassociateNetworkAclSubnets)用于网络ACL解关联vpc下的子网。 func (c *Client) DisassociateNetworkAclSubnets(request *DisassociateNetworkAclSubnetsRequest) (response *DisassociateNetworkAclSubnetsResponse, err error) { if request == nil { request = NewDisassociateNetworkAclSubnetsRequest() } response = NewDisassociateNetworkAclSubnetsResponse() err = c.Send(request, response) return } func NewDisassociateNetworkInterfaceSecurityGroupsRequest() (request *DisassociateNetworkInterfaceSecurityGroupsRequest) { request = &DisassociateNetworkInterfaceSecurityGroupsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DisassociateNetworkInterfaceSecurityGroups") return } func NewDisassociateNetworkInterfaceSecurityGroupsResponse() (response *DisassociateNetworkInterfaceSecurityGroupsResponse) { response = &DisassociateNetworkInterfaceSecurityGroupsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DisassociateNetworkInterfaceSecurityGroups)用于弹性网卡解绑安全组。支持弹性网卡完全解绑安全组。 func (c *Client) DisassociateNetworkInterfaceSecurityGroups(request *DisassociateNetworkInterfaceSecurityGroupsRequest) (response *DisassociateNetworkInterfaceSecurityGroupsResponse, err error) { if request == nil { request = NewDisassociateNetworkInterfaceSecurityGroupsRequest() } response = NewDisassociateNetworkInterfaceSecurityGroupsResponse() err = c.Send(request, response) return } func NewDownloadCustomerGatewayConfigurationRequest() (request *DownloadCustomerGatewayConfigurationRequest) { request = &DownloadCustomerGatewayConfigurationRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "DownloadCustomerGatewayConfiguration") return } func NewDownloadCustomerGatewayConfigurationResponse() (response *DownloadCustomerGatewayConfigurationResponse) { response = &DownloadCustomerGatewayConfigurationResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(DownloadCustomerGatewayConfiguration)用于下载VPN通道配置。 func (c *Client) DownloadCustomerGatewayConfiguration(request *DownloadCustomerGatewayConfigurationRequest) (response *DownloadCustomerGatewayConfigurationResponse, err error) { if request == nil { request = NewDownloadCustomerGatewayConfigurationRequest() } response = NewDownloadCustomerGatewayConfigurationResponse() err = c.Send(request, response) return } func NewEnableCcnRoutesRequest() (request *EnableCcnRoutesRequest) { request = &EnableCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "EnableCcnRoutes") return } func NewEnableCcnRoutesResponse() (response *EnableCcnRoutesResponse) { response = &EnableCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(EnableCcnRoutes)用于启用已经加入云联网(CCN)的路由。<br /> // 本接口会校验启用后,是否与已有路由冲突,如果冲突,则无法启用,失败处理。路由冲突时,需要先禁用与之冲突的路由,才能启用该路由。 func (c *Client) EnableCcnRoutes(request *EnableCcnRoutesRequest) (response *EnableCcnRoutesResponse, err error) { if request == nil { request = NewEnableCcnRoutesRequest() } response = NewEnableCcnRoutesResponse() err = c.Send(request, response) return } func NewEnableGatewayFlowMonitorRequest() (request *EnableGatewayFlowMonitorRequest) { request = &EnableGatewayFlowMonitorRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "EnableGatewayFlowMonitor") return } func NewEnableGatewayFlowMonitorResponse() (response *EnableGatewayFlowMonitorResponse) { response = &EnableGatewayFlowMonitorResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(EnableGatewayFlowMonitor)用于开启网关流量监控。 func (c *Client) EnableGatewayFlowMonitor(request *EnableGatewayFlowMonitorRequest) (response *EnableGatewayFlowMonitorResponse, err error) { if request == nil { request = NewEnableGatewayFlowMonitorRequest() } response = NewEnableGatewayFlowMonitorResponse() err = c.Send(request, response) return } func NewEnableRoutesRequest() (request *EnableRoutesRequest) { request = &EnableRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "EnableRoutes") return } func NewEnableRoutesResponse() (response *EnableRoutesResponse) { response = &EnableRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(EnableRoutes)用于启用已禁用的子网路由。<br /> // 本接口会校验启用后,是否与已有路由冲突,如果冲突,则无法启用,失败处理。路由冲突时,需要先禁用与之冲突的路由,才能启用该路由。 func (c *Client) EnableRoutes(request *EnableRoutesRequest) (response *EnableRoutesResponse, err error) { if request == nil { request = NewEnableRoutesRequest() } response = NewEnableRoutesResponse() err = c.Send(request, response) return } func NewGetCcnRegionBandwidthLimitsRequest() (request *GetCcnRegionBandwidthLimitsRequest) { request = &GetCcnRegionBandwidthLimitsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "GetCcnRegionBandwidthLimits") return } func NewGetCcnRegionBandwidthLimitsResponse() (response *GetCcnRegionBandwidthLimitsResponse) { response = &GetCcnRegionBandwidthLimitsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(GetCcnRegionBandwidthLimits)用于查询云联网相关地域带宽信息,其中预付费模式的云联网仅支持地域间限速,后付费模式的云联网支持地域间限速和地域出口限速。 func (c *Client) GetCcnRegionBandwidthLimits(request *GetCcnRegionBandwidthLimitsRequest) (response *GetCcnRegionBandwidthLimitsResponse, err error) { if request == nil { request = NewGetCcnRegionBandwidthLimitsRequest() } response = NewGetCcnRegionBandwidthLimitsResponse() err = c.Send(request, response) return } func NewHaVipAssociateAddressIpRequest() (request *HaVipAssociateAddressIpRequest) { request = &HaVipAssociateAddressIpRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "HaVipAssociateAddressIp") return } func NewHaVipAssociateAddressIpResponse() (response *HaVipAssociateAddressIpResponse) { response = &HaVipAssociateAddressIpResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(HaVipAssociateAddressIp)用于高可用虚拟IP(HAVIP)绑定弹性公网IP(EIP)<br /> // 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口 func (c *Client) HaVipAssociateAddressIp(request *HaVipAssociateAddressIpRequest) (response *HaVipAssociateAddressIpResponse, err error) { if request == nil { request = NewHaVipAssociateAddressIpRequest() } response = NewHaVipAssociateAddressIpResponse() err = c.Send(request, response) return } func NewHaVipDisassociateAddressIpRequest() (request *HaVipDisassociateAddressIpRequest) { request = &HaVipDisassociateAddressIpRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "HaVipDisassociateAddressIp") return } func NewHaVipDisassociateAddressIpResponse() (response *HaVipDisassociateAddressIpResponse) { response = &HaVipDisassociateAddressIpResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(HaVipDisassociateAddressIp)用于将高可用虚拟IP(HAVIP)已绑定的弹性公网IP(EIP)解除绑定<br /> // 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口 func (c *Client) HaVipDisassociateAddressIp(request *HaVipDisassociateAddressIpRequest) (response *HaVipDisassociateAddressIpResponse, err error) { if request == nil { request = NewHaVipDisassociateAddressIpRequest() } response = NewHaVipDisassociateAddressIpResponse() err = c.Send(request, response) return } func NewInquiryPriceCreateVpnGatewayRequest() (request *InquiryPriceCreateVpnGatewayRequest) { request = &InquiryPriceCreateVpnGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "InquiryPriceCreateVpnGateway") return } func NewInquiryPriceCreateVpnGatewayResponse() (response *InquiryPriceCreateVpnGatewayResponse) { response = &InquiryPriceCreateVpnGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(InquiryPriceCreateVpnGateway)用于创建VPN网关询价。 func (c *Client) InquiryPriceCreateVpnGateway(request *InquiryPriceCreateVpnGatewayRequest) (response *InquiryPriceCreateVpnGatewayResponse, err error) { if request == nil { request = NewInquiryPriceCreateVpnGatewayRequest() } response = NewInquiryPriceCreateVpnGatewayResponse() err = c.Send(request, response) return } func NewInquiryPriceRenewVpnGatewayRequest() (request *InquiryPriceRenewVpnGatewayRequest) { request = &InquiryPriceRenewVpnGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "InquiryPriceRenewVpnGateway") return } func NewInquiryPriceRenewVpnGatewayResponse() (response *InquiryPriceRenewVpnGatewayResponse) { response = &InquiryPriceRenewVpnGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(InquiryPriceRenewVpnGateway)用于续费VPN网关询价。目前仅支持IPSEC类型网关的询价。 func (c *Client) InquiryPriceRenewVpnGateway(request *InquiryPriceRenewVpnGatewayRequest) (response *InquiryPriceRenewVpnGatewayResponse, err error) { if request == nil { request = NewInquiryPriceRenewVpnGatewayRequest() } response = NewInquiryPriceRenewVpnGatewayResponse() err = c.Send(request, response) return } func NewInquiryPriceResetVpnGatewayInternetMaxBandwidthRequest() (request *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) { request = &InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "InquiryPriceResetVpnGatewayInternetMaxBandwidth") return } func NewInquiryPriceResetVpnGatewayInternetMaxBandwidthResponse() (response *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse) { response = &InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(InquiryPriceResetVpnGatewayInternetMaxBandwidth)调整VPN网关带宽上限询价。 func (c *Client) InquiryPriceResetVpnGatewayInternetMaxBandwidth(request *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) (response *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse, err error) { if request == nil { request = NewInquiryPriceResetVpnGatewayInternetMaxBandwidthRequest() } response = NewInquiryPriceResetVpnGatewayInternetMaxBandwidthResponse() err = c.Send(request, response) return } func NewMigrateNetworkInterfaceRequest() (request *MigrateNetworkInterfaceRequest) { request = &MigrateNetworkInterfaceRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "MigrateNetworkInterface") return } func NewMigrateNetworkInterfaceResponse() (response *MigrateNetworkInterfaceResponse) { response = &MigrateNetworkInterfaceResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(MigrateNetworkInterface)用于弹性网卡迁移。 func (c *Client) MigrateNetworkInterface(request *MigrateNetworkInterfaceRequest) (response *MigrateNetworkInterfaceResponse, err error) { if request == nil { request = NewMigrateNetworkInterfaceRequest() } response = NewMigrateNetworkInterfaceResponse() err = c.Send(request, response) return } func NewMigratePrivateIpAddressRequest() (request *MigratePrivateIpAddressRequest) { request = &MigratePrivateIpAddressRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "MigratePrivateIpAddress") return } func NewMigratePrivateIpAddressResponse() (response *MigratePrivateIpAddressResponse) { response = &MigratePrivateIpAddressResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(MigratePrivateIpAddress)用于弹性网卡内网IP迁移。 // // * 该接口用于将一个内网IP从一个弹性网卡上迁移到另外一个弹性网卡,主IP地址不支持迁移。 // * 迁移前后的弹性网卡必须在同一个子网内。 func (c *Client) MigratePrivateIpAddress(request *MigratePrivateIpAddressRequest) (response *MigratePrivateIpAddressResponse, err error) { if request == nil { request = NewMigratePrivateIpAddressRequest() } response = NewMigratePrivateIpAddressResponse() err = c.Send(request, response) return } func NewModifyAddressAttributeRequest() (request *ModifyAddressAttributeRequest) { request = &ModifyAddressAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressAttribute") return } func NewModifyAddressAttributeResponse() (response *ModifyAddressAttributeResponse) { response = &ModifyAddressAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ModifyAddressAttribute) 用于修改[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)的名称。 func (c *Client) ModifyAddressAttribute(request *ModifyAddressAttributeRequest) (response *ModifyAddressAttributeResponse, err error) { if request == nil { request = NewModifyAddressAttributeRequest() } response = NewModifyAddressAttributeResponse() err = c.Send(request, response) return } func NewModifyAddressInternetChargeTypeRequest() (request *ModifyAddressInternetChargeTypeRequest) { request = &ModifyAddressInternetChargeTypeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressInternetChargeType") return } func NewModifyAddressInternetChargeTypeResponse() (response *ModifyAddressInternetChargeTypeResponse) { response = &ModifyAddressInternetChargeTypeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 该接口用于调整具有带宽属性弹性公网IP的网络计费模式 // * 支持BANDWIDTH_PREPAID_BY_MONTH和TRAFFIC_POSTPAID_BY_HOUR两种网络计费模式之间的切换。 // * 每个弹性公网IP支持调整两次,次数超出则无法调整。 func (c *Client) ModifyAddressInternetChargeType(request *ModifyAddressInternetChargeTypeRequest) (response *ModifyAddressInternetChargeTypeResponse, err error) { if request == nil { request = NewModifyAddressInternetChargeTypeRequest() } response = NewModifyAddressInternetChargeTypeResponse() err = c.Send(request, response) return } func NewModifyAddressTemplateAttributeRequest() (request *ModifyAddressTemplateAttributeRequest) { request = &ModifyAddressTemplateAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressTemplateAttribute") return } func NewModifyAddressTemplateAttributeResponse() (response *ModifyAddressTemplateAttributeResponse) { response = &ModifyAddressTemplateAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyAddressTemplateAttribute)用于修改IP地址模板 func (c *Client) ModifyAddressTemplateAttribute(request *ModifyAddressTemplateAttributeRequest) (response *ModifyAddressTemplateAttributeResponse, err error) { if request == nil { request = NewModifyAddressTemplateAttributeRequest() } response = NewModifyAddressTemplateAttributeResponse() err = c.Send(request, response) return } func NewModifyAddressTemplateGroupAttributeRequest() (request *ModifyAddressTemplateGroupAttributeRequest) { request = &ModifyAddressTemplateGroupAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressTemplateGroupAttribute") return } func NewModifyAddressTemplateGroupAttributeResponse() (response *ModifyAddressTemplateGroupAttributeResponse) { response = &ModifyAddressTemplateGroupAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyAddressTemplateGroupAttribute)用于修改IP地址模板集合 func (c *Client) ModifyAddressTemplateGroupAttribute(request *ModifyAddressTemplateGroupAttributeRequest) (response *ModifyAddressTemplateGroupAttributeResponse, err error) { if request == nil { request = NewModifyAddressTemplateGroupAttributeRequest() } response = NewModifyAddressTemplateGroupAttributeResponse() err = c.Send(request, response) return } func NewModifyAddressesBandwidthRequest() (request *ModifyAddressesBandwidthRequest) { request = &ModifyAddressesBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyAddressesBandwidth") return } func NewModifyAddressesBandwidthResponse() (response *ModifyAddressesBandwidthResponse) { response = &ModifyAddressesBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyAddressesBandwidth)用于调整[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称EIP)带宽,包括后付费EIP, 预付费EIP和带宽包EIP func (c *Client) ModifyAddressesBandwidth(request *ModifyAddressesBandwidthRequest) (response *ModifyAddressesBandwidthResponse, err error) { if request == nil { request = NewModifyAddressesBandwidthRequest() } response = NewModifyAddressesBandwidthResponse() err = c.Send(request, response) return } func NewModifyAssistantCidrRequest() (request *ModifyAssistantCidrRequest) { request = &ModifyAssistantCidrRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyAssistantCidr") return } func NewModifyAssistantCidrResponse() (response *ModifyAssistantCidrResponse) { response = &ModifyAssistantCidrResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyAssistantCidr)用于批量修改辅助CIDR,支持新增和删除。(接口灰度中,如需使用请提工单。) func (c *Client) ModifyAssistantCidr(request *ModifyAssistantCidrRequest) (response *ModifyAssistantCidrResponse, err error) { if request == nil { request = NewModifyAssistantCidrRequest() } response = NewModifyAssistantCidrResponse() err = c.Send(request, response) return } func NewModifyBandwidthPackageAttributeRequest() (request *ModifyBandwidthPackageAttributeRequest) { request = &ModifyBandwidthPackageAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyBandwidthPackageAttribute") return } func NewModifyBandwidthPackageAttributeResponse() (response *ModifyBandwidthPackageAttributeResponse) { response = &ModifyBandwidthPackageAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 接口用于修改带宽包属性,包括带宽包名字等 func (c *Client) ModifyBandwidthPackageAttribute(request *ModifyBandwidthPackageAttributeRequest) (response *ModifyBandwidthPackageAttributeResponse, err error) { if request == nil { request = NewModifyBandwidthPackageAttributeRequest() } response = NewModifyBandwidthPackageAttributeResponse() err = c.Send(request, response) return } func NewModifyCcnAttributeRequest() (request *ModifyCcnAttributeRequest) { request = &ModifyCcnAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyCcnAttribute") return } func NewModifyCcnAttributeResponse() (response *ModifyCcnAttributeResponse) { response = &ModifyCcnAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyCcnAttribute)用于修改云联网(CCN)的相关属性。 func (c *Client) ModifyCcnAttribute(request *ModifyCcnAttributeRequest) (response *ModifyCcnAttributeResponse, err error) { if request == nil { request = NewModifyCcnAttributeRequest() } response = NewModifyCcnAttributeResponse() err = c.Send(request, response) return } func NewModifyCcnRegionBandwidthLimitsTypeRequest() (request *ModifyCcnRegionBandwidthLimitsTypeRequest) { request = &ModifyCcnRegionBandwidthLimitsTypeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyCcnRegionBandwidthLimitsType") return } func NewModifyCcnRegionBandwidthLimitsTypeResponse() (response *ModifyCcnRegionBandwidthLimitsTypeResponse) { response = &ModifyCcnRegionBandwidthLimitsTypeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyCcnRegionBandwidthLimitsType)用于修改后付费云联网实例修改带宽限速策略。 func (c *Client) ModifyCcnRegionBandwidthLimitsType(request *ModifyCcnRegionBandwidthLimitsTypeRequest) (response *ModifyCcnRegionBandwidthLimitsTypeResponse, err error) { if request == nil { request = NewModifyCcnRegionBandwidthLimitsTypeRequest() } response = NewModifyCcnRegionBandwidthLimitsTypeResponse() err = c.Send(request, response) return } func NewModifyCustomerGatewayAttributeRequest() (request *ModifyCustomerGatewayAttributeRequest) { request = &ModifyCustomerGatewayAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyCustomerGatewayAttribute") return } func NewModifyCustomerGatewayAttributeResponse() (response *ModifyCustomerGatewayAttributeResponse) { response = &ModifyCustomerGatewayAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyCustomerGatewayAttribute)用于修改对端网关信息。 func (c *Client) ModifyCustomerGatewayAttribute(request *ModifyCustomerGatewayAttributeRequest) (response *ModifyCustomerGatewayAttributeResponse, err error) { if request == nil { request = NewModifyCustomerGatewayAttributeRequest() } response = NewModifyCustomerGatewayAttributeResponse() err = c.Send(request, response) return } func NewModifyDhcpIpAttributeRequest() (request *ModifyDhcpIpAttributeRequest) { request = &ModifyDhcpIpAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyDhcpIpAttribute") return } func NewModifyDhcpIpAttributeResponse() (response *ModifyDhcpIpAttributeResponse) { response = &ModifyDhcpIpAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyDhcpIpAttribute)用于修改DhcpIp属性 func (c *Client) ModifyDhcpIpAttribute(request *ModifyDhcpIpAttributeRequest) (response *ModifyDhcpIpAttributeResponse, err error) { if request == nil { request = NewModifyDhcpIpAttributeRequest() } response = NewModifyDhcpIpAttributeResponse() err = c.Send(request, response) return } func NewModifyDirectConnectGatewayAttributeRequest() (request *ModifyDirectConnectGatewayAttributeRequest) { request = &ModifyDirectConnectGatewayAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyDirectConnectGatewayAttribute") return } func NewModifyDirectConnectGatewayAttributeResponse() (response *ModifyDirectConnectGatewayAttributeResponse) { response = &ModifyDirectConnectGatewayAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyDirectConnectGatewayAttribute)用于修改专线网关属性 func (c *Client) ModifyDirectConnectGatewayAttribute(request *ModifyDirectConnectGatewayAttributeRequest) (response *ModifyDirectConnectGatewayAttributeResponse, err error) { if request == nil { request = NewModifyDirectConnectGatewayAttributeRequest() } response = NewModifyDirectConnectGatewayAttributeResponse() err = c.Send(request, response) return } func NewModifyFlowLogAttributeRequest() (request *ModifyFlowLogAttributeRequest) { request = &ModifyFlowLogAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyFlowLogAttribute") return } func NewModifyFlowLogAttributeResponse() (response *ModifyFlowLogAttributeResponse) { response = &ModifyFlowLogAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyFlowLogAttribute)用于修改流日志属性 func (c *Client) ModifyFlowLogAttribute(request *ModifyFlowLogAttributeRequest) (response *ModifyFlowLogAttributeResponse, err error) { if request == nil { request = NewModifyFlowLogAttributeRequest() } response = NewModifyFlowLogAttributeResponse() err = c.Send(request, response) return } func NewModifyGatewayFlowQosRequest() (request *ModifyGatewayFlowQosRequest) { request = &ModifyGatewayFlowQosRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyGatewayFlowQos") return } func NewModifyGatewayFlowQosResponse() (response *ModifyGatewayFlowQosResponse) { response = &ModifyGatewayFlowQosResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyGatewayFlowQos)用于调整网关流控带宽。 func (c *Client) ModifyGatewayFlowQos(request *ModifyGatewayFlowQosRequest) (response *ModifyGatewayFlowQosResponse, err error) { if request == nil { request = NewModifyGatewayFlowQosRequest() } response = NewModifyGatewayFlowQosResponse() err = c.Send(request, response) return } func NewModifyHaVipAttributeRequest() (request *ModifyHaVipAttributeRequest) { request = &ModifyHaVipAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyHaVipAttribute") return } func NewModifyHaVipAttributeResponse() (response *ModifyHaVipAttributeResponse) { response = &ModifyHaVipAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyHaVipAttribute)用于修改高可用虚拟IP(HAVIP)属性 func (c *Client) ModifyHaVipAttribute(request *ModifyHaVipAttributeRequest) (response *ModifyHaVipAttributeResponse, err error) { if request == nil { request = NewModifyHaVipAttributeRequest() } response = NewModifyHaVipAttributeResponse() err = c.Send(request, response) return } func NewModifyIp6AddressesBandwidthRequest() (request *ModifyIp6AddressesBandwidthRequest) { request = &ModifyIp6AddressesBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6AddressesBandwidth") return } func NewModifyIp6AddressesBandwidthResponse() (response *ModifyIp6AddressesBandwidthResponse) { response = &ModifyIp6AddressesBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 该接口用于修改IPV6地址访问internet的带宽 func (c *Client) ModifyIp6AddressesBandwidth(request *ModifyIp6AddressesBandwidthRequest) (response *ModifyIp6AddressesBandwidthResponse, err error) { if request == nil { request = NewModifyIp6AddressesBandwidthRequest() } response = NewModifyIp6AddressesBandwidthResponse() err = c.Send(request, response) return } func NewModifyIp6RuleRequest() (request *ModifyIp6RuleRequest) { request = &ModifyIp6RuleRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6Rule") return } func NewModifyIp6RuleResponse() (response *ModifyIp6RuleResponse) { response = &ModifyIp6RuleResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 该接口用于修改IPV6转换规则,当前仅支持修改转换规则名称,IPV4地址和IPV4端口号 func (c *Client) ModifyIp6Rule(request *ModifyIp6RuleRequest) (response *ModifyIp6RuleResponse, err error) { if request == nil { request = NewModifyIp6RuleRequest() } response = NewModifyIp6RuleResponse() err = c.Send(request, response) return } func NewModifyIp6TranslatorRequest() (request *ModifyIp6TranslatorRequest) { request = &ModifyIp6TranslatorRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyIp6Translator") return } func NewModifyIp6TranslatorResponse() (response *ModifyIp6TranslatorResponse) { response = &ModifyIp6TranslatorResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 该接口用于修改IP6转换实例属性,当前仅支持修改实例名称。 func (c *Client) ModifyIp6Translator(request *ModifyIp6TranslatorRequest) (response *ModifyIp6TranslatorResponse, err error) { if request == nil { request = NewModifyIp6TranslatorRequest() } response = NewModifyIp6TranslatorResponse() err = c.Send(request, response) return } func NewModifyIpv6AddressesAttributeRequest() (request *ModifyIpv6AddressesAttributeRequest) { request = &ModifyIpv6AddressesAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyIpv6AddressesAttribute") return } func NewModifyIpv6AddressesAttributeResponse() (response *ModifyIpv6AddressesAttributeResponse) { response = &ModifyIpv6AddressesAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyIpv6AddressesAttribute)用于修改弹性网卡内网IPv6地址属性。 func (c *Client) ModifyIpv6AddressesAttribute(request *ModifyIpv6AddressesAttributeRequest) (response *ModifyIpv6AddressesAttributeResponse, err error) { if request == nil { request = NewModifyIpv6AddressesAttributeRequest() } response = NewModifyIpv6AddressesAttributeResponse() err = c.Send(request, response) return } func NewModifyNatGatewayAttributeRequest() (request *ModifyNatGatewayAttributeRequest) { request = &ModifyNatGatewayAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyNatGatewayAttribute") return } func NewModifyNatGatewayAttributeResponse() (response *ModifyNatGatewayAttributeResponse) { response = &ModifyNatGatewayAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyNatGatewayAttribute)用于修改NAT网关的属性。 func (c *Client) ModifyNatGatewayAttribute(request *ModifyNatGatewayAttributeRequest) (response *ModifyNatGatewayAttributeResponse, err error) { if request == nil { request = NewModifyNatGatewayAttributeRequest() } response = NewModifyNatGatewayAttributeResponse() err = c.Send(request, response) return } func NewModifyNatGatewayDestinationIpPortTranslationNatRuleRequest() (request *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) { request = &ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyNatGatewayDestinationIpPortTranslationNatRule") return } func NewModifyNatGatewayDestinationIpPortTranslationNatRuleResponse() (response *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse) { response = &ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyNatGatewayDestinationIpPortTranslationNatRule)用于修改NAT网关端口转发规则。 func (c *Client) ModifyNatGatewayDestinationIpPortTranslationNatRule(request *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) (response *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse, err error) { if request == nil { request = NewModifyNatGatewayDestinationIpPortTranslationNatRuleRequest() } response = NewModifyNatGatewayDestinationIpPortTranslationNatRuleResponse() err = c.Send(request, response) return } func NewModifyNetDetectRequest() (request *ModifyNetDetectRequest) { request = &ModifyNetDetectRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetDetect") return } func NewModifyNetDetectResponse() (response *ModifyNetDetectResponse) { response = &ModifyNetDetectResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyNetDetect)用于修改网络探测参数。 func (c *Client) ModifyNetDetect(request *ModifyNetDetectRequest) (response *ModifyNetDetectResponse, err error) { if request == nil { request = NewModifyNetDetectRequest() } response = NewModifyNetDetectResponse() err = c.Send(request, response) return } func NewModifyNetworkAclAttributeRequest() (request *ModifyNetworkAclAttributeRequest) { request = &ModifyNetworkAclAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkAclAttribute") return } func NewModifyNetworkAclAttributeResponse() (response *ModifyNetworkAclAttributeResponse) { response = &ModifyNetworkAclAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyNetworkAclAttribute)用于修改网络ACL属性。 func (c *Client) ModifyNetworkAclAttribute(request *ModifyNetworkAclAttributeRequest) (response *ModifyNetworkAclAttributeResponse, err error) { if request == nil { request = NewModifyNetworkAclAttributeRequest() } response = NewModifyNetworkAclAttributeResponse() err = c.Send(request, response) return } func NewModifyNetworkAclEntriesRequest() (request *ModifyNetworkAclEntriesRequest) { request = &ModifyNetworkAclEntriesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkAclEntries") return } func NewModifyNetworkAclEntriesResponse() (response *ModifyNetworkAclEntriesResponse) { response = &ModifyNetworkAclEntriesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyNetworkAclEntries)用于修改(包括添加和删除)网络ACL的入站规则和出站规则。在NetworkAclEntrySet参数中: // * 若同时传入入站规则和出站规则,则重置原有的入站规则和出站规则,并分别导入传入的规则。 // * 若仅传入入站规则,则仅重置原有的入站规则,并导入传入的规则,不影响原有的出站规则(若仅传入出站规则,处理方式类似入站方向)。 func (c *Client) ModifyNetworkAclEntries(request *ModifyNetworkAclEntriesRequest) (response *ModifyNetworkAclEntriesResponse, err error) { if request == nil { request = NewModifyNetworkAclEntriesRequest() } response = NewModifyNetworkAclEntriesResponse() err = c.Send(request, response) return } func NewModifyNetworkInterfaceAttributeRequest() (request *ModifyNetworkInterfaceAttributeRequest) { request = &ModifyNetworkInterfaceAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyNetworkInterfaceAttribute") return } func NewModifyNetworkInterfaceAttributeResponse() (response *ModifyNetworkInterfaceAttributeResponse) { response = &ModifyNetworkInterfaceAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyNetworkInterfaceAttribute)用于修改弹性网卡属性。 func (c *Client) ModifyNetworkInterfaceAttribute(request *ModifyNetworkInterfaceAttributeRequest) (response *ModifyNetworkInterfaceAttributeResponse, err error) { if request == nil { request = NewModifyNetworkInterfaceAttributeRequest() } response = NewModifyNetworkInterfaceAttributeResponse() err = c.Send(request, response) return } func NewModifyPrivateIpAddressesAttributeRequest() (request *ModifyPrivateIpAddressesAttributeRequest) { request = &ModifyPrivateIpAddressesAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyPrivateIpAddressesAttribute") return } func NewModifyPrivateIpAddressesAttributeResponse() (response *ModifyPrivateIpAddressesAttributeResponse) { response = &ModifyPrivateIpAddressesAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyPrivateIpAddressesAttribute)用于修改弹性网卡内网IP属性。 func (c *Client) ModifyPrivateIpAddressesAttribute(request *ModifyPrivateIpAddressesAttributeRequest) (response *ModifyPrivateIpAddressesAttributeResponse, err error) { if request == nil { request = NewModifyPrivateIpAddressesAttributeRequest() } response = NewModifyPrivateIpAddressesAttributeResponse() err = c.Send(request, response) return } func NewModifyRouteTableAttributeRequest() (request *ModifyRouteTableAttributeRequest) { request = &ModifyRouteTableAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyRouteTableAttribute") return } func NewModifyRouteTableAttributeResponse() (response *ModifyRouteTableAttributeResponse) { response = &ModifyRouteTableAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyRouteTableAttribute)用于修改路由表(RouteTable)属性。 func (c *Client) ModifyRouteTableAttribute(request *ModifyRouteTableAttributeRequest) (response *ModifyRouteTableAttributeResponse, err error) { if request == nil { request = NewModifyRouteTableAttributeRequest() } response = NewModifyRouteTableAttributeResponse() err = c.Send(request, response) return } func NewModifySecurityGroupAttributeRequest() (request *ModifySecurityGroupAttributeRequest) { request = &ModifySecurityGroupAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifySecurityGroupAttribute") return } func NewModifySecurityGroupAttributeResponse() (response *ModifySecurityGroupAttributeResponse) { response = &ModifySecurityGroupAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifySecurityGroupAttribute)用于修改安全组(SecurityGroupPolicy)属性。 func (c *Client) ModifySecurityGroupAttribute(request *ModifySecurityGroupAttributeRequest) (response *ModifySecurityGroupAttributeResponse, err error) { if request == nil { request = NewModifySecurityGroupAttributeRequest() } response = NewModifySecurityGroupAttributeResponse() err = c.Send(request, response) return } func NewModifySecurityGroupPoliciesRequest() (request *ModifySecurityGroupPoliciesRequest) { request = &ModifySecurityGroupPoliciesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifySecurityGroupPolicies") return } func NewModifySecurityGroupPoliciesResponse() (response *ModifySecurityGroupPoliciesResponse) { response = &ModifySecurityGroupPoliciesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifySecurityGroupPolicies)用于重置安全组出站和入站规则(SecurityGroupPolicy)。 // // <ul> // <li>接口是先删除当前所有的出入站规则,然后再添加 Egress 和 Ingress 规则,不支持自定义索引 PolicyIndex。</li> // <li>在 SecurityGroupPolicySet 参数中:<ul> // <li> 如果指定 SecurityGroupPolicySet.Version 为0, 表示清空所有规则,并忽略 Egress 和 Ingress。</li> // <li> 如果指定 SecurityGroupPolicySet.Version 不为0, 在添加出站和入站规则(Egress 和 Ingress)时:<ul> // <li>Protocol 字段支持输入 TCP, UDP, ICMP, ICMPV6, GRE, ALL。</li> // <li>CidrBlock 字段允许输入符合 cidr 格式标准的任意字符串。(展开)在基础网络中,如果 CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IP,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。</li> // <li>Ipv6CidrBlock 字段允许输入符合 IPv6 cidr 格式标准的任意字符串。(展开)在基础网络中,如果Ipv6CidrBlock 包含您的账户内的云服务器之外的设备在腾讯云的内网 IPv6,并不代表此规则允许您访问这些设备,租户之间网络隔离规则优先于安全组中的内网规则。</li> // <li>SecurityGroupId 字段允许输入与待修改的安全组位于相同项目中的安全组 ID,包括这个安全组 ID 本身,代表安全组下所有云服务器的内网 IP。使用这个字段时,这条规则用来匹配网络报文的过程中会随着被使用的这个ID所关联的云服务器变化而变化,不需要重新修改。</li> // <li>Port 字段允许输入一个单独端口号,或者用减号分隔的两个端口号代表端口范围,例如80或8000-8010。只有当 Protocol 字段是 TCP 或 UDP 时,Port 字段才被接受。</li> // <li>Action 字段只允许输入 ACCEPT 或 DROP。</li> // <li>CidrBlock, Ipv6CidrBlock, SecurityGroupId, AddressTemplate 四者是排他关系,不允许同时输入,Protocol + Port 和 ServiceTemplate 二者是排他关系,不允许同时输入。</li> // </ul></li></ul></li> // </ul> func (c *Client) ModifySecurityGroupPolicies(request *ModifySecurityGroupPoliciesRequest) (response *ModifySecurityGroupPoliciesResponse, err error) { if request == nil { request = NewModifySecurityGroupPoliciesRequest() } response = NewModifySecurityGroupPoliciesResponse() err = c.Send(request, response) return } func NewModifyServiceTemplateAttributeRequest() (request *ModifyServiceTemplateAttributeRequest) { request = &ModifyServiceTemplateAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyServiceTemplateAttribute") return } func NewModifyServiceTemplateAttributeResponse() (response *ModifyServiceTemplateAttributeResponse) { response = &ModifyServiceTemplateAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyServiceTemplateAttribute)用于修改协议端口模板 func (c *Client) ModifyServiceTemplateAttribute(request *ModifyServiceTemplateAttributeRequest) (response *ModifyServiceTemplateAttributeResponse, err error) { if request == nil { request = NewModifyServiceTemplateAttributeRequest() } response = NewModifyServiceTemplateAttributeResponse() err = c.Send(request, response) return } func NewModifyServiceTemplateGroupAttributeRequest() (request *ModifyServiceTemplateGroupAttributeRequest) { request = &ModifyServiceTemplateGroupAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyServiceTemplateGroupAttribute") return } func NewModifyServiceTemplateGroupAttributeResponse() (response *ModifyServiceTemplateGroupAttributeResponse) { response = &ModifyServiceTemplateGroupAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyServiceTemplateGroupAttribute)用于修改协议端口模板集合。 func (c *Client) ModifyServiceTemplateGroupAttribute(request *ModifyServiceTemplateGroupAttributeRequest) (response *ModifyServiceTemplateGroupAttributeResponse, err error) { if request == nil { request = NewModifyServiceTemplateGroupAttributeRequest() } response = NewModifyServiceTemplateGroupAttributeResponse() err = c.Send(request, response) return } func NewModifySubnetAttributeRequest() (request *ModifySubnetAttributeRequest) { request = &ModifySubnetAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifySubnetAttribute") return } func NewModifySubnetAttributeResponse() (response *ModifySubnetAttributeResponse) { response = &ModifySubnetAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifySubnetAttribute)用于修改子网属性。 func (c *Client) ModifySubnetAttribute(request *ModifySubnetAttributeRequest) (response *ModifySubnetAttributeResponse, err error) { if request == nil { request = NewModifySubnetAttributeRequest() } response = NewModifySubnetAttributeResponse() err = c.Send(request, response) return } func NewModifyVpcAttributeRequest() (request *ModifyVpcAttributeRequest) { request = &ModifyVpcAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpcAttribute") return } func NewModifyVpcAttributeResponse() (response *ModifyVpcAttributeResponse) { response = &ModifyVpcAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyVpcAttribute)用于修改私有网络(VPC)的相关属性。 func (c *Client) ModifyVpcAttribute(request *ModifyVpcAttributeRequest) (response *ModifyVpcAttributeResponse, err error) { if request == nil { request = NewModifyVpcAttributeRequest() } response = NewModifyVpcAttributeResponse() err = c.Send(request, response) return } func NewModifyVpnConnectionAttributeRequest() (request *ModifyVpnConnectionAttributeRequest) { request = &ModifyVpnConnectionAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpnConnectionAttribute") return } func NewModifyVpnConnectionAttributeResponse() (response *ModifyVpnConnectionAttributeResponse) { response = &ModifyVpnConnectionAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyVpnConnectionAttribute)用于修改VPN通道。 func (c *Client) ModifyVpnConnectionAttribute(request *ModifyVpnConnectionAttributeRequest) (response *ModifyVpnConnectionAttributeResponse, err error) { if request == nil { request = NewModifyVpnConnectionAttributeRequest() } response = NewModifyVpnConnectionAttributeResponse() err = c.Send(request, response) return } func NewModifyVpnGatewayAttributeRequest() (request *ModifyVpnGatewayAttributeRequest) { request = &ModifyVpnGatewayAttributeRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpnGatewayAttribute") return } func NewModifyVpnGatewayAttributeResponse() (response *ModifyVpnGatewayAttributeResponse) { response = &ModifyVpnGatewayAttributeResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyVpnGatewayAttribute)用于修改VPN网关属性。 func (c *Client) ModifyVpnGatewayAttribute(request *ModifyVpnGatewayAttributeRequest) (response *ModifyVpnGatewayAttributeResponse, err error) { if request == nil { request = NewModifyVpnGatewayAttributeRequest() } response = NewModifyVpnGatewayAttributeResponse() err = c.Send(request, response) return } func NewModifyVpnGatewayCcnRoutesRequest() (request *ModifyVpnGatewayCcnRoutesRequest) { request = &ModifyVpnGatewayCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ModifyVpnGatewayCcnRoutes") return } func NewModifyVpnGatewayCcnRoutesResponse() (response *ModifyVpnGatewayCcnRoutesResponse) { response = &ModifyVpnGatewayCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ModifyVpnGatewayCcnRoutes)用于修改VPN网关云联网路由 func (c *Client) ModifyVpnGatewayCcnRoutes(request *ModifyVpnGatewayCcnRoutesRequest) (response *ModifyVpnGatewayCcnRoutesResponse, err error) { if request == nil { request = NewModifyVpnGatewayCcnRoutesRequest() } response = NewModifyVpnGatewayCcnRoutesResponse() err = c.Send(request, response) return } func NewRejectAttachCcnInstancesRequest() (request *RejectAttachCcnInstancesRequest) { request = &RejectAttachCcnInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "RejectAttachCcnInstances") return } func NewRejectAttachCcnInstancesResponse() (response *RejectAttachCcnInstancesResponse) { response = &RejectAttachCcnInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(RejectAttachCcnInstances)用于跨账号关联实例时,云联网所有者拒绝关联操作。 func (c *Client) RejectAttachCcnInstances(request *RejectAttachCcnInstancesRequest) (response *RejectAttachCcnInstancesResponse, err error) { if request == nil { request = NewRejectAttachCcnInstancesRequest() } response = NewRejectAttachCcnInstancesResponse() err = c.Send(request, response) return } func NewReleaseAddressesRequest() (request *ReleaseAddressesRequest) { request = &ReleaseAddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ReleaseAddresses") return } func NewReleaseAddressesResponse() (response *ReleaseAddressesResponse) { response = &ReleaseAddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (ReleaseAddresses) 用于释放一个或多个[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 // * 该操作不可逆,释放后 EIP 关联的 IP 地址将不再属于您的名下。 // * 只有状态为 UNBIND 的 EIP 才能进行释放操作。 func (c *Client) ReleaseAddresses(request *ReleaseAddressesRequest) (response *ReleaseAddressesResponse, err error) { if request == nil { request = NewReleaseAddressesRequest() } response = NewReleaseAddressesResponse() err = c.Send(request, response) return } func NewReleaseIp6AddressesBandwidthRequest() (request *ReleaseIp6AddressesBandwidthRequest) { request = &ReleaseIp6AddressesBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ReleaseIp6AddressesBandwidth") return } func NewReleaseIp6AddressesBandwidthResponse() (response *ReleaseIp6AddressesBandwidthResponse) { response = &ReleaseIp6AddressesBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 该接口用于给弹性公网IPv6地址释放带宽。 func (c *Client) ReleaseIp6AddressesBandwidth(request *ReleaseIp6AddressesBandwidthRequest) (response *ReleaseIp6AddressesBandwidthResponse, err error) { if request == nil { request = NewReleaseIp6AddressesBandwidthRequest() } response = NewReleaseIp6AddressesBandwidthResponse() err = c.Send(request, response) return } func NewRemoveBandwidthPackageResourcesRequest() (request *RemoveBandwidthPackageResourcesRequest) { request = &RemoveBandwidthPackageResourcesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "RemoveBandwidthPackageResources") return } func NewRemoveBandwidthPackageResourcesResponse() (response *RemoveBandwidthPackageResourcesResponse) { response = &RemoveBandwidthPackageResourcesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 接口用于删除带宽包资源,包括[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)和[负载均衡](https://cloud.tencent.com/document/product/214/517)等 func (c *Client) RemoveBandwidthPackageResources(request *RemoveBandwidthPackageResourcesRequest) (response *RemoveBandwidthPackageResourcesResponse, err error) { if request == nil { request = NewRemoveBandwidthPackageResourcesRequest() } response = NewRemoveBandwidthPackageResourcesResponse() err = c.Send(request, response) return } func NewRemoveIp6RulesRequest() (request *RemoveIp6RulesRequest) { request = &RemoveIp6RulesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "RemoveIp6Rules") return } func NewRemoveIp6RulesResponse() (response *RemoveIp6RulesResponse) { response = &RemoveIp6RulesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 1. 该接口用于删除IPV6转换规则 // 2. 支持批量删除同一个转换实例下的多个转换规则 func (c *Client) RemoveIp6Rules(request *RemoveIp6RulesRequest) (response *RemoveIp6RulesResponse, err error) { if request == nil { request = NewRemoveIp6RulesRequest() } response = NewRemoveIp6RulesResponse() err = c.Send(request, response) return } func NewRenewVpnGatewayRequest() (request *RenewVpnGatewayRequest) { request = &RenewVpnGatewayRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "RenewVpnGateway") return } func NewRenewVpnGatewayResponse() (response *RenewVpnGatewayResponse) { response = &RenewVpnGatewayResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(RenewVpnGateway)用于预付费(包年包月)VPN网关续费。目前只支持IPSEC网关。 func (c *Client) RenewVpnGateway(request *RenewVpnGatewayRequest) (response *RenewVpnGatewayResponse, err error) { if request == nil { request = NewRenewVpnGatewayRequest() } response = NewRenewVpnGatewayResponse() err = c.Send(request, response) return } func NewReplaceDirectConnectGatewayCcnRoutesRequest() (request *ReplaceDirectConnectGatewayCcnRoutesRequest) { request = &ReplaceDirectConnectGatewayCcnRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ReplaceDirectConnectGatewayCcnRoutes") return } func NewReplaceDirectConnectGatewayCcnRoutesResponse() (response *ReplaceDirectConnectGatewayCcnRoutesResponse) { response = &ReplaceDirectConnectGatewayCcnRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ReplaceDirectConnectGatewayCcnRoutes)根据路由ID(RouteId)修改指定的路由(Route),支持批量修改。 func (c *Client) ReplaceDirectConnectGatewayCcnRoutes(request *ReplaceDirectConnectGatewayCcnRoutesRequest) (response *ReplaceDirectConnectGatewayCcnRoutesResponse, err error) { if request == nil { request = NewReplaceDirectConnectGatewayCcnRoutesRequest() } response = NewReplaceDirectConnectGatewayCcnRoutesResponse() err = c.Send(request, response) return } func NewReplaceRouteTableAssociationRequest() (request *ReplaceRouteTableAssociationRequest) { request = &ReplaceRouteTableAssociationRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ReplaceRouteTableAssociation") return } func NewReplaceRouteTableAssociationResponse() (response *ReplaceRouteTableAssociationResponse) { response = &ReplaceRouteTableAssociationResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ReplaceRouteTableAssociation)用于修改子网(Subnet)关联的路由表(RouteTable)。 // * 一个子网只能关联一个路由表。 func (c *Client) ReplaceRouteTableAssociation(request *ReplaceRouteTableAssociationRequest) (response *ReplaceRouteTableAssociationResponse, err error) { if request == nil { request = NewReplaceRouteTableAssociationRequest() } response = NewReplaceRouteTableAssociationResponse() err = c.Send(request, response) return } func NewReplaceRoutesRequest() (request *ReplaceRoutesRequest) { request = &ReplaceRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ReplaceRoutes") return } func NewReplaceRoutesResponse() (response *ReplaceRoutesResponse) { response = &ReplaceRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ReplaceRoutes)根据路由策略ID(RouteId)修改指定的路由策略(Route),支持批量修改。 func (c *Client) ReplaceRoutes(request *ReplaceRoutesRequest) (response *ReplaceRoutesResponse, err error) { if request == nil { request = NewReplaceRoutesRequest() } response = NewReplaceRoutesResponse() err = c.Send(request, response) return } func NewReplaceSecurityGroupPolicyRequest() (request *ReplaceSecurityGroupPolicyRequest) { request = &ReplaceSecurityGroupPolicyRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ReplaceSecurityGroupPolicy") return } func NewReplaceSecurityGroupPolicyResponse() (response *ReplaceSecurityGroupPolicyResponse) { response = &ReplaceSecurityGroupPolicyResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ReplaceSecurityGroupPolicy)用于替换单条安全组规则(SecurityGroupPolicy)。 // 单个请求中只能替换单个方向的一条规则, 必须要指定索引(PolicyIndex)。 func (c *Client) ReplaceSecurityGroupPolicy(request *ReplaceSecurityGroupPolicyRequest) (response *ReplaceSecurityGroupPolicyResponse, err error) { if request == nil { request = NewReplaceSecurityGroupPolicyRequest() } response = NewReplaceSecurityGroupPolicyResponse() err = c.Send(request, response) return } func NewResetAttachCcnInstancesRequest() (request *ResetAttachCcnInstancesRequest) { request = &ResetAttachCcnInstancesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ResetAttachCcnInstances") return } func NewResetAttachCcnInstancesResponse() (response *ResetAttachCcnInstancesResponse) { response = &ResetAttachCcnInstancesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ResetAttachCcnInstances)用于跨账号关联实例申请过期时,重新申请关联操作。 func (c *Client) ResetAttachCcnInstances(request *ResetAttachCcnInstancesRequest) (response *ResetAttachCcnInstancesResponse, err error) { if request == nil { request = NewResetAttachCcnInstancesRequest() } response = NewResetAttachCcnInstancesResponse() err = c.Send(request, response) return } func NewResetNatGatewayConnectionRequest() (request *ResetNatGatewayConnectionRequest) { request = &ResetNatGatewayConnectionRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ResetNatGatewayConnection") return } func NewResetNatGatewayConnectionResponse() (response *ResetNatGatewayConnectionResponse) { response = &ResetNatGatewayConnectionResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ResetNatGatewayConnection)用来NAT网关并发连接上限。 func (c *Client) ResetNatGatewayConnection(request *ResetNatGatewayConnectionRequest) (response *ResetNatGatewayConnectionResponse, err error) { if request == nil { request = NewResetNatGatewayConnectionRequest() } response = NewResetNatGatewayConnectionResponse() err = c.Send(request, response) return } func NewResetRoutesRequest() (request *ResetRoutesRequest) { request = &ResetRoutesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ResetRoutes") return } func NewResetRoutesResponse() (response *ResetRoutesResponse) { response = &ResetRoutesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ResetRoutes)用于对某个路由表名称和所有路由策略(Route)进行重新设置。<br /> // 注意: 调用本接口是先删除当前路由表中所有路由策略, 再保存新提交的路由策略内容, 会引起网络中断。 func (c *Client) ResetRoutes(request *ResetRoutesRequest) (response *ResetRoutesResponse, err error) { if request == nil { request = NewResetRoutesRequest() } response = NewResetRoutesResponse() err = c.Send(request, response) return } func NewResetVpnConnectionRequest() (request *ResetVpnConnectionRequest) { request = &ResetVpnConnectionRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ResetVpnConnection") return } func NewResetVpnConnectionResponse() (response *ResetVpnConnectionResponse) { response = &ResetVpnConnectionResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ResetVpnConnection)用于重置VPN通道。 func (c *Client) ResetVpnConnection(request *ResetVpnConnectionRequest) (response *ResetVpnConnectionResponse, err error) { if request == nil { request = NewResetVpnConnectionRequest() } response = NewResetVpnConnectionResponse() err = c.Send(request, response) return } func NewResetVpnGatewayInternetMaxBandwidthRequest() (request *ResetVpnGatewayInternetMaxBandwidthRequest) { request = &ResetVpnGatewayInternetMaxBandwidthRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "ResetVpnGatewayInternetMaxBandwidth") return } func NewResetVpnGatewayInternetMaxBandwidthResponse() (response *ResetVpnGatewayInternetMaxBandwidthResponse) { response = &ResetVpnGatewayInternetMaxBandwidthResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(ResetVpnGatewayInternetMaxBandwidth)调整VPN网关带宽上限。目前支持升级配置,如果是包年包月VPN网关需要在有效期内。 func (c *Client) ResetVpnGatewayInternetMaxBandwidth(request *ResetVpnGatewayInternetMaxBandwidthRequest) (response *ResetVpnGatewayInternetMaxBandwidthResponse, err error) { if request == nil { request = NewResetVpnGatewayInternetMaxBandwidthRequest() } response = NewResetVpnGatewayInternetMaxBandwidthResponse() err = c.Send(request, response) return } func NewSetCcnRegionBandwidthLimitsRequest() (request *SetCcnRegionBandwidthLimitsRequest) { request = &SetCcnRegionBandwidthLimitsRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "SetCcnRegionBandwidthLimits") return } func NewSetCcnRegionBandwidthLimitsResponse() (response *SetCcnRegionBandwidthLimitsResponse) { response = &SetCcnRegionBandwidthLimitsResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(SetCcnRegionBandwidthLimits)用于设置云联网(CCN)各地域出带宽上限,或者地域间带宽上限。 func (c *Client) SetCcnRegionBandwidthLimits(request *SetCcnRegionBandwidthLimitsRequest) (response *SetCcnRegionBandwidthLimitsResponse, err error) { if request == nil { request = NewSetCcnRegionBandwidthLimitsRequest() } response = NewSetCcnRegionBandwidthLimitsResponse() err = c.Send(request, response) return } func NewTransformAddressRequest() (request *TransformAddressRequest) { request = &TransformAddressRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "TransformAddress") return } func NewTransformAddressResponse() (response *TransformAddressResponse) { response = &TransformAddressResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口 (TransformAddress) 用于将实例的普通公网 IP 转换为[弹性公网IP](https://cloud.tencent.com/document/product/213/1941)(简称 EIP)。 // * 平台对用户每地域每日解绑 EIP 重新分配普通公网 IP 次数有所限制(可参见 [EIP 产品简介](/document/product/213/1941))。上述配额可通过 [DescribeAddressQuota](https://cloud.tencent.com/document/api/213/1378) 接口获取。 func (c *Client) TransformAddress(request *TransformAddressRequest) (response *TransformAddressResponse, err error) { if request == nil { request = NewTransformAddressRequest() } response = NewTransformAddressResponse() err = c.Send(request, response) return } func NewUnassignIpv6AddressesRequest() (request *UnassignIpv6AddressesRequest) { request = &UnassignIpv6AddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6Addresses") return } func NewUnassignIpv6AddressesResponse() (response *UnassignIpv6AddressesResponse) { response = &UnassignIpv6AddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(UnassignIpv6Addresses)用于释放弹性网卡`IPv6`地址。<br /> // 本接口是异步完成,如需查询异步任务执行结果,请使用本接口返回的`RequestId`轮询`QueryTask`接口。 func (c *Client) UnassignIpv6Addresses(request *UnassignIpv6AddressesRequest) (response *UnassignIpv6AddressesResponse, err error) { if request == nil { request = NewUnassignIpv6AddressesRequest() } response = NewUnassignIpv6AddressesResponse() err = c.Send(request, response) return } func NewUnassignIpv6CidrBlockRequest() (request *UnassignIpv6CidrBlockRequest) { request = &UnassignIpv6CidrBlockRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6CidrBlock") return } func NewUnassignIpv6CidrBlockResponse() (response *UnassignIpv6CidrBlockResponse) { response = &UnassignIpv6CidrBlockResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(UnassignIpv6CidrBlock)用于释放IPv6网段。<br /> // 网段如果还有IP占用且未回收,则网段无法释放。 func (c *Client) UnassignIpv6CidrBlock(request *UnassignIpv6CidrBlockRequest) (response *UnassignIpv6CidrBlockResponse, err error) { if request == nil { request = NewUnassignIpv6CidrBlockRequest() } response = NewUnassignIpv6CidrBlockResponse() err = c.Send(request, response) return } func NewUnassignIpv6SubnetCidrBlockRequest() (request *UnassignIpv6SubnetCidrBlockRequest) { request = &UnassignIpv6SubnetCidrBlockRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "UnassignIpv6SubnetCidrBlock") return } func NewUnassignIpv6SubnetCidrBlockResponse() (response *UnassignIpv6SubnetCidrBlockResponse) { response = &UnassignIpv6SubnetCidrBlockResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(UnassignIpv6SubnetCidrBlock)用于释放IPv6子网段。<br /> // 子网段如果还有IP占用且未回收,则子网段无法释放。 func (c *Client) UnassignIpv6SubnetCidrBlock(request *UnassignIpv6SubnetCidrBlockRequest) (response *UnassignIpv6SubnetCidrBlockResponse, err error) { if request == nil { request = NewUnassignIpv6SubnetCidrBlockRequest() } response = NewUnassignIpv6SubnetCidrBlockResponse() err = c.Send(request, response) return } func NewUnassignPrivateIpAddressesRequest() (request *UnassignPrivateIpAddressesRequest) { request = &UnassignPrivateIpAddressesRequest{ BaseRequest: &tchttp.BaseRequest{}, } request.Init().WithApiInfo("vpc", APIVersion, "UnassignPrivateIpAddresses") return } func NewUnassignPrivateIpAddressesResponse() (response *UnassignPrivateIpAddressesResponse) { response = &UnassignPrivateIpAddressesResponse{ BaseResponse: &tchttp.BaseResponse{}, } return } // 本接口(UnassignPrivateIpAddresses)用于弹性网卡退还内网 IP。 // * 退还弹性网卡上的辅助内网IP,接口自动解关联弹性公网 IP。不能退还弹性网卡的主内网IP。 func (c *Client) UnassignPrivateIpAddresses(request *UnassignPrivateIpAddressesRequest) (response *UnassignPrivateIpAddressesResponse, err error) { if request == nil { request = NewUnassignPrivateIpAddressesRequest() } response = NewUnassignPrivateIpAddressesResponse() err = c.Send(request, response) return } �������������������������������������������������������������������models.go�������������������������������������������������������������������������������������������0000664�0000000�0000000�00001323063�13771713062�0033466�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000�packer-1.6.6+ds1/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312�������������������������������������������������������������������������// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package v20170312 import ( "encoding/json" tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http" ) type AcceptAttachCcnInstancesRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 接受关联实例列表。 Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances" list` } func (r *AcceptAttachCcnInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AcceptAttachCcnInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AcceptAttachCcnInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AcceptAttachCcnInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AcceptAttachCcnInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AccountAttribute struct { // 属性名 AttributeName *string `json:"AttributeName,omitempty" name:"AttributeName"` // 属性值 AttributeValues []*string `json:"AttributeValues,omitempty" name:"AttributeValues" list` } type AddBandwidthPackageResourcesRequest struct { *tchttp.BaseRequest // 资源唯一ID,当前支持EIP资源和LB资源,形如'eip-xxxx', 'lb-xxxx' ResourceIds []*string `json:"ResourceIds,omitempty" name:"ResourceIds" list` // 带宽包唯一标识ID,形如'bwp-xxxx' BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` // 带宽包类型,当前支持'BGP'类型,表示内部资源是BGP IP。 NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` // 资源类型,包括'Address', 'LoadBalance' ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` // 带宽包协议类型。当前支持'ipv4'和'ipv6'协议类型。 Protocol *string `json:"Protocol,omitempty" name:"Protocol"` } func (r *AddBandwidthPackageResourcesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AddBandwidthPackageResourcesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AddBandwidthPackageResourcesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AddBandwidthPackageResourcesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AddBandwidthPackageResourcesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AddIp6RulesRequest struct { *tchttp.BaseRequest // IPV6转换实例唯一ID,形如ip6-xxxxxxxx Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` // IPV6转换规则信息 Ip6RuleInfos []*Ip6RuleInfo `json:"Ip6RuleInfos,omitempty" name:"Ip6RuleInfos" list` // IPV6转换规则名称 Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` } func (r *AddIp6RulesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AddIp6RulesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AddIp6RulesResponse struct { *tchttp.BaseResponse Response *struct { // IPV6转换规则唯一ID数组,形如rule6-xxxxxxxx Ip6RuleSet []*string `json:"Ip6RuleSet,omitempty" name:"Ip6RuleSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AddIp6RulesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AddIp6RulesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type Address struct { // `EIP`的`ID`,是`EIP`的唯一标识。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // `EIP`名称。 AddressName *string `json:"AddressName,omitempty" name:"AddressName"` // `EIP`状态,包含'CREATING'(创建中),'BINDING'(绑定中),'BIND'(已绑定),'UNBINDING'(解绑中),'UNBIND'(已解绑),'OFFLINING'(释放中),'BIND_ENI'(绑定悬空弹性网卡) AddressStatus *string `json:"AddressStatus,omitempty" name:"AddressStatus"` // 外网IP地址 AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` // 绑定的资源实例`ID`。可能是一个`CVM`,`NAT`。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 绑定的弹性网卡ID NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 绑定的资源内网ip PrivateAddressIp *string `json:"PrivateAddressIp,omitempty" name:"PrivateAddressIp"` // 资源隔离状态。true表示eip处于隔离状态,false表示资源处于未隔离状态 IsArrears *bool `json:"IsArrears,omitempty" name:"IsArrears"` // 资源封堵状态。true表示eip处于封堵状态,false表示eip处于未封堵状态 IsBlocked *bool `json:"IsBlocked,omitempty" name:"IsBlocked"` // eip是否支持直通模式。true表示eip支持直通模式,false表示资源不支持直通模式 IsEipDirectConnection *bool `json:"IsEipDirectConnection,omitempty" name:"IsEipDirectConnection"` // eip资源类型,包括"CalcIP","WanIP","EIP","AnycastEIP"。其中"CalcIP"表示设备ip,“WanIP”表示普通公网ip,“EIP”表示弹性公网ip,“AnycastEip”表示加速EIP AddressType *string `json:"AddressType,omitempty" name:"AddressType"` // eip是否在解绑后自动释放。true表示eip将会在解绑后自动释放,false表示eip在解绑后不会自动释放 CascadeRelease *bool `json:"CascadeRelease,omitempty" name:"CascadeRelease"` // EIP ALG开启的协议类型。 EipAlgType *AlgType `json:"EipAlgType,omitempty" name:"EipAlgType"` // 弹性公网IP的运营商信息,当前可能返回值包括"CMCC","CTCC","CUCC","BGP" InternetServiceProvider *string `json:"InternetServiceProvider,omitempty" name:"InternetServiceProvider"` } type AddressChargePrepaid struct { // 购买实例的时长 Period *int64 `json:"Period,omitempty" name:"Period"` // 自动续费标志 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` } type AddressTemplate struct { // IP地址模板名称。 AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` // IP地址模板实例唯一ID。 AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` // IP地址信息。 AddressSet []*string `json:"AddressSet,omitempty" name:"AddressSet" list` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type AddressTemplateGroup struct { // IP地址模板集合名称。 AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` // IP地址模板集合实例ID,例如:ipmg-dih8xdbq。 AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` // IP地址模板ID。 AddressTemplateIdSet []*string `json:"AddressTemplateIdSet,omitempty" name:"AddressTemplateIdSet" list` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // IP地址模板实例。 AddressTemplateSet []*AddressTemplateItem `json:"AddressTemplateSet,omitempty" name:"AddressTemplateSet" list` } type AddressTemplateItem struct { // 起始地址。 From *string `json:"From,omitempty" name:"From"` // 结束地址。 To *string `json:"To,omitempty" name:"To"` } type AddressTemplateSpecification struct { // IP地址ID,例如:ipm-2uw6ujo6。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // IP地址组ID,例如:ipmg-2uw6ujo6。 AddressGroupId *string `json:"AddressGroupId,omitempty" name:"AddressGroupId"` } type AlgType struct { // Ftp协议Alg功能是否开启 Ftp *bool `json:"Ftp,omitempty" name:"Ftp"` // Sip协议Alg功能是否开启 Sip *bool `json:"Sip,omitempty" name:"Sip"` } type AllocateAddressesRequest struct { *tchttp.BaseRequest // EIP数量。默认值:1。 AddressCount *int64 `json:"AddressCount,omitempty" name:"AddressCount"` // EIP线路类型。默认值:BGP。 // <ul style="margin:0"><li>已开通静态单线IP白名单的用户,可选值:<ul><li>CMCC:中国移动</li> // <li>CTCC:中国电信</li> // <li>CUCC:中国联通</li></ul>注意:仅部分地域支持静态单线IP。</li></ul> InternetServiceProvider *string `json:"InternetServiceProvider,omitempty" name:"InternetServiceProvider"` // EIP计费方式。 // <ul style="margin:0"><li>已开通带宽上移白名单的用户,可选值:<ul><li>BANDWIDTH_PACKAGE:[共享带宽包](https://cloud.tencent.com/document/product/684/15255)付费(需额外开通共享带宽包白名单)</li> // <li>BANDWIDTH_POSTPAID_BY_HOUR:带宽按小时后付费</li> // <li>TRAFFIC_POSTPAID_BY_HOUR:流量按小时后付费</li></ul>默认值:TRAFFIC_POSTPAID_BY_HOUR。</li> // <li>未开通带宽上移白名单的用户,EIP计费方式与其绑定的实例的计费方式一致,无需传递此参数。</li></ul> InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` // EIP出带宽上限,单位:Mbps。 // <ul style="margin:0"><li>已开通带宽上移白名单的用户,可选值范围取决于EIP计费方式:<ul><li>BANDWIDTH_PACKAGE:1 Mbps 至 1000 Mbps</li> // <li>BANDWIDTH_POSTPAID_BY_HOUR:1 Mbps 至 100 Mbps</li> // <li>TRAFFIC_POSTPAID_BY_HOUR:1 Mbps 至 100 Mbps</li></ul>默认值:1 Mbps。</li> // <li>未开通带宽上移白名单的用户,EIP出带宽上限取决于与其绑定的实例的公网出带宽上限,无需传递此参数。</li></ul> InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // EIP类型。默认值:EIP。 // <ul style="margin:0"><li>已开通Anycast公网加速白名单的用户,可选值:<ul><li>AnycastEIP:加速IP,可参见 [Anycast 公网加速](https://cloud.tencent.com/document/product/644)</li></ul>注意:仅部分地域支持加速IP。</li></ul> AddressType *string `json:"AddressType,omitempty" name:"AddressType"` // Anycast发布域。 // <ul style="margin:0"><li>已开通Anycast公网加速白名单的用户,可选值:<ul><li>ANYCAST_ZONE_GLOBAL:全球发布域(需要额外开通Anycast全球加速白名单)</li><li>ANYCAST_ZONE_OVERSEAS:境外发布域</li><li><b>[已废弃]</b> ANYCAST_ZONE_A:发布域A(已更新为全球发布域)</li><li><b>[已废弃]</b> ANYCAST_ZONE_B:发布域B(已更新为全球发布域)</li></ul>默认值:ANYCAST_ZONE_OVERSEAS。</li></ul> AnycastZone *string `json:"AnycastZone,omitempty" name:"AnycastZone"` // <b>[已废弃]</b> AnycastEIP不再区分是否负载均衡。原参数说明如下: // AnycastEIP是否用于绑定负载均衡。 // <ul style="margin:0"><li>已开通Anycast公网加速白名单的用户,可选值:<ul><li>TRUE:AnycastEIP可绑定对象为负载均衡</li> // <li>FALSE:AnycastEIP可绑定对象为云服务器、NAT网关、高可用虚拟IP等</li></ul>默认值:FALSE。</li></ul> ApplicableForCLB *bool `json:"ApplicableForCLB,omitempty" name:"ApplicableForCLB"` // 需要关联的标签列表。 Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` // BGP带宽包唯一ID参数。设定该参数且InternetChargeType为BANDWIDTH_PACKAGE,则表示创建的EIP加入该BGP带宽包并采用带宽包计费 BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` } func (r *AllocateAddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AllocateAddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AllocateAddressesResponse struct { *tchttp.BaseResponse Response *struct { // 申请到的 EIP 的唯一 ID 列表。 AddressSet []*string `json:"AddressSet,omitempty" name:"AddressSet" list` // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 TaskId *string `json:"TaskId,omitempty" name:"TaskId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AllocateAddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AllocateAddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AllocateIp6AddressesBandwidthRequest struct { *tchttp.BaseRequest // 需要开通公网访问能力的IPV6地址 Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses" list` // 带宽,单位Mbps。默认是1Mbps InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // 网络计费模式。IPV6当前支持"TRAFFIC_POSTPAID_BY_HOUR",默认是"TRAFFIC_POSTPAID_BY_HOUR"。 InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` } func (r *AllocateIp6AddressesBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AllocateIp6AddressesBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AllocateIp6AddressesBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 弹性公网 IPV6 的唯一 ID 列表。 AddressSet []*string `json:"AddressSet,omitempty" name:"AddressSet" list` // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 TaskId *string `json:"TaskId,omitempty" name:"TaskId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AllocateIp6AddressesBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AllocateIp6AddressesBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignIpv6AddressesRequest struct { *tchttp.BaseRequest // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 指定的`IPv6`地址列表,单次最多指定10个。与入参`Ipv6AddressCount`合并计算配额。与Ipv6AddressCount必填一个。 Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses" list` // 自动分配`IPv6`地址个数,内网IP地址个数总和不能超过配数。与入参`Ipv6Addresses`合并计算配额。与Ipv6Addresses必填一个。 Ipv6AddressCount *uint64 `json:"Ipv6AddressCount,omitempty" name:"Ipv6AddressCount"` } func (r *AssignIpv6AddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignIpv6AddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignIpv6AddressesResponse struct { *tchttp.BaseResponse Response *struct { // 分配给弹性网卡的`IPv6`地址列表。 Ipv6AddressSet []*Ipv6Address `json:"Ipv6AddressSet,omitempty" name:"Ipv6AddressSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssignIpv6AddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignIpv6AddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignIpv6CidrBlockRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` } func (r *AssignIpv6CidrBlockRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignIpv6CidrBlockRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignIpv6CidrBlockResponse struct { *tchttp.BaseResponse Response *struct { // 分配的 `IPv6` 网段。形如:`3402:4e00:20:1000::/56` Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssignIpv6CidrBlockResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignIpv6CidrBlockResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignIpv6SubnetCidrBlockRequest struct { *tchttp.BaseRequest // 子网所在私有网络`ID`。形如:`vpc-f49l6u0z`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 分配 `IPv6` 子网段列表。 Ipv6SubnetCidrBlocks []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlocks,omitempty" name:"Ipv6SubnetCidrBlocks" list` } func (r *AssignIpv6SubnetCidrBlockRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignIpv6SubnetCidrBlockRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignIpv6SubnetCidrBlockResponse struct { *tchttp.BaseResponse Response *struct { // 分配 `IPv6` 子网段列表。 Ipv6SubnetCidrBlockSet []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlockSet,omitempty" name:"Ipv6SubnetCidrBlockSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssignIpv6SubnetCidrBlockResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignIpv6SubnetCidrBlockResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignPrivateIpAddressesRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-m6dyj72l。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 指定的内网IP信息,单次最多指定10个。与SecondaryPrivateIpAddressCount至少提供一个。 PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` // 新申请的内网IP地址个数,与PrivateIpAddresses至少提供一个。内网IP地址个数总和不能超过配额数,详见<a href="/document/product/576/18527">弹性网卡使用限制</a>。 SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` } func (r *AssignPrivateIpAddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignPrivateIpAddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssignPrivateIpAddressesResponse struct { *tchttp.BaseResponse Response *struct { // 内网IP详细信息。 PrivateIpAddressSet []*PrivateIpAddressSpecification `json:"PrivateIpAddressSet,omitempty" name:"PrivateIpAddressSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssignPrivateIpAddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssignPrivateIpAddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssistantCidr struct { // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 辅助CIDR。形如:`172.16.0.0/16` CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 辅助CIDR类型(0:普通辅助CIDR,1:容器辅助CIDR),默认都是0。 AssistantType *int64 `json:"AssistantType,omitempty" name:"AssistantType"` // 辅助CIDR拆分的子网。 // 注意:此字段可能返回 null,表示取不到有效值。 SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet" list` } type AssociateAddressRequest struct { *tchttp.BaseRequest // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // 要绑定的实例 ID。实例 ID 形如:`ins-11112222`。可通过登录[控制台](https://console.cloud.tencent.com/cvm)查询,也可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/15728) 接口返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 要绑定的弹性网卡 ID。 弹性网卡 ID 形如:`eni-11112222`。`NetworkInterfaceId` 与 `InstanceId` 不可同时指定。弹性网卡 ID 可通过登录[控制台](https://console.cloud.tencent.com/vpc/eni)查询,也可通过[DescribeNetworkInterfaces](https://cloud.tencent.com/document/api/215/15817)接口返回值中的`networkInterfaceId`获取。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 要绑定的内网 IP。如果指定了 `NetworkInterfaceId` 则也必须指定 `PrivateIpAddress` ,表示将 EIP 绑定到指定弹性网卡的指定内网 IP 上。同时要确保指定的 `PrivateIpAddress` 是指定的 `NetworkInterfaceId` 上的一个内网 IP。指定弹性网卡的内网 IP 可通过登录[控制台](https://console.cloud.tencent.com/vpc/eni)查询,也可通过[DescribeNetworkInterfaces](https://cloud.tencent.com/document/api/215/15817)接口返回值中的`privateIpAddress`获取。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` } func (r *AssociateAddressRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateAddressRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateAddressResponse struct { *tchttp.BaseResponse Response *struct { // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 TaskId *string `json:"TaskId,omitempty" name:"TaskId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssociateAddressResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateAddressResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateDhcpIpWithAddressIpRequest struct { *tchttp.BaseRequest // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。必须是没有绑定`EIP`的`DhcpIp` DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` // 弹性公网`IP`。必须是没有绑定`DhcpIp`的`EIP` AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` } func (r *AssociateDhcpIpWithAddressIpRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateDhcpIpWithAddressIpRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateDhcpIpWithAddressIpResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssociateDhcpIpWithAddressIpResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateDhcpIpWithAddressIpResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateNatGatewayAddressRequest struct { *tchttp.BaseRequest // NAT网关的ID,形如:`nat-df45454`。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // 需要申请的弹性IP个数,系统会按您的要求生产N个弹性IP, 其中AddressCount和PublicAddresses至少传递一个。 AddressCount *uint64 `json:"AddressCount,omitempty" name:"AddressCount"` // 绑定NAT网关的弹性IP数组,其中AddressCount和PublicAddresses至少传递一个。。 PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses" list` // 弹性IP可以区,自动分配弹性IP时传递。 Zone *string `json:"Zone,omitempty" name:"Zone"` } func (r *AssociateNatGatewayAddressRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateNatGatewayAddressRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateNatGatewayAddressResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssociateNatGatewayAddressResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateNatGatewayAddressResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateNetworkAclSubnetsRequest struct { *tchttp.BaseRequest // 网络ACL实例ID。例如:acl-12345678。 NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` // 子网实例ID数组。例如:[subnet-12345678] SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds" list` } func (r *AssociateNetworkAclSubnetsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateNetworkAclSubnetsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateNetworkAclSubnetsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssociateNetworkAclSubnetsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateNetworkAclSubnetsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateNetworkInterfaceSecurityGroupsRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID。形如:eni-pxir56ns。每次请求的实例的上限为100。 NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds" list` // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。每次请求的实例的上限为100。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` } func (r *AssociateNetworkInterfaceSecurityGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateNetworkInterfaceSecurityGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AssociateNetworkInterfaceSecurityGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AssociateNetworkInterfaceSecurityGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AssociateNetworkInterfaceSecurityGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AttachCcnInstancesRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 关联网络实例列表 Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances" list` // CCN所属UIN(根账号),默认当前账号所属UIN CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` } func (r *AttachCcnInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AttachCcnInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AttachCcnInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AttachCcnInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AttachCcnInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AttachClassicLinkVpcRequest struct { *tchttp.BaseRequest // VPC实例ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // CVM实例ID InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` } func (r *AttachClassicLinkVpcRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AttachClassicLinkVpcRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AttachClassicLinkVpcResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AttachClassicLinkVpcResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AttachClassicLinkVpcResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AttachNetworkInterfaceRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-m6dyj72l。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // CVM实例ID。形如:ins-r8hr2upy。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` } func (r *AttachNetworkInterfaceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AttachNetworkInterfaceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type AttachNetworkInterfaceResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *AttachNetworkInterfaceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *AttachNetworkInterfaceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type BandwidthPackage struct { // 带宽包唯一标识Id BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` // 带宽包类型,包括'BGP','SINGLEISP','ANYCAST' NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` // 带宽包计费类型,包括'TOP5_POSTPAID_BY_MONTH'和'PERCENT95_POSTPAID_BY_MONTH' ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` // 带宽包名称 BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` // 带宽包创建时间。按照`ISO8601`标准表示,并且使用`UTC`时间。格式为:`YYYY-MM-DDThh:mm:ssZ`。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 带宽包状态,包括'CREATING','CREATED','DELETING','DELETED' Status *string `json:"Status,omitempty" name:"Status"` // 带宽包资源信息 ResourceSet []*Resource `json:"ResourceSet,omitempty" name:"ResourceSet" list` // 带宽包限速大小。单位:Mbps,-1表示不限速。 Bandwidth *int64 `json:"Bandwidth,omitempty" name:"Bandwidth"` } type CCN struct { // 云联网唯一ID CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 云联网名称 CcnName *string `json:"CcnName,omitempty" name:"CcnName"` // 云联网描述信息 CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` // 关联实例数量 InstanceCount *uint64 `json:"InstanceCount,omitempty" name:"InstanceCount"` // 创建时间 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` // 实例状态, 'ISOLATED': 隔离中(欠费停服),'AVAILABLE':运行中。 State *string `json:"State,omitempty" name:"State"` // 实例服务质量,’PT’:白金,'AU':金,'AG':银。 QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` // 付费类型,PREPAID为预付费,POSTPAID为后付费。 // 注意:此字段可能返回 null,表示取不到有效值。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 限速类型,INTER_REGION_LIMIT为地域间限速;OUTER_REGION_LIMIT为地域出口限速。 // 注意:此字段可能返回 null,表示取不到有效值。 BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` // 标签键值对。 TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet" list` } type CcnAttachedInstance struct { // 云联网实例ID。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 关联实例类型: // <li>`VPC`:私有网络</li> // <li>`DIRECTCONNECT`:专线网关</li> // <li>`BMVPC`:黑石私有网络</li> InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 关联实例ID。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 关联实例名称。 InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` // 关联实例所属大区,例如:ap-guangzhou。 InstanceRegion *string `json:"InstanceRegion,omitempty" name:"InstanceRegion"` // 关联实例所属UIN(根账号)。 InstanceUin *string `json:"InstanceUin,omitempty" name:"InstanceUin"` // 关联实例CIDR。 CidrBlock []*string `json:"CidrBlock,omitempty" name:"CidrBlock" list` // 关联实例状态: // <li>`PENDING`:申请中</li> // <li>`ACTIVE`:已连接</li> // <li>`EXPIRED`:已过期</li> // <li>`REJECTED`:已拒绝</li> // <li>`DELETED`:已删除</li> // <li>`FAILED`:失败的(2小时后将异步强制解关联)</li> // <li>`ATTACHING`:关联中</li> // <li>`DETACHING`:解关联中</li> // <li>`DETACHFAILED`:解关联失败(2小时后将异步强制解关联)</li> State *string `json:"State,omitempty" name:"State"` // 关联时间。 AttachedTime *string `json:"AttachedTime,omitempty" name:"AttachedTime"` // 云联网所属UIN(根账号)。 CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` } type CcnBandwidthInfo struct { // 带宽所属的云联网ID。 // 注意:此字段可能返回 null,表示取不到有效值。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 实例的创建时间。 // 注意:此字段可能返回 null,表示取不到有效值。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 实例的过期时间 // 注意:此字段可能返回 null,表示取不到有效值。 ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` // 带宽实例的唯一ID。 // 注意:此字段可能返回 null,表示取不到有效值。 RegionFlowControlId *string `json:"RegionFlowControlId,omitempty" name:"RegionFlowControlId"` // 带宽是否自动续费的标记。 // 注意:此字段可能返回 null,表示取不到有效值。 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` // 描述带宽的地域和限速上限信息。在地域间限速的情况下才会返回参数,出口限速模式不返回。 // 注意:此字段可能返回 null,表示取不到有效值。 CcnRegionBandwidthLimit *CcnRegionBandwidthLimit `json:"CcnRegionBandwidthLimit,omitempty" name:"CcnRegionBandwidthLimit"` } type CcnInstance struct { // 关联实例ID。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 关联实例ID所属大区,例如:ap-guangzhou。 InstanceRegion *string `json:"InstanceRegion,omitempty" name:"InstanceRegion"` // 关联实例类型,可选值: // <li>`VPC`:私有网络</li> // <li>`DIRECTCONNECT`:专线网关</li> // <li>`BMVPC`:黑石私有网络</li> // <li>`VPNGW`:VPNGW类型</li> InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` } type CcnRegionBandwidthLimit struct { // 地域,例如:ap-guangzhou Region *string `json:"Region,omitempty" name:"Region"` // 出带宽上限,单位:Mbps BandwidthLimit *uint64 `json:"BandwidthLimit,omitempty" name:"BandwidthLimit"` // 是否黑石地域,默认`false`。 IsBm *bool `json:"IsBm,omitempty" name:"IsBm"` // 目的地域,例如:ap-shanghai // 注意:此字段可能返回 null,表示取不到有效值。 DstRegion *string `json:"DstRegion,omitempty" name:"DstRegion"` // 目的地域是否为黑石地域,默认`false`。 DstIsBm *bool `json:"DstIsBm,omitempty" name:"DstIsBm"` } type CcnRoute struct { // 路由策略ID RouteId *string `json:"RouteId,omitempty" name:"RouteId"` // 目的端 DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` // 下一跳类型(关联实例类型),所有类型:VPC、DIRECTCONNECT InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 下一跳(关联实例) InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 下一跳名称(关联实例名称) InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` // 下一跳所属地域(关联实例所属地域) InstanceRegion *string `json:"InstanceRegion,omitempty" name:"InstanceRegion"` // 更新时间 UpdateTime *string `json:"UpdateTime,omitempty" name:"UpdateTime"` // 路由是否启用 Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` // 关联实例所属UIN(根账号) InstanceUin *string `json:"InstanceUin,omitempty" name:"InstanceUin"` } type CheckAssistantCidrRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 待添加的负载CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。入参NewCidrBlocks和OldCidrBlocks至少需要其一。 NewCidrBlocks []*string `json:"NewCidrBlocks,omitempty" name:"NewCidrBlocks" list` // 待删除的负载CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"]。入参NewCidrBlocks和OldCidrBlocks至少需要其一。 OldCidrBlocks []*string `json:"OldCidrBlocks,omitempty" name:"OldCidrBlocks" list` } func (r *CheckAssistantCidrRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CheckAssistantCidrRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CheckAssistantCidrResponse struct { *tchttp.BaseResponse Response *struct { // 冲突资源信息数组。 ConflictSourceSet []*ConflictSource `json:"ConflictSourceSet,omitempty" name:"ConflictSourceSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CheckAssistantCidrResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CheckAssistantCidrResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CheckDefaultSubnetRequest struct { *tchttp.BaseRequest // 子网所在的可用区ID,不同子网选择不同可用区可以做跨可用区灾备。 Zone *string `json:"Zone,omitempty" name:"Zone"` } func (r *CheckDefaultSubnetRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CheckDefaultSubnetRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CheckDefaultSubnetResponse struct { *tchttp.BaseResponse Response *struct { // 检查结果。true为可以创建默认子网,false为不可以创建默认子网。 Result *bool `json:"Result,omitempty" name:"Result"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CheckDefaultSubnetResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CheckDefaultSubnetResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CheckNetDetectStateRequest struct { *tchttp.BaseRequest // 探测目的IPv4地址数组,最多两个。 DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp" list` // 下一跳类型,目前我们支持的类型有: // VPN:VPN网关; // DIRECTCONNECT:专线网关; // PEERCONNECTION:对等连接; // NAT:NAT网关; // NORMAL_CVM:普通云服务器; NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` // 下一跳目的网关,取值与“下一跳类型”相关: // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` // 网络探测实例ID。形如:netd-12345678。该参数与(VpcId,SubnetId,NetDetectName),至少要有一个。当NetDetectId存在时,使用NetDetectId。 NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` // `VPC`实例`ID`。形如:`vpc-12345678`。该参数与(SubnetId,NetDetectName)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网实例ID。形如:subnet-12345678。该参数与(VpcId,NetDetectName)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 网络探测名称,最大长度不能超过60个字节。该参数与(VpcId,SubnetId)配合使用,与NetDetectId至少要有一个。当NetDetectId存在时,使用NetDetectId。 NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` } func (r *CheckNetDetectStateRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CheckNetDetectStateRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CheckNetDetectStateResponse struct { *tchttp.BaseResponse Response *struct { // 网络探测验证结果对象数组。 NetDetectIpStateSet []*NetDetectIpState `json:"NetDetectIpStateSet,omitempty" name:"NetDetectIpStateSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CheckNetDetectStateResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CheckNetDetectStateResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ClassicLinkInstance struct { // VPC实例ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 云服务器实例唯一ID InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` } type ConflictItem struct { // 冲突资源的ID ConfilctId *string `json:"ConfilctId,omitempty" name:"ConfilctId"` // 冲突目的资源 DestinationItem *string `json:"DestinationItem,omitempty" name:"DestinationItem"` } type ConflictSource struct { // 冲突资源ID ConflictSourceId *string `json:"ConflictSourceId,omitempty" name:"ConflictSourceId"` // 冲突资源 SourceItem *string `json:"SourceItem,omitempty" name:"SourceItem"` // 冲突资源条目信息 ConflictItemSet []*ConflictItem `json:"ConflictItemSet,omitempty" name:"ConflictItemSet" list` } type CreateAddressTemplateGroupRequest struct { *tchttp.BaseRequest // IP地址模版集合名称。 AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` // IP地址模版实例ID,例如:ipm-mdunqeb6。 AddressTemplateIds []*string `json:"AddressTemplateIds,omitempty" name:"AddressTemplateIds" list` } func (r *CreateAddressTemplateGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAddressTemplateGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateAddressTemplateGroupResponse struct { *tchttp.BaseResponse Response *struct { // IP地址模板集合对象。 AddressTemplateGroup *AddressTemplateGroup `json:"AddressTemplateGroup,omitempty" name:"AddressTemplateGroup"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateAddressTemplateGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAddressTemplateGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateAddressTemplateRequest struct { *tchttp.BaseRequest // IP地址模版名称 AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` // 地址信息,支持 IP、CIDR、IP 范围。 Addresses []*string `json:"Addresses,omitempty" name:"Addresses" list` } func (r *CreateAddressTemplateRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAddressTemplateRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateAddressTemplateResponse struct { *tchttp.BaseResponse Response *struct { // IP地址模板对象。 AddressTemplate *AddressTemplate `json:"AddressTemplate,omitempty" name:"AddressTemplate"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateAddressTemplateResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAddressTemplateResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateAndAttachNetworkInterfaceRequest struct { *tchttp.BaseRequest // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 弹性网卡名称,最大长度不能超过60个字节。 NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` // 弹性网卡所在的子网实例ID,例如:subnet-0ap8nwca。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 云主机实例ID。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 指定的内网IP信息,单次最多指定10个。 PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` // 新申请的内网IP地址个数,内网IP地址个数总和不能超过配数。 SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` // 指定绑定的安全组,例如:['sg-1dd51d']。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 弹性网卡描述,可任意命名,但不得超过60个字符。 NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateAndAttachNetworkInterfaceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAndAttachNetworkInterfaceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateAndAttachNetworkInterfaceResponse struct { *tchttp.BaseResponse Response *struct { // 弹性网卡实例。 NetworkInterface *NetworkInterface `json:"NetworkInterface,omitempty" name:"NetworkInterface"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateAndAttachNetworkInterfaceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAndAttachNetworkInterfaceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateAssistantCidrRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"] CidrBlocks []*string `json:"CidrBlocks,omitempty" name:"CidrBlocks" list` } func (r *CreateAssistantCidrRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAssistantCidrRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateAssistantCidrResponse struct { *tchttp.BaseResponse Response *struct { // 辅助CIDR数组。 // 注意:此字段可能返回 null,表示取不到有效值。 AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateAssistantCidrResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateAssistantCidrResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateBandwidthPackageRequest struct { *tchttp.BaseRequest // 带宽包类型,包括'BGP','SINGLEISP','ANYCAST' NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` // 带宽包计费类型,包括‘TOP5_POSTPAID_BY_MONTH’,‘PERCENT95_POSTPAID_BY_MONTH’ ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` // 带宽包名字 BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` // 带宽包数量(非上移账户只能填1) BandwidthPackageCount *uint64 `json:"BandwidthPackageCount,omitempty" name:"BandwidthPackageCount"` // 带宽包限速大小。单位:Mbps,-1表示不限速。 InternetMaxBandwidth *int64 `json:"InternetMaxBandwidth,omitempty" name:"InternetMaxBandwidth"` // 需要关联的标签列表。 Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` // 带宽包协议类型。当前支持'ipv4'和'ipv6'协议带宽包,默认值是'ipv4'。 Protocol *string `json:"Protocol,omitempty" name:"Protocol"` } func (r *CreateBandwidthPackageRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateBandwidthPackageRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateBandwidthPackageResponse struct { *tchttp.BaseResponse Response *struct { // 带宽包唯一ID BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` // 带宽包唯一ID列表(申请数量大于1时有效) BandwidthPackageIds []*string `json:"BandwidthPackageIds,omitempty" name:"BandwidthPackageIds" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateBandwidthPackageResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateBandwidthPackageResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateCcnRequest struct { *tchttp.BaseRequest // CCN名称,最大长度不能超过60个字节。 CcnName *string `json:"CcnName,omitempty" name:"CcnName"` // CCN描述信息,最大长度不能超过100个字节。 CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` // CCN服务质量,'PT':白金,'AU':金,'AG':银,默认为‘AU’。 QosLevel *string `json:"QosLevel,omitempty" name:"QosLevel"` // 计费模式,PREPAID:表示预付费,即包年包月,POSTPAID:表示后付费,即按量计费。默认:POSTPAID。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 限速类型,OUTER_REGION_LIMIT表示地域出口限速,INTER_REGION_LIMIT为地域间限速,默认为OUTER_REGION_LIMIT BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateCcnRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateCcnRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateCcnResponse struct { *tchttp.BaseResponse Response *struct { // 云联网(CCN)对象。 Ccn *CCN `json:"Ccn,omitempty" name:"Ccn"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateCcnResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateCcnResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateCustomerGatewayRequest struct { *tchttp.BaseRequest // 对端网关名称,可任意命名,但不得超过60个字符。 CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` // 对端网关公网IP。 IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` } func (r *CreateCustomerGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateCustomerGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateCustomerGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 对端网关对象 CustomerGateway *CustomerGateway `json:"CustomerGateway,omitempty" name:"CustomerGateway"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateCustomerGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateCustomerGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDefaultSecurityGroupRequest struct { *tchttp.BaseRequest // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` } func (r *CreateDefaultSecurityGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDefaultSecurityGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDefaultSecurityGroupResponse struct { *tchttp.BaseResponse Response *struct { // 安全组对象。 SecurityGroup *SecurityGroup `json:"SecurityGroup,omitempty" name:"SecurityGroup"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateDefaultSecurityGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDefaultSecurityGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDefaultVpcRequest struct { *tchttp.BaseRequest // 子网所在的可用区ID,不指定将随机选择可用区 Zone *string `json:"Zone,omitempty" name:"Zone"` // 是否强制返回默认VPC Force *bool `json:"Force,omitempty" name:"Force"` } func (r *CreateDefaultVpcRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDefaultVpcRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDefaultVpcResponse struct { *tchttp.BaseResponse Response *struct { // 默认VPC和子网ID Vpc *DefaultVpcSubnet `json:"Vpc,omitempty" name:"Vpc"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateDefaultVpcResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDefaultVpcResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDhcpIpRequest struct { *tchttp.BaseRequest // 私有网络`ID`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网`ID`。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // `DhcpIp`名称。 DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` // 新申请的内网IP地址个数。总数不能超过64个。 SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` } func (r *CreateDhcpIpRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDhcpIpRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDhcpIpResponse struct { *tchttp.BaseResponse Response *struct { // 新创建的`DhcpIp`信息 DhcpIpSet []*DhcpIp `json:"DhcpIpSet,omitempty" name:"DhcpIpSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateDhcpIpResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDhcpIpResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDirectConnectGatewayCcnRoutesRequest struct { *tchttp.BaseRequest // 专线网关ID,形如:dcg-prpqlmg1 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` // 需要连通的IDC网段列表 Routes []*DirectConnectGatewayCcnRoute `json:"Routes,omitempty" name:"Routes" list` } func (r *CreateDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDirectConnectGatewayCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDirectConnectGatewayRequest struct { *tchttp.BaseRequest // 专线网关名称 DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` // 关联网络类型,可选值: // <li>VPC - 私有网络</li> // <li>CCN - 云联网</li> NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` // <li>NetworkType 为 VPC 时,这里传值为私有网络实例ID</li> // <li>NetworkType 为 CCN 时,这里传值为云联网实例ID</li> NetworkInstanceId *string `json:"NetworkInstanceId,omitempty" name:"NetworkInstanceId"` // 网关类型,可选值: // <li>NORMAL - (默认)标准型,注:云联网只支持标准型</li> // <li>NAT - NAT型</li>NAT类型支持网络地址转换配置,类型确定后不能修改;一个私有网络可以创建一个NAT类型的专线网关和一个非NAT类型的专线网关 GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` } func (r *CreateDirectConnectGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDirectConnectGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateDirectConnectGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 专线网关对象。 DirectConnectGateway *DirectConnectGateway `json:"DirectConnectGateway,omitempty" name:"DirectConnectGateway"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateDirectConnectGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateDirectConnectGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateFlowLogRequest struct { *tchttp.BaseRequest // 私用网络ID或者统一ID,建议使用统一ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 流日志实例名字 FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` // 资源唯一ID ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` // 流日志采集类型,ACCEPT|REJECT|ALL TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` // 流日志存储ID CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` // 流日志实例描述 FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` } func (r *CreateFlowLogRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateFlowLogRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateFlowLogResponse struct { *tchttp.BaseResponse Response *struct { // 创建的流日志信息 FlowLog []*FlowLog `json:"FlowLog,omitempty" name:"FlowLog" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateFlowLogResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateFlowLogResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateHaVipRequest struct { *tchttp.BaseRequest // `HAVIP`所在私有网络`ID`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `HAVIP`所在子网`ID`。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // `HAVIP`名称。 HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` // 指定虚拟IP地址,必须在`VPC`网段内且未被占用。不指定则自动分配。 Vip *string `json:"Vip,omitempty" name:"Vip"` } func (r *CreateHaVipRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateHaVipRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateHaVipResponse struct { *tchttp.BaseResponse Response *struct { // `HAVIP`对象。 HaVip *HaVip `json:"HaVip,omitempty" name:"HaVip"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateHaVipResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateHaVipResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateIp6TranslatorsRequest struct { *tchttp.BaseRequest // 转换实例名称 Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` // 创建转换实例数量,默认是1个 Ip6TranslatorCount *int64 `json:"Ip6TranslatorCount,omitempty" name:"Ip6TranslatorCount"` // 转换实例运营商属性,可取"CMCC","CTCC","CUCC","BGP" Ip6InternetServiceProvider *string `json:"Ip6InternetServiceProvider,omitempty" name:"Ip6InternetServiceProvider"` } func (r *CreateIp6TranslatorsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateIp6TranslatorsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateIp6TranslatorsResponse struct { *tchttp.BaseResponse Response *struct { // 转换实例的唯一ID数组,形如"ip6-xxxxxxxx" Ip6TranslatorSet []*string `json:"Ip6TranslatorSet,omitempty" name:"Ip6TranslatorSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateIp6TranslatorsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateIp6TranslatorsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNatGatewayDestinationIpPortTranslationNatRuleRequest struct { *tchttp.BaseRequest // NAT网关的ID,形如:`nat-df45454`。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // NAT网关的端口转换规则。 DestinationIpPortTranslationNatRules []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRules,omitempty" name:"DestinationIpPortTranslationNatRules" list` } func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNatGatewayDestinationIpPortTranslationNatRuleResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNatGatewayDestinationIpPortTranslationNatRuleResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNatGatewayRequest struct { *tchttp.BaseRequest // NAT网关名称 NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // NAT网关最大外网出带宽(单位:Mbps),支持的参数值:`20, 50, 100, 200, 500, 1000, 2000, 5000`,默认: `100Mbps`。 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // NAT网关并发连接上限,支持参数值:`1000000、3000000、10000000`,默认值为`100000`。 MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` // 需要申请的弹性IP个数,系统会按您的要求生产N个弹性IP,其中AddressCount和PublicAddresses至少传递一个。 AddressCount *uint64 `json:"AddressCount,omitempty" name:"AddressCount"` // 绑定NAT网关的弹性IP数组,其中AddressCount和PublicAddresses至少传递一个。 PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses" list` // 可用区,形如:`ap-guangzhou-1`。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateNatGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNatGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNatGatewayResponse struct { *tchttp.BaseResponse Response *struct { // NAT网关对象数组。 NatGatewaySet []*NatGateway `json:"NatGatewaySet,omitempty" name:"NatGatewaySet" list` // 符合条件的 NAT网关对象数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateNatGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNatGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNetDetectRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`。形如:`vpc-12345678` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网实例ID。形如:subnet-12345678。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 网络探测名称,最大长度不能超过60个字节。 NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` // 探测目的IPv4地址数组。最多两个。 DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp" list` // 下一跳类型,目前我们支持的类型有: // VPN:VPN网关; // DIRECTCONNECT:专线网关; // PEERCONNECTION:对等连接; // NAT:NAT网关; // NORMAL_CVM:普通云服务器; NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` // 下一跳目的网关,取值与“下一跳类型”相关: // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` // 网络探测描述。 NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` } func (r *CreateNetDetectRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNetDetectRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNetDetectResponse struct { *tchttp.BaseResponse Response *struct { // 网络探测(NetDetect)对象。 NetDetect *NetDetect `json:"NetDetect,omitempty" name:"NetDetect"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateNetDetectResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNetDetectResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNetworkAclRequest struct { *tchttp.BaseRequest // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 网络ACL名称,最大长度不能超过60个字节。 NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` } func (r *CreateNetworkAclRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNetworkAclRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNetworkAclResponse struct { *tchttp.BaseResponse Response *struct { // 网络ACL实例。 NetworkAcl *NetworkAcl `json:"NetworkAcl,omitempty" name:"NetworkAcl"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateNetworkAclResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNetworkAclResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNetworkInterfaceRequest struct { *tchttp.BaseRequest // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 弹性网卡名称,最大长度不能超过60个字节。 NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` // 弹性网卡所在的子网实例ID,例如:subnet-0ap8nwca。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 弹性网卡描述,可任意命名,但不得超过60个字符。 NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` // 新申请的内网IP地址个数,内网IP地址个数总和不能超过配数。 SecondaryPrivateIpAddressCount *uint64 `json:"SecondaryPrivateIpAddressCount,omitempty" name:"SecondaryPrivateIpAddressCount"` // 指定绑定的安全组,例如:['sg-1dd51d']。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 指定的内网IP信息,单次最多指定10个。 PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateNetworkInterfaceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNetworkInterfaceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateNetworkInterfaceResponse struct { *tchttp.BaseResponse Response *struct { // 弹性网卡实例。 NetworkInterface *NetworkInterface `json:"NetworkInterface,omitempty" name:"NetworkInterface"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateNetworkInterfaceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateNetworkInterfaceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateRouteTableRequest struct { *tchttp.BaseRequest // 待操作的VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 路由表名称,最大长度不能超过60个字节。 RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateRouteTableRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateRouteTableRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateRouteTableResponse struct { *tchttp.BaseResponse Response *struct { // 路由表对象。 RouteTable *RouteTable `json:"RouteTable,omitempty" name:"RouteTable"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateRouteTableResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateRouteTableResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateRoutesRequest struct { *tchttp.BaseRequest // 路由表实例ID。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由策略对象。 Routes []*Route `json:"Routes,omitempty" name:"Routes" list` } func (r *CreateRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 新增的实例个数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 路由表对象。 RouteTableSet []*RouteTable `json:"RouteTableSet,omitempty" name:"RouteTableSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSecurityGroupPoliciesRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 安全组规则集合。 SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` } func (r *CreateSecurityGroupPoliciesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSecurityGroupPoliciesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSecurityGroupPoliciesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateSecurityGroupPoliciesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSecurityGroupPoliciesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSecurityGroupRequest struct { *tchttp.BaseRequest // 安全组名称,可任意命名,但不得超过60个字符。 GroupName *string `json:"GroupName,omitempty" name:"GroupName"` // 安全组备注,最多100个字符。 GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateSecurityGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSecurityGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSecurityGroupResponse struct { *tchttp.BaseResponse Response *struct { // 安全组对象。 SecurityGroup *SecurityGroup `json:"SecurityGroup,omitempty" name:"SecurityGroup"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateSecurityGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSecurityGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSecurityGroupWithPoliciesRequest struct { *tchttp.BaseRequest // 安全组名称,可任意命名,但不得超过60个字符。 GroupName *string `json:"GroupName,omitempty" name:"GroupName"` // 安全组备注,最多100个字符。 GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` // 项目ID,默认0。可在qcloud控制台项目管理页面查询到。 ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` // 安全组规则集合。 SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` } func (r *CreateSecurityGroupWithPoliciesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSecurityGroupWithPoliciesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSecurityGroupWithPoliciesResponse struct { *tchttp.BaseResponse Response *struct { // 安全组对象。 SecurityGroup *SecurityGroup `json:"SecurityGroup,omitempty" name:"SecurityGroup"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateSecurityGroupWithPoliciesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSecurityGroupWithPoliciesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateServiceTemplateGroupRequest struct { *tchttp.BaseRequest // 协议端口模板集合名称 ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` // 协议端口模板实例ID,例如:ppm-4dw6agho。 ServiceTemplateIds []*string `json:"ServiceTemplateIds,omitempty" name:"ServiceTemplateIds" list` } func (r *CreateServiceTemplateGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateServiceTemplateGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateServiceTemplateGroupResponse struct { *tchttp.BaseResponse Response *struct { // 协议端口模板集合对象。 ServiceTemplateGroup *ServiceTemplateGroup `json:"ServiceTemplateGroup,omitempty" name:"ServiceTemplateGroup"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateServiceTemplateGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateServiceTemplateGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateServiceTemplateRequest struct { *tchttp.BaseRequest // 协议端口模板名称 ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` // 支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。 Services []*string `json:"Services,omitempty" name:"Services" list` } func (r *CreateServiceTemplateRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateServiceTemplateRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateServiceTemplateResponse struct { *tchttp.BaseResponse Response *struct { // 协议端口模板对象。 ServiceTemplate *ServiceTemplate `json:"ServiceTemplate,omitempty" name:"ServiceTemplate"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateServiceTemplateResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateServiceTemplateResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSubnetRequest struct { *tchttp.BaseRequest // 待操作的VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网名称,最大长度不能超过60个字节。 SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` // 子网网段,子网网段必须在VPC网段内,相同VPC内子网网段不能重叠。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 子网所在的可用区ID,不同子网选择不同可用区可以做跨可用区灾备。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateSubnetRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSubnetRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSubnetResponse struct { *tchttp.BaseResponse Response *struct { // 子网对象。 Subnet *Subnet `json:"Subnet,omitempty" name:"Subnet"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateSubnetResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSubnetResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSubnetsRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网对象列表。 Subnets []*SubnetInput `json:"Subnets,omitempty" name:"Subnets" list` // 指定绑定的标签列表,注意这里的标签集合为列表中所有子网对象所共享,不能为每个子网对象单独指定标签,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateSubnetsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSubnetsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateSubnetsResponse struct { *tchttp.BaseResponse Response *struct { // 新创建的子网列表。 SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateSubnetsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateSubnetsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateVpcRequest struct { *tchttp.BaseRequest // vpc名称,最大长度不能超过60个字节。 VpcName *string `json:"VpcName,omitempty" name:"VpcName"` // vpc的cidr,只能为10.0.0.0/16,172.16.0.0/16,192.168.0.0/16这三个内网网段内。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 是否开启组播。true: 开启, false: 不开启。 EnableMulticast *string `json:"EnableMulticast,omitempty" name:"EnableMulticast"` // DNS地址,最多支持4个 DnsServers []*string `json:"DnsServers,omitempty" name:"DnsServers" list` // 域名 DomainName *string `json:"DomainName,omitempty" name:"DomainName"` // 指定绑定的标签列表,例如:[{"Key": "city", "Value": "shanghai"}] Tags []*Tag `json:"Tags,omitempty" name:"Tags" list` } func (r *CreateVpcRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateVpcRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateVpcResponse struct { *tchttp.BaseResponse Response *struct { // Vpc对象。 Vpc *Vpc `json:"Vpc,omitempty" name:"Vpc"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateVpcResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateVpcResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateVpnConnectionRequest struct { *tchttp.BaseRequest // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 对端网关ID,例如:cgw-2wqq41m9,可通过DescribeCustomerGateways接口查询对端网关。 CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` // 通道名称,可任意命名,但不得超过60个字符。 VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` // 预共享密钥。 PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` // SPD策略组,例如:{"10.0.0.5/24":["172.123.10.5/16"]},10.0.0.5/24是vpc内网段172.123.10.5/16是IDC网段。用户指定VPC内哪些网段可以和您IDC中哪些网段通信。 SecurityPolicyDatabases []*SecurityPolicyDatabase `json:"SecurityPolicyDatabases,omitempty" name:"SecurityPolicyDatabases" list` // IKE配置(Internet Key Exchange,因特网密钥交换),IKE具有一套自我保护机制,用户配置网络安全协议 IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` // IPSec配置,腾讯云提供IPSec安全会话设置 IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` } func (r *CreateVpnConnectionRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateVpnConnectionRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateVpnConnectionResponse struct { *tchttp.BaseResponse Response *struct { // 通道实例对象。 VpnConnection *VpnConnection `json:"VpnConnection,omitempty" name:"VpnConnection"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateVpnConnectionResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateVpnConnectionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateVpnGatewayRequest struct { *tchttp.BaseRequest // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // VPN网关名称,最大长度不能超过60个字节。 VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // VPN网关计费模式,PREPAID:表示预付费,即包年包月,POSTPAID_BY_HOUR:表示后付费,即按量计费。默认:POSTPAID_BY_HOUR,如果指定预付费模式,参数InstanceChargePrepaid必填。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` // 可用区,如:ap-guangzhou-2。 Zone *string `json:"Zone,omitempty" name:"Zone"` // VPN网关类型。值“CCN”云联网类型VPN网关 Type *string `json:"Type,omitempty" name:"Type"` } func (r *CreateVpnGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateVpnGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CreateVpnGatewayResponse struct { *tchttp.BaseResponse Response *struct { // VPN网关对象 VpnGateway *VpnGateway `json:"VpnGateway,omitempty" name:"VpnGateway"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *CreateVpnGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *CreateVpnGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type CustomerGateway struct { // 用户网关唯一ID CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` // 网关名称 CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` // 公网地址 IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` // 创建时间 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type CustomerGatewayVendor struct { // 平台。 Platform *string `json:"Platform,omitempty" name:"Platform"` // 软件版本。 SoftwareVersion *string `json:"SoftwareVersion,omitempty" name:"SoftwareVersion"` // 供应商名称。 VendorName *string `json:"VendorName,omitempty" name:"VendorName"` } type CvmInstance struct { // VPC实例ID。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网实例ID。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 云主机实例ID InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 云主机名称。 InstanceName *string `json:"InstanceName,omitempty" name:"InstanceName"` // 云主机状态。 InstanceState *string `json:"InstanceState,omitempty" name:"InstanceState"` // 实例的CPU核数,单位:核。 CPU *uint64 `json:"CPU,omitempty" name:"CPU"` // 实例内存容量,单位:GB。 Memory *uint64 `json:"Memory,omitempty" name:"Memory"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 实例机型。 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 实例弹性网卡配额(包含主网卡)。 EniLimit *uint64 `json:"EniLimit,omitempty" name:"EniLimit"` // 实例弹性网卡内网IP配额(包含主网卡)。 EniIpLimit *uint64 `json:"EniIpLimit,omitempty" name:"EniIpLimit"` // 实例已绑定弹性网卡的个数(包含主网卡)。 InstanceEniCount *uint64 `json:"InstanceEniCount,omitempty" name:"InstanceEniCount"` } type DefaultVpcSubnet struct { // 默认VpcId VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 默认SubnetId SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` } type DeleteAddressTemplateGroupRequest struct { *tchttp.BaseRequest // IP地址模板集合实例ID,例如:ipmg-90cex8mq。 AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` } func (r *DeleteAddressTemplateGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteAddressTemplateGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteAddressTemplateGroupResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteAddressTemplateGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteAddressTemplateGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteAddressTemplateRequest struct { *tchttp.BaseRequest // IP地址模板实例ID,例如:ipm-09o5m8kc。 AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` } func (r *DeleteAddressTemplateRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteAddressTemplateRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteAddressTemplateResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteAddressTemplateResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteAddressTemplateResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteAssistantCidrRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"] CidrBlocks []*string `json:"CidrBlocks,omitempty" name:"CidrBlocks" list` } func (r *DeleteAssistantCidrRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteAssistantCidrRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteAssistantCidrResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteAssistantCidrResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteAssistantCidrResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteBandwidthPackageRequest struct { *tchttp.BaseRequest // 待删除带宽包唯一ID BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` } func (r *DeleteBandwidthPackageRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteBandwidthPackageRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteBandwidthPackageResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteBandwidthPackageResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteBandwidthPackageResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteCcnRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` } func (r *DeleteCcnRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteCcnRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteCcnResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteCcnResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteCcnResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteCustomerGatewayRequest struct { *tchttp.BaseRequest // 对端网关ID,例如:cgw-2wqq41m9,可通过DescribeCustomerGateways接口查询对端网关。 CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` } func (r *DeleteCustomerGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteCustomerGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteCustomerGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteCustomerGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteCustomerGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteDhcpIpRequest struct { *tchttp.BaseRequest // `DhcpIp`的`ID`,是`DhcpIp`的唯一标识。 DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` } func (r *DeleteDhcpIpRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDhcpIpRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteDhcpIpResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteDhcpIpResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDhcpIpResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteDirectConnectGatewayCcnRoutesRequest struct { *tchttp.BaseRequest // 专线网关ID,形如:dcg-prpqlmg1 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` // 路由ID。形如:ccnr-f49l6u0z。 RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds" list` } func (r *DeleteDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteDirectConnectGatewayCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteDirectConnectGatewayRequest struct { *tchttp.BaseRequest // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` } func (r *DeleteDirectConnectGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDirectConnectGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteDirectConnectGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteDirectConnectGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteDirectConnectGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteFlowLogRequest struct { *tchttp.BaseRequest // 私用网络ID或者统一ID,建议使用统一ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 流日志唯一ID FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` } func (r *DeleteFlowLogRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteFlowLogRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteFlowLogResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteFlowLogResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteFlowLogResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteHaVipRequest struct { *tchttp.BaseRequest // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` } func (r *DeleteHaVipRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteHaVipRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteHaVipResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteHaVipResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteHaVipResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteIp6TranslatorsRequest struct { *tchttp.BaseRequest // 待释放的IPV6转换实例的唯一ID,形如‘ip6-xxxxxxxx’ Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds" list` } func (r *DeleteIp6TranslatorsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteIp6TranslatorsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteIp6TranslatorsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteIp6TranslatorsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteIp6TranslatorsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest struct { *tchttp.BaseRequest // NAT网关的ID,形如:`nat-df45454`。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // NAT网关的端口转换规则。 DestinationIpPortTranslationNatRules []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRules,omitempty" name:"DestinationIpPortTranslationNatRules" list` } func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNatGatewayDestinationIpPortTranslationNatRuleResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNatGatewayRequest struct { *tchttp.BaseRequest // NAT网关的ID,形如:`nat-df45454`。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` } func (r *DeleteNatGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNatGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNatGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteNatGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNatGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNetDetectRequest struct { *tchttp.BaseRequest // 网络探测实例`ID`。形如:`netd-12345678` NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` } func (r *DeleteNetDetectRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNetDetectRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNetDetectResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteNetDetectResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNetDetectResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNetworkAclRequest struct { *tchttp.BaseRequest // 网络ACL实例ID。例如:acl-12345678。 NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` } func (r *DeleteNetworkAclRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNetworkAclRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNetworkAclResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteNetworkAclResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNetworkAclResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNetworkInterfaceRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-m6dyj72l。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` } func (r *DeleteNetworkInterfaceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNetworkInterfaceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteNetworkInterfaceResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteNetworkInterfaceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteNetworkInterfaceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteRouteTableRequest struct { *tchttp.BaseRequest // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` } func (r *DeleteRouteTableRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteRouteTableRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteRouteTableResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteRouteTableResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteRouteTableResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteRoutesRequest struct { *tchttp.BaseRequest // 路由表实例ID。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由策略对象。 Routes []*Route `json:"Routes,omitempty" name:"Routes" list` } func (r *DeleteRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteSecurityGroupPoliciesRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 安全组规则集合。一个请求中只能删除单个方向的一条或多条规则。支持指定索引(PolicyIndex) 匹配删除和安全组规则匹配删除两种方式,一个请求中只能使用一种匹配方式。 SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` } func (r *DeleteSecurityGroupPoliciesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteSecurityGroupPoliciesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteSecurityGroupPoliciesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteSecurityGroupPoliciesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteSecurityGroupPoliciesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteSecurityGroupRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` } func (r *DeleteSecurityGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteSecurityGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteSecurityGroupResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteSecurityGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteSecurityGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteServiceTemplateGroupRequest struct { *tchttp.BaseRequest // 协议端口模板集合实例ID,例如:ppmg-n17uxvve。 ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` } func (r *DeleteServiceTemplateGroupRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteServiceTemplateGroupRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteServiceTemplateGroupResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteServiceTemplateGroupResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteServiceTemplateGroupResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteServiceTemplateRequest struct { *tchttp.BaseRequest // 协议端口模板实例ID,例如:ppm-e6dy460g。 ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` } func (r *DeleteServiceTemplateRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteServiceTemplateRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteServiceTemplateResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteServiceTemplateResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteServiceTemplateResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteSubnetRequest struct { *tchttp.BaseRequest // 子网实例ID。可通过DescribeSubnets接口返回值中的SubnetId获取。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` } func (r *DeleteSubnetRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteSubnetRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteSubnetResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteSubnetResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteSubnetResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteVpcRequest struct { *tchttp.BaseRequest // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` } func (r *DeleteVpcRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteVpcRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteVpcResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteVpcResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteVpcResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteVpnConnectionRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // VPN通道实例ID。形如:vpnx-f49l6u0z。 VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` } func (r *DeleteVpnConnectionRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteVpnConnectionRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteVpnConnectionResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteVpnConnectionResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteVpnConnectionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteVpnGatewayRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` } func (r *DeleteVpnGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteVpnGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DeleteVpnGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DeleteVpnGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DeleteVpnGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAccountAttributesRequest struct { *tchttp.BaseRequest } func (r *DescribeAccountAttributesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAccountAttributesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAccountAttributesResponse struct { *tchttp.BaseResponse Response *struct { // 用户账号属性对象 AccountAttributeSet []*AccountAttribute `json:"AccountAttributeSet,omitempty" name:"AccountAttributeSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeAccountAttributesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAccountAttributesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressQuotaRequest struct { *tchttp.BaseRequest } func (r *DescribeAddressQuotaRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressQuotaRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressQuotaResponse struct { *tchttp.BaseResponse Response *struct { // 账户 EIP 配额信息。 QuotaSet []*Quota `json:"QuotaSet,omitempty" name:"QuotaSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeAddressQuotaResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressQuotaResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressTemplateGroupsRequest struct { *tchttp.BaseRequest // 过滤条件。 // <li>address-template-group-name - String - (过滤条件)IP地址模板集合名称。</li> // <li>address-template-group-id - String - (过滤条件)IP地址模板实集合例ID,例如:ipmg-mdunqeb6。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeAddressTemplateGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressTemplateGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressTemplateGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // IP地址模板。 AddressTemplateGroupSet []*AddressTemplateGroup `json:"AddressTemplateGroupSet,omitempty" name:"AddressTemplateGroupSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeAddressTemplateGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressTemplateGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressTemplatesRequest struct { *tchttp.BaseRequest // 过滤条件。 // <li>address-template-name - String - (过滤条件)IP地址模板名称。</li> // <li>address-template-id - String - (过滤条件)IP地址模板实例ID,例如:ipm-mdunqeb6。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeAddressTemplatesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressTemplatesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressTemplatesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // IP地址模版。 AddressTemplateSet []*AddressTemplate `json:"AddressTemplateSet,omitempty" name:"AddressTemplateSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeAddressTemplatesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressTemplatesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressesRequest struct { *tchttp.BaseRequest // 标识 EIP 的唯一 ID 列表。EIP 唯一 ID 形如:`eip-11112222`。参数不支持同时指定`AddressIds`和`Filters`。 AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds" list` // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AddressIds`和`Filters`。详细的过滤条件如下: // <li> address-id - String - 是否必填:否 - (过滤条件)按照 EIP 的唯一 ID 过滤。EIP 唯一 ID 形如:eip-11112222。</li> // <li> address-name - String - 是否必填:否 - (过滤条件)按照 EIP 名称过滤。不支持模糊过滤。</li> // <li> address-ip - String - 是否必填:否 - (过滤条件)按照 EIP 的 IP 地址过滤。</li> // <li> address-status - String - 是否必填:否 - (过滤条件)按照 EIP 的状态过滤。状态包含:'CREATING','BINDING','BIND','UNBINDING','UNBIND','OFFLINING','BIND_ENI'。</li> // <li> instance-id - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的实例 ID 过滤。实例 ID 形如:ins-11112222。</li> // <li> private-ip-address - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的内网 IP 过滤。</li> // <li> network-interface-id - String - 是否必填:否 - (过滤条件)按照 EIP 绑定的弹性网卡 ID 过滤。弹性网卡 ID 形如:eni-11112222。</li> // <li> is-arrears - String - 是否必填:否 - (过滤条件)按照 EIP 是否欠费进行过滤。(TRUE:EIP 处于欠费状态|FALSE:EIP 费用状态正常)</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeAddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAddressesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的 EIP 数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // EIP 详细信息列表。 AddressSet []*Address `json:"AddressSet,omitempty" name:"AddressSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeAddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAssistantCidrRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`数组。形如:[`vpc-6v2ht8q5`] VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds" list` // 过滤条件,参数不支持同时指定NetworkInterfaceIds和Filters。 // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeAssistantCidrRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAssistantCidrRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeAssistantCidrResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的辅助CIDR数组。 // 注意:此字段可能返回 null,表示取不到有效值。 AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet" list` // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeAssistantCidrResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeAssistantCidrResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeBandwidthPackageQuotaRequest struct { *tchttp.BaseRequest } func (r *DescribeBandwidthPackageQuotaRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeBandwidthPackageQuotaRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeBandwidthPackageQuotaResponse struct { *tchttp.BaseResponse Response *struct { // 带宽包配额详细信息 QuotaSet []*Quota `json:"QuotaSet,omitempty" name:"QuotaSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeBandwidthPackageQuotaResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeBandwidthPackageQuotaResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeBandwidthPackagesRequest struct { *tchttp.BaseRequest // 带宽包唯一ID列表 BandwidthPackageIds []*string `json:"BandwidthPackageIds,omitempty" name:"BandwidthPackageIds" list` // 每次请求的`Filters`的上限为10。参数不支持同时指定`BandwidthPackageIds`和`Filters`。详细的过滤条件如下: // <li> bandwidth-package_id - String - 是否必填:否 - (过滤条件)按照带宽包的唯一标识ID过滤。</li> // <li> bandwidth-package-name - String - 是否必填:否 - (过滤条件)按照 带宽包名称过滤。不支持模糊过滤。</li> // <li> network-type - String - 是否必填:否 - (过滤条件)按照带宽包的类型过滤。类型包括'BGP','SINGLEISP'和'ANYCAST'。</li> // <li> charge-type - String - 是否必填:否 - (过滤条件)按照带宽包的计费类型过滤。计费类型包括'TOP5_POSTPAID_BY_MONTH'和'PERCENT95_POSTPAID_BY_MONTH'</li> // <li> resource.resource-type - String - 是否必填:否 - (过滤条件)按照带宽包资源类型过滤。资源类型包括'Address'和'LoadBalance'</li> // <li> resource.resource-id - String - 是否必填:否 - (过滤条件)按照带宽包资源Id过滤。资源Id形如'eip-xxxx','lb-xxxx'</li> // <li> resource.address-ip - String - 是否必填:否 - (过滤条件)按照带宽包资源Ip过滤。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 查询带宽包偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 查询带宽包数量限制 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeBandwidthPackagesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeBandwidthPackagesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeBandwidthPackagesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的带宽包数量 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 描述带宽包详细信息 BandwidthPackageSet []*BandwidthPackage `json:"BandwidthPackageSet,omitempty" name:"BandwidthPackageSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeBandwidthPackagesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeBandwidthPackagesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnAttachedInstancesRequest struct { *tchttp.BaseRequest // 偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` // 过滤条件: // <li>ccn-id - String -(过滤条件)CCN实例ID。</li> // <li>instance-type - String -(过滤条件)关联实例类型。</li> // <li>instance-region - String -(过滤条件)关联实例所属地域。</li> // <li>instance-id - String -(过滤条件)关联实例实例ID。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 云联网实例ID CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 排序字段。支持:`CcnId` `InstanceType` `InstanceId` `InstanceName` `InstanceRegion` `AttachedTime` `State`。 OrderField *string `json:"OrderField,omitempty" name:"OrderField"` // 排序方法。顺序:`ASC`,倒序:`DESC`。 OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` } func (r *DescribeCcnAttachedInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnAttachedInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnAttachedInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 关联实例列表。 InstanceSet []*CcnAttachedInstance `json:"InstanceSet,omitempty" name:"InstanceSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeCcnAttachedInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnAttachedInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnRegionBandwidthLimitsRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` } func (r *DescribeCcnRegionBandwidthLimitsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnRegionBandwidthLimitsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnRegionBandwidthLimitsResponse struct { *tchttp.BaseResponse Response *struct { // 云联网(CCN)各地域出带宽上限 CcnRegionBandwidthLimitSet []*CcnRegionBandwidthLimit `json:"CcnRegionBandwidthLimitSet,omitempty" name:"CcnRegionBandwidthLimitSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeCcnRegionBandwidthLimitsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnRegionBandwidthLimitsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnRoutesRequest struct { *tchttp.BaseRequest // CCN实例ID,形如:ccn-gree226l。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // CCN路由策略唯一ID。形如:ccnr-f49l6u0z。 RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds" list` // 过滤条件,参数不支持同时指定RouteIds和Filters。 // <li>route-id - String -(过滤条件)路由策略ID。</li> // <li>cidr-block - String -(过滤条件)目的端。</li> // <li>instance-type - String -(过滤条件)下一跳类型。</li> // <li>instance-region - String -(过滤条件)下一跳所属地域。</li> // <li>instance-id - String -(过滤条件)下一跳实例ID。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // CCN路由策略对象。 RouteSet []*CcnRoute `json:"RouteSet,omitempty" name:"RouteSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnsRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定CcnIds和Filters。 CcnIds []*string `json:"CcnIds,omitempty" name:"CcnIds" list` // 过滤条件,参数不支持同时指定CcnIds和Filters。 // <li>ccn-id - String - (过滤条件)CCN唯一ID,形如:vpc-f49l6u0z。</li> // <li>ccn-name - String - (过滤条件)CCN名称。</li> // <li>ccn-description - String - (过滤条件)CCN描述。</li> // <li>state - String - (过滤条件)实例状态, 'ISOLATED': 隔离中(欠费停服),'AVAILABLE':运行中。</li> // <li>tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。</li> // <li>tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例:查询绑定了标签的CCN列表。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` // 排序字段。支持:`CcnId` `CcnName` `CreateTime` `State` `QosLevel` OrderField *string `json:"OrderField,omitempty" name:"OrderField"` // 排序方法。顺序:`ASC`,倒序:`DESC`。 OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` } func (r *DescribeCcnsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCcnsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // CCN对象。 CcnSet []*CCN `json:"CcnSet,omitempty" name:"CcnSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeCcnsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCcnsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeClassicLinkInstancesRequest struct { *tchttp.BaseRequest // 过滤条件。 // <li>vpc-id - String - (过滤条件)VPC实例ID。</li> // <li>vm-ip - String - (过滤条件)基础网络云服务器IP。</li> Filters []*FilterObject `json:"Filters,omitempty" name:"Filters" list` // 偏移量 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeClassicLinkInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeClassicLinkInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeClassicLinkInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 私有网络和基础网络互通设备。 ClassicLinkInstanceSet []*ClassicLinkInstance `json:"ClassicLinkInstanceSet,omitempty" name:"ClassicLinkInstanceSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeClassicLinkInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeClassicLinkInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCustomerGatewayVendorsRequest struct { *tchttp.BaseRequest } func (r *DescribeCustomerGatewayVendorsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCustomerGatewayVendorsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCustomerGatewayVendorsResponse struct { *tchttp.BaseResponse Response *struct { // 对端网关厂商信息对象。 CustomerGatewayVendorSet []*CustomerGatewayVendor `json:"CustomerGatewayVendorSet,omitempty" name:"CustomerGatewayVendorSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeCustomerGatewayVendorsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCustomerGatewayVendorsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCustomerGatewaysRequest struct { *tchttp.BaseRequest // 对端网关ID,例如:cgw-2wqq41m9。每次请求的实例的上限为100。参数不支持同时指定CustomerGatewayIds和Filters。 CustomerGatewayIds []*string `json:"CustomerGatewayIds,omitempty" name:"CustomerGatewayIds" list` // 过滤条件,详见下表:实例过滤条件表。每次请求的Filters的上限为10,Filter.Values的上限为5。参数不支持同时指定CustomerGatewayIds和Filters。 // <li>customer-gateway-id - String - (过滤条件)用户网关唯一ID形如:`cgw-mgp33pll`。</li> // <li>customer-gateway-name - String - (过滤条件)用户网关名称形如:`test-cgw`。</li> // <li>ip-address - String - (过滤条件)公网地址形如:`58.211.1.12`。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API 简介中的相关小节。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeCustomerGatewaysRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCustomerGatewaysRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeCustomerGatewaysResponse struct { *tchttp.BaseResponse Response *struct { // 对端网关对象列表 CustomerGatewaySet []*CustomerGateway `json:"CustomerGatewaySet,omitempty" name:"CustomerGatewaySet" list` // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeCustomerGatewaysResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeCustomerGatewaysResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDhcpIpsRequest struct { *tchttp.BaseRequest // DhcpIp实例ID。形如:dhcpip-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定DhcpIpIds和Filters。 DhcpIpIds []*string `json:"DhcpIpIds,omitempty" name:"DhcpIpIds" list` // 过滤条件,参数不支持同时指定DhcpIpIds和Filters。 // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。</li> // <li>subnet-id - String - (过滤条件)所属子网实例ID,形如:subnet-f49l6u0z。</li> // <li>dhcpip-id - String - (过滤条件)DhcpIp实例ID,形如:dhcpip-pxir56ns。</li> // <li>dhcpip-name - String - (过滤条件)DhcpIp实例名称。</li> // <li>address-ip - String - (过滤条件)DhcpIp实例的IP,根据IP精确查找。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeDhcpIpsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDhcpIpsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDhcpIpsResponse struct { *tchttp.BaseResponse Response *struct { // 实例详细信息列表。 DhcpIpSet []*DhcpIp `json:"DhcpIpSet,omitempty" name:"DhcpIpSet" list` // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeDhcpIpsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDhcpIpsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDirectConnectGatewayCcnRoutesRequest struct { *tchttp.BaseRequest // 专线网关ID,形如:`dcg-prpqlmg1`。 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` // 云联网路由学习类型,可选值: // <li>`BGP` - 自动学习。</li> // <li>`STATIC` - 静态,即用户配置,默认值。</li> CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` // 偏移量。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDirectConnectGatewayCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 云联网路由(IDC网段)列表。 RouteSet []*DirectConnectGatewayCcnRoute `json:"RouteSet,omitempty" name:"RouteSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDirectConnectGatewaysRequest struct { *tchttp.BaseRequest // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 DirectConnectGatewayIds []*string `json:"DirectConnectGatewayIds,omitempty" name:"DirectConnectGatewayIds" list` // 过滤条件,参数不支持同时指定`DirectConnectGatewayIds`和`Filters`。 // <li>direct-connect-gateway-id - String - 专线网关唯一`ID`,形如:`dcg-9o233uri`。</li> // <li>direct-connect-gateway-name - String - 专线网关名称,默认模糊查询。</li> // <li>direct-connect-gateway-ip - String - 专线网关`IP`。</li> // <li>gateway-type - String - 网关类型,可选值:`NORMAL`(普通型)、`NAT`(NAT型)。</li> // <li>network-type- String - 网络类型,可选值:`VPC`(私有网络类型)、`CCN`(云联网类型)。</li> // <li>ccn-id - String - 专线网关所在云联网`ID`。</li> // <li>vpc-id - String - 专线网关所在私有网络`ID`。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeDirectConnectGatewaysRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDirectConnectGatewaysRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeDirectConnectGatewaysResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 专线网关对象数组。 DirectConnectGatewaySet []*DirectConnectGateway `json:"DirectConnectGatewaySet,omitempty" name:"DirectConnectGatewaySet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeDirectConnectGatewaysResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeDirectConnectGatewaysResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeFlowLogRequest struct { *tchttp.BaseRequest // 私用网络ID或者统一ID,建议使用统一ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 流日志唯一ID FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` } func (r *DescribeFlowLogRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeFlowLogRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeFlowLogResponse struct { *tchttp.BaseResponse Response *struct { // 流日志信息 FlowLog []*FlowLog `json:"FlowLog,omitempty" name:"FlowLog" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeFlowLogResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeFlowLogResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeFlowLogsRequest struct { *tchttp.BaseRequest // 私用网络ID或者统一ID,建议使用统一ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 流日志唯一ID FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` // 流日志实例名字 FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` // 资源唯一ID ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` // 流日志采集类型,ACCEPT|REJECT|ALL TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` // 流日志存储ID CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` // 流日志存储ID状态 CloudLogState *string `json:"CloudLogState,omitempty" name:"CloudLogState"` // 按某个字段排序,支持字段:flowLogName,createTime,默认按createTime OrderField *string `json:"OrderField,omitempty" name:"OrderField"` // 升序(asc)还是降序(desc),默认:desc OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 每页行数,默认为10 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` // 过滤条件,参数不支持同时指定FlowLogIds和Filters。 // <li>tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。</li> // <li>tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。</li> Filters *Filter `json:"Filters,omitempty" name:"Filters"` } func (r *DescribeFlowLogsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeFlowLogsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeFlowLogsResponse struct { *tchttp.BaseResponse Response *struct { // 流日志实例集合 FlowLog []*FlowLog `json:"FlowLog,omitempty" name:"FlowLog" list` // 流日志总数目 TotalNum *uint64 `json:"TotalNum,omitempty" name:"TotalNum"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeFlowLogsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeFlowLogsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeGatewayFlowMonitorDetailRequest struct { *tchttp.BaseRequest // 时间点。表示要查询这分钟内的明细。如:`2019-02-28 18:15:20`,将查询 `18:15` 这一分钟内的明细。 TimePoint *string `json:"TimePoint,omitempty" name:"TimePoint"` // VPN网关实例ID,形如:`vpn-ltjahce6`。 VpnId *string `json:"VpnId,omitempty" name:"VpnId"` // 专线网关实例ID,形如:`dcg-ltjahce6`。 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` // 对等连接实例ID,形如:`pcx-ltjahce6`。 PeeringConnectionId *string `json:"PeeringConnectionId,omitempty" name:"PeeringConnectionId"` // NAT网关实例ID,形如:`nat-ltjahce6`。 NatId *string `json:"NatId,omitempty" name:"NatId"` // 偏移量。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` // 排序字段。支持 `InPkg` `OutPkg` `InTraffic` `OutTraffic`。 OrderField *string `json:"OrderField,omitempty" name:"OrderField"` // 排序方法。顺序:`ASC`,倒序:`DESC`。 OrderDirection *string `json:"OrderDirection,omitempty" name:"OrderDirection"` } func (r *DescribeGatewayFlowMonitorDetailRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeGatewayFlowMonitorDetailRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeGatewayFlowMonitorDetailResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 网关流量监控明细。 GatewayFlowMonitorDetailSet []*GatewayFlowMonitorDetail `json:"GatewayFlowMonitorDetailSet,omitempty" name:"GatewayFlowMonitorDetailSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeGatewayFlowMonitorDetailResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeGatewayFlowMonitorDetailResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeGatewayFlowQosRequest struct { *tchttp.BaseRequest // 网关实例ID,目前我们支持的网关实例类型有, // 专线网关实例ID,形如,`dcg-ltjahce6`; // Nat网关实例ID,形如,`nat-ltjahce6`; // VPN网关实例ID,形如,`vpn-ltjahce6`。 GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` // 限流的云服务器内网IP。 IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeGatewayFlowQosRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeGatewayFlowQosRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeGatewayFlowQosResponse struct { *tchttp.BaseResponse Response *struct { // 实例详细信息列表。 GatewayQosSet []*GatewayQos `json:"GatewayQosSet,omitempty" name:"GatewayQosSet" list` // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeGatewayFlowQosResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeGatewayFlowQosResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeHaVipsRequest struct { *tchttp.BaseRequest // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 HaVipIds []*string `json:"HaVipIds,omitempty" name:"HaVipIds" list` // 过滤条件,参数不支持同时指定`HaVipIds`和`Filters`。 // <li>havip-id - String - `HAVIP`唯一`ID`,形如:`havip-9o233uri`。</li> // <li>havip-name - String - `HAVIP`名称。</li> // <li>vpc-id - String - `HAVIP`所在私有网络`ID`。</li> // <li>subnet-id - String - `HAVIP`所在子网`ID`。</li> // <li>vip - String - `HAVIP`的地址`VIP`。</li> // <li>address-ip - String - `HAVIP`绑定的弹性公网`IP`。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeHaVipsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeHaVipsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeHaVipsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // `HAVIP`对象数组。 HaVipSet []*HaVip `json:"HaVipSet,omitempty" name:"HaVipSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeHaVipsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeHaVipsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeIp6AddressesRequest struct { *tchttp.BaseRequest // 标识 IPV6 的唯一 ID 列表。IPV6 唯一 ID 形如:`eip-11112222`。参数不支持同时指定`Ip6AddressIds`和`Filters`。 Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds" list` // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`AddressIds`和`Filters`。详细的过滤条件如下: // <li> address-ip - String - 是否必填:否 - (过滤条件)按照 EIP 的 IP 地址过滤。</li> // <li> network-interface-id - String - 是否必填:否 - (过滤条件)按照弹性网卡的唯一ID过滤。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeIp6AddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeIp6AddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeIp6AddressesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的 IPV6 数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // IPV6 详细信息列表。 AddressSet []*Address `json:"AddressSet,omitempty" name:"AddressSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeIp6AddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeIp6AddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeIp6TranslatorQuotaRequest struct { *tchttp.BaseRequest // 待查询IPV6转换实例的唯一ID列表,形如ip6-xxxxxxxx Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds" list` } func (r *DescribeIp6TranslatorQuotaRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeIp6TranslatorQuotaRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeIp6TranslatorQuotaResponse struct { *tchttp.BaseResponse Response *struct { // 账户在指定地域的IPV6转换实例及规则配额信息 // QUOTAID属性是TOTAL_TRANSLATOR_QUOTA,表示账户在指定地域的IPV6转换实例配额信息;QUOTAID属性是IPV6转换实例唯一ID(形如ip6-xxxxxxxx),表示账户在该转换实例允许创建的转换规则配额 QuotaSet []*Quota `json:"QuotaSet,omitempty" name:"QuotaSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeIp6TranslatorQuotaResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeIp6TranslatorQuotaResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeIp6TranslatorsRequest struct { *tchttp.BaseRequest // IPV6转换实例唯一ID数组,形如ip6-xxxxxxxx Ip6TranslatorIds []*string `json:"Ip6TranslatorIds,omitempty" name:"Ip6TranslatorIds" list` // 每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`Ip6TranslatorIds`和`Filters`。详细的过滤条件如下: // <li> ip6-translator-id - String - 是否必填:否 - (过滤条件)按照IPV6转换实例的唯一ID过滤,形如ip6-xxxxxxx。</li> // <li> ip6-translator-vip6 - String - 是否必填:否 - (过滤条件)按照IPV6地址过滤。不支持模糊过滤。</li> // <li> ip6-translator-name - String - 是否必填:否 - (过滤条件)按照IPV6转换实例名称过滤。不支持模糊过滤。</li> // <li> ip6-translator-status - String - 是否必填:否 - (过滤条件)按照IPV6转换实例的状态过滤。状态取值范围为"CREATING","RUNNING","DELETING","MODIFYING" Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于`Offset`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 Offset *int64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。关于`Limit`的更进一步介绍请参考 API [简介](https://cloud.tencent.com/document/api/213/11646)中的相关小节。 Limit *int64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeIp6TranslatorsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeIp6TranslatorsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeIp6TranslatorsResponse struct { *tchttp.BaseResponse Response *struct { // 符合过滤条件的IPV6转换实例数量。 TotalCount *int64 `json:"TotalCount,omitempty" name:"TotalCount"` // 符合过滤条件的IPV6转换实例详细信息 Ip6TranslatorSet []*Ip6Translator `json:"Ip6TranslatorSet,omitempty" name:"Ip6TranslatorSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeIp6TranslatorsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeIp6TranslatorsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest struct { *tchttp.BaseRequest // NAT网关ID。 NatGatewayIds []*string `json:"NatGatewayIds,omitempty" name:"NatGatewayIds" list` // 过滤条件: // 参数不支持同时指定NatGatewayIds和Filters。 // <li> nat-gateway-id,NAT网关的ID,如`nat-0yi4hekt`</li> // <li> vpc-id,私有网络VPC的ID,如`vpc-0yi4hekt`</li> // <li> public-ip-address, 弹性IP,如`139.199.232.238`。</li> // <li>public-port, 公网端口。</li> // <li>private-ip-address, 内网IP,如`10.0.0.1`。</li> // <li>private-port, 内网端口。</li> // <li>description,规则描述。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse struct { *tchttp.BaseResponse Response *struct { // NAT网关端口转发规则对象数组。 NatGatewayDestinationIpPortTranslationNatRuleSet []*NatGatewayDestinationIpPortTranslationNatRule `json:"NatGatewayDestinationIpPortTranslationNatRuleSet,omitempty" name:"NatGatewayDestinationIpPortTranslationNatRuleSet" list` // 符合条件的NAT网关端口转发规则对象数目。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNatGatewayDestinationIpPortTranslationNatRulesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNatGatewaysRequest struct { *tchttp.BaseRequest // NAT网关统一 ID,形如:`nat-123xx454`。 NatGatewayIds []*string `json:"NatGatewayIds,omitempty" name:"NatGatewayIds" list` // 过滤条件,参数不支持同时指定NatGatewayIds和Filters。 // <li>nat-gateway-id - String - (过滤条件)协议端口模板实例ID,形如:`nat-123xx454`。</li> // <li>vpc-id - String - (过滤条件)私有网络 唯一ID,形如:`vpc-123xx454`。</li> // <li>nat-gateway-name - String - (过滤条件)协议端口模板实例ID,形如:`test_nat`。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeNatGatewaysRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNatGatewaysRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNatGatewaysResponse struct { *tchttp.BaseResponse Response *struct { // NAT网关对象数组。 NatGatewaySet []*NatGateway `json:"NatGatewaySet,omitempty" name:"NatGatewaySet" list` // 符合条件的NAT网关对象个数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeNatGatewaysResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNatGatewaysResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetDetectStatesRequest struct { *tchttp.BaseRequest // 网络探测实例`ID`数组。形如:[`netd-12345678`] NetDetectIds []*string `json:"NetDetectIds,omitempty" name:"NetDetectIds" list` // 过滤条件,参数不支持同时指定NetDetectIds和Filters。 // <li>net-detect-id - String - (过滤条件)网络探测实例ID,形如:netd-12345678</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeNetDetectStatesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetDetectStatesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetDetectStatesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的网络探测验证结果对象数组。 // 注意:此字段可能返回 null,表示取不到有效值。 NetDetectStateSet []*NetDetectState `json:"NetDetectStateSet,omitempty" name:"NetDetectStateSet" list` // 符合条件的网络探测验证结果对象数量。 // 注意:此字段可能返回 null,表示取不到有效值。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeNetDetectStatesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetDetectStatesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetDetectsRequest struct { *tchttp.BaseRequest // 网络探测实例`ID`数组。形如:[`netd-12345678`] NetDetectIds []*string `json:"NetDetectIds,omitempty" name:"NetDetectIds" list` // 过滤条件,参数不支持同时指定NetDetectIds和Filters。 // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-12345678</li> // <li>net-detect-id - String - (过滤条件)网络探测实例ID,形如:netd-12345678</li> // <li>subnet-id - String - (过滤条件)子网实例ID,形如:subnet-12345678</li> // <li>net-detect-name - String - (过滤条件)网络探测名称</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeNetDetectsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetDetectsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetDetectsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的网络探测对象数组。 // 注意:此字段可能返回 null,表示取不到有效值。 NetDetectSet []*NetDetect `json:"NetDetectSet,omitempty" name:"NetDetectSet" list` // 符合条件的网络探测对象数量。 // 注意:此字段可能返回 null,表示取不到有效值。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeNetDetectsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetDetectsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetworkAclsRequest struct { *tchttp.BaseRequest // 网络ACL实例ID数组。形如:[acl-12345678]。每次请求的实例的上限为100。参数不支持同时指定NetworkAclIds和Filters。 NetworkAclIds []*string `json:"NetworkAclIds,omitempty" name:"NetworkAclIds" list` // 过滤条件,参数不支持同时指定NetworkAclIds和Filters。 // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-12345678。</li> // <li>network-acl-id - String - (过滤条件)网络ACL实例ID,形如:acl-12345678。</li> // <li>network-acl-name - String - (过滤条件)网络ACL实例名称。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最小值为1,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeNetworkAclsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetworkAclsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetworkAclsResponse struct { *tchttp.BaseResponse Response *struct { // 实例详细信息列表。 NetworkAclSet []*NetworkAcl `json:"NetworkAclSet,omitempty" name:"NetworkAclSet" list` // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeNetworkAclsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetworkAclsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetworkInterfaceLimitRequest struct { *tchttp.BaseRequest // 要查询的CVM实例ID或弹性网卡ID InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` } func (r *DescribeNetworkInterfaceLimitRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetworkInterfaceLimitRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetworkInterfaceLimitResponse struct { *tchttp.BaseResponse Response *struct { // 弹性网卡配额 EniQuantity *int64 `json:"EniQuantity,omitempty" name:"EniQuantity"` // 每个弹性网卡可以分配的IP配额 EniPrivateIpAddressQuantity *int64 `json:"EniPrivateIpAddressQuantity,omitempty" name:"EniPrivateIpAddressQuantity"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeNetworkInterfaceLimitResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetworkInterfaceLimitResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetworkInterfacesRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID查询。形如:eni-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定NetworkInterfaceIds和Filters。 NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds" list` // 过滤条件,参数不支持同时指定NetworkInterfaceIds和Filters。 // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。</li> // <li>subnet-id - String - (过滤条件)所属子网实例ID,形如:subnet-f49l6u0z。</li> // <li>network-interface-id - String - (过滤条件)弹性网卡实例ID,形如:eni-5k56k7k7。</li> // <li>attachment.instance-id - String - (过滤条件)绑定的云服务器实例ID,形如:ins-3nqpdn3i。</li> // <li>groups.security-group-id - String - (过滤条件)绑定的安全组实例ID,例如:sg-f9ekbxeq。</li> // <li>network-interface-name - String - (过滤条件)网卡实例名称。</li> // <li>network-interface-description - String - (过滤条件)网卡实例描述。</li> // <li>address-ip - String - (过滤条件)内网IPv4地址,单IP后缀模糊匹配,多IP精确匹配。可以与`ip-exact-match`配合做单IP的精确匹配查询。</li> // <li>ip-exact-match - Boolean - (过滤条件)内网IPv4精确匹配查询,存在多值情况,只取第一个。</li> // <li>tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。使用请参考示例2</li> // <li>tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3。</li> // <li>is-primary - Boolean - 是否必填:否 - (过滤条件)按照是否主网卡进行过滤。值为true时,仅过滤主网卡;值为false时,仅过滤辅助网卡;次过滤参数为提供时,同时过滤主网卡和辅助网卡。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeNetworkInterfacesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetworkInterfacesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeNetworkInterfacesResponse struct { *tchttp.BaseResponse Response *struct { // 实例详细信息列表。 NetworkInterfaceSet []*NetworkInterface `json:"NetworkInterfaceSet,omitempty" name:"NetworkInterfaceSet" list` // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeNetworkInterfacesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeNetworkInterfacesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeRouteConflictsRequest struct { *tchttp.BaseRequest // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 要检查的与之冲突的目的端列表 DestinationCidrBlocks []*string `json:"DestinationCidrBlocks,omitempty" name:"DestinationCidrBlocks" list` } func (r *DescribeRouteConflictsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeRouteConflictsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeRouteConflictsResponse struct { *tchttp.BaseResponse Response *struct { // 路由策略冲突列表 RouteConflictSet []*RouteConflict `json:"RouteConflictSet,omitempty" name:"RouteConflictSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeRouteConflictsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeRouteConflictsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeRouteTablesRequest struct { *tchttp.BaseRequest // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableIds []*string `json:"RouteTableIds,omitempty" name:"RouteTableIds" list` // 过滤条件,参数不支持同时指定RouteTableIds和Filters。 // <li>route-table-id - String - (过滤条件)路由表实例ID。</li> // <li>route-table-name - String - (过滤条件)路由表名称。</li> // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。</li> // <li>association.main - String - (过滤条件)是否主路由表。</li> // <li>tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。</li> // <li>tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 请求对象个数。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeRouteTablesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeRouteTablesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeRouteTablesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 路由表对象。 RouteTableSet []*RouteTable `json:"RouteTableSet,omitempty" name:"RouteTableSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeRouteTablesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeRouteTablesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupAssociationStatisticsRequest struct { *tchttp.BaseRequest // 安全实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` } func (r *DescribeSecurityGroupAssociationStatisticsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupAssociationStatisticsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupAssociationStatisticsResponse struct { *tchttp.BaseResponse Response *struct { // 安全组关联实例统计。 SecurityGroupAssociationStatisticsSet []*SecurityGroupAssociationStatistics `json:"SecurityGroupAssociationStatisticsSet,omitempty" name:"SecurityGroupAssociationStatisticsSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeSecurityGroupAssociationStatisticsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupAssociationStatisticsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupLimitsRequest struct { *tchttp.BaseRequest } func (r *DescribeSecurityGroupLimitsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupLimitsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupLimitsResponse struct { *tchttp.BaseResponse Response *struct { // 用户安全组配额限制。 SecurityGroupLimitSet *SecurityGroupLimitSet `json:"SecurityGroupLimitSet,omitempty" name:"SecurityGroupLimitSet"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeSecurityGroupLimitsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupLimitsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupPoliciesRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` } func (r *DescribeSecurityGroupPoliciesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupPoliciesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupPoliciesResponse struct { *tchttp.BaseResponse Response *struct { // 安全组规则集合。 SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeSecurityGroupPoliciesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupPoliciesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupReferencesRequest struct { *tchttp.BaseRequest // 安全组实例ID数组。格式如:['sg-12345678'] SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` } func (r *DescribeSecurityGroupReferencesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupReferencesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupReferencesResponse struct { *tchttp.BaseResponse Response *struct { // 安全组被引用信息。 ReferredSecurityGroupSet []*ReferredSecurityGroup `json:"ReferredSecurityGroupSet,omitempty" name:"ReferredSecurityGroupSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeSecurityGroupReferencesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupReferencesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupsRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。每次请求的实例的上限为100。参数不支持同时指定SecurityGroupIds和Filters。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` // 过滤条件,参数不支持同时指定SecurityGroupIds和Filters。 // <li>security-group-id - String - (过滤条件)安全组ID。</li> // <li>project-id - Integer - (过滤条件)项目ID。</li> // <li>security-group-name - String - (过滤条件)安全组名称。</li> // <li>tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。使用请参考示例2。</li> // <li>tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeSecurityGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSecurityGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 安全组对象。 SecurityGroupSet []*SecurityGroup `json:"SecurityGroupSet,omitempty" name:"SecurityGroupSet" list` // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeSecurityGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSecurityGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeServiceTemplateGroupsRequest struct { *tchttp.BaseRequest // 过滤条件。 // <li>service-template-group-name - String - (过滤条件)协议端口模板集合名称。</li> // <li>service-template-group-id - String - (过滤条件)协议端口模板集合实例ID,例如:ppmg-e6dy460g。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeServiceTemplateGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeServiceTemplateGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeServiceTemplateGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 协议端口模板集合。 ServiceTemplateGroupSet []*ServiceTemplateGroup `json:"ServiceTemplateGroupSet,omitempty" name:"ServiceTemplateGroupSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeServiceTemplateGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeServiceTemplateGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeServiceTemplatesRequest struct { *tchttp.BaseRequest // 过滤条件。 // <li>service-template-name - String - (过滤条件)协议端口模板名称。</li> // <li>service-template-id - String - (过滤条件)协议端口模板实例ID,例如:ppm-e6dy460g。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeServiceTemplatesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeServiceTemplatesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeServiceTemplatesResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 协议端口模板对象。 ServiceTemplateSet []*ServiceTemplate `json:"ServiceTemplateSet,omitempty" name:"ServiceTemplateSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeServiceTemplatesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeServiceTemplatesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSubnetsRequest struct { *tchttp.BaseRequest // 子网实例ID查询。形如:subnet-pxir56ns。每次请求的实例的上限为100。参数不支持同时指定SubnetIds和Filters。 SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds" list` // 过滤条件,参数不支持同时指定SubnetIds和Filters。 // <li>subnet-id - String - (过滤条件)Subnet实例名称。</li> // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。</li> // <li>cidr-block - String - (过滤条件)子网网段,形如: 192.168.1.0 。</li> // <li>is-default - Boolean - (过滤条件)是否是默认子网。</li> // <li>is-remote-vpc-snat - Boolean - (过滤条件)是否为VPC SNAT地址池子网。</li> // <li>subnet-name - String - (过滤条件)子网名称。</li> // <li>zone - String - (过滤条件)可用区。</li> // <li>tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。</li> // <li>tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeSubnetsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSubnetsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeSubnetsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 子网对象。 SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeSubnetsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeSubnetsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeTaskResultRequest struct { *tchttp.BaseRequest // 异步任务ID。TaskId和DealName必填一个参数 TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` // 计费订单号。TaskId和DealName必填一个参数 DealName *string `json:"DealName,omitempty" name:"DealName"` } func (r *DescribeTaskResultRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeTaskResultRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeTaskResultResponse struct { *tchttp.BaseResponse Response *struct { // 任务ID TaskId *uint64 `json:"TaskId,omitempty" name:"TaskId"` // 执行结果,包括"SUCCESS", "FAILED", "RUNNING" Result *string `json:"Result,omitempty" name:"Result"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeTaskResultResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeTaskResultResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeTemplateLimitsRequest struct { *tchttp.BaseRequest } func (r *DescribeTemplateLimitsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeTemplateLimitsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeTemplateLimitsResponse struct { *tchttp.BaseResponse Response *struct { // 参数模板配额对象。 TemplateLimit *TemplateLimit `json:"TemplateLimit,omitempty" name:"TemplateLimit"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeTemplateLimitsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeTemplateLimitsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcInstancesRequest struct { *tchttp.BaseRequest // 过滤条件,参数不支持同时指定RouteTableIds和Filters。 // <li>vpc-id - String - (过滤条件)VPC实例ID,形如:vpc-f49l6u0z。</li> // <li>instance-id - String - (过滤条件)云主机实例ID。</li> // <li>instance-name - String - (过滤条件)云主机名称。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 请求对象个数。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeVpcInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 云主机实例列表。 InstanceSet []*CvmInstance `json:"InstanceSet,omitempty" name:"InstanceSet" list` // 满足条件的云主机实例个数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpcInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcIpv6AddressesRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `IP`地址列表,批量查询单次请求最多支持`10`个。 Ipv6Addresses []*string `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses" list` // 偏移量。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeVpcIpv6AddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcIpv6AddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcIpv6AddressesResponse struct { *tchttp.BaseResponse Response *struct { // `IPv6`地址列表。 Ipv6AddressSet []*VpcIpv6Address `json:"Ipv6AddressSet,omitempty" name:"Ipv6AddressSet" list` // `IPv6`地址总数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpcIpv6AddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcIpv6AddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcLimitsRequest struct { *tchttp.BaseRequest // 配额名称。每次最大查询100个配额类型。 LimitTypes []*string `json:"LimitTypes,omitempty" name:"LimitTypes" list` } func (r *DescribeVpcLimitsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcLimitsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcLimitsResponse struct { *tchttp.BaseResponse Response *struct { // 私有网络配额 VpcLimitSet []*VpcLimit `json:"VpcLimitSet,omitempty" name:"VpcLimitSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpcLimitsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcLimitsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcPrivateIpAddressesRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 内网`IP`地址列表,批量查询单次请求最多支持`10`个。 PrivateIpAddresses []*string `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` } func (r *DescribeVpcPrivateIpAddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcPrivateIpAddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcPrivateIpAddressesResponse struct { *tchttp.BaseResponse Response *struct { // 内网`IP`地址信息列表。 VpcPrivateIpAddressSet []*VpcPrivateIpAddress `json:"VpcPrivateIpAddressSet,omitempty" name:"VpcPrivateIpAddressSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpcPrivateIpAddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcPrivateIpAddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcResourceDashboardRequest struct { *tchttp.BaseRequest // Vpc实例ID,例如:vpc-f1xjkw1b。 VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds" list` } func (r *DescribeVpcResourceDashboardRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcResourceDashboardRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcResourceDashboardResponse struct { *tchttp.BaseResponse Response *struct { // 资源对象列表。 ResourceDashboardSet []*ResourceDashboard `json:"ResourceDashboardSet,omitempty" name:"ResourceDashboardSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpcResourceDashboardResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcResourceDashboardResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcsRequest struct { *tchttp.BaseRequest // VPC实例ID。形如:vpc-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpcIds和Filters。 VpcIds []*string `json:"VpcIds,omitempty" name:"VpcIds" list` // 过滤条件,参数不支持同时指定VpcIds和Filters。 // <li>vpc-name - String - (过滤条件)VPC实例名称。</li> // <li>is-default - String - (过滤条件)是否默认VPC。</li> // <li>vpc-id - String - (过滤条件)VPC实例ID形如:vpc-f49l6u0z。</li> // <li>cidr-block - String - (过滤条件)vpc的cidr。</li> // <li>tag-key - String -是否必填:否- (过滤条件)按照标签键进行过滤。</li> // <li>tag:tag-key - String - 是否必填:否 - (过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例2。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。 Offset *string `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *string `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeVpcsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpcsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // VPC对象。 VpcSet []*Vpc `json:"VpcSet,omitempty" name:"VpcSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpcsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpcsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpnConnectionsRequest struct { *tchttp.BaseRequest // VPN通道实例ID。形如:vpnx-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpnConnectionIds和Filters。 VpnConnectionIds []*string `json:"VpnConnectionIds,omitempty" name:"VpnConnectionIds" list` // 过滤条件。每次请求的Filters的上限为10,Filter.Values的上限为5。参数不支持同时指定VpnConnectionIds和Filters。 // <li>vpc-id - String - VPC实例ID,形如:`vpc-0a36uwkr`。</li> // <li>vpn-gateway-id - String - VPN网关实例ID,形如:`vpngw-p4lmqawn`。</li> // <li>customer-gateway-id - String - 对端网关实例ID,形如:`cgw-l4rblw63`。</li> // <li>vpn-connection-name - String - 通道名称,形如:`test-vpn`。</li> // <li>vpn-connection-id - String - 通道实例ID,形如:`vpnx-5p7vkch8"`。</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 偏移量,默认为0。关于Offset的更进一步介绍请参考 API 简介中的相关小节。 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量,默认为20,最大值为100。 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeVpnConnectionsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpnConnectionsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpnConnectionsResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // VPN通道实例。 VpnConnectionSet []*VpnConnection `json:"VpnConnectionSet,omitempty" name:"VpnConnectionSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpnConnectionsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpnConnectionsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpnGatewayCcnRoutesRequest struct { *tchttp.BaseRequest // VPN网关实例ID VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeVpnGatewayCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpnGatewayCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpnGatewayCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 云联网路由(IDC网段)列表。 RouteSet []*VpngwCcnRoutes `json:"RouteSet,omitempty" name:"RouteSet" list` // 符合条件的对象数。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpnGatewayCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpnGatewayCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpnGatewaysRequest struct { *tchttp.BaseRequest // VPN网关实例ID。形如:vpngw-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpnGatewayIds和Filters。 VpnGatewayIds []*string `json:"VpnGatewayIds,omitempty" name:"VpnGatewayIds" list` // 过滤条件,参数不支持同时指定VpnGatewayIds和Filters。 // <li>vpc-id - String - (过滤条件)VPC实例ID形如:vpc-f49l6u0z。</li> // <li>vpn-gateway-id - String - (过滤条件)VPN实例ID形如:vpngw-5aluhh9t。</li> // <li>vpn-gateway-name - String - (过滤条件)VPN实例名称。</li> // <li>type - String - (过滤条件)VPN网关类型:'IPSEC', 'SSL'。</li> // <li>public-ip-address- String - (过滤条件)公网IP。</li> // <li>renew-flag - String - (过滤条件)网关续费类型,手动续费:'NOTIFY_AND_MANUAL_RENEW'、自动续费:'NOTIFY_AND_AUTO_RENEW'。</li> // <li>zone - String - (过滤条件)VPN所在可用区,形如:ap-guangzhou-2。</li> Filters []*FilterObject `json:"Filters,omitempty" name:"Filters" list` // 偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 请求对象个数 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` } func (r *DescribeVpnGatewaysRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpnGatewaysRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DescribeVpnGatewaysResponse struct { *tchttp.BaseResponse Response *struct { // 符合条件的实例数量。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // VPN网关实例详细信息列表。 VpnGatewaySet []*VpnGateway `json:"VpnGatewaySet,omitempty" name:"VpnGatewaySet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DescribeVpnGatewaysResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DescribeVpnGatewaysResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DestinationIpPortTranslationNatRule struct { // 网络协议,可选值:`TCP`、`UDP`。 IpProtocol *string `json:"IpProtocol,omitempty" name:"IpProtocol"` // 弹性IP。 PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` // 公网端口。 PublicPort *uint64 `json:"PublicPort,omitempty" name:"PublicPort"` // 内网地址。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` // 内网端口。 PrivatePort *uint64 `json:"PrivatePort,omitempty" name:"PrivatePort"` // NAT网关转发规则描述。 Description *string `json:"Description,omitempty" name:"Description"` } type DetachCcnInstancesRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 要解关联网络实例列表 Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances" list` } func (r *DetachCcnInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DetachCcnInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DetachCcnInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DetachCcnInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DetachCcnInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DetachClassicLinkVpcRequest struct { *tchttp.BaseRequest // VPC实例ID。可通过DescribeVpcs接口返回值中的VpcId获取。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // CVM实例ID查询。形如:ins-r8hr2upy。 InstanceIds []*string `json:"InstanceIds,omitempty" name:"InstanceIds" list` } func (r *DetachClassicLinkVpcRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DetachClassicLinkVpcRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DetachClassicLinkVpcResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DetachClassicLinkVpcResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DetachClassicLinkVpcResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DetachNetworkInterfaceRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-m6dyj72l。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // CVM实例ID。形如:ins-r8hr2upy。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` } func (r *DetachNetworkInterfaceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DetachNetworkInterfaceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DetachNetworkInterfaceResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DetachNetworkInterfaceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DetachNetworkInterfaceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DhcpIp struct { // `DhcpIp`的`ID`,是`DhcpIp`的唯一标识。 DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` // `DhcpIp`所在私有网络`ID`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `DhcpIp`所在子网`ID`。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // `DhcpIp`的名称。 DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` // IP地址。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` // 绑定`EIP`。 AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` // `DhcpIp`关联弹性网卡`ID`。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 被绑定的实例`ID`。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 状态: // <li>`AVAILABLE`:运行中</li> // <li>`UNBIND`:未绑定</li> State *string `json:"State,omitempty" name:"State"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type DirectConnectGateway struct { // 专线网关`ID`。 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` // 专线网关名称。 DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` // 专线网关关联`VPC`实例`ID`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 关联网络类型: // <li>`VPC` - 私有网络</li> // <li>`CCN` - 云联网</li> NetworkType *string `json:"NetworkType,omitempty" name:"NetworkType"` // 关联网络实例`ID`: // <li>`NetworkType`为`VPC`时,这里为私有网络实例`ID`</li> // <li>`NetworkType`为`CCN`时,这里为云联网实例`ID`</li> NetworkInstanceId *string `json:"NetworkInstanceId,omitempty" name:"NetworkInstanceId"` // 网关类型: // <li>NORMAL - 标准型,注:云联网只支持标准型</li> // <li>NAT - NAT型</li> // NAT类型支持网络地址转换配置,类型确定后不能修改;一个私有网络可以创建一个NAT类型的专线网关和一个非NAT类型的专线网关 GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` // 创建时间。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` // 专线网关IP。 DirectConnectGatewayIp *string `json:"DirectConnectGatewayIp,omitempty" name:"DirectConnectGatewayIp"` // 专线网关关联`CCN`实例`ID`。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 云联网路由学习类型: // <li>`BGP` - 自动学习。</li> // <li>`STATIC` - 静态,即用户配置。</li> CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` // 是否启用BGP。 EnableBGP *bool `json:"EnableBGP,omitempty" name:"EnableBGP"` // 开启和关闭BGP的community属性。 EnableBGPCommunity *bool `json:"EnableBGPCommunity,omitempty" name:"EnableBGPCommunity"` } type DirectConnectGatewayCcnRoute struct { // 路由ID。 RouteId *string `json:"RouteId,omitempty" name:"RouteId"` // IDC网段。 DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` // `BGP`的`AS-Path`属性。 ASPath []*string `json:"ASPath,omitempty" name:"ASPath" list` } type DisableCcnRoutesRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // CCN路由策略唯一ID。形如:ccnr-f49l6u0z。 RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds" list` } func (r *DisableCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisableCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisableCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisableCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisableCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisableGatewayFlowMonitorRequest struct { *tchttp.BaseRequest // 网关实例ID,目前我们支持的网关实例类型有, // 专线网关实例ID,形如,`dcg-ltjahce6`; // Nat网关实例ID,形如,`nat-ltjahce6`; // VPN网关实例ID,形如,`vpn-ltjahce6`。 GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` } func (r *DisableGatewayFlowMonitorRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisableGatewayFlowMonitorRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisableGatewayFlowMonitorResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisableGatewayFlowMonitorResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisableGatewayFlowMonitorResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisableRoutesRequest struct { *tchttp.BaseRequest // 路由表唯一ID。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由策略ID。不能和RouteItemIds同时使用。 RouteIds []*uint64 `json:"RouteIds,omitempty" name:"RouteIds" list` // 路由策略唯一ID。不能和RouteIds同时使用。 RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds" list` } func (r *DisableRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisableRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisableRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisableRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisableRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateAddressRequest struct { *tchttp.BaseRequest // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // 表示解绑 EIP 之后是否分配普通公网 IP。取值范围:<br><li>TRUE:表示解绑 EIP 之后分配普通公网 IP。<br><li>FALSE:表示解绑 EIP 之后不分配普通公网 IP。<br>默认取值:FALSE。<br><br>只有满足以下条件时才能指定该参数:<br><li> 只有在解绑主网卡的主内网 IP 上的 EIP 时才能指定该参数。<br><li>解绑 EIP 后重新分配普通公网 IP 操作一个账号每天最多操作 10 次;详情可通过 [DescribeAddressQuota](https://cloud.tencent.com/document/api/213/1378) 接口获取。 ReallocateNormalPublicIp *bool `json:"ReallocateNormalPublicIp,omitempty" name:"ReallocateNormalPublicIp"` } func (r *DisassociateAddressRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateAddressRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateAddressResponse struct { *tchttp.BaseResponse Response *struct { // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 TaskId *string `json:"TaskId,omitempty" name:"TaskId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisassociateAddressResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateAddressResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateDhcpIpWithAddressIpRequest struct { *tchttp.BaseRequest // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。必须是已绑定`EIP`的`DhcpIp`。 DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` } func (r *DisassociateDhcpIpWithAddressIpRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateDhcpIpWithAddressIpRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateDhcpIpWithAddressIpResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisassociateDhcpIpWithAddressIpResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateDhcpIpWithAddressIpResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateNatGatewayAddressRequest struct { *tchttp.BaseRequest // NAT网关的ID,形如:`nat-df45454`。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // 绑定NAT网关的弹性IP数组。 PublicIpAddresses []*string `json:"PublicIpAddresses,omitempty" name:"PublicIpAddresses" list` } func (r *DisassociateNatGatewayAddressRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateNatGatewayAddressRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateNatGatewayAddressResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisassociateNatGatewayAddressResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateNatGatewayAddressResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateNetworkAclSubnetsRequest struct { *tchttp.BaseRequest // 网络ACL实例ID。例如:acl-12345678。 NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` // 子网实例ID数组。例如:[subnet-12345678] SubnetIds []*string `json:"SubnetIds,omitempty" name:"SubnetIds" list` } func (r *DisassociateNetworkAclSubnetsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateNetworkAclSubnetsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateNetworkAclSubnetsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisassociateNetworkAclSubnetsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateNetworkAclSubnetsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateNetworkInterfaceSecurityGroupsRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID。形如:eni-pxir56ns。每次请求的实例的上限为100。 NetworkInterfaceIds []*string `json:"NetworkInterfaceIds,omitempty" name:"NetworkInterfaceIds" list` // 安全组实例ID,例如:sg-33ocnj9n,可通过DescribeSecurityGroups获取。每次请求的实例的上限为100。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` } func (r *DisassociateNetworkInterfaceSecurityGroupsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateNetworkInterfaceSecurityGroupsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DisassociateNetworkInterfaceSecurityGroupsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DisassociateNetworkInterfaceSecurityGroupsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DisassociateNetworkInterfaceSecurityGroupsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DownloadCustomerGatewayConfigurationRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // VPN通道实例ID。形如:vpnx-f49l6u0z。 VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` // 对端网关厂商信息对象,可通过DescribeCustomerGatewayVendors获取。 CustomerGatewayVendor *CustomerGatewayVendor `json:"CustomerGatewayVendor,omitempty" name:"CustomerGatewayVendor"` // 通道接入设备物理接口名称。 InterfaceName *string `json:"InterfaceName,omitempty" name:"InterfaceName"` } func (r *DownloadCustomerGatewayConfigurationRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DownloadCustomerGatewayConfigurationRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type DownloadCustomerGatewayConfigurationResponse struct { *tchttp.BaseResponse Response *struct { // XML格式配置信息。 CustomerGatewayConfiguration *string `json:"CustomerGatewayConfiguration,omitempty" name:"CustomerGatewayConfiguration"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *DownloadCustomerGatewayConfigurationResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *DownloadCustomerGatewayConfigurationResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type EnableCcnRoutesRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // CCN路由策略唯一ID。形如:ccnr-f49l6u0z。 RouteIds []*string `json:"RouteIds,omitempty" name:"RouteIds" list` } func (r *EnableCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *EnableCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type EnableCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *EnableCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *EnableCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type EnableGatewayFlowMonitorRequest struct { *tchttp.BaseRequest // 网关实例ID,目前我们支持的网关实例有, // 专线网关实例ID,形如,`dcg-ltjahce6`; // Nat网关实例ID,形如,`nat-ltjahce6`; // VPN网关实例ID,形如,`vpn-ltjahce6`。 GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` } func (r *EnableGatewayFlowMonitorRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *EnableGatewayFlowMonitorRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type EnableGatewayFlowMonitorResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *EnableGatewayFlowMonitorResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *EnableGatewayFlowMonitorResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type EnableRoutesRequest struct { *tchttp.BaseRequest // 路由表唯一ID。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由策略ID。不能和RouteItemIds同时使用。 RouteIds []*uint64 `json:"RouteIds,omitempty" name:"RouteIds" list` // 路由策略唯一ID。不能和RouteIds同时使用。 RouteItemIds []*string `json:"RouteItemIds,omitempty" name:"RouteItemIds" list` } func (r *EnableRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *EnableRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type EnableRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *EnableRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *EnableRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type Filter struct { // 属性名称, 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 Name *string `json:"Name,omitempty" name:"Name"` // 属性值, 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。 Values []*string `json:"Values,omitempty" name:"Values" list` } type FilterObject struct { // 属性名称, 若存在多个Filter时,Filter间的关系为逻辑与(AND)关系。 Name *string `json:"Name,omitempty" name:"Name"` // 属性值, 若同一个Filter存在多个Values,同一Filter下Values间的关系为逻辑或(OR)关系。 Values []*string `json:"Values,omitempty" name:"Values" list` } type FlowLog struct { // 私用网络ID或者统一ID,建议使用统一ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 流日志唯一ID FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` // 流日志实例名字 FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` // 流日志所属资源类型,VPC|SUBNET|NETWORKINTERFACE ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` // 资源唯一ID ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` // 流日志采集类型,ACCEPT|REJECT|ALL TrafficType *string `json:"TrafficType,omitempty" name:"TrafficType"` // 流日志存储ID CloudLogId *string `json:"CloudLogId,omitempty" name:"CloudLogId"` // 流日志存储ID状态 CloudLogState *string `json:"CloudLogState,omitempty" name:"CloudLogState"` // 流日志描述信息 FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` // 流日志创建时间 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type GatewayFlowMonitorDetail struct { // 来源`IP`。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` // 入包量。 InPkg *uint64 `json:"InPkg,omitempty" name:"InPkg"` // 出包量。 OutPkg *uint64 `json:"OutPkg,omitempty" name:"OutPkg"` // 入带宽,单位:`Byte`。 InTraffic *uint64 `json:"InTraffic,omitempty" name:"InTraffic"` // 出带宽,单位:`Byte`。 OutTraffic *uint64 `json:"OutTraffic,omitempty" name:"OutTraffic"` } type GatewayQos struct { // VPC实例ID。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 云服务器内网IP。 IpAddress *string `json:"IpAddress,omitempty" name:"IpAddress"` // 流控带宽值。 Bandwidth *int64 `json:"Bandwidth,omitempty" name:"Bandwidth"` // 创建时间。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` } type GetCcnRegionBandwidthLimitsRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 过滤条件。 // <li>sregion - String - (过滤条件)源地域,形如:ap-guangzhou。</li> // <li>dregion - String - (过滤条件)目的地域,形如:ap-shanghai-bm</li> Filters []*Filter `json:"Filters,omitempty" name:"Filters" list` // 排序条件,目前支持带宽(BandwidthLimit)和过期时间(ExpireTime) SortedBy *string `json:"SortedBy,omitempty" name:"SortedBy"` // 偏移量 Offset *uint64 `json:"Offset,omitempty" name:"Offset"` // 返回数量 Limit *uint64 `json:"Limit,omitempty" name:"Limit"` // 排序方式,'ASC':升序,'DESC':降序。 OrderBy *string `json:"OrderBy,omitempty" name:"OrderBy"` } func (r *GetCcnRegionBandwidthLimitsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *GetCcnRegionBandwidthLimitsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type GetCcnRegionBandwidthLimitsResponse struct { *tchttp.BaseResponse Response *struct { // 云联网(CCN)各地域出带宽带宽详情。 // 注意:此字段可能返回 null,表示取不到有效值。 CcnBandwidthSet []*CcnBandwidthInfo `json:"CcnBandwidthSet,omitempty" name:"CcnBandwidthSet" list` // 符合条件的对象数。 // 注意:此字段可能返回 null,表示取不到有效值。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *GetCcnRegionBandwidthLimitsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *GetCcnRegionBandwidthLimitsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type HaVip struct { // `HAVIP`的`ID`,是`HAVIP`的唯一标识。 HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` // `HAVIP`名称。 HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` // 虚拟IP地址。 Vip *string `json:"Vip,omitempty" name:"Vip"` // `HAVIP`所在私有网络`ID`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `HAVIP`所在子网`ID`。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // `HAVIP`关联弹性网卡`ID`。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 被绑定的实例`ID`。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 绑定`EIP`。 AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` // 状态: // <li>`AVAILABLE`:运行中</li> // <li>`UNBIND`:未绑定</li> State *string `json:"State,omitempty" name:"State"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 使用havip的业务标识。 Business *string `json:"Business,omitempty" name:"Business"` } type HaVipAssociateAddressIpRequest struct { *tchttp.BaseRequest // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。必须是没有绑定`EIP`的`HAVIP` HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` // 弹性公网`IP`。必须是没有绑定`HAVIP`的`EIP` AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` } func (r *HaVipAssociateAddressIpRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *HaVipAssociateAddressIpRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type HaVipAssociateAddressIpResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *HaVipAssociateAddressIpResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *HaVipAssociateAddressIpResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type HaVipDisassociateAddressIpRequest struct { *tchttp.BaseRequest // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。必须是已绑定`EIP`的`HAVIP`。 HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` } func (r *HaVipDisassociateAddressIpRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *HaVipDisassociateAddressIpRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type HaVipDisassociateAddressIpResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *HaVipDisassociateAddressIpResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *HaVipDisassociateAddressIpResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type IKEOptionsSpecification struct { // 加密算法,可选值:'3DES-CBC', 'AES-CBC-128', 'AES-CBS-192', 'AES-CBC-256', 'DES-CBC',默认为3DES-CBC PropoEncryAlgorithm *string `json:"PropoEncryAlgorithm,omitempty" name:"PropoEncryAlgorithm"` // 认证算法:可选值:'MD5', 'SHA1',默认为MD5 PropoAuthenAlgorithm *string `json:"PropoAuthenAlgorithm,omitempty" name:"PropoAuthenAlgorithm"` // 协商模式:可选值:'AGGRESSIVE', 'MAIN',默认为MAIN ExchangeMode *string `json:"ExchangeMode,omitempty" name:"ExchangeMode"` // 本端标识类型:可选值:'ADDRESS', 'FQDN',默认为ADDRESS LocalIdentity *string `json:"LocalIdentity,omitempty" name:"LocalIdentity"` // 对端标识类型:可选值:'ADDRESS', 'FQDN',默认为ADDRESS RemoteIdentity *string `json:"RemoteIdentity,omitempty" name:"RemoteIdentity"` // 本端标识,当LocalIdentity选为ADDRESS时,LocalAddress必填。localAddress默认为vpn网关公网IP LocalAddress *string `json:"LocalAddress,omitempty" name:"LocalAddress"` // 对端标识,当RemoteIdentity选为ADDRESS时,RemoteAddress必填 RemoteAddress *string `json:"RemoteAddress,omitempty" name:"RemoteAddress"` // 本端标识,当LocalIdentity选为FQDN时,LocalFqdnName必填 LocalFqdnName *string `json:"LocalFqdnName,omitempty" name:"LocalFqdnName"` // 对端标识,当remoteIdentity选为FQDN时,RemoteFqdnName必填 RemoteFqdnName *string `json:"RemoteFqdnName,omitempty" name:"RemoteFqdnName"` // DH group,指定IKE交换密钥时使用的DH组,可选值:'GROUP1', 'GROUP2', 'GROUP5', 'GROUP14', 'GROUP24', DhGroupName *string `json:"DhGroupName,omitempty" name:"DhGroupName"` // IKE SA Lifetime,单位:秒,设置IKE SA的生存周期,取值范围:60-604800 IKESaLifetimeSeconds *uint64 `json:"IKESaLifetimeSeconds,omitempty" name:"IKESaLifetimeSeconds"` // IKE版本 IKEVersion *string `json:"IKEVersion,omitempty" name:"IKEVersion"` } type IPSECOptionsSpecification struct { // 加密算法,可选值:'3DES-CBC', 'AES-CBC-128', 'AES-CBC-192', 'AES-CBC-256', 'DES-CBC', 'NULL', 默认为AES-CBC-128 EncryptAlgorithm *string `json:"EncryptAlgorithm,omitempty" name:"EncryptAlgorithm"` // 认证算法:可选值:'MD5', 'SHA1',默认为 IntegrityAlgorith *string `json:"IntegrityAlgorith,omitempty" name:"IntegrityAlgorith"` // IPsec SA lifetime(s):单位秒,取值范围:180-604800 IPSECSaLifetimeSeconds *uint64 `json:"IPSECSaLifetimeSeconds,omitempty" name:"IPSECSaLifetimeSeconds"` // PFS:可选值:'NULL', 'DH-GROUP1', 'DH-GROUP2', 'DH-GROUP5', 'DH-GROUP14', 'DH-GROUP24',默认为NULL PfsDhGroup *string `json:"PfsDhGroup,omitempty" name:"PfsDhGroup"` // IPsec SA lifetime(KB):单位KB,取值范围:2560-604800 IPSECSaLifetimeTraffic *uint64 `json:"IPSECSaLifetimeTraffic,omitempty" name:"IPSECSaLifetimeTraffic"` } type InquiryPriceCreateVpnGatewayRequest struct { *tchttp.BaseRequest // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps。 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // VPN网关计费模式,PREPAID:表示预付费,即包年包月,POSTPAID_BY_HOUR:表示后付费,即按量计费。默认:POSTPAID_BY_HOUR,如果指定预付费模式,参数InstanceChargePrepaid必填。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` } func (r *InquiryPriceCreateVpnGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceCreateVpnGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceCreateVpnGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 商品价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceCreateVpnGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceCreateVpnGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceRenewVpnGatewayRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 预付费模式,即包年包月相关参数设置。通过该参数可以指定包年包月实例的购买时长、是否设置自动续费等属性。若指定实例的付费模式为预付费则该参数必传。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` } func (r *InquiryPriceRenewVpnGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceRenewVpnGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceRenewVpnGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 商品价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceRenewVpnGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceRenewVpnGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps。 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` } func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 商品价格。 Price *Price `json:"Price,omitempty" name:"Price"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *InquiryPriceResetVpnGatewayInternetMaxBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type InstanceChargePrepaid struct { // 购买实例的时长,单位:月。取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36。 Period *uint64 `json:"Period,omitempty" name:"Period"` // 自动续费标识。取值范围: NOTIFY_AND_AUTO_RENEW:通知过期且自动续费, NOTIFY_AND_MANUAL_RENEW:通知过期不自动续费。默认:NOTIFY_AND_MANUAL_RENEW RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` } type InstanceStatistic struct { // 实例的类型 InstanceType *string `json:"InstanceType,omitempty" name:"InstanceType"` // 实例的个数 InstanceCount *uint64 `json:"InstanceCount,omitempty" name:"InstanceCount"` } type Ip6Rule struct { // IPV6转换规则唯一ID,形如rule6-xxxxxxxx Ip6RuleId *string `json:"Ip6RuleId,omitempty" name:"Ip6RuleId"` // IPV6转换规则名称 Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` // IPV6地址 Vip6 *string `json:"Vip6,omitempty" name:"Vip6"` // IPV6端口号 Vport6 *int64 `json:"Vport6,omitempty" name:"Vport6"` // 协议类型,支持TCP/UDP Protocol *string `json:"Protocol,omitempty" name:"Protocol"` // IPV4地址 Vip *string `json:"Vip,omitempty" name:"Vip"` // IPV4端口号 Vport *int64 `json:"Vport,omitempty" name:"Vport"` // 转换规则状态,限于CREATING,RUNNING,DELETING,MODIFYING RuleStatus *string `json:"RuleStatus,omitempty" name:"RuleStatus"` // 转换规则创建时间 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type Ip6RuleInfo struct { // IPV6端口号,可在0~65535范围取值 Vport6 *int64 `json:"Vport6,omitempty" name:"Vport6"` // 协议类型,支持TCP/UDP Protocol *string `json:"Protocol,omitempty" name:"Protocol"` // IPV4地址 Vip *string `json:"Vip,omitempty" name:"Vip"` // IPV4端口号,可在0~65535范围取值 Vport *int64 `json:"Vport,omitempty" name:"Vport"` } type Ip6Translator struct { // IPV6转换实例唯一ID,形如ip6-xxxxxxxx Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` // IPV6转换实例名称 Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` // IPV6地址 Vip6 *string `json:"Vip6,omitempty" name:"Vip6"` // IPV6转换地址所属运营商 IspName *string `json:"IspName,omitempty" name:"IspName"` // 转换实例状态,限于CREATING,RUNNING,DELETING,MODIFYING TranslatorStatus *string `json:"TranslatorStatus,omitempty" name:"TranslatorStatus"` // IPV6转换实例创建时间 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 绑定的IPV6转换规则数量 Ip6RuleCount *int64 `json:"Ip6RuleCount,omitempty" name:"Ip6RuleCount"` // IPV6转换规则信息 IP6RuleSet []*Ip6Rule `json:"IP6RuleSet,omitempty" name:"IP6RuleSet" list` } type Ipv6Address struct { // `IPv6`地址,形如:`3402:4e00:20:100:0:8cd9:2a67:71f3` Address *string `json:"Address,omitempty" name:"Address"` // 是否是主`IP`。 Primary *bool `json:"Primary,omitempty" name:"Primary"` // `EIP`实例`ID`,形如:`eip-hxlqja90`。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // 描述信息。 Description *string `json:"Description,omitempty" name:"Description"` // 公网IP是否被封堵。 IsWanIpBlocked *bool `json:"IsWanIpBlocked,omitempty" name:"IsWanIpBlocked"` // `IPv6`地址状态: // <li>`PENDING`:生产中</li> // <li>`MIGRATING`:迁移中</li> // <li>`DELETING`:删除中</li> // <li>`AVAILABLE`:可用的</li> State *string `json:"State,omitempty" name:"State"` } type Ipv6SubnetCidrBlock struct { // 子网实例`ID`。形如:`subnet-pxir56ns`。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // `IPv6`子网段。形如:`3402:4e00:20:1001::/64` Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` } type ItemPrice struct { // 按量计费后付费单价,单位:元。 UnitPrice *float64 `json:"UnitPrice,omitempty" name:"UnitPrice"` // 按量计费后付费计价单元,可取值范围: HOUR:表示计价单元是按每小时来计算。当前涉及该计价单元的场景有:实例按小时后付费(POSTPAID_BY_HOUR)、带宽按小时后付费(BANDWIDTH_POSTPAID_BY_HOUR): GB:表示计价单元是按每GB来计算。当前涉及该计价单元的场景有:流量按小时后付费(TRAFFIC_POSTPAID_BY_HOUR)。 ChargeUnit *string `json:"ChargeUnit,omitempty" name:"ChargeUnit"` // 预付费商品的原价,单位:元。 OriginalPrice *float64 `json:"OriginalPrice,omitempty" name:"OriginalPrice"` // 预付费商品的折扣价,单位:元。 DiscountPrice *float64 `json:"DiscountPrice,omitempty" name:"DiscountPrice"` } type MigrateNetworkInterfaceRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-m6dyj72l。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 弹性网卡当前绑定的CVM实例ID。形如:ins-r8hr2upy。 SourceInstanceId *string `json:"SourceInstanceId,omitempty" name:"SourceInstanceId"` // 待迁移的目的CVM实例ID。 DestinationInstanceId *string `json:"DestinationInstanceId,omitempty" name:"DestinationInstanceId"` } func (r *MigrateNetworkInterfaceRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *MigrateNetworkInterfaceRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type MigrateNetworkInterfaceResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *MigrateNetworkInterfaceResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *MigrateNetworkInterfaceResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type MigratePrivateIpAddressRequest struct { *tchttp.BaseRequest // 当内网IP绑定的弹性网卡实例ID,例如:eni-m6dyj72l。 SourceNetworkInterfaceId *string `json:"SourceNetworkInterfaceId,omitempty" name:"SourceNetworkInterfaceId"` // 待迁移的目的弹性网卡实例ID。 DestinationNetworkInterfaceId *string `json:"DestinationNetworkInterfaceId,omitempty" name:"DestinationNetworkInterfaceId"` // 迁移的内网IP地址,例如:10.0.0.6。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` } func (r *MigratePrivateIpAddressRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *MigratePrivateIpAddressRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type MigratePrivateIpAddressResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *MigratePrivateIpAddressResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *MigratePrivateIpAddressResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressAttributeRequest struct { *tchttp.BaseRequest // 标识 EIP 的唯一 ID。EIP 唯一 ID 形如:`eip-11112222`。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // 修改后的 EIP 名称。长度上限为20个字符。 AddressName *string `json:"AddressName,omitempty" name:"AddressName"` // 设定EIP是否直通,"TRUE"表示直通,"FALSE"表示非直通。注意该参数仅对EIP直通功能可见的用户可以设定。 EipDirectConnection *string `json:"EipDirectConnection,omitempty" name:"EipDirectConnection"` } func (r *ModifyAddressAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyAddressAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressInternetChargeTypeRequest struct { *tchttp.BaseRequest // 弹性公网IP的唯一ID,形如eip-xxx AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // 弹性公网IP调整目标计费模式,只支持"BANDWIDTH_PREPAID_BY_MONTH"和"TRAFFIC_POSTPAID_BY_HOUR" InternetChargeType *string `json:"InternetChargeType,omitempty" name:"InternetChargeType"` // 弹性公网IP调整目标带宽值 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // 包月带宽网络计费模式参数。弹性公网IP的调整目标计费模式是"BANDWIDTH_PREPAID_BY_MONTH"时,必传该参数。 AddressChargePrepaid *AddressChargePrepaid `json:"AddressChargePrepaid,omitempty" name:"AddressChargePrepaid"` } func (r *ModifyAddressInternetChargeTypeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressInternetChargeTypeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressInternetChargeTypeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyAddressInternetChargeTypeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressInternetChargeTypeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressTemplateAttributeRequest struct { *tchttp.BaseRequest // IP地址模板实例ID,例如:ipm-mdunqeb6。 AddressTemplateId *string `json:"AddressTemplateId,omitempty" name:"AddressTemplateId"` // IP地址模板名称。 AddressTemplateName *string `json:"AddressTemplateName,omitempty" name:"AddressTemplateName"` // 地址信息,支持 IP、CIDR、IP 范围。 Addresses []*string `json:"Addresses,omitempty" name:"Addresses" list` } func (r *ModifyAddressTemplateAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressTemplateAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressTemplateAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyAddressTemplateAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressTemplateAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressTemplateGroupAttributeRequest struct { *tchttp.BaseRequest // IP地址模板集合实例ID,例如:ipmg-2uw6ujo6。 AddressTemplateGroupId *string `json:"AddressTemplateGroupId,omitempty" name:"AddressTemplateGroupId"` // IP地址模板集合名称。 AddressTemplateGroupName *string `json:"AddressTemplateGroupName,omitempty" name:"AddressTemplateGroupName"` // IP地址模板实例ID, 例如:ipm-mdunqeb6。 AddressTemplateIds []*string `json:"AddressTemplateIds,omitempty" name:"AddressTemplateIds" list` } func (r *ModifyAddressTemplateGroupAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressTemplateGroupAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressTemplateGroupAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyAddressTemplateGroupAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressTemplateGroupAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressesBandwidthRequest struct { *tchttp.BaseRequest // EIP唯一标识ID,形如'eip-xxxx' AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds" list` // 调整带宽目标值 InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // 包月带宽起始时间 StartTime *string `json:"StartTime,omitempty" name:"StartTime"` // 包月带宽结束时间 EndTime *string `json:"EndTime,omitempty" name:"EndTime"` } func (r *ModifyAddressesBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressesBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAddressesBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 TaskId *string `json:"TaskId,omitempty" name:"TaskId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyAddressesBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAddressesBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAssistantCidrRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`。形如:`vpc-6v2ht8q5` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 待添加的负载CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"] NewCidrBlocks []*string `json:"NewCidrBlocks,omitempty" name:"NewCidrBlocks" list` // 待删除的负载CIDR。CIDR数组,格式如["10.0.0.0/16", "172.16.0.0/16"] OldCidrBlocks []*string `json:"OldCidrBlocks,omitempty" name:"OldCidrBlocks" list` } func (r *ModifyAssistantCidrRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAssistantCidrRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyAssistantCidrResponse struct { *tchttp.BaseResponse Response *struct { // 辅助CIDR数组。 // 注意:此字段可能返回 null,表示取不到有效值。 AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet" list` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyAssistantCidrResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyAssistantCidrResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyBandwidthPackageAttributeRequest struct { *tchttp.BaseRequest // 带宽包唯一标识ID BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` // 带宽包名称 BandwidthPackageName *string `json:"BandwidthPackageName,omitempty" name:"BandwidthPackageName"` // 带宽包计费模式 ChargeType *string `json:"ChargeType,omitempty" name:"ChargeType"` } func (r *ModifyBandwidthPackageAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyBandwidthPackageAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyBandwidthPackageAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyBandwidthPackageAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyBandwidthPackageAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyCcnAttributeRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // CCN名称,最大长度不能超过60个字节。 CcnName *string `json:"CcnName,omitempty" name:"CcnName"` // CCN描述信息,最大长度不能超过100个字节。 CcnDescription *string `json:"CcnDescription,omitempty" name:"CcnDescription"` } func (r *ModifyCcnAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyCcnAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyCcnAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyCcnAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyCcnAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyCcnRegionBandwidthLimitsTypeRequest struct { *tchttp.BaseRequest // 云联网实例ID。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 云联网限速类型,INTER_REGION_LIMIT:地域间限速,OUTER_REGION_LIMIT:地域出口限速。 BandwidthLimitType *string `json:"BandwidthLimitType,omitempty" name:"BandwidthLimitType"` } func (r *ModifyCcnRegionBandwidthLimitsTypeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyCcnRegionBandwidthLimitsTypeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyCcnRegionBandwidthLimitsTypeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyCcnRegionBandwidthLimitsTypeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyCcnRegionBandwidthLimitsTypeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyCustomerGatewayAttributeRequest struct { *tchttp.BaseRequest // 对端网关ID,例如:cgw-2wqq41m9,可通过DescribeCustomerGateways接口查询对端网关。 CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` // 对端网关名称,可任意命名,但不得超过60个字符。 CustomerGatewayName *string `json:"CustomerGatewayName,omitempty" name:"CustomerGatewayName"` } func (r *ModifyCustomerGatewayAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyCustomerGatewayAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyCustomerGatewayAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyCustomerGatewayAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyCustomerGatewayAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyDhcpIpAttributeRequest struct { *tchttp.BaseRequest // `DhcpIp`唯一`ID`,形如:`dhcpip-9o233uri`。 DhcpIpId *string `json:"DhcpIpId,omitempty" name:"DhcpIpId"` // `DhcpIp`名称,可任意命名,但不得超过60个字符。 DhcpIpName *string `json:"DhcpIpName,omitempty" name:"DhcpIpName"` } func (r *ModifyDhcpIpAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyDhcpIpAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyDhcpIpAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyDhcpIpAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyDhcpIpAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyDirectConnectGatewayAttributeRequest struct { *tchttp.BaseRequest // 专线网关唯一`ID`,形如:`dcg-9o233uri`。 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` // 专线网关名称,可任意命名,但不得超过60个字符。 DirectConnectGatewayName *string `json:"DirectConnectGatewayName,omitempty" name:"DirectConnectGatewayName"` // 云联网路由学习类型,可选值:`BGP`(自动学习)、`STATIC`(静态,即用户配置)。只有云联网类型专线网关且开启了BGP功能才支持修改`CcnRouteType`。 CcnRouteType *string `json:"CcnRouteType,omitempty" name:"CcnRouteType"` } func (r *ModifyDirectConnectGatewayAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyDirectConnectGatewayAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyDirectConnectGatewayAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyDirectConnectGatewayAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyDirectConnectGatewayAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyFlowLogAttributeRequest struct { *tchttp.BaseRequest // 私用网络ID或者统一ID,建议使用统一ID VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 流日志唯一ID FlowLogId *string `json:"FlowLogId,omitempty" name:"FlowLogId"` // 流日志实例名字 FlowLogName *string `json:"FlowLogName,omitempty" name:"FlowLogName"` // 流日志实例描述 FlowLogDescription *string `json:"FlowLogDescription,omitempty" name:"FlowLogDescription"` } func (r *ModifyFlowLogAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyFlowLogAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyFlowLogAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyFlowLogAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyFlowLogAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyGatewayFlowQosRequest struct { *tchttp.BaseRequest // 网关实例ID,目前我们支持的网关实例类型有, // 专线网关实例ID,形如,`dcg-ltjahce6`; // Nat网关实例ID,形如,`nat-ltjahce6`; // VPN网关实例ID,形如,`vpn-ltjahce6`。 GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` // 流控带宽值。取值大于0,表示限流到指定的Mbps;取值等于0,表示完全限流;取值为-1,不限流。 Bandwidth *int64 `json:"Bandwidth,omitempty" name:"Bandwidth"` // 限流的云服务器内网IP。 IpAddresses []*string `json:"IpAddresses,omitempty" name:"IpAddresses" list` } func (r *ModifyGatewayFlowQosRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyGatewayFlowQosRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyGatewayFlowQosResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyGatewayFlowQosResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyGatewayFlowQosResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyHaVipAttributeRequest struct { *tchttp.BaseRequest // `HAVIP`唯一`ID`,形如:`havip-9o233uri`。 HaVipId *string `json:"HaVipId,omitempty" name:"HaVipId"` // `HAVIP`名称,可任意命名,但不得超过60个字符。 HaVipName *string `json:"HaVipName,omitempty" name:"HaVipName"` } func (r *ModifyHaVipAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyHaVipAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyHaVipAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyHaVipAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyHaVipAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIp6AddressesBandwidthRequest struct { *tchttp.BaseRequest // 修改的目标带宽,单位Mbps InternetMaxBandwidthOut *int64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // IPV6地址。Ip6Addresses和Ip6AddressId必须且只能传一个 Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses" list` // IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6Addresses和Ip6AddressId必须且只能传一个 Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds" list` } func (r *ModifyIp6AddressesBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIp6AddressesBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIp6AddressesBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyIp6AddressesBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIp6AddressesBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIp6RuleRequest struct { *tchttp.BaseRequest // IPV6转换实例唯一ID,形如ip6-xxxxxxxx Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` // IPV6转换规则唯一ID,形如rule6-xxxxxxxx Ip6RuleId *string `json:"Ip6RuleId,omitempty" name:"Ip6RuleId"` // IPV6转换规则修改后的名称 Ip6RuleName *string `json:"Ip6RuleName,omitempty" name:"Ip6RuleName"` // IPV6转换规则修改后的IPV4地址 Vip *string `json:"Vip,omitempty" name:"Vip"` // IPV6转换规则修改后的IPV4端口号 Vport *int64 `json:"Vport,omitempty" name:"Vport"` } func (r *ModifyIp6RuleRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIp6RuleRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIp6RuleResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyIp6RuleResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIp6RuleResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIp6TranslatorRequest struct { *tchttp.BaseRequest // IPV6转换实例唯一ID,形如ip6-xxxxxxxxx Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` // IPV6转换实例修改名称 Ip6TranslatorName *string `json:"Ip6TranslatorName,omitempty" name:"Ip6TranslatorName"` } func (r *ModifyIp6TranslatorRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIp6TranslatorRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIp6TranslatorResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyIp6TranslatorResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIp6TranslatorResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIpv6AddressesAttributeRequest struct { *tchttp.BaseRequest // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 指定的内网IPv6`地址信息。 Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses" list` } func (r *ModifyIpv6AddressesAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIpv6AddressesAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyIpv6AddressesAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyIpv6AddressesAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyIpv6AddressesAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNatGatewayAttributeRequest struct { *tchttp.BaseRequest // NAT网关的ID,形如:`nat-df45454`。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // NAT网关的名称,形如:`test_nat`。 NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` // NAT网关最大外网出带宽(单位:Mbps)。 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` } func (r *ModifyNatGatewayAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNatGatewayAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNatGatewayAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyNatGatewayAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNatGatewayAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest struct { *tchttp.BaseRequest // NAT网关的ID,形如:`nat-df45454`。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // 源NAT网关的端口转换规则。 SourceNatRule *DestinationIpPortTranslationNatRule `json:"SourceNatRule,omitempty" name:"SourceNatRule"` // 目的NAT网关的端口转换规则。 DestinationNatRule *DestinationIpPortTranslationNatRule `json:"DestinationNatRule,omitempty" name:"DestinationNatRule"` } func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNatGatewayDestinationIpPortTranslationNatRuleResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetDetectRequest struct { *tchttp.BaseRequest // 网络探测实例`ID`。形如:`netd-12345678` NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` // 网络探测名称,最大长度不能超过60个字节。 NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` // 探测目的IPv4地址数组,最多两个。 DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp" list` // 下一跳类型,目前我们支持的类型有: // VPN:VPN网关; // DIRECTCONNECT:专线网关; // PEERCONNECTION:对等连接; // NAT:NAT网关; // NORMAL_CVM:普通云服务器; NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` // 下一跳目的网关,取值与“下一跳类型”相关: // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` // 网络探测描述。 NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` } func (r *ModifyNetDetectRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetDetectRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetDetectResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyNetDetectResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetDetectResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetworkAclAttributeRequest struct { *tchttp.BaseRequest // 网络ACL实例ID。例如:acl-12345678。 NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` // 网络ACL名称,最大长度不能超过60个字节。 NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` } func (r *ModifyNetworkAclAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetworkAclAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetworkAclAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyNetworkAclAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetworkAclAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetworkAclEntriesRequest struct { *tchttp.BaseRequest // 网络ACL实例ID。例如:acl-12345678。 NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` // 网络ACL规则集。 NetworkAclEntrySet *NetworkAclEntrySet `json:"NetworkAclEntrySet,omitempty" name:"NetworkAclEntrySet"` } func (r *ModifyNetworkAclEntriesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetworkAclEntriesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetworkAclEntriesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyNetworkAclEntriesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetworkAclEntriesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetworkInterfaceAttributeRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-pxir56ns。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 弹性网卡名称,最大长度不能超过60个字节。 NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` // 弹性网卡描述,可任意命名,但不得超过60个字符。 NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` // 指定绑定的安全组,例如:['sg-1dd51d']。 SecurityGroupIds []*string `json:"SecurityGroupIds,omitempty" name:"SecurityGroupIds" list` } func (r *ModifyNetworkInterfaceAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetworkInterfaceAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyNetworkInterfaceAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyNetworkInterfaceAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyNetworkInterfaceAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyPrivateIpAddressesAttributeRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-m6dyj72l。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 指定的内网IP信息。 PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` } func (r *ModifyPrivateIpAddressesAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyPrivateIpAddressesAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyPrivateIpAddressesAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyPrivateIpAddressesAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyPrivateIpAddressesAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyRouteTableAttributeRequest struct { *tchttp.BaseRequest // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由表名称。 RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` } func (r *ModifyRouteTableAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyRouteTableAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyRouteTableAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyRouteTableAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyRouteTableAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifySecurityGroupAttributeRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 安全组名称,可任意命名,但不得超过60个字符。 GroupName *string `json:"GroupName,omitempty" name:"GroupName"` // 安全组备注,最多100个字符。 GroupDescription *string `json:"GroupDescription,omitempty" name:"GroupDescription"` } func (r *ModifySecurityGroupAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifySecurityGroupAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifySecurityGroupAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifySecurityGroupAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifySecurityGroupAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifySecurityGroupPoliciesRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 安全组规则集合。 SecurityGroupPolicySet对象必须同时指定新的出(Egress)入(Ingress)站规则。 SecurityGroupPolicy对象不支持自定义索引(PolicyIndex)。 SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` // 排序安全组标识。值为True时,支持安全组排序;SortPolicys不存在或SortPolicys为False时,为修改安全组规则。 SortPolicys *bool `json:"SortPolicys,omitempty" name:"SortPolicys"` } func (r *ModifySecurityGroupPoliciesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifySecurityGroupPoliciesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifySecurityGroupPoliciesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifySecurityGroupPoliciesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifySecurityGroupPoliciesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyServiceTemplateAttributeRequest struct { *tchttp.BaseRequest // 协议端口模板实例ID,例如:ppm-529nwwj8。 ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` // 协议端口模板名称。 ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` // 支持单个端口、多个端口、连续端口及所有端口,协议支持:TCP、UDP、ICMP、GRE 协议。 Services []*string `json:"Services,omitempty" name:"Services" list` } func (r *ModifyServiceTemplateAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyServiceTemplateAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyServiceTemplateAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyServiceTemplateAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyServiceTemplateAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyServiceTemplateGroupAttributeRequest struct { *tchttp.BaseRequest // 协议端口模板集合实例ID,例如:ppmg-ei8hfd9a。 ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` // 协议端口模板集合名称。 ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` // 协议端口模板实例ID,例如:ppm-4dw6agho。 ServiceTemplateIds []*string `json:"ServiceTemplateIds,omitempty" name:"ServiceTemplateIds" list` } func (r *ModifyServiceTemplateGroupAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyServiceTemplateGroupAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyServiceTemplateGroupAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyServiceTemplateGroupAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyServiceTemplateGroupAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifySubnetAttributeRequest struct { *tchttp.BaseRequest // 子网实例ID。形如:subnet-pxir56ns。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 子网名称,最大长度不能超过60个字节。 SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` // 子网是否开启广播。 EnableBroadcast *string `json:"EnableBroadcast,omitempty" name:"EnableBroadcast"` } func (r *ModifySubnetAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifySubnetAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifySubnetAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifySubnetAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifySubnetAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpcAttributeRequest struct { *tchttp.BaseRequest // VPC实例ID。形如:vpc-f49l6u0z。每次请求的实例的上限为100。参数不支持同时指定VpcIds和Filters。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 私有网络名称,可任意命名,但不得超过60个字符。 VpcName *string `json:"VpcName,omitempty" name:"VpcName"` // 是否开启组播。true: 开启, false: 关闭。 EnableMulticast *string `json:"EnableMulticast,omitempty" name:"EnableMulticast"` // DNS地址,最多支持4个,第1个默认为主,其余为备 DnsServers []*string `json:"DnsServers,omitempty" name:"DnsServers" list` // 域名 DomainName *string `json:"DomainName,omitempty" name:"DomainName"` } func (r *ModifyVpcAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpcAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpcAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyVpcAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpcAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpnConnectionAttributeRequest struct { *tchttp.BaseRequest // VPN通道实例ID。形如:vpnx-f49l6u0z。 VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` // VPN通道名称,可任意命名,但不得超过60个字符。 VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` // 预共享密钥。 PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` // SPD策略组,例如:{"10.0.0.5/24":["172.123.10.5/16"]},10.0.0.5/24是vpc内网段172.123.10.5/16是IDC网段。用户指定VPC内哪些网段可以和您IDC中哪些网段通信。 SecurityPolicyDatabases []*SecurityPolicyDatabase `json:"SecurityPolicyDatabases,omitempty" name:"SecurityPolicyDatabases" list` // IKE配置(Internet Key Exchange,因特网密钥交换),IKE具有一套自我保护机制,用户配置网络安全协议。 IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` // IPSec配置,腾讯云提供IPSec安全会话设置。 IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` } func (r *ModifyVpnConnectionAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpnConnectionAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpnConnectionAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyVpnConnectionAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpnConnectionAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpnGatewayAttributeRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // VPN网关名称,最大长度不能超过60个字节。 VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` // VPN网关计费模式,目前只支持预付费(即包年包月)到后付费(即按量计费)的转换。即参数只支持:POSTPAID_BY_HOUR。 InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` } func (r *ModifyVpnGatewayAttributeRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpnGatewayAttributeRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpnGatewayAttributeResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyVpnGatewayAttributeResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpnGatewayAttributeResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpnGatewayCcnRoutesRequest struct { *tchttp.BaseRequest // VPN网关实例ID VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 云联网路由(IDC网段)列表 Routes []*VpngwCcnRoutes `json:"Routes,omitempty" name:"Routes" list` } func (r *ModifyVpnGatewayCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpnGatewayCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ModifyVpnGatewayCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ModifyVpnGatewayCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ModifyVpnGatewayCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type NatGateway struct { // NAT网关的ID。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // NAT网关的名称。 NatGatewayName *string `json:"NatGatewayName,omitempty" name:"NatGatewayName"` // NAT网关创建的时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // NAT网关的状态。 // 'PENDING':生产中,'DELETING':删除中,'AVAILABLE':运行中,'UPDATING':升级中, // ‘FAILED’:失败。 State *string `json:"State,omitempty" name:"State"` // 网关最大外网出带宽(单位:Mbps)。 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // 网关并发连接上限。 MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` // 绑定NAT网关的公网IP对象数组。 PublicIpAddressSet []*NatGatewayAddress `json:"PublicIpAddressSet,omitempty" name:"PublicIpAddressSet" list` // NAT网关网络状态。“AVAILABLE”:运行中, “UNAVAILABLE”:不可用, “INSUFFICIENT”:欠费停服。 NetworkState *string `json:"NetworkState,omitempty" name:"NetworkState"` // NAT网关的端口转发规则。 DestinationIpPortTranslationNatRuleSet []*DestinationIpPortTranslationNatRule `json:"DestinationIpPortTranslationNatRuleSet,omitempty" name:"DestinationIpPortTranslationNatRuleSet" list` // VPC实例ID。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // NAT网关所在的可用区。 Zone *string `json:"Zone,omitempty" name:"Zone"` } type NatGatewayAddress struct { // 弹性公网IP(EIP)的唯一 ID,形如:`eip-11112222`。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // 外网IP地址,形如:`123.121.34.33`。 PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` // 资源封堵状态。true表示弹性ip处于封堵状态,false表示弹性ip处于未封堵状态。 IsBlocked *bool `json:"IsBlocked,omitempty" name:"IsBlocked"` } type NatGatewayDestinationIpPortTranslationNatRule struct { // 网络协议,可选值:`TCP`、`UDP`。 IpProtocol *string `json:"IpProtocol,omitempty" name:"IpProtocol"` // 弹性IP。 PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` // 公网端口。 PublicPort *uint64 `json:"PublicPort,omitempty" name:"PublicPort"` // 内网地址。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` // 内网端口。 PrivatePort *uint64 `json:"PrivatePort,omitempty" name:"PrivatePort"` // NAT网关转发规则描述。 Description *string `json:"Description,omitempty" name:"Description"` // NAT网关的ID。 // 注意:此字段可能返回 null,表示取不到有效值。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // 私有网络VPC的ID。 // 注意:此字段可能返回 null,表示取不到有效值。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // NAT网关转发规则创建时间。 // 注意:此字段可能返回 null,表示取不到有效值。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type NetDetect struct { // `VPC`实例`ID`。形如:`vpc-12345678` VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `VPC`实例名称。 VpcName *string `json:"VpcName,omitempty" name:"VpcName"` // 子网实例ID。形如:subnet-12345678。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 子网实例名称。 SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` // 网络探测实例ID。形如:netd-12345678。 NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` // 网络探测名称,最大长度不能超过60个字节。 NetDetectName *string `json:"NetDetectName,omitempty" name:"NetDetectName"` // 探测目的IPv4地址数组,最多两个。 DetectDestinationIp []*string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp" list` // 系统自动分配的探测源IPv4数组。长度为2。 DetectSourceIp []*string `json:"DetectSourceIp,omitempty" name:"DetectSourceIp" list` // 下一跳类型,目前我们支持的类型有: // VPN:VPN网关; // DIRECTCONNECT:专线网关; // PEERCONNECTION:对等连接; // NAT:NAT网关; // NORMAL_CVM:普通云服务器; NextHopType *string `json:"NextHopType,omitempty" name:"NextHopType"` // 下一跳目的网关,取值与“下一跳类型”相关: // 下一跳类型为VPN,取值VPN网关ID,形如:vpngw-12345678; // 下一跳类型为DIRECTCONNECT,取值专线网关ID,形如:dcg-12345678; // 下一跳类型为PEERCONNECTION,取值对等连接ID,形如:pcx-12345678; // 下一跳类型为NAT,取值Nat网关,形如:nat-12345678; // 下一跳类型为NORMAL_CVM,取值云服务器IPv4地址,形如:10.0.0.12; NextHopDestination *string `json:"NextHopDestination,omitempty" name:"NextHopDestination"` // 下一跳网关名称。 // 注意:此字段可能返回 null,表示取不到有效值。 NextHopName *string `json:"NextHopName,omitempty" name:"NextHopName"` // 网络探测描述。 // 注意:此字段可能返回 null,表示取不到有效值。 NetDetectDescription *string `json:"NetDetectDescription,omitempty" name:"NetDetectDescription"` // 创建时间。 // 注意:此字段可能返回 null,表示取不到有效值。 CreateTime *string `json:"CreateTime,omitempty" name:"CreateTime"` } type NetDetectIpState struct { // 探测目的IPv4地址。 DetectDestinationIp *string `json:"DetectDestinationIp,omitempty" name:"DetectDestinationIp"` // 探测结果。 // 0:成功; // -1:查询不到路由丢包; // -2:外出ACL丢包; // -3:IN ACL丢包; // -4:其他错误; State *int64 `json:"State,omitempty" name:"State"` // 时延,单位毫秒 Delay *uint64 `json:"Delay,omitempty" name:"Delay"` // 丢包率 PacketLossRate *uint64 `json:"PacketLossRate,omitempty" name:"PacketLossRate"` } type NetDetectState struct { // 网络探测实例ID。形如:netd-12345678。 NetDetectId *string `json:"NetDetectId,omitempty" name:"NetDetectId"` // 网络探测目的IP验证结果对象数组。 NetDetectIpStateSet []*NetDetectIpState `json:"NetDetectIpStateSet,omitempty" name:"NetDetectIpStateSet" list` } type NetworkAcl struct { // `VPC`实例`ID`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 网络ACL实例`ID`。 NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` // 网络ACL名称,最大长度为60。 NetworkAclName *string `json:"NetworkAclName,omitempty" name:"NetworkAclName"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 网络ACL关联的子网数组。 SubnetSet []*Subnet `json:"SubnetSet,omitempty" name:"SubnetSet" list` // 网络ACl入站规则。 IngressEntries []*NetworkAclEntry `json:"IngressEntries,omitempty" name:"IngressEntries" list` // 网络ACL出站规则。 EgressEntries []*NetworkAclEntry `json:"EgressEntries,omitempty" name:"EgressEntries" list` } type NetworkAclEntry struct { // 修改时间。 ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` // 协议, 取值: TCP,UDP, ICMP, ALL。 Protocol *string `json:"Protocol,omitempty" name:"Protocol"` // 端口(all, 单个port, range)。当Protocol为ALL或ICMP时,不能指定Port。 Port *string `json:"Port,omitempty" name:"Port"` // 网段或IP(互斥)。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 网段或IPv6(互斥)。 Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` // ACCEPT 或 DROP。 Action *string `json:"Action,omitempty" name:"Action"` // 规则描述,最大长度100。 Description *string `json:"Description,omitempty" name:"Description"` } type NetworkAclEntrySet struct { // 入站规则。 Ingress []*NetworkAclEntry `json:"Ingress,omitempty" name:"Ingress" list` // 出站规则。 Egress []*NetworkAclEntry `json:"Egress,omitempty" name:"Egress" list` } type NetworkInterface struct { // 弹性网卡实例ID,例如:eni-f1xjkw1b。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 弹性网卡名称。 NetworkInterfaceName *string `json:"NetworkInterfaceName,omitempty" name:"NetworkInterfaceName"` // 弹性网卡描述。 NetworkInterfaceDescription *string `json:"NetworkInterfaceDescription,omitempty" name:"NetworkInterfaceDescription"` // 子网实例ID。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // VPC实例ID。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 绑定的安全组。 GroupSet []*string `json:"GroupSet,omitempty" name:"GroupSet" list` // 是否是主网卡。 Primary *bool `json:"Primary,omitempty" name:"Primary"` // MAC地址。 MacAddress *string `json:"MacAddress,omitempty" name:"MacAddress"` // 弹性网卡状态: // <li>`PENDING`:创建中</li> // <li>`AVAILABLE`:可用的</li> // <li>`ATTACHING`:绑定中</li> // <li>`DETACHING`:解绑中</li> // <li>`DELETING`:删除中</li> State *string `json:"State,omitempty" name:"State"` // 内网IP信息。 PrivateIpAddressSet []*PrivateIpAddressSpecification `json:"PrivateIpAddressSet,omitempty" name:"PrivateIpAddressSet" list` // 绑定的云服务器对象。 // 注意:此字段可能返回 null,表示取不到有效值。 Attachment *NetworkInterfaceAttachment `json:"Attachment,omitempty" name:"Attachment"` // 可用区。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // `IPv6`地址列表。 Ipv6AddressSet []*Ipv6Address `json:"Ipv6AddressSet,omitempty" name:"Ipv6AddressSet" list` // 标签键值对。 TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet" list` // 网卡类型。0 - 弹性网卡;1 - evm弹性网卡。 EniType *uint64 `json:"EniType,omitempty" name:"EniType"` } type NetworkInterfaceAttachment struct { // 云主机实例ID。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` // 网卡在云主机实例内的序号。 DeviceIndex *uint64 `json:"DeviceIndex,omitempty" name:"DeviceIndex"` // 云主机所有者账户信息。 InstanceAccountId *string `json:"InstanceAccountId,omitempty" name:"InstanceAccountId"` // 绑定时间。 AttachTime *string `json:"AttachTime,omitempty" name:"AttachTime"` } type Price struct { // 实例价格。 InstancePrice *ItemPrice `json:"InstancePrice,omitempty" name:"InstancePrice"` // 网络价格。 BandwidthPrice *ItemPrice `json:"BandwidthPrice,omitempty" name:"BandwidthPrice"` } type PrivateIpAddressSpecification struct { // 内网IP地址。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` // 是否是主IP。 Primary *bool `json:"Primary,omitempty" name:"Primary"` // 公网IP地址。 PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` // EIP实例ID,例如:eip-11112222。 AddressId *string `json:"AddressId,omitempty" name:"AddressId"` // 内网IP描述信息。 Description *string `json:"Description,omitempty" name:"Description"` // 公网IP是否被封堵。 IsWanIpBlocked *bool `json:"IsWanIpBlocked,omitempty" name:"IsWanIpBlocked"` // IP状态: // PENDING:生产中 // MIGRATING:迁移中 // DELETING:删除中 // AVAILABLE:可用的 State *string `json:"State,omitempty" name:"State"` } type Quota struct { // 配额名称,取值范围:<br><li>`TOTAL_EIP_QUOTA`:用户当前地域下EIP的配额数;<br><li>`DAILY_EIP_APPLY`:用户当前地域下今日申购次数;<br><li>`DAILY_PUBLIC_IP_ASSIGN`:用户当前地域下,重新分配公网 IP次数。 QuotaId *string `json:"QuotaId,omitempty" name:"QuotaId"` // 当前数量 QuotaCurrent *int64 `json:"QuotaCurrent,omitempty" name:"QuotaCurrent"` // 配额数量 QuotaLimit *int64 `json:"QuotaLimit,omitempty" name:"QuotaLimit"` } type ReferredSecurityGroup struct { // 安全组实例ID。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 引用安全组实例ID(SecurityGroupId)的所有安全组实例ID。 ReferredSecurityGroupIds []*string `json:"ReferredSecurityGroupIds,omitempty" name:"ReferredSecurityGroupIds" list` } type RejectAttachCcnInstancesRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 拒绝关联实例列表。 Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances" list` } func (r *RejectAttachCcnInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RejectAttachCcnInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RejectAttachCcnInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RejectAttachCcnInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RejectAttachCcnInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReleaseAddressesRequest struct { *tchttp.BaseRequest // 标识 EIP 的唯一 ID 列表。EIP 唯一 ID 形如:`eip-11112222`。 AddressIds []*string `json:"AddressIds,omitempty" name:"AddressIds" list` } func (r *ReleaseAddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReleaseAddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReleaseAddressesResponse struct { *tchttp.BaseResponse Response *struct { // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 TaskId *string `json:"TaskId,omitempty" name:"TaskId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ReleaseAddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReleaseAddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReleaseIp6AddressesBandwidthRequest struct { *tchttp.BaseRequest // IPV6地址。Ip6Addresses和Ip6AddressIds必须且只能传一个 Ip6Addresses []*string `json:"Ip6Addresses,omitempty" name:"Ip6Addresses" list` // IPV6地址对应的唯一ID,形如eip-xxxxxxxx。Ip6Addresses和Ip6AddressIds必须且只能传一个。 Ip6AddressIds []*string `json:"Ip6AddressIds,omitempty" name:"Ip6AddressIds" list` } func (r *ReleaseIp6AddressesBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReleaseIp6AddressesBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReleaseIp6AddressesBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 异步任务TaskId。可以使用[DescribeTaskResult](https://cloud.tencent.com/document/api/215/36271)接口查询任务状态。 TaskId *string `json:"TaskId,omitempty" name:"TaskId"` // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ReleaseIp6AddressesBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReleaseIp6AddressesBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RemoveBandwidthPackageResourcesRequest struct { *tchttp.BaseRequest // 带宽包唯一标识ID,形如'bwp-xxxx' BandwidthPackageId *string `json:"BandwidthPackageId,omitempty" name:"BandwidthPackageId"` // 资源类型,包括‘Address’, ‘LoadBalance’ ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` // 资源ID,可支持资源形如'eip-xxxx', 'lb-xxxx' ResourceIds []*string `json:"ResourceIds,omitempty" name:"ResourceIds" list` } func (r *RemoveBandwidthPackageResourcesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RemoveBandwidthPackageResourcesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RemoveBandwidthPackageResourcesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RemoveBandwidthPackageResourcesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RemoveBandwidthPackageResourcesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RemoveIp6RulesRequest struct { *tchttp.BaseRequest // IPV6转换规则所属的转换实例唯一ID,形如ip6-xxxxxxxx Ip6TranslatorId *string `json:"Ip6TranslatorId,omitempty" name:"Ip6TranslatorId"` // 待删除IPV6转换规则,形如rule6-xxxxxxxx Ip6RuleIds []*string `json:"Ip6RuleIds,omitempty" name:"Ip6RuleIds" list` } func (r *RemoveIp6RulesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RemoveIp6RulesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RemoveIp6RulesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RemoveIp6RulesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RemoveIp6RulesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RenewVpnGatewayRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 预付费计费模式。 InstanceChargePrepaid *InstanceChargePrepaid `json:"InstanceChargePrepaid,omitempty" name:"InstanceChargePrepaid"` } func (r *RenewVpnGatewayRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RenewVpnGatewayRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type RenewVpnGatewayResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *RenewVpnGatewayResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *RenewVpnGatewayResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceDirectConnectGatewayCcnRoutesRequest struct { *tchttp.BaseRequest // 专线网关ID,形如:dcg-prpqlmg1 DirectConnectGatewayId *string `json:"DirectConnectGatewayId,omitempty" name:"DirectConnectGatewayId"` // 需要连通的IDC网段列表 Routes []*DirectConnectGatewayCcnRoute `json:"Routes,omitempty" name:"Routes" list` } func (r *ReplaceDirectConnectGatewayCcnRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceDirectConnectGatewayCcnRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceDirectConnectGatewayCcnRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ReplaceDirectConnectGatewayCcnRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceDirectConnectGatewayCcnRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceRouteTableAssociationRequest struct { *tchttp.BaseRequest // 子网实例ID,例如:subnet-3x5lf5q0。可通过DescribeSubnets接口查询。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` } func (r *ReplaceRouteTableAssociationRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceRouteTableAssociationRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceRouteTableAssociationResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ReplaceRouteTableAssociationResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceRouteTableAssociationResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceRoutesRequest struct { *tchttp.BaseRequest // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由策略对象。需要指定路由策略ID(RouteId)。 Routes []*Route `json:"Routes,omitempty" name:"Routes" list` } func (r *ReplaceRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ReplaceRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceSecurityGroupPolicyRequest struct { *tchttp.BaseRequest // 安全组实例ID,例如sg-33ocnj9n,可通过DescribeSecurityGroups获取。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 安全组规则集合对象。 SecurityGroupPolicySet *SecurityGroupPolicySet `json:"SecurityGroupPolicySet,omitempty" name:"SecurityGroupPolicySet"` } func (r *ReplaceSecurityGroupPolicyRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceSecurityGroupPolicyRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ReplaceSecurityGroupPolicyResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ReplaceSecurityGroupPolicyResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ReplaceSecurityGroupPolicyResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetAttachCcnInstancesRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // CCN所属UIN(根账号)。 CcnUin *string `json:"CcnUin,omitempty" name:"CcnUin"` // 重新申请关联网络实例列表。 Instances []*CcnInstance `json:"Instances,omitempty" name:"Instances" list` } func (r *ResetAttachCcnInstancesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetAttachCcnInstancesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetAttachCcnInstancesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetAttachCcnInstancesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetAttachCcnInstancesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetNatGatewayConnectionRequest struct { *tchttp.BaseRequest // NAT网关ID。 NatGatewayId *string `json:"NatGatewayId,omitempty" name:"NatGatewayId"` // NAT网关并发连接上限,形如:1000000、3000000、10000000。 MaxConcurrentConnection *uint64 `json:"MaxConcurrentConnection,omitempty" name:"MaxConcurrentConnection"` } func (r *ResetNatGatewayConnectionRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetNatGatewayConnectionRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetNatGatewayConnectionResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetNatGatewayConnectionResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetNatGatewayConnectionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetRoutesRequest struct { *tchttp.BaseRequest // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由表名称,最大长度不能超过60个字节。 RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` // 路由策略。 Routes []*Route `json:"Routes,omitempty" name:"Routes" list` } func (r *ResetRoutesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetRoutesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetRoutesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetRoutesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetRoutesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetVpnConnectionRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // VPN通道实例ID。形如:vpnx-f49l6u0z。 VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` } func (r *ResetVpnConnectionRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetVpnConnectionRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetVpnConnectionResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetVpnConnectionResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetVpnConnectionResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetVpnGatewayInternetMaxBandwidthRequest struct { *tchttp.BaseRequest // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 公网带宽设置。可选带宽规格:5, 10, 20, 50, 100;单位:Mbps。 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` } func (r *ResetVpnGatewayInternetMaxBandwidthRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetVpnGatewayInternetMaxBandwidthRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type ResetVpnGatewayInternetMaxBandwidthResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *ResetVpnGatewayInternetMaxBandwidthResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *ResetVpnGatewayInternetMaxBandwidthResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type Resource struct { // 带宽包资源类型,包括'Address'和'LoadBalance' ResourceType *string `json:"ResourceType,omitempty" name:"ResourceType"` // 带宽包资源Id,形如'eip-xxxx', 'lb-xxxx' ResourceId *string `json:"ResourceId,omitempty" name:"ResourceId"` // 带宽包资源Ip AddressIp *string `json:"AddressIp,omitempty" name:"AddressIp"` } type ResourceDashboard struct { // Vpc实例ID,例如:vpc-f1xjkw1b。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网实例ID,例如:subnet-bthucmmy。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 基础网络互通。 Classiclink *uint64 `json:"Classiclink,omitempty" name:"Classiclink"` // 专线网关。 Dcg *uint64 `json:"Dcg,omitempty" name:"Dcg"` // 对等连接。 Pcx *uint64 `json:"Pcx,omitempty" name:"Pcx"` // 当前已使用的IP总数。 Ip *uint64 `json:"Ip,omitempty" name:"Ip"` // NAT网关。 Nat *uint64 `json:"Nat,omitempty" name:"Nat"` // VPN网关。 Vpngw *uint64 `json:"Vpngw,omitempty" name:"Vpngw"` // 流日志。 FlowLog *uint64 `json:"FlowLog,omitempty" name:"FlowLog"` // 网络探测。 NetworkDetect *uint64 `json:"NetworkDetect,omitempty" name:"NetworkDetect"` // 网络ACL。 NetworkACL *uint64 `json:"NetworkACL,omitempty" name:"NetworkACL"` // 云主机。 CVM *uint64 `json:"CVM,omitempty" name:"CVM"` // 负载均衡。 LB *uint64 `json:"LB,omitempty" name:"LB"` // 关系型数据库。 CDB *uint64 `json:"CDB,omitempty" name:"CDB"` // 云数据库 TencentDB for Memcached。 Cmem *uint64 `json:"Cmem,omitempty" name:"Cmem"` // 时序数据库。 CTSDB *uint64 `json:"CTSDB,omitempty" name:"CTSDB"` // 数据库 TencentDB for MariaDB(TDSQL)。 MariaDB *uint64 `json:"MariaDB,omitempty" name:"MariaDB"` // 数据库 TencentDB for SQL Server。 SQLServer *uint64 `json:"SQLServer,omitempty" name:"SQLServer"` // 云数据库 TencentDB for PostgreSQL。 Postgres *uint64 `json:"Postgres,omitempty" name:"Postgres"` // 网络附加存储。 NAS *uint64 `json:"NAS,omitempty" name:"NAS"` // Snova云数据仓库。 Greenplumn *uint64 `json:"Greenplumn,omitempty" name:"Greenplumn"` // 消息队列 CKAFKA。 Ckafka *uint64 `json:"Ckafka,omitempty" name:"Ckafka"` // Grocery。 Grocery *uint64 `json:"Grocery,omitempty" name:"Grocery"` // 数据加密服务。 HSM *uint64 `json:"HSM,omitempty" name:"HSM"` // 游戏存储 Tcaplus。 Tcaplus *uint64 `json:"Tcaplus,omitempty" name:"Tcaplus"` // Cnas。 Cnas *uint64 `json:"Cnas,omitempty" name:"Cnas"` // HTAP 数据库 TiDB。 TiDB *uint64 `json:"TiDB,omitempty" name:"TiDB"` // EMR 集群。 Emr *uint64 `json:"Emr,omitempty" name:"Emr"` // SEAL。 SEAL *uint64 `json:"SEAL,omitempty" name:"SEAL"` // 文件存储 CFS。 CFS *uint64 `json:"CFS,omitempty" name:"CFS"` // Oracle。 Oracle *uint64 `json:"Oracle,omitempty" name:"Oracle"` // ElasticSearch服务。 ElasticSearch *uint64 `json:"ElasticSearch,omitempty" name:"ElasticSearch"` // 区块链服务。 TBaaS *uint64 `json:"TBaaS,omitempty" name:"TBaaS"` // Itop。 Itop *uint64 `json:"Itop,omitempty" name:"Itop"` // 云数据库审计。 DBAudit *uint64 `json:"DBAudit,omitempty" name:"DBAudit"` // 企业级云数据库 CynosDB for Postgres。 CynosDBPostgres *uint64 `json:"CynosDBPostgres,omitempty" name:"CynosDBPostgres"` // 数据库 TencentDB for Redis。 Redis *uint64 `json:"Redis,omitempty" name:"Redis"` // 数据库 TencentDB for MongoDB。 MongoDB *uint64 `json:"MongoDB,omitempty" name:"MongoDB"` // 分布式数据库 TencentDB for TDSQL。 DCDB *uint64 `json:"DCDB,omitempty" name:"DCDB"` // 企业级云数据库 CynosDB for MySQL。 CynosDBMySQL *uint64 `json:"CynosDBMySQL,omitempty" name:"CynosDBMySQL"` // 子网。 Subnet *uint64 `json:"Subnet,omitempty" name:"Subnet"` // 路由表。 RouteTable *uint64 `json:"RouteTable,omitempty" name:"RouteTable"` } type Route struct { // 目的网段,取值不能在私有网络网段内,例如:112.20.51.0/24。 DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` // 下一跳类型,目前我们支持的类型有: // CVM:公网网关类型的云服务器; // VPN:VPN网关; // DIRECTCONNECT:专线网关; // PEERCONNECTION:对等连接; // SSLVPN:sslvpn网关; // NAT:NAT网关; // NORMAL_CVM:普通云服务器; // EIP:云服务器的公网IP; // CCN:云联网。 GatewayType *string `json:"GatewayType,omitempty" name:"GatewayType"` // 下一跳地址,这里只需要指定不同下一跳类型的网关ID,系统会自动匹配到下一跳地址。 // 特别注意:当 GatewayType 为 EIP 时,GatewayId 固定值 '0' GatewayId *string `json:"GatewayId,omitempty" name:"GatewayId"` // 路由策略ID。IPv4路由策略ID是有意义的值,IPv6路由策略是无意义的值0。后续建议完全使用字符串唯一ID `RouteItemId`操作路由策略。 RouteId *uint64 `json:"RouteId,omitempty" name:"RouteId"` // 路由策略描述。 RouteDescription *string `json:"RouteDescription,omitempty" name:"RouteDescription"` // 是否启用 Enabled *bool `json:"Enabled,omitempty" name:"Enabled"` // 路由类型,目前我们支持的类型有: // USER:用户路由; // NETD:网络探测路由,创建网络探测实例时,系统默认下发,不可编辑与删除; // CCN:云联网路由,系统默认下发,不可编辑与删除。 // 用户只能添加和操作 USER 类型的路由。 RouteType *string `json:"RouteType,omitempty" name:"RouteType"` // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 目的IPv6网段,取值不能在私有网络网段内,例如:2402:4e00:1000:810b::/64。 DestinationIpv6CidrBlock *string `json:"DestinationIpv6CidrBlock,omitempty" name:"DestinationIpv6CidrBlock"` // 路由唯一策略ID。 RouteItemId *string `json:"RouteItemId,omitempty" name:"RouteItemId"` } type RouteConflict struct { // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 要检查的与之冲突的目的端 DestinationCidrBlock *string `json:"DestinationCidrBlock,omitempty" name:"DestinationCidrBlock"` // 冲突的路由策略列表 ConflictSet []*Route `json:"ConflictSet,omitempty" name:"ConflictSet" list` } type RouteTable struct { // VPC实例ID。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 路由表实例ID,例如:rtb-azd4dt1c。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 路由表名称。 RouteTableName *string `json:"RouteTableName,omitempty" name:"RouteTableName"` // 路由表关联关系。 AssociationSet []*RouteTableAssociation `json:"AssociationSet,omitempty" name:"AssociationSet" list` // IPv4路由策略集合。 RouteSet []*Route `json:"RouteSet,omitempty" name:"RouteSet" list` // 是否默认路由表。 Main *bool `json:"Main,omitempty" name:"Main"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 标签键值对。 TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet" list` } type RouteTableAssociation struct { // 子网实例ID。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 路由表实例ID。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` } type SecurityGroup struct { // 安全组实例ID,例如:sg-ohuuioma。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 安全组名称,可任意命名,但不得超过60个字符。 SecurityGroupName *string `json:"SecurityGroupName,omitempty" name:"SecurityGroupName"` // 安全组备注,最多100个字符。 SecurityGroupDesc *string `json:"SecurityGroupDesc,omitempty" name:"SecurityGroupDesc"` // 项目id,默认0。可在qcloud控制台项目管理页面查询到。 ProjectId *string `json:"ProjectId,omitempty" name:"ProjectId"` // 是否是默认安全组,默认安全组不支持删除。 IsDefault *bool `json:"IsDefault,omitempty" name:"IsDefault"` // 安全组创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 标签键值对。 TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet" list` } type SecurityGroupAssociationStatistics struct { // 安全组实例ID。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // 云服务器实例数。 CVM *uint64 `json:"CVM,omitempty" name:"CVM"` // 数据库实例数。 CDB *uint64 `json:"CDB,omitempty" name:"CDB"` // 弹性网卡实例数。 ENI *uint64 `json:"ENI,omitempty" name:"ENI"` // 被安全组引用数。 SG *uint64 `json:"SG,omitempty" name:"SG"` // 负载均衡实例数。 CLB *uint64 `json:"CLB,omitempty" name:"CLB"` // 全量实例的绑定统计。 InstanceStatistics []*InstanceStatistic `json:"InstanceStatistics,omitempty" name:"InstanceStatistics" list` // 所有资源的总计数(不包含被安全组引用数)。 TotalCount *uint64 `json:"TotalCount,omitempty" name:"TotalCount"` } type SecurityGroupLimitSet struct { // 每个项目每个地域可创建安全组数 SecurityGroupLimit *uint64 `json:"SecurityGroupLimit,omitempty" name:"SecurityGroupLimit"` // 安全组下的最大规则数 SecurityGroupPolicyLimit *uint64 `json:"SecurityGroupPolicyLimit,omitempty" name:"SecurityGroupPolicyLimit"` // 安全组下嵌套安全组规则数 ReferedSecurityGroupLimit *uint64 `json:"ReferedSecurityGroupLimit,omitempty" name:"ReferedSecurityGroupLimit"` // 单安全组关联实例数 SecurityGroupInstanceLimit *uint64 `json:"SecurityGroupInstanceLimit,omitempty" name:"SecurityGroupInstanceLimit"` // 实例关联安全组数 InstanceSecurityGroupLimit *uint64 `json:"InstanceSecurityGroupLimit,omitempty" name:"InstanceSecurityGroupLimit"` } type SecurityGroupPolicy struct { // 安全组规则索引号。 PolicyIndex *int64 `json:"PolicyIndex,omitempty" name:"PolicyIndex"` // 协议, 取值: TCP,UDP, ICMP。 Protocol *string `json:"Protocol,omitempty" name:"Protocol"` // 端口(all, 离散port, range)。 Port *string `json:"Port,omitempty" name:"Port"` // 协议端口ID或者协议端口组ID。ServiceTemplate和Protocol+Port互斥。 ServiceTemplate *ServiceTemplateSpecification `json:"ServiceTemplate,omitempty" name:"ServiceTemplate"` // 网段或IP(互斥)。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 网段或IPv6(互斥)。 Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` // 安全组实例ID,例如:sg-ohuuioma。 SecurityGroupId *string `json:"SecurityGroupId,omitempty" name:"SecurityGroupId"` // IP地址ID或者ID地址组ID。 AddressTemplate *AddressTemplateSpecification `json:"AddressTemplate,omitempty" name:"AddressTemplate"` // ACCEPT 或 DROP。 Action *string `json:"Action,omitempty" name:"Action"` // 安全组规则描述。 PolicyDescription *string `json:"PolicyDescription,omitempty" name:"PolicyDescription"` // 安全组最近修改时间。 ModifyTime *string `json:"ModifyTime,omitempty" name:"ModifyTime"` } type SecurityGroupPolicySet struct { // 安全组规则当前版本。用户每次更新安全规则版本会自动加1,防止更新的路由规则已过期,不填不考虑冲突。 Version *string `json:"Version,omitempty" name:"Version"` // 出站规则。 Egress []*SecurityGroupPolicy `json:"Egress,omitempty" name:"Egress" list` // 入站规则。 Ingress []*SecurityGroupPolicy `json:"Ingress,omitempty" name:"Ingress" list` } type SecurityPolicyDatabase struct { // 本端网段 LocalCidrBlock *string `json:"LocalCidrBlock,omitempty" name:"LocalCidrBlock"` // 对端网段 RemoteCidrBlock []*string `json:"RemoteCidrBlock,omitempty" name:"RemoteCidrBlock" list` } type ServiceTemplate struct { // 协议端口实例ID,例如:ppm-f5n1f8da。 ServiceTemplateId *string `json:"ServiceTemplateId,omitempty" name:"ServiceTemplateId"` // 模板名称。 ServiceTemplateName *string `json:"ServiceTemplateName,omitempty" name:"ServiceTemplateName"` // 协议端口信息。 ServiceSet []*string `json:"ServiceSet,omitempty" name:"ServiceSet" list` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type ServiceTemplateGroup struct { // 协议端口模板集合实例ID,例如:ppmg-2klmrefu。 ServiceTemplateGroupId *string `json:"ServiceTemplateGroupId,omitempty" name:"ServiceTemplateGroupId"` // 协议端口模板集合名称。 ServiceTemplateGroupName *string `json:"ServiceTemplateGroupName,omitempty" name:"ServiceTemplateGroupName"` // 协议端口模板实例ID。 ServiceTemplateIdSet []*string `json:"ServiceTemplateIdSet,omitempty" name:"ServiceTemplateIdSet" list` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 协议端口模板实例信息。 ServiceTemplateSet []*ServiceTemplate `json:"ServiceTemplateSet,omitempty" name:"ServiceTemplateSet" list` } type ServiceTemplateSpecification struct { // 协议端口ID,例如:ppm-f5n1f8da。 ServiceId *string `json:"ServiceId,omitempty" name:"ServiceId"` // 协议端口组ID,例如:ppmg-f5n1f8da。 ServiceGroupId *string `json:"ServiceGroupId,omitempty" name:"ServiceGroupId"` } type SetCcnRegionBandwidthLimitsRequest struct { *tchttp.BaseRequest // CCN实例ID。形如:ccn-f49l6u0z。 CcnId *string `json:"CcnId,omitempty" name:"CcnId"` // 云联网(CCN)各地域出带宽上限。 CcnRegionBandwidthLimits []*CcnRegionBandwidthLimit `json:"CcnRegionBandwidthLimits,omitempty" name:"CcnRegionBandwidthLimits" list` } func (r *SetCcnRegionBandwidthLimitsRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *SetCcnRegionBandwidthLimitsRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type SetCcnRegionBandwidthLimitsResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *SetCcnRegionBandwidthLimitsResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *SetCcnRegionBandwidthLimitsResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type Subnet struct { // `VPC`实例`ID`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 子网实例`ID`,例如:subnet-bthucmmy。 SubnetId *string `json:"SubnetId,omitempty" name:"SubnetId"` // 子网名称。 SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` // 子网的 `IPv4` `CIDR`。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 是否默认子网。 IsDefault *bool `json:"IsDefault,omitempty" name:"IsDefault"` // 是否开启广播。 EnableBroadcast *bool `json:"EnableBroadcast,omitempty" name:"EnableBroadcast"` // 可用区。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 路由表实例ID,例如:rtb-l2h8d7c2。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 可用`IPv4`数。 AvailableIpAddressCount *uint64 `json:"AvailableIpAddressCount,omitempty" name:"AvailableIpAddressCount"` // 子网的 `IPv6` `CIDR`。 Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` // 关联`ACL`ID NetworkAclId *string `json:"NetworkAclId,omitempty" name:"NetworkAclId"` // 是否为 `SNAT` 地址池子网。 IsRemoteVpcSnat *bool `json:"IsRemoteVpcSnat,omitempty" name:"IsRemoteVpcSnat"` // 子网`IPv4`总数。 TotalIpAddressCount *uint64 `json:"TotalIpAddressCount,omitempty" name:"TotalIpAddressCount"` // 标签键值对。 TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet" list` } type SubnetInput struct { // 子网的`CIDR`。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 子网名称。 SubnetName *string `json:"SubnetName,omitempty" name:"SubnetName"` // 可用区。形如:`ap-guangzhou-2`。 Zone *string `json:"Zone,omitempty" name:"Zone"` // 指定关联路由表,形如:`rtb-3ryrwzuu`。 RouteTableId *string `json:"RouteTableId,omitempty" name:"RouteTableId"` } type Tag struct { // 标签键 // 注意:此字段可能返回 null,表示取不到有效值。 Key *string `json:"Key,omitempty" name:"Key"` // 标签值 // 注意:此字段可能返回 null,表示取不到有效值。 Value *string `json:"Value,omitempty" name:"Value"` } type TemplateLimit struct { // 参数模板IP地址成员配额。 AddressTemplateMemberLimit *uint64 `json:"AddressTemplateMemberLimit,omitempty" name:"AddressTemplateMemberLimit"` // 参数模板IP地址组成员配额。 AddressTemplateGroupMemberLimit *uint64 `json:"AddressTemplateGroupMemberLimit,omitempty" name:"AddressTemplateGroupMemberLimit"` // 参数模板I协议端口成员配额。 ServiceTemplateMemberLimit *uint64 `json:"ServiceTemplateMemberLimit,omitempty" name:"ServiceTemplateMemberLimit"` // 参数模板协议端口组成员配额。 ServiceTemplateGroupMemberLimit *uint64 `json:"ServiceTemplateGroupMemberLimit,omitempty" name:"ServiceTemplateGroupMemberLimit"` } type TransformAddressRequest struct { *tchttp.BaseRequest // 待操作有普通公网 IP 的实例 ID。实例 ID 形如:`ins-11112222`。可通过登录[控制台](https://console.cloud.tencent.com/cvm)查询,也可通过 [DescribeInstances](https://cloud.tencent.com/document/api/213/9389) 接口返回值中的`InstanceId`获取。 InstanceId *string `json:"InstanceId,omitempty" name:"InstanceId"` } func (r *TransformAddressRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *TransformAddressRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type TransformAddressResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *TransformAddressResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *TransformAddressResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignIpv6AddressesRequest struct { *tchttp.BaseRequest // 弹性网卡实例`ID`,形如:`eni-m6dyj72l`。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 指定的`IPv6`地址列表,单次最多指定10个。 Ipv6Addresses []*Ipv6Address `json:"Ipv6Addresses,omitempty" name:"Ipv6Addresses" list` } func (r *UnassignIpv6AddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignIpv6AddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignIpv6AddressesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *UnassignIpv6AddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignIpv6AddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignIpv6CidrBlockRequest struct { *tchttp.BaseRequest // `VPC`实例`ID`,形如:`vpc-f49l6u0z`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `IPv6`网段。形如:`3402:4e00:20:1000::/56` Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` } func (r *UnassignIpv6CidrBlockRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignIpv6CidrBlockRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignIpv6CidrBlockResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *UnassignIpv6CidrBlockResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignIpv6CidrBlockResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignIpv6SubnetCidrBlockRequest struct { *tchttp.BaseRequest // 子网所在私有网络`ID`。形如:`vpc-f49l6u0z`。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `IPv6` 子网段列表。 Ipv6SubnetCidrBlocks []*Ipv6SubnetCidrBlock `json:"Ipv6SubnetCidrBlocks,omitempty" name:"Ipv6SubnetCidrBlocks" list` } func (r *UnassignIpv6SubnetCidrBlockRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignIpv6SubnetCidrBlockRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignIpv6SubnetCidrBlockResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *UnassignIpv6SubnetCidrBlockResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignIpv6SubnetCidrBlockResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignPrivateIpAddressesRequest struct { *tchttp.BaseRequest // 弹性网卡实例ID,例如:eni-m6dyj72l。 NetworkInterfaceId *string `json:"NetworkInterfaceId,omitempty" name:"NetworkInterfaceId"` // 指定的内网IP信息,单次最多指定10个。 PrivateIpAddresses []*PrivateIpAddressSpecification `json:"PrivateIpAddresses,omitempty" name:"PrivateIpAddresses" list` } func (r *UnassignPrivateIpAddressesRequest) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignPrivateIpAddressesRequest) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type UnassignPrivateIpAddressesResponse struct { *tchttp.BaseResponse Response *struct { // 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 RequestId *string `json:"RequestId,omitempty" name:"RequestId"` } `json:"Response"` } func (r *UnassignPrivateIpAddressesResponse) ToJsonString() string { b, _ := json.Marshal(r) return string(b) } func (r *UnassignPrivateIpAddressesResponse) FromJsonString(s string) error { return json.Unmarshal([]byte(s), &r) } type Vpc struct { // `VPC`名称。 VpcName *string `json:"VpcName,omitempty" name:"VpcName"` // `VPC`实例`ID`,例如:vpc-azd4dt1c。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // `VPC`的`IPv4` `CIDR`。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 是否默认`VPC`。 IsDefault *bool `json:"IsDefault,omitempty" name:"IsDefault"` // 是否开启组播。 EnableMulticast *bool `json:"EnableMulticast,omitempty" name:"EnableMulticast"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // `DNS`列表。 DnsServerSet []*string `json:"DnsServerSet,omitempty" name:"DnsServerSet" list` // `DHCP`域名选项值。 DomainName *string `json:"DomainName,omitempty" name:"DomainName"` // `DHCP`选项集`ID`。 DhcpOptionsId *string `json:"DhcpOptionsId,omitempty" name:"DhcpOptionsId"` // 是否开启`DHCP`。 EnableDhcp *bool `json:"EnableDhcp,omitempty" name:"EnableDhcp"` // `VPC`的`IPv6` `CIDR`。 Ipv6CidrBlock *string `json:"Ipv6CidrBlock,omitempty" name:"Ipv6CidrBlock"` // 标签键值对 TagSet []*Tag `json:"TagSet,omitempty" name:"TagSet" list` // 辅助CIDR // 注意:此字段可能返回 null,表示取不到有效值。 AssistantCidrSet []*AssistantCidr `json:"AssistantCidrSet,omitempty" name:"AssistantCidrSet" list` } type VpcIpv6Address struct { // `VPC`内`IPv6`地址。 Ipv6Address *string `json:"Ipv6Address,omitempty" name:"Ipv6Address"` // 所属子网 `IPv6` `CIDR`。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // `IPv6`类型。 Ipv6AddressType *string `json:"Ipv6AddressType,omitempty" name:"Ipv6AddressType"` // `IPv6`申请时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type VpcLimit struct { // 私有网络配额描述 LimitType *string `json:"LimitType,omitempty" name:"LimitType"` // 私有网络配额值 LimitValue *uint64 `json:"LimitValue,omitempty" name:"LimitValue"` } type VpcPrivateIpAddress struct { // `VPC`内网`IP`。 PrivateIpAddress *string `json:"PrivateIpAddress,omitempty" name:"PrivateIpAddress"` // 所属子网`CIDR`。 CidrBlock *string `json:"CidrBlock,omitempty" name:"CidrBlock"` // 内网`IP`类型。 PrivateIpAddressType *string `json:"PrivateIpAddressType,omitempty" name:"PrivateIpAddressType"` // `IP`申请时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` } type VpnConnection struct { // 通道实例ID。 VpnConnectionId *string `json:"VpnConnectionId,omitempty" name:"VpnConnectionId"` // 通道名称。 VpnConnectionName *string `json:"VpnConnectionName,omitempty" name:"VpnConnectionName"` // VPC实例ID。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // VPN网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // 对端网关实例ID。 CustomerGatewayId *string `json:"CustomerGatewayId,omitempty" name:"CustomerGatewayId"` // 预共享密钥。 PreShareKey *string `json:"PreShareKey,omitempty" name:"PreShareKey"` // 通道传输协议。 VpnProto *string `json:"VpnProto,omitempty" name:"VpnProto"` // 通道加密协议。 EncryptProto *string `json:"EncryptProto,omitempty" name:"EncryptProto"` // 路由类型。 RouteType *string `json:"RouteType,omitempty" name:"RouteType"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 通道的生产状态,PENDING:生产中,AVAILABLE:运行中,DELETING:删除中。 State *string `json:"State,omitempty" name:"State"` // 通道连接状态,AVAILABLE:已连接。 NetStatus *string `json:"NetStatus,omitempty" name:"NetStatus"` // SPD。 SecurityPolicyDatabaseSet []*SecurityPolicyDatabase `json:"SecurityPolicyDatabaseSet,omitempty" name:"SecurityPolicyDatabaseSet" list` // IKE选项。 IKEOptionsSpecification *IKEOptionsSpecification `json:"IKEOptionsSpecification,omitempty" name:"IKEOptionsSpecification"` // IPSEC选择。 IPSECOptionsSpecification *IPSECOptionsSpecification `json:"IPSECOptionsSpecification,omitempty" name:"IPSECOptionsSpecification"` } type VpnGateway struct { // 网关实例ID。 VpnGatewayId *string `json:"VpnGatewayId,omitempty" name:"VpnGatewayId"` // VPC实例ID。 VpcId *string `json:"VpcId,omitempty" name:"VpcId"` // 网关实例名称。 VpnGatewayName *string `json:"VpnGatewayName,omitempty" name:"VpnGatewayName"` // 网关实例类型:'IPSEC', 'SSL','CCN'。 Type *string `json:"Type,omitempty" name:"Type"` // 网关实例状态, 'PENDING':生产中,'DELETING':删除中,'AVAILABLE':运行中。 State *string `json:"State,omitempty" name:"State"` // 网关公网IP。 PublicIpAddress *string `json:"PublicIpAddress,omitempty" name:"PublicIpAddress"` // 网关续费类型:'NOTIFY_AND_MANUAL_RENEW':手动续费,'NOTIFY_AND_AUTO_RENEW':自动续费,'NOT_NOTIFY_AND_NOT_RENEW':到期不续费。 RenewFlag *string `json:"RenewFlag,omitempty" name:"RenewFlag"` // 网关付费类型:POSTPAID_BY_HOUR:按小时后付费,PREPAID:包年包月预付费, InstanceChargeType *string `json:"InstanceChargeType,omitempty" name:"InstanceChargeType"` // 网关出带宽。 InternetMaxBandwidthOut *uint64 `json:"InternetMaxBandwidthOut,omitempty" name:"InternetMaxBandwidthOut"` // 创建时间。 CreatedTime *string `json:"CreatedTime,omitempty" name:"CreatedTime"` // 预付费网关过期时间。 ExpiredTime *string `json:"ExpiredTime,omitempty" name:"ExpiredTime"` // 公网IP是否被封堵。 IsAddressBlocked *bool `json:"IsAddressBlocked,omitempty" name:"IsAddressBlocked"` // 计费模式变更,PREPAID_TO_POSTPAID:包年包月预付费到期转按小时后付费。 NewPurchasePlan *string `json:"NewPurchasePlan,omitempty" name:"NewPurchasePlan"` // 网关计费装,PROTECTIVELY_ISOLATED:被安全隔离的实例,NORMAL:正常。 RestrictState *string `json:"RestrictState,omitempty" name:"RestrictState"` // 可用区,如:ap-guangzhou-2 Zone *string `json:"Zone,omitempty" name:"Zone"` // 网关带宽配额信息 VpnGatewayQuotaSet []*VpnGatewayQuota `json:"VpnGatewayQuotaSet,omitempty" name:"VpnGatewayQuotaSet" list` // 网关实例版本信息 Version *string `json:"Version,omitempty" name:"Version"` // Type值为CCN时,该值表示云联网实例ID NetworkInstanceId *string `json:"NetworkInstanceId,omitempty" name:"NetworkInstanceId"` } type VpnGatewayQuota struct { // 带宽配额 Bandwidth *uint64 `json:"Bandwidth,omitempty" name:"Bandwidth"` // 配额中文名称 Cname *string `json:"Cname,omitempty" name:"Cname"` // 配额英文名称 Name *string `json:"Name,omitempty" name:"Name"` } type VpngwCcnRoutes struct { // 路由信息ID RouteId *string `json:"RouteId,omitempty" name:"RouteId"` // 路由信息是否启用 // ENABLE:启用该路由 // DISABLE:不启用该路由 Status *string `json:"Status,omitempty" name:"Status"` } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/�����������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017015�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/���������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0017264�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/��������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0020533�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/AUTHORS�������������������������������������������������0000664�0000000�0000000�00000000255�13771713062�0021605�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This source code refers to The Go Authors for copyright purposes. # The master list of authors is in the main Go distribution, # visible at http://tip.golang.org/AUTHORS. ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/CONTRIBUTORS��������������������������������������������0000664�0000000�0000000�00000000252�13771713062�0022412�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This source code was written by the Go contributors. # The master list of contributors is in the main Go distribution, # visible at http://tip.golang.org/CONTRIBUTORS. ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/LICENSE�������������������������������������������������0000664�0000000�0000000�00000002707�13771713062�0021546�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ���������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/PATENTS�������������������������������������������������0000664�0000000�0000000�00000002427�13771713062�0021601�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed. �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/event/��������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0021654�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/event/key/����������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0022444�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/event/key/code_string.go��������������������������������0000664�0000000�0000000�00000005654�13771713062�0025305�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Code generated by "stringer -type=Code"; DO NOT EDIT package key import "fmt" const ( _Code_name_0 = "CodeUnknown" _Code_name_1 = "CodeACodeBCodeCCodeDCodeECodeFCodeGCodeHCodeICodeJCodeKCodeLCodeMCodeNCodeOCodePCodeQCodeRCodeSCodeTCodeUCodeVCodeWCodeXCodeYCodeZCode1Code2Code3Code4Code5Code6Code7Code8Code9Code0CodeReturnEnterCodeEscapeCodeDeleteBackspaceCodeTabCodeSpacebarCodeHyphenMinusCodeEqualSignCodeLeftSquareBracketCodeRightSquareBracketCodeBackslash" _Code_name_2 = "CodeSemicolonCodeApostropheCodeGraveAccentCodeCommaCodeFullStopCodeSlashCodeCapsLockCodeF1CodeF2CodeF3CodeF4CodeF5CodeF6CodeF7CodeF8CodeF9CodeF10CodeF11CodeF12" _Code_name_3 = "CodePauseCodeInsertCodeHomeCodePageUpCodeDeleteForwardCodeEndCodePageDownCodeRightArrowCodeLeftArrowCodeDownArrowCodeUpArrowCodeKeypadNumLockCodeKeypadSlashCodeKeypadAsteriskCodeKeypadHyphenMinusCodeKeypadPlusSignCodeKeypadEnterCodeKeypad1CodeKeypad2CodeKeypad3CodeKeypad4CodeKeypad5CodeKeypad6CodeKeypad7CodeKeypad8CodeKeypad9CodeKeypad0CodeKeypadFullStop" _Code_name_4 = "CodeKeypadEqualSignCodeF13CodeF14CodeF15CodeF16CodeF17CodeF18CodeF19CodeF20CodeF21CodeF22CodeF23CodeF24" _Code_name_5 = "CodeHelp" _Code_name_6 = "CodeMuteCodeVolumeUpCodeVolumeDown" _Code_name_7 = "CodeLeftControlCodeLeftShiftCodeLeftAltCodeLeftGUICodeRightControlCodeRightShiftCodeRightAltCodeRightGUI" _Code_name_8 = "CodeCompose" ) var ( _Code_index_0 = [...]uint8{0, 11} _Code_index_1 = [...]uint16{0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 195, 205, 224, 231, 243, 258, 271, 292, 314, 327} _Code_index_2 = [...]uint8{0, 13, 27, 42, 51, 63, 72, 84, 90, 96, 102, 108, 114, 120, 126, 132, 138, 145, 152, 159} _Code_index_3 = [...]uint16{0, 9, 19, 27, 37, 54, 61, 73, 87, 100, 113, 124, 141, 156, 174, 195, 213, 228, 239, 250, 261, 272, 283, 294, 305, 316, 327, 338, 356} _Code_index_4 = [...]uint8{0, 19, 26, 33, 40, 47, 54, 61, 68, 75, 82, 89, 96, 103} _Code_index_5 = [...]uint8{0, 8} _Code_index_6 = [...]uint8{0, 8, 20, 34} _Code_index_7 = [...]uint8{0, 15, 28, 39, 50, 66, 80, 92, 104} _Code_index_8 = [...]uint8{0, 11} ) func (i Code) String() string { switch { case i == 0: return _Code_name_0 case 4 <= i && i <= 49: i -= 4 return _Code_name_1[_Code_index_1[i]:_Code_index_1[i+1]] case 51 <= i && i <= 69: i -= 51 return _Code_name_2[_Code_index_2[i]:_Code_index_2[i+1]] case 72 <= i && i <= 99: i -= 72 return _Code_name_3[_Code_index_3[i]:_Code_index_3[i+1]] case 103 <= i && i <= 115: i -= 103 return _Code_name_4[_Code_index_4[i]:_Code_index_4[i+1]] case i == 117: return _Code_name_5 case 127 <= i && i <= 129: i -= 127 return _Code_name_6[_Code_index_6[i]:_Code_index_6[i+1]] case 224 <= i && i <= 231: i -= 224 return _Code_name_7[_Code_index_7[i]:_Code_index_7[i+1]] case i == 65536: return _Code_name_8 default: return fmt.Sprintf("Code(%d)", i) } } ������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/golang.org/x/mobile/event/key/key.go����������������������������������������0000664�0000000�0000000�00000015331�13771713062�0023566�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:generate stringer -type=Code // Package key defines an event for physical keyboard keys. // // On-screen software keyboards do not send key events. // // See the golang.org/x/mobile/app package for details on the event model. package key import ( "fmt" "strings" ) // Event is a key event. type Event struct { // Rune is the meaning of the key event as determined by the // operating system. The mapping is determined by system-dependent // current layout, modifiers, lock-states, etc. // // If non-negative, it is a Unicode codepoint: pressing the 'a' key // generates different Runes 'a' or 'A' (but the same Code) depending on // the state of the shift key. // // If -1, the key does not generate a Unicode codepoint. To distinguish // them, look at Code. Rune rune // Code is the identity of the physical key relative to a notional // "standard" keyboard, independent of current layout, modifiers, // lock-states, etc // // For standard key codes, its value matches USB HID key codes. // Compare its value to uint32-typed constants in this package, such // as CodeLeftShift and CodeEscape. // // Pressing the regular '2' key and number-pad '2' key (with Num-Lock) // generate different Codes (but the same Rune). Code Code // Modifiers is a bitmask representing a set of modifier keys: ModShift, // ModAlt, etc. Modifiers Modifiers // Direction is the direction of the key event: DirPress, DirRelease, // or DirNone (for key repeats). Direction Direction // TODO: add a Device ID, for multiple input devices? // TODO: add a time.Time? } func (e Event) String() string { if e.Rune >= 0 { return fmt.Sprintf("key.Event{%q (%v), %v, %v}", e.Rune, e.Code, e.Modifiers, e.Direction) } return fmt.Sprintf("key.Event{(%v), %v, %v}", e.Code, e.Modifiers, e.Direction) } // Direction is the direction of the key event. type Direction uint8 const ( DirNone Direction = 0 DirPress Direction = 1 DirRelease Direction = 2 ) // Modifiers is a bitmask representing a set of modifier keys. type Modifiers uint32 const ( ModShift Modifiers = 1 << 0 ModControl Modifiers = 1 << 1 ModAlt Modifiers = 1 << 2 ModMeta Modifiers = 1 << 3 // called "Command" on OS X ) // Code is the identity of a key relative to a notional "standard" keyboard. type Code uint32 // Physical key codes. // // For standard key codes, its value matches USB HID key codes. // TODO: add missing codes. const ( CodeUnknown Code = 0 CodeA Code = 4 CodeB Code = 5 CodeC Code = 6 CodeD Code = 7 CodeE Code = 8 CodeF Code = 9 CodeG Code = 10 CodeH Code = 11 CodeI Code = 12 CodeJ Code = 13 CodeK Code = 14 CodeL Code = 15 CodeM Code = 16 CodeN Code = 17 CodeO Code = 18 CodeP Code = 19 CodeQ Code = 20 CodeR Code = 21 CodeS Code = 22 CodeT Code = 23 CodeU Code = 24 CodeV Code = 25 CodeW Code = 26 CodeX Code = 27 CodeY Code = 28 CodeZ Code = 29 Code1 Code = 30 Code2 Code = 31 Code3 Code = 32 Code4 Code = 33 Code5 Code = 34 Code6 Code = 35 Code7 Code = 36 Code8 Code = 37 Code9 Code = 38 Code0 Code = 39 CodeReturnEnter Code = 40 CodeEscape Code = 41 CodeDeleteBackspace Code = 42 CodeTab Code = 43 CodeSpacebar Code = 44 CodeHyphenMinus Code = 45 // - CodeEqualSign Code = 46 // = CodeLeftSquareBracket Code = 47 // [ CodeRightSquareBracket Code = 48 // ] CodeBackslash Code = 49 // \ CodeSemicolon Code = 51 // ; CodeApostrophe Code = 52 // ' CodeGraveAccent Code = 53 // ` CodeComma Code = 54 // , CodeFullStop Code = 55 // . CodeSlash Code = 56 // / CodeCapsLock Code = 57 CodeF1 Code = 58 CodeF2 Code = 59 CodeF3 Code = 60 CodeF4 Code = 61 CodeF5 Code = 62 CodeF6 Code = 63 CodeF7 Code = 64 CodeF8 Code = 65 CodeF9 Code = 66 CodeF10 Code = 67 CodeF11 Code = 68 CodeF12 Code = 69 CodePause Code = 72 CodeInsert Code = 73 CodeHome Code = 74 CodePageUp Code = 75 CodeDeleteForward Code = 76 CodeEnd Code = 77 CodePageDown Code = 78 CodeRightArrow Code = 79 CodeLeftArrow Code = 80 CodeDownArrow Code = 81 CodeUpArrow Code = 82 CodeKeypadNumLock Code = 83 CodeKeypadSlash Code = 84 // / CodeKeypadAsterisk Code = 85 // * CodeKeypadHyphenMinus Code = 86 // - CodeKeypadPlusSign Code = 87 // + CodeKeypadEnter Code = 88 CodeKeypad1 Code = 89 CodeKeypad2 Code = 90 CodeKeypad3 Code = 91 CodeKeypad4 Code = 92 CodeKeypad5 Code = 93 CodeKeypad6 Code = 94 CodeKeypad7 Code = 95 CodeKeypad8 Code = 96 CodeKeypad9 Code = 97 CodeKeypad0 Code = 98 CodeKeypadFullStop Code = 99 // . CodeKeypadEqualSign Code = 103 // = CodeF13 Code = 104 CodeF14 Code = 105 CodeF15 Code = 106 CodeF16 Code = 107 CodeF17 Code = 108 CodeF18 Code = 109 CodeF19 Code = 110 CodeF20 Code = 111 CodeF21 Code = 112 CodeF22 Code = 113 CodeF23 Code = 114 CodeF24 Code = 115 CodeHelp Code = 117 CodeMute Code = 127 CodeVolumeUp Code = 128 CodeVolumeDown Code = 129 CodeLeftControl Code = 224 CodeLeftShift Code = 225 CodeLeftAlt Code = 226 CodeLeftGUI Code = 227 CodeRightControl Code = 228 CodeRightShift Code = 229 CodeRightAlt Code = 230 CodeRightGUI Code = 231 // The following codes are not part of the standard USB HID Usage IDs for // keyboards. See http://www.usb.org/developers/hidpage/Hut1_12v2.pdf // // Usage IDs are uint16s, so these non-standard values start at 0x10000. // CodeCompose is the Code for a compose key, sometimes called a multi key, // used to input non-ASCII characters such as ñ being composed of n and ~. // // See https://en.wikipedia.org/wiki/Compose_key CodeCompose Code = 0x10000 ) // TODO: Given we use runes outside the unicode space, should we provide a // printing function? Related: it's a little unfortunate that printing a // key.Event with %v gives not very readable output like: // {100 7 key.Modifiers() Press} var mods = [...]struct { m Modifiers s string }{ {ModShift, "Shift"}, {ModControl, "Control"}, {ModAlt, "Alt"}, {ModMeta, "Meta"}, } func (m Modifiers) String() string { var match []string for _, mod := range mods { if mod.m&m != 0 { match = append(match, mod.s) } } return "key.Modifiers(" + strings.Join(match, "|") + ")" } func (d Direction) String() string { switch d { case DirNone: return "None" case DirPress: return "Press" case DirRelease: return "Release" default: return fmt.Sprintf("key.Direction(%d)", d) } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/vendor/modules.txt�����������������������������������������������������������������0000664�0000000�0000000�00000115343�13771713062�0017200�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������# cloud.google.com/go v0.66.0 cloud.google.com/go cloud.google.com/go/compute/metadata cloud.google.com/go/iam cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version # cloud.google.com/go/storage v1.10.0 cloud.google.com/go/storage # github.com/1and1/oneandone-cloudserver-sdk-go v1.0.1 github.com/1and1/oneandone-cloudserver-sdk-go # github.com/Azure/azure-sdk-for-go v40.5.0+incompatible github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute/computeapi github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl github.com/Azure/azure-sdk-for-go/services/keyvault/mgmt/2018-02-14/keyvault github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-02-01/resources github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage github.com/Azure/azure-sdk-for-go/storage github.com/Azure/azure-sdk-for-go/version # github.com/Azure/go-autorest/autorest v0.10.0 github.com/Azure/go-autorest/autorest github.com/Azure/go-autorest/autorest/azure # github.com/Azure/go-autorest/autorest/adal v0.8.2 github.com/Azure/go-autorest/autorest/adal # github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 github.com/Azure/go-autorest/autorest/azure/auth # github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 github.com/Azure/go-autorest/autorest/azure/cli # github.com/Azure/go-autorest/autorest/date v0.2.0 github.com/Azure/go-autorest/autorest/date # github.com/Azure/go-autorest/autorest/to v0.3.0 github.com/Azure/go-autorest/autorest/to # github.com/Azure/go-autorest/autorest/validation v0.2.0 github.com/Azure/go-autorest/autorest/validation # github.com/Azure/go-autorest/logger v0.1.0 github.com/Azure/go-autorest/logger # github.com/Azure/go-autorest/tracing v0.5.0 github.com/Azure/go-autorest/tracing # github.com/Azure/go-ntlmssp v0.0.0-20191115201650-bad6df29494a github.com/Azure/go-ntlmssp # github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 github.com/ChrisTrenkamp/goxpath github.com/ChrisTrenkamp/goxpath/internal/execxp github.com/ChrisTrenkamp/goxpath/internal/execxp/findutil github.com/ChrisTrenkamp/goxpath/internal/execxp/intfns github.com/ChrisTrenkamp/goxpath/internal/xsort github.com/ChrisTrenkamp/goxpath/lexer github.com/ChrisTrenkamp/goxpath/parser github.com/ChrisTrenkamp/goxpath/parser/pathexpr github.com/ChrisTrenkamp/goxpath/tree github.com/ChrisTrenkamp/goxpath/tree/xmltree github.com/ChrisTrenkamp/goxpath/tree/xmltree/xmlbuilder github.com/ChrisTrenkamp/goxpath/tree/xmltree/xmlele github.com/ChrisTrenkamp/goxpath/tree/xmltree/xmlnode github.com/ChrisTrenkamp/goxpath/xconst # github.com/NaverCloudPlatform/ncloud-sdk-go-v2 v1.1.0 github.com/NaverCloudPlatform/ncloud-sdk-go-v2/hmac github.com/NaverCloudPlatform/ncloud-sdk-go-v2/ncloud github.com/NaverCloudPlatform/ncloud-sdk-go-v2/services/server # github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d github.com/StackExchange/wmi # github.com/Telmate/proxmox-api-go v0.0.0-20200715182505-ec97c70ba887 github.com/Telmate/proxmox-api-go/proxmox # github.com/agext/levenshtein v1.2.1 github.com/agext/levenshtein # github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190418113227-25233c783f4e github.com/aliyun/alibaba-cloud-sdk-go/sdk github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials/provider github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers github.com/aliyun/alibaba-cloud-sdk-go/sdk/endpoints github.com/aliyun/alibaba-cloud-sdk-go/sdk/errors github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils github.com/aliyun/alibaba-cloud-sdk-go/services/ecs github.com/aliyun/alibaba-cloud-sdk-go/services/ram # github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20170113022742-e6dbea820a9f github.com/aliyun/aliyun-oss-go-sdk/oss # github.com/antchfx/xpath v0.0.0-20170728053731-b5c552e1acbd github.com/antchfx/xpath # github.com/antchfx/xquery v0.0.0-20170730121040-eb8c3c172607 github.com/antchfx/xquery/xml # github.com/antihax/optional v1.0.0 github.com/antihax/optional # github.com/apparentlymart/go-cidr v1.0.1 github.com/apparentlymart/go-cidr/cidr # github.com/apparentlymart/go-textseg/v12 v12.0.0 github.com/apparentlymart/go-textseg/v12/textseg # github.com/approvals/go-approval-tests v0.0.0-20160714161514-ad96e53bea43 github.com/approvals/go-approval-tests github.com/approvals/go-approval-tests/reporters github.com/approvals/go-approval-tests/utils # github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 github.com/armon/go-metrics # github.com/armon/go-radix v1.0.0 github.com/armon/go-radix # github.com/aws/aws-sdk-go v1.36.0 github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/arn github.com/aws/aws-sdk-go/aws/awserr github.com/aws/aws-sdk-go/aws/awsutil github.com/aws/aws-sdk-go/aws/client github.com/aws/aws-sdk-go/aws/client/metadata github.com/aws/aws-sdk-go/aws/corehandlers github.com/aws/aws-sdk-go/aws/credentials github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds github.com/aws/aws-sdk-go/aws/credentials/endpointcreds github.com/aws/aws-sdk-go/aws/credentials/processcreds github.com/aws/aws-sdk-go/aws/credentials/stscreds github.com/aws/aws-sdk-go/aws/csm github.com/aws/aws-sdk-go/aws/defaults github.com/aws/aws-sdk-go/aws/ec2metadata github.com/aws/aws-sdk-go/aws/endpoints github.com/aws/aws-sdk-go/aws/request github.com/aws/aws-sdk-go/aws/session github.com/aws/aws-sdk-go/aws/signer/v4 github.com/aws/aws-sdk-go/internal/context github.com/aws/aws-sdk-go/internal/ini github.com/aws/aws-sdk-go/internal/s3shared github.com/aws/aws-sdk-go/internal/s3shared/arn github.com/aws/aws-sdk-go/internal/s3shared/s3err github.com/aws/aws-sdk-go/internal/sdkio github.com/aws/aws-sdk-go/internal/sdkmath github.com/aws/aws-sdk-go/internal/sdkrand github.com/aws/aws-sdk-go/internal/sdkuri github.com/aws/aws-sdk-go/internal/shareddefaults github.com/aws/aws-sdk-go/internal/strings github.com/aws/aws-sdk-go/internal/sync/singleflight github.com/aws/aws-sdk-go/private/checksum github.com/aws/aws-sdk-go/private/protocol github.com/aws/aws-sdk-go/private/protocol/ec2query github.com/aws/aws-sdk-go/private/protocol/eventstream github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi github.com/aws/aws-sdk-go/private/protocol/json/jsonutil github.com/aws/aws-sdk-go/private/protocol/jsonrpc github.com/aws/aws-sdk-go/private/protocol/query github.com/aws/aws-sdk-go/private/protocol/query/queryutil github.com/aws/aws-sdk-go/private/protocol/rest github.com/aws/aws-sdk-go/private/protocol/restxml github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil github.com/aws/aws-sdk-go/service/ec2 github.com/aws/aws-sdk-go/service/ec2/ec2iface github.com/aws/aws-sdk-go/service/ecr github.com/aws/aws-sdk-go/service/iam github.com/aws/aws-sdk-go/service/s3 github.com/aws/aws-sdk-go/service/s3/s3iface github.com/aws/aws-sdk-go/service/s3/s3manager github.com/aws/aws-sdk-go/service/secretsmanager github.com/aws/aws-sdk-go/service/secretsmanager/secretsmanageriface github.com/aws/aws-sdk-go/service/ssm github.com/aws/aws-sdk-go/service/ssm/ssmiface github.com/aws/aws-sdk-go/service/sts github.com/aws/aws-sdk-go/service/sts/stsiface # github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d github.com/bgentry/go-netrc/netrc # github.com/bgentry/speakeasy v0.1.0 github.com/bgentry/speakeasy # github.com/biogo/hts v0.0.0-20160420073057-50da7d4131a3 github.com/biogo/hts/bgzf # github.com/bmatcuk/doublestar v1.1.5 github.com/bmatcuk/doublestar # github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee github.com/c2h5oh/datasize # github.com/cheggaaa/pb v1.0.27 github.com/cheggaaa/pb # github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/chzyer/readline # github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew/spew # github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go # github.com/digitalocean/go-libvirt v0.0.0-20190626172931-4d226dd6c437 github.com/digitalocean/go-libvirt github.com/digitalocean/go-libvirt/internal/constants github.com/digitalocean/go-libvirt/internal/go-xdr/xdr2 # github.com/digitalocean/go-qemu v0.0.0-20181112162955-dd7bb9c771b8 github.com/digitalocean/go-qemu/qmp # github.com/digitalocean/godo v1.11.1 github.com/digitalocean/godo # github.com/dimchansky/utfbom v1.1.0 github.com/dimchansky/utfbom # github.com/dylanmei/iso8601 v0.1.0 github.com/dylanmei/iso8601 # github.com/dylanmei/winrmtest v0.0.0-20170819153634-c2fbb09e6c08 github.com/dylanmei/winrmtest # github.com/exoscale/egoscale v0.18.1 github.com/exoscale/egoscale # github.com/fatih/camelcase v1.0.0 github.com/fatih/camelcase # github.com/fatih/color v1.9.0 github.com/fatih/color # github.com/fatih/structtag v1.0.0 github.com/fatih/structtag # github.com/ghodss/yaml v1.0.0 github.com/ghodss/yaml # github.com/go-ini/ini v1.25.4 github.com/go-ini/ini # github.com/go-ole/go-ole v1.2.4 github.com/go-ole/go-ole github.com/go-ole/go-ole/oleutil # github.com/go-resty/resty/v2 v2.3.0 github.com/go-resty/resty/v2 # github.com/gobwas/glob v0.2.3 github.com/gobwas/glob github.com/gobwas/glob/compiler github.com/gobwas/glob/match github.com/gobwas/glob/syntax github.com/gobwas/glob/syntax/ast github.com/gobwas/glob/syntax/lexer github.com/gobwas/glob/util/runes github.com/gobwas/glob/util/strings # github.com/gofrs/flock v0.7.3 github.com/gofrs/flock # github.com/gofrs/uuid v3.2.0+incompatible github.com/gofrs/uuid # github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/golang-collections/collections/stack # github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e github.com/golang/groupcache/lru # github.com/golang/protobuf v1.4.2 github.com/golang/protobuf/internal/gengogrpc github.com/golang/protobuf/jsonpb github.com/golang/protobuf/proto github.com/golang/protobuf/protoc-gen-go github.com/golang/protobuf/protoc-gen-go/descriptor github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/empty github.com/golang/protobuf/ptypes/timestamp github.com/golang/protobuf/ptypes/wrappers # github.com/golang/snappy v0.0.1 github.com/golang/snappy # github.com/google/go-cmp v0.5.2 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/cmpopts github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value # github.com/google/go-querystring v1.0.0 github.com/google/go-querystring/query # github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 github.com/google/shlex # github.com/google/uuid v1.1.1 github.com/google/uuid # github.com/googleapis/gax-go/v2 v2.0.5 github.com/googleapis/gax-go/v2 # github.com/gophercloud/gophercloud v0.12.0 github.com/gophercloud/gophercloud github.com/gophercloud/gophercloud/internal github.com/gophercloud/gophercloud/openstack github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/volumeactions github.com/gophercloud/gophercloud/openstack/blockstorage/v3/volumes github.com/gophercloud/gophercloud/openstack/common/extensions github.com/gophercloud/gophercloud/openstack/compute/v2/extensions github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/attachinterfaces github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/bootfromvolume github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/startstop github.com/gophercloud/gophercloud/openstack/compute/v2/flavors github.com/gophercloud/gophercloud/openstack/compute/v2/servers github.com/gophercloud/gophercloud/openstack/identity/v2/tenants github.com/gophercloud/gophercloud/openstack/identity/v2/tokens github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1 github.com/gophercloud/gophercloud/openstack/identity/v3/tokens github.com/gophercloud/gophercloud/openstack/imageservice/v2/imageimport github.com/gophercloud/gophercloud/openstack/imageservice/v2/images github.com/gophercloud/gophercloud/openstack/imageservice/v2/members github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/external github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips github.com/gophercloud/gophercloud/openstack/networking/v2/networks github.com/gophercloud/gophercloud/openstack/networking/v2/subnets github.com/gophercloud/gophercloud/openstack/utils github.com/gophercloud/gophercloud/pagination # github.com/gophercloud/utils v0.0.0-20200508015959-b0167b94122c github.com/gophercloud/utils/env github.com/gophercloud/utils/openstack/clientconfig github.com/gophercloud/utils/openstack/compute/v2/flavors # github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 github.com/grpc-ecosystem/go-grpc-middleware # github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 github.com/hako/durafmt # github.com/hashicorp/aws-sdk-go-base v0.6.0 github.com/hashicorp/aws-sdk-go-base github.com/hashicorp/aws-sdk-go-base/tfawserr # github.com/hashicorp/consul/api v1.4.0 github.com/hashicorp/consul/api # github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/errwrap # github.com/hashicorp/go-checkpoint v0.0.0-20171009173528-1545e56e46de github.com/hashicorp/go-checkpoint # github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-cleanhttp # github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840 github.com/hashicorp/go-cty-funcs/cidr github.com/hashicorp/go-cty-funcs/collection github.com/hashicorp/go-cty-funcs/crypto github.com/hashicorp/go-cty-funcs/encoding github.com/hashicorp/go-cty-funcs/filesystem github.com/hashicorp/go-cty-funcs/uuid # github.com/hashicorp/go-getter/gcs/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-getter/gcs/v2 # github.com/hashicorp/go-getter/s3/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-getter/s3/v2 # github.com/hashicorp/go-getter/v2 v2.0.0-20200604122502-a6995fa1edad github.com/hashicorp/go-getter/v2 github.com/hashicorp/go-getter/v2/helper/url # github.com/hashicorp/go-hclog v0.12.0 github.com/hashicorp/go-hclog # github.com/hashicorp/go-immutable-radix v1.1.0 github.com/hashicorp/go-immutable-radix # github.com/hashicorp/go-multierror v1.1.0 github.com/hashicorp/go-multierror # github.com/hashicorp/go-oracle-terraform v0.0.0-20181016190316-007121241b79 github.com/hashicorp/go-oracle-terraform/client github.com/hashicorp/go-oracle-terraform/compute github.com/hashicorp/go-oracle-terraform/opc # github.com/hashicorp/go-retryablehttp v0.5.4 github.com/hashicorp/go-retryablehttp # github.com/hashicorp/go-rootcerts v1.0.2 github.com/hashicorp/go-rootcerts # github.com/hashicorp/go-safetemp v1.0.0 github.com/hashicorp/go-safetemp # github.com/hashicorp/go-sockaddr v1.0.2 github.com/hashicorp/go-sockaddr # github.com/hashicorp/go-uuid v1.0.2 github.com/hashicorp/go-uuid # github.com/hashicorp/go-version v1.2.0 github.com/hashicorp/go-version # github.com/hashicorp/golang-lru v0.5.3 github.com/hashicorp/golang-lru/simplelru # github.com/hashicorp/hcl v1.0.0 github.com/hashicorp/hcl github.com/hashicorp/hcl/hcl/ast github.com/hashicorp/hcl/hcl/parser github.com/hashicorp/hcl/hcl/scanner github.com/hashicorp/hcl/hcl/strconv github.com/hashicorp/hcl/hcl/token github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token # github.com/hashicorp/hcl/v2 v2.6.0 github.com/hashicorp/hcl/v2 github.com/hashicorp/hcl/v2/ext/customdecode github.com/hashicorp/hcl/v2/ext/dynblock github.com/hashicorp/hcl/v2/ext/tryfunc github.com/hashicorp/hcl/v2/ext/typeexpr github.com/hashicorp/hcl/v2/gohcl github.com/hashicorp/hcl/v2/hcldec github.com/hashicorp/hcl/v2/hclparse github.com/hashicorp/hcl/v2/hclsyntax github.com/hashicorp/hcl/v2/hclwrite github.com/hashicorp/hcl/v2/json # github.com/hashicorp/serf v0.9.2 github.com/hashicorp/serf/coordinate # github.com/hashicorp/vault/api v1.0.4 github.com/hashicorp/vault/api # github.com/hashicorp/vault/sdk v0.1.13 github.com/hashicorp/vault/sdk/helper/compressutil github.com/hashicorp/vault/sdk/helper/consts github.com/hashicorp/vault/sdk/helper/hclutil github.com/hashicorp/vault/sdk/helper/jsonutil github.com/hashicorp/vault/sdk/helper/parseutil github.com/hashicorp/vault/sdk/helper/strutil # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hashicorp/yamux # github.com/hetznercloud/hcloud-go v1.15.1 github.com/hetznercloud/hcloud-go/hcloud github.com/hetznercloud/hcloud-go/hcloud/schema # github.com/hyperonecom/h1-client-go v0.0.0-20191203060043-b46280e4c4a4 github.com/hyperonecom/h1-client-go # github.com/jdcloud-api/jdcloud-sdk-go v1.9.1-0.20190605102154-3d81a50ca961 github.com/jdcloud-api/jdcloud-sdk-go/core github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models github.com/jdcloud-api/jdcloud-sdk-go/services/common/models github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models github.com/jdcloud-api/jdcloud-sdk-go/services/vm/apis github.com/jdcloud-api/jdcloud-sdk-go/services/vm/client github.com/jdcloud-api/jdcloud-sdk-go/services/vm/models github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/apis github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/client github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models # github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 github.com/jehiah/go-strftime # github.com/jmespath/go-jmespath v0.4.0 github.com/jmespath/go-jmespath # github.com/joyent/triton-go v0.0.0-20180628001255-830d2b111e62 github.com/joyent/triton-go github.com/joyent/triton-go/authentication github.com/joyent/triton-go/client github.com/joyent/triton-go/compute github.com/joyent/triton-go/errors github.com/joyent/triton-go/network # github.com/json-iterator/go v1.1.6 github.com/json-iterator/go # github.com/jstemmer/go-junit-report v0.9.1 github.com/jstemmer/go-junit-report github.com/jstemmer/go-junit-report/formatter github.com/jstemmer/go-junit-report/parser # github.com/klauspost/compress v0.0.0-20160131094358-f86d2e6d8a77 github.com/klauspost/compress/flate # github.com/klauspost/cpuid v0.0.0-20160106104451-349c67577817 github.com/klauspost/cpuid # github.com/klauspost/crc32 v0.0.0-20160114101742-999f3125931f github.com/klauspost/crc32 # github.com/klauspost/pgzip v0.0.0-20151221113845-47f36e165cec github.com/klauspost/pgzip # github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/konsorten/go-windows-terminal-sequences # github.com/kr/fs v0.0.0-20131111012553-2788f0dbd169 github.com/kr/fs # github.com/linode/linodego v0.14.0 github.com/linode/linodego github.com/linode/linodego/internal/duration github.com/linode/linodego/internal/parseabletime # github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 github.com/masterzen/simplexml/dom # github.com/masterzen/winrm v0.0.0-20200615185753-c42b5136ff88 github.com/masterzen/winrm github.com/masterzen/winrm/soap # github.com/mattn/go-colorable v0.1.6 github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.12 github.com/mattn/go-isatty # github.com/mattn/go-runewidth v0.0.4 github.com/mattn/go-runewidth # github.com/mattn/go-tty v0.0.0-20191112051231-74040eebce08 github.com/mattn/go-tty # github.com/mitchellh/cli v1.1.0 github.com/mitchellh/cli # github.com/mitchellh/go-fs v0.0.0-20180402234041-7b48fa161ea7 github.com/mitchellh/go-fs github.com/mitchellh/go-fs/fat # github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-homedir # github.com/mitchellh/go-testing-interface v1.0.3 github.com/mitchellh/go-testing-interface # github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed github.com/mitchellh/go-vnc # github.com/mitchellh/go-wordwrap v1.0.0 github.com/mitchellh/go-wordwrap # github.com/mitchellh/iochan v1.0.0 github.com/mitchellh/iochan # github.com/mitchellh/mapstructure v1.2.3 github.com/mitchellh/mapstructure # github.com/mitchellh/panicwrap v1.0.0 github.com/mitchellh/panicwrap # github.com/mitchellh/prefixedio v0.0.0-20151214002211-6e6954073784 github.com/mitchellh/prefixedio # github.com/mitchellh/reflectwalk v1.0.0 github.com/mitchellh/reflectwalk # github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd github.com/modern-go/concurrent # github.com/modern-go/reflect2 v1.0.1 github.com/modern-go/reflect2 # github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d github.com/nu7hatch/gouuid # github.com/olekukonko/tablewriter v0.0.0-20180105111133-96aac992fc8b github.com/olekukonko/tablewriter # github.com/oracle/oci-go-sdk v18.0.0+incompatible github.com/oracle/oci-go-sdk/common github.com/oracle/oci-go-sdk/common/auth github.com/oracle/oci-go-sdk/core # github.com/outscale/osc-sdk-go/osc v0.0.0-20200722135656-d654809d0699 github.com/outscale/osc-sdk-go/osc # github.com/packer-community/winrmcp v0.0.0-20180921204643-0fd363d6159a github.com/packer-community/winrmcp/winrmcp # github.com/pierrec/lz4 v2.0.5+incompatible github.com/pierrec/lz4 github.com/pierrec/lz4/internal/xxh32 # github.com/pkg/errors v0.9.1 github.com/pkg/errors # github.com/pkg/sftp v0.0.0-20160118190721-e84cc8c755ca github.com/pkg/sftp # github.com/pmezard/go-difflib v1.0.0 github.com/pmezard/go-difflib/difflib # github.com/posener/complete v1.2.3 github.com/posener/complete github.com/posener/complete/cmd github.com/posener/complete/cmd/install # github.com/profitbricks/profitbricks-sdk-go v4.0.2+incompatible github.com/profitbricks/profitbricks-sdk-go # github.com/ryanuber/go-glob v1.0.0 github.com/ryanuber/go-glob # github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid # github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7 github.com/scaleway/scaleway-sdk-go/api/instance/v1 github.com/scaleway/scaleway-sdk-go/api/marketplace/v1 github.com/scaleway/scaleway-sdk-go/internal/async github.com/scaleway/scaleway-sdk-go/internal/auth github.com/scaleway/scaleway-sdk-go/internal/errors github.com/scaleway/scaleway-sdk-go/internal/marshaler github.com/scaleway/scaleway-sdk-go/internal/parameter github.com/scaleway/scaleway-sdk-go/logger github.com/scaleway/scaleway-sdk-go/namegenerator github.com/scaleway/scaleway-sdk-go/scw github.com/scaleway/scaleway-sdk-go/validation # github.com/shirou/gopsutil v2.18.12+incompatible github.com/shirou/gopsutil/cpu github.com/shirou/gopsutil/host github.com/shirou/gopsutil/internal/common github.com/shirou/gopsutil/mem github.com/shirou/gopsutil/net github.com/shirou/gopsutil/process # github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 github.com/shirou/w32 # github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus # github.com/stretchr/testify v1.5.1 github.com/stretchr/testify/assert github.com/stretchr/testify/require # github.com/tencentcloud/tencentcloud-sdk-go v3.0.222+incompatible github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm/v20170312 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312 # github.com/ucloud/ucloud-sdk-go v0.16.3 github.com/ucloud/ucloud-sdk-go/external github.com/ucloud/ucloud-sdk-go/private/protocol/http github.com/ucloud/ucloud-sdk-go/private/utils github.com/ucloud/ucloud-sdk-go/services/uaccount github.com/ucloud/ucloud-sdk-go/services/ufile github.com/ucloud/ucloud-sdk-go/services/uhost github.com/ucloud/ucloud-sdk-go/services/unet github.com/ucloud/ucloud-sdk-go/services/vpc github.com/ucloud/ucloud-sdk-go/ucloud github.com/ucloud/ucloud-sdk-go/ucloud/auth github.com/ucloud/ucloud-sdk-go/ucloud/error github.com/ucloud/ucloud-sdk-go/ucloud/log github.com/ucloud/ucloud-sdk-go/ucloud/metadata github.com/ucloud/ucloud-sdk-go/ucloud/request github.com/ucloud/ucloud-sdk-go/ucloud/response github.com/ucloud/ucloud-sdk-go/ucloud/version # github.com/ufilesdk-dev/ufile-gosdk v0.0.0-20190830075812-b4dbc4ef43a6 github.com/ufilesdk-dev/ufile-gosdk # github.com/ugorji/go v0.0.0-20151218193438-646ae4a518c1 github.com/ugorji/go/codec # github.com/ulikunitz/xz v0.5.5 github.com/ulikunitz/xz github.com/ulikunitz/xz/internal/hash github.com/ulikunitz/xz/internal/xlog github.com/ulikunitz/xz/lzma # github.com/vmware/govmomi v0.23.1 github.com/vmware/govmomi github.com/vmware/govmomi/find github.com/vmware/govmomi/list github.com/vmware/govmomi/nfc github.com/vmware/govmomi/object github.com/vmware/govmomi/ovf github.com/vmware/govmomi/property github.com/vmware/govmomi/session github.com/vmware/govmomi/session/keepalive github.com/vmware/govmomi/simulator github.com/vmware/govmomi/simulator/esx github.com/vmware/govmomi/simulator/internal github.com/vmware/govmomi/simulator/vpx github.com/vmware/govmomi/task github.com/vmware/govmomi/vapi/internal github.com/vmware/govmomi/vapi/library github.com/vmware/govmomi/vapi/rest github.com/vmware/govmomi/vapi/vcenter github.com/vmware/govmomi/vim25 github.com/vmware/govmomi/vim25/debug github.com/vmware/govmomi/vim25/methods github.com/vmware/govmomi/vim25/mo github.com/vmware/govmomi/vim25/progress github.com/vmware/govmomi/vim25/soap github.com/vmware/govmomi/vim25/types github.com/vmware/govmomi/vim25/xml # github.com/xanzy/go-cloudstack v0.0.0-20190526095453-42f262b63ed0 github.com/xanzy/go-cloudstack/cloudstack # github.com/yandex-cloud/go-genproto v0.0.0-20200915125933-33de72a328bd github.com/yandex-cloud/go-genproto/yandex/cloud github.com/yandex-cloud/go-genproto/yandex/cloud/access github.com/yandex-cloud/go-genproto/yandex/cloud/ai/stt/v2 github.com/yandex-cloud/go-genproto/yandex/cloud/ai/translate/v2 github.com/yandex-cloud/go-genproto/yandex/cloud/ai/vision/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/api github.com/yandex-cloud/go-genproto/yandex/cloud/certificatemanager/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/compute/v1/instancegroup github.com/yandex-cloud/go-genproto/yandex/cloud/containerregistry/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/dataproc/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/endpoint github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/iam/v1/awscompatibility github.com/yandex-cloud/go-genproto/yandex/cloud/iot/devices/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/k8s/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/kms/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/loadbalancer/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/marketplace/v1/metering github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/clickhouse/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/clickhouse/v1/config github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/mongodb/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/mongodb/v1/config github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/mysql/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/mysql/v1/config github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/postgresql/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/postgresql/v1/config github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/redis/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/mdb/redis/v1/config github.com/yandex-cloud/go-genproto/yandex/cloud/operation github.com/yandex-cloud/go-genproto/yandex/cloud/reference github.com/yandex-cloud/go-genproto/yandex/cloud/resourcemanager/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/serverless/functions/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/serverless/triggers/v1 github.com/yandex-cloud/go-genproto/yandex/cloud/vpc/v1 # github.com/yandex-cloud/go-sdk v0.0.0-20200921111412-ef15ded2014c github.com/yandex-cloud/go-sdk github.com/yandex-cloud/go-sdk/dial github.com/yandex-cloud/go-sdk/gen/ai/stt github.com/yandex-cloud/go-sdk/gen/ai/translate github.com/yandex-cloud/go-sdk/gen/ai/vision github.com/yandex-cloud/go-sdk/gen/apiendpoint github.com/yandex-cloud/go-sdk/gen/certificatemanager github.com/yandex-cloud/go-sdk/gen/certificatemanagerdata github.com/yandex-cloud/go-sdk/gen/compute github.com/yandex-cloud/go-sdk/gen/compute/instancegroup github.com/yandex-cloud/go-sdk/gen/containerregistry github.com/yandex-cloud/go-sdk/gen/dataproc github.com/yandex-cloud/go-sdk/gen/functions github.com/yandex-cloud/go-sdk/gen/iam github.com/yandex-cloud/go-sdk/gen/iam/awscompatibility github.com/yandex-cloud/go-sdk/gen/iot/devices github.com/yandex-cloud/go-sdk/gen/kms github.com/yandex-cloud/go-sdk/gen/kmscrypto github.com/yandex-cloud/go-sdk/gen/kubernetes github.com/yandex-cloud/go-sdk/gen/loadbalancer github.com/yandex-cloud/go-sdk/gen/marketplace/metering github.com/yandex-cloud/go-sdk/gen/mdb/clickhouse github.com/yandex-cloud/go-sdk/gen/mdb/mongodb github.com/yandex-cloud/go-sdk/gen/mdb/mysql github.com/yandex-cloud/go-sdk/gen/mdb/postgresql github.com/yandex-cloud/go-sdk/gen/mdb/redis github.com/yandex-cloud/go-sdk/gen/operation github.com/yandex-cloud/go-sdk/gen/resourcemanager github.com/yandex-cloud/go-sdk/gen/triggers github.com/yandex-cloud/go-sdk/gen/vpc github.com/yandex-cloud/go-sdk/iamkey github.com/yandex-cloud/go-sdk/operation github.com/yandex-cloud/go-sdk/pkg/grpcclient github.com/yandex-cloud/go-sdk/pkg/requestid github.com/yandex-cloud/go-sdk/pkg/retry github.com/yandex-cloud/go-sdk/pkg/sdkerrors github.com/yandex-cloud/go-sdk/pkg/singleflight github.com/yandex-cloud/go-sdk/sdkresolvers # github.com/zclconf/go-cty v1.4.0 github.com/zclconf/go-cty/cty github.com/zclconf/go-cty/cty/convert github.com/zclconf/go-cty/cty/function github.com/zclconf/go-cty/cty/function/stdlib github.com/zclconf/go-cty/cty/gocty github.com/zclconf/go-cty/cty/json github.com/zclconf/go-cty/cty/set # github.com/zclconf/go-cty-yaml v1.0.1 github.com/zclconf/go-cty-yaml # go.opencensus.io v0.22.4 go.opencensus.io go.opencensus.io/internal go.opencensus.io/internal/tagencoding go.opencensus.io/metric/metricdata go.opencensus.io/metric/metricproducer go.opencensus.io/plugin/ochttp go.opencensus.io/plugin/ochttp/propagation/b3 go.opencensus.io/resource go.opencensus.io/stats go.opencensus.io/stats/internal go.opencensus.io/stats/view go.opencensus.io/tag go.opencensus.io/trace go.opencensus.io/trace/internal go.opencensus.io/trace/propagation go.opencensus.io/trace/tracestate # golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 golang.org/x/crypto/bcrypt golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 golang.org/x/crypto/curve25519 golang.org/x/crypto/ed25519 golang.org/x/crypto/ed25519/internal/edwards25519 golang.org/x/crypto/internal/subtle golang.org/x/crypto/md4 golang.org/x/crypto/pbkdf2 golang.org/x/crypto/pkcs12 golang.org/x/crypto/pkcs12/internal/rc2 golang.org/x/crypto/poly1305 golang.org/x/crypto/ssh golang.org/x/crypto/ssh/agent golang.org/x/crypto/ssh/internal/bcrypt_pbkdf golang.org/x/crypto/ssh/terminal # golang.org/x/lint v0.0.0-20200302205851-738671d3881b golang.org/x/lint golang.org/x/lint/golint # golang.org/x/mobile v0.0.0-20191130191448-5c0e7e404af8 golang.org/x/mobile/event/key # golang.org/x/mod v0.3.0 golang.org/x/mod/module golang.org/x/mod/semver # golang.org/x/net v0.0.0-20201110031124-69a78807bb2b golang.org/x/net/context golang.org/x/net/context/ctxhttp golang.org/x/net/html golang.org/x/net/html/atom golang.org/x/net/html/charset golang.org/x/net/http/httpguts golang.org/x/net/http/httpproxy golang.org/x/net/http2 golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/socks golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/publicsuffix golang.org/x/net/trace golang.org/x/net/websocket # golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 golang.org/x/oauth2 golang.org/x/oauth2/google golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt # golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 golang.org/x/sync/errgroup golang.org/x/sync/semaphore # golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f golang.org/x/sys/cpu golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix golang.org/x/sys/windows # golang.org/x/text v0.3.3 golang.org/x/text/encoding golang.org/x/text/encoding/charmap golang.org/x/text/encoding/htmlindex golang.org/x/text/encoding/internal golang.org/x/text/encoding/internal/identifier golang.org/x/text/encoding/japanese golang.org/x/text/encoding/korean golang.org/x/text/encoding/simplifiedchinese golang.org/x/text/encoding/traditionalchinese golang.org/x/text/encoding/unicode golang.org/x/text/internal/language golang.org/x/text/internal/language/compact golang.org/x/text/internal/tag golang.org/x/text/internal/utf8internal golang.org/x/text/language golang.org/x/text/runes golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm # golang.org/x/time v0.0.0-20191024005414-555d28b269f0 golang.org/x/time/rate # golang.org/x/tools v0.0.0-20201111133315-69daaf961d65 golang.org/x/tools/cmd/goimports golang.org/x/tools/go/ast/astutil golang.org/x/tools/go/gcexportdata golang.org/x/tools/go/internal/gcimporter golang.org/x/tools/go/internal/packagesdriver golang.org/x/tools/go/packages golang.org/x/tools/imports golang.org/x/tools/internal/event golang.org/x/tools/internal/event/core golang.org/x/tools/internal/event/keys golang.org/x/tools/internal/event/label golang.org/x/tools/internal/fastwalk golang.org/x/tools/internal/gocommand golang.org/x/tools/internal/gopathwalk golang.org/x/tools/internal/imports golang.org/x/tools/internal/packagesinternal golang.org/x/tools/internal/typesinternal # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 golang.org/x/xerrors golang.org/x/xerrors/internal # google.golang.org/api v0.32.0 google.golang.org/api/compute/v1 google.golang.org/api/googleapi google.golang.org/api/googleapi/transport google.golang.org/api/internal google.golang.org/api/internal/gensupport google.golang.org/api/internal/impersonate google.golang.org/api/internal/third_party/uritemplates google.golang.org/api/iterator google.golang.org/api/oauth2/v2 google.golang.org/api/option google.golang.org/api/option/internaloption google.golang.org/api/oslogin/v1 google.golang.org/api/storage/v1 google.golang.org/api/transport/cert google.golang.org/api/transport/http google.golang.org/api/transport/http/internal/propagation # google.golang.org/appengine v1.6.6 google.golang.org/appengine google.golang.org/appengine/internal google.golang.org/appengine/internal/app_identity google.golang.org/appengine/internal/base google.golang.org/appengine/internal/datastore google.golang.org/appengine/internal/log google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch # google.golang.org/genproto v0.0.0-20200918140846-d0d605568037 google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/iam/v1 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status google.golang.org/genproto/googleapis/type/dayofweek google.golang.org/genproto/googleapis/type/expr google.golang.org/genproto/googleapis/type/timeofday google.golang.org/genproto/protobuf/field_mask # google.golang.org/grpc v1.32.0 google.golang.org/grpc google.golang.org/grpc/attributes google.golang.org/grpc/backoff google.golang.org/grpc/balancer google.golang.org/grpc/balancer/base google.golang.org/grpc/balancer/grpclb/state google.golang.org/grpc/balancer/roundrobin google.golang.org/grpc/binarylog/grpc_binarylog_v1 google.golang.org/grpc/codes google.golang.org/grpc/connectivity google.golang.org/grpc/credentials google.golang.org/grpc/encoding google.golang.org/grpc/encoding/proto google.golang.org/grpc/grpclog google.golang.org/grpc/internal google.golang.org/grpc/internal/backoff google.golang.org/grpc/internal/balancerload google.golang.org/grpc/internal/binarylog google.golang.org/grpc/internal/buffer google.golang.org/grpc/internal/channelz google.golang.org/grpc/internal/credentials google.golang.org/grpc/internal/envconfig google.golang.org/grpc/internal/grpclog google.golang.org/grpc/internal/grpcrand google.golang.org/grpc/internal/grpcsync google.golang.org/grpc/internal/grpcutil google.golang.org/grpc/internal/resolver/dns google.golang.org/grpc/internal/resolver/passthrough google.golang.org/grpc/internal/serviceconfig google.golang.org/grpc/internal/status google.golang.org/grpc/internal/syscall google.golang.org/grpc/internal/transport google.golang.org/grpc/keepalive google.golang.org/grpc/metadata google.golang.org/grpc/peer google.golang.org/grpc/resolver google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap # google.golang.org/protobuf v1.25.0 google.golang.org/protobuf/cmd/protoc-gen-go/internal_gengo google.golang.org/protobuf/compiler/protogen google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire google.golang.org/protobuf/internal/descfmt google.golang.org/protobuf/internal/descopts google.golang.org/protobuf/internal/detrand google.golang.org/protobuf/internal/encoding/defval google.golang.org/protobuf/internal/encoding/json google.golang.org/protobuf/internal/encoding/messageset google.golang.org/protobuf/internal/encoding/tag google.golang.org/protobuf/internal/encoding/text google.golang.org/protobuf/internal/errors google.golang.org/protobuf/internal/fieldsort google.golang.org/protobuf/internal/filedesc google.golang.org/protobuf/internal/filetype google.golang.org/protobuf/internal/flags google.golang.org/protobuf/internal/genid google.golang.org/protobuf/internal/impl google.golang.org/protobuf/internal/mapsort google.golang.org/protobuf/internal/pragma google.golang.org/protobuf/internal/set google.golang.org/protobuf/internal/strs google.golang.org/protobuf/internal/version google.golang.org/protobuf/proto google.golang.org/protobuf/reflect/protodesc google.golang.org/protobuf/reflect/protoreflect google.golang.org/protobuf/reflect/protoregistry google.golang.org/protobuf/runtime/protoiface google.golang.org/protobuf/runtime/protoimpl google.golang.org/protobuf/types/descriptorpb google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/fieldmaskpb google.golang.org/protobuf/types/known/timestamppb google.golang.org/protobuf/types/known/wrapperspb google.golang.org/protobuf/types/pluginpb # gopkg.in/ini.v1 v1.42.0 gopkg.in/ini.v1 # gopkg.in/square/go-jose.v2 v2.3.1 gopkg.in/square/go-jose.v2 gopkg.in/square/go-jose.v2/cipher gopkg.in/square/go-jose.v2/json gopkg.in/square/go-jose.v2/jwt # gopkg.in/yaml.v2 v2.3.0 gopkg.in/yaml.v2 ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/version/���������������������������������������������������������������������������0000775�0000000�0000000�00000000000�13771713062�0015150�5����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������packer-1.6.6+ds1/version/version.go�����������������������������������������������������������������0000664�0000000�0000000�00000002215�13771713062�0017164�0����������������������������������������������������������������������������������������������������ustar�00root����������������������������root����������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������package version import ( "github.com/hashicorp/go-version" pluginVersion "github.com/hashicorp/packer/packer-plugin-sdk/version" ) // The git commit that was compiled. This will be filled in by the compiler. var GitCommit string // The main version number that is being run at the moment. const Version = "1.6.6" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release // such as "dev" (in development), "beta", "rc1", etc. const VersionPrerelease = "" var PackerVersion *pluginVersion.PluginVersion func FormattedVersion() string { return PackerVersion.FormattedVersion() } // SemVer is an instance of version.Version. This has the secondary // benefit of verifying during tests and init time that our version is a // proper semantic version, which should always be the case. var SemVer *version.Version func init() { PackerVersion = pluginVersion.InitializePluginVersion(Version, VersionPrerelease) SemVer = PackerVersion.SemVer() } // String returns the complete version string, including prerelease func String() string { return PackerVersion.String() } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������